@codexhost/cli-win32-arm64 0.26.1 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +1010 -592
- package/app/console-web.js +1861 -1498
- package/app/desktop-controller.mjs +488 -245
- package/app/host-runtime.mjs +9177 -4006
- package/app/plugins/antigravity/plugin.mjs +9055 -548
- package/app/plugins/claude-code/plugin.mjs +1117 -423
- package/app/plugins/codebuddy/plugin.mjs +599 -261
- package/app/plugins/codex-usage/plugin.mjs +1808 -1357
- package/app/plugins/copilot/plugin.mjs +491 -235
- package/app/plugins/cursor-cli/plugin.mjs +487 -232
- package/app/plugins/deepseek-harness/plugin.mjs +493 -235
- package/app/plugins/devin/plugin.mjs +467 -232
- package/app/plugins/grok/plugin.mjs +547 -253
- package/app/plugins/hermes/plugin.mjs +468 -232
- package/app/plugins/kimi-code/plugin.mjs +762 -439
- package/app/plugins/kiro-cli/plugin.mjs +466 -232
- package/app/plugins/omp/plugin.mjs +1705 -1356
- package/app/plugins/opencode/manifest.json +1 -1
- package/app/plugins/opencode/plugin.mjs +544 -250
- package/app/plugins/pi/plugin.mjs +761 -364
- package/app/plugins/qoder/plugin.mjs +540 -246
- package/app/plugins/qoder-cn/plugin.mjs +540 -246
- package/app/plugins/qwen-code/plugin.mjs +466 -232
- package/app/plugins/workbuddy/plugin.mjs +594 -273
- package/app/plugins/zcode/plugin.mjs +468 -232
- package/app/renderer-extension.js +2653 -657
- package/app/web/assets/index-DBPgg32z.css +1 -0
- package/app/web/assets/index-DWxiVzuS.js +204 -0
- package/app/web/codexhost-settings.js +101 -66
- package/app/web/index.html +2 -2
- package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +65 -65
- package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +69 -69
- package/app/web/plugins/deepseek-ai__dsh-client-shortcuts/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-approval/client.js +4 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +75 -75
- package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +73 -73
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +19 -19
- package/app/web/plugins/deepseek-ai__dsh-client-ui-input-trigger/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-model-selection/client.js +5 -5
- package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-shortcuts/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-documentpreview/client.pdf.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-right/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
- package/app/web/plugins/deepseek-ai__dsh-client-ui-user-questions/client.js +4 -4
- package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +71 -71
- package/app/web/plugins.json +2 -1
- package/app/web-modules/server.mjs +5065 -1964
- package/bin/codexhost.exe +0 -0
- package/libexec/codexhost-node-repl.exe +0 -0
- package/libexec/codexhost-shell.exe +0 -0
- package/libexec/codexhost-shim.exe +0 -0
- package/libexec/codexhost-updater.exe +0 -0
- package/package.json +1 -1
- package/app/web/assets/index-CR4Y8Ndj.css +0 -1
- package/app/web/assets/index-Dw-yHAxN.js +0 -196
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
window.__ModuleLoader__.load({id:`@deepseek-ai/dsh-client-ui-user-questions`,factory:e=>{var t={exports:{}},n=t.exports;Object.defineProperty(n,Symbol.toStringTag,{value:`Module`});let r=e("@deepseek-ai/dsh-client-store"),i=e("react"),a=e("@deepseek-ai/dsh-client-ui-primitives"),o=e("react/jsx-runtime");function s(e){return e}function c(e,t){try{return e(),Promise.resolve()}catch(e){return Promise.reject(e instanceof Error?e:Error(t,{cause:e}))}}function l(e){if(e.length!==1)return;let t=e[0],n=t.intent;if(n?.kind!==`plan-review`||t.detail===void 0||t.multiSelect===!0)return;let r=t.options??[];if(r.length>2)return;let i=r.find(e=>e.label===n.approve);if(i===void 0)return;let a=r.find(e=>e.label!==n.approve);return{id:t.id,question:t.question,plan:t.detail,...n.callId===void 0?{}:{callId:n.callId},approve:i,...a===void 0?{}:{decline:a}}}let
|
|
1
|
+
window.__ModuleLoader__.load({id:`@deepseek-ai/dsh-client-ui-user-questions`,factory:e=>{var t={exports:{}},n=t.exports;Object.defineProperty(n,Symbol.toStringTag,{value:`Module`});let r=e("@deepseek-ai/dsh-client-store"),i=e("react"),a=e("@deepseek-ai/dsh-client-ui-primitives"),o=e("react/jsx-runtime");function s(e){return e}function c(e,t){try{return e(),Promise.resolve()}catch(e){return Promise.reject(e instanceof Error?e:Error(t,{cause:e}))}}function l(e){if(e.length!==1)return;let t=e[0],n=t.intent;if(n?.kind!==`plan-review`||t.detail===void 0||t.multiSelect===!0)return;let r=t.options??[];if(r.length>2)return;let i=r.find(e=>e.label===n.approve);if(i===void 0)return;let a=r.find(e=>e.label!==n.approve);return{id:t.id,question:t.question,plan:t.detail,...n.callId===void 0?{}:{callId:n.callId},approve:i,...a===void 0?{}:{decline:a}}}function u(e){if(e.length!==1)return;let t=e[0],n=t.intent;if(n?.kind!==`approval`||t.multiSelect===!0)return;let r=t.options??[];if(n.actions.length===0)return;let i=[];for(let e of n.actions){let t=r.find(t=>t.label===e.label);if(t===void 0)return;i.push({label:t.label,effect:e.effect,...t.description===void 0?{}:{description:t.description}})}return{id:t.id,question:t.question,...t.detail===void 0?{}:{detail:t.detail},...n.toolLabel===void 0?{}:{toolLabel:n.toolLabel},...n.command===void 0?{}:{command:n.command},...n.files===void 0?{}:{files:n.files},actions:i}}let d=Array.from(globalThis.crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(16)),e=>e.toString(16).padStart(2,`0`)).join(``),f=0,p={ASK_ABORTED:`ask_user_question was aborted before the user answered`,ASK_CANCELLED:`the user cancelled ask_user_question`,ASK_TIMED_OUT:`ask_user_question timed out before the user answered`};function m(e){let t=Error(p[e]);return t.name=`UserQuestionError`,t.code=e,t}function h(e,t,n){let r=Promise.withResolvers(),i=Symbol(`pending question delegated`),a=!1,o=e=>{a||(a=!0,t?.removeEventListener(`abort`,s),e(),n(c))},s=()=>{o(()=>{r.reject(m(`ASK_ABORTED`))})},c={deadline:e,resolve:e=>{o(()=>{r.resolve(e)})},reject:e=>{o(()=>{r.reject(m(e))})},delegate:()=>{o(()=>{r.reject(i)})}};return t!==void 0&&(t.addEventListener(`abort`,s,{once:!0}),t.aborted&&s()),{channel:c,result:r.promise,isDelegation:e=>e===i}}var g=class e{kind;key;sessionId;questions;callId;review;dismissal;#e=`open`;#t;#n;#r;#i=!1;#a;#o;#s;#c=!1;#l=!1;#u=!1;#d=!1;#f;#p=/* @__PURE__ */ new Set;#m;constructor(t,n,r,i,a){this.sessionId=t,this.questions=n,this.kind=l(n)===void 0?u(n)===void 0?`question`:`approval`:`plan-review`,this.callId=r,this.review=a,this.dismissal=r===void 0?`cancel`:`hide`,this.#f=i,r===void 0&&(f+=1),this.key=r===void 0?`question:${d}:${String(f)}`:e.keyOf(t,r),this.#m=this.createSnapshot()}static keyOf(e,t){return`question:${String(e)}:${t}`}liveKeys(){return this.#f?.()??[this.key]}subscribe=e=>(this.#p.add(e),()=>{this.#p.delete(e)});snapshot=()=>this.#m;getSnapshot=this.snapshot;createSnapshot(){let e=this.#t===void 0?this.#e===`continued`&&this.#n!==void 0?`rpc`:`none`:`waterfall`,t=this.#e===`continued`?`continued`:this.#u?`waiting`:this.#l?`editing`:this.#c?`focused`:`counting`;return{state:this.#e,waitState:t,countdown:this.#i?{remainingMs:this.#o===void 0?this.#s??0:Math.max(0,this.#o-Date.now()),running:this.#o!==void 0}:void 0,channel:e,closed:this.#d}}publish(){this.#m=this.createSnapshot(),this.#h();for(let e of this.#p)e()}#h(){let e=this.#o!==void 0&&!this.#d;e!==(this.#a!==void 0)&&(e?this.#a=setInterval(()=>{this.#g()},1e3):(clearInterval(this.#a),this.#a=void 0))}#g(){let e=this.#o;
|
|
2
2
|
/* v8 ignore next -- #reschedule clears the interval in the same publish that drops the deadline. */
|
|
3
|
-
e!==void 0&&(Date.now()>=e?this.timeout():this.publish())}attachWaterfall(e){this.#t=e,this.#i=e.deadline!==void 0,!this.#u&&!this.#l&&(this.#o=e.deadline,this.#c&&e.deadline!==void 0&&(this.#s=Math.max(0,e.deadline-Date.now()),this.#o=void 0)),this.publish()}detachWaterfall(e){this.#t===e&&(this.#t=void 0,this.#i=!1,this.#o=void 0,this.publish())}hasWaterfall(){return this.#t!==void 0}attachRpc(e){this.#n=e,this.publish()}attachSeat(e){this.#r=e}setState(e){this.#e!==e&&(this.#e=e,this.publish())}takeTime(){this.#u||(this.#u=!0,this.#c=!1,this.#s=void 0,this.#o=void 0,this.publish())}holdFocus(e=Date.now()){this.#u||this.#l||this.#c||(this.#s=this.#o===void 0?void 0:Math.max(0,this.#o-e),this.#o=void 0,this.#c=!0,this.publish())}releaseFocus(e=Date.now()){this.#c&&(this.#c=!1,this.#o=this.#i&&this.#s!==void 0?e+this.#s:void 0,this.#s=void 0,this.publish())}engage(e=Date.now()){this.#u||this.#l||(this.#s===void 0&&this.#o!==void 0&&(this.#s=Math.max(0,this.#o-e)),this.#l=!0,this.#c=!1,this.#o=void 0,this.publish())}timeout(){if(this.#u||this.#l||this.#c)return;let e=this.#t;e!==void 0&&(this.#t=void 0,this.#i=!1,this.#o=void 0,e.reject(`ASK_TIMED_OUT`),this.publish())}delegate(){this.#t?.delegate()}close(){this.#d||(this.#d=!0,this.publish())}answer(e){let t=this.#t;if(t!==void 0)return c(()=>{t.resolve(e)},`pending question settlement failed`);let n=this.#n;return this.#e===`continued`&&n!==void 0?n.answer(e).then(e=>{if(!e)throw Error(`this question is no longer answerable`)}):Promise.reject(/* @__PURE__ */ Error(`no channel accepts an answer yet`))}dismiss(){if(this.dismissal===`hide`)return c(()=>{this.#r?.hide()},`pending question hide failed`);let e=this.#t;return e===void 0?Promise.reject(/* @__PURE__ */ Error(`no channel accepts a cancellation yet`)):c(()=>{e.reject(`ASK_CANCELLED`)},`pending question cancellation failed`)}};function g(){return(0,r.defineStore)({init:()=>({progressByRequest:{}}),persist:`dsh.user-questions.drafts.v1`,actions:{replace:(e,t,n)=>{e.progressByRequest[t]=n},clear:(e,t)=>{e.progressByRequest=Object.fromEntries(Object.entries(e.progressByRequest).filter(([e])=>e!==t))},prune:(e,t)=>{let n=new Set(t);e.progressByRequest=Object.fromEntries(Object.entries(e.progressByRequest).filter(([e])=>n.has(e)))}}})}function _(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=_(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function v(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=_(e))&&(r&&(r+=` `),r+=t);return r}let y=`@deepseek-ai/dsh-client-ui-user-questions/PlanReviewPanel.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(y)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-user-questions`,e.dataset.pluginCss=y,e.textContent=`.iuO8HG_frame{padding:6px calc(var(--dsh-composer-side-clearance) + 16px) 10px;justify-content:center;display:flex}.iuO8HG_card{width:100%;max-width:var(--dsh-chat-content-width);--dsw-elevation-stroke-color:var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-xl);background:var(--dsw-specific-input-major);box-shadow:var(--dsw-elevation-panel);color:var(--dsw-alias-label-primary);border:0;flex-direction:column;display:flex;overflow:hidden}.iuO8HG_card,.iuO8HG_card *{box-sizing:border-box}.iuO8HG_strip{background:var(--dsw-alias-state-warn-tertiary);color:var(--dsw-alias-state-warn-primary);flex-shrink:0;align-items:center;gap:8px;padding:12px 16px;font-size:14px;line-height:20px;display:flex}.iuO8HG_footer{flex-shrink:0;justify-content:space-between;align-items:center;gap:12px;padding:8px 16px 12px;display:flex}.iuO8HG_feedback{min-height:16px;color:var(--dsw-alias-state-error-primary);font-size:11px;line-height:16px}.iuO8HG_actions{flex-shrink:0;align-items:center;gap:8px;display:flex}.iuO8HG_summary{min-width:0;padding:14px 16px 12px}.iuO8HG_title{text-overflow:ellipsis;white-space:nowrap;margin:0;font-size:15px;font-weight:500;line-height:22px;overflow:hidden}.iuO8HG_description{-webkit-line-clamp:2;color:var(--dsw-alias-label-secondary);-webkit-box-orient:vertical;margin:8px 0 0;font-size:14px;line-height:24px;display:-webkit-box;overflow:hidden}.iuO8HG_discuss{gap:6px}@media (width<=720px){.iuO8HG_card{border-radius:var(--dsw-radius-xl)}.iuO8HG_footer{align-items:flex-end;padding:8px 12px 10px}}.iuO8HG_previewActions{align-items:center;margin-left:auto;display:flex}`,document.head.appendChild(e)}var b={actions:`iuO8HG_actions`,card:`iuO8HG_card`,description:`iuO8HG_description`,discuss:`iuO8HG_discuss`,feedback:`iuO8HG_feedback`,footer:`iuO8HG_footer`,frame:`iuO8HG_frame`,previewActions:`iuO8HG_previewActions`,strip:`iuO8HG_strip`,summary:`iuO8HG_summary`,title:`iuO8HG_title`};function x(e){return e===void 0?{}:{title:e}}function S({pending:e,review:t,t:n,renderSlot:r}){let[s,c]=(0,i.useState)(!1),[l,u]=(0,i.useState)(null),d=(t,r=!1)=>{c(!0),u(null),t().then(()=>{r&&(c(!1),e.dismiss().catch(()=>{u(n(`status.sent`))}))}).catch(e=>{c(!1),u(e instanceof Error?e.message:String(e))})},f=n=>{d(()=>e.answer({answers:[{id:t.id,selected:[n]}]}),e.snapshot().channel===`rpc`)},p=(0,i.useMemo)(()=>{let e=(0,a.extractMarkdownPlainText)(t.plan,{mode:`first-line`}),n=(0,a.extractMarkdownPlainText)(t.plan,{mode:`first-paragraph`});return{title:e,description:n===e?``:n}},[t.plan]);return/* @__PURE__ */ (0,o.jsx)(`div`,{className:b.frame,"data-plan-review-key":e.key,children:/* @__PURE__ */ (0,o.jsxs)(`section`,{className:b.card,"aria-label":t.question,"aria-busy":s,children:[/* @__PURE__ */ (0,o.jsxs)(`div`,{className:b.strip,children:[/* @__PURE__ */ (0,o.jsx)(a.StateDot,{state:s?`ongoing`:`warning`}),n(`plan.header`),/* @__PURE__ */ (0,o.jsx)(`div`,{className:b.previewActions,children:r(`conversation.plan-review.actions`,{review:t,requestKey:e.key})})]}),/* @__PURE__ */ (0,o.jsxs)(`div`,{className:b.summary,children:[/* @__PURE__ */ (0,o.jsx)(`h3`,{className:b.title,children:p.title}),p.description!==``&&/* @__PURE__ */ (0,o.jsx)(`p`,{className:b.description,children:p.description})]}),/* @__PURE__ */ (0,o.jsxs)(`div`,{className:b.footer,children:[/* @__PURE__ */ (0,o.jsx)(`div`,{className:b.feedback,role:`status`,children:l}),/* @__PURE__ */ (0,o.jsxs)(`div`,{className:b.actions,children:[/* @__PURE__ */ (0,o.jsx)(a.Button,{variant:`outline`,className:b.discuss,icon:/* @__PURE__ */ (0,o.jsx)(a.IconEditOutlineRegular,{size:14}),disabled:s,onClick:()=>{d(()=>e.dismiss())},children:n(`plan.discuss`)}),/* @__PURE__ */ (0,o.jsx)(a.Button,{variant:`primary`,...x(t.approve.description),disabled:s,onClick:()=>{f(t.approve.label)},children:n(`plan.approve`)})]})]})]})})}let C=`@deepseek-ai/dsh-client-ui-user-questions/QuestionComposer.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(C)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-user-questions`,e.dataset.pluginCss=C,e.textContent=`._0RLEhq_frame{padding:6px calc(var(--dsh-composer-side-clearance) + 16px) 10px;justify-content:center;display:flex}._0RLEhq_card{width:100%;max-width:var(--dsh-chat-content-width);--dsw-elevation-stroke-color:var(--dsw-alias-border-l2-darkmode-thin);border-radius:var(--dsw-radius-xl);background:var(--dsw-specific-input-major);min-width:0;max-height:min(60dvh,520px);box-shadow:var(--dsw-elevation-panel);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:0;flex-direction:column;padding:0;display:flex;overflow:hidden}._0RLEhq_card,._0RLEhq_card *{box-sizing:border-box}._0RLEhq_topBar{flex-wrap:wrap;flex-shrink:0;align-items:center;gap:8px 12px;padding:12px 16px 4px 20px;display:flex}._0RLEhq_cardMinimized ._0RLEhq_topBar{padding-bottom:14px}._0RLEhq_topBarLeading{flex-direction:column;flex:1 1 0;gap:2px;min-width:0;display:flex}._0RLEhq_eyebrow{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:16px;overflow:hidden}._0RLEhq_minimizedTitle{text-overflow:ellipsis;white-space:nowrap;margin:0;font-size:15px;font-weight:500;line-height:21px;overflow:hidden}._0RLEhq_statusGroup{flex-shrink:0;align-items:center;gap:8px;display:flex}._0RLEhq_iconActions{flex-shrink:0;align-items:center;gap:4px;display:flex}._0RLEhq_waitButton{white-space:nowrap;touch-action:manipulation;user-select:none;-webkit-tap-highlight-color:transparent}._0RLEhq_waitStatus{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-size:12px;line-height:20px}._0RLEhq_scrollArea{overscroll-behavior:contain;flex:auto;min-height:0;overflow-y:auto}._0RLEhq_scrollArea:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}._0RLEhq_body{flex-direction:column;display:flex}._0RLEhq_promptBlock{flex-direction:column;padding:2px 20px 0;display:flex}._0RLEhq_promptContent{overflow-wrap:anywhere;min-width:0;position:relative}._0RLEhq_title{margin:0;font-size:16px;font-weight:500;line-height:22px}._0RLEhq_detail{border:1px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-module-platform);min-width:0;color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere;margin-top:10px;padding:10px 12px;font-size:13px;line-height:20px}._0RLEhq_detail pre{white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%}._0RLEhq_promptToggle{corner-shape:round;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-state-business-primary);font:inherit;cursor:pointer;touch-action:manipulation;user-select:none;-webkit-tap-highlight-color:transparent;border:0;border-radius:999px;align-self:flex-start;align-items:center;gap:4px;margin-top:6px;padding:4px 10px;font-size:12px;font-weight:500;line-height:18px;transition:background-color .12s;display:inline-flex}._0RLEhq_promptToggle:active{background:var(--dsw-alias-interactive-bg-active)}._0RLEhq_promptToggle:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}._0RLEhq_footerActions{flex-shrink:0;align-items:center;gap:8px;margin-left:auto;display:flex}._0RLEhq_pager{flex-shrink:0;align-items:center;gap:2px;display:flex}._0RLEhq_progress{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-variant-numeric:tabular-nums;word-spacing:-2px;padding:0 4px;font-size:12px;font-weight:400;line-height:24px}._0RLEhq_iconButton{corner-shape:round;width:24px;height:24px;color:var(--dsw-alias-label-tertiary);cursor:pointer;touch-action:manipulation;user-select:none;-webkit-tap-highlight-color:transparent;background:0 0;border:none;border-radius:999px;place-items:center;padding:0;transition:background-color .12s,color .12s;display:grid}._0RLEhq_iconButton:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active);color:var(--dsw-alias-label-primary)}._0RLEhq_iconButton:focus-visible,._0RLEhq_option:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}._0RLEhq_iconButton:disabled{color:var(--dsw-alias-label-dimmed);cursor:default}._0RLEhq_options{flex-direction:column;gap:6px;margin:12px 0;padding:2px 20px;display:flex}._0RLEhq_option{border:1px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md);width:100%;min-height:44px;color:inherit;text-align:left;cursor:pointer;touch-action:manipulation;user-select:none;-webkit-tap-highlight-color:transparent;background:0 0;flex-shrink:0;align-items:flex-start;gap:8px;padding:9px 12px;transition:background-color .12s,border-color .12s,transform .1s;display:flex}._0RLEhq_optionSelected{background:var(--dsw-alias-interactive-bg-hover);border-color:var(--dsw-alias-label-secondary)}._0RLEhq_option:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active)}._0RLEhq_optionSelected ._0RLEhq_number{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-label-primary-foreground)}._0RLEhq_option:disabled{cursor:default}._0RLEhq_number{border-radius:var(--dsw-radius-xs);background:var(--dsw-alias-bg-overlay);width:20px;height:20px;color:var(--dsw-alias-label-secondary);flex:0 0 20px;place-items:center;margin-top:2px;font-size:12px;font-weight:500;line-height:18px;display:grid}._0RLEhq_checkbox{flex:0 0 20px;place-items:center;width:20px;height:20px;margin-top:2px;display:grid}._0RLEhq_checkbox:before{content:"";border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-xs);grid-area:1/1;width:14px;height:14px;transition:background-color .12s,border-color .12s}._0RLEhq_checkbox>svg{grid-area:1/1}._0RLEhq_checkboxChecked{color:var(--dsw-alias-label-primary-foreground)}._0RLEhq_checkboxChecked:before{border-color:var(--dsw-alias-label-primary);background:var(--dsw-alias-label-primary)}._0RLEhq_optionCopy{overflow-wrap:anywhere;flex:1;min-width:0}._0RLEhq_optionLine{flex-wrap:wrap;align-items:baseline;gap:2px 6px;display:flex}._0RLEhq_optionLabel{font-size:14px;font-weight:500;line-height:24px}._0RLEhq_badge{border-radius:var(--dsw-radius-xs);background:var(--dsw-specific-sidebar-nav-item-active-accent);color:var(--dsw-alias-button-info-fill);padding:0 4px;font-size:11px;font-weight:600;line-height:18px}._0RLEhq_description{color:var(--dsw-alias-label-tertiary);flex-basis:100%;font-size:14px;font-weight:400;line-height:24px}._0RLEhq_reviewNote{color:var(--dsw-alias-label-tertiary);margin:0;padding:8px 12px;font-size:14px;line-height:24px}._0RLEhq_customRow{border:1px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md);flex-shrink:0;align-items:flex-start;gap:8px;width:100%;min-height:44px;padding:9px 12px;transition:background-color .12s,border-color .12s;display:flex}._0RLEhq_customRow:focus-within,._0RLEhq_customRowActive{background:var(--dsw-alias-interactive-bg-hover);border-color:var(--dsw-alias-border-l2)}._0RLEhq_field{--dsh-answer-field-padding:0;min-width:0;display:grid}._0RLEhq_field>*{min-width:0;padding:var(--dsh-answer-field-padding);font:inherit;white-space:pre-wrap;word-break:break-word;overflow-wrap:anywhere;grid-area:1/1;font-size:14px;line-height:24px}._0RLEhq_fieldMirror{box-sizing:content-box;visibility:hidden;max-height:144px;overflow:hidden}._0RLEhq_fieldInput{resize:none;color:var(--dsw-alias-label-primary);caret-color:var(--dsw-alias-state-business-primary);background:0 0;border:none;outline:none;overflow-y:auto}._0RLEhq_fieldInput::placeholder{color:var(--dsw-alias-label-caption)}._0RLEhq_customInline{flex:1}._0RLEhq_customBlock{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-module-platform);--dsh-answer-field-padding:8px 12px;flex-shrink:0;min-height:64px;margin:0}._0RLEhq_customBlock:focus-within{border-color:var(--dsw-alias-state-business-primary)}._0RLEhq_footer{border-top:1px solid var(--dsw-alias-border-l2);flex-wrap:wrap;flex-shrink:0;justify-content:space-between;align-items:center;gap:8px 12px;padding:10px 16px;display:flex}._0RLEhq_feedback{min-width:0;color:var(--dsw-alias-state-error-primary);overflow-wrap:anywhere;flex-basis:100%;order:-1;font-size:11px;line-height:16px}._0RLEhq_feedback:empty{display:none}@media (hover:hover) and (pointer:fine){._0RLEhq_iconButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}._0RLEhq_option:hover:not(:disabled),._0RLEhq_customRow:hover,._0RLEhq_promptToggle:hover{background:var(--dsw-alias-interactive-bg-hover)}}@media (pointer:coarse){._0RLEhq_field>*{font-size:16px;line-height:24px}._0RLEhq_iconButton{width:44px;height:44px}}@media (width<=720px){._0RLEhq_frame{padding:4px 8px 8px}._0RLEhq_card{border-radius:22px;max-width:100%;max-height:min(78dvh,640px)}._0RLEhq_topBar{border-bottom:1px solid var(--dsw-alias-border-l1);gap:0 4px;padding:4px 4px 4px 14px}._0RLEhq_cardMinimized ._0RLEhq_topBar{border-bottom:none;padding-bottom:4px}._0RLEhq_eyebrow{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:600;line-height:18px}._0RLEhq_iconButton{width:44px;height:44px}._0RLEhq_statusGroup{border-top:1px solid var(--dsw-alias-border-l1);flex-basis:100%;order:3;justify-content:space-between;margin-right:10px;padding:6px 0}._0RLEhq_waitButton{corner-shape:round;border-radius:999px;min-height:36px;padding:0 12px;font-size:12.5px}._0RLEhq_promptBlock{padding:12px 14px 4px}._0RLEhq_promptCollapsed{max-height:92px;overflow:hidden}._0RLEhq_promptFaded:after{content:"";pointer-events:none;background:linear-gradient(to bottom, transparent, var(--dsw-specific-input-major) 90%);height:32px;position:absolute;inset:auto 0 0}._0RLEhq_promptToggle{min-height:36px;margin-top:8px;padding:4px 12px;font-size:12.5px}._0RLEhq_title{font-size:15px;font-weight:600;line-height:22px}._0RLEhq_detail{margin-top:10px;padding:10px 12px;font-size:13px;line-height:19px}._0RLEhq_options{gap:8px;margin:8px 0 12px;padding:2px 14px}._0RLEhq_option,._0RLEhq_customRow{border-radius:14px;min-height:46px;padding:10px 12px}._0RLEhq_optionLabel{font-size:14px;line-height:20px}._0RLEhq_description{margin-top:2px;font-size:13px;line-height:19px}._0RLEhq_number,._0RLEhq_checkbox{margin-top:1px}._0RLEhq_footer{padding:8px 12px calc(10px + env(safe-area-inset-bottom,0px));gap:6px 8px}._0RLEhq_footerActions{flex-shrink:0;gap:6px}._0RLEhq_footerActions>button{min-height:44px;padding:0 16px;font-size:14px;font-weight:500}._0RLEhq_pager{gap:0}._0RLEhq_progress{padding:0 2px;font-size:12.5px}}@media (prefers-reduced-motion:reduce){._0RLEhq_option,._0RLEhq_customRow,._0RLEhq_iconButton,._0RLEhq_promptToggle{transition:none}}`,document.head.appendChild(e)}var w={badge:`_0RLEhq_badge`,body:`_0RLEhq_body`,card:`_0RLEhq_card`,cardMinimized:`_0RLEhq_cardMinimized`,checkbox:`_0RLEhq_checkbox`,checkboxChecked:`_0RLEhq_checkboxChecked`,customBlock:`_0RLEhq_customBlock`,customInline:`_0RLEhq_customInline`,customRow:`_0RLEhq_customRow`,customRowActive:`_0RLEhq_customRowActive`,description:`_0RLEhq_description`,detail:`_0RLEhq_detail`,eyebrow:`_0RLEhq_eyebrow`,feedback:`_0RLEhq_feedback`,field:`_0RLEhq_field`,fieldInput:`_0RLEhq_fieldInput`,fieldMirror:`_0RLEhq_fieldMirror`,footer:`_0RLEhq_footer`,footerActions:`_0RLEhq_footerActions`,frame:`_0RLEhq_frame`,iconActions:`_0RLEhq_iconActions`,iconButton:`_0RLEhq_iconButton`,minimizedTitle:`_0RLEhq_minimizedTitle`,number:`_0RLEhq_number`,option:`_0RLEhq_option`,optionCopy:`_0RLEhq_optionCopy`,optionLabel:`_0RLEhq_optionLabel`,optionLine:`_0RLEhq_optionLine`,optionSelected:`_0RLEhq_optionSelected`,options:`_0RLEhq_options`,pager:`_0RLEhq_pager`,progress:`_0RLEhq_progress`,promptBlock:`_0RLEhq_promptBlock`,promptCollapsed:`_0RLEhq_promptCollapsed`,promptContent:`_0RLEhq_promptContent`,promptFaded:`_0RLEhq_promptFaded`,promptToggle:`_0RLEhq_promptToggle`,reviewNote:`_0RLEhq_reviewNote`,scrollArea:`_0RLEhq_scrollArea`,statusGroup:`_0RLEhq_statusGroup`,title:`_0RLEhq_title`,topBar:`_0RLEhq_topBar`,topBarLeading:`_0RLEhq_topBarLeading`,waitButton:`_0RLEhq_waitButton`,waitStatus:`_0RLEhq_waitStatus`};let ee={state:`open`,waitState:`counting`,countdown:void 0,channel:`none`,closed:!0};function T(e){let t=/\s*(?:\((?:recommended|推荐)\)|((?:recommended|推荐)))\s*$/i;return t.test(e)?{label:e.replace(t,``),recommended:!0}:{label:e,recommended:!1}}function te(e){let t=e.options?.[0]?.label;return t!==void 0&&T(t).recommended?t:void 0}function ne(e,t){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let n=e;return typeof n.index!=`number`||!Number.isInteger(n.index)||n.index<0||n.index>=t||!Array.isArray(n.drafts)||n.drafts.length!==t||n.wait!==void 0&&n.wait!==`editing`&&n.wait!==`waiting`?!1:n.drafts.every(e=>{if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=e;return Array.isArray(t.selected)&&t.selected.every(e=>typeof e==`string`)&&typeof t.custom==`string`&&typeof t.skipped==`boolean`})}function re(e){return e.nativeEvent.isComposing||Reflect.get(e.nativeEvent,`keyCode`)===229}function E(e){return/* @__PURE__ */ (0,o.jsxs)(`div`,{className:v(w.field,e.variant===`inline`?w.customInline:w.customBlock),children:[/* @__PURE__ */ (0,o.jsx)(`div`,{"aria-hidden":!0,className:w.fieldMirror,children:`${e.value}\n`}),/* @__PURE__ */ (0,o.jsx)(`textarea`,{autoFocus:e.autoFocus,className:w.fieldInput,value:e.value,disabled:e.disabled,rows:1,placeholder:e.placeholder,onFocus:e.onFocus,onChange:e.onChange,onKeyDown:e.onKeyDown})]})}function D(e){let t=e.matched,n=(0,i.useMemo)(()=>l(t.questions),[t]);return n===void 0?/* @__PURE__ */ (0,o.jsx)(O,{pending:t,t:e.t,useStore:e.useStore,useQuestionCard:e.useQuestionCard,actions:e.actions},t.key):/* @__PURE__ */ (0,o.jsx)(S,{pending:t,review:n,t:e.t,renderSlot:e.renderSlot},t.key)}function O({pending:e,t,useStore:n,useQuestionCard:r,actions:s}){let c=e.questions,l=e.review,u=(0,i.useMemo)(()=>({code:{copyLabel:t(`copy`),copiedLabel:t(`copied`),toolbarLabels:{codeLabel:t(`codeBlock.title`),wrapLabel:t(`codeBlock.wrap`),unwrapLabel:t(`codeBlock.unwrap`)}},footnotes:t(`markdown.footnotes`)}),[t]),d=(0,i.useMemo)(()=>{let e=new Map((l??[]).map(e=>[e.id,e]));return c.map(t=>{let n=e.get(t.id),r=n?.custom??``,i=l===void 0?te(t):void 0;return{selected:n===void 0&&i!==void 0?[i]:[...n?.selected??[]],custom:r,skipped:n!==void 0&&n.selected.length===0&&r===``}})},[c,l]),f=n(t=>t.progressByRequest[e.key]),p=ne(f,c.length)?f:void 0,m=l===void 0?p:void 0,h=p?.index??0,g=m?.drafts??d,_=m?.wait??(m?.drafts.some((e,t)=>e.selected.length!==d[t]?.selected.length||e.selected.some((e,n)=>e!==d[t]?.selected[n])||e.custom!==``||e.skipped)===!0?`editing`:void 0),[y,b]=(0,i.useState)(null),[x,S]=(0,i.useState)(null),C=r(e.key,e=>e??ee),D=C.channel!==`none`,O=y!==null||l!==void 0,k=(0,i.useRef)(null);(0,i.useEffect)(()=>{k.current===`waterfall`&&C.state===`continued`&&(k.current=null,b(null),S({key:`error.resubmit`}))},[C.state]),(0,i.useEffect)(()=>{C.closed&&s.clear(e.key)},[s,C.closed,e.key]),(0,i.useEffect)(()=>{s.prune(e.liveKeys())},[s,e]);let A=(0,i.useRef)(_);(0,i.useEffect)(()=>{A.current===`waiting`&&e.takeTime(),A.current===`editing`&&e.engage()},[e]);let j=C.countdown,[M,N]=(0,i.useState)(!1),[P,F]=(0,i.useState)(!1),[I,L]=(0,i.useState)(!1),R=(0,i.useRef)(/* @__PURE__ */ new Set),z=(0,i.useRef)(null),B=(0,i.useRef)(null);(0,i.useLayoutEffect)(()=>{z.current!==null&&(z.current.scrollTop=0),F(!1)},[h]);let V=c[h],H=g[h],U=(V.options?.length??0)>0;(0,i.useLayoutEffect)(()=>{if(M){L(!1);return}let e=B.current;if(e===null)return;let t=()=>{P||L(e.scrollHeight>e.clientHeight+2)};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[M,P,h,V.question,V.detail]),(0,i.useEffect)(()=>{M&&e.releaseFocus()},[M,e]);let W=(t,n)=>{s.replace(e.key,{index:t,drafts:n,...A.current===void 0?{}:{wait:A.current}})},G=()=>{A.current=`waiting`,e.takeTime(),W(h,g)},K=()=>{A.current===void 0&&(A.current=`editing`,e.engage())},q=t=>{t.currentTarget.contains(t.relatedTarget)||e.holdFocus()},J=t=>{t.currentTarget.contains(t.relatedTarget)||e.releaseFocus()};(0,i.useEffect)(()=>{let t=()=>{e.releaseFocus()},n=()=>{A.current===`editing`?e.engage():z.current?.contains(document.activeElement)===!0&&e.holdFocus()},r=()=>{document.hidden?t():n()};return window.addEventListener(`blur`,t),window.addEventListener(`focus`,n),document.addEventListener(`visibilitychange`,r),()=>{t(),window.removeEventListener(`blur`,t),window.removeEventListener(`focus`,n),document.removeEventListener(`visibilitychange`,r)}},[e]);let Y=()=>{e.dismissal===`hide`?e.dismiss():D?(b(`cancel`),S(null),k.current=`waterfall`,e.dismiss().catch(e=>{k.current=null,b(null),S({text:e instanceof Error?e.message:String(e)})})):S({key:`error.unavailable`})},ie=(e,t=h)=>{K();let n=g.map((t,n)=>n===h?e(t):t);W(t,n),S(null)},ae=e=>{ie(t=>{if(V.multiSelect===!0){let n=t.selected.includes(e)?t.selected.filter(t=>t!==e):[...t.selected,e];return{...t,selected:n,skipped:!1}}return{selected:[e],custom:``,skipped:!1}},V.multiSelect!==!0&&h<c.length-1?h+1:h)},X=e=>e.selected.length>0||e.custom.trim()!==``,oe=e=>X(e)||e.skipped,Z=t=>{let n=t.findIndex(e=>!oe(e));if(n>=0){W(n,t),S({key:`error.incomplete`});return}if(!D){S({key:`error.unavailable`});return}let r={answers:c.map((e,n)=>{let r=t[n];if(r.skipped)return{id:e.id,selected:[]};let i=r.custom.trim();return{id:e.id,selected:i===``||e.multiSelect===!0?r.selected:[],...i===``?{}:{custom:i}}})};b(`answer`),S(null);let i=e.snapshot().channel;k.current=i===`waterfall`?`waterfall`:null,e.answer(r).then(()=>{i===`rpc`&&(k.current=null,b(null),S(null),e.dismiss().catch(()=>{S({key:`status.sent`})}))}).catch(e=>{k.current=null,b(null),S({text:e instanceof Error?e.message:String(e)})})},se=()=>{X(H)?h<c.length-1?(W(h+1,g),S(null)):Z(g):S({key:`error.unanswered`})},ce=e=>{let t=e.target.value;ie(e=>({...e,selected:V.multiSelect===!0?e.selected:[],custom:t,skipped:!1}))},le=e=>{e.key!==`Enter`||e.shiftKey||re(e)||(e.preventDefault(),se())},ue=()=>{K();let e=g.map((e,t)=>t===h?{selected:[],custom:``,skipped:!0}:e);W(h<c.length-1?h+1:h,e),S(null),!(h<c.length-1)&&Z(e)},Q=j!==void 0&&C.waitState!==`waiting`&&C.waitState!==`editing`&&C.waitState!==`continued`,de=j!==void 0&&(C.waitState===`waiting`||C.waitState===`editing`),fe=Q||C.state===`continued`||de||l!==void 0,$=`question-${e.key}-${String(h)}`;return/* @__PURE__ */ (0,o.jsx)(`div`,{className:w.frame,"data-question-key":e.key,children:/* @__PURE__ */ (0,o.jsxs)(`section`,{className:v(w.card,M&&w.cardMinimized),"aria-labelledby":$,children:[/* @__PURE__ */ (0,o.jsxs)(`header`,{className:w.topBar,children:[/* @__PURE__ */ (0,o.jsxs)(`div`,{className:w.topBarLeading,children:[V.header!==void 0&&/* @__PURE__ */ (0,o.jsx)(`div`,{className:w.eyebrow,children:V.header}),M&&/* @__PURE__ */ (0,o.jsx)(`h2`,{className:w.minimizedTitle,id:$,children:V.question})]}),fe&&/* @__PURE__ */ (0,o.jsxs)(`div`,{className:w.statusGroup,children:[Q&&/* @__PURE__ */ (0,o.jsx)(`span`,{className:w.waitStatus,children:t(j.running?`wait.countdown`:`wait.paused`,{seconds:Math.ceil(j.remainingMs/1e3)})}),Q&&/* @__PURE__ */ (0,o.jsx)(a.Button,{variant:`outline`,size:`sm`,className:w.waitButton,onClick:G,children:t(`wait.takeTime`)}),C.state===`continued`&&/* @__PURE__ */ (0,o.jsx)(`span`,{className:w.waitStatus,children:t(`wait.continued`)}),de&&/* @__PURE__ */ (0,o.jsx)(`span`,{className:w.waitStatus,children:t(`wait.held`)}),l!==void 0&&/* @__PURE__ */ (0,o.jsx)(`span`,{className:w.waitStatus,children:t(`review.status`)})]}),/* @__PURE__ */ (0,o.jsxs)(`div`,{className:w.iconActions,children:[/* @__PURE__ */ (0,o.jsx)(`button`,{type:`button`,className:w.iconButton,"aria-label":t(M?`nav.maximize`:`nav.minimize`),title:t(M?`nav.maximize`:`nav.minimize`),"aria-expanded":!M,disabled:y!==null,onClick:()=>{N(e=>!e)},children:M?/* @__PURE__ */ (0,o.jsx)(a.IconChevronUpOutlineRegular,{}):/* @__PURE__ */ (0,o.jsx)(a.IconChevronDownOutlineRegular,{})}),/* @__PURE__ */ (0,o.jsx)(`button`,{type:`button`,className:w.iconButton,"aria-label":t(e.dismissal===`hide`?`nav.close`:`nav.cancel`),title:t(e.dismissal===`hide`?`nav.close`:`nav.cancel`),disabled:y!==null,onClick:Y,children:/* @__PURE__ */ (0,o.jsx)(a.IconCloseOutlineRegular,{})})]})]}),!M&&/* @__PURE__ */ (0,o.jsx)(`div`,{ref:z,className:w.scrollArea,"data-question-scroll":!0,tabIndex:0,onFocusCapture:q,onBlurCapture:J,children:/* @__PURE__ */ (0,o.jsxs)(`div`,{className:w.body,children:[/* @__PURE__ */ (0,o.jsxs)(`div`,{className:w.promptBlock,children:[/* @__PURE__ */ (0,o.jsxs)(`div`,{ref:B,className:v(w.promptContent,!P&&w.promptCollapsed,!P&&I&&w.promptFaded),children:[/* @__PURE__ */ (0,o.jsx)(`h2`,{className:w.title,id:$,children:V.question}),V.detail!==void 0&&/* @__PURE__ */ (0,o.jsx)(`div`,{className:w.detail,children:/* @__PURE__ */ (0,o.jsx)(a.MarkdownText,{text:V.detail,labels:u})})]}),(I||P)&&/* @__PURE__ */ (0,o.jsxs)(`button`,{type:`button`,className:w.promptToggle,"aria-expanded":P,onClick:()=>{F(e=>!e)},children:[/* @__PURE__ */ (0,o.jsx)(`span`,{children:t(P?`prompt.collapse`:`prompt.expand`)}),P?/* @__PURE__ */ (0,o.jsx)(a.IconChevronUpOutlineRegular,{size:14}):/* @__PURE__ */ (0,o.jsx)(a.IconChevronDownOutlineRegular,{size:14})]})]}),/* @__PURE__ */ (0,o.jsxs)(`div`,{className:w.options,role:V.multiSelect===!0?`group`:`radiogroup`,children:[(V.options??[]).map((e,n)=>{let r=H.selected.includes(e.label),i=T(e.label);return/* @__PURE__ */ (0,o.jsxs)(`button`,{type:`button`,className:v(w.option,r&&w.optionSelected),role:V.multiSelect===!0?`checkbox`:`radio`,"aria-checked":r,"aria-label":i.label,disabled:O,onClick:()=>{ae(e.label)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),Z(g))},children:[V.multiSelect===!0?/* @__PURE__ */ (0,o.jsx)(`span`,{className:v(w.checkbox,r&&w.checkboxChecked),"aria-hidden":`true`,children:r&&/* @__PURE__ */ (0,o.jsx)(a.IconCheckOutlineRegular,{size:12})}):/* @__PURE__ */ (0,o.jsx)(`span`,{className:w.number,children:n+1}),/* @__PURE__ */ (0,o.jsx)(`span`,{className:w.optionCopy,children:/* @__PURE__ */ (0,o.jsxs)(`span`,{className:w.optionLine,children:[/* @__PURE__ */ (0,o.jsx)(`span`,{className:w.optionLabel,children:i.label}),i.recommended&&/* @__PURE__ */ (0,o.jsx)(`span`,{className:w.badge,children:t(`option.recommended`)}),e.description!==void 0&&/* @__PURE__ */ (0,o.jsx)(`span`,{className:w.description,children:e.description})]})})]},`${e.label}-${String(n)}`)}),l!==void 0&&H.skipped&&/* @__PURE__ */ (0,o.jsx)(`p`,{className:w.reviewNote,children:t(`review.skipped`)}),(!U||V.allowOther!==!1)&&(l===void 0||H.custom!==``)&&(U?/* @__PURE__ */ (0,o.jsxs)(`div`,{className:v(w.customRow,H.custom!==``&&w.customRowActive),children:[V.multiSelect===!0?/* @__PURE__ */ (0,o.jsx)(`span`,{className:v(w.checkbox,H.custom!==``&&w.checkboxChecked),"aria-hidden":`true`,children:H.custom!==``&&/* @__PURE__ */ (0,o.jsx)(a.IconCheckOutlineRegular,{size:12})}):/* @__PURE__ */ (0,o.jsx)(`span`,{className:w.number,"aria-hidden":`true`,children:/* @__PURE__ */ (0,o.jsx)(a.IconEditOutlineRegular,{size:12})}),/* @__PURE__ */ (0,o.jsx)(E,{variant:`inline`,value:H.custom,disabled:O,placeholder:t(`custom.placeholder`),onChange:ce,onKeyDown:le})]}):/* @__PURE__ */ (0,o.jsx)(E,{autoFocus:D&&j===void 0&&!O&&!R.current.has(h),variant:`block`,value:H.custom,disabled:O,placeholder:t(`custom.placeholder`),onFocus:()=>{R.current.add(h)},onChange:ce,onKeyDown:le}))]})]})}),!M&&/* @__PURE__ */ (0,o.jsxs)(`footer`,{className:w.footer,children:[c.length>1&&/* @__PURE__ */ (0,o.jsxs)(`div`,{className:w.pager,children:[/* @__PURE__ */ (0,o.jsx)(`button`,{type:`button`,className:w.iconButton,"aria-label":t(`nav.prev`),disabled:h===0||y!==null,onClick:()=>{W(h-1,g),S(null)},children:/* @__PURE__ */ (0,o.jsx)(a.IconChevronLeftOutlineRegular,{})}),/* @__PURE__ */ (0,o.jsxs)(`span`,{className:w.progress,children:[h+1,` / `,c.length]}),/* @__PURE__ */ (0,o.jsx)(`button`,{type:`button`,className:w.iconButton,"aria-label":t(`nav.next`),disabled:h===c.length-1||y!==null,onClick:()=>{W(h+1,g),S(null)},children:/* @__PURE__ */ (0,o.jsx)(a.IconChevronRightOutlineRegular,{})})]}),/* @__PURE__ */ (0,o.jsx)(`div`,{className:w.feedback,role:`status`,children:x===null?null:`key`in x?t(x.key):x.text}),l===void 0&&/* @__PURE__ */ (0,o.jsxs)(`div`,{className:w.footerActions,children:[/* @__PURE__ */ (0,o.jsx)(a.Button,{variant:`ghost`,disabled:y!==null,onClick:ue,children:t(`action.skip`)}),/* @__PURE__ */ (0,o.jsx)(a.Button,{variant:`primary`,disabled:y!==null||!X(H)||h===c.length-1&&!D,onClick:se,children:y===`answer`?t(`submitting`):h===c.length-1?t(`submit`):t(`action.next`)})]})]})]})})}let k=/* @__PURE__ */ new Set([`system/message`,`developer/message`,`user/message`,`assistant/message`,`tool/result`]);function A(e){return k.has(e.type)?e.surfaceOp!==void 0:!1}function j(e){return A(e)&&e.surfaceOp===`append`}function M(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function N(e){let t;try{t=JSON.parse(e)}catch{return{questions:[],answers:[]}}if(!M(t)||!Array.isArray(t.questions))return{questions:[],answers:[]};let n=[];for(let e of t.questions)M(e)&&typeof e.id==`string`&&typeof e.question==`string`&&n.push({id:e.id,question:e.question,...typeof e.detail==`string`?{detail:e.detail}:{},...typeof e.header==`string`?{header:e.header}:{},...Array.isArray(e.options)?{options:e.options.flatMap(e=>!M(e)||typeof e.label!=`string`?[]:[{label:e.label,...typeof e.description==`string`?{description:e.description}:{}}])}:{},...typeof e.multiSelect==`boolean`?{multiSelect:e.multiSelect}:{}});let r=[];for(let e of Array.isArray(t.answers)?t.answers:[])M(e)&&typeof e.id==`string`&&Array.isArray(e.selected)&&r.push({id:e.id,selected:e.selected.filter(e=>typeof e==`string`),...typeof e.custom==`string`?{custom:e.custom}:{}});return{questions:n,answers:r}}function P(e,t){let n=e.answers.find(e=>e.id===t),r=n?.custom?.trim()??``;return[...n?.selected??[],...r===``?[]:[r]]}function F(e,t){return e.questions.length===0?e.text:e.questions.map(n=>{let r=P(e,n.id);return`${n.header&&n.header!==n.question?`${n.header} — ${n.question}`:n.question}\n${r.length===0?t(`reply.skipped`):`${t(`reply.answerLabel`)}${r.join(`, `)}`}`}).join(`
|
|
3
|
+
e!==void 0&&(Date.now()>=e?this.timeout():this.publish())}attachWaterfall(e){this.#t=e,this.#i=e.deadline!==void 0,!this.#u&&!this.#l&&(this.#o=e.deadline,this.#c&&e.deadline!==void 0&&(this.#s=Math.max(0,e.deadline-Date.now()),this.#o=void 0)),this.publish()}detachWaterfall(e){this.#t===e&&(this.#t=void 0,this.#i=!1,this.#o=void 0,this.publish())}hasWaterfall(){return this.#t!==void 0}attachRpc(e){this.#n=e,this.publish()}attachSeat(e){this.#r=e}setState(e){this.#e!==e&&(this.#e=e,this.publish())}takeTime(){this.#u||(this.#u=!0,this.#c=!1,this.#s=void 0,this.#o=void 0,this.publish())}holdFocus(e=Date.now()){this.#u||this.#l||this.#c||(this.#s=this.#o===void 0?void 0:Math.max(0,this.#o-e),this.#o=void 0,this.#c=!0,this.publish())}releaseFocus(e=Date.now()){this.#c&&(this.#c=!1,this.#o=this.#i&&this.#s!==void 0?e+this.#s:void 0,this.#s=void 0,this.publish())}engage(e=Date.now()){this.#u||this.#l||(this.#s===void 0&&this.#o!==void 0&&(this.#s=Math.max(0,this.#o-e)),this.#l=!0,this.#c=!1,this.#o=void 0,this.publish())}timeout(){if(this.#u||this.#l||this.#c)return;let e=this.#t;e!==void 0&&(this.#t=void 0,this.#i=!1,this.#o=void 0,e.reject(`ASK_TIMED_OUT`),this.publish())}delegate(){this.#t?.delegate()}close(){this.#d||(this.#d=!0,this.publish())}answer(e){let t=this.#t;if(t!==void 0)return c(()=>{t.resolve(e)},`pending question settlement failed`);let n=this.#n;return this.#e===`continued`&&n!==void 0?n.answer(e).then(e=>{if(!e)throw Error(`this question is no longer answerable`)}):Promise.reject(/* @__PURE__ */ Error(`no channel accepts an answer yet`))}dismiss(){if(this.dismissal===`hide`)return c(()=>{this.#r?.hide()},`pending question hide failed`);let e=this.#t;return e===void 0?Promise.reject(/* @__PURE__ */ Error(`no channel accepts a cancellation yet`)):c(()=>{e.reject(`ASK_CANCELLED`)},`pending question cancellation failed`)}};function _(){return(0,r.defineStore)({init:()=>({progressByRequest:{}}),persist:`dsh.user-questions.drafts.v1`,actions:{replace:(e,t,n)=>{e.progressByRequest[t]=n},clear:(e,t)=>{e.progressByRequest=Object.fromEntries(Object.entries(e.progressByRequest).filter(([e])=>e!==t))},prune:(e,t)=>{let n=new Set(t);e.progressByRequest=Object.fromEntries(Object.entries(e.progressByRequest).filter(([e])=>n.has(e)))}}})}function v(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=v(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function y(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=v(e))&&(r&&(r+=` `),r+=t);return r}function b({pending:e,review:t,t:n}){let[r,s]=(0,i.useState)(!1),[c,l]=(0,i.useState)(null),u=(0,i.useMemo)(()=>t.actions.map((e,t)=>({id:`${String(t)}:${e.label}`,label:e.label,effect:e.effect,...e.description===void 0?{}:{tooltip:e.description}})),[t.actions]);return/* @__PURE__ */ (0,o.jsx)(a.ApprovalCard,{cardKey:e.key,headline:t.question,meta:t.toolLabel,command:t.command,files:t.files,detail:t.detail,actions:u,busy:r,error:c,onAction:i=>{if(r)return;s(!0),l(null);let a=e.snapshot().channel===`rpc`;e.answer({answers:[{id:t.id,selected:[i.label]}]}).then(()=>{a&&(s(!1),e.dismiss().catch(()=>{l(n(`status.sent`))}))}).catch(e=>{s(!1),l(e instanceof Error?e.message:String(e))})},labels:{detailAria:n(`approval.detailAria`),expand:n(`approval.expand`),collapse:n(`approval.collapse`),moreOptions:n(`approval.moreOptions`),categoryTerminal:n(`approval.categoryTerminal`),categoryFiles:n(`approval.categoryFiles`),categoryPermission:n(`approval.categoryPermission`)}})}let x=`@deepseek-ai/dsh-client-ui-user-questions/PlanReviewPanel.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(x)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-user-questions`,e.dataset.pluginCss=x,e.textContent=`.iuO8HG_frame{padding:6px calc(var(--dsh-composer-side-clearance) + 16px) 10px;justify-content:center;display:flex}.iuO8HG_card{width:100%;max-width:var(--dsh-chat-content-width);--dsw-elevation-stroke-color:var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-xl);background:var(--dsw-specific-input-major);box-shadow:var(--dsw-elevation-panel);color:var(--dsw-alias-label-primary);border:0;flex-direction:column;display:flex;overflow:hidden}.iuO8HG_card,.iuO8HG_card *{box-sizing:border-box}.iuO8HG_strip{background:var(--dsw-alias-state-warn-tertiary);color:var(--dsw-alias-state-warn-primary);flex-shrink:0;align-items:center;gap:8px;padding:12px 16px;font-size:14px;line-height:20px;display:flex}.iuO8HG_footer{flex-shrink:0;justify-content:space-between;align-items:center;gap:12px;padding:8px 16px 12px;display:flex}.iuO8HG_feedback{min-height:16px;color:var(--dsw-alias-state-error-primary);font-size:11px;line-height:16px}.iuO8HG_actions{flex-shrink:0;align-items:center;gap:8px;display:flex}.iuO8HG_summary{min-width:0;padding:14px 16px 12px}.iuO8HG_title{text-overflow:ellipsis;white-space:nowrap;margin:0;font-size:15px;font-weight:500;line-height:22px;overflow:hidden}.iuO8HG_description{-webkit-line-clamp:2;color:var(--dsw-alias-label-secondary);-webkit-box-orient:vertical;margin:8px 0 0;font-size:14px;line-height:24px;display:-webkit-box;overflow:hidden}.iuO8HG_discuss{gap:6px}@media (width<=720px){.iuO8HG_card{border-radius:var(--dsw-radius-xl)}.iuO8HG_footer{align-items:flex-end;padding:8px 12px 10px}}.iuO8HG_previewActions{align-items:center;margin-left:auto;display:flex}`,document.head.appendChild(e)}var S={actions:`iuO8HG_actions`,card:`iuO8HG_card`,description:`iuO8HG_description`,discuss:`iuO8HG_discuss`,feedback:`iuO8HG_feedback`,footer:`iuO8HG_footer`,frame:`iuO8HG_frame`,previewActions:`iuO8HG_previewActions`,strip:`iuO8HG_strip`,summary:`iuO8HG_summary`,title:`iuO8HG_title`};function C(e){return e===void 0?{}:{title:e}}function w({pending:e,review:t,t:n,renderSlot:r}){let[s,c]=(0,i.useState)(!1),[l,u]=(0,i.useState)(null),d=(t,r=!1)=>{c(!0),u(null),t().then(()=>{r&&(c(!1),e.dismiss().catch(()=>{u(n(`status.sent`))}))}).catch(e=>{c(!1),u(e instanceof Error?e.message:String(e))})},f=n=>{d(()=>e.answer({answers:[{id:t.id,selected:[n]}]}),e.snapshot().channel===`rpc`)},p=(0,i.useMemo)(()=>{let e=(0,a.extractMarkdownPlainText)(t.plan,{mode:`first-line`}),n=(0,a.extractMarkdownPlainText)(t.plan,{mode:`first-paragraph`});return{title:e,description:n===e?``:n}},[t.plan]);return/* @__PURE__ */ (0,o.jsx)(`div`,{className:S.frame,"data-plan-review-key":e.key,children:/* @__PURE__ */ (0,o.jsxs)(`section`,{className:S.card,"aria-label":t.question,"aria-busy":s,children:[/* @__PURE__ */ (0,o.jsxs)(`div`,{className:S.strip,children:[/* @__PURE__ */ (0,o.jsx)(a.StateDot,{state:s?`ongoing`:`warning`}),n(`plan.header`),/* @__PURE__ */ (0,o.jsx)(`div`,{className:S.previewActions,children:r(`conversation.plan-review.actions`,{review:t,requestKey:e.key})})]}),/* @__PURE__ */ (0,o.jsxs)(`div`,{className:S.summary,children:[/* @__PURE__ */ (0,o.jsx)(`h3`,{className:S.title,children:p.title}),p.description!==``&&/* @__PURE__ */ (0,o.jsx)(`p`,{className:S.description,children:p.description})]}),/* @__PURE__ */ (0,o.jsxs)(`div`,{className:S.footer,children:[/* @__PURE__ */ (0,o.jsx)(`div`,{className:S.feedback,role:`status`,children:l}),/* @__PURE__ */ (0,o.jsxs)(`div`,{className:S.actions,children:[/* @__PURE__ */ (0,o.jsx)(a.Button,{variant:`outline`,className:S.discuss,icon:/* @__PURE__ */ (0,o.jsx)(a.IconEditOutlineRegular,{size:14}),disabled:s,onClick:()=>{d(()=>e.dismiss())},children:n(`plan.discuss`)}),/* @__PURE__ */ (0,o.jsx)(a.Button,{variant:`primary`,...C(t.approve.description),disabled:s,onClick:()=>{f(t.approve.label)},children:n(`plan.approve`)})]})]})]})})}let T=`@deepseek-ai/dsh-client-ui-user-questions/QuestionComposer.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(T)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-user-questions`,e.dataset.pluginCss=T,e.textContent=`._0RLEhq_frame{padding:6px calc(var(--dsh-composer-side-clearance) + 16px) 10px;justify-content:center;display:flex}._0RLEhq_card{width:100%;max-width:var(--dsh-chat-content-width);--dsw-elevation-stroke-color:var(--dsw-alias-border-l2-darkmode-thin);border-radius:var(--dsw-radius-xl);background:var(--dsw-specific-input-major);min-width:0;max-height:min(60dvh,520px);box-shadow:var(--dsw-elevation-panel);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:0;flex-direction:column;padding:0;display:flex;overflow:hidden}._0RLEhq_card,._0RLEhq_card *{box-sizing:border-box}._0RLEhq_topBar{flex-wrap:wrap;flex-shrink:0;align-items:center;gap:8px 12px;padding:12px 16px 4px 20px;display:flex}._0RLEhq_cardMinimized ._0RLEhq_topBar{padding-bottom:14px}._0RLEhq_topBarLeading{flex-direction:column;flex:1 1 0;gap:2px;min-width:0;display:flex}._0RLEhq_eyebrow{color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:16px;overflow:hidden}._0RLEhq_minimizedTitle{text-overflow:ellipsis;white-space:nowrap;margin:0;font-size:15px;font-weight:500;line-height:21px;overflow:hidden}._0RLEhq_statusGroup{flex-shrink:0;align-items:center;gap:8px;display:flex}._0RLEhq_iconActions{flex-shrink:0;align-items:center;gap:4px;display:flex}._0RLEhq_waitButton{white-space:nowrap;touch-action:manipulation;user-select:none;-webkit-tap-highlight-color:transparent}._0RLEhq_waitStatus{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-size:12px;line-height:20px}._0RLEhq_scrollArea{overscroll-behavior:contain;flex:auto;min-height:0;overflow-y:auto}._0RLEhq_scrollArea:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}._0RLEhq_body{flex-direction:column;display:flex}._0RLEhq_promptBlock{flex-direction:column;padding:2px 20px 0;display:flex}._0RLEhq_promptContent{overflow-wrap:anywhere;min-width:0;position:relative}._0RLEhq_title{margin:0;font-size:16px;font-weight:500;line-height:22px}._0RLEhq_detail{border:1px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-module-platform);min-width:0;color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere;margin-top:10px;padding:10px 12px;font-size:13px;line-height:20px}._0RLEhq_detail pre{white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%}._0RLEhq_promptToggle{corner-shape:round;background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-state-business-primary);font:inherit;cursor:pointer;touch-action:manipulation;user-select:none;-webkit-tap-highlight-color:transparent;border:0;border-radius:999px;align-self:flex-start;align-items:center;gap:4px;margin-top:6px;padding:4px 10px;font-size:12px;font-weight:500;line-height:18px;transition:background-color .12s;display:inline-flex}._0RLEhq_promptToggle:active{background:var(--dsw-alias-interactive-bg-active)}._0RLEhq_promptToggle:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}._0RLEhq_footerActions{flex-shrink:0;align-items:center;gap:8px;margin-left:auto;display:flex}._0RLEhq_pager{flex-shrink:0;align-items:center;gap:2px;display:flex}._0RLEhq_progress{color:var(--dsw-alias-label-secondary);white-space:nowrap;font-variant-numeric:tabular-nums;word-spacing:-2px;padding:0 4px;font-size:12px;font-weight:400;line-height:24px}._0RLEhq_iconButton{corner-shape:round;width:24px;height:24px;color:var(--dsw-alias-label-tertiary);cursor:pointer;touch-action:manipulation;user-select:none;-webkit-tap-highlight-color:transparent;background:0 0;border:none;border-radius:999px;place-items:center;padding:0;transition:background-color .12s,color .12s;display:grid}._0RLEhq_iconButton:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active);color:var(--dsw-alias-label-primary)}._0RLEhq_iconButton:focus-visible,._0RLEhq_option:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}._0RLEhq_iconButton:disabled{color:var(--dsw-alias-label-dimmed);cursor:default}._0RLEhq_options{flex-direction:column;gap:6px;margin:12px 0;padding:2px 20px;display:flex}._0RLEhq_option{border:1px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md);width:100%;min-height:44px;color:inherit;text-align:left;cursor:pointer;touch-action:manipulation;user-select:none;-webkit-tap-highlight-color:transparent;background:0 0;flex-shrink:0;align-items:flex-start;gap:8px;padding:9px 12px;transition:background-color .12s,border-color .12s,transform .1s;display:flex}._0RLEhq_optionSelected{background:var(--dsw-alias-interactive-bg-hover);border-color:var(--dsw-alias-label-secondary)}._0RLEhq_option:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active)}._0RLEhq_optionSelected ._0RLEhq_number{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-label-primary-foreground)}._0RLEhq_option:disabled{cursor:default}._0RLEhq_number{border-radius:var(--dsw-radius-xs);background:var(--dsw-alias-bg-overlay);width:20px;height:20px;color:var(--dsw-alias-label-secondary);flex:0 0 20px;place-items:center;margin-top:2px;font-size:12px;font-weight:500;line-height:18px;display:grid}._0RLEhq_checkbox{flex:0 0 20px;place-items:center;width:20px;height:20px;margin-top:2px;display:grid}._0RLEhq_checkbox:before{content:"";border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-xs);grid-area:1/1;width:14px;height:14px;transition:background-color .12s,border-color .12s}._0RLEhq_checkbox>svg{grid-area:1/1}._0RLEhq_checkboxChecked{color:var(--dsw-alias-label-primary-foreground)}._0RLEhq_checkboxChecked:before{border-color:var(--dsw-alias-label-primary);background:var(--dsw-alias-label-primary)}._0RLEhq_optionCopy{overflow-wrap:anywhere;flex:1;min-width:0}._0RLEhq_optionLine{flex-wrap:wrap;align-items:baseline;gap:2px 6px;display:flex}._0RLEhq_optionLabel{font-size:14px;font-weight:500;line-height:24px}._0RLEhq_badge{border-radius:var(--dsw-radius-xs);background:var(--dsw-specific-sidebar-nav-item-active-accent);color:var(--dsw-alias-button-info-fill);padding:0 4px;font-size:11px;font-weight:600;line-height:18px}._0RLEhq_description{color:var(--dsw-alias-label-tertiary);flex-basis:100%;font-size:14px;font-weight:400;line-height:24px}._0RLEhq_reviewNote{color:var(--dsw-alias-label-tertiary);margin:0;padding:8px 12px;font-size:14px;line-height:24px}._0RLEhq_customRow{border:1px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md);flex-shrink:0;align-items:flex-start;gap:8px;width:100%;min-height:44px;padding:9px 12px;transition:background-color .12s,border-color .12s;display:flex}._0RLEhq_customRow:focus-within,._0RLEhq_customRowActive{background:var(--dsw-alias-interactive-bg-hover);border-color:var(--dsw-alias-border-l2)}._0RLEhq_field{--dsh-answer-field-padding:0;min-width:0;display:grid}._0RLEhq_field>*{min-width:0;padding:var(--dsh-answer-field-padding);font:inherit;white-space:pre-wrap;word-break:break-word;overflow-wrap:anywhere;grid-area:1/1;font-size:14px;line-height:24px}._0RLEhq_fieldMirror{box-sizing:content-box;visibility:hidden;max-height:144px;overflow:hidden}._0RLEhq_fieldInput{resize:none;color:var(--dsw-alias-label-primary);caret-color:var(--dsw-alias-state-business-primary);background:0 0;border:none;outline:none;overflow-y:auto}._0RLEhq_fieldInput::placeholder{color:var(--dsw-alias-label-caption)}._0RLEhq_customInline{flex:1}._0RLEhq_customBlock{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-module-platform);--dsh-answer-field-padding:8px 12px;flex-shrink:0;min-height:64px;margin:0}._0RLEhq_customBlock:focus-within{border-color:var(--dsw-alias-state-business-primary)}._0RLEhq_footer{border-top:1px solid var(--dsw-alias-border-l2);flex-wrap:wrap;flex-shrink:0;justify-content:space-between;align-items:center;gap:8px 12px;padding:10px 16px;display:flex}._0RLEhq_feedback{min-width:0;color:var(--dsw-alias-state-error-primary);overflow-wrap:anywhere;flex-basis:100%;order:-1;font-size:11px;line-height:16px}._0RLEhq_feedback:empty{display:none}@media (hover:hover) and (pointer:fine){._0RLEhq_iconButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}._0RLEhq_option:hover:not(:disabled),._0RLEhq_customRow:hover,._0RLEhq_promptToggle:hover{background:var(--dsw-alias-interactive-bg-hover)}}@media (pointer:coarse){._0RLEhq_field>*{font-size:16px;line-height:24px}._0RLEhq_iconButton{width:44px;height:44px}}@media (width<=720px){._0RLEhq_frame{padding:4px 8px 8px}._0RLEhq_card{border-radius:22px;max-width:100%;max-height:min(78dvh,640px)}._0RLEhq_topBar{border-bottom:1px solid var(--dsw-alias-border-l1);gap:0 4px;padding:4px 4px 4px 14px}._0RLEhq_cardMinimized ._0RLEhq_topBar{border-bottom:none;padding-bottom:4px}._0RLEhq_eyebrow{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:600;line-height:18px}._0RLEhq_iconButton{width:44px;height:44px}._0RLEhq_statusGroup{border-top:1px solid var(--dsw-alias-border-l1);flex-basis:100%;order:3;justify-content:space-between;margin-right:10px;padding:6px 0}._0RLEhq_waitButton{corner-shape:round;border-radius:999px;min-height:36px;padding:0 12px;font-size:12.5px}._0RLEhq_promptBlock{padding:12px 14px 4px}._0RLEhq_promptCollapsed{max-height:92px;overflow:hidden}._0RLEhq_promptFaded:after{content:"";pointer-events:none;background:linear-gradient(to bottom, transparent, var(--dsw-specific-input-major) 90%);height:32px;position:absolute;inset:auto 0 0}._0RLEhq_promptToggle{min-height:36px;margin-top:8px;padding:4px 12px;font-size:12.5px}._0RLEhq_title{font-size:15px;font-weight:600;line-height:22px}._0RLEhq_detail{margin-top:10px;padding:10px 12px;font-size:13px;line-height:19px}._0RLEhq_options{gap:8px;margin:8px 0 12px;padding:2px 14px}._0RLEhq_option,._0RLEhq_customRow{border-radius:14px;min-height:46px;padding:10px 12px}._0RLEhq_optionLabel{font-size:14px;line-height:20px}._0RLEhq_description{margin-top:2px;font-size:13px;line-height:19px}._0RLEhq_number,._0RLEhq_checkbox{margin-top:1px}._0RLEhq_footer{padding:8px 12px calc(10px + env(safe-area-inset-bottom,0px));gap:6px 8px}._0RLEhq_footerActions{flex-shrink:0;gap:6px}._0RLEhq_footerActions>button{min-height:44px;padding:0 16px;font-size:14px;font-weight:500}._0RLEhq_pager{gap:0}._0RLEhq_progress{padding:0 2px;font-size:12.5px}}@media (prefers-reduced-motion:reduce){._0RLEhq_option,._0RLEhq_customRow,._0RLEhq_iconButton,._0RLEhq_promptToggle{transition:none}}`,document.head.appendChild(e)}var E={badge:`_0RLEhq_badge`,body:`_0RLEhq_body`,card:`_0RLEhq_card`,cardMinimized:`_0RLEhq_cardMinimized`,checkbox:`_0RLEhq_checkbox`,checkboxChecked:`_0RLEhq_checkboxChecked`,customBlock:`_0RLEhq_customBlock`,customInline:`_0RLEhq_customInline`,customRow:`_0RLEhq_customRow`,customRowActive:`_0RLEhq_customRowActive`,description:`_0RLEhq_description`,detail:`_0RLEhq_detail`,eyebrow:`_0RLEhq_eyebrow`,feedback:`_0RLEhq_feedback`,field:`_0RLEhq_field`,fieldInput:`_0RLEhq_fieldInput`,fieldMirror:`_0RLEhq_fieldMirror`,footer:`_0RLEhq_footer`,footerActions:`_0RLEhq_footerActions`,frame:`_0RLEhq_frame`,iconActions:`_0RLEhq_iconActions`,iconButton:`_0RLEhq_iconButton`,minimizedTitle:`_0RLEhq_minimizedTitle`,number:`_0RLEhq_number`,option:`_0RLEhq_option`,optionCopy:`_0RLEhq_optionCopy`,optionLabel:`_0RLEhq_optionLabel`,optionLine:`_0RLEhq_optionLine`,optionSelected:`_0RLEhq_optionSelected`,options:`_0RLEhq_options`,pager:`_0RLEhq_pager`,progress:`_0RLEhq_progress`,promptBlock:`_0RLEhq_promptBlock`,promptCollapsed:`_0RLEhq_promptCollapsed`,promptContent:`_0RLEhq_promptContent`,promptFaded:`_0RLEhq_promptFaded`,promptToggle:`_0RLEhq_promptToggle`,reviewNote:`_0RLEhq_reviewNote`,scrollArea:`_0RLEhq_scrollArea`,statusGroup:`_0RLEhq_statusGroup`,title:`_0RLEhq_title`,topBar:`_0RLEhq_topBar`,topBarLeading:`_0RLEhq_topBarLeading`,waitButton:`_0RLEhq_waitButton`,waitStatus:`_0RLEhq_waitStatus`};let ee={state:`open`,waitState:`counting`,countdown:void 0,channel:`none`,closed:!0};function D(e){let t=/\s*(?:\((?:recommended|推荐)\)|((?:recommended|推荐)))\s*$/i;return t.test(e)?{label:e.replace(t,``),recommended:!0}:{label:e,recommended:!1}}function te(e){let t=e.options?.[0]?.label;return t!==void 0&&D(t).recommended?t:void 0}function ne(e,t){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let n=e;return typeof n.index!=`number`||!Number.isInteger(n.index)||n.index<0||n.index>=t||!Array.isArray(n.drafts)||n.drafts.length!==t||n.wait!==void 0&&n.wait!==`editing`&&n.wait!==`waiting`?!1:n.drafts.every(e=>{if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=e;return Array.isArray(t.selected)&&t.selected.every(e=>typeof e==`string`)&&typeof t.custom==`string`&&typeof t.skipped==`boolean`})}function re(e){return e.nativeEvent.isComposing||Reflect.get(e.nativeEvent,`keyCode`)===229}function O(e){return/* @__PURE__ */ (0,o.jsxs)(`div`,{className:y(E.field,e.variant===`inline`?E.customInline:E.customBlock),children:[/* @__PURE__ */ (0,o.jsx)(`div`,{"aria-hidden":!0,className:E.fieldMirror,children:`${e.value}\n`}),/* @__PURE__ */ (0,o.jsx)(`textarea`,{autoFocus:e.autoFocus,className:E.fieldInput,value:e.value,disabled:e.disabled,rows:1,placeholder:e.placeholder,onFocus:e.onFocus,onChange:e.onChange,onKeyDown:e.onKeyDown})]})}function k(e){let t=e.matched,n=(0,i.useMemo)(()=>l(t.questions),[t]),r=(0,i.useMemo)(()=>u(t.questions),[t]);return n===void 0?r===void 0?/* @__PURE__ */ (0,o.jsx)(A,{pending:t,t:e.t,useStore:e.useStore,useQuestionCard:e.useQuestionCard,actions:e.actions},t.key):/* @__PURE__ */ (0,o.jsx)(b,{pending:t,review:r,t:e.t},t.key):/* @__PURE__ */ (0,o.jsx)(w,{pending:t,review:n,t:e.t,renderSlot:e.renderSlot},t.key)}function A({pending:e,t,useStore:n,useQuestionCard:r,actions:s}){let c=e.questions,l=e.review,u=(0,i.useMemo)(()=>({code:{copyLabel:t(`copy`),copiedLabel:t(`copied`),toolbarLabels:{codeLabel:t(`codeBlock.title`),wrapLabel:t(`codeBlock.wrap`),unwrapLabel:t(`codeBlock.unwrap`)}},footnotes:t(`markdown.footnotes`)}),[t]),d=(0,i.useMemo)(()=>{let e=new Map((l??[]).map(e=>[e.id,e]));return c.map(t=>{let n=e.get(t.id),r=n?.custom??``,i=l===void 0?te(t):void 0;return{selected:n===void 0&&i!==void 0?[i]:[...n?.selected??[]],custom:r,skipped:n!==void 0&&n.selected.length===0&&r===``}})},[c,l]),f=n(t=>t.progressByRequest[e.key]),p=ne(f,c.length)?f:void 0,m=l===void 0?p:void 0,h=p?.index??0,g=m?.drafts??d,_=m?.wait??(m?.drafts.some((e,t)=>e.selected.length!==d[t]?.selected.length||e.selected.some((e,n)=>e!==d[t]?.selected[n])||e.custom!==``||e.skipped)===!0?`editing`:void 0),[v,b]=(0,i.useState)(null),[x,S]=(0,i.useState)(null),C=r(e.key,e=>e??ee),w=C.channel!==`none`,T=v!==null||l!==void 0,k=(0,i.useRef)(null);(0,i.useEffect)(()=>{k.current===`waterfall`&&C.state===`continued`&&(k.current=null,b(null),S({key:`error.resubmit`}))},[C.state]),(0,i.useEffect)(()=>{C.closed&&s.clear(e.key)},[s,C.closed,e.key]),(0,i.useEffect)(()=>{s.prune(e.liveKeys())},[s,e]);let A=(0,i.useRef)(_);(0,i.useEffect)(()=>{A.current===`waiting`&&e.takeTime(),A.current===`editing`&&e.engage()},[e]);let j=C.countdown,[M,N]=(0,i.useState)(!1),[P,F]=(0,i.useState)(!1),[I,L]=(0,i.useState)(!1),R=(0,i.useRef)(/* @__PURE__ */ new Set),z=(0,i.useRef)(null),B=(0,i.useRef)(null);(0,i.useLayoutEffect)(()=>{z.current!==null&&(z.current.scrollTop=0),F(!1)},[h]);let V=c[h],H=g[h],U=(V.options?.length??0)>0;(0,i.useLayoutEffect)(()=>{if(M){L(!1);return}let e=B.current;if(e===null)return;let t=()=>{P||L(e.scrollHeight>e.clientHeight+2)};if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>{n.disconnect()}},[M,P,h,V.question,V.detail]),(0,i.useEffect)(()=>{M&&e.releaseFocus()},[M,e]);let W=(t,n)=>{s.replace(e.key,{index:t,drafts:n,...A.current===void 0?{}:{wait:A.current}})},G=()=>{A.current=`waiting`,e.takeTime(),W(h,g)},K=()=>{A.current===void 0&&(A.current=`editing`,e.engage())},q=t=>{t.currentTarget.contains(t.relatedTarget)||e.holdFocus()},J=t=>{t.currentTarget.contains(t.relatedTarget)||e.releaseFocus()};(0,i.useEffect)(()=>{let t=()=>{e.releaseFocus()},n=()=>{A.current===`editing`?e.engage():z.current?.contains(document.activeElement)===!0&&e.holdFocus()},r=()=>{document.hidden?t():n()};return window.addEventListener(`blur`,t),window.addEventListener(`focus`,n),document.addEventListener(`visibilitychange`,r),()=>{t(),window.removeEventListener(`blur`,t),window.removeEventListener(`focus`,n),document.removeEventListener(`visibilitychange`,r)}},[e]);let ie=()=>{e.dismissal===`hide`?e.dismiss():w?(b(`cancel`),S(null),k.current=`waterfall`,e.dismiss().catch(e=>{k.current=null,b(null),S({text:e instanceof Error?e.message:String(e)})})):S({key:`error.unavailable`})},Y=(e,t=h)=>{K();let n=g.map((t,n)=>n===h?e(t):t);W(t,n),S(null)},ae=e=>{Y(t=>{if(V.multiSelect===!0){let n=t.selected.includes(e)?t.selected.filter(t=>t!==e):[...t.selected,e];return{...t,selected:n,skipped:!1}}return{selected:[e],custom:``,skipped:!1}},V.multiSelect!==!0&&h<c.length-1?h+1:h)},X=e=>e.selected.length>0||e.custom.trim()!==``,oe=e=>X(e)||e.skipped,Z=t=>{let n=t.findIndex(e=>!oe(e));if(n>=0){W(n,t),S({key:`error.incomplete`});return}if(!w){S({key:`error.unavailable`});return}let r={answers:c.map((e,n)=>{let r=t[n];if(r.skipped)return{id:e.id,selected:[]};let i=r.custom.trim();return{id:e.id,selected:i===``||e.multiSelect===!0?r.selected:[],...i===``?{}:{custom:i}}})};b(`answer`),S(null);let i=e.snapshot().channel;k.current=i===`waterfall`?`waterfall`:null,e.answer(r).then(()=>{i===`rpc`&&(k.current=null,b(null),S(null),e.dismiss().catch(()=>{S({key:`status.sent`})}))}).catch(e=>{k.current=null,b(null),S({text:e instanceof Error?e.message:String(e)})})},se=()=>{X(H)?h<c.length-1?(W(h+1,g),S(null)):Z(g):S({key:`error.unanswered`})},ce=e=>{let t=e.target.value;Y(e=>({...e,selected:V.multiSelect===!0?e.selected:[],custom:t,skipped:!1}))},le=e=>{e.key!==`Enter`||e.shiftKey||re(e)||(e.preventDefault(),se())},ue=()=>{K();let e=g.map((e,t)=>t===h?{selected:[],custom:``,skipped:!0}:e);W(h<c.length-1?h+1:h,e),S(null),!(h<c.length-1)&&Z(e)},Q=j!==void 0&&C.waitState!==`waiting`&&C.waitState!==`editing`&&C.waitState!==`continued`,de=j!==void 0&&(C.waitState===`waiting`||C.waitState===`editing`),fe=Q||C.state===`continued`||de||l!==void 0,$=`question-${e.key}-${String(h)}`;return/* @__PURE__ */ (0,o.jsx)(`div`,{className:E.frame,"data-question-key":e.key,children:/* @__PURE__ */ (0,o.jsxs)(`section`,{className:y(E.card,M&&E.cardMinimized),"aria-labelledby":$,children:[/* @__PURE__ */ (0,o.jsxs)(`header`,{className:E.topBar,children:[/* @__PURE__ */ (0,o.jsxs)(`div`,{className:E.topBarLeading,children:[V.header!==void 0&&/* @__PURE__ */ (0,o.jsx)(`div`,{className:E.eyebrow,children:V.header}),M&&/* @__PURE__ */ (0,o.jsx)(`h2`,{className:E.minimizedTitle,id:$,children:V.question})]}),fe&&/* @__PURE__ */ (0,o.jsxs)(`div`,{className:E.statusGroup,children:[Q&&/* @__PURE__ */ (0,o.jsx)(`span`,{className:E.waitStatus,children:t(j.running?`wait.countdown`:`wait.paused`,{seconds:Math.ceil(j.remainingMs/1e3)})}),Q&&/* @__PURE__ */ (0,o.jsx)(a.Button,{variant:`outline`,size:`sm`,className:E.waitButton,onClick:G,children:t(`wait.takeTime`)}),C.state===`continued`&&/* @__PURE__ */ (0,o.jsx)(`span`,{className:E.waitStatus,children:t(`wait.continued`)}),de&&/* @__PURE__ */ (0,o.jsx)(`span`,{className:E.waitStatus,children:t(`wait.held`)}),l!==void 0&&/* @__PURE__ */ (0,o.jsx)(`span`,{className:E.waitStatus,children:t(`review.status`)})]}),/* @__PURE__ */ (0,o.jsxs)(`div`,{className:E.iconActions,children:[/* @__PURE__ */ (0,o.jsx)(`button`,{type:`button`,className:E.iconButton,"aria-label":t(M?`nav.maximize`:`nav.minimize`),title:t(M?`nav.maximize`:`nav.minimize`),"aria-expanded":!M,disabled:v!==null,onClick:()=>{N(e=>!e)},children:M?/* @__PURE__ */ (0,o.jsx)(a.IconChevronUpOutlineRegular,{}):/* @__PURE__ */ (0,o.jsx)(a.IconChevronDownOutlineRegular,{})}),/* @__PURE__ */ (0,o.jsx)(`button`,{type:`button`,className:E.iconButton,"aria-label":t(e.dismissal===`hide`?`nav.close`:`nav.cancel`),title:t(e.dismissal===`hide`?`nav.close`:`nav.cancel`),disabled:v!==null,onClick:ie,children:/* @__PURE__ */ (0,o.jsx)(a.IconCloseOutlineRegular,{})})]})]}),!M&&/* @__PURE__ */ (0,o.jsx)(`div`,{ref:z,className:E.scrollArea,"data-question-scroll":!0,tabIndex:0,onFocusCapture:q,onBlurCapture:J,children:/* @__PURE__ */ (0,o.jsxs)(`div`,{className:E.body,children:[/* @__PURE__ */ (0,o.jsxs)(`div`,{className:E.promptBlock,children:[/* @__PURE__ */ (0,o.jsxs)(`div`,{ref:B,className:y(E.promptContent,!P&&E.promptCollapsed,!P&&I&&E.promptFaded),children:[/* @__PURE__ */ (0,o.jsx)(`h2`,{className:E.title,id:$,children:V.question}),V.detail!==void 0&&/* @__PURE__ */ (0,o.jsx)(`div`,{className:E.detail,children:/* @__PURE__ */ (0,o.jsx)(a.MarkdownText,{text:V.detail,labels:u})})]}),(I||P)&&/* @__PURE__ */ (0,o.jsxs)(`button`,{type:`button`,className:E.promptToggle,"aria-expanded":P,onClick:()=>{F(e=>!e)},children:[/* @__PURE__ */ (0,o.jsx)(`span`,{children:t(P?`prompt.collapse`:`prompt.expand`)}),P?/* @__PURE__ */ (0,o.jsx)(a.IconChevronUpOutlineRegular,{size:14}):/* @__PURE__ */ (0,o.jsx)(a.IconChevronDownOutlineRegular,{size:14})]})]}),/* @__PURE__ */ (0,o.jsxs)(`div`,{className:E.options,role:V.multiSelect===!0?`group`:`radiogroup`,children:[(V.options??[]).map((e,n)=>{let r=H.selected.includes(e.label),i=D(e.label);return/* @__PURE__ */ (0,o.jsxs)(`button`,{type:`button`,className:y(E.option,r&&E.optionSelected),role:V.multiSelect===!0?`checkbox`:`radio`,"aria-checked":r,"aria-label":i.label,disabled:T,onClick:()=>{ae(e.label)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),Z(g))},children:[V.multiSelect===!0?/* @__PURE__ */ (0,o.jsx)(`span`,{className:y(E.checkbox,r&&E.checkboxChecked),"aria-hidden":`true`,children:r&&/* @__PURE__ */ (0,o.jsx)(a.IconCheckOutlineRegular,{size:12})}):/* @__PURE__ */ (0,o.jsx)(`span`,{className:E.number,children:n+1}),/* @__PURE__ */ (0,o.jsx)(`span`,{className:E.optionCopy,children:/* @__PURE__ */ (0,o.jsxs)(`span`,{className:E.optionLine,children:[/* @__PURE__ */ (0,o.jsx)(`span`,{className:E.optionLabel,children:i.label}),i.recommended&&/* @__PURE__ */ (0,o.jsx)(`span`,{className:E.badge,children:t(`option.recommended`)}),e.description!==void 0&&/* @__PURE__ */ (0,o.jsx)(`span`,{className:E.description,children:e.description})]})})]},`${e.label}-${String(n)}`)}),l!==void 0&&H.skipped&&/* @__PURE__ */ (0,o.jsx)(`p`,{className:E.reviewNote,children:t(`review.skipped`)}),(!U||V.allowOther!==!1)&&(l===void 0||H.custom!==``)&&(U?/* @__PURE__ */ (0,o.jsxs)(`div`,{className:y(E.customRow,H.custom!==``&&E.customRowActive),children:[V.multiSelect===!0?/* @__PURE__ */ (0,o.jsx)(`span`,{className:y(E.checkbox,H.custom!==``&&E.checkboxChecked),"aria-hidden":`true`,children:H.custom!==``&&/* @__PURE__ */ (0,o.jsx)(a.IconCheckOutlineRegular,{size:12})}):/* @__PURE__ */ (0,o.jsx)(`span`,{className:E.number,"aria-hidden":`true`,children:/* @__PURE__ */ (0,o.jsx)(a.IconEditOutlineRegular,{size:12})}),/* @__PURE__ */ (0,o.jsx)(O,{variant:`inline`,value:H.custom,disabled:T,placeholder:t(`custom.placeholder`),onChange:ce,onKeyDown:le})]}):/* @__PURE__ */ (0,o.jsx)(O,{autoFocus:w&&j===void 0&&!T&&!R.current.has(h),variant:`block`,value:H.custom,disabled:T,placeholder:t(`custom.placeholder`),onFocus:()=>{R.current.add(h)},onChange:ce,onKeyDown:le}))]})]})}),!M&&/* @__PURE__ */ (0,o.jsxs)(`footer`,{className:E.footer,children:[c.length>1&&/* @__PURE__ */ (0,o.jsxs)(`div`,{className:E.pager,children:[/* @__PURE__ */ (0,o.jsx)(`button`,{type:`button`,className:E.iconButton,"aria-label":t(`nav.prev`),disabled:h===0||v!==null,onClick:()=>{W(h-1,g),S(null)},children:/* @__PURE__ */ (0,o.jsx)(a.IconChevronLeftOutlineRegular,{})}),/* @__PURE__ */ (0,o.jsxs)(`span`,{className:E.progress,children:[h+1,` / `,c.length]}),/* @__PURE__ */ (0,o.jsx)(`button`,{type:`button`,className:E.iconButton,"aria-label":t(`nav.next`),disabled:h===c.length-1||v!==null,onClick:()=>{W(h+1,g),S(null)},children:/* @__PURE__ */ (0,o.jsx)(a.IconChevronRightOutlineRegular,{})})]}),/* @__PURE__ */ (0,o.jsx)(`div`,{className:E.feedback,role:`status`,children:x===null?null:`key`in x?t(x.key):x.text}),l===void 0&&/* @__PURE__ */ (0,o.jsxs)(`div`,{className:E.footerActions,children:[/* @__PURE__ */ (0,o.jsx)(a.Button,{variant:`ghost`,disabled:v!==null,onClick:ue,children:t(`action.skip`)}),/* @__PURE__ */ (0,o.jsx)(a.Button,{variant:`primary`,disabled:v!==null||!X(H)||h===c.length-1&&!w,onClick:se,children:v===`answer`?t(`submitting`):h===c.length-1?t(`submit`):t(`action.next`)})]})]})]})})}let j=/* @__PURE__ */ new Set([`system/message`,`developer/message`,`user/message`,`assistant/message`,`tool/result`]);function M(e){return j.has(e.type)?e.surfaceOp!==void 0:!1}function N(e){return M(e)&&e.surfaceOp===`append`}function P(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function F(e){let t;try{t=JSON.parse(e)}catch{return{questions:[],answers:[]}}if(!P(t)||!Array.isArray(t.questions))return{questions:[],answers:[]};let n=[];for(let e of t.questions)P(e)&&typeof e.id==`string`&&typeof e.question==`string`&&n.push({id:e.id,question:e.question,...typeof e.detail==`string`?{detail:e.detail}:{},...typeof e.header==`string`?{header:e.header}:{},...Array.isArray(e.options)?{options:e.options.flatMap(e=>!P(e)||typeof e.label!=`string`?[]:[{label:e.label,...typeof e.description==`string`?{description:e.description}:{}}])}:{},...typeof e.multiSelect==`boolean`?{multiSelect:e.multiSelect}:{}});let r=[];for(let e of Array.isArray(t.answers)?t.answers:[])P(e)&&typeof e.id==`string`&&Array.isArray(e.selected)&&r.push({id:e.id,selected:e.selected.filter(e=>typeof e==`string`),...typeof e.custom==`string`?{custom:e.custom}:{}});return{questions:n,answers:r}}function I(e,t){let n=e.answers.find(e=>e.id===t),r=n?.custom?.trim()??``;return[...n?.selected??[],...r===``?[]:[r]]}function L(e,t){return e.questions.length===0?e.text:e.questions.map(n=>{let r=I(e,n.id);return`${n.header&&n.header!==n.question?`${n.header} — ${n.question}`:n.question}\n${r.length===0?t(`reply.skipped`):`${t(`reply.answerLabel`)}${r.join(`, `)}`}`}).join(`
|
|
4
4
|
|
|
5
|
-
`)}function I(e){let t=e.data.source;return M(t)&&t.kind===`user-question-reply`&&typeof t.callId==`string`&&t.outcome===`answered`?{callId:t.callId,outcome:`answered`}:null}let L={kind:`user-question-reply`,target:`chat`,match:e=>e.type!==`user/message`||!j(e)||I(e)===null?null:{id:String(e.data.id),role:`start`},start:(e,t)=>{if(t.event.type!==`user/message`)throw Error(`user-question-reply start requires user/message`);let n=t.event,r=n.data.content.find(e=>e.type===`text`)?.text??``,i=I(n);if(i===null)throw Error(`user-question-reply start requires a reply source`);return{seq:n.seq,time:n.time,callId:i.callId,outcome:i.outcome,text:r,...N(r)}},update:e=>e.state,buildViewNode:e=>{if(e.state===void 0)return null;let{seq:t,...n}=e.state;return{key:e.key,kind:`question-reply`,id:e.id,target:`chat`,anchorSeq:t,location:e.start?.location??{kind:`unresolved`},visibility:`visible`,data:n}}},R=`@deepseek-ai/dsh-client-ui-user-questions/QuestionReplyView.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(R)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-user-questions`,e.dataset.pluginCss=R,e.textContent=`.r_aRUG_row{flex-direction:column;justify-content:flex-end;align-items:flex-end;gap:6px;padding:4px 0;display:flex}.r_aRUG_bubble{border-radius:var(--dsw-radius-xl);background:var(--dsw-specific-bubble);max-width:72%;color:var(--dsw-alias-label-primary);cursor:pointer;font-size:var(--dsh-content-font-size,14px);line-height:calc(22px + var(--dsh-content-font-delta,0px));text-align:left;overflow-wrap:anywhere;white-space:pre-wrap;padding:10px 16px}.r_aRUG_toggle{width:100%;color:inherit;cursor:pointer;font:inherit;text-align:left;background:0 0;border:0;padding:0}.r_aRUG_toggle:focus-visible{outline:2px solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.r_aRUG_bubble:has(.r_aRUG_toggle:focus-visible){box-shadow:0 0 0 2px var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary))}.r_aRUG_labelRow{align-items:center;gap:3px;display:flex}.r_aRUG_caret{color:var(--dsw-alias-label-secondary);display:inline-flex}.r_aRUG_caret svg{width:12px;height:12px}.r_aRUG_label{color:var(--dsw-alias-label-secondary);font-size:var(--dsh-content-font-size-secondary,13px);line-height:calc(18px + var(--dsh-content-font-delta-secondary,0px));display:block}.r_aRUG_summary{color:var(--dsw-alias-label-primary);font-size:var(--dsh-content-font-size,14px);margin-top:3px;display:block}.r_aRUG_text{margin:8px 0 0}.r_aRUG_details{border-top:1px solid color-mix(in srgb, var(--dsw-alias-label-secondary) 24%, transparent);margin:8px 0 0;padding-top:8px}.r_aRUG_details>div+div{margin-top:12px}.r_aRUG_details dt{color:var(--dsw-alias-label-secondary);font-size:12px}.r_aRUG_question{gap:3px;display:grid}.r_aRUG_header,.r_aRUG_detail,.r_aRUG_options{color:var(--dsw-alias-label-secondary);font-size:11px}.r_aRUG_questionText{color:var(--dsw-alias-label-primary)}.r_aRUG_options{margin:0;padding-left:16px}.r_aRUG_details dd{margin:4px 0 0}.r_aRUG_answer{font-size:14px}.r_aRUG_answerLabel{color:var(--dsw-alias-label-secondary);margin-right:4px;font-size:12px}.r_aRUG_actions{height:28px;color:var(--dsw-alias-label-tertiary);align-items:center;gap:8px;padding-right:4px;display:flex}.r_aRUG_time{white-space:nowrap;padding-right:4px;font-size:13px;line-height:24px}.r_aRUG_action{border-radius:var(--dsw-radius-sm);width:28px;height:28px;color:inherit;cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:6px;display:inline-flex}.r_aRUG_action svg{width:15px;height:15px}.r_aRUG_action:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary)}`,document.head.appendChild(e)}var z={action:`r_aRUG_action`,actions:`r_aRUG_actions`,answer:`r_aRUG_answer`,answerLabel:`r_aRUG_answerLabel`,bubble:`r_aRUG_bubble`,caret:`r_aRUG_caret`,detail:`r_aRUG_detail`,details:`r_aRUG_details`,header:`r_aRUG_header`,label:`r_aRUG_label`,labelRow:`r_aRUG_labelRow`,options:`r_aRUG_options`,question:`r_aRUG_question`,questionText:`r_aRUG_questionText`,row:`r_aRUG_row`,summary:`r_aRUG_summary`,text:`r_aRUG_text`,time:`r_aRUG_time`,toggle:`r_aRUG_toggle`};let B=(0,i.memo)(function({node:e,t}){return/* @__PURE__ */ (0,o.jsx)(V,{data:e.data,t})});function V({data:e,t}){let n=t(`reply.label`),[r,s]=(0,i.useState)(!1),c=t(r?`reply.close`:`reply.open`),l=e.questions.map(t=>P(e,t.id)).flat().join(`, `),u=F(e,t),[d,f]=(0,i.useState)(!1),p=(0,i.useCallback)(()=>{d||(0,a.writeClipboard)(u).then(e=>{e&&(f(!0),window.setTimeout(()=>{f(!1)},1e3))})},[d,u]);return/* @__PURE__ */ (0,o.jsxs)(`div`,{className:z.row,"data-question-reply":e.callId,"data-reply-outcome":e.outcome,role:`group`,"aria-label":n,children:[/* @__PURE__ */ (0,o.jsxs)(`div`,{className:z.bubble,children:[/* @__PURE__ */ (0,o.jsxs)(`button`,{type:`button`,className:z.toggle,"aria-expanded":r,"aria-label":`${n} · ${c}`,onClick:()=>{s(e=>!e)},children:[/* @__PURE__ */ (0,o.jsxs)(`span`,{className:z.labelRow,children:[/* @__PURE__ */ (0,o.jsx)(`span`,{className:z.caret,"aria-hidden":`true`,children:r?/* @__PURE__ */ (0,o.jsx)(a.IconChevronDownOutlineRegular,{}):/* @__PURE__ */ (0,o.jsx)(a.IconChevronRightOutlineRegular,{})}),/* @__PURE__ */ (0,o.jsx)(`span`,{className:z.label,children:n})]}),!r&&/* @__PURE__ */ (0,o.jsx)(`span`,{className:z.summary,children:l===``?t(`reply.skipped`):l})]}),r&&(e.questions.length===0?/* @__PURE__ */ (0,o.jsx)(`p`,{className:z.text,children:e.text}):/* @__PURE__ */ (0,o.jsx)(`dl`,{className:z.details,children:e.questions.map(n=>{let r=P(e,n.id);return/* @__PURE__ */ (0,o.jsxs)(`div`,{children:[/* @__PURE__ */ (0,o.jsxs)(`dt`,{className:z.question,children:[n.header&&n.header!==n.question&&/* @__PURE__ */ (0,o.jsx)(`span`,{className:z.header,children:n.header}),/* @__PURE__ */ (0,o.jsx)(`span`,{className:z.questionText,children:n.question}),n.detail&&/* @__PURE__ */ (0,o.jsx)(`span`,{className:z.detail,children:n.detail}),n.options&&n.options.length>0&&/* @__PURE__ */ (0,o.jsx)(`ul`,{className:z.options,children:n.options.map(e=>/* @__PURE__ */ (0,o.jsxs)(`li`,{children:[e.label,e.description&&` — ${e.description}`]},e.label))})]}),/* @__PURE__ */ (0,o.jsxs)(`dd`,{className:z.answer,children:[/* @__PURE__ */ (0,o.jsx)(`span`,{className:z.answerLabel,children:t(`reply.answerLabel`)}),r.length===0?t(`reply.skipped`):r.join(`, `)]})]},n.id)})}))]}),/* @__PURE__ */ (0,o.jsxs)(`div`,{className:z.actions,children:[/* @__PURE__ */ (0,o.jsx)(`span`,{className:z.time,children:new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`,hour12:!1}).format(e.time)}),/* @__PURE__ */ (0,o.jsx)(a.Tooltip,{label:t(d?`copied`:`copy`),side:`bottom`,children:/* @__PURE__ */ (0,o.jsx)(`button`,{type:`button`,className:z.action,"aria-label":t(d?`copied`:`copy`),onClick:p,children:d?/* @__PURE__ */ (0,o.jsx)(a.IconCheckOutlineRegular,{}):/* @__PURE__ */ (0,o.jsx)(a.IconCopyOutlineRegular,{})})})]})]})}let H={"error.incomplete":`请先完成这道问题。`,"error.unanswered":`请选择一个选项或填写自定义答案。`,"error.unavailable":`当前无法提交,请稍候再试。`,"error.resubmit":`回答未送达,工作已继续,请再提交一次。`,"status.sent":`回答已发送;面板未能关闭。`,"wait.takeTime":`慢慢回答`,"wait.countdown":`{seconds} 秒后继续工作`,"wait.paused":`已暂停 · 剩余 {seconds} 秒`,"wait.held":`会一直等你回答`,"wait.continued":`已继续工作,仍可回答`,"review.status":`已回答`,"review.skipped":`这道问题当时被跳过。`,"reply.label":`回答先前等待中的问题`,"reply.open":`展开问题详情`,"reply.close":`收起问题详情`,"reply.answerLabel":`回答:`,"reply.skipped":`已跳过`,"nav.prev":`上一题`,"nav.next":`下一题`,"nav.minimize":`收起问题卡片`,"nav.maximize":`展开问题卡片`,"nav.cancel":`放弃整组问题`,"nav.close":`收起问题面板,可从工具调用重新打开`,"option.recommended":`推荐`,"custom.placeholder":`输入你的答案`,"action.skip":`跳过`,"action.next":`下一题`,"prompt.expand":`展开全文`,"prompt.collapse":`收起全文`,"plan.header":`计划待审`,"plan.approve":`同意执行`,"plan.decline":`拒绝`,"plan.discuss":`要求修改`},U={"error.incomplete":`Please complete this question first.`,"error.unanswered":`Please select an option or enter a custom answer.`,"error.unavailable":`Cannot submit right now; try again in a moment.`,"error.resubmit":`The answer did not arrive before work continued; submit it again.`,"status.sent":`Reply sent; the panel could not close.`,"wait.takeTime":`Take time`,"wait.countdown":`Continuing in {seconds}s`,"wait.paused":`Paused · {seconds}s remaining`,"wait.held":`Waiting until you answer`,"wait.continued":`Work continued — you can still answer`,"review.status":`Answered`,"review.skipped":`This question was skipped.`,"reply.label":`Reply to earlier pending questions`,"reply.open":`Open question details`,"reply.close":`Close question details`,"reply.answerLabel":`Answer: `,"reply.skipped":`Skipped`,"nav.prev":`Previous question`,"nav.next":`Next question`,"nav.minimize":`Collapse the question card`,"nav.maximize":`Expand the question card`,"nav.cancel":`Dismiss all questions`,"nav.close":`Close the panel — reopen it from the tool call`,"option.recommended":`Recommended`,"custom.placeholder":`Type your answer`,"action.skip":`Skip`,"action.next":`Next`,"prompt.expand":`Show full text`,"prompt.collapse":`Show less`,"plan.header":`Plan review`,"plan.approve":`Approve`,"plan.decline":`Refuse`,"plan.discuss":`Request changes`},W=`question`,G=[`sessions`,`remote`,`remote.userQuestions`,`uiSession`,`slots`,`locale`,`uiConversation`];var K=class{publish;#e=/* @__PURE__ */ new Map;constructor(e){this.publish=e}byCallId(e,t){return this.#e.get(h.keyOf(e,t))}source(e){return this.#e.get(e)?.pending}values(){return[...this.#e.values()]}keysFor(e){return this.values().filter(t=>t.pending.sessionId===e).map(e=>e.pending.key)}ensure(e,t,n){if(n!==void 0){let t=this.byCallId(e,n);if(t!==void 0)return t}return this.#t(new h(e,t,n,()=>this.keysFor(e)))}#t(e){let t=/* @__PURE__ */ new Set,n=async()=>{e.delegate(),await Promise.all(t)},r=this.publish(e,n),i={pending:e,hide:()=>{r?.(),r=void 0},reveal:()=>{r?.(),r=this.publish(e,n)},remove:()=>{
|
|
5
|
+
`)}function R(e){let t=e.data.source;return P(t)&&t.kind===`user-question-reply`&&typeof t.callId==`string`&&t.outcome===`answered`?{callId:t.callId,outcome:`answered`}:null}let z={kind:`user-question-reply`,target:`chat`,match:e=>e.type!==`user/message`||!N(e)||R(e)===null?null:{id:String(e.data.id),role:`start`},start:(e,t)=>{if(t.event.type!==`user/message`)throw Error(`user-question-reply start requires user/message`);let n=t.event,r=n.data.content.find(e=>e.type===`text`)?.text??``,i=R(n);if(i===null)throw Error(`user-question-reply start requires a reply source`);return{seq:n.seq,time:n.time,callId:i.callId,outcome:i.outcome,text:r,...F(r)}},update:e=>e.state,buildViewNode:e=>{if(e.state===void 0)return null;let{seq:t,...n}=e.state;return{key:e.key,kind:`question-reply`,id:e.id,target:`chat`,anchorSeq:t,location:e.start?.location??{kind:`unresolved`},visibility:`visible`,data:n}}},B=`@deepseek-ai/dsh-client-ui-user-questions/QuestionReplyView.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(B)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@deepseek-ai/dsh-client-ui-user-questions`,e.dataset.pluginCss=B,e.textContent=`.r_aRUG_row{flex-direction:column;justify-content:flex-end;align-items:flex-end;gap:6px;padding:4px 0;display:flex}.r_aRUG_bubble{border-radius:var(--dsw-radius-xl);background:var(--dsw-specific-bubble);max-width:72%;color:var(--dsw-alias-label-primary);cursor:pointer;font-size:var(--dsh-content-font-size,14px);line-height:calc(22px + var(--dsh-content-font-delta,0px));text-align:left;overflow-wrap:anywhere;white-space:pre-wrap;padding:10px 16px}.r_aRUG_toggle{width:100%;color:inherit;cursor:pointer;font:inherit;text-align:left;background:0 0;border:0;padding:0}.r_aRUG_toggle:focus-visible{outline:2px solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.r_aRUG_bubble:has(.r_aRUG_toggle:focus-visible){box-shadow:0 0 0 2px var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary))}.r_aRUG_labelRow{align-items:center;gap:3px;display:flex}.r_aRUG_caret{color:var(--dsw-alias-label-secondary);display:inline-flex}.r_aRUG_caret svg{width:12px;height:12px}.r_aRUG_label{color:var(--dsw-alias-label-secondary);font-size:var(--dsh-content-font-size-secondary,13px);line-height:calc(18px + var(--dsh-content-font-delta-secondary,0px));display:block}.r_aRUG_summary{color:var(--dsw-alias-label-primary);font-size:var(--dsh-content-font-size,14px);margin-top:3px;display:block}.r_aRUG_text{margin:8px 0 0}.r_aRUG_details{border-top:1px solid color-mix(in srgb, var(--dsw-alias-label-secondary) 24%, transparent);margin:8px 0 0;padding-top:8px}.r_aRUG_details>div+div{margin-top:12px}.r_aRUG_details dt{color:var(--dsw-alias-label-secondary);font-size:12px}.r_aRUG_question{gap:3px;display:grid}.r_aRUG_header,.r_aRUG_detail,.r_aRUG_options{color:var(--dsw-alias-label-secondary);font-size:11px}.r_aRUG_questionText{color:var(--dsw-alias-label-primary)}.r_aRUG_options{margin:0;padding-left:16px}.r_aRUG_details dd{margin:4px 0 0}.r_aRUG_answer{font-size:14px}.r_aRUG_answerLabel{color:var(--dsw-alias-label-secondary);margin-right:4px;font-size:12px}.r_aRUG_actions{height:28px;color:var(--dsw-alias-label-tertiary);align-items:center;gap:8px;padding-right:4px;display:flex}.r_aRUG_time{white-space:nowrap;padding-right:4px;font-size:13px;line-height:24px}.r_aRUG_action{border-radius:var(--dsw-radius-sm);width:28px;height:28px;color:inherit;cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;padding:6px;display:inline-flex}.r_aRUG_action svg{width:15px;height:15px}.r_aRUG_action:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary)}`,document.head.appendChild(e)}var V={action:`r_aRUG_action`,actions:`r_aRUG_actions`,answer:`r_aRUG_answer`,answerLabel:`r_aRUG_answerLabel`,bubble:`r_aRUG_bubble`,caret:`r_aRUG_caret`,detail:`r_aRUG_detail`,details:`r_aRUG_details`,header:`r_aRUG_header`,label:`r_aRUG_label`,labelRow:`r_aRUG_labelRow`,options:`r_aRUG_options`,question:`r_aRUG_question`,questionText:`r_aRUG_questionText`,row:`r_aRUG_row`,summary:`r_aRUG_summary`,text:`r_aRUG_text`,time:`r_aRUG_time`,toggle:`r_aRUG_toggle`};let H=(0,i.memo)(function({node:e,t}){return/* @__PURE__ */ (0,o.jsx)(U,{data:e.data,t})});function U({data:e,t}){let n=t(`reply.label`),[r,s]=(0,i.useState)(!1),c=t(r?`reply.close`:`reply.open`),l=e.questions.map(t=>I(e,t.id)).flat().join(`, `),u=L(e,t),[d,f]=(0,i.useState)(!1),p=(0,i.useCallback)(()=>{d||(0,a.writeClipboard)(u).then(e=>{e&&(f(!0),window.setTimeout(()=>{f(!1)},1e3))})},[d,u]);return/* @__PURE__ */ (0,o.jsxs)(`div`,{className:V.row,"data-question-reply":e.callId,"data-reply-outcome":e.outcome,role:`group`,"aria-label":n,children:[/* @__PURE__ */ (0,o.jsxs)(`div`,{className:V.bubble,children:[/* @__PURE__ */ (0,o.jsxs)(`button`,{type:`button`,className:V.toggle,"aria-expanded":r,"aria-label":`${n} · ${c}`,onClick:()=>{s(e=>!e)},children:[/* @__PURE__ */ (0,o.jsxs)(`span`,{className:V.labelRow,children:[/* @__PURE__ */ (0,o.jsx)(`span`,{className:V.caret,"aria-hidden":`true`,children:r?/* @__PURE__ */ (0,o.jsx)(a.IconChevronDownOutlineRegular,{}):/* @__PURE__ */ (0,o.jsx)(a.IconChevronRightOutlineRegular,{})}),/* @__PURE__ */ (0,o.jsx)(`span`,{className:V.label,children:n})]}),!r&&/* @__PURE__ */ (0,o.jsx)(`span`,{className:V.summary,children:l===``?t(`reply.skipped`):l})]}),r&&(e.questions.length===0?/* @__PURE__ */ (0,o.jsx)(`p`,{className:V.text,children:e.text}):/* @__PURE__ */ (0,o.jsx)(`dl`,{className:V.details,children:e.questions.map(n=>{let r=I(e,n.id);return/* @__PURE__ */ (0,o.jsxs)(`div`,{children:[/* @__PURE__ */ (0,o.jsxs)(`dt`,{className:V.question,children:[n.header&&n.header!==n.question&&/* @__PURE__ */ (0,o.jsx)(`span`,{className:V.header,children:n.header}),/* @__PURE__ */ (0,o.jsx)(`span`,{className:V.questionText,children:n.question}),n.detail&&/* @__PURE__ */ (0,o.jsx)(`span`,{className:V.detail,children:n.detail}),n.options&&n.options.length>0&&/* @__PURE__ */ (0,o.jsx)(`ul`,{className:V.options,children:n.options.map(e=>/* @__PURE__ */ (0,o.jsxs)(`li`,{children:[e.label,e.description&&` — ${e.description}`]},e.label))})]}),/* @__PURE__ */ (0,o.jsxs)(`dd`,{className:V.answer,children:[/* @__PURE__ */ (0,o.jsx)(`span`,{className:V.answerLabel,children:t(`reply.answerLabel`)}),r.length===0?t(`reply.skipped`):r.join(`, `)]})]},n.id)})}))]}),/* @__PURE__ */ (0,o.jsxs)(`div`,{className:V.actions,children:[/* @__PURE__ */ (0,o.jsx)(`span`,{className:V.time,children:new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`,hour12:!1}).format(e.time)}),/* @__PURE__ */ (0,o.jsx)(a.Tooltip,{label:t(d?`copied`:`copy`),side:`bottom`,children:/* @__PURE__ */ (0,o.jsx)(`button`,{type:`button`,className:V.action,"aria-label":t(d?`copied`:`copy`),onClick:p,children:d?/* @__PURE__ */ (0,o.jsx)(a.IconCheckOutlineRegular,{}):/* @__PURE__ */ (0,o.jsx)(a.IconCopyOutlineRegular,{})})})]})]})}let W={"error.incomplete":`请先完成这道问题。`,"error.unanswered":`请选择一个选项或填写自定义答案。`,"error.unavailable":`当前无法提交,请稍候再试。`,"error.resubmit":`回答未送达,工作已继续,请再提交一次。`,"status.sent":`回答已发送;面板未能关闭。`,"wait.takeTime":`慢慢回答`,"wait.countdown":`{seconds} 秒后继续工作`,"wait.paused":`已暂停 · 剩余 {seconds} 秒`,"wait.held":`会一直等你回答`,"wait.continued":`已继续工作,仍可回答`,"review.status":`已回答`,"review.skipped":`这道问题当时被跳过。`,"reply.label":`回答先前等待中的问题`,"reply.open":`展开问题详情`,"reply.close":`收起问题详情`,"reply.answerLabel":`回答:`,"reply.skipped":`已跳过`,"nav.prev":`上一题`,"nav.next":`下一题`,"nav.minimize":`收起问题卡片`,"nav.maximize":`展开问题卡片`,"nav.cancel":`放弃整组问题`,"nav.close":`收起问题面板,可从工具调用重新打开`,"option.recommended":`推荐`,"custom.placeholder":`输入你的答案`,"action.skip":`跳过`,"action.next":`下一题`,"prompt.expand":`展开全文`,"prompt.collapse":`收起全文`,"plan.header":`计划待审`,"plan.approve":`同意执行`,"plan.decline":`拒绝`,"plan.discuss":`要求修改`,"approval.detailAria":`审批详情`,"approval.expand":`展开全部改动`,"approval.collapse":`收起`,"approval.moreOptions":`更多允许选项`,"approval.categoryTerminal":`终端`,"approval.categoryFiles":`编辑文件`,"approval.categoryPermission":`权限请求`},G={"error.incomplete":`Please complete this question first.`,"error.unanswered":`Please select an option or enter a custom answer.`,"error.unavailable":`Cannot submit right now; try again in a moment.`,"error.resubmit":`The answer did not arrive before work continued; submit it again.`,"status.sent":`Reply sent; the panel could not close.`,"wait.takeTime":`Take time`,"wait.countdown":`Continuing in {seconds}s`,"wait.paused":`Paused · {seconds}s remaining`,"wait.held":`Waiting until you answer`,"wait.continued":`Work continued — you can still answer`,"review.status":`Answered`,"review.skipped":`This question was skipped.`,"reply.label":`Reply to earlier pending questions`,"reply.open":`Open question details`,"reply.close":`Close question details`,"reply.answerLabel":`Answer: `,"reply.skipped":`Skipped`,"nav.prev":`Previous question`,"nav.next":`Next question`,"nav.minimize":`Collapse the question card`,"nav.maximize":`Expand the question card`,"nav.cancel":`Dismiss all questions`,"nav.close":`Close the panel — reopen it from the tool call`,"option.recommended":`Recommended`,"custom.placeholder":`Type your answer`,"action.skip":`Skip`,"action.next":`Next`,"prompt.expand":`Show full text`,"prompt.collapse":`Show less`,"plan.header":`Plan review`,"plan.approve":`Approve`,"plan.decline":`Refuse`,"plan.discuss":`Request changes`,"approval.detailAria":`Approval details`,"approval.expand":`Expand`,"approval.collapse":`Collapse`,"approval.moreOptions":`Approval options`,"approval.categoryTerminal":`Terminal`,"approval.categoryFiles":`Edit files`,"approval.categoryPermission":`Ask permission`},K=`question`,q=[`sessions`,`remote`,`remote.userQuestions`,`uiSession`,`slots`,`locale`,`uiConversation`];var J=class{publish;#e=/* @__PURE__ */ new Map;constructor(e){this.publish=e}byCallId(e,t){return this.#e.get(g.keyOf(e,t))}source(e){return this.#e.get(e)?.pending}values(){return[...this.#e.values()]}keysFor(e){return this.values().filter(t=>t.pending.sessionId===e).map(e=>e.pending.key)}ensure(e,t,n){if(n!==void 0){let t=this.byCallId(e,n);if(t!==void 0)return t}return this.#t(new g(e,t,n,()=>this.keysFor(e)))}#t(e){let t=/* @__PURE__ */ new Set,n=async()=>{e.delegate(),await Promise.all(t)},r=this.publish(e,n),i={pending:e,hide:()=>{r?.(),r=void 0},reveal:()=>{r?.(),r=this.publish(e,n)},remove:()=>{
|
|
6
6
|
/* v8 ignore next -- a card leaves the registry once; no caller holds a card the registry already replaced. */
|
|
7
|
-
this.#e.get(e.key)===i&&(this.#e.delete(e.key),e.close(),r?.(),r=void 0)},trackRequest:e=>(t.add(e),()=>{t.delete(e)}),hasRequest:()=>t.size>0};return e.attachSeat({hide:e.review===void 0?i.hide:i.remove}),this.#e.set(e.key,i),i}reveal(e,t){let n=this.byCallId(e,t);return n!==void 0&&(n.reveal(),!0)}review(e,t,n){return(this.byCallId(e,t)??this.#t(new
|
|
7
|
+
this.#e.get(e.key)===i&&(this.#e.delete(e.key),e.close(),r?.(),r=void 0)},trackRequest:e=>(t.add(e),()=>{t.delete(e)}),hasRequest:()=>t.size>0};return e.attachSeat({hide:e.review===void 0?i.hide:i.remove}),this.#e.set(e.key,i),i}reveal(e,t){let n=this.byCallId(e,t);return n!==void 0&&(n.reveal(),!0)}review(e,t,n){return(this.byCallId(e,t)??this.#t(new g(e,n.questions,s(t),()=>this.keysFor(e),n.answers))).reveal(),!0}dispose(){for(let e of this.values())e.pending.delegate(),e.remove()}};async function ie(e,t,n,r,i){let a=e.sessions.scopeOf(t);if(a===void 0)return r();let o=n.wait?.callId,s=i.ensure(a,n.questions,o),c=new AbortController,l=n.signal===void 0?c.signal:AbortSignal.any([c.signal,n.signal]),u,d,f,p=n.wait?.timed===!0&&o!==void 0?e.effect(()=>(u=e.remote.userQuestions.attachWait(a,o,l),async()=>{f?.(),c.abort(),u?.dispose(),d!==void 0&&await Promise.allSettled([d])}),`ui-user-questions: foreground claim`):void 0,m=Promise.withResolvers(),g=s.trackRequest(m.promise);try{let e=u?.[Symbol.asyncIterator](),t=e===void 0?void 0:await e.next();if(t?.done===!0)return await r();let n=h(t===void 0?void 0:Date.now()+t.value.remainingMs,l,e=>{s.pending.detachWaterfall(e)});if(l.aborted)return await n.result;f=()=>{n.channel.delegate()},s.pending.attachWaterfall(n.channel),e!==void 0&&(d=(async()=>{throw await e.next(),Error(`the foreground question wait ended`)})());try{return await(d===void 0?n.result:Promise.race([n.result,d]))}catch(e){if(n.isDelegation(e))return await p?.(),await r();throw e}}finally{p===void 0?c.abort():d===void 0?await p():Promise.allSettled([d]).then(()=>{p()}),o===void 0&&s.remove(),m.resolve(),g()}}function Y(e,t){let n=e.sessions,r=/* @__PURE__ */ new Map,i=e=>{if(!e.ok)throw Error(e.error.message);return e.value},a=(t,n)=>({answer:async r=>i(await e.remote.userQuestions.answer(t,n,r))}),o=()=>{let e=n.list.getSnapshot(),i=new Map(Object.values(e.byId).flatMap(e=>{let t=n.binding(e.id);return t===void 0?[]:[[e.id,t]]}));for(let[e,t]of r)i.has(e)||(t(),r.delete(e));for(let[e,t]of i){if(r.has(e))continue;let n=t.session.projections.faceOf(`userQuestions`).subscribe(o),i=t.session.projections.faceOf(`inbox`).subscribe(o);r.set(e,()=>{n(),i()})}let s=/* @__PURE__ */ new Map;for(let[e,t]of i){let n=t.session.projections.faceOf(`userQuestions`).getSnapshot(),r=t.session.projections.faceOf(`inbox`).getSnapshot(),i=/* @__PURE__ */ new Set;for(let e of[...r?.[`next-step`]??[],...r?.[`next-turn`]??[]]){if(typeof e!=`object`||!e||Array.isArray(e))continue;let t=e.source;typeof t==`object`&&t&&!Array.isArray(t)&&t.kind===`user-question-reply`&&typeof t.callId==`string`&&i.add(t.callId)}for(let t of n?.active??[])t.state===`continued`&&i.has(t.callId)||s.set(g.keyOf(e,t.callId),{sessionId:e,row:t})}for(let{sessionId:e,row:n}of s.values())if(n.state===`continued`){let r=t.ensure(e,n.questions,n.callId);r.pending.attachRpc(a(e,n.callId)),r.pending.setState(`continued`)}else t.byCallId(e,n.callId)?.pending.setState(`open`);for(let e of t.values())e.pending.callId===void 0||e.pending.review!==void 0||s.has(e.pending.key)||e.hasRequest()||e.pending.hasWaterfall()||e.remove()};o();let s=n.list.subscribe(o);return()=>{s();for(let e of r.values())e();r.clear()}}function ae(e){e.effect(()=>e.locale.register(K,{zh:W,en:G}),`ui-user-questions: dictionaries`);let t=_(),n=new J(e.uiSession.registerPendingInteraction(e=>e.kind===`approval`?0:e.kind===`plan-review`?2:1));e.effect(()=>()=>{n.dispose()},`ui-user-questions: cards`);let r=e.reflect.provide(`userQuestionPanels`,{reveal:(e,t)=>n.reveal(e,t),review:(e,t,r)=>n.review(e,t,r)});e.effect(()=>r,`ui-user-questions: answer panels`),e.effect(()=>Y(e,n),`ui-user-questions: continued questions`),e.slots.inject(`conversation.composer`,()=>e.slots.register({name:`conversation.composer`,select:({pendingInteraction:e})=>e instanceof g?e:null,locale:K,store:t,inject:()=>({keyedHooks:{questionCard:e=>n.source(e)}}),children:{"conversation.plan-review.actions":{kind:`list`,scope:`session`}}},k)),e.uiConversation.events.register(z),e.slots.inject(`conversation.chat.node`,()=>e.slots.register({name:`conversation.chat.node`,key:`question-reply`,locale:K},H)),e.remote.$on(`user-questions/request`,function(t,r){return ie(e,this,t,r,n)})}return n.apply=ae,n.inject=q,t.exports}});
|