@michengai/dsh-archive-manager 1.1.12 → 1.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -7,20 +7,20 @@ 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 pn=Object.defineProperty;var va=Object.getOwnPropertyDescriptor;var ya=Object.getOwnPropertyNames;var ba=Object.prototype.hasOwnProperty;var t=(e,s)=>pn(e,"name",{value:s,configurable:!0});var wa=(e,s)=>{for(var o in s)pn(e,o,{get:s[o],enumerable:!0})},Sa=(e,s,o,v)=>{if(s&&typeof s=="object"||typeof s=="function")for(let a of ya(s))!ba.call(e,a)&&a!==o&&pn(e,a,{get:()=>s[a],enumerable:!(v=va(s,a))||v.enumerable});return e};var xa=e=>Sa(pn({},"__esModule",{value:!0}),e);var Ya={};wa(Ya,{startArchiveClient:()=>Ka});module.exports=xa(Ya);function ce(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("\u53C2\u6570\u5FC5\u987B\u4E3A\u5BF9\u8C61");return e}t(ce,"record");function Ye(e){return String(e&&typeof e=="object"&&"message"in e?e.message??e:e)}t(Ye,"errorMessage");function mn(e){return e&&typeof e=="object"&&"code"in e?e.code:void 0}t(mn,"errorCode");var Lr=Function("return globalThis.__dshArchiveReact")(),{Children:ei,Component:ti,Fragment:Ur,Profiler:ni,PureComponent:ri,StrictMode:si,Suspense:ai,cloneElement:ii,createContext:oi,createElement:Br,createRef:li,forwardRef:ci,isValidElement:di,lazy:ui,memo:hi,startTransition:pi,useCallback:mi,useContext:gi,useDebugValue:fi,useDeferredValue:vi,useEffect:Fr,useId:yi,useImperativeHandle:bi,useInsertionEffect:wi,useLayoutEffect:Si,useMemo:xi,useReducer:ki,useRef:Ci,useState:Ut,useSyncExternalStore:Ei,useTransition:Ii,version:Ai}=Lr,M=Lr;function Wr(e){return M.createElement("input",{className:"dsham_number",type:"number",min:e.min,max:e.max,value:e.value??"",disabled:e.disabled,"aria-label":e["aria-label"],onChange:t(s=>{let o=s.target.value;if(o===""){e.onChange(null);return}let v=Number(o);e.onChange(Number.isNaN(v)?null:v)},"onChange")})}t(Wr,"NumberField");function Ca(e=M.createElement){return e("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},e("rect",{x:2,y:3,width:12,height:11,rx:2}),e("line",{x1:2,y1:6.5,x2:14,y2:6.5}),e("line",{x1:5.5,y1:1.5,x2:5.5,y2:3.5}),e("line",{x1:10.5,y1:1.5,x2:10.5,y2:3.5}))}t(Ca,"CalendarIcon");function Zt(e,s,o){let v=String(s+1).padStart(2,"0"),a=String(o).padStart(2,"0");return`${e}-${v}-${a}`}t(Zt,"formatYmd");function Bt(e){let s=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);return s?{year:Number(s[1]),monthIndex:Number(s[2])-1,day:Number(s[3])}:null}t(Bt,"parseYmd");function Ea(e,s){let o=new Date(e,s,1).getDay(),v=(o===0?7:o)-1,a=new Date(e,s+1,0).getDate(),l=new Date(e,s,0).getDate(),c=[];for(let x=0;x<42;x++){let b=e,_=s,S=0,f=!1;x<v?(S=l-v+x+1,_=s-1,_<0&&(_=11,b--),f=!0):x<v+a?S=x-v+1:(S=x-v-a+1,_=s+1,_>11&&(_=0,b++),f=!0),c.push({year:b,monthIndex:_,day:S,dateStr:Zt(b,_,S),isOutside:f})}return c}t(Ea,"buildMonthGrid");function Ia(e,s=new Date){if(e==="all")return{from:"",to:""};let o=Zt(s.getFullYear(),s.getMonth(),s.getDate());if(e==="today")return{from:o,to:o};let v=e==="7d"?6:e==="30d"?29:89,a=new Date(s.getTime()-v*864e5);return{from:Zt(a.getFullYear(),a.getMonth(),a.getDate()),to:o}}t(Ia,"getPresetRange");function Hr(e,s,o,v){let a=s+v,l=new Date(e,a+1,0).getDate();return new Date(e,a,Math.min(o,l))}t(Hr,"shiftMonthClamped");function qr(e){let s=e.React||M;function o(E,ne){let je=E==="from"?ne:e.from,Ot=E==="to"?ne:e.to;if(je===""&&Ot===""){e.onClear();return}E==="from"?e.onFrom(ne):e.onTo(ne)}t(o,"change");let v=!!(e.from||e.to),a="";e.from&&e.to?a=`${e.from} \u2013 ${e.to}`:e.from?a=`${e.from} \u2013`:e.to?a=`\u2013 ${e.to}`:a=e.t?e.t("discovery.timeRange")||`${e.fromLabel} \u2013 ${e.toLabel}`:`${e.fromLabel} \u2013 ${e.toLabel}`;let c=(s.useRef??(E=>{let[ne]=s.useState({current:E});return ne}))(null),[x,b]=s.useState(!1),_=Bt(e.from||e.to)??{year:new Date().getFullYear(),monthIndex:new Date().getMonth(),day:new Date().getDate()},[S,f]=s.useState(_.year),[k,D]=s.useState(_.monthIndex),[z,U]=s.useState(null),[B,V]=s.useState(null),[xe,K]=s.useState(null);s.useEffect(()=>{if(!x)return;let E=t(je=>{c.current&&!c.current.contains(je.target)&&(b(!1),U(null))},"onPointerDown"),ne=t(je=>{je.key==="Escape"&&(je.preventDefault(),je.stopPropagation(),b(!1),U(null))},"onKeyDown");return typeof document<"u"&&document.addEventListener("mousedown",E,!0),typeof window<"u"&&window.addEventListener("keydown",ne,!0),()=>{typeof document<"u"&&document.removeEventListener("mousedown",E,!0),typeof window<"u"&&window.removeEventListener("keydown",ne,!0)}},[x]),s.useEffect(()=>{if(!x||!xe||!c.current)return;c.current.querySelector(`[data-date="${xe}"]`)?.focus()},[x,xe]);let Y=e.t?e.t("discovery.today")==="Today"||(e.t("locale.language")||"").startsWith("en"):!1,Z=e.t?e.t("discovery.today")==="\u0421\u0435\u0433\u043E\u0434\u043D\u044F"||(e.t("locale.language")||"").startsWith("ru"):!1,Q=Y?"en-US":Z?"ru-RU":"zh-CN",ke=Y?["Mo","Tu","We","Th","Fr","Sa","Su"]:Z?["\u041F\u043D","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041F\u0442","\u0421\u0431","\u0412\u0441"]:["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u65E5"];function X(E){E.stopPropagation(),k<=0?(D(11),f(ne=>ne-1)):D(ne=>ne-1)}t(X,"prevMonth");function rt(E){E.stopPropagation(),k>=11?(D(0),f(ne=>ne+1)):D(ne=>ne+1)}t(rt,"nextMonth");function Rt(E){z?(E>=z?(e.onFrom(z),e.onTo(E)):(e.onFrom(E),e.onTo(z)),U(null),b(!1)):(U(E),V(E))}t(Rt,"handleDayClick");function _e(E){let ne=Ia(E);E==="all"?e.onClear():(e.onFrom(ne.from),e.onTo(ne.to)),U(null),b(!1)}t(_e,"applyPreset");function L(E){let ne=Zt(E.getFullYear(),E.getMonth(),E.getDate());K(ne),z&&V(ne),(E.getFullYear()!==S||E.getMonth()!==k)&&(f(E.getFullYear()),D(E.getMonth()))}t(L,"moveFocusToDate");function ye(E,ne){let je=Bt(E);je&&L(new Date(je.year,je.monthIndex,je.day+ne))}t(ye,"moveFocus");let Ze=e.from,jt=e.to;z&&B&&(Ze=z<=B?z:B,jt=z<=B?B:z);let en=Ea(S,k),Je=new Date,bn=xe||Ze||Zt(Je.getFullYear(),Je.getMonth(),Je.getDate()),Nt=en.map((E,ne)=>{let je=Ze===E.dateStr,Ot=jt===E.dateStr,zt=!!(Ze&&jt&&E.dateStr>Ze&&E.dateStr<jt),tn=E.year===Je.getFullYear()&&E.monthIndex===Je.getMonth()&&E.day===Je.getDate(),vt="dsham_dateDay";E.isOutside&&(vt+=" is-outside"),tn&&(vt+=" is-today"),je&&(vt+=" is-start"),Ot&&(vt+=" is-end"),zt&&(vt+=" is-in-range");let Ht=!E.isOutside&&(E.dateStr===bn||E.day===1&&!en.some(G=>!G.isOutside&&G.dateStr===bn));return s.createElement("div",{key:ne,className:vt,role:"button",tabIndex:Ht?0:-1,"data-date":E.dateStr,"aria-label":E.dateStr,"aria-pressed":!!(je||Ot||zt),onClick:t(G=>{G.stopPropagation(),Rt(E.dateStr)},"onClick"),onKeyDown:t(G=>{if(G.key==="Enter"||G.key===" ")G.preventDefault(),G.stopPropagation(),Rt(E.dateStr);else if(G.key==="ArrowLeft")G.preventDefault(),G.stopPropagation(),ye(E.dateStr,-1);else if(G.key==="ArrowRight")G.preventDefault(),G.stopPropagation(),ye(E.dateStr,1);else if(G.key==="ArrowUp")G.preventDefault(),G.stopPropagation(),ye(E.dateStr,-7);else if(G.key==="ArrowDown")G.preventDefault(),G.stopPropagation(),ye(E.dateStr,7);else if(G.key==="Home"){G.preventDefault(),G.stopPropagation();let me=Bt(E.dateStr);if(me){let Te=new Date(me.year,me.monthIndex,me.day),yt=(Te.getDay()===0?7:Te.getDay())-1;Te.setDate(Te.getDate()-yt),L(Te)}}else if(G.key==="End"){G.preventDefault(),G.stopPropagation();let me=Bt(E.dateStr);if(me){let Te=new Date(me.year,me.monthIndex,me.day),yt=(Te.getDay()===0?7:Te.getDay())-1;Te.setDate(Te.getDate()+(6-yt)),L(Te)}}else if(G.key==="PageUp"){G.preventDefault(),G.stopPropagation();let me=Bt(E.dateStr);me&&L(Hr(me.year,me.monthIndex,me.day,-1))}else if(G.key==="PageDown"){G.preventDefault(),G.stopPropagation();let me=Bt(E.dateStr);me&&L(Hr(me.year,me.monthIndex,me.day,1))}},"onKeyDown"),onMouseEnter:t(()=>{z&&V(E.dateStr)},"onMouseEnter")},E.day)}),Dt=`${S}\u5E74 ${k+1}\u6708`;try{Dt=new Intl.DateTimeFormat(Q,{year:"numeric",month:"long"}).format(new Date(S,k,1))}catch{Dt=Y||Z?`${S}-${String(k+1).padStart(2,"0")}`:`${S}\u5E74 ${k+1}\u6708`}return s.createElement("div",{ref:c,className:"dsham_dateRange",role:"group","aria-label":e.label},s.createElement("input",{className:"dsham_dateInputSrOnly",type:"date",tabIndex:-1,"aria-hidden":!0,value:e.from,"aria-label":e.fromLabel,"aria-invalid":e.invalid||void 0,onChange:t(E=>o("from",E.target.value),"onChange")}),s.createElement("input",{className:"dsham_dateInputSrOnly",type:"date",tabIndex:-1,"aria-hidden":!0,value:e.to,"aria-label":e.toLabel,"aria-invalid":e.invalid||void 0,onChange:t(E=>o("to",E.target.value),"onChange")}),s.createElement("div",{className:"dsham_dateTrigger"+(x?" is-open":""),role:"button",tabIndex:0,"aria-expanded":x,"aria-controls":x?"dsham-date-popover":void 0,onClick:t(()=>{x&&U(null),b(!x)},"onClick"),onKeyDown:t(E=>{(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),x&&U(null),b(!x))},"onKeyDown")},Ca(s.createElement),s.createElement("span",{className:"dsham_dateText"+(v?"":" placeholder")},a),v?s.createElement("button",{type:"button",className:"dsham_dateClearBtn","aria-label":"clear",title:"clear",onClick:t(E=>{E.stopPropagation(),e.onClear(),U(null)},"onClick"),children:"\xD7"}):null,s.createElement("span",{className:"dsham_dateChevron"},Vr(s.createElement,x))),x&&s.createElement("div",{id:"dsham-date-popover",className:"dsham_datePopover",role:"region","aria-label":e.label,onClick:t(E=>E.stopPropagation(),"onClick")},s.createElement("div",{className:"dsham_datePresets"},s.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:t(()=>_e("all"),"onClick")},e.t?e.t("discovery.allTime"):"\u5168\u90E8\u65F6\u95F4"),s.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:t(()=>_e("today"),"onClick")},e.t?e.t("discovery.today"):"\u4ECA\u5929"),s.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:t(()=>_e("7d"),"onClick")},e.t?e.t("discovery.last7Days"):"\u8FD1 7 \u5929"),s.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:t(()=>_e("30d"),"onClick")},e.t?e.t("discovery.last30Days"):"\u8FD1 30 \u5929"),s.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:t(()=>_e("90d"),"onClick")},e.t?e.t("discovery.last90Days"):"\u8FD1 90 \u5929")),s.createElement("div",{className:"dsham_dateCalendar"},s.createElement("div",{className:"dsham_dateCalHeader"},s.createElement("button",{type:"button",className:"dsham_dateNavBtn",onClick:X,"aria-label":"prev month"},"\u2039"),s.createElement("span",{className:"dsham_dateMonthTitle"},Dt),s.createElement("button",{type:"button",className:"dsham_dateNavBtn",onClick:rt,"aria-label":"next month"},"\u203A")),s.createElement("div",{className:"dsham_dateGrid"},ke.map((E,ne)=>s.createElement("div",{key:ne,className:"dsham_dateWeekday"},E))),s.createElement("div",{className:"dsham_dateGrid"},Nt))))}t(qr,"DateRange");function gn(e){return M.createElement("div",{className:e.className},M.createElement("button",{type:"button",className:"dsham_disclosure","aria-expanded":e.open,onClick:e.onToggle},Vr(M.createElement,e.open),e.title),e.open?M.createElement("div",null,e.children):null)}t(gn,"Disclosure");function Vr(e,s){return e("svg",{className:"dsham_foldChevron"+(s?" is-open":""),viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":!0},e("path",{d:"M4 6l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"}))}t(Vr,"foldChevron");function Hn(e){let s=M.useRef(null);return M.useEffect(()=>{s.current&&(s.current.indeterminate=!!e.indeterminate&&!e.checked)},[e.indeterminate,e.checked]),M.createElement("input",{ref:s,className:"dsham_checkbox",type:"checkbox",checked:e.checked,disabled:e.disabled,"aria-label":e.label,onChange:t(o=>e.onChange({target:{checked:o.target.checked}}),"onChange")})}t(Hn,"SelectionCheckbox");var Jt=t(e=>{if(typeof e!="string"||!e.length||e.length>1024)throw new TypeError("\u4F1A\u8BDD ID \u65E0\u6548");return e},"id"),Gr=t((e,s=!1)=>{if(typeof e!="string"||e.length>200||s&&!e.trim())throw new TypeError("\u5173\u952E\u8BCD\u987B\u4E3A 1\uFF5E200 \u4E2A\u5B57\u7B26");return e.trim()},"queryText"),$r={parse(e){let s=ce(e);if(!s||!Array.isArray(s.sessionIds)||!s.sessionIds.length||s.sessionIds.length>20)throw new TypeError("\u6BCF\u6B21\u68C0\u7D22\u987B\u5305\u542B 1\uFF5E20 \u4E2A\u4F1A\u8BDD");return{sessionIds:[...new Set(s.sessionIds.map(Jt))],query:Gr(s.query,!0)}}},Aa={parse(e){let s=ce(e);if(!s)throw new TypeError("\u9884\u89C8\u53C2\u6570\u65E0\u6548");return{sessionId:Jt(s.sessionId),query:Gr(s.query??"")}}},Wn=t((e,s)=>{if(typeof e!="string"||e.length>s)throw new TypeError("\u8FD4\u56DE\u6587\u672C\u65E0\u6548");return e},"boundedString"),Kr=t(e=>{if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new TypeError("\u6D88\u606F\u5E8F\u53F7\u65E0\u6548");return e},"sequence"),qn={parse(e){let s=ce(e);if(!s||!Array.isArray(s.items)||!Array.isArray(s.failures)||s.items.length>20||s.failures.length>20)throw new TypeError("\u68C0\u7D22\u7ED3\u679C\u65E0\u6548");return{items:s.items.map(ce).map(o=>({sessionId:Jt(o.sessionId),seq:Kr(o.seq),snippet:Wn(o.snippet,400)})),failures:s.failures.map(ce).map(o=>({sessionId:Jt(o.sessionId),message:Wn(o.message,500)}))}}},_a={parse(e){let s=ce(e);if(!s||!Array.isArray(s.messages)||s.messages.length>8||typeof s.hasEarlier!="boolean"||typeof s.hasLater!="boolean")throw new TypeError("\u9884\u89C8\u7ED3\u679C\u65E0\u6548");return{sessionId:Jt(s.sessionId),hasEarlier:s.hasEarlier,hasLater:s.hasLater,messages:s.messages.map(ce).map(o=>{if(typeof o.role!="string"||!["user","assistant"].includes(o.role)||typeof o.truncated!="boolean")throw new TypeError("\u6D88\u606F\u89D2\u8272\u6216\u622A\u65AD\u72B6\u6001\u65E0\u6548");return{seq:Kr(o.seq),role:o.role,text:Wn(o.text,2e3),truncated:o.truncated}})}}};async function Yr(e,s=globalThis.navigator?.clipboard){if(typeof e!="string"||!e)throw Object.assign(new Error("\u6CA1\u6709\u53EF\u590D\u5236\u7684\u5185\u5BB9"),{code:"copy.empty"});if(!s?.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 s.writeText(e)}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"})}}t(Yr,"copySessionText");function Zr(){let e=t((o,v)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${o}`,create:t(()=>v,"create"),schema:v}),"codec");return[["searchSessionContent",$r,qn],["searchArchivedContent",$r,qn],["previewArchivedSession",Aa,_a]].map(([o,v,a])=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${o}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:o,invocation:{kind:"direct"},parameters:[{name:"input",wire:"input",source:"json",codec:e(o+"Input",v)}],result:e(o+"Result",a),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}t(Zr,"discoveryInvocations");function Jr(e,s){let o=s?.trim().toLowerCase();if(!o)return null;let v=e.toLowerCase().indexOf(o);if(v<0)return null;let a=0,l=0,c;for(let x of e){let b=l+x.toLowerCase().length;if(c===void 0&&b>v&&(c=a),a+=x.length,b>=v+o.length)return{start:c??a,end:a};l=b}return null}t(Jr,"findTextRange");function fn(e,s=!1){if(!/^\d{4}-\d{2}-\d{2}$/.test(e))return NaN;let[o,v,a]=e.split("-").map(Number),l=new Date(o,v-1,a);return l.getFullYear()!==o||l.getMonth()!==v-1||l.getDate()!==a?NaN:(s&&l.setDate(l.getDate()+1),l.getTime())}t(fn,"dayBoundary");function Vn(e,s){return(!e||Number.isFinite(fn(e)))&&(!s||Number.isFinite(fn(s)))&&(!e||!s||e<=s)}t(Vn,"validUpdatedRange");function Qr(e,s,o){if(!Vn(s,o))return!1;if(!s&&!o)return!0;let v=typeof e=="number"?e:Date.parse(e??"");return Number.isFinite(v)&&(!s||v>=fn(s))&&(!o||v<fn(o,!0))}t(Qr,"matchesUpdatedRange");async function Xr(e,s,o,{signal:v,onProgress:a}={}){let l=[],c=[],x=[...new Set(e)],b=t(()=>{if(v?.aborted)throw new Error("\u641C\u7D22\u5DF2\u53D6\u6D88")},"check");for(let _=0;_<x.length;_+=20){b();let S=qn.parse(await o({sessionIds:x.slice(_,_+20),query:s}));b(),l.push(...S.items),c.push(...S.failures),a?.({done:Math.min(_+20,x.length),total:x.length,items:[...l],failures:[...c]})}return b(),{items:l,failures:c}}t(Xr,"searchArchiveBatches");function es(e,s={}){let o=e.createElement;function v({text:f,query:k=""}){let D=Jr(f,k);return D?o(e.Fragment,null,f.slice(0,D.start),o("mark",null,f.slice(D.start,D.end)),f.slice(D.end)):f}t(v,"HighlightedText");function a(f,k,D,z){let U=JSON.stringify(f),B=JSON.stringify([U,k]),[V,xe]=e.useState(0),[K,Y]=e.useState({key:"",status:"idle",items:[],failures:[]});return e.useEffect(()=>{if(!D||!k.trim()||!z)return;let Q=new AbortController;Y({key:B,status:"loading",items:[],failures:[],done:0,total:f.length});let ke=setTimeout(()=>{Xr(JSON.parse(U),k,z,{signal:Q.signal,onProgress:t(X=>{Q.signal.aborted||Y({key:B,status:"loading",...X})},"onProgress")}).then(X=>{Q.signal.aborted||Y({key:B,status:"ready",done:f.length,total:f.length,...X})}).catch(X=>{Q.signal.aborted||Y(rt=>({...rt,key:B,status:"error",error:Ye(X)}))})},350);return()=>{Q.abort(),clearTimeout(ke)}},[U,k,D,z,V]),{...D&&k.trim()&&z?K.key===B?K:{key:B,status:"loading",items:[],failures:[],done:0,total:f.length}:{status:"idle",items:[],failures:[]},retry:t(()=>xe(Q=>Q+1),"retry")}}t(a,"useArchiveSearch");function l(f,k){let[D,z]=e.useState(null),[U,B]=e.useState({status:"idle"}),[V,xe]=e.useState(0),K=D,Y=D&&k.includes(D.session.id);return e.useEffect(()=>{D&&!Y&&z(null)},[D,Y]),e.useEffect(()=>{if(!Y||typeof window>"u")return;let Z=t(Q=>{Q.key==="Escape"&&(Q.preventDefault(),Q.stopPropagation(),Q.stopImmediatePropagation(),z(null))},"onKeyDown");return window.addEventListener("keydown",Z,!0),()=>window.removeEventListener("keydown",Z,!0)},[Y]),e.useEffect(()=>{if(!D||!Y||!f)return;let Z=!0;return B({key:K,status:"loading"}),Promise.resolve().then(()=>f({sessionId:D.session.id,query:D.query})).then(Q=>{Z&&B({key:K,status:"ready",value:Q})}).catch(Q=>{Z&&B({key:K,status:"error",error:Ye(Q)})}),()=>{Z=!1}},[K,Y,f,V]),{target:Y?D:null,...U.key===K?U:{status:"loading"},open:t((Z,Q="")=>z({session:Z,query:Q}),"open"),close:t(()=>z(null),"close"),retry:t(()=>xe(Z=>Z+1),"retry")}}t(l,"useArchivePreview");function c({title:f,failures:k,separator:D}){let[z,U]=e.useState(!1),B=o("ul",null,k.map(V=>o("li",{key:V.sessionId},V.sessionId,D,V.message)));return o(gn,{title:f,open:z,onToggle:t(()=>U(V=>!V),"onToggle")},B)}t(c,"FailureDetails");function x(f,k){let D=s.Button??(z=>o("button",{type:"button",disabled:z.disabled,onClick:z.onClick},z.children));return o(D,{variant:"outline",size:"sm",...k},f)}t(x,"textButton");function b({t:f,from:k,to:D,onFrom:z,onTo:U,invalid:B,onClear:V}){return o("div",{className:"dsham_dateFilter"},o(qr,{React:e,from:k,to:D,invalid:B,label:f("discovery.date"),fromLabel:f("discovery.from"),toLabel:f("discovery.to"),onFrom:z,onTo:U,onClear:V,t:f}),B?o("p",{className:"dsham_dateAlert",role:"alert"},f("discovery.invalidDate")):null)}t(b,"DiscoveryFilters");function _({state:f,t:k}){return f.status==="idle"?null:o("div",{className:"dsham_discoveryStatus",role:"status","aria-live":"polite"},o("p",null,k(f.status==="loading"?"discovery.searching":f.status==="error"?"discovery.searchError":"discovery.searched",{done:f.done??0,total:f.total??0})),f.status==="error"&&o("p",null,f.error),f.failures.length>0&&o(c,{title:k("discovery.failed",{n:f.failures.length}),failures:f.failures,separator:k("common.separator")}),(f.status==="error"||f.status==="ready"&&f.failures.length>0)&&x(k("discovery.retry"),{onClick:f.retry}))}t(_,"SearchStatus");function S({preview:f,t:k,MarkdownText:D}){let[z,U]=e.useState(!1);if(f.status==="loading")return o("p",{role:"status"},k("discovery.loading"));if(f.status==="error")return o("div",null,o("p",{role:"alert"},f.error),x(k("discovery.retry"),{onClick:f.retry}));let B=f.value;return B?o("div",{className:"dsham_previewMessages"},o("div",{className:"dsham_previewToolbar"},o("span",{title:k("discovery.previewHint")},k("discovery.readOnly")," \xB7 ",k("discovery.messageCount",{n:B.messages.length})),D&&o(s.SegmentedControl??"div",{id:"dsham-preview-mode",label:k("discovery.displayMode"),value:z?"raw":"formatted",options:[{value:"formatted",label:k("discovery.formatted")},{value:"raw",label:k("discovery.raw")}],onChange:t(V=>U(V==="raw"),"onChange")})),B.hasEarlier&&o("p",null,k("discovery.earlier")),!B.messages.length&&o("p",null,k("discovery.empty")),B.messages.map(V=>o("article",{key:V.seq,className:"dsham_previewMessage"},o("div",{className:"dsham_previewRole","data-role":V.role},o("span",{"aria-hidden":!0},k(V.role==="user"?"discovery.you":"discovery.ai")),o("strong",null,k("discovery."+V.role))),z||!D?o("pre",{className:"dsham_previewRaw"},o(v,{text:V.text,query:f.target?.query})):o(D,{text:V.text,streaming:!1,labels:{code:{copyLabel:k("discovery.copyCode"),copiedLabel:k("details.copied")},footnotes:k("discovery.footnotes")}}),V.truncated&&o("small",null,k("discovery.truncated")))),B.hasLater&&o("p",null,k("discovery.later"))):null}return t(S,"PreviewContent"),{HighlightedText:v,useArchiveSearch:a,useArchivePreview:l,DiscoveryFilters:b,SearchStatus:_,PreviewContent:S}}t(es,"createDiscoveryTools");var ts=[".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(""),ns={"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"},rs={"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"},ss={"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 It=class extends Error{static{t(this,"ArchiveNavigationError")}code;constructor(s){super(s),this.name="ArchiveNavigationError",this.code=s}};function as(e,s){return e instanceof It?s(`archives.${e.code}`):Ye(e)}t(as,"formatArchiveNavigationError");function Ta(e,s){if(typeof e?.retainInfo!="function")return;let o=e.retainInfo(s),v=o&&typeof o=="object"&&"getSnapshot"in o&&typeof o.getSnapshot=="function"?o.getSnapshot():o;if(!v||typeof v!="object"||!("retainedBy"in v))return;let a=v.retainedBy;if(!(!a||typeof a!="object"||!("mainView"in a)||typeof a.mainView!="number"))return{retainedBy:{mainView:a.mainView}}}t(Ta,"retainInfoSnapshot");function Ra(e){let s=e?.byId;if(s!==void 0){for(let o of Object.values(s))if(o&&(o.retainedBy?.mainView??0)>0)return o.id}}t(Ra,"mainViewSessionId");function dt(e){return Ra(e)}t(dt,"currentSessionId");function ja(e,s,o){return s===void 0||s===""?!1:(e?.byId?.[s]?.retainedBy?.mainView??0)>0||(Ta(o,s)?.retainedBy?.mainView??0)>0}t(ja,"sessionIsCurrent");async function is(e,s,o,v=()=>!0){if(o){if(typeof e.prepare=="function"&&await e.prepare(s),!v())return;await e.restore(s)}v()&&await e.open(s)}t(is,"openArchivedConversation");function os(e,s,o,{onOpened:v=t(()=>{},"onOpened"),beginNavigation:a,warn:l=t((...c)=>console.warn(...c),"warn")}={}){let c,x=e?.clearArchivedCurrent,b=e&&Object.getOwnPropertyDescriptor(e,"clearArchivedCurrent"),_=t(k=>ja(s.list.getSnapshot(),k,s),"viewing"),S=t(function(...k){return c!==void 0&&_(c)&&o.list.getSnapshot().archivedSessionIds.includes(c)?!1:(c=void 0,x?.apply(this,k))},"wrapped"),f=t(()=>e&&Object.getOwnPropertyDescriptor(e,"clearArchivedCurrent")?.value===S,"ownsWrapper");if(e&&typeof x=="function")try{if(e.clearArchivedCurrent=S,!f())throw new Error("\u5BFC\u822A\u65B9\u6CD5\u672A\u63A5\u7EB3\u5F52\u6863\u9002\u914D")}catch(k){l("archive-manager: \u65E0\u6CD5\u9002\u914D\u5F52\u6863\u5BFC\u822A\uFF0C\u8BF7\u6062\u590D\u4F1A\u8BDD\u540E\u6253\u5F00\u3002",k)}return{open(k){c=k;try{if(typeof x=="function"&&!f()&&o.list.getSnapshot().archivedSessionIds.includes(k))throw l("archive-manager: \u5F52\u6863\u5BFC\u822A\u9002\u914D\u4E0D\u53EF\u7528\u6216\u5DF2\u88AB\u66FF\u6362\u3002"),new It("navigationUnavailable");if(a?.(),typeof e?.openSession!="function")throw l("archive-manager: \u5BBF\u4E3B\u672A\u63D0\u4F9B\u4F1A\u8BDD\u6253\u5F00\u63A5\u53E3\u3002"),new It("navigationUnavailable");if(e.openSession(k),!_(k))throw l("archive-manager: \u5BBF\u4E3B\u672A\u4FDD\u7559\u76EE\u6807\u4F1A\u8BDD\u3002",{cleanupAvailable:typeof x=="function"}),new It("sessionNotRetained");v()}catch(D){throw c=void 0,D}},dispose(){c=void 0,!(!e||Object.getOwnPropertyDescriptor(e,"clearArchivedCurrent")?.value!==S)&&(b?Object.defineProperty(e,"clearArchivedCurrent",b):delete e.clearArchivedCurrent,x?.call(e))}}}t(os,"allowArchivedNavigation");var Tt=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"},cs={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 Qt(e){return e.toLowerCase().startsWith("zh")?ls:cs}t(Qt,"pluginUpdateCopy");function Na(e,s,o,v){let a=Qt(e),l=s?.restartDesktop===!0||s?.profileName==="desktop",c=l?{...a,manualHint:a.manualHintDesktop}:a,x=o!=="idle",b=c.checking,_="";return o==="checking"?b=c.checking:o==="updating"?b=c.updating:v.type==="error"?(b=v.message||c.failed,_="error"):v.type==="restart"?(b=l?c.restartDesktop:c.restart,_="success"):v.type==="restarting"?(b=c.restarting,_="success"):s===void 0?b=c.checking:s.latestCheckFailed?(b=c.failed,_="error"):!s.canAutoUpdate&&s.updateAvailable?(b=c.unavailable,_="update"):s.updateAvailable?(b=`${c.found}: v${s.latestVersion??c.unknown}`,_="update"):(b=c.latest,_="success"),{copy:c,busy:x,message:b,kind:_,loading:o==="updating",updateLabel:o==="updating"?c.updating:c.auto,disabled:x||s?.canAutoUpdate!==!0||s.updateAvailable!==!0,currentVersion:s===void 0?c.unknown:`v${s.currentVersion}`,latestVersion:s?.latestVersion===void 0?c.unknown:`v${s.latestVersion}`,profileName:s?.profileName??c.unknown,profileRaw:s?.profileName??"",latestRaw:s?.latestVersion??"latest"}}t(Na,"describePluginUpdate");function ds(e,s,o){let v="idle",a=s,l={type:"status"},c=0,x=new Set,b=t(()=>{for(let S of x)S()},"emit"),_=t(S=>{a=S,o?.(S)},"assign");return{get posts(){return c},subscribe(S){return x.add(S),()=>{x.delete(S)}},view(S){return Na(S,a,v,l)},async check(){if(v==="idle"){v="checking",l={type:"status"},b();try{_(await e("GET")),l={type:"status"}}catch(S){l={type:"error",message:S instanceof Error?S.message:""}}finally{v="idle",b()}}},async update(){if(v==="idle"){v="updating",l={type:"status"},c+=1,b();try{let S=await e("POST");_(S),l={type:S.autoReload===!0?"restarting":"restart"}}catch(S){l={type:"error",message:S instanceof Error?S.message:""}}finally{v="idle",b()}}}}}t(ds,"createUpdateFlow");function us(e,s,o){return`dsh plugin${e.trim()===""?"":` --profile ${e.trim()}`} add ${s}@${o} --registry=https://registry.npmjs.org/`}t(us,"manualPluginUpdateCommand");function hs(e,s){return e.key!=="Escape"?!1:(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),s(),!0)}t(hs,"handlePluginUpdateEscape");function Da(){let e=globalThis.document;if(typeof e>"u"||e===null)return;let s=e.baseURI;if(!(typeof s!="string"||s===""))try{let o=new URL(s),v=o.pathname.lastIndexOf("/"),a=o.pathname.slice(v+1);return/\.(html?|php|aspx?|jsp)$/i.test(a)?o.pathname=o.pathname.slice(0,v+1):o.pathname.endsWith("/")||(o.pathname+="/"),o.href}catch{return}}t(Da,"pageBaseHref");function vn(e){if(typeof e!="string"||e.charAt(0)!=="/"||e.charAt(1)==="/")return e;let s=Da();if(s===void 0)return e;try{return new URL(e.slice(1),s).href}catch{return e}}t(vn,"resolveApiUrl");function ps(e){let o=Function("return globalThis.__dshArchiveReactDOMClient")()?.createRoot;if(o===void 0)throw new Error("createRoot unavailable");return o(e)}t(ps,"mountRoot");var Oa="x-michengai-plugin-update",ms="michengai-plugin-update-ui",$n=`
10
+ "use strict";var Cn=Object.defineProperty;var Ga=Object.getOwnPropertyDescriptor;var $a=Object.getOwnPropertyNames;var Ka=Object.prototype.hasOwnProperty;var e=(t,s)=>Cn(t,"name",{value:s,configurable:!0});var Ya=(t,s)=>{for(var o in s)Cn(t,o,{get:s[o],enumerable:!0})},Za=(t,s,o,f)=>{if(s&&typeof s=="object"||typeof s=="function")for(let a of $a(s))!Ka.call(t,a)&&a!==o&&Cn(t,a,{get:()=>s[a],enumerable:!(f=Ga(s,a))||f.enumerable});return t};var Ja=t=>Za(Cn({},"__esModule",{value:!0}),t);var Ei={};Ya(Ei,{startArchiveClient:()=>Ci});module.exports=Ja(Ei);function le(t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError("\u53C2\u6570\u5FC5\u987B\u4E3A\u5BF9\u8C61");return t}e(le,"record");function Pe(t){return String(t&&typeof t=="object"&&"message"in t?t.message??t:t)}e(Pe,"errorMessage");function En(t){return t&&typeof t=="object"&&"code"in t?t.code:void 0}e(En,"errorCode");var ss=Function("return globalThis.__dshArchiveReact")(),{Children:ji,Component:Di,Fragment:as,Profiler:Ni,PureComponent:zi,StrictMode:Oi,Suspense:Mi,cloneElement:Pi,createContext:Li,createElement:is,createRef:Fi,forwardRef:Bi,isValidElement:Ui,lazy:Hi,memo:Wi,startTransition:qi,useCallback:Vi,useContext:Gi,useDebugValue:$i,useDeferredValue:Ki,useEffect:os,useId:Yi,useImperativeHandle:Zi,useInsertionEffect:Ji,useLayoutEffect:Qi,useMemo:Xi,useReducer:eo,useRef:to,useState:qt,useSyncExternalStore:no,useTransition:ro,version:so}=ss,L=ss;function cs(t){return L.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(s=>{let o=s.target.value;if(o===""){t.onChange(null);return}let f=Number(o);t.onChange(Number.isNaN(f)?null:f)},"onChange")})}e(cs,"NumberField");function Xa(t=L.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(Xa,"CalendarIcon");function an(t,s,o){let f=String(s+1).padStart(2,"0"),a=String(o).padStart(2,"0");return`${t}-${f}-${a}`}e(an,"formatYmd");function Vt(t){let s=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);return s?{year:Number(s[1]),monthIndex:Number(s[2])-1,day:Number(s[3])}:null}e(Vt,"parseYmd");function ei(t,s){let o=new Date(t,s,1).getDay(),f=(o===0?7:o)-1,a=new Date(t,s+1,0).getDate(),l=new Date(t,s,0).getDate(),c=[];for(let E=0;E<42;E++){let y=t,R=s,w=0,v=!1;E<f?(w=l-f+E+1,R=s-1,R<0&&(R=11,y--),v=!0):E<f+a?w=E-f+1:(w=E-f-a+1,R=s+1,R>11&&(R=0,y++),v=!0),c.push({year:y,monthIndex:R,day:w,dateStr:an(y,R,w),isOutside:v})}return c}e(ei,"buildMonthGrid");function ti(t,s=new Date){if(t==="all")return{from:"",to:""};let o=an(s.getFullYear(),s.getMonth(),s.getDate());if(t==="today")return{from:o,to:o};let f=t==="7d"?6:t==="30d"?29:89,a=new Date(s.getTime()-f*864e5);return{from:an(a.getFullYear(),a.getMonth(),a.getDate()),to:o}}e(ti,"getPresetRange");function ls(t,s,o,f){let a=s+f,l=new Date(t,a+1,0).getDate();return new Date(t,a,Math.min(o,l))}e(ls,"shiftMonthClamped");function ds(t){let s=t.React||L;function o(_,J){let Le=_==="from"?J:t.from,zt=_==="to"?J:t.to;if(Le===""&&zt===""){t.onClear();return}_==="from"?t.onFrom(J):t.onTo(J)}e(o,"change");let f=!!(t.from||t.to),a="";t.from&&t.to?a=`${t.from} \u2013 ${t.to}`:t.from?a=`${t.from} \u2013`:t.to?a=`\u2013 ${t.to}`:a=t.t?t.t("discovery.timeRange")||`${t.fromLabel} \u2013 ${t.toLabel}`:`${t.fromLabel} \u2013 ${t.toLabel}`;let c=(s.useRef??(_=>{let[J]=s.useState({current:_});return J}))(null),[E,y]=s.useState(!1),R=Vt(t.from||t.to)??{year:new Date().getFullYear(),monthIndex:new Date().getMonth(),day:new Date().getDate()},[w,v]=s.useState(R.year),[x,T]=s.useState(R.monthIndex),[N,B]=s.useState(null),[F,H]=s.useState(null),[De,ne]=s.useState(null);s.useEffect(()=>{if(!E)return;let _=e(Le=>{c.current&&!c.current.contains(Le.target)&&(y(!1),B(null))},"onPointerDown"),J=e(Le=>{Le.key==="Escape"&&(Le.preventDefault(),Le.stopPropagation(),y(!1),B(null))},"onKeyDown");return typeof document<"u"&&document.addEventListener("mousedown",_,!0),typeof window<"u"&&window.addEventListener("keydown",J,!0),()=>{typeof document<"u"&&document.removeEventListener("mousedown",_,!0),typeof window<"u"&&window.removeEventListener("keydown",J,!0)}},[E]),s.useEffect(()=>{if(!E||!De||!c.current)return;c.current.querySelector(`[data-date="${De}"]`)?.focus()},[E,De]);let re=t.t?t.t("discovery.today")==="Today"||(t.t("locale.language")||"").startsWith("en"):!1,se=t.t?t.t("discovery.today")==="\u0421\u0435\u0433\u043E\u0434\u043D\u044F"||(t.t("locale.language")||"").startsWith("ru"):!1,ie=re?"en-US":se?"ru-RU":"zh-CN",Ne=re?["Mo","Tu","We","Th","Fr","Sa","Su"]:se?["\u041F\u043D","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041F\u0442","\u0421\u0431","\u0412\u0441"]:["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u65E5"];function ce(_){_.stopPropagation(),x<=0?(T(11),v(J=>J-1)):T(J=>J-1)}e(ce,"prevMonth");function Z(_){_.stopPropagation(),x>=11?(T(0),v(J=>J+1)):T(J=>J+1)}e(Z,"nextMonth");function xt(_){N?(_>=N?(t.onFrom(N),t.onTo(_)):(t.onFrom(_),t.onTo(N)),B(null),y(!1)):(B(_),H(_))}e(xt,"handleDayClick");function Re(_){let J=ti(_);_==="all"?t.onClear():(t.onFrom(J.from),t.onTo(J.to)),B(null),y(!1)}e(Re,"applyPreset");function U(_){let J=an(_.getFullYear(),_.getMonth(),_.getDate());ne(J),N&&H(J),(_.getFullYear()!==w||_.getMonth()!==x)&&(v(_.getFullYear()),T(_.getMonth()))}e(U,"moveFocusToDate");function de(_,J){let Le=Vt(_);Le&&U(new Date(Le.year,Le.monthIndex,Le.day+J))}e(de,"moveFocus");let at=t.from,$t=t.to;N&&F&&(at=N<=F?N:F,$t=N<=F?F:N);let Tn=ei(w,x),Dt=new Date,Nt=De||at||an(Dt.getFullYear(),Dt.getMonth(),Dt.getDate()),dn=Tn.map((_,J)=>{let Le=at===_.dateStr,zt=$t===_.dateStr,Bt=!!(at&&$t&&_.dateStr>at&&_.dateStr<$t),jn=_.year===Dt.getFullYear()&&_.monthIndex===Dt.getMonth()&&_.day===Dt.getDate(),Ot="dsham_dateDay";_.isOutside&&(Ot+=" is-outside"),jn&&(Ot+=" is-today"),Le&&(Ot+=" is-start"),zt&&(Ot+=" is-end"),Bt&&(Ot+=" is-in-range");let Dn=!_.isOutside&&(_.dateStr===Nt||_.day===1&&!Tn.some(X=>!X.isOutside&&X.dateStr===Nt));return s.createElement("div",{key:J,className:Ot,role:"button",tabIndex:Dn?0:-1,"data-date":_.dateStr,"aria-label":_.dateStr,"aria-pressed":!!(Le||zt||Bt),onClick:e(X=>{X.stopPropagation(),xt(_.dateStr)},"onClick"),onKeyDown:e(X=>{if(X.key==="Enter"||X.key===" ")X.preventDefault(),X.stopPropagation(),xt(_.dateStr);else if(X.key==="ArrowLeft")X.preventDefault(),X.stopPropagation(),de(_.dateStr,-1);else if(X.key==="ArrowRight")X.preventDefault(),X.stopPropagation(),de(_.dateStr,1);else if(X.key==="ArrowUp")X.preventDefault(),X.stopPropagation(),de(_.dateStr,-7);else if(X.key==="ArrowDown")X.preventDefault(),X.stopPropagation(),de(_.dateStr,7);else if(X.key==="Home"){X.preventDefault(),X.stopPropagation();let _e=Vt(_.dateStr);if(_e){let nt=new Date(_e.year,_e.monthIndex,_e.day),Kt=(nt.getDay()===0?7:nt.getDay())-1;nt.setDate(nt.getDate()-Kt),U(nt)}}else if(X.key==="End"){X.preventDefault(),X.stopPropagation();let _e=Vt(_.dateStr);if(_e){let nt=new Date(_e.year,_e.monthIndex,_e.day),Kt=(nt.getDay()===0?7:nt.getDay())-1;nt.setDate(nt.getDate()+(6-Kt)),U(nt)}}else if(X.key==="PageUp"){X.preventDefault(),X.stopPropagation();let _e=Vt(_.dateStr);_e&&U(ls(_e.year,_e.monthIndex,_e.day,-1))}else if(X.key==="PageDown"){X.preventDefault(),X.stopPropagation();let _e=Vt(_.dateStr);_e&&U(ls(_e.year,_e.monthIndex,_e.day,1))}},"onKeyDown"),onMouseEnter:e(()=>{N&&H(_.dateStr)},"onMouseEnter")},_.day)}),un=`${w}\u5E74 ${x+1}\u6708`;try{un=new Intl.DateTimeFormat(ie,{year:"numeric",month:"long"}).format(new Date(w,x,1))}catch{un=re||se?`${w}-${String(x+1).padStart(2,"0")}`:`${w}\u5E74 ${x+1}\u6708`}return s.createElement("div",{ref:c,className:"dsham_dateRange",role:"group","aria-label":t.label},s.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(_=>o("from",_.target.value),"onChange")}),s.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(_=>o("to",_.target.value),"onChange")}),s.createElement("div",{className:"dsham_dateTrigger"+(E?" is-open":""),role:"button",tabIndex:0,"aria-expanded":E,"aria-controls":E?"dsham-date-popover":void 0,onClick:e(()=>{E&&B(null),y(!E)},"onClick"),onKeyDown:e(_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),E&&B(null),y(!E))},"onKeyDown")},Xa(s.createElement),s.createElement("span",{className:"dsham_dateText"+(f?"":" placeholder")},a),f?s.createElement("button",{type:"button",className:"dsham_dateClearBtn","aria-label":"clear",title:"clear",onClick:e(_=>{_.stopPropagation(),t.onClear(),B(null)},"onClick"),children:"\xD7"}):null,s.createElement("span",{className:"dsham_dateChevron"},us(s.createElement,E))),E&&s.createElement("div",{id:"dsham-date-popover",className:"dsham_datePopover",role:"region","aria-label":t.label,onClick:e(_=>_.stopPropagation(),"onClick")},s.createElement("div",{className:"dsham_datePresets"},s.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>Re("all"),"onClick")},t.t?t.t("discovery.allTime"):"\u5168\u90E8\u65F6\u95F4"),s.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>Re("today"),"onClick")},t.t?t.t("discovery.today"):"\u4ECA\u5929"),s.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>Re("7d"),"onClick")},t.t?t.t("discovery.last7Days"):"\u8FD1 7 \u5929"),s.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>Re("30d"),"onClick")},t.t?t.t("discovery.last30Days"):"\u8FD1 30 \u5929"),s.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>Re("90d"),"onClick")},t.t?t.t("discovery.last90Days"):"\u8FD1 90 \u5929")),s.createElement("div",{className:"dsham_dateCalendar"},s.createElement("div",{className:"dsham_dateCalHeader"},s.createElement("button",{type:"button",className:"dsham_dateNavBtn",onClick:ce,"aria-label":"prev month"},"\u2039"),s.createElement("span",{className:"dsham_dateMonthTitle"},un),s.createElement("button",{type:"button",className:"dsham_dateNavBtn",onClick:Z,"aria-label":"next month"},"\u203A")),s.createElement("div",{className:"dsham_dateGrid"},Ne.map((_,J)=>s.createElement("div",{key:J,className:"dsham_dateWeekday"},_))),s.createElement("div",{className:"dsham_dateGrid"},dn))))}e(ds,"DateRange");function An(t){return L.createElement("div",{className:t.className},L.createElement("button",{type:"button",className:"dsham_disclosure","aria-expanded":t.open,onClick:t.onToggle},us(L.createElement,t.open),t.title),t.open?L.createElement("div",null,t.children):null)}e(An,"Disclosure");function us(t,s){return t("svg",{className:"dsham_foldChevron"+(s?" 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(us,"foldChevron");function tr(t){let s=L.useRef(null);return L.useEffect(()=>{s.current&&(s.current.indeterminate=!!t.indeterminate&&!t.checked)},[t.indeterminate,t.checked]),L.createElement("input",{ref:s,className:"dsham_checkbox",type:"checkbox",checked:t.checked,disabled:t.disabled,"aria-label":t.label,onChange:e(o=>t.onChange({target:{checked:o.target.checked}}),"onChange")})}e(tr,"SelectionCheckbox");var on=e(t=>{if(typeof t!="string"||!t.length||t.length>1024)throw new TypeError("\u4F1A\u8BDD ID \u65E0\u6548");return t},"id"),ps=e((t,s=!1)=>{if(typeof t!="string"||t.length>200||s&&!t.trim())throw new TypeError("\u5173\u952E\u8BCD\u987B\u4E3A 1\uFF5E200 \u4E2A\u5B57\u7B26");return t.trim()},"queryText"),hs={parse(t){let s=le(t);if(!s||!Array.isArray(s.sessionIds)||!s.sessionIds.length||s.sessionIds.length>20)throw new TypeError("\u6BCF\u6B21\u68C0\u7D22\u987B\u5305\u542B 1\uFF5E20 \u4E2A\u4F1A\u8BDD");return{sessionIds:[...new Set(s.sessionIds.map(on))],query:ps(s.query,!0)}}},ni={parse(t){let s=le(t);if(!s)throw new TypeError("\u9884\u89C8\u53C2\u6570\u65E0\u6548");return{sessionId:on(s.sessionId),query:ps(s.query??"")}}},nr=e((t,s)=>{if(typeof t!="string"||t.length>s)throw new TypeError("\u8FD4\u56DE\u6587\u672C\u65E0\u6548");return t},"boundedString"),ms=e(t=>{if(typeof t!="number"||!Number.isSafeInteger(t)||t<0)throw new TypeError("\u6D88\u606F\u5E8F\u53F7\u65E0\u6548");return t},"sequence"),rr={parse(t){let s=le(t);if(!s||!Array.isArray(s.items)||!Array.isArray(s.failures)||s.items.length>20||s.failures.length>20)throw new TypeError("\u68C0\u7D22\u7ED3\u679C\u65E0\u6548");return{items:s.items.map(le).map(o=>({sessionId:on(o.sessionId),seq:ms(o.seq),snippet:nr(o.snippet,400)})),failures:s.failures.map(le).map(o=>({sessionId:on(o.sessionId),message:nr(o.message,500)}))}}},ri={parse(t){let s=le(t);if(!s||!Array.isArray(s.messages)||s.messages.length>8||typeof s.hasEarlier!="boolean"||typeof s.hasLater!="boolean")throw new TypeError("\u9884\u89C8\u7ED3\u679C\u65E0\u6548");return{sessionId:on(s.sessionId),hasEarlier:s.hasEarlier,hasLater:s.hasLater,messages:s.messages.map(le).map(o=>{if(typeof o.role!="string"||!["user","assistant"].includes(o.role)||typeof o.truncated!="boolean")throw new TypeError("\u6D88\u606F\u89D2\u8272\u6216\u622A\u65AD\u72B6\u6001\u65E0\u6548");return{seq:ms(o.seq),role:o.role,text:nr(o.text,2e3),truncated:o.truncated}})}}};async function fs(t,s=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(!s?.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 s.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(fs,"copySessionText");function gs(){let t=e((o,f)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${o}`,create:e(()=>f,"create"),schema:f}),"codec");return[["searchSessionContent",hs,rr],["searchArchivedContent",hs,rr],["previewArchivedSession",ni,ri]].map(([o,f,a])=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${o}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:o,invocation:{kind:"direct"},parameters:[{name:"input",wire:"input",source:"json",codec:t(o+"Input",f)}],result:t(o+"Result",a),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}e(gs,"discoveryInvocations");function vs(t,s){let o=s?.trim().toLowerCase();if(!o)return null;let f=t.toLowerCase().indexOf(o);if(f<0)return null;let a=0,l=0,c;for(let E of t){let y=l+E.toLowerCase().length;if(c===void 0&&y>f&&(c=a),a+=E.length,y>=f+o.length)return{start:c??a,end:a};l=y}return null}e(vs,"findTextRange");function In(t,s=!1){if(!/^\d{4}-\d{2}-\d{2}$/.test(t))return NaN;let[o,f,a]=t.split("-").map(Number),l=new Date(o,f-1,a);return l.getFullYear()!==o||l.getMonth()!==f-1||l.getDate()!==a?NaN:(s&&l.setDate(l.getDate()+1),l.getTime())}e(In,"dayBoundary");function sr(t,s){return(!t||Number.isFinite(In(t)))&&(!s||Number.isFinite(In(s)))&&(!t||!s||t<=s)}e(sr,"validUpdatedRange");function ys(t,s,o){if(!sr(s,o))return!1;if(!s&&!o)return!0;let f=typeof t=="number"?t:Date.parse(t??"");return Number.isFinite(f)&&(!s||f>=In(s))&&(!o||f<In(o,!0))}e(ys,"matchesUpdatedRange");async function bs(t,s,o,{signal:f,onProgress:a}={}){let l=[],c=[],E=[...new Set(t)],y=e(()=>{if(f?.aborted)throw new Error("\u641C\u7D22\u5DF2\u53D6\u6D88")},"check");for(let R=0;R<E.length;R+=20){y();let w=rr.parse(await o({sessionIds:E.slice(R,R+20),query:s}));y(),l.push(...w.items),c.push(...w.failures),a?.({done:Math.min(R+20,E.length),total:E.length,items:[...l],failures:[...c]})}return y(),{items:l,failures:c}}e(bs,"searchArchiveBatches");function ws(t,s={}){let o=t.createElement;function f({text:v,query:x=""}){let T=vs(v,x);return T?o(t.Fragment,null,v.slice(0,T.start),o("mark",null,v.slice(T.start,T.end)),v.slice(T.end)):v}e(f,"HighlightedText");function a(v,x,T,N){let B=JSON.stringify(v),F=JSON.stringify([B,x]),[H,De]=t.useState(0),[ne,re]=t.useState({key:"",status:"idle",items:[],failures:[]});return t.useEffect(()=>{if(!T||!x.trim()||!N)return;let ie=new AbortController;re({key:F,status:"loading",items:[],failures:[],done:0,total:v.length});let Ne=setTimeout(()=>{bs(JSON.parse(B),x,N,{signal:ie.signal,onProgress:e(ce=>{ie.signal.aborted||re({key:F,status:"loading",...ce})},"onProgress")}).then(ce=>{ie.signal.aborted||re({key:F,status:"ready",done:v.length,total:v.length,...ce})}).catch(ce=>{ie.signal.aborted||re(Z=>({...Z,key:F,status:"error",error:Pe(ce)}))})},350);return()=>{ie.abort(),clearTimeout(Ne)}},[B,x,T,N,H]),{...T&&x.trim()&&N?ne.key===F?ne:{key:F,status:"loading",items:[],failures:[],done:0,total:v.length}:{status:"idle",items:[],failures:[]},retry:e(()=>De(ie=>ie+1),"retry")}}e(a,"useArchiveSearch");function l(v,x){let[T,N]=t.useState(null),[B,F]=t.useState({status:"idle"}),[H,De]=t.useState(0),ne=T,re=T&&x.includes(T.session.id);return t.useEffect(()=>{T&&!re&&N(null)},[T,re]),t.useEffect(()=>{if(!re||typeof window>"u")return;let se=e(ie=>{ie.key==="Escape"&&(ie.preventDefault(),ie.stopPropagation(),ie.stopImmediatePropagation(),N(null))},"onKeyDown");return window.addEventListener("keydown",se,!0),()=>window.removeEventListener("keydown",se,!0)},[re]),t.useEffect(()=>{if(!T||!re||!v)return;let se=!0;return F({key:ne,status:"loading"}),Promise.resolve().then(()=>v({sessionId:T.session.id,query:T.query})).then(ie=>{se&&F({key:ne,status:"ready",value:ie})}).catch(ie=>{se&&F({key:ne,status:"error",error:Pe(ie)})}),()=>{se=!1}},[ne,re,v,H]),{target:re?T:null,...B.key===ne?B:{status:"loading"},open:e((se,ie="")=>N({session:se,query:ie}),"open"),close:e(()=>N(null),"close"),retry:e(()=>De(se=>se+1),"retry")}}e(l,"useArchivePreview");function c({title:v,failures:x,separator:T}){let[N,B]=t.useState(!1),F=o("ul",null,x.map(H=>o("li",{key:H.sessionId},H.sessionId,T,H.message)));return o(An,{title:v,open:N,onToggle:e(()=>B(H=>!H),"onToggle")},F)}e(c,"FailureDetails");function E(v,x){let T=s.Button??(N=>o("button",{type:"button",disabled:N.disabled,onClick:N.onClick},N.children));return o(T,{variant:"outline",size:"sm",...x},v)}e(E,"textButton");function y({t:v,from:x,to:T,onFrom:N,onTo:B,invalid:F,onClear:H}){return o("div",{className:"dsham_dateFilter"},o(ds,{React:t,from:x,to:T,invalid:F,label:v("discovery.date"),fromLabel:v("discovery.from"),toLabel:v("discovery.to"),onFrom:N,onTo:B,onClear:H,t:v}),F?o("p",{className:"dsham_dateAlert",role:"alert"},v("discovery.invalidDate")):null)}e(y,"DiscoveryFilters");function R({state:v,t:x}){return v.status==="idle"?null:o("div",{className:"dsham_discoveryStatus",role:"status","aria-live":"polite"},o("p",null,x(v.status==="loading"?"discovery.searching":v.status==="error"?"discovery.searchError":"discovery.searched",{done:v.done??0,total:v.total??0})),v.status==="error"&&o("p",null,v.error),v.failures.length>0&&o(c,{title:x("discovery.failed",{n:v.failures.length}),failures:v.failures,separator:x("common.separator")}),(v.status==="error"||v.status==="ready"&&v.failures.length>0)&&E(x("discovery.retry"),{onClick:v.retry}))}e(R,"SearchStatus");function w({preview:v,t:x,MarkdownText:T}){let[N,B]=t.useState(!1);if(v.status==="loading")return o("p",{role:"status"},x("discovery.loading"));if(v.status==="error")return o("div",null,o("p",{role:"alert"},v.error),E(x("discovery.retry"),{onClick:v.retry}));let F=v.value;return F?o("div",{className:"dsham_previewMessages"},o("div",{className:"dsham_previewToolbar"},o("span",{title:x("discovery.previewHint")},x("discovery.readOnly")," \xB7 ",x("discovery.messageCount",{n:F.messages.length})),T&&o(s.SegmentedControl??"div",{id:"dsham-preview-mode",label:x("discovery.displayMode"),value:N?"raw":"formatted",options:[{value:"formatted",label:x("discovery.formatted")},{value:"raw",label:x("discovery.raw")}],onChange:e(H=>B(H==="raw"),"onChange")})),F.hasEarlier&&o("p",null,x("discovery.earlier")),!F.messages.length&&o("p",null,x("discovery.empty")),F.messages.map(H=>o("article",{key:H.seq,className:"dsham_previewMessage"},o("div",{className:"dsham_previewRole","data-role":H.role},o("span",{"aria-hidden":!0},x(H.role==="user"?"discovery.you":"discovery.ai")),o("strong",null,x("discovery."+H.role))),N||!T?o("pre",{className:"dsham_previewRaw"},o(f,{text:H.text,query:v.target?.query})):o(T,{text:H.text,streaming:!1,labels:{code:{copyLabel:x("discovery.copyCode"),copiedLabel:x("details.copied")},footnotes:x("discovery.footnotes")}}),H.truncated&&o("small",null,x("discovery.truncated")))),F.hasLater&&o("p",null,x("discovery.later"))):null}return e(w,"PreviewContent"),{HighlightedText:f,useArchiveSearch:a,useArchivePreview:l,DiscoveryFilters:y,SearchStatus:R,PreviewContent:w}}e(ws,"createDiscoveryTools");var Ss=[".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(""),ks={"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"},xs={"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"},Cs={"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 Es=e(t=>{let s=le(t);if(!s||typeof s.sessionId!="string"||!s.sessionId.length||s.sessionId.length>1024||typeof s.identity!="string"||!s.identity.length||s.identity.length>4096)throw new TypeError("invalid cache rebuild candidate");return{sessionId:s.sessionId,identity:s.identity}},"candidate"),si={parse(t){let s=le(t);if(!s||!Array.isArray(s.items)||!s.items.length||s.items.length>20)throw new TypeError("invalid cache rebuild batch (1\u201320 items required)");return{items:s.items.map(Es)}}},ar={parse(t){let s=le(t);if(!s||!Array.isArray(s.items)||s.count!==s.items.length)throw new TypeError("invalid cache diagnosis");return{count:s.items.length,items:s.items.map(Es)}}},ir={parse(t){let s=le(t);for(let o of["rebuiltSessionIds","skippedSessionIds"])if(!Array.isArray(s?.[o])||s[o].some(f=>typeof f!="string"))throw new TypeError("invalid cache rebuild result");if(!Array.isArray(s.failures)||s.failures.some(o=>!o||typeof o.sessionId!="string"||typeof o.message!="string"))throw new TypeError("invalid cache rebuild failures");return s}};function As(){let t=e((s,o)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${s}`,create:e(()=>o,"create"),schema:o}),"codec");return[{method:"diagnoseSessionCaches",parameters:[],result:t("CacheDiagnosis",ar)},{method:"rebuildSessionCaches",parameters:[{name:"input",wire:"input",source:"json",codec:t("CacheRebuildInput",si)}],result:t("CacheRebuildResult",ir)}].map(({method:s,...o})=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${s}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:s,invocation:{kind:"direct"},...o,sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}e(As,"cacheRebuildInvocations");function Is(t,s={}){let{maxLoadRetries:o=3,retryDelayMs:f=200}=s,a={diagnosis:{count:0,items:[]},busy:!1,progress:null,result:null,error:null,refreshError:null},l=!0,c=0,E=[],y,R=new Set,w=e(x=>{if(l){a={...a,...x};for(let T of R)T()}},"update"),v=e(async(x=o)=>{if(!l)return;y!==void 0&&(clearTimeout(y),y=void 0);let T=++c;try{let N=ar.parse(await t.diagnose());l&&T===c&&w({diagnosis:N,error:null})}catch(N){if(x>0&&l&&T===c){y=setTimeout(()=>{y=void 0,l&&T===c&&v(x-1)},f);return}l&&T===c&&w({error:Pe(N)})}},"load");return{snapshot:e(()=>a,"snapshot"),subscribe(x){return R.add(x),()=>{R.delete(x)}},load:v,async run(x=!1){if(!l||a.busy)return;++c,y!==void 0&&(clearTimeout(y),y=void 0);let T=x?[...E]:[...a.diagnosis.items],N={rebuiltSessionIds:[],skippedSessionIds:[],failures:[]};E=[],w({busy:!0,result:null,error:null,refreshError:null,progress:{done:0,total:T.length}});for(let[B,F]of T.entries()){if(!l)return;try{let H=ir.parse(await t.rebuild({items:[F]}));if(!l)return;N.rebuiltSessionIds.push(...H.rebuiltSessionIds),N.skippedSessionIds.push(...H.skippedSessionIds),N.failures.push(...H.failures),H.failures.length&&E.push(F)}catch(H){if(!l)return;N.failures.push({sessionId:F.sessionId,message:Pe(H)}),E.push(F)}w({progress:{done:B+1,total:T.length}})}w({result:N});try{await t.refresh()}catch(B){w({refreshError:Pe(B)})}l&&(await v(),w({busy:!1,progress:null}))},dismiss(){l&&w({result:null,error:null,refreshError:null})},dispose(){l=!1,++c,y!==void 0&&(clearTimeout(y),y=void 0),R.clear()}}}e(Is,"createCacheRebuildController");var jt=class extends Error{static{e(this,"ArchiveNavigationError")}code;constructor(s){super(s),this.name="ArchiveNavigationError",this.code=s}};function Rs(t,s){return t instanceof jt?s(`archives.${t.code}`):Pe(t)}e(Rs,"formatArchiveNavigationError");function ai(t,s){if(typeof t?.retainInfo!="function")return;let o=t.retainInfo(s),f=o&&typeof o=="object"&&"getSnapshot"in o&&typeof o.getSnapshot=="function"?o.getSnapshot():o;if(!f||typeof f!="object"||!("retainedBy"in f))return;let a=f.retainedBy;if(!(!a||typeof a!="object"||!("mainView"in a)||typeof a.mainView!="number"))return{retainedBy:{mainView:a.mainView}}}e(ai,"retainInfoSnapshot");function ii(t){let s=t?.byId;if(s!==void 0){for(let o of Object.values(s))if(o&&(o.retainedBy?.mainView??0)>0)return o.id}}e(ii,"mainViewSessionId");function kt(t){return ii(t)}e(kt,"currentSessionId");function oi(t,s,o){return s===void 0||s===""?!1:(t?.byId?.[s]?.retainedBy?.mainView??0)>0||(ai(o,s)?.retainedBy?.mainView??0)>0}e(oi,"sessionIsCurrent");async function _s(t,s,o,f=()=>!0){if(o){if(typeof t.prepare=="function"&&await t.prepare(s),!f())return;await t.restore(s)}f()&&await t.open(s)}e(_s,"openArchivedConversation");function Ts(t,s,o,{onOpened:f=e(()=>{},"onOpened"),beginNavigation:a,warn:l=e((...c)=>console.warn(...c),"warn")}={}){let c,E=t?.clearArchivedCurrent,y=t&&Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent"),R=e(x=>oi(s.list.getSnapshot(),x,s),"viewing"),w=e(function(...x){return c!==void 0&&R(c)&&o.list.getSnapshot().archivedSessionIds.includes(c)?!1:(c=void 0,E?.apply(this,x))},"wrapped"),v=e(()=>t&&Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent")?.value===w,"ownsWrapper");if(t&&typeof E=="function")try{if(t.clearArchivedCurrent=w,!v())throw new Error("\u5BFC\u822A\u65B9\u6CD5\u672A\u63A5\u7EB3\u5F52\u6863\u9002\u914D")}catch(x){l("archive-manager: \u65E0\u6CD5\u9002\u914D\u5F52\u6863\u5BFC\u822A\uFF0C\u8BF7\u6062\u590D\u4F1A\u8BDD\u540E\u6253\u5F00\u3002",x)}return{open(x){c=x;try{if(typeof E=="function"&&!v()&&o.list.getSnapshot().archivedSessionIds.includes(x))throw l("archive-manager: \u5F52\u6863\u5BFC\u822A\u9002\u914D\u4E0D\u53EF\u7528\u6216\u5DF2\u88AB\u66FF\u6362\u3002"),new jt("navigationUnavailable");if(a?.(),typeof t?.openSession!="function")throw l("archive-manager: \u5BBF\u4E3B\u672A\u63D0\u4F9B\u4F1A\u8BDD\u6253\u5F00\u63A5\u53E3\u3002"),new jt("navigationUnavailable");if(t.openSession(x),!R(x))throw l("archive-manager: \u5BBF\u4E3B\u672A\u4FDD\u7559\u76EE\u6807\u4F1A\u8BDD\u3002",{cleanupAvailable:typeof E=="function"}),new jt("sessionNotRetained");f()}catch(T){throw c=void 0,T}},dispose(){c=void 0,!(!t||Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent")?.value!==w)&&(y?Object.defineProperty(t,"clearArchivedCurrent",y):delete t.clearArchivedCurrent,E?.call(t))}}}e(Ts,"allowArchivedNavigation");var Ft=require("@deepseek-ai/dsh-client-ui-primitives");var js={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"},Ds={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 ln(t){return t.toLowerCase().startsWith("zh")?js:Ds}e(ln,"pluginUpdateCopy");function li(t,s,o,f){let a=ln(t),l=s?.restartDesktop===!0||s?.profileName==="desktop",c=l?{...a,manualHint:a.manualHintDesktop}:a,E=o!=="idle",y=c.checking,R="";return o==="checking"?y=c.checking:o==="updating"?y=c.updating:f.type==="error"?(y=f.message||c.failed,R="error"):f.type==="restart"?(y=l?c.restartDesktop:c.restart,R="success"):f.type==="restarting"?(y=c.restarting,R="success"):s===void 0?y=c.checking:s.latestCheckFailed?(y=c.failed,R="error"):!s.canAutoUpdate&&s.updateAvailable?(y=c.unavailable,R="update"):s.updateAvailable?(y=`${c.found}: v${s.latestVersion??c.unknown}`,R="update"):(y=c.latest,R="success"),{copy:c,busy:E,message:y,kind:R,loading:o==="updating",updateLabel:o==="updating"?c.updating:c.auto,disabled:E||s?.canAutoUpdate!==!0||s.updateAvailable!==!0,currentVersion:s===void 0?c.unknown:`v${s.currentVersion}`,latestVersion:s?.latestVersion===void 0?c.unknown:`v${s.latestVersion}`,profileName:s?.profileName??c.unknown,profileRaw:s?.profileName??"",latestRaw:s?.latestVersion??"latest"}}e(li,"describePluginUpdate");function Ns(t,s,o){let f="idle",a=s,l={type:"status"},c=0,E=new Set,y=e(()=>{for(let w of E)w()},"emit"),R=e(w=>{a=w,o?.(w)},"assign");return{get posts(){return c},subscribe(w){return E.add(w),()=>{E.delete(w)}},view(w){return li(w,a,f,l)},async check(){if(f==="idle"){f="checking",l={type:"status"},y();try{R(await t("GET")),l={type:"status"}}catch(w){l={type:"error",message:w instanceof Error?w.message:""}}finally{f="idle",y()}}},async update(){if(f==="idle"){f="updating",l={type:"status"},c+=1,y();try{let w=await t("POST");R(w),l={type:w.autoReload===!0?"restarting":"restart"}}catch(w){l={type:"error",message:w instanceof Error?w.message:""}}finally{f="idle",y()}}}}}e(Ns,"createUpdateFlow");function zs(t,s,o){return`dsh plugin${t.trim()===""?"":` --profile ${t.trim()}`} add ${s}@${o} --registry=https://registry.npmjs.org/`}e(zs,"manualPluginUpdateCommand");function Os(t,s){return t.key!=="Escape"?!1:(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),s(),!0)}e(Os,"handlePluginUpdateEscape");function ci(){let t=globalThis.document;if(typeof t>"u"||t===null)return;let s=t.baseURI;if(!(typeof s!="string"||s===""))try{let o=new URL(s),f=o.pathname.lastIndexOf("/"),a=o.pathname.slice(f+1);return/\.(html?|php|aspx?|jsp)$/i.test(a)?o.pathname=o.pathname.slice(0,f+1):o.pathname.endsWith("/")||(o.pathname+="/"),o.href}catch{return}}e(ci,"pageBaseHref");function Rn(t){if(typeof t!="string"||t.charAt(0)!=="/"||t.charAt(1)==="/")return t;let s=ci();if(s===void 0)return t;try{return new URL(t.slice(1),s).href}catch{return t}}e(Rn,"resolveApiUrl");function Ms(t){let o=Function("return globalThis.__dshArchiveReactDOMClient")()?.createRoot;if(o===void 0)throw new Error("createRoot unavailable");return o(t)}e(Ms,"mountRoot");var di="x-michengai-plugin-update",Ps="michengai-plugin-update-ui",or=`
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 za(){let e=document.getElementById(ms);if(e!==null){e.textContent!==$n&&(e.textContent=$n);return}let s=document.createElement("style");s.id=ms,s.textContent=$n,(document.head??document.documentElement).append(s)}t(za,"ensureStyle");function Ma(e){if(e===null||typeof e!="object")return!1;let s=e;return typeof s.packageName=="string"&&typeof s.currentVersion=="string"&&typeof s.updateAvailable=="boolean"&&typeof s.profileName=="string"&&typeof s.canAutoUpdate=="boolean"&&typeof s.latestCheckFailed=="boolean"&&(s.latestVersion===void 0||typeof s.latestVersion=="string")}t(Ma,"validPayload");async function gs(e,s,o){let v=o===void 0?{}:{signal:o},a=await fetch(e,s==="GET"?{cache:"no-store",...v}:{method:"POST",headers:{"content-type":"application/json",[Oa]:"1"},body:"{}",...v}),l=await a.json();if(!a.ok||!Ma(l))throw new Error(l&&typeof l=="object"&&"error"in l&&typeof l.error=="string"?l.error:Qt(document.documentElement.lang).failed);return l}t(gs,"requestStatus");function Pa(e){let s=M.useRef(null);return M.useLayoutEffect(()=>{s.current?.replaceChildren(e.node)},[e.node]),M.createElement("span",{ref:s,className:"mpi-icon","aria-hidden":!0})}t(Pa,"HostIcon");function La(e){let s=M.useRef(null),[,o]=M.useState(0),[v,a]=M.useState("idle");M.useEffect(()=>e.flow.subscribe(()=>o(S=>S+1)),[e.flow]),M.useEffect(()=>{let S=document.documentElement,f=new MutationObserver(()=>o(k=>k+1));return f.observe(S,{attributes:!0,attributeFilter:["lang"]}),()=>f.disconnect()},[]),M.useEffect(()=>{e.flow.check()},[e.flow]),M.useEffect(()=>{function S(f){hs(f,e.onClose)}return t(S,"onKey"),document.addEventListener("keydown",S,!0),()=>document.removeEventListener("keydown",S,!0)},[e.onClose]);let l=document.documentElement.lang,c=e.flow.view(l),x=l.toLowerCase().startsWith("zh")?e.zhName:l.toLowerCase().startsWith("ru")?e.ruName:e.enName,b=us(c.profileRaw,e.packageName,c.latestRaw),_=v==="copied"?c.copy.copied:v==="failed"?c.copy.copyFailed:c.copy.copy;return M.createElement(Tt.Modal,{open:!0,className:"mpi-dialog",title:`${x} ${c.copy.update}`,closeLabel:"Close",onClose:e.onClose,footer:[M.createElement(Tt.Button,{key:"check",variant:"outline",disabled:c.busy,onClick:t(()=>{e.flow.check()},"onClick")},c.copy.recheck),M.createElement(Tt.Button,{key:"update",variant:"primary",disabled:c.disabled,onClick:t(()=>{e.flow.update()},"onClick")},c.updateLabel)]},M.createElement("div",{ref:s},M.createElement("p",{className:"mpi-intro"},c.copy.intro),M.createElement("dl",{className:"mpi-meta"},M.createElement("dt",null,c.copy.current),M.createElement("dd",null,M.createElement("span",{className:"mpi-mono"},c.currentVersion)),M.createElement("dt",null,c.copy.latestLabel),M.createElement("dd",{className:"mpi-latest"},M.createElement("span",{className:"mpi-mono"},c.latestVersion),M.createElement("span",{className:"mpi-status",role:"status","data-kind":c.kind,...c.kind==="update"?{style:{color:"#e8b15a"}}:{}},c.message)),M.createElement("dt",null,c.copy.profile),M.createElement("dd",null,M.createElement("span",{className:"mpi-mono"},c.profileName))),c.busy?M.createElement("div",{className:"dssm-update-progress",role:"progressbar","aria-busy":"true"},M.createElement("div",{className:"dssm-update-progress-bar"})):null,M.createElement("section",{className:"mpi-manual"},M.createElement("h3",null,c.copy.manual),M.createElement("p",null,c.copy.manualHint),M.createElement("div",{className:"mpi-command"},M.createElement("code",null,b),M.createElement(Tt.Button,{variant:"outline",size:"sm",disabled:c.busy,onClick:t(()=>{let S=navigator.clipboard?.writeText(b);if(S===void 0){a("failed");return}S.then(()=>{a("copied"),window.setTimeout(()=>a("idle"),1400)}).catch(()=>a("failed"))},"onClick")},_)))))}t(La,"UpdateDialog");function fs(e){if(typeof document>"u"||document.body===null)return()=>{};let s=vn(e.endpoint);za();let o=new AbortController,v,a,l,c,x,b,_;function S(){l?.unmount(),l=void 0,a=void 0,c=void 0}t(S,"unmountCheck");function f(){if(l===void 0)return;c===void 0&&(c=e.createIcon("refresh"));let K=c;l.render(M.createElement(Tt.Button,{variant:"outline",size:"sm",onClick:D,icon:M.createElement(Pa,{node:K})},M.createElement("span",{"data-mpi-label":""},Qt(document.documentElement.lang).check)))}t(f,"renderCheck");function k(){b?.unmount(),b=void 0,x?.remove(),x=void 0}t(k,"closeDialog");function D(){k();let K=document.createElement("div");K.className="mpi-dialog-root",document.body.append(K),x=K,b=ps(K),b.render(M.createElement(La,{flow:ds(Y=>gs(s,Y,o.signal),v,Y=>{v=Y,z()}),packageName:e.packageName,zhName:e.zhName,enName:e.enName,ruName:e.ruName,onClose:k}))}t(D,"openDialog");function z(){let K=document.querySelector(e.titleRowSelector);if(K===null)return;let Y=K.querySelector("h1,h2"),Z=K.querySelector(e.linksSelector);if(e.isEnabled&&!e.isEnabled()){if(x!==void 0&&k(),Z!==null){let X=Z.querySelector(`[data-mpi-check="${e.packageName}"]`);X!==null&&(S(),X.remove())}if(Y!==null){let X=Y.querySelector(`.mpi-version[data-package="${e.packageName}"]`);X!==null&&X.remove()}return}if(Y!==null&&v!==void 0){let X=Y.querySelector(`.mpi-version[data-package="${e.packageName}"]`);X===null&&(X=document.createElement("span"),X.className="mpi-version",X.dataset.package=e.packageName,Y.append(X));let rt=`v${v.currentVersion}`;X.textContent!==rt&&(X.textContent=rt)}if(a!==void 0&&!a.isConnected&&S(),Z===null)return;let Q=Z.querySelector(`[data-mpi-check="${e.packageName}"]`);if(Q!==null){let X=Q.querySelector("[data-mpi-label]");(X===null||X.textContent!==Qt(document.documentElement.lang).check)&&f();return}let ke=document.createElement("span");ke.dataset.mpiCheck=e.packageName,ke.className="mpi-check-host",Z.append(ke),a=ke,l=ps(ke),f()}t(z,"applyControls");let U=new MutationObserver(()=>{_===void 0&&(_=window.requestAnimationFrame(()=>{_=void 0,z()}))});U.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["lang"]});let B,V=t(async()=>B||(B=(async()=>{try{return v=await gs(s,"GET",o.signal),z(),v}finally{B=void 0}})(),B),"load"),xe=t(()=>{z(),(!e.isEnabled||e.isEnabled())&&V().catch(()=>{})},"onToggle");return typeof window<"u"&&window.addEventListener("dsham-update-toggle",xe),z(),V().catch(()=>{}),()=>{o.abort(),U.disconnect(),k(),S(),typeof window<"u"&&window.removeEventListener("dsham-update-toggle",xe),_!==void 0&&window.cancelAnimationFrame(_),document.querySelectorAll(`[data-mpi-check="${e.packageName}"],.mpi-version[data-package="${e.packageName}"]`).forEach(K=>K.remove())}}t(fs,"observePluginUpdate");var Xt=require("@deepseek-ai/dsh-client-ui-primitives");var Fe=Br,Ua="@michengai/dsh-archive-manager",Gn="archived-sessions",Ba=4,vs="dsham-sidebar-entry-style",Fa=`
14
+ `;function ui(){let t=document.getElementById(Ps);if(t!==null){t.textContent!==or&&(t.textContent=or);return}let s=document.createElement("style");s.id=Ps,s.textContent=or,(document.head??document.documentElement).append(s)}e(ui,"ensureStyle");function hi(t){if(t===null||typeof t!="object")return!1;let s=t;return typeof s.packageName=="string"&&typeof s.currentVersion=="string"&&typeof s.updateAvailable=="boolean"&&typeof s.profileName=="string"&&typeof s.canAutoUpdate=="boolean"&&typeof s.latestCheckFailed=="boolean"&&(s.latestVersion===void 0||typeof s.latestVersion=="string")}e(hi,"validPayload");async function Ls(t,s,o){let f=o===void 0?{}:{signal:o},a=await fetch(t,s==="GET"?{cache:"no-store",...f}:{method:"POST",headers:{"content-type":"application/json",[di]:"1"},body:"{}",...f}),l=await a.json();if(!a.ok||!hi(l))throw new Error(l&&typeof l=="object"&&"error"in l&&typeof l.error=="string"?l.error:ln(document.documentElement.lang).failed);return l}e(Ls,"requestStatus");function pi(t){let s=L.useRef(null);return L.useLayoutEffect(()=>{s.current?.replaceChildren(t.node)},[t.node]),L.createElement("span",{ref:s,className:"mpi-icon","aria-hidden":!0})}e(pi,"HostIcon");function mi(t){let s=L.useRef(null),[,o]=L.useState(0),[f,a]=L.useState("idle");L.useEffect(()=>t.flow.subscribe(()=>o(w=>w+1)),[t.flow]),L.useEffect(()=>{let w=document.documentElement,v=new MutationObserver(()=>o(x=>x+1));return v.observe(w,{attributes:!0,attributeFilter:["lang"]}),()=>v.disconnect()},[]),L.useEffect(()=>{t.flow.check()},[t.flow]),L.useEffect(()=>{function w(v){Os(v,t.onClose)}return e(w,"onKey"),document.addEventListener("keydown",w,!0),()=>document.removeEventListener("keydown",w,!0)},[t.onClose]);let l=document.documentElement.lang,c=t.flow.view(l),E=l.toLowerCase().startsWith("zh")?t.zhName:l.toLowerCase().startsWith("ru")?t.ruName:t.enName,y=zs(c.profileRaw,t.packageName,c.latestRaw),R=f==="copied"?c.copy.copied:f==="failed"?c.copy.copyFailed:c.copy.copy;return L.createElement(Ft.Modal,{open:!0,className:"mpi-dialog",title:`${E} ${c.copy.update}`,closeLabel:"Close",onClose:t.onClose,footer:[L.createElement(Ft.Button,{key:"check",variant:"outline",disabled:c.busy,onClick:e(()=>{t.flow.check()},"onClick")},c.copy.recheck),L.createElement(Ft.Button,{key:"update",variant:"primary",disabled:c.disabled,onClick:e(()=>{t.flow.update()},"onClick")},c.updateLabel)]},L.createElement("div",{ref:s},L.createElement("p",{className:"mpi-intro"},c.copy.intro),L.createElement("dl",{className:"mpi-meta"},L.createElement("dt",null,c.copy.current),L.createElement("dd",null,L.createElement("span",{className:"mpi-mono"},c.currentVersion)),L.createElement("dt",null,c.copy.latestLabel),L.createElement("dd",{className:"mpi-latest"},L.createElement("span",{className:"mpi-mono"},c.latestVersion),L.createElement("span",{className:"mpi-status",role:"status","data-kind":c.kind,...c.kind==="update"?{style:{color:"#e8b15a"}}:{}},c.message)),L.createElement("dt",null,c.copy.profile),L.createElement("dd",null,L.createElement("span",{className:"mpi-mono"},c.profileName))),c.busy?L.createElement("div",{className:"dssm-update-progress",role:"progressbar","aria-busy":"true"},L.createElement("div",{className:"dssm-update-progress-bar"})):null,L.createElement("section",{className:"mpi-manual"},L.createElement("h3",null,c.copy.manual),L.createElement("p",null,c.copy.manualHint),L.createElement("div",{className:"mpi-command"},L.createElement("code",null,y),L.createElement(Ft.Button,{variant:"outline",size:"sm",disabled:c.busy,onClick:e(()=>{let w=navigator.clipboard?.writeText(y);if(w===void 0){a("failed");return}w.then(()=>{a("copied"),window.setTimeout(()=>a("idle"),1400)}).catch(()=>a("failed"))},"onClick")},R)))))}e(mi,"UpdateDialog");function Fs(t){if(typeof document>"u"||document.body===null)return()=>{};let s=Rn(t.endpoint);ui();let o=new AbortController,f,a,l,c,E,y,R;function w(){l?.unmount(),l=void 0,a=void 0,c=void 0}e(w,"unmountCheck");function v(){if(l===void 0)return;c===void 0&&(c=t.createIcon("refresh"));let ne=c;l.render(L.createElement(Ft.Button,{variant:"outline",size:"sm",onClick:T,icon:L.createElement(pi,{node:ne})},L.createElement("span",{"data-mpi-label":""},ln(document.documentElement.lang).check)))}e(v,"renderCheck");function x(){y?.unmount(),y=void 0,E?.remove(),E=void 0}e(x,"closeDialog");function T(){x();let ne=document.createElement("div");ne.className="mpi-dialog-root",document.body.append(ne),E=ne,y=Ms(ne),y.render(L.createElement(mi,{flow:Ns(re=>Ls(s,re,o.signal),f,re=>{f=re,N()}),packageName:t.packageName,zhName:t.zhName,enName:t.enName,ruName:t.ruName,onClose:x}))}e(T,"openDialog");function N(){let ne=document.querySelector(t.titleRowSelector);if(ne===null)return;let re=ne.querySelector("h1,h2"),se=ne.querySelector(t.linksSelector);if(t.isEnabled&&!t.isEnabled()){if(E!==void 0&&x(),se!==null){let ce=se.querySelector(`[data-mpi-check="${t.packageName}"]`);ce!==null&&(w(),ce.remove())}if(re!==null){let ce=re.querySelector(`.mpi-version[data-package="${t.packageName}"]`);ce!==null&&ce.remove()}return}if(re!==null&&f!==void 0){let ce=re.querySelector(`.mpi-version[data-package="${t.packageName}"]`);ce===null&&(ce=document.createElement("span"),ce.className="mpi-version",ce.dataset.package=t.packageName,re.append(ce));let Z=`v${f.currentVersion}`;ce.textContent!==Z&&(ce.textContent=Z)}if(a!==void 0&&!a.isConnected&&w(),se===null)return;let ie=se.querySelector(`[data-mpi-check="${t.packageName}"]`);if(ie!==null){let ce=ie.querySelector("[data-mpi-label]");(ce===null||ce.textContent!==ln(document.documentElement.lang).check)&&v();return}let Ne=document.createElement("span");Ne.dataset.mpiCheck=t.packageName,Ne.className="mpi-check-host",se.append(Ne),a=Ne,l=Ms(Ne),v()}e(N,"applyControls");let B=new MutationObserver(()=>{R===void 0&&(R=window.requestAnimationFrame(()=>{R=void 0,N()}))});B.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["lang"]});let F,H=e(async()=>F||(F=(async()=>{try{return f=await Ls(s,"GET",o.signal),N(),f}finally{F=void 0}})(),F),"load"),De=e(()=>{N(),(!t.isEnabled||t.isEnabled())&&H().catch(()=>{})},"onToggle");return typeof window<"u"&&window.addEventListener("dsham-update-toggle",De),N(),H().catch(()=>{}),()=>{o.abort(),B.disconnect(),x(),w(),typeof window<"u"&&window.removeEventListener("dsham-update-toggle",De),R!==void 0&&window.cancelAnimationFrame(R),document.querySelectorAll(`[data-mpi-check="${t.packageName}"],.mpi-version[data-package="${t.packageName}"]`).forEach(ne=>ne.remove())}}e(Fs,"observePluginUpdate");var cn=require("@deepseek-ai/dsh-client-ui-primitives");var tt=is,fi="@michengai/dsh-archive-manager",lr="archived-sessions",gi=4,Bs="dsham-sidebar-entry-style",vi=`
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)}
18
18
  .dsham_bundle_label_box{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1;text-align:left}
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
- `;function ys(){if(typeof document>"u"||typeof document.getElementById!="function"||document.getElementById(vs)!==null||typeof document.createElement!="function")return;let e=document.createElement("style");e.id=vs,e.textContent=Fa,(document.head??document.documentElement)?.appendChild?.(e)}t(ys,"ensureSidebarEntryStyle");function Ha(e){let s=e&&typeof e.size=="number"?e.size:16;return Fe(Xt.IconArchiveOutlineMedium,{size:s})}t(Ha,"ArchiveSidebarIcon");function Wa(e){ys();let{t:s,enabled:o,onToggle:v,disabled:a,onlineUpdateEnabled:l=!0,onToggleOnlineUpdate:c,onlineUpdateDisabled:x,onlineUpdateLocked:b=!1}=e,_=[Fe("div",{key:"sidebar-entry",className:"dsham_bundle_row"},Fe("div",{className:"dsham_bundle_label_box"},Fe("span",{className:"dsham_bundle_title"},s("sidebar.entry.title")),Fe("span",{className:"dsham_bundle_desc"},s("sidebar.entry.desc"))),Fe(Xt.Switch,{checked:o,onChange:v,label:s("sidebar.entry.toggle"),disabled:a}))];if(typeof c=="function"){let S=b?`${s("update.entry.desc")} (${s("update.entry.locked")})`:s("update.entry.desc");_.push(Fe("div",{key:"online-update",className:"dsham_bundle_row"},Fe("div",{className:"dsham_bundle_label_box"},Fe("span",{className:"dsham_bundle_title"},s("update.entry.title")),Fe("span",{className:"dsham_bundle_desc"},S)),Fe(Xt.Switch,{checked:l,onChange:c,label:s("update.entry.toggle"),disabled:x||b,title:b?s("update.entry.locked"):void 0})))}return Fe(Ur,null,_)}t(Wa,"ArchiveBundleConfigCard");function qa(e){let[s,o]=Ut(e.getEnabled),[v,a]=Ut(e.getOnlineUpdateEnabled?e.getOnlineUpdateEnabled:()=>!0),[l,c]=Ut(e.getOnlineUpdateLocked?e.getOnlineUpdateLocked:()=>!1),[x,b]=Ut(!1),[_,S]=Ut(!1);Fr(()=>{let D=t(()=>{o(e.getEnabled()),e.getOnlineUpdateEnabled&&a(e.getOnlineUpdateEnabled()),e.getOnlineUpdateLocked&&c(e.getOnlineUpdateLocked())},"syncState");return D(),e.subscribe(D)},[e]);let f=t(D=>{b(!0),o(D),e.setSidebar(D).catch(()=>{o(e.getEnabled())}).finally(()=>{b(!1)})},"onToggleSidebar"),k=e.setOnlineUpdate?D=>{e.getOnlineUpdateLocked?.()||(S(!0),a(D),e.setOnlineUpdate(D).catch(()=>{e.getOnlineUpdateEnabled&&a(e.getOnlineUpdateEnabled())}).finally(()=>{S(!1)}))}:void 0;return Fe(Wa,{t:e.t,enabled:s,disabled:x,onToggle:f,onlineUpdateEnabled:v,onlineUpdateDisabled:_||l,onlineUpdateLocked:l,onToggleOnlineUpdate:k})}t(qa,"ArchiveBundleConfigCardWrapper");function Kn(e,s){if(ys(),!e.locale)return{isEnabled:t(()=>!1,"isEnabled"),isSupported:t(()=>!1,"isSupported"),setEnabled:t(async()=>!1,"setEnabled"),isOnlineUpdateEnabled:t(()=>!0,"isOnlineUpdateEnabled"),isOnlineUpdateLocked:t(()=>!1,"isOnlineUpdateLocked"),setOnlineUpdate:t(async()=>!1,"setOnlineUpdate"),destroy:t(()=>{},"destroy")};let{callApi:o,renderPanel:v,ns:a}=s,l=!1,c=!1,x=!1,b=null,_=null,S=0,f=!1,k,D=new Set,z=t(()=>{if(!f)for(let L of D)try{L()}catch{}},"notify"),U=t(()=>{if(f||!x||!l||b)return;let L=e.slots.register({name:"main",key:Gn,locale:a,inject:t(()=>{let ye=typeof s.injectProps=="function"?s.injectProps():{};return Object.assign({t:e.locale?.bind?e.locale.bind(a):void 0},ye)},"inject")},ye=>Fe("div",{className:"dsham_mainPanel"},v(ye)));b=typeof L=="function"?L:()=>{}},"mountMain"),B=t(()=>{if(b){try{b()}catch{}b=null}},"unmountMain"),V=t(()=>{if(f||!c||!l||_)return;let L=e.slots.register({name:"sidebar.panellist",id:Gn,order:Ba,label:t(()=>e.locale.bind(a)("archives.title"),"label"),locale:a},ye=>Ha(ye&&typeof ye=="object"&&"size"in ye?ye:void 0));_=typeof L=="function"?L:()=>{}},"mountRow"),xe=t(()=>{if(_){try{_()}catch{}_=null}},"unmountRow"),K=t(()=>{if(!f)if(l)U(),V();else{if(k?.panelInfo&&typeof k.selectPanel=="function")try{k.panelInfo.getSnapshot().activePanelId===Gn&&k.selectPanel(null)}catch{}xe(),B()}},"sync"),Y=t(async L=>{if(f)return l;let ye=++S;l=L,K(),z();try{return await o("/sidebar-entry",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:L})}),L}catch(Ze){throw ye===S&&(l=!L,K(),z()),Ze}},"setEnabled"),Z=!0,Q=!1,ke=0,X=t(async L=>{if(f||Q)return Z;let ye=++ke;if(Z=L,z(),typeof s.onOnlineUpdateChange=="function")try{s.onOnlineUpdateChange(L)}catch{}try{if(await o("/online-update",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:L})}),ye===ke&&typeof s.onOnlineUpdateChange=="function")try{s.onOnlineUpdateChange(L)}catch{}return L}catch(Ze){if(ye===ke&&(Z=!L,z(),typeof s.onOnlineUpdateChange=="function"))try{s.onOnlineUpdateChange(!L)}catch{}throw Ze}},"setOnlineUpdate"),rt=S;o("/sidebar-entry").then(L=>{!f&&S===rt&&L&&typeof L.enabled=="boolean"&&(l=L.enabled,K(),z())}).catch(()=>{});let Rt=ke;o("/online-update").then(L=>{if(!f&&ke===Rt&&L&&typeof L.enabled=="boolean"&&(Z=L.enabled,L.locked===!0&&(Q=!0),z(),typeof s.onOnlineUpdateChange=="function"))try{s.onOnlineUpdateChange(Z)}catch{}}).catch(()=>{});let _e=e;return typeof _e.inject=="function"&&_e.inject(["layout"],L=>{!f&&L.layout&&(k=L.layout)}),e.slots.inject("main",()=>{if(!f)return x=!0,U(),()=>{x=!1,B()}}),e.slots.inject("sidebar.panellist",()=>{if(!f)return c=!0,V(),()=>{c=!1,xe()}}),e.slots.inject("plugins.bundle.config",()=>{if(!f)return e.slots.register({name:"plugins.bundle.config",key:Ua,locale:a},L=>L&&L.view==="summary"?null:Fe(qa,{t:e.locale.bind(a),getEnabled:t(()=>l,"getEnabled"),setSidebar:Y,getOnlineUpdateEnabled:t(()=>Z,"getOnlineUpdateEnabled"),setOnlineUpdate:X,getOnlineUpdateLocked:t(()=>Q,"getOnlineUpdateLocked"),subscribe:t(ye=>(D.add(ye),()=>{D.delete(ye)}),"subscribe")}))}),{isEnabled:t(()=>l,"isEnabled"),isSupported:t(()=>c,"isSupported"),setEnabled:Y,isOnlineUpdateEnabled:t(()=>Z,"isOnlineUpdateEnabled"),isOnlineUpdateLocked:t(()=>Q,"isOnlineUpdateLocked"),setOnlineUpdate:X,destroy:t(()=>{f||(f=!0,S++,ke++,k=void 0,D.clear(),xe(),B())},"destroy")}}t(Kn,"setupSidebarEntry");function Yn(e){if(typeof e!="string"||e.length===0||e.length>1024)throw new TypeError("\u4F1A\u8BDD ID \u957F\u5EA6\u987B\u4E3A 1\uFF5E1024 \u4E2A\u5B57\u7B26");return e}t(Yn,"checkedId");var Va={parse(e){let s=ce(e);if(!s||typeof s!="object"||typeof s.favorite!="boolean")throw new TypeError("\u6536\u85CF\u72B6\u6001\u5FC5\u987B\u4E3A\u5E03\u5C14\u503C");return{sessionId:Yn(s.sessionId),favorite:s.favorite}}},$a={parse(e){let s=ce(e);if(!s||!Array.isArray(s.favoriteSessionIds)||s.favoriteSessionIds.length>1e5)throw new TypeError("\u6536\u85CF\u96C6\u5408\u65E0\u6548");return{favoriteSessionIds:[...new Set(s.favoriteSessionIds.map(Yn))]}},safeParse(e){try{return{success:!0,data:this.parse(e)}}catch(s){return{success:!1,error:s}}}};function bs(){let e=t((s,o)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${s}`,create:t(()=>o,"create"),schema:o}),"codec");return["favoriteSessions","setSessionFavorite"].map(s=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${s}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:s,invocation:{kind:"direct"},parameters:s==="favoriteSessions"?[]:[{name:"input",wire:"input",source:"json",codec:e("FavoriteInput",Va)}],result:e("FavoriteState",$a),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}t(bs,"favoriteInvocations");function Zn(e,{days:s,now:o=Date.now(),favorites:v=new Set,currentId:a,pending:l=new Map}){if(!e||!Number.isInteger(s)||s<1||s>36500||v.has(e.id)||e.id===a||(e.retainedBy?.mainView??0)>0||e.running||(e.runningSubagentCount??0)>0||e.pendingInteraction!=null||l.has(e.id))return!1;let c=typeof e.updatedAt=="number"?e.updatedAt:Date.parse(e.updatedAt??"");return Number.isFinite(c)&&c<=o-s*864e5}t(Zn,"idleArchiveCandidate");async function yn(e,s,{onProgress:o,refresh:v}={}){let a=[...new Set(e.map(Yn))],l={requested:a,succeeded:[],skipped:[],failures:[],remaining:[],refreshError:null},c=t(()=>o?.({total:a.length,done:l.succeeded.length+l.skipped.length+l.failures.length,succeeded:l.succeeded.length,skipped:l.skipped.length,failed:l.failures.length}),"report");c();for(let x of a){try{(await s(x)?l.succeeded:l.skipped).push(x)}catch(b){l.failures.push({sessionId:x,message:b instanceof Error?b.message:String(b)}),l.remaining.push(x)}c()}try{await v?.()}catch(x){l.refreshError=x instanceof Error?x.message:String(x)}return l}t(yn,"runSessionBatch");function ws({workspaces:e,sessions:s,archive:o,restore:v,deleteOne:a,getFavorites:l,refresh:c,currentSessionId:x}){return async(b,_,S={})=>{if(!["archive","restore","undo","delete"].includes(b))throw new TypeError("\u672A\u77E5\u6279\u91CF\u64CD\u4F5C");return yn(_,async f=>{let D=e.getSnapshot().archivedSessionIds.includes(f);if(b==="archive"){if(D||!s.getSnapshot().byId[f])return!1;if(S.idleDays!==void 0){let xe=new Set((await l()).favoriteSessionIds),K=s.getSnapshot();if(!Zn(K.byId[f],{days:S.idleDays,favorites:xe,currentId:x(K),pending:S.getPending?.()??S.pending}))return!1}return await o(f),e.getSnapshot().archivedSessionIds.includes(f)}return D?b==="delete"?(await a(f),!0):!((await v(f))?.archivedSessionIds??e.getSnapshot().archivedSessionIds).includes(f):!1},{onProgress:S.onProgress,refresh:c})}}t(ws,"createSessionOrganizer");function Ga(e){return!e||e<=0?"0 B":e<1024?e+" B":e<1024*1024?(e/1024).toFixed(1)+" KB":(e/(1024*1024)).toFixed(1)+" MB"}t(Ga,"formatBytes");function Ss(e,s){let o=e.createElement;function v(l,c){return o(s??(b=>o("button",{type:"button",disabled:b.disabled,onClick:b.onClick},b.children)),{variant:"outline",size:"sm",...c},l)}t(v,"textButton");function a({title:l,failures:c,separator:x}){let[b,_]=e.useState(!1),S=o("ul",null,c.map(f=>o("li",{key:f.sessionId},f.sessionId,x,f.message)));return o(gn,{title:l,open:b,onToggle:t(()=>_(f=>!f),"onToggle")},S)}return t(a,"FailureDetails"),t(function({t:c,archived:x,busy:b,ready:_,days:S,onDays:f,count:k,onPreview:D,progress:z,result:U,onRetry:B,undoCount:V,onUndo:xe,onReload:K,orphanCount:Y=0,orphanSizeBytes:Z=0,orphanCleaning:Q=!1,onCleanOrphans:ke}){return o(e.Fragment,null,o("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}"),(!x||!_)&&o("div",{className:"dsham_organizer"},o("div",{className:"dsham_organizerControls"},!_&&v(c("organizer.reloadFavorites"),{disabled:b,onClick:K}),!x&&o(e.Fragment,null,o("label",null,c("organizer.idleDays"),o(Wr,{min:1,max:36500,value:S===""?null:Number(S),disabled:b,"aria-label":c("organizer.idleDays"),onChange:t(X=>f(X==null?"":String(X)),"onChange")})),v(c("organizer.preview",{n:k}),{disabled:b||!_||k===0,onClick:D}))),!x&&o("p",null,c("organizer.rules"))),Y>0&&o("div",{className:"dsham_organizer"},o("div",{className:"dsham_organizerControls"},o("strong",null,c("organizer.orphanTitle",{n:Y})),ke&&v(c(Q?"organizer.cleaning":"organizer.cleanOrphans"),{disabled:b||Q,onClick:ke})),o("p",null,c("organizer.orphanDesc",{size:Ga(Z)}))),(z||U||V>0)&&o("section",{className:"dsham_batchFeedback","aria-label":c("organizer.feedback")},z&&o("div",{role:"status","aria-live":"polite"},o("progress",{value:z.done,max:Math.max(1,z.total),"aria-label":c("organizer.progress")}),c("organizer.progressCount",{done:z.done,total:z.total})),U&&o("div",{role:"status"},o("strong",null,c(`organizer.${U.kind??"archive"}Result`)),o("p",null,c("organizer.result",{succeeded:U.succeeded.length,skipped:U.skipped.length,failed:U.failures.length})),U.failures.length>0&&o(a,{title:c("organizer.failureDetails"),failures:U.failures,separator:c("common.separator")}),U.refreshError&&o("p",{role:"alert"},c("organizer.refreshError",{detail:U.refreshError})),U.remaining.length>0&&v(c("organizer.retry",{n:U.remaining.length}),{disabled:b,onClick:B})),V>0&&o("div",{className:"dsham_organizerControls"},v(c("organizer.undo",{n:V}),{disabled:b,onClick:xe}),o("p",null,c("organizer.undoHint")))))},"OrganizerPanel")}t(Ss,"createOrganizerPanel");var xs={"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"},ks={"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."},Cs={"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 Ft=Function("return globalThis.__dshArchiveReactDOM")(),Es=Function("return globalThis.__dshArchiveReactDOMClient")(),Is=Ft.createPortal,oo=Ft.flushSync,lo=Es?.createRoot,co=Es?.hydrateRoot,uo=Ft.findDOMNode,ho=Ft.unmountComponentAtNode,po=Ft.unstable_batchedUpdates,mo=Ft.version;function Ka(e){var s={exports:{}},o=s.exports;Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});let v=e("@deepseek-ai/dsh-client-store"),a=e("react/jsx-runtime"),l=e("react"),c=e("@deepseek-ai/dsh-client-ui-primitives");function x({open:n,onClose:r,title:i,description:u,footer:p,children:m,className:C,width:R}){let I=l.useRef(null),P=l.useCallback(()=>I.current?.closest(".dsham_settings")??document.body,[]),[T,j]=l.useState(null);l.useEffect(()=>{if(!n){j(null);return}j(P())},[n,P]),l.useEffect(()=>{if(!n)return;let h=t(ge=>{ge.key==="Escape"&&(ge.preventDefault(),ge.stopPropagation(),"stopImmediatePropagation"in ge&&typeof ge.stopImmediatePropagation=="function"&&ge.stopImmediatePropagation(),r())},"onKey");return window.addEventListener("keydown",h,!0),()=>window.removeEventListener("keydown",h,!0)},[n,r]);let F=(0,a.jsxs)("div",{className:"dsham_modalRoot",role:"presentation",children:[(0,a.jsx)("div",{className:"dsham_modalMask",onClick:r}),(0,a.jsxs)("div",{role:"dialog","aria-modal":!0,"aria-label":typeof i=="string"?i:void 0,className:vt("dsham_modalDialog",C),style:{width:R??560},children:[(0,a.jsx)("h2",{children:i}),u!=null&&(0,a.jsx)("p",{children:u}),m!=null&&(0,a.jsx)("div",{className:"dsham_modalBody",children:m}),p!=null&&(0,a.jsx)("div",{className:"dsham_modalFooter",children:p})]})]});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b,{refObject:I,getContainer:P}),n&&T?Is(F,T):null]})}t(x,"SettingsModal");function b({refObject:n,getContainer:r}){return(0,a.jsx)("span",{hidden:!0,ref:n,"data-get-container":r})}t(b,"SettingsModalAnchor");function _({variant:n="outline",icon:r,children:i,className:u,disabled:p,title:m,onClick:C,"aria-label":R,"aria-pressed":I,"aria-expanded":P,"aria-haspopup":T}){return(0,a.jsx)(c.Button,{variant:n,size:"sm",className:u,disabled:p,title:m,onClick:C,"aria-label":R,"aria-pressed":I,"aria-expanded":P,"aria-haspopup":T,icon:r,children:i})}t(_,"settingsButton");function S({variant:n="outline",danger:r=!1,disabled:i,onClick:u,children:p}){return(0,a.jsx)(c.Button,{variant:r?"outline":n,className:r?"dsham_btnDanger":void 0,disabled:i,onClick:u,children:p})}t(S,"modalFooterButton");function f(n,r){let i={className:n?"dsham_archiveTabsLocked":void 0,children:r};return n&&(i.inert=""),i}t(f,"tabsShell");let k=Ss(l,c.Button),{HighlightedText:D,useArchiveSearch:z,useArchivePreview:U,DiscoveryFilters:B,SearchStatus:V,PreviewContent:xe}=es(l,{Button:c.Button,SegmentedControl:c.SegmentedControl}),K={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 Y(n){let r=document.createElement("span"),i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttribute("viewBox","0 0 16 16"),i.setAttribute("width","16"),i.setAttribute("height","16"),i.setAttribute("fill","none"),i.setAttribute("stroke","currentColor"),i.setAttribute("stroke-width","1.5"),i.setAttribute("stroke-linecap","round"),i.setAttribute("stroke-linejoin","round"),i.setAttribute("aria-hidden","true");for(let u of K[n]){let p=document.createElementNS("http://www.w3.org/2000/svg","path");p.setAttribute("d",u),i.append(p)}return r.append(i),r}t(Y,"createPluginUpdateIcon");let Z={parse(n){if(typeof n!="string"||n.length===0)throw new TypeError(`sessionId must be a non-empty string, got ${String(n)}`);return n}},Q={parse(n){let r=ce(n);if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError("result must be an object");let i=r.archivedSessionIds;if(!Array.isArray(i)||i.some(u=>typeof u!="string"))throw new TypeError("archivedSessionIds must be a string array");return r}},ke={parse(n){let r=ce(n);if(typeof r!="object"||r===null||Array.isArray(r)||r.deleted!==!0)throw new TypeError("deleted must be true");return r}},X={parse(n){let r=ce(n);if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError("target must be an object");if(r.scope==="all"||r.scope==="ungrouped"||r.scope==="workspace"&&typeof r.workspaceId=="string"&&r.workspaceId.length>0||r.scope==="sessions"&&Array.isArray(r.sessionIds)&&r.sessionIds.length>0&&r.sessionIds.every(i=>typeof i=="string"&&i.length>0))return r;throw new TypeError("target.scope must be all, ungrouped, workspace with a non-empty workspaceId, or sessions with non-empty sessionIds")}},rt={parse(n){let r=ce(n);if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError("result must be an object");for(let i of["requestedSessionIds","deletedSessionIds","skippedSessionIds"])if(!Array.isArray(r[i])||r[i].some(u=>typeof u!="string"))throw new TypeError(`${i} must be a string array`);if(!Array.isArray(r.failures)||r.failures.some(i=>typeof i!="object"||i===null||typeof i.sessionId!="string"||typeof i.message!="string"))throw new TypeError("failures must contain sessionId/message objects");return r}},Rt={parse(n){let r=ce(n);if(typeof r!="object"||r===null||Array.isArray(r)||!Array.isArray(r.items))throw new TypeError("result.items must be an array");if(r.items.some(i=>typeof i!="object"||i===null||typeof i.sessionId!="string"||typeof i.createdAt!="number"||!Number.isFinite(i.createdAt)))throw new TypeError("items must contain sessionId/createdAt objects");return r}};function _e(n,r){return{mode:"strict",typeSymbol:n,create:t(()=>r,"create"),schema:r}}t(_e,"strictCodec");let L={package:"@michengai/dsh-archive-manager",descriptors:[...bs(),...Zr(),{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",Z)}],result:_e("@michengai/dsh-archive-manager/types#ArchivedSessionIds",Q),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",Z)}],result:_e("@michengai/dsh-archive-manager/types#Deleted",ke),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",X)}],result:_e("@michengai/dsh-archive-manager/types#DeletedBatch",rt),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",Rt),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 r=ce(n);if(!r||typeof r.count!="number"||!Array.isArray(r.items)||typeof r.totalSizeBytes!="number")throw new TypeError("invalid orphan subagent diagnosis");return r}}),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 r=ce(n);if(!r)throw new TypeError("target must be an object");if(r.sessionIds!==void 0&&(!Array.isArray(r.sessionIds)||r.sessionIds.some(i=>typeof i!="string")))throw new TypeError("sessionIds must be an array of strings");return r}})}],result:_e("@michengai/dsh-archive-manager/types#CleanOrphanResult",{parse(n){let r=ce(n);if(!r||!Array.isArray(r.cleanedSessionIds)||!Array.isArray(r.skippedSessionIds)||!Array.isArray(r.failures))throw new TypeError("invalid orphan subagent clean result");return r}}),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}]},ye=".dsham_btnDanger:not(:disabled){color:var(--dsw-alias-state-error-primary,#ef7272);border-color:var(--dsw-alias-state-error-primary,#ef7272)}";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify("dsh-archive-manager/DangerButton.css")+"]")===null){let n=document.createElement("style");n.dataset.plugin="@michengai/dsh-archive-manager",n.dataset.pluginCss="dsh-archive-manager/DangerButton.css",n.textContent=ye,document.head.appendChild(n)}let Ze=".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}";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify("dsh-archive-manager/IconAction.css")+"]")===null){let n=document.createElement("style");n.dataset.plugin="@michengai/dsh-archive-manager",n.dataset.pluginCss="dsh-archive-manager/IconAction.css",n.textContent=Ze,document.head.appendChild(n)}let jt=".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%))}.dsham_modalDialog{position:relative;display:flex;flex-direction:column;gap:12px;max-width:calc(100vw - 48px);max-height:min(80vh,720px);padding:22px 24px 20px;overflow:hidden;border:0;border-radius:var(--dsw-radius-panel,28px);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);box-shadow:var(--dsw-elevation-prominent,0 16px 40px rgb(0 0 0 / 24%))}.dsham_modalDialog h2{margin:0;font-size:16px;line-height:24px}.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}";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify("dsh-archive-manager/Modal.css")+"]")===null){let n=document.createElement("style");n.dataset.plugin="@michengai/dsh-archive-manager",n.dataset.pluginCss="dsh-archive-manager/Modal.css",n.textContent=jt,document.head.appendChild(n)}let en=".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}";if(typeof document<"u"&&document.querySelector("style[data-plugin-css="+JSON.stringify("dsh-archive-manager/SidebarPopover.css")+"]")===null){let n=document.createElement("style");n.dataset.plugin="@michengai/dsh-archive-manager",n.dataset.pluginCss="dsh-archive-manager/SidebarPopover.css",n.textContent=en,document.head.appendChild(n)}function Je(n){let r=new Map;for(let i of Object.values(n)){if(i.origin!=="subagent")continue;let u=new Set,p=i;for(;p?.origin==="subagent"&&p.parentId!==void 0&&!u.has(p.id);){u.add(p.id);let m=r.get(p.parentId);m===void 0?r.set(p.parentId,{count:1,runningCount:i.running?1:0}):(m.count+=1,i.running&&(m.runningCount+=1)),p=n[p.parentId]}}return r}t(Je,"indexSubagentDescendants");let bn="__flat_session_order__",Nt="dsh.archive-manager.workspace.view.v1",Dt="dsh.workspace.view.v5";function E(n){let r=n??globalThis.localStorage;if(r==null||typeof r.getItem!="function"||typeof r.setItem!="function")return!1;try{if(r.getItem(Nt)!=null)return!1;let i=r.getItem(Dt);return i==null?!1:(r.setItem(Nt,i),!0)}catch{return!1}}t(E,"migrateWorkspaceViewPersist");function ne(){return E(),(0,v.defineStore)({init:t(()=>({groupBy:"workspace",orderBy:"updated",showArchived:!1,groupExpansion:{},sessionOrderByAccount:{},sessionUpdatedAtByAccount:{}}),"init"),persist:Nt,actions:{setGroupBy:t((n,r)=>{n.groupBy=r},"setGroupBy"),setOrderBy:t((n,r)=>{n.orderBy=r},"setOrderBy"),setShowArchived:t((n,r)=>{n.showArchived=r===!0},"setShowArchived"),setGroupExpanded:t((n,r,i)=>{n.groupExpansion[r]=i},"setGroupExpanded"),retainAccountKeys:t((n,r)=>{let i=new Set(r);n.groupExpansion=Object.fromEntries(Object.entries(n.groupExpansion).filter(([u])=>i.has(u))),n.sessionOrderByAccount=Object.fromEntries(Object.entries(n.sessionOrderByAccount).filter(([u])=>i.has(u))),n.sessionUpdatedAtByAccount=Object.fromEntries(Object.entries(n.sessionUpdatedAtByAccount).filter(([u])=>i.has(u)))},"retainAccountKeys"),syncSessionOrderAccount:t((n,r,i,u)=>{n.sessionOrderByAccount[r]=i,n.sessionUpdatedAtByAccount[r]=u},"syncSessionOrderAccount"),setSessionOrder:t((n,r,i)=>{n.sessionOrderByAccount[r]=i},"setSessionOrder")}})}t(ne,"createWorkspaceViewStore");function je(){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"})})}t(je,"GithubMark16");function Ot(){let n=c.IconEditOutlineRegular;return(0,a.jsx)(n,{size:16})}t(Ot,"FeedbackIcon");function zt({archiveSessions:n,archiveSession:r,sessionStore:i,workspaceStore:u,unarchiveSession:p,deleteSession:m,unarchiveSessions:C,deleteArchivedSessions:R,archivedSessionMetadata:I,openConversation:P,focusSessionWorkspace:T,viewState:j,close:F,t:h,diagnoseOrphanSubagents:ge,cleanOrphanSubagents:Ee,searchSessionContent:ie,searchArchivedContent:ht,previewArchivedSession:At,favoriteSessions:st,setSessionFavorite:$,organizeBatch:de,useSessionPendingInteraction:Mt,useSessionStatus:an}){let Qe=(0,l.useSyncExternalStore)(i.subscribe,i.getSnapshot),we=(0,l.useSyncExternalStore)(u.subscribe,u.getSnapshot),[at,bt]=(0,l.useState)("archived"),he=at==="archived",[pt,Xe]=(0,l.useState)(null),[qt,it]=(0,l.useState)(null),[Ve,mt]=(0,l.useState)(null),wt=t((d,w=null)=>{q(null),Ie(null),_t(!1),it(w),Xe(d)},"requestArchive"),on=t(()=>{W||(Xe(null),it(null),q(null))},"closeArchive"),ot=(0,l.useRef)(!1),[fe,St]=(0,l.useState)(null),Vt=(0,l.useRef)(!1),[W,Ne]=(0,l.useState)(!1),[et,q]=(0,l.useState)(null),[$t,Ie]=(0,l.useState)(null),xt=t(d=>{q(null),Ie(null),St(d)},"requestDelete"),[gt,Pt]=(0,l.useState)(j?.query??""),[g,y]=(0,l.useState)(j?.project??"all"),[N,pe]=(0,l.useState)(j?.sortBy??"updated"),[Se,oe]=(0,l.useState)({}),[De,Pe]=(0,l.useState)(()=>new Set),re=(0,l.useRef)(new Set),[be,Ae]=(0,l.useState)([]),[lt,$e]=(0,l.useState)([]),[J,ee]=(0,l.useState)(!1),[O,te]=(0,l.useState)(!1),ve=(0,l.useRef)(!1),[ue,Oe]=(0,l.useState)(!1),[ze,Le]=l.useState("content"),[Ge,Re]=l.useState(""),[Ce,le]=l.useState(""),[tt,ct]=(0,l.useState)(()=>new Set),[We,Ue]=(0,l.useState)("30"),[qe,_t]=(0,l.useState)(!1),[Ke,Nn]=(0,l.useState)(null),[Cr,ln]=(0,l.useState)(null),[Dn,cn]=(0,l.useState)([]),Lt=(0,l.useRef)(!1),On=(0,l.useRef)(null),zn=Os(Mt??js,an??Ns,typeof an=="function"),Er=(0,l.useRef)(zn.pending);Er.current=zn.pending;let kt=(0,l.useMemo)(()=>new Set(lt),[lt]),ta=t(async()=>{if(st)try{let d=await st();$e(d.favoriteSessionIds),ee(!0)}catch(d){ee(!1),q(Ye(d))}},"loadFavorites");(0,l.useEffect)(()=>{let d=!0;return st&&st().then(w=>{d&&($e(w.favoriteSessionIds),ee(!0))}).catch(w=>{d&&q(Ye(w))}),()=>{d=!1}},[st]);let na=t(async d=>{if(!(ve.current||W||!J)){ve.current=!0,te(!0),q(null);try{let w=await $({sessionId:d,favorite:!kt.has(d)});$e(w.favoriteSessionIds)}catch(w){q(Ye(w))}finally{ve.current=!1,te(!1)}}},"toggleFavorite"),dn=t(async(d,w,{idle:H=!1,retry:se=!1}={})=>{if(!(Lt.current||ve.current||re.current.size>0||!de)){Lt.current=!0,Ne(!0),q(null),Ie(null),ln(null),d==="archive"&&!se&&cn([]);try{let A=await de(d,w,{idleDays:H?Number(We):void 0,getPending:t(()=>Er.current,"getPending"),onProgress:t(ae=>{Nn(ae),d==="archive"&&ae.total>0&&ae.done>=ae.total&&(Xe(null),it(null),_t(!1))},"onProgress")});return ln({...A,kind:d,tab:at}),On.current=A.remaining.length?{kind:d,ids:A.remaining,idle:H}:null,d==="archive"&&cn(ae=>[...new Set([...ae,...A.succeeded])]),(d==="undo"||d==="restore"||d==="delete")&&cn(ae=>ae.filter(Be=>!A.succeeded.includes(Be)&&!A.skipped.includes(Be))),Ae(ae=>ae.filter(Be=>!A.succeeded.includes(Be)&&!A.skipped.includes(Be))),d==="delete"&&$e(ae=>ae.filter(Be=>!A.succeeded.includes(Be))),A}catch(A){q(Ye(A))}finally{Lt.current=!1,Ne(!1),Nn(null)}}},"executeBatch"),[Ir,ra]=(0,l.useState)(null),[Ar,_r]=(0,l.useState)(!1),Tr=t(()=>{typeof ge=="function"&&ge().then(ra).catch(d=>{console.warn("archive-manager: diagnose orphan subagents failed",d)})},"loadOrphans");(0,l.useEffect)(()=>{Tr()},[we.archivedSessionIds]);let sa=t(async()=>{if(!(Ar||typeof Ee!="function")){_r(!0),q(null),Ie(null);try{let d=await Ee({});(d.cleanedSessionIds.length>0||d.skippedSessionIds.length>0)&&Tr(),d.failures.length>0?(Ie(null),q(nn(d.failures,h))):d.cleanedSessionIds.length>0&&(q(null),Ie(h("organizer.orphanCleanSuccess",{n:d.cleanedSessionIds.length})))}catch(d){q(Ye(d))}finally{_r(!1)}}},"cleanOrphans"),Ct=(0,l.useRef)(!0),Mn=(0,l.useRef)(!1);(0,l.useEffect)(()=>(Ct.current=!0,()=>{Ct.current=!1}),[]);let un=t(async(d,w=!1)=>{if(W||Mn.current)return;Mn.current=!0,Ne(!0),q(null);let H=!1;try{await is({prepare:w?async se=>{await T?.(se)}:void 0,restore:t(async se=>{await p(se),H=!0},"restore"),open:t(async se=>{await P(se),Ct.current&&F?.()},"open")},d.id,w,()=>Ct.current)}catch(se){if(!Ct.current)return;if(H){bt("unarchived");let A=Et.find(ae=>ae.sessions.some(Be=>Be.id===d.id));A!==void 0&&y(A.key)}q(as(se,h))}finally{Mn.current=!1,Ct.current&&Ne(!1)}},"viewConversation");(0,l.useEffect)(()=>{j&&Object.assign(j,{query:gt,project:g,sortBy:N})},[gt,g,N,j]);let hn=(0,l.useMemo)(()=>he?we.archivedSessionIds:vr(Qe.byId,we.archivedSessionIds),[he,Qe.byId,we.archivedSessionIds]),Et=(0,l.useMemo)(()=>yr(Qe.byId,we.items,hn,h("group.ungrouped")),[Qe.byId,we,hn,h]),aa=t(d=>{W||re.current.size>0||(nt.close(),bt(d),Ae([]),Xe(null),it(null),q(null),Ie(null),y("all"),Pt(""),d!=="archived"&&N==="archived"&&pe("updated"))},"switchTab"),Rr=t(async(d,w=!1)=>{if(!(ot.current||W||!d?.length)){if(de){ot.current=!0;try{let H=await dn("archive",d,{idle:w}),se=H?.failures.map(A=>er(A.sessionId,A.message)).find(A=>A!==void 0);if(se!==void 0&&typeof r=="function"){let A=Qe.byId[se.sessionId];mt({sessionId:se.sessionId,title:A===void 0?se.sessionId:Me(A,h),kinds:se.kinds.join(", ")}),Xe(null),it(null),q(null);return}H&&(Xe(null),it(null),_t(!1))}finally{ot.current=!1}return}ot.current=!0,Ne(!0),q(null),Ie(null);try{let H=await n(d);Xe(null),it(null),H.archivedSessionIdsAdded.length>0&&Ie(h("archives.archiveSuccess",{n:H.archivedSessionIdsAdded.length})),H.failures&&H.failures.length>0?q(nn(H.failures,h)):(Ae([]),bt("archived"),y("all"),Pt(""))}catch(H){let se=Xn(H);if(se!==void 0&&typeof r=="function"){let A=Qe.byId[se.sessionId];mt({sessionId:se.sessionId,title:A===void 0?se.sessionId:Me(A,h),kinds:se.kinds.join(", ")}),Xe(null),it(null),q(null)}else{let A=rn(H);q(A===void 0?h("archives.archiveBatchFailed",{detail:H instanceof Error?H.message:String(H)}):h("archives.archiveActive",{kinds:A.join(", ")}))}}finally{ot.current=!1,Ne(!1)}}},"performArchive"),ia=t(()=>Rr(pt,qe),"confirmArchive"),oa=t(async d=>{q(null),Ie(null);try{await Yr(d.id),Ct.current&&Ie(h("details.copied"))}catch(w){Ct.current&&q(typeof mn(w)=="string"&&String(mn(w)).startsWith("copy.")?h(String(mn(w))):Ye(w))}},"copyId"),Pn=(0,l.useMemo)(()=>br(Et,N,Se,h,he?we.archivedSessionIds:void 0),[Et,N,Se,h,he,we.archivedSessionIds]);(0,l.useEffect)(()=>{if(W)return;let d=!1;return I().then(w=>{d||oe(Object.fromEntries(w.items.map(H=>[H.sessionId,H.createdAt])))}).catch(()=>{d||oe({})}),()=>{d=!0}},[I,we.archivedSessionIds,W]),(0,l.useEffect)(()=>{g!=="all"&&!Et.some(d=>d.key===g)&&y("all")},[Et,g]);let jr=!Vn(Ge,Ce),Nr=Pn.filter(d=>g==="all"||g===d.key).map(d=>({...d,sessions:d.sessions.filter(w=>(!ue||kt.has(w.id))&&Qr(w.updatedAt,Ge,Ce))})).filter(d=>d.sessions.length),Ln=ze==="content"&&!jr,Gt=z(Nr.flatMap(d=>d.sessions.map(w=>w.id)),gt,Ln,ie??ht),Un=new Map(Gt.items.map(d=>[d.sessionId,d])),nt=U(At,he?we.archivedSessionIds:[]),Dr=gt.trim().toLocaleLowerCase(),Kt=Nr.map(d=>({...d,sessions:d.sessions.filter(w=>!Dr||Me(w,h).toLocaleLowerCase().includes(Dr)||Un.has(w.id))})).filter(d=>d.sessions.length),Or=J?Kt.flatMap(d=>d.sessions).filter(d=>Zn(d,{days:Number(We),favorites:kt,currentId:dt(Qe),pending:zn.pending})).map(d=>d.id):[],Yt=(0,l.useMemo)(()=>mr(Kt),[Kt]),Bn=(0,l.useMemo)(()=>new Set(be),[be]),la=(0,l.useMemo)(()=>{let d=new Set(we.archivedSessionIds);return Dn.reduce((w,H)=>w+(d.has(H)?1:0),0)},[Dn,we.archivedSessionIds]),Fn=Yt.filter(d=>Bn.has(d)).length,ca=Yt.length>0&&Fn===Yt.length;(0,l.useEffect)(()=>{Ae(d=>gr(d,hn))},[hn]);let da=t((d,w)=>{Ae(H=>Tn(H,[d],w))},"toggleSessionSelection"),ua=t(d=>{Ae(w=>Tn(w,Yt,d))},"toggleVisibleSelection"),ha=t(d=>{W||re.current.has(d)||(re.current.add(d),Pe(new Set(re.current)),q(null),Ie(null),p(d).catch(w=>{q(Jn(w,h))}).finally(()=>{re.current.delete(d),Pe(new Set(re.current))}))},"onUnarchive"),zr=t(async d=>{if(!W){if(de){let w=Wt(we.archivedSessionIds,we.items,d),H=await dn("restore",w);return H&&{unarchivedSessionIds:H.succeeded}}Ne(!0),q(null),Ie(null);try{let w=await C(d);return w.unarchivedSessionIds.length>0&&Ie(h("archives.restoreSuccess",{n:w.unarchivedSessionIds.length})),w.failures&&w.failures.length>0&&q(nn(w.failures,h,Jn)),w}catch(w){q(h("archives.restoreBatchFailed",{detail:w instanceof Error?w.message:String(w)}))}finally{Ne(!1)}}},"onBatchUnarchive"),pa=t(async()=>{if(be.length===0)return;let d=await zr({scope:"sessions",sessionIds:be});if(d!==void 0){let w=new Set(d.unarchivedSessionIds);Ae(H=>H.filter(se=>!w.has(se)))}},"onSelectedUnarchive"),Mr=t(()=>{W||St(null)},"closeDelete");(0,l.useEffect)(()=>{if(fe===null)return;let d=t(w=>{w.key==="Escape"&&(w.preventDefault(),w.stopPropagation(),"stopImmediatePropagation"in w&&typeof w.stopImmediatePropagation=="function"&&w.stopImmediatePropagation(),W||St(null))},"onKeyDown");return window.addEventListener("keydown",d,!0),()=>window.removeEventListener("keydown",d,!0)},[fe,W]);let ma=t(async()=>{if(W||Vt.current||fe===null)return;if(fe.kind!=="batch"){Vt.current=!0,Ne(!0),q(null),Ie(null);try{await m(fe.session.id),St(null)}catch(w){q(wn(w,h))}finally{Vt.current=!1,Ne(!1)}return}if(Lt.current||ve.current||re.current.size>0)return;let{target:d}=fe;if(d.scope==="sessions"&&Wt(we.archivedSessionIds,we.items,d).length===0){St(null);return}Lt.current=!0,Ne(!0),q(null),Ie(null),ln(null),Nn(null);try{let w=await R(d),H=fr(w,h);H.kind==="error"?q(H.message):Ie(H.message);let se=new Set([...w.deletedSessionIds,...w.skippedSessionIds]);cn(ae=>ae.filter(Be=>!se.has(Be))),Ae(ae=>ae.filter(Be=>!se.has(Be))),$e(ae=>ae.filter(Be=>!se.has(Be)));let A=w.failures.map(ae=>ae.sessionId);On.current=A.length>0?{kind:"delete",ids:A,idle:!1}:null,ln({requested:w.requestedSessionIds,succeeded:w.deletedSessionIds,skipped:w.skippedSessionIds,failures:w.failures,remaining:A,refreshError:"refreshError"in w&&typeof w.refreshError=="string"?w.refreshError:null,kind:"delete",tab:at}),St(null)}catch(w){q(wn(w,h))}finally{Lt.current=!1,Ne(!1)}},"confirmDelete"),ft=fe?.kind==="batch"?fe.target.scope:null,ga=ft==="ungrouped"?h("archives.deleteUngroupedTitle"):ft==="workspace"?h("archives.deleteProjectTitle",{name:fe?.kind==="batch"?fe.title:""}):h(ft==="sessions"?"archives.deleteSelectedTitle":"deleteSession.title"),Pr=fe===null?void 0:ft==="ungrouped"?h("archives.deleteUngroupedDesc",{n:fe.kind==="batch"?fe.count:0}):ft==="workspace"?h("archives.deleteProjectDesc",{name:fe?.kind==="batch"?fe.title:"",n:fe.kind==="batch"?fe.count:0}):ft==="sessions"?h("archives.deleteSelectedDesc",{n:fe.kind==="batch"?fe.count:0}):h("deleteSession.desc",{name:Me(fe.kind==="session"?fe.session:{},h)}),fa=h(ft==="ungrouped"?"archives.deleteUngroupedConfirm":ft==="workspace"?"archives.deleteProjectConfirm":ft==="sessions"?"archives.deleteSelectedConfirm":"deleteSession.title");return(0,a.jsxs)("section",{className:"dsham_settings","aria-label":h("archives.title"),children:[(0,a.jsx)("style",{children:Us+Hs+Ws+qs+Vs}),(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:h("archives.title")}),(0,a.jsxs)("div",{className:"dsham_settingsLinks",children:[(0,a.jsx)(c.Button,{variant:"outline",size:"sm","aria-label":h("archives.viewProject"),icon:(0,a.jsx)(je,{}),onClick:t(()=>window.open("https://github.com/MichengAI/dsh-archive-manager","_blank","noreferrer"),"onClick"),children:h("archives.viewProject")}),(0,a.jsx)(c.Button,{variant:"outline",size:"sm","aria-label":h("archives.feedback"),icon:(0,a.jsx)(Ot,{}),onClick:t(()=>window.open("https://github.com/MichengAI/dsh-archive-manager/issues","_blank","noreferrer"),"onClick"),children:h("archives.feedback")})]})]}),(0,a.jsx)("p",{className:"dsham_settingsIntro",children:h("archives.description")})]}),l.createElement("div",f(W||De.size>0,(0,a.jsx)(c.SegmentedTabs,{className:"dsham_archiveTabs",label:h("archives.title"),value:at==="unarchived"?"unarchived":"archived",onChange:t(d=>aa(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:h("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:h("archives.tab.unarchived")})]}),id:"dsham-tab-unarchived",panelId:"dsham-archive-panel"}]})))]}),(0,a.jsxs)("div",{id:"dsham-archive-panel",role:"region","aria-label":h(at==="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)(_n,{id:"dsham-favorite-filter",className:"dsham_srOnly",tabIndex:-1,"aria-hidden":!0,value:ue?"favorites":"all",options:[{value:"all",label:h("organizer.allSessions")},{value:"favorites",label:h("organizer.favoritesOnly")}],onChange:t(d=>typeof Oe=="function"&&Oe(d==="favorites"),"onChange"),"aria-label":h("organizer.favoriteFilter")}),(0,a.jsx)(_n,{id:"dsham-search-scope",className:"dsham_srOnly",tabIndex:-1,"aria-hidden":!0,value:ze,options:[{value:"title",label:h("discovery.titleOnly")},{value:"content",label:h("discovery.titleAndContent")}],onChange:t(d=>typeof Le=="function"&&Le(d),"onChange"),"aria-label":h("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:gt,onChange:t(d=>Pt(d.target.value),"onChange"),placeholder:h(Ln?"discovery.searchPlaceholder":he?"archives.searchPlaceholder":"archives.searchUnarchived"),"aria-label":h(Ln?"discovery.searchPlaceholder":he?"archives.searchPlaceholder":"archives.searchUnarchived")}),(0,a.jsx)($s,{id:"dsham-sort-filter",t:h,disabled:W,favoritesOnly:ue,setFavoritesOnly:Oe,favoriteBusy:W||O||!J,sortBy:!he&&N==="archived"?"updated":N,setSortBy:pe,options:[...he?[{value:"archived",label:h("archives.sortArchived")}]:[],{value:"updated",label:h("archives.sortUpdated")},{value:"created",label:h("archives.sortCreated")},{value:"alphabetical",label:h("archives.sortAlphabetical")}]}),(0,a.jsx)(_n,{id:"dsham-project-filter",className:"dsham_projectFilter",value:g,title:g==="all"?h("archives.allProjects"):Pn.find(d=>d.key===g)?.title??g,options:[{value:"all",label:h("archives.allProjects")||"\u6240\u6709\u9879\u76EE",title:h("archives.allProjects")},...Pn.map(d=>({value:d.key,label:d.title,title:d.title}))],onChange:y,"aria-label":h("archives.projectFilter")}),l.createElement(B,{t:h,from:Ge,to:Ce,onFrom:Re,onTo:le,invalid:jr,onClear:t(()=>{Re(""),le("")},"onClear")})]})}),l.createElement("style",null,ts),l.createElement(V,{state:Gt,t:h}),de&&(0,a.jsx)(k,{t:h,archived:he,busy:W||O||De.size>0,ready:J,days:We,onDays:Ue,count:Or.length,onPreview:t(()=>{wt(Or),_t(!0)},"onPreview"),progress:Ke,result:Cr?.tab===at?Cr:null,onRetry:t(()=>{let d=On.current;d&&(d.kind==="delete"?xt({kind:"batch",target:{scope:"sessions",sessionIds:d.ids},count:d.ids.length}):dn(d.kind,d.ids,{idle:d.idle,retry:!0}))},"onRetry"),undoCount:la,onUndo:t(()=>dn("undo",Dn,{retry:!0}),"onUndo"),onReload:ta,orphanCount:Ir?.count??0,orphanSizeBytes:Ir?.totalSizeBytes??0,orphanCleaning:Ar,onCleanOrphans:sa}),Et.length>0&&(0,a.jsx)(ur,{selectedCount:be.length,hiddenCount:be.length-Fn,allVisibleSelected:ca,selectedVisibleCount:Fn,visibleCount:Yt.length,busy:W,t:h,onToggle:ua,onClear:t(()=>Ae([]),"onClear"),onArchive:he?void 0:()=>wt([...be]),onRestore:pa,onDelete:t(()=>xt({kind:"batch",target:{scope:"sessions",sessionIds:be},count:be.length}),"onDelete")}),Et.length===0?(0,a.jsx)("div",{className:"dsham_settingsEmpty",children:h(he?"archives.empty":"archives.emptyUnarchived")}):Kt.length===0?(0,a.jsx)("div",{className:"dsham_settingsEmpty",children:Gt.status==="loading"||Gt.status==="error"||Gt.failures.length?null:h("archives.emptyFiltered")}):Kt.map(d=>{let w=Ys(d.key),H=Et.find(A=>A.key===d.key)?.sessions.map(A=>A.id)??[],se=he?Wt(we.archivedSessionIds,we.items,w).length:H.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":!tt.has(d.key),"aria-controls":"dsham-group-"+encodeURIComponent(d.key),onClick:t(()=>ct(A=>{let ae=new Set(A);return ae.has(d.key)?ae.delete(d.key):ae.add(d.key),ae}),"onClick"),children:[(0,a.jsx)(tt.has(d.key)?c.IconChevronRightOutlineMedium:c.IconChevronDownOutlineMedium,{}),(0,a.jsx)(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:h("archives.sessionCount",{n:d.sessions.length})}),(0,a.jsx)(Ks,{group:d,busy:W,onArchive:he?void 0:()=>wt(H,d),onRestore:t(()=>zr(w),"onRestore"),onDelete:t(()=>xt({kind:"batch",target:w,title:d.title,count:se}),"onDelete"),t:h})]})]}),(0,a.jsx)("div",{className:"dsham_settingsList",id:"dsham-group-"+encodeURIComponent(d.key),hidden:tt.has(d.key)||void 0,children:!tt.has(d.key)&&d.sessions.map(A=>(0,a.jsxs)("div",{className:"dsham_settingsRow","data-selected":Bn.has(A.id),children:[(0,a.jsx)(hr,{checked:Bn.has(A.id),disabled:W,label:h("archives.selectSession",{name:Me(A,h)}),onChange:t(ae=>da(A.id,ae.target.checked),"onChange")}),(0,a.jsxs)("div",{className:"dsham_settingsContent",children:[(0,a.jsx)("button",{type:"button",className:"dsham_settingsTitleLink",title:Me(A,h),"aria-label":h("archives.openSession")+h("common.separator")+Me(A,h),disabled:W||De.has(A.id),onClick:t(()=>un(A),"onClick"),children:Me(A,h)}),(0,a.jsx)("div",{className:"dsham_settingsMeta",children:[Ls(A.updatedAt,h)]}),Un.has(A.id)&&l.createElement("button",{type:"button",className:"dsham_settingsSnippet",disabled:W,title:h(he?"discovery.preview":"archives.openSession"),onClick:t(()=>he?nt.open(A,gt):un(A),"onClick")},l.createElement(D,{text:Un.get(A.id)?.snippet??"",query:gt}))]}),(0,a.jsxs)("div",{className:"dsham_settingsActions",children:[typeof $=="function"&&_({variant:"outline",className:"dsham_iconAction"+(kt.has(A.id)?" dsham_favoriteOn":""),title:h(kt.has(A.id)?"organizer.unfavorite":"organizer.favorite"),"aria-pressed":kt.has(A.id),"aria-label":h(kt.has(A.id)?"organizer.unfavorite":"organizer.favorite")+h("common.separator")+Me(A,h),disabled:W||O||!J,onClick:t(()=>na(A.id),"onClick"),children:(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:kt.has(A.id)?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round","aria-hidden":!0,style:{display:"block"},children:(0,a.jsx)("path",{d:"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"})})}),_({variant:"outline",className:"dsham_iconAction",title:h(he?"archives.restore":"archives.archiveSelected"),"aria-label":h(he?"archives.restore":"archives.archiveSelected"),disabled:W||De.has(A.id),onClick:t(()=>he?ha(A.id):Rr([A.id]),"onClick"),icon:(0,a.jsx)(he?c.IconRefreshOutlineMedium:c.IconArchiveOutlineMedium,{size:16})}),he&&(0,a.jsx)(Gs,{busy:W||De.has(A.id),t:h,title:Me(A,h),onCopyId:t(()=>oa(A),"onCopyId"),onPreview:typeof At=="function"?()=>nt.open(A,gt):void 0,onRestoreOpen:t(()=>un(A,!0),"onRestoreOpen"),onDelete:t(()=>xt({kind:"session",session:A}),"onDelete")})]})]},A.id))})]},d.key)}),l.createElement(x,{width:900,open:nt.target!==null,onClose:nt.close,title:nt.target?Me(nt.target.session,h):h("discovery.preview"),footer:S({variant:"primary",disabled:W,onClick:t(()=>{if(nt.target){let d=nt.target.session;return nt.close(),un(d)}},"onClick"),children:h("discovery.openFull")}),children:l.createElement(xe,{preview:nt,t:h,MarkdownText:c.MarkdownText})}),pt===null&&et!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:et}),$t!==null&&(0,a.jsx)("div",{className:"dsham_settingsStatus",role:"status",children:$t}),(0,a.jsx)(x,{open:pt!==null,onClose:on,title:h("archives.archiveTitle",{n:pt?.length??0}),description:qt===null?h("archives.archiveSelectedDesc"):h(qt.key===sn?"archives.archiveUngroupedDesc":"archives.archiveProjectDesc",{name:qt.title,n:pt?.length??0}),footer:(0,a.jsxs)(a.Fragment,{children:[S({disabled:W,onClick:on,children:h("cancel")}),S({variant:"primary",disabled:W||!pt?.length,onClick:ia,children:h("archives.archiveSelected")})]}),children:(0,a.jsxs)(a.Fragment,{children:[de&&(0,a.jsx)("p",{children:h(qe?"organizer.idleConfirm":"organizer.manualConfirm")}),de&&(0,a.jsx)("div",{className:"dsham_archivePreview",children:(pt??[]).map(d=>(0,a.jsxs)("label",{children:[(0,a.jsx)(Hn,{checked:!0,disabled:W,label:Me(Qe.byId[d]??{id:d},h),onChange:t(()=>Xe(w=>(w??[]).filter(H=>H!==d)),"onChange")}),Me(Qe.byId[d]??{id:d},h)]},d))}),Ke&&(0,a.jsxs)("div",{role:"status",children:[(0,a.jsx)("progress",{value:Ke.done,max:Math.max(1,Ke.total)}),h("organizer.progressCount",{done:Ke.done,total:Ke.total})]}),et!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:et})]})}),(0,a.jsx)(x,{open:Ve!==null,onClose:t(()=>{W||(mt(null),q(null))},"onClose"),title:h("archiveActive.title"),...Ve===null?{}:{description:h("archiveActive.desc",{name:Ve.title,kinds:Ve.kinds})},footer:(0,a.jsxs)(a.Fragment,{children:[S({disabled:W,onClick:t(()=>{W||(mt(null),q(null))},"onClick"),children:h("cancel")}),S({danger:!0,disabled:W,onClick:t(async()=>{if(!(ot.current||W||Ve===null||typeof r!="function")){ot.current=!0,Ne(!0),q(null);try{await r(Ve.sessionId,{stopActivity:!0}),Ae(d=>d.filter(w=>Ve===null||w!==Ve.sessionId)),bt("archived"),Ie(h("archives.archiveSuccess",{n:1})),mt(null)}catch(d){q(d instanceof Error?d.message:String(d))}finally{ot.current=!1,Ne(!1)}}},"onClick"),children:h("archiveActive.confirm")})]}),children:et!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:et})}),(0,a.jsx)(x,{open:fe!==null,onClose:Mr,title:ga,...Pr===void 0?{}:{description:Pr},footer:(0,a.jsxs)(a.Fragment,{children:[S({disabled:W,onClick:Mr,children:h("cancel")}),S({danger:!0,disabled:W,onClick:ma,children:fa})]}),children:(0,a.jsxs)(a.Fragment,{children:[W&&(0,a.jsxs)("div",{role:"status",children:[fe?.kind==="batch"?h("archives.deleteBatchPending"):h("deleteSession.pending"),Ke&&(0,a.jsx)("progress",{value:Ke.done,max:Math.max(1,Ke.total),"aria-label":h("organizer.progress")}),Ke&&h("organizer.progressCount",{done:Ke.done,total:Ke.total})]}),et!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:et})]})})]})]})}t(zt,"ArchivedSessionsSection");function tn(n){var r,i,u="";if(typeof n=="string"||typeof n=="number")u+=n;else if(typeof n=="object")if(Array.isArray(n)){var p=n.length;for(r=0;r<p;r++)n[r]&&(i=tn(n[r]))&&(u&&(u+=" "),u+=i)}else for(i in n)n[i]&&(u&&(u+=" "),u+=i);return u}t(tn,"r");function vt(...n){for(var r,i,u=0,p="",m=arguments.length;u<m;u++)(r=arguments[u])&&(i=tn(r))&&(p&&(p+=" "),p+=i);return p}t(vt,"clsx");let Ht="Ungrouped";function G(n,r=Ht){if(n===void 0||n==="")return r;let i=n.replace(/[/\\]+$/,"").split(/[/\\]/).pop();return i!==void 0&&i!==""?i:n}t(G,"workspaceLabel");function me(n,r){return r.updatedAt!==n.updatedAt?r.updatedAt-n.updatedAt:n.id<r.id?-1:1}t(me,"byRecency");function Te(n,r,i,u){return n.origin!=="subagent"&&(!i.has(n.id)||u===!0)&&(!n.blank||n.id===r)}t(Te,"sessionVisible");function yt(n){let r=n instanceof Error?n.message:String(n);return r.includes("UNKNOWN_SESSION")||r.includes("no such session")}t(yt,"isUnknownSessionError");function wn(n,r){if(yt(n))return r("deleteSession.unknown");let i=n instanceof Error?n.message:String(n);return r("deleteSession.failed",{detail:i})}t(wn,"formatDeleteError");function Jn(n,r){if(yt(n))return r("archives.unarchiveUnknown");let i=n instanceof Error?n.message:String(n);return r("archives.unarchiveFailed",{detail:i})}t(Jn,"formatUnarchiveError");function nn(n,r,i=Qn){return n.map(u=>u.sessionId+r("common.separator")+i(new Error(u.message),r)).join(`
22
- `)}t(nn,"formatBatchFailures");function Qn(n,r){if(yt(n))return r("archives.archiveUnknown");let i=n instanceof Error?n.message:String(n);return r("archives.archiveFailed",{detail:i})}t(Qn,"formatArchiveError");function rn(n){if(n===null||typeof n!="object")return;let r=ce(n),i=r.rpcError!==null&&typeof r.rpcError=="object"?ce(r.rpcError):void 0,u=r.name==="WorkspaceActiveSessionError"?r.activity:void 0,p=i?.details,m=r.name==="WorkspaceArchiveError"&&i?.code==="workspace/session-active"&&p!==null&&typeof p=="object"?ce(p).activity:void 0,C=Array.isArray(u)?u:Array.isArray(m)?m:void 0;if(C===void 0)return;let R=C.flatMap(I=>{if(I===null||typeof I!="object")return[];let P=ce(I).kind;return typeof P=="string"&&P.length>0?[P]:[]});return R.length>0?R:void 0}t(rn,"activeSessionActivity");function Xn(n){let r=rn(n);if(r===void 0||n===null||typeof n!="object")return;let i=ce(n),u=i.rpcError!==null&&typeof i.rpcError=="object"?ce(i.rpcError).details:void 0,p=u!==null&&typeof u=="object"?ce(u).sessionId:void 0,m=typeof i.sessionId=="string"?i.sessionId:typeof p=="string"?p:void 0;return m===void 0?void 0:{sessionId:m,kinds:r}}t(Xn,"activeSessionRefusal");function er(n,r){let i=/^cannot archive session '(?:[^'\\]|\\')*': the session is active \((.*)\)$/.exec(r);if(i===null)return;let u=i[1].split(", ").filter(p=>p.length>0);return u.length>0?{sessionId:n,kinds:u}:void 0}t(er,"activeArchiveFromMessage");function As(n,r){let i=n instanceof Error?n.message:String(n);return r("archives.forkFailed",{detail:i})}t(As,"formatForkError");function Sn(n){return n.blank?"New Session":n.displayTitle}t(Sn,"sessionTitle");function tr(n,r,i,u,p,m,C){let R=[...m];return C==="recency"&&R.sort(me),{key:n,workspaceId:r,cwd:i,createdAt:u,label:p,sessions:R}}t(tr,"buildGroup");function _s(n,r){let i=new Map(n.map(m=>[m.id,m])),u=new Set,p=[];for(let m of r){let C=i.get(m);C===void 0||u.has(m)||(p.push(C),u.add(m))}for(let m of[...n].sort(me))u.has(m.id)||p.push(m);return p}t(_s,"orderedUngrouped");function nr(n,r,i,u,p){let m=[],C=new Set;for(let I of r){let P=[];for(let T of I.sessionIds){let j=n.byId[T];j!==void 0&&(C.add(T),Te(j,dt(n),i,p)&&P.push(j))}m.push(tr(I.workspaceId,I.workspaceId,I.path,Date.parse(I.createdAt),I.title,P,"account"))}let R=n.ids.map(I=>n.byId[I]).filter(I=>I!==void 0&&!C.has(I.id)&&Te(I,dt(n),i,p));return R.length>0&&m.push(tr("",void 0,void 0,void 0,Ht,u===void 0?R:_s(R,u),u===void 0?"recency":"account")),m}t(nr,"groupByWorkspace");function xn(n,r,i){if(!n||i.has(n))return!1;let u=r?.[n];return!(u===void 0||u.origin==="subagent"||u.blank)}t(xn,"isWorkspaceTaskCandidate");function rr(n){let r=n?.closest("[data-row-key]")??null;if(r===null)return null;let i=r.getAttribute("data-row-key")??"";if(!i.startsWith("workspace:"))return null;let u=i.slice(10);if(!u)return null;let p=r.querySelector(".title")??r.querySelector("[class*='title']");return{workspaceId:u,title:p?.textContent?.trim()||u}}t(rr,"workspaceMenuTriggerFrom");function kn(n,r=!0){let i=(n.textContent??"").toLowerCase();return i.includes("\u5220\u9664\u5DE5\u4F5C\u533A")||i.includes("delete workspace")||i.includes("\u0443\u0434\u0430\u043B\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435")?!0:r&&/(?:^|[_\s-])danger(?:$|[_\s-])/i.test(n.className)}t(kn,"isWorkspaceDeleteMenuItem");function Ts(n){switch(n){case"approval":case"plan-review":case"question":return n;default:return}}t(Ts,"visiblePendingKind");function sr(n,r){let i=r.get(n.id),u=i===void 0?n.pendingInteraction:i.kind;return Ts(u)}t(sr,"pendingInteractionForSession");let Cn=new Map,En=new Set,Rs=new Map;function js(n){return n(Cn)}t(js,"useEmptySessionPendingInteraction");function Ns(n){return n(Rs)}t(Ns,"useEmptySessionStatus");function ar(n){return n instanceof Map||n==null?{pending:n??Cn,completed:En}:{pending:n.pending??Cn,completed:n.completed??En}}t(ar,"pendingFacts");function Ds(n){let r=new Map,i=new Set;if(n instanceof Map)for(let[u,p]of n)p?.pendingInteraction!==void 0&&r.set(u,p.pendingInteraction),p?.completionUnread===!0&&i.add(u);return{pending:r,completed:i}}t(Ds,"factsFromSessionStatus");function Os(n,r,i){let u=n(m=>m),p=r(m=>m);return i?Ds(p):{pending:u,completed:En}}t(Os,"useSessionUiFacts");function ir(n,r,i,u){let p=ar(u),m=sr(n,p.pending);return{id:n.id,title:Sn(n),blank:n.blank,running:n.running,runningSubagentCount:r.get(n.id)?.runningCount??0,completed:n.completed===!0||p.completed.has(n.id),updatedAt:n.updatedAt,archived:i.has(n.id),...m===void 0?{}:{pendingInteraction:m}}}t(ir,"sessionNode");function zs(n,r,i,u,p){let m=new Set(i),C=new Set(p.expandedGroups),R=Je(n.byId),I=dt(n),P=I===void 0?void 0:r.find(j=>j.sessionIds.includes(I))?.workspaceId??"",T=[];for(let j of nr(n,r,m,p.ungroupedOrder,p.showArchived)){let F=C.has(j.key);T.push({key:j.key,workspaceId:j.workspaceId,cwd:j.cwd,createdAt:j.createdAt,label:j.label,sessionCount:j.sessions.length,expanded:F,containsCurrent:j.key===P,sessions:F?j.sessions.map(h=>ir(h,R,m,u)):[]})}return T}t(zs,"deriveGroups");function Ms(n,r,i,u){let p=new Set(r),m=Je(n.byId),C=[];for(let R of n.ids){let I=n.byId[R];I===void 0||!Te(I,dt(n),p,u)||C.push(I)}return C.sort(me),C.map(R=>ir(R,m,p,i))}t(Ms,"deriveFlat");function Ps(n,r,i,u,p,m,C,R,I=Ht){let P=i.trim().toLowerCase();if(P==="")return{items:[],hasMore:!1};let T=new Set(u),j=Je(n.byId),F=new Map;for(let $ of r)for(let de of $.sessionIds)F.has(de)||F.set(de,$.title);let h=t($=>F.get($.id)??G($.cwd,I),"labelOf"),ge=new Map;for(let $ of m.items)ge.has($.sessionId)||ge.set($.sessionId,$);let Ee=[];for(let $ of n.ids){let de=n.byId[$];de===void 0||de.blank||!Te(de,dt(n),T,R)||(Sn(de).toLowerCase().includes(P)||h(de).toLowerCase().includes(P))&&Ee.push(de)}Ee.sort(me);let ie=[],ht=new Set,At=t($=>{ht.has($.id)||(ht.add($.id),ie.push($))},"include");for(let $ of Ee)At($);for(let $ of m.items){let de=n.byId[$.sessionId];de!==void 0&&!de.blank&&Te(de,dt(n),T,R)&&At(de)}let st=ar(p);return{items:ie.slice(0,C).map($=>{let de=ge.get($.id),Mt=sr($,st.pending);return{id:$.id,title:Sn($),workspace:h($),running:$.running,runningSubagentCount:j.get($.id)?.runningCount??0,archived:T.has($.id),...Mt===void 0?{}:{pendingInteraction:Mt},completed:$.completed===!0||st.completed.has($.id),...de===void 0?{}:{snippet:de.snippet}}}),hasMore:m.hasMore||ie.length>C}}t(Ps,"deriveSearchResults");function Za(n,r){let m=Math.max(0,r-n);return m<6e4?{unit:"now",n:0}:m<36e5?{unit:"minutes",n:Math.floor(m/6e4)}:m<864e5?{unit:"hours",n:Math.floor(m/36e5)}:m<30*864e5?{unit:"days",n:Math.floor(m/864e5)}:m<365*864e5?{unit:"months",n:Math.floor(m/(30*864e5))}:{unit:"years",n:Math.floor(m/(365*864e5))}}t(Za,"relativeTime");let or={listeners:new Set,request(n){for(let r of this.listeners)r(n)},subscribe(n){return this.listeners.add(n),()=>{this.listeners.delete(n)}}};function Me(n,r){return n.blank?r("session.new"):n.title??n.displayTitle??""}t(Me,"displayTitle");function Ls(n,r){let i=new Date(n),u=`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`;return r("archives.timestamp",{date:r("date.ymd",{y:i.getFullYear(),m:i.getMonth()+1,d:i.getDate()}),time:u})}t(Ls,"archiveTimeLabel");let Us=[".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(""),ut="data-dsham-nav-icon",Bs='[role="dialog"] nav button',In=[`[${ut}] > svg { display: none !important; }`,`[${ut}]::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(`
23
- `);function Fs(n,r){let i=String(r??"").trim();return i.length>0&&String(n??"").trim()===i}t(Fs,"isOwnSettingsNavRow");function An(n,r){for(let i of n){if(i.type==="characterData"){let u=i.target.parentElement;if(u!==null&&u.closest(r)!==null)return!0;continue}for(let u of i.addedNodes){if(u.nodeType!==1)continue;let p=u;if(p.matches(r)||p.querySelector(r)!==null||p.closest(r)!==null)return!0}}return!1}t(An,"mutationTouches");function lr(n,r){return Fs(n.textContent,r)?n.getAttribute(ut)===""?!1:(n.setAttribute(ut,""),!0):n.hasAttribute(ut)?(n.removeAttribute(ut),!0):!1}t(lr,"applySettingsNavIcon");function cr(n){return n.hasAttribute(ut)?(n.removeAttribute(ut),!0):!1}t(cr,"restoreSettingsNavIcon");function dr(n){typeof document>"u"||typeof MutationObserver>"u"||n.effect(()=>{let r="dsham-nav-icon-style",i=document.getElementById(r);i===null?(i=document.createElement("style"),i.id=r,i.textContent=In,(document.head??document.documentElement).append(i)):i.textContent!==In&&(i.textContent=In);let u=!1,p=!1,m=t(()=>{if(p=!1,u)return;let I=n.locale.bind(He)("archived.badge");for(let P of document.querySelectorAll(Bs))lr(P,I)},"sync"),C=t(()=>{p||u||(p=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(m):setTimeout(m,16))},"schedule");m();let R=new MutationObserver(I=>{An(I,'[role="dialog"] nav')&&C()});return R.observe(document.body,{childList:!0,subtree:!0,characterData:!0}),()=>{u=!0,R.disconnect();for(let I of document.querySelectorAll(`[${ut}]`))cr(I);i?.remove()}},"archive-manager: settings nav icon")}t(dr,"installSettingsNavIcon");let Hs=[".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 20px}",".dsham_settingsGroupHeading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 14px}",".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:1px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-button-elevated-fill))}",".dsham_settingsRow{display:grid;grid-template-columns:16px minmax(0,1fr) auto;align-items:center;gap:12px;min-height:64px;padding:10px 12px;border-bottom:1px solid var(--dsw-alias-border-l2)}",".dsham_settingsRow:last-child{border-bottom:0}",".dsham_settingsContent{min-width:0;flex:1}",".dsham_settingsTitle{overflow:hidden;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600;line-height:18px;text-overflow:ellipsis;white-space:nowrap}",".dsham_settingsMeta{margin-top:2px;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:16px}",".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:32px}.dsham_settingsRow{padding:10px 12px}.dsham_settingsActions{gap:4px}}"].join(""),Ws=".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:20px;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:8px;padding:10px 8px}.dsham_settingsActions{gap:0}.dsham_settingsMeta{font-size:11px}}.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{width:16px;height:16px;margin:0;accent-color:var(--dsw-alias-brand-primary);flex:none}button.dsham_favoriteOn{color:#e8b931}button.dsham_favoriteOn:not(:disabled):hover{color:#e8b931!important;border-color:#e8b931!important}",qs=".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}}",Vs=".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 _n({id:n,className:r,value:i,options:u,onChange:p,disabled:m=!1,"aria-label":C,title:R,tabIndex:I,"aria-hidden":P}){let[T,j]=l.useState(!1),F=l.useMemo(()=>u.map(Ee=>({id:Ee.value,label:Ee.label})),[u]),h=u.find(Ee=>Ee.value===i),ge=h?.label??C;return(0,a.jsx)("div",{id:n,tabIndex:I,"aria-hidden":P,className:r===void 0?"dsham_settingsFilter":`dsham_settingsFilter ${r}`,children:(0,a.jsx)(c.Menu,{open:T,onClose:t(()=>j(!1),"onClose"),onSelect:t(Ee=>{m||p(Ee),j(!1)},"onSelect"),selectedId:i,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":T,disabled:m,tabIndex:I,"aria-hidden":P,title:R??h?.title??h?.label??C,className:"dsham_menuSelectBtn"+(T?" is-open":""),onClick:t(()=>{m||j(Ee=>!Ee)},"onClick"),children:[(0,a.jsx)("span",{className:"dsham_selectLabel",children:ge}),(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:T?"rotate(180deg)":"none",flex:"none"},children:(0,a.jsx)("path",{d:"m4 6 4 4 4-4"})})]}),items:F})})}t(_n,"ArchiveProjectSelect");function $s({id:n,t:r,disabled:i=!1,favoritesOnly:u,setFavoritesOnly:p,favoriteBusy:m=!1,sortBy:C,setSortBy:R,options:I}){let[P,T]=l.useState(!1),j=l.useMemo(()=>{let ie=[];typeof p=="function"&&(ie.push({type:"label",id:"lbl_view_filter",text:r("organizer.favoriteFilter")||"\u7B5B\u9009\u4F1A\u8BDD"}),ie.push({id:"filter:all",label:r("organizer.allSessions")||"\u5168\u90E8\u4F1A\u8BDD"}),ie.push({id:"filter:favorites",label:r("organizer.favoritesOnly")||"\u53EA\u770B\u6536\u85CF"}),ie.push({type:"separator",id:"sep_view_filter"})),ie.push({type:"label",id:"lbl_view_sort",text:r("archives.sortLabel")||"\u6392\u5E8F\u65B9\u5F0F"});for(let ht of I)ie.push({id:`sort:${ht.value}`,label:ht.label});return ie},[r,p,I]),F=t(ie=>{ie.startsWith("filter:")?typeof p=="function"&&!m&&p(ie==="filter:favorites"):ie.startsWith("sort:")&&R(ie.slice(5)),T(!1)},"onSelect"),h=I.find(ie=>ie.value===C),ge=u?r("organizer.favoritesOnly")||"\u53EA\u770B\u6536\u85CF":r("organizer.allChats")||"\u5168\u90E8\u804A\u5929",Ee=`${ge} \xB7 ${h?.label??C}`;return(0,a.jsxs)("div",{className:"dsham_viewSortContainer",children:[(0,a.jsx)(c.Menu,{open:P,onClose:t(()=>T(!1),"onClose"),onSelect:F,selectedIds:[u?"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":r("archives.viewOptions")||"\u89C6\u56FE\u9009\u9879","aria-expanded":P,disabled:i,title:Ee,className:"dsham_menuSelectBtn dsham_viewSortBtn"+(P?" is-open":"")+(u?" has-filter":""),onClick:t(()=>{i||T(ie=>!ie)},"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:ge}),(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:P?"rotate(180deg)":"none",flex:"none"},children:(0,a.jsx)("path",{d:"m4 6 4 4 4-4"})})]}),items:j})]})}t($s,"ArchiveViewSortMenu");function ur({selectedCount:n,hiddenCount:r,allVisibleSelected:i,selectedVisibleCount:u,visibleCount:p,busy:m,t:C,onToggle:R,onClear:I,onRestore:P,onDelete:T,onArchive:j}){let F=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)(hr,{checked:i,indeterminate:u>0&&!i,disabled:m||p===0,label:C("archives.selectAllFiltered"),onChange:t(h=>R(h.target.checked),"onChange")}),(0,a.jsx)("span",{"aria-live":"polite",children:F?C("archives.selectedCount",{n}):C("archives.selectAllFiltered")})]}),F&&_({disabled:m,"aria-label":C("archives.clearSelection"),onClick:I,children:C("archives.clearSelectionShort")})]}),F&&(0,a.jsxs)("div",{className:"dsham_settingsSelectionActions",children:j?[_({disabled:m,onClick:j,children:C("archives.archiveSelected")})]:[_({disabled:m,"aria-label":C("archives.restoreSelected"),onClick:P,children:C("archives.restore")}),_({disabled:m,className:"dsham_btnDanger","aria-label":C("archives.deleteSelected"),onClick:T,children:C("archives.deleteSelectionShort")})]})]}),r>0&&(0,a.jsx)("p",{className:"dsham_settingsSelectionScope",role:"status",children:C("archives.selectionHiddenHint",{hidden:r})})]})}t(ur,"ArchiveSelectionToolbar");function hr({checked:n,indeterminate:r=!1,disabled:i=!1,label:u,onChange:p}){return(0,a.jsx)(Hn,{checked:n,indeterminate:r,disabled:i,label:u,onChange:p})}t(hr,"ArchiveSelectionCheckbox");function pr(){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))})}t(pr,"moreIcon");function Gs({busy:n,title:r,t:i,onPreview:u,onRestoreOpen:p,onDelete:m,onCopyId:C}){let[R,I]=(0,l.useState)(!1),P=t(j=>{if(!n){if(I(!1),j==="copyId")return C?.();if(j==="preview")return u?.();if(j==="restoreOpen")return p?.();j==="delete"&&m?.()}},"choose"),T=[...u?[{id:"preview",label:i("discovery.preview"),icon:(0,a.jsx)(c.IconBrowseOutlineMedium,{size:16}),danger:!1}]:[],...p?[{id:"restoreOpen",label:i("archives.restoreOpen"),icon:(0,a.jsx)(c.IconUnarchiveOutlineMedium,{size:16}),danger:!1}]:[],...C?[{id:"copyId",label:i("details.copyId"),icon:(0,a.jsx)(c.IconCopyOutlineMedium,{size:16}),danger:!1}]:[],...m?[{id:"delete",label:i("menu.deleteSession"),icon:(0,a.jsx)(c.IconTrashOutlineMedium,{size:16}),danger:!0}]:[]];return(0,a.jsx)(c.Menu,{open:!n&&R,align:"end",portal:!0,dense:!0,items:T,onSelect:P,onClose:t(()=>I(!1),"onClose"),anchor:_({variant:"outline",className:"dsham_iconAction",disabled:n,title:i("archives.moreActions"),"aria-label":i("archives.moreActions")+i("common.separator")+r,"aria-haspopup":"menu","aria-expanded":R&&!n,icon:pr(),onClick:t(()=>{n||I(j=>!j)},"onClick")})})}t(Gs,"ArchivedSessionMenu");function Ks({group:n,busy:r,onArchive:i,onRestore:u,onDelete:p,t:m}){let C=n.key===sn,R=i?[{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}],[I,P]=(0,l.useState)(!1),T=m(C?"archives.ungroupedActions":"archives.projectActions",{name:n.title}),j=t(F=>{r||(F==="archive"?i?.():F==="restore"?u?.():F==="delete"&&p?.())},"choose");return(0,a.jsx)(c.Menu,{open:!r&&I,align:"end",portal:!0,dense:!0,items:R,onSelect:t(F=>{P(!1),j(F)},"onSelect"),onClose:t(()=>P(!1),"onClose"),anchor:_({variant:"outline",className:"dsham_iconAction",disabled:r,"aria-label":T,"aria-haspopup":"menu","aria-expanded":I&&!r,icon:pr(),onClick:t(()=>{r||P(F=>!F)},"onClick")})})}t(Ks,"ArchivedGroupActions");let sn="__ungrouped__";function Ys(n){return n===sn?{scope:"ungrouped"}:{scope:"workspace",workspaceId:n}}t(Ys,"archivedBatchTargetForGroup");function Wt(n,r,i){let u=[...new Set(n??[])];if(i.scope==="all")return u;if(i.scope==="sessions"){let m=new Set(i.sessionIds??[]);return u.filter(C=>m.has(C))}if(i.scope==="workspace"){let m=new Set(r.find(C=>C.workspaceId===i.workspaceId)?.sessionIds??[]);return u.filter(C=>m.has(C))}let p=new Set(r.flatMap(m=>m.sessionIds));return u.filter(m=>!p.has(m))}t(Wt,"deriveArchivedBatchIds");function mr(n){return[...new Set(n.flatMap(r=>r.sessions.map(i=>i.id)))]}t(mr,"archivedSessionIdsInGroups");function gr(n,r){let i=new Set(r);return[...new Set(n)].filter(u=>i.has(u))}t(gr,"pruneArchivedSelection");function Tn(n,r,i){let u=new Set(n);for(let p of r)i?u.add(p):u.delete(p);return[...u]}t(Tn,"toggleArchivedSelection");function fr(n,r){let i=n.deletedSessionIds.length,u=n.skippedSessionIds.length;return n.failures.length>0?{kind:"error",message:r("archives.deletePartial",{deleted:i,skipped:u,failed:n.failures.length,detail:n.failures[0].message})}:u>0&&i>0?{kind:"notice",message:r("archives.deleteSuccessWithSkipped",{deleted:i,skipped:u})}:u>0?{kind:"notice",message:r("archives.deleteSkipped",{n:u})}:{kind:"notice",message:r("archives.deleteSuccess",{n:i})}}t(fr,"archivedDeleteFeedback");function vr(n,r){let i=new Set(r);return Object.values(n).filter(u=>u.origin!=="subagent"&&!u.blank&&!i.has(u.id)).map(u=>u.id)}t(vr,"unarchivedSessionIds");function yr(n,r,i,u){let p=r.map(R=>({key:R.workspaceId,title:R.title,ids:new Set(R.sessionIds),sessions:[]})),m=[];for(let R of i){let I=n[R];if(I===void 0||I.origin==="subagent")continue;let P=p.find(T=>T.ids?.has(R));(P===void 0?m:P.sessions).push(I)}let C=p.filter(R=>R.sessions.length>0);return m.length>0&&C.push({key:sn,title:u,sessions:m}),C}t(yr,"deriveArchivedGroups");function br(n,r,i,u,p=[]){let m=t((T,j)=>String(T).localeCompare(String(j),void 0,{numeric:!0,sensitivity:"base"}),"compareText"),C=new Map;if(Array.isArray(p))for(let T=0;T<p.length;T++)C.set(p[T],T);let R=t(T=>{let j=r==="created"?i[T.id]:T.updatedAt;return typeof j=="number"&&Number.isFinite(j)?j:Number.NEGATIVE_INFINITY},"timestampOf"),I=t((T,j)=>{if(r==="archived"){let F=C.get(T.id)??-1,ge=(C.get(j.id)??-1)-F;if(ge!==0)return ge}if(r!=="alphabetical"){let F=R(j)-R(T);if(Number.isFinite(F)&&F!==0)return F}return m(Me(T,u),Me(j,u))||m(T.id,j.id)},"compareSessions");return n.map(T=>({...T,sessions:[...T.sessions].sort(I)})).sort((T,j)=>{if(r==="archived"){let F=T.sessions[0]?.id,h=j.sessions[0]?.id,ge=F!==void 0?C.get(F)??-1:-1,ie=(h!==void 0?C.get(h)??-1:-1)-ge;if(ie!==0)return ie}if(r!=="alphabetical"){let F=R(j.sessions[0])-R(T.sessions[0]);if(Number.isFinite(F)&&F!==0)return F}return m(T.title,j.title)||m(T.key,j.key)})}t(br,"sortArchivedGroups");let wr={...xs,...ns,"locale.language":"zh","service.unavailable":"\u670D\u52A1\u5C1A\u672A\u5C31\u7EEA\uFF0C\u8BF7\u91CD\u8BD5","sidebar.entry.title":"\u4FA7\u8FB9\u680F\u5165\u53E3","sidebar.entry.desc":"\u5728\u5DE6\u4FA7\u4E3B\u5BFC\u822A\u680F\u663E\u793A\u5F52\u6863\u7BA1\u7406\u5668\u3002\u8BBE\u7F6E\u91CC\u7684\u5165\u53E3\u4E0D\u53D8\u3002","sidebar.entry.toggle":"\u5207\u6362\u4FA7\u8FB9\u680F\u5165\u53E3","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","section.workspaces":"\u5DE5\u4F5C\u533A","section.sessions":"\u4F1A\u8BDD","viewOptions.label":"\u89C6\u56FE\u9009\u9879","groupBy.label":"\u5206\u7EC4\u65B9\u5F0F","groupBy.workspace":"\u6309\u5DE5\u4F5C\u533A","groupBy.flat":"\u5355\u5217\u8868","orderBy.label":"\u6392\u5E8F\u65B9\u5F0F","orderBy.manual":"\u624B\u52A8\u6392\u5E8F","orderBy.updated":"\u6700\u8FD1\u66F4\u65B0","sessions.expand":"\u5C55\u5F00\u5176\u4F59 {n} \u4E2A\u4F1A\u8BDD","sessions.collapse":"\u6536\u8D77","empty.none":"\u6682\u65E0\u4F1A\u8BDD","workspace.add":"\u6DFB\u52A0\u5DE5\u4F5C\u533A","search.sessions.aria":"\u641C\u7D22\u4F1A\u8BDD","search.placeholder":"\u641C\u7D22\u4F1A\u8BDD\u2026","search.clear":"\u6E05\u9664\u641C\u7D22","search.results.aria":"\u641C\u7D22\u7ED3\u679C","search.pending":"\u6B63\u5728\u641C\u7D22\u4F1A\u8BDD\u5386\u53F2\u2026","search.unavailable":"\u5185\u5BB9\u641C\u7D22\u6682\u4E0D\u53EF\u7528\uFF0C\u4EC5\u663E\u793A\u540D\u79F0\u5339\u914D\u3002","search.noMatches":"\u65E0\u5339\u914D\u4F1A\u8BDD","search.hasMore":"\u4EC5\u663E\u793A\u524D {n} \u6761\u7ED3\u679C\uFF0C\u8BF7\u7F29\u5C0F\u641C\u7D22\u8303\u56F4\u3002","menu.addWorkspace":"\u6DFB\u52A0\u5DE5\u4F5C\u533A\u2026","menu.unarchive":"\u53D6\u6D88\u5F52\u6863","menu.deleteSession":"\u5220\u9664\u4F1A\u8BDD","archived.badge":"\u5F52\u6863\u4F1A\u8BDD","archived.notOpenable":"\u5DF2\u5F52\u6863\uFF0C\u53D6\u6D88\u5F52\u6863\u540E\u53EF\u7EE7\u7EED\u5BF9\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.sortBy":"\u6392\u5E8F\u65B9\u5F0F","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","archiveActive.pending":"\u6B63\u5728\u505C\u6B62\u5E76\u5F52\u6863\u2026","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}","picker.loading":"\u6B63\u5728\u52A0\u8F7D\u5DE5\u4F5C\u533A\u2026","conflict.named":"\u5DF2\u5B58\u5728\u540D\u4E3A\u201C{name}\u201D\u7684\u5DE5\u4F5C\u533A\u3002","folderError.title":"\u65E0\u6CD5\u6253\u5F00\u6587\u4EF6\u5939","folderError.retry":"\u91CD\u65B0\u9009\u62E9",rename:"\u91CD\u547D\u540D","rename.workspace.title":"\u91CD\u547D\u540D\u5DE5\u4F5C\u533A","rename.session.title":"\u91CD\u547D\u540D\u4F1A\u8BDD","field.workspaceName":"\u5DE5\u4F5C\u533A\u540D\u79F0","field.sessionName":"\u4F1A\u8BDD\u540D\u79F0","delete.workspace":"\u5220\u9664\u5DE5\u4F5C\u533A","delete.desc":"\u5C06\u628A\u201C{name}\u201D\u4ECE\u5DE5\u4F5C\u533A\u5217\u8868\u4E2D\u79FB\u9664\u3002\u6587\u4EF6\u5939\u4E0E\u4F1A\u8BDD\u8BB0\u5F55\u4F1A\u4FDD\u7559\uFF0C\u5176\u4F1A\u8BDD\u5C06\u663E\u793A\u5728\u201C\u672A\u5206\u7EC4\u201D\u4E0B\u3002","delete.pending":"\u6B63\u5728\u5220\u9664\u5DE5\u4F5C\u533A\u2026","menu.fork":"\u5206\u53C9\u4F1A\u8BDD","menu.archiveSession":"\u5F52\u6863\u4F1A\u8BDD","menu.archiveWorkspace":"\u5F52\u6863\u5168\u90E8\u4F1A\u8BDD","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","actions.workspace.aria":"\u5DE5\u4F5C\u533A\u201C{name}\u201D\u7684\u64CD\u4F5C","actions.session.aria":"\u4F1A\u8BDD\u201C{name}\u201D\u7684\u64CD\u4F5C","actions.newSession.aria":"\u5728\u201C{name}\u201D\u4E2D\u65B0\u5EFA\u4F1A\u8BDD","status.running":"\u8FDB\u884C\u4E2D","status.subagentsRunning.one":"{n} \u4E2A\u5B50\u4EE3\u7406\u8FD0\u884C\u4E2D","status.subagentsRunning.other":"{n} \u4E2A\u5B50\u4EE3\u7406\u8FD0\u884C\u4E2D","status.idle":"\u7A7A\u95F2","status.waitingApproval":"\u7B49\u5F85\u5BA1\u6279","status.planReview":"\u8BA1\u5212\u5F85\u5BA1","status.waitingAnswer":"\u7B49\u5F85\u56DE\u7B54","status.completed":"\u5DF2\u5B8C\u6210","hover.created":"\u521B\u5EFA\u4E8E {time}","hover.copied":"\u5DF2\u590D\u5236","date.ymd":"{y}\u5E74{m}\u6708{d}\u65E5","time.now":"\u521A\u521A","time.minutes":"{n}\u5206\u949F","time.hours":"{n}\u5C0F\u65F6","time.days":"{n}\u5929","time.months":"{n}\u4E2A\u6708","time.years":"{n}\u5E74","time.ago":"{t}\u524D"},Sr={...ks,...rs,"locale.language":"en","service.unavailable":"The service is not ready. Please retry.","sidebar.entry.title":"Sidebar entry","sidebar.entry.desc":"Show Archived Sessions in the left sidebar. The Settings entry stays either way.","sidebar.entry.toggle":"Toggle sidebar entry","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","section.workspaces":"Workspaces","section.sessions":"Sessions","viewOptions.label":"View options","groupBy.label":"Group by","groupBy.workspace":"Workspace","groupBy.flat":"In one list","orderBy.label":"Order by","orderBy.manual":"Manual","orderBy.updated":"Last updated","sessions.expand":"Show {n} more sessions","sessions.collapse":"Show less","empty.none":"No sessions yet","workspace.add":"Add workspace","search.sessions.aria":"Search sessions","search.placeholder":"Search sessions...","search.clear":"Clear search","search.results.aria":"Search results","search.pending":"Searching session history\u2026","search.unavailable":"Content search is temporarily unavailable. Showing name matches.","search.noMatches":"No matching sessions","search.hasMore":"Showing the first {n} results. Narrow your search.","menu.addWorkspace":"Add workspace\u2026","menu.unarchive":"Unarchive","menu.deleteSession":"Delete session","archived.badge":"Archived sessions","archived.notOpenable":"This session is archived. Unarchive it to continue the conversation.","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.sortBy":"Sort 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","archiveActive.pending":"Stopping and archiving\u2026","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}","picker.loading":"Loading workspaces\u2026","conflict.named":"A workspace named \u201C{name}\u201D already exists.","folderError.title":"Couldn\u2019t open folder","folderError.retry":"Choose again",rename:"Rename","rename.workspace.title":"Rename workspace","rename.session.title":"Rename session","field.workspaceName":"Workspace name","field.sessionName":"Session name","delete.workspace":"Delete workspace","delete.desc":"This removes \u201C{name}\u201D from the workspace list. The folder and session logs will be kept. Its sessions will appear under Ungrouped.","delete.pending":"Deleting workspace\u2026","menu.fork":"Fork session","menu.archiveSession":"Archive session","menu.archiveWorkspace":"Archive all conversations","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","actions.workspace.aria":"Workspace actions for {name}","actions.session.aria":"Session actions for {name}","actions.newSession.aria":"New session in {name}","status.running":"Running","status.subagentsRunning.one":"{n} subagent running","status.subagentsRunning.other":"{n} subagents running","status.idle":"Idle","status.waitingApproval":"Waiting for approval","status.planReview":"Plan awaiting review","status.waitingAnswer":"Waiting for answer","status.completed":"Completed","hover.created":"Created {time}","hover.copied":"Copied","date.ymd":"{y}-{m}-{d}","time.now":"now","time.minutes":"{n}min","time.hours":"{n}h","time.days":"{n}d","time.months":"{n}mo","time.years":"{n}y","time.ago":"{t} ago"},Zs={...Cs,...ss,"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.","sidebar.entry.title":"\u041F\u0443\u043D\u043A\u0442 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","sidebar.entry.desc":"\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u0430\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439 \u043D\u0430 \u043B\u0435\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438. \u041F\u0443\u043D\u043A\u0442 \u0432 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430\u0445 \u0441\u043E\u0445\u0440\u0430\u043D\u044F\u0435\u0442\u0441\u044F.","sidebar.entry.toggle":"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u043F\u0443\u043D\u043A\u0442 \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","section.workspaces":"\u0420\u0430\u0431\u043E\u0447\u0438\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430","section.sessions":"\u0421\u0435\u0441\u0441\u0438\u0438","viewOptions.label":"\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430","groupBy.label":"\u0413\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u043E","groupBy.workspace":"\u0420\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E","groupBy.flat":"\u0412 \u043E\u0434\u043D\u043E\u043C \u0441\u043F\u0438\u0441\u043A\u0435","orderBy.label":"\u041F\u043E\u0440\u044F\u0434\u043E\u043A","orderBy.manual":"\u0412\u0440\u0443\u0447\u043D\u0443\u044E","orderBy.updated":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0435 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","sessions.expand":"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0435\u0449\u0451 {n} \u0441\u0435\u0441\u0441\u0438\u0439","sessions.collapse":"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043C\u0435\u043D\u044C\u0448\u0435","empty.none":"\u041F\u043E\u043A\u0430 \u043D\u0435\u0442 \u0441\u0435\u0441\u0441\u0438\u0439","workspace.add":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E","search.sessions.aria":"\u041F\u043E\u0438\u0441\u043A \u0441\u0435\u0441\u0441\u0438\u0439","search.placeholder":"\u041F\u043E\u0438\u0441\u043A \u0441\u0435\u0441\u0441\u0438\u0439...","search.clear":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u043F\u043E\u0438\u0441\u043A","search.results.aria":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u043F\u043E\u0438\u0441\u043A\u0430","search.pending":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0438\u0441\u0442\u043E\u0440\u0438\u0438 \u0441\u0435\u0441\u0441\u0438\u0439\u2026","search.unavailable":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443 \u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D. \u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u0441\u043E\u0432\u043F\u0430\u0434\u0435\u043D\u0438\u044F \u043F\u043E \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u044F\u043C.","search.noMatches":"\u041D\u0435\u0442 \u043F\u043E\u0434\u0445\u043E\u0434\u044F\u0449\u0438\u0445 \u0441\u0435\u0441\u0441\u0438\u0439","search.hasMore":"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u044B \u043F\u0435\u0440\u0432\u044B\u0435 {n} \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u043E\u0432. \u0421\u0443\u0437\u044C\u0442\u0435 \u043F\u043E\u0438\u0441\u043A.","menu.addWorkspace":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E\u2026","menu.unarchive":"\u0412\u0435\u0440\u043D\u0443\u0442\u044C \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430","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","archived.notOpenable":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0432 \u0430\u0440\u0445\u0438\u0432\u0435. \u0412\u0435\u0440\u043D\u0438\u0442\u0435 \u0435\u0451 \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430, \u0447\u0442\u043E\u0431\u044B \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440.","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.sortBy":"\u0421\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0430 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432","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","archiveActive.pending":"\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430 \u0438 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F\u2026","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}","picker.loading":"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0440\u0430\u0431\u043E\u0447\u0438\u0445 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u2026","conflict.named":"\u0420\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E \u0441 \u0438\u043C\u0435\u043D\u0435\u043C \xAB{name}\xBB \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.","folderError.title":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0442\u043A\u0440\u044B\u0442\u044C \u043F\u0430\u043F\u043A\u0443","folderError.retry":"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0441\u043D\u043E\u0432\u0430",rename:"\u041F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u044C","rename.workspace.title":"\u041F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E","rename.session.title":"\u041F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","field.workspaceName":"\u0418\u043C\u044F \u0440\u0430\u0431\u043E\u0447\u0435\u0433\u043E \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430","field.sessionName":"\u0418\u043C\u044F \u0441\u0435\u0441\u0441\u0438\u0438","delete.workspace":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E","delete.desc":"\u042D\u0442\u043E \u0443\u0434\u0430\u043B\u0438\u0442 \xAB{name}\xBB \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430 \u0440\u0430\u0431\u043E\u0447\u0438\u0445 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432. \u041F\u0430\u043F\u043A\u0430 \u0438 \u0436\u0443\u0440\u043D\u0430\u043B\u044B \u0441\u0435\u0441\u0441\u0438\u0439 \u043E\u0441\u0442\u0430\u043D\u0443\u0442\u0441\u044F. \u0415\u0433\u043E \u0441\u0435\u0441\u0441\u0438\u0438 \u043F\u043E\u044F\u0432\u044F\u0442\u0441\u044F \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0411\u0435\u0437 \u0433\u0440\u0443\u043F\u043F\u044B\xBB.","delete.pending":"\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0440\u0430\u0431\u043E\u0447\u0435\u0433\u043E \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430\u2026","menu.fork":"\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0432\u0435\u0442\u043A\u0443 \u0441\u0435\u0441\u0441\u0438\u0438","menu.archiveSession":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","menu.archiveWorkspace":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 \u0441\u0435\u0441\u0441\u0438\u0438","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","actions.workspace.aria":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0440\u0430\u0431\u043E\u0447\u0435\u0433\u043E \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430 \u0434\u043B\u044F {name}","actions.session.aria":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0441\u0435\u0441\u0441\u0438\u0438 \u0434\u043B\u044F {name}","actions.newSession.aria":"\u041D\u043E\u0432\u0430\u044F \u0441\u0435\u0441\u0441\u0438\u044F \u0432 {name}","status.running":"\u0412\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F","status.subagentsRunning.one":"{n} \u043F\u043E\u0434\u0430\u0433\u0435\u043D\u0442 \u0440\u0430\u0431\u043E\u0442\u0430\u0435\u0442","status.subagentsRunning.other":"{n} \u043F\u043E\u0434\u0430\u0433\u0435\u043D\u0442\u043E\u0432 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0442","status.idle":"\u041E\u0436\u0438\u0434\u0430\u043D\u0438\u0435","status.waitingApproval":"\u041E\u0436\u0438\u0434\u0430\u043D\u0438\u0435 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u044F","status.planReview":"\u041F\u043B\u0430\u043D \u043E\u0436\u0438\u0434\u0430\u0435\u0442 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438","status.waitingAnswer":"\u041E\u0436\u0438\u0434\u0430\u043D\u0438\u0435 \u043E\u0442\u0432\u0435\u0442\u0430","status.completed":"\u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043E","hover.created":"\u0421\u043E\u0437\u0434\u0430\u043D\u043E {time}","hover.copied":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E","date.ymd":"{y}-{m}-{d}","time.now":"\u0441\u0435\u0439\u0447\u0430\u0441","time.minutes":"{n}\u043C\u0438\u043D","time.hours":"{n}\u0447","time.days":"{n}\u0434","time.months":"{n}\u043C\u0435\u0441","time.years":"{n}\u0433","time.ago":"{t} \u043D\u0430\u0437\u0430\u0434"},He="archive-manager-workspace",Js=["slots","sessions","workspaces","locale","remote","typert"];function Rn(n){return{getSnapshot:n.getSnapshot.bind(n),subscribe:n.subscribe.bind(n)}}t(Rn,"bindObservable");function xr(n){return async r=>{if(typeof n?.unarchiveSession!="function")throw new Error("archive-manager: host unarchiveSession is unavailable");await n.unarchiveSession(r)}}t(xr,"createUnarchiveSession");async function jn(n,r,i){let u=new Set(n.list?.getSnapshot?.()?.archivedSessionIds??[]),p=await yn(r,async C=>{try{await n.archiveSession(C)}catch(R){throw R!==null&&typeof R=="object"&&rn(R)!==void 0&&typeof ce(R).sessionId!="string"&&Object.assign(R,{sessionId:C}),R}return!0},{refresh:i}),m=[...n.list?.getSnapshot?.()?.archivedSessionIds??[]];return{archivedSessionIds:m,archivedSessionIdsAdded:m.filter(C=>!u.has(C)),failures:p.failures}}t(jn,"archiveSessionsViaOfficial");async function kr(n,r,i,u){let p=new Set(n.list?.getSnapshot?.()?.archivedSessionIds??[]),m=typeof u=="function"?u:I=>n.unarchiveSession?.(I),C=await yn(r,async I=>(await m(I),!0),{refresh:i}),R=[...n.list?.getSnapshot?.()?.archivedSessionIds??[]];return{archivedSessionIds:R,unarchivedSessionIds:[...p].filter(I=>!R.includes(I)),failures:C.failures}}t(kr,"unarchiveSessionsViaOfficial");async function Qs(n){Xs(n);let r=n.get("remote"),i=t(()=>{},"disposeRemote");return r!==void 0&&(i=await r.$mount(L)),async()=>{await i()}}t(Qs,"apply");function Xs(n){n.effect(()=>n.locale.register(He,{zh:wr,en:Sr,ru:Zs}),"dsh-archive-manager: dictionaries");let r=t(()=>n.get("uiWorkspace"),"uiWorkspaceAt"),i={},u,p=t(g=>(u=os(g,n.sessions,n.workspaces,{onOpened:t(()=>n.get("layout")?.selectPanel(null),"onOpened"),beginNavigation:t(()=>n.get("layout")?.beginNavigation?.(),"beginNavigation")}),()=>u?.dispose()),"attachArchiveNavigation");n.effect(()=>p(r()),"archive-manager: explicit archived navigation");let m=t(g=>{if(u===void 0)throw new It("navigationUnavailable");return or.request(g),u.open(g)},"openConversation"),C=t(async g=>{n.get("layout")?.beginNavigation?.(),or.request(g)},"focusSessionWorkspace"),R=t(async(g,y)=>{let N=await n.sessions.search(g,y);if(!N.ok)throw new Error(N.error.message);return N.value},"searchSessions"),I=t(async()=>{if(typeof n.sessions.refresh!="function")return null;try{return await n.sessions.refresh(),null}catch(g){return console.warn("archive-manager: restored archived sessions but session list refresh failed:",g),g instanceof Error?g.message:String(g)}},"refreshSessionList"),P=xr(n.workspaces),T=t(async(g,...y)=>{let N=n.get("remote.workspaceRegistry");if(!N||typeof N[g]!="function")throw new Error(n.locale.bind(He)("service.unavailable"));let Se=await N[g].apply(N,y);if(!Se.ok)throw new Error(Se.error.message);return Se.value},"registryCall"),j=t(()=>T("diagnoseOrphanSubagents"),"diagnoseOrphanSubagents"),F=t((g={})=>T("cleanOrphanSubagents",g??{}),"cleanOrphanSubagents"),h=t(g=>T("searchArchivedContent",g),"searchArchivedContent"),ge=t(g=>T("searchSessionContent",g),"searchSessionContent"),Ee=t(g=>T("previewArchivedSession",g),"previewArchivedSession"),ie=t(()=>T("favoriteSessions"),"favoriteSessions"),ht=t(g=>T("setSessionFavorite",g),"setSessionFavorite"),At=ws({workspaces:n.workspaces.list,sessions:n.sessions.list,archive:t(g=>n.workspaces.archiveSession(g),"archive"),restore:t(async g=>{await P(g)},"restore"),deleteOne:t(async g=>{let y=n.get("remote.workspaceRegistry");if(!y)throw new Error(n.locale.bind(He)("service.unavailable"));let N=await y.deleteSession(g);if(!N.ok)throw new Error(N.error.message)},"deleteOne"),getFavorites:ie,refresh:t(()=>n.sessions.refresh?.(),"refresh"),currentSessionId:dt}),st=t(async g=>{await P(g),await I()},"unarchiveSession"),$=t(async g=>{let y=n.get("remote.workspaceRegistry");if(y===void 0)throw new Error("archive-manager remote service is unavailable");let N=await y.deleteSession(g);if(!N.ok)throw new Error(N.error.message);await I()},"deleteSession"),de=t(async g=>jn(n.workspaces,g,I),"archiveSessions"),Mt=t(async g=>{let y=n.workspaces.list?.getSnapshot?.()??{archivedSessionIds:[],items:[]},N=Wt(y.archivedSessionIds,y.items,g);return kr(n.workspaces,N,I,P)},"unarchiveSessions"),an=t(async g=>{let y=n.get("remote.workspaceRegistry");if(y===void 0)throw new Error("archive-manager remote service is unavailable");let N=await y.deleteArchivedSessions(g);if(!N.ok)throw new Error(N.error.message);let pe=await I();return{...N.value,refreshError:pe}},"deleteArchivedSessions"),Qe=t(async()=>{let g=n.get("remote.workspaceRegistry");if(g===void 0)throw new Error("archive-manager remote service is unavailable");let y=await g.archivedSessionMetadata();if(!y.ok)throw new Error(y.error.message);return y.value},"archivedSessionMetadata"),we="sidebar.workspaces.session.menu.item",at=null,bt=new Set,he=t(g=>{at=g;for(let y of bt)y()},"publishDeleteTarget");function pt(){return l.useSyncExternalStore(g=>(bt.add(g),()=>{bt.delete(g)}),()=>at,()=>at)}t(pt,"useDeleteRequest");function Xe({sessionId:g,displayTitle:y,useMenuOpenState:N,t:pe}){let[,Se]=N(),oe=c.MenuItemButton,De=(0,a.jsx)(c.IconTrashOutlineRegular,{size:14}),Pe=t(()=>{Se(!1),he({sessionId:g,title:y})},"onSelect");return typeof oe=="function"?(0,a.jsx)(oe,{danger:!0,icon:De,onSelect:Pe,children:pe("menu.deleteSession")}):(0,a.jsx)("button",{type:"button",role:"menuitem",onClick:Pe,children:pe("menu.deleteSession")})}t(Xe,"DeleteSessionMenuItem");function qt(g){try{let y=document.querySelector(`[data-row-key="session:${CSS.escape(g)}"]`);return y?(y.hasAttribute("tabindex")||(y.setAttribute("tabindex","-1"),y.addEventListener("blur",()=>y.removeAttribute("tabindex"),{once:!0})),typeof c.focusWithoutRing=="function"?c.focusWithoutRing(y):y.focus(),!0):!1}catch{return!1}}t(qt,"focusSessionRow");function it({t:g}){let y=pt(),[N,pe]=(0,l.useState)(!1),[Se,oe]=(0,l.useState)(null),[De,Pe]=(0,l.useState)(null),re=(0,l.useRef)(null),be=(0,l.useRef)(null),Ae=(0,l.useRef)(null);if((0,l.useLayoutEffect)(()=>{if(y===null||typeof document>"u"){Pe(null);return}let J=null,ee=t(()=>{if(J&&J.isConnected)return J;try{J=document.querySelector(`[data-row-key="session:${CSS.escape(y.sessionId)}"]`)}catch{J=null}return J},"getTargetRow"),O=t(()=>{let ve=re.current,ue=ve?.offsetWidth||290,Oe=ve?.offsetHeight||160,ze=8,Le=ee();if(!Le){let le=window.innerWidth,tt=window.innerHeight,ct=Math.max(16,(tt-Oe)/2),We=Math.max(16,(le-ue)/2);Pe(Ue=>Ue!==null&&Ue.top===ct&&Ue.left===We?Ue:{top:ct,left:We});return}let Ge=Le.getBoundingClientRect(),Re=Ge.top-4;Re+Oe>window.innerHeight-16&&(Re=window.innerHeight-16-Oe),Re<16&&(Re=16);let Ce=Ge.right+ze;Ce+ue>window.innerWidth-16&&(Ce=Ge.left-ue-ze),Ce<16&&(Ce=16),Pe(le=>le!==null&&le.top===Re&&le.left===Ce?le:{top:Re,left:Ce})},"updatePosition");O(),window.addEventListener("scroll",O,!0),window.addEventListener("resize",O);let te=null;return typeof ResizeObserver<"u"&&re.current&&(te=new ResizeObserver(O),te.observe(re.current)),()=>{te?.disconnect(),window.removeEventListener("scroll",O,!0),window.removeEventListener("resize",O)}},[y]),(0,l.useEffect)(()=>{if(y===null)return;be.current&&!be.current.disabled?be.current.focus():re.current?.focus();let J=y.sessionId;return()=>{if(!qt(J)){let O=document.querySelector('[role="treeitem"][aria-selected="true"]');O&&(O.hasAttribute("tabindex")||(O.setAttribute("tabindex","-1"),O.addEventListener("blur",()=>O.removeAttribute("tabindex"),{once:!0})),typeof c.focusWithoutRing=="function"?c.focusWithoutRing(O):O.focus())}}},[y]),(0,l.useEffect)(()=>{y!==null&&N&&re.current?.focus()},[y,N]),(0,l.useEffect)(()=>{if(y===null)return;let J=t(ee=>{if(ee.key==="Escape"){ee.preventDefault(),ee.stopPropagation(),"stopImmediatePropagation"in ee&&typeof ee.stopImmediatePropagation=="function"&&ee.stopImmediatePropagation(),N||(oe(null),he(null));return}if(ee.key==="Tab"){if(ee.preventDefault(),N){re.current?.focus();return}let O=be.current,te=Ae.current;if(!O||!te)return;ee.shiftKey?document.activeElement===O?te.focus():O.focus():document.activeElement===te?O.focus():te.focus()}},"onKey");return window.addEventListener("keydown",J,!0),()=>window.removeEventListener("keydown",J,!0)},[y,N]),y===null)return null;let lt=t(()=>{N||(oe(null),he(null))},"close"),$e=t(()=>{pe(!0),oe(null),$(y.sessionId).then(()=>{pe(!1),he(null)}).catch(J=>{pe(!1),oe(wn(J,g))})},"confirm");return(0,a.jsxs)("div",{className:"dsham_sidebarCardRoot",children:[(0,a.jsx)("div",{className:"dsham_sidebarCardBackdrop",onClick:lt}),(0,a.jsxs)("div",{ref:re,role:"dialog","aria-modal":!0,"aria-label":g("deleteSession.title"),tabIndex:-1,className:"dsham_sidebarCard",style:De?{top:De.top,left:De.left,visibility:"visible"}:{visibility:"hidden",top:0,left:0},children:[(0,a.jsx)("h3",{className:"dsham_sidebarCardTitle",children:g("deleteSession.confirmTitle")}),(0,a.jsx)("p",{className:"dsham_sidebarCardDesc",children:g("deleteSession.desc",{name:y.title})}),N&&(0,a.jsx)("div",{className:"dsham_sidebarCardDesc",role:"status",children:g("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:be,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnCancel",disabled:N,onClick:lt,children:g("cancel")}),(0,a.jsx)("button",{ref:Ae,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnDanger",disabled:N,onClick:$e,children:g("deleteSession.title")})]})]})]})}t(it,"DeleteSessionOverlay");let Ve=null,mt=new Set,wt=t(g=>{Ve=g;for(let y of mt)y()},"publishArchiveWsTarget");function on(){return l.useSyncExternalStore(g=>(mt.add(g),()=>{mt.delete(g)}),()=>Ve,()=>Ve)}t(on,"useArchiveWsRequest");function ot(g){try{let y=document.querySelector(`[data-row-key="workspace:${CSS.escape(g)}"]`);return y?(y.hasAttribute("tabindex")||(y.setAttribute("tabindex","-1"),y.addEventListener("blur",()=>y.removeAttribute("tabindex"),{once:!0})),typeof c.focusWithoutRing=="function"?c.focusWithoutRing(y):y.focus(),!0):!1}catch{return!1}}t(ot,"focusWorkspaceRow");function fe({t:g}){let y=on(),[N,pe]=(0,l.useState)(!1),[Se,oe]=(0,l.useState)(null),[De,Pe]=(0,l.useState)(null),re=(0,l.useRef)(null),be=(0,l.useRef)(null),Ae=(0,l.useRef)(null);if((0,l.useLayoutEffect)(()=>{if(y===null||typeof document>"u"){Pe(null);return}let J=null,ee=t(()=>{if(J&&J.isConnected)return J;try{J=document.querySelector(`[data-row-key="workspace:${CSS.escape(y.workspaceId)}"]`)}catch{J=null}return J},"getTargetRow"),O=t(()=>{let ve=re.current,ue=ve?.offsetWidth||290,Oe=ve?.offsetHeight||160,ze=8,Le=ee();if(!Le){let le=window.innerWidth,tt=window.innerHeight,ct=Math.max(16,(tt-Oe)/2),We=Math.max(16,(le-ue)/2);Pe(Ue=>Ue!==null&&Ue.top===ct&&Ue.left===We?Ue:{top:ct,left:We});return}let Ge=Le.getBoundingClientRect(),Re=Ge.top-4;Re+Oe>window.innerHeight-16&&(Re=window.innerHeight-16-Oe),Re<16&&(Re=16);let Ce=Ge.right+ze;Ce+ue>window.innerWidth-16&&(Ce=Ge.left-ue-ze),Ce<16&&(Ce=16),Pe(le=>le!==null&&le.top===Re&&le.left===Ce?le:{top:Re,left:Ce})},"updatePosition");O(),window.addEventListener("scroll",O,!0),window.addEventListener("resize",O);let te=null;return typeof ResizeObserver<"u"&&re.current&&(te=new ResizeObserver(O),te.observe(re.current)),()=>{te?.disconnect(),window.removeEventListener("scroll",O,!0),window.removeEventListener("resize",O)}},[y]),(0,l.useEffect)(()=>{if(y===null)return;be.current&&!be.current.disabled?be.current.focus():re.current?.focus();let J=y.workspaceId;return()=>{ot(J)}},[y]),(0,l.useEffect)(()=>{y!==null&&N&&re.current?.focus()},[y,N]),(0,l.useEffect)(()=>{if(y===null)return;let J=t(ee=>{if(ee.key==="Escape"){ee.preventDefault(),ee.stopPropagation(),"stopImmediatePropagation"in ee&&typeof ee.stopImmediatePropagation=="function"&&ee.stopImmediatePropagation(),N||(oe(null),wt(null));return}if(ee.key==="Tab"){if(ee.preventDefault(),N){re.current?.focus();return}let O=be.current,te=Ae.current;if(!O||!te)return;ee.shiftKey?document.activeElement===O?te.focus():O.focus():document.activeElement===te?O.focus():te.focus()}},"onKey");return window.addEventListener("keydown",J,!0),()=>window.removeEventListener("keydown",J,!0)},[y,N]),y===null)return null;let lt=t(()=>{N||(oe(null),wt(null))},"close"),$e=t(()=>{pe(!0),oe(null);let ee=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(ue=>ue.workspaceId===y.workspaceId),O=n.sessions.list?.getSnapshot?.()?.byId??{},te=new Set(n.workspaces.list?.getSnapshot?.()?.archivedSessionIds??[]),ve=(ee?.sessionIds??[]).filter(ue=>xn(ue,O,te));jn(n.workspaces,ve,I).then(ue=>{if(pe(!1),ue.failures.length>0){oe(nn(ue.failures,g));return}wt(null)}).catch(ue=>{pe(!1),oe(Qn(ue,g))})},"confirm");return(0,a.jsxs)("div",{className:"dsham_sidebarCardRoot",children:[(0,a.jsx)("div",{className:"dsham_sidebarCardBackdrop",onClick:lt}),(0,a.jsxs)("div",{ref:re,role:"dialog","aria-modal":!0,"aria-label":g("menu.archiveWorkspace"),tabIndex:-1,className:"dsham_sidebarCard",style:De?{top:De.top,left:De.left,visibility:"visible"}:{visibility:"hidden",top:0,left:0},children:[(0,a.jsx)("h3",{className:"dsham_sidebarCardTitle",children:g("archiveWorkspace.title",{n:y.count})}),(0,a.jsx)("p",{className:"dsham_sidebarCardDesc",children:g("archiveWorkspace.desc",{name:y.title})}),N&&(0,a.jsx)("div",{className:"dsham_sidebarCardDesc",role:"status",children:g("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:be,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnCancel",disabled:N,onClick:lt,children:g("cancel")}),(0,a.jsx)("button",{ref:Ae,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnDanger",disabled:N,onClick:$e,children:g("archiveWorkspace.confirm")})]})]})]})}t(fe,"ArchiveWorkspaceOverlay");function St(g){if(typeof document>"u"||typeof document.addEventListener!="function"||typeof MutationObserver>"u")return()=>{};let y=null,N=!1,pe=new Map,Se=!1,oe=t(O=>{let ve=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(ze=>ze.workspaceId===O);if(ve===void 0)return[];let ue=n.sessions.list?.getSnapshot?.()?.byId??{},Oe=new Set(n.workspaces.list?.getSnapshot?.()?.archivedSessionIds??[]);return ve.sessionIds.filter(ze=>xn(ze,ue,Oe))},"workspaceCandidateIds"),De=t(()=>{if(Se=!1,!N)for(let[O,te]of pe){if(!O.isConnected){pe.delete(O);continue}let ve=oe(te.workspaceId).length===0;O.disabled=ve,O.style.opacity=ve?"0.5":"",O.style.cursor=ve?"not-allowed":""}},"revalidateItems"),Pe=t(()=>{if(pe.size===0||Se||N)return;Se=!0;let O=t(()=>De(),"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(O):setTimeout(O,16)},"scheduleRevalidate"),re=t(O=>{y=rr(O.target)},"rememberWorkspace");document.addEventListener("pointerdown",re,!0),document.addEventListener("click",re,!0);let be=t(()=>{if(N)return;for(let[te]of pe)te.isConnected||pe.delete(te);let O=document.querySelectorAll('[role="menu"]');for(let te of O){if(te.querySelector('[data-dsham-archive-workspace="true"]'))continue;let ve=Array.from(te.querySelectorAll('button[role="menuitem"]'));if(ve.length===0)continue;let ue=ve.find(qe=>kn(qe,!1))??ve.find(qe=>kn(qe,!0));if(!ue)continue;let Oe=ve.find(qe=>qe!==ue)??ue,ze=ue.parentElement;if(!ze)continue;let Le=y;if(!Le)continue;let Re=oe(Le.workspaceId).length,Ce=document.createElement("div");Ce.className=ze.className;let le=document.createElement("button");le.type="button",le.setAttribute("role","menuitem"),le.dataset.dshamArchiveWorkspace="true",le.className=Oe.className.split(/\s+/).filter(qe=>!/(?:^|[_-])danger(?:$|[_-])/i.test(qe)).join(" ");let tt=Oe.querySelector("span"),ct=Oe.querySelectorAll("span")[1],We=document.createElement("span");We.setAttribute("aria-hidden","true"),tt?.className&&(We.className=tt.className),We.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 Ue=document.createElement("span");ct?.className&&(Ue.className=ct.className),Ue.textContent=g("menu.archiveWorkspace"),le.append(We,Ue),Ce.append(le),Re===0&&(le.disabled=!0,le.style.opacity="0.5",le.style.cursor="not-allowed"),le.addEventListener("click",qe=>{qe.preventDefault(),qe.stopPropagation();let _t=oe(Le.workspaceId).length;_t!==0&&(document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),wt({workspaceId:Le.workspaceId,title:Le.title,count:_t}))}),ze.parentNode?.insertBefore(Ce,ze),pe.set(le,{workspaceId:Le.workspaceId})}},"checkAndInject"),Ae=!1,lt=t(()=>{if(Ae||N)return;Ae=!0;let O=t(()=>{Ae=!1,!N&&be()},"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(O):setTimeout(O,16)},"scheduleInject"),$e=new MutationObserver(O=>{An(O,'[role="menu"]')&&lt()});$e.observe(document.body,{childList:!0,subtree:!0});let J=n.sessions.list?.subscribe?.(Pe),ee=n.workspaces.list?.subscribe?.(Pe);return()=>{N=!0,document.removeEventListener("pointerdown",re,!0),document.removeEventListener("click",re,!0),$e.disconnect(),J?.(),ee?.(),pe.clear();for(let O of document.querySelectorAll('[data-dsham-archive-workspace="true"]'))O.parentElement?.remove()}}t(St,"setupWorkspaceMenuInjector");function Vt(){return typeof n.slots.entries!="function"?!1:n.slots.entries("sidebar.workspaces").some(g=>g.children?.[we]!==void 0)}t(Vt,"hostSidebarDeclaresSessionMenu");let W,Ne,et,q,$t=t(()=>{let g=Vt()?"menu":"waiting";g!==W&&(W=g,g==="menu"&&(Ne??=n.slots.inject(we,()=>n.slots.register({name:we,id:"archive-manager.delete-session",order:500,locale:He,inject:t(()=>({}),"inject")},Xe)),et??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.delete-session",locale:He,inject:t(()=>({t:n.locale.bind(He)}),"inject")},it)),q??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.archive-workspace",locale:He,inject:t(()=>({t:n.locale.bind(He)}),"inject")},fe))))},"reconcileSidebar");$t(),n.effect(()=>St(n.locale.bind(He)),"archive-manager: workspace menu injector"),dr(n);let Ie=typeof n.on=="function"?n.on("slots/changed",g=>{if(g==="sidebar.workspaces")try{$t()}catch(y){console.warn("archive-manager: sidebar mode switch failed",y)}}):void 0;n.effect(()=>()=>{Ie?.(),Ne?.(),et?.(),q?.()},"archive-manager: sidebar mode");let xt=t(()=>({archiveSessions:de,archiveSession:t((g,y)=>n.workspaces.archiveSession(g,y),"archiveSession"),sessionStore:Rn(n.sessions.list),workspaceStore:Rn(n.workspaces.list),unarchiveSession:st,deleteSession:$,unarchiveSessions:Mt,deleteArchivedSessions:an,archivedSessionMetadata:Qe,openConversation:m,focusSessionWorkspace:C,viewState:i,favoriteSessions:ie,setSessionFavorite:ht,organizeBatch:At,diagnoseOrphanSubagents:j,cleanOrphanSubagents:F,searchSessionContent:ge,searchArchivedContent:h,previewArchivedSession:Ee,t:n.locale.bind(He)}),"buildArchivedSectionProps"),Pt=Kn(n,{callApi:t(async(g,y)=>{let N=vn(`/api/michengai/dsh-archive-manager${g}`),pe=Object.assign({"content-type":"application/json","x-michengai-plugin-update":"1"},y?.headers),Se=await fetch(N,Object.assign({},y,{headers:pe})),oe=await Se.json();if(!Se.ok||!oe||oe.ok===!1)throw new Error((oe&&typeof oe=="object"&&typeof oe.error=="string"?oe.error:void 0)||`HTTP ${Se.status}`);return oe},"callSettingsApi"),renderPanel:t(g=>(0,a.jsx)(zt,Object.assign({},xt(),g)),"renderPanel"),injectProps:xt,ns:He,onOnlineUpdateChange:t(()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("dsham-update-toggle"))},"onOnlineUpdateChange")});n.effect(()=>()=>Pt.destroy(),"archive-manager: sidebar entry"),n.effect(()=>fs({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:Y,isEnabled:t(()=>Pt.isOnlineUpdateEnabled(),"isEnabled")}),"dsh-archive-manager: plugin update ui"),n.slots.inject("settings.section",()=>n.slots.register({name:"settings.section",id:"archived-sessions",order:45,label:t(()=>n.locale.bind(He)("archived.badge"),"label"),icon:"archive",locale:He,inject:xt},zt))}t(Xs,"applyWorkspaceBrowser");async function ea(n,r,i,u){try{await r(n)}catch(p){i(As(p,u))}}return t(ea,"forkWithFeedback"),o.__test={forkWithFeedback:ea,unarchivedSessionIds:vr,ArchiveSelectionToolbar:ur,ArchivedSessionsSection:zt,zh:wr,en:Sr,displayTitle:Me,sessionVisible:Te,indexSubagentDescendants:Je,isUnknownSessionError:yt,deriveGroups:zs,deriveFlat:Ms,deriveSearchResults:Ps,deriveArchivedGroups:yr,sortArchivedGroups:br,deriveArchivedBatchIds:Wt,archivedSessionIdsInGroups:mr,pruneArchivedSelection:gr,toggleArchivedSelection:Tn,archivedDeleteFeedback:fr,isWorkspaceTaskCandidate:xn,isWorkspaceDeleteMenuItem:kn,workspaceMenuTriggerFrom:rr,applySettingsNavIcon:lr,restoreSettingsNavIcon:cr,installSettingsNavIcon:dr,mutationTouches:An,activeSessionActivity:rn,activeSessionRefusal:Xn,activeArchiveFromMessage:er,archiveSessionsViaOfficial:jn,unarchiveSessionsViaOfficial:kr,createUnarchiveSession:xr,createWorkspaceViewStore:ne,migrateWorkspaceViewPersist:E,WORKSPACE_VIEW_PERSIST_KEY:Nt,LEGACY_WORKSPACE_VIEW_PERSIST_KEY:Dt,bindObservable:Rn,groupByWorkspace:nr,byRecency:me,ARCHIVE_MANAGER_REMOTE:L,currentSessionId:dt,setupSidebarEntry:Kn},o.apply=Qs,o.inject=Js,s.exports}t(Ka,"startArchiveClient");
21
+ `;function Us(){if(typeof document>"u"||typeof document.getElementById!="function"||document.getElementById(Bs)!==null||typeof document.createElement!="function")return;let t=document.createElement("style");t.id=Bs,t.textContent=vi,(document.head??document.documentElement)?.appendChild?.(t)}e(Us,"ensureSidebarEntryStyle");function yi(t){let s=t&&typeof t.size=="number"?t.size:16;return tt(cn.IconArchiveOutlineMedium,{size:s})}e(yi,"ArchiveSidebarIcon");function bi(t){Us();let{t:s,enabled:o,onToggle:f,disabled:a,onlineUpdateEnabled:l=!0,onToggleOnlineUpdate:c,onlineUpdateDisabled:E,onlineUpdateLocked:y=!1}=t,R=[tt("div",{key:"sidebar-entry",className:"dsham_bundle_row"},tt("div",{className:"dsham_bundle_label_box"},tt("span",{className:"dsham_bundle_title"},s("sidebar.entry.title")),tt("span",{className:"dsham_bundle_desc"},s("sidebar.entry.desc"))),tt(cn.Switch,{checked:o,onChange:f,label:s("sidebar.entry.toggle"),disabled:a}))];if(typeof c=="function"){let w=y?`${s("update.entry.desc")} (${s("update.entry.locked")})`:s("update.entry.desc");R.push(tt("div",{key:"online-update",className:"dsham_bundle_row"},tt("div",{className:"dsham_bundle_label_box"},tt("span",{className:"dsham_bundle_title"},s("update.entry.title")),tt("span",{className:"dsham_bundle_desc"},w)),tt(cn.Switch,{checked:l,onChange:c,label:s("update.entry.toggle"),disabled:E||y,title:y?s("update.entry.locked"):void 0})))}return tt(as,null,R)}e(bi,"ArchiveBundleConfigCard");function wi(t){let[s,o]=qt(t.getEnabled),[f,a]=qt(t.getOnlineUpdateEnabled?t.getOnlineUpdateEnabled:()=>!0),[l,c]=qt(t.getOnlineUpdateLocked?t.getOnlineUpdateLocked:()=>!1),[E,y]=qt(!1),[R,w]=qt(!1);os(()=>{let T=e(()=>{o(t.getEnabled()),t.getOnlineUpdateEnabled&&a(t.getOnlineUpdateEnabled()),t.getOnlineUpdateLocked&&c(t.getOnlineUpdateLocked())},"syncState");return T(),t.subscribe(T)},[t]);let v=e(T=>{y(!0),o(T),t.setSidebar(T).catch(()=>{o(t.getEnabled())}).finally(()=>{y(!1)})},"onToggleSidebar"),x=t.setOnlineUpdate?T=>{t.getOnlineUpdateLocked?.()||(w(!0),a(T),t.setOnlineUpdate(T).catch(()=>{t.getOnlineUpdateEnabled&&a(t.getOnlineUpdateEnabled())}).finally(()=>{w(!1)}))}:void 0;return tt(bi,{t:t.t,enabled:s,disabled:E,onToggle:v,onlineUpdateEnabled:f,onlineUpdateDisabled:R||l,onlineUpdateLocked:l,onToggleOnlineUpdate:x})}e(wi,"ArchiveBundleConfigCardWrapper");function cr(t,s){if(Us(),!t.locale)return{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"),destroy:e(()=>{},"destroy")};let{callApi:o,renderPanel:f,ns:a}=s,l=!1,c=!1,E=!1,y=null,R=null,w=0,v=!1,x,T=new Set,N=e(()=>{if(!v)for(let U of T)try{U()}catch{}},"notify"),B=e(()=>{if(v||!E||!l||y)return;let U=t.slots.register({name:"main",key:lr,locale:a,inject:e(()=>{let de=typeof s.injectProps=="function"?s.injectProps():{};return Object.assign({t:t.locale?.bind?t.locale.bind(a):void 0},de)},"inject")},de=>tt("div",{className:"dsham_mainPanel"},f(de)));y=typeof U=="function"?U:()=>{}},"mountMain"),F=e(()=>{if(y){try{y()}catch{}y=null}},"unmountMain"),H=e(()=>{if(v||!c||!l||R)return;let U=t.slots.register({name:"sidebar.panellist",id:lr,order:gi,label:e(()=>t.locale.bind(a)("archives.title"),"label"),locale:a},de=>yi(de&&typeof de=="object"&&"size"in de?de:void 0));R=typeof U=="function"?U:()=>{}},"mountRow"),De=e(()=>{if(R){try{R()}catch{}R=null}},"unmountRow"),ne=e(()=>{if(!v)if(l)B(),H();else{if(x?.panelInfo&&typeof x.selectPanel=="function")try{x.panelInfo.getSnapshot().activePanelId===lr&&x.selectPanel(null)}catch{}De(),F()}},"sync"),re=e(async U=>{if(v)return l;let de=++w;l=U,ne(),N();try{return await o("/sidebar-entry",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:U})}),U}catch(at){throw de===w&&(l=!U,ne(),N()),at}},"setEnabled"),se=!0,ie=!1,Ne=0,ce=e(async U=>{if(v||ie)return se;let de=++Ne;if(se=U,N(),typeof s.onOnlineUpdateChange=="function")try{s.onOnlineUpdateChange(U)}catch{}try{if(await o("/online-update",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:U})}),de===Ne&&typeof s.onOnlineUpdateChange=="function")try{s.onOnlineUpdateChange(U)}catch{}return U}catch(at){if(de===Ne&&(se=!U,N(),typeof s.onOnlineUpdateChange=="function"))try{s.onOnlineUpdateChange(!U)}catch{}throw at}},"setOnlineUpdate"),Z=w;o("/sidebar-entry").then(U=>{!v&&w===Z&&U&&typeof U.enabled=="boolean"&&(l=U.enabled,ne(),N())}).catch(()=>{});let xt=Ne;o("/online-update").then(U=>{if(!v&&Ne===xt&&U&&typeof U.enabled=="boolean"&&(se=U.enabled,U.locked===!0&&(ie=!0),N(),typeof s.onOnlineUpdateChange=="function"))try{s.onOnlineUpdateChange(se)}catch{}}).catch(()=>{});let Re=t;return typeof Re.inject=="function"&&Re.inject(["layout"],U=>{!v&&U.layout&&(x=U.layout)}),t.slots.inject("main",()=>{if(!v)return E=!0,B(),()=>{E=!1,F()}}),t.slots.inject("sidebar.panellist",()=>{if(!v)return c=!0,H(),()=>{c=!1,De()}}),t.slots.inject("plugins.bundle.config",()=>{if(!v)return t.slots.register({name:"plugins.bundle.config",key:fi,locale:a},U=>U&&U.view==="summary"?null:tt(wi,{t:t.locale.bind(a),getEnabled:e(()=>l,"getEnabled"),setSidebar:re,getOnlineUpdateEnabled:e(()=>se,"getOnlineUpdateEnabled"),setOnlineUpdate:ce,getOnlineUpdateLocked:e(()=>ie,"getOnlineUpdateLocked"),subscribe:e(de=>(T.add(de),()=>{T.delete(de)}),"subscribe")}))}),{isEnabled:e(()=>l,"isEnabled"),isSupported:e(()=>c,"isSupported"),setEnabled:re,isOnlineUpdateEnabled:e(()=>se,"isOnlineUpdateEnabled"),isOnlineUpdateLocked:e(()=>ie,"isOnlineUpdateLocked"),setOnlineUpdate:ce,destroy:e(()=>{v||(v=!0,w++,Ne++,x=void 0,T.clear(),De(),F())},"destroy")}}e(cr,"setupSidebarEntry");function dr(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(dr,"checkedId");var Si={parse(t){let s=le(t);if(!s||typeof s!="object"||typeof s.favorite!="boolean")throw new TypeError("\u6536\u85CF\u72B6\u6001\u5FC5\u987B\u4E3A\u5E03\u5C14\u503C");return{sessionId:dr(s.sessionId),favorite:s.favorite}}},ki={parse(t){let s=le(t);if(!s||!Array.isArray(s.favoriteSessionIds)||s.favoriteSessionIds.length>1e5)throw new TypeError("\u6536\u85CF\u96C6\u5408\u65E0\u6548");return{favoriteSessionIds:[...new Set(s.favoriteSessionIds.map(dr))]}},safeParse(t){try{return{success:!0,data:this.parse(t)}}catch(s){return{success:!1,error:s}}}};function Hs(){let t=e((s,o)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${s}`,create:e(()=>o,"create"),schema:o}),"codec");return["favoriteSessions","setSessionFavorite"].map(s=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${s}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:s,invocation:{kind:"direct"},parameters:s==="favoriteSessions"?[]:[{name:"input",wire:"input",source:"json",codec:t("FavoriteInput",Si)}],result:t("FavoriteState",ki),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}e(Hs,"favoriteInvocations");function ur(t,{days:s,now:o=Date.now(),favorites:f=new Set,currentId:a,pending:l=new Map}){if(!t||!Number.isInteger(s)||s<1||s>36500||f.has(t.id)||t.id===a||(t.retainedBy?.mainView??0)>0||t.running||(t.runningSubagentCount??0)>0||t.pendingInteraction!=null||l.has(t.id))return!1;let c=typeof t.updatedAt=="number"?t.updatedAt:Date.parse(t.updatedAt??"");return Number.isFinite(c)&&c<=o-s*864e5}e(ur,"idleArchiveCandidate");async function _n(t,s,{onProgress:o,refresh:f}={}){let a=[...new Set(t.map(dr))],l={requested:a,succeeded:[],skipped:[],failures:[],remaining:[],refreshError:null},c=e(()=>o?.({total:a.length,done:l.succeeded.length+l.skipped.length+l.failures.length,succeeded:l.succeeded.length,skipped:l.skipped.length,failed:l.failures.length}),"report");c();for(let E of a){try{(await s(E)?l.succeeded:l.skipped).push(E)}catch(y){l.failures.push({sessionId:E,message:y instanceof Error?y.message:String(y)}),l.remaining.push(E)}c()}try{await f?.()}catch(E){l.refreshError=E instanceof Error?E.message:String(E)}return l}e(_n,"runSessionBatch");function Ws({workspaces:t,sessions:s,archive:o,restore:f,deleteOne:a,getFavorites:l,refresh:c,currentSessionId:E}){return async(y,R,w={})=>{if(!["archive","restore","undo","delete"].includes(y))throw new TypeError("\u672A\u77E5\u6279\u91CF\u64CD\u4F5C");return _n(R,async v=>{let T=t.getSnapshot().archivedSessionIds.includes(v);if(y==="archive"){if(T||!s.getSnapshot().byId[v])return!1;if(w.idleDays!==void 0){let De=new Set((await l()).favoriteSessionIds),ne=s.getSnapshot();if(!ur(ne.byId[v],{days:w.idleDays,favorites:De,currentId:E(ne),pending:w.getPending?.()??w.pending}))return!1}return await o(v),t.getSnapshot().archivedSessionIds.includes(v)}return T?y==="delete"?(await a(v),!0):!((await f(v))?.archivedSessionIds??t.getSnapshot().archivedSessionIds).includes(v):!1},{onProgress:w.onProgress,refresh:c})}}e(Ws,"createSessionOrganizer");function xi(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(xi,"formatBytes");function qs(t,s){let o=t.createElement;function f(l,c){return o(s??(y=>o("button",{type:"button",disabled:y.disabled,onClick:y.onClick},y.children)),{variant:"outline",size:"sm",...c},l)}e(f,"textButton");function a({title:l,failures:c,separator:E}){let[y,R]=t.useState(!1),w=o("ul",null,c.map(v=>o("li",{key:v.sessionId},v.sessionId,E,v.message)));return o(An,{title:l,open:y,onToggle:e(()=>R(v=>!v),"onToggle")},w)}return e(a,"FailureDetails"),e(function({t:c,archived:E,busy:y,ready:R,days:w,onDays:v,count:x,onPreview:T,progress:N,result:B,onRetry:F,undoCount:H,onUndo:De,onReload:ne,orphanCount:re=0,orphanSizeBytes:se=0,orphanCleaning:ie=!1,onCleanOrphans:Ne,cacheCount:ce=0,cacheRepair:Z,onRebuildCaches:xt,onRetryCaches:Re,onReloadCaches:U,onDismissCaches:de}){return o(t.Fragment,null,o("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}"),(!E||!R)&&o("div",{className:"dsham_organizer"},o("div",{className:"dsham_organizerControls"},!R&&f(c("organizer.reloadFavorites"),{disabled:y,onClick:ne}),!E&&o(t.Fragment,null,o("label",null,c("organizer.idleDays"),o(cs,{min:1,max:36500,value:w===""?null:Number(w),disabled:y,"aria-label":c("organizer.idleDays"),onChange:e(at=>v(at==null?"":String(at)),"onChange")})),f(c("organizer.preview",{n:x}),{disabled:y||!R||x===0,onClick:T}))),!E&&o("p",null,c("organizer.rules"))),re>0&&o("div",{className:"dsham_organizer"},o("div",{className:"dsham_organizerControls"},o("strong",null,c("organizer.orphanTitle",{n:re})),Ne&&f(c(ie?"organizer.cleaning":"organizer.cleanOrphans"),{disabled:y||ie,onClick:Ne})),o("p",null,c("organizer.orphanDesc",{size:xi(se)}))),ce>0&&o("div",{className:"dsham_organizer"},o("div",{className:"dsham_organizerControls"},o("strong",null,c("organizer.cacheTitle",{n:ce})),xt&&f(c(Z?.busy?"organizer.cacheRebuilding":"organizer.cacheRebuild"),{disabled:y||Z?.busy,onClick:xt})),o("p",null,c("organizer.cacheDesc"))),Z&&(Z.result||Z.progress||Z.error||Z.refreshError)&&o("section",{className:"dsham_batchFeedback","aria-label":c("organizer.cacheRebuild")},Z.progress&&o("div",{role:"status"},o("progress",{value:Z.progress.done,max:Math.max(1,Z.progress.total)}),c("organizer.progressCount",Z.progress)),Z.result&&o("div",{role:"status"},o("p",null,c("organizer.result",{succeeded:Z.result.rebuiltSessionIds.length,skipped:Z.result.skippedSessionIds.length,failed:Z.result.failures.length})),Z.result.failures.length>0&&o(a,{title:c("organizer.failureDetails"),failures:Z.result.failures,separator:c("common.separator")}),Z.result.failures.length>0&&Re&&f(c("organizer.cacheRetry",{n:Z.result.failures.length}),{disabled:y||Z.busy,onClick:Re})),Z.error&&o("p",{role:"alert"},c("organizer.cacheError",{detail:Z.error})),Z.refreshError&&o("p",{role:"alert"},c("organizer.refreshError",{detail:Z.refreshError})),o("div",{className:"dsham_organizerControls"},U&&f(c("organizer.cacheCheck"),{disabled:y||Z.busy,onClick:U}),de&&f(c("organizer.dismiss"),{disabled:y||Z.busy,onClick:de}))),(N||B||H>0)&&o("section",{className:"dsham_batchFeedback","aria-label":c("organizer.feedback")},N&&o("div",{role:"status","aria-live":"polite"},o("progress",{value:N.done,max:Math.max(1,N.total),"aria-label":c("organizer.progress")}),c("organizer.progressCount",{done:N.done,total:N.total})),B&&o("div",{role:"status"},o("strong",null,c(`organizer.${B.kind??"archive"}Result`)),o("p",null,c("organizer.result",{succeeded:B.succeeded.length,skipped:B.skipped.length,failed:B.failures.length})),B.failures.length>0&&o(a,{title:c("organizer.failureDetails"),failures:B.failures,separator:c("common.separator")}),B.refreshError&&o("p",{role:"alert"},c("organizer.refreshError",{detail:B.refreshError})),B.remaining.length>0&&f(c("organizer.retry",{n:B.remaining.length}),{disabled:y,onClick:F})),H>0&&o("div",{className:"dsham_organizerControls"},f(c("organizer.undo",{n:H}),{disabled:y,onClick:De}),o("p",null,c("organizer.undoHint")))))},"OrganizerPanel")}e(qs,"createOrganizerPanel");var Vs={"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"},Gs={"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."},$s={"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 Gt=Function("return globalThis.__dshArchiveReactDOM")(),Ks=Function("return globalThis.__dshArchiveReactDOMClient")(),Ys=Gt.createPortal,Go=Gt.flushSync,$o=Ks?.createRoot,Ko=Ks?.hydrateRoot,Yo=Gt.findDOMNode,Zo=Gt.unmountComponentAtNode,Jo=Gt.unstable_batchedUpdates,Qo=Gt.version;function Ci(t){var s={exports:{}},o=s.exports;Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});let f=t("@deepseek-ai/dsh-client-store"),a=t("react/jsx-runtime"),l=t("react"),c=t("@deepseek-ai/dsh-client-ui-primitives");function E({open:n,onClose:r,title:i,description:u,footer:m,children:p,className:k,width:b}){let A=l.useRef(null),z=l.useCallback(()=>A.current?.closest(".dsham_settings")??document.body,[]),[I,D]=l.useState(null);l.useEffect(()=>{if(!n){D(null);return}D(z())},[n,z]),l.useEffect(()=>{if(!n)return;let h=e(ue=>{ue.key==="Escape"&&(ue.preventDefault(),ue.stopPropagation(),"stopImmediatePropagation"in ue&&typeof ue.stopImmediatePropagation=="function"&&ue.stopImmediatePropagation(),r())},"onKey");return window.addEventListener("keydown",h,!0),()=>window.removeEventListener("keydown",h,!0)},[n,r]);let P=(0,a.jsxs)("div",{className:"dsham_modalRoot",role:"presentation",children:[(0,a.jsx)("div",{className:"dsham_modalMask",onClick:r}),(0,a.jsxs)("div",{role:"dialog","aria-modal":!0,"aria-label":typeof i=="string"?i:void 0,className:Xs("dsham_modalDialog",k),style:{width:b??560},children:[(0,a.jsx)("h2",{children:i}),u!=null&&(0,a.jsx)("p",{children:u}),p!=null&&(0,a.jsx)("div",{className:"dsham_modalBody",children:p}),m!=null&&(0,a.jsx)("div",{className:"dsham_modalFooter",children:m})]})]});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y,{refObject:A,getContainer:z}),n&&I?Ys(P,I):null]})}e(E,"SettingsModal");function y({refObject:n,getContainer:r}){return(0,a.jsx)("span",{hidden:!0,ref:n,"data-get-container":r})}e(y,"SettingsModalAnchor");function R({variant:n="outline",icon:r,children:i,className:u,disabled:m,title:p,onClick:k,"aria-label":b,"aria-pressed":A,"aria-expanded":z,"aria-haspopup":I}){return(0,a.jsx)(c.Button,{variant:n,size:"sm",className:u,disabled:m,title:p,onClick:k,"aria-label":b,"aria-pressed":A,"aria-expanded":z,"aria-haspopup":I,icon:r,children:i})}e(R,"settingsButton");function w({variant:n="outline",danger:r=!1,disabled:i,onClick:u,children:m}){return(0,a.jsx)(c.Button,{variant:r?"outline":n,className:r?"dsham_btnDanger":void 0,disabled:i,onClick:u,children:m})}e(w,"modalFooterButton");function v(n,r){let i={className:n?"dsham_archiveTabsLocked":void 0,children:r};return n&&(i.inert=""),i}e(v,"tabsShell");let x=qs(l,c.Button),{HighlightedText:T,useArchiveSearch:N,useArchivePreview:B,DiscoveryFilters:F,SearchStatus:H,PreviewContent:De}=ws(l,{Button:c.Button,SegmentedControl:c.SegmentedControl}),ne={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 re(n){let r=document.createElement("span"),i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttribute("viewBox","0 0 16 16"),i.setAttribute("width","16"),i.setAttribute("height","16"),i.setAttribute("fill","none"),i.setAttribute("stroke","currentColor"),i.setAttribute("stroke-width","1.5"),i.setAttribute("stroke-linecap","round"),i.setAttribute("stroke-linejoin","round"),i.setAttribute("aria-hidden","true");for(let u of ne[n]){let m=document.createElementNS("http://www.w3.org/2000/svg","path");m.setAttribute("d",u),i.append(m)}return r.append(i),r}e(re,"createPluginUpdateIcon");let se={parse(n){if(typeof n!="string"||n.length===0)throw new TypeError(`sessionId must be a non-empty string, got ${String(n)}`);return n}},ie={parse(n){let r=le(n);if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError("result must be an object");let i=r.archivedSessionIds;if(!Array.isArray(i)||i.some(u=>typeof u!="string"))throw new TypeError("archivedSessionIds must be a string array");return r}},Ne={parse(n){let r=le(n);if(typeof r!="object"||r===null||Array.isArray(r)||r.deleted!==!0)throw new TypeError("deleted must be true");return r}},ce={parse(n){let r=le(n);if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError("target must be an object");if(r.scope==="all"||r.scope==="ungrouped"||r.scope==="workspace"&&typeof r.workspaceId=="string"&&r.workspaceId.length>0||r.scope==="sessions"&&Array.isArray(r.sessionIds)&&r.sessionIds.length>0&&r.sessionIds.every(i=>typeof i=="string"&&i.length>0))return r;throw new TypeError("target.scope must be all, ungrouped, workspace with a non-empty workspaceId, or sessions with non-empty sessionIds")}},Z={parse(n){let r=le(n);if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError("result must be an object");for(let i of["requestedSessionIds","deletedSessionIds","skippedSessionIds"])if(!Array.isArray(r[i])||r[i].some(u=>typeof u!="string"))throw new TypeError(`${i} must be a string array`);if(!Array.isArray(r.failures)||r.failures.some(i=>typeof i!="object"||i===null||typeof i.sessionId!="string"||typeof i.message!="string"))throw new TypeError("failures must contain sessionId/message objects");return r}},xt={parse(n){let r=le(n);if(typeof r!="object"||r===null||Array.isArray(r)||!Array.isArray(r.items))throw new TypeError("result.items must be an array");if(r.items.some(i=>typeof i!="object"||i===null||typeof i.sessionId!="string"||typeof i.createdAt!="number"||!Number.isFinite(i.createdAt)))throw new TypeError("items must contain sessionId/createdAt objects");return r}};function Re(n,r){return{mode:"strict",typeSymbol:n,create:e(()=>r,"create"),schema:r}}e(Re,"strictCodec");let U={package:"@michengai/dsh-archive-manager",descriptors:[...Hs(),...gs(),...As(),{id:"@michengai/dsh-archive-manager#workspaceRegistry/unarchiveSession",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"unarchiveSession",invocation:{kind:"direct"},parameters:[{name:"sessionId",wire:"sessionId",source:"json",codec:Re("@deepseek-ai/dsh-session/types#SessionId",se)}],result:Re("@michengai/dsh-archive-manager/types#ArchivedSessionIds",ie),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:Re("@deepseek-ai/dsh-session/types#SessionId",se)}],result:Re("@michengai/dsh-archive-manager/types#Deleted",Ne),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:Re("@michengai/dsh-archive-manager/types#ArchivedBatchTarget",ce)}],result:Re("@michengai/dsh-archive-manager/types#DeletedBatch",Z),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:Re("@michengai/dsh-archive-manager/types#ArchivedSessionMetadata",xt),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:Re("@michengai/dsh-archive-manager/types#OrphanSubagentDiagnosis",{parse(n){let r=le(n);if(!r||typeof r.count!="number"||!Array.isArray(r.items)||typeof r.totalSizeBytes!="number")throw new TypeError("invalid orphan subagent diagnosis");return r}}),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:Re("@michengai/dsh-archive-manager/types#CleanOrphanTarget",{parse(n){if(n==null)return{};let r=le(n);if(!r)throw new TypeError("target must be an object");if(r.sessionIds!==void 0&&(!Array.isArray(r.sessionIds)||r.sessionIds.some(i=>typeof i!="string")))throw new TypeError("sessionIds must be an array of strings");return r}})}],result:Re("@michengai/dsh-archive-manager/types#CleanOrphanResult",{parse(n){let r=le(n);if(!r||!Array.isArray(r.cleanedSessionIds)||!Array.isArray(r.skippedSessionIds)||!Array.isArray(r.failures))throw new TypeError("invalid orphan subagent clean result");return r}}),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}]};function de(n,r){if(typeof document>"u"||document.querySelector("style[data-plugin-css="+JSON.stringify(n)+"]")!==null)return;let i=document.createElement("style");i.dataset.plugin="@michengai/dsh-archive-manager",i.dataset.pluginCss=n,i.textContent=r,document.head.appendChild(i)}e(de,"ensurePluginStyle"),de("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)}"),de("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}"),de("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%))}.dsham_modalDialog{position:relative;display:flex;flex-direction:column;gap:12px;max-width:calc(100vw - 48px);max-height:min(80vh,720px);padding:22px 24px 20px;overflow:hidden;border:0;border-radius:var(--dsw-radius-panel,28px);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);box-shadow:var(--dsw-elevation-prominent,0 16px 40px rgb(0 0 0 / 24%))}.dsham_modalDialog h2{margin:0;font-size:16px;line-height:24px}.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}"),de("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}");let Nt="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 dn(n){return n?'<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="'+Nt+'"/></svg>':'<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linejoin="round" aria-hidden="true"><path d="'+Nt+'"/></svg>'}e(dn,"starSvg"),de("dsh-archive-manager/RowFavorite.css",".dsham_starSlot{display:none;align-items:center;justify-content:center;box-sizing:border-box;width:16px;min-width:16px;height:20px;flex:none;margin:0 3px 0 0}[data-row-key^='session:']:hover .dsham_starSlot,.dsham_starSlot[data-favorited='true']{display:inline-flex}.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:14px;height:14px;flex:none}");let _="dsh-archive-manager:workspace-favorites-only",J="data-dsham-favorites-hidden",Le="data-dsham-favorites-only",zt="dsham_rowStar",Bt="dsham_starSlot",jn=["\u4EC5\u663E\u793A\u5DF2\u5F52\u6863","Archived only","\u0422\u043E\u043B\u044C\u043A\u043E \u0430\u0440\u0445\u0438\u0432\u043D\u044B\u0435"];de("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 Dn(){try{return window.localStorage.getItem(_)==="1"}catch{return!1}}e(Dn,"readWorkspaceFavoritesOnly");function X(n){try{window.localStorage.setItem(_,n?"1":"0")}catch{}}e(X,"writeWorkspaceFavoritesOnly");function _e(n,r){let i=e(p=>r.favorites.has(p)||r.sessions?.[p]?.blank===!0,"visibleSession"),u=new Map,m=null;for(let p of n){if(p.startsWith("workspace:")){m=p,u.set(p,!1);continue}p.startsWith("session:")&&m!==null&&i(p.slice(8))&&u.set(m,!0)}return n.map(p=>p.startsWith("session:")?i(p.slice(8)):p.startsWith("workspace:")?u.get(p)===!0||r.groupHasFavorite?.(p.slice(10))===!0:!p.startsWith("overflow:"))}e(_e,"favoritesOnlyVisibility");function nt(n,r){let i=new Map,u=new Set;for(let p of r){let k=!1;for(let b of p.sessionIds)u.add(b),n.has(b)&&(k=!0);i.set(p.workspaceId,k)}let m=!1;for(let p of n)if(!u.has(p)){m=!0;break}return p=>p===""||p==="ungrouped"?m:i.get(p)===!0}e(nt,"favoriteGroupPredicate");function Kt(n,r,i){let u={dispose:e(()=>{},"dispose")};if(typeof document>"u"||typeof document.addEventListener!="function"||typeof MutationObserver>"u")return u;let m=Dn(),p=!1,k=!1,b=0,A=200,z=null,I=new Set,D=e(V=>{let ze=r.getSnapshot();for(let Ie of V){let fe=Ie.getAttribute("data-row-key")??"";if(!fe.startsWith("session:"))continue;let rt=fe.slice(8),Ke=Array.from(Ie.children).find(ee=>ee.tagName==="SPAN"&&Array.from(ee.classList).some(Je=>Je==="slot"||Je.endsWith("_slot")))??null;if(Ke===null)continue;let W=Array.from(Ie.children).find(ee=>ee.classList.contains(Bt))??null;if(!ze.ready){W?.remove();continue}W!==null&&W.previousElementSibling!==Ke&&(W.remove(),W=null),W===null&&(W=document.createElement("span"),W.className=Bt,Ke.after(W)),W.dataset.sessionId=rt;let q=W.querySelector("."+zt);q===null&&(q=document.createElement("button"),q.type="button",q.className=zt,q.addEventListener("click",ee=>{ee.preventDefault(),ee.stopPropagation(),r.toggle(W?.dataset.sessionId??"")}),W.appendChild(q));let Oe=ze.ids.has(rt);if(W.dataset.favorited===String(Oe))continue;let Ze=i()(Oe?"organizer.unfavorite":"organizer.favorite");W.dataset.favorited=String(Oe),q.setAttribute("aria-pressed",String(Oe)),q.setAttribute("aria-label",Ze),q.title=Ze,q.innerHTML=dn(Oe)}},"ensureRowStars"),P=e(V=>{let ze=r.getSnapshot();if(!m||!ze.ready){for(let W of V)W.hasAttribute(J)&&W.removeAttribute(J);b=0,z=null,I.clear();return}let Ie=V.map(W=>W.getAttribute("data-row-key")??""),fe=nt(ze.ids,n.workspaces.list?.getSnapshot?.()?.items??[]),rt=_e(Ie,{favorites:ze.ids,sessions:n.sessions.list?.getSnapshot?.()?.byId,groupHasFavorite:fe});z!==null&&(V.length<=z.rows&&I.add(z.key),z=null);let Ke=!1;if(b<A)for(let W=0;W<V.length;W+=1){let q=V[W],Oe=Ie[W];if(!Oe.startsWith("overflow:")||q.getAttribute("aria-expanded")!=="false")continue;let Ze=Oe.slice(9);if(!(I.has(Ze)||!fe(Ze))){try{q.click(),b+=1,z={key:Ze,rows:V.length},Ke=!0}catch(ee){console.warn("archive-manager: favorites-only expand failed",ee)}break}}for(let W=0;W<V.length;W+=1){let q=V[W];rt[W]?q.hasAttribute(J)&&q.removeAttribute(J):q.setAttribute(J,"true")}Ke&&me()},"applyVisibility"),h=e(V=>{let ze=V.parentElement;if(ze===null)return null;let Ie=ze.cloneNode(!0),fe=Ie.querySelector('button[role="menuitem"]');if(fe===null)return null;let rt=Array.from(fe.querySelectorAll("span")),Ke=rt[0]??null,W=rt[rt.length-1]??null;Ke!==null&&(Ke.innerHTML=dn(!1)),W!==null&&(W.textContent=i()("organizer.favoritesOnly"));for(let q of Array.from(fe.querySelectorAll("svg")))q.closest("span")===null&&q.remove();return fe.setAttribute(Le,"true"),fe.setAttribute("role","menuitemcheckbox"),fe.dataset.active=String(m),fe.setAttribute("aria-checked",String(m)),fe.setAttribute("aria-label",i()("organizer.favoritesOnly")),fe.onclick=q=>{q.preventDefault(),q.stopPropagation(),he(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0}))},Ie},"buildMenuRow"),ue=e(()=>{if(!p){for(let V of Array.from(document.querySelectorAll("button["+Le+"]")))V.dataset.active=String(m),V.setAttribute("aria-checked",String(m));for(let V of Array.from(document.querySelectorAll('[role="menu"]'))){let ze=Array.from(V.querySelectorAll('button[role="menuitem"]')).find(rt=>jn.some(Ke=>(rt.textContent??"").includes(Ke)));if(ze===void 0||V.querySelector("["+Le+"]")!==null)continue;let Ie=ze.parentElement;if(Ie===null)continue;let fe=h(ze);fe!==null&&Ie.parentElement?.insertBefore(fe,Ie.nextSibling)}}},"injectMenuRows"),me=e(()=>{if(k||p)return;k=!0;let V=e(()=>{if(k=!1,p)return;let ze=Array.from(document.querySelectorAll("[data-row-key]"));ue(),D(ze),P(ze),r.getSnapshot().ready||gt()},"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(V):setTimeout(V,16)},"schedulePass"),he=e(()=>{m=!m,it=20,b=0,z=null,I.clear(),X(m),me()},"toggle"),Ue=null,it=20,gt=e(()=>{Ue!==null||p||it<=0||(it-=1,Ue=setTimeout(()=>{Ue=null,r.ensure(),me()},600))},"scheduleRetry"),Y=new MutationObserver(V=>{vn(V,'[data-row-key], [role="menu"]')&&me()});Y.observe(document.body,{childList:!0,subtree:!0}),r.ensure().catch(()=>{});let be=[r.subscribe(()=>me()),typeof n.sessions.list?.subscribe=="function"?n.sessions.list.subscribe(()=>me()):null,typeof n.workspaces.list?.subscribe=="function"?n.workspaces.list.subscribe(()=>me()):null].filter(V=>typeof V=="function");return me(),{dispose(){p=!0,Y.disconnect();for(let V of be)V();for(let V of Array.from(document.querySelectorAll("["+J+"]")))V.removeAttribute(J);for(let V of Array.from(document.querySelectorAll("["+Le+"]")))V.parentElement?.remove();for(let V of Array.from(document.querySelectorAll("."+Bt)))V.remove();Ue!==null&&(clearTimeout(Ue),Ue=null)}}}e(Kt,"setupWorkspaceFavoritesOnly");function hr(){let n,r={ready:!1,ids:new Set,pending:new Set},i,u=0,m=new Set,p=e(b=>{r=b;for(let A of m)try{A()}catch(z){console.warn("archive-manager: favorite listener failed",z)}},"publish"),k=e((b,A)=>{let z=new Set(b);for(let h of r.pending)h!==A&&(r.ids.has(h)?z.add(h):z.delete(h));let I=new Set(r.pending);A!==void 0?I.delete(A):r.pending.size===0&&I.clear();let D=r.ids.size===z.size&&[...z].every(h=>r.ids.has(h)),P=r.pending.size===I.size&&[...I].every(h=>r.pending.has(h));D&&P&&r.ready||p({ready:!0,ids:z,pending:I})},"adopt");return{bind(b){n=b},subscribe(b){return m.add(b),()=>{m.delete(b)}},getSnapshot:e(()=>r,"getSnapshot"),adopt:e(b=>k(b),"adopt"),ensure(){return n===void 0||r.ready?Promise.resolve():i!==void 0?i:Date.now()<u?Promise.resolve():(i=n.favoriteSessions().then(b=>{k(b.favoriteSessionIds)}).catch(b=>{console.warn("archive-manager: load favorites failed, will retry",b),u=Date.now()+600}).finally(()=>{i=void 0}),i)},async toggle(b){if(n===void 0||!r.ready||r.pending.has(b))return;let A=r.ids.has(b),z=!A,I=new Set(r.ids);z?I.add(b):I.delete(b);let D=new Set(r.pending);D.add(b),p({ready:!0,ids:I,pending:D});try{let P=await n.setSessionFavorite({sessionId:b,favorite:z});if(!Array.isArray(P?.favoriteSessionIds))throw new TypeError("favorite response is missing favoriteSessionIds");k(P.favoriteSessionIds,b)}catch(P){console.warn("archive-manager: sidebar favorite toggle failed",P);let h=new Set(r.ids);A?h.add(b):h.delete(b);let ue=new Set(r.pending);ue.delete(b),p({ready:!0,ids:h,pending:ue})}}}}e(hr,"createFavoriteRowStore");function hn(n){let r=new Map;for(let i of Object.values(n)){if(i.origin!=="subagent")continue;let u=new Set,m=i;for(;m?.origin==="subagent"&&m.parentId!==void 0&&!u.has(m.id);){u.add(m.id);let p=r.get(m.parentId);p===void 0?r.set(m.parentId,{count:1,runningCount:i.running?1:0}):(p.count+=1,i.running&&(p.runningCount+=1)),m=n[m.parentId]}}return r}e(hn,"indexSubagentDescendants");let Ai="__flat_session_order__",pn="dsh.archive-manager.workspace.view.v1",pr="dsh.workspace.view.v5";function mr(n){let r=n??globalThis.localStorage;if(r==null||typeof r.getItem!="function"||typeof r.setItem!="function")return!1;try{if(r.getItem(pn)!=null)return!1;let i=r.getItem(pr);return i==null?!1:(r.setItem(pn,i),!0)}catch{return!1}}e(mr,"migrateWorkspaceViewPersist");function Zs(){return mr(),(0,f.defineStore)({init:e(()=>({groupBy:"workspace",orderBy:"updated",showArchived:!1,groupExpansion:{},sessionOrderByAccount:{},sessionUpdatedAtByAccount:{}}),"init"),persist:pn,actions:{setGroupBy:e((n,r)=>{n.groupBy=r},"setGroupBy"),setOrderBy:e((n,r)=>{n.orderBy=r},"setOrderBy"),setShowArchived:e((n,r)=>{n.showArchived=r===!0},"setShowArchived"),setGroupExpanded:e((n,r,i)=>{n.groupExpansion[r]=i},"setGroupExpanded"),retainAccountKeys:e((n,r)=>{let i=new Set(r);n.groupExpansion=Object.fromEntries(Object.entries(n.groupExpansion).filter(([u])=>i.has(u))),n.sessionOrderByAccount=Object.fromEntries(Object.entries(n.sessionOrderByAccount).filter(([u])=>i.has(u))),n.sessionUpdatedAtByAccount=Object.fromEntries(Object.entries(n.sessionUpdatedAtByAccount).filter(([u])=>i.has(u)))},"retainAccountKeys"),syncSessionOrderAccount:e((n,r,i,u)=>{n.sessionOrderByAccount[r]=i,n.sessionUpdatedAtByAccount[r]=u},"syncSessionOrderAccount"),setSessionOrder:e((n,r,i)=>{n.sessionOrderByAccount[r]=i},"setSessionOrder")}})}e(Zs,"createWorkspaceViewStore");function Js(){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(Js,"GithubMark16");function Qs(){let n=c.IconEditOutlineRegular;return(0,a.jsx)(n,{size:16})}e(Qs,"FeedbackIcon");function Nn({archiveSessions:n,archiveSession:r,sessionStore:i,workspaceStore:u,unarchiveSession:m,deleteSession:p,unarchiveSessions:k,deleteArchivedSessions:b,archivedSessionMetadata:A,openConversation:z,focusSessionWorkspace:I,viewState:D,close:P,t:h,diagnoseOrphanSubagents:ue,cleanOrphanSubagents:me,diagnoseSessionCaches:he,rebuildSessionCaches:Ue,refreshCacheLists:it,searchSessionContent:gt,searchArchivedContent:Y,previewArchivedSession:be,favoriteSessions:V,setSessionFavorite:ze,favoriteSync:Ie,organizeBatch:fe,useSessionPendingInteraction:rt,useSessionStatus:Ke}){let W=(0,l.useSyncExternalStore)(i.subscribe,i.getSnapshot),q=(0,l.useSyncExternalStore)(u.subscribe,u.getSnapshot),[Oe,Ze]=(0,l.useState)("archived"),ee=Oe==="archived",[Je,ct]=(0,l.useState)(null),[Jt,vt]=(0,l.useState)(null),[yt,Mt]=(0,l.useState)(null),Pt=e((d,C=null)=>{G(null),Me(null),Xe(!1),vt(C),ct(d)},"requestArchive"),Ht=e(()=>{K||(ct(null),vt(null),G(null))},"closeArchive"),ot=(0,l.useRef)(!1),[Ce,It]=(0,l.useState)(null),Qt=(0,l.useRef)(!1),[K,He]=(0,l.useState)(!1),[dt,G]=(0,l.useState)(null),[Xt,Me]=(0,l.useState)(null),Lt=e(d=>{G(null),Me(null),It(d)},"requestDelete"),[ut,en]=(0,l.useState)(D?.query??""),[Qe,Wt]=(0,l.useState)(D?.project??"all"),[bt,g]=(0,l.useState)(D?.sortBy??"updated"),[S,O]=(0,l.useState)({}),[te,Ee]=(0,l.useState)(()=>new Set),Q=(0,l.useRef)(new Set),[Ae,we]=(0,l.useState)([]),[Se,Te]=(0,l.useState)([]),[We,lt]=(0,l.useState)(!1),[wt,pe]=(0,l.useState)(!1),ae=(0,l.useRef)(!1),[M,oe]=(0,l.useState)(!1),[je,ke]=l.useState("content"),[qe,Ve]=l.useState(""),[Ye,ht]=l.useState(""),[Fe,Be]=(0,l.useState)(()=>new Set),[ge,Rt]=(0,l.useState)("30"),[pt,Xe]=(0,l.useState)(!1),[xe,st]=(0,l.useState)(null),[tn,bn]=(0,l.useState)(null),[Gn,wn]=(0,l.useState)([]),Et=(0,l.useRef)(!1),$n=(0,l.useRef)(null),Kn=la(rt??aa,Ke??ia,typeof Ke=="function"),Wr=(0,l.useRef)(Kn.pending);Wr.current=Kn.pending;let _t=(0,l.useMemo)(()=>new Set(Se),[Se]),_a=e(async()=>{if(V)try{let d=await V();Te(d.favoriteSessionIds),lt(!0),Ie?.adopt(d.favoriteSessionIds)}catch(d){lt(!1),G(Pe(d))}},"loadFavorites");(0,l.useEffect)(()=>{let d=!0;return V&&V().then(C=>{d&&(Te(C.favoriteSessionIds),lt(!0),Ie?.adopt(C.favoriteSessionIds))}).catch(C=>{d&&G(Pe(C))}),()=>{d=!1}},[V]),(0,l.useEffect)(()=>{if(Ie)return Ie.subscribe(()=>{let d=Ie.getSnapshot();d.ready&&(Te([...d.ids]),lt(!0))})},[Ie]);let Ta=e(async d=>{if(!(ae.current||K||!We)){ae.current=!0,pe(!0),G(null);try{let C=await ze({sessionId:d,favorite:!_t.has(d)});Te(C.favoriteSessionIds),Ie?.adopt(C.favoriteSessionIds)}catch(C){G(Pe(C))}finally{ae.current=!1,pe(!1)}}},"toggleFavorite"),Sn=e(async(d,C,{idle:$=!1,retry:ve=!1}={})=>{if(!(Et.current||ae.current||Q.current.size>0||!fe)){Et.current=!0,He(!0),G(null),Me(null),bn(null),d==="archive"&&!ve&&wn([]);try{let j=await fe(d,C,{idleDays:$?Number(ge):void 0,getPending:e(()=>Wr.current,"getPending"),onProgress:e(ye=>{st(ye),d==="archive"&&ye.total>0&&ye.done>=ye.total&&(ct(null),vt(null),Xe(!1))},"onProgress")});return bn({...j,kind:d,tab:Oe}),$n.current=j.remaining.length?{kind:d,ids:j.remaining,idle:$}:null,d==="archive"&&wn(ye=>[...new Set([...ye,...j.succeeded])]),(d==="undo"||d==="restore"||d==="delete")&&wn(ye=>ye.filter(et=>!j.succeeded.includes(et)&&!j.skipped.includes(et))),we(ye=>ye.filter(et=>!j.succeeded.includes(et)&&!j.skipped.includes(et))),d==="delete"&&Te(ye=>ye.filter(et=>!j.succeeded.includes(et))),j}catch(j){G(Pe(j))}finally{Et.current=!1,He(!1),st(null)}}},"executeBatch"),[qr,ja]=(0,l.useState)(null),[Vr,Da]=(0,l.useState)({diagnosis:{count:0,items:[]},busy:!1,progress:null,result:null,error:null,refreshError:null}),mt=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(!he||!Ue||!it)return;let d=Is({diagnose:he,rebuild:Ue,refresh:it});mt.current=d;let C=d.subscribe(()=>{Da(d.snapshot())});return d.load(),()=>{C(),d.dispose(),mt.current=null}},[he,Ue,it]),(0,l.useEffect)(()=>{mt.current?.snapshot().busy||mt.current?.load()},[q.archivedSessionIds]);let Gr=e(async(d=!1)=>{if(!(K||Et.current||!mt.current||mt.current.snapshot().busy)){Et.current=!0,He(!0);try{await mt.current.run(d)}finally{Et.current=!1,St.current&&He(!1)}}},"runCacheRebuild"),[$r,Kr]=(0,l.useState)(!1),Yr=e(()=>{typeof ue=="function"&&ue().then(ja).catch(d=>{console.warn("archive-manager: diagnose orphan subagents failed",d)})},"loadOrphans");(0,l.useEffect)(()=>{Yr()},[q.archivedSessionIds]);let Na=e(async()=>{if(!($r||typeof me!="function")){Kr(!0),G(null),Me(null);try{let d=await me({});(d.cleanedSessionIds.length>0||d.skippedSessionIds.length>0)&&Yr(),d.failures.length>0?(Me(null),G(fn(d.failures,h))):d.cleanedSessionIds.length>0&&(G(null),Me(h("organizer.orphanCleanSuccess",{n:d.cleanedSessionIds.length})))}catch(d){G(Pe(d))}finally{Kr(!1)}}},"cleanOrphans"),St=(0,l.useRef)(!0),Yn=(0,l.useRef)(!1);(0,l.useEffect)(()=>(St.current=!0,()=>{St.current=!1}),[]);let kn=e(async(d,C=!1)=>{if(K||Yn.current)return;Yn.current=!0,He(!0),G(null);let $=!1;try{await _s({prepare:C?async ve=>{await I?.(ve)}:void 0,restore:e(async ve=>{await m(ve),$=!0},"restore"),open:e(async ve=>{await z(ve),St.current&&P?.()},"open")},d.id,C,()=>St.current)}catch(ve){if(!St.current)return;if($){Ze("unarchived");let j=Tt.find(ye=>ye.sessions.some(et=>et.id===d.id));j!==void 0&&Wt(j.key)}G(Rs(ve,h))}finally{Yn.current=!1,St.current&&He(!1)}},"viewConversation");(0,l.useEffect)(()=>{D&&Object.assign(D,{query:ut,project:Qe,sortBy:bt})},[ut,Qe,bt,D]);let xn=(0,l.useMemo)(()=>ee?q.archivedSessionIds:Mr(W.byId,q.archivedSessionIds),[ee,W.byId,q.archivedSessionIds]),Tt=(0,l.useMemo)(()=>Pr(W.byId,q.items,xn,h("group.ungrouped")),[W.byId,q,xn,h]),za=e(d=>{K||Q.current.size>0||(ft.close(),Ze(d),we([]),ct(null),vt(null),G(null),Me(null),Wt("all"),en(""),d!=="archived"&&bt==="archived"&&g("updated"))},"switchTab"),Zr=e(async(d,C=!1)=>{if(!(ot.current||K||!d?.length)){if(fe){ot.current=!0;try{let $=await Sn("archive",d,{idle:C}),ve=$?.failures.map(j=>br(j.sessionId,j.message)).find(j=>j!==void 0);if(ve!==void 0&&typeof r=="function"){let j=W.byId[ve.sessionId];Mt({sessionId:ve.sessionId,title:j===void 0?ve.sessionId:Ge(j,h),kinds:ve.kinds.join(", ")}),ct(null),vt(null),G(null);return}$&&(ct(null),vt(null),Xe(!1))}finally{ot.current=!1}return}ot.current=!0,He(!0),G(null),Me(null);try{let $=await n(d);ct(null),vt(null),$.archivedSessionIdsAdded.length>0&&Me(h("archives.archiveSuccess",{n:$.archivedSessionIdsAdded.length})),$.failures&&$.failures.length>0?G(fn($.failures,h)):(we([]),Ze("archived"),Wt("all"),en(""))}catch($){let ve=yr($);if(ve!==void 0&&typeof r=="function"){let j=W.byId[ve.sessionId];Mt({sessionId:ve.sessionId,title:j===void 0?ve.sessionId:Ge(j,h),kinds:ve.kinds.join(", ")}),ct(null),vt(null),G(null)}else{let j=gn($);G(j===void 0?h("archives.archiveBatchFailed",{detail:$ instanceof Error?$.message:String($)}):h("archives.archiveActive",{kinds:j.join(", ")}))}}finally{ot.current=!1,He(!1)}}},"performArchive"),Oa=e(()=>Zr(Je,pt),"confirmArchive"),Ma=e(async d=>{G(null),Me(null);try{await fs(d.id),St.current&&Me(h("details.copied"))}catch(C){St.current&&G(typeof En(C)=="string"&&String(En(C)).startsWith("copy.")?h(String(En(C))):Pe(C))}},"copyId"),Zn=(0,l.useMemo)(()=>Lr(Tt,bt,S,h,ee?q.archivedSessionIds:void 0),[Tt,bt,S,h,ee,q.archivedSessionIds]);(0,l.useEffect)(()=>{if(K)return;let d=!1;return A().then(C=>{d||O(Object.fromEntries(C.items.map($=>[$.sessionId,$.createdAt])))}).catch(()=>{d||O({})}),()=>{d=!0}},[A,q.archivedSessionIds,K]),(0,l.useEffect)(()=>{Qe!=="all"&&!Tt.some(d=>d.key===Qe)&&Wt("all")},[Tt,Qe]);let Jr=!sr(qe,Ye),Qr=Zn.filter(d=>Qe==="all"||Qe===d.key).map(d=>({...d,sessions:d.sessions.filter(C=>(!M||_t.has(C.id))&&ys(C.updatedAt,qe,Ye))})).filter(d=>d.sessions.length),Jn=je==="content"&&!Jr,nn=N(Qr.flatMap(d=>d.sessions.map(C=>C.id)),ut,Jn,gt??Y),Qn=new Map(nn.items.map(d=>[d.sessionId,d])),ft=B(be,ee?q.archivedSessionIds:[]),Xr=ut.trim().toLocaleLowerCase(),rn=Qr.map(d=>({...d,sessions:d.sessions.filter(C=>!Xr||Ge(C,h).toLocaleLowerCase().includes(Xr)||Qn.has(C.id))})).filter(d=>d.sessions.length),es=We?rn.flatMap(d=>d.sessions).filter(d=>ur(d,{days:Number(ge),favorites:_t,currentId:kt(W),pending:Kn.pending})).map(d=>d.id):[],sn=(0,l.useMemo)(()=>Nr(rn),[rn]),Xn=(0,l.useMemo)(()=>new Set(Ae),[Ae]),Pa=(0,l.useMemo)(()=>{let d=new Set(q.archivedSessionIds);return Gn.reduce((C,$)=>C+(d.has($)?1:0),0)},[Gn,q.archivedSessionIds]),er=sn.filter(d=>Xn.has(d)).length,La=sn.length>0&&er===sn.length;(0,l.useEffect)(()=>{we(d=>zr(d,xn))},[xn]);let Fa=e((d,C)=>{we($=>Wn($,[d],C))},"toggleSessionSelection"),Ba=e(d=>{we(C=>Wn(C,sn,d))},"toggleVisibleSelection"),Ua=e(d=>{K||Q.current.has(d)||(Q.current.add(d),Ee(new Set(Q.current)),G(null),Me(null),m(d).catch(C=>{G(gr(C,h))}).finally(()=>{Q.current.delete(d),Ee(new Set(Q.current))}))},"onUnarchive"),ts=e(async d=>{if(!K){if(fe){let C=Zt(q.archivedSessionIds,q.items,d),$=await Sn("restore",C);return $&&{unarchivedSessionIds:$.succeeded}}He(!0),G(null),Me(null);try{let C=await k(d);return C.unarchivedSessionIds.length>0&&Me(h("archives.restoreSuccess",{n:C.unarchivedSessionIds.length})),C.failures&&C.failures.length>0&&G(fn(C.failures,h,gr)),C}catch(C){G(h("archives.restoreBatchFailed",{detail:C instanceof Error?C.message:String(C)}))}finally{He(!1)}}},"onBatchUnarchive"),Ha=e(async()=>{if(Ae.length===0)return;let d=await ts({scope:"sessions",sessionIds:Ae});if(d!==void 0){let C=new Set(d.unarchivedSessionIds);we($=>$.filter(ve=>!C.has(ve)))}},"onSelectedUnarchive"),ns=e(()=>{K||It(null)},"closeDelete");(0,l.useEffect)(()=>{if(Ce===null)return;let d=e(C=>{C.key==="Escape"&&(C.preventDefault(),C.stopPropagation(),"stopImmediatePropagation"in C&&typeof C.stopImmediatePropagation=="function"&&C.stopImmediatePropagation(),K||It(null))},"onKeyDown");return window.addEventListener("keydown",d,!0),()=>window.removeEventListener("keydown",d,!0)},[Ce,K]);let Wa=e(async()=>{if(K||Qt.current||Ce===null)return;if(Ce.kind!=="batch"){Qt.current=!0,He(!0),G(null),Me(null);try{await p(Ce.session.id),It(null)}catch(C){G(On(C,h))}finally{Qt.current=!1,He(!1)}return}if(Et.current||ae.current||Q.current.size>0)return;let{target:d}=Ce;if(d.scope==="sessions"&&Zt(q.archivedSessionIds,q.items,d).length===0){It(null);return}Et.current=!0,He(!0),G(null),Me(null),bn(null),st(null);try{let C=await b(d),$=Or(C,h);$.kind==="error"?G($.message):Me($.message);let ve=new Set([...C.deletedSessionIds,...C.skippedSessionIds]);wn(ye=>ye.filter(et=>!ve.has(et))),we(ye=>ye.filter(et=>!ve.has(et))),Te(ye=>ye.filter(et=>!ve.has(et)));let j=C.failures.map(ye=>ye.sessionId);$n.current=j.length>0?{kind:"delete",ids:j,idle:!1}:null,bn({requested:C.requestedSessionIds,succeeded:C.deletedSessionIds,skipped:C.skippedSessionIds,failures:C.failures,remaining:j,refreshError:"refreshError"in C&&typeof C.refreshError=="string"?C.refreshError:null,kind:"delete",tab:Oe}),It(null)}catch(C){G(On(C,h))}finally{Et.current=!1,He(!1)}},"confirmDelete"),At=Ce?.kind==="batch"?Ce.target.scope:null,qa=At==="ungrouped"?h("archives.deleteUngroupedTitle"):At==="workspace"?h("archives.deleteProjectTitle",{name:Ce?.kind==="batch"?Ce.title:""}):h(At==="sessions"?"archives.deleteSelectedTitle":"deleteSession.title"),rs=Ce===null?void 0:At==="ungrouped"?h("archives.deleteUngroupedDesc",{n:Ce.kind==="batch"?Ce.count:0}):At==="workspace"?h("archives.deleteProjectDesc",{name:Ce?.kind==="batch"?Ce.title:"",n:Ce.kind==="batch"?Ce.count:0}):At==="sessions"?h("archives.deleteSelectedDesc",{n:Ce.kind==="batch"?Ce.count:0}):h("deleteSession.desc",{name:Ge(Ce.kind==="session"?Ce.session:{},h)}),Va=h(At==="ungrouped"?"archives.deleteUngroupedConfirm":At==="workspace"?"archives.deleteProjectConfirm":At==="sessions"?"archives.deleteSelectedConfirm":"deleteSession.title");return(0,a.jsxs)("section",{className:"dsham_settings","aria-label":h("archives.title"),children:[(0,a.jsx)("style",{children:pa+ga+va+ya+ba}),(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:h("archives.title")}),(0,a.jsxs)("div",{className:"dsham_settingsLinks",children:[(0,a.jsx)(c.Button,{variant:"outline",size:"sm","aria-label":h("archives.viewProject"),icon:(0,a.jsx)(Js,{}),onClick:e(()=>window.open("https://github.com/MichengAI/dsh-archive-manager","_blank","noreferrer"),"onClick"),children:h("archives.viewProject")}),(0,a.jsx)(c.Button,{variant:"outline",size:"sm","aria-label":h("archives.feedback"),icon:(0,a.jsx)(Qs,{}),onClick:e(()=>window.open("https://github.com/MichengAI/dsh-archive-manager/issues","_blank","noreferrer"),"onClick"),children:h("archives.feedback")})]})]}),(0,a.jsx)("p",{className:"dsham_settingsIntro",children:h("archives.description")})]}),l.createElement("div",v(K||te.size>0,(0,a.jsx)(c.SegmentedTabs,{className:"dsham_archiveTabs",label:h("archives.title"),value:Oe==="unarchived"?"unarchived":"archived",onChange:e(d=>za(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:h("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:h("archives.tab.unarchived")})]}),id:"dsham-tab-unarchived",panelId:"dsham-archive-panel"}]})))]}),(0,a.jsxs)("div",{id:"dsham-archive-panel",role:"region","aria-label":h(Oe==="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)(Hn,{id:"dsham-favorite-filter",className:"dsham_srOnly",tabIndex:-1,"aria-hidden":!0,value:M?"favorites":"all",options:[{value:"all",label:h("organizer.allSessions")},{value:"favorites",label:h("organizer.favoritesOnly")}],onChange:e(d=>typeof oe=="function"&&oe(d==="favorites"),"onChange"),"aria-label":h("organizer.favoriteFilter")}),(0,a.jsx)(Hn,{id:"dsham-search-scope",className:"dsham_srOnly",tabIndex:-1,"aria-hidden":!0,value:je,options:[{value:"title",label:h("discovery.titleOnly")},{value:"content",label:h("discovery.titleAndContent")}],onChange:e(d=>typeof ke=="function"&&ke(d),"onChange"),"aria-label":h("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:ut,onChange:e(d=>en(d.target.value),"onChange"),placeholder:h(Jn?"discovery.searchPlaceholder":ee?"archives.searchPlaceholder":"archives.searchUnarchived"),"aria-label":h(Jn?"discovery.searchPlaceholder":ee?"archives.searchPlaceholder":"archives.searchUnarchived")}),(0,a.jsx)(wa,{id:"dsham-sort-filter",t:h,disabled:K,favoritesOnly:M,setFavoritesOnly:oe,favoriteBusy:K||wt||!We,sortBy:!ee&&bt==="archived"?"updated":bt,setSortBy:g,options:[...ee?[{value:"archived",label:h("archives.sortArchived")}]:[],{value:"updated",label:h("archives.sortUpdated")},{value:"created",label:h("archives.sortCreated")},{value:"alphabetical",label:h("archives.sortAlphabetical")}]}),(0,a.jsx)(Hn,{id:"dsham-project-filter",className:"dsham_projectFilter",value:Qe,title:Qe==="all"?h("archives.allProjects"):Zn.find(d=>d.key===Qe)?.title??Qe,options:[{value:"all",label:h("archives.allProjects")||"\u6240\u6709\u9879\u76EE",title:h("archives.allProjects")},...Zn.map(d=>({value:d.key,label:d.title,title:d.title}))],onChange:Wt,"aria-label":h("archives.projectFilter")}),l.createElement(F,{t:h,from:qe,to:Ye,onFrom:Ve,onTo:ht,invalid:Jr,onClear:e(()=>{Ve(""),ht("")},"onClear")})]})}),l.createElement("style",null,Ss),l.createElement(H,{state:nn,t:h}),fe&&(0,a.jsx)(x,{t:h,archived:ee,busy:K||wt||te.size>0,ready:We,days:ge,onDays:Rt,count:es.length,onPreview:e(()=>{Pt(es),Xe(!0)},"onPreview"),progress:xe,result:tn?.tab===Oe?tn:null,onRetry:e(()=>{let d=$n.current;d&&(d.kind==="delete"?Lt({kind:"batch",target:{scope:"sessions",sessionIds:d.ids},count:d.ids.length}):Sn(d.kind,d.ids,{idle:d.idle,retry:!0}))},"onRetry"),undoCount:Pa,onUndo:e(()=>Sn("undo",Gn,{retry:!0}),"onUndo"),onReload:_a,orphanCount:qr?.count??0,cacheCount:Vr.diagnosis.count,cacheRepair:Vr,onRebuildCaches:e(()=>Gr(),"onRebuildCaches"),onRetryCaches:e(()=>Gr(!0),"onRetryCaches"),onReloadCaches:e(async()=>{try{await it?.(),await mt.current?.load(),(mt.current?.snapshot().diagnosis.count??0)===0&&mt.current?.dismiss()}catch(d){St.current&&G(Pe(d))}},"onReloadCaches"),onDismissCaches:e(()=>mt.current?.dismiss(),"onDismissCaches"),orphanSizeBytes:qr?.totalSizeBytes??0,orphanCleaning:$r,onCleanOrphans:Na}),Tt.length>0&&(0,a.jsx)(Tr,{selectedCount:Ae.length,hiddenCount:Ae.length-er,allVisibleSelected:La,selectedVisibleCount:er,visibleCount:sn.length,busy:K,t:h,onToggle:Ba,onClear:e(()=>we([]),"onClear"),onArchive:ee?void 0:()=>Pt([...Ae]),onRestore:Ha,onDelete:e(()=>Lt({kind:"batch",target:{scope:"sessions",sessionIds:Ae},count:Ae.length}),"onDelete")}),Tt.length===0?(0,a.jsx)("div",{className:"dsham_settingsEmpty",children:h(ee?"archives.empty":"archives.emptyUnarchived")}):rn.length===0?(0,a.jsx)("div",{className:"dsham_settingsEmpty",children:nn.status==="loading"||nn.status==="error"||nn.failures.length?null:h("archives.emptyFiltered")}):rn.map(d=>{let C=xa(d.key),$=Tt.find(j=>j.key===d.key)?.sessions.map(j=>j.id)??[],ve=ee?Zt(q.archivedSessionIds,q.items,C).length:$.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":!Fe.has(d.key),"aria-controls":"dsham-group-"+encodeURIComponent(d.key),onClick:e(()=>Be(j=>{let ye=new Set(j);return ye.has(d.key)?ye.delete(d.key):ye.add(d.key),ye}),"onClick"),children:[(0,a.jsx)(Fe.has(d.key)?c.IconChevronRightOutlineMedium:c.IconChevronDownOutlineMedium,{}),(0,a.jsx)(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:h("archives.sessionCount",{n:d.sessions.length})}),(0,a.jsx)(ka,{group:d,busy:K,onArchive:ee?void 0:()=>Pt($,d),onRestore:e(()=>ts(C),"onRestore"),onDelete:e(()=>Lt({kind:"batch",target:C,title:d.title,count:ve}),"onDelete"),t:h})]})]}),(0,a.jsx)("div",{className:"dsham_settingsList",id:"dsham-group-"+encodeURIComponent(d.key),hidden:Fe.has(d.key)||void 0,children:!Fe.has(d.key)&&d.sessions.map(j=>(0,a.jsxs)("div",{className:"dsham_settingsRow","data-selected":Xn.has(j.id),children:[(0,a.jsx)(jr,{checked:Xn.has(j.id),disabled:K,label:h("archives.selectSession",{name:Ge(j,h)}),onChange:e(ye=>Fa(j.id,ye.target.checked),"onChange")}),(0,a.jsxs)("div",{className:"dsham_settingsContent",children:[(0,a.jsx)("button",{type:"button",className:"dsham_settingsTitleLink",title:Ge(j,h),"aria-label":h("archives.openSession")+h("common.separator")+Ge(j,h),disabled:K||te.has(j.id),onClick:e(()=>kn(j),"onClick"),children:Ge(j,h)}),(0,a.jsx)("div",{className:"dsham_settingsMeta",children:[ha(j.updatedAt,h)]}),Qn.has(j.id)&&l.createElement("button",{type:"button",className:"dsham_settingsSnippet",disabled:K,title:h(ee?"discovery.preview":"archives.openSession"),onClick:e(()=>ee?ft.open(j,ut):kn(j),"onClick")},l.createElement(T,{text:Qn.get(j.id)?.snippet??"",query:ut}))]}),(0,a.jsxs)("div",{className:"dsham_settingsActions",children:[typeof ze=="function"&&R({variant:"outline",className:"dsham_iconAction"+(_t.has(j.id)?" dsham_favoriteOn":""),title:h(_t.has(j.id)?"organizer.unfavorite":"organizer.favorite"),"aria-pressed":_t.has(j.id),"aria-label":h(_t.has(j.id)?"organizer.unfavorite":"organizer.favorite")+h("common.separator")+Ge(j,h),disabled:K||wt||!We,onClick:e(()=>Ta(j.id),"onClick"),children:(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:_t.has(j.id)?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round","aria-hidden":!0,style:{display:"block"},children:(0,a.jsx)("path",{d:Nt})})}),R({variant:"outline",className:"dsham_iconAction",title:h(ee?"archives.restore":"archives.archiveSelected"),"aria-label":h(ee?"archives.restore":"archives.archiveSelected"),disabled:K||te.has(j.id),onClick:e(()=>ee?Ua(j.id):Zr([j.id]),"onClick"),icon:(0,a.jsx)(ee?c.IconRefreshOutlineMedium:c.IconArchiveOutlineMedium,{size:16})}),ee&&(0,a.jsx)(Sa,{busy:K||te.has(j.id),t:h,title:Ge(j,h),onCopyId:e(()=>Ma(j),"onCopyId"),onPreview:typeof be=="function"?()=>ft.open(j,ut):void 0,onRestoreOpen:e(()=>kn(j,!0),"onRestoreOpen"),onDelete:e(()=>Lt({kind:"session",session:j}),"onDelete")})]})]},j.id))})]},d.key)}),l.createElement(E,{width:900,open:ft.target!==null,onClose:ft.close,title:ft.target?Ge(ft.target.session,h):h("discovery.preview"),footer:w({variant:"primary",disabled:K,onClick:e(()=>{if(ft.target){let d=ft.target.session;return ft.close(),kn(d)}},"onClick"),children:h("discovery.openFull")}),children:l.createElement(De,{preview:ft,t:h,MarkdownText:c.MarkdownText})}),Je===null&&dt!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:dt}),Xt!==null&&(0,a.jsx)("div",{className:"dsham_settingsStatus",role:"status",children:Xt}),(0,a.jsx)(E,{open:Je!==null,onClose:Ht,title:h("archives.archiveTitle",{n:Je?.length??0}),description:Jt===null?h("archives.archiveSelectedDesc"):h(Jt.key===yn?"archives.archiveUngroupedDesc":"archives.archiveProjectDesc",{name:Jt.title,n:Je?.length??0}),footer:(0,a.jsxs)(a.Fragment,{children:[w({disabled:K,onClick:Ht,children:h("cancel")}),w({variant:"primary",disabled:K||!Je?.length,onClick:Oa,children:h("archives.archiveSelected")})]}),children:(0,a.jsxs)(a.Fragment,{children:[fe&&(0,a.jsx)("p",{children:h(pt?"organizer.idleConfirm":"organizer.manualConfirm")}),fe&&(0,a.jsx)("div",{className:"dsham_archivePreview",children:(Je??[]).map(d=>(0,a.jsxs)("label",{children:[(0,a.jsx)(tr,{checked:!0,disabled:K,label:Ge(W.byId[d]??{id:d},h),onChange:e(()=>ct(C=>(C??[]).filter($=>$!==d)),"onChange")}),Ge(W.byId[d]??{id:d},h)]},d))}),xe&&(0,a.jsxs)("div",{role:"status",children:[(0,a.jsx)("progress",{value:xe.done,max:Math.max(1,xe.total)}),h("organizer.progressCount",{done:xe.done,total:xe.total})]}),dt!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:dt})]})}),(0,a.jsx)(E,{open:yt!==null,onClose:e(()=>{K||(Mt(null),G(null))},"onClose"),title:h("archiveActive.title"),...yt===null?{}:{description:h("archiveActive.desc",{name:yt.title,kinds:yt.kinds})},footer:(0,a.jsxs)(a.Fragment,{children:[w({disabled:K,onClick:e(()=>{K||(Mt(null),G(null))},"onClick"),children:h("cancel")}),w({danger:!0,disabled:K,onClick:e(async()=>{if(!(ot.current||K||yt===null||typeof r!="function")){ot.current=!0,He(!0),G(null);try{await r(yt.sessionId,{stopActivity:!0}),we(d=>d.filter(C=>yt===null||C!==yt.sessionId)),Ze("archived"),Me(h("archives.archiveSuccess",{n:1})),Mt(null)}catch(d){G(d instanceof Error?d.message:String(d))}finally{ot.current=!1,He(!1)}}},"onClick"),children:h("archiveActive.confirm")})]}),children:dt!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:dt})}),(0,a.jsx)(E,{open:Ce!==null,onClose:ns,title:qa,...rs===void 0?{}:{description:rs},footer:(0,a.jsxs)(a.Fragment,{children:[w({disabled:K,onClick:ns,children:h("cancel")}),w({danger:!0,disabled:K,onClick:Wa,children:Va})]}),children:(0,a.jsxs)(a.Fragment,{children:[K&&(0,a.jsxs)("div",{role:"status",children:[Ce?.kind==="batch"?h("archives.deleteBatchPending"):h("deleteSession.pending"),xe&&(0,a.jsx)("progress",{value:xe.done,max:Math.max(1,xe.total),"aria-label":h("organizer.progress")}),xe&&h("organizer.progressCount",{done:xe.done,total:xe.total})]}),dt!==null&&(0,a.jsx)("div",{className:"dsham_settingsError",role:"alert",children:dt})]})})]})]})}e(Nn,"ArchivedSessionsSection");function fr(n){var r,i,u="";if(typeof n=="string"||typeof n=="number")u+=n;else if(typeof n=="object")if(Array.isArray(n)){var m=n.length;for(r=0;r<m;r++)n[r]&&(i=fr(n[r]))&&(u&&(u+=" "),u+=i)}else for(i in n)n[i]&&(u&&(u+=" "),u+=i);return u}e(fr,"r");function Xs(...n){for(var r,i,u=0,m="",p=arguments.length;u<p;u++)(r=arguments[u])&&(i=fr(r))&&(m&&(m+=" "),m+=i);return m}e(Xs,"clsx");let zn="Ungrouped";function ea(n,r=zn){if(n===void 0||n==="")return r;let i=n.replace(/[/\\]+$/,"").split(/[/\\]/).pop();return i!==void 0&&i!==""?i:n}e(ea,"workspaceLabel");function Yt(n,r){return r.updatedAt!==n.updatedAt?r.updatedAt-n.updatedAt:n.id<r.id?-1:1}e(Yt,"byRecency");function Ut(n,r,i,u){return n.origin!=="subagent"&&(!i.has(n.id)||u===!0)&&(!n.blank||n.id===r)}e(Ut,"sessionVisible");function mn(n){let r=n instanceof Error?n.message:String(n);return r.includes("UNKNOWN_SESSION")||r.includes("no such session")}e(mn,"isUnknownSessionError");function On(n,r){if(mn(n))return r("deleteSession.unknown");let i=n instanceof Error?n.message:String(n);return r("deleteSession.failed",{detail:i})}e(On,"formatDeleteError");function gr(n,r){if(mn(n))return r("archives.unarchiveUnknown");let i=n instanceof Error?n.message:String(n);return r("archives.unarchiveFailed",{detail:i})}e(gr,"formatUnarchiveError");function fn(n,r,i=vr){return n.map(u=>u.sessionId+r("common.separator")+i(new Error(u.message),r)).join(`
22
+ `)}e(fn,"formatBatchFailures");function vr(n,r){if(mn(n))return r("archives.archiveUnknown");let i=n instanceof Error?n.message:String(n);return r("archives.archiveFailed",{detail:i})}e(vr,"formatArchiveError");function gn(n){if(n===null||typeof n!="object")return;let r=le(n),i=r.rpcError!==null&&typeof r.rpcError=="object"?le(r.rpcError):void 0,u=r.name==="WorkspaceActiveSessionError"?r.activity:void 0,m=i?.details,p=r.name==="WorkspaceArchiveError"&&i?.code==="workspace/session-active"&&m!==null&&typeof m=="object"?le(m).activity:void 0,k=Array.isArray(u)?u:Array.isArray(p)?p:void 0;if(k===void 0)return;let b=k.flatMap(A=>{if(A===null||typeof A!="object")return[];let z=le(A).kind;return typeof z=="string"&&z.length>0?[z]:[]});return b.length>0?b:void 0}e(gn,"activeSessionActivity");function yr(n){let r=gn(n);if(r===void 0||n===null||typeof n!="object")return;let i=le(n),u=i.rpcError!==null&&typeof i.rpcError=="object"?le(i.rpcError).details:void 0,m=u!==null&&typeof u=="object"?le(u).sessionId:void 0,p=typeof i.sessionId=="string"?i.sessionId:typeof m=="string"?m:void 0;return p===void 0?void 0:{sessionId:p,kinds:r}}e(yr,"activeSessionRefusal");function br(n,r){let i=/^cannot archive session '(?:[^'\\]|\\')*': the session is active \((.*)\)$/.exec(r);if(i===null)return;let u=i[1].split(", ").filter(m=>m.length>0);return u.length>0?{sessionId:n,kinds:u}:void 0}e(br,"activeArchiveFromMessage");function ta(n,r){let i=n instanceof Error?n.message:String(n);return r("archives.forkFailed",{detail:i})}e(ta,"formatForkError");function Mn(n){return n.blank?"New Session":n.displayTitle}e(Mn,"sessionTitle");function wr(n,r,i,u,m,p,k){let b=[...p];return k==="recency"&&b.sort(Yt),{key:n,workspaceId:r,cwd:i,createdAt:u,label:m,sessions:b}}e(wr,"buildGroup");function na(n,r){let i=new Map(n.map(p=>[p.id,p])),u=new Set,m=[];for(let p of r){let k=i.get(p);k===void 0||u.has(p)||(m.push(k),u.add(p))}for(let p of[...n].sort(Yt))u.has(p.id)||m.push(p);return m}e(na,"orderedUngrouped");function Sr(n,r,i,u,m){let p=[],k=new Set;for(let A of r){let z=[];for(let I of A.sessionIds){let D=n.byId[I];D!==void 0&&(k.add(I),Ut(D,kt(n),i,m)&&z.push(D))}p.push(wr(A.workspaceId,A.workspaceId,A.path,Date.parse(A.createdAt),A.title,z,"account"))}let b=n.ids.map(A=>n.byId[A]).filter(A=>A!==void 0&&!k.has(A.id)&&Ut(A,kt(n),i,m));return b.length>0&&p.push(wr("",void 0,void 0,void 0,zn,u===void 0?b:na(b,u),u===void 0?"recency":"account")),p}e(Sr,"groupByWorkspace");function Pn(n,r,i){if(!n||i.has(n))return!1;let u=r?.[n];return!(u===void 0||u.origin==="subagent"||u.blank)}e(Pn,"isWorkspaceTaskCandidate");function kr(n){let r=n?.closest("[data-row-key]")??null;if(r===null)return null;let i=r.getAttribute("data-row-key")??"";if(!i.startsWith("workspace:"))return null;let u=i.slice(10);if(!u)return null;let m=r.querySelector(".title")??r.querySelector("[class*='title']");return{workspaceId:u,title:m?.textContent?.trim()||u}}e(kr,"workspaceMenuTriggerFrom");function Ln(n,r=!0){let i=(n.textContent??"").toLowerCase();return i.includes("\u5220\u9664\u5DE5\u4F5C\u533A")||i.includes("delete workspace")||i.includes("\u0443\u0434\u0430\u043B\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435")?!0:r&&/(?:^|[_\s-])danger(?:$|[_\s-])/i.test(n.className)}e(Ln,"isWorkspaceDeleteMenuItem");function ra(n){switch(n){case"approval":case"plan-review":case"question":return n;default:return}}e(ra,"visiblePendingKind");function xr(n,r){let i=r.get(n.id),u=i===void 0?n.pendingInteraction:i.kind;return ra(u)}e(xr,"pendingInteractionForSession");let Fn=new Map,Bn=new Set,sa=new Map;function aa(n){return n(Fn)}e(aa,"useEmptySessionPendingInteraction");function ia(n){return n(sa)}e(ia,"useEmptySessionStatus");function Cr(n){return n instanceof Map||n==null?{pending:n??Fn,completed:Bn}:{pending:n.pending??Fn,completed:n.completed??Bn}}e(Cr,"pendingFacts");function oa(n){let r=new Map,i=new Set;if(n instanceof Map)for(let[u,m]of n)m?.pendingInteraction!==void 0&&r.set(u,m.pendingInteraction),m?.completionUnread===!0&&i.add(u);return{pending:r,completed:i}}e(oa,"factsFromSessionStatus");function la(n,r,i){let u=n(p=>p),m=r(p=>p);return i?oa(m):{pending:u,completed:Bn}}e(la,"useSessionUiFacts");function Er(n,r,i,u){let m=Cr(u),p=xr(n,m.pending);return{id:n.id,title:Mn(n),blank:n.blank,running:n.running,runningSubagentCount:r.get(n.id)?.runningCount??0,completed:n.completed===!0||m.completed.has(n.id),updatedAt:n.updatedAt,archived:i.has(n.id),...p===void 0?{}:{pendingInteraction:p}}}e(Er,"sessionNode");function ca(n,r,i,u,m){let p=new Set(i),k=new Set(m.expandedGroups),b=hn(n.byId),A=kt(n),z=A===void 0?void 0:r.find(D=>D.sessionIds.includes(A))?.workspaceId??"",I=[];for(let D of Sr(n,r,p,m.ungroupedOrder,m.showArchived)){let P=k.has(D.key);I.push({key:D.key,workspaceId:D.workspaceId,cwd:D.cwd,createdAt:D.createdAt,label:D.label,sessionCount:D.sessions.length,expanded:P,containsCurrent:D.key===z,sessions:P?D.sessions.map(h=>Er(h,b,p,u)):[]})}return I}e(ca,"deriveGroups");function da(n,r,i,u){let m=new Set(r),p=hn(n.byId),k=[];for(let b of n.ids){let A=n.byId[b];A===void 0||!Ut(A,kt(n),m,u)||k.push(A)}return k.sort(Yt),k.map(b=>Er(b,p,m,i))}e(da,"deriveFlat");function ua(n,r,i,u,m,p,k,b,A=zn){let z=i.trim().toLowerCase();if(z==="")return{items:[],hasMore:!1};let I=new Set(u),D=hn(n.byId),P=new Map;for(let Y of r)for(let be of Y.sessionIds)P.has(be)||P.set(be,Y.title);let h=e(Y=>P.get(Y.id)??ea(Y.cwd,A),"labelOf"),ue=new Map;for(let Y of p.items)ue.has(Y.sessionId)||ue.set(Y.sessionId,Y);let me=[];for(let Y of n.ids){let be=n.byId[Y];be===void 0||be.blank||!Ut(be,kt(n),I,b)||(Mn(be).toLowerCase().includes(z)||h(be).toLowerCase().includes(z))&&me.push(be)}me.sort(Yt);let he=[],Ue=new Set,it=e(Y=>{Ue.has(Y.id)||(Ue.add(Y.id),he.push(Y))},"include");for(let Y of me)it(Y);for(let Y of p.items){let be=n.byId[Y.sessionId];be!==void 0&&!be.blank&&Ut(be,kt(n),I,b)&&it(be)}let gt=Cr(m);return{items:he.slice(0,k).map(Y=>{let be=ue.get(Y.id),V=xr(Y,gt.pending);return{id:Y.id,title:Mn(Y),workspace:h(Y),running:Y.running,runningSubagentCount:D.get(Y.id)?.runningCount??0,archived:I.has(Y.id),...V===void 0?{}:{pendingInteraction:V},completed:Y.completed===!0||gt.completed.has(Y.id),...be===void 0?{}:{snippet:be.snippet}}}),hasMore:p.hasMore||he.length>k}}e(ua,"deriveSearchResults");function Ii(n,r){let p=Math.max(0,r-n);return p<6e4?{unit:"now",n:0}:p<36e5?{unit:"minutes",n:Math.floor(p/6e4)}:p<864e5?{unit:"hours",n:Math.floor(p/36e5)}:p<30*864e5?{unit:"days",n:Math.floor(p/864e5)}:p<365*864e5?{unit:"months",n:Math.floor(p/(30*864e5))}:{unit:"years",n:Math.floor(p/(365*864e5))}}e(Ii,"relativeTime");let Ar={listeners:new Set,request(n){for(let r of this.listeners)r(n)},subscribe(n){return this.listeners.add(n),()=>{this.listeners.delete(n)}}};function Ge(n,r){return n.blank?r("session.new"):n.title??n.displayTitle??""}e(Ge,"displayTitle");function ha(n,r){let i=new Date(n),u=`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`;return r("archives.timestamp",{date:r("date.ymd",{y:i.getFullYear(),m:i.getMonth()+1,d:i.getDate()}),time:u})}e(ha,"archiveTimeLabel");let pa=[".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(""),Ct="data-dsham-nav-icon",ma='[role="dialog"] nav button',Un=[`[${Ct}] > svg { display: none !important; }`,`[${Ct}]::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(`
23
+ `);function fa(n,r){let i=String(r??"").trim();return i.length>0&&String(n??"").trim()===i}e(fa,"isOwnSettingsNavRow");function vn(n,r){for(let i of n){if(i.type==="characterData"){let u=i.target.parentElement;if(u!==null&&u.closest(r)!==null)return!0;continue}for(let u of i.addedNodes){if(u.nodeType!==1)continue;let m=u;if(m.matches(r)||m.querySelector(r)!==null||m.closest(r)!==null)return!0}}return!1}e(vn,"mutationTouches");function Ir(n,r){return fa(n.textContent,r)?n.getAttribute(Ct)===""?!1:(n.setAttribute(Ct,""),!0):n.hasAttribute(Ct)?(n.removeAttribute(Ct),!0):!1}e(Ir,"applySettingsNavIcon");function Rr(n){return n.hasAttribute(Ct)?(n.removeAttribute(Ct),!0):!1}e(Rr,"restoreSettingsNavIcon");function _r(n){typeof document>"u"||typeof MutationObserver>"u"||n.effect(()=>{let r="dsham-nav-icon-style",i=document.getElementById(r);i===null?(i=document.createElement("style"),i.id=r,i.textContent=Un,(document.head??document.documentElement).append(i)):i.textContent!==Un&&(i.textContent=Un);let u=!1,m=!1,p=e(()=>{if(m=!1,u)return;let A=n.locale.bind($e)("archived.badge");for(let z of document.querySelectorAll(ma))Ir(z,A)},"sync"),k=e(()=>{m||u||(m=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(p):setTimeout(p,16))},"schedule");p();let b=new MutationObserver(A=>{vn(A,'[role="dialog"] nav')&&k()});return b.observe(document.body,{childList:!0,subtree:!0,characterData:!0}),()=>{u=!0,b.disconnect();for(let A of document.querySelectorAll(`[${Ct}]`))Rr(A);i?.remove()}},"archive-manager: settings nav icon")}e(_r,"installSettingsNavIcon");let ga=[".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 20px}",".dsham_settingsGroupHeading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 14px}",".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:1px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-button-elevated-fill))}",".dsham_settingsRow{display:grid;grid-template-columns:16px minmax(0,1fr) auto;align-items:center;gap:12px;min-height:64px;padding:10px 12px;border-bottom:1px solid var(--dsw-alias-border-l2)}",".dsham_settingsRow:last-child{border-bottom:0}",".dsham_settingsContent{min-width:0;flex:1}",".dsham_settingsTitle{overflow:hidden;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600;line-height:18px;text-overflow:ellipsis;white-space:nowrap}",".dsham_settingsMeta{margin-top:2px;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:16px}",".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:32px}.dsham_settingsRow{padding:10px 12px}.dsham_settingsActions{gap:4px}}"].join(""),va=".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:20px;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:8px;padding:10px 8px}.dsham_settingsActions{gap:0}.dsham_settingsMeta{font-size:11px}}.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{width:16px;height:16px;margin:0;accent-color:var(--dsw-alias-brand-primary);flex:none}button.dsham_favoriteOn{color:#e8b931}button.dsham_favoriteOn:not(:disabled):hover{color:#e8b931!important;border-color:#e8b931!important}",ya=".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}}",ba=".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 Hn({id:n,className:r,value:i,options:u,onChange:m,disabled:p=!1,"aria-label":k,title:b,tabIndex:A,"aria-hidden":z}){let[I,D]=l.useState(!1),P=l.useMemo(()=>u.map(me=>({id:me.value,label:me.label})),[u]),h=u.find(me=>me.value===i),ue=h?.label??k;return(0,a.jsx)("div",{id:n,tabIndex:A,"aria-hidden":z,className:r===void 0?"dsham_settingsFilter":`dsham_settingsFilter ${r}`,children:(0,a.jsx)(c.Menu,{open:I,onClose:e(()=>D(!1),"onClose"),onSelect:e(me=>{p||m(me),D(!1)},"onSelect"),selectedId:i,align:"start",portal:!0,dense:!0,listClassName:"dsham_selectDropdown",anchor:(0,a.jsxs)(c.Button,{variant:"outline",size:"sm",role:"combobox","aria-label":k,"aria-expanded":I,disabled:p,tabIndex:A,"aria-hidden":z,title:b??h?.title??h?.label??k,className:"dsham_menuSelectBtn"+(I?" is-open":""),onClick:e(()=>{p||D(me=>!me)},"onClick"),children:[(0,a.jsx)("span",{className:"dsham_selectLabel",children:ue}),(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:I?"rotate(180deg)":"none",flex:"none"},children:(0,a.jsx)("path",{d:"m4 6 4 4 4-4"})})]}),items:P})})}e(Hn,"ArchiveProjectSelect");function wa({id:n,t:r,disabled:i=!1,favoritesOnly:u,setFavoritesOnly:m,favoriteBusy:p=!1,sortBy:k,setSortBy:b,options:A}){let[z,I]=l.useState(!1),D=l.useMemo(()=>{let he=[];typeof m=="function"&&(he.push({type:"label",id:"lbl_view_filter",text:r("organizer.favoriteFilter")||"\u7B5B\u9009\u4F1A\u8BDD"}),he.push({id:"filter:all",label:r("organizer.allSessions")||"\u5168\u90E8\u4F1A\u8BDD"}),he.push({id:"filter:favorites",label:r("organizer.favoritesOnly")||"\u53EA\u770B\u6536\u85CF"}),he.push({type:"separator",id:"sep_view_filter"})),he.push({type:"label",id:"lbl_view_sort",text:r("archives.sortLabel")||"\u6392\u5E8F\u65B9\u5F0F"});for(let Ue of A)he.push({id:`sort:${Ue.value}`,label:Ue.label});return he},[r,m,A]),P=e(he=>{he.startsWith("filter:")?typeof m=="function"&&!p&&m(he==="filter:favorites"):he.startsWith("sort:")&&b(he.slice(5)),I(!1)},"onSelect"),h=A.find(he=>he.value===k),ue=u?r("organizer.favoritesOnly")||"\u53EA\u770B\u6536\u85CF":r("organizer.allChats")||"\u5168\u90E8\u804A\u5929",me=`${ue} \xB7 ${h?.label??k}`;return(0,a.jsxs)("div",{className:"dsham_viewSortContainer",children:[(0,a.jsx)(c.Menu,{open:z,onClose:e(()=>I(!1),"onClose"),onSelect:P,selectedIds:[u?"filter:favorites":"filter:all",`sort:${k}`],align:"end",portal:!0,dense:!0,listClassName:"dsham_viewSortDropdown",anchor:(0,a.jsxs)(c.Button,{variant:"outline",size:"sm",role:"combobox","aria-label":r("archives.viewOptions")||"\u89C6\u56FE\u9009\u9879","aria-expanded":z,disabled:i,title:me,className:"dsham_menuSelectBtn dsham_viewSortBtn"+(z?" is-open":"")+(u?" has-filter":""),onClick:e(()=>{i||I(he=>!he)},"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:ue}),(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:z?"rotate(180deg)":"none",flex:"none"},children:(0,a.jsx)("path",{d:"m4 6 4 4 4-4"})})]}),items:D})]})}e(wa,"ArchiveViewSortMenu");function Tr({selectedCount:n,hiddenCount:r,allVisibleSelected:i,selectedVisibleCount:u,visibleCount:m,busy:p,t:k,onToggle:b,onClear:A,onRestore:z,onDelete:I,onArchive:D}){let P=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:k("archives.selectAllFiltered"),children:[(0,a.jsx)(jr,{checked:i,indeterminate:u>0&&!i,disabled:p||m===0,label:k("archives.selectAllFiltered"),onChange:e(h=>b(h.target.checked),"onChange")}),(0,a.jsx)("span",{"aria-live":"polite",children:P?k("archives.selectedCount",{n}):k("archives.selectAllFiltered")})]}),P&&R({disabled:p,"aria-label":k("archives.clearSelection"),onClick:A,children:k("archives.clearSelectionShort")})]}),P&&(0,a.jsxs)("div",{className:"dsham_settingsSelectionActions",children:D?[R({disabled:p,onClick:D,children:k("archives.archiveSelected")})]:[R({disabled:p,"aria-label":k("archives.restoreSelected"),onClick:z,children:k("archives.restore")}),R({disabled:p,className:"dsham_btnDanger","aria-label":k("archives.deleteSelected"),onClick:I,children:k("archives.deleteSelectionShort")})]})]}),r>0&&(0,a.jsx)("p",{className:"dsham_settingsSelectionScope",role:"status",children:k("archives.selectionHiddenHint",{hidden:r})})]})}e(Tr,"ArchiveSelectionToolbar");function jr({checked:n,indeterminate:r=!1,disabled:i=!1,label:u,onChange:m}){return(0,a.jsx)(tr,{checked:n,indeterminate:r,disabled:i,label:u,onChange:m})}e(jr,"ArchiveSelectionCheckbox");function Dr(){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(Dr,"moreIcon");function Sa({busy:n,title:r,t:i,onPreview:u,onRestoreOpen:m,onDelete:p,onCopyId:k}){let[b,A]=(0,l.useState)(!1),z=e(D=>{if(!n){if(A(!1),D==="copyId")return k?.();if(D==="preview")return u?.();if(D==="restoreOpen")return m?.();D==="delete"&&p?.()}},"choose"),I=[...u?[{id:"preview",label:i("discovery.preview"),icon:(0,a.jsx)(c.IconBrowseOutlineMedium,{size:16}),danger:!1}]:[],...m?[{id:"restoreOpen",label:i("archives.restoreOpen"),icon:(0,a.jsx)(c.IconUnarchiveOutlineMedium,{size:16}),danger:!1}]:[],...k?[{id:"copyId",label:i("details.copyId"),icon:(0,a.jsx)(c.IconCopyOutlineMedium,{size:16}),danger:!1}]:[],...p?[{id:"delete",label:i("menu.deleteSession"),icon:(0,a.jsx)(c.IconTrashOutlineMedium,{size:16}),danger:!0}]:[]];return(0,a.jsx)(c.Menu,{open:!n&&b,align:"end",portal:!0,dense:!0,items:I,onSelect:z,onClose:e(()=>A(!1),"onClose"),anchor:R({variant:"outline",className:"dsham_iconAction",disabled:n,title:i("archives.moreActions"),"aria-label":i("archives.moreActions")+i("common.separator")+r,"aria-haspopup":"menu","aria-expanded":b&&!n,icon:Dr(),onClick:e(()=>{n||A(D=>!D)},"onClick")})})}e(Sa,"ArchivedSessionMenu");function ka({group:n,busy:r,onArchive:i,onRestore:u,onDelete:m,t:p}){let k=n.key===yn,b=i?[{id:"archive",label:p(k?"archives.archiveUngrouped":"archives.archiveProject"),icon:(0,a.jsx)(c.IconArchiveOutlineMedium,{size:16}),danger:!0}]:[{id:"restore",label:p(k?"archives.restoreUngrouped":"archives.restoreProject"),icon:(0,a.jsx)(c.IconUnarchiveOutlineMedium,{size:16}),danger:!1},{id:"delete",label:p(k?"archives.deleteUngrouped":"archives.deleteProject"),icon:(0,a.jsx)(c.IconTrashOutlineMedium,{size:16}),danger:!0}],[A,z]=(0,l.useState)(!1),I=p(k?"archives.ungroupedActions":"archives.projectActions",{name:n.title}),D=e(P=>{r||(P==="archive"?i?.():P==="restore"?u?.():P==="delete"&&m?.())},"choose");return(0,a.jsx)(c.Menu,{open:!r&&A,align:"end",portal:!0,dense:!0,items:b,onSelect:e(P=>{z(!1),D(P)},"onSelect"),onClose:e(()=>z(!1),"onClose"),anchor:R({variant:"outline",className:"dsham_iconAction",disabled:r,"aria-label":I,"aria-haspopup":"menu","aria-expanded":A&&!r,icon:Dr(),onClick:e(()=>{r||z(P=>!P)},"onClick")})})}e(ka,"ArchivedGroupActions");let yn="__ungrouped__";function xa(n){return n===yn?{scope:"ungrouped"}:{scope:"workspace",workspaceId:n}}e(xa,"archivedBatchTargetForGroup");function Zt(n,r,i){let u=[...new Set(n??[])];if(i.scope==="all")return u;if(i.scope==="sessions"){let p=new Set(i.sessionIds??[]);return u.filter(k=>p.has(k))}if(i.scope==="workspace"){let p=new Set(r.find(k=>k.workspaceId===i.workspaceId)?.sessionIds??[]);return u.filter(k=>p.has(k))}let m=new Set(r.flatMap(p=>p.sessionIds));return u.filter(p=>!m.has(p))}e(Zt,"deriveArchivedBatchIds");function Nr(n){return[...new Set(n.flatMap(r=>r.sessions.map(i=>i.id)))]}e(Nr,"archivedSessionIdsInGroups");function zr(n,r){let i=new Set(r);return[...new Set(n)].filter(u=>i.has(u))}e(zr,"pruneArchivedSelection");function Wn(n,r,i){let u=new Set(n);for(let m of r)i?u.add(m):u.delete(m);return[...u]}e(Wn,"toggleArchivedSelection");function Or(n,r){let i=n.deletedSessionIds.length,u=n.skippedSessionIds.length;return n.failures.length>0?{kind:"error",message:r("archives.deletePartial",{deleted:i,skipped:u,failed:n.failures.length,detail:n.failures[0].message})}:u>0&&i>0?{kind:"notice",message:r("archives.deleteSuccessWithSkipped",{deleted:i,skipped:u})}:u>0?{kind:"notice",message:r("archives.deleteSkipped",{n:u})}:{kind:"notice",message:r("archives.deleteSuccess",{n:i})}}e(Or,"archivedDeleteFeedback");function Mr(n,r){let i=new Set(r);return Object.values(n).filter(u=>u.origin!=="subagent"&&!u.blank&&!i.has(u.id)).map(u=>u.id)}e(Mr,"unarchivedSessionIds");function Pr(n,r,i,u){let m=r.map(b=>({key:b.workspaceId,title:b.title,ids:new Set(b.sessionIds),sessions:[]})),p=[];for(let b of i){let A=n[b];if(A===void 0||A.origin==="subagent")continue;let z=m.find(I=>I.ids?.has(b));(z===void 0?p:z.sessions).push(A)}let k=m.filter(b=>b.sessions.length>0);return p.length>0&&k.push({key:yn,title:u,sessions:p}),k}e(Pr,"deriveArchivedGroups");function Lr(n,r,i,u,m=[]){let p=e((I,D)=>String(I).localeCompare(String(D),void 0,{numeric:!0,sensitivity:"base"}),"compareText"),k=new Map;if(Array.isArray(m))for(let I=0;I<m.length;I++)k.set(m[I],I);let b=e(I=>{let D=r==="created"?i[I.id]:I.updatedAt;return typeof D=="number"&&Number.isFinite(D)?D:Number.NEGATIVE_INFINITY},"timestampOf"),A=e((I,D)=>{if(r==="archived"){let P=k.get(I.id)??-1,ue=(k.get(D.id)??-1)-P;if(ue!==0)return ue}if(r!=="alphabetical"){let P=b(D)-b(I);if(Number.isFinite(P)&&P!==0)return P}return p(Ge(I,u),Ge(D,u))||p(I.id,D.id)},"compareSessions");return n.map(I=>({...I,sessions:[...I.sessions].sort(A)})).sort((I,D)=>{if(r==="archived"){let P=I.sessions[0]?.id,h=D.sessions[0]?.id,ue=P!==void 0?k.get(P)??-1:-1,he=(h!==void 0?k.get(h)??-1:-1)-ue;if(he!==0)return he}if(r!=="alphabetical"){let P=b(D.sessions[0])-b(I.sessions[0]);if(Number.isFinite(P)&&P!==0)return P}return p(I.title,D.title)||p(I.key,D.key)})}e(Lr,"sortArchivedGroups");let Fr={...Vs,...ks,"locale.language":"zh","service.unavailable":"\u670D\u52A1\u5C1A\u672A\u5C31\u7EEA\uFF0C\u8BF7\u91CD\u8BD5","sidebar.entry.title":"\u4FA7\u8FB9\u680F\u5165\u53E3","sidebar.entry.desc":"\u5728\u5DE6\u4FA7\u4E3B\u5BFC\u822A\u680F\u663E\u793A\u5F52\u6863\u7BA1\u7406\u5668\u3002\u8BBE\u7F6E\u91CC\u7684\u5165\u53E3\u4E0D\u53D8\u3002","sidebar.entry.toggle":"\u5207\u6362\u4FA7\u8FB9\u680F\u5165\u53E3","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","section.workspaces":"\u5DE5\u4F5C\u533A","section.sessions":"\u4F1A\u8BDD","viewOptions.label":"\u89C6\u56FE\u9009\u9879","groupBy.label":"\u5206\u7EC4\u65B9\u5F0F","groupBy.workspace":"\u6309\u5DE5\u4F5C\u533A","groupBy.flat":"\u5355\u5217\u8868","orderBy.label":"\u6392\u5E8F\u65B9\u5F0F","orderBy.manual":"\u624B\u52A8\u6392\u5E8F","orderBy.updated":"\u6700\u8FD1\u66F4\u65B0","sessions.expand":"\u5C55\u5F00\u5176\u4F59 {n} \u4E2A\u4F1A\u8BDD","sessions.collapse":"\u6536\u8D77","empty.none":"\u6682\u65E0\u4F1A\u8BDD","workspace.add":"\u6DFB\u52A0\u5DE5\u4F5C\u533A","search.sessions.aria":"\u641C\u7D22\u4F1A\u8BDD","search.placeholder":"\u641C\u7D22\u4F1A\u8BDD\u2026","search.clear":"\u6E05\u9664\u641C\u7D22","search.results.aria":"\u641C\u7D22\u7ED3\u679C","search.pending":"\u6B63\u5728\u641C\u7D22\u4F1A\u8BDD\u5386\u53F2\u2026","search.unavailable":"\u5185\u5BB9\u641C\u7D22\u6682\u4E0D\u53EF\u7528\uFF0C\u4EC5\u663E\u793A\u540D\u79F0\u5339\u914D\u3002","search.noMatches":"\u65E0\u5339\u914D\u4F1A\u8BDD","search.hasMore":"\u4EC5\u663E\u793A\u524D {n} \u6761\u7ED3\u679C\uFF0C\u8BF7\u7F29\u5C0F\u641C\u7D22\u8303\u56F4\u3002","menu.addWorkspace":"\u6DFB\u52A0\u5DE5\u4F5C\u533A\u2026","menu.unarchive":"\u53D6\u6D88\u5F52\u6863","menu.deleteSession":"\u5220\u9664\u4F1A\u8BDD","archived.badge":"\u5F52\u6863\u4F1A\u8BDD","archived.notOpenable":"\u5DF2\u5F52\u6863\uFF0C\u53D6\u6D88\u5F52\u6863\u540E\u53EF\u7EE7\u7EED\u5BF9\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.sortBy":"\u6392\u5E8F\u65B9\u5F0F","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","archiveActive.pending":"\u6B63\u5728\u505C\u6B62\u5E76\u5F52\u6863\u2026","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}","picker.loading":"\u6B63\u5728\u52A0\u8F7D\u5DE5\u4F5C\u533A\u2026","conflict.named":"\u5DF2\u5B58\u5728\u540D\u4E3A\u201C{name}\u201D\u7684\u5DE5\u4F5C\u533A\u3002","folderError.title":"\u65E0\u6CD5\u6253\u5F00\u6587\u4EF6\u5939","folderError.retry":"\u91CD\u65B0\u9009\u62E9",rename:"\u91CD\u547D\u540D","rename.workspace.title":"\u91CD\u547D\u540D\u5DE5\u4F5C\u533A","rename.session.title":"\u91CD\u547D\u540D\u4F1A\u8BDD","field.workspaceName":"\u5DE5\u4F5C\u533A\u540D\u79F0","field.sessionName":"\u4F1A\u8BDD\u540D\u79F0","delete.workspace":"\u5220\u9664\u5DE5\u4F5C\u533A","delete.desc":"\u5C06\u628A\u201C{name}\u201D\u4ECE\u5DE5\u4F5C\u533A\u5217\u8868\u4E2D\u79FB\u9664\u3002\u6587\u4EF6\u5939\u4E0E\u4F1A\u8BDD\u8BB0\u5F55\u4F1A\u4FDD\u7559\uFF0C\u5176\u4F1A\u8BDD\u5C06\u663E\u793A\u5728\u201C\u672A\u5206\u7EC4\u201D\u4E0B\u3002","delete.pending":"\u6B63\u5728\u5220\u9664\u5DE5\u4F5C\u533A\u2026","menu.fork":"\u5206\u53C9\u4F1A\u8BDD","menu.archiveSession":"\u5F52\u6863\u4F1A\u8BDD","menu.archiveWorkspace":"\u5F52\u6863\u5168\u90E8\u4F1A\u8BDD","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","actions.workspace.aria":"\u5DE5\u4F5C\u533A\u201C{name}\u201D\u7684\u64CD\u4F5C","actions.session.aria":"\u4F1A\u8BDD\u201C{name}\u201D\u7684\u64CD\u4F5C","actions.newSession.aria":"\u5728\u201C{name}\u201D\u4E2D\u65B0\u5EFA\u4F1A\u8BDD","status.running":"\u8FDB\u884C\u4E2D","status.subagentsRunning.one":"{n} \u4E2A\u5B50\u4EE3\u7406\u8FD0\u884C\u4E2D","status.subagentsRunning.other":"{n} \u4E2A\u5B50\u4EE3\u7406\u8FD0\u884C\u4E2D","status.idle":"\u7A7A\u95F2","status.waitingApproval":"\u7B49\u5F85\u5BA1\u6279","status.planReview":"\u8BA1\u5212\u5F85\u5BA1","status.waitingAnswer":"\u7B49\u5F85\u56DE\u7B54","status.completed":"\u5DF2\u5B8C\u6210","hover.created":"\u521B\u5EFA\u4E8E {time}","hover.copied":"\u5DF2\u590D\u5236","date.ymd":"{y}\u5E74{m}\u6708{d}\u65E5","time.now":"\u521A\u521A","time.minutes":"{n}\u5206\u949F","time.hours":"{n}\u5C0F\u65F6","time.days":"{n}\u5929","time.months":"{n}\u4E2A\u6708","time.years":"{n}\u5E74","time.ago":"{t}\u524D"},Br={...Gs,...xs,"locale.language":"en","service.unavailable":"The service is not ready. Please retry.","sidebar.entry.title":"Sidebar entry","sidebar.entry.desc":"Show Archived Sessions in the left sidebar. The Settings entry stays either way.","sidebar.entry.toggle":"Toggle sidebar entry","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","section.workspaces":"Workspaces","section.sessions":"Sessions","viewOptions.label":"View options","groupBy.label":"Group by","groupBy.workspace":"Workspace","groupBy.flat":"In one list","orderBy.label":"Order by","orderBy.manual":"Manual","orderBy.updated":"Last updated","sessions.expand":"Show {n} more sessions","sessions.collapse":"Show less","empty.none":"No sessions yet","workspace.add":"Add workspace","search.sessions.aria":"Search sessions","search.placeholder":"Search sessions...","search.clear":"Clear search","search.results.aria":"Search results","search.pending":"Searching session history\u2026","search.unavailable":"Content search is temporarily unavailable. Showing name matches.","search.noMatches":"No matching sessions","search.hasMore":"Showing the first {n} results. Narrow your search.","menu.addWorkspace":"Add workspace\u2026","menu.unarchive":"Unarchive","menu.deleteSession":"Delete session","archived.badge":"Archived sessions","archived.notOpenable":"This session is archived. Unarchive it to continue the conversation.","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.sortBy":"Sort 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","archiveActive.pending":"Stopping and archiving\u2026","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}","picker.loading":"Loading workspaces\u2026","conflict.named":"A workspace named \u201C{name}\u201D already exists.","folderError.title":"Couldn\u2019t open folder","folderError.retry":"Choose again",rename:"Rename","rename.workspace.title":"Rename workspace","rename.session.title":"Rename session","field.workspaceName":"Workspace name","field.sessionName":"Session name","delete.workspace":"Delete workspace","delete.desc":"This removes \u201C{name}\u201D from the workspace list. The folder and session logs will be kept. Its sessions will appear under Ungrouped.","delete.pending":"Deleting workspace\u2026","menu.fork":"Fork session","menu.archiveSession":"Archive session","menu.archiveWorkspace":"Archive all conversations","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","actions.workspace.aria":"Workspace actions for {name}","actions.session.aria":"Session actions for {name}","actions.newSession.aria":"New session in {name}","status.running":"Running","status.subagentsRunning.one":"{n} subagent running","status.subagentsRunning.other":"{n} subagents running","status.idle":"Idle","status.waitingApproval":"Waiting for approval","status.planReview":"Plan awaiting review","status.waitingAnswer":"Waiting for answer","status.completed":"Completed","hover.created":"Created {time}","hover.copied":"Copied","date.ymd":"{y}-{m}-{d}","time.now":"now","time.minutes":"{n}min","time.hours":"{n}h","time.days":"{n}d","time.months":"{n}mo","time.years":"{n}y","time.ago":"{t} ago"},Ca={...$s,...Cs,"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.","sidebar.entry.title":"\u041F\u0443\u043D\u043A\u0442 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","sidebar.entry.desc":"\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u0430\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439 \u043D\u0430 \u043B\u0435\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438. \u041F\u0443\u043D\u043A\u0442 \u0432 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430\u0445 \u0441\u043E\u0445\u0440\u0430\u043D\u044F\u0435\u0442\u0441\u044F.","sidebar.entry.toggle":"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u043F\u0443\u043D\u043A\u0442 \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","section.workspaces":"\u0420\u0430\u0431\u043E\u0447\u0438\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430","section.sessions":"\u0421\u0435\u0441\u0441\u0438\u0438","viewOptions.label":"\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430","groupBy.label":"\u0413\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u043E","groupBy.workspace":"\u0420\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E","groupBy.flat":"\u0412 \u043E\u0434\u043D\u043E\u043C \u0441\u043F\u0438\u0441\u043A\u0435","orderBy.label":"\u041F\u043E\u0440\u044F\u0434\u043E\u043A","orderBy.manual":"\u0412\u0440\u0443\u0447\u043D\u0443\u044E","orderBy.updated":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0435 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","sessions.expand":"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0435\u0449\u0451 {n} \u0441\u0435\u0441\u0441\u0438\u0439","sessions.collapse":"\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043C\u0435\u043D\u044C\u0448\u0435","empty.none":"\u041F\u043E\u043A\u0430 \u043D\u0435\u0442 \u0441\u0435\u0441\u0441\u0438\u0439","workspace.add":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E","search.sessions.aria":"\u041F\u043E\u0438\u0441\u043A \u0441\u0435\u0441\u0441\u0438\u0439","search.placeholder":"\u041F\u043E\u0438\u0441\u043A \u0441\u0435\u0441\u0441\u0438\u0439...","search.clear":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u043F\u043E\u0438\u0441\u043A","search.results.aria":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u043F\u043E\u0438\u0441\u043A\u0430","search.pending":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0438\u0441\u0442\u043E\u0440\u0438\u0438 \u0441\u0435\u0441\u0441\u0438\u0439\u2026","search.unavailable":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443 \u0432\u0440\u0435\u043C\u0435\u043D\u043D\u043E \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D. \u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u0441\u043E\u0432\u043F\u0430\u0434\u0435\u043D\u0438\u044F \u043F\u043E \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u044F\u043C.","search.noMatches":"\u041D\u0435\u0442 \u043F\u043E\u0434\u0445\u043E\u0434\u044F\u0449\u0438\u0445 \u0441\u0435\u0441\u0441\u0438\u0439","search.hasMore":"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u044B \u043F\u0435\u0440\u0432\u044B\u0435 {n} \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u043E\u0432. \u0421\u0443\u0437\u044C\u0442\u0435 \u043F\u043E\u0438\u0441\u043A.","menu.addWorkspace":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E\u2026","menu.unarchive":"\u0412\u0435\u0440\u043D\u0443\u0442\u044C \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430","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","archived.notOpenable":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0432 \u0430\u0440\u0445\u0438\u0432\u0435. \u0412\u0435\u0440\u043D\u0438\u0442\u0435 \u0435\u0451 \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430, \u0447\u0442\u043E\u0431\u044B \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440.","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.sortBy":"\u0421\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0430 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432","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","archiveActive.pending":"\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430 \u0438 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F\u2026","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}","picker.loading":"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0440\u0430\u0431\u043E\u0447\u0438\u0445 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u2026","conflict.named":"\u0420\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E \u0441 \u0438\u043C\u0435\u043D\u0435\u043C \xAB{name}\xBB \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.","folderError.title":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0442\u043A\u0440\u044B\u0442\u044C \u043F\u0430\u043F\u043A\u0443","folderError.retry":"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0441\u043D\u043E\u0432\u0430",rename:"\u041F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u044C","rename.workspace.title":"\u041F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E","rename.session.title":"\u041F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","field.workspaceName":"\u0418\u043C\u044F \u0440\u0430\u0431\u043E\u0447\u0435\u0433\u043E \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430","field.sessionName":"\u0418\u043C\u044F \u0441\u0435\u0441\u0441\u0438\u0438","delete.workspace":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E","delete.desc":"\u042D\u0442\u043E \u0443\u0434\u0430\u043B\u0438\u0442 \xAB{name}\xBB \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430 \u0440\u0430\u0431\u043E\u0447\u0438\u0445 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432. \u041F\u0430\u043F\u043A\u0430 \u0438 \u0436\u0443\u0440\u043D\u0430\u043B\u044B \u0441\u0435\u0441\u0441\u0438\u0439 \u043E\u0441\u0442\u0430\u043D\u0443\u0442\u0441\u044F. \u0415\u0433\u043E \u0441\u0435\u0441\u0441\u0438\u0438 \u043F\u043E\u044F\u0432\u044F\u0442\u0441\u044F \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0411\u0435\u0437 \u0433\u0440\u0443\u043F\u043F\u044B\xBB.","delete.pending":"\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0440\u0430\u0431\u043E\u0447\u0435\u0433\u043E \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430\u2026","menu.fork":"\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u0432\u0435\u0442\u043A\u0443 \u0441\u0435\u0441\u0441\u0438\u0438","menu.archiveSession":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","menu.archiveWorkspace":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 \u0441\u0435\u0441\u0441\u0438\u0438","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","actions.workspace.aria":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0440\u0430\u0431\u043E\u0447\u0435\u0433\u043E \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430 \u0434\u043B\u044F {name}","actions.session.aria":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0441\u0435\u0441\u0441\u0438\u0438 \u0434\u043B\u044F {name}","actions.newSession.aria":"\u041D\u043E\u0432\u0430\u044F \u0441\u0435\u0441\u0441\u0438\u044F \u0432 {name}","status.running":"\u0412\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F","status.subagentsRunning.one":"{n} \u043F\u043E\u0434\u0430\u0433\u0435\u043D\u0442 \u0440\u0430\u0431\u043E\u0442\u0430\u0435\u0442","status.subagentsRunning.other":"{n} \u043F\u043E\u0434\u0430\u0433\u0435\u043D\u0442\u043E\u0432 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0442","status.idle":"\u041E\u0436\u0438\u0434\u0430\u043D\u0438\u0435","status.waitingApproval":"\u041E\u0436\u0438\u0434\u0430\u043D\u0438\u0435 \u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u044F","status.planReview":"\u041F\u043B\u0430\u043D \u043E\u0436\u0438\u0434\u0430\u0435\u0442 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438","status.waitingAnswer":"\u041E\u0436\u0438\u0434\u0430\u043D\u0438\u0435 \u043E\u0442\u0432\u0435\u0442\u0430","status.completed":"\u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043E","hover.created":"\u0421\u043E\u0437\u0434\u0430\u043D\u043E {time}","hover.copied":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E","date.ymd":"{y}-{m}-{d}","time.now":"\u0441\u0435\u0439\u0447\u0430\u0441","time.minutes":"{n}\u043C\u0438\u043D","time.hours":"{n}\u0447","time.days":"{n}\u0434","time.months":"{n}\u043C\u0435\u0441","time.years":"{n}\u0433","time.ago":"{t} \u043D\u0430\u0437\u0430\u0434"},$e="archive-manager-workspace",Ea=["slots","sessions","workspaces","locale","remote","typert"];function qn(n){return{getSnapshot:n.getSnapshot.bind(n),subscribe:n.subscribe.bind(n)}}e(qn,"bindObservable");function Ur(n){return async r=>{if(typeof n?.unarchiveSession!="function")throw new Error("archive-manager: host unarchiveSession is unavailable");await n.unarchiveSession(r)}}e(Ur,"createUnarchiveSession");async function Vn(n,r,i){let u=new Set(n.list?.getSnapshot?.()?.archivedSessionIds??[]),m=await _n(r,async k=>{try{await n.archiveSession(k)}catch(b){throw b!==null&&typeof b=="object"&&gn(b)!==void 0&&typeof le(b).sessionId!="string"&&Object.assign(b,{sessionId:k}),b}return!0},{refresh:i}),p=[...n.list?.getSnapshot?.()?.archivedSessionIds??[]];return{archivedSessionIds:p,archivedSessionIdsAdded:p.filter(k=>!u.has(k)),failures:m.failures}}e(Vn,"archiveSessionsViaOfficial");async function Hr(n,r,i,u){let m=new Set(n.list?.getSnapshot?.()?.archivedSessionIds??[]),p=typeof u=="function"?u:A=>n.unarchiveSession?.(A),k=await _n(r,async A=>(await p(A),!0),{refresh:i}),b=[...n.list?.getSnapshot?.()?.archivedSessionIds??[]];return{archivedSessionIds:b,unarchivedSessionIds:[...m].filter(A=>!b.includes(A)),failures:k.failures}}e(Hr,"unarchiveSessionsViaOfficial");async function Aa(n){Ia(n);let r=n.get("remote"),i=e(()=>{},"disposeRemote");return r!==void 0&&(i=await r.$mount(U)),async()=>{await i()}}e(Aa,"apply");function Ia(n){n.effect(()=>n.locale.register($e,{zh:Fr,en:Br,ru:Ca}),"dsh-archive-manager: dictionaries");let r=e(()=>n.get("uiWorkspace"),"uiWorkspaceAt"),i={},u,m=e(g=>(u=Ts(g,n.sessions,n.workspaces,{onOpened:e(()=>n.get("layout")?.selectPanel(null),"onOpened"),beginNavigation:e(()=>n.get("layout")?.beginNavigation?.(),"beginNavigation")}),()=>u?.dispose()),"attachArchiveNavigation");n.effect(()=>m(r()),"archive-manager: explicit archived navigation");let p=e(g=>{if(u===void 0)throw new jt("navigationUnavailable");return Ar.request(g),u.open(g)},"openConversation"),k=e(async g=>{n.get("layout")?.beginNavigation?.(),Ar.request(g)},"focusSessionWorkspace"),b=e(async(g,S)=>{let O=await n.sessions.search(g,S);if(!O.ok)throw new Error(O.error.message);return O.value},"searchSessions"),A=e(async()=>{if(typeof n.sessions.refresh!="function")return null;try{return await ue(),null}catch(g){return console.warn("archive-manager: restored archived sessions but session list refresh failed:",g),g instanceof Error?g.message:String(g)}},"refreshSessionList"),z=Ur(n.workspaces),I=e(async(g,...S)=>{let O=n.get("remote.workspaceRegistry");if(!O||typeof O[g]!="function")throw new Error(n.locale.bind($e)("service.unavailable"));let Ee=await O[g].apply(O,S);if(!Ee.ok)throw new Error(Ee.error.message);return Ee.value},"registryCall"),D=e(()=>I("diagnoseOrphanSubagents"),"diagnoseOrphanSubagents"),P=e(()=>I("diagnoseSessionCaches"),"diagnoseSessionCaches"),h=e(g=>I("rebuildSessionCaches",g),"rebuildSessionCaches"),ue=e(async()=>{if(typeof n.sessions.refresh!="function")throw new Error("Official session list refresh is unavailable");let g=await n.sessions.refresh(),S=n.sessions,O=S.manager;if(O?.listState==="error"&&O.listError)throw new Error(Pe(O.listError));if(S.listState==="error"&&S.listError)throw new Error(Pe(S.listError));let te=S.list?.getSnapshot?.();if(te?.state==="error"&&te.error)throw new Error(Pe(te.error));if(g&&typeof g=="object"&&"ok"in g&&g.ok===!1)throw new Error(Pe(g.error??"Session list refresh failed"))},"refreshCacheLists"),me=e((g={})=>I("cleanOrphanSubagents",g??{}),"cleanOrphanSubagents"),he=e(g=>I("searchArchivedContent",g),"searchArchivedContent"),Ue=e(g=>I("searchSessionContent",g),"searchSessionContent"),it=e(g=>I("previewArchivedSession",g),"previewArchivedSession"),gt=e(()=>I("favoriteSessions"),"favoriteSessions"),Y=e(g=>I("setSessionFavorite",g),"setSessionFavorite"),be=hr();be.bind({favoriteSessions:gt,setSessionFavorite:Y});let V=Kt(n,be,()=>n.locale.bind($e));n.effect(()=>()=>V.dispose(),"archive-manager: favorites only filter");let ze=Ws({workspaces:n.workspaces.list,sessions:n.sessions.list,archive:e(g=>n.workspaces.archiveSession(g),"archive"),restore:e(async g=>{await z(g)},"restore"),deleteOne:e(async g=>{let S=n.get("remote.workspaceRegistry");if(!S)throw new Error(n.locale.bind($e)("service.unavailable"));let O=await S.deleteSession(g);if(!O.ok)throw new Error(O.error.message)},"deleteOne"),getFavorites:gt,refresh:e(()=>n.sessions.refresh?.(),"refresh"),currentSessionId:kt}),Ie=e(async g=>{await z(g),await A()},"unarchiveSession"),fe=e(async g=>{let S=n.get("remote.workspaceRegistry");if(S===void 0)throw new Error("archive-manager remote service is unavailable");let O=await S.deleteSession(g);if(!O.ok)throw new Error(O.error.message);await A()},"deleteSession"),rt=e(async g=>Vn(n.workspaces,g,A),"archiveSessions"),Ke=e(async g=>{let S=n.workspaces.list?.getSnapshot?.()??{archivedSessionIds:[],items:[]},O=Zt(S.archivedSessionIds,S.items,g);return Hr(n.workspaces,O,A,z)},"unarchiveSessions"),W=e(async g=>{let S=n.get("remote.workspaceRegistry");if(S===void 0)throw new Error("archive-manager remote service is unavailable");let O=await S.deleteArchivedSessions(g);if(!O.ok)throw new Error(O.error.message);let te=await A();return{...O.value,refreshError:te}},"deleteArchivedSessions"),q=e(async()=>{let g=n.get("remote.workspaceRegistry");if(g===void 0)throw new Error("archive-manager remote service is unavailable");let S=await g.archivedSessionMetadata();if(!S.ok)throw new Error(S.error.message);return S.value},"archivedSessionMetadata"),Oe="sidebar.workspaces.session.menu.item",Ze=null,ee=new Set,Je=e(g=>{Ze=g;for(let S of ee)S()},"publishDeleteTarget");function ct(){return l.useSyncExternalStore(g=>(ee.add(g),()=>{ee.delete(g)}),()=>Ze,()=>Ze)}e(ct,"useDeleteRequest");function Jt({sessionId:g,displayTitle:S,useMenuOpenState:O,t:te}){let[,Ee]=O(),Q=c.MenuItemButton,Ae=(0,a.jsx)(c.IconTrashOutlineRegular,{size:14}),we=e(()=>{Ee(!1),Je({sessionId:g,title:S})},"onSelect");return typeof Q=="function"?(0,a.jsx)(Q,{danger:!0,icon:Ae,onSelect:we,children:te("menu.deleteSession")}):(0,a.jsx)("button",{type:"button",role:"menuitem",onClick:we,children:te("menu.deleteSession")})}e(Jt,"DeleteSessionMenuItem");function vt({sessionId:g,favoriteRow:S,useMenuOpenState:O,t:te}){let[,Ee]=O(),Q=(0,l.useSyncExternalStore)(S.subscribe,S.getSnapshot),Ae=Q.ready&&Q.ids.has(g),we=e(()=>{Ee(!1),S.toggle(g)},"onSelect"),Se=c.MenuItemButton,Te=(0,a.jsx)("svg",{viewBox:"0 0 16 16",width:14,height:14,fill:Ae?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round","aria-hidden":!0,children:(0,a.jsx)("path",{d:Nt})}),We=te(Ae?"organizer.unfavorite":"organizer.favorite");return typeof Se=="function"?(0,a.jsx)(Se,{icon:Te,onSelect:we,children:We}):(0,a.jsx)("button",{type:"button",role:"menuitem",onClick:we,children:We})}e(vt,"FavoriteMenuItem");function yt(g){try{let S=document.querySelector(`[data-row-key="session:${CSS.escape(g)}"]`);return S?(S.hasAttribute("tabindex")||(S.setAttribute("tabindex","-1"),S.addEventListener("blur",()=>S.removeAttribute("tabindex"),{once:!0})),typeof c.focusWithoutRing=="function"?c.focusWithoutRing(S):S.focus(),!0):!1}catch{return!1}}e(yt,"focusSessionRow");function Mt({t:g}){let S=ct(),[O,te]=(0,l.useState)(!1),[Ee,Q]=(0,l.useState)(null),[Ae,we]=(0,l.useState)(null),Se=(0,l.useRef)(null),Te=(0,l.useRef)(null),We=(0,l.useRef)(null);if((0,l.useLayoutEffect)(()=>{if(S===null||typeof document>"u"){we(null);return}let pe=null,ae=e(()=>{if(pe&&pe.isConnected)return pe;try{pe=document.querySelector(`[data-row-key="session:${CSS.escape(S.sessionId)}"]`)}catch{pe=null}return pe},"getTargetRow"),M=e(()=>{let je=Se.current,ke=je?.offsetWidth||290,qe=je?.offsetHeight||160,Ve=8,Ye=ae();if(!Ye){let ge=window.innerWidth,Rt=window.innerHeight,pt=Math.max(16,(Rt-qe)/2),Xe=Math.max(16,(ge-ke)/2);we(xe=>xe!==null&&xe.top===pt&&xe.left===Xe?xe:{top:pt,left:Xe});return}let ht=Ye.getBoundingClientRect(),Fe=ht.top-4;Fe+qe>window.innerHeight-16&&(Fe=window.innerHeight-16-qe),Fe<16&&(Fe=16);let Be=ht.right+Ve;Be+ke>window.innerWidth-16&&(Be=ht.left-ke-Ve),Be<16&&(Be=16),we(ge=>ge!==null&&ge.top===Fe&&ge.left===Be?ge:{top:Fe,left:Be})},"updatePosition");M(),window.addEventListener("scroll",M,!0),window.addEventListener("resize",M);let oe=null;return typeof ResizeObserver<"u"&&Se.current&&(oe=new ResizeObserver(M),oe.observe(Se.current)),()=>{oe?.disconnect(),window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",M)}},[S]),(0,l.useEffect)(()=>{if(S===null)return;Te.current&&!Te.current.disabled?Te.current.focus():Se.current?.focus();let pe=S.sessionId;return()=>{if(!yt(pe)){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())}}},[S]),(0,l.useEffect)(()=>{S!==null&&O&&Se.current?.focus()},[S,O]),(0,l.useEffect)(()=>{if(S===null)return;let pe=e(ae=>{if(ae.key==="Escape"){ae.preventDefault(),ae.stopPropagation(),"stopImmediatePropagation"in ae&&typeof ae.stopImmediatePropagation=="function"&&ae.stopImmediatePropagation(),O||(Q(null),Je(null));return}if(ae.key==="Tab"){if(ae.preventDefault(),O){Se.current?.focus();return}let M=Te.current,oe=We.current;if(!M||!oe)return;ae.shiftKey?document.activeElement===M?oe.focus():M.focus():document.activeElement===oe?M.focus():oe.focus()}},"onKey");return window.addEventListener("keydown",pe,!0),()=>window.removeEventListener("keydown",pe,!0)},[S,O]),S===null)return null;let lt=e(()=>{O||(Q(null),Je(null))},"close"),wt=e(()=>{te(!0),Q(null),fe(S.sessionId).then(()=>{te(!1),Je(null)}).catch(pe=>{te(!1),Q(On(pe,g))})},"confirm");return(0,a.jsxs)("div",{className:"dsham_sidebarCardRoot",children:[(0,a.jsx)("div",{className:"dsham_sidebarCardBackdrop",onClick:lt}),(0,a.jsxs)("div",{ref:Se,role:"dialog","aria-modal":!0,"aria-label":g("deleteSession.title"),tabIndex:-1,className:"dsham_sidebarCard",style:Ae?{top:Ae.top,left:Ae.left,visibility:"visible"}:{visibility:"hidden",top:0,left:0},children:[(0,a.jsx)("h3",{className:"dsham_sidebarCardTitle",children:g("deleteSession.confirmTitle")}),(0,a.jsx)("p",{className:"dsham_sidebarCardDesc",children:g("deleteSession.desc",{name:S.title})}),O&&(0,a.jsx)("div",{className:"dsham_sidebarCardDesc",role:"status",children:g("deleteSession.pending")}),Ee!==null&&(0,a.jsx)("div",{className:"dsham_sidebarCardError",role:"alert",children:Ee}),(0,a.jsxs)("div",{className:"dsham_sidebarCardFooter",children:[(0,a.jsx)("button",{ref:Te,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnCancel",disabled:O,onClick:lt,children:g("cancel")}),(0,a.jsx)("button",{ref:We,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnDanger",disabled:O,onClick:wt,children:g("deleteSession.title")})]})]})]})}e(Mt,"DeleteSessionOverlay");let Pt=null,Ht=new Set,ot=e(g=>{Pt=g;for(let S of Ht)S()},"publishArchiveWsTarget");function Ce(){return l.useSyncExternalStore(g=>(Ht.add(g),()=>{Ht.delete(g)}),()=>Pt,()=>Pt)}e(Ce,"useArchiveWsRequest");function It(g){try{let S=document.querySelector(`[data-row-key="workspace:${CSS.escape(g)}"]`);return S?(S.hasAttribute("tabindex")||(S.setAttribute("tabindex","-1"),S.addEventListener("blur",()=>S.removeAttribute("tabindex"),{once:!0})),typeof c.focusWithoutRing=="function"?c.focusWithoutRing(S):S.focus(),!0):!1}catch{return!1}}e(It,"focusWorkspaceRow");function Qt({t:g}){let S=Ce(),[O,te]=(0,l.useState)(!1),[Ee,Q]=(0,l.useState)(null),[Ae,we]=(0,l.useState)(null),Se=(0,l.useRef)(null),Te=(0,l.useRef)(null),We=(0,l.useRef)(null);if((0,l.useLayoutEffect)(()=>{if(S===null||typeof document>"u"){we(null);return}let pe=null,ae=e(()=>{if(pe&&pe.isConnected)return pe;try{pe=document.querySelector(`[data-row-key="workspace:${CSS.escape(S.workspaceId)}"]`)}catch{pe=null}return pe},"getTargetRow"),M=e(()=>{let je=Se.current,ke=je?.offsetWidth||290,qe=je?.offsetHeight||160,Ve=8,Ye=ae();if(!Ye){let ge=window.innerWidth,Rt=window.innerHeight,pt=Math.max(16,(Rt-qe)/2),Xe=Math.max(16,(ge-ke)/2);we(xe=>xe!==null&&xe.top===pt&&xe.left===Xe?xe:{top:pt,left:Xe});return}let ht=Ye.getBoundingClientRect(),Fe=ht.top-4;Fe+qe>window.innerHeight-16&&(Fe=window.innerHeight-16-qe),Fe<16&&(Fe=16);let Be=ht.right+Ve;Be+ke>window.innerWidth-16&&(Be=ht.left-ke-Ve),Be<16&&(Be=16),we(ge=>ge!==null&&ge.top===Fe&&ge.left===Be?ge:{top:Fe,left:Be})},"updatePosition");M(),window.addEventListener("scroll",M,!0),window.addEventListener("resize",M);let oe=null;return typeof ResizeObserver<"u"&&Se.current&&(oe=new ResizeObserver(M),oe.observe(Se.current)),()=>{oe?.disconnect(),window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",M)}},[S]),(0,l.useEffect)(()=>{if(S===null)return;Te.current&&!Te.current.disabled?Te.current.focus():Se.current?.focus();let pe=S.workspaceId;return()=>{It(pe)}},[S]),(0,l.useEffect)(()=>{S!==null&&O&&Se.current?.focus()},[S,O]),(0,l.useEffect)(()=>{if(S===null)return;let pe=e(ae=>{if(ae.key==="Escape"){ae.preventDefault(),ae.stopPropagation(),"stopImmediatePropagation"in ae&&typeof ae.stopImmediatePropagation=="function"&&ae.stopImmediatePropagation(),O||(Q(null),ot(null));return}if(ae.key==="Tab"){if(ae.preventDefault(),O){Se.current?.focus();return}let M=Te.current,oe=We.current;if(!M||!oe)return;ae.shiftKey?document.activeElement===M?oe.focus():M.focus():document.activeElement===oe?M.focus():oe.focus()}},"onKey");return window.addEventListener("keydown",pe,!0),()=>window.removeEventListener("keydown",pe,!0)},[S,O]),S===null)return null;let lt=e(()=>{O||(Q(null),ot(null))},"close"),wt=e(()=>{te(!0),Q(null);let ae=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(ke=>ke.workspaceId===S.workspaceId),M=n.sessions.list?.getSnapshot?.()?.byId??{},oe=new Set(n.workspaces.list?.getSnapshot?.()?.archivedSessionIds??[]),je=(ae?.sessionIds??[]).filter(ke=>Pn(ke,M,oe));Vn(n.workspaces,je,A).then(ke=>{if(te(!1),ke.failures.length>0){Q(fn(ke.failures,g));return}ot(null)}).catch(ke=>{te(!1),Q(vr(ke,g))})},"confirm");return(0,a.jsxs)("div",{className:"dsham_sidebarCardRoot",children:[(0,a.jsx)("div",{className:"dsham_sidebarCardBackdrop",onClick:lt}),(0,a.jsxs)("div",{ref:Se,role:"dialog","aria-modal":!0,"aria-label":g("menu.archiveWorkspace"),tabIndex:-1,className:"dsham_sidebarCard",style:Ae?{top:Ae.top,left:Ae.left,visibility:"visible"}:{visibility:"hidden",top:0,left:0},children:[(0,a.jsx)("h3",{className:"dsham_sidebarCardTitle",children:g("archiveWorkspace.title",{n:S.count})}),(0,a.jsx)("p",{className:"dsham_sidebarCardDesc",children:g("archiveWorkspace.desc",{name:S.title})}),O&&(0,a.jsx)("div",{className:"dsham_sidebarCardDesc",role:"status",children:g("archiveWorkspace.pending")}),Ee!==null&&(0,a.jsx)("div",{className:"dsham_sidebarCardError",role:"alert",children:Ee}),(0,a.jsxs)("div",{className:"dsham_sidebarCardFooter",children:[(0,a.jsx)("button",{ref:Te,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnCancel",disabled:O,onClick:lt,children:g("cancel")}),(0,a.jsx)("button",{ref:We,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnDanger",disabled:O,onClick:wt,children:g("archiveWorkspace.confirm")})]})]})]})}e(Qt,"ArchiveWorkspaceOverlay");function K(g){if(typeof document>"u"||typeof document.addEventListener!="function"||typeof MutationObserver>"u")return()=>{};let S=null,O=!1,te=new Map,Ee=!1,Q=e(M=>{let je=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(Ve=>Ve.workspaceId===M);if(je===void 0)return[];let ke=n.sessions.list?.getSnapshot?.()?.byId??{},qe=new Set(n.workspaces.list?.getSnapshot?.()?.archivedSessionIds??[]);return je.sessionIds.filter(Ve=>Pn(Ve,ke,qe))},"workspaceCandidateIds"),Ae=e(()=>{if(Ee=!1,!O)for(let[M,oe]of te){if(!M.isConnected){te.delete(M);continue}let je=Q(oe.workspaceId).length===0;M.disabled=je,M.style.opacity=je?"0.5":"",M.style.cursor=je?"not-allowed":""}},"revalidateItems"),we=e(()=>{if(te.size===0||Ee||O)return;Ee=!0;let M=e(()=>Ae(),"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(M):setTimeout(M,16)},"scheduleRevalidate"),Se=e(M=>{S=kr(M.target)},"rememberWorkspace");document.addEventListener("pointerdown",Se,!0),document.addEventListener("click",Se,!0);let Te=e(()=>{if(O)return;for(let[oe]of te)oe.isConnected||te.delete(oe);let M=document.querySelectorAll('[role="menu"]');for(let oe of M){if(oe.querySelector('[data-dsham-archive-workspace="true"]'))continue;let je=Array.from(oe.querySelectorAll('button[role="menuitem"]'));if(je.length===0)continue;let ke=je.find(st=>Ln(st,!1))??je.find(st=>Ln(st,!0));if(!ke)continue;let qe=je.find(st=>st!==ke)??ke,Ve=ke.parentElement;if(!Ve)continue;let Ye=S;if(!Ye)continue;let Fe=Q(Ye.workspaceId).length,Be=document.createElement("div");Be.className=Ve.className;let ge=document.createElement("button");ge.type="button",ge.setAttribute("role","menuitem"),ge.dataset.dshamArchiveWorkspace="true",ge.className=qe.className.split(/\s+/).filter(st=>!/(?:^|[_-])danger(?:$|[_-])/i.test(st)).join(" ");let Rt=qe.querySelector("span"),pt=qe.querySelectorAll("span")[1],Xe=document.createElement("span");Xe.setAttribute("aria-hidden","true"),Rt?.className&&(Xe.className=Rt.className),Xe.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 xe=document.createElement("span");pt?.className&&(xe.className=pt.className),xe.textContent=g("menu.archiveWorkspace"),ge.append(Xe,xe),Be.append(ge),Fe===0&&(ge.disabled=!0,ge.style.opacity="0.5",ge.style.cursor="not-allowed"),ge.addEventListener("click",st=>{st.preventDefault(),st.stopPropagation();let tn=Q(Ye.workspaceId).length;tn!==0&&(document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),ot({workspaceId:Ye.workspaceId,title:Ye.title,count:tn}))}),Ve.parentNode?.insertBefore(Be,Ve),te.set(ge,{workspaceId:Ye.workspaceId})}},"checkAndInject"),We=!1,lt=e(()=>{if(We||O)return;We=!0;let M=e(()=>{We=!1,!O&&Te()},"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(M):setTimeout(M,16)},"scheduleInject"),wt=new MutationObserver(M=>{vn(M,'[role="menu"]')&&lt()});wt.observe(document.body,{childList:!0,subtree:!0});let pe=n.sessions.list?.subscribe?.(we),ae=n.workspaces.list?.subscribe?.(we);return()=>{O=!0,document.removeEventListener("pointerdown",Se,!0),document.removeEventListener("click",Se,!0),wt.disconnect(),pe?.(),ae?.(),te.clear();for(let M of document.querySelectorAll('[data-dsham-archive-workspace="true"]'))M.parentElement?.remove()}}e(K,"setupWorkspaceMenuInjector");function He(){return typeof n.slots.entries!="function"?!1:n.slots.entries("sidebar.workspaces").some(g=>g.children?.[Oe]!==void 0)}e(He,"hostSidebarDeclaresSessionMenu");let dt,G,Xt,Me,Lt,ut=e(()=>{let g=He()?"menu":"waiting";g!==dt&&(dt=g,g==="menu"&&(G??=n.slots.inject(Oe,()=>n.slots.register({name:Oe,id:"archive-manager.delete-session",order:500,locale:$e,inject:e(()=>({}),"inject")},Jt)),Xt??=n.slots.inject(Oe,()=>n.slots.register({name:Oe,id:"archive-manager.favorite",order:350,locale:$e,inject:e(()=>({favoriteRow:be}),"inject")},vt)),Me??=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")},Mt)),Lt??=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")},Qt))))},"reconcileSidebar");ut(),n.effect(()=>K(n.locale.bind($e)),"archive-manager: workspace menu injector"),_r(n);let en=typeof n.on=="function"?n.on("slots/changed",g=>{if(g==="sidebar.workspaces")try{ut()}catch(S){console.warn("archive-manager: sidebar mode switch failed",S)}}):void 0;n.effect(()=>()=>{en?.(),G?.(),Xt?.(),Me?.(),Lt?.()},"archive-manager: sidebar mode");let Qe=e(()=>({archiveSessions:rt,archiveSession:e((g,S)=>n.workspaces.archiveSession(g,S),"archiveSession"),sessionStore:qn(n.sessions.list),workspaceStore:qn(n.workspaces.list),unarchiveSession:Ie,deleteSession:fe,unarchiveSessions:Ke,deleteArchivedSessions:W,archivedSessionMetadata:q,openConversation:p,focusSessionWorkspace:k,viewState:i,favoriteSessions:gt,setSessionFavorite:Y,favoriteSync:be,organizeBatch:ze,diagnoseOrphanSubagents:D,cleanOrphanSubagents:me,diagnoseSessionCaches:P,rebuildSessionCaches:h,refreshCacheLists:ue,searchSessionContent:Ue,searchArchivedContent:he,previewArchivedSession:it,t:n.locale.bind($e)}),"buildArchivedSectionProps"),bt=cr(n,{callApi:e(async(g,S)=>{let O=Rn(`/api/michengai/dsh-archive-manager${g}`),te=Object.assign({"content-type":"application/json","x-michengai-plugin-update":"1"},S?.headers),Ee=await fetch(O,Object.assign({},S,{headers:te})),Q=await Ee.json();if(!Ee.ok||!Q||Q.ok===!1)throw new Error((Q&&typeof Q=="object"&&typeof Q.error=="string"?Q.error:void 0)||`HTTP ${Ee.status}`);return Q},"callSettingsApi"),renderPanel:e(g=>(0,a.jsx)(Nn,Object.assign({},Qe(),g)),"renderPanel"),injectProps:Qe,ns:$e,onOnlineUpdateChange:e(()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("dsham-update-toggle"))},"onOnlineUpdateChange")});n.effect(()=>()=>bt.destroy(),"archive-manager: sidebar entry"),n.effect(()=>Fs({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:re,isEnabled:e(()=>bt.isOnlineUpdateEnabled(),"isEnabled")}),"dsh-archive-manager: plugin update ui"),n.slots.inject("settings.section",()=>n.slots.register({name:"settings.section",id:"archived-sessions",order:45,label:e(()=>n.locale.bind($e)("archived.badge"),"label"),icon:"archive",locale:$e,inject:Qe},Nn))}e(Ia,"applyWorkspaceBrowser");async function Ra(n,r,i,u){try{await r(n)}catch(m){i(ta(m,u))}}return e(Ra,"forkWithFeedback"),o.__test={forkWithFeedback:Ra,favoritesOnlyVisibility:_e,favoriteGroupPredicate:nt,createFavoriteRowStore:hr,unarchivedSessionIds:Mr,ArchiveSelectionToolbar:Tr,ArchivedSessionsSection:Nn,zh:Fr,en:Br,displayTitle:Ge,sessionVisible:Ut,indexSubagentDescendants:hn,isUnknownSessionError:mn,deriveGroups:ca,deriveFlat:da,deriveSearchResults:ua,deriveArchivedGroups:Pr,sortArchivedGroups:Lr,deriveArchivedBatchIds:Zt,archivedSessionIdsInGroups:Nr,pruneArchivedSelection:zr,toggleArchivedSelection:Wn,archivedDeleteFeedback:Or,isWorkspaceTaskCandidate:Pn,isWorkspaceDeleteMenuItem:Ln,workspaceMenuTriggerFrom:kr,applySettingsNavIcon:Ir,restoreSettingsNavIcon:Rr,installSettingsNavIcon:_r,mutationTouches:vn,activeSessionActivity:gn,activeSessionRefusal:yr,activeArchiveFromMessage:br,archiveSessionsViaOfficial:Vn,unarchiveSessionsViaOfficial:Hr,createUnarchiveSession:Ur,createWorkspaceViewStore:Zs,migrateWorkspaceViewPersist:mr,WORKSPACE_VIEW_PERSIST_KEY:pn,LEGACY_WORKSPACE_VIEW_PERSIST_KEY:pr,bindObservable:qn,groupByWorkspace:Sr,byRecency:Yt,ARCHIVE_MANAGER_REMOTE:U,currentSessionId:kt,setupSidebarEntry:cr},o.apply=Aa,o.inject=Ea,s.exports}e(Ci,"startArchiveClient");
24
24
 
25
25
  return module.exports.startArchiveClient(require);
26
26
  }