@alwith/module-chat 0.6.15 → 0.6.17
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/assets/provider-catalog.json +4 -9
- package/dist/chunk-4h07zyxp.js +2 -0
- package/dist/{chunk-5r909639.js → chunk-hwmpcj3y.js} +1 -1
- package/dist/{chunk-v2mdhm11.js → chunk-vet6snkp.js} +1 -1
- package/dist/{chunk-bc6e3dhv.js → chunk-zah37d5q.js} +1 -1
- package/dist/lib/markdown-parser.worker.js +39 -38
- package/dist/settings/model-alias-settings.js +1 -1
- package/dist/settings/provider-section.js +1 -1
- package/dist/settings/providers-port.js +1 -1
- package/dist/settings/providers.js +1 -1
- package/dist/settings/settings.js +1 -1
- package/native/darwin-arm64/THIRD_PARTY_NOTICES.md +11 -11
- package/native/darwin-arm64/artifact.json +1 -1
- package/native/darwin-arm64/libalwith_native_chat.dylib +0 -0
- package/native/darwin-arm64/licenses/zstd-sys-2.1.3+zstd.1.5.7/LICENSE.BSD-2-Clause +29 -0
- package/native/win32-x64/THIRD_PARTY_NOTICES.md +10 -10
- package/native/win32-x64/alwith_native_chat.dll +0 -0
- package/native/win32-x64/artifact.json +1 -1
- package/native/win32-x64/licenses/zstd-sys-2.1.3+zstd.1.5.7/LICENSE.BSD-2-Clause +29 -0
- package/package.json +7 -7
- package/dist/chunk-h7ackcd4.js +0 -2
- /package/native/darwin-arm64/licenses/{const-oid-0.10.2 → const-oid-0.10.3}/LICENSE-APACHE +0 -0
- /package/native/darwin-arm64/licenses/{const-oid-0.10.2 → const-oid-0.10.3}/LICENSE-MIT +0 -0
- /package/native/darwin-arm64/licenses/{crc32fast-1.5.4 → crc32fast-1.5.5}/LICENSE-APACHE +0 -0
- /package/native/darwin-arm64/licenses/{crc32fast-1.5.4 → crc32fast-1.5.5}/LICENSE-MIT +0 -0
- /package/native/darwin-arm64/licenses/{errno-0.3.14 → errno-0.3.15}/LICENSE-APACHE +0 -0
- /package/native/darwin-arm64/licenses/{errno-0.3.14 → errno-0.3.15}/LICENSE-MIT +0 -0
- /package/native/darwin-arm64/licenses/{itoa-1.0.18 → itoa-1.0.19}/LICENSE-APACHE +0 -0
- /package/native/darwin-arm64/licenses/{itoa-1.0.18 → itoa-1.0.19}/LICENSE-MIT +0 -0
- /package/native/darwin-arm64/licenses/{rusqlite-0.42.0 → rusqlite-0.43.0}/LICENSE +0 -0
- /package/native/darwin-arm64/licenses/{rustls-pki-types-1.15.1 → rustls-pki-types-1.16.0}/LICENSE-APACHE +0 -0
- /package/native/darwin-arm64/licenses/{rustls-pki-types-1.15.1 → rustls-pki-types-1.16.0}/LICENSE-MIT +0 -0
- /package/native/darwin-arm64/licenses/{syn-3.0.9 → syn-3.0.10}/LICENSE-APACHE +0 -0
- /package/native/darwin-arm64/licenses/{syn-3.0.9 → syn-3.0.10}/LICENSE-MIT +0 -0
- /package/native/darwin-arm64/licenses/{zip-9.4.2 → zip-9.5.1}/LICENSE +0 -0
- /package/native/darwin-arm64/licenses/{zstd-0.14.3 → zstd-0.14.4}/LICENSE +0 -0
- /package/native/darwin-arm64/licenses/{zstd-safe-8.2.0 → zstd-safe-8.3.0}/LICENSE +0 -0
- /package/native/darwin-arm64/licenses/{zstd-sys-2.1.2+zstd.1.5.7 → zstd-sys-2.1.3+zstd.1.5.7}/LICENSE +0 -0
- /package/native/darwin-arm64/licenses/{zstd-sys-2.1.2+zstd.1.5.7 → zstd-sys-2.1.3+zstd.1.5.7}/LICENSE.BSD-3-Clause +0 -0
- /package/native/win32-x64/licenses/{const-oid-0.10.2 → const-oid-0.10.3}/LICENSE-APACHE +0 -0
- /package/native/win32-x64/licenses/{const-oid-0.10.2 → const-oid-0.10.3}/LICENSE-MIT +0 -0
- /package/native/win32-x64/licenses/{crc32fast-1.5.4 → crc32fast-1.5.5}/LICENSE-APACHE +0 -0
- /package/native/win32-x64/licenses/{crc32fast-1.5.4 → crc32fast-1.5.5}/LICENSE-MIT +0 -0
- /package/native/win32-x64/licenses/{itoa-1.0.18 → itoa-1.0.19}/LICENSE-APACHE +0 -0
- /package/native/win32-x64/licenses/{itoa-1.0.18 → itoa-1.0.19}/LICENSE-MIT +0 -0
- /package/native/win32-x64/licenses/{rusqlite-0.42.0 → rusqlite-0.43.0}/LICENSE +0 -0
- /package/native/win32-x64/licenses/{rustls-pki-types-1.15.1 → rustls-pki-types-1.16.0}/LICENSE-APACHE +0 -0
- /package/native/win32-x64/licenses/{rustls-pki-types-1.15.1 → rustls-pki-types-1.16.0}/LICENSE-MIT +0 -0
- /package/native/win32-x64/licenses/{syn-3.0.9 → syn-3.0.10}/LICENSE-APACHE +0 -0
- /package/native/win32-x64/licenses/{syn-3.0.9 → syn-3.0.10}/LICENSE-MIT +0 -0
- /package/native/win32-x64/licenses/{zip-9.4.2 → zip-9.5.1}/LICENSE +0 -0
- /package/native/win32-x64/licenses/{zstd-0.14.3 → zstd-0.14.4}/LICENSE +0 -0
- /package/native/win32-x64/licenses/{zstd-safe-8.2.0 → zstd-safe-8.3.0}/LICENSE +0 -0
- /package/native/win32-x64/licenses/{zstd-sys-2.1.2+zstd.1.5.7 → zstd-sys-2.1.3+zstd.1.5.7}/LICENSE +0 -0
- /package/native/win32-x64/licenses/{zstd-sys-2.1.2+zstd.1.5.7 → zstd-sys-2.1.3+zstd.1.5.7}/LICENSE.BSD-3-Clause +0 -0
|
@@ -10,9 +10,7 @@
|
|
|
10
10
|
}
|
|
11
11
|
],
|
|
12
12
|
"catalog": "alwith/models.json",
|
|
13
|
-
"config": {
|
|
14
|
-
"web_search": "disabled"
|
|
15
|
-
}
|
|
13
|
+
"config": {}
|
|
16
14
|
},
|
|
17
15
|
{
|
|
18
16
|
"id": "anthropic",
|
|
@@ -39,15 +37,14 @@
|
|
|
39
37
|
}
|
|
40
38
|
],
|
|
41
39
|
"catalog": "anthropic/models.json",
|
|
42
|
-
"config": {
|
|
43
|
-
"web_search": "disabled"
|
|
44
|
-
}
|
|
40
|
+
"config": {}
|
|
45
41
|
},
|
|
46
42
|
{
|
|
47
43
|
"id": "deepseek",
|
|
48
44
|
"name": "DeepSeek",
|
|
49
45
|
"baseUrl": "https://api.deepseek.com/",
|
|
50
46
|
"keyUrl": "https://platform.deepseek.com/api_keys",
|
|
47
|
+
"webSearch": "deepseek",
|
|
51
48
|
"models": [
|
|
52
49
|
{
|
|
53
50
|
"id": "deepseek-flash",
|
|
@@ -56,9 +53,7 @@
|
|
|
56
53
|
}
|
|
57
54
|
],
|
|
58
55
|
"catalog": "deepseek/models.json",
|
|
59
|
-
"config": {
|
|
60
|
-
"web_search": "disabled"
|
|
61
|
-
}
|
|
56
|
+
"config": {}
|
|
62
57
|
},
|
|
63
58
|
{
|
|
64
59
|
"id": "openrouter",
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Eo,Ot,Ut,Bt,Gt}from"./chunk-x0h0g1ma.js";var a=[{id:"litellm",source:"account",name:"ALwith",models:[{id:"deepseek-V4.1-flash",label:"DS Flash"}],catalog:"alwith/models.json",config:{}},{id:"anthropic",name:"Anthropic",apiType:"anthropic",baseUrl:"https://api.anthropic.com",keyUrl:"https://platform.claude.com/settings/keys",models:[{id:"claude-opus-5-5",label:"Opus 5.5"},{id:"claude-sonnet-5-5",label:"Sonnet 5.5"},{id:"claude-haiku-5-5",label:"Haiku 5.5"},{id:"claude-fable-5-2",label:"Fable 5.2"}],catalog:"anthropic/models.json",config:{}},{id:"deepseek",name:"DeepSeek",baseUrl:"https://api.deepseek.com/",keyUrl:"https://platform.deepseek.com/api_keys",webSearch:"deepseek",models:[{id:"deepseek-flash",label:"Flash",description:"Latest frontier agentic coding model with image input."}],catalog:"deepseek/models.json",config:{}},{id:"openrouter",name:"OpenRouter",baseUrl:"https://openrouter.ai/api/v1",keyUrl:"https://openrouter.ai/keys",models:[{id:"moonshotai/kimi-k3",label:"Kimi K3"},{id:"minimax/minimax-m3",label:"MiniMax M3"},{id:"z-ai/glm-5.3",label:"GLM 5.3"},{id:"deepseek/deepseek-v4-pro",label:"DeepSeek V4 Pro"},{id:"qwen/qwen3.8-max-0902",label:"Qwen 3.8 Max"},{id:"x-ai/grok-4.6",label:"Grok 4.6"}],catalog:"openrouter/models.json"},{id:"qwen",name:"Qwen",regions:[{id:"intl",baseUrl:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",keyUrl:"https://modelstudio.console.alibabacloud.com/?tab=model#/api-key"},{id:"cn",baseUrl:"https://dashscope.aliyuncs.com/compatible-mode/v1",keyUrl:"https://bailian.console.aliyun.com/#/api-key"}],models:[{id:"qwen3.8-max",label:"3.8 Max"},{id:"qwen3.8-flash",label:"3.8 Flash"},{id:"qwen3.7-max",label:"3.7 Max"},{id:"qwen3.7-plus",label:"3.7 Plus"},{id:"qwen3.6-flash",label:"3.6 Flash"}],catalog:"qwen/models.json"},{id:"xai",name:"xAI",baseUrl:"https://api.x.ai/v1",keyUrl:"https://console.x.ai",models:[{id:"grok-4.6",label:"Grok 4.6"},{id:"grok-4.5",label:"Grok 4.5"},{id:"grok-4.3",label:"Grok 4.3"}],catalog:"xai/models.json"}];var l={models:[{slug:"glm-5.3",display_name:"GLM-5.3",description:"GLM-5.3 via the Responses API.",default_reasoning_level:"max",supported_reasoning_levels:[{effort:"low",description:"Low reasoning effort"},{effort:"high",description:"High reasoning effort"},{effort:"max",description:"Max reasoning effort"}],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text"],context_window:1e6,max_context_window:1e6,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"glm-5.3-flash",display_name:"GLM-5.3-Flash",description:"GLM-5.3-Flash via the Responses API.",default_reasoning_level:"max",supported_reasoning_levels:[{effort:"low",description:"Low reasoning effort"},{effort:"high",description:"High reasoning effort"},{effort:"max",description:"Max reasoning effort"}],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1e6,max_context_window:1e6,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"glm-5.2",display_name:"GLM-5.2",description:"GLM-5.2 via the Responses API.",default_reasoning_level:"max",supported_reasoning_levels:[{effort:"none",description:"Disable reasoning"},{effort:"high",description:"High reasoning effort"},{effort:"max",description:"Max reasoning effort"}],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text"],context_window:1e6,max_context_window:1e6,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"glm-5.1",display_name:"GLM-5.1",description:"GLM-5.1 via the Responses API.",default_reasoning_level:"high",supported_reasoning_levels:[],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text"],context_window:200000,max_context_window:200000,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"MiniMax-M3.1-Flash",display_name:"MiniMax M3.1 Flash",description:"MiniMax M3.1 Flash via the Responses API.",default_reasoning_level:"max",supported_reasoning_levels:[{effort:"low",description:"Low reasoning effort"},{effort:"medium",description:"Medium reasoning effort"},{effort:"high",description:"High reasoning effort"},{effort:"xhigh",description:"Xhigh reasoning effort"},{effort:"max",description:"Max reasoning effort"}],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1e6,max_context_window:1e6,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"MiniMax-M3",display_name:"MiniMax M3",description:"MiniMax M3 via the Responses API.",default_reasoning_level:"high",supported_reasoning_levels:[],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1e6,max_context_window:1e6,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"doubao-seed-evolving",display_name:"Doubao Seed Evolving",description:"Doubao Seed Evolving via the Responses API.",default_reasoning_level:"high",supported_reasoning_levels:[{effort:"minimal",description:"Disable reasoning"},{effort:"low",description:"Low reasoning effort"},{effort:"medium",description:"Medium reasoning effort"},{effort:"high",description:"High reasoning effort"}],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1024000,max_context_window:1024000,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"doubao-seed-2-1-pro-260915",display_name:"Doubao Seed 2.1 Pro",description:"Doubao Seed 2.1 Pro via the Responses API.",default_reasoning_level:"high",supported_reasoning_levels:[{effort:"minimal",description:"Disable reasoning"},{effort:"low",description:"Low reasoning effort"},{effort:"medium",description:"Medium reasoning effort"},{effort:"high",description:"High reasoning effort"}],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1024000,max_context_window:1024000,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"doubao-seed-2-1-lite-260915",display_name:"Doubao Seed 2.1 Lite",description:"Doubao Seed 2.1 Lite via the Responses API.",default_reasoning_level:"high",supported_reasoning_levels:[{effort:"minimal",description:"Disable reasoning"},{effort:"low",description:"Low reasoning effort"},{effort:"medium",description:"Medium reasoning effort"},{effort:"high",description:"High reasoning effort"}],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1024000,max_context_window:1024000,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"kimi-k3.1-pro",display_name:"Kimi K3.1 Pro",description:"Kimi K3.1 Pro via the Responses API.",default_reasoning_level:"max",supported_reasoning_levels:[{effort:"low",description:"Low reasoning effort"},{effort:"high",description:"High reasoning effort"},{effort:"max",description:"Max reasoning effort"}],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1048576,max_context_window:1048576,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"kimi-k3",display_name:"Kimi K3",description:"Kimi K3 via the Responses API.",default_reasoning_level:"max",supported_reasoning_levels:[{effort:"low",description:"Low reasoning effort"},{effort:"high",description:"High reasoning effort"},{effort:"max",description:"Max reasoning effort"}],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1048576,max_context_window:1048576,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"kimi-k2.7-code",display_name:"Kimi K2.7 Code",description:"Kimi K2.7 Code via the Responses API.",default_reasoning_level:"high",supported_reasoning_levels:[],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:262144,max_context_window:262144,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"mimo-v2.6-pro",display_name:"MiMo V2.6 Pro",description:"MiMo V2.6 Pro via the Responses API.",default_reasoning_level:"high",supported_reasoning_levels:[],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1048576,max_context_window:1048576,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"mimo-v2.6-flash",display_name:"MiMo V2.6 Flash",description:"MiMo V2.6 Flash via the Responses API.",default_reasoning_level:"high",supported_reasoning_levels:[],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1048576,max_context_window:1048576,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"doubao-seed-2.1-pro",display_name:"Doubao Seed 2.1 Pro",description:"Doubao Seed 2.1 Pro via the Responses API.",default_reasoning_level:"high",supported_reasoning_levels:[{effort:"minimal",description:"Disable reasoning"},{effort:"low",description:"Low reasoning effort"},{effort:"medium",description:"Medium reasoning effort"},{effort:"high",description:"High reasoning effort"}],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1024000,max_context_window:1024000,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"doubao-seed-2.1-lite",display_name:"Doubao Seed 2.1 Lite",description:"Doubao Seed 2.1 Lite via the Responses API.",default_reasoning_level:"high",supported_reasoning_levels:[{effort:"minimal",description:"Disable reasoning"},{effort:"low",description:"Low reasoning effort"},{effort:"medium",description:"Medium reasoning effort"},{effort:"high",description:"High reasoning effort"}],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1024000,max_context_window:1024000,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"}]};var p={"gateway:deepseek:deepseek-flash":{shortLabel:"Flash"},"gateway:litellm:deepseek-V4.1-flash":{shortLabel:"Flash",label:"DS Flash"}};var d=a,g={anthropic:Eo,deepseek:Ot,openrouter:Bt,qwen:Gt,xai:Ut};function m(e){let i=g[e];if(!i)throw Error(`Provider ${e} has no logo`);return i}var q=d.filter((e)=>e.source!=="account").map(({source:e,...i})=>({...i,logo:m(i.id)}));function No(e){return e!=null&&d.some((i)=>i.source==="account"&&e.startsWith(`gateway:${encodeURIComponent(i.id)}:`))}function Ye(e){let i=JSON.parse(e);if(!Array.isArray(i)||i.length===0)throw Error("Add at least one model");let o=new Set;return i.map((s)=>{if(typeof s!=="object"||s===null||Array.isArray(s))throw Error("Each model must be an object");let t=s,r=typeof t.label==="string"?t.label.trim():"",n=typeof t.api_id==="string"?t.api_id.trim():"";if(r===""||n==="")throw Error("Model label and API ID cannot be empty");if(o.has(n))throw Error("Model IDs must be unique");if(o.add(n),t.contextWindow!==void 0&&t.contextWindow!==null&&(!Number.isSafeInteger(t.contextWindow)||t.contextWindow<=0))throw Error("Model contextWindow must be a positive integer");if(t.description!==void 0&&typeof t.description!=="string")throw Error("Model description must be a string");return{label:r,api_id:n,...t.contextWindow===void 0?{}:{contextWindow:t.contextWindow},...t.description===void 0?{}:{description:t.description}}})}function Mo(e){return[...q.filter((i)=>e.providers[i.id]!==void 0).map((i)=>({id:i.id,name:i.name,models:i.models})),...[...e.customProviders,...e.managedProviders??[]].map((i)=>({id:i.id,name:i.name,models:i.models.map((o)=>({id:o.api_id,label:o.label,...o.description==null?{}:{description:o.description}}))}))]}function Xe(e,i){let o=e.startsWith("custom_")?`custom-${Array.from(new TextEncoder().encode(e),(s)=>s.toString(16).padStart(2,"0")).join("")}`:e;return`gateway:${encodeURIComponent(o)}:${encodeURIComponent(i)}`}function Yr(e,i){let o=Mo(i).flatMap((s)=>s.models.map((t)=>Xe(s.id,t.id)));if(e!==null&&(!e.startsWith("gateway:")||o.includes(e)))return e;if(No(e))throw Error("The selected ALwith account model is unavailable. Select another model before sending.");return o[0]??null}function X(e,i){if(!e.regions)return null;let o=e.regions.find((s)=>s.id===i)??e.regions[0];if(!o)throw Error(`Provider ${e.id} declares no regions`);return o}function Dt(e,i){return X(e,i)?.keyUrl??e.keyUrl??null}function Ht(e){if(typeof e==="object"&&e!==null&&"code"in e&&e.code==="pending")return!0;return(e instanceof Error?e.message:typeof e==="string"?e:typeof e==="object"&&e!==null&&("message"in e)?String(e.message):String(e)).includes("Provider settings are pending")}function Xr(e){let i=e?.match(/^gateway:custom-[^:]+:(.+)$/);if(!i)return null;let o=decodeURIComponent(i[1]),s=l.models.find((t)=>t.slug===o);return s?{value:s.default_reasoning_level,hidden:s.supported_reasoning_levels.length===0}:null}var Ao=p;function ea(e){return Ao[e]??{}}
|
|
2
|
+
export{q,No,Ye,Mo,Xe,Yr,X,Dt,Ht,Xr,Ao,ea};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e}from"./chunk-pwcw4zp2.js";import{zt,Vt}from"./chunk-9rf3qecr.js";import{Xe}from"./chunk-
|
|
1
|
+
import{e}from"./chunk-pwcw4zp2.js";import{zt,Vt}from"./chunk-9rf3qecr.js";import{Xe}from"./chunk-4h07zyxp.js";import{ChevronDownIcon as h}from"lucide-react";import{useId as x,useState as v}from"react";import{Button as b}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as A,CollapsibleContent as M,CollapsibleTrigger as I}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Input as N}from"@nyssance/shadcn/vega/components/ui/input";import{jsx as t,jsxs as i}from"react/jsx-runtime";function Wr({providers:n,store:l}){let{t:m}=e().host,d=zt(l);if(!n.some((s)=>s.models.length))return null;return i(A,{children:[i(I,{render:t(b,{variant:"ghost",size:"sm"}),children:[m("provider.managed.aliases"),t(h,{className:"size-4"})]}),i(M,{className:"space-y-3 pt-3",children:[t("p",{className:"text-muted-foreground text-xs",children:m("provider.managed.aliasHint")}),n.flatMap((s)=>s.models.map((o)=>{let a=Xe(s.id,o.api_id);return t(S,{id:a,label:o.label,modelId:o.api_id,alias:d[a]??"",store:l},a)}))]})]})}function S({id:n,label:l,modelId:m,alias:d,store:s}){let{host:o}=e(),a=x(),[C,c]=v(null),[p,f]=v(!1),u=C??d;async function y(){f(!0);try{await Vt(s,n,u),c(null)}catch(r){let g=r instanceof Error?r:Error(String(r));if(o.reportError)o.reportError(g);else console.error(g)}finally{f(!1)}}return i("form",{className:"space-y-1.5",onSubmit:(r)=>{if(r.preventDefault(),!p)y()},children:[t("label",{htmlFor:a,className:"text-sm font-medium",children:l}),t("p",{className:"text-muted-foreground text-xs break-all",children:m}),i("div",{className:"flex items-center gap-2",children:[t(N,{id:a,value:u,placeholder:l,maxLength:100,disabled:p,onChange:(r)=>c(r.target.value)}),t(b,{type:"submit",variant:"outline",size:"sm",disabled:p||u.trim()===d,children:o.t("provider.managed.saveAlias")})]})]})}
|
|
2
2
|
export{Wr};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e}from"./chunk-pwcw4zp2.js";import{Lt}from"./chunk-twx75z08.js";import{q,Ye,X,Dt}from"./chunk-h7ackcd4.js";import{At,Et}from"./chunk-bc6e3dhv.js";import{CardSendIcon as pe}from"@solar-icons/react/line-duotone/card-send";import{cn as J}from"cn";import{ChevronDownIcon as se,ExternalLinkIcon as ve,EyeIcon as ne,EyeOffIcon as oe,PlusIcon as ge,ServerIcon as ie,Trash2Icon as fe}from"lucide-react";import{useEffect as j,useRef as ye,useState as y}from"react";import{Button as R}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as re,CollapsibleContent as ae,CollapsibleTrigger as le}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Field as D,FieldDescription as de,FieldLabel as O}from"@nyssance/shadcn/vega/components/ui/field";import{Input as ee}from"@nyssance/shadcn/vega/components/ui/input";import{InputGroup as W,InputGroupAddon as ce,InputGroupButton as ue,InputGroupInput as H}from"@nyssance/shadcn/vega/components/ui/input-group";import{Select as be,SelectContent as he,SelectGroup as xe,SelectItem as Ne,SelectTrigger as Pe,SelectValue as Ce}from"@nyssance/shadcn/vega/components/ui/select";import{Separator as Q}from"@nyssance/shadcn/vega/components/ui/separator";import{Spinner as Y}from"@nyssance/shadcn/vega/components/ui/spinner";import{Textarea as we}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as t,jsxs as i,Fragment as Se}from"react/jsx-runtime";function V(s){if(s instanceof Error)return s.message;if(typeof s==="object"&&s!==null&&"message"in s)return String(s.message);return String(s)}function Z(){let{host:s}=e();return(d)=>{let u=d instanceof Error?d:Error(V(d));if(s.reportError)s.reportError(u);else console.error(u)}}function wo({refreshAccountProviders:s,openTopUp:d,group:u}){let{t:v}=e().host,C=Z(),[S,N]=y(0),[l,n]=y(null),[h,c]=y(!0),w=ye(s);return w.current=s,j(()=>{let b=()=>N((p)=>p+1);return window.addEventListener("focus",b),()=>window.removeEventListener("focus",b)},[]),j(()=>{let b=!0;return c(!0),w.current().then(()=>{if(b)n(null),c(!1)},(p)=>{if(b)n(V(p)),c(!1)}),()=>{b=!1}},[S]),t(u,{children:i("div",{className:"space-y-3 rounded-xl border p-4",children:[i("div",{className:"flex items-center justify-between gap-3",children:[t("h3",{className:"text-sm font-medium",children:"ALwith"}),d&&t(R,{variant:"ghost",size:"icon-sm",className:"text-primary hover:text-primary/80","aria-label":v("provider.managed.topUp"),title:v("provider.managed.topUp"),onClick:()=>{d().catch(C)},children:t(pe,{className:"size-4","aria-hidden":"true"})})]}),t("p",{className:"text-muted-foreground text-xs",children:v("provider.managed.description")}),l!==null&&i("div",{className:"space-y-2",children:[t("p",{role:"alert",className:"text-destructive text-xs",children:l}),i(R,{variant:"outline",size:"sm",disabled:h,onClick:()=>N((b)=>b+1),children:[h&&t(Y,{"aria-hidden":"true"}),v("provider.retry")]})]})]})})}function $r({port:s,bridge:d,group:u,label:v,refreshAccountProviders:C,openTopUp:S}){let{host:N}=e(),{t:l}=N,n=Z(),h=(o)=>N.notify?.(o),c=Et(s,n),w=c?.providers??{},[b,p]=y(null),[x,k]=y(q[0]?.id??""),[F,B]=y(0),[U,A]=y({}),_=async(o,r,f)=>{p(r.id);try{let a=await s.save(o,r.id,f);if(!a.error)A((M)=>{let L={...M};return delete L[r.id],L});if(a.error)n(a.error);if(!a.error)h(l(a.status==="pending"?"provider.pending":f===null?"provider.removed":"provider.saved",{name:r.name}));return a}catch(a){return n(a),null}finally{p(null)}},I=async(o)=>{p(o);try{let r=await s.test(o);if(A((f)=>({...f,[o]:r})),r.ok)h(l("provider.testSuccess",{latency:r.latencyMs??0}));else n(`${l(`provider.testErrors.${r.code}`)}${r.message?`: ${r.message}`:""}`)}catch(r){n(r)}finally{p(null)}},T=async(o,r)=>{p(r.id);try{let f=await s.saveCustom(o,r);if(f.error)n(f.error);else A((a)=>{let M={...a};return delete M[r.id],M}),h(l(f.status==="pending"?"provider.pending":"provider.saved",{name:r.name}));return!f.error}catch(f){return n(f),!1}finally{p(null)}},z=async(o)=>{if(!c)return;p(o.id);try{let r=await s.removeCustom(c.revision,o.id);if(r.error)n(r.error);else k(q[0]?.id??""),h(l(r.status==="pending"?"provider.pending":"provider.removed",{name:o.name}))}catch(r){n(r)}finally{p(null)}},K=async()=>{p("retry");try{let o=await At(s);if(o.error)n(o.error);else if(o.status==="pending")h(l("provider.pending"))}catch(o){n(o)}finally{p(null)}},P=q.find((o)=>o.id===x)??null,E=c?.customProviders.find((o)=>o.id===x)??null;return j(()=>{if(!c||x==="new"||P||E)return;k(q[0]?.id??"")},[c,x,P,E]),i("div",{className:"flex flex-col gap-6",children:[i(u,{children:[t(v,{children:"Codex"}),t(Lt,{bridge:d})]}),C&&t(wo,{refreshAccountProviders:C,openTopUp:S,group:u}),c?.status==="pending"&&t("p",{className:"text-muted-foreground text-sm",children:l("provider.pending")}),c?.error&&t("p",{className:"text-destructive text-sm",children:c.error}),c&&c.status!=="applied"&&t(R,{variant:"outline",className:"self-start",disabled:b!==null,onClick:()=>void K(),children:l("provider.retry")}),t(u,{children:c&&i(Se,{children:[t(ko,{activeId:x,keys:w,customProviders:c.customProviders,onSelect:k,onAdd:()=>k("new"),label:v}),q.map((o)=>t("div",{hidden:x!==o.id,children:t(_o,{provider:o,saved:w[o.id]??null,revision:c.revision,busy:b!==null,onSave:(r,f)=>_(r,o,f),testResult:U[o.id],onTest:()=>I(o.id)})},o.id)),c.customProviders.map((o)=>t("div",{hidden:x!==o.id,children:t(Sn,{provider:o,revision:c.revision,busy:b!==null,testResult:U[o.id],onTest:()=>I(o.id),onRemove:()=>z(o),onSaved:k,onSave:T})},o.id)),t("div",{hidden:x!=="new",children:t(Sn,{provider:null,revision:c.revision,busy:b!==null,onSaved:(o)=>{B((r)=>r+1),k(o)},onSave:T},F)})]})})]})}function ko({activeId:s,keys:d,customProviders:u,onSelect:v,onAdd:C,label:S}){let{t:N}=e().host;return i("div",{children:[t(S,{children:N("provider.label")}),i("div",{className:"grid grid-cols-2 gap-2 py-4 sm:grid-cols-3",children:[q.map((l)=>{let n=l.logo,h=d[l.id]!==void 0;return t(te,{id:l.id,name:l.name,active:s===l.id,configured:h,icon:t(n,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)}),u.map((l)=>t(te,{id:l.id,name:l.name,active:s===l.id,configured:!0,icon:t(ie,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)),i(R,{type:"button",variant:"outline","aria-pressed":s==="new",onClick:C,className:J("h-9 w-full justify-start gap-2 rounded-full px-4",s==="new"&&"bg-accent"),children:[t(ge,{className:"size-4 shrink-0"}),t("span",{className:"truncate",children:N("provider.customButton")})]})]})]})}function te({id:s,name:d,active:u,configured:v,icon:C,onClick:S}){return i(R,{type:"button",variant:"outline","aria-label":d,"aria-pressed":u,onClick:S,className:J("h-9 w-full gap-2 rounded-full px-4",u&&"bg-accent"),children:[C,t("span",{className:"min-w-0 flex-1 truncate text-center",children:d}),t("span",{"data-testid":`${s}-status`,"data-configured":v,"aria-hidden":"true",className:J("size-2 shrink-0 rounded-full",v?"bg-green-500":"bg-muted-foreground/30")})]})}function So({result:s}){let{t:d}=e().host;return t("p",{role:"status",className:s.ok?"text-muted-foreground text-xs":"text-destructive text-xs",children:s.ok?d("provider.testSuccess",{latency:s.latencyMs??0}):`${d(`provider.testErrors.${s.code}`)}${s.status?` (HTTP ${s.status})`:""}`})}function me({busy:s,canTest:d,onTest:u,onRemove:v,result:C,children:S}){let{t:N}=e().host;return i("div",{className:"space-y-3 border-t pt-4",children:[C&&t(So,{result:C}),u&&t("p",{className:"text-muted-foreground text-xs leading-relaxed",children:N("provider.testDescription")}),i("div",{className:"flex flex-wrap items-center gap-2",children:[v&&i(R,{size:"sm",variant:"destructive",className:"font-normal",disabled:s,onClick:v,children:[t(fe,{className:"size-4"}),N("provider.remove")]}),i("div",{className:"ms-auto flex flex-wrap items-center gap-2",children:[u&&t(R,{size:"sm",variant:"outline",disabled:s||!d,onClick:u,children:N("provider.testButton")}),S]})]})]})}function _o({provider:s,saved:d,revision:u,busy:v,onSave:C,testResult:S,onTest:N}){let{host:l}=e(),{t:n}=l,h=Z(),[c,w]=y(""),[b,p]=y(!1),[x,k]=y({saved:d,revision:u}),[F,B]=y(X(s,d?.region)?.id),[U,A]=y(d?.base_url??""),_=s.logo,I=d!==null,T=c.trim(),z=Dt(s,F),K=F!==X(s,x.saved?.region)?.id,P=U.trim()!==(x.saved?.base_url??"");j(()=>{if(u>x.revision&&T===""&&!K&&!P)k({saved:d,revision:u}),B(X(s,d?.region)?.id),A(d?.base_url??"")},[u,d,s,x.revision,T,K,P]);let E=!v&&(T!==""||K||P),o=`${s.id}-api-key`,r=async(a)=>{let M=c,L=F,m=await C(x.revision,a);if(!m)return;let G=m.providers[s.id]??null;k({saved:G,revision:m.revision}),w((g)=>g===M?"":g),B((g)=>g===L?X(s,G?.region)?.id:g),A((g)=>g===U?G?.base_url??"":g)},f=()=>{if(T===""&&x.saved===null)return;r({...T===""?{}:{apiKey:T},...F===void 0?{}:{region:F},...P?{baseUrl:U.trim()}:{}})};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex flex-wrap items-center gap-3",children:[t(_,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium",children:s.name}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:I?n("provider.active",{name:s.name,count:s.models.length}):n("provider.inactive")})]}),s.regions&&i(be,{value:F,onValueChange:(a)=>B(a??s.regions?.[0]?.id),children:[t(Pe,{className:"w-32","aria-label":n("provider.region"),children:t(Ce,{})}),t(he,{align:"start",alignItemWithTrigger:!1,sideOffset:6,className:"max-w-(--available-width) min-w-0 p-1",children:t(xe,{children:s.regions.map((a)=>t(Ne,{value:a.id,children:n(`provider.regions.${a.id}`)},a.id))})})]})]}),t(Q,{}),i("section",{className:"space-y-4","aria-labelledby":`${s.id}-connection`,children:[t("h4",{id:`${s.id}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(D,{className:"gap-2",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t(O,{htmlFor:o,children:n("provider.apiKey")}),z!==null&&i(R,{type:"button",variant:"link",size:"sm",className:"text-muted-foreground h-auto p-0 text-xs",onClick:()=>{try{l.openLink(z)}catch(a){h(a)}},children:[n("provider.getKey",{name:s.name}),t(ve,{className:"size-3","aria-hidden":"true"})]})]}),i(W,{children:[t(H,{id:o,type:b?"text":"password",autoComplete:"off",spellCheck:!1,placeholder:I?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:c,onChange:(a)=>w(a.target.value),onKeyDown:(a)=>{if(a.key==="Enter"&&E)f()}}),t(ce,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(b?"provider.hideKey":"provider.showKey"),onClick:()=>p((a)=>!a),children:b?t(ne,{}):t(oe,{})})})]})]}),i(re,{className:"space-y-2",children:[i(le,{render:t(R,{variant:"ghost",size:"sm",className:"group px-2.5"}),children:[n("provider.baseUrl"),t(se,{className:"size-4 transition-transform group-aria-expanded:rotate-180","aria-hidden":"true"})]}),t(ae,{children:i(D,{className:"gap-2",children:[t(O,{htmlFor:`${s.id}-base-url`,className:"sr-only",children:n("provider.baseUrl")}),t(W,{children:t(H,{id:`${s.id}-base-url`,type:"url",spellCheck:!1,placeholder:X(s,F)?.baseUrl??s.baseUrl,value:U,onChange:(a)=>A(a.target.value)})}),t(de,{className:"text-xs",children:n("provider.baseUrlDescription")})]})})]})]}),t(me,{busy:v,canTest:!E,onTest:I?N:void 0,onRemove:I?()=>void r(null):void 0,result:!E?S:void 0,children:i(R,{size:"sm",disabled:!E,onClick:f,children:[v&&t(Y,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}function Sn({provider:s,revision:d,busy:u,testResult:v,onTest:C,onRemove:S,onSaved:N,onSave:l}){let{t:n}=e().host,[h,c]=y(s?.name??""),[w,b]=y(s?.baseUrl??""),[p,x]=y(""),[k,F]=y(!1),[B,U]=y(s===null),[A,_]=y(s?.models??[]),[I,T]=y(s?JSON.stringify(s.models,null,2):`[
|
|
1
|
+
import{e}from"./chunk-pwcw4zp2.js";import{Lt}from"./chunk-twx75z08.js";import{q,Ye,X,Dt}from"./chunk-4h07zyxp.js";import{At,Et}from"./chunk-zah37d5q.js";import{CardSendIcon as pe}from"@solar-icons/react/line-duotone/card-send";import{cn as J}from"cn";import{ChevronDownIcon as se,ExternalLinkIcon as ve,EyeIcon as ne,EyeOffIcon as oe,PlusIcon as ge,ServerIcon as ie,Trash2Icon as fe}from"lucide-react";import{useEffect as j,useRef as ye,useState as y}from"react";import{Button as R}from"@nyssance/shadcn/vega/components/ui/button";import{Collapsible as re,CollapsibleContent as ae,CollapsibleTrigger as le}from"@nyssance/shadcn/vega/components/ui/collapsible";import{Field as D,FieldDescription as de,FieldLabel as O}from"@nyssance/shadcn/vega/components/ui/field";import{Input as ee}from"@nyssance/shadcn/vega/components/ui/input";import{InputGroup as W,InputGroupAddon as ce,InputGroupButton as ue,InputGroupInput as H}from"@nyssance/shadcn/vega/components/ui/input-group";import{Select as be,SelectContent as he,SelectGroup as xe,SelectItem as Ne,SelectTrigger as Pe,SelectValue as Ce}from"@nyssance/shadcn/vega/components/ui/select";import{Separator as Q}from"@nyssance/shadcn/vega/components/ui/separator";import{Spinner as Y}from"@nyssance/shadcn/vega/components/ui/spinner";import{Textarea as we}from"@nyssance/shadcn/vega/components/ui/textarea";import{jsx as t,jsxs as i,Fragment as Se}from"react/jsx-runtime";function V(s){if(s instanceof Error)return s.message;if(typeof s==="object"&&s!==null&&"message"in s)return String(s.message);return String(s)}function Z(){let{host:s}=e();return(d)=>{let u=d instanceof Error?d:Error(V(d));if(s.reportError)s.reportError(u);else console.error(u)}}function wo({refreshAccountProviders:s,openTopUp:d,group:u}){let{t:v}=e().host,C=Z(),[S,N]=y(0),[l,n]=y(null),[h,c]=y(!0),w=ye(s);return w.current=s,j(()=>{let b=()=>N((p)=>p+1);return window.addEventListener("focus",b),()=>window.removeEventListener("focus",b)},[]),j(()=>{let b=!0;return c(!0),w.current().then(()=>{if(b)n(null),c(!1)},(p)=>{if(b)n(V(p)),c(!1)}),()=>{b=!1}},[S]),t(u,{children:i("div",{className:"space-y-3 rounded-xl border p-4",children:[i("div",{className:"flex items-center justify-between gap-3",children:[t("h3",{className:"text-sm font-medium",children:"ALwith"}),d&&t(R,{variant:"ghost",size:"icon-sm",className:"text-primary hover:text-primary/80","aria-label":v("provider.managed.topUp"),title:v("provider.managed.topUp"),onClick:()=>{d().catch(C)},children:t(pe,{className:"size-4","aria-hidden":"true"})})]}),t("p",{className:"text-muted-foreground text-xs",children:v("provider.managed.description")}),l!==null&&i("div",{className:"space-y-2",children:[t("p",{role:"alert",className:"text-destructive text-xs",children:l}),i(R,{variant:"outline",size:"sm",disabled:h,onClick:()=>N((b)=>b+1),children:[h&&t(Y,{"aria-hidden":"true"}),v("provider.retry")]})]})]})})}function $r({port:s,bridge:d,group:u,label:v,refreshAccountProviders:C,openTopUp:S}){let{host:N}=e(),{t:l}=N,n=Z(),h=(o)=>N.notify?.(o),c=Et(s,n),w=c?.providers??{},[b,p]=y(null),[x,k]=y(q[0]?.id??""),[F,B]=y(0),[U,A]=y({}),_=async(o,r,f)=>{p(r.id);try{let a=await s.save(o,r.id,f);if(!a.error)A((M)=>{let L={...M};return delete L[r.id],L});if(a.error)n(a.error);if(!a.error)h(l(a.status==="pending"?"provider.pending":f===null?"provider.removed":"provider.saved",{name:r.name}));return a}catch(a){return n(a),null}finally{p(null)}},I=async(o)=>{p(o);try{let r=await s.test(o);if(A((f)=>({...f,[o]:r})),r.ok)h(l("provider.testSuccess",{latency:r.latencyMs??0}));else n(`${l(`provider.testErrors.${r.code}`)}${r.message?`: ${r.message}`:""}`)}catch(r){n(r)}finally{p(null)}},T=async(o,r)=>{p(r.id);try{let f=await s.saveCustom(o,r);if(f.error)n(f.error);else A((a)=>{let M={...a};return delete M[r.id],M}),h(l(f.status==="pending"?"provider.pending":"provider.saved",{name:r.name}));return!f.error}catch(f){return n(f),!1}finally{p(null)}},z=async(o)=>{if(!c)return;p(o.id);try{let r=await s.removeCustom(c.revision,o.id);if(r.error)n(r.error);else k(q[0]?.id??""),h(l(r.status==="pending"?"provider.pending":"provider.removed",{name:o.name}))}catch(r){n(r)}finally{p(null)}},K=async()=>{p("retry");try{let o=await At(s);if(o.error)n(o.error);else if(o.status==="pending")h(l("provider.pending"))}catch(o){n(o)}finally{p(null)}},P=q.find((o)=>o.id===x)??null,E=c?.customProviders.find((o)=>o.id===x)??null;return j(()=>{if(!c||x==="new"||P||E)return;k(q[0]?.id??"")},[c,x,P,E]),i("div",{className:"flex flex-col gap-6",children:[i(u,{children:[t(v,{children:"Codex"}),t(Lt,{bridge:d})]}),C&&t(wo,{refreshAccountProviders:C,openTopUp:S,group:u}),c?.status==="pending"&&t("p",{className:"text-muted-foreground text-sm",children:l("provider.pending")}),c?.error&&t("p",{className:"text-destructive text-sm",children:c.error}),c&&c.status!=="applied"&&t(R,{variant:"outline",className:"self-start",disabled:b!==null,onClick:()=>void K(),children:l("provider.retry")}),t(u,{children:c&&i(Se,{children:[t(ko,{activeId:x,keys:w,customProviders:c.customProviders,onSelect:k,onAdd:()=>k("new"),label:v}),q.map((o)=>t("div",{hidden:x!==o.id,children:t(_o,{provider:o,saved:w[o.id]??null,revision:c.revision,busy:b!==null,onSave:(r,f)=>_(r,o,f),testResult:U[o.id],onTest:()=>I(o.id)})},o.id)),c.customProviders.map((o)=>t("div",{hidden:x!==o.id,children:t(Sn,{provider:o,revision:c.revision,busy:b!==null,testResult:U[o.id],onTest:()=>I(o.id),onRemove:()=>z(o),onSaved:k,onSave:T})},o.id)),t("div",{hidden:x!=="new",children:t(Sn,{provider:null,revision:c.revision,busy:b!==null,onSaved:(o)=>{B((r)=>r+1),k(o)},onSave:T},F)})]})})]})}function ko({activeId:s,keys:d,customProviders:u,onSelect:v,onAdd:C,label:S}){let{t:N}=e().host;return i("div",{children:[t(S,{children:N("provider.label")}),i("div",{className:"grid grid-cols-2 gap-2 py-4 sm:grid-cols-3",children:[q.map((l)=>{let n=l.logo,h=d[l.id]!==void 0;return t(te,{id:l.id,name:l.name,active:s===l.id,configured:h,icon:t(n,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)}),u.map((l)=>t(te,{id:l.id,name:l.name,active:s===l.id,configured:!0,icon:t(ie,{className:"size-5 shrink-0"}),onClick:()=>v(l.id)},l.id)),i(R,{type:"button",variant:"outline","aria-pressed":s==="new",onClick:C,className:J("h-9 w-full justify-start gap-2 rounded-full px-4",s==="new"&&"bg-accent"),children:[t(ge,{className:"size-4 shrink-0"}),t("span",{className:"truncate",children:N("provider.customButton")})]})]})]})}function te({id:s,name:d,active:u,configured:v,icon:C,onClick:S}){return i(R,{type:"button",variant:"outline","aria-label":d,"aria-pressed":u,onClick:S,className:J("h-9 w-full gap-2 rounded-full px-4",u&&"bg-accent"),children:[C,t("span",{className:"min-w-0 flex-1 truncate text-center",children:d}),t("span",{"data-testid":`${s}-status`,"data-configured":v,"aria-hidden":"true",className:J("size-2 shrink-0 rounded-full",v?"bg-green-500":"bg-muted-foreground/30")})]})}function So({result:s}){let{t:d}=e().host;return t("p",{role:"status",className:s.ok?"text-muted-foreground text-xs":"text-destructive text-xs",children:s.ok?d("provider.testSuccess",{latency:s.latencyMs??0}):`${d(`provider.testErrors.${s.code}`)}${s.status?` (HTTP ${s.status})`:""}`})}function me({busy:s,canTest:d,onTest:u,onRemove:v,result:C,children:S}){let{t:N}=e().host;return i("div",{className:"space-y-3 border-t pt-4",children:[C&&t(So,{result:C}),u&&t("p",{className:"text-muted-foreground text-xs leading-relaxed",children:N("provider.testDescription")}),i("div",{className:"flex flex-wrap items-center gap-2",children:[v&&i(R,{size:"sm",variant:"destructive",className:"font-normal",disabled:s,onClick:v,children:[t(fe,{className:"size-4"}),N("provider.remove")]}),i("div",{className:"ms-auto flex flex-wrap items-center gap-2",children:[u&&t(R,{size:"sm",variant:"outline",disabled:s||!d,onClick:u,children:N("provider.testButton")}),S]})]})]})}function _o({provider:s,saved:d,revision:u,busy:v,onSave:C,testResult:S,onTest:N}){let{host:l}=e(),{t:n}=l,h=Z(),[c,w]=y(""),[b,p]=y(!1),[x,k]=y({saved:d,revision:u}),[F,B]=y(X(s,d?.region)?.id),[U,A]=y(d?.base_url??""),_=s.logo,I=d!==null,T=c.trim(),z=Dt(s,F),K=F!==X(s,x.saved?.region)?.id,P=U.trim()!==(x.saved?.base_url??"");j(()=>{if(u>x.revision&&T===""&&!K&&!P)k({saved:d,revision:u}),B(X(s,d?.region)?.id),A(d?.base_url??"")},[u,d,s,x.revision,T,K,P]);let E=!v&&(T!==""||K||P),o=`${s.id}-api-key`,r=async(a)=>{let M=c,L=F,m=await C(x.revision,a);if(!m)return;let G=m.providers[s.id]??null;k({saved:G,revision:m.revision}),w((g)=>g===M?"":g),B((g)=>g===L?X(s,G?.region)?.id:g),A((g)=>g===U?G?.base_url??"":g)},f=()=>{if(T===""&&x.saved===null)return;r({...T===""?{}:{apiKey:T},...F===void 0?{}:{region:F},...P?{baseUrl:U.trim()}:{}})};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex flex-wrap items-center gap-3",children:[t(_,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium",children:s.name}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:I?n("provider.active",{name:s.name,count:s.models.length}):n("provider.inactive")})]}),s.regions&&i(be,{value:F,onValueChange:(a)=>B(a??s.regions?.[0]?.id),children:[t(Pe,{className:"w-32","aria-label":n("provider.region"),children:t(Ce,{})}),t(he,{align:"start",alignItemWithTrigger:!1,sideOffset:6,className:"max-w-(--available-width) min-w-0 p-1",children:t(xe,{children:s.regions.map((a)=>t(Ne,{value:a.id,children:n(`provider.regions.${a.id}`)},a.id))})})]})]}),t(Q,{}),i("section",{className:"space-y-4","aria-labelledby":`${s.id}-connection`,children:[t("h4",{id:`${s.id}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(D,{className:"gap-2",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t(O,{htmlFor:o,children:n("provider.apiKey")}),z!==null&&i(R,{type:"button",variant:"link",size:"sm",className:"text-muted-foreground h-auto p-0 text-xs",onClick:()=>{try{l.openLink(z)}catch(a){h(a)}},children:[n("provider.getKey",{name:s.name}),t(ve,{className:"size-3","aria-hidden":"true"})]})]}),i(W,{children:[t(H,{id:o,type:b?"text":"password",autoComplete:"off",spellCheck:!1,placeholder:I?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:c,onChange:(a)=>w(a.target.value),onKeyDown:(a)=>{if(a.key==="Enter"&&E)f()}}),t(ce,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(b?"provider.hideKey":"provider.showKey"),onClick:()=>p((a)=>!a),children:b?t(ne,{}):t(oe,{})})})]})]}),i(re,{className:"space-y-2",children:[i(le,{render:t(R,{variant:"ghost",size:"sm",className:"group px-2.5"}),children:[n("provider.baseUrl"),t(se,{className:"size-4 transition-transform group-aria-expanded:rotate-180","aria-hidden":"true"})]}),t(ae,{children:i(D,{className:"gap-2",children:[t(O,{htmlFor:`${s.id}-base-url`,className:"sr-only",children:n("provider.baseUrl")}),t(W,{children:t(H,{id:`${s.id}-base-url`,type:"url",spellCheck:!1,placeholder:X(s,F)?.baseUrl??s.baseUrl,value:U,onChange:(a)=>A(a.target.value)})}),t(de,{className:"text-xs",children:n("provider.baseUrlDescription")})]})})]})]}),t(me,{busy:v,canTest:!E,onTest:I?N:void 0,onRemove:I?()=>void r(null):void 0,result:!E?S:void 0,children:i(R,{size:"sm",disabled:!E,onClick:f,children:[v&&t(Y,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}function Sn({provider:s,revision:d,busy:u,testResult:v,onTest:C,onRemove:S,onSaved:N,onSave:l}){let{t:n}=e().host,[h,c]=y(s?.name??""),[w,b]=y(s?.baseUrl??""),[p,x]=y(""),[k,F]=y(!1),[B,U]=y(s===null),[A,_]=y(s?.models??[]),[I,T]=y(s?JSON.stringify(s.models,null,2):`[
|
|
2
2
|
{ "label": "My Model", "api_id": "model-id" }
|
|
3
3
|
]`),[z,K]=y(null),[P]=y(()=>s?.id??`custom_${crypto.randomUUID().replaceAll("-","")}`),E=`${P}-name`,o=`${P}-base-url`,r=`${P}-api-key`,f=`${P}-models`,a=h.trim()!==s?.name||w.trim()!==s.baseUrl||p.trim()!==""||I!==JSON.stringify(s.models,null,2),M=(m)=>{if(!m)try{_(Ye(I)),K(null)}catch(G){K(V(G));return}U(m)},L=async()=>{let m;try{m=Ye(I),K(null)}catch(g){K(V(g)),U(!0);return}if(await l(d,{id:P,name:h.trim(),baseUrl:w.trim(),models:m,...p.trim()===""?{}:{apiKey:p.trim()}}))c((g)=>g===h?h.trim():g),b((g)=>g===w?w.trim():g),x((g)=>g===p?"":g),T((g)=>g===I?JSON.stringify(m,null,2):g),N(P)};return i("div",{className:"space-y-5 rounded-xl border p-4",children:[i("div",{className:"flex items-center gap-3",children:[t(ie,{className:"size-6 shrink-0"}),i("div",{className:"min-w-0 flex-1",children:[t("h3",{className:"text-sm font-medium break-words",children:s?.name||n("provider.addCustom")}),t("div",{className:"text-muted-foreground mt-0.5 text-xs",children:n("provider.customDescription")})]}),s&&t("span",{className:"text-muted-foreground shrink-0 text-xs",children:n("provider.configured")})]}),t(Q,{}),i("section",{className:"space-y-4","aria-labelledby":`${P}-connection`,children:[t("h4",{id:`${P}-connection`,className:"text-sm font-medium",children:n("provider.connectionSettings")}),i(D,{className:"gap-2",children:[t(O,{htmlFor:E,children:n("provider.name")}),t(ee,{id:E,value:h,onChange:(m)=>c(m.target.value)})]}),i(D,{className:"gap-2",children:[t(O,{htmlFor:o,children:n("provider.baseUrl")}),t(ee,{id:o,type:"url",placeholder:"https://.../v1",value:w,onChange:(m)=>b(m.target.value)})]}),i(D,{className:"gap-2",children:[t(O,{htmlFor:r,children:n("provider.apiKey")}),i(W,{children:[t(H,{id:r,type:k?"text":"password",autoComplete:"off",placeholder:s?n("provider.apiKeyKept"):n("provider.apiKeyPlaceholder"),value:p,onChange:(m)=>x(m.target.value)}),t(ce,{align:"inline-end",children:t(ue,{size:"icon-xs","aria-label":n(k?"provider.hideKey":"provider.showKey"),onClick:()=>F((m)=>!m),children:k?t(ne,{}):t(oe,{})})})]})]})]}),t(Q,{}),i(re,{open:B,onOpenChange:M,className:"space-y-3",children:[i("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[t("h4",{className:"text-sm font-medium",children:n("provider.models")}),i(le,{render:t(R,{variant:"ghost",size:"sm"}),children:[n(B?"provider.previewModels":"provider.editModels"),t(se,{className:J("size-4",B&&"rotate-180")})]})]}),!B&&t("ul",{className:"bg-muted/40 divide-y rounded-lg px-3",children:A.map((m)=>i("li",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 py-2.5 text-sm",children:[t("span",{className:"break-all",children:m.label}),t("span",{className:"text-muted-foreground font-mono text-xs break-all",children:m.api_id})]},m.api_id))}),t(ae,{children:i(D,{className:"gap-2","data-invalid":z!==null,children:[t(O,{htmlFor:f,children:n("provider.modelsJson")}),t(we,{id:f,"aria-invalid":z!==null,"aria-describedby":`${f}-description`,spellCheck:!1,className:"min-h-44 font-mono text-xs",value:I,onChange:(m)=>{T(m.target.value),K(null)}}),t(de,{id:`${f}-description`,className:J("text-xs",z&&"text-destructive"),role:z?"alert":void 0,children:z??n("provider.modelsJsonDescription")})]})})]}),t(me,{busy:u,canTest:!a,onTest:s?C:void 0,onRemove:s?S:void 0,result:!a?v:void 0,children:i(R,{size:"sm",disabled:u||!a||h.trim()===""||w.trim()===""||!s&&p.trim()==="",onClick:()=>void L(),children:[u&&t(Y,{"data-icon":"inline-start"}),n("provider.saveButton")]})})]})}
|
|
4
4
|
export{wo,$r,ko,So,_o,Sn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{P,_n}from"./chunk-z7ehwkcq.js";import{Ht}from"./chunk-
|
|
1
|
+
import{P,_n}from"./chunk-z7ehwkcq.js";import{Ht}from"./chunk-4h07zyxp.js";import{useEffect as p,useRef as u,useState as m}from"react";var Po="providers:changed",Io="providers:managed-revoked",i=(e)=>e;function Kr(){return{read:()=>i(P.providersRead()),save:(e,r,t)=>i(P.providersSave({providerId:r,input:t,expectedRevision:e})),saveCustom:(e,r)=>i(P.providersSaveCustom({input:r,expectedRevision:e})),removeCustom:(e,r)=>i(P.providersRemoveCustom({providerId:r,expectedRevision:e})),test:(e)=>P.providersTest({providerId:e}),apply:()=>i(P.providersApply()),onChanged:(e)=>_n[Po].listen((r)=>e(r.payload))}}function qr(){return{bind:(e)=>P.providersAccountBind({account:e}),refresh:(e,r)=>i(P.providersRefreshManaged({generation:e,accessToken:r})),clear:async()=>{await P.providersClearManaged()},onRevoked:(e)=>_n[Io].listen((r)=>e(r.payload.sessionIds))}}async function At(e){try{return await e.apply()}catch(r){if(!Ht(r))throw r;return e.read()}}function Et(e,r=console.error){let[t,d]=m(null),a=u(r);return a.current=r,p(()=>{let n=!0,v=e.onChanged((o)=>{if(n)d((s)=>s&&s.revision>o.revision?s:o)});return v.then(()=>e.read()).then((o)=>{if(n)d((s)=>s&&s.revision>=o.revision?s:o)}).catch((o)=>{if(n)a.current(o)}),()=>{n=!1,v.then((o)=>o())}},[e]),t}
|
|
2
2
|
export{Po,Io,Kr,qr,At,Et};
|
|
@@ -1,72 +1,73 @@
|
|
|
1
|
-
function
|
|
2
|
-
]`).replace("lheading",
|
|
1
|
+
function ne(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var I=ne();function ye(t){I=t}var T={exec:()=>null};function B(t){let e=[];return(r)=>{let s=Math.max(0,Math.min(3,r-1)),n=e[s];return n||(n=t(s),e[s]=n),n}}function d(t,e=""){let r=typeof t=="string"?t:t.source,s={replace:(n,a)=>{let i=typeof a=="string"?a:a.source;return i=i.replace(F.caret,"$1"),r=r.replace(n,i),s},getRegex:()=>new RegExp(r,e)};return s}var ze=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),F={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,listInterruptsParagraph:/^ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+)[ \t]*)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,blockquoteMarkerWhitespace:/^( {0,3}>)([ \t]+)/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\][ \t]+\S/,listReplaceTask:/^\[[ xX]\][ \t]+/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:(t)=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:B((t)=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:B((t)=>new RegExp(`^ {0,${t}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:B((t)=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:B((t)=>new RegExp(`^ {0,${t}}#{1,6}(?:\\s|$)`)),pedanticHeadingBeginRegex:B((t)=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:B((t)=>new RegExp(`^ {0,${t}}(?:</?(?:${N})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,"i")),blockquoteBeginRegex:B((t)=>new RegExp(`^ {0,${t}}>`)),nestedContainerMarkers:/^(?: {0,3}(?:(?:[*+-]|\d{1,9}[.)])[ \t]+|>[ \t]?))+/},Ge=/^(?:[ \t]*(?:\n|$))+/,Ue=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ke=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}(?:(?=`)\1`*|(?=~)\1~*) *(?=\n|$)|$)/,Q=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Je=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ie=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Re=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+)[ \t]*(?:\n+|$)/,Se=d(Re).replace(/bull/g,ie).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ve=d(Re).replace(/bull/g,ie).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ae=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Ye=/^[^\n]+/,le=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\\n]|\n(?![ \t]*\n))+/,et=d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",le).replace("title",/(?:"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\\n]|\n(?!\n))*'|\((?:\\[\s\S]|[^()\\])*\))/).getRegex(),tt=d(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,ie).getRegex(),N="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ue=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,rt=d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?:[ \\t]+|\\n|/?>|$)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",ue).replace("tag",N).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Be=(t)=>d(ae).replace("hr",Q).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",N).getRegex(),st=Be(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),nt=Be(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),it=d(/^( {0,3}> ?(?:(?![ \t]*(?:\n|$))(paragraph)|[^\n]*)(?:\n|$))+/).replace("paragraph",nt).getRegex(),oe={blockquote:it,code:Ue,def:et,fences:Ke,heading:Je,hr:Q,html:rt,lheading:Se,list:tt,newline:Ge,paragraph:st,table:T,text:Ye},De=d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Q).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",N).getRegex(),at={...oe,lheading:Ve,table:De,paragraph:d(ae).replace("hr",Q).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",De).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html"," {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag",N).getRegex()},lt={...oe,html:d(`^ *(?:comment(?: *\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1>(?: *\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?>(?: *\\n{2,}|\\s*$))`).replace("comment",ue).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:T,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:d(ae).replace("hr",Q).replace("heading",` *#{1,6} *[^
|
|
2
|
+
]`).replace("lheading",Se).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ut=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ot=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Te=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,ct=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,y=/[\p{P}\p{S}]/u,q=/[\s\p{P}\p{S}]/u,W=/[^\s\p{P}\p{S}]/u,ht=d(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,q).getRegex(),pt=/[\p{Pi}\p{Ps}"']/u,ve=/(?!~)[\p{P}\p{S}]/u,gt=/(?!~)[\s\p{P}\p{S}]/u,dt=/(?:[^\s\p{P}\p{S}]|~)/u,kt=d(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ze?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ie=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,ft=d(Ie,"u").replace(/punct/g,y).getRegex(),xt=d(Ie,"u").replace(/punct/g,ve).getRegex(),Dt=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,mt=d(Dt,"u").replace(/openQuote/g,pt).replace(/punct/g,y).getRegex(),Pe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",_t=d(Pe,"gu").replace(/notPunctSpace/g,W).replace(/punctSpace/g,q).replace(/punct/g,y).getRegex(),Ft=d(Pe,"gu").replace(/notPunctSpace/g,dt).replace(/punctSpace/g,gt).replace(/punct/g,ve).getRegex(),bt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",wt=d(bt,"gu").replace(/notPunctSpace/g,W).replace(/punctSpace/g,q).replace(/punct/g,y).getRegex(),Et=d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,W).replace(/punctSpace/g,q).replace(/punct/g,y).getRegex(),$t="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",At=d($t,"gu").replace(/notPunctSpace/g,W).replace(/punctSpace/g,q).replace(/punct/g,y).getRegex(),Ct=d(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,y).getRegex(),yt="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",zt=d(yt,"gu").replace(/notPunctSpace/g,W).replace(/punctSpace/g,q).replace(/punct/g,y).getRegex(),Rt=d(/\\(punct)/,"gu").replace(/punct/g,y).getRegex(),St=d(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,"gu").replace(/punct/g,y).getRegex(),Bt=d(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Tt=d(ue).replace("(?:-->|$)","-->").getRegex(),vt=d("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Tt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Le=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,V=d(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets",Le).getRegex(),It=d(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label",V).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*'|\((?:\\[\s\S]|[^)\\])*\)/).getRegex(),Pt=d(/^!?\[(label)\]\[(ref)\]/).replace("label",V).replace("ref",le).getRegex(),Lt=d(/^!?\[(ref)\](?:\[\])?/).replace("ref",le).getRegex(),me=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Zt=d(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets",Le).getRegex(),Mt=d("reflink|nolink(?!\\()","g").replace("reflink",d(/^!?\[(label)\]\[(ref)\]/).replace("label",Zt).replace("ref",me).getRegex()).replace("nolink",d(/^!?\[(ref)\](?:\[\])?/).replace("ref",me).getRegex()).getRegex(),_e=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,qt=/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/,Ot=d(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,qt).getRegex(),ce={_backpedal:T,anyPunctuation:Rt,anyPunctuationOutsideCode:St,autolink:Bt,blockSkip:kt,br:Te,code:ot,del:T,delLDelim:T,delRDelim:T,emStrongLDelim:ft,emStrongRDelimAst:_t,emStrongRDelimUnd:Et,escape:ut,link:It,nolink:Lt,punctuation:ht,reflink:Pt,reflinkSearch:Mt,tag:vt,text:ct,url:T},jt={...ce,emStrongLDelim:mt,emStrongRDelimAst:wt,emStrongRDelimUnd:At,link:d(/^!?\[(label)\]\((.*?)\)/).replace("label",V).getRegex(),reflink:d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",V).getRegex()},se={...ce,emStrongRDelimAst:Ft,emStrongLDelim:xt,delLDelim:Ct,delRDelim:zt,url:d(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",Ot).replace("protocol",_e).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:d(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|wwwStart|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol",_e).replace(/emailProtocol/g,/(?:mailto|xmpp):/).replace("wwwStart",ze?"(?<![^\\s*_~(])www\\.":"www\\.").getRegex()},Ht={...se,br:d(Te).replace("{2,}","*").getRegex(),text:d(se.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},K={normal:oe,gfm:at,pedantic:lt},j={normal:ce,gfm:se,breaks:Ht,pedantic:jt},Qt={"&":"&","<":"<",">":">",'"':""","'":"'"},Fe=(t)=>Qt[t];function E(t,e){if(e){if(F.escapeTest.test(t))return t.replace(F.escapeReplace,Fe)}else if(F.escapeTestNoEncode.test(t))return t.replace(F.escapeReplaceNoEncode,Fe);return t}function Nt(t){return F.numericCharacterReference.test(t)?t.replace(F.numericCharacterReferenceOrAmpersand,(e,r,s)=>{if(r===void 0&&s===void 0)return"&";let n=r===void 0?Number.parseInt(s,16):Number.parseInt(r,10);return n===0||n>1114111||n>=55296&&n<=57343?"�":n===38?"&":String.fromCodePoint(n)}):t}function be(t){try{t=encodeURI(t).replace(F.percentDecode,"%")}catch{return null}return t}function we(t,e){let r=t.replace(F.findPipe,(a,i,l)=>{let u=!1,c=i;for(;--c>=0&&l[c]==="\\";)u=!u;return u?"|":" |"}),s=r.split(F.splitPipe),n=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;n<s.length;n++)s[n]=s[n].trim().replace(F.slashPipe,"|");return s}function z(t,e,r){let s=t.length;if(s===0)return"";let n=0;for(;n<s;){let a=t.charAt(s-n-1);if(a===e&&!r)n++;else if(a!==e&&r)n++;else break}return t.slice(0,s-n)}function Ee(t){let e=t.split(`
|
|
3
3
|
`),r=e.length-1;for(;r>=0&&F.blankLine.test(e[r]);)r--;return e.length-r<=2?t:e.slice(0,r+1).join(`
|
|
4
|
-
`)}function Y(t){return t.trim().replace(F.multipleSpaceGlobal," ").toLowerCase().toUpperCase().toLowerCase()}function
|
|
5
|
-
`:t[n-1],l=n+1;for(;l<s&&t[l]===
|
|
6
|
-
`&&
|
|
7
|
-
`).map((
|
|
8
|
-
`)}function
|
|
4
|
+
`)}function Y(t){return t.trim().replace(F.multipleSpaceGlobal," ").toLowerCase().toUpperCase().toLowerCase()}function $e(t,e){if(t.indexOf(e[0])===-1&&t.indexOf(e[1])===-1)return-1;let r=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])r++;else if(t[s]===e[1]&&(r--,r<0))return s;return r>0?-2:-1}var M=new WeakMap;function he(t){let e={"*":-1,_:-1},r=-1,s=t.length;for(let n=0;n<s;n++){let a=t[n];if(a!=="*"&&a!=="_"&&a!=="~")continue;let i=n===0?`
|
|
5
|
+
`:t[n-1],l=n+1;for(;l<s&&t[l]===a;)l++;i!==" "&&i!=="\t"&&i!==`
|
|
6
|
+
`&&i!=="\r"&&i!=="\f"&&(a==="~"?r=n:e[a]=n),n=l-1}return{maskedSrc:t,lastPossibleEmStrongCloserIndex:e,lastPossibleDelCloserIndex:r}}function Wt(t,e){let r=he(e),s=M.get(t);s?s.push(r):M.set(t,[r])}function Xt(t){let e=M.get(t);e&&(e.pop(),e.length===0&&M.delete(t))}function Gt(t,e,r){let s=M.get(t)?.at(-1);return s&&s.maskedSrc===e?s.lastPossibleEmStrongCloserIndex[r]:he(e).lastPossibleEmStrongCloserIndex[r]}function Ut(t,e){let r=M.get(t)?.at(-1);return r&&r.maskedSrc===e?r.lastPossibleDelCloserIndex:he(e).lastPossibleDelCloserIndex}function J(t,e=0){let r=e,s="";for(let n of t)if(n==="\t"){let a=4-r%4;s+=" ".repeat(a),r+=a}else s+=n,r++;return s}function Ae(t,e,r,s,n){let a=e.href,i=e.title||null,l=t[1].replace(n.other.outputLinkReplace,"$1"),u=t[0].charAt(0)==="!",c=s.state.inLink,o=s.state.linkEmitted,p=s.state.inRawBlock;s.state.inLink=!0,s.state.linkEmitted=!1;let k=s.inlineTokens(l),h=s.state.linkEmitted;if(s.state.linkEmitted=o,s.state.inLink=c,!u){if(h){s.state.inRawBlock=p;return}s.state.linkEmitted=!0}return{type:u?"image":"link",raw:r,href:a,title:i,text:l,tokens:k}}function Kt(t,e,r){let s=t.match(r.other.indentCodeCompensation);if(s===null)return e;let n=s[1];return e.split(`
|
|
7
|
+
`).map((a)=>{let i=a.match(r.other.beginningSpace);if(i===null)return a;let[l]=i;return a.slice(Math.min(l.length,n.length))}).join(`
|
|
8
|
+
`)}function Ce(t,e,r,s){if(!e.includes("<"))return!1;for(let n=0;n<e.length;n++){if(e[n]==="\\"){n++;continue}if(e[n]==="`"){let l=s.inline.code.exec(e.slice(n));if(l){n+=l[0].length-1;continue}}if(e[n]!=="<")continue;let a=t.slice(r+n),i=s.inline.tag.exec(a)||s.inline.autolink.exec(a);if(i){if(i[0].length>e.length-n)return!0;n+=i[0].length-1}}return!1}var Z=class{options;rules;lexer;constructor(t){this.options=t||I}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let r=this.options.pedantic?e[0]:Ee(e[0]),s=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:s}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let r=e[0],s=Kt(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let s=z(r,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceTabChar.test(s))&&(r=s.trim())}return{type:"heading",raw:z(e[0],`
|
|
9
9
|
`),depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:z(e[0],`
|
|
10
10
|
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let r=z(e[0],`
|
|
11
11
|
`).split(`
|
|
12
|
-
`),s="",n="",
|
|
12
|
+
`),s="",n="",a=[];for(;r.length>0;){let i=!1,l=[],u;for(u=0;u<r.length;u++)if(this.rules.other.blockquoteStart.test(r[u]))l.push(r[u]),i=!0;else if(!i)l.push(r[u]);else break;r=r.slice(u);let c=l.join(`
|
|
13
13
|
`),o=c.replace(this.rules.other.blockquoteMarkerWhitespace,(h,x,D)=>x+J(D,x.length)).replace(this.rules.other.blockquoteSetextReplace,`
|
|
14
14
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
15
15
|
${c}`:c,n=n?`${n}
|
|
16
|
-
${o}`:o;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(o,
|
|
16
|
+
${o}`:o;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(o,a,!0),this.lexer.state.top=p,r.length===0)break;let k=a.at(-1);if(k?.type==="code"||k?.type==="heading"||k?.type==="hr"||k?.type==="html"||k?.type==="table")break;if(k?.type==="blockquote"){let h=k,x=r.join(`
|
|
17
17
|
`),D=h.raw+`
|
|
18
|
-
`+x.replace(this.rules.other.blockquoteSetextReplace2,""),g=this.blockquote(D);
|
|
19
|
-
`).length:0,b=
|
|
18
|
+
`+x.replace(this.rules.other.blockquoteSetextReplace2,""),g=this.blockquote(D);a[a.length-1]=g;let _=D.substring(g.raw.length).replace(/^\n/,""),f=_?_.split(`
|
|
19
|
+
`).length:0,b=f?r.slice(0,-f):r;if(b.length>0&&(s=`${s}
|
|
20
20
|
${b.join(`
|
|
21
|
-
`)}`),n=n.substring(0,n.length-h.text.length)+g.text,r=r.slice(b.length),r.length>0&&this.rules.other.blockquoteStart.test(r[0]))continue;break}else if(
|
|
21
|
+
`)}`),n=n.substring(0,n.length-h.text.length)+g.text,r=r.slice(b.length),r.length>0&&this.rules.other.blockquoteStart.test(r[0]))continue;break}else if(k?.type==="list"){let h=k,x=h.raw+`
|
|
22
22
|
`+r.join(`
|
|
23
|
-
`),D=this.list(x);
|
|
23
|
+
`),D=this.list(x);a[a.length-1]=D;let g=D.raw.length>h.raw.length?x.slice(h.raw.length+1,D.raw.length).split(`
|
|
24
24
|
`).length:0;if(g>0){let _=r.slice(0,g).join(`
|
|
25
25
|
`);s=`${s}
|
|
26
26
|
${_}`,n=`${n}
|
|
27
|
-
${_}`}r=r.slice(g);continue}}return{type:"blockquote",raw:s,tokens:
|
|
27
|
+
${_}`}r=r.slice(g);continue}}return{type:"blockquote",raw:s,tokens:a,text:n}}}list(t){let e=this.rules.block.list.exec(t);if(e){if(!this.options.pedantic&&this.lexer.state.lastToken?.type==="text"&&!this.rules.other.listInterruptsParagraph.test(t))return;let r=t,s=()=>r.length-t.length,n=e[1].trim(),a=n.length>1,i={type:"list",raw:"",ordered:a,start:a?+n.slice(0,-1):"",loose:!1,items:[]};n=a?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=a?n:"[*+-]");let l=this.rules.other.listItemRegex(n),u=!1;for(;t;){let o=!1,p="";if(!(e=l.exec(t))||this.rules.block.hr.test(t))break;let k=s();t=t.substring(e[0].length);let h=e[2].split(`
|
|
28
28
|
`,1)[0],x=e[1].length,D=this.options.pedantic?J(h,x):h.replace(this.rules.other.leadingSpaceTab,(w)=>J(w,x)),g=t.split(`
|
|
29
|
-
`,1)[0],_=!D.trim(),
|
|
30
|
-
`,1)[0],
|
|
31
|
-
`+
|
|
32
|
-
${g}`)?` ${
|
|
33
|
-
`+te}_=!g.trim(),t=t.substring(
|
|
34
|
-
`),href:s,title:n}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=
|
|
35
|
-
`):[],
|
|
36
|
-
`),header:[],align:[],rows:[]};if(r.length===s.length){for(let
|
|
29
|
+
`,1)[0],_=!D.trim(),f=0;if(this.options.pedantic?(f=2,p=D.trimStart()):_?f=x+1:(f=D.search(this.rules.other.nonSpaceChar),f=f>4?1:f,p=D.slice(f),f+=x),_&&this.rules.other.blankLine.test(g)&&(t=t.substring(g.length+1),o=!0),!o){let w=this.rules.other.nextBulletRegex(f),O=this.rules.other.hrRegex(f),X=this.rules.other.fencesBeginRegex(f),G=this.options.pedantic?this.rules.other.pedanticHeadingBeginRegex(f):this.rules.other.headingBeginRegex(f),S=this.rules.other.htmlBeginRegex(f),U=this.rules.other.blockquoteBeginRegex(f),P=!1;for(;t;){let xe=t.split(`
|
|
30
|
+
`,1)[0],L;if(g=xe,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),L=g):L=g.replace(this.rules.other.leadingSpaceTab,(te)=>J(te)),X.test(g)||G.test(g)||S.test(g)||U.test(g)||w.test(g)||O.test(g))break;if(L.search(this.rules.other.nonSpaceChar)>=f||!g.trim())p+=`
|
|
31
|
+
`+L.slice(f),P=!1;else{if(_||D.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||X.test(D)||G.test(D)||S.test(D)||O.test(D))break;if(!this.options.pedantic&&!P){let re=D.replace(this.rules.other.nestedContainerMarkers,"");if(this.rules.block.fences.test(re)||this.rules.block.heading.test(re)||this.rules.block.hr.test(re))break}let te=!this.options.pedantic&&/^ {0,3}(?:=+|-+) *$/.test(g)&&this.rules.block.lheading.test(`${D}
|
|
32
|
+
${g}`)?` ${L.replace(/^ {0,3}/,"")}`:g;p+=`
|
|
33
|
+
`+te,P=!0}_=!g.trim(),t=t.substring(xe.length+1),D=L.slice(f)}}let b=r.slice(k,s());i.loose||(u?i.loose=!0:this.rules.other.doubleBlankLine.test(b)&&(u=!0)),i.items.push({type:"list_item",raw:b,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]})}let c=i.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;i.raw=r.slice(0,s()).trimEnd();for(let o of i.items)if(this.lexer.state.top=!1,o.tokens=this.lexer.blockTokens(o.text,[]),!i.loose){let p=o.tokens.filter((h)=>h.type==="space"),k=p.length>0&&p.some((h)=>this.rules.other.anyLine.test(h.raw));i.loose=k}for(let o of i.items){let p=o.tokens[0];if(o.task&&(p?.type==="text"||p?.type==="paragraph")){o.text=o.text.replace(this.rules.other.listReplaceTask,""),p.raw=p.raw.replace(this.rules.other.listReplaceTask,""),p.text=p.text.replace(this.rules.other.listReplaceTask,"");for(let h=this.lexer.inlineQueue.length-1;h>=0;h--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[h].src)){this.lexer.inlineQueue[h].src=this.lexer.inlineQueue[h].src.replace(this.rules.other.listReplaceTask,"");break}let k=this.rules.other.listTaskCheckbox.exec(o.raw);if(k){let h={type:"checkbox",raw:k[0]+" ",checked:k[0]!=="[ ]"};o.checked=h.checked,i.loose?o.tokens[0]&&["paragraph","text"].includes(o.tokens[0].type)&&"tokens"in o.tokens[0]&&o.tokens[0].tokens?(o.tokens[0].raw=h.raw+o.tokens[0].raw,o.tokens[0].text=h.raw+o.tokens[0].text,o.tokens[0].tokens.unshift(h)):o.tokens.unshift({type:"paragraph",raw:h.raw,text:h.raw,tokens:[h]}):o.tokens.unshift(h)}}else o.task&&(o.task=!1)}if(i.loose)for(let o of i.items){o.loose=!0;for(let p of o.tokens)p.type==="text"&&(p.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e){let r=Ee(e[0]);return{type:"html",block:!0,raw:r,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:r}}}def(t){let e=this.rules.block.def.exec(t);if(e){if(!this.rules.other.startAngleBracket.test(e[2])&&$e(e[2],"()")!==-1)return;let r=Y(e[1]),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:z(e[0],`
|
|
34
|
+
`),href:s,title:n}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=we(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
35
|
+
`):[],a={type:"table",raw:z(e[0],`
|
|
36
|
+
`),header:[],align:[],rows:[]};if(r.length===s.length){for(let i of s)this.rules.other.tableAlignRight.test(i)?a.align.push("right"):this.rules.other.tableAlignCenter.test(i)?a.align.push("center"):this.rules.other.tableAlignLeft.test(i)?a.align.push("left"):a.align.push(null);for(let i=0;i<r.length;i++)a.header.push({text:r[i],tokens:this.lexer.inline(r[i]),header:!0,align:a.align[i]});for(let i of n)a.rows.push(we(i,a.header.length).map((l,u)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[u]})));return a}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let r=e[1].trim();return{type:"heading",raw:z(e[0],`
|
|
37
37
|
`),depth:e[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let r=e[1].charAt(e[1].length-1)===`
|
|
38
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){if(this.lexer.state.linkParenPossible===!1)return;let e=this.rules.inline.link.exec(t);if(e){let r=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic
|
|
39
|
-
`),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let s=this.inlineQueue[r];this.state.inRawBlock=!1,this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],s=!1){this.tokenizer.lexer=this
|
|
40
|
-
`:r.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let
|
|
38
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){if(this.lexer.state.linkParenPossible===!1)return;let e=this.rules.inline.link.exec(t);if(e){let r=e[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Ce(t,e[1],r,this.rules))return;let s=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;let l=z(s.slice(0,-1),"\\");if((s.length-l.length)%2===0)return}else{let l=$e(e[2],"()");if(l===-2)return;if(l>-1){let u=(e[0].indexOf("!")===0?5:4)+e[1].length+l;e[2]=e[2].substring(0,l),e[0]=e[0].substring(0,u).trim(),e[3]=""}}let n=z(e[0].slice(0,-1),"\\");if((e[0].length-n.length)%2===0)return;let a=e[2],i="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(a);l&&(a=l[1],i=l[3])}else i=e[3]?e[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?a=a.slice(1):a=a.slice(1,-1)),Ae(e,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let s=r[0].charAt(0)==="!"?2:1;if(!this.options.pedantic&&Ce(t,r[1],s,this.rules))return;let n=e[Y(r[2]||r[1])];if(!n){let a=r[0].charAt(0);return{type:"text",raw:a,text:a}}return Ae(r,n,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!s||!s[1]&&!s[2]&&!s[3]&&!s[4])return;let n=s[0][0],a=r===n,i=e.length-t.length,l=i;for(;!this.options.pedantic&&l>0&&e[l-1]===n;)l--;let u=[...e.slice(Math.max(0,l-2),l)].at(-1)??"",c=u==="*"||u==="_"||!!this.rules.inline.punctuation.exec(u);l<i&&(r=u);let o=l<i?c:r==="*"||r==="_"||!!this.rules.inline.punctuation.exec(r);if(s[4]&&r.match(this.rules.other.unicodeAlphaNumeric))return;let p=s[1]||s[3]||"";if(!p||!r||o){let k=[...s[0]].length-1,h,x,D=k,g=0,_=i-l+k,f=!this.options.pedantic&&!!u.trim()&&(!!p||n==="*"&&!c);if(n!=="*"&&n!=="_")return;let b=n==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd,w=Gt(this,e,n),O=e.length-t.length+k;if(w<O)return;e=e.slice(-1*t.length+k);let X=w-O;for(b.lastIndex=0;(s=b.exec(e))!==null&&!(s.index>X);){if(h=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!h)continue;if(x=[...h].length,s[3]||s[4]){D+=x;continue}else if(s[5]||s[6]||f){if(a&&(s[5]||s[6]))break;if(_%3&&!((_+x)%3)){g+=x;continue}}if(D-=x,D>0)continue;x=Math.min(x,x+D+g);let G=[...s[0]][0].length,S=t.slice(0,k+s.index+G+x);if(Math.min(k,x)%2){let P=S.slice(1,-1);return{type:"em",raw:S,text:P,tokens:this.lexer.inlineTokens(P)}}let U=S.slice(2,-2);return{type:"strong",raw:S,text:U,tokens:this.lexer.inlineTokens(U)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(r),n=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return s&&n&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,r=""){let s=this.rules.inline.delLDelim.exec(t);if(!s)return;if(!s[1]||!r||this.rules.inline.punctuation.exec(r)){let n=[...s[0]].length-1,a,i,l=n,u=this.rules.inline.delRDelim,c=Ut(this,e),o=e.length-t.length+n;if(c<o)return;e=e.slice(-1*t.length+n);let p=c-o;for(u.lastIndex=0;(s=u.exec(e))!==null&&!(s.index>p);){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a||(i=[...a].length,i!==n))continue;if(s[3]||s[4]){l+=i;continue}if(l-=i,l>0)continue;i=Math.min(i,i+l);let k=[...s[0]][0].length,h=t.slice(0,n+s.index+k+i),x=h.slice(n,-n);return{type:"del",raw:h,text:x,tokens:this.lexer.inlineTokens(x)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let r,s;return e[2]==="@"?(r=e[1],s="mailto:"+r):(r=e[1],s=r),{type:"link",raw:e[0],text:r,href:s,autolink:!0,tokens:[{type:"text",raw:r,text:r}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let r,s;if(e[2]==="@")r=e[0],s="mailto:"+r;else{let n;do n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(n!==e[0]);r=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:r,href:s,autolink:!0,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:r?e[0]:Nt(e[0]),escaped:r}}}},A=class t{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||I,this.options.tokenizer=this.options.tokenizer||new Z,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let r={other:F,block:K.normal,inline:j.normal};this.options.pedantic?(r.block=K.pedantic,r.inline=j.pedantic):this.options.gfm&&(r.block=K.gfm,this.options.breaks?r.inline=j.breaks:r.inline=j.gfm),this.tokenizer.rules=r}static get rules(){return{block:K,inline:j}}static lex(e,r){return new t(r).lex(e)}static lexInline(e,r){return new t(r).inlineTokens(e)}lex(e){e=e.replace(F.carriageReturn,`
|
|
39
|
+
`),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let s=this.inlineQueue[r];this.state.inRawBlock=!1,this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],s=!1){this.tokenizer.lexer=this;let n=this.state.lastToken;this.options.pedantic&&(e=e.replace(F.tabCharGlobal," ").replace(F.spaceLine,""));let a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}this.state.lastToken=r.at(-1);let i;if(this.options.extensions?.block?.some((u)=>(i=u.call({lexer:this},e,r))?(e=e.substring(i.raw.length),r.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let u=r.at(-1);i.raw.length===1&&u!==void 0?u.raw+=`
|
|
40
|
+
`:r.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let u=r.at(-1);u?.type==="paragraph"||u?.type==="text"?(u.raw+=(u.raw.endsWith(`
|
|
41
41
|
`)?"":`
|
|
42
|
-
`)+i.raw,
|
|
43
|
-
`+i.text,this.inlineQueue.at(-1).src=
|
|
42
|
+
`)+i.raw,u.text+=`
|
|
43
|
+
`+i.text,this.inlineQueue.at(-1).src=u.text):r.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let u=r.at(-1);u?.type==="paragraph"||u?.type==="text"?(u.raw+=(u.raw.endsWith(`
|
|
44
44
|
`)?"":`
|
|
45
|
-
`)+i.raw,
|
|
46
|
-
`+i.raw,this.inlineQueue.at(-1).src=
|
|
45
|
+
`)+i.raw,u.text+=`
|
|
46
|
+
`+i.raw,this.inlineQueue.at(-1).src=u.text):(this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title}),r.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),r.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),r.push(i);continue}let l=e;if(this.options.extensions?.startBlock){let u=1/0,c=e.slice(1),o;this.options.extensions.startBlock.forEach((p)=>{o=p.call({lexer:this},c),typeof o=="number"&&o>=0&&(u=Math.min(u,o))}),u<1/0&&u>=0&&(l=e.substring(0,u+1))}if(this.state.top&&(i=this.tokenizer.paragraph(l))){let u=r.at(-1);s&&u?.type==="paragraph"?(u.raw+=(u.raw.endsWith(`
|
|
47
47
|
`)?"":`
|
|
48
|
-
`)+i.raw,
|
|
49
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=
|
|
48
|
+
`)+i.raw,u.text+=`
|
|
49
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(i),s=l.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let u=r.at(-1);u?.type==="text"?(u.raw+=(u.raw.endsWith(`
|
|
50
50
|
`)?"":`
|
|
51
|
-
`)+i.raw,
|
|
52
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=
|
|
51
|
+
`)+i.raw,u.text+=`
|
|
52
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):r.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,this.state.lastToken=n,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}linkInText(e){if(!e.includes("["))return!1;let r=this.tokenizer.rules.inline.link;for(let s of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(r.test(s[0])&&e.charAt(s.index-1)!=="!")return!0;for(let s of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let n=s[0],a=n.lastIndexOf("[");if(!(n.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,Y(n.slice(a+1,-1))))&&!(a>1&&this.linkInText(n.slice(1,a-1))))return!0}return!1}inlineTokens(e,r=[]){this.tokenizer.lexer=this;let s=this.state.linkParenPossible;this.state.linkParenPossible=s&&e.includes(")");try{return this.#e(e,r)}finally{this.state.linkParenPossible=s}}#e(e,r){let s=e.includes("*")||e.includes("_")||e.includes("~")||this.options.hooks?.emStrongMask||this.tokenizer.emStrong!==Z.prototype.emStrong||this.tokenizer.del!==Z.prototype.del?this.#s(e):e;Wt(this.tokenizer,s);try{return this.#t(e,s,r)}finally{Xt(this.tokenizer)}}#t(e,r,s){let n=!1,a="",i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}n||(a=""),n=!1;let l;if(this.options.extensions?.inline?.some((c)=>(l=c.call({lexer:this},e,s))?(e=e.substring(l.raw.length),s.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let c=s.at(-1);l.type==="text"&&c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):s.push(l);continue}if(l=this.tokenizer.emStrong(e,r,a)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.del(e,r,a)){e=e.substring(l.raw.length),s.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),s.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),s.push(l);continue}let u=e;if(this.options.extensions?.startInline){let c=1/0,o=e.slice(1),p;this.options.extensions.startInline.forEach((k)=>{p=k.call({lexer:this},o),typeof p=="number"&&p>=0&&(c=Math.min(c,p))}),c<1/0&&c>=0&&(u=e.substring(0,c+1))}if(l=this.tokenizer.inlineText(u)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(a=l.raw.slice(-1)),n=!0;let c=s.at(-1);c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):s.push(l);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return s}#r(e){let{blockSkip:r,tag:s,autolink:n}=this.tokenizer.rules.inline,a="",i=0,l;for(r.lastIndex=0;l=r.exec(e);){let u=l.index+(l[2]?l[2].length:0),c=l.index+l[0].length;if(e.charAt(u)==="<"){let o=e.slice(u),p=s.exec(o)||n.exec(o);if(!p){r.lastIndex=u+1;continue}c=u+p[0].length,r.lastIndex=c}a+=e.slice(i,u)+"["+"a".repeat(c-u-2)+"]",i=c}return a+e.slice(i)}#s(e){let r=e;if(this.tokens.links&&e.includes("[")){let s=this.tokenizer.rules.inline.reflinkSearch,n=(a)=>{let i=a.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,Y(a.slice(i+1,-1))))return a;if(i>1&&a.charAt(0)!=="!"){let l=a.slice(1,i-1);if(this.linkInText(l))return"["+l.replace(s,n)+"]["+"a".repeat(a.length-i-2)+"]"}return"["+"a".repeat(a.length-2)+"]"};r=r.replace(s,n)}return r=r.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(s,n,a)=>a?"+".repeat(s.length):n?n+s.slice(n.length,-n.length).replace(/`/g,"+")+n:s),r=this.#r(r),r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r,r}infiniteLoopError(e){let r="Infinite loop on byte: "+e;if(this.options.silent)console.error(r);else throw Error(r)}},ee=class{options;parser;constructor(t){this.options=t||I}space(t){return""}code({text:t,lang:e,escaped:r}){let s=(e||"").match(F.notSpaceStart)?.[0],n=t?t.replace(F.endingNewline,"")+`
|
|
53
53
|
`:"";return s?'<pre><code class="language-'+E(s)+'">'+(r?n:E(n,!0))+`</code></pre>
|
|
54
54
|
`:"<pre><code>"+(r?n:E(n,!0))+`</code></pre>
|
|
55
55
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
56
56
|
${this.parser.parse(t)}</blockquote>
|
|
57
57
|
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
58
58
|
`}hr(t){return`<hr>
|
|
59
|
-
`}list(t){let{ordered:e,start:r}=t,s="";for(let
|
|
59
|
+
`}list(t){let{ordered:e,start:r}=t,s="";for(let i=0;i<t.items.length;i++){let l=t.items[i];s+=this.listitem(l)}let n=e?"ol":"ul",a=e&&r!==1?' start="'+r+'"':"";return"<"+n+a+`>
|
|
60
60
|
`+s+"</"+n+`>
|
|
61
61
|
`}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
|
|
62
62
|
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
63
|
-
`}table(t){let e="",r="";for(let n=0;n<t.header.length;n++)r+=this.tablecell(t.header[n]);e+=this.tablerow({text:r});let s="";for(let n=0;n<t.rows.length;n++){let
|
|
63
|
+
`}table(t){let e="",r="";for(let n=0;n<t.header.length;n++)r+=this.tablecell(t.header[n]);e+=this.tablerow({text:r});let s="";for(let n=0;n<t.rows.length;n++){let a=t.rows[n];r="";for(let i=0;i<a.length;i++)r+=this.tablecell(a[i]);s+=this.tablerow({text:r})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
64
64
|
<thead>
|
|
65
65
|
`+e+`</thead>
|
|
66
66
|
`+s+`</table>
|
|
67
67
|
`}tablerow({text:t}){return`<tr>
|
|
68
68
|
${t}</tr>
|
|
69
69
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>
|
|
70
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${E(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,text:r,tokens:s,autolink:n}){let
|
|
71
|
-
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+E(r.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(r);throw r}}},v=new pe;function m(t,e){return v.parse(t,e)}m.options=m.setOptions=function(t){return v.setOptions(t),m.defaults=v.defaults,Ae(m.defaults),m};m.getDefaults=se;m.defaults=P;function Ut(...t){return v.use(...t),m.defaults=v.defaults,Ae(m.defaults),m}m.use=Ut;m.walkTokens=function(t,e){return v.walkTokens(t,e)};m.parseInline=v.parseInline;m.Parser=C;m.parser=C.parse;m.Renderer=ee;m.TextRenderer=he;m.Lexer=A;m.lexer=A.lex;m.Tokenizer=L;m.Hooks=Q;m.parse=m;var{options:cr,setOptions:hr,walkTokens:pr,parseInline:gr}=m;var dr=C.parse,fr=A.lex;var Ie=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Le=/[\0-\x1F\x7F-\x9F]/;var Ze=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/;var Me=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var Kt=class{src_Any=Ie.source;src_Cc=Le.source;src_Z=Me.source;src_P=Ze.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join("|");src_ZCc=[this.src_Z,this.src_Cc].join("|");cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(t={}){this.opts={...this.opts,...t}}set(t={}){return this.opts={...this.opts,...t},this.cache={},this}escapeRE(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(t,e,r=4){let s=this.escapeRE(t),n=this.escapeRE(e),i=`(?:(?!${this.src_ZCc}|${s}|${n}).)`,a=`${s}${i}{0,1000}${n}`;for(let l=2;l<=r;l++)a=`${s}(?:${i}|${a}){0,1000}${n}`;return a}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])")}get_ipv6_addr(){let e=`(?:(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=new RegExp(`(?:(?:[0-9A-Fa-f]{1,4}:){6}${e}|::(?:[0-9A-Fa-f]{1,4}:){5}${e}|(?:[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){4}${e}|(?:(?:[0-9A-Fa-f]{1,4}:){0,1}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){3}${e}|(?:(?:[0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){2}${e}|(?:(?:[0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:${e}|(?:(?:[0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})?::${e}|(?:(?:[0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(?:(?:[0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?")}get_host_terminator(){return this.cache.src_host_terminator??=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=new RegExp("xn--[a-z0-9\\-]{1,59}")}get_tld(){if(this.cache.tld)return this.cache.tld;let t=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${t||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=new RegExp("")}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig")}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig")}get_http_validator(){return this.cache.http_validator??=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy")}get_relative_proto_validator(){return this.cache.relative_proto_validator??=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy")}get_mail_name_validator(){return this.cache.mail_name_validator??=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy")}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map((t)=>this.escapeRE(t)).join("|"))}get_schema_search(){return this.cache.schema_search??=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig")}get_schema_at_start(){return this.cache.schema_at_start??=new RegExp(`^${this.get_schema_search().source}`,"i")}},ge={validate:(t,e,r)=>{let s=r.re.get_http_validator();s.lastIndex=e;let n=s.exec(t);return n?n[0].length:0},normalize:(t,e)=>e.normalize(t)},Jt={"http:":ge,"https:":ge,"ftp:":ge,"//":{validate:function(t,e,r){let s=r.re.get_relative_proto_validator();s.lastIndex=e;let n=s.exec(t);if(n){if(e>=3&&t[e-3]===":")return 0;if(e>=3&&t[e-3]==="/")return 0;return n[0].length}return 0},normalize:(t,e)=>e.normalize(t)},"mailto:":{validate:function(t,e,r){let s=r.re.get_mailto_validator();s.lastIndex=e;let n=s.exec(t);return n?n[0].length:0},normalize:(t,e)=>e.normalize(t)}},Vt="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",Yt="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function er(){let t=Yt.split("|");return Vt.split("|").forEach((e)=>{let r=e.indexOf(":"),s=e.slice(0,r);for(let n of e.slice(r+1))t.push(s+n)}),t}var tr={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:er(),urlAuth:!1,maxLength:1e4},qe=class{schema;index;lastIndex;raw;text;url;constructor(t,e,r,s){let n=t.slice(r,s);this.schema=e.toLowerCase(),this.index=r,this.lastIndex=s,this.raw=n,this.text=n,this.url=n}},Oe=class{__opts__;__schemas__;re;constructor(t={}){let{rebuilder:e,...r}=t;this.__opts__={...tr,...r},this.__schemas__={...Jt},this.re=e||new Kt,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(t,e=null){if(!e)delete this.__schemas__[t];else{let r={normalize:(s,n)=>n.normalize(s),...e};this.__schemas__[t]=r}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(t={}){return this.__opts__={...this.__opts__,...t},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(t){if(!t.length)return!1;let e,r;r=this.re.get_schema_search(),r.lastIndex=0;while((e=r.exec(t))!==null)if(this.testSchemaAt(t,e[2],r.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]){if(r=this.re.get_fuzzy_link_search(),r.lastIndex=0,r.exec(t)!==null)return!0}if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]){if(t.indexOf("@")>=0){let s=this.re.get_fuzzy_mail_host_search(),n=this.re.get_mail_name_validator();s.lastIndex=0;while((e=s.exec(t))!==null){let i=t.slice(Math.max(0,e.index-65),e.index);if(n.test(i))return!0}}}return!1}testSchemaAt(t,e,r){if(!this.__schemas__[e.toLowerCase()])return 0;return this.__schemas__[e.toLowerCase()].validate(t.slice(0,r+this.__opts__.maxLength),r,this)}match(t){let e=[],r=this.re.get_schema_search(),s,n,i,a,l,u,c=!1,o=!1,p=!1,f=0;if(!t.length)return null;if(r.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"])s=this.re.get_fuzzy_link_search(),s.lastIndex=0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"])n=this.re.get_fuzzy_mail_host_search(),n.lastIndex=0,i=this.re.get_mail_name_validator();for(;;){let h=Math.max(f-1,0);if(n&&i&&!p&&(!l||l.index<f)){if(n.lastIndex<h)n.lastIndex=h;for(;;){let k=n.exec(t);if(!k){p=!0,l=void 0;break}let b=i.exec(t.slice(Math.max(0,k.index-65),k.index));if(!b)continue;if(l={schema:"mailto:",index:k.index-b[1].length,lastIndex:k.index+k[0].length},l.index>=f)break;if(n.lastIndex<h)n.lastIndex=h}}if(s&&!o&&(!a||a.index<f)){if(s.lastIndex<h)s.lastIndex=h;for(;;){let k=s.exec(t);if(!k){o=!0,a=void 0;break}if(a={schema:"",index:k.index+k[1].length,lastIndex:k.index+k[0].length},a.index>=f)break;if(s.lastIndex<h)s.lastIndex=h}}let x=l;if(!x||a&&(a.index<x.index||a.index===x.index&&a.lastIndex>x.lastIndex))x=a;let D;if(!c)for(;;){if(!u){if(r.lastIndex<h)r.lastIndex=h;let w=r.exec(t);if(!w){c=!0;break}u={schema:w[2],index:w.index+w[1].length,lastIndex:w.index+w[0].length}}if(u.index<f){u=void 0;continue}if(x&&u.index>x.index)break;let k=u;u=void 0;let b=this.testSchemaAt(t,k.schema,k.lastIndex);if(b){D={schema:k.schema,index:k.index,lastIndex:k.lastIndex+b};break}}let g=D;if(!g||l&&(l.index<g.index||l.index===g.index&&l.lastIndex>g.lastIndex))g=l;if(!g||a&&(a.index<g.index||a.index===g.index&&a.lastIndex>g.lastIndex))g=a;if(!g)break;if(g===l)l=void 0;else if(g===a)a=void 0;let _=new qe(t,g.schema,g.index,g.lastIndex);if(_.schema)this.__schemas__[_.schema].normalize(_,this);else this.normalize(_);e.push(_),f=g.lastIndex}if(e.length)return e;return null}matchAtStart(t){if(!t.length)return null;let e=this.re.get_schema_at_start().exec(t);if(!e)return null;let r=this.testSchemaAt(t,e[2],e[0].length);if(!r)return null;let s=new qe(t,e[2],e.index+e[1].length,e.index+e[0].length+r);return this.__schemas__[s.schema].normalize(s,this),s}tlds(t,e=!1){if(t=Array.isArray(t)?t:[t],!e)this.__opts__.tlds=t;else this.__opts__.tlds=this.__opts__.tlds.concat(t);return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(t){if(!t.schema)t.url=`http://${t.url}`;if(t.schema==="mailto:"&&!/^mailto:/i.test(t.url))t.url=`mailto:${t.url}`}};var rr={fuzzyLink:!0};function de(t={}){let{tlds:e,tldsKeepOld:r,schemas:s,...n}=t,i=new Oe({...rr,...n});return sr(i,e,r),nr(i,s),{extensions:[{name:"autolink",level:"inline",start:(a)=>{let l=je(i,a);if(!l)return;return l.index},tokenizer(a){if(this.lexer.state.inLink)return;let l=je(i,a);if(!l)return;let u;if(l.index===0)u=l.raw;else if(l.index===1&&a.charAt(0)==="<"&&a.charAt(l.lastIndex)===">")u=`<${l.raw}>`;if(!u)return;return{type:"link",raw:u,text:l.text,href:l.url,tokens:[{type:"text",raw:l.text,text:l.text}]}}}]}}function je(t,e){let r=t.match(e);if(!r||!r.length)return;return r[0]}function sr(t,e,r){if(e)t.tlds(e,r)}function nr(t,e){if(e)for(let[r,s]of Object.entries(e))t.add(r,s)}var ir=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,lr=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,Qe=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,ar={extensions:[{name:"math",level:"block",tokenizer(t){let e=Qe.exec(t);if(e===null)return;return{type:"math",raw:e[0],text:(e[1]??e[2]).trim(),display:!0}}},{name:"math",level:"inline",start(t){return t.search(/\$|\\[([]/)},tokenizer(t){let e=Qe.exec(t);if(e!==null)return{type:"math",raw:e[0],text:(e[1]??e[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(t);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let s=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(t);if(s===null||/^\s|\s$/.test(s[1]))return;return{type:"math",raw:s[0],text:s[1],display:!1}}}]};function He(){let t=new pe({gfm:!0}),e=de(),r=e.extensions[0],s=r.tokenizer;r.tokenizer=function(n,i){let a=s.call(this,n,i);if(a===void 0)return;if(a.raw.startsWith("<"))return a;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(a.raw);if(l===null)return a;let u=l[0].length-1,c=a.raw.slice(u).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(c===-1)return a;let o=a.raw.slice(0,u+c),p=a.href.slice(0,a.href.length-(a.raw.length-o.length));return{...a,raw:o,href:p,text:o,tokens:[{type:"text",raw:o,text:o}]}},t.use(ar,e);for(let n of["block","inline"])t.use({extensions:[{name:"internalMessage",level:n,...n==="inline"?{start(i){return ir.exec(i)?.index}}:{},tokenizer(i){let a=lr.exec(i);if(a===null)return;return{type:"internalMessage",raw:a[0]}},renderer(){return""}}]});return t}function ur(t,e){let r=Object.keys(t);return r.length===Object.keys(e).length&&r.every((s)=>{let n=e[s];return t[s].href===n?.href&&t[s].title===n.title})}function or(t,e){let r=2,s=0;for(let i=t.length-1;i>=0;i-=1){if(t[i].type==="space")continue;if(r-=1,r===0){s=i;break}}let n=0;for(let i=0;i<s;i+=1){let a=t[i];if(a.type==="def"||/^ {0,3}(?:\[|<|\$\$|\\\[)/.test(a.raw))return n;let l=!1;if(e.walkTokens([t[i]],(u)=>{if(u.type==="html"&&(("inLink"in u)&&u.inLink||("inRawBlock"in u)&&u.inRawBlock))l=!0}),l)return n;if(/\n[\t ]*\n$/.test(t[i].raw))n=i+1}return n}function Ne(t=He()){let e="",r=[],s={},n={};return{parse(i){let a=i.replaceAll(/\r\n|\r/g,`
|
|
72
|
-
`);if(!a.startsWith(e))e="",r=[],s={},n={};let l=new t.Lexer(t.defaults);l.tokens.links={...s};let u=l.lex(a.slice(e.length)),c=[...r,...u],o=u.links;if(r.length>0&&!ur(n,o)){let h=t.lexer(a);c=[...h],o=h.links}n=o;let p=0,f=[];for(let h of c){if(!a.startsWith(h.raw,p))break;f.push(h),p+=h.raw.length}return r=f.slice(0,or(f,t)),e=a.slice(0,r.reduce((h,x)=>h+x.raw.length,0)),s=Object.create(null),t.walkTokens(r,(h)=>{if(h.type!=="def")return;let x=h;if(!Object.hasOwn(s,x.tag))s[x.tag]={href:x.href,title:x.title}}),structuredClone(c)}}}var fe=new Map;self.onmessage=(t)=>{let e=t.data;if(e.type==="dispose"){fe.delete(e.clientId);return}let{clientId:r,revision:s,source:n}=e,i;try{let a=fe.get(r);if(a===void 0)a=Ne(),fe.set(r,a);i={clientId:r,revision:s,ok:!0,tokens:a.parse(n)}}catch(a){i={clientId:r,revision:s,ok:!1,error:a instanceof Error?a.message:String(a)}}self.postMessage(i)};
|
|
70
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${E(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,text:r,tokens:s,autolink:n}){let a=n?E(r,!0):this.parser.parseInline(s),i=be(t);if(i===null)return a;t=E(i,n);let l='<a href="'+t+'"';return e&&(l+=' title="'+E(e)+'"'),l+=">"+a+"</a>",l}image({href:t,title:e,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let n=be(t);if(n===null)return E(r);t=n;let a=`<img src="${E(t)}" alt="${E(r)}"`;return e&&(a+=` title="${E(e)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):("escaped"in t)&&t.escaped?t.text:E(t.text)}},pe=class{parser;strong({text:t,tokens:e}){return e?this.parser.parseInline(e,this):t}em({text:t,tokens:e}){return e?this.parser.parseInline(e,this):t}codespan({text:t}){return t}del({text:t,tokens:e}){return e?this.parser.parseInline(e,this):t}html({text:t}){return t}text({text:t}){return t}link({text:t,tokens:e}){return e?this.parser.parseInline(e,this):t}image({text:t,tokens:e}){return e?this.parser.parseInline(e,this):t}br(){return`
|
|
71
|
+
`}checkbox({raw:t}){return t}},C=class t{options;renderer;textRenderer;constructor(e){this.options=e||I,this.options.renderer=this.options.renderer||new ee,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new pe,this.textRenderer.parser=this}static parse(e,r){return new t(r).parse(e)}static parseInline(e,r){return new t(r).parseInline(e)}parse(e){this.renderer.parser=this;let r="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let i=n,l=this.options.extensions.renderers[i.type].call({parser:this},i);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(i.type)){r+=l===!1?"":l??"";continue}}let a=n;switch(a.type){case"space":{r+=this.renderer.space(a);break}case"hr":{r+=this.renderer.hr(a);break}case"heading":{r+=this.renderer.heading(a);break}case"code":{r+=this.renderer.code(a);break}case"table":{r+=this.renderer.table(a);break}case"blockquote":{r+=this.renderer.blockquote(a);break}case"list":{r+=this.renderer.list(a);break}case"checkbox":{r+=this.renderer.checkbox(a);break}case"html":{r+=this.renderer.html(a);break}case"def":{r+=this.renderer.def(a);break}case"paragraph":{r+=this.renderer.paragraph(a);break}case"text":{r+=this.renderer.text(a);break}default:{let i='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw Error(i)}}}return r}parseInline(e,r=this.renderer){this.renderer.parser=this;let s="";for(let n=0;n<e.length;n++){let a=e[n];if(this.options.extensions?.renderers?.[a.type]){let l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(a.type)){s+=l===!1?"":l??"";continue}}let i=a;switch(i.type){case"escape":{s+=r.text(i);break}case"html":{s+=r.html(i);break}case"link":{s+=r.link(i);break}case"image":{s+=r.image(i);break}case"checkbox":{s+=r.checkbox(i);break}case"strong":{s+=r.strong(i);break}case"em":{s+=r.em(i);break}case"codespan":{s+=r.codespan(i);break}case"br":{s+=r.br(i);break}case"del":{s+=r.del(i);break}case"text":{s+=r.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw Error(l)}}}return s}},H=class{options;block;constructor(t){this.options=t||I}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?A.lex:A.lexInline}provideParser(t=this.block){return t?C.parse:C.parseInline}};function R(t,e){if(Array.isArray(e))for(let r=0;r<e.length;r++)t.push(e[r]);else t.push(e)}var ge=class{defaults=ne();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=C;Renderer=ee;TextRenderer=pe;Lexer=A;Tokenizer=Z;Hooks=H;constructor(...t){this.use(...t)}walkTokens(t,e){let r=[];for(let s of t)switch(R(r,e.call(this,s)),s.type){case"table":{let n=s;for(let a of n.header)R(r,this.walkTokens(a.tokens,e));for(let a of n.rows)for(let i of a)R(r,this.walkTokens(i.tokens,e));break}case"list":{let n=s;R(r,this.walkTokens(n.items,e));break}default:{let n=s;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach((a)=>{let i=n[a].flat(1/0);R(r,this.walkTokens(i,e))}):n.tokens&&R(r,this.walkTokens(n.tokens,e))}}return r}use(...t){let e=this.defaults.extensions||{renderers:Object.create(null),childTokens:Object.create(null)};return t.forEach((r)=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach((n)=>{if(!n.name)throw Error("extension name required");if("renderer"in n){let a=e.renderers[n.name];a?e.renderers[n.name]=function(...i){let l=n.renderer.apply(this,i);return l===!1&&(l=a.apply(this,i)),l}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw Error("extension level must be 'block' or 'inline'");let a=e[n.level];a?a.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),s.extensions=e),r.renderer){let n=this.defaults.renderer||new ee(this.defaults);for(let a in r.renderer){if(!(a in n))throw Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let i=a,l=r.renderer[i],u=n[i];n[i]=(...c)=>{let o=l.apply(n,c);return o===!1&&(o=u.apply(n,c)),o===!1?"":o??""}}s.renderer=n}if(r.tokenizer){let n=this.defaults.tokenizer||new Z(this.defaults);for(let a in r.tokenizer){if(!(a in n))throw Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let i=a,l=r.tokenizer[i],u=n[i];n[i]=(...c)=>{let o=l.apply(n,c);return o===!1&&(o=u.apply(n,c)),o}}s.tokenizer=n}if(r.hooks){let n=this.defaults.hooks||new H;for(let a in r.hooks){if(!(a in n))throw Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let i=a,l=r.hooks[i],u=n[i];H.passThroughHooks.has(a)?n[i]=(c)=>{if(n.options.async&&H.passThroughHooksRespectAsync.has(a))return(async()=>{let p=await l.call(n,c);return u.call(n,p)})();let o=l.call(n,c);return u.call(n,o)}:n[i]=(...c)=>{if(n.options.async)return(async()=>{let p=await l.apply(n,c);return p===!1&&(p=await u.apply(n,c)),p})();let o=l.apply(n,c);return o===!1&&(o=u.apply(n,c)),o}}s.hooks=n}if(r.walkTokens){let n=this.defaults.walkTokens,a=r.walkTokens;s.walkTokens=function(i){let l=[];return R(l,a.call(this,i)),n&&R(l,n.call(this,i)),l}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return A.lex(t,e??this.defaults)}parser(t,e){return C.parse(t,e??this.defaults)}parseMarkdown(t){return(e,r)=>{let s={...r},n={...this.defaults,...s},a=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&s.async===!1)return a(Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return a(Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=t),n.async)return(async()=>{let i=n.hooks?await n.hooks.preprocess(e):e,l=await(n.hooks?await n.hooks.provideLexer(t):t?A.lex:A.lexInline)(i,n),u=n.hooks?await n.hooks.processAllTokens(l):l;n.walkTokens&&await Promise.all(this.walkTokens(u,n.walkTokens));let c=await(n.hooks?await n.hooks.provideParser(t):t?C.parse:C.parseInline)(u,n);return n.hooks?await n.hooks.postprocess(c):c})().catch(a);try{n.hooks&&(e=n.hooks.preprocess(e));let i=(n.hooks?n.hooks.provideLexer(t):t?A.lex:A.lexInline)(e,n);n.hooks&&(i=n.hooks.processAllTokens(i)),n.walkTokens&&this.walkTokens(i,n.walkTokens);let l=(n.hooks?n.hooks.provideParser(t):t?C.parse:C.parseInline)(i,n);return n.hooks&&(l=n.hooks.postprocess(l)),l}catch(i){return a(i)}}}onError(t,e){return(r)=>{if(r.message+=`
|
|
72
|
+
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+E(r.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(r);throw r}}},v=new ge;function m(t,e){return v.parse(t,e)}m.options=m.setOptions=function(t){return v.setOptions(t),m.defaults=v.defaults,ye(m.defaults),m};m.getDefaults=ne;m.defaults=I;function Jt(...t){return v.use(...t),m.defaults=v.defaults,ye(m.defaults),m}m.use=Jt;m.walkTokens=function(t,e){return v.walkTokens(t,e)};m.parseInline=v.parseInline;m.Parser=C;m.parser=C.parse;m.Renderer=ee;m.TextRenderer=pe;m.Lexer=A;m.lexer=A.lex;m.Tokenizer=Z;m.Hooks=H;m.parse=m;var{options:pr,setOptions:gr,walkTokens:dr,parseInline:kr}=m;var fr=C.parse,xr=A.lex;var Ze=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Me=/[\0-\x1F\x7F-\x9F]/;var qe=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/;var Oe=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var Vt=class{src_Any=Ze.source;src_Cc=Me.source;src_Z=Oe.source;src_P=qe.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join("|");src_ZCc=[this.src_Z,this.src_Cc].join("|");cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(t={}){this.opts={...this.opts,...t}}set(t={}){return this.opts={...this.opts,...t},this.cache={},this}escapeRE(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(t,e,r=4){let s=this.escapeRE(t),n=this.escapeRE(e),a=`(?:(?!${this.src_ZCc}|${s}|${n}).)`,i=`${s}${a}{0,1000}${n}`;for(let l=2;l<=r;l++)i=`${s}(?:${a}|${i}){0,1000}${n}`;return i}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])")}get_ipv6_addr(){let e=`(?:(?:[0-9A-Fa-f]{1,4}:[0-9A-Fa-f]{1,4})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=new RegExp(`(?:(?:[0-9A-Fa-f]{1,4}:){6}${e}|::(?:[0-9A-Fa-f]{1,4}:){5}${e}|(?:[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){4}${e}|(?:(?:[0-9A-Fa-f]{1,4}:){0,1}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){3}${e}|(?:(?:[0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})?::(?:[0-9A-Fa-f]{1,4}:){2}${e}|(?:(?:[0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}:${e}|(?:(?:[0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})?::${e}|(?:(?:[0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})?::[0-9A-Fa-f]{1,4}|(?:(?:[0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?")}get_host_terminator(){return this.cache.src_host_terminator??=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=new RegExp("xn--[a-z0-9\\-]{1,59}")}get_tld(){if(this.cache.tld)return this.cache.tld;let t=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${t||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=new RegExp("")}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig")}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig")}get_http_validator(){return this.cache.http_validator??=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy")}get_relative_proto_validator(){return this.cache.relative_proto_validator??=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy")}get_mail_name_validator(){return this.cache.mail_name_validator??=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy")}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map((t)=>this.escapeRE(t)).join("|"))}get_schema_search(){return this.cache.schema_search??=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig")}get_schema_at_start(){return this.cache.schema_at_start??=new RegExp(`^${this.get_schema_search().source}`,"i")}},de={validate:(t,e,r)=>{let s=r.re.get_http_validator();s.lastIndex=e;let n=s.exec(t);return n?n[0].length:0},normalize:(t,e)=>e.normalize(t)},Yt={"http:":de,"https:":de,"ftp:":de,"//":{validate:function(t,e,r){let s=r.re.get_relative_proto_validator();s.lastIndex=e;let n=s.exec(t);if(n){if(e>=3&&t[e-3]===":")return 0;if(e>=3&&t[e-3]==="/")return 0;return n[0].length}return 0},normalize:(t,e)=>e.normalize(t)},"mailto:":{validate:function(t,e,r){let s=r.re.get_mailto_validator();s.lastIndex=e;let n=s.exec(t);return n?n[0].length:0},normalize:(t,e)=>e.normalize(t)}},er="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",tr="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function rr(){let t=tr.split("|");return er.split("|").forEach((e)=>{let r=e.indexOf(":"),s=e.slice(0,r);for(let n of e.slice(r+1))t.push(s+n)}),t}var sr={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:rr(),urlAuth:!1,maxLength:1e4},je=class{schema;index;lastIndex;raw;text;url;constructor(t,e,r,s){let n=t.slice(r,s);this.schema=e.toLowerCase(),this.index=r,this.lastIndex=s,this.raw=n,this.text=n,this.url=n}},He=class{__opts__;__schemas__;re;constructor(t={}){let{rebuilder:e,...r}=t;this.__opts__={...sr,...r},this.__schemas__={...Yt},this.re=e||new Vt,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(t,e=null){if(!e)delete this.__schemas__[t];else{let r={normalize:(s,n)=>n.normalize(s),...e};this.__schemas__[t]=r}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(t={}){return this.__opts__={...this.__opts__,...t},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(t){if(!t.length)return!1;let e,r;r=this.re.get_schema_search(),r.lastIndex=0;while((e=r.exec(t))!==null)if(this.testSchemaAt(t,e[2],r.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]){if(r=this.re.get_fuzzy_link_search(),r.lastIndex=0,r.exec(t)!==null)return!0}if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]){if(t.indexOf("@")>=0){let s=this.re.get_fuzzy_mail_host_search(),n=this.re.get_mail_name_validator();s.lastIndex=0;while((e=s.exec(t))!==null){let a=t.slice(Math.max(0,e.index-65),e.index);if(n.test(a))return!0}}}return!1}testSchemaAt(t,e,r){if(!this.__schemas__[e.toLowerCase()])return 0;return this.__schemas__[e.toLowerCase()].validate(t.slice(0,r+this.__opts__.maxLength),r,this)}match(t){let e=[],r=this.re.get_schema_search(),s,n,a,i,l,u,c=!1,o=!1,p=!1,k=0;if(!t.length)return null;if(r.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"])s=this.re.get_fuzzy_link_search(),s.lastIndex=0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"])n=this.re.get_fuzzy_mail_host_search(),n.lastIndex=0,a=this.re.get_mail_name_validator();for(;;){let h=Math.max(k-1,0);if(n&&a&&!p&&(!l||l.index<k)){if(n.lastIndex<h)n.lastIndex=h;for(;;){let f=n.exec(t);if(!f){p=!0,l=void 0;break}let b=a.exec(t.slice(Math.max(0,f.index-65),f.index));if(!b)continue;if(l={schema:"mailto:",index:f.index-b[1].length,lastIndex:f.index+f[0].length},l.index>=k)break;if(n.lastIndex<h)n.lastIndex=h}}if(s&&!o&&(!i||i.index<k)){if(s.lastIndex<h)s.lastIndex=h;for(;;){let f=s.exec(t);if(!f){o=!0,i=void 0;break}if(i={schema:"",index:f.index+f[1].length,lastIndex:f.index+f[0].length},i.index>=k)break;if(s.lastIndex<h)s.lastIndex=h}}let x=l;if(!x||i&&(i.index<x.index||i.index===x.index&&i.lastIndex>x.lastIndex))x=i;let D;if(!c)for(;;){if(!u){if(r.lastIndex<h)r.lastIndex=h;let w=r.exec(t);if(!w){c=!0;break}u={schema:w[2],index:w.index+w[1].length,lastIndex:w.index+w[0].length}}if(u.index<k){u=void 0;continue}if(x&&u.index>x.index)break;let f=u;u=void 0;let b=this.testSchemaAt(t,f.schema,f.lastIndex);if(b){D={schema:f.schema,index:f.index,lastIndex:f.lastIndex+b};break}}let g=D;if(!g||l&&(l.index<g.index||l.index===g.index&&l.lastIndex>g.lastIndex))g=l;if(!g||i&&(i.index<g.index||i.index===g.index&&i.lastIndex>g.lastIndex))g=i;if(!g)break;if(g===l)l=void 0;else if(g===i)i=void 0;let _=new je(t,g.schema,g.index,g.lastIndex);if(_.schema)this.__schemas__[_.schema].normalize(_,this);else this.normalize(_);e.push(_),k=g.lastIndex}if(e.length)return e;return null}matchAtStart(t){if(!t.length)return null;let e=this.re.get_schema_at_start().exec(t);if(!e)return null;let r=this.testSchemaAt(t,e[2],e[0].length);if(!r)return null;let s=new je(t,e[2],e.index+e[1].length,e.index+e[0].length+r);return this.__schemas__[s.schema].normalize(s,this),s}tlds(t,e=!1){if(t=Array.isArray(t)?t:[t],!e)this.__opts__.tlds=t;else this.__opts__.tlds=this.__opts__.tlds.concat(t);return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(t){if(!t.schema)t.url=`http://${t.url}`;if(t.schema==="mailto:"&&!/^mailto:/i.test(t.url))t.url=`mailto:${t.url}`}};var nr={fuzzyLink:!0};function ke(t={}){let{tlds:e,tldsKeepOld:r,schemas:s,...n}=t,a=new He({...nr,...n});return ir(a,e,r),ar(a,s),{extensions:[{name:"autolink",level:"inline",start:(i)=>{let l=Qe(a,i);if(!l)return;return l.index},tokenizer(i){if(this.lexer.state.inLink)return;let l=Qe(a,i);if(!l)return;let u;if(l.index===0)u=l.raw;else if(l.index===1&&i.charAt(0)==="<"&&i.charAt(l.lastIndex)===">")u=`<${l.raw}>`;if(!u)return;return{type:"link",raw:u,text:l.text,href:l.url,tokens:[{type:"text",raw:l.text,text:l.text}]}}}]}}function Qe(t,e){let r=t.match(e);if(!r||!r.length)return;return r[0]}function ir(t,e,r){if(e)t.tlds(e,r)}function ar(t,e){if(e)for(let[r,s]of Object.entries(e))t.add(r,s)}var lr=/<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>/,ur=/^<(task-notification|system-reminder|antml:[\w-]+)\b[^>]*>[\s\S]*?(?:<\/\1\s*>|$)/,Ne=/^(?:\$\$([\s\S]+?)\$\$|\\\[([\s\S]+?)\\\])/,or={extensions:[{name:"math",level:"block",tokenizer(t){let e=Ne.exec(t);if(e===null)return;return{type:"math",raw:e[0],text:(e[1]??e[2]).trim(),display:!0}}},{name:"math",level:"inline",start(t){return t.search(/\$|\\[([]/)},tokenizer(t){let e=Ne.exec(t);if(e!==null)return{type:"math",raw:e[0],text:(e[1]??e[2]).trim(),display:!0};let r=/^\\\(([^\n]+?)\\\)/.exec(t);if(r!==null)return{type:"math",raw:r[0],text:r[1].trim(),display:!1};let s=/^\$(?!\$)((?:\\[^\n]|[^\\$\n])+?)\$(?![\d$])/.exec(t);if(s===null||/^\s|\s$/.test(s[1]))return;return{type:"math",raw:s[0],text:s[1],display:!1}}}]};function We(){let t=new ge({gfm:!0}),e=ke(),r=e.extensions[0],s=r.tokenizer;r.tokenizer=function(n,a){let i=s.call(this,n,a);if(i===void 0)return;if(i.raw.startsWith("<"))return i;let l=/^(?:[a-z][a-z\d+.-]*:\/\/|www\.)[^/?#]+[/?#]/i.exec(i.raw);if(l===null)return i;let u=l[0].length-1,c=i.raw.slice(u).search(/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u);if(c===-1)return i;let o=i.raw.slice(0,u+c),p=i.href.slice(0,i.href.length-(i.raw.length-o.length));return{...i,raw:o,href:p,text:o,tokens:[{type:"text",raw:o,text:o}]}},t.use(or,e);for(let n of["block","inline"])t.use({extensions:[{name:"internalMessage",level:n,...n==="inline"?{start(a){return lr.exec(a)?.index}}:{},tokenizer(a){let i=ur.exec(a);if(i===null)return;return{type:"internalMessage",raw:i[0]}},renderer(){return""}}]});return t}function cr(t,e){let r=Object.keys(t);return r.length===Object.keys(e).length&&r.every((s)=>{let n=e[s];return t[s].href===n?.href&&t[s].title===n.title})}function hr(t,e){let r=2,s=0;for(let a=t.length-1;a>=0;a-=1){if(t[a].type==="space")continue;if(r-=1,r===0){s=a;break}}let n=0;for(let a=0;a<s;a+=1){let i=t[a];if(i.type==="def"||/^ {0,3}(?:\[|<|\$\$|\\\[)/.test(i.raw))return n;let l=!1;if(e.walkTokens([t[a]],(u)=>{if(u.type==="html"&&(("inLink"in u)&&u.inLink||("inRawBlock"in u)&&u.inRawBlock))l=!0}),l)return n;if(/\n[\t ]*\n$/.test(t[a].raw))n=a+1}return n}function Xe(t=We()){let e="",r=[],s={},n={};return{parse(a){let i=a.replaceAll(/\r\n|\r/g,`
|
|
73
|
+
`);if(!i.startsWith(e))e="",r=[],s={},n={};let l=new t.Lexer(t.defaults);l.tokens.links={...s};let u=l.lex(i.slice(e.length)),c=[...r,...u],o=u.links;if(r.length>0&&!cr(n,o)){let h=t.lexer(i);c=[...h],o=h.links}n=o;let p=0,k=[];for(let h of c){if(!i.startsWith(h.raw,p))break;k.push(h),p+=h.raw.length}return r=k.slice(0,hr(k,t)),e=i.slice(0,r.reduce((h,x)=>h+x.raw.length,0)),s=Object.create(null),t.walkTokens(r,(h)=>{if(h.type!=="def")return;let x=h;if(!Object.hasOwn(s,x.tag))s[x.tag]={href:x.href,title:x.title}}),structuredClone(c)}}}var fe=new Map;self.onmessage=(t)=>{let e=t.data;if(e.type==="dispose"){fe.delete(e.clientId);return}let{clientId:r,revision:s,source:n}=e,a;try{let i=fe.get(r);if(i===void 0)i=Xe(),fe.set(r,i);a={clientId:r,revision:s,ok:!0,tokens:i.parse(n)}}catch(i){a={clientId:r,revision:s,ok:!1,error:i instanceof Error?i.message:String(i)}}self.postMessage(a)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Wr}from"../chunk-
|
|
1
|
+
import{Wr}from"../chunk-hwmpcj3y.js";import"../chunk-4h07zyxp.js";import"../chunk-x0h0g1ma.js";import"../chunk-9rf3qecr.js";import"../chunk-pwcw4zp2.js";import"../chunk-xqwbn2ph.js";import"../chunk-f0kgxjp1.js";export{Wr as ModelAliasSettings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{wo,$r,ko,So,_o,Sn}from"../chunk-
|
|
1
|
+
import{wo,$r,ko,So,_o,Sn}from"../chunk-vet6snkp.js";import"../chunk-zah37d5q.js";import"../chunk-z7ehwkcq.js";import"../chunk-twx75z08.js";import"../chunk-3yq0a0f1.js";import"../chunk-4h07zyxp.js";import"../chunk-x0h0g1ma.js";import"../chunk-xbp4r3n4.js";import"../chunk-vypkwd0x.js";import"../chunk-0yqb54zg.js";import"../chunk-xmks1g9y.js";import"../chunk-pwcw4zp2.js";import"../chunk-qdgsg6v4.js";import"../chunk-tjfjvzv5.js";import"../chunk-vjmgh1q9.js";import"../chunk-vnr9rqs6.js";import"../chunk-xqwbn2ph.js";import"../chunk-f0kgxjp1.js";export{Sn as CustomProviderEditor,wo as ManagedProviderSection,_o as ProviderRow,$r as ProviderSection,ko as ProviderTabs,So as TestFeedback};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Po,Io,Kr,qr,At,Et}from"../chunk-
|
|
1
|
+
import{Po,Io,Kr,qr,At,Et}from"../chunk-zah37d5q.js";import"../chunk-z7ehwkcq.js";import"../chunk-4h07zyxp.js";import"../chunk-x0h0g1ma.js";export{Po as PROVIDERS_CHANGED,Io as PROVIDERS_REVOKED,At as applyProvidersWhenIdle,qr as createManagedProvidersPort,Kr as createProvidersPort,Et as useProviders};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q,No,Ye,Mo,Xe,Yr,X,Dt,Ht,Xr,Ao,ea}from"../chunk-
|
|
1
|
+
import{q,No,Ye,Mo,Xe,Yr,X,Dt,Ht,Xr,Ao,ea}from"../chunk-4h07zyxp.js";import"../chunk-x0h0g1ma.js";export{Ao as MODEL_PRESENTATION,q as PROVIDERS,Xr as customModelEffort,Xe as gatewayModelId,No as isAccountModel,Ye as parseCustomModels,ea as presentModel,Ht as providerApplicationPending,Mo as providerGroups,Dt as providerKeyUrl,X as providerRegion,Yr as resolveSessionModel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Zr,Qr,Jr}from"../chunk-00z352ph.js";import"../chunk-vjmgh1q9.js";import"../chunk-qdgsg6v4.js";import"../chunk-vypkwd0x.js";import"../chunk-tjfjvzv5.js";import"../chunk-vnr9rqs6.js";import"../chunk-f0kgxjp1.js";import"../chunk-xqwbn2ph.js";import"../chunk-pwcw4zp2.js";import"../chunk-xbp4r3n4.js";import"../chunk-xmks1g9y.js";import"../chunk-0yqb54zg.js";import{Ft}from"../chunk-3yq0a0f1.js";import{Rt,To,Lt}from"../chunk-twx75z08.js";import{Ot,Ut,Bt,Gt}from"../chunk-x0h0g1ma.js";import{q,No,Ye,Mo,Xe,Yr,X,Dt,Ht,Xr,Ao,ea}from"../chunk-
|
|
1
|
+
import{Zr,Qr,Jr}from"../chunk-00z352ph.js";import"../chunk-vjmgh1q9.js";import"../chunk-qdgsg6v4.js";import"../chunk-vypkwd0x.js";import"../chunk-tjfjvzv5.js";import"../chunk-vnr9rqs6.js";import"../chunk-f0kgxjp1.js";import"../chunk-xqwbn2ph.js";import"../chunk-pwcw4zp2.js";import"../chunk-xbp4r3n4.js";import"../chunk-xmks1g9y.js";import"../chunk-0yqb54zg.js";import{Ft}from"../chunk-3yq0a0f1.js";import{Rt,To,Lt}from"../chunk-twx75z08.js";import{Ot,Ut,Bt,Gt}from"../chunk-x0h0g1ma.js";import{q,No,Ye,Mo,Xe,Yr,X,Dt,Ht,Xr,Ao,ea}from"../chunk-4h07zyxp.js";import"../chunk-z7ehwkcq.js";import{Po,Io,Kr,qr,At,Et}from"../chunk-zah37d5q.js";import{wo,$r,ko,So,_o,Sn}from"../chunk-vet6snkp.js";import{et,zt,Vt}from"../chunk-9rf3qecr.js";import{Wr}from"../chunk-hwmpcj3y.js";export{Lt as CodexAccountCard,To as CodexAccountSummary,Sn as CustomProviderEditor,Ot as DeepSeekLogo,Ut as GrokLogo,Ft as LoginCard,et as MODEL_ALIASES_KEY,Ao as MODEL_PRESENTATION,wo as ManagedProviderSection,Wr as ModelAliasSettings,Bt as OpenRouterLogo,q as PROVIDERS,Po as PROVIDERS_CHANGED,Io as PROVIDERS_REVOKED,_o as ProviderRow,$r as ProviderSection,ko as ProviderTabs,Gt as QwenLogo,So as TestFeedback,Rt as UsageLimitRow,At as applyProvidersWhenIdle,Zr as codexSettingsBridge,qr as createManagedProvidersPort,Kr as createProvidersPort,Jr as createSettingsBridgeClient,Xr as customModelEffort,Xe as gatewayModelId,No as isAccountModel,Ye as parseCustomModels,ea as presentModel,Ht as providerApplicationPending,Mo as providerGroups,Dt as providerKeyUrl,X as providerRegion,Yr as resolveSessionModel,Vt as saveModelAlias,Qr as serveSettingsBridge,zt as useModelAliases,Et as useProviders};
|
|
@@ -26,13 +26,13 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
26
26
|
- cipher@0.5.2: MIT OR Apache-2.0; licenses/cipher-0.5.2/
|
|
27
27
|
- cmake@0.1.58: MIT OR Apache-2.0; licenses/cmake-0.1.58/
|
|
28
28
|
- cmov@0.5.4: Apache-2.0 OR MIT; licenses/cmov-0.5.4/
|
|
29
|
-
- const-oid@0.10.
|
|
29
|
+
- const-oid@0.10.3: Apache-2.0 OR MIT; licenses/const-oid-0.10.3/
|
|
30
30
|
- constant_time_eq@0.6.1: CC0-1.0 OR MIT-0 OR Apache-2.0; licenses/constant_time_eq-0.6.1/
|
|
31
31
|
- core-foundation@0.10.1: MIT OR Apache-2.0; licenses/core-foundation-0.10.1/
|
|
32
32
|
- core-foundation-sys@0.8.7: MIT OR Apache-2.0; licenses/core-foundation-sys-0.8.7/
|
|
33
33
|
- cpubits@0.1.1: MIT OR Apache-2.0; licenses/cpubits-0.1.1/
|
|
34
34
|
- cpufeatures@0.3.1: MIT OR Apache-2.0; licenses/cpufeatures-0.3.1/
|
|
35
|
-
- crc32fast@1.5.
|
|
35
|
+
- crc32fast@1.5.5: MIT OR Apache-2.0; licenses/crc32fast-1.5.5/
|
|
36
36
|
- crypto-common@0.2.2: MIT OR Apache-2.0; licenses/crypto-common-0.2.2/
|
|
37
37
|
- ctutils@0.4.8: Apache-2.0 OR MIT; licenses/ctutils-0.4.8/
|
|
38
38
|
- dary_heap@0.3.9: MIT OR Apache-2.0; licenses/dary_heap-0.3.9/
|
|
@@ -42,7 +42,7 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
42
42
|
- displaydoc@0.2.7: MIT OR Apache-2.0; licenses/displaydoc-0.2.7/
|
|
43
43
|
- dunce@1.0.5: CC0-1.0 OR MIT-0 OR Apache-2.0; licenses/dunce-1.0.5/
|
|
44
44
|
- equivalent@1.0.3: Apache-2.0 OR MIT; licenses/equivalent-1.0.3/
|
|
45
|
-
- errno@0.3.
|
|
45
|
+
- errno@0.3.15: MIT OR Apache-2.0; licenses/errno-0.3.15/
|
|
46
46
|
- fallible-iterator@0.3.0: MIT/Apache-2.0; licenses/fallible-iterator-0.3.0/
|
|
47
47
|
- fallible-streaming-iterator@0.1.9: MIT/Apache-2.0; licenses/fallible-streaming-iterator-0.1.9/
|
|
48
48
|
- fastrand@2.5.0: Apache-2.0 OR MIT; licenses/fastrand-2.5.0/
|
|
@@ -85,7 +85,7 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
85
85
|
- indexmap@2.14.2: Apache-2.0 OR MIT; licenses/indexmap-2.14.2/
|
|
86
86
|
- inout@0.2.6: MIT OR Apache-2.0; licenses/inout-0.2.6/
|
|
87
87
|
- ipnet@2.12.2: MIT OR Apache-2.0; licenses/ipnet-2.12.2/
|
|
88
|
-
- itoa@1.0.
|
|
88
|
+
- itoa@1.0.19: MIT OR Apache-2.0; licenses/itoa-1.0.19/
|
|
89
89
|
- jieba-macros@0.11.0: MIT; licenses/jieba-macros-0.11.0/; source: https://raw.githubusercontent.com/messense/jieba-rs/3a0d75cf7455e2006330a5b4e94156da272cd7b9/LICENSE
|
|
90
90
|
- jieba-rs@0.11.0: MIT; licenses/jieba-rs-0.11.0/; source: https://raw.githubusercontent.com/messense/jieba-rs/3a0d75cf7455e2006330a5b4e94156da272cd7b9/LICENSE
|
|
91
91
|
- jobserver@0.1.35: MIT OR Apache-2.0; licenses/jobserver-0.1.35/
|
|
@@ -130,12 +130,12 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
130
130
|
- rev_lines@0.3.0: MIT (declared in its Cargo.toml; upstream publishes no licence text, standard MIT text with its declared authors); licenses/rev_lines-0.3.0/; source: https://github.com/mikeycgto/rev_lines
|
|
131
131
|
- ring@0.17.14: Apache-2.0 AND ISC; licenses/ring-0.17.14/
|
|
132
132
|
- rle-decode-fast@1.0.3: MIT OR Apache-2.0; licenses/rle-decode-fast-1.0.3/
|
|
133
|
-
- rusqlite@0.
|
|
133
|
+
- rusqlite@0.43.0: MIT; licenses/rusqlite-0.43.0/
|
|
134
134
|
- rustc-hash@2.1.3: Apache-2.0 OR MIT; licenses/rustc-hash-2.1.3/
|
|
135
135
|
- rustc_version@0.4.1: MIT OR Apache-2.0; licenses/rustc_version-0.4.1/
|
|
136
136
|
- rustix@1.1.6: Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT; licenses/rustix-1.1.6/
|
|
137
137
|
- rustls@0.23.46: Apache-2.0 OR ISC OR MIT; licenses/rustls-0.23.46/
|
|
138
|
-
- rustls-pki-types@1.
|
|
138
|
+
- rustls-pki-types@1.16.0: MIT OR Apache-2.0; licenses/rustls-pki-types-1.16.0/
|
|
139
139
|
- rustls-platform-verifier@0.7.1: MIT OR Apache-2.0; licenses/rustls-platform-verifier-0.7.1/
|
|
140
140
|
- rustls-webpki@0.103.16: ISC; licenses/rustls-webpki-0.103.16/
|
|
141
141
|
- rustversion@1.0.23: MIT OR Apache-2.0; licenses/rustversion-1.0.23/
|
|
@@ -161,7 +161,7 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
161
161
|
- stop-words@0.10.1: MIT OR Apache-2.0; licenses/stop-words-0.10.1/
|
|
162
162
|
- subtle@2.6.1: BSD-3-Clause; licenses/subtle-2.6.1/
|
|
163
163
|
- syn@2.0.119: MIT OR Apache-2.0; licenses/syn-2.0.119/
|
|
164
|
-
- syn@3.0.
|
|
164
|
+
- syn@3.0.10: MIT OR Apache-2.0; licenses/syn-3.0.10/
|
|
165
165
|
- sync_wrapper@1.0.2: Apache-2.0; licenses/sync_wrapper-1.0.2/
|
|
166
166
|
- synstructure@0.14.0: MIT; licenses/synstructure-0.14.0/
|
|
167
167
|
- tempfile@3.27.0: MIT OR Apache-2.0; licenses/tempfile-3.27.0/
|
|
@@ -202,10 +202,10 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
202
202
|
- zerotrie@0.2.5: Unicode-3.0; licenses/zerotrie-0.2.5/
|
|
203
203
|
- zerovec@0.11.9: Unicode-3.0; licenses/zerovec-0.11.9/
|
|
204
204
|
- zerovec-derive@0.11.7: Unicode-3.0; licenses/zerovec-derive-0.11.7/
|
|
205
|
-
- zip@9.
|
|
205
|
+
- zip@9.5.1: MIT; licenses/zip-9.5.1/
|
|
206
206
|
- zlib-rs@0.6.8: Zlib; licenses/zlib-rs-0.6.8/
|
|
207
207
|
- zmij@1.0.23: MIT; licenses/zmij-1.0.23/
|
|
208
208
|
- zopfli@0.8.4: Apache-2.0; licenses/zopfli-0.8.4/
|
|
209
|
-
- zstd@0.14.
|
|
210
|
-
- zstd-safe@8.
|
|
211
|
-
- zstd-sys@2.1.
|
|
209
|
+
- zstd@0.14.4: BSD-3-Clause; licenses/zstd-0.14.4/
|
|
210
|
+
- zstd-safe@8.3.0: BSD-3-Clause; licenses/zstd-safe-8.3.0/
|
|
211
|
+
- zstd-sys@2.1.3+zstd.1.5.7: BSD-3-Clause AND BSD-2-Clause; licenses/zstd-sys-2.1.3+zstd.1.5.7/
|
|
Binary file
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
The decoders for legacy formats, in zstd/lib/legacy/, include code under the
|
|
2
|
+
2-clause BSD license:
|
|
3
|
+
|
|
4
|
+
BSD 2-Clause License
|
|
5
|
+
|
|
6
|
+
Copyright (C) 2013-2016, Yann Collet.
|
|
7
|
+
|
|
8
|
+
Redistribution and use in source and binary forms, with or without
|
|
9
|
+
modification, are permitted provided that the following conditions are
|
|
10
|
+
met:
|
|
11
|
+
|
|
12
|
+
* Redistributions of source code must retain the above copyright
|
|
13
|
+
notice, this list of conditions and the following disclaimer.
|
|
14
|
+
* Redistributions in binary form must reproduce the above
|
|
15
|
+
copyright notice, this list of conditions and the following disclaimer
|
|
16
|
+
in the documentation and/or other materials provided with the
|
|
17
|
+
distribution.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
20
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
21
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
22
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
23
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
24
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
25
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
26
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
27
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
28
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -26,11 +26,11 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
26
26
|
- cipher@0.5.2: MIT OR Apache-2.0; licenses/cipher-0.5.2/
|
|
27
27
|
- cmake@0.1.58: MIT OR Apache-2.0; licenses/cmake-0.1.58/
|
|
28
28
|
- cmov@0.5.4: Apache-2.0 OR MIT; licenses/cmov-0.5.4/
|
|
29
|
-
- const-oid@0.10.
|
|
29
|
+
- const-oid@0.10.3: Apache-2.0 OR MIT; licenses/const-oid-0.10.3/
|
|
30
30
|
- constant_time_eq@0.6.1: CC0-1.0 OR MIT-0 OR Apache-2.0; licenses/constant_time_eq-0.6.1/
|
|
31
31
|
- cpubits@0.1.1: MIT OR Apache-2.0; licenses/cpubits-0.1.1/
|
|
32
32
|
- cpufeatures@0.3.1: MIT OR Apache-2.0; licenses/cpufeatures-0.3.1/
|
|
33
|
-
- crc32fast@1.5.
|
|
33
|
+
- crc32fast@1.5.5: MIT OR Apache-2.0; licenses/crc32fast-1.5.5/
|
|
34
34
|
- crypto-common@0.2.2: MIT OR Apache-2.0; licenses/crypto-common-0.2.2/
|
|
35
35
|
- ctutils@0.4.8: Apache-2.0 OR MIT; licenses/ctutils-0.4.8/
|
|
36
36
|
- dary_heap@0.3.9: MIT OR Apache-2.0; licenses/dary_heap-0.3.9/
|
|
@@ -81,7 +81,7 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
81
81
|
- indexmap@2.14.2: Apache-2.0 OR MIT; licenses/indexmap-2.14.2/
|
|
82
82
|
- inout@0.2.6: MIT OR Apache-2.0; licenses/inout-0.2.6/
|
|
83
83
|
- ipnet@2.12.2: MIT OR Apache-2.0; licenses/ipnet-2.12.2/
|
|
84
|
-
- itoa@1.0.
|
|
84
|
+
- itoa@1.0.19: MIT OR Apache-2.0; licenses/itoa-1.0.19/
|
|
85
85
|
- jieba-macros@0.11.0: MIT; licenses/jieba-macros-0.11.0/; source: https://raw.githubusercontent.com/messense/jieba-rs/3a0d75cf7455e2006330a5b4e94156da272cd7b9/LICENSE
|
|
86
86
|
- jieba-rs@0.11.0: MIT; licenses/jieba-rs-0.11.0/; source: https://raw.githubusercontent.com/messense/jieba-rs/3a0d75cf7455e2006330a5b4e94156da272cd7b9/LICENSE
|
|
87
87
|
- jobserver@0.1.35: MIT OR Apache-2.0; licenses/jobserver-0.1.35/
|
|
@@ -125,11 +125,11 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
125
125
|
- rev_lines@0.3.0: MIT (declared in its Cargo.toml; upstream publishes no licence text, standard MIT text with its declared authors); licenses/rev_lines-0.3.0/; source: https://github.com/mikeycgto/rev_lines
|
|
126
126
|
- ring@0.17.14: Apache-2.0 AND ISC; licenses/ring-0.17.14/
|
|
127
127
|
- rle-decode-fast@1.0.3: MIT OR Apache-2.0; licenses/rle-decode-fast-1.0.3/
|
|
128
|
-
- rusqlite@0.
|
|
128
|
+
- rusqlite@0.43.0: MIT; licenses/rusqlite-0.43.0/
|
|
129
129
|
- rustc-hash@2.1.3: Apache-2.0 OR MIT; licenses/rustc-hash-2.1.3/
|
|
130
130
|
- rustc_version@0.4.1: MIT OR Apache-2.0; licenses/rustc_version-0.4.1/
|
|
131
131
|
- rustls@0.23.46: Apache-2.0 OR ISC OR MIT; licenses/rustls-0.23.46/
|
|
132
|
-
- rustls-pki-types@1.
|
|
132
|
+
- rustls-pki-types@1.16.0: MIT OR Apache-2.0; licenses/rustls-pki-types-1.16.0/
|
|
133
133
|
- rustls-platform-verifier@0.7.1: MIT OR Apache-2.0; licenses/rustls-platform-verifier-0.7.1/
|
|
134
134
|
- rustls-webpki@0.103.16: ISC; licenses/rustls-webpki-0.103.16/
|
|
135
135
|
- rustversion@1.0.23: MIT OR Apache-2.0; licenses/rustversion-1.0.23/
|
|
@@ -152,7 +152,7 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
152
152
|
- stop-words@0.10.1: MIT OR Apache-2.0; licenses/stop-words-0.10.1/
|
|
153
153
|
- subtle@2.6.1: BSD-3-Clause; licenses/subtle-2.6.1/
|
|
154
154
|
- syn@2.0.119: MIT OR Apache-2.0; licenses/syn-2.0.119/
|
|
155
|
-
- syn@3.0.
|
|
155
|
+
- syn@3.0.10: MIT OR Apache-2.0; licenses/syn-3.0.10/
|
|
156
156
|
- sync_wrapper@1.0.2: Apache-2.0; licenses/sync_wrapper-1.0.2/
|
|
157
157
|
- synstructure@0.14.0: MIT; licenses/synstructure-0.14.0/
|
|
158
158
|
- tempfile@3.27.0: MIT OR Apache-2.0; licenses/tempfile-3.27.0/
|
|
@@ -195,10 +195,10 @@ ALwith native implementations are proprietary. Dependencies retain their own lic
|
|
|
195
195
|
- zerotrie@0.2.5: Unicode-3.0; licenses/zerotrie-0.2.5/
|
|
196
196
|
- zerovec@0.11.9: Unicode-3.0; licenses/zerovec-0.11.9/
|
|
197
197
|
- zerovec-derive@0.11.7: Unicode-3.0; licenses/zerovec-derive-0.11.7/
|
|
198
|
-
- zip@9.
|
|
198
|
+
- zip@9.5.1: MIT; licenses/zip-9.5.1/
|
|
199
199
|
- zlib-rs@0.6.8: Zlib; licenses/zlib-rs-0.6.8/
|
|
200
200
|
- zmij@1.0.23: MIT; licenses/zmij-1.0.23/
|
|
201
201
|
- zopfli@0.8.4: Apache-2.0; licenses/zopfli-0.8.4/
|
|
202
|
-
- zstd@0.14.
|
|
203
|
-
- zstd-safe@8.
|
|
204
|
-
- zstd-sys@2.1.
|
|
202
|
+
- zstd@0.14.4: BSD-3-Clause; licenses/zstd-0.14.4/
|
|
203
|
+
- zstd-safe@8.3.0: BSD-3-Clause; licenses/zstd-safe-8.3.0/
|
|
204
|
+
- zstd-sys@2.1.3+zstd.1.5.7: BSD-3-Clause AND BSD-2-Clause; licenses/zstd-sys-2.1.3+zstd.1.5.7/
|
|
Binary file
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
The decoders for legacy formats, in zstd/lib/legacy/, include code under the
|
|
2
|
+
2-clause BSD license:
|
|
3
|
+
|
|
4
|
+
BSD 2-Clause License
|
|
5
|
+
|
|
6
|
+
Copyright (C) 2013-2016, Yann Collet.
|
|
7
|
+
|
|
8
|
+
Redistribution and use in source and binary forms, with or without
|
|
9
|
+
modification, are permitted provided that the following conditions are
|
|
10
|
+
met:
|
|
11
|
+
|
|
12
|
+
* Redistributions of source code must retain the above copyright
|
|
13
|
+
notice, this list of conditions and the following disclaimer.
|
|
14
|
+
* Redistributions in binary form must reproduce the above
|
|
15
|
+
copyright notice, this list of conditions and the following disclaimer
|
|
16
|
+
in the documentation and/or other materials provided with the
|
|
17
|
+
distribution.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
20
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
21
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
22
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
23
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
24
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
25
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
26
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
27
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
28
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwith/module-chat",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.17",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -387,7 +387,7 @@
|
|
|
387
387
|
"prepack": "bun run build && bun test ../../scripts/__tests__/chat-worker-distribution.test.ts && bun ../../scripts/verify-module-package.ts chat"
|
|
388
388
|
},
|
|
389
389
|
"devDependencies": {
|
|
390
|
-
"@agentclientprotocol/sdk": "^2.
|
|
390
|
+
"@agentclientprotocol/sdk": "^2.7.0",
|
|
391
391
|
"@alwith/api": "^0.6.1",
|
|
392
392
|
"@happy-dom/global-registrator": "^21.0.4",
|
|
393
393
|
"@tauri-apps/api": "^3.0.0-alpha.3",
|
|
@@ -406,10 +406,10 @@
|
|
|
406
406
|
"@dnd-kit/sortable": "^10.0.0",
|
|
407
407
|
"@dnd-kit/utilities": "^3.2.2",
|
|
408
408
|
"@floating-ui/dom": "^1.8.0",
|
|
409
|
-
"@nyssance/codex-acp-v2": "^0.7.
|
|
409
|
+
"@nyssance/codex-acp-v2": "^0.7.70",
|
|
410
410
|
"@nyssance/shadcn": "^4.23.4",
|
|
411
411
|
"@shadcn/react": "^0.3.1",
|
|
412
|
-
"@solar-icons/react": "^2.
|
|
412
|
+
"@solar-icons/react": "^2.5.0",
|
|
413
413
|
"ansi_up": "^6.0.6",
|
|
414
414
|
"class-variance-authority": "^0.7.1",
|
|
415
415
|
"cn": "^0.5.2",
|
|
@@ -420,10 +420,10 @@
|
|
|
420
420
|
"highlight.js": "^11.12.0",
|
|
421
421
|
"katex": "^0.19.1",
|
|
422
422
|
"ldrs": "^1.1.9",
|
|
423
|
-
"lucide-react": "^1.
|
|
424
|
-
"marked": "^18.
|
|
423
|
+
"lucide-react": "^1.72.0",
|
|
424
|
+
"marked": "^18.2.0",
|
|
425
425
|
"marked-linkify-it": "^4.0.2",
|
|
426
|
-
"motion": "^14.
|
|
426
|
+
"motion": "^14.13.0",
|
|
427
427
|
"smplr": "^1.2.0"
|
|
428
428
|
},
|
|
429
429
|
"license": "SEE LICENSE IN LICENSE",
|
package/dist/chunk-h7ackcd4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Eo,Ot,Ut,Bt,Gt}from"./chunk-x0h0g1ma.js";var a=[{id:"litellm",source:"account",name:"ALwith",models:[{id:"deepseek-V4.1-flash",label:"DS Flash"}],catalog:"alwith/models.json",config:{web_search:"disabled"}},{id:"anthropic",name:"Anthropic",apiType:"anthropic",baseUrl:"https://api.anthropic.com",keyUrl:"https://platform.claude.com/settings/keys",models:[{id:"claude-opus-5-5",label:"Opus 5.5"},{id:"claude-sonnet-5-5",label:"Sonnet 5.5"},{id:"claude-haiku-5-5",label:"Haiku 5.5"},{id:"claude-fable-5-2",label:"Fable 5.2"}],catalog:"anthropic/models.json",config:{web_search:"disabled"}},{id:"deepseek",name:"DeepSeek",baseUrl:"https://api.deepseek.com/",keyUrl:"https://platform.deepseek.com/api_keys",models:[{id:"deepseek-flash",label:"Flash",description:"Latest frontier agentic coding model with image input."}],catalog:"deepseek/models.json",config:{web_search:"disabled"}},{id:"openrouter",name:"OpenRouter",baseUrl:"https://openrouter.ai/api/v1",keyUrl:"https://openrouter.ai/keys",models:[{id:"moonshotai/kimi-k3",label:"Kimi K3"},{id:"minimax/minimax-m3",label:"MiniMax M3"},{id:"z-ai/glm-5.3",label:"GLM 5.3"},{id:"deepseek/deepseek-v4-pro",label:"DeepSeek V4 Pro"},{id:"qwen/qwen3.8-max-0902",label:"Qwen 3.8 Max"},{id:"x-ai/grok-4.6",label:"Grok 4.6"}],catalog:"openrouter/models.json"},{id:"qwen",name:"Qwen",regions:[{id:"intl",baseUrl:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",keyUrl:"https://modelstudio.console.alibabacloud.com/?tab=model#/api-key"},{id:"cn",baseUrl:"https://dashscope.aliyuncs.com/compatible-mode/v1",keyUrl:"https://bailian.console.aliyun.com/#/api-key"}],models:[{id:"qwen3.8-max",label:"3.8 Max"},{id:"qwen3.8-flash",label:"3.8 Flash"},{id:"qwen3.7-max",label:"3.7 Max"},{id:"qwen3.7-plus",label:"3.7 Plus"},{id:"qwen3.6-flash",label:"3.6 Flash"}],catalog:"qwen/models.json"},{id:"xai",name:"xAI",baseUrl:"https://api.x.ai/v1",keyUrl:"https://console.x.ai",models:[{id:"grok-4.6",label:"Grok 4.6"},{id:"grok-4.5",label:"Grok 4.5"},{id:"grok-4.3",label:"Grok 4.3"}],catalog:"xai/models.json"}];var l={models:[{slug:"glm-5.3",display_name:"GLM-5.3",description:"GLM-5.3 via the Responses API.",default_reasoning_level:"max",supported_reasoning_levels:[{effort:"low",description:"Low reasoning effort"},{effort:"high",description:"High reasoning effort"},{effort:"max",description:"Max reasoning effort"}],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text"],context_window:1e6,max_context_window:1e6,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"glm-5.3-flash",display_name:"GLM-5.3-Flash",description:"GLM-5.3-Flash via the Responses API.",default_reasoning_level:"max",supported_reasoning_levels:[{effort:"low",description:"Low reasoning effort"},{effort:"high",description:"High reasoning effort"},{effort:"max",description:"Max reasoning effort"}],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1e6,max_context_window:1e6,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"glm-5.2",display_name:"GLM-5.2",description:"GLM-5.2 via the Responses API.",default_reasoning_level:"max",supported_reasoning_levels:[{effort:"none",description:"Disable reasoning"},{effort:"high",description:"High reasoning effort"},{effort:"max",description:"Max reasoning effort"}],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text"],context_window:1e6,max_context_window:1e6,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"glm-5.1",display_name:"GLM-5.1",description:"GLM-5.1 via the Responses API.",default_reasoning_level:"high",supported_reasoning_levels:[],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text"],context_window:200000,max_context_window:200000,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"MiniMax-M3.1-Flash",display_name:"MiniMax M3.1 Flash",description:"MiniMax M3.1 Flash via the Responses API.",default_reasoning_level:"max",supported_reasoning_levels:[{effort:"low",description:"Low reasoning effort"},{effort:"medium",description:"Medium reasoning effort"},{effort:"high",description:"High reasoning effort"},{effort:"xhigh",description:"Xhigh reasoning effort"},{effort:"max",description:"Max reasoning effort"}],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1e6,max_context_window:1e6,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"MiniMax-M3",display_name:"MiniMax M3",description:"MiniMax M3 via the Responses API.",default_reasoning_level:"high",supported_reasoning_levels:[],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1e6,max_context_window:1e6,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"doubao-seed-evolving",display_name:"Doubao Seed Evolving",description:"Doubao Seed Evolving via the Responses API.",default_reasoning_level:"high",supported_reasoning_levels:[{effort:"minimal",description:"Disable reasoning"},{effort:"low",description:"Low reasoning effort"},{effort:"medium",description:"Medium reasoning effort"},{effort:"high",description:"High reasoning effort"}],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1024000,max_context_window:1024000,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"doubao-seed-2-1-pro-260915",display_name:"Doubao Seed 2.1 Pro",description:"Doubao Seed 2.1 Pro via the Responses API.",default_reasoning_level:"high",supported_reasoning_levels:[{effort:"minimal",description:"Disable reasoning"},{effort:"low",description:"Low reasoning effort"},{effort:"medium",description:"Medium reasoning effort"},{effort:"high",description:"High reasoning effort"}],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1024000,max_context_window:1024000,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"doubao-seed-2-1-lite-260915",display_name:"Doubao Seed 2.1 Lite",description:"Doubao Seed 2.1 Lite via the Responses API.",default_reasoning_level:"high",supported_reasoning_levels:[{effort:"minimal",description:"Disable reasoning"},{effort:"low",description:"Low reasoning effort"},{effort:"medium",description:"Medium reasoning effort"},{effort:"high",description:"High reasoning effort"}],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1024000,max_context_window:1024000,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"kimi-k3.1-pro",display_name:"Kimi K3.1 Pro",description:"Kimi K3.1 Pro via the Responses API.",default_reasoning_level:"max",supported_reasoning_levels:[{effort:"low",description:"Low reasoning effort"},{effort:"high",description:"High reasoning effort"},{effort:"max",description:"Max reasoning effort"}],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1048576,max_context_window:1048576,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"kimi-k3",display_name:"Kimi K3",description:"Kimi K3 via the Responses API.",default_reasoning_level:"max",supported_reasoning_levels:[{effort:"low",description:"Low reasoning effort"},{effort:"high",description:"High reasoning effort"},{effort:"max",description:"Max reasoning effort"}],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1048576,max_context_window:1048576,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"kimi-k2.7-code",display_name:"Kimi K2.7 Code",description:"Kimi K2.7 Code via the Responses API.",default_reasoning_level:"high",supported_reasoning_levels:[],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:262144,max_context_window:262144,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"mimo-v2.6-pro",display_name:"MiMo V2.6 Pro",description:"MiMo V2.6 Pro via the Responses API.",default_reasoning_level:"high",supported_reasoning_levels:[],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1048576,max_context_window:1048576,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"mimo-v2.6-flash",display_name:"MiMo V2.6 Flash",description:"MiMo V2.6 Flash via the Responses API.",default_reasoning_level:"high",supported_reasoning_levels:[],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1048576,max_context_window:1048576,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"doubao-seed-2.1-pro",display_name:"Doubao Seed 2.1 Pro",description:"Doubao Seed 2.1 Pro via the Responses API.",default_reasoning_level:"high",supported_reasoning_levels:[{effort:"minimal",description:"Disable reasoning"},{effort:"low",description:"Low reasoning effort"},{effort:"medium",description:"Medium reasoning effort"},{effort:"high",description:"High reasoning effort"}],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1024000,max_context_window:1024000,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"},{slug:"doubao-seed-2.1-lite",display_name:"Doubao Seed 2.1 Lite",description:"Doubao Seed 2.1 Lite via the Responses API.",default_reasoning_level:"high",supported_reasoning_levels:[{effort:"minimal",description:"Disable reasoning"},{effort:"low",description:"Low reasoning effort"},{effort:"medium",description:"Medium reasoning effort"},{effort:"high",description:"High reasoning effort"}],shell_type:"unified_exec",visibility:"list",supported_in_api:!0,priority:0,support_verbosity:!1,supports_reasoning_summary_parameter:!1,truncation_policy:{mode:"bytes",limit:1e4},experimental_supported_tools:[],input_modalities:["text","image"],context_window:1024000,max_context_window:1024000,base_instructions:"You are a coding agent helping the user complete tasks in their workspace. Follow the user and project instructions. Use the provided tools when needed, verify changes, and report results accurately.",include_apps_usage_instructions:!1,default_reasoning_summary:"none"}]};var p={"gateway:deepseek:deepseek-flash":{shortLabel:"Flash"},"gateway:litellm:deepseek-V4.1-flash":{shortLabel:"Flash",label:"DS Flash"}};var d=a,g={anthropic:Eo,deepseek:Ot,openrouter:Bt,qwen:Gt,xai:Ut};function m(e){let i=g[e];if(!i)throw Error(`Provider ${e} has no logo`);return i}var q=d.filter((e)=>e.source!=="account").map(({source:e,...i})=>({...i,logo:m(i.id)}));function No(e){return e!=null&&d.some((i)=>i.source==="account"&&e.startsWith(`gateway:${encodeURIComponent(i.id)}:`))}function Ye(e){let i=JSON.parse(e);if(!Array.isArray(i)||i.length===0)throw Error("Add at least one model");let o=new Set;return i.map((s)=>{if(typeof s!=="object"||s===null||Array.isArray(s))throw Error("Each model must be an object");let t=s,r=typeof t.label==="string"?t.label.trim():"",n=typeof t.api_id==="string"?t.api_id.trim():"";if(r===""||n==="")throw Error("Model label and API ID cannot be empty");if(o.has(n))throw Error("Model IDs must be unique");if(o.add(n),t.contextWindow!==void 0&&t.contextWindow!==null&&(!Number.isSafeInteger(t.contextWindow)||t.contextWindow<=0))throw Error("Model contextWindow must be a positive integer");if(t.description!==void 0&&typeof t.description!=="string")throw Error("Model description must be a string");return{label:r,api_id:n,...t.contextWindow===void 0?{}:{contextWindow:t.contextWindow},...t.description===void 0?{}:{description:t.description}}})}function Mo(e){return[...q.filter((i)=>e.providers[i.id]!==void 0).map((i)=>({id:i.id,name:i.name,models:i.models})),...[...e.customProviders,...e.managedProviders??[]].map((i)=>({id:i.id,name:i.name,models:i.models.map((o)=>({id:o.api_id,label:o.label,...o.description==null?{}:{description:o.description}}))}))]}function Xe(e,i){let o=e.startsWith("custom_")?`custom-${Array.from(new TextEncoder().encode(e),(s)=>s.toString(16).padStart(2,"0")).join("")}`:e;return`gateway:${encodeURIComponent(o)}:${encodeURIComponent(i)}`}function Yr(e,i){let o=Mo(i).flatMap((s)=>s.models.map((t)=>Xe(s.id,t.id)));if(e!==null&&(!e.startsWith("gateway:")||o.includes(e)))return e;if(No(e))throw Error("The selected ALwith account model is unavailable. Select another model before sending.");return o[0]??null}function X(e,i){if(!e.regions)return null;let o=e.regions.find((s)=>s.id===i)??e.regions[0];if(!o)throw Error(`Provider ${e.id} declares no regions`);return o}function Dt(e,i){return X(e,i)?.keyUrl??e.keyUrl??null}function Ht(e){if(typeof e==="object"&&e!==null&&"code"in e&&e.code==="pending")return!0;return(e instanceof Error?e.message:typeof e==="string"?e:typeof e==="object"&&e!==null&&("message"in e)?String(e.message):String(e)).includes("Provider settings are pending")}function Xr(e){let i=e?.match(/^gateway:custom-[^:]+:(.+)$/);if(!i)return null;let o=decodeURIComponent(i[1]),s=l.models.find((t)=>t.slug===o);return s?{value:s.default_reasoning_level,hidden:s.supported_reasoning_levels.length===0}:null}var Ao=p;function ea(e){return Ao[e]??{}}
|
|
2
|
-
export{q,No,Ye,Mo,Xe,Yr,X,Dt,Ht,Xr,Ao,ea};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/native/win32-x64/licenses/{rustls-pki-types-1.15.1 → rustls-pki-types-1.16.0}/LICENSE-MIT
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/native/win32-x64/licenses/{zstd-sys-2.1.2+zstd.1.5.7 → zstd-sys-2.1.3+zstd.1.5.7}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|