feat: 支持离线运行时(runtime 目录)+ 动态生成自启 vbs
- FindNodeExe/FindDshBinJs/FindNpmCli:标准安装或应用旁 runtime 目录均可 - WriteServiceVbs 按当前环境动态生成(跨设备路径正确),启动时刷新 - 为离线安装包(Node 便携 + dsh 依赖内置)做准备
This commit is contained in:
1 parent
deba852624
commit
40a5640510
345 files changed
+353442
-19
No files matched your search
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"description" : "AutoLaunch Protocols Preregistration",
|
||||||
|
"name" : "Protocol Preregistration",
|
||||||
|
"version" : "1.0.0.12"
|
||||||
|
}
|
||||||
@@ -0,0 +1,125 @@
|
|||||||
|
{
|
||||||
|
"allow": [
|
||||||
|
{
|
||||||
|
"origins": [
|
||||||
|
"https://.get.microsoft.com",
|
||||||
|
"https://.apps.microsoft.com"
|
||||||
|
],
|
||||||
|
"protocol": "ms-windows-store"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"origins": [
|
||||||
|
"https://.onedrive.com",
|
||||||
|
"https://.onedrive.live.com",
|
||||||
|
"https://sharepoint.com"
|
||||||
|
],
|
||||||
|
"protocol": "ms-word"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"origins": [
|
||||||
|
"^https://[a-z0-9-]*word-edit\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*word-view\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*onenote\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*eap\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*shared\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*afhs\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*vhs\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*optin\\.online\\.office\\.com/$"
|
||||||
|
],
|
||||||
|
"use_regex": true,
|
||||||
|
"protocol": "ms-word"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"origins": [
|
||||||
|
"https://.onedrive.com",
|
||||||
|
"https://.onedrive.live.com",
|
||||||
|
"https://sharepoint.com"
|
||||||
|
],
|
||||||
|
"protocol": "ms-excel"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"origins": [
|
||||||
|
"^https://[a-z0-9-]*excel\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*onenote\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*eap\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*shared\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*afhs\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*vhs\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*optin\\.online\\.office\\.com/$"
|
||||||
|
],
|
||||||
|
"use_regex": true,
|
||||||
|
"protocol": "ms-excel"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"origins": [
|
||||||
|
"https://.onedrive.com",
|
||||||
|
"https://.onedrive.live.com",
|
||||||
|
"https://sharepoint.com"
|
||||||
|
],
|
||||||
|
"protocol": "ms-powerpoint"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"origins": [
|
||||||
|
"^https://[a-z0-9-]*powerpoint\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*onenote\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*eap\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*shared\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*afhs\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*vhs\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*optin\\.online\\.office\\.com/$"
|
||||||
|
],
|
||||||
|
"use_regex": true,
|
||||||
|
"protocol": "ms-powerpoint"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"origins": [
|
||||||
|
"https://.onedrive.com",
|
||||||
|
"https://.onedrive.live.com",
|
||||||
|
"https://sharepoint.com"
|
||||||
|
],
|
||||||
|
"protocol": "ms-visio"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"origins": [
|
||||||
|
"^https://[a-z0-9-]*visio\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*onenote\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*eap\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*shared\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*afhs\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*vhs\\.officeapps\\.live\\.com/$",
|
||||||
|
"^https://[a-z0-9-]*optin\\.online\\.office\\.com/$"
|
||||||
|
],
|
||||||
|
"use_regex": true,
|
||||||
|
"protocol": "ms-visio"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"origins": [
|
||||||
|
"https://www.microsoft.com",
|
||||||
|
"https://copilot.microsoft.com"
|
||||||
|
],
|
||||||
|
"protocol": "ms-copilot"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"warn": [
|
||||||
|
{
|
||||||
|
"origins": [
|
||||||
|
"*"
|
||||||
|
],
|
||||||
|
"protocol": "ms-test-warn"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"block": [
|
||||||
|
{
|
||||||
|
"origins": [
|
||||||
|
"*"
|
||||||
|
],
|
||||||
|
"protocol": "ms-test-block"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"origins": [
|
||||||
|
"*"
|
||||||
|
],
|
||||||
|
"protocol": "applescript"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"description": "Microsoft CRLSet",
|
||||||
|
"name": "MicrosoftCRLSet",
|
||||||
|
"version": "6498.2025.9.4"
|
||||||
|
}
|
||||||
Whitespace-only changes.
Binary file not shown.
@@ -0,0 +1 @@
|
|||||||
|
level=none expiry=0
|
||||||
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,2 @@
|
|||||||
|
{
|
||||||
|
}
|
||||||
Binary file not shown.
Whitespace-only changes.
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"epochs": [ {
|
||||||
|
"calculation_time": "13431166270621045",
|
||||||
|
"config_version": 0,
|
||||||
|
"model_version": "0",
|
||||||
|
"padded_top_topics_start_index": 0,
|
||||||
|
"taxonomy_version": 0,
|
||||||
|
"top_topics_and_observing_domains": [ ]
|
||||||
|
} ],
|
||||||
|
"hex_encoded_hmac_key": "CB70FBE6FEFCCF5D8DE0800D0C77EEFF7A18DD3D57004D63C911493AE980144D",
|
||||||
|
"next_scheduled_calculation_time": "13431771070621077"
|
||||||
|
}
|
||||||
Whitespace-only changes.
Whitespace-only changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
|||||||
|
._boot_9gj4p_6{height:100%;display:grid;place-items:center;background:var(--dsw-alias-bg-base, #f9fafb)}._card_9gj4p_13{display:flex;flex-direction:column;align-items:center;gap:16px}._wordmark_9gj4p_20{font-size:16px;line-height:24px;font-weight:600;letter-spacing:.08em;color:var(--dsw-alias-label-primary, #0f1115)}._hint_9gj4p_28{font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary, #81858c)}._spinner_9gj4p_34{width:20px;height:20px;border-radius:50%;border:2px solid var(--dsw-alias-border-l2, rgb(0 0 0 / 10%));border-top-color:var(--dsw-alias-brand-primary, #3964fe);animation:_spin_9gj4p_34 .8s linear infinite}@keyframes _spin_9gj4p_34{to{transform:rotate(360deg)}}._failed_9gj4p_47{max-width:480px;display:flex;flex-direction:column;gap:8px}._failedTitle_9gj4p_54{font-size:14px;line-height:22px;font-weight:600;color:var(--dsw-alias-label-primary, #0f1115)}._failedItem_9gj4p_61{font-family:var(--ds-font-family-code, ui-monospace, "SF Mono", Menlo, Consolas, "Courier New");font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary, #61666b)}._dot_10orb_3,._matrix_10orb_4{--dsh-state-ongoing: var(--dsw-static-deepseek-450)}._dot_10orb_3{position:relative;display:inline-block;flex:none}._dot_10orb_3:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:50%;background:currentColor;opacity:.1}._dot_10orb_3:after{content:"";position:absolute;top:20%;right:20%;bottom:20%;left:20%;border-radius:50%;background:currentColor}._dot_10orb_3[data-state=done]{color:var(--dsw-alias-state-success-primary)}._dot_10orb_3[data-state=warning]{color:var(--dsw-alias-state-warn-primary)}._dot_10orb_3[data-state=error]{color:var(--dsw-alias-state-error-primary)}._matrix_10orb_4{flex:none;color:var(--dsh-state-ongoing)}._cell_10orb_54{fill:currentColor;opacity:.15;animation:_dsh-state-dot-chase_10orb_1 1s infinite}@keyframes _dsh-state-dot-chase_10orb_1{0%,12.4%{opacity:1}12.5%,24.9%{opacity:.6}25%,37.4%{opacity:.35}37.5%,to{opacity:.15}}._root_9cl6j_3{display:flex;flex-direction:column;width:100%;min-width:0}._row_9cl6j_10{position:relative;overflow:hidden;display:flex;align-items:center;height:24px;min-width:0}._row_9cl6j_10[data-expandable]{cursor:pointer}._leading_9cl6j_23{position:relative;flex:none;width:16px;height:16px;display:inline-flex;align-items:center;justify-content:center;margin-right:6px;padding:0;border:none;background:none;color:var(--dsw-alias-label-tertiary)}button._leading_9cl6j_23{cursor:pointer}._iconIdle_9cl6j_42{display:inline-flex;opacity:1;transition:opacity .1s ease}._chevronHover_9cl6j_48{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto;opacity:0;transition:opacity .1s ease}._row_9cl6j_10:hover ._iconIdle_9cl6j_42{opacity:0}._row_9cl6j_10:hover ._chevronHover_9cl6j_48{opacity:1}._title_9cl6j_64{flex:none;font-size:14px;line-height:24px;color:var(--dsw-alias-label-secondary)}._button_kz6gm_4{display:inline-flex;align-items:center;justify-content:center;gap:4px;border:none;border-radius:18px;cursor:pointer;font-size:14px;line-height:22px;color:var(--dsw-alias-label-primary);background:transparent;padding:0 14px}._button_kz6gm_4:disabled{cursor:not-allowed;opacity:.4}._md_kz6gm_24{height:36px}._sm_kz6gm_30{height:28px;font-size:12px;line-height:18px;padding:0 10px;border-radius:14px}._primary_kz6gm_38{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground)}._primary_kz6gm_38:hover:not(:disabled){background:var(--dsw-alias-button-primary-hover)}._ghost_kz6gm_47:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}._ghost_kz6gm_47:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active)}._outline_kz6gm_56{border:1px solid var(--dsw-alias-border-l2);background:transparent}._outline_kz6gm_56:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}._toolbar_kz6gm_65{background:var(--dsw-alias-button-tool-bar-fill)}._toolbar_kz6gm_65:hover:not(:disabled){background:var(--dsw-alias-button-tool-bar-hover)}._icon_kz6gm_73{display:inline-flex;width:16px;height:16px;align-items:center;justify-content:center}._pill_e3ygd_1{display:inline-flex;align-items:center;gap:4px;height:24px;padding:0 8px;border:none;border-radius:12px;font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2)}._interactive_e3ygd_15{cursor:pointer}._interactive_e3ygd_15:hover{background:var(--dsw-alias-interactive-bg-hover)}._active_e3ygd_23{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-button-ghost-active-fill);box-shadow:inset 0 0 0 1px var(--dsw-alias-button-ghost-active-border)}._wrap_1ao1y_1{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 8px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-1)}._wrap_1ao1y_1:focus-within{border-color:var(--dsw-alias-brand-primary)}._icon_1ao1y_16{display:inline-flex;width:16px;height:16px;align-items:center;justify-contenLine truncated
|
||||||
@@ -0,0 +1,112 @@
|
|||||||
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/langs/ruby-DEItuUFs.js","assets/langs/html-CfGypltT.js","assets/langs/css-CLj8gQPS.js","assets/langs/xml-sdJ4AIDG.js","assets/langs/java-CylS5w8V.js","assets/langs/sql-CRqJ_cUM.js","assets/vendor-Cjbwl5VI.js","assets/vendor-CjyC-hUb.css","assets/langs/cpp-DIPi6g--.js","assets/langs/c-BIGW1oBm.js","assets/langs/lua-BaeVxFsk.js","assets/langs/yaml-Buea-lGh.js","assets/langs/php-D-uCvoST.js","assets/langs/scss-D5BDwBP9.js"])))=>i.map(i=>d[i]);
|
||||||
|
var I5=Object.defineProperty;var $5=(n,r,i)=>r in n?I5(n,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[r]=i;var P=(n,r,i)=>$5(n,typeof r!="symbol"?r+"":r,i);import{c as H5,a as V5,b as A5,d as D5,t as F5,s as B5,j as z5,e as Z5,f as ge,g as c0,h as Pl,u as U5,m as kr,i as wt,k as rl,l as d3,n as h3,o as W5,p as p3,q as q5,r as f0,v as Gl}from"./vendor-Cjbwl5VI.js";function ni(n,r){for(var i=0;i<r.length;i++){const s=r[i];if(typeof s!="string"&&!Array.isArray(s)){for(const u in s)if(u!=="default"&&!(u in n)){const c=Object.getOwnPropertyDescriptor(s,u);c&&Object.defineProperty(n,u,c.get?c:{enumerable:!0,get:()=>s[u]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))s(u);new MutationObserver(u=>{for(const c of u)if(c.type==="childList")for(const h of c.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&s(h)}).observe(document,{childList:!0,subtree:!0});function i(u){const c={};return u.integrity&&(c.integrity=u.integrity),u.referrerPolicy&&(c.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?c.credentials="include":u.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(u){if(u.ep)return;u.ep=!0;const c=i(u);fetch(u.href,c)}})();function j1(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ol={exports:{}},p1={},il={exports:{}},Ce={};/**
|
||||||
|
* @license React
|
||||||
|
* react.production.min.js
|
||||||
|
*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/var d0;function Q5(){if(d0)return Ce;d0=1;var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),h=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),C=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),L=Symbol.iterator;function w(j){return j===null||typeof j!="object"?null:(j=L&&j[L]||j["@@iterator"],typeof j=="function"?j:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,E={};function T(j,O,oe){this.props=j,this.context=O,this.refs=E,this.updater=oe||_}T.prototype.isReactComponent={},T.prototype.setState=function(j,O){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,O,"setState")},T.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function B(){}B.prototype=T.prototype;function W(j,O,oe){this.props=j,this.context=O,this.refs=E,this.updater=oe||_}var z=W.prototype=new B;z.constructor=W,k(z,T.prototype),z.isPureReactComponent=!0;var ee=Array.isArray,Q=Object.prototype.hasOwnProperty,V={current:null},Z={key:!0,ref:!0,__self:!0,__source:!0};function ne(j,O,oe){var de,ve={},_e=null,be=null;if(O!=null)for(de in O.ref!==void 0&&(be=O.ref),O.key!==void 0&&(_e=""+O.key),O)Q.call(O,de)&&!Z.hasOwnProperty(de)&&(ve[de]=O[de]);var je=arguments.length-2;if(je===1)ve.children=oe;else if(1<je){for(var Re=Array(je),dt=0;dt<je;dt++)Re[dt]=arguments[dt+2];ve.children=Re}if(j&&j.defaultProps)for(de in je=j.defaultProps,je)ve[de]===void 0&&(ve[de]=je[de]);return{$$typeof:n,type:j,key:_e,ref:be,props:ve,_owner:V.current}}function I(j,O){return{$$typeof:n,type:j.type,key:O,ref:j.ref,props:j.props,_owner:j._owner}}function J(j){return typeof j=="object"&&j!==null&&j.$$typeof===n}function q(j){var O={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(oe){return O[oe]})}var ce=/\/+/g;function le(j,O){return typeof j=="object"&&j!==null&&j.key!=null?q(""+j.key):O.toString(36)}function he(j,O,oe,de,ve){var _e=typeof j;(_e==="undefined"||_e==="boolean")&&(j=null);var be=!1;if(j===null)be=!0;else switch(_e){case"string":case"number":be=!0;break;case"object":switch(j.$$typeof){case n:case r:be=!0}}if(be)return be=j,ve=ve(be),j=de===""?"."+le(be,0):de,ee(ve)?(oe="",j!=null&&(oe=j.replace(ce,"$&/")+"/"),he(ve,O,oe,"",function(dt){return dt})):ve!=null&&(J(ve)&&(ve=I(ve,oe+(!ve.key||be&&be.key===ve.key?"":(""+ve.key).replace(ce,"$&/")+"/")+j)),O.push(ve)),1;if(be=0,de=de===""?".":de+":",ee(j))for(var je=0;je<j.length;je++){_e=j[je];var Re=de+le(_e,je);be+=he(_e,O,oe,Re,ve)}else if(Re=w(j),typeof Re=="function")for(j=Re.call(j),je=0;!(_e=j.next()).done;)_e=_e.value,Re=de+le(_e,je++),be+=he(_e,O,oe,Re,ve);else if(_e==="object")throw O=String(j),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.");return be}function pe(j,O,oe){if(j==null)return j;var de=[],ve=0;return he(j,de,"","",function(_e){return O.call(oe,_e,ve++)}),de}function Se(j){if(j._status===-1){var O=j._result;O=O(),O.then(function(oe){(j._status===0||j._status===-1)&&(j._status=1,j._result=oe)},function(oe){(j._status===0||j._status===-1)&&(j._status=2,j._result=oe)}),j._status===-1&&(j._status=0,j._result=O)}if(j._status===1)return j._result.default;throw j._result}var we={current:null},U={transition:null},ie={ReactCurrentDispatcher:we,ReactCurrentBatchConfig:U,ReactCurrentOwner:V};function K(){throw Error("act(...) is not supported in production builds of React.")}return Ce.Children={map:pe,forEach:function(j,O,oe){pe(j,function(){O.apply(this,arguments)},oe)},count:function(j){var O=0;return pe(j,function(){O++}),O},toArray:function(j){return pe(j,function(O){return O})||[]},only:function(j){if(!J(j))throw Error("React.Children.only expected to receive a single React element child.");return j}},Ce.Component=T,Ce.Fragment=i,Ce.Profiler=u,Ce.PureComponent=W,Ce.StrictMode=s,Ce.Suspense=g,Ce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ie,Ce.act=K,Ce.cloneElement=function(j,O,oe){if(j==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+j+".");var de=k({},j.props),ve=j.key,_e=j.ref,be=j._owner;if(O!=null){if(O.ref!==void 0&&(_e=O.ref,be=V.current),O.key!==void 0&&(ve=""+O.key),j.type&&j.type.defaultProps)var je=j.type.defaultProps;for(Re in O)Q.call(O,Re)&&!Z.hasOwnProperty(Re)&&(de[Re]=O[Re]===void 0&&je!==void 0?je[Re]:O[Re])}var Re=arguments.length-2;if(Re===1)de.children=oe;else if(1<Re){je=Array(Re);for(var dt=0;dt<Re;dt++)je[dt]=arguments[dt+2];de.children=je}return{$$typLine truncated
|
||||||
|
* @license React
|
||||||
|
* react-jsx-runtime.production.min.js
|
||||||
|
*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/var p0;function K5(){if(p0)return p1;p0=1;var n=E1(),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,u=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function h(p,g,C){var v,L={},w=null,_=null;C!==void 0&&(w=""+C),g.key!==void 0&&(w=""+g.key),g.ref!==void 0&&(_=g.ref);for(v in g)s.call(g,v)&&!c.hasOwnProperty(v)&&(L[v]=g[v]);if(p&&p.defaultProps)for(v in g=p.defaultProps,g)L[v]===void 0&&(L[v]=g[v]);return{$$typeof:r,type:p,key:w,ref:_,props:L,_owner:u.current}}return p1.Fragment=i,p1.jsx=h,p1.jsxs=h,p1}var m0;function J5(){return m0||(m0=1,ol.exports=K5()),ol.exports}var f=J5();const G5=j1(f),Y5=ni({__proto__:null,default:G5},[f]);function ze(n){return n==null}function X5(n){return!ze(n)}function Yl(n){return n&&typeof n=="object"&&!Array.isArray(n)}function e6(n,r){return Object.fromEntries(Object.entries(n).filter(([i,s])=>r(i,s)))}function on(n,r){return Object.fromEntries(Object.entries(n).map(([i,s])=>[i,r(s,i)]))}function t6(n,r,i){if(!r)return{...n};const s={};for(const u of r)n[u]!==void 0&&(s[u]=n[u]);return s}function qt(n,r,i){return Object.defineProperty(n,r,{writable:!0,value:i,enumerable:!1})}function Qn(n,r){return arguments.length===1?i=>Qn(n,i):n in globalThis&&r instanceof globalThis[n]||Object.prototype.toString.call(r).slice(8,-1)===n}function ri(n){return Qn("ArrayBuffer",n)||Qn("SharedArrayBuffer",n)}function n6(n){return ri(n)||ArrayBuffer.isView(n)}var Wt;(function(n){n.is=ri,n.isSource=n6;function r(h){return ArrayBuffer.isView(h)?h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength):h}n.fromSource=r;function i(h){if(h=r(h),typeof Buffer<"u")return Buffer.from(h).toString("base64");let p="";const g=new Uint8Array(h);for(let C=0;C<g.byteLength;C++)p+=String.fromCharCode(g[C]);return btoa(p)}n.toBase64=i;function s(h){return typeof Buffer<"u"?r(Buffer.from(h,"base64")):Uint8Array.from(atob(h),p=>p.charCodeAt(0))}n.fromBase64=s;function u(h){return h=r(h),typeof Buffer<"u"?Buffer.from(h).toString("hex"):Array.from(new Uint8Array(h),p=>p.toString(16).padStart(2,"0")).join("")}n.toHex=u;function c(h){if(typeof Buffer<"u")return r(Buffer.from(h,"hex"));const p=h.length%2===0?h:h.slice(0,h.length-1),g=[];for(let C=0;C<p.length;C+=2)g.push(parseInt(`${p[C]}${p[C+1]}`,16));return Uint8Array.from(g).buffer}n.fromHex=c})(Wt||(Wt={}));Wt.fromBase64;Wt.toBase64;Wt.fromHex;Wt.toHex;function Tl(n,r=new Map){if(!n||typeof n!="object")return n;if(Qn("Date",n))return new Date(n.valueOf());if(Qn("RegExp",n))return new RegExp(n.source,n.flags);if(ri(n))return n.slice(0);if(ArrayBuffer.isView(n))return n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength);const i=r.get(n);if(i)return i;if(Array.isArray(n)){const u=[];return r.set(n,u),n.forEach((c,h)=>{u[h]=Reflect.apply(Tl,null,[c,r])}),u}const s=Object.create(Object.getPrototypeOf(n));r.set(n,s);for(const u of Reflect.ownKeys(n)){const c={...Reflect.getOwnPropertyDescriptor(n,u)};"value"in c&&(c.value=Reflect.apply(Tl,null,[c.value,r])),Reflect.defineProperty(s,u,c)}return s}function jr(n,r,i){if(n===r||!i&&ze(n)&&ze(r))return!0;if(typeof n!=typeof r||typeof n!="object"||!n||!r)return!1;function s(u,c){return u(n)?u(r)?c(n,r):!1:u(r)?!1:void 0}return s(Array.isArray,(u,c)=>u.length===c.length&&u.every((h,p)=>jr(h,c[p])))??s(Qn("Date"),(u,c)=>u.valueOf()===c.valueOf())??s(Qn("RegExp"),(u,c)=>u.source===c.source&&u.flags===c.flags)??s(ri,(u,c)=>{if(u.byteLength!==c.byteLength)return!1;const h=new Uint8Array(u),p=new Uint8Array(c);for(let g=0;g<h.length;g++)if(h[g]!==p[g])return!1;return!0})??Object.keys({...n,...r}).every(u=>jr(n[u],r[u],i))}function r6(n,r,i){const s=[];let u=0;for(let c=0;c<n.length;c++){const h=n.charCodeAt(c);if(h>=65&&h<=90){if(u===1){const p=n.charCodeAt(c+1);p>=97&&p<=122&&s.push(i),s.push(h+32)}else u!==0&&s.push(i),s.push(h+32);u=1}else h>=97&&h<=122?(s.push(h),u=2):r.includes(h)?(u!==0&&s.push(i),u=0):s.push(h)}return String.fromCharCode(...s)}function o6(n){return r6(n,[45,95],45)}const i6=o6;var C0;(function(n){n.millisecond=1,n.second=1e3,n.minute=n.second*60,n.hour=n.minute*60,n.day=n.hour*24,n.week=n.day*7;let r=new Date().getTimezoneOffset();function i(_){r=_}n.setTimezoneOffset=i;function s(){return r}n.getTimezoneOffset=s;function u(_=new Date,k){return typeof _=="number"&&(_=new Date(_)),k===void 0&&(k=r),Math.floor((_.valueOf()/n.minute-k)/1440)}n.getDateNumber=u;function c(_,k){const E=new Date(_*n.day);return k===void 0&&(k=r),new Date(+E+k*n.minute)}n.fromDateNumber=c;const h=/\d+(?:\.\d+)?/.source,p=new RegExp(`^${["w(?:eek(?:s)?)?","d(?:ay(?:s)?)?","h(?:our(?:s)?)?","m(?:in(?:ute)?(?:s)?)?","s(?:ec(?:ond)?(?:s)?)?"].map(_=>`(${h}${_})?`).join("")}$`);function g(_){const k=p.exec(_);return k?(parseFloat(k[1])*n.week||0)+(parseFloat(k[2])*n.day||0)+(parseFloat(k[3])*n.hour||0)+(parseFloat(k[4])*n.minute||0)+(parseFloat(k[5])*n.second||0):0}n.parseTime=g;function C(_){const k=g(_);return k?_=Date.noLine truncated
|
||||||
|
`);if(typeof(r==null?void 0:r.stack)!="string"){const h=new Error(r),p=h.stack.split(`
|
||||||
|
`);throw p.splice(1,1/0,...i()),h.stack=p.join(`
|
||||||
|
`),h}const u=r.stack.split(`
|
||||||
|
`);let c=u.indexOf(s[2]);if(c===-1)throw r;for(c-=n.offset;c>0&&u[c-1].endsWith(" (<anonymous>)");)c-=1;throw u.splice(c,1/0,...i()),r.stack=u.join(`
|
||||||
|
`),r}function Ko(n,r=si()){const i={offset:1,error:new Error};try{const s=n(i);return Un(s)&&"then"in s?s.then(void 0,u=>v0(i,u,r)):s}catch(s){v0(i,s,r)}}function si(n=0){const r=new Error;return()=>r.stack.split(`
|
||||||
|
`).slice(3+n)}function $l(n){return n!==null&&n!==!1&&n!==void 0}var v3=class{constructor(n){P(this,"ctx");P(this,"_hooks",{});this.ctx=n,qt(this,Y.tracker,{property:"ctx",noShadow:!0}),this.on("internal/listener",function(r,i,s){var u;if(r==="internal/update"&&!s.global)return((u=this.fiber._hooks)["internal/update"]??(u["internal/update"]=new oi))[s.prepend?"unshift":"push"](i)}),this.on("internal/update",function(r,i,s){const u=[...this._hooks["internal/update"]||[]],c=()=>(u.shift()??s).call(this,r,i,c);return c()},{global:!0,prepend:!0})}dispatch(n,r){const i=typeof r[0]=="object"||typeof r[0]=="function"?r.shift():null,s=r.shift();s.startsWith("internal/")||this.emit("internal/dispatch",n,s,r,i);const u=i==null?void 0:i[Be.filter];return(this._hooks[s]||[]).filter(c=>c.global||!u||u.call(i,c.ctx)).map(c=>c.callback.bind(i))}async parallel(...n){const r=(await Promise.allSettled(this.dispatch("emit",n).map(async i=>i(...n)))).filter(i=>i.status==="rejected");if(r.length)throw new AggregateError(r.map(i=>i.reason))}emit(...n){this.dispatch("emit",n).map(r=>r(...n))}async serial(...n){for(const r of this.dispatch("serial",n)){const i=await r(...n);if($l(i))return i}}bail(...n){for(const r of this.dispatch("bail",n)){const i=r(...n);if($l(i))return i}}waterfall(...n){const r=this.dispatch("waterfall",n),i=n.pop(),s=()=>(r.shift()??i)(...n);return n.push(s),s()}register(n,r,i,s){const u=s.prepend?"unshift":"push";return this.ctx.fiber.effect(()=>(r[u]({ctx:this.ctx,callback:i,...s}),()=>this.unregister(r,i)),n)}unregister(n,r){const i=n.findIndex(s=>s.callback===r);if(i>=0)return n.splice(i,1),!0}on(n,r,i){var h;typeof i!="object"&&(i={prepend:i}),this.ctx.fiber.assertActive(),r=this.ctx.reflect.bind(r);const s=this.bail(this.ctx,"internal/listener",n,r,i);if(s)return s;const u=(h=this._hooks)[n]||(h[n]=[]),c=`ctx.on(${typeof n=="string"?JSON.stringify(n):n.toString()})`;return this.register(c,u,r,i)}once(n,r,i){const s=this.on(n,function(...u){return s(),r.apply(this,u)},i);return s}};const Hl={s:n=>String(n),d:n=>Math.trunc(Number(n)),i:n=>Math.trunc(Number(n)),f:n=>Number(n),o:n=>JSON.stringify(n),O:n=>JSON.stringify(n),c:()=>"",C:(n,r,i)=>Jo.color(r,Jo.code(i.name,r.colors),n)};function u6(n){return n instanceof Error&&Array.isArray(n.errors)}var Jo=class{constructor(n,r){P(this,"service");this.service=r,Object.assign(this,n),this.error=this._method("error",0),this.info=this._method("info",1),this.warn=this._method("warn",2),this.debug=this._method("debug",3)}static color(n,r,i,s=""){return n.colors?`\x1B[3${r<8?r:"8;5;"+r}${n.colors>=2?s:""}m${i}\x1B[0m`:""+i}static code(n,r){let i=0;for(let u=0;u<n.length;u++)i=(i<<3)-i+n.charCodeAt(u)+13,i|=0;const s=r?r>=2?w3:y3:[];return s[Math.abs(i)%s.length]}static format(n,r){var h;const i=r.args.slice();i[0]instanceof Error?(i[0]=i[0].stack||i[0].message,i.unshift("%s")):typeof i[0]!="string"&&i.unshift("%o");let s=i.shift();s=s.replace(/%([a-zA-Z%])/g,(p,g)=>{var v;if(p==="%%")return"%";const C=((v=n.formatters)==null?void 0:v[g])??Hl[g];return typeof C=="function"?C(i.shift(),n,r):p});const u=((h=n.formatters)==null?void 0:h.o)??Hl.o;for(let p of i)typeof p=="object"&&p&&(p=u(p,n,r)),s+=" "+p;const{maxLength:c=10240}=n;return s.split(/\r?\n/g).map(p=>p.slice(0,c)+(p.length>c?"...":"")).join(`
|
||||||
|
`)}_method(n,r){return(...i)=>{var c,h;if(i.length===1&&i[0]instanceof Error){if(i[0].cause)this[n](i[0].cause);else if(u6(i[0])){i[0].errors.forEach(p=>this[n](p));return}}const s=++this.service._snMessage,u=Date.now();for(const p of this.service.exporters.values()){if((((c=p.levels)==null?void 0:c[this.name])??((h=p.levels)==null?void 0:h.default)??this.level??1)<r)continue;const g={sn:s,ts:u,type:n,level:r,name:this.name,...this.meta,args:i};p.export(g)}}}};const y3=[6,2,3,4,5,1],w3=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221];var Sr,x3=(Sr=class{constructor(r){P(this,"bufferSize",1e3);P(this,"buffer",[]);P(this,"ctx");P(this,"_snMessage",0);P(this,"_snExporter",0);P(this,"exporters",new Map);const i={property:"ctx",noShadow:!0},s=Qo("logger",ii(Object.getPrototypeOf(this),Function.prototype),i);return Object.assign(s,this),s.ctx=r,qt(s,Y.tracker,i),s.exporter({colors:3,export:u=>{s.buffer.push(u),s.buffer.length>s.bufferSize&&(s.buffer=s.buffer.slice(-s.bufferSize))}}),s}exporter(r){return this.ctx.effect(()=>(this.exporters.set(++this._snExporter,r),()=>this.exporters.delete(this._snExporter)),"ctx.logger.exporter()")}_resolveConfig(){let r=this.ctx[Y.intercept];const i=[];for(;"logger"in r;)Object.hasOwn(r,"logger")&&i.unshift(r.logger),r=Object.getPrototypeOf(r);return Object.assign({},...i)}[Y.invoke](r){const i=this._resolveConfig(),s=(this.ctx[Y.shadow]??this.ctx).fiber;return r??(r=i.name),r??(r=i6(s.name)),new Jo({name:r,level:i.level,meta:{fiber:new WeakRef(s)}},this)}},(()=>{for(const r of["error","info","warn","debug"])Sr.prototype[r]=function(...i){return this()[r](...i)}})(),Sr);function ll(n){const r=n.stack.split(`
|
||||||
|
`);return r.splice(0,2,`Error: ${n.message}`),n.stack=r.join(`
|
||||||
|
`),n}const a6=["prototype","then"];function ul(n){return typeof n=="symbol"||a6.includes(n)||parseInt(n).toString()===n||n.startsWith("_")}var Nl,y0=(Nl=class{constructor(n){P(this,"ctx");P(this,"store",Object.create(null));P(this,"props",Object.create(null));this.ctx=n,qt(this,Y.tracker,{property:"ctx",noShadow:!0}),this.mixin("reflect",["get","set","provide","accessor","mixin"]),this.mixin("fiber",["runtime","effect"]),this.mixin("registry",["inject","plugin"]),this.mixin("events",["on","once","parallel","emit","serial","bail","waterfall"])}get(n,r=!0){var i;return En(this.ctx,(i=this._getImpl(n,r))==null?void 0:i.value)}_getImpl(n,r=!0){const i=this.ctx[Y.isolate][n],s=i&&this.store[i];if(s&&!(r&&s.fiber.state!==2))return s}set(n,r,i){const s=this.ctx[Y.isolate][n],u=this.store[s];if(!u)throw new Error(`cannot set property "${n}" without provide`);if(u.fiber!==this.ctx.fiber)throw new Error(`cannot set property "${n}" in multiple fibers`);return u.value=r,!0}provide(n,r,i){return this.ctx.fiber.effect(()=>{var c,h;if(!this.props[n])(c=this.props)[n]??(c[n]={type:"service"});else if(this.props[n].type!=="service")throw new Error(`property "${n}" is already declared as ${this.props[n].type}`);this.props[n]={type:"service"},(h=this.ctx.root[Y.isolate])[n]??(h[n]=Symbol(n));const s=this.ctx[Y.isolate][n],u={name:n,value:r,fiber:this.ctx.fiber,check:i};if(this.store[s])throw new Error(`service "${n}" has been registered at <${this.store[s].fiber.name}>`);return this.store[s]=u,this.ctx.fiber.store[n]=u,this.ctx.fiber.state===2&&this.notify([n]),async()=>{delete this.store[s];const p=this.notify([n]);await Promise.allSettled(p.map(g=>g.await())),delete this.ctx.fiber.store[n]}},`ctx.provide(${JSON.stringify(n)})`)}notify(n,r=(i,s)=>i[Y.isolate][s]===this.ctx[Y.isolate][s]){var s;const i=[];for(const u of this.ctx.registry.values())for(const c of u.fibers){let h=!1;for(const p of n)p in c.inject&&r(c.ctx,p)&&(h=!0,c._checkImpl(p));h&&(c._refresh(),i.push(c))}for(const u of n){const c=Object.create(this.ctx);c[Y.filter]=h=>r(h,u),this.ctx.events.emit(c,"internal/service",u,(s=this._getImpl(u,!1))==null?void 0:s.value)}return i}accessor(n,r){return this.ctx.fiber.effect(()=>{if(n in this.props)throw new Error(`property "${n}" is already declared as ${this.props[n].type}`);return this.props[n]={type:"accessor",...r},()=>delete this.props[n]},`ctx.accessor(${JSON.stringify(n)})`)}mixin(n,r){const i=this;return this.ctx.fiber.effect(function*(){const s=Array.isArray(r)?r.map(c=>[c,c]):Object.entries(r),u=(c,h)=>c[n];for(const[c,h]of s)yield i.accessor(h,{get(p,g){const C=u(this);if(ze(C))return C;const v=p?x1(p,C):C,L=Reflect.get(C,c,v);return typeof L!="function"?L:L.bind(v??C)},set(p,g,C){const v=u(this),L=g?x1(g,v):v;return Reflect.set(v,c,p,L)}})},`ctx.mixin(${JSON.stringify(n)})`)}trace(n){return En(this.ctx,n)}bind(n){return new Proxy(n,{apply:(r,i,s)=>Reflect.apply(r,this.trace(i),s.map(u=>this.trace(u))),construct:(r,i,s)=>Reflect.construct(r,i.map(u=>this.trace(u)),s)})}},P(Nl,"handler",{get:(n,r,i)=>{if(ul(r))return Reflect.get(n,r,i);if(Reflect.has(n,r))return En(i,Reflect.get(n,r,i));const s=new Error(`cannot get property "${r}" without inject`);try{const u=n.reflect.props[r];return(u==null?void 0:u.type)==="accessor"?u.get.call(i,i[Y.receiver],s):i.fiber.runtime?i.events.waterfall("internal/get",i,r,s,()=>{var p;const c=n[Y.isolate][r];let h=(i[Y.shadow]??i).fiber;for(;;){const g=(p=h.store)==null?void 0:p[r];if(g)return En(i,g.value);if(r in h.inject)throw s.message=`cannot get required service "${r}" in inactive context`,s;if(!h.runtime||h.parent[Y.isolate][r]!==c)throw s;h=h.parent.fiber}}):i.reflect.get(r,!1)}catch(u){throw u===s?ll(u):u}},set:(n,r,i,s)=>{if(ul(r))return Reflect.set(n,r,i,s);const u=new Error(`cannot set property "${r}" without provide`),c=n.reflect.props[r];if(!c){if(!s.fiber.runtime)return Reflect.set(n,r,i,s);throw ll(u)}try{return c.type==="accessor"?c.set?c.set.call(s,i,s[Y.receiver],u):!1:s.events.waterfall("internal/set",s,r,i,u,()=>s.reflect.set(r,i,u))}catch(h){throw h===u?ll(h):h}},has:(n,r)=>ul(r)?Reflect.has(n,r):Reflect.has(n,r)?!0:!!n.reflect.props[r]}),Nl);const c6=Symbol.for("ValidationError");var eu=class extends TypeError{constructor(i){super(`invalid config:
|
||||||
|
`+i.map(s=>s.path?` - ${s.message} (at ${s.path.join(".")})`:` - ${s.message}`).join(`
|
||||||
|
`));P(this,"name","ValidationError")}};Object.defineProperty(eu.prototype,c6,{value:!0});function _3(n,r){if(!n.Config)return r;const i=n.Config["~standard"].validate(r);if("then"in i)throw new TypeError("Async config validation is not supported");if(i.issues)throw new eu(i.issues);return i.value}const L3=new WeakMap;function al(n){var i;const r=n();return((i=L3.get(n))==null?void 0:i())??r}function f6(n,r){const i=["internal/plugin",r];let s;try{s=n.events.dispatch("emit",i)}catch(u){n.logger.error(u);return}for(const u of s)try{const c=u(...i);Promise.resolve(c).catch(h=>n.logger.error(h))}catch(c){n.logger.error(c)}}var _1=class k3 extends Error{constructor(i,s){super(s??k3.Code[i]);P(this,"code");this.code=i}};(function(n){n.Code={INACTIVE_EFFECT:"cannot create effect on inactive context"}})(_1||(_1={}));const zt="__INACTIVE__";var tu=class{constructor(n,r,i,s,u){P(this,"parent");P(this,"inject");P(this,"runtime");P(this,"uid");P(this,"ctx");P(this,"config");P(this,"_config");P(this,"state",0);P(this,"dispose");P(this,"store");P(this,"inertia");P(this,"_hooks",Object.create(null));P(this,"_disposables",new oi);P(this,"context");P(this,"_error");P(this,"_runner");P(this,"_store",Object.create(null));this.parent=n,this.inject=i,this.runtime=s,this._config=r;const c=h=>{this._disposables.push(h)};if(s){this.uid=n.registry.counter,this.ctx=this.context=n.extend({fiber:this});const h=Object.entries(this.inject);if(h.length){this.ctx[Be.intercept]=Object.create(n[Be.intercept]);for(const[p,g]of h)ze(g)||(this.ctx[Be.intercept][p]=g)}this._runner={epoch:zt,getOuterStack:u,execute:function(){var p;if(m3(s.callback)){const g=new s.callback(this.ctx,this.config);for(const C of(g==null?void 0:g[Y.initHooks])??[])C();return(p=g==null?void 0:g[Y.init])==null?void 0:p.call(g)}else return s.callback(this.ctx,this.config)},collect:c},this.dispose=n.fiber.effect(()=>{const p=s.fibers.push(this);return async()=>{for(this.uid=null,f6(this.context,this),this.ctx.registry.has(s.callback)&&(p(),s.fibers.length||this.ctx.registry.delete(s.callback)),this._setEpoch(zt),this.inertia||this._updateState(()=>(this.inertia=this._unload(),5));this.inertia;)await this.inertia}},"ctx.plugin()");try{this.context.emit("internal/plugin",this)}catch(p){throw Promise.resolve(this.dispose()).catch(g=>this.ctx.logger.error(g)),p}if(this.uid!==null&&n.fiber.state!==5){for(const p of Object.keys(this.inject))this._checkImpl(p);this._refresh()}}else this.uid=0,this.ctx=this.context=n,this.state=2,this.store=Object.create(null),this._runner={epoch:"",getOuterStack:u,execute:()=>{},collect:c},this.dispose=()=>this.restart()}get name(){var r;let n=this;do{if((r=n.runtime)!=null&&r.name)return n.runtime.name;n=n.parent.fiber}while(n!==n.parent.fiber);return"root"}assertActive(){if(this.uid===null)throw new _1("INACTIVE_EFFECT")}_execute(n){const r=n.epoch;return Ko(i=>{const s=c=>{if(typeof c=="function")n.collect(c);else if(!ze(c))throw new TypeError("Invalid effect")},u=n.execute.call(this);if(typeof u=="function")return n.collect(u);if(!ze(u))if(Un(u)){if("then"in u)return u.then(s);if(Symbol.iterator in u){i.error=new Error;const c=u[Symbol.iterator]();for(;;){const h=c.next();if(s(h.value),h.done)return}}else if(Symbol.asyncIterator in u){const c=u[Symbol.asyncIterator]();return(async()=>{for(await Promise.resolve(),i.error=new Error;;){if(n.epoch!==r)return;const h=await c.next();if(s(h.value),h.done)return}})()}else throw new TypeError("Invalid effect")}else throw new TypeError("Invalid effect")},n.getOuterStack)}effect(n,r="anonymous"){if(this.assertActive(),this.state===5)throw new _1("INACTIVE_EFFECT");const i=[];let s=!1,u;const c=()=>{if(s)return u;s=!0;let Q;for(const V of i.splice(0).reverse())if(Q)Q=Q.then(()=>al(V));else{const Z=al(V);Un(Z)&&"then"in Z&&(Q=Z)}return u=Q},h={label:r,children:[]},p={execute:n,epoch:!0,collect:Q=>{i.push(Q),this._disposables.delete(Q),Q[Y.effect]&&h.children.push(Q[Y.effect])},getOuterStack:si()};let g,C=!0,v,L,w,_=!1,k,E=()=>!1;const T=()=>(w??(w=new Promise((Q,V)=>{v=Q,L=V})),w),B=Q=>Promise.resolve(Q).then(()=>c(),async V=>{throw await c(),V}),W=Q=>{let V;try{V=Q()}catch(Z){throw E(),Z}if(Un(V)&&"then"in V){const Z=Promise.resolve(V).finally(()=>{E(),k===Z&&(k=void 0)});return k=Z}return E(),V},z=qt(()=>p.epoch?(p.epoch=!1,W(()=>C?B(T()):g?B(g):c())):_?k:void 0,Y.effect,h);L3.set(z,()=>k),E=this._disposables.push(z);try{g=this._execute(p)}catch(Q){C=!1,_=!0,p.epoch=!1;let V;try{V=W(c)}finally{L==null||L(Q)}throw Un(V)&&"then"in V&&V.catch(Z=>this.ctx.logger.error(Z)),Q}C=!1,w&&Promise.resolve(g).then(v,L),g==null||g.catch(()=>p.epoch?W(c):c()).catch(Q=>this.ctx.logger.error(Q));const ee=()=>{if(p.epoch)return p.epoch=!1,W(c)};return z.then=async(Q,V)=>Promise.resolve(g).then(()=>ee).then(Q,V),z}getEffects(){return[...this._disposables].map(n=>n[Y.effect]).filter(Boolean)}_getState(){return this.uid===null?4:this._error?3:this._runner.epoch!==zt?2:0}_updateState(n){const r=this.state;if(this.state=nLine truncated
|
||||||
|
with (ctx) {
|
||||||
|
return eval(expr)
|
||||||
|
}
|
||||||
|
`);function Al(n,r){return b3(r)?E3(n,r.__jsExpr):!r||typeof r!="object"?r:Array.isArray(r)?r.map(i=>Al(n,i)):on(r,i=>Al(n,i))}function b3(n){return n instanceof Object&&"__jsExpr"in n}function Zt(n,r,i){const s=i instanceof Error?i.message:String(i);return new Error(`failed to ${n} loader entry ${r.id} (${r.name}): ${s}`,{cause:i})}function cl(n,r){const i=[];for(const s of r)s in n&&(i.push([s,n[s]]),delete n[s]);return i}function C6(n,r=["id","name"],i=["config"]){const s=cl(n,r),u=cl(n,i),c=cl(n,Object.keys(n)).sort(([h],[p])=>h.localeCompare(p));return Object.assign(n,Object.fromEntries([...s,...c,...u]))}function g6(n,r){for(const i of Object.keys(n))Reflect.deleteProperty(n,i);return Object.assign(n,r)}var qn,Dl=(qn=class{constructor(r){P(this,"loader");P(this,"ctx");P(this,"fiber");P(this,"parent");P(this,"options",{});P(this,"subgroup");P(this,"subtree");P(this,"_initTask");P(this,"_disposing",0);P(this,"getOuterStack",()=>{let r=this;const i=[];do i.push(` at ${r.parent.tree.ctx.baseUrl}#${r.options.id}`),r=r.parent.ctx.fiber.entry;while(r);return i});this.loader=r,this.ctx=r.ctx.extend({[qn.key]:this}),this.context.emit("loader/entry-init",this)}get context(){return this.ctx}get id(){let r=this.options.id;return this.parent.tree.ctx.fiber.entry&&(r=this.parent.tree.ctx.fiber.entry.id+j3.sep+r),r}get disabled(){return this._disabled(this.options)}_disabled(r){if(r.group)return!1;if(this.disabledOf(r))return!0;let i=this.parent.ctx.fiber.entry;for(;i;){if(this.disabledOf(i.options))return!0;i=i.parent.ctx.fiber.entry}return!1}disabledOf(r){return b3(r.disabled)?!!this.evaluate(r.disabled.__jsExpr):!!r.disabled}evaluate(r){return E3(this.ctx,r)}async _patchContext(r){await this.context.waterfall("loader/patch-context",this,async()=>{var i;Object.setPrototypeOf(this.ctx,this.parent.ctx),(i=this.fiber)!=null&&i.uid&&(r.includes("config")||this.options.group)&&await this.fiber.update(this.options.config,!0)})}async refresh(){this.fiber||this.disabled||await this.init()}async _dispose(r=this.fiber){if(r){this.fiber===r&&(this.fiber=void 0),this._disposing+=1;try{await r.dispose()}finally{this._disposing-=1}}}async update(r,i=!1,s=!1){const u=this.options,c={...u},h=i?r:{...u};if(!i)for(const[w,_]of Object.entries(r))ze(_)?delete h[w]:h[w]=_;C6(h);const p=Object.keys({...h,...c}).filter(w=>!jr(h[w],c[w]));if(!p.length&&!s)return;const g=()=>{i||(this.options=g6(u,h))},C=this.fiber;if(!(C!=null&&C.uid)){this.fiber=void 0,this.options=h;try{this._disabled(h)||await this.init()}catch(w){throw this.options=u,w}g();return}if(this._disabled(h)){this.options=h;try{await this._dispose(C)}catch(w){throw this.options=u,Zt("dispose",h,w)}g(),this.context.emit("loader/partial-dispose",this,c,!0);return}if(!p.some(w=>w==="name"||w==="inject"||w==="group")){this.options=h;try{await this._patchContext(p)}catch(w){this.options=u;try{await this._patchContext(p)}catch(_){throw Zt("rollback",c,new AggregateError([w,_]))}throw this.context.emit("loader/partial-dispose",this,h,!0),Zt("apply",h,w)}g(),this.context.emit("loader/partial-dispose",this,c,!0);return}let v;try{v=p.includes("name")?this.loader.unwrapExports(await this.parent.tree.import(h.name,this.getOuterStack)):C.runtime.callback}catch(w){throw Zt("import",h,w)}const L=C.runtime.callback;this.options=h;try{await this._dispose(C)}catch(w){throw this.options=u,Zt("dispose",h,w)}try{await this._start(v)}catch(w){this.options=u;try{await this._start(L)}catch(_){throw Zt("rollback",c,new AggregateError([w,_]))}throw this.context.emit("loader/partial-dispose",this,h,!0),Zt("apply",h,w)}g(),this.context.emit("loader/partial-dispose",this,c,!0)}async init(){try{await(this._initTask??(this._initTask=this._init()))}finally{this._initTask=void 0,this.loader.getTasks().length||this.ctx.reflect.notify(["loader"])}await this._await()}async _await(){var r;try{await((r=this.fiber)==null?void 0:r.await())}catch(i){throw Zt("apply",this.options,i)}}async _init(){let r;try{r=this.loader.unwrapExports(await this.parent.tree.import(this.options.name,this.getOuterStack))}catch(i){throw Zt("import",this.options,i)}try{await this._start(r)}catch(i){throw Zt("apply",this.options,i)}}async _start(r){let i;try{await this._patchContext([]),this.loader.showLog(this,"apply"),i=this.fiber=this.ctx.registry.plugin(r,this.options.config,this.getOuterStack),await i.await()}catch(s){throw await this._dispose(i),s}}},P(qn,"key",Symbol.for("cordis.entry")),qn);function x0(n,r){for(const i of Reflect.ownKeys(n))Reflect.deleteProperty(n,i);for(const i of Reflect.ownKeys(r||{}))Reflect.defineProperty(n,i,Reflect.getOwnPropertyDescriptor(r,i))}var M3=class{constructor(){P(this,"store",Object.create(null))}access(n,r=!1){var i;return r?(i=this.store)[n]??(i[n]=Symbol(`${n}${this.suffix}`)):this.store[n]??Symbol(`${n}${this.suffix}`)}delete(n){delete this.store[n]}get size(){return Object.keys(this.store).length}},v6=class extends M3{constructor(r){super();P(this,"entry");this.entry=r}get suffix(){retLine truncated
|
||||||
|
* @license React
|
||||||
|
* scheduler.production.min.js
|
||||||
|
*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/var _0;function _6(){return _0||(_0=1,(function(n){function r(U,ie){var K=U.length;U.push(ie);e:for(;0<K;){var j=K-1>>>1,O=U[j];if(0<u(O,ie))U[j]=ie,U[K]=O,K=j;else break e}}function i(U){return U.length===0?null:U[0]}function s(U){if(U.length===0)return null;var ie=U[0],K=U.pop();if(K!==ie){U[0]=K;e:for(var j=0,O=U.length,oe=O>>>1;j<oe;){var de=2*(j+1)-1,ve=U[de],_e=de+1,be=U[_e];if(0>u(ve,K))_e<O&&0>u(be,ve)?(U[j]=be,U[_e]=K,j=_e):(U[j]=ve,U[de]=K,j=de);else if(_e<O&&0>u(be,K))U[j]=be,U[_e]=K,j=_e;else break e}}return ie}function u(U,ie){var K=U.sortIndex-ie.sortIndex;return K!==0?K:U.id-ie.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var h=Date,p=h.now();n.unstable_now=function(){return h.now()-p}}var g=[],C=[],v=1,L=null,w=3,_=!1,k=!1,E=!1,T=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,W=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function z(U){for(var ie=i(C);ie!==null;){if(ie.callback===null)s(C);else if(ie.startTime<=U)s(C),ie.sortIndex=ie.expirationTime,r(g,ie);else break;ie=i(C)}}function ee(U){if(E=!1,z(U),!k)if(i(g)!==null)k=!0,Se(Q);else{var ie=i(C);ie!==null&&we(ee,ie.startTime-U)}}function Q(U,ie){k=!1,E&&(E=!1,B(ne),ne=-1),_=!0;var K=w;try{for(z(ie),L=i(g);L!==null&&(!(L.expirationTime>ie)||U&&!q());){var j=L.callback;if(typeof j=="function"){L.callback=null,w=L.priorityLevel;var O=j(L.expirationTime<=ie);ie=n.unstable_now(),typeof O=="function"?L.callback=O:L===i(g)&&s(g),z(ie)}else s(g);L=i(g)}if(L!==null)var oe=!0;else{var de=i(C);de!==null&&we(ee,de.startTime-ie),oe=!1}return oe}finally{L=null,w=K,_=!1}}var V=!1,Z=null,ne=-1,I=5,J=-1;function q(){return!(n.unstable_now()-J<I)}function ce(){if(Z!==null){var U=n.unstable_now();J=U;var ie=!0;try{ie=Z(!0,U)}finally{ie?le():(V=!1,Z=null)}}else V=!1}var le;if(typeof W=="function")le=function(){W(ce)};else if(typeof MessageChannel<"u"){var he=new MessageChannel,pe=he.port2;he.port1.onmessage=ce,le=function(){pe.postMessage(null)}}else le=function(){T(ce,0)};function Se(U){Z=U,V||(V=!0,le())}function we(U,ie){ne=T(function(){U(n.unstable_now())},ie)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(U){U.callback=null},n.unstable_continueExecution=function(){k||_||(k=!0,Se(Q))},n.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<U?Math.floor(1e3/U):5},n.unstable_getCurrentPriorityLevel=function(){return w},n.unstable_getFirstCallbackNode=function(){return i(g)},n.unstable_next=function(U){switch(w){case 1:case 2:case 3:var ie=3;break;default:ie=w}var K=w;w=ie;try{return U()}finally{w=K}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(U,ie){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var K=w;w=U;try{return ie()}finally{w=K}},n.unstable_scheduleCallback=function(U,ie,K){var j=n.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?j+K:j):K=j,U){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=K+O,U={id:v++,callback:ie,priorityLevel:U,startTime:K,expirationTime:O,sortIndex:-1},K>j?(U.sortIndex=K,r(C,U),i(g)===null&&U===i(C)&&(E?(B(ne),ne=-1):E=!0,we(ee,K-j))):(U.sortIndex=O,r(g,U),k||_||(k=!0,Se(Q))),U},n.unstable_shouldYield=q,n.unstable_wrapCallback=function(U){var ie=w;return function(){var K=w;w=ie;try{return U.apply(this,arguments)}finally{w=K}}}})(hl)),hl}var L0;function L6(){return L0||(L0=1,dl.exports=_6()),dl.exports}/**
|
||||||
|
* @license React
|
||||||
|
* react-dom.production.min.js
|
||||||
|
*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/var k0;function k6(){if(k0)return ft;k0=1;var n=E1(),r=L6();function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=1;o<arguments.length;o++)t+="&args[]="+encodeURIComponent(arguments[o]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,u={};function c(e,t){h(e,t),h(e+"Capture",t)}function h(e,t){for(u[e]=t,e=0;e<t.length;e++)s.add(t[e])}var p=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),g=Object.prototype.hasOwnProperty,C=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,v={},L={};function w(e){return g.call(L,e)?!0:g.call(v,e)?!1:C.test(e)?L[e]=!0:(v[e]=!0,!1)}function _(e,t,o,l){if(o!==null&&o.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return l?!1:o!==null?!o.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function k(e,t,o,l){if(t===null||typeof t>"u"||_(e,t,o,l))return!0;if(l)return!1;if(o!==null)switch(o.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function E(e,t,o,l,a,d,m){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=l,this.attributeNamespace=a,this.mustUseProperty=o,this.propertyName=e,this.type=t,this.sanitizeURL=d,this.removeEmptyString=m}var T={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){T[e]=new E(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];T[t]=new E(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){T[e]=new E(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){T[e]=new E(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){T[e]=new E(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){T[e]=new E(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){T[e]=new E(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){T[e]=new E(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){T[e]=new E(e,5,!1,e.toLowerCase(),null,!1,!1)});var B=/[\-:]([a-z])/g;function W(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(B,W);T[t]=new E(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(B,W);T[t]=new E(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(B,W);T[t]=new E(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){T[e]=new E(e,1,!1,e.toLowerCase(),null,!1,!1)}),T.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){T[e]=new E(e,1,!1,e.toLowerCase(),null,!0,!0)});function z(e,t,o,l){var a=T.hasOwnProperty(t)?T[t]:null;(a!==null?a.type!==0:l||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=Line truncated
|
||||||
|
`+j+e}var oe=!1;function de(e,t){if(!e||oe)return"";oe=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(N){var l=N}Reflect.construct(e,[],t)}else{try{t.call()}catch(N){l=N}e.call(t.prototype)}else{try{throw Error()}catch(N){l=N}e()}}catch(N){if(N&&l&&typeof N.stack=="string"){for(var a=N.stack.split(`
|
||||||
|
`),d=l.stack.split(`
|
||||||
|
`),m=a.length-1,y=d.length-1;1<=m&&0<=y&&a[m]!==d[y];)y--;for(;1<=m&&0<=y;m--,y--)if(a[m]!==d[y]){if(m!==1||y!==1)do if(m--,y--,0>y||a[m]!==d[y]){var x=`
|
||||||
|
`+a[m].replace(" at new "," at ");return e.displayName&&x.includes("<anonymous>")&&(x=x.replace("<anonymous>",e.displayName)),x}while(1<=m&&0<=y);break}}}finally{oe=!1,Error.prepareStackTrace=o}return(e=e?e.displayName||e.name:"")?O(e):""}function ve(e){switch(e.tag){case 5:return O(e.type);case 16:return O("Lazy");case 13:return O("Suspense");case 19:return O("SuspenseList");case 0:case 2:case 15:return e=de(e.type,!1),e;case 11:return e=de(e.type.render,!1),e;case 1:return e=de(e.type,!0),e;default:return""}}function _e(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Z:return"Fragment";case V:return"Portal";case I:return"Profiler";case ne:return"StrictMode";case le:return"Suspense";case he:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case q:return(e.displayName||"Context")+".Consumer";case J:return(e._context.displayName||"Context")+".Provider";case ce:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case pe:return t=e.displayName||null,t!==null?t:_e(e.type)||"Memo";case Se:t=e._payload,e=e._init;try{return _e(e(t))}catch{}}return null}function be(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _e(t);case 8:return t===ne?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function je(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Re(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function dt(e){var t=Re(e)?"checked":"value",o=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var a=o.get,d=o.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(m){l=""+m,d.call(this,m)}}),Object.defineProperty(e,t,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(m){l=""+m},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function b1(e){e._valueTracker||(e._valueTracker=dt(e))}function Cu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var o=t.getValue(),l="";return e&&(l=Re(e)?e.checked?"true":"false":e.value),e=l,e!==o?(t.setValue(e),!0):!1}function M1(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ci(e,t){var o=t.checked;return K({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??e._wrapperState.initialChecked})}function gu(e,t){var o=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;o=je(t.value!=null?t.value:o),e._wrapperState={initialChecked:l,initialValue:o,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function vu(e,t){t=t.checked,t!=null&&z(e,"checked",t,!1)}function fi(e,t){vu(e,t);var o=je(t.value),l=t.type;if(o!=null)l==="number"?(o===0&&e.value===""||e.value!=o)&&(e.value=""+o):e.value!==""+o&&(e.value=""+o);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?di(e,t.type,o):t.hasOwnProperty("defaultValue")&&di(e,t.type,je(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function yu(e,t,o){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var l=t.type;if(!(l!=="submit"&&l!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,o||t===e.value||(e.value=t),e.defaultValue=t}o=e.name,o!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,o!==""&&(e.name=o)}function di(e,t,o){(t!=="number"||M1(e.ownerDocument)!==e)&&(o==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+o&&(e.defaultValue=""+o))}var Mr=Array.isArray;function Jn(e,t,o,l){if(e=e.options,t){t={};for(var a=0;a<o.length;a++)t["$"+o[a]]=!0;for(o=0;o<e.length;o++)a=t.hasOwnProperty("$"+e[o].value),e[o].selected!==a&&(e[o].selected=a),a&&l&&(e[o].defaultSelected=!0)}else{for(o=""+je(o),t=null,a=0;a<e.length;a++){if(e[a].value===o){e[a].selected=!0,l&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function hi(e,t){if(t.dangerouslySetILine truncated
|
||||||
|
`).replace(Q4,"")}function G1(e,t,o){if(t=Ma(t),Ma(e)!==t&&o)throw Error(i(425))}function Y1(){}var Qi=null,Ki=null;function Ji(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Gi=typeof setTimeout=="function"?setTimeout:void 0,K4=typeof clearTimeout=="function"?clearTimeout:void 0,Oa=typeof Promise=="function"?Promise:void 0,J4=typeof queueMicrotask=="function"?queueMicrotask:typeof Oa<"u"?function(e){return Oa.resolve(null).then(e).catch(G4)}:Gi;function G4(e){setTimeout(function(){throw e})}function Yi(e,t){var o=t,l=0;do{var a=o.nextSibling;if(e.removeChild(o),a&&a.nodeType===8)if(o=a.data,o==="/$"){if(l===0){e.removeChild(a),Fr(t);return}l--}else o!=="$"&&o!=="$?"&&o!=="$!"||l++;o=a}while(o);Fr(t)}function pn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Na(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var o=e.data;if(o==="$"||o==="$!"||o==="$?"){if(t===0)return e;t--}else o==="/$"&&t++}e=e.previousSibling}return null}var ir=Math.random().toString(36).slice(2),At="__reactFiber$"+ir,Yr="__reactProps$"+ir,Qt="__reactContainer$"+ir,Xi="__reactEvents$"+ir,Y4="__reactListeners$"+ir,X4="__reactHandles$"+ir;function Mn(e){var t=e[At];if(t)return t;for(var o=e.parentNode;o;){if(t=o[Qt]||o[At]){if(o=t.alternate,t.child!==null||o!==null&&o.child!==null)for(e=Na(e);e!==null;){if(o=e[At])return o;e=Na(e)}return t}e=o,o=e.parentNode}return null}function Xr(e){return e=e[At]||e[Qt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function sr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function X1(e){return e[Yr]||null}var es=[],lr=-1;function mn(e){return{current:e}}function Ne(e){0>lr||(e.current=es[lr],es[lr]=null,lr--)}function Me(e,t){lr++,es[lr]=e.current,e.current=t}var Cn={},Ge=mn(Cn),st=mn(!1),On=Cn;function ur(e,t){var o=e.type.contextTypes;if(!o)return Cn;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===t)return l.__reactInternalMemoizedMaskedChildContext;var a={},d;for(d in o)a[d]=t[d];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function lt(e){return e=e.childContextTypes,e!=null}function eo(){Ne(st),Ne(Ge)}function Ra(e,t,o){if(Ge.current!==Cn)throw Error(i(168));Me(Ge,t),Me(st,o)}function Pa(e,t,o){var l=e.stateNode;if(t=t.childContextTypes,typeof l.getChildContext!="function")return o;l=l.getChildContext();for(var a in l)if(!(a in t))throw Error(i(108,be(e)||"Unknown",a));return K({},o,l)}function to(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Cn,On=Ge.current,Me(Ge,e),Me(st,st.current),!0}function Ta(e,t,o){var l=e.stateNode;if(!l)throw Error(i(169));o?(e=Pa(e,t,On),l.__reactInternalMemoizedMergedChildContext=e,Ne(st),Ne(Ge),Me(Ge,e)):Ne(st),Me(st,o)}var Kt=null,no=!1,ts=!1;function Ia(e){Kt===null?Kt=[e]:Kt.push(e)}function e5(e){no=!0,Ia(e)}function gn(){if(!ts&&Kt!==null){ts=!0;var e=0,t=Ee;try{var o=Kt;for(Ee=1;e<o.length;e++){var l=o[e];do l=l(!0);while(l!==null)}Kt=null,no=!1}catch(a){throw Kt!==null&&(Kt=Kt.slice(e+1)),Hu(Li,gn),a}finally{Ee=t,ts=!1}}return null}var ar=[],cr=0,ro=null,oo=0,xt=[],_t=0,Nn=null,Jt=1,Gt="";function Rn(e,t){ar[cr++]=oo,ar[cr++]=ro,ro=e,oo=t}function $a(e,t,o){xt[_t++]=Jt,xt[_t++]=Gt,xt[_t++]=Nn,Nn=e;var l=Jt;e=Gt;var a=32-bt(l)-1;l&=~(1<<a),o+=1;var d=32-bt(t)+a;if(30<d){var m=a-a%5;d=(l&(1<<m)-1).toString(32),l>>=m,a-=m,Jt=1<<32-bt(t)+a|o<<a|l,Gt=d+e}else Jt=1<<d|o<<a|l,Gt=e}function ns(e){e.return!==null&&(Rn(e,1),$a(e,1,0))}function rs(e){for(;e===ro;)ro=ar[--cr],ar[cr]=null,oo=ar[--cr],ar[cr]=null;for(;e===Nn;)Nn=xt[--_t],xt[_t]=null,Gt=xt[--_t],xt[_t]=null,Jt=xt[--_t],xt[_t]=null}var pt=null,mt=null,Pe=!1,Ot=null;function Ha(e,t){var o=jt(5,null,null,0);o.elementType="DELETED",o.stateNode=t,o.return=e,t=e.deletions,t===null?(e.deletions=[o],e.flags|=16):t.push(o)}function Va(e,t){switch(e.tag){case 5:var o=e.type;return t=t.nodeType!==1||o.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,pt=e,mt=pn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,pt=e,mt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(o=Nn!==null?{id:Jt,overflow:Gt}:null,e.memoizedState={dehydrated:t,treeContext:o,retryLane:1073741824},o=jt(18,null,null,0),o.stateNode=t,o.return=e,e.child=o,pt=e,mt=null,!0):!1;default:return!1}}function os(e){return(e.mode&1)!==0&&(e.flags&128)===0}function is(e){if(Pe){var t=mt;if(t){var o=t;if(!Va(e,t)){if(os(e))throw Error(i(418));t=pn(o.nextSibling);var l=pt;t&&Va(e,t)?Ha(l,o):(e.flags=e.flags&-4097|2,Pe=!1,pt=e)}}else{if(os(e))throw Error(i(418));e.flags=e.flags&-4097|2,Pe=!1,pt=e}}}function Aa(e){for(e=e.Line truncated
|
||||||
|
Error generating stack: `+d.message+`
|
||||||
|
`+d.stack}return{value:e,source:t,stack:a,digest:null}}function Es(e,t,o){return{value:e,source:null,stack:o??null,digest:t??null}}function bs(e,t){try{console.error(t.value)}catch(o){setTimeout(function(){throw o})}}var a5=typeof WeakMap=="function"?WeakMap:Map;function y2(e,t,o){o=Xt(-1,o),o.tag=3,o.payload={element:null};var l=t.value;return o.callback=function(){So||(So=!0,zs=l),bs(e,t)},o}function w2(e,t,o){o=Xt(-1,o),o.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var a=t.value;o.payload=function(){return l(a)},o.callback=function(){bs(e,t)}}var d=e.stateNode;return d!==null&&typeof d.componentDidCatch=="function"&&(o.callback=function(){bs(e,t),typeof l!="function"&&(xn===null?xn=new Set([this]):xn.add(this));var m=t.stack;this.componentDidCatch(t.value,{componentStack:m!==null?m:""})}),o}function x2(e,t,o){var l=e.pingCache;if(l===null){l=e.pingCache=new a5;var a=new Set;l.set(t,a)}else a=l.get(t),a===void 0&&(a=new Set,l.set(t,a));a.has(o)||(a.add(o),e=L5.bind(null,e,t,o),t.then(e,e))}function _2(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function L2(e,t,o,l,a){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,o.flags|=131072,o.flags&=-52805,o.tag===1&&(o.alternate===null?o.tag=17:(t=Xt(-1,1),t.tag=2,yn(o,t,1))),o.lanes|=1),e):(e.flags|=65536,e.lanes=a,e)}var c5=ee.ReactCurrentOwner,ut=!1;function nt(e,t,o,l){t.child=e===null?za(t,null,o,l):dr(t,e.child,o,l)}function k2(e,t,o,l,a){o=o.render;var d=t.ref;return pr(t,a),l=ys(e,t,o,l,d,a),o=ws(),e!==null&&!ut?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,en(e,t,a)):(Pe&&o&&ns(t),t.flags|=1,nt(e,t,l,a),t.child)}function S2(e,t,o,l,a){if(e===null){var d=o.type;return typeof d=="function"&&!Js(d)&&d.defaultProps===void 0&&o.compare===null&&o.defaultProps===void 0?(t.tag=15,t.type=d,j2(e,t,d,l,a)):(e=No(o.type,null,l,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,(e.lanes&a)===0){var m=d.memoizedProps;if(o=o.compare,o=o!==null?o:qr,o(m,l)&&e.ref===t.ref)return en(e,t,a)}return t.flags|=1,e=Sn(d,l),e.ref=t.ref,e.return=t,t.child=e}function j2(e,t,o,l,a){if(e!==null){var d=e.memoizedProps;if(qr(d,l)&&e.ref===t.ref)if(ut=!1,t.pendingProps=l=d,(e.lanes&a)!==0)(e.flags&131072)!==0&&(ut=!0);else return t.lanes=e.lanes,en(e,t,a)}return Ms(e,t,o,l,a)}function E2(e,t,o){var l=t.pendingProps,a=l.children,d=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Me(vr,Ct),Ct|=o;else{if((o&1073741824)===0)return e=d!==null?d.baseLanes|o:o,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Me(vr,Ct),Ct|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=d!==null?d.baseLanes:o,Me(vr,Ct),Ct|=l}else d!==null?(l=d.baseLanes|o,t.memoizedState=null):l=o,Me(vr,Ct),Ct|=l;return nt(e,t,a,o),t.child}function b2(e,t){var o=t.ref;(e===null&&o!==null||e!==null&&e.ref!==o)&&(t.flags|=512,t.flags|=2097152)}function Ms(e,t,o,l,a){var d=lt(o)?On:Ge.current;return d=ur(t,d),pr(t,a),o=ys(e,t,o,l,d,a),l=ws(),e!==null&&!ut?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,en(e,t,a)):(Pe&&l&&ns(t),t.flags|=1,nt(e,t,o,a),t.child)}function M2(e,t,o,l,a){if(lt(o)){var d=!0;to(t)}else d=!1;if(pr(t,a),t.stateNode===null)wo(e,t),g2(t,o,l),js(t,o,l,a),l=!0;else if(e===null){var m=t.stateNode,y=t.memoizedProps;m.props=y;var x=m.context,N=o.contextType;typeof N=="object"&&N!==null?N=Lt(N):(N=lt(o)?On:Ge.current,N=ur(t,N));var H=o.getDerivedStateFromProps,A=typeof H=="function"||typeof m.getSnapshotBeforeUpdate=="function";A||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(y!==l||x!==N)&&v2(t,m,l,N),vn=!1;var $=t.memoizedState;m.state=$,co(t,l,m,a),x=t.memoizedState,y!==l||$!==x||st.current||vn?(typeof H=="function"&&(Ss(t,o,H,l),x=t.memoizedState),(y=vn||C2(t,o,y,l,$,x,N))?(A||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(t.flags|=4194308)):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=x),m.props=l,m.state=x,m.context=N,l=y):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{m=t.stateNode,Ua(e,t),y=t.memoizedProps,N=t.type===t.elementType?y:Nt(t.type,y),m.props=N,A=t.pendingProps,$=m.context,x=o.contextType,typeof x=="object"&&x!==null?x=Lt(x):(x=lt(o)?On:Ge.current,x=ur(t,x));var G=o.getDerivedStateFromProps;(H=typeof G=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(y!==A||$!==x)&&v2(t,m,l,x),vn=!1,$=t.memoizedState,m.state=$,co(t,l,m,Line truncated
|
||||||
|
* @license React
|
||||||
|
* use-sync-external-store-shim.production.min.js
|
||||||
|
*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/var E0;function P6(){if(E0)return gl;E0=1;var n=E1();function r(L,w){return L===w&&(L!==0||1/L===1/w)||L!==L&&w!==w}var i=typeof Object.is=="function"?Object.is:r,s=n.useState,u=n.useEffect,c=n.useLayoutEffect,h=n.useDebugValue;function p(L,w){var _=w(),k=s({inst:{value:_,getSnapshot:w}}),E=k[0].inst,T=k[1];return c(function(){E.value=_,E.getSnapshot=w,g(E)&&T({inst:E})},[L,_,w]),u(function(){return g(E)&&T({inst:E}),L(function(){g(E)&&T({inst:E})})},[L]),h(_),_}function g(L){var w=L.getSnapshot;L=L.value;try{var _=w();return!i(L,_)}catch{return!0}}function C(L,w){return w()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?C:p;return gl.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:v,gl}var b0;function T6(){return b0||(b0=1,Cl.exports=P6()),Cl.exports}/**
|
||||||
|
* @license React
|
||||||
|
* use-sync-external-store-shim/with-selector.production.min.js
|
||||||
|
*
|
||||||
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/var M0;function I6(){if(M0)return ml;M0=1;var n=E1(),r=T6();function i(C,v){return C===v&&(C!==0||1/C===1/v)||C!==C&&v!==v}var s=typeof Object.is=="function"?Object.is:i,u=r.useSyncExternalStore,c=n.useRef,h=n.useEffect,p=n.useMemo,g=n.useDebugValue;return ml.useSyncExternalStoreWithSelector=function(C,v,L,w,_){var k=c(null);if(k.current===null){var E={hasValue:!1,value:null};k.current=E}else E=k.current;k=p(function(){function B(V){if(!W){if(W=!0,z=V,V=w(V),_!==void 0&&E.hasValue){var Z=E.value;if(_(Z,V))return ee=Z}return ee=V}if(Z=ee,s(z,V))return Z;var ne=w(V);return _!==void 0&&_(Z,ne)?Z:(z=V,ee=ne)}var W=!1,z,ee,Q=L===void 0?null:L;return[function(){return B(v())},Q===null?void 0:function(){return B(Q())}]},[v,L,w,_]);var T=u(C,k[0],k[1]);return h(function(){E.hasValue=!0,E.value=T},[T]),g(T),T},ml}var O0;function $6(){return O0||(O0=1,pl.exports=I6()),pl.exports}var H6=$6();function ru(n){const r=s=>n.subscribe(s),i=()=>n.getSnapshot();return function(u,c){return H6.useSyncExternalStoreWithSelector(r,i,void 0,u,c)}}class li extends Error{}class Er extends Error{}function V6(n){return typeof n=="function"?n():n}const Do=Object.freeze([]);class A6{constructor(){P(this,"records",new Map);P(this,"mutateListeners",new Set);P(this,"handleScopes",new Map);P(this,"dirty",new Set);P(this,"flushScheduled",!1);P(this,"abdicated",new WeakSet);P(this,"entryErrorListeners",new Set);const r=this.record("root");r.spec={kind:"single",scope:"root"},r.declaredBy="(built-in)",r.declarationEpoch=1}register(r,i){const s=this.records.get(r.name);if(!(s!=null&&s.spec))throw new Error(`slot "${r.name}" is not declared (a parent entry's children table must declare it)`);const u=s.spec,c=r.priority??0,h=C=>`at priority ${c}${C.registrant!==void 0?` (registered by ${C.registrant})`:""} — register at a different priority to shadow it (lowest renders)`;switch(u.kind){case"single":{const C=s.entries.find(v=>(v.options.priority??0)===c);if(C)throw new Error(`single slot "${r.name}" already has a registration ${h(C)}`);break}case"keyed":{if(r.key===void 0)throw new Error(`keyed slot "${r.name}" requires options.key`);const C=s.entries.find(v=>v.options.key===r.key&&(v.options.priority??0)===c);if(C)throw new Error(`keyed slot "${r.name}" already has an entry for key "${r.key}" ${h(C)}`);break}case"list":{if(r.id===void 0)throw new Error(`list slot "${r.name}" requires options.id`);const C=s.entries.find(v=>v.options.id===r.id&&(v.options.priority??0)===c);if(C)throw new Error(`list slot "${r.name}" already has an entry with id "${r.id}" ${h(C)}`);break}case"chain":if(r.select===void 0)throw new Error(`chain slot "${r.name}" requires options.select`);break}if(r.children)for(const C of Object.keys(r.children)){const v=this.records.get(C);if(v!=null&&v.spec)throw new Error(`slot "${C}" is already declared (by ${v.declaredBy??"an unknown entry"})`)}if(r.store!==void 0&&typeof r.store!="function"){const C=this.handleScopes.get(r.store);if(C&&C.scope!==u.scope)throw new Error(`store handle mounted under "${r.name}" (scope "${u.scope}") is already mounted under scope "${C.scope}" — one handle, one scope`);C?C.count+=1:this.handleScopes.set(r.store,{scope:u.scope,count:1})}const p={component:i,options:{...r.key!==void 0?{key:r.key}:{},...r.id!==void 0?{id:r.id}:{},...r.order!==void 0?{order:r.order}:{},...r.label!==void 0?{label:r.label}:{},...r.priority!==void 0?{priority:r.priority}:{}},...r.select!==void 0?{select:r.select}:{},...r.inject!==void 0?{inject:r.inject}:{},...r.children!==void 0?{children:r.children}:{},...r.store!==void 0?{store:r.store}:{},...r.locale!==void 0?{locale:r.locale}:{},...r.registrant!==void 0?{registrant:r.registrant}:{}},g=[...s.entries,p];if(g.sort(u.kind==="list"?(C,v)=>(C.options.priority??0)-(v.options.priority??0)||(C.options.order??0)-(v.options.order??0):(C,v)=>(C.options.priority??0)-(v.options.priority??0)),s.entries=g,this.markDirty(r.name,s),r.children){const C=[];for(const[v,L]of Object.entries(r.children)){const w=this.record(v);w.spec=L,w.declaredBy=`an entry in "${r.name}"${r.registrant?` (${r.registrant})`:""}`,w.parent=r.name,w.declarationEpoch+=1,C.push([v,w])}for(const[v,L]of C)this.markDirty(v,L);for(const[,v]of C)this.notifyDeclaration(v)}return()=>{s.entries.includes(p)&&(s.entries=s.entries.filter(C=>C!==p),this.markDirty(r.name,s),this.releaseEntry(p))}}isLive(r){for(const i of this.records.values())if(i.entries.includes(r))return!0;return!1}entries(r){var i;return((i=this.records.get(r))==null?void 0:i.entries)??Do}entriesOfSlot(r){const i=this.records.get(r);if(!(i!=null&&i.spec))return Do;const s=i.spec.kind;if(s==="chain")return i.entries;const u=[],c=new Set;for(const h of i.entries){if(this.abdicated.has(h))continue;const p=s==="keyed"?h.options.key:s==="list"?h.options.id:void 0;c.has(p)||(c.add(p),u.push(h))}return u}spec(r){var i;return(i=this.records.get(r))==null?void 0:i.spec}specDynamic(r){var i;return(i=this.records.get(r))==null?void 0:i.spec}snapshot(r){const i=(Line truncated
|
||||||
|
`)){const u=s.replace(/\r+$/,"");if(pd.test(u)){const c=yd(u,i);r.push(c.text),i=c.sgr;continue}r.push(u);for(const c of u.matchAll(md))i=nc(i,String(c[1]))}return r.join(`
|
||||||
|
`)}function xd(n){const r=n.replace(fd,"").replace(dd,"");return wd(r).replace(hd,"")}function _d(n){const r={},i=n.bg===null?void 0:`rgb(${n.bg})`;if(i!==void 0&&(r.backgroundColor=i),n.fg!==null){const s=`rgb(${n.fg})`;r.color=i===void 0?ad[n.fg.replace(/\s+/g,"")]??s:s}for(const s of n.decorations)Object.assign(r,cd[s]);return Object.keys(r).length===0?void 0:r}function Ld(n){let r=[];const i=[r];for(const s of ud.ansiToJson(xd(n),{json:!0,remove_empty:!0})){const u=_d(s);for(const[c,h]of s.content.split(`
|
||||||
|
`).entries())c>0&&(r=[],i.push(r)),h!==""&&r.push({text:h,style:u})}return i}function rc(n,r,i){const s=n-r,u=Math.ceil(r/2);return{hidden:s,capped:s>0&&!i,headLines:u,tailLines:r-u}}const kd=1e3;function oc(n){const[r,i]=R.useState(!1),s=R.useCallback(()=>{r||br(n).then(u=>{u&&(i(!0),window.setTimeout(()=>{i(!1)},kd))})},[r,n]);return{copied:r,onCopy:s}}const Sd="_block_10eou_7",jd="_header_10eou_38",Ed="_prompt_10eou_76",bd="_promptLine_10eou_84",Md="_runState_10eou_97",Od="_runStateLabel_10eou_105",Nd="_cwd_10eou_114",Rd="_command_10eou_122",Pd="_status_10eou_134",Td="_copyButton_10eou_142",Id="_output_10eou_162",$d="_line_10eou_186",Hd="_expand_10eou_191",Vd="_empty_10eou_207",ot={block:Sd,header:jd,prompt:Ed,promptLine:bd,runState:Md,runStateLabel:Od,cwd:Nd,command:Rd,status:Pd,copyButton:Td,output:Id,line:$d,expand:Hd,empty:Vd},ic=16,G0={signal:n=>`信号 ${n}`,exitCode:n=>`退出码 ${n}`,running:"运行中",failed:"失败",done:"已完成",copy:"复制",copied:"复制成功",noOutput:"无输出",collapseAria:"收起输出",collapse:"收起",expandAria:n=>`展开其余 ${n} 行输出`,expand:n=>`… 其余 ${n} 行`};function Ad(n,r){const i=n.replace(/[/\\]+$/,"");if(r!==void 0&&i===r.replace(/[/\\]+$/,""))return"~";const s=i.split(/[/\\]/).pop();return s===void 0||s===""?n:s}function sc(n,r,i){if(r!==void 0)return i.signal(r);if(n!==void 0&&n!==0)return i.exitCode(n)}function Dd(n,r,i,s){return n?{state:"ongoing",label:s.running}:sc(r,i,s)!==void 0?{state:"error",label:s.failed}:{state:"done",label:s.done}}function Y0(n){return n.map((r,i)=>r.style===void 0?r.text:f.jsx("span",{style:r.style,children:r.text},i))}function Fd({command:n,cwd:r,home:i,output:s,exitCode:u,signal:c,running:h=!1,maxLines:p=ic,className:g,labels:C}){const v=R.useMemo(()=>C===void 0?G0:{...G0,...C},[C]),L=s??"",w=R.useMemo(()=>{const J=Ld(L),q=J[J.length-1];return J.length>1&&q!==void 0&&q.every(le=>le.text==="")?J.slice(0,-1):J},[L]),[_,k]=R.useState(!1),{copied:E,onCopy:T}=oc(L),B=R.useCallback(()=>{k(J=>!J)},[]),W=sc(u,c,v),z=Dd(h,u,c,v),ee=R.useMemo(()=>(n.endsWith(`
|
||||||
|
`)?n.slice(0,-1):n).split(`
|
||||||
|
`),[n]),Q=w.every(J=>J.every(q=>q.text.trim()==="")),{hidden:V,capped:Z,headLines:ne,tailLines:I}=rc(w.length,p,_);return f.jsxs("div",{className:ye(ot.block,g),"data-terminal":"","data-running":h?"":void 0,children:[f.jsxs("div",{className:ot.header,children:[f.jsxs("div",{className:ot.prompt,children:[f.jsx("span",{className:ot.runStateLabel,children:z.label}),ee.map((J,q)=>f.jsxs("div",{className:ot.promptLine,children:[q===0&&f.jsx(Z3,{state:z.state,className:ot.runState}),f.jsx("span",{className:ot.cwd,children:q>0||r===void 0?"$":Ad(r,i)}),f.jsx("span",{className:ot.command,children:J})]},q))]}),W!==void 0&&f.jsx(J3,{className:ot.status,children:W}),!h&&!Q&&f.jsx("button",{type:"button",className:ot.copyButton,onClick:T,children:E?v.copied:v.copy})]}),!h&&(Q?f.jsx("div",{className:ot.empty,children:v.noOutput}):f.jsxs("div",{className:ot.output,children:[(Z?w.slice(0,ne):w).map((J,q)=>f.jsx("div",{className:ot.line,children:Y0(J)},q)),V>0&&f.jsx("button",{type:"button",className:ot.expand,"aria-expanded":_,"aria-label":_?v.collapseAria:v.expandAria(V),onClick:B,children:_?v.collapse:v.expand(V)}),Z&&w.slice(w.length-I).map((J,q)=>f.jsx("div",{className:ot.line,children:Y0(J)},q))]}))]})}const Bd="modulepreload",zd=function(n){return"/"+n},X0={},He=function(r,i,s){let u=Promise.resolve();if(i&&i.length>0){let h=function(C){return Promise.all(C.map(v=>Promise.resolve(v).then(L=>({status:"fulfilled",value:L}),L=>({status:"rejected",reason:L}))))};document.getElementsByTagName("link");const p=document.querySelector("meta[property=csp-nonce]"),g=(p==null?void 0:p.nonce)||(p==null?void 0:p.getAttribute("nonce"));u=h(i.map(C=>{if(C=zd(C),C in X0)return;X0[C]=!0;const v=C.endsWith(".css"),L=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${C}"]${L}`))return;const w=document.createElement("link");if(w.rel=v?"stylesheet":Bd,v||(w.as="script"),w.crossOrigin="",w.href=C,g&&w.setAttribute("nonce",g),document.head.appendChild(w),v)return new Promise((_,k)=>{w.addEventListener("load",_),w.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${C}`)))})}))}function c(h){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=h,window.dispatchEvent(p),!p.defaultPrevented)throw h}return u.then(h=>{for(const p of h||[])p.status==="rejected"&&c(p.reason);return r().catch(c)})},Zd=[F5,B5,z5],Ud=new Map([["python",()=>He(()=>import("./langs/python-B6aJPvgy.js"),[])],["ruby",()=>He(()=>import("./langs/ruby-DEItuUFs.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))],["go",()=>He(()=>import("./langs/go-C27-OAKa.js"),[])],["rust",()=>He(()=>import("./langs/rust-B1yitclQ.js"),[])],["java",()=>He(()=>import("./langs/java-CylS5w8V.js"),[])],["c",()=>He(()=>import("./langs/c-BIGW1oBm.js"),[])],["cpp",()=>He(()=>import("./langs/cpp-DIPi6g--.js"),__vite__mapDeps([8,9,5]))],["csharp",()=>He(()=>import("./langs/csharp-DSvCPggb.js"),[])],["kotlin",()=>He(()=>import("./langs/kotlin-BdnUsdx6.js"),[])],["swift",()=>He(()=>import("./langs/swift-D82vCrfD.js"),[])],["php",()=>He(()=>import("./langs/php-D-uCvoST.js"),__vite__mapDeps([12,1,2,3,4,5,6,7]))],["yaml",()=>He(()=>import("./langs/yaml-Buea-lGh.js"),[])],["toml",()=>He(()=>import("./langs/toml-vGWfd6FD.js"),[])],["ini",()=>He(()=>import("./langs/ini-BEwlwnbL.js"),[])],["markdown",()=>He(()=>import("./langs/markdown-Cvjx9yec.js"),[])],["mdx",()=>He(()=>import("./langs/mdx-Cmh6b_Ma.js"),[])],["html",()=>He(()=>import("./langs/html-CfGypltT.js").then(n=>n.a),__vite__mapDeps([1,2]))],["css",()=>He(()=>import("./langs/css-CLj8gQPS.js"),[])],["scss",()=>He(()=>import("./langs/scss-D5BDwBP9.js"),__vite__mapDeps([13,2]))],["less",()=>He(()=>import("./langs/less-B1dDrJ26.js"),[])],["sql",()=>He(()=>import("./langs/sql-CRqJ_cUM.js"),[])],["xml",()=>He(()=>import("./langs/xml-sdJ4AIDG.js"),__vite__mapDeps([3,4]))],["lua",()=>He(()=>import("./langs/lua-BaeVxFsk.js"),__vite__mapDeps([10,9]))]]),lc=new Map([["typescript","typescript"],["ts","typescript"],["tsx","typescript"],["javascript","typescript"],["js","typescript"],["jsx","typescript"],["shellscript","shellscript"],["bash","shellscript"],["sh","shellscript"],["shell","shellscript"],["zsh","shellscript"],["json","json"],["jsonc","json"],["py","python"],["python","python"],["rb","ruby"],["ruby","ruby"],["go","go"],["rs","rust"],["rust","rust"],["java","java"],["c","c"],["cpp","cpp"],["cs","csharp"],["csharp","csharp"],["kotlin","kotlin"],["swift","swift"],["php","php"],["yaml","yaml"],["yml","yaml"],["toml","toml"],["ini","ini"],["md","markdown"],["markdown","markdown"],["mdx","mdx"],["html","html"],["css","css"],["scss","scss"],["less","less"],["sql","sql"],["xml","xml"],["lua","lua"]]),Wd=H5({name:"css-variables",variablePrefix:"--shiki-",fontStyle:!0}),qd=V5({forgiving:!0,regexConstructor:n=>D5(n,{lazyCompileLength:Number.POSITIVE_INFINITY})});let e3;const Qd=[{lang:"typescript",code:"const answer: number = 42"},{lang:"shellscript",code:`printf '%s\\n' "$HOME"`},{lang:"json",code:'{"ready":true}'}Line truncated
|
||||||
|
`),[r]),p=R.useSyncExternalStore(ac,ei,ei),g=R.useMemo(()=>Gd(h,s),[h,s,p]),[C,v]=R.useState(!1),[L,w]=R.useState(!1),_=R.useCallback(()=>{L||br(h).then(V=>{V&&(w(!0),window.setTimeout(()=>{w(!1)},1e3))})},[L,h]),k=R.useCallback(()=>{v(V=>!V)},[]),E=r.length-u,T=E>0&&!C,B=Math.ceil(u/2),W=u-B,z=r.length<i,ee=V=>V.map(([Z,ne])=>f.jsxs("div",{className:Et.line,children:[f.jsx("span",{className:Et.gutter,"aria-hidden":!0,children:Z.number}),f.jsx("span",{className:Et.content,children:ne===void 0?Z.text:ch(ne)})]},Z.number)),Q=r.map((V,Z)=>[V,g==null?void 0:g[Z]]);return f.jsxs("div",{className:ye(Et.block,c),"data-read":"",children:[f.jsxs("div",{className:Et.banner,children:[f.jsx("div",{className:Et.label,children:n??""}),f.jsxs("div",{className:Et.action,children:[z&&f.jsx("span",{className:Et.count,children:`显示 ${r.length} / ${i} 行`}),f.jsx("span",{className:Et.lang,children:s??""}),r.length>0&&f.jsx("button",{type:"button",className:Et.copyButton,onClick:_,children:L?"复制成功":"复制"})]})]}),f.jsxs("div",{className:Et.body,children:[ee(T?Q.slice(0,B):Q),E>0&&f.jsx("button",{type:"button",className:Et.expand,"aria-expanded":C,"aria-label":C?"收起内容":`展开其余 ${E} 行`,onClick:k,children:C?"收起":`… 其余 ${E} 行`}),T&&ee(Q.slice(Q.length-W))]})]})}const dh="_block_srovd_7",hh="_copyButton_srovd_22",ph="_body_srovd_36",mh="_line_srovd_44",Ch="_path_srovd_53",gh="_gap_srovd_60",vh="_del_srovd_67",yh="_add_srovd_76",wh="_expand_srovd_85",xh="_footer_srovd_103",It={block:dh,copyButton:hh,body:ph,line:mh,path:Ch,gap:gh,del:vh,add:yh,expand:wh,footer:xh},dc=16;function _h(n){throw new Error(`unreachable diff row kind: ${String(n)}`)}const n3={path:It.path,del:It.del,add:It.add,gap:It.gap};function Lh(n){const r=[],i=new Set;let s=0,u=0,c;for(const h of n){if(i.add(h.path),h.path!==c?r.push({kind:"path",text:h.path}):r.push({kind:"gap",text:"⋯"}),c=h.path,h.oldText!==null)for(const p of r3(h.oldText))r.push({kind:"del",text:p}),u++;for(const p of r3(h.newText))r.push({kind:"add",text:p}),s++}return{rows:r,added:s,removed:u,files:i.size}}function r3(n){return n===""?[]:(n.endsWith(`
|
||||||
|
`)?n.slice(0,-1):n).split(`
|
||||||
|
`)}function kh(n){return n.map(r=>{switch(r.kind){case"del":return`- ${r.text}`;case"add":return`+ ${r.text}`;case"path":return r.text;case"gap":return r.text;default:return _h(r.kind)}}).join(`
|
||||||
|
`)}function Sh({diffs:n,maxLines:r=dc,className:i}){const{rows:s,added:u,removed:c,files:h}=R.useMemo(()=>Lh(n),[n]),[p,g]=R.useState(!1),[C,v]=R.useState(!1),L=R.useCallback(()=>{C||br(kh(s)).then(z=>{z&&(v(!0),window.setTimeout(()=>{v(!1)},1e3))})},[C,s]),w=R.useCallback(()=>{g(z=>!z)},[]);if(s.length===0)return null;const _=s.length-r,k=_>0&&!p,E=Math.ceil(r/2),T=r-E,B=k?s.slice(0,E):s,W=k?s.slice(s.length-T):[];return f.jsxs("div",{className:ye(It.block,i),"data-diff":"",children:[f.jsx("button",{type:"button",className:It.copyButton,onClick:L,children:C?"复制成功":"复制"}),f.jsxs("div",{className:It.body,children:[B.map((z,ee)=>f.jsx("div",{className:ye(It.line,n3[z.kind]),children:z.text},ee)),_>0&&f.jsx("button",{type:"button",className:It.expand,"aria-expanded":p,"aria-label":p?"收起差异":`展开其余 ${_} 行差异`,onClick:w,children:p?"收起":`… 其余 ${_} 行`}),W.map((z,ee)=>f.jsx("div",{className:ye(It.line,n3[z.kind]),children:z.text},ee))]}),f.jsxs("div",{className:It.footer,children:["└ +",u," -",c," · ",h," file",h===1?"":"s"]})]})}const jh="_block_s66q0_7",Eh="_header_s66q0_20",bh="_summary_s66q0_30",Mh="_copyButton_s66q0_40",Oh="_body_s66q0_51",Nh="_line_s66q0_60",Rh="_lineNumber_s66q0_68",Ph="_fileHeader_s66q0_74",Th="_filePath_s66q0_88",Ih="_fileCount_s66q0_95",$h="_expand_s66q0_100",Hh="_empty_s66q0_116",gt={block:jh,header:Eh,summary:bh,copyButton:Mh,body:Oh,line:Nh,lineNumber:Rh,fileHeader:Ph,filePath:Th,fileCount:Ih,expand:$h,empty:Hh},hc=16;function Vh(n){return n.kind==="paths"?n.paths.join(`
|
||||||
|
`):n.files.map(r=>[r.path,...r.matches.map(i=>`${i.lineNumber}: ${i.line}`)].join(`
|
||||||
|
`)).join(`
|
||||||
|
|
||||||
|
`)}function Ah(n){return n.kind==="paths"?n.paths.length:n.files.reduce((r,i)=>r+i.matches.length,0)}function Dh(n,r,i,s){const u=i?`显示 ${r} / 共 ${s}`:`${r}`;return n.kind==="paths"?`${u} 个路径`:`${u} 处匹配 · ${n.files.length} 个文件`}function Fh(n,r){if(n.kind==="paths")return n.paths.map(s=>({type:"path",path:s}));const i=[];return n.files.forEach((s,u)=>{const c=r.has(u);if(i.push({type:"file",path:s.path,count:s.matches.length,index:u,collapsed:c}),!c)for(const h of s.matches)i.push({type:"match",lineNumber:h.lineNumber,line:h.line,key:`${u}:${h.lineNumber}`,fileIndex:u})}),i}function El(n){switch(n.type){case"match":return`match:${n.key}`;case"file":return`file:${n.index}`;case"path":return`path:${n.path}`}}function Bh(n){const{truncated:r,total:i,maxLines:s=hc,className:u}=n,[c,h]=R.useState(!1),[p,g]=R.useState(()=>new Set),C=Fh(n,p),v=Ah(n),L=C.length===0,{copied:w,onCopy:_}=oc(Vh(n)),k=R.useCallback(()=>{h(J=>!J)},[]),E=R.useCallback(J=>{g(q=>{const ce=new Set(q);return ce.has(J)?ce.delete(J):ce.add(J),ce})},[]),{hidden:T,capped:B,headLines:W,tailLines:z}=rc(C.length,s,c),ee=B?C.slice(0,W):C,Q=B?C.slice(C.length-z):[],V=Q[0],Z=(V==null?void 0:V.type)==="match"&&!ee.some(J=>J.type==="file"&&J.index===V.fileIndex)?C.find(J=>J.type==="file"&&J.index===V.fileIndex):void 0,ne=Z===void 0?Q:Q.slice(1),I=J=>J.type==="path"?f.jsx("div",{className:gt.line,children:J.path}):J.type==="match"?f.jsxs("div",{className:gt.line,children:[f.jsxs("span",{className:gt.lineNumber,children:[J.lineNumber,": "]}),J.line]}):f.jsxs("button",{type:"button",className:gt.fileHeader,"aria-expanded":!J.collapsed,onClick:()=>{E(J.index)},children:[f.jsx("span",{className:gt.filePath,children:J.path}),f.jsx("span",{className:gt.fileCount,children:J.count})]});return f.jsxs("div",{className:ye(gt.block,u),"data-search":n.kind,children:[f.jsxs("div",{className:gt.header,children:[f.jsx("span",{className:gt.summary,children:Dh(n,v,r,i)}),!L&&f.jsx("button",{type:"button",className:gt.copyButton,onClick:_,children:w?"复制成功":"复制"})]}),L?f.jsx("div",{className:gt.empty,children:"无结果"}):f.jsxs("div",{className:gt.body,children:[ee.map(J=>f.jsx("div",{children:I(J)},El(J))),T>0&&f.jsx("button",{type:"button",className:gt.expand,"aria-expanded":c,"aria-label":c?"收起结果":`展开其余 ${T} 行结果`,onClick:k,children:c?"收起":`… 其余 ${T} 行`}),Z!==void 0&&f.jsx("div",{children:I(Z)},`tailHeader:${El(Z)}`),ne.map(J=>f.jsx("div",{children:I(J)},El(J)))]})]})}const zh=2;function o3(n,r,i){var u;const s=(u=n.position)==null?void 0:u.start.offset;return s===void 0?-(i+1):r+s}class Zh{constructor(r){P(this,"prevText","");P(this,"tailStart",0);P(this,"frozen",[]);P(this,"generation",0);P(this,"cached",null);this.parse=r}update(r){var h,p;if(this.cached!==null&&r===this.prevText)return this.cached;r.startsWith(this.prevText)||(this.prevText="",this.tailStart=0,this.frozen=[],this.generation+=1),this.prevText=r;const i=this.tailStart,s=this.parse(r.slice(i)).children;let u=Math.max(0,s.length-zh);if(u>0){const g=(p=(h=s[u-1])==null?void 0:h.position)==null?void 0:p.end.offset;if(g===void 0)u=0;else{for(const C of s.slice(0,u))this.frozen.push({node:C,key:o3(C,i,this.frozen.length)});this.tailStart=i+g}}const c=s.slice(u).map((g,C)=>({node:g,key:o3(g,i,C)}));return this.cached={frozen:[...this.frozen],tail:c,generation:this.generation},this.cached}}const Uh=new RegExp(["\\p{Script_Extensions=Han}","\\p{Script_Extensions=Hiragana}","\\p{Script_Extensions=Katakana}","\\p{Script_Extensions=Hangul}","\\p{Script_Extensions=Bopomofo}"].join("|"),"u");function Wh(n){return n!==null&&n>=0&&Uh.test(String.fromCodePoint(n))}const qh=function(n,r,i){const s=this.parser.constructs.attentionMarkers.null;if(s===void 0)throw new Error("micromark CommonMark attention markers are unavailable");const u=s,c=this.previous,h=c0(c);let p=ge.eof;return g;function g(v){return v!==ge.asterisk?i(v):(p=v,n.enter("attentionSequence"),C(v))}function C(v){if(v===p)return n.consume(v),C;const L=n.exit("attentionSequence"),w=c0(v),_=!w||w===Pl.characterGroupPunctuation&&!!h||u.includes(v),k=!h||h===Pl.characterGroupPunctuation&&!!w||u.includes(c),T=L.end.offset-L.start.offset>=2&&U5(c)&&Wh(v),B=k||T;return L._open=_,L._close=B,r(v)}},Qh={name:"cjkFriendlyAttention",resolveAll:Z5.resolveAll,tokenize:qh},Kh={text:{[ge.asterisk]:Qh}};function pc(){return Kh}const Jh=function(n){if(n!==ge.backslash)return!0;const r=this.events.at(-1);return r===void 0?!1:r[1].type===wt.characterEscape},Gh=function(n,r,i){return s;function s(_){return _!==ge.backslash?i(_):(n.enter("mathText"),n.enter("mathTextSequence"),n.consume(_),u)}function u(_){return _!==ge.leftParenthesis?i(_):(n.consume(_),n.exit("mathTextSequence"),c)}function c(_){return _===ge.eof?i(_):_===ge.backslash?n.attempt({partial:!0,tokenize:L},v,h)(_):kr(_)?(n.enter(wt.lineEnding),n.consume(_),n.exit(wt.lineEnding),c):p(_)}function h(_){return n.check({partial:!0,tokenize:w},i,p)(_Line truncated
|
||||||
|
`)?n.slice(0,-1):n,h=R.useSyncExternalStore(ac,ei,ei),p=R.useMemo(()=>Jd(c,r),[c,r,h]),g=R.useRef(null),[C,v]=R.useState(!1),L=R.useCallback(()=>{var k,E;if(C)return;const _=((E=(k=g.current)==null?void 0:k.querySelector("pre"))==null?void 0:E.textContent)??c;br(_).then(T=>{T&&(v(!0),window.setTimeout(()=>{v(!1)},1e3))})},[C,c]),w=p===void 0?f.jsx("pre",{className:zn.plain,children:f.jsx("code",{children:c})}):f.jsx("div",{dangerouslySetInnerHTML:{__html:p}});return f.jsxs("div",{ref:g,className:ye(zn.block,"md-code-block",i),children:[f.jsx("div",{className:zn.bannerWrap,children:f.jsxs("div",{className:zn.banner,children:[f.jsx("div",{className:zn.infostring,children:r??""}),f.jsx("div",{className:zn.action,children:f.jsx("button",{type:"button",className:zn.copyButton,onClick:L,children:C?u:s})})]})}),w]})}function hp(n){const r={};for(const i of n.split(";")){const s=i.indexOf(":");if(s===-1)continue;const c=i.slice(0,s).trim().replace(/-([a-z])/g,(h,p)=>p.toUpperCase());r[c]=i.slice(s+1).trim()}return r}function vc(n,r){if(n.nodeType===Node.TEXT_NODE)return n.textContent;if(n.nodeType!==Node.ELEMENT_NODE)return null;const i=n,s={key:r};for(const c of i.attributes)c.name==="class"?s.className=c.value:c.name==="style"?s.style=hp(c.value):s[c.name]=c.value;const u=[...i.childNodes].map(vc);return u.length===0?R.createElement(i.localName,s):R.createElement(i.localName,s,...u)}function ql(n,r){let i;try{i=f0.renderToString(n,{displayMode:r,throwOnError:!0})}catch(u){try{i=f0.renderToString(n,{displayMode:r,strict:"ignore",throwOnError:!1})}catch{return f.jsx("span",{className:"katex-error",style:{color:"#cc0000"},title:String(u),children:n})}}return[...new DOMParser().parseFromString(i,"text/html").body.childNodes].map(vc)}const pp="_markdown_1nba0_5",mp="_tableScroll_1nba0_174",Cp="_imageAlt_1nba0_229",gp="_image_1nba0_229",vp="_fileMention_1nba0_249",S1={markdown:pp,tableScroll:mp,imageAlt:Cp,image:gp,fileMention:vp};function yc(n){try{switch(new URL(n).protocol){case"http:":case"https:":case"mailto:":return n;default:return""}}catch{return""}}function yp(n){try{const r=new URL(n).protocol;return r==="http:"||r==="https:"?n:void 0}catch{return}}function Ql(){return{definitions:new Map,footnotes:new Map}}function ti(n,r){for(const i of n){if(i.type==="definition"){const s=i.identifier.toUpperCase();r.definitions.has(s)||r.definitions.set(s,i)}else if(i.type==="footnoteDefinition"){const s=i.identifier.toUpperCase();r.footnotes.has(s)||r.footnotes.set(s,i)}"children"in i&&ti(i.children,r)}}function Kl(n,r){return n.map(i=>pu(i.node,i.key,r)).filter(i=>i!==null)}function hu(n,r){const i=[];for(const s of n)(r||i.length>0)&&i.push(`
|
||||||
|
`),i.push(s);return r&&n.length>0&&i.push(`
|
||||||
|
`),i}function wc(n,r){const i=[];for(const[s,u]of n.entries())if(u.type==="paragraph")i.push({paragraph:$t(u.children,r)});else{const c=pu(u,s,r);c!==null&&i.push({element:c})}return i}function $t(n,r){return n.map((i,s)=>pu(i,s,r))}function pu(n,r,i){var s;switch(n.type){case"text":return n.value;case"paragraph":return f.jsx("p",{children:$t(n.children,i)},r);case"heading":return R.createElement(`h${n.depth}`,{key:r},...$t(n.children,i));case"blockquote":return f.jsx("blockquote",{children:hu($t(n.children,i).filter(u=>u!==null),!0)},r);case"thematicBreak":return f.jsx("hr",{},r);case"break":return f.jsxs(R.Fragment,{children:[f.jsx("br",{}),`
|
||||||
|
`]},r);case"strong":return f.jsx("strong",{children:$t(n.children,i)},r);case"emphasis":return f.jsx("em",{children:$t(n.children,i)},r);case"delete":return f.jsx("del",{children:$t(n.children,i)},r);case"inlineCode":{const u=n.value.replace(/\r?\n|\r/g," "),c=kp(u);if(c!==void 0)return f.jsx("code",{children:Lc(c,[u],"link")},r);const h=i.inLink===!0||(s=i.fileMentions)==null?void 0:s.resolve(u);return h!==void 0?f.jsx("code",{children:f.jsx("button",{type:"button",className:S1.fileMention,title:h.title,"aria-label":h.label,onClick:h.open,children:u})},r):f.jsx("code",{children:u},r)}case"html":return n.value;case"code":return wp(n,r,i);case"math":return f.jsx(R.Fragment,{children:ql(n.value,!0)},r);case"inlineMath":return f.jsx(R.Fragment,{children:ql(n.value,!1)},r);case"list":return _p(n,r,i);case"listItem":return _c(n,xc(n),r,i);case"table":return Lp(n,r,i);case"link":return kc(n.url,$t(n.children,{...i,inLink:!0}),r);case"linkReference":return Sp(n,r,i);case"image":return Sc(n.url,n.alt??"",r);case"imageReference":return jp(n,r,i);case"footnoteReference":return Ep(n,r,i);case"definition":case"footnoteDefinition":return null;default:return null}}function wp(n,r,i){var c,h,p;const s=n.lang??void 0;if(n.value==="")return f.jsx("pre",{children:f.jsx("code",{className:s===void 0?void 0:`language-${s}`})},r);const u=s===void 0||(c=/^[\w-]+/.exec(s))==null?void 0:c[0];return!i.streaming&&u==="math"?f.jsx(R.Fragment,{children:ql(`${n.value}
|
||||||
|
`,!0)},r):f.jsx(gc,{code:`${n.value}
|
||||||
|
`,lang:i.streaming?void 0:u,copyLabel:(h=i.codeLabels)==null?void 0:h.copyLabel,copiedLabel:(p=i.codeLabels)==null?void 0:p.copiedLabel},r)}function xp(n){return(n.spread??!1)||n.children.some(xc)}function xc(n){return n.spread??n.children.length>1}function _p(n,r,i){const s=xp(n),u={};return typeof n.start=="number"&&n.start!==1&&(u.start=n.start),n.children.some(c=>typeof c.checked=="boolean")&&(u.className="contains-task-list"),R.createElement(n.ordered===!0?"ol":"ul",{key:r,...u},...n.children.map((c,h)=>_c(c,s,h,i)))}function _c(n,r,i,s){const u=wc(n.children,s),c=typeof n.checked=="boolean";if(c){const g=f.jsx("input",{type:"checkbox",checked:n.checked===!0,disabled:!0},"task-checkbox"),C=u[0];C!==void 0&&"paragraph"in C?C.paragraph=C.paragraph.length>0?[g," ",...C.paragraph]:[g]:u.unshift({paragraph:[g]})}const h=[];for(const[g,C]of u.entries()){const v="paragraph"in C;(r||g!==0||!v)&&h.push(`
|
||||||
|
`),v?r?h.push(f.jsx("p",{children:C.paragraph},`p-${g}`)):h.push(f.jsx(R.Fragment,{children:C.paragraph},`p-${g}`)):h.push(C.element)}const p=u[u.length-1];return p!==void 0&&(r||!("paragraph"in p))&&h.push(`
|
||||||
|
`),f.jsx("li",{className:c?"task-list-item":void 0,children:h},i)}function Lp(n,r,i){const s=n.align??null,[u,...c]=n.children;return f.jsx("div",{className:S1.tableScroll,children:f.jsxs("table",{children:[u!==void 0&&f.jsx("thead",{children:i3(u,"th",s,0,i)}),c.length>0&&f.jsx("tbody",{children:c.map((h,p)=>i3(h,"td",s,p+1,i))})]})},r)}function i3(n,r,i,s,u){const c=i===null?n.children.length:i.length,h=[];for(let p=0;p<c;p++){const g=n.children[p],C=i==null?void 0:i[p];h.push(R.createElement(r,{key:p,style:C==null?void 0:{textAlign:C}},...g===void 0?[]:$t(g.children,u)))}return f.jsx("tr",{children:h},s)}function Lc(n,r,i){const s=yc(n);if(s==="")return f.jsx(R.Fragment,{children:r},i);const u=["http:","https:"].includes(new URL(s).protocol);return f.jsx("a",{href:s,...u?{target:"_blank",rel:"noopener noreferrer"}:{},children:r},i)}function kc(n,r,i){return Lc(Gl(n),r,i)}function kp(n){if(n.trim()===n)try{const r=new URL(n).protocol;return r==="http:"||r==="https:"?n:void 0}catch{return}}function Sc(n,r,i){const s=yp(yc(Gl(n)));return s===void 0?f.jsx("span",{className:S1.imageAlt,children:r},i):f.jsx("img",{className:S1.image,src:s,alt:r,loading:"lazy",decoding:"async",referrerPolicy:"no-referrer"},i)}function jc(n){return n.referenceType==="collapsed"?"][]":n.referenceType==="full"?`][${n.label??n.identifier}]`:"]"}function Sp(n,r,i){const s=i.targets.definitions.get(n.identifier.toUpperCase());return s===void 0?f.jsxs(R.Fragment,{children:["[",$t(n.children,i),jc(n)]},r):kc(s.url,$t(n.children,{...i,inLink:!0}),r)}function jp(n,r,i){const s=i.targets.definitions.get(n.identifier.toUpperCase());return s===void 0?`![${n.alt??""}${jc(n)}`:Sc(s.url,n.alt??"",r)}function Ep(n,r,i){const s=n.identifier.toUpperCase(),u=i.footnoteCounts.get(s);return u===void 0&&i.footnoteOrder.push(s),i.footnoteCounts.set(s,(u??0)+1),f.jsx("sup",{children:String(i.footnoteOrder.indexOf(s)+1)},r)}function Ec(n){const r=[];for(const i of n.footnoteOrder){const s=n.targets.footnotes.get(i);if(s===void 0)continue;const u=n.footnoteCounts.get(i)??0,c=[];for(let C=1;C<=u;C++)c.length>0&&c.push(" "),c.push("↩"),C>1&&c.push(f.jsx("sup",{children:String(C)},`re-${C}`));const h=wc(s.children,n),p=h[h.length-1],g=h.map((C,v)=>"paragraph"in C?f.jsxs("p",{children:[C.paragraph,C===p&&f.jsxs(f.Fragment,{children:[" ",c]})]},`p-${v}`):C.element);(p===void 0||!("paragraph"in p))&&g.push(...c),r.push(f.jsx("li",{id:`user-content-fn-${Gl(i.toLowerCase())}`,children:hu(g,!0)},i))}return r.length===0?null:f.jsxs("section",{"data-footnotes":!0,className:"footnotes",children:[f.jsx("h2",{id:"footnote-label",className:"sr-only",children:"Footnotes"}),f.jsx("ol",{children:r})]},"footnotes")}function bp(n,r,i){const s=ip(n),u=Ql();ti(s.children,u);const c={streaming:!1,codeLabels:r,fileMentions:i,targets:u,footnoteOrder:[],footnoteCounts:new Map},h=hu(Kl(s.children.map((g,C)=>({node:g,key:C})),c),!1),p=Ec(c);return p===null?h:[...h,`
|
||||||
|
`,p]}class Mp{constructor(r){P(this,"parser",new Zh(Cc));P(this,"generation",-1);P(this,"frozenCount",0);P(this,"frozenElements",[]);P(this,"frozenTargets",Ql());P(this,"frozenFootnoteOrder",[]);P(this,"frozenFootnoteCounts",new Map);P(this,"lastText",null);P(this,"lastRendered",[]);this.codeLabels=r}render(r){if(r===this.lastText)return this.lastRendered;const{frozen:i,tail:s,generation:u}=this.parser.update(r);u!==this.generation&&(this.generation=u,this.frozenCount=0,this.frozenElements=[],this.frozenTargets=Ql(),this.frozenFootnoteOrder=[],this.frozenFootnoteCounts=new Map);const c=i.slice(this.frozenCount);ti(c.map(v=>v.node),this.frozenTargets);const h={definitions:new Map(this.frozenTargets.definitions),footnotes:new Map(this.frozenTargets.footnotes)};if(ti(s.map(v=>v.node),h),c.length>0){const v={streaming:!0,codeLabels:this.codeLabels,fileMentions:void 0,targets:h,footnoteOrder:this.frozenFootnoteOrder,footnoteCounts:this.frozenFootnoteCounts},L=[...this.frozenElements];for(const w of Kl(c,v))L.length>0&&L.push(`
|
||||||
|
`),L.push(w);this.frozenElements=L,this.frozenCount=i.length}const p={streaming:!0,codeLabels:this.codeLabels,fileMentions:void 0,targets:h,footnoteOrder:[...this.frozenFootnoteOrder],footnoteCounts:new Map(this.frozenFootnoteCounts)},g=[...this.frozenElements];for(const v of Kl(s,p))g.length>0&&g.push(`
|
||||||
|
`),g.push(v);const C=Ec(p);return C!==null&&g.push(`
|
||||||
|
`,C),this.lastText=r,this.lastRendered=g,this.lastRendered}}const bc=R.memo(function({text:r,streaming:i=!1,codeLabels:s,fileMentions:u}){const c=R.useRef(null),h=R.useRef(s),p=R.useMemo(()=>i?((c.current===null||h.current!==s)&&(c.current=new Mp(s),h.current=s),c.current.render(r)):(c.current=null,bp(r,s,u)),[r,i,s,u]);return f.jsx("div",{className:S1.markdown,children:p})}),Op="_block_d4nqi_7",Np="_answer_d4nqi_19",Rp="_sources_d4nqi_5",Pp="_source_d4nqi_5",Tp="_sourceLink_d4nqi_60",Ip="_snippet_d4nqi_71",$p="_published_d4nqi_79",Hp="_truncated_d4nqi_85",Vp="_empty_d4nqi_91",Ap="_fetch_d4nqi_97",Dp="_fetchUrl_d4nqi_103",Fp="_fetchMeta_d4nqi_115",Bp="_status_d4nqi_121",it={block:Op,answer:Np,sources:Rp,source:Pp,sourceLink:Tp,snippet:Ip,published:$p,truncated:Hp,empty:Vp,fetch:Ap,fetchUrl:Dp,fetchMeta:Fp,status:Bp};function zp(n){try{const{protocol:r}=new URL(n);return r==="http:"||r==="https:"?n:void 0}catch{return}}function Zp(n,r){if(r!==void 0&&r!=="")return r;try{const{hostname:i}=new URL(n);return i===""?n:i}catch{return n}}function Mc({url:n,label:r,className:i}){const s=zp(n);return s===void 0?f.jsx("span",{className:i,children:r}):f.jsx("a",{className:i,href:s,target:"_blank",rel:"noopener noreferrer",children:r})}function Up({source:n,ordinal:r}){return f.jsxs("li",{className:it.source,value:r,children:[f.jsx(Mc,{url:n.url,label:Zp(n.url,n.title),className:it.sourceLink}),n.snippet!==void 0&&n.snippet!==""&&f.jsx("div",{className:it.snippet,children:n.snippet}),n.publishedAt!==void 0&&n.publishedAt!==""&&f.jsx("div",{className:it.published,children:n.publishedAt})]})}function Wp({answer:n,sources:r,truncated:i,className:s}){const u=(n===void 0||n==="")&&r.length===0;return f.jsxs("div",{className:ye(it.block,s),"data-web":"search",children:[n!==void 0&&n!==""&&f.jsx("div",{className:it.answer,children:f.jsx(bc,{text:n})}),u?f.jsx("div",{className:it.empty,children:"未找到结果"}):f.jsx("ol",{className:it.sources,children:r.map((c,h)=>f.jsx(Up,{source:c,ordinal:h+1},h))}),i&&f.jsx("div",{className:it.truncated,children:"来源列表已截断"})]})}function qp({url:n,statusCode:r,truncated:i,className:s}){return f.jsxs("div",{className:ye(it.block,it.fetch,s),"data-web":"fetch",children:[f.jsx(Mc,{url:n,label:n,className:it.fetchUrl}),f.jsxs("div",{className:it.fetchMeta,children:[f.jsxs("span",{className:it.status,children:["HTTP ",r]}),i&&f.jsx("span",{className:it.truncated,children:"内容已截断"})]})]})}function Qp(n){return n.kind==="search"?f.jsx(Wp,{...n}):f.jsx(qp,{...n})}const Kp="_root_1ye18_1",Jp="_toggle_1ye18_5",Gp="_body_1ye18_20",bl={root:Kp,toggle:Jp,body:Gp},s3=2e4;function Yp(n){return`… 已截断,共 ${n} 字符`}function Xp({label:n,payload:r,defaultOpen:i=!1,truncatedLabel:s=Yp}){const[u,c]=R.useState(i),h=R.useMemo(()=>{if(!u)return"";let p;try{p=JSON.stringify(r,null,2)??String(r)}catch{p=String(r)}return p.length>s3?`${p.slice(0,s3)}
|
||||||
|
${s(p.length)}`:p},[u,r,s]);return f.jsxs("div",{className:bl.root,children:[f.jsxs("button",{type:"button",className:bl.toggle,onClick:()=>{c(p=>!p)},children:[u?"▾":"▸"," ",n]}),u&&f.jsx("pre",{className:bl.body,children:h})]})}const em="_text_1pfhk_1",tm={text:em};function nm({text:n}){return f.jsx("div",{className:tm.text,children:n})}function w1(n){var r;switch(n.type){case"text":case"inlineCode":case"code":return n.value??"";case"image":case"imageReference":return n.alt??"";case"break":return`
|
||||||
|
`;case"html":return n.value??"";default:return((r=n.children)==null?void 0:r.map(w1).join(""))??""}}function Uo(n){return n.replace(/\s+/g," ").trim()}function Lr(n){var r,i,s,u,c,h;switch(n.type){case"root":case"blockquote":return((r=n.children)==null?void 0:r.map(Lr).filter(Boolean).join(`
|
||||||
|
|
||||||
|
`))??"";case"paragraph":case"heading":return Uo(w1(n));case"code":return((i=n.value)==null?void 0:i.trim())??"";case"list":return((s=n.children)==null?void 0:s.map(Lr).filter(Boolean).join(`
|
||||||
|
`))??"";case"listItem":return((u=n.children)==null?void 0:u.map(Lr).filter(Boolean).join(" "))??"";case"table":return((c=n.children)==null?void 0:c.map(Lr).filter(Boolean).join(`
|
||||||
|
`))??"";case"tableRow":return((h=n.children)==null?void 0:h.map(Lr).join(" "))??"";case"tableCell":return Uo(w1(n));case"html":return n.value??"";case"thematicBreak":case"definition":return"";default:return Uo(w1(n))}}function Oc(n){if(n.type==="paragraph"){const r=Uo(w1(n));if(r!=="")return r}for(const r of n.children??[]){const i=Oc(r);if(i!==void 0)return i}}function rm(n){return Lr(n).split(`
|
||||||
|
`).map(r=>r.trim()).join(`
|
||||||
|
`).replace(/\n{3,}/g,`
|
||||||
|
|
||||||
|
`).trim()}function om(n,r={}){const{mode:i="all"}=r,s=Cc(n),u=rm(s);switch(i){case"all":return u;case"first-line":return u.split(`
|
||||||
|
`).find(c=>c!=="")??"";case"first-paragraph":return Oc(s)??u.split(`
|
||||||
|
`).find(c=>c!=="")??""}}const im=Object.freeze(Object.defineProperty({__proto__:null,BrandWordmark:vf,Button:zl,CodeBlock:gc,ConnectionBanner:Cf,DEFAULT_DIFF_MAX_LINES:dc,DEFAULT_READ_MAX_LINES:fc,DEFAULT_SEARCH_MAX_LINES:hc,DEFAULT_TERMINAL_MAX_LINES:ic,DiffBlock:Sh,DisclosureRow:Y9,FishLogo:gf,HoverCard:Z7,IconAgentPresetOutline16:s9,IconApiOutline14:S9,IconArchiveOutline20:U9,IconBranchOutline16:q8,IconBrowseOutline16:l9,IconCheckOutline14:W8,IconCheckOutline16:cu,IconChecklistOutline14:V9,IconChevronDownOutline14:Bl,IconChevronLeftOutline14:U3,IconChevronRightOutline14:W3,IconChevronUpOutline14:K8,IconCloseFill14:q3,IconCloseOutline16:fu,IconCodeOutline16:L9,IconCopyOutline16:Q3,IconCordisPluginOutline14:k9,IconDarkOutline16:P9,IconDataOutline16:I9,IconDislikeFill16:t9,IconDislikeOutline16:e9,IconDownloadOutline16:y9,IconEditOutline16:r9,IconEllipsisOutline16:Z8,IconEnhanceOutline16:d9,IconFolderClose16:O9,IconFolderOpen16:M9,IconFolderOpenOutline16:b9,IconFollowsystemOutline16:T9,IconFullscreenOutline16:_9,IconGlobeOutline14:D8,IconGoalOutline16:D9,IconInspectOutline12:B9,IconLightOutline16:R9,IconLikeFill16:X8,IconLikeOutline16:Y8,IconLinkOutline14:u9,IconLinkOutline16:a9,IconListPenOutline16:A9,IconLoadingOutline16:v9,IconNewChatOutline16:V8,IconPanelLeftOutline16:z8,IconPaperclipOutline16:g9,IconPauseOutline16:x9,IconPersonalizationOutline16:j9,IconPlayOutline16:w9,IconPlusOutline16:U8,IconProjectAddOutline16:E9,IconQuestionOutline14:Z9,IconQueueOutline14:H9,IconRefreshOutline14:G8,IconRefreshOutline16:J8,IconRightUpOutline14:c9,IconRightUpOutline16:f9,IconSearchOutline16:A8,IconSendOutline14:$9,IconSendOutline16:m9,IconSettingsOutline14:F8,IconSettingsOutline16:B8,IconShareOutline16:n9,IconSkillOutline16:z9,IconSparkle16:F9,IconStopFill16:C9,IconThinkOutline14:o9,IconThinkOutline16:i9,IconTrashOutline16:h9,IconTreeCorner8x10:N9,IconTriangleRightFill14:Q8,IconUserOutline16:p9,IconWarningOutline16:K3,Input:h7,JsonBlock:Xp,JsonTree:id,MarkdownText:bc,Menu:Y3,MessageText:nm,Modal:X3,OnboardingSurface:of,Pill:J3,ReadBlock:fh,RiskConfirmation:hf,SearchBlock:Bh,StateDot:Z3,TerminalBlock:Fd,Toast:Ef,Tooltip:xf,WebBlock:Qp,extractMarkdownPlainText:om,useAnchoredMaxHeight:H7,writeClipboard:br},Symbol.toStringTag,{value:"Module"})),sm="_root_1hk8w_5",lm="_rail_1hk8w_10",um="_item_1hk8w_28",am="_thumbnail_1hk8w_35",cm="_remove_1hk8w_53",fm="_arrow_1hk8w_90",dm="_arrowLeft_1hk8w_112",hm="_arrowRight_1hk8w_116",rn={root:sm,rail:lm,item:um,thumbnail:am,remove:cm,arrow:fm,arrowLeft:dm,arrowRight:hm},pm=16;function mm(){var n;return(n=window.matchMedia)!=null&&n.call(window,"(prefers-reduced-motion: reduce)").matches?"auto":"smooth"}function Cm({items:n,labels:r,onOpen:i,onRemove:s}){const u=R.useRef(null),c=R.useRef(null),[h,p]=R.useState({left:!1,right:!1}),g=R.useCallback(()=>{const v=u.current;if(v===null)return;const L=v.scrollLeft>1,w=v.scrollLeft<v.scrollWidth-v.clientWidth-1;p(_=>_.left===L&&_.right===w?_:{left:L,right:w})},[]);R.useLayoutEffect(()=>{const v=c.current!==null&&n.length>c.current;c.current=n.length;const L=u.current;L!==null&&(v&&(L.scrollLeft=L.scrollWidth-L.clientWidth),g())},[n.length,g]),R.useEffect(()=>{const v=u.current;if(v===null)return;let L=()=>{};if(typeof ResizeObserver<"u"){const _=new ResizeObserver(g);_.observe(v),L=()=>{_.disconnect()}}const w=_=>{if(_.deltaY===0)return;const k=_.deltaMode===WheelEvent.DOM_DELTA_LINE?pm:_.deltaMode===WheelEvent.DOM_DELTA_PAGE?v.clientWidth:1;_.preventDefault(),v.scrollBy({left:_.deltaX!==0?_.deltaX*k:Math.sign(_.deltaY)*Math.min(Math.abs(_.deltaY)*k,60),behavior:"auto"})};return v.addEventListener("wheel",w,{passive:!1}),()=>{L(),v.removeEventListener("wheel",w)}},[g]);const C=v=>{const L=u.current;L!==null&&L.scrollBy({left:v*Math.max(L.clientWidth-64,200),behavior:mm()})};return f.jsxs("div",{className:rn.root,children:[h.left&&f.jsx("button",{type:"button",className:ye(rn.arrow,rn.arrowLeft),"aria-label":r.scrollLeft,onClick:()=>{C(-1)},children:f.jsx(U3,{})}),f.jsx("div",{ref:u,className:rn.rail,role:"group","aria-label":r.group,onScroll:g,children:n.map(v=>f.jsxs("div",{className:rn.item,children:[f.jsx("button",{type:"button",className:rn.thumbnail,title:r.open,onClick:()=>{i(v)},children:f.jsx("img",{src:v.previewUrl,alt:v.alt})}),f.jsx("button",{type:"button",className:rn.remove,"aria-label":v.removeLabel,onClick:()=>{s(v)},children:f.jsx(q3,{size:12})})]},v.id))}),h.right&&f.jsx("button",{type:"button",className:ye(rn.arrow,rn.arrowRight),"aria-label":r.scrollRight,onClick:()=>{C(1)},children:f.jsx(W3,{})})]})}const gm="_mask_rcb0a_5",vm="_wrap_rcb0a_29",ym="_illustration_rcb0a_39",wm="_title_rcb0a_44",xm="_desc_rcb0a_49",C1={mask:gm,wrap:vm,illustration:ym,title:wm,desc:xm};function _m({disabled:n,labels:r}){return ln.createPortal(f.jsx("div",{className:C1.mask,role:"status",children:f.jsxs("div",{className:C1.wrap,children:[f.jsx("div",{className:C1.illustration,"aria-hidden":"true",children:n?f.jsx(km,{}):f.jsx(Lm,{})}),f.jsx("divLine truncated
|
||||||
|
${i.join(`
|
||||||
|
`)}`)}}const Vc=document.getElementById("root");if(Vc===null)throw new Error("web app: missing #root");new qm(Vc).run();
|
||||||
|
//# sourceMappingURL=index-Dqw48FrP.js.map
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(/assets/fonts/KaTeX_AMS-Regular-BQhdFMY1.woff2) format("woff2"),url(/assets/fonts/KaTeX_AMS-Regular-DMm9YOAa.woff) format("woff"),url(/assets/fonts/KaTeX_AMS-Regular-DRggAlZN.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(/assets/fonts/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2) format("woff2"),url(/assets/fonts/KaTeX_Caligraphic-Bold-BEiXGLvX.woff) format("woff"),url(/assets/fonts/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(/assets/fonts/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2) format("woff2"),url(/assets/fonts/KaTeX_Caligraphic-Regular-CTRA-rTL.woff) format("woff"),url(/assets/fonts/KaTeX_Caligraphic-Regular-wX97UBjC.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(/assets/fonts/KaTeX_Fraktur-Bold-CL6g_b3V.woff2) format("woff2"),url(/assets/fonts/KaTeX_Fraktur-Bold-BsDP51OF.woff) format("woff"),url(/assets/fonts/KaTeX_Fraktur-Bold-BdnERNNW.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(/assets/fonts/KaTeX_Fraktur-Regular-CTYiF6lA.woff2) format("woff2"),url(/assets/fonts/KaTeX_Fraktur-Regular-Dxdc4cR9.woff) format("woff"),url(/assets/fonts/KaTeX_Fraktur-Regular-CB_wures.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(/assets/fonts/KaTeX_Main-Bold-Cx986IdX.woff2) format("woff2"),url(/assets/fonts/KaTeX_Main-Bold-Jm3AIy58.woff) format("woff"),url(/assets/fonts/KaTeX_Main-Bold-waoOVXN0.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(/assets/fonts/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2) format("woff2"),url(/assets/fonts/KaTeX_Main-BoldItalic-SpSLRI95.woff) format("woff"),url(/assets/fonts/KaTeX_Main-BoldItalic-DzxPMmG6.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(/assets/fonts/KaTeX_Main-Italic-NWA7e6Wa.woff2) format("woff2"),url(/assets/fonts/KaTeX_Main-Italic-BMLOBm91.woff) format("woff"),url(/assets/fonts/KaTeX_Main-Italic-3WenGoN9.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(/assets/fonts/KaTeX_Main-Regular-B22Nviop.woff2) format("woff2"),url(/assets/fonts/KaTeX_Main-Regular-Dr94JaBh.woff) format("woff"),url(/assets/fonts/KaTeX_Main-Regular-ypZvNtVU.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(/assets/fonts/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2) format("woff2"),url(/assets/fonts/KaTeX_Math-BoldItalic-iY-2wyZ7.woff) format("woff"),url(/assets/fonts/KaTeX_Math-BoldItalic-B3XSjfu4.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(/assets/fonts/KaTeX_Math-Italic-t53AETM-.woff2) format("woff2"),url(/assets/fonts/KaTeX_Math-Italic-DA0__PXp.woff) format("woff"),url(/assets/fonts/KaTeX_Math-Italic-flOr_0UB.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(/assets/fonts/KaTeX_SansSerif-Bold-D1sUS0GD.woff2) format("woff2"),url(/assets/fonts/KaTeX_SansSerif-Bold-DbIhKOiC.woff) format("woff"),url(/assets/fonts/KaTeX_SansSerif-Bold-CFMepnvq.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(/assets/fonts/KaTeX_SansSerif-Italic-C3H0VqGB.woff2) format("woff2"),url(/assets/fonts/KaTeX_SansSerif-Italic-DN2j7dab.woff) format("woff"),url(/assets/fonts/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(/assets/fonts/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2) format("woff2"),url(/assets/fonts/KaTeX_SansSerif-Regular-CS6fqUqJ.woff) format("woff"),url(/assets/fonts/KaTeX_SansSerif-Regular-BNo7hRIc.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(/assets/fonts/KaTeX_Script-Regular-D3wIWfF6.woff2) format("woff2"),url(/assets/fonts/KaTeX_Script-Regular-D5yQViql.woff) format("woff"),url(/assets/fonts/KaTeX_Script-Regular-C5JkGWo-.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(/assets/fonts/KaTeX_Size1-Regular-mCD8mA8B.woff2) format("woff2"),url(/assets/fonts/KaTeX_Size1-Regular-C195tn64.woff) format("woff"),url(/assets/fonts/KaTeX_Size1-Regular-Dbsnue_I.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(/assets/fonts/KaTeX_Size2-ReguLine truncated
|
||||||
@@ -0,0 +1,411 @@
|
|||||||
|
var oc=Object.defineProperty;var lc=Object.getPrototypeOf;var uc=Reflect.get;var qs=e=>{throw TypeError(e)};var cc=(e,t,n)=>t in e?oc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var z=(e,t,n)=>cc(e,typeof t!="symbol"?t+"":t,n),qa=(e,t,n)=>t.has(e)||qs("Cannot "+n);var je=(e,t,n)=>(qa(e,t,"read from private field"),n?n.call(e):t.get(e)),cn=(e,t,n)=>t.has(e)?qs("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),gt=(e,t,n,r)=>(qa(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ja=(e,t,n)=>(qa(e,t,"access private method"),n);var js=(e,t,n)=>uc(lc(e),n,t);var be=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function mc(e){return cs(e)}function cs(e){return Array.isArray(e)?hc(e):e instanceof RegExp?e:typeof e=="object"?pc(e):e}function hc(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=cs(e[n]);return t}function pc(e){let t={};for(let n in e)t[n]=cs(e[n]);return t}function Nl(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function Bl(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Bl(e.substring(0,e.length-1)):e.substr(~t+1)}var Ga=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Ar=class{static hasCaptures(e){return e===null?!1:(Ga.lastIndex=0,Ga.test(e))}static replaceCaptures(e,t,n){return e.replace(Ga,(r,a,i,s)=>{let o=n[parseInt(a||i,10)];if(o){let l=t.substring(o.start,o.end);for(;l[0]===".";)l=l.substring(1);switch(s){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function Dl(e,t){return e<t?-1:e>t?1:0}function Ll(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let a=0;a<n;a++){let i=Dl(e[a],t[a]);if(i!==0)return i}return 0}return n-r}function Gs(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Fl(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Pl=class{constructor(e){z(this,"cache",new Map);this.fn=e}get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},Yr=class{constructor(e,t,n){z(this,"_cachedMatchRoot",new Pl(e=>this._root.match(e)));this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(gc(e),t)}static createFromParsedTheme(e,t){return yc(e,t)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(a=>dc(e.parent,a.parentScopes));return r?new Ol(r.fontStyle,r.foreground,r.background):null}},Ha=class jr{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new jr(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new jr(n,t[r]);return n}push(t){return new jr(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function dc(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],a=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],a=!0}for(;e&&!fc(e.scopeName,r);){if(a)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function fc(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Ol=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function gc(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let a=0,i=t.length;a<i;a++){let s=t[a];if(!s.settings)continue;let o;if(typeof s.scope=="string"){let c=s.scope;c=c.replace(/^[,]+/,""),c=c.replace(/[,]+$/,""),o=c.split(",")}else Array.isArray(s.scope)?o=s.scope:o=[""];let l=-1;if(typeof s.settings.fontStyle=="string"){l=0;let c=s.settings.fontStyle.split(" ");for(let f=0,d=c.length;f<d;f++)switch(c[f]){case"italic":l=l|1;break;case"bold":l=l|2;break;case"underline":l=l|4;break;case"strikethrough":l=l|8;break}}let u=null;typeof s.settings.foreground=="string"&&Gs(s.settings.foreground)&&(u=s.settings.foreground);let h=null;typeof s.settings.background=="string"&&Gs(s.settings.background)&&(h=s.settings.background);for(let c=0,f=o.length;c<f;c++){let b=o[c].trim().split(" "),w=b[b.length-1],A=null;b.length>1&&(A=b.slice(0,b.length-1),A.reverse()),n[r++]=new bc(w,A,a,l,u,h)}}return n}var bc=class{constructor(e,t,n,r,a,i){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=a,this.background=i}},Fe=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Fe||{});function yc(e,t){e.sort((l,u)=>{let h=DlLine truncated
|
||||||
|
`)}findNextMatchSync(e,t,n){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Ua=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Dt,Dc=(Dt=class{constructor(t,n){z(this,"_defaultAttributes");z(this,"_embeddedLanguagesMatcher");z(this,"_getBasicScopeAttributes",new Pl(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new Ua(n,r)}));this._defaultAttributes=new Ua(t,8),this._embeddedLanguagesMatcher=new Lc(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Dt._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Dt.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}},z(Dt,"_NULL_SCOPE_METADATA",new Ua(0,0)),z(Dt,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),Dt),Lc=class{constructor(e){z(this,"values");z(this,"scopesRegExp");if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>Fl(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Xs=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Vl(e,t,n,r,a,i,s,o){const l=t.content.length;let u=!1,h=-1;if(s){const d=Fc(e,t,n,r,a,i);a=d.stack,r=d.linePos,n=d.isFirstLine,h=d.anchorPosition}const c=Date.now();for(;!u;){if(o!==0&&Date.now()-c>o)return new Xs(a,!0);f()}return new Xs(a,!1);function f(){const d=Pc(e,t,n,r,a,h);if(!d){i.produce(a,l),u=!0;return}const b=d.captureIndices,w=d.matchedRuleId,A=b&&b.length>0?b[0].end>r:!1;if(w===Rc){const k=a.getRule(e);i.produce(a,b[0].start),a=a.withContentNameScopesList(a.nameScopesList),er(e,t,n,a,i,k.endCaptures,b),i.produce(a,b[0].end);const C=a;if(a=a.parent,h=C.getAnchorPos(),!A&&C.getEnterPos()===r){a=C,i.produce(a,l),u=!0;return}}else{const k=e.getRule(w);i.produce(a,b[0].start);const C=a,T=k.getName(t.content,b),I=a.contentNameScopesList.pushAttributed(T,e);if(a=a.push(w,r,h,b[0].end===l,null,I,I),k instanceof Si){const N=k;er(e,t,n,a,i,N.beginCaptures,b),i.produce(a,b[0].end),h=b[0].end;const E=N.getContentName(t.content,b),L=I.pushAttributed(E,e);if(a=a.withContentNameScopesList(L),N.endHasBackReferences&&(a=a.withEndRule(N.getEndWithResolvedBackReferences(t.content,b))),!A&&C.hasSameRuleAs(a)){a=a.pop(),i.produce(a,l),u=!0;return}}else if(k instanceof Qr){const N=k;er(e,t,n,a,i,N.beginCaptures,b),i.produce(a,b[0].end),h=b[0].end;const E=N.getContentName(t.content,b),L=I.pushAttributed(E,e);if(a=a.withContentNameScopesList(L),N.whileHasBackReferences&&(a=a.withEndRule(N.getWhileWithResolvedBackReferences(t.content,b))),!A&&C.hasSameRuleAs(a)){a=a.pop(),i.produce(a,l),u=!0;return}}else if(er(e,t,n,a,i,k.captures,b),i.produce(a,b[0].end),a=a.pop(),!A){a=a.safePop(),i.produce(a,l),u=!0;return}}b[0].end>r&&(r=b[0].end,n=!1)}}function Fc(e,t,n,r,a,i){let s=a.beginRuleCapturedEOL?0:-1;const o=[];for(let l=a;l;l=l.pop()){const u=l.getRule(e);u instanceof Qr&&o.push({rule:u,stack:l})}for(let l=o.pop();l;l=o.pop()){const{ruleScanner:u,findOptions:h}=jc(l.rule,e,l.stack.endRule,n,r===s),c=u.findNextMatchSync(t,r,h);if(c){if(c.ruleId!==Hl){a=l.stack.pop();break}c.captureIndices&&c.captureIndices.length&&(i.produce(l.stack,c.captureIndices[0].start),er(e,t,n,l.stack,i,l.rule.whileCaptures,c.captureIndices),i.produce(l.stack,c.captureIndices[0].end),s=c.captureIndices[0].end,c.captureIndices[0].end>r&&(r=c.captureIndices[0].end,n=!1))}else{a=l.stack.pop();break}}return{stack:a,linePos:r,anchorPosition:s,isFirstLine:n}}function Pc(e,t,n,r,a,i){const s=Oc(e,t,n,r,a,i),o=e.getInjections();if(o.length===0)return s;const l=qc(o,e,t,n,r,a,i);if(!l)return s;if(!s)return l;const u=s.captureIndices[0].start,h=l.captureIndices[0].start;return h<u||l.priorityMatch&&h===u?l:s}function Oc(e,t,n,r,a,i){const s=a.getRule(e),{ruleScanner:o,findOptions:l}=Xl(s,e,a.endRule,n,r===i),u=o.findNextMatchSync(t,r,l);return u?{captureIndices:u.captureIndices,matchedRuleId:u.ruleId}:null}function qc(e,t,n,r,a,i,s){let o=Number.MAX_VALUE,l=null,u,h=0;const c=i.contentNameScopesList.getScopeNames();for(let f=0,d=e.length;f<d;f++){const b=e[f];if(!b.matcher(c))continue;const w=t.getRule(b.ruleId),{ruleScanner:A,findOptions:k}=Xl(w,t,null,r,a===s),C=A.findNextMatchSync(n,a,k);if(!C)continue;const T=C.captureIndices[0].start;if(!(T>=o)&&(o=T,l=C.captureIndices,u=C.ruleId,h=b.priority,o===a))break}return l?{priorityMatch:h===-1,captureIndices:l,matchedRuleId:u}:null}function Xl(e,t,n,r,a){return{ruleScanner:e.compileAG(t,n,r,a),findOptions:0}}function jc(e,t,n,r,a){return{ruleScanLine truncated
|
||||||
|
`;const i=this.createOnigString(e),s=i.content.length,o=new Xc(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=Vl(this,i,a,0,t,o,!0,r);return jl(i),{lineLength:s,lineTokens:o,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Zs(e,t){return e=mc(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var nr=class xt{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,a=(t==null?void 0:t.scopePath)??null;for(const i of n)a=Ha.push(a,i.scopeNames),r=new xt(r,a,i.encodedTokenAttributes);return r}static createRoot(t,n){return new xt(null,new Ha(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const a=r.getMetadataForScope(t),i=new Ha(null,t),s=r.themeProvider.themeMatch(i),o=xt.mergeAttributes(n,a,s);return new xt(null,i,o)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return xt.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let a=-1,i=0,s=0;return r!==null&&(a=r.fontStyle,i=r.foregroundId,s=r.backgroundId),xn.set(t,n.languageId,n.tokenType,null,a,i,s)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return xt._pushAttributed(this,t,n);const r=t.split(/ /g);let a=this;for(const i of r)a=xt._pushAttributed(a,i,n);return a}static _pushAttributed(t,n,r){const a=r.getMetadataForScope(n),i=t.scopePath.push(n),s=r.themeProvider.themeMatch(i),o=xt.mergeAttributes(t.tokenAttributes,a,s);return new xt(t,i,o)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){var a;const n=[];let r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(((a=r.parent)==null?void 0:a.scopePath)??null)}),r=r.parent;return r===t?n.reverse():void 0}},ut,Ai=(ut=class{constructor(t,n,r,a,i,s,o,l){z(this,"_stackElementBrand");z(this,"_enterPos");z(this,"_anchorPos");z(this,"depth");this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=s,this.nameScopesList=o,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=a}equals(t){return t===null?!1:ut._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?nr.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){ut._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,a,i,s,o){return new ut(this,t,n,r,a,i,s,o)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){var r,a;return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${(r=this.nameScopesList)==null?void 0:r.toString()}, ${(a=this.contentNameScopesList)==null?void 0:a.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new ut(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){var t,n,r;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((n=this.nameScopesList)==null?void 0:n.getExtensionIfDefined(((t=this.parent)==null?void 0:t.nameScopesList)??null))??[],contentNameScopesList:((r=this.contentNameScopesList)==null?void 0:r.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(t,n){const r=nr.fromExtension((t==null?void 0:t.nameScopesList)??null,n.nameScopesList);return new ut(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,nr.fromExtension(r,n.contentNameScopesList))}},z(ut,"NULL",new ut(null,0,0,0,!1,null,null,null)),ut),Vc=class{constructor(e,t){z(this,"balancedBracketScopes");z(this,"unbalancedBracketScopes");z(this,"allowAny",!1);this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Zr(n,Jr).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Zr(n,Jr).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!Line truncated
|
||||||
|
\f\r &/=>`.split(""),`
|
||||||
|
\f\r "&'/=>\``.split("")],[`\0
|
||||||
|
\f\r "&'/<=>`.split(""),`\0
|
||||||
|
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
||||||
|
\f\r &>`.split(""),`\0
|
||||||
|
\f\r "&'<=>\``.split("")],[`\0
|
||||||
|
\f\r "&'<=>\``.split(""),`\0
|
||||||
|
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function yh(e,t,n,r){const a=r.schema,i=a.space==="svg"?!1:r.settings.omitOptionalTags;let s=a.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const o=[];let l;a.space==="html"&&e.tagName==="svg"&&(r.schema=l0);const u=vh(r,e.properties),h=r.all(a.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=a,h&&(s=!1),(u||!i||!hh(e,t,n))&&(o.push("<",e.tagName,u?" "+u:""),s&&(a.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&o.push(" "),o.push("/")),o.push(">")),o.push(h),!s&&(!i||!fs(e,t,n))&&o.push("</"+e.tagName+">"),o.join("")}function vh(e,t){const n=[];let r=-1,a;if(t){for(a in t)if(t[a]!==null&&t[a]!==void 0){const i=wh(e,a,t[a]);i&&n.push(i)}}for(;++r<n.length;){const i=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&i!=='"'&&i!=="'"&&(n[r]+=" ")}return n.join("")}function wh(e,t,n){const r=_m(e.schema,t),a=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,i=e.settings.allowDangerousCharacters?0:1;let s=e.quote,o;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const l=Dn(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Er.name[a][i]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Ym:Zm)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?l:(e.settings.preferUnquoted&&(o=Dn(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Er.unquoted[a][i]}))),o!==n&&(e.settings.quoteSmart&&ta(n,s)>ta(n,e.alternative)&&(s=e.alternative),o=s+Dn(n,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?Er.single:Er.double)[a][i],attribute:!0}))+s),l+(o&&"="+o))}const xh=["<","&"];function p0(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Dn(e.value,Object.assign({},r.settings.characterReferences,{subset:xh}))}function kh(e,t,n,r){return r.settings.allowDangerousHtml?e.value:p0(e,t,n,r)}function _h(e,t,n,r){return r.all(e)}const $h=Am("type",{invalid:Ch,unknown:Sh,handlers:{comment:Vm,doctype:Xm,element:yh,raw:kh,root:_h,text:p0}});function Ch(e){throw new Error("Expected node, not `"+e+"`")}function Sh(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const Ah={},Th={},Eh=[];function Mh(e,t){const n=t||Ah,r=n.quote||'"',a=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Ih,all:zh,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||bm,characterReferences:n.characterReferences||Th,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?l0:Sm,quote:r,alternative:a}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function Ih(e,t,n){return $h(e,t,n,this)}function zh(e){const t=[],n=e&&e.children||Eh;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}const lo=/\s+/g;function d0(e,t){var r;if(!t)return e;e.properties||(e.properties={}),(r=e.properties).class||(r.class=[]),typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(lo)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(lo);for(const a of n)a&&!e.properties.class.includes(a)&&e.properties.class.push(a);return e}function Rh(e){const t=ga(e,!0).map(([a])=>a);function n(a){if(a===e.length)return{line:t.length-1,character:t.at(-1).length};let i=a,s=0;for(const o of t){if(i<o.length)break;i-=o.length,s++}return{line:s,character:i}}function r(a,i){let s=0;for(let o=0;o<a;o++)s+=t[o].length;return s+=i,s}return{lines:t,indexToPos:n,posToIndex:r}}const Nh=["color","background-color"];function Bh(e,t){let n=0;const r=[];for(const a of t)a>n&&r.push({...e,content:e.content.slice(n,a),offset:e.offset+n}),n=a;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function Dh(e,t){const n=[...t instanceof Set?t:new Set(t)].sort((r,a)=>r-a);return n.length?e.map(r=>r.flatMap(a=>{const i=n.filter(s=>a.offset<s&&s<a.offset+a.content.length).map(s=>s-a.offLine truncated
|
||||||
|
`}));let N={type:"element",tagName:"span",properties:{class:"line"},children:[]},E=0;for(const q of T){let M={type:"element",tagName:"span",properties:{...q.htmlAttrs},children:[{type:"text",value:q.content}]};const U=Ri(q.htmlStyle||na(q));U&&(M.properties.style=U);for(const j of a)M=((L=j==null?void 0:j.span)==null?void 0:L.call(d,M,I+1,E,N,q))||M;o==="inline"?s.children.push(M):o==="classic"&&N.children.push(M),E+=q.content.length}if(o==="classic"){for(const q of a)N=((V=q==null?void 0:q.line)==null?void 0:V.call(d,N,I+1))||N;f.push(N),i.push(N)}else o==="inline"&&f.push(N)}),o==="classic"){for(const T of a)c=((w=T==null?void 0:T.code)==null?void 0:w.call(d,c))||c;h.children.push(c);for(const T of a)h=((A=T==null?void 0:T.pre)==null?void 0:A.call(d,h))||h;s.children.push(h)}else if(o==="inline"){const T=[];let I={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const E of s.children)E.type==="element"&&E.tagName==="br"?(T.push(I),I={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(E.type==="element"||E.type==="text")&&I.children.push(E);T.push(I);let N={type:"element",tagName:"code",properties:{},children:T};for(const E of a)N=((k=E==null?void 0:E.code)==null?void 0:k.call(d,N))||N;s.children=[];for(let E=0;E<N.children.length;E++){E>0&&s.children.push({type:"element",tagName:"br",properties:{},children:[]});const L=N.children[E];L.type==="element"&&s.children.push(...L.children)}}let b=s;for(const T of a)b=((C=T==null?void 0:T.root)==null?void 0:C.call(d,b))||b;return r&&ba(b,r),b}function ep(e){return e.map(t=>{const n=[];let r="",a;return t.forEach((i,s)=>{const o=!(i.fontStyle&&(i.fontStyle&Fe.Underline||i.fontStyle&Fe.Strikethrough));o&&g0.test(i.content)&&t[s+1]?(a===void 0&&(a=i.offset),r+=i.content):r?(o?n.push({...i,offset:a,content:r+i.content}):n.push({content:r,offset:a},i),a=void 0,r=""):n.push(i)}),n})}function tp(e){return e.map(t=>t.flatMap(n=>{if(g0.test(n.content))return n;const r=n.content.match(Qh);if(!r)return n;const[,a,i,s]=r;if(!a&&!s)return n;const o=[{...n,offset:n.offset+a.length,content:i}];return a&&o.unshift({content:a,offset:n.offset}),s&&o.push({content:s,offset:n.offset+a.length+i.length}),o}))}function np(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const a=n.at(-1),i=Ri(a.htmlStyle||na(a)),s=Ri(r.htmlStyle||na(r)),o=a.fontStyle&&(a.fontStyle&Fe.Underline||a.fontStyle&Fe.Strikethrough),l=r.fontStyle&&(r.fontStyle&Fe.Underline||r.fontStyle&Fe.Strikethrough);!o&&!l&&i===s?a.content+=r.content:n.push({...r})}return n})}const rp=Mh;function ap(e,t,n){var i;const r={meta:{},options:n,codeToHast:(s,o)=>ia(e,s,o),codeToTokens:(s,o)=>aa(e,s,o)};let a=rp(ia(e,t,n,r));for(const s of ra(n))a=((i=s.postprocess)==null?void 0:i.call(r,a,n))||a;return a}function k5(e){const t=im(e);return{getLastGrammarState:(...n)=>cm(t,...n),codeToTokensBase:(n,r)=>Ni(t,n,r),codeToTokensWithThemes:(n,r)=>e0(t,n,r),codeToTokens:(n,r)=>aa(t,n,r),codeToHast:(n,r)=>ia(t,n,r),codeToHtml:(n,r)=>ap(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function _5(e={}){var s;const{name:t="css-variables",variablePrefix:n="--shiki-",fontStyle:r=!0}=e,a=o=>{var l;return(l=e.variableDefaults)!=null&&l[o]?`var(${n}${o}, ${e.variableDefaults[o]})`:`var(${n}${o})`},i={name:t,type:"dark",colors:{"editor.foreground":a("foreground"),"editor.background":a("background"),"terminal.ansiBlack":a("ansi-black"),"terminal.ansiRed":a("ansi-red"),"terminal.ansiGreen":a("ansi-green"),"terminal.ansiYellow":a("ansi-yellow"),"terminal.ansiBlue":a("ansi-blue"),"terminal.ansiMagenta":a("ansi-magenta"),"terminal.ansiCyan":a("ansi-cyan"),"terminal.ansiWhite":a("ansi-white"),"terminal.ansiBrightBlack":a("ansi-bright-black"),"terminal.ansiBrightRed":a("ansi-bright-red"),"terminal.ansiBrightGreen":a("ansi-bright-green"),"terminal.ansiBrightYellow":a("ansi-bright-yellow"),"terminal.ansiBrightBlue":a("ansi-bright-blue"),"terminal.ansiBrightMagenta":a("ansi-bright-magenta"),"terminal.ansiBrightCyan":a("ansi-bright-cyan"),"terminal.ansiBrightWhite":a("ansi-bright-white")},tokenColors:[{scope:["keyword.operator.accessor","meta.group.braces.round.function.arguments","meta.template.expression","markup.fenced_code meta.embedded.block"],settings:{foreground:a("foreground")}},{scope:"emphasis",settings:{fontStyle:"italic"}},{scope:["strong","markup.heading.markdown","markup.bold.markdown"],settings:{fontStyle:"bold"}},{scope:["markup.italic.markdown"],settings:{fontStyle:"italic"}},{scope:"meta.link.inline.markdown",settings:{fontStyle:"underline",foreground:a("token-link")}},{scope:["string","markup.fenced_code","markup.inline"],settings:{foreground:a("token-string")}},{scope:["comment","string.quoted.docstring.multi"],settings:{foreground:a("token-comment")}},{scope:["constant.numeric","constant.language","constant.other.placeholder","constant.character.format.placeholder","variable.language.this","variable.other.objLine truncated
|
||||||
|
\\ (?:
|
||||||
|
${y0}
|
||||||
|
| [gk]<[^>]*>?
|
||||||
|
| [gk]'[^']*'?
|
||||||
|
| .
|
||||||
|
)
|
||||||
|
| \( (?:
|
||||||
|
\? (?:
|
||||||
|
[:=!>({]
|
||||||
|
| <[=!]
|
||||||
|
| <[^>]*>
|
||||||
|
| '[^']*'
|
||||||
|
| ~\|?
|
||||||
|
| #(?:[^)\\]|\\.?)*
|
||||||
|
| [^:)]*[:)]
|
||||||
|
)?
|
||||||
|
| \*[^\)]*\)?
|
||||||
|
)?
|
||||||
|
| (?:${bs.source})+
|
||||||
|
| ${b0}
|
||||||
|
| .
|
||||||
|
`.replace(/\s+/g,""),"gsu"),Za=new RegExp(Be`
|
||||||
|
\\ (?:
|
||||||
|
${y0}
|
||||||
|
| .
|
||||||
|
)
|
||||||
|
| \[:(?:\^?\p{Alpha}+|\^):\]
|
||||||
|
| ${b0}
|
||||||
|
| &&
|
||||||
|
| .
|
||||||
|
`.replace(/\s+/g,""),"gsu");function op(e,t={}){const n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const r=Sp(n.flags),a=[r.extended],i={captureGroup:n.rules.captureGroup,getCurrentModX(){return a.at(-1)},numOpenGroups:0,popModX(){a.pop()},pushModX(c){a.push(c)},replaceCurrentModX(c){a[a.length-1]=c},singleline:n.rules.singleline};let s=[],o;for(Mr.lastIndex=0;o=Mr.exec(e);){const c=lp(i,e,o[0],Mr.lastIndex);c.tokens?s.push(...c.tokens):c.token&&s.push(c.token),c.lastIndex!==void 0&&(Mr.lastIndex=c.lastIndex)}const l=[];let u=0;s.filter(c=>c.type==="GroupOpen").forEach(c=>{c.kind==="capturing"?c.number=++u:c.raw==="("&&l.push(c)}),u||l.forEach((c,f)=>{c.kind="capturing",c.number=f+1});const h=u||l.length;return{tokens:s.map(c=>c.type==="EscapedNumber"?Tp(c,h):c).flat(),flags:r}}function lp(e,t,n,r){const[a,i]=n;if(n==="["||n==="[^"){const s=up(t,n,r);return{tokens:s.tokens,lastIndex:s.lastIndex}}if(a==="\\"){if("AbBGyYzZ".includes(i))return{token:ho(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:vp(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:w0(n)}}if(i==="K")return{token:x0("keep",n)};if(i==="N"||i==="R")return{token:yn("newline",n,{negate:i==="N"})};if(i==="O")return{token:yn("any",n)};if(i==="X")return{token:yn("text_segment",n)};const s=v0(n,{inCharClass:!1});return Array.isArray(s)?{tokens:s}:{token:s}}if(a==="("){if(i==="*")return{token:_p(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:kp(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:Rn("group",n)};if(n==="(?>")return{token:Rn("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:Rn(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:Rn("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:Rn("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:gp(n)}}if(e.getCurrentModX()){if(n==="#"){const s=t.indexOf(`
|
||||||
|
`,r);return{lastIndex:s===-1?t.length:s}}if(/^\s$/.test(n)){const s=/\s+/y;return s.lastIndex=r,{lastIndex:s.exec(t)?s.lastIndex:r}}}if(n===".")return{token:yn("dot",n)};if(n==="^"||n==="$"){const s=e.singleline?{"^":Be`\A`,$:Be`\Z`}[n]:n;return{token:ho(s,n)}}return n==="|"?{token:mp(n)}:bs.test(n)?{tokens:Ep(n)}:{token:Lt(jn(n),n)}}function up(e,t,n){const r=[po(t[1]==="^",t)];let a=1,i;for(Za.lastIndex=n;i=Za.exec(e);){const s=i[0];if(s[0]==="["&&s[1]!==":")a++,r.push(po(s[1]==="^",s));else if(s==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(Lt(93,s));else if(a--,r.push(hp(s)),!a)break}else{const o=cp(s);Array.isArray(o)?r.push(...o):r.push(o)}}return{tokens:r,lastIndex:Za.lastIndex||e.length}}function cp(e){if(e[0]==="\\")return v0(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!gs.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return yn("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?pp(e):e==="&&"?dp(e):Lt(jn(e),e)}function v0(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return xp(e);if("dDhHsSwW".includes(n))return $p(e);if(e.startsWith(Be`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return Cp(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const r=e.split(/\\x/).slice(1).map(s=>parseInt(s,16)),a=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),i=new TextEncoder;return[...a].map(s=>{const o=[...i.encode(s)].map(l=>`\\x${l.toString(16)}`).join("");return Lt(jn(s),o)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Lt(Ap(e),e);if(fo.has(n))return Lt(fo.get(n),e);if(/\d/.test(n))return fp(t,e);if(e==="\\")throw new Error(Be`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Lt(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function mp(e){return{type:"Alternator",raw:e}}function ho(e,t){return{type:"Assertion",kind:e,raw:t}}function w0(e){return{type:"Backreference",raw:e}}function Lt(e,t){return{type:"Character",value:e,raw:t}}function hp(e){return{type:"CharacterClassClose",raw:e}}function pp(e){return{type:"CharacterClassHyphen",raw:e}}function dp(e){return{type:"CharacterClassIntersector",raw:e}}function po(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function yn(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function x0(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Gn(n.flags),raw:t}}function fp(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function gp(e){return{type:"GroupClose",raw:e}}function Rn(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function bp(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function yp(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function vp(e){return{type:"Subroutine",raw:e}}const wp=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),fo=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function xp(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return Lt(jn(t.toUpperCase())-64,e)}function kp(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??(r="");const a=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),i=bo(n),s=bo(r),o={};if(i&&(o.enable=i),s&&(o.disable=s),e.endsWith(")"))return t.replaceCurrentModX(a),x0("flags",e,{flags:o});if(e.endsWith(":"))return t.pushModX(a),t.numOpenGroups++,Rn("group",e,{...(i||s)&&{flags:o}});throw new Error(`Unexpected flag modifier "${e}"`)}function _p(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:r,args:a}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const i=a?a.split(",").filter(h=>h!=="").map(h=>/^[+-]?\d+$/.test(h)?+h:h):[],[s,o,l]=i,u=wp.has(n)?n.toLowerCase():"custom";switch(u){case"fail":case"mismatch":case"skip":if(i.length>0)throw new Error(`Named callout arguments not allowed "${i}"`);break;case"error":if(i.length>1)throw new Error(`Named callout allows only one argument "${i}"`);if(typeof s=="string")throw new Error(`Named callout argument must be a number "${s}"`);break;case"max":if(!i.length||i.length>2)throw new Error(`Named callout must have one or two arguments "${i}"`);if(typeof s=="string"&&!/^[A-Za-z_]\w*$/.test(s))throw new Error(`Named callout argument one must be a tag or number "${s}"`);if(i.length===2&&(typeof o=="number"||!/^[<>X]$/.test(o)))throw new Error(`Named callout optional argLine truncated
|
||||||
|
\\(?: \d+
|
||||||
|
| c[A-Za-z]
|
||||||
|
| [gk]<[^>]+>
|
||||||
|
| [pPu]\{[^\}]+\}
|
||||||
|
| u[A-Fa-f\d]{4}
|
||||||
|
| x[A-Fa-f\d]{2}
|
||||||
|
)
|
||||||
|
| \((?: \? (?: [:=!>]
|
||||||
|
| <(?:[=!]|[^>]+>)
|
||||||
|
| [A-Za-z\-]+:
|
||||||
|
| \(DEFINE\)
|
||||||
|
))?
|
||||||
|
| (?<qBase>${E0})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
||||||
|
| \\?.
|
||||||
|
`.replace(/\s+/g,""),"gsu");function nd(e){if(!new RegExp(`${E0}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,a="",i=0,s;for(Ka.lastIndex=0;s=Ka.exec(e);){const{0:o,index:l,groups:{qBase:u,qMod:h,invalidQ:c}}=s;if(o==="[")i||(r=l),i++;else if(o==="]")i?i--:r=null;else if(!i)if(h==="+"&&a&&!a.startsWith("(")){if(c)throw new Error(`Invalid quantifier "${o}"`);let f=-1;if(/^\{\d+\}$/.test(u))e=Qp(e,l+u.length,h,"");else{if(a===")"||a==="]"){const d=a===")"?n:r;if(d===null)throw new Error(`Invalid unmatched "${a}"`);e=`${e.slice(0,d)}(?>${e.slice(d,l)}${u})${e.slice(l+o.length)}`}else e=`${e.slice(0,l-a.length)}(?>${a}${u})${e.slice(l+o.length)}`;f+=4}Ka.lastIndex+=f}else o[0]==="("?t.push(l):o===")"&&(n=t.length?t.pop():null);a=o}return{pattern:e}}const ct=String.raw,rd=ct`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Fi=ct`\(\?R=(?<rDepth>[^\)]+)\)|${rd}`,xa=ct`\(\?<(?![=!])(?<captureName>[^>]+)>`,M0=ct`${xa}|(?<unnamed>\()(?!\?)`,mn=new RegExp(ct`${xa}|${Fi}|\(\?|\\?.`,"gsu"),Qa="Cannot use multiple overlapping recursions";function ad(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let a=(t==null?void 0:t.captureTransfers)??new Map;if(!new RegExp(Fi,"su").test(e))return{pattern:e,captureTransfers:a,hiddenCaptures:n};if(r==="plugin"&&zr(e,ct`\(\?\(DEFINE\)`,mt.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const i=[],s=zr(e,ct`\\[1-9]`,mt.DEFAULT),o=new Map,l=[];let u=!1,h=0,c=0,f;for(mn.lastIndex=0;f=mn.exec(e);){const{0:d,groups:{captureName:b,rDepth:w,gRNameOrNum:A,gRDepth:k}}=f;if(d==="[")h++;else if(h)d==="]"&&h--;else if(w){if(_o(w),u)throw new Error(Qa);if(s)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const C=e.slice(0,f.index),T=e.slice(mn.lastIndex);if(zr(T,Fi,mt.DEFAULT))throw new Error(Qa);const I=+w-1;e=$o(C,T,I,!1,n,i,c),a=So(a,C,I,i.length,0,c);break}else if(A){_o(k);let C=!1;for(const j of l)if(j.name===A||j.num===+A){if(C=!0,j.hasRecursedWithin)throw new Error(Qa);break}if(!C)throw new Error(ct`Recursive \g cannot be used outside the referenced group "${r==="external"?A:ct`\g<${A}&R=${k}>`}"`);const T=o.get(A),I=ed(e,T);if(s&&zr(I,ct`${xa}|\((?!\?)`,mt.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const N=e.slice(T,f.index),E=I.slice(N.length+d.length),L=i.length,V=+k-1,q=$o(N,E,V,!0,n,i,c);a=So(a,N,V,i.length-L,L,c);const M=e.slice(0,T),U=e.slice(T+I.length);e=`${M}${q}${U}`,mn.lastIndex+=q.length-d.length-N.length-E.length,l.forEach(j=>j.hasRecursedWithin=!0),u=!0}else if(b)c++,o.set(String(c),mn.lastIndex),o.set(b,mn.lastIndex),l.push({num:c,name:b});else if(d[0]==="("){const C=d==="(";C&&(c++,o.set(String(c),mn.lastIndex)),l.push(C?{num:c}:{})}else d===")"&&l.pop()}return n.push(...i),{pattern:e,captureTransfers:a,hiddenCaptures:n}}function _o(e){const t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function $o(e,t,n,r,a,i,s){const o=new Set;r&&T0(e+t,xa,({groups:{captureName:u}})=>{o.add(u)},mt.DEFAULT);const l=[n,r?o:null,a,i,s];return`${e}${Co(`(?:${e}`,"forward",...l)}(?:)${Co(`${t})`,"backward",...l)}${t}`}function Co(e,t,n,r,a,i,s){const l=h=>t==="forward"?h+2:n-h+2-1;let u="";for(let h=0;h<n;h++){const c=l(h);u+=ys(e,ct`${M0}|\\k<(?<backref>[^>]+)>`,({0:f,groups:{captureName:d,unnamed:b,backref:w}})=>{if(w&&r&&!r.has(w))return f;const A=`_$${c}`;if(b||d){const k=s+i.length+1;return i.push(k),id(a,k),b?f:`(?<${d}${A}>`}return ct`\k<${w}${A}>`},mt.DEFAULT)}return u}function id(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function So(e,t,n,r,a,i){if(e.size&&r){let s=0;T0(t,M0,()=>s++,mt.DEFAULT);const o=i-s+a,l=new Map;return e.forEach((u,h)=>{const c=(r-s*n)/n,f=s*n,d=h>o+s?h+r:h,b=[];for(const w of u)if(w<=o)b.push(w);else if(w>o+s+c)b.push(w+r);else if(w<=o+s)for(let A=0;A<=n;A++)b.push(w+s*A);else for(let A=0;A<=n;A++)b.push(w+f+c*A);l.set(d,b)}),l}return e}var Ie=String.fromCodePoint,ne=String.raw,yt={},ka=globalThis.RegExp;yt.flagGroups=(()=>{try{new ka("(?i:)")}catch{return!1}return!0})();yt.unicodeSets=(()=>{try{new ka("[[]]","v")}catch{return!1}return!0})();yt.bugFlagVLiteralHyphenIsRange=yt.unicodeSets?(()=>{try{new ka(ne`[\d\-a]`,"v")}catch{return!0}return!1})():!1;yt.bugNestedClassIgnoresNegation=yt.unicodeSets&&new ka("[[^a]]","v").test("a");function sa(e,{enable:t,disable:n}){return{dotAll:!(n!=null&&n.dotAll)&&!!(t!=null&&t.dotAll||e.dotAll),ignoreCase:!(n!=null&&n.ignoreCase)&&!!(t!=null&&t.ignoreCase||e.ignoreCase)}}function cr(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Pi(e,t){return Ao[e]>=Ao[t]}function sd(e,t){if(e==null)throw new Error(t??"Value expected");return e}var Ao={ES2025:2025,ES2024:2024,ES2018:2018},od={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function I0(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("ULine truncated
|
||||||
|
Cc Control cntrl
|
||||||
|
Cf Format
|
||||||
|
Cn Unassigned
|
||||||
|
Co Private_Use
|
||||||
|
Cs Surrogate
|
||||||
|
L Letter
|
||||||
|
LC Cased_Letter
|
||||||
|
Ll Lowercase_Letter
|
||||||
|
Lm Modifier_Letter
|
||||||
|
Lo Other_Letter
|
||||||
|
Lt Titlecase_Letter
|
||||||
|
Lu Uppercase_Letter
|
||||||
|
M Mark Combining_Mark
|
||||||
|
Mc Spacing_Mark
|
||||||
|
Me Enclosing_Mark
|
||||||
|
Mn Nonspacing_Mark
|
||||||
|
N Number
|
||||||
|
Nd Decimal_Number digit
|
||||||
|
Nl Letter_Number
|
||||||
|
No Other_Number
|
||||||
|
P Punctuation punct
|
||||||
|
Pc Connector_Punctuation
|
||||||
|
Pd Dash_Punctuation
|
||||||
|
Pe Close_Punctuation
|
||||||
|
Pf Final_Punctuation
|
||||||
|
Pi Initial_Punctuation
|
||||||
|
Po Other_Punctuation
|
||||||
|
Ps Open_Punctuation
|
||||||
|
S Symbol
|
||||||
|
Sc Currency_Symbol
|
||||||
|
Sk Modifier_Symbol
|
||||||
|
Sm Math_Symbol
|
||||||
|
So Other_Symbol
|
||||||
|
Z Separator
|
||||||
|
Zl Line_Separator
|
||||||
|
Zp Paragraph_Separator
|
||||||
|
Zs Space_Separator
|
||||||
|
ASCII
|
||||||
|
ASCII_Hex_Digit AHex
|
||||||
|
Alphabetic Alpha
|
||||||
|
Any
|
||||||
|
Assigned
|
||||||
|
Bidi_Control Bidi_C
|
||||||
|
Bidi_Mirrored Bidi_M
|
||||||
|
Case_Ignorable CI
|
||||||
|
Cased
|
||||||
|
Changes_When_Casefolded CWCF
|
||||||
|
Changes_When_Casemapped CWCM
|
||||||
|
Changes_When_Lowercased CWL
|
||||||
|
Changes_When_NFKC_Casefolded CWKCF
|
||||||
|
Changes_When_Titlecased CWT
|
||||||
|
Changes_When_Uppercased CWU
|
||||||
|
Dash
|
||||||
|
Default_Ignorable_Code_Point DI
|
||||||
|
Deprecated Dep
|
||||||
|
Diacritic Dia
|
||||||
|
Emoji
|
||||||
|
Emoji_Component EComp
|
||||||
|
Emoji_Modifier EMod
|
||||||
|
Emoji_Modifier_Base EBase
|
||||||
|
Emoji_Presentation EPres
|
||||||
|
Extended_Pictographic ExtPict
|
||||||
|
Extender Ext
|
||||||
|
Grapheme_Base Gr_Base
|
||||||
|
Grapheme_Extend Gr_Ext
|
||||||
|
Hex_Digit Hex
|
||||||
|
IDS_Binary_Operator IDSB
|
||||||
|
IDS_Trinary_Operator IDST
|
||||||
|
ID_Continue IDC
|
||||||
|
ID_Start IDS
|
||||||
|
Ideographic Ideo
|
||||||
|
Join_Control Join_C
|
||||||
|
Logical_Order_Exception LOE
|
||||||
|
Lowercase Lower
|
||||||
|
Math
|
||||||
|
Noncharacter_Code_Point NChar
|
||||||
|
Pattern_Syntax Pat_Syn
|
||||||
|
Pattern_White_Space Pat_WS
|
||||||
|
Quotation_Mark QMark
|
||||||
|
Radical
|
||||||
|
Regional_Indicator RI
|
||||||
|
Sentence_Terminal STerm
|
||||||
|
Soft_Dotted SD
|
||||||
|
Terminal_Punctuation Term
|
||||||
|
Unified_Ideograph UIdeo
|
||||||
|
Uppercase Upper
|
||||||
|
Variation_Selector VS
|
||||||
|
White_Space space
|
||||||
|
XID_Continue XIDC
|
||||||
|
XID_Start XIDS`.split(/\s/).map(e=>[wa(e),e])),cd=new Map([["s",Ie(383)],[Ie(383),"s"]]),md=new Map([[Ie(223),Ie(7838)],[Ie(107),Ie(8490)],[Ie(229),Ie(8491)],[Ie(969),Ie(8486)]]),hd=new Map([Vt(453),Vt(456),Vt(459),Vt(498),...Ja(8072,8079),...Ja(8088,8095),...Ja(8104,8111),Vt(8124),Vt(8140),Vt(8188)]),pd=new Map([["alnum",ne`[\p{Alpha}\p{Nd}]`],["alpha",ne`\p{Alpha}`],["ascii",ne`\p{ASCII}`],["blank",ne`[\p{Zs}\t]`],["cntrl",ne`\p{Cc}`],["digit",ne`\p{Nd}`],["graph",ne`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",ne`\p{Lower}`],["print",ne`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",ne`[\p{P}\p{S}]`],["space",ne`\p{space}`],["upper",ne`\p{Upper}`],["word",ne`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",ne`\p{AHex}`]]);function dd(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Vt(e){const t=Ie(e);return[t.toLowerCase(),t]}function Ja(e,t){return dd(e,t).map(n=>Vt(n))}var R0=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function fd(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};N0(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Pi(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};rr(e,gd,r);const a={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},i={currentFlags:a,prevFlags:null,globalFlags:a,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};rr(e,bd,i);const s={groupsByName:i.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:i.reffedNodesByReferencer};return rr(e,yd,s),e._originMap=i.groupOriginByCopy,e._strategy=r.strategy,e}var gd={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:a}=e;if(a==="repeater"){const i=bt();i.body[0].body.push(fn({negate:!0,body:r}),Nn("Any"));const s=bt();s.body[0].body.push(C0("greedy",0,1/0,i)),n(_e(s,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){const a=e.body.filter(i=>i.kind==="flags");for(let i=n+1;i<t.body.length;i++){const s=t.body[i];cr(r,s,[]).push(...a)}},exit({node:e},{flagDirectivesByAlt:t}){var n;if((n=t.get(e))!=null&&n.length){const r=D0(t.get(e));if(r){const a=bt({flags:r});a.body[0].body=e.body,e.body=[_e(a,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:a,remove:i,replaceWith:s},o){const{kind:l,negate:u}=e,{asciiWordBoundaries:h,avoidSubclass:c,supportedGNodes:f,wordIsAscii:d}=o;if(l==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${u?"Y":"y"}"`);if(l==="line_end")s(_e(fn({body:[_n({body:[Bi("string_end")]}),_n({body:[va(10)]})]}),t));else if(l==="line_start")s(_e(zt(ne`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(l==="search_start")if(f.has(e))a.flags.sticky=!0,i();else{const b=r[n-1];if(b&&$d(b))s(_e(fn({negate:!0}),t));else{if(c)throw new Error(ne`Uses "\G" in a way that requires a subclass`);s(Xt(Bi("string_start"),t)),o.strategy="clip_search"}}else if(!(l==="string_end"||l==="string_start"))if(l==="string_end_newline")s(_e(zt(ne`(?=\n?\z)`),t));else if(l==="word_boundary"){if(!d&&!h){const b=`(?:(?<=${It})(?!${It})|(?<!${It})(?=${It}))`,w=`(?:(?<=${It})(?=${It})|(?<!${It})(?!${It}))`;s(_e(zt(u?w:b),t))}}else throw new Error(`Unexpected assertion kind "${l}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!ti(n)&&(n=ei(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!ti(r)&&(r=ei(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const r=Hr({body:[e]});n(_e(r,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:a,digitIsAscii:i,spaceIsAscii:s,wordIsAscii:o}){const{kind:l,negate:u,value:h}=e;if(i&&(l==="digit"||h==="digit")){n(Xt(Li("digit",{negate:u}),t));return}if(s&&(l==="space"||h==="space")){n(_e(ni(zt(ld),u),t));return}if(o&&(l==="word"||h==="word")){n(Xt(Li("word",{negate:u}),t));return}if(l==="any")n(Xt(Nn("Any"),t));else if(l==="digit")n(Xt(Nn("Nd",{negate:u}),t));else if(l!=="dot")if(l==="text_segment"){if(r==="strict")throw new Error(ne`Use of "\X" requires non-strict accuracy`);const c="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",f=ne`\p{RI}{2}|${c}(?:\u200D${c})*`;n(_e(zt(ne`(?>\r\n|${a?ne`\p{RGI_Emoji}`:f}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(l==="hex")n(Xt(Nn("AHex",{negate:u}),t));else if(l==="newline")n(_e(zt(u?`[^
|
||||||
|
]`:`(?>\r
|
||||||
|
?|[
|
||||||
|
\v\f
\u2028\u2029])`),t));else if(l==="posix")if(!a&&(h==="graph"||h==="print")){if(r==="strict")throw new Error(`POSIX class "${h}" requires min target ES2024 or non-strict accuracy`);let c={graph:"!-~",print:" -~"}[h];u&&(c=`\0-${Ie(c.codePointAt(0)-1)}${Ie(c.codePointAt(2)+1)}-`),n(_e(zt(`[${c}]`),t))}else n(_e(ni(zt(pd.get(h)),u),t));else if(l==="property")vs.has(wa(h))||(e.key="sc");else if(l==="space")n(Xt(Nn("space",{negate:u}),t));else if(l==="word")n(_e(ni(zt(It),u),t));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:a,removeAllPrevSiblings:i,removeAllNextSiblings:s}){const{kind:o,flags:l}=e;if(o==="flags")if(!l.enable&&!l.disable)r();else{const u=bt({flags:l});u.body[0].body=s(),a(_e(u,t),{traverse:!0})}else if(o==="keep"){const u=n.body[0],c=n.body.length===1&&k0(u,{type:"Group"})&&u.body[0].body.length===1?u.body[0]:n;if(t.parent!==c||c.body.length>1)throw new Error(ne`Uses "\K" in a way that's unsupported`);const f=fn({behind:!0});f.body[0].body=i(),a(_e(f,t))}else throw new Error(`Unexpected directive kind "${o}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t!=null&&t.extended&&delete t.extended,n!=null&&n.extended&&delete n.extended,t!=null&&t.dotAll&&(n!=null&&n.dotAll)&&delete t.dotAll,t!=null&&t.ignoreCase&&(n!=null&&n.ignoreCase)&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:r}=e;if(r==="fail")n(_e(fn({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=bt();t.body[0].body.push(e.body),e.body=_e(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,a=!1;for(const i of e.body)if(i.body.length===1&&i.body[0].kind==="search_start")i.body.pop();else{const s=F0(i.body);s?(r=!0,Array.isArray(s)?n.push(...s):n.push(s)):a=!0}r&&!a&&n.forEach(i=>t.add(i))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(ne`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!ti(n)&&(n=ei(n,t),e.ref=n)}},bd={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:a}=e;r||n.set(e,[...t.get(a).map(({node:i})=>i)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:a,groupsByName:i,multiplexCapturesToLeftByRef:s,openRefs:o,reffedNodesByReferencer:l}){const u=a.get(e);if(u&&o.has(e.number)){const c=Xt(To(e.number),t);l.set(c,o.get(e.number)),n(c);return}o.set(e.number,e),s.set(e.number,[]),e.name&&cr(s,e.name,[]);const h=s.get(e.name??e.number);for(let c=0;c<h.length;c++){const f=h[c];if(u===f.node||u&&u===f.origin||e===f.origin){h.splice(c,1);break}}if(s.get(e.number).push({node:e,origin:u}),e.name&&s.get(e.name).push({node:e,origin:u}),e.name){const c=cr(i,e.name,new Map);let f=!1;if(u)f=!0;else for(const d of c.values())if(!d.hasDuplicateNameToRemove){f=!0;break}i.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:f})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=sa(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){const{isRecursive:a,ref:i}=e;if(a){let h=t;for(;(h=h.parent)&&!(h.type==="CapturingGroup"&&(h.name===i||h.number===i)););r.reffedNodesByReferencer.set(e,h);return}const s=r.subroutineRefMap.get(i),o=i===0,l=o?To(0):B0(s,r.groupOriginByCopy,null);let u=l;if(!o){const h=D0(xd(s,f=>f.type==="Group"&&!!f.flags)),c=h?sa(r.globalFlags,h):r.globalFlags;vd(c,r.currentFlags)||(u=bt({flags:kd(c)}),u.body[0].body.push(l))}n(_e(u,t),{traverse:!o})}},yd={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const i=r.reffedNodesByReferencer.get(e).filter(s=>wd(s,e));if(!i.length)n(_e(fn({negate:!0}),t));else if(i.length>1){const s=bt({atomic:!0,body:i.reverse().map(o=>_n({body:[Di(o.number)]}))});n(_e(s,t))}else e.ref=i[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const n=Math.max(t.highestOrphanBaLine truncated
|
||||||
|
`;break}case-3:{s=`\r
|
||||||
|
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&a)continue;s=" ";break}default:s=String.fromCharCode(i)}a=i===-2,r.push(s)}return r.join("")}function qf(e){const r={constructs:j0([Lf,...(e||{}).extensions||[]]),content:a(t1),defined:[],document:a(r1),flow:a(kf),lazy:{},string:a(Cf),text:a(Sf)};return r;function a(i){return s;function s(o){return Ff(r,i,o)}}}function jf(e){for(;!V0(e););return e}const qo=/[\0\t\n\r]/g;function Gf(){let e=1,t="",n=!0,r;return a;function a(i,s,o){const l=[];let u,h,c,f,d;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),c=0,t="",n&&(i.charCodeAt(0)===65279&&c++,n=void 0);c<i.length;){if(qo.lastIndex=c,u=qo.exec(i),f=u&&u.index!==void 0?u.index:i.length,d=i.charCodeAt(f),!u){t=i.slice(c);break}if(d===10&&c===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),c<f&&(l.push(i.slice(c,f)),e+=f-c),d){case 0:{l.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,l.push(-2);e++<h;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}c=f+1}return o&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Hf=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Uf(e){return e.replace(Hf,Wf)}function Wf(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),i=a===120||a===88;return G0(n.slice(i?2:1),i?16:10)}return xs(n)||e}function Wr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?jo(e.position):"start"in e||"end"in e?jo(e):"line"in e||"column"in e?Gi(e):""}function Gi(e){return Go(e&&e.line)+":"+Go(e&&e.column)}function jo(e){return Gi(e&&e.start)+"-"+Gi(e&&e.end)}function Go(e){return e&&typeof e=="number"?e:1}const J0={}.hasOwnProperty;function E5(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Vf(n)(jf(qf(n).document().write(Gf()(e,t,!0))))}function Vf(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Xn),autolinkProtocol:q,autolinkEmail:q,atxHeading:i(xr),blockQuote:i(Tt),characterEscape:q,characterReference:q,codeFenced:i(on),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(on,s),codeText:i(wr,s),codeTextData:q,data:q,codeFlowValue:q,definition:i(An),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(Tn),hardBreakEscape:i(kr),hardBreakTrailing:i(kr),htmlFlow:i(_r,s),htmlFlowData:q,htmlText:i(_r,s),htmlTextData:q,image:i($r),label:s,link:i(Xn),listItem:i(Pa),listItemValue:f,listOrdered:i(ln,c),listUnordered:i(ln),paragraph:i(Oa),reference:$,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(xr),strong:i(Yn),thematicBreak:i(Sr)},exit:{atxHeading:l(),atxHeadingSequence:N,autolink:l(),autolinkEmail:Qe,autolinkProtocol:dt,blockQuote:l(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:wt,characterReferenceMarkerNumeric:wt,characterReferenceValue:Ee,characterReference:st,codeFenced:l(A),codeFencedFence:w,codeFencedFenceInfo:d,codeFencedFenceMeta:b,codeFlowValue:M,codeIndented:l(k),codeText:l(Z),codeTextData:M,data:M,definition:l(),definitionDestinationString:I,definitionLabelString:C,definitionTitleString:T,emphasis:l(),hardBreakEscape:l(j),hardBreakTrailing:l(j),htmlFlow:l(le),htmlFlowData:M,htmlText:l(se),htmlTextData:M,image:l(he),label:Ke,labelText:Ne,lineEnding:U,link:l(ue),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:De,resourceDestinationString:_,resourceTitleString:$e,resource:qe,setextHeading:l(V),setextHeadingLineSequence:L,setextHeadingText:E,strong:l(),thematicBreak:l()}};eu(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(R){let H={type:"root",children:[]};const Q={stack:[H],tokenStack:[],config:t,enter:o,exit:u,buffer:s,resume:h,data:n},ae=[];let pe=-1;for(;++pe<R.length;)if(R[pe][1].type==="listOrdered"||R[pe][1].type==="listUnordered")if(R[pe][0]==="enter")ae.push(pe);else{const ft=ae.pop();pe=a(R,ft,pe)}for(pe=-1;++pe<R.length;){const ft=t[R[pe][0]];J0.call(ft,R[pe][1].type)&&ft[R[pe][1].type].call(Object.assign({sliceSerialize:R[pe][2].sliceSerialize},Q),R[pe][1])}if(Q.tokenStack.length>0){const ft=Q.tokenStack[Q.tokenStack.length-1];(ft[1]||Ho).call(Q,void 0,ft[0])}for(H.position={start:Ht(R.length>0?R[0][1].start:{line:1,column:1,offset:0}),end:Ht(R.length>0?R[R.length-2][1].end:{line:1,column:1,offset:0})},pe=-1;++pe<t.transforms.length;)H=t.transforms[pe](H)||H;return H}function a(R,H,Q){let ae=H-1,pe=-1,ft=!1,un,Et,Zn,Kn;for(;++ae<=Q;){const Je=R[ae];switch(Je[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Je[0]==="enter"?pe++:pe--,Kn=void 0;break}case"lineEndingBlank":{Je[0]==="enter"&&(un&&!Kn&&!pe&&!Zn&&(Zn=ae),Kn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Kn=void 0}if(!pe&&Je[0]==="enter"&&Je[1].type==="listItemPrefix"||pe===-1&&Je[0]==="exit"&&(Je[1].type==="listUnordered"||Je[1].type==="listOrdered")){if(un){let En=ae;for(Et=void 0;En--;){const MtLine truncated
|
||||||
|
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
||||||
|
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
||||||
|
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
|
||||||
|
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
|
||||||
|
c69,-144,104.5,-217.7,106.5,-221
|
||||||
|
l`+t/2.075+" -"+t+`
|
||||||
|
c5.3,-9.3,12,-14,20,-14
|
||||||
|
H400000v`+(40+t)+`H845.2724
|
||||||
|
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
||||||
|
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
||||||
|
M`+(834+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},O4=function(t,n){return"M263,"+(601+t+n)+`c0.7,0,18,39.7,52,119
|
||||||
|
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
||||||
|
c340,-704.7,510.7,-1060.3,512,-1067
|
||||||
|
l`+t/2.084+" -"+t+`
|
||||||
|
c4.7,-7.3,11,-11,19,-11
|
||||||
|
H40000v`+(40+t)+`H1012.3
|
||||||
|
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
|
||||||
|
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
|
||||||
|
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
||||||
|
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
||||||
|
M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},q4=function(t,n){return"M983 "+(10+t+n)+`
|
||||||
|
l`+t/3.13+" -"+t+`
|
||||||
|
c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+`
|
||||||
|
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
|
||||||
|
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
|
||||||
|
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
||||||
|
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
||||||
|
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
||||||
|
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
||||||
|
M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},j4=function(t,n){return"M424,"+(2398+t+n)+`
|
||||||
|
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
||||||
|
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
|
||||||
|
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
||||||
|
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
|
||||||
|
l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000
|
||||||
|
v`+(40+t)+`H1014.6
|
||||||
|
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
||||||
|
c-2,6,-10,9,-24,9
|
||||||
|
c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+n+`
|
||||||
|
h400000v`+(40+t)+"h-400000z"},G4=function(t,n){return"M473,"+(2713+t+n)+`
|
||||||
|
c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+`
|
||||||
|
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7
|
||||||
|
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
||||||
|
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
|
||||||
|
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
|
||||||
|
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
||||||
|
606zM`+(1001+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},H4=function(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"},U4=function(t,n,r){var a=r-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+`
|
||||||
|
H742v`+a+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
|
||||||
|
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
||||||
|
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
||||||
|
219 661 l218 661zM702 `+n+"H400000v"+(40+t)+"H742z"},W4=function(t,n,r){n=1e3*n;var a="";switch(t){case"sqrtMain":a=P4(n,zn);break;case"sqrtSize1":a=O4(n,zn);break;case"sqrtSize2":a=q4(n,zn);break;case"sqrtSize3":a=j4(n,zn);break;case"sqrtSize4":a=G4(n,zn);break;case"sqrtTall":a=U4(n,zn,r)}return a},V4=function(t,n){switch(t){case"⎜":return Me("M291 0 H417 V"+n+" H291z");case"∣":return Me("M145 0 H188 V"+n+" H145z");case"∥":return Me("M145 0 H188 V"+n+" H145z")+Me("M367 0 H410 V"+n+" H367z");case"⎟":return Me("M457 0 H583 V"+n+" H457z");case"⎢":return Me("M319 0 H403 V"+n+" H319z");case"⎥":return Me("M263 0 H347 V"+n+" H263z");case"⎪":return Me("M384 0 H504 V"+n+" H384z");case"⏐":return Me("M312 0 H355 V"+n+" H312z");case"‖":return Me("M257 0 H300 V"+n+" H257z")+Me("M478 0 H521 V"+n+" H478z");default:return""}},Zo={doubleleftarrow:`M262 157
|
||||||
|
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
||||||
|
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
||||||
|
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
||||||
|
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
|
||||||
|
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
|
||||||
|
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
||||||
|
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
||||||
|
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
||||||
|
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
|
||||||
|
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
|
||||||
|
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
|
||||||
|
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
|
||||||
|
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
||||||
|
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
|
||||||
|
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
||||||
|
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
|
||||||
|
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
|
||||||
|
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
|
||||||
|
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
|
||||||
|
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
|
||||||
|
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
||||||
|
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
||||||
|
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
|
||||||
|
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
|
||||||
|
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
||||||
|
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
|
||||||
|
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
|
||||||
|
435 0h399565z`,leftgroupunder:`M400000 262
|
||||||
|
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
|
||||||
|
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
||||||
|
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
|
||||||
|
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
|
||||||
|
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
|
||||||
|
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
|
||||||
|
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
|
||||||
|
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
||||||
|
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
||||||
|
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
||||||
|
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
|
||||||
|
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
|
||||||
|
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
|
||||||
|
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
||||||
|
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
|
||||||
|
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
|
||||||
|
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
|
||||||
|
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Me("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Me("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Me("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Me("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
||||||
|
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
||||||
|
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
|
||||||
|
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Me("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334
|
||||||
|
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
|
||||||
|
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
||||||
|
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
|
||||||
|
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
||||||
|
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
|
||||||
|
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
||||||
|
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
|
||||||
|
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
|
||||||
|
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
||||||
|
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
|
||||||
|
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
|
||||||
|
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
||||||
|
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
||||||
|
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
|
||||||
|
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
||||||
|
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
|
||||||
|
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
|
||||||
|
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
||||||
|
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
||||||
|
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
|
||||||
|
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
|
||||||
|
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
|
||||||
|
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
|
||||||
|
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
||||||
|
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
||||||
|
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
||||||
|
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
|
||||||
|
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
|
||||||
|
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
|
||||||
|
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
||||||
|
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
|
||||||
|
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
|
||||||
|
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
|
||||||
|
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
|
||||||
|
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
|
||||||
|
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
|
||||||
|
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
|
||||||
|
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
|
||||||
|
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
|
||||||
|
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
|
||||||
|
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
|
||||||
|
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
|
||||||
|
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
|
||||||
|
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
|
||||||
|
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
||||||
|
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
|
||||||
|
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
|
||||||
|
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
|
||||||
|
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:Me("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Me("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Me("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
||||||
|
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
||||||
|
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
|
||||||
|
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
||||||
|
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
|
||||||
|
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
||||||
|
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
||||||
|
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
||||||
|
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
|
||||||
|
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
|
||||||
|
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
|
||||||
|
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
||||||
|
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
||||||
|
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
|
||||||
|
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
|
||||||
|
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
|
||||||
|
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
||||||
|
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
||||||
|
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
|
||||||
|
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
||||||
|
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
|
||||||
|
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
|
||||||
|
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
||||||
|
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
||||||
|
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
||||||
|
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
||||||
|
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
||||||
|
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
||||||
|
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
||||||
|
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
|
||||||
|
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
||||||
|
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
|
||||||
|
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
|
||||||
|
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
||||||
|
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
||||||
|
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
|
||||||
|
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
|
||||||
|
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
|
||||||
|
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
|
||||||
|
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
|
||||||
|
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
||||||
|
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
||||||
|
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
||||||
|
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
|
||||||
|
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
||||||
|
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
|
||||||
|
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
|
||||||
|
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
|
||||||
|
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
|
||||||
|
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
||||||
|
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
||||||
|
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
|
||||||
|
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
|
||||||
|
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
|
||||||
|
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
||||||
|
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
||||||
|
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
||||||
|
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
||||||
|
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
|
||||||
|
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
||||||
|
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
||||||
|
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
||||||
|
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
||||||
|
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
||||||
|
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
||||||
|
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
||||||
|
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
|
||||||
|
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
|
||||||
|
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
||||||
|
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
|
||||||
|
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
||||||
|
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
||||||
|
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
||||||
|
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},X4=function(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 v84 h347 v-84
|
||||||
|
H403z M403 1759 V0 H319 V1759 v`+n+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z
|
||||||
|
M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
|
||||||
|
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
||||||
|
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
|
||||||
|
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
||||||
|
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z
|
||||||
|
M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15
|
||||||
|
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
||||||
|
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z
|
||||||
|
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z
|
||||||
|
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z
|
||||||
|
M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z
|
||||||
|
M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
|
||||||
|
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
|
||||||
|
-36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
|
||||||
|
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
|
||||||
|
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
|
||||||
|
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
|
||||||
|
l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
|
||||||
|
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
|
||||||
|
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
|
||||||
|
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+`
|
||||||
|
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
|
||||||
|
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
|
||||||
|
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
|
||||||
|
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
||||||
|
l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
||||||
|
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function Y4(e){return"toText"in e}class Hn{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t}toMarkup(){for(var t="",n=0;n<this.children.length;n++)t+=this.children[n].toMarkup();return t}toText(){return this.children.map(t=>{if(Y4(t))return t.toText();throw new Error("Expected MathDomNode with toText, got "+t.constructor.name)}).join("")}}var Vi={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},Z4={ex:!0,em:!0,mu:!0},hu=function(t){return typeof t!="string"&&(t=t.unit),t in Vi||t in Z4||t==="ex"},xe=function(t,n){var r;if(t.unit in Vi)r=Vi[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")r=n.fontMetrics().cssEmPerMu;else{var a;if(n.style.isTight()?a=n.havingStyle(n.style.text()):a=n,t.unit==="ex")r=a.fontMetrics().xHeight;else if(t.unit==="em")r=a.fontMetrics().quad;else throw new P("Invalid unit: '"+t.unit+"'");a!==n&&(r*=a.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*r,n.maxSize)},G=function(t){return+t.toFixed(4)+"em"},en=function(t){return t.filter(n=>n).join(" ")},As=function(t){var n="";for(var r of Object.keys(t)){var a=t[r];a!==void 0&&(n+=$4(r)+":"+a+";")}return n},pu=function(t,n,r){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},n){n.style.isTight()&&this.classes.push("mtight");var a=n.getColor();a&&(this.style.color=a)}},du=function(t){var n=document.createElement(t);n.className=en(this.classes),Object.assign(n.style,this.style);for(var r of Object.keys(this.attributes))n.setAttribute(r,this.attributes[r]);for(var a=0;a<this.children.length;a++)n.appendChild(this.children[a].toNode());return n},K4=/[\s"'>/=\x00-\x1f]/,fu=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+Oe(en(this.classes))+'"');var r=As(this.style);r&&(n+=' style="'+Oe(r)+'"');for(var a of Object.keys(this.attributes)){if(K4.test(a))throw new P("Invalid attribute name '"+a+"'");n+=" "+a+'="'+Oe(this.attributes[a])+'"'}n+=">";for(var i=0;i<this.children.length;i++)n+=this.children[i].toMarkup();return n+="</"+t+">",n};class Un{constructor(t,n,r,a){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,pu.call(this,t,r,a),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return du.call(this,"span")}toMarkup(){return fu.call(this,"span")}}class Sa{constructor(t,n,r,a){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,pu.call(this,n,a),this.children=r||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return du.call(this,"a")}toMarkup(){return fu.call(this,"a")}}class Q4{constructor(t,n,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");return t.src=this.src,t.alt=this.alt,t.className="mord",Object.assign(t.style,this.style),t}toMarkup(){var t='<img src="'+Oe(this.src)+'"'+(' alt="'+Oe(this.alt)+'"'),n=As(this.style);return n&&(t+=' style="'+Oe(n)+'"'),t+="'/>",t}}var J4={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class rt{constructor(t,n,r,a,i,s,o,l){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=t,this.height=n||0,this.depth=r||0,this.italic=a||0,this.skew=i||0,this.width=s||0,this.classes=o||[],this.style=l||{},this.maxFontSize=0;var u=F4(this.text.charCodeAt(0));u&&this.classes.push(u+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=J4[this.text])}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createTextNode(this.text),n=null;return this.italic>0&&(n=document.createElement("span"),n.style.marginRight=G(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=en(this.classes)),Object.keys(this.style).length>0&&(n=n||document.createElement("span"),Object.assign(n.style,this.style)),n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="<span";this.classes.length&&(t=!0,n+=' class="',n+=Oe(enLine truncated
|
||||||
|
`+E+" children.");for(var q=0;q<E;q++){var M=new tn(C[q]),U=new Pt([M],{width:"400em",height:G(N),viewBox:"0 0 "+o+" "+I,preserveAspectRatio:V[q]+" slice"}),j=nn([L[q]],[U],n);if(E===1)return{span:j,minWidth:T,height:N};j.style.height=G(N),A.push(j)}return{span:D(["stretchy"],A,n),minWidth:T,height:N}}}var{span:a,minWidth:i,height:s}=r();return a.height=s,a.style.height=G(s),i>0&&(a.style.minWidth=G(i)),a},A2=function(t,n,r,a,i){var s,o=t.height+t.depth+r+a;if(/fbox|color|angl/.test(n)){if(s=D(["stretchy",n],[],i),n==="fbox"){var l=i.color&&i.getColor();l&&(s.style.borderColor=l)}}else{var u=[];/^[bx]cancel$/.test(n)&&u.push(new Xi({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&u.push(new Xi({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new Pt(u,{width:"100%",height:G(o)});s=nn([],[h],i)}return s.height=o,s.style.height=G(o),s},T2={bin:1,close:1,inner:1,open:1,punct:1,rel:1},E2={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function M2(e){return e in T2}function re(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function Ia(e){var t=za(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function za(e){return e&&(e.type==="atom"||E2.hasOwnProperty(e.type))?e:null}var Au=e=>{if(e instanceof rt)return e;if(n2(e)&&e.children.length===1)return Au(e.children[0])},Rs=(e,t)=>{var n,r,a;e&&e.type==="supsub"?(r=re(e.base,"accent"),n=r.base,e.base=n,a=t2(me(e,t)),e.base=r):(r=re(e,"accent"),n=r.base);var i=me(n,t.havingCrampedStyle()),s=r.isShifty&&qt(n),o=0;if(s){var l,u;o=(l=(u=Au(i))==null?void 0:u.skew)!=null?l:0}var h=r.label==="\\c",c=h?i.height+i.depth:Math.min(i.height,t.fontMetrics().xHeight),f;if(r.isStretchy)f=Ma(r,t),f=ce({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:f,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+G(2*o)+")",marginLeft:G(2*o)}:void 0}]});else{var d,b;r.label==="\\vec"?(d=wu("vec",t),b=vu.vec[1]):(d=Ta({mode:r.mode,text:r.label},t,"textord"),d=e2(d),d.italic=0,b=d.width,h&&(c+=d.depth)),f=D(["accent-body"],[d]);var w=r.label==="\\textcircled";w&&(f.classes.push("accent-full"),c=i.height);var A=o;w||(A-=b/2),f.style.left=G(A),r.label==="\\textcircled"&&(f.style.top=".2em"),f=ce({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-c},{type:"elem",elem:f}]})}var k=D(["mord","accent"],[f],t);return a?(a.children[0]=k,a.height=Math.max(k.height,a.height),a.classes[0]="mord",a):k},Tu=(e,t)=>{var n=e.isStretchy?Ea(e.label):new O("mo",[pt(e.label,e.mode)]),r=new O("mover",[ge(e.base,t),n]);return r.setAttribute("accent","true"),r},I2=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));W({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=pa(t[0]),r=!I2.test(e.funcName),a=!r||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:a,base:n}},htmlBuilder:Rs,mathmlBuilder:Tu});W({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:Rs,mathmlBuilder:Tu});W({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,a=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:a}},htmlBuilder:(e,t)=>{var n=me(e.base,t),r=Ma(e,t),a=e.label==="\\utilde"?.12:0,i=ce({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:a},{type:"elem",elem:n}]});return D(["mord","accentunder"],[i],t)},mathmlBuilder:(e,t)=>{var n=Ea(e.label),r=new O("munder",[ge(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var Pr=e=>{var t=new O("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};W({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrigLine truncated
|
||||||
|
]`,i5="\\\\[a-zA-Z@]+",s5="\\\\[^\uD800-\uDFFF]",o5="("+i5+")"+tc+"*",l5=`\\\\(
|
||||||
|
|[ \r ]+
|
||||||
|
?)[ \r ]*`,us="[̀-ͯ]",u5=new RegExp(us+"+$"),c5="("+tc+"+)|"+(l5+"|")+"([!-\\[\\]-‧-豈-]"+(us+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(us+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+o5)+("|"+s5+")");class El{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(c5,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new nt("EOF",new Ye(this,n,n));var r=this.tokenRegex.exec(t);if(r===null||r.index!==n)throw new P("Unexpected character: '"+t[n]+"'",new nt(t[n],new Ye(this,n,n+1)));var a=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[a]===14){var i=t.indexOf(`
|
||||||
|
`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=i+1,this.lex()}return new nt(a,new Ye(this,n,this.tokenRegex.lastIndex))}}class m5{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new P("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,r){if(r===void 0&&(r=!1),r){for(var a=0;a<this.undefStack.length;a++)delete this.undefStack[a][t];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var i=this.undefStack[this.undefStack.length-1];i&&!i.hasOwnProperty(t)&&(i[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var h5=Hu;y("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});y("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});y("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});y("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});y("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});y("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");y("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var Ml={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};y("\\char",function(e){var t=e.popToken(),n,r=0;if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")r=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new P("\\char` missing argument");r=t.text.charCodeAt(0)}else n=10;if(n){if(r=Ml[t.text],r==null||r>=n)throw new P("Invalid base-"+n+" digit "+t.text);for(var a;(a=Ml[e.future().text])!=null&&a<n;)r*=n,r+=a,e.popToken()}return"\\@char{"+r+"}"});var Ls=(e,t,n,r)=>{var a=e.consumeArg().tokens;if(a.length!==1)throw new P("\\newcommand's first argument must be a macro name");var i=a[0].text,s=e.isDefined(i);if(s&&!t)throw new P("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!s&&!n)throw new P("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(a=e.consumeArg().tokens,a.length===1&&a[0].text==="["){for(var l="",u=e.expandNextToken();u.text!=="]"&&u.text!=="EOF";)l+=u.text,u=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new P("Invalid number of arguments: "+l);o=parseInt(l),a=e.consumeArg().tokens}return s&&r||e.macros.set(i,{tokens:a,numArgs:o}),""};y("\\newcommand",e=>Ls(e,!1,!0,!1));y("\\renewcommand",e=>Ls(e,!0,!1,!1));y("\\providecommand",e=>Ls(e,!0,!0,!0));y("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});y("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});y("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Kt[n],ye.math[n],ye.text[n]),""});y("\\bgroup","{");y("\\egroup","}");y("~","\\nobreakspace");y("\\lq","`");y("\\rq","'");y("\\aa","\\r a");y("\\AA","\\r A");y("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");y("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");y("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");y("ℬ","\\mathscr{B}");y("ℰ","\\mathscr{E}");y("ℱ","\\mathscr{F}");y("ℋ","\\mathscr{H}");y("ℐ","\\mathscr{I}");y("ℒ","\\mathscr{L}");y("ℳ","\\mathscr{M}");y("ℛ","\\mathscr{R}");y("ℭ","\\mathfrak{C}");y("ℌ","\\mathfrak{H}");y("ℨ","\\mathfrak{Z}");y("\\Bbbk","\\Bbb{k}");y("\\llap","\\mathllap{\\textrm{#1}}");y("\\rlap","\\mathrlap{\\textrm{#1}}");y("\\clap","\\mathclap{\\textrm{#1}}");y("\\mathstrut","\\vphantom{(}");y("\\underbar","\\underline{\\text{#1}}");y("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');y("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");y("\\ne","\\neq");y("≠","\\neq");y("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");y("∉","\\notin");y("≘","\\hLine truncated
|
||||||
|
please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:a}}Rl.hasOwnProperty(n[0])&&!ye[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',t),n=Rl[n[0]]+n.slice(1));var i=u5.exec(n);i&&(n=n.substring(0,i.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var s;if(ye[this.mode][n]){this.settings.strict&&this.mode==="math"&&Yi.includes(n)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',t);var o=ye[this.mode][n].group,l=Ye.range(t),u;M2(o)?u={type:"atom",mode:this.mode,family:o,loc:l,text:n}:u={type:o,mode:this.mode,loc:l,text:n},s=u}else if(n.charCodeAt(0)>=128)this.settings.strict&&(mu(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),s={type:"textord",mode:"text",loc:Ye.range(t),text:n};else return null;if(this.consume(),i)for(var h=0;h<i[0].length;h++){var c=i[0][h];if(!ki[c])throw new P("Unknown accent ' "+c+"'",t);var f=ki[c][this.mode]||ki[c].text;if(!f)throw new P("Accent "+c+" unsupported in "+this.mode+" mode",t);s={type:"accent",mode:this.mode,loc:Ye.range(t),label:f,isStretchy:!1,isShifty:!0,base:s}}return s}}Fa.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var Ps=function(t,n){if(!(typeof t=="string"||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new Fa(t,n);delete r.gullet.macros.current["\\df@tag"];var a=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new P("\\tag works only in display equations");a=[{type:"tag",mode:"text",body:a,tag:r.subparse([new nt("\\df@tag")])}]}return a},ic=function(t,n,r){n.textContent="";var a=Os(t,r).toNode();n.appendChild(a)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),ic=function(){throw new P("KaTeX doesn't work in quirks mode.")});var f5=function(t,n){var r=Os(t,n).toMarkup();return r},g5=function(t,n){var r=new Cs(n);return Ps(t,r)},sc=function(t,n,r){if(r.throwOnError||!(t instanceof P))throw t;var a=D(["katex-error"],[new rt(n)]);return a.setAttribute("title",t.toString()),a.setAttribute("style","color:"+r.errorColor),a},Os=function(t,n){var r=new Cs(n);try{var a=Ps(t,r);return k2(a,t,r)}catch(i){return sc(i,t,r)}},b5=function(t,n){var r=new Cs(n);try{var a=Ps(t,r);return _2(a,t,r)}catch(i){return sc(i,t,r)}},y5="0.16.47",v5={Span:Un,Anchor:Sa,SymbolNode:rt,SvgNode:Pt,PathNode:tn,LineNode:Xi},N5={version:y5,render:ic,renderToString:f5,ParseError:P,SETTINGS_SCHEMA:Ui,__parse:g5,__renderToDomTree:Os,__renderToHTMLTree:b5,__setFontMetrics:r2,__defineSymbol:m,__defineFunction:W,__defineMacro:y,__domTree:v5};const B5={eof:null,dollarSign:36,leftParenthesis:40,rightParenthesis:41,asterisk:42,leftSquareBracket:91,backslash:92,rightSquareBracket:93},D5={characterGroupPunctuation:2,tabSize:4},L5={whitespace:"whitespace",lineEnding:"lineEnding",linePrefix:"linePrefix",characterEscape:"characterEscape",chunkString:"chunkString"};export{$5 as a,k5 as b,_5 as c,Gd as d,ji as e,B5 as f,la as g,D5 as h,L5 as i,A5 as j,ie as k,E5 as l,Y as m,z5 as n,R5 as o,M5 as p,I5 as q,N5 as r,S5 as s,C5 as t,_a as u,T5 as v};
|
||||||
|
//# sourceMappingURL=vendor-Cjbwl5VI.js.map
|
||||||
@@ -0,0 +1,420 @@
|
|||||||
|
window.__ModuleLoader__.load({
|
||||||
|
id: "@deepseek-ai/dsh-api-gateway",
|
||||||
|
factory: (require) => {
|
||||||
|
var module = { exports: {} };
|
||||||
|
var exports = module.exports;
|
||||||
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||||
|
let _deepseek_ai_cordis = require("@deepseek-ai/cordis");
|
||||||
|
//#region lib/types/client/index.js
|
||||||
|
/**
|
||||||
|
* Client projection of generated Typert Remote descriptors. Contributions
|
||||||
|
* install traced `remote.<namespace>` services; no JavaScript Proxy
|
||||||
|
* participates in method lookup, invocation, or type exposure.
|
||||||
|
*/
|
||||||
|
/** Required Client services: the Typert registry and the existing Connection carrier. */
|
||||||
|
const inject = ["typert", "connection"];
|
||||||
|
/**
|
||||||
|
* Install the typed Client Remote service.
|
||||||
|
* @param ctx - Client Cordis root.
|
||||||
|
*/
|
||||||
|
function apply(ctx) {
|
||||||
|
new ClientRemoteService(ctx);
|
||||||
|
}
|
||||||
|
var ClientRemoteService = class extends _deepseek_ai_cordis.Service {
|
||||||
|
ownerCtx;
|
||||||
|
namespaces = /* @__PURE__ */ new Map();
|
||||||
|
subscriptions = /* @__PURE__ */ new Map();
|
||||||
|
mutations = Promise.resolve();
|
||||||
|
constructor(ctx) {
|
||||||
|
super(ctx, "remote");
|
||||||
|
this.ownerCtx = ctx;
|
||||||
|
ctx.effect(() => () => {
|
||||||
|
this.subscriptions.clear();
|
||||||
|
}, "api-gateway.client.subscriptions");
|
||||||
|
}
|
||||||
|
async $mount(contribution) {
|
||||||
|
const callerCtx = this.ctx;
|
||||||
|
const owned = callerCtx.effect(async () => {
|
||||||
|
const dispose = await this.enqueue(() => this.mountContribution(callerCtx, contribution));
|
||||||
|
return () => this.enqueue(dispose);
|
||||||
|
}, `api-gateway.client.$mount(${JSON.stringify(contribution.package)})`);
|
||||||
|
await owned;
|
||||||
|
return async () => {
|
||||||
|
await owned();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
$on(event, listener) {
|
||||||
|
const subscription = { listener };
|
||||||
|
const owned = this.ctx.effect(() => {
|
||||||
|
const listeners = this.listeners(event);
|
||||||
|
listeners.push(subscription);
|
||||||
|
return () => {
|
||||||
|
const at = listeners.indexOf(subscription);
|
||||||
|
/* v8 ignore next -- listener */
|
||||||
|
if (at >= 0) listeners.splice(at, 1);
|
||||||
|
};
|
||||||
|
}, `api-gateway.client.$on(${JSON.stringify(event)})`);
|
||||||
|
return () => {
|
||||||
|
owned();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Deliver one forwarded event in registration order, isolating a listener
|
||||||
|
* that fails either synchronously or by rejecting a returned promise; see
|
||||||
|
* {@link TypertClientRemote.$dispatch} for the caller contract.
|
||||||
|
*/
|
||||||
|
$dispatch(event, args) {
|
||||||
|
const listeners = this.subscriptions.get(event);
|
||||||
|
if (listeners === void 0) return;
|
||||||
|
for (const { listener } of [...listeners]) {
|
||||||
|
const report = (error) => {
|
||||||
|
console.error(`client api: Remote event ${JSON.stringify(event)} listener threw:`, error);
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
const settled = listener(...args);
|
||||||
|
if (settled instanceof Promise) settled.catch(report);
|
||||||
|
} catch (error) {
|
||||||
|
report(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** Subscriptions for one event name; empty arrays are retained, bounded by the Host's selection. */
|
||||||
|
listeners(event) {
|
||||||
|
let listeners = this.subscriptions.get(event);
|
||||||
|
if (listeners === void 0) {
|
||||||
|
listeners = [];
|
||||||
|
this.subscriptions.set(event, listeners);
|
||||||
|
}
|
||||||
|
return listeners;
|
||||||
|
}
|
||||||
|
enqueue(operation) {
|
||||||
|
const result = this.mutations.then(operation, operation);
|
||||||
|
this.mutations = result.then(() => void 0, () => void 0);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
async mountContribution(callerCtx, contribution) {
|
||||||
|
this.validateContribution(contribution);
|
||||||
|
const disposeRemote = callerCtx.typert.remotes.register(contribution);
|
||||||
|
const installed = [];
|
||||||
|
try {
|
||||||
|
for (const descriptor of contribution.descriptors) installed.push(await this.install(descriptor));
|
||||||
|
} catch (error) {
|
||||||
|
for (const dispose of installed.reverse()) await dispose();
|
||||||
|
await disposeRemote();
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
return async () => {
|
||||||
|
for (const dispose of installed.reverse()) await dispose();
|
||||||
|
await disposeRemote();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
validateContribution(contribution) {
|
||||||
|
const direct = /* @__PURE__ */ new Map();
|
||||||
|
const scoped = /* @__PURE__ */ new Map();
|
||||||
|
const add = (table, descriptor, kind) => {
|
||||||
|
const methods = table.get(descriptor.namespace) ?? /* @__PURE__ */ new Set();
|
||||||
|
if (methods.has(descriptor.method)) throw new Error(`client api: contribution repeats ${kind} method ${endpointOf(descriptor)}`);
|
||||||
|
methods.add(descriptor.method);
|
||||||
|
table.set(descriptor.namespace, methods);
|
||||||
|
if ((this.namespaces.get(descriptor.namespace)?.service)?.has(kind, descriptor.method) === true) throw new Error(`client api: ${kind} method ${endpointOf(descriptor)} is already mounted`);
|
||||||
|
};
|
||||||
|
for (const descriptor of contribution.descriptors) {
|
||||||
|
requireStrictDescriptor(descriptor);
|
||||||
|
if (descriptor.invocation.kind === "direct") add(direct, descriptor, "direct");
|
||||||
|
if (scopedProjection(descriptor) !== void 0) add(scoped, descriptor, "scoped");
|
||||||
|
}
|
||||||
|
const namespaces = new Set([...direct.keys(), ...scoped.keys()]);
|
||||||
|
for (const namespace of namespaces) {
|
||||||
|
const service = this.namespaces.get(namespace)?.service;
|
||||||
|
if (service === void 0) {
|
||||||
|
if (namespace in this) throw new Error(`client api: namespace ${JSON.stringify(namespace)} conflicts with the Remote service`);
|
||||||
|
const serviceKey = remoteServiceKey(namespace);
|
||||||
|
if (this.ownerCtx.reflect.props[serviceKey]?.type === "accessor" || this.ownerCtx.get(serviceKey) !== void 0) throw new Error(`client api: namespace ${JSON.stringify(namespace)} conflicts with an existing Remote namespace`);
|
||||||
|
}
|
||||||
|
for (const method of new Set([...direct.get(namespace) ?? [], ...scoped.get(namespace) ?? []])) if (service === void 0) RemoteNamespaceService.assertMethodAvailable(namespace, method);
|
||||||
|
else service.assertMethodAvailable(method);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async install(descriptor) {
|
||||||
|
const token = {
|
||||||
|
active: true,
|
||||||
|
abort: new AbortController()
|
||||||
|
};
|
||||||
|
const installed = [];
|
||||||
|
try {
|
||||||
|
if (descriptor.invocation.kind === "direct") installed.push(await this.installDirect(descriptor, token));
|
||||||
|
const projection = scopedProjection(descriptor);
|
||||||
|
if (projection !== void 0) installed.push(await this.installScoped(descriptor, projection, token));
|
||||||
|
} catch (error) {
|
||||||
|
token.active = false;
|
||||||
|
token.abort.abort();
|
||||||
|
for (const dispose of installed.reverse()) await dispose();
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
return async () => {
|
||||||
|
/* v8 ignore next -- Cordis effect disposers are idempotent and invoke this cleanup at most once. */
|
||||||
|
if (!token.active) return;
|
||||||
|
token.active = false;
|
||||||
|
token.abort.abort();
|
||||||
|
for (const dispose of installed.reverse()) await dispose();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
async installDirect(descriptor, token) {
|
||||||
|
const namespace = await this.namespace(descriptor.namespace);
|
||||||
|
try {
|
||||||
|
namespace.service.installDirect(descriptor, token);
|
||||||
|
} catch (error) {
|
||||||
|
await this.disposeNamespace(descriptor.namespace, namespace);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
return async () => {
|
||||||
|
namespace.service.remove("direct", descriptor.method, token);
|
||||||
|
await this.disposeNamespace(descriptor.namespace, namespace);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
async installScoped(descriptor, projection, token) {
|
||||||
|
const namespace = await this.namespace(descriptor.namespace);
|
||||||
|
try {
|
||||||
|
namespace.service.installScoped(descriptor, projection, token);
|
||||||
|
} catch (error) {
|
||||||
|
await this.disposeNamespace(descriptor.namespace, namespace);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
return async () => {
|
||||||
|
namespace.service.remove("scoped", descriptor.method, token);
|
||||||
|
await this.disposeNamespace(descriptor.namespace, namespace);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
async namespace(name) {
|
||||||
|
let namespace = this.namespaces.get(name);
|
||||||
|
if (namespace !== void 0) return namespace;
|
||||||
|
let service;
|
||||||
|
const fiber = this.ownerCtx.plugin({
|
||||||
|
name: remoteServiceKey(name),
|
||||||
|
apply: (ctx) => {
|
||||||
|
service = new RemoteNamespaceService(ctx, name, (direct, scoped, caller, args) => this.invokeMethod(direct, scoped, caller, args));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await fiber;
|
||||||
|
} catch (error) {
|
||||||
|
await fiber.dispose();
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
/* v8 ignore next -- a settled namespace fiber synchronously constructs its Service. */
|
||||||
|
if (service === void 0) throw new Error(`client api: namespace ${JSON.stringify(name)} did not start`);
|
||||||
|
namespace = {
|
||||||
|
service,
|
||||||
|
dispose: fiber.dispose
|
||||||
|
};
|
||||||
|
this.namespaces.set(name, namespace);
|
||||||
|
return namespace;
|
||||||
|
}
|
||||||
|
async disposeNamespace(name, namespace) {
|
||||||
|
if (!namespace.service.empty || this.namespaces.get(name) !== namespace) return;
|
||||||
|
this.namespaces.delete(name);
|
||||||
|
await namespace.dispose();
|
||||||
|
}
|
||||||
|
invokeMethod(direct, scoped, callerCtx, values) {
|
||||||
|
if (scoped !== void 0) {
|
||||||
|
const identity = this.ownerCtx.typert.contexts.getClient(scoped.projection.context)?.identity(callerCtx);
|
||||||
|
if (identity !== void 0) return this.invoke(scoped.descriptor, scoped.projection, scoped.token, callerCtx, values, { value: identity });
|
||||||
|
}
|
||||||
|
if (direct !== void 0) return this.invoke(direct.descriptor, void 0, direct.token, callerCtx, values);
|
||||||
|
if (scoped !== void 0) return this.invoke(scoped.descriptor, scoped.projection, scoped.token, callerCtx, values);
|
||||||
|
throw new Error("client api: Remote method is no longer mounted");
|
||||||
|
}
|
||||||
|
async invoke(descriptor, projection, token, callerCtx, values, boundIdentity) {
|
||||||
|
const endpoint = endpointOf(descriptor);
|
||||||
|
if (!token.active) return withdrawn(endpoint);
|
||||||
|
const expected = descriptor.parameters.length - (projection?.parameterIndex === void 0 ? 0 : 1);
|
||||||
|
const hasCallerSignal = descriptor.cancellation !== void 0 && values.length === expected + 1;
|
||||||
|
if (values.length !== expected && !hasCallerSignal) {
|
||||||
|
const contract = descriptor.cancellation === void 0 ? `${String(expected)} argument(s)` : `${String(expected)} business argument(s) plus an optional AbortSignal`;
|
||||||
|
throw new Error(`client api: ${endpoint} expected ${contract}, got ${String(values.length)}`);
|
||||||
|
}
|
||||||
|
const args = Object.create(null);
|
||||||
|
if (projection !== void 0) {
|
||||||
|
const binder = boundIdentity === void 0 ? this.ownerCtx.typert.contexts.getClient(projection.context) : void 0;
|
||||||
|
if (boundIdentity === void 0 && binder === void 0) throw new Error(`client api: ${endpoint} has no Client Context binder for ${JSON.stringify(projection.context)}`);
|
||||||
|
const identity = boundIdentity === void 0 ? binder?.identity(callerCtx) : boundIdentity.value;
|
||||||
|
if (identity === void 0) throw new Error(`client api: ${endpoint} requires a ${JSON.stringify(projection.context)} Context`);
|
||||||
|
args[projection.wire] = parse(projection.codec, identity, endpoint, projection.wire);
|
||||||
|
}
|
||||||
|
let valueIndex = 0;
|
||||||
|
descriptor.parameters.forEach((parameter, parameterIndex) => {
|
||||||
|
if (parameterIndex === projection?.parameterIndex) return;
|
||||||
|
const value = parse(parameter.codec, values[valueIndex], endpoint, parameter.wire);
|
||||||
|
if (value !== void 0) args[parameter.wire] = value;
|
||||||
|
valueIndex += 1;
|
||||||
|
});
|
||||||
|
const connection = this.ownerCtx.get("connection");
|
||||||
|
if (connection === void 0) throw new Error(`client api: ${endpoint} has no active Connection`);
|
||||||
|
const callerSignal = hasCallerSignal ? values[expected] : void 0;
|
||||||
|
const signal = callerSignal === void 0 ? token.abort.signal : AbortSignal.any([token.abort.signal, callerSignal]);
|
||||||
|
try {
|
||||||
|
const result = await connection.rpc.call("/api", endpoint, { args }, signal);
|
||||||
|
if (!mountActive(token)) return withdrawn(endpoint);
|
||||||
|
if (!result.ok) return {
|
||||||
|
ok: false,
|
||||||
|
error: result.error
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
ok: true,
|
||||||
|
value: parse(descriptor.result, result.value, endpoint, "result")
|
||||||
|
};
|
||||||
|
} catch (error) {
|
||||||
|
return carrierFailure(endpoint, error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var RemoteNamespaceService = class RemoteNamespaceService extends _deepseek_ai_cordis.Service {
|
||||||
|
invokeRemote;
|
||||||
|
methods = /* @__PURE__ */ new Map();
|
||||||
|
namespace;
|
||||||
|
static assertMethodAvailable(namespace, method) {
|
||||||
|
if (REMOTE_NAMESPACE_FIELDS.has(method) || method in RemoteNamespaceService.prototype) throw new Error(`client api: method ${JSON.stringify(`${namespace}/${method}`)} conflicts with its namespace service`);
|
||||||
|
}
|
||||||
|
constructor(ctx, name, invokeRemote) {
|
||||||
|
super(ctx, remoteServiceKey(name));
|
||||||
|
this.invokeRemote = invokeRemote;
|
||||||
|
this.namespace = name;
|
||||||
|
}
|
||||||
|
assertMethodAvailable(method) {
|
||||||
|
RemoteNamespaceService.assertMethodAvailable(this.namespace, method);
|
||||||
|
if (method in this && !this.methods.has(method)) throw new Error(`client api: method ${JSON.stringify(`${this.namespace}/${method}`)} conflicts with its namespace service`);
|
||||||
|
}
|
||||||
|
get empty() {
|
||||||
|
return this.methods.size === 0;
|
||||||
|
}
|
||||||
|
has(kind, method) {
|
||||||
|
return this.methods.get(method)?.[kind] !== void 0;
|
||||||
|
}
|
||||||
|
installDirect(descriptor, token) {
|
||||||
|
this.install(descriptor.method, "direct", {
|
||||||
|
descriptor,
|
||||||
|
token
|
||||||
|
});
|
||||||
|
}
|
||||||
|
installScoped(descriptor, projection, token) {
|
||||||
|
this.install(descriptor.method, "scoped", {
|
||||||
|
descriptor,
|
||||||
|
projection,
|
||||||
|
token
|
||||||
|
});
|
||||||
|
}
|
||||||
|
install(method, kind, value) {
|
||||||
|
this.assertMethodAvailable(method);
|
||||||
|
let record = this.methods.get(method);
|
||||||
|
const fresh = record === void 0;
|
||||||
|
record ??= {};
|
||||||
|
if (fresh) {
|
||||||
|
Object.defineProperty(this, method, {
|
||||||
|
configurable: true,
|
||||||
|
enumerable: true,
|
||||||
|
get: function() {
|
||||||
|
const callerCtx = this.ctx;
|
||||||
|
const current = this.methods.get(method);
|
||||||
|
const direct = current?.direct;
|
||||||
|
const scoped = current?.scoped;
|
||||||
|
return (...args) => {
|
||||||
|
return this.invokeRemote(direct, scoped, callerCtx, args);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.methods.set(method, record);
|
||||||
|
}
|
||||||
|
if (kind === "direct") record.direct = value;
|
||||||
|
else record.scoped = value;
|
||||||
|
}
|
||||||
|
remove(kind, method, token) {
|
||||||
|
const record = this.methods.get(method);
|
||||||
|
const current = record?.[kind];
|
||||||
|
/* v8 ignore next -- duplicate live variants are rejected before installation, so no newer token can replace this one. */
|
||||||
|
if (record === void 0 || current?.token !== token) return;
|
||||||
|
if (kind === "direct") delete record.direct;
|
||||||
|
else delete record.scoped;
|
||||||
|
if (record.direct !== void 0 || record.scoped !== void 0) return;
|
||||||
|
this.methods.delete(method);
|
||||||
|
Reflect.deleteProperty(this, method);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const REMOTE_NAMESPACE_FIELDS = new Set([
|
||||||
|
"ctx",
|
||||||
|
"empty",
|
||||||
|
"invokeRemote",
|
||||||
|
"methods",
|
||||||
|
"name",
|
||||||
|
"namespace"
|
||||||
|
]);
|
||||||
|
function remoteServiceKey(namespace) {
|
||||||
|
return `remote.${namespace}`;
|
||||||
|
}
|
||||||
|
function endpointOf(descriptor) {
|
||||||
|
return `${descriptor.namespace}/${descriptor.method}`;
|
||||||
|
}
|
||||||
|
function mountActive(token) {
|
||||||
|
return token.active;
|
||||||
|
}
|
||||||
|
function scopedProjection(descriptor) {
|
||||||
|
if (descriptor.invocation.kind === "context") return {
|
||||||
|
context: descriptor.invocation.context,
|
||||||
|
wire: descriptor.invocation.wire,
|
||||||
|
codec: descriptor.invocation.codec
|
||||||
|
};
|
||||||
|
if (descriptor.scope === void 0) return void 0;
|
||||||
|
const lookupParameters = descriptor.parameters.map((parameter, index) => ({
|
||||||
|
parameter,
|
||||||
|
index
|
||||||
|
})).filter((candidate) => candidate.parameter.source === "lookup");
|
||||||
|
const selected = lookupParameters.length === 1 ? lookupParameters[0] : void 0;
|
||||||
|
if (selected === void 0 || selected.parameter.wire !== descriptor.scope.wire || selected.parameter.lookup !== descriptor.scope.context) throw new Error(`client api: generated Remote ${endpointOf(descriptor)} scope must select its only lookup parameter`);
|
||||||
|
return {
|
||||||
|
context: descriptor.scope.context,
|
||||||
|
wire: descriptor.scope.wire,
|
||||||
|
codec: selected.parameter.codec,
|
||||||
|
parameterIndex: selected.index
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function requireStrictDescriptor(descriptor) {
|
||||||
|
const endpoint = endpointOf(descriptor);
|
||||||
|
requireStrictCodec(descriptor.result, endpoint, "result");
|
||||||
|
for (const parameter of descriptor.parameters) requireStrictCodec(parameter.codec, endpoint, parameter.wire);
|
||||||
|
if (descriptor.invocation.kind === "context") requireStrictCodec(descriptor.invocation.codec, endpoint, descriptor.invocation.wire);
|
||||||
|
}
|
||||||
|
function requireStrictCodec(codec, endpoint, field) {
|
||||||
|
if (codec.mode !== "strict") throw new Error(`client api: generated Remote ${endpoint} field ${JSON.stringify(field)} has no strict codec`);
|
||||||
|
}
|
||||||
|
function parse(codec, value, endpoint, field) {
|
||||||
|
if (codec.mode !== "strict") throw new Error(`client api: generated Remote ${endpoint} field ${JSON.stringify(field)} has no strict codec`);
|
||||||
|
try {
|
||||||
|
return codec.schema.parse(value);
|
||||||
|
} catch (cause) {
|
||||||
|
throw new Error(`client api: ${endpoint} rejected ${JSON.stringify(field)}`, { cause });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** The namespace retired before or during the call, so no request outcome exists. */
|
||||||
|
function withdrawn(endpoint) {
|
||||||
|
return internalFailure(`client api: Remote method ${endpoint} is no longer mounted`);
|
||||||
|
}
|
||||||
|
function carrierFailure(endpoint, error) {
|
||||||
|
return internalFailure(`client api: ${endpoint} failed: ${error instanceof Error ? error.message : String(error)}`);
|
||||||
|
}
|
||||||
|
function internalFailure(message) {
|
||||||
|
return {
|
||||||
|
ok: false,
|
||||||
|
error: {
|
||||||
|
code: "internal",
|
||||||
|
message,
|
||||||
|
details: {}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
exports.apply = apply;
|
||||||
|
exports.inject = inject;
|
||||||
|
return module.exports;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//# sourceMappingURL=client.js.map
|
||||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,456 @@
|
|||||||
|
window.__ModuleLoader__.load({
|
||||||
|
id: "@deepseek-ai/dsh-client-ui-layout",
|
||||||
|
factory: (require) => {
|
||||||
|
var module = { exports: {} };
|
||||||
|
var exports = module.exports;
|
||||||
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||||
|
let react_jsx_runtime = require("react/jsx-runtime");
|
||||||
|
let react = require("react");
|
||||||
|
let _deepseek_ai_dsh_client_runtime_client = require("@deepseek-ai/dsh-client-runtime/client");
|
||||||
|
/** Viewport width below which the sidebar auto-collapses to the rail (deepsuite
|
||||||
|
* LG breakpoint); a manual toggle below it re-expands over the squeezed center
|
||||||
|
* (stores.ts narrowExpanded). */
|
||||||
|
const SIDEBAR_AUTO_COLLAPSE = 1024;
|
||||||
|
/**
|
||||||
|
* Clamp a panel width into its contract range.
|
||||||
|
* @param px - requested width.
|
||||||
|
* @param min - range lower bound.
|
||||||
|
* @param max - range upper bound.
|
||||||
|
* @returns the clamped width.
|
||||||
|
*/
|
||||||
|
function clampWidth(px, min, max) {
|
||||||
|
return Math.min(max, Math.max(min, Math.round(px)));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Solve the three column widths for one viewport frame. Pure: no hysteresis —
|
||||||
|
* the output is a function of (viewport, preferences) only, so recovery on
|
||||||
|
* re-widening is automatic. Preferences re-clamp here because they cross the
|
||||||
|
* store boundary and callers may still supply stale ranges.
|
||||||
|
* @param viewport - available frame width in px.
|
||||||
|
* @param sidebar - sidebar width preference in px (0 = closed).
|
||||||
|
* @param details - details width preference in px (0 = closed).
|
||||||
|
* @returns resolved widths; details 0 means visually closed (never unmounted), while a closed sidebar keeps its compact rail.
|
||||||
|
*/
|
||||||
|
function computeColumns(viewport, sidebar, details) {
|
||||||
|
const s = sidebar === 0 ? 56 : clampWidth(sidebar, 264, 420);
|
||||||
|
const d0 = details === 0 ? 0 : clampWidth(details, 300, 520);
|
||||||
|
if (s + d0 + 640 <= viewport) return {
|
||||||
|
sidebar: s,
|
||||||
|
center: viewport - s - d0,
|
||||||
|
details: d0
|
||||||
|
};
|
||||||
|
const d1 = d0 === 0 ? 0 : Math.max(300, viewport - s - 640);
|
||||||
|
if (s + d1 + 640 <= viewport) return {
|
||||||
|
sidebar: s,
|
||||||
|
center: 640,
|
||||||
|
details: d1
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
sidebar: s,
|
||||||
|
center: Math.max(0, viewport - s),
|
||||||
|
details: 0
|
||||||
|
};
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-layout/src/client/AppFrame.module.css.mjs
|
||||||
|
const css = ".pI_x6G_frame{background:var(--dsw-alias-bg-base);height:100%;transition:grid-template-columns var(--ds-transition-duration-slow) var(--ds-ease-in-out);grid-template-rows:100%;display:grid;position:relative;overflow:hidden}.pI_x6G_frame[data-dragging]{transition:none}@media (prefers-reduced-motion:reduce){.pI_x6G_frame{transition:none}}.pI_x6G_sidebarCol{background:var(--dsw-specific-sidebar-fill);border-right:1px solid var(--dsw-alias-border-l1);min-width:0;overflow:hidden}.pI_x6G_centerCol{flex-direction:column;min-width:0;display:flex;overflow:hidden}.pI_x6G_detailsCol{border-left:1px solid var(--dsw-alias-border-l2);min-width:0;overflow:hidden}.pI_x6G_frame[data-details-collapsed] .pI_x6G_detailsCol{border-left:none}.pI_x6G_handle{cursor:col-resize;z-index:2;touch-action:none;width:8px;transition:left var(--ds-transition-duration-slow) var(--ds-ease-in-out);margin-left:-4px;position:absolute;top:0;bottom:0}.pI_x6G_frame[data-dragging] .pI_x6G_handle{transition:none}@media (prefers-reduced-motion:reduce){.pI_x6G_handle{transition:none}}.pI_x6G_handle[data-side=details]:after{content:\"\";box-sizing:border-box;background:var(--dsw-alias-button-floating-fill);border:1px solid var(--dsw-alias-border-l2-darkmode-thin);opacity:0;width:12px;height:32px;transition:opacity var(--ds-transition-duration-slow) var(--ds-ease-in-out), background var(--ds-transition-duration-slow) var(--ds-ease-in-out);border-radius:10px;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.pI_x6G_detailsCol:hover~.pI_x6G_handle[data-side=details]:after,.pI_x6G_handle[data-side=details]:hover:after,.pI_x6G_handle[data-side=details][data-dragging=true]:after{opacity:1}.pI_x6G_handle[data-side=details]:hover:after,.pI_x6G_handle[data-side=details][data-dragging=true]:after{background:var(--dsw-alias-button-floating-hover);border-color:var(--dsw-alias-border-l3)}.pI_x6G_overlayLayer{z-index:20;pointer-events:none;position:absolute;inset:0}.pI_x6G_overlayLayer>*{pointer-events:auto}";
|
||||||
|
const tagId = "@deepseek-ai/dsh-client-ui-layout/AppFrame.module.css";
|
||||||
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
||||||
|
const tag = document.createElement("style");
|
||||||
|
tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-layout";
|
||||||
|
tag.dataset.pluginCss = tagId;
|
||||||
|
tag.textContent = css;
|
||||||
|
document.head.appendChild(tag);
|
||||||
|
}
|
||||||
|
var AppFrame_module_css_default = {
|
||||||
|
"detailsCol": "pI_x6G_detailsCol",
|
||||||
|
"sidebarCol": "pI_x6G_sidebarCol",
|
||||||
|
"overlayLayer": "pI_x6G_overlayLayer",
|
||||||
|
"handle": "pI_x6G_handle",
|
||||||
|
"frame": "pI_x6G_frame",
|
||||||
|
"centerCol": "pI_x6G_centerCol"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/AppFrame.js
|
||||||
|
/**
|
||||||
|
* Three-column shell frame, registered into the built-in 'root' slot (the web
|
||||||
|
* shell renders only 'root'). Owns the grid tracks (sidebar | center |
|
||||||
|
* details), the drag handles (pointer capture + rAF throttle), the concession
|
||||||
|
* chain (columns.ts), and the child-slot render decisions: the sidebar slot
|
||||||
|
* renders HERE with live parameters from the concession solve, and the
|
||||||
|
* session-aware occupants render in fixed column positions; strict entries
|
||||||
|
* gate themselves on current-session availability while session-maybe
|
||||||
|
* entries retain identity. Pure component: everything arrives
|
||||||
|
* through the three framework shares — zero cordis or framework imports,
|
||||||
|
* zero self-made hooks.
|
||||||
|
*/
|
||||||
|
/** Center column grid item (session-body building block). */
|
||||||
|
function CenterColumn(props) {
|
||||||
|
return (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: AppFrame_module_css_default.centerCol,
|
||||||
|
children: props.children
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** Details column grid item; width 0 keeps the subtree mounted (never unmount on close). */
|
||||||
|
function DetailsColumn(props) {
|
||||||
|
return (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: AppFrame_module_css_default.detailsCol,
|
||||||
|
children: props.children
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* One drag handle: pointer capture, rAF-throttled dx reports against the drag-start origin.
|
||||||
|
* `side` keys the hover-reveal CSS to the owning column.
|
||||||
|
*/
|
||||||
|
function DragHandle(props) {
|
||||||
|
const [dragging, setDragging] = (0, react.useState)(false);
|
||||||
|
const origin = (0, react.useRef)(0);
|
||||||
|
const latest = (0, react.useRef)(0);
|
||||||
|
const frame = (0, react.useRef)(null);
|
||||||
|
const callbacks = (0, react.useRef)({
|
||||||
|
onStart: props.onStart,
|
||||||
|
onDrag: props.onDrag,
|
||||||
|
onEnd: props.onEnd
|
||||||
|
});
|
||||||
|
callbacks.current = {
|
||||||
|
onStart: props.onStart,
|
||||||
|
onDrag: props.onDrag,
|
||||||
|
onEnd: props.onEnd
|
||||||
|
};
|
||||||
|
const onPointerDown = (0, react.useCallback)((e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
e.currentTarget.setPointerCapture(e.pointerId);
|
||||||
|
origin.current = e.clientX;
|
||||||
|
latest.current = e.clientX;
|
||||||
|
callbacks.current.onStart();
|
||||||
|
setDragging(true);
|
||||||
|
}, []);
|
||||||
|
const onPointerMove = (0, react.useCallback)((e) => {
|
||||||
|
if (!e.currentTarget.hasPointerCapture(e.pointerId)) return;
|
||||||
|
latest.current = e.clientX;
|
||||||
|
frame.current ??= requestAnimationFrame(() => {
|
||||||
|
frame.current = null;
|
||||||
|
callbacks.current.onDrag(latest.current - origin.current);
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
const onPointerUp = (0, react.useCallback)((e) => {
|
||||||
|
if (!e.currentTarget.hasPointerCapture(e.pointerId)) return;
|
||||||
|
e.currentTarget.releasePointerCapture(e.pointerId);
|
||||||
|
if (frame.current !== null) {
|
||||||
|
cancelAnimationFrame(frame.current);
|
||||||
|
frame.current = null;
|
||||||
|
}
|
||||||
|
callbacks.current.onDrag(latest.current - origin.current);
|
||||||
|
setDragging(false);
|
||||||
|
callbacks.current.onEnd();
|
||||||
|
}, []);
|
||||||
|
return (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: AppFrame_module_css_default.handle,
|
||||||
|
style: { left: props.left },
|
||||||
|
"data-side": props.side,
|
||||||
|
"data-dragging": dragging || void 0,
|
||||||
|
onPointerDown,
|
||||||
|
onPointerMove,
|
||||||
|
onPointerUp
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** The three-column frame (see module doc). */
|
||||||
|
function AppFrame({ useStore, useSessions, actions, renderSlot }) {
|
||||||
|
const panels = useStore((s) => s);
|
||||||
|
const detailsSession = useSessions((s) => {
|
||||||
|
const current = s.current;
|
||||||
|
return current !== void 0 && s.byId[current]?.blank === false ? current : void 0;
|
||||||
|
});
|
||||||
|
const frameRef = (0, react.useRef)(null);
|
||||||
|
const [viewport, setViewport] = (0, react.useState)(() => window.innerWidth);
|
||||||
|
const lastSession = (0, react.useRef)(detailsSession);
|
||||||
|
(0, react.useLayoutEffect)(() => {
|
||||||
|
if (detailsSession === void 0) return;
|
||||||
|
if (lastSession.current !== void 0 && lastSession.current !== detailsSession) actions.closeDetails();
|
||||||
|
lastSession.current = detailsSession;
|
||||||
|
}, [actions, detailsSession]);
|
||||||
|
(0, react.useEffect)(() => {
|
||||||
|
const el = frameRef.current;
|
||||||
|
/* v8 ignore next -- the ref is always attached by effect time: the frame div renders unconditionally. */
|
||||||
|
if (el === null) return;
|
||||||
|
let raf = null;
|
||||||
|
const observer = new ResizeObserver(() => {
|
||||||
|
raf ??= requestAnimationFrame(() => {
|
||||||
|
raf = null;
|
||||||
|
const width = el.getBoundingClientRect().width;
|
||||||
|
if (width > 0) setViewport(width);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
observer.observe(el);
|
||||||
|
return () => {
|
||||||
|
observer.disconnect();
|
||||||
|
if (raf !== null) cancelAnimationFrame(raf);
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
const narrow = viewport < SIDEBAR_AUTO_COLLAPSE;
|
||||||
|
(0, react.useEffect)(() => {
|
||||||
|
actions.setNarrow(narrow);
|
||||||
|
}, [actions, narrow]);
|
||||||
|
const sidebarCollapsed = narrow ? !panels.narrowExpanded : panels.sidebar === 0;
|
||||||
|
const cols = computeColumns(viewport, sidebarCollapsed ? 0 : panels.sidebar === 0 ? 280 : panels.sidebar, detailsSession === void 0 ? 0 : panels.details);
|
||||||
|
const colsRef = (0, react.useRef)(cols);
|
||||||
|
colsRef.current = cols;
|
||||||
|
const sidebarBase = (0, react.useRef)(0);
|
||||||
|
const detailsBase = (0, react.useRef)(0);
|
||||||
|
const [dragging, setDragging] = (0, react.useState)(false);
|
||||||
|
const onDragEnd = (0, react.useCallback)(() => {
|
||||||
|
setDragging(false);
|
||||||
|
}, []);
|
||||||
|
const onSidebarStart = (0, react.useCallback)(() => {
|
||||||
|
sidebarBase.current = colsRef.current.sidebar;
|
||||||
|
setDragging(true);
|
||||||
|
}, []);
|
||||||
|
const onDetailsStart = (0, react.useCallback)(() => {
|
||||||
|
detailsBase.current = colsRef.current.details;
|
||||||
|
setDragging(true);
|
||||||
|
}, []);
|
||||||
|
const onSidebarDrag = (0, react.useCallback)((dx) => {
|
||||||
|
actions.setSidebar(sidebarBase.current + dx);
|
||||||
|
}, [actions]);
|
||||||
|
const onDetailsDrag = (0, react.useCallback)((dx) => {
|
||||||
|
actions.setDetails(detailsBase.current - dx);
|
||||||
|
}, [actions]);
|
||||||
|
return (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
ref: frameRef,
|
||||||
|
className: AppFrame_module_css_default.frame,
|
||||||
|
style: { gridTemplateColumns: `${cols.sidebar}px minmax(0, 1fr) ${cols.details}px` },
|
||||||
|
"data-sidebar-collapsed": sidebarCollapsed || void 0,
|
||||||
|
"data-details-collapsed": cols.details === 0 || void 0,
|
||||||
|
"data-dragging": dragging || void 0,
|
||||||
|
children: [
|
||||||
|
(0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: AppFrame_module_css_default.sidebarCol,
|
||||||
|
children: renderSlot("sidebar", {
|
||||||
|
collapsed: sidebarCollapsed,
|
||||||
|
width: cols.sidebar
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)(CenterColumn, { children: renderSlot("conversation", {}) }), (0, react_jsx_runtime.jsx)(DetailsColumn, { children: renderSlot("details", {}) })] }),
|
||||||
|
(0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: AppFrame_module_css_default.overlayLayer,
|
||||||
|
"data-shell-overlay": true,
|
||||||
|
children: renderSlot("shell.overlay", {})
|
||||||
|
}),
|
||||||
|
!sidebarCollapsed && (0, react_jsx_runtime.jsx)(DragHandle, {
|
||||||
|
side: "sidebar",
|
||||||
|
left: cols.sidebar,
|
||||||
|
onStart: onSidebarStart,
|
||||||
|
onDrag: onSidebarDrag,
|
||||||
|
onEnd: onDragEnd
|
||||||
|
}),
|
||||||
|
cols.details > 0 && (0, react_jsx_runtime.jsx)(DragHandle, {
|
||||||
|
side: "details",
|
||||||
|
left: viewport - cols.details,
|
||||||
|
onStart: onDetailsStart,
|
||||||
|
onDrag: onDetailsDrag,
|
||||||
|
onEnd: onDragEnd
|
||||||
|
})
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/stores.js
|
||||||
|
/**
|
||||||
|
* The root entry's transient layout store: panel geometry as plain widths in
|
||||||
|
* px (0 = closed). Module level exports the factory only — a module-level
|
||||||
|
* handle would pin the store's identity in the module
|
||||||
|
* cache (a de-facto singleton surviving plugin reloads). register() receives
|
||||||
|
* the factory (exclusive use: the framework instantiates per entry), AppFrame
|
||||||
|
* derives its PropsStore share from the return type, and the service face
|
||||||
|
* receives the bound actions through the registration's inject hook.
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* Create the layout panel store handle. The preference IS the width, so
|
||||||
|
* closing a panel forgets its drag width — reopening restores the contract
|
||||||
|
* default. Actions are the complete write set: drag writes clamp
|
||||||
|
* into the panel's contract range and never cross the open/closed line;
|
||||||
|
* open/close transitions write 0 / the default explicitly. Below the
|
||||||
|
* auto-collapse breakpoint (AppFrame feeds setNarrow) the sidebar toggle
|
||||||
|
* flips the narrowExpanded override instead of the preference.
|
||||||
|
* @returns the store handle (spec + type + identity + factory in one).
|
||||||
|
*/
|
||||||
|
function createLayoutStore() {
|
||||||
|
return (0, _deepseek_ai_dsh_client_runtime_client.defineStore)({
|
||||||
|
init: () => ({
|
||||||
|
sidebar: 280,
|
||||||
|
details: 0,
|
||||||
|
narrow: false,
|
||||||
|
narrowExpanded: false
|
||||||
|
}),
|
||||||
|
actions: {
|
||||||
|
setSidebar: (d, px) => {
|
||||||
|
d.sidebar = clampWidth(px, 264, 420);
|
||||||
|
},
|
||||||
|
setDetails: (d, px) => {
|
||||||
|
d.details = clampWidth(px, 300, 520);
|
||||||
|
},
|
||||||
|
toggleSidebar: (d) => {
|
||||||
|
if (d.narrow) d.narrowExpanded = !d.narrowExpanded;
|
||||||
|
else d.sidebar = d.sidebar === 0 ? 280 : 0;
|
||||||
|
},
|
||||||
|
setNarrow: (d, narrow) => {
|
||||||
|
if (d.narrow === narrow) return;
|
||||||
|
d.narrow = narrow;
|
||||||
|
d.narrowExpanded = false;
|
||||||
|
},
|
||||||
|
openDetails: (d) => {
|
||||||
|
if (d.details === 0) d.details = 360;
|
||||||
|
},
|
||||||
|
closeDetails: (d) => {
|
||||||
|
d.details = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/service.js
|
||||||
|
/** Cross-plugin panel-action face (ctx.layout). */
|
||||||
|
var LayoutController = class {
|
||||||
|
#panels;
|
||||||
|
/**
|
||||||
|
* Adopt the root entry's bound store actions. Called from the root
|
||||||
|
* registration's inject hook (a sanctioned assembly side effect), so the
|
||||||
|
* face is live from the entry's first render; on entry re-register the
|
||||||
|
* fresh actions overwrite the stale set.
|
||||||
|
* @param actions - bound actions of the entry's layout store instance.
|
||||||
|
*/
|
||||||
|
attachPanels(actions) {
|
||||||
|
this.#panels = actions;
|
||||||
|
}
|
||||||
|
/** Toggle the sidebar panel (closed ⟷ contract default width). */
|
||||||
|
toggleSidebar() {
|
||||||
|
this.#require().toggleSidebar();
|
||||||
|
}
|
||||||
|
/** Open the details panel (no-op when already open). */
|
||||||
|
openDetails() {
|
||||||
|
this.#require().openDetails();
|
||||||
|
}
|
||||||
|
/** Close the details panel. */
|
||||||
|
closeDetails() {
|
||||||
|
this.#require().closeDetails();
|
||||||
|
}
|
||||||
|
#require() {
|
||||||
|
if (this.#panels === void 0) throw new Error("layout: panel actions not wired (root entry not mounted)");
|
||||||
|
return this.#panels;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/theme-presenter.js
|
||||||
|
/** Body attribute selecting the dark base palette in the token stylesheets. */
|
||||||
|
const DARK_ATTRIBUTE = "data-ds-dark-theme";
|
||||||
|
/** Applies theme snapshots to the document; one instance per plugin fiber. */
|
||||||
|
var ThemePresenter = class {
|
||||||
|
/** Token names this presenter wrote in the last apply (its retraction set). */
|
||||||
|
appliedTokens = [];
|
||||||
|
/** The single metadata node this presenter inserts and removes. */
|
||||||
|
themeColorMeta;
|
||||||
|
/** Create the presenter-owned metadata node before the first snapshot arrives. */
|
||||||
|
constructor() {
|
||||||
|
this.themeColorMeta = document.createElement("meta");
|
||||||
|
this.themeColorMeta.name = "theme-color";
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Project a snapshot onto the document: set root `color-scheme` and the body
|
||||||
|
* palette attribute from `active.colorScheme` (never the id — `system` is
|
||||||
|
* resolved upstream), then replace the previously applied token variables
|
||||||
|
* with `active.tokens`. Browser theme-color metadata follows the computed
|
||||||
|
* body background after those writes, so the rendered palette remains the
|
||||||
|
* color authority.
|
||||||
|
* @param snapshot - resolved theme snapshot from ctx.theme.
|
||||||
|
*/
|
||||||
|
apply(snapshot) {
|
||||||
|
const scheme = snapshot.active.colorScheme;
|
||||||
|
document.documentElement.style.colorScheme = scheme;
|
||||||
|
const body = document.body;
|
||||||
|
if (scheme === "dark") body.setAttribute(DARK_ATTRIBUTE, "");
|
||||||
|
else body.removeAttribute(DARK_ATTRIBUTE);
|
||||||
|
for (const name of this.appliedTokens) body.style.removeProperty(name);
|
||||||
|
this.appliedTokens = [];
|
||||||
|
for (const [name, value] of Object.entries(snapshot.active.tokens)) {
|
||||||
|
body.style.setProperty(name, value);
|
||||||
|
this.appliedTokens.push(name);
|
||||||
|
}
|
||||||
|
this.themeColorMeta.content = getComputedStyle(body).backgroundColor;
|
||||||
|
if (!this.themeColorMeta.isConnected) document.head.append(this.themeColorMeta);
|
||||||
|
}
|
||||||
|
/** Retract root color-scheme, the palette attribute, token variables, and the owned metadata node. */
|
||||||
|
dispose() {
|
||||||
|
document.documentElement.style.removeProperty("color-scheme");
|
||||||
|
const body = document.body;
|
||||||
|
body.removeAttribute(DARK_ATTRIBUTE);
|
||||||
|
for (const name of this.appliedTokens) body.style.removeProperty(name);
|
||||||
|
this.appliedTokens = [];
|
||||||
|
this.themeColorMeta.remove();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/index.js
|
||||||
|
/** Required services (cordis fiber inject — the loader passes all module exports as an object plugin). */
|
||||||
|
const inject = ["slots", "theme"];
|
||||||
|
/**
|
||||||
|
* Client plugin body: provide ctx.layout, then one register() call — AppFrame
|
||||||
|
* into 'root' with the four child-slot declarations, the layout store seat,
|
||||||
|
* and the inject hook that hands the store's bound actions to the service.
|
||||||
|
* @param ctx - client root context.
|
||||||
|
*/
|
||||||
|
function apply(ctx) {
|
||||||
|
const layout = new LayoutController();
|
||||||
|
ctx.effect(() => {
|
||||||
|
const disposeService = ctx.reflect.provide("layout", layout);
|
||||||
|
const disposeRegistration = ctx.slots.register({
|
||||||
|
name: "root",
|
||||||
|
children: {
|
||||||
|
"sidebar": {
|
||||||
|
kind: "single",
|
||||||
|
scope: "root"
|
||||||
|
},
|
||||||
|
"conversation": {
|
||||||
|
kind: "single",
|
||||||
|
scope: "session-maybe"
|
||||||
|
},
|
||||||
|
"details": {
|
||||||
|
kind: "single",
|
||||||
|
scope: "session"
|
||||||
|
},
|
||||||
|
"shell.overlay": {
|
||||||
|
kind: "list",
|
||||||
|
scope: "root"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
store: createLayoutStore,
|
||||||
|
inject: (actions) => {
|
||||||
|
layout.attachPanels(actions);
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}, AppFrame);
|
||||||
|
return () => {
|
||||||
|
disposeRegistration();
|
||||||
|
disposeService();
|
||||||
|
};
|
||||||
|
}, "ui-layout: service + root registration");
|
||||||
|
ctx.effect(() => {
|
||||||
|
const presenter = new ThemePresenter();
|
||||||
|
presenter.apply(ctx.theme.getTheme());
|
||||||
|
const off = ctx.on("theme/change", (snapshot) => {
|
||||||
|
presenter.apply(snapshot);
|
||||||
|
});
|
||||||
|
return () => {
|
||||||
|
off();
|
||||||
|
presenter.dispose();
|
||||||
|
};
|
||||||
|
}, "ui-layout: theme presenter");
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
exports.LayoutController = LayoutController;
|
||||||
|
exports.apply = apply;
|
||||||
|
exports.inject = inject;
|
||||||
|
return module.exports;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//# sourceMappingURL=client.js.map
|
||||||
@@ -0,0 +1,609 @@
|
|||||||
|
window.__ModuleLoader__.load({
|
||||||
|
id: "@deepseek-ai/dsh-client-ui-settings-general",
|
||||||
|
factory: (require) => {
|
||||||
|
var module = { exports: {} };
|
||||||
|
var exports = module.exports;
|
||||||
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||||
|
let _deepseek_ai_dsh_client_ui_slots = require("@deepseek-ai/dsh-client-ui-slots");
|
||||||
|
let _deepseek_ai_dsh_client_web_react = require("@deepseek-ai/dsh-client-web-react");
|
||||||
|
let react_jsx_runtime = require("react/jsx-runtime");
|
||||||
|
let react = require("react");
|
||||||
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
||||||
|
let _deepseek_ai_dsh_client_runtime_client = require("@deepseek-ai/dsh-client-runtime/client");
|
||||||
|
//#region ../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
||||||
|
function r(e) {
|
||||||
|
var t, f, n = "";
|
||||||
|
if ("string" == typeof e || "number" == typeof e) n += e;
|
||||||
|
else if ("object" == typeof e) if (Array.isArray(e)) {
|
||||||
|
var o = e.length;
|
||||||
|
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
||||||
|
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
function clsx() {
|
||||||
|
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-settings-general/src/client/SettingsRoot.module.css.mjs
|
||||||
|
const css$3 = ".VOzbGW_trigger{box-sizing:border-box;cursor:pointer;width:calc(100% + 8px);height:34px;color:var(--dsw-alias-label-primary);background:0 0;border:none;border-radius:12px;flex:none;align-items:center;gap:8px;margin:4px -4px;padding:6px 2px 6px 10px;font-family:inherit;font-size:14px;line-height:22px;display:flex;overflow:hidden}.VOzbGW_trigger:hover{background:var(--dsw-alias-interactive-bg-hover)}.VOzbGW_trigger.VOzbGW_rail{border-radius:50%;justify-content:center;gap:0;width:36px;height:36px;margin:8px 0 10px;padding:0}.VOzbGW_triggerLabel{white-space:nowrap;overflow:hidden}.VOzbGW_overlay{z-index:1000;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.VOzbGW_mask{background:var(--dsw-alias-bg-mask-1);backdrop-filter:var(--dsw-mask-blur);position:absolute;inset:0}.VOzbGW_panel{z-index:1;background:var(--dsw-alias-bg-layer-2);width:800px;max-width:calc(100vw - 48px);height:min(800px,100vh - 48px);box-shadow:var(--dsw-shadow-lv3);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border-radius:24px;display:flex;position:relative;overflow:hidden}.VOzbGW_nav{box-sizing:border-box;flex-direction:column;flex:none;gap:18px;width:188px;padding:22px 12px 0;display:flex}.VOzbGW_navTitle{color:var(--dsw-alias-label-primary);padding:0 12px;font-size:16px;font-weight:500;line-height:24px}.VOzbGW_navList{flex-direction:column;gap:4px;display:flex}.VOzbGW_navCell{box-sizing:border-box;cursor:pointer;height:40px;color:var(--dsw-alias-label-primary);text-align:left;background:0 0;border:none;border-radius:12px;align-items:center;gap:8px;padding:9px 16px 9px 12px;font-family:inherit;font-size:14px;font-weight:400;line-height:22px;display:flex}.VOzbGW_navCell:hover{background:var(--dsw-specific-sidebar-nav-item-hover)}.VOzbGW_navCell.VOzbGW_active{background:var(--dsw-specific-sidebar-nav-item-active)}.VOzbGW_navIcon{flex:none}.VOzbGW_navLabel{white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;overflow:hidden}.VOzbGW_content{flex-direction:column;flex:1;min-width:0;display:flex}.VOzbGW_header{box-sizing:border-box;flex:none;justify-content:space-between;align-items:flex-start;gap:8px;height:54px;padding:20px 14px 8px 10px;display:flex}.VOzbGW_actions{justify-content:flex-end;align-items:center;gap:8px;min-width:0;margin-left:auto;display:flex}.VOzbGW_close{cursor:pointer;width:28px;height:28px;color:var(--dsw-alias-label-primary);background:0 0;border:none;border-radius:28px;justify-content:center;align-items:center;padding:0;display:inline-flex}.VOzbGW_close:hover{background:var(--dsw-alias-interactive-bg-hover)}.VOzbGW_options{flex:1;min-height:0;padding:0 24px 24px;overflow-y:auto}.VOzbGW_hiddenLabel{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}";
|
||||||
|
const tagId$3 = "@deepseek-ai/dsh-client-ui-settings-general/SettingsRoot.module.css";
|
||||||
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$3) + "]") === null) {
|
||||||
|
const tag = document.createElement("style");
|
||||||
|
tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-settings-general";
|
||||||
|
tag.dataset.pluginCss = tagId$3;
|
||||||
|
tag.textContent = css$3;
|
||||||
|
document.head.appendChild(tag);
|
||||||
|
}
|
||||||
|
var SettingsRoot_module_css_default = {
|
||||||
|
"options": "VOzbGW_options",
|
||||||
|
"navList": "VOzbGW_navList",
|
||||||
|
"panel": "VOzbGW_panel",
|
||||||
|
"actions": "VOzbGW_actions",
|
||||||
|
"navCell": "VOzbGW_navCell",
|
||||||
|
"triggerLabel": "VOzbGW_triggerLabel",
|
||||||
|
"active": "VOzbGW_active",
|
||||||
|
"navLabel": "VOzbGW_navLabel",
|
||||||
|
"navIcon": "VOzbGW_navIcon",
|
||||||
|
"trigger": "VOzbGW_trigger",
|
||||||
|
"content": "VOzbGW_content",
|
||||||
|
"close": "VOzbGW_close",
|
||||||
|
"rail": "VOzbGW_rail",
|
||||||
|
"nav": "VOzbGW_nav",
|
||||||
|
"overlay": "VOzbGW_overlay",
|
||||||
|
"navTitle": "VOzbGW_navTitle",
|
||||||
|
"header": "VOzbGW_header",
|
||||||
|
"hiddenLabel": "VOzbGW_hiddenLabel",
|
||||||
|
"mask": "VOzbGW_mask"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/SettingsRoot.js
|
||||||
|
/**
|
||||||
|
* Settings shell root: the sidebar-foot trigger row plus the centered modal
|
||||||
|
* panel (figma 501:29947, 1080x700) with the section nav rail. The shell is
|
||||||
|
* a pure composition face — every piece of text (trigger label, panel title,
|
||||||
|
* close label, sections) arrives from registrants through slots; accessible
|
||||||
|
* names resolve to that content (trigger: its own text; dialog:
|
||||||
|
* aria-labelledby the title node; close: visually-hidden slot text). Modal
|
||||||
|
* open state and the active section id are component-local viewing state;
|
||||||
|
* the onboarding coordinator mounts exactly one ordered registrant while the
|
||||||
|
* sessions-derived empty-Hero fact is active. Visible dialog chrome belongs
|
||||||
|
* to the step, so a mounted-but-deciding step paints nothing here.
|
||||||
|
*/
|
||||||
|
/** Nav glyph by section id; unknown ids fall back to the settings gear. */
|
||||||
|
function navIcon(id) {
|
||||||
|
if (id === "models") return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconDataOutline16, {
|
||||||
|
className: SettingsRoot_module_css_default.navIcon,
|
||||||
|
size: 16
|
||||||
|
});
|
||||||
|
if (id === "agent-presets") return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconAgentPresetOutline16, {
|
||||||
|
className: SettingsRoot_module_css_default.navIcon,
|
||||||
|
size: 16
|
||||||
|
});
|
||||||
|
if (id === "plugins") return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPersonalizationOutline16, {
|
||||||
|
className: SettingsRoot_module_css_default.navIcon,
|
||||||
|
size: 16
|
||||||
|
});
|
||||||
|
return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconSettingsOutline16, {
|
||||||
|
className: SettingsRoot_module_css_default.navIcon,
|
||||||
|
size: 16
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The modal layer: full-viewport mask + centered panel. Close paths: the
|
||||||
|
* header button, a mask click, and document-level Escape (mounted only while
|
||||||
|
* open, so the listener lifetime is the panel's).
|
||||||
|
*/
|
||||||
|
function SettingsPanel({ rows, renderSlot, activeId, onSelect, onClose }) {
|
||||||
|
const active = rows.find((r) => r.id === activeId)?.id ?? rows[0]?.id;
|
||||||
|
const titleId = (0, react.useId)();
|
||||||
|
(0, react.useEffect)(() => {
|
||||||
|
const onKeyDown = (e) => {
|
||||||
|
if (e.key === "Escape") onClose();
|
||||||
|
};
|
||||||
|
document.addEventListener("keydown", onKeyDown);
|
||||||
|
return () => {
|
||||||
|
document.removeEventListener("keydown", onKeyDown);
|
||||||
|
};
|
||||||
|
}, [onClose]);
|
||||||
|
const closeButton = (0, react.useRef)(null);
|
||||||
|
(0, react.useEffect)(() => {
|
||||||
|
closeButton.current?.focus();
|
||||||
|
}, []);
|
||||||
|
return (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: SettingsRoot_module_css_default.overlay,
|
||||||
|
role: "presentation",
|
||||||
|
children: [(0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: SettingsRoot_module_css_default.mask,
|
||||||
|
"aria-hidden": "true",
|
||||||
|
onClick: onClose
|
||||||
|
}), (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: SettingsRoot_module_css_default.panel,
|
||||||
|
role: "dialog",
|
||||||
|
"aria-modal": "true",
|
||||||
|
"aria-labelledby": titleId,
|
||||||
|
children: [(0, react_jsx_runtime.jsxs)("nav", {
|
||||||
|
className: SettingsRoot_module_css_default.nav,
|
||||||
|
children: [(0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: SettingsRoot_module_css_default.navTitle,
|
||||||
|
id: titleId,
|
||||||
|
children: renderSlot("settings.header", {})
|
||||||
|
}), (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: SettingsRoot_module_css_default.navList,
|
||||||
|
children: rows.map((row) => (0, react_jsx_runtime.jsxs)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: clsx(SettingsRoot_module_css_default.navCell, row.id === active && SettingsRoot_module_css_default.active),
|
||||||
|
"aria-current": row.id === active ? "true" : void 0,
|
||||||
|
onClick: () => {
|
||||||
|
onSelect(row.id);
|
||||||
|
},
|
||||||
|
children: [navIcon(row.id), (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: SettingsRoot_module_css_default.navLabel,
|
||||||
|
children: row.label
|
||||||
|
})]
|
||||||
|
}, row.id))
|
||||||
|
})]
|
||||||
|
}), (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: SettingsRoot_module_css_default.content,
|
||||||
|
children: [(0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: SettingsRoot_module_css_default.header,
|
||||||
|
children: [(0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: SettingsRoot_module_css_default.actions,
|
||||||
|
children: renderSlot("settings.action", {})
|
||||||
|
}), (0, react_jsx_runtime.jsxs)("button", {
|
||||||
|
ref: closeButton,
|
||||||
|
type: "button",
|
||||||
|
className: SettingsRoot_module_css_default.close,
|
||||||
|
onClick: onClose,
|
||||||
|
children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCloseOutline16, { size: 14 }), (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: SettingsRoot_module_css_default.hiddenLabel,
|
||||||
|
children: renderSlot("settings.close", {})
|
||||||
|
})]
|
||||||
|
})]
|
||||||
|
}), (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: SettingsRoot_module_css_default.options,
|
||||||
|
children: active !== void 0 && renderSlot("settings.section", { close: onClose }, { only: active })
|
||||||
|
})]
|
||||||
|
})]
|
||||||
|
})]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Render the settings trigger and panel.
|
||||||
|
* @param props - composed slot props (contract/slots.ts).
|
||||||
|
* @returns the settings shell element tree.
|
||||||
|
*/
|
||||||
|
function SettingsRoot(props) {
|
||||||
|
const { wide, useSections, useOnboardingSteps, useSessions, renderSlot } = props;
|
||||||
|
const [open, setOpen] = (0, react.useState)(false);
|
||||||
|
const [activeId, setActiveId] = (0, react.useState)(void 0);
|
||||||
|
const [completedOnboarding, setCompletedOnboarding] = (0, react.useState)(() => /* @__PURE__ */ new Set());
|
||||||
|
const close = (0, react.useCallback)(() => {
|
||||||
|
setOpen(false);
|
||||||
|
setActiveId(void 0);
|
||||||
|
}, []);
|
||||||
|
const openSection = (0, react.useCallback)((id) => {
|
||||||
|
setActiveId(id);
|
||||||
|
setOpen(true);
|
||||||
|
}, []);
|
||||||
|
const rows = useSections((s) => s);
|
||||||
|
const onboardingSteps = useOnboardingSteps((s) => s);
|
||||||
|
const onboardingActive = useSessions((state) => state.phase === "ready" && (state.current === void 0 || state.byId[state.current]?.blank === true));
|
||||||
|
const onboardingStep = onboardingActive ? onboardingSteps.find((step) => !completedOnboarding.has(step.id)) : void 0;
|
||||||
|
(0, react.useEffect)(() => {
|
||||||
|
if (onboardingActive) return;
|
||||||
|
setCompletedOnboarding(/* @__PURE__ */ new Set());
|
||||||
|
}, [onboardingActive]);
|
||||||
|
const completeOnboardingStep = (0, react.useCallback)((id) => {
|
||||||
|
setCompletedOnboarding((previous) => {
|
||||||
|
if (previous.has(id)) return previous;
|
||||||
|
return new Set([...previous, id]);
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
||||||
|
(0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: clsx(SettingsRoot_module_css_default.trigger, !wide && SettingsRoot_module_css_default.rail),
|
||||||
|
"aria-haspopup": "dialog",
|
||||||
|
"aria-expanded": open,
|
||||||
|
onClick: () => {
|
||||||
|
setOpen(true);
|
||||||
|
},
|
||||||
|
children: renderSlot("settings.trigger", { wide })
|
||||||
|
}),
|
||||||
|
open && (0, react_jsx_runtime.jsx)(SettingsPanel, {
|
||||||
|
rows,
|
||||||
|
renderSlot,
|
||||||
|
activeId,
|
||||||
|
onSelect: setActiveId,
|
||||||
|
onClose: close
|
||||||
|
}),
|
||||||
|
onboardingStep !== void 0 && renderSlot("settings.onboarding", {
|
||||||
|
stepId: onboardingStep.id,
|
||||||
|
complete: () => {
|
||||||
|
completeOnboardingStep(onboardingStep.id);
|
||||||
|
},
|
||||||
|
openSection
|
||||||
|
}, { only: onboardingStep.id })
|
||||||
|
] });
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-settings-general/src/client/chrome.module.css.mjs
|
||||||
|
const css$2 = ".UQsH_q_triggerLabel{white-space:nowrap;overflow:hidden}";
|
||||||
|
const tagId$2 = "@deepseek-ai/dsh-client-ui-settings-general/chrome.module.css";
|
||||||
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
|
||||||
|
const tag = document.createElement("style");
|
||||||
|
tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-settings-general";
|
||||||
|
tag.dataset.pluginCss = tagId$2;
|
||||||
|
tag.textContent = css$2;
|
||||||
|
document.head.appendChild(tag);
|
||||||
|
}
|
||||||
|
var chrome_module_css_default = { "triggerLabel": "UQsH_q_triggerLabel" };
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/chrome.js
|
||||||
|
/**
|
||||||
|
* Shell chrome content registered into the shell's trigger/header seats: the
|
||||||
|
* trigger row icon + label (figma sidebar foot) and the panel title text.
|
||||||
|
* The shell renders the surrounding chrome (button, nav heading row) and
|
||||||
|
* reads each entry's `label` option for aria text.
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* Render the trigger row content (icon; label only in the wide column).
|
||||||
|
* @param props - composed slot props.
|
||||||
|
* @returns the trigger content fragment.
|
||||||
|
*/
|
||||||
|
function TriggerContent({ wide, t }) {
|
||||||
|
return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [wide ? (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconSettingsOutline16, { size: 16 }) : (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconSettingsOutline14, { size: 18 }), wide && (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: chrome_module_css_default.triggerLabel,
|
||||||
|
children: t("trigger")
|
||||||
|
})] });
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Render the panel title text.
|
||||||
|
* @param props - composed slot props.
|
||||||
|
* @returns the title text node.
|
||||||
|
*/
|
||||||
|
function HeaderContent({ t }) {
|
||||||
|
return (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: t("title") });
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Render the close button's visually-hidden label text.
|
||||||
|
* @param props - composed slot props.
|
||||||
|
* @returns the label text node.
|
||||||
|
*/
|
||||||
|
function CloseLabel({ t }) {
|
||||||
|
return (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children: t("close") });
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-settings-general/src/client/GeneralSection.module.css.mjs
|
||||||
|
const css$1 = "._WvWnq_section{flex-direction:column;width:100%;display:flex}._WvWnq_section>[data-slot=\"settings.general.item\"]>:last-child{border-bottom:none}";
|
||||||
|
const tagId$1 = "@deepseek-ai/dsh-client-ui-settings-general/GeneralSection.module.css";
|
||||||
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
|
||||||
|
const tag = document.createElement("style");
|
||||||
|
tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-settings-general";
|
||||||
|
tag.dataset.pluginCss = tagId$1;
|
||||||
|
tag.textContent = css$1;
|
||||||
|
document.head.appendChild(tag);
|
||||||
|
}
|
||||||
|
var GeneralSection_module_css_default = { "section": "_WvWnq_section" };
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/GeneralSection.js
|
||||||
|
/**
|
||||||
|
* Render the General section content column.
|
||||||
|
* @param props - composed slot props (contract/slots.ts).
|
||||||
|
* @returns the section element tree.
|
||||||
|
*/
|
||||||
|
function GeneralSection({ renderSlot }) {
|
||||||
|
return (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: GeneralSection_module_css_default.section,
|
||||||
|
children: renderSlot("settings.general.item", {})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-settings-general/src/client/SettingsDocumentAction.module.css.mjs
|
||||||
|
const css = ".me01iq_action{align-items:center;gap:8px;min-width:0;display:flex}.me01iq_error{max-width:180px;color:var(--dsw-alias-state-error-primary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:18px;overflow:hidden}";
|
||||||
|
const tagId = "@deepseek-ai/dsh-client-ui-settings-general/SettingsDocumentAction.module.css";
|
||||||
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
||||||
|
const tag = document.createElement("style");
|
||||||
|
tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-settings-general";
|
||||||
|
tag.dataset.pluginCss = tagId;
|
||||||
|
tag.textContent = css;
|
||||||
|
document.head.appendChild(tag);
|
||||||
|
}
|
||||||
|
var SettingsDocumentAction_module_css_default = {
|
||||||
|
"error": "me01iq_error",
|
||||||
|
"action": "me01iq_action"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/SettingsDocumentAction.js
|
||||||
|
/** Optional settings-header action for opening a file-backed Host document. */
|
||||||
|
/**
|
||||||
|
* Render the open-document action only after Host metadata confirms document availability.
|
||||||
|
* @param props - header owner props, localized copy, and injected document state.
|
||||||
|
* @returns the action, or null while unavailable or unresolved.
|
||||||
|
*/
|
||||||
|
function SettingsDocumentAction({ controller, useSnapshot, t }) {
|
||||||
|
const state = useSnapshot((snapshot) => snapshot);
|
||||||
|
(0, react.useEffect)(() => {
|
||||||
|
controller.load();
|
||||||
|
}, [controller]);
|
||||||
|
if (state.status !== "ready") return null;
|
||||||
|
return (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: SettingsDocumentAction_module_css_default.action,
|
||||||
|
children: [state.error === null ? null : (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: SettingsDocumentAction_module_css_default.error,
|
||||||
|
role: "alert",
|
||||||
|
children: t("openDocument.error")
|
||||||
|
}), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
||||||
|
variant: "outline",
|
||||||
|
size: "sm",
|
||||||
|
disabled: state.opening,
|
||||||
|
onClick: () => {
|
||||||
|
controller.open();
|
||||||
|
},
|
||||||
|
children: t("openDocument")
|
||||||
|
})]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/settings-document-store.js
|
||||||
|
/** State owner for the optional local settings-document action. */
|
||||||
|
function messageOf(error) {
|
||||||
|
return error instanceof Error ? error.message : String(error);
|
||||||
|
}
|
||||||
|
/** Loads local-document availability and invokes the pathless Host-owned open operation. */
|
||||||
|
var SettingsDocumentStore = class {
|
||||||
|
api;
|
||||||
|
/** uSES-safe state source shared by the registered header action. */
|
||||||
|
store = (0, _deepseek_ai_dsh_client_runtime_client.createSnapshotStore)({
|
||||||
|
status: "idle",
|
||||||
|
opening: false,
|
||||||
|
error: null
|
||||||
|
});
|
||||||
|
generation = 0;
|
||||||
|
/**
|
||||||
|
* @param api - loopback settings wire face that reports and opens the provider document.
|
||||||
|
*/
|
||||||
|
constructor(api) {
|
||||||
|
this.api = api;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Load whether the current provider owns a local document.
|
||||||
|
* @returns after the latest metadata response updates the store.
|
||||||
|
*/
|
||||||
|
async load() {
|
||||||
|
const generation = ++this.generation;
|
||||||
|
this.store.update((state) => {
|
||||||
|
state.status = "loading";
|
||||||
|
state.error = null;
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
const { result } = await this.api.settings.describe({});
|
||||||
|
if (generation !== this.generation) return;
|
||||||
|
if (!result.ok) {
|
||||||
|
this.store.update((state) => {
|
||||||
|
state.status = "unavailable";
|
||||||
|
state.error = result.error.message;
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.store.update((state) => {
|
||||||
|
state.status = result.value.hasDocument ? "ready" : "unavailable";
|
||||||
|
state.error = null;
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
if (generation !== this.generation) return;
|
||||||
|
this.store.update((state) => {
|
||||||
|
state.status = "unavailable";
|
||||||
|
state.error = messageOf(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Open the loaded document once; concurrent gestures collapse behind the in-flight action.
|
||||||
|
* @returns after the native-open request settles, or immediately when unavailable/already opening.
|
||||||
|
*/
|
||||||
|
async open() {
|
||||||
|
const current = this.store.getSnapshot();
|
||||||
|
if (current.status !== "ready" || current.opening) return;
|
||||||
|
this.store.update((state) => {
|
||||||
|
state.opening = true;
|
||||||
|
state.error = null;
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
const response = await this.api.settings.openDocument({});
|
||||||
|
if (!response.result.ok) throw new Error(response.result.error.message);
|
||||||
|
} catch (error) {
|
||||||
|
this.store.update((state) => {
|
||||||
|
state.error = messageOf(error);
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
|
this.store.update((state) => {
|
||||||
|
state.opening = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Refresh document availability after reconnect only when a surface has already requested it.
|
||||||
|
* @param controller - optional loopback document state owner.
|
||||||
|
*/
|
||||||
|
function refreshDocumentIfLoaded(controller) {
|
||||||
|
if (controller === void 0 || controller.store.getSnapshot().status === "idle") return;
|
||||||
|
controller.load();
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/locales.js
|
||||||
|
/** Shell chrome and General-nav dictionaries; feature rows own their copy. */
|
||||||
|
/** Simplified Chinese dictionary (the key-set source of truth). */
|
||||||
|
const zh = {
|
||||||
|
"trigger": "设置",
|
||||||
|
"title": "设置",
|
||||||
|
"close": "关闭",
|
||||||
|
"openDocument": "打开配置文件",
|
||||||
|
"openDocument.error": "无法打开配置文件",
|
||||||
|
"general.nav": "通用设置"
|
||||||
|
};
|
||||||
|
/** English dictionary, checked complete against the zh key set. */
|
||||||
|
const en = {
|
||||||
|
"trigger": "Settings",
|
||||||
|
"title": "Settings",
|
||||||
|
"close": "Close",
|
||||||
|
"openDocument": "Open configuration file",
|
||||||
|
"openDocument.error": "Could not open configuration file",
|
||||||
|
"general.nav": "General"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/index.js
|
||||||
|
/** Dictionary namespace owned by this plugin (shell chrome + General copy). */
|
||||||
|
const NS = "settings";
|
||||||
|
/**
|
||||||
|
* Required services (cordis fiber inject). The target slots are declared by
|
||||||
|
* ui-settings' apply, whose activation order relative to this one is NOT
|
||||||
|
* constrained; registrations depend on their slots through `slots.inject()`.
|
||||||
|
*/
|
||||||
|
const inject = [
|
||||||
|
"slots",
|
||||||
|
"locale",
|
||||||
|
"connection"
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* Register the `settings` dictionaries, the chrome content, and the General
|
||||||
|
* section, each once its slot declaration is on the ledger.
|
||||||
|
* @param ctx - client root context.
|
||||||
|
*/
|
||||||
|
function apply(ctx) {
|
||||||
|
ctx.effect(() => ctx.locale.register(NS, {
|
||||||
|
zh,
|
||||||
|
en
|
||||||
|
}), "ui-settings-general: dictionaries");
|
||||||
|
const t = ctx.locale.bind(NS);
|
||||||
|
const connection = ctx.get("connection");
|
||||||
|
const documentController = connection.isLoopback ? new SettingsDocumentStore(connection.api) : void 0;
|
||||||
|
const documentInjected = documentController === void 0 ? void 0 : (() => {
|
||||||
|
const useSnapshot = (0, _deepseek_ai_dsh_client_web_react.bindSnapshotSelector)(documentController.store);
|
||||||
|
return () => ({
|
||||||
|
controller: documentController,
|
||||||
|
useSnapshot
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
ctx.effect(() => ctx.on("connection/reset", () => {
|
||||||
|
refreshDocumentIfLoaded(documentController);
|
||||||
|
}), "ui-settings-general: metadata invalidations");
|
||||||
|
let rowsVersion = -1;
|
||||||
|
let rowsRevision = -1;
|
||||||
|
let rows = [];
|
||||||
|
let onboardingVersion = -1;
|
||||||
|
let onboardingSteps = [];
|
||||||
|
const shellInjected = () => ({ hooks: {
|
||||||
|
sections: {
|
||||||
|
getSnapshot: () => {
|
||||||
|
const version = ctx.slots.getVersion("settings.section");
|
||||||
|
const revision = ctx.locale.getSnapshot().revision;
|
||||||
|
if (version !== rowsVersion || revision !== rowsRevision) {
|
||||||
|
rowsVersion = version;
|
||||||
|
rowsRevision = revision;
|
||||||
|
rows = ctx.slots.entries("settings.section").map((e) => ({
|
||||||
|
/* v8 ignore next -- list-slot registration requires id (SlotCore rejects an entry without one) */
|
||||||
|
id: e.options.id ?? "",
|
||||||
|
order: e.options.order ?? 0,
|
||||||
|
label: (0, _deepseek_ai_dsh_client_ui_slots.resolveSlotLabel)(e.options.label) ?? ""
|
||||||
|
})).sort((a, b) => a.order - b.order);
|
||||||
|
}
|
||||||
|
return rows;
|
||||||
|
},
|
||||||
|
subscribe: (listener) => {
|
||||||
|
const offLedger = ctx.slots.subscribe("settings.section", listener);
|
||||||
|
const offLocale = ctx.locale.subscribe(listener);
|
||||||
|
return () => {
|
||||||
|
offLedger();
|
||||||
|
offLocale();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onboardingSteps: {
|
||||||
|
getSnapshot: () => {
|
||||||
|
const version = ctx.slots.getVersion("settings.onboarding");
|
||||||
|
if (version !== onboardingVersion) {
|
||||||
|
onboardingVersion = version;
|
||||||
|
onboardingSteps = ctx.slots.entries("settings.onboarding").map((e) => ({
|
||||||
|
/* v8 ignore next -- list-slot registration requires id */
|
||||||
|
id: e.options.id ?? "",
|
||||||
|
order: e.options.order ?? 0
|
||||||
|
})).sort((a, b) => a.order - b.order);
|
||||||
|
}
|
||||||
|
return onboardingSteps;
|
||||||
|
},
|
||||||
|
subscribe: (listener) => ctx.slots.subscribe("settings.onboarding", listener)
|
||||||
|
}
|
||||||
|
} });
|
||||||
|
ctx.slots.inject("sidebar.settings", () => ctx.slots.register({
|
||||||
|
name: "sidebar.settings",
|
||||||
|
children: {
|
||||||
|
"settings.trigger": {
|
||||||
|
kind: "single",
|
||||||
|
scope: "root"
|
||||||
|
},
|
||||||
|
"settings.header": {
|
||||||
|
kind: "single",
|
||||||
|
scope: "root"
|
||||||
|
},
|
||||||
|
"settings.action": {
|
||||||
|
kind: "list",
|
||||||
|
scope: "root"
|
||||||
|
},
|
||||||
|
"settings.close": {
|
||||||
|
kind: "single",
|
||||||
|
scope: "root"
|
||||||
|
},
|
||||||
|
"settings.section": {
|
||||||
|
kind: "list",
|
||||||
|
scope: "root"
|
||||||
|
},
|
||||||
|
"settings.onboarding": {
|
||||||
|
kind: "list",
|
||||||
|
scope: "root"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
inject: shellInjected
|
||||||
|
}, SettingsRoot));
|
||||||
|
ctx.slots.inject("settings.trigger", () => ctx.slots.register({
|
||||||
|
name: "settings.trigger",
|
||||||
|
locale: NS
|
||||||
|
}, TriggerContent));
|
||||||
|
ctx.slots.inject("settings.header", () => ctx.slots.register({
|
||||||
|
name: "settings.header",
|
||||||
|
locale: NS
|
||||||
|
}, HeaderContent));
|
||||||
|
if (documentInjected !== void 0) ctx.slots.inject("settings.action", () => ctx.slots.register({
|
||||||
|
name: "settings.action",
|
||||||
|
id: "open-document",
|
||||||
|
order: 0,
|
||||||
|
locale: NS,
|
||||||
|
inject: documentInjected
|
||||||
|
}, SettingsDocumentAction));
|
||||||
|
ctx.slots.inject("settings.close", () => ctx.slots.register({
|
||||||
|
name: "settings.close",
|
||||||
|
locale: NS
|
||||||
|
}, CloseLabel));
|
||||||
|
ctx.slots.inject("settings.section", () => ctx.slots.register({
|
||||||
|
name: "settings.section",
|
||||||
|
id: "general",
|
||||||
|
order: 0,
|
||||||
|
label: () => t("general.nav"),
|
||||||
|
locale: NS,
|
||||||
|
children: { "settings.general.item": {
|
||||||
|
kind: "list",
|
||||||
|
scope: "root"
|
||||||
|
} }
|
||||||
|
}, GeneralSection));
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
exports.SettingsDocumentStore = SettingsDocumentStore;
|
||||||
|
exports.apply = apply;
|
||||||
|
exports.inject = inject;
|
||||||
|
return module.exports;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//# sourceMappingURL=client.js.map
|
||||||
@@ -0,0 +1,302 @@
|
|||||||
|
window.__ModuleLoader__.load({
|
||||||
|
id: "@deepseek-ai/dsh-client-ui-settings-plugin-inventory",
|
||||||
|
factory: (require) => {
|
||||||
|
var module = { exports: {} };
|
||||||
|
var exports = module.exports;
|
||||||
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||||
|
let react_jsx_runtime = require("react/jsx-runtime");
|
||||||
|
let react = require("react");
|
||||||
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
||||||
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-settings-plugin-inventory/src/client/PluginInventorySettingsTab.module.css.mjs
|
||||||
|
const css = ".qSYn7G_section{width:100%;max-width:760px;color:var(--dsw-alias-label-primary);flex-direction:column;gap:14px;display:flex}.qSYn7G_catalogHeading h3,.qSYn7G_status,.qSYn7G_failure p{margin:0}.qSYn7G_status,.qSYn7G_failure{color:var(--dsw-alias-label-tertiary);font-size:13px;line-height:20px}.qSYn7G_failure{color:var(--dsw-alias-state-error-primary);align-items:center;gap:10px;display:flex}.qSYn7G_failure button{border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;background:0 0;border-radius:6px;padding:4px 10px}.qSYn7G_catalog{flex-direction:column;gap:12px;display:flex}.qSYn7G_search{width:100%;color:var(--dsw-alias-label-tertiary);align-items:center;display:flex;position:relative}.qSYn7G_search>svg{pointer-events:none;position:absolute;left:12px}.qSYn7G_search input{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);width:100%;height:36px;color:var(--dsw-alias-label-primary);font:inherit;border-radius:8px;outline:none;padding:0 34px 0 36px;font-size:13px}.qSYn7G_search input::placeholder{color:var(--dsw-alias-label-tertiary)}.qSYn7G_search input:focus-visible{border-color:var(--dsw-alias-state-business-primary);box-shadow:0 0 0 2px color-mix(in srgb, var(--dsw-alias-state-business-primary) 18%, transparent)}.qSYn7G_catalogHeading{align-items:baseline;gap:7px;padding:0 2px;display:flex}.qSYn7G_catalogHeading h3{font-size:13px;font-weight:600;line-height:20px}.qSYn7G_catalogHeading span{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:12px;line-height:18px}.qSYn7G_cards{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:10px;margin:0;padding:0;list-style:none;display:grid}.qSYn7G_card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:10px;min-width:0;overflow:hidden}.qSYn7G_card[data-open=true]{border-color:var(--dsw-alias-border-l1);box-shadow:var(--dsw-shadow-lv1)}.qSYn7G_cardContent{box-sizing:border-box;width:100%;min-height:52px;color:inherit;font:inherit;text-align:left;cursor:pointer;background:0 0;border:0;justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;display:flex}.qSYn7G_cardContent:hover,.qSYn7G_card[data-open=true]>.qSYn7G_cardContent{background:var(--dsw-alias-interactive-bg-hover)}.qSYn7G_cardContent:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}.qSYn7G_cardTitle{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:14px;font-weight:600;line-height:20px;overflow:hidden}.qSYn7G_cardTrailing{color:var(--dsw-alias-label-tertiary);flex:none;align-items:center;gap:7px;display:inline-flex}.qSYn7G_statusDot{background:var(--dsw-alias-label-tertiary);border-radius:999px;flex:none;width:7px;height:7px;display:inline-block}.qSYn7G_statusDot[data-phase=active]{background:var(--dsw-alias-state-success-primary)}.qSYn7G_statusDot[data-phase=failed]{background:var(--dsw-alias-state-error-primary)}.qSYn7G_statusDot[data-phase=loading]{background:var(--dsw-alias-state-business-primary)}.qSYn7G_configTag{background:var(--dsw-alias-bg-layer-1);min-height:20px;color:var(--dsw-alias-label-secondary);white-space:nowrap;border-radius:5px;align-items:center;padding:1px 6px;font-size:11px;line-height:16px;display:inline-flex}.qSYn7G_configTag[data-enabled=true]{background:color-mix(in srgb, var(--dsw-alias-state-success-primary) 10%, transparent);color:var(--dsw-alias-state-success-primary)}.qSYn7G_chevron{color:var(--dsw-alias-label-tertiary);flex:none}.qSYn7G_card[data-open=true] .qSYn7G_chevron{transform:rotate(180deg)}.qSYn7G_cardDetails{border-top:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-module-platform);padding:10px 14px 12px}.qSYn7G_entryValue{overflow-wrap:anywhere;color:var(--dsw-alias-label-primary);font-family:var(--ds-font-family-code);font-size:12px;line-height:18px;display:block}.qSYn7G_details{grid-template-columns:76px minmax(0,1fr);gap:6px 10px;margin:8px 0 0;display:grid}.qSYn7G_details div{display:contents}.qSYn7G_details dt{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:17px}.qSYn7G_details dd{overflow-wrap:anywhere;min-width:0;color:var(--dsw-alias-label-secondary);margin:0;font-size:12px;line-height:17px}.qSYn7G_visuallyHidden{clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}@media (prefers-reduced-motion:no-preference){.qSYn7G_chevron{transition:transform .14s var(--ds-ease-in-out)}}@media (width<=680px){.qSYn7G_cards{grid-template-columns:minmax(0,1fr)}}";
|
||||||
|
const tagId = "@deepseek-ai/dsh-client-ui-settings-plugin-inventory/PluginInventorySettingsTab.module.css";
|
||||||
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
||||||
|
const tag = document.createElement("style");
|
||||||
|
tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-settings-plugin-inventory";
|
||||||
|
tag.dataset.pluginCss = tagId;
|
||||||
|
tag.textContent = css;
|
||||||
|
document.head.appendChild(tag);
|
||||||
|
}
|
||||||
|
var PluginInventorySettingsTab_module_css_default = {
|
||||||
|
"cardContent": "qSYn7G_cardContent",
|
||||||
|
"visuallyHidden": "qSYn7G_visuallyHidden",
|
||||||
|
"configTag": "qSYn7G_configTag",
|
||||||
|
"search": "qSYn7G_search",
|
||||||
|
"catalogHeading": "qSYn7G_catalogHeading",
|
||||||
|
"cards": "qSYn7G_cards",
|
||||||
|
"chevron": "qSYn7G_chevron",
|
||||||
|
"cardTrailing": "qSYn7G_cardTrailing",
|
||||||
|
"status": "qSYn7G_status",
|
||||||
|
"section": "qSYn7G_section",
|
||||||
|
"catalog": "qSYn7G_catalog",
|
||||||
|
"cardTitle": "qSYn7G_cardTitle",
|
||||||
|
"entryValue": "qSYn7G_entryValue",
|
||||||
|
"failure": "qSYn7G_failure",
|
||||||
|
"statusDot": "qSYn7G_statusDot",
|
||||||
|
"cardDetails": "qSYn7G_cardDetails",
|
||||||
|
"details": "qSYn7G_details",
|
||||||
|
"card": "qSYn7G_card"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/PluginInventorySettingsTab.js
|
||||||
|
const PHASE_KEYS = {
|
||||||
|
pending: "pending",
|
||||||
|
loading: "loadingPhase",
|
||||||
|
active: "active",
|
||||||
|
failed: "failed",
|
||||||
|
unloading: "unloading"
|
||||||
|
};
|
||||||
|
/** Localized accessible label for one root Fiber phase. */
|
||||||
|
function phaseLabel(phase, t) {
|
||||||
|
return phase === null ? t("unobserved") : t(PHASE_KEYS[phase]);
|
||||||
|
}
|
||||||
|
/** Compact a module specifier without guessing whether its Loader id was generated. */
|
||||||
|
function moduleShortName(moduleName) {
|
||||||
|
return (moduleName.startsWith("@") ? moduleName.slice(moduleName.indexOf("/") + 1) : moduleName).replace(/^cordis:/, "").replace(/^cordis-plugin-/, "").replace(/^dsh-(?:host-|client-)?/, "");
|
||||||
|
}
|
||||||
|
/** Whether an inventory row matches the local catalog query. */
|
||||||
|
function matches(entry, normalizedQuery) {
|
||||||
|
if (normalizedQuery.length === 0) return true;
|
||||||
|
return [entry.moduleName, entry.entryId].some((value) => value.toLocaleLowerCase().includes(normalizedQuery));
|
||||||
|
}
|
||||||
|
/** Render the read-only current Loader inventory. */
|
||||||
|
function PluginInventorySettingsTab({ list, t }) {
|
||||||
|
const catalogId = (0, react.useId)();
|
||||||
|
const [request, setRequest] = (0, react.useState)(0);
|
||||||
|
const [query, setQuery] = (0, react.useState)("");
|
||||||
|
const [expanded, setExpanded] = (0, react.useState)(null);
|
||||||
|
const [state, setState] = (0, react.useState)({ status: "loading" });
|
||||||
|
(0, react.useEffect)(() => {
|
||||||
|
let current = true;
|
||||||
|
Promise.resolve().then(() => list()).then((snapshot) => {
|
||||||
|
if (current) setState({
|
||||||
|
status: "ready",
|
||||||
|
snapshot
|
||||||
|
});
|
||||||
|
}, () => {
|
||||||
|
if (current) setState({ status: "error" });
|
||||||
|
});
|
||||||
|
return () => {
|
||||||
|
current = false;
|
||||||
|
};
|
||||||
|
}, [list, request]);
|
||||||
|
const normalizedQuery = query.trim().toLocaleLowerCase();
|
||||||
|
const filteredEntries = (0, react.useMemo)(() => state.status === "ready" ? state.snapshot.entries.filter((entry) => matches(entry, normalizedQuery)) : [], [normalizedQuery, state]);
|
||||||
|
(0, react.useEffect)(() => {
|
||||||
|
if (expanded !== null && !filteredEntries.some((entry) => entry.entryId === expanded)) setExpanded(null);
|
||||||
|
}, [expanded, filteredEntries]);
|
||||||
|
const retry = () => {
|
||||||
|
setState({ status: "loading" });
|
||||||
|
setRequest((value) => value + 1);
|
||||||
|
};
|
||||||
|
return (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: PluginInventorySettingsTab_module_css_default.section,
|
||||||
|
"aria-busy": state.status === "loading",
|
||||||
|
children: [
|
||||||
|
state.status === "loading" ? (0, react_jsx_runtime.jsx)("p", {
|
||||||
|
className: PluginInventorySettingsTab_module_css_default.status,
|
||||||
|
children: t("loading")
|
||||||
|
}) : null,
|
||||||
|
state.status === "error" ? (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: PluginInventorySettingsTab_module_css_default.failure,
|
||||||
|
children: [(0, react_jsx_runtime.jsx)("p", {
|
||||||
|
role: "alert",
|
||||||
|
children: t("error")
|
||||||
|
}), (0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
onClick: retry,
|
||||||
|
children: t("retry")
|
||||||
|
})]
|
||||||
|
}) : null,
|
||||||
|
state.status === "ready" ? (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: PluginInventorySettingsTab_module_css_default.catalog,
|
||||||
|
children: [
|
||||||
|
(0, react_jsx_runtime.jsxs)("label", {
|
||||||
|
className: PluginInventorySettingsTab_module_css_default.search,
|
||||||
|
children: [
|
||||||
|
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconSearchOutline16, { "aria-hidden": "true" }),
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: PluginInventorySettingsTab_module_css_default.visuallyHidden,
|
||||||
|
children: t("search")
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)("input", {
|
||||||
|
type: "search",
|
||||||
|
value: query,
|
||||||
|
placeholder: t("search"),
|
||||||
|
"aria-label": t("search"),
|
||||||
|
onChange: (event) => {
|
||||||
|
setQuery(event.currentTarget.value);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: PluginInventorySettingsTab_module_css_default.catalogHeading,
|
||||||
|
children: [(0, react_jsx_runtime.jsx)("h3", { children: t("catalog") }), (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
"data-plugin-count": filteredEntries.length,
|
||||||
|
children: filteredEntries.length
|
||||||
|
})]
|
||||||
|
}),
|
||||||
|
state.snapshot.entries.length === 0 ? (0, react_jsx_runtime.jsx)("p", {
|
||||||
|
className: PluginInventorySettingsTab_module_css_default.status,
|
||||||
|
children: t("empty")
|
||||||
|
}) : null,
|
||||||
|
state.snapshot.entries.length > 0 && filteredEntries.length === 0 ? (0, react_jsx_runtime.jsx)("p", {
|
||||||
|
className: PluginInventorySettingsTab_module_css_default.status,
|
||||||
|
children: t("emptySearch")
|
||||||
|
}) : null,
|
||||||
|
filteredEntries.length > 0 ? (0, react_jsx_runtime.jsx)("ul", {
|
||||||
|
className: PluginInventorySettingsTab_module_css_default.cards,
|
||||||
|
children: filteredEntries.map((entry) => {
|
||||||
|
const status = phaseLabel(entry.fiberPhase, t);
|
||||||
|
const title = moduleShortName(entry.moduleName);
|
||||||
|
const configuration = t(entry.enabled ? "enabledTag" : "disabledTag");
|
||||||
|
const open = expanded === entry.entryId;
|
||||||
|
const detailId = `${catalogId}-details-${encodeURIComponent(entry.entryId)}`;
|
||||||
|
return (0, react_jsx_runtime.jsxs)("li", {
|
||||||
|
className: PluginInventorySettingsTab_module_css_default.card,
|
||||||
|
"data-plugin-entry": entry.entryId,
|
||||||
|
"data-open": open ? "true" : void 0,
|
||||||
|
children: [(0, react_jsx_runtime.jsxs)("button", {
|
||||||
|
className: PluginInventorySettingsTab_module_css_default.cardContent,
|
||||||
|
type: "button",
|
||||||
|
"aria-expanded": open,
|
||||||
|
"aria-controls": detailId,
|
||||||
|
"aria-label": entry.enabled ? `${title}, ${status}, ${configuration}` : `${title}, ${configuration}`,
|
||||||
|
onClick: () => {
|
||||||
|
setExpanded((current) => current === entry.entryId ? null : entry.entryId);
|
||||||
|
},
|
||||||
|
children: [(0, react_jsx_runtime.jsx)("strong", {
|
||||||
|
className: PluginInventorySettingsTab_module_css_default.cardTitle,
|
||||||
|
title: entry.moduleName,
|
||||||
|
children: title
|
||||||
|
}), (0, react_jsx_runtime.jsxs)("span", {
|
||||||
|
className: PluginInventorySettingsTab_module_css_default.cardTrailing,
|
||||||
|
children: [
|
||||||
|
entry.enabled ? (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: PluginInventorySettingsTab_module_css_default.statusDot,
|
||||||
|
"data-phase": entry.fiberPhase ?? "unobserved",
|
||||||
|
role: "img",
|
||||||
|
"aria-label": status,
|
||||||
|
title: status
|
||||||
|
}) : null,
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: PluginInventorySettingsTab_module_css_default.configTag,
|
||||||
|
"data-enabled": entry.enabled ? "true" : "false",
|
||||||
|
children: configuration
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, {
|
||||||
|
className: PluginInventorySettingsTab_module_css_default.chevron,
|
||||||
|
size: 12,
|
||||||
|
"aria-hidden": "true"
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})]
|
||||||
|
}), open ? (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: PluginInventorySettingsTab_module_css_default.cardDetails,
|
||||||
|
id: detailId,
|
||||||
|
children: [(0, react_jsx_runtime.jsx)("code", {
|
||||||
|
className: PluginInventorySettingsTab_module_css_default.entryValue,
|
||||||
|
"data-loader-entry": true,
|
||||||
|
children: entry.entryId
|
||||||
|
}), (0, react_jsx_runtime.jsxs)("dl", {
|
||||||
|
className: PluginInventorySettingsTab_module_css_default.details,
|
||||||
|
children: [(0, react_jsx_runtime.jsxs)("div", { children: [(0, react_jsx_runtime.jsx)("dt", { children: t("configuration") }), (0, react_jsx_runtime.jsx)("dd", { children: configuration })] }), entry.enabled ? (0, react_jsx_runtime.jsxs)("div", { children: [(0, react_jsx_runtime.jsx)("dt", { children: t("cordis") }), (0, react_jsx_runtime.jsx)("dd", { children: status })] }) : null]
|
||||||
|
})]
|
||||||
|
}) : null]
|
||||||
|
}, entry.entryId);
|
||||||
|
})
|
||||||
|
}) : null
|
||||||
|
]
|
||||||
|
}) : null
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/locales.js
|
||||||
|
/** Copy dictionaries for the plugin inventory Settings section. */
|
||||||
|
/** Simplified Chinese dictionary and key source of truth. */
|
||||||
|
const zh = {
|
||||||
|
tab: "插件列表",
|
||||||
|
loading: "正在读取插件…",
|
||||||
|
error: "暂时无法读取插件。",
|
||||||
|
retry: "重试",
|
||||||
|
search: "搜索插件",
|
||||||
|
catalog: "插件列表",
|
||||||
|
empty: "暂无插件。",
|
||||||
|
emptySearch: "没有匹配的插件。",
|
||||||
|
enabledTag: "已启用",
|
||||||
|
disabledTag: "已停用",
|
||||||
|
configuration: "配置状态",
|
||||||
|
cordis: "Cordis 状态",
|
||||||
|
unobserved: "未挂载",
|
||||||
|
pending: "等待依赖",
|
||||||
|
loadingPhase: "加载中",
|
||||||
|
active: "已挂载",
|
||||||
|
failed: "挂载失败",
|
||||||
|
unloading: "卸载中"
|
||||||
|
};
|
||||||
|
/** English dictionary checked against the Chinese key set. */
|
||||||
|
const en = {
|
||||||
|
tab: "Plugin list",
|
||||||
|
loading: "Reading plugins…",
|
||||||
|
error: "Plugins are temporarily unavailable.",
|
||||||
|
retry: "Retry",
|
||||||
|
search: "Search plugins",
|
||||||
|
catalog: "Plugin list",
|
||||||
|
empty: "No plugins are available.",
|
||||||
|
emptySearch: "No matching plugins.",
|
||||||
|
enabledTag: "Enabled",
|
||||||
|
disabledTag: "Disabled",
|
||||||
|
configuration: "Configuration",
|
||||||
|
cordis: "Cordis status",
|
||||||
|
unobserved: "Not mounted",
|
||||||
|
pending: "Waiting for dependencies",
|
||||||
|
loadingPhase: "Loading",
|
||||||
|
active: "Mounted",
|
||||||
|
failed: "Mount failed",
|
||||||
|
unloading: "Unloading"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/index.js
|
||||||
|
/** Read-only Host plugin inventory registered into Web Settings. */
|
||||||
|
/** Dictionary namespace owned by this plugin. */
|
||||||
|
const NS = "settings.pluginInventory";
|
||||||
|
/** Services required by the Settings registration and generated Remote face. */
|
||||||
|
const inject = [
|
||||||
|
"slots",
|
||||||
|
"locale",
|
||||||
|
"remote",
|
||||||
|
"remote.pluginInventory"
|
||||||
|
];
|
||||||
|
/** Contribute the lazy inventory tab to the Plugins settings section. */
|
||||||
|
function apply(ctx) {
|
||||||
|
ctx.effect(() => ctx.locale.register(NS, {
|
||||||
|
zh,
|
||||||
|
en
|
||||||
|
}), "ui-settings-plugin-inventory: dictionaries");
|
||||||
|
const t = ctx.locale.bind(NS);
|
||||||
|
const list = async () => {
|
||||||
|
const result = await ctx.remote.pluginInventory.list();
|
||||||
|
if (!result.ok) throw new Error(`pluginInventory.list failed: ${result.error.code}: ${result.error.message}`);
|
||||||
|
return result.value;
|
||||||
|
};
|
||||||
|
const injected = () => ({ list });
|
||||||
|
ctx.slots.inject("settings.plugins.tab", () => ctx.slots.register({
|
||||||
|
name: "settings.plugins.tab",
|
||||||
|
id: "all",
|
||||||
|
order: 10,
|
||||||
|
label: () => t("tab"),
|
||||||
|
locale: NS,
|
||||||
|
inject: injected
|
||||||
|
}, PluginInventorySettingsTab));
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
exports.NS = NS;
|
||||||
|
exports.apply = apply;
|
||||||
|
exports.inject = inject;
|
||||||
|
return module.exports;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//# sourceMappingURL=client.js.map
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,474 @@
|
|||||||
|
window.__ModuleLoader__.load({
|
||||||
|
id: "@deepseek-ai/dsh-client-ui-workflow-run",
|
||||||
|
factory: (require) => {
|
||||||
|
var module = { exports: {} };
|
||||||
|
var exports = module.exports;
|
||||||
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||||
|
let react_jsx_runtime = require("react/jsx-runtime");
|
||||||
|
let react = require("react");
|
||||||
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
||||||
|
let _deepseek_ai_dsh_client_runtime_client = require("@deepseek-ai/dsh-client-runtime/client");
|
||||||
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-workflow-run/src/client/WorkflowRunPanel.module.css.mjs
|
||||||
|
const css = ".DBuyfa_root{width:100%;min-width:0}.DBuyfa_runHeader{box-sizing:border-box;background:var(--dsw-alias-bg-module-platform);border-radius:8px;align-items:center;gap:6px;width:100%;min-width:0;height:32px;padding:0 8px;display:flex}.DBuyfa_runHeader:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}.DBuyfa_runLeading{width:16px;height:16px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;margin-right:0;display:inline-flex}.DBuyfa_runTitle{max-width:42%;color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;flex:none;font-size:14px;font-weight:510;line-height:24px;overflow:hidden}.DBuyfa_runSummary{min-width:0;color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:12px;line-height:18px;overflow:hidden}.DBuyfa_statusTail{height:20px;color:var(--dsw-alias-label-secondary);white-space:nowrap;flex:none;align-items:center;gap:4px;font-size:11px;font-weight:510;line-height:16px;display:inline-flex;overflow:hidden}.DBuyfa_phaseHeader{box-sizing:border-box;align-items:center;gap:6px;width:100%;min-width:0;height:32px;display:flex}.DBuyfa_phaseHeader:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px;border-radius:4px}.DBuyfa_phaseLeading{width:16px;height:16px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;margin-right:0;display:inline-flex}.DBuyfa_phaseTitle{min-width:0;max-width:42%;color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;flex:0 auto;font-size:14px;line-height:24px;overflow:hidden}.DBuyfa_phaseCount{min-width:0;color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:13px;line-height:20px;overflow:hidden}.DBuyfa_phaseStatus{width:132px;color:var(--dsw-alias-label-secondary);text-align:right;text-overflow:ellipsis;white-space:nowrap;flex:none;font-size:13px;line-height:20px;overflow:hidden}.DBuyfa_separator{background:var(--dsw-alias-label-tertiary);border-radius:50%;flex:none;width:2px;height:2px}.DBuyfa_phaseList{flex-direction:column;gap:4px;min-width:0;padding:4px 0 0 16px;display:flex}.DBuyfa_phase{min-width:0}.DBuyfa_members{flex-direction:column;gap:2px;min-width:0;padding:0 0 0 16px;display:flex}.DBuyfa_memberRow,.DBuyfa_memberButton{width:100%;min-width:0;min-height:24px;color:var(--dsw-alias-label-secondary);font:inherit;text-align:left;background:0 0;border:0;border-radius:4px;align-items:center;gap:12px;padding:0;display:flex}.DBuyfa_memberButton{cursor:pointer}.DBuyfa_memberButton .DBuyfa_memberLabel{color:var(--dsw-alias-state-business-primary);text-underline-position:from-font;text-decoration:underline}.DBuyfa_dotSlot{flex:none;justify-content:center;align-items:center;width:16px;height:24px;display:inline-flex;overflow:hidden}.DBuyfa_memberButton:focus-visible{outline:none}.DBuyfa_memberButton:focus-visible .DBuyfa_memberLabelWrap{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-1px}.DBuyfa_memberLabelWrap{border-radius:4px;flex:1;align-items:center;min-width:0;height:24px;padding:0 2px;display:flex;overflow:hidden}.DBuyfa_memberLabel{min-width:0;color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:14px;line-height:24px;overflow:hidden}.DBuyfa_memberStatus{width:64px;color:var(--dsw-alias-label-secondary);text-align:right;text-overflow:ellipsis;white-space:nowrap;flex:none;font-size:13px;line-height:20px;overflow:hidden}.DBuyfa_empty{color:var(--dsw-alias-label-tertiary);padding:0;font-size:13px;line-height:20px}@media (width<=560px){.DBuyfa_phaseList,.DBuyfa_members{padding-left:12px}}";
|
||||||
|
const tagId = "@deepseek-ai/dsh-client-ui-workflow-run/WorkflowRunPanel.module.css";
|
||||||
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
||||||
|
const tag = document.createElement("style");
|
||||||
|
tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-workflow-run";
|
||||||
|
tag.dataset.pluginCss = tagId;
|
||||||
|
tag.textContent = css;
|
||||||
|
document.head.appendChild(tag);
|
||||||
|
}
|
||||||
|
var WorkflowRunPanel_module_css_default = {
|
||||||
|
"root": "DBuyfa_root",
|
||||||
|
"phaseHeader": "DBuyfa_phaseHeader",
|
||||||
|
"runTitle": "DBuyfa_runTitle",
|
||||||
|
"memberLabel": "DBuyfa_memberLabel",
|
||||||
|
"phaseList": "DBuyfa_phaseList",
|
||||||
|
"phaseLeading": "DBuyfa_phaseLeading",
|
||||||
|
"phase": "DBuyfa_phase",
|
||||||
|
"members": "DBuyfa_members",
|
||||||
|
"phaseStatus": "DBuyfa_phaseStatus",
|
||||||
|
"runHeader": "DBuyfa_runHeader",
|
||||||
|
"memberRow": "DBuyfa_memberRow",
|
||||||
|
"memberStatus": "DBuyfa_memberStatus",
|
||||||
|
"statusTail": "DBuyfa_statusTail",
|
||||||
|
"dotSlot": "DBuyfa_dotSlot",
|
||||||
|
"empty": "DBuyfa_empty",
|
||||||
|
"memberButton": "DBuyfa_memberButton",
|
||||||
|
"memberLabelWrap": "DBuyfa_memberLabelWrap",
|
||||||
|
"runLeading": "DBuyfa_runLeading",
|
||||||
|
"runSummary": "DBuyfa_runSummary",
|
||||||
|
"separator": "DBuyfa_separator",
|
||||||
|
"phaseTitle": "DBuyfa_phaseTitle",
|
||||||
|
"phaseCount": "DBuyfa_phaseCount"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/WorkflowRunPanel.js
|
||||||
|
const STATUS_KEYS = {
|
||||||
|
running: "status.running",
|
||||||
|
completed: "status.completed",
|
||||||
|
failed: "status.failed",
|
||||||
|
cancelled: "status.cancelled",
|
||||||
|
interrupted: "status.interrupted"
|
||||||
|
};
|
||||||
|
function dotState(status) {
|
||||||
|
switch (status) {
|
||||||
|
case "running": return "ongoing";
|
||||||
|
case "completed": return "done";
|
||||||
|
case "failed": return "error";
|
||||||
|
case "cancelled":
|
||||||
|
case "interrupted": return "warning";
|
||||||
|
/* v8 ignore next -- WorkflowRunStatus is closed and every variant is handled above. */
|
||||||
|
default: return status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function readablePhase(phase, t) {
|
||||||
|
if (phase === null) return t("phase.unassigned");
|
||||||
|
return phase === "" ? t("phase.empty") : phase;
|
||||||
|
}
|
||||||
|
function readableMember(label, t) {
|
||||||
|
return label === "" ? t("member.empty") : label;
|
||||||
|
}
|
||||||
|
function statusCount(status, count, t) {
|
||||||
|
return t(`statusCount.${status}`, { count });
|
||||||
|
}
|
||||||
|
function memberCount(count, t) {
|
||||||
|
return t(count === 1 ? "run.members.one" : "run.members.other", { count });
|
||||||
|
}
|
||||||
|
function phaseRequiresExpansion(phase) {
|
||||||
|
return phase.members.some((member) => member.status !== "completed");
|
||||||
|
}
|
||||||
|
/* v8 ignore next -- DisclosureRow requires the callback but cannot invoke it when expandable is false. */
|
||||||
|
const forcedOpenToggle = () => {};
|
||||||
|
function ManualDisclosure(props) {
|
||||||
|
const [open, setOpen] = (0, react.useState)(false);
|
||||||
|
return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.DisclosureRow, {
|
||||||
|
...props,
|
||||||
|
open,
|
||||||
|
expandable: true,
|
||||||
|
onToggle: () => {
|
||||||
|
setOpen((value) => !value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function StatusDisclosure({ cleanCycleKey, requiresExpansion, ...props }) {
|
||||||
|
if (!requiresExpansion) return (0, react_jsx_runtime.jsx)(ManualDisclosure, { ...props }, cleanCycleKey);
|
||||||
|
return (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.DisclosureRow, {
|
||||||
|
...props,
|
||||||
|
open: true,
|
||||||
|
expandable: false,
|
||||||
|
onToggle: forcedOpenToggle
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function phaseStatusSummary(members, t) {
|
||||||
|
const counts = /* @__PURE__ */ new Map();
|
||||||
|
for (const member of members) counts.set(member.status, (counts.get(member.status) ?? 0) + 1);
|
||||||
|
const count = (status) => counts.get(status) ?? 0;
|
||||||
|
const active = [
|
||||||
|
"running",
|
||||||
|
"failed",
|
||||||
|
"cancelled",
|
||||||
|
"interrupted"
|
||||||
|
].filter((status) => count(status) > 0);
|
||||||
|
if (active.length === 0) return statusCount("completed", count("completed"), t);
|
||||||
|
return (active.includes("interrupted") && count("completed") > 0 ? ["completed", ...active] : active).map((status) => statusCount(status, count(status), t)).join(" · ");
|
||||||
|
}
|
||||||
|
function navigableMembers(sessions, phases, parentId) {
|
||||||
|
const ordinary = new Set(sessions.ids);
|
||||||
|
const result = [];
|
||||||
|
for (const phase of phases) for (const member of phase.members) {
|
||||||
|
const summary = sessions.byId[member.childId];
|
||||||
|
if (member.status === "running" && ordinary.has(member.childId) && summary?.origin === "subagent" && summary.parentId === parentId && summary.running) result.push(member.childId);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
function RunHeader({ children, count, name, requiresExpansion, status, t }) {
|
||||||
|
return (0, react_jsx_runtime.jsx)(StatusDisclosure, {
|
||||||
|
icon: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronRightOutline14, {}),
|
||||||
|
title: t("run.title", { name }),
|
||||||
|
requiresExpansion,
|
||||||
|
expandOnRowClick: true,
|
||||||
|
previewChevron: false,
|
||||||
|
keepContentWhenOpen: true,
|
||||||
|
rowClassName: WorkflowRunPanel_module_css_default.runHeader,
|
||||||
|
leadingClassName: WorkflowRunPanel_module_css_default.runLeading,
|
||||||
|
titleClassName: WorkflowRunPanel_module_css_default.runTitle,
|
||||||
|
collapsedContent: (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: WorkflowRunPanel_module_css_default.separator,
|
||||||
|
"aria-hidden": true
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: WorkflowRunPanel_module_css_default.runSummary,
|
||||||
|
children: memberCount(count, t)
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsxs)("span", {
|
||||||
|
className: WorkflowRunPanel_module_css_default.statusTail,
|
||||||
|
"data-status": status,
|
||||||
|
children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, { state: dotState(status) }), (0, react_jsx_runtime.jsx)("span", { children: t(STATUS_KEYS[status]) })]
|
||||||
|
})
|
||||||
|
] }),
|
||||||
|
children
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function MemberRow({ member, navigable, openSession, t }) {
|
||||||
|
const name = readableMember(member.label, t);
|
||||||
|
const content = (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: WorkflowRunPanel_module_css_default.dotSlot,
|
||||||
|
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, { state: dotState(member.status) })
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: WorkflowRunPanel_module_css_default.memberLabelWrap,
|
||||||
|
"data-member-label-wrap": true,
|
||||||
|
children: (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: WorkflowRunPanel_module_css_default.memberLabel,
|
||||||
|
"data-member-label": true,
|
||||||
|
children: name
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: WorkflowRunPanel_module_css_default.memberStatus,
|
||||||
|
"data-member-status-text": true,
|
||||||
|
children: t(STATUS_KEYS[member.status])
|
||||||
|
})
|
||||||
|
] });
|
||||||
|
if (!navigable) return (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: WorkflowRunPanel_module_css_default.memberRow,
|
||||||
|
"data-member-status": member.status,
|
||||||
|
children: content
|
||||||
|
});
|
||||||
|
return (0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: WorkflowRunPanel_module_css_default.memberButton,
|
||||||
|
"data-member-status": member.status,
|
||||||
|
"aria-label": t("member.open", { name }),
|
||||||
|
onClick: () => {
|
||||||
|
openSession(member.childId);
|
||||||
|
},
|
||||||
|
children: content
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function PhaseSection({ phase, navigable, openSession, t }) {
|
||||||
|
return (0, react_jsx_runtime.jsx)(StatusDisclosure, {
|
||||||
|
icon: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronRightOutline14, {}),
|
||||||
|
title: readablePhase(phase.phase, t),
|
||||||
|
cleanCycleKey: phase.members.length,
|
||||||
|
requiresExpansion: phaseRequiresExpansion(phase),
|
||||||
|
expandOnRowClick: true,
|
||||||
|
previewChevron: false,
|
||||||
|
keepContentWhenOpen: true,
|
||||||
|
className: WorkflowRunPanel_module_css_default.phase,
|
||||||
|
rowClassName: WorkflowRunPanel_module_css_default.phaseHeader,
|
||||||
|
leadingClassName: WorkflowRunPanel_module_css_default.phaseLeading,
|
||||||
|
titleClassName: WorkflowRunPanel_module_css_default.phaseTitle,
|
||||||
|
collapsedContent: (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: WorkflowRunPanel_module_css_default.separator,
|
||||||
|
"aria-hidden": true
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: WorkflowRunPanel_module_css_default.phaseCount,
|
||||||
|
"data-phase-count": true,
|
||||||
|
children: memberCount(phase.members.length, t)
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: WorkflowRunPanel_module_css_default.phaseStatus,
|
||||||
|
"data-phase-status-text": true,
|
||||||
|
children: phaseStatusSummary(phase.members, t)
|
||||||
|
})
|
||||||
|
] }),
|
||||||
|
children: (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: WorkflowRunPanel_module_css_default.members,
|
||||||
|
children: phase.members.map((member) => (0, react_jsx_runtime.jsx)(MemberRow, {
|
||||||
|
member,
|
||||||
|
navigable: navigable.includes(member.childId),
|
||||||
|
openSession,
|
||||||
|
t
|
||||||
|
}, member.seq))
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** Render one durable workflow run with status-driven run and phase disclosure. */
|
||||||
|
function WorkflowRunPanel({ node, sessionId, useSessions, openSession, t }) {
|
||||||
|
const totalMembers = node.data.phases.reduce((count, phase) => count + phase.members.length, 0);
|
||||||
|
const requiresExpansion = node.data.status !== "completed" || node.data.phases.some(phaseRequiresExpansion);
|
||||||
|
const navigable = useSessions((sessions) => navigableMembers(sessions, node.data.phases, sessionId), _deepseek_ai_dsh_client_runtime_client.shallowEqual);
|
||||||
|
return (0, react_jsx_runtime.jsx)("section", {
|
||||||
|
className: WorkflowRunPanel_module_css_default.root,
|
||||||
|
"data-workflow-run": true,
|
||||||
|
"data-run-status": node.data.status,
|
||||||
|
children: (0, react_jsx_runtime.jsx)(RunHeader, {
|
||||||
|
count: totalMembers,
|
||||||
|
name: node.data.name,
|
||||||
|
requiresExpansion,
|
||||||
|
status: node.data.status,
|
||||||
|
t,
|
||||||
|
children: (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: WorkflowRunPanel_module_css_default.phaseList,
|
||||||
|
children: node.data.phases.length === 0 ? (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: WorkflowRunPanel_module_css_default.empty,
|
||||||
|
children: t("run.empty")
|
||||||
|
}) : node.data.phases.map((phase) => (0, react_jsx_runtime.jsx)(PhaseSection, {
|
||||||
|
phase,
|
||||||
|
navigable,
|
||||||
|
openSession,
|
||||||
|
t
|
||||||
|
}, phase.key))
|
||||||
|
})
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/locales.js
|
||||||
|
/** `workflowRun` namespace dictionaries. */
|
||||||
|
/** Dictionary namespace owned by this plugin. */
|
||||||
|
const NS = "workflowRun";
|
||||||
|
/** Simplified Chinese dictionary (the key-set source of truth). */
|
||||||
|
const zh = {
|
||||||
|
"run.title": "{name}",
|
||||||
|
"run.members.one": "{count} 个成员",
|
||||||
|
"run.members.other": "{count} 个成员",
|
||||||
|
"run.empty": "没有启动成员",
|
||||||
|
"phase.unassigned": "未分阶段",
|
||||||
|
"phase.empty": "空阶段名",
|
||||||
|
"statusCount.running": "运行中 {count}",
|
||||||
|
"statusCount.completed": "已完成 {count}",
|
||||||
|
"statusCount.failed": "失败 {count}",
|
||||||
|
"statusCount.cancelled": "已取消 {count}",
|
||||||
|
"statusCount.interrupted": "已中断 {count}",
|
||||||
|
"member.empty": "空成员名",
|
||||||
|
"member.open": "打开 {name}",
|
||||||
|
"status.running": "运行中",
|
||||||
|
"status.completed": "已完成",
|
||||||
|
"status.failed": "失败",
|
||||||
|
"status.cancelled": "已取消",
|
||||||
|
"status.interrupted": "已中断"
|
||||||
|
};
|
||||||
|
/** English dictionary (same key set). */
|
||||||
|
const en = {
|
||||||
|
"run.title": "{name}",
|
||||||
|
"run.members.one": "{count} member",
|
||||||
|
"run.members.other": "{count} members",
|
||||||
|
"run.empty": "No members started",
|
||||||
|
"phase.unassigned": "Unphased",
|
||||||
|
"phase.empty": "Empty phase name",
|
||||||
|
"statusCount.running": "Running {count}",
|
||||||
|
"statusCount.completed": "Completed {count}",
|
||||||
|
"statusCount.failed": "Failed {count}",
|
||||||
|
"statusCount.cancelled": "Cancelled {count}",
|
||||||
|
"statusCount.interrupted": "Interrupted {count}",
|
||||||
|
"member.empty": "Empty member name",
|
||||||
|
"member.open": "Open {name}",
|
||||||
|
"status.running": "Running",
|
||||||
|
"status.completed": "Completed",
|
||||||
|
"status.failed": "Failed",
|
||||||
|
"status.cancelled": "Cancelled",
|
||||||
|
"status.interrupted": "Interrupted"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/workflow-definition.js
|
||||||
|
/**
|
||||||
|
* Build a collision-free phase key preserving absent versus empty identity.
|
||||||
|
* @param phase - exact phase string, or null for an omitted field.
|
||||||
|
* @returns the stable renderer key for that phase identity.
|
||||||
|
*/
|
||||||
|
function workflowPhaseKey(phase) {
|
||||||
|
return phase === null ? "missing" : `value:${phase.length}:${phase}`;
|
||||||
|
}
|
||||||
|
function statusFromStopReason(stopReason) {
|
||||||
|
switch (stopReason) {
|
||||||
|
case "completed": return "completed";
|
||||||
|
case "cancelled": return "cancelled";
|
||||||
|
case "error": return "failed";
|
||||||
|
/* v8 ignore next -- WorkflowStopReason is closed and every variant is handled above. */
|
||||||
|
default: return stopReason;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function statusFromOutcome(outcome) {
|
||||||
|
switch (outcome) {
|
||||||
|
case "completed": return "completed";
|
||||||
|
case "cancelled": return "cancelled";
|
||||||
|
case "failed": return "failed";
|
||||||
|
/* v8 ignore next -- WorkflowAgentOutcome is closed and every variant is handled above. */
|
||||||
|
default: return outcome;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function locationClosed(location) {
|
||||||
|
if (location.kind === "step") return location.step.status === "closed" || location.turn.status === "closed";
|
||||||
|
return location.kind === "turn" && location.turn.status === "closed";
|
||||||
|
}
|
||||||
|
function projectWorkflow(context, location) {
|
||||||
|
const state = context.state;
|
||||||
|
const interrupted = state.stopReason === void 0 && locationClosed(location);
|
||||||
|
const phases = /* @__PURE__ */ new Map();
|
||||||
|
for (const member of state.members) {
|
||||||
|
const phase = member.phase === void 0 ? null : member.phase;
|
||||||
|
const key = workflowPhaseKey(phase);
|
||||||
|
let group = phases.get(key);
|
||||||
|
if (group === void 0) {
|
||||||
|
group = {
|
||||||
|
phase,
|
||||||
|
members: []
|
||||||
|
};
|
||||||
|
phases.set(key, group);
|
||||||
|
}
|
||||||
|
group.members.push({
|
||||||
|
seq: member.seq,
|
||||||
|
label: member.label,
|
||||||
|
childId: member.childId,
|
||||||
|
status: member.outcome === void 0 ? interrupted ? "interrupted" : "running" : statusFromOutcome(member.outcome)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const projectedPhases = [...phases].map(([key, phase]) => ({
|
||||||
|
key,
|
||||||
|
phase: phase.phase,
|
||||||
|
members: phase.members
|
||||||
|
}));
|
||||||
|
return {
|
||||||
|
name: state.name,
|
||||||
|
status: state.stopReason === void 0 ? interrupted ? "interrupted" : "running" : statusFromStopReason(state.stopReason),
|
||||||
|
phases: projectedPhases
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function updateAgentStart(state, data) {
|
||||||
|
const member = {
|
||||||
|
seq: data.seq,
|
||||||
|
label: data.label,
|
||||||
|
...data.phase === void 0 ? {} : { phase: data.phase },
|
||||||
|
childId: data.childId
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
members: [...state.members, member]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
function updateAgentEnd(state, data) {
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
members: state.members.map((member) => member.seq === data.seq ? {
|
||||||
|
...member,
|
||||||
|
outcome: data.outcome
|
||||||
|
} : member)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
/** Durable workflow event family folded into one keyed Chat node. */
|
||||||
|
const workflowRunDefinition = {
|
||||||
|
kind: "workflow-run",
|
||||||
|
target: "chat",
|
||||||
|
match: (event) => {
|
||||||
|
if (event.type === "tool-workflow/run-start") return {
|
||||||
|
id: String(event.data.runId),
|
||||||
|
role: "start"
|
||||||
|
};
|
||||||
|
if (event.type === "tool-workflow/agent-start" || event.type === "tool-workflow/agent-end" || event.type === "tool-workflow/run-end") return {
|
||||||
|
id: String(event.data.runId),
|
||||||
|
role: "update"
|
||||||
|
};
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
start: (_context, match) => {
|
||||||
|
if (match.event.type !== "tool-workflow/run-start") throw new Error("workflow-run start requires tool-workflow/run-start");
|
||||||
|
return {
|
||||||
|
name: match.event.data.name,
|
||||||
|
members: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
update: (context, match) => {
|
||||||
|
if (match.event.type === "tool-workflow/agent-start") return updateAgentStart(context.state, match.event.data);
|
||||||
|
if (match.event.type === "tool-workflow/agent-end") return updateAgentEnd(context.state, match.event.data);
|
||||||
|
if (match.event.type === "tool-workflow/run-end") return {
|
||||||
|
...context.state,
|
||||||
|
stopReason: match.event.data.stopReason
|
||||||
|
};
|
||||||
|
return context.state;
|
||||||
|
},
|
||||||
|
buildViewNode: (context) => {
|
||||||
|
if (context.start === void 0) return null;
|
||||||
|
const data = projectWorkflow(context, context.start.location);
|
||||||
|
return {
|
||||||
|
key: context.key,
|
||||||
|
kind: "workflow-run",
|
||||||
|
id: context.id,
|
||||||
|
target: "chat",
|
||||||
|
anchorSeq: context.start.event.seq,
|
||||||
|
location: context.start.location,
|
||||||
|
visibility: "visible",
|
||||||
|
data
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/index.js
|
||||||
|
/** Browser plugin for durable workflow-run Conversation Nodes. */
|
||||||
|
/** Required services for Definition, keyed renderer, navigation, and copy. */
|
||||||
|
const inject = [
|
||||||
|
"conversationEvents",
|
||||||
|
"slots",
|
||||||
|
"sessions",
|
||||||
|
"locale"
|
||||||
|
];
|
||||||
|
/** Register the workflow Definition, dictionary, and keyed Chat renderer. */
|
||||||
|
function apply(ctx) {
|
||||||
|
ctx.conversationEvents.register(workflowRunDefinition);
|
||||||
|
ctx.effect(() => ctx.locale.register(NS, {
|
||||||
|
zh,
|
||||||
|
en
|
||||||
|
}), "ui-workflow-run: dictionaries");
|
||||||
|
ctx.slots.inject("conversation.chat.node", () => ctx.slots.register({
|
||||||
|
name: "conversation.chat.node",
|
||||||
|
key: "workflow-run",
|
||||||
|
locale: NS,
|
||||||
|
inject: () => ({ openSession: (id) => {
|
||||||
|
ctx.sessions.open(id);
|
||||||
|
} })
|
||||||
|
}, WorkflowRunPanel));
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
exports.apply = apply;
|
||||||
|
exports.inject = inject;
|
||||||
|
return module.exports;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//# sourceMappingURL=client.js.map
|
||||||
@@ -0,0 +1,373 @@
|
|||||||
|
window.__ModuleLoader__.load({
|
||||||
|
id: "@deepseek-ai/dsh-client-ui-deliverables",
|
||||||
|
factory: (require) => {
|
||||||
|
var module = { exports: {} };
|
||||||
|
var exports = module.exports;
|
||||||
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||||
|
let react_jsx_runtime = require("react/jsx-runtime");
|
||||||
|
let react = require("react");
|
||||||
|
let _deepseek_ai_dsh_client_runtime_client = require("@deepseek-ai/dsh-client-runtime/client");
|
||||||
|
//#region lib/types/client/turn-deliverables.js
|
||||||
|
/**
|
||||||
|
* Paths a call view reports having created or changed, by render intent rather
|
||||||
|
* than tool name: a diff card, or a generic card whose kind is `edit` (the
|
||||||
|
* shape `str_replace_editor`'s insert presents). Every other card produces
|
||||||
|
* nothing to open — a read looked, a delete removed, a terminal ran. Only
|
||||||
|
* root call views enter this Turn accumulator; nested Code Mode dispatches
|
||||||
|
* preserve the pre-assembly behavior and do not contribute independently.
|
||||||
|
*/
|
||||||
|
function producedPaths(view) {
|
||||||
|
if (view === null) return [];
|
||||||
|
if (view.card === "diff") return (view.locations ?? []).map((location) => location.path);
|
||||||
|
if (view.card === "generic" && view.kind === "edit") return (view.locations ?? []).map((location) => location.path);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Files produced by one Turn data value.
|
||||||
|
*
|
||||||
|
* The source is the mutation tools' own follow-along `locations`, not the
|
||||||
|
* closing prose: a produced file must be listed whether or not the model
|
||||||
|
* remembered to name it. A mutation is recognized by render intent, not by
|
||||||
|
* tool name — a diff card, or a generic card whose `kind` is `edit` (the shape
|
||||||
|
* `str_replace_editor`'s insert presents) — so a new mutation tool joins by
|
||||||
|
* declaring what it does. Reads contribute nothing (looking at a file does not
|
||||||
|
* produce it), and neither do deletes (there is nothing left to open) or
|
||||||
|
* failed calls. Paths keep first-seen order and appear once, so a file written
|
||||||
|
* and then edited in the same turn is one entry.
|
||||||
|
*
|
||||||
|
* The Conversation Location index owns turn membership before this function
|
||||||
|
* runs, so paths cannot spill across turns and this derivation does not infer
|
||||||
|
* boundaries from neighboring presentation Nodes.
|
||||||
|
* @param data - engine-published Deliverables data for one Turn.
|
||||||
|
* @param seq - closing Assistant seq; later Tool settlements are excluded.
|
||||||
|
* @returns Produced paths in first-seen order; empty when the turn wrote nothing.
|
||||||
|
*/
|
||||||
|
function producedForClosing(data, seq = Number.POSITIVE_INFINITY) {
|
||||||
|
if (data === void 0) return [];
|
||||||
|
const paths = [];
|
||||||
|
const seen = /* @__PURE__ */ new Set();
|
||||||
|
for (const produced of data.produced) {
|
||||||
|
if (produced.seq > seq || seen.has(produced.path)) continue;
|
||||||
|
seen.add(produced.path);
|
||||||
|
paths.push(produced.path);
|
||||||
|
}
|
||||||
|
return paths;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Claim the turn-tail chain only when its closing turn produced files.
|
||||||
|
* @param owner - Turn-tail owner currency for the closing assistant.
|
||||||
|
* @returns Produced paths as the component's match, or null to decline before mount.
|
||||||
|
*/
|
||||||
|
function selectProducedFiles(owner) {
|
||||||
|
const paths = producedForClosing(owner.turn.data.get("deliverables"), owner.seq);
|
||||||
|
return paths.length === 0 ? null : paths;
|
||||||
|
}
|
||||||
|
/** Turn-local successful mutation accumulator; it publishes no view Node. */
|
||||||
|
const deliverablesDefinition = {
|
||||||
|
kind: "deliverables",
|
||||||
|
match: (event) => {
|
||||||
|
if (event.type === "turn/start") return {
|
||||||
|
id: String(event.data.turn),
|
||||||
|
role: "start"
|
||||||
|
};
|
||||||
|
if (event.type === "tool/call") return {
|
||||||
|
id: String(event.data.turn),
|
||||||
|
role: "update"
|
||||||
|
};
|
||||||
|
if (event.type === "tool/result" && (0, _deepseek_ai_dsh_client_runtime_client.isAppendSurfaceEvent)(event)) return {
|
||||||
|
id: String(event.data.turn),
|
||||||
|
role: "update"
|
||||||
|
};
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
start: (_context, match) => {
|
||||||
|
if (match.event.type !== "turn/start") throw new Error("deliverables start requires turn/start");
|
||||||
|
return {
|
||||||
|
turn: match.event.data.turn,
|
||||||
|
calls: /* @__PURE__ */ new Map(),
|
||||||
|
produced: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
update: (context, match) => {
|
||||||
|
if (match.event.type === "tool/call") {
|
||||||
|
const calls = new Map(context.state.calls);
|
||||||
|
calls.set(String(match.event.data.callId), match.view?.for === "call" ? match.view.view : null);
|
||||||
|
return {
|
||||||
|
...context.state,
|
||||||
|
calls
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if (match.event.type !== "tool/result") return context.state;
|
||||||
|
if (match.event.data.message.content[0].isError === true) return context.state;
|
||||||
|
const callId = String(match.event.data.message.source.callId);
|
||||||
|
const additions = producedPaths(context.state.calls.get(callId) ?? null).map((path) => ({
|
||||||
|
seq: match.event.seq,
|
||||||
|
path
|
||||||
|
}));
|
||||||
|
return additions.length === 0 ? context.state : {
|
||||||
|
...context.state,
|
||||||
|
produced: [...context.state.produced, ...additions]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
buildLocationData: (context, scope) => scope !== "turn" || context.state === void 0 ? null : {
|
||||||
|
kind: "turn",
|
||||||
|
turn: context.state.turn,
|
||||||
|
key: "deliverables",
|
||||||
|
value: { produced: context.state.produced }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Trailing path segment, the part that identifies the file at a glance.
|
||||||
|
* @param path - Slash- or backslash-separated path.
|
||||||
|
* @returns The final segment, or the whole string when separator-free.
|
||||||
|
*/
|
||||||
|
function basename(path) {
|
||||||
|
const at = Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\"));
|
||||||
|
return at === -1 ? path : path.slice(at + 1);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* File-mention vocabulary over one turn's produced paths, for the closing
|
||||||
|
* message's prose: an inline-code token opens the file it names. A token
|
||||||
|
* resolves by exact path, or by being exactly the basename of exactly one
|
||||||
|
* produced path — a basename two paths share stays inert rather than
|
||||||
|
* guessing, so a mention link can never open the wrong file or 404.
|
||||||
|
* @param paths - The turn's produced paths (tool order, already deduped).
|
||||||
|
* @param openFile - The chat view's file opener.
|
||||||
|
* @param label - Localizes the accessible open-label for a resolved path.
|
||||||
|
* @returns The resolver MarkdownText consumes; the full path rides `title`,
|
||||||
|
* the same disambiguator the row's chips carry.
|
||||||
|
*/
|
||||||
|
function producedFileMentions(paths, openFile, label) {
|
||||||
|
return { resolve(value) {
|
||||||
|
const path = paths.includes(value) ? value : onlyPathWithBasename(paths, value);
|
||||||
|
if (path === void 0) return void 0;
|
||||||
|
return {
|
||||||
|
open: () => {
|
||||||
|
openFile(path);
|
||||||
|
},
|
||||||
|
label: label(path),
|
||||||
|
title: path
|
||||||
|
};
|
||||||
|
} };
|
||||||
|
}
|
||||||
|
/** The single produced path whose basename is exactly `value`, else undefined. */
|
||||||
|
function onlyPathWithBasename(paths, value) {
|
||||||
|
const matches = paths.filter((path) => basename(path) === value);
|
||||||
|
return matches.length === 1 ? matches[0] : void 0;
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-deliverables/src/client/ProducedFiles.module.css.mjs
|
||||||
|
const css = ".P4kPIW_root{grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:6px 8px;margin-top:16px;font-size:13px;line-height:22px;display:grid;position:relative}.P4kPIW_label{color:var(--dsw-alias-label-tertiary);grid-area:1/1}.P4kPIW_row{flex-wrap:nowrap;grid-area:1/2;align-items:center;gap:8px;min-width:0;display:flex;overflow:hidden}.P4kPIW_file{text-overflow:ellipsis;white-space:nowrap;background:var(--dsw-alias-interactive-bg-hover);max-width:320px;color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;border:none;border-radius:6px;flex:none;margin:0;padding:0 8px;overflow:hidden}.P4kPIW_file:hover{color:var(--dsw-alias-label-primary);text-decoration:underline}.P4kPIW_file:focus-visible,.P4kPIW_showFolder:focus-visible{box-shadow:inset 0 0 0 2px var(--dsw-alias-border-l3);outline:none}.P4kPIW_more{white-space:nowrap;color:var(--dsw-alias-label-tertiary);flex:none}.P4kPIW_showFolder{color:var(--dsw-alias-label-tertiary);font:inherit;cursor:pointer;background:0 0;border:none;border-radius:4px;grid-area:2/2;justify-self:start;margin:0;padding:0 2px;line-height:20px}.P4kPIW_showFolder:hover{color:var(--dsw-alias-label-secondary);text-decoration:underline}.P4kPIW_measure{visibility:hidden;pointer-events:none;contain:strict;width:0;height:0;position:absolute;overflow:hidden}.P4kPIW_probe{width:max-content;position:absolute;inset:0 auto auto 0}";
|
||||||
|
const tagId = "@deepseek-ai/dsh-client-ui-deliverables/ProducedFiles.module.css";
|
||||||
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
||||||
|
const tag = document.createElement("style");
|
||||||
|
tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-deliverables";
|
||||||
|
tag.dataset.pluginCss = tagId;
|
||||||
|
tag.textContent = css;
|
||||||
|
document.head.appendChild(tag);
|
||||||
|
}
|
||||||
|
var ProducedFiles_module_css_default = {
|
||||||
|
"showFolder": "P4kPIW_showFolder",
|
||||||
|
"file": "P4kPIW_file",
|
||||||
|
"root": "P4kPIW_root",
|
||||||
|
"measure": "P4kPIW_measure",
|
||||||
|
"label": "P4kPIW_label",
|
||||||
|
"probe": "P4kPIW_probe",
|
||||||
|
"row": "P4kPIW_row",
|
||||||
|
"more": "P4kPIW_more"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/ProducedFiles.js
|
||||||
|
/** At most six chips compete for the one-line summary; every other path stays counted. */
|
||||||
|
const SHOWN_LIMIT = 6;
|
||||||
|
/**
|
||||||
|
* Select the largest prefix whose measured chips and exact remainder fit.
|
||||||
|
* @param available - usable width of the one-line file lane.
|
||||||
|
* @param gap - computed flex gap between adjacent visible items.
|
||||||
|
* @param chipWidths - measured widths for the candidate file chips.
|
||||||
|
* @param moreWidthsByShown - exact localized remainder width for each shown count.
|
||||||
|
* @returns Number of leading chips to render.
|
||||||
|
*/
|
||||||
|
function fitProducedFiles(available, gap, chipWidths, moreWidthsByShown) {
|
||||||
|
if (available <= 0) return chipWidths.length;
|
||||||
|
const prefix = [0];
|
||||||
|
let prefixWidth = 0;
|
||||||
|
for (const width of chipWidths) {
|
||||||
|
prefixWidth += width;
|
||||||
|
prefix.push(prefixWidth);
|
||||||
|
}
|
||||||
|
let largestFit = 0;
|
||||||
|
for (const [shown, width] of prefix.entries()) {
|
||||||
|
const more = moreWidthsByShown[shown];
|
||||||
|
const items = shown + (more === void 0 ? 0 : 1);
|
||||||
|
if (width + (more ?? 0) + Math.max(0, items - 1) * gap <= available) largestFit = shown;
|
||||||
|
}
|
||||||
|
return largestFit;
|
||||||
|
}
|
||||||
|
function moreLabel(t, count) {
|
||||||
|
return count === 1 ? t("produced.moreOne") : t("produced.more", { count: String(count) });
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Render one turn's produced files as openable chips.
|
||||||
|
* @param props - selector-matched paths, the chat view's file opener, and the locale seat.
|
||||||
|
* @returns The produced-files row.
|
||||||
|
*/
|
||||||
|
function ProducedFiles({ matched: paths, openFile, isLoopback, useHostDescription, t }) {
|
||||||
|
const hostCanOpenPath = useHostDescription((description) => description?.canOpenPath === true);
|
||||||
|
const canOpenPath = isLoopback && hostCanOpenPath;
|
||||||
|
const limit = Math.min(paths.length, SHOWN_LIMIT);
|
||||||
|
const [shownCount, setShownCount] = (0, react.useState)(limit);
|
||||||
|
const rowRef = (0, react.useRef)(null);
|
||||||
|
const chipProbes = (0, react.useRef)([]);
|
||||||
|
const moreProbe = (0, react.useRef)(null);
|
||||||
|
(0, react.useLayoutEffect)(() => {
|
||||||
|
const row = rowRef.current;
|
||||||
|
const remainderProbe = moreProbe.current;
|
||||||
|
/* v8 ignore next -- React attaches both refs before the layout effect runs. */
|
||||||
|
if (row === null || remainderProbe === null) return;
|
||||||
|
const measure = () => {
|
||||||
|
const styles = getComputedStyle(row);
|
||||||
|
const gap = Number.parseFloat(styles.columnGap || styles.gap) || 0;
|
||||||
|
const chips = chipProbes.current.slice(0, limit).map((probe) => probe.getBoundingClientRect().width);
|
||||||
|
const more = Array.from({ length: limit + 1 }, (_, candidate) => {
|
||||||
|
if (paths.length === candidate) return void 0;
|
||||||
|
remainderProbe.textContent = moreLabel(t, paths.length - candidate);
|
||||||
|
return remainderProbe.getBoundingClientRect().width;
|
||||||
|
});
|
||||||
|
setShownCount(fitProducedFiles(row.clientWidth, gap, chips, more));
|
||||||
|
};
|
||||||
|
measure();
|
||||||
|
if (typeof ResizeObserver === "undefined") return;
|
||||||
|
const observer = new ResizeObserver(measure);
|
||||||
|
observer.observe(row);
|
||||||
|
for (const probe of [...chipProbes.current, moreProbe.current]) if (probe !== null) observer.observe(probe);
|
||||||
|
return () => {
|
||||||
|
observer.disconnect();
|
||||||
|
};
|
||||||
|
}, [
|
||||||
|
limit,
|
||||||
|
paths,
|
||||||
|
t
|
||||||
|
]);
|
||||||
|
const visibleCount = Math.min(shownCount, limit);
|
||||||
|
const shown = paths.slice(0, visibleCount);
|
||||||
|
const hidden = paths.length - shown.length;
|
||||||
|
return (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: ProducedFiles_module_css_default.root,
|
||||||
|
children: [
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: ProducedFiles_module_css_default.label,
|
||||||
|
children: t("produced.label")
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
ref: rowRef,
|
||||||
|
className: ProducedFiles_module_css_default.row,
|
||||||
|
"data-produced-files-row": true,
|
||||||
|
children: [shown.map((path) => (0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: ProducedFiles_module_css_default.file,
|
||||||
|
title: path,
|
||||||
|
"aria-label": t("produced.open", { name: path }),
|
||||||
|
onClick: () => {
|
||||||
|
openFile(path);
|
||||||
|
},
|
||||||
|
children: basename(path)
|
||||||
|
}, path)), hidden > 0 && (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: ProducedFiles_module_css_default.more,
|
||||||
|
children: moreLabel(t, hidden)
|
||||||
|
})]
|
||||||
|
}),
|
||||||
|
hidden > 0 && canOpenPath && (0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: ProducedFiles_module_css_default.showFolder,
|
||||||
|
onClick: () => {
|
||||||
|
openFile(".");
|
||||||
|
},
|
||||||
|
children: t("produced.showInFolder")
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: ProducedFiles_module_css_default.measure,
|
||||||
|
"aria-hidden": "true",
|
||||||
|
children: [paths.slice(0, limit).map((path, index) => (0, react_jsx_runtime.jsx)("button", {
|
||||||
|
ref: (node) => {
|
||||||
|
chipProbes.current[index] = node;
|
||||||
|
},
|
||||||
|
type: "button",
|
||||||
|
tabIndex: -1,
|
||||||
|
className: `${ProducedFiles_module_css_default.file} ${ProducedFiles_module_css_default.probe}`,
|
||||||
|
children: basename(path)
|
||||||
|
}, path)), (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
ref: moreProbe,
|
||||||
|
className: `${ProducedFiles_module_css_default.more} ${ProducedFiles_module_css_default.probe}`
|
||||||
|
})]
|
||||||
|
})
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/locales.js
|
||||||
|
/** `deliverables` namespace dictionaries. */
|
||||||
|
/** Dictionary namespace owned by this plugin. */
|
||||||
|
const NS = "deliverables";
|
||||||
|
/** Simplified Chinese dictionary (the key-set source of truth). */
|
||||||
|
const zh = {
|
||||||
|
"produced.label": "产物",
|
||||||
|
"produced.moreOne": "+ 1 个文件",
|
||||||
|
"produced.more": "+ {count} 个文件",
|
||||||
|
"produced.open": "打开 {name}",
|
||||||
|
"produced.showInFolder": "在文件夹中显示"
|
||||||
|
};
|
||||||
|
/** English dictionary (same key set). */
|
||||||
|
const en = {
|
||||||
|
"produced.label": "Produced",
|
||||||
|
"produced.moreOne": "+ 1 file",
|
||||||
|
"produced.more": "+ {count} files",
|
||||||
|
"produced.open": "Open {name}",
|
||||||
|
"produced.showInFolder": "Show in folder"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/index.js
|
||||||
|
/** Required services for the tail-slot registration and its dictionaries. */
|
||||||
|
const inject = [
|
||||||
|
"slots",
|
||||||
|
"locale",
|
||||||
|
"conversationEvents",
|
||||||
|
"connection"
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* Client plugin body: register the dictionaries and the turn-tail entry.
|
||||||
|
* @param ctx - client root context.
|
||||||
|
*/
|
||||||
|
function apply(ctx) {
|
||||||
|
const connection = ctx.get("connection");
|
||||||
|
ctx.conversationEvents.register(deliverablesDefinition);
|
||||||
|
ctx.effect(() => ctx.locale.register(NS, {
|
||||||
|
zh,
|
||||||
|
en
|
||||||
|
}), "ui-deliverables: dictionaries");
|
||||||
|
ctx.slots.inject("conversation.chat.turnTail", () => ctx.slots.register({
|
||||||
|
name: "conversation.chat.turnTail",
|
||||||
|
select: selectProducedFiles,
|
||||||
|
locale: NS,
|
||||||
|
inject: () => ({
|
||||||
|
isLoopback: connection.isLoopback,
|
||||||
|
hooks: { hostDescription: connection.hostDescription }
|
||||||
|
})
|
||||||
|
}, ProducedFiles));
|
||||||
|
const t = ctx.locale.bind(NS);
|
||||||
|
ctx.provide("chatFileMentions", { forClosing(owner) {
|
||||||
|
const paths = selectProducedFiles(owner);
|
||||||
|
if (paths === null) return void 0;
|
||||||
|
return producedFileMentions(paths, owner.openFile, (path) => t("produced.open", { name: path }));
|
||||||
|
} });
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
exports.ProducedFiles = ProducedFiles;
|
||||||
|
exports.apply = apply;
|
||||||
|
exports.inject = inject;
|
||||||
|
exports.producedForClosing = producedForClosing;
|
||||||
|
return module.exports;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//# sourceMappingURL=client.js.map
|
||||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,859 @@
|
|||||||
|
window.__ModuleLoader__.load({
|
||||||
|
id: "@deepseek-ai/dsh-client-ui-input-trigger",
|
||||||
|
factory: (require) => {
|
||||||
|
var module = { exports: {} };
|
||||||
|
var exports = module.exports;
|
||||||
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||||
|
let _deepseek_ai_cordis = require("@deepseek-ai/cordis");
|
||||||
|
let _deepseek_ai_dsh_client_runtime_client = require("@deepseek-ai/dsh-client-runtime/client");
|
||||||
|
let react_jsx_runtime = require("react/jsx-runtime");
|
||||||
|
let react = require("react");
|
||||||
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
||||||
|
//#region lib/types/core/detect.js
|
||||||
|
const WORD_CHAR = /[\p{L}\p{N}_]/u;
|
||||||
|
const WHITESPACE = /\s/u;
|
||||||
|
/**
|
||||||
|
* Word-boundary rule: a trigger char opens only at start-of-draft, after
|
||||||
|
* whitespace (newlines included), or after punctuation. Two URL carve-outs
|
||||||
|
* keep '/' dead inside URLs (both pinned by tests): '/' after a ':' that
|
||||||
|
* itself follows a non-whitespace char (scheme separator, `https:/…`), and
|
||||||
|
* '/' directly after another '/' (second slash of `//`).
|
||||||
|
*/
|
||||||
|
function boundaryOk(draft, index, char) {
|
||||||
|
if (index === 0) return true;
|
||||||
|
const prev = draft.charAt(index - 1);
|
||||||
|
if (WHITESPACE.test(prev)) return true;
|
||||||
|
if (WORD_CHAR.test(prev)) return false;
|
||||||
|
if (char === "/") {
|
||||||
|
if (prev === "/") return false;
|
||||||
|
if (prev === ":" && index >= 2 && !WHITESPACE.test(draft.charAt(index - 2))) return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Detect a trigger token at the caret. Scans left from the caret and stops
|
||||||
|
* at the first whitespace (the token under edit never spans whitespace);
|
||||||
|
* trigger chars failing the guard tier or the word boundary are treated as
|
||||||
|
* ordinary token chars and the scan continues (`user@host`, URL slashes).
|
||||||
|
* Guard tiers: plain = both chars live; claimed = '/' fully suppressed,
|
||||||
|
* '@' live; frozen = none.
|
||||||
|
*
|
||||||
|
* @param draft - Full draft text.
|
||||||
|
* @param caret - Caret offset into `draft`.
|
||||||
|
* @param guard - Availability tier derived from the input phase.
|
||||||
|
* @returns The hit with `query` = trigger-to-caret slice and `span` =
|
||||||
|
* `{start: triggerIndex, end: caret}`; `span.draftRev` is a placeholder `0`
|
||||||
|
* — the calling shell stamps the real revision. Null when no trigger is
|
||||||
|
* live at the caret.
|
||||||
|
*/
|
||||||
|
const detectTrigger = (draft, caret, guard) => {
|
||||||
|
if (guard.tier === "frozen") return null;
|
||||||
|
for (let i = caret - 1; i >= 0; i--) {
|
||||||
|
const ch = draft.charAt(i);
|
||||||
|
if (WHITESPACE.test(ch)) return null;
|
||||||
|
if (ch !== "/" && ch !== "@") continue;
|
||||||
|
if (guard.tier === "claimed" && ch === "/") continue;
|
||||||
|
if (!boundaryOk(draft, i, ch)) continue;
|
||||||
|
return {
|
||||||
|
trigger: ch,
|
||||||
|
query: draft.slice(i + 1, caret),
|
||||||
|
position: draft.search(/\S/) === i ? "leading" : "inline",
|
||||||
|
span: {
|
||||||
|
start: i,
|
||||||
|
end: caret,
|
||||||
|
draftRev: 0
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/core/menu.js
|
||||||
|
/** Closed rest state with generation 0; store initializer and test seed. */
|
||||||
|
const MENU_CLOSED = {
|
||||||
|
open: false,
|
||||||
|
hit: null,
|
||||||
|
generation: 0,
|
||||||
|
groups: [],
|
||||||
|
highlight: null
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Replace the group roster with pending groups for `sources`, in order.
|
||||||
|
* Shell-side step before dispatching `hit` on a fresh menu open.
|
||||||
|
*
|
||||||
|
* @param state - Current menu state.
|
||||||
|
* @param sources - Source names registered for the hit trigger, menu order.
|
||||||
|
* @returns State carrying the new pending roster; highlight cleared.
|
||||||
|
*/
|
||||||
|
function seedGroups(state, sources) {
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
groups: sources.map((source) => ({
|
||||||
|
source,
|
||||||
|
status: "pending",
|
||||||
|
items: []
|
||||||
|
})),
|
||||||
|
highlight: null
|
||||||
|
};
|
||||||
|
}
|
||||||
|
/** Close, preserving the generation so in-flight settlements stay droppable. */
|
||||||
|
const closed = (state) => state.open || state.hit !== null || state.groups.length > 0 || state.highlight !== null ? {
|
||||||
|
open: false,
|
||||||
|
hit: null,
|
||||||
|
generation: state.generation,
|
||||||
|
groups: [],
|
||||||
|
highlight: null
|
||||||
|
} : state;
|
||||||
|
/** First item of the first non-empty ready group, or null. */
|
||||||
|
function firstHighlight(groups) {
|
||||||
|
for (const g of groups) if (g.status === "ready" && g.items.length > 0) return {
|
||||||
|
source: g.source,
|
||||||
|
index: 0
|
||||||
|
};
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
/** The highlight itself when it still points at a ready item, else null. */
|
||||||
|
function validHighlight(highlight, groups) {
|
||||||
|
if (!highlight) return null;
|
||||||
|
const g = groups.find((x) => x.source === highlight.source);
|
||||||
|
return g && g.status === "ready" && highlight.index < g.items.length ? highlight : null;
|
||||||
|
}
|
||||||
|
/** Flatten ready items into (source, index) positions in group order. */
|
||||||
|
function positions(groups) {
|
||||||
|
const out = [];
|
||||||
|
for (const g of groups) {
|
||||||
|
if (g.status !== "ready") continue;
|
||||||
|
for (let i = 0; i < g.items.length; i++) out.push({
|
||||||
|
source: g.source,
|
||||||
|
index: i
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
/** True when every group is ready with zero items (the auto-close condition). */
|
||||||
|
const allReadyEmpty = (groups) => groups.every((g) => g.status === "ready" && g.items.length === 0);
|
||||||
|
/**
|
||||||
|
* Pure menu reducer. `hit` opens a new generation over the seeded roster
|
||||||
|
* (null hit closes); `source-settled` outside the current generation, the
|
||||||
|
* open menu, or the roster is dropped; a settlement or failure leaving every
|
||||||
|
* group ready-and-empty (or no groups) auto-closes; `source-failed` silently
|
||||||
|
* removes the group (the shell logs); `move` cycles the highlight across
|
||||||
|
* ready items.
|
||||||
|
*
|
||||||
|
* @param state - Current menu state.
|
||||||
|
* @param ev - Menu event.
|
||||||
|
* @returns Next state; the same reference when stale or a no-op.
|
||||||
|
*/
|
||||||
|
const menuReduce = (state, ev) => {
|
||||||
|
switch (ev.type) {
|
||||||
|
case "hit":
|
||||||
|
if (ev.hit === null) return closed(state);
|
||||||
|
return {
|
||||||
|
open: true,
|
||||||
|
hit: ev.hit,
|
||||||
|
generation: state.generation + 1,
|
||||||
|
groups: state.groups.map((g) => ({
|
||||||
|
source: g.source,
|
||||||
|
status: "pending",
|
||||||
|
items: []
|
||||||
|
})),
|
||||||
|
highlight: null
|
||||||
|
};
|
||||||
|
case "source-settled": {
|
||||||
|
if (!state.open || ev.generation !== state.generation) return state;
|
||||||
|
const idx = state.groups.findIndex((g) => g.source === ev.source);
|
||||||
|
if (idx < 0) return state;
|
||||||
|
const items = ev.items ?? [];
|
||||||
|
const groups = state.groups.map((g, i) => i === idx ? {
|
||||||
|
source: g.source,
|
||||||
|
status: "ready",
|
||||||
|
items
|
||||||
|
} : g);
|
||||||
|
if (allReadyEmpty(groups)) return closed(state);
|
||||||
|
const highlight = validHighlight(state.highlight, groups) ?? firstHighlight(groups);
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
groups,
|
||||||
|
highlight
|
||||||
|
};
|
||||||
|
}
|
||||||
|
case "source-failed": {
|
||||||
|
if (!state.open || ev.generation !== state.generation) return state;
|
||||||
|
if (!state.groups.some((g) => g.source === ev.source)) return state;
|
||||||
|
const groups = state.groups.filter((g) => g.source !== ev.source);
|
||||||
|
if (groups.length === 0 || allReadyEmpty(groups)) return closed(state);
|
||||||
|
const highlight = validHighlight(state.highlight, groups) ?? firstHighlight(groups);
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
groups,
|
||||||
|
highlight
|
||||||
|
};
|
||||||
|
}
|
||||||
|
case "move": {
|
||||||
|
if (!state.open) return state;
|
||||||
|
const pos = positions(state.groups);
|
||||||
|
if (pos.length === 0) return state;
|
||||||
|
const hl = state.highlight;
|
||||||
|
const at = hl ? pos.findIndex((p) => p.source === hl.source && p.index === hl.index) : -1;
|
||||||
|
const next = pos[at < 0 ? ev.dir === 1 ? 0 : pos.length - 1 : (at + ev.dir + pos.length) % pos.length];
|
||||||
|
if (next === void 0) return state;
|
||||||
|
if (hl && next.source === hl.source && next.index === hl.index) return state;
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
highlight: next
|
||||||
|
};
|
||||||
|
}
|
||||||
|
case "close": return closed(state);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/controller.js
|
||||||
|
/**
|
||||||
|
* Per-session trigger pipeline state and orchestration. All mutation stays
|
||||||
|
* inside; MenuView renders from {@link InputTriggerController.menu} and routes
|
||||||
|
* pointer picks back through {@link InputTriggerController.pick}.
|
||||||
|
*/
|
||||||
|
var InputTriggerController = class {
|
||||||
|
deps;
|
||||||
|
/** Menu state store (per-session; survives session switches, dies with the scope). */
|
||||||
|
menu = (0, _deepseek_ai_dsh_client_runtime_client.createSnapshotStore)(MENU_CLOSED);
|
||||||
|
/**
|
||||||
|
* Name of the source opened through the programmatic launcher, or null for
|
||||||
|
* trigger-detected/closed menus. Composer chrome subscribes to this store
|
||||||
|
* for the launcher's expanded state without owning a second menu model.
|
||||||
|
*/
|
||||||
|
launcher = (0, _deepseek_ai_dsh_client_runtime_client.createSnapshotStore)(null);
|
||||||
|
/**
|
||||||
|
* Aggregated hot reference lexicon, grouped by trigger (plain-text-reference decision;
|
||||||
|
* see .agents/notes/implemented/architecture/2026-07-25-web-input-machine-and-slash-pipeline.md):
|
||||||
|
* sources implementing the lexicon hook are polled with the session
|
||||||
|
* projection; undefined answers (roll not hot yet) are skipped; multiple
|
||||||
|
* sources on one trigger concatenate in registration order. A snapshot
|
||||||
|
* store because rolls change asynchronously (catalog settles, children
|
||||||
|
* spawn/exit) — render-side consumers subscribe instead of re-reading a
|
||||||
|
* mutable answer.
|
||||||
|
*/
|
||||||
|
lexicon = (0, _deepseek_ai_dsh_client_runtime_client.createSnapshotStore)(/* @__PURE__ */ new Map());
|
||||||
|
/** The authoritative hit: single truth for span CAS material (menu snapshot never carries it alone). */
|
||||||
|
hit = null;
|
||||||
|
fetch = null;
|
||||||
|
disposed = false;
|
||||||
|
/** Per-source lexicon unsubscribers (sources without the hook never enter). */
|
||||||
|
lexiconOffs = /* @__PURE__ */ new Map();
|
||||||
|
constructor(deps) {
|
||||||
|
this.deps = deps;
|
||||||
|
const projection = this.project();
|
||||||
|
for (const src of deps.roster.all()) {
|
||||||
|
src.warm?.(projection);
|
||||||
|
this.watchLexicon(src, projection);
|
||||||
|
}
|
||||||
|
this.refreshLexicon();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Feed a draft/caret change through trigger detection and drive the menu.
|
||||||
|
* @param draft - full draft text.
|
||||||
|
* @param caret - caret offset into `draft`.
|
||||||
|
* @param guard - availability tier derived from the input phase.
|
||||||
|
* @param draftRev - the input machine's current draft revision, stamped
|
||||||
|
* into the hit span for pick-time CAS.
|
||||||
|
*/
|
||||||
|
track(draft, caret, guard, draftRev) {
|
||||||
|
if (this.disposed) return;
|
||||||
|
const launched = this.launcher.getSnapshot() !== null;
|
||||||
|
this.clearLauncher();
|
||||||
|
const raw = detectTrigger(draft, caret, guard);
|
||||||
|
if (raw === null) {
|
||||||
|
this.hit = null;
|
||||||
|
this.stopFetch();
|
||||||
|
this.reduce({ type: "close" });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const hit = {
|
||||||
|
...raw,
|
||||||
|
span: {
|
||||||
|
...raw.span,
|
||||||
|
draftRev
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const prev = this.menu.getSnapshot();
|
||||||
|
const same = !launched && prev.open && prev.hit !== null && prev.hit.trigger === hit.trigger && prev.hit.query === hit.query && prev.hit.span.start === hit.span.start && prev.hit.span.end === hit.span.end;
|
||||||
|
this.hit = hit;
|
||||||
|
if (same) return;
|
||||||
|
const roster = this.deps.roster.sources(hit.trigger);
|
||||||
|
if (roster.length === 0) {
|
||||||
|
this.stopFetch();
|
||||||
|
this.reduce({ type: "close" });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (launched || !prev.open || prev.hit === null || prev.hit.trigger !== hit.trigger) this.menu.set(seedGroups(this.menu.getSnapshot(), roster.map((s) => s.name)));
|
||||||
|
this.reduce({
|
||||||
|
type: "hit",
|
||||||
|
hit
|
||||||
|
});
|
||||||
|
this.fetchCandidates(hit, roster);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Toggle a menu containing exactly one registered source. The supplied hit
|
||||||
|
* is a synthetic selection span rather than a typed trigger token, but
|
||||||
|
* picks deliberately reuse the ordinary source callback and scoped input
|
||||||
|
* mutation pipeline.
|
||||||
|
* @param source - registered source name under `hit.trigger`.
|
||||||
|
* @param hit - synthetic hit carrying position and pick-time draft CAS.
|
||||||
|
*/
|
||||||
|
toggleSource(source, hit) {
|
||||||
|
if (this.disposed) return;
|
||||||
|
if (this.launcher.getSnapshot() === source && this.menu.getSnapshot().open) {
|
||||||
|
this.dismiss();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const match = this.deps.roster.sources(hit.trigger).find((item) => item.name === source);
|
||||||
|
if (match === void 0) {
|
||||||
|
this.dismiss();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.stopFetch();
|
||||||
|
this.hit = hit;
|
||||||
|
this.launcher.set(source);
|
||||||
|
this.menu.set(seedGroups(this.menu.getSnapshot(), [source]));
|
||||||
|
this.reduce({
|
||||||
|
type: "hit",
|
||||||
|
hit
|
||||||
|
});
|
||||||
|
this.fetchCandidates(hit, [match]);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Pointer pick from MenuView: route the clicked candidate through onPick
|
||||||
|
* and execute claim/insert outcomes via the scoped input events.
|
||||||
|
* @param source - source (group) name.
|
||||||
|
* @param index - candidate index within the group.
|
||||||
|
*/
|
||||||
|
pick(source, index) {
|
||||||
|
const state = this.menu.getSnapshot();
|
||||||
|
const hit = this.hit;
|
||||||
|
if (this.disposed || !state.open || hit === null) return;
|
||||||
|
const group = state.groups.find((g) => g.source === source);
|
||||||
|
const candidate = group !== void 0 && group.status === "ready" ? group.items[index] : void 0;
|
||||||
|
if (candidate === void 0) return;
|
||||||
|
const src = this.deps.roster.sources(hit.trigger).find((s) => s.name === source);
|
||||||
|
if (src === void 0) return;
|
||||||
|
const outcome = src.onPick({
|
||||||
|
candidate,
|
||||||
|
session: this.project(),
|
||||||
|
position: hit.position,
|
||||||
|
via: "menu",
|
||||||
|
span: hit.span
|
||||||
|
});
|
||||||
|
this.stopFetch();
|
||||||
|
this.reduce({ type: "close" });
|
||||||
|
this.execute(outcome, hit.span);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Keyboard arbitration while the menu is open.
|
||||||
|
* @param key - intercepted key.
|
||||||
|
* @param composing - inside IME composition: everything passes.
|
||||||
|
* @returns consumed / pick-highlighted / pass.
|
||||||
|
*/
|
||||||
|
arbitrate(key, composing) {
|
||||||
|
if (composing || this.disposed) return "pass";
|
||||||
|
const state = this.menu.getSnapshot();
|
||||||
|
if (!state.open) return "pass";
|
||||||
|
switch (key) {
|
||||||
|
case "up":
|
||||||
|
this.reduce({
|
||||||
|
type: "move",
|
||||||
|
dir: -1
|
||||||
|
});
|
||||||
|
return "consumed";
|
||||||
|
case "down":
|
||||||
|
this.reduce({
|
||||||
|
type: "move",
|
||||||
|
dir: 1
|
||||||
|
});
|
||||||
|
return "consumed";
|
||||||
|
case "escape":
|
||||||
|
this.stopFetch();
|
||||||
|
this.reduce({ type: "close" });
|
||||||
|
return "consumed";
|
||||||
|
case "enter":
|
||||||
|
if (state.highlight === null) return "pass";
|
||||||
|
this.pick(state.highlight.source, state.highlight.index);
|
||||||
|
return "pick-highlighted";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Space adjudication over the just-completed leading token: polls sources'
|
||||||
|
* matchSpace (hot state, synchronous) and dispatches the outcome itself.
|
||||||
|
* @returns true when a claim/insert was actually applied by the input —
|
||||||
|
* the caller preventDefaults exactly then.
|
||||||
|
*/
|
||||||
|
onSpace() {
|
||||||
|
const hit = this.hit;
|
||||||
|
if (this.disposed || hit === null || hit.position !== "leading") return false;
|
||||||
|
const token = hit.trigger + hit.query;
|
||||||
|
const projection = this.project();
|
||||||
|
for (const src of this.deps.roster.sources(hit.trigger)) {
|
||||||
|
if (src.matchSpace === void 0) continue;
|
||||||
|
const outcome = src.matchSpace(projection, token);
|
||||||
|
if (outcome === void 0) continue;
|
||||||
|
if (outcome === "handled") return true;
|
||||||
|
return this.execute(outcome, hit.span);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Serialize one reference occurrence to its model form via the owning
|
||||||
|
* source's codec (prompt serialization: registry → explicit
|
||||||
|
* call → await). Owner missing or codec-less rejects — the submit attempt
|
||||||
|
* blocks instead of silently downgrading to the clipboard text.
|
||||||
|
* @param source - owning source name.
|
||||||
|
* @param ref - owner-scoped reference id.
|
||||||
|
* @param signal - the submit attempt's abort signal.
|
||||||
|
* @returns the model representation (e.g. `<skill>name</skill>`).
|
||||||
|
*/
|
||||||
|
serializeReference(source, ref, signal) {
|
||||||
|
const owner = this.deps.roster.all().find((s) => s.name === source);
|
||||||
|
if (owner?.codec === void 0) return Promise.reject(/* @__PURE__ */ new Error(`slash: no serializer for reference source "${source}"`));
|
||||||
|
return owner.codec.serialize(ref, signal);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Enter last adjudication: polls sources' matchEnter in registration
|
||||||
|
* order, first non-undefined wins. The outcome returns to the caller (the
|
||||||
|
* input machine applies it inside the same submit attempt — no event).
|
||||||
|
* @param line - trimmed draft; the leading char selects the trigger roster.
|
||||||
|
* @param signal - attempt-scoped abort from the input machine.
|
||||||
|
* @returns the winning outcome or undefined (default sink). Rejects when a
|
||||||
|
* polled source's warmup fails — the caller must not silently downgrade.
|
||||||
|
*/
|
||||||
|
async adjudicate(line, signal) {
|
||||||
|
const projection = this.project();
|
||||||
|
for (const src of this.deps.roster.all()) {
|
||||||
|
if (signal.aborted) throw signal.reason instanceof Error ? signal.reason : /* @__PURE__ */ new Error("slash adjudication aborted");
|
||||||
|
if (src.matchEnter === void 0 || !line.startsWith(src.trigger)) continue;
|
||||||
|
const outcome = await src.matchEnter(projection, line, signal);
|
||||||
|
if (outcome !== void 0) return outcome;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Drop the menu group of a disposed source (root registry change notification).
|
||||||
|
* @param source - the source whose registration was disposed.
|
||||||
|
*/
|
||||||
|
sourceRemoved(source) {
|
||||||
|
const state = this.menu.getSnapshot();
|
||||||
|
if (state.open && state.hit !== null && state.hit.trigger === source.trigger) this.reduce({
|
||||||
|
type: "source-failed",
|
||||||
|
generation: state.generation,
|
||||||
|
source: source.name
|
||||||
|
});
|
||||||
|
this.lexiconOffs.get(source)?.();
|
||||||
|
this.lexiconOffs.delete(source);
|
||||||
|
this.refreshLexicon();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Admit a source registered after this controller's birth (root registry
|
||||||
|
* change notification): warm it and fold its roll into the live lexicon —
|
||||||
|
* the constructor-time prewarm covers only the roster present at scope
|
||||||
|
* birth.
|
||||||
|
* @param source - the newly registered source.
|
||||||
|
*/
|
||||||
|
sourceAdded(source) {
|
||||||
|
const projection = this.project();
|
||||||
|
source.warm?.(projection);
|
||||||
|
this.watchLexicon(source, projection);
|
||||||
|
this.refreshLexicon();
|
||||||
|
}
|
||||||
|
/** External dismiss (e.g. pointer outside the composer area). */
|
||||||
|
dismiss() {
|
||||||
|
if (this.disposed) return;
|
||||||
|
this.stopFetch();
|
||||||
|
this.reduce({ type: "close" });
|
||||||
|
}
|
||||||
|
/** Scope teardown: close and abort (the service deletes the map entry). */
|
||||||
|
dispose() {
|
||||||
|
this.disposed = true;
|
||||||
|
this.stopFetch();
|
||||||
|
this.reduce({ type: "close" });
|
||||||
|
this.hit = null;
|
||||||
|
for (const off of this.lexiconOffs.values()) off();
|
||||||
|
this.lexiconOffs.clear();
|
||||||
|
}
|
||||||
|
/** The session projection handed to sources (agent-backed identity; constant per scope). */
|
||||||
|
project() {
|
||||||
|
return { sessionId: this.deps.sessionId };
|
||||||
|
}
|
||||||
|
/** Execute a claim/insert/text outcome via the scoped input events (actx as dispatch subject); true = the input applied it. */
|
||||||
|
execute(outcome, span) {
|
||||||
|
const { actx } = this.deps;
|
||||||
|
if (outcome === void 0 || outcome === "handled") return false;
|
||||||
|
if ("claim" in outcome) return actx.bail(actx, "slash/input-begin-command", {
|
||||||
|
claim: outcome.claim,
|
||||||
|
span
|
||||||
|
}) === true;
|
||||||
|
if ("text" in outcome) return actx.bail(actx, "slash/input-insert-text", {
|
||||||
|
text: outcome.text,
|
||||||
|
span
|
||||||
|
}) === true;
|
||||||
|
return actx.bail(actx, "slash/input-insert-reference", {
|
||||||
|
reference: outcome.insert,
|
||||||
|
span
|
||||||
|
}) === true;
|
||||||
|
}
|
||||||
|
/** Re-poll every lexicon-bearing source and publish the aggregated rolls (see the store doc). */
|
||||||
|
refreshLexicon() {
|
||||||
|
const projection = this.project();
|
||||||
|
const rolls = /* @__PURE__ */ new Map();
|
||||||
|
for (const src of this.deps.roster.all()) {
|
||||||
|
if (src.lexicon === void 0) continue;
|
||||||
|
let names;
|
||||||
|
try {
|
||||||
|
names = src.lexicon(projection);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`[ui-input-trigger] source "${src.name}" lexicon failed:`, error);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (names === void 0) continue;
|
||||||
|
const prev = rolls.get(src.trigger);
|
||||||
|
rolls.set(src.trigger, prev === void 0 ? names : [...prev, ...names]);
|
||||||
|
}
|
||||||
|
this.lexicon.set(rolls);
|
||||||
|
}
|
||||||
|
/** Wire one source's lexicon invalidation channel into refresh (hookless or roll-less sources never notify). */
|
||||||
|
watchLexicon(source, projection) {
|
||||||
|
if (source.lexicon === void 0 || source.subscribeLexicon === void 0) return;
|
||||||
|
this.lexiconOffs.set(source, source.subscribeLexicon(projection, () => {
|
||||||
|
this.refreshLexicon();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
/** Launch the candidate fetch for one hit generation, superseding the previous one. */
|
||||||
|
fetchCandidates(hit, roster) {
|
||||||
|
this.stopFetch();
|
||||||
|
const controller = new AbortController();
|
||||||
|
this.fetch = controller;
|
||||||
|
const generation = this.menu.getSnapshot().generation;
|
||||||
|
const projection = this.project();
|
||||||
|
for (const source of roster) source.candidates(projection, {
|
||||||
|
query: hit.query,
|
||||||
|
position: hit.position,
|
||||||
|
signal: controller.signal
|
||||||
|
}).then((items) => {
|
||||||
|
if (controller.signal.aborted) return;
|
||||||
|
this.reduce({
|
||||||
|
type: "source-settled",
|
||||||
|
generation,
|
||||||
|
source: source.name,
|
||||||
|
items
|
||||||
|
});
|
||||||
|
}, (error) => {
|
||||||
|
if (controller.signal.aborted) return;
|
||||||
|
console.error(`[ui-input-trigger] source "${source.name}" candidates failed:`, error);
|
||||||
|
this.reduce({
|
||||||
|
type: "source-failed",
|
||||||
|
generation,
|
||||||
|
source: source.name
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
stopFetch() {
|
||||||
|
this.fetch?.abort();
|
||||||
|
this.fetch = null;
|
||||||
|
}
|
||||||
|
clearLauncher() {
|
||||||
|
if (this.launcher.getSnapshot() !== null) this.launcher.set(null);
|
||||||
|
}
|
||||||
|
reduce(ev) {
|
||||||
|
const cur = this.menu.getSnapshot();
|
||||||
|
const next = menuReduce(cur, ev);
|
||||||
|
if (next !== cur) this.menu.set(next);
|
||||||
|
if (!next.open) this.clearLauncher();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/service.js
|
||||||
|
/**
|
||||||
|
* InputTriggerService (`ctx.inputTriggers`): the root half of the trigger pipeline — the
|
||||||
|
* stateless source registry plus the per-session controller map. Every piece
|
||||||
|
* of mutable interaction state (hit, menu, fetch) lives on the
|
||||||
|
* {@link InputTriggerController}; the service only registers sources, resolves
|
||||||
|
* controllers by session scope, and relays roster changes.
|
||||||
|
*/
|
||||||
|
/** The `ctx.inputTriggers` trigger pipeline service (root registry + controller resolution). */
|
||||||
|
var InputTriggerService = class extends _deepseek_ai_cordis.Service {
|
||||||
|
static inject = ["sessions"];
|
||||||
|
live = {
|
||||||
|
sources: [],
|
||||||
|
controllers: /* @__PURE__ */ new Map()
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @param ctx - owning root context (the service registers itself as `slash`).
|
||||||
|
*/
|
||||||
|
constructor(ctx) {
|
||||||
|
super(ctx, "inputTriggers");
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Register one trigger source. Live session controllers are notified so a
|
||||||
|
* source arriving after scope birth still warms and joins the lexicon.
|
||||||
|
* @param src - the source; (trigger, name) must be unique — duplicates throw.
|
||||||
|
* @returns the disposer (callers wrap registration in ctx.effect). Disposal
|
||||||
|
* while a controller shows the source's menu group drops that group.
|
||||||
|
*/
|
||||||
|
registerSource(src) {
|
||||||
|
const { live } = this;
|
||||||
|
if (live.sources.some((s) => s.trigger === src.trigger && s.name === src.name)) throw new Error(`slash source "${src.trigger}${src.name}" is already registered`);
|
||||||
|
live.sources.push(src);
|
||||||
|
for (const controller of live.controllers.values()) try {
|
||||||
|
controller.sourceAdded(src);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`[ui-input-trigger] source "${src.trigger}${src.name}" late-registration setup failed:`, error);
|
||||||
|
}
|
||||||
|
return () => {
|
||||||
|
const at = live.sources.indexOf(src);
|
||||||
|
if (at < 0) return;
|
||||||
|
live.sources.splice(at, 1);
|
||||||
|
for (const controller of live.controllers.values()) controller.sourceRemoved(src);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Resolve the per-session controller for one session scope (lazy; the
|
||||||
|
* scope disposer removes and disposes it). Construction warms the source
|
||||||
|
* roster once — sessions are always agent-backed, so scope birth is the
|
||||||
|
* single prewarm moment.
|
||||||
|
* @param actx - session-scope ctx.
|
||||||
|
* @returns the resident controller.
|
||||||
|
*/
|
||||||
|
sessionOf(actx) {
|
||||||
|
const id = this.sessions().scopeOf(actx);
|
||||||
|
if (id === void 0) throw new Error("slash.sessionOf requires a session scope");
|
||||||
|
const { live } = this;
|
||||||
|
const existing = live.controllers.get(id);
|
||||||
|
if (existing !== void 0) return existing;
|
||||||
|
const controller = new InputTriggerController({
|
||||||
|
actx,
|
||||||
|
sessionId: id,
|
||||||
|
roster: {
|
||||||
|
sources: (trigger) => live.sources.filter((s) => s.trigger === trigger).sort((a, b) => (a.order ?? 0) - (b.order ?? 0)),
|
||||||
|
all: () => live.sources
|
||||||
|
}
|
||||||
|
});
|
||||||
|
live.controllers.set(id, controller);
|
||||||
|
actx.effect(() => () => {
|
||||||
|
controller.dispose();
|
||||||
|
live.controllers.delete(id);
|
||||||
|
}, "slash: session controller");
|
||||||
|
return controller;
|
||||||
|
}
|
||||||
|
sessions() {
|
||||||
|
const sessions = this.ctx.get("sessions");
|
||||||
|
if (sessions === void 0) throw new Error("ui-input-trigger: sessions service unavailable");
|
||||||
|
return sessions;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region ../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
||||||
|
function r(e) {
|
||||||
|
var t, f, n = "";
|
||||||
|
if ("string" == typeof e || "number" == typeof e) n += e;
|
||||||
|
else if ("object" == typeof e) if (Array.isArray(e)) {
|
||||||
|
var o = e.length;
|
||||||
|
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
||||||
|
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
function clsx() {
|
||||||
|
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-input-trigger/src/client/MenuView.module.css.mjs
|
||||||
|
const css = "._3e4SsG_menu{z-index:100;--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border:1px solid var(--dsw-alias-border-inverted);background:var(--dsw-specific-menu);min-width:min(260px,100%);max-width:min(537px,100%);max-height:320px;box-shadow:var(--dsw-shadow-lv3);border-radius:12px;flex-direction:column;padding:4px;display:flex;position:absolute;bottom:calc(100% + 4px);left:0;overflow:hidden}._3e4SsG_viewport{flex-direction:column;min-height:0;display:flex;overflow-y:auto}._3e4SsG_item{cursor:pointer;width:100%;min-height:40px;color:var(--dsw-alias-label-primary);text-align:left;background:0 0;border:none;border-radius:10px;align-items:center;gap:8px;padding:8px 10px;font-size:14px;line-height:22px;display:flex}._3e4SsG_item:hover,._3e4SsG_item._3e4SsG_active{background:var(--dsw-alias-interactive-bg-hover)}._3e4SsG_itemIcon{width:16px;height:16px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;display:inline-flex}._3e4SsG_itemName{text-overflow:ellipsis;white-space:nowrap;flex:none;max-width:40%;overflow:hidden}._3e4SsG_itemDescription{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-tertiary);flex:1;overflow:hidden}._3e4SsG_groupTitle{color:var(--dsw-alias-label-tertiary);padding:8px 10px;font-size:12px;line-height:16px}._3e4SsG_loading{min-height:40px;color:var(--dsw-alias-label-dimmed);align-items:center;padding:8px 10px;font-size:14px;line-height:22px;display:flex}";
|
||||||
|
const tagId = "@deepseek-ai/dsh-client-ui-input-trigger/MenuView.module.css";
|
||||||
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
||||||
|
const tag = document.createElement("style");
|
||||||
|
tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-input-trigger";
|
||||||
|
tag.dataset.pluginCss = tagId;
|
||||||
|
tag.textContent = css;
|
||||||
|
document.head.appendChild(tag);
|
||||||
|
}
|
||||||
|
var MenuView_module_css_default = {
|
||||||
|
"item": "_3e4SsG_item",
|
||||||
|
"viewport": "_3e4SsG_viewport",
|
||||||
|
"loading": "_3e4SsG_loading",
|
||||||
|
"menu": "_3e4SsG_menu",
|
||||||
|
"itemDescription": "_3e4SsG_itemDescription",
|
||||||
|
"groupTitle": "_3e4SsG_groupTitle",
|
||||||
|
"itemName": "_3e4SsG_itemName",
|
||||||
|
"itemIcon": "_3e4SsG_itemIcon",
|
||||||
|
"active": "_3e4SsG_active"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/MenuView.js
|
||||||
|
/**
|
||||||
|
* Trigger candidate menu: renders the InputTriggerService menu store into the
|
||||||
|
* conversation.input.overlay anchor. Closed state renders null (the overlay
|
||||||
|
* slot stays mounted); groups render in roster order under localized title
|
||||||
|
* rows, pending groups as a loading row; pointer picks route back through
|
||||||
|
* the service (combobox pattern — focus never leaves the textarea, so rows
|
||||||
|
* are mousedown-handled and the highlight is exposed via
|
||||||
|
* aria-activedescendant on the listbox).
|
||||||
|
*/
|
||||||
|
/** Design cap on the list height (figma SLASH 39:26572 MenuDropdown). */
|
||||||
|
const MAX_HEIGHT = 320;
|
||||||
|
/** DOM id of one option row (the aria-activedescendant target). */
|
||||||
|
function optionId(source, index) {
|
||||||
|
return `dsh-slash-option-${source}-${index}`;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Render the candidate menu overlay entry.
|
||||||
|
* @param props - injected face (the menu store and the pick route); `t` rides the standard locale seat.
|
||||||
|
* @returns the dropdown while open; null while closed.
|
||||||
|
*/
|
||||||
|
function MenuView({ menu, onPick, onDismiss, t }) {
|
||||||
|
const state = (0, react.useSyncExternalStore)((fn) => menu.subscribe(fn), () => menu.getSnapshot());
|
||||||
|
const listRef = (0, react.useRef)(null);
|
||||||
|
const maxHeight = (0, _deepseek_ai_dsh_client_ui_primitives.useAnchoredMaxHeight)(listRef, MAX_HEIGHT, state);
|
||||||
|
const highlight = state.open ? state.highlight : null;
|
||||||
|
(0, react.useEffect)(() => {
|
||||||
|
if (highlight === null) return;
|
||||||
|
document.getElementById(optionId(highlight.source, highlight.index))?.scrollIntoView({ block: "nearest" });
|
||||||
|
}, [highlight]);
|
||||||
|
(0, react.useEffect)(() => {
|
||||||
|
if (!state.open) return;
|
||||||
|
const onPointerDown = (ev) => {
|
||||||
|
if (!(ev.target instanceof Node)) return;
|
||||||
|
if (listRef.current?.contains(ev.target)) return;
|
||||||
|
if ((listRef.current?.closest("[data-composer-card]"))?.contains(ev.target)) return;
|
||||||
|
onDismiss();
|
||||||
|
};
|
||||||
|
document.addEventListener("pointerdown", onPointerDown, true);
|
||||||
|
return () => {
|
||||||
|
document.removeEventListener("pointerdown", onPointerDown, true);
|
||||||
|
};
|
||||||
|
}, [state.open, onDismiss]);
|
||||||
|
if (!state.open) return null;
|
||||||
|
return (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
ref: listRef,
|
||||||
|
className: MenuView_module_css_default.menu,
|
||||||
|
style: { maxHeight },
|
||||||
|
role: "listbox",
|
||||||
|
"aria-label": t("suggestions.aria"),
|
||||||
|
"aria-activedescendant": highlight !== null ? optionId(highlight.source, highlight.index) : void 0,
|
||||||
|
children: (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: MenuView_module_css_default.viewport,
|
||||||
|
children: state.groups.map((group) => group.status === "ready" && group.items.length === 0 ? null : (0, react_jsx_runtime.jsxs)(react.Fragment, { children: [(0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: MenuView_module_css_default.groupTitle,
|
||||||
|
role: "presentation",
|
||||||
|
"data-source": group.source,
|
||||||
|
children: t(group.source)
|
||||||
|
}), group.status === "pending" ? (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: MenuView_module_css_default.loading,
|
||||||
|
"data-source": group.source,
|
||||||
|
children: t("loading")
|
||||||
|
}) : group.items.map((item, index) => {
|
||||||
|
const active = highlight !== null && highlight.source === group.source && highlight.index === index;
|
||||||
|
return (0, react_jsx_runtime.jsxs)("button", {
|
||||||
|
id: optionId(group.source, index),
|
||||||
|
type: "button",
|
||||||
|
role: "option",
|
||||||
|
"aria-selected": active,
|
||||||
|
className: clsx(MenuView_module_css_default.item, active && MenuView_module_css_default.active),
|
||||||
|
onMouseDown: (ev) => {
|
||||||
|
ev.preventDefault();
|
||||||
|
onPick(group.source, index);
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
item.icon !== void 0 && (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: MenuView_module_css_default.itemIcon,
|
||||||
|
"aria-hidden": true,
|
||||||
|
children: item.icon
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: MenuView_module_css_default.itemName,
|
||||||
|
children: item.name
|
||||||
|
}),
|
||||||
|
item.description !== void 0 && (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: MenuView_module_css_default.itemDescription,
|
||||||
|
children: item.description
|
||||||
|
})
|
||||||
|
]
|
||||||
|
}, `${group.source}:${item.name}`);
|
||||||
|
})] }, group.source))
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/locales.js
|
||||||
|
/**
|
||||||
|
* `slash.menu` namespace dictionaries: group titles keyed by source name
|
||||||
|
* (the lookup chain returns the key itself, so an unknown source shows its
|
||||||
|
* raw name), the pending row, and the listbox aria label.
|
||||||
|
*/
|
||||||
|
/** Simplified Chinese dictionary (the key-set source of truth). */
|
||||||
|
const zh = {
|
||||||
|
"command": "命令",
|
||||||
|
"skill": "技能",
|
||||||
|
"subagent": "子智能体",
|
||||||
|
"loading": "正在加载…",
|
||||||
|
"suggestions.aria": "触发候选建议"
|
||||||
|
};
|
||||||
|
/** English dictionary, checked complete against the zh key set. */
|
||||||
|
const en = {
|
||||||
|
"command": "Commands",
|
||||||
|
"skill": "Skills",
|
||||||
|
"subagent": "Subagents",
|
||||||
|
"loading": "Loading…",
|
||||||
|
"suggestions.aria": "Trigger suggestions"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/index.js
|
||||||
|
/** Namespace owning the candidate-menu copy. */
|
||||||
|
const MENU_NS = "slash.menu";
|
||||||
|
/** Required services: controller resolution reads the session scope tree; the menu copy is localized. */
|
||||||
|
const inject = ["sessions", "locale"];
|
||||||
|
/**
|
||||||
|
* Client plugin body: mount the service, then register MenuView into the
|
||||||
|
* input overlay once its declarer is up.
|
||||||
|
* @param ctx - client root context.
|
||||||
|
*/
|
||||||
|
function apply(ctx) {
|
||||||
|
ctx.plugin(InputTriggerService);
|
||||||
|
ctx.effect(() => ctx.locale.register(MENU_NS, {
|
||||||
|
zh,
|
||||||
|
en
|
||||||
|
}), "ui-input-trigger: menu dictionaries");
|
||||||
|
ctx.inject([
|
||||||
|
"slots",
|
||||||
|
"inputTriggers",
|
||||||
|
"sessions"
|
||||||
|
], (scope) => {
|
||||||
|
const inputTriggers = scope.inputTriggers;
|
||||||
|
const sessions = scope.sessions;
|
||||||
|
scope.slots.inject("conversation.input.overlay", () => scope.slots.register({
|
||||||
|
name: "conversation.input.overlay",
|
||||||
|
id: "slash-menu",
|
||||||
|
order: 0,
|
||||||
|
locale: MENU_NS,
|
||||||
|
inject: (sessionId) => {
|
||||||
|
const actx = sessions.scope(sessionId);
|
||||||
|
if (actx === void 0) throw new Error(`ui-input-trigger: session "${String(sessionId)}" resolved no scope`);
|
||||||
|
const controller = inputTriggers.sessionOf(actx);
|
||||||
|
return {
|
||||||
|
menu: controller.menu,
|
||||||
|
onPick: (source, index) => {
|
||||||
|
controller.pick(source, index);
|
||||||
|
},
|
||||||
|
onDismiss: () => {
|
||||||
|
controller.dismiss();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}, MenuView));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
exports.InputTriggerController = InputTriggerController;
|
||||||
|
exports.InputTriggerService = InputTriggerService;
|
||||||
|
exports.apply = apply;
|
||||||
|
exports.inject = inject;
|
||||||
|
return module.exports;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//# sourceMappingURL=client.js.map
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,710 @@
|
|||||||
|
window.__ModuleLoader__.load({
|
||||||
|
id: "@deepseek-ai/dsh-client-ui-subagent",
|
||||||
|
factory: (require) => {
|
||||||
|
var module = { exports: {} };
|
||||||
|
var exports = module.exports;
|
||||||
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||||
|
let react_jsx_runtime = require("react/jsx-runtime");
|
||||||
|
let react = require("react");
|
||||||
|
let _deepseek_ai_dsh_client_runtime_client = require("@deepseek-ai/dsh-client-runtime/client");
|
||||||
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
||||||
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-subagent/src/client/SubagentCatalogAction.module.css.mjs
|
||||||
|
const css$1 = ".h8S2Va_root{position:relative}.h8S2Va_trigger{min-height:28px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;border-radius:6px;align-items:center;gap:3px;padding:3px 2px;font-size:12px;line-height:18px;display:inline-flex}.h8S2Va_count{margin:0 5px}.h8S2Va_activitySlot{flex:none;width:10px;height:10px;display:inline-flex}.h8S2Va_trigger:hover,.h8S2Va_trigger:focus-visible{color:var(--dsw-alias-label-secondary)}.h8S2Va_trigger svg{transition:transform .12s}.h8S2Va_triggerOpen{transform:rotate(180deg)}.h8S2Va_menu{z-index:100;box-sizing:border-box;background:var(--dsw-specific-menu);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);width:336px;max-width:min(400px,100vw - 32px);max-height:min(560px,100vh - 140px);box-shadow:var(--dsw-shadow-lv3);border-radius:12px;flex-direction:column;padding:4px;display:flex;position:absolute;top:calc(100% + 5px);left:0;overflow:auto}.h8S2Va_node{min-width:0;position:relative}.h8S2Va_menu>.h8S2Va_node{margin-left:-3px}.h8S2Va_row{box-sizing:border-box;width:100%;min-height:50px;color:var(--dsw-alias-label-primary);text-align:left;cursor:pointer;background:0 0;border:0;border-radius:8px;outline:none;align-items:flex-start;gap:8px;padding:7px 8px 7px 11px;font-size:13px;line-height:18px;display:flex;position:relative}.h8S2Va_row:hover>.h8S2Va_clickarea,.h8S2Va_row:focus-visible>.h8S2Va_clickarea{background:var(--dsw-alias-interactive-bg-hover)}.h8S2Va_clickarea{box-sizing:border-box;border-radius:8px;flex:1;align-self:stretch;align-items:flex-start;gap:8px;min-width:0;margin:-7px -8px;padding:7px 8px;display:flex}.h8S2Va_row>[data-state],.h8S2Va_clickarea>[data-state]{margin-top:4px}.h8S2Va_disabled{color:var(--dsw-alias-label-dimmed);cursor:not-allowed}.h8S2Va_disabled:hover{background:0 0}.h8S2Va_loadingRow{cursor:default}.h8S2Va_disclosure,.h8S2Va_disclosureSpace{flex:none;width:14px;height:18px}.h8S2Va_disclosure{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:0;justify-content:center;align-items:center;padding:0;transition:transform .12s;display:inline-flex}.h8S2Va_disclosure:hover{color:var(--dsw-alias-label-primary)}.h8S2Va_disclosureOpen{transform:rotate(90deg)}.h8S2Va_content{flex-direction:column;flex:1;min-width:0;display:flex}.h8S2Va_label,.h8S2Va_summary{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.h8S2Va_label{color:inherit;font-weight:400}.h8S2Va_summary,.h8S2Va_metrics{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}.h8S2Va_metrics{font-variant-numeric:tabular-nums;text-align:right;white-space:nowrap;flex:none;grid-template-rows:18px 16px;display:grid}.h8S2Va_metricToken{grid-row:1;line-height:18px}.h8S2Va_metricDuration{grid-row:2}.h8S2Va_children{margin-left:18px;padding-left:4px;position:relative}.h8S2Va_children:before,.h8S2Va_children>.h8S2Va_node:before{content:\"\";border-left:1px solid var(--dsw-alias-border-l2);position:absolute;left:0}.h8S2Va_children:before{height:26px;top:-26px}.h8S2Va_children[aria-busy=true]:before{content:none}.h8S2Va_children>.h8S2Va_node:before{top:0;bottom:0;left:-4px}.h8S2Va_children>.h8S2Va_node:last-child:before{height:17px;bottom:auto}.h8S2Va_children>.h8S2Va_node>.h8S2Va_row:before{content:\"\";border-top:1px solid var(--dsw-alias-border-l2);width:14px;position:absolute;top:16px;left:-4px}.h8S2Va_notice,.h8S2Va_error{color:var(--dsw-alias-label-tertiary);padding:10px 12px;font-size:12px;line-height:18px}.h8S2Va_error{color:var(--dsw-alias-state-error-primary);justify-content:space-between;align-items:center;gap:12px;display:flex}.h8S2Va_refresh{color:inherit;cursor:pointer;background:0 0;border:0;border-radius:6px;flex:none;align-items:center;gap:4px;padding:4px 6px;display:inline-flex}.h8S2Va_refresh:hover{background:var(--dsw-alias-interactive-bg-hover)}";
|
||||||
|
const tagId$1 = "@deepseek-ai/dsh-client-ui-subagent/SubagentCatalogAction.module.css";
|
||||||
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
|
||||||
|
const tag = document.createElement("style");
|
||||||
|
tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-subagent";
|
||||||
|
tag.dataset.pluginCss = tagId$1;
|
||||||
|
tag.textContent = css$1;
|
||||||
|
document.head.appendChild(tag);
|
||||||
|
}
|
||||||
|
var SubagentCatalogAction_module_css_default = {
|
||||||
|
"triggerOpen": "h8S2Va_triggerOpen",
|
||||||
|
"loadingRow": "h8S2Va_loadingRow",
|
||||||
|
"clickarea": "h8S2Va_clickarea",
|
||||||
|
"children": "h8S2Va_children",
|
||||||
|
"metricToken": "h8S2Va_metricToken",
|
||||||
|
"root": "h8S2Va_root",
|
||||||
|
"count": "h8S2Va_count",
|
||||||
|
"activitySlot": "h8S2Va_activitySlot",
|
||||||
|
"node": "h8S2Va_node",
|
||||||
|
"menu": "h8S2Va_menu",
|
||||||
|
"metrics": "h8S2Va_metrics",
|
||||||
|
"notice": "h8S2Va_notice",
|
||||||
|
"disclosureOpen": "h8S2Va_disclosureOpen",
|
||||||
|
"disclosure": "h8S2Va_disclosure",
|
||||||
|
"disabled": "h8S2Va_disabled",
|
||||||
|
"error": "h8S2Va_error",
|
||||||
|
"content": "h8S2Va_content",
|
||||||
|
"label": "h8S2Va_label",
|
||||||
|
"row": "h8S2Va_row",
|
||||||
|
"summary": "h8S2Va_summary",
|
||||||
|
"trigger": "h8S2Va_trigger",
|
||||||
|
"refresh": "h8S2Va_refresh",
|
||||||
|
"disclosureSpace": "h8S2Va_disclosureSpace",
|
||||||
|
"metricDuration": "h8S2Va_metricDuration"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/SubagentCatalogAction.js
|
||||||
|
function diagnosticReason(entry, t) {
|
||||||
|
switch (entry.reason) {
|
||||||
|
case "corrupt": return t("diagnostic.corrupt");
|
||||||
|
case "unsupported": return t("diagnostic.unsupported");
|
||||||
|
case "unavailable": return t("diagnostic.unavailable");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function treeItems(root) {
|
||||||
|
return root === null ? [] : Array.from(root.querySelectorAll("[role=\"treeitem\"]:not([aria-disabled=\"true\"])"));
|
||||||
|
}
|
||||||
|
/** Compact token count shared in shape with the conversation stats strip. */
|
||||||
|
function formatTokens(value) {
|
||||||
|
const scaled = (next) => next >= 100 ? String(Math.round(next)) : String(Math.round(next * 10) / 10);
|
||||||
|
if (value < 1e3) return String(value);
|
||||||
|
if (value < 1e6) return `${scaled(value / 1e3)}K`;
|
||||||
|
return `${scaled(value / 1e6)}M`;
|
||||||
|
}
|
||||||
|
/** Sum the four disjoint durable provider-usage buckets. */
|
||||||
|
function tokenTotal(usage) {
|
||||||
|
return usage === void 0 ? void 0 : usage.uncachedInputTokens + usage.outputTokens + usage.cacheReadTokens + usage.cacheWriteTokens;
|
||||||
|
}
|
||||||
|
/** Exact whole-second active-turn duration for one catalog row. */
|
||||||
|
function activityDuration(summary, activity, now) {
|
||||||
|
if (summary === void 0) return void 0;
|
||||||
|
const timing = summary.projectionValues?.subagentTiming;
|
||||||
|
if (timing === void 0) return void 0;
|
||||||
|
if (timing.active === void 0) return timing.settledMs;
|
||||||
|
const end = activity === "running" ? now : timing.active.through;
|
||||||
|
return timing.settledMs + Math.max(0, end - timing.active.since);
|
||||||
|
}
|
||||||
|
function splitDuration(ms) {
|
||||||
|
const totalSeconds = Math.floor(Math.max(0, ms) / 1e3);
|
||||||
|
const totalMinutes = Math.floor(totalSeconds / 60);
|
||||||
|
const totalHours = Math.floor(totalMinutes / 60);
|
||||||
|
return {
|
||||||
|
seconds: totalSeconds % 60,
|
||||||
|
minutes: totalMinutes % 60,
|
||||||
|
hours: totalHours % 24,
|
||||||
|
days: Math.floor(totalHours / 24),
|
||||||
|
totalMinutes,
|
||||||
|
totalHours
|
||||||
|
};
|
||||||
|
}
|
||||||
|
/** Format a duration with decreasing visual precision at larger scales. */
|
||||||
|
function formatDuration(ms, t) {
|
||||||
|
const { seconds, minutes, hours, days, totalMinutes, totalHours } = splitDuration(ms);
|
||||||
|
if (days >= 365) {
|
||||||
|
const years = Math.floor(days / 365);
|
||||||
|
const months = Math.floor(days % 365 / 30);
|
||||||
|
return months === 0 ? t("duration.years", { years }) : t("duration.yearsMonths", {
|
||||||
|
years,
|
||||||
|
months
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (days >= 30) {
|
||||||
|
const months = Math.floor(days / 30);
|
||||||
|
const remainingDays = days % 30;
|
||||||
|
return remainingDays === 0 ? t("duration.months", { months }) : t("duration.monthsDays", {
|
||||||
|
months,
|
||||||
|
days: remainingDays
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (days > 0) return hours === 0 ? t("duration.days", { days }) : t("duration.daysHours", {
|
||||||
|
days,
|
||||||
|
hours
|
||||||
|
});
|
||||||
|
if (totalHours > 0) return t("duration.hours", {
|
||||||
|
hours: totalHours,
|
||||||
|
minutes: String(minutes).padStart(2, "0"),
|
||||||
|
seconds: String(seconds).padStart(2, "0")
|
||||||
|
});
|
||||||
|
if (totalMinutes > 0) return t("duration.minutes", {
|
||||||
|
minutes: totalMinutes,
|
||||||
|
seconds: String(seconds).padStart(2, "0")
|
||||||
|
});
|
||||||
|
return t("duration.seconds", { seconds });
|
||||||
|
}
|
||||||
|
/** Preserve exact whole seconds for hover and accessible naming. */
|
||||||
|
function formatExactDuration(ms, t) {
|
||||||
|
const { seconds, minutes, hours, days } = splitDuration(ms);
|
||||||
|
return days === 0 ? formatDuration(ms, t) : t("duration.exactDays", {
|
||||||
|
days,
|
||||||
|
hours: String(hours).padStart(2, "0"),
|
||||||
|
minutes: String(minutes).padStart(2, "0"),
|
||||||
|
seconds: String(seconds).padStart(2, "0")
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const NO_DESCENDANTS = {
|
||||||
|
count: 0,
|
||||||
|
runningCount: 0
|
||||||
|
};
|
||||||
|
/** Render the known direct-child shape while its authoritative catalog hydrates. */
|
||||||
|
function CatalogLoadingRows({ parentSessionId, summaries, level, t }) {
|
||||||
|
const children = Object.values(summaries).filter((summary) => summary.origin === "subagent" && summary.parentId === parentSessionId);
|
||||||
|
if (children.length === 0) return (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: SubagentCatalogAction_module_css_default.notice,
|
||||||
|
children: t("loading.label")
|
||||||
|
});
|
||||||
|
return children.map((summary) => (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: SubagentCatalogAction_module_css_default.node,
|
||||||
|
children: (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
role: "treeitem",
|
||||||
|
"aria-disabled": "true",
|
||||||
|
"aria-level": level,
|
||||||
|
"aria-label": t("loading.aria"),
|
||||||
|
className: `${SubagentCatalogAction_module_css_default.row} ${SubagentCatalogAction_module_css_default.disabled} ${SubagentCatalogAction_module_css_default.loadingRow}`,
|
||||||
|
children: [
|
||||||
|
(0, react_jsx_runtime.jsx)("span", { className: SubagentCatalogAction_module_css_default.disclosureSpace }),
|
||||||
|
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, { state: summary.running ? "ongoing" : "done" }),
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: SubagentCatalogAction_module_css_default.content,
|
||||||
|
children: (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: SubagentCatalogAction_module_css_default.label,
|
||||||
|
children: t("loading.label")
|
||||||
|
})
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})
|
||||||
|
}, summary.id));
|
||||||
|
}
|
||||||
|
/** Render one catalog level and recurse only through explicitly expanded rows. */
|
||||||
|
function CatalogRows({ parentSessionId, catalog, catalogs, summaries, expanded, level, now, openChild, refresh, toggleBranch, closeCatalog, t }) {
|
||||||
|
const emptyLoading = catalog.state === "loading" && catalog.entries.length === 0;
|
||||||
|
const reserveDisclosure = catalog.entries.some((entry) => entry.kind === "child" && entry.hasChildren);
|
||||||
|
return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
||||||
|
emptyLoading && (0, react_jsx_runtime.jsx)(CatalogLoadingRows, {
|
||||||
|
parentSessionId,
|
||||||
|
summaries,
|
||||||
|
level,
|
||||||
|
t
|
||||||
|
}),
|
||||||
|
catalog.state === "error" && (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: SubagentCatalogAction_module_css_default.error,
|
||||||
|
children: [(0, react_jsx_runtime.jsx)("span", { children: catalog.error?.message ?? t("load.error") }), (0, react_jsx_runtime.jsxs)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: SubagentCatalogAction_module_css_default.refresh,
|
||||||
|
onClick: () => {
|
||||||
|
refresh(parentSessionId);
|
||||||
|
},
|
||||||
|
children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutline14, {}), t("retry")]
|
||||||
|
})]
|
||||||
|
}),
|
||||||
|
catalog.entries.map((entry) => {
|
||||||
|
if (entry.kind === "diagnostic") {
|
||||||
|
const reason = diagnosticReason(entry, t);
|
||||||
|
return (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: SubagentCatalogAction_module_css_default.node,
|
||||||
|
children: (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
role: "treeitem",
|
||||||
|
"aria-disabled": "true",
|
||||||
|
"aria-level": level,
|
||||||
|
"aria-label": `${entry.id} ${reason}`,
|
||||||
|
className: `${SubagentCatalogAction_module_css_default.row} ${SubagentCatalogAction_module_css_default.disabled}`,
|
||||||
|
title: reason,
|
||||||
|
children: [
|
||||||
|
reserveDisclosure && (0, react_jsx_runtime.jsx)("span", { className: SubagentCatalogAction_module_css_default.disclosureSpace }),
|
||||||
|
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, { state: "error" }),
|
||||||
|
(0, react_jsx_runtime.jsxs)("span", {
|
||||||
|
className: SubagentCatalogAction_module_css_default.content,
|
||||||
|
children: [(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: SubagentCatalogAction_module_css_default.label,
|
||||||
|
children: entry.id
|
||||||
|
}), (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: SubagentCatalogAction_module_css_default.summary,
|
||||||
|
children: reason
|
||||||
|
})]
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})
|
||||||
|
}, entry.id);
|
||||||
|
}
|
||||||
|
const childCatalog = catalogs[entry.id];
|
||||||
|
const isExpanded = expanded.has(entry.id);
|
||||||
|
const knownLeaf = !entry.hasChildren;
|
||||||
|
const childLoading = childCatalog === void 0 || childCatalog.state === "loading" && childCatalog.entries.length === 0;
|
||||||
|
const summary = summaries[entry.id];
|
||||||
|
const label = entry.label ?? entry.id;
|
||||||
|
const mode = entry.mode === "one-shot" ? t("mode.oneShot") : t("mode.continuable");
|
||||||
|
const activity = entry.activity === "running" ? t("activity.running") : t("activity.inactive");
|
||||||
|
const secondary = [
|
||||||
|
summary?.title,
|
||||||
|
mode,
|
||||||
|
activity
|
||||||
|
].filter((value) => value !== void 0).join(" · ");
|
||||||
|
const totalTokens = tokenTotal(summary?.projectionValues?.tokenUsage);
|
||||||
|
const durationMs = activityDuration(summary, entry.activity, now);
|
||||||
|
const tokenMetric = totalTokens === void 0 ? void 0 : `${formatTokens(totalTokens)} tok`;
|
||||||
|
const durationMetric = durationMs === void 0 ? void 0 : {
|
||||||
|
compact: formatDuration(durationMs, t),
|
||||||
|
exact: formatExactDuration(durationMs, t)
|
||||||
|
};
|
||||||
|
const metrics = [tokenMetric, durationMetric?.exact].filter((value) => value !== void 0).join(" · ");
|
||||||
|
const open = () => {
|
||||||
|
openChild({
|
||||||
|
parentSessionId,
|
||||||
|
childSessionId: entry.id,
|
||||||
|
mode: entry.mode
|
||||||
|
});
|
||||||
|
closeCatalog();
|
||||||
|
};
|
||||||
|
const handleKey = (event) => {
|
||||||
|
if (event.key === "Enter" || event.key === " ") {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
open();
|
||||||
|
} else if (event.key === "ArrowRight" && !knownLeaf && !isExpanded || event.key === "ArrowLeft" && isExpanded) {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
toggleBranch(entry.id);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const toggle = (event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
toggleBranch(entry.id);
|
||||||
|
};
|
||||||
|
return (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: SubagentCatalogAction_module_css_default.node,
|
||||||
|
children: [(0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
role: "treeitem",
|
||||||
|
tabIndex: 0,
|
||||||
|
"aria-level": level,
|
||||||
|
"aria-label": [
|
||||||
|
label,
|
||||||
|
secondary,
|
||||||
|
metrics
|
||||||
|
].filter((value) => value !== "").join(" "),
|
||||||
|
...knownLeaf ? {} : { "aria-expanded": isExpanded },
|
||||||
|
className: SubagentCatalogAction_module_css_default.row,
|
||||||
|
onClick: open,
|
||||||
|
onKeyDown: handleKey,
|
||||||
|
children: [knownLeaf ? reserveDisclosure && (0, react_jsx_runtime.jsx)("span", { className: SubagentCatalogAction_module_css_default.disclosureSpace }) : (0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
tabIndex: -1,
|
||||||
|
className: `${SubagentCatalogAction_module_css_default.disclosure} ${isExpanded ? SubagentCatalogAction_module_css_default.disclosureOpen : ""}`,
|
||||||
|
"aria-label": t(isExpanded ? "branch.collapse" : "branch.expand", { label }),
|
||||||
|
onClick: toggle,
|
||||||
|
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronRightOutline14, {})
|
||||||
|
}), (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: SubagentCatalogAction_module_css_default.clickarea,
|
||||||
|
children: [
|
||||||
|
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, { state: entry.activity === "running" ? "ongoing" : "done" }),
|
||||||
|
(0, react_jsx_runtime.jsxs)("span", {
|
||||||
|
className: SubagentCatalogAction_module_css_default.content,
|
||||||
|
children: [(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: SubagentCatalogAction_module_css_default.label,
|
||||||
|
children: label
|
||||||
|
}), (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: SubagentCatalogAction_module_css_default.summary,
|
||||||
|
children: secondary
|
||||||
|
})]
|
||||||
|
}),
|
||||||
|
metrics !== "" && (0, react_jsx_runtime.jsxs)("span", {
|
||||||
|
className: SubagentCatalogAction_module_css_default.metrics,
|
||||||
|
children: [tokenMetric !== void 0 && (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: SubagentCatalogAction_module_css_default.metricToken,
|
||||||
|
children: tokenMetric
|
||||||
|
}), durationMetric !== void 0 && (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: SubagentCatalogAction_module_css_default.metricDuration,
|
||||||
|
title: t("duration.exactTitle", { duration: durationMetric.exact }),
|
||||||
|
children: durationMetric.compact
|
||||||
|
})]
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})]
|
||||||
|
}), isExpanded && !knownLeaf && (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
role: "group",
|
||||||
|
className: SubagentCatalogAction_module_css_default.children,
|
||||||
|
"aria-busy": childLoading || void 0,
|
||||||
|
children: childCatalog === void 0 ? (0, react_jsx_runtime.jsx)(CatalogLoadingRows, {
|
||||||
|
parentSessionId: entry.id,
|
||||||
|
summaries,
|
||||||
|
level: level + 1,
|
||||||
|
t
|
||||||
|
}) : (0, react_jsx_runtime.jsx)(CatalogRows, {
|
||||||
|
parentSessionId: entry.id,
|
||||||
|
catalog: childCatalog,
|
||||||
|
catalogs,
|
||||||
|
summaries,
|
||||||
|
expanded,
|
||||||
|
level: level + 1,
|
||||||
|
now,
|
||||||
|
openChild,
|
||||||
|
refresh,
|
||||||
|
toggleBranch,
|
||||||
|
closeCatalog,
|
||||||
|
t
|
||||||
|
})
|
||||||
|
})]
|
||||||
|
}, entry.id);
|
||||||
|
})
|
||||||
|
] });
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Render the current session's direct catalog and lazily expanded descendants.
|
||||||
|
* @param props - session standard props plus catalog navigation actions.
|
||||||
|
* @returns The action while the catalog is pending or summaries establish descendants.
|
||||||
|
*/
|
||||||
|
function SubagentCatalogAction({ sessionId, useSessions, openChild, refresh, setCatalogOpen, t }) {
|
||||||
|
const catalogs = useSessions((state) => state.subagentsByParent);
|
||||||
|
const summaries = useSessions((state) => state.byId);
|
||||||
|
const catalog = catalogs[sessionId];
|
||||||
|
const [open, setOpen] = (0, react.useState)(false);
|
||||||
|
const [now, setNow] = (0, react.useState)(() => Date.now());
|
||||||
|
const [expanded, setExpanded] = (0, react.useState)(() => /* @__PURE__ */ new Set());
|
||||||
|
const rootRef = (0, react.useRef)(null);
|
||||||
|
const triggerRef = (0, react.useRef)(null);
|
||||||
|
const observedCatalogs = (0, react.useRef)(/* @__PURE__ */ new Set());
|
||||||
|
const setCatalogOpenRef = (0, react.useRef)(setCatalogOpen);
|
||||||
|
setCatalogOpenRef.current = setCatalogOpen;
|
||||||
|
const healthy = catalog?.entries.filter((entry) => entry.kind === "child") ?? [];
|
||||||
|
const descendants = (0, react.useMemo)(() => (0, _deepseek_ai_dsh_client_runtime_client.indexSubagentDescendants)(summaries).get(sessionId) ?? NO_DESCENDANTS, [sessionId, summaries]);
|
||||||
|
const descendantCount = Math.max(healthy.length, descendants.count);
|
||||||
|
const totalCountKey = descendantCount === 1 ? "count.total.one" : "count.total.other";
|
||||||
|
const runningCountKey = descendants.runningCount === 1 ? "count.running.one" : "count.running.other";
|
||||||
|
const presentedCatalog = descendants.count > 0 && (catalog === void 0 || catalog.state === "ready" && catalog.entries.length === 0) ? {
|
||||||
|
entries: [],
|
||||||
|
parentAvailable: catalog?.parentAvailable ?? false,
|
||||||
|
state: "loading",
|
||||||
|
error: null
|
||||||
|
} : catalog;
|
||||||
|
const observeCatalog = (parentSessionId, next) => {
|
||||||
|
if (next) observedCatalogs.current.add(parentSessionId);
|
||||||
|
else observedCatalogs.current.delete(parentSessionId);
|
||||||
|
setCatalogOpen(parentSessionId, next);
|
||||||
|
};
|
||||||
|
const closeAllCatalogs = () => {
|
||||||
|
for (const parentSessionId of observedCatalogs.current) setCatalogOpen(parentSessionId, false);
|
||||||
|
observedCatalogs.current.clear();
|
||||||
|
setExpanded(/* @__PURE__ */ new Set());
|
||||||
|
};
|
||||||
|
const changeOpen = (next, restoreFocus = false) => {
|
||||||
|
setOpen(next);
|
||||||
|
if (next) {
|
||||||
|
setNow(Date.now());
|
||||||
|
observeCatalog(sessionId, true);
|
||||||
|
} else closeAllCatalogs();
|
||||||
|
if (restoreFocus) queueMicrotask(() => {
|
||||||
|
triggerRef.current?.focus();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const closeBranch = (root) => {
|
||||||
|
const closing = /* @__PURE__ */ new Set();
|
||||||
|
const visit = (parentSessionId) => {
|
||||||
|
if (closing.has(parentSessionId) || !expanded.has(parentSessionId)) return;
|
||||||
|
closing.add(parentSessionId);
|
||||||
|
const branch = catalogs[parentSessionId];
|
||||||
|
for (const entry of branch?.entries ?? []) if (entry.kind === "child") visit(entry.id);
|
||||||
|
};
|
||||||
|
visit(root);
|
||||||
|
for (const parentSessionId of closing) observeCatalog(parentSessionId, false);
|
||||||
|
setExpanded((current) => new Set([...current].filter((id) => !closing.has(id))));
|
||||||
|
};
|
||||||
|
const toggleBranch = (childSessionId) => {
|
||||||
|
if (expanded.has(childSessionId)) {
|
||||||
|
closeBranch(childSessionId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setExpanded((current) => new Set(current).add(childSessionId));
|
||||||
|
observeCatalog(childSessionId, true);
|
||||||
|
};
|
||||||
|
(0, react.useEffect)(() => {
|
||||||
|
if (!open) return;
|
||||||
|
const closeOutside = (event) => {
|
||||||
|
if (event.target instanceof Node && !rootRef.current?.contains(event.target)) changeOpen(false);
|
||||||
|
};
|
||||||
|
document.addEventListener("pointerdown", closeOutside);
|
||||||
|
return () => {
|
||||||
|
document.removeEventListener("pointerdown", closeOutside);
|
||||||
|
};
|
||||||
|
}, [open]);
|
||||||
|
(0, react.useEffect)(() => {
|
||||||
|
if (!open || descendants.runningCount === 0) return;
|
||||||
|
const timer = setInterval(() => {
|
||||||
|
setNow(Date.now());
|
||||||
|
}, 1e3);
|
||||||
|
return () => {
|
||||||
|
clearInterval(timer);
|
||||||
|
};
|
||||||
|
}, [open, descendants.runningCount]);
|
||||||
|
(0, react.useEffect)(() => () => {
|
||||||
|
for (const parentSessionId of observedCatalogs.current) setCatalogOpenRef.current(parentSessionId, false);
|
||||||
|
observedCatalogs.current.clear();
|
||||||
|
}, []);
|
||||||
|
const visible = presentedCatalog !== void 0 && (presentedCatalog.state === "error" || presentedCatalog.entries.length > 0 || descendantCount > 0);
|
||||||
|
(0, react.useEffect)(() => {
|
||||||
|
if (visible || !open) return;
|
||||||
|
setOpen(false);
|
||||||
|
closeAllCatalogs();
|
||||||
|
}, [visible, open]);
|
||||||
|
if (!visible) return null;
|
||||||
|
const focusAt = (index) => {
|
||||||
|
const items = treeItems(rootRef.current);
|
||||||
|
if (items.length === 0) return;
|
||||||
|
items[(index + items.length) % items.length]?.focus();
|
||||||
|
};
|
||||||
|
const navigate = (event) => {
|
||||||
|
const items = treeItems(rootRef.current);
|
||||||
|
const index = items.indexOf(document.activeElement);
|
||||||
|
if (event.key === "Escape") {
|
||||||
|
event.preventDefault();
|
||||||
|
changeOpen(false, true);
|
||||||
|
} else if (event.key === "Home") {
|
||||||
|
event.preventDefault();
|
||||||
|
focusAt(0);
|
||||||
|
} else if (event.key === "End") {
|
||||||
|
event.preventDefault();
|
||||||
|
focusAt(items.length - 1);
|
||||||
|
} else if (event.key === "ArrowDown") {
|
||||||
|
event.preventDefault();
|
||||||
|
focusAt(index + 1);
|
||||||
|
} else if (event.key === "ArrowUp") {
|
||||||
|
event.preventDefault();
|
||||||
|
focusAt(index < 0 ? items.length - 1 : index - 1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: SubagentCatalogAction_module_css_default.root,
|
||||||
|
ref: rootRef,
|
||||||
|
onKeyDown: navigate,
|
||||||
|
children: [(0, react_jsx_runtime.jsxs)("button", {
|
||||||
|
ref: triggerRef,
|
||||||
|
type: "button",
|
||||||
|
className: SubagentCatalogAction_module_css_default.trigger,
|
||||||
|
"aria-haspopup": "tree",
|
||||||
|
"aria-expanded": open,
|
||||||
|
"aria-label": t(descendants.runningCount > 0 ? runningCountKey : totalCountKey, { count: descendants.runningCount > 0 ? descendants.runningCount : descendantCount }),
|
||||||
|
onClick: () => {
|
||||||
|
changeOpen(!open);
|
||||||
|
},
|
||||||
|
onKeyDown: (event) => {
|
||||||
|
if (event.key !== "ArrowDown") return;
|
||||||
|
event.preventDefault();
|
||||||
|
if (!open) changeOpen(true);
|
||||||
|
queueMicrotask(() => {
|
||||||
|
focusAt(0);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: SubagentCatalogAction_module_css_default.activitySlot,
|
||||||
|
children: descendants.runningCount > 0 && (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, { state: "ongoing" })
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: SubagentCatalogAction_module_css_default.count,
|
||||||
|
children: t(totalCountKey, { count: descendantCount })
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, { className: open ? SubagentCatalogAction_module_css_default.triggerOpen : void 0 })
|
||||||
|
]
|
||||||
|
}), open && (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: SubagentCatalogAction_module_css_default.menu,
|
||||||
|
role: "tree",
|
||||||
|
"aria-label": t("tree.aria"),
|
||||||
|
children: (0, react_jsx_runtime.jsx)(CatalogRows, {
|
||||||
|
parentSessionId: sessionId,
|
||||||
|
catalog: presentedCatalog,
|
||||||
|
catalogs,
|
||||||
|
summaries,
|
||||||
|
expanded,
|
||||||
|
level: 1,
|
||||||
|
now,
|
||||||
|
openChild,
|
||||||
|
refresh,
|
||||||
|
toggleBranch,
|
||||||
|
closeCatalog: () => {
|
||||||
|
changeOpen(false);
|
||||||
|
},
|
||||||
|
t
|
||||||
|
})
|
||||||
|
})]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-subagent/src/client/SubagentReadOnlyComposer.module.css.mjs
|
||||||
|
const css = ".XJ7liG_frame{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);min-height:54px;color:var(--dsw-alias-label-tertiary);border-radius:14px;justify-content:center;align-items:center;gap:8px;margin:0 24px 20px;padding:10px 16px;font-size:13px;line-height:20px;display:flex}.XJ7liG_frame strong{color:var(--dsw-alias-label-primary);font-weight:510}";
|
||||||
|
const tagId = "@deepseek-ai/dsh-client-ui-subagent/SubagentReadOnlyComposer.module.css";
|
||||||
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
||||||
|
const tag = document.createElement("style");
|
||||||
|
tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-subagent";
|
||||||
|
tag.dataset.pluginCss = tagId;
|
||||||
|
tag.textContent = css;
|
||||||
|
document.head.appendChild(tag);
|
||||||
|
}
|
||||||
|
var SubagentReadOnlyComposer_module_css_default = { "frame": "XJ7liG_frame" };
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/SubagentReadOnlyComposer.js
|
||||||
|
/**
|
||||||
|
* Explain why the normal composer is unavailable for an addressed child.
|
||||||
|
* @param props - selector-owned read-only reason plus standard slot props.
|
||||||
|
* @returns A read-only composer replacement.
|
||||||
|
*/
|
||||||
|
function SubagentReadOnlyComposer({ matched, t }) {
|
||||||
|
const oneShot = matched.reason === "one-shot";
|
||||||
|
return (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: SubagentReadOnlyComposer_module_css_default.frame,
|
||||||
|
role: "status",
|
||||||
|
children: [(0, react_jsx_runtime.jsx)("strong", { children: t(oneShot ? "readonly.oneShot.title" : "readonly.title") }), (0, react_jsx_runtime.jsx)("span", { children: t(oneShot ? "readonly.oneShot.body" : "readonly.body") })]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/locales.js
|
||||||
|
/** `subagent` namespace dictionaries. */
|
||||||
|
/** Dictionary namespace owned by this plugin. */
|
||||||
|
const NS = "subagent";
|
||||||
|
/** Simplified Chinese dictionary (the key-set source of truth). */
|
||||||
|
const zh = {
|
||||||
|
"diagnostic.corrupt": "会话记录损坏",
|
||||||
|
"diagnostic.unsupported": "子代理记录版本不受支持",
|
||||||
|
"diagnostic.unavailable": "会话记录暂不可用",
|
||||||
|
"duration.seconds": "{seconds}秒",
|
||||||
|
"duration.minutes": "{minutes}分{seconds}秒",
|
||||||
|
"duration.hours": "{hours}小时{minutes}分{seconds}秒",
|
||||||
|
"duration.days": "{days}天",
|
||||||
|
"duration.daysHours": "{days}天{hours}小时",
|
||||||
|
"duration.months": "约{months}个月",
|
||||||
|
"duration.monthsDays": "约{months}个月{days}天",
|
||||||
|
"duration.years": "约{years}年",
|
||||||
|
"duration.yearsMonths": "约{years}年{months}个月",
|
||||||
|
"duration.exactDays": "{days}天{hours}小时{minutes}分{seconds}秒",
|
||||||
|
"duration.exactTitle": "总活跃耗时:{duration}",
|
||||||
|
"loading.label": "正在加载子代理…",
|
||||||
|
"loading.aria": "正在加载子代理",
|
||||||
|
"load.error": "无法加载子代理",
|
||||||
|
"retry": "重试",
|
||||||
|
"mode.oneShot": "一次性",
|
||||||
|
"mode.continuable": "可继续",
|
||||||
|
"activity.running": "正在运行",
|
||||||
|
"activity.inactive": "当前未运行",
|
||||||
|
"branch.collapse": "收起 {label} 的下级子代理",
|
||||||
|
"branch.expand": "展开 {label} 的下级子代理",
|
||||||
|
"count.total.one": "{count} 个子代理",
|
||||||
|
"count.total.other": "{count} 个子代理",
|
||||||
|
"count.running.one": "{count} 个子代理,正在运行",
|
||||||
|
"count.running.other": "{count} 个子代理,正在运行",
|
||||||
|
"tree.aria": "子代理会话",
|
||||||
|
"readonly.oneShot.title": "一次性子代理记录",
|
||||||
|
"readonly.title": "此子代理暂时只读",
|
||||||
|
"readonly.oneShot.body": "一次性任务不支持后续消息,可在这里查看完整执行记录。",
|
||||||
|
"readonly.body": "父会话当前不在线,重新打开父会话后即可继续发送消息。"
|
||||||
|
};
|
||||||
|
/** English dictionary, key-identical to the Chinese source of truth. */
|
||||||
|
const en = {
|
||||||
|
"diagnostic.corrupt": "corrupted session record",
|
||||||
|
"diagnostic.unsupported": "unsupported subagent record version",
|
||||||
|
"diagnostic.unavailable": "session record temporarily unavailable",
|
||||||
|
"duration.seconds": "{seconds}s",
|
||||||
|
"duration.minutes": "{minutes}m {seconds}s",
|
||||||
|
"duration.hours": "{hours}h {minutes}m {seconds}s",
|
||||||
|
"duration.days": "{days}d",
|
||||||
|
"duration.daysHours": "{days}d {hours}h",
|
||||||
|
"duration.months": "~{months}mo",
|
||||||
|
"duration.monthsDays": "~{months}mo {days}d",
|
||||||
|
"duration.years": "~{years}y",
|
||||||
|
"duration.yearsMonths": "~{years}y {months}mo",
|
||||||
|
"duration.exactDays": "{days}d {hours}h {minutes}m {seconds}s",
|
||||||
|
"duration.exactTitle": "Total active duration: {duration}",
|
||||||
|
"loading.label": "Loading subagents…",
|
||||||
|
"loading.aria": "Loading subagents",
|
||||||
|
"load.error": "Unable to load subagents",
|
||||||
|
"retry": "Retry",
|
||||||
|
"mode.oneShot": "one-shot",
|
||||||
|
"mode.continuable": "continuable",
|
||||||
|
"activity.running": "running",
|
||||||
|
"activity.inactive": "not running",
|
||||||
|
"branch.collapse": "Collapse {label} descendants",
|
||||||
|
"branch.expand": "Expand {label} descendants",
|
||||||
|
"count.total.one": "{count} subagent",
|
||||||
|
"count.total.other": "{count} subagents",
|
||||||
|
"count.running.one": "{count} subagent running",
|
||||||
|
"count.running.other": "{count} subagents running",
|
||||||
|
"tree.aria": "Subagent sessions",
|
||||||
|
"readonly.oneShot.title": "One-shot subagent record",
|
||||||
|
"readonly.title": "This subagent is read-only for now",
|
||||||
|
"readonly.oneShot.body": "One-shot tasks do not accept follow-ups; review the full execution record here.",
|
||||||
|
"readonly.body": "The parent session is offline; reopen it to continue sending messages."
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/index.js
|
||||||
|
/** Required services for references, conversation slots, and session navigation. */
|
||||||
|
const inject = [
|
||||||
|
"inputTriggers",
|
||||||
|
"sessions",
|
||||||
|
"slots",
|
||||||
|
"locale"
|
||||||
|
];
|
||||||
|
/** Claim the composer for one-shot history or an unavailable continuation owner. */
|
||||||
|
function selectReadOnlySubagent(owner) {
|
||||||
|
const subagent = owner.session?.subagent;
|
||||||
|
if (subagent === void 0 || subagent === null) return null;
|
||||||
|
if (subagent.address.mode === "one-shot") return { reason: "one-shot" };
|
||||||
|
if (subagent.parentAvailable) return null;
|
||||||
|
return owner.session?.running === true ? null : { reason: "parent-unavailable" };
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Client plugin body: register the '@' subagent source over the root session list.
|
||||||
|
* @param ctx - client root context.
|
||||||
|
*/
|
||||||
|
function apply(ctx) {
|
||||||
|
ctx.effect(() => ctx.locale.register(NS, {
|
||||||
|
zh,
|
||||||
|
en
|
||||||
|
}), "ui-subagent: dictionaries");
|
||||||
|
const sessions = ctx.sessions;
|
||||||
|
const childLabels = (session, query) => {
|
||||||
|
const { byId } = sessions.list.getSnapshot();
|
||||||
|
return Object.values(byId).filter((child) => child.parentId === session.sessionId && child.running && child.displayTitle.includes(query)).map((child) => child.displayTitle);
|
||||||
|
};
|
||||||
|
const source = {
|
||||||
|
trigger: "@",
|
||||||
|
name: "subagent",
|
||||||
|
candidates(session, { query }) {
|
||||||
|
return Promise.resolve(childLabels(session, query).map((name) => ({ name })));
|
||||||
|
},
|
||||||
|
lexicon(session) {
|
||||||
|
return childLabels(session, "");
|
||||||
|
},
|
||||||
|
subscribeLexicon(_session, listener) {
|
||||||
|
return sessions.list.subscribe(listener);
|
||||||
|
},
|
||||||
|
onPick({ candidate }) {
|
||||||
|
return { text: `@${candidate.name} ` };
|
||||||
|
},
|
||||||
|
codec: {
|
||||||
|
clipboardText: (ref) => `@${ref}`,
|
||||||
|
serialize: (ref) => Promise.resolve(`@${ref}`)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const inputTriggers = ctx.get("inputTriggers");
|
||||||
|
ctx.effect(() => inputTriggers.registerSource(source), "ui-subagent: @ source");
|
||||||
|
const catalogActions = (_parentSessionId) => ({
|
||||||
|
openChild(address) {
|
||||||
|
sessions.openSubagent(address);
|
||||||
|
},
|
||||||
|
refresh(parentSessionId) {
|
||||||
|
sessions.refreshSubagents(parentSessionId);
|
||||||
|
},
|
||||||
|
setCatalogOpen(parentSessionId, open) {
|
||||||
|
sessions.setSubagentCatalogOpen(parentSessionId, open);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
ctx.slots.inject("conversation.session.header.actions", () => ctx.slots.register({
|
||||||
|
name: "conversation.session.header.actions",
|
||||||
|
id: "subagent-catalog",
|
||||||
|
order: 10,
|
||||||
|
locale: NS,
|
||||||
|
inject: catalogActions
|
||||||
|
}, SubagentCatalogAction));
|
||||||
|
ctx.slots.inject("conversation.composer", () => ctx.slots.register({
|
||||||
|
name: "conversation.composer",
|
||||||
|
priority: -10,
|
||||||
|
locale: NS,
|
||||||
|
select: selectReadOnlySubagent
|
||||||
|
}, SubagentReadOnlyComposer));
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
exports.apply = apply;
|
||||||
|
exports.inject = inject;
|
||||||
|
return module.exports;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//# sourceMappingURL=client.js.map
|
||||||
@@ -0,0 +1,448 @@
|
|||||||
|
window.__ModuleLoader__.load({
|
||||||
|
id: "@deepseek-ai/dsh-client-ui-goal",
|
||||||
|
factory: (require) => {
|
||||||
|
var module = { exports: {} };
|
||||||
|
var exports = module.exports;
|
||||||
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||||
|
let react_jsx_runtime = require("react/jsx-runtime");
|
||||||
|
let react = require("react");
|
||||||
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
||||||
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-goal/src/client/GoalBar.module.css.mjs
|
||||||
|
const css$1 = ".nLMEza_dock{box-sizing:border-box;width:calc(100% - var(--dsh-composer-side-clearance) - var(--dsh-composer-side-clearance) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset));margin:0 auto}.nLMEza_bar{box-sizing:border-box;width:100%;max-width:calc(var(--dsh-composer-card-max-width) - 4 * var(--dsh-composer-dock-inset));border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-specific-tip);border-radius:12px;align-items:center;gap:10px;height:36px;margin:0 auto;padding:4px 5px 4px 12px;display:flex}.nLMEza_goalGlyph{color:var(--dsw-alias-label-tertiary);flex:none;display:inline-flex}.nLMEza_label{color:var(--dsw-alias-label-primary);flex:none;font-size:13px;font-weight:500;line-height:24px}.nLMEza_objective{min-width:0;color:var(--dsw-alias-label-primary-dimmed);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:13px;line-height:20px;overflow:hidden}.nLMEza_error{min-width:0;color:var(--dsw-alias-state-error-primary);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:12px;line-height:20px;overflow:hidden}.nLMEza_objectiveInput{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-base);min-width:0;height:26px;color:var(--dsw-alias-label-primary);border-radius:6px;outline:none;flex:1;padding:0 8px;font-size:13px;line-height:20px}.nLMEza_objectiveInput:focus{border-color:var(--dsw-alias-state-business-primary)}.nLMEza_objectiveInput::placeholder{color:var(--dsw-alias-label-caption)}.nLMEza_actions{flex:none;align-items:center;gap:10px;display:flex}.nLMEza_iconBtn{width:28px;height:28px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:999px;justify-content:center;align-items:center;padding:0;display:inline-flex}.nLMEza_iconBtn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary)}.nLMEza_iconBtn:disabled{opacity:.4;cursor:default}";
|
||||||
|
const tagId$1 = "@deepseek-ai/dsh-client-ui-goal/GoalBar.module.css";
|
||||||
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
|
||||||
|
const tag = document.createElement("style");
|
||||||
|
tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-goal";
|
||||||
|
tag.dataset.pluginCss = tagId$1;
|
||||||
|
tag.textContent = css$1;
|
||||||
|
document.head.appendChild(tag);
|
||||||
|
}
|
||||||
|
var GoalBar_module_css_default = {
|
||||||
|
"dock": "nLMEza_dock",
|
||||||
|
"objective": "nLMEza_objective",
|
||||||
|
"objectiveInput": "nLMEza_objectiveInput",
|
||||||
|
"label": "nLMEza_label",
|
||||||
|
"iconBtn": "nLMEza_iconBtn",
|
||||||
|
"actions": "nLMEza_actions",
|
||||||
|
"error": "nLMEza_error",
|
||||||
|
"goalGlyph": "nLMEza_goalGlyph",
|
||||||
|
"bar": "nLMEza_bar"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/GoalBar.js
|
||||||
|
/**
|
||||||
|
* GoalBar: the goal indicator docked above the message composer (input dock
|
||||||
|
* strip). A present goal shows a goal glyph, a phase label, the truncated
|
||||||
|
* objective, and icon actions — resume when paused, edit (inline form in the
|
||||||
|
* same strip), and clear. Goal creation lives on the `/goal` command, not
|
||||||
|
* here: loading (undefined), no goal (null), and complete goals render
|
||||||
|
* nothing. Live state arrives as the projected whole snapshot; the verbs are
|
||||||
|
* the injected face.
|
||||||
|
*/
|
||||||
|
/** Strip label keys per visible phase; complete goals render nothing. */
|
||||||
|
const PHASE_LABELS = {
|
||||||
|
active: "phase.active",
|
||||||
|
paused: "phase.paused",
|
||||||
|
blocked: "phase.blocked"
|
||||||
|
};
|
||||||
|
function GoalBar({ goal, onEdit, onPause, onResume, onClear, t }) {
|
||||||
|
const [editing, setEditing] = (0, react.useState)(false);
|
||||||
|
const [draft, setDraft] = (0, react.useState)("");
|
||||||
|
const [pending, setPending] = (0, react.useState)(false);
|
||||||
|
const [actionError, setActionError] = (0, react.useState)(null);
|
||||||
|
const [clearedGoalId, setClearedGoalId] = (0, react.useState)(null);
|
||||||
|
const pendingRef = (0, react.useRef)(false);
|
||||||
|
const goalId = goal?.id;
|
||||||
|
(0, react.useEffect)(() => {
|
||||||
|
setEditing(false);
|
||||||
|
setActionError(null);
|
||||||
|
setClearedGoalId(null);
|
||||||
|
}, [goalId]);
|
||||||
|
const runAction = (0, react.useCallback)(async (action) => {
|
||||||
|
if (pendingRef.current) return void 0;
|
||||||
|
pendingRef.current = true;
|
||||||
|
setPending(true);
|
||||||
|
setActionError(null);
|
||||||
|
const result = await action();
|
||||||
|
pendingRef.current = false;
|
||||||
|
setPending(false);
|
||||||
|
if (!result.ok) setActionError(`${result.error.message} (${result.error.code})`);
|
||||||
|
return result;
|
||||||
|
}, []);
|
||||||
|
const handleEdit = (0, react.useCallback)(async () => {
|
||||||
|
const trimmed = draft.trim();
|
||||||
|
if (trimmed === "") return;
|
||||||
|
if ((await runAction(() => onEdit(trimmed)))?.ok) setEditing(false);
|
||||||
|
}, [
|
||||||
|
draft,
|
||||||
|
onEdit,
|
||||||
|
runAction
|
||||||
|
]);
|
||||||
|
const handleClear = (0, react.useCallback)(async (clearedId) => {
|
||||||
|
if ((await runAction(onClear))?.ok) setClearedGoalId(clearedId);
|
||||||
|
}, [onClear, runAction]);
|
||||||
|
if (goal === void 0 || goal === null || goal.phase === "complete" || goal.id === clearedGoalId) return null;
|
||||||
|
if (editing) return (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: GoalBar_module_css_default.dock,
|
||||||
|
"data-goal-bar": true,
|
||||||
|
children: (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: GoalBar_module_css_default.bar,
|
||||||
|
children: [
|
||||||
|
(0, react_jsx_runtime.jsx)("input", {
|
||||||
|
className: GoalBar_module_css_default.objectiveInput,
|
||||||
|
type: "text",
|
||||||
|
"aria-label": t("objective.aria"),
|
||||||
|
value: draft,
|
||||||
|
onChange: (e) => {
|
||||||
|
setDraft(e.target.value);
|
||||||
|
},
|
||||||
|
onKeyDown: (e) => {
|
||||||
|
if (e.key === "Enter") handleEdit();
|
||||||
|
if (e.key === "Escape") setEditing(false);
|
||||||
|
},
|
||||||
|
autoFocus: true
|
||||||
|
}),
|
||||||
|
actionError !== null && (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: GoalBar_module_css_default.error,
|
||||||
|
role: "alert",
|
||||||
|
children: actionError
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: GoalBar_module_css_default.actions,
|
||||||
|
children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
||||||
|
label: t("action.save"),
|
||||||
|
side: "bottom",
|
||||||
|
delayMs: 500,
|
||||||
|
children: (0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: GoalBar_module_css_default.iconBtn,
|
||||||
|
onClick: () => {
|
||||||
|
handleEdit();
|
||||||
|
},
|
||||||
|
disabled: pending || draft.trim() === "",
|
||||||
|
"aria-label": t("action.save"),
|
||||||
|
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutline16, { size: 14 })
|
||||||
|
})
|
||||||
|
}), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
||||||
|
label: t("action.cancel"),
|
||||||
|
side: "bottom",
|
||||||
|
delayMs: 500,
|
||||||
|
children: (0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: GoalBar_module_css_default.iconBtn,
|
||||||
|
onClick: () => {
|
||||||
|
setEditing(false);
|
||||||
|
},
|
||||||
|
disabled: pending,
|
||||||
|
"aria-label": t("action.cancel"),
|
||||||
|
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCloseOutline16, { size: 14 })
|
||||||
|
})
|
||||||
|
})]
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})
|
||||||
|
});
|
||||||
|
const title = goal.phase === "blocked" ? goal.blockedReason?.message : void 0;
|
||||||
|
return (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: GoalBar_module_css_default.dock,
|
||||||
|
"data-goal-bar": true,
|
||||||
|
children: (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: GoalBar_module_css_default.bar,
|
||||||
|
title,
|
||||||
|
children: [
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: GoalBar_module_css_default.goalGlyph,
|
||||||
|
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconGoalOutline16, { size: 14 })
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: GoalBar_module_css_default.label,
|
||||||
|
children: t(PHASE_LABELS[goal.phase])
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: GoalBar_module_css_default.objective,
|
||||||
|
children: goal.objective
|
||||||
|
}),
|
||||||
|
actionError !== null && (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: GoalBar_module_css_default.error,
|
||||||
|
role: "alert",
|
||||||
|
children: actionError
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: GoalBar_module_css_default.actions,
|
||||||
|
children: [
|
||||||
|
goal.phase === "active" && (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
||||||
|
label: t("action.pause"),
|
||||||
|
side: "bottom",
|
||||||
|
delayMs: 500,
|
||||||
|
children: (0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: GoalBar_module_css_default.iconBtn,
|
||||||
|
disabled: pending,
|
||||||
|
onClick: () => {
|
||||||
|
runAction(onPause);
|
||||||
|
},
|
||||||
|
"aria-label": t("action.pause"),
|
||||||
|
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPauseOutline16, { size: 14 })
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
goal.phase === "paused" && (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
||||||
|
label: t("action.resume"),
|
||||||
|
side: "bottom",
|
||||||
|
delayMs: 500,
|
||||||
|
children: (0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: GoalBar_module_css_default.iconBtn,
|
||||||
|
disabled: pending,
|
||||||
|
onClick: () => {
|
||||||
|
runAction(onResume);
|
||||||
|
},
|
||||||
|
"aria-label": t("action.resume"),
|
||||||
|
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconPlayOutline16, { size: 14 })
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
||||||
|
label: t("action.edit"),
|
||||||
|
side: "bottom",
|
||||||
|
delayMs: 500,
|
||||||
|
children: (0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: GoalBar_module_css_default.iconBtn,
|
||||||
|
disabled: pending,
|
||||||
|
onClick: () => {
|
||||||
|
setDraft(goal.objective);
|
||||||
|
setEditing(true);
|
||||||
|
},
|
||||||
|
"aria-label": t("action.edit"),
|
||||||
|
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconEditOutline16, { size: 14 })
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
||||||
|
label: t("action.clear"),
|
||||||
|
side: "bottom",
|
||||||
|
delayMs: 500,
|
||||||
|
children: (0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: GoalBar_module_css_default.iconBtn,
|
||||||
|
disabled: pending,
|
||||||
|
onClick: () => {
|
||||||
|
handleClear(goal.id);
|
||||||
|
},
|
||||||
|
"aria-label": t("action.clear"),
|
||||||
|
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconTrashOutline16, { size: 14 })
|
||||||
|
})
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** Dock adapter: reads the host-computed 'goal' projection (whole value; absent or null renders nothing). */
|
||||||
|
function GoalDock({ useProjection, onEdit, onPause, onResume, onClear, t }) {
|
||||||
|
const projection = useProjection("goal");
|
||||||
|
return (0, react_jsx_runtime.jsx)(GoalBar, {
|
||||||
|
goal: projection === void 0 ? void 0 : projection === null ? null : projection.goal,
|
||||||
|
onEdit,
|
||||||
|
onPause,
|
||||||
|
onResume,
|
||||||
|
onClear,
|
||||||
|
t
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-goal/src/client/GoalCommandInputView.module.css.mjs
|
||||||
|
const css = ".oRe1gG_row{flex-direction:column;align-items:flex-end;gap:6px;display:flex}.oRe1gG_stack{flex-direction:column;align-items:flex-end;min-width:0;max-width:min(525px,82%);display:flex}.oRe1gG_bubble{overflow-wrap:anywhere;background:var(--dsw-specific-bubble);max-width:100%;color:var(--dsw-alias-label-primary);font:var(--dsw-font-markdown-code);white-space:pre-wrap;border-radius:22px;padding:10px 16px}";
|
||||||
|
const tagId = "@deepseek-ai/dsh-client-ui-goal/GoalCommandInputView.module.css";
|
||||||
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
||||||
|
const tag = document.createElement("style");
|
||||||
|
tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-goal";
|
||||||
|
tag.dataset.pluginCss = tagId;
|
||||||
|
tag.textContent = css;
|
||||||
|
document.head.appendChild(tag);
|
||||||
|
}
|
||||||
|
var GoalCommandInputView_module_css_default = {
|
||||||
|
"stack": "oRe1gG_stack",
|
||||||
|
"bubble": "oRe1gG_bubble",
|
||||||
|
"row": "oRe1gG_row"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/GoalCommandInputView.js
|
||||||
|
/** Right-aligned `/goal` input bubble without ordinary message actions. */
|
||||||
|
const GoalCommandInputView = (0, react.memo)(function GoalCommandInputView({ node, t }) {
|
||||||
|
const data = node.data;
|
||||||
|
return (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: GoalCommandInputView_module_css_default.row,
|
||||||
|
"data-command-input": "",
|
||||||
|
role: "group",
|
||||||
|
"aria-label": t("commandInput.aria"),
|
||||||
|
children: (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: GoalCommandInputView_module_css_default.stack,
|
||||||
|
children: (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: GoalCommandInputView_module_css_default.bubble,
|
||||||
|
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MessageText, { text: data.text })
|
||||||
|
})
|
||||||
|
})
|
||||||
|
});
|
||||||
|
});
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/goal-command-input.js
|
||||||
|
/**
|
||||||
|
* Derive the visible command line from its structured durable run.
|
||||||
|
* @param event - `/goal` command run.
|
||||||
|
* @returns command text with trailing parser whitespace removed.
|
||||||
|
*/
|
||||||
|
function goalCommandText(event) {
|
||||||
|
return `/${event.data.name}${(event.data.args ?? "").trimEnd()}`;
|
||||||
|
}
|
||||||
|
/** Goal-owned command input projection; the generic command Definition retains the result row. */
|
||||||
|
const goalCommandInputDefinition = {
|
||||||
|
kind: "goal-command-input",
|
||||||
|
target: "chat",
|
||||||
|
match: (event) => event.type === "command/run" && event.data.name === "goal" ? {
|
||||||
|
id: String(event.data.commandId),
|
||||||
|
role: "start"
|
||||||
|
} : null,
|
||||||
|
start: (_context, match) => {
|
||||||
|
if (match.event.type !== "command/run") throw new Error("goal-command-input start requires command/run");
|
||||||
|
return {
|
||||||
|
commandId: match.event.data.commandId,
|
||||||
|
seq: match.event.seq,
|
||||||
|
time: match.event.time,
|
||||||
|
text: goalCommandText(match.event)
|
||||||
|
};
|
||||||
|
},
|
||||||
|
update: (context) => context.state,
|
||||||
|
buildViewNode: (context) => {
|
||||||
|
if (context.state === void 0) return null;
|
||||||
|
return {
|
||||||
|
key: context.key,
|
||||||
|
kind: "command-input",
|
||||||
|
id: context.id,
|
||||||
|
target: "chat",
|
||||||
|
anchorSeq: context.state.seq - .1,
|
||||||
|
location: context.start?.location ?? { kind: "unresolved" },
|
||||||
|
visibility: "visible",
|
||||||
|
data: {
|
||||||
|
commandId: context.state.commandId,
|
||||||
|
text: context.state.text,
|
||||||
|
time: context.state.time
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/locales.js
|
||||||
|
/** `goal` namespace dictionaries. */
|
||||||
|
/** Simplified Chinese dictionary (the key-set source of truth). */
|
||||||
|
const zh = {
|
||||||
|
"phase.active": "进行中的目标",
|
||||||
|
"phase.paused": "已暂停的目标",
|
||||||
|
"phase.blocked": "受阻的目标",
|
||||||
|
"objective.aria": "目标内容",
|
||||||
|
"commandInput.aria": "命令输入",
|
||||||
|
"action.save": "保存目标",
|
||||||
|
"action.cancel": "取消编辑",
|
||||||
|
"action.pause": "暂停目标",
|
||||||
|
"action.resume": "恢复目标",
|
||||||
|
"action.edit": "编辑目标",
|
||||||
|
"action.clear": "清除目标"
|
||||||
|
};
|
||||||
|
/** English dictionary, checked complete against the zh key set. */
|
||||||
|
const en = {
|
||||||
|
"phase.active": "Ongoing Goal",
|
||||||
|
"phase.paused": "Paused Goal",
|
||||||
|
"phase.blocked": "Blocked Goal",
|
||||||
|
"objective.aria": "Goal objective",
|
||||||
|
"commandInput.aria": "Command input",
|
||||||
|
"action.save": "Save goal",
|
||||||
|
"action.cancel": "Cancel edit",
|
||||||
|
"action.pause": "Pause goal",
|
||||||
|
"action.resume": "Resume goal",
|
||||||
|
"action.edit": "Edit goal",
|
||||||
|
"action.clear": "Clear goal"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/index.js
|
||||||
|
/** Dictionary namespace owned by this plugin. */
|
||||||
|
const NS = "goal";
|
||||||
|
/** Required services for the Goal dock, command-input projection, Remote mutations, and copy. */
|
||||||
|
const inject = [
|
||||||
|
"slots",
|
||||||
|
"sessions",
|
||||||
|
"remote",
|
||||||
|
"remote.goals",
|
||||||
|
"locale",
|
||||||
|
"conversationEvents"
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* Client plugin body: the GoalBar dock entry with its mutation verbs.
|
||||||
|
* @param ctx - client root context.
|
||||||
|
*/
|
||||||
|
function apply(ctx) {
|
||||||
|
ctx.conversationEvents.register(goalCommandInputDefinition);
|
||||||
|
ctx.effect(() => ctx.locale.register(NS, {
|
||||||
|
zh,
|
||||||
|
en
|
||||||
|
}), "ui-goal: dictionaries");
|
||||||
|
ctx.slots.inject("conversation.chat.node", () => ctx.slots.register({
|
||||||
|
name: "conversation.chat.node",
|
||||||
|
key: "command-input",
|
||||||
|
locale: NS
|
||||||
|
}, GoalCommandInputView));
|
||||||
|
const sessions = ctx.sessions;
|
||||||
|
/** The session's current projected CAS ref, read at verb call time (no staleness fence: the RPC's CAS is the guard). */
|
||||||
|
const refOf = (sessionId) => {
|
||||||
|
const projection = (sessions.binding(sessionId)?.session.projections.faceOf("goal"))?.getSnapshot();
|
||||||
|
if (projection == null) return void 0;
|
||||||
|
return {
|
||||||
|
id: projection.goal.id,
|
||||||
|
revision: projection.goal.revision
|
||||||
|
};
|
||||||
|
};
|
||||||
|
const noCurrentGoal = {
|
||||||
|
ok: false,
|
||||||
|
error: {
|
||||||
|
code: "no-current-goal",
|
||||||
|
message: "no current goal to mutate",
|
||||||
|
details: {}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
ctx.slots.inject("conversation.input.dock", () => ctx.slots.register({
|
||||||
|
name: "conversation.input.dock",
|
||||||
|
id: "goal",
|
||||||
|
order: 10,
|
||||||
|
locale: NS,
|
||||||
|
inject: (sessionId) => ({
|
||||||
|
onEdit: async (objective) => {
|
||||||
|
const ref = refOf(sessionId);
|
||||||
|
if (ref === void 0) return noCurrentGoal;
|
||||||
|
return await ctx.remote.goals.edit(sessionId, ref, { objective });
|
||||||
|
},
|
||||||
|
onPause: async () => {
|
||||||
|
const ref = refOf(sessionId);
|
||||||
|
if (ref === void 0) return noCurrentGoal;
|
||||||
|
return await ctx.remote.goals.pause(sessionId, ref);
|
||||||
|
},
|
||||||
|
onResume: async () => {
|
||||||
|
const ref = refOf(sessionId);
|
||||||
|
if (ref === void 0) return noCurrentGoal;
|
||||||
|
return await ctx.remote.goals.resume(sessionId, ref);
|
||||||
|
},
|
||||||
|
onClear: async () => {
|
||||||
|
const ref = refOf(sessionId);
|
||||||
|
if (ref === void 0) return noCurrentGoal;
|
||||||
|
return await ctx.remote.goals.clear(sessionId, ref);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, GoalDock));
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
exports.GoalBar = GoalBar;
|
||||||
|
exports.GoalDock = GoalDock;
|
||||||
|
exports.apply = apply;
|
||||||
|
exports.inject = inject;
|
||||||
|
return module.exports;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//# sourceMappingURL=client.js.map
|
||||||
@@ -0,0 +1,461 @@
|
|||||||
|
window.__ModuleLoader__.load({
|
||||||
|
id: "@deepseek-ai/dsh-client-ui-permission-presets",
|
||||||
|
factory: (require) => {
|
||||||
|
var module = { exports: {} };
|
||||||
|
var exports = module.exports;
|
||||||
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||||
|
let react_jsx_runtime = require("react/jsx-runtime");
|
||||||
|
let react = require("react");
|
||||||
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
||||||
|
let _deepseek_ai_dsh_client_runtime_client = require("@deepseek-ai/dsh-client-runtime/client");
|
||||||
|
let _deepseek_ai_dsh_client_schema_form = require("@deepseek-ai/dsh-client-schema-form");
|
||||||
|
//#region lib/types/client/presentation.js
|
||||||
|
/** Machine value of the preset that requires an explicit GUI risk gate. */
|
||||||
|
const FULL_ACCESS_PRESET = "danger-full-access";
|
||||||
|
/**
|
||||||
|
* Convert conventional kebab-case preset names into user-facing title case.
|
||||||
|
* @param name - host-supplied preset label or key.
|
||||||
|
* @returns the title-cased conventional key, or a non-kebab label unchanged.
|
||||||
|
*/
|
||||||
|
function displayPresetName(name) {
|
||||||
|
if (!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(name)) return name;
|
||||||
|
return name.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Render a permission preset under its product label.
|
||||||
|
* @param value - preset machine value.
|
||||||
|
* @param name - host-supplied preset name.
|
||||||
|
* @returns the Full access product label or the conventional display name.
|
||||||
|
*/
|
||||||
|
function displayPermissionPreset(value, name) {
|
||||||
|
return value === "danger-full-access" ? "Full access" : displayPresetName(name);
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-permission-presets/src/client/PermissionRow.module.css.mjs
|
||||||
|
const css = ".oY77xG_row{border-bottom:1px solid var(--dsw-alias-border-l2);align-items:center;gap:8px;padding:16px 0;display:flex}.oY77xG_rowText{flex-direction:column;flex:1;gap:4px;min-width:0;padding-right:48px;display:flex}.oY77xG_title{color:var(--dsw-alias-label-primary);font-size:14px;font-weight:400;line-height:22px}.oY77xG_desc{color:var(--dsw-alias-label-tertiary);font-size:12px;font-weight:400;line-height:18px}.oY77xG_selector{background:var(--dsw-alias-bg-module-platform);height:36px;font:inherit;color:var(--dsw-alias-label-primary);cursor:pointer;border:none;border-radius:18px;align-items:center;gap:12px;padding:0 14px;font-size:14px;line-height:22px;display:inline-flex}.oY77xG_selector:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.oY77xG_selector:disabled{cursor:default}.oY77xG_chevron{flex:none}";
|
||||||
|
const tagId = "@deepseek-ai/dsh-client-ui-permission-presets/PermissionRow.module.css";
|
||||||
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
||||||
|
const tag = document.createElement("style");
|
||||||
|
tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-permission-presets";
|
||||||
|
tag.dataset.pluginCss = tagId;
|
||||||
|
tag.textContent = css;
|
||||||
|
document.head.appendChild(tag);
|
||||||
|
}
|
||||||
|
var PermissionRow_module_css_default = {
|
||||||
|
"selector": "oY77xG_selector",
|
||||||
|
"row": "oY77xG_row",
|
||||||
|
"chevron": "oY77xG_chevron",
|
||||||
|
"rowText": "oY77xG_rowText",
|
||||||
|
"title": "oY77xG_title",
|
||||||
|
"desc": "oY77xG_desc"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/PermissionRow.js
|
||||||
|
/**
|
||||||
|
* Permission preference row: the default preset for subsequently created
|
||||||
|
* sessions. Current-session switches remain on the composer `/permission`
|
||||||
|
* control.
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* Render the new-session Permission default selector.
|
||||||
|
* @param props - composed slot props.
|
||||||
|
* @returns the row, or null when the host does not expose permission settings.
|
||||||
|
*/
|
||||||
|
function PermissionRow({ load, select, usePermission, t }) {
|
||||||
|
const state = usePermission((snapshot) => snapshot);
|
||||||
|
const [open, setOpen] = (0, react.useState)(false);
|
||||||
|
const [confirmingFullAccess, setConfirmingFullAccess] = (0, react.useState)(false);
|
||||||
|
const [acknowledged, setAcknowledged] = (0, react.useState)(false);
|
||||||
|
(0, react.useEffect)(() => {
|
||||||
|
load();
|
||||||
|
}, [load]);
|
||||||
|
(0, react.useEffect)(() => {
|
||||||
|
if (state.writable && state.status !== "unavailable") return;
|
||||||
|
setOpen(false);
|
||||||
|
setAcknowledged(false);
|
||||||
|
setConfirmingFullAccess(false);
|
||||||
|
}, [state.status, state.writable]);
|
||||||
|
if (state.status === "unavailable") return null;
|
||||||
|
const selected = state.options.find((option) => option.id === state.currentValue);
|
||||||
|
const busy = state.status === "loading" || state.status === "saving" || confirmingFullAccess;
|
||||||
|
const label = selected?.label ?? (busy ? t("loading") : t("unavailable"));
|
||||||
|
const description = state.error ?? t("description");
|
||||||
|
return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: PermissionRow_module_css_default.row,
|
||||||
|
children: [(0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: PermissionRow_module_css_default.rowText,
|
||||||
|
children: [(0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: PermissionRow_module_css_default.title,
|
||||||
|
children: t("title")
|
||||||
|
}), (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: PermissionRow_module_css_default.desc,
|
||||||
|
role: state.error === null ? void 0 : "alert",
|
||||||
|
children: description
|
||||||
|
})]
|
||||||
|
}), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Menu, {
|
||||||
|
open,
|
||||||
|
onClose: () => {
|
||||||
|
setOpen(false);
|
||||||
|
},
|
||||||
|
items: state.options.map((option) => ({
|
||||||
|
id: option.id,
|
||||||
|
label: option.label
|
||||||
|
})),
|
||||||
|
selectedId: state.currentValue,
|
||||||
|
onSelect: (id) => {
|
||||||
|
setOpen(false);
|
||||||
|
if (id === state.currentValue) return;
|
||||||
|
if (id === "danger-full-access") {
|
||||||
|
setAcknowledged(false);
|
||||||
|
setConfirmingFullAccess(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
select(id);
|
||||||
|
},
|
||||||
|
align: "end",
|
||||||
|
portal: true,
|
||||||
|
anchor: (0, react_jsx_runtime.jsxs)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: PermissionRow_module_css_default.selector,
|
||||||
|
"aria-haspopup": "menu",
|
||||||
|
"aria-expanded": open,
|
||||||
|
disabled: busy || !state.writable || state.options.length === 0,
|
||||||
|
onClick: () => {
|
||||||
|
setOpen((value) => !value);
|
||||||
|
},
|
||||||
|
children: [label, (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, { className: PermissionRow_module_css_default.chevron })]
|
||||||
|
})
|
||||||
|
})]
|
||||||
|
}), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.RiskConfirmation, {
|
||||||
|
open: confirmingFullAccess,
|
||||||
|
title: t("confirm.title"),
|
||||||
|
description: t("confirm.description"),
|
||||||
|
acknowledgeLabel: t("confirm.acknowledge"),
|
||||||
|
cancelLabel: t("confirm.cancel"),
|
||||||
|
confirmLabel: t("confirm.enable"),
|
||||||
|
acknowledged,
|
||||||
|
disabled: !state.writable || state.status === "saving",
|
||||||
|
onAcknowledgedChange: setAcknowledged,
|
||||||
|
onCancel: () => {
|
||||||
|
setAcknowledged(false);
|
||||||
|
setConfirmingFullAccess(false);
|
||||||
|
},
|
||||||
|
onConfirm: () => {
|
||||||
|
setAcknowledged(false);
|
||||||
|
setConfirmingFullAccess(false);
|
||||||
|
select(FULL_ACCESS_PRESET);
|
||||||
|
}
|
||||||
|
})] });
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/locales.js
|
||||||
|
/** `settings.permission` namespace dictionaries (the Permission row's copy). */
|
||||||
|
/** Simplified Chinese dictionary (the key-set source of truth). */
|
||||||
|
const zh = {
|
||||||
|
"title": "权限",
|
||||||
|
"description": "选择新会话的默认权限模式",
|
||||||
|
"loading": "加载中",
|
||||||
|
"unavailable": "不可用",
|
||||||
|
"confirm.title": "确认启用 Full access?",
|
||||||
|
"confirm.description": "启用 Full access 后,新会话将减少确认步骤,并且可以直接执行更多操作,包括敏感操作、文件修改或外部命令。仅建议在你信任后续任务时使用。",
|
||||||
|
"confirm.acknowledge": "我已了解风险,并愿意继续",
|
||||||
|
"confirm.cancel": "取消",
|
||||||
|
"confirm.enable": "启用 Full access"
|
||||||
|
};
|
||||||
|
/** English dictionary, checked complete against the zh key set. */
|
||||||
|
const en = {
|
||||||
|
"title": "Permission",
|
||||||
|
"description": "Choose the default permission mode for new sessions",
|
||||||
|
"loading": "Loading",
|
||||||
|
"unavailable": "Unavailable",
|
||||||
|
"confirm.title": "Enable Full access?",
|
||||||
|
"confirm.description": "Full access lets new sessions reduce confirmation steps and perform more actions directly, including sensitive operations, file changes, or external commands. Only use it when you trust subsequent tasks.",
|
||||||
|
"confirm.acknowledge": "I understand the risks and want to continue",
|
||||||
|
"confirm.cancel": "Cancel",
|
||||||
|
"confirm.enable": "Enable Full access"
|
||||||
|
};
|
||||||
|
/** Simplified Chinese dictionary for the current-session popup gate. */
|
||||||
|
const accessZh = {
|
||||||
|
"confirm.title": "确认启用 Full access?",
|
||||||
|
"confirm.description": "启用 Full access 后,agent 将减少确认步骤,并且可以直接执行更多操作,包括敏感操作、文件修改或外部命令。仅建议在你信任当前任务时使用。",
|
||||||
|
"confirm.acknowledge": "我已了解风险,并愿意继续",
|
||||||
|
"confirm.cancel": "取消",
|
||||||
|
"confirm.enable": "启用 Full access"
|
||||||
|
};
|
||||||
|
/** English dictionary for the current-session popup gate. */
|
||||||
|
const accessEn = {
|
||||||
|
"confirm.title": "Enable Full access?",
|
||||||
|
"confirm.description": "Full access reduces confirmation steps and lets the agent perform more actions directly, including sensitive operations, file changes, or external commands. Only use it when you trust the current task.",
|
||||||
|
"confirm.acknowledge": "I understand the risks and want to continue",
|
||||||
|
"confirm.cancel": "Cancel",
|
||||||
|
"confirm.enable": "Enable Full access"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/settings-store.js
|
||||||
|
/**
|
||||||
|
* Permission default-settings controller. The host descriptor supplies the
|
||||||
|
* current value and the dynamic preset enum; writes target only
|
||||||
|
* `defaultPreset` and carry the descriptor revision.
|
||||||
|
*/
|
||||||
|
/** Permission's settings namespace on the host wire. */
|
||||||
|
const PERMISSION_SETTINGS_NS = "permission";
|
||||||
|
/**
|
||||||
|
* Read the dynamic preset enum encoded by the host's `defaultPreset` schema.
|
||||||
|
* @param view - permission namespace descriptor.
|
||||||
|
* @returns current value and selectable options.
|
||||||
|
*/
|
||||||
|
function permissionDefaultOf(view) {
|
||||||
|
const value = view.value?.defaultPreset;
|
||||||
|
if (typeof value !== "string") throw new Error("permission settings has no defaultPreset value");
|
||||||
|
const node = (0, _deepseek_ai_dsh_client_schema_form.nodeAtPath)((0, _deepseek_ai_dsh_client_schema_form.rehydrateSchema)(view.schema), ["defaultPreset"]);
|
||||||
|
if (node === void 0) throw new Error("permission settings schema has no defaultPreset field");
|
||||||
|
const options = (node.type === "union" ? node.list ?? [] : [node]).flatMap((candidate) => {
|
||||||
|
const choice = candidate;
|
||||||
|
if (choice.type !== "const" || typeof choice.value !== "string") return [];
|
||||||
|
const described = choice.meta?.description;
|
||||||
|
return [{
|
||||||
|
id: choice.value,
|
||||||
|
label: typeof described === "string" && described.length > 0 ? displayPermissionPreset(choice.value, described) : displayPermissionPreset(choice.value, choice.value)
|
||||||
|
}];
|
||||||
|
});
|
||||||
|
if (options.length === 0 || !options.some((option) => option.id === value)) throw new Error("permission settings schema does not advertise its current preset");
|
||||||
|
return {
|
||||||
|
currentValue: value,
|
||||||
|
options
|
||||||
|
};
|
||||||
|
}
|
||||||
|
/** Controller joining Settings reads, writes, and pushed invalidations. */
|
||||||
|
var PermissionPresetSettingsController = class {
|
||||||
|
api;
|
||||||
|
/** Row snapshot consumed through a bound selector hook. */
|
||||||
|
store = (0, _deepseek_ai_dsh_client_runtime_client.createSnapshotStore)({
|
||||||
|
status: "idle",
|
||||||
|
error: null,
|
||||||
|
writable: false,
|
||||||
|
currentValue: "",
|
||||||
|
options: [],
|
||||||
|
revision: 0
|
||||||
|
});
|
||||||
|
generation = 0;
|
||||||
|
view;
|
||||||
|
/** @param api - Settings wire face. */
|
||||||
|
constructor(api) {
|
||||||
|
this.api = api;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Refresh the permission descriptor. Latest request wins.
|
||||||
|
* @returns nothing; {@link store} carries success or failure.
|
||||||
|
*/
|
||||||
|
async load() {
|
||||||
|
const generation = ++this.generation;
|
||||||
|
this.store.update((state) => {
|
||||||
|
state.status = "loading";
|
||||||
|
state.error = null;
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
const response = await this.api.settings.describe({});
|
||||||
|
if (!response.result.ok) throw new Error(response.result.error.message);
|
||||||
|
if (generation !== this.generation) return;
|
||||||
|
const view = response.result.value.namespaces.find((entry) => entry.ns === PERMISSION_SETTINGS_NS);
|
||||||
|
if (view === void 0) {
|
||||||
|
this.view = void 0;
|
||||||
|
this.store.update((state) => {
|
||||||
|
state.status = "unavailable";
|
||||||
|
state.writable = false;
|
||||||
|
state.currentValue = "";
|
||||||
|
state.options = [];
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.accept(view, response.result.value.writable);
|
||||||
|
} catch (error) {
|
||||||
|
if (generation !== this.generation) return;
|
||||||
|
this.fail(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Persist one preset as the default for subsequently created sessions.
|
||||||
|
* @param preset - advertised preset key.
|
||||||
|
* @returns nothing; {@link store} carries success or failure.
|
||||||
|
*/
|
||||||
|
async select(preset) {
|
||||||
|
const view = this.view;
|
||||||
|
const state = this.store.getSnapshot();
|
||||||
|
if (view === void 0 || !state.writable) return;
|
||||||
|
const generation = ++this.generation;
|
||||||
|
this.store.update((draft) => {
|
||||||
|
draft.status = "saving";
|
||||||
|
draft.error = null;
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
const response = await this.api.settings.mutate({
|
||||||
|
ns: PERMISSION_SETTINGS_NS,
|
||||||
|
ops: [{
|
||||||
|
op: "set",
|
||||||
|
path: ["defaultPreset"],
|
||||||
|
value: preset
|
||||||
|
}],
|
||||||
|
expectedRevision: view.revision
|
||||||
|
});
|
||||||
|
if (generation !== this.generation) return;
|
||||||
|
if (!response.result.ok) throw new Error(response.result.error.message);
|
||||||
|
this.accept(response.result.value, true);
|
||||||
|
} catch (error) {
|
||||||
|
if (generation !== this.generation) return;
|
||||||
|
this.fail(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** Stop in-flight responses from publishing after plugin disposal. */
|
||||||
|
dispose() {
|
||||||
|
this.generation += 1;
|
||||||
|
this.view = void 0;
|
||||||
|
}
|
||||||
|
accept(view, writable) {
|
||||||
|
const resolved = permissionDefaultOf(view);
|
||||||
|
this.view = view;
|
||||||
|
this.store.update((state) => {
|
||||||
|
state.status = "ready";
|
||||||
|
state.error = null;
|
||||||
|
state.writable = writable;
|
||||||
|
state.currentValue = resolved.currentValue;
|
||||||
|
state.options = resolved.options;
|
||||||
|
state.revision = view.revision;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
fail(error) {
|
||||||
|
this.store.update((state) => {
|
||||||
|
state.status = "error";
|
||||||
|
state.error = error instanceof Error ? error.message : String(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Refetch only after the row has opened once.
|
||||||
|
* @param controller - permission settings controller.
|
||||||
|
*/
|
||||||
|
function refreshPermissionIfLoaded(controller) {
|
||||||
|
if (controller.store.getSnapshot().status === "idle") return;
|
||||||
|
controller.load();
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/index.js
|
||||||
|
/** Required services (cordis fiber inject). */
|
||||||
|
const inject = [
|
||||||
|
"commandUi",
|
||||||
|
"sessions",
|
||||||
|
"slots",
|
||||||
|
"locale",
|
||||||
|
"connection",
|
||||||
|
"remote"
|
||||||
|
];
|
||||||
|
const ACCESS_NS = "permission.access";
|
||||||
|
/** Read one session's current permissions projection value (undefined = capability absent). */
|
||||||
|
function selectOf(session) {
|
||||||
|
return session?.projections.faceOf("permissions").getSnapshot();
|
||||||
|
}
|
||||||
|
/** Flatten the projection select into popup rows; `custom` is display state, never a target. */
|
||||||
|
function optionsOf(value, t) {
|
||||||
|
return value.options.filter((option) => option.value !== "custom").map((option) => ({
|
||||||
|
id: option.value,
|
||||||
|
label: displayPermissionPreset(option.value, option.name),
|
||||||
|
...option.description !== void 0 ? { detail: option.description } : {},
|
||||||
|
...option.value === value.currentValue ? { active: true } : {},
|
||||||
|
...option.value === "danger-full-access" ? { confirmation: {
|
||||||
|
title: t("confirm.title"),
|
||||||
|
description: t("confirm.description"),
|
||||||
|
acknowledgeLabel: t("confirm.acknowledge"),
|
||||||
|
cancelLabel: t("confirm.cancel"),
|
||||||
|
confirmLabel: t("confirm.enable")
|
||||||
|
} } : {}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Client plugin body: register the /permission popup picker over the
|
||||||
|
* permissions projection.
|
||||||
|
* @param ctx - client root context.
|
||||||
|
*/
|
||||||
|
function apply(ctx) {
|
||||||
|
const command = ctx.get("commandUi");
|
||||||
|
const sessions = ctx.sessions;
|
||||||
|
ctx.effect(() => {
|
||||||
|
const disposers = [ctx.locale.register(ACCESS_NS, "zh", {
|
||||||
|
"confirm.title": accessZh["confirm.title"],
|
||||||
|
"confirm.description": accessZh["confirm.description"],
|
||||||
|
"confirm.acknowledge": accessZh["confirm.acknowledge"],
|
||||||
|
"confirm.cancel": accessZh["confirm.cancel"],
|
||||||
|
"confirm.enable": accessZh["confirm.enable"]
|
||||||
|
}), ctx.locale.register(ACCESS_NS, "en", {
|
||||||
|
"confirm.title": accessEn["confirm.title"],
|
||||||
|
"confirm.description": accessEn["confirm.description"],
|
||||||
|
"confirm.acknowledge": accessEn["confirm.acknowledge"],
|
||||||
|
"confirm.cancel": accessEn["confirm.cancel"],
|
||||||
|
"confirm.enable": accessEn["confirm.enable"]
|
||||||
|
})];
|
||||||
|
return () => {
|
||||||
|
for (const dispose of disposers) dispose();
|
||||||
|
};
|
||||||
|
}, "ui-permission: Full access confirmation dictionaries");
|
||||||
|
const t = ctx.locale.bind(ACCESS_NS);
|
||||||
|
const sessionFor = (session) => sessions.binding(session.sessionId)?.session;
|
||||||
|
ctx.effect(() => ctx.locale.register("settings.permission", {
|
||||||
|
zh,
|
||||||
|
en
|
||||||
|
}), "ui-permission: settings row dictionaries");
|
||||||
|
const controller = new PermissionPresetSettingsController(ctx.get("connection").api);
|
||||||
|
const load = () => controller.load();
|
||||||
|
const select = (preset) => controller.select(preset);
|
||||||
|
const injected = () => ({
|
||||||
|
hooks: { permission: controller.store },
|
||||||
|
load,
|
||||||
|
select
|
||||||
|
});
|
||||||
|
ctx.effect(() => {
|
||||||
|
const refresh = () => {
|
||||||
|
refreshPermissionIfLoaded(controller);
|
||||||
|
};
|
||||||
|
const disposers = [ctx.remote.$on("settings/document-updated", (ns) => {
|
||||||
|
if (ns !== "permission") return;
|
||||||
|
refresh();
|
||||||
|
}), ctx.on("connection/reset", () => {
|
||||||
|
refresh();
|
||||||
|
})];
|
||||||
|
return () => {
|
||||||
|
controller.dispose();
|
||||||
|
for (const dispose of disposers) dispose();
|
||||||
|
};
|
||||||
|
}, "ui-permission: settings invalidations");
|
||||||
|
ctx.slots.inject("settings.general.item", () => ctx.slots.register({
|
||||||
|
name: "settings.general.item",
|
||||||
|
id: "permission",
|
||||||
|
order: -20,
|
||||||
|
locale: "settings.permission",
|
||||||
|
inject: injected
|
||||||
|
}, PermissionRow));
|
||||||
|
ctx.effect(() => command.decorate({
|
||||||
|
name: "permission",
|
||||||
|
available: (session) => selectOf(sessionFor(session)) !== void 0,
|
||||||
|
ui: {
|
||||||
|
kind: "popupSelect",
|
||||||
|
options: (session) => {
|
||||||
|
const value = selectOf(sessionFor(session));
|
||||||
|
if (value === void 0) throw new Error("permission presets are not available on this host");
|
||||||
|
return Promise.resolve(optionsOf(value, t));
|
||||||
|
},
|
||||||
|
onSelect: async (option, session) => {
|
||||||
|
const live = sessionFor(session);
|
||||||
|
if (live === void 0) throw new Error("this session is not materialized yet");
|
||||||
|
const result = await live.command(`/permission ${option.id}`);
|
||||||
|
if (!result.ok) throw new Error(`permission switch failed: ${result.error.code}: ${result.error.message}`);
|
||||||
|
if (!result.value.matched) throw new Error("the host offers no /permission command");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}), "ui-permission: /permission decoration");
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
exports.apply = apply;
|
||||||
|
exports.inject = inject;
|
||||||
|
return module.exports;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//# sourceMappingURL=client.js.map
|
||||||
@@ -0,0 +1,611 @@
|
|||||||
|
window.__ModuleLoader__.load({
|
||||||
|
id: "@deepseek-ai/dsh-client-ui-message-feedback",
|
||||||
|
factory: (require) => {
|
||||||
|
var module = { exports: {} };
|
||||||
|
var exports = module.exports;
|
||||||
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||||
|
let react_jsx_runtime = require("react/jsx-runtime");
|
||||||
|
let react = require("react");
|
||||||
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
||||||
|
//#region lib/types/client/controller.js
|
||||||
|
const INITIAL_VIEW = Object.freeze({
|
||||||
|
status: "cold",
|
||||||
|
items: /* @__PURE__ */ new Map(),
|
||||||
|
error: null
|
||||||
|
});
|
||||||
|
const OK = Object.freeze({ ok: true });
|
||||||
|
const DISPOSED = Object.freeze({
|
||||||
|
ok: false,
|
||||||
|
error: Object.freeze({
|
||||||
|
code: "disposed",
|
||||||
|
message: "feedback controller is disposed"
|
||||||
|
})
|
||||||
|
});
|
||||||
|
/** Human-readable text for one business failure code. */
|
||||||
|
function describe(code) {
|
||||||
|
switch (code) {
|
||||||
|
case "session-not-found": return "this session is no longer persisted";
|
||||||
|
case "target-not-found": return "this message is not a persisted assistant message";
|
||||||
|
case "version-conflict": return "feedback changed elsewhere";
|
||||||
|
case "note-blank": return "a note must contain a non-whitespace character";
|
||||||
|
case "note-too-large": return "the note is too long";
|
||||||
|
default: return code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** Build the rejected branch for one business failure code. */
|
||||||
|
function fail(code) {
|
||||||
|
return {
|
||||||
|
ok: false,
|
||||||
|
error: {
|
||||||
|
code,
|
||||||
|
message: describe(code)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
/** Carrier failure rendered with the Host-supplied code and message. */
|
||||||
|
function carrierFailure(error) {
|
||||||
|
return {
|
||||||
|
ok: false,
|
||||||
|
error: {
|
||||||
|
code: error.code,
|
||||||
|
message: error.message
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Per-session feedback object layer. One instance backs every per-message
|
||||||
|
* control in that Session, so a single list read seeds them all.
|
||||||
|
*/
|
||||||
|
var MessageFeedbackController = class {
|
||||||
|
remote;
|
||||||
|
sessionId;
|
||||||
|
view = INITIAL_VIEW;
|
||||||
|
listeners = /* @__PURE__ */ new Set();
|
||||||
|
loadPromise = null;
|
||||||
|
operationTail = Promise.resolve();
|
||||||
|
disposed = false;
|
||||||
|
/**
|
||||||
|
* @param remote - the messageFeedback Remote namespace.
|
||||||
|
* @param sessionId - Session owning every addressed assistant message.
|
||||||
|
*/
|
||||||
|
constructor(remote, sessionId) {
|
||||||
|
this.remote = remote;
|
||||||
|
this.sessionId = sessionId;
|
||||||
|
}
|
||||||
|
/** Return the cached immutable view. */
|
||||||
|
getSnapshot = () => this.view;
|
||||||
|
/** Subscribe to view replacement. */
|
||||||
|
subscribe = (listener) => {
|
||||||
|
this.listeners.add(listener);
|
||||||
|
return () => {
|
||||||
|
this.listeners.delete(listener);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Load once; a failed load stays retryable.
|
||||||
|
* @returns the settled load result, shared by concurrent callers.
|
||||||
|
*/
|
||||||
|
ensure() {
|
||||||
|
if (this.view.status === "ready") return Promise.resolve(OK);
|
||||||
|
return this.refresh();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Re-read the authoritative list, collapsing concurrent callers onto one
|
||||||
|
* in-flight read.
|
||||||
|
*
|
||||||
|
* This is the unserialized read used to seed a cold controller, where no
|
||||||
|
* mutation can be in flight yet. A reconnect must use {@link resync} instead:
|
||||||
|
* an unserialized list response can otherwise arrive after a newer mutation's
|
||||||
|
* reply and overwrite the version that mutation just committed.
|
||||||
|
* @returns the settled reload result.
|
||||||
|
*/
|
||||||
|
refresh() {
|
||||||
|
if (this.loadPromise !== null) return this.loadPromise;
|
||||||
|
this.publish({
|
||||||
|
status: "loading",
|
||||||
|
items: this.view.items,
|
||||||
|
error: null
|
||||||
|
});
|
||||||
|
const pending = this.load();
|
||||||
|
this.loadPromise = pending;
|
||||||
|
return pending.finally(() => {
|
||||||
|
this.loadPromise = null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Re-read the list behind this Session's queued mutations, so a reconnect
|
||||||
|
* cannot resurrect a version an in-flight mutation already replaced.
|
||||||
|
* @returns the settled reload result.
|
||||||
|
*/
|
||||||
|
resync() {
|
||||||
|
return this.mutate(() => this.refresh(), { seed: false });
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Create or replace feedback for one message, comparing against the version
|
||||||
|
* this controller last observed.
|
||||||
|
*
|
||||||
|
* The note is resolved here rather than by the caller: `mutate` awaits the
|
||||||
|
* one list read first, so this body always sees the committed item, while a
|
||||||
|
* control that rendered before that read completed would still be holding
|
||||||
|
* `undefined`. Omitting `note` therefore keeps whatever is stored; only
|
||||||
|
* {@link clearNote} removes one.
|
||||||
|
* @param messageId - target assistant message.
|
||||||
|
* @param rating - desired judgment.
|
||||||
|
* @param note - replacement explanation; omitted keeps the stored note.
|
||||||
|
* @returns the settled mutation result.
|
||||||
|
*/
|
||||||
|
rate(messageId, rating, note) {
|
||||||
|
return this.mutate(async () => {
|
||||||
|
const observed = this.view.items.get(messageId);
|
||||||
|
return await this.putCommitted(messageId, rating, note ?? observed?.note, observed);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Replace one message's rating with the opposite judgment, or retract it when
|
||||||
|
* the committed rating already matches. The decision reads the committed item
|
||||||
|
* inside the serialized mutation, so a click that lands before the first list
|
||||||
|
* read still toggles against the stored value rather than the empty view a
|
||||||
|
* cold control rendered.
|
||||||
|
* @param messageId - target assistant message.
|
||||||
|
* @param rating - the judgment the human asked for.
|
||||||
|
* @returns the settled mutation result.
|
||||||
|
*/
|
||||||
|
toggle(messageId, rating) {
|
||||||
|
return this.mutate(async () => {
|
||||||
|
const observed = this.view.items.get(messageId);
|
||||||
|
if (observed?.rating === rating) return await this.deleteCommitted(messageId, observed);
|
||||||
|
return await this.putCommitted(messageId, rating, observed?.note, observed);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Drop the note while keeping the rating. Absent feedback needs no call.
|
||||||
|
* @param messageId - target assistant message.
|
||||||
|
* @returns the settled mutation result.
|
||||||
|
*/
|
||||||
|
clearNote(messageId) {
|
||||||
|
return this.mutate(async () => {
|
||||||
|
const observed = this.view.items.get(messageId);
|
||||||
|
if (observed === void 0 || observed.note === void 0) return OK;
|
||||||
|
return await this.putCommitted(messageId, observed.rating, void 0, observed);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Remove feedback for one message. A message with no known item is already
|
||||||
|
* in the requested state, so no call is made.
|
||||||
|
* @param messageId - target assistant message.
|
||||||
|
* @returns the settled mutation result.
|
||||||
|
*/
|
||||||
|
clear(messageId) {
|
||||||
|
return this.mutate(async () => {
|
||||||
|
const observed = this.view.items.get(messageId);
|
||||||
|
if (observed === void 0) return OK;
|
||||||
|
return await this.deleteCommitted(messageId, observed);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** Commit one put against the observed version and reconcile a conflict. */
|
||||||
|
async putCommitted(messageId, rating, note, observed) {
|
||||||
|
const carried = await this.remote.put({
|
||||||
|
sessionId: this.sessionId,
|
||||||
|
messageId,
|
||||||
|
rating,
|
||||||
|
...note === void 0 ? {} : { note },
|
||||||
|
ifVersion: observed?.version ?? null
|
||||||
|
});
|
||||||
|
if (!carried.ok) return carrierFailure(carried.error);
|
||||||
|
const result = carried.value;
|
||||||
|
if (result.ok) {
|
||||||
|
this.commit(messageId, result.value);
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
if (result.error.code === "version-conflict") this.commit(messageId, result.error.current);
|
||||||
|
return fail(result.error.code);
|
||||||
|
}
|
||||||
|
/** Commit one delete against the observed version and reconcile a conflict. */
|
||||||
|
async deleteCommitted(messageId, observed) {
|
||||||
|
const carried = await this.remote.delete({
|
||||||
|
sessionId: this.sessionId,
|
||||||
|
messageId,
|
||||||
|
ifVersion: observed.version
|
||||||
|
});
|
||||||
|
if (!carried.ok) return carrierFailure(carried.error);
|
||||||
|
const result = carried.value;
|
||||||
|
if (result.ok) {
|
||||||
|
this.commit(messageId, null);
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
if (result.error.code === "version-conflict") this.commit(messageId, result.error.current);
|
||||||
|
return fail(result.error.code);
|
||||||
|
}
|
||||||
|
/** Drop subscribers and refuse further work when the owning fiber unloads. */
|
||||||
|
dispose() {
|
||||||
|
this.disposed = true;
|
||||||
|
this.listeners.clear();
|
||||||
|
}
|
||||||
|
/** Fetch the whole sidecar and publish it as the seeded view. */
|
||||||
|
async load() {
|
||||||
|
try {
|
||||||
|
const carried = await this.remote.list({ sessionId: this.sessionId });
|
||||||
|
if (this.disposed) return OK;
|
||||||
|
if (!carried.ok) {
|
||||||
|
this.publish({
|
||||||
|
status: "error",
|
||||||
|
items: this.view.items,
|
||||||
|
error: carried.error.message
|
||||||
|
});
|
||||||
|
return carrierFailure(carried.error);
|
||||||
|
}
|
||||||
|
const result = carried.value;
|
||||||
|
if (!result.ok) {
|
||||||
|
this.publish({
|
||||||
|
status: "error",
|
||||||
|
items: this.view.items,
|
||||||
|
error: describe(result.error.code)
|
||||||
|
});
|
||||||
|
return fail(result.error.code);
|
||||||
|
}
|
||||||
|
const items = /* @__PURE__ */ new Map();
|
||||||
|
for (const item of result.value.items) items.set(item.messageId, item);
|
||||||
|
this.publish({
|
||||||
|
status: "ready",
|
||||||
|
items,
|
||||||
|
error: null
|
||||||
|
});
|
||||||
|
return OK;
|
||||||
|
} catch (error) {
|
||||||
|
if (this.disposed) return OK;
|
||||||
|
const message = error instanceof Error ? error.message : "message feedback list failed";
|
||||||
|
this.publish({
|
||||||
|
status: "error",
|
||||||
|
items: this.view.items,
|
||||||
|
error: message
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
ok: false,
|
||||||
|
error: {
|
||||||
|
code: "transport",
|
||||||
|
message
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Serialize one mutation behind this Session's prior mutation so queued
|
||||||
|
* operations always compare against the committed version, and translate a
|
||||||
|
* transport throw into the same settled shape the controls already render.
|
||||||
|
*/
|
||||||
|
mutate(operation, options = {}) {
|
||||||
|
const guarded = async () => {
|
||||||
|
if (this.disposed) return DISPOSED;
|
||||||
|
if (options.seed !== false) {
|
||||||
|
const loaded = await this.ensure();
|
||||||
|
if (!loaded.ok) return loaded;
|
||||||
|
if (this.disposed) return DISPOSED;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return await operation();
|
||||||
|
} catch (error) {
|
||||||
|
return {
|
||||||
|
ok: false,
|
||||||
|
error: {
|
||||||
|
code: "transport",
|
||||||
|
message: error instanceof Error ? error.message : "message feedback mutation failed"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const result = this.operationTail.then(guarded, guarded);
|
||||||
|
this.operationTail = result.then(() => void 0);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Replace one message's entry, keeping every other entry's identity. Only a
|
||||||
|
* `mutate` operation reaches this, and `mutate` refuses admission once the
|
||||||
|
* controller is disposed, so no disposal guard belongs here; `publish` is
|
||||||
|
* the single place that stops notifying after listeners are dropped.
|
||||||
|
*/
|
||||||
|
commit(messageId, item) {
|
||||||
|
const items = new Map(this.view.items);
|
||||||
|
if (item === null) items.delete(messageId);
|
||||||
|
else items.set(messageId, item);
|
||||||
|
this.publish({
|
||||||
|
status: "ready",
|
||||||
|
items,
|
||||||
|
error: null
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/** Replace the view and contain subscriber failures at the observable boundary. */
|
||||||
|
publish(view) {
|
||||||
|
this.view = Object.freeze(view);
|
||||||
|
for (const listener of this.listeners) try {
|
||||||
|
listener();
|
||||||
|
} catch (error) {
|
||||||
|
console.error("[ui-message-feedback] subscriber threw:", error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-message-feedback/src/client/MessageFeedbackActions.module.css.mjs
|
||||||
|
const css = "._8_XoUG_action{width:28px;height:28px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:28px;justify-content:center;align-items:center;padding:6px;display:inline-flex}._8_XoUG_action:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary)}._8_XoUG_action:disabled{cursor:default;opacity:.4}._8_XoUG_action[data-active]{color:var(--dsw-alias-label-primary)}._8_XoUG_noteOpen{max-width:220px;color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;cursor:pointer;background:0 0;border:none;border-radius:14px;padding:0 8px;font-size:13px;line-height:28px;overflow:hidden}._8_XoUG_noteOpen:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary)}._8_XoUG_noteEditor{align-items:flex-start;gap:6px;display:inline-flex}._8_XoUG_noteInput{border:1px solid var(--dsw-alias-border-secondary);background:var(--dsw-alias-bg-primary);width:260px;color:var(--dsw-alias-label-primary);font:inherit;resize:vertical;border-radius:8px;padding:6px 8px;font-size:13px}._8_XoUG_noteSave,._8_XoUG_noteCancel{cursor:pointer;border:none;border-radius:14px;height:28px;padding:0 10px;font-size:13px}._8_XoUG_noteSave{background:var(--dsw-alias-interactive-bg-primary);color:var(--dsw-alias-label-inverse)}._8_XoUG_noteSave:disabled{cursor:default;opacity:.4}._8_XoUG_noteCancel{color:var(--dsw-alias-label-tertiary);background:0 0}._8_XoUG_noteCancel:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary)}._8_XoUG_failure{color:var(--dsw-alias-label-tertiary);padding-left:4px;font-size:13px;line-height:28px}";
|
||||||
|
const tagId = "@deepseek-ai/dsh-client-ui-message-feedback/MessageFeedbackActions.module.css";
|
||||||
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
||||||
|
const tag = document.createElement("style");
|
||||||
|
tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-message-feedback";
|
||||||
|
tag.dataset.pluginCss = tagId;
|
||||||
|
tag.textContent = css;
|
||||||
|
document.head.appendChild(tag);
|
||||||
|
}
|
||||||
|
var MessageFeedbackActions_module_css_default = {
|
||||||
|
"noteSave": "_8_XoUG_noteSave",
|
||||||
|
"noteInput": "_8_XoUG_noteInput",
|
||||||
|
"noteCancel": "_8_XoUG_noteCancel",
|
||||||
|
"action": "_8_XoUG_action",
|
||||||
|
"noteOpen": "_8_XoUG_noteOpen",
|
||||||
|
"failure": "_8_XoUG_failure",
|
||||||
|
"noteEditor": "_8_XoUG_noteEditor"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/MessageFeedbackActions.js
|
||||||
|
/**
|
||||||
|
* Per-message feedback controls: a Like/Dislike pair plus an optional note.
|
||||||
|
* Rendered inside the assistant message's IconActions row, so the buttons
|
||||||
|
* reuse that row's chrome and sit between copy and branch.
|
||||||
|
* @module @deepseek-ai/dsh-client-ui-message-feedback/client/MessageFeedbackActions
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* One message's feedback controls.
|
||||||
|
* @param props - the owner's message identity, the injected verbs, and the
|
||||||
|
* shared feedback hook.
|
||||||
|
* @returns the rating buttons, plus the note editor while it is open.
|
||||||
|
*/
|
||||||
|
function MessageFeedbackActions({ messageId, ensure, rate, toggle, clearNote, useFeedback, t }) {
|
||||||
|
const item = useFeedback((view) => view.items.get(messageId));
|
||||||
|
const loadFailed = useFeedback((view) => view.status === "error");
|
||||||
|
const rating = item?.rating;
|
||||||
|
const [noteOpen, setNoteOpen] = (0, react.useState)(false);
|
||||||
|
const [draft, setDraft] = (0, react.useState)("");
|
||||||
|
const [pending, setPending] = (0, react.useState)(false);
|
||||||
|
const [failure, setFailure] = (0, react.useState)(null);
|
||||||
|
const seeded = (0, react.useRef)(false);
|
||||||
|
const seed = (0, react.useCallback)(() => {
|
||||||
|
if (seeded.current) return;
|
||||||
|
seeded.current = true;
|
||||||
|
ensure();
|
||||||
|
}, [ensure]);
|
||||||
|
const alive = (0, react.useRef)(true);
|
||||||
|
(0, react.useEffect)(() => () => {
|
||||||
|
alive.current = false;
|
||||||
|
}, []);
|
||||||
|
const settle = (0, react.useCallback)((result) => {
|
||||||
|
if (!alive.current) return;
|
||||||
|
setPending(false);
|
||||||
|
if (result.ok) {
|
||||||
|
setFailure(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setFailure(result.error?.code === "version-conflict" ? t("error.conflict") : t("error.generic"));
|
||||||
|
}, [t]);
|
||||||
|
const onRate = (0, react.useCallback)((next) => {
|
||||||
|
setPending(true);
|
||||||
|
setFailure(null);
|
||||||
|
setNoteOpen(false);
|
||||||
|
toggle(messageId, next).then(settle);
|
||||||
|
}, [
|
||||||
|
messageId,
|
||||||
|
settle,
|
||||||
|
toggle
|
||||||
|
]);
|
||||||
|
const onSaveNote = (0, react.useCallback)((current) => {
|
||||||
|
const trimmed = draft.trim();
|
||||||
|
setPending(true);
|
||||||
|
setFailure(null);
|
||||||
|
(trimmed.length === 0 ? clearNote(messageId) : rate(messageId, current, trimmed)).then((result) => {
|
||||||
|
settle(result);
|
||||||
|
if (result.ok && alive.current) setNoteOpen(false);
|
||||||
|
});
|
||||||
|
}, [
|
||||||
|
clearNote,
|
||||||
|
draft,
|
||||||
|
messageId,
|
||||||
|
rate,
|
||||||
|
settle
|
||||||
|
]);
|
||||||
|
const openNote = (0, react.useCallback)(() => {
|
||||||
|
setDraft(item?.note ?? "");
|
||||||
|
setNoteOpen(true);
|
||||||
|
}, [item?.note]);
|
||||||
|
const likeLabel = rating === "positive" ? t("action.likeActive") : t("action.like");
|
||||||
|
const dislikeLabel = rating === "negative" ? t("action.dislikeActive") : t("action.dislike");
|
||||||
|
return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
||||||
|
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
||||||
|
label: likeLabel,
|
||||||
|
side: "bottom",
|
||||||
|
children: (0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: MessageFeedbackActions_module_css_default.action,
|
||||||
|
"aria-label": likeLabel,
|
||||||
|
"aria-pressed": rating === "positive",
|
||||||
|
"data-active": rating === "positive" || void 0,
|
||||||
|
disabled: pending,
|
||||||
|
onFocus: seed,
|
||||||
|
onPointerEnter: seed,
|
||||||
|
onClick: () => {
|
||||||
|
onRate("positive");
|
||||||
|
},
|
||||||
|
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconLikeOutline16, {})
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Tooltip, {
|
||||||
|
label: dislikeLabel,
|
||||||
|
side: "bottom",
|
||||||
|
children: (0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: MessageFeedbackActions_module_css_default.action,
|
||||||
|
"aria-label": dislikeLabel,
|
||||||
|
"aria-pressed": rating === "negative",
|
||||||
|
"data-active": rating === "negative" || void 0,
|
||||||
|
disabled: pending,
|
||||||
|
onFocus: seed,
|
||||||
|
onPointerEnter: seed,
|
||||||
|
onClick: () => {
|
||||||
|
onRate("negative");
|
||||||
|
},
|
||||||
|
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconDislikeOutline16, {})
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
rating !== void 0 && !noteOpen && (0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: MessageFeedbackActions_module_css_default.noteOpen,
|
||||||
|
onClick: openNote,
|
||||||
|
children: item?.note === void 0 ? t("note.open") : item.note
|
||||||
|
}),
|
||||||
|
rating !== void 0 && noteOpen && (0, react_jsx_runtime.jsxs)("span", {
|
||||||
|
className: MessageFeedbackActions_module_css_default.noteEditor,
|
||||||
|
children: [
|
||||||
|
(0, react_jsx_runtime.jsx)("textarea", {
|
||||||
|
className: MessageFeedbackActions_module_css_default.noteInput,
|
||||||
|
"aria-label": t("note.aria"),
|
||||||
|
placeholder: t("note.placeholder"),
|
||||||
|
value: draft,
|
||||||
|
rows: 2,
|
||||||
|
onChange: (event) => {
|
||||||
|
setDraft(event.target.value);
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: MessageFeedbackActions_module_css_default.noteSave,
|
||||||
|
disabled: pending,
|
||||||
|
onClick: () => {
|
||||||
|
onSaveNote(rating);
|
||||||
|
},
|
||||||
|
children: t("note.save")
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: MessageFeedbackActions_module_css_default.noteCancel,
|
||||||
|
onClick: () => {
|
||||||
|
setNoteOpen(false);
|
||||||
|
},
|
||||||
|
children: t("note.cancel")
|
||||||
|
})
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
failure === null && loadFailed && (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: MessageFeedbackActions_module_css_default.failure,
|
||||||
|
role: "status",
|
||||||
|
children: t("error.load")
|
||||||
|
}),
|
||||||
|
failure !== null && (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: MessageFeedbackActions_module_css_default.failure,
|
||||||
|
role: "status",
|
||||||
|
children: failure
|
||||||
|
})
|
||||||
|
] });
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/locales.js
|
||||||
|
/** `feedback` namespace dictionaries. */
|
||||||
|
/** Simplified Chinese dictionary (the key-set source of truth). */
|
||||||
|
const zh = {
|
||||||
|
"action.like": "好的回答",
|
||||||
|
"action.likeActive": "取消标记",
|
||||||
|
"action.dislike": "有问题的回答",
|
||||||
|
"action.dislikeActive": "取消标记",
|
||||||
|
"note.open": "补充说明",
|
||||||
|
"note.placeholder": "这条回答哪里好,或哪里有问题?(可选)",
|
||||||
|
"note.save": "保存",
|
||||||
|
"note.cancel": "取消",
|
||||||
|
"note.aria": "反馈说明",
|
||||||
|
"error.conflict": "这条反馈已在别处改动,已显示最新状态",
|
||||||
|
"error.load": "反馈状态加载失败",
|
||||||
|
"error.generic": "反馈保存失败"
|
||||||
|
};
|
||||||
|
/** English dictionary, checked complete against the zh key set. */
|
||||||
|
const en = {
|
||||||
|
"action.like": "Good response",
|
||||||
|
"action.likeActive": "Remove rating",
|
||||||
|
"action.dislike": "Bad response",
|
||||||
|
"action.dislikeActive": "Remove rating",
|
||||||
|
"note.open": "Add a note",
|
||||||
|
"note.placeholder": "What was good, or what went wrong? (optional)",
|
||||||
|
"note.save": "Save",
|
||||||
|
"note.cancel": "Cancel",
|
||||||
|
"note.aria": "Feedback note",
|
||||||
|
"error.conflict": "This feedback changed elsewhere; the latest state is shown",
|
||||||
|
"error.load": "Could not load feedback",
|
||||||
|
"error.generic": "Could not save feedback"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/index.js
|
||||||
|
/**
|
||||||
|
* Message feedback plugin, browser half: the Like/Dislike entry in the
|
||||||
|
* conversation.chat.assistant-actions strip. One MessageFeedbackController per
|
||||||
|
* Session backs every message control in that Session, so a single list read
|
||||||
|
* seeds the whole transcript. Mutations go through the generated
|
||||||
|
* messageFeedback Remote; the Host owns per-item compare-and-set.
|
||||||
|
* @module @deepseek-ai/dsh-client-ui-message-feedback/client
|
||||||
|
*/
|
||||||
|
/** Dictionary namespace owned by this plugin. */
|
||||||
|
const NS = "feedback";
|
||||||
|
/** Required services: the slot registry, the Remote namespace, and the copy. */
|
||||||
|
const inject = [
|
||||||
|
"slots",
|
||||||
|
"remote",
|
||||||
|
"remote.messageFeedback",
|
||||||
|
"locale"
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* Client plugin body: the per-message feedback entry and its per-session
|
||||||
|
* object layer.
|
||||||
|
* @param ctx - client root context.
|
||||||
|
*/
|
||||||
|
function apply(ctx) {
|
||||||
|
ctx.effect(() => ctx.locale.register(NS, {
|
||||||
|
zh,
|
||||||
|
en
|
||||||
|
}), "ui-message-feedback: dictionaries");
|
||||||
|
const controllers = /* @__PURE__ */ new Map();
|
||||||
|
const controllerFor = (sessionId) => {
|
||||||
|
let controller = controllers.get(sessionId);
|
||||||
|
if (controller === void 0) {
|
||||||
|
controller = new MessageFeedbackController(ctx.remote.messageFeedback, sessionId);
|
||||||
|
controllers.set(sessionId, controller);
|
||||||
|
}
|
||||||
|
return controller;
|
||||||
|
};
|
||||||
|
ctx.on("connection/reset", () => {
|
||||||
|
for (const controller of controllers.values()) if (controller.getSnapshot().status !== "cold") controller.resync();
|
||||||
|
});
|
||||||
|
ctx.slots.inject("conversation.chat.assistant-actions", () => {
|
||||||
|
const dispose = ctx.slots.register({
|
||||||
|
name: "conversation.chat.assistant-actions",
|
||||||
|
id: "feedback",
|
||||||
|
order: 10,
|
||||||
|
locale: NS,
|
||||||
|
inject: (sessionId) => {
|
||||||
|
const controller = controllerFor(sessionId);
|
||||||
|
return {
|
||||||
|
hooks: { feedback: controller },
|
||||||
|
ensure: () => controller.ensure(),
|
||||||
|
rate: (messageId, rating, note) => controller.rate(messageId, rating, note),
|
||||||
|
toggle: (messageId, rating) => controller.toggle(messageId, rating),
|
||||||
|
clearNote: (messageId) => controller.clearNote(messageId),
|
||||||
|
clear: (messageId) => controller.clear(messageId)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}, MessageFeedbackActions);
|
||||||
|
return () => {
|
||||||
|
dispose();
|
||||||
|
for (const controller of controllers.values()) controller.dispose();
|
||||||
|
controllers.clear();
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
exports.apply = apply;
|
||||||
|
exports.inject = inject;
|
||||||
|
return module.exports;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//# sourceMappingURL=client.js.map
|
||||||
@@ -0,0 +1,804 @@
|
|||||||
|
window.__ModuleLoader__.load({
|
||||||
|
id: "@deepseek-ai/dsh-client-ui-model-selection",
|
||||||
|
factory: (require) => {
|
||||||
|
var module = { exports: {} };
|
||||||
|
var exports = module.exports;
|
||||||
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||||
|
let _deepseek_ai_cordis = require("@deepseek-ai/cordis");
|
||||||
|
let _deepseek_ai_dsh_client_runtime_client = require("@deepseek-ai/dsh-client-runtime/client");
|
||||||
|
let react_jsx_runtime = require("react/jsx-runtime");
|
||||||
|
let react = require("react");
|
||||||
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
||||||
|
//#region lib/types/client/directory.js
|
||||||
|
/** One session's shared directory controller; disposed with the session scope. */
|
||||||
|
var ModelDirectory = class {
|
||||||
|
sessions;
|
||||||
|
sessionId;
|
||||||
|
available;
|
||||||
|
/** The shared snapshot both entries render from (uSES-safe store). */
|
||||||
|
store = (0, _deepseek_ai_dsh_client_runtime_client.createSnapshotStore)({
|
||||||
|
current: null,
|
||||||
|
routable: null,
|
||||||
|
groups: [],
|
||||||
|
failures: [],
|
||||||
|
status: "idle",
|
||||||
|
error: null
|
||||||
|
});
|
||||||
|
/** Latest operation wins; an older response never overwrites a newer one. */
|
||||||
|
generation = 0;
|
||||||
|
disposed = false;
|
||||||
|
/**
|
||||||
|
* @param sessions - the session wire face (captured from the plugin's root connection).
|
||||||
|
* @param sessionId - the owning session.
|
||||||
|
* @param available - whether this session may use Agent-bound model RPCs.
|
||||||
|
*/
|
||||||
|
constructor(sessions, sessionId, available) {
|
||||||
|
this.sessions = sessions;
|
||||||
|
this.sessionId = sessionId;
|
||||||
|
this.available = available;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Refresh the advisory directory (both entries call this on open).
|
||||||
|
* Failure preserves the last good groups and current selection.
|
||||||
|
* @returns the fresh directory value.
|
||||||
|
*/
|
||||||
|
async load() {
|
||||||
|
this.assertAvailable();
|
||||||
|
const generation = ++this.generation;
|
||||||
|
this.store.update((s) => {
|
||||||
|
s.status = "loading";
|
||||||
|
s.error = null;
|
||||||
|
});
|
||||||
|
const { result } = await this.sessions.models({ sessionId: this.sessionId });
|
||||||
|
if (this.disposed || generation !== this.generation) {
|
||||||
|
if (!result.ok) throw new Error(`${result.error.code}: ${result.error.message}`);
|
||||||
|
return result.value;
|
||||||
|
}
|
||||||
|
if (!result.ok) {
|
||||||
|
this.store.update((s) => {
|
||||||
|
s.status = "error";
|
||||||
|
s.error = `${result.error.code}: ${result.error.message}`;
|
||||||
|
});
|
||||||
|
throw new Error(`session.models failed: ${result.error.code}: ${result.error.message}`);
|
||||||
|
}
|
||||||
|
const { current, routable, groups, failures } = result.value;
|
||||||
|
this.store.update((s) => {
|
||||||
|
s.current = current;
|
||||||
|
s.routable = routable;
|
||||||
|
s.groups = groups;
|
||||||
|
s.failures = failures;
|
||||||
|
s.status = "ready";
|
||||||
|
s.error = null;
|
||||||
|
});
|
||||||
|
return result.value;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Select the complete provider/model/reasoning selection (both entries submit through here). Success
|
||||||
|
* updates the shared current; failure surfaces on the store and throws so
|
||||||
|
* each entry's own retry surface engages.
|
||||||
|
* @param selection - provider, provider-owned model id, and optional adapter-owned effort.
|
||||||
|
*/
|
||||||
|
async select(selection) {
|
||||||
|
this.assertAvailable();
|
||||||
|
const generation = ++this.generation;
|
||||||
|
this.store.update((s) => {
|
||||||
|
s.status = "selecting";
|
||||||
|
s.error = null;
|
||||||
|
});
|
||||||
|
const { result } = await this.sessions.selectModel({
|
||||||
|
sessionId: this.sessionId,
|
||||||
|
provider: selection.provider,
|
||||||
|
model: selection.model,
|
||||||
|
...selection.reasoningEffort === void 0 ? {} : { reasoningEffort: selection.reasoningEffort }
|
||||||
|
});
|
||||||
|
if (this.disposed || generation !== this.generation) {
|
||||||
|
if (!result.ok) throw new Error(`${result.error.code}: ${result.error.message}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!result.ok) {
|
||||||
|
this.store.update((s) => {
|
||||||
|
s.status = "error";
|
||||||
|
s.error = `${result.error.code}: ${result.error.message}`;
|
||||||
|
});
|
||||||
|
throw new Error(`session.selectModel failed: ${result.error.code}: ${result.error.message}`);
|
||||||
|
}
|
||||||
|
this.store.update((s) => {
|
||||||
|
s.current = result.value.selected;
|
||||||
|
s.routable = true;
|
||||||
|
s.status = "ready";
|
||||||
|
s.error = null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Drop the previous Host generation's projection and repull it. Clearing
|
||||||
|
* first prevents an unconsumed process-local selection from being displayed
|
||||||
|
* while the restarted Host has restored the last logged model selection.
|
||||||
|
*/
|
||||||
|
resetConnected() {
|
||||||
|
if (this.disposed) return;
|
||||||
|
++this.generation;
|
||||||
|
this.store.update((s) => {
|
||||||
|
s.current = null;
|
||||||
|
s.routable = null;
|
||||||
|
s.groups = [];
|
||||||
|
s.failures = [];
|
||||||
|
s.status = "idle";
|
||||||
|
s.error = null;
|
||||||
|
});
|
||||||
|
if (!this.available()) return;
|
||||||
|
this.load().catch(() => {});
|
||||||
|
}
|
||||||
|
/** Scope teardown: late settlements lose write access to the store. */
|
||||||
|
dispose() {
|
||||||
|
this.disposed = true;
|
||||||
|
}
|
||||||
|
assertAvailable() {
|
||||||
|
if (!this.available()) throw new Error("model selection is unavailable for addressed subagent sessions");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/service.js
|
||||||
|
/**
|
||||||
|
* ModelDirectoryResolver (`ctx.modelDirectories`): the root owner of per-session
|
||||||
|
* {@link ModelDirectory} instances. Both selection entries (the /model popup
|
||||||
|
* and the composer model seat) resolve their session's directory through
|
||||||
|
* this service, which is what makes the dual entry one shared state.
|
||||||
|
*
|
||||||
|
* Per-session storage follows the client service pattern (InputTriggerService /
|
||||||
|
* CommandUiRuntime): a lazy service-internal map whose entry is deleted by the
|
||||||
|
* owning scope's disposer. The host `dsh-scope` ScopedLayers registry does
|
||||||
|
* does not belong here: it derives scope from the host carrier mechanism
|
||||||
|
* (object-keyed), while client scopes tag contexts with branded SessionId
|
||||||
|
* strings, and it models global+shadow named registries — this is a
|
||||||
|
* per-session singleton with no global layer to merge.
|
||||||
|
*/
|
||||||
|
/** The `ctx.modelDirectories` session model-selection service. */
|
||||||
|
var ModelDirectoryResolver = class extends _deepseek_ai_cordis.Service {
|
||||||
|
static inject = [
|
||||||
|
"connection",
|
||||||
|
"sessions",
|
||||||
|
"remote"
|
||||||
|
];
|
||||||
|
live = { directories: /* @__PURE__ */ new Map() };
|
||||||
|
/** Localized composer-block copy; this plugin owns the string it raises. */
|
||||||
|
blockReason;
|
||||||
|
/**
|
||||||
|
* @param ctx - owning root context (the service registers itself as `models`).
|
||||||
|
* @param config - the bound translator for this plugin's own dictionary.
|
||||||
|
*/
|
||||||
|
constructor(ctx, config) {
|
||||||
|
super(ctx, "modelDirectories");
|
||||||
|
this.blockReason = config.blockReason;
|
||||||
|
ctx.on("connection/reset", () => {
|
||||||
|
for (const directory of this.live.directories.values()) directory.resetConnected();
|
||||||
|
});
|
||||||
|
const refresh = () => {
|
||||||
|
for (const directory of this.live.directories.values()) directory.load().catch(() => void 0);
|
||||||
|
};
|
||||||
|
ctx.remote.$on("llm/adapters-updated", refresh);
|
||||||
|
ctx.remote.$on("settings/document-updated", refresh);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Resolve the per-session shared directory (lazy; the scope disposer
|
||||||
|
* removes and disposes it). Unknown sessions fail loud.
|
||||||
|
* @param sessionId - the owning session.
|
||||||
|
* @returns the resident directory both entries share.
|
||||||
|
*/
|
||||||
|
directoryFor(sessionId) {
|
||||||
|
const { live } = this;
|
||||||
|
const existing = live.directories.get(sessionId);
|
||||||
|
if (existing !== void 0) return existing;
|
||||||
|
const sessions = this.ctx.get("sessions");
|
||||||
|
const actx = sessions.scope(sessionId);
|
||||||
|
if (actx === void 0) throw new Error(`ui-model-selection: session "${String(sessionId)}" resolved no scope`);
|
||||||
|
const directory = new ModelDirectory(this.ctx.get("connection").api.sessions, sessionId, () => sessions.subagentAddress(sessionId) === void 0);
|
||||||
|
live.directories.set(sessionId, directory);
|
||||||
|
const conversation = this.ctx.get("conversation");
|
||||||
|
if (conversation !== void 0) {
|
||||||
|
const publish = () => {
|
||||||
|
conversation.blocks.set(sessionId, directory.store.getSnapshot().routable === false ? { reason: this.blockReason() } : void 0);
|
||||||
|
};
|
||||||
|
publish();
|
||||||
|
actx.effect(() => {
|
||||||
|
const stop = directory.store.subscribe(publish);
|
||||||
|
return () => {
|
||||||
|
stop();
|
||||||
|
conversation.blocks.set(sessionId, void 0);
|
||||||
|
};
|
||||||
|
}, "ui-model-selection: composer block");
|
||||||
|
}
|
||||||
|
actx.effect(() => () => {
|
||||||
|
directory.dispose();
|
||||||
|
live.directories.delete(sessionId);
|
||||||
|
}, "ui-model-selection: session directory");
|
||||||
|
return directory;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region ../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
||||||
|
function r(e) {
|
||||||
|
var t, f, n = "";
|
||||||
|
if ("string" == typeof e || "number" == typeof e) n += e;
|
||||||
|
else if ("object" == typeof e) if (Array.isArray(e)) {
|
||||||
|
var o = e.length;
|
||||||
|
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
||||||
|
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
function clsx() {
|
||||||
|
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-model-selection/src/client/ModelSelect.module.css.mjs
|
||||||
|
const css = "._7KE1Ra_root{min-width:0;position:relative}._7KE1Ra_trigger{min-width:0;max-width:220px;height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:24px;outline:none;align-items:center;gap:4px;padding:0 4px 0 8px;font-size:13px;font-weight:500;line-height:20px;display:flex}._7KE1Ra_trigger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}._7KE1Ra_trigger:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-border-l3)}._7KE1Ra_trigger:disabled{color:var(--dsw-alias-label-dimmed);cursor:default}._7KE1Ra_triggerLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}._7KE1Ra_triggerEffort{color:var(--dsw-alias-label-caption);flex:none}._7KE1Ra_chevron{color:var(--dsw-alias-label-caption);flex:none;transition:transform .12s}._7KE1Ra_chevronOpen{transform:rotate(180deg)}._7KE1Ra_menu{z-index:20;border:1px solid var(--dsw-alias-border-inverted);background:var(--dsw-specific-menu);width:min(240px,100vw - 32px);max-height:min(360px,100vh - 96px);box-shadow:var(--dsw-shadow-lv3);color:var(--dsw-alias-label-primary);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border-radius:12px;flex-direction:column;padding:4px;display:flex;position:absolute;bottom:calc(100% + 8px);right:0;overflow:hidden}._7KE1Ra_status,._7KE1Ra_empty{color:var(--dsw-alias-label-tertiary);padding:10px;font-size:13px;line-height:20px}._7KE1Ra_error,._7KE1Ra_warning{background:var(--dsw-alias-interactive-bg-hover-danger);color:var(--dsw-alias-state-error-primary);border-radius:8px;justify-content:space-between;align-items:flex-start;gap:8px;margin-bottom:4px;padding:7px 8px;font-size:12px;line-height:18px;display:flex}._7KE1Ra_warning{background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-state-warn-label)}._7KE1Ra_retry{color:inherit;font:inherit;cursor:pointer;background:0 0;border:none;flex:none;padding:0;font-weight:600}._7KE1Ra_groups{min-height:0;overflow-y:auto}._7KE1Ra_group+._7KE1Ra_group{margin-top:4px}._7KE1Ra_groupTitle{z-index:1;background:var(--dsw-specific-menu);color:var(--dsw-alias-label-tertiary);padding:5px 8px 3px;font-size:12px;font-weight:500;line-height:18px;position:sticky;top:0}._7KE1Ra_option{width:100%;min-height:38px;color:inherit;text-align:left;cursor:pointer;background:0 0;border:none;border-radius:10px;outline:none;align-items:center;gap:8px;padding:6px 8px;display:flex}._7KE1Ra_option:hover:not(:disabled),._7KE1Ra_option:focus-visible{background:var(--dsw-alias-interactive-bg-hover)}._7KE1Ra_selected{background:0 0}._7KE1Ra_option:disabled{color:var(--dsw-alias-label-dimmed);cursor:default}._7KE1Ra_optionCopy{flex-direction:column;flex:1;min-width:0;display:flex}._7KE1Ra_modelName{color:inherit;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:500;line-height:20px;overflow:hidden}._7KE1Ra_description{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:18px;overflow:hidden}._7KE1Ra_check{color:var(--dsw-alias-label-primary);flex:0 0 18px;place-items:center;display:grid}._7KE1Ra_cell{width:100%;height:40px;color:var(--dsw-alias-label-primary);cursor:pointer;text-align:left;background:0 0;border:none;border-radius:10px;align-items:center;gap:8px;padding:0 10px;font-size:14px;line-height:22px;display:flex}._7KE1Ra_cell:hover{background:var(--dsw-alias-interactive-bg-hover)}._7KE1Ra_cellLabel{text-overflow:ellipsis;white-space:nowrap;flex:auto;min-width:0;overflow:hidden}._7KE1Ra_cellValue{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-tertiary);flex:0 auto;overflow:hidden}._7KE1Ra_cellChevron{color:var(--dsw-alias-label-tertiary);flex:none}";
|
||||||
|
const tagId = "@deepseek-ai/dsh-client-ui-model-selection/ModelSelect.module.css";
|
||||||
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
||||||
|
const tag = document.createElement("style");
|
||||||
|
tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-model-selection";
|
||||||
|
tag.dataset.pluginCss = tagId;
|
||||||
|
tag.textContent = css;
|
||||||
|
document.head.appendChild(tag);
|
||||||
|
}
|
||||||
|
var ModelSelect_module_css_default = {
|
||||||
|
"optionCopy": "_7KE1Ra_optionCopy",
|
||||||
|
"triggerEffort": "_7KE1Ra_triggerEffort",
|
||||||
|
"retry": "_7KE1Ra_retry",
|
||||||
|
"description": "_7KE1Ra_description",
|
||||||
|
"root": "_7KE1Ra_root",
|
||||||
|
"cellValue": "_7KE1Ra_cellValue",
|
||||||
|
"cellChevron": "_7KE1Ra_cellChevron",
|
||||||
|
"option": "_7KE1Ra_option",
|
||||||
|
"group": "_7KE1Ra_group",
|
||||||
|
"chevronOpen": "_7KE1Ra_chevronOpen",
|
||||||
|
"status": "_7KE1Ra_status",
|
||||||
|
"error": "_7KE1Ra_error",
|
||||||
|
"check": "_7KE1Ra_check",
|
||||||
|
"cell": "_7KE1Ra_cell",
|
||||||
|
"triggerLabel": "_7KE1Ra_triggerLabel",
|
||||||
|
"modelName": "_7KE1Ra_modelName",
|
||||||
|
"chevron": "_7KE1Ra_chevron",
|
||||||
|
"trigger": "_7KE1Ra_trigger",
|
||||||
|
"menu": "_7KE1Ra_menu",
|
||||||
|
"warning": "_7KE1Ra_warning",
|
||||||
|
"cellLabel": "_7KE1Ra_cellLabel",
|
||||||
|
"groupTitle": "_7KE1Ra_groupTitle",
|
||||||
|
"groups": "_7KE1Ra_groups",
|
||||||
|
"selected": "_7KE1Ra_selected",
|
||||||
|
"empty": "_7KE1Ra_empty"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/ModelSelect.js
|
||||||
|
/**
|
||||||
|
* ModelSelect: the composer's named model seat (`conversation.input.model`).
|
||||||
|
* Two-level selection per figma 496:26454's MenuDropdown: the root menu is
|
||||||
|
* the Model / Effort row pair (label + current value + a right chevron),
|
||||||
|
* each drilling into its own list — the provider-grouped model list over
|
||||||
|
* the shared directory, and the effort levels. The trigger (313:14108's
|
||||||
|
* ToggleButton) shows both: model name + effort in the caption tone.
|
||||||
|
* Data and submission ride the SAME per-session ModelDirectory as the
|
||||||
|
* /model popup; exact-model reasoning metadata and the selected effort come
|
||||||
|
* from the Host rather than a client-owned vocabulary. A rejected selection
|
||||||
|
* announces through the shared transient Toast anchored to the composer
|
||||||
|
* card; the in-menu strip with Retry remains the catalog-load surface.
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* Render the composer model seat.
|
||||||
|
* @param props - owner share (locked) + injected face (shared directory
|
||||||
|
* store/verbs) + the standard locale seat.
|
||||||
|
* @returns the trigger and, while open, the two-level menu.
|
||||||
|
*/
|
||||||
|
function ModelSelect({ locked, available, directory, load, select, t }) {
|
||||||
|
const state = (0, react.useSyncExternalStore)((fn) => directory.subscribe(fn), () => directory.getSnapshot());
|
||||||
|
const [open, setOpen] = (0, react.useState)(false);
|
||||||
|
const [pane, setPane] = (0, react.useState)("root");
|
||||||
|
const lastActionRef = (0, react.useRef)("load");
|
||||||
|
const [toast, setToast] = (0, react.useState)(null);
|
||||||
|
const toastSeq = (0, react.useRef)(0);
|
||||||
|
const rootRef = (0, react.useRef)(null);
|
||||||
|
const triggerRef = (0, react.useRef)(null);
|
||||||
|
const itemRefs = (0, react.useRef)([]);
|
||||||
|
const id = (0, react.useId)();
|
||||||
|
const choices = (0, react.useMemo)(() => state.groups.flatMap((group) => group.models.map((model) => ({
|
||||||
|
group,
|
||||||
|
model,
|
||||||
|
selection: {
|
||||||
|
provider: group.id,
|
||||||
|
model: model.id,
|
||||||
|
...model.reasoning?.defaultEffort === void 0 ? {} : { reasoningEffort: model.reasoning.defaultEffort }
|
||||||
|
}
|
||||||
|
}))), [state.groups]);
|
||||||
|
const currentChoice = choices[state.current === null ? -1 : choices.findIndex((c) => c.selection.provider === state.current?.provider && c.selection.model === state.current.model)];
|
||||||
|
const reasoning = currentChoice?.model.reasoning;
|
||||||
|
const effectiveEffort = state.current?.reasoningEffort ?? reasoning?.defaultEffort;
|
||||||
|
const effortLabel = reasoning === void 0 ? void 0 : effectiveEffort === void 0 ? t("effort.providerDefault") : reasoning.efforts.find((level) => level.id === effectiveEffort)?.name ?? effectiveEffort;
|
||||||
|
const effortChoices = (0, react.useMemo)(() => reasoning === void 0 ? [] : [...reasoning.defaultEffort === void 0 ? [{
|
||||||
|
key: "provider-default",
|
||||||
|
effort: void 0,
|
||||||
|
label: t("effort.providerDefault")
|
||||||
|
}] : [], ...reasoning.efforts.map((effort) => ({
|
||||||
|
key: `effort:${effort.id}`,
|
||||||
|
effort: effort.id,
|
||||||
|
label: effort.name,
|
||||||
|
...effort.description === void 0 ? {} : { description: effort.description }
|
||||||
|
}))], [reasoning, t]);
|
||||||
|
const busy = state.status === "selecting";
|
||||||
|
const reload = () => {
|
||||||
|
lastActionRef.current = "load";
|
||||||
|
load();
|
||||||
|
};
|
||||||
|
(0, react.useEffect)(() => {
|
||||||
|
if (available) {
|
||||||
|
lastActionRef.current = "load";
|
||||||
|
load();
|
||||||
|
}
|
||||||
|
}, [available, load]);
|
||||||
|
(0, react.useEffect)(() => {
|
||||||
|
if (!open) return;
|
||||||
|
const closeOutside = (event) => {
|
||||||
|
if (!rootRef.current?.contains(event.target)) setOpen(false);
|
||||||
|
};
|
||||||
|
document.addEventListener("mousedown", closeOutside);
|
||||||
|
return () => {
|
||||||
|
document.removeEventListener("mousedown", closeOutside);
|
||||||
|
};
|
||||||
|
}, [open]);
|
||||||
|
if (!available) return null;
|
||||||
|
const show = () => {
|
||||||
|
setPane("root");
|
||||||
|
setOpen(true);
|
||||||
|
reload();
|
||||||
|
};
|
||||||
|
const close = (restoreFocus = false) => {
|
||||||
|
setOpen(false);
|
||||||
|
setPane("root");
|
||||||
|
if (restoreFocus) queueMicrotask(() => {
|
||||||
|
triggerRef.current?.focus();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const moveFocus = (offset) => {
|
||||||
|
const items = itemRefs.current.filter((item) => item !== null);
|
||||||
|
if (items.length === 0) return;
|
||||||
|
const active = items.findIndex((item) => item === document.activeElement);
|
||||||
|
items[(Math.max(active, 0) + offset + items.length) % items.length]?.focus();
|
||||||
|
};
|
||||||
|
const onRootKeyDown = (event) => {
|
||||||
|
if (event.key === "Escape" && open) {
|
||||||
|
event.preventDefault();
|
||||||
|
if (pane !== "root") setPane("root");
|
||||||
|
else close(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!open) return;
|
||||||
|
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
||||||
|
event.preventDefault();
|
||||||
|
moveFocus(event.key === "ArrowDown" ? 1 : -1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const onBlur = (event) => {
|
||||||
|
if (event.relatedTarget instanceof Node && rootRef.current?.contains(event.relatedTarget)) return;
|
||||||
|
close();
|
||||||
|
};
|
||||||
|
const settleSelection = (accepted) => {
|
||||||
|
if (accepted) {
|
||||||
|
if (rootRef.current !== null) close(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const message = directory.getSnapshot().error;
|
||||||
|
if (message !== null) {
|
||||||
|
toastSeq.current += 1;
|
||||||
|
setToast({
|
||||||
|
seq: toastSeq.current,
|
||||||
|
text: t("error.action", { message })
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const choose = (selection) => {
|
||||||
|
if (state.current?.provider === selection.provider && state.current.model === selection.model) {
|
||||||
|
close(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
lastActionRef.current = "select";
|
||||||
|
select(selection).then(settleSelection);
|
||||||
|
};
|
||||||
|
const chooseEffort = (effort) => {
|
||||||
|
if (state.current === null) return;
|
||||||
|
if (effectiveEffort === effort) {
|
||||||
|
close(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const selection = {
|
||||||
|
provider: state.current.provider,
|
||||||
|
model: state.current.model,
|
||||||
|
...effort === void 0 ? {} : { reasoningEffort: effort }
|
||||||
|
};
|
||||||
|
lastActionRef.current = "select";
|
||||||
|
select(selection).then(settleSelection);
|
||||||
|
};
|
||||||
|
const modelLabel = currentChoice?.model.name ?? t("trigger.fallback");
|
||||||
|
const triggerLabel = effortLabel === void 0 ? modelLabel : `${modelLabel} · ${effortLabel}`;
|
||||||
|
const triggerAria = currentChoice === void 0 ? t("trigger.selectAria") : effortLabel === void 0 ? t("trigger.aria", { model: modelLabel }) : t("trigger.ariaEffort", {
|
||||||
|
model: modelLabel,
|
||||||
|
effort: effortLabel
|
||||||
|
});
|
||||||
|
itemRefs.current = [];
|
||||||
|
let itemIndex = 0;
|
||||||
|
const itemRef = () => {
|
||||||
|
const at = itemIndex++;
|
||||||
|
return (node) => {
|
||||||
|
itemRefs.current[at] = node;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
return (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
ref: rootRef,
|
||||||
|
className: ModelSelect_module_css_default.root,
|
||||||
|
onKeyDown: onRootKeyDown,
|
||||||
|
onBlur,
|
||||||
|
children: [
|
||||||
|
(0, react_jsx_runtime.jsxs)("button", {
|
||||||
|
ref: triggerRef,
|
||||||
|
type: "button",
|
||||||
|
className: ModelSelect_module_css_default.trigger,
|
||||||
|
"aria-label": triggerAria,
|
||||||
|
"aria-haspopup": "menu",
|
||||||
|
"aria-expanded": open,
|
||||||
|
"aria-controls": open ? `${id}-menu` : void 0,
|
||||||
|
title: triggerLabel,
|
||||||
|
disabled: locked,
|
||||||
|
onClick: () => {
|
||||||
|
if (open) close();
|
||||||
|
else show();
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: ModelSelect_module_css_default.triggerLabel,
|
||||||
|
children: modelLabel
|
||||||
|
}),
|
||||||
|
effortLabel !== void 0 && (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: ModelSelect_module_css_default.triggerEffort,
|
||||||
|
children: effortLabel
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutline14, { className: clsx(ModelSelect_module_css_default.chevron, open && ModelSelect_module_css_default.chevronOpen) })
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
open && (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
id: `${id}-menu`,
|
||||||
|
className: ModelSelect_module_css_default.menu,
|
||||||
|
role: "menu",
|
||||||
|
"aria-label": t("menu.aria"),
|
||||||
|
"aria-busy": state.status === "loading" || busy,
|
||||||
|
children: [
|
||||||
|
pane === "root" && (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsxs)("button", {
|
||||||
|
ref: itemRef(),
|
||||||
|
type: "button",
|
||||||
|
role: "menuitem",
|
||||||
|
className: ModelSelect_module_css_default.cell,
|
||||||
|
onClick: () => {
|
||||||
|
setPane("model");
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: ModelSelect_module_css_default.cellLabel,
|
||||||
|
children: t("menu.model")
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: ModelSelect_module_css_default.cellValue,
|
||||||
|
children: modelLabel
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronRightOutline14, { className: ModelSelect_module_css_default.cellChevron })
|
||||||
|
]
|
||||||
|
}), reasoning !== void 0 && (0, react_jsx_runtime.jsxs)("button", {
|
||||||
|
ref: itemRef(),
|
||||||
|
type: "button",
|
||||||
|
role: "menuitem",
|
||||||
|
className: ModelSelect_module_css_default.cell,
|
||||||
|
onClick: () => {
|
||||||
|
setPane("effort");
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: ModelSelect_module_css_default.cellLabel,
|
||||||
|
children: t("menu.effort")
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: ModelSelect_module_css_default.cellValue,
|
||||||
|
children: effortLabel
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronRightOutline14, { className: ModelSelect_module_css_default.cellChevron })
|
||||||
|
]
|
||||||
|
})] }),
|
||||||
|
pane === "model" && (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
||||||
|
state.status === "loading" && (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: ModelSelect_module_css_default.status,
|
||||||
|
children: t("status.loading")
|
||||||
|
}),
|
||||||
|
state.error !== null && lastActionRef.current === "load" && (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: ModelSelect_module_css_default.error,
|
||||||
|
children: [(0, react_jsx_runtime.jsx)("span", { children: t("error.action", { message: state.error }) }), (0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: ModelSelect_module_css_default.retry,
|
||||||
|
onClick: reload,
|
||||||
|
children: t("retry")
|
||||||
|
})]
|
||||||
|
}),
|
||||||
|
state.failures.map((failure) => (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: ModelSelect_module_css_default.warning,
|
||||||
|
children: [(0, react_jsx_runtime.jsx)("span", { children: t("warning.groupLoad", {
|
||||||
|
name: failure.name,
|
||||||
|
message: failure.message
|
||||||
|
}) }), (0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: ModelSelect_module_css_default.retry,
|
||||||
|
onClick: reload,
|
||||||
|
children: t("retry")
|
||||||
|
})]
|
||||||
|
}, failure.id)),
|
||||||
|
(0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: clsx(ModelSelect_module_css_default.groups, "scrollable"),
|
||||||
|
children: state.groups.map((group) => {
|
||||||
|
const headingId = `${id}-${group.id}`;
|
||||||
|
return (0, react_jsx_runtime.jsxs)("section", {
|
||||||
|
role: "group",
|
||||||
|
"aria-labelledby": headingId,
|
||||||
|
className: ModelSelect_module_css_default.group,
|
||||||
|
children: [(0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: ModelSelect_module_css_default.groupTitle,
|
||||||
|
id: headingId,
|
||||||
|
children: group.name
|
||||||
|
}), group.models.map((model) => {
|
||||||
|
const selected = state.current?.provider === group.id && state.current.model === model.id;
|
||||||
|
return (0, react_jsx_runtime.jsxs)("button", {
|
||||||
|
ref: itemRef(),
|
||||||
|
type: "button",
|
||||||
|
role: "menuitemradio",
|
||||||
|
"aria-checked": selected,
|
||||||
|
className: clsx(ModelSelect_module_css_default.option, selected && ModelSelect_module_css_default.selected),
|
||||||
|
title: model.name,
|
||||||
|
disabled: busy,
|
||||||
|
onClick: () => {
|
||||||
|
choose({
|
||||||
|
provider: group.id,
|
||||||
|
model: model.id
|
||||||
|
});
|
||||||
|
},
|
||||||
|
children: [(0, react_jsx_runtime.jsxs)("span", {
|
||||||
|
className: ModelSelect_module_css_default.optionCopy,
|
||||||
|
children: [(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: ModelSelect_module_css_default.modelName,
|
||||||
|
children: model.name
|
||||||
|
}), model.description !== void 0 && (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: ModelSelect_module_css_default.description,
|
||||||
|
children: model.description
|
||||||
|
})]
|
||||||
|
}), (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: ModelSelect_module_css_default.check,
|
||||||
|
children: selected ? (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutline16, {}) : null
|
||||||
|
})]
|
||||||
|
}, model.id);
|
||||||
|
})]
|
||||||
|
}, group.id);
|
||||||
|
})
|
||||||
|
}),
|
||||||
|
state.status === "ready" && choices.length === 0 && (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: ModelSelect_module_css_default.empty,
|
||||||
|
children: t("empty.models")
|
||||||
|
})
|
||||||
|
] }),
|
||||||
|
pane === "effort" && (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [state.error !== null && lastActionRef.current === "load" && (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: ModelSelect_module_css_default.error,
|
||||||
|
children: [(0, react_jsx_runtime.jsx)("span", { children: t("error.action", { message: state.error }) }), (0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: ModelSelect_module_css_default.retry,
|
||||||
|
onClick: reload,
|
||||||
|
children: t("action.reload")
|
||||||
|
})]
|
||||||
|
}), effortChoices.length === 0 ? (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: ModelSelect_module_css_default.empty,
|
||||||
|
children: t("empty.efforts")
|
||||||
|
}) : effortChoices.map((level) => (0, react_jsx_runtime.jsxs)("button", {
|
||||||
|
ref: itemRef(),
|
||||||
|
type: "button",
|
||||||
|
role: "menuitemradio",
|
||||||
|
"aria-checked": effectiveEffort === level.effort,
|
||||||
|
className: clsx(ModelSelect_module_css_default.option, effectiveEffort === level.effort && ModelSelect_module_css_default.selected),
|
||||||
|
disabled: busy,
|
||||||
|
onClick: () => {
|
||||||
|
chooseEffort(level.effort);
|
||||||
|
},
|
||||||
|
children: [(0, react_jsx_runtime.jsxs)("span", {
|
||||||
|
className: ModelSelect_module_css_default.optionCopy,
|
||||||
|
children: [(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: ModelSelect_module_css_default.modelName,
|
||||||
|
children: level.label
|
||||||
|
}), level.description !== void 0 && (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: ModelSelect_module_css_default.description,
|
||||||
|
children: level.description
|
||||||
|
})]
|
||||||
|
}), (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: ModelSelect_module_css_default.check,
|
||||||
|
children: effectiveEffort === level.effort ? (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutline16, {}) : null
|
||||||
|
})]
|
||||||
|
}, level.key))] })
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
toast !== null && (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Toast, {
|
||||||
|
text: toast.text,
|
||||||
|
icon: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconWarningOutline16, {}),
|
||||||
|
anchor: rootRef.current?.closest("[data-composer-card]") ?? null,
|
||||||
|
onDone: () => {
|
||||||
|
setToast(null);
|
||||||
|
}
|
||||||
|
}, toast.seq)
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/locales.js
|
||||||
|
/**
|
||||||
|
* `model` namespace dictionaries.
|
||||||
|
*
|
||||||
|
* `trigger.selectAria` reads identically to `trigger.fallback` today and is
|
||||||
|
* still a separate key: the visible fallback label and the accessible name of
|
||||||
|
* an unset trigger are free to diverge per locale, and folding it into
|
||||||
|
* `trigger.aria` would announce the degenerate "Select model, current Select
|
||||||
|
* model".
|
||||||
|
*/
|
||||||
|
/** Simplified Chinese dictionary (the key-set source of truth). */
|
||||||
|
const zh = {
|
||||||
|
"command.description": "选择本会话使用的模型",
|
||||||
|
"option.loadError": "目录加载失败:{message}",
|
||||||
|
"trigger.fallback": "选择模型",
|
||||||
|
"trigger.selectAria": "选择模型",
|
||||||
|
"trigger.aria": "选择模型,当前 {model}",
|
||||||
|
"trigger.ariaEffort": "选择模型,当前 {model},推理等级 {effort}",
|
||||||
|
"menu.aria": "模型与推理等级",
|
||||||
|
"menu.model": "模型",
|
||||||
|
"menu.effort": "推理等级",
|
||||||
|
"effort.providerDefault": "Default",
|
||||||
|
"status.loading": "正在刷新模型列表…",
|
||||||
|
"error.action": "模型操作失败:{message}",
|
||||||
|
"action.reload": "重新加载",
|
||||||
|
"warning.groupLoad": "{name} 加载失败:{message}",
|
||||||
|
"empty.models": "没有可用的模型。",
|
||||||
|
"blocked.composer": "当前模型不可用,请先选择模型",
|
||||||
|
"empty.efforts": "当前模型未提供推理等级。"
|
||||||
|
};
|
||||||
|
/** English dictionary, checked complete against the zh key set. */
|
||||||
|
const en = {
|
||||||
|
"command.description": "Select the model for this conversation",
|
||||||
|
"option.loadError": "Catalog failed to load: {message}",
|
||||||
|
"trigger.fallback": "Select model",
|
||||||
|
"trigger.selectAria": "Select model",
|
||||||
|
"trigger.aria": "Select model, current {model}",
|
||||||
|
"trigger.ariaEffort": "Select model, current {model}, reasoning effort {effort}",
|
||||||
|
"menu.aria": "Model and reasoning effort",
|
||||||
|
"menu.model": "Model",
|
||||||
|
"menu.effort": "Effort",
|
||||||
|
"effort.providerDefault": "Default",
|
||||||
|
"status.loading": "Refreshing model list…",
|
||||||
|
"error.action": "Model operation failed: {message}",
|
||||||
|
"action.reload": "Reload",
|
||||||
|
"warning.groupLoad": "{name} failed to load: {message}",
|
||||||
|
"empty.models": "No models available.",
|
||||||
|
"blocked.composer": "This model is unavailable — select one to continue",
|
||||||
|
"empty.efforts": "This model provides no reasoning effort levels."
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/index.js
|
||||||
|
/** One selectable row's id: an opaque row key (resolved by lookup, never parsed). */
|
||||||
|
function rowId(providerId, modelId) {
|
||||||
|
return `${providerId}/${modelId}`;
|
||||||
|
}
|
||||||
|
/** Flatten the directory into popup rows; failure rows are listed for visibility but never selectable. */
|
||||||
|
function optionsOf(directory, t) {
|
||||||
|
const rows = [];
|
||||||
|
for (const group of directory.groups) for (const model of group.models) rows.push({
|
||||||
|
id: rowId(group.id, model.id),
|
||||||
|
label: model.name,
|
||||||
|
detail: model.description !== void 0 ? `${group.name} · ${model.description}` : group.name,
|
||||||
|
...directory.current.provider === group.id && directory.current.model === model.id ? { active: true } : {}
|
||||||
|
});
|
||||||
|
for (const failure of directory.failures) rows.push({
|
||||||
|
id: `failure/${failure.id}`,
|
||||||
|
label: failure.name,
|
||||||
|
detail: t("option.loadError", { message: failure.message })
|
||||||
|
});
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Resolve a picked row back to its model selection by matching against the loaded
|
||||||
|
* groups (the same data the rows were built from — ids stay opaque).
|
||||||
|
* @param state - the session's directory snapshot.
|
||||||
|
* @param id - the picked row id.
|
||||||
|
* @returns the row's model selection, or undefined for failure rows / stale ids.
|
||||||
|
*/
|
||||||
|
function selectionOf(state, id) {
|
||||||
|
for (const group of state.groups) for (const model of group.models) {
|
||||||
|
if (rowId(group.id, model.id) !== id) continue;
|
||||||
|
const reasoningEffort = state.current?.provider === group.id && state.current.model === model.id ? state.current?.reasoningEffort ?? model.reasoning?.defaultEffort : model.reasoning?.defaultEffort;
|
||||||
|
return {
|
||||||
|
provider: group.id,
|
||||||
|
model: model.id,
|
||||||
|
...reasoningEffort === void 0 ? {} : { reasoningEffort }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** Dictionary namespace owned by this plugin. */
|
||||||
|
const NS = "model";
|
||||||
|
/** Required services: the contribution registry, the seat's slot registry, locale, and the service's own faces. */
|
||||||
|
const inject = [
|
||||||
|
"commandUi",
|
||||||
|
"connection",
|
||||||
|
"locale",
|
||||||
|
"sessions",
|
||||||
|
"slots",
|
||||||
|
"remote"
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* Client plugin body: mount ModelDirectoryResolver, register the `model` dictionaries,
|
||||||
|
* then register the /model popup contribution and the composer model seat
|
||||||
|
* over the service.
|
||||||
|
* @param ctx - client root context.
|
||||||
|
*/
|
||||||
|
function apply(ctx) {
|
||||||
|
ctx.effect(() => ctx.locale.register(NS, {
|
||||||
|
zh,
|
||||||
|
en
|
||||||
|
}), "ui-model-selection: dictionaries");
|
||||||
|
const t = ctx.locale.bind(NS);
|
||||||
|
ctx.plugin(ModelDirectoryResolver, { blockReason: () => t("blocked.composer") });
|
||||||
|
ctx.inject(["commandUi", "modelDirectories"], (scope) => {
|
||||||
|
const command = scope.get("commandUi");
|
||||||
|
const models = scope.modelDirectories;
|
||||||
|
const sessions = scope.sessions;
|
||||||
|
scope.effect(() => command.register({
|
||||||
|
name: "model",
|
||||||
|
description: t("command.description"),
|
||||||
|
available: (session) => sessions.subagentAddress(session.sessionId) === void 0,
|
||||||
|
ui: {
|
||||||
|
kind: "popupSelect",
|
||||||
|
options: async (session) => {
|
||||||
|
if (sessions.subagentAddress(session.sessionId) !== void 0) throw new Error("model selection is unavailable for addressed subagent sessions");
|
||||||
|
return optionsOf(await models.directoryFor(session.sessionId).load(), t);
|
||||||
|
},
|
||||||
|
onSelect: async (option, session) => {
|
||||||
|
if (sessions.subagentAddress(session.sessionId) !== void 0) throw new Error("model selection is unavailable for addressed subagent sessions");
|
||||||
|
const directory = models.directoryFor(session.sessionId);
|
||||||
|
const selection = selectionOf(directory.store.getSnapshot(), option.id);
|
||||||
|
if (selection === void 0) throw new Error("this provider's catalog failed to load — pick a model from a loaded group");
|
||||||
|
await directory.select(selection);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}), "ui-model-selection: /model contribution");
|
||||||
|
});
|
||||||
|
ctx.inject(["slots", "modelDirectories"], (scope) => {
|
||||||
|
const models = scope.modelDirectories;
|
||||||
|
const sessions = scope.sessions;
|
||||||
|
scope.slots.inject("conversation.input.model", () => scope.slots.register({
|
||||||
|
name: "conversation.input.model",
|
||||||
|
locale: NS,
|
||||||
|
inject: (sessionId) => {
|
||||||
|
const directory = models.directoryFor(sessionId);
|
||||||
|
const available = sessions.subagentAddress(sessionId) === void 0;
|
||||||
|
return {
|
||||||
|
available,
|
||||||
|
directory: directory.store,
|
||||||
|
load: () => {
|
||||||
|
if (available) directory.load().catch(() => {});
|
||||||
|
},
|
||||||
|
select: (selection) => available ? directory.select(selection).then(() => true, () => false) : Promise.resolve(false)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}, ModelSelect));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
exports.ModelDirectory = ModelDirectory;
|
||||||
|
exports.ModelDirectoryResolver = ModelDirectoryResolver;
|
||||||
|
exports.apply = apply;
|
||||||
|
exports.inject = inject;
|
||||||
|
return module.exports;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//# sourceMappingURL=client.js.map
|
||||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,679 @@
|
|||||||
|
window.__ModuleLoader__.load({
|
||||||
|
id: "@deepseek-ai/dsh-client-ui-user-questions",
|
||||||
|
factory: (require) => {
|
||||||
|
var module = { exports: {} };
|
||||||
|
var exports = module.exports;
|
||||||
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
||||||
|
let react_jsx_runtime = require("react/jsx-runtime");
|
||||||
|
let react = require("react");
|
||||||
|
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
||||||
|
//#region ../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
||||||
|
function r(e) {
|
||||||
|
var t, f, n = "";
|
||||||
|
if ("string" == typeof e || "number" == typeof e) n += e;
|
||||||
|
else if ("object" == typeof e) if (Array.isArray(e)) {
|
||||||
|
var o = e.length;
|
||||||
|
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
||||||
|
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
function clsx() {
|
||||||
|
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/contract/slots.js
|
||||||
|
/**
|
||||||
|
* Narrow a request to a renderable plan review, or return undefined to leave it
|
||||||
|
* to the generic question flow.
|
||||||
|
*
|
||||||
|
* The card is one decision over one plan, and it claims a request only when it
|
||||||
|
* can send every answer that request allows — an intent changes the layout,
|
||||||
|
* never which answers are reachable. So the batch must be a single question
|
||||||
|
* that declares the intent, carries the plan as its detail, offers the approve
|
||||||
|
* label the intent names, and is a binary single choice: at most one option
|
||||||
|
* besides approve, and not multi-select. A third option or a multi-select batch
|
||||||
|
* has answers two buttons cannot express, so the generic flow keeps it — as it
|
||||||
|
* keeps any request whose intent the asker's own service would have rejected,
|
||||||
|
* because the client sits downstream of a wire boundary and every request must
|
||||||
|
* stay answerable.
|
||||||
|
*
|
||||||
|
* @param questions - the request's whole question batch.
|
||||||
|
* @returns The narrowed review, or undefined when the generic flow owns it.
|
||||||
|
*/
|
||||||
|
function planReviewOf(questions) {
|
||||||
|
if (questions.length !== 1) return void 0;
|
||||||
|
const question = questions[0];
|
||||||
|
const intent = question.intent;
|
||||||
|
if (intent?.kind !== "plan-review" || question.detail === void 0) return void 0;
|
||||||
|
if (question.multiSelect === true) return void 0;
|
||||||
|
const options = question.options ?? [];
|
||||||
|
if (options.length > 2) return void 0;
|
||||||
|
const approve = options.find((option) => option.label === intent.approve);
|
||||||
|
if (approve === void 0) return void 0;
|
||||||
|
const decline = options.find((option) => option.label !== intent.approve);
|
||||||
|
return {
|
||||||
|
id: question.id,
|
||||||
|
question: question.question,
|
||||||
|
plan: question.detail,
|
||||||
|
approve,
|
||||||
|
...decline === void 0 ? {} : { decline }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Question domain face over the carrier: render identity and questions
|
||||||
|
* transparently forwarded; answer/cancel own the wire encoding (the success
|
||||||
|
* fields and the cancelled error) and turn a rejected carrier receipt into a
|
||||||
|
* thrown error. Components mint one per carrier via useMemo (never inside a
|
||||||
|
* select — a per-dispatch mint would churn identity and break memoization).
|
||||||
|
*/
|
||||||
|
var PendingQuestion = class {
|
||||||
|
wait;
|
||||||
|
/**
|
||||||
|
* @param wait - the runtime carrier for one pending question request.
|
||||||
|
*/
|
||||||
|
constructor(wait) {
|
||||||
|
this.wait = wait;
|
||||||
|
}
|
||||||
|
/** Opaque render identity (React key / draft remount axis), forwarded from the carrier. */
|
||||||
|
get key() {
|
||||||
|
return this.wait.key;
|
||||||
|
}
|
||||||
|
/** The request's question list, forwarded from the carrier payload. */
|
||||||
|
get questions() {
|
||||||
|
return this.wait.payload.questions;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Deliver the whole answer batch; a rejected carrier receipt throws.
|
||||||
|
* @param answer - complete structured answer batch.
|
||||||
|
*/
|
||||||
|
async answer(answer) {
|
||||||
|
const receipt = await this.wait.respond({
|
||||||
|
ok: true,
|
||||||
|
value: {
|
||||||
|
sessionId: this.wait.sessionId,
|
||||||
|
answer
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!receipt.accepted) throw new Error(`question response rejected: ${receipt.reason}`);
|
||||||
|
}
|
||||||
|
/** Reject the whole wait (the host resolves the tool call as cancelled); a rejected receipt throws. */
|
||||||
|
async cancel() {
|
||||||
|
const receipt = await this.wait.respond({
|
||||||
|
ok: false,
|
||||||
|
error: {
|
||||||
|
code: "cancelled",
|
||||||
|
message: "the user closed this question request",
|
||||||
|
details: {}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!receipt.accepted) throw new Error(`question cancellation rejected: ${receipt.reason}`);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-user-questions/src/client/PlanReviewPanel.module.css.mjs
|
||||||
|
const css$1 = ".LVzXQa_frame{padding:6px calc(var(--dsh-composer-side-clearance) + 16px) 10px;justify-content:center;display:flex}.LVzXQa_card{width:100%;max-width:var(--dsh-chat-content-width);border:1px solid var(--dsw-alias-state-warn-secondary);background:var(--dsw-specific-input-major);max-height:min(60vh,520px);box-shadow:var(--dsw-shadow-lv2);color:var(--dsw-alias-label-primary);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border-radius:20px;flex-direction:column;display:flex;overflow:hidden}.LVzXQa_card,.LVzXQa_card *{box-sizing:border-box}.LVzXQa_strip{background:var(--dsw-alias-state-warn-tertiary);color:var(--dsw-alias-state-warn-primary);flex-shrink:0;align-items:center;gap:8px;padding:10px 16px;font-size:13px;line-height:18px;display:flex}.LVzXQa_dot{background:var(--dsw-alias-state-warn-primary);border-radius:50%;width:8px;height:8px}.LVzXQa_body{overscroll-behavior:contain;flex:auto;min-height:0;padding:12px 16px 4px;font-size:14px;line-height:22px;overflow-y:auto}.LVzXQa_footer{flex-shrink:0;justify-content:space-between;align-items:center;gap:12px;padding:8px 16px 12px;display:flex}.LVzXQa_feedback{min-height:16px;color:var(--dsw-alias-state-error-primary);font-size:11px;line-height:16px}.LVzXQa_actions{flex-shrink:0;align-items:center;gap:8px;display:flex}.LVzXQa_discuss{color:var(--dsw-alias-label-secondary);gap:6px}.LVzXQa_discuss:hover:not(:disabled){color:var(--dsw-alias-label-primary)}@media (width<=720px){.LVzXQa_card{border-radius:16px}.LVzXQa_body{padding:10px 12px 4px}.LVzXQa_footer{align-items:flex-end;padding:8px 12px 10px}}";
|
||||||
|
const tagId$1 = "@deepseek-ai/dsh-client-ui-user-questions/PlanReviewPanel.module.css";
|
||||||
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
|
||||||
|
const tag = document.createElement("style");
|
||||||
|
tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-user-questions";
|
||||||
|
tag.dataset.pluginCss = tagId$1;
|
||||||
|
tag.textContent = css$1;
|
||||||
|
document.head.appendChild(tag);
|
||||||
|
}
|
||||||
|
var PlanReviewPanel_module_css_default = {
|
||||||
|
"dot": "LVzXQa_dot",
|
||||||
|
"feedback": "LVzXQa_feedback",
|
||||||
|
"frame": "LVzXQa_frame",
|
||||||
|
"strip": "LVzXQa_strip",
|
||||||
|
"body": "LVzXQa_body",
|
||||||
|
"card": "LVzXQa_card",
|
||||||
|
"actions": "LVzXQa_actions",
|
||||||
|
"discuss": "LVzXQa_discuss",
|
||||||
|
"footer": "LVzXQa_footer"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/PlanReviewPanel.js
|
||||||
|
/**
|
||||||
|
* Optional-prop spread for a decision button's tooltip: `title` is optional on
|
||||||
|
* the DOM props, and exactOptionalPropertyTypes rejects an explicit undefined.
|
||||||
|
*
|
||||||
|
* @param description - the asker's option description, when it carries one.
|
||||||
|
* @returns The `title` prop to spread, or nothing.
|
||||||
|
*/
|
||||||
|
function tooltip(description) {
|
||||||
|
return description === void 0 ? {} : { title: description };
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Render a plan review as a decision card.
|
||||||
|
*
|
||||||
|
* @param props - the question domain face, the narrowed plan review, and `t`.
|
||||||
|
* @returns The plan-review takeover for this request.
|
||||||
|
*/
|
||||||
|
function PlanReviewPanel({ pending, review, t }) {
|
||||||
|
const [busy, setBusy] = (0, react.useState)(false);
|
||||||
|
const [error, setError] = (0, react.useState)(null);
|
||||||
|
const settle = (send) => {
|
||||||
|
setBusy(true);
|
||||||
|
setError(null);
|
||||||
|
send().catch((cause) => {
|
||||||
|
setBusy(false);
|
||||||
|
setError(cause instanceof Error ? cause.message : String(cause));
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const decide = (label) => {
|
||||||
|
settle(() => pending.answer({ answers: [{
|
||||||
|
id: review.id,
|
||||||
|
selected: [label]
|
||||||
|
}] }));
|
||||||
|
};
|
||||||
|
const decline = review.decline;
|
||||||
|
return (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: PlanReviewPanel_module_css_default.frame,
|
||||||
|
"data-plan-review-key": pending.key,
|
||||||
|
children: (0, react_jsx_runtime.jsxs)("section", {
|
||||||
|
className: PlanReviewPanel_module_css_default.card,
|
||||||
|
"aria-label": review.question,
|
||||||
|
children: [
|
||||||
|
(0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: PlanReviewPanel_module_css_default.strip,
|
||||||
|
children: [(0, react_jsx_runtime.jsx)("span", { className: PlanReviewPanel_module_css_default.dot }), t("plan.header")]
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: PlanReviewPanel_module_css_default.body,
|
||||||
|
"data-plan-review-scroll": true,
|
||||||
|
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MarkdownText, { text: review.plan })
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: PlanReviewPanel_module_css_default.footer,
|
||||||
|
children: [(0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: PlanReviewPanel_module_css_default.feedback,
|
||||||
|
role: "status",
|
||||||
|
children: error
|
||||||
|
}), (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: PlanReviewPanel_module_css_default.actions,
|
||||||
|
children: [
|
||||||
|
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
||||||
|
variant: "ghost",
|
||||||
|
className: PlanReviewPanel_module_css_default.discuss,
|
||||||
|
icon: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconEditOutline16, { size: 14 }),
|
||||||
|
disabled: busy,
|
||||||
|
onClick: () => {
|
||||||
|
settle(() => pending.cancel());
|
||||||
|
},
|
||||||
|
children: t("plan.discuss")
|
||||||
|
}),
|
||||||
|
decline !== void 0 && (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
||||||
|
variant: "outline",
|
||||||
|
...tooltip(decline.description),
|
||||||
|
disabled: busy,
|
||||||
|
onClick: () => {
|
||||||
|
decide(decline.label);
|
||||||
|
},
|
||||||
|
children: t("plan.decline")
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
||||||
|
variant: "primary",
|
||||||
|
...tooltip(review.approve.description),
|
||||||
|
disabled: busy,
|
||||||
|
onClick: () => {
|
||||||
|
decide(review.approve.label);
|
||||||
|
},
|
||||||
|
children: t("plan.approve")
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})]
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-user-questions/src/client/QuestionComposer.module.css.mjs
|
||||||
|
const css = ".Mbwy4a_frame{padding:6px calc(var(--dsh-composer-side-clearance) + 16px) 10px;justify-content:center;display:flex}.Mbwy4a_card{width:100%;max-width:var(--dsh-chat-content-width);border:1px solid var(--dsw-alias-border-l2-darkmode-thin);background:var(--dsw-specific-input-major);max-height:min(60vh,520px);box-shadow:var(--dsw-shadow-lv2);color:var(--dsw-alias-label-primary);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border-radius:20px;flex-direction:column;padding:0 0 10px;display:flex;overflow:hidden}.Mbwy4a_card,.Mbwy4a_card *{box-sizing:border-box}.Mbwy4a_header{flex-shrink:0;justify-content:space-between;align-items:flex-start;gap:16px;padding:20px 16px 0 24px;display:flex}.Mbwy4a_headingBlock{min-width:0}.Mbwy4a_eyebrow{color:var(--dsw-alias-label-tertiary);margin-bottom:5px;font-size:11px;line-height:16px}.Mbwy4a_title{margin:0;font-size:16px;font-weight:500;line-height:22px}.Mbwy4a_detail{margin:0 2px 8px}.Mbwy4a_footerActions{flex-shrink:0;align-items:center;gap:12px;display:flex}.Mbwy4a_pager{flex-shrink:0;align-items:center;gap:6px;display:flex}.Mbwy4a_progress{color:var(--dsw-alias-label-secondary);white-space:nowrap;word-spacing:-2px;padding:0 4px;font-size:14px;font-weight:500;line-height:24px}.Mbwy4a_iconButton{width:24px;height:24px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:999px;place-items:center;padding:0;display:grid}.Mbwy4a_iconButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.Mbwy4a_iconButton:disabled{color:var(--dsw-alias-label-dimmed);cursor:default}.Mbwy4a_body{overscroll-behavior:contain;flex-direction:column;flex:auto;min-height:0;display:flex;overflow-y:auto}.Mbwy4a_options{flex-direction:column;gap:1px;margin:8px 0 0;padding:4px 12px;display:flex}.Mbwy4a_option{width:100%;min-height:40px;color:inherit;text-align:left;cursor:pointer;background:0 0;border:1px solid #0000;border-radius:12px;flex-shrink:0;align-items:flex-start;gap:8px;padding:8px 12px 8px 8px;transition:background-color .12s,border-color .12s;display:flex}.Mbwy4a_option:hover:not(:disabled),.Mbwy4a_optionSelected{background:var(--dsw-alias-interactive-bg-hover)}.Mbwy4a_optionSelected{border-color:var(--dsw-alias-border-l2)}.Mbwy4a_option:disabled{cursor:default}.Mbwy4a_number{background:var(--dsw-alias-bg-overlay);width:20px;height:20px;color:var(--dsw-alias-label-secondary);border-radius:6px;flex:0 0 20px;place-items:center;margin-top:2px;font-size:12px;font-weight:500;line-height:18px;display:grid}.Mbwy4a_checkbox{flex:0 0 20px;place-items:center;width:20px;height:20px;margin-top:2px;display:grid}.Mbwy4a_checkbox:before{content:\"\";border:1px solid var(--dsw-alias-border-l4);border-radius:4px;grid-area:1/1;width:14px;height:14px;transition:background-color .12s,border-color .12s}.Mbwy4a_checkbox>svg{grid-area:1/1}.Mbwy4a_checkboxChecked{color:var(--dsw-alias-label-primary-foreground)}.Mbwy4a_checkboxChecked:before{border-color:var(--dsw-alias-label-primary);background:var(--dsw-alias-label-primary)}.Mbwy4a_optionCopy{flex:1;min-width:0}.Mbwy4a_optionLine{flex-wrap:wrap;align-items:baseline;gap:2px 6px;display:flex}.Mbwy4a_optionLabel{font-size:14px;font-weight:500;line-height:24px}.Mbwy4a_badge{background:var(--dsw-specific-sidebar-nav-item-active-accent);color:var(--dsw-alias-button-info-fill);border-radius:6px;padding:0 4px;font-size:11px;font-weight:600;line-height:18px}.Mbwy4a_description{color:var(--dsw-alias-label-tertiary);font-size:14px;font-weight:400;line-height:24px}.Mbwy4a_customRow{border:1px solid #0000;border-radius:12px;flex-shrink:0;align-items:flex-start;gap:8px;width:100%;min-height:40px;padding:8px 12px 8px 8px;transition:background-color .12s,border-color .12s;display:flex}.Mbwy4a_customRow:hover,.Mbwy4a_customRow:focus-within,.Mbwy4a_customRowActive{background:var(--dsw-alias-interactive-bg-hover)}.Mbwy4a_customRow:focus-within,.Mbwy4a_customRowActive{border-color:var(--dsw-alias-border-l2)}.Mbwy4a_customInput{min-width:0;color:var(--dsw-alias-label-primary);caret-color:var(--dsw-alias-state-business-primary);font:inherit;background:0 0;border:none;outline:none;flex:1;padding:0;font-size:14px;line-height:24px}.Mbwy4a_customInput::placeholder{color:var(--dsw-alias-label-caption)}.Mbwy4a_customTextarea{resize:none;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-module-platform);min-height:64px;max-height:140px;color:var(--dsw-alias-label-primary);caret-color:var(--dsw-alias-state-business-primary);font:inherit;border-radius:10px;outline:none;flex-shrink:0;margin:0 12px;padding:8px 12px;font-size:14px;line-height:24px;display:block}.Mbwy4a_customTextarea:focus{border-color:var(--dsw-alias-state-business-primary)}.Mbwy4a_customTextarea::placeholder{color:var(--dsw-alias-label-caption)}.Mbwy4a_footer{flex-shrink:0;justify-content:space-between;align-items:center;gaLine truncated
|
||||||
|
const tagId = "@deepseek-ai/dsh-client-ui-user-questions/QuestionComposer.module.css";
|
||||||
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
||||||
|
const tag = document.createElement("style");
|
||||||
|
tag.dataset.plugin = "@deepseek-ai/dsh-client-ui-user-questions";
|
||||||
|
tag.dataset.pluginCss = tagId;
|
||||||
|
tag.textContent = css;
|
||||||
|
document.head.appendChild(tag);
|
||||||
|
}
|
||||||
|
var QuestionComposer_module_css_default = {
|
||||||
|
"pager": "Mbwy4a_pager",
|
||||||
|
"optionCopy": "Mbwy4a_optionCopy",
|
||||||
|
"footer": "Mbwy4a_footer",
|
||||||
|
"iconButton": "Mbwy4a_iconButton",
|
||||||
|
"option": "Mbwy4a_option",
|
||||||
|
"description": "Mbwy4a_description",
|
||||||
|
"optionLine": "Mbwy4a_optionLine",
|
||||||
|
"card": "Mbwy4a_card",
|
||||||
|
"customRow": "Mbwy4a_customRow",
|
||||||
|
"eyebrow": "Mbwy4a_eyebrow",
|
||||||
|
"options": "Mbwy4a_options",
|
||||||
|
"body": "Mbwy4a_body",
|
||||||
|
"customRowActive": "Mbwy4a_customRowActive",
|
||||||
|
"detail": "Mbwy4a_detail",
|
||||||
|
"customInput": "Mbwy4a_customInput",
|
||||||
|
"title": "Mbwy4a_title",
|
||||||
|
"checkbox": "Mbwy4a_checkbox",
|
||||||
|
"feedback": "Mbwy4a_feedback",
|
||||||
|
"headingBlock": "Mbwy4a_headingBlock",
|
||||||
|
"progress": "Mbwy4a_progress",
|
||||||
|
"checkboxChecked": "Mbwy4a_checkboxChecked",
|
||||||
|
"header": "Mbwy4a_header",
|
||||||
|
"optionLabel": "Mbwy4a_optionLabel",
|
||||||
|
"badge": "Mbwy4a_badge",
|
||||||
|
"customTextarea": "Mbwy4a_customTextarea",
|
||||||
|
"footerActions": "Mbwy4a_footerActions",
|
||||||
|
"optionSelected": "Mbwy4a_optionSelected",
|
||||||
|
"number": "Mbwy4a_number",
|
||||||
|
"frame": "Mbwy4a_frame"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/QuestionComposer.js
|
||||||
|
/**
|
||||||
|
* Split the conventional recommendation suffix without changing the answer value.
|
||||||
|
* @param label - Original option label returned if selected.
|
||||||
|
* @returns Display label plus recommendation state.
|
||||||
|
*/
|
||||||
|
function parseRecommendedLabel(label) {
|
||||||
|
const suffix = /\s*(?:\((?:recommended|推荐)\)|((?:recommended|推荐)))\s*$/i;
|
||||||
|
return suffix.test(label) ? {
|
||||||
|
label: label.replace(suffix, ""),
|
||||||
|
recommended: true
|
||||||
|
} : {
|
||||||
|
label,
|
||||||
|
recommended: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
/** Return whether a text-field key event belongs to an active IME composition. */
|
||||||
|
function isComposing(event) {
|
||||||
|
return event.nativeEvent.isComposing || event.nativeEvent.keyCode === 229;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Composer takeover boundary; the carrier key keys local drafts, so a
|
||||||
|
* same-request replay (same key, new carrier object) preserves them.
|
||||||
|
*
|
||||||
|
* One takeover, two shapes: a request that declares a presentation intent this
|
||||||
|
* package renders takes that shape (a plan review is one decision over one
|
||||||
|
* plan, not a question set), and every other request takes the generic flow.
|
||||||
|
* The routing lives here, at the one entry that owns the composer seat, so
|
||||||
|
* neither shape can claim a request the other is already rendering.
|
||||||
|
*
|
||||||
|
* @param props - the selector-matched pending question carrier plus the framework standard kit.
|
||||||
|
* @returns The question flow, or the intent's own surface, for this request.
|
||||||
|
*/
|
||||||
|
function QuestionComposer(props) {
|
||||||
|
const question = (0, react.useMemo)(() => new PendingQuestion(props.matched), [props.matched]);
|
||||||
|
const review = (0, react.useMemo)(() => planReviewOf(question.questions), [question]);
|
||||||
|
return review === void 0 ? (0, react_jsx_runtime.jsx)(QuestionFlow, {
|
||||||
|
pending: question,
|
||||||
|
t: props.t
|
||||||
|
}, question.key) : (0, react_jsx_runtime.jsx)(PlanReviewPanel, {
|
||||||
|
pending: question,
|
||||||
|
review,
|
||||||
|
t: props.t
|
||||||
|
}, question.key);
|
||||||
|
}
|
||||||
|
function QuestionFlow({ pending, t }) {
|
||||||
|
const questions = pending.questions;
|
||||||
|
const [index, setIndex] = (0, react.useState)(0);
|
||||||
|
const [drafts, setDrafts] = (0, react.useState)(() => questions.map(() => ({
|
||||||
|
selected: [],
|
||||||
|
custom: "",
|
||||||
|
skipped: false
|
||||||
|
})));
|
||||||
|
const [busy, setBusy] = (0, react.useState)(null);
|
||||||
|
const [error, setError] = (0, react.useState)(null);
|
||||||
|
const question = questions[index];
|
||||||
|
const draft = drafts[index];
|
||||||
|
const hasOptions = (question.options?.length ?? 0) > 0;
|
||||||
|
const cancelFlow = () => {
|
||||||
|
setBusy("cancel");
|
||||||
|
setError(null);
|
||||||
|
pending.cancel().catch((cause) => {
|
||||||
|
setBusy(null);
|
||||||
|
setError({ text: cause instanceof Error ? cause.message : String(cause) });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const updateDraft = (update) => {
|
||||||
|
setDrafts((current) => current.map((item, itemIndex) => itemIndex === index ? update(item) : item));
|
||||||
|
setError(null);
|
||||||
|
};
|
||||||
|
const choose = (label) => {
|
||||||
|
updateDraft((current) => {
|
||||||
|
if (question.multiSelect === true) {
|
||||||
|
const selected = current.selected.includes(label) ? current.selected.filter((item) => item !== label) : [...current.selected, label];
|
||||||
|
return {
|
||||||
|
...current,
|
||||||
|
selected,
|
||||||
|
skipped: false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
selected: [label],
|
||||||
|
custom: "",
|
||||||
|
skipped: false
|
||||||
|
};
|
||||||
|
});
|
||||||
|
if (question.multiSelect !== true && index < questions.length - 1) setIndex((current) => current + 1);
|
||||||
|
};
|
||||||
|
const answered = (item) => item.selected.length > 0 || item.custom.trim() !== "";
|
||||||
|
const completed = (item) => answered(item) || item.skipped;
|
||||||
|
const submitDrafts = (values) => {
|
||||||
|
const missing = values.findIndex((item) => !completed(item));
|
||||||
|
if (missing >= 0) {
|
||||||
|
setIndex(missing);
|
||||||
|
setError({ key: "error.incomplete" });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const answer = { answers: questions.map((item, itemIndex) => {
|
||||||
|
const value = values[itemIndex];
|
||||||
|
if (value.skipped) return {
|
||||||
|
id: item.id,
|
||||||
|
selected: []
|
||||||
|
};
|
||||||
|
const custom = value.custom.trim();
|
||||||
|
return {
|
||||||
|
id: item.id,
|
||||||
|
selected: custom === "" || item.multiSelect === true ? value.selected : [],
|
||||||
|
...custom === "" ? {} : { custom }
|
||||||
|
};
|
||||||
|
}) };
|
||||||
|
setBusy("answer");
|
||||||
|
setError(null);
|
||||||
|
pending.answer(answer).catch((cause) => {
|
||||||
|
setBusy(null);
|
||||||
|
setError({ text: cause instanceof Error ? cause.message : String(cause) });
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const continueFlow = () => {
|
||||||
|
if (!answered(draft)) {
|
||||||
|
setError({ key: "error.unanswered" });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (index < questions.length - 1) {
|
||||||
|
setIndex((current) => current + 1);
|
||||||
|
setError(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
submitDrafts(drafts);
|
||||||
|
};
|
||||||
|
const draftCustom = (event) => {
|
||||||
|
const value = event.target.value;
|
||||||
|
updateDraft((current) => ({
|
||||||
|
...current,
|
||||||
|
selected: question.multiSelect === true ? current.selected : [],
|
||||||
|
custom: value,
|
||||||
|
skipped: false
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
const continueFromCustom = (event) => {
|
||||||
|
if (event.key !== "Enter" || event.shiftKey || isComposing(event)) return;
|
||||||
|
event.preventDefault();
|
||||||
|
continueFlow();
|
||||||
|
};
|
||||||
|
const skipQuestion = () => {
|
||||||
|
const nextDrafts = drafts.map((item, itemIndex) => itemIndex === index ? {
|
||||||
|
selected: [],
|
||||||
|
custom: "",
|
||||||
|
skipped: true
|
||||||
|
} : item);
|
||||||
|
setDrafts(nextDrafts);
|
||||||
|
setError(null);
|
||||||
|
if (index < questions.length - 1) {
|
||||||
|
setIndex((current) => current + 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
submitDrafts(nextDrafts);
|
||||||
|
};
|
||||||
|
return (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: QuestionComposer_module_css_default.frame,
|
||||||
|
"data-question-key": pending.key,
|
||||||
|
children: (0, react_jsx_runtime.jsxs)("section", {
|
||||||
|
className: QuestionComposer_module_css_default.card,
|
||||||
|
"aria-labelledby": `question-${pending.key}-${String(index)}`,
|
||||||
|
children: [
|
||||||
|
(0, react_jsx_runtime.jsxs)("header", {
|
||||||
|
className: QuestionComposer_module_css_default.header,
|
||||||
|
children: [(0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: QuestionComposer_module_css_default.headingBlock,
|
||||||
|
children: [question.header !== void 0 && (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: QuestionComposer_module_css_default.eyebrow,
|
||||||
|
children: question.header
|
||||||
|
}), (0, react_jsx_runtime.jsx)("h2", {
|
||||||
|
className: QuestionComposer_module_css_default.title,
|
||||||
|
id: `question-${pending.key}-${String(index)}`,
|
||||||
|
children: question.question
|
||||||
|
})]
|
||||||
|
}), (0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: QuestionComposer_module_css_default.iconButton,
|
||||||
|
"aria-label": t("nav.cancel"),
|
||||||
|
title: t("nav.cancel"),
|
||||||
|
disabled: busy !== null,
|
||||||
|
onClick: cancelFlow,
|
||||||
|
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCloseOutline16, {})
|
||||||
|
})]
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: QuestionComposer_module_css_default.body,
|
||||||
|
"data-question-scroll": true,
|
||||||
|
children: [question.detail !== void 0 && (0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: QuestionComposer_module_css_default.detail,
|
||||||
|
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MarkdownText, { text: question.detail })
|
||||||
|
}), (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: QuestionComposer_module_css_default.options,
|
||||||
|
role: question.multiSelect === true ? "group" : "radiogroup",
|
||||||
|
children: [(question.options ?? []).map((option, optionIndex) => {
|
||||||
|
const selected = draft.selected.includes(option.label);
|
||||||
|
const display = parseRecommendedLabel(option.label);
|
||||||
|
return (0, react_jsx_runtime.jsxs)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: clsx(QuestionComposer_module_css_default.option, selected && question.multiSelect !== true && QuestionComposer_module_css_default.optionSelected),
|
||||||
|
role: question.multiSelect === true ? "checkbox" : "radio",
|
||||||
|
"aria-checked": selected,
|
||||||
|
"aria-label": display.label,
|
||||||
|
disabled: busy !== null,
|
||||||
|
onClick: () => {
|
||||||
|
choose(option.label);
|
||||||
|
},
|
||||||
|
onKeyDown: (event) => {
|
||||||
|
if (event.key !== "Enter" || !drafts.every(completed)) return;
|
||||||
|
event.preventDefault();
|
||||||
|
submitDrafts(drafts);
|
||||||
|
},
|
||||||
|
children: [question.multiSelect === true ? (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: clsx(QuestionComposer_module_css_default.checkbox, selected && QuestionComposer_module_css_default.checkboxChecked),
|
||||||
|
"aria-hidden": "true",
|
||||||
|
children: selected && (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutline14, { size: 12 })
|
||||||
|
}) : (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: QuestionComposer_module_css_default.number,
|
||||||
|
children: optionIndex + 1
|
||||||
|
}), (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: QuestionComposer_module_css_default.optionCopy,
|
||||||
|
children: (0, react_jsx_runtime.jsxs)("span", {
|
||||||
|
className: QuestionComposer_module_css_default.optionLine,
|
||||||
|
children: [
|
||||||
|
(0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: QuestionComposer_module_css_default.optionLabel,
|
||||||
|
children: display.label
|
||||||
|
}),
|
||||||
|
display.recommended && (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: QuestionComposer_module_css_default.badge,
|
||||||
|
children: t("option.recommended")
|
||||||
|
}),
|
||||||
|
option.description !== void 0 && (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: QuestionComposer_module_css_default.description,
|
||||||
|
children: option.description
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})
|
||||||
|
})]
|
||||||
|
}, `${option.label}-${String(optionIndex)}`);
|
||||||
|
}), hasOptions ? (0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: clsx(QuestionComposer_module_css_default.customRow, draft.custom !== "" && QuestionComposer_module_css_default.customRowActive),
|
||||||
|
children: [question.multiSelect === true ? (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: clsx(QuestionComposer_module_css_default.checkbox, draft.custom !== "" && QuestionComposer_module_css_default.checkboxChecked),
|
||||||
|
"aria-hidden": "true",
|
||||||
|
children: draft.custom !== "" && (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutline14, { size: 12 })
|
||||||
|
}) : (0, react_jsx_runtime.jsx)("span", {
|
||||||
|
className: QuestionComposer_module_css_default.number,
|
||||||
|
"aria-hidden": "true",
|
||||||
|
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconEditOutline16, { size: 12 })
|
||||||
|
}), (0, react_jsx_runtime.jsx)("input", {
|
||||||
|
type: "text",
|
||||||
|
className: QuestionComposer_module_css_default.customInput,
|
||||||
|
value: draft.custom,
|
||||||
|
disabled: busy !== null,
|
||||||
|
placeholder: t("custom.placeholder"),
|
||||||
|
onChange: draftCustom,
|
||||||
|
onKeyDown: continueFromCustom
|
||||||
|
})]
|
||||||
|
}) : (0, react_jsx_runtime.jsx)("textarea", {
|
||||||
|
autoFocus: true,
|
||||||
|
className: QuestionComposer_module_css_default.customTextarea,
|
||||||
|
value: draft.custom,
|
||||||
|
disabled: busy !== null,
|
||||||
|
rows: 2,
|
||||||
|
placeholder: t("custom.placeholder"),
|
||||||
|
onChange: draftCustom,
|
||||||
|
onKeyDown: continueFromCustom
|
||||||
|
})]
|
||||||
|
})]
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsxs)("footer", {
|
||||||
|
className: QuestionComposer_module_css_default.footer,
|
||||||
|
children: [
|
||||||
|
(0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: QuestionComposer_module_css_default.pager,
|
||||||
|
children: [
|
||||||
|
(0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: QuestionComposer_module_css_default.iconButton,
|
||||||
|
"aria-label": t("nav.prev"),
|
||||||
|
disabled: index === 0 || busy !== null,
|
||||||
|
onClick: () => {
|
||||||
|
setIndex(index - 1);
|
||||||
|
setError(null);
|
||||||
|
},
|
||||||
|
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronLeftOutline14, {})
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsxs)("span", {
|
||||||
|
className: QuestionComposer_module_css_default.progress,
|
||||||
|
children: [
|
||||||
|
index + 1,
|
||||||
|
" / ",
|
||||||
|
questions.length
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)("button", {
|
||||||
|
type: "button",
|
||||||
|
className: QuestionComposer_module_css_default.iconButton,
|
||||||
|
"aria-label": t("nav.next"),
|
||||||
|
disabled: index === questions.length - 1 || busy !== null,
|
||||||
|
onClick: () => {
|
||||||
|
setIndex(index + 1);
|
||||||
|
setError(null);
|
||||||
|
},
|
||||||
|
children: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronRightOutline14, {})
|
||||||
|
})
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsx)("div", {
|
||||||
|
className: QuestionComposer_module_css_default.feedback,
|
||||||
|
role: "status",
|
||||||
|
children: error === null ? null : "key" in error ? t(error.key) : error.text
|
||||||
|
}),
|
||||||
|
(0, react_jsx_runtime.jsxs)("div", {
|
||||||
|
className: QuestionComposer_module_css_default.footerActions,
|
||||||
|
children: [(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
||||||
|
variant: "outline",
|
||||||
|
disabled: busy !== null,
|
||||||
|
onClick: skipQuestion,
|
||||||
|
children: t("action.skip")
|
||||||
|
}), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
||||||
|
variant: "primary",
|
||||||
|
disabled: busy !== null || !answered(draft),
|
||||||
|
onClick: continueFlow,
|
||||||
|
children: busy === "answer" ? t("submitting") : index === questions.length - 1 ? t("submit") : t("action.next")
|
||||||
|
})]
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})
|
||||||
|
]
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/locales.js
|
||||||
|
/** `question` namespace dictionaries. */
|
||||||
|
/** Simplified Chinese dictionary (the key-set source of truth). */
|
||||||
|
const zh = {
|
||||||
|
"error.incomplete": "请先完成这道问题。",
|
||||||
|
"error.unanswered": "请选择一个选项或填写自定义答案。",
|
||||||
|
"nav.prev": "上一题",
|
||||||
|
"nav.next": "下一题",
|
||||||
|
"nav.cancel": "放弃整组问题",
|
||||||
|
"option.recommended": "推荐",
|
||||||
|
"custom.placeholder": "输入你的答案",
|
||||||
|
"action.skip": "跳过本题",
|
||||||
|
"action.next": "下一题",
|
||||||
|
"plan.header": "计划待审",
|
||||||
|
"plan.approve": "确认执行",
|
||||||
|
"plan.decline": "拒绝",
|
||||||
|
"plan.discuss": "去聊天里说"
|
||||||
|
};
|
||||||
|
/** English dictionary, checked complete against the zh key set. */
|
||||||
|
const en = {
|
||||||
|
"error.incomplete": "Please complete this question first.",
|
||||||
|
"error.unanswered": "Please select an option or enter a custom answer.",
|
||||||
|
"nav.prev": "Previous question",
|
||||||
|
"nav.next": "Next question",
|
||||||
|
"nav.cancel": "Dismiss all questions",
|
||||||
|
"option.recommended": "Recommended",
|
||||||
|
"custom.placeholder": "Type your answer",
|
||||||
|
"action.skip": "Skip this question",
|
||||||
|
"action.next": "Next",
|
||||||
|
"plan.header": "Plan review",
|
||||||
|
"plan.approve": "Approve",
|
||||||
|
"plan.decline": "Refuse",
|
||||||
|
"plan.discuss": "Chat about it"
|
||||||
|
};
|
||||||
|
//#endregion
|
||||||
|
//#region lib/types/client/index.js
|
||||||
|
/** Dictionary namespace owned by this plugin. */
|
||||||
|
const NS = "question";
|
||||||
|
/** Required services: the slot registry and the question composer's copy. */
|
||||||
|
const inject = ["slots", "locale"];
|
||||||
|
/** Chain routing: claim the composer while a question wait is pending (pure — owner props only). */
|
||||||
|
function selectQuestion({ interactions }) {
|
||||||
|
return interactions.find((i) => i.kind === "question") ?? null;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Client plugin body: register the `question` dictionaries and the question
|
||||||
|
* composer into the composer chain. Zero business face — data and verbs live
|
||||||
|
* on the matched carrier; t rides the standard locale seat.
|
||||||
|
* @param ctx - client root context.
|
||||||
|
*/
|
||||||
|
function apply(ctx) {
|
||||||
|
ctx.effect(() => ctx.locale.register(NS, {
|
||||||
|
zh,
|
||||||
|
en
|
||||||
|
}), "ui-user-questions: dictionaries");
|
||||||
|
ctx.slots.inject("conversation.composer", () => ctx.slots.register({
|
||||||
|
name: "conversation.composer",
|
||||||
|
select: selectQuestion,
|
||||||
|
locale: NS
|
||||||
|
}, QuestionComposer));
|
||||||
|
}
|
||||||
|
//#endregion
|
||||||
|
exports.PendingQuestion = PendingQuestion;
|
||||||
|
exports.apply = apply;
|
||||||
|
exports.inject = inject;
|
||||||
|
return module.exports;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//# sourceMappingURL=client.js.map
|
||||||
File diff suppressed because it is too large.
Load diff
Binary file not shown.
@@ -0,0 +1 @@
|
|||||||
|
$F~
|
||||||
Binary file not shown.
Whitespace-only changes.
Whitespace-only changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loaded 100 of 345 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user