dsh-model-think-level 1.0.3 → 1.0.5

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/lib/client.js CHANGED
@@ -4,7 +4,7 @@ window.__ModuleLoader__.load({
4
4
  var module = { exports: {} };
5
5
  var exports = module.exports;
6
6
 
7
- "use strict";var Rt=Object.defineProperty;var Gs=Object.getOwnPropertyDescriptor;var Vs=Object.getOwnPropertyNames;var $s=Object.prototype.hasOwnProperty;var Ys=(e,t,n)=>t in e?Rt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Js=(e,t)=>{for(var n in t)Rt(e,n,{get:t[n],enumerable:!0})},Xs=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Vs(t))!$s.call(e,o)&&o!==n&&Rt(e,o,{get:()=>t[o],enumerable:!(r=Gs(t,o))||r.enumerable});return e};var Qs=e=>Xs(Rt({},"__esModule",{value:!0}),e);var Dr=(e,t,n)=>Ys(e,typeof t!="symbol"?t+"":t,n);var Pl={};Js(Pl,{EffortEditor:()=>Zt,apply:()=>Dl,baselineModelsOf:()=>Po,compatOf:()=>$t,createEditorApi:()=>Xt,defaultEffortOf:()=>Jt,describeNamespace:()=>ne,effortsOf:()=>Gt,findModelMenu:()=>Mr,findModelTrigger:()=>Sr,inject:()=>Il,inputOf:()=>Vt,name:()=>Nl,nameOf:()=>Yt,providerHeadersOf:()=>Qn,providersOf:()=>xe,userProvidersOf:()=>Xn,writeModelRows:()=>ct,writeProviderHeaders:()=>Zn});module.exports=Qs(Pl);var Os=require("react");var J="dsh-model-think-level",Pr="/dsh-model-think-level/raw-models";var Ot="/dsh-model-think-level/provider-key",Cr="/dsh-model-think-level/key-index",Fr="/dsh-model-think-level/autofill-config",Kr="/dsh-model-think-level/headers-config",re="llm-pi-ai",de="reasoningEffortsUnset",Te="inputUnset",Ge="reasoningEffortsAutofilled",Ve="defaultEffort",An=J;var st=require("react");function qr(e){let{locale:t}=e,n=(0,st.useCallback)(o=>t.subscribe(o),[t]),r=(0,st.useCallback)(()=>t.getSnapshot().revision??0,[t]);return(0,st.useSyncExternalStore)(n,r),e.children()}var Br={reasoningEffort:"Reasoning effort",thinkingMode:"Thinking",thinkingModeOff:"Off \u2014 this model is declared as not reasoning.",autoAdapt:"Auto-adapt",autoAdaptAll:"Auto-detect thinking levels",autoAdaptAllHint:"Adapt every model of this provider at once",apply:"Apply",reset:"Reset",pendingSave:"Modified \u2014 it will be written when you save this card.",pendingHint:"Cancel or reload discards it, exactly like the card's own fields.",appliedHint:"Applied suggestion from {source} \xB7 confidence: {confidence}",inputHintEndpoint:"Modality advice comes from the endpoint listing.",inputHintKnowledge:"Modality advice comes from the knowledge base.",inputHintHeuristic:"Modality guessed from the name alone (low confidence) \u2014 verify.",referenceTitle:"Reference capacities (hints only, never auto-filled)",contextWindowLabel:"Context window",maxTokensLabel:"Max output",inputModality:"Input modalities",modalityImage:"Image input",modalityInherit:"Not declared \u2014 the provider default applies (usually text-only).",clearDeclaration:"Clear declaration",confidence_high:"high",confidence_medium:"medium",confidence_low:"low \u2014 verify before relying on it",noSuggestion:"No suggestion is available for this model.",conflict:"The settings document kept changing under this edit. Wait a moment, then apply again.",writeError:"Failed: {message}",renderFailed:"Reasoning-effort editor failed to render",wirePlaceholder:"Wire value",wireValue:"value",reasoningDisabled:"No reasoning-effort control declared for this model (false) \u2014 do not arm thinking levels.",bareHint:"Clearing every level removes the declaration \u2014 requests go out bare (provider default), which some relays require.",defaultRiskDisabled:"No off level: Default and provider tests send thinking: disabled, which this model rejects (e.g. 1210).",defaultRiskQwen:"No off level: Default sends enable_thinking: false \u2014 only fails where the upstream requires thinking on.",stagedHint:"Not saved yet. Staged settings are applied automatically once the model is saved.",level_off:"off",level_minimal:"minimal",level_low:"low",level_medium:"medium",level_high:"high",level_xhigh:"xhigh",level_max:"max",sliderToggleTitle:"Model and reasoning-effort rows",sliderToggleDescription:"Show the model row and the reasoning-level chips in the model menu; the levels follow the current model.",sliderToggleAria:"Enable the model and reasoning-effort rows",settingOn:"On",settingOff:"Off",sliderEffortAria:"Reasoning effort",sliderNoLevels:"The current model exposes no reasoning-effort levels.",triggerFallback:"Select model",effortDefault:"Default",modelRowLabel:"Model",effortRowLabel:"Reasoning level",tagVision:"Image input",tagThinking:"Sends thinking levels",sliderEffortTitle:"Reasoning effort \xB7 {name}",sliderEffortTitleError:"Reasoning effort failed: {error}",sliderNoCurrent:"No model selected.",compatTitle:"Endpoint compatibility",budgetFieldLabel:"Thinking budget field",budgetFieldHint:"Which parameter carries the thinking-token budget: some vLLM and self-hosted endpoints read thinking_token_budget, others thinking_budget or thinking_budget_tokens. Unset sends none of them.",budgetUnset:"Not set",defaultEffortLabel:"Default effort",defaultEffortUnset:"Follow memory",defaultEffortHint:"The level every new session starts this model at \u2014 it outranks the remembered levels. Within a session, a level you pick by hand always wins. Empty follows the memory chain.",clearDefaultEffort:"Clear pick",priorityLabel:"vLLM priority",priorityPlaceholder:"e.g. 0",priorityHint:"Scheduler priority for endpoints started with --priority, where lower runs first. Leave empty to send nothing.",priorityInvalid:"Priority must be an integer \u2014 it is not saved until fixed.",maxOutputLabel:"max_output_tokens in requests",maxOutputUnset:"Unset \u2014 follow the protocol default",maxOutputOn:"Send it",maxOutputOff:"Omit it",maxOutputHint:'For Responses-protocol gateways only, and only when a request carries an output cap: some of them reject the parameter, so "Omit it" keeps the cap out of the request entirely. Unset is the safe choice.',aliasMigrated:"Legacy alias detected \u2014 saving writes the explicit budget field.",modelSearchPlaceholder:"Search models\u2026",modelSearchNoMatches:"No matching models",modelSearchClear:"Clear search",modelSearchFailed:"Model search failed to render",editorTabsLabel:"Editor sections",editorTabProvider:"Provider",editorTabModels:"Models",editorTabAdvanced:"Advanced",keyRevealShow:"Show key",keyRevealHide:"Hide key",keyRevealFailed:"Stored key unavailable",keysLoading:"Loading keys\u2026",keysAdd:"Add another key",keysAddConfirm:"Add",keysEnable:"Use {name}",keysEnabled:"Enabled",keysMissing:"Not stored",keysEdit:"Edit",keysRemove:"Delete",keysConfirmRemove:"Confirm delete",keysCancel:"Cancel",keysSave:"Save",keysAlias:"Label",keysAliasPlaceholder:"Name (optional), e.g. Team",keysValue:"Key",keysValuePlaceholder:"Paste the API key",keysNewValuePlaceholder:"Paste the new API key",keysAddIllegal:"A key is printable ASCII without spaces.",keysAdded:"Key stored.",keysRenamed:"Label saved.",keysReplaced:"Key replaced.",keysRemoved:"Key removed.",keysEnabledNote:"{name} is now in use.",keysUnreachable:"The plugin\u2019s key route did not answer.",keysPanelFailed:"Key manager failed to render",headersTitle:"Request headers",headersHint:"Sent on every request of this route, the model-listing probe included \u2014 add any gateway, routing, metering, or authentication header here.",headersEmpty:"No extra request headers are configured.",headersAdd:"Add header",headersName:"Name",headersNamePlaceholder:"e.g. x-company",headersValue:"Value",headersEdit:"Edit",headersSave:"Save",headersCancel:"Cancel",headersClear:"Clear all",headersSaved:"Saved.",headersCleared:"Cleared \u2014 this route sends no extra request headers.",headersReadOnly:"The settings document is not writable.",headersUserAgentTitle:"User-Agent (taken over at the fetch layer)",headersUserAgentHint:"The official adapter discards a configured user-agent \u2014 the name is reserved for client attribution \u2014 so this plugin adds it at the request layer. Filling it in really does replace the outgoing User-Agent.",headersUserAgentClear:"Do not override",headersUserAgentPlaceholder:"e.g. claude-cli/2.1.161 (external, cli)",headersConflictOrigin:"Routes sharing one endpoint declare different request-header values: when the model in a request body does not identify exactly one of them, that request falls back to the first route.",headersConflictPatched:"The installed dsh-llm-pi-ai already carries a request-header patch: enter values in the headers above and this plugin need not take the request layer over.",headersConflictSiblings:"A plugin rewriting the same layer is installed: {names}. Only one user-agent rewrite should be active at a time, or the last writer on the wire wins.",headersError:"Save failed: {error}",headersNoRoute:"This route is no longer in the settings document \u2014 save the official card once first.",providerReorderAria:"Reorder {provider}",providerReorderHint:"Drag to set the provider order \u2014 the model switcher follows it.",providerToggleAria:"Enable {provider}",providerToggleHint:"A disabled provider is not listed by the model switcher.",providerRemoveDisabled:"Delete",providerRemoveLocked:"A built-in provider cannot be deleted.",modelReorderAria:"Reorder {model}",modelReorderHint:"Drag to set the order of this provider\u2019s models \u2014 the model switcher follows it."},Wr={reasoningEffort:"\u601D\u8003\u5F3A\u5EA6",thinkingMode:"\u601D\u8003",thinkingModeOff:"\u5DF2\u5173\u95ED\u2014\u2014\u8BE5\u6A21\u578B\u58F0\u660E\u4E3A\u4E0D\u601D\u8003\u3002",autoAdapt:"\u81EA\u52A8\u9002\u914D",autoAdaptAll:"\u81EA\u52A8\u83B7\u53D6\u601D\u8003\u7B49\u7EA7",autoAdaptAllHint:"\u5C06\u8BE5\u4F9B\u5E94\u5546\u4E0B\u6240\u6709\u6A21\u578B\u81EA\u52A8\u9002\u914D\u601D\u8003\u7B49\u7EA7",apply:"\u5E94\u7528",reset:"\u653E\u5F03\u4FEE\u6539",pendingSave:"\u5DF2\u4FEE\u6539\u2014\u2014\u70B9\u5361\u7247\u300C\u4FDD\u5B58\u300D\u65F6\u4E00\u8D77\u5199\u5165\u3002",pendingHint:"\u70B9\u300C\u53D6\u6D88\u300D\u6216\u5237\u65B0\u9875\u9762\u4F1A\u4E00\u5E76\u4E22\u5F03\uFF0C\u4E0E\u5361\u7247\u81EA\u8EAB\u7684\u5B57\u6BB5\u4E00\u81F4\u3002",appliedHint:"\u5DF2\u6309 {source} \u5E94\u7528\u5EFA\u8BAE \xB7 \u7F6E\u4FE1\u5EA6\uFF1A{confidence}",inputHintEndpoint:"\u6A21\u6001\u5EFA\u8BAE\u6765\u81EA\u7AEF\u70B9\u5217\u8868\u3002",inputHintKnowledge:"\u6A21\u6001\u5EFA\u8BAE\u6765\u81EA\u77E5\u8BC6\u5E93\u3002",inputHintHeuristic:"\u6A21\u6001\u5EFA\u8BAE\u4EC5\u6309\u547D\u540D\u63A8\u65AD\uFF08\u4F4E\u7F6E\u4FE1\u5EA6\uFF09\uFF0C\u8BF7\u6838\u5BF9\u3002",referenceTitle:"\u53C2\u8003\u5BB9\u91CF\uFF08\u4EC5\u63D0\u793A\uFF0C\u4E0D\u81EA\u52A8\u586B\u5145\uFF09",contextWindowLabel:"\u4E0A\u4E0B\u6587\u7A97\u53E3",maxTokensLabel:"\u6700\u5927\u8F93\u51FA",inputModality:"\u8F93\u5165\u6A21\u6001",modalityImage:"\u56FE\u7247\u8F93\u5165",modalityInherit:"\u672A\u58F0\u660E\u2014\u2014\u7EE7\u627F\u63D0\u4F9B\u65B9\u9ED8\u8BA4\uFF08\u901A\u5E38\u4EC5\u6587\u672C\uFF09\u3002",clearDeclaration:"\u6E05\u9664\u58F0\u660E",confidence_high:"\u9AD8",confidence_medium:"\u4E2D",confidence_low:"\u4F4E\uFF08\u5EFA\u8BAE\u6838\u5BF9\uFF09",noSuggestion:"\u6CA1\u6709\u9002\u7528\u4E8E\u8BE5\u6A21\u578B\u7684\u5EFA\u8BAE\u3002",conflict:"\u8BBE\u7F6E\u6587\u6863\u5728\u4FDD\u5B58\u671F\u95F4\u6301\u7EED\u53D8\u5316\uFF0C\u8BF7\u7A0D\u5019\u518D\u6B21\u5E94\u7528\u3002",writeError:"\u5199\u5165\u5931\u8D25\uFF1A{message}",renderFailed:"\u601D\u8003\u5F3A\u5EA6\u7F16\u8F91\u5668\u6E32\u67D3\u5931\u8D25",wirePlaceholder:"\u7EBF\u4E0A\u53D6\u503C",wireValue:"\u53D6\u503C",reasoningDisabled:"\u8BE5\u6A21\u578B\u58F0\u660E\u4E3A\u65E0 reasoning-effort \u63A7\u5236\uFF08false\uFF09\u2014\u2014\u8BF7\u52FF\u52FE\u9009\u601D\u8003\u6863\u3002",bareHint:"\u5168\u90E8\u53D6\u6D88\u5E76\u4FDD\u5B58\u5C06\u6E05\u9664\u58F0\u660E\u2014\u2014\u8BF7\u6C42\u4EE5\u88F8\u683C\u5F0F\u53D1\u51FA\uFF08\u8D70\u63D0\u4F9B\u65B9\u9ED8\u8BA4\uFF09\uFF0C\u90E8\u5206\u4E2D\u8F6C\u7AD9\u9700\u8981\u8FD9\u6837\u3002",defaultRiskDisabled:"\u65E0 off \u6863\uFF1ADefault \u4E0E\u63D0\u4F9B\u5546\u6D4B\u8BD5\u4F1A\u53D1\u9001 thinking: disabled\uFF0C\u8BE5\u6A21\u578B\u4F1A\u62A5\u9519\uFF08\u5982 1210\uFF09\u3002",defaultRiskQwen:"\u65E0 off \u6863\uFF1ADefault \u4F1A\u53D1\u9001 enable_thinking: false\u2014\u2014\u4EC5\u5728\u4E0A\u6E38\u8981\u6C42\u5F00\u542F\u601D\u8003\u65F6\u624D\u4F1A\u5931\u8D25\u3002",stagedHint:"\u5C1A\u672A\u4FDD\u5B58\u3002\u6682\u5B58\u7684\u914D\u7F6E\u5C06\u5728\u8BE5\u6A21\u578B\u4FDD\u5B58\u540E\u81EA\u52A8\u5E94\u7528\u3002",level_off:"off",level_minimal:"minimal",level_low:"low",level_medium:"medium",level_high:"high",level_xhigh:"xhigh",level_max:"max",sliderToggleTitle:"\u6A21\u578B\u4E0E\u601D\u8003\u7B49\u7EA7\u884C",sliderToggleDescription:"\u5728\u6A21\u578B\u83DC\u5355\u4E2D\u663E\u793A\u6A21\u578B\u884C\u4E0E\u601D\u8003\u7B49\u7EA7\u6807\u7B7E\uFF0C\u6863\u4F4D\u968F\u5F53\u524D\u6A21\u578B\u81EA\u52A8\u9002\u914D",sliderToggleAria:"\u542F\u7528\u6A21\u578B\u4E0E\u601D\u8003\u7B49\u7EA7\u884C",settingOn:"\u542F\u7528",settingOff:"\u505C\u7528",sliderEffortAria:"\u601D\u8003\u5F3A\u5EA6",sliderNoLevels:"\u5F53\u524D\u6A21\u578B\u672A\u63D0\u4F9B\u601D\u8003\u5F3A\u5EA6\u6863\u4F4D",triggerFallback:"\u9009\u62E9\u6A21\u578B",effortDefault:"\u9ED8\u8BA4",modelRowLabel:"\u6A21\u578B",effortRowLabel:"\u601D\u8003\u7B49\u7EA7",tagVision:"\u652F\u6301\u56FE\u7247\u8F93\u5165",tagThinking:"\u652F\u6301\u601D\u8003\u7B49\u7EA7",sliderEffortTitle:"\u601D\u8003\u5F3A\u5EA6 \xB7 {name}",sliderEffortTitleError:"\u601D\u8003\u5F3A\u5EA6\u8BBE\u7F6E\u5931\u8D25\uFF1A{error}",sliderNoCurrent:"\u5F53\u524D\u65E0\u9009\u62E9\u4E2D\u7684\u6A21\u578B\u3002",compatTitle:"\u7AEF\u70B9\u517C\u5BB9",budgetFieldLabel:"\u601D\u8003\u9884\u7B97\u5B57\u6BB5",budgetFieldHint:"\u601D\u8003 token \u9884\u7B97\u7528\u54EA\u4E2A\u53C2\u6570\u53D1\u9001\uFF1A\u90E8\u5206 vLLM\uFF0F\u81EA\u5EFA\u7AEF\u70B9\u8BFB thinking_token_budget\uFF0C\u53E6\u4E00\u4E9B\u8BFB thinking_budget \u6216 thinking_budget_tokens\u3002\u672A\u8BBE\u7F6E\u8868\u793A\u4E09\u4E2A\u90FD\u4E0D\u53D1\u9001\u3002",budgetUnset:"\u672A\u8BBE\u7F6E",defaultEffortLabel:"\u9ED8\u8BA4\u601D\u8003\u5F3A\u5EA6",defaultEffortUnset:"\u8DDF\u968F\u8BB0\u5FC6",defaultEffortHint:"\u6BCF\u4E2A\u65B0\u4F1A\u8BDD\u6253\u5F00\u8BE5\u6A21\u578B\u65F6\u4F7F\u7528\u7684\u6863\u4F4D\u2014\u2014\u4F18\u5148\u4E8E\u8BB0\u4F4F\u7684\u4E0A\u6B21\u6863\u4F4D\u3002\u4F1A\u8BDD\u5185\u624B\u52A8\u9009\u62E9\u7684\u6863\u4F4D\u59CB\u7EC8\u6700\u9AD8\u3002\u7559\u7A7A\u5219\u8DDF\u968F\u8BB0\u5FC6\u94FE\u3002",clearDefaultEffort:"\u6E05\u9664\u9009\u62E9",priorityLabel:"vLLM \u4F18\u5148\u7EA7",priorityPlaceholder:"\u4F8B\u5982 0",priorityHint:"\u4EE5 --priority \u542F\u52A8\u7684\u7AEF\u70B9\u7684\u8C03\u5EA6\u4F18\u5148\u7EA7\uFF0C\u6570\u503C\u8D8A\u5C0F\u8D8A\u5148\u6267\u884C\u3002\u7559\u7A7A\u8868\u793A\u4E0D\u53D1\u9001\u3002",priorityInvalid:"\u4F18\u5148\u7EA7\u5FC5\u987B\u662F\u6574\u6570\u2014\u2014\u4FEE\u6B63\u524D\u4E0D\u4F1A\u4FDD\u5B58\u3002",maxOutputLabel:"\u8BF7\u6C42\u4E2D\u7684 max_output_tokens",maxOutputUnset:"\u672A\u8BBE\u7F6E\u2014\u2014\u8DDF\u968F\u534F\u8BAE\u9ED8\u8BA4",maxOutputOn:"\u53D1\u9001",maxOutputOff:"\u4E0D\u53D1\u9001",maxOutputHint:'\u4EC5\u5BF9 Responses \u534F\u8BAE\u7684\u7F51\u5173\u751F\u6548\uFF0C\u4E14\u53EA\u5728\u8BF7\u6C42\u5E26\u8F93\u51FA\u4E0A\u9650\u65F6\u624D\u8D77\u4F5C\u7528\uFF1A\u90E8\u5206\u7F51\u5173\u4F1A\u62D2\u6536\u8BE5\u53C2\u6570\uFF0C\u9009"\u4E0D\u53D1\u9001"\u53EF\u8BA9\u8BF7\u6C42\u5B8C\u5168\u4E0D\u643A\u5E26\u8F93\u51FA\u4E0A\u9650\u3002\u672A\u8BBE\u7F6E\u662F\u6700\u5B89\u5168\u7684\u9009\u62E9\u3002',aliasMigrated:"\u68C0\u6D4B\u5230\u65E7\u522B\u540D\u2014\u2014\u4FDD\u5B58\u65F6\u4F1A\u5199\u5165\u663E\u5F0F\u9884\u7B97\u5B57\u6BB5\u3002",modelSearchPlaceholder:"\u641C\u7D22\u6A21\u578B\u2026",modelSearchNoMatches:"\u672A\u627E\u5230\u5339\u914D\u6A21\u578B",modelSearchClear:"\u6E05\u7A7A\u641C\u7D22",modelSearchFailed:"\u6A21\u578B\u641C\u7D22\u6E32\u67D3\u5931\u8D25",editorTabsLabel:"\u7F16\u8F91\u5668\u5206\u533A",editorTabProvider:"\u4F9B\u5E94\u5546\u914D\u7F6E",editorTabModels:"\u6A21\u578B\u914D\u7F6E",editorTabAdvanced:"\u9AD8\u7EA7\u914D\u7F6E",keyRevealShow:"\u663E\u793A\u5BC6\u94A5",keyRevealHide:"\u9690\u85CF\u5BC6\u94A5",keyRevealFailed:"\u65E0\u6CD5\u8BFB\u53D6\u5DF2\u4FDD\u5B58\u7684\u5BC6\u94A5",keysLoading:"\u6B63\u5728\u8BFB\u53D6\u5BC6\u94A5\u2026",keysAdd:"\u6DFB\u52A0\u53E6\u4E00\u4E2A\u5BC6\u94A5",keysAddConfirm:"\u6DFB\u52A0",keysEnable:"\u542F\u7528 {name}",keysEnabled:"\u542F\u7528",keysMissing:"\u672A\u5B58\u50A8",keysEdit:"\u4FEE\u6539",keysRemove:"\u5220\u9664",keysConfirmRemove:"\u786E\u8BA4\u5220\u9664",keysCancel:"\u53D6\u6D88",keysSave:"\u4FDD\u5B58",keysAlias:"\u522B\u540D",keysAliasPlaceholder:"\u540D\u79F0\uFF08\u53EF\u9009\uFF09\uFF0C\u4F8B\u5982 \u56E2\u961F",keysValue:"\u5BC6\u94A5",keysValuePlaceholder:"\u7C98\u8D34 API \u5BC6\u94A5",keysNewValuePlaceholder:"\u7C98\u8D34\u65B0\u7684 API \u5BC6\u94A5",keysAddIllegal:"\u5BC6\u94A5\u53EA\u80FD\u662F\u53EF\u6253\u5370 ASCII \u5B57\u7B26\uFF0C\u4E14\u4E0D\u80FD\u5305\u542B\u7A7A\u683C\u3002",keysAdded:"\u5DF2\u4FDD\u5B58\u5BC6\u94A5\u3002",keysRenamed:"\u5DF2\u4FDD\u5B58\u522B\u540D\u3002",keysReplaced:"\u5DF2\u66FF\u6362\u5BC6\u94A5\u3002",keysRemoved:"\u5DF2\u5220\u9664\u5BC6\u94A5\u3002",keysEnabledNote:"\u5DF2\u542F\u7528 {name}\u3002",keysUnreachable:"\u63D2\u4EF6\u7684\u5BC6\u94A5\u63A5\u53E3\u6CA1\u6709\u54CD\u5E94\u3002",keysPanelFailed:"\u5BC6\u94A5\u7BA1\u7406\u9762\u677F\u6E32\u67D3\u5931\u8D25",headersTitle:"\u8BF7\u6C42\u5934",headersHint:"\u8BE5\u8DEF\u7531\u7684\u6BCF\u4E2A\u8BF7\u6C42\u90FD\u4F1A\u643A\u5E26\uFF08\u8BC6\u522B\u6A21\u578B\u5217\u8868\u7684\u63A2\u6D4B\u8BF7\u6C42\u4E5F\u5305\u62EC\uFF09\uFF1A\u4E2D\u8F6C\u7AD9\u7684\u8DEF\u7531\u3001\u8BA1\u91CF\u3001\u8BA4\u8BC1\u7B49\u4EFB\u610F\u8BF7\u6C42\u5934\u90FD\u53EF\u4EE5\u5199\u5728\u8FD9\u91CC\u3002",headersEmpty:"\u5C1A\u672A\u914D\u7F6E\u989D\u5916\u8BF7\u6C42\u5934\u3002",headersAdd:"\u6DFB\u52A0\u8BF7\u6C42\u5934",headersName:"\u540D\u79F0",headersNamePlaceholder:"\u4F8B\u5982 x-company",headersValue:"\u503C",headersEdit:"\u7F16\u8F91",headersSave:"\u4FDD\u5B58",headersCancel:"\u53D6\u6D88",headersClear:"\u5168\u90E8\u6E05\u7A7A",headersSaved:"\u5DF2\u4FDD\u5B58\u3002",headersCleared:"\u5DF2\u6E05\u7A7A\u2014\u2014\u8BE5\u8DEF\u7531\u4E0D\u518D\u643A\u5E26\u989D\u5916\u8BF7\u6C42\u5934\u3002",headersReadOnly:"\u5F53\u524D\u8BBE\u7F6E\u6587\u6863\u4E0D\u53EF\u5199\u5165\u3002",headersUserAgentTitle:"User-Agent\uFF08\u7531\u63D2\u4EF6\u5728\u8BF7\u6C42\u5C42\u63A5\u7BA1\uFF09",headersUserAgentHint:"\u5B98\u65B9\u9002\u914D\u5668\u4F1A\u4E22\u5F03\u914D\u7F6E\u7684 user-agent\uFF08\u8BE5\u540D\u79F0\u4FDD\u7559\u7ED9\u5BA2\u6237\u7AEF\u5F52\u5C5E\u6807\u8BC6\uFF09\uFF0C\u6240\u4EE5\u7531\u63D2\u4EF6\u5728\u8BF7\u6C42\u5C42\u8865\u4E0A\u3002\u586B\u4E86\u5C31\u4F1A\u771F\u6B63\u66FF\u6362\u4E0A\u884C\u8BF7\u6C42\u5934\u91CC\u7684 User-Agent\u3002",headersUserAgentClear:"\u4E0D\u8986\u76D6",headersUserAgentPlaceholder:"\u4F8B\u5982 claude-cli/2.1.161 (external, cli)",headersConflictOrigin:"\u540C\u4E00\u4E2A endpoint \u4E0A\u6709\u591A\u4E2A\u8DEF\u7531\u914D\u7F6E\u4E86\u4E0D\u540C\u7684\u8BF7\u6C42\u5934\u503C\uFF1A\u5F53\u8BF7\u6C42\u4F53\u91CC\u7684\u6A21\u578B\u65E0\u6CD5\u552F\u4E00\u5B9A\u4F4D\u5176\u4E2D\u4E00\u4E2A\u8DEF\u7531\u65F6\uFF0C\u8BE5\u8BF7\u6C42\u56DE\u9000\u5230\u7B2C\u4E00\u4E2A\u8DEF\u7531\u7684\u914D\u7F6E\u3002",headersConflictPatched:"\u68C0\u6D4B\u5230\u5B98\u65B9 dsh-llm-pi-ai \u5DF2\u5728\u8BF7\u6C42\u5C42\u5904\u7406\u8BF7\u6C42\u5934\uFF1A\u628A\u503C\u586B\u5728\u4E0A\u65B9\u8BF7\u6C42\u5934\u914D\u7F6E\u4E2D\u5373\u53EF\uFF0C\u65E0\u9700\u91CD\u590D\u63A5\u7BA1\u3002",headersConflictSiblings:"\u68C0\u6D4B\u5230\u4F1A\u6539\u5199\u540C\u4E00\u5C42\u7684\u540C\u7C7B\u63D2\u4EF6\uFF1A{names}\u3002\u540C\u4E00\u65F6\u95F4\u53EA\u5E94\u542F\u7528\u4E00\u79CD\u8BF7\u6C42\u5934\u6539\u5199\uFF0C\u5426\u5219\u7EBF\u4E0A\u751F\u6548\u7684\u662F\u6700\u540E\u5199\u5165\u8005\u3002",headersError:"\u4FDD\u5B58\u5931\u8D25\uFF1A{error}",headersNoRoute:"\u8BE5\u8DEF\u7531\u5DF2\u4E0D\u5728\u8BBE\u7F6E\u6587\u6863\u4E2D\u2014\u2014\u8BF7\u5148\u4FDD\u5B58\u4E00\u6B21\u5B98\u65B9\u5361\u7247\u3002",providerReorderAria:"\u62D6\u52A8\u6392\u5E8F\uFF1A{provider}",providerReorderHint:"\u62D6\u52A8\u8C03\u6574\u4F9B\u5E94\u5546\u987A\u5E8F\u2014\u2014\u6A21\u578B\u5207\u6362\u6309\u6B64\u987A\u5E8F\u663E\u793A\u3002",providerToggleAria:"\u542F\u7528 {provider}",providerToggleHint:"\u7981\u7528\u540E\u8BE5\u4F9B\u5E94\u5546\u4E0D\u5728\u6A21\u578B\u5207\u6362\u5217\u8868\u4E2D\u663E\u793A\u3002",providerRemoveDisabled:"\u5220\u9664",providerRemoveLocked:"\u5185\u7F6E\u4F9B\u5E94\u5546\u4E0D\u53EF\u5220\u9664\u3002",modelReorderAria:"\u62D6\u52A8\u6392\u5E8F\uFF1A{model}",modelReorderHint:"\u62D6\u52A8\u8C03\u6574\u8BE5\u4F9B\u5E94\u5546\u5185\u6A21\u578B\u987A\u5E8F\u2014\u2014\u6A21\u578B\u5207\u6362\u6309\u6B64\u987A\u5E8F\u663E\u793A\u3002"};var Ht="dsh-model-think-level.slider.enabled",Zs=["dsh-reasoning-effort.enabled","@dsh-external/dsh-reasoning-effort.enabled"],at=ea();function ea(){try{let e=window.localStorage.getItem(Ht),t=e===null?Zs.map(n=>window.localStorage.getItem(n)).find(n=>n!==null):null;return(e??t??null)!=="false"}catch{return!0}}var Rn=new Set;function Ur(){for(let e of[...Rn])e()}function le(){return at}function jr(e){if(at!==e){at=e;try{window.localStorage.setItem(Ht,String(e))}catch{}Ur()}}function zr(e){at!==e&&(at=e,Ur())}function _t(e){return Rn.add(e),()=>{Rn.delete(e)}}var Nt="dsh-model-think-level.provider-order",Gr=["deepseek-account","deepseek-official"];function Ye(e){if(e===null)return[];try{let t=JSON.parse(e);return Array.isArray(t)?Hn(t.filter(n=>typeof n=="string")):[]}catch{return[]}}function Hn(e){let t=new Set,n=[];for(let r of e)r.length===0||t.has(r)||(t.add(r),n.push(r));return n}var $e=(()=>{try{return Ye(window.localStorage.getItem(Nt))}catch{return[]}})(),On=new Set;function Vr(){for(let e of[...On])e()}function $r(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function _n(){return $e}function Yr(e){let t=Hn(e);if(!$r($e,t)){$e=t;try{window.localStorage.setItem(Nt,JSON.stringify($e))}catch{}Vr()}}function Jr(e){let t=Hn(e);$r($e,t)||($e=t,Vr())}function It(e){return On.add(e),()=>{On.delete(e)}}function Nn(e){let t=n=>{let r=Gr.indexOf(n);return r<0?Gr.length:r};return e.map((n,r)=>({id:n,index:r,rank:t(n)})).sort((n,r)=>n.rank-r.rank||n.index-r.index).map(n=>n.id)}function Je(e,t){let n=new Map;for(let i of t)n.has(i)||n.set(i,n.size);let r=[],o=[];e.forEach((i,s)=>{n.has(i)&&(r.push(s),o.push(i))}),o.sort((i,s)=>n.get(i)-n.get(s));let a=[...e];return r.forEach((i,s)=>{a[i]=o[s]}),a}function Xr(e){return Je(Nn(e),_n())}function In(e,t,n){let r=e.indexOf(t);if(r<0)return[...e];let o=[...e];o.splice(r,1);let a=Math.max(0,Math.min(o.length,n));return o.splice(a,0,t),o}var Dt="dsh-model-think-level.providers.disabled",Dn=new Set,Me=ta();function ta(){try{return Ye(window.localStorage.getItem(Dt))}catch{return[]}}function Qr(e){return Ye(e)}function Zr(){return Me}function Pt(e){return!Me.includes(e)}function eo(e,t){let n=!Me.includes(e);t!==n&&no(t?Me.filter(r=>r!==e):[...Me,e],!0)}function to(e){no(e,!1)}function Ct(e){return Dn.add(e),()=>{Dn.delete(e)}}function na(e,t){return e.length!==t.length?!1:e.every(n=>t.includes(n))}function no(e,t){if(!na(Me,e)){if(Me=[...new Set(e)],t)try{window.localStorage.setItem(Dt,JSON.stringify(Me))}catch{}for(let n of[...Dn])n()}}var Ft="dsh-model-think-level.model-order";function Cn(e){if(e===null)return{};try{let t=JSON.parse(e);if(t===null||typeof t!="object"||Array.isArray(t))return{};let n={};for(let[r,o]of Object.entries(t)){if(r.length===0||!Array.isArray(o))continue;let a=ro(o.filter(i=>typeof i=="string"));a.length>0&&(n[r]=a)}return n}catch{return{}}}function ro(e){let t=new Set,n=[];for(let r of e)r.length===0||t.has(r)||(t.add(r),n.push(r));return n}var Ie=(()=>{try{return Cn(window.localStorage.getItem(Ft))}catch{return{}}})(),Pn=new Set;function oo(){for(let e of[...Pn])e()}function ra(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function oa(){try{window.localStorage.setItem(Ft,JSON.stringify(Ie))}catch{}}function io(){return Ie}function Fn(e){return Ie[e]??ia}var ia=[];function so(e,t){if(e.length===0)return;let n=ro(t),r=Fn(e);if(ra(r,n)&&(n.length>0||!(e in Ie)))return;let o={...Ie};n.length===0?delete o[e]:o[e]=n,Ie=o,oa(),oo()}function ao(e){Ie=e,oo()}function Kt(e){return Pn.add(e),()=>{Pn.delete(e)}}function sa(e,t){return Je(e,t)}function lo(e,t){return Je(t,Fn(e))}function fo(e,t){if(e.length===0||t.length===0)return e;let n=new Map(e.map(r=>[r.id,r]));return sa(e.map(r=>r.id),t).map(r=>n.get(r))}var uo=`
7
+ "use strict";var Ot=Object.defineProperty;var ta=Object.getOwnPropertyDescriptor;var na=Object.getOwnPropertyNames;var ra=Object.prototype.hasOwnProperty;var oa=(e,t,n)=>t in e?Ot(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ia=(e,t)=>{for(var n in t)Ot(e,n,{get:t[n],enumerable:!0})},sa=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of na(t))!ra.call(e,o)&&o!==n&&Ot(e,o,{get:()=>t[o],enumerable:!(r=ta(t,o))||r.enumerable});return e};var aa=e=>sa(Ot({},"__esModule",{value:!0}),e);var Br=(e,t,n)=>oa(e,typeof t!="symbol"?t+"":t,n);var Xl={};ia(Xl,{EffortEditor:()=>en,apply:()=>Jl,baselineModelsOf:()=>Wo,compatOf:()=>Yt,createEditorApi:()=>Qt,defaultEffortOf:()=>Xt,describeNamespace:()=>ne,effortsOf:()=>$t,findModelMenu:()=>Rr,findModelTrigger:()=>Or,inject:()=>Yl,inputOf:()=>Vt,name:()=>Vl,nameOf:()=>Jt,providerHeadersOf:()=>Zn,providersOf:()=>we,userProvidersOf:()=>Qn,writeModelRows:()=>mt,writeProviderHeaders:()=>er});module.exports=aa(Xl);var Ks=require("react");var J="dsh-model-think-level",Wr="/dsh-model-think-level/raw-models";var Ht="/dsh-model-think-level/provider-key",Ur="/dsh-model-think-level/key-index",jr="/dsh-model-think-level/autofill-config",zr="/dsh-model-think-level/headers-config",re="llm-pi-ai",se="reasoningEffortsUnset",Me="inputUnset",Ye="reasoningEffortsAutofilled",Je="defaultEffort",Rn=J;var dt=require("react");function Gr(e){let{locale:t}=e,n=(0,dt.useCallback)(o=>t.subscribe(o),[t]),r=(0,dt.useCallback)(()=>t.getSnapshot().revision??0,[t]);return(0,dt.useSyncExternalStore)(n,r),e.children()}var $r={reasoningEffort:"Reasoning effort",thinkingMode:"Thinking",thinkingModeOff:"Off \u2014 this model is declared as not reasoning.",autoAdapt:"Auto-adapt",autoAdaptAll:"Auto-detect thinking levels",autoAdaptWorking:"Detecting\u2026",autoAdaptDone:"Adapted {count} \xB7 save to write",autoAdaptEmpty:"All already configured",autoAdaptUnsuggested:"No suggestion available",autoAdaptBlocked:"No models to adapt yet",autoAdaptFailed:"Detection failed: {message}",autoAdaptDoneHint:"Held for {count} model(s): they land when this card is saved.",autoAdaptEmptyHint:"Every model of this provider already declares its thinking levels.",autoAdaptUnsuggestedHint:"The models that still need a declaration have no knowledge-base match \u2014 adapt them one by one.",autoAdaptBlockedHint:"Nothing to adapt yet: the card has no models, is not saved, or the settings document is read-only.",apply:"Apply",reset:"Reset",pendingSave:"Modified \u2014 it will be written when you save this card.",pendingHint:"Cancel or reload discards it, exactly like the card's own fields.",appliedHint:"Applied suggestion from {source} \xB7 confidence: {confidence}",inputHintEndpoint:"Modality advice comes from the endpoint listing.",inputHintKnowledge:"Modality advice comes from the knowledge base.",inputHintHeuristic:"Modality guessed from the name alone (low confidence) \u2014 verify.",referenceTitle:"Reference capacities (hints only, never auto-filled)",contextWindowLabel:"Context window",maxTokensLabel:"Max output",inputModality:"Input modalities",modalityImage:"Image input",modalityInherit:"Not declared \u2014 the provider default applies (usually text-only).",clearDeclaration:"Clear declaration",confidence_high:"high",confidence_medium:"medium",confidence_low:"low \u2014 verify before relying on it",noSuggestion:"No suggestion is available for this model.",conflict:"The settings document kept changing under this edit. Wait a moment, then apply again.",writeError:"Failed: {message}",renderFailed:"Reasoning-effort editor failed to render",wirePlaceholder:"Wire value",wireValue:"value",reasoningDisabled:"No reasoning-effort control declared for this model (false) \u2014 do not arm thinking levels.",bareHint:"Clearing every level removes the declaration \u2014 requests go out bare (provider default), which some relays require.",defaultRiskDisabled:"No off level: Default and provider tests send thinking: disabled, which this model rejects (e.g. 1210).",defaultRiskQwen:"No off level: Default sends enable_thinking: false \u2014 only fails where the upstream requires thinking on.",stagedHint:"Not saved yet. Staged settings are applied automatically once the model is saved.",level_off:"off",level_minimal:"minimal",level_low:"low",level_medium:"medium",level_high:"high",level_xhigh:"xhigh",level_max:"max",sliderToggleTitle:"Model and reasoning-effort rows",sliderToggleDescription:"Show the model row and the reasoning-level chips in the model menu; the levels follow the current model.",sliderToggleAria:"Enable the model and reasoning-effort rows",settingOn:"On",settingOff:"Off",sliderEffortAria:"Reasoning effort",sliderNoLevels:"The current model exposes no reasoning-effort levels.",triggerFallback:"Select model",effortDefault:"Default",modelRowLabel:"Model",effortRowLabel:"Reasoning level",tagVision:"Image input",tagThinking:"Sends thinking levels",sliderEffortTitle:"Reasoning effort \xB7 {name}",sliderEffortTitleError:"Reasoning effort failed: {error}",sliderNoCurrent:"No model selected.",compatTitle:"Endpoint compatibility",budgetFieldLabel:"Thinking budget field",budgetFieldHint:"Which parameter carries the thinking-token budget: some vLLM and self-hosted endpoints read thinking_token_budget, others thinking_budget or thinking_budget_tokens. Unset sends none of them.",budgetUnset:"Not set",defaultEffortLabel:"Default effort",defaultEffortUnset:"Follow memory",defaultEffortHint:"The level every new session starts this model at \u2014 it outranks the remembered levels. Within a session, a level you pick by hand always wins. Empty follows the memory chain.",clearDefaultEffort:"Clear pick",priorityLabel:"vLLM priority",priorityPlaceholder:"e.g. 0",priorityHint:"Scheduler priority for endpoints started with --priority, where lower runs first. Leave empty to send nothing.",priorityInvalid:"Priority must be an integer \u2014 it is not saved until fixed.",maxOutputLabel:"max_output_tokens in requests",maxOutputUnset:"Unset \u2014 follow the protocol default",maxOutputOn:"Send it",maxOutputOff:"Omit it",maxOutputHint:'For Responses-protocol gateways only, and only when a request carries an output cap: some of them reject the parameter, so "Omit it" keeps the cap out of the request entirely. Unset is the safe choice.',aliasMigrated:"Legacy alias detected \u2014 saving writes the explicit budget field.",modelSearchPlaceholder:"Search models\u2026",modelSearchNoMatches:"No matching models",modelSearchClear:"Clear search",modelSearchFailed:"Model search failed to render",editorTabsLabel:"Editor sections",editorTabProvider:"Provider",editorTabModels:"Models",editorTabAdvanced:"Advanced",keyRevealShow:"Show key",keyRevealHide:"Hide key",keyRevealFailed:"Stored key unavailable",keysLoading:"Loading keys\u2026",keysAdd:"Add another key",keysAddConfirm:"Add",keysEnable:"Use {name}",keysEnabled:"Enabled",keysMissing:"Not stored",keysEdit:"Edit",keysRemove:"Delete",keysConfirmRemove:"Confirm delete",keysCancel:"Cancel",keysSave:"Save",keysAlias:"Label",keysAliasPlaceholder:"Name (optional), e.g. Team",keysValue:"Key",keysValuePlaceholder:"Paste the API key",keysNewValuePlaceholder:"Paste the new API key",keysAddIllegal:"A key is printable ASCII without spaces.",keysAdded:"Key stored.",keysRenamed:"Label saved.",keysReplaced:"Key replaced.",keysRemoved:"Key removed.",keysEnabledNote:"{name} is now in use.",keysUnreachable:"The plugin\u2019s key route did not answer.",keysPanelFailed:"Key manager failed to render",headersTitle:"Request headers",headersHint:"Sent on every request of this route, the model-listing probe included \u2014 add any gateway, routing, metering, or authentication header here.",headersEmpty:"No extra request headers are configured.",headersAdd:"Add header",headersName:"Name",headersNamePlaceholder:"e.g. x-company",headersValue:"Value",headersEdit:"Edit",headersSave:"Save",headersCancel:"Cancel",headersClear:"Clear all",headersSaved:"Saved.",headersCleared:"Cleared \u2014 this route sends no extra request headers.",headersReadOnly:"The settings document is not writable.",headersUserAgentTitle:"User-Agent (taken over at the fetch layer)",headersUserAgentHint:"The official adapter discards a configured user-agent \u2014 the name is reserved for client attribution \u2014 so this plugin adds it at the request layer. Filling it in really does replace the outgoing User-Agent.",headersUserAgentClear:"Do not override",headersUserAgentPlaceholder:"e.g. claude-cli/2.1.161 (external, cli)",headersConflictOrigin:"Routes sharing one endpoint declare different request-header values: when the model in a request body does not identify exactly one of them, that request falls back to the first route.",headersConflictPatched:"The installed dsh-llm-pi-ai already carries a request-header patch: enter values in the headers above and this plugin need not take the request layer over.",headersConflictSiblings:"A plugin rewriting the same layer is installed: {names}. Only one user-agent rewrite should be active at a time, or the last writer on the wire wins.",headersError:"Save failed: {error}",headersNoRoute:"This route is no longer in the settings document \u2014 save the official card once first.",providerReorderAria:"Reorder {provider}",providerReorderHint:"Drag to set the provider order \u2014 the model switcher follows it.",providerToggleAria:"Enable {provider}",providerToggleHint:"A disabled provider is not listed by the model switcher.",providerRemoveDisabled:"Delete",providerRemoveLocked:"A built-in provider cannot be deleted.",modelReorderAria:"Reorder {model}",modelReorderHint:"Drag to set the order of this provider\u2019s models \u2014 the model switcher follows it."},Vr={reasoningEffort:"\u601D\u8003\u5F3A\u5EA6",thinkingMode:"\u601D\u8003",thinkingModeOff:"\u5DF2\u5173\u95ED\u2014\u2014\u8BE5\u6A21\u578B\u58F0\u660E\u4E3A\u4E0D\u601D\u8003\u3002",autoAdapt:"\u81EA\u52A8\u9002\u914D",autoAdaptAll:"\u81EA\u52A8\u83B7\u53D6\u601D\u8003\u7B49\u7EA7",autoAdaptWorking:"\u83B7\u53D6\u4E2D\u2026",autoAdaptDone:"\u5DF2\u9002\u914D {count} \u4E2A\xB7\u4FDD\u5B58\u540E\u5199\u5165",autoAdaptEmpty:"\u5DF2\u5168\u90E8\u914D\u7F6E",autoAdaptUnsuggested:"\u6CA1\u6709\u53EF\u7528\u5EFA\u8BAE",autoAdaptBlocked:"\u6682\u65E0\u53EF\u9002\u914D\u6A21\u578B",autoAdaptFailed:"\u83B7\u53D6\u5931\u8D25\uFF1A{message}",autoAdaptDoneHint:"\u5DF2\u6682\u5B58 {count} \u4E2A\u6A21\u578B\u7684\u9002\u914D\u7ED3\u679C\uFF1A\u70B9\u8BE5\u5361\u7247\u7684\u300C\u4FDD\u5B58\u300D\u540E\u5199\u5165\u3002",autoAdaptEmptyHint:"\u8BE5\u4F9B\u5E94\u5546\u4E0B\u6240\u6709\u6A21\u578B\u90FD\u5DF2\u58F0\u660E\u601D\u8003\u7B49\u7EA7\u3002",autoAdaptUnsuggestedHint:"\u4ECD\u9700\u58F0\u660E\u7684\u6A21\u578B\u6CA1\u6709\u77E5\u8BC6\u5E93\u5339\u914D\u2014\u2014\u8BF7\u9010\u4E2A\u6253\u5F00\u6A21\u578B\u884C\u624B\u52A8\u9002\u914D\u3002",autoAdaptBlockedHint:"\u6682\u65E0\u53EF\u9002\u914D\u5185\u5BB9\uFF1A\u8BE5\u5361\u7247\u8FD8\u6CA1\u6709\u6A21\u578B\u3001\u5C1A\u672A\u4FDD\u5B58\uFF0C\u6216\u5F53\u524D\u8BBE\u7F6E\u6587\u6863\u4E0D\u53EF\u5199\u5165\u3002",apply:"\u5E94\u7528",reset:"\u653E\u5F03\u4FEE\u6539",pendingSave:"\u5DF2\u4FEE\u6539\u2014\u2014\u70B9\u5361\u7247\u300C\u4FDD\u5B58\u300D\u65F6\u4E00\u8D77\u5199\u5165\u3002",pendingHint:"\u70B9\u300C\u53D6\u6D88\u300D\u6216\u5237\u65B0\u9875\u9762\u4F1A\u4E00\u5E76\u4E22\u5F03\uFF0C\u4E0E\u5361\u7247\u81EA\u8EAB\u7684\u5B57\u6BB5\u4E00\u81F4\u3002",appliedHint:"\u5DF2\u6309 {source} \u5E94\u7528\u5EFA\u8BAE \xB7 \u7F6E\u4FE1\u5EA6\uFF1A{confidence}",inputHintEndpoint:"\u6A21\u6001\u5EFA\u8BAE\u6765\u81EA\u7AEF\u70B9\u5217\u8868\u3002",inputHintKnowledge:"\u6A21\u6001\u5EFA\u8BAE\u6765\u81EA\u77E5\u8BC6\u5E93\u3002",inputHintHeuristic:"\u6A21\u6001\u5EFA\u8BAE\u4EC5\u6309\u547D\u540D\u63A8\u65AD\uFF08\u4F4E\u7F6E\u4FE1\u5EA6\uFF09\uFF0C\u8BF7\u6838\u5BF9\u3002",referenceTitle:"\u53C2\u8003\u5BB9\u91CF\uFF08\u4EC5\u63D0\u793A\uFF0C\u4E0D\u81EA\u52A8\u586B\u5145\uFF09",contextWindowLabel:"\u4E0A\u4E0B\u6587\u7A97\u53E3",maxTokensLabel:"\u6700\u5927\u8F93\u51FA",inputModality:"\u8F93\u5165\u6A21\u6001",modalityImage:"\u56FE\u7247\u8F93\u5165",modalityInherit:"\u672A\u58F0\u660E\u2014\u2014\u7EE7\u627F\u63D0\u4F9B\u65B9\u9ED8\u8BA4\uFF08\u901A\u5E38\u4EC5\u6587\u672C\uFF09\u3002",clearDeclaration:"\u6E05\u9664\u58F0\u660E",confidence_high:"\u9AD8",confidence_medium:"\u4E2D",confidence_low:"\u4F4E\uFF08\u5EFA\u8BAE\u6838\u5BF9\uFF09",noSuggestion:"\u6CA1\u6709\u9002\u7528\u4E8E\u8BE5\u6A21\u578B\u7684\u5EFA\u8BAE\u3002",conflict:"\u8BBE\u7F6E\u6587\u6863\u5728\u4FDD\u5B58\u671F\u95F4\u6301\u7EED\u53D8\u5316\uFF0C\u8BF7\u7A0D\u5019\u518D\u6B21\u5E94\u7528\u3002",writeError:"\u5199\u5165\u5931\u8D25\uFF1A{message}",renderFailed:"\u601D\u8003\u5F3A\u5EA6\u7F16\u8F91\u5668\u6E32\u67D3\u5931\u8D25",wirePlaceholder:"\u7EBF\u4E0A\u53D6\u503C",wireValue:"\u53D6\u503C",reasoningDisabled:"\u8BE5\u6A21\u578B\u58F0\u660E\u4E3A\u65E0 reasoning-effort \u63A7\u5236\uFF08false\uFF09\u2014\u2014\u8BF7\u52FF\u52FE\u9009\u601D\u8003\u6863\u3002",bareHint:"\u5168\u90E8\u53D6\u6D88\u5E76\u4FDD\u5B58\u5C06\u6E05\u9664\u58F0\u660E\u2014\u2014\u8BF7\u6C42\u4EE5\u88F8\u683C\u5F0F\u53D1\u51FA\uFF08\u8D70\u63D0\u4F9B\u65B9\u9ED8\u8BA4\uFF09\uFF0C\u90E8\u5206\u4E2D\u8F6C\u7AD9\u9700\u8981\u8FD9\u6837\u3002",defaultRiskDisabled:"\u65E0 off \u6863\uFF1ADefault \u4E0E\u63D0\u4F9B\u5546\u6D4B\u8BD5\u4F1A\u53D1\u9001 thinking: disabled\uFF0C\u8BE5\u6A21\u578B\u4F1A\u62A5\u9519\uFF08\u5982 1210\uFF09\u3002",defaultRiskQwen:"\u65E0 off \u6863\uFF1ADefault \u4F1A\u53D1\u9001 enable_thinking: false\u2014\u2014\u4EC5\u5728\u4E0A\u6E38\u8981\u6C42\u5F00\u542F\u601D\u8003\u65F6\u624D\u4F1A\u5931\u8D25\u3002",stagedHint:"\u5C1A\u672A\u4FDD\u5B58\u3002\u6682\u5B58\u7684\u914D\u7F6E\u5C06\u5728\u8BE5\u6A21\u578B\u4FDD\u5B58\u540E\u81EA\u52A8\u5E94\u7528\u3002",level_off:"off",level_minimal:"minimal",level_low:"low",level_medium:"medium",level_high:"high",level_xhigh:"xhigh",level_max:"max",sliderToggleTitle:"\u6A21\u578B\u4E0E\u601D\u8003\u7B49\u7EA7\u884C",sliderToggleDescription:"\u5728\u6A21\u578B\u83DC\u5355\u4E2D\u663E\u793A\u6A21\u578B\u884C\u4E0E\u601D\u8003\u7B49\u7EA7\u6807\u7B7E\uFF0C\u6863\u4F4D\u968F\u5F53\u524D\u6A21\u578B\u81EA\u52A8\u9002\u914D",sliderToggleAria:"\u542F\u7528\u6A21\u578B\u4E0E\u601D\u8003\u7B49\u7EA7\u884C",settingOn:"\u542F\u7528",settingOff:"\u505C\u7528",sliderEffortAria:"\u601D\u8003\u5F3A\u5EA6",sliderNoLevels:"\u5F53\u524D\u6A21\u578B\u672A\u63D0\u4F9B\u601D\u8003\u5F3A\u5EA6\u6863\u4F4D",triggerFallback:"\u9009\u62E9\u6A21\u578B",effortDefault:"\u9ED8\u8BA4",modelRowLabel:"\u6A21\u578B",effortRowLabel:"\u601D\u8003\u7B49\u7EA7",tagVision:"\u652F\u6301\u56FE\u7247\u8F93\u5165",tagThinking:"\u652F\u6301\u601D\u8003\u7B49\u7EA7",sliderEffortTitle:"\u601D\u8003\u5F3A\u5EA6 \xB7 {name}",sliderEffortTitleError:"\u601D\u8003\u5F3A\u5EA6\u8BBE\u7F6E\u5931\u8D25\uFF1A{error}",sliderNoCurrent:"\u5F53\u524D\u65E0\u9009\u62E9\u4E2D\u7684\u6A21\u578B\u3002",compatTitle:"\u7AEF\u70B9\u517C\u5BB9",budgetFieldLabel:"\u601D\u8003\u9884\u7B97\u5B57\u6BB5",budgetFieldHint:"\u601D\u8003 token \u9884\u7B97\u7528\u54EA\u4E2A\u53C2\u6570\u53D1\u9001\uFF1A\u90E8\u5206 vLLM\uFF0F\u81EA\u5EFA\u7AEF\u70B9\u8BFB thinking_token_budget\uFF0C\u53E6\u4E00\u4E9B\u8BFB thinking_budget \u6216 thinking_budget_tokens\u3002\u672A\u8BBE\u7F6E\u8868\u793A\u4E09\u4E2A\u90FD\u4E0D\u53D1\u9001\u3002",budgetUnset:"\u672A\u8BBE\u7F6E",defaultEffortLabel:"\u9ED8\u8BA4\u601D\u8003\u5F3A\u5EA6",defaultEffortUnset:"\u8DDF\u968F\u8BB0\u5FC6",defaultEffortHint:"\u6BCF\u4E2A\u65B0\u4F1A\u8BDD\u6253\u5F00\u8BE5\u6A21\u578B\u65F6\u4F7F\u7528\u7684\u6863\u4F4D\u2014\u2014\u4F18\u5148\u4E8E\u8BB0\u4F4F\u7684\u4E0A\u6B21\u6863\u4F4D\u3002\u4F1A\u8BDD\u5185\u624B\u52A8\u9009\u62E9\u7684\u6863\u4F4D\u59CB\u7EC8\u6700\u9AD8\u3002\u7559\u7A7A\u5219\u8DDF\u968F\u8BB0\u5FC6\u94FE\u3002",clearDefaultEffort:"\u6E05\u9664\u9009\u62E9",priorityLabel:"vLLM \u4F18\u5148\u7EA7",priorityPlaceholder:"\u4F8B\u5982 0",priorityHint:"\u4EE5 --priority \u542F\u52A8\u7684\u7AEF\u70B9\u7684\u8C03\u5EA6\u4F18\u5148\u7EA7\uFF0C\u6570\u503C\u8D8A\u5C0F\u8D8A\u5148\u6267\u884C\u3002\u7559\u7A7A\u8868\u793A\u4E0D\u53D1\u9001\u3002",priorityInvalid:"\u4F18\u5148\u7EA7\u5FC5\u987B\u662F\u6574\u6570\u2014\u2014\u4FEE\u6B63\u524D\u4E0D\u4F1A\u4FDD\u5B58\u3002",maxOutputLabel:"\u8BF7\u6C42\u4E2D\u7684 max_output_tokens",maxOutputUnset:"\u672A\u8BBE\u7F6E\u2014\u2014\u8DDF\u968F\u534F\u8BAE\u9ED8\u8BA4",maxOutputOn:"\u53D1\u9001",maxOutputOff:"\u4E0D\u53D1\u9001",maxOutputHint:'\u4EC5\u5BF9 Responses \u534F\u8BAE\u7684\u7F51\u5173\u751F\u6548\uFF0C\u4E14\u53EA\u5728\u8BF7\u6C42\u5E26\u8F93\u51FA\u4E0A\u9650\u65F6\u624D\u8D77\u4F5C\u7528\uFF1A\u90E8\u5206\u7F51\u5173\u4F1A\u62D2\u6536\u8BE5\u53C2\u6570\uFF0C\u9009"\u4E0D\u53D1\u9001"\u53EF\u8BA9\u8BF7\u6C42\u5B8C\u5168\u4E0D\u643A\u5E26\u8F93\u51FA\u4E0A\u9650\u3002\u672A\u8BBE\u7F6E\u662F\u6700\u5B89\u5168\u7684\u9009\u62E9\u3002',aliasMigrated:"\u68C0\u6D4B\u5230\u65E7\u522B\u540D\u2014\u2014\u4FDD\u5B58\u65F6\u4F1A\u5199\u5165\u663E\u5F0F\u9884\u7B97\u5B57\u6BB5\u3002",modelSearchPlaceholder:"\u641C\u7D22\u6A21\u578B\u2026",modelSearchNoMatches:"\u672A\u627E\u5230\u5339\u914D\u6A21\u578B",modelSearchClear:"\u6E05\u7A7A\u641C\u7D22",modelSearchFailed:"\u6A21\u578B\u641C\u7D22\u6E32\u67D3\u5931\u8D25",editorTabsLabel:"\u7F16\u8F91\u5668\u5206\u533A",editorTabProvider:"\u4F9B\u5E94\u5546\u914D\u7F6E",editorTabModels:"\u6A21\u578B\u914D\u7F6E",editorTabAdvanced:"\u9AD8\u7EA7\u914D\u7F6E",keyRevealShow:"\u663E\u793A\u5BC6\u94A5",keyRevealHide:"\u9690\u85CF\u5BC6\u94A5",keyRevealFailed:"\u65E0\u6CD5\u8BFB\u53D6\u5DF2\u4FDD\u5B58\u7684\u5BC6\u94A5",keysLoading:"\u6B63\u5728\u8BFB\u53D6\u5BC6\u94A5\u2026",keysAdd:"\u6DFB\u52A0\u53E6\u4E00\u4E2A\u5BC6\u94A5",keysAddConfirm:"\u6DFB\u52A0",keysEnable:"\u542F\u7528 {name}",keysEnabled:"\u542F\u7528",keysMissing:"\u672A\u5B58\u50A8",keysEdit:"\u4FEE\u6539",keysRemove:"\u5220\u9664",keysConfirmRemove:"\u786E\u8BA4\u5220\u9664",keysCancel:"\u53D6\u6D88",keysSave:"\u4FDD\u5B58",keysAlias:"\u522B\u540D",keysAliasPlaceholder:"\u540D\u79F0\uFF08\u53EF\u9009\uFF09\uFF0C\u4F8B\u5982 \u56E2\u961F",keysValue:"\u5BC6\u94A5",keysValuePlaceholder:"\u7C98\u8D34 API \u5BC6\u94A5",keysNewValuePlaceholder:"\u7C98\u8D34\u65B0\u7684 API \u5BC6\u94A5",keysAddIllegal:"\u5BC6\u94A5\u53EA\u80FD\u662F\u53EF\u6253\u5370 ASCII \u5B57\u7B26\uFF0C\u4E14\u4E0D\u80FD\u5305\u542B\u7A7A\u683C\u3002",keysAdded:"\u5DF2\u4FDD\u5B58\u5BC6\u94A5\u3002",keysRenamed:"\u5DF2\u4FDD\u5B58\u522B\u540D\u3002",keysReplaced:"\u5DF2\u66FF\u6362\u5BC6\u94A5\u3002",keysRemoved:"\u5DF2\u5220\u9664\u5BC6\u94A5\u3002",keysEnabledNote:"\u5DF2\u542F\u7528 {name}\u3002",keysUnreachable:"\u63D2\u4EF6\u7684\u5BC6\u94A5\u63A5\u53E3\u6CA1\u6709\u54CD\u5E94\u3002",keysPanelFailed:"\u5BC6\u94A5\u7BA1\u7406\u9762\u677F\u6E32\u67D3\u5931\u8D25",headersTitle:"\u8BF7\u6C42\u5934",headersHint:"\u8BE5\u8DEF\u7531\u7684\u6BCF\u4E2A\u8BF7\u6C42\u90FD\u4F1A\u643A\u5E26\uFF08\u8BC6\u522B\u6A21\u578B\u5217\u8868\u7684\u63A2\u6D4B\u8BF7\u6C42\u4E5F\u5305\u62EC\uFF09\uFF1A\u4E2D\u8F6C\u7AD9\u7684\u8DEF\u7531\u3001\u8BA1\u91CF\u3001\u8BA4\u8BC1\u7B49\u4EFB\u610F\u8BF7\u6C42\u5934\u90FD\u53EF\u4EE5\u5199\u5728\u8FD9\u91CC\u3002",headersEmpty:"\u5C1A\u672A\u914D\u7F6E\u989D\u5916\u8BF7\u6C42\u5934\u3002",headersAdd:"\u6DFB\u52A0\u8BF7\u6C42\u5934",headersName:"\u540D\u79F0",headersNamePlaceholder:"\u4F8B\u5982 x-company",headersValue:"\u503C",headersEdit:"\u7F16\u8F91",headersSave:"\u4FDD\u5B58",headersCancel:"\u53D6\u6D88",headersClear:"\u5168\u90E8\u6E05\u7A7A",headersSaved:"\u5DF2\u4FDD\u5B58\u3002",headersCleared:"\u5DF2\u6E05\u7A7A\u2014\u2014\u8BE5\u8DEF\u7531\u4E0D\u518D\u643A\u5E26\u989D\u5916\u8BF7\u6C42\u5934\u3002",headersReadOnly:"\u5F53\u524D\u8BBE\u7F6E\u6587\u6863\u4E0D\u53EF\u5199\u5165\u3002",headersUserAgentTitle:"User-Agent\uFF08\u7531\u63D2\u4EF6\u5728\u8BF7\u6C42\u5C42\u63A5\u7BA1\uFF09",headersUserAgentHint:"\u5B98\u65B9\u9002\u914D\u5668\u4F1A\u4E22\u5F03\u914D\u7F6E\u7684 user-agent\uFF08\u8BE5\u540D\u79F0\u4FDD\u7559\u7ED9\u5BA2\u6237\u7AEF\u5F52\u5C5E\u6807\u8BC6\uFF09\uFF0C\u6240\u4EE5\u7531\u63D2\u4EF6\u5728\u8BF7\u6C42\u5C42\u8865\u4E0A\u3002\u586B\u4E86\u5C31\u4F1A\u771F\u6B63\u66FF\u6362\u4E0A\u884C\u8BF7\u6C42\u5934\u91CC\u7684 User-Agent\u3002",headersUserAgentClear:"\u4E0D\u8986\u76D6",headersUserAgentPlaceholder:"\u4F8B\u5982 claude-cli/2.1.161 (external, cli)",headersConflictOrigin:"\u540C\u4E00\u4E2A endpoint \u4E0A\u6709\u591A\u4E2A\u8DEF\u7531\u914D\u7F6E\u4E86\u4E0D\u540C\u7684\u8BF7\u6C42\u5934\u503C\uFF1A\u5F53\u8BF7\u6C42\u4F53\u91CC\u7684\u6A21\u578B\u65E0\u6CD5\u552F\u4E00\u5B9A\u4F4D\u5176\u4E2D\u4E00\u4E2A\u8DEF\u7531\u65F6\uFF0C\u8BE5\u8BF7\u6C42\u56DE\u9000\u5230\u7B2C\u4E00\u4E2A\u8DEF\u7531\u7684\u914D\u7F6E\u3002",headersConflictPatched:"\u68C0\u6D4B\u5230\u5B98\u65B9 dsh-llm-pi-ai \u5DF2\u5728\u8BF7\u6C42\u5C42\u5904\u7406\u8BF7\u6C42\u5934\uFF1A\u628A\u503C\u586B\u5728\u4E0A\u65B9\u8BF7\u6C42\u5934\u914D\u7F6E\u4E2D\u5373\u53EF\uFF0C\u65E0\u9700\u91CD\u590D\u63A5\u7BA1\u3002",headersConflictSiblings:"\u68C0\u6D4B\u5230\u4F1A\u6539\u5199\u540C\u4E00\u5C42\u7684\u540C\u7C7B\u63D2\u4EF6\uFF1A{names}\u3002\u540C\u4E00\u65F6\u95F4\u53EA\u5E94\u542F\u7528\u4E00\u79CD\u8BF7\u6C42\u5934\u6539\u5199\uFF0C\u5426\u5219\u7EBF\u4E0A\u751F\u6548\u7684\u662F\u6700\u540E\u5199\u5165\u8005\u3002",headersError:"\u4FDD\u5B58\u5931\u8D25\uFF1A{error}",headersNoRoute:"\u8BE5\u8DEF\u7531\u5DF2\u4E0D\u5728\u8BBE\u7F6E\u6587\u6863\u4E2D\u2014\u2014\u8BF7\u5148\u4FDD\u5B58\u4E00\u6B21\u5B98\u65B9\u5361\u7247\u3002",providerReorderAria:"\u62D6\u52A8\u6392\u5E8F\uFF1A{provider}",providerReorderHint:"\u62D6\u52A8\u8C03\u6574\u4F9B\u5E94\u5546\u987A\u5E8F\u2014\u2014\u6A21\u578B\u5207\u6362\u6309\u6B64\u987A\u5E8F\u663E\u793A\u3002",providerToggleAria:"\u542F\u7528 {provider}",providerToggleHint:"\u7981\u7528\u540E\u8BE5\u4F9B\u5E94\u5546\u4E0D\u5728\u6A21\u578B\u5207\u6362\u5217\u8868\u4E2D\u663E\u793A\u3002",providerRemoveDisabled:"\u5220\u9664",providerRemoveLocked:"\u5185\u7F6E\u4F9B\u5E94\u5546\u4E0D\u53EF\u5220\u9664\u3002",modelReorderAria:"\u62D6\u52A8\u6392\u5E8F\uFF1A{model}",modelReorderHint:"\u62D6\u52A8\u8C03\u6574\u8BE5\u4F9B\u5E94\u5546\u5185\u6A21\u578B\u987A\u5E8F\u2014\u2014\u6A21\u578B\u5207\u6362\u6309\u6B64\u987A\u5E8F\u663E\u793A\u3002"};var Nt="dsh-model-think-level.slider.enabled",da=["dsh-reasoning-effort.enabled","@dsh-external/dsh-reasoning-effort.enabled"],lt=la();function la(){try{let e=window.localStorage.getItem(Nt),t=e===null?da.map(n=>window.localStorage.getItem(n)).find(n=>n!==null):null;return(e??t??null)!=="false"}catch{return!0}}var On=new Set;function Yr(){for(let e of[...On])e()}function ue(){return lt}function Jr(e){if(lt!==e){lt=e;try{window.localStorage.setItem(Nt,String(e))}catch{}Yr()}}function Xr(e){lt!==e&&(lt=e,Yr())}function _t(e){return On.add(e),()=>{On.delete(e)}}var It="dsh-model-think-level.provider-order",Qr=["deepseek-account","deepseek-official"];function Qe(e){if(e===null)return[];try{let t=JSON.parse(e);return Array.isArray(t)?Nn(t.filter(n=>typeof n=="string")):[]}catch{return[]}}function Nn(e){let t=new Set,n=[];for(let r of e)r.length===0||t.has(r)||(t.add(r),n.push(r));return n}var Xe=(()=>{try{return Qe(window.localStorage.getItem(It))}catch{return[]}})(),Hn=new Set;function Zr(){for(let e of[...Hn])e()}function eo(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function _n(){return Xe}function to(e){let t=Nn(e);if(!eo(Xe,t)){Xe=t;try{window.localStorage.setItem(It,JSON.stringify(Xe))}catch{}Zr()}}function no(e){let t=Nn(e);eo(Xe,t)||(Xe=t,Zr())}function Dt(e){return Hn.add(e),()=>{Hn.delete(e)}}function In(e){let t=n=>{let r=Qr.indexOf(n);return r<0?Qr.length:r};return e.map((n,r)=>({id:n,index:r,rank:t(n)})).sort((n,r)=>n.rank-r.rank||n.index-r.index).map(n=>n.id)}function Ze(e,t){let n=new Map;for(let s of t)n.has(s)||n.set(s,n.size);let r=[],o=[];e.forEach((s,a)=>{n.has(s)&&(r.push(a),o.push(s))}),o.sort((s,a)=>n.get(s)-n.get(a));let i=[...e];return r.forEach((s,a)=>{i[s]=o[a]}),i}function ro(e){return Ze(In(e),_n())}function Dn(e,t,n){let r=e.indexOf(t);if(r<0)return[...e];let o=[...e];o.splice(r,1);let i=Math.max(0,Math.min(o.length,n));return o.splice(i,0,t),o}var Pt="dsh-model-think-level.providers.disabled",Pn=new Set,Se=ua();function ua(){try{return Qe(window.localStorage.getItem(Pt))}catch{return[]}}function oo(e){return Qe(e)}function io(){return Se}function Ct(e){return!Se.includes(e)}function so(e,t){let n=!Se.includes(e);t!==n&&lo(t?Se.filter(r=>r!==e):[...Se,e],!0)}function ao(e){lo(e,!1)}function Ft(e){return Pn.add(e),()=>{Pn.delete(e)}}function fa(e,t){return e.length!==t.length?!1:e.every(n=>t.includes(n))}function lo(e,t){if(!fa(Se,e)){if(Se=[...new Set(e)],t)try{window.localStorage.setItem(Pt,JSON.stringify(Se))}catch{}for(let n of[...Pn])n()}}var Kt="dsh-model-think-level.model-order";function Fn(e){if(e===null)return{};try{let t=JSON.parse(e);if(t===null||typeof t!="object"||Array.isArray(t))return{};let n={};for(let[r,o]of Object.entries(t)){if(r.length===0||!Array.isArray(o))continue;let i=uo(o.filter(s=>typeof s=="string"));i.length>0&&(n[r]=i)}return n}catch{return{}}}function uo(e){let t=new Set,n=[];for(let r of e)r.length===0||t.has(r)||(t.add(r),n.push(r));return n}var Fe=(()=>{try{return Fn(window.localStorage.getItem(Kt))}catch{return{}}})(),Cn=new Set;function fo(){for(let e of[...Cn])e()}function ca(e,t){return e.length===t.length&&e.every((n,r)=>n===t[r])}function pa(){try{window.localStorage.setItem(Kt,JSON.stringify(Fe))}catch{}}function co(){return Fe}function Kn(e){return Fe[e]??ma}var ma=[];function po(e,t){if(e.length===0)return;let n=uo(t),r=Kn(e);if(ca(r,n)&&(n.length>0||!(e in Fe)))return;let o={...Fe};n.length===0?delete o[e]:o[e]=n,Fe=o,pa(),fo()}function mo(e){Fe=e,fo()}function qt(e){return Cn.add(e),()=>{Cn.delete(e)}}function ga(e,t){return Ze(e,t)}function go(e,t){return Ze(t,Kn(e))}function ho(e,t){if(e.length===0||t.length===0)return e;let n=new Map(e.map(r=>[r.id,r]));return ga(e.map(r=>r.id),t).map(r=>n.get(r))}var bo=`
8
8
  /* The injector's mount wrapper. It \u2014 not the editor inside it \u2014 is the item
9
9
  placed into the official row disclosure's repeat(auto-fit, minmax(160px,1fr))
10
10
  grid (context window and max tokens take two cells), so the span belongs
@@ -55,12 +55,32 @@ window.__ModuleLoader__.load({
55
55
  .bre-link-button:hover { text-decoration: underline; }
56
56
  .bre-link-button:disabled { opacity: 0.5; cursor: default; text-decoration: none; }
57
57
  .bre-auto-effort {
58
- /* Seated in the OFFICIAL catalogue head, beside the host's own fetch link:
59
- it borrows the plugin's link metrics and only adds the gap the head's own
60
- controls are spaced by, so it reads as one more control of that row. */
61
- margin-left: 4px;
58
+ /* Seated in the OFFICIAL catalogue head, among the host's own controls, so it
59
+ wears THEIR metrics instead of the plugin's blue underlined link look
60
+ (user request: "\u4E0D\u8981\u8D85\u94FE\u63A5\u6837\u5F0F\uFF0C\u8DDF\u53E6\u5916\u4E24\u4E2A\u4FDD\u6301\u4E00\u81F4"). These values mirror
61
+ the host's own linkButton rule; the seat cannot simply take that class,
62
+ because it would then answer the probe that finds the anchor it sits after.
63
+ No extra margin: the head's own 12px gap already spaces it exactly like the
64
+ controls beside it. */
65
+ box-sizing: border-box;
66
+ display: inline-flex;
67
+ align-items: center;
68
+ height: 28px;
69
+ padding: 0 10px;
70
+ border: none;
71
+ border-radius: var(--dsw-radius-sm, 8px);
72
+ background: none;
73
+ color: var(--dsw-alias-label-tertiary, #6b7280);
74
+ font: inherit;
75
+ font-size: 12px;
76
+ line-height: 18px;
77
+ cursor: pointer;
62
78
  flex: none;
63
79
  }
80
+ .bre-auto-effort:hover {
81
+ background: var(--dsw-alias-interactive-bg-hover, #2631480f);
82
+ color: var(--dsw-alias-label-secondary, #374151);
83
+ }
64
84
  .bre-effort-grid {
65
85
  /* Exactly two equal columns mirroring the official capacity pair the editor
66
86
  sits under; an odd row count leaves the last cell in the left column,
@@ -1576,6 +1596,103 @@ li.bre-row-disabled [class*="rowName"] { opacity: .5; }
1576
1596
  padding-top: 0;
1577
1597
  }
1578
1598
 
1599
+ /* The catalogue heading names a box this pane has already named for the user:
1600
+ the Models tab IS the catalogue, so "\u6A21\u578B\u76EE\u5F55" says it twice, and
1601
+ "\u5DF2\u81EA\u5B9A\u4E49\u6A21\u578B\u76EE\u5F55" (the meta line beside it) says nothing at all \u2014 the rows
1602
+ below ARE the customized catalogue. Both strings are the host's own, so they
1603
+ go by class stem, and the heading takes its title and meta with it. The
1604
+ head's own controls (\u6062\u590D\u9ED8\u8BA4\u6A21\u578B / \u83B7\u53D6\u53EF\u7528\u6A21\u578B) are siblings of the heading,
1605
+ not children, so they stay \u2014 the auto-adapt seat is anchored to them. */
1606
+ .bre-tabbed[data-bre-tab='models'] [data-bre-editor-body] [class*='modelCatalogHeading'] {
1607
+ display: none;
1608
+ }
1609
+
1610
+ /* With the heading gone the head holds only controls, and they read as TWO
1611
+ ENDS: \u6062\u590D\u9ED8\u8BA4\u6A21\u578B stays at the left edge while \u83B7\u53D6\u53EF\u7528\u6A21\u578B keeps the
1612
+ auto-adapt seat beside it at the far right \u2014 the seat belongs to that link's
1613
+ group, it is never a column of its own. The official space-between cannot
1614
+ express that once a third child exists: it spreads the three evenly, which
1615
+ strands the fetch link in the middle of the card. So the free space is handed
1616
+ to the fetch link's own leading auto margin instead \u2014 an auto margin absorbs
1617
+ the space BEFORE justify-content is consulted, whatever the official rule
1618
+ says. The fetch link is the button the seat sits after, which is also the
1619
+ only control present when the provider is not overridden: the pair then
1620
+ simply holds the right edge. align-items centres the taller host links
1621
+ against the seat. */
1622
+ .bre-tabbed[data-bre-tab='models'] [data-bre-editor-body] [class*='modelListHead'] {
1623
+ align-items: center;
1624
+ }
1625
+ .bre-tabbed[data-bre-tab='models'] [data-bre-editor-body] [class*='modelListHead'] > button:has(+ .bre-auto-effort) {
1626
+ margin-left: auto;
1627
+ }
1628
+
1629
+ /* The click's answer, as a bubble at the top of the window that takes itself
1630
+ away again. The control is left alone on purpose: its label is what the user
1631
+ aimed at, and a button that rewrites itself is a button that moved. The
1632
+ bubble is a fixed overlay on the body \u2014 not a child of the head, which is the
1633
+ host's flex row and would take a fourth item \u2014 and it clears the settings
1634
+ dialog's opaque overlay for the same reason the drop line does. It follows
1635
+ the host's own toast in placement and tone, but not in z-index: the settings
1636
+ dialog's overlay outranks the toast layer, and this bubble is raised from
1637
+ inside that dialog. Pointer-events none keeps it out of the way, the phase
1638
+ colours the headline so the outcome reads before the words do, and the
1639
+ hold/fade pair is timed by --bre-note-hold, which the script sets from the
1640
+ same constant it uses for the dismissal. The fade is counted INSIDE that
1641
+ hold, so the bubble is gone when the clock says it is, rather than fading
1642
+ after it. */
1643
+ .bre-auto-effort-note {
1644
+ position: fixed;
1645
+ top: 40px;
1646
+ left: 50%;
1647
+ display: flex;
1648
+ flex-direction: column;
1649
+ gap: 2px;
1650
+ width: max-content;
1651
+ max-width: min(640px, calc(100vw - 48px));
1652
+ padding: 10px 14px;
1653
+ border-radius: 10px;
1654
+ background: var(--dsw-alias-toast-bg, #2b2f36);
1655
+ color: var(--dsw-alias-toast-label, #f9fafb);
1656
+ box-shadow: var(--dsw-shadow-lv3, 0 6px 24px #00000029);
1657
+ font-size: 13px;
1658
+ line-height: 20px;
1659
+ pointer-events: none;
1660
+ transform: translateX(-50%);
1661
+ animation: bre-note-in 160ms ease-out, bre-note-out 400ms ease calc(var(--bre-note-hold, 3000ms) - 400ms) forwards;
1662
+ z-index: 1200;
1663
+ }
1664
+ /* A pass in flight has no lifetime of its own: it is replaced by its verdict,
1665
+ which restarts both animations because the phase changes the rule. */
1666
+ .bre-auto-effort-note[data-bre-auto-effort-phase='working'] {
1667
+ animation: bre-note-in 160ms ease-out;
1668
+ }
1669
+ @keyframes bre-note-in {
1670
+ from { opacity: 0; transform: translate(-50%, -6px); }
1671
+ to { opacity: 1; transform: translate(-50%, 0); }
1672
+ }
1673
+ @keyframes bre-note-out {
1674
+ to { opacity: 0; visibility: hidden; }
1675
+ }
1676
+ @media (prefers-reduced-motion: reduce) {
1677
+ .bre-auto-effort-note {
1678
+ animation: bre-note-out 400ms ease calc(var(--bre-note-hold, 3000ms) - 400ms) forwards;
1679
+ }
1680
+ .bre-auto-effort-note[data-bre-auto-effort-phase='working'] { animation: none; }
1681
+ }
1682
+ .bre-auto-effort-note-text { font-weight: 500; }
1683
+ .bre-auto-effort-note-detail { opacity: .72; }
1684
+ /* The attribute is the visibility switch, so it must beat the flex column above. */
1685
+ .bre-auto-effort-note-detail[hidden] { display: none; }
1686
+ .bre-auto-effort-note[data-bre-auto-effort-phase='working'] .bre-auto-effort-note-text {
1687
+ color: var(--dsw-alias-state-business-primary, #6ea8fe);
1688
+ }
1689
+ .bre-auto-effort-note[data-bre-auto-effort-phase='done'] .bre-auto-effort-note-text {
1690
+ color: var(--dsw-alias-state-success-primary, #22c55e);
1691
+ }
1692
+ .bre-auto-effort-note[data-bre-auto-effort-phase='failed'] .bre-auto-effort-note-text {
1693
+ color: var(--dsw-alias-state-error-secondary, #ff8a80);
1694
+ }
1695
+
1579
1696
  /* The API-key eye. The official key field is a plain flex column whose input is
1580
1697
  its last in-flow child, so the button hangs on the field's own box and is
1581
1698
  measured against the input's 32px row \u2014 the official markup offers no
@@ -1921,7 +2038,7 @@ li.bre-row-disabled [class*="rowName"] { opacity: .5; }
1921
2038
  .bre-key-eye { transition: none; }
1922
2039
  .bre-keys-mark, .bre-keys-actions, .bre-keys-add { transition: none; }
1923
2040
  }
1924
- `;var ut=require("react"),_o=require("react-dom");var T=require("react"),$n=require("react-dom");var go=["off","minimal","low","medium","high","xhigh","max"],aa=["text","image"];var da=[{id:"deepseek-v4-vision",patterns:["deepseek-v4-flash-vision","deepseek-v4-vision"],efforts:{off:"none",low:"low",high:"high",max:"max"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:384e3,note:"DeepSeek \u89C6\u89C9\u5B9E\u9A8C\u7248 id\uFF08deepseek-v4-flash-vision-exp\uFF09\u3002\u5B98\u65B9\u76EE\u5F55\u5DF2\u6807\u6CE8\u8BE5\u6A21\u578B\u9000\u5F79\uFF0C\u540D\u5B57\u4ECD\u88AB\u63A5\u53D7\u3001\u7531\u73B0\u884C deepseek-flash \u63D0\u4F9B\u670D\u52A1\u2014\u2014\u56FE\u7247\u8F93\u5165\u73B0\u5DF2\u7531 deepseek-flash \u539F\u751F\u63D0\u4F9B\u3002"},{id:"deepseek-v4-1-flash",patterns:["deepseek-v4.1-flash","deepseek-flash"],efforts:{off:"none",low:"low",high:"high",max:"max"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:384e3,note:'DeepSeek-V4.1-Flash\uFF082026-09-10 \u53D1\u5E03\u7684\u73B0\u884C\u5B98\u65B9\u6A21\u578B\uFF0C\u5B98\u65B9 id \u4E3A deepseek-flash\uFF1B25 \u4E07\u5E76\u53D1\u3001**\u539F\u751F\u56FE\u7247\u8F93\u5165**\uFF09\u3002V4.1 \u7684\u5404\u5199\u6CD5\uFF08deepseek-flash\u3001deepseek-v4.1-flash\u3001deepseek-v4-1-flash\uFF0C\u4EE5\u53CA\u5E26\u65E5\u671F\u540E\u7F00\u7684\u7B2C\u4E09\u65B9\u53D8\u4F53\uFF09\u90FD\u5F52\u6B64\u6761\u2014\u2014\u7EAF\u6587\u672C\u7684 deepseek-v4 \u4E3B\u5E72\u4E0D\u518D\u541E\u6389\u5B83\u4EEC\u3002\u5B98\u65B9\u679A\u4E3E\u540C V4 \u7CFB\uFF1AOff\uFF08thinking:"disabled"\uFF09/ Low / High / Max\uFF0C\u9ED8\u8BA4 High\uFF1B\u5BB9\u91CF 1,048,576 \u4E0A\u4E0B\u6587 / \u6700\u5927\u8F93\u51FA 384K\u3002'},{id:"deepseek-v4",patterns:["deepseek-v4"],efforts:{off:"none",low:"low",high:"high",max:"max"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:384e3,note:'DeepSeek \u5B98\u65B9\u679A\u4E3E Low / High / Max\uFF08\u9ED8\u8BA4 High\uFF1Bminimal\u3001medium\u3001xhigh \u517C\u5BB9\u6620\u5C04\uFF0Cultra\u2192max\uFF09\uFF0COff \u5373 thinking:"disabled"\uFF08Responses API \u4E0B off \u4EE5 reasoning.effort:"none" \u8868\u793A\uFF09\u3002\u672C\u6761\u76EE\u662F V4 \u5BB6\u65CF\u7684**\u7EAF\u6587\u672C**\u6210\u5458\uFF1Adeepseek-v4-pro\uFF08= DeepSeek-V4-Pro-0813\uFF0C\u5B98\u65B9\u4E0D\u652F\u6301\u56FE\u7247\uFF09\u4E0E\u5DF2\u9000\u5F79\u6A21\u578B\u7684\u517C\u5BB9\u522B\u540D deepseek-v4-flash\uFF08deepseek-v4-flash-vision-exp \u53E6\u6709\u89C6\u89C9\u6761\u76EE\uFF09\u3002**\u6536\u56FE\u7684 V4.1-Flash\uFF08\u5B98\u65B9 id deepseek-flash\uFF09\u53E6\u6709\u4E13\u95E8\u6761\u76EE**\uFF0C\u5176 input \u542B image\u3002\u5BB9\u91CF\uFF1A1,048,576 \u4E0A\u4E0B\u6587 / \u6700\u5927\u8F93\u51FA 384K\uFF08393,216\uFF1B\u9ED8\u8BA4\u975E\u601D\u8003 8K\u3001\u601D\u8003 64K\u3001effort=max \u65F6 128K\uFF09\u3002'},{id:"deepseek-v3",patterns:["deepseek-v3","deepseek-chat"],efforts:{off:"none",high:"high",max:"max"},compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text"],contextWindow:163840,maxTokens:65536,note:"DeepSeek V3 \u6863\u4F4D\uFF1AOff / High / Max\u3002\u5B98\u65B9\u5DF2\u505C\u552E V3 \u4EE3\uFF08\u5B9A\u4EF7\u9875\u4EC5\u5269 V4 \u4E09\u578B\uFF09\uFF0C\u5BB9\u91CF\u53D6\u76EE\u5F55\u73B0\u5F79\u503C\u3002"},{id:"deepseek-r1",patterns:["deepseek-r1","deepseek-reasoner"],efforts:{high:"high"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text"],contextWindow:163840,maxTokens:32768,note:"DeepSeek-R1 \u4E3A\u63A8\u7406\u6A21\u578B\uFF0C\u4EC5\u63D0\u4F9B High\u3002\u5B98\u65B9\u5DF2\u4E0B\u67B6 R1 \u4EE3\uFF0C\u5BB9\u91CF\u53D6\u76EE\u5F55 r1-0528 \u503C\u3002"},{id:"openai-gpt-5-2",patterns:["gpt-5.2"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.2 \u6863\u4F4D\uFF1ANone / Low / Medium / High / XHigh\uFF08\u9ED8\u8BA4 None\uFF09\u3002\u5B98\u65B9\u53E6\u652F\u6301 PDF \u8F93\u5165\uFF08\u6838\u5FC3\u8BCD\u8868\u6682\u4E0D\u542B\uFF09\u3002gpt-5.2-pro \u5B98\u65B9\u9875\u672A\u5355\u5217\u6863\u4F4D\u884C\uFF0C\u6309\u672C\u6761\u76EE\u540C\u6863\u5904\u7406\uFF1Bgpt-5.2-codex \u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"openai-gpt-5-2-codex",patterns:["gpt-5.2-codex"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.2-Codex \u6863\u4F4D\uFF1ALow / Medium / High / XHigh\uFF08\u65E0 None \u6863\uFF0C\u52FF\u52FE Off\uFF09\uFF0C\u5E26\u56FE\u8F93\u5165\u3001400K\u3002"},{id:"openai-gpt-5-6",patterns:["gpt-5.6"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:105e4,maxTokens:128e3,note:"GPT-5.6\uFF08\u522B\u540D\u5373 sol\uFF09\u6863\u4F4D\uFF1ANone / Low / Medium(\u9ED8\u8BA4) / High / XHigh / Max\uFF1Bsol/luna/terra \u540C\u6863\uFF0C\u5E26\u56FE\u8F93\u5165\u3002"},{id:"openai-gpt-5-5",patterns:["gpt-5.5"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:105e4,maxTokens:128e3,note:"GPT-5.5 \u6863\u4F4D\uFF1ANone / Low / Medium(\u9ED8\u8BA4) / High / XHigh\uFF0C\u5E26\u56FE\u8F93\u5165\u3002pro \u53D8\u4F53\u4EC5 Medium / High(\u9ED8\u8BA4) / XHigh \u4E14\u4EC5 Responses API\u3002"},{id:"openai-gpt-5-4",patterns:["gpt-5.4"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:105e4,maxTokens:128e3,note:"GPT-5.4 \u6863\u4F4D\uFF1ANone(\u9ED8\u8BA4) / Low / Medium / High / XHigh\uFF0C\u5E26\u56FE\u8F93\u5165\u3002pro \u53D8\u4F53\u4EC5 Medium/High/XHigh\uFF1Bmini/nano \u4E3A 400K \u4E0A\u4E0B\u6587\u3002"},{id:"openai-gpt-5-3",patterns:["gpt-5.3"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.3-Codex \u6863\u4F4D\uFF1ALow / Medium / High / XHigh\uFF08\u65E0 None \u6863\uFF09\uFF0C\u5E26\u56FE\u8F93\u5165\u3001400K\uFF1Bgpt-5.3-chat \u4E3A\u975E\u63A8\u7406\u804A\u5929\u6A21\u578B\uFF08\u89C1 chat \u6761\u76EE\uFF09\u3002"},{id:"openai-gpt-5-1",patterns:["gpt-5.1"],efforts:{off:"none",low:"low",medium:"medium",high:"high"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.1 \u6863\u4F4D\uFF1ANone / Low / Medium / High\uFF08\u9ED8\u8BA4 None\uFF09\u3002"},{id:"openai-gpt-5-1-codex",patterns:["gpt-5.1-codex"],efforts:{low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.1-Codex \u7CFB\u5217\uFF1A\u5B98\u65B9\u6A21\u578B\u9875\u672A\u5355\u5217 effort \u503C\u57DF\uFF0C\u6309\u540C\u4EE3\u4FDD\u5B88\u6863 Low / Medium / High\uFF08\u65E0 None\uFF1Bxhigh \u672A\u8BC1\u5B9E\uFF09\u3002\u5982\u7AEF\u70B9\u652F\u6301 xhigh/none \u53EF\u624B\u8C03\u3002"},{id:"openai-gpt-5",patterns:["gpt-5"],efforts:{minimal:"minimal",low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5 \u521D\u4EE3\u6863\u4F4D\uFF1AMinimal / Low / Medium / High\uFF0C\u65E0\u5173\u95ED\u6863\u3002"},{id:"openai-chat",patterns:["gpt-5.1-chat-latest","gpt-5.2-chat-latest","gpt-5.3-chat-latest","gpt-5-chat-latest","gpt-chat-latest","gpt-5-chat","gpt-5.1-chat","gpt-5.2-chat","gpt-5.3-chat"],efforts:!1,input:["text","image"],contextWindow:128e3,maxTokens:16384,note:"-chat \u7CFB\u5217\uFF08\u5B98\u65B9 id \u4E3A gpt-5.x-chat-latest\uFF09\u4E3A\u975E\u63A8\u7406\u804A\u5929\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF08\u52FF\u52FE\u601D\u8003\u6863\uFF09\uFF1B\u5B98\u65B9\u652F\u6301\u56FE\u7247\u8F93\u5165\uFF0C128K / 16,384 \u8F93\u51FA\u3002gpt-5-chat-latest \u5DF2\u4E8E 2026-07-23 \u4E0B\u67B6\u3001gpt-chat-latest \u5DF2\u65E0\u5B98\u65B9\u9875\u9762\uFF08\u4FDD\u7559\u6A21\u5F0F\u4F9B\u7F51\u5173\uFF09\u3002"},{id:"openai-o",patterns:["o1","o3","o4"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:2e5,maxTokens:1e5,note:"OpenAI o \u7CFB\u6863\u4F4D\uFF1ALow / Medium / High\u3002\u5B98\u65B9\u5DF2\u4E8E 2026-06 \u516C\u544A\u9000\u5F79\uFF08o1/o1-pro/o3-mini/o4-mini 2026-10-23 \u79FB\u9664\u3001o3/o3-pro 2026-12-11\uFF09\uFF0C\u7F51\u5173\u6B8B\u7559\u4ECD\u53EF\u547D\u4E2D\uFF1B\u591A\u6570 o \u7CFB\u7AEF\u70B9\u6536\u56FE\uFF08o3-mini \u4F8B\u5916\uFF09\u3002"},{id:"openai-gpt-oss",patterns:["gpt-oss"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"low",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:131072,maxTokens:131072,note:"GPT-OSS \u5F00\u6E90\u6743\u91CD\uFF08Ollama/vLLM \u5E38\u89C1\uFF09\uFF1Areasoning effort Low / Medium / High\uFF0C\u7EAF\u6587\u672C\uFF0C131K \u4E0A\u4E0B\u6587 / 131K \u8F93\u51FA\u30022026-09 \u590D\u6838\uFF1A\u5B98\u65B9\u6A21\u578B\u9875\u73B0\u5728\u5199 Chat Completions = Not supported\u3001\u65E0\u56FE\u7247\u8F93\u5165\uFF08\u9ED8\u8BA4 Low \u6765\u81EA\u5B98\u65B9 CLI\uFF0C\u4E0D\u662F API \u9875\uFF09\uFF0C\u56E0\u6B64\u8FD9\u91CC\u4E0D\u518D\u58F0\u660E Off\u3002"},{id:"openai-gpt-6-astra",patterns:["gpt-6-astra","gpt-6"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:105e4,maxTokens:128e3,note:"GPT-6 Astra \u6863\u4F4D\uFF1ALow / Medium / High / XHigh / Max\u2014\u2014**\u6CA1\u6709 None \u6863**\uFF08\u5B98\u65B9\u539F\u6587\uFF1A\u8BBE\u4E3A none \u8FD4\u56DE HTTP 400\uFF09\uFF0C\u56E0\u6B64\u672C\u6761\u76EE\u4E0D\u58F0\u660E Off\u3002\u5E26\u56FE\u8F93\u5165\uFF0C1,050,000 \u4E0A\u4E0B\u6587 / 128,000 \u8F93\u51FA\uFF1BAI \u5B98\u65B9\u9ED8\u8BA4\u6863\u4F4D\u672A\u516C\u5E03\uFF0C\u6545\u4E0D\u586B\u3002\u5DE5\u5177\u8C03\u7528\u9700\u8D70 Responses API\u3002"},{id:"openai-gpt-5-6-cyber",patterns:["gpt-5.6-cyber"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.6-Cyber\uFF1A\u5B98\u65B9\u6A21\u578B\u9875\u672A\u5355\u5217 effort \u503C\u57DF\uFF08\u4E0D\u7B49\u4E8E\u4E0D\u652F\u6301\uFF09\uFF0C\u6545\u6309\u540C\u4EE3\u4FDD\u5B88\u6863 Low / Medium / High / XHigh\uFF1B\u8BE5\u578B\u53F7\u4EC5 Responses API\uFF0C\u5E26\u56FE\u8F93\u5165\u3001400K \u4E0A\u4E0B\u6587\u3002\u5B98\u65B9\u652F\u6301\u7684\u5176\u4ED6\u6863\u4F4D\u53EF\u624B\u8C03\u540E\u5E94\u7528\u3002"},{id:"openai-gpt-4o",patterns:["gpt-4o"],efforts:!1,input:["text","image"],contextWindow:128e3,maxTokens:16384,note:"GPT-4o \u4EE3\u9645\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF08\u52FF\u52FE\u601D\u8003\u6863\uFF09\uFF1B\u56FE\u7247\u8F93\u5165\u5168\u7CFB\u6807\u914D\uFF0C128K / 16,384 \u8F93\u51FA\u3002"},{id:"openai-gpt-4-1",patterns:["gpt-4.1"],efforts:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,note:"GPT-4.1 \u5168\u7CFB\uFF08\u542B mini/nano\uFF09\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF1B\u5B98\u65B9 1,047,576 \u4E0A\u4E0B\u6587 / 32,768 \u8F93\u51FA\uFF0C\u5168\u7CFB\u5E26\u56FE\u8F93\u5165\u3002"},{id:"openai-gpt-4-turbo-preview",patterns:["gpt-4-turbo-preview"],efforts:!1,input:["text"],contextWindow:128e3,maxTokens:4096,note:"GPT-4 Turbo Preview\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u7EAF\u6587\u672C\u8F93\u5165\uFF08\u6B63\u5F0F turbo \u5FEB\u7167\u652F\u6301\u56FE\u7247\uFF0C\u89C1\u4E0B\u6761\uFF09\uFF0C128K\u3002"},{id:"openai-gpt-4-turbo",patterns:["gpt-4-turbo"],efforts:!1,input:["text","image"],contextWindow:128e3,maxTokens:4096,note:"GPT-4 Turbo\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u5B98\u65B9\u652F\u6301\u56FE\u7247\u8F93\u5165\uFF0C128K / 4,096 \u8F93\u51FA\u3002"},{id:"openai-gpt",patterns:["gpt-4","gpt-3.5"],efforts:!1,input:["text"],note:"GPT-4/3.5 \u4EE3\u9645\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF08\u52FF\u52FE\u601D\u8003\u6863\uFF09\u3002gpt-4-turbo/4.1 \u8D77\u652F\u6301\u56FE\u7247\uFF0C\u89C1\u5355\u72EC\u6761\u76EE\uFF1B\u65B0\u4EE3\u8BF7\u7528 GPT-5 \u7CFB\uFF08\u89C1 openai-chat/gpt-5.x \u6761\u76EE\uFF09\u3002"},{id:"anthropic-claude-5",patterns:["claude-fable-5","claude-mythos-5","claude-opus-5","claude-sonnet-5"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude 5 \u4EE3\uFF08Fable 5 / Mythos 5 / Opus 5 / Sonnet 5\uFF09\u6863\u4F4D\uFF1ALow / Medium / High(\u9ED8\u8BA4) / XHigh / Max\uFF1BFable 5.1 \u4E0E Mythos 5.1 \u89C1\u5355\u72EC\u6761\u76EE\uFF0CMythos Preview \u4EC5\u81F3 Max\u30021M \u4E0A\u4E0B\u6587 / 128K \u8F93\u51FA\uFF08Batch 300K\uFF09\u3002\u5B98\u65B9\u652F\u6301 PDF \u8F93\u5165\u3002\u6CE8\u610F\uFF1AAnthropic \u5B98\u65B9 OpenAI \u517C\u5BB9\u5C42\u4F1A\u5FFD\u7565 effort \u53C2\u6570\uFF0C\u58F0\u660E\u5728\u7B2C\u4E09\u65B9\u7F51\u5173\u6620\u5C04\u65F6\u751F\u6548\u3002"},{id:"anthropic-claude-5-1",patterns:["claude-fable-5-1","claude-mythos-5-1"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude Fable 5.1 / Mythos 5.1\uFF1A\u5B98\u65B9\u6863\u4F4D Low / Medium / High(\u9ED8\u8BA4) / XHigh / Max\uFF0C\u81EA\u9002\u5E94\u601D\u8003\u5E38\u5F00\uFF08\u4E0D\u63A5\u53D7 enabled/disabled\uFF09\u30021M \u4E0A\u4E0B\u6587 / 128K \u8F93\u51FA\uFF1B\u8FD9\u4E24\u578B\u4E5F\u662F\u5B98\u65B9\u552F\u4E00\u5141\u8BB8\u4F1A\u8BDD\u4E2D\u9014\u6539\u6863\u7684\uFF08\u9700 beta header\uFF0C\u672C\u63D2\u4EF6\u4E0D\u6D89\u53CA\uFF09\u3002"},{id:"anthropic-claude-mythos-preview",patterns:["claude-mythos-preview"],efforts:{low:"low",medium:"medium",high:"high",max:"max"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude Mythos Preview\uFF1A\u5B98\u65B9\u6863\u4F4D Low / Medium / High / Max\uFF08\u65E0 XHigh\uFF09\uFF0C1M \u4E0A\u4E0B\u6587\u3002"},{id:"anthropic-claude-opus-4-high",patterns:["claude-opus-4-8","claude-opus-4-7"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude Opus 4.7/4.8 \u6863\u4F4D\uFF1ALow / Medium / High(\u9ED8\u8BA4) / XHigh / Max\uFF1Bxhigh \u4E3A\u5B98\u65B9\u63A8\u8350\u7684\u7F16\u7801\u8D77\u6B65\u6863\u30021M \u4E0A\u4E0B\u6587\u3002"},{id:"anthropic-claude-4-6",patterns:["claude-opus-4-6","claude-sonnet-4-6"],efforts:{low:"low",medium:"medium",high:"high",max:"max"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude 4.6 \u4EE3\u6863\u4F4D\uFF1ALow / Medium / High / Max\uFF08\u65E0 XHigh\u2014\u2014\u5B98\u65B9\u660E\u8A00\u300C\u652F\u6301 max \u7684\u90E8\u5206\u578B\u53F7\u4E0D\u652F\u6301 xhigh\u300D\uFF09\u30021M \u4E0A\u4E0B\u6587\u3002"},{id:"anthropic-claude-opus-4-5",patterns:["claude-opus-4-5"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},input:["text","image"],contextWindow:2e5,maxTokens:64e3,note:"Claude Opus 4.5\uFF1A\u5B98\u65B9 effort \u652F\u6301\u5217\u8868\uFF0820251101 \u5FEB\u7167\uFF09\uFF0C\u6863\u4F4D Low / Medium / High\uFF08\u65E0 XHigh/Max\uFF09\uFF0C\u53EF\u4E0E budget_tokens \u5E76\u7528\uFF1B200K / 64K\u3002"},{id:"anthropic-claude",patterns:["claude"],efforts:!1,input:["text","image"],contextWindow:2e5,maxTokens:64e3,note:"Claude 3.x \u4E0E Sonnet 4.5 / Haiku 4.5\uFF1A\u5B98\u65B9 effort \u53C2\u6570\u4E0D\u652F\u6301\uFF08\u4EC5 Fable/Mythos 5\u3001Opus 5/4.6-4.8\u3001Sonnet 5/4.6\u3001Opus 4.5 \u652F\u6301\uFF09\uFF0C\u601D\u8003\u7531 thinking.type \u63A7\u5236\u2014\u2014\u52FF\u52FE\u601D\u8003\u6863\u3002\u53C2\u8003\u5BB9\u91CF 200K / 64K\uFF08Haiku 3.5 \u4E3A\u7EAF\u6587\u672C\uFF0C\u6309\u9700\u53D6\u6D88\u56FE\u7247\uFF09\u3002"},{id:"google-gemini",patterns:["gemini"],efforts:{low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:65536,note:"Gemini \u901A\u7528\u5B89\u5168\u6863\uFF1ALow / Medium / High\uFF08\u5B98\u65B9 OpenAI \u517C\u5BB9\u6620\u5C04\u8868\u53E6\u6536 minimal\uFF1A2.5 \u7CFB\u6620\u5C04\u4E3A 1,024 \u9884\u7B97\u30013.1 Flash-Lite/3 Flash \u539F\u751F minimal\u30013.1 Pro \u843D low\uFF09\u3002none \u4EC5\u80FD\u5173 2.5 \u975E Pro\uFF1B2.5 Pro \u4E0E 3 \u4EE3\u4E0D\u53EF\u5173\uFF1B\u5404\u578B\u9ED8\u8BA4\u4E0D\u4E00\uFF08flash-lite \u9ED8\u8BA4\u5173\uFF09\u3002\u5B98\u65B9\u53E6\u6536\u97F3\u9891/\u89C6\u9891/PDF\u3002"},{id:"xai-grok-4-7",patterns:["grok-4.7"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:5e5,note:'Grok 4.7\uFF08\u4E0A\u6E38\u5FEB\u7167 grok-4.7-20260916\uFF09\uFF1A\u6863\u4F4D Low / Medium / High / XHigh\u2014\u2014**\u53D6\u81EA\u516C\u5F00\u76EE\u5F55**\uFF08OpenRouter \u7684 supported_parameters\u3001models.dev \u5BF9 docs.x.ai \u7684\u8F6C\u8FF0\uFF09\uFF0C\u672C\u6B21 xAI \u5B98\u65B9\u6587\u6863\u7AD9\u4E0D\u53EF\u8FBE\u3001\u672A\u80FD\u4E00\u624B\u8BC1\u5B9E\uFF1B\u9ED8\u8BA4\u6863\u4F4D\u4E0E"\u80FD\u5426\u5173\u95ED\u601D\u8003"\u540C\u6837\u672A\u8BC1\u5B9E\uFF0C\u6545\u4E0D\u58F0\u660E Off\uFF0C\u4E5F\u4E0D\u5199\u9ED8\u8BA4\u6863\u3002\u5E26\u56FE\u8F93\u5165\uFF08\u76EE\u5F55\u8BB0 text+image+file\uFF0CPDF \u5B58\u7591\uFF09\uFF0C500K \u4E0A\u4E0B\u6587\uFF1B\u6700\u5927\u8F93\u51FA\u5404\u76EE\u5F55\u7ED9\u51FA 450K \u4E0E 500K \u4E24\u79CD\u503C\uFF0C\u6309"\u5206\u6B67\u5373\u4E0D\u5199"\u5904\u7406\u30022026-08 \u90A3\u6B21"grok-4.7 \u4E0D\u5B58\u5728\uFF08\u5B98\u65B9 404\uFF09"\u7684\u7ED3\u8BBA\u5DF2\u968F\u53D1\u5E03\u4F5C\u5E9F\u3002'},{id:"xai-grok-high",patterns:["grok-4.6"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"high",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:5e5,note:'Grok 4.6 \u6863\u4F4D\uFF1ALow / Medium / High(\u9ED8\u8BA4) / XHigh\uFF0C\u601D\u8003\u4E0D\u53EF\u5173\u95ED\uFF1B\u5E26\u56FE\u8F93\u5165\u3001500K \u4E0A\u4E0B\u6587\u3002Grok 4.7 \u89C1\u4E0A\u4E00\u6761\uFF08\u6B64\u524D\u8BB0\u4E3A"\u4E0D\u5B58\u5728"\uFF0C\u5DF2\u968F\u53D1\u5E03\u4F5C\u5E9F\uFF09\u3002'},{id:"xai-grok-4-5",patterns:["grok-4.5"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"high",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:5e5,note:"Grok 4.5 \u6863\u4F4D\uFF1ALow / Medium / High(\u9ED8\u8BA4)\uFF0C\u601D\u8003\u4E0D\u53EF\u5173\u95ED\uFF1B\u5E26\u56FE\u8F93\u5165\u3002\u4F20\u5165 xhigh \u4F1A\u88AB\u5B98\u65B9\u9759\u9ED8\u6309 High \u5904\u7406\u3002"},{id:"xai-grok-4-3",patterns:["grok-4.3"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"low",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1e6,note:"Grok 4.3\uFF1A\u5B98\u65B9\u56DB\u7EA7 reasoning effort\uFF08None / Low / Medium / High\uFF09\uFF0C1M \u4E0A\u4E0B\u6587\u3001\u5E26\u56FE\u8F93\u5165\uFF1Bgrok-4-fast \u7B49\u65E7 slug 2026-05-15 \u8D77\u81EA\u52A8\u91CD\u5B9A\u5411\u5230\u672C\u578B\u53F7\u3002"},{id:"xai-grok",patterns:["grok"],efforts:{low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],note:"Grok \u901A\u7528\u6863\u4F4D\uFF1ALow / Medium / High\u3002\u521D\u4EE3 grok-4\u3001grok-4.20 \u4E0E grok-build-0.1 \u4E0D\u63A5\u53D7\u8BE5\u53C2\u6570\uFF08grok-4 \u7CFB\u4E0E grok-3 \u5DF2\u4E8E 2026-05-15 \u9000\u5F79\u5E76\u91CD\u5B9A\u5411\u81F3 4.3\uFF09\uFF1Bgrok-4.20-multi-agent \u7684\u56DB\u6863\u63A7\u5236\u7684\u662F agent \u6570\u91CF\u800C\u975E\u601D\u8003\u6DF1\u5EA6\u3002\u65B0\u65E7\u4EE3\u9645\u8BF7\u4F18\u5148\u9009 4.5/4.6/4.3\uFF1B\u591A\u6A21\u6001\u53D8\u4F53\u6309\u9700\u52FE\u9009\u56FE\u7247\u3002"},{id:"mistral-magistral",patterns:["magistral"],efforts:!1,input:["text"],contextWindow:32768,maxTokens:32768,note:"Magistral \u539F\u751F\u601D\u8003\u7EBF\uFF08\u65E0 effort \u53C2\u6570\uFF0C\u4E3A prompt_mode \u8BED\u4E49\uFF09\uFF0C\u5B98\u65B9\u5DF2\u4E8E 2026-07-28 \u58F0\u660E\u5F03\u7528\u3001\u9010\u6B65\u64A4\u51FA\uFF1B\u73B0\u5F79\u63A8\u7406\u8D70 mistral-small-2603 / mistral-medium-3-5 \u7684 reasoning_effort\uFF08\u89C1\u4E0B\u6761\uFF09\u3002"},{id:"mistral-medium-3",patterns:["mistral-medium-3.5","mistral-small-latest","mistral-small-2603"],efforts:{off:"none",high:"high"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],note:"Mistral \u73B0\u5F79\u63A8\u7406\u6863\uFF1ANone / High\u2014\u2014\u5B98\u65B9 reasoning_effort \u679A\u4E3E\uFF08mistral-common \u534F\u8BAE\u5E93\uFF09\u5373 none/high\uFF1Bmistral-small-2603\uFF08Small 4\uFF09\u4E0E mistral-medium-3-5 \u7ECF\u5B83\u63A7\u5236\uFF0CMedium 3.5 \u5E26\u89C6\u89C9\u3002\u5BB9\u91CF\u672A\u5728\u5B98\u65B9\u76EE\u5F55\u9875\u5355\u5217\uFF0C\u4E0D\u63D0\u4F9B\u3002"},{id:"qwen-vision",patterns:["qwen-vl","qwen2-vl","qwen2-5-vl","qwen3-vl","qvq"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"qwen"},input:["text","image"],contextWindow:131072,maxTokens:8192,note:"\u901A\u4E49\u89C6\u89C9\u7EBF\uFF08Qwen-VL/QvQ\uFF09\uFF1Aenable_thinking \u5F00\u5173\uFF08\u5F00=High\uFF09\uFF0C\u6536\u56FE\u3002qwen3-vl \u5BB9\u91CF\u66F4\u5927\uFF0C\u6309\u9700\u4E0A\u8C03\u3002"},{id:"qwen-3-8",patterns:["qwen3.8"],efforts:{off:null,low:"low",medium:"medium",xhigh:"xhigh"},defaultEffort:"xhigh",compat:{thinkingFormat:"qwen",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1e6,note:"Qwen 3.8 \u7CFB\uFF1A\u5B98\u65B9 reasoning_effort \u6863\u4F4D XHigh(\u9ED8\u8BA4) / Medium / Low\uFF0Cthinking \u9ED8\u8BA4\u5F00\u3001\u53EF\u6309\u8BF7\u6C42\u5173\u95ED\uFF1B\u539F\u751F\u591A\u6A21\u6001\uFF08qwen3.8-max \u56FE\u50CF/\u89C6\u9891\u7406\u89E3\uFF0C\u89C6\u9891\u672A\u5165\u6838\u5FC3\u8BCD\u8868\uFF09\u30021M \u6863\u4E0A\u4E0B\u6587\u300227B \u4E0E Flash-Next \u5F00\u6E90\u6B3E\u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"qwen-3-8-27b",patterns:["qwen3.8-27b"],efforts:{off:null,low:"low",medium:"medium",xhigh:"xhigh"},defaultEffort:"xhigh",compat:{thinkingFormat:"qwen",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,note:"Qwen3.8-27B\uFF08dense\uFF0C2026-08-14 \u5F00\u6E90\uFF09\uFF1A\u5B98\u65B9 reasoning_effort \u6863\u4F4D XHigh(\u9ED8\u8BA4) / Medium / Low\uFF0Cthinking \u9ED8\u8BA4\u5F00\u3001\u53EF\u6309\u8BF7\u6C42\u5173\uFF1B\u539F\u751F\u56FE\u50CF+\u89C6\u9891\u7406\u89E3\uFF08\u89C6\u9891\u672A\u5165\u6838\u5FC3\u8BCD\u8868\uFF09\u3002262,144 \u539F\u751F\u4E0A\u4E0B\u6587\u3001\u5B98\u65B9\u58F0\u660E\u53EF\u6269\u81F3 1M\u3002\u6765\u6E90\uFF1AHF Qwen/Qwen3.8-27B \u6A21\u578B\u5361\u3002"},{id:"qwen-3-8-flash-next",patterns:["qwen3.8-flash-next"],efforts:{off:null,low:"low",medium:"medium",xhigh:"xhigh"},defaultEffort:"xhigh",compat:{thinkingFormat:"qwen",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,note:"Qwen3.8-Flash-Next\uFF08125B-A6B \u5B9E\u9A8C\u67B6\u6784\uFF0CQwen4 \u524D\u8EAB\uFF09\uFF1A\u5B98\u65B9 reasoning_effort \u6863\u4F4D XHigh(\u9ED8\u8BA4) / Medium / Low + enable_thinking \u5F00\u5173\uFF1B\u539F\u751F\u89C6\u89C9\uFF08Vision Encoder\uFF09\u3002262,144 \u539F\u751F\u4E0A\u4E0B\u6587\u3001\u53EF\u6269\u81F3 1M\u3002\u6765\u6E90\uFF1AHF \u6A21\u578B\u5361\u4E0E qwen.ai \u5B98\u65B9\u535A\u5BA2\u3002"},{id:"qwen",patterns:["qwen","qwq"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"qwen"},input:["text"],contextWindow:1e6,maxTokens:65536,note:"\u901A\u4E49\u5343\u95EE\uFF1Aenable_thinking \u5F00\u5173\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\uFF1B\u73B0\u5F79\u65D7\u8230\u4E3A qwen3.8 \u7CFB\uFF081M \u6863\u4E0A\u4E0B\u6587\uFF0C\u89C1 qwen-3-8 \u6761\u76EE\uFF09\u30023.6/3.7 \u4EE3\u7684 Plus/Flash \u4EA6\u9ED8\u8BA4\u591A\u6A21\u6001\uFF08\u56FE\u7247/\u89C6\u9891\uFF09\uFF0C\u5982\u63A5\u5165\u8BF7\u6309\u9700\u52FE\u9009\u56FE\u7247\uFF1B\u89C6\u89C9\u7EBF\u89C1 qwen-vision \u6761\u76EE\u3002"},{id:"glm-vision",patterns:["glm-4v","glm-4-6v","glm-4-5v","glm-5v"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"zai"},input:["text","image"],contextWindow:131072,maxTokens:32768,note:"\u667A\u8C31\u89C6\u89C9\u7EBF\uFF08GLM-4V/4.5V/4.6V/5V\uFF09\uFF1Athinking \u5F00\u5173\uFF08\u5F00=High\uFF09\uFF0C\u6536\u56FE\u3002GLM-4.5V \u4E3A\u5F3A\u5236\u601D\u8003\uFF08\u4F20 disabled \u62A5\u9519\uFF0C\u8BF7\u624B\u52A8\u5220 Off \u6863\uFF09\u3002"},{id:"glm-5-3-flash",patterns:["glm-5.3-flash"],efforts:{low:"low",high:"high",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"zai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:131072,note:"GLM-5.3-Flash\uFF08320B\uFF0C\u5B98\u65B9\u6587\u6863 vlm \u5206\u7C7B\uFF09\uFF1A\u5F3A\u5236\u601D\u8003\uFF08thinking.type \u4EC5 enabled\uFF0C\u4E0D\u652F\u6301\u5173\u95ED\uFF09\uFF0C\u6587\u672C\u53C2\u6570\u4E0E GLM-5.3 \u4E00\u81F4\u2014\u2014\u6863\u4F4D Low / High / Max\u3002\u8F93\u5165\u6A21\u6001\uFF1A\u89C6\u9891\u3001\u56FE\u50CF\u3001\u6587\u672C\u3001\u6587\u4EF6\uFF08\u89C6\u9891/\u6587\u4EF6\u672A\u5165\u6838\u5FC3\u8BCD\u8868\uFF0C\u56FE\u7247\u53EF\u52FE\uFF09\u3002\u5B98\u65B9 1M \u4E0A\u4E0B\u6587 / 128K \u6700\u5927\u8F93\u51FA\u3002\u6765\u6E90\uFF1Adocs.bigmodel.cn \u6A21\u578B\u9875\u3002"},{id:"glm-5-3",patterns:["glm-5.3"],efforts:{low:"low",high:"high",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"zai",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:131072,note:"GLM-5.3 \u6863\u4F4D\uFF1ALow / High / Max\uFF08\u5F3A\u5236\u601D\u8003\uFF0C\u5176\u4F59\u503C\u62A5\u9519\uFF09\u3002\u5B98\u65B9\u5BB9\u91CF 1M / 128K\u3002"},{id:"glm-5-2",patterns:["glm-5.2"],efforts:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"zai",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:131072,note:"GLM-5.2 \u6863\u4F4D\uFF1ANone / Minimal / Low / Medium / High / XHigh / Max\uFF08\u5B98\u65B9\u6620\u5C04\uFF1ALow\xB7Medium\u2192High\u3001XHigh\u2192Max\u3001None\xB7Minimal=\u505C\u6B62\u601D\u8003\uFF09\u3002\u89C6\u89C9\u7EBF\u89C1 glm-vision \u6761\u76EE\u3002"},{id:"glm",patterns:["glm","zhipu","chatglm"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"zai"},input:["text"],note:"GLM \u901A\u7528\uFF1Athinking \u5F00\u5173\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\uFF1Beffort \u9636\u68AF\u4EC5 GLM-5.2+ \u652F\u6301\uFF08\u89C1\u4E0A\u4E24\u6761\u76EE\uFF09\u3002\u6CE8\u610F GLM-4.7/GLM-4.5V \u4E3A\u5F3A\u5236\u601D\u8003\uFF0C\u4F20 disabled \u4F1A\u62A5\u9519\uFF08\u8BF7\u624B\u52A8\u5220 Off \u6863\uFF09\u3002\u89C6\u89C9\u7EBF\u89C1 glm-vision \u6761\u76EE\u3002"},{id:"kimi-k3",patterns:["kimi-k3"],efforts:{low:"low",high:"high",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,note:"Kimi K3 \u6863\u4F4D\uFF1ALow / High / Max(\u9ED8\u8BA4 Max)\uFF0C\u8D70\u9876\u5C42 reasoning_effort\uFF1B\u59CB\u7EC8\u63A8\u7406\u3001\u52FF\u4F20 thinking \u5BF9\u8C61\u3002\u539F\u751F\u89C6\u89C9\u7406\u89E3\uFF0C1M \u4E0A\u4E0B\u6587\uFF08\u6700\u5927\u8F93\u51FA\u5B98\u65B9\u672A\u5355\u72EC\u5217\uFF0C\u4E0D\u63D0\u4F9B\uFF09\u3002"},{id:"kimi-k2-vision",patterns:["kimi-k2.6","kimi-k2.5"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"deepseek"},input:["text","image"],contextWindow:262144,note:"Kimi K2.5/K2.6 \u89C6\u89C9\u4EE3\uFF1Athinking.type \u5F00\u5173\uFF08\u9ED8\u8BA4\u5F00\u3001\u53EF\u5173\uFF09\uFF0C\u5F00=High\uFF1B\u5E26\u89C6\u89C9\uFF0C256K\u3002K2.7 Code \u59CB\u7EC8\u601D\u8003\uFF0C\u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"kimi-k27-code",patterns:["kimi-k2.7"],efforts:{high:"high"},defaultEffort:"high",compat:{thinkingFormat:"deepseek"},input:["text","image"],contextWindow:262144,note:"Kimi K2.7 Code\uFF08\u542B\u9AD8\u901F\u7248\uFF09\uFF1A\u59CB\u7EC8\u601D\u8003\u2014\u2014thinking.type \u4EC5\u63A5\u53D7 enabled\uFF08\u4F20 disabled \u62A5\u9519\uFF09\uFF0C\u65E0 Off \u6863\uFF1B\u5E26\u89C6\u89C9\uFF0C256K\u3002"},{id:"kimi-moonshot-v1-vision",patterns:["moonshot-v1-8k-vision","moonshot-v1-32k-vision","moonshot-v1-128k-vision"],efforts:!1,input:["text","image"],note:"Moonshot V1 \u89C6\u89C9\u65E7\u4EE3\uFF088k/32k/128k \u5404\u4E00\uFF09\uFF1A\u65E0\u601D\u8003\u63A7\u4EF6\uFF08\u751F\u6210\u6A21\u578B\uFF09\u3001\u652F\u6301\u56FE\u7247\u8F93\u5165\uFF1B\u8BE5\u7EBF\u5DF2\u505C\u6B62\u5BF9\u65B0\u7528\u6237\u5F00\u653E\uFF082026-08-31 \u5168\u91CF\u4E0B\u7EBF\uFF0C\u7F51\u5173\u6B8B\u7559\u4ECD\u53EF\u547D\u4E2D\uFF09\u3002"},{id:"kimi",patterns:["kimi","moonshot"],efforts:{off:null,high:"high"},compat:{thinkingFormat:"deepseek"},input:["text"],contextWindow:262144,note:"Kimi \u901A\u7528\uFF1Athinking \u5F00\u5173\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\u3002k2 \u7CFB\u5217 2026-05-25 \u4E0B\u7EBF\u3001kimi-latest 2026-01-28 \u4E0B\u7EBF\u3001moonshot-v1 \u7CFB 2026-08-31 \u5168\u91CF\u4E0B\u7EBF\uFF08\u7F51\u5173\u6B8B\u7559\u4ECD\u53EF\u547D\u4E2D\uFF1Bmoonshot-v1 \u672C\u8EAB\u975E\u601D\u8003\u6A21\u578B\uFF09\u3002\u89C6\u89C9\u4EE3\u4E0E K2.7 Code \u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"hunyuan-hy3",patterns:["hy3"],efforts:{low:"low",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:262144,note:"\u6DF7\u5143 hy3\uFF1A\u5F00\u6E90\u5951\u7EA6\u7ECF chat_template_kwargs.reasoning_effort = no_think(\u9ED8\u8BA4)/low/high\uFF1B\u5B98\u65B9\u6A21\u578B\u5361 256K \u4E0A\u4E0B\u6587\uFF08295B MoE\uFF0C2026 \u5F00\u6E90\uFF09\u3002"},{id:"hunyuan-hy4",patterns:["hy4-preview","hy-4-preview"],efforts:{off:"no_think",high:"high"},defaultEffort:"high",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},contextWindow:1e6,note:"\u6DF7\u5143 Hy4 preview\uFF1A\u5B98\u65B9 README\u2014\u2014reasoning \u9ED8\u8BA4 high\uFF08\u6DF1\u5EA6\u601D\u8003\uFF09\uFF0C\u5173\u95ED\u7ECF chat_template_kwargs.reasoning_effort=no_think\uFF1B\u5B98\u65B9\u89C4\u683C\u8868 1M \u4E0A\u4E0B\u6587\uFF08770B-A49B MoE\uFF0CGated DSA\uFF09\u3002low \u6863\u5B98\u65B9\u672A\u5217\uFF0C\u5982\u6709\u8BF7\u624B\u8C03\uFF1B\u89C6\u89C9\u672A\u58F0\u660E\uFF0C\u6309\u9700\u624B\u52FE\u3002\u6765\u6E90\uFF1ATencent-Hunyuan/Hy4-preview \u5B98\u65B9 README\u3002"},{id:"step-5-preview",patterns:["step-5"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1e6,maxTokens:65536,note:'\u9636\u8DC3 Step-5-Preview\uFF08\u5B98\u65B9 id \u5373 step-5-preview\uFF0C\u65E0\u88F8 step-5\uFF1Bpattern \u53D6\u5BB6\u65CF\u4E3B\u5E72\u4EE5\u517C\u5BB9\u7F51\u5173\u5199\u6CD5\uFF09\uFF1A\u6863\u4F4D Low / Medium(\u5B98\u65B9\u6807"\u9ED8\u8BA4\u63A8\u8350") / High\uFF0C\u601D\u8003\u4E0D\u53EF\u5173\u95ED\uFF1B\u539F\u751F\u56FE\u7247 + \u89C6\u9891\u8F93\u5165\uFF1B1M \u4E0A\u4E0B\u6587\u300164K \u6700\u5927\u8F93\u51FA\uFF08\u5B98\u65B9\u53E6\u6CE8 max_tokens \u9ED8\u8BA4 INF\u3001\u4E0E 64K \u4E0A\u9650\u5E76\u5B58\uFF0C\u4EE5\u7AEF\u70B9\u5B9E\u6D4B\u4E3A\u51C6\uFF09\u3002'},{id:"step-3-7",patterns:["step-3.7","step-3.6"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,note:"\u9636\u8DC3 Step-3.6/3.7 \u6863\u4F4D\uFF1ALow / Medium(\u9ED8\u8BA4\u63A8\u8350) / High\uFF0C\u539F\u751F\u56FE\u7247+\u89C6\u9891\u7406\u89E3\u3002\u4E0A\u4E0B\u6587\u4E3A\u8F93\u5165+\u8F93\u51FA\u603B\u548C\u4E0A\u9650\u3002"},{id:"step-3-5",patterns:["step-3.5"],efforts:{low:"low",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:262144,note:"\u9636\u8DC3 Step-3.5 Flash \u6863\u4F4D\uFF1ALow / High\uFF08\u7EAF\u6587\u672C\u63A8\u7406\u65D7\u8230\uFF09\u3002\u4E0A\u4E0B\u6587\u4E3A\u8F93\u5165+\u8F93\u51FA\u603B\u548C\u4E0A\u9650\u3002"},{id:"step",patterns:["step-3","step-2"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],note:"\u9636\u8DC3 Step \u6863\u4F4D\uFF1ALow / Medium / High\uFF08\u9ED8\u8BA4 Medium\uFF0C\u4E0D\u53EF\u5173\u95ED\uFF09\u30023.6/3.7 \u89C6\u89C9\u4EE3\u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"doubao",patterns:["doubao","seed"],efforts:{off:null,low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],note:"\u8C46\u5305\u6863\u4F4D\uFF1AOff / Low / Medium / High\u2014\u2014effort \u9636\u68AF\u4ECD\u662F\u793E\u533A\u8BC1\u636E\u3001\u5B98\u65B9 Ark \u6587\u6863\u660E\u5217\u7684\u4E3A thinking.type \u5F00\u5173\uFF082026-08-24 \u590D\u6838\u4ECD\u672A\u89C1\u5230 effort \u5B98\u65B9\u660E\u6587\uFF09\u3002seed \u4EE3\u6536\u56FE\uFF081.5-pro \u4F8B\u5916\uFF09\u3002"},{id:"minimax-m3",patterns:["minimax-m3"],efforts:{off:null,high:"high"},compat:{thinkingFormat:"deepseek"},input:["text","image"],contextWindow:1048576,note:"MiniMax-M3\uFF1A\u5B98\u65B9 thinking \u53C2\u6570 enabled/adaptive/disabled\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\u3001\u5173=disabled\uFF1B\u539F\u751F\u591A\u6A21\u6001\uFF08\u56FE/\u89C6\u9891\uFF0C\u6838\u5FC3\u8BCD\u8868\u4EC5\u542B\u56FE\uFF09\uFF0C1M \u4E0A\u4E0B\u6587\u3002"},{id:"mimo-v2-6",patterns:["mimo-v2.6","mimo-v2.5"],efforts:{off:"none",low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:131072,note:"\u5C0F\u7C73 MiMo v2.6 \u7CFB\u5217\uFF08mimo-v2.6-pro / -flash / -pro-ultraspeed\uFF1B1M \u4E0A\u4E0B\u6587 / 128K \u6700\u5927\u8F93\u51FA\u3001\u539F\u751F\u5168\u6A21\u6001\uFF09\u4E0E\u5176\u524D\u4EE3 mimo-v2.5\u3002\u5B98\u65B9\u6587\u6863\uFF1Athinking.type\uFF08enabled/disabled\uFF0C\u9ED8\u8BA4 enabled\uFF09+ reasoning.effort\uFF08none \u5173\u95ED\uFF1B\u5176\u4F59\u5408\u6CD5\u503C\u5747\u5F00\u542F\uFF0C\u4E14**\u73B0\u9636\u6BB5\u6682\u672A\u533A\u5206\u63A8\u7406\u5F3A\u5EA6**\u2014\u2014minimal \u5F52\u4E00\u4E3A low\u3001xhigh/max/ultra \u5F52\u4E00\u4E3A high\uFF09\uFF0C\u56E0\u6B64\u8FD9\u91CC\u58F0\u660E\u7684\u662F\u7AEF\u70B9**\u63A5\u53D7**\u7684\u6863\u4F4D Off / Low / Medium / High\uFF08xhigh\u3001max \u4E0D\u58F0\u660E\uFF0C\u7AEF\u70B9\u53EA\u4F1A\u6298\u53E0\u4E3A high\uFF09\u3002\u601D\u8003\u6A21\u5F0F\u4E0B temperature / top_p \u4E0D\u53EF\u81EA\u5B9A\u4E49\uFF08\u5F3A\u5236 1.0 / 0.95\uFF09\uFF1B\u5E26\u5DE5\u5177\u8C03\u7528\u7684\u5386\u53F2\u8F6E\u5FC5\u987B\u5B8C\u6574\u56DE\u4F20 reasoning_content\uFF0C\u5426\u5219 400\u3002mimo-v2.5 \u4E0E v2.5-pro \u5B98\u65B9\u5B9A\u4E8E 2026-10-21 \u4E0B\u7EBF\u3002"},{id:"mimo-v2-5-pro",patterns:["mimo-v2.5-pro"],efforts:{off:"none",low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:131072,note:"\u5C0F\u7C73 MiMo v2.5-Pro\uFF1A\u8BE5\u5BB6\u65CF\u552F\u4E00\u7684**\u7EAF\u6587\u672C**\u6210\u5458\uFF08\u5B98\u65B9\u80FD\u529B\u8868\u672A\u5217\u5168\u6A21\u6001\u7406\u89E3\uFF09\uFF0C1M \u4E0A\u4E0B\u6587 / 128K \u6700\u5927\u8F93\u51FA\uFF0C\u63A8\u7406\u5951\u7EA6\u4E0E v2.6 \u7CFB\u5217\u76F8\u540C\uFF08thinking.type + reasoning.effort\uFF0Cnone \u5173\u95ED\u3001\u5176\u4F59\u6863\u4F4D\u6682\u4E0D\u533A\u5206\u5F3A\u5EA6\uFF09\u3002\u5B98\u65B9\u5B9A\u4E8E 2026-10-21 \u4E0B\u7EBF\u3002"},{id:"baidu-ernie",patterns:["ernie"],efforts:!1,input:["text"],contextWindow:131072,note:"\u767E\u5EA6\u5343\u5E06 ERNIE \u7CFB\uFF1A\u5B98\u65B9 OpenAI \u517C\u5BB9\u63A5\u53E3\u65E0 reasoning_effort \u53C2\u6570\u2014\u2014\u601D\u8003\u7531\u6A21\u578B\u53D8\u4F53\u51B3\u5B9A\uFF08-Thinking \u7CFB\u5217\u59CB\u7EC8\u601D\u8003\u3001\u666E\u901A\u7CFB\u5217\u4E0D\u601D\u8003\uFF09\uFF0C\u52FF\u52FE\u601D\u8003\u6863\u3002ERNIE 4.5 Turbo VL \u652F\u6301\u56FE\u7247\uFF0C\u6309\u9700\u624B\u52FE\uFF1B\u53C2\u8003\u5BB9\u91CF\u53D6 Turbo 128K \u6863\u3002"}],Kn={off:null,low:"low",medium:"medium",high:"high"},la={"openai-completions":Kn,"openai-responses":Kn,"anthropic-messages":Kn,deepseek:{off:"none",low:"low",high:"high",max:"max"}},fa={low:"low",medium:"medium",high:"high"};function lt(e){return(e??"").toLowerCase().trim()}function co(e){return e!==void 0&&/[a-z0-9]/.test(e)}function dt(e){return e.toLowerCase().trim().replace(/[^a-z0-9]+/g," ")}function ho(e,t,n){let r=t===0?void 0:e[t-1],o=e[t+n];return!co(r)&&!co(o)}function Bn(e,t){let n=dt(e)+" "+dt(t??""),r;for(let o of da)for(let a of o.patterns){let i=dt(a),s=n.indexOf(i);for(;s>=0;){if(ho(n,s,i.length)){(r===void 0||i.length>r.length)&&(r={entry:o,length:i.length});break}s=n.indexOf(i,s+1)}}return r?.entry}var ua={"deepseek.com":"deepseek","anthropic.com":"anthropic-messages"};function ca(e){let t=lt(e.api);if(t.length>0)return t;let n=e.baseURL;if(n!==void 0&&n.length>0)try{let o=new URL(n).hostname.toLowerCase().split(".");if(o.length>=2){let a=ua[o.slice(-2).join(".")];if(a!==void 0)return a}}catch{}return"openai-completions"}var qt="openai-completions",bo="anthropic-messages";function qn(e){if(e===void 0||e.length===0)return!1;let t="";try{t=new URL(e).hostname.toLowerCase()}catch{return!1}return t==="localhost"||t==="::1"||t.endsWith(".local")||t.endsWith(".internal")||/^(127\.|10\.|192\.168\.)/.test(t)||/^172\.(1[6-9]|2[0-9]|3[01])\./.test(t)?!0:t.includes(":")}function pa(e,t){let n=lt(t),r={...e};if(delete r.supportsMidConvoEffort,delete r.allowedFallbackModels,n===bo){for(let o of["thinkingFormat","supportsReasoningEffort","thinkingTokenBudgetField","supportsThinkingTokenBudget","vllmPriority","supportsMaxOutputTokens"])delete r[o];return r.forceAdaptiveThinking===void 0?void 0:{forceAdaptiveThinking:r.forceAdaptiveThinking}}if(n==="openai-responses"){for(let o of["thinkingFormat","supportsReasoningEffort","thinkingTokenBudgetField","supportsThinkingTokenBudget","vllmPriority"])delete r[o];return r.supportsMaxOutputTokens===void 0?void 0:{supportsMaxOutputTokens:r.supportsMaxOutputTokens}}if(n===qt)return delete r.forceAdaptiveThinking,delete r.supportsMaxOutputTokens,Object.keys(r).length===0?void 0:r}function ma(e,t){let n=lt(t.api);if(n===qt){let r=e.compat;return r!==void 0&&(r=pa(r,n)??void 0),r===void 0&&!qn(t.baseURL)?void 0:r===void 0?{thinkingTokenBudgetField:"thinking_token_budget"}:r.thinkingTokenBudgetField===void 0&&r.supportsThinkingTokenBudget!==!0&&qn(t.baseURL)?{...r,thinkingTokenBudgetField:"thinking_token_budget"}:r}if(n===bo&&e.anthropicAdaptive===!0)return{forceAdaptiveThinking:!0}}var ga=["openai.com","openai.azure.com","deepseek.com","openrouter.ai","z.ai","bigmodel.cn","moonshot.ai","moonshot.cn","aliyuncs.com","anthropic.com","x.ai","together.ai","together.xyz","nvidia.com","cerebras.ai","cloudflare.com","chutes.ai","opencode.ai","ant-ling.com"];function Wn(e){if(lt(e.api)!==qt)return!1;let t=e.baseURL;if(t===void 0||t.length===0)return!1;try{let n=new URL(t).hostname.toLowerCase();return n.includes(".")?!ga.some(r=>n===r||n.endsWith("."+r)):!1}catch{return!1}}function po(e,t,n){return e===void 0||!n||e.supportsDeveloperRole!==void 0||!Wn(t)?e:{...e,supportsDeveloperRole:!1}}var mo={off:null,low:"low",medium:"medium",high:"high"},ha=["vl","vision","omni","4o","pixtral","internvl"];function Un(e){let t=dt(e);for(let n of ha){let r=dt(n),o=t.indexOf(r);for(;o>=0;){if(ho(t,o,r.length))return["text","image"];o=t.indexOf(r,o+1)}}}function ba(e){if(e===void 0)return;let t=e.map(n=>n.toLowerCase());if(t.some(n=>aa.includes(n)))return t.includes("image")?["text","image"]:["text"]}function be(e,t,n){let r=Bn(e,t.displayName),o,a,i,s;r?.input!==void 0&&(o=r.input,a="knowledge"),r?.contextWindow!==void 0&&(i=r.contextWindow),r?.maxTokens!==void 0&&(s=r.maxTokens);let d=ba(n?.input);if(d!==void 0&&(o=d,a="endpoint"),n?.contextLength!==void 0&&Number.isFinite(n.contextLength)&&n.contextLength>0&&(i=n.contextLength),o===void 0){let v=Un(e);v!==void 0&&(o=v,a="heuristic")}let c={...o===void 0?{}:{input:o},...a===void 0?{}:{inputSource:a},...i===void 0?{}:{contextWindow:i},...s===void 0?{}:{maxTokens:s}},m=n===void 0?{}:{endpoint:{reasoning:n.reasoning,source:n.source}};if(n?.reasoning===!1)return{efforts:!1,matched:!1,source:"endpoint:"+(n.source??"listing"),confidence:"high",...m,...c};if(r!==void 0){let v=po(ma(r,t),t,r.efforts!==!1);return{efforts:r.efforts,...r.efforts!==!1&&r.defaultEffort!==void 0&&r.efforts[r.defaultEffort]!==void 0?{defaultEffort:r.defaultEffort}:{},...v===void 0?{}:{compat:v},matched:!0,entryId:r.id,source:r.id,confidence:"high",...m,...c}}let u=ca(t),g=la[u]??fa,l=lt(t.api)===qt?{thinkingFormat:"openai",supportsReasoningEffort:!0}:void 0,f=l!==void 0&&qn(t.baseURL)?{...l,thinkingTokenBudgetField:"thinking_token_budget"}:l,p=po(f,t,!0);return n?.reasoning===!0?{efforts:{...mo},...mo.medium!==void 0?{defaultEffort:"medium"}:{},...p===void 0?{}:{compat:p},matched:!1,source:"endpoint:"+(n.source??"listing"),confidence:"medium",...m,...c}:{efforts:g,...g.medium!==void 0?{defaultEffort:"medium"}:{},...p===void 0?{}:{compat:p},matched:!1,source:"protocol:"+u,confidence:"low",...m,...c}}var wo="dsh-model-think-level.slider.efforts",jn="breSelectWired";function zn(e){return typeof e=="object"&&e!==null&&e.ok===!1}function Gn(e){if(!zn(e))return;let t=e.error,n=typeof t?.code=="string"?t.code:"settings/rejected",r=typeof t?.message=="string"?t.message:"";return r.length>0?`${n}: ${r}`:n}function De(e,t){return`${e}/${t}`}function xo(){try{let e=window.localStorage.getItem(wo);if(e===null)return{};let t=JSON.parse(e);if(typeof t!="object"||t===null||Array.isArray(t))return{};let n={};for(let[r,o]of Object.entries(t))r.length>0&&typeof o=="string"&&o.trim().length>0&&(n[r]=o);return n}catch{return{}}}function ya(e){try{window.localStorage.setItem(wo,JSON.stringify(e))}catch{}}function wa(e,t,n){let r=xo();r[De(e,t)]=n,ya(r)}function xa(e,t){return xo()[De(e,t)]}function Bt(e,t,n){let o=e.groups.find(a=>a.id===t)?.models.find(a=>a.id===n)?.reasoning?.efforts;return o===void 0?[]:o.map(a=>a.id)}function va(e,t,n){return e.groups.find(o=>o.id===t)?.models.find(o=>o.id===n)?.reasoning?.defaultEffort}function ka(e){if(!(e.length<2))return e[Math.floor((e.length-1)/2)]}function Ea(e,t){return e===null||e.provider!==t.provider||e.model!==t.model}async function yo(e,t,n,r,o){let a=Bt(e,t,n);if(a.length===0)return;let i=De(t,n),s=r.get(i);if(s!==void 0&&a.includes(s))return s;let d=await o?.configuredEffort?.(t,n);if(d!==void 0&&a.includes(d))return d;let c=xa(t,n);if(c!==void 0&&a.includes(c))return c;let m=be(n,{}).defaultEffort;if(m!==void 0&&a.includes(m))return m;let u=va(e,t,n);return u!==void 0&&a.includes(u)?u:ka(a)}function vo(e,t){let n=e;if(n[jn]===!0)return()=>{};let r=Object.prototype.hasOwnProperty.call(n,"select"),o=e.select,a=new Map,i=new Set,s=new Map,d=3,c=0,m=async l=>{let f=++c;if(l.reasoningEffort!==void 0){let w=await o.call(e,l);return!zn(w)&&le()&&(a.set(De(l.provider,l.model),l.reasoningEffort),wa(l.provider,l.model,l.reasoningEffort)),w}let p=e.store.getSnapshot();if(!Ea(p.current,l)){if(le()){let w=De(l.provider,l.model);a.delete(w),i.add(w)}return o.call(e,l)}if(!le())return o.call(e,l);let v=await yo(p,l.provider,l.model,a,t),x=e.store.getSnapshot();if(!(c!==f||((w,E)=>w===null||E===null?w!==E:w.provider!==E.provider||w.model!==E.model||w.reasoningEffort!==E.reasoningEffort)(x.current,p.current)))return!le()||v===void 0||!Bt(x,l.provider,l.model).includes(v)?o.call(e,l):o.call(e,{...l,reasoningEffort:v})},u=()=>{let l=e.store.getSnapshot(),f=l.current;if(f===null||f.reasoningEffort!==void 0||!le())return;let p=De(f.provider,f.model);if(i.has(p))return;if(Bt(l,f.provider,f.model).length===0){i.add(p);return}i.add(p);let v=c;yo(l,f.provider,f.model,a,t).then(async x=>{if(x===void 0){i.delete(p);return}if(!le()){i.delete(p);return}let k=e.store.getSnapshot(),w=k.current;if(c!==v||w===null||w.reasoningEffort!==void 0||De(w.provider,w.model)!==p||!Bt(k,w.provider,w.model).includes(x))return;let E=await o.call(e,{provider:w.provider,model:w.model,reasoningEffort:x});if(zn(E))throw E}).catch(()=>{let x=(s.get(p)??0)+1;s.set(p,x),x<d&&(i.delete(p),u())})},g=e.store.subscribe(u);return u(),n[jn]=!0,e.select=m,()=>{delete n[jn],g(),r?e.select=o:delete n.select}}function Ta(e){if(e.current===null)return[];let r=e.groups.find(o=>o.id===e.current?.provider)?.models.find(o=>o.id===e.current?.model)?.reasoning?.efforts;return r!==void 0&&r.length>=2?r:[]}function Ma(e){return e.current}function Sa(e,t){let n=Ma(t),r=e.findIndex(s=>s.id===n?.reasoningEffort);if(r>=0)return r;let a=t.groups.find(s=>s.id===n?.provider)?.models.find(s=>s.id===n?.model)?.reasoning?.defaultEffort,i=a===void 0?-1:e.findIndex(s=>s.id===a);return i>=0?i:Math.floor((e.length-1)/2)}function ko(e){return e.models??[]}function Wt(e){let t=e;return t.name??t.label??t.title??e.id}function Vn(e){return(0,T.createElement)("span",{className:"bre-row-chevron"+(e?" is-open":""),"aria-hidden":!0},"\u203A")}function La(){return(0,T.createElement)("svg",{className:"bre-option-check",width:14,height:14,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0},(0,T.createElement)("path",{d:"M3.5 8.5l3 3 6-7",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round"}))}var Eo=new Map;function Aa(e){if(Array.isArray(e.input))return e.input.includes("image");let t=Eo.get(e.id);if(t!==void 0)return t;let n=Bn(e.id,e.name)?.input,r=n!==void 0?n.includes("image"):(Un(e.id)??[]).includes("image");return Eo.set(e.id,r),r}function Ra(e){let t=e.reasoning?.efforts;return Array.isArray(t)&&t.length>0}function Oa(e){return(0,T.createElement)("svg",{className:"bre-tag-icon",width:13,height:13,viewBox:"0 0 16 16",fill:"none",role:"img","aria-label":e},(0,T.createElement)("path",{d:"M1.8 8s2.4-4.2 6.2-4.2S14.2 8 14.2 8s-2.4 4.2-6.2 4.2S1.8 8 1.8 8z",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round"}),(0,T.createElement)("circle",{cx:8,cy:8,r:1.8,fill:"currentColor"}))}function Ha(e){return(0,T.createElement)("svg",{className:"bre-tag-icon",width:13,height:13,viewBox:"0 0 16 16",fill:"none",role:"img","aria-label":e},(0,T.createElement)("path",{d:"M8 1.9l1.35 3.75L13.1 7l-3.75 1.35L8 12.1 6.65 8.35 2.9 7l3.75-1.35z",fill:"currentColor"}))}function _a(e,t){let n=[];return Aa(e)&&n.push((0,T.createElement)("span",{key:"vision",className:"bre-tag",title:t("tagVision")},Oa(t("tagVision")))),Ra(e)&&n.push((0,T.createElement)("span",{key:"thinking",className:"bre-tag",title:t("tagThinking")},Ha(t("tagThinking")))),n.length===0?null:(0,T.createElement)("span",{className:"bre-option-tags"},...n)}function To(e){let{directory:t,t:n}=e,r=e.onLayoutChange,o=(0,T.useSyncExternalStore)(M=>t.store.subscribe(M),()=>t.store.getSnapshot()),a=Ta(o),[i,s]=(0,T.useState)(""),[d,c]=(0,T.useState)(null),[m,u]=(0,T.useState)(null),[g,l]=(0,T.useState)(!1),[f,p]=(0,T.useState)(null),v=(0,T.useRef)(null),x=(0,T.useRef)(""),k=(0,T.useRef)(!1),w=o.current!==null&&a.length>=2,E=g||o.status==="selecting",b=f??o.error,A=t.select;(0,T.useEffect)(()=>{if(k.current)return;let M=Sa(a,o),ee=a[M]?.id??"";x.current=ee,s(ee),p(null)},[w,a,o]),(0,T.useEffect)(()=>{t.load().catch(()=>{})},[t]);let H=o.current,U=o.groups.find(M=>M.id===H?.provider),_=U?.models.find(M=>M.id===H?.model)?.name??(H===null?n("triggerFallback"):H.model),te=H===null?_:Wt(U??{id:H.provider})+" \xB7 "+_,S=a.find(M=>M.id===i)?.name??n("effortDefault"),D=(0,T.useSyncExternalStore)(It,_n),P=(0,T.useSyncExternalStore)(Ct,Zr),F=(0,T.useSyncExternalStore)(Kt,io),W=o.groups.filter(M=>ko(M).length>0&&!P.includes(M.id)).map(M=>M.id),z=Je(Nn(W),D),j=m!==null&&z.includes(m)?m:H!==null&&z.includes(H.provider)?H.provider:z[0]??null,L=j===null?[]:fo(ko(o.groups.find(M=>M.id===j)),F[j]??[]),O=H===null?"":H.provider+"/"+H.model,K=(0,T.useCallback)(M=>{d!==M&&((0,$n.flushSync)(()=>{c(M)}),r?.())},[r,d]),Z=(0,T.useCallback)(()=>{d!==null&&((0,$n.flushSync)(()=>{c(null)}),r?.())},[r,d]),ce=(0,T.useCallback)(()=>{let M=v.current?.closest('[role="menu"]');M!=null&&(M.tabIndex=-1,M.focus({preventScroll:!0}))},[]),ze=(0,T.useCallback)(async(M,ee)=>{if(k.current)return;let Y=t.store.getSnapshot().current;if(Z(),!(Y!==null&&Y.provider===M&&Y.model===ee)){k.current=!0,ce(),l(!0),p(null);try{let pe=await A({provider:M,model:ee}),oe=Gn(pe);if(oe!==void 0)throw new Error(oe)}catch(pe){p(pe instanceof Error?pe.message:String(pe))}finally{k.current=!1,l(!1)}}},[Z,t,ce,A]),Ne=(0,T.useCallback)(async M=>{if(k.current||(Z(),M===o.current?.reasoningEffort&&o.status!=="error"))return;k.current=!0;let ee=x.current;ce(),l(!0),p(null),s(M);try{let Y=o.current;if(Y===null)throw new Error(n("sliderNoCurrent"));let pe=await A({provider:Y.provider,model:Y.model,reasoningEffort:M}),oe=Gn(pe);if(oe!==void 0)throw new Error(oe);let St=t.store.getSnapshot(),it=a.find(Lt=>Lt.id===St.current?.reasoningEffort)?.id??M;x.current=it,s(it)}catch(Y){x.current=ee,s(ee),p(Y instanceof Error?Y.message:String(Y))}finally{k.current=!1,l(!1)}},[Z,t,ce,a,A,o.current,o.status,n]),ot=[(0,T.createElement)("button",{key:"row:model",type:"button",role:"menuitem",className:"bre-row-control"+(d==="model"?" is-open":""),disabled:E,"aria-expanded":d==="model",onClick:()=>{K(d==="model"?null:"model")}},(0,T.createElement)("span",{className:"bre-row-label"},n("modelRowLabel")),(0,T.createElement)("span",{className:"bre-row-value"},te),Vn(d==="model")),d==="model"?(0,T.createElement)("div",{key:"panel:model",className:"bre-panel bre-panel-models"},(0,T.createElement)("div",{className:"bre-providers",role:"group","aria-label":n("modelRowLabel")},...z.map(M=>(0,T.createElement)("button",{key:M,type:"button",className:"bre-provider"+(M===j?" is-open":"")+(M===H?.provider?" is-current":""),disabled:E,"aria-expanded":M===j,onClick:()=>{u(M)}},(0,T.createElement)("span",{className:"bre-option-name"},Wt(o.groups.find(ee=>ee.id===M))),Vn(M===j))),...z.length===0?[(0,T.createElement)("div",{key:"no-providers",className:"bre-empty"},n("sliderNoCurrent"))]:[]),(0,T.createElement)("div",{className:"bre-provider-models",role:"group","aria-label":n("modelRowLabel")},...L.length===0?[(0,T.createElement)("div",{key:"no-models",className:"bre-empty"},n("sliderNoCurrent"))]:L.map(M=>{let ee=j+"/"+M.id,Y=ee===O;return(0,T.createElement)("button",{key:ee,type:"button",className:"bre-option"+(Y?" is-active":""),disabled:E,"aria-pressed":Y,onClick:()=>{ze(j,M.id)}},(0,T.createElement)("span",{className:"bre-option-name"},M.name??M.id),_a(M,n))}))):null,(0,T.createElement)("div",{key:"divider",className:"bre-divider","aria-hidden":!0}),(0,T.createElement)("button",{key:"row:effort",type:"button",role:"menuitem",className:"bre-row-control"+(d==="effort"?" is-open":""),disabled:E||!w,"aria-expanded":w?d==="effort":void 0,onClick:()=>{K(d==="effort"?null:"effort")}},(0,T.createElement)("span",{className:"bre-row-label"},n("effortRowLabel")),(0,T.createElement)("span",{className:"bre-row-value"+(w?"":" is-muted")},w?S:n("sliderNoLevels")),w?Vn(d==="effort"):null),d==="effort"&&w?(0,T.createElement)("div",{key:"panel:effort",className:"bre-panel",role:"group","aria-label":n("effortRowLabel")},...a.map(M=>(0,T.createElement)("button",{key:M.id,type:"button",className:"bre-option"+(M.id===i?" is-active":""),disabled:E,"aria-pressed":M.id===i,onClick:()=>{Ne(M.id)}},(0,T.createElement)("span",{className:"bre-option-name"},M.name),M.id===i?La():null))):null];return(0,T.createElement)("div",{className:"bre-slider-body",ref:v},(0,T.createElement)("div",{className:"bre-card"},...ot),b===null?null:(0,T.createElement)("div",{className:"bre-model-error",role:"status"},b))}var G=require("react"),So='section[role="group"]',Jn='button[role="menuitemradio"]';function Lo(e){return e.querySelector(So)!==null}function Yn(e){return Array.from(e.querySelectorAll(Jn)).filter(t=>!t.disabled&&t.style.display!=="none")}function Na(e){let t=e.getAttribute("aria-labelledby");return(t===null?null:e.ownerDocument.getElementById(t))?.textContent?.toLowerCase()??""}function Mo(e,t,n=new Map){let r=d=>{n.has(d)||n.set(d,d.style.display),d.style.display="none"},o=d=>{let c=n.get(d);c!==void 0&&(d.style.display=c,n.delete(d))};for(let d of[...n.keys()])d.isConnected||n.delete(d);let a=t.trim().toLowerCase().split(/\s+/).filter(Boolean),i=Array.from(e.querySelectorAll(So)),s=0;if(a.length===0){for(let d of[...n.keys()])o(d);for(let d of i)s+=d.querySelectorAll(Jn).length;return s}for(let d of i){let c=Na(d),m=Array.from(d.querySelectorAll(Jn)),u=0;for(let g of m){let l=(g.getAttribute("title")??"").toLowerCase(),f=(g.textContent??"").toLowerCase(),p=`${c} ${l} ${f}`;a.every(v=>p.includes(v))?(o(g),u+=1):r(g)}u>0?(o(d),s+=u):r(d)}return s}function Ao({menu:e,t}){let[n,r]=(0,G.useState)(""),[o,a]=(0,G.useState)(0),i=(0,G.useRef)(null),s=(0,G.useRef)(""),d=(0,G.useRef)(new Map),c=(0,G.useCallback)(l=>{s.current=l;let f=Mo(e,l,d.current);a(f)},[e]);(0,G.useEffect)(()=>()=>{Mo(e,"",d.current)},[e]),(0,G.useEffect)(()=>{let l=new MutationObserver(()=>{s.current.trim().length!==0&&c(s.current)});return l.observe(e,{childList:!0,subtree:!0}),()=>{l.disconnect()}},[e,c]),(0,G.useEffect)(()=>{let l=f=>{if(s.current.trim().length===0)return;let p=f.key;if(!(p==="ArrowDown"||p==="ArrowUp")&&!(p==="Home"||p==="End"||p==="PageUp"||p==="PageDown")||f.target===i.current||f.target instanceof Node&&!e.contains(f.target))return;let k=Yn(e);if(k.length===0)return;let w=k.findIndex(b=>b===document.activeElement),E;p==="Home"||p==="PageUp"?E=0:p==="End"||p==="PageDown"?E=k.length-1:p==="ArrowDown"?E=w===-1?0:(w+1)%k.length:E=w===-1?k.length-1:(w-1+k.length)%k.length,f.preventDefault(),f.stopPropagation(),k[E]?.focus()};return e.addEventListener("keydown",l,!0),()=>{e.removeEventListener("keydown",l,!0)}},[e]);let m=l=>{let f=l.key;if(f==="ArrowDown"){l.preventDefault(),l.stopPropagation(),Yn(e)[0]?.focus();return}if(n.trim().length>0&&(f==="ArrowUp"||f==="Home"||f==="PageUp"||f==="End"||f==="PageDown")){let p=Yn(e);p.length>0&&(l.preventDefault(),l.stopPropagation(),p[f==="ArrowUp"||f==="End"||f==="PageDown"?p.length-1:0]?.focus());return}f==="Escape"&&n.length>0&&(l.preventDefault(),l.stopPropagation(),r(""),c(""))},u=()=>{r(""),c(""),i.current?.focus({preventScroll:!0})},g=o===0&&n.trim().length>0;return(0,G.createElement)("div",{className:"bre-model-search-box"+(g?" has-empty":""),"data-bre-search":"1"},(0,G.createElement)("div",{className:"bre-search-input-wrapper"},(0,G.createElement)("span",{className:"bre-search-icon","aria-hidden":"true"},(0,G.createElement)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},(0,G.createElement)("circle",{cx:"7",cy:"7",r:"4.5"}),(0,G.createElement)("path",{d:"M10.5 10.5L14 14",strokeLinecap:"round"}))),(0,G.createElement)("input",{ref:i,type:"text",className:"bre-search-input",role:"searchbox",placeholder:t("modelSearchPlaceholder"),"aria-label":t("modelSearchPlaceholder"),value:n,spellCheck:!1,autoComplete:"off",onChange:l=>{let f=l.currentTarget.value;r(f),c(f)},onKeyDown:m}),n.length>0?(0,G.createElement)("button",{type:"button",className:"bre-search-clear",title:t("modelSearchClear"),"aria-label":t("modelSearchClear"),onClick:u},(0,G.createElement)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},(0,G.createElement)("path",{d:"M4 4L12 12M12 4L4 12",strokeLinecap:"round"}))):null),g?(0,G.createElement)("div",{className:"bre-search-empty",role:"status"},t("modelSearchNoMatches")):null)}var Ut=require("react"),Ro=require("react-dom"),Oo=require("react-dom/client");function ye(){return document.body}function ft(e,t,n){let r=(0,Oo.createRoot)(e);return n?.sync===!0?(0,Ro.flushSync)(()=>{r.render(t)}):r.render(t),{wrapper:e,root:r}}function Pe(e){e!==void 0&&(e.root.unmount(),e.wrapper.remove())}var ke=class extends Ut.Component{constructor(){super(...arguments);Dr(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n instanceof Error?n.message:String(n)}}componentDidCatch(n,r){console.error("[bre] editor render failed:",n,r.componentStack)}render(){return this.state.error!==null?(0,Ut.createElement)("div",{style:{color:"#c00",fontSize:"11px",whiteSpace:"pre-wrap",padding:"6px"}},`${this.props.fallbackText}: ${this.state.error}`):this.props.children}};var Ho=()=>{(0,_o.flushSync)(()=>{window.dispatchEvent(new Event("resize"))})};function No(e){let{menuOf:t,triggerOf:n,t:r,refreshed:o,sliderEnabled:a,directory:i}=e,s,d,c,m,u,g,l=()=>{g?.removeAttribute("data-bre-provider"),g=void 0},f=()=>{let b=n();g!==void 0&&g!==b&&l();let A=m?.store.getSnapshot(),H=A?.current;if(b===void 0||H===null||H===void 0){b===g&&l();return}let U=A?.groups.find(_=>_.id===H.provider),B=U===void 0?H.provider:Wt(U);if(B.trim()===""){b===g&&l();return}b.dataset.breProvider=B,g=b},p=()=>{let b=i();b!==m&&(u?.(),u=void 0,m=b,b!==void 0&&(u=b.store.subscribe(f))),f()},v=()=>{Pe(d),d=void 0},x=b=>{let A=b.querySelector('section[role="group"]'),H=A?.parentElement,U=H!=null&&H.parentElement===b?H:A;if(d===void 0){let B=document.createElement("div");B.dataset.plugin=J,B.dataset.breSearch="1",b.insertBefore(B,U),d=ft(B,(0,ut.createElement)(ke,{fallbackText:r("modelSearchFailed"),children:o(()=>(0,ut.createElement)(Ao,{menu:b,t:r}))}),{sync:!0});return}if(d.wrapper.parentElement!==b){b.insertBefore(d.wrapper,U);return}U!==null&&d.wrapper.nextSibling!==U&&b.insertBefore(d.wrapper,U)},k=b=>{if(!a()){Pe(s),s=void 0,b.classList.remove("bre-model-menu-host");for(let _ of Array.from(b.children))_.getAttribute("role")==="menuitem"&&(_.style.display="");return}let A=i();if(A===void 0)return;if(s===void 0){let _=document.createElement("div");_.dataset.plugin=J,_.dataset.breSlider="1",b.insertBefore(_,b.firstChild),s=ft(_,(0,ut.createElement)(ke,{fallbackText:r("renderFailed"),children:o(()=>(0,ut.createElement)(To,{directory:A,t:r,onLayoutChange:Ho}))}),{sync:!0})}else(s.wrapper.parentElement!==b||b.firstChild!==s.wrapper)&&b.insertBefore(s.wrapper,b.firstChild);b.classList.add("bre-model-menu-host");let H=Array.from(b.children).filter(_=>_.getAttribute("role")==="menuitem"),U=s.wrapper;if(Array.from(b.querySelectorAll('[role="menuitemradio"]')).some(_=>!U.contains(_)))s.wrapper.contains(document.activeElement)&&(b.tabIndex=-1,b.focus({preventScroll:!0})),s.wrapper.style.display="none";else{s.wrapper.style.display="";for(let _ of H)_.style.display="none"}};return{reconcile:()=>{p();let b=t();if(b===void 0){Pe(s),s=void 0,v(),c=void 0;return}let A=Lo(b);A?x(b):v(),k(b),A!==c&&(c=A,(A||a())&&Ho())},dispose:()=>{u?.(),u=void 0,m=void 0,l(),Pe(s),s=void 0,v(),c=void 0}}}var N=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function Io(e){let t=e.toLowerCase();return t.includes("compat")||t.includes("thinkingtokenbudget")||t.includes("vllmpriority")||t.includes("supportsmaxoutput")}function jt(e,t){if(!N(e))return[];let n=e[t];return!N(n)||!Array.isArray(n.models)?[]:n.models.filter(N)}function Ce(e,t){if(!N(e))return{};let n=e[t];if(!N(n))return{};let r=typeof n.api=="string"?n.api:void 0,o=typeof n.baseURL=="string"?n.baseURL:void 0,a=typeof n.displayName=="string"?n.displayName:void 0;return{api:r,baseURL:o,displayName:a}}var Se=(e,t)=>typeof e[t]=="boolean";function Ia(e,t){if(Array.isArray(e)){for(let n of e)if(N(n)&&n.id===t)return n}}function Da(e){if(!N(e))return{reasoning:"unknown",source:null};let t=e.supported_features;if(Array.isArray(t)&&t.includes("reasoning"))return{...we(e),reasoning:!0,source:"supported_features"};let n=e.supported_parameters;if(Array.isArray(n)&&(n.includes("reasoning")||n.includes("include_reasoning")||n.includes("reasoning_effort")))return{...we(e),reasoning:!0,source:"supported_parameters"};if(Se(e,"supports_reasoning"))return{...we(e),reasoning:e.supports_reasoning,source:"supports_reasoning"};if(Se(e,"supportsReasoning"))return{...we(e),reasoning:e.supportsReasoning,source:"supportsReasoning"};if(Se(e,"can_reason"))return{...we(e),reasoning:e.can_reason,source:"can_reason"};if(Se(e,"reasoning"))return{...we(e),reasoning:e.reasoning,source:"reasoning"};let r=e.reasoning_effort;if(r!=null&&!(typeof r=="string"&&r.trim().length===0)||e.supports_reasoning_effort===!0)return{...we(e),reasoning:!0,source:"reasoning_effort"};let o=N(e.capabilities)?e.capabilities:void 0;if(o!==void 0){let a=o.thinking;if(N(a)&&typeof a.supported=="boolean")return{...we(e),reasoning:a.supported,source:"capabilities.thinking.supported"};let i=o.effort;if(N(i)&&typeof i.supported=="boolean")return{...we(e),reasoning:i.supported,source:"capabilities.effort.supported"}}return{...we(e),reasoning:"unknown",source:null}}function we(e){let t={},n=i=>{if(!Array.isArray(i))return;let s=i.filter(d=>typeof d=="string");return s.length>0?s.map(d=>d.toLowerCase()):[]},r=N(e.architecture)?e.architecture:void 0,o=n(r?.input_modalities);if(o===void 0&&(o=n(e.input_modalities)),o===void 0){let i=N(e.modalities)?e.modalities:void 0;o=n(i?.input)}if(o===void 0){let i=e.capabilities,s=d=>Array.isArray(d)&&d.some(c=>typeof c=="string"&&c.toLowerCase()==="vision");if(s(e.supported_features)||s(i))o=["image"];else if(N(i)){let d=[];for(let c of["image_input","video_input","pdf_input","file_input"]){let m=N(i[c])?i[c]:void 0;if(m===void 0||typeof m.supported!="boolean")continue;let u=c.replace(/_input$/,"");m.supported===!0?d.push(u):d.length===0&&d.push("text")}d.length>0&&(o=d)}}o===void 0&&(Se(e,"supports_vision")?o=e.supports_vision===!0?["image"]:[]:Se(e,"supportsVision")?o=e.supportsVision===!0?["image"]:[]:(Se(e,"supports_images")||Se(e,"supportsImages"))&&(o=e.supports_images===!0||e.supportsImages===!0?["image"]:[])),o!==void 0&&(t.input=o.length===0?["text"]:o);let a=e.context_length;if(typeof a=="number"&&Number.isFinite(a)&&a>0)t.contextLength=a;else{let s=(N(e.top_provider)?e.top_provider:void 0)?.context_length;if(typeof s=="number"&&Number.isFinite(s)&&s>0)t.contextLength=s;else{let d=e.max_input_tokens;if(typeof d=="number"&&Number.isFinite(d)&&d>0)t.contextLength=d;else{let m=(N(e.limit)?e.limit:void 0)?.context;typeof m=="number"&&Number.isFinite(m)&&m>0&&(t.contextLength=m)}}}return t}function Do(e,t){let n=Ia(e,t);return n===void 0?{found:!1,signal:{reasoning:"unknown",source:null}}:{found:!0,signal:Da(n)}}function xe(e){let n=e?.value?.providers;return typeof n!="object"||n===null||Array.isArray(n)?{}:Object.fromEntries(Object.entries(n).filter(([,r])=>typeof r=="object"&&r!==null&&!Array.isArray(r)))}function zt(e){if(!N(e))return;let t=e.providers;return N(t)?t:void 0}function Po(e,t){for(let n of[e?.user,e?.base]){let r=zt(n)?.[t];if(N(r)&&r.models!==void 0)return r.models}}function Xn(e){return zt(e?.user)}function Gt(e,t){let n=e.find(o=>o.id===t);if(n===void 0)return;let r=n.reasoningEfforts;if(r===!1)return!1;if(typeof r=="object"&&r!==null&&!Array.isArray(r))return r}function Vt(e,t){let r=e.find(a=>a.id===t)?.input;if(!Array.isArray(r))return;let o=r.filter(a=>typeof a=="string");return o.length>0?o:void 0}function $t(e,t){let r=e.find(o=>o.id===t)?.compat;if(N(r))return{...r}}function Yt(e,t){let r=e.find(o=>o.id===t)?.name;return typeof r=="string"&&r.length>0?r:void 0}function Jt(e,t){let r=e.find(o=>o.id===t)?.[Ve];return typeof r=="string"&&r.length>0?r:void 0}async function Pa(e,t){try{let n=await fetch(`${Pr}?route=${encodeURIComponent(e)}`,{method:"GET"});if(!n.ok)return{reasoning:"unknown",source:null};let r=await n.json();return r?.ok?Do(r.data,t).signal:{reasoning:"unknown",source:null}}catch{return{reasoning:"unknown",source:null}}}function Xt(e,t=()=>ne(e),n,r,o,a){return{async suggest(i,s,d,c){let m=xe((await t()).namespace),u=Ce(m,i),g={api:u.api??c?.api,baseURL:u.baseURL??c?.baseURL,displayName:d??u.displayName},l=m[i]===void 0?void 0:await Pa(i,s),f=be(s,g,l);return f.efforts===void 0?{ok:!1,error:"no-suggestion"}:{ok:!0,suggestion:{efforts:f.efforts,...f.compat===void 0?{}:{compat:f.compat},...f.defaultEffort===void 0?{}:{defaultEffort:f.defaultEffort},...f.defaultEffort===void 0?{}:{defaultEffort:f.defaultEffort},...f.input===void 0?{}:{input:f.input},...f.inputSource===void 0?{}:{inputSource:f.inputSource},...f.contextWindow===void 0?{}:{contextWindow:f.contextWindow},...f.maxTokens===void 0?{}:{maxTokens:f.maxTokens},matched:f.matched,source:f.source,confidence:f.confidence,...f.endpoint===void 0?{}:{endpoint:f.endpoint}}}},commit(i,s,d){if(a?.()===!0){n?.(i,s,d.efforts,d.compat,d.input,d.defaultEffort);return}r?.(i,s,{efforts:d.efforts,...d.compat===void 0?{}:{compat:d.compat},...d.input===void 0?{}:{input:d.input},...d.clearCompatKeys===void 0?{}:{clearCompatKeys:d.clearCompatKeys},...d.defaultEffort===void 0?{}:{defaultEffort:d.defaultEffort}})},withdraw(i,s){o?.(i,s)},stageEfforts(i,s,d,c,m,u){n?.(i,s,d,c,m,u)},async writeEfforts(i,s,d,c,m,u,g){if(r!==void 0)return r(i,s,{efforts:d,...c===void 0?{}:{compat:c},...m===void 0?{}:{input:m},...u===void 0?{}:{clearCompatKeys:u},...g===void 0?{}:{defaultEffort:g}}),{ok:!0,staged:!0};let f=(await ct(e,i,[{modelId:s,efforts:d,...c===void 0?{}:{compat:c},...m===void 0?{}:{input:m},...u===void 0?{}:{clearCompatKeys:u},...g===void 0?{}:{defaultEffort:g}}],t))[0]??{ok:!1,error:"no-result"};return f.ok?{ok:!0}:f.modelNotFound===!0?{ok:!1,error:"model-not-found"}:{ok:!1,error:f.error??"conflict"}}}}async function ct(e,t,n,r=()=>ne(e),o){if(n.length===0)return[];let a=!1;for(let i=0;i<3;i++)try{let s=i===0?await r():await ne(e,{fresh:!0});if(s.namespace===void 0)return n.map(()=>({ok:!1,error:"no-namespace"}));let d=Po(s.namespace,t);if(!Array.isArray(d))return n.map(()=>({ok:!1,modelNotFound:!0}));if(!d.every(N))return n.map(()=>({ok:!1,error:"invalid-models"}));let m=d.map(l=>l),u=[];for(let l of n){let f=m.findIndex(p=>p.id===l.modelId);if(f<0){u.push(l.modelId);continue}m[f]=Ca(m[f],l,a?void 0:l.compat)}if(u.length>0)return n.map(l=>u.includes(l.modelId)?{ok:!1,modelNotFound:!0}:{ok:!1,error:"model-not-found"});if(o?.()===!0)return n.map(()=>({ok:!1,aborted:!0}));let g=await e.settings.mutate(re,[{op:"set",path:["providers",t,"models"],value:m}],s.namespace.revision);if(!g.ok){if(i===0&&g.error.code==="settings/conflict")continue;let l=g.error.code==="settings/rejected"&&Io(g.error.message);if(!a&&l&&n.some(f=>f.compat!==void 0)){a=!0;continue}return n.map(()=>({ok:!1,error:g.error.message}))}return n.map(()=>({ok:!0}))}catch(s){return n.map(()=>({ok:!1,error:s instanceof Error?s.message:String(s)}))}return n.map(()=>({ok:!1,error:"conflict"}))}function Ca(e,t,n){let r={...e},o=t.efforts!=="keep",a=t.efforts==="keep"?void 0:t.efforts;if(o)if(a===void 0)delete r.reasoningEfforts,r[de]=!0;else if(delete r[de],delete r[Ge],a===!1)r.reasoningEfforts=!1;else{r.reasoningEfforts={...a};let i=N(e.compat)?e.compat:{},s={...i,...n??{}};for(let d of t.clearCompatKeys??[])delete s[d];(Object.keys(i).length>0||Object.keys(s).length>0)&&(Object.keys(s).length===0?delete r.compat:r.compat=s)}return t.input!==void 0&&(t.input===null?(delete r.input,r[Te]=!0):(delete r[Te],r.input=[...t.input])),t.defaultEffort!==void 0&&(t.defaultEffort===null?delete r[Ve]:r[Ve]=t.defaultEffort),r}function Qn(e,t){for(let n of[e?.user,e?.base]){let r=zt(n)?.[t];if(!N(r))continue;let o=r.headers;if(o===void 0)continue;if(!N(o))return;let a={};for(let[i,s]of Object.entries(o))typeof s=="string"&&(a[i]=s);return a}}async function Zn(e,t,n){if(typeof t!="string"||t.length===0)return{ok:!1,error:"no-route"};for(let r=0;r<2;r+=1)try{let o=r===0?await ne(e):await ne(e,{fresh:!0});if(o.namespace===void 0)return{ok:!1,error:"no-namespace"};if(o.writable!==!0)return{ok:!1,error:"read-only"};if(!Fa(o.namespace,t))return{ok:!1,error:"no-route"};let a=await e.settings.mutate(re,[{op:"set",path:["providers",t,"headers"],value:{...n}}],o.namespace.revision);if(!a.ok){if(r===0&&a.error.code==="settings/conflict")continue;return{ok:!1,error:a.error.message}}return{ok:!0}}catch(o){return{ok:!1,error:o instanceof Error?o.message:String(o)}}return{ok:!1,error:"conflict"}}function Fa(e,t){for(let n of[e?.user,e?.base]){let r=zt(n);if(r!==void 0&&Object.prototype.hasOwnProperty.call(r,t))return!0}return!1}async function ne(e,t={}){let n=t.fresh===!0?void 0:Ka(e);if(n!==void 0)return n;let r=await e.settings.describe();return r.ok?{namespace:r.value.namespaces.find(a=>a.ns===re),writable:r.value.writable}:{namespace:void 0,writable:!1}}function Ka(e){let t=e.scope?.getSnapshot();if(!(t===void 0||t.status!=="ready")&&typeof t.revision=="number")return{namespace:{ns:re,schema:{},value:t.value,user:t.user,base:t.base,revision:t.revision,applies:"live",secrets:[]},writable:t.writable===!0}}function Co(e){let t,n,r=0,o=()=>{if(t!==void 0)return Promise.resolve();let s=r;return n??(n=ne(e.api).then(d=>{if(d.namespace===void 0){n=void 0;return}let c=new Map;for(let[m,u]of Object.entries(xe(d.namespace))){let g=Array.isArray(u.models)?u.models:[];for(let l of g){if(typeof l!="object"||l===null||Array.isArray(l))continue;let f=l.id,p=l[Ve];typeof f=="string"&&typeof p=="string"&&p.length>0&&c.set(`${m}/${f}`,p)}}s===r?t=c:n=void 0}).catch(()=>{s===r&&(n=void 0)})),n};return{of:async(s,d)=>(await o(),t?.get(`${s}/${d}`)),invalidate:()=>{r+=1,t=void 0,n=void 0}}}function qa(e){let t=e.input;return Array.isArray(t)&&t.length>0}function Fo(e,t=()=>!0,n={},r=0){let o=n.efforts!==!1,a=n.modalities!==!1;if(!N(e))return;let i={};for(let s of Object.keys(e)){if(!t(s))continue;let d=e[s],c=N(d)&&Array.isArray(d.models)?d.models:void 0;if(c===void 0||c.length===0||!c.every(N))continue;let m=c,u=[],g=!1;for(let l of m){let f=l.reasoningEfforts!==void 0||l[de]===!0,p=qa(l)||l[Te]===!0;if((f||!o)&&(p||!a)){let A=Ba(l,e,s);A!==void 0?(g=!0,u.push(A)):u.push(l);continue}let v=typeof l.id=="string"?l.id:"";if(v.length===0){u.push(l);continue}let x=Ce(e,s),k=typeof l.name=="string"?l.name:void 0,w=be(v,{...x,displayName:k??x.displayName});if(w.efforts===void 0){u.push(l);continue}let E={...l},b=!1;if(!f&&o&&(b=!0,E.reasoningEfforts=w.efforts,E[Ge]=r,w.compat!==void 0)){let A=N(l.compat)?l.compat:{};E.compat={...A,...w.compat}}if(!p&&a&&w.input!==void 0&&(b=!0,E.input=[...w.input]),!b){u.push(l);continue}g=!0,u.push(E)}g&&(i[s]={models:u})}return Object.keys(i).length===0?void 0:{providers:i}}function Ba(e,t,n){if(!N(e.reasoningEfforts)||e[de]===!0)return;let r=e.compat,o=N(r)?{...r}:{};if(o.supportsDeveloperRole===void 0&&Wn(Ce(t,n)))return{...e,compat:{...o,supportsDeveloperRole:!1}}}function Ko(e){let t,n=()=>(t??(t=(async()=>{let o={autofill:!0,modalityAutofill:!0};try{let a=await fetch(Fr,{method:"GET"});if(!a.ok)return o;let i=await a.json();return i?.ok!==!0?o:{autofill:i.data?.autofill!==!1,modalityAutofill:i.data?.modalityAutofill!==!1}}catch{return o}})()),t),r=async()=>{try{let o=await n();if(!o.autofill)return;let a=await ne(e.api,{fresh:!0}),i=a.namespace;if(i===void 0||a.writable!==!0)return;let s=Xn(i);if(s===void 0)return;let d=Fo(s,()=>!0,{modalities:o.modalityAutofill},i.revision);if(d===void 0)return;let c=d.providers,m=Object.entries(c).map(([g,l])=>({op:"set",path:["providers",g,"models"],value:l.models})),u=await e.api.settings.mutate(re,m,i.revision);u.ok||console.error(`[bre] idle autofill refused: ${u.error.message}`)}catch(o){console.error(`[bre] idle autofill failed: ${o instanceof Error?o.message:String(o)}`)}};return{run:()=>{r()}}}var Er=require("react"),gs=require("react-dom/client");var C=require("react");var Fe=go;function Ke(e){let t={};for(let n of Fe){if(e===void 0){t[n]={on:!1,wire:""};continue}if(e===!1){t[n]=n==="off"?{on:!0,wire:""}:{on:!1,wire:""};continue}let r=e[n];t[n]={on:r!==void 0,wire:r===null?"":typeof r=="string"?r:""}}return t}function Xe(e){let t=!1,n=!1,r={};for(let o of Fe){let a=e[o];if(!a.on)continue;if(o==="off"){t=!0;let s=a.wire.trim();r.off=s.length===0?null:s;continue}n=!0;let i=a.wire.trim();r[o]=i.length===0?o:i}return n?r:t?!1:void 0}function pt(e,t){if(e===t)return!0;if(e===!1||e===void 0||t===!1||t===void 0)return!1;let n=Fe.filter(o=>e[o]!==void 0),r=Fe.filter(o=>t[o]!==void 0);return n.length!==r.length?!1:n.every(o=>e[o]===t[o])}function qo(e,t){if(!(e===void 0||e===!1)&&!("off"in e)){if(t==="zai"||t==="deepseek")return"thinking-disabled";if(t==="qwen")return"enable-thinking-false"}}var er="bre:auto-effort",Bo=Promise.resolve();function Wo(e){Bo=Bo.then(e,e).then(()=>{},()=>{})}function Uo(e,t=document){t.dispatchEvent(new CustomEvent(er,{detail:{route:e}}))}function jo(e,t=document){let n=r=>{let o=r.detail;typeof o?.route!="string"||o.route.length===0||e(o.route)};return t.addEventListener(er,n),()=>{t.removeEventListener(er,n)}}var y=require("react/jsx-runtime"),zo=new Intl.NumberFormat("en-US");function qe(e){return e===void 0||e.length===0?{declared:!1,image:!1}:{declared:!0,image:e.includes("image")}}function tr(e){return e.declared?e.image?["text","image"]:["text"]:null}var Wa={"openai-completions":["thinkingTokenBudgetField","supportsThinkingTokenBudget","vllmPriority"],"openai-responses":["supportsMaxOutputTokens"]};function Ua(e){return Wa[(e??"").toLowerCase()]??[]}function Go(e,t){let n=Ua(e);if(n.length===0)return[];let r=new Set(t===void 0?[]:Object.keys(t));return n.filter(o=>!r.has(o))}function ja(e,t){if(t!==void 0)return{clearCompatKeys:Go(e,t)};let n=Go(e,void 0);return n.length===0?{}:{clearCompatKeys:n}}function Qt(e,t){return e.declared?t===void 0?!1:e.image?t.includes("image"):!t.includes("image"):t===void 0}function nr(e,t,n){let r=e?t:!1;return e&&r===void 0&&n===void 0?"keep":r}function Vo(e){let t={},n=e?.thinkingTokenBudgetField??"";n!==""&&(t.thinkingTokenBudgetField=n);let o=(e?.vllmPriority===void 0?"":String(e.vllmPriority)).trim();o!==""&&/^-?\d+$/.test(o)&&(t.vllmPriority=Number.parseInt(o,10));let a=e?.supportsMaxOutputTokens===void 0?"":String(e.supportsMaxOutputTokens);return a==="true"?t.supportsMaxOutputTokens=!0:a==="false"&&(t.supportsMaxOutputTokens=!1),Object.keys(t).length===0?void 0:t}function rr(e){let t=e.appliedCompat,n=e.manualCompat,r=t!==void 0?{...t,...n??{}}:n;return e.initialCompat?.supportsThinkingTokenBudget===!0&&e.initialCompat?.thinkingTokenBudgetField===void 0&&r?.thinkingTokenBudgetField===void 0&&(e.routeApi??"").toLowerCase()==="openai-completions"&&(r={...r??{},thinkingTokenBudgetField:"thinking_token_budget"}),{efforts:e.efforts,...r===void 0?{}:{compat:r},...e.input===void 0?{}:{input:e.input},...ja(e.routeApi,r),...e.defaultEffort===void 0?{}:{defaultEffort:e.defaultEffort}}}function Zt({route:e,routeApi:t,routeBaseURL:n,modelId:r,modelName:o,efforts:a,input:i,compat:s,defaultEffort:d,index:c,staged:m=!1,officialInputTypes:u=!1,api:g,readOnly:l,t:f}){let[p,v]=(0,C.useState)(()=>Ke(a)),[x,k]=(0,C.useState)(()=>qe(i)),[w,E]=(0,C.useState)(()=>a!==!1),[b,A]=(0,C.useState)(()=>d??""),[H,U]=(0,C.useState)(!1),[B,_]=(0,C.useState)(void 0),[te,S]=(0,C.useState)(void 0),[D,P]=(0,C.useState)(""),[F,W]=(0,C.useState)("low"),z=(0,C.useRef)(void 0),[j,L]=(0,C.useState)(()=>s?.thinkingTokenBudgetField??""),[O,K]=(0,C.useState)(()=>s?.vllmPriority===void 0?"":String(s.vllmPriority)),[Z,ce]=(0,C.useState)(()=>s?.supportsMaxOutputTokens===void 0?"":String(s.supportsMaxOutputTokens)),ze=(0,C.useRef)(s),[Ne,ot]=(0,C.useState)(void 0),[M,ee]=(0,C.useState)(void 0),[Y,pe]=(0,C.useState)(void 0),oe=(0,C.useRef)(!1),St=(0,C.useRef)(a),Mn=(0,C.useRef)(i),it=(0,C.useRef)(d),Lt=(0,C.useRef)(void 0),Ar=(0,C.useRef)(a);Ar.current=a,(0,C.useEffect)(()=>jo(h=>{if(h!==e||Ar.current!==void 0)return;let q=Lt.current;q!==void 0&&Wo(q)}),[e]),(0,C.useEffect)(()=>{pt(St.current,a)||(St.current=a,oe.current||(v(Ke(a)),E(a!==!1))),Mn.current!==i&&(Mn.current=i,oe.current||k(qe(i))),it.current!==d&&(it.current=d,oe.current||A(d??"")),JSON.stringify(ze.current??null)!==JSON.stringify(s??null)&&(ze.current=s,oe.current||(L(s?.thinkingTokenBudgetField??""),K(s?.vllmPriority===void 0?"":String(s.vllmPriority)),ce(s?.supportsMaxOutputTokens===void 0?"":String(s.supportsMaxOutputTokens))))},[a,i,s,d]);let Rr=()=>{let h={};j!==""&&(h.thinkingTokenBudgetField=j);let q=O.trim();return q!==""&&/^-?\d+$/.test(q)&&(h.vllmPriority=Number.parseInt(q,10)),Z==="true"?h.supportsMaxOutputTokens=!0:Z==="false"&&(h.supportsMaxOutputTokens=!1),Object.keys(h).length===0?void 0:h},Hs=()=>{let h=Rr();return JSON.stringify(h??null)!==JSON.stringify({...s?.thinkingTokenBudgetField===void 0?{}:{thinkingTokenBudgetField:s.thinkingTokenBudgetField},...s?.vllmPriority===void 0?{}:{vllmPriority:s.vllmPriority},...s?.supportsMaxOutputTokens===void 0?{}:{supportsMaxOutputTokens:s.supportsMaxOutputTokens}})},At=Fe.filter(h=>p[h].on),_s=b===(d??"")?void 0:b===""?null:b,Ns=w?Xe(p):!1,Sn=!pt(Ns,a)||!Qt(x,i)||Hs()||_s!==void 0,Ln=(0,C.useRef)(void 0),me=()=>{oe.current=!0,S(void 0),P(""),W("low"),ot(void 0)},ge=(h,q,Q,he=w)=>{let ae=nr(he,Xe(h),a),zs=Qt(q,i)?void 0:tr(q),Nr=rr({efforts:ae,input:zs,defaultEffort:Q===(d??"")?void 0:Q===""?null:Q,manualCompat:Rr(),appliedCompat:z.current,routeApi:t,initialCompat:s}),Ir=JSON.stringify(Nr);Ln.current!==Ir&&(Ln.current=Ir,g.commit(e,r,Nr))},Is=(h,q)=>{me();let Q=!q&&b===h?"":b;Q!==b&&A(Q),v(he=>{let ae={...he,[h]:{...he[h],on:q}};return q&&h!=="off"&&ae[h].wire.trim().length===0&&(ae[h]={...ae[h],wire:h}),ge(ae,x,Q),ae}),_(void 0)},Ds=h=>{me(),E(h);let q=h?b:"";q!==b&&A(q),ge(p,x,q,h),_(void 0)},Ps=(h,q)=>{me(),v(Q=>{let he={...Q,[h]:{...Q[h],wire:q}};return ge(he,x,b),he}),_(void 0)},Cs=h=>{me();let q={declared:!0,image:h};k(q),ge(p,q,b),_(void 0)},Fs=()=>{me();let h={declared:!1,image:!1};k(h),ge(p,h,b),_(void 0)},Ks=h=>{me(),L(h),ge(p,x,b),_(void 0)},qs=h=>{me(),K(h),ge(p,x,b),_(void 0)},Bs=h=>{me(),ce(h),ge(p,x,b),_(void 0)},Or=h=>{me(),A(h),ge(p,x,h),_(void 0)},Ws=h=>{me();let q=h.efforts!==!1;E(q);let Q=Ke(h.efforts);v(Q);let he=h.input===void 0?x:qe(h.input);h.input!==void 0&&k(he);let ae=b===""&&h.defaultEffort!==void 0?h.defaultEffort:b;ae!==b&&A(ae),S(h.efforts),P(h.source),W(h.confidence),z.current=h.compat,ot(h.inputSource),ee(h.contextWindow),pe(h.maxTokens),_({kind:"info",text:f("appliedHint",{source:h.source,confidence:f("confidence_"+h.confidence)})}),ge(Q,he,ae,q)},Hr=async()=>{if(!(l||H)){U(!0),_(void 0);try{let h=m?await g.suggest(e,r,o,{...t===void 0?{}:{api:t},...n===void 0?{}:{baseURL:n}}):await g.suggest(e,r,o);if(!h.ok){_({kind:"error",text:h.error==="no-suggestion"?f("noSuggestion"):h.error});return}Ws(h.suggestion)}catch(h){_({kind:"error",text:f("writeError",{message:String(h)})})}finally{U(!1)}}};(0,C.useEffect)(()=>{Lt.current=Hr});let Us=()=>{oe.current=!1,g.withdraw(e,r),v(Ke(a)),E(a!==!1),k(qe(i)),A(d??""),L(s?.thinkingTokenBudgetField??""),K(s?.vllmPriority===void 0?"":String(s.vllmPriority)),ce(s?.supportsMaxOutputTokens===void 0?"":String(s.supportsMaxOutputTokens)),S(void 0),P(""),W("low"),z.current=void 0,ot(void 0),ee(void 0),pe(void 0),_(void 0),Ln.current=void 0},js=z.current?.thinkingFormat??be(r,{...t===void 0?{}:{api:t},...n===void 0?{}:{baseURL:n}}).compat?.thinkingFormat,_r=qo(a,js),ie=l||H;return(0,y.jsxs)("div",{className:"bre-effort-editor","data-plugin":J,children:[(0,y.jsxs)("label",{className:"bre-modality-row bre-thinking-switch",children:[(0,y.jsx)("input",{type:"checkbox",checked:w,disabled:ie,"aria-label":f("thinkingMode")+" "+String(c+1),onChange:h=>{Ds(h.target.checked)}}),(0,y.jsx)("span",{className:"bre-effort-level",children:f("thinkingMode")}),w?null:(0,y.jsx)("span",{className:"bre-effort-note",children:f("thinkingModeOff")})]}),w?(0,y.jsxs)("div",{className:"bre-effort-card",children:[(0,y.jsxs)("div",{className:"bre-effort-head",children:[(0,y.jsx)("span",{className:"bre-effort-title",children:f("reasoningEffort")}),(0,y.jsx)("button",{type:"button",className:"bre-link-button",disabled:ie,onClick:()=>{Hr()},children:f("autoAdapt")})]}),(0,y.jsx)("div",{className:"bre-effort-grid",children:Fe.map(h=>{let q=p[h];return(0,y.jsxs)("label",{className:"bre-effort-row",children:[(0,y.jsx)("input",{type:"checkbox",checked:q.on,disabled:ie,"aria-label":f("level_"+h)+" "+String(c+1),onChange:Q=>{Is(h,Q.target.checked)}}),(0,y.jsx)("span",{className:"bre-effort-level",children:f("level_"+h)}),q.on?(0,y.jsx)("input",{type:"text",className:"bre-effort-wire",value:q.wire,disabled:ie,placeholder:f("wirePlaceholder"),"aria-label":f("level_"+h)+" "+f("wireValue"),onChange:Q=>{Ps(h,Q.target.value)}}):(0,y.jsx)("span",{className:"bre-effort-empty"})]},h)})}),At.length>0?(0,y.jsxs)("div",{className:"bre-modality",children:[(0,y.jsx)("span",{className:"bre-effort-title",children:f("defaultEffortLabel")}),(0,y.jsxs)("label",{className:"bre-modality-row",children:[(0,y.jsxs)("select",{className:"bre-select",disabled:ie,"aria-label":f("defaultEffortLabel")+" "+String(c+1),value:b,onChange:h=>{Or(h.target.value)},children:[(0,y.jsx)("option",{value:"",children:f("defaultEffortUnset")}),(b!==""&&!At.includes(b)?[...At,b]:At).map(h=>(0,y.jsx)("option",{value:h,children:f("level_"+h)},h))]}),b!==""?(0,y.jsx)("button",{type:"button",className:"bre-link-button bre-modality-clear",disabled:ie,onClick:()=>{Or("")},children:f("clearDefaultEffort")}):null]}),(0,y.jsx)("p",{className:"bre-modality-note",children:f("defaultEffortHint")})]}):null,u?null:(0,y.jsxs)("div",{className:"bre-modality",children:[(0,y.jsx)("span",{className:"bre-effort-title",children:f("inputModality")}),(0,y.jsxs)("label",{className:"bre-modality-row",children:[(0,y.jsx)("input",{type:"checkbox",checked:x.declared&&x.image,disabled:ie,"aria-label":f("modalityImage")+" "+String(c+1),onChange:h=>{Cs(h.target.checked)}}),(0,y.jsx)("span",{className:"bre-effort-level",children:f("modalityImage")}),x.declared?(0,y.jsx)("button",{type:"button",className:"bre-link-button bre-modality-clear",disabled:ie,onClick:Fs,children:f("clearDeclaration")}):null]}),x.declared?null:(0,y.jsx)("p",{className:"bre-modality-note",children:f("modalityInherit")})]}),(t??"").toLowerCase()==="openai-completions"?(0,y.jsxs)("div",{className:"bre-compat",children:[(0,y.jsx)("span",{className:"bre-effort-title",children:f("compatTitle")}),(0,y.jsxs)("label",{className:"bre-compat-row",children:[(0,y.jsx)("span",{className:"bre-compat-label",children:f("budgetFieldLabel")}),(0,y.jsxs)("select",{className:"bre-select",disabled:ie,"aria-label":f("budgetFieldLabel")+" "+String(c+1),value:j,onChange:h=>{Ks(h.target.value)},children:[(0,y.jsx)("option",{value:"",children:f("budgetUnset")}),(0,y.jsx)("option",{value:"thinking_token_budget",children:"thinking_token_budget"}),(0,y.jsx)("option",{value:"thinking_budget",children:"thinking_budget"}),(0,y.jsx)("option",{value:"thinking_budget_tokens",children:"thinking_budget_tokens"})]}),(0,y.jsx)("span",{className:"bre-compat-hint",children:f("budgetFieldHint")})]}),(0,y.jsxs)("div",{className:"bre-compat-row",children:[(0,y.jsxs)("label",{className:"bre-compat-field",children:[(0,y.jsx)("span",{className:"bre-compat-label",children:f("priorityLabel")}),(0,y.jsx)("input",{type:"text",inputMode:"numeric",className:"bre-text-input",value:O,disabled:ie,placeholder:f("priorityPlaceholder"),"aria-label":f("priorityLabel")+" "+String(c+1),onChange:h=>{qs(h.target.value)}})]}),(0,y.jsx)("span",{className:"bre-compat-hint",children:f("priorityHint")}),O.trim()!==""&&!/^-?\d+$/.test(O.trim())?(0,y.jsx)("p",{className:"bre-effort-note bre-error",children:f("priorityInvalid")}):null]}),s?.supportsThinkingTokenBudget===!0&&s?.thinkingTokenBudgetField===void 0?(0,y.jsx)("p",{className:"bre-effort-note",children:f("aliasMigrated")}):null]}):null,(t??"").toLowerCase()==="openai-responses"?(0,y.jsxs)("div",{className:"bre-compat",children:[(0,y.jsx)("span",{className:"bre-effort-title",children:f("compatTitle")}),(0,y.jsxs)("label",{className:"bre-compat-row",children:[(0,y.jsx)("span",{className:"bre-compat-label",children:f("maxOutputLabel")}),(0,y.jsxs)("select",{className:"bre-select",disabled:ie,"aria-label":f("maxOutputLabel")+" "+String(c+1),value:Z,onChange:h=>{Bs(h.target.value)},children:[(0,y.jsx)("option",{value:"",children:f("maxOutputUnset")}),(0,y.jsx)("option",{value:"true",children:f("maxOutputOn")}),(0,y.jsx)("option",{value:"false",children:f("maxOutputOff")})]}),(0,y.jsx)("span",{className:"bre-compat-hint",children:f("maxOutputHint")})]})]}):null,m?(0,y.jsx)("p",{className:"bre-effort-note",children:f("stagedHint")}):null,a===!1?(0,y.jsx)("p",{className:"bre-effort-note",children:f("reasoningDisabled")}):null,_r===void 0?null:(0,y.jsx)("p",{className:"bre-effort-note",children:f(_r==="thinking-disabled"?"defaultRiskDisabled":"defaultRiskQwen")}),Xe(p)===void 0&&a!==void 0?(0,y.jsx)("p",{className:"bre-effort-note",children:f("bareHint")}):null,te!==void 0?(0,y.jsxs)("div",{className:"bre-suggestion",children:[(0,y.jsx)("p",{className:"bre-effort-note",children:f("appliedHint",{source:D,confidence:f("confidence_"+F)})}),Ne===void 0?null:(0,y.jsx)("p",{className:"bre-effort-note",children:f(Ne==="endpoint"?"inputHintEndpoint":Ne==="knowledge"?"inputHintKnowledge":"inputHintHeuristic")}),M===void 0&&Y===void 0?null:(0,y.jsxs)("div",{className:"bre-reference",children:[(0,y.jsx)("span",{className:"bre-reference-title",children:f("referenceTitle")}),(0,y.jsxs)("span",{className:"bre-reference-values",children:[M===void 0?null:(0,y.jsxs)("span",{children:[f("contextWindowLabel")," ",(0,y.jsx)("b",{children:zo.format(M)})]}),Y===void 0?null:(0,y.jsxs)("span",{children:[f("maxTokensLabel")," ",(0,y.jsx)("b",{children:zo.format(Y)})]})]})]})]}):null,B===void 0?null:(0,y.jsx)("p",{className:"bre-effort-message bre-"+B.kind,role:B.kind==="error"?"alert":"status",children:B.text}),Sn?(0,y.jsx)("p",{className:"bre-effort-message bre-info",role:"status",children:f("pendingSave")}):null,Sn?(0,y.jsx)("p",{className:"bre-effort-note",children:f("pendingHint")}):null,(0,y.jsx)("div",{className:"bre-effort-actions",children:(0,y.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:ie||!Sn,onClick:Us,children:f("reset")})})]}):null]})}var Be="data-bre-auto-effort",za='[class*="modelCatalog"]',Ga='[class*="modelListHead"]',Va='button[class*="linkButton"]',$a="bre-link-button bre-auto-effort";function en(e,t,n){let r=new Map;for(let i of t)i.route.length!==0&&i.catalogue.isConnected&&r.set(i.catalogue,i.route);let o=n.t("autoAdaptAll"),a=n.t("autoAdaptAllHint");for(let[i,s]of r){let d=i.querySelector(Ga)??i,c=d.querySelector(`[${Be}]`)??Ja(n),m=Ya(d);m!==null?m.nextElementSibling!==c&&m.after(c):d.lastElementChild!==c&&d.append(c),Xa(c,s,o,a)}for(let i of Array.from(e.querySelectorAll(`[${Be}]`))){let s=i.closest(za);(s===null||!r.has(s))&&i.remove()}}function $o(){for(let e of Array.from(document.querySelectorAll(`[${Be}]`)))e.remove()}function Ya(e){let t=Array.from(e.querySelectorAll(Va));return t.length===0?null:t[t.length-1]}function Ja(e){let t=document.createElement("button");return t.className=$a,t.setAttribute("type","button"),t.setAttribute(Be,""),t.addEventListener("click",()=>{let n=t.getAttribute(Be)??"";n.length!==0&&(Uo(n),e.onRequest?.(n))}),t}function Xa(e,t,n,r){e.getAttribute(Be)!==t&&e.setAttribute(Be,t),e.textContent!==n&&(e.textContent=n),e.getAttribute("title")!==r&&e.setAttribute("title",r)}function Qe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var or="__breLedgerDocument";function Qo(){let e=globalThis;return e[or]??(e[or]=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`)}var tn="bre:held-writes:v1";function ir(){try{return typeof sessionStorage>"u"?void 0:sessionStorage}catch{return}}function ve(e){let t=ir();if(t!==void 0)try{if(e.pending.size===0&&e.queued.size===0){t.removeItem(tn);return}let n={document:Qo(),committed:[...e.committing].filter(r=>e.queued.has(r)),pending:[...e.pending].map(([r,o])=>[r,[...o]]),queued:[...e.queued].map(([r,o])=>[r,[...o]])};t.setItem(tn,JSON.stringify(n))}catch{}}function Yo(e,t){if(!Array.isArray(e))return;let n=[];for(let r of e){if(!Array.isArray(r)||r.length!==2)return;let[o,a]=r;if(typeof o!="string"||!Array.isArray(a))return;let i=[];for(let s of a){if(!Array.isArray(s)||s.length!==2)return;let[d,c]=s;if(typeof d!="string"||!N(c)||t!==void 0&&!t(c))return;i.push([d,c])}n.push([o,i])}return n}function Qa(e){let t=ir();if(t!==void 0)try{let n=t.getItem(tn);if(n===null)return;let r=JSON.parse(n);if(r.document!==Qo())return;let o=Yo(r.pending),a=Yo(r.queued,dd);if(o===void 0||a===void 0)return;let i=Array.isArray(r.committed)?r.committed.filter(s=>typeof s=="string"):[];for(let[s,d]of o)e.pending.set(s,new Map(d));for(let[s,d]of a)i.includes(s)&&(e.queued.set(s,new Map(d)),e.committing.add(s))}catch{}}function Zo(e,t){(async()=>{try{await sr(t,e),await ar(t,e)}catch(n){console.error(`[bre] teardown flush failed: ${n instanceof Error?n.message:String(n)}`)}})()}function ei(e,t){(async()=>{try{await sr(t,e,!0),await ar(t,e,!0)}catch(n){console.error(`[bre] unload flush failed: ${n instanceof Error?n.message:String(n)}`)}finally{try{ir()?.removeItem(tn)}catch{}}})()}function ti(){let e={mounted:new Map,describePromise:void 0,pending:new Map,missedScans:new Map,queued:new Map,editing:void 0,flushing:!1,flushFailures:0,nextFlushAt:0,committing:new Set,adapting:new Set,signalsUnavailable:!1,submitWired:new WeakSet,cancelWired:new WeakSet};return Qa(e),e}async function Za(e,t){if(!t.flushing){t.flushing=!0;try{let n=await sr(e,t),r=await ar(e,t);n||r?Jo(e,t):(t.flushFailures=0,t.nextFlushAt=0)}catch(n){Jo(e,t),console.error(`[bre] idle flush failed: ${n instanceof Error?n.message:String(n)}`)}finally{t.flushing=!1}try{e.onIdle?.()}catch(n){console.error(`[bre] idle hook failed: ${n instanceof Error?n.message:String(n)}`)}}}function Jo(e,t){t.flushFailures+=1;let n=Math.min(2**t.flushFailures*500,3e4);t.nextFlushAt=Date.now()+n,e.onBackoff?.(n)}function ed(e){return e.queued.size>0||e.pending.size>0}function nn(e,t,n,r,o,a,i){try{let s=e.pending.get(t);if(r===void 0){if(s===void 0)return;s.delete(n),s.size===0&&e.pending.delete(t);return}e.pending.set(t,(s??new Map).set(n,{efforts:r,...o===void 0?{}:{compat:o},...a===void 0?{}:{input:a},...i===void 0?{}:{defaultEffort:i}}))}finally{ve(e)}}function ni(e,t,n,r){e.queued.set(t,(e.queued.get(t)??new Map).set(n,r)),ve(e)}function td(e,t,n){let r=e.pending.get(t);r!==void 0&&(r.delete(n),r.size===0&&e.pending.delete(t),ve(e))}function nd(e,t,n){let r=e.queued.get(t);r!==void 0&&(r.delete(n),r.size===0&&e.queued.delete(t),ve(e))}function rd(e,t,n){td(e,t,n),nd(e,t,n)}function od(e,t){e.queued.delete(t),e.pending.delete(t),e.missedScans.delete(t),e.committing.delete(t),ve(e)}function id(e,t,n){if(t===void 0)return null;let a=t[de]!==!0&&t.reasoningEfforts!==void 0&&typeof t[Ge]=="number"||t[de]!==!0&&n?.efforts!==void 0&&sd(t.reasoningEfforts,n.efforts)?!1:t.reasoningEfforts!==void 0||t[de]===!0||e.efforts==="keep",s=t[Te]!==!0&&n?.input!==void 0&&ad(t.input,n.input)?!1:Array.isArray(t.input)&&t.input.length>0||t[Te]===!0,d=a?"keep":e.efforts,c=s?void 0:e.input,m=e.defaultEffort;return d==="keep"&&c===void 0&&m===void 0?null:{efforts:d,...e.compat===void 0?{}:{compat:e.compat},...c===void 0?{}:{input:c},...m===void 0?{}:{defaultEffort:m}}}function sd(e,t){if(e===t)return!0;if(!N(e)||!N(t))return!1;let n=Object.keys(t);if(Object.keys(e).length!==n.length)return!1;let r=t;return n.every(o=>e[o]===r[o])}function ad(e,t){if(!Array.isArray(e)||e.length!==t.length)return!1;let n=new Set(t);return e.every(r=>typeof r=="string"&&n.has(r))}function dd(e){if(!N(e))return!1;let t=e.efforts;if(t!==!1&&t!=="keep"&&!N(t))return!1;let n=e.clearCompatKeys;return n===void 0||Array.isArray(n)&&n.every(r=>typeof r=="string")}async function ld(e,t,n,r,o=!1){let a=await e.describeNamespace(),i=xe(a.namespace),s=[];for(let[u,g]of[...r]){let l=jt(i,n).find(k=>k.id===u);if(l===void 0||t.pending.get(n)?.get(u)!==g)continue;let f=Ce(i,n),p=typeof l.name=="string"?l.name:void 0,v=be(u,p===void 0?f:{...f,displayName:p}),x=id(g,l,{...v.efforts===void 0?{}:{efforts:v.efforts},...v.input===void 0?{}:{input:v.input}});if(x===null){nn(t,n,u,void 0);continue}s.push({modelId:u,efforts:x.efforts,...x.compat===void 0?{}:{compat:x.compat},...x.input===void 0?{}:{input:x.input},...x.defaultEffort===void 0?{}:{defaultEffort:x.defaultEffort}})}if(s.length===0)return!1;let d=!1,c=await ct(e.api,n,s,()=>d?e.describeNamespace():(d=!0,Promise.resolve(a)),o?void 0:oi),m=!1;return s.forEach((u,g)=>{let l=c[g];if(l?.aborted!==!0){if(l?.ok===!0||l?.modelNotFound===!0){nn(t,n,u.modelId,void 0);return}m=!0,console.error(`[bre] staged flush write failed for "${n}"/"${u.modelId}": ${l?.error??"unknown"}`)}}),m}async function sr(e,t,n=!1){for(let i of[...t.committing])t.queued.has(i)||t.committing.delete(i);if(![...t.queued.keys()].some(i=>t.committing.has(i)||t.signalsUnavailable)||(await e.describeNamespace()).writable!==!0)return ve(t),!1;let a=!1;for(let[i,s]of[...t.queued]){if(!t.committing.has(i)&&!t.signalsUnavailable)continue;let c=[...s].map(([g,l])=>({modelId:g,efforts:l.efforts,...l.compat===void 0?{}:{compat:l.compat},...l.input===void 0?{}:{input:l.input},...l.clearCompatKeys===void 0?{}:{clearCompatKeys:l.clearCompatKeys},...l.defaultEffort===void 0?{}:{defaultEffort:l.defaultEffort}})),m=await ct(e.api,i,c,void 0,n?void 0:oi),u=!1;c.forEach((g,l)=>{let f=m[l];if(f?.aborted===!0){u=!0;return}if(f?.ok===!0||f?.modelNotFound===!0){s.delete(g.modelId);return}console.error(`[bre] held write failed for "${i}"/"${g.modelId}": ${f?.error??"unknown"}`)}),s.size===0?(t.queued.delete(i),t.committing.delete(i)):u||(a=!0)}return ve(t),a}async function ar(e,t,n=!1){if(t.pending.size===0)return!1;let r=await e.describeNamespace();if(r.writable!==!0)return!1;let o=xe(r.namespace),a=!1;for(let[i,s]of[...t.pending]){if(s.size===0){t.pending.delete(i);continue}Qe(o,i)&&await ld(e,t,i,s,n)&&(a=!0)}return ve(t),a}function Le(e,t){for(let n of t){let r=Array.from(e.querySelectorAll("input[aria-label], select[aria-label]")).find(o=>(o.getAttribute("aria-label")??"").startsWith(n));if(r!==void 0&&r.value.trim().length>0)return r.value.trim()}return""}function dr(e){return e.closest('[class*="editor"], [class*="rowCard"], [class*="addCard"]')??void 0}function fd(e){let t=e.closest('[class*="modelEntry"]');if(t===null){let r=dr(e);if(r===void 0)return;let o=Array.from(r.querySelectorAll('[class*="modelAdvanced"]'));return o.find(a=>a.offsetParent!==null)??o[0]}let n=Array.from(t.querySelectorAll('[class*="modelAdvanced"]'));return n.find(r=>r.offsetParent!==null)??n[0]}function ud(e){return e.querySelector('[class*="modelInputTypes"]')!==null}function cd(e,t,n,r,o){!e.isConnected||lr(e)===void 0||Array.from(e.querySelectorAll("button[aria-label]")).some(i=>o.capacity.some(s=>(i.getAttribute("aria-label")??"").startsWith(s)))||en(e,pd(e,xe(r.namespace),o),{t:t.t,onRequest:i=>{ri(n,t,i)}})}function pd(e,t,n){let r=[];for(let o of Array.from(e.querySelectorAll('[class*="modelCatalog"]'))){let a=dr(o);if(a===void 0)continue;let i=We(a,t,n);i===void 0||i.staged||r.push({catalogue:o,route:i.route})}return r}function md(e,t,n){let r=[],o=new Set;for(let a of e){if(o.has(a.card))continue;o.add(a.card);let i=We(a.card,t,n);if(i===void 0)continue;let s=a.card.querySelector('[class*="modelCatalog"]');s!==null&&r.push({catalogue:s,route:i.route})}return r}async function ri(e,t,n){if(!(n.length===0||e.adapting.has(n))){e.adapting.add(n);try{let r,o=()=>r??(r=t.describeNamespace()),a=await o(),i=xe(a.namespace);if(a.writable!==!0||!Qe(i,n))return;let s=jt(i,n);if(s.length===0)return;let d=i[n]??{},c=typeof d.api=="string"?d.api:void 0,m=new Set;for(let g of e.mounted.values())g.props.route===n&&g.props.efforts!==void 0&&m.add(g.props.modelId);let u=Xt(t.api,o,void 0,(g,l,f)=>{ni(e,g,l,f)});for(let g of s){let l=typeof g.id=="string"?g.id:"";if(l.length===0||m.has(l))continue;let f=Gt(s,l);if(f!==void 0||g[de]===!0)continue;let p=Vt(s,l),v=$t(s,l),x=Jt(s,l)??"",k=await u.suggest(n,l,Yt(s,l));if(!k.ok)continue;let w=k.suggestion,E=w.efforts!==!1,b=w.input===void 0?qe(p):qe(w.input),A=w.defaultEffort??x,H=A===x?void 0:A===""?null:A;u.commit(n,l,rr({efforts:nr(E,Xe(Ke(w.efforts)),f),input:Qt(b,p)?void 0:tr(b),defaultEffort:H,manualCompat:Vo(v),appliedCompat:w.compat,routeApi:c,initialCompat:v}))}}catch(r){console.warn("[bre] provider-wide adapt failed:",r)}finally{e.adapting.delete(n)}}}function gd(e){return e.querySelector(`[data-plugin="${J}"]`)!==null}function hd(e,t){return e.route===t.route&&e.routeDisplayName===t.routeDisplayName&&e.routeApi===t.routeApi&&e.routeBaseURL===t.routeBaseURL&&e.modelId===t.modelId&&e.modelName===t.modelName&&e.index===t.index&&e.readOnly===t.readOnly&&e.defaultEffort===t.defaultEffort&&e.staged===t.staged&&e.officialInputTypes===t.officialInputTypes&&pt(e.efforts,t.efforts)&&yd(e.input,t.input)&&bd(e.compat,t.compat)}function bd(e,t){return e===t?!0:e===void 0||t===void 0?!1:JSON.stringify({...e},Object.keys({...e,...t}).sort())===JSON.stringify({...t},Object.keys({...e,...t}).sort())}function yd(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;let n=new Set(e);return e.length===t.length&&t.every(r=>n.has(r))}function wd(e,t){return Array.from(e.querySelectorAll("input[aria-label], select[aria-label]")).some(n=>t.some(r=>(n.getAttribute("aria-label")??"").startsWith(r)))}function We(e,t,n){let r=e.querySelector('[class*="editorRoute"]')?.textContent?.trim();if(r!==void 0&&r.length>0&&Qe(t,r))return{route:r,staged:!1};if(wd(e,n.routeId)){let i=Le(e,n.routeId);return i.length>0&&!Qe(t,i)?{route:i,staged:!0}:void 0}let o=e.querySelector('[class*="editorTitle"], [class*="rowName"]')?.textContent?.trim();if(o===void 0||o.length===0)return;let a=Object.entries(t).find(([,i])=>i.displayName===o);if(a!==void 0)return{route:a[0],staged:!1};if(Qe(t,o))return{route:o,staged:!1}}function xd(e,t){let n=e.querySelector('[class*="editorActions"]');if(n===null)return;let r=Array.from(n.querySelectorAll("button"));if(r.length<2)return;let o=(u,g)=>(u.textContent??"").trim()===g,a=n.querySelector('[class*="primaryButton"]'),i=n.querySelector('[class*="secondaryButton"]');if(a!==null&&i!==null)return{submit:a,cancel:i};let s=[...r].reverse().find(u=>t.apply.some(g=>o(u,g))),d=[...r].reverse().find(u=>t.cancel.some(g=>o(u,g)));if(s!==void 0&&d!==void 0)return{submit:s,cancel:d};let c=r[r.length-1],m=r[r.length-2];if(!(c===void 0||m===void 0))return{submit:c,cancel:m}}function Xo(e,t,n){t.has(e)||(t.add(e),e.addEventListener("click",n,{capture:!0}))}function lr(e){return e.querySelector('[class*="editorActions"]')??e.querySelector('[class*="modelEntry"]')??void 0}function oi(){return lr(ye())!==void 0}function ii(e,t,n){if(!e.isConnected)return;let r=t.labels(),o=lr(e)!==void 0,a=Array.from(e.querySelectorAll("button[aria-label]")).some(s=>r.capacity.some(d=>(s.getAttribute("aria-label")??"").startsWith(d)));if(!o){if(en(e,[],{t:t.t}),n.mounted.size>0){for(let[,d]of n.mounted)d.editor.unmount();n.mounted.clear()}let s=n.editing;n.editing=!1,(s!==!1||ed(n)&&Date.now()>=n.nextFlushAt)&&Za(t,n).catch(d=>{console.error(`[bre] idle pass failed: ${d instanceof Error?d.message:String(d)}`)});return}if(n.editing=!0,!a){for(let[,d]of n.mounted)d.editor.unmount();n.mounted.clear(),n.describePromise??(n.describePromise=t.describeNamespace());let s=r;n.describePromise.then(d=>{cd(e,t,n,d,s)}).catch(d=>{console.error(`[bre] empty-catalog seat failed: ${d instanceof Error?d.message:String(d)}`)});return}n.describePromise??(n.describePromise=t.describeNamespace());let i=s=>{if(!e.isConnected)return;let d=s.namespace,c=xe(d),m=[];for(let u of r.capacity){let g=Array.from(e.querySelectorAll("button[aria-label]")).filter(l=>(l.getAttribute("aria-label")??"").startsWith(u));for(let l of g){let f=dr(l);if(f===void 0)continue;let p=l.closest('[class*="modelEntry"]')??f,v=Le(p,r.modelId);v.length!==0&&m.push({container:fd(l),row:p,modelId:v,card:f})}}en(e,md(m,c,r),{t:t.t,onRequest:u=>{ri(n,t,u)}});for(let[u,g]of n.mounted)m.some(l=>l.container===u)||(g.editor.unmount(),n.mounted.delete(u));if(n.pending.size>0){let u=new Map;for(let l of m){let f=We(l.card,c,r);if(f===void 0)continue;let p=u.get(f.route);p===void 0&&u.set(f.route,p=new Set),p.add(l.modelId)}let g=new Map;for(let[l,f]of n.pending){if(!Qe(c,l))continue;let p=u.get(l),v=[...f.keys()].filter(x=>!p?.has(x));v.length>0&&g.set(l,new Set(v))}for(let[l,f]of g){let p=n.missedScans.get(l);if(p!==void 0)for(let v of f)p.has(v)&&(nn(n,l,v,void 0),p.delete(v))}n.missedScans=g}m.forEach((u,g)=>{let l=u.container;if(l===void 0)return;let f=We(u.card,c,r);if(f===void 0)return;let{route:p,staged:v}=f,x=c[p]??{},k=jt(c,p),w=new Set(k.map(O=>O.id)),E=v||!w.has(u.modelId),b=E?n.pending.get(p)?.get(u.modelId)?.efforts:void 0,A=E?b==="keep"?void 0:b:Gt(k,u.modelId),H=E?n.pending.get(p)?.get(u.modelId)?.input:Vt(k,u.modelId),U=E?n.pending.get(p)?.get(u.modelId)?.compat:$t(k,u.modelId),B=E?n.pending.get(p)?.get(u.modelId)?.defaultEffort??void 0:Jt(k,u.modelId),_=E?Le(u.row,r.modelName):"",te=E?_.length>0?_:void 0:Yt(k,u.modelId),S=v?Le(u.card,r.apiProtocol):"",D=v?Le(u.card,r.baseUrl):"",P=xd(u.card,r);P===void 0?n.signalsUnavailable=!0:(n.signalsUnavailable=!1,Xo(P.submit,n.submitWired,()=>{let O=We(u.card,c,r)?.route??p;n.committing.add(O),ve(n)}),Xo(P.cancel,n.cancelWired,()=>{let O=We(u.card,c,r)?.route??p;od(n,O)}));let F=v&&S.length>0?S:typeof x.api=="string"?x.api:void 0,W=v&&D.length>0?D:typeof x.baseURL=="string"?x.baseURL:void 0,z={route:p,routeDisplayName:v?p:typeof x.displayName=="string"?x.displayName:p,...F===void 0?{}:{routeApi:F},...W===void 0?{}:{routeBaseURL:W},modelId:u.modelId,...te===void 0?{}:{modelName:te},...A===void 0?{}:{efforts:A},...H===void 0?{}:{input:H},...U===void 0?{}:{compat:U},...B===void 0?{}:{defaultEffort:B},index:g,staged:E,officialInputTypes:ud(l),api:Xt(t.api,void 0,(O,K,Z,ce,ze,Ne)=>{nn(n,O,K,Z,ce,ze,Ne)},(O,K,Z)=>{ni(n,O,K,Z)},O=>{rd(n,O,u.modelId)},()=>(We(u.card,c,r)?.staged??v)||!w.has(u.modelId)),readOnly:s.writable!==!0,t:t.t},j=n.mounted.get(l);if(j!==void 0){hd(j.props,z)||(j.props=z,j.editor.render(z));return}if(gd(l))return;let L=t.mount(l,z);n.mounted.set(l,{editor:L,props:z})})};n.describePromise.then(i,()=>{n.describePromise=void 0})}function V(e,t,n){e.getAttribute(t)!==n&&e.setAttribute(t,n)}function mt(e,t){e!==void 0&&e.hidden!==t&&(e.hidden=t)}function Ae(e,t,n){e.classList.contains(t)!==n&&(n?e.classList.add(t):e.classList.remove(t))}function rn(e,t){e!==void 0&&e.textContent!==t&&(e.textContent=t)}var fr=require("react");var X=require("react");function si(e){if(typeof e!="string")return;let t="";for(let n of e){let r=n.codePointAt(0)??0;r<32||r===127||(t+=n)}if(t=t.trim(),t.length!==0)return t.slice(0,40)}function on(e){return typeof e=="string"&&/^[\x21-\x7E]+$/.test(e)}function vd(e){for(let t of["error","message"]){let n=e[t];if(typeof n=="string"&&n.length>0)return n}}function kd(e){if(!N(e))return;let t=e.ref;if(typeof t!="string"||t.length===0)return;let n=e.alias,r=e.configured,o=e.masked;return{ref:t,...typeof n=="string"&&n.length>0?{alias:n}:{},enabled:e.enabled===!0,configured:typeof r=="boolean"?r:null,...typeof o=="string"&&o.length>0?{masked:o}:{}}}function Ed(e){let t=e.entries;if(!Array.isArray(t))return;let n=[];for(let a of t){let i=kd(a);i!==void 0&&n.push(i)}let r=e.enabledRef,o=e.route;return{ok:!0,route:typeof o=="string"?o:"",enabledRef:typeof r=="string"&&r.length>0?r:null,entries:n}}async function Td(e){let t;try{t=await e.json()}catch{t=void 0}if(!N(t))return{ok:!1};if(t.ok===!0){let r=Ed(t);if(r!==void 0)return r}let n=vd(t);return n===void 0?{ok:!1}:{ok:!1,error:n}}async function Ze(e,t){let n=`${Cr}?route=${encodeURIComponent(e)}`;try{let r=await fetch(n,t===void 0?{method:"GET",cache:"no-store",credentials:"same-origin"}:{method:"POST",cache:"no-store",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify(t)});return await Td(r)}catch{return{ok:!1}}}var ai={list:e=>Ze(e),add:(e,t,n)=>Ze(e,{op:"add",value:t,...n===void 0?{}:{alias:n}}),enable:(e,t)=>Ze(e,{op:"enable",ref:t}),rename:(e,t,n)=>Ze(e,{op:"rename",ref:t,...n===void 0?{}:{alias:n}}),remove:(e,t)=>Ze(e,{op:"remove",ref:t}),replace:(e,t,n)=>Ze(e,{op:"value",ref:t,value:n}),async reveal(e,t){try{let n=await fetch(`${Ot}?route=${encodeURIComponent(e)}&ref=${encodeURIComponent(t)}`,{method:"GET",cache:"no-store",credentials:"same-origin"});if(!n.ok)return;let r=await n.json();if(!N(r)||r.ok!==!0)return;let o=r.key;return typeof o=="string"&&o.length>0?o:void 0}catch{return}}};var R=require("react/jsx-runtime"),Md="M3.9 8.35 6.6 11.05 12.1 5.5",Sd=["M8 3.9v8.2","M3.9 8h8.2"];function di({paths:e}){return(0,R.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:e.map(t=>(0,R.jsx)("path",{d:t},t))})}function Ld(e,t){return e.masked!==void 0?e.masked:e.configured===!1?t("keysMissing"):"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"}function Ad(e){return e.alias??e.masked??e.ref}function li(e){let{route:t,t:n}=e,r=e.client??ai,o=(0,X.useId)(),[a,i]=(0,X.useState)(void 0),[s,d]=(0,X.useState)(null),[c,m]=(0,X.useState)(void 0),[u,g]=(0,X.useState)(!1),[l,f]=(0,X.useState)(void 0),[p,v]=(0,X.useState)(""),[x,k]=(0,X.useState)(""),[w,E]=(0,X.useState)(void 0),b=(0,X.useCallback)((S,D)=>{if(!S.ok){m({kind:"error",text:S.error??n("keysUnreachable")});return}i(S.entries),d(S.enabledRef),m(D===void 0?void 0:{kind:"status",text:D})},[n]);(0,X.useEffect)(()=>{let S=!0;return(async()=>{let D=await r.list(t);S&&b(D,void 0)})(),()=>{S=!1}},[b,r,t]);let A=(0,X.useCallback)(async(S,D)=>{g(!0),E(void 0),f(void 0);try{b(await S(),D)}finally{g(!1)}},[b]),H=()=>{f(void 0),v(""),k("")},U=(S,D)=>{f({kind:S,ref:D.ref}),v(S==="alias"?D.alias??"":""),k(""),E(void 0)},B=()=>{if(u||l===void 0)return;let S=l.kind,D=l.ref;if(S!=="alias"&&!on(x))return;let P=si(p);g(!0),(async()=>{try{if(S==="add"){let W=await r.add(t,x,P);b(W,n("keysAdded")),W.ok&&H();return}if(D===void 0)return;let F=S==="alias"?await r.rename(t,D,P):await r.replace(t,D,x);b(F,n(S==="alias"?"keysRenamed":"keysReplaced")),F.ok&&H()}finally{g(!1)}})()},_=()=>{if(l===void 0)return null;let S=l.kind,D=S!=="alias",P=D&&x.length>0&&!on(x);return(0,R.jsxs)("div",{className:"bre-keys-form",children:[(0,R.jsxs)("div",{className:"bre-keys-form-fields",children:[S==="value"?null:(0,R.jsx)("input",{className:"bre-text-input bre-keys-name",type:"text",value:p,placeholder:n("keysAliasPlaceholder"),"aria-label":n("keysAlias"),disabled:u,autoFocus:S==="alias",onChange:F=>v(F.target.value)}),D?(0,R.jsx)("input",{className:"bre-text-input bre-keys-secret",type:"password",autoComplete:"new-password",spellCheck:!1,value:x,placeholder:n(S==="add"?"keysValuePlaceholder":"keysNewValuePlaceholder"),"aria-label":n("keysValue"),"aria-invalid":P,disabled:u,autoFocus:!0,onChange:F=>k(F.target.value)}):null]}),P?(0,R.jsx)("p",{className:"bre-effort-message bre-error",role:"alert",children:n("keysAddIllegal")}):null,(0,R.jsxs)("div",{className:"bre-keys-form-actions",children:[(0,R.jsx)("button",{type:"button",className:"bre-link-button",disabled:u,onClick:H,children:n("keysCancel")}),(0,R.jsx)("button",{type:"button",className:"bre-primary-button",disabled:u||D&&!on(x),onClick:B,children:n(S==="add"?"keysAddConfirm":"keysSave")})]})]})},te=()=>l?.kind==="add"?(0,R.jsx)("li",{className:"bre-keys-form-row",children:_()}):(0,R.jsx)("li",{className:"bre-keys-add-row",children:(0,R.jsxs)("button",{type:"button",className:"bre-keys-add",disabled:u,onClick:()=>{f({kind:"add"}),v(""),k(""),E(void 0)},children:[(0,R.jsx)("span",{className:"bre-keys-add-mark","aria-hidden":"true",children:(0,R.jsx)(di,{paths:Sd})}),n("keysAdd")]})});return a===void 0?c===void 0?(0,R.jsx)("div",{className:"bre-keys"}):(0,R.jsxs)("div",{className:"bre-keys",children:[(0,R.jsx)("p",{className:"bre-effort-message bre-"+c.kind,role:c.kind==="error"?"alert":"status",children:c.text}),(0,R.jsx)("ul",{className:"bre-keys-list",children:te()})]}):(0,R.jsxs)("div",{className:"bre-keys",children:[(0,R.jsxs)("ul",{className:"bre-keys-list",children:[a.map(S=>{let D=Ad(S);return(0,R.jsxs)(X.Fragment,{children:[(0,R.jsxs)("li",{className:"bre-keys-row","data-state":S.configured===!1?"missing":"ready",children:[S.alias===void 0?null:(0,R.jsx)("span",{className:"bre-keys-alias",children:S.alias}),(0,R.jsx)("span",{className:S.alias===void 0?"bre-keys-mask bre-keys-mask-plain":"bre-keys-mask",children:Ld(S,n)}),(0,R.jsx)("span",{className:"bre-keys-actions",children:w===S.ref?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("button",{type:"button",className:"bre-link-button bre-keys-danger",disabled:u,onClick:()=>{A(()=>r.remove(t,S.ref),n("keysRemoved"))},children:n("keysConfirmRemove")}),(0,R.jsx)("button",{type:"button",className:"bre-link-button",disabled:u,onClick:()=>E(void 0),children:n("keysCancel")})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("button",{type:"button",className:"bre-link-button",disabled:u,onClick:()=>{E(S.ref),f(void 0)},children:n("keysRemove")}),(0,R.jsx)("button",{type:"button",className:"bre-link-button",disabled:u,onClick:()=>U("alias",S),children:n("keysAlias")}),(0,R.jsx)("button",{type:"button",className:"bre-link-button",disabled:u,onClick:()=>U("value",S),children:n("keysEdit")})]})}),(0,R.jsxs)("label",{className:"bre-keys-enable",title:n("keysEnable",{name:D}),children:[(0,R.jsx)("input",{type:"radio",name:o,className:"bre-keys-enabled",checked:S.enabled,disabled:u,"aria-label":n("keysEnable",{name:D}),onChange:()=>{A(()=>r.enable(t,S.ref),n("keysEnabledNote",{name:D}))}}),(0,R.jsx)("span",{className:"bre-keys-mark","aria-hidden":"true",children:S.enabled?(0,R.jsx)(di,{paths:[Md]}):null}),(0,R.jsx)("span",{className:"bre-keys-enable-text",children:n("keysEnabled")})]})]}),l!==void 0&&l.ref===S.ref?(0,R.jsx)("li",{className:"bre-keys-form-row",children:_()}):null]},S.ref)}),te()]}),c===void 0?null:(0,R.jsx)("p",{className:"bre-effort-message bre-"+c.kind,role:c.kind==="error"?"alert":"status",children:c.text})]})}var an="bre-key-managed",Rd="bre-keys-host",ur="data-bre-key-host",Od="data-bre-key-input",sn="data-bre-region",Re=new WeakMap;function Hd(e){let t=e.querySelector(`input[${Od}]`);if(t instanceof HTMLInputElement)return t;let n=e.querySelector('input[type="password"]');return n instanceof HTMLInputElement?n:void 0}function fi(e){let t=Re.get(e)?.host;if(t!==void 0&&t.isConnected)return t;let n=e.nextElementSibling;return n instanceof HTMLElement&&n.hasAttribute(ur)?n:void 0}function ui(e,t){let n=t.route;if(n===void 0||n.length===0||Hd(e)===void 0||e.parentElement===null)return;Ae(e,an,!0);let r=Re.get(e),o=fi(e);o===void 0&&(r!==void 0&&ci(e,r),o=e.ownerDocument.createElement("div"),o.className=Rd,e.after(o)),V(o,ur,n);let a=e.getAttribute(sn);a===null?o.hasAttribute(sn)&&o.removeAttribute(sn):V(o,sn,a);let i=()=>(0,fr.createElement)(ke,{fallbackText:t.t("keysPanelFailed")},(0,fr.createElement)(li,{route:n,t:t.t,client:t.client})),s=Re.get(e);if(s!==void 0&&s.route===n){(s.t!==t.t||s.client!==t.client)&&(s.t=t.t,s.client=t.client,s.mount.root.render(i()));return}s!==void 0&&(Re.delete(e),s.mount.root.unmount()),Re.set(e,{route:n,host:o,mount:ft(o,i(),{sync:!0}),t:t.t,client:t.client})}function ci(e,t){Re.delete(e),Pe(t.mount)}function dn(e){Ae(e,an,!1);let t=Re.get(e);t!==void 0&&ci(e,t),fi(e)?.remove()}function pi(){for(let e of Array.from(document.querySelectorAll(`[${ur}]`))){let t=e.previousElementSibling;t instanceof HTMLElement&&Re.has(t)?dn(t):e.remove()}}var mi="http://www.w3.org/2000/svg",_d="data-bre-icon";function Nd(e){let t=document.createElementNS(mi,"path");return t.setAttribute("d",e),t}function gi(e,t){let n=document.createElementNS(mi,"svg");return n.setAttribute("viewBox","0 0 16 16"),n.setAttribute("width","16"),n.setAttribute("height","16"),n.setAttribute("fill","none"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","1.5"),n.setAttribute("stroke-linecap","round"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("aria-hidden","true"),n.setAttribute("focusable","false"),n.setAttribute(_d,e),n.append(...t.map(Nd)),n}var fn="bre-key-field",wi="bre-key-eye",ln="data-bre-key-input",xi="data-bre-eye-show",vi="data-bre-eye-hide",hi=["M1.5 8S4 3.75 8 3.75 14.5 8 14.5 8 12 12.25 8 12.25 1.5 8 1.5 8Z","M6.2 8a1.8 1.8 0 1 0 3.6 0 1.8 1.8 0 0 0-3.6 0Z"],mr=new WeakMap;function cr(e){let t=e.querySelector(`input[${ln}]`);if(t instanceof HTMLInputElement)return t;let n=e.querySelector('input[type="password"]');return n instanceof HTMLInputElement?n:void 0}function ki(e){for(let t of Array.from(e.children))if(t instanceof HTMLButtonElement&&t.classList.contains(wi))return t}function Ei(e,t){let n=cr(e);if(n===void 0){un(e);return}mr.set(e,t),V(n,ln,""),Ae(e,fn,!0);let r=ki(e)??Dd(e);V(r,xi,t.t("keyRevealShow")),V(r,vi,t.t("keyRevealHide")),pr(r,n)}function un(e){let t=ki(e);t!==void 0&&t.remove(),mr.delete(e),Ae(e,fn,!1);let n=e.querySelector(`input[${ln}]`);n instanceof HTMLInputElement&&(n.removeAttribute(ln),n.type="password")}async function Id(e){try{let t=await fetch(`${Ot}?route=${encodeURIComponent(e)}`,{method:"GET",cache:"no-store",credentials:"same-origin"});if(!t.ok)return;let n=await t.json();return n===null||typeof n!="object"||n.ok!==!0?void 0:typeof n.key=="string"&&n.key.length>0?n.key:void 0}catch{return}}function pr(e,t){let n=t.type!=="password";V(e,"aria-pressed",n?"true":"false");let r=e.getAttribute(n?vi:xi);r!==null&&(V(e,"aria-label",r),V(e,"title",r)),mt(e,t.disabled)}function bi(e,t){let n=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");n?.set===void 0?e.value=t:n.set.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0}))}function Dd(e){let t=document.createElement("button");t.type="button",t.className=wi,t.append(yi("eye"),yi("eye-off"));let n,r=async()=>{let o=cr(e),a=mr.get(e);if(o===void 0||a===void 0)return;if(o.type!=="password"){n!==void 0&&o.value===n&&bi(o,""),n=void 0,o.type="password",pr(t,o);return}let i=a.route;if(i!==void 0&&n===void 0&&o.value.length===0){V(t,"aria-busy","true");let s;try{s=await(a.loadKey??Id)(i)}catch{s=void 0}if(t.hasAttribute("aria-busy")&&t.removeAttribute("aria-busy"),s===void 0){let d=a.t("keyRevealFailed");V(t,"aria-label",d),V(t,"title",d);return}cr(e)===o&&o.value.length===0&&(n=s,bi(o,s))}o.type="text",pr(t,o)};return t.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),r()}),e.append(t),t}function yi(e){let t=e==="eye-off"?[...hi,"M2.5 13.5 13.5 2.5"]:hi;return gi(e,t)}var gr="bre-editor-tabs",Pd="bre-editor-tab",cn="data-bre-tab-id",bt="bre-tabbed",He="data-bre-tab",Ti="data-bre-provider",fe="data-bre-region",ht="data-bre-editor-body",yt="data-bre-details";var Cd=".bre-headers",Oe="provider",et="models",tt="advanced",Fd=[Oe,et,tt],Kd="none",Mi=Fd,Si=gr,Li=Pd,Ai=cn,pn='[class*="editorActions"], [class*="modelList"], [class*="modelCatalog"], [class*="modelEntry"]',qd='[class*="modelCatalog"], [class*="modelList"], [class*="modelEntry"]',Ri='[class*="rowCard"], [class*="addCard"], li';function Oi(){return{warned:new WeakSet}}function gn(e){return e===null?null:e.closest(Ri)}function Hi(e,t){V(e,He,t),Ii(e)}function hr(e,t,n){if(!e.isConnected)return;let r=new Set;for(let o of Array.from(e.querySelectorAll(pn))){let a=o.closest(Ri);a!==null&&r.add(a)}for(let o of Array.from(e.querySelectorAll(`.${bt}`)))r.has(o)||mn(o);for(let o of r)try{zd(o,t)}catch(a){n.warned.has(o)||(n.warned.add(o),console.warn("[bre] editor tabs: rolled a provider card back to the official layout:",a)),mn(o)}}function _i(){for(let e of Array.from(document.querySelectorAll(`.${bt}`))){e.classList.remove(bt),e.removeAttribute(He),e.removeAttribute(ht);for(let t of Array.from(e.querySelectorAll(`[${fe}]`)))t.removeAttribute(fe)}for(let e of Array.from(document.querySelectorAll(`[${He}]`)))e.removeAttribute(He);for(let e of Array.from(document.querySelectorAll(`[${fe}]`)))e.removeAttribute(fe);for(let e of Array.from(document.querySelectorAll(`[${ht}]`)))e.removeAttribute(ht);for(let e of Array.from(document.querySelectorAll(`details[${yt}]`)))e.removeAttribute("open"),e.removeAttribute(yt);for(let e of Array.from(document.querySelectorAll(`.${fn}`)))un(e);for(let e of Array.from(document.querySelectorAll(`.${an}`)))dn(e);pi()}function Bd(e){for(let n of Array.from(e.children))if(n instanceof HTMLElement&&!n.matches('[class*="editorHeader"], [class*="editorTitle"], [class*="editorActions"], [class*="editorRoute"]')&&n.matches('[class*="editor"]')&&(n.querySelector(pn)!==null||n.querySelector("input, select")!==null))return n;let t=e.querySelector(pn);for(;t!==null&&t.parentElement!==e;)t=t.parentElement;return t!==null&&t!==e?t:void 0}function Wd(e){let t={header:void 0,models:void 0,actions:void 0,fields:[]};Ni(e,t,0);let{actions:n,fields:r,header:o,models:a}=t;if(!(n===void 0||r.length===0)&&r.some(i=>i.querySelector("input, select, textarea")!==null))return{header:o,models:a,actions:n,fields:r}}var Ud=4;function Ni(e,t,n){if(!(n>Ud)){for(let r of Array.from(e.children))if(r instanceof HTMLElement&&!r.matches('[class*="bre-"], [data-plugin]')){if(t.header===void 0&&r.matches('[class*="editorHeader"], [class*="editorTitle"]')){t.header=r;continue}if(r.matches('[class*="editorActions"]')){t.actions??(t.actions=r);continue}if(r.matches(qd)){t.models??(t.models=r);continue}if(r.querySelector(pn)!==null){Ni(r,t,n+1);continue}if(r.querySelector('[class*="editorActions"]')!==null){t.actions??(t.actions=r);continue}r.querySelector("input, select, textarea")!==null&&t.fields.push(r)}}}function jd(e){let n=e.querySelector(`[${Ti}]`)?.getAttribute(Ti);return n==null||n===""?void 0:n}function zd(e,t){let n=Bd(e);if(n===void 0){mn(e);return}let r=Wd(n);if(r===void 0){mn(e);return}let o=e.querySelector(Cd),a=jd(e);for(let d of r.fields)V(d,fe,Oe),Ei(d,{t:t.t,route:a}),ui(d,{t:t.t,route:a});r.header!==void 0&&V(r.header,fe,Kd),r.models!==void 0&&V(r.models,fe,et),V(n,ht,""),o!==null&&V(o,fe,tt),Vd(n);let i=new Set([Oe]);r.models!==void 0&&i.add(et),o!==null&&i.add(tt);let s=e.getAttribute(He)??Oe;V(e,He,i.has(s)?s:Oe),Ae(e,bt,!0),Gd(e,t,i)}function Gd(e,t,n){let r=e.querySelector(`.${gr}`);r!==null&&(V(r,"aria-label",t.t("editorTabsLabel")),rn(gt(r,Oe),t.t("editorTabProvider")),rn(gt(r,et),t.t("editorTabModels")),rn(gt(r,tt),t.t("editorTabAdvanced")),mt(gt(r,et),!n.has(et)),mt(gt(r,tt),!n.has(tt)),Ii(e,r))}function Ii(e,t){let n=t??e.querySelector(`.${gr}`);if(n===null)return;let r=e.getAttribute(He)??Oe;for(let o of Array.from(n.querySelectorAll(`[${cn}]`)))V(o,"aria-selected",o.getAttribute(cn)===r?"true":"false")}function gt(e,t){for(let n of Array.from(e.children))if(n instanceof HTMLElement&&n.getAttribute(cn)===t)return n}function mn(e){e.classList.remove(bt),e.removeAttribute(He),e.removeAttribute(ht);for(let t of Array.from(e.querySelectorAll(`[${fe}]`)))t.getAttribute(fe)===Oe&&(un(t),dn(t)),t.removeAttribute(fe);$d(e)}function Vd(e){for(let t of Array.from(e.querySelectorAll("details")))t.hasAttribute("open")||(V(t,yt,"closed"),V(t,"open",""))}function $d(e){for(let t of Array.from(e.querySelectorAll(`details[${yt}]`)))t.removeAttribute("open"),t.removeAttribute(yt)}var wt="data-bre-drag-handle",br="data-bre-row-head",yr="data-bre-drop-side",hn="bre-row-dragging",bn="bre-row-drop-target",qi="bre-drag-ghost",Bi="bre-drop-line",Di="http://www.w3.org/2000/svg",Pi=8,Ci=28,Fi=12,Yd="transform 180ms cubic-bezier(0.2, 0.7, 0.3, 1)",Jd='button, a, input, textarea, select, [contenteditable], [role="button"], [role="switch"], [role="checkbox"], [role="textbox"], [role="combobox"]';function yn(){return{sources:new WeakSet,lists:new WeakSet,line:void 0,drag:void 0}}function ue(e){return Array.from(e.children).filter(t=>t instanceof HTMLElement)}function Xd(e,t){let n=e.style.order;if(n==="")return t;let r=Number.parseInt(n,10);return Number.isNaN(r)?t:r}function Ue(e){return ue(e).map((t,n)=>({row:t,key:Xd(t,n),index:n})).sort((t,n)=>t.key-n.key||t.index-n.index).map(t=>t.row)}function xt(e,t){let n=Ue(e),r=n.filter(s=>t.includes(s)),o=r.map(s=>n.indexOf(s)),a=t.filter(s=>r.includes(s)),i=new Map;n.forEach((s,d)=>i.set(s,d)),o.forEach((s,d)=>{let c=a[d];c!==void 0&&i.set(c,s)});for(let[s,d]of i){let c=String(d);s.style.order!==c&&(s.style.order=c)}}function wr(e,t){let n=ue(e),r=n.map(o=>o.offsetTop);t(),n.forEach((o,a)=>{let i=r[a]-o.offsetTop;i!==0&&(o.style.transition="none",o.style.transform=`translateY(${i}px)`,o.offsetHeight,o.style.transition=Yd,o.style.transform="")})}function vt(e,t){return Ue(e).map(n=>t(n)).filter(n=>n!==void 0)}function Wi(e,t,n){let r=new Map;for(let[i,s]of t.entries())r.has(s)||r.set(s,i);let a=[...Ue(e).filter(i=>n(i)!==void 0)].sort((i,s)=>{let d=r.get(n(i))??Number.MAX_SAFE_INTEGER,c=r.get(n(s))??Number.MAX_SAFE_INTEGER;return d-c});xt(e,a)}function wn(e){for(let t of e)t.style.order="",t.style.transition="",t.style.transform=""}function Ui(e,t,n,r){let a=e.filter(i=>i!==t).indexOf(n);return a<0?Math.max(0,e.indexOf(t)):r?a+1:a}function ji(e,t){let n,r=Number.POSITIVE_INFINITY;for(let o of e){let a=o.getBoundingClientRect(),i=t<a.top?a.top-t:t>a.bottom?t-a.bottom:0;i<r&&(r=i,n=o)}return n}function Qd(e,t){let n=e.getBoundingClientRect();return n.height<=0?!0:t>n.top+n.height/2}function zi(e,t){let n=e.getBoundingClientRect();return t?n.bottom+Pi/2-1:n.top-Pi/2-1}function Gi(){let e=document.createElementNS(Di,"svg");e.setAttribute("width","10"),e.setAttribute("height","14"),e.setAttribute("viewBox","0 0 10 14"),e.setAttribute("fill","none"),e.setAttribute("aria-hidden","true");let t=[[2.5,3],[7.5,3],[2.5,7],[7.5,7],[2.5,11],[7.5,11]];for(let[n,r]of t){let o=document.createElementNS(Di,"circle");o.setAttribute("cx",String(n)),o.setAttribute("cy",String(r)),o.setAttribute("r","1.2"),o.setAttribute("fill","currentColor"),e.appendChild(o)}return e}function Vi(e,t){let n=document.createElement("div");n.className=qi,n.setAttribute("aria-hidden","true"),n.appendChild(Gi());let r=document.createElement("span");r.className="bre-drag-ghost-name";let o=t??e.querySelector('[class*="rowName"]')?.textContent?.trim();return r.textContent=o===void 0?"":o,n.appendChild(r),n}function Zd(e){return!(e instanceof Element)||e.closest(`[${wt}]`)!==null?!1:e.closest(Jd)!==null}function $i(e){return e.parentElement??void 0}function Yi(e){for(let t of ue(e))t.classList.remove(bn),t.removeAttribute(yr)}function Ji(e){let t=e.parentElement;for(;t!==null;){if(el(t))return t;t=t.parentElement}let n=document.scrollingElement;return n instanceof HTMLElement&&n.scrollHeight>n.clientHeight?n:void 0}function el(e){if(e.scrollHeight<=e.clientHeight)return!1;let t=e.style.overflowY,n=t.length>0?t:window.getComputedStyle(e).overflowY;return n==="auto"||n==="scroll"||n==="overlay"}function Xi(e,t){let n=e.getBoundingClientRect();return n.height<=0?0:t<n.top+Ci?-Fi:t>n.bottom-Ci?Fi:0}function Qi(e,t,n){if(t.scrollStep===n)return;if(t.scrollStep=n,n===0){t.frame!==void 0&&(window.cancelAnimationFrame(t.frame),t.frame=void 0);return}let r=t.scroller;if(r===void 0||t.frame!==void 0)return;let o=()=>{t.frame=void 0,!(e.drag!==t||t.scrollStep===0)&&(r.scrollTop+=t.scrollStep,t.frame=window.requestAnimationFrame(o))};t.frame=window.requestAnimationFrame(o)}function tl(e){let t=e.line;if(t!==void 0&&t.isConnected)return t;let n=document.createElement("div");return n.className=Bi,n.setAttribute("aria-hidden","true"),document.body.appendChild(n),e.line=n,n}function nl(e,t,n){let r=tl(e),o=t.getBoundingClientRect();r.style.top=`${zi(t,n)}px`,r.style.left=`${o.left}px`,r.style.width=`${o.width}px`,r.style.display="block",r.setAttribute(yr,n?"after":"before")}function rl(e){e.line!==void 0&&(e.line.style.display="none")}function ol(e){let t=e.drag;e.drag=void 0,t!==void 0&&(Qi(e,t,0),rl(e),t.row.classList.remove(hn),Yi(t.list),t.dropped||wr(t.list,()=>{xt(t.list,t.before)}))}function il(e,t,n,r){if(Zd(t.target)){t.preventDefault();return}let o=$i(e),a=n.idOf(e);if(o===void 0||a===void 0){t.preventDefault();return}let i={row:e,list:o,before:Ue(o),scroller:Ji(o),adapter:n,scrollStep:0,frame:void 0,dropped:!1};r.drag=i,e.classList.add(hn);let s=Vi(e,n.labelOf(e));Number.isFinite(t.clientX)&&Number.isFinite(t.clientY)&&(s.style.left=`${t.clientX}px`,s.style.top=`${t.clientY}px`),document.body.appendChild(s);let d=t.dataTransfer;if(d!=null)try{d.effectAllowed="move",d.setData("text/plain",a),d.setDragImage(s,Math.round(s.offsetWidth/2),Math.round(s.offsetHeight/2))}catch{}window.setTimeout(()=>{s.remove()},0)}function sl(e,t,n){let r=n.drag;if(r===void 0||r.list!==e)return;let o=t.target,a=o instanceof Element?r.adapter.rowOf(o,e):void 0,i=Ue(e),s=a!==void 0&&i.includes(a)?a:ji(i,t.clientY);if(s===void 0)return;t.preventDefault();let d=t.dataTransfer;d!=null&&(d.dropEffect="move");let c=Qd(s,t.clientY),m=Ui(i,r.row,s,c);m!==i.indexOf(r.row)&&wr(e,()=>{xt(e,In(i,r.row,m))}),Yi(e),s.classList.add(bn),s.setAttribute(yr,c?"after":"before"),nl(n,s,c),Qi(n,r,r.scroller===void 0?0:Xi(r.scroller,t.clientY))}function al(e,t){t.lists.has(e)||(t.lists.add(e),e.addEventListener("dragover",n=>{sl(e,n,t)}),e.addEventListener("drop",n=>{let r=t.drag;r===void 0||r.list!==e||(n.preventDefault(),r.dropped=!0,r.adapter.commit(e))}))}function dl(e,t,n,r){r.sources.has(e)||(r.sources.add(e),n.seatDrags&&(e.setAttribute(br,"1"),e.setAttribute("draggable","true")),e.addEventListener("dragstart",o=>{il(t,o,n,r)}),e.addEventListener("dragend",()=>{ol(r)}))}function ll(e,t,n,r){e.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation()}),e.addEventListener("keydown",o=>{if(o.key!=="ArrowUp"&&o.key!=="ArrowDown")return;let a=$i(t);if(a===void 0)return;let i=Ue(a),s=i.indexOf(t);if(s<0)return;let d=s+(o.key==="ArrowUp"?-1:1);d<0||d>=i.length||(o.preventDefault(),wr(a,()=>{xt(a,In(i,t,d))}),n.commit(a),e.focus())})}function Ki(e,t,n,r){let o=r.gripLabel(t,n),a=r.gripHint();e.getAttribute(wt)!==n&&e.setAttribute(wt,n),e.getAttribute("aria-label")!==o&&e.setAttribute("aria-label",o),e.getAttribute("title")!==a&&e.setAttribute("title",a)}function fl(e,t,n,r,o){let a=t.querySelector(`[${wt}]`);if(a!==null){Ki(a,e,n,r);return}r.decorate?.(e,t);let i=document.createElement("span");i.className="bre-drag-grip",i.setAttribute("role","button"),i.setAttribute("tabindex","0"),i.setAttribute("draggable","true"),i.appendChild(Gi()),Ki(i,e,n,r),ll(i,e,r,o),dl(r.seatDrags?t:i,e,r,o),t.insertBefore(i,t.firstChild)}function xn(e,t,n,r){if(e.isConnected){al(t,r);for(let o of ue(t)){let a=n.idOf(o);if(a===void 0)continue;let i=n.seatOf(o);i!==void 0&&fl(o,i,a,n,r)}r.drag===void 0&&Wi(t,n.order(vt(t,n.idOf)),n.idOf)}}function vn(e){e.drag=void 0;for(let t of Array.from(document.querySelectorAll(`[${wt}]`)))t.remove();for(let t of Array.from(document.querySelectorAll(`[${br}]`)))t.removeAttribute(br),t.removeAttribute("draggable");for(let t of Array.from(document.querySelectorAll(`.${hn}, .${bn}`)))t.classList.remove(hn,bn);for(let t of Array.from(document.querySelectorAll(`.${Bi}`)))t.remove();for(let t of Array.from(document.querySelectorAll(`.${qi}`)))t.remove();e.line=void 0}var kt="data-bre-row-provider",Zi="{provider}",ul=["rowCard","setupCard"];function es(){return yn()}function Et(e){for(let t of ul)for(let n of Array.from(e.querySelectorAll(`[class*="${t}"]`))){let r=n.parentElement;if(!(r===null||r.tagName!=="UL")&&ue(r).length!==0)return r}}function Tt(e){return e.querySelector('[class*="rowHead"]')??void 0}function nt(e){let t=e.querySelector('[class*="rowName"]')?.textContent?.trim();return t!==void 0&&t.length>0?t:void 0}function cl(e){let t=e.indexOf(Zi);if(!(t<0))return{prefix:e.slice(0,t),suffix:e.slice(t+Zi.length)}}function pl(e){let t=e.trim();if(t.length===0)return;let n=/^(.*) \(([^()]*)\)$/.exec(t);if(n!==null){let r=n[2];return r.length===0?void 0:r}return/\s/.test(t)?void 0:t}var ml='[class*="rowCard"], [class*="setupCard"], [class*="addCard"]';function gl(e){let t=e.closest(ml);for(let n=e;n!==null&&n!==t;n=n.parentElement)if(n.matches('[data-plugin], [class*="bre-"]'))return!0;return!1}function je(e,t){let n=e.querySelector("[data-bre-provider]")?.getAttribute("data-bre-provider");if(typeof n=="string"&&n.length>0)return n;for(let r of t.editProvider){let o=cl(r);if(o!==void 0)for(let a of Array.from(e.querySelectorAll("button[aria-label]"))){if(gl(a))continue;let i=a.getAttribute("aria-label")??"";if(i.length<=o.prefix.length+o.suffix.length||!i.startsWith(o.prefix)||!i.endsWith(o.suffix))continue;let s=pl(i.slice(o.prefix.length,i.length-o.suffix.length));if(s!==void 0)return s}}}function xr(e){let t=e.getAttribute(kt);return t===null||t.length===0?void 0:t}function hl(e){return vt(e,xr)}function ts(e,t,n){if(!e.isConnected)return;let r=Et(e);if(r===void 0)return;let o=t.labels();for(let a of ue(r)){let i=je(a,o);if(i===void 0){a.removeAttribute(kt);continue}xr(a)!==i&&a.setAttribute(kt,i)}xn(e,r,bl(t),n)}function bl(e){return{rowOf:t=>{let n=t.closest("li");return n instanceof HTMLElement?n:void 0},idOf:xr,labelOf:nt,order:t=>Xr(t),commit:t=>{Yr(hl(t))},seatOf:Tt,seatDrags:!0,gripLabel:(t,n)=>e.t("providerReorderAria",{provider:nt(t)??n}),gripHint:()=>e.t("providerReorderHint")}}function ns(e){vn(e);let t=Array.from(document.querySelectorAll(`[${kt}]`));wn(t);for(let n of t)n.removeAttribute(kt)}var rt="data-bre-provider-switch",kn="bre-row-disabled";function os(){return{switches:new WeakSet}}function is(e,t,n){if(!e.isConnected)return;let r=Et(e);if(r===void 0)return;let o=t.labels();for(let a of Array.from(r.children)){if(!(a instanceof HTMLElement))continue;let i=je(a,o);if(i===void 0)continue;let s=Tt(a);s!==void 0&&(yl(a,s,i,t,n),a.classList.toggle(kn,!Pt(i)))}}function ss(){for(let e of Array.from(document.querySelectorAll(`[${rt}]`)))e.remove();for(let e of Array.from(document.querySelectorAll(`.${kn}`)))e.classList.remove(kn)}function yl(e,t,n,r,o){let a=t.querySelector(`[${rt}]`);if(a!==null){rs(a,e,n,r);return}let i=document.createElement("button");i.className="bre-provider-switch",i.setAttribute("type","button"),i.setAttribute("role","switch"),i.setAttribute(rt,n),rs(i,e,n,r),wl(i,e,o);let s=t.querySelector('[class*="rowActions"]');s===null?t.appendChild(i):s.insertBefore(i,s.firstChild)}function rs(e,t,n,r){let o=r.t("providerToggleAria",{provider:nt(t)??n}),a=r.t("providerToggleHint"),i=Pt(n)?"true":"false";e.getAttribute(rt)!==n&&e.setAttribute(rt,n),e.getAttribute("aria-checked")!==i&&e.setAttribute("aria-checked",i),e.getAttribute("aria-label")!==o&&e.setAttribute("aria-label",o),e.getAttribute("title")!==a&&e.setAttribute("title",a)}function wl(e,t,n){n.switches.has(e)||(n.switches.add(e),e.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation();let o=e.getAttribute(rt);if(o===null)return;let a=!Pt(o);eo(o,a),e.setAttribute("aria-checked",a?"true":"false"),t.classList.toggle(kn,!a)}))}var En="data-bre-provider-delete",as='[class*="rowActions"]',ds='[class*="dangerButton"]',xl="bre-provider-delete";function ls(e,t){if(!e.isConnected)return;let n=Et(e);if(n===void 0)return;let r=t.labels(),o=vl(n)??t.t("providerRemoveDisabled");for(let a of Array.from(n.children)){if(!(a instanceof HTMLElement))continue;let i=je(a,r);if(i===void 0)continue;let s=Tt(a);if(s===void 0)continue;let d=s.querySelector(as);if(d===null)continue;let c=d.querySelector(`[${En}]`);if(d.querySelector(ds)!==null){c!==null&&c.remove();continue}let m=c??kl();d.lastElementChild!==m&&d.appendChild(m),El(m,i,o,t.t("providerRemoveLocked",{provider:nt(a)??i}))}}function fs(){for(let e of Array.from(document.querySelectorAll(`[${En}]`)))e.remove()}function vl(e){let n=e.querySelector(`${as} ${ds}`)?.textContent?.trim()??"";return n.length>0?n:void 0}function kl(){let e=document.createElement("button");return e.className=xl,e.setAttribute("type","button"),e.setAttribute("disabled",""),e}function El(e,t,n,r){e.getAttribute(En)!==t&&e.setAttribute(En,t),e.textContent!==n&&(e.textContent=n),e.getAttribute("aria-label")!==r&&e.setAttribute("aria-label",r),e.getAttribute("title")!==r&&e.setAttribute("title",r)}var Mt="data-bre-row-model",vr="bre-model-grid";function cs(){return yn()}function Tl(e){let t=[];for(let n of Array.from(e.querySelectorAll('[class*="modelList"]')))ue(n).filter(o=>o.matches('[class*="modelEntry"]')).length!==0&&t.push(n);return t}function Tn(e){let t=e.getAttribute(Mt);return t===null||t.length===0?void 0:t}function kr(e,t){let n=e.closest("li");if(n!==null)return je(n,t.labels())}function us(e,t){let n=Le(e,t.labels().modelName);return n.length>0?n:Tn(e)}function Ml(e,t){return{rowOf:n=>{let r=n.closest('[class*="modelEntry"]');return r instanceof HTMLElement?r:void 0},idOf:Tn,labelOf:n=>us(n,t),order:n=>{let r=kr(e,t);return r===void 0?n:lo(r,n)},commit:n=>{let r=kr(n,t);r!==void 0&&so(r,vt(n,Tn))},seatOf:n=>n.querySelector('[class*="modelRow"]')??void 0,seatDrags:!1,gripLabel:(n,r)=>t.t("modelReorderAria",{model:us(n,t)??r}),gripHint:()=>t.t("modelReorderHint"),decorate:(n,r)=>{r.classList.add(vr)}}}function ps(e,t,n){if(!e.isConnected)return;let r=t.labels();for(let o of Tl(e))if(kr(o,t)!==void 0){for(let a of ue(o)){let i=Le(a,r.modelId);if(i.length===0){a.removeAttribute(Mt);continue}Tn(a)!==i&&a.setAttribute(Mt,i)}xn(e,o,Ml(o,t),n)}}function ms(e){vn(e);for(let n of Array.from(document.querySelectorAll(`.${vr}`)))n.classList.remove(vr);let t=Array.from(document.querySelectorAll(`[${Mt}]`));wn(t);for(let n of t)n.removeAttribute(Mt)}var Sl="settings.models",Ee={capacity:["modelAdvanced","Model options","Capacities"],modelId:["modelId","Model ID"],modelName:["modelName","Display name"],routeId:["customRoute","Provider ID"],baseUrl:["baseUrl","Base URL"],apiProtocol:["customApi","API protocol"],apply:["apply","Apply"],cancel:["cancel","Cancel"],editProvider:["editProvider","Edit {provider}"]};function hs(e){let{ctx:t,api:n,t:r,onIdle:o,refreshed:a}=e,i=()=>{let P=t.locale.bind(Sl),F=([W,...z])=>{let j=P(W);return j===W||j.trim()===""?z:[j,...z]};return{capacity:F(Ee.capacity),modelId:F(Ee.modelId),modelName:F(Ee.modelName),routeId:F(Ee.routeId),baseUrl:F(Ee.baseUrl),apiProtocol:F(Ee.apiProtocol),apply:F(Ee.apply),cancel:F(Ee.cancel),editProvider:F(Ee.editProvider)}},s=120,d=ti(),c=es(),m={t:r,labels:i},u=os(),g={t:r,labels:i},l={t:r,labels:i},f=cs(),p={t:r,labels:i},v=Oi(),x={t:r},k,w,E,b,A=!1,H={api:n,describeNamespace:()=>ne(n),t:r,labels:i,onIdle:o,onBackoff:P=>{U(P)},mount(P,F){let W=document.createElement("div");W.className="bre-effort-slot",W.dataset.plugin=J,P.appendChild(W);let z=(0,gs.createRoot)(W),j=L=>{z.render((0,Er.createElement)(ke,{fallbackText:r("renderFailed"),children:a(()=>(0,Er.createElement)(Zt,L))}))};return j(F),{unmount:()=>{z.unmount()},render:j}}};function U(P){A||w!==void 0||(w=window.setTimeout(()=>{w=void 0,B()},P))}function B(){A||k!==void 0||(k=window.setTimeout(()=>{k=void 0,b?.(),ii(ye(),H,d),hr(ye(),x,v),ts(ye(),m,c),is(ye(),g,u),ls(ye(),l),ps(ye(),p,f)},s))}let _=P=>{A||E!==void 0||(b=P,P(),E=new MutationObserver(()=>{P(),hr(ye(),x,v),B()}),E.observe(document.body,{childList:!0,subtree:!0}),B())},te=()=>{A=!0,k!==void 0&&(window.clearTimeout(k),k=void 0),w!==void 0&&(window.clearTimeout(w),w=void 0),E?.disconnect(),E=void 0};return{state:d,labels:i,start:_,stopObserver:te,teardown:()=>{te(),Zo(d,H);for(let[,P]of d.mounted)P.editor.unmount();d.mounted.clear(),ns(c),ss(),fs(),$o(),ms(f),_i()},flushOnUnload:()=>{ei(d,H)},schedule:B}}function Ll(e,t){let n=e?.list?.getSnapshot(),r=n?.current;if(typeof r=="string"&&r.length>0)return r;let o=t?.adapter?.current?.getSnapshot?.()?.key;if(typeof o=="string"&&o.length>0)return o;for(let[a,i]of Object.entries(n?.byId??{}))if(!(i===void 0||(i.retainedBy?.mainView??0)<=0))return typeof i.id=="string"&&i.id.length>0?i.id:a}function bs(e){let t,n=new Map,r=(i,s)=>{for(let[d,c]of n){if(d===s)continue;let m;try{m=i.directoryFor(c.sessionId)===d}catch{m=!1}m||(c.restore(),n.delete(d))}};return{ensure:()=>{let i=e.ctx,s=i.get?.("sessions"),d=i.get?.("uiSession"),c=i.get?.("modelDirectories"),m=Ll(s,d);if(!(m===void 0||c===void 0))try{let u=c.directoryFor(m);return r(c,u),t!==void 0&&t.sessionId===m&&t.directory===u||(n.has(u)||n.set(u,{sessionId:m,restore:vo(u,{configuredEffort:e.configuredEffort})}),t={sessionId:m,directory:u}),u}catch{t=void 0;return}},dispose:()=>{for(let[,i]of n)i.restore();n.clear()}}}var Al="conversation.input.model";function ys(e){return e.querySelector("[data-composer-card]")??void 0}function Tr(e){return e.querySelector(`[data-slot="${Al}"]`)??void 0}function ws(e){let t=Tr(e)??e;return Array.from(t.querySelectorAll('button[aria-haspopup="menu"]'))}function xs(e,t){let n=e.getAttribute("aria-controls");if(n===null||n.length===0)return;let r=t.getElementById(n);if(r!==null)return r.getAttribute("role")==="menu"?r:void 0}function Mr(e=document){let t=ys(e);if(t===void 0)return;for(let r of ws(t)){let o=xs(r,e);if(o!==void 0)return o}let n=Tr(t)??t;for(let r of Array.from(n.querySelectorAll('[role="menu"]')))if(r.previousElementSibling?.matches('button[aria-haspopup="menu"]'))return r}function Sr(e=document){let t=ys(e);if(t===void 0)return;let n=Tr(t),r=ws(t),o=r[0];if(o!==void 0){for(let a of r)if(xs(a,e)!==void 0)return a;for(let a of r)if(a.nextElementSibling?.matches('[role="menu"]'))return a;return n===void 0?r.at(-1):o}}function vs(){return Mr()}function ks(){return Sr()}var _e=require("react");var $=require("react");var I=require("react/jsx-runtime"),Rl=["claude-cli/2.1.161 (external, cli)","claude-code/1.0.0","Kilo-Code/1.0"];function Es(e){let t=0,n=Object.entries(e??{}).map(([r,o])=>({id:t+=1,name:r,value:o}));return n.length===0&&n.push({id:t+=1,name:"",value:""}),{rows:n}}function Ol(e){let t={},n=!1;for(let o of e.rows){let a=o.name.trim();a.length!==0&&(t[a]=o.value,a.toLowerCase()==="user-agent"&&(n=!0))}let r=e.userAgent?.trim();return!n&&r!==void 0&&r.length>0&&(t["user-agent"]=r),t}function Ts({route:e,api:t,t:n}){let r=(0,$.useId)(),[o,a]=(0,$.useState)(void 0),[i,s]=(0,$.useState)({rows:[]}),[d,c]=(0,$.useState)(!1),[m,u]=(0,$.useState)(!1),[g,l]=(0,$.useState)(!0),[f,p]=(0,$.useState)(!1),[v,x]=(0,$.useState)(!1),[k,w]=(0,$.useState)(void 0),[E,b]=(0,$.useState)(void 0),[A,H]=(0,$.useState)(!1),U=(0,$.useRef)(1),B=(0,$.useRef)(null);(0,$.useEffect)(()=>{let L=!0;return(async()=>{try{let O=await ne(t);if(!L)return;let K=Qn(O.namespace,e);a(K),s(Es(K)),x(O.writable!==!0)}catch{L&&x(!0)}finally{L&&l(!1)}})(),()=>{L=!1}},[t,e]),(0,$.useEffect)(()=>{let L=!0;return(async()=>{try{let K=await(await fetch(Kr,{method:"GET"})).json();L&&K.ok===!0&&K.data!==void 0&&b(K.data)}catch{}})(),()=>{L=!1}},[]),(0,$.useEffect)(()=>{let L=B.current;if(L===null)return;let O=()=>{H(L.dataset.breRegion==="advanced")};O();let K=new MutationObserver(O);return K.observe(L,{attributes:!0,attributeFilter:["data-bre-region"]}),()=>{K.disconnect()}},[]);let _=()=>{s(L=>({...L,rows:[...L.rows,{id:U.current+=1,name:"",value:""}]})),w(void 0)},te=(L,O)=>{s(K=>({...K,rows:K.rows.map(Z=>Z.id===L?{...Z,...O}:Z)})),w(void 0)},S=L=>{s(O=>({...O,rows:O.rows.filter(K=>K.id!==L)})),w(void 0)},D=()=>{s(Es(o)),u(!1),w(void 0)},P=async L=>{p(!0),w(void 0);let O;try{O=await Zn(t,e,L)}catch(K){O={ok:!1,error:K instanceof Error?K.message:String(K)}}if(p(!1),!O.ok){w({kind:"error",text:O.error==="no-route"?n("headersNoRoute"):O.error==="read-only"?n("headersReadOnly"):n("headersError",{error:O.error})});return}a(L),u(!1),w({kind:"success",text:Object.keys(L).length===0?n("headersCleared"):n("headersSaved")})},F=Object.entries(o??{}),W=v||f,z=F.length,j=A;return(0,I.jsxs)("div",{className:"bre-headers",ref:B,"data-plugin":J,"data-open":d?"1":"0",children:[!A&&(0,I.jsx)("div",{className:"bre-headers-head",children:m?(0,I.jsx)("span",{className:"bre-effort-title",children:n("headersTitle")}):(0,I.jsxs)("button",{type:"button",className:"bre-headers-disclosure","aria-expanded":d,"aria-label":`${n("headersTitle")} ${e}`,onClick:()=>{c(!d),w(void 0)},children:[(0,I.jsx)("span",{className:"bre-effort-title",children:n("headersTitle")}),g||z===0?null:(0,I.jsx)("span",{className:"bre-headers-count",children:z}),(0,I.jsx)("span",{className:"bre-headers-chevron","aria-hidden":"true",children:"\u203A"})]})}),!d&&!m&&!A?null:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("p",{className:"bre-effort-note",children:n("headersHint")}),E===void 0?null:(0,I.jsxs)(I.Fragment,{children:[E.environment.preferOfficialLayer?(0,I.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictPatched")}):null,E.conflicts.length===0&&(E.headerConflicts?.length??0)===0?null:(0,I.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictOrigin")}),E.environment.siblings.length===0?null:(0,I.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictSiblings",{names:E.environment.siblings.map(L=>L.name).join(", ")})})]}),g?null:m||j?(0,I.jsxs)("div",{className:"bre-headers-edit",children:[(0,I.jsxs)("div",{className:"bre-headers-columns","aria-hidden":"true",children:[(0,I.jsx)("span",{children:n("headersName")}),(0,I.jsx)("span",{children:n("headersValue")}),(0,I.jsx)("span",{})]}),i.rows.map(L=>(0,I.jsxs)("div",{className:"bre-headers-row",children:[(0,I.jsx)("input",{type:"text",className:"bre-text-input bre-headers-name",value:L.name,disabled:W,placeholder:n("headersNamePlaceholder"),"aria-label":n("headersName"),onChange:O=>{te(L.id,{name:O.target.value})}}),(0,I.jsx)("input",{type:"text",className:"bre-text-input bre-headers-value",value:L.value,disabled:W,list:L.name.trim().toLowerCase()==="user-agent"?r:void 0,placeholder:n("headersValue"),"aria-label":n("headersValue"),onChange:O=>{te(L.id,{value:O.target.value})}}),(0,I.jsx)("button",{type:"button",className:"bre-link-button bre-headers-remove",disabled:W,"aria-label":`${n("headersClear")} ${L.name}`,onClick:()=>{S(L.id)},children:"\xD7"})]},L.id)),(0,I.jsx)("button",{type:"button",className:"bre-link-button bre-headers-add",disabled:W,onClick:_,children:n("headersAdd")}),!1,(0,I.jsx)("datalist",{id:r,children:Rl.map(L=>(0,I.jsx)("option",{value:L},L))}),(0,I.jsx)("p",{className:"bre-effort-note bre-headers-legacy",hidden:!0,children:n("headersUserAgentHint")}),(0,I.jsxs)("div",{className:"bre-effort-actions",children:[(0,I.jsx)("button",{type:"button",className:"bre-primary-button",disabled:W,onClick:()=>{P(Ol(i))},children:n("headersSave")}),(0,I.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:W,onClick:D,children:n("headersCancel")})]})]}):(0,I.jsxs)("div",{className:"bre-headers-rows",children:[F.length===0?(0,I.jsx)("p",{className:"bre-effort-note",children:n("headersEmpty")}):F.map(([L,O])=>(0,I.jsxs)("div",{className:"bre-headers-row",children:[(0,I.jsx)("span",{className:"bre-headers-name",children:L}),(0,I.jsx)("span",{className:"bre-headers-value bre-headers-masked",children:"\u2022".repeat(Math.min(O.length,24))})]},L)),v?null:(0,I.jsx)("div",{className:"bre-effort-actions",children:(0,I.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:W,onClick:()=>{u(!0),w(void 0)},children:n("headersEdit")})})]})]}),k===void 0?null:(0,I.jsx)("p",{className:"bre-effort-message bre-"+k.kind,role:k.kind==="error"?"alert":"status",children:k.text})]})}var Lr=require("react");var Hl={provider:"editorTabProvider",models:"editorTabModels",advanced:"editorTabAdvanced"};function Ms({host:e,t}){return(0,Lr.createElement)("div",{className:Si,role:"tablist","aria-label":t("editorTabsLabel")},...Mi.map(n=>(0,Lr.createElement)("button",{key:n,type:"button",role:"tab",className:Li,[Ai]:n,onClick:r=>{r.preventDefault(),r.stopPropagation();let o=gn(e.current);o!==null&&Hi(o,n)}},t(Hl[n]))))}var Ss="settings.models.provider-card";function _l({provider:e,api:t,t:n}){let r=(0,_e.useRef)(null);(0,_e.useEffect)(()=>{let a=r.current,i=gn(a);if(a===null||i===null)return;let s=i,d=()=>i.querySelector('[class*="_editor"]')!==null,c=()=>{let u=d()?"1":"0";a.dataset.edit!==u&&(a.dataset.edit=u)};c();let m=new MutationObserver(c);return m.observe(s,{childList:!0,subtree:!0}),()=>{m.disconnect()}},[]);let o=e?.provider;return typeof o!="string"||o.length===0?null:(0,_e.createElement)("div",{ref:r,className:"bre-headers-host","data-bre-provider":o},(0,_e.createElement)(Ms,{host:r,t:n}),(0,_e.createElement)(Ts,{route:o,api:t,t:n}))}function Ls(e,t,n){let r=e,o=r.slots?.inject(Ss,()=>{r.slots?.register({name:Ss,key:re,inject:()=>({api:t,t:n})},_l)});return typeof o=="function"?o:()=>{}}var se=require("react");function As(e){let{t}=e,n=(0,se.useSyncExternalStore)(_t,le),r=()=>{jr(!n)};return(0,se.createElement)("div",{className:"bre-slider-setting"},(0,se.createElement)("div",{className:"bre-slider-setting-row"},(0,se.createElement)("div",{className:"bre-slider-setting-copy"},(0,se.createElement)("div",{className:"bre-slider-setting-title"},t("sliderToggleTitle")),(0,se.createElement)("div",{className:"bre-slider-setting-description"},t("sliderToggleDescription"))),(0,se.createElement)("div",{className:"bre-slider-setting-control"},(0,se.createElement)("span",{className:"bre-slider-setting-state"},t(n?"settingOn":"settingOff")),(0,se.createElement)("button",{type:"button",role:"switch","aria-label":t("sliderToggleAria"),"aria-checked":n,className:"bre-slider-setting-switch"+(n?" is-on":""),onClick:r},(0,se.createElement)("span",{className:"bre-slider-setting-switch-knob","aria-hidden":!0})))))}function Rs(e,t){let n=e,r=n.slots?.inject("settings.models.footer",()=>{n.slots?.register({name:"settings.models.footer",id:J+"-slider-toggle",order:15,inject:()=>({t})},As)});return typeof r=="function"?r:()=>{}}var Nl=J,Il=["slots","locale","connection","remote","remote.settings"];function Dl(e){e.effect(()=>e.locale.register(An,{zh:Wr,en:Br}),"dsh-model-think-level: dictionaries");let t=document.createElement("style");t.dataset.plugin=J,t.dataset.pluginStyles=J,t.textContent=uo,document.head.appendChild(t),e.effect(()=>()=>t.remove(),"dsh-model-think-level: stylesheet");let n=(()=>{try{let l=e.get?.("configForms");try{let p=l?.get?.(re);if(p!==void 0)return p}catch{}return e.get?.("settingsScope")?.bind?.({namespace:re})}catch{return}})(),r=n===void 0?{settings:e.remote.settings}:{settings:e.remote.settings,scope:n},o=e.locale.bind(An),a=()=>{let l=e.locale;return typeof l.subscribe=="function"&&typeof l.getSnapshot=="function"?l:void 0},i=l=>{let f=a();return f===void 0?l():(0,Os.createElement)(qr,{locale:f,children:l})},s=Co({api:r}),d=bs({ctx:e,configuredEffort:s.of}),c=No({menuOf:vs,triggerOf:ks,t:o,refreshed:i,sliderEnabled:le,directory:d.ensure}),m=Ko({api:r}),u=hs({ctx:e,api:r,t:o,onIdle:m.run,refreshed:i}),g=()=>{d.ensure(),c.reconcile()};e.effect(()=>(u.start(g),()=>{u.teardown(),c.dispose(),d.dispose()}),"dsh-model-think-level: DOM injector"),e.effect(()=>{let l=()=>{u.flushOnUnload()};return window.addEventListener("pagehide",l),()=>{window.removeEventListener("pagehide",l)}},"dsh-model-think-level: ledger flush on unload"),e.effect(()=>{let l=()=>{u.state.describePromise=void 0,s.invalidate(),u.schedule()},f=[e.remote.$on("settings/document-updated",p=>{p===re&&l()}),e.on("connection/reset",l)];return()=>{for(let p of f)p()}},"dsh-model-think-level: pushed invalidations"),e.effect(()=>{let l=k=>{k.key===Ht?zr(k.newValue!=="false"):k.key===Nt?Jr(Ye(k.newValue)):k.key===Dt?to(Qr(k.newValue)):k.key===Ft&&ao(Cn(k.newValue))};window.addEventListener("storage",l);let f=_t(()=>{u.schedule()}),p=It(()=>{u.schedule()}),v=Ct(()=>{u.schedule()}),x=Kt(()=>{u.schedule()});return()=>{window.removeEventListener("storage",l),f(),p(),v(),x()}},"dsh-model-think-level: client preferences"),e.effect(()=>Rs(e,o),"dsh-model-think-level: footer slot activation"),e.effect(()=>Ls(e,r,o),"dsh-model-think-level: provider-card slot activation")}
2041
+ `;var pt=require("react"),Fo=require("react-dom");var M=require("react"),Yn=require("react-dom");var vo=["off","minimal","low","medium","high","xhigh","max"],ha=["text","image"];var ba=[{id:"deepseek-v4-vision",patterns:["deepseek-v4-flash-vision","deepseek-v4-vision"],efforts:{off:"none",low:"low",high:"high",max:"max"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:384e3,note:"DeepSeek \u89C6\u89C9\u5B9E\u9A8C\u7248 id\uFF08deepseek-v4-flash-vision-exp\uFF09\u3002\u5B98\u65B9\u76EE\u5F55\u5DF2\u6807\u6CE8\u8BE5\u6A21\u578B\u9000\u5F79\uFF0C\u540D\u5B57\u4ECD\u88AB\u63A5\u53D7\u3001\u7531\u73B0\u884C deepseek-flash \u63D0\u4F9B\u670D\u52A1\u2014\u2014\u56FE\u7247\u8F93\u5165\u73B0\u5DF2\u7531 deepseek-flash \u539F\u751F\u63D0\u4F9B\u3002"},{id:"deepseek-v4-1-flash",patterns:["deepseek-v4.1-flash","deepseek-flash"],efforts:{off:"none",low:"low",high:"high",max:"max"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:384e3,note:'DeepSeek-V4.1-Flash\uFF082026-09-10 \u53D1\u5E03\u7684\u73B0\u884C\u5B98\u65B9\u6A21\u578B\uFF0C\u5B98\u65B9 id \u4E3A deepseek-flash\uFF1B25 \u4E07\u5E76\u53D1\u3001**\u539F\u751F\u56FE\u7247\u8F93\u5165**\uFF09\u3002V4.1 \u7684\u5404\u5199\u6CD5\uFF08deepseek-flash\u3001deepseek-v4.1-flash\u3001deepseek-v4-1-flash\uFF0C\u4EE5\u53CA\u5E26\u65E5\u671F\u540E\u7F00\u7684\u7B2C\u4E09\u65B9\u53D8\u4F53\uFF09\u90FD\u5F52\u6B64\u6761\u2014\u2014\u7EAF\u6587\u672C\u7684 deepseek-v4 \u4E3B\u5E72\u4E0D\u518D\u541E\u6389\u5B83\u4EEC\u3002\u5B98\u65B9\u679A\u4E3E\u540C V4 \u7CFB\uFF1AOff\uFF08thinking:"disabled"\uFF09/ Low / High / Max\uFF0C\u9ED8\u8BA4 High\uFF1B\u5BB9\u91CF 1,048,576 \u4E0A\u4E0B\u6587 / \u6700\u5927\u8F93\u51FA 384K\u3002'},{id:"deepseek-v4",patterns:["deepseek-v4"],efforts:{off:"none",low:"low",high:"high",max:"max"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:384e3,note:'DeepSeek \u5B98\u65B9\u679A\u4E3E Low / High / Max\uFF08\u9ED8\u8BA4 High\uFF1Bminimal\u3001medium\u3001xhigh \u517C\u5BB9\u6620\u5C04\uFF0Cultra\u2192max\uFF09\uFF0COff \u5373 thinking:"disabled"\uFF08Responses API \u4E0B off \u4EE5 reasoning.effort:"none" \u8868\u793A\uFF09\u3002\u672C\u6761\u76EE\u662F V4 \u5BB6\u65CF\u7684**\u7EAF\u6587\u672C**\u6210\u5458\uFF1Adeepseek-v4-pro\uFF08= DeepSeek-V4-Pro-0813\uFF0C\u5B98\u65B9\u4E0D\u652F\u6301\u56FE\u7247\uFF09\u4E0E\u5DF2\u9000\u5F79\u6A21\u578B\u7684\u517C\u5BB9\u522B\u540D deepseek-v4-flash\uFF08deepseek-v4-flash-vision-exp \u53E6\u6709\u89C6\u89C9\u6761\u76EE\uFF09\u3002**\u6536\u56FE\u7684 V4.1-Flash\uFF08\u5B98\u65B9 id deepseek-flash\uFF09\u53E6\u6709\u4E13\u95E8\u6761\u76EE**\uFF0C\u5176 input \u542B image\u3002\u5BB9\u91CF\uFF1A1,048,576 \u4E0A\u4E0B\u6587 / \u6700\u5927\u8F93\u51FA 384K\uFF08393,216\uFF1B\u9ED8\u8BA4\u975E\u601D\u8003 8K\u3001\u601D\u8003 64K\u3001effort=max \u65F6 128K\uFF09\u3002'},{id:"deepseek-v3",patterns:["deepseek-v3","deepseek-chat"],efforts:{off:"none",high:"high",max:"max"},compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text"],contextWindow:163840,maxTokens:65536,note:"DeepSeek V3 \u6863\u4F4D\uFF1AOff / High / Max\u3002\u5B98\u65B9\u5DF2\u505C\u552E V3 \u4EE3\uFF08\u5B9A\u4EF7\u9875\u4EC5\u5269 V4 \u4E09\u578B\uFF09\uFF0C\u5BB9\u91CF\u53D6\u76EE\u5F55\u73B0\u5F79\u503C\u3002"},{id:"deepseek-r1",patterns:["deepseek-r1","deepseek-reasoner"],efforts:{high:"high"},defaultEffort:"high",compat:{thinkingFormat:"deepseek",supportsReasoningEffort:!0},input:["text"],contextWindow:163840,maxTokens:32768,note:"DeepSeek-R1 \u4E3A\u63A8\u7406\u6A21\u578B\uFF0C\u4EC5\u63D0\u4F9B High\u3002\u5B98\u65B9\u5DF2\u4E0B\u67B6 R1 \u4EE3\uFF0C\u5BB9\u91CF\u53D6\u76EE\u5F55 r1-0528 \u503C\u3002"},{id:"openai-gpt-5-2",patterns:["gpt-5.2"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.2 \u6863\u4F4D\uFF1ANone / Low / Medium / High / XHigh\uFF08\u9ED8\u8BA4 None\uFF09\u3002\u5B98\u65B9\u53E6\u652F\u6301 PDF \u8F93\u5165\uFF08\u6838\u5FC3\u8BCD\u8868\u6682\u4E0D\u542B\uFF09\u3002gpt-5.2-pro \u5B98\u65B9\u9875\u672A\u5355\u5217\u6863\u4F4D\u884C\uFF0C\u6309\u672C\u6761\u76EE\u540C\u6863\u5904\u7406\uFF1Bgpt-5.2-codex \u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"openai-gpt-5-2-codex",patterns:["gpt-5.2-codex"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.2-Codex \u6863\u4F4D\uFF1ALow / Medium / High / XHigh\uFF08\u65E0 None \u6863\uFF0C\u52FF\u52FE Off\uFF09\uFF0C\u5E26\u56FE\u8F93\u5165\u3001400K\u3002"},{id:"openai-gpt-5-6",patterns:["gpt-5.6"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:105e4,maxTokens:128e3,note:"GPT-5.6\uFF08\u522B\u540D\u5373 sol\uFF09\u6863\u4F4D\uFF1ANone / Low / Medium(\u9ED8\u8BA4) / High / XHigh / Max\uFF1Bsol/luna/terra \u540C\u6863\uFF0C\u5E26\u56FE\u8F93\u5165\u3002"},{id:"openai-gpt-5-5",patterns:["gpt-5.5"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:105e4,maxTokens:128e3,note:"GPT-5.5 \u6863\u4F4D\uFF1ANone / Low / Medium(\u9ED8\u8BA4) / High / XHigh\uFF0C\u5E26\u56FE\u8F93\u5165\u3002pro \u53D8\u4F53\u4EC5 Medium / High(\u9ED8\u8BA4) / XHigh \u4E14\u4EC5 Responses API\u3002"},{id:"openai-gpt-5-4",patterns:["gpt-5.4"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:105e4,maxTokens:128e3,note:"GPT-5.4 \u6863\u4F4D\uFF1ANone(\u9ED8\u8BA4) / Low / Medium / High / XHigh\uFF0C\u5E26\u56FE\u8F93\u5165\u3002pro \u53D8\u4F53\u4EC5 Medium/High/XHigh\uFF1Bmini/nano \u4E3A 400K \u4E0A\u4E0B\u6587\u3002"},{id:"openai-gpt-5-3",patterns:["gpt-5.3"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.3-Codex \u6863\u4F4D\uFF1ALow / Medium / High / XHigh\uFF08\u65E0 None \u6863\uFF09\uFF0C\u5E26\u56FE\u8F93\u5165\u3001400K\uFF1Bgpt-5.3-chat \u4E3A\u975E\u63A8\u7406\u804A\u5929\u6A21\u578B\uFF08\u89C1 chat \u6761\u76EE\uFF09\u3002"},{id:"openai-gpt-5-1",patterns:["gpt-5.1"],efforts:{off:"none",low:"low",medium:"medium",high:"high"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.1 \u6863\u4F4D\uFF1ANone / Low / Medium / High\uFF08\u9ED8\u8BA4 None\uFF09\u3002"},{id:"openai-gpt-5-1-codex",patterns:["gpt-5.1-codex"],efforts:{low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.1-Codex \u7CFB\u5217\uFF1A\u5B98\u65B9\u6A21\u578B\u9875\u672A\u5355\u5217 effort \u503C\u57DF\uFF0C\u6309\u540C\u4EE3\u4FDD\u5B88\u6863 Low / Medium / High\uFF08\u65E0 None\uFF1Bxhigh \u672A\u8BC1\u5B9E\uFF09\u3002\u5982\u7AEF\u70B9\u652F\u6301 xhigh/none \u53EF\u624B\u8C03\u3002"},{id:"openai-gpt-5",patterns:["gpt-5"],efforts:{minimal:"minimal",low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5 \u521D\u4EE3\u6863\u4F4D\uFF1AMinimal / Low / Medium / High\uFF0C\u65E0\u5173\u95ED\u6863\u3002"},{id:"openai-chat",patterns:["gpt-5.1-chat-latest","gpt-5.2-chat-latest","gpt-5.3-chat-latest","gpt-5-chat-latest","gpt-chat-latest","gpt-5-chat","gpt-5.1-chat","gpt-5.2-chat","gpt-5.3-chat"],efforts:!1,input:["text","image"],contextWindow:128e3,maxTokens:16384,note:"-chat \u7CFB\u5217\uFF08\u5B98\u65B9 id \u4E3A gpt-5.x-chat-latest\uFF09\u4E3A\u975E\u63A8\u7406\u804A\u5929\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF08\u52FF\u52FE\u601D\u8003\u6863\uFF09\uFF1B\u5B98\u65B9\u652F\u6301\u56FE\u7247\u8F93\u5165\uFF0C128K / 16,384 \u8F93\u51FA\u3002gpt-5-chat-latest \u5DF2\u4E8E 2026-07-23 \u4E0B\u67B6\u3001gpt-chat-latest \u5DF2\u65E0\u5B98\u65B9\u9875\u9762\uFF08\u4FDD\u7559\u6A21\u5F0F\u4F9B\u7F51\u5173\uFF09\u3002"},{id:"openai-o",patterns:["o1","o3","o4"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:2e5,maxTokens:1e5,note:"OpenAI o \u7CFB\u6863\u4F4D\uFF1ALow / Medium / High\u3002\u5B98\u65B9\u5DF2\u4E8E 2026-06 \u516C\u544A\u9000\u5F79\uFF08o1/o1-pro/o3-mini/o4-mini 2026-10-23 \u79FB\u9664\u3001o3/o3-pro 2026-12-11\uFF09\uFF0C\u7F51\u5173\u6B8B\u7559\u4ECD\u53EF\u547D\u4E2D\uFF1B\u591A\u6570 o \u7CFB\u7AEF\u70B9\u6536\u56FE\uFF08o3-mini \u4F8B\u5916\uFF09\u3002"},{id:"openai-gpt-oss",patterns:["gpt-oss"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"low",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:131072,maxTokens:131072,note:"GPT-OSS \u5F00\u6E90\u6743\u91CD\uFF08Ollama/vLLM \u5E38\u89C1\uFF09\uFF1Areasoning effort Low / Medium / High\uFF0C\u7EAF\u6587\u672C\uFF0C131K \u4E0A\u4E0B\u6587 / 131K \u8F93\u51FA\u30022026-09 \u590D\u6838\uFF1A\u5B98\u65B9\u6A21\u578B\u9875\u73B0\u5728\u5199 Chat Completions = Not supported\u3001\u65E0\u56FE\u7247\u8F93\u5165\uFF08\u9ED8\u8BA4 Low \u6765\u81EA\u5B98\u65B9 CLI\uFF0C\u4E0D\u662F API \u9875\uFF09\uFF0C\u56E0\u6B64\u8FD9\u91CC\u4E0D\u518D\u58F0\u660E Off\u3002"},{id:"openai-gpt-6-astra",patterns:["gpt-6-astra","gpt-6"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:105e4,maxTokens:128e3,note:"GPT-6 Astra \u6863\u4F4D\uFF1ALow / Medium / High / XHigh / Max\u2014\u2014**\u6CA1\u6709 None \u6863**\uFF08\u5B98\u65B9\u539F\u6587\uFF1A\u8BBE\u4E3A none \u8FD4\u56DE HTTP 400\uFF09\uFF0C\u56E0\u6B64\u672C\u6761\u76EE\u4E0D\u58F0\u660E Off\u3002\u5E26\u56FE\u8F93\u5165\uFF0C1,050,000 \u4E0A\u4E0B\u6587 / 128,000 \u8F93\u51FA\uFF1BAI \u5B98\u65B9\u9ED8\u8BA4\u6863\u4F4D\u672A\u516C\u5E03\uFF0C\u6545\u4E0D\u586B\u3002\u5DE5\u5177\u8C03\u7528\u9700\u8D70 Responses API\u3002"},{id:"openai-gpt-5-6-cyber",patterns:["gpt-5.6-cyber"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:4e5,maxTokens:128e3,note:"GPT-5.6-Cyber\uFF1A\u5B98\u65B9\u6A21\u578B\u9875\u672A\u5355\u5217 effort \u503C\u57DF\uFF08\u4E0D\u7B49\u4E8E\u4E0D\u652F\u6301\uFF09\uFF0C\u6545\u6309\u540C\u4EE3\u4FDD\u5B88\u6863 Low / Medium / High / XHigh\uFF1B\u8BE5\u578B\u53F7\u4EC5 Responses API\uFF0C\u5E26\u56FE\u8F93\u5165\u3001400K \u4E0A\u4E0B\u6587\u3002\u5B98\u65B9\u652F\u6301\u7684\u5176\u4ED6\u6863\u4F4D\u53EF\u624B\u8C03\u540E\u5E94\u7528\u3002"},{id:"openai-gpt-4o",patterns:["gpt-4o"],efforts:!1,input:["text","image"],contextWindow:128e3,maxTokens:16384,note:"GPT-4o \u4EE3\u9645\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF08\u52FF\u52FE\u601D\u8003\u6863\uFF09\uFF1B\u56FE\u7247\u8F93\u5165\u5168\u7CFB\u6807\u914D\uFF0C128K / 16,384 \u8F93\u51FA\u3002"},{id:"openai-gpt-4-1",patterns:["gpt-4.1"],efforts:!1,input:["text","image"],contextWindow:1047576,maxTokens:32768,note:"GPT-4.1 \u5168\u7CFB\uFF08\u542B mini/nano\uFF09\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF1B\u5B98\u65B9 1,047,576 \u4E0A\u4E0B\u6587 / 32,768 \u8F93\u51FA\uFF0C\u5168\u7CFB\u5E26\u56FE\u8F93\u5165\u3002"},{id:"openai-gpt-4-turbo-preview",patterns:["gpt-4-turbo-preview"],efforts:!1,input:["text"],contextWindow:128e3,maxTokens:4096,note:"GPT-4 Turbo Preview\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u7EAF\u6587\u672C\u8F93\u5165\uFF08\u6B63\u5F0F turbo \u5FEB\u7167\u652F\u6301\u56FE\u7247\uFF0C\u89C1\u4E0B\u6761\uFF09\uFF0C128K\u3002"},{id:"openai-gpt-4-turbo",patterns:["gpt-4-turbo"],efforts:!1,input:["text","image"],contextWindow:128e3,maxTokens:4096,note:"GPT-4 Turbo\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u5B98\u65B9\u652F\u6301\u56FE\u7247\u8F93\u5165\uFF0C128K / 4,096 \u8F93\u51FA\u3002"},{id:"openai-gpt",patterns:["gpt-4","gpt-3.5"],efforts:!1,input:["text"],note:"GPT-4/3.5 \u4EE3\u9645\uFF1A\u975E\u63A8\u7406\u6A21\u578B\uFF0C\u4E0D\u652F\u6301 effort \u53C2\u6570\uFF08\u52FF\u52FE\u601D\u8003\u6863\uFF09\u3002gpt-4-turbo/4.1 \u8D77\u652F\u6301\u56FE\u7247\uFF0C\u89C1\u5355\u72EC\u6761\u76EE\uFF1B\u65B0\u4EE3\u8BF7\u7528 GPT-5 \u7CFB\uFF08\u89C1 openai-chat/gpt-5.x \u6761\u76EE\uFF09\u3002"},{id:"anthropic-claude-5",patterns:["claude-fable-5","claude-mythos-5","claude-opus-5","claude-sonnet-5"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude 5 \u4EE3\uFF08Fable 5 / Mythos 5 / Opus 5 / Sonnet 5\uFF09\u6863\u4F4D\uFF1ALow / Medium / High(\u9ED8\u8BA4) / XHigh / Max\uFF1BFable 5.1 \u4E0E Mythos 5.1 \u89C1\u5355\u72EC\u6761\u76EE\uFF0CMythos Preview \u4EC5\u81F3 Max\u30021M \u4E0A\u4E0B\u6587 / 128K \u8F93\u51FA\uFF08Batch 300K\uFF09\u3002\u5B98\u65B9\u652F\u6301 PDF \u8F93\u5165\u3002\u6CE8\u610F\uFF1AAnthropic \u5B98\u65B9 OpenAI \u517C\u5BB9\u5C42\u4F1A\u5FFD\u7565 effort \u53C2\u6570\uFF0C\u58F0\u660E\u5728\u7B2C\u4E09\u65B9\u7F51\u5173\u6620\u5C04\u65F6\u751F\u6548\u3002"},{id:"anthropic-claude-5-1",patterns:["claude-fable-5-1","claude-mythos-5-1"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude Fable 5.1 / Mythos 5.1\uFF1A\u5B98\u65B9\u6863\u4F4D Low / Medium / High(\u9ED8\u8BA4) / XHigh / Max\uFF0C\u81EA\u9002\u5E94\u601D\u8003\u5E38\u5F00\uFF08\u4E0D\u63A5\u53D7 enabled/disabled\uFF09\u30021M \u4E0A\u4E0B\u6587 / 128K \u8F93\u51FA\uFF1B\u8FD9\u4E24\u578B\u4E5F\u662F\u5B98\u65B9\u552F\u4E00\u5141\u8BB8\u4F1A\u8BDD\u4E2D\u9014\u6539\u6863\u7684\uFF08\u9700 beta header\uFF0C\u672C\u63D2\u4EF6\u4E0D\u6D89\u53CA\uFF09\u3002"},{id:"anthropic-claude-mythos-preview",patterns:["claude-mythos-preview"],efforts:{low:"low",medium:"medium",high:"high",max:"max"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude Mythos Preview\uFF1A\u5B98\u65B9\u6863\u4F4D Low / Medium / High / Max\uFF08\u65E0 XHigh\uFF09\uFF0C1M \u4E0A\u4E0B\u6587\u3002"},{id:"anthropic-claude-opus-4-high",patterns:["claude-opus-4-8","claude-opus-4-7"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude Opus 4.7/4.8 \u6863\u4F4D\uFF1ALow / Medium / High(\u9ED8\u8BA4) / XHigh / Max\uFF1Bxhigh \u4E3A\u5B98\u65B9\u63A8\u8350\u7684\u7F16\u7801\u8D77\u6B65\u6863\u30021M \u4E0A\u4E0B\u6587\u3002"},{id:"anthropic-claude-4-6",patterns:["claude-opus-4-6","claude-sonnet-4-6"],efforts:{low:"low",medium:"medium",high:"high",max:"max"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},anthropicAdaptive:!0,input:["text","image"],contextWindow:1e6,maxTokens:128e3,note:"Claude 4.6 \u4EE3\u6863\u4F4D\uFF1ALow / Medium / High / Max\uFF08\u65E0 XHigh\u2014\u2014\u5B98\u65B9\u660E\u8A00\u300C\u652F\u6301 max \u7684\u90E8\u5206\u578B\u53F7\u4E0D\u652F\u6301 xhigh\u300D\uFF09\u30021M \u4E0A\u4E0B\u6587\u3002"},{id:"anthropic-claude-opus-4-5",patterns:["claude-opus-4-5"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"high",compat:{supportsReasoningEffort:!0},input:["text","image"],contextWindow:2e5,maxTokens:64e3,note:"Claude Opus 4.5\uFF1A\u5B98\u65B9 effort \u652F\u6301\u5217\u8868\uFF0820251101 \u5FEB\u7167\uFF09\uFF0C\u6863\u4F4D Low / Medium / High\uFF08\u65E0 XHigh/Max\uFF09\uFF0C\u53EF\u4E0E budget_tokens \u5E76\u7528\uFF1B200K / 64K\u3002"},{id:"anthropic-claude",patterns:["claude"],efforts:!1,input:["text","image"],contextWindow:2e5,maxTokens:64e3,note:"Claude 3.x \u4E0E Sonnet 4.5 / Haiku 4.5\uFF1A\u5B98\u65B9 effort \u53C2\u6570\u4E0D\u652F\u6301\uFF08\u4EC5 Fable/Mythos 5\u3001Opus 5/4.6-4.8\u3001Sonnet 5/4.6\u3001Opus 4.5 \u652F\u6301\uFF09\uFF0C\u601D\u8003\u7531 thinking.type \u63A7\u5236\u2014\u2014\u52FF\u52FE\u601D\u8003\u6863\u3002\u53C2\u8003\u5BB9\u91CF 200K / 64K\uFF08Haiku 3.5 \u4E3A\u7EAF\u6587\u672C\uFF0C\u6309\u9700\u53D6\u6D88\u56FE\u7247\uFF09\u3002"},{id:"google-gemini",patterns:["gemini"],efforts:{low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:65536,note:"Gemini \u901A\u7528\u5B89\u5168\u6863\uFF1ALow / Medium / High\uFF08\u5B98\u65B9 OpenAI \u517C\u5BB9\u6620\u5C04\u8868\u53E6\u6536 minimal\uFF1A2.5 \u7CFB\u6620\u5C04\u4E3A 1,024 \u9884\u7B97\u30013.1 Flash-Lite/3 Flash \u539F\u751F minimal\u30013.1 Pro \u843D low\uFF09\u3002none \u4EC5\u80FD\u5173 2.5 \u975E Pro\uFF1B2.5 Pro \u4E0E 3 \u4EE3\u4E0D\u53EF\u5173\uFF1B\u5404\u578B\u9ED8\u8BA4\u4E0D\u4E00\uFF08flash-lite \u9ED8\u8BA4\u5173\uFF09\u3002\u5B98\u65B9\u53E6\u6536\u97F3\u9891/\u89C6\u9891/PDF\u3002"},{id:"xai-grok-4-7",patterns:["grok-4.7"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:5e5,note:'Grok 4.7\uFF08\u4E0A\u6E38\u5FEB\u7167 grok-4.7-20260916\uFF09\uFF1A\u6863\u4F4D Low / Medium / High / XHigh\u2014\u2014**\u53D6\u81EA\u516C\u5F00\u76EE\u5F55**\uFF08OpenRouter \u7684 supported_parameters\u3001models.dev \u5BF9 docs.x.ai \u7684\u8F6C\u8FF0\uFF09\uFF0C\u672C\u6B21 xAI \u5B98\u65B9\u6587\u6863\u7AD9\u4E0D\u53EF\u8FBE\u3001\u672A\u80FD\u4E00\u624B\u8BC1\u5B9E\uFF1B\u9ED8\u8BA4\u6863\u4F4D\u4E0E"\u80FD\u5426\u5173\u95ED\u601D\u8003"\u540C\u6837\u672A\u8BC1\u5B9E\uFF0C\u6545\u4E0D\u58F0\u660E Off\uFF0C\u4E5F\u4E0D\u5199\u9ED8\u8BA4\u6863\u3002\u5E26\u56FE\u8F93\u5165\uFF08\u76EE\u5F55\u8BB0 text+image+file\uFF0CPDF \u5B58\u7591\uFF09\uFF0C500K \u4E0A\u4E0B\u6587\uFF1B\u6700\u5927\u8F93\u51FA\u5404\u76EE\u5F55\u7ED9\u51FA 450K \u4E0E 500K \u4E24\u79CD\u503C\uFF0C\u6309"\u5206\u6B67\u5373\u4E0D\u5199"\u5904\u7406\u30022026-08 \u90A3\u6B21"grok-4.7 \u4E0D\u5B58\u5728\uFF08\u5B98\u65B9 404\uFF09"\u7684\u7ED3\u8BBA\u5DF2\u968F\u53D1\u5E03\u4F5C\u5E9F\u3002'},{id:"xai-grok-high",patterns:["grok-4.6"],efforts:{low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"high",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:5e5,note:'Grok 4.6 \u6863\u4F4D\uFF1ALow / Medium / High(\u9ED8\u8BA4) / XHigh\uFF0C\u601D\u8003\u4E0D\u53EF\u5173\u95ED\uFF1B\u5E26\u56FE\u8F93\u5165\u3001500K \u4E0A\u4E0B\u6587\u3002Grok 4.7 \u89C1\u4E0A\u4E00\u6761\uFF08\u6B64\u524D\u8BB0\u4E3A"\u4E0D\u5B58\u5728"\uFF0C\u5DF2\u968F\u53D1\u5E03\u4F5C\u5E9F\uFF09\u3002'},{id:"xai-grok-4-5",patterns:["grok-4.5"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"high",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:5e5,note:"Grok 4.5 \u6863\u4F4D\uFF1ALow / Medium / High(\u9ED8\u8BA4)\uFF0C\u601D\u8003\u4E0D\u53EF\u5173\u95ED\uFF1B\u5E26\u56FE\u8F93\u5165\u3002\u4F20\u5165 xhigh \u4F1A\u88AB\u5B98\u65B9\u9759\u9ED8\u6309 High \u5904\u7406\u3002"},{id:"xai-grok-4-3",patterns:["grok-4.3"],efforts:{off:"none",low:"low",medium:"medium",high:"high",xhigh:"xhigh"},defaultEffort:"low",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1e6,note:"Grok 4.3\uFF1A\u5B98\u65B9\u56DB\u7EA7 reasoning effort\uFF08None / Low / Medium / High\uFF09\uFF0C1M \u4E0A\u4E0B\u6587\u3001\u5E26\u56FE\u8F93\u5165\uFF1Bgrok-4-fast \u7B49\u65E7 slug 2026-05-15 \u8D77\u81EA\u52A8\u91CD\u5B9A\u5411\u5230\u672C\u578B\u53F7\u3002"},{id:"xai-grok",patterns:["grok"],efforts:{low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],note:"Grok \u901A\u7528\u6863\u4F4D\uFF1ALow / Medium / High\u3002\u521D\u4EE3 grok-4\u3001grok-4.20 \u4E0E grok-build-0.1 \u4E0D\u63A5\u53D7\u8BE5\u53C2\u6570\uFF08grok-4 \u7CFB\u4E0E grok-3 \u5DF2\u4E8E 2026-05-15 \u9000\u5F79\u5E76\u91CD\u5B9A\u5411\u81F3 4.3\uFF09\uFF1Bgrok-4.20-multi-agent \u7684\u56DB\u6863\u63A7\u5236\u7684\u662F agent \u6570\u91CF\u800C\u975E\u601D\u8003\u6DF1\u5EA6\u3002\u65B0\u65E7\u4EE3\u9645\u8BF7\u4F18\u5148\u9009 4.5/4.6/4.3\uFF1B\u591A\u6A21\u6001\u53D8\u4F53\u6309\u9700\u52FE\u9009\u56FE\u7247\u3002"},{id:"mistral-magistral",patterns:["magistral"],efforts:!1,input:["text"],contextWindow:32768,maxTokens:32768,note:"Magistral \u539F\u751F\u601D\u8003\u7EBF\uFF08\u65E0 effort \u53C2\u6570\uFF0C\u4E3A prompt_mode \u8BED\u4E49\uFF09\uFF0C\u5B98\u65B9\u5DF2\u4E8E 2026-07-28 \u58F0\u660E\u5F03\u7528\u3001\u9010\u6B65\u64A4\u51FA\uFF1B\u73B0\u5F79\u63A8\u7406\u8D70 mistral-small-2603 / mistral-medium-3-5 \u7684 reasoning_effort\uFF08\u89C1\u4E0B\u6761\uFF09\u3002"},{id:"mistral-medium-3",patterns:["mistral-medium-3.5","mistral-small-latest","mistral-small-2603"],efforts:{off:"none",high:"high"},defaultEffort:"off",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],note:"Mistral \u73B0\u5F79\u63A8\u7406\u6863\uFF1ANone / High\u2014\u2014\u5B98\u65B9 reasoning_effort \u679A\u4E3E\uFF08mistral-common \u534F\u8BAE\u5E93\uFF09\u5373 none/high\uFF1Bmistral-small-2603\uFF08Small 4\uFF09\u4E0E mistral-medium-3-5 \u7ECF\u5B83\u63A7\u5236\uFF0CMedium 3.5 \u5E26\u89C6\u89C9\u3002\u5BB9\u91CF\u672A\u5728\u5B98\u65B9\u76EE\u5F55\u9875\u5355\u5217\uFF0C\u4E0D\u63D0\u4F9B\u3002"},{id:"qwen-vision",patterns:["qwen-vl","qwen2-vl","qwen2-5-vl","qwen3-vl","qvq"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"qwen"},input:["text","image"],contextWindow:131072,maxTokens:8192,note:"\u901A\u4E49\u89C6\u89C9\u7EBF\uFF08Qwen-VL/QvQ\uFF09\uFF1Aenable_thinking \u5F00\u5173\uFF08\u5F00=High\uFF09\uFF0C\u6536\u56FE\u3002qwen3-vl \u5BB9\u91CF\u66F4\u5927\uFF0C\u6309\u9700\u4E0A\u8C03\u3002"},{id:"qwen-3-8",patterns:["qwen3.8"],efforts:{off:null,low:"low",medium:"medium",xhigh:"xhigh"},defaultEffort:"xhigh",compat:{thinkingFormat:"qwen",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1e6,note:"Qwen 3.8 \u7CFB\uFF1A\u5B98\u65B9 reasoning_effort \u6863\u4F4D XHigh(\u9ED8\u8BA4) / Medium / Low\uFF0Cthinking \u9ED8\u8BA4\u5F00\u3001\u53EF\u6309\u8BF7\u6C42\u5173\u95ED\uFF1B\u539F\u751F\u591A\u6A21\u6001\uFF08qwen3.8-max \u56FE\u50CF/\u89C6\u9891\u7406\u89E3\uFF0C\u89C6\u9891\u672A\u5165\u6838\u5FC3\u8BCD\u8868\uFF09\u30021M \u6863\u4E0A\u4E0B\u6587\u300227B \u4E0E Flash-Next \u5F00\u6E90\u6B3E\u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"qwen-3-8-27b",patterns:["qwen3.8-27b"],efforts:{off:null,low:"low",medium:"medium",xhigh:"xhigh"},defaultEffort:"xhigh",compat:{thinkingFormat:"qwen",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,note:"Qwen3.8-27B\uFF08dense\uFF0C2026-08-14 \u5F00\u6E90\uFF09\uFF1A\u5B98\u65B9 reasoning_effort \u6863\u4F4D XHigh(\u9ED8\u8BA4) / Medium / Low\uFF0Cthinking \u9ED8\u8BA4\u5F00\u3001\u53EF\u6309\u8BF7\u6C42\u5173\uFF1B\u539F\u751F\u56FE\u50CF+\u89C6\u9891\u7406\u89E3\uFF08\u89C6\u9891\u672A\u5165\u6838\u5FC3\u8BCD\u8868\uFF09\u3002262,144 \u539F\u751F\u4E0A\u4E0B\u6587\u3001\u5B98\u65B9\u58F0\u660E\u53EF\u6269\u81F3 1M\u3002\u6765\u6E90\uFF1AHF Qwen/Qwen3.8-27B \u6A21\u578B\u5361\u3002"},{id:"qwen-3-8-flash-next",patterns:["qwen3.8-flash-next"],efforts:{off:null,low:"low",medium:"medium",xhigh:"xhigh"},defaultEffort:"xhigh",compat:{thinkingFormat:"qwen",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,note:"Qwen3.8-Flash-Next\uFF08125B-A6B \u5B9E\u9A8C\u67B6\u6784\uFF0CQwen4 \u524D\u8EAB\uFF09\uFF1A\u5B98\u65B9 reasoning_effort \u6863\u4F4D XHigh(\u9ED8\u8BA4) / Medium / Low + enable_thinking \u5F00\u5173\uFF1B\u539F\u751F\u89C6\u89C9\uFF08Vision Encoder\uFF09\u3002262,144 \u539F\u751F\u4E0A\u4E0B\u6587\u3001\u53EF\u6269\u81F3 1M\u3002\u6765\u6E90\uFF1AHF \u6A21\u578B\u5361\u4E0E qwen.ai \u5B98\u65B9\u535A\u5BA2\u3002"},{id:"qwen",patterns:["qwen","qwq"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"qwen"},input:["text"],contextWindow:1e6,maxTokens:65536,note:"\u901A\u4E49\u5343\u95EE\uFF1Aenable_thinking \u5F00\u5173\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\uFF1B\u73B0\u5F79\u65D7\u8230\u4E3A qwen3.8 \u7CFB\uFF081M \u6863\u4E0A\u4E0B\u6587\uFF0C\u89C1 qwen-3-8 \u6761\u76EE\uFF09\u30023.6/3.7 \u4EE3\u7684 Plus/Flash \u4EA6\u9ED8\u8BA4\u591A\u6A21\u6001\uFF08\u56FE\u7247/\u89C6\u9891\uFF09\uFF0C\u5982\u63A5\u5165\u8BF7\u6309\u9700\u52FE\u9009\u56FE\u7247\uFF1B\u89C6\u89C9\u7EBF\u89C1 qwen-vision \u6761\u76EE\u3002"},{id:"glm-vision",patterns:["glm-4v","glm-4-6v","glm-4-5v","glm-5v"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"zai"},input:["text","image"],contextWindow:131072,maxTokens:32768,note:"\u667A\u8C31\u89C6\u89C9\u7EBF\uFF08GLM-4V/4.5V/4.6V/5V\uFF09\uFF1Athinking \u5F00\u5173\uFF08\u5F00=High\uFF09\uFF0C\u6536\u56FE\u3002GLM-4.5V \u4E3A\u5F3A\u5236\u601D\u8003\uFF08\u4F20 disabled \u62A5\u9519\uFF0C\u8BF7\u624B\u52A8\u5220 Off \u6863\uFF09\u3002"},{id:"glm-5-3-flash",patterns:["glm-5.3-flash"],efforts:{low:"low",high:"high",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"zai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:131072,note:"GLM-5.3-Flash\uFF08320B\uFF0C\u5B98\u65B9\u6587\u6863 vlm \u5206\u7C7B\uFF09\uFF1A\u5F3A\u5236\u601D\u8003\uFF08thinking.type \u4EC5 enabled\uFF0C\u4E0D\u652F\u6301\u5173\u95ED\uFF09\uFF0C\u6587\u672C\u53C2\u6570\u4E0E GLM-5.3 \u4E00\u81F4\u2014\u2014\u6863\u4F4D Low / High / Max\u3002\u8F93\u5165\u6A21\u6001\uFF1A\u89C6\u9891\u3001\u56FE\u50CF\u3001\u6587\u672C\u3001\u6587\u4EF6\uFF08\u89C6\u9891/\u6587\u4EF6\u672A\u5165\u6838\u5FC3\u8BCD\u8868\uFF0C\u56FE\u7247\u53EF\u52FE\uFF09\u3002\u5B98\u65B9 1M \u4E0A\u4E0B\u6587 / 128K \u6700\u5927\u8F93\u51FA\u3002\u6765\u6E90\uFF1Adocs.bigmodel.cn \u6A21\u578B\u9875\u3002"},{id:"glm-5-3",patterns:["glm-5.3"],efforts:{low:"low",high:"high",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"zai",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:131072,note:"GLM-5.3 \u6863\u4F4D\uFF1ALow / High / Max\uFF08\u5F3A\u5236\u601D\u8003\uFF0C\u5176\u4F59\u503C\u62A5\u9519\uFF09\u3002\u5B98\u65B9\u5BB9\u91CF 1M / 128K\u3002"},{id:"glm-5-2",patterns:["glm-5.2"],efforts:{off:"none",minimal:"minimal",low:"low",medium:"medium",high:"high",xhigh:"xhigh",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"zai",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:131072,note:"GLM-5.2 \u6863\u4F4D\uFF1ANone / Minimal / Low / Medium / High / XHigh / Max\uFF08\u5B98\u65B9\u6620\u5C04\uFF1ALow\xB7Medium\u2192High\u3001XHigh\u2192Max\u3001None\xB7Minimal=\u505C\u6B62\u601D\u8003\uFF09\u3002\u89C6\u89C9\u7EBF\u89C1 glm-vision \u6761\u76EE\u3002"},{id:"glm",patterns:["glm","zhipu","chatglm"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"zai"},input:["text"],note:"GLM \u901A\u7528\uFF1Athinking \u5F00\u5173\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\uFF1Beffort \u9636\u68AF\u4EC5 GLM-5.2+ \u652F\u6301\uFF08\u89C1\u4E0A\u4E24\u6761\u76EE\uFF09\u3002\u6CE8\u610F GLM-4.7/GLM-4.5V \u4E3A\u5F3A\u5236\u601D\u8003\uFF0C\u4F20 disabled \u4F1A\u62A5\u9519\uFF08\u8BF7\u624B\u52A8\u5220 Off \u6863\uFF09\u3002\u89C6\u89C9\u7EBF\u89C1 glm-vision \u6761\u76EE\u3002"},{id:"kimi-k3",patterns:["kimi-k3"],efforts:{low:"low",high:"high",max:"max"},defaultEffort:"max",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,note:"Kimi K3 \u6863\u4F4D\uFF1ALow / High / Max(\u9ED8\u8BA4 Max)\uFF0C\u8D70\u9876\u5C42 reasoning_effort\uFF1B\u59CB\u7EC8\u63A8\u7406\u3001\u52FF\u4F20 thinking \u5BF9\u8C61\u3002\u539F\u751F\u89C6\u89C9\u7406\u89E3\uFF0C1M \u4E0A\u4E0B\u6587\uFF08\u6700\u5927\u8F93\u51FA\u5B98\u65B9\u672A\u5355\u72EC\u5217\uFF0C\u4E0D\u63D0\u4F9B\uFF09\u3002"},{id:"kimi-k2-vision",patterns:["kimi-k2.6","kimi-k2.5"],efforts:{off:null,high:"high"},defaultEffort:"high",compat:{thinkingFormat:"deepseek"},input:["text","image"],contextWindow:262144,note:"Kimi K2.5/K2.6 \u89C6\u89C9\u4EE3\uFF1Athinking.type \u5F00\u5173\uFF08\u9ED8\u8BA4\u5F00\u3001\u53EF\u5173\uFF09\uFF0C\u5F00=High\uFF1B\u5E26\u89C6\u89C9\uFF0C256K\u3002K2.7 Code \u59CB\u7EC8\u601D\u8003\uFF0C\u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"kimi-k27-code",patterns:["kimi-k2.7"],efforts:{high:"high"},defaultEffort:"high",compat:{thinkingFormat:"deepseek"},input:["text","image"],contextWindow:262144,note:"Kimi K2.7 Code\uFF08\u542B\u9AD8\u901F\u7248\uFF09\uFF1A\u59CB\u7EC8\u601D\u8003\u2014\u2014thinking.type \u4EC5\u63A5\u53D7 enabled\uFF08\u4F20 disabled \u62A5\u9519\uFF09\uFF0C\u65E0 Off \u6863\uFF1B\u5E26\u89C6\u89C9\uFF0C256K\u3002"},{id:"kimi-moonshot-v1-vision",patterns:["moonshot-v1-8k-vision","moonshot-v1-32k-vision","moonshot-v1-128k-vision"],efforts:!1,input:["text","image"],note:"Moonshot V1 \u89C6\u89C9\u65E7\u4EE3\uFF088k/32k/128k \u5404\u4E00\uFF09\uFF1A\u65E0\u601D\u8003\u63A7\u4EF6\uFF08\u751F\u6210\u6A21\u578B\uFF09\u3001\u652F\u6301\u56FE\u7247\u8F93\u5165\uFF1B\u8BE5\u7EBF\u5DF2\u505C\u6B62\u5BF9\u65B0\u7528\u6237\u5F00\u653E\uFF082026-08-31 \u5168\u91CF\u4E0B\u7EBF\uFF0C\u7F51\u5173\u6B8B\u7559\u4ECD\u53EF\u547D\u4E2D\uFF09\u3002"},{id:"kimi",patterns:["kimi","moonshot"],efforts:{off:null,high:"high"},compat:{thinkingFormat:"deepseek"},input:["text"],contextWindow:262144,note:"Kimi \u901A\u7528\uFF1Athinking \u5F00\u5173\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\u3002k2 \u7CFB\u5217 2026-05-25 \u4E0B\u7EBF\u3001kimi-latest 2026-01-28 \u4E0B\u7EBF\u3001moonshot-v1 \u7CFB 2026-08-31 \u5168\u91CF\u4E0B\u7EBF\uFF08\u7F51\u5173\u6B8B\u7559\u4ECD\u53EF\u547D\u4E2D\uFF1Bmoonshot-v1 \u672C\u8EAB\u975E\u601D\u8003\u6A21\u578B\uFF09\u3002\u89C6\u89C9\u4EE3\u4E0E K2.7 Code \u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"hunyuan-hy3",patterns:["hy3"],efforts:{low:"low",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:262144,note:"\u6DF7\u5143 hy3\uFF1A\u5F00\u6E90\u5951\u7EA6\u7ECF chat_template_kwargs.reasoning_effort = no_think(\u9ED8\u8BA4)/low/high\uFF1B\u5B98\u65B9\u6A21\u578B\u5361 256K \u4E0A\u4E0B\u6587\uFF08295B MoE\uFF0C2026 \u5F00\u6E90\uFF09\u3002"},{id:"hunyuan-hy4",patterns:["hy4-preview","hy-4-preview"],efforts:{off:"no_think",high:"high"},defaultEffort:"high",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},contextWindow:1e6,note:"\u6DF7\u5143 Hy4 preview\uFF1A\u5B98\u65B9 README\u2014\u2014reasoning \u9ED8\u8BA4 high\uFF08\u6DF1\u5EA6\u601D\u8003\uFF09\uFF0C\u5173\u95ED\u7ECF chat_template_kwargs.reasoning_effort=no_think\uFF1B\u5B98\u65B9\u89C4\u683C\u8868 1M \u4E0A\u4E0B\u6587\uFF08770B-A49B MoE\uFF0CGated DSA\uFF09\u3002low \u6863\u5B98\u65B9\u672A\u5217\uFF0C\u5982\u6709\u8BF7\u624B\u8C03\uFF1B\u89C6\u89C9\u672A\u58F0\u660E\uFF0C\u6309\u9700\u624B\u52FE\u3002\u6765\u6E90\uFF1ATencent-Hunyuan/Hy4-preview \u5B98\u65B9 README\u3002"},{id:"step-5-preview",patterns:["step-5"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1e6,maxTokens:65536,note:'\u9636\u8DC3 Step-5-Preview\uFF08\u5B98\u65B9 id \u5373 step-5-preview\uFF0C\u65E0\u88F8 step-5\uFF1Bpattern \u53D6\u5BB6\u65CF\u4E3B\u5E72\u4EE5\u517C\u5BB9\u7F51\u5173\u5199\u6CD5\uFF09\uFF1A\u6863\u4F4D Low / Medium(\u5B98\u65B9\u6807"\u9ED8\u8BA4\u63A8\u8350") / High\uFF0C\u601D\u8003\u4E0D\u53EF\u5173\u95ED\uFF1B\u539F\u751F\u56FE\u7247 + \u89C6\u9891\u8F93\u5165\uFF1B1M \u4E0A\u4E0B\u6587\u300164K \u6700\u5927\u8F93\u51FA\uFF08\u5B98\u65B9\u53E6\u6CE8 max_tokens \u9ED8\u8BA4 INF\u3001\u4E0E 64K \u4E0A\u9650\u5E76\u5B58\uFF0C\u4EE5\u7AEF\u70B9\u5B9E\u6D4B\u4E3A\u51C6\uFF09\u3002'},{id:"step-3-7",patterns:["step-3.7","step-3.6"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:262144,note:"\u9636\u8DC3 Step-3.6/3.7 \u6863\u4F4D\uFF1ALow / Medium(\u9ED8\u8BA4\u63A8\u8350) / High\uFF0C\u539F\u751F\u56FE\u7247+\u89C6\u9891\u7406\u89E3\u3002\u4E0A\u4E0B\u6587\u4E3A\u8F93\u5165+\u8F93\u51FA\u603B\u548C\u4E0A\u9650\u3002"},{id:"step-3-5",patterns:["step-3.5"],efforts:{low:"low",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:262144,note:"\u9636\u8DC3 Step-3.5 Flash \u6863\u4F4D\uFF1ALow / High\uFF08\u7EAF\u6587\u672C\u63A8\u7406\u65D7\u8230\uFF09\u3002\u4E0A\u4E0B\u6587\u4E3A\u8F93\u5165+\u8F93\u51FA\u603B\u548C\u4E0A\u9650\u3002"},{id:"step",patterns:["step-3","step-2"],efforts:{low:"low",medium:"medium",high:"high"},defaultEffort:"medium",compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],note:"\u9636\u8DC3 Step \u6863\u4F4D\uFF1ALow / Medium / High\uFF08\u9ED8\u8BA4 Medium\uFF0C\u4E0D\u53EF\u5173\u95ED\uFF09\u30023.6/3.7 \u89C6\u89C9\u4EE3\u89C1\u5355\u72EC\u6761\u76EE\u3002"},{id:"doubao",patterns:["doubao","seed"],efforts:{off:null,low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],note:"\u8C46\u5305\u6863\u4F4D\uFF1AOff / Low / Medium / High\u2014\u2014effort \u9636\u68AF\u4ECD\u662F\u793E\u533A\u8BC1\u636E\u3001\u5B98\u65B9 Ark \u6587\u6863\u660E\u5217\u7684\u4E3A thinking.type \u5F00\u5173\uFF082026-08-24 \u590D\u6838\u4ECD\u672A\u89C1\u5230 effort \u5B98\u65B9\u660E\u6587\uFF09\u3002seed \u4EE3\u6536\u56FE\uFF081.5-pro \u4F8B\u5916\uFF09\u3002"},{id:"minimax-m3",patterns:["minimax-m3"],efforts:{off:null,high:"high"},compat:{thinkingFormat:"deepseek"},input:["text","image"],contextWindow:1048576,note:"MiniMax-M3\uFF1A\u5B98\u65B9 thinking \u53C2\u6570 enabled/adaptive/disabled\uFF08\u65E0 effort \u6863\uFF09\uFF0C\u5F00=High\u3001\u5173=disabled\uFF1B\u539F\u751F\u591A\u6A21\u6001\uFF08\u56FE/\u89C6\u9891\uFF0C\u6838\u5FC3\u8BCD\u8868\u4EC5\u542B\u56FE\uFF09\uFF0C1M \u4E0A\u4E0B\u6587\u3002"},{id:"mimo-v2-6",patterns:["mimo-v2.6","mimo-v2.5"],efforts:{off:"none",low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text","image"],contextWindow:1048576,maxTokens:131072,note:"\u5C0F\u7C73 MiMo v2.6 \u7CFB\u5217\uFF08mimo-v2.6-pro / -flash / -pro-ultraspeed\uFF1B1M \u4E0A\u4E0B\u6587 / 128K \u6700\u5927\u8F93\u51FA\u3001\u539F\u751F\u5168\u6A21\u6001\uFF09\u4E0E\u5176\u524D\u4EE3 mimo-v2.5\u3002\u5B98\u65B9\u6587\u6863\uFF1Athinking.type\uFF08enabled/disabled\uFF0C\u9ED8\u8BA4 enabled\uFF09+ reasoning.effort\uFF08none \u5173\u95ED\uFF1B\u5176\u4F59\u5408\u6CD5\u503C\u5747\u5F00\u542F\uFF0C\u4E14**\u73B0\u9636\u6BB5\u6682\u672A\u533A\u5206\u63A8\u7406\u5F3A\u5EA6**\u2014\u2014minimal \u5F52\u4E00\u4E3A low\u3001xhigh/max/ultra \u5F52\u4E00\u4E3A high\uFF09\uFF0C\u56E0\u6B64\u8FD9\u91CC\u58F0\u660E\u7684\u662F\u7AEF\u70B9**\u63A5\u53D7**\u7684\u6863\u4F4D Off / Low / Medium / High\uFF08xhigh\u3001max \u4E0D\u58F0\u660E\uFF0C\u7AEF\u70B9\u53EA\u4F1A\u6298\u53E0\u4E3A high\uFF09\u3002\u601D\u8003\u6A21\u5F0F\u4E0B temperature / top_p \u4E0D\u53EF\u81EA\u5B9A\u4E49\uFF08\u5F3A\u5236 1.0 / 0.95\uFF09\uFF1B\u5E26\u5DE5\u5177\u8C03\u7528\u7684\u5386\u53F2\u8F6E\u5FC5\u987B\u5B8C\u6574\u56DE\u4F20 reasoning_content\uFF0C\u5426\u5219 400\u3002mimo-v2.5 \u4E0E v2.5-pro \u5B98\u65B9\u5B9A\u4E8E 2026-10-21 \u4E0B\u7EBF\u3002"},{id:"mimo-v2-5-pro",patterns:["mimo-v2.5-pro"],efforts:{off:"none",low:"low",medium:"medium",high:"high"},compat:{thinkingFormat:"openai",supportsReasoningEffort:!0},input:["text"],contextWindow:1048576,maxTokens:131072,note:"\u5C0F\u7C73 MiMo v2.5-Pro\uFF1A\u8BE5\u5BB6\u65CF\u552F\u4E00\u7684**\u7EAF\u6587\u672C**\u6210\u5458\uFF08\u5B98\u65B9\u80FD\u529B\u8868\u672A\u5217\u5168\u6A21\u6001\u7406\u89E3\uFF09\uFF0C1M \u4E0A\u4E0B\u6587 / 128K \u6700\u5927\u8F93\u51FA\uFF0C\u63A8\u7406\u5951\u7EA6\u4E0E v2.6 \u7CFB\u5217\u76F8\u540C\uFF08thinking.type + reasoning.effort\uFF0Cnone \u5173\u95ED\u3001\u5176\u4F59\u6863\u4F4D\u6682\u4E0D\u533A\u5206\u5F3A\u5EA6\uFF09\u3002\u5B98\u65B9\u5B9A\u4E8E 2026-10-21 \u4E0B\u7EBF\u3002"},{id:"baidu-ernie",patterns:["ernie"],efforts:!1,input:["text"],contextWindow:131072,note:"\u767E\u5EA6\u5343\u5E06 ERNIE \u7CFB\uFF1A\u5B98\u65B9 OpenAI \u517C\u5BB9\u63A5\u53E3\u65E0 reasoning_effort \u53C2\u6570\u2014\u2014\u601D\u8003\u7531\u6A21\u578B\u53D8\u4F53\u51B3\u5B9A\uFF08-Thinking \u7CFB\u5217\u59CB\u7EC8\u601D\u8003\u3001\u666E\u901A\u7CFB\u5217\u4E0D\u601D\u8003\uFF09\uFF0C\u52FF\u52FE\u601D\u8003\u6863\u3002ERNIE 4.5 Turbo VL \u652F\u6301\u56FE\u7247\uFF0C\u6309\u9700\u624B\u52FE\uFF1B\u53C2\u8003\u5BB9\u91CF\u53D6 Turbo 128K \u6863\u3002"}],qn={off:null,low:"low",medium:"medium",high:"high"},ya={"openai-completions":qn,"openai-responses":qn,"anthropic-messages":qn,deepseek:{off:"none",low:"low",high:"high",max:"max"}},wa={low:"low",medium:"medium",high:"high"};function ft(e){return(e??"").toLowerCase().trim()}function yo(e){return e!==void 0&&/[a-z0-9]/.test(e)}function ut(e){return e.toLowerCase().trim().replace(/[^a-z0-9]+/g," ")}function ko(e,t,n){let r=t===0?void 0:e[t-1],o=e[t+n];return!yo(r)&&!yo(o)}function Wn(e,t){let n=ut(e)+" "+ut(t??""),r;for(let o of ba)for(let i of o.patterns){let s=ut(i),a=n.indexOf(s);for(;a>=0;){if(ko(n,a,s.length)){(r===void 0||s.length>r.length)&&(r={entry:o,length:s.length});break}a=n.indexOf(s,a+1)}}return r?.entry}var xa={"deepseek.com":"deepseek","anthropic.com":"anthropic-messages"};function va(e){let t=ft(e.api);if(t.length>0)return t;let n=e.baseURL;if(n!==void 0&&n.length>0)try{let o=new URL(n).hostname.toLowerCase().split(".");if(o.length>=2){let i=xa[o.slice(-2).join(".")];if(i!==void 0)return i}}catch{}return"openai-completions"}var Bt="openai-completions",Eo="anthropic-messages";function Bn(e){if(e===void 0||e.length===0)return!1;let t="";try{t=new URL(e).hostname.toLowerCase()}catch{return!1}return t==="localhost"||t==="::1"||t.endsWith(".local")||t.endsWith(".internal")||/^(127\.|10\.|192\.168\.)/.test(t)||/^172\.(1[6-9]|2[0-9]|3[01])\./.test(t)?!0:t.includes(":")}function ka(e,t){let n=ft(t),r={...e};if(delete r.supportsMidConvoEffort,delete r.allowedFallbackModels,n===Eo){for(let o of["thinkingFormat","supportsReasoningEffort","thinkingTokenBudgetField","supportsThinkingTokenBudget","vllmPriority","supportsMaxOutputTokens"])delete r[o];return r.forceAdaptiveThinking===void 0?void 0:{forceAdaptiveThinking:r.forceAdaptiveThinking}}if(n==="openai-responses"){for(let o of["thinkingFormat","supportsReasoningEffort","thinkingTokenBudgetField","supportsThinkingTokenBudget","vllmPriority"])delete r[o];return r.supportsMaxOutputTokens===void 0?void 0:{supportsMaxOutputTokens:r.supportsMaxOutputTokens}}if(n===Bt)return delete r.forceAdaptiveThinking,delete r.supportsMaxOutputTokens,Object.keys(r).length===0?void 0:r}function Ea(e,t){let n=ft(t.api);if(n===Bt){let r=e.compat;return r!==void 0&&(r=ka(r,n)??void 0),r===void 0&&!Bn(t.baseURL)?void 0:r===void 0?{thinkingTokenBudgetField:"thinking_token_budget"}:r.thinkingTokenBudgetField===void 0&&r.supportsThinkingTokenBudget!==!0&&Bn(t.baseURL)?{...r,thinkingTokenBudgetField:"thinking_token_budget"}:r}if(n===Eo&&e.anthropicAdaptive===!0)return{forceAdaptiveThinking:!0}}var Ta=["openai.com","openai.azure.com","deepseek.com","openrouter.ai","z.ai","bigmodel.cn","moonshot.ai","moonshot.cn","aliyuncs.com","anthropic.com","x.ai","together.ai","together.xyz","nvidia.com","cerebras.ai","cloudflare.com","chutes.ai","opencode.ai","ant-ling.com"];function Un(e){if(ft(e.api)!==Bt)return!1;let t=e.baseURL;if(t===void 0||t.length===0)return!1;try{let n=new URL(t).hostname.toLowerCase();return n.includes(".")?!Ta.some(r=>n===r||n.endsWith("."+r)):!1}catch{return!1}}function wo(e,t,n){return e===void 0||!n||e.supportsDeveloperRole!==void 0||!Un(t)?e:{...e,supportsDeveloperRole:!1}}var xo={off:null,low:"low",medium:"medium",high:"high"},Ma=["vl","vision","omni","4o","pixtral","internvl"];function jn(e){let t=ut(e);for(let n of Ma){let r=ut(n),o=t.indexOf(r);for(;o>=0;){if(ko(t,o,r.length))return["text","image"];o=t.indexOf(r,o+1)}}}function Sa(e){if(e===void 0)return;let t=e.map(n=>n.toLowerCase());if(t.some(n=>ha.includes(n)))return t.includes("image")?["text","image"]:["text"]}function he(e,t,n){let r=Wn(e,t.displayName),o,i,s,a;r?.input!==void 0&&(o=r.input,i="knowledge"),r?.contextWindow!==void 0&&(s=r.contextWindow),r?.maxTokens!==void 0&&(a=r.maxTokens);let d=Sa(n?.input);if(d!==void 0&&(o=d,i="endpoint"),n?.contextLength!==void 0&&Number.isFinite(n.contextLength)&&n.contextLength>0&&(s=n.contextLength),o===void 0){let b=jn(e);b!==void 0&&(o=b,i="heuristic")}let f={...o===void 0?{}:{input:o},...i===void 0?{}:{inputSource:i},...s===void 0?{}:{contextWindow:s},...a===void 0?{}:{maxTokens:a}},m=n===void 0?{}:{endpoint:{reasoning:n.reasoning,source:n.source}};if(n?.reasoning===!1)return{efforts:!1,matched:!1,source:"endpoint:"+(n.source??"listing"),confidence:"high",...m,...f};if(r!==void 0){let b=wo(Ea(r,t),t,r.efforts!==!1);return{efforts:r.efforts,...r.efforts!==!1&&r.defaultEffort!==void 0&&r.efforts[r.defaultEffort]!==void 0?{defaultEffort:r.defaultEffort}:{},...b===void 0?{}:{compat:b},matched:!0,entryId:r.id,source:r.id,confidence:"high",...m,...f}}let p=va(t),g=ya[p]??wa,l=ft(t.api)===Bt?{thinkingFormat:"openai",supportsReasoningEffort:!0}:void 0,c=l!==void 0&&Bn(t.baseURL)?{...l,thinkingTokenBudgetField:"thinking_token_budget"}:l,u=wo(c,t,!0);return n?.reasoning===!0?{efforts:{...xo},...xo.medium!==void 0?{defaultEffort:"medium"}:{},...u===void 0?{}:{compat:u},matched:!1,source:"endpoint:"+(n.source??"listing"),confidence:"medium",...m,...f}:{efforts:g,...g.medium!==void 0?{defaultEffort:"medium"}:{},...u===void 0?{}:{compat:u},matched:!1,source:"protocol:"+p,confidence:"low",...m,...f}}var Mo="dsh-model-think-level.slider.efforts",zn="breSelectWired";function Gn(e){return typeof e=="object"&&e!==null&&e.ok===!1}function $n(e){if(!Gn(e))return;let t=e.error,n=typeof t?.code=="string"?t.code:"settings/rejected",r=typeof t?.message=="string"?t.message:"";return r.length>0?`${n}: ${r}`:n}function Ke(e,t){return`${e}/${t}`}function So(){try{let e=window.localStorage.getItem(Mo);if(e===null)return{};let t=JSON.parse(e);if(typeof t!="object"||t===null||Array.isArray(t))return{};let n={};for(let[r,o]of Object.entries(t))r.length>0&&typeof o=="string"&&o.trim().length>0&&(n[r]=o);return n}catch{return{}}}function La(e){try{window.localStorage.setItem(Mo,JSON.stringify(e))}catch{}}function Aa(e,t,n){let r=So();r[Ke(e,t)]=n,La(r)}function Ra(e,t){return So()[Ke(e,t)]}function Wt(e,t,n){let o=e.groups.find(i=>i.id===t)?.models.find(i=>i.id===n)?.reasoning?.efforts;return o===void 0?[]:o.map(i=>i.id)}function Oa(e,t,n){return e.groups.find(o=>o.id===t)?.models.find(o=>o.id===n)?.reasoning?.defaultEffort}function Ha(e){if(!(e.length<2))return e[Math.floor((e.length-1)/2)]}function Na(e,t){return e===null||e.provider!==t.provider||e.model!==t.model}async function To(e,t,n,r,o){let i=Wt(e,t,n);if(i.length===0)return;let s=Ke(t,n),a=r.get(s);if(a!==void 0&&i.includes(a))return a;let d=await o?.configuredEffort?.(t,n);if(d!==void 0&&i.includes(d))return d;let f=Ra(t,n);if(f!==void 0&&i.includes(f))return f;let m=he(n,{}).defaultEffort;if(m!==void 0&&i.includes(m))return m;let p=Oa(e,t,n);return p!==void 0&&i.includes(p)?p:Ha(i)}function Lo(e,t){let n=e;if(n[zn]===!0)return()=>{};let r=Object.prototype.hasOwnProperty.call(n,"select"),o=e.select,i=new Map,s=new Set,a=new Map,d=3,f=0,m=async l=>{let c=++f;if(l.reasoningEffort!==void 0){let x=await o.call(e,l);return!Gn(x)&&ue()&&(i.set(Ke(l.provider,l.model),l.reasoningEffort),Aa(l.provider,l.model,l.reasoningEffort)),x}let u=e.store.getSnapshot();if(!Na(u.current,l)){if(ue()){let x=Ke(l.provider,l.model);i.delete(x),s.add(x)}return o.call(e,l)}if(!ue())return o.call(e,l);let b=await To(u,l.provider,l.model,i,t),k=e.store.getSnapshot();if(!(f!==c||((x,T)=>x===null||T===null?x!==T:x.provider!==T.provider||x.model!==T.model||x.reasoningEffort!==T.reasoningEffort)(k.current,u.current)))return!ue()||b===void 0||!Wt(k,l.provider,l.model).includes(b)?o.call(e,l):o.call(e,{...l,reasoningEffort:b})},p=()=>{let l=e.store.getSnapshot(),c=l.current;if(c===null||c.reasoningEffort!==void 0||!ue())return;let u=Ke(c.provider,c.model);if(s.has(u))return;if(Wt(l,c.provider,c.model).length===0){s.add(u);return}s.add(u);let b=f;To(l,c.provider,c.model,i,t).then(async k=>{if(k===void 0){s.delete(u);return}if(!ue()){s.delete(u);return}let w=e.store.getSnapshot(),x=w.current;if(f!==b||x===null||x.reasoningEffort!==void 0||Ke(x.provider,x.model)!==u||!Wt(w,x.provider,x.model).includes(k))return;let T=await o.call(e,{provider:x.provider,model:x.model,reasoningEffort:k});if(Gn(T))throw T}).catch(()=>{let k=(a.get(u)??0)+1;a.set(u,k),k<d&&(s.delete(u),p())})},g=e.store.subscribe(p);return p(),n[zn]=!0,e.select=m,()=>{delete n[zn],g(),r?e.select=o:delete n.select}}function _a(e){if(e.current===null)return[];let r=e.groups.find(o=>o.id===e.current?.provider)?.models.find(o=>o.id===e.current?.model)?.reasoning?.efforts;return r!==void 0&&r.length>=2?r:[]}function Ia(e){return e.current}function Da(e,t){let n=Ia(t),r=e.findIndex(a=>a.id===n?.reasoningEffort);if(r>=0)return r;let i=t.groups.find(a=>a.id===n?.provider)?.models.find(a=>a.id===n?.model)?.reasoning?.defaultEffort,s=i===void 0?-1:e.findIndex(a=>a.id===i);return s>=0?s:Math.floor((e.length-1)/2)}function Ao(e){return e.models??[]}function Ut(e){let t=e;return t.name??t.label??t.title??e.id}function Vn(e){return(0,M.createElement)("span",{className:"bre-row-chevron"+(e?" is-open":""),"aria-hidden":!0},"\u203A")}function Pa(){return(0,M.createElement)("svg",{className:"bre-option-check",width:14,height:14,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0},(0,M.createElement)("path",{d:"M3.5 8.5l3 3 6-7",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round"}))}var Ro=new Map;function Ca(e){if(Array.isArray(e.input))return e.input.includes("image");let t=Ro.get(e.id);if(t!==void 0)return t;let n=Wn(e.id,e.name)?.input,r=n!==void 0?n.includes("image"):(jn(e.id)??[]).includes("image");return Ro.set(e.id,r),r}function Fa(e){let t=e.reasoning?.efforts;return Array.isArray(t)&&t.length>0}function Ka(e){return(0,M.createElement)("svg",{className:"bre-tag-icon",width:13,height:13,viewBox:"0 0 16 16",fill:"none",role:"img","aria-label":e},(0,M.createElement)("path",{d:"M1.8 8s2.4-4.2 6.2-4.2S14.2 8 14.2 8s-2.4 4.2-6.2 4.2S1.8 8 1.8 8z",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round"}),(0,M.createElement)("circle",{cx:8,cy:8,r:1.8,fill:"currentColor"}))}function qa(e){return(0,M.createElement)("svg",{className:"bre-tag-icon",width:13,height:13,viewBox:"0 0 16 16",fill:"none",role:"img","aria-label":e},(0,M.createElement)("path",{d:"M8 1.9l1.35 3.75L13.1 7l-3.75 1.35L8 12.1 6.65 8.35 2.9 7l3.75-1.35z",fill:"currentColor"}))}function Ba(e,t){let n=[];return Ca(e)&&n.push((0,M.createElement)("span",{key:"vision",className:"bre-tag",title:t("tagVision")},Ka(t("tagVision")))),Fa(e)&&n.push((0,M.createElement)("span",{key:"thinking",className:"bre-tag",title:t("tagThinking")},qa(t("tagThinking")))),n.length===0?null:(0,M.createElement)("span",{className:"bre-option-tags"},...n)}function Oo(e){let{directory:t,t:n}=e,r=e.onLayoutChange,o=(0,M.useSyncExternalStore)(S=>t.store.subscribe(S),()=>t.store.getSnapshot()),i=_a(o),[s,a]=(0,M.useState)(""),[d,f]=(0,M.useState)(null),[m,p]=(0,M.useState)(null),[g,l]=(0,M.useState)(!1),[c,u]=(0,M.useState)(null),b=(0,M.useRef)(null),k=(0,M.useRef)(""),w=(0,M.useRef)(!1),x=o.current!==null&&i.length>=2,T=g||o.status==="selecting",y=c??o.error,E=t.select;(0,M.useEffect)(()=>{if(w.current)return;let S=Da(i,o),Q=i[S]?.id??"";k.current=Q,a(Q),u(null)},[x,i,o]),(0,M.useEffect)(()=>{t.load().catch(()=>{})},[t]);let R=o.current,K=o.groups.find(S=>S.id===R?.provider),I=K?.models.find(S=>S.id===R?.model)?.name??(R===null?n("triggerFallback"):R.model),B=R===null?I:Ut(K??{id:R.provider})+" \xB7 "+I,A=i.find(S=>S.id===s)?.name??n("effortDefault"),D=(0,M.useSyncExternalStore)(Dt,_n),W=(0,M.useSyncExternalStore)(Ft,io),C=(0,M.useSyncExternalStore)(qt,co),z=o.groups.filter(S=>Ao(S).length>0&&!W.includes(S.id)).map(S=>S.id),V=Ze(In(z),D),U=m!==null&&V.includes(m)?m:R!==null&&V.includes(R.provider)?R.provider:V[0]??null,L=U===null?[]:ho(Ao(o.groups.find(S=>S.id===U)),C[U]??[]),P=R===null?"":R.provider+"/"+R.model,_=(0,M.useCallback)(S=>{d!==S&&((0,Yn.flushSync)(()=>{f(S)}),r?.())},[r,d]),te=(0,M.useCallback)(()=>{d!==null&&((0,Yn.flushSync)(()=>{f(null)}),r?.())},[r,d]),oe=(0,M.useCallback)(()=>{let S=b.current?.closest('[role="menu"]');S!=null&&(S.tabIndex=-1,S.focus({preventScroll:!0}))},[]),Pe=(0,M.useCallback)(async(S,Q)=>{if(w.current)return;let Z=t.store.getSnapshot().current;if(te(),!(Z!==null&&Z.provider===S&&Z.model===Q)){w.current=!0,oe(),l(!0),u(null);try{let de=await E({provider:S,model:Q}),Ee=$n(de);if(Ee!==void 0)throw new Error(Ee)}catch(de){u(de instanceof Error?de.message:String(de))}finally{w.current=!1,l(!1)}}},[te,t,oe,E]),Ve=(0,M.useCallback)(async S=>{if(w.current||(te(),S===o.current?.reasoningEffort&&o.status!=="error"))return;w.current=!0;let Q=k.current;oe(),l(!0),u(null),a(S);try{let Z=o.current;if(Z===null)throw new Error(n("sliderNoCurrent"));let de=await E({provider:Z.provider,model:Z.model,reasoningEffort:S}),Ee=$n(de);if(Ee!==void 0)throw new Error(Ee);let Te=t.store.getSnapshot(),at=i.find(At=>At.id===Te.current?.reasoningEffort)?.id??S;k.current=at,a(at)}catch(Z){k.current=Q,a(Q),u(Z instanceof Error?Z.message:String(Z))}finally{w.current=!1,l(!1)}},[te,t,oe,i,E,o.current,o.status,n]),Ce=[(0,M.createElement)("button",{key:"row:model",type:"button",role:"menuitem",className:"bre-row-control"+(d==="model"?" is-open":""),disabled:T,"aria-expanded":d==="model",onClick:()=>{_(d==="model"?null:"model")}},(0,M.createElement)("span",{className:"bre-row-label"},n("modelRowLabel")),(0,M.createElement)("span",{className:"bre-row-value"},B),Vn(d==="model")),d==="model"?(0,M.createElement)("div",{key:"panel:model",className:"bre-panel bre-panel-models"},(0,M.createElement)("div",{className:"bre-providers",role:"group","aria-label":n("modelRowLabel")},...V.map(S=>(0,M.createElement)("button",{key:S,type:"button",className:"bre-provider"+(S===U?" is-open":"")+(S===R?.provider?" is-current":""),disabled:T,"aria-expanded":S===U,onClick:()=>{p(S)}},(0,M.createElement)("span",{className:"bre-option-name"},Ut(o.groups.find(Q=>Q.id===S))),Vn(S===U))),...V.length===0?[(0,M.createElement)("div",{key:"no-providers",className:"bre-empty"},n("sliderNoCurrent"))]:[]),(0,M.createElement)("div",{className:"bre-provider-models",role:"group","aria-label":n("modelRowLabel")},...L.length===0?[(0,M.createElement)("div",{key:"no-models",className:"bre-empty"},n("sliderNoCurrent"))]:L.map(S=>{let Q=U+"/"+S.id,Z=Q===P;return(0,M.createElement)("button",{key:Q,type:"button",className:"bre-option"+(Z?" is-active":""),disabled:T,"aria-pressed":Z,onClick:()=>{Pe(U,S.id)}},(0,M.createElement)("span",{className:"bre-option-name"},S.name??S.id),Ba(S,n))}))):null,(0,M.createElement)("div",{key:"divider",className:"bre-divider","aria-hidden":!0}),(0,M.createElement)("button",{key:"row:effort",type:"button",role:"menuitem",className:"bre-row-control"+(d==="effort"?" is-open":""),disabled:T||!x,"aria-expanded":x?d==="effort":void 0,onClick:()=>{_(d==="effort"?null:"effort")}},(0,M.createElement)("span",{className:"bre-row-label"},n("effortRowLabel")),(0,M.createElement)("span",{className:"bre-row-value"+(x?"":" is-muted")},x?A:n("sliderNoLevels")),x?Vn(d==="effort"):null),d==="effort"&&x?(0,M.createElement)("div",{key:"panel:effort",className:"bre-panel",role:"group","aria-label":n("effortRowLabel")},...i.map(S=>(0,M.createElement)("button",{key:S.id,type:"button",className:"bre-option"+(S.id===s?" is-active":""),disabled:T,"aria-pressed":S.id===s,onClick:()=>{Ve(S.id)}},(0,M.createElement)("span",{className:"bre-option-name"},S.name),S.id===s?Pa():null))):null];return(0,M.createElement)("div",{className:"bre-slider-body",ref:b},(0,M.createElement)("div",{className:"bre-card"},...Ce),y===null?null:(0,M.createElement)("div",{className:"bre-model-error",role:"status"},y))}var G=require("react"),No='section[role="group"]',Xn='button[role="menuitemradio"]';function _o(e){return e.querySelector(No)!==null}function Jn(e){return Array.from(e.querySelectorAll(Xn)).filter(t=>!t.disabled&&t.style.display!=="none")}function Wa(e){let t=e.getAttribute("aria-labelledby");return(t===null?null:e.ownerDocument.getElementById(t))?.textContent?.toLowerCase()??""}function Ho(e,t,n=new Map){let r=d=>{n.has(d)||n.set(d,d.style.display),d.style.display="none"},o=d=>{let f=n.get(d);f!==void 0&&(d.style.display=f,n.delete(d))};for(let d of[...n.keys()])d.isConnected||n.delete(d);let i=t.trim().toLowerCase().split(/\s+/).filter(Boolean),s=Array.from(e.querySelectorAll(No)),a=0;if(i.length===0){for(let d of[...n.keys()])o(d);for(let d of s)a+=d.querySelectorAll(Xn).length;return a}for(let d of s){let f=Wa(d),m=Array.from(d.querySelectorAll(Xn)),p=0;for(let g of m){let l=(g.getAttribute("title")??"").toLowerCase(),c=(g.textContent??"").toLowerCase(),u=`${f} ${l} ${c}`;i.every(b=>u.includes(b))?(o(g),p+=1):r(g)}p>0?(o(d),a+=p):r(d)}return a}function Io({menu:e,t}){let[n,r]=(0,G.useState)(""),[o,i]=(0,G.useState)(0),s=(0,G.useRef)(null),a=(0,G.useRef)(""),d=(0,G.useRef)(new Map),f=(0,G.useCallback)(l=>{a.current=l;let c=Ho(e,l,d.current);i(c)},[e]);(0,G.useEffect)(()=>()=>{Ho(e,"",d.current)},[e]),(0,G.useEffect)(()=>{let l=new MutationObserver(()=>{a.current.trim().length!==0&&f(a.current)});return l.observe(e,{childList:!0,subtree:!0}),()=>{l.disconnect()}},[e,f]),(0,G.useEffect)(()=>{let l=c=>{if(a.current.trim().length===0)return;let u=c.key;if(!(u==="ArrowDown"||u==="ArrowUp")&&!(u==="Home"||u==="End"||u==="PageUp"||u==="PageDown")||c.target===s.current||c.target instanceof Node&&!e.contains(c.target))return;let w=Jn(e);if(w.length===0)return;let x=w.findIndex(y=>y===document.activeElement),T;u==="Home"||u==="PageUp"?T=0:u==="End"||u==="PageDown"?T=w.length-1:u==="ArrowDown"?T=x===-1?0:(x+1)%w.length:T=x===-1?w.length-1:(x-1+w.length)%w.length,c.preventDefault(),c.stopPropagation(),w[T]?.focus()};return e.addEventListener("keydown",l,!0),()=>{e.removeEventListener("keydown",l,!0)}},[e]);let m=l=>{let c=l.key;if(c==="ArrowDown"){l.preventDefault(),l.stopPropagation(),Jn(e)[0]?.focus();return}if(n.trim().length>0&&(c==="ArrowUp"||c==="Home"||c==="PageUp"||c==="End"||c==="PageDown")){let u=Jn(e);u.length>0&&(l.preventDefault(),l.stopPropagation(),u[c==="ArrowUp"||c==="End"||c==="PageDown"?u.length-1:0]?.focus());return}c==="Escape"&&n.length>0&&(l.preventDefault(),l.stopPropagation(),r(""),f(""))},p=()=>{r(""),f(""),s.current?.focus({preventScroll:!0})},g=o===0&&n.trim().length>0;return(0,G.createElement)("div",{className:"bre-model-search-box"+(g?" has-empty":""),"data-bre-search":"1"},(0,G.createElement)("div",{className:"bre-search-input-wrapper"},(0,G.createElement)("span",{className:"bre-search-icon","aria-hidden":"true"},(0,G.createElement)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},(0,G.createElement)("circle",{cx:"7",cy:"7",r:"4.5"}),(0,G.createElement)("path",{d:"M10.5 10.5L14 14",strokeLinecap:"round"}))),(0,G.createElement)("input",{ref:s,type:"text",className:"bre-search-input",role:"searchbox",placeholder:t("modelSearchPlaceholder"),"aria-label":t("modelSearchPlaceholder"),value:n,spellCheck:!1,autoComplete:"off",onChange:l=>{let c=l.currentTarget.value;r(c),f(c)},onKeyDown:m}),n.length>0?(0,G.createElement)("button",{type:"button",className:"bre-search-clear",title:t("modelSearchClear"),"aria-label":t("modelSearchClear"),onClick:p},(0,G.createElement)("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5"},(0,G.createElement)("path",{d:"M4 4L12 12M12 4L4 12",strokeLinecap:"round"}))):null),g?(0,G.createElement)("div",{className:"bre-search-empty",role:"status"},t("modelSearchNoMatches")):null)}var jt=require("react"),Do=require("react-dom"),Po=require("react-dom/client");function be(){return document.body}function ct(e,t,n){let r=(0,Po.createRoot)(e);return n?.sync===!0?(0,Do.flushSync)(()=>{r.render(t)}):r.render(t),{wrapper:e,root:r}}function qe(e){e!==void 0&&(e.root.unmount(),e.wrapper.remove())}var ve=class extends jt.Component{constructor(){super(...arguments);Br(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n instanceof Error?n.message:String(n)}}componentDidCatch(n,r){console.error("[bre] editor render failed:",n,r.componentStack)}render(){return this.state.error!==null?(0,jt.createElement)("div",{style:{color:"#c00",fontSize:"11px",whiteSpace:"pre-wrap",padding:"6px"}},`${this.props.fallbackText}: ${this.state.error}`):this.props.children}};var Co=()=>{(0,Fo.flushSync)(()=>{window.dispatchEvent(new Event("resize"))})};function Ko(e){let{menuOf:t,triggerOf:n,t:r,refreshed:o,sliderEnabled:i,directory:s}=e,a,d,f,m,p,g,l=()=>{g?.removeAttribute("data-bre-provider"),g=void 0},c=()=>{let y=n();g!==void 0&&g!==y&&l();let E=m?.store.getSnapshot(),R=E?.current;if(y===void 0||R===null||R===void 0){y===g&&l();return}let K=E?.groups.find(I=>I.id===R.provider),j=K===void 0?R.provider:Ut(K);if(j.trim()===""){y===g&&l();return}y.dataset.breProvider=j,g=y},u=()=>{let y=s();y!==m&&(p?.(),p=void 0,m=y,y!==void 0&&(p=y.store.subscribe(c))),c()},b=()=>{qe(d),d=void 0},k=y=>{let E=y.querySelector('section[role="group"]'),R=E?.parentElement,K=R!=null&&R.parentElement===y?R:E;if(d===void 0){let j=document.createElement("div");j.dataset.plugin=J,j.dataset.breSearch="1",y.insertBefore(j,K),d=ct(j,(0,pt.createElement)(ve,{fallbackText:r("modelSearchFailed"),children:o(()=>(0,pt.createElement)(Io,{menu:y,t:r}))}),{sync:!0});return}if(d.wrapper.parentElement!==y){y.insertBefore(d.wrapper,K);return}K!==null&&d.wrapper.nextSibling!==K&&y.insertBefore(d.wrapper,K)},w=y=>{if(!i()){qe(a),a=void 0,y.classList.remove("bre-model-menu-host");for(let I of Array.from(y.children))I.getAttribute("role")==="menuitem"&&(I.style.display="");return}let E=s();if(E===void 0)return;if(a===void 0){let I=document.createElement("div");I.dataset.plugin=J,I.dataset.breSlider="1",y.insertBefore(I,y.firstChild),a=ct(I,(0,pt.createElement)(ve,{fallbackText:r("renderFailed"),children:o(()=>(0,pt.createElement)(Oo,{directory:E,t:r,onLayoutChange:Co}))}),{sync:!0})}else(a.wrapper.parentElement!==y||y.firstChild!==a.wrapper)&&y.insertBefore(a.wrapper,y.firstChild);y.classList.add("bre-model-menu-host");let R=Array.from(y.children).filter(I=>I.getAttribute("role")==="menuitem"),K=a.wrapper;if(Array.from(y.querySelectorAll('[role="menuitemradio"]')).some(I=>!K.contains(I)))a.wrapper.contains(document.activeElement)&&(y.tabIndex=-1,y.focus({preventScroll:!0})),a.wrapper.style.display="none";else{a.wrapper.style.display="";for(let I of R)I.style.display="none"}};return{reconcile:()=>{u();let y=t();if(y===void 0){qe(a),a=void 0,b(),f=void 0;return}let E=_o(y);E?k(y):b(),w(y),E!==f&&(f=E,(E||i())&&Co())},dispose:()=>{p?.(),p=void 0,m=void 0,l(),qe(a),a=void 0,b(),f=void 0}}}var H=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function qo(e){let t=e.toLowerCase();return t.includes("compat")||t.includes("thinkingtokenbudget")||t.includes("vllmpriority")||t.includes("supportsmaxoutput")}function zt(e,t){if(!H(e))return[];let n=e[t];return!H(n)||!Array.isArray(n.models)?[]:n.models.filter(H)}function Be(e,t){if(!H(e))return{};let n=e[t];if(!H(n))return{};let r=typeof n.api=="string"?n.api:void 0,o=typeof n.baseURL=="string"?n.baseURL:void 0,i=typeof n.displayName=="string"?n.displayName:void 0;return{api:r,baseURL:o,displayName:i}}var Le=(e,t)=>typeof e[t]=="boolean";function Ua(e,t){if(Array.isArray(e)){for(let n of e)if(H(n)&&n.id===t)return n}}function ja(e){if(!H(e))return{reasoning:"unknown",source:null};let t=e.supported_features;if(Array.isArray(t)&&t.includes("reasoning"))return{...ye(e),reasoning:!0,source:"supported_features"};let n=e.supported_parameters;if(Array.isArray(n)&&(n.includes("reasoning")||n.includes("include_reasoning")||n.includes("reasoning_effort")))return{...ye(e),reasoning:!0,source:"supported_parameters"};if(Le(e,"supports_reasoning"))return{...ye(e),reasoning:e.supports_reasoning,source:"supports_reasoning"};if(Le(e,"supportsReasoning"))return{...ye(e),reasoning:e.supportsReasoning,source:"supportsReasoning"};if(Le(e,"can_reason"))return{...ye(e),reasoning:e.can_reason,source:"can_reason"};if(Le(e,"reasoning"))return{...ye(e),reasoning:e.reasoning,source:"reasoning"};let r=e.reasoning_effort;if(r!=null&&!(typeof r=="string"&&r.trim().length===0)||e.supports_reasoning_effort===!0)return{...ye(e),reasoning:!0,source:"reasoning_effort"};let o=H(e.capabilities)?e.capabilities:void 0;if(o!==void 0){let i=o.thinking;if(H(i)&&typeof i.supported=="boolean")return{...ye(e),reasoning:i.supported,source:"capabilities.thinking.supported"};let s=o.effort;if(H(s)&&typeof s.supported=="boolean")return{...ye(e),reasoning:s.supported,source:"capabilities.effort.supported"}}return{...ye(e),reasoning:"unknown",source:null}}function ye(e){let t={},n=s=>{if(!Array.isArray(s))return;let a=s.filter(d=>typeof d=="string");return a.length>0?a.map(d=>d.toLowerCase()):[]},r=H(e.architecture)?e.architecture:void 0,o=n(r?.input_modalities);if(o===void 0&&(o=n(e.input_modalities)),o===void 0){let s=H(e.modalities)?e.modalities:void 0;o=n(s?.input)}if(o===void 0){let s=e.capabilities,a=d=>Array.isArray(d)&&d.some(f=>typeof f=="string"&&f.toLowerCase()==="vision");if(a(e.supported_features)||a(s))o=["image"];else if(H(s)){let d=[];for(let f of["image_input","video_input","pdf_input","file_input"]){let m=H(s[f])?s[f]:void 0;if(m===void 0||typeof m.supported!="boolean")continue;let p=f.replace(/_input$/,"");m.supported===!0?d.push(p):d.length===0&&d.push("text")}d.length>0&&(o=d)}}o===void 0&&(Le(e,"supports_vision")?o=e.supports_vision===!0?["image"]:[]:Le(e,"supportsVision")?o=e.supportsVision===!0?["image"]:[]:(Le(e,"supports_images")||Le(e,"supportsImages"))&&(o=e.supports_images===!0||e.supportsImages===!0?["image"]:[])),o!==void 0&&(t.input=o.length===0?["text"]:o);let i=e.context_length;if(typeof i=="number"&&Number.isFinite(i)&&i>0)t.contextLength=i;else{let a=(H(e.top_provider)?e.top_provider:void 0)?.context_length;if(typeof a=="number"&&Number.isFinite(a)&&a>0)t.contextLength=a;else{let d=e.max_input_tokens;if(typeof d=="number"&&Number.isFinite(d)&&d>0)t.contextLength=d;else{let m=(H(e.limit)?e.limit:void 0)?.context;typeof m=="number"&&Number.isFinite(m)&&m>0&&(t.contextLength=m)}}}return t}function Bo(e,t){let n=Ua(e,t);return n===void 0?{found:!1,signal:{reasoning:"unknown",source:null}}:{found:!0,signal:ja(n)}}function we(e){let n=e?.value?.providers;return typeof n!="object"||n===null||Array.isArray(n)?{}:Object.fromEntries(Object.entries(n).filter(([,r])=>typeof r=="object"&&r!==null&&!Array.isArray(r)))}function Gt(e){if(!H(e))return;let t=e.providers;return H(t)?t:void 0}function Wo(e,t){for(let n of[e?.user,e?.base]){let r=Gt(n)?.[t];if(H(r)&&r.models!==void 0)return r.models}}function Qn(e){return Gt(e?.user)}function $t(e,t){let n=e.find(o=>o.id===t);if(n===void 0)return;let r=n.reasoningEfforts;if(r===!1)return!1;if(typeof r=="object"&&r!==null&&!Array.isArray(r))return r}function Vt(e,t){let r=e.find(i=>i.id===t)?.input;if(!Array.isArray(r))return;let o=r.filter(i=>typeof i=="string");return o.length>0?o:void 0}function Yt(e,t){let r=e.find(o=>o.id===t)?.compat;if(H(r))return{...r}}function Jt(e,t){let r=e.find(o=>o.id===t)?.name;return typeof r=="string"&&r.length>0?r:void 0}function Xt(e,t){let r=e.find(o=>o.id===t)?.[Je];return typeof r=="string"&&r.length>0?r:void 0}async function za(e,t){try{let n=await fetch(`${Wr}?route=${encodeURIComponent(e)}`,{method:"GET"});if(!n.ok)return{reasoning:"unknown",source:null};let r=await n.json();return r?.ok?Bo(r.data,t).signal:{reasoning:"unknown",source:null}}catch{return{reasoning:"unknown",source:null}}}function Qt(e,t=()=>ne(e),n,r,o,i){return{async suggest(s,a,d,f){let m=we((await t()).namespace),p=Be(m,s),g={api:p.api??f?.api,baseURL:p.baseURL??f?.baseURL,displayName:d??p.displayName},l=m[s]===void 0?void 0:await za(s,a),c=he(a,g,l);return c.efforts===void 0?{ok:!1,error:"no-suggestion"}:{ok:!0,suggestion:{efforts:c.efforts,...c.compat===void 0?{}:{compat:c.compat},...c.defaultEffort===void 0?{}:{defaultEffort:c.defaultEffort},...c.defaultEffort===void 0?{}:{defaultEffort:c.defaultEffort},...c.input===void 0?{}:{input:c.input},...c.inputSource===void 0?{}:{inputSource:c.inputSource},...c.contextWindow===void 0?{}:{contextWindow:c.contextWindow},...c.maxTokens===void 0?{}:{maxTokens:c.maxTokens},matched:c.matched,source:c.source,confidence:c.confidence,...c.endpoint===void 0?{}:{endpoint:c.endpoint}}}},commit(s,a,d){if(i?.()===!0){n?.(s,a,d.efforts,d.compat,d.input,d.defaultEffort);return}r?.(s,a,{efforts:d.efforts,...d.compat===void 0?{}:{compat:d.compat},...d.input===void 0?{}:{input:d.input},...d.clearCompatKeys===void 0?{}:{clearCompatKeys:d.clearCompatKeys},...d.defaultEffort===void 0?{}:{defaultEffort:d.defaultEffort}})},withdraw(s,a){o?.(s,a)},stageEfforts(s,a,d,f,m,p){n?.(s,a,d,f,m,p)},async writeEfforts(s,a,d,f,m,p,g){if(r!==void 0)return r(s,a,{efforts:d,...f===void 0?{}:{compat:f},...m===void 0?{}:{input:m},...p===void 0?{}:{clearCompatKeys:p},...g===void 0?{}:{defaultEffort:g}}),{ok:!0,staged:!0};let c=(await mt(e,s,[{modelId:a,efforts:d,...f===void 0?{}:{compat:f},...m===void 0?{}:{input:m},...p===void 0?{}:{clearCompatKeys:p},...g===void 0?{}:{defaultEffort:g}}],t))[0]??{ok:!1,error:"no-result"};return c.ok?{ok:!0}:c.modelNotFound===!0?{ok:!1,error:"model-not-found"}:{ok:!1,error:c.error??"conflict"}}}}async function mt(e,t,n,r=()=>ne(e),o){if(n.length===0)return[];let i=!1;for(let s=0;s<3;s++)try{let a=s===0?await r():await ne(e,{fresh:!0});if(a.namespace===void 0)return n.map(()=>({ok:!1,error:"no-namespace"}));let d=Wo(a.namespace,t);if(!Array.isArray(d))return n.map(()=>({ok:!1,modelNotFound:!0}));if(!d.every(H))return n.map(()=>({ok:!1,error:"invalid-models"}));let m=d.map(l=>l),p=[];for(let l of n){let c=m.findIndex(u=>u.id===l.modelId);if(c<0){p.push(l.modelId);continue}m[c]=Ga(m[c],l,i?void 0:l.compat)}if(p.length>0)return n.map(l=>p.includes(l.modelId)?{ok:!1,modelNotFound:!0}:{ok:!1,error:"model-not-found"});if(o?.()===!0)return n.map(()=>({ok:!1,aborted:!0}));let g=await e.settings.mutate(re,[{op:"set",path:["providers",t,"models"],value:m}],a.namespace.revision);if(!g.ok){if(s===0&&g.error.code==="settings/conflict")continue;let l=g.error.code==="settings/rejected"&&qo(g.error.message);if(!i&&l&&n.some(c=>c.compat!==void 0)){i=!0;continue}return n.map(()=>({ok:!1,error:g.error.message}))}return n.map(()=>({ok:!0}))}catch(a){return n.map(()=>({ok:!1,error:a instanceof Error?a.message:String(a)}))}return n.map(()=>({ok:!1,error:"conflict"}))}function Ga(e,t,n){let r={...e},o=t.efforts!=="keep",i=t.efforts==="keep"?void 0:t.efforts;if(o)if(i===void 0)delete r.reasoningEfforts,r[se]=!0;else if(delete r[se],delete r[Ye],i===!1)r.reasoningEfforts=!1;else{r.reasoningEfforts={...i};let s=H(e.compat)?e.compat:{},a={...s,...n??{}};for(let d of t.clearCompatKeys??[])delete a[d];(Object.keys(s).length>0||Object.keys(a).length>0)&&(Object.keys(a).length===0?delete r.compat:r.compat=a)}return t.input!==void 0&&(t.input===null?(delete r.input,r[Me]=!0):(delete r[Me],r.input=[...t.input])),t.defaultEffort!==void 0&&(t.defaultEffort===null?delete r[Je]:r[Je]=t.defaultEffort),r}function Zn(e,t){for(let n of[e?.user,e?.base]){let r=Gt(n)?.[t];if(!H(r))continue;let o=r.headers;if(o===void 0)continue;if(!H(o))return;let i={};for(let[s,a]of Object.entries(o))typeof a=="string"&&(i[s]=a);return i}}async function er(e,t,n){if(typeof t!="string"||t.length===0)return{ok:!1,error:"no-route"};for(let r=0;r<2;r+=1)try{let o=r===0?await ne(e):await ne(e,{fresh:!0});if(o.namespace===void 0)return{ok:!1,error:"no-namespace"};if(o.writable!==!0)return{ok:!1,error:"read-only"};if(!$a(o.namespace,t))return{ok:!1,error:"no-route"};let i=await e.settings.mutate(re,[{op:"set",path:["providers",t,"headers"],value:{...n}}],o.namespace.revision);if(!i.ok){if(r===0&&i.error.code==="settings/conflict")continue;return{ok:!1,error:i.error.message}}return{ok:!0}}catch(o){return{ok:!1,error:o instanceof Error?o.message:String(o)}}return{ok:!1,error:"conflict"}}function $a(e,t){for(let n of[e?.user,e?.base]){let r=Gt(n);if(r!==void 0&&Object.prototype.hasOwnProperty.call(r,t))return!0}return!1}async function ne(e,t={}){let n=t.fresh===!0?void 0:Va(e);if(n!==void 0)return n;let r=await e.settings.describe();return r.ok?{namespace:r.value.namespaces.find(i=>i.ns===re),writable:r.value.writable}:{namespace:void 0,writable:!1}}function Va(e){let t=e.scope?.getSnapshot();if(!(t===void 0||t.status!=="ready")&&typeof t.revision=="number")return{namespace:{ns:re,schema:{},value:t.value,user:t.user,base:t.base,revision:t.revision,applies:"live",secrets:[]},writable:t.writable===!0}}function Uo(e){let t,n,r=0,o=()=>{if(t!==void 0)return Promise.resolve();let a=r;return n??(n=ne(e.api).then(d=>{if(d.namespace===void 0){n=void 0;return}let f=new Map;for(let[m,p]of Object.entries(we(d.namespace))){let g=Array.isArray(p.models)?p.models:[];for(let l of g){if(typeof l!="object"||l===null||Array.isArray(l))continue;let c=l.id,u=l[Je];typeof c=="string"&&typeof u=="string"&&u.length>0&&f.set(`${m}/${c}`,u)}}a===r?t=f:n=void 0}).catch(()=>{a===r&&(n=void 0)})),n};return{of:async(a,d)=>(await o(),t?.get(`${a}/${d}`)),invalidate:()=>{r+=1,t=void 0,n=void 0}}}function Ya(e){let t=e.input;return Array.isArray(t)&&t.length>0}function jo(e,t=()=>!0,n={},r=0){let o=n.efforts!==!1,i=n.modalities!==!1;if(!H(e))return;let s={};for(let a of Object.keys(e)){if(!t(a))continue;let d=e[a],f=H(d)&&Array.isArray(d.models)?d.models:void 0;if(f===void 0||f.length===0||!f.every(H))continue;let m=f,p=[],g=!1;for(let l of m){let c=l.reasoningEfforts!==void 0||l[se]===!0,u=Ya(l)||l[Me]===!0;if((c||!o)&&(u||!i)){let E=Ja(l,e,a);E!==void 0?(g=!0,p.push(E)):p.push(l);continue}let b=typeof l.id=="string"?l.id:"";if(b.length===0){p.push(l);continue}let k=Be(e,a),w=typeof l.name=="string"?l.name:void 0,x=he(b,{...k,displayName:w??k.displayName});if(x.efforts===void 0){p.push(l);continue}let T={...l},y=!1;if(!c&&o&&(y=!0,T.reasoningEfforts=x.efforts,T[Ye]=r,x.compat!==void 0)){let E=H(l.compat)?l.compat:{};T.compat={...E,...x.compat}}if(!u&&i&&x.input!==void 0&&(y=!0,T.input=[...x.input]),!y){p.push(l);continue}g=!0,p.push(T)}g&&(s[a]={models:p})}return Object.keys(s).length===0?void 0:{providers:s}}function Ja(e,t,n){if(!H(e.reasoningEfforts)||e[se]===!0)return;let r=e.compat,o=H(r)?{...r}:{};if(o.supportsDeveloperRole===void 0&&Un(Be(t,n)))return{...e,compat:{...o,supportsDeveloperRole:!1}}}function zo(e){let t,n=()=>(t??(t=(async()=>{let o={autofill:!0,modalityAutofill:!0};try{let i=await fetch(jr,{method:"GET"});if(!i.ok)return o;let s=await i.json();return s?.ok!==!0?o:{autofill:s.data?.autofill!==!1,modalityAutofill:s.data?.modalityAutofill!==!1}}catch{return o}})()),t),r=async()=>{try{let o=await n();if(!o.autofill)return;let i=await ne(e.api,{fresh:!0}),s=i.namespace;if(s===void 0||i.writable!==!0)return;let a=Qn(s);if(a===void 0)return;let d=jo(a,()=>!0,{modalities:o.modalityAutofill},s.revision);if(d===void 0)return;let f=d.providers,m=Object.entries(f).map(([g,l])=>({op:"set",path:["providers",g,"models"],value:l.models})),p=await e.api.settings.mutate(re,m,s.revision);p.ok||console.error(`[bre] idle autofill refused: ${p.error.message}`)}catch(o){console.error(`[bre] idle autofill failed: ${o instanceof Error?o.message:String(o)}`)}};return{run:()=>{r()}}}var Lr=require("react"),Ts=require("react-dom/client");var F=require("react");var We=vo;function Ue(e){let t={};for(let n of We){if(e===void 0){t[n]={on:!1,wire:""};continue}if(e===!1){t[n]=n==="off"?{on:!0,wire:""}:{on:!1,wire:""};continue}let r=e[n];t[n]={on:r!==void 0,wire:r===null?"":typeof r=="string"?r:""}}return t}function et(e){let t=!1,n=!1,r={};for(let o of We){let i=e[o];if(!i.on)continue;if(o==="off"){t=!0;let a=i.wire.trim();r.off=a.length===0?null:a;continue}n=!0;let s=i.wire.trim();r[o]=s.length===0?o:s}return n?r:t?!1:void 0}function gt(e,t){if(e===t)return!0;if(e===!1||e===void 0||t===!1||t===void 0)return!1;let n=We.filter(o=>e[o]!==void 0),r=We.filter(o=>t[o]!==void 0);return n.length!==r.length?!1:n.every(o=>e[o]===t[o])}function Go(e,t){if(!(e===void 0||e===!1)&&!("off"in e)){if(t==="zai"||t==="deepseek")return"thinking-disabled";if(t==="qwen")return"enable-thinking-false"}}var tr="bre:auto-effort",$o=Promise.resolve();function Vo(e){$o=$o.then(e,e).then(()=>{},()=>{})}function Yo(e,t=document){t.dispatchEvent(new CustomEvent(tr,{detail:{route:e}}))}function Jo(e,t=document){let n=r=>{let o=r.detail;typeof o?.route!="string"||o.route.length===0||e(o.route)};return t.addEventListener(tr,n),()=>{t.removeEventListener(tr,n)}}var v=require("react/jsx-runtime"),Xo=new Intl.NumberFormat("en-US");function je(e){return e===void 0||e.length===0?{declared:!1,image:!1}:{declared:!0,image:e.includes("image")}}function nr(e){return e.declared?e.image?["text","image"]:["text"]:null}var Xa={"openai-completions":["thinkingTokenBudgetField","supportsThinkingTokenBudget","vllmPriority"],"openai-responses":["supportsMaxOutputTokens"]};function Qa(e){return Xa[(e??"").toLowerCase()]??[]}function Qo(e,t){let n=Qa(e);if(n.length===0)return[];let r=new Set(t===void 0?[]:Object.keys(t));return n.filter(o=>!r.has(o))}function Za(e,t){if(t!==void 0)return{clearCompatKeys:Qo(e,t)};let n=Qo(e,void 0);return n.length===0?{}:{clearCompatKeys:n}}function Zt(e,t){return e.declared?t===void 0?!1:e.image?t.includes("image"):!t.includes("image"):t===void 0}function rr(e,t,n){let r=e?t:!1;return e&&r===void 0&&n===void 0?"keep":r}function Zo(e){let t={},n=e?.thinkingTokenBudgetField??"";n!==""&&(t.thinkingTokenBudgetField=n);let o=(e?.vllmPriority===void 0?"":String(e.vllmPriority)).trim();o!==""&&/^-?\d+$/.test(o)&&(t.vllmPriority=Number.parseInt(o,10));let i=e?.supportsMaxOutputTokens===void 0?"":String(e.supportsMaxOutputTokens);return i==="true"?t.supportsMaxOutputTokens=!0:i==="false"&&(t.supportsMaxOutputTokens=!1),Object.keys(t).length===0?void 0:t}function or(e){let t=e.appliedCompat,n=e.manualCompat,r=t!==void 0?{...t,...n??{}}:n;return e.initialCompat?.supportsThinkingTokenBudget===!0&&e.initialCompat?.thinkingTokenBudgetField===void 0&&r?.thinkingTokenBudgetField===void 0&&(e.routeApi??"").toLowerCase()==="openai-completions"&&(r={...r??{},thinkingTokenBudgetField:"thinking_token_budget"}),{efforts:e.efforts,...r===void 0?{}:{compat:r},...e.input===void 0?{}:{input:e.input},...Za(e.routeApi,r),...e.defaultEffort===void 0?{}:{defaultEffort:e.defaultEffort}}}function en({route:e,routeApi:t,routeBaseURL:n,modelId:r,modelName:o,efforts:i,effortsUnset:s=!1,input:a,compat:d,defaultEffort:f,index:m,staged:p=!1,officialInputTypes:g=!1,api:l,readOnly:c,t:u}){let[b,k]=(0,F.useState)(()=>Ue(i)),[w,x]=(0,F.useState)(()=>je(a)),[T,y]=(0,F.useState)(()=>i!==!1),[E,R]=(0,F.useState)(()=>f??""),[K,j]=(0,F.useState)(!1),[I,B]=(0,F.useState)(void 0),[A,D]=(0,F.useState)(void 0),[W,C]=(0,F.useState)(""),[z,V]=(0,F.useState)("low"),U=(0,F.useRef)(void 0),[L,P]=(0,F.useState)(()=>d?.thinkingTokenBudgetField??""),[_,te]=(0,F.useState)(()=>d?.vllmPriority===void 0?"":String(d.vllmPriority)),[oe,Pe]=(0,F.useState)(()=>d?.supportsMaxOutputTokens===void 0?"":String(d.supportsMaxOutputTokens)),Ve=(0,F.useRef)(d),[Ce,S]=(0,F.useState)(void 0),[Q,Z]=(0,F.useState)(void 0),[de,Ee]=(0,F.useState)(void 0),Te=(0,F.useRef)(!1),Sn=(0,F.useRef)(i),at=(0,F.useRef)(a),At=(0,F.useRef)(f),Nr=(0,F.useRef)(void 0),_r=(0,F.useRef)(i);_r.current=i;let Ir=(0,F.useRef)(s);Ir.current=s,(0,F.useEffect)(()=>Jo(h=>{if(h!==e||_r.current!==void 0||Ir.current)return;let q=Nr.current;q!==void 0&&Vo(q)}),[e]),(0,F.useEffect)(()=>{gt(Sn.current,i)||(Sn.current=i,Te.current||(k(Ue(i)),y(i!==!1))),at.current!==a&&(at.current=a,Te.current||x(je(a))),At.current!==f&&(At.current=f,Te.current||R(f??"")),JSON.stringify(Ve.current??null)!==JSON.stringify(d??null)&&(Ve.current=d,Te.current||(P(d?.thinkingTokenBudgetField??""),te(d?.vllmPriority===void 0?"":String(d.vllmPriority)),Pe(d?.supportsMaxOutputTokens===void 0?"":String(d.supportsMaxOutputTokens))))},[i,a,d,f]);let Dr=()=>{let h={};L!==""&&(h.thinkingTokenBudgetField=L);let q=_.trim();return q!==""&&/^-?\d+$/.test(q)&&(h.vllmPriority=Number.parseInt(q,10)),oe==="true"?h.supportsMaxOutputTokens=!0:oe==="false"&&(h.supportsMaxOutputTokens=!1),Object.keys(h).length===0?void 0:h},qs=()=>{let h=Dr();return JSON.stringify(h??null)!==JSON.stringify({...d?.thinkingTokenBudgetField===void 0?{}:{thinkingTokenBudgetField:d.thinkingTokenBudgetField},...d?.vllmPriority===void 0?{}:{vllmPriority:d.vllmPriority},...d?.supportsMaxOutputTokens===void 0?{}:{supportsMaxOutputTokens:d.supportsMaxOutputTokens}})},Rt=We.filter(h=>b[h].on),Bs=E===(f??"")?void 0:E===""?null:E,Ws=T?et(b):!1,Ln=!gt(Ws,i)||!Zt(w,a)||qs()||Bs!==void 0,An=(0,F.useRef)(void 0),pe=()=>{Te.current=!0,D(void 0),C(""),V("low"),S(void 0)},me=(h,q,ee,ge=T)=>{let le=rr(ge,et(h),i),ea=Zt(q,a)?void 0:nr(q),Kr=or({efforts:le,input:ea,defaultEffort:ee===(f??"")?void 0:ee===""?null:ee,manualCompat:Dr(),appliedCompat:U.current,routeApi:t,initialCompat:d}),qr=JSON.stringify(Kr);An.current!==qr&&(An.current=qr,l.commit(e,r,Kr))},Us=(h,q)=>{pe();let ee=!q&&E===h?"":E;ee!==E&&R(ee),k(ge=>{let le={...ge,[h]:{...ge[h],on:q}};return q&&h!=="off"&&le[h].wire.trim().length===0&&(le[h]={...le[h],wire:h}),me(le,w,ee),le}),B(void 0)},js=h=>{pe(),y(h);let q=h?E:"";q!==E&&R(q),me(b,w,q,h),B(void 0)},zs=(h,q)=>{pe(),k(ee=>{let ge={...ee,[h]:{...ee[h],wire:q}};return me(ge,w,E),ge}),B(void 0)},Gs=h=>{pe();let q={declared:!0,image:h};x(q),me(b,q,E),B(void 0)},$s=()=>{pe();let h={declared:!1,image:!1};x(h),me(b,h,E),B(void 0)},Vs=h=>{pe(),P(h),me(b,w,E),B(void 0)},Ys=h=>{pe(),te(h),me(b,w,E),B(void 0)},Js=h=>{pe(),Pe(h),me(b,w,E),B(void 0)},Pr=h=>{pe(),R(h),me(b,w,h),B(void 0)},Xs=h=>{pe();let q=h.efforts!==!1;y(q);let ee=Ue(h.efforts);k(ee);let ge=h.input===void 0?w:je(h.input);h.input!==void 0&&x(ge);let le=E===""&&h.defaultEffort!==void 0?h.defaultEffort:E;le!==E&&R(le),D(h.efforts),C(h.source),V(h.confidence),U.current=h.compat,S(h.inputSource),Z(h.contextWindow),Ee(h.maxTokens),B({kind:"info",text:u("appliedHint",{source:h.source,confidence:u("confidence_"+h.confidence)})}),me(ee,ge,le,q)},Cr=async()=>{if(!(c||K)){j(!0),B(void 0);try{let h=p?await l.suggest(e,r,o,{...t===void 0?{}:{api:t},...n===void 0?{}:{baseURL:n}}):await l.suggest(e,r,o);if(!h.ok){B({kind:"error",text:h.error==="no-suggestion"?u("noSuggestion"):h.error});return}Xs(h.suggestion)}catch(h){B({kind:"error",text:u("writeError",{message:String(h)})})}finally{j(!1)}}};(0,F.useEffect)(()=>{Nr.current=Cr});let Qs=()=>{Te.current=!1,l.withdraw(e,r),k(Ue(i)),y(i!==!1),x(je(a)),R(f??""),P(d?.thinkingTokenBudgetField??""),te(d?.vllmPriority===void 0?"":String(d.vllmPriority)),Pe(d?.supportsMaxOutputTokens===void 0?"":String(d.supportsMaxOutputTokens)),D(void 0),C(""),V("low"),U.current=void 0,S(void 0),Z(void 0),Ee(void 0),B(void 0),An.current=void 0},Zs=U.current?.thinkingFormat??he(r,{...t===void 0?{}:{api:t},...n===void 0?{}:{baseURL:n}}).compat?.thinkingFormat,Fr=Go(i,Zs),ie=c||K;return(0,v.jsxs)("div",{className:"bre-effort-editor","data-plugin":J,children:[(0,v.jsxs)("label",{className:"bre-modality-row bre-thinking-switch",children:[(0,v.jsx)("input",{type:"checkbox",checked:T,disabled:ie,"aria-label":u("thinkingMode")+" "+String(m+1),onChange:h=>{js(h.target.checked)}}),(0,v.jsx)("span",{className:"bre-effort-level",children:u("thinkingMode")}),T?null:(0,v.jsx)("span",{className:"bre-effort-note",children:u("thinkingModeOff")})]}),T?(0,v.jsxs)("div",{className:"bre-effort-card",children:[(0,v.jsxs)("div",{className:"bre-effort-head",children:[(0,v.jsx)("span",{className:"bre-effort-title",children:u("reasoningEffort")}),(0,v.jsx)("button",{type:"button",className:"bre-link-button",disabled:ie,onClick:()=>{Cr()},children:u("autoAdapt")})]}),(0,v.jsx)("div",{className:"bre-effort-grid",children:We.map(h=>{let q=b[h];return(0,v.jsxs)("label",{className:"bre-effort-row",children:[(0,v.jsx)("input",{type:"checkbox",checked:q.on,disabled:ie,"aria-label":u("level_"+h)+" "+String(m+1),onChange:ee=>{Us(h,ee.target.checked)}}),(0,v.jsx)("span",{className:"bre-effort-level",children:u("level_"+h)}),q.on?(0,v.jsx)("input",{type:"text",className:"bre-effort-wire",value:q.wire,disabled:ie,placeholder:u("wirePlaceholder"),"aria-label":u("level_"+h)+" "+u("wireValue"),onChange:ee=>{zs(h,ee.target.value)}}):(0,v.jsx)("span",{className:"bre-effort-empty"})]},h)})}),Rt.length>0?(0,v.jsxs)("div",{className:"bre-modality",children:[(0,v.jsx)("span",{className:"bre-effort-title",children:u("defaultEffortLabel")}),(0,v.jsxs)("label",{className:"bre-modality-row",children:[(0,v.jsxs)("select",{className:"bre-select",disabled:ie,"aria-label":u("defaultEffortLabel")+" "+String(m+1),value:E,onChange:h=>{Pr(h.target.value)},children:[(0,v.jsx)("option",{value:"",children:u("defaultEffortUnset")}),(E!==""&&!Rt.includes(E)?[...Rt,E]:Rt).map(h=>(0,v.jsx)("option",{value:h,children:u("level_"+h)},h))]}),E!==""?(0,v.jsx)("button",{type:"button",className:"bre-link-button bre-modality-clear",disabled:ie,onClick:()=>{Pr("")},children:u("clearDefaultEffort")}):null]}),(0,v.jsx)("p",{className:"bre-modality-note",children:u("defaultEffortHint")})]}):null,g?null:(0,v.jsxs)("div",{className:"bre-modality",children:[(0,v.jsx)("span",{className:"bre-effort-title",children:u("inputModality")}),(0,v.jsxs)("label",{className:"bre-modality-row",children:[(0,v.jsx)("input",{type:"checkbox",checked:w.declared&&w.image,disabled:ie,"aria-label":u("modalityImage")+" "+String(m+1),onChange:h=>{Gs(h.target.checked)}}),(0,v.jsx)("span",{className:"bre-effort-level",children:u("modalityImage")}),w.declared?(0,v.jsx)("button",{type:"button",className:"bre-link-button bre-modality-clear",disabled:ie,onClick:$s,children:u("clearDeclaration")}):null]}),w.declared?null:(0,v.jsx)("p",{className:"bre-modality-note",children:u("modalityInherit")})]}),(t??"").toLowerCase()==="openai-completions"?(0,v.jsxs)("div",{className:"bre-compat",children:[(0,v.jsx)("span",{className:"bre-effort-title",children:u("compatTitle")}),(0,v.jsxs)("label",{className:"bre-compat-row",children:[(0,v.jsx)("span",{className:"bre-compat-label",children:u("budgetFieldLabel")}),(0,v.jsxs)("select",{className:"bre-select",disabled:ie,"aria-label":u("budgetFieldLabel")+" "+String(m+1),value:L,onChange:h=>{Vs(h.target.value)},children:[(0,v.jsx)("option",{value:"",children:u("budgetUnset")}),(0,v.jsx)("option",{value:"thinking_token_budget",children:"thinking_token_budget"}),(0,v.jsx)("option",{value:"thinking_budget",children:"thinking_budget"}),(0,v.jsx)("option",{value:"thinking_budget_tokens",children:"thinking_budget_tokens"})]}),(0,v.jsx)("span",{className:"bre-compat-hint",children:u("budgetFieldHint")})]}),(0,v.jsxs)("div",{className:"bre-compat-row",children:[(0,v.jsxs)("label",{className:"bre-compat-field",children:[(0,v.jsx)("span",{className:"bre-compat-label",children:u("priorityLabel")}),(0,v.jsx)("input",{type:"text",inputMode:"numeric",className:"bre-text-input",value:_,disabled:ie,placeholder:u("priorityPlaceholder"),"aria-label":u("priorityLabel")+" "+String(m+1),onChange:h=>{Ys(h.target.value)}})]}),(0,v.jsx)("span",{className:"bre-compat-hint",children:u("priorityHint")}),_.trim()!==""&&!/^-?\d+$/.test(_.trim())?(0,v.jsx)("p",{className:"bre-effort-note bre-error",children:u("priorityInvalid")}):null]}),d?.supportsThinkingTokenBudget===!0&&d?.thinkingTokenBudgetField===void 0?(0,v.jsx)("p",{className:"bre-effort-note",children:u("aliasMigrated")}):null]}):null,(t??"").toLowerCase()==="openai-responses"?(0,v.jsxs)("div",{className:"bre-compat",children:[(0,v.jsx)("span",{className:"bre-effort-title",children:u("compatTitle")}),(0,v.jsxs)("label",{className:"bre-compat-row",children:[(0,v.jsx)("span",{className:"bre-compat-label",children:u("maxOutputLabel")}),(0,v.jsxs)("select",{className:"bre-select",disabled:ie,"aria-label":u("maxOutputLabel")+" "+String(m+1),value:oe,onChange:h=>{Js(h.target.value)},children:[(0,v.jsx)("option",{value:"",children:u("maxOutputUnset")}),(0,v.jsx)("option",{value:"true",children:u("maxOutputOn")}),(0,v.jsx)("option",{value:"false",children:u("maxOutputOff")})]}),(0,v.jsx)("span",{className:"bre-compat-hint",children:u("maxOutputHint")})]})]}):null,p?(0,v.jsx)("p",{className:"bre-effort-note",children:u("stagedHint")}):null,i===!1?(0,v.jsx)("p",{className:"bre-effort-note",children:u("reasoningDisabled")}):null,Fr===void 0?null:(0,v.jsx)("p",{className:"bre-effort-note",children:u(Fr==="thinking-disabled"?"defaultRiskDisabled":"defaultRiskQwen")}),et(b)===void 0&&i!==void 0?(0,v.jsx)("p",{className:"bre-effort-note",children:u("bareHint")}):null,A!==void 0?(0,v.jsxs)("div",{className:"bre-suggestion",children:[(0,v.jsx)("p",{className:"bre-effort-note",children:u("appliedHint",{source:W,confidence:u("confidence_"+z)})}),Ce===void 0?null:(0,v.jsx)("p",{className:"bre-effort-note",children:u(Ce==="endpoint"?"inputHintEndpoint":Ce==="knowledge"?"inputHintKnowledge":"inputHintHeuristic")}),Q===void 0&&de===void 0?null:(0,v.jsxs)("div",{className:"bre-reference",children:[(0,v.jsx)("span",{className:"bre-reference-title",children:u("referenceTitle")}),(0,v.jsxs)("span",{className:"bre-reference-values",children:[Q===void 0?null:(0,v.jsxs)("span",{children:[u("contextWindowLabel")," ",(0,v.jsx)("b",{children:Xo.format(Q)})]}),de===void 0?null:(0,v.jsxs)("span",{children:[u("maxTokensLabel")," ",(0,v.jsx)("b",{children:Xo.format(de)})]})]})]})]}):null,I===void 0?null:(0,v.jsx)("p",{className:"bre-effort-message bre-"+I.kind,role:I.kind==="error"?"alert":"status",children:I.text}),Ln?(0,v.jsx)("p",{className:"bre-effort-message bre-info",role:"status",children:u("pendingSave")}):null,Ln?(0,v.jsx)("p",{className:"bre-effort-note",children:u("pendingHint")}):null,(0,v.jsx)("div",{className:"bre-effort-actions",children:(0,v.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:ie||!Ln,onClick:Qs,children:u("reset")})})]}):null]})}var Ae="data-bre-auto-effort",ir='[class*="modelCatalog"]',ed='[class*="modelListHead"]',td='button[class*="linkButton"]',nd="bre-auto-effort",rd="bre-auto-effort-note",od="data-bre-auto-effort-phase",ti="bre-auto-effort-note-text",ni="bre-auto-effort-note-detail",id=3e3;function sd(e){return e.blocked==="busy"?null:e.failed!==void 0?{phase:"failed",count:0,missed:0,detail:e.failed}:e.blocked!==void 0?{phase:"blocked",count:0,missed:0,detail:""}:e.held>0?{phase:"done",count:e.held,missed:e.unsuggested,detail:""}:e.unsuggested>0?{phase:"unsuggested",count:0,missed:e.unsuggested,detail:""}:{phase:"empty",count:0,missed:0,detail:""}}function sr(e){return Array.from(e.querySelectorAll(ir)).filter(t=>(t.parentElement?.closest(ir)??null)===null)}function tn(e,t,n){let r=new Map;for(let a of t)a.route.length!==0&&a.catalogue.isConnected&&r.set(a.catalogue,a.route);let o=n.t("autoAdaptAll");for(let[a,d]of r){let f=a.querySelector(ed)??a,m=f.querySelector(`[${Ae}]`)??dd(n),p=ad(f);p!==null?p.nextElementSibling!==m&&p.after(m):f.lastElementChild!==m&&f.append(m),cd(m,d,o)}let i=new Set,s=new Set(r.values());for(let a of Array.from(e.querySelectorAll(`[${Ae}]`))){let d=a.closest(ir),f=a.getAttribute(Ae)??"";if(d===null||!r.has(d)||i.has(d)){a.remove(),f.length>0&&!s.has(f)&&ar(f);continue}i.add(d)}}function ar(e){let t=ze.get(e);t!==void 0&&(t.timer!==null&&clearTimeout(t.timer),t.note.remove(),ze.delete(e))}function ri(){for(let e of Array.from(document.querySelectorAll(`[${Ae}]`)))e.remove();for(let e of ze.values())e.timer!==null&&clearTimeout(e.timer),e.note.remove();ze.clear()}function ad(e){let t=Array.from(e.querySelectorAll(td));return t.length===0?null:t[t.length-1]}function dd(e){let t=document.createElement("button");return t.className=nd,t.setAttribute("type","button"),t.setAttribute(Ae,""),t.addEventListener("click",()=>{let n=t.getAttribute(Ae)??"";n.length!==0&&(Yo(n),ld(n,e))}),t}async function ld(e,t){if(t.onRequest===void 0)return;ei(e,{phase:"working",count:0,missed:0,detail:""},t,0);let n;try{n=await t.onRequest(e)}catch(o){n={held:0,unsuggested:0,failed:String(o)}}if(n===void 0){ar(e);return}let r=sd(n);r!==null&&ei(e,r,t,id)}function ei(e,t,n,r){let o=ze.get(e);o!==void 0&&!o.note.isConnected&&(o.timer!==null&&clearTimeout(o.timer),ze.delete(e),o=void 0),o!==void 0&&o.timer!==null&&clearTimeout(o.timer);let i=o?.note??ud();i.setAttribute(od,t.phase);let s=i.querySelector(`.${ti}`),a=i.querySelector(`.${ni}`),d=fd(t,n);s.textContent!==d.text&&(s.textContent=d.text),a.textContent!==d.detail&&(a.textContent=d.detail),a.hidden=d.detail.length===0,o===void 0&&document.body.append(i);let f=r>0?setTimeout(()=>{ar(e)},r):null;i.style.setProperty("--bre-note-hold",`${r}ms`),ze.set(e,{note:i,timer:f})}function ud(){let e=document.createElement("div");return e.className=rd,e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.innerHTML=`<span class="${ti}"></span><span class="${ni}"></span>`,e}var ze=new Map;function fd(e,t){switch(e.phase){case"working":return{text:t.t("autoAdaptWorking"),detail:""};case"done":return{text:t.t("autoAdaptDone",{count:e.count}),detail:e.missed>0?`${t.t("autoAdaptDoneHint",{count:e.count})} ${t.t("autoAdaptUnsuggestedHint")}`:t.t("autoAdaptDoneHint",{count:e.count})};case"empty":return{text:t.t("autoAdaptEmpty"),detail:t.t("autoAdaptEmptyHint")};case"unsuggested":return{text:t.t("autoAdaptUnsuggested"),detail:t.t("autoAdaptUnsuggestedHint")};case"blocked":return{text:t.t("autoAdaptBlocked"),detail:t.t("autoAdaptBlockedHint")};case"failed":return{text:t.t("autoAdaptFailed",{message:e.detail}),detail:e.detail}}}function cd(e,t,n){e.getAttribute(Ae)!==t&&e.setAttribute(Ae,t),e.textContent!==n&&(e.textContent=n),e.getAttribute("title")!==null&&e.removeAttribute("title")}function tt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var dr="__breLedgerDocument";function ai(){let e=globalThis;return e[dr]??(e[dr]=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`)}var nn="bre:held-writes:v1";function lr(){try{return typeof sessionStorage>"u"?void 0:sessionStorage}catch{return}}function xe(e){let t=lr();if(t!==void 0)try{if(e.pending.size===0&&e.queued.size===0){t.removeItem(nn);return}let n={document:ai(),committed:[...e.committing].filter(r=>e.queued.has(r)),pending:[...e.pending].map(([r,o])=>[r,[...o]]),queued:[...e.queued].map(([r,o])=>[r,[...o]])};t.setItem(nn,JSON.stringify(n))}catch{}}function oi(e,t){if(!Array.isArray(e))return;let n=[];for(let r of e){if(!Array.isArray(r)||r.length!==2)return;let[o,i]=r;if(typeof o!="string"||!Array.isArray(i))return;let s=[];for(let a of i){if(!Array.isArray(a)||a.length!==2)return;let[d,f]=a;if(typeof d!="string"||!H(f)||t!==void 0&&!t(f))return;s.push([d,f])}n.push([o,s])}return n}function pd(e){let t=lr();if(t!==void 0)try{let n=t.getItem(nn);if(n===null)return;let r=JSON.parse(n);if(r.document!==ai())return;let o=oi(r.pending),i=oi(r.queued,Ed);if(o===void 0||i===void 0)return;let s=Array.isArray(r.committed)?r.committed.filter(a=>typeof a=="string"):[];for(let[a,d]of o)e.pending.set(a,new Map(d));for(let[a,d]of i)s.includes(a)&&(e.queued.set(a,new Map(d)),e.committing.add(a))}catch{}}function di(e,t){(async()=>{try{await ur(t,e),await fr(t,e)}catch(n){console.error(`[bre] teardown flush failed: ${n instanceof Error?n.message:String(n)}`)}})()}function li(e,t){(async()=>{try{await ur(t,e,!0),await fr(t,e,!0)}catch(n){console.error(`[bre] unload flush failed: ${n instanceof Error?n.message:String(n)}`)}finally{try{lr()?.removeItem(nn)}catch{}}})()}function ui(){let e={mounted:new Map,describePromise:void 0,pending:new Map,missedScans:new Map,queued:new Map,editing:void 0,flushing:!1,flushFailures:0,nextFlushAt:0,committing:new Set,adapting:new Set,signalsUnavailable:!1,submitWired:new WeakSet,cancelWired:new WeakSet};return pd(e),e}async function md(e,t){if(!t.flushing){t.flushing=!0;try{let n=await ur(e,t),r=await fr(e,t);n||r?ii(e,t):(t.flushFailures=0,t.nextFlushAt=0)}catch(n){ii(e,t),console.error(`[bre] idle flush failed: ${n instanceof Error?n.message:String(n)}`)}finally{t.flushing=!1}try{e.onIdle?.()}catch(n){console.error(`[bre] idle hook failed: ${n instanceof Error?n.message:String(n)}`)}}}function ii(e,t){t.flushFailures+=1;let n=Math.min(2**t.flushFailures*500,3e4);t.nextFlushAt=Date.now()+n,e.onBackoff?.(n)}function gd(e){return e.queued.size>0||e.pending.size>0}function rn(e,t,n,r,o,i,s){try{let a=e.pending.get(t);if(r===void 0){if(a===void 0)return;a.delete(n),a.size===0&&e.pending.delete(t);return}e.pending.set(t,(a??new Map).set(n,{efforts:r,...o===void 0?{}:{compat:o},...i===void 0?{}:{input:i},...s===void 0?{}:{defaultEffort:s}}))}finally{xe(e)}}function fi(e,t,n,r){e.queued.set(t,(e.queued.get(t)??new Map).set(n,r)),xe(e)}function hd(e,t,n){let r=e.pending.get(t);r!==void 0&&(r.delete(n),r.size===0&&e.pending.delete(t),xe(e))}function bd(e,t,n){let r=e.queued.get(t);r!==void 0&&(r.delete(n),r.size===0&&e.queued.delete(t),xe(e))}function yd(e,t,n){hd(e,t,n),bd(e,t,n)}function wd(e,t){e.queued.delete(t),e.pending.delete(t),e.missedScans.delete(t),e.committing.delete(t),xe(e)}function xd(e,t,n){if(t===void 0)return null;let i=t[se]!==!0&&t.reasoningEfforts!==void 0&&typeof t[Ye]=="number"||t[se]!==!0&&n?.efforts!==void 0&&vd(t.reasoningEfforts,n.efforts)?!1:t.reasoningEfforts!==void 0||t[se]===!0||e.efforts==="keep",a=t[Me]!==!0&&n?.input!==void 0&&kd(t.input,n.input)?!1:Array.isArray(t.input)&&t.input.length>0||t[Me]===!0,d=i?"keep":e.efforts,f=a?void 0:e.input,m=e.defaultEffort;return d==="keep"&&f===void 0&&m===void 0?null:{efforts:d,...e.compat===void 0?{}:{compat:e.compat},...f===void 0?{}:{input:f},...m===void 0?{}:{defaultEffort:m}}}function vd(e,t){if(e===t)return!0;if(!H(e)||!H(t))return!1;let n=Object.keys(t);if(Object.keys(e).length!==n.length)return!1;let r=t;return n.every(o=>e[o]===r[o])}function kd(e,t){if(!Array.isArray(e)||e.length!==t.length)return!1;let n=new Set(t);return e.every(r=>typeof r=="string"&&n.has(r))}function Ed(e){if(!H(e))return!1;let t=e.efforts;if(t!==!1&&t!=="keep"&&!H(t))return!1;let n=e.clearCompatKeys;return n===void 0||Array.isArray(n)&&n.every(r=>typeof r=="string")}async function Td(e,t,n,r,o=!1){let i=await e.describeNamespace(),s=we(i.namespace),a=[];for(let[p,g]of[...r]){let l=zt(s,n).find(w=>w.id===p);if(l===void 0||t.pending.get(n)?.get(p)!==g)continue;let c=Be(s,n),u=typeof l.name=="string"?l.name:void 0,b=he(p,u===void 0?c:{...c,displayName:u}),k=xd(g,l,{...b.efforts===void 0?{}:{efforts:b.efforts},...b.input===void 0?{}:{input:b.input}});if(k===null){rn(t,n,p,void 0);continue}a.push({modelId:p,efforts:k.efforts,...k.compat===void 0?{}:{compat:k.compat},...k.input===void 0?{}:{input:k.input},...k.defaultEffort===void 0?{}:{defaultEffort:k.defaultEffort}})}if(a.length===0)return!1;let d=!1,f=await mt(e.api,n,a,()=>d?e.describeNamespace():(d=!0,Promise.resolve(i)),o?void 0:pi),m=!1;return a.forEach((p,g)=>{let l=f[g];if(l?.aborted!==!0){if(l?.ok===!0||l?.modelNotFound===!0){rn(t,n,p.modelId,void 0);return}m=!0,console.error(`[bre] staged flush write failed for "${n}"/"${p.modelId}": ${l?.error??"unknown"}`)}}),m}async function ur(e,t,n=!1){for(let s of[...t.committing])t.queued.has(s)||t.committing.delete(s);if(![...t.queued.keys()].some(s=>t.committing.has(s)||t.signalsUnavailable)||(await e.describeNamespace()).writable!==!0)return xe(t),!1;let i=!1;for(let[s,a]of[...t.queued]){if(!t.committing.has(s)&&!t.signalsUnavailable)continue;let f=[...a].map(([g,l])=>({modelId:g,efforts:l.efforts,...l.compat===void 0?{}:{compat:l.compat},...l.input===void 0?{}:{input:l.input},...l.clearCompatKeys===void 0?{}:{clearCompatKeys:l.clearCompatKeys},...l.defaultEffort===void 0?{}:{defaultEffort:l.defaultEffort}})),m=await mt(e.api,s,f,void 0,n?void 0:pi),p=!1;f.forEach((g,l)=>{let c=m[l];if(c?.aborted===!0){p=!0;return}if(c?.ok===!0||c?.modelNotFound===!0){a.delete(g.modelId);return}console.error(`[bre] held write failed for "${s}"/"${g.modelId}": ${c?.error??"unknown"}`)}),a.size===0?(t.queued.delete(s),t.committing.delete(s)):p||(i=!0)}return xe(t),i}async function fr(e,t,n=!1){if(t.pending.size===0)return!1;let r=await e.describeNamespace();if(r.writable!==!0)return!1;let o=we(r.namespace),i=!1;for(let[s,a]of[...t.pending]){if(a.size===0){t.pending.delete(s);continue}tt(o,s)&&await Td(e,t,s,a,n)&&(i=!0)}return xe(t),i}function Oe(e,t){for(let n of t){let r=Array.from(e.querySelectorAll("input[aria-label], select[aria-label]")).find(o=>(o.getAttribute("aria-label")??"").startsWith(n));if(r!==void 0&&r.value.trim().length>0)return r.value.trim()}return""}function cr(e){return e.closest('[class*="editor"], [class*="rowCard"], [class*="addCard"]')??void 0}function Md(e){let t=e.closest('[class*="modelEntry"]');if(t===null){let r=cr(e);if(r===void 0)return;let o=Array.from(r.querySelectorAll('[class*="modelAdvanced"]'));return o.find(i=>i.offsetParent!==null)??o[0]}let n=Array.from(t.querySelectorAll('[class*="modelAdvanced"]'));return n.find(r=>r.offsetParent!==null)??n[0]}function Sd(e){return e.querySelector('[class*="modelInputTypes"]')!==null}function Ld(e,t,n,r,o){!e.isConnected||pr(e)===void 0||Array.from(e.querySelectorAll("button[aria-label]")).some(s=>o.capacity.some(a=>(s.getAttribute("aria-label")??"").startsWith(a)))||tn(e,Ad(e,we(r.namespace),o),{t:t.t,onRequest:s=>ci(n,t,s)})}function Ad(e,t,n){let r=[];for(let o of sr(e)){let i=cr(o);if(i===void 0)continue;let s=Re(i,t,n);s===void 0||s.staged||r.push({catalogue:o,route:s.route})}return r}function Rd(e,t,n){let r=[],o=new Set;for(let i of e){if(o.has(i.card))continue;o.add(i.card);let s=Re(i.card,t,n);if(s===void 0)continue;let[a]=sr(i.card);a!==void 0&&r.push({catalogue:a,route:s.route})}return r}async function ci(e,t,n){if(n.length===0)return{held:0,unsuggested:0,blocked:"unknown-route"};if(e.adapting.has(n))return{held:0,unsuggested:0,blocked:"busy"};e.adapting.add(n);let r=0,o=0;try{let i,s=()=>i??(i=t.describeNamespace()),a=await s(),d=we(a.namespace);if(a.writable!==!0)return{held:0,unsuggested:0,blocked:"unwritable"};if(!tt(d,n))return{held:0,unsuggested:0,blocked:"unknown-route"};let f=zt(d,n);if(f.length===0)return{held:0,unsuggested:0,blocked:"no-models"};let m=d[n]??{},p=typeof m.api=="string"?m.api:void 0,g=new Set;for(let c of e.mounted.values())c.props.route===n&&c.props.efforts!==void 0&&g.add(c.props.modelId);let l=Qt(t.api,s,void 0,(c,u,b)=>{fi(e,c,u,b)});for(let c of f){let u=typeof c.id=="string"?c.id:"";if(u.length===0||g.has(u))continue;let b=$t(f,u);if(b!==void 0||c[se]===!0)continue;let k=Vt(f,u),w=Yt(f,u),x=Xt(f,u)??"",T=await l.suggest(n,u,Jt(f,u));if(!T.ok){o+=1;continue}let y=T.suggestion,E=y.efforts!==!1,R=y.input===void 0?je(k):je(y.input),K=y.defaultEffort??x,j=K===x?void 0:K===""?null:K;l.commit(n,u,or({efforts:rr(E,et(Ue(y.efforts)),b),input:Zt(R,k)?void 0:nr(R),defaultEffort:j,manualCompat:Zo(w),appliedCompat:y.compat,routeApi:p,initialCompat:w})),r+=1}return{held:r,unsuggested:o}}catch(i){return console.warn("[bre] provider-wide adapt failed:",i),{held:r,unsuggested:o,failed:i instanceof Error?i.message:String(i)}}finally{e.adapting.delete(n)}}function Od(e){return e.querySelector(`[data-plugin="${J}"]`)!==null}function Hd(e,t){return e.route===t.route&&e.routeDisplayName===t.routeDisplayName&&e.routeApi===t.routeApi&&e.routeBaseURL===t.routeBaseURL&&e.modelId===t.modelId&&e.modelName===t.modelName&&e.index===t.index&&e.readOnly===t.readOnly&&e.defaultEffort===t.defaultEffort&&e.staged===t.staged&&e.officialInputTypes===t.officialInputTypes&&e.effortsUnset===t.effortsUnset&&gt(e.efforts,t.efforts)&&_d(e.input,t.input)&&Nd(e.compat,t.compat)}function Nd(e,t){return e===t?!0:e===void 0||t===void 0?!1:JSON.stringify({...e},Object.keys({...e,...t}).sort())===JSON.stringify({...t},Object.keys({...e,...t}).sort())}function _d(e,t){if(e===t)return!0;if(e===void 0||t===void 0)return!1;let n=new Set(e);return e.length===t.length&&t.every(r=>n.has(r))}function Id(e,t){return Array.from(e.querySelectorAll("input[aria-label], select[aria-label]")).some(n=>t.some(r=>(n.getAttribute("aria-label")??"").startsWith(r)))}function Re(e,t,n){let r=e.querySelector('[class*="editorRoute"]')?.textContent?.trim();if(r!==void 0&&r.length>0&&tt(t,r))return{route:r,staged:!1};if(Id(e,n.routeId)){let s=Oe(e,n.routeId);return s.length>0&&!tt(t,s)?{route:s,staged:!0}:void 0}let o=e.querySelector('[class*="editorTitle"], [class*="rowName"]')?.textContent?.trim();if(o===void 0||o.length===0)return;let i=Object.entries(t).find(([,s])=>s.displayName===o);if(i!==void 0)return{route:i[0],staged:!1};if(tt(t,o))return{route:o,staged:!1}}function Dd(e,t){let n=e.querySelector('[class*="editorActions"]');if(n===null)return;let r=Array.from(n.querySelectorAll("button"));if(r.length<2)return;let o=(p,g)=>(p.textContent??"").trim()===g,i=n.querySelector('[class*="primaryButton"]'),s=n.querySelector('[class*="secondaryButton"]');if(i!==null&&s!==null)return{submit:i,cancel:s};let a=[...r].reverse().find(p=>t.apply.some(g=>o(p,g))),d=[...r].reverse().find(p=>t.cancel.some(g=>o(p,g)));if(a!==void 0&&d!==void 0)return{submit:a,cancel:d};let f=r[r.length-1],m=r[r.length-2];if(!(f===void 0||m===void 0))return{submit:f,cancel:m}}function si(e,t,n){t.has(e)||(t.add(e),e.addEventListener("click",n,{capture:!0}))}function pr(e){return e.querySelector('[class*="editorActions"]')??e.querySelector('[class*="modelEntry"]')??void 0}function pi(){return pr(be())!==void 0}function mi(e,t,n){if(!e.isConnected)return;let r=t.labels(),o=pr(e)!==void 0,i=Array.from(e.querySelectorAll("button[aria-label]")).some(a=>r.capacity.some(d=>(a.getAttribute("aria-label")??"").startsWith(d)));if(!o){if(tn(e,[],{t:t.t}),n.mounted.size>0){for(let[,d]of n.mounted)d.editor.unmount();n.mounted.clear()}let a=n.editing;n.editing=!1,(a!==!1||gd(n)&&Date.now()>=n.nextFlushAt)&&md(t,n).catch(d=>{console.error(`[bre] idle pass failed: ${d instanceof Error?d.message:String(d)}`)});return}if(n.editing=!0,!i){for(let[,d]of n.mounted)d.editor.unmount();n.mounted.clear(),n.describePromise??(n.describePromise=t.describeNamespace());let a=r;n.describePromise.then(d=>{Ld(e,t,n,d,a)}).catch(d=>{console.error(`[bre] empty-catalog seat failed: ${d instanceof Error?d.message:String(d)}`)});return}n.describePromise??(n.describePromise=t.describeNamespace());let s=a=>{if(!e.isConnected)return;let d=a.namespace,f=we(d),m=[];for(let g of r.capacity){let l=Array.from(e.querySelectorAll("button[aria-label]")).filter(c=>(c.getAttribute("aria-label")??"").startsWith(g));for(let c of l){let u=cr(c);if(u===void 0)continue;let b=c.closest('[class*="modelEntry"]')??u,k=Oe(b,r.modelId);k.length!==0&&m.push({container:Md(c),row:b,modelId:k,card:u})}}tn(e,Rd(m,f,r),{t:t.t,onRequest:g=>ci(n,t,g)});for(let[g,l]of n.mounted)m.some(c=>c.container===g)||(l.editor.unmount(),n.mounted.delete(g));if(n.pending.size>0){let g=new Map;for(let c of m){let u=Re(c.card,f,r);if(u===void 0)continue;let b=g.get(u.route);b===void 0&&g.set(u.route,b=new Set),b.add(c.modelId)}let l=new Map;for(let[c,u]of n.pending){if(!tt(f,c))continue;let b=g.get(c),k=[...u.keys()].filter(w=>!b?.has(w));k.length>0&&l.set(c,new Set(k))}for(let[c,u]of l){let b=n.missedScans.get(c);if(b!==void 0)for(let k of u)b.has(k)&&(rn(n,c,k,void 0),b.delete(k))}n.missedScans=l}let p=new Set(m.map(g=>g.card));for(let g of p){let l=Re(g,f,r);if(l===void 0)continue;let c=l.route,u=Dd(g,r);u===void 0?n.signalsUnavailable=!0:(n.signalsUnavailable=!1,si(u.submit,n.submitWired,()=>{let b=Re(g,f,r)?.route??c;n.committing.add(b),xe(n)}),si(u.cancel,n.cancelWired,()=>{let b=Re(g,f,r)?.route??c;wd(n,b)}))}m.forEach((g,l)=>{let c=g.container;if(c===void 0)return;let u=Re(g.card,f,r);if(u===void 0)return;let{route:b,staged:k}=u,w=f[b]??{},x=zt(f,b),T=new Set(x.map(_=>_.id)),y=k||!T.has(g.modelId),E=y?n.pending.get(b)?.get(g.modelId)?.efforts:void 0,R=y?E==="keep"?void 0:E:$t(x,g.modelId),K=!y&&x.some(_=>_.id===g.modelId&&_[se]===!0),j=y?n.pending.get(b)?.get(g.modelId)?.input:Vt(x,g.modelId),I=y?n.pending.get(b)?.get(g.modelId)?.compat:Yt(x,g.modelId),B=y?n.pending.get(b)?.get(g.modelId)?.defaultEffort??void 0:Xt(x,g.modelId),A=y?Oe(g.row,r.modelName):"",D=y?A.length>0?A:void 0:Jt(x,g.modelId),W=k?Oe(g.card,r.apiProtocol):"",C=k?Oe(g.card,r.baseUrl):"",z=k&&W.length>0?W:typeof w.api=="string"?w.api:void 0,V=k&&C.length>0?C:typeof w.baseURL=="string"?w.baseURL:void 0,U={route:b,routeDisplayName:k?b:typeof w.displayName=="string"?w.displayName:b,...z===void 0?{}:{routeApi:z},...V===void 0?{}:{routeBaseURL:V},modelId:g.modelId,...D===void 0?{}:{modelName:D},...R===void 0?{}:{efforts:R},...K?{effortsUnset:K}:{},...j===void 0?{}:{input:j},...I===void 0?{}:{compat:I},...B===void 0?{}:{defaultEffort:B},index:l,staged:y,officialInputTypes:Sd(c),api:Qt(t.api,void 0,(_,te,oe,Pe,Ve,Ce)=>{rn(n,_,te,oe,Pe,Ve,Ce)},(_,te,oe)=>{fi(n,_,te,oe)},_=>{yd(n,_,g.modelId)},()=>(Re(g.card,f,r)?.staged??k)||!T.has(g.modelId)),readOnly:a.writable!==!0,t:t.t},L=n.mounted.get(c);if(L!==void 0){Hd(L.props,U)||(L.props=U,L.editor.render(U));return}if(Od(c))return;let P=t.mount(c,U);n.mounted.set(c,{editor:P,props:U})})};n.describePromise.then(s,()=>{n.describePromise=void 0})}function $(e,t,n){e.getAttribute(t)!==n&&e.setAttribute(t,n)}function ht(e,t){e!==void 0&&e.hidden!==t&&(e.hidden=t)}function He(e,t,n){e.classList.contains(t)!==n&&(n?e.classList.add(t):e.classList.remove(t))}function on(e,t){e!==void 0&&e.textContent!==t&&(e.textContent=t)}var mr=require("react");var X=require("react");function gi(e){if(typeof e!="string")return;let t="";for(let n of e){let r=n.codePointAt(0)??0;r<32||r===127||(t+=n)}if(t=t.trim(),t.length!==0)return t.slice(0,40)}function sn(e){return typeof e=="string"&&/^[\x21-\x7E]+$/.test(e)}function Pd(e){for(let t of["error","message"]){let n=e[t];if(typeof n=="string"&&n.length>0)return n}}function Cd(e){if(!H(e))return;let t=e.ref;if(typeof t!="string"||t.length===0)return;let n=e.alias,r=e.configured,o=e.masked;return{ref:t,...typeof n=="string"&&n.length>0?{alias:n}:{},enabled:e.enabled===!0,configured:typeof r=="boolean"?r:null,...typeof o=="string"&&o.length>0?{masked:o}:{}}}function Fd(e){let t=e.entries;if(!Array.isArray(t))return;let n=[];for(let i of t){let s=Cd(i);s!==void 0&&n.push(s)}let r=e.enabledRef,o=e.route;return{ok:!0,route:typeof o=="string"?o:"",enabledRef:typeof r=="string"&&r.length>0?r:null,entries:n}}async function Kd(e){let t;try{t=await e.json()}catch{t=void 0}if(!H(t))return{ok:!1};if(t.ok===!0){let r=Fd(t);if(r!==void 0)return r}let n=Pd(t);return n===void 0?{ok:!1}:{ok:!1,error:n}}async function nt(e,t){let n=`${Ur}?route=${encodeURIComponent(e)}`;try{let r=await fetch(n,t===void 0?{method:"GET",cache:"no-store",credentials:"same-origin"}:{method:"POST",cache:"no-store",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify(t)});return await Kd(r)}catch{return{ok:!1}}}var hi={list:e=>nt(e),add:(e,t,n)=>nt(e,{op:"add",value:t,...n===void 0?{}:{alias:n}}),enable:(e,t)=>nt(e,{op:"enable",ref:t}),rename:(e,t,n)=>nt(e,{op:"rename",ref:t,...n===void 0?{}:{alias:n}}),remove:(e,t)=>nt(e,{op:"remove",ref:t}),replace:(e,t,n)=>nt(e,{op:"value",ref:t,value:n}),async reveal(e,t){try{let n=await fetch(`${Ht}?route=${encodeURIComponent(e)}&ref=${encodeURIComponent(t)}`,{method:"GET",cache:"no-store",credentials:"same-origin"});if(!n.ok)return;let r=await n.json();if(!H(r)||r.ok!==!0)return;let o=r.key;return typeof o=="string"&&o.length>0?o:void 0}catch{return}}};var O=require("react/jsx-runtime"),qd="M3.9 8.35 6.6 11.05 12.1 5.5",Bd=["M8 3.9v8.2","M3.9 8h8.2"];function bi({paths:e}){return(0,O.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:e.map(t=>(0,O.jsx)("path",{d:t},t))})}function Wd(e,t){return e.masked!==void 0?e.masked:e.configured===!1?t("keysMissing"):"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"}function Ud(e){return e.alias??e.masked??e.ref}function yi(e){let{route:t,t:n}=e,r=e.client??hi,o=(0,X.useId)(),[i,s]=(0,X.useState)(void 0),[a,d]=(0,X.useState)(null),[f,m]=(0,X.useState)(void 0),[p,g]=(0,X.useState)(!1),[l,c]=(0,X.useState)(void 0),[u,b]=(0,X.useState)(""),[k,w]=(0,X.useState)(""),[x,T]=(0,X.useState)(void 0),y=(0,X.useCallback)((A,D)=>{if(!A.ok){m({kind:"error",text:A.error??n("keysUnreachable")});return}s(A.entries),d(A.enabledRef),m(D===void 0?void 0:{kind:"status",text:D})},[n]);(0,X.useEffect)(()=>{let A=!0;return(async()=>{let D=await r.list(t);A&&y(D,void 0)})(),()=>{A=!1}},[y,r,t]);let E=(0,X.useCallback)(async(A,D)=>{g(!0),T(void 0),c(void 0);try{y(await A(),D)}finally{g(!1)}},[y]),R=()=>{c(void 0),b(""),w("")},K=(A,D)=>{c({kind:A,ref:D.ref}),b(A==="alias"?D.alias??"":""),w(""),T(void 0)},j=()=>{if(p||l===void 0)return;let A=l.kind,D=l.ref;if(A!=="alias"&&!sn(k))return;let W=gi(u);g(!0),(async()=>{try{if(A==="add"){let z=await r.add(t,k,W);y(z,n("keysAdded")),z.ok&&R();return}if(D===void 0)return;let C=A==="alias"?await r.rename(t,D,W):await r.replace(t,D,k);y(C,n(A==="alias"?"keysRenamed":"keysReplaced")),C.ok&&R()}finally{g(!1)}})()},I=()=>{if(l===void 0)return null;let A=l.kind,D=A!=="alias",W=D&&k.length>0&&!sn(k);return(0,O.jsxs)("div",{className:"bre-keys-form",children:[(0,O.jsxs)("div",{className:"bre-keys-form-fields",children:[A==="value"?null:(0,O.jsx)("input",{className:"bre-text-input bre-keys-name",type:"text",value:u,placeholder:n("keysAliasPlaceholder"),"aria-label":n("keysAlias"),disabled:p,autoFocus:A==="alias",onChange:C=>b(C.target.value)}),D?(0,O.jsx)("input",{className:"bre-text-input bre-keys-secret",type:"password",autoComplete:"new-password",spellCheck:!1,value:k,placeholder:n(A==="add"?"keysValuePlaceholder":"keysNewValuePlaceholder"),"aria-label":n("keysValue"),"aria-invalid":W,disabled:p,autoFocus:!0,onChange:C=>w(C.target.value)}):null]}),W?(0,O.jsx)("p",{className:"bre-effort-message bre-error",role:"alert",children:n("keysAddIllegal")}):null,(0,O.jsxs)("div",{className:"bre-keys-form-actions",children:[(0,O.jsx)("button",{type:"button",className:"bre-link-button",disabled:p,onClick:R,children:n("keysCancel")}),(0,O.jsx)("button",{type:"button",className:"bre-primary-button",disabled:p||D&&!sn(k),onClick:j,children:n(A==="add"?"keysAddConfirm":"keysSave")})]})]})},B=()=>l?.kind==="add"?(0,O.jsx)("li",{className:"bre-keys-form-row",children:I()}):(0,O.jsx)("li",{className:"bre-keys-add-row",children:(0,O.jsxs)("button",{type:"button",className:"bre-keys-add",disabled:p,onClick:()=>{c({kind:"add"}),b(""),w(""),T(void 0)},children:[(0,O.jsx)("span",{className:"bre-keys-add-mark","aria-hidden":"true",children:(0,O.jsx)(bi,{paths:Bd})}),n("keysAdd")]})});return i===void 0?f===void 0?(0,O.jsx)("div",{className:"bre-keys"}):(0,O.jsxs)("div",{className:"bre-keys",children:[(0,O.jsx)("p",{className:"bre-effort-message bre-"+f.kind,role:f.kind==="error"?"alert":"status",children:f.text}),(0,O.jsx)("ul",{className:"bre-keys-list",children:B()})]}):(0,O.jsxs)("div",{className:"bre-keys",children:[(0,O.jsxs)("ul",{className:"bre-keys-list",children:[i.map(A=>{let D=Ud(A);return(0,O.jsxs)(X.Fragment,{children:[(0,O.jsxs)("li",{className:"bre-keys-row","data-state":A.configured===!1?"missing":"ready",children:[A.alias===void 0?null:(0,O.jsx)("span",{className:"bre-keys-alias",children:A.alias}),(0,O.jsx)("span",{className:A.alias===void 0?"bre-keys-mask bre-keys-mask-plain":"bre-keys-mask",children:Wd(A,n)}),(0,O.jsx)("span",{className:"bre-keys-actions",children:x===A.ref?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("button",{type:"button",className:"bre-link-button bre-keys-danger",disabled:p,onClick:()=>{E(()=>r.remove(t,A.ref),n("keysRemoved"))},children:n("keysConfirmRemove")}),(0,O.jsx)("button",{type:"button",className:"bre-link-button",disabled:p,onClick:()=>T(void 0),children:n("keysCancel")})]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("button",{type:"button",className:"bre-link-button",disabled:p,onClick:()=>{T(A.ref),c(void 0)},children:n("keysRemove")}),(0,O.jsx)("button",{type:"button",className:"bre-link-button",disabled:p,onClick:()=>K("alias",A),children:n("keysAlias")}),(0,O.jsx)("button",{type:"button",className:"bre-link-button",disabled:p,onClick:()=>K("value",A),children:n("keysEdit")})]})}),(0,O.jsxs)("label",{className:"bre-keys-enable",title:n("keysEnable",{name:D}),children:[(0,O.jsx)("input",{type:"radio",name:o,className:"bre-keys-enabled",checked:A.enabled,disabled:p,"aria-label":n("keysEnable",{name:D}),onChange:()=>{E(()=>r.enable(t,A.ref),n("keysEnabledNote",{name:D}))}}),(0,O.jsx)("span",{className:"bre-keys-mark","aria-hidden":"true",children:A.enabled?(0,O.jsx)(bi,{paths:[qd]}):null}),(0,O.jsx)("span",{className:"bre-keys-enable-text",children:n("keysEnabled")})]})]}),l!==void 0&&l.ref===A.ref?(0,O.jsx)("li",{className:"bre-keys-form-row",children:I()}):null]},A.ref)}),B()]}),f===void 0?null:(0,O.jsx)("p",{className:"bre-effort-message bre-"+f.kind,role:f.kind==="error"?"alert":"status",children:f.text})]})}var dn="bre-key-managed",jd="bre-keys-host",gr="data-bre-key-host",zd="data-bre-key-input",an="data-bre-region",Ne=new WeakMap;function Gd(e){let t=e.querySelector(`input[${zd}]`);if(t instanceof HTMLInputElement)return t;let n=e.querySelector('input[type="password"]');return n instanceof HTMLInputElement?n:void 0}function wi(e){let t=Ne.get(e)?.host;if(t!==void 0&&t.isConnected)return t;let n=e.nextElementSibling;return n instanceof HTMLElement&&n.hasAttribute(gr)?n:void 0}function xi(e,t){let n=t.route;if(n===void 0||n.length===0||Gd(e)===void 0||e.parentElement===null)return;He(e,dn,!0);let r=Ne.get(e),o=wi(e);o===void 0&&(r!==void 0&&vi(e,r),o=e.ownerDocument.createElement("div"),o.className=jd,e.after(o)),$(o,gr,n);let i=e.getAttribute(an);i===null?o.hasAttribute(an)&&o.removeAttribute(an):$(o,an,i);let s=()=>(0,mr.createElement)(ve,{fallbackText:t.t("keysPanelFailed")},(0,mr.createElement)(yi,{route:n,t:t.t,client:t.client})),a=Ne.get(e);if(a!==void 0&&a.route===n){(a.t!==t.t||a.client!==t.client)&&(a.t=t.t,a.client=t.client,a.mount.root.render(s()));return}a!==void 0&&(Ne.delete(e),a.mount.root.unmount()),Ne.set(e,{route:n,host:o,mount:ct(o,s(),{sync:!0}),t:t.t,client:t.client})}function vi(e,t){Ne.delete(e),qe(t.mount)}function ln(e){He(e,dn,!1);let t=Ne.get(e);t!==void 0&&vi(e,t),wi(e)?.remove()}function ki(){for(let e of Array.from(document.querySelectorAll(`[${gr}]`))){let t=e.previousElementSibling;t instanceof HTMLElement&&Ne.has(t)?ln(t):e.remove()}}var Ei="http://www.w3.org/2000/svg",$d="data-bre-icon";function Vd(e){let t=document.createElementNS(Ei,"path");return t.setAttribute("d",e),t}function Ti(e,t){let n=document.createElementNS(Ei,"svg");return n.setAttribute("viewBox","0 0 16 16"),n.setAttribute("width","16"),n.setAttribute("height","16"),n.setAttribute("fill","none"),n.setAttribute("stroke","currentColor"),n.setAttribute("stroke-width","1.5"),n.setAttribute("stroke-linecap","round"),n.setAttribute("stroke-linejoin","round"),n.setAttribute("aria-hidden","true"),n.setAttribute("focusable","false"),n.setAttribute($d,e),n.append(...t.map(Vd)),n}var fn="bre-key-field",Ai="bre-key-eye",un="data-bre-key-input",Ri="data-bre-eye-show",Oi="data-bre-eye-hide",Mi=["M1.5 8S4 3.75 8 3.75 14.5 8 14.5 8 12 12.25 8 12.25 1.5 8 1.5 8Z","M6.2 8a1.8 1.8 0 1 0 3.6 0 1.8 1.8 0 0 0-3.6 0Z"],yr=new WeakMap;function hr(e){let t=e.querySelector(`input[${un}]`);if(t instanceof HTMLInputElement)return t;let n=e.querySelector('input[type="password"]');return n instanceof HTMLInputElement?n:void 0}function Hi(e){for(let t of Array.from(e.children))if(t instanceof HTMLButtonElement&&t.classList.contains(Ai))return t}function Ni(e,t){let n=hr(e);if(n===void 0){cn(e);return}yr.set(e,t),$(n,un,""),He(e,fn,!0);let r=Hi(e)??Jd(e);$(r,Ri,t.t("keyRevealShow")),$(r,Oi,t.t("keyRevealHide")),br(r,n)}function cn(e){let t=Hi(e);t!==void 0&&t.remove(),yr.delete(e),He(e,fn,!1);let n=e.querySelector(`input[${un}]`);n instanceof HTMLInputElement&&(n.removeAttribute(un),n.type="password")}async function Yd(e){try{let t=await fetch(`${Ht}?route=${encodeURIComponent(e)}`,{method:"GET",cache:"no-store",credentials:"same-origin"});if(!t.ok)return;let n=await t.json();return n===null||typeof n!="object"||n.ok!==!0?void 0:typeof n.key=="string"&&n.key.length>0?n.key:void 0}catch{return}}function br(e,t){let n=t.type!=="password";$(e,"aria-pressed",n?"true":"false");let r=e.getAttribute(n?Oi:Ri);r!==null&&($(e,"aria-label",r),$(e,"title",r)),ht(e,t.disabled)}function Si(e,t){let n=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value");n?.set===void 0?e.value=t:n.set.call(e,t),e.dispatchEvent(new Event("input",{bubbles:!0}))}function Jd(e){let t=document.createElement("button");t.type="button",t.className=Ai,t.append(Li("eye"),Li("eye-off"));let n,r=async()=>{let o=hr(e),i=yr.get(e);if(o===void 0||i===void 0)return;if(o.type!=="password"){n!==void 0&&o.value===n&&Si(o,""),n=void 0,o.type="password",br(t,o);return}let s=i.route;if(s!==void 0&&n===void 0&&o.value.length===0){$(t,"aria-busy","true");let a;try{a=await(i.loadKey??Yd)(s)}catch{a=void 0}if(t.hasAttribute("aria-busy")&&t.removeAttribute("aria-busy"),a===void 0){let d=i.t("keyRevealFailed");$(t,"aria-label",d),$(t,"title",d);return}hr(e)===o&&o.value.length===0&&(n=a,Si(o,a))}o.type="text",br(t,o)};return t.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),r()}),e.append(t),t}function Li(e){let t=e==="eye-off"?[...Mi,"M2.5 13.5 13.5 2.5"]:Mi;return Ti(e,t)}var wr="bre-editor-tabs",Xd="bre-editor-tab",pn="data-bre-tab-id",wt="bre-tabbed",Ie="data-bre-tab",_i="data-bre-provider",fe="data-bre-region",yt="data-bre-editor-body",xt="data-bre-details";var Qd=".bre-headers",_e="provider",rt="models",ot="advanced",Zd=[_e,rt,ot],el="none",Ii=Zd,Di=wr,Pi=Xd,Ci=pn,mn='[class*="editorActions"], [class*="modelList"], [class*="modelCatalog"], [class*="modelEntry"]',tl='[class*="modelCatalog"], [class*="modelList"], [class*="modelEntry"]',Fi='[class*="rowCard"], [class*="addCard"], li';function Ki(){return{warned:new WeakSet}}function hn(e){return e===null?null:e.closest(Fi)}function qi(e,t){$(e,Ie,t),Ui(e)}function xr(e,t,n){if(!e.isConnected)return;let r=new Set;for(let o of Array.from(e.querySelectorAll(mn))){let i=o.closest(Fi);i!==null&&r.add(i)}for(let o of Array.from(e.querySelectorAll(`.${wt}`)))r.has(o)||gn(o);for(let o of r)try{sl(o,t)}catch(i){n.warned.has(o)||(n.warned.add(o),console.warn("[bre] editor tabs: rolled a provider card back to the official layout:",i)),gn(o)}}function Bi(){for(let e of Array.from(document.querySelectorAll(`.${wt}`))){e.classList.remove(wt),e.removeAttribute(Ie),e.removeAttribute(yt);for(let t of Array.from(e.querySelectorAll(`[${fe}]`)))t.removeAttribute(fe)}for(let e of Array.from(document.querySelectorAll(`[${Ie}]`)))e.removeAttribute(Ie);for(let e of Array.from(document.querySelectorAll(`[${fe}]`)))e.removeAttribute(fe);for(let e of Array.from(document.querySelectorAll(`[${yt}]`)))e.removeAttribute(yt);for(let e of Array.from(document.querySelectorAll(`details[${xt}]`)))e.removeAttribute("open"),e.removeAttribute(xt);for(let e of Array.from(document.querySelectorAll(`.${fn}`)))cn(e);for(let e of Array.from(document.querySelectorAll(`.${dn}`)))ln(e);ki()}function nl(e){for(let n of Array.from(e.children))if(n instanceof HTMLElement&&!n.matches('[class*="editorHeader"], [class*="editorTitle"], [class*="editorActions"], [class*="editorRoute"]')&&n.matches('[class*="editor"]')&&(n.querySelector(mn)!==null||n.querySelector("input, select")!==null))return n;let t=e.querySelector(mn);for(;t!==null&&t.parentElement!==e;)t=t.parentElement;return t!==null&&t!==e?t:void 0}function rl(e){let t={header:void 0,models:void 0,actions:void 0,fields:[]};Wi(e,t,0);let{actions:n,fields:r,header:o,models:i}=t;if(!(n===void 0||r.length===0)&&r.some(s=>s.querySelector("input, select, textarea")!==null))return{header:o,models:i,actions:n,fields:r}}var ol=4;function Wi(e,t,n){if(!(n>ol)){for(let r of Array.from(e.children))if(r instanceof HTMLElement&&!r.matches('[class*="bre-"], [data-plugin]')){if(t.header===void 0&&r.matches('[class*="editorHeader"], [class*="editorTitle"]')){t.header=r;continue}if(r.matches('[class*="editorActions"]')){t.actions??(t.actions=r);continue}if(r.matches(tl)){t.models??(t.models=r);continue}if(r.querySelector(mn)!==null){Wi(r,t,n+1);continue}if(r.querySelector('[class*="editorActions"]')!==null){t.actions??(t.actions=r);continue}r.querySelector("input, select, textarea")!==null&&t.fields.push(r)}}}function il(e){let n=e.querySelector(`[${_i}]`)?.getAttribute(_i);return n==null||n===""?void 0:n}function sl(e,t){let n=nl(e);if(n===void 0){gn(e);return}let r=rl(n);if(r===void 0){gn(e);return}let o=e.querySelector(Qd),i=il(e);for(let d of r.fields)$(d,fe,_e),Ni(d,{t:t.t,route:i}),xi(d,{t:t.t,route:i});r.header!==void 0&&$(r.header,fe,el),r.models!==void 0&&$(r.models,fe,rt),$(n,yt,""),o!==null&&$(o,fe,ot),dl(n);let s=new Set([_e]);r.models!==void 0&&s.add(rt),o!==null&&s.add(ot);let a=e.getAttribute(Ie)??_e;$(e,Ie,s.has(a)?a:_e),He(e,wt,!0),al(e,t,s)}function al(e,t,n){let r=e.querySelector(`.${wr}`);r!==null&&($(r,"aria-label",t.t("editorTabsLabel")),on(bt(r,_e),t.t("editorTabProvider")),on(bt(r,rt),t.t("editorTabModels")),on(bt(r,ot),t.t("editorTabAdvanced")),ht(bt(r,rt),!n.has(rt)),ht(bt(r,ot),!n.has(ot)),Ui(e,r))}function Ui(e,t){let n=t??e.querySelector(`.${wr}`);if(n===null)return;let r=e.getAttribute(Ie)??_e;for(let o of Array.from(n.querySelectorAll(`[${pn}]`)))$(o,"aria-selected",o.getAttribute(pn)===r?"true":"false")}function bt(e,t){for(let n of Array.from(e.children))if(n instanceof HTMLElement&&n.getAttribute(pn)===t)return n}function gn(e){e.classList.remove(wt),e.removeAttribute(Ie),e.removeAttribute(yt);for(let t of Array.from(e.querySelectorAll(`[${fe}]`)))t.getAttribute(fe)===_e&&(cn(t),ln(t)),t.removeAttribute(fe);ll(e)}function dl(e){for(let t of Array.from(e.querySelectorAll("details")))t.hasAttribute("open")||($(t,xt,"closed"),$(t,"open",""))}function ll(e){for(let t of Array.from(e.querySelectorAll(`details[${xt}]`)))t.removeAttribute("open"),t.removeAttribute(xt)}var vt="data-bre-drag-handle",vr="data-bre-row-head",kr="data-bre-drop-side",bn="bre-row-dragging",yn="bre-row-drop-target",Yi="bre-drag-ghost",Ji="bre-drop-line",ji="http://www.w3.org/2000/svg",zi=8,Gi=28,$i=12,ul="transform 180ms cubic-bezier(0.2, 0.7, 0.3, 1)",fl='button, a, input, textarea, select, [contenteditable], [role="button"], [role="switch"], [role="checkbox"], [role="textbox"], [role="combobox"]';function wn(){return{sources:new WeakSet,lists:new WeakSet,line:void 0,drag:void 0}}function ce(e){return Array.from(e.children).filter(t=>t instanceof HTMLElement)}function cl(e,t){let n=e.style.order;if(n==="")return t;let r=Number.parseInt(n,10);return Number.isNaN(r)?t:r}function Ge(e){return ce(e).map((t,n)=>({row:t,key:cl(t,n),index:n})).sort((t,n)=>t.key-n.key||t.index-n.index).map(t=>t.row)}function kt(e,t){let n=Ge(e),r=n.filter(a=>t.includes(a)),o=r.map(a=>n.indexOf(a)),i=t.filter(a=>r.includes(a)),s=new Map;n.forEach((a,d)=>s.set(a,d)),o.forEach((a,d)=>{let f=i[d];f!==void 0&&s.set(f,a)});for(let[a,d]of s){let f=String(d);a.style.order!==f&&(a.style.order=f)}}function Er(e,t){let n=ce(e),r=n.map(o=>o.offsetTop);t(),n.forEach((o,i)=>{let s=r[i]-o.offsetTop;s!==0&&(o.style.transition="none",o.style.transform=`translateY(${s}px)`,o.offsetHeight,o.style.transition=ul,o.style.transform="")})}function Et(e,t){return Ge(e).map(n=>t(n)).filter(n=>n!==void 0)}function Xi(e,t,n){let r=new Map;for(let[s,a]of t.entries())r.has(a)||r.set(a,s);let i=[...Ge(e).filter(s=>n(s)!==void 0)].sort((s,a)=>{let d=r.get(n(s))??Number.MAX_SAFE_INTEGER,f=r.get(n(a))??Number.MAX_SAFE_INTEGER;return d-f});kt(e,i)}function xn(e){for(let t of e)t.style.order="",t.style.transition="",t.style.transform=""}function Qi(e,t,n,r){let i=e.filter(s=>s!==t).indexOf(n);return i<0?Math.max(0,e.indexOf(t)):r?i+1:i}function Zi(e,t){let n,r=Number.POSITIVE_INFINITY;for(let o of e){let i=o.getBoundingClientRect(),s=t<i.top?i.top-t:t>i.bottom?t-i.bottom:0;s<r&&(r=s,n=o)}return n}function pl(e,t){let n=e.getBoundingClientRect();return n.height<=0?!0:t>n.top+n.height/2}function es(e,t){let n=e.getBoundingClientRect();return t?n.bottom+zi/2-1:n.top-zi/2-1}function ts(){let e=document.createElementNS(ji,"svg");e.setAttribute("width","10"),e.setAttribute("height","14"),e.setAttribute("viewBox","0 0 10 14"),e.setAttribute("fill","none"),e.setAttribute("aria-hidden","true");let t=[[2.5,3],[7.5,3],[2.5,7],[7.5,7],[2.5,11],[7.5,11]];for(let[n,r]of t){let o=document.createElementNS(ji,"circle");o.setAttribute("cx",String(n)),o.setAttribute("cy",String(r)),o.setAttribute("r","1.2"),o.setAttribute("fill","currentColor"),e.appendChild(o)}return e}function ns(e,t){let n=document.createElement("div");n.className=Yi,n.setAttribute("aria-hidden","true"),n.appendChild(ts());let r=document.createElement("span");r.className="bre-drag-ghost-name";let o=t??e.querySelector('[class*="rowName"]')?.textContent?.trim();return r.textContent=o===void 0?"":o,n.appendChild(r),n}function ml(e){return!(e instanceof Element)||e.closest(`[${vt}]`)!==null?!1:e.closest(fl)!==null}function rs(e){return e.parentElement??void 0}function os(e){for(let t of ce(e))t.classList.remove(yn),t.removeAttribute(kr)}function is(e){let t=e.parentElement;for(;t!==null;){if(gl(t))return t;t=t.parentElement}let n=document.scrollingElement;return n instanceof HTMLElement&&n.scrollHeight>n.clientHeight?n:void 0}function gl(e){if(e.scrollHeight<=e.clientHeight)return!1;let t=e.style.overflowY,n=t.length>0?t:window.getComputedStyle(e).overflowY;return n==="auto"||n==="scroll"||n==="overlay"}function ss(e,t){let n=e.getBoundingClientRect();return n.height<=0?0:t<n.top+Gi?-$i:t>n.bottom-Gi?$i:0}function as(e,t,n){if(t.scrollStep===n)return;if(t.scrollStep=n,n===0){t.frame!==void 0&&(window.cancelAnimationFrame(t.frame),t.frame=void 0);return}let r=t.scroller;if(r===void 0||t.frame!==void 0)return;let o=()=>{t.frame=void 0,!(e.drag!==t||t.scrollStep===0)&&(r.scrollTop+=t.scrollStep,t.frame=window.requestAnimationFrame(o))};t.frame=window.requestAnimationFrame(o)}function hl(e){let t=e.line;if(t!==void 0&&t.isConnected)return t;let n=document.createElement("div");return n.className=Ji,n.setAttribute("aria-hidden","true"),document.body.appendChild(n),e.line=n,n}function bl(e,t,n){let r=hl(e),o=t.getBoundingClientRect();r.style.top=`${es(t,n)}px`,r.style.left=`${o.left}px`,r.style.width=`${o.width}px`,r.style.display="block",r.setAttribute(kr,n?"after":"before")}function yl(e){e.line!==void 0&&(e.line.style.display="none")}function wl(e){let t=e.drag;e.drag=void 0,t!==void 0&&(as(e,t,0),yl(e),t.row.classList.remove(bn),os(t.list),t.dropped||Er(t.list,()=>{kt(t.list,t.before)}))}function xl(e,t,n,r){if(ml(t.target)){t.preventDefault();return}let o=rs(e),i=n.idOf(e);if(o===void 0||i===void 0){t.preventDefault();return}let s={row:e,list:o,before:Ge(o),scroller:is(o),adapter:n,scrollStep:0,frame:void 0,dropped:!1};r.drag=s,e.classList.add(bn);let a=ns(e,n.labelOf(e));Number.isFinite(t.clientX)&&Number.isFinite(t.clientY)&&(a.style.left=`${t.clientX}px`,a.style.top=`${t.clientY}px`),document.body.appendChild(a);let d=t.dataTransfer;if(d!=null)try{d.effectAllowed="move",d.setData("text/plain",i),d.setDragImage(a,Math.round(a.offsetWidth/2),Math.round(a.offsetHeight/2))}catch{}window.setTimeout(()=>{a.remove()},0)}function vl(e,t,n){let r=n.drag;if(r===void 0||r.list!==e)return;let o=t.target,i=o instanceof Element?r.adapter.rowOf(o,e):void 0,s=Ge(e),a=i!==void 0&&s.includes(i)?i:Zi(s,t.clientY);if(a===void 0)return;t.preventDefault();let d=t.dataTransfer;d!=null&&(d.dropEffect="move");let f=pl(a,t.clientY),m=Qi(s,r.row,a,f);m!==s.indexOf(r.row)&&Er(e,()=>{kt(e,Dn(s,r.row,m))}),os(e),a.classList.add(yn),a.setAttribute(kr,f?"after":"before"),bl(n,a,f),as(n,r,r.scroller===void 0?0:ss(r.scroller,t.clientY))}function kl(e,t){t.lists.has(e)||(t.lists.add(e),e.addEventListener("dragover",n=>{vl(e,n,t)}),e.addEventListener("drop",n=>{let r=t.drag;r===void 0||r.list!==e||(n.preventDefault(),r.dropped=!0,r.adapter.commit(e))}))}function El(e,t,n,r){r.sources.has(e)||(r.sources.add(e),n.seatDrags&&(e.setAttribute(vr,"1"),e.setAttribute("draggable","true")),e.addEventListener("dragstart",o=>{xl(t,o,n,r)}),e.addEventListener("dragend",()=>{wl(r)}))}function Tl(e,t,n,r){e.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation()}),e.addEventListener("keydown",o=>{if(o.key!=="ArrowUp"&&o.key!=="ArrowDown")return;let i=rs(t);if(i===void 0)return;let s=Ge(i),a=s.indexOf(t);if(a<0)return;let d=a+(o.key==="ArrowUp"?-1:1);d<0||d>=s.length||(o.preventDefault(),Er(i,()=>{kt(i,Dn(s,t,d))}),n.commit(i),e.focus())})}function Vi(e,t,n,r){let o=r.gripLabel(t,n),i=r.gripHint();e.getAttribute(vt)!==n&&e.setAttribute(vt,n),e.getAttribute("aria-label")!==o&&e.setAttribute("aria-label",o),e.getAttribute("title")!==i&&e.setAttribute("title",i)}function Ml(e,t,n,r,o){let i=t.querySelector(`[${vt}]`);if(i!==null){Vi(i,e,n,r);return}r.decorate?.(e,t);let s=document.createElement("span");s.className="bre-drag-grip",s.setAttribute("role","button"),s.setAttribute("tabindex","0"),s.setAttribute("draggable","true"),s.appendChild(ts()),Vi(s,e,n,r),Tl(s,e,r,o),El(r.seatDrags?t:s,e,r,o),t.insertBefore(s,t.firstChild)}function vn(e,t,n,r){if(e.isConnected){kl(t,r);for(let o of ce(t)){let i=n.idOf(o);if(i===void 0)continue;let s=n.seatOf(o);s!==void 0&&Ml(o,s,i,n,r)}r.drag===void 0&&Xi(t,n.order(Et(t,n.idOf)),n.idOf)}}function kn(e){e.drag=void 0;for(let t of Array.from(document.querySelectorAll(`[${vt}]`)))t.remove();for(let t of Array.from(document.querySelectorAll(`[${vr}]`)))t.removeAttribute(vr),t.removeAttribute("draggable");for(let t of Array.from(document.querySelectorAll(`.${bn}, .${yn}`)))t.classList.remove(bn,yn);for(let t of Array.from(document.querySelectorAll(`.${Ji}`)))t.remove();for(let t of Array.from(document.querySelectorAll(`.${Yi}`)))t.remove();e.line=void 0}var Tt="data-bre-row-provider",ds="{provider}",Sl=["rowCard","setupCard"];function ls(){return wn()}function Mt(e){for(let t of Sl)for(let n of Array.from(e.querySelectorAll(`[class*="${t}"]`))){let r=n.parentElement;if(!(r===null||r.tagName!=="UL")&&ce(r).length!==0)return r}}function St(e){return e.querySelector('[class*="rowHead"]')??void 0}function it(e){let t=e.querySelector('[class*="rowName"]')?.textContent?.trim();return t!==void 0&&t.length>0?t:void 0}function Ll(e){let t=e.indexOf(ds);if(!(t<0))return{prefix:e.slice(0,t),suffix:e.slice(t+ds.length)}}function Al(e){let t=e.trim();if(t.length===0)return;let n=/^(.*) \(([^()]*)\)$/.exec(t);if(n!==null){let r=n[2];return r.length===0?void 0:r}return/\s/.test(t)?void 0:t}var Rl='[class*="rowCard"], [class*="setupCard"], [class*="addCard"]';function Ol(e){let t=e.closest(Rl);for(let n=e;n!==null&&n!==t;n=n.parentElement)if(n.matches('[data-plugin], [class*="bre-"]'))return!0;return!1}function $e(e,t){let n=e.querySelector("[data-bre-provider]")?.getAttribute("data-bre-provider");if(typeof n=="string"&&n.length>0)return n;for(let r of t.editProvider){let o=Ll(r);if(o!==void 0)for(let i of Array.from(e.querySelectorAll("button[aria-label]"))){if(Ol(i))continue;let s=i.getAttribute("aria-label")??"";if(s.length<=o.prefix.length+o.suffix.length||!s.startsWith(o.prefix)||!s.endsWith(o.suffix))continue;let a=Al(s.slice(o.prefix.length,s.length-o.suffix.length));if(a!==void 0)return a}}}function Tr(e){let t=e.getAttribute(Tt);return t===null||t.length===0?void 0:t}function Hl(e){return Et(e,Tr)}function us(e,t,n){if(!e.isConnected)return;let r=Mt(e);if(r===void 0)return;let o=t.labels();for(let i of ce(r)){let s=$e(i,o);if(s===void 0){i.removeAttribute(Tt);continue}Tr(i)!==s&&i.setAttribute(Tt,s)}vn(e,r,Nl(t),n)}function Nl(e){return{rowOf:t=>{let n=t.closest("li");return n instanceof HTMLElement?n:void 0},idOf:Tr,labelOf:it,order:t=>ro(t),commit:t=>{to(Hl(t))},seatOf:St,seatDrags:!0,gripLabel:(t,n)=>e.t("providerReorderAria",{provider:it(t)??n}),gripHint:()=>e.t("providerReorderHint")}}function fs(e){kn(e);let t=Array.from(document.querySelectorAll(`[${Tt}]`));xn(t);for(let n of t)n.removeAttribute(Tt)}var st="data-bre-provider-switch",En="bre-row-disabled";function ps(){return{switches:new WeakSet}}function ms(e,t,n){if(!e.isConnected)return;let r=Mt(e);if(r===void 0)return;let o=t.labels();for(let i of Array.from(r.children)){if(!(i instanceof HTMLElement))continue;let s=$e(i,o);if(s===void 0)continue;let a=St(i);a!==void 0&&(_l(i,a,s,t,n),i.classList.toggle(En,!Ct(s)))}}function gs(){for(let e of Array.from(document.querySelectorAll(`[${st}]`)))e.remove();for(let e of Array.from(document.querySelectorAll(`.${En}`)))e.classList.remove(En)}function _l(e,t,n,r,o){let i=t.querySelector(`[${st}]`);if(i!==null){cs(i,e,n,r);return}let s=document.createElement("button");s.className="bre-provider-switch",s.setAttribute("type","button"),s.setAttribute("role","switch"),s.setAttribute(st,n),cs(s,e,n,r),Il(s,e,o);let a=t.querySelector('[class*="rowActions"]');a===null?t.appendChild(s):a.insertBefore(s,a.firstChild)}function cs(e,t,n,r){let o=r.t("providerToggleAria",{provider:it(t)??n}),i=r.t("providerToggleHint"),s=Ct(n)?"true":"false";e.getAttribute(st)!==n&&e.setAttribute(st,n),e.getAttribute("aria-checked")!==s&&e.setAttribute("aria-checked",s),e.getAttribute("aria-label")!==o&&e.setAttribute("aria-label",o),e.getAttribute("title")!==i&&e.setAttribute("title",i)}function Il(e,t,n){n.switches.has(e)||(n.switches.add(e),e.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation();let o=e.getAttribute(st);if(o===null)return;let i=!Ct(o);so(o,i),e.setAttribute("aria-checked",i?"true":"false"),t.classList.toggle(En,!i)}))}var Tn="data-bre-provider-delete",hs='[class*="rowActions"]',bs='[class*="dangerButton"]',Dl="bre-provider-delete";function ys(e,t){if(!e.isConnected)return;let n=Mt(e);if(n===void 0)return;let r=t.labels(),o=Pl(n)??t.t("providerRemoveDisabled");for(let i of Array.from(n.children)){if(!(i instanceof HTMLElement))continue;let s=$e(i,r);if(s===void 0)continue;let a=St(i);if(a===void 0)continue;let d=a.querySelector(hs);if(d===null)continue;let f=d.querySelector(`[${Tn}]`);if(d.querySelector(bs)!==null){f!==null&&f.remove();continue}let m=f??Cl();d.lastElementChild!==m&&d.appendChild(m),Fl(m,s,o,t.t("providerRemoveLocked",{provider:it(i)??s}))}}function ws(){for(let e of Array.from(document.querySelectorAll(`[${Tn}]`)))e.remove()}function Pl(e){let n=e.querySelector(`${hs} ${bs}`)?.textContent?.trim()??"";return n.length>0?n:void 0}function Cl(){let e=document.createElement("button");return e.className=Dl,e.setAttribute("type","button"),e.setAttribute("disabled",""),e}function Fl(e,t,n,r){e.getAttribute(Tn)!==t&&e.setAttribute(Tn,t),e.textContent!==n&&(e.textContent=n),e.getAttribute("aria-label")!==r&&e.setAttribute("aria-label",r),e.getAttribute("title")!==r&&e.setAttribute("title",r)}var Lt="data-bre-row-model",Mr="bre-model-grid";function vs(){return wn()}function Kl(e){let t=[];for(let n of Array.from(e.querySelectorAll('[class*="modelList"]')))ce(n).filter(o=>o.matches('[class*="modelEntry"]')).length!==0&&t.push(n);return t}function Mn(e){let t=e.getAttribute(Lt);return t===null||t.length===0?void 0:t}function Sr(e,t){let n=e.closest("li");if(n!==null)return $e(n,t.labels())}function xs(e,t){let n=Oe(e,t.labels().modelName);return n.length>0?n:Mn(e)}function ql(e,t){return{rowOf:n=>{let r=n.closest('[class*="modelEntry"]');return r instanceof HTMLElement?r:void 0},idOf:Mn,labelOf:n=>xs(n,t),order:n=>{let r=Sr(e,t);return r===void 0?n:go(r,n)},commit:n=>{let r=Sr(n,t);r!==void 0&&po(r,Et(n,Mn))},seatOf:n=>n.querySelector('[class*="modelRow"]')??void 0,seatDrags:!1,gripLabel:(n,r)=>t.t("modelReorderAria",{model:xs(n,t)??r}),gripHint:()=>t.t("modelReorderHint"),decorate:(n,r)=>{r.classList.add(Mr)}}}function ks(e,t,n){if(!e.isConnected)return;let r=t.labels();for(let o of Kl(e))if(Sr(o,t)!==void 0){for(let i of ce(o)){let s=Oe(i,r.modelId);if(s.length===0){i.removeAttribute(Lt);continue}Mn(i)!==s&&i.setAttribute(Lt,s)}vn(e,o,ql(o,t),n)}}function Es(e){kn(e);for(let n of Array.from(document.querySelectorAll(`.${Mr}`)))n.classList.remove(Mr);let t=Array.from(document.querySelectorAll(`[${Lt}]`));xn(t);for(let n of t)n.removeAttribute(Lt)}var Bl="settings.models",ke={capacity:["modelAdvanced","Model options","Capacities"],modelId:["modelId","Model ID"],modelName:["modelName","Display name"],routeId:["customRoute","Provider ID"],baseUrl:["baseUrl","Base URL"],apiProtocol:["customApi","API protocol"],apply:["apply","Apply"],cancel:["cancel","Cancel"],editProvider:["editProvider","Edit {provider}"]};function Ms(e){let{ctx:t,api:n,t:r,onIdle:o,refreshed:i}=e,s=()=>{let W=t.locale.bind(Bl),C=([z,...V])=>{let U=W(z);return U===z||U.trim()===""?V:[U,...V]};return{capacity:C(ke.capacity),modelId:C(ke.modelId),modelName:C(ke.modelName),routeId:C(ke.routeId),baseUrl:C(ke.baseUrl),apiProtocol:C(ke.apiProtocol),apply:C(ke.apply),cancel:C(ke.cancel),editProvider:C(ke.editProvider)}},a=120,d=ui(),f=ls(),m={t:r,labels:s},p=ps(),g={t:r,labels:s},l={t:r,labels:s},c=vs(),u={t:r,labels:s},b=Ki(),k={t:r},w,x,T,y,E=!1,R={api:n,describeNamespace:()=>ne(n),t:r,labels:s,onIdle:o,onBackoff:W=>{K(W)},mount(W,C){let z=document.createElement("div");z.className="bre-effort-slot",z.dataset.plugin=J,W.appendChild(z);let V=(0,Ts.createRoot)(z),U=L=>{V.render((0,Lr.createElement)(ve,{fallbackText:r("renderFailed"),children:i(()=>(0,Lr.createElement)(en,L))}))};return U(C),{unmount:()=>{V.unmount()},render:U}}};function K(W){E||x!==void 0||(x=window.setTimeout(()=>{x=void 0,j()},W))}function j(){E||w!==void 0||(w=window.setTimeout(()=>{w=void 0,y?.(),mi(be(),R,d),xr(be(),k,b),us(be(),m,f),ms(be(),g,p),ys(be(),l),ks(be(),u,c)},a))}let I=W=>{E||T!==void 0||(y=W,W(),T=new MutationObserver(()=>{W(),xr(be(),k,b),j()}),T.observe(document.body,{childList:!0,subtree:!0}),j())},B=()=>{E=!0,w!==void 0&&(window.clearTimeout(w),w=void 0),x!==void 0&&(window.clearTimeout(x),x=void 0),T?.disconnect(),T=void 0};return{state:d,labels:s,start:I,stopObserver:B,teardown:()=>{B(),di(d,R);for(let[,W]of d.mounted)W.editor.unmount();d.mounted.clear(),fs(f),gs(),ws(),ri(),Es(c),Bi()},flushOnUnload:()=>{li(d,R)},schedule:j}}function Wl(e,t){let n=e?.list?.getSnapshot(),r=n?.current;if(typeof r=="string"&&r.length>0)return r;let o=t?.adapter?.current?.getSnapshot?.()?.key;if(typeof o=="string"&&o.length>0)return o;for(let[i,s]of Object.entries(n?.byId??{}))if(!(s===void 0||(s.retainedBy?.mainView??0)<=0))return typeof s.id=="string"&&s.id.length>0?s.id:i}function Ss(e){let t,n=new Map,r=(s,a)=>{for(let[d,f]of n){if(d===a)continue;let m;try{m=s.directoryFor(f.sessionId)===d}catch{m=!1}m||(f.restore(),n.delete(d))}};return{ensure:()=>{let s=e.ctx,a=s.get?.("sessions"),d=s.get?.("uiSession"),f=s.get?.("modelDirectories"),m=Wl(a,d);if(!(m===void 0||f===void 0))try{let p=f.directoryFor(m);return r(f,p),t!==void 0&&t.sessionId===m&&t.directory===p||(n.has(p)||n.set(p,{sessionId:m,restore:Lo(p,{configuredEffort:e.configuredEffort})}),t={sessionId:m,directory:p}),p}catch{t=void 0;return}},dispose:()=>{for(let[,s]of n)s.restore();n.clear()}}}var Ul="conversation.input.model";function Ls(e){return e.querySelector("[data-composer-card]")??void 0}function Ar(e){return e.querySelector(`[data-slot="${Ul}"]`)??void 0}function As(e){let t=Ar(e)??e;return Array.from(t.querySelectorAll('button[aria-haspopup="menu"]'))}function Rs(e,t){let n=e.getAttribute("aria-controls");if(n===null||n.length===0)return;let r=t.getElementById(n);if(r!==null)return r.getAttribute("role")==="menu"?r:void 0}function Rr(e=document){let t=Ls(e);if(t===void 0)return;for(let r of As(t)){let o=Rs(r,e);if(o!==void 0)return o}let n=Ar(t)??t;for(let r of Array.from(n.querySelectorAll('[role="menu"]')))if(r.previousElementSibling?.matches('button[aria-haspopup="menu"]'))return r}function Or(e=document){let t=Ls(e);if(t===void 0)return;let n=Ar(t),r=As(t),o=r[0];if(o!==void 0){for(let i of r)if(Rs(i,e)!==void 0)return i;for(let i of r)if(i.nextElementSibling?.matches('[role="menu"]'))return i;return n===void 0?r.at(-1):o}}function Os(){return Rr()}function Hs(){return Or()}var De=require("react");var Y=require("react");var N=require("react/jsx-runtime"),jl=["claude-cli/2.1.161 (external, cli)","claude-code/1.0.0","Kilo-Code/1.0"];function Ns(e){let t=0,n=Object.entries(e??{}).map(([r,o])=>({id:t+=1,name:r,value:o}));return n.length===0&&n.push({id:t+=1,name:"",value:""}),{rows:n}}function zl(e){let t={},n=!1;for(let o of e.rows){let i=o.name.trim();i.length!==0&&(t[i]=o.value,i.toLowerCase()==="user-agent"&&(n=!0))}let r=e.userAgent?.trim();return!n&&r!==void 0&&r.length>0&&(t["user-agent"]=r),t}function _s({route:e,api:t,t:n}){let r=(0,Y.useId)(),[o,i]=(0,Y.useState)(void 0),[s,a]=(0,Y.useState)({rows:[]}),[d,f]=(0,Y.useState)(!1),[m,p]=(0,Y.useState)(!1),[g,l]=(0,Y.useState)(!0),[c,u]=(0,Y.useState)(!1),[b,k]=(0,Y.useState)(!1),[w,x]=(0,Y.useState)(void 0),[T,y]=(0,Y.useState)(void 0),[E,R]=(0,Y.useState)(!1),K=(0,Y.useRef)(1),j=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{let L=!0;return(async()=>{try{let P=await ne(t);if(!L)return;let _=Zn(P.namespace,e);i(_),a(Ns(_)),k(P.writable!==!0)}catch{L&&k(!0)}finally{L&&l(!1)}})(),()=>{L=!1}},[t,e]),(0,Y.useEffect)(()=>{let L=!0;return(async()=>{try{let _=await(await fetch(zr,{method:"GET"})).json();L&&_.ok===!0&&_.data!==void 0&&y(_.data)}catch{}})(),()=>{L=!1}},[]),(0,Y.useEffect)(()=>{let L=j.current;if(L===null)return;let P=()=>{R(L.dataset.breRegion==="advanced")};P();let _=new MutationObserver(P);return _.observe(L,{attributes:!0,attributeFilter:["data-bre-region"]}),()=>{_.disconnect()}},[]);let I=()=>{a(L=>({...L,rows:[...L.rows,{id:K.current+=1,name:"",value:""}]})),x(void 0)},B=(L,P)=>{a(_=>({..._,rows:_.rows.map(te=>te.id===L?{...te,...P}:te)})),x(void 0)},A=L=>{a(P=>({...P,rows:P.rows.filter(_=>_.id!==L)})),x(void 0)},D=()=>{a(Ns(o)),p(!1),x(void 0)},W=async L=>{u(!0),x(void 0);let P;try{P=await er(t,e,L)}catch(_){P={ok:!1,error:_ instanceof Error?_.message:String(_)}}if(u(!1),!P.ok){x({kind:"error",text:P.error==="no-route"?n("headersNoRoute"):P.error==="read-only"?n("headersReadOnly"):n("headersError",{error:P.error})});return}i(L),p(!1),x({kind:"success",text:Object.keys(L).length===0?n("headersCleared"):n("headersSaved")})},C=Object.entries(o??{}),z=b||c,V=C.length,U=E;return(0,N.jsxs)("div",{className:"bre-headers",ref:j,"data-plugin":J,"data-open":d?"1":"0",children:[!E&&(0,N.jsx)("div",{className:"bre-headers-head",children:m?(0,N.jsx)("span",{className:"bre-effort-title",children:n("headersTitle")}):(0,N.jsxs)("button",{type:"button",className:"bre-headers-disclosure","aria-expanded":d,"aria-label":`${n("headersTitle")} ${e}`,onClick:()=>{f(!d),x(void 0)},children:[(0,N.jsx)("span",{className:"bre-effort-title",children:n("headersTitle")}),g||V===0?null:(0,N.jsx)("span",{className:"bre-headers-count",children:V}),(0,N.jsx)("span",{className:"bre-headers-chevron","aria-hidden":"true",children:"\u203A"})]})}),!d&&!m&&!E?null:(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)("p",{className:"bre-effort-note",children:n("headersHint")}),T===void 0?null:(0,N.jsxs)(N.Fragment,{children:[T.environment.preferOfficialLayer?(0,N.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictPatched")}):null,T.conflicts.length===0&&(T.headerConflicts?.length??0)===0?null:(0,N.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictOrigin")}),T.environment.siblings.length===0?null:(0,N.jsx)("p",{className:"bre-effort-note bre-warn",children:n("headersConflictSiblings",{names:T.environment.siblings.map(L=>L.name).join(", ")})})]}),g?null:m||U?(0,N.jsxs)("div",{className:"bre-headers-edit",children:[(0,N.jsxs)("div",{className:"bre-headers-columns","aria-hidden":"true",children:[(0,N.jsx)("span",{children:n("headersName")}),(0,N.jsx)("span",{children:n("headersValue")}),(0,N.jsx)("span",{})]}),s.rows.map(L=>(0,N.jsxs)("div",{className:"bre-headers-row",children:[(0,N.jsx)("input",{type:"text",className:"bre-text-input bre-headers-name",value:L.name,disabled:z,placeholder:n("headersNamePlaceholder"),"aria-label":n("headersName"),onChange:P=>{B(L.id,{name:P.target.value})}}),(0,N.jsx)("input",{type:"text",className:"bre-text-input bre-headers-value",value:L.value,disabled:z,list:L.name.trim().toLowerCase()==="user-agent"?r:void 0,placeholder:n("headersValue"),"aria-label":n("headersValue"),onChange:P=>{B(L.id,{value:P.target.value})}}),(0,N.jsx)("button",{type:"button",className:"bre-link-button bre-headers-remove",disabled:z,"aria-label":`${n("headersClear")} ${L.name}`,onClick:()=>{A(L.id)},children:"\xD7"})]},L.id)),(0,N.jsx)("button",{type:"button",className:"bre-link-button bre-headers-add",disabled:z,onClick:I,children:n("headersAdd")}),!1,(0,N.jsx)("datalist",{id:r,children:jl.map(L=>(0,N.jsx)("option",{value:L},L))}),(0,N.jsx)("p",{className:"bre-effort-note bre-headers-legacy",hidden:!0,children:n("headersUserAgentHint")}),(0,N.jsxs)("div",{className:"bre-effort-actions",children:[(0,N.jsx)("button",{type:"button",className:"bre-primary-button",disabled:z,onClick:()=>{W(zl(s))},children:n("headersSave")}),(0,N.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:z,onClick:D,children:n("headersCancel")})]})]}):(0,N.jsxs)("div",{className:"bre-headers-rows",children:[C.length===0?(0,N.jsx)("p",{className:"bre-effort-note",children:n("headersEmpty")}):C.map(([L,P])=>(0,N.jsxs)("div",{className:"bre-headers-row",children:[(0,N.jsx)("span",{className:"bre-headers-name",children:L}),(0,N.jsx)("span",{className:"bre-headers-value bre-headers-masked",children:"\u2022".repeat(Math.min(P.length,24))})]},L)),b?null:(0,N.jsx)("div",{className:"bre-effort-actions",children:(0,N.jsx)("button",{type:"button",className:"bre-secondary-button",disabled:z,onClick:()=>{p(!0),x(void 0)},children:n("headersEdit")})})]})]}),w===void 0?null:(0,N.jsx)("p",{className:"bre-effort-message bre-"+w.kind,role:w.kind==="error"?"alert":"status",children:w.text})]})}var Hr=require("react");var Gl={provider:"editorTabProvider",models:"editorTabModels",advanced:"editorTabAdvanced"};function Is({host:e,t}){return(0,Hr.createElement)("div",{className:Di,role:"tablist","aria-label":t("editorTabsLabel")},...Ii.map(n=>(0,Hr.createElement)("button",{key:n,type:"button",role:"tab",className:Pi,[Ci]:n,onClick:r=>{r.preventDefault(),r.stopPropagation();let o=hn(e.current);o!==null&&qi(o,n)}},t(Gl[n]))))}var Ds="settings.models.provider-card";function $l({provider:e,api:t,t:n}){let r=(0,De.useRef)(null);(0,De.useEffect)(()=>{let i=r.current,s=hn(i);if(i===null||s===null)return;let a=s,d=()=>s.querySelector('[class*="_editor"]')!==null,f=()=>{let p=d()?"1":"0";i.dataset.edit!==p&&(i.dataset.edit=p)};f();let m=new MutationObserver(f);return m.observe(a,{childList:!0,subtree:!0}),()=>{m.disconnect()}},[]);let o=e?.provider;return typeof o!="string"||o.length===0?null:(0,De.createElement)("div",{ref:r,className:"bre-headers-host","data-bre-provider":o},(0,De.createElement)(Is,{host:r,t:n}),(0,De.createElement)(_s,{route:o,api:t,t:n}))}function Ps(e,t,n){let r=e,o=r.slots?.inject(Ds,()=>{r.slots?.register({name:Ds,key:re,inject:()=>({api:t,t:n})},$l)});return typeof o=="function"?o:()=>{}}var ae=require("react");function Cs(e){let{t}=e,n=(0,ae.useSyncExternalStore)(_t,ue),r=()=>{Jr(!n)};return(0,ae.createElement)("div",{className:"bre-slider-setting"},(0,ae.createElement)("div",{className:"bre-slider-setting-row"},(0,ae.createElement)("div",{className:"bre-slider-setting-copy"},(0,ae.createElement)("div",{className:"bre-slider-setting-title"},t("sliderToggleTitle")),(0,ae.createElement)("div",{className:"bre-slider-setting-description"},t("sliderToggleDescription"))),(0,ae.createElement)("div",{className:"bre-slider-setting-control"},(0,ae.createElement)("span",{className:"bre-slider-setting-state"},t(n?"settingOn":"settingOff")),(0,ae.createElement)("button",{type:"button",role:"switch","aria-label":t("sliderToggleAria"),"aria-checked":n,className:"bre-slider-setting-switch"+(n?" is-on":""),onClick:r},(0,ae.createElement)("span",{className:"bre-slider-setting-switch-knob","aria-hidden":!0})))))}function Fs(e,t){let n=e,r=n.slots?.inject("settings.models.footer",()=>{n.slots?.register({name:"settings.models.footer",id:J+"-slider-toggle",order:15,inject:()=>({t})},Cs)});return typeof r=="function"?r:()=>{}}var Vl=J,Yl=["slots","locale","connection","remote","remote.settings"];function Jl(e){e.effect(()=>e.locale.register(Rn,{zh:Vr,en:$r}),"dsh-model-think-level: dictionaries");let t=document.createElement("style");t.dataset.plugin=J,t.dataset.pluginStyles=J,t.textContent=bo,document.head.appendChild(t),e.effect(()=>()=>t.remove(),"dsh-model-think-level: stylesheet");let n=(()=>{try{let l=e.get?.("configForms");try{let u=l?.get?.(re);if(u!==void 0)return u}catch{}return e.get?.("settingsScope")?.bind?.({namespace:re})}catch{return}})(),r=n===void 0?{settings:e.remote.settings}:{settings:e.remote.settings,scope:n},o=e.locale.bind(Rn),i=()=>{let l=e.locale;return typeof l.subscribe=="function"&&typeof l.getSnapshot=="function"?l:void 0},s=l=>{let c=i();return c===void 0?l():(0,Ks.createElement)(Gr,{locale:c,children:l})},a=Uo({api:r}),d=Ss({ctx:e,configuredEffort:a.of}),f=Ko({menuOf:Os,triggerOf:Hs,t:o,refreshed:s,sliderEnabled:ue,directory:d.ensure}),m=zo({api:r}),p=Ms({ctx:e,api:r,t:o,onIdle:m.run,refreshed:s}),g=()=>{d.ensure(),f.reconcile()};e.effect(()=>(p.start(g),()=>{p.teardown(),f.dispose(),d.dispose()}),"dsh-model-think-level: DOM injector"),e.effect(()=>{let l=()=>{p.flushOnUnload()};return window.addEventListener("pagehide",l),()=>{window.removeEventListener("pagehide",l)}},"dsh-model-think-level: ledger flush on unload"),e.effect(()=>{let l=()=>{p.state.describePromise=void 0,a.invalidate(),p.schedule()},c=[e.remote.$on("settings/document-updated",u=>{u===re&&l()}),e.on("connection/reset",l)];return()=>{for(let u of c)u()}},"dsh-model-think-level: pushed invalidations"),e.effect(()=>{let l=w=>{w.key===Nt?Xr(w.newValue!=="false"):w.key===It?no(Qe(w.newValue)):w.key===Pt?ao(oo(w.newValue)):w.key===Kt&&mo(Fn(w.newValue))};window.addEventListener("storage",l);let c=_t(()=>{p.schedule()}),u=Dt(()=>{p.schedule()}),b=Ft(()=>{p.schedule()}),k=qt(()=>{p.schedule()});return()=>{window.removeEventListener("storage",l),c(),u(),b(),k()}},"dsh-model-think-level: client preferences"),e.effect(()=>Fs(e,o),"dsh-model-think-level: footer slot activation"),e.effect(()=>Ps(e,r,o),"dsh-model-think-level: provider-card slot activation")}
1925
2042
 
1926
2043
  return module.exports;
1927
2044
  }