@michengai/dsh-archive-manager 1.2.4 → 1.2.6
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/CHANGELOG.md +18 -1
- package/CHANGELOG.zh-CN.md +21 -4
- package/README.md +2 -2
- package/README.ru.md +2 -2
- package/README.zh-CN.md +2 -2
- package/lib/client.js +11 -5
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -7,11 +7,11 @@ window.__ModuleLoader__.load({
|
|
|
7
7
|
globalThis.__dshArchiveReactDOMClient = require("react-dom/client");
|
|
8
8
|
var module = { exports: {} };
|
|
9
9
|
var exports = module.exports;
|
|
10
|
-
"use strict";var Wn=Object.defineProperty;var Ps=Object.getOwnPropertyDescriptor;var Os=Object.getOwnPropertyNames;var Fs=Object.prototype.hasOwnProperty;var e=(t,r)=>Wn(t,"name",{value:r,configurable:!0});var Bs=(t,r)=>{for(var i in r)Wn(t,i,{get:r[i],enumerable:!0})},Hs=(t,r,i,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Os(r))!Fs.call(t,o)&&o!==i&&Wn(t,o,{get:()=>r[o],enumerable:!(a=Ps(r,o))||a.enumerable});return t};var Us=t=>Hs(Wn({},"__esModule",{value:!0}),t);var mi={};Bs(mi,{startArchiveClient:()=>pi});module.exports=Us(mi);function ce(t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError("\u53C2\u6570\u5FC5\u987B\u4E3A\u5BF9\u8C61");return t}e(ce,"record");function Be(t){return String(t&&typeof t=="object"&&"message"in t?t.message??t:t)}e(Be,"errorMessage");function qn(t){return t&&typeof t=="object"&&"code"in t?t.code:void 0}e(qn,"errorCode");var sa=Function("return globalThis.__dshArchiveReact")(),{Children:bi,Component:yi,Fragment:ia,Profiler:wi,PureComponent:Si,StrictMode:xi,Suspense:ki,cloneElement:Ci,createContext:Ei,createElement:oa,createRef:Ii,forwardRef:Ti,isValidElement:Ai,lazy:_i,memo:Ri,startTransition:ji,useCallback:Ni,useContext:Di,useDebugValue:Mi,useDeferredValue:Li,useEffect:la,useId:zi,useImperativeHandle:Pi,useInsertionEffect:Oi,useLayoutEffect:Fi,useMemo:Bi,useReducer:Hi,useRef:Ui,useState:Ut,useSyncExternalStore:Wi,useTransition:qi,version:Vi}=sa,W=sa;function da(t){return W.createElement("input",{className:"dsham_number",type:"number",min:t.min,max:t.max,value:t.value??"",disabled:t.disabled,"aria-label":t["aria-label"],onChange:e(r=>{let i=r.target.value;if(i===""){t.onChange(null);return}let a=Number(i);t.onChange(Number.isNaN(a)?null:a)},"onChange")})}e(da,"NumberField");function qs(t=W.createElement){return t("svg",{className:"dsham_dateIcon",width:14,height:14,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},t("rect",{x:2,y:3,width:12,height:11,rx:2}),t("line",{x1:2,y1:6.5,x2:14,y2:6.5}),t("line",{x1:5.5,y1:1.5,x2:5.5,y2:3.5}),t("line",{x1:10.5,y1:1.5,x2:10.5,y2:3.5}))}e(qs,"CalendarIcon");function Rn(t,r,i){let a=String(r+1).padStart(2,"0"),o=String(i).padStart(2,"0");return`${t}-${a}-${o}`}e(Rn,"formatYmd");function pn(t){let r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);return r?{year:Number(r[1]),monthIndex:Number(r[2])-1,day:Number(r[3])}:null}e(pn,"parseYmd");function Vs(t,r){let i=new Date(t,r,1).getDay(),a=(i===0?7:i)-1,o=new Date(t,r+1,0).getDate(),f=new Date(t,r,0).getDate(),c=[];for(let k=0;k<42;k++){let y=t,A=r,w=0,g=!1;k<a?(w=f-a+k+1,A=r-1,A<0&&(A=11,y--),g=!0):k<a+o?w=k-a+1:(w=k-a-o+1,A=r+1,A>11&&(A=0,y++),g=!0),c.push({year:y,monthIndex:A,day:w,dateStr:Rn(y,A,w),isOutside:g})}return c}e(Vs,"buildMonthGrid");function $s(t,r=new Date){if(t==="all")return{from:"",to:""};let i=Rn(r.getFullYear(),r.getMonth(),r.getDate());if(t==="today")return{from:i,to:i};let a=t==="7d"?6:t==="30d"?29:89,o=new Date(r.getTime()-a*864e5);return{from:Rn(o.getFullYear(),o.getMonth(),o.getDate()),to:i}}e($s,"getPresetRange");function ca(t,r,i,a){let o=r+a,f=new Date(t,o+1,0).getDate();return new Date(t,o,Math.min(i,f))}e(ca,"shiftMonthClamped");function ua(t){let r=t.React||W;function i(T,re){let Ye=T==="from"?re:t.from,Zt=T==="to"?re:t.to;if(Ye===""&&Zt===""){t.onClear();return}T==="from"?t.onFrom(re):t.onTo(re)}e(i,"change");let a=!!(t.from||t.to),o="";t.from&&t.to?o=`${t.from} \u2013 ${t.to}`:t.from?o=`${t.from} \u2013`:t.to?o=`\u2013 ${t.to}`:o=t.t?t.t("discovery.timeRange")||`${t.fromLabel} \u2013 ${t.toLabel}`:`${t.fromLabel} \u2013 ${t.toLabel}`;let c=(r.useRef??(T=>{let[re]=r.useState({current:T});return re}))(null),[k,y]=r.useState(!1),A=pn(t.from||t.to)??{year:new Date().getFullYear(),monthIndex:new Date().getMonth(),day:new Date().getDate()},[w,g]=r.useState(A.year),[S,D]=r.useState(A.monthIndex),[j,U]=r.useState(null),[z,H]=r.useState(null),[ge,le]=r.useState(null);r.useEffect(()=>{if(!k)return;let T=e(Ye=>{c.current&&!c.current.contains(Ye.target)&&(y(!1),U(null))},"onPointerDown"),re=e(Ye=>{Ye.key==="Escape"&&(Ye.preventDefault(),Ye.stopPropagation(),y(!1),U(null))},"onKeyDown");return typeof document<"u"&&document.addEventListener("mousedown",T,!0),typeof window<"u"&&window.addEventListener("keydown",re,!0),()=>{typeof document<"u"&&document.removeEventListener("mousedown",T,!0),typeof window<"u"&&window.removeEventListener("keydown",re,!0)}},[k]),r.useEffect(()=>{if(!k||!ge||!c.current)return;c.current.querySelector(`[data-date="${ge}"]`)?.focus()},[k,ge]);let V=t.t?t.t("discovery.today")==="Today"||(t.t("locale.language")||"").startsWith("en"):!1,pe=t.t?t.t("discovery.today")==="\u0421\u0435\u0433\u043E\u0434\u043D\u044F"||(t.t("locale.language")||"").startsWith("ru"):!1,me=V?"en-US":pe?"ru-RU":"zh-CN",Xe=V?["Mo","Tu","We","Th","Fr","Sa","Su"]:pe?["\u041F\u043D","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041F\u0442","\u0421\u0431","\u0412\u0441"]:["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u65E5"];function ie(T){T.stopPropagation(),S<=0?(D(11),g(re=>re-1)):D(re=>re-1)}e(ie,"prevMonth");function Q(T){T.stopPropagation(),S>=11?(D(0),g(re=>re+1)):D(re=>re+1)}e(Q,"nextMonth");function mt(T){j?(T>=j?(t.onFrom(j),t.onTo(T)):(t.onFrom(T),t.onTo(j)),U(null),y(!1)):(U(T),H(T))}e(mt,"handleDayClick");function yt(T){let re=$s(T);T==="all"?t.onClear():(t.onFrom(re.from),t.onTo(re.to)),U(null),y(!1)}e(yt,"applyPreset");function Ke(T){let re=Rn(T.getFullYear(),T.getMonth(),T.getDate());le(re),j&&H(re),(T.getFullYear()!==w||T.getMonth()!==S)&&(g(T.getFullYear()),D(T.getMonth()))}e(Ke,"moveFocusToDate");function Ee(T,re){let Ye=pn(T);Ye&&Ke(new Date(Ye.year,Ye.monthIndex,Ye.day+re))}e(Ee,"moveFocus");let ft=t.from,lt=t.to;j&&z&&(ft=j<=z?j:z,lt=j<=z?z:j);let an=Vs(w,S),Ft=new Date,sn=ge||ft||Rn(Ft.getFullYear(),Ft.getMonth(),Ft.getDate()),O=an.map((T,re)=>{let Ye=ft===T.dateStr,Zt=lt===T.dateStr,gn=!!(ft&<&&T.dateStr>ft&&T.dateStr<lt),Dn=T.year===Ft.getFullYear()&&T.monthIndex===Ft.getMonth()&&T.day===Ft.getDate(),gt="dsham_dateDay";T.isOutside&&(gt+=" is-outside"),Dn&&(gt+=" is-today"),Ye&&(gt+=" is-start"),Zt&&(gt+=" is-end"),gn&&(gt+=" is-in-range");let on=!T.isOutside&&(T.dateStr===sn||T.day===1&&!an.some(oe=>!oe.isOutside&&oe.dateStr===sn));return r.createElement("div",{key:re,className:gt,role:"button",tabIndex:on?0:-1,"data-date":T.dateStr,"aria-label":T.dateStr,"aria-pressed":!!(Ye||Zt||gn),onClick:e(oe=>{oe.stopPropagation(),mt(T.dateStr)},"onClick"),onKeyDown:e(oe=>{if(oe.key==="Enter"||oe.key===" ")oe.preventDefault(),oe.stopPropagation(),mt(T.dateStr);else if(oe.key==="ArrowLeft")oe.preventDefault(),oe.stopPropagation(),Ee(T.dateStr,-1);else if(oe.key==="ArrowRight")oe.preventDefault(),oe.stopPropagation(),Ee(T.dateStr,1);else if(oe.key==="ArrowUp")oe.preventDefault(),oe.stopPropagation(),Ee(T.dateStr,-7);else if(oe.key==="ArrowDown")oe.preventDefault(),oe.stopPropagation(),Ee(T.dateStr,7);else if(oe.key==="Home"){oe.preventDefault(),oe.stopPropagation();let je=pn(T.dateStr);if(je){let wt=new Date(je.year,je.monthIndex,je.day),Mn=(wt.getDay()===0?7:wt.getDay())-1;wt.setDate(wt.getDate()-Mn),Ke(wt)}}else if(oe.key==="End"){oe.preventDefault(),oe.stopPropagation();let je=pn(T.dateStr);if(je){let wt=new Date(je.year,je.monthIndex,je.day),Mn=(wt.getDay()===0?7:wt.getDay())-1;wt.setDate(wt.getDate()+(6-Mn)),Ke(wt)}}else if(oe.key==="PageUp"){oe.preventDefault(),oe.stopPropagation();let je=pn(T.dateStr);je&&Ke(ca(je.year,je.monthIndex,je.day,-1))}else if(oe.key==="PageDown"){oe.preventDefault(),oe.stopPropagation();let je=pn(T.dateStr);je&&Ke(ca(je.year,je.monthIndex,je.day,1))}},"onKeyDown"),onMouseEnter:e(()=>{j&&H(T.dateStr)},"onMouseEnter")},T.day)}),Le=`${w}\u5E74 ${S+1}\u6708`;try{Le=new Intl.DateTimeFormat(me,{year:"numeric",month:"long"}).format(new Date(w,S,1))}catch{Le=V||pe?`${w}-${String(S+1).padStart(2,"0")}`:`${w}\u5E74 ${S+1}\u6708`}return r.createElement("div",{ref:c,className:"dsham_dateRange",role:"group","aria-label":t.label},r.createElement("input",{className:"dsham_dateInputSrOnly",type:"date",tabIndex:-1,"aria-hidden":!0,value:t.from,"aria-label":t.fromLabel,"aria-invalid":t.invalid||void 0,onChange:e(T=>i("from",T.target.value),"onChange")}),r.createElement("input",{className:"dsham_dateInputSrOnly",type:"date",tabIndex:-1,"aria-hidden":!0,value:t.to,"aria-label":t.toLabel,"aria-invalid":t.invalid||void 0,onChange:e(T=>i("to",T.target.value),"onChange")}),r.createElement("div",{className:"dsham_dateTrigger"+(k?" is-open":""),role:"button",tabIndex:0,"aria-expanded":k,"aria-controls":k?"dsham-date-popover":void 0,onClick:e(()=>{k&&U(null),y(!k)},"onClick"),onKeyDown:e(T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),k&&U(null),y(!k))},"onKeyDown")},qs(r.createElement),r.createElement("span",{className:"dsham_dateText"+(a?"":" placeholder")},o),a?r.createElement("button",{type:"button",className:"dsham_dateClearBtn","aria-label":"clear",title:"clear",onClick:e(T=>{T.stopPropagation(),t.onClear(),U(null)},"onClick"),children:"\xD7"}):null,r.createElement("span",{className:"dsham_dateChevron"},ha(r.createElement,k))),k&&r.createElement("div",{id:"dsham-date-popover",className:"dsham_datePopover",role:"region","aria-label":t.label,onClick:e(T=>T.stopPropagation(),"onClick")},r.createElement("div",{className:"dsham_datePresets"},r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>yt("all"),"onClick")},t.t?t.t("discovery.allTime"):"\u5168\u90E8\u65F6\u95F4"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>yt("today"),"onClick")},t.t?t.t("discovery.today"):"\u4ECA\u5929"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>yt("7d"),"onClick")},t.t?t.t("discovery.last7Days"):"\u8FD1 7 \u5929"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>yt("30d"),"onClick")},t.t?t.t("discovery.last30Days"):"\u8FD1 30 \u5929"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>yt("90d"),"onClick")},t.t?t.t("discovery.last90Days"):"\u8FD1 90 \u5929")),r.createElement("div",{className:"dsham_dateCalendar"},r.createElement("div",{className:"dsham_dateCalHeader"},r.createElement("button",{type:"button",className:"dsham_dateNavBtn",onClick:ie,"aria-label":"prev month"},"\u2039"),r.createElement("span",{className:"dsham_dateMonthTitle"},Le),r.createElement("button",{type:"button",className:"dsham_dateNavBtn",onClick:Q,"aria-label":"next month"},"\u203A")),r.createElement("div",{className:"dsham_dateGrid"},Xe.map((T,re)=>r.createElement("div",{key:re,className:"dsham_dateWeekday"},T))),r.createElement("div",{className:"dsham_dateGrid"},O))))}e(ua,"DateRange");function Vn(t){return W.createElement("div",{className:t.className},W.createElement("button",{type:"button",className:"dsham_disclosure","aria-expanded":t.open,onClick:t.onToggle},ha(W.createElement,t.open),t.title),t.open?W.createElement("div",null,t.children):null)}e(Vn,"Disclosure");function ha(t,r){return t("svg",{className:"dsham_foldChevron"+(r?" is-open":""),viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":!0},t("path",{d:"M4 6l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"}))}e(ha,"foldChevron");function cr(t){let r=W.useRef(null);return W.useEffect(()=>{r.current&&(r.current.indeterminate=!!t.indeterminate&&!t.checked)},[t.indeterminate,t.checked]),W.createElement("input",{ref:r,className:"dsham_checkbox",type:"checkbox",checked:t.checked,disabled:t.disabled,"aria-label":t.label,onChange:e(i=>t.onChange({target:{checked:i.target.checked}}),"onChange")})}e(cr,"SelectionCheckbox");var jn=e(t=>{if(typeof t!="string"||!t.length||t.length>1024)throw new TypeError("\u4F1A\u8BDD ID \u65E0\u6548");return t},"id"),ma=e((t,r=!1)=>{if(typeof t!="string"||t.length>200||r&&!t.trim())throw new TypeError("\u5173\u952E\u8BCD\u987B\u4E3A 1\uFF5E200 \u4E2A\u5B57\u7B26");return t.trim()},"queryText"),pa={parse(t){let r=ce(t);if(!r||!Array.isArray(r.sessionIds)||!r.sessionIds.length||r.sessionIds.length>20)throw new TypeError("\u6BCF\u6B21\u68C0\u7D22\u987B\u5305\u542B 1\uFF5E20 \u4E2A\u4F1A\u8BDD");return{sessionIds:[...new Set(r.sessionIds.map(jn))],query:ma(r.query,!0)}}},Gs={parse(t){let r=ce(t);if(!r)throw new TypeError("\u9884\u89C8\u53C2\u6570\u65E0\u6548");return{sessionId:jn(r.sessionId),query:ma(r.query??"")}}},dr=e((t,r)=>{if(typeof t!="string"||t.length>r)throw new TypeError("\u8FD4\u56DE\u6587\u672C\u65E0\u6548");return t},"boundedString"),fa=e(t=>{if(typeof t!="number"||!Number.isSafeInteger(t)||t<0)throw new TypeError("\u6D88\u606F\u5E8F\u53F7\u65E0\u6548");return t},"sequence"),ur={parse(t){let r=ce(t);if(!r||!Array.isArray(r.items)||!Array.isArray(r.failures)||r.items.length>20||r.failures.length>20)throw new TypeError("\u68C0\u7D22\u7ED3\u679C\u65E0\u6548");return{items:r.items.map(ce).map(i=>({sessionId:jn(i.sessionId),seq:fa(i.seq),snippet:dr(i.snippet,400)})),failures:r.failures.map(ce).map(i=>({sessionId:jn(i.sessionId),message:dr(i.message,500)}))}}},Ks={parse(t){let r=ce(t);if(!r||!Array.isArray(r.messages)||r.messages.length>8||typeof r.hasEarlier!="boolean"||typeof r.hasLater!="boolean")throw new TypeError("\u9884\u89C8\u7ED3\u679C\u65E0\u6548");return{sessionId:jn(r.sessionId),hasEarlier:r.hasEarlier,hasLater:r.hasLater,messages:r.messages.map(ce).map(i=>{if(typeof i.role!="string"||!["user","assistant"].includes(i.role)||typeof i.truncated!="boolean")throw new TypeError("\u6D88\u606F\u89D2\u8272\u6216\u622A\u65AD\u72B6\u6001\u65E0\u6548");return{seq:fa(i.seq),role:i.role,text:dr(i.text,2e3),truncated:i.truncated}})}}};async function Gn(t,r=globalThis.navigator?.clipboard){if(typeof t!="string"||!t)throw Object.assign(new Error("\u6CA1\u6709\u53EF\u590D\u5236\u7684\u5185\u5BB9"),{code:"copy.empty"});if(!r?.writeText)throw Object.assign(new Error("\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u526A\u8D34\u677F\uFF0C\u8BF7\u5728 HTTPS \u6216\u672C\u673A\u5730\u5740\u4E2D\u6253\u5F00\u9875\u9762"),{code:"copy.unavailable"});try{await r.writeText(t)}catch{throw Object.assign(new Error("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u5141\u8BB8\u6D4F\u89C8\u5668\u8BBF\u95EE\u526A\u8D34\u677F\u540E\u91CD\u8BD5"),{code:"copy.denied"})}}e(Gn,"copySessionText");function ga(){let t=e((i,a)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${i}`,create:e(()=>a,"create"),schema:a}),"codec");return[["searchSessionContent",pa,ur],["searchArchivedContent",pa,ur],["previewArchivedSession",Gs,Ks]].map(([i,a,o])=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${i}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:i,invocation:{kind:"direct"},parameters:[{name:"input",wire:"input",source:"json",codec:t(i+"Input",a)}],result:t(i+"Result",o),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}e(ga,"discoveryInvocations");function va(t,r){let i=r?.trim().toLowerCase();if(!i)return null;let a=t.toLowerCase().indexOf(i);if(a<0)return null;let o=0,f=0,c;for(let k of t){let y=f+k.toLowerCase().length;if(c===void 0&&y>a&&(c=o),o+=k.length,y>=a+i.length)return{start:c??o,end:o};f=y}return null}e(va,"findTextRange");function $n(t,r=!1){if(!/^\d{4}-\d{2}-\d{2}$/.test(t))return NaN;let[i,a,o]=t.split("-").map(Number),f=new Date(i,a-1,o);return f.getFullYear()!==i||f.getMonth()!==a-1||f.getDate()!==o?NaN:(r&&f.setDate(f.getDate()+1),f.getTime())}e($n,"dayBoundary");function hr(t,r){return(!t||Number.isFinite($n(t)))&&(!r||Number.isFinite($n(r)))&&(!t||!r||t<=r)}e(hr,"validUpdatedRange");function ba(t,r,i){if(!hr(r,i))return!1;if(!r&&!i)return!0;let a=typeof t=="number"?t:Date.parse(t??"");return Number.isFinite(a)&&(!r||a>=$n(r))&&(!i||a<$n(i,!0))}e(ba,"matchesUpdatedRange");async function ya(t,r,i,{signal:a,onProgress:o}={}){let f=[],c=[],k=[...new Set(t)],y=e(()=>{if(a?.aborted)throw new Error("\u641C\u7D22\u5DF2\u53D6\u6D88")},"check");for(let A=0;A<k.length;A+=20){y();let w=ur.parse(await i({sessionIds:k.slice(A,A+20),query:r}));y(),f.push(...w.items),c.push(...w.failures),o?.({done:Math.min(A+20,k.length),total:k.length,items:[...f],failures:[...c]})}return y(),{items:f,failures:c}}e(ya,"searchArchiveBatches");function wa(t,r={}){let i=t.createElement;function a({text:g,query:S=""}){let D=va(g,S);return D?i(t.Fragment,null,g.slice(0,D.start),i("mark",null,g.slice(D.start,D.end)),g.slice(D.end)):g}e(a,"HighlightedText");function o(g,S,D,j){let U=JSON.stringify(g),z=JSON.stringify([U,S]),[H,ge]=t.useState(0),[le,V]=t.useState({key:"",status:"idle",items:[],failures:[]});return t.useEffect(()=>{if(!D||!S.trim()||!j)return;let me=new AbortController;V({key:z,status:"loading",items:[],failures:[],done:0,total:g.length});let Xe=setTimeout(()=>{ya(JSON.parse(U),S,j,{signal:me.signal,onProgress:e(ie=>{me.signal.aborted||V({key:z,status:"loading",...ie})},"onProgress")}).then(ie=>{me.signal.aborted||V({key:z,status:"ready",done:g.length,total:g.length,...ie})}).catch(ie=>{me.signal.aborted||V(Q=>({...Q,key:z,status:"error",error:Be(ie)}))})},350);return()=>{me.abort(),clearTimeout(Xe)}},[U,S,D,j,H]),{...D&&S.trim()&&j?le.key===z?le:{key:z,status:"loading",items:[],failures:[],done:0,total:g.length}:{status:"idle",items:[],failures:[]},retry:e(()=>ge(me=>me+1),"retry")}}e(o,"useArchiveSearch");function f(g,S){let[D,j]=t.useState(null),[U,z]=t.useState({status:"idle"}),[H,ge]=t.useState(0),le=D,V=D&&S.includes(D.session.id);return t.useEffect(()=>{D&&!V&&j(null)},[D,V]),t.useEffect(()=>{if(!V||typeof window>"u")return;let pe=e(me=>{me.key==="Escape"&&(me.preventDefault(),me.stopPropagation(),me.stopImmediatePropagation(),j(null))},"onKeyDown");return window.addEventListener("keydown",pe,!0),()=>window.removeEventListener("keydown",pe,!0)},[V]),t.useEffect(()=>{if(!D||!V||!g)return;let pe=!0;return z({key:le,status:"loading"}),Promise.resolve().then(()=>g({sessionId:D.session.id,query:D.query})).then(me=>{pe&&z({key:le,status:"ready",value:me})}).catch(me=>{pe&&z({key:le,status:"error",error:Be(me)})}),()=>{pe=!1}},[le,V,g,H]),{target:V?D:null,...U.key===le?U:{status:"loading"},open:e((pe,me="")=>j({session:pe,query:me}),"open"),close:e(()=>j(null),"close"),retry:e(()=>ge(pe=>pe+1),"retry")}}e(f,"useArchivePreview");function c({title:g,failures:S,separator:D}){let[j,U]=t.useState(!1),z=i("ul",null,S.map(H=>i("li",{key:H.sessionId},H.sessionId,D,H.message)));return i(Vn,{title:g,open:j,onToggle:e(()=>U(H=>!H),"onToggle")},z)}e(c,"FailureDetails");function k(g,S){let D=r.Button??(j=>i("button",{type:"button",disabled:j.disabled,onClick:j.onClick},j.children));return i(D,{variant:"outline",size:"sm",...S},g)}e(k,"textButton");function y({t:g,from:S,to:D,onFrom:j,onTo:U,invalid:z,onClear:H}){return i("div",{className:"dsham_dateFilter"},i(ua,{React:t,from:S,to:D,invalid:z,label:g("discovery.date"),fromLabel:g("discovery.from"),toLabel:g("discovery.to"),onFrom:j,onTo:U,onClear:H,t:g}),z?i("p",{className:"dsham_dateAlert",role:"alert"},g("discovery.invalidDate")):null)}e(y,"DiscoveryFilters");function A({state:g,t:S}){return g.status==="idle"?null:i("div",{className:"dsham_discoveryStatus",role:"status","aria-live":"polite"},i("p",null,S(g.status==="loading"?"discovery.searching":g.status==="error"?"discovery.searchError":"discovery.searched",{done:g.done??0,total:g.total??0})),g.status==="error"&&i("p",null,g.error),g.failures.length>0&&i(c,{title:S("discovery.failed",{n:g.failures.length}),failures:g.failures,separator:S("common.separator")}),(g.status==="error"||g.status==="ready"&&g.failures.length>0)&&k(S("discovery.retry"),{onClick:g.retry}))}e(A,"SearchStatus");function w({preview:g,t:S,MarkdownText:D}){let[j,U]=t.useState(!1);if(g.status==="loading")return i("p",{role:"status"},S("discovery.loading"));if(g.status==="error")return i("div",null,i("p",{role:"alert"},g.error),k(S("discovery.retry"),{onClick:g.retry}));let z=g.value;return z?i("div",{className:"dsham_previewMessages"},i("div",{className:"dsham_previewToolbar"},i("span",{title:S("discovery.previewHint")},S("discovery.readOnly")," \xB7 ",S("discovery.messageCount",{n:z.messages.length})),D&&i(r.SegmentedControl??"div",{id:"dsham-preview-mode",label:S("discovery.displayMode"),value:j?"raw":"formatted",options:[{value:"formatted",label:S("discovery.formatted")},{value:"raw",label:S("discovery.raw")}],onChange:e(H=>U(H==="raw"),"onChange")})),z.hasEarlier&&i("p",null,S("discovery.earlier")),!z.messages.length&&i("p",null,S("discovery.empty")),z.messages.map(H=>i("article",{key:H.seq,className:"dsham_previewMessage"},i("div",{className:"dsham_previewRole","data-role":H.role},i("span",{"aria-hidden":!0},S(H.role==="user"?"discovery.you":"discovery.ai")),i("strong",null,S("discovery."+H.role))),j||!D?i("pre",{className:"dsham_previewRaw"},i(a,{text:H.text,query:g.target?.query})):i(D,{text:H.text,streaming:!1,labels:{code:{copyLabel:S("discovery.copyCode"),copiedLabel:S("details.copied")},footnotes:S("discovery.footnotes")}}),H.truncated&&i("small",null,S("discovery.truncated")))),z.hasLater&&i("p",null,S("discovery.later"))):null}return e(w,"PreviewContent"),{HighlightedText:a,useArchiveSearch:o,useArchivePreview:f,DiscoveryFilters:y,SearchStatus:A,PreviewContent:w}}e(wa,"createDiscoveryTools");var Sa=[".dsham_dateFilter{display:flex;align-items:center;gap:8px;min-width:0;position:relative}",".dsham_dateAlert{position:absolute;top:calc(100% + 4px);right:0;margin:0;width:max-content;max-width:240px;padding:4px 8px;background:var(--dsw-alias-bg-layer-2);border:0.5px solid var(--dsw-alias-state-error-primary);border-radius:6px;box-shadow:0 4px 12px rgba(0,0,0,0.25);z-index:1100;font-size:12px;line-height:16px;color:var(--dsw-alias-state-error-primary);pointer-events:none}",".dsham_dateRange{position:relative;display:inline-flex;align-items:center;flex:1 1 auto;min-width:0;box-sizing:border-box}",".dsham_dateTrigger{display:inline-flex;align-items:center;gap:6px;width:100%;height:32px;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;line-height:20px;cursor:pointer;box-sizing:border-box;transition:all .15s ease}",".dsham_dateTrigger:hover{border-color:var(--dsw-alias-border-l3)}",".dsham_dateTrigger.is-open{border-color:var(--dsw-alias-state-business-primary);box-shadow:0 0 0 1px var(--dsw-alias-state-business-primary)}",".dsham_dateIcon{flex:none;color:var(--dsw-alias-label-tertiary);display:flex;align-items:center}",".dsham_dateText{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;color:var(--dsw-alias-label-primary)}",".dsham_dateText.placeholder{color:var(--dsw-alias-label-primary)}",".dsham_dateClearBtn{flex:none;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-tertiary);border-radius:50%;cursor:pointer;font-size:13px;line-height:1}",".dsham_dateClearBtn:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}",".dsham_dateChevron{flex:none;color:var(--dsw-alias-label-tertiary);display:flex;align-items:center}",".dsham_dateInputSrOnly{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}",".dsham_datePopover{position:absolute;top:calc(100% + 4px);right:0;left:auto;z-index:1000;display:flex;gap:10px;padding:10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md,10px);background:var(--dsw-alias-bg-layer-1);box-shadow:0 8px 24px rgba(0,0,0,0.12),0 2px 6px rgba(0,0,0,0.06);box-sizing:border-box}",".dsham_datePresets{width:84px;border-right:0.5px solid var(--dsw-alias-border-l2);padding-right:8px;display:flex;flex-direction:column;gap:3px;flex:none}",".dsham_datePresetBtn{border:0;background:transparent;padding:5px 6px;text-align:left;font:inherit;font-size:12px;color:var(--dsw-alias-label-secondary);border-radius:var(--dsw-radius-sm,6px);cursor:pointer;transition:all .15s ease;white-space:nowrap}",".dsham_datePresetBtn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}",".dsham_dateCalendar{width:224px;display:flex;flex-direction:column;gap:6px;flex:none}",".dsham_dateCalHeader{display:flex;justify-content:space-between;align-items:center;padding:0 2px}",".dsham_dateMonthTitle{font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary)}",".dsham_dateNavBtn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:0;border-radius:4px;background:transparent;color:var(--dsw-alias-label-secondary);cursor:pointer;font-size:14px;line-height:1}",".dsham_dateNavBtn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}",".dsham_dateGrid{display:grid;grid-template-columns:repeat(7,1fr);row-gap:2px}",".dsham_dateWeekday{font-size:11px;color:var(--dsw-alias-label-tertiary);text-align:center;padding:3px 0;font-weight:500}",".dsham_dateDay{position:relative;height:26px;display:flex;align-items:center;justify-content:center;font-size:12px;color:var(--dsw-alias-label-primary);cursor:pointer;border-radius:0}",".dsham_dateDay.is-outside{color:var(--dsw-alias-label-quaternary)}",".dsham_dateDay:not(.is-outside):hover{background:var(--dsw-alias-interactive-bg-hover);border-radius:4px}",".dsham_dateDay.is-start{background:var(--dsw-alias-state-business-primary)!important;color:#fff!important;border-top-left-radius:6px;border-bottom-left-radius:6px}",".dsham_dateDay.is-end{background:var(--dsw-alias-state-business-primary)!important;color:#fff!important;border-top-right-radius:6px;border-bottom-right-radius:6px}",".dsham_dateDay.is-start.is-end{border-radius:6px!important}",".dsham_dateDay.is-in-range{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-state-business-primary)}",".dsham_dateDay.is-today::after{content:'';position:absolute;bottom:2px;width:3px;height:3px;border-radius:50%;background:var(--dsw-alias-state-business-primary)}",".dsham_dateDay.is-start.is-today::after,.dsham_dateDay.is-end.is-today::after{background:#fff}",".dsham_discoveryStatus{font-size:12px;margin-bottom:12px;overflow-wrap:anywhere}",".dsham_settingsSnippet{display:block;width:100%;padding:0;margin:4px 0 0;border:0;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}",".dsham_previewMessages{max-height:65vh;overflow:auto;overflow-wrap:anywhere;padding-right:8px}",".dsham_previewToolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px;color:var(--dsw-alias-label-secondary);font-size:12px}",".dsham_previewRole{display:flex;align-items:center;gap:8px;margin-bottom:12px;font-size:13px}",".dsham_previewRole>span{display:grid;place-items:center;width:28px;height:28px;border-radius:8px;background:var(--dsw-alias-bg-layer-3);font-size:11px}",".dsham_previewRole[data-role=user]>span{color:var(--dsw-alias-state-business-primary)}",".dsham_previewRaw{white-space:pre-wrap;font:13px/1.8 ui-monospace,monospace;overflow-wrap:anywhere}",".dsham_previewMessage pre:not(.dsham_previewRaw){white-space:pre;overflow-x:auto;max-width:100%}",".dsham_previewMessage table{display:block;max-width:100%;overflow-x:auto}",".dsham_previewMessage img{max-width:100%}","@media(max-width:520px){.dsham_previewToolbar{align-items:flex-start;flex-wrap:wrap}}",".dsham_previewMessage{padding:18px 0;border-bottom:1px solid var(--dsw-alias-border-l2)}",".dsham_previewMessage p{font-size:14px;line-height:1.8}",".dsham_previewHint,.dsham_previewMessage small{color:var(--dsw-alias-label-secondary);font-size:12px}",".dsham_settings mark,.dsham_previewMessages mark{background:var(--dsw-alias-state-warn-tertiary);color:inherit;border-radius:2px}",".dsham_settingsSnippet:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}"].join(""),xa={"common.separator":"\uFF1A","copy.empty":"\u6CA1\u6709\u53EF\u590D\u5236\u7684\u5185\u5BB9","copy.unavailable":"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u526A\u8D34\u677F\uFF0C\u8BF7\u5728 HTTPS \u6216\u672C\u673A\u5730\u5740\u4E2D\u6253\u5F00\u9875\u9762","copy.denied":"\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u5141\u8BB8\u6D4F\u89C8\u5668\u8BBF\u95EE\u526A\u8D34\u677F\u540E\u91CD\u8BD5","discovery.you":"\u4F60","discovery.ai":"AI","discovery.readOnly":"\u53EA\u8BFB\u9884\u89C8","discovery.messageCount":"\u672C\u6B21\u663E\u793A {n} \u6761\u6D88\u606F","discovery.displayMode":"\u663E\u793A\u65B9\u5F0F","discovery.formatted":"\u6392\u7248","discovery.raw":"\u539F\u6587\u4E0E\u9AD8\u4EAE","discovery.copyCode":"\u590D\u5236\u4EE3\u7801","discovery.footnotes":"\u6CE8\u91CA","details.copyId":"\u590D\u5236\u4F1A\u8BDD ID","details.copied":"\u5DF2\u590D\u5236","discovery.date":"\u65E5\u671F","discovery.timeRange":"\u65F6\u95F4\u8303\u56F4","discovery.allTime":"\u5168\u90E8\u65F6\u95F4","discovery.today":"\u4ECA\u5929","discovery.last7Days":"\u8FD1 7 \u5929","discovery.last30Days":"\u8FD1 30 \u5929","discovery.last90Days":"\u8FD1 90 \u5929","discovery.customRange":"\u81EA\u5B9A\u4E49\u2026","discovery.dateActive":"\u65E5\u671F\xB7\u5DF2\u9009","discovery.clearDate":"\u6E05\u9664\u65E5\u671F","discovery.active":"\u5DF2\u542F\u7528","discovery.scope":"\u67E5\u627E\u8303\u56F4","discovery.titleOnly":"\u4EC5\u6807\u9898","discovery.titleAndContent":"\u6807\u9898\u4E0E\u6B63\u6587","discovery.from":"\u66F4\u65B0\u65F6\u95F4\u4ECE","discovery.to":"\u81F3","discovery.clear":"\u6E05\u9664\u6761\u4EF6","discovery.invalidDate":"\u5F00\u59CB\u65E5\u671F\u4E0D\u80FD\u665A\u4E8E\u7ED3\u675F\u65E5\u671F\uFF0C\u8BF7\u68C0\u67E5\u65E5\u671F\u8303\u56F4\u3002","discovery.searching":"\u6B63\u5728\u68C0\u7D22\u6B63\u6587\uFF1A{done} / {total}","discovery.searched":"\u6B63\u6587\u68C0\u7D22\u5B8C\u6210\uFF1A{done} / {total}","discovery.searchError":"\u6B63\u6587\u68C0\u7D22\u672A\u5B8C\u6210\uFF0C\u5F53\u524D\u7ED3\u679C\u53EF\u80FD\u4E0D\u5B8C\u6574\u3002","discovery.failed":"{n} \u6761\u4F1A\u8BDD\u8BFB\u53D6\u5931\u8D25","discovery.retry":"\u91CD\u8BD5","discovery.preview":"\u5FEB\u901F\u9884\u89C8","discovery.loading":"\u6B63\u5728\u8BFB\u53D6\u4F1A\u8BDD\u2026","discovery.previewHint":"\u53EA\u8BFB\u9884\u89C8\u539F\u59CB\u5BF9\u8BDD\u6587\u672C\uFF0C\u4E0D\u6062\u590D\u4F1A\u8BDD\uFF1B\u4E0D\u542B\u5DE5\u5177\u8F93\u51FA\u3001\u9644\u4EF6\u3001\u63A8\u7406\u548C\u7CFB\u7EDF\u5185\u5BB9\u3002","discovery.earlier":"\u524D\u9762\u8FD8\u6709\u6D88\u606F\uFF0C\u53EF\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD\u67E5\u770B\u3002","discovery.later":"\u540E\u9762\u8FD8\u6709\u6D88\u606F\uFF0C\u53EF\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD\u67E5\u770B\u3002","discovery.empty":"\u6CA1\u6709\u53EF\u9884\u89C8\u7684\u7528\u6237\u6216\u52A9\u624B\u6587\u672C\u3002","discovery.truncated":"\u672C\u6761\u4EC5\u663E\u793A\u90E8\u5206\u5185\u5BB9\u3002","discovery.user":"\u7528\u6237","discovery.assistant":"\u52A9\u624B","discovery.openFull":"\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD","discovery.searchPlaceholder":"\u641C\u7D22\u6807\u9898\u6216\u6B63\u6587"},ka={"common.separator":": ","copy.empty":"Nothing to copy","copy.unavailable":"Clipboard unavailable. Open the page over HTTPS or localhost.","copy.denied":"Copy failed. Allow clipboard access and retry.","discovery.you":"You","discovery.ai":"AI","discovery.readOnly":"Read-only preview","discovery.messageCount":"Showing {n} messages","discovery.displayMode":"Display mode","discovery.formatted":"Formatted","discovery.raw":"Source and highlights","discovery.copyCode":"Copy code","discovery.footnotes":"Footnotes","details.copyId":"Copy session ID","details.copied":"Copied","discovery.date":"Date","discovery.timeRange":"Time range","discovery.allTime":"All time","discovery.today":"Today","discovery.last7Days":"Past 7 days","discovery.last30Days":"Past 30 days","discovery.last90Days":"Past 90 days","discovery.customRange":"Custom\u2026","discovery.dateActive":"Date \xB7 Set","discovery.clearDate":"Clear dates","discovery.active":"Active","discovery.scope":"Search in","discovery.titleOnly":"Titles","discovery.titleAndContent":"Titles and content","discovery.from":"Updated from","discovery.to":"To","discovery.clear":"Clear filters","discovery.invalidDate":"Check the date range: the start must not be after the end.","discovery.searching":"Searching content: {done} / {total}","discovery.searched":"Content search complete: {done} / {total}","discovery.searchError":"Content search is incomplete; results may be missing.","discovery.failed":"Could not read {n} conversations","discovery.retry":"Retry","discovery.preview":"Quick preview","discovery.loading":"Reading conversation\u2026","discovery.previewHint":"Read-only original conversation text; keeps the conversation archived. Excludes tools, attachments, reasoning and system content.","discovery.earlier":"More messages before this preview. Open the full conversation to read them.","discovery.later":"More messages after this preview. Open the full conversation to read them.","discovery.empty":"No user or assistant text to preview.","discovery.truncated":"Only part of this message is shown.","discovery.user":"User","discovery.assistant":"Assistant","discovery.openFull":"Open full conversation","discovery.searchPlaceholder":"Search titles or content"},Ca={"common.separator":": ","copy.empty":"\u041D\u0435\u0447\u0435\u0433\u043E \u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C","copy.unavailable":"\u0411\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u043F\u043E HTTPS \u0438\u043B\u0438 localhost.","copy.denied":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C. \u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u0435 \u0434\u043E\u0441\u0442\u0443\u043F \u043A \u0431\u0443\u0444\u0435\u0440\u0443 \u043E\u0431\u043C\u0435\u043D\u0430 \u0438 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435.","discovery.you":"\u0412\u044B","discovery.ai":"\u0418\u0418","discovery.readOnly":"\u041F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0442\u043E\u043B\u044C\u043A\u043E \u0434\u043B\u044F \u0447\u0442\u0435\u043D\u0438\u044F","discovery.messageCount":"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u043E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439: {n}","discovery.displayMode":"\u0420\u0435\u0436\u0438\u043C \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F","discovery.formatted":"\u0424\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u043E","discovery.raw":"\u0418\u0441\u0445\u043E\u0434\u043D\u0438\u043A \u0438 \u043F\u043E\u0434\u0441\u0432\u0435\u0442\u043A\u0430","discovery.copyCode":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043A\u043E\u0434","discovery.footnotes":"\u0421\u043D\u043E\u0441\u043A\u0438","details.copyId":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C ID \u0441\u0435\u0441\u0441\u0438\u0438","details.copied":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E","discovery.date":"\u0414\u0430\u0442\u0430","discovery.timeRange":"\u041F\u0435\u0440\u0438\u043E\u0434","discovery.allTime":"\u0412\u0441\u0435 \u0432\u0440\u0435\u043C\u044F","discovery.today":"\u0421\u0435\u0433\u043E\u0434\u043D\u044F","discovery.last7Days":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 7 \u0434\u043D\u0435\u0439","discovery.last30Days":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 30 \u0434\u043D\u0435\u0439","discovery.last90Days":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 90 \u0434\u043D\u0435\u0439","discovery.customRange":"\u0421\u0432\u043E\u0439 \u043F\u0435\u0440\u0438\u043E\u0434\u2026","discovery.dateActive":"\u0414\u0430\u0442\u0430 \xB7 \u0412\u044B\u0431\u0440\u0430\u043D\u0430","discovery.clearDate":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0434\u0430\u0442\u044B","discovery.active":"\u0412\u043A\u043B\u044E\u0447\u0435\u043D\u043E","discovery.scope":"\u0418\u0441\u043A\u0430\u0442\u044C \u0432","discovery.titleOnly":"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u044F","discovery.titleAndContent":"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u044F \u0438 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0435","discovery.from":"\u041E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u043E \u0441","discovery.to":"\u041F\u043E","discovery.clear":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440\u044B","discovery.invalidDate":"\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D \u0434\u0430\u0442: \u043D\u0430\u0447\u0430\u043B\u043E \u043D\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043F\u043E\u0437\u0436\u0435 \u043A\u043E\u043D\u0446\u0430.","discovery.searching":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443: {done} / {total}","discovery.searched":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443 \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043D: {done} / {total}","discovery.searchError":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443 \u043D\u0435\u043F\u043E\u043B\u043D\u044B\u0439; \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u043D\u0435\u043F\u043E\u043B\u043D\u044B\u043C\u0438.","discovery.failed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C {n} \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u043E\u0432","discovery.retry":"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C","discovery.preview":"\u0411\u044B\u0441\u0442\u0440\u044B\u0439 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440","discovery.loading":"\u0427\u0442\u0435\u043D\u0438\u0435 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u0430\u2026","discovery.previewHint":"\u0422\u043E\u043B\u044C\u043A\u043E \u0447\u0442\u0435\u043D\u0438\u0435 \u0438\u0441\u0445\u043E\u0434\u043D\u043E\u0433\u043E \u0442\u0435\u043A\u0441\u0442\u0430 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u0430; \u0441\u0435\u0441\u0441\u0438\u044F \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0432 \u0430\u0440\u0445\u0438\u0432\u0435. \u0411\u0435\u0437 \u0432\u044B\u0432\u043E\u0434\u0430 \u0438\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u043E\u0432, \u0432\u043B\u043E\u0436\u0435\u043D\u0438\u0439, \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043D\u0438\u0439 \u0438 \u0441\u0438\u0441\u0442\u0435\u043C\u043D\u043E\u0433\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0433\u043E.","discovery.earlier":"\u041F\u0435\u0440\u0435\u0434 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u043E\u043C \u0435\u0441\u0442\u044C \u0435\u0449\u0451 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0447\u0442\u043E\u0431\u044B \u0438\u0445 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C.","discovery.later":"\u041F\u043E\u0441\u043B\u0435 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430 \u0435\u0441\u0442\u044C \u0435\u0449\u0451 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0447\u0442\u043E\u0431\u044B \u0438\u0445 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C.","discovery.empty":"\u041D\u0435\u0442 \u0442\u0435\u043A\u0441\u0442\u0430 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0438\u043B\u0438 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442\u0430 \u0434\u043B\u044F \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430.","discovery.truncated":"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u0430 \u0442\u043E\u043B\u044C\u043A\u043E \u0447\u0430\u0441\u0442\u044C \u044D\u0442\u043E\u0433\u043E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F.","discovery.user":"\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C","discovery.assistant":"\u0410\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442","discovery.openFull":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440","discovery.searchPlaceholder":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u044F\u043C \u0438\u043B\u0438 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443"};var Ea=e(t=>{let r=ce(t);if(!r||typeof r.sessionId!="string"||!r.sessionId.length||r.sessionId.length>1024||typeof r.identity!="string"||!r.identity.length||r.identity.length>4096)throw new TypeError("invalid cache rebuild candidate");return{sessionId:r.sessionId,identity:r.identity}},"candidate"),Ys={parse(t){let r=ce(t);if(!r||!Array.isArray(r.items)||!r.items.length||r.items.length>20)throw new TypeError("invalid cache rebuild batch (1\u201320 items required)");return{items:r.items.map(Ea)}}},pr={parse(t){let r=ce(t);if(!r||!Array.isArray(r.items)||r.count!==r.items.length)throw new TypeError("invalid cache diagnosis");return{count:r.items.length,items:r.items.map(Ea)}}},mr={parse(t){let r=ce(t);for(let i of["rebuiltSessionIds","skippedSessionIds"])if(!Array.isArray(r?.[i])||r[i].some(a=>typeof a!="string"))throw new TypeError("invalid cache rebuild result");if(!Array.isArray(r.failures)||r.failures.some(i=>!i||typeof i.sessionId!="string"||typeof i.message!="string"))throw new TypeError("invalid cache rebuild failures");return r}};function Ia(){let t=e((r,i)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${r}`,create:e(()=>i,"create"),schema:i}),"codec");return[{method:"diagnoseSessionCaches",parameters:[],result:t("CacheDiagnosis",pr)},{method:"rebuildSessionCaches",parameters:[{name:"input",wire:"input",source:"json",codec:t("CacheRebuildInput",Ys)}],result:t("CacheRebuildResult",mr)}].map(({method:r,...i})=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${r}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:r,invocation:{kind:"direct"},...i,sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}e(Ia,"cacheRebuildInvocations");function Ta(t,r={}){let{maxLoadRetries:i=3,retryDelayMs:a=200}=r,o={diagnosis:{count:0,items:[]},busy:!1,progress:null,result:null,error:null,refreshError:null},f=!0,c=0,k=[],y,A=new Set,w=e(S=>{if(f){o={...o,...S};for(let D of A)D()}},"update"),g=e(async(S=i)=>{if(!f)return;y!==void 0&&(clearTimeout(y),y=void 0);let D=++c;try{let j=pr.parse(await t.diagnose());f&&D===c&&w({diagnosis:j,error:null})}catch(j){if(S>0&&f&&D===c){y=setTimeout(()=>{y=void 0,f&&D===c&&g(S-1)},a);return}f&&D===c&&w({error:Be(j)})}},"load");return{snapshot:e(()=>o,"snapshot"),subscribe(S){return A.add(S),()=>{A.delete(S)}},load:g,async run(S=!1){if(!f||o.busy)return;++c,y!==void 0&&(clearTimeout(y),y=void 0);let D=S?[...k]:[...o.diagnosis.items],j={rebuiltSessionIds:[],skippedSessionIds:[],failures:[]};k=[],w({busy:!0,result:null,error:null,refreshError:null,progress:{done:0,total:D.length}});for(let[U,z]of D.entries()){if(!f)return;try{let H=mr.parse(await t.rebuild({items:[z]}));if(!f)return;j.rebuiltSessionIds.push(...H.rebuiltSessionIds),j.skippedSessionIds.push(...H.skippedSessionIds),j.failures.push(...H.failures),H.failures.length&&k.push(z)}catch(H){if(!f)return;j.failures.push({sessionId:z.sessionId,message:Be(H)}),k.push(z)}w({progress:{done:U+1,total:D.length}})}w({result:j});try{await t.refresh()}catch(U){w({refreshError:Be(U)})}f&&(await g(),w({busy:!1,progress:null}))},dismiss(){f&&w({result:null,error:null,refreshError:null})},dispose(){f=!1,++c,y!==void 0&&(clearTimeout(y),y=void 0),A.clear()}}}e(Ta,"createCacheRebuildController");var Yt=class extends Error{static{e(this,"ArchiveNavigationError")}code;constructor(r){super(r),this.name="ArchiveNavigationError",this.code=r}};function Aa(t,r){return t instanceof Yt?r(`archives.${t.code}`):Be(t)}e(Aa,"formatArchiveNavigationError");function Zs(t,r){if(typeof t?.retainInfo!="function")return;let i=t.retainInfo(r),a=i&&typeof i=="object"&&"getSnapshot"in i&&typeof i.getSnapshot=="function"?i.getSnapshot():i;if(!a||typeof a!="object"||!("retainedBy"in a))return;let o=a.retainedBy;if(!(!o||typeof o!="object"||!("mainView"in o)||typeof o.mainView!="number"))return{retainedBy:{mainView:o.mainView}}}e(Zs,"retainInfoSnapshot");function Js(t){let r=t?.byId;if(r!==void 0){for(let i of Object.values(r))if(i&&(i.retainedBy?.mainView??0)>0)return i.id}}e(Js,"mainViewSessionId");function Kn(t){return Js(t)}e(Kn,"currentSessionId");function Xs(t,r,i){return r===void 0||r===""?!1:(t?.byId?.[r]?.retainedBy?.mainView??0)>0||(Zs(i,r)?.retainedBy?.mainView??0)>0}e(Xs,"sessionIsCurrent");async function _a(t,r,i,a=()=>!0){if(i){if(typeof t.prepare=="function"&&await t.prepare(r),!a())return;await t.restore(r)}a()&&await t.open(r)}e(_a,"openArchivedConversation");function Ra(t,r,i,{onOpened:a=e(()=>{},"onOpened"),beginNavigation:o,warn:f=e((...c)=>console.warn(...c),"warn")}={}){let c,k=t?.clearArchivedCurrent,y=t&&Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent"),A=e(S=>Xs(r.list.getSnapshot(),S,r),"viewing"),w=e(function(...S){return c!==void 0&&A(c)&&i.list.getSnapshot().archivedSessionIds.includes(c)?!1:(c=void 0,k?.apply(this,S))},"wrapped"),g=e(()=>t&&Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent")?.value===w,"ownsWrapper");if(t&&typeof k=="function")try{if(t.clearArchivedCurrent=w,!g())throw new Error("\u5BFC\u822A\u65B9\u6CD5\u672A\u63A5\u7EB3\u5F52\u6863\u9002\u914D")}catch(S){f("archive-manager: \u65E0\u6CD5\u9002\u914D\u5F52\u6863\u5BFC\u822A\uFF0C\u8BF7\u6062\u590D\u4F1A\u8BDD\u540E\u6253\u5F00\u3002",S)}return{open(S){c=S;try{if(typeof k=="function"&&!g()&&i.list.getSnapshot().archivedSessionIds.includes(S))throw f("archive-manager: \u5F52\u6863\u5BFC\u822A\u9002\u914D\u4E0D\u53EF\u7528\u6216\u5DF2\u88AB\u66FF\u6362\u3002"),new Yt("navigationUnavailable");if(o?.(),typeof t?.openSession!="function")throw f("archive-manager: \u5BBF\u4E3B\u672A\u63D0\u4F9B\u4F1A\u8BDD\u6253\u5F00\u63A5\u53E3\u3002"),new Yt("navigationUnavailable");if(t.openSession(S),!A(S))throw f("archive-manager: \u5BBF\u4E3B\u672A\u4FDD\u7559\u76EE\u6807\u4F1A\u8BDD\u3002",{cleanupAvailable:typeof k=="function"}),new Yt("sessionNotRetained");a()}catch(D){throw c=void 0,D}},dispose(){c=void 0,!(!t||Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent")?.value!==w)&&(y?Object.defineProperty(t,"clearArchivedCurrent",y):delete t.clearArchivedCurrent,k?.call(t))}}}e(Ra,"allowArchivedNavigation");var nn=require("@deepseek-ai/dsh-client-ui-primitives");var ja={check:"\u68C0\u67E5\u66F4\u65B0",update:"\u66F4\u65B0",recheck:"\u91CD\u65B0\u68C0\u67E5",auto:"\u81EA\u52A8\u66F4\u65B0",updating:"\u6B63\u5728\u66F4\u65B0\u2026",copy:"\u590D\u5236\u547D\u4EE4",copied:"\u5DF2\u590D\u5236",copyFailed:"\u590D\u5236\u5931\u8D25",checking:"\u6B63\u5728\u68C0\u67E5\u66F4\u65B0\u2026",latest:"\u5DF2\u662F\u6700\u65B0\u7248\u672C",found:"\u53D1\u73B0\u65B0\u7248\u672C",failed:"\u68C0\u67E5\u66F4\u65B0\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",current:"\u8FD0\u884C\u7248\u672C",latestLabel:"\u6700\u65B0\u7248\u672C",profile:"\u76EE\u6807 profile",unknown:"\u672A\u77E5",manual:"\u624B\u5DE5\u66F4\u65B0",manualHint:"\u81EA\u52A8\u66F4\u65B0\u5931\u8D25\u65F6\uFF0C\u53EF\u5728\u5F53\u524D DSH \u7EC8\u7AEF\u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\uFF0C\u5B8C\u6210\u540E\u91CD\u542F DSH Web\u3002",manualHintDesktop:"\u81EA\u52A8\u66F4\u65B0\u5931\u8D25\u65F6\uFF0C\u8BF7\u5148\u5B8C\u5168\u9000\u51FA DSH Desktop\uFF0C\u518D\u7528 Desktop \u81EA\u5E26\u7684 dsh \u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\u3002\u666E\u901A dsh \u4F1A\u62D2\u7EDD desktop profile\u3002",intro:"\u4EC5\u68C0\u67E5\u5E76\u66F4\u65B0\u5F53\u524D\u63D2\u4EF6\uFF0C\u4E0D\u4F1A\u8054\u52A8\u5B89\u88C5\u5176\u4ED6\u63D2\u4EF6\u3002",restart:"\u66F4\u65B0\u5B8C\u6210\uFF0C\u8BF7\u91CD\u542F DSH Web\u3002",restartDesktop:"\u66F4\u65B0\u5B8C\u6210\uFF0C\u8BF7\u5B8C\u5168\u9000\u51FA\u5E76\u91CD\u65B0\u6253\u5F00 DSH Desktop\u3002",restarting:"\u66F4\u65B0\u5B8C\u6210\uFF0C\u6B63\u5728\u91CD\u542F DSH Desktop\u2026",unavailable:"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u81EA\u52A8\u66F4\u65B0\uFF0C\u8BF7\u4F7F\u7528\u624B\u5DE5\u66F4\u65B0\u547D\u4EE4\u3002"},Na={check:"Check for updates",update:"Update",recheck:"Check again",auto:"Update automatically",updating:"Updating\u2026",copy:"Copy command",copied:"Copied",copyFailed:"Copy failed",checking:"Checking for updates\u2026",latest:"You are up to date",found:"New version available",failed:"Could not check for updates. Try again later.",current:"Running version",latestLabel:"Latest version",profile:"Target profile",unknown:"Unknown",manual:"Manual update",manualHint:"If automatic update fails, run this command in the current DSH terminal, then restart DSH Web.",manualHintDesktop:"If automatic update fails, fully quit DSH Desktop, then run this command with Desktop's own dsh. A regular dsh rejects the desktop profile.",intro:"Only this plugin is checked and updated. Other plugins are not changed.",restart:"Update complete. Restart DSH Web.",restartDesktop:"Update complete. Fully quit and reopen DSH Desktop.",restarting:"Update complete. Restarting DSH Desktop\u2026",unavailable:"Automatic update is unavailable. Use the manual command."};function Nn(t){return t.toLowerCase().startsWith("zh")?ja:Na}e(Nn,"pluginUpdateCopy");function Qs(t,r,i,a){let o=Nn(t),f=r?.restartDesktop===!0||r?.profileName==="desktop",c=f?{...o,manualHint:o.manualHintDesktop}:o,k=i!=="idle",y=c.checking,A="";return i==="checking"?y=c.checking:i==="updating"?y=c.updating:a.type==="error"?(y=a.message||c.failed,A="error"):a.type==="restart"?(y=f?c.restartDesktop:c.restart,A="success"):a.type==="restarting"?(y=c.restarting,A="success"):r===void 0?y=c.checking:r.latestCheckFailed?(y=c.failed,A="error"):!r.canAutoUpdate&&r.updateAvailable?(y=c.unavailable,A="update"):r.updateAvailable?(y=`${c.found}: v${r.latestVersion??c.unknown}`,A="update"):(y=c.latest,A="success"),{copy:c,busy:k,message:y,kind:A,loading:i==="updating",updateLabel:i==="updating"?c.updating:c.auto,disabled:k||r?.canAutoUpdate!==!0||r.updateAvailable!==!0,currentVersion:r===void 0?c.unknown:`v${r.currentVersion}`,latestVersion:r?.latestVersion===void 0?c.unknown:`v${r.latestVersion}`,profileName:r?.profileName??c.unknown,profileRaw:r?.profileName??"",latestRaw:r?.latestVersion??"latest"}}e(Qs,"describePluginUpdate");function Da(t,r,i){let a="idle",o=r,f={type:"status"},c=0,k=new Set,y=e(()=>{for(let w of k)w()},"emit"),A=e(w=>{o=w,i?.(w)},"assign");return{get posts(){return c},subscribe(w){return k.add(w),()=>{k.delete(w)}},view(w){return Qs(w,o,a,f)},async check(){if(a==="idle"){a="checking",f={type:"status"},y();try{A(await t("GET")),f={type:"status"}}catch(w){f={type:"error",message:w instanceof Error?w.message:""}}finally{a="idle",y()}}},async update(){if(a==="idle"){a="updating",f={type:"status"},c+=1,y();try{let w=await t("POST");A(w),f={type:w.autoReload===!0?"restarting":"restart"}}catch(w){f={type:"error",message:w instanceof Error?w.message:""}}finally{a="idle",y()}}}}}e(Da,"createUpdateFlow");function Ma(t,r,i){return`dsh plugin${t.trim()===""?"":` --profile ${t.trim()}`} add ${r}@${i} --registry=https://registry.npmjs.org/`}e(Ma,"manualPluginUpdateCommand");function La(t,r){return t.key!=="Escape"?!1:(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),r(),!0)}e(La,"handlePluginUpdateEscape");function ei(){let t=globalThis.document;if(typeof t>"u"||t===null)return;let r=t.baseURI;if(!(typeof r!="string"||r===""))try{let i=new URL(r),a=i.pathname.lastIndexOf("/"),o=i.pathname.slice(a+1);return/\.(html?|php|aspx?|jsp)$/i.test(o)?i.pathname=i.pathname.slice(0,a+1):i.pathname.endsWith("/")||(i.pathname+="/"),i.href}catch{return}}e(ei,"pageBaseHref");function mn(t){if(typeof t!="string"||t.charAt(0)!=="/"||t.charAt(1)==="/")return t;let r=ei();if(r===void 0)return t;try{return new URL(t.slice(1),r).href}catch{return t}}e(mn,"resolveApiUrl");function za(t){let i=Function("return globalThis.__dshArchiveReactDOMClient")()?.createRoot;if(i===void 0)throw new Error("createRoot unavailable");return i(t)}e(za,"mountRoot");var ti="x-michengai-plugin-update",Pa="michengai-plugin-update-ui",fr=`
|
|
10
|
+
"use strict";var Vn=Object.defineProperty;var Ua=Object.getOwnPropertyDescriptor;var Wa=Object.getOwnPropertyNames;var qa=Object.prototype.hasOwnProperty;var e=(t,r)=>Vn(t,"name",{value:r,configurable:!0});var Va=(t,r)=>{for(var i in r)Vn(t,i,{get:r[i],enumerable:!0})},$a=(t,r,i,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of Wa(r))!qa.call(t,l)&&l!==i&&Vn(t,l,{get:()=>r[l],enumerable:!(s=Ua(r,l))||s.enumerable});return t};var Ga=t=>$a(Vn({},"__esModule",{value:!0}),t);var yi={};Va(yi,{startArchiveClient:()=>bi});module.exports=Ga(yi);function ce(t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError("\u53C2\u6570\u5FC5\u987B\u4E3A\u5BF9\u8C61");return t}e(ce,"record");function Oe(t){return String(t&&typeof t=="object"&&"message"in t?t.message??t:t)}e(Oe,"errorMessage");function $n(t){return t&&typeof t=="object"&&"code"in t?t.code:void 0}e($n,"errorCode");var cs=Function("return globalThis.__dshArchiveReact")(),{Children:Ci,Component:Ei,Fragment:ds,Profiler:Ii,PureComponent:Ti,StrictMode:Ai,Suspense:_i,cloneElement:Ri,createContext:ji,createElement:us,createRef:Ni,forwardRef:Mi,isValidElement:Di,lazy:Li,memo:zi,startTransition:Pi,useCallback:Oi,useContext:Fi,useDebugValue:Hi,useDeferredValue:Bi,useEffect:hs,useId:Ui,useImperativeHandle:Wi,useInsertionEffect:qi,useLayoutEffect:Vi,useMemo:$i,useReducer:Gi,useRef:Ki,useState:qt,useSyncExternalStore:Yi,useTransition:Zi,version:Ji}=cs,W=cs;function ms(t){return W.createElement("input",{className:"dsham_number",type:"number",min:t.min,max:t.max,value:t.value??"",disabled:t.disabled,"aria-label":t["aria-label"],onChange:e(r=>{let i=r.target.value;if(i===""){t.onChange(null);return}let s=Number(i);t.onChange(Number.isNaN(s)?null:s)},"onChange")})}e(ms,"NumberField");function Ya(t=W.createElement){return t("svg",{className:"dsham_dateIcon",width:14,height:14,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},t("rect",{x:2,y:3,width:12,height:11,rx:2}),t("line",{x1:2,y1:6.5,x2:14,y2:6.5}),t("line",{x1:5.5,y1:1.5,x2:5.5,y2:3.5}),t("line",{x1:10.5,y1:1.5,x2:10.5,y2:3.5}))}e(Ya,"CalendarIcon");function Nn(t,r,i){let s=String(r+1).padStart(2,"0"),l=String(i).padStart(2,"0");return`${t}-${s}-${l}`}e(Nn,"formatYmd");function mn(t){let r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);return r?{year:Number(r[1]),monthIndex:Number(r[2])-1,day:Number(r[3])}:null}e(mn,"parseYmd");function Za(t,r){let i=new Date(t,r,1).getDay(),s=(i===0?7:i)-1,l=new Date(t,r+1,0).getDate(),u=new Date(t,r,0).getDate(),m=[];for(let C=0;C<42;C++){let y=t,_=r,x=0,g=!1;C<s?(x=u-s+C+1,_=r-1,_<0&&(_=11,y--),g=!0):C<s+l?x=C-s+1:(x=C-s-l+1,_=r+1,_>11&&(_=0,y++),g=!0),m.push({year:y,monthIndex:_,day:x,dateStr:Nn(y,_,x),isOutside:g})}return m}e(Za,"buildMonthGrid");function Ja(t,r=new Date){if(t==="all")return{from:"",to:""};let i=Nn(r.getFullYear(),r.getMonth(),r.getDate());if(t==="today")return{from:i,to:i};let s=t==="7d"?6:t==="30d"?29:89,l=new Date(r.getTime()-s*864e5);return{from:Nn(l.getFullYear(),l.getMonth(),l.getDate()),to:i}}e(Ja,"getPresetRange");function ps(t,r,i,s){let l=r+s,u=new Date(t,l+1,0).getDate();return new Date(t,l,Math.min(i,u))}e(ps,"shiftMonthClamped");function fs(t){let r=t.React||W;function i(T,he){let it=T==="from"?he:t.from,vn=T==="to"?he:t.to;if(it===""&&vn===""){t.onClear();return}T==="from"?t.onFrom(he):t.onTo(he)}e(i,"change");let s=!!(t.from||t.to),l="";t.from&&t.to?l=`${t.from} \u2013 ${t.to}`:t.from?l=`${t.from} \u2013`:t.to?l=`\u2013 ${t.to}`:l=t.t?t.t("discovery.timeRange")||`${t.fromLabel} \u2013 ${t.toLabel}`:`${t.fromLabel} \u2013 ${t.toLabel}`;let m=(r.useRef??(T=>{let[he]=r.useState({current:T});return he}))(null),[C,y]=r.useState(!1),_=mn(t.from||t.to)??{year:new Date().getFullYear(),monthIndex:new Date().getMonth(),day:new Date().getDate()},[x,g]=r.useState(_.year),[w,D]=r.useState(_.monthIndex),[j,U]=r.useState(null),[P,B]=r.useState(null),[me,le]=r.useState(null);r.useEffect(()=>{if(!C)return;let T=e(it=>{m.current&&!m.current.contains(it.target)&&(y(!1),U(null))},"onPointerDown"),he=e(it=>{it.key==="Escape"&&(it.preventDefault(),it.stopPropagation(),y(!1),U(null))},"onKeyDown");return typeof document<"u"&&document.addEventListener("mousedown",T,!0),typeof window<"u"&&window.addEventListener("keydown",he,!0),()=>{typeof document<"u"&&document.removeEventListener("mousedown",T,!0),typeof window<"u"&&window.removeEventListener("keydown",he,!0)}},[C]),r.useEffect(()=>{if(!C||!me||!m.current)return;m.current.querySelector(`[data-date="${me}"]`)?.focus()},[C,me]);let V=t.t?t.t("discovery.today")==="Today"||(t.t("locale.language")||"").startsWith("en"):!1,fe=t.t?t.t("discovery.today")==="\u0421\u0435\u0433\u043E\u0434\u043D\u044F"||(t.t("locale.language")||"").startsWith("ru"):!1,ue=V?"en-US":fe?"ru-RU":"zh-CN",Qe=V?["Mo","Tu","We","Th","Fr","Sa","Su"]:fe?["\u041F\u043D","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041F\u0442","\u0421\u0431","\u0412\u0441"]:["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u65E5"];function re(T){T.stopPropagation(),w<=0?(D(11),g(he=>he-1)):D(he=>he-1)}e(re,"prevMonth");function X(T){T.stopPropagation(),w>=11?(D(0),g(he=>he+1)):D(he=>he+1)}e(X,"nextMonth");function yt(T){j?(T>=j?(t.onFrom(j),t.onTo(T)):(t.onFrom(T),t.onTo(j)),U(null),y(!1)):(U(T),B(T))}e(yt,"handleDayClick");function St(T){let he=Ja(T);T==="all"?t.onClear():(t.onFrom(he.from),t.onTo(he.to)),U(null),y(!1)}e(St,"applyPreset");function et(T){let he=Nn(T.getFullYear(),T.getMonth(),T.getDate());le(he),j&&B(he),(T.getFullYear()!==x||T.getMonth()!==w)&&(g(T.getFullYear()),D(T.getMonth()))}e(et,"moveFocusToDate");function dt(T,he){let it=mn(T);it&&et(new Date(it.year,it.monthIndex,it.day+he))}e(dt,"moveFocus");let xt=t.from,$e=t.to;j&&P&&(xt=j<=P?j:P,$e=j<=P?P:j);let en=Za(x,w),tt=new Date,tn=me||xt||Nn(tt.getFullYear(),tt.getMonth(),tt.getDate()),F=en.map((T,he)=>{let it=xt===T.dateStr,vn=$e===T.dateStr,Ht=!!(xt&&$e&&T.dateStr>xt&&T.dateStr<$e),Ln=T.year===tt.getFullYear()&&T.monthIndex===tt.getMonth()&&T.day===tt.getDate(),Bt="dsham_dateDay";T.isOutside&&(Bt+=" is-outside"),Ln&&(Bt+=" is-today"),it&&(Bt+=" is-start"),vn&&(Bt+=" is-end"),Ht&&(Bt+=" is-in-range");let zn=!T.isOutside&&(T.dateStr===tn||T.day===1&&!en.some(ie=>!ie.isOutside&&ie.dateStr===tn));return r.createElement("div",{key:he,className:Bt,role:"button",tabIndex:zn?0:-1,"data-date":T.dateStr,"aria-label":T.dateStr,"aria-pressed":!!(it||vn||Ht),onClick:e(ie=>{ie.stopPropagation(),yt(T.dateStr)},"onClick"),onKeyDown:e(ie=>{if(ie.key==="Enter"||ie.key===" ")ie.preventDefault(),ie.stopPropagation(),yt(T.dateStr);else if(ie.key==="ArrowLeft")ie.preventDefault(),ie.stopPropagation(),dt(T.dateStr,-1);else if(ie.key==="ArrowRight")ie.preventDefault(),ie.stopPropagation(),dt(T.dateStr,1);else if(ie.key==="ArrowUp")ie.preventDefault(),ie.stopPropagation(),dt(T.dateStr,-7);else if(ie.key==="ArrowDown")ie.preventDefault(),ie.stopPropagation(),dt(T.dateStr,7);else if(ie.key==="Home"){ie.preventDefault(),ie.stopPropagation();let ke=mn(T.dateStr);if(ke){let ot=new Date(ke.year,ke.monthIndex,ke.day),ln=(ot.getDay()===0?7:ot.getDay())-1;ot.setDate(ot.getDate()-ln),et(ot)}}else if(ie.key==="End"){ie.preventDefault(),ie.stopPropagation();let ke=mn(T.dateStr);if(ke){let ot=new Date(ke.year,ke.monthIndex,ke.day),ln=(ot.getDay()===0?7:ot.getDay())-1;ot.setDate(ot.getDate()+(6-ln)),et(ot)}}else if(ie.key==="PageUp"){ie.preventDefault(),ie.stopPropagation();let ke=mn(T.dateStr);ke&&et(ps(ke.year,ke.monthIndex,ke.day,-1))}else if(ie.key==="PageDown"){ie.preventDefault(),ie.stopPropagation();let ke=mn(T.dateStr);ke&&et(ps(ke.year,ke.monthIndex,ke.day,1))}},"onKeyDown"),onMouseEnter:e(()=>{j&&B(T.dateStr)},"onMouseEnter")},T.day)}),De=`${x}\u5E74 ${w+1}\u6708`;try{De=new Intl.DateTimeFormat(ue,{year:"numeric",month:"long"}).format(new Date(x,w,1))}catch{De=V||fe?`${x}-${String(w+1).padStart(2,"0")}`:`${x}\u5E74 ${w+1}\u6708`}return r.createElement("div",{ref:m,className:"dsham_dateRange",role:"group","aria-label":t.label},r.createElement("input",{className:"dsham_dateInputSrOnly",type:"date",tabIndex:-1,"aria-hidden":!0,value:t.from,"aria-label":t.fromLabel,"aria-invalid":t.invalid||void 0,onChange:e(T=>i("from",T.target.value),"onChange")}),r.createElement("input",{className:"dsham_dateInputSrOnly",type:"date",tabIndex:-1,"aria-hidden":!0,value:t.to,"aria-label":t.toLabel,"aria-invalid":t.invalid||void 0,onChange:e(T=>i("to",T.target.value),"onChange")}),r.createElement("div",{className:"dsham_dateTrigger"+(C?" is-open":""),role:"button",tabIndex:0,"aria-expanded":C,"aria-controls":C?"dsham-date-popover":void 0,onClick:e(()=>{C&&U(null),y(!C)},"onClick"),onKeyDown:e(T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),C&&U(null),y(!C))},"onKeyDown")},Ya(r.createElement),r.createElement("span",{className:"dsham_dateText"+(s?"":" placeholder")},l),s?r.createElement("button",{type:"button",className:"dsham_dateClearBtn","aria-label":"clear",title:"clear",onClick:e(T=>{T.stopPropagation(),t.onClear(),U(null)},"onClick"),children:"\xD7"}):null,r.createElement("span",{className:"dsham_dateChevron"},gs(r.createElement,C))),C&&r.createElement("div",{id:"dsham-date-popover",className:"dsham_datePopover",role:"region","aria-label":t.label,onClick:e(T=>T.stopPropagation(),"onClick")},r.createElement("div",{className:"dsham_datePresets"},r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>St("all"),"onClick")},t.t?t.t("discovery.allTime"):"\u5168\u90E8\u65F6\u95F4"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>St("today"),"onClick")},t.t?t.t("discovery.today"):"\u4ECA\u5929"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>St("7d"),"onClick")},t.t?t.t("discovery.last7Days"):"\u8FD1 7 \u5929"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>St("30d"),"onClick")},t.t?t.t("discovery.last30Days"):"\u8FD1 30 \u5929"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>St("90d"),"onClick")},t.t?t.t("discovery.last90Days"):"\u8FD1 90 \u5929")),r.createElement("div",{className:"dsham_dateCalendar"},r.createElement("div",{className:"dsham_dateCalHeader"},r.createElement("button",{type:"button",className:"dsham_dateNavBtn",onClick:re,"aria-label":"prev month"},"\u2039"),r.createElement("span",{className:"dsham_dateMonthTitle"},De),r.createElement("button",{type:"button",className:"dsham_dateNavBtn",onClick:X,"aria-label":"next month"},"\u203A")),r.createElement("div",{className:"dsham_dateGrid"},Qe.map((T,he)=>r.createElement("div",{key:he,className:"dsham_dateWeekday"},T))),r.createElement("div",{className:"dsham_dateGrid"},F))))}e(fs,"DateRange");function Gn(t){return W.createElement("div",{className:t.className},W.createElement("button",{type:"button",className:"dsham_disclosure","aria-expanded":t.open,onClick:t.onToggle},gs(W.createElement,t.open),t.title),t.open?W.createElement("div",null,t.children):null)}e(Gn,"Disclosure");function gs(t,r){return t("svg",{className:"dsham_foldChevron"+(r?" is-open":""),viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":!0},t("path",{d:"M4 6l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"}))}e(gs,"foldChevron");function ur(t){let r=W.useRef(null);return W.useEffect(()=>{r.current&&(r.current.indeterminate=!!t.indeterminate&&!t.checked)},[t.indeterminate,t.checked]),W.createElement("input",{ref:r,className:"dsham_checkbox",type:"checkbox",checked:t.checked,disabled:t.disabled,"aria-label":t.label,onChange:e(i=>t.onChange({target:{checked:i.target.checked}}),"onChange")})}e(ur,"SelectionCheckbox");var Mn=e(t=>{if(typeof t!="string"||!t.length||t.length>1024)throw new TypeError("\u4F1A\u8BDD ID \u65E0\u6548");return t},"id"),bs=e((t,r=!1)=>{if(typeof t!="string"||t.length>200||r&&!t.trim())throw new TypeError("\u5173\u952E\u8BCD\u987B\u4E3A 1\uFF5E200 \u4E2A\u5B57\u7B26");return t.trim()},"queryText"),vs={parse(t){let r=ce(t);if(!r||!Array.isArray(r.sessionIds)||!r.sessionIds.length||r.sessionIds.length>20)throw new TypeError("\u6BCF\u6B21\u68C0\u7D22\u987B\u5305\u542B 1\uFF5E20 \u4E2A\u4F1A\u8BDD");return{sessionIds:[...new Set(r.sessionIds.map(Mn))],query:bs(r.query,!0)}}},Xa={parse(t){let r=ce(t);if(!r)throw new TypeError("\u9884\u89C8\u53C2\u6570\u65E0\u6548");return{sessionId:Mn(r.sessionId),query:bs(r.query??"")}}},hr=e((t,r)=>{if(typeof t!="string"||t.length>r)throw new TypeError("\u8FD4\u56DE\u6587\u672C\u65E0\u6548");return t},"boundedString"),ys=e(t=>{if(typeof t!="number"||!Number.isSafeInteger(t)||t<0)throw new TypeError("\u6D88\u606F\u5E8F\u53F7\u65E0\u6548");return t},"sequence"),pr={parse(t){let r=ce(t);if(!r||!Array.isArray(r.items)||!Array.isArray(r.failures)||r.items.length>20||r.failures.length>20)throw new TypeError("\u68C0\u7D22\u7ED3\u679C\u65E0\u6548");return{items:r.items.map(ce).map(i=>({sessionId:Mn(i.sessionId),seq:ys(i.seq),snippet:hr(i.snippet,400)})),failures:r.failures.map(ce).map(i=>({sessionId:Mn(i.sessionId),message:hr(i.message,500)}))}}},Qa={parse(t){let r=ce(t);if(!r||!Array.isArray(r.messages)||r.messages.length>8||typeof r.hasEarlier!="boolean"||typeof r.hasLater!="boolean")throw new TypeError("\u9884\u89C8\u7ED3\u679C\u65E0\u6548");return{sessionId:Mn(r.sessionId),hasEarlier:r.hasEarlier,hasLater:r.hasLater,messages:r.messages.map(ce).map(i=>{if(typeof i.role!="string"||!["user","assistant"].includes(i.role)||typeof i.truncated!="boolean")throw new TypeError("\u6D88\u606F\u89D2\u8272\u6216\u622A\u65AD\u72B6\u6001\u65E0\u6548");return{seq:ys(i.seq),role:i.role,text:hr(i.text,2e3),truncated:i.truncated}})}}};async function Yn(t,r=globalThis.navigator?.clipboard){if(typeof t!="string"||!t)throw Object.assign(new Error("\u6CA1\u6709\u53EF\u590D\u5236\u7684\u5185\u5BB9"),{code:"copy.empty"});if(!r?.writeText)throw Object.assign(new Error("\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u526A\u8D34\u677F\uFF0C\u8BF7\u5728 HTTPS \u6216\u672C\u673A\u5730\u5740\u4E2D\u6253\u5F00\u9875\u9762"),{code:"copy.unavailable"});try{await r.writeText(t)}catch{throw Object.assign(new Error("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u5141\u8BB8\u6D4F\u89C8\u5668\u8BBF\u95EE\u526A\u8D34\u677F\u540E\u91CD\u8BD5"),{code:"copy.denied"})}}e(Yn,"copySessionText");function ws(){let t=e((i,s)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${i}`,create:e(()=>s,"create"),schema:s}),"codec");return[["searchSessionContent",vs,pr],["searchArchivedContent",vs,pr],["previewArchivedSession",Xa,Qa]].map(([i,s,l])=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${i}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:i,invocation:{kind:"direct"},parameters:[{name:"input",wire:"input",source:"json",codec:t(i+"Input",s)}],result:t(i+"Result",l),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}e(ws,"discoveryInvocations");function Ss(t,r){let i=r?.trim().toLowerCase();if(!i)return null;let s=t.toLowerCase().indexOf(i);if(s<0)return null;let l=0,u=0,m;for(let C of t){let y=u+C.toLowerCase().length;if(m===void 0&&y>s&&(m=l),l+=C.length,y>=s+i.length)return{start:m??l,end:l};u=y}return null}e(Ss,"findTextRange");function Kn(t,r=!1){if(!/^\d{4}-\d{2}-\d{2}$/.test(t))return NaN;let[i,s,l]=t.split("-").map(Number),u=new Date(i,s-1,l);return u.getFullYear()!==i||u.getMonth()!==s-1||u.getDate()!==l?NaN:(r&&u.setDate(u.getDate()+1),u.getTime())}e(Kn,"dayBoundary");function mr(t,r){return(!t||Number.isFinite(Kn(t)))&&(!r||Number.isFinite(Kn(r)))&&(!t||!r||t<=r)}e(mr,"validUpdatedRange");function xs(t,r,i){if(!mr(r,i))return!1;if(!r&&!i)return!0;let s=typeof t=="number"?t:Date.parse(t??"");return Number.isFinite(s)&&(!r||s>=Kn(r))&&(!i||s<Kn(i,!0))}e(xs,"matchesUpdatedRange");async function ks(t,r,i,{signal:s,onProgress:l}={}){let u=[],m=[],C=[...new Set(t)],y=e(()=>{if(s?.aborted)throw new Error("\u641C\u7D22\u5DF2\u53D6\u6D88")},"check");for(let _=0;_<C.length;_+=20){y();let x=pr.parse(await i({sessionIds:C.slice(_,_+20),query:r}));y(),u.push(...x.items),m.push(...x.failures),l?.({done:Math.min(_+20,C.length),total:C.length,items:[...u],failures:[...m]})}return y(),{items:u,failures:m}}e(ks,"searchArchiveBatches");function Cs(t,r={}){let i=t.createElement;function s({text:g,query:w=""}){let D=Ss(g,w);return D?i(t.Fragment,null,g.slice(0,D.start),i("mark",null,g.slice(D.start,D.end)),g.slice(D.end)):g}e(s,"HighlightedText");function l(g,w,D,j){let U=JSON.stringify(g),P=JSON.stringify([U,w]),[B,me]=t.useState(0),[le,V]=t.useState({key:"",status:"idle",items:[],failures:[]});return t.useEffect(()=>{if(!D||!w.trim()||!j)return;let ue=new AbortController;V({key:P,status:"loading",items:[],failures:[],done:0,total:g.length});let Qe=setTimeout(()=>{ks(JSON.parse(U),w,j,{signal:ue.signal,onProgress:e(re=>{ue.signal.aborted||V({key:P,status:"loading",...re})},"onProgress")}).then(re=>{ue.signal.aborted||V({key:P,status:"ready",done:g.length,total:g.length,...re})}).catch(re=>{ue.signal.aborted||V(X=>({...X,key:P,status:"error",error:Oe(re)}))})},350);return()=>{ue.abort(),clearTimeout(Qe)}},[U,w,D,j,B]),{...D&&w.trim()&&j?le.key===P?le:{key:P,status:"loading",items:[],failures:[],done:0,total:g.length}:{status:"idle",items:[],failures:[]},retry:e(()=>me(ue=>ue+1),"retry")}}e(l,"useArchiveSearch");function u(g,w){let[D,j]=t.useState(null),[U,P]=t.useState({status:"idle"}),[B,me]=t.useState(0),le=D,V=D&&w.includes(D.session.id);return t.useEffect(()=>{D&&!V&&j(null)},[D,V]),t.useEffect(()=>{if(!V||typeof window>"u")return;let fe=e(ue=>{ue.key==="Escape"&&(ue.preventDefault(),ue.stopPropagation(),ue.stopImmediatePropagation(),j(null))},"onKeyDown");return window.addEventListener("keydown",fe,!0),()=>window.removeEventListener("keydown",fe,!0)},[V]),t.useEffect(()=>{if(!D||!V||!g)return;let fe=!0;return P({key:le,status:"loading"}),Promise.resolve().then(()=>g({sessionId:D.session.id,query:D.query})).then(ue=>{fe&&P({key:le,status:"ready",value:ue})}).catch(ue=>{fe&&P({key:le,status:"error",error:Oe(ue)})}),()=>{fe=!1}},[le,V,g,B]),{target:V?D:null,...U.key===le?U:{status:"loading"},open:e((fe,ue="")=>j({session:fe,query:ue}),"open"),close:e(()=>j(null),"close"),retry:e(()=>me(fe=>fe+1),"retry")}}e(u,"useArchivePreview");function m({title:g,failures:w,separator:D}){let[j,U]=t.useState(!1),P=i("ul",null,w.map(B=>i("li",{key:B.sessionId},B.sessionId,D,B.message)));return i(Gn,{title:g,open:j,onToggle:e(()=>U(B=>!B),"onToggle")},P)}e(m,"FailureDetails");function C(g,w){let D=r.Button??(j=>i("button",{type:"button",disabled:j.disabled,onClick:j.onClick},j.children));return i(D,{variant:"outline",size:"sm",...w},g)}e(C,"textButton");function y({t:g,from:w,to:D,onFrom:j,onTo:U,invalid:P,onClear:B}){return i("div",{className:"dsham_dateFilter"},i(fs,{React:t,from:w,to:D,invalid:P,label:g("discovery.date"),fromLabel:g("discovery.from"),toLabel:g("discovery.to"),onFrom:j,onTo:U,onClear:B,t:g}),P?i("p",{className:"dsham_dateAlert",role:"alert"},g("discovery.invalidDate")):null)}e(y,"DiscoveryFilters");function _({state:g,t:w}){return g.status==="idle"?null:i("div",{className:"dsham_discoveryStatus",role:"status","aria-live":"polite"},i("p",null,w(g.status==="loading"?"discovery.searching":g.status==="error"?"discovery.searchError":"discovery.searched",{done:g.done??0,total:g.total??0})),g.status==="error"&&i("p",null,g.error),g.failures.length>0&&i(m,{title:w("discovery.failed",{n:g.failures.length}),failures:g.failures,separator:w("common.separator")}),(g.status==="error"||g.status==="ready"&&g.failures.length>0)&&C(w("discovery.retry"),{onClick:g.retry}))}e(_,"SearchStatus");function x({preview:g,t:w,MarkdownText:D}){let[j,U]=t.useState(!1);if(g.status==="loading")return i("p",{role:"status"},w("discovery.loading"));if(g.status==="error")return i("div",null,i("p",{role:"alert"},g.error),C(w("discovery.retry"),{onClick:g.retry}));let P=g.value;return P?i("div",{className:"dsham_previewMessages"},i("div",{className:"dsham_previewToolbar"},i("span",{title:w("discovery.previewHint")},w("discovery.readOnly")," \xB7 ",w("discovery.messageCount",{n:P.messages.length})),D&&i(r.SegmentedControl??"div",{id:"dsham-preview-mode",label:w("discovery.displayMode"),value:j?"raw":"formatted",options:[{value:"formatted",label:w("discovery.formatted")},{value:"raw",label:w("discovery.raw")}],onChange:e(B=>U(B==="raw"),"onChange")})),P.hasEarlier&&i("p",null,w("discovery.earlier")),!P.messages.length&&i("p",null,w("discovery.empty")),P.messages.map(B=>i("article",{key:B.seq,className:"dsham_previewMessage"},i("div",{className:"dsham_previewRole","data-role":B.role},i("span",{"aria-hidden":!0},w(B.role==="user"?"discovery.you":"discovery.ai")),i("strong",null,w("discovery."+B.role))),j||!D?i("pre",{className:"dsham_previewRaw"},i(s,{text:B.text,query:g.target?.query})):i(D,{text:B.text,streaming:!1,labels:{code:{copyLabel:w("discovery.copyCode"),copiedLabel:w("details.copied")},footnotes:w("discovery.footnotes")}}),B.truncated&&i("small",null,w("discovery.truncated")))),P.hasLater&&i("p",null,w("discovery.later"))):null}return e(x,"PreviewContent"),{HighlightedText:s,useArchiveSearch:l,useArchivePreview:u,DiscoveryFilters:y,SearchStatus:_,PreviewContent:x}}e(Cs,"createDiscoveryTools");var Es=[".dsham_dateFilter{display:flex;align-items:center;gap:8px;min-width:0;position:relative}",".dsham_dateAlert{position:absolute;top:calc(100% + 4px);right:0;margin:0;width:max-content;max-width:240px;padding:4px 8px;background:var(--dsw-alias-bg-layer-2);border:0.5px solid var(--dsw-alias-state-error-primary);border-radius:6px;box-shadow:0 4px 12px rgba(0,0,0,0.25);z-index:1100;font-size:12px;line-height:16px;color:var(--dsw-alias-state-error-primary);pointer-events:none}",".dsham_dateRange{position:relative;display:inline-flex;align-items:center;flex:1 1 auto;min-width:0;box-sizing:border-box}",".dsham_dateTrigger{display:inline-flex;align-items:center;gap:6px;width:100%;height:32px;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;line-height:20px;cursor:pointer;box-sizing:border-box;transition:all .15s ease}",".dsham_dateTrigger:hover{border-color:var(--dsw-alias-border-l3)}",".dsham_dateTrigger.is-open{border-color:var(--dsw-alias-state-business-primary);box-shadow:0 0 0 1px var(--dsw-alias-state-business-primary)}",".dsham_dateIcon{flex:none;color:var(--dsw-alias-label-tertiary);display:flex;align-items:center}",".dsham_dateText{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;color:var(--dsw-alias-label-primary)}",".dsham_dateText.placeholder{color:var(--dsw-alias-label-primary)}",".dsham_dateClearBtn{flex:none;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-tertiary);border-radius:50%;cursor:pointer;font-size:13px;line-height:1}",".dsham_dateClearBtn:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}",".dsham_dateChevron{flex:none;color:var(--dsw-alias-label-tertiary);display:flex;align-items:center}",".dsham_dateInputSrOnly{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}",".dsham_datePopover{position:absolute;top:calc(100% + 4px);right:0;left:auto;z-index:1000;display:flex;gap:10px;padding:10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md,10px);background:var(--dsw-alias-bg-layer-1);box-shadow:0 8px 24px rgba(0,0,0,0.12),0 2px 6px rgba(0,0,0,0.06);box-sizing:border-box}",".dsham_datePresets{width:84px;border-right:0.5px solid var(--dsw-alias-border-l2);padding-right:8px;display:flex;flex-direction:column;gap:3px;flex:none}",".dsham_datePresetBtn{border:0;background:transparent;padding:5px 6px;text-align:left;font:inherit;font-size:12px;color:var(--dsw-alias-label-secondary);border-radius:var(--dsw-radius-sm,6px);cursor:pointer;transition:all .15s ease;white-space:nowrap}",".dsham_datePresetBtn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}",".dsham_dateCalendar{width:224px;display:flex;flex-direction:column;gap:6px;flex:none}",".dsham_dateCalHeader{display:flex;justify-content:space-between;align-items:center;padding:0 2px}",".dsham_dateMonthTitle{font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary)}",".dsham_dateNavBtn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:0;border-radius:4px;background:transparent;color:var(--dsw-alias-label-secondary);cursor:pointer;font-size:14px;line-height:1}",".dsham_dateNavBtn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}",".dsham_dateGrid{display:grid;grid-template-columns:repeat(7,1fr);row-gap:2px}",".dsham_dateWeekday{font-size:11px;color:var(--dsw-alias-label-tertiary);text-align:center;padding:3px 0;font-weight:500}",".dsham_dateDay{position:relative;height:26px;display:flex;align-items:center;justify-content:center;font-size:12px;color:var(--dsw-alias-label-primary);cursor:pointer;border-radius:0}",".dsham_dateDay.is-outside{color:var(--dsw-alias-label-quaternary)}",".dsham_dateDay:not(.is-outside):hover{background:var(--dsw-alias-interactive-bg-hover);border-radius:4px}",".dsham_dateDay.is-start{background:var(--dsw-alias-state-business-primary)!important;color:#fff!important;border-top-left-radius:6px;border-bottom-left-radius:6px}",".dsham_dateDay.is-end{background:var(--dsw-alias-state-business-primary)!important;color:#fff!important;border-top-right-radius:6px;border-bottom-right-radius:6px}",".dsham_dateDay.is-start.is-end{border-radius:6px!important}",".dsham_dateDay.is-in-range{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-state-business-primary)}",".dsham_dateDay.is-today::after{content:'';position:absolute;bottom:2px;width:3px;height:3px;border-radius:50%;background:var(--dsw-alias-state-business-primary)}",".dsham_dateDay.is-start.is-today::after,.dsham_dateDay.is-end.is-today::after{background:#fff}",".dsham_discoveryStatus{font-size:12px;margin-bottom:12px;overflow-wrap:anywhere}",".dsham_settingsSnippet{display:block;width:100%;padding:0;margin:4px 0 0;border:0;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}",".dsham_previewMessages{max-height:65vh;overflow:auto;overflow-wrap:anywhere;padding-right:8px}",".dsham_previewToolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px;color:var(--dsw-alias-label-secondary);font-size:12px}",".dsham_previewRole{display:flex;align-items:center;gap:8px;margin-bottom:12px;font-size:13px}",".dsham_previewRole>span{display:grid;place-items:center;width:28px;height:28px;border-radius:8px;background:var(--dsw-alias-bg-layer-3);font-size:11px}",".dsham_previewRole[data-role=user]>span{color:var(--dsw-alias-state-business-primary)}",".dsham_previewRaw{white-space:pre-wrap;font:13px/1.8 ui-monospace,monospace;overflow-wrap:anywhere}",".dsham_previewMessage pre:not(.dsham_previewRaw){white-space:pre;overflow-x:auto;max-width:100%}",".dsham_previewMessage table{display:block;max-width:100%;overflow-x:auto}",".dsham_previewMessage img{max-width:100%}","@media(max-width:520px){.dsham_previewToolbar{align-items:flex-start;flex-wrap:wrap}}",".dsham_previewMessage{padding:18px 0;border-bottom:1px solid var(--dsw-alias-border-l2)}",".dsham_previewMessage p{font-size:14px;line-height:1.8}",".dsham_previewHint,.dsham_previewMessage small{color:var(--dsw-alias-label-secondary);font-size:12px}",".dsham_settings mark,.dsham_previewMessages mark{background:var(--dsw-alias-state-warn-tertiary);color:inherit;border-radius:2px}",".dsham_settingsSnippet:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}"].join(""),Is={"common.separator":"\uFF1A","copy.empty":"\u6CA1\u6709\u53EF\u590D\u5236\u7684\u5185\u5BB9","copy.unavailable":"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u526A\u8D34\u677F\uFF0C\u8BF7\u5728 HTTPS \u6216\u672C\u673A\u5730\u5740\u4E2D\u6253\u5F00\u9875\u9762","copy.denied":"\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u5141\u8BB8\u6D4F\u89C8\u5668\u8BBF\u95EE\u526A\u8D34\u677F\u540E\u91CD\u8BD5","discovery.you":"\u4F60","discovery.ai":"AI","discovery.readOnly":"\u53EA\u8BFB\u9884\u89C8","discovery.messageCount":"\u672C\u6B21\u663E\u793A {n} \u6761\u6D88\u606F","discovery.displayMode":"\u663E\u793A\u65B9\u5F0F","discovery.formatted":"\u6392\u7248","discovery.raw":"\u539F\u6587\u4E0E\u9AD8\u4EAE","discovery.copyCode":"\u590D\u5236\u4EE3\u7801","discovery.footnotes":"\u6CE8\u91CA","details.copyId":"\u590D\u5236\u4F1A\u8BDD ID","details.copied":"\u5DF2\u590D\u5236","discovery.date":"\u65E5\u671F","discovery.timeRange":"\u65F6\u95F4\u8303\u56F4","discovery.allTime":"\u5168\u90E8\u65F6\u95F4","discovery.today":"\u4ECA\u5929","discovery.last7Days":"\u8FD1 7 \u5929","discovery.last30Days":"\u8FD1 30 \u5929","discovery.last90Days":"\u8FD1 90 \u5929","discovery.customRange":"\u81EA\u5B9A\u4E49\u2026","discovery.dateActive":"\u65E5\u671F\xB7\u5DF2\u9009","discovery.clearDate":"\u6E05\u9664\u65E5\u671F","discovery.active":"\u5DF2\u542F\u7528","discovery.scope":"\u67E5\u627E\u8303\u56F4","discovery.titleOnly":"\u4EC5\u6807\u9898","discovery.titleAndContent":"\u6807\u9898\u4E0E\u6B63\u6587","discovery.from":"\u66F4\u65B0\u65F6\u95F4\u4ECE","discovery.to":"\u81F3","discovery.clear":"\u6E05\u9664\u6761\u4EF6","discovery.invalidDate":"\u5F00\u59CB\u65E5\u671F\u4E0D\u80FD\u665A\u4E8E\u7ED3\u675F\u65E5\u671F\uFF0C\u8BF7\u68C0\u67E5\u65E5\u671F\u8303\u56F4\u3002","discovery.searching":"\u6B63\u5728\u68C0\u7D22\u6B63\u6587\uFF1A{done} / {total}","discovery.searched":"\u6B63\u6587\u68C0\u7D22\u5B8C\u6210\uFF1A{done} / {total}","discovery.searchError":"\u6B63\u6587\u68C0\u7D22\u672A\u5B8C\u6210\uFF0C\u5F53\u524D\u7ED3\u679C\u53EF\u80FD\u4E0D\u5B8C\u6574\u3002","discovery.failed":"{n} \u6761\u4F1A\u8BDD\u8BFB\u53D6\u5931\u8D25","discovery.retry":"\u91CD\u8BD5","discovery.preview":"\u5FEB\u901F\u9884\u89C8","discovery.loading":"\u6B63\u5728\u8BFB\u53D6\u4F1A\u8BDD\u2026","discovery.previewHint":"\u53EA\u8BFB\u9884\u89C8\u539F\u59CB\u5BF9\u8BDD\u6587\u672C\uFF0C\u4E0D\u6062\u590D\u4F1A\u8BDD\uFF1B\u4E0D\u542B\u5DE5\u5177\u8F93\u51FA\u3001\u9644\u4EF6\u3001\u63A8\u7406\u548C\u7CFB\u7EDF\u5185\u5BB9\u3002","discovery.earlier":"\u524D\u9762\u8FD8\u6709\u6D88\u606F\uFF0C\u53EF\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD\u67E5\u770B\u3002","discovery.later":"\u540E\u9762\u8FD8\u6709\u6D88\u606F\uFF0C\u53EF\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD\u67E5\u770B\u3002","discovery.empty":"\u6CA1\u6709\u53EF\u9884\u89C8\u7684\u7528\u6237\u6216\u52A9\u624B\u6587\u672C\u3002","discovery.truncated":"\u672C\u6761\u4EC5\u663E\u793A\u90E8\u5206\u5185\u5BB9\u3002","discovery.user":"\u7528\u6237","discovery.assistant":"\u52A9\u624B","discovery.openFull":"\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD","discovery.searchPlaceholder":"\u641C\u7D22\u6807\u9898\u6216\u6B63\u6587"},Ts={"common.separator":": ","copy.empty":"Nothing to copy","copy.unavailable":"Clipboard unavailable. Open the page over HTTPS or localhost.","copy.denied":"Copy failed. Allow clipboard access and retry.","discovery.you":"You","discovery.ai":"AI","discovery.readOnly":"Read-only preview","discovery.messageCount":"Showing {n} messages","discovery.displayMode":"Display mode","discovery.formatted":"Formatted","discovery.raw":"Source and highlights","discovery.copyCode":"Copy code","discovery.footnotes":"Footnotes","details.copyId":"Copy session ID","details.copied":"Copied","discovery.date":"Date","discovery.timeRange":"Time range","discovery.allTime":"All time","discovery.today":"Today","discovery.last7Days":"Past 7 days","discovery.last30Days":"Past 30 days","discovery.last90Days":"Past 90 days","discovery.customRange":"Custom\u2026","discovery.dateActive":"Date \xB7 Set","discovery.clearDate":"Clear dates","discovery.active":"Active","discovery.scope":"Search in","discovery.titleOnly":"Titles","discovery.titleAndContent":"Titles and content","discovery.from":"Updated from","discovery.to":"To","discovery.clear":"Clear filters","discovery.invalidDate":"Check the date range: the start must not be after the end.","discovery.searching":"Searching content: {done} / {total}","discovery.searched":"Content search complete: {done} / {total}","discovery.searchError":"Content search is incomplete; results may be missing.","discovery.failed":"Could not read {n} conversations","discovery.retry":"Retry","discovery.preview":"Quick preview","discovery.loading":"Reading conversation\u2026","discovery.previewHint":"Read-only original conversation text; keeps the conversation archived. Excludes tools, attachments, reasoning and system content.","discovery.earlier":"More messages before this preview. Open the full conversation to read them.","discovery.later":"More messages after this preview. Open the full conversation to read them.","discovery.empty":"No user or assistant text to preview.","discovery.truncated":"Only part of this message is shown.","discovery.user":"User","discovery.assistant":"Assistant","discovery.openFull":"Open full conversation","discovery.searchPlaceholder":"Search titles or content"},As={"common.separator":": ","copy.empty":"\u041D\u0435\u0447\u0435\u0433\u043E \u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C","copy.unavailable":"\u0411\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u043F\u043E HTTPS \u0438\u043B\u0438 localhost.","copy.denied":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C. \u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u0435 \u0434\u043E\u0441\u0442\u0443\u043F \u043A \u0431\u0443\u0444\u0435\u0440\u0443 \u043E\u0431\u043C\u0435\u043D\u0430 \u0438 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435.","discovery.you":"\u0412\u044B","discovery.ai":"\u0418\u0418","discovery.readOnly":"\u041F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0442\u043E\u043B\u044C\u043A\u043E \u0434\u043B\u044F \u0447\u0442\u0435\u043D\u0438\u044F","discovery.messageCount":"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u043E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439: {n}","discovery.displayMode":"\u0420\u0435\u0436\u0438\u043C \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F","discovery.formatted":"\u0424\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u043E","discovery.raw":"\u0418\u0441\u0445\u043E\u0434\u043D\u0438\u043A \u0438 \u043F\u043E\u0434\u0441\u0432\u0435\u0442\u043A\u0430","discovery.copyCode":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043A\u043E\u0434","discovery.footnotes":"\u0421\u043D\u043E\u0441\u043A\u0438","details.copyId":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C ID \u0441\u0435\u0441\u0441\u0438\u0438","details.copied":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E","discovery.date":"\u0414\u0430\u0442\u0430","discovery.timeRange":"\u041F\u0435\u0440\u0438\u043E\u0434","discovery.allTime":"\u0412\u0441\u0435 \u0432\u0440\u0435\u043C\u044F","discovery.today":"\u0421\u0435\u0433\u043E\u0434\u043D\u044F","discovery.last7Days":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 7 \u0434\u043D\u0435\u0439","discovery.last30Days":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 30 \u0434\u043D\u0435\u0439","discovery.last90Days":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 90 \u0434\u043D\u0435\u0439","discovery.customRange":"\u0421\u0432\u043E\u0439 \u043F\u0435\u0440\u0438\u043E\u0434\u2026","discovery.dateActive":"\u0414\u0430\u0442\u0430 \xB7 \u0412\u044B\u0431\u0440\u0430\u043D\u0430","discovery.clearDate":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0434\u0430\u0442\u044B","discovery.active":"\u0412\u043A\u043B\u044E\u0447\u0435\u043D\u043E","discovery.scope":"\u0418\u0441\u043A\u0430\u0442\u044C \u0432","discovery.titleOnly":"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u044F","discovery.titleAndContent":"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u044F \u0438 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0435","discovery.from":"\u041E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u043E \u0441","discovery.to":"\u041F\u043E","discovery.clear":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440\u044B","discovery.invalidDate":"\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D \u0434\u0430\u0442: \u043D\u0430\u0447\u0430\u043B\u043E \u043D\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043F\u043E\u0437\u0436\u0435 \u043A\u043E\u043D\u0446\u0430.","discovery.searching":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443: {done} / {total}","discovery.searched":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443 \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043D: {done} / {total}","discovery.searchError":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443 \u043D\u0435\u043F\u043E\u043B\u043D\u044B\u0439; \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u043D\u0435\u043F\u043E\u043B\u043D\u044B\u043C\u0438.","discovery.failed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C {n} \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u043E\u0432","discovery.retry":"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C","discovery.preview":"\u0411\u044B\u0441\u0442\u0440\u044B\u0439 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440","discovery.loading":"\u0427\u0442\u0435\u043D\u0438\u0435 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u0430\u2026","discovery.previewHint":"\u0422\u043E\u043B\u044C\u043A\u043E \u0447\u0442\u0435\u043D\u0438\u0435 \u0438\u0441\u0445\u043E\u0434\u043D\u043E\u0433\u043E \u0442\u0435\u043A\u0441\u0442\u0430 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u0430; \u0441\u0435\u0441\u0441\u0438\u044F \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0432 \u0430\u0440\u0445\u0438\u0432\u0435. \u0411\u0435\u0437 \u0432\u044B\u0432\u043E\u0434\u0430 \u0438\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u043E\u0432, \u0432\u043B\u043E\u0436\u0435\u043D\u0438\u0439, \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043D\u0438\u0439 \u0438 \u0441\u0438\u0441\u0442\u0435\u043C\u043D\u043E\u0433\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0433\u043E.","discovery.earlier":"\u041F\u0435\u0440\u0435\u0434 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u043E\u043C \u0435\u0441\u0442\u044C \u0435\u0449\u0451 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0447\u0442\u043E\u0431\u044B \u0438\u0445 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C.","discovery.later":"\u041F\u043E\u0441\u043B\u0435 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430 \u0435\u0441\u0442\u044C \u0435\u0449\u0451 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0447\u0442\u043E\u0431\u044B \u0438\u0445 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C.","discovery.empty":"\u041D\u0435\u0442 \u0442\u0435\u043A\u0441\u0442\u0430 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0438\u043B\u0438 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442\u0430 \u0434\u043B\u044F \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430.","discovery.truncated":"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u0430 \u0442\u043E\u043B\u044C\u043A\u043E \u0447\u0430\u0441\u0442\u044C \u044D\u0442\u043E\u0433\u043E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F.","discovery.user":"\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C","discovery.assistant":"\u0410\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442","discovery.openFull":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440","discovery.searchPlaceholder":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u044F\u043C \u0438\u043B\u0438 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443"};var _s=e(t=>{let r=ce(t);if(!r||typeof r.sessionId!="string"||!r.sessionId.length||r.sessionId.length>1024||typeof r.identity!="string"||!r.identity.length||r.identity.length>4096)throw new TypeError("invalid cache rebuild candidate");return{sessionId:r.sessionId,identity:r.identity}},"candidate"),ei={parse(t){let r=ce(t);if(!r||!Array.isArray(r.items)||!r.items.length||r.items.length>20)throw new TypeError("invalid cache rebuild batch (1\u201320 items required)");return{items:r.items.map(_s)}}},fr={parse(t){let r=ce(t);if(!r||!Array.isArray(r.items)||r.count!==r.items.length)throw new TypeError("invalid cache diagnosis");return{count:r.items.length,items:r.items.map(_s)}}},gr={parse(t){let r=ce(t);for(let i of["rebuiltSessionIds","skippedSessionIds"])if(!Array.isArray(r?.[i])||r[i].some(s=>typeof s!="string"))throw new TypeError("invalid cache rebuild result");if(!Array.isArray(r.failures)||r.failures.some(i=>!i||typeof i.sessionId!="string"||typeof i.message!="string"))throw new TypeError("invalid cache rebuild failures");return r}};function Rs(){let t=e((r,i)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${r}`,create:e(()=>i,"create"),schema:i}),"codec");return[{method:"diagnoseSessionCaches",parameters:[],result:t("CacheDiagnosis",fr)},{method:"rebuildSessionCaches",parameters:[{name:"input",wire:"input",source:"json",codec:t("CacheRebuildInput",ei)}],result:t("CacheRebuildResult",gr)}].map(({method:r,...i})=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${r}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:r,invocation:{kind:"direct"},...i,sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}e(Rs,"cacheRebuildInvocations");function js(t,r={}){let{maxLoadRetries:i=3,retryDelayMs:s=200}=r,l={diagnosis:{count:0,items:[]},busy:!1,progress:null,result:null,error:null,refreshError:null},u=!0,m=0,C=[],y,_=new Set,x=e(w=>{if(u){l={...l,...w};for(let D of _)D()}},"update"),g=e(async(w=i)=>{if(!u)return;y!==void 0&&(clearTimeout(y),y=void 0);let D=++m;try{let j=fr.parse(await t.diagnose());u&&D===m&&x({diagnosis:j,error:null})}catch(j){if(w>0&&u&&D===m){y=setTimeout(()=>{y=void 0,u&&D===m&&g(w-1)},s);return}u&&D===m&&x({error:Oe(j)})}},"load");return{snapshot:e(()=>l,"snapshot"),subscribe(w){return _.add(w),()=>{_.delete(w)}},load:g,async run(w=!1){if(!u||l.busy)return;++m,y!==void 0&&(clearTimeout(y),y=void 0);let D=w?[...C]:[...l.diagnosis.items],j={rebuiltSessionIds:[],skippedSessionIds:[],failures:[]};C=[],x({busy:!0,result:null,error:null,refreshError:null,progress:{done:0,total:D.length}});for(let[U,P]of D.entries()){if(!u)return;try{let B=gr.parse(await t.rebuild({items:[P]}));if(!u)return;j.rebuiltSessionIds.push(...B.rebuiltSessionIds),j.skippedSessionIds.push(...B.skippedSessionIds),j.failures.push(...B.failures),B.failures.length&&C.push(P)}catch(B){if(!u)return;j.failures.push({sessionId:P.sessionId,message:Oe(B)}),C.push(P)}x({progress:{done:U+1,total:D.length}})}x({result:j});try{await t.refresh()}catch(U){x({refreshError:Oe(U)})}u&&(await g(),x({busy:!1,progress:null}))},dismiss(){u&&x({result:null,error:null,refreshError:null})},dispose(){u=!1,++m,y!==void 0&&(clearTimeout(y),y=void 0),_.clear()}}}e(js,"createCacheRebuildController");var Qt=class extends Error{static{e(this,"ArchiveNavigationError")}code;constructor(r){super(r),this.name="ArchiveNavigationError",this.code=r}};function Ns(t,r){return t instanceof Qt?r(`archives.${t.code}`):Oe(t)}e(Ns,"formatArchiveNavigationError");function ti(t,r){if(typeof t?.retainInfo!="function")return;let i=t.retainInfo(r),s=i&&typeof i=="object"&&"getSnapshot"in i&&typeof i.getSnapshot=="function"?i.getSnapshot():i;if(!s||typeof s!="object"||!("retainedBy"in s))return;let l=s.retainedBy;if(!(!l||typeof l!="object"||!("mainView"in l)||typeof l.mainView!="number"))return{retainedBy:{mainView:l.mainView}}}e(ti,"retainInfoSnapshot");function ni(t){let r=t?.byId;if(r!==void 0){for(let i of Object.values(r))if(i&&(i.retainedBy?.mainView??0)>0)return i.id}}e(ni,"mainViewSessionId");function Zn(t){return ni(t)}e(Zn,"currentSessionId");function ri(t,r,i){return r===void 0||r===""?!1:(t?.byId?.[r]?.retainedBy?.mainView??0)>0||(ti(i,r)?.retainedBy?.mainView??0)>0}e(ri,"sessionIsCurrent");async function Ms(t,r,i,s=()=>!0){if(i){if(typeof t.prepare=="function"&&await t.prepare(r),!s())return;await t.restore(r)}s()&&await t.open(r)}e(Ms,"openArchivedConversation");function Ds(t,r,i,{onOpened:s=e(()=>{},"onOpened"),beginNavigation:l,warn:u=e((...m)=>console.warn(...m),"warn")}={}){let m,C=t?.clearArchivedCurrent,y=t&&Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent"),_=e(w=>ri(r.list.getSnapshot(),w,r),"viewing"),x=e(function(...w){return m!==void 0&&_(m)&&i.list.getSnapshot().archivedSessionIds.includes(m)?!1:(m=void 0,C?.apply(this,w))},"wrapped"),g=e(()=>t&&Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent")?.value===x,"ownsWrapper");if(t&&typeof C=="function")try{if(t.clearArchivedCurrent=x,!g())throw new Error("\u5BFC\u822A\u65B9\u6CD5\u672A\u63A5\u7EB3\u5F52\u6863\u9002\u914D")}catch(w){u("archive-manager: \u65E0\u6CD5\u9002\u914D\u5F52\u6863\u5BFC\u822A\uFF0C\u8BF7\u6062\u590D\u4F1A\u8BDD\u540E\u6253\u5F00\u3002",w)}return{open(w){m=w;try{if(typeof C=="function"&&!g()&&i.list.getSnapshot().archivedSessionIds.includes(w))throw u("archive-manager: \u5F52\u6863\u5BFC\u822A\u9002\u914D\u4E0D\u53EF\u7528\u6216\u5DF2\u88AB\u66FF\u6362\u3002"),new Qt("navigationUnavailable");if(l?.(),typeof t?.openSession!="function")throw u("archive-manager: \u5BBF\u4E3B\u672A\u63D0\u4F9B\u4F1A\u8BDD\u6253\u5F00\u63A5\u53E3\u3002"),new Qt("navigationUnavailable");if(t.openSession(w),!_(w))throw u("archive-manager: \u5BBF\u4E3B\u672A\u4FDD\u7559\u76EE\u6807\u4F1A\u8BDD\u3002",{cleanupAvailable:typeof C=="function"}),new Qt("sessionNotRetained");s()}catch(D){throw m=void 0,D}},dispose(){m=void 0,!(!t||Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent")?.value!==x)&&(y?Object.defineProperty(t,"clearArchivedCurrent",y):delete t.clearArchivedCurrent,C?.call(t))}}}e(Ds,"allowArchivedNavigation");var an=require("@deepseek-ai/dsh-client-ui-primitives");var Ls={check:"\u68C0\u67E5\u66F4\u65B0",update:"\u66F4\u65B0",recheck:"\u91CD\u65B0\u68C0\u67E5",auto:"\u81EA\u52A8\u66F4\u65B0",updating:"\u6B63\u5728\u66F4\u65B0\u2026",copy:"\u590D\u5236\u547D\u4EE4",copied:"\u5DF2\u590D\u5236",copyFailed:"\u590D\u5236\u5931\u8D25",checking:"\u6B63\u5728\u68C0\u67E5\u66F4\u65B0\u2026",latest:"\u5DF2\u662F\u6700\u65B0\u7248\u672C",found:"\u53D1\u73B0\u65B0\u7248\u672C",failed:"\u68C0\u67E5\u66F4\u65B0\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",current:"\u8FD0\u884C\u7248\u672C",latestLabel:"\u6700\u65B0\u7248\u672C",profile:"\u76EE\u6807 profile",unknown:"\u672A\u77E5",manual:"\u624B\u5DE5\u66F4\u65B0",manualHint:"\u81EA\u52A8\u66F4\u65B0\u5931\u8D25\u65F6\uFF0C\u53EF\u5728\u5F53\u524D DSH \u7EC8\u7AEF\u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\uFF0C\u5B8C\u6210\u540E\u91CD\u542F DSH Web\u3002",manualHintDesktop:"\u81EA\u52A8\u66F4\u65B0\u5931\u8D25\u65F6\uFF0C\u8BF7\u5148\u5B8C\u5168\u9000\u51FA DSH Desktop\uFF0C\u518D\u7528 Desktop \u81EA\u5E26\u7684 dsh \u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\u3002\u666E\u901A dsh \u4F1A\u62D2\u7EDD desktop profile\u3002",intro:"\u4EC5\u68C0\u67E5\u5E76\u66F4\u65B0\u5F53\u524D\u63D2\u4EF6\uFF0C\u4E0D\u4F1A\u8054\u52A8\u5B89\u88C5\u5176\u4ED6\u63D2\u4EF6\u3002",restart:"\u66F4\u65B0\u5B8C\u6210\uFF0C\u8BF7\u91CD\u542F DSH Web\u3002",restartDesktop:"\u66F4\u65B0\u5B8C\u6210\uFF0C\u8BF7\u5B8C\u5168\u9000\u51FA\u5E76\u91CD\u65B0\u6253\u5F00 DSH Desktop\u3002",restarting:"\u66F4\u65B0\u5B8C\u6210\uFF0C\u6B63\u5728\u91CD\u542F DSH Desktop\u2026",unavailable:"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u81EA\u52A8\u66F4\u65B0\uFF0C\u8BF7\u4F7F\u7528\u624B\u5DE5\u66F4\u65B0\u547D\u4EE4\u3002"},zs={check:"Check for updates",update:"Update",recheck:"Check again",auto:"Update automatically",updating:"Updating\u2026",copy:"Copy command",copied:"Copied",copyFailed:"Copy failed",checking:"Checking for updates\u2026",latest:"You are up to date",found:"New version available",failed:"Could not check for updates. Try again later.",current:"Running version",latestLabel:"Latest version",profile:"Target profile",unknown:"Unknown",manual:"Manual update",manualHint:"If automatic update fails, run this command in the current DSH terminal, then restart DSH Web.",manualHintDesktop:"If automatic update fails, fully quit DSH Desktop, then run this command with Desktop's own dsh. A regular dsh rejects the desktop profile.",intro:"Only this plugin is checked and updated. Other plugins are not changed.",restart:"Update complete. Restart DSH Web.",restartDesktop:"Update complete. Fully quit and reopen DSH Desktop.",restarting:"Update complete. Restarting DSH Desktop\u2026",unavailable:"Automatic update is unavailable. Use the manual command."};function Dn(t){return t.toLowerCase().startsWith("zh")?Ls:zs}e(Dn,"pluginUpdateCopy");function si(t,r,i,s){let l=Dn(t),u=r?.restartDesktop===!0||r?.profileName==="desktop",m=u?{...l,manualHint:l.manualHintDesktop}:l,C=i!=="idle",y=m.checking,_="";return i==="checking"?y=m.checking:i==="updating"?y=m.updating:s.type==="error"?(y=s.message||m.failed,_="error"):s.type==="restart"?(y=u?m.restartDesktop:m.restart,_="success"):s.type==="restarting"?(y=m.restarting,_="success"):r===void 0?y=m.checking:r.latestCheckFailed?(y=m.failed,_="error"):!r.canAutoUpdate&&r.updateAvailable?(y=m.unavailable,_="update"):r.updateAvailable?(y=`${m.found}: v${r.latestVersion??m.unknown}`,_="update"):(y=m.latest,_="success"),{copy:m,busy:C,message:y,kind:_,loading:i==="updating",updateLabel:i==="updating"?m.updating:m.auto,disabled:C||r?.canAutoUpdate!==!0||r.updateAvailable!==!0,currentVersion:r===void 0?m.unknown:`v${r.currentVersion}`,latestVersion:r?.latestVersion===void 0?m.unknown:`v${r.latestVersion}`,profileName:r?.profileName??m.unknown,profileRaw:r?.profileName??"",latestRaw:r?.latestVersion??"latest"}}e(si,"describePluginUpdate");function Ps(t,r,i){let s="idle",l=r,u={type:"status"},m=0,C=new Set,y=e(()=>{for(let x of C)x()},"emit"),_=e(x=>{l=x,i?.(x)},"assign");return{get posts(){return m},subscribe(x){return C.add(x),()=>{C.delete(x)}},view(x){return si(x,l,s,u)},async check(){if(s==="idle"){s="checking",u={type:"status"},y();try{_(await t("GET")),u={type:"status"}}catch(x){u={type:"error",message:x instanceof Error?x.message:""}}finally{s="idle",y()}}},async update(){if(s==="idle"){s="updating",u={type:"status"},m+=1,y();try{let x=await t("POST");_(x),u={type:x.autoReload===!0?"restarting":"restart"}}catch(x){u={type:"error",message:x instanceof Error?x.message:""}}finally{s="idle",y()}}}}}e(Ps,"createUpdateFlow");function Os(t,r,i){return`dsh plugin${t.trim()===""?"":` --profile ${t.trim()}`} add ${r}@${i} --registry=https://registry.npmjs.org/`}e(Os,"manualPluginUpdateCommand");function Fs(t,r){return t.key!=="Escape"?!1:(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),r(),!0)}e(Fs,"handlePluginUpdateEscape");function ai(){let t=globalThis.document;if(typeof t>"u"||t===null)return;let r=t.baseURI;if(!(typeof r!="string"||r===""))try{let i=new URL(r),s=i.pathname.lastIndexOf("/"),l=i.pathname.slice(s+1);return/\.(html?|php|aspx?|jsp)$/i.test(l)?i.pathname=i.pathname.slice(0,s+1):i.pathname.endsWith("/")||(i.pathname+="/"),i.href}catch{return}}e(ai,"pageBaseHref");function fn(t){if(typeof t!="string"||t.charAt(0)!=="/"||t.charAt(1)==="/")return t;let r=ai();if(r===void 0)return t;try{return new URL(t.slice(1),r).href}catch{return t}}e(fn,"resolveApiUrl");function Hs(t){let i=Function("return globalThis.__dshArchiveReactDOMClient")()?.createRoot;if(i===void 0)throw new Error("createRoot unavailable");return i(t)}e(Hs,"mountRoot");var ii="x-michengai-plugin-update",Bs="michengai-plugin-update-ui",vr=`
|
|
11
11
|
.mpi-version{margin-left:8px;color:var(--dsw-alias-label-tertiary,#a0a0a0);font-family:inherit;font-size:12px;font-weight:500;line-height:18px;letter-spacing:0;white-space:nowrap;vertical-align:baseline}.mpi-check-host{display:inline-flex;align-items:center}.mpi-icon{display:inline-flex;flex:0 0 auto;width:16px;height:16px;align-items:center;justify-content:center;pointer-events:none}.mpi-icon svg{display:block;width:16px;height:16px}
|
|
12
12
|
.mpi-intro{margin:0 0 16px;color:var(--dsw-alias-label-secondary,#b9b9b9);font-size:13px;line-height:20px}.mpi-meta{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:8px 18px;margin:0 0 16px;font-size:12px;line-height:18px}.mpi-meta dt{color:var(--dsw-alias-label-secondary,#b9b9b9)}.mpi-meta dd{margin:0}.mpi-mono{font-family:ui-monospace,SFMono-Regular,Consolas,monospace}.mpi-latest{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 10px}.mpi-status{font-size:13px;font-weight:600;line-height:18px}.mpi-status[data-kind=error]{color:var(--dsw-alias-state-error-primary,#ef7272)}.mpi-status[data-kind=success]{color:var(--dsw-alias-state-success-primary,#51b976)}.mpi-status[data-kind=update]{color:#e8b15a !important}.mpi-manual{border-top:1px solid var(--dsw-alias-border-l2,#494949);padding-top:16px}.mpi-manual h3{margin:0 0 6px;font-size:14px;line-height:20px}.mpi-manual p{margin:0 0 10px;color:var(--dsw-alias-label-secondary,#b9b9b9);font-size:12px;line-height:18px}.mpi-command{display:flex;align-items:flex-start;gap:8px;border:1px solid var(--dsw-alias-border-l2,#494949);border-radius:7px;padding:10px;background:var(--dsw-alias-bg-layer-3,var(--dsw-specific-menu-item-hover,#353638))}.mpi-command code{min-width:0;flex:1;overflow:visible;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;line-height:18px;white-space:pre-wrap;overflow-wrap:anywhere}@media(max-width:560px){.mpi-meta{grid-template-columns:1fr;gap:2px}.mpi-meta dd{margin-bottom:6px}}
|
|
13
13
|
.dssm-update-progress{height:4px;border-radius:2px;background:var(--dsw-alias-border-l1,#3a3a3a);overflow:hidden;margin:12px 0;position:relative}.dssm-update-progress-bar{height:100%;width:40%;background:var(--dsw-alias-button-primary-fill,#4176e6);border-radius:2px;animation:dssm-progress-slide 1.4s ease-in-out infinite}@keyframes dssm-progress-slide{0%{transform:translateX(-100%)}100%{transform:translateX(300%)}}@media (prefers-reduced-motion:reduce){.dssm-update-progress-bar{animation:none;width:100%;opacity:.6}}
|
|
14
|
-
`;function
|
|
14
|
+
`;function oi(){let t=document.getElementById(Bs);if(t!==null){t.textContent!==vr&&(t.textContent=vr);return}let r=document.createElement("style");r.id=Bs,r.textContent=vr,(document.head??document.documentElement).append(r)}e(oi,"ensureStyle");function li(t){if(t===null||typeof t!="object")return!1;let r=t;return typeof r.packageName=="string"&&typeof r.currentVersion=="string"&&typeof r.updateAvailable=="boolean"&&typeof r.profileName=="string"&&typeof r.canAutoUpdate=="boolean"&&typeof r.latestCheckFailed=="boolean"&&(r.latestVersion===void 0||typeof r.latestVersion=="string")}e(li,"validPayload");async function Us(t,r,i){let s=i===void 0?{}:{signal:i},l=await fetch(t,r==="GET"?{cache:"no-store",...s}:{method:"POST",headers:{"content-type":"application/json",[ii]:"1"},body:"{}",...s}),u=await l.json();if(!l.ok||!li(u))throw new Error(u&&typeof u=="object"&&"error"in u&&typeof u.error=="string"?u.error:Dn(document.documentElement.lang).failed);return u}e(Us,"requestStatus");function ci(t){let r=W.useRef(null);return W.useLayoutEffect(()=>{r.current?.replaceChildren(t.node)},[t.node]),W.createElement("span",{ref:r,className:"mpi-icon","aria-hidden":!0})}e(ci,"HostIcon");function di(t){let r=W.useRef(null),[,i]=W.useState(0),[s,l]=W.useState("idle");W.useEffect(()=>t.flow.subscribe(()=>i(x=>x+1)),[t.flow]),W.useEffect(()=>{let x=document.documentElement,g=new MutationObserver(()=>i(w=>w+1));return g.observe(x,{attributes:!0,attributeFilter:["lang"]}),()=>g.disconnect()},[]),W.useEffect(()=>{t.flow.check()},[t.flow]),W.useEffect(()=>{function x(g){Fs(g,t.onClose)}return e(x,"onKey"),document.addEventListener("keydown",x,!0),()=>document.removeEventListener("keydown",x,!0)},[t.onClose]);let u=document.documentElement.lang,m=t.flow.view(u),C=u.toLowerCase().startsWith("zh")?t.zhName:u.toLowerCase().startsWith("ru")?t.ruName:t.enName,y=Os(m.profileRaw,t.packageName,m.latestRaw),_=s==="copied"?m.copy.copied:s==="failed"?m.copy.copyFailed:m.copy.copy;return W.createElement(an.Modal,{open:!0,className:"mpi-dialog",title:`${C} ${m.copy.update}`,closeLabel:"Close",onClose:t.onClose,footer:[W.createElement(an.Button,{key:"check",variant:"outline",disabled:m.busy,onClick:e(()=>{t.flow.check()},"onClick")},m.copy.recheck),W.createElement(an.Button,{key:"update",variant:"primary",disabled:m.disabled,onClick:e(()=>{t.flow.update()},"onClick")},m.updateLabel)]},W.createElement("div",{ref:r},W.createElement("p",{className:"mpi-intro"},m.copy.intro),W.createElement("dl",{className:"mpi-meta"},W.createElement("dt",null,m.copy.current),W.createElement("dd",null,W.createElement("span",{className:"mpi-mono"},m.currentVersion)),W.createElement("dt",null,m.copy.latestLabel),W.createElement("dd",{className:"mpi-latest"},W.createElement("span",{className:"mpi-mono"},m.latestVersion),W.createElement("span",{className:"mpi-status",role:"status","data-kind":m.kind,...m.kind==="update"?{style:{color:"#e8b15a"}}:{}},m.message)),W.createElement("dt",null,m.copy.profile),W.createElement("dd",null,W.createElement("span",{className:"mpi-mono"},m.profileName))),m.busy?W.createElement("div",{className:"dssm-update-progress",role:"progressbar","aria-busy":"true"},W.createElement("div",{className:"dssm-update-progress-bar"})):null,W.createElement("section",{className:"mpi-manual"},W.createElement("h3",null,m.copy.manual),W.createElement("p",null,m.copy.manualHint),W.createElement("div",{className:"mpi-command"},W.createElement("code",null,y),W.createElement(an.Button,{variant:"outline",size:"sm",disabled:m.busy,onClick:e(()=>{let x=navigator.clipboard?.writeText(y);if(x===void 0){l("failed");return}x.then(()=>{l("copied"),window.setTimeout(()=>l("idle"),1400)}).catch(()=>l("failed"))},"onClick")},_)))))}e(di,"UpdateDialog");function Ws(t){if(typeof document>"u"||document.body===null)return()=>{};let r=fn(t.endpoint);oi();let i=new AbortController,s,l,u,m,C,y,_;function x(){u?.unmount(),u=void 0,l=void 0,m=void 0}e(x,"unmountCheck");function g(){if(u===void 0)return;m===void 0&&(m=t.createIcon("refresh"));let le=m;u.render(W.createElement(an.Button,{variant:"outline",size:"sm",onClick:D,icon:W.createElement(ci,{node:le})},W.createElement("span",{"data-mpi-label":""},Dn(document.documentElement.lang).check)))}e(g,"renderCheck");function w(){y?.unmount(),y=void 0,C?.remove(),C=void 0}e(w,"closeDialog");function D(){w();let le=document.createElement("div");le.className="mpi-dialog-root",document.body.append(le),C=le,y=Hs(le),y.render(W.createElement(di,{flow:Ps(V=>Us(r,V,i.signal),s,V=>{s=V,j()}),packageName:t.packageName,zhName:t.zhName,enName:t.enName,ruName:t.ruName,onClose:w}))}e(D,"openDialog");function j(){let le=document.querySelector(t.titleRowSelector);if(le===null)return;let V=le.querySelector("h1,h2"),fe=le.querySelector(t.linksSelector);if(t.isEnabled&&!t.isEnabled()){if(C!==void 0&&w(),fe!==null){let re=fe.querySelector(`[data-mpi-check="${t.packageName}"]`);re!==null&&(x(),re.remove())}if(V!==null){let re=V.querySelector(`.mpi-version[data-package="${t.packageName}"]`);re!==null&&re.remove()}return}if(V!==null&&s!==void 0){let re=V.querySelector(`.mpi-version[data-package="${t.packageName}"]`);re===null&&(re=document.createElement("span"),re.className="mpi-version",re.dataset.package=t.packageName,V.append(re));let X=`v${s.currentVersion}`;re.textContent!==X&&(re.textContent=X)}if(l!==void 0&&!l.isConnected&&x(),fe===null)return;let ue=fe.querySelector(`[data-mpi-check="${t.packageName}"]`);if(ue!==null){let re=ue.querySelector("[data-mpi-label]");(re===null||re.textContent!==Dn(document.documentElement.lang).check)&&g();return}let Qe=document.createElement("span");Qe.dataset.mpiCheck=t.packageName,Qe.className="mpi-check-host",fe.append(Qe),l=Qe,u=Hs(Qe),g()}e(j,"applyControls");let U=new MutationObserver(()=>{_===void 0&&(_=window.requestAnimationFrame(()=>{_=void 0,j()}))});U.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["lang"]});let P,B=e(async()=>P||(P=(async()=>{try{return s=await Us(r,"GET",i.signal),j(),s}finally{P=void 0}})(),P),"load"),me=e(()=>{j(),(!t.isEnabled||t.isEnabled())&&B().catch(()=>{})},"onToggle");return typeof window<"u"&&window.addEventListener("dsham-update-toggle",me),j(),B().catch(()=>{}),()=>{i.abort(),U.disconnect(),w(),x(),typeof window<"u"&&window.removeEventListener("dsham-update-toggle",me),_!==void 0&&window.cancelAnimationFrame(_),document.querySelectorAll(`[data-mpi-check="${t.packageName}"],.mpi-version[data-package="${t.packageName}"]`).forEach(le=>le.remove())}}e(Ws,"observePluginUpdate");var on=require("@deepseek-ai/dsh-client-ui-primitives");var Fe=us,ui="@michengai/dsh-archive-manager",br="archived-sessions",hi=4,qs="dsham-sidebar-entry-style",pi=`
|
|
15
15
|
.dsham_mainPanel{box-sizing:border-box;height:100%;min-height:0;overflow-y:auto;display:flex;flex-direction:column;align-items:center;padding:28px clamp(24px,4vw,48px) 48px}
|
|
16
16
|
.dsham_mainPanel>*{width:100%;max-width:960px}
|
|
17
17
|
.dsham_bundle_row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:0.5px solid var(--dsw-alias-border-l2)}
|
|
@@ -19,9 +19,15 @@ window.__ModuleLoader__.load({
|
|
|
19
19
|
.dsham_bundle_title{font-size:13px;font-weight:500;line-height:20px;color:var(--dsw-alias-label-primary)}
|
|
20
20
|
.dsham_bundle_desc{font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary)}
|
|
21
21
|
.dsham_bundle_error{font-size:12px;line-height:16px;color:var(--dsw-alias-state-error-primary,#ef4444);margin-top:2px}
|
|
22
|
-
`;function Ha(){if(typeof document>"u"||typeof document.getElementById!="function"||document.getElementById(Ba)!==null||typeof document.createElement!="function")return;let t=document.createElement("style");t.id=Ba,t.textContent=li,(document.head??document.documentElement)?.appendChild?.(t)}e(Ha,"ensureSidebarEntryStyle");function ci(t){let r=t&&typeof t.size=="number"?t.size:16;return He(rn.IconArchiveOutlineMedium,{size:r})}e(ci,"ArchiveSidebarIcon");function vr(t){Ha();let{t:r,location:i,onLocationChange:a,errorMessage:o,enabled:f=!1,onToggle:c,disabled:k,onlineUpdateEnabled:y=!0,onToggleOnlineUpdate:A,onlineUpdateDisabled:w,onlineUpdateLocked:g=!1,sidebarFavoriteStarEnabled:S=!0,onToggleSidebarFavoriteStar:D,sidebarFavoriteStarDisabled:j}=t,U=i??(f?"both":"settings"),z=e(ge=>{(ge==="both"||ge==="sidebar"||ge==="settings")&&(typeof a=="function"?a(ge):typeof c=="function"&&c(ge!=="settings"))},"handleLocationChange"),H=[He("div",{key:"entry-location",className:"dsham_bundle_row"},He("div",{className:"dsham_bundle_label_box"},He("span",{className:"dsham_bundle_title"},r("entry.location.title")),He("span",{className:"dsham_bundle_desc"},r("entry.location.desc")),o?He("span",{className:"dsham_bundle_error",role:"alert"},o):null),He(rn.SegmentedControl,{id:"dsham-bundle-entry-location",value:U,onChange:z,label:r("entry.location.title"),disabled:k,options:[{value:"both",label:r("entry.location.both")},{value:"sidebar",label:r("entry.location.sidebar")},{value:"settings",label:r("entry.location.settings")}]}))];if(typeof A=="function"){let ge=g?`${r("update.entry.desc")} (${r("update.entry.locked")})`:r("update.entry.desc");H.push(He("div",{key:"online-update",className:"dsham_bundle_row"},He("div",{className:"dsham_bundle_label_box"},He("span",{className:"dsham_bundle_title"},r("update.entry.title")),He("span",{className:"dsham_bundle_desc"},ge)),He(rn.Switch,{checked:y,onChange:A,label:r("update.entry.toggle"),disabled:w||g,title:g?r("update.entry.locked"):void 0})))}return typeof D=="function"&&H.push(He("div",{key:"sidebar-favorite-star",className:"dsham_bundle_row"},He("div",{className:"dsham_bundle_label_box"},He("span",{className:"dsham_bundle_title"},r("sidebar.favoriteStar.title")),He("span",{className:"dsham_bundle_desc"},r("sidebar.favoriteStar.desc"))),He(rn.Switch,{checked:S,onChange:D,label:r("sidebar.favoriteStar.toggle"),disabled:j}))),He(ia,null,H)}e(vr,"ArchiveBundleConfigCard");function br(t){let[r,i]=Ut(t.getLocation),[a,o]=Ut(t.getOnlineUpdateEnabled?t.getOnlineUpdateEnabled:()=>!0),[f,c]=Ut(t.getOnlineUpdateLocked?t.getOnlineUpdateLocked:()=>!1),[k,y]=Ut(t.getSidebarFavoriteStarEnabled?t.getSidebarFavoriteStarEnabled:()=>!0),[A,w]=Ut(null),[g,S]=Ut(!1),[D,j]=Ut(!1),[U,z]=Ut(!1);la(()=>{let V=e(()=>{i(t.getLocation()),w(null),t.getOnlineUpdateEnabled&&o(t.getOnlineUpdateEnabled()),t.getOnlineUpdateLocked&&c(t.getOnlineUpdateLocked()),t.getSidebarFavoriteStarEnabled&&y(t.getSidebarFavoriteStarEnabled())},"syncState");return V(),t.subscribe(V)},[t]);let H=e(V=>{S(!0),w(null),i(V),t.setLocation(V).catch(pe=>{console.error("archive-manager: setLocation failed:",pe),i(t.getLocation()),w(t.t("entry.location.saveFailed")||"\u4FDD\u5B58\u5165\u53E3\u8BBE\u7F6E\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u6216\u91CD\u542F\u5BBF\u4E3B\u8FDB\u7A0B")}).finally(()=>{S(!1)})},"onLocationChange"),ge=t.setOnlineUpdate?V=>{t.getOnlineUpdateLocked?.()||(j(!0),o(V),t.setOnlineUpdate(V).catch(()=>{t.getOnlineUpdateEnabled&&o(t.getOnlineUpdateEnabled())}).finally(()=>{j(!1)}))}:void 0,le=t.setSidebarFavoriteStar?V=>{z(!0),y(V),t.setSidebarFavoriteStar(V).catch(()=>{t.getSidebarFavoriteStarEnabled&&y(t.getSidebarFavoriteStarEnabled())}).finally(()=>{z(!1)})}:void 0;return He(vr,{t:t.t,location:r,errorMessage:A,disabled:g,onLocationChange:H,onlineUpdateEnabled:a,onlineUpdateDisabled:D||f,onlineUpdateLocked:f,onToggleOnlineUpdate:ge,sidebarFavoriteStarEnabled:k,sidebarFavoriteStarDisabled:U,onToggleSidebarFavoriteStar:le})}e(br,"ArchiveBundleConfigCardWrapper");function yr(t,r){if(Ha(),!t.locale)return{getLocation:e(()=>"settings","getLocation"),setLocation:e(async()=>"settings","setLocation"),isSettingsSectionEnabled:e(()=>!0,"isSettingsSectionEnabled"),isEnabled:e(()=>!1,"isEnabled"),isSupported:e(()=>!1,"isSupported"),setEnabled:e(async()=>!1,"setEnabled"),isOnlineUpdateEnabled:e(()=>!0,"isOnlineUpdateEnabled"),isOnlineUpdateLocked:e(()=>!1,"isOnlineUpdateLocked"),setOnlineUpdate:e(async()=>!1,"setOnlineUpdate"),isSidebarFavoriteStarEnabled:e(()=>!0,"isSidebarFavoriteStarEnabled"),setSidebarFavoriteStar:e(async()=>!1,"setSidebarFavoriteStar"),destroy:e(()=>{},"destroy")};let{callApi:i,renderPanel:a,ns:o}=r,f="settings",c=!1,k=!1,y=null,A=null,w=0,g=!1,S,D=new Set,j=e(()=>f==="both"||f==="sidebar","isSidebarEnabled"),U=e(()=>f==="both"||f==="settings","isSettingsSectionEnabled"),z=e(()=>{if(!g)for(let O of D)try{O()}catch{}},"notify"),H=e(()=>{if(g||!k||!j()||y)return;let O=t.slots.register({name:"main",key:gr,locale:o,inject:e(()=>{let Le=typeof r.injectProps=="function"?r.injectProps():{};return Object.assign({t:t.locale?.bind?t.locale.bind(o):void 0},Le)},"inject")},Le=>He("div",{className:"dsham_mainPanel"},a(Le)));y=typeof O=="function"?O:()=>{}},"mountMain"),ge=e(()=>{if(y){try{y()}catch{}y=null}},"unmountMain"),le=e(()=>{if(g||!c||!j()||A)return;let O=t.slots.register({name:"sidebar.panellist",id:gr,order:oi,label:e(()=>t.locale.bind(o)("archives.title"),"label"),locale:o},Le=>ci(Le&&typeof Le=="object"&&"size"in Le?Le:void 0));A=typeof O=="function"?O:()=>{}},"mountRow"),V=e(()=>{if(A){try{A()}catch{}A=null}},"unmountRow"),pe=e(()=>{if(!g)if(j())H(),le();else{if(S?.panelInfo&&typeof S.selectPanel=="function")try{S.panelInfo.getSnapshot().activePanelId===gr&&S.selectPanel(null)}catch{}V(),ge()}},"sync"),me=e(async O=>{if(g)return f;let Le=++w,T=f;if(f=O,pe(),z(),typeof r.onLocationChange=="function")try{r.onLocationChange(O)}catch{}try{return await i("/sidebar-entry",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({location:O})}),O}catch(re){if(Le===w&&(f=T,pe(),z(),typeof r.onLocationChange=="function"))try{r.onLocationChange(T)}catch{}throw re}},"setLocation"),Xe=e(async O=>(await me(O?"both":"settings"),j()),"setEnabled"),ie=!0,Q=!1,mt=0,yt=e(async O=>{if(g||Q)return ie;let Le=++mt;if(ie=O,z(),typeof r.onOnlineUpdateChange=="function")try{r.onOnlineUpdateChange(O)}catch{}try{if(await i("/online-update",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:O})}),Le===mt&&typeof r.onOnlineUpdateChange=="function")try{r.onOnlineUpdateChange(O)}catch{}return O}catch(T){if(Le===mt&&(ie=!O,z(),typeof r.onOnlineUpdateChange=="function"))try{r.onOnlineUpdateChange(!O)}catch{}throw T}},"setOnlineUpdate"),Ke=!0,Ee=0,ft=e(async O=>{if(g)return Ke;let Le=++Ee;if(Ke=O,z(),typeof r.onSidebarFavoriteStarChange=="function")try{r.onSidebarFavoriteStarChange(O)}catch{}try{return await i("/sidebar-favorite-star",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:O})}),O}catch(T){if(Le===Ee&&(Ke=!O,z(),typeof r.onSidebarFavoriteStarChange=="function"))try{r.onSidebarFavoriteStarChange(!O)}catch{}throw T}},"setSidebarFavoriteStar"),lt=w;i("/sidebar-entry").then(O=>{if(!g&&w===lt&&O&&(O.location==="both"||O.location==="sidebar"||O.location==="settings"?f=O.location:typeof O.enabled=="boolean"&&(f=O.enabled?"both":"settings"),pe(),z(),typeof r.onLocationChange=="function"))try{r.onLocationChange(f)}catch{}}).catch(()=>{});let an=mt;i("/online-update").then(O=>{if(!g&&mt===an&&O&&typeof O.enabled=="boolean"&&(ie=O.enabled,O.locked===!0&&(Q=!0),z(),typeof r.onOnlineUpdateChange=="function"))try{r.onOnlineUpdateChange(ie)}catch{}}).catch(()=>{});let Ft=Ee;i("/sidebar-favorite-star").then(O=>{if(!g&&Ee===Ft&&O&&typeof O.enabled=="boolean"&&(Ke=O.enabled,z(),typeof r.onSidebarFavoriteStarChange=="function"))try{r.onSidebarFavoriteStarChange(Ke)}catch{}}).catch(()=>{});let sn=t;return typeof sn.inject=="function"&&sn.inject(["layout"],O=>{!g&&O.layout&&(S=O.layout)}),t.slots.inject("main",()=>{if(!g)return k=!0,H(),()=>{k=!1,ge()}}),t.slots.inject("sidebar.panellist",()=>{if(!g)return c=!0,le(),()=>{c=!1,V()}}),t.slots.inject("plugins.bundle.config",()=>{if(!g)return t.slots.register({name:"plugins.bundle.config",key:ii,locale:o},O=>O&&O.view==="summary"?null:He(br,{t:t.locale.bind(o),getLocation:e(()=>f,"getLocation"),setLocation:me,getEnabled:e(()=>j(),"getEnabled"),setSidebar:Xe,getOnlineUpdateEnabled:e(()=>ie,"getOnlineUpdateEnabled"),setOnlineUpdate:yt,getOnlineUpdateLocked:e(()=>Q,"getOnlineUpdateLocked"),getSidebarFavoriteStarEnabled:e(()=>Ke,"getSidebarFavoriteStarEnabled"),setSidebarFavoriteStar:ft,subscribe:e(Le=>(D.add(Le),()=>{D.delete(Le)}),"subscribe")}))}),{getLocation:e(()=>f,"getLocation"),setLocation:me,isSettingsSectionEnabled:U,isEnabled:e(()=>j(),"isEnabled"),isSupported:e(()=>c,"isSupported"),setEnabled:Xe,isOnlineUpdateEnabled:e(()=>ie,"isOnlineUpdateEnabled"),isOnlineUpdateLocked:e(()=>Q,"isOnlineUpdateLocked"),setOnlineUpdate:yt,isSidebarFavoriteStarEnabled:e(()=>Ke,"isSidebarFavoriteStarEnabled"),setSidebarFavoriteStar:ft,destroy:e(()=>{g||(g=!0,w++,mt++,Ee++,S=void 0,D.clear(),V(),ge())},"destroy")}}e(yr,"setupSidebarEntry");function wr(t){if(typeof t!="string"||t.length===0||t.length>1024)throw new TypeError("\u4F1A\u8BDD ID \u957F\u5EA6\u987B\u4E3A 1\uFF5E1024 \u4E2A\u5B57\u7B26");return t}e(wr,"checkedId");var di={parse(t){let r=ce(t);if(!r||typeof r!="object"||typeof r.favorite!="boolean")throw new TypeError("\u6536\u85CF\u72B6\u6001\u5FC5\u987B\u4E3A\u5E03\u5C14\u503C");return{sessionId:wr(r.sessionId),favorite:r.favorite}}},ui={parse(t){let r=ce(t);if(!r||!Array.isArray(r.favoriteSessionIds)||r.favoriteSessionIds.length>1e5)throw new TypeError("\u6536\u85CF\u96C6\u5408\u65E0\u6548");return{favoriteSessionIds:[...new Set(r.favoriteSessionIds.map(wr))]}},safeParse(t){try{return{success:!0,data:this.parse(t)}}catch(r){return{success:!1,error:r}}}};function Ua(){let t=e((r,i)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${r}`,create:e(()=>i,"create"),schema:i}),"codec");return["favoriteSessions","setSessionFavorite"].map(r=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${r}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:r,invocation:{kind:"direct"},parameters:r==="favoriteSessions"?[]:[{name:"input",wire:"input",source:"json",codec:t("FavoriteInput",di)}],result:t("FavoriteState",ui),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}e(Ua,"favoriteInvocations");function Sr(t,{days:r,now:i=Date.now(),favorites:a=new Set,currentId:o,pending:f=new Map}){if(!t||!Number.isInteger(r)||r<1||r>36500||a.has(t.id)||t.id===o||(t.retainedBy?.mainView??0)>0||t.running||(t.runningSubagentCount??0)>0||t.pendingInteraction!=null||f.has(t.id))return!1;let c=typeof t.updatedAt=="number"?t.updatedAt:Date.parse(t.updatedAt??"");return Number.isFinite(c)&&c<=i-r*864e5}e(Sr,"idleArchiveCandidate");async function Yn(t,r,{onProgress:i,refresh:a}={}){let o=[...new Set(t.map(wr))],f={requested:o,succeeded:[],skipped:[],failures:[],remaining:[],refreshError:null},c=e(()=>i?.({total:o.length,done:f.succeeded.length+f.skipped.length+f.failures.length,succeeded:f.succeeded.length,skipped:f.skipped.length,failed:f.failures.length}),"report");c();for(let k of o){try{(await r(k)?f.succeeded:f.skipped).push(k)}catch(y){f.failures.push({sessionId:k,message:y instanceof Error?y.message:String(y)}),f.remaining.push(k)}c()}try{await a?.()}catch(k){f.refreshError=k instanceof Error?k.message:String(k)}return f}e(Yn,"runSessionBatch");function Wa({workspaces:t,sessions:r,archive:i,restore:a,deleteOne:o,getFavorites:f,refresh:c,currentSessionId:k}){return async(y,A,w={})=>{if(!["archive","restore","undo","delete"].includes(y))throw new TypeError("\u672A\u77E5\u6279\u91CF\u64CD\u4F5C");return Yn(A,async g=>{let D=t.getSnapshot().archivedSessionIds.includes(g);if(y==="archive"){if(D||!r.getSnapshot().byId[g])return!1;if(w.idleDays!==void 0){let ge=new Set((await f()).favoriteSessionIds),le=r.getSnapshot();if(!Sr(le.byId[g],{days:w.idleDays,favorites:ge,currentId:k(le),pending:w.getPending?.()??w.pending}))return!1}return await i(g),t.getSnapshot().archivedSessionIds.includes(g)}return D?y==="delete"?(await o(g),!0):!((await a(g))?.archivedSessionIds??t.getSnapshot().archivedSessionIds).includes(g):!1},{onProgress:w.onProgress,refresh:c})}}e(Wa,"createSessionOrganizer");function hi(t){return!t||t<=0?"0 B":t<1024?t+" B":t<1024*1024?(t/1024).toFixed(1)+" KB":(t/(1024*1024)).toFixed(1)+" MB"}e(hi,"formatBytes");function qa(t,r){let i=t.createElement;function a(f,c){return i(r??(y=>i("button",{type:"button",disabled:y.disabled,onClick:y.onClick},y.children)),{variant:"outline",size:"sm",...c},f)}e(a,"textButton");function o({title:f,failures:c,separator:k}){let[y,A]=t.useState(!1),w=i("ul",null,c.map(g=>i("li",{key:g.sessionId},g.sessionId,k,g.message)));return i(Vn,{title:f,open:y,onToggle:e(()=>A(g=>!g),"onToggle")},w)}return e(o,"FailureDetails"),e(function({t:c,archived:k,busy:y,ready:A,days:w,onDays:g,count:S,onPreview:D,progress:j,result:U,onRetry:z,undoCount:H,onUndo:ge,onReload:le,orphanCount:V=0,orphanSizeBytes:pe=0,orphanCleaning:me=!1,onCleanOrphans:Xe,cacheCount:ie=0,cacheRepair:Q,onRebuildCaches:mt,onRetryCaches:yt,onReloadCaches:Ke,onDismissCaches:Ee}){return i(t.Fragment,null,i("style",null,".dsham_organizer,.dsham_batchFeedback{display:grid;gap:12px;margin:0 0 16px;padding:14px 16px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2)}.dsham_organizerControls{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.dsham_organizer label{display:inline-flex;align-items:center;gap:8px;font-size:13px;color:var(--dsw-alias-label-primary)}.dsham_number{width:88px;height:32px;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px}.dsham_number:hover{border-color:var(--dsw-alias-border-l3)}.dsham_number:focus{outline:none;border-color:var(--dsw-alias-state-business-primary)}.dsham_disclosure{display:inline-flex;align-items:center;gap:6px;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;cursor:pointer}.dsham_foldChevron{transition:transform 150ms ease}.dsham_foldChevron.is-open{transform:rotate(180deg)}.dsham_organizer p,.dsham_batchFeedback p{margin:0;font-size:12px;color:var(--dsw-alias-label-secondary)}.dsham_batchFeedback progress{width:100%}.dsham_batchFeedback details{font-size:12px;overflow-wrap:anywhere}.dsham_archivePreview{max-height:260px;overflow:auto;display:grid;gap:8px;padding:8px 0}.dsham_archivePreview label{display:flex;gap:8px;align-items:center;overflow-wrap:anywhere}"),(!k||!A)&&i("div",{className:"dsham_organizer"},i("div",{className:"dsham_organizerControls"},!A&&a(c("organizer.reloadFavorites"),{disabled:y,onClick:le}),!k&&i(t.Fragment,null,i("label",null,c("organizer.idleDays"),i(da,{min:1,max:36500,value:w===""?null:Number(w),disabled:y,"aria-label":c("organizer.idleDays"),onChange:e(ft=>g(ft==null?"":String(ft)),"onChange")})),a(c("organizer.preview",{n:S}),{disabled:y||!A||S===0,onClick:D}))),!k&&i("p",null,c("organizer.rules"))),V>0&&i("div",{className:"dsham_organizer"},i("div",{className:"dsham_organizerControls"},i("strong",null,c("organizer.orphanTitle",{n:V})),Xe&&a(c(me?"organizer.cleaning":"organizer.cleanOrphans"),{disabled:y||me,onClick:Xe})),i("p",null,c("organizer.orphanDesc",{size:hi(pe)}))),ie>0&&i("div",{className:"dsham_organizer"},i("div",{className:"dsham_organizerControls"},i("strong",null,c("organizer.cacheTitle",{n:ie})),mt&&a(c(Q?.busy?"organizer.cacheRebuilding":"organizer.cacheRebuild"),{disabled:y||Q?.busy,onClick:mt})),i("p",null,c("organizer.cacheDesc"))),Q&&(Q.result||Q.progress||Q.error||Q.refreshError)&&i("section",{className:"dsham_batchFeedback","aria-label":c("organizer.cacheRebuild")},Q.progress&&i("div",{role:"status"},i("progress",{value:Q.progress.done,max:Math.max(1,Q.progress.total)}),c("organizer.progressCount",Q.progress)),Q.result&&i("div",{role:"status"},i("p",null,c("organizer.result",{succeeded:Q.result.rebuiltSessionIds.length,skipped:Q.result.skippedSessionIds.length,failed:Q.result.failures.length})),Q.result.failures.length>0&&i(o,{title:c("organizer.failureDetails"),failures:Q.result.failures,separator:c("common.separator")}),Q.result.failures.length>0&&yt&&a(c("organizer.cacheRetry",{n:Q.result.failures.length}),{disabled:y||Q.busy,onClick:yt})),Q.error&&i("p",{role:"alert"},c("organizer.cacheError",{detail:Q.error})),Q.refreshError&&i("p",{role:"alert"},c("organizer.refreshError",{detail:Q.refreshError})),i("div",{className:"dsham_organizerControls"},Ke&&a(c("organizer.cacheCheck"),{disabled:y||Q.busy,onClick:Ke}),Ee&&a(c("organizer.dismiss"),{disabled:y||Q.busy,onClick:Ee}))),(j||U||H>0)&&i("section",{className:"dsham_batchFeedback","aria-label":c("organizer.feedback")},j&&i("div",{role:"status","aria-live":"polite"},i("progress",{value:j.done,max:Math.max(1,j.total),"aria-label":c("organizer.progress")}),c("organizer.progressCount",{done:j.done,total:j.total})),U&&i("div",{role:"status"},i("strong",null,c(`organizer.${U.kind??"archive"}Result`)),i("p",null,c("organizer.result",{succeeded:U.succeeded.length,skipped:U.skipped.length,failed:U.failures.length})),U.failures.length>0&&i(o,{title:c("organizer.failureDetails"),failures:U.failures,separator:c("common.separator")}),U.refreshError&&i("p",{role:"alert"},c("organizer.refreshError",{detail:U.refreshError})),U.remaining.length>0&&a(c("organizer.retry",{n:U.remaining.length}),{disabled:y,onClick:z})),H>0&&i("div",{className:"dsham_organizerControls"},a(c("organizer.undo",{n:H}),{disabled:y,onClick:ge}),i("p",null,c("organizer.undoHint")))))},"OrganizerPanel")}e(qa,"createOrganizerPanel");var Va={"organizer.cacheTitle":"\u53D1\u73B0 {n} \u4E2A\u4F1A\u8BDD\u7F3A\u5C11\u53EF\u7528\u5217\u8868\u7F13\u5B58","organizer.cacheDesc":"\u68C0\u67E5\u5DE5\u4F5C\u533A\u3001\u672A\u5206\u7EC4\u53CA\u5F52\u6863\u666E\u901A\u4F1A\u8BDD\u7684\u5934\u90E8\u4E0E\u5B98\u65B9\u7F13\u5B58\u3002\u70B9\u51FB\u540E\u9010\u6761\u53EA\u8BFB\u65E5\u5FD7\u5E76\u91CD\u5EFA\u5B98\u65B9\u5217\u8868\u7F13\u5B58\uFF1B\u8DF3\u8FC7\u6D3B\u52A8\u4F1A\u8BDD\uFF0C\u4E0D\u6253\u5F00\u4F1A\u8BDD\u3001\u4E0D\u8C03\u7528\u6A21\u578B\uFF0C\u4E5F\u4E0D\u6539\u53D8\u5F52\u6863\u6216\u5B9A\u65F6\u4EFB\u52A1\u3002\u8D85\u65F6\u8868\u793A\u4FDD\u5B58\u672A\u786E\u8BA4\uFF0C\u53EF\u91CD\u8BD5\u3002","organizer.cacheRebuild":"\u91CD\u5EFA\u5217\u8868\u7F13\u5B58","organizer.cacheRebuilding":"\u91CD\u5EFA\u4E2D\u2026","organizer.cacheRetry":"\u91CD\u8BD5\u5931\u8D25 {n} \u6761","organizer.cacheCheck":"\u5237\u65B0\u5217\u8868\u5E76\u91CD\u65B0\u68C0\u6D4B","organizer.cacheError":"\u7F13\u5B58\u68C0\u6D4B\u5931\u8D25\uFF1A{detail}","organizer.dismiss":"\u5B8C\u6210","organizer.feedback":"\u64CD\u4F5C\u53CD\u9988","organizer.allSessions":"\u5168\u90E8\u4F1A\u8BDD","organizer.favoriteFilter":"\u6536\u85CF\u7B5B\u9009","organizer.archiveResult":"\u5F52\u6863\u7ED3\u679C","organizer.restoreResult":"\u6062\u590D\u7ED3\u679C","organizer.deleteResult":"\u5220\u9664\u7ED3\u679C","organizer.undoResult":"\u64A4\u56DE\u7ED3\u679C","organizer.favorite":"\u6536\u85CF","organizer.unfavorite":"\u53D6\u6D88\u6536\u85CF","organizer.favoritesOnly":"\u53EA\u770B\u6536\u85CF","organizer.reloadFavorites":"\u91CD\u65B0\u52A0\u8F7D\u6536\u85CF","organizer.idleDays":"\u95F2\u7F6E\u5929\u6570","organizer.preview":"\u9884\u89C8\u95F2\u7F6E\u5F52\u6863\uFF08{n}\uFF09","organizer.rules":"\u6309\u6700\u540E\u6D3B\u52A8\u65F6\u95F4\u7B5B\u9009\uFF0C\u9075\u5FAA\u5F53\u524D\u5217\u8868\u7B5B\u9009\u6761\u4EF6\uFF1B\u6392\u9664\u6536\u85CF\u3001\u5F53\u524D\u6253\u5F00\u3001\u6B63\u5728\u6267\u884C\u53CA\u7B49\u5F85\u4EA4\u4E92\u7684\u4F1A\u8BDD\u3002","organizer.progress":"\u6279\u91CF\u64CD\u4F5C\u8FDB\u5EA6","organizer.progressCount":"\u5DF2\u5904\u7406 {done} / {total}","organizer.result":"\u6210\u529F {succeeded} \xB7 \u8DF3\u8FC7 {skipped} \xB7 \u5931\u8D25 {failed}","organizer.failureDetails":"\u67E5\u770B\u5931\u8D25\u8BE6\u60C5","organizer.refreshError":"\u64CD\u4F5C\u7ED3\u679C\u5DF2\u4FDD\u7559\uFF0C\u4F46\u5217\u8868\u5237\u65B0\u5931\u8D25\uFF1A{detail}","organizer.retry":"\u91CD\u8BD5\u5269\u4F59 {n} \u6761","organizer.undo":"\u64A4\u56DE\u672C\u6B21\u5F52\u6863\uFF08{n}\uFF09","organizer.undoHint":"\u4EC5\u4FDD\u7559\u672C\u6B21\u6253\u5F00\u7BA1\u7406\u9875\u671F\u95F4\u6700\u8FD1\u4E00\u6279\u5F52\u6863\uFF1B\u5173\u95ED\u9875\u9762\u6216\u5237\u65B0\u540E\u6E05\u9664\u3002\u64A4\u56DE\u4E0D\u4F1A\u6062\u590D\u5DF2\u5220\u9664\u7684\u4F1A\u8BDD\u3002","organizer.idleConfirm":"\u8BF7\u68C0\u67E5\u4EE5\u4E0B\u5019\u9009\uFF0C\u53EF\u53D6\u6D88\u52FE\u9009\uFF1B\u6267\u884C\u524D\u518D\u6B21\u6392\u9664\u6536\u85CF\u53CA\u6D3B\u8DC3\u4F1A\u8BDD\u3002","organizer.manualConfirm":"\u4EC5\u5F52\u6863\u4EE5\u4E0B\u52FE\u9009\u4F1A\u8BDD\uFF1B\u53EF\u9010\u6761\u53D6\u6D88\u3002\u5F52\u6863\u540E\u53EF\u64A4\u56DE\u672C\u6279\u64CD\u4F5C\u3002","organizer.orphanTitle":"\u53D1\u73B0 {n} \u4E2A\u65E0\u4E3B\u5B64\u513F\u5B50\u4EE3\u7406","organizer.orphanDesc":"\u6BCD\u4F1A\u8BDD\u5DF2\u88AB\u5916\u90E8\u5220\u9664\uFF0C\u8FD9\u4E9B\u5B50\u4EE3\u7406\u5728\u65E5\u5E38\u804A\u5929\u5217\u8868\u4E2D\u4E0D\u53EF\u89C1\uFF0C\u5171\u5360\u7528\u7EA6 {size} \u78C1\u76D8\u7A7A\u95F4\u3002\u6E05\u7406\u4E0D\u53EF\u64A4\u9500\u3002","organizer.cleanOrphans":"\u6E05\u7406\u5168\u90E8\u5B64\u513F","organizer.cleaning":"\u6E05\u7406\u4E2D\u2026","organizer.orphanCleanSuccess":"\u5DF2\u6210\u529F\u6E05\u7406 {n} \u4E2A\u65E0\u4E3B\u5B50\u4EE3\u7406\u4F1A\u8BDD\u3002"},$a={"organizer.cacheTitle":"Found {n} sessions without usable list caches","organizer.cacheDesc":"Checks headers and official caches for workspace, ungrouped, and archived ordinary sessions. On click, reads logs one at a time and rebuilds official caches. Skips active sessions; never opens sessions, calls models or changes archives or schedules. Timeout means persistence is unconfirmed and can be retried.","organizer.cacheRebuild":"Rebuild list caches","organizer.cacheRebuilding":"Rebuilding\u2026","organizer.cacheRetry":"Retry {n} failed","organizer.cacheCheck":"Refresh lists and check again","organizer.cacheError":"Cache check failed: {detail}","organizer.dismiss":"Done","organizer.feedback":"Operation feedback","organizer.allSessions":"All sessions","organizer.favoriteFilter":"Favorites filter","organizer.archiveResult":"Archive results","organizer.restoreResult":"Restore results","organizer.deleteResult":"Delete results","organizer.undoResult":"Undo results","organizer.favorite":"Favorite","organizer.unfavorite":"Unfavorite","organizer.favoritesOnly":"Favorites only","organizer.reloadFavorites":"Reload favorites","organizer.idleDays":"Idle days","organizer.preview":"Preview idle archives ({n})","organizer.rules":"Uses last activity, the current list filters. Excludes favorites, open, running and waiting sessions.","organizer.progress":"Batch progress","organizer.progressCount":"Processed {done} / {total}","organizer.result":"Succeeded {succeeded} \xB7 Skipped {skipped} \xB7 Failed {failed}","organizer.failureDetails":"Failure details","organizer.refreshError":"Results retained, but refresh failed: {detail}","organizer.retry":"Retry remaining {n}","organizer.undo":"Undo this archive batch ({n})","organizer.undoHint":"Only the latest archive batch while this page is open is retained. Closing or refreshing clears undo. Deleted sessions cannot be restored.","organizer.idleConfirm":"Review and deselect candidates. Favorites and active sessions are checked again before archiving.","organizer.manualConfirm":"Only checked sessions below will be archived. You can undo this batch afterward.","organizer.orphanTitle":"Found {n} orphan subagents","organizer.orphanDesc":"Parent sessions were deleted externally. These subagents are hidden from normal chat lists and occupy ~{size} disk space. Removal cannot be undone.","organizer.cleanOrphans":"Clean up all orphans","organizer.cleaning":"Cleaning up\u2026","organizer.orphanCleanSuccess":"Successfully cleaned up {n} orphan subagent sessions."},Ga={"organizer.cacheTitle":"\u041D\u0430\u0439\u0434\u0435\u043D\u043E {n} \u0441\u0435\u0441\u0441\u0438\u0439 \u0431\u0435\u0437 \u043F\u0440\u0438\u0433\u043E\u0434\u043D\u043E\u0433\u043E \u043A\u0435\u0448\u0430 \u0441\u043F\u0438\u0441\u043A\u0430","organizer.cacheDesc":"\u041F\u0440\u043E\u0432\u0435\u0440\u044F\u044E\u0442\u0441\u044F \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0438 \u0438 \u043E\u0444\u0438\u0446\u0438\u0430\u043B\u044C\u043D\u044B\u0439 \u043A\u0435\u0448 \u0441\u0435\u0441\u0441\u0438\u0439 \u0440\u0430\u0431\u043E\u0447\u0438\u0445 \u043E\u0431\u043B\u0430\u0441\u0442\u0435\u0439, \u0431\u0435\u0437 \u0433\u0440\u0443\u043F\u043F\u044B \u0438 \u0430\u0440\u0445\u0438\u0432\u0430. \u041F\u043E \u043D\u0430\u0436\u0430\u0442\u0438\u044E \u0436\u0443\u0440\u043D\u0430\u043B\u044B \u0447\u0438\u0442\u0430\u044E\u0442\u0441\u044F \u043F\u043E \u043E\u0434\u043D\u043E\u043C\u0443 \u0434\u043B\u044F \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F \u043E\u0444\u0438\u0446\u0438\u0430\u043B\u044C\u043D\u043E\u0433\u043E \u043A\u0435\u0448\u0430. \u0410\u043A\u0442\u0438\u0432\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u043F\u0440\u043E\u043F\u0443\u0441\u043A\u0430\u044E\u0442\u0441\u044F; \u0441\u0435\u0441\u0441\u0438\u0438 \u043D\u0435 \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u044E\u0442\u0441\u044F, \u043C\u043E\u0434\u0435\u043B\u0438 \u043D\u0435 \u0432\u044B\u0437\u044B\u0432\u0430\u044E\u0442\u0441\u044F, \u0430\u0440\u0445\u0438\u0432\u044B \u0438 \u0440\u0430\u0441\u043F\u0438\u0441\u0430\u043D\u0438\u044F \u043D\u0435 \u043C\u0435\u043D\u044F\u044E\u0442\u0441\u044F. \u0422\u0430\u0439\u043C-\u0430\u0443\u0442 \u043E\u0437\u043D\u0430\u0447\u0430\u0435\u0442 \u043D\u0435\u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0451\u043D\u043D\u043E\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435; \u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u043F\u043E\u0432\u0442\u043E\u0440.","organizer.cacheRebuild":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u043A\u0435\u0448 \u0441\u043F\u0438\u0441\u043A\u043E\u0432","organizer.cacheRebuilding":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435\u2026","organizer.cacheRetry":"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C {n} \u043E\u0448\u0438\u0431\u043E\u043A","organizer.cacheCheck":"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u043F\u0438\u0441\u043A\u0438 \u0438 \u043F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C","organizer.cacheError":"\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 \u043A\u0435\u0448\u0430: {detail}","organizer.dismiss":"\u0413\u043E\u0442\u043E\u0432\u043E","organizer.feedback":"\u041E\u0442\u0437\u044B\u0432 \u043E\u0431 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438","organizer.allSessions":"\u0412\u0441\u0435 \u0441\u0435\u0441\u0441\u0438\u0438","organizer.favoriteFilter":"\u0424\u0438\u043B\u044C\u0442\u0440 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E","organizer.archiveResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438","organizer.restoreResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F","organizer.deleteResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u044F","organizer.undoResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u043E\u0442\u043C\u0435\u043D\u044B","organizer.favorite":"\u0412 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435","organizer.unfavorite":"\u0423\u0431\u0440\u0430\u0442\u044C \u0438\u0437 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E","organizer.favoritesOnly":"\u0422\u043E\u043B\u044C\u043A\u043E \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435","organizer.reloadFavorites":"\u041F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435","organizer.idleDays":"\u0414\u043D\u0438 \u043F\u0440\u043E\u0441\u0442\u043E\u044F","organizer.preview":"\u041F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0430\u0440\u0445\u0438\u0432\u0430 \u043F\u0440\u043E\u0441\u0442\u043E\u044F ({n})","organizer.rules":"\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u044E\u044E \u0430\u043A\u0442\u0438\u0432\u043D\u043E\u0441\u0442\u044C \u0438 \u0442\u0435\u043A\u0443\u0449\u0438\u0435 \u0444\u0438\u043B\u044C\u0442\u0440\u044B \u0441\u043F\u0438\u0441\u043A\u0430. \u0418\u0441\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435, \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u0435, \u0437\u0430\u043F\u0443\u0449\u0435\u043D\u043D\u044B\u0435 \u0438 \u043E\u0436\u0438\u0434\u0430\u044E\u0449\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438.","organizer.progress":"\u0425\u043E\u0434 \u043F\u0430\u043A\u0435\u0442\u043D\u043E\u0439 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438","organizer.progressCount":"\u041E\u0431\u0440\u0430\u0431\u043E\u0442\u0430\u043D\u043E {done} / {total}","organizer.result":"\u0423\u0441\u043F\u0435\u0448\u043D\u043E {succeeded} \xB7 \u041F\u0440\u043E\u043F\u0443\u0449\u0435\u043D\u043E {skipped} \xB7 \u041E\u0448\u0438\u0431\u043E\u043A {failed}","organizer.failureDetails":"\u041F\u043E\u0434\u0440\u043E\u0431\u043D\u043E\u0441\u0442\u0438 \u043E\u0448\u0438\u0431\u043E\u043A","organizer.refreshError":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u044B, \u043D\u043E \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u043F\u0438\u0441\u043A\u0430 \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C: {detail}","organizer.retry":"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C \u043E\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044F {n}","organizer.undo":"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u044D\u0442\u0443 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044E ({n})","organizer.undoHint":"\u0421\u043E\u0445\u0440\u0430\u043D\u044F\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u044F\u044F \u043F\u0430\u043A\u0435\u0442\u043D\u0430\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F, \u043F\u043E\u043A\u0430 \u043E\u0442\u043A\u0440\u044B\u0442\u0430 \u044D\u0442\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430. \u0417\u0430\u043A\u0440\u044B\u0442\u0438\u0435 \u0438\u043B\u0438 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u0431\u0440\u0430\u0441\u044B\u0432\u0430\u0435\u0442 \u043E\u0442\u043C\u0435\u043D\u0443. \u0423\u0434\u0430\u043B\u0451\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u043D\u0435\u043B\u044C\u0437\u044F.","organizer.idleConfirm":"\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u043A\u0430\u043D\u0434\u0438\u0434\u0430\u0442\u043E\u0432, \u043C\u043E\u0436\u043D\u043E \u0441\u043D\u044F\u0442\u044C \u043E\u0442\u043C\u0435\u0442\u043A\u0443. \u041F\u0435\u0440\u0435\u0434 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0435\u0439 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435 \u0438 \u0430\u043A\u0442\u0438\u0432\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u043F\u0440\u043E\u0432\u0435\u0440\u044F\u044E\u0442\u0441\u044F \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E.","organizer.manualConfirm":"\u0411\u0443\u0434\u0443\u0442 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u044B \u0442\u043E\u043B\u044C\u043A\u043E \u043E\u0442\u043C\u0435\u0447\u0435\u043D\u043D\u044B\u0435 \u043D\u0438\u0436\u0435 \u0441\u0435\u0441\u0441\u0438\u0438. \u042D\u0442\u0443 \u043F\u0430\u043A\u0435\u0442\u043D\u0443\u044E \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u044E \u043C\u043E\u0436\u043D\u043E \u043E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u043F\u043E\u0437\u0436\u0435.","organizer.orphanTitle":"\u041D\u0430\u0439\u0434\u0435\u043D\u043E {n} \u043E\u0441\u0438\u0440\u043E\u0442\u0435\u0432\u0448\u0438\u0445 \u043F\u043E\u0434\u0430\u0433\u0435\u043D\u0442\u043E\u0432","organizer.orphanDesc":"\u0420\u043E\u0434\u0438\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u0431\u044B\u043B\u0438 \u0443\u0434\u0430\u043B\u0435\u043D\u044B \u0438\u0437\u0432\u043D\u0435. \u041F\u043E\u0434\u0430\u0433\u0435\u043D\u0442\u044B \u0441\u043A\u0440\u044B\u0442\u044B \u0438\u0437 \u043E\u0431\u044B\u0447\u043D\u044B\u0445 \u0441\u043F\u0438\u0441\u043A\u043E\u0432 \u0447\u0430\u0442\u043E\u0432 \u0438 \u0437\u0430\u043D\u0438\u043C\u0430\u044E\u0442 ~{size} \u0434\u0438\u0441\u043A\u043E\u0432\u043E\u0433\u043E \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430. \u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","organizer.cleanOrphans":"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0432\u0441\u0435\u0445 \u0441\u0438\u0440\u043E\u0442","organizer.cleaning":"\u041E\u0447\u0438\u0441\u0442\u043A\u0430\u2026","organizer.orphanCleanSuccess":"\u0423\u0441\u043F\u0435\u0448\u043D\u043E \u043E\u0447\u0438\u0449\u0435\u043D\u043E {n} \u043E\u0441\u0438\u0440\u043E\u0442\u0435\u0432\u0448\u0438\u0445 \u043F\u043E\u0434\u0430\u0433\u0435\u043D\u0442\u043E\u0432."};var fn=Function("return globalThis.__dshArchiveReactDOM")(),Ka=Function("return globalThis.__dshArchiveReactDOMClient")(),Ya=fn.createPortal,Do=fn.flushSync,Mo=Ka?.createRoot,Lo=Ka?.hydrateRoot,zo=fn.findDOMNode,Po=fn.unmountComponentAtNode,Oo=fn.unstable_batchedUpdates,Fo=fn.version;function pi(t){var r={exports:{}},i=r.exports;Object.defineProperty(i,Symbol.toStringTag,{value:"Module"});let a=t("react/jsx-runtime"),o=t("react"),f=t("react-dom"),c=t("@deepseek-ai/dsh-client-ui-primitives");function k({open:n,onClose:s,title:l,description:h,footer:v,children:m,className:C,width:E,portalToBody:N=!1,closeLabel:F,t:_}){let P=o.useRef(null),B=o.useCallback(()=>P.current?.closest(".dsham_settings")??document.body,[]),[u,Ie]=o.useState(null);o.useEffect(()=>{if(!n){Ie(null);return}Ie(N?typeof document<"u"?document.body:null:B())},[n,B,N]),o.useEffect(()=>{if(!n)return;let St=e(ct=>{ct.key==="Escape"&&(ct.preventDefault(),ct.stopPropagation(),"stopImmediatePropagation"in ct&&typeof ct.stopImmediatePropagation=="function"&&ct.stopImmediatePropagation(),s())},"onKey");return window.addEventListener("keydown",St,!0),()=>window.removeEventListener("keydown",St,!0)},[n,s]);let Oe=F||_("common.close"),be=(0,a.jsxs)("div",{className:"dsham_modalRoot",role:"presentation",children:[(0,a.jsx)("div",{className:"dsham_modalMask",onClick:s}),(0,a.jsxs)("div",{role:"dialog","aria-modal":!0,"aria-label":typeof l=="string"?l:void 0,className:es("dsham_modalDialog",C),style:{width:E??560},children:[(0,a.jsxs)("div",{className:"dsham_modalHeader",children:[(0,a.jsx)("h2",{title:typeof l=="string"?l:void 0,children:l}),(0,a.jsx)("button",{type:"button",className:"dsham_modalClose",onClick:s,"aria-label":Oe,title:Oe,children:(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:14,height:14,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round","aria-hidden":"true",children:(0,a.jsx)("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]}),h!=null&&(0,a.jsx)("p",{children:h}),m!=null&&(0,a.jsx)("div",{className:"dsham_modalBody",children:m}),v!=null&&(0,a.jsx)("div",{className:"dsham_modalFooter",children:v})]})]});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y,{refObject:P,getContainer:B}),n&&u?Ya(be,u):null]})}e(k,"SettingsModal");function y({refObject:n,getContainer:s}){return(0,a.jsx)("span",{hidden:!0,ref:n,"data-get-container":s})}e(y,"SettingsModalAnchor");function A({variant:n="outline",icon:s,children:l,className:h,disabled:v,title:m,onClick:C,"aria-label":E,"aria-pressed":N,"aria-expanded":F,"aria-haspopup":_}){return(0,a.jsx)(c.Button,{variant:n,size:"sm",className:h,disabled:v,title:m,onClick:C,"aria-label":E,"aria-pressed":N,"aria-expanded":F,"aria-haspopup":_,icon:s,children:l})}e(A,"settingsButton");function w({variant:n="outline",danger:s=!1,disabled:l,onClick:h,children:v}){return(0,a.jsx)(c.Button,{variant:s?"outline":n,className:s?"dsham_btnDanger":void 0,disabled:l,onClick:h,children:v})}e(w,"modalFooterButton");function g(n,s){let l={className:n?"dsham_archiveTabsLocked":void 0,children:s};return n&&(l.inert=""),l}e(g,"tabsShell");let S=qa(o,c.Button),{HighlightedText:D,useArchiveSearch:j,useArchivePreview:U,DiscoveryFilters:z,SearchStatus:H,PreviewContent:ge}=wa(o,{Button:c.Button,SegmentedControl:c.SegmentedControl}),le={refresh:["M13.5 5.5V2.5m0 0h-3m3 0-2.1 2.1A5.5 5.5 0 1 0 13.2 12"],download:["M8 2v8m0 0 3-3m-3 3-3-3M3 13v2h10v-2"],copy:["M5 5h8v8H5z","M3 3h8"],close:["m4 4 8 8M12 4 4 12"]};function V(n){let s=document.createElement("span"),l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttribute("viewBox","0 0 16 16"),l.setAttribute("width","16"),l.setAttribute("height","16"),l.setAttribute("fill","none"),l.setAttribute("stroke","currentColor"),l.setAttribute("stroke-width","1.5"),l.setAttribute("stroke-linecap","round"),l.setAttribute("stroke-linejoin","round"),l.setAttribute("aria-hidden","true");for(let h of le[n]){let v=document.createElementNS("http://www.w3.org/2000/svg","path");v.setAttribute("d",h),l.append(v)}return s.append(l),s}e(V,"createPluginUpdateIcon");let pe={parse(n){if(typeof n!="string"||n.length===0)throw new TypeError(`sessionId must be a non-empty string, got ${String(n)}`);return n}},me={parse(n){let s=ce(n);if(typeof s!="object"||s===null||Array.isArray(s))throw new TypeError("result must be an object");let l=s.archivedSessionIds;if(!Array.isArray(l)||l.some(h=>typeof h!="string"))throw new TypeError("archivedSessionIds must be a string array");return s}},Xe={parse(n){let s=ce(n);if(typeof s!="object"||s===null||Array.isArray(s)||s.deleted!==!0)throw new TypeError("deleted must be true");return s}},ie={parse(n){let s=ce(n);if(typeof s!="object"||s===null||Array.isArray(s))throw new TypeError("target must be an object");if(s.scope==="all"||s.scope==="ungrouped"||s.scope==="workspace"&&typeof s.workspaceId=="string"&&s.workspaceId.length>0||s.scope==="sessions"&&Array.isArray(s.sessionIds)&&s.sessionIds.length>0&&s.sessionIds.every(l=>typeof l=="string"&&l.length>0))return s;throw new TypeError("target.scope must be all, ungrouped, workspace with a non-empty workspaceId, or sessions with non-empty sessionIds")}},Q={parse(n){let s=ce(n);if(typeof s!="object"||s===null||Array.isArray(s))throw new TypeError("result must be an object");for(let l of["requestedSessionIds","deletedSessionIds","skippedSessionIds"])if(!Array.isArray(s[l])||s[l].some(h=>typeof h!="string"))throw new TypeError(`${l} must be a string array`);if(!Array.isArray(s.failures)||s.failures.some(l=>typeof l!="object"||l===null||typeof l.sessionId!="string"||typeof l.message!="string"))throw new TypeError("failures must contain sessionId/message objects");return s}},mt={parse(n){let s=ce(n);if(typeof s!="object"||s===null||Array.isArray(s)||!Array.isArray(s.items))throw new TypeError("result.items must be an array");if(s.items.some(l=>typeof l!="object"||l===null||typeof l.sessionId!="string"||typeof l.createdAt!="number"||!Number.isFinite(l.createdAt)))throw new TypeError("items must contain sessionId/createdAt objects");return s}},yt={parse(n){let s=ce(n);if(!s||typeof s.sessionId!="string"||!s.sessionId||typeof s.targetWorkspaceId!="string"||!s.targetWorkspaceId)throw new TypeError("sessionId and targetWorkspaceId must be non-empty strings");return{sessionId:s.sessionId,targetWorkspaceId:s.targetWorkspaceId}}},Ke={parse(n){let s=ce(n);if(!s||s.ok!==!0)throw new TypeError("session move result must be ok: true");return s}};function Ee(n,s){return{mode:"strict",typeSymbol:n,create:e(()=>s,"create"),schema:s}}e(Ee,"strictCodec");let ft={package:"@michengai/dsh-archive-manager",descriptors:[...Ua(),...ga(),...Ia(),{id:"@michengai/dsh-archive-manager#workspaceRegistry/unarchiveSession",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"unarchiveSession",invocation:{kind:"direct"},parameters:[{name:"sessionId",wire:"sessionId",source:"json",codec:Ee("@deepseek-ai/dsh-session/types#SessionId",pe)}],result:Ee("@michengai/dsh-archive-manager/types#ArchivedSessionIds",me),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/deleteSession",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"deleteSession",invocation:{kind:"direct"},parameters:[{name:"sessionId",wire:"sessionId",source:"json",codec:Ee("@deepseek-ai/dsh-session/types#SessionId",pe)}],result:Ee("@michengai/dsh-archive-manager/types#Deleted",Xe),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/deleteArchivedSessions",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"deleteArchivedSessions",invocation:{kind:"direct"},parameters:[{name:"target",wire:"target",source:"json",codec:Ee("@michengai/dsh-archive-manager/types#ArchivedBatchTarget",ie)}],result:Ee("@michengai/dsh-archive-manager/types#DeletedBatch",Q),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/archivedSessionMetadata",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"archivedSessionMetadata",invocation:{kind:"direct"},parameters:[],result:Ee("@michengai/dsh-archive-manager/types#ArchivedSessionMetadata",mt),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/diagnoseOrphanSubagents",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"diagnoseOrphanSubagents",invocation:{kind:"direct"},parameters:[],result:Ee("@michengai/dsh-archive-manager/types#OrphanSubagentDiagnosis",{parse(n){let s=ce(n);if(!s||typeof s.count!="number"||!Array.isArray(s.items)||typeof s.totalSizeBytes!="number")throw new TypeError("invalid orphan subagent diagnosis");return s}}),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/cleanOrphanSubagents",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"cleanOrphanSubagents",invocation:{kind:"direct"},parameters:[{name:"target",wire:"target",source:"json",acceptsUndefined:!0,codec:Ee("@michengai/dsh-archive-manager/types#CleanOrphanTarget",{parse(n){if(n==null)return{};let s=ce(n);if(!s)throw new TypeError("target must be an object");if(s.sessionIds!==void 0&&(!Array.isArray(s.sessionIds)||s.sessionIds.some(l=>typeof l!="string")))throw new TypeError("sessionIds must be an array of strings");return s}})}],result:Ee("@michengai/dsh-archive-manager/types#CleanOrphanResult",{parse(n){let s=ce(n);if(!s||!Array.isArray(s.cleanedSessionIds)||!Array.isArray(s.skippedSessionIds)||!Array.isArray(s.failures))throw new TypeError("invalid orphan subagent clean result");return s}}),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/moveSessionToWorkspace",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"moveSessionToWorkspace",invocation:{kind:"direct"},parameters:[{name:"input",wire:"input",source:"json",codec:Ee("@michengai/dsh-archive-manager/types#SessionMoveInput",yt)}],result:Ee("@michengai/dsh-archive-manager/types#SessionMoveResult",Ke),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}]};function lt(n,s){if(typeof document>"u"||document.querySelector("style[data-plugin-css="+JSON.stringify(n)+"]")!==null)return;let l=document.createElement("style");l.dataset.plugin="@michengai/dsh-archive-manager",l.dataset.pluginCss=n,l.textContent=s,document.head.appendChild(l)}e(lt,"ensurePluginStyle");function an(n){if(typeof document>"u")return;document.querySelector("style[data-plugin-css="+JSON.stringify(n)+"]")?.remove()}e(an,"removePluginStyle"),lt("dsh-archive-manager/DangerButton.css",".dsham_btnDanger:not(:disabled){color:var(--dsw-alias-state-error-primary,#ef7272);border-color:var(--dsw-alias-state-error-primary,#ef7272)}"),lt("dsh-archive-manager/IconAction.css",".dsham_iconAction{display:inline-flex!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important;width:22px!important;min-width:22px!important;height:22px!important;padding:0!important;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px)!important;background:transparent;color:var(--dsw-alias-label-secondary)}.dsham_iconAction:not(:disabled):hover{color:var(--dsw-alias-link,#4176e6)!important;border-color:var(--dsw-alias-link,#4176e6)!important}.dsham_iconAction.dsham_iconDanger{color:var(--dsw-alias-state-error-primary,#ef7272)!important;border-color:var(--dsw-alias-state-error-primary,#ef7272)!important}.dsham_iconAction.dsham_iconDanger:not(:disabled):hover{color:var(--dsw-alias-state-error-primary,#ef7272)!important;border-color:var(--dsw-alias-state-error-primary,#ef7272)!important}.dsham_iconAction svg{width:16px!important;height:16px!important;flex:none!important}"),lt("dsh-archive-manager/Modal.css",".dsham_modalRoot{position:fixed;inset:0;z-index:1200;display:grid;place-items:center;padding:24px}.dsham_modalMask{position:absolute;inset:0;background:var(--dsw-alias-bg-mask-1,rgb(0 0 0 / 45%));backdrop-filter:var(--dsw-mask-blur,blur(16px));-webkit-backdrop-filter:var(--dsw-mask-blur,blur(16px))}.dsham_modalDialog{position:relative;display:flex;flex-direction:column;gap:12px;box-sizing:border-box;max-width:calc(100vw - 48px);max-height:min(85vh,760px);padding:22px 24px 20px;overflow:hidden;border:1px solid var(--dsw-alias-border-l1,rgba(128,128,128,.2));border-radius:var(--dsw-radius-panel,28px);background-color:var(--dsw-alias-surface-overlay,var(--dsw-alias-bg-base,Canvas));background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-surface-overlay,Canvas));backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));-webkit-backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));color:var(--dsw-alias-label-primary);box-shadow:var(--dsw-elevation-prominent,0 16px 40px rgb(0 0 0 / 24%))}.dsham_modalHeader{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none}.dsham_modalHeader h2,.dsham_modalDialog h2{margin:0;font-size:16px;line-height:24px;font-weight:600;color:var(--dsw-alias-label-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}.dsham_modalClose{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:28px;height:28px;padding:0;border:none;border-radius:var(--dsw-radius-sm,6px);background:transparent;color:var(--dsw-alias-label-secondary);cursor:pointer;flex:none;transition:background-color .15s ease,color .15s ease}.dsham_modalClose:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.dsham_modalClose svg{display:block;width:14px;height:14px}.dsham_modalDialog>p{margin:0;color:var(--dsw-alias-label-secondary);font-size:13px;line-height:20px}.dsham_modalBody{display:flex;flex-direction:column;gap:12px;flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain}.dsham_modalFooter{display:flex;flex:none;align-items:center;justify-content:flex-end;gap:8px}.dsham_modalWide{width:min(900px,calc(100vw - 48px))!important;max-height:min(88vh,820px)!important}.dsham_modalWide .dsham_modalBody{overflow:hidden}.dsham_modalWide .dsham_previewMessages{max-height:none;flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain}"),lt("dsh-archive-manager/SidebarPopover.css",".dsham_sidebarCardRoot{position:fixed;inset:0;z-index:1200;pointer-events:none}.dsham_sidebarCardBackdrop{position:fixed;inset:0;pointer-events:auto;background:transparent}.dsham_sidebarCard{position:fixed;pointer-events:auto;box-sizing:border-box;width:290px;max-height:calc(100vh - 32px);overflow-y:auto;padding:16px 18px 14px;border-radius:var(--dsw-radius-lg,14px);background:var(--dsw-menu-surface-fill);backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));-webkit-backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));border:none;box-shadow:var(--dsw-elevation-prominent);color:var(--dsw-alias-label-primary);display:flex;flex-direction:column;gap:8px}.dsham_sidebarCardTitle{margin:0;font-size:14px;font-weight:600;line-height:20px;color:var(--dsw-alias-label-primary)}.dsham_sidebarCardDesc{margin:0;font-size:13px;line-height:18px;color:var(--dsw-alias-label-secondary)}.dsham_sidebarCardError{margin-top:2px;font-size:12px;line-height:16px;color:var(--dsw-alias-state-error-primary,#ef7272);white-space:pre-line}.dsham_sidebarCardFooter{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:10px}.dsham_sidebarCardBtn{border:none;background:transparent;padding:5px 12px;border-radius:var(--dsw-radius-sm,6px);font:inherit;font-size:13px;font-weight:500;line-height:18px;cursor:pointer;transition:background-color .15s ease,opacity .15s ease}.dsham_sidebarCardBtnCancel{color:var(--dsw-alias-label-primary)}.dsham_sidebarCardBtnCancel:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.dsham_sidebarCardBtnDanger{color:var(--dsw-alias-state-error-primary,#ef7272)}.dsham_sidebarCardBtnDanger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-danger,#f25a5a26)}.dsham_sidebarCardBtn:disabled{opacity:.4;cursor:default}"),lt("dsh-archive-manager/MoveSubmenu.css",".dsham_moveSessionWrap{position:relative}.dsham_moveSubmenu{position:fixed;z-index:99999;min-width:160px;max-width:260px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.25) transparent;background:var(--dsw-menu-surface-fill,var(--dsw-alias-surface-overlay,#1e1e22));backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));-webkit-backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));border:1px solid var(--dsw-alias-border-l1,rgba(255,255,255,0.12));border-radius:var(--dsw-radius-md,8px);box-shadow:var(--dsw-elevation-prominent,0 6px 20px rgba(0,0,0,0.45));padding:4px;display:flex;flex-direction:column;gap:2px}.dsham_moveSubmenu::-webkit-scrollbar{width:6px}.dsham_moveSubmenu::-webkit-scrollbar-track{background:transparent}.dsham_moveSubmenu::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.2);border-radius:3px}.dsham_moveSubmenu::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,0.35)}.dsham_moveSubmenuBtn{display:flex;align-items:center;width:100%;padding:6px 10px;border:none;border-radius:var(--dsw-radius-sm,6px);background:transparent;color:var(--dsw-alias-label-primary,#ededed);font:inherit;font-size:13px;line-height:20px;text-align:left;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:background-color .12s ease}.dsham_moveSubmenuBtn:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,0.08))}.dsham_moveSubmenuBtn:focus-visible:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,0.08));outline:none}");let re="M8 1.75l1.934 3.918 4.324.628-3.129 3.05.738 4.306L8 11.618l-3.867 2.034.738-4.306-3.129-3.05 4.324-.628L8 1.75z";function Ye(n){return n?'<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="'+re+'"/></svg>':'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linejoin="round" aria-hidden="true"><path d="'+re+'"/></svg>'}e(Ye,"starSvg");function Zt(n){return!!n?.querySelector("[data-state]")}e(Zt,"resolveRowHasStatus");let gn="[data-row-key^='session:']{position:relative}.dsham_starSlot{display:none;position:absolute;left:calc(8px + var(--dsh-workspace-indent,0px));inset-inline-start:calc(8px + var(--dsh-workspace-indent,0px));top:50%;transform:translateY(-50%);align-items:center;justify-content:center;box-sizing:border-box;width:16px;height:20px;z-index:1;pointer-events:none}[data-row-key^='session:']:hover .dsham_starSlot,.dsham_starSlot[data-favorited='true']{display:inline-flex;pointer-events:auto}[data-row-key^='session:']:hover>span:first-child:not(:has([data-state])),[data-row-key^='session:'][data-dsham-favorited='true']:not([data-dsham-has-status='true'])>span:first-child:not(:has([data-state])){opacity:0}[data-row-key^='session:'][data-dsham-has-status='true']>span:first-child,[data-row-key^='session:']>span:first-child:has([data-state]){opacity:1}[data-row-key^='session:'][data-dsham-has-status='true'] .dsham_starSlot,[data-row-key^='session:']:has(>span:first-child [data-state]) .dsham_starSlot{width:10px;height:10px;top:auto;bottom:3px;left:calc(15px + var(--dsh-workspace-indent,0px));inset-inline-start:calc(15px + var(--dsh-workspace-indent,0px));transform:none}[data-row-key^='session:'][data-dsham-has-status='true'] .dsham_rowStar,[data-row-key^='session:']:has(>span:first-child [data-state]) .dsham_rowStar{width:10px;height:10px}[data-row-key^='session:'][data-dsham-has-status='true'] .dsham_rowStar svg,[data-row-key^='session:']:has(>span:first-child [data-state]) .dsham_rowStar svg{width:10px;height:10px;filter:drop-shadow(0 0 1px rgba(0,0,0,0.85))}.dsham_rowStar{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:16px;height:16px;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-primary);cursor:pointer;flex:none;border-radius:var(--dsw-radius-xs,4px)}.dsham_starSlot[data-favorited='true'] .dsham_rowStar{color:#e8b931}.dsham_rowStar svg{display:block;width:16px;height:16px;flex:none}";lt("dsh-archive-manager/RowFavorite.css",gn);let Dn="dsh-archive-manager:workspace-favorites-only",gt="data-dsham-favorites-hidden",on="data-dsham-favorites-only",oe="dsham_rowStar",je="dsham_starSlot",wt=["\u4EC5\u663E\u793A\u5DF2\u5F52\u6863","Archived only","\u0422\u043E\u043B\u044C\u043A\u043E \u0430\u0440\u0445\u0438\u0432\u043D\u044B\u0435"];lt("dsh-archive-manager/FavoritesFilter.css",`[data-dsham-favorites-hidden='true']{display:none!important}button[data-dsham-favorites-only='true'][data-active='true']::after{content:"\\2713";margin-left:auto;padding-left:12px;font-size:12px;line-height:1;color:var(--dsw-alias-state-business-primary,#3b82f6)}`);function Za(){try{return window.localStorage.getItem(Dn)==="1"}catch{return!1}}e(Za,"readWorkspaceFavoritesOnly");function Ja(n){try{window.localStorage.setItem(Dn,n?"1":"0")}catch{}}e(Ja,"writeWorkspaceFavoritesOnly");function xr(n,s){let l=e(m=>s.favorites.has(m)||s.sessions?.[m]?.blank===!0,"visibleSession"),h=new Map,v=null;for(let m of n){if(m.startsWith("workspace:")){v=m,h.set(m,!1);continue}m.startsWith("session:")&&v!==null&&l(m.slice(8))&&h.set(v,!0)}return n.map(m=>m.startsWith("session:")?l(m.slice(8)):m.startsWith("workspace:")?h.get(m)===!0||s.groupHasFavorite?.(m.slice(10))===!0:!m.startsWith("overflow:"))}e(xr,"favoritesOnlyVisibility");function kr(n,s){let l=new Map,h=new Set;for(let m of s){let C=!1;for(let E of m.sessionIds)h.add(E),n.has(E)&&(C=!0);l.set(m.workspaceId,C)}let v=!1;for(let m of n)if(!h.has(m)){v=!0;break}return m=>m===""||m==="ungrouped"?v:l.get(m)===!0}e(kr,"favoriteGroupPredicate");function Cr(n,s,l,h){let v={dispose:e(()=>{},"dispose"),setFavoriteStarEnabled:e(q=>{},"setFavoriteStarEnabled"),isFavoriteStarEnabled:e(()=>!0,"isFavoriteStarEnabled")};if(typeof document>"u"||typeof document.addEventListener!="function"||typeof MutationObserver>"u")return v;let m=Za(),C=typeof h=="function"?h():!0,E=!1,N=!1,F=e(()=>{C?lt("dsh-archive-manager/RowFavorite.css",gn):an("dsh-archive-manager/RowFavorite.css")},"updateStarStyle");F();let _=e(q=>{let De=q;typeof De?.detail?.enabled=="boolean"?C=De.detail.enabled:typeof h=="function"&&(C=h()),F(),rt()},"onStarToggle");typeof window<"u"&&typeof window.addEventListener=="function"&&window.addEventListener("dsham-favorite-star-toggle",_);let P=0,B=200,u=null,Ie=new Set,Oe=e(q=>{if(!C){for(let ne of q)Array.from(ne.children).find(Fe=>Fe.classList.contains(je))?.remove(),ne.removeAttribute("data-dsham-favorited"),ne.removeAttribute("data-dsham-has-status");return}let De=s.getSnapshot();for(let ne of q){let Z=ne.getAttribute("data-row-key")??"";if(!Z.startsWith("session:"))continue;let Fe=Z.slice(8),et=Array.from(ne.children).find($e=>$e.tagName==="SPAN"&&Array.from($e.classList).some(Dt=>Dt==="slot"||Dt.endsWith("_slot")))??null;if(et===null){ne.removeAttribute("data-dsham-has-status");continue}let L=Array.from(ne.children).find($e=>$e.classList.contains(je))??null;if(!De.ready){L?.remove(),ne.removeAttribute("data-dsham-favorited"),ne.removeAttribute("data-dsham-has-status");continue}L!==null&&(L.parentElement!==ne||L.nextElementSibling!==null)&&ne.appendChild(L),L===null&&(L=document.createElement("span"),L.className=je,ne.appendChild(L)),L.dataset.sessionId=Fe,Zt(et)?ne.setAttribute("data-dsham-has-status","true"):ne.removeAttribute("data-dsham-has-status");let xe=L.querySelector("."+oe);xe===null&&(xe=document.createElement("button"),xe.type="button",xe.className=oe,xe.addEventListener("click",$e=>{$e.preventDefault(),$e.stopPropagation(),s.toggle(L?.dataset.sessionId??"")}),L.appendChild(xe));let Ue=De.ids.has(Fe);if(Ue?ne.setAttribute("data-dsham-favorited","true"):ne.removeAttribute("data-dsham-favorited"),L.dataset.favorited===String(Ue))continue;let dt=l()(Ue?"organizer.unfavorite":"organizer.favorite");L.dataset.favorited=String(Ue),xe.setAttribute("aria-pressed",String(Ue)),xe.setAttribute("aria-label",dt),xe.title=dt,xe.innerHTML=Ye(Ue)}},"ensureRowStars"),be=e(q=>{let De=s.getSnapshot();if(!m||!De.ready){for(let L of q)L.hasAttribute(gt)&&L.removeAttribute(gt);P=0,u=null,Ie.clear();return}let ne=q.map(L=>L.getAttribute("data-row-key")??""),Z=kr(De.ids,n.workspaces.list?.getSnapshot?.()?.items??[]),Fe=xr(ne,{favorites:De.ids,sessions:n.sessions.list?.getSnapshot?.()?.byId,groupHasFavorite:Z});u!==null&&(q.length<=u.rows&&Ie.add(u.key),u=null);let et=!1;if(P<B)for(let L=0;L<q.length;L+=1){let _e=q[L],xe=ne[L];if(!xe.startsWith("overflow:")||_e.getAttribute("aria-expanded")!=="false")continue;let Ue=xe.slice(9);if(!(Ie.has(Ue)||!Z(Ue))){try{_e.click(),P+=1,u={key:Ue,rows:q.length},et=!0}catch(dt){console.warn("archive-manager: favorites-only expand failed",dt)}break}}for(let L=0;L<q.length;L+=1){let _e=q[L];Fe[L]?_e.hasAttribute(gt)&&_e.removeAttribute(gt):_e.setAttribute(gt,"true")}et&&rt()},"applyVisibility"),St=e(q=>{let De=q.parentElement;if(De===null)return null;let ne=De.cloneNode(!0),Z=ne.querySelector('button[role="menuitem"]');if(Z===null)return null;let Fe=Array.from(Z.querySelectorAll("span")),et=Fe[0]??null,L=Fe[Fe.length-1]??null;et!==null&&(et.innerHTML=Ye(!1)),L!==null&&(L.textContent=l()("organizer.favoritesOnly"));for(let _e of Array.from(Z.querySelectorAll("svg")))_e.closest("span")===null&&_e.remove();return Z.setAttribute(on,"true"),Z.setAttribute("role","menuitemcheckbox"),Z.dataset.active=String(m),Z.setAttribute("aria-checked",String(m)),Z.setAttribute("aria-label",l()("organizer.favoritesOnly")),Z.onclick=_e=>{_e.preventDefault(),_e.stopPropagation(),ln(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0}))},ne},"buildMenuRow"),ct=e(()=>{if(!E){for(let q of Array.from(document.querySelectorAll("button["+on+"]")))q.dataset.active=String(m),q.setAttribute("aria-checked",String(m));for(let q of Array.from(document.querySelectorAll('[role="menu"]'))){let De=Array.from(q.querySelectorAll('button[role="menuitem"]')).find(Fe=>wt.some(et=>(Fe.textContent??"").includes(et)));if(De===void 0||q.querySelector("["+on+"]")!==null)continue;let ne=De.parentElement;if(ne===null)continue;let Z=St(De);Z!==null&&ne.parentElement?.insertBefore(Z,ne.nextSibling)}}},"injectMenuRows"),rt=e(()=>{if(N||E)return;N=!0;let q=e(()=>{if(N=!1,E)return;let De=Array.from(document.querySelectorAll("[data-row-key]"));ct(),Oe(De),be(De),s.getSnapshot().ready||cn()},"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(q):setTimeout(q,16)},"schedulePass"),ln=e(()=>{m=!m,Ve=20,P=0,u=null,Ie.clear(),Ja(m),rt()},"toggle"),Qe=null,Ve=20,cn=e(()=>{Qe!==null||E||Ve<=0||(Ve-=1,Qe=setTimeout(()=>{Qe=null,s.ensure(),rt()},600))},"scheduleRetry"),Et=new MutationObserver(q=>{Bn(q,'[data-row-key], [role="menu"]')&&rt()});Et.observe(document.body,{childList:!0,subtree:!0}),s.ensure().catch(()=>{});let Rt=[s.subscribe(()=>rt()),typeof n.sessions.list?.subscribe=="function"?n.sessions.list.subscribe(()=>rt()):null,typeof n.workspaces.list?.subscribe=="function"?n.workspaces.list.subscribe(()=>rt()):null].filter(q=>typeof q=="function");return rt(),{dispose(){E=!0,typeof window<"u"&&typeof window.removeEventListener=="function"&&window.removeEventListener("dsham-favorite-star-toggle",_),Et.disconnect();for(let q of Rt)q();for(let q of Array.from(document.querySelectorAll("["+gt+"]")))q.removeAttribute(gt);for(let q of Array.from(document.querySelectorAll("["+on+"]")))q.parentElement?.remove();for(let q of Array.from(document.querySelectorAll("."+je)))q.remove();for(let q of Array.from(document.querySelectorAll("[data-dsham-favorited]")))q.removeAttribute("data-dsham-favorited");for(let q of Array.from(document.querySelectorAll("[data-dsham-has-status]")))q.removeAttribute("data-dsham-has-status");Qe!==null&&(clearTimeout(Qe),Qe=null)},setFavoriteStarEnabled(q){C=q,F(),rt()},isFavoriteStarEnabled:e(()=>C,"isFavoriteStarEnabled")}}e(Cr,"setupWorkspaceFavoritesOnly");function Er(){let n,s={ready:!1,ids:new Set,pending:new Set},l,h=0,v=new Set,m=e(E=>{s=E;for(let N of v)try{N()}catch(F){console.warn("archive-manager: favorite listener failed",F)}},"publish"),C=e((E,N)=>{let F=new Set(E);for(let u of s.pending)u!==N&&(s.ids.has(u)?F.add(u):F.delete(u));let _=new Set(s.pending);N!==void 0?_.delete(N):s.pending.size===0&&_.clear();let P=s.ids.size===F.size&&[...F].every(u=>s.ids.has(u)),B=s.pending.size===_.size&&[..._].every(u=>s.pending.has(u));P&&B&&s.ready||m({ready:!0,ids:F,pending:_})},"adopt");return{bind(E){n=E},subscribe(E){return v.add(E),()=>{v.delete(E)}},getSnapshot:e(()=>s,"getSnapshot"),adopt:e(E=>C(E),"adopt"),ensure(){return n===void 0||s.ready?Promise.resolve():l!==void 0?l:Date.now()<h?Promise.resolve():(l=n.favoriteSessions().then(E=>{C(E.favoriteSessionIds)}).catch(E=>{console.warn("archive-manager: load favorites failed, will retry",E),h=Date.now()+600}).finally(()=>{l=void 0}),l)},async toggle(E){if(n===void 0||!s.ready||s.pending.has(E))return;let N=s.ids.has(E),F=!N,_=new Set(s.ids);F?_.add(E):_.delete(E);let P=new Set(s.pending);P.add(E),m({ready:!0,ids:_,pending:P});try{let B=await n.setSessionFavorite({sessionId:E,favorite:F});if(!Array.isArray(B?.favoriteSessionIds))throw new TypeError("favorite response is missing favoriteSessionIds");C(B.favoriteSessionIds,E)}catch(B){console.warn("archive-manager: sidebar favorite toggle failed",B);let u=new Set(s.ids);N?u.add(E):u.delete(E);let Ie=new Set(s.pending);Ie.delete(E),m({ready:!0,ids:u,pending:Ie})}}}}e(Er,"createFavoriteRowStore");function Xa(){return(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,"aria-hidden":!0,focusable:"false",children:(0,a.jsx)("path",{fill:"currentColor",d:"M8 0a8 8 0 0 0-2.53 15.59c.4.074.547-.173.547-.385 0-.19-.007-.693-.01-1.36-2.226.484-2.695-1.073-2.695-1.073-.364-.924-.89-1.17-.89-1.17-.726-.496.055-.486.055-.486.803.056 1.225.824 1.225.824.714 1.223 1.872.87 2.328.665.072-.517.28-.87.508-1.07-1.777-.202-3.645-.888-3.645-3.956 0-.874.31-1.588.823-2.148-.083-.202-.357-1.017.078-2.12 0 0 .672-.215 2.2.82A7.65 7.65 0 0 1 8 4.8c.68.003 1.365.092 2.004.27 1.527-1.035 2.197-.82 2.197-.82.437 1.103.162 1.918.08 2.12.513.56.822 1.274.822 2.148 0 3.076-1.872 3.752-3.654 3.95.288.248.544.735.544 1.482 0 1.07-.01 1.932-.01 2.195 0 .214.144.463.55.384A8.001 8.001 0 0 0 8 0Z"})})}e(Xa,"GithubMark16");function Qa(){let n=c.IconEditOutlineRegular;return(0,a.jsx)(n,{size:16})}e(Qa,"FeedbackIcon");function Ln({archiveSessions:n,archiveSession:s,sessionStore:l,workspaceStore:h,unarchiveSession:v,deleteSession:m,unarchiveSessions:C,deleteArchivedSessions:E,archivedSessionMetadata:N,openConversation:F,focusSessionWorkspace:_,viewState:P,close:B,t:u,diagnoseOrphanSubagents:Ie,cleanOrphanSubagents:Oe,diagnoseSessionCaches:be,rebuildSessionCaches:St,refreshCacheLists:ct,searchSessionContent:rt,searchArchivedContent:ln,previewArchivedSession:Qe,favoriteSessions:Ve,setSessionFavorite:cn,favoriteSync:Et,organizeBatch:Rt,useSessionPendingInteraction:q,useSessionStatus:De}){let ne=(0,o.useSyncExternalStore)(l.subscribe,l.getSnapshot),Z=(0,o.useSyncExternalStore)(h.subscribe,h.getSnapshot),[Fe,et]=(0,o.useState)("archived"),L=Fe==="archived",[_e,xe]=(0,o.useState)(null),[Ue,dt]=(0,o.useState)(null),[$e,Dt]=(0,o.useState)(null),bn=e((d,x=null)=>{K(null),We(null),tt(!1),dt(x),xe(d)},"requestArchive"),Wt=e(()=>{ee||(xe(null),dt(null),K(null))},"closeArchive"),xt=(0,o.useRef)(!1),[Te,qt]=(0,o.useState)(null),yn=(0,o.useRef)(!1),[ee,Ze]=(0,o.useState)(!1),[It,K]=(0,o.useState)(null),[Vt,We]=(0,o.useState)(null),dn=e(d=>{K(null),We(null),qt(d)},"requestDelete"),[Mt,wn]=(0,o.useState)(P?.query??""),[kt,$t]=(0,o.useState)(P?.project??"all"),[Lt,Sn]=(0,o.useState)(P?.sortBy??"updated"),[xn,kn]=(0,o.useState)({}),[Gt,Cn]=(0,o.useState)(()=>new Set),jt=(0,o.useRef)(new Set),[ut,Tt]=(0,o.useState)([]),[Jt,zt]=(0,o.useState)([]),[Ct,Pt]=(0,o.useState)(!1),[En,Un]=(0,o.useState)(!1),Ot=(0,o.useRef)(!1),[In,p]=(0,o.useState)(!1),[b,I]=o.useState("content"),[G,Se]=o.useState(""),[ae,fe]=o.useState(""),[de,ue]=(0,o.useState)(()=>new Set),[Me,Pe]=(0,o.useState)("30"),[at,tt]=(0,o.useState)(!1),[$,J]=(0,o.useState)(null),[M,Y]=(0,o.useState)(null),[he,te]=(0,o.useState)([]),Ae=(0,o.useRef)(!1),ke=(0,o.useRef)(null),qe=ls(q??ss,De??is,typeof De=="function"),vt=(0,o.useRef)(qe.pending);vt.current=qe.pending;let Ce=(0,o.useMemo)(()=>new Set(Jt),[Jt]),se=e(async()=>{if(Ve)try{let d=await Ve();zt(d.favoriteSessionIds),Pt(!0),Et?.adopt(d.favoriteSessionIds)}catch(d){Pt(!1),K(Be(d))}},"loadFavorites");(0,o.useEffect)(()=>{let d=!0;return Ve&&Ve().then(x=>{d&&(zt(x.favoriteSessionIds),Pt(!0),Et?.adopt(x.favoriteSessionIds))}).catch(x=>{d&&K(Be(x))}),()=>{d=!1}},[Ve]),(0,o.useEffect)(()=>{if(Et)return Et.subscribe(()=>{let d=Et.getSnapshot();d.ready&&(zt([...d.ids]),Pt(!0))})},[Et]);let Re=e(async d=>{if(!(Ot.current||ee||!Ct)){Ot.current=!0,Un(!0),K(null);try{let x=await cn({sessionId:d,favorite:!Ce.has(d)});zt(x.favoriteSessionIds),Et?.adopt(x.favoriteSessionIds)}catch(x){K(Be(x))}finally{Ot.current=!1,Un(!1)}}},"toggleFavorite"),ze=e(async(d,x,{idle:X=!1,retry:ye=!1}={})=>{if(!(Ae.current||Ot.current||jt.current.size>0||!Rt)){Ae.current=!0,Ze(!0),K(null),We(null),Y(null),d==="archive"&&!ye&&te([]);try{let R=await Rt(d,x,{idleDays:X?Number(Me):void 0,getPending:e(()=>vt.current,"getPending"),onProgress:e(we=>{J(we),d==="archive"&&we.total>0&&we.done>=we.total&&(xe(null),dt(null),tt(!1))},"onProgress")});return Y({...R,kind:d,tab:Fe}),ke.current=R.remaining.length?{kind:d,ids:R.remaining,idle:X}:null,d==="archive"&&te(we=>[...new Set([...we,...R.succeeded])]),(d==="undo"||d==="restore"||d==="delete")&&te(we=>we.filter(pt=>!R.succeeded.includes(pt)&&!R.skipped.includes(pt))),Tt(we=>we.filter(pt=>!R.succeeded.includes(pt)&&!R.skipped.includes(pt))),d==="delete"&&zt(we=>we.filter(pt=>!R.succeeded.includes(pt))),R}catch(R){K(Be(R))}finally{Ae.current=!1,Ze(!1),J(null)}}},"executeBatch"),[st,it]=(0,o.useState)(null),[ve,Kt]=(0,o.useState)({diagnosis:{count:0,items:[]},busy:!1,progress:null,result:null,error:null,refreshError:null}),Je=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(!be||!St||!ct)return;let d=Ta({diagnose:be,rebuild:St,refresh:ct});Je.current=d;let x=d.subscribe(()=>{Kt(d.snapshot())});return d.load(),()=>{x(),d.dispose(),Je.current=null}},[be,St,ct]),(0,o.useEffect)(()=>{Je.current?.snapshot().busy||Je.current?.load()},[Z.archivedSessionIds]);let Xt=e(async(d=!1)=>{if(!(ee||Ae.current||!Je.current||Je.current.snapshot().busy)){Ae.current=!0,Ze(!0);try{await Je.current.run(d)}finally{Ae.current=!1,bt.current&&Ze(!1)}}},"runCacheRebuild"),[un,Ge]=(0,o.useState)(!1),ot=e(()=>{typeof Ie=="function"&&Ie().then(it).catch(d=>{console.warn("archive-manager: diagnose orphan subagents failed",d)})},"loadOrphans");(0,o.useEffect)(()=>{ot()},[Z.archivedSessionIds]);let hn=e(async()=>{if(!(un||typeof Oe!="function")){Ge(!0),K(null),We(null);try{let d=await Oe({});(d.cleanedSessionIds.length>0||d.skippedSessionIds.length>0)&&ot(),d.failures.length>0?(We(null),K(Pn(d.failures,u))):d.cleanedSessionIds.length>0&&(K(null),We(u("organizer.orphanCleanSuccess",{n:d.cleanedSessionIds.length})))}catch(d){K(Be(d))}finally{Ge(!1)}}},"cleanOrphans"),bt=(0,o.useRef)(!0),Qt=(0,o.useRef)(!1);(0,o.useEffect)(()=>(bt.current=!0,()=>{bt.current=!1}),[]);let ht=e(async(d,x=!1)=>{if(ee||Qt.current)return;Qt.current=!0,Ze(!0),K(null);let X=!1;try{await _a({prepare:x?async ye=>{await _?.(ye)}:void 0,restore:e(async ye=>{await v(ye),X=!0},"restore"),open:e(async ye=>{await F(ye),bt.current&&B?.()},"open")},d.id,x,()=>bt.current)}catch(ye){if(!bt.current)return;if(X){et("unarchived");let R=At.find(we=>we.sessions.some(pt=>pt.id===d.id));R!==void 0&&$t(R.key)}K(Aa(ye,u))}finally{Qt.current=!1,bt.current&&Ze(!1)}},"viewConversation");(0,o.useEffect)(()=>{P&&Object.assign(P,{query:Mt,project:kt,sortBy:Lt})},[Mt,kt,Lt,P]);let Bt=(0,o.useMemo)(()=>L?Z.archivedSessionIds:qr(ne.byId,Z.archivedSessionIds),[L,ne.byId,Z.archivedSessionIds]),At=(0,o.useMemo)(()=>Vr(ne.byId,Z.items,Bt,u("group.ungrouped")),[ne.byId,Z,Bt,u]),en=e(d=>{ee||jt.current.size>0||(Nt.close(),et(d),Tt([]),xe(null),dt(null),K(null),We(null),$t("all"),wn(""),d!=="archived"&&Lt==="archived"&&Sn("updated"))},"switchTab"),tn=e(async(d,x=!1)=>{if(!(xt.current||ee||!d?.length)){if(Rt){xt.current=!0;try{let X=await ze("archive",d,{idle:x}),ye=X?.failures.map(R=>Rr(R.sessionId,R.message)).find(R=>R!==void 0);if(ye!==void 0&&typeof s=="function"){let R=ne.byId[ye.sessionId];Dt({sessionId:ye.sessionId,title:R===void 0?ye.sessionId:nt(R,u),kinds:ye.kinds.join(", ")}),xe(null),dt(null),K(null);return}X&&(xe(null),dt(null),tt(!1))}finally{xt.current=!1}return}xt.current=!0,Ze(!0),K(null),We(null);try{let X=await n(d);xe(null),dt(null),X.archivedSessionIdsAdded.length>0&&We(u("archives.archiveSuccess",{n:X.archivedSessionIdsAdded.length})),X.failures&&X.failures.length>0?K(Pn(X.failures,u)):(Tt([]),et("archived"),$t("all"),wn(""))}catch(X){let ye=_r(X);if(ye!==void 0&&typeof s=="function"){let R=ne.byId[ye.sessionId];Dt({sessionId:ye.sessionId,title:R===void 0?ye.sessionId:nt(R,u),kinds:ye.kinds.join(", ")}),xe(null),dt(null),K(null)}else{let R=On(X);K(R===void 0?u("archives.archiveBatchFailed",{detail:X instanceof Error?X.message:String(X)}):u("archives.archiveActive",{kinds:R.join(", ")}))}}finally{xt.current=!1,Ze(!1)}}},"performArchive"),Is=e(()=>tn(_e,at),"confirmArchive"),Ts=e(async d=>{K(null),We(null);try{await Gn(d.id),bt.current&&We(u("details.copied"))}catch(x){bt.current&&K(typeof qn(x)=="string"&&String(qn(x)).startsWith("copy.")?u(String(qn(x))):Be(x))}},"copyId"),ar=(0,o.useMemo)(()=>$r(At,Lt,xn,u,L?Z.archivedSessionIds:void 0),[At,Lt,xn,u,L,Z.archivedSessionIds]);(0,o.useEffect)(()=>{if(ee)return;let d=!1;return N().then(x=>{d||kn(Object.fromEntries(x.items.map(X=>[X.sessionId,X.createdAt])))}).catch(()=>{d||kn({})}),()=>{d=!0}},[N,Z.archivedSessionIds,ee]),(0,o.useEffect)(()=>{kt!=="all"&&!At.some(d=>d.key===kt)&&$t("all")},[At,kt]);let Xr=!hr(G,ae),Qr=ar.filter(d=>kt==="all"||kt===d.key).map(d=>({...d,sessions:d.sessions.filter(x=>(!In||Ce.has(x.id))&&ba(x.updatedAt,G,ae))})).filter(d=>d.sessions.length),sr=b==="content"&&!Xr,Tn=j(Qr.flatMap(d=>d.sessions.map(x=>x.id)),Mt,sr,rt??ln),ir=new Map(Tn.items.map(d=>[d.sessionId,d])),Nt=U(Qe,L?Z.archivedSessionIds:[]),ea=Mt.trim().toLocaleLowerCase(),An=Qr.map(d=>({...d,sessions:d.sessions.filter(x=>!ea||nt(x,u).toLocaleLowerCase().includes(ea)||ir.has(x.id))})).filter(d=>d.sessions.length),ta=Ct?An.flatMap(d=>d.sessions).filter(d=>Sr(d,{days:Number(Me),favorites:Ce,currentId:Kn(ne),pending:qe.pending})).map(d=>d.id):[],_n=(0,o.useMemo)(()=>Hr(An),[An]),or=(0,o.useMemo)(()=>new Set(ut),[ut]),As=(0,o.useMemo)(()=>{let d=new Set(Z.archivedSessionIds);return he.reduce((x,X)=>x+(d.has(X)?1:0),0)},[he,Z.archivedSessionIds]),lr=_n.filter(d=>or.has(d)).length,_s=_n.length>0&&lr===_n.length;(0,o.useEffect)(()=>{Tt(d=>Ur(d,Bt))},[Bt]);let Rs=e((d,x)=>{Tt(X=>tr(X,[d],x))},"toggleSessionSelection"),js=e(d=>{Tt(x=>tr(x,_n,d))},"toggleVisibleSelection"),Ns=e(d=>{ee||jt.current.has(d)||(jt.current.add(d),Cn(new Set(jt.current)),K(null),We(null),v(d).catch(x=>{K(Tr(x,u))}).finally(()=>{jt.current.delete(d),Cn(new Set(jt.current))}))},"onUnarchive"),na=e(async d=>{if(!ee){if(Rt){let x=vn(Z.archivedSessionIds,Z.items,d),X=await ze("restore",x);return X&&{unarchivedSessionIds:X.succeeded}}Ze(!0),K(null),We(null);try{let x=await C(d);return x.unarchivedSessionIds.length>0&&We(u("archives.restoreSuccess",{n:x.unarchivedSessionIds.length})),x.failures&&x.failures.length>0&&K(Pn(x.failures,u,Tr)),x}catch(x){K(u("archives.restoreBatchFailed",{detail:x instanceof Error?x.message:String(x)}))}finally{Ze(!1)}}},"onBatchUnarchive"),Ds=e(async()=>{if(ut.length===0)return;let d=await na({scope:"sessions",sessionIds:ut});if(d!==void 0){let x=new Set(d.unarchivedSessionIds);Tt(X=>X.filter(ye=>!x.has(ye)))}},"onSelectedUnarchive"),ra=e(()=>{ee||qt(null)},"closeDelete");(0,o.useEffect)(()=>{if(Te===null)return;let d=e(x=>{x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),"stopImmediatePropagation"in x&&typeof x.stopImmediatePropagation=="function"&&x.stopImmediatePropagation(),ee||qt(null))},"onKeyDown");return window.addEventListener("keydown",d,!0),()=>window.removeEventListener("keydown",d,!0)},[Te,ee]);let Ms=e(async()=>{if(ee||yn.current||Te===null)return;if(Te.kind!=="batch"){yn.current=!0,Ze(!0),K(null),We(null);try{await m(Te.session.id),qt(null)}catch(x){K(Zn(x,u))}finally{yn.current=!1,Ze(!1)}return}if(Ae.current||Ot.current||jt.current.size>0)return;let{target:d}=Te;if(d.scope==="sessions"&&vn(Z.archivedSessionIds,Z.items,d).length===0){qt(null);return}Ae.current=!0,Ze(!0),K(null),We(null),Y(null),J(null);try{let x=await E(d),X=Wr(x,u);X.kind==="error"?K(X.message):We(X.message);let ye=new Set([...x.deletedSessionIds,...x.skippedSessionIds]);te(we=>we.filter(pt=>!ye.has(pt))),Tt(we=>we.filter(pt=>!ye.has(pt))),zt(we=>we.filter(pt=>!ye.has(pt)));let R=x.failures.map(we=>we.sessionId);ke.current=R.length>0?{kind:"delete",ids:R,idle:!1}:null,Y({requested:x.requestedSessionIds,succeeded:x.deletedSessionIds,skipped:x.skippedSessionIds,failures:x.failures,remaining:R,refreshError:"refreshError"in x&&typeof x.refreshError=="string"?x.refreshError:null,kind:"delete",tab:Fe}),qt(null)}catch(x){K(Zn(x,u))}finally{Ae.current=!1,Ze(!1)}},"confirmDelete"),Ht=Te?.kind==="batch"?Te.target.scope:null,Ls=Ht==="ungrouped"?u("archives.deleteUngroupedTitle"):Ht==="workspace"?u("archives.deleteProjectTitle",{name:Te?.kind==="batch"?Te.title:""}):u(Ht==="sessions"?"archives.deleteSelectedTitle":"deleteSession.title"),aa=Te===null?void 0:Ht==="ungrouped"?u("archives.deleteUngroupedDesc",{n:Te.kind==="batch"?Te.count:0}):Ht==="workspace"?u("archives.deleteProjectDesc",{name:Te?.kind==="batch"?Te.title:"",n:Te.kind==="batch"?Te.count:0}):Ht==="sessions"?u("archives.deleteSelectedDesc",{n:Te.kind==="batch"?Te.count:0}):u("deleteSession.desc",{name:nt(Te.kind==="session"?Te.session:{},u)}),zs=u(Ht==="ungrouped"?"archives.deleteUngroupedConfirm":Ht==="workspace"?"archives.deleteProjectConfirm":Ht==="sessions"?"archives.deleteSelectedConfirm":"deleteSession.title");return(0,a.jsxs)("section",{className:"dsham_settings","aria-label":u("archives.title"),children:[(0,a.jsx)("style",{children:ds+ps+ms+fs+gs}),(0,a.jsxs)("div",{className:"dsham_settingsHeader",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"dsham_settingsTitleRow",children:[(0,a.jsx)("h2",{children:u("archives.title")}),(0,a.jsxs)("div",{className:"dsham_settingsLinks",children:[(0,a.jsx)(c.Button,{variant:"outline",size:"sm","aria-label":u("archives.viewProject"),icon:(0,a.jsx)(Xa,{}),onClick:e(()=>window.open("https://github.com/MichengAI/dsh-archive-manager","_blank","noreferrer"),"onClick"),children:u("archives.viewProject")}),(0,a.jsx)(c.Button,{variant:"outline",size:"sm","aria-label":u("archives.feedback"),icon:(0,a.jsx)(Qa,{}),onClick:e(()=>window.open("https://github.com/MichengAI/dsh-archive-manager/issues","_blank","noreferrer"),"onClick"),children:u("archives.feedback")})]})]}),(0,a.jsx)("p",{className:"dsham_settingsIntro",children:u("archives.description")})]}),o.createElement("div",g(ee||Gt.size>0,(0,a.jsx)(c.SegmentedTabs,{className:"dsham_archiveTabs",label:u("archives.title"),value:Fe==="unarchived"?"unarchived":"archived",onChange:e(d=>en(d==="unarchived"?"unarchived":"archived"),"onChange"),items:[{value:"archived",label:(0,a.jsxs)("span",{className:"dsham_tabLabel",children:[(0,a.jsx)(c.IconArchiveOutlineMedium,{size:14}),(0,a.jsx)("span",{children:u("archives.tab.archived")})]}),id:"dsham-tab-archived",panelId:"dsham-archive-panel"},{value:"unarchived",label:(0,a.jsxs)("span",{className:"dsham_tabLabel",children:[(0,a.jsx)(c.IconFolderCloseMedium,{size:14}),(0,a.jsx)("span",{children:u("archives.tab.unarchived")})]}),id:"dsham-tab-unarchived",panelId:"dsham-archive-panel"}]})))]}),(0,a.jsxs)("div",{id:"dsham-archive-panel",role:"region","aria-label":u(Fe==="unarchived"?"archives.tab.unarchived":"archives.tab.archived"),children:[(0,a.jsx)("div",{className:"dsham_settingsToolbar",children:(0,a.jsxs)("div",{className:"dsham_settingsSearch",children:[(0,a.jsx)(er,{id:"dsham-favorite-filter",className:"dsham_srOnly",tabIndex:-1,"aria-hidden":!0,value:In?"favorites":"all",options:[{value:"all",label:u("organizer.allSessions")},{value:"favorites",label:u("organizer.favoritesOnly")}],onChange:e(d=>typeof p=="function"&&p(d==="favorites"),"onChange"),"aria-label":u("organizer.favoriteFilter")}),(0,a.jsx)(er,{id:"dsham-search-scope",className:"dsham_srOnly",tabIndex:-1,"aria-hidden":!0,value:b,options:[{value:"title",label:u("discovery.titleOnly")},{value:"content",label:u("discovery.titleAndContent")}],onChange:e(d=>typeof I=="function"&&I(d),"onChange"),"aria-label":u("discovery.scope")}),(0,a.jsx)(c.Input,{id:"dsham-search-input",className:"dsham_searchField",type:"search",icon:(0,a.jsx)(c.IconSearchOutlineMedium,{size:16,"aria-hidden":!0}),autoComplete:"off",spellCheck:!1,maxLength:200,value:Mt,onChange:e(d=>wn(d.target.value),"onChange"),placeholder:u(sr?"discovery.searchPlaceholder":L?"archives.searchPlaceholder":"archives.searchUnarchived"),"aria-label":u(sr?"discovery.searchPlaceholder":L?"archives.searchPlaceholder":"archives.searchUnarchived")}),(0,a.jsx)(vs,{id:"dsham-sort-filter",t:u,disabled:ee,favoritesOnly:In,setFavoritesOnly:p,favoriteBusy:ee||En||!Ct,sortBy:!L&&Lt==="archived"?"updated":Lt,setSortBy:Sn,options:[...L?[{value:"archived",label:u("archives.sortArchived")}]:[],{value:"updated",label:u("archives.sortUpdated")},{value:"created",label:u("archives.sortCreated")},{value:"alphabetical",label:u("archives.sortAlphabetical")}]}),(0,a.jsx)(er,{id:"dsham-project-filter",className:"dsham_projectFilter",value:kt,title:kt==="all"?u("archives.allProjects"):ar.find(d=>d.key===kt)?.title??kt,options:[{value:"all",label:u("archives.allProjects")||"\u6240\u6709\u9879\u76EE",title:u("archives.allProjects")},...ar.map(d=>({value:d.key,label:d.title,title:d.title}))],onChange:$t,"aria-label":u("archives.projectFilter")}),o.createElement(z,{t:u,from:G,to:ae,onFrom:Se,onTo:fe,invalid:Xr,onClear:e(()=>{Se(""),fe("")},"onClear")})]})}),o.createElement("style",null,Sa),o.createElement(H,{state:Tn,t:u}),Rt&&(0,a.jsx)(S,{t:u,archived:L,busy:ee||En||Gt.size>0,ready:Ct,days:Me,onDays:Pe,count:ta.length,onPreview:e(()=>{bn(ta),tt(!0)},"onPreview"),progress:$,result:M?.tab===Fe?M:null,onRetry:e(()=>{let d=ke.current;d&&(d.kind==="delete"?dn({kind:"batch",target:{scope:"sessions",sessionIds:d.ids},count:d.ids.length}):ze(d.kind,d.ids,{idle:d.idle,retry:!0}))},"onRetry"),undoCount:As,onUndo:e(()=>ze("undo",he,{retry:!0}),"onUndo"),onReload:se,orphanCount:st?.count??0,cacheCount:ve.diagnosis.count,cacheRepair:ve,onRebuildCaches:e(()=>Xt(),"onRebuildCaches"),onRetryCaches:e(()=>Xt(!0),"onRetryCaches"),onReloadCaches:e(async()=>{try{await ct?.(),await Je.current?.load(),(Je.current?.snapshot().diagnosis.count??0)===0&&Je.current?.dismiss()}catch(d){bt.current&&K(Be(d))}},"onReloadCaches"),onDismissCaches:e(()=>Je.current?.dismiss(),"onDismissCaches"),orphanSizeBytes:st?.totalSizeBytes??0,orphanCleaning:un,onCleanOrphans:hn}),At.length>0&&(0,a.jsx)(Or,{selectedCount:ut.length,hiddenCount:ut.length-lr,allVisibleSelected:_s,selectedVisibleCount:lr,visibleCount:_n.length,busy:ee,t:u,onToggle:js,onClear:e(()=>Tt([]),"onClear"),onArchive:L?void 0:()=>bn([...ut]),onRestore:Ds,onDelete:e(()=>dn({kind:"batch",target:{scope:"sessions",sessionIds:ut},count:ut.length}),"onDelete")}),At.length===0?(0,a.jsx)("div",{className:"dsham_settingsEmpty",children:u(L?"archives.empty":"archives.emptyUnarchived")}):An.length===0?(0,a.jsx)("div",{className:"dsham_settingsEmpty",children:Tn.status==="loading"||Tn.status==="error"||Tn.failures.length?null:u("archives.emptyFiltered")}):An.map(d=>{let x=ws(d.key),X=At.find(R=>R.key===d.key)?.sessions.map(R=>R.id)??[],ye=L?vn(Z.archivedSessionIds,Z.items,x).length:X.length;return(0,a.jsxs)("section",{className:"dsham_settingsGroup",children:[(0,a.jsxs)("div",{className:"dsham_settingsGroupHeading",children:[(0,a.jsx)("h3",{className:"dsham_settingsGroupTitle",children:(0,a.jsxs)("button",{type:"button",className:"dsham_groupToggle","aria-expanded":!de.has(d.key),"aria-controls":"dsham-group-"+encodeURIComponent(d.key),onClick:e(()=>ue(R=>{let we=new Set(R);return we.has(d.key)?we.delete(d.key):we.add(d.key),we}),"onClick"),children:[(0,a.jsx)(de.has(d.key)?c.IconChevronRightOutlineMedium:c.IconChevronDownOutlineMedium,{}),(0,a.jsx)(de.has(d.key)?c.IconFolderCloseMedium:c.IconFolderOpenOutlineMedium,{}),(0,a.jsx)("span",{children:d.title})]})}),(0,a.jsxs)("div",{className:"dsham_settingsGroupMeta",children:[(0,a.jsx)("span",{className:"dsham_settingsCount",children:u("archives.sessionCount",{n:d.sessions.length})}),(0,a.jsx)(ys,{group:d,busy:ee,onArchive:L?void 0:()=>bn(X,d),onRestore:e(()=>na(x),"onRestore"),onDelete:e(()=>dn({kind:"batch",target:x,title:d.title,count:ye}),"onDelete"),t:u})]})]}),(0,a.jsx)("div",{className:"dsham_settingsList",id:"dsham-group-"+encodeURIComponent(d.key),hidden:de.has(d.key)||void 0,children:!de.has(d.key)&&d.sessions.map(R=>(0,a.jsxs)("div",{className:"dsham_settingsRow","data-selected":or.has(R.id),children:[(0,a.jsx)(Fr,{checked:or.has(R.id),disabled:ee,label:u("archives.selectSession",{name:nt(R,u)}),onChange:e(we=>Rs(R.id,we.target.checked),"onChange")}),(0,a.jsxs)("div",{className:"dsham_settingsContent",children:[(0,a.jsx)("button",{type:"button",className:"dsham_settingsTitleLink",title:nt(R,u),"aria-label":u("archives.openSession")+u("common.separator")+nt(R,u),disabled:ee||Gt.has(R.id),onClick:e(()=>ht(R),"onClick"),children:nt(R,u)}),(0,a.jsx)("div",{className:"dsham_settingsMeta",children:[cs(R.updatedAt,u)]}),ir.has(R.id)&&o.createElement("button",{type:"button",className:"dsham_settingsSnippet",disabled:ee,title:u(L?"discovery.preview":"archives.openSession"),onClick:e(()=>L?Nt.open(R,Mt):ht(R),"onClick")},o.createElement(D,{text:ir.get(R.id)?.snippet??"",query:Mt}))]}),(0,a.jsxs)("div",{className:"dsham_settingsActions",children:[typeof cn=="function"&&A({variant:"outline",className:"dsham_iconAction"+(Ce.has(R.id)?" dsham_favoriteOn":""),title:u(Ce.has(R.id)?"organizer.unfavorite":"organizer.favorite"),"aria-pressed":Ce.has(R.id),"aria-label":u(Ce.has(R.id)?"organizer.unfavorite":"organizer.favorite")+u("common.separator")+nt(R,u),disabled:ee||En||!Ct,onClick:e(()=>Re(R.id),"onClick"),children:(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:Ce.has(R.id)?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round","aria-hidden":!0,style:{display:"block"},children:(0,a.jsx)("path",{d:re})})}),A({variant:"outline",className:"dsham_iconAction",title:u(L?"archives.restore":"archives.archiveSelected"),"aria-label":u(L?"archives.restore":"archives.archiveSelected"),disabled:ee||Gt.has(R.id),onClick:e(()=>L?Ns(R.id):tn([R.id]),"onClick"),icon:(0,a.jsx)(L?c.IconRefreshOutlineMedium:c.IconArchiveOutlineMedium,{size:16})}),L&&(0,a.jsx)(bs,{busy:ee||Gt.has(R.id),t:u,title:nt(R,u),onCopyId:e(()=>Ts(R),"onCopyId"),onPreview:typeof Qe=="function"?()=>Nt.open(R,Mt):void 0,onRestoreOpen:e(()=>ht(R,!0),"onRestoreOpen"),onDelete:e(()=>dn({kind:"session",session:R}),"onDelete")})]})]},R.id))})]},d.key)}),o.createElement(k,{width:900,className:"dsham_modalWide",portalToBody:!0,t:u,open:Nt.target!==null,onClose:Nt.close,title:Nt.target?nt(Nt.target.session,u):u("discovery.preview"),footer:w({variant:"primary",disabled:ee,onClick:e(()=>{if(Nt.target){let d=Nt.target.session;return Nt.close(),ht(d)}},"onClick"),children:u("discovery.openFull")}),children:o.createElement(ge,{preview:Nt,t:u,MarkdownText:c.MarkdownText})}),_e===null&&It!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:It}),Vt!==null&&(0,a.jsx)("div",{className:"dsham_settingsStatus",role:"status",children:Vt}),(0,a.jsx)(k,{t:u,open:_e!==null,onClose:Wt,title:u("archives.archiveTitle",{n:_e?.length??0}),description:Ue===null?u("archives.archiveSelectedDesc"):u(Ue.key===Hn?"archives.archiveUngroupedDesc":"archives.archiveProjectDesc",{name:Ue.title,n:_e?.length??0}),footer:(0,a.jsxs)(a.Fragment,{children:[w({disabled:ee,onClick:Wt,children:u("cancel")}),w({variant:"primary",disabled:ee||!_e?.length,onClick:Is,children:u("archives.archiveSelected")})]}),children:(0,a.jsxs)(a.Fragment,{children:[Rt&&(0,a.jsx)("p",{children:u(at?"organizer.idleConfirm":"organizer.manualConfirm")}),Rt&&(0,a.jsx)("div",{className:"dsham_archivePreview",children:(_e??[]).map(d=>(0,a.jsxs)("label",{children:[(0,a.jsx)(cr,{checked:!0,disabled:ee,label:nt(ne.byId[d]??{id:d},u),onChange:e(()=>xe(x=>(x??[]).filter(X=>X!==d)),"onChange")}),nt(ne.byId[d]??{id:d},u)]},d))}),$&&(0,a.jsxs)("div",{role:"status",children:[(0,a.jsx)("progress",{value:$.done,max:Math.max(1,$.total)}),u("organizer.progressCount",{done:$.done,total:$.total})]}),It!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:It})]})}),(0,a.jsx)(k,{t:u,open:$e!==null,onClose:e(()=>{ee||(Dt(null),K(null))},"onClose"),title:u("archiveActive.title"),...$e===null?{}:{description:u("archiveActive.desc",{name:$e.title,kinds:$e.kinds})},footer:(0,a.jsxs)(a.Fragment,{children:[w({disabled:ee,onClick:e(()=>{ee||(Dt(null),K(null))},"onClick"),children:u("cancel")}),w({danger:!0,disabled:ee,onClick:e(async()=>{if(!(xt.current||ee||$e===null||typeof s!="function")){xt.current=!0,Ze(!0),K(null);try{await s($e.sessionId,{stopActivity:!0}),Tt(d=>d.filter(x=>$e===null||x!==$e.sessionId)),et("archived"),We(u("archives.archiveSuccess",{n:1})),Dt(null)}catch(d){K(d instanceof Error?d.message:String(d))}finally{xt.current=!1,Ze(!1)}}},"onClick"),children:u("archiveActive.confirm")})]}),children:It!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:It})}),(0,a.jsx)(k,{t:u,open:Te!==null,onClose:ra,title:Ls,...aa===void 0?{}:{description:aa},footer:(0,a.jsxs)(a.Fragment,{children:[w({disabled:ee,onClick:ra,children:u("cancel")}),w({danger:!0,disabled:ee,onClick:Ms,children:zs})]}),children:(0,a.jsxs)(a.Fragment,{children:[ee&&(0,a.jsxs)("div",{role:"status",children:[Te?.kind==="batch"?u("archives.deleteBatchPending"):u("deleteSession.pending"),$&&(0,a.jsx)("progress",{value:$.done,max:Math.max(1,$.total),"aria-label":u("organizer.progress")}),$&&u("organizer.progressCount",{done:$.done,total:$.total})]}),It!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:It})]})})]})]})}e(Ln,"ArchivedSessionsSection");function Ir(n){var s,l,h="";if(typeof n=="string"||typeof n=="number")h+=n;else if(typeof n=="object")if(Array.isArray(n)){var v=n.length;for(s=0;s<v;s++)n[s]&&(l=Ir(n[s]))&&(h&&(h+=" "),h+=l)}else for(l in n)n[l]&&(h&&(h+=" "),h+=l);return h}e(Ir,"r");function es(...n){for(var s,l,h=0,v="",m=arguments.length;h<m;h++)(s=arguments[h])&&(l=Ir(s))&&(v&&(v+=" "),v+=l);return v}e(es,"clsx");function zn(n){let s=n instanceof Error?n.message:String(n);return s.includes("UNKNOWN_SESSION")||s.includes("no such session")}e(zn,"isUnknownSessionError");function Zn(n,s){if(zn(n))return s("deleteSession.unknown");let l=n instanceof Error?n.message:String(n);return s("deleteSession.failed",{detail:l})}e(Zn,"formatDeleteError");function Tr(n,s){if(zn(n))return s("archives.unarchiveUnknown");let l=n instanceof Error?n.message:String(n);return s("archives.unarchiveFailed",{detail:l})}e(Tr,"formatUnarchiveError");function Pn(n,s,l=Ar){return n.map(h=>h.sessionId+s("common.separator")+l(new Error(h.message),s)).join(`
|
|
23
|
-
|
|
24
|
-
`);function hs(n,s){let l=String(s??"").trim();return l.length>0&&String(n??"").trim()===l}e(hs,"isOwnSettingsNavRow");function Bn(n,s){for(let l of n){if(l.type==="characterData"){let v=l.target.parentElement;if(v!==null&&v.closest(s)!==null)return!0;continue}let h=l.target;if(h&&h.nodeType===1&&(typeof h.matches=="function"&&h.matches(s)||typeof h.closest=="function"&&h.closest(s)!==null))return!0;if(l.addedNodes)for(let v of l.addedNodes){if(v.nodeType!==1)continue;let m=v;if(typeof m.matches=="function"&&m.matches(s)||typeof m.querySelector=="function"&&m.querySelector(s)!==null||typeof m.closest=="function"&&m.closest(s)!==null)return!0}if(l.removedNodes)for(let v of l.removedNodes){if(v.nodeType!==1)continue;let m=v;if(typeof m.matches=="function"&&m.matches(s)||typeof m.querySelector=="function"&&m.querySelector(s)!==null||typeof m.closest=="function"&&m.closest(s)!==null)return!0}}return!1}e(Bn,"mutationTouches");function Lr(n,s){return hs(n.textContent,s)?Array.from(n.children).some(v=>v.tagName==="SPAN"&&(v.className.includes("navIcon")||v.getAttribute("aria-hidden")==="true"))||!!n.querySelector?.('[class*="navIcon"]')?n.hasAttribute(_t)?(n.removeAttribute(_t),!0):!1:n.getAttribute(_t)===""?!1:(n.setAttribute(_t,""),!0):n.hasAttribute(_t)?(n.removeAttribute(_t),!0):!1}e(Lr,"applySettingsNavIcon");function zr(n){return n.hasAttribute(_t)?(n.removeAttribute(_t),!0):!1}e(zr,"restoreSettingsNavIcon");function Pr(n){typeof document>"u"||typeof MutationObserver>"u"||n.effect(()=>{let s="dsham-nav-icon-style",l=document.getElementById(s);l===null?(l=document.createElement("style"),l.id=s,l.textContent=Qn,(document.head??document.documentElement).append(l)):l.textContent!==Qn&&(l.textContent=Qn);let h=!1,v=!1,m=e(()=>{if(v=!1,h)return;let N=n.locale.bind(Ne)("archived.badge");for(let F of document.querySelectorAll(us))Lr(F,N)},"sync"),C=e(()=>{v||h||(v=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(m):setTimeout(m,16))},"schedule");m();let E=new MutationObserver(N=>{Bn(N,'[role="dialog"] nav')&&C()});return E.observe(document.body,{childList:!0,subtree:!0,characterData:!0}),()=>{h=!0,E.disconnect();for(let N of document.querySelectorAll(`[${_t}]`))zr(N);l?.remove()}},"archive-manager: settings nav icon")}e(Pr,"installSettingsNavIcon");let ps=[".dsham_settings{container-type:inline-size;min-width:0;box-sizing:border-box;width:100%;padding:0 0 32px;color:var(--dsw-alias-label-primary)}",".dsham_settingsHeader{display:flex;flex-direction:column;align-items:stretch;gap:16px;margin-bottom:16px}",".dsham_settings h2{margin:0;font-size:24px;line-height:32px;font-weight:600;letter-spacing:-.4px;white-space:nowrap}",".dsham_settingsIntro{margin:12px 0 0;max-width:42em;color:var(--dsw-alias-label-tertiary);font-size:14px;line-height:22px}",".dsham_settingsToolbar{display:flex;align-items:center;gap:8px;margin-bottom:16px;width:100%;min-width:0}",".dsham_settingsSearch{display:flex;align-items:center;gap:8px;min-width:0;width:100%;flex-wrap:nowrap}","@container(max-width:520px){.dsham_settingsSearch{flex-wrap:wrap}}",".dsham_settingsSearch .dsham_searchField{flex:1 1 0;min-width:120px;width:auto;box-sizing:border-box}",".dsham_viewSortContainer{flex:0 0 auto;position:relative;box-sizing:border-box}",".dsham_viewSortBtn{height:32px!important;padding:0 8px!important;font-size:13px!important;box-sizing:border-box}",".dsham_viewSortBtn.has-filter{border-color:var(--dsw-alias-state-business-primary)!important;color:var(--dsw-alias-state-business-primary)!important}",".dsham_settingsFilter{display:inline-flex;position:relative}",".dsham_settingsSearch .dsham_projectFilter{flex:0 0 auto;max-width:120px;min-width:0;box-sizing:border-box}",".dsham_settingsSearch .dsham_projectFilter > span{display:inline-block;max-width:100%;box-sizing:border-box}",".dsham_settingsSearch .dsham_projectFilter .dsham_menuSelectBtn{display:inline-flex!important;width:100%;max-width:120px;padding:0 8px;box-sizing:border-box;overflow:hidden}",".dsham_settingsSearch .dsham_projectFilter .dsham_selectLabel{flex:1 1 auto;min-width:0;max-width:80px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}",".dsham_settingsSearch .dsham_dateFilter{flex:0 0 125px;width:125px;min-width:125px;position:relative;box-sizing:border-box}",".dsham_dateRange{width:100%;box-sizing:border-box}",".dsham_dateTrigger{height:32px!important;padding:0 8px!important;gap:5px!important;border:0.5px solid var(--dsw-alias-border-l2)!important;border-radius:var(--dsw-radius-sm,8px)!important;background:var(--dsw-alias-bg-layer-1)!important;box-sizing:border-box}",".dsham_dateTrigger .dsham_dateText{font-size:12px!important;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".dsham_srOnly{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;opacity:0;pointer-events:none}",".dsham_menuSelectBtn{display:inline-flex!important;align-items:center;justify-content:space-between;gap:6px;width:auto!important;max-width:100%;min-width:0!important;height:32px!important;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);box-sizing:border-box;font:inherit;font-size:13px;cursor:pointer}",".dsham_selectLabel{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:normal;text-align:left}",".dsham_settingsGroup{margin:0 0 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-button-elevated-fill));overflow:hidden;transition:border-color 150ms ease}",".dsham_settingsGroupHeading{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:38px;padding:0 10px;margin:0;user-select:none}",".dsham_settingsGroupTitle{display:flex;align-items:center;gap:8px;min-width:0;margin:0;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600}",".dsham_settingsGroupTitle svg{flex:none;color:var(--dsw-alias-label-secondary)}",".dsham_settingsCount{flex:none;color:var(--dsw-alias-label-tertiary);font-size:12px}",".dsham_settingsList{display:grid;overflow:hidden;border:0;border-top:1px solid var(--dsw-alias-border-l2);border-radius:0;background:transparent}",".dsham_settingsList[hidden]{display:none!important;border:0!important}",".dsham_settingsRow{display:grid;grid-template-columns:16px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:40px;padding:4px 10px;border-bottom:1px solid var(--dsw-alias-border-l2)}",".dsham_settingsRow:last-child{border-bottom:0}",".dsham_settingsContent{min-width:0;flex:1}",".dsham_settingsMeta{margin-top:1px;color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:13px}",".dsham_settingsActions{display:flex;align-items:center;gap:4px;flex:none}",".dsham_settingsEmpty{padding:28px 8px;color:var(--dsw-alias-label-secondary);text-align:center}",".dsham_settingsError{margin-top:10px;color:var(--dsw-alias-state-error-primary);font-size:12px;white-space:pre-line}","@container(max-width:520px){.dsham_settingsHeader{margin-bottom:16px}.dsham_settingsGroup{margin-bottom:10px}.dsham_settingsRow{padding:4px 8px}.dsham_settingsActions{gap:2px}}"].join(""),ms=".dsham_settingsTitleLink{display:block;max-width:100%;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;font-weight:600;line-height:16px;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.dsham_settingsTitleLink:hover:not(:disabled){text-decoration:underline;text-underline-offset:3px}.dsham_settingsTitleLink:disabled{cursor:default;opacity:.6}.dsham_groupToggle{display:flex;align-items:center;gap:8px;min-width:0;max-width:100%;padding:4px 0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.dsham_groupToggle span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dsham_settingsRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.dsham_settingsRow[data-selected=true]{background:var(--dsw-alias-interactive-bg-hover)}.dsham_settingsTitleLink:focus-visible,.dsham_groupToggle:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#3b82f6);outline-offset:2px}@container(max-width:400px){.dsham_settingsRow{gap:6px;padding:4px 6px}.dsham_settingsActions{gap:0}.dsham_settingsMeta{font-size:10px}}.dsham_settingsGroupMeta{display:flex;align-items:center;gap:8px;flex:none;flex-wrap:wrap}.dsham_settingsStatus{margin-top:10px;color:var(--dsw-alias-label-secondary);font-size:12px}.dsham_checkbox{flex:none;box-sizing:border-box;width:16px;height:16px;margin:0;accent-color:var(--dsw-alias-brand-primary);cursor:pointer}.dsham_checkbox:focus-visible{outline:var(--dsw-focus-ring-width,1px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.dsham_checkbox:disabled{opacity:.5;cursor:default}button.dsham_favoriteOn{color:#e8b931}button.dsham_favoriteOn:not(:disabled):hover{color:#e8b931!important;border-color:#e8b931!important}",fs=".dsham_settingsTitleRow{display:flex;align-items:center;gap:8px 12px;min-width:0;flex-wrap:wrap}.dsham_settingsLinks{display:flex;align-items:center;gap:8px;flex-wrap:wrap}@media(max-width:720px){.dsham_settingsTitleRow{flex-wrap:wrap}}",gs=".dsham_settingsSelection{margin:-8px 0 16px;padding:4px 0 12px;border-bottom:1px solid var(--dsw-alias-border-l2)}.dsham_settingsSelectionMain{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;min-height:36px}.dsham_settingsSelectionSummary{display:flex;flex-wrap:wrap;align-items:center;gap:12px;min-width:0;max-width:100%}.dsham_settingsSelectionToggle{display:inline-flex;flex:none;white-space:nowrap;align-items:center;gap:12px;color:var(--dsw-alias-label-primary);font-size:13px;line-height:20px;cursor:pointer}.dsham_settingsSelectionActions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;max-width:100%;margin-left:auto}.dsham_settingsSelectionScope{margin:8px 0 0;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:20px;overflow-wrap:anywhere}";function er({id:n,className:s,value:l,options:h,onChange:v,disabled:m=!1,"aria-label":C,title:E,tabIndex:N,"aria-hidden":F}){let[_,P]=o.useState(!1),B=o.useMemo(()=>h.map(Oe=>({id:Oe.value,label:Oe.label})),[h]),u=h.find(Oe=>Oe.value===l),Ie=u?.label??C;return(0,a.jsx)("div",{id:n,tabIndex:N,"aria-hidden":F,className:s===void 0?"dsham_settingsFilter":`dsham_settingsFilter ${s}`,children:(0,a.jsx)(c.Menu,{open:_,onClose:e(()=>P(!1),"onClose"),onSelect:e(Oe=>{m||v(Oe),P(!1)},"onSelect"),selectedId:l,align:"start",portal:!0,dense:!0,listClassName:"dsham_selectDropdown",anchor:(0,a.jsxs)(c.Button,{variant:"outline",size:"sm",role:"combobox","aria-label":C,"aria-expanded":_,disabled:m,tabIndex:N,"aria-hidden":F,title:E??u?.title??u?.label??C,className:"dsham_menuSelectBtn"+(_?" is-open":""),onClick:e(()=>{m||P(Oe=>!Oe)},"onClick"),children:[(0,a.jsx)("span",{className:"dsham_selectLabel",children:Ie}),(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",style:{marginLeft:4,transition:"transform 150ms ease",transform:_?"rotate(180deg)":"none",flex:"none"},children:(0,a.jsx)("path",{d:"m4 6 4 4 4-4"})})]}),items:B})})}e(er,"ArchiveProjectSelect");function vs({id:n,t:s,disabled:l=!1,favoritesOnly:h,setFavoritesOnly:v,favoriteBusy:m=!1,sortBy:C,setSortBy:E,options:N}){let[F,_]=o.useState(!1),P=o.useMemo(()=>{let be=[];typeof v=="function"&&(be.push({type:"label",id:"lbl_view_filter",text:s("organizer.favoriteFilter")||"\u7B5B\u9009\u4F1A\u8BDD"}),be.push({id:"filter:all",label:s("organizer.allSessions")||"\u5168\u90E8\u4F1A\u8BDD"}),be.push({id:"filter:favorites",label:s("organizer.favoritesOnly")||"\u53EA\u770B\u6536\u85CF"}),be.push({type:"separator",id:"sep_view_filter"})),be.push({type:"label",id:"lbl_view_sort",text:s("archives.sortLabel")||"\u6392\u5E8F\u65B9\u5F0F"});for(let St of N)be.push({id:`sort:${St.value}`,label:St.label});return be},[s,v,N]),B=e(be=>{be.startsWith("filter:")?typeof v=="function"&&!m&&v(be==="filter:favorites"):be.startsWith("sort:")&&E(be.slice(5)),_(!1)},"onSelect"),u=N.find(be=>be.value===C),Ie=h?s("organizer.favoritesOnly")||"\u53EA\u770B\u6536\u85CF":s("organizer.allChats")||"\u5168\u90E8\u804A\u5929",Oe=`${Ie} \xB7 ${u?.label??C}`;return(0,a.jsxs)("div",{className:"dsham_viewSortContainer",children:[(0,a.jsx)(c.Menu,{open:F,onClose:e(()=>_(!1),"onClose"),onSelect:B,selectedIds:[h?"filter:favorites":"filter:all",`sort:${C}`],align:"end",portal:!0,dense:!0,listClassName:"dsham_viewSortDropdown",anchor:(0,a.jsxs)(c.Button,{variant:"outline",size:"sm",role:"combobox","aria-label":s("archives.viewOptions")||"\u89C6\u56FE\u9009\u9879","aria-expanded":F,disabled:l,title:Oe,className:"dsham_menuSelectBtn dsham_viewSortBtn"+(F?" is-open":"")+(h?" has-filter":""),onClick:e(()=>{l||_(be=>!be)},"onClick"),children:[(0,a.jsxs)("svg",{viewBox:"0 0 16 16",width:13,height:13,fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"none",marginRight:4},children:[(0,a.jsx)("line",{x1:2.5,y1:4.5,x2:13.5,y2:4.5}),(0,a.jsx)("circle",{cx:5,cy:4.5,r:1.5,fill:"var(--dsw-alias-bg-layer-1)"}),(0,a.jsx)("line",{x1:2.5,y1:11.5,x2:13.5,y2:11.5}),(0,a.jsx)("circle",{cx:11,cy:11.5,r:1.5,fill:"var(--dsw-alias-bg-layer-1)"})]}),(0,a.jsx)("span",{className:"dsham_selectLabel",children:Ie}),(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:11,height:11,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",style:{marginLeft:3,transition:"transform 150ms ease",transform:F?"rotate(180deg)":"none",flex:"none"},children:(0,a.jsx)("path",{d:"m4 6 4 4 4-4"})})]}),items:P})]})}e(vs,"ArchiveViewSortMenu");function Or({selectedCount:n,hiddenCount:s,allVisibleSelected:l,selectedVisibleCount:h,visibleCount:v,busy:m,t:C,onToggle:E,onClear:N,onRestore:F,onDelete:_,onArchive:P}){let B=n>0;return(0,a.jsxs)("div",{className:"dsham_settingsSelection",children:[(0,a.jsxs)("div",{className:"dsham_settingsSelectionMain",children:[(0,a.jsxs)("div",{className:"dsham_settingsSelectionSummary",children:[(0,a.jsxs)("label",{className:"dsham_settingsSelectionToggle",title:C("archives.selectAllFiltered"),children:[(0,a.jsx)(Fr,{checked:l,indeterminate:h>0&&!l,disabled:m||v===0,label:C("archives.selectAllFiltered"),onChange:e(u=>E(u.target.checked),"onChange")}),(0,a.jsx)("span",{"aria-live":"polite",children:B?C("archives.selectedCount",{n}):C("archives.selectAllFiltered")})]}),B&&A({disabled:m,"aria-label":C("archives.clearSelection"),onClick:N,children:C("archives.clearSelectionShort")})]}),B&&(0,a.jsxs)("div",{className:"dsham_settingsSelectionActions",children:P?[A({disabled:m,onClick:P,children:C("archives.archiveSelected")})]:[A({disabled:m,"aria-label":C("archives.restoreSelected"),onClick:F,children:C("archives.restore")}),A({disabled:m,className:"dsham_btnDanger","aria-label":C("archives.deleteSelected"),onClick:_,children:C("archives.deleteSelectionShort")})]})]}),s>0&&(0,a.jsx)("p",{className:"dsham_settingsSelectionScope",role:"status",children:C("archives.selectionHiddenHint",{hidden:s})})]})}e(Or,"ArchiveSelectionToolbar");function Fr({checked:n,indeterminate:s=!1,disabled:l=!1,label:h,onChange:v}){return(0,a.jsx)(cr,{checked:n,indeterminate:s,disabled:l,label:h,onChange:v})}e(Fr,"ArchiveSelectionCheckbox");function Br(){return(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,"aria-hidden":!0,focusable:"false",children:[3.5,8,12.5].map(n=>(0,a.jsx)("circle",{cx:n,cy:8,r:1.15,fill:"none",stroke:"currentColor",strokeWidth:1.5},n))})}e(Br,"moreIcon");function bs({busy:n,title:s,t:l,onPreview:h,onRestoreOpen:v,onDelete:m,onCopyId:C}){let[E,N]=(0,o.useState)(!1),F=e(P=>{if(!n){if(N(!1),P==="copyId")return C?.();if(P==="preview")return h?.();if(P==="restoreOpen")return v?.();P==="delete"&&m?.()}},"choose"),_=[...h?[{id:"preview",label:l("discovery.preview"),icon:(0,a.jsx)(c.IconBrowseOutlineMedium,{size:16}),danger:!1}]:[],...v?[{id:"restoreOpen",label:l("archives.restoreOpen"),icon:(0,a.jsx)(c.IconUnarchiveOutlineMedium,{size:16}),danger:!1}]:[],...C?[{id:"copyId",label:l("details.copyId"),icon:(0,a.jsx)(c.IconCopyOutlineMedium,{size:16}),danger:!1}]:[],...m?[{id:"delete",label:l("menu.deleteSession"),icon:(0,a.jsx)(c.IconTrashOutlineMedium,{size:16}),danger:!0}]:[]];return(0,a.jsx)(c.Menu,{open:!n&&E,align:"end",portal:!0,dense:!0,items:_,onSelect:F,onClose:e(()=>N(!1),"onClose"),anchor:A({variant:"outline",className:"dsham_iconAction",disabled:n,title:l("archives.moreActions"),"aria-label":l("archives.moreActions")+l("common.separator")+s,"aria-haspopup":"menu","aria-expanded":E&&!n,icon:Br(),onClick:e(()=>{n||N(P=>!P)},"onClick")})})}e(bs,"ArchivedSessionMenu");function ys({group:n,busy:s,onArchive:l,onRestore:h,onDelete:v,t:m}){let C=n.key===Hn,E=l?[{id:"archive",label:m(C?"archives.archiveUngrouped":"archives.archiveProject"),icon:(0,a.jsx)(c.IconArchiveOutlineMedium,{size:16}),danger:!0}]:[{id:"restore",label:m(C?"archives.restoreUngrouped":"archives.restoreProject"),icon:(0,a.jsx)(c.IconUnarchiveOutlineMedium,{size:16}),danger:!1},{id:"delete",label:m(C?"archives.deleteUngrouped":"archives.deleteProject"),icon:(0,a.jsx)(c.IconTrashOutlineMedium,{size:16}),danger:!0}],[N,F]=(0,o.useState)(!1),_=m(C?"archives.ungroupedActions":"archives.projectActions",{name:n.title}),P=e(B=>{s||(B==="archive"?l?.():B==="restore"?h?.():B==="delete"&&v?.())},"choose");return(0,a.jsx)(c.Menu,{open:!s&&N,align:"end",portal:!0,dense:!0,items:E,onSelect:e(B=>{F(!1),P(B)},"onSelect"),onClose:e(()=>F(!1),"onClose"),anchor:A({variant:"outline",className:"dsham_iconAction",disabled:s,"aria-label":_,"aria-haspopup":"menu","aria-expanded":N&&!s,icon:Br(),onClick:e(()=>{s||F(B=>!B)},"onClick")})})}e(ys,"ArchivedGroupActions");let Hn="__ungrouped__";function ws(n){return n===Hn?{scope:"ungrouped"}:{scope:"workspace",workspaceId:n}}e(ws,"archivedBatchTargetForGroup");function vn(n,s,l){let h=[...new Set(n??[])];if(l.scope==="all")return h;if(l.scope==="sessions"){let m=new Set(l.sessionIds??[]);return h.filter(C=>m.has(C))}if(l.scope==="workspace"){let m=new Set(s.find(C=>C.workspaceId===l.workspaceId)?.sessionIds??[]);return h.filter(C=>m.has(C))}let v=new Set(s.flatMap(m=>m.sessionIds));return h.filter(m=>!v.has(m))}e(vn,"deriveArchivedBatchIds");function Hr(n){return[...new Set(n.flatMap(s=>s.sessions.map(l=>l.id)))]}e(Hr,"archivedSessionIdsInGroups");function Ur(n,s){let l=new Set(s);return[...new Set(n)].filter(h=>l.has(h))}e(Ur,"pruneArchivedSelection");function tr(n,s,l){let h=new Set(n);for(let v of s)l?h.add(v):h.delete(v);return[...h]}e(tr,"toggleArchivedSelection");function Wr(n,s){let l=n.deletedSessionIds.length,h=n.skippedSessionIds.length;return n.failures.length>0?{kind:"error",message:s("archives.deletePartial",{deleted:l,skipped:h,failed:n.failures.length,detail:n.failures[0].message})}:h>0&&l>0?{kind:"notice",message:s("archives.deleteSuccessWithSkipped",{deleted:l,skipped:h})}:h>0?{kind:"notice",message:s("archives.deleteSkipped",{n:h})}:{kind:"notice",message:s("archives.deleteSuccess",{n:l})}}e(Wr,"archivedDeleteFeedback");function qr(n,s){let l=new Set(s);return Object.values(n).filter(h=>h.origin!=="subagent"&&!h.blank&&!l.has(h.id)).map(h=>h.id)}e(qr,"unarchivedSessionIds");function Vr(n,s,l,h){let v=s.map(E=>({key:E.workspaceId,title:E.title,ids:new Set(E.sessionIds),sessions:[]})),m=[];for(let E of l){let N=n[E];if(N===void 0||N.origin==="subagent")continue;let F=v.find(_=>_.ids?.has(E));(F===void 0?m:F.sessions).push(N)}let C=v.filter(E=>E.sessions.length>0);return m.length>0&&C.push({key:Hn,title:h,sessions:m}),C}e(Vr,"deriveArchivedGroups");function $r(n,s,l,h,v=[]){let m=e((_,P)=>String(_).localeCompare(String(P),void 0,{numeric:!0,sensitivity:"base"}),"compareText"),C=new Map;if(Array.isArray(v))for(let _=0;_<v.length;_++)C.set(v[_],_);let E=e(_=>{let P=s==="created"?l[_.id]:_.updatedAt;return typeof P=="number"&&Number.isFinite(P)?P:Number.NEGATIVE_INFINITY},"timestampOf"),N=e((_,P)=>{if(s==="archived"){let B=C.get(_.id)??-1,Ie=(C.get(P.id)??-1)-B;if(Ie!==0)return Ie}if(s!=="alphabetical"){let B=E(P)-E(_);if(Number.isFinite(B)&&B!==0)return B}return m(nt(_,h),nt(P,h))||m(_.id,P.id)},"compareSessions");return n.map(_=>({..._,sessions:[..._.sessions].sort(N)})).sort((_,P)=>{if(s==="archived"){let B=_.sessions[0]?.id,u=P.sessions[0]?.id,Ie=B!==void 0?C.get(B)??-1:-1,be=(u!==void 0?C.get(u)??-1:-1)-Ie;if(be!==0)return be}if(s!=="alphabetical"){let B=E(P.sessions[0])-E(_.sessions[0]);if(Number.isFinite(B)&&B!==0)return B}return m(_.title,P.title)||m(_.key,P.key)})}e($r,"sortArchivedGroups");let Gr={...Va,...xa,"locale.language":"zh","service.unavailable":"\u670D\u52A1\u5C1A\u672A\u5C31\u7EEA\uFF0C\u8BF7\u91CD\u8BD5","common.close":"\u5173\u95ED","entry.location.title":"\u5165\u53E3\u5C55\u793A\u4F4D\u7F6E","entry.location.desc":"\u9009\u62E9\u5F52\u6863\u7BA1\u7406\u5165\u53E3\u7684\u5C55\u793A\u4F4D\u7F6E\uFF08\u81F3\u5C11\u4FDD\u7559\u4E00\u5904\uFF0C\u9632\u6B62\u65E0\u6CD5\u6253\u5F00\u9762\u677F\uFF09\u3002","entry.location.both":"\u4E24\u8FB9\u663E\u793A","entry.location.sidebar":"\u4EC5\u4FA7\u8FB9\u680F","entry.location.settings":"\u4EC5\u8BBE\u7F6E","entry.location.saveFailed":"\u4FDD\u5B58\u5165\u53E3\u8BBE\u7F6E\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u6216\u91CD\u542F\u5BBF\u4E3B\u8FDB\u7A0B","sidebar.favoriteStar.title":"\u4FA7\u680F\u6536\u85CF\u661F\u6807","sidebar.favoriteStar.desc":"\u5728\u4F1A\u8BDD\u5217\u8868\u884C\u524D\u663E\u793A\u6536\u85CF\u661F\u6807\u3002\u5173\u95ED\u540E\u4E0D\u663E\u793A\u56FE\u6807\uFF0C\u4ECD\u53EF\u901A\u8FC7\u83DC\u5355\u6536\u85CF\u548C\u7B5B\u9009\u3002","sidebar.favoriteStar.toggle":"\u5207\u6362\u4FA7\u680F\u6536\u85CF\u661F\u6807","update.entry.title":"\u5728\u7EBF\u66F4\u65B0","update.entry.desc":"\u5141\u8BB8\u68C0\u67E5\u5E76\u5728\u7EBF\u5B89\u88C5\u5F52\u6863\u7BA1\u7406\u5668\u7684\u65B0\u7248\u672C\u3002\u5173\u95ED\u540E\u9690\u85CF\u66F4\u65B0\u5165\u53E3\u3002","update.entry.toggle":"\u5207\u6362\u5728\u7EBF\u66F4\u65B0","update.entry.locked":"\u5728\u7EBF\u66F4\u65B0\u5DF2\u88AB\u5BBF\u4E3B\u914D\u7F6E\u9501\u5B9A\u7981\u7528","archives.archiveProject":"\u5F52\u6863\u8BE5\u9879\u76EE\u7684\u5168\u90E8\u804A\u5929","archives.archiveUngrouped":"\u5F52\u6863\u5168\u90E8\u672A\u5206\u7EC4\u804A\u5929","archives.archiveProjectDesc":"\u5C06\u201C{name}\u201D\u4E2D\u5168\u90E8 {n} \u6761\u672A\u5F52\u6863\u4F1A\u8BDD\u5F52\u6863\uFF0C\u4E0D\u53D7\u5F53\u524D\u641C\u7D22\u7B5B\u9009\u5F71\u54CD\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u6062\u590D\u3002","archives.archiveUngroupedDesc":"\u5C06\u5168\u90E8 {n} \u6761\u672A\u5206\u7EC4\u7684\u672A\u5F52\u6863\u4F1A\u8BDD\u5F52\u6863\uFF0C\u4E0D\u53D7\u5F53\u524D\u641C\u7D22\u7B5B\u9009\u5F71\u54CD\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u6062\u590D\u3002","archives.tab.archived":"\u5DF2\u5F52\u6863","archives.tab.unarchived":"\u672A\u5F52\u6863","archives.searchUnarchived":"\u641C\u7D22\u672A\u5F52\u6863\u804A\u5929","archives.emptyUnarchived":"\u6682\u65E0\u672A\u5F52\u6863\u4F1A\u8BDD\u3002","archives.archiveSelected":"\u5F52\u6863","archives.openSession":"\u6253\u5F00","archives.moreActions":"\u66F4\u591A\u64CD\u4F5C","archives.archiveSelectedDesc":"\u5C06\u9009\u4E2D\u7684\u4F1A\u8BDD\u5F52\u6863\uFF0C\u5305\u542B\u5F53\u524D\u7B5B\u9009\u9690\u85CF\u7684\u5DF2\u9009\u9879\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u67E5\u770B\u548C\u6062\u590D\u3002","archives.archiveSuccess":"\u5DF2\u5F52\u6863 {n} \u6761\u4F1A\u8BDD\u3002","archives.archiveBatchFailed":"\u6279\u91CF\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.navigationUnavailable":"\u5F53\u524D\u5BBF\u4E3B\u65E0\u6CD5\u4FDD\u6301\u5F52\u6863\u5BF9\u8BDD\uFF0C\u8BF7\u4F7F\u7528\u201C\u6062\u590D\u5E76\u6253\u5F00\u201D\u3002","archives.sessionNotRetained":"\u5BBF\u4E3B\u672A\u4FDD\u7559\u76EE\u6807\u4F1A\u8BDD\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u6216\u6062\u590D\u540E\u518D\u8BD5\u3002","archives.restoreOpen":"\u6062\u590D\u6253\u5F00","archives.selectedCount":"\u5DF2\u9009 {n} \u6761","archives.selectionHiddenHint":"\u542B\u5F53\u524D\u672A\u663E\u793A\u7684 {hidden} \u6761\uFF0C\u4E5F\u5C06\u53C2\u4E0E\u64CD\u4F5C","archives.clearSelectionShort":"\u6E05\u7A7A","archives.restore":"\u6062\u590D","archives.archiveTitle":"\u5F52\u6863 {n} \u4E2A\u804A\u5929\uFF1F","archives.deleteSelectionShort":"\u5220\u9664","archives.clearSelection":"\u6E05\u7A7A\u9009\u62E9","group.ungrouped":"\u672A\u5206\u7EC4","session.new":"\u65B0\u4F1A\u8BDD","menu.deleteSession":"\u5220\u9664\u4F1A\u8BDD","archived.badge":"\u5F52\u6863\u4F1A\u8BDD","archives.title":"\u5F52\u6863\u4F1A\u8BDD","archives.description":"\u7BA1\u7406\u5DF2\u5F52\u6863\u4F1A\u8BDD\uFF0C\u6216\u9009\u62E9\u672A\u5F52\u6863\u4F1A\u8BDD\u8FDB\u884C\u6279\u91CF\u5F52\u6863\u3002","archives.viewProject":"GitHub","archives.feedback":"\u95EE\u9898\u53CD\u9988","archives.empty":"\u6682\u65E0\u5DF2\u5F52\u6863\u4F1A\u8BDD","archives.emptyFiltered":"\u6CA1\u6709\u7B26\u5408\u7B5B\u9009\u6761\u4EF6\u7684\u804A\u5929","archives.searchPlaceholder":"\u641C\u7D22\u5DF2\u5F52\u6863\u804A\u5929","archives.sortLabel":"\u6392\u5E8F\u65B9\u5F0F","archives.viewOptions":"\u89C6\u56FE\u9009\u9879","archives.sortArchived":"\u6700\u8FD1\u5F52\u6863","archives.sortUpdated":"\u66F4\u65B0\u65F6\u95F4","archives.sortCreated":"\u521B\u5EFA\u65F6\u95F4","archives.sortAlphabetical":"\u6309\u5B57\u6BCD\u987A\u5E8F","archives.projectFilter":"\u6309\u9879\u76EE\u7B5B\u9009","archives.allProjects":"\u6240\u6709\u9879\u76EE","discovery.timeRange":"\u65F6\u95F4\u8303\u56F4","organizer.allChats":"\u5168\u90E8\u804A\u5929","archives.sessionCount":"{n} \u4E2A\u804A\u5929","archives.selectAllFiltered":"\u5168\u9009\u5F53\u524D\u7B5B\u9009\u7ED3\u679C","archives.selectSession":"\u9009\u62E9\u4F1A\u8BDD\u201C{name}\u201D","archives.restoreSelected":"\u6062\u590D\u6240\u9009","archives.deleteSelected":"\u5220\u9664\u6240\u9009","archives.timestamp":"{date}\uFF0C{time}","archives.restoreProject":"\u6062\u590D\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.restoreUngrouped":"\u5168\u90E8\u6062\u590D","archives.deleteProject":"\u5220\u9664\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.deleteUngrouped":"\u5168\u90E8\u5220\u9664","archives.projectActions":"\u9879\u76EE\u201C{name}\u201D\u7684\u5F52\u6863\u64CD\u4F5C","archives.ungroupedActions":"\u672A\u5206\u7EC4\u804A\u5929\u7684\u5F52\u6863\u64CD\u4F5C","archives.restoreSuccess":"\u5DF2\u6062\u590D {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u3002","archives.restoreBatchFailed":"\u6279\u91CF\u6062\u590D\u5931\u8D25\uFF1A{detail}","archives.deleteSelectedTitle":"\u5220\u9664\u6240\u9009\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteSelectedDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u6240\u9009\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\uFF08\u542B\u6B63\u5728\u8FD0\u884C\u7684\uFF09\u548C\u8BB0\u5F55\u3002\u5176\u4ED6\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteSelectedConfirm":"\u5220\u9664\u6240\u9009\u804A\u5929","archives.deleteProjectTitle":"\u5220\u9664\u201C{name}\u201D\u4E2D\u7684\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteProjectDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u201C{name}\u201D\u4E2D\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\u548C\u8BB0\u5F55\u3002\u9879\u76EE\u76EE\u5F55\u548C\u672A\u5F52\u6863\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteProjectConfirm":"\u5220\u9664\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.deleteUngroupedTitle":"\u5220\u9664\u672A\u5206\u7EC4\u7684\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteUngroupedDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u672A\u5206\u7EC4\u4E2D\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\u548C\u8BB0\u5F55\u3002\u5176\u4ED6\u9879\u76EE\u548C\u672A\u5F52\u6863\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteUngroupedConfirm":"\u5220\u9664\u672A\u5206\u7EC4\u7684\u5168\u90E8\u804A\u5929","archives.deleteBatchPending":"\u6B63\u5728\u5220\u9664\u5DF2\u5F52\u6863\u804A\u5929\u2026","archives.deleteSuccess":"\u5DF2\u5220\u9664 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u3002","archives.deleteSuccessWithSkipped":"\u5DF2\u5220\u9664 {deleted} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\uFF1B\u53E6\u6E05\u7406 {skipped} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\u3002","archives.deleteSkipped":"\u5DF2\u6E05\u7406 {n} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\u3002","archives.deletePartial":"\u5DF2\u5220\u9664 {deleted} \u4E2A\u804A\u5929\uFF0C\u6E05\u7406 {skipped} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\uFF1B{failed} \u4E2A\u5220\u9664\u5931\u8D25\uFF1A{detail}","archives.unarchiveUnknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u53D6\u6D88\u5F52\u6863\u3002","archives.unarchiveFailed":"\u53D6\u6D88\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.archiveUnknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u5F52\u6863\u3002","archives.archiveFailed":"\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.archiveActive":"\u4F1A\u8BDD\u4ECD\u5728\u8FD0\u884C\uFF08{kinds}\uFF09\u3002","archiveActive.title":"\u505C\u6B62\u5E76\u5F52\u6863","archiveActive.desc":"\u201C{name}\u201D\u4ECD\u6709\u6B63\u5728\u8FDB\u884C\u7684\u5DE5\u4F5C\uFF1A{kinds}\u3002\u5F52\u6863\u524D\u4F1A\u505C\u6B62\u8FD9\u4E9B\u5DE5\u4F5C\u3002","archiveActive.confirm":"\u505C\u6B62\u5E76\u5F52\u6863","archives.forkFailed":"\u5206\u53C9\u4F1A\u8BDD\u5931\u8D25\uFF1A{detail}","deleteSession.title":"\u5220\u9664\u4F1A\u8BDD","deleteSession.confirmTitle":"\u5220\u9664\u4F1A\u8BDD\uFF1F","deleteSession.desc":"\u5C06\u6C38\u4E45\u5220\u9664\u4F1A\u8BDD\u201C{name}\u201D\u53CA\u5176\u5B50\u4EE3\u7406\uFF08\u542B\u6B63\u5728\u8FD0\u884C\u7684\uFF09\u548C\u5168\u90E8\u8BB0\u5F55\uFF08\u5BF9\u8BDD\u5185\u5BB9\u3001\u7EDF\u8BA1\u3001\u7F13\u5B58\uFF09\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","deleteSession.pending":"\u6B63\u5728\u5220\u9664\u4F1A\u8BDD\u2026","deleteSession.unknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\u6216\u5DF2\u88AB\u5220\u9664\u3002","deleteSession.failed":"\u5220\u9664\u4F1A\u8BDD\u5931\u8D25\uFF1A{detail}","menu.archiveWorkspace":"\u5F52\u6863\u4F1A\u8BDD","menu.copyWorkspacePath":"\u590D\u5236\u76EE\u5F55","menu.openInExplorer":"\u6253\u5F00\u76EE\u5F55","menu.moveSession":"\u79FB\u52A8\u5230\u5DE5\u4F5C\u533A","moveSession.noOtherWorkspaces":"\u6682\u65E0\u53EF\u79FB\u52A8\u7684\u5176\u4ED6\u5DE5\u4F5C\u533A","moveSession.success":"\u4F1A\u8BDD\u5DF2\u6210\u529F\u79FB\u52A8\u5230\u201C{name}\u201D","archiveWorkspace.title":"\u5F52\u6863 {n} \u4E2A\u4F1A\u8BDD\uFF1F","archiveWorkspace.desc":"\u8FD9\u4F1A\u5C06\u201C{name}\u201D\u4E2D\u7684\u4F1A\u8BDD\u5F52\u6863\u3002\u4E4B\u540E\u53EF\u4EE5\u5728\u201C\u8BBE\u7F6E \u2192 \u5F52\u6863\u4F1A\u8BDD\u201D\u4E2D\u627E\u5230\u5B83\u4EEC\u3002","archiveWorkspace.confirm":"\u5168\u90E8\u5F52\u6863","archiveWorkspace.pending":"\u6B63\u5728\u5F52\u6863\u4F1A\u8BDD\u2026","date.ymd":"{y}\u5E74{m}\u6708{d}\u65E5"},Kr={...$a,...ka,"locale.language":"en","service.unavailable":"The service is not ready. Please retry.","common.close":"Close","entry.location.title":"Entry placement","entry.location.desc":"Choose where to show the entry (at least one is retained to avoid losing access).","entry.location.both":"Both","entry.location.sidebar":"Sidebar only","entry.location.settings":"Settings only","entry.location.saveFailed":"Failed to save entry location. Please check your network or restart the host.","sidebar.favoriteStar.title":"Sidebar favorite star","sidebar.favoriteStar.desc":"Show favorite star on session rows in the sidebar. When disabled, the star is hidden while menu actions and filters stay available.","sidebar.favoriteStar.toggle":"Toggle sidebar favorite star","update.entry.title":"Online updates","update.entry.desc":"Allow checking and installing new versions online. Hides the update entry when disabled.","update.entry.toggle":"Toggle online updates","update.entry.locked":"Online updates are disabled by the host configuration.","archives.moreActions":"More actions","archives.archiveProject":"Archive all chats in this project","archives.archiveUngrouped":"Archive all ungrouped chats","archives.archiveProjectDesc":"Archive all {n} unarchived sessions in \u201C{name}\u201D, regardless of the current search filter. You can restore them in Archived.","archives.archiveUngroupedDesc":"Archive all {n} ungrouped, unarchived sessions, regardless of the current search filter. You can restore them in Archived.","archives.tab.archived":"Archived","archives.tab.unarchived":"Unarchived","archives.searchUnarchived":"Search unarchived chats","archives.emptyUnarchived":"No unarchived sessions.","archives.archiveSelected":"Archive","archives.openSession":"Open session","archives.archiveSelectedDesc":"Archive the selected sessions, including selections hidden by the current filter. You can view and restore them in Archived.","archives.archiveSuccess":"Archived {n} sessions.","archives.archiveBatchFailed":"Batch archive failed: {detail}","archives.navigationUnavailable":"This host cannot keep the conversation archived while opening it. Use \u201CRestore and open\u201D instead.","archives.sessionNotRetained":"The host did not keep the requested conversation open. Try again, or restore it before opening.","archives.restoreOpen":"Restore and open","archives.selectedCount":"{n} selected","archives.selectionHiddenHint":"Includes {hidden} hidden by the current filter; actions apply to them too.","archives.clearSelectionShort":"Clear","archives.restore":"Restore","archives.archiveTitle":"Archive {n} chats?","archives.deleteSelectionShort":"Delete","archives.clearSelection":"Clear selection","group.ungrouped":"Ungrouped","session.new":"New Session","menu.deleteSession":"Delete session","archived.badge":"Archived sessions","archives.title":"Archived sessions","archives.description":"Manage archived sessions or select unarchived sessions to archive in bulk.","archives.viewProject":"GitHub","archives.feedback":"Issues","archives.empty":"No archived sessions.","archives.emptyFiltered":"No chats match your filters.","archives.searchPlaceholder":"Search archived chats","archives.sortLabel":"Sort order","archives.viewOptions":"View options","archives.sortArchived":"Recently archived","archives.sortUpdated":"Last updated","archives.sortCreated":"Created","archives.sortAlphabetical":"Alphabetical","archives.projectFilter":"Filter by project","archives.allProjects":"All projects","discovery.timeRange":"Date range","organizer.allChats":"All chats","archives.sessionCount":"{n} chats","archives.selectAllFiltered":"Select all results","archives.selectSession":"Select chat {name}","archives.restoreSelected":"Restore selected","archives.deleteSelected":"Delete selected","archives.timestamp":"{date}, {time}","archives.restoreProject":"Restore all chats in this project","archives.restoreUngrouped":"Restore all","archives.deleteProject":"Delete all chats in this project","archives.deleteUngrouped":"Delete all","archives.projectActions":"Archive actions for project {name}","archives.ungroupedActions":"Archive actions for ungrouped chats","archives.restoreSuccess":"Restored {n} archived chats.","archives.restoreBatchFailed":"Could not restore the archived chats: {detail}","archives.deleteSelectedTitle":"Delete selected archived chats","archives.deleteSelectedDesc":"This permanently deletes the selected {n} archived chats, their child agents (including any that are still running), and their records. Other chats are not affected. This cannot be undone.","archives.deleteSelectedConfirm":"Delete selected chats","archives.deleteProjectTitle":"Delete archived chats in {name}","archives.deleteProjectDesc":"This permanently deletes the {n} archived chats in {name}, their child agents, and their records. The project directory and unarchived chats are not affected. This cannot be undone.","archives.deleteProjectConfirm":"Delete all project chats","archives.deleteUngroupedTitle":"Delete ungrouped archived chats","archives.deleteUngroupedDesc":"This permanently deletes the {n} ungrouped archived chats, their child agents, and their records. Other projects and unarchived chats are not affected. This cannot be undone.","archives.deleteUngroupedConfirm":"Delete all ungrouped chats","archives.deleteBatchPending":"Deleting archived chats\u2026","archives.deleteSuccess":"Deleted {n} archived chats.","archives.deleteSuccessWithSkipped":"Deleted {deleted} archived chats and cleared {skipped} stale archive entries for sessions that no longer exist.","archives.deleteSkipped":"Cleared {n} stale archive entries for sessions that no longer exist.","archives.deletePartial":"Deleted {deleted} chats and cleared {skipped} stale archive entries; {failed} could not be deleted: {detail}","archives.unarchiveUnknown":"This session no longer exists, so it cannot be unarchived.","archives.unarchiveFailed":"Could not unarchive the session: {detail}","archives.archiveUnknown":"This session no longer exists, so it cannot be archived.","archives.archiveFailed":"Could not archive the session: {detail}","archives.archiveActive":"This conversation is still running ({kinds}).","archiveActive.title":"Stop and archive","archiveActive.desc":"\u201C{name}\u201D still has work in progress: {kinds}. Archiving stops that work first.","archiveActive.confirm":"Stop and archive","archives.forkFailed":"Could not fork the session: {detail}","deleteSession.title":"Delete session","deleteSession.confirmTitle":"Delete session?","deleteSession.desc":"This permanently deletes session \u201C{name}\u201D, its child agents (including any that are still running), and all of its records (conversation, stats, cache). This cannot be undone.","deleteSession.pending":"Deleting session\u2026","deleteSession.unknown":"This session no longer exists or was already deleted.","deleteSession.failed":"Could not delete the session: {detail}","menu.archiveWorkspace":"Archive sessions","menu.copyWorkspacePath":"Copy folder path","menu.openInExplorer":"Open folder","menu.moveSession":"Move to workspace","moveSession.noOtherWorkspaces":"No other workspaces available","moveSession.success":"Session successfully moved to \u201C{name}\u201D","archiveWorkspace.title":"Archive {n} conversations?","archiveWorkspace.desc":"This archives all conversations in \u201C{name}\u201D. You can find them later in Archived sessions.","archiveWorkspace.confirm":"Archive all","archiveWorkspace.pending":"Archiving conversations\u2026","date.ymd":"{y}-{m}-{d}"},Ss={...Ga,...Ca,"locale.language":"ru","service.unavailable":"\u0421\u0435\u0440\u0432\u0438\u0441 \u0435\u0449\u0451 \u043D\u0435 \u0433\u043E\u0442\u043E\u0432. \u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435.","common.close":"\u0417\u0430\u043A\u0440\u044B\u0442\u044C","entry.location.title":"\u0420\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u043F\u0443\u043D\u043A\u0442\u0430","entry.location.desc":"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435, \u0433\u0434\u0435 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0442\u044C \u043F\u0443\u043D\u043A\u0442 \u0432\u0445\u043E\u0434\u0430 (\u0445\u043E\u0442\u044F \u0431\u044B \u043E\u0434\u0438\u043D \u043E\u0441\u0442\u0430\u0435\u0442\u0441\u044F \u0430\u043A\u0442\u0438\u0432\u043D\u044B\u043C).","entry.location.both":"\u041E\u0431\u0430 \u043C\u0435\u0441\u0442\u0430","entry.location.sidebar":"\u0422\u043E\u043B\u044C\u043A\u043E \u0431\u043E\u043A\u043E\u0432\u0430\u044F \u043F\u0430\u043D\u0435\u043B\u044C","entry.location.settings":"\u0422\u043E\u043B\u044C\u043A\u043E \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438","entry.location.saveFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u043F\u0443\u043D\u043A\u0442\u0430. \u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0441\u0435\u0442\u044C \u0438\u043B\u0438 \u043F\u0435\u0440\u0435\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u0435 \u0445\u043E\u0441\u0442.","sidebar.favoriteStar.title":"\u0417\u0432\u0435\u0437\u0434\u0430 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0432 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","sidebar.favoriteStar.desc":"\u041E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0442\u044C \u0437\u0432\u0435\u0437\u0434\u0443 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0443 \u0441\u0442\u0440\u043E\u043A \u0441\u0435\u0441\u0441\u0438\u0439 \u0432 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438. \u041F\u0440\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0438 \u0437\u043D\u0430\u0447\u043E\u043A \u0441\u043A\u0440\u044B\u0432\u0430\u0435\u0442\u0441\u044F, \u0430 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u043C\u0435\u043D\u044E \u0438 \u0444\u0438\u043B\u044C\u0442\u0440\u0430\u0446\u0438\u044F \u043E\u0441\u0442\u0430\u044E\u0442\u0441\u044F \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u043C\u0438.","sidebar.favoriteStar.toggle":"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0437\u0432\u0435\u0437\u0434\u0443 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0432 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","update.entry.title":"\u041E\u043D\u043B\u0430\u0439\u043D-\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","update.entry.desc":"\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044C \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0443 \u0438 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0443 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0439 \u043E\u043D\u043B\u0430\u0439\u043D. \u0421\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u043F\u0443\u043D\u043A\u0442 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F \u043F\u0440\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0438.","update.entry.toggle":"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u043E\u043D\u043B\u0430\u0439\u043D-\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","update.entry.locked":"\u041E\u043D\u043B\u0430\u0439\u043D-\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u043E \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u0445\u043E\u0441\u0442\u0430.","archives.moreActions":"\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E","archives.archiveProject":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.archiveUngrouped":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.archiveProjectDesc":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 {n} \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439 \u0432 \xAB{name}\xBB, \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u0444\u0438\u043B\u044C\u0442\u0440\u0430 \u043F\u043E\u0438\u0441\u043A\u0430. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.archiveUngroupedDesc":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 {n} \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439, \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u0444\u0438\u043B\u044C\u0442\u0440\u0430 \u043F\u043E\u0438\u0441\u043A\u0430. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.tab.archived":"\u0410\u0440\u0445\u0438\u0432","archives.tab.unarchived":"\u041D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435","archives.searchUnarchived":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C \u0447\u0430\u0442\u0430\u043C","archives.emptyUnarchived":"\u041D\u0435\u0442 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.archiveSelected":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archives.openSession":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","archives.archiveSelectedDesc":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438, \u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0441\u043A\u0440\u044B\u0442\u044B\u0435 \u0442\u0435\u043A\u0443\u0449\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u043C. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.archiveSuccess":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043E \u0441\u0435\u0441\u0441\u0438\u0439: {n}.","archives.archiveBatchFailed":"\u041F\u0430\u043A\u0435\u0442\u043D\u0430\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u043D\u0435 \u0443\u0434\u0430\u043B\u0430\u0441\u044C: {detail}","archives.navigationUnavailable":"\u042D\u0442\u043E\u0442 \u0445\u043E\u0441\u0442 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0434\u0435\u0440\u0436\u0430\u0442\u044C \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u0432 \u0430\u0440\u0445\u0438\u0432\u0435 \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438. \u0412\u043C\u0435\u0441\u0442\u043E \u044D\u0442\u043E\u0433\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \xAB\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u044C\xBB.","archives.sessionNotRetained":"\u0425\u043E\u0441\u0442 \u043D\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u043B \u0437\u0430\u043F\u0440\u043E\u0448\u0435\u043D\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u043C. \u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435 \u0438\u043B\u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0435 \u0435\u0433\u043E \u043F\u0435\u0440\u0435\u0434 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0435\u043C.","archives.restoreOpen":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u044C","archives.selectedCount":"\u0412\u044B\u0431\u0440\u0430\u043D\u043E: {n}","archives.selectionHiddenHint":"\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 {hidden}, \u0441\u043A\u0440\u044B\u0442\u044B\u0445 \u0442\u0435\u043A\u0443\u0449\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u043C; \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u043F\u0440\u0438\u043C\u0435\u043D\u044F\u044E\u0442\u0441\u044F \u0438 \u043A \u043D\u0438\u043C.","archives.clearSelectionShort":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C","archives.restore":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C","archives.archiveTitle":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C {n} \u0447\u0430\u0442\u043E\u0432?","archives.deleteSelectionShort":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C","archives.clearSelection":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0432\u044B\u0431\u043E\u0440","group.ungrouped":"\u0411\u0435\u0437 \u0433\u0440\u0443\u043F\u043F\u044B","session.new":"\u041D\u043E\u0432\u0430\u044F \u0441\u0435\u0441\u0441\u0438\u044F","menu.deleteSession":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","archived.badge":"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439","archives.title":"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439","archives.description":"\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C\u0438 \u0441\u0435\u0441\u0441\u0438\u044F\u043C\u0438 \u0438\u043B\u0438 \u0432\u044B\u0431\u043E\u0440 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0434\u043B\u044F \u043F\u0430\u043A\u0435\u0442\u043D\u043E\u0439 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438.","archives.viewProject":"GitHub","archives.feedback":"\u041F\u0440\u043E\u0431\u043B\u0435\u043C\u044B","archives.empty":"\u041D\u0435\u0442 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.emptyFiltered":"\u041D\u0438 \u043E\u0434\u0438\u043D \u0447\u0430\u0442 \u043D\u0435 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0430\u0448\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u0430\u043C.","archives.searchPlaceholder":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C \u0447\u0430\u0442\u0430\u043C","archives.sortLabel":"\u0421\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0430","archives.viewOptions":"\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u0432\u0438\u0434\u0430","archives.sortArchived":"\u041D\u0435\u0434\u0430\u0432\u043D\u043E \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435","archives.sortUpdated":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0435 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","archives.sortCreated":"\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F","archives.sortAlphabetical":"\u041F\u043E \u0430\u043B\u0444\u0430\u0432\u0438\u0442\u0443","archives.projectFilter":"\u0424\u0438\u043B\u044C\u0442\u0440 \u043F\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0443","archives.allProjects":"\u0412\u0441\u0435 \u043F\u0440\u043E\u0435\u043A\u0442\u044B","discovery.timeRange":"\u041F\u0435\u0440\u0438\u043E\u0434","organizer.allChats":"\u0412\u0441\u0435 \u0447\u0430\u0442\u044B","archives.sessionCount":"{n} \u0447\u0430\u0442\u043E\u0432","archives.selectAllFiltered":"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B","archives.selectSession":"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0447\u0430\u0442 {name}","archives.restoreSelected":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435","archives.deleteSelected":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435","archives.timestamp":"{date}, {time}","archives.restoreProject":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.restoreUngrouped":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435","archives.deleteProject":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.deleteUngrouped":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435","archives.projectActions":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438 \u0434\u043B\u044F \u043F\u0440\u043E\u0435\u043A\u0442\u0430 {name}","archives.ungroupedActions":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438 \u0434\u043B\u044F \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432","archives.restoreSuccess":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432: {n}.","archives.restoreBatchFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B: {detail}","archives.deleteSelectedTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteSelectedDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 {n} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B (\u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0435\u0449\u0451 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435) \u0438 \u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0438. \u0414\u0440\u0443\u0433\u0438\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteSelectedConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteProjectTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u0432 {name}","archives.deleteProjectDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 {n} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432 \u0432 {name}, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B \u0438 \u0437\u0430\u043F\u0438\u0441\u0438. \u041A\u0430\u0442\u0430\u043B\u043E\u0433 \u043F\u0440\u043E\u0435\u043A\u0442\u0430 \u0438 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteProjectConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.deleteUngroupedTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteUngroupedDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 {n} \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B \u0438 \u0437\u0430\u043F\u0438\u0441\u0438. \u0414\u0440\u0443\u0433\u0438\u0435 \u043F\u0440\u043E\u0435\u043A\u0442\u044B \u0438 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteUngroupedConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteBatchPending":"\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432\u2026","archives.deleteSuccess":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432: {n}.","archives.deleteSuccessWithSkipped":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E {deleted} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432 \u0438 \u043E\u0447\u0438\u0449\u0435\u043D\u043E {skipped} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430 \u0434\u043B\u044F \u043D\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.deleteSkipped":"\u041E\u0447\u0438\u0449\u0435\u043D\u043E {n} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430 \u0434\u043B\u044F \u043D\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.deletePartial":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E {deleted} \u0447\u0430\u0442\u043E\u0432 \u0438 \u043E\u0447\u0438\u0449\u0435\u043D\u043E {skipped} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430; {failed} \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0443\u0434\u0430\u043B\u0438\u0442\u044C: {detail}","archives.unarchiveUnknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0435\u0451 \u043D\u0435\u043B\u044C\u0437\u044F \u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430.","archives.unarchiveFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430: {detail}","archives.archiveUnknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0435\u0451 \u043D\u0435\u043B\u044C\u0437\u044F \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C.","archives.archiveFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E: {detail}","archives.archiveActive":"\u042D\u0442\u043E\u0442 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u0432\u0441\u0451 \u0435\u0449\u0451 \u0432\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F ({kinds}).","archiveActive.title":"\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archiveActive.desc":"\u0412 \xAB{name}\xBB \u0435\u0449\u0451 \u0438\u0434\u0451\u0442 \u0440\u0430\u0431\u043E\u0442\u0430: {kinds}. \u0410\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u0441\u043D\u0430\u0447\u0430\u043B\u0430 \u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442 \u0435\u0451.","archiveActive.confirm":"\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archives.forkFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0432\u0435\u0442\u043A\u0443 \u0441\u0435\u0441\u0441\u0438\u0438: {detail}","deleteSession.title":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","deleteSession.confirmTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E?","deleteSession.desc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 \u0441\u0435\u0441\u0441\u0438\u044E \xAB{name}\xBB, \u0435\u0451 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B (\u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0435\u0449\u0451 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435) \u0438 \u0432\u0441\u0435 \u0435\u0451 \u0437\u0430\u043F\u0438\u0441\u0438 (\u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A\u0443, \u043A\u044D\u0448). \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","deleteSession.pending":"\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438\u2026","deleteSession.unknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438\u043B\u0438 \u0443\u0436\u0435 \u0443\u0434\u0430\u043B\u0435\u043D\u0430.","deleteSession.failed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0443\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E: {detail}","menu.archiveWorkspace":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u0438","menu.copyWorkspacePath":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u0443\u0442\u044C \u043A \u043F\u0430\u043F\u043A\u0435","menu.openInExplorer":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043F\u0430\u043F\u043A\u0443","menu.moveSession":"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u0432 \u043F\u0440\u043E\u0435\u043A\u0442","moveSession.noOtherWorkspaces":"\u041D\u0435\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0445 \u043F\u0440\u043E\u0435\u043A\u0442\u043E\u0432","moveSession.success":"\u0421\u0435\u0441\u0441\u0438\u044F \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u043F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0430 \u0432 \xAB{name}\xBB","archiveWorkspace.title":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C {n} \u0441\u0435\u0441\u0441\u0438\u0439?","archiveWorkspace.desc":"\u042D\u0442\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0435\u0442 \u0441\u0435\u0441\u0441\u0438\u0438 \u0432 \xAB{name}\xBB. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u043D\u0430\u0439\u0442\u0438 \u043F\u043E\u0437\u0436\u0435 \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archiveWorkspace.confirm":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435","archiveWorkspace.pending":"\u0410\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u0441\u0435\u0441\u0441\u0438\u0439\u2026","date.ymd":"{y}-{m}-{d}"},Ne="archive-manager-workspace",xs=["slots","sessions","workspaces","locale","remote","typert"];function nr(n){return{getSnapshot:n.getSnapshot.bind(n),subscribe:n.subscribe.bind(n)}}e(nr,"bindObservable");function Yr(n){return async s=>{if(typeof n?.unarchiveSession!="function")throw new Error("archive-manager: host unarchiveSession is unavailable");await n.unarchiveSession(s)}}e(Yr,"createUnarchiveSession");async function rr(n,s,l){let h=new Set(n.list?.getSnapshot?.()?.archivedSessionIds??[]),v=await Yn(s,async C=>{try{await n.archiveSession(C)}catch(E){throw E!==null&&typeof E=="object"&&On(E)!==void 0&&typeof ce(E).sessionId!="string"&&Object.assign(E,{sessionId:C}),E}return!0},{refresh:l}),m=[...n.list?.getSnapshot?.()?.archivedSessionIds??[]];return{archivedSessionIds:m,archivedSessionIdsAdded:m.filter(C=>!h.has(C)),failures:v.failures}}e(rr,"archiveSessionsViaOfficial");async function Zr(n,s,l,h){let v=new Set(n.list?.getSnapshot?.()?.archivedSessionIds??[]),m=typeof h=="function"?h:N=>n.unarchiveSession?.(N),C=await Yn(s,async N=>(await m(N),!0),{refresh:l}),E=[...n.list?.getSnapshot?.()?.archivedSessionIds??[]];return{archivedSessionIds:E,unarchivedSessionIds:[...v].filter(N=>!E.includes(N)),failures:C.failures}}e(Zr,"unarchiveSessionsViaOfficial");function Jr({triggerRect:n,viewport:s,itemCount:l,measuredHeight:h}){let v=s.width,m=s.height,C=220,E=Math.max(140,m-20),N=Math.min(360,E),F=l===0?44:34*l+8,_=Math.min(N,Math.max(20,typeof h=="number"&&h>0?h:F)),P=n.right+2;P+C>v-10&&(P=Math.max(10,n.left-C-4));let B=n.top-4;if(B+_>m-10){let u=n.bottom+4-_;u>=10?B=u:B=Math.max(10,m-_-10)}return B<10&&(B=10),{top:B,left:P,maxHeight:N}}e(Jr,"computeSubmenuPosition");async function ks(n){Cs(n);let s=n.get("remote"),l=e(()=>{},"disposeRemote");return s!==void 0&&(l=await s.$mount(ft)),async()=>{await l()}}e(ks,"apply");function Cs(n){n.effect(()=>n.locale.register(Ne,{zh:Gr,en:Kr,ru:Ss}),"dsh-archive-manager: dictionaries");let s=e(()=>n.get("uiWorkspace"),"uiWorkspaceAt"),l={},h,v=e(p=>(h=Ra(p,n.sessions,n.workspaces,{onOpened:e(()=>n.get("layout")?.selectPanel(null),"onOpened"),beginNavigation:e(()=>n.get("layout")?.beginNavigation?.(),"beginNavigation")}),()=>h?.dispose()),"attachArchiveNavigation");n.effect(()=>v(s()),"archive-manager: explicit archived navigation");let m=e(p=>{if(h===void 0)throw new Yt("navigationUnavailable");return Mr.request(p),h.open(p)},"openConversation"),C=e(async p=>{n.get("layout")?.beginNavigation?.(),Mr.request(p)},"focusSessionWorkspace"),E=e(async(p,b)=>{let I=await n.sessions.search(p,b);if(!I.ok)throw new Error(I.error.message);return I.value},"searchSessions"),N=e(async()=>{if(typeof n.sessions.refresh!="function")return null;try{return await Ie(),null}catch(p){return console.warn("archive-manager: restored archived sessions but session list refresh failed:",p),p instanceof Error?p.message:String(p)}},"refreshSessionList"),F=Yr(n.workspaces),_=e(async(p,...b)=>{let I=n.get("remote.workspaceRegistry");if(!I||typeof I[p]!="function")throw new Error(n.locale.bind(Ne)("service.unavailable"));let Se=await I[p].apply(I,b);if(!Se.ok)throw new Error(Se.error.message);return Se.value},"registryCall"),P=e(()=>_("diagnoseOrphanSubagents"),"diagnoseOrphanSubagents"),B=e(()=>_("diagnoseSessionCaches"),"diagnoseSessionCaches"),u=e(p=>_("rebuildSessionCaches",p),"rebuildSessionCaches"),Ie=e(async()=>{if(typeof n.sessions.refresh!="function")throw new Error("Official session list refresh is unavailable");let p=await n.sessions.refresh(),b=n.sessions,I=b.manager;if(I?.listState==="error"&&I.listError)throw new Error(Be(I.listError));if(b.listState==="error"&&b.listError)throw new Error(Be(b.listError));let G=b.list?.getSnapshot?.();if(G?.state==="error"&&G.error)throw new Error(Be(G.error));if(p&&typeof p=="object"&&"ok"in p&&p.ok===!1)throw new Error(Be(p.error??"Session list refresh failed"))},"refreshCacheLists"),Oe=e((p={})=>_("cleanOrphanSubagents",p??{}),"cleanOrphanSubagents"),be=e(p=>_("searchArchivedContent",p),"searchArchivedContent"),St=e(p=>_("searchSessionContent",p),"searchSessionContent"),ct=e(p=>_("previewArchivedSession",p),"previewArchivedSession"),rt=e(()=>_("favoriteSessions"),"favoriteSessions"),ln=e(p=>_("setSessionFavorite",p),"setSessionFavorite"),Qe=Er();Qe.bind({favoriteSessions:rt,setSessionFavorite:ln});let Ve,cn=Cr(n,Qe,()=>n.locale.bind(Ne),()=>Ve?.isSidebarFavoriteStarEnabled()??!0);n.effect(()=>()=>cn.dispose(),"archive-manager: favorites only filter");let Et=Wa({workspaces:n.workspaces.list,sessions:n.sessions.list,archive:e(p=>n.workspaces.archiveSession(p),"archive"),restore:e(async p=>{await F(p)},"restore"),deleteOne:e(async p=>{let b=n.get("remote.workspaceRegistry");if(!b)throw new Error(n.locale.bind(Ne)("service.unavailable"));let I=await b.deleteSession(p);if(!I.ok)throw new Error(I.error.message)},"deleteOne"),getFavorites:rt,refresh:e(()=>n.sessions.refresh?.(),"refresh"),currentSessionId:Kn}),Rt=e(async p=>{await F(p),await N()},"unarchiveSession"),q=e(async p=>{let b=n.get("remote.workspaceRegistry");if(b===void 0)throw new Error("archive-manager remote service is unavailable");let I=await b.deleteSession(p);if(!I.ok)throw new Error(I.error.message);await N()},"deleteSession"),De=e(async(p,b)=>{let I=n.get("remote.workspaceRegistry");if(I===void 0)throw new Error("archive-manager remote service is unavailable");let G=await I.moveSessionToWorkspace({sessionId:p,targetWorkspaceId:b});if(!G.ok)throw new Error(G.error?.message||"move failed");return await N(),G.value},"moveSession"),ne=e(async p=>rr(n.workspaces,p,N),"archiveSessions"),Z=e(async p=>{let b=n.workspaces.list?.getSnapshot?.()??{archivedSessionIds:[],items:[]},I=vn(b.archivedSessionIds,b.items,p);return Zr(n.workspaces,I,N,F)},"unarchiveSessions"),Fe=e(async p=>{let b=n.get("remote.workspaceRegistry");if(b===void 0)throw new Error("archive-manager remote service is unavailable");let I=await b.deleteArchivedSessions(p);if(!I.ok)throw new Error(I.error.message);let G=await N();return{...I.value,refreshError:G}},"deleteArchivedSessions"),et=e(async()=>{let p=n.get("remote.workspaceRegistry");if(p===void 0)throw new Error("archive-manager remote service is unavailable");let b=await p.archivedSessionMetadata();if(!b.ok)throw new Error(b.error.message);return b.value},"archivedSessionMetadata"),L="sidebar.workspaces.session.menu.item",_e=null,xe=new Set,Ue=e(p=>{_e=p;for(let b of xe)b()},"publishDeleteTarget");function dt(){return o.useSyncExternalStore(p=>(xe.add(p),()=>{xe.delete(p)}),()=>_e,()=>_e)}e(dt,"useDeleteRequest");let $e=e(()=>{try{return typeof n.get("contextMenus")?.register=="function"}catch{return!1}},"hasNativeContextMenus");function Dt({sessionId:p,displayTitle:b,useMenuOpenState:I,t:G}){if($e())return null;let[,Se]=I(),ae=c.MenuItemButton,fe=(0,a.jsx)(c.IconTrashOutlineRegular,{size:14}),de=e(()=>{Se(!1),Ue({sessionId:p,title:b})},"onSelect");return typeof ae=="function"?(0,a.jsx)(ae,{danger:!0,separatorBefore:!0,icon:fe,onSelect:de,children:G("menu.deleteSession")}):(0,a.jsx)("button",{type:"button",role:"menuitem",onClick:de,children:G("menu.deleteSession")})}e(Dt,"DeleteSessionMenuItem");function bn({sessionId:p,favoriteRow:b,useMenuOpenState:I,t:G}){if($e())return null;let[,Se]=I(),ae=(0,o.useSyncExternalStore)(b.subscribe,b.getSnapshot),fe=ae.ready&&ae.ids.has(p),de=e(()=>{Se(!1),b.toggle(p)},"onSelect"),ue=c.MenuItemButton,Me=(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:fe?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round","aria-hidden":!0,children:(0,a.jsx)("path",{d:re})}),Pe=G(fe?"organizer.unfavorite":"organizer.favorite");return typeof ue=="function"?(0,a.jsx)(ue,{icon:Me,onSelect:de,children:Pe}):(0,a.jsx)("button",{type:"button",role:"menuitem",onClick:de,children:Pe})}e(bn,"FavoriteMenuItem");let Wt=null,xt=new Set;function Te(p,b="success"){Wt={text:p,tone:b,seq:Date.now()};for(let I of xt)I()}e(Te,"showToast");function qt(){let p=o.useSyncExternalStore(I=>(xt.add(I),()=>{xt.delete(I)}),()=>Wt,()=>Wt);if(!p)return null;let b=c.Toast;return typeof b=="function"?(0,a.jsx)(b,{key:p.seq,text:p.text,tone:p.tone,holdMs:3e3,onDone:e(()=>{if(Wt?.seq===p.seq){Wt=null;for(let I of xt)I()}},"onDone")}):(0,a.jsx)("div",{key:p.seq,style:{position:"fixed",top:16,left:"50%",transform:"translateX(-50%)",zIndex:99999,padding:"8px 16px",borderRadius:8,background:p.tone==="danger"?"#7f1d1d":"#14532d",color:"#fff",fontSize:13,boxShadow:"0 4px 16px rgba(0,0,0,0.4)"},children:p.text})}e(qt,"GlobalToastOverlay");function yn({sessionId:p,displayTitle:b,useMenuOpenState:I,t:G}){let[,Se]=I(),[ae,fe]=o.useState(!1),[de,ue]=o.useState(null),[Me,Pe]=o.useState(!1),at=o.useRef(null),tt=o.useRef(null),$=o.useRef(null),J=n.workspaces.list?.getSnapshot?.()?.items??[],M=c.MenuItemButton,Y=e(se=>{if(!at.current)return;let Re=at.current.getBoundingClientRect(),ze=typeof window<"u"?window.innerWidth:1024,st=typeof window<"u"?window.innerHeight:768,it=Jr({triggerRect:Re,viewport:{width:ze,height:st},itemCount:J.length,measuredHeight:se});ue(ve=>ve&&ve.top===it.top&&ve.left===it.left&&ve.maxHeight===it.maxHeight?ve:it)},"updatePosition"),he=e(()=>{$.current&&clearTimeout($.current),Y(),fe(!0)},"handleMouseEnter");o.useLayoutEffect(()=>{if(!ae||!tt.current)return;let se=tt.current.offsetHeight;se>0&&Y(se)},[ae,J.length]);let te=e(()=>{$.current=setTimeout(()=>{fe(!1)},180)},"handleMouseLeave"),Ae=e(async(se,Re)=>{if(!Me){Pe(!0),fe(!1),Se(!1);try{await De(p,se),Te(G("moveSession.success",{name:Re})||`\u4F1A\u8BDD\u5DF2\u6210\u529F\u79FB\u52A8\u5230\u201C${Re}\u201D`,"success")}catch(ze){let st=ze instanceof Error?ze.message:String(ze);console.warn("archive-manager: move session failed",ze),Te(st,"danger")}finally{Pe(!1)}}},"handleSelectWorkspace"),ke=(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:14,height:14,fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,a.jsx)("path",{d:"M2 3.5C2 2.67157 2.67157 2 3.5 2H6.5L8 4H12.5C13.3284 4 14 4.67157 14 5.5V12.5C14 13.3284 13.3284 14 12.5 14H3.5C2.67157 14 2 13.3284 2 12.5V3.5Z"}),(0,a.jsx)("path",{d:"M8 7.5L10.5 10L8 12.5"}),(0,a.jsx)("path",{d:"M5.5 10H10.5"})]}),qe=(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,style:{marginLeft:"auto",opacity:.65},children:(0,a.jsx)("path",{d:"M6 3.5L10.5 8L6 12.5"})}),vt=(0,a.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",gap:8},children:[(0,a.jsx)("span",{children:G("menu.moveSession")}),qe]}),Ce=typeof M=="function"?(0,a.jsx)(M,{icon:ke,onSelect:e(()=>he(),"onSelect"),children:vt}):(0,a.jsxs)("button",{type:"button",role:"menuitem",onClick:e(()=>he(),"onClick"),style:{display:"flex",alignItems:"center",gap:6,width:"100%",padding:"6px 8px",background:"transparent",border:"none",cursor:"pointer",color:"inherit",textAlign:"left"},children:[ke,vt]});return(0,a.jsxs)("div",{ref:at,className:"dsham_moveSessionWrap",onMouseEnter:he,onMouseLeave:te,children:[Ce,ae&&de&&typeof document<"u"&&typeof f?.createPortal=="function"&&(0,f.createPortal)((0,a.jsxs)("div",{ref:tt,className:"dsham_moveSubmenu",role:"menu",onPointerDown:e(se=>{se.stopPropagation()},"onPointerDown"),onMouseDown:e(se=>{se.stopPropagation()},"onMouseDown"),onMouseEnter:he,onMouseLeave:te,style:{top:de.top,left:de.left,maxHeight:de.maxHeight},children:[(0,a.jsx)("div",{style:{position:"absolute",top:0,bottom:0,left:-6,width:8},"aria-hidden":!0}),J.length===0?(0,a.jsx)("div",{style:{padding:"8px 10px",fontSize:"12px",color:"var(--dsw-alias-label-tertiary, #888)"},children:G("moveSession.noOtherWorkspaces")}):J.map(se=>{let Re=se.title||se.path||se.workspaceId;return(0,a.jsxs)("button",{type:"button",role:"menuitem",className:"dsham_moveSubmenuBtn",disabled:Me,onPointerDown:e(ze=>{ze.preventDefault(),ze.stopPropagation(),Ae(se.workspaceId,Re)},"onPointerDown"),onClick:e(ze=>{ze.preventDefault(),ze.stopPropagation(),Ae(se.workspaceId,Re)},"onClick"),children:[(0,a.jsx)("span",{"aria-hidden":!0,style:{display:"inline-flex",flex:"none",marginRight:8},children:(0,a.jsx)(c.IconFolderCloseMedium,{size:14})}),(0,a.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",flex:1,minWidth:0},children:Re})]},se.workspaceId)})]}),document.body)]})}e(yn,"MoveSessionMenuItem");function ee(p){try{let b=document.querySelector(`[data-row-key="session:${CSS.escape(p)}"]`);return b?(b.hasAttribute("tabindex")||(b.setAttribute("tabindex","-1"),b.addEventListener("blur",()=>b.removeAttribute("tabindex"),{once:!0})),typeof c.focusWithoutRing=="function"?c.focusWithoutRing(b):b.focus(),!0):!1}catch{return!1}}e(ee,"focusSessionRow");function Ze({t:p}){let b=dt(),[I,G]=(0,o.useState)(!1),[Se,ae]=(0,o.useState)(null),[fe,de]=(0,o.useState)(null),ue=(0,o.useRef)(null),Me=(0,o.useRef)(null),Pe=(0,o.useRef)(null);if((0,o.useLayoutEffect)(()=>{if(b===null||typeof document>"u"){de(null);return}let $=null,J=e(()=>{if($&&$.isConnected)return $;try{$=document.querySelector(`[data-row-key="session:${CSS.escape(b.sessionId)}"]`)}catch{$=null}return $},"getTargetRow"),M=e(()=>{let he=ue.current,te=he?.offsetWidth||290,Ae=he?.offsetHeight||160,ke=8,qe=J();if(!qe){let Re=window.innerWidth,ze=window.innerHeight,st=Math.max(16,(ze-Ae)/2),it=Math.max(16,(Re-te)/2);de(ve=>ve!==null&&ve.top===st&&ve.left===it?ve:{top:st,left:it});return}let vt=qe.getBoundingClientRect(),Ce=vt.top-4;Ce+Ae>window.innerHeight-16&&(Ce=window.innerHeight-16-Ae),Ce<16&&(Ce=16);let se=vt.right+ke;se+te>window.innerWidth-16&&(se=vt.left-te-ke),se<16&&(se=16),de(Re=>Re!==null&&Re.top===Ce&&Re.left===se?Re:{top:Ce,left:se})},"updatePosition");M(),window.addEventListener("scroll",M,!0),window.addEventListener("resize",M);let Y=null;return typeof ResizeObserver<"u"&&ue.current&&(Y=new ResizeObserver(M),Y.observe(ue.current)),()=>{Y?.disconnect(),window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",M)}},[b]),(0,o.useEffect)(()=>{if(b===null)return;Me.current&&!Me.current.disabled?Me.current.focus():ue.current?.focus();let $=b.sessionId;return()=>{if(!ee($)){let M=document.querySelector('[role="treeitem"][aria-selected="true"]');M&&(M.hasAttribute("tabindex")||(M.setAttribute("tabindex","-1"),M.addEventListener("blur",()=>M.removeAttribute("tabindex"),{once:!0})),typeof c.focusWithoutRing=="function"?c.focusWithoutRing(M):M.focus())}}},[b]),(0,o.useEffect)(()=>{b!==null&&I&&ue.current?.focus()},[b,I]),(0,o.useEffect)(()=>{if(b===null)return;let $=e(J=>{if(J.key==="Escape"){J.preventDefault(),J.stopPropagation(),"stopImmediatePropagation"in J&&typeof J.stopImmediatePropagation=="function"&&J.stopImmediatePropagation(),I||(ae(null),Ue(null));return}if(J.key==="Tab"){if(J.preventDefault(),I){ue.current?.focus();return}let M=Me.current,Y=Pe.current;if(!M||!Y)return;J.shiftKey?document.activeElement===M?Y.focus():M.focus():document.activeElement===Y?M.focus():Y.focus()}},"onKey");return window.addEventListener("keydown",$,!0),()=>window.removeEventListener("keydown",$,!0)},[b,I]),b===null)return null;let at=e(()=>{I||(ae(null),Ue(null))},"close"),tt=e(()=>{G(!0),ae(null),q(b.sessionId).then(()=>{G(!1),Ue(null)}).catch($=>{G(!1),ae(Zn($,p))})},"confirm");return(0,a.jsxs)("div",{className:"dsham_sidebarCardRoot",children:[(0,a.jsx)("div",{className:"dsham_sidebarCardBackdrop",onClick:at}),(0,a.jsxs)("div",{ref:ue,role:"dialog","aria-modal":!0,"aria-label":p("deleteSession.title"),tabIndex:-1,className:"dsham_sidebarCard",style:fe?{top:fe.top,left:fe.left,visibility:"visible"}:{visibility:"hidden",top:0,left:0},children:[(0,a.jsx)("h3",{className:"dsham_sidebarCardTitle",children:p("deleteSession.confirmTitle")}),(0,a.jsx)("p",{className:"dsham_sidebarCardDesc",children:p("deleteSession.desc",{name:b.title})}),I&&(0,a.jsx)("div",{className:"dsham_sidebarCardDesc",role:"status",children:p("deleteSession.pending")}),Se!==null&&(0,a.jsx)("div",{className:"dsham_sidebarCardError",role:"alert",children:Se}),(0,a.jsxs)("div",{className:"dsham_sidebarCardFooter",children:[(0,a.jsx)("button",{ref:Me,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnCancel",disabled:I,onClick:at,children:p("cancel")}),(0,a.jsx)("button",{ref:Pe,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnDanger",disabled:I,onClick:tt,children:p("deleteSession.title")})]})]})]})}e(Ze,"DeleteSessionOverlay");let It=null,K=new Set,Vt=e(p=>{It=p;for(let b of K)b()},"publishArchiveWsTarget");function We(){return o.useSyncExternalStore(p=>(K.add(p),()=>{K.delete(p)}),()=>It,()=>It)}e(We,"useArchiveWsRequest");function dn(p){try{let b=document.querySelector(`[data-row-key="workspace:${CSS.escape(p)}"]`);return b?(b.hasAttribute("tabindex")||(b.setAttribute("tabindex","-1"),b.addEventListener("blur",()=>b.removeAttribute("tabindex"),{once:!0})),typeof c.focusWithoutRing=="function"?c.focusWithoutRing(b):b.focus(),!0):!1}catch{return!1}}e(dn,"focusWorkspaceRow");function Mt({t:p}){let b=We(),[I,G]=(0,o.useState)(!1),[Se,ae]=(0,o.useState)(null),[fe,de]=(0,o.useState)(null),ue=(0,o.useRef)(null),Me=(0,o.useRef)(null),Pe=(0,o.useRef)(null);if((0,o.useLayoutEffect)(()=>{if(b===null||typeof document>"u"){de(null);return}let $=null,J=e(()=>{if($&&$.isConnected)return $;try{$=document.querySelector(`[data-row-key="workspace:${CSS.escape(b.workspaceId)}"]`)}catch{$=null}return $},"getTargetRow"),M=e(()=>{let he=ue.current,te=he?.offsetWidth||290,Ae=he?.offsetHeight||160,ke=8,qe=J();if(!qe){let Re=window.innerWidth,ze=window.innerHeight,st=Math.max(16,(ze-Ae)/2),it=Math.max(16,(Re-te)/2);de(ve=>ve!==null&&ve.top===st&&ve.left===it?ve:{top:st,left:it});return}let vt=qe.getBoundingClientRect(),Ce=vt.top-4;Ce+Ae>window.innerHeight-16&&(Ce=window.innerHeight-16-Ae),Ce<16&&(Ce=16);let se=vt.right+ke;se+te>window.innerWidth-16&&(se=vt.left-te-ke),se<16&&(se=16),de(Re=>Re!==null&&Re.top===Ce&&Re.left===se?Re:{top:Ce,left:se})},"updatePosition");M(),window.addEventListener("scroll",M,!0),window.addEventListener("resize",M);let Y=null;return typeof ResizeObserver<"u"&&ue.current&&(Y=new ResizeObserver(M),Y.observe(ue.current)),()=>{Y?.disconnect(),window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",M)}},[b]),(0,o.useEffect)(()=>{if(b===null)return;Me.current&&!Me.current.disabled?Me.current.focus():ue.current?.focus();let $=b.workspaceId;return()=>{dn($)}},[b]),(0,o.useEffect)(()=>{b!==null&&I&&ue.current?.focus()},[b,I]),(0,o.useEffect)(()=>{if(b===null)return;let $=e(J=>{if(J.key==="Escape"){J.preventDefault(),J.stopPropagation(),"stopImmediatePropagation"in J&&typeof J.stopImmediatePropagation=="function"&&J.stopImmediatePropagation(),I||(ae(null),Vt(null));return}if(J.key==="Tab"){if(J.preventDefault(),I){ue.current?.focus();return}let M=Me.current,Y=Pe.current;if(!M||!Y)return;J.shiftKey?document.activeElement===M?Y.focus():M.focus():document.activeElement===Y?M.focus():Y.focus()}},"onKey");return window.addEventListener("keydown",$,!0),()=>window.removeEventListener("keydown",$,!0)},[b,I]),b===null)return null;let at=e(()=>{I||(ae(null),Vt(null))},"close"),tt=e(()=>{G(!0),ae(null);let J=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(te=>te.workspaceId===b.workspaceId),M=n.sessions.list?.getSnapshot?.()?.byId??{},Y=new Set(n.workspaces.list?.getSnapshot?.()?.archivedSessionIds??[]),he=(J?.sessionIds??[]).filter(te=>Fn(te,M,Y));rr(n.workspaces,he,N).then(te=>{if(G(!1),te.failures.length>0){ae(Pn(te.failures,p));return}Vt(null)}).catch(te=>{G(!1),ae(Ar(te,p))})},"confirm");return(0,a.jsxs)("div",{className:"dsham_sidebarCardRoot",children:[(0,a.jsx)("div",{className:"dsham_sidebarCardBackdrop",onClick:at}),(0,a.jsxs)("div",{ref:ue,role:"dialog","aria-modal":!0,"aria-label":p("menu.archiveWorkspace"),tabIndex:-1,className:"dsham_sidebarCard",style:fe?{top:fe.top,left:fe.left,visibility:"visible"}:{visibility:"hidden",top:0,left:0},children:[(0,a.jsx)("h3",{className:"dsham_sidebarCardTitle",children:p("archiveWorkspace.title",{n:b.count})}),(0,a.jsx)("p",{className:"dsham_sidebarCardDesc",children:p("archiveWorkspace.desc",{name:b.title})}),I&&(0,a.jsx)("div",{className:"dsham_sidebarCardDesc",role:"status",children:p("archiveWorkspace.pending")}),Se!==null&&(0,a.jsx)("div",{className:"dsham_sidebarCardError",role:"alert",children:Se}),(0,a.jsxs)("div",{className:"dsham_sidebarCardFooter",children:[(0,a.jsx)("button",{ref:Me,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnCancel",disabled:I,onClick:at,children:p("cancel")}),(0,a.jsx)("button",{ref:Pe,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnDanger",disabled:I,onClick:tt,children:p("archiveWorkspace.confirm")})]})]})]})}e(Mt,"ArchiveWorkspaceOverlay");function wn(p){if(typeof document>"u"||typeof document.addEventListener!="function"||typeof MutationObserver>"u")return()=>{};let b=null,I=!1,G=new Map,Se=!1,ae=e(M=>{let he=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(ke=>ke.workspaceId===M);if(he===void 0)return[];let te=n.sessions.list?.getSnapshot?.()?.byId??{},Ae=new Set(n.workspaces.list?.getSnapshot?.()?.archivedSessionIds??[]);return he.sessionIds.filter(ke=>Fn(ke,te,Ae))},"workspaceCandidateIds"),fe=e(()=>{if(Se=!1,!I)for(let[M,Y]of G){if(!M.isConnected){G.delete(M);continue}let he=ae(Y.workspaceId).length===0;M.disabled=he,M.style.opacity=he?"0.5":"",M.style.cursor=he?"not-allowed":""}},"revalidateItems"),de=e(()=>{if(G.size===0||Se||I)return;Se=!0;let M=e(()=>fe(),"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(M):setTimeout(M,16)},"scheduleRevalidate"),ue=e(M=>{b=jr(M.target)},"rememberWorkspace");document.addEventListener("pointerdown",ue,!0),document.addEventListener("click",ue,!0);let Me=e(()=>{if(I)return;for(let[Y]of G)Y.isConnected||G.delete(Y);let M=document.querySelectorAll('[role="menu"]');for(let Y of M){if(Y.querySelector('[data-dsham-archive-workspace="true"]'))continue;let he=Array.from(Y.querySelectorAll('button[role="menuitem"]'));if(he.length===0)continue;let te=he.find(Ge=>Xn(Ge,!1))??he.find(Ge=>Xn(Ge,!0));if(!te)continue;let Ae=he.find(Ge=>Ge!==te)??te,ke=te.parentElement;if(!ke)continue;let qe=b;if(!qe)continue;let Ce=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(Ge=>Ge.workspaceId===qe.workspaceId),se=Ce?.path??Ce?.cwd,ze=ae(qe.workspaceId).length,st=document.createElement("div");st.className=ke.className;let it=Ae.className.split(/\s+/).filter(Ge=>!/(?:^|[_-])danger(?:$|[_-])/i.test(Ge)).join(" "),ve=document.createElement("button");ve.type="button",ve.setAttribute("role","menuitem"),ve.dataset.dshamArchiveWorkspace="true",ve.className=it;let Kt=Ae.querySelector("span"),Je=Ae.querySelectorAll("span")[1],Xt=document.createElement("span");Xt.setAttribute("aria-hidden","true"),Kt?.className&&(Xt.className=Kt.className),Xt.innerHTML='<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M13.5 2.5H2.5C1.94772 2.5 1.5 2.94772 1.5 3.5V4.5C1.5 5.05228 1.94772 5.5 2.5 5.5H13.5C14.0523 5.5 14.5 5.05228 14.5 4.5V3.5C14.5 2.94772 14.0523 2.5 13.5 2.5Z"/><path d="M2.5 5.5V13.5C2.5 13.7652 2.60536 14.0196 2.79289 14.2071C2.98043 14.3946 3.23478 14.5 3.5 14.5H12.5C12.7652 14.5 13.0196 14.3946 13.2071 14.2071C13.3946 14.0196 13.5 13.7652 13.5 13.5V5.5"/><path d="M6.5 9.5H9.5"/></svg>';let un=document.createElement("span");if(Je?.className&&(un.className=Je.className),un.textContent=p("menu.archiveWorkspace"),ve.append(Xt,un),st.append(ve),ze===0&&(ve.disabled=!0,ve.style.opacity="0.5",ve.style.cursor="not-allowed"),ve.addEventListener("click",Ge=>{Ge.preventDefault(),Ge.stopPropagation();let ot=ae(qe.workspaceId).length;ot!==0&&(document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),Vt({workspaceId:qe.workspaceId,title:qe.title,count:ot}))}),se){let Ge=document.createElement("div");Ge.className=ke.className;let ot=document.createElement("button");ot.type="button",ot.setAttribute("role","menuitem"),ot.dataset.dshamCopyWorkspacePath="true",ot.className=it,ot.disabled=!1,ot.style.opacity="",ot.style.cursor="";let hn=document.createElement("span");hn.setAttribute("aria-hidden","true"),Kt?.className&&(hn.className=Kt.className),hn.innerHTML='<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><rect x="5.5" y="5.5" width="8" height="8" rx="1.5"/><path d="M10.5 3.5V2.5C10.5 1.94772 10.0523 1.5 9.5 1.5H3.5C2.94772 1.5 2.5 1.94772 2.5 2.5V8.5C2.5 9.05228 2.94772 9.5 3.5 9.5H4.5"/></svg>';let bt=document.createElement("span");Je?.className&&(bt.className=Je.className),bt.textContent=p("menu.copyWorkspacePath"),ot.append(hn,bt),Ge.append(ot),ot.addEventListener("click",en=>{en.preventDefault(),en.stopPropagation(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),Gn(se).catch(()=>{})});let Qt=document.createElement("div");Qt.className=ke.className;let ht=document.createElement("button");ht.type="button",ht.setAttribute("role","menuitem"),ht.dataset.dshamOpenExplorer="true",ht.className=it,ht.disabled=!1,ht.style.opacity="",ht.style.cursor="";let Bt=document.createElement("span");Bt.setAttribute("aria-hidden","true"),Kt?.className&&(Bt.className=Kt.className),Bt.innerHTML='<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M1.5 3.5C1.5 2.94772 1.94772 2.5 2.5 2.5H6.5L8 4.5H13.5C14.0523 4.5 14.5 4.94772 14.5 5.5V12.5C14.5 13.0523 14.0523 13.5 13.5 13.5H2.5C1.94772 13.5 1.5 13.0523 1.5 12.5V3.5Z"/><path d="M10 8.5L12 10.5L10 12.5"/><path d="M6.5 10.5H12"/></svg>';let At=document.createElement("span");Je?.className&&(At.className=Je.className),At.textContent=p("menu.openInExplorer"),ht.append(Bt,At),Qt.append(ht),ht.addEventListener("click",en=>{en.preventDefault(),en.stopPropagation(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),(async()=>{try{let tn=await fetch(mn("/open-in-app/open"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({app:"explorer",path:se})}).catch(()=>null);if(tn&&tn.ok)return}catch{}try{await zt("/open-in-explorer",{method:"POST",body:JSON.stringify({path:se,workspaceId:qe.workspaceId})})}catch(tn){console.warn("archive-manager: open in explorer failed",tn)}})()}),ke.parentNode?.insertBefore(Ge,ke),ke.parentNode?.insertBefore(Qt,ke)}ke.parentNode?.insertBefore(st,ke),G.set(ve,{workspaceId:qe.workspaceId})}},"checkAndInject"),Pe=!1,at=e(()=>{if(Pe||I)return;Pe=!0;let M=e(()=>{Pe=!1,!I&&Me()},"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(M):setTimeout(M,16)},"scheduleInject"),tt=new MutationObserver(M=>{Bn(M,'[role="menu"]')&&at()});tt.observe(document.body,{childList:!0,subtree:!0});let $=n.sessions.list?.subscribe?.(de),J=n.workspaces.list?.subscribe?.(de);return()=>{I=!0,document.removeEventListener("pointerdown",ue,!0),document.removeEventListener("click",ue,!0),tt.disconnect(),$?.(),J?.(),G.clear();for(let M of document.querySelectorAll('[data-dsham-archive-workspace="true"], [data-dsham-copy-workspace-path="true"], [data-dsham-open-explorer="true"]'))M.parentElement?.remove()}}e(wn,"setupWorkspaceMenuInjector");function kt(){if(typeof n.slots.entries!="function")return!1;if(n.slots.entries("sidebar.workspaces").some(I=>I.children?.[L]!==void 0)||n.slots.entries("contextMenu.content").some(I=>I.children?.[L]!==void 0))return!0;try{if(n.get("contextMenus")!==void 0&&n.slots.entries("contextMenu.content").length>0)return!0}catch{}return!1}e(kt,"hostSidebarDeclaresSessionMenu");let $t,Lt,Sn,xn,kn,Gt,Cn,jt=e(()=>{let p=kt()?"menu":"waiting";p!==$t&&($t=p,p==="menu"&&(Lt??=n.slots.inject(L,()=>n.slots.register({name:L,id:"archive-manager.delete-session",order:9999,locale:Ne,inject:e(()=>({}),"inject")},Dt)),Sn??=n.slots.inject(L,()=>n.slots.register({name:L,id:"archive-manager.favorite",order:1,locale:Ne,inject:e(()=>({favoriteRow:Qe}),"inject")},bn)),xn??=n.slots.inject(L,()=>n.slots.register({name:L,id:"archive-manager.move-session",order:480,locale:Ne,inject:e(()=>({}),"inject")},yn)),kn??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.delete-session",locale:Ne,inject:e(()=>({t:n.locale.bind(Ne)}),"inject")},Ze)),Gt??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.archive-workspace",locale:Ne,inject:e(()=>({t:n.locale.bind(Ne)}),"inject")},Mt)),Cn??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.toast",locale:Ne,inject:e(()=>({}),"inject")},qt))))},"reconcileSidebar");jt();let ut=(()=>{try{return n.get("contextMenus")}catch{return}})();ut&&typeof ut.register=="function"?n.effect(()=>{let p,b,I;try{p=n.slots.register({name:"contextMenu.icon",key:"archive-manager.explorer"},()=>(0,a.jsx)("svg",{width:14,height:14,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M1.5 3.5C1.5 2.94772 1.94772 2.5 2.5 2.5H6.5L8 4.5H13.5C14.0523 4.5 14.5 4.94772 14.5 5.5V12.5C14.5 13.0523 14.0523 13.5 13.5 13.5H2.5C1.94772 13.5 1.5 13.0523 1.5 12.5V3.5Z"}),(0,a.jsx)("path",{d:"M10 8.5L12 10.5L10 12.5"}),(0,a.jsx)("path",{d:"M6.5 10.5H12"})]})),b=n.slots.register({name:"contextMenu.icon",key:"archive-manager.star-fill"},()=>(0,a.jsx)("svg",{width:14,height:14,viewBox:"0 0 16 16",fill:"#e8b931",stroke:"#e8b931",strokeWidth:1.2,strokeLinejoin:"round",children:(0,a.jsx)("path",{d:re})})),I=n.slots.register({name:"contextMenu.icon",key:"archive-manager.star-outline"},()=>(0,a.jsx)("svg",{width:14,height:14,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round",children:(0,a.jsx)("path",{d:re})}))}catch{}let G=ut.register({id:"archive-manager.session-favorite",target:"session",order:1,observe:e(()=>[Qe,n.locale],"observe"),resolve:e(({sessionId:fe})=>{let de=Qe.getSnapshot(),ue=de.ready&&de.ids.has(fe);return[{id:"favorite",label:n.locale.bind(Ne)(ue?"organizer.unfavorite":"organizer.favorite"),icon:{key:ue?"archive-manager.star-fill":"archive-manager.star-outline"},run:e(()=>{Qe.toggle(fe)},"run")}]},"resolve")}),Se=ut.register({id:"archive-manager.session-delete",target:"session",order:9999,observe:e(()=>[n.locale],"observe"),resolve:e(({sessionId:fe,displayTitle:de})=>[{id:"delete-session",label:n.locale.bind(Ne)("menu.deleteSession"),icon:{key:"workspace.delete"},danger:!0,separatorBefore:!0,afterContent:!0,run:e(()=>{Ue({sessionId:fe,title:de||fe})},"run")}],"resolve")}),ae=ut.register({id:"archive-manager.workspace-actions",target:"workspace",order:250,observe:e(()=>[n.workspaces.list,n.sessions.list,n.locale],"observe"),resolve:e(({workspaceId:fe,path:de,displayTitle:ue})=>{let Pe=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(te=>te.workspaceId===fe),at=n.sessions.list?.getSnapshot?.()?.byId??{},tt=new Set(n.workspaces.list?.getSnapshot?.()?.archivedSessionIds??[]),J=(Pe?Pe.sessionIds.filter(te=>Fn(te,at,tt)):[]).length,M=n.locale.bind(Ne),Y=de??Pe?.path??Pe?.cwd,he=[];return Y&&(he.push({id:"copy-workspace-path",label:M("menu.copyWorkspacePath"),icon:{key:"workspace.copy"},run:e(()=>{Gn(Y).catch(()=>{})},"run")}),he.push({id:"open-in-explorer",label:M("menu.openInExplorer"),icon:{key:"archive-manager.explorer"},run:e(()=>{(async()=>{try{let te=await fetch(mn("/open-in-app/open"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({app:"explorer",path:Y})}).catch(()=>null);if(te&&te.ok)return}catch{}try{await zt("/open-in-explorer",{method:"POST",body:JSON.stringify({path:Y,workspaceId:fe})})}catch(te){console.warn("archive-manager: open in explorer failed",te)}})()},"run")})),he.push({id:"archive-workspace",label:M("menu.archiveWorkspace"),icon:{key:"workspace.archive"},disabled:J===0,run:e(()=>{J!==0&&Vt({workspaceId:fe,title:ue||fe,count:J})},"run")}),he},"resolve")});return()=>{G?.(),Se?.(),ae?.(),p?.(),b?.(),I?.()}},"archive-manager: native workspace context menu"):n.effect(()=>wn(n.locale.bind(Ne)),"archive-manager: workspace menu injector"),n.effect(()=>Dr(),"archive-manager: sidebar row contextmenu trigger"),Pr(n);let Tt=typeof n.on=="function"?n.on("slots/changed",p=>{if(!(p!=="sidebar.workspaces"&&p!=="contextMenu.content"))try{jt()}catch(b){console.warn("archive-manager: sidebar mode switch failed",b)}}):void 0;n.effect(()=>()=>{Tt?.(),Lt?.(),Sn?.(),xn?.(),kn?.(),Gt?.(),Cn?.()},"archive-manager: sidebar mode");let Jt=e(()=>({archiveSessions:ne,archiveSession:e((p,b)=>n.workspaces.archiveSession(p,b),"archiveSession"),sessionStore:nr(n.sessions.list),workspaceStore:nr(n.workspaces.list),unarchiveSession:Rt,deleteSession:q,unarchiveSessions:Z,deleteArchivedSessions:Fe,archivedSessionMetadata:et,openConversation:m,focusSessionWorkspace:C,viewState:l,favoriteSessions:rt,setSessionFavorite:ln,favoriteSync:Qe,organizeBatch:Et,diagnoseOrphanSubagents:P,cleanOrphanSubagents:Oe,diagnoseSessionCaches:B,rebuildSessionCaches:u,refreshCacheLists:Ie,searchSessionContent:St,searchArchivedContent:be,previewArchivedSession:ct,t:n.locale.bind(Ne)}),"buildArchivedSectionProps"),zt=e(async(p,b)=>{let I=mn(`/api/michengai/dsh-archive-manager${p}`),G=Object.assign({"content-type":"application/json","x-michengai-plugin-update":"1"},b?.headers),Se=await fetch(I,Object.assign({},b,{headers:G})),ae=await Se.json();if(!Se.ok||!ae||ae.ok===!1)throw new Error((ae&&typeof ae=="object"&&typeof ae.error=="string"?ae.error:void 0)||`HTTP ${Se.status}`);return ae},"callSettingsApi"),Ct=null,Pt=!1,En=e(({size:p=16})=>(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:p,height:p,fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M13.5 2.5H2.5C1.94772 2.5 1.5 2.94772 1.5 3.5V4.5C1.5 5.05228 1.94772 5.5 2.5 5.5H13.5C14.0523 5.5 14.5 5.05228 14.5 4.5V3.5C14.5 2.94772 14.0523 2.5 13.5 2.5Z"}),(0,a.jsx)("path",{d:"M2.5 5.5V13.5C2.5 13.7652 2.60536 14.0196 2.79289 14.2071C2.98043 14.3946 3.23478 14.5 3.5 14.5H12.5C12.7652 14.5 13.0196 14.3946 13.2071 14.2071C13.3946 14.0196 13.5 13.7652 13.5 13.5V5.5"}),(0,a.jsx)("path",{d:"M6.5 9.5H9.5"})]}),"ArchiveNavIcon"),Un=e(()=>{if(!(!Pt||Ct)&&!(Ve&&!Ve.isSettingsSectionEnabled()))try{n.slots.register({name:"settings.section.icon",id:"archive-manager",locale:Ne},En);let p=n.slots.register({name:"settings.section",id:"archive-manager",order:45,label:e(()=>n.locale.bind(Ne)("archived.badge"),"label"),icon:"archive",locale:Ne,inject:Jt},Ln);Ct=typeof p=="function"?p:()=>{}}catch(p){console.warn("archive-manager: register settings.section failed:",p),Ct=null}},"mountSettingsSection"),Ot=e(()=>{if(Ct){try{Ct()}catch{}Ct=null}},"unmountSettingsSection"),In=e(()=>{Ve?.isSettingsSectionEnabled?.()??!0?Un():Ot()},"syncSettingsSection");Ve=yr(n,{callApi:zt,renderPanel:e(p=>(0,a.jsx)(Ln,Object.assign({},Jt(),p)),"renderPanel"),injectProps:Jt,ns:Ne,onOnlineUpdateChange:e(()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("dsham-update-toggle"))},"onOnlineUpdateChange"),onSidebarFavoriteStarChange:e(p=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("dsham-favorite-star-toggle",{detail:{enabled:p}}))},"onSidebarFavoriteStarChange"),onLocationChange:e(()=>{In()},"onLocationChange")}),n.effect(()=>()=>{Ve?.destroy(),Ot()},"archive-manager: sidebar entry"),n.effect(()=>Fa({endpoint:"/api/michengai/dsh-archive-manager/update",packageName:"@michengai/dsh-archive-manager",titleRowSelector:".dsham_settingsTitleRow",linksSelector:".dsham_settingsLinks",zhName:"\u5F52\u6863\u4F1A\u8BDD",enName:"Archived sessions",ruName:"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439",createIcon:V,isEnabled:e(()=>Ve.isOnlineUpdateEnabled(),"isEnabled")}),"dsh-archive-manager: plugin update ui"),n.slots.inject("settings.section",()=>{Pt=!0;try{if(Ve&&!Ve.isSettingsSectionEnabled())return()=>{Pt=!1,Ot()};let p=n.slots.register({name:"settings.section",id:"archive-manager",order:45,label:e(()=>n.locale.bind(Ne)("archived.badge"),"label"),icon:"archive",locale:Ne,inject:Jt},Ln);return Ct=typeof p=="function"?p:()=>{},()=>{Pt=!1,Ot()}}catch(p){return console.warn("archive-manager: register settings.section failed:",p),()=>{Pt=!1}}})}e(Cs,"applyWorkspaceBrowser");async function Es(n,s,l,h){try{await s(n)}catch(v){l(ts(v,h))}}return e(Es,"forkWithFeedback"),i.__test={computeSubmenuPosition:Jr,forkWithFeedback:Es,favoritesOnlyVisibility:xr,favoriteGroupPredicate:kr,createFavoriteRowStore:Er,unarchivedSessionIds:qr,ArchiveSelectionToolbar:Or,ArchivedSessionsSection:Ln,zh:Gr,en:Kr,displayTitle:nt,isUnknownSessionError:zn,deriveArchivedGroups:Vr,sortArchivedGroups:$r,deriveArchivedBatchIds:vn,archivedSessionIdsInGroups:Hr,pruneArchivedSelection:Ur,toggleArchivedSelection:tr,archivedDeleteFeedback:Wr,isWorkspaceTaskCandidate:Fn,isWorkspaceDeleteMenuItem:Xn,workspaceMenuTriggerFrom:jr,findRowMenuButton:Jn,isRowMenuButton:Nr,setupSidebarRowContextMenu:Dr,applySettingsNavIcon:Lr,restoreSettingsNavIcon:zr,installSettingsNavIcon:Pr,mutationTouches:Bn,resolveRowHasStatus:Zt,activeSessionActivity:On,activeSessionRefusal:_r,activeArchiveFromMessage:Rr,archiveSessionsViaOfficial:rr,unarchiveSessionsViaOfficial:Zr,createUnarchiveSession:Yr,bindObservable:nr,ARCHIVE_MANAGER_REMOTE:ft,currentSessionId:Kn,setupSidebarEntry:yr,ArchiveBundleConfigCard:vr,ArchiveBundleConfigCardWrapper:br,setupWorkspaceFavoritesOnly:Cr},i.apply=ks,i.inject=xs,r.exports}e(pi,"startArchiveClient");
|
|
22
|
+
`;function Vs(){if(typeof document>"u"||typeof document.getElementById!="function"||document.getElementById(qs)!==null||typeof document.createElement!="function")return;let t=document.createElement("style");t.id=qs,t.textContent=pi,(document.head??document.documentElement)?.appendChild?.(t)}e(Vs,"ensureSidebarEntryStyle");function mi(t){let r=t&&typeof t.size=="number"?t.size:16;return Fe(on.IconArchiveOutlineMedium,{size:r})}e(mi,"ArchiveSidebarIcon");function yr(t){Vs();let{t:r,location:i,onLocationChange:s,errorMessage:l,enabled:u=!1,onToggle:m,disabled:C,onlineUpdateEnabled:y=!0,onToggleOnlineUpdate:_,onlineUpdateDisabled:x,onlineUpdateLocked:g=!1,sidebarFavoriteStarEnabled:w=!0,onToggleSidebarFavoriteStar:D,sidebarFavoriteStarDisabled:j}=t,U=i??(u?"both":"settings"),P=e(me=>{(me==="both"||me==="sidebar"||me==="settings")&&(typeof s=="function"?s(me):typeof m=="function"&&m(me!=="settings"))},"handleLocationChange"),B=[Fe("div",{key:"entry-location",className:"dsham_bundle_row"},Fe("div",{className:"dsham_bundle_label_box"},Fe("span",{className:"dsham_bundle_title"},r("entry.location.title")),Fe("span",{className:"dsham_bundle_desc"},r("entry.location.desc")),l?Fe("span",{className:"dsham_bundle_error",role:"alert"},l):null),Fe(on.SegmentedControl,{id:"dsham-bundle-entry-location",value:U,onChange:P,label:r("entry.location.title"),disabled:C,options:[{value:"both",label:r("entry.location.both")},{value:"sidebar",label:r("entry.location.sidebar")},{value:"settings",label:r("entry.location.settings")}]}))];if(typeof _=="function"){let me=g?`${r("update.entry.desc")} (${r("update.entry.locked")})`:r("update.entry.desc");B.push(Fe("div",{key:"online-update",className:"dsham_bundle_row"},Fe("div",{className:"dsham_bundle_label_box"},Fe("span",{className:"dsham_bundle_title"},r("update.entry.title")),Fe("span",{className:"dsham_bundle_desc"},me)),Fe(on.Switch,{checked:y,onChange:_,label:r("update.entry.toggle"),disabled:x||g,title:g?r("update.entry.locked"):void 0})))}return typeof D=="function"&&B.push(Fe("div",{key:"sidebar-favorite-star",className:"dsham_bundle_row"},Fe("div",{className:"dsham_bundle_label_box"},Fe("span",{className:"dsham_bundle_title"},r("sidebar.favoriteStar.title")),Fe("span",{className:"dsham_bundle_desc"},r("sidebar.favoriteStar.desc"))),Fe(on.Switch,{checked:w,onChange:D,label:r("sidebar.favoriteStar.toggle"),disabled:j}))),Fe(ds,null,B)}e(yr,"ArchiveBundleConfigCard");function wr(t){let[r,i]=qt(t.getLocation),[s,l]=qt(t.getOnlineUpdateEnabled?t.getOnlineUpdateEnabled:()=>!0),[u,m]=qt(t.getOnlineUpdateLocked?t.getOnlineUpdateLocked:()=>!1),[C,y]=qt(t.getSidebarFavoriteStarEnabled?t.getSidebarFavoriteStarEnabled:()=>!0),[_,x]=qt(null),[g,w]=qt(!1),[D,j]=qt(!1),[U,P]=qt(!1);hs(()=>{let V=e(()=>{i(t.getLocation()),x(null),t.getOnlineUpdateEnabled&&l(t.getOnlineUpdateEnabled()),t.getOnlineUpdateLocked&&m(t.getOnlineUpdateLocked()),t.getSidebarFavoriteStarEnabled&&y(t.getSidebarFavoriteStarEnabled())},"syncState");return V(),t.subscribe(V)},[t]);let B=e(V=>{w(!0),x(null),i(V),t.setLocation(V).catch(fe=>{console.error("archive-manager: setLocation failed:",fe),i(t.getLocation()),x(t.t("entry.location.saveFailed")||"\u4FDD\u5B58\u5165\u53E3\u8BBE\u7F6E\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u6216\u91CD\u542F\u5BBF\u4E3B\u8FDB\u7A0B")}).finally(()=>{w(!1)})},"onLocationChange"),me=t.setOnlineUpdate?V=>{t.getOnlineUpdateLocked?.()||(j(!0),l(V),t.setOnlineUpdate(V).catch(()=>{t.getOnlineUpdateEnabled&&l(t.getOnlineUpdateEnabled())}).finally(()=>{j(!1)}))}:void 0,le=t.setSidebarFavoriteStar?V=>{P(!0),y(V),t.setSidebarFavoriteStar(V).catch(()=>{t.getSidebarFavoriteStarEnabled&&y(t.getSidebarFavoriteStarEnabled())}).finally(()=>{P(!1)})}:void 0;return Fe(yr,{t:t.t,location:r,errorMessage:_,disabled:g,onLocationChange:B,onlineUpdateEnabled:s,onlineUpdateDisabled:D||u,onlineUpdateLocked:u,onToggleOnlineUpdate:me,sidebarFavoriteStarEnabled:C,sidebarFavoriteStarDisabled:U,onToggleSidebarFavoriteStar:le})}e(wr,"ArchiveBundleConfigCardWrapper");function Sr(t,r){if(Vs(),!t.locale)return{getLocation:e(()=>"settings","getLocation"),setLocation:e(async()=>"settings","setLocation"),isSettingsSectionEnabled:e(()=>!0,"isSettingsSectionEnabled"),isEnabled:e(()=>!1,"isEnabled"),isSupported:e(()=>!1,"isSupported"),setEnabled:e(async()=>!1,"setEnabled"),isOnlineUpdateEnabled:e(()=>!0,"isOnlineUpdateEnabled"),isOnlineUpdateLocked:e(()=>!1,"isOnlineUpdateLocked"),setOnlineUpdate:e(async()=>!1,"setOnlineUpdate"),isSidebarFavoriteStarEnabled:e(()=>!0,"isSidebarFavoriteStarEnabled"),setSidebarFavoriteStar:e(async()=>!1,"setSidebarFavoriteStar"),destroy:e(()=>{},"destroy")};let{callApi:i,renderPanel:s,ns:l}=r,u="settings",m=!1,C=!1,y=null,_=null,x=0,g=!1,w,D=new Set,j=e(()=>u==="both"||u==="sidebar","isSidebarEnabled"),U=e(()=>u==="both"||u==="settings","isSettingsSectionEnabled"),P=e(()=>{if(!g)for(let F of D)try{F()}catch{}},"notify"),B=e(()=>{if(g||!C||!j()||y)return;let F=t.slots.register({name:"main",key:br,locale:l,inject:e(()=>{let De=typeof r.injectProps=="function"?r.injectProps():{};return Object.assign({t:t.locale?.bind?t.locale.bind(l):void 0},De)},"inject")},De=>Fe("div",{className:"dsham_mainPanel"},s(De)));y=typeof F=="function"?F:()=>{}},"mountMain"),me=e(()=>{if(y){try{y()}catch{}y=null}},"unmountMain"),le=e(()=>{if(g||!m||!j()||_)return;let F=t.slots.register({name:"sidebar.panellist",id:br,order:hi,label:e(()=>t.locale.bind(l)("archives.title"),"label"),locale:l},De=>mi(De&&typeof De=="object"&&"size"in De?De:void 0));_=typeof F=="function"?F:()=>{}},"mountRow"),V=e(()=>{if(_){try{_()}catch{}_=null}},"unmountRow"),fe=e(()=>{if(!g)if(j())B(),le();else{if(w?.panelInfo&&typeof w.selectPanel=="function")try{w.panelInfo.getSnapshot().activePanelId===br&&w.selectPanel(null)}catch{}V(),me()}},"sync"),ue=e(async F=>{if(g)return u;let De=++x,T=u;if(u=F,fe(),P(),typeof r.onLocationChange=="function")try{r.onLocationChange(F)}catch{}try{return await i("/sidebar-entry",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({location:F})}),F}catch(he){if(De===x&&(u=T,fe(),P(),typeof r.onLocationChange=="function"))try{r.onLocationChange(T)}catch{}throw he}},"setLocation"),Qe=e(async F=>(await ue(F?"both":"settings"),j()),"setEnabled"),re=!0,X=!1,yt=0,St=e(async F=>{if(g||X)return re;let De=++yt;if(re=F,P(),typeof r.onOnlineUpdateChange=="function")try{r.onOnlineUpdateChange(F)}catch{}try{if(await i("/online-update",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:F})}),De===yt&&typeof r.onOnlineUpdateChange=="function")try{r.onOnlineUpdateChange(F)}catch{}return F}catch(T){if(De===yt&&(re=!F,P(),typeof r.onOnlineUpdateChange=="function"))try{r.onOnlineUpdateChange(!F)}catch{}throw T}},"setOnlineUpdate"),et=!0,dt=0,xt=e(async F=>{if(g)return et;let De=++dt;if(et=F,P(),typeof r.onSidebarFavoriteStarChange=="function")try{r.onSidebarFavoriteStarChange(F)}catch{}try{return await i("/sidebar-favorite-star",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:F})}),F}catch(T){if(De===dt&&(et=!F,P(),typeof r.onSidebarFavoriteStarChange=="function"))try{r.onSidebarFavoriteStarChange(!F)}catch{}throw T}},"setSidebarFavoriteStar"),$e=x;i("/sidebar-entry").then(F=>{if(!g&&x===$e&&F&&(F.location==="both"||F.location==="sidebar"||F.location==="settings"?u=F.location:typeof F.enabled=="boolean"&&(u=F.enabled?"both":"settings"),fe(),P(),typeof r.onLocationChange=="function"))try{r.onLocationChange(u)}catch{}}).catch(()=>{});let en=yt;i("/online-update").then(F=>{if(!g&&yt===en&&F&&typeof F.enabled=="boolean"&&(re=F.enabled,F.locked===!0&&(X=!0),P(),typeof r.onOnlineUpdateChange=="function"))try{r.onOnlineUpdateChange(re)}catch{}}).catch(()=>{});let tt=dt;i("/sidebar-favorite-star").then(F=>{if(!g&&dt===tt&&F&&typeof F.enabled=="boolean"&&(et=F.enabled,P(),typeof r.onSidebarFavoriteStarChange=="function"))try{r.onSidebarFavoriteStarChange(et)}catch{}}).catch(()=>{});let tn=t;return typeof tn.inject=="function"&&tn.inject(["layout"],F=>{!g&&F.layout&&(w=F.layout)}),t.slots.inject("main",()=>{if(!g)return C=!0,B(),()=>{C=!1,me()}}),t.slots.inject("sidebar.panellist",()=>{if(!g)return m=!0,le(),()=>{m=!1,V()}}),t.slots.inject("plugins.bundle.config",()=>{if(!g)return t.slots.register({name:"plugins.bundle.config",key:ui,locale:l},F=>F&&F.view==="summary"?null:Fe(wr,{t:t.locale.bind(l),getLocation:e(()=>u,"getLocation"),setLocation:ue,getEnabled:e(()=>j(),"getEnabled"),setSidebar:Qe,getOnlineUpdateEnabled:e(()=>re,"getOnlineUpdateEnabled"),setOnlineUpdate:St,getOnlineUpdateLocked:e(()=>X,"getOnlineUpdateLocked"),getSidebarFavoriteStarEnabled:e(()=>et,"getSidebarFavoriteStarEnabled"),setSidebarFavoriteStar:xt,subscribe:e(De=>(D.add(De),()=>{D.delete(De)}),"subscribe")}))}),{getLocation:e(()=>u,"getLocation"),setLocation:ue,isSettingsSectionEnabled:U,isEnabled:e(()=>j(),"isEnabled"),isSupported:e(()=>m,"isSupported"),setEnabled:Qe,isOnlineUpdateEnabled:e(()=>re,"isOnlineUpdateEnabled"),isOnlineUpdateLocked:e(()=>X,"isOnlineUpdateLocked"),setOnlineUpdate:St,isSidebarFavoriteStarEnabled:e(()=>et,"isSidebarFavoriteStarEnabled"),setSidebarFavoriteStar:xt,destroy:e(()=>{g||(g=!0,x++,yt++,dt++,w=void 0,D.clear(),V(),me())},"destroy")}}e(Sr,"setupSidebarEntry");function xr(t){if(typeof t!="string"||t.length===0||t.length>1024)throw new TypeError("\u4F1A\u8BDD ID \u957F\u5EA6\u987B\u4E3A 1\uFF5E1024 \u4E2A\u5B57\u7B26");return t}e(xr,"checkedId");var fi={parse(t){let r=ce(t);if(!r||typeof r!="object"||typeof r.favorite!="boolean")throw new TypeError("\u6536\u85CF\u72B6\u6001\u5FC5\u987B\u4E3A\u5E03\u5C14\u503C");return{sessionId:xr(r.sessionId),favorite:r.favorite}}},gi={parse(t){let r=ce(t);if(!r||!Array.isArray(r.favoriteSessionIds)||r.favoriteSessionIds.length>1e5)throw new TypeError("\u6536\u85CF\u96C6\u5408\u65E0\u6548");return{favoriteSessionIds:[...new Set(r.favoriteSessionIds.map(xr))]}},safeParse(t){try{return{success:!0,data:this.parse(t)}}catch(r){return{success:!1,error:r}}}};function $s(){let t=e((r,i)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${r}`,create:e(()=>i,"create"),schema:i}),"codec");return["favoriteSessions","setSessionFavorite"].map(r=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${r}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:r,invocation:{kind:"direct"},parameters:r==="favoriteSessions"?[]:[{name:"input",wire:"input",source:"json",codec:t("FavoriteInput",fi)}],result:t("FavoriteState",gi),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}e($s,"favoriteInvocations");function kr(t,{days:r,now:i=Date.now(),favorites:s=new Set,currentId:l,pending:u=new Map}){if(!t||!Number.isInteger(r)||r<1||r>36500||s.has(t.id)||t.id===l||(t.retainedBy?.mainView??0)>0||t.running||(t.runningSubagentCount??0)>0||t.pendingInteraction!=null||u.has(t.id))return!1;let m=typeof t.updatedAt=="number"?t.updatedAt:Date.parse(t.updatedAt??"");return Number.isFinite(m)&&m<=i-r*864e5}e(kr,"idleArchiveCandidate");async function Jn(t,r,{onProgress:i,refresh:s}={}){let l=[...new Set(t.map(xr))],u={requested:l,succeeded:[],skipped:[],failures:[],remaining:[],refreshError:null},m=e(()=>i?.({total:l.length,done:u.succeeded.length+u.skipped.length+u.failures.length,succeeded:u.succeeded.length,skipped:u.skipped.length,failed:u.failures.length}),"report");m();for(let C of l){try{(await r(C)?u.succeeded:u.skipped).push(C)}catch(y){u.failures.push({sessionId:C,message:y instanceof Error?y.message:String(y)}),u.remaining.push(C)}m()}try{await s?.()}catch(C){u.refreshError=C instanceof Error?C.message:String(C)}return u}e(Jn,"runSessionBatch");function Gs({workspaces:t,sessions:r,archive:i,restore:s,deleteOne:l,getFavorites:u,refresh:m,currentSessionId:C}){return async(y,_,x={})=>{if(!["archive","restore","undo","delete"].includes(y))throw new TypeError("\u672A\u77E5\u6279\u91CF\u64CD\u4F5C");return Jn(_,async g=>{let D=t.getSnapshot().archivedSessionIds.includes(g);if(y==="archive"){if(D||!r.getSnapshot().byId[g])return!1;if(x.idleDays!==void 0){let me=new Set((await u()).favoriteSessionIds),le=r.getSnapshot();if(!kr(le.byId[g],{days:x.idleDays,favorites:me,currentId:C(le),pending:x.getPending?.()??x.pending}))return!1}return await i(g),t.getSnapshot().archivedSessionIds.includes(g)}return D?y==="delete"?(await l(g),!0):!((await s(g))?.archivedSessionIds??t.getSnapshot().archivedSessionIds).includes(g):!1},{onProgress:x.onProgress,refresh:m})}}e(Gs,"createSessionOrganizer");function vi(t){return!t||t<=0?"0 B":t<1024?t+" B":t<1024*1024?(t/1024).toFixed(1)+" KB":(t/(1024*1024)).toFixed(1)+" MB"}e(vi,"formatBytes");function Ks(t,r){let i=t.createElement;function s(u,m){return i(r??(y=>i("button",{type:"button",disabled:y.disabled,onClick:y.onClick},y.children)),{variant:"outline",size:"sm",...m},u)}e(s,"textButton");function l({title:u,failures:m,separator:C}){let[y,_]=t.useState(!1),x=i("ul",null,m.map(g=>i("li",{key:g.sessionId},g.sessionId,C,g.message)));return i(Gn,{title:u,open:y,onToggle:e(()=>_(g=>!g),"onToggle")},x)}return e(l,"FailureDetails"),e(function({t:m,archived:C,busy:y,ready:_,days:x,onDays:g,count:w,onPreview:D,progress:j,result:U,onRetry:P,undoCount:B,onUndo:me,onReload:le,orphanCount:V=0,orphanSizeBytes:fe=0,orphanCleaning:ue=!1,onCleanOrphans:Qe,cacheCount:re=0,cacheRepair:X,onRebuildCaches:yt,onRetryCaches:St,onReloadCaches:et,onDismissCaches:dt}){return i(t.Fragment,null,i("style",null,".dsham_organizer,.dsham_batchFeedback{display:grid;gap:12px;margin:0 0 16px;padding:14px 16px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2)}.dsham_organizerControls{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.dsham_organizer label{display:inline-flex;align-items:center;gap:8px;font-size:13px;color:var(--dsw-alias-label-primary)}.dsham_number{width:88px;height:32px;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px}.dsham_number:hover{border-color:var(--dsw-alias-border-l3)}.dsham_number:focus{outline:none;border-color:var(--dsw-alias-state-business-primary)}.dsham_disclosure{display:inline-flex;align-items:center;gap:6px;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;cursor:pointer}.dsham_foldChevron{transition:transform 150ms ease}.dsham_foldChevron.is-open{transform:rotate(180deg)}.dsham_organizer p,.dsham_batchFeedback p{margin:0;font-size:12px;color:var(--dsw-alias-label-secondary)}.dsham_batchFeedback progress{width:100%}.dsham_batchFeedback details{font-size:12px;overflow-wrap:anywhere}.dsham_archivePreview{max-height:260px;overflow:auto;display:grid;gap:8px;padding:8px 0}.dsham_archivePreview label{display:flex;gap:8px;align-items:center;overflow-wrap:anywhere}"),(!C||!_)&&i("div",{className:"dsham_organizer"},i("div",{className:"dsham_organizerControls"},!_&&s(m("organizer.reloadFavorites"),{disabled:y,onClick:le}),!C&&i(t.Fragment,null,i("label",null,m("organizer.idleDays"),i(ms,{min:1,max:36500,value:x===""?null:Number(x),disabled:y,"aria-label":m("organizer.idleDays"),onChange:e(xt=>g(xt==null?"":String(xt)),"onChange")})),s(m("organizer.preview",{n:w}),{disabled:y||!_||w===0,onClick:D}))),!C&&i("p",null,m("organizer.rules"))),V>0&&i("div",{className:"dsham_organizer"},i("div",{className:"dsham_organizerControls"},i("strong",null,m("organizer.orphanTitle",{n:V})),Qe&&s(m(ue?"organizer.cleaning":"organizer.cleanOrphans"),{disabled:y||ue,onClick:Qe})),i("p",null,m("organizer.orphanDesc",{size:vi(fe)}))),re>0&&i("div",{className:"dsham_organizer"},i("div",{className:"dsham_organizerControls"},i("strong",null,m("organizer.cacheTitle",{n:re})),yt&&s(m(X?.busy?"organizer.cacheRebuilding":"organizer.cacheRebuild"),{disabled:y||X?.busy,onClick:yt})),i("p",null,m("organizer.cacheDesc"))),X&&(X.result||X.progress||X.error||X.refreshError)&&i("section",{className:"dsham_batchFeedback","aria-label":m("organizer.cacheRebuild")},X.progress&&i("div",{role:"status"},i("progress",{value:X.progress.done,max:Math.max(1,X.progress.total)}),m("organizer.progressCount",X.progress)),X.result&&i("div",{role:"status"},i("p",null,m("organizer.result",{succeeded:X.result.rebuiltSessionIds.length,skipped:X.result.skippedSessionIds.length,failed:X.result.failures.length})),X.result.failures.length>0&&i(l,{title:m("organizer.failureDetails"),failures:X.result.failures,separator:m("common.separator")}),X.result.failures.length>0&&St&&s(m("organizer.cacheRetry",{n:X.result.failures.length}),{disabled:y||X.busy,onClick:St})),X.error&&i("p",{role:"alert"},m("organizer.cacheError",{detail:X.error})),X.refreshError&&i("p",{role:"alert"},m("organizer.refreshError",{detail:X.refreshError})),i("div",{className:"dsham_organizerControls"},et&&s(m("organizer.cacheCheck"),{disabled:y||X.busy,onClick:et}),dt&&s(m("organizer.dismiss"),{disabled:y||X.busy,onClick:dt}))),(j||U||B>0)&&i("section",{className:"dsham_batchFeedback","aria-label":m("organizer.feedback")},j&&i("div",{role:"status","aria-live":"polite"},i("progress",{value:j.done,max:Math.max(1,j.total),"aria-label":m("organizer.progress")}),m("organizer.progressCount",{done:j.done,total:j.total})),U&&i("div",{role:"status"},i("strong",null,m(`organizer.${U.kind??"archive"}Result`)),i("p",null,m("organizer.result",{succeeded:U.succeeded.length,skipped:U.skipped.length,failed:U.failures.length})),U.failures.length>0&&i(l,{title:m("organizer.failureDetails"),failures:U.failures,separator:m("common.separator")}),U.refreshError&&i("p",{role:"alert"},m("organizer.refreshError",{detail:U.refreshError})),U.remaining.length>0&&s(m("organizer.retry",{n:U.remaining.length}),{disabled:y,onClick:P})),B>0&&i("div",{className:"dsham_organizerControls"},s(m("organizer.undo",{n:B}),{disabled:y,onClick:me}),i("p",null,m("organizer.undoHint")))))},"OrganizerPanel")}e(Ks,"createOrganizerPanel");var Ys={"organizer.cacheTitle":"\u53D1\u73B0 {n} \u4E2A\u4F1A\u8BDD\u7F3A\u5C11\u53EF\u7528\u5217\u8868\u7F13\u5B58","organizer.cacheDesc":"\u68C0\u67E5\u5DE5\u4F5C\u533A\u3001\u672A\u5206\u7EC4\u53CA\u5F52\u6863\u666E\u901A\u4F1A\u8BDD\u7684\u5934\u90E8\u4E0E\u5B98\u65B9\u7F13\u5B58\u3002\u70B9\u51FB\u540E\u9010\u6761\u53EA\u8BFB\u65E5\u5FD7\u5E76\u91CD\u5EFA\u5B98\u65B9\u5217\u8868\u7F13\u5B58\uFF1B\u8DF3\u8FC7\u6D3B\u52A8\u4F1A\u8BDD\uFF0C\u4E0D\u6253\u5F00\u4F1A\u8BDD\u3001\u4E0D\u8C03\u7528\u6A21\u578B\uFF0C\u4E5F\u4E0D\u6539\u53D8\u5F52\u6863\u6216\u5B9A\u65F6\u4EFB\u52A1\u3002\u8D85\u65F6\u8868\u793A\u4FDD\u5B58\u672A\u786E\u8BA4\uFF0C\u53EF\u91CD\u8BD5\u3002","organizer.cacheRebuild":"\u91CD\u5EFA\u5217\u8868\u7F13\u5B58","organizer.cacheRebuilding":"\u91CD\u5EFA\u4E2D\u2026","organizer.cacheRetry":"\u91CD\u8BD5\u5931\u8D25 {n} \u6761","organizer.cacheCheck":"\u5237\u65B0\u5217\u8868\u5E76\u91CD\u65B0\u68C0\u6D4B","organizer.cacheError":"\u7F13\u5B58\u68C0\u6D4B\u5931\u8D25\uFF1A{detail}","organizer.dismiss":"\u5B8C\u6210","organizer.feedback":"\u64CD\u4F5C\u53CD\u9988","organizer.allSessions":"\u5168\u90E8\u4F1A\u8BDD","organizer.favoriteFilter":"\u6536\u85CF\u7B5B\u9009","organizer.archiveResult":"\u5F52\u6863\u7ED3\u679C","organizer.restoreResult":"\u6062\u590D\u7ED3\u679C","organizer.deleteResult":"\u5220\u9664\u7ED3\u679C","organizer.undoResult":"\u64A4\u56DE\u7ED3\u679C","organizer.favorite":"\u6536\u85CF","organizer.unfavorite":"\u53D6\u6D88\u6536\u85CF","organizer.favoritesOnly":"\u53EA\u770B\u6536\u85CF","organizer.reloadFavorites":"\u91CD\u65B0\u52A0\u8F7D\u6536\u85CF","organizer.idleDays":"\u95F2\u7F6E\u5929\u6570","organizer.preview":"\u9884\u89C8\u95F2\u7F6E\u5F52\u6863\uFF08{n}\uFF09","organizer.rules":"\u6309\u6700\u540E\u6D3B\u52A8\u65F6\u95F4\u7B5B\u9009\uFF0C\u9075\u5FAA\u5F53\u524D\u5217\u8868\u7B5B\u9009\u6761\u4EF6\uFF1B\u6392\u9664\u6536\u85CF\u3001\u5F53\u524D\u6253\u5F00\u3001\u6B63\u5728\u6267\u884C\u53CA\u7B49\u5F85\u4EA4\u4E92\u7684\u4F1A\u8BDD\u3002","organizer.progress":"\u6279\u91CF\u64CD\u4F5C\u8FDB\u5EA6","organizer.progressCount":"\u5DF2\u5904\u7406 {done} / {total}","organizer.result":"\u6210\u529F {succeeded} \xB7 \u8DF3\u8FC7 {skipped} \xB7 \u5931\u8D25 {failed}","organizer.failureDetails":"\u67E5\u770B\u5931\u8D25\u8BE6\u60C5","organizer.refreshError":"\u64CD\u4F5C\u7ED3\u679C\u5DF2\u4FDD\u7559\uFF0C\u4F46\u5217\u8868\u5237\u65B0\u5931\u8D25\uFF1A{detail}","organizer.retry":"\u91CD\u8BD5\u5269\u4F59 {n} \u6761","organizer.undo":"\u64A4\u56DE\u672C\u6B21\u5F52\u6863\uFF08{n}\uFF09","organizer.undoHint":"\u4EC5\u4FDD\u7559\u672C\u6B21\u6253\u5F00\u7BA1\u7406\u9875\u671F\u95F4\u6700\u8FD1\u4E00\u6279\u5F52\u6863\uFF1B\u5173\u95ED\u9875\u9762\u6216\u5237\u65B0\u540E\u6E05\u9664\u3002\u64A4\u56DE\u4E0D\u4F1A\u6062\u590D\u5DF2\u5220\u9664\u7684\u4F1A\u8BDD\u3002","organizer.idleConfirm":"\u8BF7\u68C0\u67E5\u4EE5\u4E0B\u5019\u9009\uFF0C\u53EF\u53D6\u6D88\u52FE\u9009\uFF1B\u6267\u884C\u524D\u518D\u6B21\u6392\u9664\u6536\u85CF\u53CA\u6D3B\u8DC3\u4F1A\u8BDD\u3002","organizer.manualConfirm":"\u4EC5\u5F52\u6863\u4EE5\u4E0B\u52FE\u9009\u4F1A\u8BDD\uFF1B\u53EF\u9010\u6761\u53D6\u6D88\u3002\u5F52\u6863\u540E\u53EF\u64A4\u56DE\u672C\u6279\u64CD\u4F5C\u3002","organizer.orphanTitle":"\u53D1\u73B0 {n} \u4E2A\u65E0\u4E3B\u5B64\u513F\u5B50\u4EE3\u7406","organizer.orphanDesc":"\u6BCD\u4F1A\u8BDD\u5DF2\u88AB\u5916\u90E8\u5220\u9664\uFF0C\u8FD9\u4E9B\u5B50\u4EE3\u7406\u5728\u65E5\u5E38\u804A\u5929\u5217\u8868\u4E2D\u4E0D\u53EF\u89C1\uFF0C\u5171\u5360\u7528\u7EA6 {size} \u78C1\u76D8\u7A7A\u95F4\u3002\u6E05\u7406\u4E0D\u53EF\u64A4\u9500\u3002","organizer.cleanOrphans":"\u6E05\u7406\u5168\u90E8\u5B64\u513F","organizer.cleaning":"\u6E05\u7406\u4E2D\u2026","organizer.orphanCleanSuccess":"\u5DF2\u6210\u529F\u6E05\u7406 {n} \u4E2A\u65E0\u4E3B\u5B50\u4EE3\u7406\u4F1A\u8BDD\u3002"},Zs={"organizer.cacheTitle":"Found {n} sessions without usable list caches","organizer.cacheDesc":"Checks headers and official caches for workspace, ungrouped, and archived ordinary sessions. On click, reads logs one at a time and rebuilds official caches. Skips active sessions; never opens sessions, calls models or changes archives or schedules. Timeout means persistence is unconfirmed and can be retried.","organizer.cacheRebuild":"Rebuild list caches","organizer.cacheRebuilding":"Rebuilding\u2026","organizer.cacheRetry":"Retry {n} failed","organizer.cacheCheck":"Refresh lists and check again","organizer.cacheError":"Cache check failed: {detail}","organizer.dismiss":"Done","organizer.feedback":"Operation feedback","organizer.allSessions":"All sessions","organizer.favoriteFilter":"Favorites filter","organizer.archiveResult":"Archive results","organizer.restoreResult":"Restore results","organizer.deleteResult":"Delete results","organizer.undoResult":"Undo results","organizer.favorite":"Favorite","organizer.unfavorite":"Unfavorite","organizer.favoritesOnly":"Favorites only","organizer.reloadFavorites":"Reload favorites","organizer.idleDays":"Idle days","organizer.preview":"Preview idle archives ({n})","organizer.rules":"Uses last activity, the current list filters. Excludes favorites, open, running and waiting sessions.","organizer.progress":"Batch progress","organizer.progressCount":"Processed {done} / {total}","organizer.result":"Succeeded {succeeded} \xB7 Skipped {skipped} \xB7 Failed {failed}","organizer.failureDetails":"Failure details","organizer.refreshError":"Results retained, but refresh failed: {detail}","organizer.retry":"Retry remaining {n}","organizer.undo":"Undo this archive batch ({n})","organizer.undoHint":"Only the latest archive batch while this page is open is retained. Closing or refreshing clears undo. Deleted sessions cannot be restored.","organizer.idleConfirm":"Review and deselect candidates. Favorites and active sessions are checked again before archiving.","organizer.manualConfirm":"Only checked sessions below will be archived. You can undo this batch afterward.","organizer.orphanTitle":"Found {n} orphan subagents","organizer.orphanDesc":"Parent sessions were deleted externally. These subagents are hidden from normal chat lists and occupy ~{size} disk space. Removal cannot be undone.","organizer.cleanOrphans":"Clean up all orphans","organizer.cleaning":"Cleaning up\u2026","organizer.orphanCleanSuccess":"Successfully cleaned up {n} orphan subagent sessions."},Js={"organizer.cacheTitle":"\u041D\u0430\u0439\u0434\u0435\u043D\u043E {n} \u0441\u0435\u0441\u0441\u0438\u0439 \u0431\u0435\u0437 \u043F\u0440\u0438\u0433\u043E\u0434\u043D\u043E\u0433\u043E \u043A\u0435\u0448\u0430 \u0441\u043F\u0438\u0441\u043A\u0430","organizer.cacheDesc":"\u041F\u0440\u043E\u0432\u0435\u0440\u044F\u044E\u0442\u0441\u044F \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0438 \u0438 \u043E\u0444\u0438\u0446\u0438\u0430\u043B\u044C\u043D\u044B\u0439 \u043A\u0435\u0448 \u0441\u0435\u0441\u0441\u0438\u0439 \u0440\u0430\u0431\u043E\u0447\u0438\u0445 \u043E\u0431\u043B\u0430\u0441\u0442\u0435\u0439, \u0431\u0435\u0437 \u0433\u0440\u0443\u043F\u043F\u044B \u0438 \u0430\u0440\u0445\u0438\u0432\u0430. \u041F\u043E \u043D\u0430\u0436\u0430\u0442\u0438\u044E \u0436\u0443\u0440\u043D\u0430\u043B\u044B \u0447\u0438\u0442\u0430\u044E\u0442\u0441\u044F \u043F\u043E \u043E\u0434\u043D\u043E\u043C\u0443 \u0434\u043B\u044F \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F \u043E\u0444\u0438\u0446\u0438\u0430\u043B\u044C\u043D\u043E\u0433\u043E \u043A\u0435\u0448\u0430. \u0410\u043A\u0442\u0438\u0432\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u043F\u0440\u043E\u043F\u0443\u0441\u043A\u0430\u044E\u0442\u0441\u044F; \u0441\u0435\u0441\u0441\u0438\u0438 \u043D\u0435 \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u044E\u0442\u0441\u044F, \u043C\u043E\u0434\u0435\u043B\u0438 \u043D\u0435 \u0432\u044B\u0437\u044B\u0432\u0430\u044E\u0442\u0441\u044F, \u0430\u0440\u0445\u0438\u0432\u044B \u0438 \u0440\u0430\u0441\u043F\u0438\u0441\u0430\u043D\u0438\u044F \u043D\u0435 \u043C\u0435\u043D\u044F\u044E\u0442\u0441\u044F. \u0422\u0430\u0439\u043C-\u0430\u0443\u0442 \u043E\u0437\u043D\u0430\u0447\u0430\u0435\u0442 \u043D\u0435\u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0451\u043D\u043D\u043E\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435; \u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u043F\u043E\u0432\u0442\u043E\u0440.","organizer.cacheRebuild":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u043A\u0435\u0448 \u0441\u043F\u0438\u0441\u043A\u043E\u0432","organizer.cacheRebuilding":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435\u2026","organizer.cacheRetry":"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C {n} \u043E\u0448\u0438\u0431\u043E\u043A","organizer.cacheCheck":"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u043F\u0438\u0441\u043A\u0438 \u0438 \u043F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C","organizer.cacheError":"\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 \u043A\u0435\u0448\u0430: {detail}","organizer.dismiss":"\u0413\u043E\u0442\u043E\u0432\u043E","organizer.feedback":"\u041E\u0442\u0437\u044B\u0432 \u043E\u0431 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438","organizer.allSessions":"\u0412\u0441\u0435 \u0441\u0435\u0441\u0441\u0438\u0438","organizer.favoriteFilter":"\u0424\u0438\u043B\u044C\u0442\u0440 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E","organizer.archiveResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438","organizer.restoreResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F","organizer.deleteResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u044F","organizer.undoResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u043E\u0442\u043C\u0435\u043D\u044B","organizer.favorite":"\u0412 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435","organizer.unfavorite":"\u0423\u0431\u0440\u0430\u0442\u044C \u0438\u0437 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E","organizer.favoritesOnly":"\u0422\u043E\u043B\u044C\u043A\u043E \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435","organizer.reloadFavorites":"\u041F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435","organizer.idleDays":"\u0414\u043D\u0438 \u043F\u0440\u043E\u0441\u0442\u043E\u044F","organizer.preview":"\u041F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0430\u0440\u0445\u0438\u0432\u0430 \u043F\u0440\u043E\u0441\u0442\u043E\u044F ({n})","organizer.rules":"\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u044E\u044E \u0430\u043A\u0442\u0438\u0432\u043D\u043E\u0441\u0442\u044C \u0438 \u0442\u0435\u043A\u0443\u0449\u0438\u0435 \u0444\u0438\u043B\u044C\u0442\u0440\u044B \u0441\u043F\u0438\u0441\u043A\u0430. \u0418\u0441\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435, \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u0435, \u0437\u0430\u043F\u0443\u0449\u0435\u043D\u043D\u044B\u0435 \u0438 \u043E\u0436\u0438\u0434\u0430\u044E\u0449\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438.","organizer.progress":"\u0425\u043E\u0434 \u043F\u0430\u043A\u0435\u0442\u043D\u043E\u0439 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438","organizer.progressCount":"\u041E\u0431\u0440\u0430\u0431\u043E\u0442\u0430\u043D\u043E {done} / {total}","organizer.result":"\u0423\u0441\u043F\u0435\u0448\u043D\u043E {succeeded} \xB7 \u041F\u0440\u043E\u043F\u0443\u0449\u0435\u043D\u043E {skipped} \xB7 \u041E\u0448\u0438\u0431\u043E\u043A {failed}","organizer.failureDetails":"\u041F\u043E\u0434\u0440\u043E\u0431\u043D\u043E\u0441\u0442\u0438 \u043E\u0448\u0438\u0431\u043E\u043A","organizer.refreshError":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u044B, \u043D\u043E \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u043F\u0438\u0441\u043A\u0430 \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C: {detail}","organizer.retry":"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C \u043E\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044F {n}","organizer.undo":"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u044D\u0442\u0443 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044E ({n})","organizer.undoHint":"\u0421\u043E\u0445\u0440\u0430\u043D\u044F\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u044F\u044F \u043F\u0430\u043A\u0435\u0442\u043D\u0430\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F, \u043F\u043E\u043A\u0430 \u043E\u0442\u043A\u0440\u044B\u0442\u0430 \u044D\u0442\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430. \u0417\u0430\u043A\u0440\u044B\u0442\u0438\u0435 \u0438\u043B\u0438 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u0431\u0440\u0430\u0441\u044B\u0432\u0430\u0435\u0442 \u043E\u0442\u043C\u0435\u043D\u0443. \u0423\u0434\u0430\u043B\u0451\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u043D\u0435\u043B\u044C\u0437\u044F.","organizer.idleConfirm":"\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u043A\u0430\u043D\u0434\u0438\u0434\u0430\u0442\u043E\u0432, \u043C\u043E\u0436\u043D\u043E \u0441\u043D\u044F\u0442\u044C \u043E\u0442\u043C\u0435\u0442\u043A\u0443. \u041F\u0435\u0440\u0435\u0434 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0435\u0439 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435 \u0438 \u0430\u043A\u0442\u0438\u0432\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u043F\u0440\u043E\u0432\u0435\u0440\u044F\u044E\u0442\u0441\u044F \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E.","organizer.manualConfirm":"\u0411\u0443\u0434\u0443\u0442 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u044B \u0442\u043E\u043B\u044C\u043A\u043E \u043E\u0442\u043C\u0435\u0447\u0435\u043D\u043D\u044B\u0435 \u043D\u0438\u0436\u0435 \u0441\u0435\u0441\u0441\u0438\u0438. \u042D\u0442\u0443 \u043F\u0430\u043A\u0435\u0442\u043D\u0443\u044E \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u044E \u043C\u043E\u0436\u043D\u043E \u043E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u043F\u043E\u0437\u0436\u0435.","organizer.orphanTitle":"\u041D\u0430\u0439\u0434\u0435\u043D\u043E {n} \u043E\u0441\u0438\u0440\u043E\u0442\u0435\u0432\u0448\u0438\u0445 \u043F\u043E\u0434\u0430\u0433\u0435\u043D\u0442\u043E\u0432","organizer.orphanDesc":"\u0420\u043E\u0434\u0438\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u0431\u044B\u043B\u0438 \u0443\u0434\u0430\u043B\u0435\u043D\u044B \u0438\u0437\u0432\u043D\u0435. \u041F\u043E\u0434\u0430\u0433\u0435\u043D\u0442\u044B \u0441\u043A\u0440\u044B\u0442\u044B \u0438\u0437 \u043E\u0431\u044B\u0447\u043D\u044B\u0445 \u0441\u043F\u0438\u0441\u043A\u043E\u0432 \u0447\u0430\u0442\u043E\u0432 \u0438 \u0437\u0430\u043D\u0438\u043C\u0430\u044E\u0442 ~{size} \u0434\u0438\u0441\u043A\u043E\u0432\u043E\u0433\u043E \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430. \u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","organizer.cleanOrphans":"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0432\u0441\u0435\u0445 \u0441\u0438\u0440\u043E\u0442","organizer.cleaning":"\u041E\u0447\u0438\u0441\u0442\u043A\u0430\u2026","organizer.orphanCleanSuccess":"\u0423\u0441\u043F\u0435\u0448\u043D\u043E \u043E\u0447\u0438\u0449\u0435\u043D\u043E {n} \u043E\u0441\u0438\u0440\u043E\u0442\u0435\u0432\u0448\u0438\u0445 \u043F\u043E\u0434\u0430\u0433\u0435\u043D\u0442\u043E\u0432."};var gn=Function("return globalThis.__dshArchiveReactDOM")(),Xs=Function("return globalThis.__dshArchiveReactDOMClient")(),Qs=gn.createPortal,Fo=gn.flushSync,Ho=Xs?.createRoot,Bo=Xs?.hydrateRoot,Uo=gn.findDOMNode,Wo=gn.unmountComponentAtNode,qo=gn.unstable_batchedUpdates,Vo=gn.version;function bi(t){var r={exports:{}},i=r.exports;Object.defineProperty(i,Symbol.toStringTag,{value:"Module"});let s=t("react/jsx-runtime"),l=t("react"),u=t("@deepseek-ai/dsh-client-ui-primitives");function m(n){try{return typeof n("contextMenus")?.register=="function"}catch{return!1}}e(m,"hasNativeContextMenuService");function C(){let n=u;return!!(n?.MenuSurface&&n?.MenuItemButton)}e(C,"hasMoveMenuPrimitives");function y(n,a){return n.filter(o=>!o.sessionIds?.includes(a))}e(y,"movableWorkspaces");function _({open:n,onClose:a,title:o,description:h,footer:v,children:f,className:k,width:E,portalToBody:N=!1,closeLabel:H,t:A}){let z=l.useRef(null),O=l.useCallback(()=>z.current?.closest(".dsham_settings")??document.body,[]),[d,oe]=l.useState(null);l.useEffect(()=>{if(!n){oe(null);return}oe(N?typeof document<"u"?document.body:null:O())},[n,O,N]),l.useEffect(()=>{if(!n)return;let kt=e(ut=>{ut.key==="Escape"&&(ut.preventDefault(),ut.stopPropagation(),"stopImmediatePropagation"in ut&&typeof ut.stopImmediatePropagation=="function"&&ut.stopImmediatePropagation(),a())},"onKey");return window.addEventListener("keydown",kt,!0),()=>window.removeEventListener("keydown",kt,!0)},[n,a]);let Re=H||A("common.close"),pe=(0,s.jsxs)("div",{className:"dsham_modalRoot",role:"presentation",children:[(0,s.jsx)("div",{className:"dsham_modalMask",onClick:a}),(0,s.jsxs)("div",{role:"dialog","aria-modal":!0,"aria-label":typeof o=="string"?o:void 0,className:aa("dsham_modalDialog",k),style:{width:E??560},children:[(0,s.jsxs)("div",{className:"dsham_modalHeader",children:[(0,s.jsx)("h2",{title:typeof o=="string"?o:void 0,children:o}),(0,s.jsx)("button",{type:"button",className:"dsham_modalClose",onClick:a,"aria-label":Re,title:Re,children:(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:14,height:14,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round","aria-hidden":"true",children:(0,s.jsx)("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]}),h!=null&&(0,s.jsx)("p",{children:h}),f!=null&&(0,s.jsx)("div",{className:"dsham_modalBody",children:f}),v!=null&&(0,s.jsx)("div",{className:"dsham_modalFooter",children:v})]})]});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(x,{refObject:z,getContainer:O}),n&&d?Qs(pe,d):null]})}e(_,"SettingsModal");function x({refObject:n,getContainer:a}){return(0,s.jsx)("span",{hidden:!0,ref:n,"data-get-container":a})}e(x,"SettingsModalAnchor");function g({variant:n="outline",icon:a,children:o,className:h,disabled:v,title:f,onClick:k,"aria-label":E,"aria-pressed":N,"aria-expanded":H,"aria-haspopup":A}){return(0,s.jsx)(u.Button,{variant:n,size:"sm",className:h,disabled:v,title:f,onClick:k,"aria-label":E,"aria-pressed":N,"aria-expanded":H,"aria-haspopup":A,icon:a,children:o})}e(g,"settingsButton");function w({variant:n="outline",danger:a=!1,disabled:o,onClick:h,children:v}){return(0,s.jsx)(u.Button,{variant:a?"outline":n,className:a?"dsham_btnDanger":void 0,disabled:o,onClick:h,children:v})}e(w,"modalFooterButton");function D(n,a){let o={className:n?"dsham_archiveTabsLocked":void 0,children:a};return n&&(o.inert=""),o}e(D,"tabsShell");let j=Ks(l,u.Button),{HighlightedText:U,useArchiveSearch:P,useArchivePreview:B,DiscoveryFilters:me,SearchStatus:le,PreviewContent:V}=Cs(l,{Button:u.Button,SegmentedControl:u.SegmentedControl}),fe={refresh:["M13.5 5.5V2.5m0 0h-3m3 0-2.1 2.1A5.5 5.5 0 1 0 13.2 12"],download:["M8 2v8m0 0 3-3m-3 3-3-3M3 13v2h10v-2"],copy:["M5 5h8v8H5z","M3 3h8"],close:["m4 4 8 8M12 4 4 12"]};function ue(n){let a=document.createElement("span"),o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("viewBox","0 0 16 16"),o.setAttribute("width","16"),o.setAttribute("height","16"),o.setAttribute("fill","none"),o.setAttribute("stroke","currentColor"),o.setAttribute("stroke-width","1.5"),o.setAttribute("stroke-linecap","round"),o.setAttribute("stroke-linejoin","round"),o.setAttribute("aria-hidden","true");for(let h of fe[n]){let v=document.createElementNS("http://www.w3.org/2000/svg","path");v.setAttribute("d",h),o.append(v)}return a.append(o),a}e(ue,"createPluginUpdateIcon");let Qe={parse(n){if(typeof n!="string"||n.length===0)throw new TypeError(`sessionId must be a non-empty string, got ${String(n)}`);return n}},re={parse(n){let a=ce(n);if(typeof a!="object"||a===null||Array.isArray(a))throw new TypeError("result must be an object");let o=a.archivedSessionIds;if(!Array.isArray(o)||o.some(h=>typeof h!="string"))throw new TypeError("archivedSessionIds must be a string array");return a}},X={parse(n){let a=ce(n);if(typeof a!="object"||a===null||Array.isArray(a)||a.deleted!==!0)throw new TypeError("deleted must be true");return a}},yt={parse(n){let a=ce(n);if(typeof a!="object"||a===null||Array.isArray(a))throw new TypeError("target must be an object");if(a.scope==="all"||a.scope==="ungrouped"||a.scope==="workspace"&&typeof a.workspaceId=="string"&&a.workspaceId.length>0||a.scope==="sessions"&&Array.isArray(a.sessionIds)&&a.sessionIds.length>0&&a.sessionIds.every(o=>typeof o=="string"&&o.length>0))return a;throw new TypeError("target.scope must be all, ungrouped, workspace with a non-empty workspaceId, or sessions with non-empty sessionIds")}},St={parse(n){let a=ce(n);if(typeof a!="object"||a===null||Array.isArray(a))throw new TypeError("result must be an object");for(let o of["requestedSessionIds","deletedSessionIds","skippedSessionIds"])if(!Array.isArray(a[o])||a[o].some(h=>typeof h!="string"))throw new TypeError(`${o} must be a string array`);if(!Array.isArray(a.failures)||a.failures.some(o=>typeof o!="object"||o===null||typeof o.sessionId!="string"||typeof o.message!="string"))throw new TypeError("failures must contain sessionId/message objects");return a}},et={parse(n){let a=ce(n);if(typeof a!="object"||a===null||Array.isArray(a)||!Array.isArray(a.items))throw new TypeError("result.items must be an array");if(a.items.some(o=>typeof o!="object"||o===null||typeof o.sessionId!="string"||typeof o.createdAt!="number"||!Number.isFinite(o.createdAt)))throw new TypeError("items must contain sessionId/createdAt objects");return a}},dt={parse(n){let a=ce(n);if(!a||typeof a.sessionId!="string"||!a.sessionId||typeof a.targetWorkspaceId!="string"||!a.targetWorkspaceId)throw new TypeError("sessionId and targetWorkspaceId must be non-empty strings");return{sessionId:a.sessionId,targetWorkspaceId:a.targetWorkspaceId}}},xt={parse(n){let a=ce(n);if(!a||a.ok!==!0)throw new TypeError("session move result must be ok: true");return a}};function $e(n,a){return{mode:"strict",typeSymbol:n,create:e(()=>a,"create"),schema:a}}e($e,"strictCodec");let en={package:"@michengai/dsh-archive-manager",descriptors:[...$s(),...ws(),...Rs(),{id:"@michengai/dsh-archive-manager#workspaceRegistry/unarchiveSession",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"unarchiveSession",invocation:{kind:"direct"},parameters:[{name:"sessionId",wire:"sessionId",source:"json",codec:$e("@deepseek-ai/dsh-session/types#SessionId",Qe)}],result:$e("@michengai/dsh-archive-manager/types#ArchivedSessionIds",re),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/deleteSession",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"deleteSession",invocation:{kind:"direct"},parameters:[{name:"sessionId",wire:"sessionId",source:"json",codec:$e("@deepseek-ai/dsh-session/types#SessionId",Qe)}],result:$e("@michengai/dsh-archive-manager/types#Deleted",X),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/deleteArchivedSessions",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"deleteArchivedSessions",invocation:{kind:"direct"},parameters:[{name:"target",wire:"target",source:"json",codec:$e("@michengai/dsh-archive-manager/types#ArchivedBatchTarget",yt)}],result:$e("@michengai/dsh-archive-manager/types#DeletedBatch",St),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/archivedSessionMetadata",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"archivedSessionMetadata",invocation:{kind:"direct"},parameters:[],result:$e("@michengai/dsh-archive-manager/types#ArchivedSessionMetadata",et),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/diagnoseOrphanSubagents",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"diagnoseOrphanSubagents",invocation:{kind:"direct"},parameters:[],result:$e("@michengai/dsh-archive-manager/types#OrphanSubagentDiagnosis",{parse(n){let a=ce(n);if(!a||typeof a.count!="number"||!Array.isArray(a.items)||typeof a.totalSizeBytes!="number")throw new TypeError("invalid orphan subagent diagnosis");return a}}),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/cleanOrphanSubagents",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"cleanOrphanSubagents",invocation:{kind:"direct"},parameters:[{name:"target",wire:"target",source:"json",acceptsUndefined:!0,codec:$e("@michengai/dsh-archive-manager/types#CleanOrphanTarget",{parse(n){if(n==null)return{};let a=ce(n);if(!a)throw new TypeError("target must be an object");if(a.sessionIds!==void 0&&(!Array.isArray(a.sessionIds)||a.sessionIds.some(o=>typeof o!="string")))throw new TypeError("sessionIds must be an array of strings");return a}})}],result:$e("@michengai/dsh-archive-manager/types#CleanOrphanResult",{parse(n){let a=ce(n);if(!a||!Array.isArray(a.cleanedSessionIds)||!Array.isArray(a.skippedSessionIds)||!Array.isArray(a.failures))throw new TypeError("invalid orphan subagent clean result");return a}}),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/moveSessionToWorkspace",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"moveSessionToWorkspace",invocation:{kind:"direct"},parameters:[{name:"input",wire:"input",source:"json",codec:$e("@michengai/dsh-archive-manager/types#SessionMoveInput",dt)}],result:$e("@michengai/dsh-archive-manager/types#SessionMoveResult",xt),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}]};function tt(n,a){if(typeof document>"u"||document.querySelector("style[data-plugin-css="+JSON.stringify(n)+"]")!==null)return;let o=document.createElement("style");o.dataset.plugin="@michengai/dsh-archive-manager",o.dataset.pluginCss=n,o.textContent=a,document.head.appendChild(o)}e(tt,"ensurePluginStyle");function tn(n){if(typeof document>"u")return;document.querySelector("style[data-plugin-css="+JSON.stringify(n)+"]")?.remove()}e(tn,"removePluginStyle"),tt("dsh-archive-manager/DangerButton.css",".dsham_btnDanger:not(:disabled){color:var(--dsw-alias-state-error-primary,#ef7272);border-color:var(--dsw-alias-state-error-primary,#ef7272)}"),tt("dsh-archive-manager/IconAction.css",".dsham_iconAction{display:inline-flex!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important;width:22px!important;min-width:22px!important;height:22px!important;padding:0!important;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px)!important;background:transparent;color:var(--dsw-alias-label-secondary)}.dsham_iconAction:not(:disabled):hover{color:var(--dsw-alias-link,#4176e6)!important;border-color:var(--dsw-alias-link,#4176e6)!important}.dsham_iconAction.dsham_iconDanger{color:var(--dsw-alias-state-error-primary,#ef7272)!important;border-color:var(--dsw-alias-state-error-primary,#ef7272)!important}.dsham_iconAction.dsham_iconDanger:not(:disabled):hover{color:var(--dsw-alias-state-error-primary,#ef7272)!important;border-color:var(--dsw-alias-state-error-primary,#ef7272)!important}.dsham_iconAction svg{width:16px!important;height:16px!important;flex:none!important}"),tt("dsh-archive-manager/Modal.css",".dsham_modalRoot{position:fixed;inset:0;z-index:1200;display:grid;place-items:center;padding:24px}.dsham_modalMask{position:absolute;inset:0;background:var(--dsw-alias-bg-mask-1,rgb(0 0 0 / 45%));backdrop-filter:var(--dsw-mask-blur,blur(16px));-webkit-backdrop-filter:var(--dsw-mask-blur,blur(16px))}.dsham_modalDialog{position:relative;display:flex;flex-direction:column;gap:12px;box-sizing:border-box;max-width:calc(100vw - 48px);max-height:min(85vh,760px);padding:22px 24px 20px;overflow:hidden;border:1px solid var(--dsw-alias-border-l1,rgba(128,128,128,.2));border-radius:var(--dsw-radius-panel,28px);background-color:var(--dsw-alias-surface-overlay,var(--dsw-alias-bg-base,Canvas));background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-surface-overlay,Canvas));backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));-webkit-backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));color:var(--dsw-alias-label-primary);box-shadow:var(--dsw-elevation-prominent,0 16px 40px rgb(0 0 0 / 24%))}.dsham_modalHeader{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none}.dsham_modalHeader h2,.dsham_modalDialog h2{margin:0;font-size:16px;line-height:24px;font-weight:600;color:var(--dsw-alias-label-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}.dsham_modalClose{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:28px;height:28px;padding:0;border:none;border-radius:var(--dsw-radius-sm,6px);background:transparent;color:var(--dsw-alias-label-secondary);cursor:pointer;flex:none;transition:background-color .15s ease,color .15s ease}.dsham_modalClose:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.dsham_modalClose svg{display:block;width:14px;height:14px}.dsham_modalDialog>p{margin:0;color:var(--dsw-alias-label-secondary);font-size:13px;line-height:20px}.dsham_modalBody{display:flex;flex-direction:column;gap:12px;flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain}.dsham_modalFooter{display:flex;flex:none;align-items:center;justify-content:flex-end;gap:8px}.dsham_modalWide{width:min(900px,calc(100vw - 48px))!important;max-height:min(88vh,820px)!important}.dsham_modalWide .dsham_modalBody{overflow:hidden}.dsham_modalWide .dsham_previewMessages{max-height:none;flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain}"),tt("dsh-archive-manager/SidebarPopover.css",".dsham_sidebarCardRoot{position:fixed;inset:0;z-index:1200;pointer-events:none}.dsham_sidebarCardBackdrop{position:fixed;inset:0;pointer-events:auto;background:transparent}.dsham_sidebarCard{position:fixed;pointer-events:auto;box-sizing:border-box;width:290px;max-height:calc(100vh - 32px);overflow-y:auto;padding:16px 18px 14px;border-radius:var(--dsw-radius-lg,14px);background:var(--dsw-menu-surface-fill);backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));-webkit-backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));border:none;box-shadow:var(--dsw-elevation-prominent);color:var(--dsw-alias-label-primary);display:flex;flex-direction:column;gap:8px}.dsham_sidebarCardTitle{margin:0;font-size:14px;font-weight:600;line-height:20px;color:var(--dsw-alias-label-primary)}.dsham_sidebarCardDesc{margin:0;font-size:13px;line-height:18px;color:var(--dsw-alias-label-secondary)}.dsham_sidebarCardError{margin-top:2px;font-size:12px;line-height:16px;color:var(--dsw-alias-state-error-primary,#ef7272);white-space:pre-line}.dsham_sidebarCardFooter{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:10px}.dsham_sidebarCardBtn{border:none;background:transparent;padding:5px 12px;border-radius:var(--dsw-radius-sm,6px);font:inherit;font-size:13px;font-weight:500;line-height:18px;cursor:pointer;transition:background-color .15s ease,opacity .15s ease}.dsham_sidebarCardBtnCancel{color:var(--dsw-alias-label-primary)}.dsham_sidebarCardBtnCancel:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.dsham_sidebarCardBtnDanger{color:var(--dsw-alias-state-error-primary,#ef7272)}.dsham_sidebarCardBtnDanger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-danger,#f25a5a26)}.dsham_sidebarCardBtn:disabled{opacity:.4;cursor:default}"),tt("dsh-archive-manager/MoveSubmenu.css",`.dsham_moveSessionWrap{position:relative}
|
|
23
|
+
.dsham_moveSubmenu{position:fixed;z-index:1100;min-width:160px;max-width:280px;box-sizing:border-box;overflow-y:auto;overscroll-behavior:contain;padding:4px;display:flex;flex-direction:column;gap:0;border:none;border-radius:var(--dsw-radius-lg,14px);box-shadow:var(--dsw-elevation-prominent,0 6px 20px rgba(0,0,0,.45));color:var(--dsw-alias-label-primary,#ededed);isolation:isolate}
|
|
24
|
+
.dsham_moveSubmenu::before{content:'';position:absolute;top:0;bottom:0;left:-6px;width:8px}
|
|
25
|
+
.dsham_moveSubmenu[data-dsham-side="left"]::before{left:auto;right:-6px}
|
|
26
|
+
.dsham_moveSubmenu::-webkit-scrollbar{width:0px;height:0px;display:none}
|
|
27
|
+
.dsham_moveSubmenu{scrollbar-width:none;-ms-overflow-style:none}
|
|
28
|
+
.dsham_moveSubmenuEmpty{padding:8px 10px;font-size:12px;color:var(--dsw-alias-label-tertiary,#888)}`),tt("dsh-archive-manager/WorkspaceMenuGroup.css",'div:has([data-dsham-archive-icon]) + div[role="separator"],div:has([data-dsham-archive-icon]) + div[class*="separator"],div:has(svg[data-dsham-archive-icon]) + div[role="separator"],div:has(svg[data-dsham-archive-icon]) + [class*="separator"]{display:none!important}');let Ht="M8 1.75l1.934 3.918 4.324.628-3.129 3.05.738 4.306L8 11.618l-3.867 2.034.738-4.306-3.129-3.05 4.324-.628L8 1.75z";function Ln(n){return n?'<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="'+Ht+'"/></svg>':'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linejoin="round" aria-hidden="true"><path d="'+Ht+'"/></svg>'}e(Ln,"starSvg");function Bt(n){return!!n?.querySelector("[data-state]")}e(Bt,"resolveRowHasStatus");let zn="[data-row-key^='session:']{position:relative}.dsham_starSlot{display:none;position:absolute;left:calc(8px + var(--dsh-workspace-indent,0px));inset-inline-start:calc(8px + var(--dsh-workspace-indent,0px));top:50%;transform:translateY(-50%);align-items:center;justify-content:center;box-sizing:border-box;width:16px;height:20px;z-index:1;pointer-events:none}[data-row-key^='session:']:hover .dsham_starSlot,.dsham_starSlot[data-favorited='true']{display:inline-flex;pointer-events:auto}[data-row-key^='session:']:hover>span:first-child:not(:has([data-state])),[data-row-key^='session:'][data-dsham-favorited='true']:not([data-dsham-has-status='true'])>span:first-child:not(:has([data-state])){opacity:0}[data-row-key^='session:'][data-dsham-has-status='true']>span:first-child,[data-row-key^='session:']>span:first-child:has([data-state]){opacity:1}[data-row-key^='session:'][data-dsham-has-status='true'] .dsham_starSlot,[data-row-key^='session:']:has(>span:first-child [data-state]) .dsham_starSlot{width:10px;height:10px;top:auto;bottom:3px;left:calc(15px + var(--dsh-workspace-indent,0px));inset-inline-start:calc(15px + var(--dsh-workspace-indent,0px));transform:none}[data-row-key^='session:'][data-dsham-has-status='true'] .dsham_rowStar,[data-row-key^='session:']:has(>span:first-child [data-state]) .dsham_rowStar{width:10px;height:10px}[data-row-key^='session:'][data-dsham-has-status='true'] .dsham_rowStar svg,[data-row-key^='session:']:has(>span:first-child [data-state]) .dsham_rowStar svg{width:10px;height:10px;filter:drop-shadow(0 0 1px rgba(0,0,0,0.85))}.dsham_rowStar{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:16px;height:16px;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-primary);cursor:pointer;flex:none;border-radius:var(--dsw-radius-xs,4px)}.dsham_starSlot[data-favorited='true'] .dsham_rowStar{color:#e8b931}.dsham_rowStar svg{display:block;width:16px;height:16px;flex:none}";tt("dsh-archive-manager/RowFavorite.css",zn);let ie="dsh-archive-manager:workspace-favorites-only",ke="data-dsham-favorites-hidden",ot="data-dsham-favorites-only",ln="dsham_rowStar",Pn="dsham_starSlot",ea=["\u4EC5\u663E\u793A\u5DF2\u5F52\u6863","Archived only","\u0422\u043E\u043B\u044C\u043A\u043E \u0430\u0440\u0445\u0438\u0432\u043D\u044B\u0435"];tt("dsh-archive-manager/FavoritesFilter.css",`[data-dsham-favorites-hidden='true']{display:none!important}button[data-dsham-favorites-only='true'][data-active='true']::after{content:"\\2713";margin-left:auto;padding-left:12px;font-size:12px;line-height:1;color:var(--dsw-alias-state-business-primary,#3b82f6)}`);function ta(){try{return window.localStorage.getItem(ie)==="1"}catch{return!1}}e(ta,"readWorkspaceFavoritesOnly");function na(n){try{window.localStorage.setItem(ie,n?"1":"0")}catch{}}e(na,"writeWorkspaceFavoritesOnly");function Cr(n,a){let o=e(f=>a.favorites.has(f)||a.sessions?.[f]?.blank===!0,"visibleSession"),h=new Map,v=null;for(let f of n){if(f.startsWith("workspace:")){v=f,h.set(f,!1);continue}f.startsWith("session:")&&v!==null&&o(f.slice(8))&&h.set(v,!0)}return n.map(f=>f.startsWith("session:")?o(f.slice(8)):f.startsWith("workspace:")?h.get(f)===!0||a.groupHasFavorite?.(f.slice(10))===!0:!f.startsWith("overflow:"))}e(Cr,"favoritesOnlyVisibility");function Er(n,a){let o=new Map,h=new Set;for(let f of a){let k=!1;for(let E of f.sessionIds)h.add(E),n.has(E)&&(k=!0);o.set(f.workspaceId,k)}let v=!1;for(let f of n)if(!h.has(f)){v=!0;break}return f=>f===""||f==="ungrouped"?v:o.get(f)===!0}e(Er,"favoriteGroupPredicate");function Ir(n,a,o,h){let v={dispose:e(()=>{},"dispose"),setFavoriteStarEnabled:e(q=>{},"setFavoriteStarEnabled"),isFavoriteStarEnabled:e(()=>!0,"isFavoriteStarEnabled")};if(typeof document>"u"||typeof document.addEventListener!="function"||typeof MutationObserver>"u")return v;let f=ta(),k=typeof h=="function"?h():!0,E=!1,N=!1,H=e(()=>{k?tt("dsh-archive-manager/RowFavorite.css",zn):tn("dsh-archive-manager/RowFavorite.css")},"updateStarStyle");H();let A=e(q=>{let Me=q;typeof Me?.detail?.enabled=="boolean"?k=Me.detail.enabled:typeof h=="function"&&(k=h()),H(),ct()},"onStarToggle");typeof window<"u"&&typeof window.addEventListener=="function"&&window.addEventListener("dsham-favorite-star-toggle",A);let z=0,O=200,d=null,oe=new Set,Re=e(q=>{if(!k){for(let ee of q)Array.from(ee.children).find(ze=>ze.classList.contains(Pn))?.remove(),ee.removeAttribute("data-dsham-favorited"),ee.removeAttribute("data-dsham-has-status");return}let Me=a.getSnapshot();for(let ee of q){let Z=ee.getAttribute("data-row-key")??"";if(!Z.startsWith("session:"))continue;let ze=Z.slice(8),at=Array.from(ee.children).find(Ke=>Ke.tagName==="SPAN"&&Array.from(Ke.classList).some(zt=>zt==="slot"||zt.endsWith("_slot")))??null;if(at===null){ee.removeAttribute("data-dsham-has-status");continue}let L=Array.from(ee.children).find(Ke=>Ke.classList.contains(Pn))??null;if(!Me.ready){L?.remove(),ee.removeAttribute("data-dsham-favorited"),ee.removeAttribute("data-dsham-has-status");continue}L!==null&&(L.parentElement!==ee||L.nextElementSibling!==null)&&ee.appendChild(L),L===null&&(L=document.createElement("span"),L.className=Pn,ee.appendChild(L)),L.dataset.sessionId=ze,Bt(at)?ee.setAttribute("data-dsham-has-status","true"):ee.removeAttribute("data-dsham-has-status");let Ce=L.querySelector("."+ln);Ce===null&&(Ce=document.createElement("button"),Ce.type="button",Ce.className=ln,Ce.addEventListener("click",Ke=>{Ke.preventDefault(),Ke.stopPropagation(),a.toggle(L?.dataset.sessionId??"")}),L.appendChild(Ce));let He=Me.ids.has(ze);if(He?ee.setAttribute("data-dsham-favorited","true"):ee.removeAttribute("data-dsham-favorited"),L.dataset.favorited===String(He))continue;let ht=o()(He?"organizer.unfavorite":"organizer.favorite");L.dataset.favorited=String(He),Ce.setAttribute("aria-pressed",String(He)),Ce.setAttribute("aria-label",ht),Ce.title=ht,Ce.innerHTML=Ln(He)}},"ensureRowStars"),pe=e(q=>{let Me=a.getSnapshot();if(!f||!Me.ready){for(let L of q)L.hasAttribute(ke)&&L.removeAttribute(ke);z=0,d=null,oe.clear();return}let ee=q.map(L=>L.getAttribute("data-row-key")??""),Z=Er(Me.ids,n.workspaces.list?.getSnapshot?.()?.items??[]),ze=Cr(ee,{favorites:Me.ids,sessions:n.sessions.list?.getSnapshot?.()?.byId,groupHasFavorite:Z});d!==null&&(q.length<=d.rows&&oe.add(d.key),d=null);let at=!1;if(z<O)for(let L=0;L<q.length;L+=1){let je=q[L],Ce=ee[L];if(!Ce.startsWith("overflow:")||je.getAttribute("aria-expanded")!=="false")continue;let He=Ce.slice(9);if(!(oe.has(He)||!Z(He))){try{je.click(),z+=1,d={key:He,rows:q.length},at=!0}catch(ht){console.warn("archive-manager: favorites-only expand failed",ht)}break}}for(let L=0;L<q.length;L+=1){let je=q[L];ze[L]?je.hasAttribute(ke)&&je.removeAttribute(ke):je.setAttribute(ke,"true")}at&&ct()},"applyVisibility"),kt=e(q=>{let Me=q.parentElement;if(Me===null)return null;let ee=Me.cloneNode(!0),Z=ee.querySelector('button[role="menuitem"]');if(Z===null)return null;let ze=Array.from(Z.querySelectorAll("span")),at=ze[0]??null,L=ze[ze.length-1]??null;at!==null&&(at.innerHTML=Ln(!1)),L!==null&&(L.textContent=o()("organizer.favoritesOnly"));for(let je of Array.from(Z.querySelectorAll("svg")))je.closest("span")===null&&je.remove();return Z.setAttribute(ot,"true"),Z.setAttribute("role","menuitemcheckbox"),Z.dataset.active=String(f),Z.setAttribute("aria-checked",String(f)),Z.setAttribute("aria-label",o()("organizer.favoritesOnly")),Z.onclick=je=>{je.preventDefault(),je.stopPropagation(),cn(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0}))},ee},"buildMenuRow"),ut=e(()=>{if(!E){for(let q of Array.from(document.querySelectorAll("button["+ot+"]")))q.dataset.active=String(f),q.setAttribute("aria-checked",String(f));for(let q of Array.from(document.querySelectorAll('[role="menu"]'))){let Me=Array.from(q.querySelectorAll('button[role="menuitem"]')).find(ze=>ea.some(at=>(ze.textContent??"").includes(at)));if(Me===void 0||q.querySelector("["+ot+"]")!==null)continue;let ee=Me.parentElement;if(ee===null)continue;let Z=kt(Me);Z!==null&&ee.parentElement?.insertBefore(Z,ee.nextSibling)}}},"injectMenuRows"),ct=e(()=>{if(N||E)return;N=!0;let q=e(()=>{if(N=!1,E)return;let Me=Array.from(document.querySelectorAll("[data-row-key]"));ut(),Re(Me),pe(Me),a.getSnapshot().ready||dn()},"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(q):setTimeout(q,16)},"schedulePass"),cn=e(()=>{f=!f,Ge=20,z=0,d=null,oe.clear(),na(f),ct()},"toggle"),st=null,Ge=20,dn=e(()=>{st!==null||E||Ge<=0||(Ge-=1,st=setTimeout(()=>{st=null,a.ensure(),ct()},600))},"scheduleRetry"),At=new MutationObserver(q=>{Wn(q,'[data-row-key], [role="menu"]')&&ct()});At.observe(document.body,{childList:!0,subtree:!0}),a.ensure().catch(()=>{});let Mt=[a.subscribe(()=>ct()),typeof n.sessions.list?.subscribe=="function"?n.sessions.list.subscribe(()=>ct()):null,typeof n.workspaces.list?.subscribe=="function"?n.workspaces.list.subscribe(()=>ct()):null].filter(q=>typeof q=="function");return ct(),{dispose(){E=!0,typeof window<"u"&&typeof window.removeEventListener=="function"&&window.removeEventListener("dsham-favorite-star-toggle",A),At.disconnect();for(let q of Mt)q();for(let q of Array.from(document.querySelectorAll("["+ke+"]")))q.removeAttribute(ke);for(let q of Array.from(document.querySelectorAll("["+ot+"]")))q.parentElement?.remove();for(let q of Array.from(document.querySelectorAll("."+Pn)))q.remove();for(let q of Array.from(document.querySelectorAll("[data-dsham-favorited]")))q.removeAttribute("data-dsham-favorited");for(let q of Array.from(document.querySelectorAll("[data-dsham-has-status]")))q.removeAttribute("data-dsham-has-status");st!==null&&(clearTimeout(st),st=null)},setFavoriteStarEnabled(q){k=q,H(),ct()},isFavoriteStarEnabled:e(()=>k,"isFavoriteStarEnabled")}}e(Ir,"setupWorkspaceFavoritesOnly");function Tr(){let n,a={ready:!1,ids:new Set,pending:new Set},o,h=0,v=new Set,f=e(E=>{a=E;for(let N of v)try{N()}catch(H){console.warn("archive-manager: favorite listener failed",H)}},"publish"),k=e((E,N)=>{let H=new Set(E);for(let d of a.pending)d!==N&&(a.ids.has(d)?H.add(d):H.delete(d));let A=new Set(a.pending);N!==void 0?A.delete(N):a.pending.size===0&&A.clear();let z=a.ids.size===H.size&&[...H].every(d=>a.ids.has(d)),O=a.pending.size===A.size&&[...A].every(d=>a.pending.has(d));z&&O&&a.ready||f({ready:!0,ids:H,pending:A})},"adopt");return{bind(E){n=E},subscribe(E){return v.add(E),()=>{v.delete(E)}},getSnapshot:e(()=>a,"getSnapshot"),adopt:e(E=>k(E),"adopt"),ensure(){return n===void 0||a.ready?Promise.resolve():o!==void 0?o:Date.now()<h?Promise.resolve():(o=n.favoriteSessions().then(E=>{k(E.favoriteSessionIds)}).catch(E=>{console.warn("archive-manager: load favorites failed, will retry",E),h=Date.now()+600}).finally(()=>{o=void 0}),o)},async toggle(E){if(n===void 0||!a.ready||a.pending.has(E))return;let N=a.ids.has(E),H=!N,A=new Set(a.ids);H?A.add(E):A.delete(E);let z=new Set(a.pending);z.add(E),f({ready:!0,ids:A,pending:z});try{let O=await n.setSessionFavorite({sessionId:E,favorite:H});if(!Array.isArray(O?.favoriteSessionIds))throw new TypeError("favorite response is missing favoriteSessionIds");k(O.favoriteSessionIds,E)}catch(O){console.warn("archive-manager: sidebar favorite toggle failed",O);let d=new Set(a.ids);N?d.add(E):d.delete(E);let oe=new Set(a.pending);oe.delete(E),f({ready:!0,ids:d,pending:oe})}}}}e(Tr,"createFavoriteRowStore");function ra(){return(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,"aria-hidden":!0,focusable:"false",children:(0,s.jsx)("path",{fill:"currentColor",d:"M8 0a8 8 0 0 0-2.53 15.59c.4.074.547-.173.547-.385 0-.19-.007-.693-.01-1.36-2.226.484-2.695-1.073-2.695-1.073-.364-.924-.89-1.17-.89-1.17-.726-.496.055-.486.055-.486.803.056 1.225.824 1.225.824.714 1.223 1.872.87 2.328.665.072-.517.28-.87.508-1.07-1.777-.202-3.645-.888-3.645-3.956 0-.874.31-1.588.823-2.148-.083-.202-.357-1.017.078-2.12 0 0 .672-.215 2.2.82A7.65 7.65 0 0 1 8 4.8c.68.003 1.365.092 2.004.27 1.527-1.035 2.197-.82 2.197-.82.437 1.103.162 1.918.08 2.12.513.56.822 1.274.822 2.148 0 3.076-1.872 3.752-3.654 3.95.288.248.544.735.544 1.482 0 1.07-.01 1.932-.01 2.195 0 .214.144.463.55.384A8.001 8.001 0 0 0 8 0Z"})})}e(ra,"GithubMark16");function sa(){let n=u.IconEditOutlineRegular;return(0,s.jsx)(n,{size:16})}e(sa,"FeedbackIcon");function On({archiveSessions:n,archiveSession:a,sessionStore:o,workspaceStore:h,unarchiveSession:v,deleteSession:f,unarchiveSessions:k,deleteArchivedSessions:E,archivedSessionMetadata:N,openConversation:H,focusSessionWorkspace:A,viewState:z,close:O,t:d,diagnoseOrphanSubagents:oe,cleanOrphanSubagents:Re,diagnoseSessionCaches:pe,rebuildSessionCaches:kt,refreshCacheLists:ut,searchSessionContent:ct,searchArchivedContent:cn,previewArchivedSession:st,favoriteSessions:Ge,setSessionFavorite:dn,favoriteSync:At,organizeBatch:Mt,useSessionPendingInteraction:q,useSessionStatus:Me}){let ee=(0,l.useSyncExternalStore)(o.subscribe,o.getSnapshot),Z=(0,l.useSyncExternalStore)(h.subscribe,h.getSnapshot),[ze,at]=(0,l.useState)("archived"),L=ze==="archived",[je,Ce]=(0,l.useState)(null),[He,ht]=(0,l.useState)(null),[Ke,zt]=(0,l.useState)(null),yn=e((c,S=null)=>{G(null),Be(null),We(!1),ht(S),Ce(c)},"requestArchive"),Vt=e(()=>{Q||(Ce(null),ht(null),G(null))},"closeArchive"),Ct=(0,l.useRef)(!1),[Te,$t]=(0,l.useState)(null),wn=(0,l.useRef)(!1),[Q,nt]=(0,l.useState)(!1),[_t,G]=(0,l.useState)(null),[Gt,Be]=(0,l.useState)(null),un=e(c=>{G(null),Be(null),$t(c)},"requestDelete"),[Pt,Sn]=(0,l.useState)(z?.query??""),[Et,Kt]=(0,l.useState)(z?.project??"all"),[Ot,xn]=(0,l.useState)(z?.sortBy??"updated"),[kn,Cn]=(0,l.useState)({}),[Yt,En]=(0,l.useState)(()=>new Set),Dt=(0,l.useRef)(new Set),[pt,Rt]=(0,l.useState)([]),[nn,Ft]=(0,l.useState)([]),[It,jt]=(0,l.useState)(!1),[Ut,In]=(0,l.useState)(!1),rn=(0,l.useRef)(!1),[Zt,Tn]=(0,l.useState)(!1),[p,b]=l.useState("content"),[I,$]=l.useState(""),[ye,se]=l.useState(""),[ge,de]=(0,l.useState)(()=>new Set),[ae,Ne]=(0,l.useState)("30"),[Ue,We]=(0,l.useState)(!1),[Ae,te]=(0,l.useState)(null),[ne,M]=(0,l.useState)(null),[K,ve]=(0,l.useState)([]),Y=(0,l.useRef)(!1),be=(0,l.useRef)(null),Ee=pa(q??da,Me??ua,typeof Me=="function"),Ye=(0,l.useRef)(Ee.pending);Ye.current=Ee.pending;let Ze=(0,l.useMemo)(()=>new Set(nn),[nn]),qe=e(async()=>{if(Ge)try{let c=await Ge();Ft(c.favoriteSessionIds),jt(!0),At?.adopt(c.favoriteSessionIds)}catch(c){jt(!1),G(Oe(c))}},"loadFavorites");(0,l.useEffect)(()=>{let c=!0;return Ge&&Ge().then(S=>{c&&(Ft(S.favoriteSessionIds),jt(!0),At?.adopt(S.favoriteSessionIds))}).catch(S=>{c&&G(Oe(S))}),()=>{c=!1}},[Ge]),(0,l.useEffect)(()=>{if(At)return At.subscribe(()=>{let c=At.getSnapshot();c.ready&&(Ft([...c.ids]),jt(!0))})},[At]);let Le=e(async c=>{if(!(rn.current||Q||!It)){rn.current=!0,In(!0),G(null);try{let S=await dn({sessionId:c,favorite:!Ze.has(c)});Ft(S.favoriteSessionIds),At?.adopt(S.favoriteSessionIds)}catch(S){G(Oe(S))}finally{rn.current=!1,In(!1)}}},"toggleFavorite"),Pe=e(async(c,S,{idle:J=!1,retry:Se=!1}={})=>{if(!(Y.current||rn.current||Dt.current.size>0||!Mt)){Y.current=!0,nt(!0),G(null),Be(null),M(null),c==="archive"&&!Se&&ve([]);try{let R=await Mt(c,S,{idleDays:J?Number(ae):void 0,getPending:e(()=>Ye.current,"getPending"),onProgress:e(xe=>{te(xe),c==="archive"&&xe.total>0&&xe.done>=xe.total&&(Ce(null),ht(null),We(!1))},"onProgress")});return M({...R,kind:c,tab:ze}),be.current=R.remaining.length?{kind:c,ids:R.remaining,idle:J}:null,c==="archive"&&ve(xe=>[...new Set([...xe,...R.succeeded])]),(c==="undo"||c==="restore"||c==="delete")&&ve(xe=>xe.filter(bt=>!R.succeeded.includes(bt)&&!R.skipped.includes(bt))),Rt(xe=>xe.filter(bt=>!R.succeeded.includes(bt)&&!R.skipped.includes(bt))),c==="delete"&&Ft(xe=>xe.filter(bt=>!R.succeeded.includes(bt))),R}catch(R){G(Oe(R))}finally{Y.current=!1,nt(!1),te(null)}}},"executeBatch"),[we,rt]=(0,l.useState)(null),[Je,Ie]=(0,l.useState)({diagnosis:{count:0,items:[]},busy:!1,progress:null,result:null,error:null,refreshError:null}),Ve=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(!pe||!kt||!ut)return;let c=js({diagnose:pe,rebuild:kt,refresh:ut});Ve.current=c;let S=c.subscribe(()=>{Ie(c.snapshot())});return c.load(),()=>{S(),c.dispose(),Ve.current=null}},[pe,kt,ut]),(0,l.useEffect)(()=>{Ve.current?.snapshot().busy||Ve.current?.load()},[Z.archivedSessionIds]);let mt=e(async(c=!1)=>{if(!(Q||Y.current||!Ve.current||Ve.current.snapshot().busy)){Y.current=!0,nt(!0);try{await Ve.current.run(c)}finally{Y.current=!1,gt.current&&nt(!1)}}},"runCacheRebuild"),[wt,hn]=(0,l.useState)(!1),Xe=e(()=>{typeof oe=="function"&&oe().then(rt).catch(c=>{console.warn("archive-manager: diagnose orphan subagents failed",c)})},"loadOrphans");(0,l.useEffect)(()=>{Xe()},[Z.archivedSessionIds]);let ft=e(async()=>{if(!(wt||typeof Re!="function")){hn(!0),G(null),Be(null);try{let c=await Re({});(c.cleanedSessionIds.length>0||c.skippedSessionIds.length>0)&&Xe(),c.failures.length>0?(Be(null),G(Hn(c.failures,d))):c.cleanedSessionIds.length>0&&(G(null),Be(d("organizer.orphanCleanSuccess",{n:c.cleanedSessionIds.length})))}catch(c){G(Oe(c))}finally{hn(!1)}}},"cleanOrphans"),gt=(0,l.useRef)(!0),sn=(0,l.useRef)(!1);(0,l.useEffect)(()=>(gt.current=!0,()=>{gt.current=!1}),[]);let Jt=e(async(c,S=!1)=>{if(Q||sn.current)return;sn.current=!0,nt(!0),G(null);let J=!1;try{await Ms({prepare:S?async Se=>{await A?.(Se)}:void 0,restore:e(async Se=>{await v(Se),J=!0},"restore"),open:e(async Se=>{await H(Se),gt.current&&O?.()},"open")},c.id,S,()=>gt.current)}catch(Se){if(!gt.current)return;if(J){at("unarchived");let R=Tt.find(xe=>xe.sessions.some(bt=>bt.id===c.id));R!==void 0&&Kt(R.key)}G(Ns(Se,d))}finally{sn.current=!1,gt.current&&nt(!1)}},"viewConversation");(0,l.useEffect)(()=>{z&&Object.assign(z,{query:Pt,project:Et,sortBy:Ot})},[Pt,Et,Ot,z]);let vt=(0,l.useMemo)(()=>L?Z.archivedSessionIds:$r(ee.byId,Z.archivedSessionIds),[L,ee.byId,Z.archivedSessionIds]),Tt=(0,l.useMemo)(()=>Gr(ee.byId,Z.items,vt,d("group.ungrouped")),[ee.byId,Z,vt,d]),An=e(c=>{Q||Dt.current.size>0||(Lt.close(),at(c),Rt([]),Ce(null),ht(null),G(null),Be(null),Kt("all"),Sn(""),c!=="archived"&&Ot==="archived"&&xn("updated"))},"switchTab"),Xt=e(async(c,S=!1)=>{if(!(Ct.current||Q||!c?.length)){if(Mt){Ct.current=!0;try{let J=await Pe("archive",c,{idle:S}),Se=J?.failures.map(R=>Nr(R.sessionId,R.message)).find(R=>R!==void 0);if(Se!==void 0&&typeof a=="function"){let R=ee.byId[Se.sessionId];zt({sessionId:Se.sessionId,title:R===void 0?Se.sessionId:lt(R,d),kinds:Se.kinds.join(", ")}),Ce(null),ht(null),G(null);return}J&&(Ce(null),ht(null),We(!1))}finally{Ct.current=!1}return}Ct.current=!0,nt(!0),G(null),Be(null);try{let J=await n(c);Ce(null),ht(null),J.archivedSessionIdsAdded.length>0&&Be(d("archives.archiveSuccess",{n:J.archivedSessionIdsAdded.length})),J.failures&&J.failures.length>0?G(Hn(J.failures,d)):(Rt([]),at("archived"),Kt("all"),Sn(""))}catch(J){let Se=jr(J);if(Se!==void 0&&typeof a=="function"){let R=ee.byId[Se.sessionId];zt({sessionId:Se.sessionId,title:R===void 0?Se.sessionId:lt(R,d),kinds:Se.kinds.join(", ")}),Ce(null),ht(null),G(null)}else{let R=Bn(J);G(R===void 0?d("archives.archiveBatchFailed",{detail:J instanceof Error?J.message:String(J)}):d("archives.archiveActive",{kinds:R.join(", ")}))}}finally{Ct.current=!1,nt(!1)}}},"performArchive"),pn=e(()=>Xt(je,Ue),"confirmArchive"),Na=e(async c=>{G(null),Be(null);try{await Yn(c.id),gt.current&&Be(d("details.copied"))}catch(S){gt.current&&G(typeof $n(S)=="string"&&String($n(S)).startsWith("copy.")?d(String($n(S))):Oe(S))}},"copyId"),ir=(0,l.useMemo)(()=>Kr(Tt,Ot,kn,d,L?Z.archivedSessionIds:void 0),[Tt,Ot,kn,d,L,Z.archivedSessionIds]);(0,l.useEffect)(()=>{if(Q)return;let c=!1;return N().then(S=>{c||Cn(Object.fromEntries(S.items.map(J=>[J.sessionId,J.createdAt])))}).catch(()=>{c||Cn({})}),()=>{c=!0}},[N,Z.archivedSessionIds,Q]),(0,l.useEffect)(()=>{Et!=="all"&&!Tt.some(c=>c.key===Et)&&Kt("all")},[Tt,Et]);let ns=!mr(I,ye),rs=ir.filter(c=>Et==="all"||Et===c.key).map(c=>({...c,sessions:c.sessions.filter(S=>(!Zt||Ze.has(S.id))&&xs(S.updatedAt,I,ye))})).filter(c=>c.sessions.length),or=p==="content"&&!ns,_n=P(rs.flatMap(c=>c.sessions.map(S=>S.id)),Pt,or,ct??cn),lr=new Map(_n.items.map(c=>[c.sessionId,c])),Lt=B(st,L?Z.archivedSessionIds:[]),ss=Pt.trim().toLocaleLowerCase(),Rn=rs.map(c=>({...c,sessions:c.sessions.filter(S=>!ss||lt(S,d).toLocaleLowerCase().includes(ss)||lr.has(S.id))})).filter(c=>c.sessions.length),as=It?Rn.flatMap(c=>c.sessions).filter(c=>kr(c,{days:Number(ae),favorites:Ze,currentId:Zn(ee),pending:Ee.pending})).map(c=>c.id):[],jn=(0,l.useMemo)(()=>Wr(Rn),[Rn]),cr=(0,l.useMemo)(()=>new Set(pt),[pt]),Ma=(0,l.useMemo)(()=>{let c=new Set(Z.archivedSessionIds);return K.reduce((S,J)=>S+(c.has(J)?1:0),0)},[K,Z.archivedSessionIds]),dr=jn.filter(c=>cr.has(c)).length,Da=jn.length>0&&dr===jn.length;(0,l.useEffect)(()=>{Rt(c=>qr(c,vt))},[vt]);let La=e((c,S)=>{Rt(J=>rr(J,[c],S))},"toggleSessionSelection"),za=e(c=>{Rt(S=>rr(S,jn,c))},"toggleVisibleSelection"),Pa=e(c=>{Q||Dt.current.has(c)||(Dt.current.add(c),En(new Set(Dt.current)),G(null),Be(null),v(c).catch(S=>{G(_r(S,d))}).finally(()=>{Dt.current.delete(c),En(new Set(Dt.current))}))},"onUnarchive"),is=e(async c=>{if(!Q){if(Mt){let S=bn(Z.archivedSessionIds,Z.items,c),J=await Pe("restore",S);return J&&{unarchivedSessionIds:J.succeeded}}nt(!0),G(null),Be(null);try{let S=await k(c);return S.unarchivedSessionIds.length>0&&Be(d("archives.restoreSuccess",{n:S.unarchivedSessionIds.length})),S.failures&&S.failures.length>0&&G(Hn(S.failures,d,_r)),S}catch(S){G(d("archives.restoreBatchFailed",{detail:S instanceof Error?S.message:String(S)}))}finally{nt(!1)}}},"onBatchUnarchive"),Oa=e(async()=>{if(pt.length===0)return;let c=await is({scope:"sessions",sessionIds:pt});if(c!==void 0){let S=new Set(c.unarchivedSessionIds);Rt(J=>J.filter(Se=>!S.has(Se)))}},"onSelectedUnarchive"),os=e(()=>{Q||$t(null)},"closeDelete");(0,l.useEffect)(()=>{if(Te===null)return;let c=e(S=>{S.key==="Escape"&&(S.preventDefault(),S.stopPropagation(),"stopImmediatePropagation"in S&&typeof S.stopImmediatePropagation=="function"&&S.stopImmediatePropagation(),Q||$t(null))},"onKeyDown");return window.addEventListener("keydown",c,!0),()=>window.removeEventListener("keydown",c,!0)},[Te,Q]);let Fa=e(async()=>{if(Q||wn.current||Te===null)return;if(Te.kind!=="batch"){wn.current=!0,nt(!0),G(null),Be(null);try{await f(Te.session.id),$t(null)}catch(S){G(Xn(S,d))}finally{wn.current=!1,nt(!1)}return}if(Y.current||rn.current||Dt.current.size>0)return;let{target:c}=Te;if(c.scope==="sessions"&&bn(Z.archivedSessionIds,Z.items,c).length===0){$t(null);return}Y.current=!0,nt(!0),G(null),Be(null),M(null),te(null);try{let S=await E(c),J=Vr(S,d);J.kind==="error"?G(J.message):Be(J.message);let Se=new Set([...S.deletedSessionIds,...S.skippedSessionIds]);ve(xe=>xe.filter(bt=>!Se.has(bt))),Rt(xe=>xe.filter(bt=>!Se.has(bt))),Ft(xe=>xe.filter(bt=>!Se.has(bt)));let R=S.failures.map(xe=>xe.sessionId);be.current=R.length>0?{kind:"delete",ids:R,idle:!1}:null,M({requested:S.requestedSessionIds,succeeded:S.deletedSessionIds,skipped:S.skippedSessionIds,failures:S.failures,remaining:R,refreshError:"refreshError"in S&&typeof S.refreshError=="string"?S.refreshError:null,kind:"delete",tab:ze}),$t(null)}catch(S){G(Xn(S,d))}finally{Y.current=!1,nt(!1)}},"confirmDelete"),Wt=Te?.kind==="batch"?Te.target.scope:null,Ha=Wt==="ungrouped"?d("archives.deleteUngroupedTitle"):Wt==="workspace"?d("archives.deleteProjectTitle",{name:Te?.kind==="batch"?Te.title:""}):d(Wt==="sessions"?"archives.deleteSelectedTitle":"deleteSession.title"),ls=Te===null?void 0:Wt==="ungrouped"?d("archives.deleteUngroupedDesc",{n:Te.kind==="batch"?Te.count:0}):Wt==="workspace"?d("archives.deleteProjectDesc",{name:Te?.kind==="batch"?Te.title:"",n:Te.kind==="batch"?Te.count:0}):Wt==="sessions"?d("archives.deleteSelectedDesc",{n:Te.kind==="batch"?Te.count:0}):d("deleteSession.desc",{name:lt(Te.kind==="session"?Te.session:{},d)}),Ba=d(Wt==="ungrouped"?"archives.deleteUngroupedConfirm":Wt==="workspace"?"archives.deleteProjectConfirm":Wt==="sessions"?"archives.deleteSelectedConfirm":"deleteSession.title");return(0,s.jsxs)("section",{className:"dsham_settings","aria-label":d("archives.title"),children:[(0,s.jsx)("style",{children:fa+ba+ya+wa+Sa}),(0,s.jsxs)("div",{className:"dsham_settingsHeader",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"dsham_settingsTitleRow",children:[(0,s.jsx)("h2",{children:d("archives.title")}),(0,s.jsxs)("div",{className:"dsham_settingsLinks",children:[(0,s.jsx)(u.Button,{variant:"outline",size:"sm","aria-label":d("archives.viewProject"),icon:(0,s.jsx)(ra,{}),onClick:e(()=>window.open("https://github.com/MichengAI/dsh-archive-manager","_blank","noreferrer"),"onClick"),children:d("archives.viewProject")}),(0,s.jsx)(u.Button,{variant:"outline",size:"sm","aria-label":d("archives.feedback"),icon:(0,s.jsx)(sa,{}),onClick:e(()=>window.open("https://github.com/MichengAI/dsh-archive-manager/issues","_blank","noreferrer"),"onClick"),children:d("archives.feedback")})]})]}),(0,s.jsx)("p",{className:"dsham_settingsIntro",children:d("archives.description")})]}),l.createElement("div",D(Q||Yt.size>0,(0,s.jsx)(u.SegmentedTabs,{className:"dsham_archiveTabs",label:d("archives.title"),value:ze==="unarchived"?"unarchived":"archived",onChange:e(c=>An(c==="unarchived"?"unarchived":"archived"),"onChange"),items:[{value:"archived",label:(0,s.jsxs)("span",{className:"dsham_tabLabel",children:[(0,s.jsx)(u.IconArchiveOutlineMedium,{size:14}),(0,s.jsx)("span",{children:d("archives.tab.archived")})]}),id:"dsham-tab-archived",panelId:"dsham-archive-panel"},{value:"unarchived",label:(0,s.jsxs)("span",{className:"dsham_tabLabel",children:[(0,s.jsx)(u.IconFolderCloseMedium,{size:14}),(0,s.jsx)("span",{children:d("archives.tab.unarchived")})]}),id:"dsham-tab-unarchived",panelId:"dsham-archive-panel"}]})))]}),(0,s.jsxs)("div",{id:"dsham-archive-panel",role:"region","aria-label":d(ze==="unarchived"?"archives.tab.unarchived":"archives.tab.archived"),children:[(0,s.jsx)("div",{className:"dsham_settingsToolbar",children:(0,s.jsxs)("div",{className:"dsham_settingsSearch",children:[(0,s.jsx)(nr,{id:"dsham-favorite-filter",className:"dsham_srOnly",tabIndex:-1,"aria-hidden":!0,value:Zt?"favorites":"all",options:[{value:"all",label:d("organizer.allSessions")},{value:"favorites",label:d("organizer.favoritesOnly")}],onChange:e(c=>typeof Tn=="function"&&Tn(c==="favorites"),"onChange"),"aria-label":d("organizer.favoriteFilter")}),(0,s.jsx)(nr,{id:"dsham-search-scope",className:"dsham_srOnly",tabIndex:-1,"aria-hidden":!0,value:p,options:[{value:"title",label:d("discovery.titleOnly")},{value:"content",label:d("discovery.titleAndContent")}],onChange:e(c=>typeof b=="function"&&b(c),"onChange"),"aria-label":d("discovery.scope")}),(0,s.jsx)(u.Input,{id:"dsham-search-input",className:"dsham_searchField",type:"search",icon:(0,s.jsx)(u.IconSearchOutlineMedium,{size:16,"aria-hidden":!0}),autoComplete:"off",spellCheck:!1,maxLength:200,value:Pt,onChange:e(c=>Sn(c.target.value),"onChange"),placeholder:d(or?"discovery.searchPlaceholder":L?"archives.searchPlaceholder":"archives.searchUnarchived"),"aria-label":d(or?"discovery.searchPlaceholder":L?"archives.searchPlaceholder":"archives.searchUnarchived")}),(0,s.jsx)(xa,{id:"dsham-sort-filter",t:d,disabled:Q,favoritesOnly:Zt,setFavoritesOnly:Tn,favoriteBusy:Q||Ut||!It,sortBy:!L&&Ot==="archived"?"updated":Ot,setSortBy:xn,options:[...L?[{value:"archived",label:d("archives.sortArchived")}]:[],{value:"updated",label:d("archives.sortUpdated")},{value:"created",label:d("archives.sortCreated")},{value:"alphabetical",label:d("archives.sortAlphabetical")}]}),(0,s.jsx)(nr,{id:"dsham-project-filter",className:"dsham_projectFilter",value:Et,title:Et==="all"?d("archives.allProjects"):ir.find(c=>c.key===Et)?.title??Et,options:[{value:"all",label:d("archives.allProjects")||"\u6240\u6709\u9879\u76EE",title:d("archives.allProjects")},...ir.map(c=>({value:c.key,label:c.title,title:c.title}))],onChange:Kt,"aria-label":d("archives.projectFilter")}),l.createElement(me,{t:d,from:I,to:ye,onFrom:$,onTo:se,invalid:ns,onClear:e(()=>{$(""),se("")},"onClear")})]})}),l.createElement("style",null,Es),l.createElement(le,{state:_n,t:d}),Mt&&(0,s.jsx)(j,{t:d,archived:L,busy:Q||Ut||Yt.size>0,ready:It,days:ae,onDays:Ne,count:as.length,onPreview:e(()=>{yn(as),We(!0)},"onPreview"),progress:Ae,result:ne?.tab===ze?ne:null,onRetry:e(()=>{let c=be.current;c&&(c.kind==="delete"?un({kind:"batch",target:{scope:"sessions",sessionIds:c.ids},count:c.ids.length}):Pe(c.kind,c.ids,{idle:c.idle,retry:!0}))},"onRetry"),undoCount:Ma,onUndo:e(()=>Pe("undo",K,{retry:!0}),"onUndo"),onReload:qe,orphanCount:we?.count??0,cacheCount:Je.diagnosis.count,cacheRepair:Je,onRebuildCaches:e(()=>mt(),"onRebuildCaches"),onRetryCaches:e(()=>mt(!0),"onRetryCaches"),onReloadCaches:e(async()=>{try{await ut?.(),await Ve.current?.load(),(Ve.current?.snapshot().diagnosis.count??0)===0&&Ve.current?.dismiss()}catch(c){gt.current&&G(Oe(c))}},"onReloadCaches"),onDismissCaches:e(()=>Ve.current?.dismiss(),"onDismissCaches"),orphanSizeBytes:we?.totalSizeBytes??0,orphanCleaning:wt,onCleanOrphans:ft}),Tt.length>0&&(0,s.jsx)(Hr,{selectedCount:pt.length,hiddenCount:pt.length-dr,allVisibleSelected:Da,selectedVisibleCount:dr,visibleCount:jn.length,busy:Q,t:d,onToggle:za,onClear:e(()=>Rt([]),"onClear"),onArchive:L?void 0:()=>yn([...pt]),onRestore:Oa,onDelete:e(()=>un({kind:"batch",target:{scope:"sessions",sessionIds:pt},count:pt.length}),"onDelete")}),Tt.length===0?(0,s.jsx)("div",{className:"dsham_settingsEmpty",children:d(L?"archives.empty":"archives.emptyUnarchived")}):Rn.length===0?(0,s.jsx)("div",{className:"dsham_settingsEmpty",children:_n.status==="loading"||_n.status==="error"||_n.failures.length?null:d("archives.emptyFiltered")}):Rn.map(c=>{let S=Ea(c.key),J=Tt.find(R=>R.key===c.key)?.sessions.map(R=>R.id)??[],Se=L?bn(Z.archivedSessionIds,Z.items,S).length:J.length;return(0,s.jsxs)("section",{className:"dsham_settingsGroup",children:[(0,s.jsxs)("div",{className:"dsham_settingsGroupHeading",children:[(0,s.jsx)("h3",{className:"dsham_settingsGroupTitle",children:(0,s.jsxs)("button",{type:"button",className:"dsham_groupToggle","aria-expanded":!ge.has(c.key),"aria-controls":"dsham-group-"+encodeURIComponent(c.key),onClick:e(()=>de(R=>{let xe=new Set(R);return xe.has(c.key)?xe.delete(c.key):xe.add(c.key),xe}),"onClick"),children:[(0,s.jsx)(ge.has(c.key)?u.IconChevronRightOutlineMedium:u.IconChevronDownOutlineMedium,{}),(0,s.jsx)(ge.has(c.key)?u.IconFolderCloseMedium:u.IconFolderOpenOutlineMedium,{}),(0,s.jsx)("span",{children:c.title})]})}),(0,s.jsxs)("div",{className:"dsham_settingsGroupMeta",children:[(0,s.jsx)("span",{className:"dsham_settingsCount",children:d("archives.sessionCount",{n:c.sessions.length})}),(0,s.jsx)(Ca,{group:c,busy:Q,onArchive:L?void 0:()=>yn(J,c),onRestore:e(()=>is(S),"onRestore"),onDelete:e(()=>un({kind:"batch",target:S,title:c.title,count:Se}),"onDelete"),t:d})]})]}),(0,s.jsx)("div",{className:"dsham_settingsList",id:"dsham-group-"+encodeURIComponent(c.key),hidden:ge.has(c.key)||void 0,children:!ge.has(c.key)&&c.sessions.map(R=>(0,s.jsxs)("div",{className:"dsham_settingsRow","data-selected":cr.has(R.id),children:[(0,s.jsx)(Br,{checked:cr.has(R.id),disabled:Q,label:d("archives.selectSession",{name:lt(R,d)}),onChange:e(xe=>La(R.id,xe.target.checked),"onChange")}),(0,s.jsxs)("div",{className:"dsham_settingsContent",children:[(0,s.jsx)("button",{type:"button",className:"dsham_settingsTitleLink",title:lt(R,d),"aria-label":d("archives.openSession")+d("common.separator")+lt(R,d),disabled:Q||Yt.has(R.id),onClick:e(()=>Jt(R),"onClick"),children:lt(R,d)}),(0,s.jsx)("div",{className:"dsham_settingsMeta",children:[ma(R.updatedAt,d)]}),lr.has(R.id)&&l.createElement("button",{type:"button",className:"dsham_settingsSnippet",disabled:Q,title:d(L?"discovery.preview":"archives.openSession"),onClick:e(()=>L?Lt.open(R,Pt):Jt(R),"onClick")},l.createElement(U,{text:lr.get(R.id)?.snippet??"",query:Pt}))]}),(0,s.jsxs)("div",{className:"dsham_settingsActions",children:[typeof dn=="function"&&g({variant:"outline",className:"dsham_iconAction"+(Ze.has(R.id)?" dsham_favoriteOn":""),title:d(Ze.has(R.id)?"organizer.unfavorite":"organizer.favorite"),"aria-pressed":Ze.has(R.id),"aria-label":d(Ze.has(R.id)?"organizer.unfavorite":"organizer.favorite")+d("common.separator")+lt(R,d),disabled:Q||Ut||!It,onClick:e(()=>Le(R.id),"onClick"),children:(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:Ze.has(R.id)?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round","aria-hidden":!0,style:{display:"block"},children:(0,s.jsx)("path",{d:Ht})})}),g({variant:"outline",className:"dsham_iconAction",title:d(L?"archives.restore":"archives.archiveSelected"),"aria-label":d(L?"archives.restore":"archives.archiveSelected"),disabled:Q||Yt.has(R.id),onClick:e(()=>L?Pa(R.id):Xt([R.id]),"onClick"),icon:(0,s.jsx)(L?u.IconRefreshOutlineMedium:u.IconArchiveOutlineMedium,{size:16})}),L&&(0,s.jsx)(ka,{busy:Q||Yt.has(R.id),t:d,title:lt(R,d),onCopyId:e(()=>Na(R),"onCopyId"),onPreview:typeof st=="function"?()=>Lt.open(R,Pt):void 0,onRestoreOpen:e(()=>Jt(R,!0),"onRestoreOpen"),onDelete:e(()=>un({kind:"session",session:R}),"onDelete")})]})]},R.id))})]},c.key)}),l.createElement(_,{width:900,className:"dsham_modalWide",portalToBody:!0,t:d,open:Lt.target!==null,onClose:Lt.close,title:Lt.target?lt(Lt.target.session,d):d("discovery.preview"),footer:w({variant:"primary",disabled:Q,onClick:e(()=>{if(Lt.target){let c=Lt.target.session;return Lt.close(),Jt(c)}},"onClick"),children:d("discovery.openFull")}),children:l.createElement(V,{preview:Lt,t:d,MarkdownText:u.MarkdownText})}),je===null&&_t!==null&&(0,s.jsx)("div",{className:"dsham_settingsError",role:"alert",children:_t}),Gt!==null&&(0,s.jsx)("div",{className:"dsham_settingsStatus",role:"status",children:Gt}),(0,s.jsx)(_,{t:d,open:je!==null,onClose:Vt,title:d("archives.archiveTitle",{n:je?.length??0}),description:He===null?d("archives.archiveSelectedDesc"):d(He.key===qn?"archives.archiveUngroupedDesc":"archives.archiveProjectDesc",{name:He.title,n:je?.length??0}),footer:(0,s.jsxs)(s.Fragment,{children:[w({disabled:Q,onClick:Vt,children:d("cancel")}),w({variant:"primary",disabled:Q||!je?.length,onClick:pn,children:d("archives.archiveSelected")})]}),children:(0,s.jsxs)(s.Fragment,{children:[Mt&&(0,s.jsx)("p",{children:d(Ue?"organizer.idleConfirm":"organizer.manualConfirm")}),Mt&&(0,s.jsx)("div",{className:"dsham_archivePreview",children:(je??[]).map(c=>(0,s.jsxs)("label",{children:[(0,s.jsx)(ur,{checked:!0,disabled:Q,label:lt(ee.byId[c]??{id:c},d),onChange:e(()=>Ce(S=>(S??[]).filter(J=>J!==c)),"onChange")}),lt(ee.byId[c]??{id:c},d)]},c))}),Ae&&(0,s.jsxs)("div",{role:"status",children:[(0,s.jsx)("progress",{value:Ae.done,max:Math.max(1,Ae.total)}),d("organizer.progressCount",{done:Ae.done,total:Ae.total})]}),_t!==null&&(0,s.jsx)("div",{className:"dsham_settingsError",role:"alert",children:_t})]})}),(0,s.jsx)(_,{t:d,open:Ke!==null,onClose:e(()=>{Q||(zt(null),G(null))},"onClose"),title:d("archiveActive.title"),...Ke===null?{}:{description:d("archiveActive.desc",{name:Ke.title,kinds:Ke.kinds})},footer:(0,s.jsxs)(s.Fragment,{children:[w({disabled:Q,onClick:e(()=>{Q||(zt(null),G(null))},"onClick"),children:d("cancel")}),w({danger:!0,disabled:Q,onClick:e(async()=>{if(!(Ct.current||Q||Ke===null||typeof a!="function")){Ct.current=!0,nt(!0),G(null);try{await a(Ke.sessionId,{stopActivity:!0}),Rt(c=>c.filter(S=>Ke===null||S!==Ke.sessionId)),at("archived"),Be(d("archives.archiveSuccess",{n:1})),zt(null)}catch(c){G(c instanceof Error?c.message:String(c))}finally{Ct.current=!1,nt(!1)}}},"onClick"),children:d("archiveActive.confirm")})]}),children:_t!==null&&(0,s.jsx)("div",{className:"dsham_settingsError",role:"alert",children:_t})}),(0,s.jsx)(_,{t:d,open:Te!==null,onClose:os,title:Ha,...ls===void 0?{}:{description:ls},footer:(0,s.jsxs)(s.Fragment,{children:[w({disabled:Q,onClick:os,children:d("cancel")}),w({danger:!0,disabled:Q,onClick:Fa,children:Ba})]}),children:(0,s.jsxs)(s.Fragment,{children:[Q&&(0,s.jsxs)("div",{role:"status",children:[Te?.kind==="batch"?d("archives.deleteBatchPending"):d("deleteSession.pending"),Ae&&(0,s.jsx)("progress",{value:Ae.done,max:Math.max(1,Ae.total),"aria-label":d("organizer.progress")}),Ae&&d("organizer.progressCount",{done:Ae.done,total:Ae.total})]}),_t!==null&&(0,s.jsx)("div",{className:"dsham_settingsError",role:"alert",children:_t})]})})]})]})}e(On,"ArchivedSessionsSection");function Ar(n){var a,o,h="";if(typeof n=="string"||typeof n=="number")h+=n;else if(typeof n=="object")if(Array.isArray(n)){var v=n.length;for(a=0;a<v;a++)n[a]&&(o=Ar(n[a]))&&(h&&(h+=" "),h+=o)}else for(o in n)n[o]&&(h&&(h+=" "),h+=o);return h}e(Ar,"r");function aa(...n){for(var a,o,h=0,v="",f=arguments.length;h<f;h++)(a=arguments[h])&&(o=Ar(a))&&(v&&(v+=" "),v+=o);return v}e(aa,"clsx");function Fn(n){let a=n instanceof Error?n.message:String(n);return a.includes("UNKNOWN_SESSION")||a.includes("no such session")}e(Fn,"isUnknownSessionError");function Xn(n,a){if(Fn(n))return a("deleteSession.unknown");let o=n instanceof Error?n.message:String(n);return a("deleteSession.failed",{detail:o})}e(Xn,"formatDeleteError");function _r(n,a){if(Fn(n))return a("archives.unarchiveUnknown");let o=n instanceof Error?n.message:String(n);return a("archives.unarchiveFailed",{detail:o})}e(_r,"formatUnarchiveError");function Hn(n,a,o=Rr){return n.map(h=>h.sessionId+a("common.separator")+o(new Error(h.message),a)).join(`
|
|
29
|
+
`)}e(Hn,"formatBatchFailures");function Rr(n,a){if(Fn(n))return a("archives.archiveUnknown");let o=n instanceof Error?n.message:String(n);return a("archives.archiveFailed",{detail:o})}e(Rr,"formatArchiveError");function Bn(n){if(n===null||typeof n!="object")return;let a=ce(n),o=a.rpcError!==null&&typeof a.rpcError=="object"?ce(a.rpcError):void 0,h=a.name==="WorkspaceActiveSessionError"?a.activity:void 0,v=o?.details,f=a.name==="WorkspaceArchiveError"&&o?.code==="workspace/session-active"&&v!==null&&typeof v=="object"?ce(v).activity:void 0,k=Array.isArray(h)?h:Array.isArray(f)?f:void 0;if(k===void 0)return;let E=k.flatMap(N=>{if(N===null||typeof N!="object")return[];let H=ce(N).kind;return typeof H=="string"&&H.length>0?[H]:[]});return E.length>0?E:void 0}e(Bn,"activeSessionActivity");function jr(n){let a=Bn(n);if(a===void 0||n===null||typeof n!="object")return;let o=ce(n),h=o.rpcError!==null&&typeof o.rpcError=="object"?ce(o.rpcError).details:void 0,v=h!==null&&typeof h=="object"?ce(h).sessionId:void 0,f=typeof o.sessionId=="string"?o.sessionId:typeof v=="string"?v:void 0;return f===void 0?void 0:{sessionId:f,kinds:a}}e(jr,"activeSessionRefusal");function Nr(n,a){let o=/^cannot archive session '(?:[^'\\]|\\')*': the session is active \((.*)\)$/.exec(a);if(o===null)return;let h=o[1].split(", ").filter(v=>v.length>0);return h.length>0?{sessionId:n,kinds:h}:void 0}e(Nr,"activeArchiveFromMessage");function ia(n,a){let o=n instanceof Error?n.message:String(n);return a("archives.forkFailed",{detail:o})}e(ia,"formatForkError");function Un(n,a,o){if(!n||o.has(n))return!1;let h=a?.[n];return!(h===void 0||h.origin==="subagent"||h.blank)}e(Un,"isWorkspaceTaskCandidate");function Mr(n){let a=n?.closest("[data-row-key]")??null;if(a===null)return null;let o=a.getAttribute("data-row-key")??"";if(!o.startsWith("workspace:"))return null;let h=o.slice(10);if(!h)return null;let v=a.querySelector(".title")??a.querySelector("[class*='title']");return{workspaceId:h,title:v?.textContent?.trim()||h}}e(Mr,"workspaceMenuTriggerFrom");function Qn(n){let a=n.querySelector('[class*="rowActions"]');if(!a)return null;let o=Array.from(a.querySelectorAll("button"));if(o.length===0)return null;let h=e(f=>!!((f.getAttribute("class")??"").includes("dsham_rowStar")||typeof f.closest=="function"&&f.closest(".dsham_starSlot")),"isStarButton");return o.find(f=>{if(h(f))return!1;if(f.getAttribute("aria-haspopup")==="menu")return!0;let k=(f.getAttribute("aria-label")??f.getAttribute("title")??"").toLowerCase();return/new|create|新建|add|\+|созда/.test(k)?!1:/action|操作|действи|more|更多|选项|options|menu/.test(k)})??null}e(Qn,"findRowMenuButton");function Dr(n,a){if(Qn(a)===n)return!0;let h=(n.getAttribute("aria-label")??n.getAttribute("title")??"").toLowerCase();return/action|操作|действи|more|更多/.test(h)}e(Dr,"isRowMenuButton");function Lr(){if(typeof document>"u"||typeof document.addEventListener!="function")return()=>{};let n=e(a=>{let o=a.target;if(!o||o.closest("input, textarea, [contenteditable='true']"))return;let h=o.closest('[data-row-key^="workspace:"], [data-row-key^="session:"]');if(!h)return;let v=o.closest("button");if(v&&!Dr(v,h))return;let f=Qn(h);f&&(a.preventDefault(),a.stopPropagation(),f.click())},"onContextMenu");return document.addEventListener("contextmenu",n,!0),()=>{document.removeEventListener("contextmenu",n,!0)}}e(Lr,"setupSidebarRowContextMenu");function er(n,a=!0){let o=(n.textContent??"").toLowerCase();return o.includes("\u5220\u9664\u5DE5\u4F5C\u533A")||o.includes("delete workspace")||o.includes("\u0443\u0434\u0430\u043B\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435")?!0:a&&/(?:^|[_\s-])danger(?:$|[_\s-])/i.test(n.className)}e(er,"isWorkspaceDeleteMenuItem");let oa=new Map,la=new Set,ca=new Map;function da(n){return n(oa)}e(da,"useEmptySessionPendingInteraction");function ua(n){return n(ca)}e(ua,"useEmptySessionStatus");function ha(n){let a=new Map,o=new Set;if(n instanceof Map)for(let[h,v]of n)v?.pendingInteraction!==void 0&&a.set(h,v.pendingInteraction),v?.completionUnread===!0&&o.add(h);return{pending:a,completed:o}}e(ha,"factsFromSessionStatus");function pa(n,a,o){let h=n(f=>f),v=a(f=>f);return o?ha(v):{pending:h,completed:la}}e(pa,"useSessionUiFacts");let zr={listeners:new Set,request(n){for(let a of this.listeners)a(n)},subscribe(n){return this.listeners.add(n),()=>{this.listeners.delete(n)}}};function lt(n,a){return n.blank?a("session.new"):n.title??n.displayTitle??""}e(lt,"displayTitle");function ma(n,a){let o=new Date(n),h=`${String(o.getHours()).padStart(2,"0")}:${String(o.getMinutes()).padStart(2,"0")}`;return a("archives.timestamp",{date:a("date.ymd",{y:o.getFullYear(),m:o.getMonth()+1,d:o.getDate()}),time:h})}e(ma,"archiveTimeLabel");let fa=[".dsham_archiveTabsLocked{opacity:.5}",".dsham_archiveTabs{display:grid!important;box-sizing:border-box!important;height:32px!important;min-height:32px!important;max-height:32px!important;padding:2px!important;border:0!important;border-radius:var(--dsw-radius-sm,8px)!important;box-shadow:inset 0 0 0 .5px var(--dsw-alias-border-l2)!important;background:var(--dsw-alias-bg-layer-1)!important}",'.dsham_archiveTabs>span[aria-hidden="true"],.dsham_archiveTabs>[class*="indicator"]{inset:2px auto 2px 2px!important;width:calc((100% - 4px)/2)!important;border-radius:6px!important;border:0.5px solid var(--dsw-alias-border-l3,rgba(255,255,255,.12))!important;background:var(--dsw-alias-bg-layer-3,rgba(255,255,255,.08))!important;box-shadow:none!important}',".dsham_archiveTabs [role=tab]{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;height:28px!important;padding:0 12px!important;border-radius:6px!important;font-size:13px!important;line-height:20px!important;color:var(--dsw-alias-label-secondary)!important;text-align:center!important;box-sizing:border-box!important;transition:color 150ms ease!important}",".dsham_archiveTabs [role=tab]:hover{color:var(--dsw-alias-label-primary)!important}",'.dsham_archiveTabs [role=tab][aria-selected="true"]{color:var(--dsw-alias-label-primary)!important;font-weight:600!important}',".dsham_tabLabel{display:inline-flex;align-items:center;justify-content:center;gap:6px}",".dsham_tabLabel svg{flex:none;display:block}"].join(""),Nt="data-dsham-nav-icon",ga='[role="dialog"] nav button',tr=[`[${Nt}] > svg { display: none !important; }`,`[${Nt}]::before {`," content: '';"," flex: none;"," width: 16px;"," height: 16px;"," background-color: currentColor;",' -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.3%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M13.5%202.5H2.5C1.94772%202.5%201.5%202.94772%201.5%203.5V4.5C1.5%205.05228%201.94772%205.5%202.5%205.5H13.5C14.0523%205.5%2014.5%205.05228%2014.5%204.5V3.5C14.5%202.94772%2014.0523%202.5%2013.5%202.5Z%22%2F%3E%3Cpath%20d%3D%22M2.5%205.5V13.5C2.5%2013.7652%202.60536%2014.0196%202.79289%2014.2071C2.98043%2014.3946%203.23478%2014.5%203.5%2014.5H12.5C12.7652%2014.5%2013.0196%2014.3946%2013.2071%2014.2071C13.3946%2014.0196%2013.5%2013.7652%2013.5%2013.5V5.5%22%2F%3E%3Cpath%20d%3D%22M6.5%209.5H9.5%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") center / contain no-repeat;',' mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.3%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M13.5%202.5H2.5C1.94772%202.5%201.5%202.94772%201.5%203.5V4.5C1.5%205.05228%201.94772%205.5%202.5%205.5H13.5C14.0523%205.5%2014.5%205.05228%2014.5%204.5V3.5C14.5%202.94772%2014.0523%202.5%2013.5%202.5Z%22%2F%3E%3Cpath%20d%3D%22M2.5%205.5V13.5C2.5%2013.7652%202.60536%2014.0196%202.79289%2014.2071C2.98043%2014.3946%203.23478%2014.5%203.5%2014.5H12.5C12.7652%2014.5%2013.0196%2014.3946%2013.2071%2014.2071C13.3946%2014.0196%2013.5%2013.7652%2013.5%2013.5V5.5%22%2F%3E%3Cpath%20d%3D%22M6.5%209.5H9.5%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") center / contain no-repeat;'," -webkit-mask-repeat: no-repeat;"," mask-repeat: no-repeat;"," -webkit-mask-position: center;"," mask-position: center;"," -webkit-mask-size: 16px 16px;"," mask-size: 16px 16px;","}"].join(`
|
|
30
|
+
`);function va(n,a){let o=String(a??"").trim();return o.length>0&&String(n??"").trim()===o}e(va,"isOwnSettingsNavRow");function Wn(n,a){for(let o of n){if(o.type==="characterData"){let v=o.target.parentElement;if(v!==null&&v.closest(a)!==null)return!0;continue}let h=o.target;if(h&&h.nodeType===1&&(typeof h.matches=="function"&&h.matches(a)||typeof h.closest=="function"&&h.closest(a)!==null))return!0;if(o.addedNodes)for(let v of o.addedNodes){if(v.nodeType!==1)continue;let f=v;if(typeof f.matches=="function"&&f.matches(a)||typeof f.querySelector=="function"&&f.querySelector(a)!==null||typeof f.closest=="function"&&f.closest(a)!==null)return!0}if(o.removedNodes)for(let v of o.removedNodes){if(v.nodeType!==1)continue;let f=v;if(typeof f.matches=="function"&&f.matches(a)||typeof f.querySelector=="function"&&f.querySelector(a)!==null||typeof f.closest=="function"&&f.closest(a)!==null)return!0}}return!1}e(Wn,"mutationTouches");function Pr(n,a){return va(n.textContent,a)?Array.from(n.children).some(v=>v.tagName==="SPAN"&&(v.className.includes("navIcon")||v.getAttribute("aria-hidden")==="true"))||!!n.querySelector?.('[class*="navIcon"]')?n.hasAttribute(Nt)?(n.removeAttribute(Nt),!0):!1:n.getAttribute(Nt)===""?!1:(n.setAttribute(Nt,""),!0):n.hasAttribute(Nt)?(n.removeAttribute(Nt),!0):!1}e(Pr,"applySettingsNavIcon");function Or(n){return n.hasAttribute(Nt)?(n.removeAttribute(Nt),!0):!1}e(Or,"restoreSettingsNavIcon");function Fr(n){typeof document>"u"||typeof MutationObserver>"u"||n.effect(()=>{let a="dsham-nav-icon-style",o=document.getElementById(a);o===null?(o=document.createElement("style"),o.id=a,o.textContent=tr,(document.head??document.documentElement).append(o)):o.textContent!==tr&&(o.textContent=tr);let h=!1,v=!1,f=e(()=>{if(v=!1,h)return;let N=n.locale.bind(_e)("archived.badge");for(let H of document.querySelectorAll(ga))Pr(H,N)},"sync"),k=e(()=>{v||h||(v=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(f):setTimeout(f,16))},"schedule");f();let E=new MutationObserver(N=>{Wn(N,'[role="dialog"] nav')&&k()});return E.observe(document.body,{childList:!0,subtree:!0,characterData:!0}),()=>{h=!0,E.disconnect();for(let N of document.querySelectorAll(`[${Nt}]`))Or(N);o?.remove()}},"archive-manager: settings nav icon")}e(Fr,"installSettingsNavIcon");let ba=[".dsham_settings{container-type:inline-size;min-width:0;box-sizing:border-box;width:100%;padding:0 0 32px;color:var(--dsw-alias-label-primary)}",".dsham_settingsHeader{display:flex;flex-direction:column;align-items:stretch;gap:16px;margin-bottom:16px}",".dsham_settings h2{margin:0;font-size:24px;line-height:32px;font-weight:600;letter-spacing:-.4px;white-space:nowrap}",".dsham_settingsIntro{margin:12px 0 0;max-width:42em;color:var(--dsw-alias-label-tertiary);font-size:14px;line-height:22px}",".dsham_settingsToolbar{display:flex;align-items:center;gap:8px;margin-bottom:16px;width:100%;min-width:0}",".dsham_settingsSearch{display:flex;align-items:center;gap:8px;min-width:0;width:100%;flex-wrap:nowrap}","@container(max-width:520px){.dsham_settingsSearch{flex-wrap:wrap}}",".dsham_settingsSearch .dsham_searchField{flex:1 1 0;min-width:120px;width:auto;box-sizing:border-box}",".dsham_viewSortContainer{flex:0 0 auto;position:relative;box-sizing:border-box}",".dsham_viewSortBtn{height:32px!important;padding:0 8px!important;font-size:13px!important;box-sizing:border-box}",".dsham_viewSortBtn.has-filter{border-color:var(--dsw-alias-state-business-primary)!important;color:var(--dsw-alias-state-business-primary)!important}",".dsham_settingsFilter{display:inline-flex;position:relative}",".dsham_settingsSearch .dsham_projectFilter{flex:0 0 auto;max-width:120px;min-width:0;box-sizing:border-box}",".dsham_settingsSearch .dsham_projectFilter > span{display:inline-block;max-width:100%;box-sizing:border-box}",".dsham_settingsSearch .dsham_projectFilter .dsham_menuSelectBtn{display:inline-flex!important;width:100%;max-width:120px;padding:0 8px;box-sizing:border-box;overflow:hidden}",".dsham_settingsSearch .dsham_projectFilter .dsham_selectLabel{flex:1 1 auto;min-width:0;max-width:80px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}",".dsham_settingsSearch .dsham_dateFilter{flex:0 0 125px;width:125px;min-width:125px;position:relative;box-sizing:border-box}",".dsham_dateRange{width:100%;box-sizing:border-box}",".dsham_dateTrigger{height:32px!important;padding:0 8px!important;gap:5px!important;border:0.5px solid var(--dsw-alias-border-l2)!important;border-radius:var(--dsw-radius-sm,8px)!important;background:var(--dsw-alias-bg-layer-1)!important;box-sizing:border-box}",".dsham_dateTrigger .dsham_dateText{font-size:12px!important;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".dsham_srOnly{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;opacity:0;pointer-events:none}",".dsham_menuSelectBtn{display:inline-flex!important;align-items:center;justify-content:space-between;gap:6px;width:auto!important;max-width:100%;min-width:0!important;height:32px!important;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);box-sizing:border-box;font:inherit;font-size:13px;cursor:pointer}",".dsham_selectLabel{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:normal;text-align:left}",".dsham_settingsGroup{margin:0 0 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-button-elevated-fill));overflow:hidden;transition:border-color 150ms ease}",".dsham_settingsGroupHeading{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:38px;padding:0 10px;margin:0;user-select:none}",".dsham_settingsGroupTitle{display:flex;align-items:center;gap:8px;min-width:0;margin:0;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600}",".dsham_settingsGroupTitle svg{flex:none;color:var(--dsw-alias-label-secondary)}",".dsham_settingsCount{flex:none;color:var(--dsw-alias-label-tertiary);font-size:12px}",".dsham_settingsList{display:grid;overflow:hidden;border:0;border-top:1px solid var(--dsw-alias-border-l2);border-radius:0;background:transparent}",".dsham_settingsList[hidden]{display:none!important;border:0!important}",".dsham_settingsRow{display:grid;grid-template-columns:16px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:40px;padding:4px 10px;border-bottom:1px solid var(--dsw-alias-border-l2)}",".dsham_settingsRow:last-child{border-bottom:0}",".dsham_settingsContent{min-width:0;flex:1}",".dsham_settingsMeta{margin-top:1px;color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:13px}",".dsham_settingsActions{display:flex;align-items:center;gap:4px;flex:none}",".dsham_settingsEmpty{padding:28px 8px;color:var(--dsw-alias-label-secondary);text-align:center}",".dsham_settingsError{margin-top:10px;color:var(--dsw-alias-state-error-primary);font-size:12px;white-space:pre-line}","@container(max-width:520px){.dsham_settingsHeader{margin-bottom:16px}.dsham_settingsGroup{margin-bottom:10px}.dsham_settingsRow{padding:4px 8px}.dsham_settingsActions{gap:2px}}"].join(""),ya=".dsham_settingsTitleLink{display:block;max-width:100%;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;font-weight:600;line-height:16px;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.dsham_settingsTitleLink:hover:not(:disabled){text-decoration:underline;text-underline-offset:3px}.dsham_settingsTitleLink:disabled{cursor:default;opacity:.6}.dsham_groupToggle{display:flex;align-items:center;gap:8px;min-width:0;max-width:100%;padding:4px 0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.dsham_groupToggle span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dsham_settingsRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.dsham_settingsRow[data-selected=true]{background:var(--dsw-alias-interactive-bg-hover)}.dsham_settingsTitleLink:focus-visible,.dsham_groupToggle:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#3b82f6);outline-offset:2px}@container(max-width:400px){.dsham_settingsRow{gap:6px;padding:4px 6px}.dsham_settingsActions{gap:0}.dsham_settingsMeta{font-size:10px}}.dsham_settingsGroupMeta{display:flex;align-items:center;gap:8px;flex:none;flex-wrap:wrap}.dsham_settingsStatus{margin-top:10px;color:var(--dsw-alias-label-secondary);font-size:12px}.dsham_checkbox{flex:none;box-sizing:border-box;width:16px;height:16px;margin:0;accent-color:var(--dsw-alias-brand-primary);cursor:pointer}.dsham_checkbox:focus-visible{outline:var(--dsw-focus-ring-width,1px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.dsham_checkbox:disabled{opacity:.5;cursor:default}button.dsham_favoriteOn{color:#e8b931}button.dsham_favoriteOn:not(:disabled):hover{color:#e8b931!important;border-color:#e8b931!important}",wa=".dsham_settingsTitleRow{display:flex;align-items:center;gap:8px 12px;min-width:0;flex-wrap:wrap}.dsham_settingsLinks{display:flex;align-items:center;gap:8px;flex-wrap:wrap}@media(max-width:720px){.dsham_settingsTitleRow{flex-wrap:wrap}}",Sa=".dsham_settingsSelection{margin:-8px 0 16px;padding:4px 0 12px;border-bottom:1px solid var(--dsw-alias-border-l2)}.dsham_settingsSelectionMain{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;min-height:36px}.dsham_settingsSelectionSummary{display:flex;flex-wrap:wrap;align-items:center;gap:12px;min-width:0;max-width:100%}.dsham_settingsSelectionToggle{display:inline-flex;flex:none;white-space:nowrap;align-items:center;gap:12px;color:var(--dsw-alias-label-primary);font-size:13px;line-height:20px;cursor:pointer}.dsham_settingsSelectionActions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;max-width:100%;margin-left:auto}.dsham_settingsSelectionScope{margin:8px 0 0;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:20px;overflow-wrap:anywhere}";function nr({id:n,className:a,value:o,options:h,onChange:v,disabled:f=!1,"aria-label":k,title:E,tabIndex:N,"aria-hidden":H}){let[A,z]=l.useState(!1),O=l.useMemo(()=>h.map(Re=>({id:Re.value,label:Re.label})),[h]),d=h.find(Re=>Re.value===o),oe=d?.label??k;return(0,s.jsx)("div",{id:n,tabIndex:N,"aria-hidden":H,className:a===void 0?"dsham_settingsFilter":`dsham_settingsFilter ${a}`,children:(0,s.jsx)(u.Menu,{open:A,onClose:e(()=>z(!1),"onClose"),onSelect:e(Re=>{f||v(Re),z(!1)},"onSelect"),selectedId:o,align:"start",portal:!0,dense:!0,listClassName:"dsham_selectDropdown",anchor:(0,s.jsxs)(u.Button,{variant:"outline",size:"sm",role:"combobox","aria-label":k,"aria-expanded":A,disabled:f,tabIndex:N,"aria-hidden":H,title:E??d?.title??d?.label??k,className:"dsham_menuSelectBtn"+(A?" is-open":""),onClick:e(()=>{f||z(Re=>!Re)},"onClick"),children:[(0,s.jsx)("span",{className:"dsham_selectLabel",children:oe}),(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",style:{marginLeft:4,transition:"transform 150ms ease",transform:A?"rotate(180deg)":"none",flex:"none"},children:(0,s.jsx)("path",{d:"m4 6 4 4 4-4"})})]}),items:O})})}e(nr,"ArchiveProjectSelect");function xa({id:n,t:a,disabled:o=!1,favoritesOnly:h,setFavoritesOnly:v,favoriteBusy:f=!1,sortBy:k,setSortBy:E,options:N}){let[H,A]=l.useState(!1),z=l.useMemo(()=>{let pe=[];typeof v=="function"&&(pe.push({type:"label",id:"lbl_view_filter",text:a("organizer.favoriteFilter")||"\u7B5B\u9009\u4F1A\u8BDD"}),pe.push({id:"filter:all",label:a("organizer.allSessions")||"\u5168\u90E8\u4F1A\u8BDD"}),pe.push({id:"filter:favorites",label:a("organizer.favoritesOnly")||"\u53EA\u770B\u6536\u85CF"}),pe.push({type:"separator",id:"sep_view_filter"})),pe.push({type:"label",id:"lbl_view_sort",text:a("archives.sortLabel")||"\u6392\u5E8F\u65B9\u5F0F"});for(let kt of N)pe.push({id:`sort:${kt.value}`,label:kt.label});return pe},[a,v,N]),O=e(pe=>{pe.startsWith("filter:")?typeof v=="function"&&!f&&v(pe==="filter:favorites"):pe.startsWith("sort:")&&E(pe.slice(5)),A(!1)},"onSelect"),d=N.find(pe=>pe.value===k),oe=h?a("organizer.favoritesOnly")||"\u53EA\u770B\u6536\u85CF":a("organizer.allChats")||"\u5168\u90E8\u804A\u5929",Re=`${oe} \xB7 ${d?.label??k}`;return(0,s.jsxs)("div",{className:"dsham_viewSortContainer",children:[(0,s.jsx)(u.Menu,{open:H,onClose:e(()=>A(!1),"onClose"),onSelect:O,selectedIds:[h?"filter:favorites":"filter:all",`sort:${k}`],align:"end",portal:!0,dense:!0,listClassName:"dsham_viewSortDropdown",anchor:(0,s.jsxs)(u.Button,{variant:"outline",size:"sm",role:"combobox","aria-label":a("archives.viewOptions")||"\u89C6\u56FE\u9009\u9879","aria-expanded":H,disabled:o,title:Re,className:"dsham_menuSelectBtn dsham_viewSortBtn"+(H?" is-open":"")+(h?" has-filter":""),onClick:e(()=>{o||A(pe=>!pe)},"onClick"),children:[(0,s.jsxs)("svg",{viewBox:"0 0 16 16",width:13,height:13,fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"none",marginRight:4},children:[(0,s.jsx)("line",{x1:2.5,y1:4.5,x2:13.5,y2:4.5}),(0,s.jsx)("circle",{cx:5,cy:4.5,r:1.5,fill:"var(--dsw-alias-bg-layer-1)"}),(0,s.jsx)("line",{x1:2.5,y1:11.5,x2:13.5,y2:11.5}),(0,s.jsx)("circle",{cx:11,cy:11.5,r:1.5,fill:"var(--dsw-alias-bg-layer-1)"})]}),(0,s.jsx)("span",{className:"dsham_selectLabel",children:oe}),(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:11,height:11,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",style:{marginLeft:3,transition:"transform 150ms ease",transform:H?"rotate(180deg)":"none",flex:"none"},children:(0,s.jsx)("path",{d:"m4 6 4 4 4-4"})})]}),items:z})]})}e(xa,"ArchiveViewSortMenu");function Hr({selectedCount:n,hiddenCount:a,allVisibleSelected:o,selectedVisibleCount:h,visibleCount:v,busy:f,t:k,onToggle:E,onClear:N,onRestore:H,onDelete:A,onArchive:z}){let O=n>0;return(0,s.jsxs)("div",{className:"dsham_settingsSelection",children:[(0,s.jsxs)("div",{className:"dsham_settingsSelectionMain",children:[(0,s.jsxs)("div",{className:"dsham_settingsSelectionSummary",children:[(0,s.jsxs)("label",{className:"dsham_settingsSelectionToggle",title:k("archives.selectAllFiltered"),children:[(0,s.jsx)(Br,{checked:o,indeterminate:h>0&&!o,disabled:f||v===0,label:k("archives.selectAllFiltered"),onChange:e(d=>E(d.target.checked),"onChange")}),(0,s.jsx)("span",{"aria-live":"polite",children:O?k("archives.selectedCount",{n}):k("archives.selectAllFiltered")})]}),O&&g({disabled:f,"aria-label":k("archives.clearSelection"),onClick:N,children:k("archives.clearSelectionShort")})]}),O&&(0,s.jsxs)("div",{className:"dsham_settingsSelectionActions",children:z?[g({disabled:f,onClick:z,children:k("archives.archiveSelected")})]:[g({disabled:f,"aria-label":k("archives.restoreSelected"),onClick:H,children:k("archives.restore")}),g({disabled:f,className:"dsham_btnDanger","aria-label":k("archives.deleteSelected"),onClick:A,children:k("archives.deleteSelectionShort")})]})]}),a>0&&(0,s.jsx)("p",{className:"dsham_settingsSelectionScope",role:"status",children:k("archives.selectionHiddenHint",{hidden:a})})]})}e(Hr,"ArchiveSelectionToolbar");function Br({checked:n,indeterminate:a=!1,disabled:o=!1,label:h,onChange:v}){return(0,s.jsx)(ur,{checked:n,indeterminate:a,disabled:o,label:h,onChange:v})}e(Br,"ArchiveSelectionCheckbox");function Ur(){return(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,"aria-hidden":!0,focusable:"false",children:[3.5,8,12.5].map(n=>(0,s.jsx)("circle",{cx:n,cy:8,r:1.15,fill:"none",stroke:"currentColor",strokeWidth:1.5},n))})}e(Ur,"moreIcon");function ka({busy:n,title:a,t:o,onPreview:h,onRestoreOpen:v,onDelete:f,onCopyId:k}){let[E,N]=(0,l.useState)(!1),H=e(z=>{if(!n){if(N(!1),z==="copyId")return k?.();if(z==="preview")return h?.();if(z==="restoreOpen")return v?.();z==="delete"&&f?.()}},"choose"),A=[...h?[{id:"preview",label:o("discovery.preview"),icon:(0,s.jsx)(u.IconBrowseOutlineMedium,{size:16}),danger:!1}]:[],...v?[{id:"restoreOpen",label:o("archives.restoreOpen"),icon:(0,s.jsx)(u.IconUnarchiveOutlineMedium,{size:16}),danger:!1}]:[],...k?[{id:"copyId",label:o("details.copyId"),icon:(0,s.jsx)(u.IconCopyOutlineMedium,{size:16}),danger:!1}]:[],...f?[{id:"delete",label:o("menu.deleteSession"),icon:(0,s.jsx)(u.IconTrashOutlineMedium,{size:16}),danger:!0}]:[]];return(0,s.jsx)(u.Menu,{open:!n&&E,align:"end",portal:!0,dense:!0,items:A,onSelect:H,onClose:e(()=>N(!1),"onClose"),anchor:g({variant:"outline",className:"dsham_iconAction",disabled:n,title:o("archives.moreActions"),"aria-label":o("archives.moreActions")+o("common.separator")+a,"aria-haspopup":"menu","aria-expanded":E&&!n,icon:Ur(),onClick:e(()=>{n||N(z=>!z)},"onClick")})})}e(ka,"ArchivedSessionMenu");function Ca({group:n,busy:a,onArchive:o,onRestore:h,onDelete:v,t:f}){let k=n.key===qn,E=o?[{id:"archive",label:f(k?"archives.archiveUngrouped":"archives.archiveProject"),icon:(0,s.jsx)(u.IconArchiveOutlineMedium,{size:16}),danger:!0}]:[{id:"restore",label:f(k?"archives.restoreUngrouped":"archives.restoreProject"),icon:(0,s.jsx)(u.IconUnarchiveOutlineMedium,{size:16}),danger:!1},{id:"delete",label:f(k?"archives.deleteUngrouped":"archives.deleteProject"),icon:(0,s.jsx)(u.IconTrashOutlineMedium,{size:16}),danger:!0}],[N,H]=(0,l.useState)(!1),A=f(k?"archives.ungroupedActions":"archives.projectActions",{name:n.title}),z=e(O=>{a||(O==="archive"?o?.():O==="restore"?h?.():O==="delete"&&v?.())},"choose");return(0,s.jsx)(u.Menu,{open:!a&&N,align:"end",portal:!0,dense:!0,items:E,onSelect:e(O=>{H(!1),z(O)},"onSelect"),onClose:e(()=>H(!1),"onClose"),anchor:g({variant:"outline",className:"dsham_iconAction",disabled:a,"aria-label":A,"aria-haspopup":"menu","aria-expanded":N&&!a,icon:Ur(),onClick:e(()=>{a||H(O=>!O)},"onClick")})})}e(Ca,"ArchivedGroupActions");let qn="__ungrouped__";function Ea(n){return n===qn?{scope:"ungrouped"}:{scope:"workspace",workspaceId:n}}e(Ea,"archivedBatchTargetForGroup");function bn(n,a,o){let h=[...new Set(n??[])];if(o.scope==="all")return h;if(o.scope==="sessions"){let f=new Set(o.sessionIds??[]);return h.filter(k=>f.has(k))}if(o.scope==="workspace"){let f=new Set(a.find(k=>k.workspaceId===o.workspaceId)?.sessionIds??[]);return h.filter(k=>f.has(k))}let v=new Set(a.flatMap(f=>f.sessionIds));return h.filter(f=>!v.has(f))}e(bn,"deriveArchivedBatchIds");function Wr(n){return[...new Set(n.flatMap(a=>a.sessions.map(o=>o.id)))]}e(Wr,"archivedSessionIdsInGroups");function qr(n,a){let o=new Set(a);return[...new Set(n)].filter(h=>o.has(h))}e(qr,"pruneArchivedSelection");function rr(n,a,o){let h=new Set(n);for(let v of a)o?h.add(v):h.delete(v);return[...h]}e(rr,"toggleArchivedSelection");function Vr(n,a){let o=n.deletedSessionIds.length,h=n.skippedSessionIds.length;return n.failures.length>0?{kind:"error",message:a("archives.deletePartial",{deleted:o,skipped:h,failed:n.failures.length,detail:n.failures[0].message})}:h>0&&o>0?{kind:"notice",message:a("archives.deleteSuccessWithSkipped",{deleted:o,skipped:h})}:h>0?{kind:"notice",message:a("archives.deleteSkipped",{n:h})}:{kind:"notice",message:a("archives.deleteSuccess",{n:o})}}e(Vr,"archivedDeleteFeedback");function $r(n,a){let o=new Set(a);return Object.values(n).filter(h=>h.origin!=="subagent"&&!h.blank&&!o.has(h.id)).map(h=>h.id)}e($r,"unarchivedSessionIds");function Gr(n,a,o,h){let v=a.map(E=>({key:E.workspaceId,title:E.title,ids:new Set(E.sessionIds),sessions:[]})),f=[];for(let E of o){let N=n[E];if(N===void 0||N.origin==="subagent")continue;let H=v.find(A=>A.ids?.has(E));(H===void 0?f:H.sessions).push(N)}let k=v.filter(E=>E.sessions.length>0);return f.length>0&&k.push({key:qn,title:h,sessions:f}),k}e(Gr,"deriveArchivedGroups");function Kr(n,a,o,h,v=[]){let f=e((A,z)=>String(A).localeCompare(String(z),void 0,{numeric:!0,sensitivity:"base"}),"compareText"),k=new Map;if(Array.isArray(v))for(let A=0;A<v.length;A++)k.set(v[A],A);let E=e(A=>{let z=a==="created"?o[A.id]:A.updatedAt;return typeof z=="number"&&Number.isFinite(z)?z:Number.NEGATIVE_INFINITY},"timestampOf"),N=e((A,z)=>{if(a==="archived"){let O=k.get(A.id)??-1,oe=(k.get(z.id)??-1)-O;if(oe!==0)return oe}if(a!=="alphabetical"){let O=E(z)-E(A);if(Number.isFinite(O)&&O!==0)return O}return f(lt(A,h),lt(z,h))||f(A.id,z.id)},"compareSessions");return n.map(A=>({...A,sessions:[...A.sessions].sort(N)})).sort((A,z)=>{if(a==="archived"){let O=A.sessions[0]?.id,d=z.sessions[0]?.id,oe=O!==void 0?k.get(O)??-1:-1,pe=(d!==void 0?k.get(d)??-1:-1)-oe;if(pe!==0)return pe}if(a!=="alphabetical"){let O=E(z.sessions[0])-E(A.sessions[0]);if(Number.isFinite(O)&&O!==0)return O}return f(A.title,z.title)||f(A.key,z.key)})}e(Kr,"sortArchivedGroups");let Yr={...Ys,...Is,"locale.language":"zh","service.unavailable":"\u670D\u52A1\u5C1A\u672A\u5C31\u7EEA\uFF0C\u8BF7\u91CD\u8BD5","common.close":"\u5173\u95ED","entry.location.title":"\u5165\u53E3\u5C55\u793A\u4F4D\u7F6E","entry.location.desc":"\u9009\u62E9\u5F52\u6863\u7BA1\u7406\u5165\u53E3\u7684\u5C55\u793A\u4F4D\u7F6E\uFF08\u81F3\u5C11\u4FDD\u7559\u4E00\u5904\uFF0C\u9632\u6B62\u65E0\u6CD5\u6253\u5F00\u9762\u677F\uFF09\u3002","entry.location.both":"\u4E24\u8FB9\u663E\u793A","entry.location.sidebar":"\u4EC5\u4FA7\u8FB9\u680F","entry.location.settings":"\u4EC5\u8BBE\u7F6E","entry.location.saveFailed":"\u4FDD\u5B58\u5165\u53E3\u8BBE\u7F6E\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u6216\u91CD\u542F\u5BBF\u4E3B\u8FDB\u7A0B","sidebar.favoriteStar.title":"\u4FA7\u680F\u6536\u85CF\u661F\u6807","sidebar.favoriteStar.desc":"\u5728\u4F1A\u8BDD\u5217\u8868\u884C\u524D\u663E\u793A\u6536\u85CF\u661F\u6807\u3002\u5173\u95ED\u540E\u4E0D\u663E\u793A\u56FE\u6807\uFF0C\u4ECD\u53EF\u901A\u8FC7\u83DC\u5355\u6536\u85CF\u548C\u7B5B\u9009\u3002","sidebar.favoriteStar.toggle":"\u5207\u6362\u4FA7\u680F\u6536\u85CF\u661F\u6807","update.entry.title":"\u5728\u7EBF\u66F4\u65B0","update.entry.desc":"\u5141\u8BB8\u68C0\u67E5\u5E76\u5728\u7EBF\u5B89\u88C5\u5F52\u6863\u7BA1\u7406\u5668\u7684\u65B0\u7248\u672C\u3002\u5173\u95ED\u540E\u9690\u85CF\u66F4\u65B0\u5165\u53E3\u3002","update.entry.toggle":"\u5207\u6362\u5728\u7EBF\u66F4\u65B0","update.entry.locked":"\u5728\u7EBF\u66F4\u65B0\u5DF2\u88AB\u5BBF\u4E3B\u914D\u7F6E\u9501\u5B9A\u7981\u7528","archives.archiveProject":"\u5F52\u6863\u8BE5\u9879\u76EE\u7684\u5168\u90E8\u804A\u5929","archives.archiveUngrouped":"\u5F52\u6863\u5168\u90E8\u672A\u5206\u7EC4\u804A\u5929","archives.archiveProjectDesc":"\u5C06\u201C{name}\u201D\u4E2D\u5168\u90E8 {n} \u6761\u672A\u5F52\u6863\u4F1A\u8BDD\u5F52\u6863\uFF0C\u4E0D\u53D7\u5F53\u524D\u641C\u7D22\u7B5B\u9009\u5F71\u54CD\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u6062\u590D\u3002","archives.archiveUngroupedDesc":"\u5C06\u5168\u90E8 {n} \u6761\u672A\u5206\u7EC4\u7684\u672A\u5F52\u6863\u4F1A\u8BDD\u5F52\u6863\uFF0C\u4E0D\u53D7\u5F53\u524D\u641C\u7D22\u7B5B\u9009\u5F71\u54CD\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u6062\u590D\u3002","archives.tab.archived":"\u5DF2\u5F52\u6863","archives.tab.unarchived":"\u672A\u5F52\u6863","archives.searchUnarchived":"\u641C\u7D22\u672A\u5F52\u6863\u804A\u5929","archives.emptyUnarchived":"\u6682\u65E0\u672A\u5F52\u6863\u4F1A\u8BDD\u3002","archives.archiveSelected":"\u5F52\u6863","archives.openSession":"\u6253\u5F00","archives.moreActions":"\u66F4\u591A\u64CD\u4F5C","archives.archiveSelectedDesc":"\u5C06\u9009\u4E2D\u7684\u4F1A\u8BDD\u5F52\u6863\uFF0C\u5305\u542B\u5F53\u524D\u7B5B\u9009\u9690\u85CF\u7684\u5DF2\u9009\u9879\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u67E5\u770B\u548C\u6062\u590D\u3002","archives.archiveSuccess":"\u5DF2\u5F52\u6863 {n} \u6761\u4F1A\u8BDD\u3002","archives.archiveBatchFailed":"\u6279\u91CF\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.navigationUnavailable":"\u5F53\u524D\u5BBF\u4E3B\u65E0\u6CD5\u4FDD\u6301\u5F52\u6863\u5BF9\u8BDD\uFF0C\u8BF7\u4F7F\u7528\u201C\u6062\u590D\u5E76\u6253\u5F00\u201D\u3002","archives.sessionNotRetained":"\u5BBF\u4E3B\u672A\u4FDD\u7559\u76EE\u6807\u4F1A\u8BDD\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u6216\u6062\u590D\u540E\u518D\u8BD5\u3002","archives.restoreOpen":"\u6062\u590D\u6253\u5F00","archives.selectedCount":"\u5DF2\u9009 {n} \u6761","archives.selectionHiddenHint":"\u542B\u5F53\u524D\u672A\u663E\u793A\u7684 {hidden} \u6761\uFF0C\u4E5F\u5C06\u53C2\u4E0E\u64CD\u4F5C","archives.clearSelectionShort":"\u6E05\u7A7A","archives.restore":"\u6062\u590D","archives.archiveTitle":"\u5F52\u6863 {n} \u4E2A\u804A\u5929\uFF1F","archives.deleteSelectionShort":"\u5220\u9664","archives.clearSelection":"\u6E05\u7A7A\u9009\u62E9","group.ungrouped":"\u672A\u5206\u7EC4","session.new":"\u65B0\u4F1A\u8BDD","menu.deleteSession":"\u5220\u9664\u4F1A\u8BDD","archived.badge":"\u5F52\u6863\u4F1A\u8BDD","archives.title":"\u5F52\u6863\u4F1A\u8BDD","archives.description":"\u7BA1\u7406\u5DF2\u5F52\u6863\u4F1A\u8BDD\uFF0C\u6216\u9009\u62E9\u672A\u5F52\u6863\u4F1A\u8BDD\u8FDB\u884C\u6279\u91CF\u5F52\u6863\u3002","archives.viewProject":"GitHub","archives.feedback":"\u95EE\u9898\u53CD\u9988","archives.empty":"\u6682\u65E0\u5DF2\u5F52\u6863\u4F1A\u8BDD","archives.emptyFiltered":"\u6CA1\u6709\u7B26\u5408\u7B5B\u9009\u6761\u4EF6\u7684\u804A\u5929","archives.searchPlaceholder":"\u641C\u7D22\u5DF2\u5F52\u6863\u804A\u5929","archives.sortLabel":"\u6392\u5E8F\u65B9\u5F0F","archives.viewOptions":"\u89C6\u56FE\u9009\u9879","archives.sortArchived":"\u6700\u8FD1\u5F52\u6863","archives.sortUpdated":"\u66F4\u65B0\u65F6\u95F4","archives.sortCreated":"\u521B\u5EFA\u65F6\u95F4","archives.sortAlphabetical":"\u6309\u5B57\u6BCD\u987A\u5E8F","archives.projectFilter":"\u6309\u9879\u76EE\u7B5B\u9009","archives.allProjects":"\u6240\u6709\u9879\u76EE","discovery.timeRange":"\u65F6\u95F4\u8303\u56F4","organizer.allChats":"\u5168\u90E8\u804A\u5929","archives.sessionCount":"{n} \u4E2A\u804A\u5929","archives.selectAllFiltered":"\u5168\u9009\u5F53\u524D\u7B5B\u9009\u7ED3\u679C","archives.selectSession":"\u9009\u62E9\u4F1A\u8BDD\u201C{name}\u201D","archives.restoreSelected":"\u6062\u590D\u6240\u9009","archives.deleteSelected":"\u5220\u9664\u6240\u9009","archives.timestamp":"{date}\uFF0C{time}","archives.restoreProject":"\u6062\u590D\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.restoreUngrouped":"\u5168\u90E8\u6062\u590D","archives.deleteProject":"\u5220\u9664\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.deleteUngrouped":"\u5168\u90E8\u5220\u9664","archives.projectActions":"\u9879\u76EE\u201C{name}\u201D\u7684\u5F52\u6863\u64CD\u4F5C","archives.ungroupedActions":"\u672A\u5206\u7EC4\u804A\u5929\u7684\u5F52\u6863\u64CD\u4F5C","archives.restoreSuccess":"\u5DF2\u6062\u590D {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u3002","archives.restoreBatchFailed":"\u6279\u91CF\u6062\u590D\u5931\u8D25\uFF1A{detail}","archives.deleteSelectedTitle":"\u5220\u9664\u6240\u9009\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteSelectedDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u6240\u9009\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\uFF08\u542B\u6B63\u5728\u8FD0\u884C\u7684\uFF09\u548C\u8BB0\u5F55\u3002\u5176\u4ED6\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteSelectedConfirm":"\u5220\u9664\u6240\u9009\u804A\u5929","archives.deleteProjectTitle":"\u5220\u9664\u201C{name}\u201D\u4E2D\u7684\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteProjectDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u201C{name}\u201D\u4E2D\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\u548C\u8BB0\u5F55\u3002\u9879\u76EE\u76EE\u5F55\u548C\u672A\u5F52\u6863\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteProjectConfirm":"\u5220\u9664\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.deleteUngroupedTitle":"\u5220\u9664\u672A\u5206\u7EC4\u7684\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteUngroupedDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u672A\u5206\u7EC4\u4E2D\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\u548C\u8BB0\u5F55\u3002\u5176\u4ED6\u9879\u76EE\u548C\u672A\u5F52\u6863\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteUngroupedConfirm":"\u5220\u9664\u672A\u5206\u7EC4\u7684\u5168\u90E8\u804A\u5929","archives.deleteBatchPending":"\u6B63\u5728\u5220\u9664\u5DF2\u5F52\u6863\u804A\u5929\u2026","archives.deleteSuccess":"\u5DF2\u5220\u9664 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u3002","archives.deleteSuccessWithSkipped":"\u5DF2\u5220\u9664 {deleted} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\uFF1B\u53E6\u6E05\u7406 {skipped} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\u3002","archives.deleteSkipped":"\u5DF2\u6E05\u7406 {n} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\u3002","archives.deletePartial":"\u5DF2\u5220\u9664 {deleted} \u4E2A\u804A\u5929\uFF0C\u6E05\u7406 {skipped} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\uFF1B{failed} \u4E2A\u5220\u9664\u5931\u8D25\uFF1A{detail}","archives.unarchiveUnknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u53D6\u6D88\u5F52\u6863\u3002","archives.unarchiveFailed":"\u53D6\u6D88\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.archiveUnknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u5F52\u6863\u3002","archives.archiveFailed":"\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.archiveActive":"\u4F1A\u8BDD\u4ECD\u5728\u8FD0\u884C\uFF08{kinds}\uFF09\u3002","archiveActive.title":"\u505C\u6B62\u5E76\u5F52\u6863","archiveActive.desc":"\u201C{name}\u201D\u4ECD\u6709\u6B63\u5728\u8FDB\u884C\u7684\u5DE5\u4F5C\uFF1A{kinds}\u3002\u5F52\u6863\u524D\u4F1A\u505C\u6B62\u8FD9\u4E9B\u5DE5\u4F5C\u3002","archiveActive.confirm":"\u505C\u6B62\u5E76\u5F52\u6863","archives.forkFailed":"\u5206\u53C9\u4F1A\u8BDD\u5931\u8D25\uFF1A{detail}","deleteSession.title":"\u5220\u9664\u4F1A\u8BDD","deleteSession.confirmTitle":"\u5220\u9664\u4F1A\u8BDD\uFF1F","deleteSession.desc":"\u5C06\u6C38\u4E45\u5220\u9664\u4F1A\u8BDD\u201C{name}\u201D\u53CA\u5176\u5B50\u4EE3\u7406\uFF08\u542B\u6B63\u5728\u8FD0\u884C\u7684\uFF09\u548C\u5168\u90E8\u8BB0\u5F55\uFF08\u5BF9\u8BDD\u5185\u5BB9\u3001\u7EDF\u8BA1\u3001\u7F13\u5B58\uFF09\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","deleteSession.pending":"\u6B63\u5728\u5220\u9664\u4F1A\u8BDD\u2026","deleteSession.unknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\u6216\u5DF2\u88AB\u5220\u9664\u3002","deleteSession.failed":"\u5220\u9664\u4F1A\u8BDD\u5931\u8D25\uFF1A{detail}","menu.archiveWorkspace":"\u5F52\u6863\u5DE5\u4F5C\u533A","menu.copyWorkspacePath":"\u590D\u5236\u76EE\u5F55","menu.openInExplorer":"\u6253\u5F00\u76EE\u5F55","menu.moveSession":"\u79FB\u52A8\u5230\u5DE5\u4F5C\u533A","moveSession.noOtherWorkspaces":"\u6682\u65E0\u53EF\u79FB\u52A8\u7684\u5176\u4ED6\u5DE5\u4F5C\u533A","moveSession.success":"\u4F1A\u8BDD\u5DF2\u6210\u529F\u79FB\u52A8\u5230\u201C{name}\u201D","archiveWorkspace.title":"\u5F52\u6863 {n} \u4E2A\u4F1A\u8BDD\uFF1F","archiveWorkspace.desc":"\u8FD9\u4F1A\u5C06\u201C{name}\u201D\u4E2D\u7684\u4F1A\u8BDD\u5F52\u6863\u3002\u4E4B\u540E\u53EF\u4EE5\u5728\u201C\u8BBE\u7F6E \u2192 \u5F52\u6863\u4F1A\u8BDD\u201D\u4E2D\u627E\u5230\u5B83\u4EEC\u3002","archiveWorkspace.confirm":"\u5168\u90E8\u5F52\u6863","archiveWorkspace.pending":"\u6B63\u5728\u5F52\u6863\u4F1A\u8BDD\u2026","date.ymd":"{y}\u5E74{m}\u6708{d}\u65E5"},Zr={...Zs,...Ts,"locale.language":"en","service.unavailable":"The service is not ready. Please retry.","common.close":"Close","entry.location.title":"Entry placement","entry.location.desc":"Choose where to show the entry (at least one is retained to avoid losing access).","entry.location.both":"Both","entry.location.sidebar":"Sidebar only","entry.location.settings":"Settings only","entry.location.saveFailed":"Failed to save entry location. Please check your network or restart the host.","sidebar.favoriteStar.title":"Sidebar favorite star","sidebar.favoriteStar.desc":"Show favorite star on session rows in the sidebar. When disabled, the star is hidden while menu actions and filters stay available.","sidebar.favoriteStar.toggle":"Toggle sidebar favorite star","update.entry.title":"Online updates","update.entry.desc":"Allow checking and installing new versions online. Hides the update entry when disabled.","update.entry.toggle":"Toggle online updates","update.entry.locked":"Online updates are disabled by the host configuration.","archives.moreActions":"More actions","archives.archiveProject":"Archive all chats in this project","archives.archiveUngrouped":"Archive all ungrouped chats","archives.archiveProjectDesc":"Archive all {n} unarchived sessions in \u201C{name}\u201D, regardless of the current search filter. You can restore them in Archived.","archives.archiveUngroupedDesc":"Archive all {n} ungrouped, unarchived sessions, regardless of the current search filter. You can restore them in Archived.","archives.tab.archived":"Archived","archives.tab.unarchived":"Unarchived","archives.searchUnarchived":"Search unarchived chats","archives.emptyUnarchived":"No unarchived sessions.","archives.archiveSelected":"Archive","archives.openSession":"Open session","archives.archiveSelectedDesc":"Archive the selected sessions, including selections hidden by the current filter. You can view and restore them in Archived.","archives.archiveSuccess":"Archived {n} sessions.","archives.archiveBatchFailed":"Batch archive failed: {detail}","archives.navigationUnavailable":"This host cannot keep the conversation archived while opening it. Use \u201CRestore and open\u201D instead.","archives.sessionNotRetained":"The host did not keep the requested conversation open. Try again, or restore it before opening.","archives.restoreOpen":"Restore and open","archives.selectedCount":"{n} selected","archives.selectionHiddenHint":"Includes {hidden} hidden by the current filter; actions apply to them too.","archives.clearSelectionShort":"Clear","archives.restore":"Restore","archives.archiveTitle":"Archive {n} chats?","archives.deleteSelectionShort":"Delete","archives.clearSelection":"Clear selection","group.ungrouped":"Ungrouped","session.new":"New Session","menu.deleteSession":"Delete session","archived.badge":"Archived sessions","archives.title":"Archived sessions","archives.description":"Manage archived sessions or select unarchived sessions to archive in bulk.","archives.viewProject":"GitHub","archives.feedback":"Issues","archives.empty":"No archived sessions.","archives.emptyFiltered":"No chats match your filters.","archives.searchPlaceholder":"Search archived chats","archives.sortLabel":"Sort order","archives.viewOptions":"View options","archives.sortArchived":"Recently archived","archives.sortUpdated":"Last updated","archives.sortCreated":"Created","archives.sortAlphabetical":"Alphabetical","archives.projectFilter":"Filter by project","archives.allProjects":"All projects","discovery.timeRange":"Date range","organizer.allChats":"All chats","archives.sessionCount":"{n} chats","archives.selectAllFiltered":"Select all results","archives.selectSession":"Select chat {name}","archives.restoreSelected":"Restore selected","archives.deleteSelected":"Delete selected","archives.timestamp":"{date}, {time}","archives.restoreProject":"Restore all chats in this project","archives.restoreUngrouped":"Restore all","archives.deleteProject":"Delete all chats in this project","archives.deleteUngrouped":"Delete all","archives.projectActions":"Archive actions for project {name}","archives.ungroupedActions":"Archive actions for ungrouped chats","archives.restoreSuccess":"Restored {n} archived chats.","archives.restoreBatchFailed":"Could not restore the archived chats: {detail}","archives.deleteSelectedTitle":"Delete selected archived chats","archives.deleteSelectedDesc":"This permanently deletes the selected {n} archived chats, their child agents (including any that are still running), and their records. Other chats are not affected. This cannot be undone.","archives.deleteSelectedConfirm":"Delete selected chats","archives.deleteProjectTitle":"Delete archived chats in {name}","archives.deleteProjectDesc":"This permanently deletes the {n} archived chats in {name}, their child agents, and their records. The project directory and unarchived chats are not affected. This cannot be undone.","archives.deleteProjectConfirm":"Delete all project chats","archives.deleteUngroupedTitle":"Delete ungrouped archived chats","archives.deleteUngroupedDesc":"This permanently deletes the {n} ungrouped archived chats, their child agents, and their records. Other projects and unarchived chats are not affected. This cannot be undone.","archives.deleteUngroupedConfirm":"Delete all ungrouped chats","archives.deleteBatchPending":"Deleting archived chats\u2026","archives.deleteSuccess":"Deleted {n} archived chats.","archives.deleteSuccessWithSkipped":"Deleted {deleted} archived chats and cleared {skipped} stale archive entries for sessions that no longer exist.","archives.deleteSkipped":"Cleared {n} stale archive entries for sessions that no longer exist.","archives.deletePartial":"Deleted {deleted} chats and cleared {skipped} stale archive entries; {failed} could not be deleted: {detail}","archives.unarchiveUnknown":"This session no longer exists, so it cannot be unarchived.","archives.unarchiveFailed":"Could not unarchive the session: {detail}","archives.archiveUnknown":"This session no longer exists, so it cannot be archived.","archives.archiveFailed":"Could not archive the session: {detail}","archives.archiveActive":"This conversation is still running ({kinds}).","archiveActive.title":"Stop and archive","archiveActive.desc":"\u201C{name}\u201D still has work in progress: {kinds}. Archiving stops that work first.","archiveActive.confirm":"Stop and archive","archives.forkFailed":"Could not fork the session: {detail}","deleteSession.title":"Delete session","deleteSession.confirmTitle":"Delete session?","deleteSession.desc":"This permanently deletes session \u201C{name}\u201D, its child agents (including any that are still running), and all of its records (conversation, stats, cache). This cannot be undone.","deleteSession.pending":"Deleting session\u2026","deleteSession.unknown":"This session no longer exists or was already deleted.","deleteSession.failed":"Could not delete the session: {detail}","menu.archiveWorkspace":"Archive workspace","menu.copyWorkspacePath":"Copy folder path","menu.openInExplorer":"Open folder","menu.moveSession":"Move to workspace","moveSession.noOtherWorkspaces":"No other workspaces available","moveSession.success":"Session successfully moved to \u201C{name}\u201D","archiveWorkspace.title":"Archive {n} conversations?","archiveWorkspace.desc":"This archives all conversations in \u201C{name}\u201D. You can find them later in Archived sessions.","archiveWorkspace.confirm":"Archive all","archiveWorkspace.pending":"Archiving conversations\u2026","date.ymd":"{y}-{m}-{d}"},Ia={...Js,...As,"locale.language":"ru","service.unavailable":"\u0421\u0435\u0440\u0432\u0438\u0441 \u0435\u0449\u0451 \u043D\u0435 \u0433\u043E\u0442\u043E\u0432. \u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435.","common.close":"\u0417\u0430\u043A\u0440\u044B\u0442\u044C","entry.location.title":"\u0420\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u043F\u0443\u043D\u043A\u0442\u0430","entry.location.desc":"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435, \u0433\u0434\u0435 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0442\u044C \u043F\u0443\u043D\u043A\u0442 \u0432\u0445\u043E\u0434\u0430 (\u0445\u043E\u0442\u044F \u0431\u044B \u043E\u0434\u0438\u043D \u043E\u0441\u0442\u0430\u0435\u0442\u0441\u044F \u0430\u043A\u0442\u0438\u0432\u043D\u044B\u043C).","entry.location.both":"\u041E\u0431\u0430 \u043C\u0435\u0441\u0442\u0430","entry.location.sidebar":"\u0422\u043E\u043B\u044C\u043A\u043E \u0431\u043E\u043A\u043E\u0432\u0430\u044F \u043F\u0430\u043D\u0435\u043B\u044C","entry.location.settings":"\u0422\u043E\u043B\u044C\u043A\u043E \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438","entry.location.saveFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u043F\u0443\u043D\u043A\u0442\u0430. \u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0441\u0435\u0442\u044C \u0438\u043B\u0438 \u043F\u0435\u0440\u0435\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u0435 \u0445\u043E\u0441\u0442.","sidebar.favoriteStar.title":"\u0417\u0432\u0435\u0437\u0434\u0430 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0432 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","sidebar.favoriteStar.desc":"\u041E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0442\u044C \u0437\u0432\u0435\u0437\u0434\u0443 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0443 \u0441\u0442\u0440\u043E\u043A \u0441\u0435\u0441\u0441\u0438\u0439 \u0432 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438. \u041F\u0440\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0438 \u0437\u043D\u0430\u0447\u043E\u043A \u0441\u043A\u0440\u044B\u0432\u0430\u0435\u0442\u0441\u044F, \u0430 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u043C\u0435\u043D\u044E \u0438 \u0444\u0438\u043B\u044C\u0442\u0440\u0430\u0446\u0438\u044F \u043E\u0441\u0442\u0430\u044E\u0442\u0441\u044F \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u043C\u0438.","sidebar.favoriteStar.toggle":"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0437\u0432\u0435\u0437\u0434\u0443 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0432 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","update.entry.title":"\u041E\u043D\u043B\u0430\u0439\u043D-\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","update.entry.desc":"\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044C \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0443 \u0438 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0443 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0439 \u043E\u043D\u043B\u0430\u0439\u043D. \u0421\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u043F\u0443\u043D\u043A\u0442 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F \u043F\u0440\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0438.","update.entry.toggle":"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u043E\u043D\u043B\u0430\u0439\u043D-\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","update.entry.locked":"\u041E\u043D\u043B\u0430\u0439\u043D-\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u043E \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u0445\u043E\u0441\u0442\u0430.","archives.moreActions":"\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E","archives.archiveProject":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.archiveUngrouped":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.archiveProjectDesc":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 {n} \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439 \u0432 \xAB{name}\xBB, \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u0444\u0438\u043B\u044C\u0442\u0440\u0430 \u043F\u043E\u0438\u0441\u043A\u0430. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.archiveUngroupedDesc":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 {n} \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439, \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u0444\u0438\u043B\u044C\u0442\u0440\u0430 \u043F\u043E\u0438\u0441\u043A\u0430. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.tab.archived":"\u0410\u0440\u0445\u0438\u0432","archives.tab.unarchived":"\u041D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435","archives.searchUnarchived":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C \u0447\u0430\u0442\u0430\u043C","archives.emptyUnarchived":"\u041D\u0435\u0442 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.archiveSelected":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archives.openSession":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","archives.archiveSelectedDesc":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438, \u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0441\u043A\u0440\u044B\u0442\u044B\u0435 \u0442\u0435\u043A\u0443\u0449\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u043C. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.archiveSuccess":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043E \u0441\u0435\u0441\u0441\u0438\u0439: {n}.","archives.archiveBatchFailed":"\u041F\u0430\u043A\u0435\u0442\u043D\u0430\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u043D\u0435 \u0443\u0434\u0430\u043B\u0430\u0441\u044C: {detail}","archives.navigationUnavailable":"\u042D\u0442\u043E\u0442 \u0445\u043E\u0441\u0442 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0434\u0435\u0440\u0436\u0430\u0442\u044C \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u0432 \u0430\u0440\u0445\u0438\u0432\u0435 \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438. \u0412\u043C\u0435\u0441\u0442\u043E \u044D\u0442\u043E\u0433\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \xAB\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u044C\xBB.","archives.sessionNotRetained":"\u0425\u043E\u0441\u0442 \u043D\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u043B \u0437\u0430\u043F\u0440\u043E\u0448\u0435\u043D\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u043C. \u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435 \u0438\u043B\u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0435 \u0435\u0433\u043E \u043F\u0435\u0440\u0435\u0434 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0435\u043C.","archives.restoreOpen":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u044C","archives.selectedCount":"\u0412\u044B\u0431\u0440\u0430\u043D\u043E: {n}","archives.selectionHiddenHint":"\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 {hidden}, \u0441\u043A\u0440\u044B\u0442\u044B\u0445 \u0442\u0435\u043A\u0443\u0449\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u043C; \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u043F\u0440\u0438\u043C\u0435\u043D\u044F\u044E\u0442\u0441\u044F \u0438 \u043A \u043D\u0438\u043C.","archives.clearSelectionShort":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C","archives.restore":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C","archives.archiveTitle":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C {n} \u0447\u0430\u0442\u043E\u0432?","archives.deleteSelectionShort":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C","archives.clearSelection":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0432\u044B\u0431\u043E\u0440","group.ungrouped":"\u0411\u0435\u0437 \u0433\u0440\u0443\u043F\u043F\u044B","session.new":"\u041D\u043E\u0432\u0430\u044F \u0441\u0435\u0441\u0441\u0438\u044F","menu.deleteSession":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","archived.badge":"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439","archives.title":"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439","archives.description":"\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C\u0438 \u0441\u0435\u0441\u0441\u0438\u044F\u043C\u0438 \u0438\u043B\u0438 \u0432\u044B\u0431\u043E\u0440 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0434\u043B\u044F \u043F\u0430\u043A\u0435\u0442\u043D\u043E\u0439 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438.","archives.viewProject":"GitHub","archives.feedback":"\u041F\u0440\u043E\u0431\u043B\u0435\u043C\u044B","archives.empty":"\u041D\u0435\u0442 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.emptyFiltered":"\u041D\u0438 \u043E\u0434\u0438\u043D \u0447\u0430\u0442 \u043D\u0435 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0430\u0448\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u0430\u043C.","archives.searchPlaceholder":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C \u0447\u0430\u0442\u0430\u043C","archives.sortLabel":"\u0421\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0430","archives.viewOptions":"\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u0432\u0438\u0434\u0430","archives.sortArchived":"\u041D\u0435\u0434\u0430\u0432\u043D\u043E \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435","archives.sortUpdated":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0435 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","archives.sortCreated":"\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F","archives.sortAlphabetical":"\u041F\u043E \u0430\u043B\u0444\u0430\u0432\u0438\u0442\u0443","archives.projectFilter":"\u0424\u0438\u043B\u044C\u0442\u0440 \u043F\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0443","archives.allProjects":"\u0412\u0441\u0435 \u043F\u0440\u043E\u0435\u043A\u0442\u044B","discovery.timeRange":"\u041F\u0435\u0440\u0438\u043E\u0434","organizer.allChats":"\u0412\u0441\u0435 \u0447\u0430\u0442\u044B","archives.sessionCount":"{n} \u0447\u0430\u0442\u043E\u0432","archives.selectAllFiltered":"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B","archives.selectSession":"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0447\u0430\u0442 {name}","archives.restoreSelected":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435","archives.deleteSelected":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435","archives.timestamp":"{date}, {time}","archives.restoreProject":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.restoreUngrouped":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435","archives.deleteProject":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.deleteUngrouped":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435","archives.projectActions":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438 \u0434\u043B\u044F \u043F\u0440\u043E\u0435\u043A\u0442\u0430 {name}","archives.ungroupedActions":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438 \u0434\u043B\u044F \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432","archives.restoreSuccess":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432: {n}.","archives.restoreBatchFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B: {detail}","archives.deleteSelectedTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteSelectedDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 {n} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B (\u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0435\u0449\u0451 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435) \u0438 \u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0438. \u0414\u0440\u0443\u0433\u0438\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteSelectedConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteProjectTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u0432 {name}","archives.deleteProjectDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 {n} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432 \u0432 {name}, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B \u0438 \u0437\u0430\u043F\u0438\u0441\u0438. \u041A\u0430\u0442\u0430\u043B\u043E\u0433 \u043F\u0440\u043E\u0435\u043A\u0442\u0430 \u0438 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteProjectConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.deleteUngroupedTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteUngroupedDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 {n} \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B \u0438 \u0437\u0430\u043F\u0438\u0441\u0438. \u0414\u0440\u0443\u0433\u0438\u0435 \u043F\u0440\u043E\u0435\u043A\u0442\u044B \u0438 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteUngroupedConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteBatchPending":"\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432\u2026","archives.deleteSuccess":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432: {n}.","archives.deleteSuccessWithSkipped":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E {deleted} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432 \u0438 \u043E\u0447\u0438\u0449\u0435\u043D\u043E {skipped} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430 \u0434\u043B\u044F \u043D\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.deleteSkipped":"\u041E\u0447\u0438\u0449\u0435\u043D\u043E {n} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430 \u0434\u043B\u044F \u043D\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.deletePartial":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E {deleted} \u0447\u0430\u0442\u043E\u0432 \u0438 \u043E\u0447\u0438\u0449\u0435\u043D\u043E {skipped} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430; {failed} \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0443\u0434\u0430\u043B\u0438\u0442\u044C: {detail}","archives.unarchiveUnknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0435\u0451 \u043D\u0435\u043B\u044C\u0437\u044F \u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430.","archives.unarchiveFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430: {detail}","archives.archiveUnknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0435\u0451 \u043D\u0435\u043B\u044C\u0437\u044F \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C.","archives.archiveFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E: {detail}","archives.archiveActive":"\u042D\u0442\u043E\u0442 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u0432\u0441\u0451 \u0435\u0449\u0451 \u0432\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F ({kinds}).","archiveActive.title":"\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archiveActive.desc":"\u0412 \xAB{name}\xBB \u0435\u0449\u0451 \u0438\u0434\u0451\u0442 \u0440\u0430\u0431\u043E\u0442\u0430: {kinds}. \u0410\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u0441\u043D\u0430\u0447\u0430\u043B\u0430 \u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442 \u0435\u0451.","archiveActive.confirm":"\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archives.forkFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0432\u0435\u0442\u043A\u0443 \u0441\u0435\u0441\u0441\u0438\u0438: {detail}","deleteSession.title":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","deleteSession.confirmTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E?","deleteSession.desc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 \u0441\u0435\u0441\u0441\u0438\u044E \xAB{name}\xBB, \u0435\u0451 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B (\u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0435\u0449\u0451 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435) \u0438 \u0432\u0441\u0435 \u0435\u0451 \u0437\u0430\u043F\u0438\u0441\u0438 (\u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A\u0443, \u043A\u044D\u0448). \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","deleteSession.pending":"\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438\u2026","deleteSession.unknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438\u043B\u0438 \u0443\u0436\u0435 \u0443\u0434\u0430\u043B\u0435\u043D\u0430.","deleteSession.failed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0443\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E: {detail}","menu.archiveWorkspace":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0443\u044E \u043E\u0431\u043B\u0430\u0441\u0442\u044C","menu.copyWorkspacePath":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u0443\u0442\u044C \u043A \u043F\u0430\u043F\u043A\u0435","menu.openInExplorer":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043F\u0430\u043F\u043A\u0443","menu.moveSession":"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u0432 \u043F\u0440\u043E\u0435\u043A\u0442","moveSession.noOtherWorkspaces":"\u041D\u0435\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0445 \u043F\u0440\u043E\u0435\u043A\u0442\u043E\u0432","moveSession.success":"\u0421\u0435\u0441\u0441\u0438\u044F \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u043F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0430 \u0432 \xAB{name}\xBB","archiveWorkspace.title":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C {n} \u0441\u0435\u0441\u0441\u0438\u0439?","archiveWorkspace.desc":"\u042D\u0442\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0435\u0442 \u0441\u0435\u0441\u0441\u0438\u0438 \u0432 \xAB{name}\xBB. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u043D\u0430\u0439\u0442\u0438 \u043F\u043E\u0437\u0436\u0435 \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archiveWorkspace.confirm":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435","archiveWorkspace.pending":"\u0410\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u0441\u0435\u0441\u0441\u0438\u0439\u2026","date.ymd":"{y}-{m}-{d}"},_e="archive-manager-workspace",Ta=["slots","sessions","workspaces","locale","remote","typert"];function sr(n){return{getSnapshot:n.getSnapshot.bind(n),subscribe:n.subscribe.bind(n)}}e(sr,"bindObservable");function Jr(n){return async a=>{if(typeof n?.unarchiveSession!="function")throw new Error("archive-manager: host unarchiveSession is unavailable");await n.unarchiveSession(a)}}e(Jr,"createUnarchiveSession");async function ar(n,a,o){let h=new Set(n.list?.getSnapshot?.()?.archivedSessionIds??[]),v=await Jn(a,async k=>{try{await n.archiveSession(k)}catch(E){throw E!==null&&typeof E=="object"&&Bn(E)!==void 0&&typeof ce(E).sessionId!="string"&&Object.assign(E,{sessionId:k}),E}return!0},{refresh:o}),f=[...n.list?.getSnapshot?.()?.archivedSessionIds??[]];return{archivedSessionIds:f,archivedSessionIdsAdded:f.filter(k=>!h.has(k)),failures:v.failures}}e(ar,"archiveSessionsViaOfficial");async function Xr(n,a,o,h){let v=new Set(n.list?.getSnapshot?.()?.archivedSessionIds??[]),f=typeof h=="function"?h:N=>n.unarchiveSession?.(N),k=await Jn(a,async N=>(await f(N),!0),{refresh:o}),E=[...n.list?.getSnapshot?.()?.archivedSessionIds??[]];return{archivedSessionIds:E,unarchivedSessionIds:[...v].filter(N=>!E.includes(N)),failures:k.failures}}e(Xr,"unarchiveSessionsViaOfficial");let Aa=220;function Qr({triggerRect:n,viewport:a,itemCount:o,measuredHeight:h,measuredWidth:v}){let f=a.width,k=a.height,E=typeof v=="number"&&v>0?Math.min(280,Math.max(160,v)):Aa,N=Math.max(200,k-24),H=Math.min(520,N),A=o===0?44:34*o+8,z=Math.min(H,Math.max(20,typeof h=="number"&&h>0?h:A)),O=n.right+2,d="right";O+E>f-10&&(O=Math.max(10,n.left-E-4),d="left");let oe=n.top-4;if(oe+z>k-10){let pe=n.bottom+4-z;pe>=10?oe=pe:oe=Math.max(10,k-z-10)}oe<10&&(oe=10);let Re=Math.min(H,Math.max(60,k-10-oe));return{top:oe,left:O,maxHeight:Re,side:d}}e(Qr,"computeSubmenuPosition");function es(n,a,o){return{height:typeof a=="number"&&a>0?a:n.height,width:typeof o=="number"&&o>0?o:n.width}}e(es,"mergeSubmenuMeasurement");function ts({surfaceRef:n,submenuId:a,pos:o,workspaces:h,moving:v,t:f,onSelect:k,onEnter:E,onLeave:N}){let H=u.MenuSurface,A=u.MenuItemButton;if(!C())return null;let z=h.length===0?(0,s.jsx)("div",{className:"dsham_moveSubmenuEmpty",children:f("moveSession.noOtherWorkspaces")}):h.map(O=>{let d=O.title||O.path||O.workspaceId,oe=(0,s.jsx)(u.IconFolderCloseMedium,{size:14,"aria-hidden":!0}),Re=(0,s.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0},children:d});return(0,s.jsx)(A,{icon:oe,disabled:v,onSelect:e(()=>k(O.workspaceId,d),"onSelect"),children:Re},O.workspaceId)});return(0,s.jsx)(H,{ref:n,id:a,className:"dsham_moveSubmenu",role:"menu","aria-label":f("menu.moveSession"),"data-dsham-move-submenu":"true","data-dsham-side":o.side,onPointerDown:e(O=>{O.stopPropagation()},"onPointerDown"),onMouseDown:e(O=>{O.stopPropagation()},"onMouseDown"),onMouseEnter:E,onMouseLeave:N,style:{top:o.top,left:o.left,maxHeight:o.maxHeight},children:z})}e(ts,"MoveSubmenu");async function _a(n){Ra(n);let a=n.get("remote"),o=e(()=>{},"disposeRemote");return a!==void 0&&(o=await a.$mount(en)),async()=>{await o()}}e(_a,"apply");function Ra(n){n.effect(()=>n.locale.register(_e,{zh:Yr,en:Zr,ru:Ia}),"dsh-archive-manager: dictionaries");let a=e(()=>n.get("uiWorkspace"),"uiWorkspaceAt"),o={},h,v=e(p=>(h=Ds(p,n.sessions,n.workspaces,{onOpened:e(()=>n.get("layout")?.selectPanel(null),"onOpened"),beginNavigation:e(()=>n.get("layout")?.beginNavigation?.(),"beginNavigation")}),()=>h?.dispose()),"attachArchiveNavigation");n.effect(()=>v(a()),"archive-manager: explicit archived navigation");let f=e(p=>{if(h===void 0)throw new Qt("navigationUnavailable");return zr.request(p),h.open(p)},"openConversation"),k=e(async p=>{n.get("layout")?.beginNavigation?.(),zr.request(p)},"focusSessionWorkspace"),E=e(async(p,b)=>{let I=await n.sessions.search(p,b);if(!I.ok)throw new Error(I.error.message);return I.value},"searchSessions"),N=e(async()=>{if(typeof n.sessions.refresh!="function")return null;try{return await oe(),null}catch(p){return console.warn("archive-manager: restored archived sessions but session list refresh failed:",p),p instanceof Error?p.message:String(p)}},"refreshSessionList"),H=Jr(n.workspaces),A=e(async(p,...b)=>{let I=n.get("remote.workspaceRegistry");if(!I||typeof I[p]!="function")throw new Error(n.locale.bind(_e)("service.unavailable"));let ye=await I[p].apply(I,b);if(!ye.ok)throw new Error(ye.error.message);return ye.value},"registryCall"),z=e(()=>A("diagnoseOrphanSubagents"),"diagnoseOrphanSubagents"),O=e(()=>A("diagnoseSessionCaches"),"diagnoseSessionCaches"),d=e(p=>A("rebuildSessionCaches",p),"rebuildSessionCaches"),oe=e(async()=>{if(typeof n.sessions.refresh!="function")throw new Error("Official session list refresh is unavailable");let p=await n.sessions.refresh(),b=n.sessions,I=b.manager;if(I?.listState==="error"&&I.listError)throw new Error(Oe(I.listError));if(b.listState==="error"&&b.listError)throw new Error(Oe(b.listError));let $=b.list?.getSnapshot?.();if($?.state==="error"&&$.error)throw new Error(Oe($.error));if(p&&typeof p=="object"&&"ok"in p&&p.ok===!1)throw new Error(Oe(p.error??"Session list refresh failed"))},"refreshCacheLists"),Re=e((p={})=>A("cleanOrphanSubagents",p??{}),"cleanOrphanSubagents"),pe=e(p=>A("searchArchivedContent",p),"searchArchivedContent"),kt=e(p=>A("searchSessionContent",p),"searchSessionContent"),ut=e(p=>A("previewArchivedSession",p),"previewArchivedSession"),ct=e(()=>A("favoriteSessions"),"favoriteSessions"),cn=e(p=>A("setSessionFavorite",p),"setSessionFavorite"),st=Tr();st.bind({favoriteSessions:ct,setSessionFavorite:cn});let Ge,dn=Ir(n,st,()=>n.locale.bind(_e),()=>Ge?.isSidebarFavoriteStarEnabled()??!0);n.effect(()=>()=>dn.dispose(),"archive-manager: favorites only filter");let At=Gs({workspaces:n.workspaces.list,sessions:n.sessions.list,archive:e(p=>n.workspaces.archiveSession(p),"archive"),restore:e(async p=>{await H(p)},"restore"),deleteOne:e(async p=>{let b=n.get("remote.workspaceRegistry");if(!b)throw new Error(n.locale.bind(_e)("service.unavailable"));let I=await b.deleteSession(p);if(!I.ok)throw new Error(I.error.message)},"deleteOne"),getFavorites:ct,refresh:e(()=>n.sessions.refresh?.(),"refresh"),currentSessionId:Zn}),Mt=e(async p=>{await H(p),await N()},"unarchiveSession"),q=e(async p=>{let b=n.get("remote.workspaceRegistry");if(b===void 0)throw new Error("archive-manager remote service is unavailable");let I=await b.deleteSession(p);if(!I.ok)throw new Error(I.error.message);await N()},"deleteSession"),Me=e(async(p,b)=>{let I=n.get("remote.workspaceRegistry");if(I===void 0)throw new Error("archive-manager remote service is unavailable");let $=await I.moveSessionToWorkspace({sessionId:p,targetWorkspaceId:b});if(!$.ok)throw new Error($.error?.message||"move failed");return await N(),$.value},"moveSession"),ee=e(async p=>ar(n.workspaces,p,N),"archiveSessions"),Z=e(async p=>{let b=n.workspaces.list?.getSnapshot?.()??{archivedSessionIds:[],items:[]},I=bn(b.archivedSessionIds,b.items,p);return Xr(n.workspaces,I,N,H)},"unarchiveSessions"),ze=e(async p=>{let b=n.get("remote.workspaceRegistry");if(b===void 0)throw new Error("archive-manager remote service is unavailable");let I=await b.deleteArchivedSessions(p);if(!I.ok)throw new Error(I.error.message);let $=await N();return{...I.value,refreshError:$}},"deleteArchivedSessions"),at=e(async()=>{let p=n.get("remote.workspaceRegistry");if(p===void 0)throw new Error("archive-manager remote service is unavailable");let b=await p.archivedSessionMetadata();if(!b.ok)throw new Error(b.error.message);return b.value},"archivedSessionMetadata"),L="sidebar.workspaces.session.menu.item",je=null,Ce=new Set,He=e(p=>{je=p;for(let b of Ce)b()},"publishDeleteTarget");function ht(){return l.useSyncExternalStore(p=>(Ce.add(p),()=>{Ce.delete(p)}),()=>je,()=>je)}e(ht,"useDeleteRequest");let Ke=e(()=>m(p=>n.get(p)),"hasNativeContextMenus");function zt({sessionId:p,displayTitle:b,useMenuOpenState:I,t:$}){if(Ke())return null;let[,ye]=I(),se=u.MenuItemButton,ge=(0,s.jsx)(u.IconTrashOutlineRegular,{size:14}),de=e(()=>{ye(!1),He({sessionId:p,title:b})},"onSelect");return typeof se=="function"?(0,s.jsx)(se,{danger:!0,icon:ge,onSelect:de,children:$("menu.deleteSession")}):(0,s.jsx)("button",{type:"button",role:"menuitem",onClick:de,children:$("menu.deleteSession")})}e(zt,"DeleteSessionMenuItem");function yn({sessionId:p,favoriteRow:b,useMenuOpenState:I,t:$}){if(Ke())return null;let[,ye]=I(),se=(0,l.useSyncExternalStore)(b.subscribe,b.getSnapshot),ge=se.ready&&se.ids.has(p),de=e(()=>{ye(!1),b.toggle(p)},"onSelect"),ae=u.MenuItemButton,Ne=(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:ge?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round","aria-hidden":!0,children:(0,s.jsx)("path",{d:Ht})}),Ue=$(ge?"organizer.unfavorite":"organizer.favorite");return typeof ae=="function"?(0,s.jsx)(ae,{icon:Ne,onSelect:de,children:Ue}):(0,s.jsx)("button",{type:"button",role:"menuitem",onClick:de,children:Ue})}e(yn,"FavoriteMenuItem");let Vt=null,Ct=new Set;function Te(p,b="success"){Vt={text:p,tone:b,seq:Date.now()};for(let I of Ct)I()}e(Te,"showToast");function $t(){let p=l.useSyncExternalStore(I=>(Ct.add(I),()=>{Ct.delete(I)}),()=>Vt,()=>Vt);if(!p)return null;let b=u.Toast;return typeof b=="function"?(0,s.jsx)(b,{key:p.seq,text:p.text,tone:p.tone,holdMs:3e3,onDone:e(()=>{if(Vt?.seq===p.seq){Vt=null;for(let I of Ct)I()}},"onDone")}):(0,s.jsx)("div",{key:p.seq,style:{position:"fixed",top:16,left:"50%",transform:"translateX(-50%)",zIndex:99999,padding:"8px 16px",borderRadius:8,background:p.tone==="danger"?"#7f1d1d":"#14532d",color:"#fff",fontSize:13,boxShadow:"0 4px 16px rgba(0,0,0,0.4)"},children:p.text})}e($t,"GlobalToastOverlay");function wn({sessionId:p,displayTitle:b,useMenuOpenState:I,t:$}){let[,ye]=I(),se=l.useId(),[ge,de]=l.useState(!1),[ae,Ne]=l.useState(null),[Ue,We]=l.useState(!1),Ae=l.useRef(null),te=l.useRef(null),ne=l.useRef(null),M=l.useRef({}),K=y(n.workspaces.list?.getSnapshot?.()?.items??[],p),ve=u.MenuItemButton;l.useEffect(()=>{let we=Ae.current?.querySelector(':scope > div > button[role="menuitem"], :scope > button[role="menuitem"]');we&&(we.setAttribute("aria-haspopup","menu"),we.setAttribute("aria-expanded",ge?"true":"false"),ge?we.setAttribute("aria-controls",se):we.removeAttribute("aria-controls"))},[ge,se]);let Y=e((we,rt)=>{if(!Ae.current)return;M.current=es(M.current,we,rt);let Je=Ae.current.getBoundingClientRect(),Ie=typeof window<"u"?window.innerWidth:1024,Ve=typeof window<"u"?window.innerHeight:768,mt=Qr({triggerRect:Je,viewport:{width:Ie,height:Ve},itemCount:K.length,measuredHeight:M.current.height,measuredWidth:M.current.width});Ne(wt=>wt&&wt.top===mt.top&&wt.left===mt.left&&wt.maxHeight===mt.maxHeight&&wt.side===mt.side?wt:mt)},"updatePosition"),be=e(()=>{ne.current&&clearTimeout(ne.current),Y(),de(!0)},"handleMouseEnter");l.useLayoutEffect(()=>{if(!ge||!te.current)return;let we=te.current;we.offsetHeight>0&&Y(we.offsetHeight,we.offsetWidth)},[ge,K.length]),l.useEffect(()=>{if(!ge||typeof window>"u")return;let we=e(()=>Y(),"reposition");return window.addEventListener("resize",we),window.addEventListener("scroll",we,!0),()=>{window.removeEventListener("resize",we),window.removeEventListener("scroll",we,!0)}},[ge,K.length]),l.useEffect(()=>()=>{ne.current&&clearTimeout(ne.current)},[]);let Ee=e(()=>{ne.current=setTimeout(()=>{de(!1)},180)},"handleMouseLeave"),Ye=e(async(we,rt)=>{if(!Ue){We(!0),de(!1),ye(!1);try{await Me(p,we),Te($("moveSession.success",{name:rt})||`\u4F1A\u8BDD\u5DF2\u6210\u529F\u79FB\u52A8\u5230\u201C${rt}\u201D`,"success")}catch(Je){let Ie=Je instanceof Error?Je.message:String(Je);console.warn("archive-manager: move session failed",Je),Te(Ie,"danger")}finally{We(!1)}}},"handleSelectWorkspace"),Ze=(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:14,height:14,fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,s.jsx)("path",{d:"M2 3.5C2 2.67157 2.67157 2 3.5 2H6.5L8 4H12.5C13.3284 4 14 4.67157 14 5.5V12.5C14 13.3284 13.3284 14 12.5 14H3.5C2.67157 14 2 13.3284 2 12.5V3.5Z"}),(0,s.jsx)("path",{d:"M8 7.5L10.5 10L8 12.5"}),(0,s.jsx)("path",{d:"M5.5 10H10.5"})]}),qe=(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,style:{marginLeft:"auto",opacity:.65},children:(0,s.jsx)("path",{d:"M6 3.5L10.5 8L6 12.5"})}),Le=(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",gap:8},children:[(0,s.jsx)("span",{children:$("menu.moveSession")}),qe]});if(!C())return null;let Pe=(0,s.jsx)(ve,{icon:Ze,onSelect:e(()=>be(),"onSelect"),children:Le});return(0,s.jsxs)("div",{ref:Ae,className:"dsham_moveSessionWrap",onMouseEnter:be,onMouseLeave:Ee,children:[Pe,ge&&ae&&(0,s.jsx)(ts,{surfaceRef:te,submenuId:se,pos:ae,workspaces:K,moving:Ue,t:$,onSelect:e((we,rt)=>{Ye(we,rt)},"onSelect"),onEnter:be,onLeave:Ee})]})}e(wn,"MoveSessionMenuItem");function Q(p){try{let b=document.querySelector(`[data-row-key="session:${CSS.escape(p)}"]`);return b?(b.hasAttribute("tabindex")||(b.setAttribute("tabindex","-1"),b.addEventListener("blur",()=>b.removeAttribute("tabindex"),{once:!0})),typeof u.focusWithoutRing=="function"?u.focusWithoutRing(b):b.focus(),!0):!1}catch{return!1}}e(Q,"focusSessionRow");function nt({t:p}){let b=ht(),[I,$]=(0,l.useState)(!1),[ye,se]=(0,l.useState)(null),[ge,de]=(0,l.useState)(null),ae=(0,l.useRef)(null),Ne=(0,l.useRef)(null),Ue=(0,l.useRef)(null);if((0,l.useLayoutEffect)(()=>{if(b===null||typeof document>"u"){de(null);return}let te=null,ne=e(()=>{if(te&&te.isConnected)return te;try{te=document.querySelector(`[data-row-key="session:${CSS.escape(b.sessionId)}"]`)}catch{te=null}return te},"getTargetRow"),M=e(()=>{let ve=ae.current,Y=ve?.offsetWidth||290,be=ve?.offsetHeight||160,Ee=8,Ye=ne();if(!Ye){let Pe=window.innerWidth,we=window.innerHeight,rt=Math.max(16,(we-be)/2),Je=Math.max(16,(Pe-Y)/2);de(Ie=>Ie!==null&&Ie.top===rt&&Ie.left===Je?Ie:{top:rt,left:Je});return}let Ze=Ye.getBoundingClientRect(),qe=Ze.top-4;qe+be>window.innerHeight-16&&(qe=window.innerHeight-16-be),qe<16&&(qe=16);let Le=Ze.right+Ee;Le+Y>window.innerWidth-16&&(Le=Ze.left-Y-Ee),Le<16&&(Le=16),de(Pe=>Pe!==null&&Pe.top===qe&&Pe.left===Le?Pe:{top:qe,left:Le})},"updatePosition");M(),window.addEventListener("scroll",M,!0),window.addEventListener("resize",M);let K=null;return typeof ResizeObserver<"u"&&ae.current&&(K=new ResizeObserver(M),K.observe(ae.current)),()=>{K?.disconnect(),window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",M)}},[b]),(0,l.useEffect)(()=>{if(b===null)return;Ne.current&&!Ne.current.disabled?Ne.current.focus():ae.current?.focus();let te=b.sessionId;return()=>{if(!Q(te)){let M=document.querySelector('[role="treeitem"][aria-selected="true"]');M&&(M.hasAttribute("tabindex")||(M.setAttribute("tabindex","-1"),M.addEventListener("blur",()=>M.removeAttribute("tabindex"),{once:!0})),typeof u.focusWithoutRing=="function"?u.focusWithoutRing(M):M.focus())}}},[b]),(0,l.useEffect)(()=>{b!==null&&I&&ae.current?.focus()},[b,I]),(0,l.useEffect)(()=>{if(b===null)return;let te=e(ne=>{if(ne.key==="Escape"){ne.preventDefault(),ne.stopPropagation(),"stopImmediatePropagation"in ne&&typeof ne.stopImmediatePropagation=="function"&&ne.stopImmediatePropagation(),I||(se(null),He(null));return}if(ne.key==="Tab"){if(ne.preventDefault(),I){ae.current?.focus();return}let M=Ne.current,K=Ue.current;if(!M||!K)return;ne.shiftKey?document.activeElement===M?K.focus():M.focus():document.activeElement===K?M.focus():K.focus()}},"onKey");return window.addEventListener("keydown",te,!0),()=>window.removeEventListener("keydown",te,!0)},[b,I]),b===null)return null;let We=e(()=>{I||(se(null),He(null))},"close"),Ae=e(()=>{$(!0),se(null),q(b.sessionId).then(()=>{$(!1),He(null)}).catch(te=>{$(!1),se(Xn(te,p))})},"confirm");return(0,s.jsxs)("div",{className:"dsham_sidebarCardRoot",children:[(0,s.jsx)("div",{className:"dsham_sidebarCardBackdrop",onClick:We}),(0,s.jsxs)("div",{ref:ae,role:"dialog","aria-modal":!0,"aria-label":p("deleteSession.title"),tabIndex:-1,className:"dsham_sidebarCard",style:ge?{top:ge.top,left:ge.left,visibility:"visible"}:{visibility:"hidden",top:0,left:0},children:[(0,s.jsx)("h3",{className:"dsham_sidebarCardTitle",children:p("deleteSession.confirmTitle")}),(0,s.jsx)("p",{className:"dsham_sidebarCardDesc",children:p("deleteSession.desc",{name:b.title})}),I&&(0,s.jsx)("div",{className:"dsham_sidebarCardDesc",role:"status",children:p("deleteSession.pending")}),ye!==null&&(0,s.jsx)("div",{className:"dsham_sidebarCardError",role:"alert",children:ye}),(0,s.jsxs)("div",{className:"dsham_sidebarCardFooter",children:[(0,s.jsx)("button",{ref:Ne,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnCancel",disabled:I,onClick:We,children:p("cancel")}),(0,s.jsx)("button",{ref:Ue,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnDanger",disabled:I,onClick:Ae,children:p("deleteSession.title")})]})]})]})}e(nt,"DeleteSessionOverlay");let _t=null,G=new Set,Gt=e(p=>{_t=p;for(let b of G)b()},"publishArchiveWsTarget");function Be(){return l.useSyncExternalStore(p=>(G.add(p),()=>{G.delete(p)}),()=>_t,()=>_t)}e(Be,"useArchiveWsRequest");function un(p){try{let b=document.querySelector(`[data-row-key="workspace:${CSS.escape(p)}"]`);return b?(b.hasAttribute("tabindex")||(b.setAttribute("tabindex","-1"),b.addEventListener("blur",()=>b.removeAttribute("tabindex"),{once:!0})),typeof u.focusWithoutRing=="function"?u.focusWithoutRing(b):b.focus(),!0):!1}catch{return!1}}e(un,"focusWorkspaceRow");function Pt({t:p}){let b=Be(),[I,$]=(0,l.useState)(!1),[ye,se]=(0,l.useState)(null),[ge,de]=(0,l.useState)(null),ae=(0,l.useRef)(null),Ne=(0,l.useRef)(null),Ue=(0,l.useRef)(null);if((0,l.useLayoutEffect)(()=>{if(b===null||typeof document>"u"){de(null);return}let te=null,ne=e(()=>{if(te&&te.isConnected)return te;try{te=document.querySelector(`[data-row-key="workspace:${CSS.escape(b.workspaceId)}"]`)}catch{te=null}return te},"getTargetRow"),M=e(()=>{let ve=ae.current,Y=ve?.offsetWidth||290,be=ve?.offsetHeight||160,Ee=8,Ye=ne();if(!Ye){let Pe=window.innerWidth,we=window.innerHeight,rt=Math.max(16,(we-be)/2),Je=Math.max(16,(Pe-Y)/2);de(Ie=>Ie!==null&&Ie.top===rt&&Ie.left===Je?Ie:{top:rt,left:Je});return}let Ze=Ye.getBoundingClientRect(),qe=Ze.top-4;qe+be>window.innerHeight-16&&(qe=window.innerHeight-16-be),qe<16&&(qe=16);let Le=Ze.right+Ee;Le+Y>window.innerWidth-16&&(Le=Ze.left-Y-Ee),Le<16&&(Le=16),de(Pe=>Pe!==null&&Pe.top===qe&&Pe.left===Le?Pe:{top:qe,left:Le})},"updatePosition");M(),window.addEventListener("scroll",M,!0),window.addEventListener("resize",M);let K=null;return typeof ResizeObserver<"u"&&ae.current&&(K=new ResizeObserver(M),K.observe(ae.current)),()=>{K?.disconnect(),window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",M)}},[b]),(0,l.useEffect)(()=>{if(b===null)return;Ne.current&&!Ne.current.disabled?Ne.current.focus():ae.current?.focus();let te=b.workspaceId;return()=>{un(te)}},[b]),(0,l.useEffect)(()=>{b!==null&&I&&ae.current?.focus()},[b,I]),(0,l.useEffect)(()=>{if(b===null)return;let te=e(ne=>{if(ne.key==="Escape"){ne.preventDefault(),ne.stopPropagation(),"stopImmediatePropagation"in ne&&typeof ne.stopImmediatePropagation=="function"&&ne.stopImmediatePropagation(),I||(se(null),Gt(null));return}if(ne.key==="Tab"){if(ne.preventDefault(),I){ae.current?.focus();return}let M=Ne.current,K=Ue.current;if(!M||!K)return;ne.shiftKey?document.activeElement===M?K.focus():M.focus():document.activeElement===K?M.focus():K.focus()}},"onKey");return window.addEventListener("keydown",te,!0),()=>window.removeEventListener("keydown",te,!0)},[b,I]),b===null)return null;let We=e(()=>{I||(se(null),Gt(null))},"close"),Ae=e(()=>{$(!0),se(null);let ne=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(Y=>Y.workspaceId===b.workspaceId),M=n.sessions.list?.getSnapshot?.()?.byId??{},K=new Set(n.workspaces.list?.getSnapshot?.()?.archivedSessionIds??[]),ve=(ne?.sessionIds??[]).filter(Y=>Un(Y,M,K));ar(n.workspaces,ve,N).then(Y=>{if($(!1),Y.failures.length>0){se(Hn(Y.failures,p));return}Gt(null)}).catch(Y=>{$(!1),se(Rr(Y,p))})},"confirm");return(0,s.jsxs)("div",{className:"dsham_sidebarCardRoot",children:[(0,s.jsx)("div",{className:"dsham_sidebarCardBackdrop",onClick:We}),(0,s.jsxs)("div",{ref:ae,role:"dialog","aria-modal":!0,"aria-label":p("menu.archiveWorkspace"),tabIndex:-1,className:"dsham_sidebarCard",style:ge?{top:ge.top,left:ge.left,visibility:"visible"}:{visibility:"hidden",top:0,left:0},children:[(0,s.jsx)("h3",{className:"dsham_sidebarCardTitle",children:p("archiveWorkspace.title",{n:b.count})}),(0,s.jsx)("p",{className:"dsham_sidebarCardDesc",children:p("archiveWorkspace.desc",{name:b.title})}),I&&(0,s.jsx)("div",{className:"dsham_sidebarCardDesc",role:"status",children:p("archiveWorkspace.pending")}),ye!==null&&(0,s.jsx)("div",{className:"dsham_sidebarCardError",role:"alert",children:ye}),(0,s.jsxs)("div",{className:"dsham_sidebarCardFooter",children:[(0,s.jsx)("button",{ref:Ne,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnCancel",disabled:I,onClick:We,children:p("cancel")}),(0,s.jsx)("button",{ref:Ue,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnDanger",disabled:I,onClick:Ae,children:p("archiveWorkspace.confirm")})]})]})]})}e(Pt,"ArchiveWorkspaceOverlay");function Sn(p){if(typeof document>"u"||typeof document.addEventListener!="function"||typeof MutationObserver>"u")return()=>{};let b=null,I=!1,$=new Map,ye=!1,se=e(M=>{let ve=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(Ee=>Ee.workspaceId===M);if(ve===void 0)return[];let Y=n.sessions.list?.getSnapshot?.()?.byId??{},be=new Set(n.workspaces.list?.getSnapshot?.()?.archivedSessionIds??[]);return ve.sessionIds.filter(Ee=>Un(Ee,Y,be))},"workspaceCandidateIds"),ge=e(()=>{if(ye=!1,!I)for(let[M,K]of $){if(!M.isConnected){$.delete(M);continue}let ve=se(K.workspaceId).length===0;M.disabled=ve,M.style.opacity=ve?"0.5":"",M.style.cursor=ve?"not-allowed":""}},"revalidateItems"),de=e(()=>{if($.size===0||ye||I)return;ye=!0;let M=e(()=>ge(),"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(M):setTimeout(M,16)},"scheduleRevalidate"),ae=e(M=>{b=Mr(M.target)},"rememberWorkspace");document.addEventListener("pointerdown",ae,!0),document.addEventListener("click",ae,!0);let Ne=e(()=>{if(I)return;for(let[K]of $)K.isConnected||$.delete(K);let M=document.querySelectorAll('[role="menu"]');for(let K of M){if(K.querySelector('[data-dsham-archive-workspace="true"]'))continue;let ve=Array.from(K.querySelectorAll('button[role="menuitem"]'));if(ve.length===0)continue;let Y=ve.find(Xe=>er(Xe,!1))??ve.find(Xe=>er(Xe,!0));if(!Y)continue;let be=ve.find(Xe=>Xe!==Y)??Y,Ee=Y.parentElement;if(!Ee)continue;let Ye=b;if(!Ye)continue;let qe=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(Xe=>Xe.workspaceId===Ye.workspaceId),Le=qe?.path??qe?.cwd,we=se(Ye.workspaceId).length,rt=document.createElement("div");rt.className=Ee.className;let Je=be.className.split(/\s+/).filter(Xe=>!/(?:^|[_-])danger(?:$|[_-])/i.test(Xe)).join(" "),Ie=document.createElement("button");Ie.type="button",Ie.setAttribute("role","menuitem"),Ie.dataset.dshamArchiveWorkspace="true",Ie.className=Je;let Ve=be.querySelector("span"),mt=be.querySelectorAll("span")[1],wt=document.createElement("span");wt.setAttribute("aria-hidden","true"),Ve?.className&&(wt.className=Ve.className),wt.innerHTML='<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M13.5 2.5H2.5C1.94772 2.5 1.5 2.94772 1.5 3.5V4.5C1.5 5.05228 1.94772 5.5 2.5 5.5H13.5C14.0523 5.5 14.5 5.05228 14.5 4.5V3.5C14.5 2.94772 14.0523 2.5 13.5 2.5Z"/><path d="M2.5 5.5V13.5C2.5 13.7652 2.60536 14.0196 2.79289 14.2071C2.98043 14.3946 3.23478 14.5 3.5 14.5H12.5C12.7652 14.5 13.0196 14.3946 13.2071 14.2071C13.3946 14.0196 13.5 13.7652 13.5 13.5V5.5"/><path d="M6.5 9.5H9.5"/></svg>';let hn=document.createElement("span");if(mt?.className&&(hn.className=mt.className),hn.textContent=p("menu.archiveWorkspace"),Ie.append(wt,hn),rt.append(Ie),we===0&&(Ie.disabled=!0,Ie.style.opacity="0.5",Ie.style.cursor="not-allowed"),Ie.addEventListener("click",Xe=>{Xe.preventDefault(),Xe.stopPropagation();let ft=se(Ye.workspaceId).length;ft!==0&&(document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),Gt({workspaceId:Ye.workspaceId,title:Ye.title,count:ft}))}),Le){let Xe=document.createElement("div");Xe.className=Ee.className;let ft=document.createElement("button");ft.type="button",ft.setAttribute("role","menuitem"),ft.dataset.dshamCopyWorkspacePath="true",ft.className=Je,ft.disabled=!1,ft.style.opacity="",ft.style.cursor="";let gt=document.createElement("span");gt.setAttribute("aria-hidden","true"),Ve?.className&&(gt.className=Ve.className),gt.innerHTML='<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><rect x="5.5" y="5.5" width="8" height="8" rx="1.5"/><path d="M10.5 3.5V2.5C10.5 1.94772 10.0523 1.5 9.5 1.5H3.5C2.94772 1.5 2.5 1.94772 2.5 2.5V8.5C2.5 9.05228 2.94772 9.5 3.5 9.5H4.5"/></svg>';let sn=document.createElement("span");mt?.className&&(sn.className=mt.className),sn.textContent=p("menu.copyWorkspacePath"),ft.append(gt,sn),Xe.append(ft),ft.addEventListener("click",Xt=>{Xt.preventDefault(),Xt.stopPropagation(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),Yn(Le).catch(()=>{})});let Jt=document.createElement("div");Jt.className=Ee.className;let vt=document.createElement("button");vt.type="button",vt.setAttribute("role","menuitem"),vt.dataset.dshamOpenExplorer="true",vt.className=Je,vt.disabled=!1,vt.style.opacity="",vt.style.cursor="";let Tt=document.createElement("span");Tt.setAttribute("aria-hidden","true"),Ve?.className&&(Tt.className=Ve.className),Tt.innerHTML='<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M1.5 3.5C1.5 2.94772 1.94772 2.5 2.5 2.5H6.5L8 4.5H13.5C14.0523 4.5 14.5 4.94772 14.5 5.5V12.5C14.5 13.0523 14.0523 13.5 13.5 13.5H2.5C1.94772 13.5 1.5 13.0523 1.5 12.5V3.5Z"/><path d="M10 8.5L12 10.5L10 12.5"/><path d="M6.5 10.5H12"/></svg>';let An=document.createElement("span");mt?.className&&(An.className=mt.className),An.textContent=p("menu.openInExplorer"),vt.append(Tt,An),Jt.append(vt),vt.addEventListener("click",Xt=>{Xt.preventDefault(),Xt.stopPropagation(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),(async()=>{try{let pn=await fetch(fn("/open-in-app/open"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({app:"explorer",path:Le})}).catch(()=>null);if(pn&&pn.ok)return}catch{}try{await Ft("/open-in-explorer",{method:"POST",body:JSON.stringify({path:Le,workspaceId:Ye.workspaceId})})}catch(pn){console.warn("archive-manager: open in explorer failed",pn)}})()}),Ee.parentNode?.insertBefore(Xe,Ee),Ee.parentNode?.insertBefore(Jt,Ee)}Ee.parentNode?.insertBefore(rt,Ee),$.set(Ie,{workspaceId:Ye.workspaceId})}},"checkAndInject"),Ue=!1,We=e(()=>{if(Ue||I)return;Ue=!0;let M=e(()=>{Ue=!1,!I&&Ne()},"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(M):setTimeout(M,16)},"scheduleInject"),Ae=new MutationObserver(M=>{Wn(M,'[role="menu"]')&&We()});Ae.observe(document.body,{childList:!0,subtree:!0});let te=n.sessions.list?.subscribe?.(de),ne=n.workspaces.list?.subscribe?.(de);return()=>{I=!0,document.removeEventListener("pointerdown",ae,!0),document.removeEventListener("click",ae,!0),Ae.disconnect(),te?.(),ne?.(),$.clear();for(let M of document.querySelectorAll('[data-dsham-archive-workspace="true"], [data-dsham-copy-workspace-path="true"], [data-dsham-open-explorer="true"]'))M.parentElement?.remove()}}e(Sn,"setupWorkspaceMenuInjector");function Et(){if(typeof n.slots.entries!="function")return!1;if(n.slots.entries("sidebar.workspaces").some(I=>I.children?.[L]!==void 0)||n.slots.entries("contextMenu.content").some(I=>I.children?.[L]!==void 0))return!0;try{if(n.get("contextMenus")!==void 0&&n.slots.entries("contextMenu.content").length>0)return!0}catch{}return!1}e(Et,"hostSidebarDeclaresSessionMenu");let Kt,Ot,xn,kn,Cn,Yt,En,Dt=e(()=>{let p=Et()?"menu":"waiting";p!==Kt&&(Kt=p,p==="menu"&&(Ot??=n.slots.inject(L,()=>n.slots.register({name:L,id:"archive-manager.delete-session",order:9999,locale:_e,inject:e(()=>({}),"inject")},zt)),xn??=n.slots.inject(L,()=>n.slots.register({name:L,id:"archive-manager.favorite",order:1,locale:_e,inject:e(()=>({favoriteRow:st}),"inject")},yn)),C()&&(kn??=n.slots.inject(L,()=>n.slots.register({name:L,id:"archive-manager.move-session",order:480,locale:_e,inject:e(()=>({}),"inject")},wn))),Cn??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.delete-session",locale:_e,inject:e(()=>({t:n.locale.bind(_e)}),"inject")},nt)),Yt??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.archive-workspace",locale:_e,inject:e(()=>({t:n.locale.bind(_e)}),"inject")},Pt)),En??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.toast",locale:_e,inject:e(()=>({}),"inject")},$t))))},"reconcileSidebar");Dt();let pt=(()=>{try{return n.get("contextMenus")}catch{return}})();pt&&typeof pt.register=="function"?n.effect(()=>{let p,b,I,$;try{p=n.slots.register({name:"contextMenu.icon",key:"archive-manager.explorer"},()=>(0,s.jsx)("svg",{width:14,height:14,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"M1.5 3.5C1.5 2.94772 1.94772 2.5 2.5 2.5H6.5L8 4.5H13.5C14.0523 4.5 14.5 4.94772 14.5 5.5V12.5C14.5 13.0523 14.0523 13.5 13.5 13.5H2.5C1.94772 13.5 1.5 13.0523 1.5 12.5V3.5Z"}),(0,s.jsx)("path",{d:"M10 8.5L12 10.5L10 12.5"}),(0,s.jsx)("path",{d:"M6.5 10.5H12"})]})),b=n.slots.register({name:"contextMenu.icon",key:"archive-manager.star-fill"},()=>(0,s.jsx)("svg",{width:14,height:14,viewBox:"0 0 16 16",fill:"#e8b931",stroke:"#e8b931",strokeWidth:1.2,strokeLinejoin:"round",children:(0,s.jsx)("path",{d:Ht})})),I=n.slots.register({name:"contextMenu.icon",key:"archive-manager.star-outline"},()=>(0,s.jsx)("svg",{width:14,height:14,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round",children:(0,s.jsx)("path",{d:Ht})})),$=n.slots.register({name:"contextMenu.icon",key:"archive-manager.workspace-archive"},()=>(0,s.jsx)("svg",{"data-dsham-archive-icon":"true",width:14,height:14,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"M13.5 2.5H2.5C1.94772 2.5 1.5 2.94772 1.5 3.5V4.5C1.5 5.05228 1.94772 5.5 2.5 5.5H13.5C14.0523 5.5 14.5 4.94772 14.5 4.5V3.5C14.5 2.94772 14.0523 2.5 13.5 2.5Z"}),(0,s.jsx)("path",{d:"M2.5 5.5V13.5C2.5 13.7652 2.60536 14.0196 2.79289 14.2071C2.98043 14.3946 3.23478 14.5 3.5 14.5H12.5C12.7652 14.5 13.0196 14.3946 13.2071 14.2071C13.3946 14.0196 13.5 13.7652 13.5 13.5V5.5"}),(0,s.jsx)("path",{d:"M6.5 9.5H9.5"})]}))}catch{}let ye=pt.register({id:"archive-manager.session-favorite",target:"session",order:1,observe:e(()=>[st,n.locale],"observe"),resolve:e(({sessionId:de})=>{let ae=st.getSnapshot(),Ne=ae.ready&&ae.ids.has(de);return[{id:"favorite",label:n.locale.bind(_e)(Ne?"organizer.unfavorite":"organizer.favorite"),icon:{key:Ne?"archive-manager.star-fill":"archive-manager.star-outline"},run:e(()=>{st.toggle(de)},"run")}]},"resolve")}),se=pt.register({id:"archive-manager.session-delete",target:"session",order:9999,observe:e(()=>[n.locale],"observe"),resolve:e(({sessionId:de,displayTitle:ae})=>[{id:"delete-session",label:n.locale.bind(_e)("menu.deleteSession"),icon:{key:"workspace.delete"},danger:!0,afterContent:!0,run:e(()=>{He({sessionId:de,title:ae||de})},"run")}],"resolve")}),ge=pt.register({id:"archive-manager.workspace-actions",target:"workspace",order:250,observe:e(()=>[n.workspaces.list,n.sessions.list,n.locale],"observe"),resolve:e(({workspaceId:de,path:ae,displayTitle:Ne})=>{let We=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(be=>be.workspaceId===de),Ae=n.sessions.list?.getSnapshot?.()?.byId??{},te=new Set(n.workspaces.list?.getSnapshot?.()?.archivedSessionIds??[]),M=(We?We.sessionIds.filter(be=>Un(be,Ae,te)):[]).length,K=n.locale.bind(_e),ve=ae??We?.path??We?.cwd,Y=[];return ve&&(Y.push({id:"copy-workspace-path",label:K("menu.copyWorkspacePath"),icon:{key:"workspace.copy"},run:e(()=>{Yn(ve).catch(()=>{})},"run")}),Y.push({id:"open-in-explorer",label:K("menu.openInExplorer"),icon:{key:"archive-manager.explorer"},run:e(()=>{(async()=>{try{let be=await fetch(fn("/open-in-app/open"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({app:"explorer",path:ve})}).catch(()=>null);if(be&&be.ok)return}catch{}try{await Ft("/open-in-explorer",{method:"POST",body:JSON.stringify({path:ve,workspaceId:de})})}catch(be){console.warn("archive-manager: open in explorer failed",be)}})()},"run")})),Y.push({id:"archive-workspace",label:K("menu.archiveWorkspace"),icon:{key:"archive-manager.workspace-archive"},disabled:M===0,separatorBefore:!0,run:e(()=>{M!==0&&Gt({workspaceId:de,title:Ne||de,count:M})},"run")}),Y},"resolve")});return()=>{ye?.(),se?.(),ge?.(),p?.(),b?.(),I?.(),$?.()}},"archive-manager: native workspace context menu"):n.effect(()=>Sn(n.locale.bind(_e)),"archive-manager: workspace menu injector"),n.effect(()=>Lr(),"archive-manager: sidebar row contextmenu trigger"),Fr(n);let Rt=typeof n.on=="function"?n.on("slots/changed",p=>{if(!(p!=="sidebar.workspaces"&&p!=="contextMenu.content"))try{Dt()}catch(b){console.warn("archive-manager: sidebar mode switch failed",b)}}):void 0;n.effect(()=>()=>{Rt?.(),Ot?.(),xn?.(),kn?.(),Cn?.(),Yt?.(),En?.()},"archive-manager: sidebar mode");let nn=e(()=>({archiveSessions:ee,archiveSession:e((p,b)=>n.workspaces.archiveSession(p,b),"archiveSession"),sessionStore:sr(n.sessions.list),workspaceStore:sr(n.workspaces.list),unarchiveSession:Mt,deleteSession:q,unarchiveSessions:Z,deleteArchivedSessions:ze,archivedSessionMetadata:at,openConversation:f,focusSessionWorkspace:k,viewState:o,favoriteSessions:ct,setSessionFavorite:cn,favoriteSync:st,organizeBatch:At,diagnoseOrphanSubagents:z,cleanOrphanSubagents:Re,diagnoseSessionCaches:O,rebuildSessionCaches:d,refreshCacheLists:oe,searchSessionContent:kt,searchArchivedContent:pe,previewArchivedSession:ut,t:n.locale.bind(_e)}),"buildArchivedSectionProps"),Ft=e(async(p,b)=>{let I=fn(`/api/michengai/dsh-archive-manager${p}`),$=Object.assign({"content-type":"application/json","x-michengai-plugin-update":"1"},b?.headers),ye=await fetch(I,Object.assign({},b,{headers:$})),se=await ye.json();if(!ye.ok||!se||se.ok===!1)throw new Error((se&&typeof se=="object"&&typeof se.error=="string"?se.error:void 0)||`HTTP ${ye.status}`);return se},"callSettingsApi"),It=null,jt=null,Ut=!1,In=e(({size:p=16})=>(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:p,height:p,fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"M13.5 2.5H2.5C1.94772 2.5 1.5 2.94772 1.5 3.5V4.5C1.5 5.05228 1.94772 5.5 2.5 5.5H13.5C14.0523 5.5 14.5 5.05228 14.5 4.5V3.5C14.5 2.94772 14.0523 2.5 13.5 2.5Z"}),(0,s.jsx)("path",{d:"M2.5 5.5V13.5C2.5 13.7652 2.60536 14.0196 2.79289 14.2071C2.98043 14.3946 3.23478 14.5 3.5 14.5H12.5C12.7652 14.5 13.0196 14.3946 13.2071 14.2071C13.3946 14.0196 13.5 13.7652 13.5 13.5V5.5"}),(0,s.jsx)("path",{d:"M6.5 9.5H9.5"})]}),"ArchiveNavIcon"),rn=e(()=>{if(!(!Ut||It)&&!(Ge&&!Ge.isSettingsSectionEnabled())){try{let p=n.slots.register({name:"settings.section.icon",id:"archive-manager",locale:_e},In);jt=typeof p=="function"?p:null}catch{jt=null}try{let p=n.slots.register({name:"settings.section",id:"archive-manager",order:45,label:e(()=>n.locale.bind(_e)("archived.badge"),"label"),icon:"archive",locale:_e,inject:nn},On);It=typeof p=="function"?p:()=>{}}catch(p){console.warn("archive-manager: register settings.section failed:",p),It=null}}},"mountSettingsSection"),Zt=e(()=>{if(jt){try{jt()}catch{}jt=null}if(It){try{It()}catch{}It=null}},"unmountSettingsSection"),Tn=e(()=>{Ge?.isSettingsSectionEnabled?.()??!0?rn():Zt()},"syncSettingsSection");Ge=Sr(n,{callApi:Ft,renderPanel:e(p=>(0,s.jsx)(On,Object.assign({},nn(),p)),"renderPanel"),injectProps:nn,ns:_e,onOnlineUpdateChange:e(()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("dsham-update-toggle"))},"onOnlineUpdateChange"),onSidebarFavoriteStarChange:e(p=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("dsham-favorite-star-toggle",{detail:{enabled:p}}))},"onSidebarFavoriteStarChange"),onLocationChange:e(()=>{Tn()},"onLocationChange")}),n.effect(()=>()=>{Ge?.destroy(),Zt()},"archive-manager: sidebar entry"),n.effect(()=>Ws({endpoint:"/api/michengai/dsh-archive-manager/update",packageName:"@michengai/dsh-archive-manager",titleRowSelector:".dsham_settingsTitleRow",linksSelector:".dsham_settingsLinks",zhName:"\u5F52\u6863\u4F1A\u8BDD",enName:"Archived sessions",ruName:"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439",createIcon:ue,isEnabled:e(()=>Ge.isOnlineUpdateEnabled(),"isEnabled")}),"dsh-archive-manager: plugin update ui"),n.slots.inject("settings.section",()=>{Ut=!0;try{if(Ge&&!Ge.isSettingsSectionEnabled())return()=>{Ut=!1,Zt()};try{let b=n.slots.register({name:"settings.section.icon",id:"archive-manager",locale:_e},In);jt=typeof b=="function"?b:null}catch{jt=null}let p=n.slots.register({name:"settings.section",id:"archive-manager",order:45,label:e(()=>n.locale.bind(_e)("archived.badge"),"label"),icon:"archive",locale:_e,inject:nn},On);return It=typeof p=="function"?p:()=>{},()=>{Ut=!1,Zt()}}catch(p){return console.warn("archive-manager: register settings.section failed:",p),()=>{Ut=!1}}})}e(Ra,"applyWorkspaceBrowser");async function ja(n,a,o,h){try{await a(n)}catch(v){o(ia(v,h))}}return e(ja,"forkWithFeedback"),i.__test={computeSubmenuPosition:Qr,mergeSubmenuMeasurement:es,movableWorkspaces:y,MoveSubmenu:ts,forkWithFeedback:ja,hasNativeContextMenuService:m,favoritesOnlyVisibility:Cr,favoriteGroupPredicate:Er,createFavoriteRowStore:Tr,unarchivedSessionIds:$r,ArchiveSelectionToolbar:Hr,ArchivedSessionsSection:On,zh:Yr,en:Zr,displayTitle:lt,isUnknownSessionError:Fn,deriveArchivedGroups:Gr,sortArchivedGroups:Kr,deriveArchivedBatchIds:bn,archivedSessionIdsInGroups:Wr,pruneArchivedSelection:qr,toggleArchivedSelection:rr,archivedDeleteFeedback:Vr,isWorkspaceTaskCandidate:Un,isWorkspaceDeleteMenuItem:er,workspaceMenuTriggerFrom:Mr,findRowMenuButton:Qn,isRowMenuButton:Dr,setupSidebarRowContextMenu:Lr,applySettingsNavIcon:Pr,restoreSettingsNavIcon:Or,installSettingsNavIcon:Fr,mutationTouches:Wn,resolveRowHasStatus:Bt,activeSessionActivity:Bn,activeSessionRefusal:jr,activeArchiveFromMessage:Nr,archiveSessionsViaOfficial:ar,unarchiveSessionsViaOfficial:Xr,createUnarchiveSession:Jr,bindObservable:sr,ARCHIVE_MANAGER_REMOTE:en,currentSessionId:Zn,setupSidebarEntry:Sr,ArchiveBundleConfigCard:yr,ArchiveBundleConfigCardWrapper:wr,setupWorkspaceFavoritesOnly:Ir},i.apply=_a,i.inject=Ta,r.exports}e(bi,"startArchiveClient");
|
|
25
31
|
|
|
26
32
|
return module.exports.startArchiveClient(require);
|
|
27
33
|
}
|