@michengai/dsh-archive-manager 1.2.6 → 1.2.8

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,11 +7,11 @@ window.__ModuleLoader__.load({
7
7
  globalThis.__dshArchiveReactDOMClient = require("react-dom/client");
8
8
  var module = { exports: {} };
9
9
  var exports = module.exports;
10
- "use strict";var Vn=Object.defineProperty;var Ua=Object.getOwnPropertyDescriptor;var Wa=Object.getOwnPropertyNames;var qa=Object.prototype.hasOwnProperty;var e=(t,r)=>Vn(t,"name",{value:r,configurable:!0});var Va=(t,r)=>{for(var i in r)Vn(t,i,{get:r[i],enumerable:!0})},$a=(t,r,i,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of Wa(r))!qa.call(t,l)&&l!==i&&Vn(t,l,{get:()=>r[l],enumerable:!(s=Ua(r,l))||s.enumerable});return t};var Ga=t=>$a(Vn({},"__esModule",{value:!0}),t);var yi={};Va(yi,{startArchiveClient:()=>bi});module.exports=Ga(yi);function ce(t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError("\u53C2\u6570\u5FC5\u987B\u4E3A\u5BF9\u8C61");return t}e(ce,"record");function Oe(t){return String(t&&typeof t=="object"&&"message"in t?t.message??t:t)}e(Oe,"errorMessage");function $n(t){return t&&typeof t=="object"&&"code"in t?t.code:void 0}e($n,"errorCode");var cs=Function("return globalThis.__dshArchiveReact")(),{Children:Ci,Component:Ei,Fragment:ds,Profiler:Ii,PureComponent:Ti,StrictMode:Ai,Suspense:_i,cloneElement:Ri,createContext:ji,createElement:us,createRef:Ni,forwardRef:Mi,isValidElement:Di,lazy:Li,memo:zi,startTransition:Pi,useCallback:Oi,useContext:Fi,useDebugValue:Hi,useDeferredValue:Bi,useEffect:hs,useId:Ui,useImperativeHandle:Wi,useInsertionEffect:qi,useLayoutEffect:Vi,useMemo:$i,useReducer:Gi,useRef:Ki,useState:qt,useSyncExternalStore:Yi,useTransition:Zi,version:Ji}=cs,W=cs;function ms(t){return W.createElement("input",{className:"dsham_number",type:"number",min:t.min,max:t.max,value:t.value??"",disabled:t.disabled,"aria-label":t["aria-label"],onChange:e(r=>{let i=r.target.value;if(i===""){t.onChange(null);return}let s=Number(i);t.onChange(Number.isNaN(s)?null:s)},"onChange")})}e(ms,"NumberField");function Ya(t=W.createElement){return t("svg",{className:"dsham_dateIcon",width:14,height:14,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},t("rect",{x:2,y:3,width:12,height:11,rx:2}),t("line",{x1:2,y1:6.5,x2:14,y2:6.5}),t("line",{x1:5.5,y1:1.5,x2:5.5,y2:3.5}),t("line",{x1:10.5,y1:1.5,x2:10.5,y2:3.5}))}e(Ya,"CalendarIcon");function Nn(t,r,i){let s=String(r+1).padStart(2,"0"),l=String(i).padStart(2,"0");return`${t}-${s}-${l}`}e(Nn,"formatYmd");function mn(t){let r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);return r?{year:Number(r[1]),monthIndex:Number(r[2])-1,day:Number(r[3])}:null}e(mn,"parseYmd");function Za(t,r){let i=new Date(t,r,1).getDay(),s=(i===0?7:i)-1,l=new Date(t,r+1,0).getDate(),u=new Date(t,r,0).getDate(),m=[];for(let C=0;C<42;C++){let y=t,_=r,x=0,g=!1;C<s?(x=u-s+C+1,_=r-1,_<0&&(_=11,y--),g=!0):C<s+l?x=C-s+1:(x=C-s-l+1,_=r+1,_>11&&(_=0,y++),g=!0),m.push({year:y,monthIndex:_,day:x,dateStr:Nn(y,_,x),isOutside:g})}return m}e(Za,"buildMonthGrid");function Ja(t,r=new Date){if(t==="all")return{from:"",to:""};let i=Nn(r.getFullYear(),r.getMonth(),r.getDate());if(t==="today")return{from:i,to:i};let s=t==="7d"?6:t==="30d"?29:89,l=new Date(r.getTime()-s*864e5);return{from:Nn(l.getFullYear(),l.getMonth(),l.getDate()),to:i}}e(Ja,"getPresetRange");function ps(t,r,i,s){let l=r+s,u=new Date(t,l+1,0).getDate();return new Date(t,l,Math.min(i,u))}e(ps,"shiftMonthClamped");function fs(t){let r=t.React||W;function i(T,he){let it=T==="from"?he:t.from,vn=T==="to"?he:t.to;if(it===""&&vn===""){t.onClear();return}T==="from"?t.onFrom(he):t.onTo(he)}e(i,"change");let s=!!(t.from||t.to),l="";t.from&&t.to?l=`${t.from} \u2013 ${t.to}`:t.from?l=`${t.from} \u2013`:t.to?l=`\u2013 ${t.to}`:l=t.t?t.t("discovery.timeRange")||`${t.fromLabel} \u2013 ${t.toLabel}`:`${t.fromLabel} \u2013 ${t.toLabel}`;let m=(r.useRef??(T=>{let[he]=r.useState({current:T});return he}))(null),[C,y]=r.useState(!1),_=mn(t.from||t.to)??{year:new Date().getFullYear(),monthIndex:new Date().getMonth(),day:new Date().getDate()},[x,g]=r.useState(_.year),[w,D]=r.useState(_.monthIndex),[j,U]=r.useState(null),[P,B]=r.useState(null),[me,le]=r.useState(null);r.useEffect(()=>{if(!C)return;let T=e(it=>{m.current&&!m.current.contains(it.target)&&(y(!1),U(null))},"onPointerDown"),he=e(it=>{it.key==="Escape"&&(it.preventDefault(),it.stopPropagation(),y(!1),U(null))},"onKeyDown");return typeof document<"u"&&document.addEventListener("mousedown",T,!0),typeof window<"u"&&window.addEventListener("keydown",he,!0),()=>{typeof document<"u"&&document.removeEventListener("mousedown",T,!0),typeof window<"u"&&window.removeEventListener("keydown",he,!0)}},[C]),r.useEffect(()=>{if(!C||!me||!m.current)return;m.current.querySelector(`[data-date="${me}"]`)?.focus()},[C,me]);let V=t.t?t.t("discovery.today")==="Today"||(t.t("locale.language")||"").startsWith("en"):!1,fe=t.t?t.t("discovery.today")==="\u0421\u0435\u0433\u043E\u0434\u043D\u044F"||(t.t("locale.language")||"").startsWith("ru"):!1,ue=V?"en-US":fe?"ru-RU":"zh-CN",Qe=V?["Mo","Tu","We","Th","Fr","Sa","Su"]:fe?["\u041F\u043D","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041F\u0442","\u0421\u0431","\u0412\u0441"]:["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u65E5"];function re(T){T.stopPropagation(),w<=0?(D(11),g(he=>he-1)):D(he=>he-1)}e(re,"prevMonth");function X(T){T.stopPropagation(),w>=11?(D(0),g(he=>he+1)):D(he=>he+1)}e(X,"nextMonth");function yt(T){j?(T>=j?(t.onFrom(j),t.onTo(T)):(t.onFrom(T),t.onTo(j)),U(null),y(!1)):(U(T),B(T))}e(yt,"handleDayClick");function St(T){let he=Ja(T);T==="all"?t.onClear():(t.onFrom(he.from),t.onTo(he.to)),U(null),y(!1)}e(St,"applyPreset");function et(T){let he=Nn(T.getFullYear(),T.getMonth(),T.getDate());le(he),j&&B(he),(T.getFullYear()!==x||T.getMonth()!==w)&&(g(T.getFullYear()),D(T.getMonth()))}e(et,"moveFocusToDate");function dt(T,he){let it=mn(T);it&&et(new Date(it.year,it.monthIndex,it.day+he))}e(dt,"moveFocus");let xt=t.from,$e=t.to;j&&P&&(xt=j<=P?j:P,$e=j<=P?P:j);let en=Za(x,w),tt=new Date,tn=me||xt||Nn(tt.getFullYear(),tt.getMonth(),tt.getDate()),F=en.map((T,he)=>{let it=xt===T.dateStr,vn=$e===T.dateStr,Ht=!!(xt&&$e&&T.dateStr>xt&&T.dateStr<$e),Ln=T.year===tt.getFullYear()&&T.monthIndex===tt.getMonth()&&T.day===tt.getDate(),Bt="dsham_dateDay";T.isOutside&&(Bt+=" is-outside"),Ln&&(Bt+=" is-today"),it&&(Bt+=" is-start"),vn&&(Bt+=" is-end"),Ht&&(Bt+=" is-in-range");let zn=!T.isOutside&&(T.dateStr===tn||T.day===1&&!en.some(ie=>!ie.isOutside&&ie.dateStr===tn));return r.createElement("div",{key:he,className:Bt,role:"button",tabIndex:zn?0:-1,"data-date":T.dateStr,"aria-label":T.dateStr,"aria-pressed":!!(it||vn||Ht),onClick:e(ie=>{ie.stopPropagation(),yt(T.dateStr)},"onClick"),onKeyDown:e(ie=>{if(ie.key==="Enter"||ie.key===" ")ie.preventDefault(),ie.stopPropagation(),yt(T.dateStr);else if(ie.key==="ArrowLeft")ie.preventDefault(),ie.stopPropagation(),dt(T.dateStr,-1);else if(ie.key==="ArrowRight")ie.preventDefault(),ie.stopPropagation(),dt(T.dateStr,1);else if(ie.key==="ArrowUp")ie.preventDefault(),ie.stopPropagation(),dt(T.dateStr,-7);else if(ie.key==="ArrowDown")ie.preventDefault(),ie.stopPropagation(),dt(T.dateStr,7);else if(ie.key==="Home"){ie.preventDefault(),ie.stopPropagation();let ke=mn(T.dateStr);if(ke){let ot=new Date(ke.year,ke.monthIndex,ke.day),ln=(ot.getDay()===0?7:ot.getDay())-1;ot.setDate(ot.getDate()-ln),et(ot)}}else if(ie.key==="End"){ie.preventDefault(),ie.stopPropagation();let ke=mn(T.dateStr);if(ke){let ot=new Date(ke.year,ke.monthIndex,ke.day),ln=(ot.getDay()===0?7:ot.getDay())-1;ot.setDate(ot.getDate()+(6-ln)),et(ot)}}else if(ie.key==="PageUp"){ie.preventDefault(),ie.stopPropagation();let ke=mn(T.dateStr);ke&&et(ps(ke.year,ke.monthIndex,ke.day,-1))}else if(ie.key==="PageDown"){ie.preventDefault(),ie.stopPropagation();let ke=mn(T.dateStr);ke&&et(ps(ke.year,ke.monthIndex,ke.day,1))}},"onKeyDown"),onMouseEnter:e(()=>{j&&B(T.dateStr)},"onMouseEnter")},T.day)}),De=`${x}\u5E74 ${w+1}\u6708`;try{De=new Intl.DateTimeFormat(ue,{year:"numeric",month:"long"}).format(new Date(x,w,1))}catch{De=V||fe?`${x}-${String(w+1).padStart(2,"0")}`:`${x}\u5E74 ${w+1}\u6708`}return r.createElement("div",{ref:m,className:"dsham_dateRange",role:"group","aria-label":t.label},r.createElement("input",{className:"dsham_dateInputSrOnly",type:"date",tabIndex:-1,"aria-hidden":!0,value:t.from,"aria-label":t.fromLabel,"aria-invalid":t.invalid||void 0,onChange:e(T=>i("from",T.target.value),"onChange")}),r.createElement("input",{className:"dsham_dateInputSrOnly",type:"date",tabIndex:-1,"aria-hidden":!0,value:t.to,"aria-label":t.toLabel,"aria-invalid":t.invalid||void 0,onChange:e(T=>i("to",T.target.value),"onChange")}),r.createElement("div",{className:"dsham_dateTrigger"+(C?" is-open":""),role:"button",tabIndex:0,"aria-expanded":C,"aria-controls":C?"dsham-date-popover":void 0,onClick:e(()=>{C&&U(null),y(!C)},"onClick"),onKeyDown:e(T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),C&&U(null),y(!C))},"onKeyDown")},Ya(r.createElement),r.createElement("span",{className:"dsham_dateText"+(s?"":" placeholder")},l),s?r.createElement("button",{type:"button",className:"dsham_dateClearBtn","aria-label":"clear",title:"clear",onClick:e(T=>{T.stopPropagation(),t.onClear(),U(null)},"onClick"),children:"\xD7"}):null,r.createElement("span",{className:"dsham_dateChevron"},gs(r.createElement,C))),C&&r.createElement("div",{id:"dsham-date-popover",className:"dsham_datePopover",role:"region","aria-label":t.label,onClick:e(T=>T.stopPropagation(),"onClick")},r.createElement("div",{className:"dsham_datePresets"},r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>St("all"),"onClick")},t.t?t.t("discovery.allTime"):"\u5168\u90E8\u65F6\u95F4"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>St("today"),"onClick")},t.t?t.t("discovery.today"):"\u4ECA\u5929"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>St("7d"),"onClick")},t.t?t.t("discovery.last7Days"):"\u8FD1 7 \u5929"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>St("30d"),"onClick")},t.t?t.t("discovery.last30Days"):"\u8FD1 30 \u5929"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>St("90d"),"onClick")},t.t?t.t("discovery.last90Days"):"\u8FD1 90 \u5929")),r.createElement("div",{className:"dsham_dateCalendar"},r.createElement("div",{className:"dsham_dateCalHeader"},r.createElement("button",{type:"button",className:"dsham_dateNavBtn",onClick:re,"aria-label":"prev month"},"\u2039"),r.createElement("span",{className:"dsham_dateMonthTitle"},De),r.createElement("button",{type:"button",className:"dsham_dateNavBtn",onClick:X,"aria-label":"next month"},"\u203A")),r.createElement("div",{className:"dsham_dateGrid"},Qe.map((T,he)=>r.createElement("div",{key:he,className:"dsham_dateWeekday"},T))),r.createElement("div",{className:"dsham_dateGrid"},F))))}e(fs,"DateRange");function Gn(t){return W.createElement("div",{className:t.className},W.createElement("button",{type:"button",className:"dsham_disclosure","aria-expanded":t.open,onClick:t.onToggle},gs(W.createElement,t.open),t.title),t.open?W.createElement("div",null,t.children):null)}e(Gn,"Disclosure");function gs(t,r){return t("svg",{className:"dsham_foldChevron"+(r?" is-open":""),viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":!0},t("path",{d:"M4 6l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"}))}e(gs,"foldChevron");function ur(t){let r=W.useRef(null);return W.useEffect(()=>{r.current&&(r.current.indeterminate=!!t.indeterminate&&!t.checked)},[t.indeterminate,t.checked]),W.createElement("input",{ref:r,className:"dsham_checkbox",type:"checkbox",checked:t.checked,disabled:t.disabled,"aria-label":t.label,onChange:e(i=>t.onChange({target:{checked:i.target.checked}}),"onChange")})}e(ur,"SelectionCheckbox");var Mn=e(t=>{if(typeof t!="string"||!t.length||t.length>1024)throw new TypeError("\u4F1A\u8BDD ID \u65E0\u6548");return t},"id"),bs=e((t,r=!1)=>{if(typeof t!="string"||t.length>200||r&&!t.trim())throw new TypeError("\u5173\u952E\u8BCD\u987B\u4E3A 1\uFF5E200 \u4E2A\u5B57\u7B26");return t.trim()},"queryText"),vs={parse(t){let r=ce(t);if(!r||!Array.isArray(r.sessionIds)||!r.sessionIds.length||r.sessionIds.length>20)throw new TypeError("\u6BCF\u6B21\u68C0\u7D22\u987B\u5305\u542B 1\uFF5E20 \u4E2A\u4F1A\u8BDD");return{sessionIds:[...new Set(r.sessionIds.map(Mn))],query:bs(r.query,!0)}}},Xa={parse(t){let r=ce(t);if(!r)throw new TypeError("\u9884\u89C8\u53C2\u6570\u65E0\u6548");return{sessionId:Mn(r.sessionId),query:bs(r.query??"")}}},hr=e((t,r)=>{if(typeof t!="string"||t.length>r)throw new TypeError("\u8FD4\u56DE\u6587\u672C\u65E0\u6548");return t},"boundedString"),ys=e(t=>{if(typeof t!="number"||!Number.isSafeInteger(t)||t<0)throw new TypeError("\u6D88\u606F\u5E8F\u53F7\u65E0\u6548");return t},"sequence"),pr={parse(t){let r=ce(t);if(!r||!Array.isArray(r.items)||!Array.isArray(r.failures)||r.items.length>20||r.failures.length>20)throw new TypeError("\u68C0\u7D22\u7ED3\u679C\u65E0\u6548");return{items:r.items.map(ce).map(i=>({sessionId:Mn(i.sessionId),seq:ys(i.seq),snippet:hr(i.snippet,400)})),failures:r.failures.map(ce).map(i=>({sessionId:Mn(i.sessionId),message:hr(i.message,500)}))}}},Qa={parse(t){let r=ce(t);if(!r||!Array.isArray(r.messages)||r.messages.length>8||typeof r.hasEarlier!="boolean"||typeof r.hasLater!="boolean")throw new TypeError("\u9884\u89C8\u7ED3\u679C\u65E0\u6548");return{sessionId:Mn(r.sessionId),hasEarlier:r.hasEarlier,hasLater:r.hasLater,messages:r.messages.map(ce).map(i=>{if(typeof i.role!="string"||!["user","assistant"].includes(i.role)||typeof i.truncated!="boolean")throw new TypeError("\u6D88\u606F\u89D2\u8272\u6216\u622A\u65AD\u72B6\u6001\u65E0\u6548");return{seq:ys(i.seq),role:i.role,text:hr(i.text,2e3),truncated:i.truncated}})}}};async function Yn(t,r=globalThis.navigator?.clipboard){if(typeof t!="string"||!t)throw Object.assign(new Error("\u6CA1\u6709\u53EF\u590D\u5236\u7684\u5185\u5BB9"),{code:"copy.empty"});if(!r?.writeText)throw Object.assign(new Error("\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u526A\u8D34\u677F\uFF0C\u8BF7\u5728 HTTPS \u6216\u672C\u673A\u5730\u5740\u4E2D\u6253\u5F00\u9875\u9762"),{code:"copy.unavailable"});try{await r.writeText(t)}catch{throw Object.assign(new Error("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u5141\u8BB8\u6D4F\u89C8\u5668\u8BBF\u95EE\u526A\u8D34\u677F\u540E\u91CD\u8BD5"),{code:"copy.denied"})}}e(Yn,"copySessionText");function ws(){let t=e((i,s)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${i}`,create:e(()=>s,"create"),schema:s}),"codec");return[["searchSessionContent",vs,pr],["searchArchivedContent",vs,pr],["previewArchivedSession",Xa,Qa]].map(([i,s,l])=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${i}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:i,invocation:{kind:"direct"},parameters:[{name:"input",wire:"input",source:"json",codec:t(i+"Input",s)}],result:t(i+"Result",l),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}e(ws,"discoveryInvocations");function Ss(t,r){let i=r?.trim().toLowerCase();if(!i)return null;let s=t.toLowerCase().indexOf(i);if(s<0)return null;let l=0,u=0,m;for(let C of t){let y=u+C.toLowerCase().length;if(m===void 0&&y>s&&(m=l),l+=C.length,y>=s+i.length)return{start:m??l,end:l};u=y}return null}e(Ss,"findTextRange");function Kn(t,r=!1){if(!/^\d{4}-\d{2}-\d{2}$/.test(t))return NaN;let[i,s,l]=t.split("-").map(Number),u=new Date(i,s-1,l);return u.getFullYear()!==i||u.getMonth()!==s-1||u.getDate()!==l?NaN:(r&&u.setDate(u.getDate()+1),u.getTime())}e(Kn,"dayBoundary");function mr(t,r){return(!t||Number.isFinite(Kn(t)))&&(!r||Number.isFinite(Kn(r)))&&(!t||!r||t<=r)}e(mr,"validUpdatedRange");function xs(t,r,i){if(!mr(r,i))return!1;if(!r&&!i)return!0;let s=typeof t=="number"?t:Date.parse(t??"");return Number.isFinite(s)&&(!r||s>=Kn(r))&&(!i||s<Kn(i,!0))}e(xs,"matchesUpdatedRange");async function ks(t,r,i,{signal:s,onProgress:l}={}){let u=[],m=[],C=[...new Set(t)],y=e(()=>{if(s?.aborted)throw new Error("\u641C\u7D22\u5DF2\u53D6\u6D88")},"check");for(let _=0;_<C.length;_+=20){y();let x=pr.parse(await i({sessionIds:C.slice(_,_+20),query:r}));y(),u.push(...x.items),m.push(...x.failures),l?.({done:Math.min(_+20,C.length),total:C.length,items:[...u],failures:[...m]})}return y(),{items:u,failures:m}}e(ks,"searchArchiveBatches");function Cs(t,r={}){let i=t.createElement;function s({text:g,query:w=""}){let D=Ss(g,w);return D?i(t.Fragment,null,g.slice(0,D.start),i("mark",null,g.slice(D.start,D.end)),g.slice(D.end)):g}e(s,"HighlightedText");function l(g,w,D,j){let U=JSON.stringify(g),P=JSON.stringify([U,w]),[B,me]=t.useState(0),[le,V]=t.useState({key:"",status:"idle",items:[],failures:[]});return t.useEffect(()=>{if(!D||!w.trim()||!j)return;let ue=new AbortController;V({key:P,status:"loading",items:[],failures:[],done:0,total:g.length});let Qe=setTimeout(()=>{ks(JSON.parse(U),w,j,{signal:ue.signal,onProgress:e(re=>{ue.signal.aborted||V({key:P,status:"loading",...re})},"onProgress")}).then(re=>{ue.signal.aborted||V({key:P,status:"ready",done:g.length,total:g.length,...re})}).catch(re=>{ue.signal.aborted||V(X=>({...X,key:P,status:"error",error:Oe(re)}))})},350);return()=>{ue.abort(),clearTimeout(Qe)}},[U,w,D,j,B]),{...D&&w.trim()&&j?le.key===P?le:{key:P,status:"loading",items:[],failures:[],done:0,total:g.length}:{status:"idle",items:[],failures:[]},retry:e(()=>me(ue=>ue+1),"retry")}}e(l,"useArchiveSearch");function u(g,w){let[D,j]=t.useState(null),[U,P]=t.useState({status:"idle"}),[B,me]=t.useState(0),le=D,V=D&&w.includes(D.session.id);return t.useEffect(()=>{D&&!V&&j(null)},[D,V]),t.useEffect(()=>{if(!V||typeof window>"u")return;let fe=e(ue=>{ue.key==="Escape"&&(ue.preventDefault(),ue.stopPropagation(),ue.stopImmediatePropagation(),j(null))},"onKeyDown");return window.addEventListener("keydown",fe,!0),()=>window.removeEventListener("keydown",fe,!0)},[V]),t.useEffect(()=>{if(!D||!V||!g)return;let fe=!0;return P({key:le,status:"loading"}),Promise.resolve().then(()=>g({sessionId:D.session.id,query:D.query})).then(ue=>{fe&&P({key:le,status:"ready",value:ue})}).catch(ue=>{fe&&P({key:le,status:"error",error:Oe(ue)})}),()=>{fe=!1}},[le,V,g,B]),{target:V?D:null,...U.key===le?U:{status:"loading"},open:e((fe,ue="")=>j({session:fe,query:ue}),"open"),close:e(()=>j(null),"close"),retry:e(()=>me(fe=>fe+1),"retry")}}e(u,"useArchivePreview");function m({title:g,failures:w,separator:D}){let[j,U]=t.useState(!1),P=i("ul",null,w.map(B=>i("li",{key:B.sessionId},B.sessionId,D,B.message)));return i(Gn,{title:g,open:j,onToggle:e(()=>U(B=>!B),"onToggle")},P)}e(m,"FailureDetails");function C(g,w){let D=r.Button??(j=>i("button",{type:"button",disabled:j.disabled,onClick:j.onClick},j.children));return i(D,{variant:"outline",size:"sm",...w},g)}e(C,"textButton");function y({t:g,from:w,to:D,onFrom:j,onTo:U,invalid:P,onClear:B}){return i("div",{className:"dsham_dateFilter"},i(fs,{React:t,from:w,to:D,invalid:P,label:g("discovery.date"),fromLabel:g("discovery.from"),toLabel:g("discovery.to"),onFrom:j,onTo:U,onClear:B,t:g}),P?i("p",{className:"dsham_dateAlert",role:"alert"},g("discovery.invalidDate")):null)}e(y,"DiscoveryFilters");function _({state:g,t:w}){return g.status==="idle"?null:i("div",{className:"dsham_discoveryStatus",role:"status","aria-live":"polite"},i("p",null,w(g.status==="loading"?"discovery.searching":g.status==="error"?"discovery.searchError":"discovery.searched",{done:g.done??0,total:g.total??0})),g.status==="error"&&i("p",null,g.error),g.failures.length>0&&i(m,{title:w("discovery.failed",{n:g.failures.length}),failures:g.failures,separator:w("common.separator")}),(g.status==="error"||g.status==="ready"&&g.failures.length>0)&&C(w("discovery.retry"),{onClick:g.retry}))}e(_,"SearchStatus");function x({preview:g,t:w,MarkdownText:D}){let[j,U]=t.useState(!1);if(g.status==="loading")return i("p",{role:"status"},w("discovery.loading"));if(g.status==="error")return i("div",null,i("p",{role:"alert"},g.error),C(w("discovery.retry"),{onClick:g.retry}));let P=g.value;return P?i("div",{className:"dsham_previewMessages"},i("div",{className:"dsham_previewToolbar"},i("span",{title:w("discovery.previewHint")},w("discovery.readOnly")," \xB7 ",w("discovery.messageCount",{n:P.messages.length})),D&&i(r.SegmentedControl??"div",{id:"dsham-preview-mode",label:w("discovery.displayMode"),value:j?"raw":"formatted",options:[{value:"formatted",label:w("discovery.formatted")},{value:"raw",label:w("discovery.raw")}],onChange:e(B=>U(B==="raw"),"onChange")})),P.hasEarlier&&i("p",null,w("discovery.earlier")),!P.messages.length&&i("p",null,w("discovery.empty")),P.messages.map(B=>i("article",{key:B.seq,className:"dsham_previewMessage"},i("div",{className:"dsham_previewRole","data-role":B.role},i("span",{"aria-hidden":!0},w(B.role==="user"?"discovery.you":"discovery.ai")),i("strong",null,w("discovery."+B.role))),j||!D?i("pre",{className:"dsham_previewRaw"},i(s,{text:B.text,query:g.target?.query})):i(D,{text:B.text,streaming:!1,labels:{code:{copyLabel:w("discovery.copyCode"),copiedLabel:w("details.copied")},footnotes:w("discovery.footnotes")}}),B.truncated&&i("small",null,w("discovery.truncated")))),P.hasLater&&i("p",null,w("discovery.later"))):null}return e(x,"PreviewContent"),{HighlightedText:s,useArchiveSearch:l,useArchivePreview:u,DiscoveryFilters:y,SearchStatus:_,PreviewContent:x}}e(Cs,"createDiscoveryTools");var Es=[".dsham_dateFilter{display:flex;align-items:center;gap:8px;min-width:0;position:relative}",".dsham_dateAlert{position:absolute;top:calc(100% + 4px);right:0;margin:0;width:max-content;max-width:240px;padding:4px 8px;background:var(--dsw-alias-bg-layer-2);border:0.5px solid var(--dsw-alias-state-error-primary);border-radius:6px;box-shadow:0 4px 12px rgba(0,0,0,0.25);z-index:1100;font-size:12px;line-height:16px;color:var(--dsw-alias-state-error-primary);pointer-events:none}",".dsham_dateRange{position:relative;display:inline-flex;align-items:center;flex:1 1 auto;min-width:0;box-sizing:border-box}",".dsham_dateTrigger{display:inline-flex;align-items:center;gap:6px;width:100%;height:32px;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;line-height:20px;cursor:pointer;box-sizing:border-box;transition:all .15s ease}",".dsham_dateTrigger:hover{border-color:var(--dsw-alias-border-l3)}",".dsham_dateTrigger.is-open{border-color:var(--dsw-alias-state-business-primary);box-shadow:0 0 0 1px var(--dsw-alias-state-business-primary)}",".dsham_dateIcon{flex:none;color:var(--dsw-alias-label-tertiary);display:flex;align-items:center}",".dsham_dateText{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;color:var(--dsw-alias-label-primary)}",".dsham_dateText.placeholder{color:var(--dsw-alias-label-primary)}",".dsham_dateClearBtn{flex:none;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-tertiary);border-radius:50%;cursor:pointer;font-size:13px;line-height:1}",".dsham_dateClearBtn:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}",".dsham_dateChevron{flex:none;color:var(--dsw-alias-label-tertiary);display:flex;align-items:center}",".dsham_dateInputSrOnly{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}",".dsham_datePopover{position:absolute;top:calc(100% + 4px);right:0;left:auto;z-index:1000;display:flex;gap:10px;padding:10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-md,10px);background:var(--dsw-alias-bg-layer-1);box-shadow:0 8px 24px rgba(0,0,0,0.12),0 2px 6px rgba(0,0,0,0.06);box-sizing:border-box}",".dsham_datePresets{width:84px;border-right:0.5px solid var(--dsw-alias-border-l2);padding-right:8px;display:flex;flex-direction:column;gap:3px;flex:none}",".dsham_datePresetBtn{border:0;background:transparent;padding:5px 6px;text-align:left;font:inherit;font-size:12px;color:var(--dsw-alias-label-secondary);border-radius:var(--dsw-radius-sm,6px);cursor:pointer;transition:all .15s ease;white-space:nowrap}",".dsham_datePresetBtn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}",".dsham_dateCalendar{width:224px;display:flex;flex-direction:column;gap:6px;flex:none}",".dsham_dateCalHeader{display:flex;justify-content:space-between;align-items:center;padding:0 2px}",".dsham_dateMonthTitle{font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary)}",".dsham_dateNavBtn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:0;border-radius:4px;background:transparent;color:var(--dsw-alias-label-secondary);cursor:pointer;font-size:14px;line-height:1}",".dsham_dateNavBtn:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}",".dsham_dateGrid{display:grid;grid-template-columns:repeat(7,1fr);row-gap:2px}",".dsham_dateWeekday{font-size:11px;color:var(--dsw-alias-label-tertiary);text-align:center;padding:3px 0;font-weight:500}",".dsham_dateDay{position:relative;height:26px;display:flex;align-items:center;justify-content:center;font-size:12px;color:var(--dsw-alias-label-primary);cursor:pointer;border-radius:0}",".dsham_dateDay.is-outside{color:var(--dsw-alias-label-quaternary)}",".dsham_dateDay:not(.is-outside):hover{background:var(--dsw-alias-interactive-bg-hover);border-radius:4px}",".dsham_dateDay.is-start{background:var(--dsw-alias-state-business-primary)!important;color:#fff!important;border-top-left-radius:6px;border-bottom-left-radius:6px}",".dsham_dateDay.is-end{background:var(--dsw-alias-state-business-primary)!important;color:#fff!important;border-top-right-radius:6px;border-bottom-right-radius:6px}",".dsham_dateDay.is-start.is-end{border-radius:6px!important}",".dsham_dateDay.is-in-range{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-state-business-primary)}",".dsham_dateDay.is-today::after{content:'';position:absolute;bottom:2px;width:3px;height:3px;border-radius:50%;background:var(--dsw-alias-state-business-primary)}",".dsham_dateDay.is-start.is-today::after,.dsham_dateDay.is-end.is-today::after{background:#fff}",".dsham_discoveryStatus{font-size:12px;margin-bottom:12px;overflow-wrap:anywhere}",".dsham_settingsSnippet{display:block;width:100%;padding:0;margin:4px 0 0;border:0;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}",".dsham_previewMessages{max-height:65vh;overflow:auto;overflow-wrap:anywhere;padding-right:8px}",".dsham_previewToolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px;color:var(--dsw-alias-label-secondary);font-size:12px}",".dsham_previewRole{display:flex;align-items:center;gap:8px;margin-bottom:12px;font-size:13px}",".dsham_previewRole>span{display:grid;place-items:center;width:28px;height:28px;border-radius:8px;background:var(--dsw-alias-bg-layer-3);font-size:11px}",".dsham_previewRole[data-role=user]>span{color:var(--dsw-alias-state-business-primary)}",".dsham_previewRaw{white-space:pre-wrap;font:13px/1.8 ui-monospace,monospace;overflow-wrap:anywhere}",".dsham_previewMessage pre:not(.dsham_previewRaw){white-space:pre;overflow-x:auto;max-width:100%}",".dsham_previewMessage table{display:block;max-width:100%;overflow-x:auto}",".dsham_previewMessage img{max-width:100%}","@media(max-width:520px){.dsham_previewToolbar{align-items:flex-start;flex-wrap:wrap}}",".dsham_previewMessage{padding:18px 0;border-bottom:1px solid var(--dsw-alias-border-l2)}",".dsham_previewMessage p{font-size:14px;line-height:1.8}",".dsham_previewHint,.dsham_previewMessage small{color:var(--dsw-alias-label-secondary);font-size:12px}",".dsham_settings mark,.dsham_previewMessages mark{background:var(--dsw-alias-state-warn-tertiary);color:inherit;border-radius:2px}",".dsham_settingsSnippet:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}"].join(""),Is={"common.separator":"\uFF1A","copy.empty":"\u6CA1\u6709\u53EF\u590D\u5236\u7684\u5185\u5BB9","copy.unavailable":"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u526A\u8D34\u677F\uFF0C\u8BF7\u5728 HTTPS \u6216\u672C\u673A\u5730\u5740\u4E2D\u6253\u5F00\u9875\u9762","copy.denied":"\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u5141\u8BB8\u6D4F\u89C8\u5668\u8BBF\u95EE\u526A\u8D34\u677F\u540E\u91CD\u8BD5","discovery.you":"\u4F60","discovery.ai":"AI","discovery.readOnly":"\u53EA\u8BFB\u9884\u89C8","discovery.messageCount":"\u672C\u6B21\u663E\u793A {n} \u6761\u6D88\u606F","discovery.displayMode":"\u663E\u793A\u65B9\u5F0F","discovery.formatted":"\u6392\u7248","discovery.raw":"\u539F\u6587\u4E0E\u9AD8\u4EAE","discovery.copyCode":"\u590D\u5236\u4EE3\u7801","discovery.footnotes":"\u6CE8\u91CA","details.copyId":"\u590D\u5236\u4F1A\u8BDD ID","details.copied":"\u5DF2\u590D\u5236","discovery.date":"\u65E5\u671F","discovery.timeRange":"\u65F6\u95F4\u8303\u56F4","discovery.allTime":"\u5168\u90E8\u65F6\u95F4","discovery.today":"\u4ECA\u5929","discovery.last7Days":"\u8FD1 7 \u5929","discovery.last30Days":"\u8FD1 30 \u5929","discovery.last90Days":"\u8FD1 90 \u5929","discovery.customRange":"\u81EA\u5B9A\u4E49\u2026","discovery.dateActive":"\u65E5\u671F\xB7\u5DF2\u9009","discovery.clearDate":"\u6E05\u9664\u65E5\u671F","discovery.active":"\u5DF2\u542F\u7528","discovery.scope":"\u67E5\u627E\u8303\u56F4","discovery.titleOnly":"\u4EC5\u6807\u9898","discovery.titleAndContent":"\u6807\u9898\u4E0E\u6B63\u6587","discovery.from":"\u66F4\u65B0\u65F6\u95F4\u4ECE","discovery.to":"\u81F3","discovery.clear":"\u6E05\u9664\u6761\u4EF6","discovery.invalidDate":"\u5F00\u59CB\u65E5\u671F\u4E0D\u80FD\u665A\u4E8E\u7ED3\u675F\u65E5\u671F\uFF0C\u8BF7\u68C0\u67E5\u65E5\u671F\u8303\u56F4\u3002","discovery.searching":"\u6B63\u5728\u68C0\u7D22\u6B63\u6587\uFF1A{done} / {total}","discovery.searched":"\u6B63\u6587\u68C0\u7D22\u5B8C\u6210\uFF1A{done} / {total}","discovery.searchError":"\u6B63\u6587\u68C0\u7D22\u672A\u5B8C\u6210\uFF0C\u5F53\u524D\u7ED3\u679C\u53EF\u80FD\u4E0D\u5B8C\u6574\u3002","discovery.failed":"{n} \u6761\u4F1A\u8BDD\u8BFB\u53D6\u5931\u8D25","discovery.retry":"\u91CD\u8BD5","discovery.preview":"\u5FEB\u901F\u9884\u89C8","discovery.loading":"\u6B63\u5728\u8BFB\u53D6\u4F1A\u8BDD\u2026","discovery.previewHint":"\u53EA\u8BFB\u9884\u89C8\u539F\u59CB\u5BF9\u8BDD\u6587\u672C\uFF0C\u4E0D\u6062\u590D\u4F1A\u8BDD\uFF1B\u4E0D\u542B\u5DE5\u5177\u8F93\u51FA\u3001\u9644\u4EF6\u3001\u63A8\u7406\u548C\u7CFB\u7EDF\u5185\u5BB9\u3002","discovery.earlier":"\u524D\u9762\u8FD8\u6709\u6D88\u606F\uFF0C\u53EF\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD\u67E5\u770B\u3002","discovery.later":"\u540E\u9762\u8FD8\u6709\u6D88\u606F\uFF0C\u53EF\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD\u67E5\u770B\u3002","discovery.empty":"\u6CA1\u6709\u53EF\u9884\u89C8\u7684\u7528\u6237\u6216\u52A9\u624B\u6587\u672C\u3002","discovery.truncated":"\u672C\u6761\u4EC5\u663E\u793A\u90E8\u5206\u5185\u5BB9\u3002","discovery.user":"\u7528\u6237","discovery.assistant":"\u52A9\u624B","discovery.openFull":"\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD","discovery.searchPlaceholder":"\u641C\u7D22\u6807\u9898\u6216\u6B63\u6587"},Ts={"common.separator":": ","copy.empty":"Nothing to copy","copy.unavailable":"Clipboard unavailable. Open the page over HTTPS or localhost.","copy.denied":"Copy failed. Allow clipboard access and retry.","discovery.you":"You","discovery.ai":"AI","discovery.readOnly":"Read-only preview","discovery.messageCount":"Showing {n} messages","discovery.displayMode":"Display mode","discovery.formatted":"Formatted","discovery.raw":"Source and highlights","discovery.copyCode":"Copy code","discovery.footnotes":"Footnotes","details.copyId":"Copy session ID","details.copied":"Copied","discovery.date":"Date","discovery.timeRange":"Time range","discovery.allTime":"All time","discovery.today":"Today","discovery.last7Days":"Past 7 days","discovery.last30Days":"Past 30 days","discovery.last90Days":"Past 90 days","discovery.customRange":"Custom\u2026","discovery.dateActive":"Date \xB7 Set","discovery.clearDate":"Clear dates","discovery.active":"Active","discovery.scope":"Search in","discovery.titleOnly":"Titles","discovery.titleAndContent":"Titles and content","discovery.from":"Updated from","discovery.to":"To","discovery.clear":"Clear filters","discovery.invalidDate":"Check the date range: the start must not be after the end.","discovery.searching":"Searching content: {done} / {total}","discovery.searched":"Content search complete: {done} / {total}","discovery.searchError":"Content search is incomplete; results may be missing.","discovery.failed":"Could not read {n} conversations","discovery.retry":"Retry","discovery.preview":"Quick preview","discovery.loading":"Reading conversation\u2026","discovery.previewHint":"Read-only original conversation text; keeps the conversation archived. Excludes tools, attachments, reasoning and system content.","discovery.earlier":"More messages before this preview. Open the full conversation to read them.","discovery.later":"More messages after this preview. Open the full conversation to read them.","discovery.empty":"No user or assistant text to preview.","discovery.truncated":"Only part of this message is shown.","discovery.user":"User","discovery.assistant":"Assistant","discovery.openFull":"Open full conversation","discovery.searchPlaceholder":"Search titles or content"},As={"common.separator":": ","copy.empty":"\u041D\u0435\u0447\u0435\u0433\u043E \u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C","copy.unavailable":"\u0411\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u043F\u043E HTTPS \u0438\u043B\u0438 localhost.","copy.denied":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C. \u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u0435 \u0434\u043E\u0441\u0442\u0443\u043F \u043A \u0431\u0443\u0444\u0435\u0440\u0443 \u043E\u0431\u043C\u0435\u043D\u0430 \u0438 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435.","discovery.you":"\u0412\u044B","discovery.ai":"\u0418\u0418","discovery.readOnly":"\u041F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0442\u043E\u043B\u044C\u043A\u043E \u0434\u043B\u044F \u0447\u0442\u0435\u043D\u0438\u044F","discovery.messageCount":"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u043E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439: {n}","discovery.displayMode":"\u0420\u0435\u0436\u0438\u043C \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F","discovery.formatted":"\u0424\u043E\u0440\u043C\u0430\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u043E","discovery.raw":"\u0418\u0441\u0445\u043E\u0434\u043D\u0438\u043A \u0438 \u043F\u043E\u0434\u0441\u0432\u0435\u0442\u043A\u0430","discovery.copyCode":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043A\u043E\u0434","discovery.footnotes":"\u0421\u043D\u043E\u0441\u043A\u0438","details.copyId":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C ID \u0441\u0435\u0441\u0441\u0438\u0438","details.copied":"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E","discovery.date":"\u0414\u0430\u0442\u0430","discovery.timeRange":"\u041F\u0435\u0440\u0438\u043E\u0434","discovery.allTime":"\u0412\u0441\u0435 \u0432\u0440\u0435\u043C\u044F","discovery.today":"\u0421\u0435\u0433\u043E\u0434\u043D\u044F","discovery.last7Days":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 7 \u0434\u043D\u0435\u0439","discovery.last30Days":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 30 \u0434\u043D\u0435\u0439","discovery.last90Days":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0438\u0435 90 \u0434\u043D\u0435\u0439","discovery.customRange":"\u0421\u0432\u043E\u0439 \u043F\u0435\u0440\u0438\u043E\u0434\u2026","discovery.dateActive":"\u0414\u0430\u0442\u0430 \xB7 \u0412\u044B\u0431\u0440\u0430\u043D\u0430","discovery.clearDate":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0434\u0430\u0442\u044B","discovery.active":"\u0412\u043A\u043B\u044E\u0447\u0435\u043D\u043E","discovery.scope":"\u0418\u0441\u043A\u0430\u0442\u044C \u0432","discovery.titleOnly":"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u044F","discovery.titleAndContent":"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u044F \u0438 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0435","discovery.from":"\u041E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u043E \u0441","discovery.to":"\u041F\u043E","discovery.clear":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440\u044B","discovery.invalidDate":"\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D \u0434\u0430\u0442: \u043D\u0430\u0447\u0430\u043B\u043E \u043D\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043F\u043E\u0437\u0436\u0435 \u043A\u043E\u043D\u0446\u0430.","discovery.searching":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443: {done} / {total}","discovery.searched":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443 \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043D: {done} / {total}","discovery.searchError":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443 \u043D\u0435\u043F\u043E\u043B\u043D\u044B\u0439; \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u043D\u0435\u043F\u043E\u043B\u043D\u044B\u043C\u0438.","discovery.failed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C {n} \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u043E\u0432","discovery.retry":"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C","discovery.preview":"\u0411\u044B\u0441\u0442\u0440\u044B\u0439 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440","discovery.loading":"\u0427\u0442\u0435\u043D\u0438\u0435 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u0430\u2026","discovery.previewHint":"\u0422\u043E\u043B\u044C\u043A\u043E \u0447\u0442\u0435\u043D\u0438\u0435 \u0438\u0441\u0445\u043E\u0434\u043D\u043E\u0433\u043E \u0442\u0435\u043A\u0441\u0442\u0430 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u0430; \u0441\u0435\u0441\u0441\u0438\u044F \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0432 \u0430\u0440\u0445\u0438\u0432\u0435. \u0411\u0435\u0437 \u0432\u044B\u0432\u043E\u0434\u0430 \u0438\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u043E\u0432, \u0432\u043B\u043E\u0436\u0435\u043D\u0438\u0439, \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043D\u0438\u0439 \u0438 \u0441\u0438\u0441\u0442\u0435\u043C\u043D\u043E\u0433\u043E \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0433\u043E.","discovery.earlier":"\u041F\u0435\u0440\u0435\u0434 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u043E\u043C \u0435\u0441\u0442\u044C \u0435\u0449\u0451 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0447\u0442\u043E\u0431\u044B \u0438\u0445 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C.","discovery.later":"\u041F\u043E\u0441\u043B\u0435 \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430 \u0435\u0441\u0442\u044C \u0435\u0449\u0451 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F. \u041E\u0442\u043A\u0440\u043E\u0439\u0442\u0435 \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0447\u0442\u043E\u0431\u044B \u0438\u0445 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C.","discovery.empty":"\u041D\u0435\u0442 \u0442\u0435\u043A\u0441\u0442\u0430 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0438\u043B\u0438 \u0430\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442\u0430 \u0434\u043B\u044F \u043F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430.","discovery.truncated":"\u041F\u043E\u043A\u0430\u0437\u0430\u043D\u0430 \u0442\u043E\u043B\u044C\u043A\u043E \u0447\u0430\u0441\u0442\u044C \u044D\u0442\u043E\u0433\u043E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F.","discovery.user":"\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C","discovery.assistant":"\u0410\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442","discovery.openFull":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440","discovery.searchPlaceholder":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u044F\u043C \u0438\u043B\u0438 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u043C\u0443"};var _s=e(t=>{let r=ce(t);if(!r||typeof r.sessionId!="string"||!r.sessionId.length||r.sessionId.length>1024||typeof r.identity!="string"||!r.identity.length||r.identity.length>4096)throw new TypeError("invalid cache rebuild candidate");return{sessionId:r.sessionId,identity:r.identity}},"candidate"),ei={parse(t){let r=ce(t);if(!r||!Array.isArray(r.items)||!r.items.length||r.items.length>20)throw new TypeError("invalid cache rebuild batch (1\u201320 items required)");return{items:r.items.map(_s)}}},fr={parse(t){let r=ce(t);if(!r||!Array.isArray(r.items)||r.count!==r.items.length)throw new TypeError("invalid cache diagnosis");return{count:r.items.length,items:r.items.map(_s)}}},gr={parse(t){let r=ce(t);for(let i of["rebuiltSessionIds","skippedSessionIds"])if(!Array.isArray(r?.[i])||r[i].some(s=>typeof s!="string"))throw new TypeError("invalid cache rebuild result");if(!Array.isArray(r.failures)||r.failures.some(i=>!i||typeof i.sessionId!="string"||typeof i.message!="string"))throw new TypeError("invalid cache rebuild failures");return r}};function Rs(){let t=e((r,i)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${r}`,create:e(()=>i,"create"),schema:i}),"codec");return[{method:"diagnoseSessionCaches",parameters:[],result:t("CacheDiagnosis",fr)},{method:"rebuildSessionCaches",parameters:[{name:"input",wire:"input",source:"json",codec:t("CacheRebuildInput",ei)}],result:t("CacheRebuildResult",gr)}].map(({method:r,...i})=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${r}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:r,invocation:{kind:"direct"},...i,sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}e(Rs,"cacheRebuildInvocations");function js(t,r={}){let{maxLoadRetries:i=3,retryDelayMs:s=200}=r,l={diagnosis:{count:0,items:[]},busy:!1,progress:null,result:null,error:null,refreshError:null},u=!0,m=0,C=[],y,_=new Set,x=e(w=>{if(u){l={...l,...w};for(let D of _)D()}},"update"),g=e(async(w=i)=>{if(!u)return;y!==void 0&&(clearTimeout(y),y=void 0);let D=++m;try{let j=fr.parse(await t.diagnose());u&&D===m&&x({diagnosis:j,error:null})}catch(j){if(w>0&&u&&D===m){y=setTimeout(()=>{y=void 0,u&&D===m&&g(w-1)},s);return}u&&D===m&&x({error:Oe(j)})}},"load");return{snapshot:e(()=>l,"snapshot"),subscribe(w){return _.add(w),()=>{_.delete(w)}},load:g,async run(w=!1){if(!u||l.busy)return;++m,y!==void 0&&(clearTimeout(y),y=void 0);let D=w?[...C]:[...l.diagnosis.items],j={rebuiltSessionIds:[],skippedSessionIds:[],failures:[]};C=[],x({busy:!0,result:null,error:null,refreshError:null,progress:{done:0,total:D.length}});for(let[U,P]of D.entries()){if(!u)return;try{let B=gr.parse(await t.rebuild({items:[P]}));if(!u)return;j.rebuiltSessionIds.push(...B.rebuiltSessionIds),j.skippedSessionIds.push(...B.skippedSessionIds),j.failures.push(...B.failures),B.failures.length&&C.push(P)}catch(B){if(!u)return;j.failures.push({sessionId:P.sessionId,message:Oe(B)}),C.push(P)}x({progress:{done:U+1,total:D.length}})}x({result:j});try{await t.refresh()}catch(U){x({refreshError:Oe(U)})}u&&(await g(),x({busy:!1,progress:null}))},dismiss(){u&&x({result:null,error:null,refreshError:null})},dispose(){u=!1,++m,y!==void 0&&(clearTimeout(y),y=void 0),_.clear()}}}e(js,"createCacheRebuildController");var Qt=class extends Error{static{e(this,"ArchiveNavigationError")}code;constructor(r){super(r),this.name="ArchiveNavigationError",this.code=r}};function Ns(t,r){return t instanceof Qt?r(`archives.${t.code}`):Oe(t)}e(Ns,"formatArchiveNavigationError");function ti(t,r){if(typeof t?.retainInfo!="function")return;let i=t.retainInfo(r),s=i&&typeof i=="object"&&"getSnapshot"in i&&typeof i.getSnapshot=="function"?i.getSnapshot():i;if(!s||typeof s!="object"||!("retainedBy"in s))return;let l=s.retainedBy;if(!(!l||typeof l!="object"||!("mainView"in l)||typeof l.mainView!="number"))return{retainedBy:{mainView:l.mainView}}}e(ti,"retainInfoSnapshot");function ni(t){let r=t?.byId;if(r!==void 0){for(let i of Object.values(r))if(i&&(i.retainedBy?.mainView??0)>0)return i.id}}e(ni,"mainViewSessionId");function Zn(t){return ni(t)}e(Zn,"currentSessionId");function ri(t,r,i){return r===void 0||r===""?!1:(t?.byId?.[r]?.retainedBy?.mainView??0)>0||(ti(i,r)?.retainedBy?.mainView??0)>0}e(ri,"sessionIsCurrent");async function Ms(t,r,i,s=()=>!0){if(i){if(typeof t.prepare=="function"&&await t.prepare(r),!s())return;await t.restore(r)}s()&&await t.open(r)}e(Ms,"openArchivedConversation");function Ds(t,r,i,{onOpened:s=e(()=>{},"onOpened"),beginNavigation:l,warn:u=e((...m)=>console.warn(...m),"warn")}={}){let m,C=t?.clearArchivedCurrent,y=t&&Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent"),_=e(w=>ri(r.list.getSnapshot(),w,r),"viewing"),x=e(function(...w){return m!==void 0&&_(m)&&i.list.getSnapshot().archivedSessionIds.includes(m)?!1:(m=void 0,C?.apply(this,w))},"wrapped"),g=e(()=>t&&Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent")?.value===x,"ownsWrapper");if(t&&typeof C=="function")try{if(t.clearArchivedCurrent=x,!g())throw new Error("\u5BFC\u822A\u65B9\u6CD5\u672A\u63A5\u7EB3\u5F52\u6863\u9002\u914D")}catch(w){u("archive-manager: \u65E0\u6CD5\u9002\u914D\u5F52\u6863\u5BFC\u822A\uFF0C\u8BF7\u6062\u590D\u4F1A\u8BDD\u540E\u6253\u5F00\u3002",w)}return{open(w){m=w;try{if(typeof C=="function"&&!g()&&i.list.getSnapshot().archivedSessionIds.includes(w))throw u("archive-manager: \u5F52\u6863\u5BFC\u822A\u9002\u914D\u4E0D\u53EF\u7528\u6216\u5DF2\u88AB\u66FF\u6362\u3002"),new Qt("navigationUnavailable");if(l?.(),typeof t?.openSession!="function")throw u("archive-manager: \u5BBF\u4E3B\u672A\u63D0\u4F9B\u4F1A\u8BDD\u6253\u5F00\u63A5\u53E3\u3002"),new Qt("navigationUnavailable");if(t.openSession(w),!_(w))throw u("archive-manager: \u5BBF\u4E3B\u672A\u4FDD\u7559\u76EE\u6807\u4F1A\u8BDD\u3002",{cleanupAvailable:typeof C=="function"}),new Qt("sessionNotRetained");s()}catch(D){throw m=void 0,D}},dispose(){m=void 0,!(!t||Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent")?.value!==x)&&(y?Object.defineProperty(t,"clearArchivedCurrent",y):delete t.clearArchivedCurrent,C?.call(t))}}}e(Ds,"allowArchivedNavigation");var an=require("@deepseek-ai/dsh-client-ui-primitives");var Ls={check:"\u68C0\u67E5\u66F4\u65B0",update:"\u66F4\u65B0",recheck:"\u91CD\u65B0\u68C0\u67E5",auto:"\u81EA\u52A8\u66F4\u65B0",updating:"\u6B63\u5728\u66F4\u65B0\u2026",copy:"\u590D\u5236\u547D\u4EE4",copied:"\u5DF2\u590D\u5236",copyFailed:"\u590D\u5236\u5931\u8D25",checking:"\u6B63\u5728\u68C0\u67E5\u66F4\u65B0\u2026",latest:"\u5DF2\u662F\u6700\u65B0\u7248\u672C",found:"\u53D1\u73B0\u65B0\u7248\u672C",failed:"\u68C0\u67E5\u66F4\u65B0\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",current:"\u8FD0\u884C\u7248\u672C",latestLabel:"\u6700\u65B0\u7248\u672C",profile:"\u76EE\u6807 profile",unknown:"\u672A\u77E5",manual:"\u624B\u5DE5\u66F4\u65B0",manualHint:"\u81EA\u52A8\u66F4\u65B0\u5931\u8D25\u65F6\uFF0C\u53EF\u5728\u5F53\u524D DSH \u7EC8\u7AEF\u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\uFF0C\u5B8C\u6210\u540E\u91CD\u542F DSH Web\u3002",manualHintDesktop:"\u81EA\u52A8\u66F4\u65B0\u5931\u8D25\u65F6\uFF0C\u8BF7\u5148\u5B8C\u5168\u9000\u51FA DSH Desktop\uFF0C\u518D\u7528 Desktop \u81EA\u5E26\u7684 dsh \u6267\u884C\u4EE5\u4E0B\u547D\u4EE4\u3002\u666E\u901A dsh \u4F1A\u62D2\u7EDD desktop profile\u3002",intro:"\u4EC5\u68C0\u67E5\u5E76\u66F4\u65B0\u5F53\u524D\u63D2\u4EF6\uFF0C\u4E0D\u4F1A\u8054\u52A8\u5B89\u88C5\u5176\u4ED6\u63D2\u4EF6\u3002",restart:"\u66F4\u65B0\u5B8C\u6210\uFF0C\u8BF7\u91CD\u542F DSH Web\u3002",restartDesktop:"\u66F4\u65B0\u5B8C\u6210\uFF0C\u8BF7\u5B8C\u5168\u9000\u51FA\u5E76\u91CD\u65B0\u6253\u5F00 DSH Desktop\u3002",restarting:"\u66F4\u65B0\u5B8C\u6210\uFF0C\u6B63\u5728\u91CD\u542F DSH Desktop\u2026",unavailable:"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u81EA\u52A8\u66F4\u65B0\uFF0C\u8BF7\u4F7F\u7528\u624B\u5DE5\u66F4\u65B0\u547D\u4EE4\u3002"},zs={check:"Check for updates",update:"Update",recheck:"Check again",auto:"Update automatically",updating:"Updating\u2026",copy:"Copy command",copied:"Copied",copyFailed:"Copy failed",checking:"Checking for updates\u2026",latest:"You are up to date",found:"New version available",failed:"Could not check for updates. Try again later.",current:"Running version",latestLabel:"Latest version",profile:"Target profile",unknown:"Unknown",manual:"Manual update",manualHint:"If automatic update fails, run this command in the current DSH terminal, then restart DSH Web.",manualHintDesktop:"If automatic update fails, fully quit DSH Desktop, then run this command with Desktop's own dsh. A regular dsh rejects the desktop profile.",intro:"Only this plugin is checked and updated. Other plugins are not changed.",restart:"Update complete. Restart DSH Web.",restartDesktop:"Update complete. Fully quit and reopen DSH Desktop.",restarting:"Update complete. Restarting DSH Desktop\u2026",unavailable:"Automatic update is unavailable. Use the manual command."};function Dn(t){return t.toLowerCase().startsWith("zh")?Ls:zs}e(Dn,"pluginUpdateCopy");function si(t,r,i,s){let l=Dn(t),u=r?.restartDesktop===!0||r?.profileName==="desktop",m=u?{...l,manualHint:l.manualHintDesktop}:l,C=i!=="idle",y=m.checking,_="";return i==="checking"?y=m.checking:i==="updating"?y=m.updating:s.type==="error"?(y=s.message||m.failed,_="error"):s.type==="restart"?(y=u?m.restartDesktop:m.restart,_="success"):s.type==="restarting"?(y=m.restarting,_="success"):r===void 0?y=m.checking:r.latestCheckFailed?(y=m.failed,_="error"):!r.canAutoUpdate&&r.updateAvailable?(y=m.unavailable,_="update"):r.updateAvailable?(y=`${m.found}: v${r.latestVersion??m.unknown}`,_="update"):(y=m.latest,_="success"),{copy:m,busy:C,message:y,kind:_,loading:i==="updating",updateLabel:i==="updating"?m.updating:m.auto,disabled:C||r?.canAutoUpdate!==!0||r.updateAvailable!==!0,currentVersion:r===void 0?m.unknown:`v${r.currentVersion}`,latestVersion:r?.latestVersion===void 0?m.unknown:`v${r.latestVersion}`,profileName:r?.profileName??m.unknown,profileRaw:r?.profileName??"",latestRaw:r?.latestVersion??"latest"}}e(si,"describePluginUpdate");function Ps(t,r,i){let s="idle",l=r,u={type:"status"},m=0,C=new Set,y=e(()=>{for(let x of C)x()},"emit"),_=e(x=>{l=x,i?.(x)},"assign");return{get posts(){return m},subscribe(x){return C.add(x),()=>{C.delete(x)}},view(x){return si(x,l,s,u)},async check(){if(s==="idle"){s="checking",u={type:"status"},y();try{_(await t("GET")),u={type:"status"}}catch(x){u={type:"error",message:x instanceof Error?x.message:""}}finally{s="idle",y()}}},async update(){if(s==="idle"){s="updating",u={type:"status"},m+=1,y();try{let x=await t("POST");_(x),u={type:x.autoReload===!0?"restarting":"restart"}}catch(x){u={type:"error",message:x instanceof Error?x.message:""}}finally{s="idle",y()}}}}}e(Ps,"createUpdateFlow");function Os(t,r,i){return`dsh plugin${t.trim()===""?"":` --profile ${t.trim()}`} add ${r}@${i} --registry=https://registry.npmjs.org/`}e(Os,"manualPluginUpdateCommand");function Fs(t,r){return t.key!=="Escape"?!1:(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),r(),!0)}e(Fs,"handlePluginUpdateEscape");function ai(){let t=globalThis.document;if(typeof t>"u"||t===null)return;let r=t.baseURI;if(!(typeof r!="string"||r===""))try{let i=new URL(r),s=i.pathname.lastIndexOf("/"),l=i.pathname.slice(s+1);return/\.(html?|php|aspx?|jsp)$/i.test(l)?i.pathname=i.pathname.slice(0,s+1):i.pathname.endsWith("/")||(i.pathname+="/"),i.href}catch{return}}e(ai,"pageBaseHref");function fn(t){if(typeof t!="string"||t.charAt(0)!=="/"||t.charAt(1)==="/")return t;let r=ai();if(r===void 0)return t;try{return new URL(t.slice(1),r).href}catch{return t}}e(fn,"resolveApiUrl");function Hs(t){let i=Function("return globalThis.__dshArchiveReactDOMClient")()?.createRoot;if(i===void 0)throw new Error("createRoot unavailable");return i(t)}e(Hs,"mountRoot");var ii="x-michengai-plugin-update",Bs="michengai-plugin-update-ui",vr=`
10
+ "use strict";var Jn=Object.defineProperty;var Ua=Object.getOwnPropertyDescriptor;var Wa=Object.getOwnPropertyNames;var qa=Object.prototype.hasOwnProperty;var e=(t,r)=>Jn(t,"name",{value:r,configurable:!0});var Va=(t,r)=>{for(var i in r)Jn(t,i,{get:r[i],enumerable:!0})},$a=(t,r,i,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of Wa(r))!qa.call(t,l)&&l!==i&&Jn(t,l,{get:()=>r[l],enumerable:!(s=Ua(r,l))||s.enumerable});return t};var Ga=t=>$a(Jn({},"__esModule",{value:!0}),t);var yi={};Va(yi,{startArchiveClient:()=>bi});module.exports=Ga(yi);function ce(t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError("\u53C2\u6570\u5FC5\u987B\u4E3A\u5BF9\u8C61");return t}e(ce,"record");function Be(t){return String(t&&typeof t=="object"&&"message"in t?t.message??t:t)}e(Be,"errorMessage");function Xn(t){return t&&typeof t=="object"&&"code"in t?t.code:void 0}e(Xn,"errorCode");var ds=Function("return globalThis.__dshArchiveReact")(),{Children:Ci,Component:Ei,Fragment:us,Profiler:Ii,PureComponent:Ti,StrictMode:Ai,Suspense:_i,cloneElement:Ri,createContext:ji,createElement:hs,createRef:Ni,forwardRef:Mi,isValidElement:Di,lazy:Li,memo:zi,startTransition:Pi,useCallback:Oi,useContext:Fi,useDebugValue:Hi,useDeferredValue:Bi,useEffect:ps,useId:Ui,useImperativeHandle:Wi,useInsertionEffect:qi,useLayoutEffect:Vi,useMemo:$i,useReducer:Gi,useRef:Ki,useState:Yt,useSyncExternalStore:Yi,useTransition:Zi,version:Ji}=ds,W=ds;function fs(t){return W.createElement("input",{className:"dsham_number",type:"number",min:t.min,max:t.max,value:t.value??"",disabled:t.disabled,"aria-label":t["aria-label"],onChange:e(r=>{let i=r.target.value;if(i===""){t.onChange(null);return}let s=Number(i);t.onChange(Number.isNaN(s)?null:s)},"onChange")})}e(fs,"NumberField");function Ya(t=W.createElement){return t("svg",{className:"dsham_dateIcon",width:14,height:14,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.25,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},t("rect",{x:2,y:3,width:12,height:11,rx:2}),t("line",{x1:2,y1:6.5,x2:14,y2:6.5}),t("line",{x1:5.5,y1:1.5,x2:5.5,y2:3.5}),t("line",{x1:10.5,y1:1.5,x2:10.5,y2:3.5}))}e(Ya,"CalendarIcon");function Pn(t,r,i){let s=String(r+1).padStart(2,"0"),l=String(i).padStart(2,"0");return`${t}-${s}-${l}`}e(Pn,"formatYmd");function Sn(t){let r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t);return r?{year:Number(r[1]),monthIndex:Number(r[2])-1,day:Number(r[3])}:null}e(Sn,"parseYmd");function Za(t,r){let i=new Date(t,r,1).getDay(),s=(i===0?7:i)-1,l=new Date(t,r+1,0).getDate(),h=new Date(t,r,0).getDate(),m=[];for(let C=0;C<42;C++){let y=t,_=r,x=0,g=!1;C<s?(x=h-s+C+1,_=r-1,_<0&&(_=11,y--),g=!0):C<s+l?x=C-s+1:(x=C-s-l+1,_=r+1,_>11&&(_=0,y++),g=!0),m.push({year:y,monthIndex:_,day:x,dateStr:Pn(y,_,x),isOutside:g})}return m}e(Za,"buildMonthGrid");function Ja(t,r=new Date){if(t==="all")return{from:"",to:""};let i=Pn(r.getFullYear(),r.getMonth(),r.getDate());if(t==="today")return{from:i,to:i};let s=t==="7d"?6:t==="30d"?29:89,l=new Date(r.getTime()-s*864e5);return{from:Pn(l.getFullYear(),l.getMonth(),l.getDate()),to:i}}e(Ja,"getPresetRange");function ms(t,r,i,s){let l=r+s,h=new Date(t,l+1,0).getDate();return new Date(t,l,Math.min(i,h))}e(ms,"shiftMonthClamped");function gs(t){let r=t.React||W;function i(I,pe){let at=I==="from"?pe:t.from,Cn=I==="to"?pe:t.to;if(at===""&&Cn===""){t.onClear();return}I==="from"?t.onFrom(pe):t.onTo(pe)}e(i,"change");let s=!!(t.from||t.to),l="";t.from&&t.to?l=`${t.from} \u2013 ${t.to}`:t.from?l=`${t.from} \u2013`:t.to?l=`\u2013 ${t.to}`:l=t.t?t.t("discovery.timeRange")||`${t.fromLabel} \u2013 ${t.toLabel}`:`${t.fromLabel} \u2013 ${t.toLabel}`;let m=(r.useRef??(I=>{let[pe]=r.useState({current:I});return pe}))(null),[C,y]=r.useState(!1),_=Sn(t.from||t.to)??{year:new Date().getFullYear(),monthIndex:new Date().getMonth(),day:new Date().getDate()},[x,g]=r.useState(_.year),[w,D]=r.useState(_.monthIndex),[N,U]=r.useState(null),[P,B]=r.useState(null),[fe,le]=r.useState(null);r.useEffect(()=>{if(!C)return;let I=e(at=>{m.current&&!m.current.contains(at.target)&&(y(!1),U(null))},"onPointerDown"),pe=e(at=>{at.key==="Escape"&&(at.preventDefault(),at.stopPropagation(),y(!1),U(null))},"onKeyDown");return typeof document<"u"&&document.addEventListener("mousedown",I,!0),typeof window<"u"&&window.addEventListener("keydown",pe,!0),()=>{typeof document<"u"&&document.removeEventListener("mousedown",I,!0),typeof window<"u"&&window.removeEventListener("keydown",pe,!0)}},[C]),r.useEffect(()=>{if(!C||!fe||!m.current)return;m.current.querySelector(`[data-date="${fe}"]`)?.focus()},[C,fe]);let $=t.t?t.t("discovery.today")==="Today"||(t.t("locale.language")||"").startsWith("en"):!1,ge=t.t?t.t("discovery.today")==="\u0421\u0435\u0433\u043E\u0434\u043D\u044F"||(t.t("locale.language")||"").startsWith("ru"):!1,he=$?"en-US":ge?"ru-RU":"zh-CN",Ye=$?["Mo","Tu","We","Th","Fr","Sa","Su"]:ge?["\u041F\u043D","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041F\u0442","\u0421\u0431","\u0412\u0441"]:["\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u65E5"];function ne(I){I.stopPropagation(),w<=0?(D(11),g(pe=>pe-1)):D(pe=>pe-1)}e(ne,"prevMonth");function J(I){I.stopPropagation(),w>=11?(D(0),g(pe=>pe+1)):D(pe=>pe+1)}e(J,"nextMonth");function gt(I){N?(I>=N?(t.onFrom(N),t.onTo(I)):(t.onFrom(I),t.onTo(N)),U(null),y(!1)):(U(I),B(I))}e(gt,"handleDayClick");function vt(I){let pe=Ja(I);I==="all"?t.onClear():(t.onFrom(pe.from),t.onTo(pe.to)),U(null),y(!1)}e(vt,"applyPreset");function Ze(I){let pe=Pn(I.getFullYear(),I.getMonth(),I.getDate());le(pe),N&&B(pe),(I.getFullYear()!==x||I.getMonth()!==w)&&(g(I.getFullYear()),D(I.getMonth()))}e(Ze,"moveFocusToDate");function ut(I,pe){let at=Sn(I);at&&Ze(new Date(at.year,at.monthIndex,at.day+pe))}e(ut,"moveFocus");let bt=t.from,Ve=t.to;N&&P&&(bt=N<=P?N:P,Ve=N<=P?P:N);let tn=Za(x,w),Je=new Date,nn=fe||bt||Pn(Je.getFullYear(),Je.getMonth(),Je.getDate()),F=tn.map((I,pe)=>{let at=bt===I.dateStr,Cn=Ve===I.dateStr,qt=!!(bt&&Ve&&I.dateStr>bt&&I.dateStr<Ve),Hn=I.year===Je.getFullYear()&&I.monthIndex===Je.getMonth()&&I.day===Je.getDate(),Vt="dsham_dateDay";I.isOutside&&(Vt+=" is-outside"),Hn&&(Vt+=" is-today"),at&&(Vt+=" is-start"),Cn&&(Vt+=" is-end"),qt&&(Vt+=" is-in-range");let Bn=!I.isOutside&&(I.dateStr===nn||I.day===1&&!tn.some(se=>!se.isOutside&&se.dateStr===nn));return r.createElement("div",{key:pe,className:Vt,role:"button",tabIndex:Bn?0:-1,"data-date":I.dateStr,"aria-label":I.dateStr,"aria-pressed":!!(at||Cn||qt),onClick:e(se=>{se.stopPropagation(),gt(I.dateStr)},"onClick"),onKeyDown:e(se=>{if(se.key==="Enter"||se.key===" ")se.preventDefault(),se.stopPropagation(),gt(I.dateStr);else if(se.key==="ArrowLeft")se.preventDefault(),se.stopPropagation(),ut(I.dateStr,-1);else if(se.key==="ArrowRight")se.preventDefault(),se.stopPropagation(),ut(I.dateStr,1);else if(se.key==="ArrowUp")se.preventDefault(),se.stopPropagation(),ut(I.dateStr,-7);else if(se.key==="ArrowDown")se.preventDefault(),se.stopPropagation(),ut(I.dateStr,7);else if(se.key==="Home"){se.preventDefault(),se.stopPropagation();let Ie=Sn(I.dateStr);if(Ie){let it=new Date(Ie.year,Ie.monthIndex,Ie.day),pn=(it.getDay()===0?7:it.getDay())-1;it.setDate(it.getDate()-pn),Ze(it)}}else if(se.key==="End"){se.preventDefault(),se.stopPropagation();let Ie=Sn(I.dateStr);if(Ie){let it=new Date(Ie.year,Ie.monthIndex,Ie.day),pn=(it.getDay()===0?7:it.getDay())-1;it.setDate(it.getDate()+(6-pn)),Ze(it)}}else if(se.key==="PageUp"){se.preventDefault(),se.stopPropagation();let Ie=Sn(I.dateStr);Ie&&Ze(ms(Ie.year,Ie.monthIndex,Ie.day,-1))}else if(se.key==="PageDown"){se.preventDefault(),se.stopPropagation();let Ie=Sn(I.dateStr);Ie&&Ze(ms(Ie.year,Ie.monthIndex,Ie.day,1))}},"onKeyDown"),onMouseEnter:e(()=>{N&&B(I.dateStr)},"onMouseEnter")},I.day)}),ze=`${x}\u5E74 ${w+1}\u6708`;try{ze=new Intl.DateTimeFormat(he,{year:"numeric",month:"long"}).format(new Date(x,w,1))}catch{ze=$||ge?`${x}-${String(w+1).padStart(2,"0")}`:`${x}\u5E74 ${w+1}\u6708`}return r.createElement("div",{ref:m,className:"dsham_dateRange",role:"group","aria-label":t.label},r.createElement("input",{className:"dsham_dateInputSrOnly",type:"date",tabIndex:-1,"aria-hidden":!0,value:t.from,"aria-label":t.fromLabel,"aria-invalid":t.invalid||void 0,onChange:e(I=>i("from",I.target.value),"onChange")}),r.createElement("input",{className:"dsham_dateInputSrOnly",type:"date",tabIndex:-1,"aria-hidden":!0,value:t.to,"aria-label":t.toLabel,"aria-invalid":t.invalid||void 0,onChange:e(I=>i("to",I.target.value),"onChange")}),r.createElement("div",{className:"dsham_dateTrigger"+(C?" is-open":""),role:"button",tabIndex:0,"aria-expanded":C,"aria-controls":C?"dsham-date-popover":void 0,onClick:e(()=>{C&&U(null),y(!C)},"onClick"),onKeyDown:e(I=>{(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),C&&U(null),y(!C))},"onKeyDown")},Ya(r.createElement),r.createElement("span",{className:"dsham_dateText"+(s?"":" placeholder")},l),s?r.createElement("button",{type:"button",className:"dsham_dateClearBtn","aria-label":"clear",title:"clear",onClick:e(I=>{I.stopPropagation(),t.onClear(),U(null)},"onClick"),children:"\xD7"}):null,r.createElement("span",{className:"dsham_dateChevron"},vs(r.createElement,C))),C&&r.createElement("div",{id:"dsham-date-popover",className:"dsham_datePopover",role:"region","aria-label":t.label,onClick:e(I=>I.stopPropagation(),"onClick")},r.createElement("div",{className:"dsham_datePresets"},r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>vt("all"),"onClick")},t.t?t.t("discovery.allTime"):"\u5168\u90E8\u65F6\u95F4"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>vt("today"),"onClick")},t.t?t.t("discovery.today"):"\u4ECA\u5929"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>vt("7d"),"onClick")},t.t?t.t("discovery.last7Days"):"\u8FD1 7 \u5929"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>vt("30d"),"onClick")},t.t?t.t("discovery.last30Days"):"\u8FD1 30 \u5929"),r.createElement("button",{type:"button",className:"dsham_datePresetBtn",onClick:e(()=>vt("90d"),"onClick")},t.t?t.t("discovery.last90Days"):"\u8FD1 90 \u5929")),r.createElement("div",{className:"dsham_dateCalendar"},r.createElement("div",{className:"dsham_dateCalHeader"},r.createElement("button",{type:"button",className:"dsham_dateNavBtn",onClick:ne,"aria-label":"prev month"},"\u2039"),r.createElement("span",{className:"dsham_dateMonthTitle"},ze),r.createElement("button",{type:"button",className:"dsham_dateNavBtn",onClick:J,"aria-label":"next month"},"\u203A")),r.createElement("div",{className:"dsham_dateGrid"},Ye.map((I,pe)=>r.createElement("div",{key:pe,className:"dsham_dateWeekday"},I))),r.createElement("div",{className:"dsham_dateGrid"},F))))}e(gs,"DateRange");function Qn(t){return W.createElement("div",{className:t.className},W.createElement("button",{type:"button",className:"dsham_disclosure","aria-expanded":t.open,onClick:t.onToggle},vs(W.createElement,t.open),t.title),t.open?W.createElement("div",null,t.children):null)}e(Qn,"Disclosure");function vs(t,r){return t("svg",{className:"dsham_foldChevron"+(r?" is-open":""),viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.5,"aria-hidden":!0},t("path",{d:"M4 6l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"}))}e(vs,"foldChevron");function mr(t){let r=W.useRef(null);return W.useEffect(()=>{r.current&&(r.current.indeterminate=!!t.indeterminate&&!t.checked)},[t.indeterminate,t.checked]),W.createElement("input",{ref:r,className:"dsham_checkbox",type:"checkbox",checked:t.checked,disabled:t.disabled,"aria-label":t.label,onChange:e(i=>t.onChange({target:{checked:i.target.checked}}),"onChange")})}e(mr,"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"),ys=e((t,r=!1)=>{if(typeof t!="string"||t.length>200||r&&!t.trim())throw new TypeError("\u5173\u952E\u8BCD\u987B\u4E3A 1\uFF5E200 \u4E2A\u5B57\u7B26");return t.trim()},"queryText"),bs={parse(t){let r=ce(t);if(!r||!Array.isArray(r.sessionIds)||!r.sessionIds.length||r.sessionIds.length>20)throw new TypeError("\u6BCF\u6B21\u68C0\u7D22\u987B\u5305\u542B 1\uFF5E20 \u4E2A\u4F1A\u8BDD");return{sessionIds:[...new Set(r.sessionIds.map(On))],query:ys(r.query,!0)}}},Xa={parse(t){let r=ce(t);if(!r)throw new TypeError("\u9884\u89C8\u53C2\u6570\u65E0\u6548");return{sessionId:On(r.sessionId),query:ys(r.query??"")}}},fr=e((t,r)=>{if(typeof t!="string"||t.length>r)throw new TypeError("\u8FD4\u56DE\u6587\u672C\u65E0\u6548");return t},"boundedString"),ws=e(t=>{if(typeof t!="number"||!Number.isSafeInteger(t)||t<0)throw new TypeError("\u6D88\u606F\u5E8F\u53F7\u65E0\u6548");return t},"sequence"),gr={parse(t){let r=ce(t);if(!r||!Array.isArray(r.items)||!Array.isArray(r.failures)||r.items.length>20||r.failures.length>20)throw new TypeError("\u68C0\u7D22\u7ED3\u679C\u65E0\u6548");return{items:r.items.map(ce).map(i=>({sessionId:On(i.sessionId),seq:ws(i.seq),snippet:fr(i.snippet,400)})),failures:r.failures.map(ce).map(i=>({sessionId:On(i.sessionId),message:fr(i.message,500)}))}}},Qa={parse(t){let r=ce(t);if(!r||!Array.isArray(r.messages)||r.messages.length>8||typeof r.hasEarlier!="boolean"||typeof r.hasLater!="boolean")throw new TypeError("\u9884\u89C8\u7ED3\u679C\u65E0\u6548");return{sessionId:On(r.sessionId),hasEarlier:r.hasEarlier,hasLater:r.hasLater,messages:r.messages.map(ce).map(i=>{if(typeof i.role!="string"||!["user","assistant"].includes(i.role)||typeof i.truncated!="boolean")throw new TypeError("\u6D88\u606F\u89D2\u8272\u6216\u622A\u65AD\u72B6\u6001\u65E0\u6548");return{seq:ws(i.seq),role:i.role,text:fr(i.text,2e3),truncated:i.truncated}})}}};async function tr(t,r=globalThis.navigator?.clipboard){if(typeof t!="string"||!t)throw Object.assign(new Error("\u6CA1\u6709\u53EF\u590D\u5236\u7684\u5185\u5BB9"),{code:"copy.empty"});if(!r?.writeText)throw Object.assign(new Error("\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u526A\u8D34\u677F\uFF0C\u8BF7\u5728 HTTPS \u6216\u672C\u673A\u5730\u5740\u4E2D\u6253\u5F00\u9875\u9762"),{code:"copy.unavailable"});try{await r.writeText(t)}catch{throw Object.assign(new Error("\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u5141\u8BB8\u6D4F\u89C8\u5668\u8BBF\u95EE\u526A\u8D34\u677F\u540E\u91CD\u8BD5"),{code:"copy.denied"})}}e(tr,"copySessionText");function Ss(){let t=e((i,s)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${i}`,create:e(()=>s,"create"),schema:s}),"codec");return[["searchSessionContent",bs,gr],["searchArchivedContent",bs,gr],["previewArchivedSession",Xa,Qa]].map(([i,s,l])=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${i}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:i,invocation:{kind:"direct"},parameters:[{name:"input",wire:"input",source:"json",codec:t(i+"Input",s)}],result:t(i+"Result",l),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}e(Ss,"discoveryInvocations");function xs(t,r){let i=r?.trim().toLowerCase();if(!i)return null;let s=t.toLowerCase().indexOf(i);if(s<0)return null;let l=0,h=0,m;for(let C of t){let y=h+C.toLowerCase().length;if(m===void 0&&y>s&&(m=l),l+=C.length,y>=s+i.length)return{start:m??l,end:l};h=y}return null}e(xs,"findTextRange");function er(t,r=!1){if(!/^\d{4}-\d{2}-\d{2}$/.test(t))return NaN;let[i,s,l]=t.split("-").map(Number),h=new Date(i,s-1,l);return h.getFullYear()!==i||h.getMonth()!==s-1||h.getDate()!==l?NaN:(r&&h.setDate(h.getDate()+1),h.getTime())}e(er,"dayBoundary");function vr(t,r){return(!t||Number.isFinite(er(t)))&&(!r||Number.isFinite(er(r)))&&(!t||!r||t<=r)}e(vr,"validUpdatedRange");function ks(t,r,i){if(!vr(r,i))return!1;if(!r&&!i)return!0;let s=typeof t=="number"?t:Date.parse(t??"");return Number.isFinite(s)&&(!r||s>=er(r))&&(!i||s<er(i,!0))}e(ks,"matchesUpdatedRange");async function Cs(t,r,i,{signal:s,onProgress:l}={}){let h=[],m=[],C=[...new Set(t)],y=e(()=>{if(s?.aborted)throw new Error("\u641C\u7D22\u5DF2\u53D6\u6D88")},"check");for(let _=0;_<C.length;_+=20){y();let x=gr.parse(await i({sessionIds:C.slice(_,_+20),query:r}));y(),h.push(...x.items),m.push(...x.failures),l?.({done:Math.min(_+20,C.length),total:C.length,items:[...h],failures:[...m]})}return y(),{items:h,failures:m}}e(Cs,"searchArchiveBatches");function Es(t,r={}){let i=t.createElement;function s({text:g,query:w=""}){let D=xs(g,w);return D?i(t.Fragment,null,g.slice(0,D.start),i("mark",null,g.slice(D.start,D.end)),g.slice(D.end)):g}e(s,"HighlightedText");function l(g,w,D,N){let U=JSON.stringify(g),P=JSON.stringify([U,w]),[B,fe]=t.useState(0),[le,$]=t.useState({key:"",status:"idle",items:[],failures:[]});return t.useEffect(()=>{if(!D||!w.trim()||!N)return;let he=new AbortController;$({key:P,status:"loading",items:[],failures:[],done:0,total:g.length});let Ye=setTimeout(()=>{Cs(JSON.parse(U),w,N,{signal:he.signal,onProgress:e(ne=>{he.signal.aborted||$({key:P,status:"loading",...ne})},"onProgress")}).then(ne=>{he.signal.aborted||$({key:P,status:"ready",done:g.length,total:g.length,...ne})}).catch(ne=>{he.signal.aborted||$(J=>({...J,key:P,status:"error",error:Be(ne)}))})},350);return()=>{he.abort(),clearTimeout(Ye)}},[U,w,D,N,B]),{...D&&w.trim()&&N?le.key===P?le:{key:P,status:"loading",items:[],failures:[],done:0,total:g.length}:{status:"idle",items:[],failures:[]},retry:e(()=>fe(he=>he+1),"retry")}}e(l,"useArchiveSearch");function h(g,w){let[D,N]=t.useState(null),[U,P]=t.useState({status:"idle"}),[B,fe]=t.useState(0),le=D,$=D&&w.includes(D.session.id);return t.useEffect(()=>{D&&!$&&N(null)},[D,$]),t.useEffect(()=>{if(!$||typeof window>"u")return;let ge=e(he=>{he.key==="Escape"&&(he.preventDefault(),he.stopPropagation(),he.stopImmediatePropagation(),N(null))},"onKeyDown");return window.addEventListener("keydown",ge,!0),()=>window.removeEventListener("keydown",ge,!0)},[$]),t.useEffect(()=>{if(!D||!$||!g)return;let ge=!0;return P({key:le,status:"loading"}),Promise.resolve().then(()=>g({sessionId:D.session.id,query:D.query})).then(he=>{ge&&P({key:le,status:"ready",value:he})}).catch(he=>{ge&&P({key:le,status:"error",error:Be(he)})}),()=>{ge=!1}},[le,$,g,B]),{target:$?D:null,...U.key===le?U:{status:"loading"},open:e((ge,he="")=>N({session:ge,query:he}),"open"),close:e(()=>N(null),"close"),retry:e(()=>fe(ge=>ge+1),"retry")}}e(h,"useArchivePreview");function m({title:g,failures:w,separator:D}){let[N,U]=t.useState(!1),P=i("ul",null,w.map(B=>i("li",{key:B.sessionId},B.sessionId,D,B.message)));return i(Qn,{title:g,open:N,onToggle:e(()=>U(B=>!B),"onToggle")},P)}e(m,"FailureDetails");function C(g,w){let D=r.Button??(N=>i("button",{type:"button",disabled:N.disabled,onClick:N.onClick},N.children));return i(D,{variant:"outline",size:"sm",...w},g)}e(C,"textButton");function y({t:g,from:w,to:D,onFrom:N,onTo:U,invalid:P,onClear:B}){return i("div",{className:"dsham_dateFilter"},i(gs,{React:t,from:w,to:D,invalid:P,label:g("discovery.date"),fromLabel:g("discovery.from"),toLabel:g("discovery.to"),onFrom:N,onTo:U,onClear:B,t:g}),P?i("p",{className:"dsham_dateAlert",role:"alert"},g("discovery.invalidDate")):null)}e(y,"DiscoveryFilters");function _({state:g,t:w}){return g.status==="idle"?null:i("div",{className:"dsham_discoveryStatus",role:"status","aria-live":"polite"},i("p",null,w(g.status==="loading"?"discovery.searching":g.status==="error"?"discovery.searchError":"discovery.searched",{done:g.done??0,total:g.total??0})),g.status==="error"&&i("p",null,g.error),g.failures.length>0&&i(m,{title:w("discovery.failed",{n:g.failures.length}),failures:g.failures,separator:w("common.separator")}),(g.status==="error"||g.status==="ready"&&g.failures.length>0)&&C(w("discovery.retry"),{onClick:g.retry}))}e(_,"SearchStatus");function x({preview:g,t:w,MarkdownText:D}){let[N,U]=t.useState(!1);if(g.status==="loading")return i("p",{role:"status"},w("discovery.loading"));if(g.status==="error")return i("div",null,i("p",{role:"alert"},g.error),C(w("discovery.retry"),{onClick:g.retry}));let P=g.value;return P?i("div",{className:"dsham_previewMessages"},i("div",{className:"dsham_previewToolbar"},i("span",{title:w("discovery.previewHint")},w("discovery.readOnly")," \xB7 ",w("discovery.messageCount",{n:P.messages.length})),D&&i(r.SegmentedControl??"div",{id:"dsham-preview-mode",label:w("discovery.displayMode"),value:N?"raw":"formatted",options:[{value:"formatted",label:w("discovery.formatted")},{value:"raw",label:w("discovery.raw")}],onChange:e(B=>U(B==="raw"),"onChange")})),P.hasEarlier&&i("p",null,w("discovery.earlier")),!P.messages.length&&i("p",null,w("discovery.empty")),P.messages.map(B=>i("article",{key:B.seq,className:"dsham_previewMessage"},i("div",{className:"dsham_previewRole","data-role":B.role},i("span",{"aria-hidden":!0},w(B.role==="user"?"discovery.you":"discovery.ai")),i("strong",null,w("discovery."+B.role))),N||!D?i("pre",{className:"dsham_previewRaw"},i(s,{text:B.text,query:g.target?.query})):i(D,{text:B.text,streaming:!1,labels:{code:{copyLabel:w("discovery.copyCode"),copiedLabel:w("details.copied")},footnotes:w("discovery.footnotes")}}),B.truncated&&i("small",null,w("discovery.truncated")))),P.hasLater&&i("p",null,w("discovery.later"))):null}return e(x,"PreviewContent"),{HighlightedText:s,useArchiveSearch:l,useArchivePreview:h,DiscoveryFilters:y,SearchStatus:_,PreviewContent:x}}e(Es,"createDiscoveryTools");var Is=[".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(""),Ts={"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"},As={"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"},_s={"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 Rs=e(t=>{let r=ce(t);if(!r||typeof r.sessionId!="string"||!r.sessionId.length||r.sessionId.length>1024||typeof r.identity!="string"||!r.identity.length||r.identity.length>4096)throw new TypeError("invalid cache rebuild candidate");return{sessionId:r.sessionId,identity:r.identity}},"candidate"),ei={parse(t){let r=ce(t);if(!r||!Array.isArray(r.items)||!r.items.length||r.items.length>20)throw new TypeError("invalid cache rebuild batch (1\u201320 items required)");return{items:r.items.map(Rs)}}},br={parse(t){let r=ce(t);if(!r||!Array.isArray(r.items)||r.count!==r.items.length)throw new TypeError("invalid cache diagnosis");return{count:r.items.length,items:r.items.map(Rs)}}},yr={parse(t){let r=ce(t);for(let i of["rebuiltSessionIds","skippedSessionIds"])if(!Array.isArray(r?.[i])||r[i].some(s=>typeof s!="string"))throw new TypeError("invalid cache rebuild result");if(!Array.isArray(r.failures)||r.failures.some(i=>!i||typeof i.sessionId!="string"||typeof i.message!="string"))throw new TypeError("invalid cache rebuild failures");return r}};function js(){let t=e((r,i)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${r}`,create:e(()=>i,"create"),schema:i}),"codec");return[{method:"diagnoseSessionCaches",parameters:[],result:t("CacheDiagnosis",br)},{method:"rebuildSessionCaches",parameters:[{name:"input",wire:"input",source:"json",codec:t("CacheRebuildInput",ei)}],result:t("CacheRebuildResult",yr)}].map(({method:r,...i})=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${r}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:r,invocation:{kind:"direct"},...i,sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}e(js,"cacheRebuildInvocations");function Ns(t,r={}){let{maxLoadRetries:i=3,retryDelayMs:s=200}=r,l={diagnosis:{count:0,items:[]},busy:!1,progress:null,result:null,error:null,refreshError:null},h=!0,m=0,C=[],y,_=new Set,x=e(w=>{if(h){l={...l,...w};for(let D of _)D()}},"update"),g=e(async(w=i)=>{if(!h)return;y!==void 0&&(clearTimeout(y),y=void 0);let D=++m;try{let N=br.parse(await t.diagnose());h&&D===m&&x({diagnosis:N,error:null})}catch(N){if(w>0&&h&&D===m){y=setTimeout(()=>{y=void 0,h&&D===m&&g(w-1)},s);return}h&&D===m&&x({error:Be(N)})}},"load");return{snapshot:e(()=>l,"snapshot"),subscribe(w){return _.add(w),()=>{_.delete(w)}},load:g,async run(w=!1){if(!h||l.busy)return;++m,y!==void 0&&(clearTimeout(y),y=void 0);let D=w?[...C]:[...l.diagnosis.items],N={rebuiltSessionIds:[],skippedSessionIds:[],failures:[]};C=[],x({busy:!0,result:null,error:null,refreshError:null,progress:{done:0,total:D.length}});for(let[U,P]of D.entries()){if(!h)return;try{let B=yr.parse(await t.rebuild({items:[P]}));if(!h)return;N.rebuiltSessionIds.push(...B.rebuiltSessionIds),N.skippedSessionIds.push(...B.skippedSessionIds),N.failures.push(...B.failures),B.failures.length&&C.push(P)}catch(B){if(!h)return;N.failures.push({sessionId:P.sessionId,message:Be(B)}),C.push(P)}x({progress:{done:U+1,total:D.length}})}x({result:N});try{await t.refresh()}catch(U){x({refreshError:Be(U)})}h&&(await g(),x({busy:!1,progress:null}))},dismiss(){h&&x({result:null,error:null,refreshError:null})},dispose(){h=!1,++m,y!==void 0&&(clearTimeout(y),y=void 0),_.clear()}}}e(Ns,"createCacheRebuildController");var en=class extends Error{static{e(this,"ArchiveNavigationError")}code;constructor(r){super(r),this.name="ArchiveNavigationError",this.code=r}};function Ms(t,r){return t instanceof en?r(`archives.${t.code}`):Be(t)}e(Ms,"formatArchiveNavigationError");function ti(t,r){if(typeof t?.retainInfo!="function")return;let i=t.retainInfo(r),s=i&&typeof i=="object"&&"getSnapshot"in i&&typeof i.getSnapshot=="function"?i.getSnapshot():i;if(!s||typeof s!="object"||!("retainedBy"in s))return;let l=s.retainedBy;if(!(!l||typeof l!="object"||!("mainView"in l)||typeof l.mainView!="number"))return{retainedBy:{mainView:l.mainView}}}e(ti,"retainInfoSnapshot");function ni(t){let r=t?.byId;if(r!==void 0){for(let i of Object.values(r))if(i&&(i.retainedBy?.mainView??0)>0)return i.id}}e(ni,"mainViewSessionId");function nr(t){return ni(t)}e(nr,"currentSessionId");function ri(t,r,i){return r===void 0||r===""?!1:(t?.byId?.[r]?.retainedBy?.mainView??0)>0||(ti(i,r)?.retainedBy?.mainView??0)>0}e(ri,"sessionIsCurrent");async function Ds(t,r,i,s=()=>!0){if(i){if(typeof t.prepare=="function"&&await t.prepare(r),!s())return;await t.restore(r)}s()&&await t.open(r)}e(Ds,"openArchivedConversation");function Ls(t,r,i,{onOpened:s=e(()=>{},"onOpened"),beginNavigation:l,warn:h=e((...m)=>console.warn(...m),"warn")}={}){let m,C=t?.clearArchivedCurrent,y=t&&Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent"),_=e(w=>ri(r.list.getSnapshot(),w,r),"viewing"),x=e(function(...w){return m!==void 0&&_(m)&&i.list.getSnapshot().archivedSessionIds.includes(m)?!1:(m=void 0,C?.apply(this,w))},"wrapped"),g=e(()=>t&&Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent")?.value===x,"ownsWrapper");if(t&&typeof C=="function")try{if(t.clearArchivedCurrent=x,!g())throw new Error("\u5BFC\u822A\u65B9\u6CD5\u672A\u63A5\u7EB3\u5F52\u6863\u9002\u914D")}catch(w){h("archive-manager: \u65E0\u6CD5\u9002\u914D\u5F52\u6863\u5BFC\u822A\uFF0C\u8BF7\u6062\u590D\u4F1A\u8BDD\u540E\u6253\u5F00\u3002",w)}return{open(w){m=w;try{if(typeof C=="function"&&!g()&&i.list.getSnapshot().archivedSessionIds.includes(w))throw h("archive-manager: \u5F52\u6863\u5BFC\u822A\u9002\u914D\u4E0D\u53EF\u7528\u6216\u5DF2\u88AB\u66FF\u6362\u3002"),new en("navigationUnavailable");if(l?.(),typeof t?.openSession!="function")throw h("archive-manager: \u5BBF\u4E3B\u672A\u63D0\u4F9B\u4F1A\u8BDD\u6253\u5F00\u63A5\u53E3\u3002"),new en("navigationUnavailable");if(t.openSession(w),!_(w))throw h("archive-manager: \u5BBF\u4E3B\u672A\u4FDD\u7559\u76EE\u6807\u4F1A\u8BDD\u3002",{cleanupAvailable:typeof C=="function"}),new en("sessionNotRetained");s()}catch(D){throw m=void 0,D}},dispose(){m=void 0,!(!t||Object.getOwnPropertyDescriptor(t,"clearArchivedCurrent")?.value!==x)&&(y?Object.defineProperty(t,"clearArchivedCurrent",y):delete t.clearArchivedCurrent,C?.call(t))}}}e(Ls,"allowArchivedNavigation");var un=require("@deepseek-ai/dsh-client-ui-primitives");var zs={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"},Ps={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 Fn(t){return t.toLowerCase().startsWith("zh")?zs:Ps}e(Fn,"pluginUpdateCopy");function si(t,r,i,s){let l=Fn(t),h=r?.restartDesktop===!0||r?.profileName==="desktop",m=h?{...l,manualHint:l.manualHintDesktop}:l,C=i!=="idle",y=m.checking,_="";return i==="checking"?y=m.checking:i==="updating"?y=m.updating:s.type==="error"?(y=s.message||m.failed,_="error"):s.type==="restart"?(y=h?m.restartDesktop:m.restart,_="success"):s.type==="restarting"?(y=m.restarting,_="success"):r===void 0?y=m.checking:r.latestCheckFailed?(y=m.failed,_="error"):!r.canAutoUpdate&&r.updateAvailable?(y=m.unavailable,_="update"):r.updateAvailable?(y=`${m.found}: v${r.latestVersion??m.unknown}`,_="update"):(y=m.latest,_="success"),{copy:m,busy:C,message:y,kind:_,loading:i==="updating",updateLabel:i==="updating"?m.updating:m.auto,disabled:C||r?.canAutoUpdate!==!0||r.updateAvailable!==!0,currentVersion:r===void 0?m.unknown:`v${r.currentVersion}`,latestVersion:r?.latestVersion===void 0?m.unknown:`v${r.latestVersion}`,profileName:r?.profileName??m.unknown,profileRaw:r?.profileName??"",latestRaw:r?.latestVersion??"latest"}}e(si,"describePluginUpdate");function Os(t,r,i){let s="idle",l=r,h={type:"status"},m=0,C=new Set,y=e(()=>{for(let x of C)x()},"emit"),_=e(x=>{l=x,i?.(x)},"assign");return{get posts(){return m},subscribe(x){return C.add(x),()=>{C.delete(x)}},view(x){return si(x,l,s,h)},async check(){if(s==="idle"){s="checking",h={type:"status"},y();try{_(await t("GET")),h={type:"status"}}catch(x){h={type:"error",message:x instanceof Error?x.message:""}}finally{s="idle",y()}}},async update(){if(s==="idle"){s="updating",h={type:"status"},m+=1,y();try{let x=await t("POST");_(x),h={type:x.autoReload===!0?"restarting":"restart"}}catch(x){h={type:"error",message:x instanceof Error?x.message:""}}finally{s="idle",y()}}}}}e(Os,"createUpdateFlow");function Fs(t,r,i){return`dsh plugin${t.trim()===""?"":` --profile ${t.trim()}`} add ${r}@${i} --registry=https://registry.npmjs.org/`}e(Fs,"manualPluginUpdateCommand");function Hs(t,r){return t.key!=="Escape"?!1:(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),r(),!0)}e(Hs,"handlePluginUpdateEscape");function ai(){let t=globalThis.document;if(typeof t>"u"||t===null)return;let r=t.baseURI;if(!(typeof r!="string"||r===""))try{let i=new URL(r),s=i.pathname.lastIndexOf("/"),l=i.pathname.slice(s+1);return/\.(html?|php|aspx?|jsp)$/i.test(l)?i.pathname=i.pathname.slice(0,s+1):i.pathname.endsWith("/")||(i.pathname+="/"),i.href}catch{return}}e(ai,"pageBaseHref");function xn(t){if(typeof t!="string"||t.charAt(0)!=="/"||t.charAt(1)==="/")return t;let r=ai();if(r===void 0)return t;try{return new URL(t.slice(1),r).href}catch{return t}}e(xn,"resolveApiUrl");function Bs(t){let i=Function("return globalThis.__dshArchiveReactDOMClient")()?.createRoot;if(i===void 0)throw new Error("createRoot unavailable");return i(t)}e(Bs,"mountRoot");var ii="x-michengai-plugin-update",Us="michengai-plugin-update-ui",wr=`
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 oi(){let t=document.getElementById(Bs);if(t!==null){t.textContent!==vr&&(t.textContent=vr);return}let r=document.createElement("style");r.id=Bs,r.textContent=vr,(document.head??document.documentElement).append(r)}e(oi,"ensureStyle");function li(t){if(t===null||typeof t!="object")return!1;let r=t;return typeof r.packageName=="string"&&typeof r.currentVersion=="string"&&typeof r.updateAvailable=="boolean"&&typeof r.profileName=="string"&&typeof r.canAutoUpdate=="boolean"&&typeof r.latestCheckFailed=="boolean"&&(r.latestVersion===void 0||typeof r.latestVersion=="string")}e(li,"validPayload");async function Us(t,r,i){let s=i===void 0?{}:{signal:i},l=await fetch(t,r==="GET"?{cache:"no-store",...s}:{method:"POST",headers:{"content-type":"application/json",[ii]:"1"},body:"{}",...s}),u=await l.json();if(!l.ok||!li(u))throw new Error(u&&typeof u=="object"&&"error"in u&&typeof u.error=="string"?u.error:Dn(document.documentElement.lang).failed);return u}e(Us,"requestStatus");function ci(t){let r=W.useRef(null);return W.useLayoutEffect(()=>{r.current?.replaceChildren(t.node)},[t.node]),W.createElement("span",{ref:r,className:"mpi-icon","aria-hidden":!0})}e(ci,"HostIcon");function di(t){let r=W.useRef(null),[,i]=W.useState(0),[s,l]=W.useState("idle");W.useEffect(()=>t.flow.subscribe(()=>i(x=>x+1)),[t.flow]),W.useEffect(()=>{let x=document.documentElement,g=new MutationObserver(()=>i(w=>w+1));return g.observe(x,{attributes:!0,attributeFilter:["lang"]}),()=>g.disconnect()},[]),W.useEffect(()=>{t.flow.check()},[t.flow]),W.useEffect(()=>{function x(g){Fs(g,t.onClose)}return e(x,"onKey"),document.addEventListener("keydown",x,!0),()=>document.removeEventListener("keydown",x,!0)},[t.onClose]);let u=document.documentElement.lang,m=t.flow.view(u),C=u.toLowerCase().startsWith("zh")?t.zhName:u.toLowerCase().startsWith("ru")?t.ruName:t.enName,y=Os(m.profileRaw,t.packageName,m.latestRaw),_=s==="copied"?m.copy.copied:s==="failed"?m.copy.copyFailed:m.copy.copy;return W.createElement(an.Modal,{open:!0,className:"mpi-dialog",title:`${C} ${m.copy.update}`,closeLabel:"Close",onClose:t.onClose,footer:[W.createElement(an.Button,{key:"check",variant:"outline",disabled:m.busy,onClick:e(()=>{t.flow.check()},"onClick")},m.copy.recheck),W.createElement(an.Button,{key:"update",variant:"primary",disabled:m.disabled,onClick:e(()=>{t.flow.update()},"onClick")},m.updateLabel)]},W.createElement("div",{ref:r},W.createElement("p",{className:"mpi-intro"},m.copy.intro),W.createElement("dl",{className:"mpi-meta"},W.createElement("dt",null,m.copy.current),W.createElement("dd",null,W.createElement("span",{className:"mpi-mono"},m.currentVersion)),W.createElement("dt",null,m.copy.latestLabel),W.createElement("dd",{className:"mpi-latest"},W.createElement("span",{className:"mpi-mono"},m.latestVersion),W.createElement("span",{className:"mpi-status",role:"status","data-kind":m.kind,...m.kind==="update"?{style:{color:"#e8b15a"}}:{}},m.message)),W.createElement("dt",null,m.copy.profile),W.createElement("dd",null,W.createElement("span",{className:"mpi-mono"},m.profileName))),m.busy?W.createElement("div",{className:"dssm-update-progress",role:"progressbar","aria-busy":"true"},W.createElement("div",{className:"dssm-update-progress-bar"})):null,W.createElement("section",{className:"mpi-manual"},W.createElement("h3",null,m.copy.manual),W.createElement("p",null,m.copy.manualHint),W.createElement("div",{className:"mpi-command"},W.createElement("code",null,y),W.createElement(an.Button,{variant:"outline",size:"sm",disabled:m.busy,onClick:e(()=>{let x=navigator.clipboard?.writeText(y);if(x===void 0){l("failed");return}x.then(()=>{l("copied"),window.setTimeout(()=>l("idle"),1400)}).catch(()=>l("failed"))},"onClick")},_)))))}e(di,"UpdateDialog");function Ws(t){if(typeof document>"u"||document.body===null)return()=>{};let r=fn(t.endpoint);oi();let i=new AbortController,s,l,u,m,C,y,_;function x(){u?.unmount(),u=void 0,l=void 0,m=void 0}e(x,"unmountCheck");function g(){if(u===void 0)return;m===void 0&&(m=t.createIcon("refresh"));let le=m;u.render(W.createElement(an.Button,{variant:"outline",size:"sm",onClick:D,icon:W.createElement(ci,{node:le})},W.createElement("span",{"data-mpi-label":""},Dn(document.documentElement.lang).check)))}e(g,"renderCheck");function w(){y?.unmount(),y=void 0,C?.remove(),C=void 0}e(w,"closeDialog");function D(){w();let le=document.createElement("div");le.className="mpi-dialog-root",document.body.append(le),C=le,y=Hs(le),y.render(W.createElement(di,{flow:Ps(V=>Us(r,V,i.signal),s,V=>{s=V,j()}),packageName:t.packageName,zhName:t.zhName,enName:t.enName,ruName:t.ruName,onClose:w}))}e(D,"openDialog");function j(){let le=document.querySelector(t.titleRowSelector);if(le===null)return;let V=le.querySelector("h1,h2"),fe=le.querySelector(t.linksSelector);if(t.isEnabled&&!t.isEnabled()){if(C!==void 0&&w(),fe!==null){let re=fe.querySelector(`[data-mpi-check="${t.packageName}"]`);re!==null&&(x(),re.remove())}if(V!==null){let re=V.querySelector(`.mpi-version[data-package="${t.packageName}"]`);re!==null&&re.remove()}return}if(V!==null&&s!==void 0){let re=V.querySelector(`.mpi-version[data-package="${t.packageName}"]`);re===null&&(re=document.createElement("span"),re.className="mpi-version",re.dataset.package=t.packageName,V.append(re));let X=`v${s.currentVersion}`;re.textContent!==X&&(re.textContent=X)}if(l!==void 0&&!l.isConnected&&x(),fe===null)return;let ue=fe.querySelector(`[data-mpi-check="${t.packageName}"]`);if(ue!==null){let re=ue.querySelector("[data-mpi-label]");(re===null||re.textContent!==Dn(document.documentElement.lang).check)&&g();return}let Qe=document.createElement("span");Qe.dataset.mpiCheck=t.packageName,Qe.className="mpi-check-host",fe.append(Qe),l=Qe,u=Hs(Qe),g()}e(j,"applyControls");let U=new MutationObserver(()=>{_===void 0&&(_=window.requestAnimationFrame(()=>{_=void 0,j()}))});U.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["lang"]});let P,B=e(async()=>P||(P=(async()=>{try{return s=await Us(r,"GET",i.signal),j(),s}finally{P=void 0}})(),P),"load"),me=e(()=>{j(),(!t.isEnabled||t.isEnabled())&&B().catch(()=>{})},"onToggle");return typeof window<"u"&&window.addEventListener("dsham-update-toggle",me),j(),B().catch(()=>{}),()=>{i.abort(),U.disconnect(),w(),x(),typeof window<"u"&&window.removeEventListener("dsham-update-toggle",me),_!==void 0&&window.cancelAnimationFrame(_),document.querySelectorAll(`[data-mpi-check="${t.packageName}"],.mpi-version[data-package="${t.packageName}"]`).forEach(le=>le.remove())}}e(Ws,"observePluginUpdate");var on=require("@deepseek-ai/dsh-client-ui-primitives");var Fe=us,ui="@michengai/dsh-archive-manager",br="archived-sessions",hi=4,qs="dsham-sidebar-entry-style",pi=`
14
+ `;function oi(){let t=document.getElementById(Us);if(t!==null){t.textContent!==wr&&(t.textContent=wr);return}let r=document.createElement("style");r.id=Us,r.textContent=wr,(document.head??document.documentElement).append(r)}e(oi,"ensureStyle");function li(t){if(t===null||typeof t!="object")return!1;let r=t;return typeof r.packageName=="string"&&typeof r.currentVersion=="string"&&typeof r.updateAvailable=="boolean"&&typeof r.profileName=="string"&&typeof r.canAutoUpdate=="boolean"&&typeof r.latestCheckFailed=="boolean"&&(r.latestVersion===void 0||typeof r.latestVersion=="string")}e(li,"validPayload");async function Ws(t,r,i){let s=i===void 0?{}:{signal:i},l=await fetch(t,r==="GET"?{cache:"no-store",...s}:{method:"POST",headers:{"content-type":"application/json",[ii]:"1"},body:"{}",...s}),h=await l.json();if(!l.ok||!li(h))throw new Error(h&&typeof h=="object"&&"error"in h&&typeof h.error=="string"?h.error:Fn(document.documentElement.lang).failed);return h}e(Ws,"requestStatus");function ci(t){let r=W.useRef(null);return W.useLayoutEffect(()=>{r.current?.replaceChildren(t.node)},[t.node]),W.createElement("span",{ref:r,className:"mpi-icon","aria-hidden":!0})}e(ci,"HostIcon");function di(t){let r=W.useRef(null),[,i]=W.useState(0),[s,l]=W.useState("idle");W.useEffect(()=>t.flow.subscribe(()=>i(x=>x+1)),[t.flow]),W.useEffect(()=>{let x=document.documentElement,g=new MutationObserver(()=>i(w=>w+1));return g.observe(x,{attributes:!0,attributeFilter:["lang"]}),()=>g.disconnect()},[]),W.useEffect(()=>{t.flow.check()},[t.flow]),W.useEffect(()=>{function x(g){Hs(g,t.onClose)}return e(x,"onKey"),document.addEventListener("keydown",x,!0),()=>document.removeEventListener("keydown",x,!0)},[t.onClose]);let h=document.documentElement.lang,m=t.flow.view(h),C=h.toLowerCase().startsWith("zh")?t.zhName:h.toLowerCase().startsWith("ru")?t.ruName:t.enName,y=Fs(m.profileRaw,t.packageName,m.latestRaw),_=s==="copied"?m.copy.copied:s==="failed"?m.copy.copyFailed:m.copy.copy;return W.createElement(un.Modal,{open:!0,className:"mpi-dialog",title:`${C} ${m.copy.update}`,closeLabel:"Close",onClose:t.onClose,footer:[W.createElement(un.Button,{key:"check",variant:"outline",disabled:m.busy,onClick:e(()=>{t.flow.check()},"onClick")},m.copy.recheck),W.createElement(un.Button,{key:"update",variant:"primary",disabled:m.disabled,onClick:e(()=>{t.flow.update()},"onClick")},m.updateLabel)]},W.createElement("div",{ref:r},W.createElement("p",{className:"mpi-intro"},m.copy.intro),W.createElement("dl",{className:"mpi-meta"},W.createElement("dt",null,m.copy.current),W.createElement("dd",null,W.createElement("span",{className:"mpi-mono"},m.currentVersion)),W.createElement("dt",null,m.copy.latestLabel),W.createElement("dd",{className:"mpi-latest"},W.createElement("span",{className:"mpi-mono"},m.latestVersion),W.createElement("span",{className:"mpi-status",role:"status","data-kind":m.kind,...m.kind==="update"?{style:{color:"#e8b15a"}}:{}},m.message)),W.createElement("dt",null,m.copy.profile),W.createElement("dd",null,W.createElement("span",{className:"mpi-mono"},m.profileName))),m.busy?W.createElement("div",{className:"dssm-update-progress",role:"progressbar","aria-busy":"true"},W.createElement("div",{className:"dssm-update-progress-bar"})):null,W.createElement("section",{className:"mpi-manual"},W.createElement("h3",null,m.copy.manual),W.createElement("p",null,m.copy.manualHint),W.createElement("div",{className:"mpi-command"},W.createElement("code",null,y),W.createElement(un.Button,{variant:"outline",size:"sm",disabled:m.busy,onClick:e(()=>{let x=navigator.clipboard?.writeText(y);if(x===void 0){l("failed");return}x.then(()=>{l("copied"),window.setTimeout(()=>l("idle"),1400)}).catch(()=>l("failed"))},"onClick")},_)))))}e(di,"UpdateDialog");function qs(t){if(typeof document>"u"||document.body===null)return()=>{};let r=xn(t.endpoint);oi();let i=new AbortController,s,l,h,m,C,y,_;function x(){h?.unmount(),h=void 0,l=void 0,m=void 0}e(x,"unmountCheck");function g(){if(h===void 0)return;m===void 0&&(m=t.createIcon("refresh"));let le=m;h.render(W.createElement(un.Button,{variant:"outline",size:"sm",onClick:D,icon:W.createElement(ci,{node:le})},W.createElement("span",{"data-mpi-label":""},Fn(document.documentElement.lang).check)))}e(g,"renderCheck");function w(){y?.unmount(),y=void 0,C?.remove(),C=void 0}e(w,"closeDialog");function D(){w();let le=document.createElement("div");le.className="mpi-dialog-root",document.body.append(le),C=le,y=Bs(le),y.render(W.createElement(di,{flow:Os($=>Ws(r,$,i.signal),s,$=>{s=$,N()}),packageName:t.packageName,zhName:t.zhName,enName:t.enName,ruName:t.ruName,onClose:w}))}e(D,"openDialog");function N(){let le=document.querySelector(t.titleRowSelector);if(le===null)return;let $=le.querySelector("h1,h2"),ge=le.querySelector(t.linksSelector);if(t.isEnabled&&!t.isEnabled()){if(C!==void 0&&w(),ge!==null){let ne=ge.querySelector(`[data-mpi-check="${t.packageName}"]`);ne!==null&&(x(),ne.remove())}if($!==null){let ne=$.querySelector(`.mpi-version[data-package="${t.packageName}"]`);ne!==null&&ne.remove()}return}if($!==null&&s!==void 0){let ne=$.querySelector(`.mpi-version[data-package="${t.packageName}"]`);ne===null&&(ne=document.createElement("span"),ne.className="mpi-version",ne.dataset.package=t.packageName,$.append(ne));let J=`v${s.currentVersion}`;ne.textContent!==J&&(ne.textContent=J)}if(l!==void 0&&!l.isConnected&&x(),ge===null)return;let he=ge.querySelector(`[data-mpi-check="${t.packageName}"]`);if(he!==null){let ne=he.querySelector("[data-mpi-label]");(ne===null||ne.textContent!==Fn(document.documentElement.lang).check)&&g();return}let Ye=document.createElement("span");Ye.dataset.mpiCheck=t.packageName,Ye.className="mpi-check-host",ge.append(Ye),l=Ye,h=Bs(Ye),g()}e(N,"applyControls");let U=new MutationObserver(()=>{_===void 0&&(_=window.requestAnimationFrame(()=>{_=void 0,N()}))});U.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["lang"]});let P,B=e(async()=>P||(P=(async()=>{try{return s=await Ws(r,"GET",i.signal),N(),s}finally{P=void 0}})(),P),"load"),fe=e(()=>{N(),(!t.isEnabled||t.isEnabled())&&B().catch(()=>{})},"onToggle");return typeof window<"u"&&window.addEventListener("dsham-update-toggle",fe),N(),B().catch(()=>{}),()=>{i.abort(),U.disconnect(),w(),x(),typeof window<"u"&&window.removeEventListener("dsham-update-toggle",fe),_!==void 0&&window.cancelAnimationFrame(_),document.querySelectorAll(`[data-mpi-check="${t.packageName}"],.mpi-version[data-package="${t.packageName}"]`).forEach(le=>le.remove())}}e(qs,"observePluginUpdate");var hn=require("@deepseek-ai/dsh-client-ui-primitives");var Ue=hs,ui="@michengai/dsh-archive-manager",Sr="archived-sessions",hi=4,Vs="dsham-sidebar-entry-style",pi=`
15
15
  .dsham_mainPanel{box-sizing:border-box;height:100%;min-height:0;overflow-y:auto;display:flex;flex-direction:column;align-items:center;padding:28px clamp(24px,4vw,48px) 48px}
16
16
  .dsham_mainPanel>*{width:100%;max-width:960px}
17
17
  .dsham_bundle_row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:0.5px solid var(--dsw-alias-border-l2)}
@@ -19,15 +19,15 @@ window.__ModuleLoader__.load({
19
19
  .dsham_bundle_title{font-size:13px;font-weight:500;line-height:20px;color:var(--dsw-alias-label-primary)}
20
20
  .dsham_bundle_desc{font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary)}
21
21
  .dsham_bundle_error{font-size:12px;line-height:16px;color:var(--dsw-alias-state-error-primary,#ef4444);margin-top:2px}
22
- `;function Vs(){if(typeof document>"u"||typeof document.getElementById!="function"||document.getElementById(qs)!==null||typeof document.createElement!="function")return;let t=document.createElement("style");t.id=qs,t.textContent=pi,(document.head??document.documentElement)?.appendChild?.(t)}e(Vs,"ensureSidebarEntryStyle");function mi(t){let r=t&&typeof t.size=="number"?t.size:16;return Fe(on.IconArchiveOutlineMedium,{size:r})}e(mi,"ArchiveSidebarIcon");function yr(t){Vs();let{t:r,location:i,onLocationChange:s,errorMessage:l,enabled:u=!1,onToggle:m,disabled:C,onlineUpdateEnabled:y=!0,onToggleOnlineUpdate:_,onlineUpdateDisabled:x,onlineUpdateLocked:g=!1,sidebarFavoriteStarEnabled:w=!0,onToggleSidebarFavoriteStar:D,sidebarFavoriteStarDisabled:j}=t,U=i??(u?"both":"settings"),P=e(me=>{(me==="both"||me==="sidebar"||me==="settings")&&(typeof s=="function"?s(me):typeof m=="function"&&m(me!=="settings"))},"handleLocationChange"),B=[Fe("div",{key:"entry-location",className:"dsham_bundle_row"},Fe("div",{className:"dsham_bundle_label_box"},Fe("span",{className:"dsham_bundle_title"},r("entry.location.title")),Fe("span",{className:"dsham_bundle_desc"},r("entry.location.desc")),l?Fe("span",{className:"dsham_bundle_error",role:"alert"},l):null),Fe(on.SegmentedControl,{id:"dsham-bundle-entry-location",value:U,onChange:P,label:r("entry.location.title"),disabled:C,options:[{value:"both",label:r("entry.location.both")},{value:"sidebar",label:r("entry.location.sidebar")},{value:"settings",label:r("entry.location.settings")}]}))];if(typeof _=="function"){let me=g?`${r("update.entry.desc")} (${r("update.entry.locked")})`:r("update.entry.desc");B.push(Fe("div",{key:"online-update",className:"dsham_bundle_row"},Fe("div",{className:"dsham_bundle_label_box"},Fe("span",{className:"dsham_bundle_title"},r("update.entry.title")),Fe("span",{className:"dsham_bundle_desc"},me)),Fe(on.Switch,{checked:y,onChange:_,label:r("update.entry.toggle"),disabled:x||g,title:g?r("update.entry.locked"):void 0})))}return typeof D=="function"&&B.push(Fe("div",{key:"sidebar-favorite-star",className:"dsham_bundle_row"},Fe("div",{className:"dsham_bundle_label_box"},Fe("span",{className:"dsham_bundle_title"},r("sidebar.favoriteStar.title")),Fe("span",{className:"dsham_bundle_desc"},r("sidebar.favoriteStar.desc"))),Fe(on.Switch,{checked:w,onChange:D,label:r("sidebar.favoriteStar.toggle"),disabled:j}))),Fe(ds,null,B)}e(yr,"ArchiveBundleConfigCard");function wr(t){let[r,i]=qt(t.getLocation),[s,l]=qt(t.getOnlineUpdateEnabled?t.getOnlineUpdateEnabled:()=>!0),[u,m]=qt(t.getOnlineUpdateLocked?t.getOnlineUpdateLocked:()=>!1),[C,y]=qt(t.getSidebarFavoriteStarEnabled?t.getSidebarFavoriteStarEnabled:()=>!0),[_,x]=qt(null),[g,w]=qt(!1),[D,j]=qt(!1),[U,P]=qt(!1);hs(()=>{let V=e(()=>{i(t.getLocation()),x(null),t.getOnlineUpdateEnabled&&l(t.getOnlineUpdateEnabled()),t.getOnlineUpdateLocked&&m(t.getOnlineUpdateLocked()),t.getSidebarFavoriteStarEnabled&&y(t.getSidebarFavoriteStarEnabled())},"syncState");return V(),t.subscribe(V)},[t]);let B=e(V=>{w(!0),x(null),i(V),t.setLocation(V).catch(fe=>{console.error("archive-manager: setLocation failed:",fe),i(t.getLocation()),x(t.t("entry.location.saveFailed")||"\u4FDD\u5B58\u5165\u53E3\u8BBE\u7F6E\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u6216\u91CD\u542F\u5BBF\u4E3B\u8FDB\u7A0B")}).finally(()=>{w(!1)})},"onLocationChange"),me=t.setOnlineUpdate?V=>{t.getOnlineUpdateLocked?.()||(j(!0),l(V),t.setOnlineUpdate(V).catch(()=>{t.getOnlineUpdateEnabled&&l(t.getOnlineUpdateEnabled())}).finally(()=>{j(!1)}))}:void 0,le=t.setSidebarFavoriteStar?V=>{P(!0),y(V),t.setSidebarFavoriteStar(V).catch(()=>{t.getSidebarFavoriteStarEnabled&&y(t.getSidebarFavoriteStarEnabled())}).finally(()=>{P(!1)})}:void 0;return Fe(yr,{t:t.t,location:r,errorMessage:_,disabled:g,onLocationChange:B,onlineUpdateEnabled:s,onlineUpdateDisabled:D||u,onlineUpdateLocked:u,onToggleOnlineUpdate:me,sidebarFavoriteStarEnabled:C,sidebarFavoriteStarDisabled:U,onToggleSidebarFavoriteStar:le})}e(wr,"ArchiveBundleConfigCardWrapper");function Sr(t,r){if(Vs(),!t.locale)return{getLocation:e(()=>"settings","getLocation"),setLocation:e(async()=>"settings","setLocation"),isSettingsSectionEnabled:e(()=>!0,"isSettingsSectionEnabled"),isEnabled:e(()=>!1,"isEnabled"),isSupported:e(()=>!1,"isSupported"),setEnabled:e(async()=>!1,"setEnabled"),isOnlineUpdateEnabled:e(()=>!0,"isOnlineUpdateEnabled"),isOnlineUpdateLocked:e(()=>!1,"isOnlineUpdateLocked"),setOnlineUpdate:e(async()=>!1,"setOnlineUpdate"),isSidebarFavoriteStarEnabled:e(()=>!0,"isSidebarFavoriteStarEnabled"),setSidebarFavoriteStar:e(async()=>!1,"setSidebarFavoriteStar"),destroy:e(()=>{},"destroy")};let{callApi:i,renderPanel:s,ns:l}=r,u="settings",m=!1,C=!1,y=null,_=null,x=0,g=!1,w,D=new Set,j=e(()=>u==="both"||u==="sidebar","isSidebarEnabled"),U=e(()=>u==="both"||u==="settings","isSettingsSectionEnabled"),P=e(()=>{if(!g)for(let F of D)try{F()}catch{}},"notify"),B=e(()=>{if(g||!C||!j()||y)return;let F=t.slots.register({name:"main",key:br,locale:l,inject:e(()=>{let De=typeof r.injectProps=="function"?r.injectProps():{};return Object.assign({t:t.locale?.bind?t.locale.bind(l):void 0},De)},"inject")},De=>Fe("div",{className:"dsham_mainPanel"},s(De)));y=typeof F=="function"?F:()=>{}},"mountMain"),me=e(()=>{if(y){try{y()}catch{}y=null}},"unmountMain"),le=e(()=>{if(g||!m||!j()||_)return;let F=t.slots.register({name:"sidebar.panellist",id:br,order:hi,label:e(()=>t.locale.bind(l)("archives.title"),"label"),locale:l},De=>mi(De&&typeof De=="object"&&"size"in De?De:void 0));_=typeof F=="function"?F:()=>{}},"mountRow"),V=e(()=>{if(_){try{_()}catch{}_=null}},"unmountRow"),fe=e(()=>{if(!g)if(j())B(),le();else{if(w?.panelInfo&&typeof w.selectPanel=="function")try{w.panelInfo.getSnapshot().activePanelId===br&&w.selectPanel(null)}catch{}V(),me()}},"sync"),ue=e(async F=>{if(g)return u;let De=++x,T=u;if(u=F,fe(),P(),typeof r.onLocationChange=="function")try{r.onLocationChange(F)}catch{}try{return await i("/sidebar-entry",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({location:F})}),F}catch(he){if(De===x&&(u=T,fe(),P(),typeof r.onLocationChange=="function"))try{r.onLocationChange(T)}catch{}throw he}},"setLocation"),Qe=e(async F=>(await ue(F?"both":"settings"),j()),"setEnabled"),re=!0,X=!1,yt=0,St=e(async F=>{if(g||X)return re;let De=++yt;if(re=F,P(),typeof r.onOnlineUpdateChange=="function")try{r.onOnlineUpdateChange(F)}catch{}try{if(await i("/online-update",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:F})}),De===yt&&typeof r.onOnlineUpdateChange=="function")try{r.onOnlineUpdateChange(F)}catch{}return F}catch(T){if(De===yt&&(re=!F,P(),typeof r.onOnlineUpdateChange=="function"))try{r.onOnlineUpdateChange(!F)}catch{}throw T}},"setOnlineUpdate"),et=!0,dt=0,xt=e(async F=>{if(g)return et;let De=++dt;if(et=F,P(),typeof r.onSidebarFavoriteStarChange=="function")try{r.onSidebarFavoriteStarChange(F)}catch{}try{return await i("/sidebar-favorite-star",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:F})}),F}catch(T){if(De===dt&&(et=!F,P(),typeof r.onSidebarFavoriteStarChange=="function"))try{r.onSidebarFavoriteStarChange(!F)}catch{}throw T}},"setSidebarFavoriteStar"),$e=x;i("/sidebar-entry").then(F=>{if(!g&&x===$e&&F&&(F.location==="both"||F.location==="sidebar"||F.location==="settings"?u=F.location:typeof F.enabled=="boolean"&&(u=F.enabled?"both":"settings"),fe(),P(),typeof r.onLocationChange=="function"))try{r.onLocationChange(u)}catch{}}).catch(()=>{});let en=yt;i("/online-update").then(F=>{if(!g&&yt===en&&F&&typeof F.enabled=="boolean"&&(re=F.enabled,F.locked===!0&&(X=!0),P(),typeof r.onOnlineUpdateChange=="function"))try{r.onOnlineUpdateChange(re)}catch{}}).catch(()=>{});let tt=dt;i("/sidebar-favorite-star").then(F=>{if(!g&&dt===tt&&F&&typeof F.enabled=="boolean"&&(et=F.enabled,P(),typeof r.onSidebarFavoriteStarChange=="function"))try{r.onSidebarFavoriteStarChange(et)}catch{}}).catch(()=>{});let tn=t;return typeof tn.inject=="function"&&tn.inject(["layout"],F=>{!g&&F.layout&&(w=F.layout)}),t.slots.inject("main",()=>{if(!g)return C=!0,B(),()=>{C=!1,me()}}),t.slots.inject("sidebar.panellist",()=>{if(!g)return m=!0,le(),()=>{m=!1,V()}}),t.slots.inject("plugins.bundle.config",()=>{if(!g)return t.slots.register({name:"plugins.bundle.config",key:ui,locale:l},F=>F&&F.view==="summary"?null:Fe(wr,{t:t.locale.bind(l),getLocation:e(()=>u,"getLocation"),setLocation:ue,getEnabled:e(()=>j(),"getEnabled"),setSidebar:Qe,getOnlineUpdateEnabled:e(()=>re,"getOnlineUpdateEnabled"),setOnlineUpdate:St,getOnlineUpdateLocked:e(()=>X,"getOnlineUpdateLocked"),getSidebarFavoriteStarEnabled:e(()=>et,"getSidebarFavoriteStarEnabled"),setSidebarFavoriteStar:xt,subscribe:e(De=>(D.add(De),()=>{D.delete(De)}),"subscribe")}))}),{getLocation:e(()=>u,"getLocation"),setLocation:ue,isSettingsSectionEnabled:U,isEnabled:e(()=>j(),"isEnabled"),isSupported:e(()=>m,"isSupported"),setEnabled:Qe,isOnlineUpdateEnabled:e(()=>re,"isOnlineUpdateEnabled"),isOnlineUpdateLocked:e(()=>X,"isOnlineUpdateLocked"),setOnlineUpdate:St,isSidebarFavoriteStarEnabled:e(()=>et,"isSidebarFavoriteStarEnabled"),setSidebarFavoriteStar:xt,destroy:e(()=>{g||(g=!0,x++,yt++,dt++,w=void 0,D.clear(),V(),me())},"destroy")}}e(Sr,"setupSidebarEntry");function xr(t){if(typeof t!="string"||t.length===0||t.length>1024)throw new TypeError("\u4F1A\u8BDD ID \u957F\u5EA6\u987B\u4E3A 1\uFF5E1024 \u4E2A\u5B57\u7B26");return t}e(xr,"checkedId");var fi={parse(t){let r=ce(t);if(!r||typeof r!="object"||typeof r.favorite!="boolean")throw new TypeError("\u6536\u85CF\u72B6\u6001\u5FC5\u987B\u4E3A\u5E03\u5C14\u503C");return{sessionId:xr(r.sessionId),favorite:r.favorite}}},gi={parse(t){let r=ce(t);if(!r||!Array.isArray(r.favoriteSessionIds)||r.favoriteSessionIds.length>1e5)throw new TypeError("\u6536\u85CF\u96C6\u5408\u65E0\u6548");return{favoriteSessionIds:[...new Set(r.favoriteSessionIds.map(xr))]}},safeParse(t){try{return{success:!0,data:this.parse(t)}}catch(r){return{success:!1,error:r}}}};function $s(){let t=e((r,i)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${r}`,create:e(()=>i,"create"),schema:i}),"codec");return["favoriteSessions","setSessionFavorite"].map(r=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${r}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:r,invocation:{kind:"direct"},parameters:r==="favoriteSessions"?[]:[{name:"input",wire:"input",source:"json",codec:t("FavoriteInput",fi)}],result:t("FavoriteState",gi),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}e($s,"favoriteInvocations");function kr(t,{days:r,now:i=Date.now(),favorites:s=new Set,currentId:l,pending:u=new Map}){if(!t||!Number.isInteger(r)||r<1||r>36500||s.has(t.id)||t.id===l||(t.retainedBy?.mainView??0)>0||t.running||(t.runningSubagentCount??0)>0||t.pendingInteraction!=null||u.has(t.id))return!1;let m=typeof t.updatedAt=="number"?t.updatedAt:Date.parse(t.updatedAt??"");return Number.isFinite(m)&&m<=i-r*864e5}e(kr,"idleArchiveCandidate");async function Jn(t,r,{onProgress:i,refresh:s}={}){let l=[...new Set(t.map(xr))],u={requested:l,succeeded:[],skipped:[],failures:[],remaining:[],refreshError:null},m=e(()=>i?.({total:l.length,done:u.succeeded.length+u.skipped.length+u.failures.length,succeeded:u.succeeded.length,skipped:u.skipped.length,failed:u.failures.length}),"report");m();for(let C of l){try{(await r(C)?u.succeeded:u.skipped).push(C)}catch(y){u.failures.push({sessionId:C,message:y instanceof Error?y.message:String(y)}),u.remaining.push(C)}m()}try{await s?.()}catch(C){u.refreshError=C instanceof Error?C.message:String(C)}return u}e(Jn,"runSessionBatch");function Gs({workspaces:t,sessions:r,archive:i,restore:s,deleteOne:l,getFavorites:u,refresh:m,currentSessionId:C}){return async(y,_,x={})=>{if(!["archive","restore","undo","delete"].includes(y))throw new TypeError("\u672A\u77E5\u6279\u91CF\u64CD\u4F5C");return Jn(_,async g=>{let D=t.getSnapshot().archivedSessionIds.includes(g);if(y==="archive"){if(D||!r.getSnapshot().byId[g])return!1;if(x.idleDays!==void 0){let me=new Set((await u()).favoriteSessionIds),le=r.getSnapshot();if(!kr(le.byId[g],{days:x.idleDays,favorites:me,currentId:C(le),pending:x.getPending?.()??x.pending}))return!1}return await i(g),t.getSnapshot().archivedSessionIds.includes(g)}return D?y==="delete"?(await l(g),!0):!((await s(g))?.archivedSessionIds??t.getSnapshot().archivedSessionIds).includes(g):!1},{onProgress:x.onProgress,refresh:m})}}e(Gs,"createSessionOrganizer");function vi(t){return!t||t<=0?"0 B":t<1024?t+" B":t<1024*1024?(t/1024).toFixed(1)+" KB":(t/(1024*1024)).toFixed(1)+" MB"}e(vi,"formatBytes");function Ks(t,r){let i=t.createElement;function s(u,m){return i(r??(y=>i("button",{type:"button",disabled:y.disabled,onClick:y.onClick},y.children)),{variant:"outline",size:"sm",...m},u)}e(s,"textButton");function l({title:u,failures:m,separator:C}){let[y,_]=t.useState(!1),x=i("ul",null,m.map(g=>i("li",{key:g.sessionId},g.sessionId,C,g.message)));return i(Gn,{title:u,open:y,onToggle:e(()=>_(g=>!g),"onToggle")},x)}return e(l,"FailureDetails"),e(function({t:m,archived:C,busy:y,ready:_,days:x,onDays:g,count:w,onPreview:D,progress:j,result:U,onRetry:P,undoCount:B,onUndo:me,onReload:le,orphanCount:V=0,orphanSizeBytes:fe=0,orphanCleaning:ue=!1,onCleanOrphans:Qe,cacheCount:re=0,cacheRepair:X,onRebuildCaches:yt,onRetryCaches:St,onReloadCaches:et,onDismissCaches:dt}){return i(t.Fragment,null,i("style",null,".dsham_organizer,.dsham_batchFeedback{display:grid;gap:12px;margin:0 0 16px;padding:14px 16px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2)}.dsham_organizerControls{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.dsham_organizer label{display:inline-flex;align-items:center;gap:8px;font-size:13px;color:var(--dsw-alias-label-primary)}.dsham_number{width:88px;height:32px;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px}.dsham_number:hover{border-color:var(--dsw-alias-border-l3)}.dsham_number:focus{outline:none;border-color:var(--dsw-alias-state-business-primary)}.dsham_disclosure{display:inline-flex;align-items:center;gap:6px;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;cursor:pointer}.dsham_foldChevron{transition:transform 150ms ease}.dsham_foldChevron.is-open{transform:rotate(180deg)}.dsham_organizer p,.dsham_batchFeedback p{margin:0;font-size:12px;color:var(--dsw-alias-label-secondary)}.dsham_batchFeedback progress{width:100%}.dsham_batchFeedback details{font-size:12px;overflow-wrap:anywhere}.dsham_archivePreview{max-height:260px;overflow:auto;display:grid;gap:8px;padding:8px 0}.dsham_archivePreview label{display:flex;gap:8px;align-items:center;overflow-wrap:anywhere}"),(!C||!_)&&i("div",{className:"dsham_organizer"},i("div",{className:"dsham_organizerControls"},!_&&s(m("organizer.reloadFavorites"),{disabled:y,onClick:le}),!C&&i(t.Fragment,null,i("label",null,m("organizer.idleDays"),i(ms,{min:1,max:36500,value:x===""?null:Number(x),disabled:y,"aria-label":m("organizer.idleDays"),onChange:e(xt=>g(xt==null?"":String(xt)),"onChange")})),s(m("organizer.preview",{n:w}),{disabled:y||!_||w===0,onClick:D}))),!C&&i("p",null,m("organizer.rules"))),V>0&&i("div",{className:"dsham_organizer"},i("div",{className:"dsham_organizerControls"},i("strong",null,m("organizer.orphanTitle",{n:V})),Qe&&s(m(ue?"organizer.cleaning":"organizer.cleanOrphans"),{disabled:y||ue,onClick:Qe})),i("p",null,m("organizer.orphanDesc",{size:vi(fe)}))),re>0&&i("div",{className:"dsham_organizer"},i("div",{className:"dsham_organizerControls"},i("strong",null,m("organizer.cacheTitle",{n:re})),yt&&s(m(X?.busy?"organizer.cacheRebuilding":"organizer.cacheRebuild"),{disabled:y||X?.busy,onClick:yt})),i("p",null,m("organizer.cacheDesc"))),X&&(X.result||X.progress||X.error||X.refreshError)&&i("section",{className:"dsham_batchFeedback","aria-label":m("organizer.cacheRebuild")},X.progress&&i("div",{role:"status"},i("progress",{value:X.progress.done,max:Math.max(1,X.progress.total)}),m("organizer.progressCount",X.progress)),X.result&&i("div",{role:"status"},i("p",null,m("organizer.result",{succeeded:X.result.rebuiltSessionIds.length,skipped:X.result.skippedSessionIds.length,failed:X.result.failures.length})),X.result.failures.length>0&&i(l,{title:m("organizer.failureDetails"),failures:X.result.failures,separator:m("common.separator")}),X.result.failures.length>0&&St&&s(m("organizer.cacheRetry",{n:X.result.failures.length}),{disabled:y||X.busy,onClick:St})),X.error&&i("p",{role:"alert"},m("organizer.cacheError",{detail:X.error})),X.refreshError&&i("p",{role:"alert"},m("organizer.refreshError",{detail:X.refreshError})),i("div",{className:"dsham_organizerControls"},et&&s(m("organizer.cacheCheck"),{disabled:y||X.busy,onClick:et}),dt&&s(m("organizer.dismiss"),{disabled:y||X.busy,onClick:dt}))),(j||U||B>0)&&i("section",{className:"dsham_batchFeedback","aria-label":m("organizer.feedback")},j&&i("div",{role:"status","aria-live":"polite"},i("progress",{value:j.done,max:Math.max(1,j.total),"aria-label":m("organizer.progress")}),m("organizer.progressCount",{done:j.done,total:j.total})),U&&i("div",{role:"status"},i("strong",null,m(`organizer.${U.kind??"archive"}Result`)),i("p",null,m("organizer.result",{succeeded:U.succeeded.length,skipped:U.skipped.length,failed:U.failures.length})),U.failures.length>0&&i(l,{title:m("organizer.failureDetails"),failures:U.failures,separator:m("common.separator")}),U.refreshError&&i("p",{role:"alert"},m("organizer.refreshError",{detail:U.refreshError})),U.remaining.length>0&&s(m("organizer.retry",{n:U.remaining.length}),{disabled:y,onClick:P})),B>0&&i("div",{className:"dsham_organizerControls"},s(m("organizer.undo",{n:B}),{disabled:y,onClick:me}),i("p",null,m("organizer.undoHint")))))},"OrganizerPanel")}e(Ks,"createOrganizerPanel");var Ys={"organizer.cacheTitle":"\u53D1\u73B0 {n} \u4E2A\u4F1A\u8BDD\u7F3A\u5C11\u53EF\u7528\u5217\u8868\u7F13\u5B58","organizer.cacheDesc":"\u68C0\u67E5\u5DE5\u4F5C\u533A\u3001\u672A\u5206\u7EC4\u53CA\u5F52\u6863\u666E\u901A\u4F1A\u8BDD\u7684\u5934\u90E8\u4E0E\u5B98\u65B9\u7F13\u5B58\u3002\u70B9\u51FB\u540E\u9010\u6761\u53EA\u8BFB\u65E5\u5FD7\u5E76\u91CD\u5EFA\u5B98\u65B9\u5217\u8868\u7F13\u5B58\uFF1B\u8DF3\u8FC7\u6D3B\u52A8\u4F1A\u8BDD\uFF0C\u4E0D\u6253\u5F00\u4F1A\u8BDD\u3001\u4E0D\u8C03\u7528\u6A21\u578B\uFF0C\u4E5F\u4E0D\u6539\u53D8\u5F52\u6863\u6216\u5B9A\u65F6\u4EFB\u52A1\u3002\u8D85\u65F6\u8868\u793A\u4FDD\u5B58\u672A\u786E\u8BA4\uFF0C\u53EF\u91CD\u8BD5\u3002","organizer.cacheRebuild":"\u91CD\u5EFA\u5217\u8868\u7F13\u5B58","organizer.cacheRebuilding":"\u91CD\u5EFA\u4E2D\u2026","organizer.cacheRetry":"\u91CD\u8BD5\u5931\u8D25 {n} \u6761","organizer.cacheCheck":"\u5237\u65B0\u5217\u8868\u5E76\u91CD\u65B0\u68C0\u6D4B","organizer.cacheError":"\u7F13\u5B58\u68C0\u6D4B\u5931\u8D25\uFF1A{detail}","organizer.dismiss":"\u5B8C\u6210","organizer.feedback":"\u64CD\u4F5C\u53CD\u9988","organizer.allSessions":"\u5168\u90E8\u4F1A\u8BDD","organizer.favoriteFilter":"\u6536\u85CF\u7B5B\u9009","organizer.archiveResult":"\u5F52\u6863\u7ED3\u679C","organizer.restoreResult":"\u6062\u590D\u7ED3\u679C","organizer.deleteResult":"\u5220\u9664\u7ED3\u679C","organizer.undoResult":"\u64A4\u56DE\u7ED3\u679C","organizer.favorite":"\u6536\u85CF","organizer.unfavorite":"\u53D6\u6D88\u6536\u85CF","organizer.favoritesOnly":"\u53EA\u770B\u6536\u85CF","organizer.reloadFavorites":"\u91CD\u65B0\u52A0\u8F7D\u6536\u85CF","organizer.idleDays":"\u95F2\u7F6E\u5929\u6570","organizer.preview":"\u9884\u89C8\u95F2\u7F6E\u5F52\u6863\uFF08{n}\uFF09","organizer.rules":"\u6309\u6700\u540E\u6D3B\u52A8\u65F6\u95F4\u7B5B\u9009\uFF0C\u9075\u5FAA\u5F53\u524D\u5217\u8868\u7B5B\u9009\u6761\u4EF6\uFF1B\u6392\u9664\u6536\u85CF\u3001\u5F53\u524D\u6253\u5F00\u3001\u6B63\u5728\u6267\u884C\u53CA\u7B49\u5F85\u4EA4\u4E92\u7684\u4F1A\u8BDD\u3002","organizer.progress":"\u6279\u91CF\u64CD\u4F5C\u8FDB\u5EA6","organizer.progressCount":"\u5DF2\u5904\u7406 {done} / {total}","organizer.result":"\u6210\u529F {succeeded} \xB7 \u8DF3\u8FC7 {skipped} \xB7 \u5931\u8D25 {failed}","organizer.failureDetails":"\u67E5\u770B\u5931\u8D25\u8BE6\u60C5","organizer.refreshError":"\u64CD\u4F5C\u7ED3\u679C\u5DF2\u4FDD\u7559\uFF0C\u4F46\u5217\u8868\u5237\u65B0\u5931\u8D25\uFF1A{detail}","organizer.retry":"\u91CD\u8BD5\u5269\u4F59 {n} \u6761","organizer.undo":"\u64A4\u56DE\u672C\u6B21\u5F52\u6863\uFF08{n}\uFF09","organizer.undoHint":"\u4EC5\u4FDD\u7559\u672C\u6B21\u6253\u5F00\u7BA1\u7406\u9875\u671F\u95F4\u6700\u8FD1\u4E00\u6279\u5F52\u6863\uFF1B\u5173\u95ED\u9875\u9762\u6216\u5237\u65B0\u540E\u6E05\u9664\u3002\u64A4\u56DE\u4E0D\u4F1A\u6062\u590D\u5DF2\u5220\u9664\u7684\u4F1A\u8BDD\u3002","organizer.idleConfirm":"\u8BF7\u68C0\u67E5\u4EE5\u4E0B\u5019\u9009\uFF0C\u53EF\u53D6\u6D88\u52FE\u9009\uFF1B\u6267\u884C\u524D\u518D\u6B21\u6392\u9664\u6536\u85CF\u53CA\u6D3B\u8DC3\u4F1A\u8BDD\u3002","organizer.manualConfirm":"\u4EC5\u5F52\u6863\u4EE5\u4E0B\u52FE\u9009\u4F1A\u8BDD\uFF1B\u53EF\u9010\u6761\u53D6\u6D88\u3002\u5F52\u6863\u540E\u53EF\u64A4\u56DE\u672C\u6279\u64CD\u4F5C\u3002","organizer.orphanTitle":"\u53D1\u73B0 {n} \u4E2A\u65E0\u4E3B\u5B64\u513F\u5B50\u4EE3\u7406","organizer.orphanDesc":"\u6BCD\u4F1A\u8BDD\u5DF2\u88AB\u5916\u90E8\u5220\u9664\uFF0C\u8FD9\u4E9B\u5B50\u4EE3\u7406\u5728\u65E5\u5E38\u804A\u5929\u5217\u8868\u4E2D\u4E0D\u53EF\u89C1\uFF0C\u5171\u5360\u7528\u7EA6 {size} \u78C1\u76D8\u7A7A\u95F4\u3002\u6E05\u7406\u4E0D\u53EF\u64A4\u9500\u3002","organizer.cleanOrphans":"\u6E05\u7406\u5168\u90E8\u5B64\u513F","organizer.cleaning":"\u6E05\u7406\u4E2D\u2026","organizer.orphanCleanSuccess":"\u5DF2\u6210\u529F\u6E05\u7406 {n} \u4E2A\u65E0\u4E3B\u5B50\u4EE3\u7406\u4F1A\u8BDD\u3002"},Zs={"organizer.cacheTitle":"Found {n} sessions without usable list caches","organizer.cacheDesc":"Checks headers and official caches for workspace, ungrouped, and archived ordinary sessions. On click, reads logs one at a time and rebuilds official caches. Skips active sessions; never opens sessions, calls models or changes archives or schedules. Timeout means persistence is unconfirmed and can be retried.","organizer.cacheRebuild":"Rebuild list caches","organizer.cacheRebuilding":"Rebuilding\u2026","organizer.cacheRetry":"Retry {n} failed","organizer.cacheCheck":"Refresh lists and check again","organizer.cacheError":"Cache check failed: {detail}","organizer.dismiss":"Done","organizer.feedback":"Operation feedback","organizer.allSessions":"All sessions","organizer.favoriteFilter":"Favorites filter","organizer.archiveResult":"Archive results","organizer.restoreResult":"Restore results","organizer.deleteResult":"Delete results","organizer.undoResult":"Undo results","organizer.favorite":"Favorite","organizer.unfavorite":"Unfavorite","organizer.favoritesOnly":"Favorites only","organizer.reloadFavorites":"Reload favorites","organizer.idleDays":"Idle days","organizer.preview":"Preview idle archives ({n})","organizer.rules":"Uses last activity, the current list filters. Excludes favorites, open, running and waiting sessions.","organizer.progress":"Batch progress","organizer.progressCount":"Processed {done} / {total}","organizer.result":"Succeeded {succeeded} \xB7 Skipped {skipped} \xB7 Failed {failed}","organizer.failureDetails":"Failure details","organizer.refreshError":"Results retained, but refresh failed: {detail}","organizer.retry":"Retry remaining {n}","organizer.undo":"Undo this archive batch ({n})","organizer.undoHint":"Only the latest archive batch while this page is open is retained. Closing or refreshing clears undo. Deleted sessions cannot be restored.","organizer.idleConfirm":"Review and deselect candidates. Favorites and active sessions are checked again before archiving.","organizer.manualConfirm":"Only checked sessions below will be archived. You can undo this batch afterward.","organizer.orphanTitle":"Found {n} orphan subagents","organizer.orphanDesc":"Parent sessions were deleted externally. These subagents are hidden from normal chat lists and occupy ~{size} disk space. Removal cannot be undone.","organizer.cleanOrphans":"Clean up all orphans","organizer.cleaning":"Cleaning up\u2026","organizer.orphanCleanSuccess":"Successfully cleaned up {n} orphan subagent sessions."},Js={"organizer.cacheTitle":"\u041D\u0430\u0439\u0434\u0435\u043D\u043E {n} \u0441\u0435\u0441\u0441\u0438\u0439 \u0431\u0435\u0437 \u043F\u0440\u0438\u0433\u043E\u0434\u043D\u043E\u0433\u043E \u043A\u0435\u0448\u0430 \u0441\u043F\u0438\u0441\u043A\u0430","organizer.cacheDesc":"\u041F\u0440\u043E\u0432\u0435\u0440\u044F\u044E\u0442\u0441\u044F \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0438 \u0438 \u043E\u0444\u0438\u0446\u0438\u0430\u043B\u044C\u043D\u044B\u0439 \u043A\u0435\u0448 \u0441\u0435\u0441\u0441\u0438\u0439 \u0440\u0430\u0431\u043E\u0447\u0438\u0445 \u043E\u0431\u043B\u0430\u0441\u0442\u0435\u0439, \u0431\u0435\u0437 \u0433\u0440\u0443\u043F\u043F\u044B \u0438 \u0430\u0440\u0445\u0438\u0432\u0430. \u041F\u043E \u043D\u0430\u0436\u0430\u0442\u0438\u044E \u0436\u0443\u0440\u043D\u0430\u043B\u044B \u0447\u0438\u0442\u0430\u044E\u0442\u0441\u044F \u043F\u043E \u043E\u0434\u043D\u043E\u043C\u0443 \u0434\u043B\u044F \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F \u043E\u0444\u0438\u0446\u0438\u0430\u043B\u044C\u043D\u043E\u0433\u043E \u043A\u0435\u0448\u0430. \u0410\u043A\u0442\u0438\u0432\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u043F\u0440\u043E\u043F\u0443\u0441\u043A\u0430\u044E\u0442\u0441\u044F; \u0441\u0435\u0441\u0441\u0438\u0438 \u043D\u0435 \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u044E\u0442\u0441\u044F, \u043C\u043E\u0434\u0435\u043B\u0438 \u043D\u0435 \u0432\u044B\u0437\u044B\u0432\u0430\u044E\u0442\u0441\u044F, \u0430\u0440\u0445\u0438\u0432\u044B \u0438 \u0440\u0430\u0441\u043F\u0438\u0441\u0430\u043D\u0438\u044F \u043D\u0435 \u043C\u0435\u043D\u044F\u044E\u0442\u0441\u044F. \u0422\u0430\u0439\u043C-\u0430\u0443\u0442 \u043E\u0437\u043D\u0430\u0447\u0430\u0435\u0442 \u043D\u0435\u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0451\u043D\u043D\u043E\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0435; \u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u043F\u043E\u0432\u0442\u043E\u0440.","organizer.cacheRebuild":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u043A\u0435\u0448 \u0441\u043F\u0438\u0441\u043A\u043E\u0432","organizer.cacheRebuilding":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435\u2026","organizer.cacheRetry":"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C {n} \u043E\u0448\u0438\u0431\u043E\u043A","organizer.cacheCheck":"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u043F\u0438\u0441\u043A\u0438 \u0438 \u043F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C","organizer.cacheError":"\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0438 \u043A\u0435\u0448\u0430: {detail}","organizer.dismiss":"\u0413\u043E\u0442\u043E\u0432\u043E","organizer.feedback":"\u041E\u0442\u0437\u044B\u0432 \u043E\u0431 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438","organizer.allSessions":"\u0412\u0441\u0435 \u0441\u0435\u0441\u0441\u0438\u0438","organizer.favoriteFilter":"\u0424\u0438\u043B\u044C\u0442\u0440 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E","organizer.archiveResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438","organizer.restoreResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F","organizer.deleteResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0443\u0434\u0430\u043B\u0435\u043D\u0438\u044F","organizer.undoResult":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u043E\u0442\u043C\u0435\u043D\u044B","organizer.favorite":"\u0412 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435","organizer.unfavorite":"\u0423\u0431\u0440\u0430\u0442\u044C \u0438\u0437 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E","organizer.favoritesOnly":"\u0422\u043E\u043B\u044C\u043A\u043E \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435","organizer.reloadFavorites":"\u041F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435","organizer.idleDays":"\u0414\u043D\u0438 \u043F\u0440\u043E\u0441\u0442\u043E\u044F","organizer.preview":"\u041F\u0440\u0435\u0434\u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0430\u0440\u0445\u0438\u0432\u0430 \u043F\u0440\u043E\u0441\u0442\u043E\u044F ({n})","organizer.rules":"\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u044E\u044E \u0430\u043A\u0442\u0438\u0432\u043D\u043E\u0441\u0442\u044C \u0438 \u0442\u0435\u043A\u0443\u0449\u0438\u0435 \u0444\u0438\u043B\u044C\u0442\u0440\u044B \u0441\u043F\u0438\u0441\u043A\u0430. \u0418\u0441\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435, \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u0435, \u0437\u0430\u043F\u0443\u0449\u0435\u043D\u043D\u044B\u0435 \u0438 \u043E\u0436\u0438\u0434\u0430\u044E\u0449\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438.","organizer.progress":"\u0425\u043E\u0434 \u043F\u0430\u043A\u0435\u0442\u043D\u043E\u0439 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438","organizer.progressCount":"\u041E\u0431\u0440\u0430\u0431\u043E\u0442\u0430\u043D\u043E {done} / {total}","organizer.result":"\u0423\u0441\u043F\u0435\u0448\u043D\u043E {succeeded} \xB7 \u041F\u0440\u043E\u043F\u0443\u0449\u0435\u043D\u043E {skipped} \xB7 \u041E\u0448\u0438\u0431\u043E\u043A {failed}","organizer.failureDetails":"\u041F\u043E\u0434\u0440\u043E\u0431\u043D\u043E\u0441\u0442\u0438 \u043E\u0448\u0438\u0431\u043E\u043A","organizer.refreshError":"\u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u044B, \u043D\u043E \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u043F\u0438\u0441\u043A\u0430 \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C: {detail}","organizer.retry":"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C \u043E\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044F {n}","organizer.undo":"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u044D\u0442\u0443 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044E ({n})","organizer.undoHint":"\u0421\u043E\u0445\u0440\u0430\u043D\u044F\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u044F\u044F \u043F\u0430\u043A\u0435\u0442\u043D\u0430\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F, \u043F\u043E\u043A\u0430 \u043E\u0442\u043A\u0440\u044B\u0442\u0430 \u044D\u0442\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430. \u0417\u0430\u043A\u0440\u044B\u0442\u0438\u0435 \u0438\u043B\u0438 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u0431\u0440\u0430\u0441\u044B\u0432\u0430\u0435\u0442 \u043E\u0442\u043C\u0435\u043D\u0443. \u0423\u0434\u0430\u043B\u0451\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u043D\u0435\u043B\u044C\u0437\u044F.","organizer.idleConfirm":"\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u043A\u0430\u043D\u0434\u0438\u0434\u0430\u0442\u043E\u0432, \u043C\u043E\u0436\u043D\u043E \u0441\u043D\u044F\u0442\u044C \u043E\u0442\u043C\u0435\u0442\u043A\u0443. \u041F\u0435\u0440\u0435\u0434 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0435\u0439 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0435 \u0438 \u0430\u043A\u0442\u0438\u0432\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u043F\u0440\u043E\u0432\u0435\u0440\u044F\u044E\u0442\u0441\u044F \u043F\u043E\u0432\u0442\u043E\u0440\u043D\u043E.","organizer.manualConfirm":"\u0411\u0443\u0434\u0443\u0442 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u044B \u0442\u043E\u043B\u044C\u043A\u043E \u043E\u0442\u043C\u0435\u0447\u0435\u043D\u043D\u044B\u0435 \u043D\u0438\u0436\u0435 \u0441\u0435\u0441\u0441\u0438\u0438. \u042D\u0442\u0443 \u043F\u0430\u043A\u0435\u0442\u043D\u0443\u044E \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u044E \u043C\u043E\u0436\u043D\u043E \u043E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u043F\u043E\u0437\u0436\u0435.","organizer.orphanTitle":"\u041D\u0430\u0439\u0434\u0435\u043D\u043E {n} \u043E\u0441\u0438\u0440\u043E\u0442\u0435\u0432\u0448\u0438\u0445 \u043F\u043E\u0434\u0430\u0433\u0435\u043D\u0442\u043E\u0432","organizer.orphanDesc":"\u0420\u043E\u0434\u0438\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 \u0431\u044B\u043B\u0438 \u0443\u0434\u0430\u043B\u0435\u043D\u044B \u0438\u0437\u0432\u043D\u0435. \u041F\u043E\u0434\u0430\u0433\u0435\u043D\u0442\u044B \u0441\u043A\u0440\u044B\u0442\u044B \u0438\u0437 \u043E\u0431\u044B\u0447\u043D\u044B\u0445 \u0441\u043F\u0438\u0441\u043A\u043E\u0432 \u0447\u0430\u0442\u043E\u0432 \u0438 \u0437\u0430\u043D\u0438\u043C\u0430\u044E\u0442 ~{size} \u0434\u0438\u0441\u043A\u043E\u0432\u043E\u0433\u043E \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u0430. \u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","organizer.cleanOrphans":"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0432\u0441\u0435\u0445 \u0441\u0438\u0440\u043E\u0442","organizer.cleaning":"\u041E\u0447\u0438\u0441\u0442\u043A\u0430\u2026","organizer.orphanCleanSuccess":"\u0423\u0441\u043F\u0435\u0448\u043D\u043E \u043E\u0447\u0438\u0449\u0435\u043D\u043E {n} \u043E\u0441\u0438\u0440\u043E\u0442\u0435\u0432\u0448\u0438\u0445 \u043F\u043E\u0434\u0430\u0433\u0435\u043D\u0442\u043E\u0432."};var gn=Function("return globalThis.__dshArchiveReactDOM")(),Xs=Function("return globalThis.__dshArchiveReactDOMClient")(),Qs=gn.createPortal,Fo=gn.flushSync,Ho=Xs?.createRoot,Bo=Xs?.hydrateRoot,Uo=gn.findDOMNode,Wo=gn.unmountComponentAtNode,qo=gn.unstable_batchedUpdates,Vo=gn.version;function bi(t){var r={exports:{}},i=r.exports;Object.defineProperty(i,Symbol.toStringTag,{value:"Module"});let s=t("react/jsx-runtime"),l=t("react"),u=t("@deepseek-ai/dsh-client-ui-primitives");function m(n){try{return typeof n("contextMenus")?.register=="function"}catch{return!1}}e(m,"hasNativeContextMenuService");function C(){let n=u;return!!(n?.MenuSurface&&n?.MenuItemButton)}e(C,"hasMoveMenuPrimitives");function y(n,a){return n.filter(o=>!o.sessionIds?.includes(a))}e(y,"movableWorkspaces");function _({open:n,onClose:a,title:o,description:h,footer:v,children:f,className:k,width:E,portalToBody:N=!1,closeLabel:H,t:A}){let z=l.useRef(null),O=l.useCallback(()=>z.current?.closest(".dsham_settings")??document.body,[]),[d,oe]=l.useState(null);l.useEffect(()=>{if(!n){oe(null);return}oe(N?typeof document<"u"?document.body:null:O())},[n,O,N]),l.useEffect(()=>{if(!n)return;let kt=e(ut=>{ut.key==="Escape"&&(ut.preventDefault(),ut.stopPropagation(),"stopImmediatePropagation"in ut&&typeof ut.stopImmediatePropagation=="function"&&ut.stopImmediatePropagation(),a())},"onKey");return window.addEventListener("keydown",kt,!0),()=>window.removeEventListener("keydown",kt,!0)},[n,a]);let Re=H||A("common.close"),pe=(0,s.jsxs)("div",{className:"dsham_modalRoot",role:"presentation",children:[(0,s.jsx)("div",{className:"dsham_modalMask",onClick:a}),(0,s.jsxs)("div",{role:"dialog","aria-modal":!0,"aria-label":typeof o=="string"?o:void 0,className:aa("dsham_modalDialog",k),style:{width:E??560},children:[(0,s.jsxs)("div",{className:"dsham_modalHeader",children:[(0,s.jsx)("h2",{title:typeof o=="string"?o:void 0,children:o}),(0,s.jsx)("button",{type:"button",className:"dsham_modalClose",onClick:a,"aria-label":Re,title:Re,children:(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:14,height:14,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round","aria-hidden":"true",children:(0,s.jsx)("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]}),h!=null&&(0,s.jsx)("p",{children:h}),f!=null&&(0,s.jsx)("div",{className:"dsham_modalBody",children:f}),v!=null&&(0,s.jsx)("div",{className:"dsham_modalFooter",children:v})]})]});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(x,{refObject:z,getContainer:O}),n&&d?Qs(pe,d):null]})}e(_,"SettingsModal");function x({refObject:n,getContainer:a}){return(0,s.jsx)("span",{hidden:!0,ref:n,"data-get-container":a})}e(x,"SettingsModalAnchor");function g({variant:n="outline",icon:a,children:o,className:h,disabled:v,title:f,onClick:k,"aria-label":E,"aria-pressed":N,"aria-expanded":H,"aria-haspopup":A}){return(0,s.jsx)(u.Button,{variant:n,size:"sm",className:h,disabled:v,title:f,onClick:k,"aria-label":E,"aria-pressed":N,"aria-expanded":H,"aria-haspopup":A,icon:a,children:o})}e(g,"settingsButton");function w({variant:n="outline",danger:a=!1,disabled:o,onClick:h,children:v}){return(0,s.jsx)(u.Button,{variant:a?"outline":n,className:a?"dsham_btnDanger":void 0,disabled:o,onClick:h,children:v})}e(w,"modalFooterButton");function D(n,a){let o={className:n?"dsham_archiveTabsLocked":void 0,children:a};return n&&(o.inert=""),o}e(D,"tabsShell");let j=Ks(l,u.Button),{HighlightedText:U,useArchiveSearch:P,useArchivePreview:B,DiscoveryFilters:me,SearchStatus:le,PreviewContent:V}=Cs(l,{Button:u.Button,SegmentedControl:u.SegmentedControl}),fe={refresh:["M13.5 5.5V2.5m0 0h-3m3 0-2.1 2.1A5.5 5.5 0 1 0 13.2 12"],download:["M8 2v8m0 0 3-3m-3 3-3-3M3 13v2h10v-2"],copy:["M5 5h8v8H5z","M3 3h8"],close:["m4 4 8 8M12 4 4 12"]};function ue(n){let a=document.createElement("span"),o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("viewBox","0 0 16 16"),o.setAttribute("width","16"),o.setAttribute("height","16"),o.setAttribute("fill","none"),o.setAttribute("stroke","currentColor"),o.setAttribute("stroke-width","1.5"),o.setAttribute("stroke-linecap","round"),o.setAttribute("stroke-linejoin","round"),o.setAttribute("aria-hidden","true");for(let h of fe[n]){let v=document.createElementNS("http://www.w3.org/2000/svg","path");v.setAttribute("d",h),o.append(v)}return a.append(o),a}e(ue,"createPluginUpdateIcon");let Qe={parse(n){if(typeof n!="string"||n.length===0)throw new TypeError(`sessionId must be a non-empty string, got ${String(n)}`);return n}},re={parse(n){let a=ce(n);if(typeof a!="object"||a===null||Array.isArray(a))throw new TypeError("result must be an object");let o=a.archivedSessionIds;if(!Array.isArray(o)||o.some(h=>typeof h!="string"))throw new TypeError("archivedSessionIds must be a string array");return a}},X={parse(n){let a=ce(n);if(typeof a!="object"||a===null||Array.isArray(a)||a.deleted!==!0)throw new TypeError("deleted must be true");return a}},yt={parse(n){let a=ce(n);if(typeof a!="object"||a===null||Array.isArray(a))throw new TypeError("target must be an object");if(a.scope==="all"||a.scope==="ungrouped"||a.scope==="workspace"&&typeof a.workspaceId=="string"&&a.workspaceId.length>0||a.scope==="sessions"&&Array.isArray(a.sessionIds)&&a.sessionIds.length>0&&a.sessionIds.every(o=>typeof o=="string"&&o.length>0))return a;throw new TypeError("target.scope must be all, ungrouped, workspace with a non-empty workspaceId, or sessions with non-empty sessionIds")}},St={parse(n){let a=ce(n);if(typeof a!="object"||a===null||Array.isArray(a))throw new TypeError("result must be an object");for(let o of["requestedSessionIds","deletedSessionIds","skippedSessionIds"])if(!Array.isArray(a[o])||a[o].some(h=>typeof h!="string"))throw new TypeError(`${o} must be a string array`);if(!Array.isArray(a.failures)||a.failures.some(o=>typeof o!="object"||o===null||typeof o.sessionId!="string"||typeof o.message!="string"))throw new TypeError("failures must contain sessionId/message objects");return a}},et={parse(n){let a=ce(n);if(typeof a!="object"||a===null||Array.isArray(a)||!Array.isArray(a.items))throw new TypeError("result.items must be an array");if(a.items.some(o=>typeof o!="object"||o===null||typeof o.sessionId!="string"||typeof o.createdAt!="number"||!Number.isFinite(o.createdAt)))throw new TypeError("items must contain sessionId/createdAt objects");return a}},dt={parse(n){let a=ce(n);if(!a||typeof a.sessionId!="string"||!a.sessionId||typeof a.targetWorkspaceId!="string"||!a.targetWorkspaceId)throw new TypeError("sessionId and targetWorkspaceId must be non-empty strings");return{sessionId:a.sessionId,targetWorkspaceId:a.targetWorkspaceId}}},xt={parse(n){let a=ce(n);if(!a||a.ok!==!0)throw new TypeError("session move result must be ok: true");return a}};function $e(n,a){return{mode:"strict",typeSymbol:n,create:e(()=>a,"create"),schema:a}}e($e,"strictCodec");let en={package:"@michengai/dsh-archive-manager",descriptors:[...$s(),...ws(),...Rs(),{id:"@michengai/dsh-archive-manager#workspaceRegistry/unarchiveSession",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"unarchiveSession",invocation:{kind:"direct"},parameters:[{name:"sessionId",wire:"sessionId",source:"json",codec:$e("@deepseek-ai/dsh-session/types#SessionId",Qe)}],result:$e("@michengai/dsh-archive-manager/types#ArchivedSessionIds",re),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/deleteSession",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"deleteSession",invocation:{kind:"direct"},parameters:[{name:"sessionId",wire:"sessionId",source:"json",codec:$e("@deepseek-ai/dsh-session/types#SessionId",Qe)}],result:$e("@michengai/dsh-archive-manager/types#Deleted",X),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/deleteArchivedSessions",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"deleteArchivedSessions",invocation:{kind:"direct"},parameters:[{name:"target",wire:"target",source:"json",codec:$e("@michengai/dsh-archive-manager/types#ArchivedBatchTarget",yt)}],result:$e("@michengai/dsh-archive-manager/types#DeletedBatch",St),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/archivedSessionMetadata",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"archivedSessionMetadata",invocation:{kind:"direct"},parameters:[],result:$e("@michengai/dsh-archive-manager/types#ArchivedSessionMetadata",et),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/diagnoseOrphanSubagents",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"diagnoseOrphanSubagents",invocation:{kind:"direct"},parameters:[],result:$e("@michengai/dsh-archive-manager/types#OrphanSubagentDiagnosis",{parse(n){let a=ce(n);if(!a||typeof a.count!="number"||!Array.isArray(a.items)||typeof a.totalSizeBytes!="number")throw new TypeError("invalid orphan subagent diagnosis");return a}}),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/cleanOrphanSubagents",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"cleanOrphanSubagents",invocation:{kind:"direct"},parameters:[{name:"target",wire:"target",source:"json",acceptsUndefined:!0,codec:$e("@michengai/dsh-archive-manager/types#CleanOrphanTarget",{parse(n){if(n==null)return{};let a=ce(n);if(!a)throw new TypeError("target must be an object");if(a.sessionIds!==void 0&&(!Array.isArray(a.sessionIds)||a.sessionIds.some(o=>typeof o!="string")))throw new TypeError("sessionIds must be an array of strings");return a}})}],result:$e("@michengai/dsh-archive-manager/types#CleanOrphanResult",{parse(n){let a=ce(n);if(!a||!Array.isArray(a.cleanedSessionIds)||!Array.isArray(a.skippedSessionIds)||!Array.isArray(a.failures))throw new TypeError("invalid orphan subagent clean result");return a}}),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/moveSessionToWorkspace",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"moveSessionToWorkspace",invocation:{kind:"direct"},parameters:[{name:"input",wire:"input",source:"json",codec:$e("@michengai/dsh-archive-manager/types#SessionMoveInput",dt)}],result:$e("@michengai/dsh-archive-manager/types#SessionMoveResult",xt),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}]};function tt(n,a){if(typeof document>"u"||document.querySelector("style[data-plugin-css="+JSON.stringify(n)+"]")!==null)return;let o=document.createElement("style");o.dataset.plugin="@michengai/dsh-archive-manager",o.dataset.pluginCss=n,o.textContent=a,document.head.appendChild(o)}e(tt,"ensurePluginStyle");function tn(n){if(typeof document>"u")return;document.querySelector("style[data-plugin-css="+JSON.stringify(n)+"]")?.remove()}e(tn,"removePluginStyle"),tt("dsh-archive-manager/DangerButton.css",".dsham_btnDanger:not(:disabled){color:var(--dsw-alias-state-error-primary,#ef7272);border-color:var(--dsw-alias-state-error-primary,#ef7272)}"),tt("dsh-archive-manager/IconAction.css",".dsham_iconAction{display:inline-flex!important;align-items:center!important;justify-content:center!important;box-sizing:border-box!important;width:22px!important;min-width:22px!important;height:22px!important;padding:0!important;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px)!important;background:transparent;color:var(--dsw-alias-label-secondary)}.dsham_iconAction:not(:disabled):hover{color:var(--dsw-alias-link,#4176e6)!important;border-color:var(--dsw-alias-link,#4176e6)!important}.dsham_iconAction.dsham_iconDanger{color:var(--dsw-alias-state-error-primary,#ef7272)!important;border-color:var(--dsw-alias-state-error-primary,#ef7272)!important}.dsham_iconAction.dsham_iconDanger:not(:disabled):hover{color:var(--dsw-alias-state-error-primary,#ef7272)!important;border-color:var(--dsw-alias-state-error-primary,#ef7272)!important}.dsham_iconAction svg{width:16px!important;height:16px!important;flex:none!important}"),tt("dsh-archive-manager/Modal.css",".dsham_modalRoot{position:fixed;inset:0;z-index:1200;display:grid;place-items:center;padding:24px}.dsham_modalMask{position:absolute;inset:0;background:var(--dsw-alias-bg-mask-1,rgb(0 0 0 / 45%));backdrop-filter:var(--dsw-mask-blur,blur(16px));-webkit-backdrop-filter:var(--dsw-mask-blur,blur(16px))}.dsham_modalDialog{position:relative;display:flex;flex-direction:column;gap:12px;box-sizing:border-box;max-width:calc(100vw - 48px);max-height:min(85vh,760px);padding:22px 24px 20px;overflow:hidden;border:1px solid var(--dsw-alias-border-l1,rgba(128,128,128,.2));border-radius:var(--dsw-radius-panel,28px);background-color:var(--dsw-alias-surface-overlay,var(--dsw-alias-bg-base,Canvas));background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-surface-overlay,Canvas));backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));-webkit-backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));color:var(--dsw-alias-label-primary);box-shadow:var(--dsw-elevation-prominent,0 16px 40px rgb(0 0 0 / 24%))}.dsham_modalHeader{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none}.dsham_modalHeader h2,.dsham_modalDialog h2{margin:0;font-size:16px;line-height:24px;font-weight:600;color:var(--dsw-alias-label-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}.dsham_modalClose{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:28px;height:28px;padding:0;border:none;border-radius:var(--dsw-radius-sm,6px);background:transparent;color:var(--dsw-alias-label-secondary);cursor:pointer;flex:none;transition:background-color .15s ease,color .15s ease}.dsham_modalClose:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.dsham_modalClose svg{display:block;width:14px;height:14px}.dsham_modalDialog>p{margin:0;color:var(--dsw-alias-label-secondary);font-size:13px;line-height:20px}.dsham_modalBody{display:flex;flex-direction:column;gap:12px;flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain}.dsham_modalFooter{display:flex;flex:none;align-items:center;justify-content:flex-end;gap:8px}.dsham_modalWide{width:min(900px,calc(100vw - 48px))!important;max-height:min(88vh,820px)!important}.dsham_modalWide .dsham_modalBody{overflow:hidden}.dsham_modalWide .dsham_previewMessages{max-height:none;flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain}"),tt("dsh-archive-manager/SidebarPopover.css",".dsham_sidebarCardRoot{position:fixed;inset:0;z-index:1200;pointer-events:none}.dsham_sidebarCardBackdrop{position:fixed;inset:0;pointer-events:auto;background:transparent}.dsham_sidebarCard{position:fixed;pointer-events:auto;box-sizing:border-box;width:290px;max-height:calc(100vh - 32px);overflow-y:auto;padding:16px 18px 14px;border-radius:var(--dsw-radius-lg,14px);background:var(--dsw-menu-surface-fill);backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));-webkit-backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));border:none;box-shadow:var(--dsw-elevation-prominent);color:var(--dsw-alias-label-primary);display:flex;flex-direction:column;gap:8px}.dsham_sidebarCardTitle{margin:0;font-size:14px;font-weight:600;line-height:20px;color:var(--dsw-alias-label-primary)}.dsham_sidebarCardDesc{margin:0;font-size:13px;line-height:18px;color:var(--dsw-alias-label-secondary)}.dsham_sidebarCardError{margin-top:2px;font-size:12px;line-height:16px;color:var(--dsw-alias-state-error-primary,#ef7272);white-space:pre-line}.dsham_sidebarCardFooter{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:10px}.dsham_sidebarCardBtn{border:none;background:transparent;padding:5px 12px;border-radius:var(--dsw-radius-sm,6px);font:inherit;font-size:13px;font-weight:500;line-height:18px;cursor:pointer;transition:background-color .15s ease,opacity .15s ease}.dsham_sidebarCardBtnCancel{color:var(--dsw-alias-label-primary)}.dsham_sidebarCardBtnCancel:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.dsham_sidebarCardBtnDanger{color:var(--dsw-alias-state-error-primary,#ef7272)}.dsham_sidebarCardBtnDanger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-danger,#f25a5a26)}.dsham_sidebarCardBtn:disabled{opacity:.4;cursor:default}"),tt("dsh-archive-manager/MoveSubmenu.css",`.dsham_moveSessionWrap{position:relative}
22
+ `;function $s(){if(typeof document>"u"||typeof document.getElementById!="function"||document.getElementById(Vs)!==null||typeof document.createElement!="function")return;let t=document.createElement("style");t.id=Vs,t.textContent=pi,(document.head??document.documentElement)?.appendChild?.(t)}e($s,"ensureSidebarEntryStyle");function mi(t){let r=t&&typeof t.size=="number"?t.size:16;return Ue(hn.IconArchiveOutlineMedium,{size:r})}e(mi,"ArchiveSidebarIcon");function xr(t){$s();let{t:r,location:i,onLocationChange:s,errorMessage:l,enabled:h=!1,onToggle:m,disabled:C,onlineUpdateEnabled:y=!0,onToggleOnlineUpdate:_,onlineUpdateDisabled:x,onlineUpdateLocked:g=!1,sidebarFavoriteStarEnabled:w=!0,onToggleSidebarFavoriteStar:D,sidebarFavoriteStarDisabled:N}=t,U=i??(h?"both":"settings"),P=e(fe=>{(fe==="both"||fe==="sidebar"||fe==="settings")&&(typeof s=="function"?s(fe):typeof m=="function"&&m(fe!=="settings"))},"handleLocationChange"),B=[Ue("div",{key:"entry-location",className:"dsham_bundle_row"},Ue("div",{className:"dsham_bundle_label_box"},Ue("span",{className:"dsham_bundle_title"},r("entry.location.title")),Ue("span",{className:"dsham_bundle_desc"},r("entry.location.desc")),l?Ue("span",{className:"dsham_bundle_error",role:"alert"},l):null),Ue(hn.SegmentedControl,{id:"dsham-bundle-entry-location",value:U,onChange:P,label:r("entry.location.title"),disabled:C,options:[{value:"both",label:r("entry.location.both")},{value:"sidebar",label:r("entry.location.sidebar")},{value:"settings",label:r("entry.location.settings")}]}))];if(typeof _=="function"){let fe=g?`${r("update.entry.desc")} (${r("update.entry.locked")})`:r("update.entry.desc");B.push(Ue("div",{key:"online-update",className:"dsham_bundle_row"},Ue("div",{className:"dsham_bundle_label_box"},Ue("span",{className:"dsham_bundle_title"},r("update.entry.title")),Ue("span",{className:"dsham_bundle_desc"},fe)),Ue(hn.Switch,{checked:y,onChange:_,label:r("update.entry.toggle"),disabled:x||g,title:g?r("update.entry.locked"):void 0})))}return typeof D=="function"&&B.push(Ue("div",{key:"sidebar-favorite-star",className:"dsham_bundle_row"},Ue("div",{className:"dsham_bundle_label_box"},Ue("span",{className:"dsham_bundle_title"},r("sidebar.favoriteStar.title")),Ue("span",{className:"dsham_bundle_desc"},r("sidebar.favoriteStar.desc"))),Ue(hn.Switch,{checked:w,onChange:D,label:r("sidebar.favoriteStar.toggle"),disabled:N}))),Ue(us,null,B)}e(xr,"ArchiveBundleConfigCard");function kr(t){let[r,i]=Yt(t.getLocation),[s,l]=Yt(t.getOnlineUpdateEnabled?t.getOnlineUpdateEnabled:()=>!0),[h,m]=Yt(t.getOnlineUpdateLocked?t.getOnlineUpdateLocked:()=>!1),[C,y]=Yt(t.getSidebarFavoriteStarEnabled?t.getSidebarFavoriteStarEnabled:()=>!0),[_,x]=Yt(null),[g,w]=Yt(!1),[D,N]=Yt(!1),[U,P]=Yt(!1);ps(()=>{let $=e(()=>{i(t.getLocation()),x(null),t.getOnlineUpdateEnabled&&l(t.getOnlineUpdateEnabled()),t.getOnlineUpdateLocked&&m(t.getOnlineUpdateLocked()),t.getSidebarFavoriteStarEnabled&&y(t.getSidebarFavoriteStarEnabled())},"syncState");return $(),t.subscribe($)},[t]);let B=e($=>{w(!0),x(null),i($),t.setLocation($).catch(ge=>{console.error("archive-manager: setLocation failed:",ge),i(t.getLocation()),x(t.t("entry.location.saveFailed")||"\u4FDD\u5B58\u5165\u53E3\u8BBE\u7F6E\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u6216\u91CD\u542F\u5BBF\u4E3B\u8FDB\u7A0B")}).finally(()=>{w(!1)})},"onLocationChange"),fe=t.setOnlineUpdate?$=>{t.getOnlineUpdateLocked?.()||(N(!0),l($),t.setOnlineUpdate($).catch(()=>{t.getOnlineUpdateEnabled&&l(t.getOnlineUpdateEnabled())}).finally(()=>{N(!1)}))}:void 0,le=t.setSidebarFavoriteStar?$=>{P(!0),y($),t.setSidebarFavoriteStar($).catch(()=>{t.getSidebarFavoriteStarEnabled&&y(t.getSidebarFavoriteStarEnabled())}).finally(()=>{P(!1)})}:void 0;return Ue(xr,{t:t.t,location:r,errorMessage:_,disabled:g,onLocationChange:B,onlineUpdateEnabled:s,onlineUpdateDisabled:D||h,onlineUpdateLocked:h,onToggleOnlineUpdate:fe,sidebarFavoriteStarEnabled:C,sidebarFavoriteStarDisabled:U,onToggleSidebarFavoriteStar:le})}e(kr,"ArchiveBundleConfigCardWrapper");function Cr(t,r){if($s(),!t.locale)return{getLocation:e(()=>"settings","getLocation"),setLocation:e(async()=>"settings","setLocation"),isSettingsSectionEnabled:e(()=>!0,"isSettingsSectionEnabled"),isEnabled:e(()=>!1,"isEnabled"),isSupported:e(()=>!1,"isSupported"),setEnabled:e(async()=>!1,"setEnabled"),isOnlineUpdateEnabled:e(()=>!0,"isOnlineUpdateEnabled"),isOnlineUpdateLocked:e(()=>!1,"isOnlineUpdateLocked"),setOnlineUpdate:e(async()=>!1,"setOnlineUpdate"),isSidebarFavoriteStarEnabled:e(()=>!0,"isSidebarFavoriteStarEnabled"),setSidebarFavoriteStar:e(async()=>!1,"setSidebarFavoriteStar"),destroy:e(()=>{},"destroy")};let{callApi:i,renderPanel:s,ns:l}=r,h="settings",m=!1,C=!1,y=null,_=null,x=0,g=!1,w,D=new Set,N=e(()=>h==="both"||h==="sidebar","isSidebarEnabled"),U=e(()=>h==="both"||h==="settings","isSettingsSectionEnabled"),P=e(()=>{if(!g)for(let F of D)try{F()}catch{}},"notify"),B=e(()=>{if(g||!C||!N()||y)return;let F=t.slots.register({name:"main",key:Sr,locale:l,inject:e(()=>{let ze=typeof r.injectProps=="function"?r.injectProps():{};return Object.assign({t:t.locale?.bind?t.locale.bind(l):void 0},ze)},"inject")},ze=>Ue("div",{className:"dsham_mainPanel"},s(ze)));y=typeof F=="function"?F:()=>{}},"mountMain"),fe=e(()=>{if(y){try{y()}catch{}y=null}},"unmountMain"),le=e(()=>{if(g||!m||!N()||_)return;let F=t.slots.register({name:"sidebar.panellist",id:Sr,order:hi,label:e(()=>t.locale.bind(l)("archives.title"),"label"),locale:l},ze=>mi(ze&&typeof ze=="object"&&"size"in ze?ze:void 0));_=typeof F=="function"?F:()=>{}},"mountRow"),$=e(()=>{if(_){try{_()}catch{}_=null}},"unmountRow"),ge=e(()=>{if(!g)if(N())B(),le();else{if(w?.panelInfo&&typeof w.selectPanel=="function")try{w.panelInfo.getSnapshot().activePanelId===Sr&&w.selectPanel(null)}catch{}$(),fe()}},"sync"),he=e(async F=>{if(g)return h;let ze=++x,I=h;if(h=F,ge(),P(),typeof r.onLocationChange=="function")try{r.onLocationChange(F)}catch{}try{return await i("/sidebar-entry",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({location:F})}),F}catch(pe){if(ze===x&&(h=I,ge(),P(),typeof r.onLocationChange=="function"))try{r.onLocationChange(I)}catch{}throw pe}},"setLocation"),Ye=e(async F=>(await he(F?"both":"settings"),N()),"setEnabled"),ne=!0,J=!1,gt=0,vt=e(async F=>{if(g||J)return ne;let ze=++gt;if(ne=F,P(),typeof r.onOnlineUpdateChange=="function")try{r.onOnlineUpdateChange(F)}catch{}try{if(await i("/online-update",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:F})}),ze===gt&&typeof r.onOnlineUpdateChange=="function")try{r.onOnlineUpdateChange(F)}catch{}return F}catch(I){if(ze===gt&&(ne=!F,P(),typeof r.onOnlineUpdateChange=="function"))try{r.onOnlineUpdateChange(!F)}catch{}throw I}},"setOnlineUpdate"),Ze=!0,ut=0,bt=e(async F=>{if(g)return Ze;let ze=++ut;if(Ze=F,P(),typeof r.onSidebarFavoriteStarChange=="function")try{r.onSidebarFavoriteStarChange(F)}catch{}try{return await i("/sidebar-favorite-star",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:F})}),F}catch(I){if(ze===ut&&(Ze=!F,P(),typeof r.onSidebarFavoriteStarChange=="function"))try{r.onSidebarFavoriteStarChange(!F)}catch{}throw I}},"setSidebarFavoriteStar"),Ve=x;i("/sidebar-entry").then(F=>{if(!g&&x===Ve&&F&&(F.location==="both"||F.location==="sidebar"||F.location==="settings"?h=F.location:typeof F.enabled=="boolean"&&(h=F.enabled?"both":"settings"),ge(),P(),typeof r.onLocationChange=="function"))try{r.onLocationChange(h)}catch{}}).catch(()=>{});let tn=gt;i("/online-update").then(F=>{if(!g&&gt===tn&&F&&typeof F.enabled=="boolean"&&(ne=F.enabled,F.locked===!0&&(J=!0),P(),typeof r.onOnlineUpdateChange=="function"))try{r.onOnlineUpdateChange(ne)}catch{}}).catch(()=>{});let Je=ut;i("/sidebar-favorite-star").then(F=>{if(!g&&ut===Je&&F&&typeof F.enabled=="boolean"&&(Ze=F.enabled,P(),typeof r.onSidebarFavoriteStarChange=="function"))try{r.onSidebarFavoriteStarChange(Ze)}catch{}}).catch(()=>{});let nn=t;return typeof nn.inject=="function"&&nn.inject(["layout"],F=>{!g&&F.layout&&(w=F.layout)}),t.slots.inject("main",()=>{if(!g)return C=!0,B(),()=>{C=!1,fe()}}),t.slots.inject("sidebar.panellist",()=>{if(!g)return m=!0,le(),()=>{m=!1,$()}}),t.slots.inject("plugins.bundle.config",()=>{if(!g)return t.slots.register({name:"plugins.bundle.config",key:ui,locale:l},F=>F&&F.view==="summary"?null:Ue(kr,{t:t.locale.bind(l),getLocation:e(()=>h,"getLocation"),setLocation:he,getEnabled:e(()=>N(),"getEnabled"),setSidebar:Ye,getOnlineUpdateEnabled:e(()=>ne,"getOnlineUpdateEnabled"),setOnlineUpdate:vt,getOnlineUpdateLocked:e(()=>J,"getOnlineUpdateLocked"),getSidebarFavoriteStarEnabled:e(()=>Ze,"getSidebarFavoriteStarEnabled"),setSidebarFavoriteStar:bt,subscribe:e(ze=>(D.add(ze),()=>{D.delete(ze)}),"subscribe")}))}),{getLocation:e(()=>h,"getLocation"),setLocation:he,isSettingsSectionEnabled:U,isEnabled:e(()=>N(),"isEnabled"),isSupported:e(()=>m,"isSupported"),setEnabled:Ye,isOnlineUpdateEnabled:e(()=>ne,"isOnlineUpdateEnabled"),isOnlineUpdateLocked:e(()=>J,"isOnlineUpdateLocked"),setOnlineUpdate:vt,isSidebarFavoriteStarEnabled:e(()=>Ze,"isSidebarFavoriteStarEnabled"),setSidebarFavoriteStar:bt,destroy:e(()=>{g||(g=!0,x++,gt++,ut++,w=void 0,D.clear(),$(),fe())},"destroy")}}e(Cr,"setupSidebarEntry");function Er(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(Er,"checkedId");var fi={parse(t){let r=ce(t);if(!r||typeof r!="object"||typeof r.favorite!="boolean")throw new TypeError("\u6536\u85CF\u72B6\u6001\u5FC5\u987B\u4E3A\u5E03\u5C14\u503C");return{sessionId:Er(r.sessionId),favorite:r.favorite}}},gi={parse(t){let r=ce(t);if(!r||!Array.isArray(r.favoriteSessionIds)||r.favoriteSessionIds.length>1e5)throw new TypeError("\u6536\u85CF\u96C6\u5408\u65E0\u6548");return{favoriteSessionIds:[...new Set(r.favoriteSessionIds.map(Er))]}},safeParse(t){try{return{success:!0,data:this.parse(t)}}catch(r){return{success:!1,error:r}}}};function Gs(){let t=e((r,i)=>({mode:"strict",typeSymbol:`@michengai/dsh-archive-manager/types#${r}`,create:e(()=>i,"create"),schema:i}),"codec");return["favoriteSessions","setSessionFavorite"].map(r=>({id:`@michengai/dsh-archive-manager#workspaceRegistry/${r}`,service:"workspaceRegistry",namespace:"workspaceRegistry",method:r,invocation:{kind:"direct"},parameters:r==="favoriteSessions"?[]:[{name:"input",wire:"input",source:"json",codec:t("FavoriteInput",fi)}],result:t("FavoriteState",gi),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}))}e(Gs,"favoriteInvocations");function Ir(t,{days:r,now:i=Date.now(),favorites:s=new Set,currentId:l,pending:h=new Map}){if(!t||!Number.isInteger(r)||r<1||r>36500||s.has(t.id)||t.id===l||(t.retainedBy?.mainView??0)>0||t.running||(t.runningSubagentCount??0)>0||t.pendingInteraction!=null||h.has(t.id))return!1;let m=typeof t.updatedAt=="number"?t.updatedAt:Date.parse(t.updatedAt??"");return Number.isFinite(m)&&m<=i-r*864e5}e(Ir,"idleArchiveCandidate");async function rr(t,r,{onProgress:i,refresh:s}={}){let l=[...new Set(t.map(Er))],h={requested:l,succeeded:[],skipped:[],failures:[],remaining:[],refreshError:null},m=e(()=>i?.({total:l.length,done:h.succeeded.length+h.skipped.length+h.failures.length,succeeded:h.succeeded.length,skipped:h.skipped.length,failed:h.failures.length}),"report");m();for(let C of l){try{(await r(C)?h.succeeded:h.skipped).push(C)}catch(y){h.failures.push({sessionId:C,message:y instanceof Error?y.message:String(y)}),h.remaining.push(C)}m()}try{await s?.()}catch(C){h.refreshError=C instanceof Error?C.message:String(C)}return h}e(rr,"runSessionBatch");function Ks({workspaces:t,sessions:r,archive:i,restore:s,deleteOne:l,getFavorites:h,refresh:m,currentSessionId:C}){return async(y,_,x={})=>{if(!["archive","restore","undo","delete"].includes(y))throw new TypeError("\u672A\u77E5\u6279\u91CF\u64CD\u4F5C");return rr(_,async g=>{let D=t.getSnapshot().archivedSessionIds.includes(g);if(y==="archive"){if(D||!r.getSnapshot().byId[g])return!1;if(x.idleDays!==void 0){let fe=new Set((await h()).favoriteSessionIds),le=r.getSnapshot();if(!Ir(le.byId[g],{days:x.idleDays,favorites:fe,currentId:C(le),pending:x.getPending?.()??x.pending}))return!1}return await i(g),t.getSnapshot().archivedSessionIds.includes(g)}return D?y==="delete"?(await l(g),!0):!((await s(g))?.archivedSessionIds??t.getSnapshot().archivedSessionIds).includes(g):!1},{onProgress:x.onProgress,refresh:m})}}e(Ks,"createSessionOrganizer");function vi(t){return!t||t<=0?"0 B":t<1024?t+" B":t<1024*1024?(t/1024).toFixed(1)+" KB":(t/(1024*1024)).toFixed(1)+" MB"}e(vi,"formatBytes");function Ys(t,r){let i=t.createElement;function s(h,m){return i(r??(y=>i("button",{type:"button",disabled:y.disabled,onClick:y.onClick},y.children)),{variant:"outline",size:"sm",...m},h)}e(s,"textButton");function l({title:h,failures:m,separator:C}){let[y,_]=t.useState(!1),x=i("ul",null,m.map(g=>i("li",{key:g.sessionId},g.sessionId,C,g.message)));return i(Qn,{title:h,open:y,onToggle:e(()=>_(g=>!g),"onToggle")},x)}return e(l,"FailureDetails"),e(function({t:m,archived:C,busy:y,ready:_,days:x,onDays:g,count:w,onPreview:D,progress:N,result:U,onRetry:P,undoCount:B,onUndo:fe,onReload:le,orphanCount:$=0,orphanSizeBytes:ge=0,orphanCleaning:he=!1,onCleanOrphans:Ye,cacheCount:ne=0,cacheRepair:J,onRebuildCaches:gt,onRetryCaches:vt,onReloadCaches:Ze,onDismissCaches:ut}){return i(t.Fragment,null,i("style",null,".dsham_organizer,.dsham_batchFeedback{display:grid;gap:12px;margin:0 0 16px;padding:14px 16px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2)}.dsham_organizerControls{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.dsham_organizer label{display:inline-flex;align-items:center;gap:8px;font-size:13px;color:var(--dsw-alias-label-primary)}.dsham_number{width:88px;height:32px;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px}.dsham_number:hover{border-color:var(--dsw-alias-border-l3)}.dsham_number:focus{outline:none;border-color:var(--dsw-alias-state-business-primary)}.dsham_disclosure{display:inline-flex;align-items:center;gap:6px;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;cursor:pointer}.dsham_foldChevron{transition:transform 150ms ease}.dsham_foldChevron.is-open{transform:rotate(180deg)}.dsham_organizer p,.dsham_batchFeedback p{margin:0;font-size:12px;color:var(--dsw-alias-label-secondary)}.dsham_batchFeedback progress{width:100%}.dsham_batchFeedback details{font-size:12px;overflow-wrap:anywhere}.dsham_archivePreview{max-height:260px;overflow:auto;display:grid;gap:8px;padding:8px 0}.dsham_archivePreview label{display:flex;gap:8px;align-items:center;overflow-wrap:anywhere}"),(!C||!_)&&i("div",{className:"dsham_organizer"},i("div",{className:"dsham_organizerControls"},!_&&s(m("organizer.reloadFavorites"),{disabled:y,onClick:le}),!C&&i(t.Fragment,null,i("label",null,m("organizer.idleDays"),i(fs,{min:1,max:36500,value:x===""?null:Number(x),disabled:y,"aria-label":m("organizer.idleDays"),onChange:e(bt=>g(bt==null?"":String(bt)),"onChange")})),s(m("organizer.preview",{n:w}),{disabled:y||!_||w===0,onClick:D}))),!C&&i("p",null,m("organizer.rules"))),$>0&&i("div",{className:"dsham_organizer"},i("div",{className:"dsham_organizerControls"},i("strong",null,m("organizer.orphanTitle",{n:$})),Ye&&s(m(he?"organizer.cleaning":"organizer.cleanOrphans"),{disabled:y||he,onClick:Ye})),i("p",null,m("organizer.orphanDesc",{size:vi(ge)}))),ne>0&&i("div",{className:"dsham_organizer"},i("div",{className:"dsham_organizerControls"},i("strong",null,m("organizer.cacheTitle",{n:ne})),gt&&s(m(J?.busy?"organizer.cacheRebuilding":"organizer.cacheRebuild"),{disabled:y||J?.busy,onClick:gt})),i("p",null,m("organizer.cacheDesc"))),J&&(J.result||J.progress||J.error||J.refreshError)&&i("section",{className:"dsham_batchFeedback","aria-label":m("organizer.cacheRebuild")},J.progress&&i("div",{role:"status"},i("progress",{value:J.progress.done,max:Math.max(1,J.progress.total)}),m("organizer.progressCount",J.progress)),J.result&&i("div",{role:"status"},i("p",null,m("organizer.result",{succeeded:J.result.rebuiltSessionIds.length,skipped:J.result.skippedSessionIds.length,failed:J.result.failures.length})),J.result.failures.length>0&&i(l,{title:m("organizer.failureDetails"),failures:J.result.failures,separator:m("common.separator")}),J.result.failures.length>0&&vt&&s(m("organizer.cacheRetry",{n:J.result.failures.length}),{disabled:y||J.busy,onClick:vt})),J.error&&i("p",{role:"alert"},m("organizer.cacheError",{detail:J.error})),J.refreshError&&i("p",{role:"alert"},m("organizer.refreshError",{detail:J.refreshError})),i("div",{className:"dsham_organizerControls"},Ze&&s(m("organizer.cacheCheck"),{disabled:y||J.busy,onClick:Ze}),ut&&s(m("organizer.dismiss"),{disabled:y||J.busy,onClick:ut}))),(N||U||B>0)&&i("section",{className:"dsham_batchFeedback","aria-label":m("organizer.feedback")},N&&i("div",{role:"status","aria-live":"polite"},i("progress",{value:N.done,max:Math.max(1,N.total),"aria-label":m("organizer.progress")}),m("organizer.progressCount",{done:N.done,total:N.total})),U&&i("div",{role:"status"},i("strong",null,m(`organizer.${U.kind??"archive"}Result`)),i("p",null,m("organizer.result",{succeeded:U.succeeded.length,skipped:U.skipped.length,failed:U.failures.length})),U.failures.length>0&&i(l,{title:m("organizer.failureDetails"),failures:U.failures,separator:m("common.separator")}),U.refreshError&&i("p",{role:"alert"},m("organizer.refreshError",{detail:U.refreshError})),U.remaining.length>0&&s(m("organizer.retry",{n:U.remaining.length}),{disabled:y,onClick:P})),B>0&&i("div",{className:"dsham_organizerControls"},s(m("organizer.undo",{n:B}),{disabled:y,onClick:fe}),i("p",null,m("organizer.undoHint")))))},"OrganizerPanel")}e(Ys,"createOrganizerPanel");var Zs={"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"},Js={"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."},Xs={"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 kn=Function("return globalThis.__dshArchiveReactDOM")(),Qs=Function("return globalThis.__dshArchiveReactDOMClient")(),ea=kn.createPortal,Fo=kn.flushSync,Ho=Qs?.createRoot,Bo=Qs?.hydrateRoot,Uo=kn.findDOMNode,Wo=kn.unmountComponentAtNode,qo=kn.unstable_batchedUpdates,Vo=kn.version;function bi(t){var r={exports:{}},i=r.exports;Object.defineProperty(i,Symbol.toStringTag,{value:"Module"});let s=t("react/jsx-runtime"),l=t("react"),h=t("@deepseek-ai/dsh-client-ui-primitives");function m(n){try{return typeof n("contextMenus")?.register=="function"}catch{return!1}}e(m,"hasNativeContextMenuService");function C(){let n=h;return!!(n?.MenuSurface&&n?.MenuItemButton)}e(C,"hasMoveMenuPrimitives");function y(n,a){return n.filter(o=>!o.sessionIds?.includes(a))}e(y,"movableWorkspaces");function _({open:n,onClose:a,title:o,description:p,footer:v,children:f,className:k,width:E,portalToBody:M=!1,closeLabel:H,t:A}){let z=l.useRef(null),O=l.useCallback(()=>z.current?.closest(".dsham_settings")??document.body,[]),[u,ae]=l.useState(null);l.useEffect(()=>{if(!n){ae(null);return}ae(M?typeof document<"u"?document.body:null:O())},[n,O,M]),l.useEffect(()=>{if(!n)return;let yt=e(ht=>{ht.key==="Escape"&&(ht.preventDefault(),ht.stopPropagation(),"stopImmediatePropagation"in ht&&typeof ht.stopImmediatePropagation=="function"&&ht.stopImmediatePropagation(),a())},"onKey");return window.addEventListener("keydown",yt,!0),()=>window.removeEventListener("keydown",yt,!0)},[n,a]);let Ne=H||A("common.close"),me=(0,s.jsxs)("div",{className:"dsham_modalRoot",role:"presentation",children:[(0,s.jsx)("div",{className:"dsham_modalMask",onClick:a}),(0,s.jsxs)("div",{role:"dialog","aria-modal":!0,"aria-label":typeof o=="string"?o:void 0,className:ia("dsham_modalDialog",k),style:{width:E??560},children:[(0,s.jsxs)("div",{className:"dsham_modalHeader",children:[(0,s.jsx)("h2",{title:typeof o=="string"?o:void 0,children:o}),(0,s.jsx)("button",{type:"button",className:"dsham_modalClose",onClick:a,"aria-label":Ne,title:Ne,children:(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:14,height:14,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round","aria-hidden":"true",children:(0,s.jsx)("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]}),p!=null&&(0,s.jsx)("p",{children:p}),f!=null&&(0,s.jsx)("div",{className:"dsham_modalBody",children:f}),v!=null&&(0,s.jsx)("div",{className:"dsham_modalFooter",children:v})]})]});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(x,{refObject:z,getContainer:O}),n&&u?ea(me,u):null]})}e(_,"SettingsModal");function x({refObject:n,getContainer:a}){return(0,s.jsx)("span",{hidden:!0,ref:n,"data-get-container":a})}e(x,"SettingsModalAnchor");function g({variant:n="outline",icon:a,children:o,className:p,disabled:v,title:f,onClick:k,"aria-label":E,"aria-pressed":M,"aria-expanded":H,"aria-haspopup":A}){return(0,s.jsx)(h.Button,{variant:n,size:"sm",className:p,disabled:v,title:f,onClick:k,"aria-label":E,"aria-pressed":M,"aria-expanded":H,"aria-haspopup":A,icon:a,children:o})}e(g,"settingsButton");function w({variant:n="outline",danger:a=!1,disabled:o,onClick:p,children:v}){return(0,s.jsx)(h.Button,{variant:a?"outline":n,className:a?"dsham_btnDanger":void 0,disabled:o,onClick:p,children:v})}e(w,"modalFooterButton");function D(n,a){let o={className:n?"dsham_archiveTabsLocked":void 0,children:a};return n&&(o.inert=""),o}e(D,"tabsShell");let N=Ys(l,h.Button),{HighlightedText:U,useArchiveSearch:P,useArchivePreview:B,DiscoveryFilters:fe,SearchStatus:le,PreviewContent:$}=Es(l,{Button:h.Button,SegmentedControl:h.SegmentedControl}),ge={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 he(n){let a=document.createElement("span"),o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("viewBox","0 0 16 16"),o.setAttribute("width","16"),o.setAttribute("height","16"),o.setAttribute("fill","none"),o.setAttribute("stroke","currentColor"),o.setAttribute("stroke-width","1.5"),o.setAttribute("stroke-linecap","round"),o.setAttribute("stroke-linejoin","round"),o.setAttribute("aria-hidden","true");for(let p of ge[n]){let v=document.createElementNS("http://www.w3.org/2000/svg","path");v.setAttribute("d",p),o.append(v)}return a.append(o),a}e(he,"createPluginUpdateIcon");let Ye={parse(n){if(typeof n!="string"||n.length===0)throw new TypeError(`sessionId must be a non-empty string, got ${String(n)}`);return n}},ne={parse(n){let a=ce(n);if(typeof a!="object"||a===null||Array.isArray(a))throw new TypeError("result must be an object");let o=a.archivedSessionIds;if(!Array.isArray(o)||o.some(p=>typeof p!="string"))throw new TypeError("archivedSessionIds must be a string array");return a}},J={parse(n){let a=ce(n);if(typeof a!="object"||a===null||Array.isArray(a)||a.deleted!==!0)throw new TypeError("deleted must be true");return a}},gt={parse(n){let a=ce(n);if(typeof a!="object"||a===null||Array.isArray(a))throw new TypeError("target must be an object");if(a.scope==="all"||a.scope==="ungrouped"||a.scope==="workspace"&&typeof a.workspaceId=="string"&&a.workspaceId.length>0||a.scope==="sessions"&&Array.isArray(a.sessionIds)&&a.sessionIds.length>0&&a.sessionIds.every(o=>typeof o=="string"&&o.length>0))return a;throw new TypeError("target.scope must be all, ungrouped, workspace with a non-empty workspaceId, or sessions with non-empty sessionIds")}},vt={parse(n){let a=ce(n);if(typeof a!="object"||a===null||Array.isArray(a))throw new TypeError("result must be an object");for(let o of["requestedSessionIds","deletedSessionIds","skippedSessionIds"])if(!Array.isArray(a[o])||a[o].some(p=>typeof p!="string"))throw new TypeError(`${o} must be a string array`);if(!Array.isArray(a.failures)||a.failures.some(o=>typeof o!="object"||o===null||typeof o.sessionId!="string"||typeof o.message!="string"))throw new TypeError("failures must contain sessionId/message objects");return a}},Ze={parse(n){let a=ce(n);if(typeof a!="object"||a===null||Array.isArray(a)||!Array.isArray(a.items))throw new TypeError("result.items must be an array");if(a.items.some(o=>typeof o!="object"||o===null||typeof o.sessionId!="string"||typeof o.createdAt!="number"||!Number.isFinite(o.createdAt)))throw new TypeError("items must contain sessionId/createdAt objects");return a}},ut={parse(n){let a=ce(n);if(!a||typeof a.sessionId!="string"||!a.sessionId||typeof a.targetWorkspaceId!="string"||!a.targetWorkspaceId)throw new TypeError("sessionId and targetWorkspaceId must be non-empty strings");return{sessionId:a.sessionId,targetWorkspaceId:a.targetWorkspaceId}}},bt={parse(n){let a=ce(n);if(!a||a.ok!==!0)throw new TypeError("session move result must be ok: true");return a}};function Ve(n,a){return{mode:"strict",typeSymbol:n,create:e(()=>a,"create"),schema:a}}e(Ve,"strictCodec");let tn={package:"@michengai/dsh-archive-manager",descriptors:[...Gs(),...Ss(),...js(),{id:"@michengai/dsh-archive-manager#workspaceRegistry/unarchiveSession",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"unarchiveSession",invocation:{kind:"direct"},parameters:[{name:"sessionId",wire:"sessionId",source:"json",codec:Ve("@deepseek-ai/dsh-session/types#SessionId",Ye)}],result:Ve("@michengai/dsh-archive-manager/types#ArchivedSessionIds",ne),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:Ve("@deepseek-ai/dsh-session/types#SessionId",Ye)}],result:Ve("@michengai/dsh-archive-manager/types#Deleted",J),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:Ve("@michengai/dsh-archive-manager/types#ArchivedBatchTarget",gt)}],result:Ve("@michengai/dsh-archive-manager/types#DeletedBatch",vt),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:Ve("@michengai/dsh-archive-manager/types#ArchivedSessionMetadata",Ze),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:Ve("@michengai/dsh-archive-manager/types#OrphanSubagentDiagnosis",{parse(n){let a=ce(n);if(!a||typeof a.count!="number"||!Array.isArray(a.items)||typeof a.totalSizeBytes!="number")throw new TypeError("invalid orphan subagent diagnosis");return a}}),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/cleanOrphanSubagents",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"cleanOrphanSubagents",invocation:{kind:"direct"},parameters:[{name:"target",wire:"target",source:"json",acceptsUndefined:!0,codec:Ve("@michengai/dsh-archive-manager/types#CleanOrphanTarget",{parse(n){if(n==null)return{};let a=ce(n);if(!a)throw new TypeError("target must be an object");if(a.sessionIds!==void 0&&(!Array.isArray(a.sessionIds)||a.sessionIds.some(o=>typeof o!="string")))throw new TypeError("sessionIds must be an array of strings");return a}})}],result:Ve("@michengai/dsh-archive-manager/types#CleanOrphanResult",{parse(n){let a=ce(n);if(!a||!Array.isArray(a.cleanedSessionIds)||!Array.isArray(a.skippedSessionIds)||!Array.isArray(a.failures))throw new TypeError("invalid orphan subagent clean result");return a}}),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}},{id:"@michengai/dsh-archive-manager#workspaceRegistry/moveSessionToWorkspace",service:"workspaceRegistry",namespace:"workspaceRegistry",method:"moveSessionToWorkspace",invocation:{kind:"direct"},parameters:[{name:"input",wire:"input",source:"json",codec:Ve("@michengai/dsh-archive-manager/types#SessionMoveInput",ut)}],result:Ve("@michengai/dsh-archive-manager/types#SessionMoveResult",bt),sourceLocation:{file:"@michengai/dsh-archive-manager/lib/workspace.js",line:1,column:1}}]};function Je(n,a){if(typeof document>"u"||document.querySelector("style[data-plugin-css="+JSON.stringify(n)+"]")!==null)return;let o=document.createElement("style");o.dataset.plugin="@michengai/dsh-archive-manager",o.dataset.pluginCss=n,o.textContent=a,document.head.appendChild(o)}e(Je,"ensurePluginStyle");function nn(n){if(typeof document>"u")return;document.querySelector("style[data-plugin-css="+JSON.stringify(n)+"]")?.remove()}e(nn,"removePluginStyle"),Je("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)}"),Je("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}"),Je("dsh-archive-manager/Modal.css",".dsham_modalRoot{position:fixed;inset:0;z-index:1200;display:grid;place-items:center;padding:24px}.dsham_modalMask{position:absolute;inset:0;background:var(--dsw-alias-bg-mask-1,rgb(0 0 0 / 45%));backdrop-filter:var(--dsw-mask-blur,blur(16px));-webkit-backdrop-filter:var(--dsw-mask-blur,blur(16px))}.dsham_modalDialog{position:relative;display:flex;flex-direction:column;gap:12px;box-sizing:border-box;max-width:calc(100vw - 48px);max-height:min(85vh,760px);padding:22px 24px 20px;overflow:hidden;border:1px solid var(--dsw-alias-border-l1,rgba(128,128,128,.2));border-radius:var(--dsw-radius-panel,28px);background-color:var(--dsw-alias-surface-overlay,var(--dsw-alias-bg-base,Canvas));background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-surface-overlay,Canvas));backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));-webkit-backdrop-filter:var(--dsw-menu-backdrop-filter,blur(40px) saturate(150%));color:var(--dsw-alias-label-primary);box-shadow:var(--dsw-elevation-prominent,0 16px 40px rgb(0 0 0 / 24%))}.dsham_modalHeader{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none}.dsham_modalHeader h2,.dsham_modalDialog h2{margin:0;font-size:16px;line-height:24px;font-weight:600;color:var(--dsw-alias-label-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}.dsham_modalClose{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:28px;height:28px;padding:0;border:none;border-radius:var(--dsw-radius-sm,6px);background:transparent;color:var(--dsw-alias-label-secondary);cursor:pointer;flex:none;transition:background-color .15s ease,color .15s ease}.dsham_modalClose:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.dsham_modalClose svg{display:block;width:14px;height:14px}.dsham_modalDialog>p{margin:0;color:var(--dsw-alias-label-secondary);font-size:13px;line-height:20px}.dsham_modalBody{display:flex;flex-direction:column;gap:12px;flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain}.dsham_modalFooter{display:flex;flex:none;align-items:center;justify-content:flex-end;gap:8px}.dsham_modalWide{width:min(900px,calc(100vw - 48px))!important;max-height:min(88vh,820px)!important}.dsham_modalWide .dsham_modalBody{overflow:hidden}.dsham_modalWide .dsham_previewMessages{max-height:none;flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain}"),Je("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}"),Je("dsh-archive-manager/MoveSubmenu.css",`.dsham_moveSessionWrap{position:relative}
23
23
  .dsham_moveSubmenu{position:fixed;z-index:1100;min-width:160px;max-width:280px;box-sizing:border-box;overflow-y:auto;overscroll-behavior:contain;padding:4px;display:flex;flex-direction:column;gap:0;border:none;border-radius:var(--dsw-radius-lg,14px);box-shadow:var(--dsw-elevation-prominent,0 6px 20px rgba(0,0,0,.45));color:var(--dsw-alias-label-primary,#ededed);isolation:isolate}
24
24
  .dsham_moveSubmenu::before{content:'';position:absolute;top:0;bottom:0;left:-6px;width:8px}
25
25
  .dsham_moveSubmenu[data-dsham-side="left"]::before{left:auto;right:-6px}
26
26
  .dsham_moveSubmenu::-webkit-scrollbar{width:0px;height:0px;display:none}
27
27
  .dsham_moveSubmenu{scrollbar-width:none;-ms-overflow-style:none}
28
- .dsham_moveSubmenuEmpty{padding:8px 10px;font-size:12px;color:var(--dsw-alias-label-tertiary,#888)}`),tt("dsh-archive-manager/WorkspaceMenuGroup.css",'div:has([data-dsham-archive-icon]) + div[role="separator"],div:has([data-dsham-archive-icon]) + div[class*="separator"],div:has(svg[data-dsham-archive-icon]) + div[role="separator"],div:has(svg[data-dsham-archive-icon]) + [class*="separator"]{display:none!important}');let Ht="M8 1.75l1.934 3.918 4.324.628-3.129 3.05.738 4.306L8 11.618l-3.867 2.034.738-4.306-3.129-3.05 4.324-.628L8 1.75z";function Ln(n){return n?'<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="'+Ht+'"/></svg>':'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linejoin="round" aria-hidden="true"><path d="'+Ht+'"/></svg>'}e(Ln,"starSvg");function Bt(n){return!!n?.querySelector("[data-state]")}e(Bt,"resolveRowHasStatus");let zn="[data-row-key^='session:']{position:relative}.dsham_starSlot{display:none;position:absolute;left:calc(8px + var(--dsh-workspace-indent,0px));inset-inline-start:calc(8px + var(--dsh-workspace-indent,0px));top:50%;transform:translateY(-50%);align-items:center;justify-content:center;box-sizing:border-box;width:16px;height:20px;z-index:1;pointer-events:none}[data-row-key^='session:']:hover .dsham_starSlot,.dsham_starSlot[data-favorited='true']{display:inline-flex;pointer-events:auto}[data-row-key^='session:']:hover>span:first-child:not(:has([data-state])),[data-row-key^='session:'][data-dsham-favorited='true']:not([data-dsham-has-status='true'])>span:first-child:not(:has([data-state])){opacity:0}[data-row-key^='session:'][data-dsham-has-status='true']>span:first-child,[data-row-key^='session:']>span:first-child:has([data-state]){opacity:1}[data-row-key^='session:'][data-dsham-has-status='true'] .dsham_starSlot,[data-row-key^='session:']:has(>span:first-child [data-state]) .dsham_starSlot{width:10px;height:10px;top:auto;bottom:3px;left:calc(15px + var(--dsh-workspace-indent,0px));inset-inline-start:calc(15px + var(--dsh-workspace-indent,0px));transform:none}[data-row-key^='session:'][data-dsham-has-status='true'] .dsham_rowStar,[data-row-key^='session:']:has(>span:first-child [data-state]) .dsham_rowStar{width:10px;height:10px}[data-row-key^='session:'][data-dsham-has-status='true'] .dsham_rowStar svg,[data-row-key^='session:']:has(>span:first-child [data-state]) .dsham_rowStar svg{width:10px;height:10px;filter:drop-shadow(0 0 1px rgba(0,0,0,0.85))}.dsham_rowStar{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:16px;height:16px;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-primary);cursor:pointer;flex:none;border-radius:var(--dsw-radius-xs,4px)}.dsham_starSlot[data-favorited='true'] .dsham_rowStar{color:#e8b931}.dsham_rowStar svg{display:block;width:16px;height:16px;flex:none}";tt("dsh-archive-manager/RowFavorite.css",zn);let ie="dsh-archive-manager:workspace-favorites-only",ke="data-dsham-favorites-hidden",ot="data-dsham-favorites-only",ln="dsham_rowStar",Pn="dsham_starSlot",ea=["\u4EC5\u663E\u793A\u5DF2\u5F52\u6863","Archived only","\u0422\u043E\u043B\u044C\u043A\u043E \u0430\u0440\u0445\u0438\u0432\u043D\u044B\u0435"];tt("dsh-archive-manager/FavoritesFilter.css",`[data-dsham-favorites-hidden='true']{display:none!important}button[data-dsham-favorites-only='true'][data-active='true']::after{content:"\\2713";margin-left:auto;padding-left:12px;font-size:12px;line-height:1;color:var(--dsw-alias-state-business-primary,#3b82f6)}`);function ta(){try{return window.localStorage.getItem(ie)==="1"}catch{return!1}}e(ta,"readWorkspaceFavoritesOnly");function na(n){try{window.localStorage.setItem(ie,n?"1":"0")}catch{}}e(na,"writeWorkspaceFavoritesOnly");function Cr(n,a){let o=e(f=>a.favorites.has(f)||a.sessions?.[f]?.blank===!0,"visibleSession"),h=new Map,v=null;for(let f of n){if(f.startsWith("workspace:")){v=f,h.set(f,!1);continue}f.startsWith("session:")&&v!==null&&o(f.slice(8))&&h.set(v,!0)}return n.map(f=>f.startsWith("session:")?o(f.slice(8)):f.startsWith("workspace:")?h.get(f)===!0||a.groupHasFavorite?.(f.slice(10))===!0:!f.startsWith("overflow:"))}e(Cr,"favoritesOnlyVisibility");function Er(n,a){let o=new Map,h=new Set;for(let f of a){let k=!1;for(let E of f.sessionIds)h.add(E),n.has(E)&&(k=!0);o.set(f.workspaceId,k)}let v=!1;for(let f of n)if(!h.has(f)){v=!0;break}return f=>f===""||f==="ungrouped"?v:o.get(f)===!0}e(Er,"favoriteGroupPredicate");function Ir(n,a,o,h){let v={dispose:e(()=>{},"dispose"),setFavoriteStarEnabled:e(q=>{},"setFavoriteStarEnabled"),isFavoriteStarEnabled:e(()=>!0,"isFavoriteStarEnabled")};if(typeof document>"u"||typeof document.addEventListener!="function"||typeof MutationObserver>"u")return v;let f=ta(),k=typeof h=="function"?h():!0,E=!1,N=!1,H=e(()=>{k?tt("dsh-archive-manager/RowFavorite.css",zn):tn("dsh-archive-manager/RowFavorite.css")},"updateStarStyle");H();let A=e(q=>{let Me=q;typeof Me?.detail?.enabled=="boolean"?k=Me.detail.enabled:typeof h=="function"&&(k=h()),H(),ct()},"onStarToggle");typeof window<"u"&&typeof window.addEventListener=="function"&&window.addEventListener("dsham-favorite-star-toggle",A);let z=0,O=200,d=null,oe=new Set,Re=e(q=>{if(!k){for(let ee of q)Array.from(ee.children).find(ze=>ze.classList.contains(Pn))?.remove(),ee.removeAttribute("data-dsham-favorited"),ee.removeAttribute("data-dsham-has-status");return}let Me=a.getSnapshot();for(let ee of q){let Z=ee.getAttribute("data-row-key")??"";if(!Z.startsWith("session:"))continue;let ze=Z.slice(8),at=Array.from(ee.children).find(Ke=>Ke.tagName==="SPAN"&&Array.from(Ke.classList).some(zt=>zt==="slot"||zt.endsWith("_slot")))??null;if(at===null){ee.removeAttribute("data-dsham-has-status");continue}let L=Array.from(ee.children).find(Ke=>Ke.classList.contains(Pn))??null;if(!Me.ready){L?.remove(),ee.removeAttribute("data-dsham-favorited"),ee.removeAttribute("data-dsham-has-status");continue}L!==null&&(L.parentElement!==ee||L.nextElementSibling!==null)&&ee.appendChild(L),L===null&&(L=document.createElement("span"),L.className=Pn,ee.appendChild(L)),L.dataset.sessionId=ze,Bt(at)?ee.setAttribute("data-dsham-has-status","true"):ee.removeAttribute("data-dsham-has-status");let Ce=L.querySelector("."+ln);Ce===null&&(Ce=document.createElement("button"),Ce.type="button",Ce.className=ln,Ce.addEventListener("click",Ke=>{Ke.preventDefault(),Ke.stopPropagation(),a.toggle(L?.dataset.sessionId??"")}),L.appendChild(Ce));let He=Me.ids.has(ze);if(He?ee.setAttribute("data-dsham-favorited","true"):ee.removeAttribute("data-dsham-favorited"),L.dataset.favorited===String(He))continue;let ht=o()(He?"organizer.unfavorite":"organizer.favorite");L.dataset.favorited=String(He),Ce.setAttribute("aria-pressed",String(He)),Ce.setAttribute("aria-label",ht),Ce.title=ht,Ce.innerHTML=Ln(He)}},"ensureRowStars"),pe=e(q=>{let Me=a.getSnapshot();if(!f||!Me.ready){for(let L of q)L.hasAttribute(ke)&&L.removeAttribute(ke);z=0,d=null,oe.clear();return}let ee=q.map(L=>L.getAttribute("data-row-key")??""),Z=Er(Me.ids,n.workspaces.list?.getSnapshot?.()?.items??[]),ze=Cr(ee,{favorites:Me.ids,sessions:n.sessions.list?.getSnapshot?.()?.byId,groupHasFavorite:Z});d!==null&&(q.length<=d.rows&&oe.add(d.key),d=null);let at=!1;if(z<O)for(let L=0;L<q.length;L+=1){let je=q[L],Ce=ee[L];if(!Ce.startsWith("overflow:")||je.getAttribute("aria-expanded")!=="false")continue;let He=Ce.slice(9);if(!(oe.has(He)||!Z(He))){try{je.click(),z+=1,d={key:He,rows:q.length},at=!0}catch(ht){console.warn("archive-manager: favorites-only expand failed",ht)}break}}for(let L=0;L<q.length;L+=1){let je=q[L];ze[L]?je.hasAttribute(ke)&&je.removeAttribute(ke):je.setAttribute(ke,"true")}at&&ct()},"applyVisibility"),kt=e(q=>{let Me=q.parentElement;if(Me===null)return null;let ee=Me.cloneNode(!0),Z=ee.querySelector('button[role="menuitem"]');if(Z===null)return null;let ze=Array.from(Z.querySelectorAll("span")),at=ze[0]??null,L=ze[ze.length-1]??null;at!==null&&(at.innerHTML=Ln(!1)),L!==null&&(L.textContent=o()("organizer.favoritesOnly"));for(let je of Array.from(Z.querySelectorAll("svg")))je.closest("span")===null&&je.remove();return Z.setAttribute(ot,"true"),Z.setAttribute("role","menuitemcheckbox"),Z.dataset.active=String(f),Z.setAttribute("aria-checked",String(f)),Z.setAttribute("aria-label",o()("organizer.favoritesOnly")),Z.onclick=je=>{je.preventDefault(),je.stopPropagation(),cn(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0}))},ee},"buildMenuRow"),ut=e(()=>{if(!E){for(let q of Array.from(document.querySelectorAll("button["+ot+"]")))q.dataset.active=String(f),q.setAttribute("aria-checked",String(f));for(let q of Array.from(document.querySelectorAll('[role="menu"]'))){let Me=Array.from(q.querySelectorAll('button[role="menuitem"]')).find(ze=>ea.some(at=>(ze.textContent??"").includes(at)));if(Me===void 0||q.querySelector("["+ot+"]")!==null)continue;let ee=Me.parentElement;if(ee===null)continue;let Z=kt(Me);Z!==null&&ee.parentElement?.insertBefore(Z,ee.nextSibling)}}},"injectMenuRows"),ct=e(()=>{if(N||E)return;N=!0;let q=e(()=>{if(N=!1,E)return;let Me=Array.from(document.querySelectorAll("[data-row-key]"));ut(),Re(Me),pe(Me),a.getSnapshot().ready||dn()},"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(q):setTimeout(q,16)},"schedulePass"),cn=e(()=>{f=!f,Ge=20,z=0,d=null,oe.clear(),na(f),ct()},"toggle"),st=null,Ge=20,dn=e(()=>{st!==null||E||Ge<=0||(Ge-=1,st=setTimeout(()=>{st=null,a.ensure(),ct()},600))},"scheduleRetry"),At=new MutationObserver(q=>{Wn(q,'[data-row-key], [role="menu"]')&&ct()});At.observe(document.body,{childList:!0,subtree:!0}),a.ensure().catch(()=>{});let Mt=[a.subscribe(()=>ct()),typeof n.sessions.list?.subscribe=="function"?n.sessions.list.subscribe(()=>ct()):null,typeof n.workspaces.list?.subscribe=="function"?n.workspaces.list.subscribe(()=>ct()):null].filter(q=>typeof q=="function");return ct(),{dispose(){E=!0,typeof window<"u"&&typeof window.removeEventListener=="function"&&window.removeEventListener("dsham-favorite-star-toggle",A),At.disconnect();for(let q of Mt)q();for(let q of Array.from(document.querySelectorAll("["+ke+"]")))q.removeAttribute(ke);for(let q of Array.from(document.querySelectorAll("["+ot+"]")))q.parentElement?.remove();for(let q of Array.from(document.querySelectorAll("."+Pn)))q.remove();for(let q of Array.from(document.querySelectorAll("[data-dsham-favorited]")))q.removeAttribute("data-dsham-favorited");for(let q of Array.from(document.querySelectorAll("[data-dsham-has-status]")))q.removeAttribute("data-dsham-has-status");st!==null&&(clearTimeout(st),st=null)},setFavoriteStarEnabled(q){k=q,H(),ct()},isFavoriteStarEnabled:e(()=>k,"isFavoriteStarEnabled")}}e(Ir,"setupWorkspaceFavoritesOnly");function Tr(){let n,a={ready:!1,ids:new Set,pending:new Set},o,h=0,v=new Set,f=e(E=>{a=E;for(let N of v)try{N()}catch(H){console.warn("archive-manager: favorite listener failed",H)}},"publish"),k=e((E,N)=>{let H=new Set(E);for(let d of a.pending)d!==N&&(a.ids.has(d)?H.add(d):H.delete(d));let A=new Set(a.pending);N!==void 0?A.delete(N):a.pending.size===0&&A.clear();let z=a.ids.size===H.size&&[...H].every(d=>a.ids.has(d)),O=a.pending.size===A.size&&[...A].every(d=>a.pending.has(d));z&&O&&a.ready||f({ready:!0,ids:H,pending:A})},"adopt");return{bind(E){n=E},subscribe(E){return v.add(E),()=>{v.delete(E)}},getSnapshot:e(()=>a,"getSnapshot"),adopt:e(E=>k(E),"adopt"),ensure(){return n===void 0||a.ready?Promise.resolve():o!==void 0?o:Date.now()<h?Promise.resolve():(o=n.favoriteSessions().then(E=>{k(E.favoriteSessionIds)}).catch(E=>{console.warn("archive-manager: load favorites failed, will retry",E),h=Date.now()+600}).finally(()=>{o=void 0}),o)},async toggle(E){if(n===void 0||!a.ready||a.pending.has(E))return;let N=a.ids.has(E),H=!N,A=new Set(a.ids);H?A.add(E):A.delete(E);let z=new Set(a.pending);z.add(E),f({ready:!0,ids:A,pending:z});try{let O=await n.setSessionFavorite({sessionId:E,favorite:H});if(!Array.isArray(O?.favoriteSessionIds))throw new TypeError("favorite response is missing favoriteSessionIds");k(O.favoriteSessionIds,E)}catch(O){console.warn("archive-manager: sidebar favorite toggle failed",O);let d=new Set(a.ids);N?d.add(E):d.delete(E);let oe=new Set(a.pending);oe.delete(E),f({ready:!0,ids:d,pending:oe})}}}}e(Tr,"createFavoriteRowStore");function ra(){return(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,"aria-hidden":!0,focusable:"false",children:(0,s.jsx)("path",{fill:"currentColor",d:"M8 0a8 8 0 0 0-2.53 15.59c.4.074.547-.173.547-.385 0-.19-.007-.693-.01-1.36-2.226.484-2.695-1.073-2.695-1.073-.364-.924-.89-1.17-.89-1.17-.726-.496.055-.486.055-.486.803.056 1.225.824 1.225.824.714 1.223 1.872.87 2.328.665.072-.517.28-.87.508-1.07-1.777-.202-3.645-.888-3.645-3.956 0-.874.31-1.588.823-2.148-.083-.202-.357-1.017.078-2.12 0 0 .672-.215 2.2.82A7.65 7.65 0 0 1 8 4.8c.68.003 1.365.092 2.004.27 1.527-1.035 2.197-.82 2.197-.82.437 1.103.162 1.918.08 2.12.513.56.822 1.274.822 2.148 0 3.076-1.872 3.752-3.654 3.95.288.248.544.735.544 1.482 0 1.07-.01 1.932-.01 2.195 0 .214.144.463.55.384A8.001 8.001 0 0 0 8 0Z"})})}e(ra,"GithubMark16");function sa(){let n=u.IconEditOutlineRegular;return(0,s.jsx)(n,{size:16})}e(sa,"FeedbackIcon");function On({archiveSessions:n,archiveSession:a,sessionStore:o,workspaceStore:h,unarchiveSession:v,deleteSession:f,unarchiveSessions:k,deleteArchivedSessions:E,archivedSessionMetadata:N,openConversation:H,focusSessionWorkspace:A,viewState:z,close:O,t:d,diagnoseOrphanSubagents:oe,cleanOrphanSubagents:Re,diagnoseSessionCaches:pe,rebuildSessionCaches:kt,refreshCacheLists:ut,searchSessionContent:ct,searchArchivedContent:cn,previewArchivedSession:st,favoriteSessions:Ge,setSessionFavorite:dn,favoriteSync:At,organizeBatch:Mt,useSessionPendingInteraction:q,useSessionStatus:Me}){let ee=(0,l.useSyncExternalStore)(o.subscribe,o.getSnapshot),Z=(0,l.useSyncExternalStore)(h.subscribe,h.getSnapshot),[ze,at]=(0,l.useState)("archived"),L=ze==="archived",[je,Ce]=(0,l.useState)(null),[He,ht]=(0,l.useState)(null),[Ke,zt]=(0,l.useState)(null),yn=e((c,S=null)=>{G(null),Be(null),We(!1),ht(S),Ce(c)},"requestArchive"),Vt=e(()=>{Q||(Ce(null),ht(null),G(null))},"closeArchive"),Ct=(0,l.useRef)(!1),[Te,$t]=(0,l.useState)(null),wn=(0,l.useRef)(!1),[Q,nt]=(0,l.useState)(!1),[_t,G]=(0,l.useState)(null),[Gt,Be]=(0,l.useState)(null),un=e(c=>{G(null),Be(null),$t(c)},"requestDelete"),[Pt,Sn]=(0,l.useState)(z?.query??""),[Et,Kt]=(0,l.useState)(z?.project??"all"),[Ot,xn]=(0,l.useState)(z?.sortBy??"updated"),[kn,Cn]=(0,l.useState)({}),[Yt,En]=(0,l.useState)(()=>new Set),Dt=(0,l.useRef)(new Set),[pt,Rt]=(0,l.useState)([]),[nn,Ft]=(0,l.useState)([]),[It,jt]=(0,l.useState)(!1),[Ut,In]=(0,l.useState)(!1),rn=(0,l.useRef)(!1),[Zt,Tn]=(0,l.useState)(!1),[p,b]=l.useState("content"),[I,$]=l.useState(""),[ye,se]=l.useState(""),[ge,de]=(0,l.useState)(()=>new Set),[ae,Ne]=(0,l.useState)("30"),[Ue,We]=(0,l.useState)(!1),[Ae,te]=(0,l.useState)(null),[ne,M]=(0,l.useState)(null),[K,ve]=(0,l.useState)([]),Y=(0,l.useRef)(!1),be=(0,l.useRef)(null),Ee=pa(q??da,Me??ua,typeof Me=="function"),Ye=(0,l.useRef)(Ee.pending);Ye.current=Ee.pending;let Ze=(0,l.useMemo)(()=>new Set(nn),[nn]),qe=e(async()=>{if(Ge)try{let c=await Ge();Ft(c.favoriteSessionIds),jt(!0),At?.adopt(c.favoriteSessionIds)}catch(c){jt(!1),G(Oe(c))}},"loadFavorites");(0,l.useEffect)(()=>{let c=!0;return Ge&&Ge().then(S=>{c&&(Ft(S.favoriteSessionIds),jt(!0),At?.adopt(S.favoriteSessionIds))}).catch(S=>{c&&G(Oe(S))}),()=>{c=!1}},[Ge]),(0,l.useEffect)(()=>{if(At)return At.subscribe(()=>{let c=At.getSnapshot();c.ready&&(Ft([...c.ids]),jt(!0))})},[At]);let Le=e(async c=>{if(!(rn.current||Q||!It)){rn.current=!0,In(!0),G(null);try{let S=await dn({sessionId:c,favorite:!Ze.has(c)});Ft(S.favoriteSessionIds),At?.adopt(S.favoriteSessionIds)}catch(S){G(Oe(S))}finally{rn.current=!1,In(!1)}}},"toggleFavorite"),Pe=e(async(c,S,{idle:J=!1,retry:Se=!1}={})=>{if(!(Y.current||rn.current||Dt.current.size>0||!Mt)){Y.current=!0,nt(!0),G(null),Be(null),M(null),c==="archive"&&!Se&&ve([]);try{let R=await Mt(c,S,{idleDays:J?Number(ae):void 0,getPending:e(()=>Ye.current,"getPending"),onProgress:e(xe=>{te(xe),c==="archive"&&xe.total>0&&xe.done>=xe.total&&(Ce(null),ht(null),We(!1))},"onProgress")});return M({...R,kind:c,tab:ze}),be.current=R.remaining.length?{kind:c,ids:R.remaining,idle:J}:null,c==="archive"&&ve(xe=>[...new Set([...xe,...R.succeeded])]),(c==="undo"||c==="restore"||c==="delete")&&ve(xe=>xe.filter(bt=>!R.succeeded.includes(bt)&&!R.skipped.includes(bt))),Rt(xe=>xe.filter(bt=>!R.succeeded.includes(bt)&&!R.skipped.includes(bt))),c==="delete"&&Ft(xe=>xe.filter(bt=>!R.succeeded.includes(bt))),R}catch(R){G(Oe(R))}finally{Y.current=!1,nt(!1),te(null)}}},"executeBatch"),[we,rt]=(0,l.useState)(null),[Je,Ie]=(0,l.useState)({diagnosis:{count:0,items:[]},busy:!1,progress:null,result:null,error:null,refreshError:null}),Ve=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(!pe||!kt||!ut)return;let c=js({diagnose:pe,rebuild:kt,refresh:ut});Ve.current=c;let S=c.subscribe(()=>{Ie(c.snapshot())});return c.load(),()=>{S(),c.dispose(),Ve.current=null}},[pe,kt,ut]),(0,l.useEffect)(()=>{Ve.current?.snapshot().busy||Ve.current?.load()},[Z.archivedSessionIds]);let mt=e(async(c=!1)=>{if(!(Q||Y.current||!Ve.current||Ve.current.snapshot().busy)){Y.current=!0,nt(!0);try{await Ve.current.run(c)}finally{Y.current=!1,gt.current&&nt(!1)}}},"runCacheRebuild"),[wt,hn]=(0,l.useState)(!1),Xe=e(()=>{typeof oe=="function"&&oe().then(rt).catch(c=>{console.warn("archive-manager: diagnose orphan subagents failed",c)})},"loadOrphans");(0,l.useEffect)(()=>{Xe()},[Z.archivedSessionIds]);let ft=e(async()=>{if(!(wt||typeof Re!="function")){hn(!0),G(null),Be(null);try{let c=await Re({});(c.cleanedSessionIds.length>0||c.skippedSessionIds.length>0)&&Xe(),c.failures.length>0?(Be(null),G(Hn(c.failures,d))):c.cleanedSessionIds.length>0&&(G(null),Be(d("organizer.orphanCleanSuccess",{n:c.cleanedSessionIds.length})))}catch(c){G(Oe(c))}finally{hn(!1)}}},"cleanOrphans"),gt=(0,l.useRef)(!0),sn=(0,l.useRef)(!1);(0,l.useEffect)(()=>(gt.current=!0,()=>{gt.current=!1}),[]);let Jt=e(async(c,S=!1)=>{if(Q||sn.current)return;sn.current=!0,nt(!0),G(null);let J=!1;try{await Ms({prepare:S?async Se=>{await A?.(Se)}:void 0,restore:e(async Se=>{await v(Se),J=!0},"restore"),open:e(async Se=>{await H(Se),gt.current&&O?.()},"open")},c.id,S,()=>gt.current)}catch(Se){if(!gt.current)return;if(J){at("unarchived");let R=Tt.find(xe=>xe.sessions.some(bt=>bt.id===c.id));R!==void 0&&Kt(R.key)}G(Ns(Se,d))}finally{sn.current=!1,gt.current&&nt(!1)}},"viewConversation");(0,l.useEffect)(()=>{z&&Object.assign(z,{query:Pt,project:Et,sortBy:Ot})},[Pt,Et,Ot,z]);let vt=(0,l.useMemo)(()=>L?Z.archivedSessionIds:$r(ee.byId,Z.archivedSessionIds),[L,ee.byId,Z.archivedSessionIds]),Tt=(0,l.useMemo)(()=>Gr(ee.byId,Z.items,vt,d("group.ungrouped")),[ee.byId,Z,vt,d]),An=e(c=>{Q||Dt.current.size>0||(Lt.close(),at(c),Rt([]),Ce(null),ht(null),G(null),Be(null),Kt("all"),Sn(""),c!=="archived"&&Ot==="archived"&&xn("updated"))},"switchTab"),Xt=e(async(c,S=!1)=>{if(!(Ct.current||Q||!c?.length)){if(Mt){Ct.current=!0;try{let J=await Pe("archive",c,{idle:S}),Se=J?.failures.map(R=>Nr(R.sessionId,R.message)).find(R=>R!==void 0);if(Se!==void 0&&typeof a=="function"){let R=ee.byId[Se.sessionId];zt({sessionId:Se.sessionId,title:R===void 0?Se.sessionId:lt(R,d),kinds:Se.kinds.join(", ")}),Ce(null),ht(null),G(null);return}J&&(Ce(null),ht(null),We(!1))}finally{Ct.current=!1}return}Ct.current=!0,nt(!0),G(null),Be(null);try{let J=await n(c);Ce(null),ht(null),J.archivedSessionIdsAdded.length>0&&Be(d("archives.archiveSuccess",{n:J.archivedSessionIdsAdded.length})),J.failures&&J.failures.length>0?G(Hn(J.failures,d)):(Rt([]),at("archived"),Kt("all"),Sn(""))}catch(J){let Se=jr(J);if(Se!==void 0&&typeof a=="function"){let R=ee.byId[Se.sessionId];zt({sessionId:Se.sessionId,title:R===void 0?Se.sessionId:lt(R,d),kinds:Se.kinds.join(", ")}),Ce(null),ht(null),G(null)}else{let R=Bn(J);G(R===void 0?d("archives.archiveBatchFailed",{detail:J instanceof Error?J.message:String(J)}):d("archives.archiveActive",{kinds:R.join(", ")}))}}finally{Ct.current=!1,nt(!1)}}},"performArchive"),pn=e(()=>Xt(je,Ue),"confirmArchive"),Na=e(async c=>{G(null),Be(null);try{await Yn(c.id),gt.current&&Be(d("details.copied"))}catch(S){gt.current&&G(typeof $n(S)=="string"&&String($n(S)).startsWith("copy.")?d(String($n(S))):Oe(S))}},"copyId"),ir=(0,l.useMemo)(()=>Kr(Tt,Ot,kn,d,L?Z.archivedSessionIds:void 0),[Tt,Ot,kn,d,L,Z.archivedSessionIds]);(0,l.useEffect)(()=>{if(Q)return;let c=!1;return N().then(S=>{c||Cn(Object.fromEntries(S.items.map(J=>[J.sessionId,J.createdAt])))}).catch(()=>{c||Cn({})}),()=>{c=!0}},[N,Z.archivedSessionIds,Q]),(0,l.useEffect)(()=>{Et!=="all"&&!Tt.some(c=>c.key===Et)&&Kt("all")},[Tt,Et]);let ns=!mr(I,ye),rs=ir.filter(c=>Et==="all"||Et===c.key).map(c=>({...c,sessions:c.sessions.filter(S=>(!Zt||Ze.has(S.id))&&xs(S.updatedAt,I,ye))})).filter(c=>c.sessions.length),or=p==="content"&&!ns,_n=P(rs.flatMap(c=>c.sessions.map(S=>S.id)),Pt,or,ct??cn),lr=new Map(_n.items.map(c=>[c.sessionId,c])),Lt=B(st,L?Z.archivedSessionIds:[]),ss=Pt.trim().toLocaleLowerCase(),Rn=rs.map(c=>({...c,sessions:c.sessions.filter(S=>!ss||lt(S,d).toLocaleLowerCase().includes(ss)||lr.has(S.id))})).filter(c=>c.sessions.length),as=It?Rn.flatMap(c=>c.sessions).filter(c=>kr(c,{days:Number(ae),favorites:Ze,currentId:Zn(ee),pending:Ee.pending})).map(c=>c.id):[],jn=(0,l.useMemo)(()=>Wr(Rn),[Rn]),cr=(0,l.useMemo)(()=>new Set(pt),[pt]),Ma=(0,l.useMemo)(()=>{let c=new Set(Z.archivedSessionIds);return K.reduce((S,J)=>S+(c.has(J)?1:0),0)},[K,Z.archivedSessionIds]),dr=jn.filter(c=>cr.has(c)).length,Da=jn.length>0&&dr===jn.length;(0,l.useEffect)(()=>{Rt(c=>qr(c,vt))},[vt]);let La=e((c,S)=>{Rt(J=>rr(J,[c],S))},"toggleSessionSelection"),za=e(c=>{Rt(S=>rr(S,jn,c))},"toggleVisibleSelection"),Pa=e(c=>{Q||Dt.current.has(c)||(Dt.current.add(c),En(new Set(Dt.current)),G(null),Be(null),v(c).catch(S=>{G(_r(S,d))}).finally(()=>{Dt.current.delete(c),En(new Set(Dt.current))}))},"onUnarchive"),is=e(async c=>{if(!Q){if(Mt){let S=bn(Z.archivedSessionIds,Z.items,c),J=await Pe("restore",S);return J&&{unarchivedSessionIds:J.succeeded}}nt(!0),G(null),Be(null);try{let S=await k(c);return S.unarchivedSessionIds.length>0&&Be(d("archives.restoreSuccess",{n:S.unarchivedSessionIds.length})),S.failures&&S.failures.length>0&&G(Hn(S.failures,d,_r)),S}catch(S){G(d("archives.restoreBatchFailed",{detail:S instanceof Error?S.message:String(S)}))}finally{nt(!1)}}},"onBatchUnarchive"),Oa=e(async()=>{if(pt.length===0)return;let c=await is({scope:"sessions",sessionIds:pt});if(c!==void 0){let S=new Set(c.unarchivedSessionIds);Rt(J=>J.filter(Se=>!S.has(Se)))}},"onSelectedUnarchive"),os=e(()=>{Q||$t(null)},"closeDelete");(0,l.useEffect)(()=>{if(Te===null)return;let c=e(S=>{S.key==="Escape"&&(S.preventDefault(),S.stopPropagation(),"stopImmediatePropagation"in S&&typeof S.stopImmediatePropagation=="function"&&S.stopImmediatePropagation(),Q||$t(null))},"onKeyDown");return window.addEventListener("keydown",c,!0),()=>window.removeEventListener("keydown",c,!0)},[Te,Q]);let Fa=e(async()=>{if(Q||wn.current||Te===null)return;if(Te.kind!=="batch"){wn.current=!0,nt(!0),G(null),Be(null);try{await f(Te.session.id),$t(null)}catch(S){G(Xn(S,d))}finally{wn.current=!1,nt(!1)}return}if(Y.current||rn.current||Dt.current.size>0)return;let{target:c}=Te;if(c.scope==="sessions"&&bn(Z.archivedSessionIds,Z.items,c).length===0){$t(null);return}Y.current=!0,nt(!0),G(null),Be(null),M(null),te(null);try{let S=await E(c),J=Vr(S,d);J.kind==="error"?G(J.message):Be(J.message);let Se=new Set([...S.deletedSessionIds,...S.skippedSessionIds]);ve(xe=>xe.filter(bt=>!Se.has(bt))),Rt(xe=>xe.filter(bt=>!Se.has(bt))),Ft(xe=>xe.filter(bt=>!Se.has(bt)));let R=S.failures.map(xe=>xe.sessionId);be.current=R.length>0?{kind:"delete",ids:R,idle:!1}:null,M({requested:S.requestedSessionIds,succeeded:S.deletedSessionIds,skipped:S.skippedSessionIds,failures:S.failures,remaining:R,refreshError:"refreshError"in S&&typeof S.refreshError=="string"?S.refreshError:null,kind:"delete",tab:ze}),$t(null)}catch(S){G(Xn(S,d))}finally{Y.current=!1,nt(!1)}},"confirmDelete"),Wt=Te?.kind==="batch"?Te.target.scope:null,Ha=Wt==="ungrouped"?d("archives.deleteUngroupedTitle"):Wt==="workspace"?d("archives.deleteProjectTitle",{name:Te?.kind==="batch"?Te.title:""}):d(Wt==="sessions"?"archives.deleteSelectedTitle":"deleteSession.title"),ls=Te===null?void 0:Wt==="ungrouped"?d("archives.deleteUngroupedDesc",{n:Te.kind==="batch"?Te.count:0}):Wt==="workspace"?d("archives.deleteProjectDesc",{name:Te?.kind==="batch"?Te.title:"",n:Te.kind==="batch"?Te.count:0}):Wt==="sessions"?d("archives.deleteSelectedDesc",{n:Te.kind==="batch"?Te.count:0}):d("deleteSession.desc",{name:lt(Te.kind==="session"?Te.session:{},d)}),Ba=d(Wt==="ungrouped"?"archives.deleteUngroupedConfirm":Wt==="workspace"?"archives.deleteProjectConfirm":Wt==="sessions"?"archives.deleteSelectedConfirm":"deleteSession.title");return(0,s.jsxs)("section",{className:"dsham_settings","aria-label":d("archives.title"),children:[(0,s.jsx)("style",{children:fa+ba+ya+wa+Sa}),(0,s.jsxs)("div",{className:"dsham_settingsHeader",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"dsham_settingsTitleRow",children:[(0,s.jsx)("h2",{children:d("archives.title")}),(0,s.jsxs)("div",{className:"dsham_settingsLinks",children:[(0,s.jsx)(u.Button,{variant:"outline",size:"sm","aria-label":d("archives.viewProject"),icon:(0,s.jsx)(ra,{}),onClick:e(()=>window.open("https://github.com/MichengAI/dsh-archive-manager","_blank","noreferrer"),"onClick"),children:d("archives.viewProject")}),(0,s.jsx)(u.Button,{variant:"outline",size:"sm","aria-label":d("archives.feedback"),icon:(0,s.jsx)(sa,{}),onClick:e(()=>window.open("https://github.com/MichengAI/dsh-archive-manager/issues","_blank","noreferrer"),"onClick"),children:d("archives.feedback")})]})]}),(0,s.jsx)("p",{className:"dsham_settingsIntro",children:d("archives.description")})]}),l.createElement("div",D(Q||Yt.size>0,(0,s.jsx)(u.SegmentedTabs,{className:"dsham_archiveTabs",label:d("archives.title"),value:ze==="unarchived"?"unarchived":"archived",onChange:e(c=>An(c==="unarchived"?"unarchived":"archived"),"onChange"),items:[{value:"archived",label:(0,s.jsxs)("span",{className:"dsham_tabLabel",children:[(0,s.jsx)(u.IconArchiveOutlineMedium,{size:14}),(0,s.jsx)("span",{children:d("archives.tab.archived")})]}),id:"dsham-tab-archived",panelId:"dsham-archive-panel"},{value:"unarchived",label:(0,s.jsxs)("span",{className:"dsham_tabLabel",children:[(0,s.jsx)(u.IconFolderCloseMedium,{size:14}),(0,s.jsx)("span",{children:d("archives.tab.unarchived")})]}),id:"dsham-tab-unarchived",panelId:"dsham-archive-panel"}]})))]}),(0,s.jsxs)("div",{id:"dsham-archive-panel",role:"region","aria-label":d(ze==="unarchived"?"archives.tab.unarchived":"archives.tab.archived"),children:[(0,s.jsx)("div",{className:"dsham_settingsToolbar",children:(0,s.jsxs)("div",{className:"dsham_settingsSearch",children:[(0,s.jsx)(nr,{id:"dsham-favorite-filter",className:"dsham_srOnly",tabIndex:-1,"aria-hidden":!0,value:Zt?"favorites":"all",options:[{value:"all",label:d("organizer.allSessions")},{value:"favorites",label:d("organizer.favoritesOnly")}],onChange:e(c=>typeof Tn=="function"&&Tn(c==="favorites"),"onChange"),"aria-label":d("organizer.favoriteFilter")}),(0,s.jsx)(nr,{id:"dsham-search-scope",className:"dsham_srOnly",tabIndex:-1,"aria-hidden":!0,value:p,options:[{value:"title",label:d("discovery.titleOnly")},{value:"content",label:d("discovery.titleAndContent")}],onChange:e(c=>typeof b=="function"&&b(c),"onChange"),"aria-label":d("discovery.scope")}),(0,s.jsx)(u.Input,{id:"dsham-search-input",className:"dsham_searchField",type:"search",icon:(0,s.jsx)(u.IconSearchOutlineMedium,{size:16,"aria-hidden":!0}),autoComplete:"off",spellCheck:!1,maxLength:200,value:Pt,onChange:e(c=>Sn(c.target.value),"onChange"),placeholder:d(or?"discovery.searchPlaceholder":L?"archives.searchPlaceholder":"archives.searchUnarchived"),"aria-label":d(or?"discovery.searchPlaceholder":L?"archives.searchPlaceholder":"archives.searchUnarchived")}),(0,s.jsx)(xa,{id:"dsham-sort-filter",t:d,disabled:Q,favoritesOnly:Zt,setFavoritesOnly:Tn,favoriteBusy:Q||Ut||!It,sortBy:!L&&Ot==="archived"?"updated":Ot,setSortBy:xn,options:[...L?[{value:"archived",label:d("archives.sortArchived")}]:[],{value:"updated",label:d("archives.sortUpdated")},{value:"created",label:d("archives.sortCreated")},{value:"alphabetical",label:d("archives.sortAlphabetical")}]}),(0,s.jsx)(nr,{id:"dsham-project-filter",className:"dsham_projectFilter",value:Et,title:Et==="all"?d("archives.allProjects"):ir.find(c=>c.key===Et)?.title??Et,options:[{value:"all",label:d("archives.allProjects")||"\u6240\u6709\u9879\u76EE",title:d("archives.allProjects")},...ir.map(c=>({value:c.key,label:c.title,title:c.title}))],onChange:Kt,"aria-label":d("archives.projectFilter")}),l.createElement(me,{t:d,from:I,to:ye,onFrom:$,onTo:se,invalid:ns,onClear:e(()=>{$(""),se("")},"onClear")})]})}),l.createElement("style",null,Es),l.createElement(le,{state:_n,t:d}),Mt&&(0,s.jsx)(j,{t:d,archived:L,busy:Q||Ut||Yt.size>0,ready:It,days:ae,onDays:Ne,count:as.length,onPreview:e(()=>{yn(as),We(!0)},"onPreview"),progress:Ae,result:ne?.tab===ze?ne:null,onRetry:e(()=>{let c=be.current;c&&(c.kind==="delete"?un({kind:"batch",target:{scope:"sessions",sessionIds:c.ids},count:c.ids.length}):Pe(c.kind,c.ids,{idle:c.idle,retry:!0}))},"onRetry"),undoCount:Ma,onUndo:e(()=>Pe("undo",K,{retry:!0}),"onUndo"),onReload:qe,orphanCount:we?.count??0,cacheCount:Je.diagnosis.count,cacheRepair:Je,onRebuildCaches:e(()=>mt(),"onRebuildCaches"),onRetryCaches:e(()=>mt(!0),"onRetryCaches"),onReloadCaches:e(async()=>{try{await ut?.(),await Ve.current?.load(),(Ve.current?.snapshot().diagnosis.count??0)===0&&Ve.current?.dismiss()}catch(c){gt.current&&G(Oe(c))}},"onReloadCaches"),onDismissCaches:e(()=>Ve.current?.dismiss(),"onDismissCaches"),orphanSizeBytes:we?.totalSizeBytes??0,orphanCleaning:wt,onCleanOrphans:ft}),Tt.length>0&&(0,s.jsx)(Hr,{selectedCount:pt.length,hiddenCount:pt.length-dr,allVisibleSelected:Da,selectedVisibleCount:dr,visibleCount:jn.length,busy:Q,t:d,onToggle:za,onClear:e(()=>Rt([]),"onClear"),onArchive:L?void 0:()=>yn([...pt]),onRestore:Oa,onDelete:e(()=>un({kind:"batch",target:{scope:"sessions",sessionIds:pt},count:pt.length}),"onDelete")}),Tt.length===0?(0,s.jsx)("div",{className:"dsham_settingsEmpty",children:d(L?"archives.empty":"archives.emptyUnarchived")}):Rn.length===0?(0,s.jsx)("div",{className:"dsham_settingsEmpty",children:_n.status==="loading"||_n.status==="error"||_n.failures.length?null:d("archives.emptyFiltered")}):Rn.map(c=>{let S=Ea(c.key),J=Tt.find(R=>R.key===c.key)?.sessions.map(R=>R.id)??[],Se=L?bn(Z.archivedSessionIds,Z.items,S).length:J.length;return(0,s.jsxs)("section",{className:"dsham_settingsGroup",children:[(0,s.jsxs)("div",{className:"dsham_settingsGroupHeading",children:[(0,s.jsx)("h3",{className:"dsham_settingsGroupTitle",children:(0,s.jsxs)("button",{type:"button",className:"dsham_groupToggle","aria-expanded":!ge.has(c.key),"aria-controls":"dsham-group-"+encodeURIComponent(c.key),onClick:e(()=>de(R=>{let xe=new Set(R);return xe.has(c.key)?xe.delete(c.key):xe.add(c.key),xe}),"onClick"),children:[(0,s.jsx)(ge.has(c.key)?u.IconChevronRightOutlineMedium:u.IconChevronDownOutlineMedium,{}),(0,s.jsx)(ge.has(c.key)?u.IconFolderCloseMedium:u.IconFolderOpenOutlineMedium,{}),(0,s.jsx)("span",{children:c.title})]})}),(0,s.jsxs)("div",{className:"dsham_settingsGroupMeta",children:[(0,s.jsx)("span",{className:"dsham_settingsCount",children:d("archives.sessionCount",{n:c.sessions.length})}),(0,s.jsx)(Ca,{group:c,busy:Q,onArchive:L?void 0:()=>yn(J,c),onRestore:e(()=>is(S),"onRestore"),onDelete:e(()=>un({kind:"batch",target:S,title:c.title,count:Se}),"onDelete"),t:d})]})]}),(0,s.jsx)("div",{className:"dsham_settingsList",id:"dsham-group-"+encodeURIComponent(c.key),hidden:ge.has(c.key)||void 0,children:!ge.has(c.key)&&c.sessions.map(R=>(0,s.jsxs)("div",{className:"dsham_settingsRow","data-selected":cr.has(R.id),children:[(0,s.jsx)(Br,{checked:cr.has(R.id),disabled:Q,label:d("archives.selectSession",{name:lt(R,d)}),onChange:e(xe=>La(R.id,xe.target.checked),"onChange")}),(0,s.jsxs)("div",{className:"dsham_settingsContent",children:[(0,s.jsx)("button",{type:"button",className:"dsham_settingsTitleLink",title:lt(R,d),"aria-label":d("archives.openSession")+d("common.separator")+lt(R,d),disabled:Q||Yt.has(R.id),onClick:e(()=>Jt(R),"onClick"),children:lt(R,d)}),(0,s.jsx)("div",{className:"dsham_settingsMeta",children:[ma(R.updatedAt,d)]}),lr.has(R.id)&&l.createElement("button",{type:"button",className:"dsham_settingsSnippet",disabled:Q,title:d(L?"discovery.preview":"archives.openSession"),onClick:e(()=>L?Lt.open(R,Pt):Jt(R),"onClick")},l.createElement(U,{text:lr.get(R.id)?.snippet??"",query:Pt}))]}),(0,s.jsxs)("div",{className:"dsham_settingsActions",children:[typeof dn=="function"&&g({variant:"outline",className:"dsham_iconAction"+(Ze.has(R.id)?" dsham_favoriteOn":""),title:d(Ze.has(R.id)?"organizer.unfavorite":"organizer.favorite"),"aria-pressed":Ze.has(R.id),"aria-label":d(Ze.has(R.id)?"organizer.unfavorite":"organizer.favorite")+d("common.separator")+lt(R,d),disabled:Q||Ut||!It,onClick:e(()=>Le(R.id),"onClick"),children:(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:Ze.has(R.id)?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round","aria-hidden":!0,style:{display:"block"},children:(0,s.jsx)("path",{d:Ht})})}),g({variant:"outline",className:"dsham_iconAction",title:d(L?"archives.restore":"archives.archiveSelected"),"aria-label":d(L?"archives.restore":"archives.archiveSelected"),disabled:Q||Yt.has(R.id),onClick:e(()=>L?Pa(R.id):Xt([R.id]),"onClick"),icon:(0,s.jsx)(L?u.IconRefreshOutlineMedium:u.IconArchiveOutlineMedium,{size:16})}),L&&(0,s.jsx)(ka,{busy:Q||Yt.has(R.id),t:d,title:lt(R,d),onCopyId:e(()=>Na(R),"onCopyId"),onPreview:typeof st=="function"?()=>Lt.open(R,Pt):void 0,onRestoreOpen:e(()=>Jt(R,!0),"onRestoreOpen"),onDelete:e(()=>un({kind:"session",session:R}),"onDelete")})]})]},R.id))})]},c.key)}),l.createElement(_,{width:900,className:"dsham_modalWide",portalToBody:!0,t:d,open:Lt.target!==null,onClose:Lt.close,title:Lt.target?lt(Lt.target.session,d):d("discovery.preview"),footer:w({variant:"primary",disabled:Q,onClick:e(()=>{if(Lt.target){let c=Lt.target.session;return Lt.close(),Jt(c)}},"onClick"),children:d("discovery.openFull")}),children:l.createElement(V,{preview:Lt,t:d,MarkdownText:u.MarkdownText})}),je===null&&_t!==null&&(0,s.jsx)("div",{className:"dsham_settingsError",role:"alert",children:_t}),Gt!==null&&(0,s.jsx)("div",{className:"dsham_settingsStatus",role:"status",children:Gt}),(0,s.jsx)(_,{t:d,open:je!==null,onClose:Vt,title:d("archives.archiveTitle",{n:je?.length??0}),description:He===null?d("archives.archiveSelectedDesc"):d(He.key===qn?"archives.archiveUngroupedDesc":"archives.archiveProjectDesc",{name:He.title,n:je?.length??0}),footer:(0,s.jsxs)(s.Fragment,{children:[w({disabled:Q,onClick:Vt,children:d("cancel")}),w({variant:"primary",disabled:Q||!je?.length,onClick:pn,children:d("archives.archiveSelected")})]}),children:(0,s.jsxs)(s.Fragment,{children:[Mt&&(0,s.jsx)("p",{children:d(Ue?"organizer.idleConfirm":"organizer.manualConfirm")}),Mt&&(0,s.jsx)("div",{className:"dsham_archivePreview",children:(je??[]).map(c=>(0,s.jsxs)("label",{children:[(0,s.jsx)(ur,{checked:!0,disabled:Q,label:lt(ee.byId[c]??{id:c},d),onChange:e(()=>Ce(S=>(S??[]).filter(J=>J!==c)),"onChange")}),lt(ee.byId[c]??{id:c},d)]},c))}),Ae&&(0,s.jsxs)("div",{role:"status",children:[(0,s.jsx)("progress",{value:Ae.done,max:Math.max(1,Ae.total)}),d("organizer.progressCount",{done:Ae.done,total:Ae.total})]}),_t!==null&&(0,s.jsx)("div",{className:"dsham_settingsError",role:"alert",children:_t})]})}),(0,s.jsx)(_,{t:d,open:Ke!==null,onClose:e(()=>{Q||(zt(null),G(null))},"onClose"),title:d("archiveActive.title"),...Ke===null?{}:{description:d("archiveActive.desc",{name:Ke.title,kinds:Ke.kinds})},footer:(0,s.jsxs)(s.Fragment,{children:[w({disabled:Q,onClick:e(()=>{Q||(zt(null),G(null))},"onClick"),children:d("cancel")}),w({danger:!0,disabled:Q,onClick:e(async()=>{if(!(Ct.current||Q||Ke===null||typeof a!="function")){Ct.current=!0,nt(!0),G(null);try{await a(Ke.sessionId,{stopActivity:!0}),Rt(c=>c.filter(S=>Ke===null||S!==Ke.sessionId)),at("archived"),Be(d("archives.archiveSuccess",{n:1})),zt(null)}catch(c){G(c instanceof Error?c.message:String(c))}finally{Ct.current=!1,nt(!1)}}},"onClick"),children:d("archiveActive.confirm")})]}),children:_t!==null&&(0,s.jsx)("div",{className:"dsham_settingsError",role:"alert",children:_t})}),(0,s.jsx)(_,{t:d,open:Te!==null,onClose:os,title:Ha,...ls===void 0?{}:{description:ls},footer:(0,s.jsxs)(s.Fragment,{children:[w({disabled:Q,onClick:os,children:d("cancel")}),w({danger:!0,disabled:Q,onClick:Fa,children:Ba})]}),children:(0,s.jsxs)(s.Fragment,{children:[Q&&(0,s.jsxs)("div",{role:"status",children:[Te?.kind==="batch"?d("archives.deleteBatchPending"):d("deleteSession.pending"),Ae&&(0,s.jsx)("progress",{value:Ae.done,max:Math.max(1,Ae.total),"aria-label":d("organizer.progress")}),Ae&&d("organizer.progressCount",{done:Ae.done,total:Ae.total})]}),_t!==null&&(0,s.jsx)("div",{className:"dsham_settingsError",role:"alert",children:_t})]})})]})]})}e(On,"ArchivedSessionsSection");function Ar(n){var a,o,h="";if(typeof n=="string"||typeof n=="number")h+=n;else if(typeof n=="object")if(Array.isArray(n)){var v=n.length;for(a=0;a<v;a++)n[a]&&(o=Ar(n[a]))&&(h&&(h+=" "),h+=o)}else for(o in n)n[o]&&(h&&(h+=" "),h+=o);return h}e(Ar,"r");function aa(...n){for(var a,o,h=0,v="",f=arguments.length;h<f;h++)(a=arguments[h])&&(o=Ar(a))&&(v&&(v+=" "),v+=o);return v}e(aa,"clsx");function Fn(n){let a=n instanceof Error?n.message:String(n);return a.includes("UNKNOWN_SESSION")||a.includes("no such session")}e(Fn,"isUnknownSessionError");function Xn(n,a){if(Fn(n))return a("deleteSession.unknown");let o=n instanceof Error?n.message:String(n);return a("deleteSession.failed",{detail:o})}e(Xn,"formatDeleteError");function _r(n,a){if(Fn(n))return a("archives.unarchiveUnknown");let o=n instanceof Error?n.message:String(n);return a("archives.unarchiveFailed",{detail:o})}e(_r,"formatUnarchiveError");function Hn(n,a,o=Rr){return n.map(h=>h.sessionId+a("common.separator")+o(new Error(h.message),a)).join(`
29
- `)}e(Hn,"formatBatchFailures");function Rr(n,a){if(Fn(n))return a("archives.archiveUnknown");let o=n instanceof Error?n.message:String(n);return a("archives.archiveFailed",{detail:o})}e(Rr,"formatArchiveError");function Bn(n){if(n===null||typeof n!="object")return;let a=ce(n),o=a.rpcError!==null&&typeof a.rpcError=="object"?ce(a.rpcError):void 0,h=a.name==="WorkspaceActiveSessionError"?a.activity:void 0,v=o?.details,f=a.name==="WorkspaceArchiveError"&&o?.code==="workspace/session-active"&&v!==null&&typeof v=="object"?ce(v).activity:void 0,k=Array.isArray(h)?h:Array.isArray(f)?f:void 0;if(k===void 0)return;let E=k.flatMap(N=>{if(N===null||typeof N!="object")return[];let H=ce(N).kind;return typeof H=="string"&&H.length>0?[H]:[]});return E.length>0?E:void 0}e(Bn,"activeSessionActivity");function jr(n){let a=Bn(n);if(a===void 0||n===null||typeof n!="object")return;let o=ce(n),h=o.rpcError!==null&&typeof o.rpcError=="object"?ce(o.rpcError).details:void 0,v=h!==null&&typeof h=="object"?ce(h).sessionId:void 0,f=typeof o.sessionId=="string"?o.sessionId:typeof v=="string"?v:void 0;return f===void 0?void 0:{sessionId:f,kinds:a}}e(jr,"activeSessionRefusal");function Nr(n,a){let o=/^cannot archive session '(?:[^'\\]|\\')*': the session is active \((.*)\)$/.exec(a);if(o===null)return;let h=o[1].split(", ").filter(v=>v.length>0);return h.length>0?{sessionId:n,kinds:h}:void 0}e(Nr,"activeArchiveFromMessage");function ia(n,a){let o=n instanceof Error?n.message:String(n);return a("archives.forkFailed",{detail:o})}e(ia,"formatForkError");function Un(n,a,o){if(!n||o.has(n))return!1;let h=a?.[n];return!(h===void 0||h.origin==="subagent"||h.blank)}e(Un,"isWorkspaceTaskCandidate");function Mr(n){let a=n?.closest("[data-row-key]")??null;if(a===null)return null;let o=a.getAttribute("data-row-key")??"";if(!o.startsWith("workspace:"))return null;let h=o.slice(10);if(!h)return null;let v=a.querySelector(".title")??a.querySelector("[class*='title']");return{workspaceId:h,title:v?.textContent?.trim()||h}}e(Mr,"workspaceMenuTriggerFrom");function Qn(n){let a=n.querySelector('[class*="rowActions"]');if(!a)return null;let o=Array.from(a.querySelectorAll("button"));if(o.length===0)return null;let h=e(f=>!!((f.getAttribute("class")??"").includes("dsham_rowStar")||typeof f.closest=="function"&&f.closest(".dsham_starSlot")),"isStarButton");return o.find(f=>{if(h(f))return!1;if(f.getAttribute("aria-haspopup")==="menu")return!0;let k=(f.getAttribute("aria-label")??f.getAttribute("title")??"").toLowerCase();return/new|create|新建|add|\+|созда/.test(k)?!1:/action|操作|действи|more|更多|选项|options|menu/.test(k)})??null}e(Qn,"findRowMenuButton");function Dr(n,a){if(Qn(a)===n)return!0;let h=(n.getAttribute("aria-label")??n.getAttribute("title")??"").toLowerCase();return/action|操作|действи|more|更多/.test(h)}e(Dr,"isRowMenuButton");function Lr(){if(typeof document>"u"||typeof document.addEventListener!="function")return()=>{};let n=e(a=>{let o=a.target;if(!o||o.closest("input, textarea, [contenteditable='true']"))return;let h=o.closest('[data-row-key^="workspace:"], [data-row-key^="session:"]');if(!h)return;let v=o.closest("button");if(v&&!Dr(v,h))return;let f=Qn(h);f&&(a.preventDefault(),a.stopPropagation(),f.click())},"onContextMenu");return document.addEventListener("contextmenu",n,!0),()=>{document.removeEventListener("contextmenu",n,!0)}}e(Lr,"setupSidebarRowContextMenu");function er(n,a=!0){let o=(n.textContent??"").toLowerCase();return o.includes("\u5220\u9664\u5DE5\u4F5C\u533A")||o.includes("delete workspace")||o.includes("\u0443\u0434\u0430\u043B\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435")?!0:a&&/(?:^|[_\s-])danger(?:$|[_\s-])/i.test(n.className)}e(er,"isWorkspaceDeleteMenuItem");let oa=new Map,la=new Set,ca=new Map;function da(n){return n(oa)}e(da,"useEmptySessionPendingInteraction");function ua(n){return n(ca)}e(ua,"useEmptySessionStatus");function ha(n){let a=new Map,o=new Set;if(n instanceof Map)for(let[h,v]of n)v?.pendingInteraction!==void 0&&a.set(h,v.pendingInteraction),v?.completionUnread===!0&&o.add(h);return{pending:a,completed:o}}e(ha,"factsFromSessionStatus");function pa(n,a,o){let h=n(f=>f),v=a(f=>f);return o?ha(v):{pending:h,completed:la}}e(pa,"useSessionUiFacts");let zr={listeners:new Set,request(n){for(let a of this.listeners)a(n)},subscribe(n){return this.listeners.add(n),()=>{this.listeners.delete(n)}}};function lt(n,a){return n.blank?a("session.new"):n.title??n.displayTitle??""}e(lt,"displayTitle");function ma(n,a){let o=new Date(n),h=`${String(o.getHours()).padStart(2,"0")}:${String(o.getMinutes()).padStart(2,"0")}`;return a("archives.timestamp",{date:a("date.ymd",{y:o.getFullYear(),m:o.getMonth()+1,d:o.getDate()}),time:h})}e(ma,"archiveTimeLabel");let fa=[".dsham_archiveTabsLocked{opacity:.5}",".dsham_archiveTabs{display:grid!important;box-sizing:border-box!important;height:32px!important;min-height:32px!important;max-height:32px!important;padding:2px!important;border:0!important;border-radius:var(--dsw-radius-sm,8px)!important;box-shadow:inset 0 0 0 .5px var(--dsw-alias-border-l2)!important;background:var(--dsw-alias-bg-layer-1)!important}",'.dsham_archiveTabs>span[aria-hidden="true"],.dsham_archiveTabs>[class*="indicator"]{inset:2px auto 2px 2px!important;width:calc((100% - 4px)/2)!important;border-radius:6px!important;border:0.5px solid var(--dsw-alias-border-l3,rgba(255,255,255,.12))!important;background:var(--dsw-alias-bg-layer-3,rgba(255,255,255,.08))!important;box-shadow:none!important}',".dsham_archiveTabs [role=tab]{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;height:28px!important;padding:0 12px!important;border-radius:6px!important;font-size:13px!important;line-height:20px!important;color:var(--dsw-alias-label-secondary)!important;text-align:center!important;box-sizing:border-box!important;transition:color 150ms ease!important}",".dsham_archiveTabs [role=tab]:hover{color:var(--dsw-alias-label-primary)!important}",'.dsham_archiveTabs [role=tab][aria-selected="true"]{color:var(--dsw-alias-label-primary)!important;font-weight:600!important}',".dsham_tabLabel{display:inline-flex;align-items:center;justify-content:center;gap:6px}",".dsham_tabLabel svg{flex:none;display:block}"].join(""),Nt="data-dsham-nav-icon",ga='[role="dialog"] nav button',tr=[`[${Nt}] > svg { display: none !important; }`,`[${Nt}]::before {`," content: '';"," flex: none;"," width: 16px;"," height: 16px;"," background-color: currentColor;",' -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.3%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M13.5%202.5H2.5C1.94772%202.5%201.5%202.94772%201.5%203.5V4.5C1.5%205.05228%201.94772%205.5%202.5%205.5H13.5C14.0523%205.5%2014.5%205.05228%2014.5%204.5V3.5C14.5%202.94772%2014.0523%202.5%2013.5%202.5Z%22%2F%3E%3Cpath%20d%3D%22M2.5%205.5V13.5C2.5%2013.7652%202.60536%2014.0196%202.79289%2014.2071C2.98043%2014.3946%203.23478%2014.5%203.5%2014.5H12.5C12.7652%2014.5%2013.0196%2014.3946%2013.2071%2014.2071C13.3946%2014.0196%2013.5%2013.7652%2013.5%2013.5V5.5%22%2F%3E%3Cpath%20d%3D%22M6.5%209.5H9.5%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") center / contain no-repeat;',' mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.3%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M13.5%202.5H2.5C1.94772%202.5%201.5%202.94772%201.5%203.5V4.5C1.5%205.05228%201.94772%205.5%202.5%205.5H13.5C14.0523%205.5%2014.5%205.05228%2014.5%204.5V3.5C14.5%202.94772%2014.0523%202.5%2013.5%202.5Z%22%2F%3E%3Cpath%20d%3D%22M2.5%205.5V13.5C2.5%2013.7652%202.60536%2014.0196%202.79289%2014.2071C2.98043%2014.3946%203.23478%2014.5%203.5%2014.5H12.5C12.7652%2014.5%2013.0196%2014.3946%2013.2071%2014.2071C13.3946%2014.0196%2013.5%2013.7652%2013.5%2013.5V5.5%22%2F%3E%3Cpath%20d%3D%22M6.5%209.5H9.5%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") center / contain no-repeat;'," -webkit-mask-repeat: no-repeat;"," mask-repeat: no-repeat;"," -webkit-mask-position: center;"," mask-position: center;"," -webkit-mask-size: 16px 16px;"," mask-size: 16px 16px;","}"].join(`
30
- `);function va(n,a){let o=String(a??"").trim();return o.length>0&&String(n??"").trim()===o}e(va,"isOwnSettingsNavRow");function Wn(n,a){for(let o of n){if(o.type==="characterData"){let v=o.target.parentElement;if(v!==null&&v.closest(a)!==null)return!0;continue}let h=o.target;if(h&&h.nodeType===1&&(typeof h.matches=="function"&&h.matches(a)||typeof h.closest=="function"&&h.closest(a)!==null))return!0;if(o.addedNodes)for(let v of o.addedNodes){if(v.nodeType!==1)continue;let f=v;if(typeof f.matches=="function"&&f.matches(a)||typeof f.querySelector=="function"&&f.querySelector(a)!==null||typeof f.closest=="function"&&f.closest(a)!==null)return!0}if(o.removedNodes)for(let v of o.removedNodes){if(v.nodeType!==1)continue;let f=v;if(typeof f.matches=="function"&&f.matches(a)||typeof f.querySelector=="function"&&f.querySelector(a)!==null||typeof f.closest=="function"&&f.closest(a)!==null)return!0}}return!1}e(Wn,"mutationTouches");function Pr(n,a){return va(n.textContent,a)?Array.from(n.children).some(v=>v.tagName==="SPAN"&&(v.className.includes("navIcon")||v.getAttribute("aria-hidden")==="true"))||!!n.querySelector?.('[class*="navIcon"]')?n.hasAttribute(Nt)?(n.removeAttribute(Nt),!0):!1:n.getAttribute(Nt)===""?!1:(n.setAttribute(Nt,""),!0):n.hasAttribute(Nt)?(n.removeAttribute(Nt),!0):!1}e(Pr,"applySettingsNavIcon");function Or(n){return n.hasAttribute(Nt)?(n.removeAttribute(Nt),!0):!1}e(Or,"restoreSettingsNavIcon");function Fr(n){typeof document>"u"||typeof MutationObserver>"u"||n.effect(()=>{let a="dsham-nav-icon-style",o=document.getElementById(a);o===null?(o=document.createElement("style"),o.id=a,o.textContent=tr,(document.head??document.documentElement).append(o)):o.textContent!==tr&&(o.textContent=tr);let h=!1,v=!1,f=e(()=>{if(v=!1,h)return;let N=n.locale.bind(_e)("archived.badge");for(let H of document.querySelectorAll(ga))Pr(H,N)},"sync"),k=e(()=>{v||h||(v=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(f):setTimeout(f,16))},"schedule");f();let E=new MutationObserver(N=>{Wn(N,'[role="dialog"] nav')&&k()});return E.observe(document.body,{childList:!0,subtree:!0,characterData:!0}),()=>{h=!0,E.disconnect();for(let N of document.querySelectorAll(`[${Nt}]`))Or(N);o?.remove()}},"archive-manager: settings nav icon")}e(Fr,"installSettingsNavIcon");let ba=[".dsham_settings{container-type:inline-size;min-width:0;box-sizing:border-box;width:100%;padding:0 0 32px;color:var(--dsw-alias-label-primary)}",".dsham_settingsHeader{display:flex;flex-direction:column;align-items:stretch;gap:16px;margin-bottom:16px}",".dsham_settings h2{margin:0;font-size:24px;line-height:32px;font-weight:600;letter-spacing:-.4px;white-space:nowrap}",".dsham_settingsIntro{margin:12px 0 0;max-width:42em;color:var(--dsw-alias-label-tertiary);font-size:14px;line-height:22px}",".dsham_settingsToolbar{display:flex;align-items:center;gap:8px;margin-bottom:16px;width:100%;min-width:0}",".dsham_settingsSearch{display:flex;align-items:center;gap:8px;min-width:0;width:100%;flex-wrap:nowrap}","@container(max-width:520px){.dsham_settingsSearch{flex-wrap:wrap}}",".dsham_settingsSearch .dsham_searchField{flex:1 1 0;min-width:120px;width:auto;box-sizing:border-box}",".dsham_viewSortContainer{flex:0 0 auto;position:relative;box-sizing:border-box}",".dsham_viewSortBtn{height:32px!important;padding:0 8px!important;font-size:13px!important;box-sizing:border-box}",".dsham_viewSortBtn.has-filter{border-color:var(--dsw-alias-state-business-primary)!important;color:var(--dsw-alias-state-business-primary)!important}",".dsham_settingsFilter{display:inline-flex;position:relative}",".dsham_settingsSearch .dsham_projectFilter{flex:0 0 auto;max-width:120px;min-width:0;box-sizing:border-box}",".dsham_settingsSearch .dsham_projectFilter > span{display:inline-block;max-width:100%;box-sizing:border-box}",".dsham_settingsSearch .dsham_projectFilter .dsham_menuSelectBtn{display:inline-flex!important;width:100%;max-width:120px;padding:0 8px;box-sizing:border-box;overflow:hidden}",".dsham_settingsSearch .dsham_projectFilter .dsham_selectLabel{flex:1 1 auto;min-width:0;max-width:80px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}",".dsham_settingsSearch .dsham_dateFilter{flex:0 0 125px;width:125px;min-width:125px;position:relative;box-sizing:border-box}",".dsham_dateRange{width:100%;box-sizing:border-box}",".dsham_dateTrigger{height:32px!important;padding:0 8px!important;gap:5px!important;border:0.5px solid var(--dsw-alias-border-l2)!important;border-radius:var(--dsw-radius-sm,8px)!important;background:var(--dsw-alias-bg-layer-1)!important;box-sizing:border-box}",".dsham_dateTrigger .dsham_dateText{font-size:12px!important;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".dsham_srOnly{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;opacity:0;pointer-events:none}",".dsham_menuSelectBtn{display:inline-flex!important;align-items:center;justify-content:space-between;gap:6px;width:auto!important;max-width:100%;min-width:0!important;height:32px!important;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);box-sizing:border-box;font:inherit;font-size:13px;cursor:pointer}",".dsham_selectLabel{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:normal;text-align:left}",".dsham_settingsGroup{margin:0 0 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-button-elevated-fill));overflow:hidden;transition:border-color 150ms ease}",".dsham_settingsGroupHeading{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:38px;padding:0 10px;margin:0;user-select:none}",".dsham_settingsGroupTitle{display:flex;align-items:center;gap:8px;min-width:0;margin:0;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600}",".dsham_settingsGroupTitle svg{flex:none;color:var(--dsw-alias-label-secondary)}",".dsham_settingsCount{flex:none;color:var(--dsw-alias-label-tertiary);font-size:12px}",".dsham_settingsList{display:grid;overflow:hidden;border:0;border-top:1px solid var(--dsw-alias-border-l2);border-radius:0;background:transparent}",".dsham_settingsList[hidden]{display:none!important;border:0!important}",".dsham_settingsRow{display:grid;grid-template-columns:16px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:40px;padding:4px 10px;border-bottom:1px solid var(--dsw-alias-border-l2)}",".dsham_settingsRow:last-child{border-bottom:0}",".dsham_settingsContent{min-width:0;flex:1}",".dsham_settingsMeta{margin-top:1px;color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:13px}",".dsham_settingsActions{display:flex;align-items:center;gap:4px;flex:none}",".dsham_settingsEmpty{padding:28px 8px;color:var(--dsw-alias-label-secondary);text-align:center}",".dsham_settingsError{margin-top:10px;color:var(--dsw-alias-state-error-primary);font-size:12px;white-space:pre-line}","@container(max-width:520px){.dsham_settingsHeader{margin-bottom:16px}.dsham_settingsGroup{margin-bottom:10px}.dsham_settingsRow{padding:4px 8px}.dsham_settingsActions{gap:2px}}"].join(""),ya=".dsham_settingsTitleLink{display:block;max-width:100%;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;font-weight:600;line-height:16px;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.dsham_settingsTitleLink:hover:not(:disabled){text-decoration:underline;text-underline-offset:3px}.dsham_settingsTitleLink:disabled{cursor:default;opacity:.6}.dsham_groupToggle{display:flex;align-items:center;gap:8px;min-width:0;max-width:100%;padding:4px 0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.dsham_groupToggle span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dsham_settingsRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.dsham_settingsRow[data-selected=true]{background:var(--dsw-alias-interactive-bg-hover)}.dsham_settingsTitleLink:focus-visible,.dsham_groupToggle:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#3b82f6);outline-offset:2px}@container(max-width:400px){.dsham_settingsRow{gap:6px;padding:4px 6px}.dsham_settingsActions{gap:0}.dsham_settingsMeta{font-size:10px}}.dsham_settingsGroupMeta{display:flex;align-items:center;gap:8px;flex:none;flex-wrap:wrap}.dsham_settingsStatus{margin-top:10px;color:var(--dsw-alias-label-secondary);font-size:12px}.dsham_checkbox{flex:none;box-sizing:border-box;width:16px;height:16px;margin:0;accent-color:var(--dsw-alias-brand-primary);cursor:pointer}.dsham_checkbox:focus-visible{outline:var(--dsw-focus-ring-width,1px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.dsham_checkbox:disabled{opacity:.5;cursor:default}button.dsham_favoriteOn{color:#e8b931}button.dsham_favoriteOn:not(:disabled):hover{color:#e8b931!important;border-color:#e8b931!important}",wa=".dsham_settingsTitleRow{display:flex;align-items:center;gap:8px 12px;min-width:0;flex-wrap:wrap}.dsham_settingsLinks{display:flex;align-items:center;gap:8px;flex-wrap:wrap}@media(max-width:720px){.dsham_settingsTitleRow{flex-wrap:wrap}}",Sa=".dsham_settingsSelection{margin:-8px 0 16px;padding:4px 0 12px;border-bottom:1px solid var(--dsw-alias-border-l2)}.dsham_settingsSelectionMain{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;min-height:36px}.dsham_settingsSelectionSummary{display:flex;flex-wrap:wrap;align-items:center;gap:12px;min-width:0;max-width:100%}.dsham_settingsSelectionToggle{display:inline-flex;flex:none;white-space:nowrap;align-items:center;gap:12px;color:var(--dsw-alias-label-primary);font-size:13px;line-height:20px;cursor:pointer}.dsham_settingsSelectionActions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px;max-width:100%;margin-left:auto}.dsham_settingsSelectionScope{margin:8px 0 0;color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:20px;overflow-wrap:anywhere}";function nr({id:n,className:a,value:o,options:h,onChange:v,disabled:f=!1,"aria-label":k,title:E,tabIndex:N,"aria-hidden":H}){let[A,z]=l.useState(!1),O=l.useMemo(()=>h.map(Re=>({id:Re.value,label:Re.label})),[h]),d=h.find(Re=>Re.value===o),oe=d?.label??k;return(0,s.jsx)("div",{id:n,tabIndex:N,"aria-hidden":H,className:a===void 0?"dsham_settingsFilter":`dsham_settingsFilter ${a}`,children:(0,s.jsx)(u.Menu,{open:A,onClose:e(()=>z(!1),"onClose"),onSelect:e(Re=>{f||v(Re),z(!1)},"onSelect"),selectedId:o,align:"start",portal:!0,dense:!0,listClassName:"dsham_selectDropdown",anchor:(0,s.jsxs)(u.Button,{variant:"outline",size:"sm",role:"combobox","aria-label":k,"aria-expanded":A,disabled:f,tabIndex:N,"aria-hidden":H,title:E??d?.title??d?.label??k,className:"dsham_menuSelectBtn"+(A?" is-open":""),onClick:e(()=>{f||z(Re=>!Re)},"onClick"),children:[(0,s.jsx)("span",{className:"dsham_selectLabel",children:oe}),(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",style:{marginLeft:4,transition:"transform 150ms ease",transform:A?"rotate(180deg)":"none",flex:"none"},children:(0,s.jsx)("path",{d:"m4 6 4 4 4-4"})})]}),items:O})})}e(nr,"ArchiveProjectSelect");function xa({id:n,t:a,disabled:o=!1,favoritesOnly:h,setFavoritesOnly:v,favoriteBusy:f=!1,sortBy:k,setSortBy:E,options:N}){let[H,A]=l.useState(!1),z=l.useMemo(()=>{let pe=[];typeof v=="function"&&(pe.push({type:"label",id:"lbl_view_filter",text:a("organizer.favoriteFilter")||"\u7B5B\u9009\u4F1A\u8BDD"}),pe.push({id:"filter:all",label:a("organizer.allSessions")||"\u5168\u90E8\u4F1A\u8BDD"}),pe.push({id:"filter:favorites",label:a("organizer.favoritesOnly")||"\u53EA\u770B\u6536\u85CF"}),pe.push({type:"separator",id:"sep_view_filter"})),pe.push({type:"label",id:"lbl_view_sort",text:a("archives.sortLabel")||"\u6392\u5E8F\u65B9\u5F0F"});for(let kt of N)pe.push({id:`sort:${kt.value}`,label:kt.label});return pe},[a,v,N]),O=e(pe=>{pe.startsWith("filter:")?typeof v=="function"&&!f&&v(pe==="filter:favorites"):pe.startsWith("sort:")&&E(pe.slice(5)),A(!1)},"onSelect"),d=N.find(pe=>pe.value===k),oe=h?a("organizer.favoritesOnly")||"\u53EA\u770B\u6536\u85CF":a("organizer.allChats")||"\u5168\u90E8\u804A\u5929",Re=`${oe} \xB7 ${d?.label??k}`;return(0,s.jsxs)("div",{className:"dsham_viewSortContainer",children:[(0,s.jsx)(u.Menu,{open:H,onClose:e(()=>A(!1),"onClose"),onSelect:O,selectedIds:[h?"filter:favorites":"filter:all",`sort:${k}`],align:"end",portal:!0,dense:!0,listClassName:"dsham_viewSortDropdown",anchor:(0,s.jsxs)(u.Button,{variant:"outline",size:"sm",role:"combobox","aria-label":a("archives.viewOptions")||"\u89C6\u56FE\u9009\u9879","aria-expanded":H,disabled:o,title:Re,className:"dsham_menuSelectBtn dsham_viewSortBtn"+(H?" is-open":"")+(h?" has-filter":""),onClick:e(()=>{o||A(pe=>!pe)},"onClick"),children:[(0,s.jsxs)("svg",{viewBox:"0 0 16 16",width:13,height:13,fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"none",marginRight:4},children:[(0,s.jsx)("line",{x1:2.5,y1:4.5,x2:13.5,y2:4.5}),(0,s.jsx)("circle",{cx:5,cy:4.5,r:1.5,fill:"var(--dsw-alias-bg-layer-1)"}),(0,s.jsx)("line",{x1:2.5,y1:11.5,x2:13.5,y2:11.5}),(0,s.jsx)("circle",{cx:11,cy:11.5,r:1.5,fill:"var(--dsw-alias-bg-layer-1)"})]}),(0,s.jsx)("span",{className:"dsham_selectLabel",children:oe}),(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:11,height:11,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",style:{marginLeft:3,transition:"transform 150ms ease",transform:H?"rotate(180deg)":"none",flex:"none"},children:(0,s.jsx)("path",{d:"m4 6 4 4 4-4"})})]}),items:z})]})}e(xa,"ArchiveViewSortMenu");function Hr({selectedCount:n,hiddenCount:a,allVisibleSelected:o,selectedVisibleCount:h,visibleCount:v,busy:f,t:k,onToggle:E,onClear:N,onRestore:H,onDelete:A,onArchive:z}){let O=n>0;return(0,s.jsxs)("div",{className:"dsham_settingsSelection",children:[(0,s.jsxs)("div",{className:"dsham_settingsSelectionMain",children:[(0,s.jsxs)("div",{className:"dsham_settingsSelectionSummary",children:[(0,s.jsxs)("label",{className:"dsham_settingsSelectionToggle",title:k("archives.selectAllFiltered"),children:[(0,s.jsx)(Br,{checked:o,indeterminate:h>0&&!o,disabled:f||v===0,label:k("archives.selectAllFiltered"),onChange:e(d=>E(d.target.checked),"onChange")}),(0,s.jsx)("span",{"aria-live":"polite",children:O?k("archives.selectedCount",{n}):k("archives.selectAllFiltered")})]}),O&&g({disabled:f,"aria-label":k("archives.clearSelection"),onClick:N,children:k("archives.clearSelectionShort")})]}),O&&(0,s.jsxs)("div",{className:"dsham_settingsSelectionActions",children:z?[g({disabled:f,onClick:z,children:k("archives.archiveSelected")})]:[g({disabled:f,"aria-label":k("archives.restoreSelected"),onClick:H,children:k("archives.restore")}),g({disabled:f,className:"dsham_btnDanger","aria-label":k("archives.deleteSelected"),onClick:A,children:k("archives.deleteSelectionShort")})]})]}),a>0&&(0,s.jsx)("p",{className:"dsham_settingsSelectionScope",role:"status",children:k("archives.selectionHiddenHint",{hidden:a})})]})}e(Hr,"ArchiveSelectionToolbar");function Br({checked:n,indeterminate:a=!1,disabled:o=!1,label:h,onChange:v}){return(0,s.jsx)(ur,{checked:n,indeterminate:a,disabled:o,label:h,onChange:v})}e(Br,"ArchiveSelectionCheckbox");function Ur(){return(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,"aria-hidden":!0,focusable:"false",children:[3.5,8,12.5].map(n=>(0,s.jsx)("circle",{cx:n,cy:8,r:1.15,fill:"none",stroke:"currentColor",strokeWidth:1.5},n))})}e(Ur,"moreIcon");function ka({busy:n,title:a,t:o,onPreview:h,onRestoreOpen:v,onDelete:f,onCopyId:k}){let[E,N]=(0,l.useState)(!1),H=e(z=>{if(!n){if(N(!1),z==="copyId")return k?.();if(z==="preview")return h?.();if(z==="restoreOpen")return v?.();z==="delete"&&f?.()}},"choose"),A=[...h?[{id:"preview",label:o("discovery.preview"),icon:(0,s.jsx)(u.IconBrowseOutlineMedium,{size:16}),danger:!1}]:[],...v?[{id:"restoreOpen",label:o("archives.restoreOpen"),icon:(0,s.jsx)(u.IconUnarchiveOutlineMedium,{size:16}),danger:!1}]:[],...k?[{id:"copyId",label:o("details.copyId"),icon:(0,s.jsx)(u.IconCopyOutlineMedium,{size:16}),danger:!1}]:[],...f?[{id:"delete",label:o("menu.deleteSession"),icon:(0,s.jsx)(u.IconTrashOutlineMedium,{size:16}),danger:!0}]:[]];return(0,s.jsx)(u.Menu,{open:!n&&E,align:"end",portal:!0,dense:!0,items:A,onSelect:H,onClose:e(()=>N(!1),"onClose"),anchor:g({variant:"outline",className:"dsham_iconAction",disabled:n,title:o("archives.moreActions"),"aria-label":o("archives.moreActions")+o("common.separator")+a,"aria-haspopup":"menu","aria-expanded":E&&!n,icon:Ur(),onClick:e(()=>{n||N(z=>!z)},"onClick")})})}e(ka,"ArchivedSessionMenu");function Ca({group:n,busy:a,onArchive:o,onRestore:h,onDelete:v,t:f}){let k=n.key===qn,E=o?[{id:"archive",label:f(k?"archives.archiveUngrouped":"archives.archiveProject"),icon:(0,s.jsx)(u.IconArchiveOutlineMedium,{size:16}),danger:!0}]:[{id:"restore",label:f(k?"archives.restoreUngrouped":"archives.restoreProject"),icon:(0,s.jsx)(u.IconUnarchiveOutlineMedium,{size:16}),danger:!1},{id:"delete",label:f(k?"archives.deleteUngrouped":"archives.deleteProject"),icon:(0,s.jsx)(u.IconTrashOutlineMedium,{size:16}),danger:!0}],[N,H]=(0,l.useState)(!1),A=f(k?"archives.ungroupedActions":"archives.projectActions",{name:n.title}),z=e(O=>{a||(O==="archive"?o?.():O==="restore"?h?.():O==="delete"&&v?.())},"choose");return(0,s.jsx)(u.Menu,{open:!a&&N,align:"end",portal:!0,dense:!0,items:E,onSelect:e(O=>{H(!1),z(O)},"onSelect"),onClose:e(()=>H(!1),"onClose"),anchor:g({variant:"outline",className:"dsham_iconAction",disabled:a,"aria-label":A,"aria-haspopup":"menu","aria-expanded":N&&!a,icon:Ur(),onClick:e(()=>{a||H(O=>!O)},"onClick")})})}e(Ca,"ArchivedGroupActions");let qn="__ungrouped__";function Ea(n){return n===qn?{scope:"ungrouped"}:{scope:"workspace",workspaceId:n}}e(Ea,"archivedBatchTargetForGroup");function bn(n,a,o){let h=[...new Set(n??[])];if(o.scope==="all")return h;if(o.scope==="sessions"){let f=new Set(o.sessionIds??[]);return h.filter(k=>f.has(k))}if(o.scope==="workspace"){let f=new Set(a.find(k=>k.workspaceId===o.workspaceId)?.sessionIds??[]);return h.filter(k=>f.has(k))}let v=new Set(a.flatMap(f=>f.sessionIds));return h.filter(f=>!v.has(f))}e(bn,"deriveArchivedBatchIds");function Wr(n){return[...new Set(n.flatMap(a=>a.sessions.map(o=>o.id)))]}e(Wr,"archivedSessionIdsInGroups");function qr(n,a){let o=new Set(a);return[...new Set(n)].filter(h=>o.has(h))}e(qr,"pruneArchivedSelection");function rr(n,a,o){let h=new Set(n);for(let v of a)o?h.add(v):h.delete(v);return[...h]}e(rr,"toggleArchivedSelection");function Vr(n,a){let o=n.deletedSessionIds.length,h=n.skippedSessionIds.length;return n.failures.length>0?{kind:"error",message:a("archives.deletePartial",{deleted:o,skipped:h,failed:n.failures.length,detail:n.failures[0].message})}:h>0&&o>0?{kind:"notice",message:a("archives.deleteSuccessWithSkipped",{deleted:o,skipped:h})}:h>0?{kind:"notice",message:a("archives.deleteSkipped",{n:h})}:{kind:"notice",message:a("archives.deleteSuccess",{n:o})}}e(Vr,"archivedDeleteFeedback");function $r(n,a){let o=new Set(a);return Object.values(n).filter(h=>h.origin!=="subagent"&&!h.blank&&!o.has(h.id)).map(h=>h.id)}e($r,"unarchivedSessionIds");function Gr(n,a,o,h){let v=a.map(E=>({key:E.workspaceId,title:E.title,ids:new Set(E.sessionIds),sessions:[]})),f=[];for(let E of o){let N=n[E];if(N===void 0||N.origin==="subagent")continue;let H=v.find(A=>A.ids?.has(E));(H===void 0?f:H.sessions).push(N)}let k=v.filter(E=>E.sessions.length>0);return f.length>0&&k.push({key:qn,title:h,sessions:f}),k}e(Gr,"deriveArchivedGroups");function Kr(n,a,o,h,v=[]){let f=e((A,z)=>String(A).localeCompare(String(z),void 0,{numeric:!0,sensitivity:"base"}),"compareText"),k=new Map;if(Array.isArray(v))for(let A=0;A<v.length;A++)k.set(v[A],A);let E=e(A=>{let z=a==="created"?o[A.id]:A.updatedAt;return typeof z=="number"&&Number.isFinite(z)?z:Number.NEGATIVE_INFINITY},"timestampOf"),N=e((A,z)=>{if(a==="archived"){let O=k.get(A.id)??-1,oe=(k.get(z.id)??-1)-O;if(oe!==0)return oe}if(a!=="alphabetical"){let O=E(z)-E(A);if(Number.isFinite(O)&&O!==0)return O}return f(lt(A,h),lt(z,h))||f(A.id,z.id)},"compareSessions");return n.map(A=>({...A,sessions:[...A.sessions].sort(N)})).sort((A,z)=>{if(a==="archived"){let O=A.sessions[0]?.id,d=z.sessions[0]?.id,oe=O!==void 0?k.get(O)??-1:-1,pe=(d!==void 0?k.get(d)??-1:-1)-oe;if(pe!==0)return pe}if(a!=="alphabetical"){let O=E(z.sessions[0])-E(A.sessions[0]);if(Number.isFinite(O)&&O!==0)return O}return f(A.title,z.title)||f(A.key,z.key)})}e(Kr,"sortArchivedGroups");let Yr={...Ys,...Is,"locale.language":"zh","service.unavailable":"\u670D\u52A1\u5C1A\u672A\u5C31\u7EEA\uFF0C\u8BF7\u91CD\u8BD5","common.close":"\u5173\u95ED","entry.location.title":"\u5165\u53E3\u5C55\u793A\u4F4D\u7F6E","entry.location.desc":"\u9009\u62E9\u5F52\u6863\u7BA1\u7406\u5165\u53E3\u7684\u5C55\u793A\u4F4D\u7F6E\uFF08\u81F3\u5C11\u4FDD\u7559\u4E00\u5904\uFF0C\u9632\u6B62\u65E0\u6CD5\u6253\u5F00\u9762\u677F\uFF09\u3002","entry.location.both":"\u4E24\u8FB9\u663E\u793A","entry.location.sidebar":"\u4EC5\u4FA7\u8FB9\u680F","entry.location.settings":"\u4EC5\u8BBE\u7F6E","entry.location.saveFailed":"\u4FDD\u5B58\u5165\u53E3\u8BBE\u7F6E\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u6216\u91CD\u542F\u5BBF\u4E3B\u8FDB\u7A0B","sidebar.favoriteStar.title":"\u4FA7\u680F\u6536\u85CF\u661F\u6807","sidebar.favoriteStar.desc":"\u5728\u4F1A\u8BDD\u5217\u8868\u884C\u524D\u663E\u793A\u6536\u85CF\u661F\u6807\u3002\u5173\u95ED\u540E\u4E0D\u663E\u793A\u56FE\u6807\uFF0C\u4ECD\u53EF\u901A\u8FC7\u83DC\u5355\u6536\u85CF\u548C\u7B5B\u9009\u3002","sidebar.favoriteStar.toggle":"\u5207\u6362\u4FA7\u680F\u6536\u85CF\u661F\u6807","update.entry.title":"\u5728\u7EBF\u66F4\u65B0","update.entry.desc":"\u5141\u8BB8\u68C0\u67E5\u5E76\u5728\u7EBF\u5B89\u88C5\u5F52\u6863\u7BA1\u7406\u5668\u7684\u65B0\u7248\u672C\u3002\u5173\u95ED\u540E\u9690\u85CF\u66F4\u65B0\u5165\u53E3\u3002","update.entry.toggle":"\u5207\u6362\u5728\u7EBF\u66F4\u65B0","update.entry.locked":"\u5728\u7EBF\u66F4\u65B0\u5DF2\u88AB\u5BBF\u4E3B\u914D\u7F6E\u9501\u5B9A\u7981\u7528","archives.archiveProject":"\u5F52\u6863\u8BE5\u9879\u76EE\u7684\u5168\u90E8\u804A\u5929","archives.archiveUngrouped":"\u5F52\u6863\u5168\u90E8\u672A\u5206\u7EC4\u804A\u5929","archives.archiveProjectDesc":"\u5C06\u201C{name}\u201D\u4E2D\u5168\u90E8 {n} \u6761\u672A\u5F52\u6863\u4F1A\u8BDD\u5F52\u6863\uFF0C\u4E0D\u53D7\u5F53\u524D\u641C\u7D22\u7B5B\u9009\u5F71\u54CD\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u6062\u590D\u3002","archives.archiveUngroupedDesc":"\u5C06\u5168\u90E8 {n} \u6761\u672A\u5206\u7EC4\u7684\u672A\u5F52\u6863\u4F1A\u8BDD\u5F52\u6863\uFF0C\u4E0D\u53D7\u5F53\u524D\u641C\u7D22\u7B5B\u9009\u5F71\u54CD\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u6062\u590D\u3002","archives.tab.archived":"\u5DF2\u5F52\u6863","archives.tab.unarchived":"\u672A\u5F52\u6863","archives.searchUnarchived":"\u641C\u7D22\u672A\u5F52\u6863\u804A\u5929","archives.emptyUnarchived":"\u6682\u65E0\u672A\u5F52\u6863\u4F1A\u8BDD\u3002","archives.archiveSelected":"\u5F52\u6863","archives.openSession":"\u6253\u5F00","archives.moreActions":"\u66F4\u591A\u64CD\u4F5C","archives.archiveSelectedDesc":"\u5C06\u9009\u4E2D\u7684\u4F1A\u8BDD\u5F52\u6863\uFF0C\u5305\u542B\u5F53\u524D\u7B5B\u9009\u9690\u85CF\u7684\u5DF2\u9009\u9879\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u67E5\u770B\u548C\u6062\u590D\u3002","archives.archiveSuccess":"\u5DF2\u5F52\u6863 {n} \u6761\u4F1A\u8BDD\u3002","archives.archiveBatchFailed":"\u6279\u91CF\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.navigationUnavailable":"\u5F53\u524D\u5BBF\u4E3B\u65E0\u6CD5\u4FDD\u6301\u5F52\u6863\u5BF9\u8BDD\uFF0C\u8BF7\u4F7F\u7528\u201C\u6062\u590D\u5E76\u6253\u5F00\u201D\u3002","archives.sessionNotRetained":"\u5BBF\u4E3B\u672A\u4FDD\u7559\u76EE\u6807\u4F1A\u8BDD\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u6216\u6062\u590D\u540E\u518D\u8BD5\u3002","archives.restoreOpen":"\u6062\u590D\u6253\u5F00","archives.selectedCount":"\u5DF2\u9009 {n} \u6761","archives.selectionHiddenHint":"\u542B\u5F53\u524D\u672A\u663E\u793A\u7684 {hidden} \u6761\uFF0C\u4E5F\u5C06\u53C2\u4E0E\u64CD\u4F5C","archives.clearSelectionShort":"\u6E05\u7A7A","archives.restore":"\u6062\u590D","archives.archiveTitle":"\u5F52\u6863 {n} \u4E2A\u804A\u5929\uFF1F","archives.deleteSelectionShort":"\u5220\u9664","archives.clearSelection":"\u6E05\u7A7A\u9009\u62E9","group.ungrouped":"\u672A\u5206\u7EC4","session.new":"\u65B0\u4F1A\u8BDD","menu.deleteSession":"\u5220\u9664\u4F1A\u8BDD","archived.badge":"\u5F52\u6863\u4F1A\u8BDD","archives.title":"\u5F52\u6863\u4F1A\u8BDD","archives.description":"\u7BA1\u7406\u5DF2\u5F52\u6863\u4F1A\u8BDD\uFF0C\u6216\u9009\u62E9\u672A\u5F52\u6863\u4F1A\u8BDD\u8FDB\u884C\u6279\u91CF\u5F52\u6863\u3002","archives.viewProject":"GitHub","archives.feedback":"\u95EE\u9898\u53CD\u9988","archives.empty":"\u6682\u65E0\u5DF2\u5F52\u6863\u4F1A\u8BDD","archives.emptyFiltered":"\u6CA1\u6709\u7B26\u5408\u7B5B\u9009\u6761\u4EF6\u7684\u804A\u5929","archives.searchPlaceholder":"\u641C\u7D22\u5DF2\u5F52\u6863\u804A\u5929","archives.sortLabel":"\u6392\u5E8F\u65B9\u5F0F","archives.viewOptions":"\u89C6\u56FE\u9009\u9879","archives.sortArchived":"\u6700\u8FD1\u5F52\u6863","archives.sortUpdated":"\u66F4\u65B0\u65F6\u95F4","archives.sortCreated":"\u521B\u5EFA\u65F6\u95F4","archives.sortAlphabetical":"\u6309\u5B57\u6BCD\u987A\u5E8F","archives.projectFilter":"\u6309\u9879\u76EE\u7B5B\u9009","archives.allProjects":"\u6240\u6709\u9879\u76EE","discovery.timeRange":"\u65F6\u95F4\u8303\u56F4","organizer.allChats":"\u5168\u90E8\u804A\u5929","archives.sessionCount":"{n} \u4E2A\u804A\u5929","archives.selectAllFiltered":"\u5168\u9009\u5F53\u524D\u7B5B\u9009\u7ED3\u679C","archives.selectSession":"\u9009\u62E9\u4F1A\u8BDD\u201C{name}\u201D","archives.restoreSelected":"\u6062\u590D\u6240\u9009","archives.deleteSelected":"\u5220\u9664\u6240\u9009","archives.timestamp":"{date}\uFF0C{time}","archives.restoreProject":"\u6062\u590D\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.restoreUngrouped":"\u5168\u90E8\u6062\u590D","archives.deleteProject":"\u5220\u9664\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.deleteUngrouped":"\u5168\u90E8\u5220\u9664","archives.projectActions":"\u9879\u76EE\u201C{name}\u201D\u7684\u5F52\u6863\u64CD\u4F5C","archives.ungroupedActions":"\u672A\u5206\u7EC4\u804A\u5929\u7684\u5F52\u6863\u64CD\u4F5C","archives.restoreSuccess":"\u5DF2\u6062\u590D {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u3002","archives.restoreBatchFailed":"\u6279\u91CF\u6062\u590D\u5931\u8D25\uFF1A{detail}","archives.deleteSelectedTitle":"\u5220\u9664\u6240\u9009\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteSelectedDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u6240\u9009\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\uFF08\u542B\u6B63\u5728\u8FD0\u884C\u7684\uFF09\u548C\u8BB0\u5F55\u3002\u5176\u4ED6\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteSelectedConfirm":"\u5220\u9664\u6240\u9009\u804A\u5929","archives.deleteProjectTitle":"\u5220\u9664\u201C{name}\u201D\u4E2D\u7684\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteProjectDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u201C{name}\u201D\u4E2D\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\u548C\u8BB0\u5F55\u3002\u9879\u76EE\u76EE\u5F55\u548C\u672A\u5F52\u6863\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteProjectConfirm":"\u5220\u9664\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.deleteUngroupedTitle":"\u5220\u9664\u672A\u5206\u7EC4\u7684\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteUngroupedDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u672A\u5206\u7EC4\u4E2D\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\u548C\u8BB0\u5F55\u3002\u5176\u4ED6\u9879\u76EE\u548C\u672A\u5F52\u6863\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteUngroupedConfirm":"\u5220\u9664\u672A\u5206\u7EC4\u7684\u5168\u90E8\u804A\u5929","archives.deleteBatchPending":"\u6B63\u5728\u5220\u9664\u5DF2\u5F52\u6863\u804A\u5929\u2026","archives.deleteSuccess":"\u5DF2\u5220\u9664 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u3002","archives.deleteSuccessWithSkipped":"\u5DF2\u5220\u9664 {deleted} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\uFF1B\u53E6\u6E05\u7406 {skipped} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\u3002","archives.deleteSkipped":"\u5DF2\u6E05\u7406 {n} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\u3002","archives.deletePartial":"\u5DF2\u5220\u9664 {deleted} \u4E2A\u804A\u5929\uFF0C\u6E05\u7406 {skipped} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\uFF1B{failed} \u4E2A\u5220\u9664\u5931\u8D25\uFF1A{detail}","archives.unarchiveUnknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u53D6\u6D88\u5F52\u6863\u3002","archives.unarchiveFailed":"\u53D6\u6D88\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.archiveUnknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u5F52\u6863\u3002","archives.archiveFailed":"\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.archiveActive":"\u4F1A\u8BDD\u4ECD\u5728\u8FD0\u884C\uFF08{kinds}\uFF09\u3002","archiveActive.title":"\u505C\u6B62\u5E76\u5F52\u6863","archiveActive.desc":"\u201C{name}\u201D\u4ECD\u6709\u6B63\u5728\u8FDB\u884C\u7684\u5DE5\u4F5C\uFF1A{kinds}\u3002\u5F52\u6863\u524D\u4F1A\u505C\u6B62\u8FD9\u4E9B\u5DE5\u4F5C\u3002","archiveActive.confirm":"\u505C\u6B62\u5E76\u5F52\u6863","archives.forkFailed":"\u5206\u53C9\u4F1A\u8BDD\u5931\u8D25\uFF1A{detail}","deleteSession.title":"\u5220\u9664\u4F1A\u8BDD","deleteSession.confirmTitle":"\u5220\u9664\u4F1A\u8BDD\uFF1F","deleteSession.desc":"\u5C06\u6C38\u4E45\u5220\u9664\u4F1A\u8BDD\u201C{name}\u201D\u53CA\u5176\u5B50\u4EE3\u7406\uFF08\u542B\u6B63\u5728\u8FD0\u884C\u7684\uFF09\u548C\u5168\u90E8\u8BB0\u5F55\uFF08\u5BF9\u8BDD\u5185\u5BB9\u3001\u7EDF\u8BA1\u3001\u7F13\u5B58\uFF09\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","deleteSession.pending":"\u6B63\u5728\u5220\u9664\u4F1A\u8BDD\u2026","deleteSession.unknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\u6216\u5DF2\u88AB\u5220\u9664\u3002","deleteSession.failed":"\u5220\u9664\u4F1A\u8BDD\u5931\u8D25\uFF1A{detail}","menu.archiveWorkspace":"\u5F52\u6863\u5DE5\u4F5C\u533A","menu.copyWorkspacePath":"\u590D\u5236\u76EE\u5F55","menu.openInExplorer":"\u6253\u5F00\u76EE\u5F55","menu.moveSession":"\u79FB\u52A8\u5230\u5DE5\u4F5C\u533A","moveSession.noOtherWorkspaces":"\u6682\u65E0\u53EF\u79FB\u52A8\u7684\u5176\u4ED6\u5DE5\u4F5C\u533A","moveSession.success":"\u4F1A\u8BDD\u5DF2\u6210\u529F\u79FB\u52A8\u5230\u201C{name}\u201D","archiveWorkspace.title":"\u5F52\u6863 {n} \u4E2A\u4F1A\u8BDD\uFF1F","archiveWorkspace.desc":"\u8FD9\u4F1A\u5C06\u201C{name}\u201D\u4E2D\u7684\u4F1A\u8BDD\u5F52\u6863\u3002\u4E4B\u540E\u53EF\u4EE5\u5728\u201C\u8BBE\u7F6E \u2192 \u5F52\u6863\u4F1A\u8BDD\u201D\u4E2D\u627E\u5230\u5B83\u4EEC\u3002","archiveWorkspace.confirm":"\u5168\u90E8\u5F52\u6863","archiveWorkspace.pending":"\u6B63\u5728\u5F52\u6863\u4F1A\u8BDD\u2026","date.ymd":"{y}\u5E74{m}\u6708{d}\u65E5"},Zr={...Zs,...Ts,"locale.language":"en","service.unavailable":"The service is not ready. Please retry.","common.close":"Close","entry.location.title":"Entry placement","entry.location.desc":"Choose where to show the entry (at least one is retained to avoid losing access).","entry.location.both":"Both","entry.location.sidebar":"Sidebar only","entry.location.settings":"Settings only","entry.location.saveFailed":"Failed to save entry location. Please check your network or restart the host.","sidebar.favoriteStar.title":"Sidebar favorite star","sidebar.favoriteStar.desc":"Show favorite star on session rows in the sidebar. When disabled, the star is hidden while menu actions and filters stay available.","sidebar.favoriteStar.toggle":"Toggle sidebar favorite star","update.entry.title":"Online updates","update.entry.desc":"Allow checking and installing new versions online. Hides the update entry when disabled.","update.entry.toggle":"Toggle online updates","update.entry.locked":"Online updates are disabled by the host configuration.","archives.moreActions":"More actions","archives.archiveProject":"Archive all chats in this project","archives.archiveUngrouped":"Archive all ungrouped chats","archives.archiveProjectDesc":"Archive all {n} unarchived sessions in \u201C{name}\u201D, regardless of the current search filter. You can restore them in Archived.","archives.archiveUngroupedDesc":"Archive all {n} ungrouped, unarchived sessions, regardless of the current search filter. You can restore them in Archived.","archives.tab.archived":"Archived","archives.tab.unarchived":"Unarchived","archives.searchUnarchived":"Search unarchived chats","archives.emptyUnarchived":"No unarchived sessions.","archives.archiveSelected":"Archive","archives.openSession":"Open session","archives.archiveSelectedDesc":"Archive the selected sessions, including selections hidden by the current filter. You can view and restore them in Archived.","archives.archiveSuccess":"Archived {n} sessions.","archives.archiveBatchFailed":"Batch archive failed: {detail}","archives.navigationUnavailable":"This host cannot keep the conversation archived while opening it. Use \u201CRestore and open\u201D instead.","archives.sessionNotRetained":"The host did not keep the requested conversation open. Try again, or restore it before opening.","archives.restoreOpen":"Restore and open","archives.selectedCount":"{n} selected","archives.selectionHiddenHint":"Includes {hidden} hidden by the current filter; actions apply to them too.","archives.clearSelectionShort":"Clear","archives.restore":"Restore","archives.archiveTitle":"Archive {n} chats?","archives.deleteSelectionShort":"Delete","archives.clearSelection":"Clear selection","group.ungrouped":"Ungrouped","session.new":"New Session","menu.deleteSession":"Delete session","archived.badge":"Archived sessions","archives.title":"Archived sessions","archives.description":"Manage archived sessions or select unarchived sessions to archive in bulk.","archives.viewProject":"GitHub","archives.feedback":"Issues","archives.empty":"No archived sessions.","archives.emptyFiltered":"No chats match your filters.","archives.searchPlaceholder":"Search archived chats","archives.sortLabel":"Sort order","archives.viewOptions":"View options","archives.sortArchived":"Recently archived","archives.sortUpdated":"Last updated","archives.sortCreated":"Created","archives.sortAlphabetical":"Alphabetical","archives.projectFilter":"Filter by project","archives.allProjects":"All projects","discovery.timeRange":"Date range","organizer.allChats":"All chats","archives.sessionCount":"{n} chats","archives.selectAllFiltered":"Select all results","archives.selectSession":"Select chat {name}","archives.restoreSelected":"Restore selected","archives.deleteSelected":"Delete selected","archives.timestamp":"{date}, {time}","archives.restoreProject":"Restore all chats in this project","archives.restoreUngrouped":"Restore all","archives.deleteProject":"Delete all chats in this project","archives.deleteUngrouped":"Delete all","archives.projectActions":"Archive actions for project {name}","archives.ungroupedActions":"Archive actions for ungrouped chats","archives.restoreSuccess":"Restored {n} archived chats.","archives.restoreBatchFailed":"Could not restore the archived chats: {detail}","archives.deleteSelectedTitle":"Delete selected archived chats","archives.deleteSelectedDesc":"This permanently deletes the selected {n} archived chats, their child agents (including any that are still running), and their records. Other chats are not affected. This cannot be undone.","archives.deleteSelectedConfirm":"Delete selected chats","archives.deleteProjectTitle":"Delete archived chats in {name}","archives.deleteProjectDesc":"This permanently deletes the {n} archived chats in {name}, their child agents, and their records. The project directory and unarchived chats are not affected. This cannot be undone.","archives.deleteProjectConfirm":"Delete all project chats","archives.deleteUngroupedTitle":"Delete ungrouped archived chats","archives.deleteUngroupedDesc":"This permanently deletes the {n} ungrouped archived chats, their child agents, and their records. Other projects and unarchived chats are not affected. This cannot be undone.","archives.deleteUngroupedConfirm":"Delete all ungrouped chats","archives.deleteBatchPending":"Deleting archived chats\u2026","archives.deleteSuccess":"Deleted {n} archived chats.","archives.deleteSuccessWithSkipped":"Deleted {deleted} archived chats and cleared {skipped} stale archive entries for sessions that no longer exist.","archives.deleteSkipped":"Cleared {n} stale archive entries for sessions that no longer exist.","archives.deletePartial":"Deleted {deleted} chats and cleared {skipped} stale archive entries; {failed} could not be deleted: {detail}","archives.unarchiveUnknown":"This session no longer exists, so it cannot be unarchived.","archives.unarchiveFailed":"Could not unarchive the session: {detail}","archives.archiveUnknown":"This session no longer exists, so it cannot be archived.","archives.archiveFailed":"Could not archive the session: {detail}","archives.archiveActive":"This conversation is still running ({kinds}).","archiveActive.title":"Stop and archive","archiveActive.desc":"\u201C{name}\u201D still has work in progress: {kinds}. Archiving stops that work first.","archiveActive.confirm":"Stop and archive","archives.forkFailed":"Could not fork the session: {detail}","deleteSession.title":"Delete session","deleteSession.confirmTitle":"Delete session?","deleteSession.desc":"This permanently deletes session \u201C{name}\u201D, its child agents (including any that are still running), and all of its records (conversation, stats, cache). This cannot be undone.","deleteSession.pending":"Deleting session\u2026","deleteSession.unknown":"This session no longer exists or was already deleted.","deleteSession.failed":"Could not delete the session: {detail}","menu.archiveWorkspace":"Archive workspace","menu.copyWorkspacePath":"Copy folder path","menu.openInExplorer":"Open folder","menu.moveSession":"Move to workspace","moveSession.noOtherWorkspaces":"No other workspaces available","moveSession.success":"Session successfully moved to \u201C{name}\u201D","archiveWorkspace.title":"Archive {n} conversations?","archiveWorkspace.desc":"This archives all conversations in \u201C{name}\u201D. You can find them later in Archived sessions.","archiveWorkspace.confirm":"Archive all","archiveWorkspace.pending":"Archiving conversations\u2026","date.ymd":"{y}-{m}-{d}"},Ia={...Js,...As,"locale.language":"ru","service.unavailable":"\u0421\u0435\u0440\u0432\u0438\u0441 \u0435\u0449\u0451 \u043D\u0435 \u0433\u043E\u0442\u043E\u0432. \u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435.","common.close":"\u0417\u0430\u043A\u0440\u044B\u0442\u044C","entry.location.title":"\u0420\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u043F\u0443\u043D\u043A\u0442\u0430","entry.location.desc":"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435, \u0433\u0434\u0435 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0442\u044C \u043F\u0443\u043D\u043A\u0442 \u0432\u0445\u043E\u0434\u0430 (\u0445\u043E\u0442\u044F \u0431\u044B \u043E\u0434\u0438\u043D \u043E\u0441\u0442\u0430\u0435\u0442\u0441\u044F \u0430\u043A\u0442\u0438\u0432\u043D\u044B\u043C).","entry.location.both":"\u041E\u0431\u0430 \u043C\u0435\u0441\u0442\u0430","entry.location.sidebar":"\u0422\u043E\u043B\u044C\u043A\u043E \u0431\u043E\u043A\u043E\u0432\u0430\u044F \u043F\u0430\u043D\u0435\u043B\u044C","entry.location.settings":"\u0422\u043E\u043B\u044C\u043A\u043E \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438","entry.location.saveFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u043F\u0443\u043D\u043A\u0442\u0430. \u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0441\u0435\u0442\u044C \u0438\u043B\u0438 \u043F\u0435\u0440\u0435\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u0435 \u0445\u043E\u0441\u0442.","sidebar.favoriteStar.title":"\u0417\u0432\u0435\u0437\u0434\u0430 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0432 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","sidebar.favoriteStar.desc":"\u041E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0442\u044C \u0437\u0432\u0435\u0437\u0434\u0443 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0443 \u0441\u0442\u0440\u043E\u043A \u0441\u0435\u0441\u0441\u0438\u0439 \u0432 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438. \u041F\u0440\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0438 \u0437\u043D\u0430\u0447\u043E\u043A \u0441\u043A\u0440\u044B\u0432\u0430\u0435\u0442\u0441\u044F, \u0430 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u043C\u0435\u043D\u044E \u0438 \u0444\u0438\u043B\u044C\u0442\u0440\u0430\u0446\u0438\u044F \u043E\u0441\u0442\u0430\u044E\u0442\u0441\u044F \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u043C\u0438.","sidebar.favoriteStar.toggle":"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0437\u0432\u0435\u0437\u0434\u0443 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0432 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","update.entry.title":"\u041E\u043D\u043B\u0430\u0439\u043D-\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","update.entry.desc":"\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044C \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0443 \u0438 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0443 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0439 \u043E\u043D\u043B\u0430\u0439\u043D. \u0421\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u043F\u0443\u043D\u043A\u0442 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F \u043F\u0440\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0438.","update.entry.toggle":"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u043E\u043D\u043B\u0430\u0439\u043D-\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","update.entry.locked":"\u041E\u043D\u043B\u0430\u0439\u043D-\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u043E \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u0445\u043E\u0441\u0442\u0430.","archives.moreActions":"\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E","archives.archiveProject":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.archiveUngrouped":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.archiveProjectDesc":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 {n} \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439 \u0432 \xAB{name}\xBB, \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u0444\u0438\u043B\u044C\u0442\u0440\u0430 \u043F\u043E\u0438\u0441\u043A\u0430. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.archiveUngroupedDesc":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 {n} \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439, \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u0444\u0438\u043B\u044C\u0442\u0440\u0430 \u043F\u043E\u0438\u0441\u043A\u0430. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.tab.archived":"\u0410\u0440\u0445\u0438\u0432","archives.tab.unarchived":"\u041D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435","archives.searchUnarchived":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C \u0447\u0430\u0442\u0430\u043C","archives.emptyUnarchived":"\u041D\u0435\u0442 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.archiveSelected":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archives.openSession":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","archives.archiveSelectedDesc":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438, \u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0441\u043A\u0440\u044B\u0442\u044B\u0435 \u0442\u0435\u043A\u0443\u0449\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u043C. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.archiveSuccess":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043E \u0441\u0435\u0441\u0441\u0438\u0439: {n}.","archives.archiveBatchFailed":"\u041F\u0430\u043A\u0435\u0442\u043D\u0430\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u043D\u0435 \u0443\u0434\u0430\u043B\u0430\u0441\u044C: {detail}","archives.navigationUnavailable":"\u042D\u0442\u043E\u0442 \u0445\u043E\u0441\u0442 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0434\u0435\u0440\u0436\u0430\u0442\u044C \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u0432 \u0430\u0440\u0445\u0438\u0432\u0435 \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438. \u0412\u043C\u0435\u0441\u0442\u043E \u044D\u0442\u043E\u0433\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \xAB\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u044C\xBB.","archives.sessionNotRetained":"\u0425\u043E\u0441\u0442 \u043D\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u043B \u0437\u0430\u043F\u0440\u043E\u0448\u0435\u043D\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u043C. \u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435 \u0438\u043B\u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0435 \u0435\u0433\u043E \u043F\u0435\u0440\u0435\u0434 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0435\u043C.","archives.restoreOpen":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u044C","archives.selectedCount":"\u0412\u044B\u0431\u0440\u0430\u043D\u043E: {n}","archives.selectionHiddenHint":"\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 {hidden}, \u0441\u043A\u0440\u044B\u0442\u044B\u0445 \u0442\u0435\u043A\u0443\u0449\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u043C; \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u043F\u0440\u0438\u043C\u0435\u043D\u044F\u044E\u0442\u0441\u044F \u0438 \u043A \u043D\u0438\u043C.","archives.clearSelectionShort":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C","archives.restore":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C","archives.archiveTitle":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C {n} \u0447\u0430\u0442\u043E\u0432?","archives.deleteSelectionShort":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C","archives.clearSelection":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0432\u044B\u0431\u043E\u0440","group.ungrouped":"\u0411\u0435\u0437 \u0433\u0440\u0443\u043F\u043F\u044B","session.new":"\u041D\u043E\u0432\u0430\u044F \u0441\u0435\u0441\u0441\u0438\u044F","menu.deleteSession":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","archived.badge":"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439","archives.title":"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439","archives.description":"\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C\u0438 \u0441\u0435\u0441\u0441\u0438\u044F\u043C\u0438 \u0438\u043B\u0438 \u0432\u044B\u0431\u043E\u0440 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0434\u043B\u044F \u043F\u0430\u043A\u0435\u0442\u043D\u043E\u0439 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438.","archives.viewProject":"GitHub","archives.feedback":"\u041F\u0440\u043E\u0431\u043B\u0435\u043C\u044B","archives.empty":"\u041D\u0435\u0442 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.emptyFiltered":"\u041D\u0438 \u043E\u0434\u0438\u043D \u0447\u0430\u0442 \u043D\u0435 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0430\u0448\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u0430\u043C.","archives.searchPlaceholder":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C \u0447\u0430\u0442\u0430\u043C","archives.sortLabel":"\u0421\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0430","archives.viewOptions":"\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u0432\u0438\u0434\u0430","archives.sortArchived":"\u041D\u0435\u0434\u0430\u0432\u043D\u043E \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435","archives.sortUpdated":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0435 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","archives.sortCreated":"\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F","archives.sortAlphabetical":"\u041F\u043E \u0430\u043B\u0444\u0430\u0432\u0438\u0442\u0443","archives.projectFilter":"\u0424\u0438\u043B\u044C\u0442\u0440 \u043F\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0443","archives.allProjects":"\u0412\u0441\u0435 \u043F\u0440\u043E\u0435\u043A\u0442\u044B","discovery.timeRange":"\u041F\u0435\u0440\u0438\u043E\u0434","organizer.allChats":"\u0412\u0441\u0435 \u0447\u0430\u0442\u044B","archives.sessionCount":"{n} \u0447\u0430\u0442\u043E\u0432","archives.selectAllFiltered":"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B","archives.selectSession":"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0447\u0430\u0442 {name}","archives.restoreSelected":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435","archives.deleteSelected":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435","archives.timestamp":"{date}, {time}","archives.restoreProject":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.restoreUngrouped":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435","archives.deleteProject":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.deleteUngrouped":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435","archives.projectActions":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438 \u0434\u043B\u044F \u043F\u0440\u043E\u0435\u043A\u0442\u0430 {name}","archives.ungroupedActions":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438 \u0434\u043B\u044F \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432","archives.restoreSuccess":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432: {n}.","archives.restoreBatchFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B: {detail}","archives.deleteSelectedTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteSelectedDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 {n} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B (\u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0435\u0449\u0451 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435) \u0438 \u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0438. \u0414\u0440\u0443\u0433\u0438\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteSelectedConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteProjectTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u0432 {name}","archives.deleteProjectDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 {n} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432 \u0432 {name}, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B \u0438 \u0437\u0430\u043F\u0438\u0441\u0438. \u041A\u0430\u0442\u0430\u043B\u043E\u0433 \u043F\u0440\u043E\u0435\u043A\u0442\u0430 \u0438 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteProjectConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.deleteUngroupedTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteUngroupedDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 {n} \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B \u0438 \u0437\u0430\u043F\u0438\u0441\u0438. \u0414\u0440\u0443\u0433\u0438\u0435 \u043F\u0440\u043E\u0435\u043A\u0442\u044B \u0438 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteUngroupedConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteBatchPending":"\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432\u2026","archives.deleteSuccess":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432: {n}.","archives.deleteSuccessWithSkipped":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E {deleted} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432 \u0438 \u043E\u0447\u0438\u0449\u0435\u043D\u043E {skipped} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430 \u0434\u043B\u044F \u043D\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.deleteSkipped":"\u041E\u0447\u0438\u0449\u0435\u043D\u043E {n} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430 \u0434\u043B\u044F \u043D\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.deletePartial":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E {deleted} \u0447\u0430\u0442\u043E\u0432 \u0438 \u043E\u0447\u0438\u0449\u0435\u043D\u043E {skipped} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430; {failed} \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0443\u0434\u0430\u043B\u0438\u0442\u044C: {detail}","archives.unarchiveUnknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0435\u0451 \u043D\u0435\u043B\u044C\u0437\u044F \u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430.","archives.unarchiveFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430: {detail}","archives.archiveUnknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0435\u0451 \u043D\u0435\u043B\u044C\u0437\u044F \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C.","archives.archiveFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E: {detail}","archives.archiveActive":"\u042D\u0442\u043E\u0442 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u0432\u0441\u0451 \u0435\u0449\u0451 \u0432\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F ({kinds}).","archiveActive.title":"\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archiveActive.desc":"\u0412 \xAB{name}\xBB \u0435\u0449\u0451 \u0438\u0434\u0451\u0442 \u0440\u0430\u0431\u043E\u0442\u0430: {kinds}. \u0410\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u0441\u043D\u0430\u0447\u0430\u043B\u0430 \u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442 \u0435\u0451.","archiveActive.confirm":"\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archives.forkFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0432\u0435\u0442\u043A\u0443 \u0441\u0435\u0441\u0441\u0438\u0438: {detail}","deleteSession.title":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","deleteSession.confirmTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E?","deleteSession.desc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 \u0441\u0435\u0441\u0441\u0438\u044E \xAB{name}\xBB, \u0435\u0451 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B (\u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0435\u0449\u0451 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435) \u0438 \u0432\u0441\u0435 \u0435\u0451 \u0437\u0430\u043F\u0438\u0441\u0438 (\u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A\u0443, \u043A\u044D\u0448). \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","deleteSession.pending":"\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438\u2026","deleteSession.unknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438\u043B\u0438 \u0443\u0436\u0435 \u0443\u0434\u0430\u043B\u0435\u043D\u0430.","deleteSession.failed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0443\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E: {detail}","menu.archiveWorkspace":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0443\u044E \u043E\u0431\u043B\u0430\u0441\u0442\u044C","menu.copyWorkspacePath":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u0443\u0442\u044C \u043A \u043F\u0430\u043F\u043A\u0435","menu.openInExplorer":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043F\u0430\u043F\u043A\u0443","menu.moveSession":"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u0432 \u043F\u0440\u043E\u0435\u043A\u0442","moveSession.noOtherWorkspaces":"\u041D\u0435\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0445 \u043F\u0440\u043E\u0435\u043A\u0442\u043E\u0432","moveSession.success":"\u0421\u0435\u0441\u0441\u0438\u044F \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u043F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0430 \u0432 \xAB{name}\xBB","archiveWorkspace.title":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C {n} \u0441\u0435\u0441\u0441\u0438\u0439?","archiveWorkspace.desc":"\u042D\u0442\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0435\u0442 \u0441\u0435\u0441\u0441\u0438\u0438 \u0432 \xAB{name}\xBB. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u043D\u0430\u0439\u0442\u0438 \u043F\u043E\u0437\u0436\u0435 \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archiveWorkspace.confirm":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435","archiveWorkspace.pending":"\u0410\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u0441\u0435\u0441\u0441\u0438\u0439\u2026","date.ymd":"{y}-{m}-{d}"},_e="archive-manager-workspace",Ta=["slots","sessions","workspaces","locale","remote","typert"];function sr(n){return{getSnapshot:n.getSnapshot.bind(n),subscribe:n.subscribe.bind(n)}}e(sr,"bindObservable");function Jr(n){return async a=>{if(typeof n?.unarchiveSession!="function")throw new Error("archive-manager: host unarchiveSession is unavailable");await n.unarchiveSession(a)}}e(Jr,"createUnarchiveSession");async function ar(n,a,o){let h=new Set(n.list?.getSnapshot?.()?.archivedSessionIds??[]),v=await Jn(a,async k=>{try{await n.archiveSession(k)}catch(E){throw E!==null&&typeof E=="object"&&Bn(E)!==void 0&&typeof ce(E).sessionId!="string"&&Object.assign(E,{sessionId:k}),E}return!0},{refresh:o}),f=[...n.list?.getSnapshot?.()?.archivedSessionIds??[]];return{archivedSessionIds:f,archivedSessionIdsAdded:f.filter(k=>!h.has(k)),failures:v.failures}}e(ar,"archiveSessionsViaOfficial");async function Xr(n,a,o,h){let v=new Set(n.list?.getSnapshot?.()?.archivedSessionIds??[]),f=typeof h=="function"?h:N=>n.unarchiveSession?.(N),k=await Jn(a,async N=>(await f(N),!0),{refresh:o}),E=[...n.list?.getSnapshot?.()?.archivedSessionIds??[]];return{archivedSessionIds:E,unarchivedSessionIds:[...v].filter(N=>!E.includes(N)),failures:k.failures}}e(Xr,"unarchiveSessionsViaOfficial");let Aa=220;function Qr({triggerRect:n,viewport:a,itemCount:o,measuredHeight:h,measuredWidth:v}){let f=a.width,k=a.height,E=typeof v=="number"&&v>0?Math.min(280,Math.max(160,v)):Aa,N=Math.max(200,k-24),H=Math.min(520,N),A=o===0?44:34*o+8,z=Math.min(H,Math.max(20,typeof h=="number"&&h>0?h:A)),O=n.right+2,d="right";O+E>f-10&&(O=Math.max(10,n.left-E-4),d="left");let oe=n.top-4;if(oe+z>k-10){let pe=n.bottom+4-z;pe>=10?oe=pe:oe=Math.max(10,k-z-10)}oe<10&&(oe=10);let Re=Math.min(H,Math.max(60,k-10-oe));return{top:oe,left:O,maxHeight:Re,side:d}}e(Qr,"computeSubmenuPosition");function es(n,a,o){return{height:typeof a=="number"&&a>0?a:n.height,width:typeof o=="number"&&o>0?o:n.width}}e(es,"mergeSubmenuMeasurement");function ts({surfaceRef:n,submenuId:a,pos:o,workspaces:h,moving:v,t:f,onSelect:k,onEnter:E,onLeave:N}){let H=u.MenuSurface,A=u.MenuItemButton;if(!C())return null;let z=h.length===0?(0,s.jsx)("div",{className:"dsham_moveSubmenuEmpty",children:f("moveSession.noOtherWorkspaces")}):h.map(O=>{let d=O.title||O.path||O.workspaceId,oe=(0,s.jsx)(u.IconFolderCloseMedium,{size:14,"aria-hidden":!0}),Re=(0,s.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0},children:d});return(0,s.jsx)(A,{icon:oe,disabled:v,onSelect:e(()=>k(O.workspaceId,d),"onSelect"),children:Re},O.workspaceId)});return(0,s.jsx)(H,{ref:n,id:a,className:"dsham_moveSubmenu",role:"menu","aria-label":f("menu.moveSession"),"data-dsham-move-submenu":"true","data-dsham-side":o.side,onPointerDown:e(O=>{O.stopPropagation()},"onPointerDown"),onMouseDown:e(O=>{O.stopPropagation()},"onMouseDown"),onMouseEnter:E,onMouseLeave:N,style:{top:o.top,left:o.left,maxHeight:o.maxHeight},children:z})}e(ts,"MoveSubmenu");async function _a(n){Ra(n);let a=n.get("remote"),o=e(()=>{},"disposeRemote");return a!==void 0&&(o=await a.$mount(en)),async()=>{await o()}}e(_a,"apply");function Ra(n){n.effect(()=>n.locale.register(_e,{zh:Yr,en:Zr,ru:Ia}),"dsh-archive-manager: dictionaries");let a=e(()=>n.get("uiWorkspace"),"uiWorkspaceAt"),o={},h,v=e(p=>(h=Ds(p,n.sessions,n.workspaces,{onOpened:e(()=>n.get("layout")?.selectPanel(null),"onOpened"),beginNavigation:e(()=>n.get("layout")?.beginNavigation?.(),"beginNavigation")}),()=>h?.dispose()),"attachArchiveNavigation");n.effect(()=>v(a()),"archive-manager: explicit archived navigation");let f=e(p=>{if(h===void 0)throw new Qt("navigationUnavailable");return zr.request(p),h.open(p)},"openConversation"),k=e(async p=>{n.get("layout")?.beginNavigation?.(),zr.request(p)},"focusSessionWorkspace"),E=e(async(p,b)=>{let I=await n.sessions.search(p,b);if(!I.ok)throw new Error(I.error.message);return I.value},"searchSessions"),N=e(async()=>{if(typeof n.sessions.refresh!="function")return null;try{return await oe(),null}catch(p){return console.warn("archive-manager: restored archived sessions but session list refresh failed:",p),p instanceof Error?p.message:String(p)}},"refreshSessionList"),H=Jr(n.workspaces),A=e(async(p,...b)=>{let I=n.get("remote.workspaceRegistry");if(!I||typeof I[p]!="function")throw new Error(n.locale.bind(_e)("service.unavailable"));let ye=await I[p].apply(I,b);if(!ye.ok)throw new Error(ye.error.message);return ye.value},"registryCall"),z=e(()=>A("diagnoseOrphanSubagents"),"diagnoseOrphanSubagents"),O=e(()=>A("diagnoseSessionCaches"),"diagnoseSessionCaches"),d=e(p=>A("rebuildSessionCaches",p),"rebuildSessionCaches"),oe=e(async()=>{if(typeof n.sessions.refresh!="function")throw new Error("Official session list refresh is unavailable");let p=await n.sessions.refresh(),b=n.sessions,I=b.manager;if(I?.listState==="error"&&I.listError)throw new Error(Oe(I.listError));if(b.listState==="error"&&b.listError)throw new Error(Oe(b.listError));let $=b.list?.getSnapshot?.();if($?.state==="error"&&$.error)throw new Error(Oe($.error));if(p&&typeof p=="object"&&"ok"in p&&p.ok===!1)throw new Error(Oe(p.error??"Session list refresh failed"))},"refreshCacheLists"),Re=e((p={})=>A("cleanOrphanSubagents",p??{}),"cleanOrphanSubagents"),pe=e(p=>A("searchArchivedContent",p),"searchArchivedContent"),kt=e(p=>A("searchSessionContent",p),"searchSessionContent"),ut=e(p=>A("previewArchivedSession",p),"previewArchivedSession"),ct=e(()=>A("favoriteSessions"),"favoriteSessions"),cn=e(p=>A("setSessionFavorite",p),"setSessionFavorite"),st=Tr();st.bind({favoriteSessions:ct,setSessionFavorite:cn});let Ge,dn=Ir(n,st,()=>n.locale.bind(_e),()=>Ge?.isSidebarFavoriteStarEnabled()??!0);n.effect(()=>()=>dn.dispose(),"archive-manager: favorites only filter");let At=Gs({workspaces:n.workspaces.list,sessions:n.sessions.list,archive:e(p=>n.workspaces.archiveSession(p),"archive"),restore:e(async p=>{await H(p)},"restore"),deleteOne:e(async p=>{let b=n.get("remote.workspaceRegistry");if(!b)throw new Error(n.locale.bind(_e)("service.unavailable"));let I=await b.deleteSession(p);if(!I.ok)throw new Error(I.error.message)},"deleteOne"),getFavorites:ct,refresh:e(()=>n.sessions.refresh?.(),"refresh"),currentSessionId:Zn}),Mt=e(async p=>{await H(p),await N()},"unarchiveSession"),q=e(async p=>{let b=n.get("remote.workspaceRegistry");if(b===void 0)throw new Error("archive-manager remote service is unavailable");let I=await b.deleteSession(p);if(!I.ok)throw new Error(I.error.message);await N()},"deleteSession"),Me=e(async(p,b)=>{let I=n.get("remote.workspaceRegistry");if(I===void 0)throw new Error("archive-manager remote service is unavailable");let $=await I.moveSessionToWorkspace({sessionId:p,targetWorkspaceId:b});if(!$.ok)throw new Error($.error?.message||"move failed");return await N(),$.value},"moveSession"),ee=e(async p=>ar(n.workspaces,p,N),"archiveSessions"),Z=e(async p=>{let b=n.workspaces.list?.getSnapshot?.()??{archivedSessionIds:[],items:[]},I=bn(b.archivedSessionIds,b.items,p);return Xr(n.workspaces,I,N,H)},"unarchiveSessions"),ze=e(async p=>{let b=n.get("remote.workspaceRegistry");if(b===void 0)throw new Error("archive-manager remote service is unavailable");let I=await b.deleteArchivedSessions(p);if(!I.ok)throw new Error(I.error.message);let $=await N();return{...I.value,refreshError:$}},"deleteArchivedSessions"),at=e(async()=>{let p=n.get("remote.workspaceRegistry");if(p===void 0)throw new Error("archive-manager remote service is unavailable");let b=await p.archivedSessionMetadata();if(!b.ok)throw new Error(b.error.message);return b.value},"archivedSessionMetadata"),L="sidebar.workspaces.session.menu.item",je=null,Ce=new Set,He=e(p=>{je=p;for(let b of Ce)b()},"publishDeleteTarget");function ht(){return l.useSyncExternalStore(p=>(Ce.add(p),()=>{Ce.delete(p)}),()=>je,()=>je)}e(ht,"useDeleteRequest");let Ke=e(()=>m(p=>n.get(p)),"hasNativeContextMenus");function zt({sessionId:p,displayTitle:b,useMenuOpenState:I,t:$}){if(Ke())return null;let[,ye]=I(),se=u.MenuItemButton,ge=(0,s.jsx)(u.IconTrashOutlineRegular,{size:14}),de=e(()=>{ye(!1),He({sessionId:p,title:b})},"onSelect");return typeof se=="function"?(0,s.jsx)(se,{danger:!0,icon:ge,onSelect:de,children:$("menu.deleteSession")}):(0,s.jsx)("button",{type:"button",role:"menuitem",onClick:de,children:$("menu.deleteSession")})}e(zt,"DeleteSessionMenuItem");function yn({sessionId:p,favoriteRow:b,useMenuOpenState:I,t:$}){if(Ke())return null;let[,ye]=I(),se=(0,l.useSyncExternalStore)(b.subscribe,b.getSnapshot),ge=se.ready&&se.ids.has(p),de=e(()=>{ye(!1),b.toggle(p)},"onSelect"),ae=u.MenuItemButton,Ne=(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:ge?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round","aria-hidden":!0,children:(0,s.jsx)("path",{d:Ht})}),Ue=$(ge?"organizer.unfavorite":"organizer.favorite");return typeof ae=="function"?(0,s.jsx)(ae,{icon:Ne,onSelect:de,children:Ue}):(0,s.jsx)("button",{type:"button",role:"menuitem",onClick:de,children:Ue})}e(yn,"FavoriteMenuItem");let Vt=null,Ct=new Set;function Te(p,b="success"){Vt={text:p,tone:b,seq:Date.now()};for(let I of Ct)I()}e(Te,"showToast");function $t(){let p=l.useSyncExternalStore(I=>(Ct.add(I),()=>{Ct.delete(I)}),()=>Vt,()=>Vt);if(!p)return null;let b=u.Toast;return typeof b=="function"?(0,s.jsx)(b,{key:p.seq,text:p.text,tone:p.tone,holdMs:3e3,onDone:e(()=>{if(Vt?.seq===p.seq){Vt=null;for(let I of Ct)I()}},"onDone")}):(0,s.jsx)("div",{key:p.seq,style:{position:"fixed",top:16,left:"50%",transform:"translateX(-50%)",zIndex:99999,padding:"8px 16px",borderRadius:8,background:p.tone==="danger"?"#7f1d1d":"#14532d",color:"#fff",fontSize:13,boxShadow:"0 4px 16px rgba(0,0,0,0.4)"},children:p.text})}e($t,"GlobalToastOverlay");function wn({sessionId:p,displayTitle:b,useMenuOpenState:I,t:$}){let[,ye]=I(),se=l.useId(),[ge,de]=l.useState(!1),[ae,Ne]=l.useState(null),[Ue,We]=l.useState(!1),Ae=l.useRef(null),te=l.useRef(null),ne=l.useRef(null),M=l.useRef({}),K=y(n.workspaces.list?.getSnapshot?.()?.items??[],p),ve=u.MenuItemButton;l.useEffect(()=>{let we=Ae.current?.querySelector(':scope > div > button[role="menuitem"], :scope > button[role="menuitem"]');we&&(we.setAttribute("aria-haspopup","menu"),we.setAttribute("aria-expanded",ge?"true":"false"),ge?we.setAttribute("aria-controls",se):we.removeAttribute("aria-controls"))},[ge,se]);let Y=e((we,rt)=>{if(!Ae.current)return;M.current=es(M.current,we,rt);let Je=Ae.current.getBoundingClientRect(),Ie=typeof window<"u"?window.innerWidth:1024,Ve=typeof window<"u"?window.innerHeight:768,mt=Qr({triggerRect:Je,viewport:{width:Ie,height:Ve},itemCount:K.length,measuredHeight:M.current.height,measuredWidth:M.current.width});Ne(wt=>wt&&wt.top===mt.top&&wt.left===mt.left&&wt.maxHeight===mt.maxHeight&&wt.side===mt.side?wt:mt)},"updatePosition"),be=e(()=>{ne.current&&clearTimeout(ne.current),Y(),de(!0)},"handleMouseEnter");l.useLayoutEffect(()=>{if(!ge||!te.current)return;let we=te.current;we.offsetHeight>0&&Y(we.offsetHeight,we.offsetWidth)},[ge,K.length]),l.useEffect(()=>{if(!ge||typeof window>"u")return;let we=e(()=>Y(),"reposition");return window.addEventListener("resize",we),window.addEventListener("scroll",we,!0),()=>{window.removeEventListener("resize",we),window.removeEventListener("scroll",we,!0)}},[ge,K.length]),l.useEffect(()=>()=>{ne.current&&clearTimeout(ne.current)},[]);let Ee=e(()=>{ne.current=setTimeout(()=>{de(!1)},180)},"handleMouseLeave"),Ye=e(async(we,rt)=>{if(!Ue){We(!0),de(!1),ye(!1);try{await Me(p,we),Te($("moveSession.success",{name:rt})||`\u4F1A\u8BDD\u5DF2\u6210\u529F\u79FB\u52A8\u5230\u201C${rt}\u201D`,"success")}catch(Je){let Ie=Je instanceof Error?Je.message:String(Je);console.warn("archive-manager: move session failed",Je),Te(Ie,"danger")}finally{We(!1)}}},"handleSelectWorkspace"),Ze=(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:14,height:14,fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,s.jsx)("path",{d:"M2 3.5C2 2.67157 2.67157 2 3.5 2H6.5L8 4H12.5C13.3284 4 14 4.67157 14 5.5V12.5C14 13.3284 13.3284 14 12.5 14H3.5C2.67157 14 2 13.3284 2 12.5V3.5Z"}),(0,s.jsx)("path",{d:"M8 7.5L10.5 10L8 12.5"}),(0,s.jsx)("path",{d:"M5.5 10H10.5"})]}),qe=(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,style:{marginLeft:"auto",opacity:.65},children:(0,s.jsx)("path",{d:"M6 3.5L10.5 8L6 12.5"})}),Le=(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",gap:8},children:[(0,s.jsx)("span",{children:$("menu.moveSession")}),qe]});if(!C())return null;let Pe=(0,s.jsx)(ve,{icon:Ze,onSelect:e(()=>be(),"onSelect"),children:Le});return(0,s.jsxs)("div",{ref:Ae,className:"dsham_moveSessionWrap",onMouseEnter:be,onMouseLeave:Ee,children:[Pe,ge&&ae&&(0,s.jsx)(ts,{surfaceRef:te,submenuId:se,pos:ae,workspaces:K,moving:Ue,t:$,onSelect:e((we,rt)=>{Ye(we,rt)},"onSelect"),onEnter:be,onLeave:Ee})]})}e(wn,"MoveSessionMenuItem");function Q(p){try{let b=document.querySelector(`[data-row-key="session:${CSS.escape(p)}"]`);return b?(b.hasAttribute("tabindex")||(b.setAttribute("tabindex","-1"),b.addEventListener("blur",()=>b.removeAttribute("tabindex"),{once:!0})),typeof u.focusWithoutRing=="function"?u.focusWithoutRing(b):b.focus(),!0):!1}catch{return!1}}e(Q,"focusSessionRow");function nt({t:p}){let b=ht(),[I,$]=(0,l.useState)(!1),[ye,se]=(0,l.useState)(null),[ge,de]=(0,l.useState)(null),ae=(0,l.useRef)(null),Ne=(0,l.useRef)(null),Ue=(0,l.useRef)(null);if((0,l.useLayoutEffect)(()=>{if(b===null||typeof document>"u"){de(null);return}let te=null,ne=e(()=>{if(te&&te.isConnected)return te;try{te=document.querySelector(`[data-row-key="session:${CSS.escape(b.sessionId)}"]`)}catch{te=null}return te},"getTargetRow"),M=e(()=>{let ve=ae.current,Y=ve?.offsetWidth||290,be=ve?.offsetHeight||160,Ee=8,Ye=ne();if(!Ye){let Pe=window.innerWidth,we=window.innerHeight,rt=Math.max(16,(we-be)/2),Je=Math.max(16,(Pe-Y)/2);de(Ie=>Ie!==null&&Ie.top===rt&&Ie.left===Je?Ie:{top:rt,left:Je});return}let Ze=Ye.getBoundingClientRect(),qe=Ze.top-4;qe+be>window.innerHeight-16&&(qe=window.innerHeight-16-be),qe<16&&(qe=16);let Le=Ze.right+Ee;Le+Y>window.innerWidth-16&&(Le=Ze.left-Y-Ee),Le<16&&(Le=16),de(Pe=>Pe!==null&&Pe.top===qe&&Pe.left===Le?Pe:{top:qe,left:Le})},"updatePosition");M(),window.addEventListener("scroll",M,!0),window.addEventListener("resize",M);let K=null;return typeof ResizeObserver<"u"&&ae.current&&(K=new ResizeObserver(M),K.observe(ae.current)),()=>{K?.disconnect(),window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",M)}},[b]),(0,l.useEffect)(()=>{if(b===null)return;Ne.current&&!Ne.current.disabled?Ne.current.focus():ae.current?.focus();let te=b.sessionId;return()=>{if(!Q(te)){let M=document.querySelector('[role="treeitem"][aria-selected="true"]');M&&(M.hasAttribute("tabindex")||(M.setAttribute("tabindex","-1"),M.addEventListener("blur",()=>M.removeAttribute("tabindex"),{once:!0})),typeof u.focusWithoutRing=="function"?u.focusWithoutRing(M):M.focus())}}},[b]),(0,l.useEffect)(()=>{b!==null&&I&&ae.current?.focus()},[b,I]),(0,l.useEffect)(()=>{if(b===null)return;let te=e(ne=>{if(ne.key==="Escape"){ne.preventDefault(),ne.stopPropagation(),"stopImmediatePropagation"in ne&&typeof ne.stopImmediatePropagation=="function"&&ne.stopImmediatePropagation(),I||(se(null),He(null));return}if(ne.key==="Tab"){if(ne.preventDefault(),I){ae.current?.focus();return}let M=Ne.current,K=Ue.current;if(!M||!K)return;ne.shiftKey?document.activeElement===M?K.focus():M.focus():document.activeElement===K?M.focus():K.focus()}},"onKey");return window.addEventListener("keydown",te,!0),()=>window.removeEventListener("keydown",te,!0)},[b,I]),b===null)return null;let We=e(()=>{I||(se(null),He(null))},"close"),Ae=e(()=>{$(!0),se(null),q(b.sessionId).then(()=>{$(!1),He(null)}).catch(te=>{$(!1),se(Xn(te,p))})},"confirm");return(0,s.jsxs)("div",{className:"dsham_sidebarCardRoot",children:[(0,s.jsx)("div",{className:"dsham_sidebarCardBackdrop",onClick:We}),(0,s.jsxs)("div",{ref:ae,role:"dialog","aria-modal":!0,"aria-label":p("deleteSession.title"),tabIndex:-1,className:"dsham_sidebarCard",style:ge?{top:ge.top,left:ge.left,visibility:"visible"}:{visibility:"hidden",top:0,left:0},children:[(0,s.jsx)("h3",{className:"dsham_sidebarCardTitle",children:p("deleteSession.confirmTitle")}),(0,s.jsx)("p",{className:"dsham_sidebarCardDesc",children:p("deleteSession.desc",{name:b.title})}),I&&(0,s.jsx)("div",{className:"dsham_sidebarCardDesc",role:"status",children:p("deleteSession.pending")}),ye!==null&&(0,s.jsx)("div",{className:"dsham_sidebarCardError",role:"alert",children:ye}),(0,s.jsxs)("div",{className:"dsham_sidebarCardFooter",children:[(0,s.jsx)("button",{ref:Ne,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnCancel",disabled:I,onClick:We,children:p("cancel")}),(0,s.jsx)("button",{ref:Ue,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnDanger",disabled:I,onClick:Ae,children:p("deleteSession.title")})]})]})]})}e(nt,"DeleteSessionOverlay");let _t=null,G=new Set,Gt=e(p=>{_t=p;for(let b of G)b()},"publishArchiveWsTarget");function Be(){return l.useSyncExternalStore(p=>(G.add(p),()=>{G.delete(p)}),()=>_t,()=>_t)}e(Be,"useArchiveWsRequest");function un(p){try{let b=document.querySelector(`[data-row-key="workspace:${CSS.escape(p)}"]`);return b?(b.hasAttribute("tabindex")||(b.setAttribute("tabindex","-1"),b.addEventListener("blur",()=>b.removeAttribute("tabindex"),{once:!0})),typeof u.focusWithoutRing=="function"?u.focusWithoutRing(b):b.focus(),!0):!1}catch{return!1}}e(un,"focusWorkspaceRow");function Pt({t:p}){let b=Be(),[I,$]=(0,l.useState)(!1),[ye,se]=(0,l.useState)(null),[ge,de]=(0,l.useState)(null),ae=(0,l.useRef)(null),Ne=(0,l.useRef)(null),Ue=(0,l.useRef)(null);if((0,l.useLayoutEffect)(()=>{if(b===null||typeof document>"u"){de(null);return}let te=null,ne=e(()=>{if(te&&te.isConnected)return te;try{te=document.querySelector(`[data-row-key="workspace:${CSS.escape(b.workspaceId)}"]`)}catch{te=null}return te},"getTargetRow"),M=e(()=>{let ve=ae.current,Y=ve?.offsetWidth||290,be=ve?.offsetHeight||160,Ee=8,Ye=ne();if(!Ye){let Pe=window.innerWidth,we=window.innerHeight,rt=Math.max(16,(we-be)/2),Je=Math.max(16,(Pe-Y)/2);de(Ie=>Ie!==null&&Ie.top===rt&&Ie.left===Je?Ie:{top:rt,left:Je});return}let Ze=Ye.getBoundingClientRect(),qe=Ze.top-4;qe+be>window.innerHeight-16&&(qe=window.innerHeight-16-be),qe<16&&(qe=16);let Le=Ze.right+Ee;Le+Y>window.innerWidth-16&&(Le=Ze.left-Y-Ee),Le<16&&(Le=16),de(Pe=>Pe!==null&&Pe.top===qe&&Pe.left===Le?Pe:{top:qe,left:Le})},"updatePosition");M(),window.addEventListener("scroll",M,!0),window.addEventListener("resize",M);let K=null;return typeof ResizeObserver<"u"&&ae.current&&(K=new ResizeObserver(M),K.observe(ae.current)),()=>{K?.disconnect(),window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",M)}},[b]),(0,l.useEffect)(()=>{if(b===null)return;Ne.current&&!Ne.current.disabled?Ne.current.focus():ae.current?.focus();let te=b.workspaceId;return()=>{un(te)}},[b]),(0,l.useEffect)(()=>{b!==null&&I&&ae.current?.focus()},[b,I]),(0,l.useEffect)(()=>{if(b===null)return;let te=e(ne=>{if(ne.key==="Escape"){ne.preventDefault(),ne.stopPropagation(),"stopImmediatePropagation"in ne&&typeof ne.stopImmediatePropagation=="function"&&ne.stopImmediatePropagation(),I||(se(null),Gt(null));return}if(ne.key==="Tab"){if(ne.preventDefault(),I){ae.current?.focus();return}let M=Ne.current,K=Ue.current;if(!M||!K)return;ne.shiftKey?document.activeElement===M?K.focus():M.focus():document.activeElement===K?M.focus():K.focus()}},"onKey");return window.addEventListener("keydown",te,!0),()=>window.removeEventListener("keydown",te,!0)},[b,I]),b===null)return null;let We=e(()=>{I||(se(null),Gt(null))},"close"),Ae=e(()=>{$(!0),se(null);let ne=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(Y=>Y.workspaceId===b.workspaceId),M=n.sessions.list?.getSnapshot?.()?.byId??{},K=new Set(n.workspaces.list?.getSnapshot?.()?.archivedSessionIds??[]),ve=(ne?.sessionIds??[]).filter(Y=>Un(Y,M,K));ar(n.workspaces,ve,N).then(Y=>{if($(!1),Y.failures.length>0){se(Hn(Y.failures,p));return}Gt(null)}).catch(Y=>{$(!1),se(Rr(Y,p))})},"confirm");return(0,s.jsxs)("div",{className:"dsham_sidebarCardRoot",children:[(0,s.jsx)("div",{className:"dsham_sidebarCardBackdrop",onClick:We}),(0,s.jsxs)("div",{ref:ae,role:"dialog","aria-modal":!0,"aria-label":p("menu.archiveWorkspace"),tabIndex:-1,className:"dsham_sidebarCard",style:ge?{top:ge.top,left:ge.left,visibility:"visible"}:{visibility:"hidden",top:0,left:0},children:[(0,s.jsx)("h3",{className:"dsham_sidebarCardTitle",children:p("archiveWorkspace.title",{n:b.count})}),(0,s.jsx)("p",{className:"dsham_sidebarCardDesc",children:p("archiveWorkspace.desc",{name:b.title})}),I&&(0,s.jsx)("div",{className:"dsham_sidebarCardDesc",role:"status",children:p("archiveWorkspace.pending")}),ye!==null&&(0,s.jsx)("div",{className:"dsham_sidebarCardError",role:"alert",children:ye}),(0,s.jsxs)("div",{className:"dsham_sidebarCardFooter",children:[(0,s.jsx)("button",{ref:Ne,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnCancel",disabled:I,onClick:We,children:p("cancel")}),(0,s.jsx)("button",{ref:Ue,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnDanger",disabled:I,onClick:Ae,children:p("archiveWorkspace.confirm")})]})]})]})}e(Pt,"ArchiveWorkspaceOverlay");function Sn(p){if(typeof document>"u"||typeof document.addEventListener!="function"||typeof MutationObserver>"u")return()=>{};let b=null,I=!1,$=new Map,ye=!1,se=e(M=>{let ve=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(Ee=>Ee.workspaceId===M);if(ve===void 0)return[];let Y=n.sessions.list?.getSnapshot?.()?.byId??{},be=new Set(n.workspaces.list?.getSnapshot?.()?.archivedSessionIds??[]);return ve.sessionIds.filter(Ee=>Un(Ee,Y,be))},"workspaceCandidateIds"),ge=e(()=>{if(ye=!1,!I)for(let[M,K]of $){if(!M.isConnected){$.delete(M);continue}let ve=se(K.workspaceId).length===0;M.disabled=ve,M.style.opacity=ve?"0.5":"",M.style.cursor=ve?"not-allowed":""}},"revalidateItems"),de=e(()=>{if($.size===0||ye||I)return;ye=!0;let M=e(()=>ge(),"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(M):setTimeout(M,16)},"scheduleRevalidate"),ae=e(M=>{b=Mr(M.target)},"rememberWorkspace");document.addEventListener("pointerdown",ae,!0),document.addEventListener("click",ae,!0);let Ne=e(()=>{if(I)return;for(let[K]of $)K.isConnected||$.delete(K);let M=document.querySelectorAll('[role="menu"]');for(let K of M){if(K.querySelector('[data-dsham-archive-workspace="true"]'))continue;let ve=Array.from(K.querySelectorAll('button[role="menuitem"]'));if(ve.length===0)continue;let Y=ve.find(Xe=>er(Xe,!1))??ve.find(Xe=>er(Xe,!0));if(!Y)continue;let be=ve.find(Xe=>Xe!==Y)??Y,Ee=Y.parentElement;if(!Ee)continue;let Ye=b;if(!Ye)continue;let qe=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(Xe=>Xe.workspaceId===Ye.workspaceId),Le=qe?.path??qe?.cwd,we=se(Ye.workspaceId).length,rt=document.createElement("div");rt.className=Ee.className;let Je=be.className.split(/\s+/).filter(Xe=>!/(?:^|[_-])danger(?:$|[_-])/i.test(Xe)).join(" "),Ie=document.createElement("button");Ie.type="button",Ie.setAttribute("role","menuitem"),Ie.dataset.dshamArchiveWorkspace="true",Ie.className=Je;let Ve=be.querySelector("span"),mt=be.querySelectorAll("span")[1],wt=document.createElement("span");wt.setAttribute("aria-hidden","true"),Ve?.className&&(wt.className=Ve.className),wt.innerHTML='<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M13.5 2.5H2.5C1.94772 2.5 1.5 2.94772 1.5 3.5V4.5C1.5 5.05228 1.94772 5.5 2.5 5.5H13.5C14.0523 5.5 14.5 5.05228 14.5 4.5V3.5C14.5 2.94772 14.0523 2.5 13.5 2.5Z"/><path d="M2.5 5.5V13.5C2.5 13.7652 2.60536 14.0196 2.79289 14.2071C2.98043 14.3946 3.23478 14.5 3.5 14.5H12.5C12.7652 14.5 13.0196 14.3946 13.2071 14.2071C13.3946 14.0196 13.5 13.7652 13.5 13.5V5.5"/><path d="M6.5 9.5H9.5"/></svg>';let hn=document.createElement("span");if(mt?.className&&(hn.className=mt.className),hn.textContent=p("menu.archiveWorkspace"),Ie.append(wt,hn),rt.append(Ie),we===0&&(Ie.disabled=!0,Ie.style.opacity="0.5",Ie.style.cursor="not-allowed"),Ie.addEventListener("click",Xe=>{Xe.preventDefault(),Xe.stopPropagation();let ft=se(Ye.workspaceId).length;ft!==0&&(document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),Gt({workspaceId:Ye.workspaceId,title:Ye.title,count:ft}))}),Le){let Xe=document.createElement("div");Xe.className=Ee.className;let ft=document.createElement("button");ft.type="button",ft.setAttribute("role","menuitem"),ft.dataset.dshamCopyWorkspacePath="true",ft.className=Je,ft.disabled=!1,ft.style.opacity="",ft.style.cursor="";let gt=document.createElement("span");gt.setAttribute("aria-hidden","true"),Ve?.className&&(gt.className=Ve.className),gt.innerHTML='<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><rect x="5.5" y="5.5" width="8" height="8" rx="1.5"/><path d="M10.5 3.5V2.5C10.5 1.94772 10.0523 1.5 9.5 1.5H3.5C2.94772 1.5 2.5 1.94772 2.5 2.5V8.5C2.5 9.05228 2.94772 9.5 3.5 9.5H4.5"/></svg>';let sn=document.createElement("span");mt?.className&&(sn.className=mt.className),sn.textContent=p("menu.copyWorkspacePath"),ft.append(gt,sn),Xe.append(ft),ft.addEventListener("click",Xt=>{Xt.preventDefault(),Xt.stopPropagation(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),Yn(Le).catch(()=>{})});let Jt=document.createElement("div");Jt.className=Ee.className;let vt=document.createElement("button");vt.type="button",vt.setAttribute("role","menuitem"),vt.dataset.dshamOpenExplorer="true",vt.className=Je,vt.disabled=!1,vt.style.opacity="",vt.style.cursor="";let Tt=document.createElement("span");Tt.setAttribute("aria-hidden","true"),Ve?.className&&(Tt.className=Ve.className),Tt.innerHTML='<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M1.5 3.5C1.5 2.94772 1.94772 2.5 2.5 2.5H6.5L8 4.5H13.5C14.0523 4.5 14.5 4.94772 14.5 5.5V12.5C14.5 13.0523 14.0523 13.5 13.5 13.5H2.5C1.94772 13.5 1.5 13.0523 1.5 12.5V3.5Z"/><path d="M10 8.5L12 10.5L10 12.5"/><path d="M6.5 10.5H12"/></svg>';let An=document.createElement("span");mt?.className&&(An.className=mt.className),An.textContent=p("menu.openInExplorer"),vt.append(Tt,An),Jt.append(vt),vt.addEventListener("click",Xt=>{Xt.preventDefault(),Xt.stopPropagation(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),(async()=>{try{let pn=await fetch(fn("/open-in-app/open"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({app:"explorer",path:Le})}).catch(()=>null);if(pn&&pn.ok)return}catch{}try{await Ft("/open-in-explorer",{method:"POST",body:JSON.stringify({path:Le,workspaceId:Ye.workspaceId})})}catch(pn){console.warn("archive-manager: open in explorer failed",pn)}})()}),Ee.parentNode?.insertBefore(Xe,Ee),Ee.parentNode?.insertBefore(Jt,Ee)}Ee.parentNode?.insertBefore(rt,Ee),$.set(Ie,{workspaceId:Ye.workspaceId})}},"checkAndInject"),Ue=!1,We=e(()=>{if(Ue||I)return;Ue=!0;let M=e(()=>{Ue=!1,!I&&Ne()},"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(M):setTimeout(M,16)},"scheduleInject"),Ae=new MutationObserver(M=>{Wn(M,'[role="menu"]')&&We()});Ae.observe(document.body,{childList:!0,subtree:!0});let te=n.sessions.list?.subscribe?.(de),ne=n.workspaces.list?.subscribe?.(de);return()=>{I=!0,document.removeEventListener("pointerdown",ae,!0),document.removeEventListener("click",ae,!0),Ae.disconnect(),te?.(),ne?.(),$.clear();for(let M of document.querySelectorAll('[data-dsham-archive-workspace="true"], [data-dsham-copy-workspace-path="true"], [data-dsham-open-explorer="true"]'))M.parentElement?.remove()}}e(Sn,"setupWorkspaceMenuInjector");function Et(){if(typeof n.slots.entries!="function")return!1;if(n.slots.entries("sidebar.workspaces").some(I=>I.children?.[L]!==void 0)||n.slots.entries("contextMenu.content").some(I=>I.children?.[L]!==void 0))return!0;try{if(n.get("contextMenus")!==void 0&&n.slots.entries("contextMenu.content").length>0)return!0}catch{}return!1}e(Et,"hostSidebarDeclaresSessionMenu");let Kt,Ot,xn,kn,Cn,Yt,En,Dt=e(()=>{let p=Et()?"menu":"waiting";p!==Kt&&(Kt=p,p==="menu"&&(Ot??=n.slots.inject(L,()=>n.slots.register({name:L,id:"archive-manager.delete-session",order:9999,locale:_e,inject:e(()=>({}),"inject")},zt)),xn??=n.slots.inject(L,()=>n.slots.register({name:L,id:"archive-manager.favorite",order:1,locale:_e,inject:e(()=>({favoriteRow:st}),"inject")},yn)),C()&&(kn??=n.slots.inject(L,()=>n.slots.register({name:L,id:"archive-manager.move-session",order:480,locale:_e,inject:e(()=>({}),"inject")},wn))),Cn??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.delete-session",locale:_e,inject:e(()=>({t:n.locale.bind(_e)}),"inject")},nt)),Yt??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.archive-workspace",locale:_e,inject:e(()=>({t:n.locale.bind(_e)}),"inject")},Pt)),En??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.toast",locale:_e,inject:e(()=>({}),"inject")},$t))))},"reconcileSidebar");Dt();let pt=(()=>{try{return n.get("contextMenus")}catch{return}})();pt&&typeof pt.register=="function"?n.effect(()=>{let p,b,I,$;try{p=n.slots.register({name:"contextMenu.icon",key:"archive-manager.explorer"},()=>(0,s.jsx)("svg",{width:14,height:14,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"M1.5 3.5C1.5 2.94772 1.94772 2.5 2.5 2.5H6.5L8 4.5H13.5C14.0523 4.5 14.5 4.94772 14.5 5.5V12.5C14.5 13.0523 14.0523 13.5 13.5 13.5H2.5C1.94772 13.5 1.5 13.0523 1.5 12.5V3.5Z"}),(0,s.jsx)("path",{d:"M10 8.5L12 10.5L10 12.5"}),(0,s.jsx)("path",{d:"M6.5 10.5H12"})]})),b=n.slots.register({name:"contextMenu.icon",key:"archive-manager.star-fill"},()=>(0,s.jsx)("svg",{width:14,height:14,viewBox:"0 0 16 16",fill:"#e8b931",stroke:"#e8b931",strokeWidth:1.2,strokeLinejoin:"round",children:(0,s.jsx)("path",{d:Ht})})),I=n.slots.register({name:"contextMenu.icon",key:"archive-manager.star-outline"},()=>(0,s.jsx)("svg",{width:14,height:14,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round",children:(0,s.jsx)("path",{d:Ht})})),$=n.slots.register({name:"contextMenu.icon",key:"archive-manager.workspace-archive"},()=>(0,s.jsx)("svg",{"data-dsham-archive-icon":"true",width:14,height:14,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"M13.5 2.5H2.5C1.94772 2.5 1.5 2.94772 1.5 3.5V4.5C1.5 5.05228 1.94772 5.5 2.5 5.5H13.5C14.0523 5.5 14.5 4.94772 14.5 4.5V3.5C14.5 2.94772 14.0523 2.5 13.5 2.5Z"}),(0,s.jsx)("path",{d:"M2.5 5.5V13.5C2.5 13.7652 2.60536 14.0196 2.79289 14.2071C2.98043 14.3946 3.23478 14.5 3.5 14.5H12.5C12.7652 14.5 13.0196 14.3946 13.2071 14.2071C13.3946 14.0196 13.5 13.7652 13.5 13.5V5.5"}),(0,s.jsx)("path",{d:"M6.5 9.5H9.5"})]}))}catch{}let ye=pt.register({id:"archive-manager.session-favorite",target:"session",order:1,observe:e(()=>[st,n.locale],"observe"),resolve:e(({sessionId:de})=>{let ae=st.getSnapshot(),Ne=ae.ready&&ae.ids.has(de);return[{id:"favorite",label:n.locale.bind(_e)(Ne?"organizer.unfavorite":"organizer.favorite"),icon:{key:Ne?"archive-manager.star-fill":"archive-manager.star-outline"},run:e(()=>{st.toggle(de)},"run")}]},"resolve")}),se=pt.register({id:"archive-manager.session-delete",target:"session",order:9999,observe:e(()=>[n.locale],"observe"),resolve:e(({sessionId:de,displayTitle:ae})=>[{id:"delete-session",label:n.locale.bind(_e)("menu.deleteSession"),icon:{key:"workspace.delete"},danger:!0,afterContent:!0,run:e(()=>{He({sessionId:de,title:ae||de})},"run")}],"resolve")}),ge=pt.register({id:"archive-manager.workspace-actions",target:"workspace",order:250,observe:e(()=>[n.workspaces.list,n.sessions.list,n.locale],"observe"),resolve:e(({workspaceId:de,path:ae,displayTitle:Ne})=>{let We=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(be=>be.workspaceId===de),Ae=n.sessions.list?.getSnapshot?.()?.byId??{},te=new Set(n.workspaces.list?.getSnapshot?.()?.archivedSessionIds??[]),M=(We?We.sessionIds.filter(be=>Un(be,Ae,te)):[]).length,K=n.locale.bind(_e),ve=ae??We?.path??We?.cwd,Y=[];return ve&&(Y.push({id:"copy-workspace-path",label:K("menu.copyWorkspacePath"),icon:{key:"workspace.copy"},run:e(()=>{Yn(ve).catch(()=>{})},"run")}),Y.push({id:"open-in-explorer",label:K("menu.openInExplorer"),icon:{key:"archive-manager.explorer"},run:e(()=>{(async()=>{try{let be=await fetch(fn("/open-in-app/open"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({app:"explorer",path:ve})}).catch(()=>null);if(be&&be.ok)return}catch{}try{await Ft("/open-in-explorer",{method:"POST",body:JSON.stringify({path:ve,workspaceId:de})})}catch(be){console.warn("archive-manager: open in explorer failed",be)}})()},"run")})),Y.push({id:"archive-workspace",label:K("menu.archiveWorkspace"),icon:{key:"archive-manager.workspace-archive"},disabled:M===0,separatorBefore:!0,run:e(()=>{M!==0&&Gt({workspaceId:de,title:Ne||de,count:M})},"run")}),Y},"resolve")});return()=>{ye?.(),se?.(),ge?.(),p?.(),b?.(),I?.(),$?.()}},"archive-manager: native workspace context menu"):n.effect(()=>Sn(n.locale.bind(_e)),"archive-manager: workspace menu injector"),n.effect(()=>Lr(),"archive-manager: sidebar row contextmenu trigger"),Fr(n);let Rt=typeof n.on=="function"?n.on("slots/changed",p=>{if(!(p!=="sidebar.workspaces"&&p!=="contextMenu.content"))try{Dt()}catch(b){console.warn("archive-manager: sidebar mode switch failed",b)}}):void 0;n.effect(()=>()=>{Rt?.(),Ot?.(),xn?.(),kn?.(),Cn?.(),Yt?.(),En?.()},"archive-manager: sidebar mode");let nn=e(()=>({archiveSessions:ee,archiveSession:e((p,b)=>n.workspaces.archiveSession(p,b),"archiveSession"),sessionStore:sr(n.sessions.list),workspaceStore:sr(n.workspaces.list),unarchiveSession:Mt,deleteSession:q,unarchiveSessions:Z,deleteArchivedSessions:ze,archivedSessionMetadata:at,openConversation:f,focusSessionWorkspace:k,viewState:o,favoriteSessions:ct,setSessionFavorite:cn,favoriteSync:st,organizeBatch:At,diagnoseOrphanSubagents:z,cleanOrphanSubagents:Re,diagnoseSessionCaches:O,rebuildSessionCaches:d,refreshCacheLists:oe,searchSessionContent:kt,searchArchivedContent:pe,previewArchivedSession:ut,t:n.locale.bind(_e)}),"buildArchivedSectionProps"),Ft=e(async(p,b)=>{let I=fn(`/api/michengai/dsh-archive-manager${p}`),$=Object.assign({"content-type":"application/json","x-michengai-plugin-update":"1"},b?.headers),ye=await fetch(I,Object.assign({},b,{headers:$})),se=await ye.json();if(!ye.ok||!se||se.ok===!1)throw new Error((se&&typeof se=="object"&&typeof se.error=="string"?se.error:void 0)||`HTTP ${ye.status}`);return se},"callSettingsApi"),It=null,jt=null,Ut=!1,In=e(({size:p=16})=>(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:p,height:p,fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"M13.5 2.5H2.5C1.94772 2.5 1.5 2.94772 1.5 3.5V4.5C1.5 5.05228 1.94772 5.5 2.5 5.5H13.5C14.0523 5.5 14.5 5.05228 14.5 4.5V3.5C14.5 2.94772 14.0523 2.5 13.5 2.5Z"}),(0,s.jsx)("path",{d:"M2.5 5.5V13.5C2.5 13.7652 2.60536 14.0196 2.79289 14.2071C2.98043 14.3946 3.23478 14.5 3.5 14.5H12.5C12.7652 14.5 13.0196 14.3946 13.2071 14.2071C13.3946 14.0196 13.5 13.7652 13.5 13.5V5.5"}),(0,s.jsx)("path",{d:"M6.5 9.5H9.5"})]}),"ArchiveNavIcon"),rn=e(()=>{if(!(!Ut||It)&&!(Ge&&!Ge.isSettingsSectionEnabled())){try{let p=n.slots.register({name:"settings.section.icon",id:"archive-manager",locale:_e},In);jt=typeof p=="function"?p:null}catch{jt=null}try{let p=n.slots.register({name:"settings.section",id:"archive-manager",order:45,label:e(()=>n.locale.bind(_e)("archived.badge"),"label"),icon:"archive",locale:_e,inject:nn},On);It=typeof p=="function"?p:()=>{}}catch(p){console.warn("archive-manager: register settings.section failed:",p),It=null}}},"mountSettingsSection"),Zt=e(()=>{if(jt){try{jt()}catch{}jt=null}if(It){try{It()}catch{}It=null}},"unmountSettingsSection"),Tn=e(()=>{Ge?.isSettingsSectionEnabled?.()??!0?rn():Zt()},"syncSettingsSection");Ge=Sr(n,{callApi:Ft,renderPanel:e(p=>(0,s.jsx)(On,Object.assign({},nn(),p)),"renderPanel"),injectProps:nn,ns:_e,onOnlineUpdateChange:e(()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("dsham-update-toggle"))},"onOnlineUpdateChange"),onSidebarFavoriteStarChange:e(p=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("dsham-favorite-star-toggle",{detail:{enabled:p}}))},"onSidebarFavoriteStarChange"),onLocationChange:e(()=>{Tn()},"onLocationChange")}),n.effect(()=>()=>{Ge?.destroy(),Zt()},"archive-manager: sidebar entry"),n.effect(()=>Ws({endpoint:"/api/michengai/dsh-archive-manager/update",packageName:"@michengai/dsh-archive-manager",titleRowSelector:".dsham_settingsTitleRow",linksSelector:".dsham_settingsLinks",zhName:"\u5F52\u6863\u4F1A\u8BDD",enName:"Archived sessions",ruName:"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439",createIcon:ue,isEnabled:e(()=>Ge.isOnlineUpdateEnabled(),"isEnabled")}),"dsh-archive-manager: plugin update ui"),n.slots.inject("settings.section",()=>{Ut=!0;try{if(Ge&&!Ge.isSettingsSectionEnabled())return()=>{Ut=!1,Zt()};try{let b=n.slots.register({name:"settings.section.icon",id:"archive-manager",locale:_e},In);jt=typeof b=="function"?b:null}catch{jt=null}let p=n.slots.register({name:"settings.section",id:"archive-manager",order:45,label:e(()=>n.locale.bind(_e)("archived.badge"),"label"),icon:"archive",locale:_e,inject:nn},On);return It=typeof p=="function"?p:()=>{},()=>{Ut=!1,Zt()}}catch(p){return console.warn("archive-manager: register settings.section failed:",p),()=>{Ut=!1}}})}e(Ra,"applyWorkspaceBrowser");async function ja(n,a,o,h){try{await a(n)}catch(v){o(ia(v,h))}}return e(ja,"forkWithFeedback"),i.__test={computeSubmenuPosition:Qr,mergeSubmenuMeasurement:es,movableWorkspaces:y,MoveSubmenu:ts,forkWithFeedback:ja,hasNativeContextMenuService:m,favoritesOnlyVisibility:Cr,favoriteGroupPredicate:Er,createFavoriteRowStore:Tr,unarchivedSessionIds:$r,ArchiveSelectionToolbar:Hr,ArchivedSessionsSection:On,zh:Yr,en:Zr,displayTitle:lt,isUnknownSessionError:Fn,deriveArchivedGroups:Gr,sortArchivedGroups:Kr,deriveArchivedBatchIds:bn,archivedSessionIdsInGroups:Wr,pruneArchivedSelection:qr,toggleArchivedSelection:rr,archivedDeleteFeedback:Vr,isWorkspaceTaskCandidate:Un,isWorkspaceDeleteMenuItem:er,workspaceMenuTriggerFrom:Mr,findRowMenuButton:Qn,isRowMenuButton:Dr,setupSidebarRowContextMenu:Lr,applySettingsNavIcon:Pr,restoreSettingsNavIcon:Or,installSettingsNavIcon:Fr,mutationTouches:Wn,resolveRowHasStatus:Bt,activeSessionActivity:Bn,activeSessionRefusal:jr,activeArchiveFromMessage:Nr,archiveSessionsViaOfficial:ar,unarchiveSessionsViaOfficial:Xr,createUnarchiveSession:Jr,bindObservable:sr,ARCHIVE_MANAGER_REMOTE:en,currentSessionId:Zn,setupSidebarEntry:Sr,ArchiveBundleConfigCard:yr,ArchiveBundleConfigCardWrapper:wr,setupWorkspaceFavoritesOnly:Ir},i.apply=_a,i.inject=Ta,r.exports}e(bi,"startArchiveClient");
28
+ .dsham_moveSubmenuEmpty{padding:8px 10px;font-size:12px;color:var(--dsw-alias-label-tertiary,#888)}`),Je("dsh-archive-manager/WorkspaceMenuGroup.css",'div:has([data-dsham-archive-icon]) + div[role="separator"],div:has([data-dsham-archive-icon]) + div[class*="separator"],div:has(svg[data-dsham-archive-icon]) + div[role="separator"],div:has(svg[data-dsham-archive-icon]) + [class*="separator"]{display:none!important}');let qt="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 Hn(n){return n?'<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="'+qt+'"/></svg>':'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linejoin="round" aria-hidden="true"><path d="'+qt+'"/></svg>'}e(Hn,"starSvg");function Vt(n){return!!n?.querySelector("[data-state]")}e(Vt,"resolveRowHasStatus");let Bn="[data-row-key^='session:']{position:relative}.dsham_starSlot{display:none;position:absolute;left:calc(8px + var(--dsh-workspace-indent,0px));inset-inline-start:calc(8px + var(--dsh-workspace-indent,0px));top:50%;transform:translateY(-50%);align-items:center;justify-content:center;box-sizing:border-box;width:16px;height:20px;z-index:1;pointer-events:none}[data-row-key^='session:']:hover .dsham_starSlot,.dsham_starSlot[data-favorited='true']{display:inline-flex;pointer-events:auto}[data-row-key^='session:']:hover>span:first-child:not(:has([data-state])),[data-row-key^='session:'][data-dsham-favorited='true']:not([data-dsham-has-status='true'])>span:first-child:not(:has([data-state])){opacity:0}[data-row-key^='session:'][data-dsham-has-status='true']>span:first-child,[data-row-key^='session:']>span:first-child:has([data-state]){opacity:1}[data-row-key^='session:'][data-dsham-has-status='true'] .dsham_starSlot,[data-row-key^='session:']:has(>span:first-child [data-state]) .dsham_starSlot{width:10px;height:10px;top:auto;bottom:3px;left:calc(15px + var(--dsh-workspace-indent,0px));inset-inline-start:calc(15px + var(--dsh-workspace-indent,0px));transform:none}[data-row-key^='session:'][data-dsham-has-status='true'] .dsham_rowStar,[data-row-key^='session:']:has(>span:first-child [data-state]) .dsham_rowStar{width:10px;height:10px}[data-row-key^='session:'][data-dsham-has-status='true'] .dsham_rowStar svg,[data-row-key^='session:']:has(>span:first-child [data-state]) .dsham_rowStar svg{width:10px;height:10px;filter:drop-shadow(0 0 1px rgba(0,0,0,0.85))}.dsham_rowStar{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;width:16px;height:16px;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-primary);cursor:pointer;flex:none;border-radius:var(--dsw-radius-xs,4px)}.dsham_starSlot[data-favorited='true'] .dsham_rowStar{color:#e8b931}.dsham_rowStar svg{display:block;width:16px;height:16px;flex:none}";Je("dsh-archive-manager/RowFavorite.css",Bn);let se="dsh-archive-manager:workspace-favorites-only",Ie="data-dsham-favorites-hidden",it="data-dsham-favorites-only",pn="dsham_rowStar",Un="dsham_starSlot",ta=["\u4EC5\u663E\u793A\u5DF2\u5F52\u6863","Archived only","\u0422\u043E\u043B\u044C\u043A\u043E \u0430\u0440\u0445\u0438\u0432\u043D\u044B\u0435"];Je("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 na(){try{return window.localStorage.getItem(se)==="1"}catch{return!1}}e(na,"readWorkspaceFavoritesOnly");function ra(n){try{window.localStorage.setItem(se,n?"1":"0")}catch{}}e(ra,"writeWorkspaceFavoritesOnly");function Tr(n,a){let o=e(f=>a.favorites.has(f)||a.sessions?.[f]?.blank===!0,"visibleSession"),p=new Map,v=null;for(let f of n){if(f.startsWith("workspace:")){v=f,p.set(f,!1);continue}f.startsWith("session:")&&v!==null&&o(f.slice(8))&&p.set(v,!0)}return n.map(f=>f.startsWith("session:")?o(f.slice(8)):f.startsWith("workspace:")?p.get(f)===!0||a.groupHasFavorite?.(f.slice(10))===!0:!f.startsWith("overflow:"))}e(Tr,"favoritesOnlyVisibility");function Ar(n,a){let o=new Map,p=new Set;for(let f of a){let k=!1;for(let E of f.sessionIds)p.add(E),n.has(E)&&(k=!0);o.set(f.workspaceId,k)}let v=!1;for(let f of n)if(!p.has(f)){v=!0;break}return f=>f===""||f==="ungrouped"?v:o.get(f)===!0}e(Ar,"favoriteGroupPredicate");function _r(n,a,o,p){let v={dispose:e(()=>{},"dispose"),setFavoriteStarEnabled:e(q=>{},"setFavoriteStarEnabled"),isFavoriteStarEnabled:e(()=>!0,"isFavoriteStarEnabled")};if(typeof document>"u"||typeof document.addEventListener!="function"||typeof MutationObserver>"u")return v;let f=na(),k=typeof p=="function"?p():!0,E=!1,M=!1,H=e(()=>{k?Je("dsh-archive-manager/RowFavorite.css",Bn):nn("dsh-archive-manager/RowFavorite.css")},"updateStarStyle");H();let A=e(q=>{let Le=q;typeof Le?.detail?.enabled=="boolean"?k=Le.detail.enabled:typeof p=="function"&&(k=p()),H(),lt()},"onStarToggle");typeof window<"u"&&typeof window.addEventListener=="function"&&window.addEventListener("dsham-favorite-star-toggle",A);let z=0,O=200,u=null,ae=new Set,Ne=e(q=>{if(!k){for(let ee of q)Array.from(ee.children).find(He=>He.classList.contains(Un))?.remove(),ee.removeAttribute("data-dsham-favorited"),ee.removeAttribute("data-dsham-has-status");return}let Le=a.getSnapshot();for(let ee of q){let K=ee.getAttribute("data-row-key")??"";if(!K.startsWith("session:"))continue;let He=K.slice(8),nt=Array.from(ee.children).find(qe=>qe.tagName==="SPAN"&&Array.from(qe.classList).some(zt=>zt==="slot"||zt.endsWith("_slot")))??null;if(nt===null){ee.removeAttribute("data-dsham-has-status");continue}let L=Array.from(ee.children).find(qe=>qe.classList.contains(Un))??null;if(!Le.ready){L?.remove(),ee.removeAttribute("data-dsham-favorited"),ee.removeAttribute("data-dsham-has-status");continue}L!==null&&(L.parentElement!==ee||L.nextElementSibling!==null)&&ee.appendChild(L),L===null&&(L=document.createElement("span"),L.className=Un,ee.appendChild(L)),L.dataset.sessionId=He,Vt(nt)?ee.setAttribute("data-dsham-has-status","true"):ee.removeAttribute("data-dsham-has-status");let Te=L.querySelector("."+pn);Te===null&&(Te=document.createElement("button"),Te.type="button",Te.className=pn,Te.addEventListener("click",qe=>{qe.preventDefault(),qe.stopPropagation(),a.toggle(L?.dataset.sessionId??"")}),L.appendChild(Te));let We=Le.ids.has(He);if(We?ee.setAttribute("data-dsham-favorited","true"):ee.removeAttribute("data-dsham-favorited"),L.dataset.favorited===String(We))continue;let pt=o()(We?"organizer.unfavorite":"organizer.favorite");L.dataset.favorited=String(We),Te.setAttribute("aria-pressed",String(We)),Te.setAttribute("aria-label",pt),Te.title=pt,Te.innerHTML=Hn(We)}},"ensureRowStars"),me=e(q=>{let Le=a.getSnapshot();if(!f||!Le.ready){for(let L of q)L.hasAttribute(Ie)&&L.removeAttribute(Ie);z=0,u=null,ae.clear();return}let ee=q.map(L=>L.getAttribute("data-row-key")??""),K=Ar(Le.ids,n.workspaces.list?.getSnapshot?.()?.items??[]),He=Tr(ee,{favorites:Le.ids,sessions:n.sessions.list?.getSnapshot?.()?.byId,groupHasFavorite:K});u!==null&&(q.length<=u.rows&&ae.add(u.key),u=null);let nt=!1;if(z<O)for(let L=0;L<q.length;L+=1){let Me=q[L],Te=ee[L];if(!Te.startsWith("overflow:")||Me.getAttribute("aria-expanded")!=="false")continue;let We=Te.slice(9);if(!(ae.has(We)||!K(We))){try{Me.click(),z+=1,u={key:We,rows:q.length},nt=!0}catch(pt){console.warn("archive-manager: favorites-only expand failed",pt)}break}}for(let L=0;L<q.length;L+=1){let Me=q[L];He[L]?Me.hasAttribute(Ie)&&Me.removeAttribute(Ie):Me.setAttribute(Ie,"true")}nt&&lt()},"applyVisibility"),yt=e(q=>{let Le=q.parentElement;if(Le===null)return null;let ee=Le.cloneNode(!0),K=ee.querySelector('button[role="menuitem"]');if(K===null)return null;let He=Array.from(K.querySelectorAll("span")),nt=He[0]??null,L=He[He.length-1]??null;nt!==null&&(nt.innerHTML=Hn(!1)),L!==null&&(L.textContent=o()("organizer.favoritesOnly"));for(let Me of Array.from(K.querySelectorAll("svg")))Me.closest("span")===null&&Me.remove();return K.setAttribute(it,"true"),K.setAttribute("role","menuitemcheckbox"),K.dataset.active=String(f),K.setAttribute("aria-checked",String(f)),K.setAttribute("aria-label",o()("organizer.favoritesOnly")),K.onclick=Me=>{Me.preventDefault(),Me.stopPropagation(),mn(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0}))},ee},"buildMenuRow"),ht=e(()=>{if(!E){for(let q of Array.from(document.querySelectorAll("button["+it+"]")))q.dataset.active=String(f),q.setAttribute("aria-checked",String(f));for(let q of Array.from(document.querySelectorAll('[role="menu"]'))){let Le=Array.from(q.querySelectorAll('button[role="menuitem"]')).find(He=>ta.some(nt=>(He.textContent??"").includes(nt)));if(Le===void 0||q.querySelector("["+it+"]")!==null)continue;let ee=Le.parentElement;if(ee===null)continue;let K=yt(Le);K!==null&&ee.parentElement?.insertBefore(K,ee.nextSibling)}}},"injectMenuRows"),lt=e(()=>{if(M||E)return;M=!0;let q=e(()=>{if(M=!1,E)return;let Le=Array.from(document.querySelectorAll("[data-row-key]"));ht(),Ne(Le),me(Le),a.getSnapshot().ready||fn()},"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(q):setTimeout(q,16)},"schedulePass"),mn=e(()=>{f=!f,$e=20,z=0,u=null,ae.clear(),ra(f),lt()},"toggle"),tt=null,$e=20,fn=e(()=>{tt!==null||E||$e<=0||($e-=1,tt=setTimeout(()=>{tt=null,a.ensure(),lt()},600))},"scheduleRetry"),Et=new MutationObserver(q=>{Kn(q,'[data-row-key], [role="menu"]')&&lt()});Et.observe(document.body,{childList:!0,subtree:!0}),a.ensure().catch(()=>{});let jt=[a.subscribe(()=>lt()),typeof n.sessions.list?.subscribe=="function"?n.sessions.list.subscribe(()=>lt()):null,typeof n.workspaces.list?.subscribe=="function"?n.workspaces.list.subscribe(()=>lt()):null].filter(q=>typeof q=="function");return lt(),{dispose(){E=!0,typeof window<"u"&&typeof window.removeEventListener=="function"&&window.removeEventListener("dsham-favorite-star-toggle",A),Et.disconnect();for(let q of jt)q();for(let q of Array.from(document.querySelectorAll("["+Ie+"]")))q.removeAttribute(Ie);for(let q of Array.from(document.querySelectorAll("["+it+"]")))q.parentElement?.remove();for(let q of Array.from(document.querySelectorAll("."+Un)))q.remove();for(let q of Array.from(document.querySelectorAll("[data-dsham-favorited]")))q.removeAttribute("data-dsham-favorited");for(let q of Array.from(document.querySelectorAll("[data-dsham-has-status]")))q.removeAttribute("data-dsham-has-status");tt!==null&&(clearTimeout(tt),tt=null)},setFavoriteStarEnabled(q){k=q,H(),lt()},isFavoriteStarEnabled:e(()=>k,"isFavoriteStarEnabled")}}e(_r,"setupWorkspaceFavoritesOnly");function Rr(){let n,a={ready:!1,ids:new Set,pending:new Set},o,p=0,v=new Set,f=e(E=>{a=E;for(let M of v)try{M()}catch(H){console.warn("archive-manager: favorite listener failed",H)}},"publish"),k=e((E,M)=>{let H=new Set(E);for(let u of a.pending)u!==M&&(a.ids.has(u)?H.add(u):H.delete(u));let A=new Set(a.pending);M!==void 0?A.delete(M):a.pending.size===0&&A.clear();let z=a.ids.size===H.size&&[...H].every(u=>a.ids.has(u)),O=a.pending.size===A.size&&[...A].every(u=>a.pending.has(u));z&&O&&a.ready||f({ready:!0,ids:H,pending:A})},"adopt");return{bind(E){n=E},subscribe(E){return v.add(E),()=>{v.delete(E)}},getSnapshot:e(()=>a,"getSnapshot"),adopt:e(E=>k(E),"adopt"),ensure(){return n===void 0||a.ready?Promise.resolve():o!==void 0?o:Date.now()<p?Promise.resolve():(o=n.favoriteSessions().then(E=>{k(E.favoriteSessionIds)}).catch(E=>{console.warn("archive-manager: load favorites failed, will retry",E),p=Date.now()+600}).finally(()=>{o=void 0}),o)},async toggle(E){if(n===void 0||!a.ready||a.pending.has(E))return;let M=a.ids.has(E),H=!M,A=new Set(a.ids);H?A.add(E):A.delete(E);let z=new Set(a.pending);z.add(E),f({ready:!0,ids:A,pending:z});try{let O=await n.setSessionFavorite({sessionId:E,favorite:H});if(!Array.isArray(O?.favoriteSessionIds))throw new TypeError("favorite response is missing favoriteSessionIds");k(O.favoriteSessionIds,E)}catch(O){console.warn("archive-manager: sidebar favorite toggle failed",O);let u=new Set(a.ids);M?u.add(E):u.delete(E);let ae=new Set(a.pending);ae.delete(E),f({ready:!0,ids:u,pending:ae})}}}}e(Rr,"createFavoriteRowStore");function sa(){return(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,"aria-hidden":!0,focusable:"false",children:(0,s.jsx)("path",{fill:"currentColor",d:"M8 0a8 8 0 0 0-2.53 15.59c.4.074.547-.173.547-.385 0-.19-.007-.693-.01-1.36-2.226.484-2.695-1.073-2.695-1.073-.364-.924-.89-1.17-.89-1.17-.726-.496.055-.486.055-.486.803.056 1.225.824 1.225.824.714 1.223 1.872.87 2.328.665.072-.517.28-.87.508-1.07-1.777-.202-3.645-.888-3.645-3.956 0-.874.31-1.588.823-2.148-.083-.202-.357-1.017.078-2.12 0 0 .672-.215 2.2.82A7.65 7.65 0 0 1 8 4.8c.68.003 1.365.092 2.004.27 1.527-1.035 2.197-.82 2.197-.82.437 1.103.162 1.918.08 2.12.513.56.822 1.274.822 2.148 0 3.076-1.872 3.752-3.654 3.95.288.248.544.735.544 1.482 0 1.07-.01 1.932-.01 2.195 0 .214.144.463.55.384A8.001 8.001 0 0 0 8 0Z"})})}e(sa,"GithubMark16");function aa(){let n=h.IconEditOutlineRegular;return(0,s.jsx)(n,{size:16})}e(aa,"FeedbackIcon");function Wn({archiveSessions:n,archiveSession:a,sessionStore:o,workspaceStore:p,unarchiveSession:v,deleteSession:f,unarchiveSessions:k,deleteArchivedSessions:E,archivedSessionMetadata:M,openConversation:H,focusSessionWorkspace:A,viewState:z,close:O,t:u,diagnoseOrphanSubagents:ae,cleanOrphanSubagents:Ne,diagnoseSessionCaches:me,rebuildSessionCaches:yt,refreshCacheLists:ht,searchSessionContent:lt,searchArchivedContent:mn,previewArchivedSession:tt,favoriteSessions:$e,setSessionFavorite:fn,favoriteSync:Et,organizeBatch:jt,useSessionPendingInteraction:q,useSessionStatus:Le}){let ee=(0,l.useSyncExternalStore)(o.subscribe,o.getSnapshot),K=(0,l.useSyncExternalStore)(p.subscribe,p.getSnapshot),[He,nt]=(0,l.useState)("archived"),L=He==="archived",[Me,Te]=(0,l.useState)(null),[We,pt]=(0,l.useState)(null),[qe,zt]=(0,l.useState)(null),gn=e((c,S=null)=>{Q(null),Fe(null),ve(!1),pt(S),Te(c)},"requestArchive"),Zn=e(()=>{X||(Te(null),pt(null),Q(null))},"closeArchive"),Pt=(0,l.useRef)(!1),[Se,Nt]=(0,l.useState)(null),vn=(0,l.useRef)(!1),[X,Xe]=(0,l.useState)(!1),[Ot,Q]=(0,l.useState)(null),[bn,Fe]=(0,l.useState)(null),Ft=e(c=>{Q(null),Fe(null),Nt(c)},"requestDelete"),[Ht,In]=(0,l.useState)(z?.query??""),[wt,Zt]=(0,l.useState)(z?.project??"all"),[$t,Tn]=(0,l.useState)(z?.sortBy??"updated"),[An,_n]=(0,l.useState)({}),[Jt,Rn]=(0,l.useState)(()=>new Set),Mt=(0,l.useRef)(new Set),[It,St]=(0,l.useState)([]),[xt,kt]=(0,l.useState)([]),[mt,Bt]=(0,l.useState)(!1),[jn,yn]=(0,l.useState)(!1),rn=(0,l.useRef)(!1),[Xt,sn]=(0,l.useState)(!1),[Ut,Wt]=l.useState("content"),[Gt,Nn]=l.useState(""),[Mn,an]=l.useState(""),[on,d]=(0,l.useState)(()=>new Set),[b,T]=(0,l.useState)("30"),[G,ve]=(0,l.useState)(!1),[V,be]=(0,l.useState)(null),[Re,de]=(0,l.useState)(null),[ue,Ae]=(0,l.useState)([]),je=(0,l.useRef)(!1),rt=(0,l.useRef)(null),Y=ma(q??ua,Le??ha,typeof Le=="function"),te=(0,l.useRef)(Y.pending);te.current=Y.pending;let R=(0,l.useMemo)(()=>new Set(xt),[xt]),re=e(async()=>{if($e)try{let c=await $e();kt(c.favoriteSessionIds),Bt(!0),Et?.adopt(c.favoriteSessionIds)}catch(c){Bt(!1),Q(Be(c))}},"loadFavorites");(0,l.useEffect)(()=>{let c=!0;return $e&&$e().then(S=>{c&&(kt(S.favoriteSessionIds),Bt(!0),Et?.adopt(S.favoriteSessionIds))}).catch(S=>{c&&Q(Be(S))}),()=>{c=!1}},[$e]),(0,l.useEffect)(()=>{if(Et)return Et.subscribe(()=>{let c=Et.getSnapshot();c.ready&&(kt([...c.ids]),Bt(!0))})},[Et]);let _e=e(async c=>{if(!(rn.current||X||!mt)){rn.current=!0,yn(!0),Q(null);try{let S=await fn({sessionId:c,favorite:!R.has(c)});kt(S.favoriteSessionIds),Et?.adopt(S.favoriteSessionIds)}catch(S){Q(Be(S))}finally{rn.current=!1,yn(!1)}}},"toggleFavorite"),ie=e(async(c,S,{idle:Z=!1,retry:ke=!1}={})=>{if(!(je.current||rn.current||Mt.current.size>0||!jt)){je.current=!0,Xe(!0),Q(null),Fe(null),de(null),c==="archive"&&!ke&&Ae([]);try{let j=await jt(c,S,{idleDays:Z?Number(b):void 0,getPending:e(()=>te.current,"getPending"),onProgress:e(Ce=>{be(Ce),c==="archive"&&Ce.total>0&&Ce.done>=Ce.total&&(Te(null),pt(null),ve(!1))},"onProgress")});return de({...j,kind:c,tab:He}),rt.current=j.remaining.length?{kind:c,ids:j.remaining,idle:Z}:null,c==="archive"&&Ae(Ce=>[...new Set([...Ce,...j.succeeded])]),(c==="undo"||c==="restore"||c==="delete")&&Ae(Ce=>Ce.filter(ft=>!j.succeeded.includes(ft)&&!j.skipped.includes(ft))),St(Ce=>Ce.filter(ft=>!j.succeeded.includes(ft)&&!j.skipped.includes(ft))),c==="delete"&&kt(Ce=>Ce.filter(ft=>!j.succeeded.includes(ft))),j}catch(j){Q(Be(j))}finally{je.current=!1,Xe(!1),be(null)}}},"executeBatch"),[De,ye]=(0,l.useState)(null),[Ee,Tt]=(0,l.useState)({diagnosis:{count:0,items:[]},busy:!1,progress:null,result:null,error:null,refreshError:null}),we=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(!me||!yt||!ht)return;let c=Ns({diagnose:me,rebuild:yt,refresh:ht});we.current=c;let S=c.subscribe(()=>{Tt(c.snapshot())});return c.load(),()=>{S(),c.dispose(),we.current=null}},[me,yt,ht]),(0,l.useEffect)(()=>{we.current?.snapshot().busy||we.current?.load()},[K.archivedSessionIds]);let Pe=e(async(c=!1)=>{if(!(X||je.current||!we.current||we.current.snapshot().busy)){je.current=!0,Xe(!0);try{await we.current.run(c)}finally{je.current=!1,oe.current&&Xe(!1)}}},"runCacheRebuild"),[Ge,xe]=(0,l.useState)(!1),Ke=e(()=>{typeof ae=="function"&&ae().then(ye).catch(c=>{console.warn("archive-manager: diagnose orphan subagents failed",c)})},"loadOrphans");(0,l.useEffect)(()=>{Ke()},[K.archivedSessionIds]);let Qe=e(async()=>{if(!(Ge||typeof Ne!="function")){xe(!0),Q(null),Fe(null);try{let c=await Ne({});(c.cleanedSessionIds.length>0||c.skippedSessionIds.length>0)&&Ke(),c.failures.length>0?(Fe(null),Q(Vn(c.failures,u))):c.cleanedSessionIds.length>0&&(Q(null),Fe(u("organizer.orphanCleanSuccess",{n:c.cleanedSessionIds.length})))}catch(c){Q(Be(c))}finally{xe(!1)}}},"cleanOrphans"),oe=(0,l.useRef)(!0),At=(0,l.useRef)(!1);(0,l.useEffect)(()=>(oe.current=!0,()=>{oe.current=!1}),[]);let st=e(async(c,S=!1)=>{if(X||At.current)return;At.current=!0,Xe(!0),Q(null);let Z=!1;try{await Ds({prepare:S?async ke=>{await A?.(ke)}:void 0,restore:e(async ke=>{await v(ke),Z=!0},"restore"),open:e(async ke=>{await H(ke),oe.current&&O?.()},"open")},c.id,S,()=>oe.current)}catch(ke){if(!oe.current)return;if(Z){nt("unarchived");let j=_t.find(Ce=>Ce.sessions.some(ft=>ft.id===c.id));j!==void 0&&Zt(j.key)}Q(Ms(ke,u))}finally{At.current=!1,oe.current&&Xe(!1)}},"viewConversation");(0,l.useEffect)(()=>{z&&Object.assign(z,{query:Ht,project:wt,sortBy:$t})},[Ht,wt,$t,z]);let ct=(0,l.useMemo)(()=>L?K.archivedSessionIds:Yr(ee.byId,K.archivedSessionIds),[L,ee.byId,K.archivedSessionIds]),_t=(0,l.useMemo)(()=>Zr(ee.byId,K.items,ct,u("group.ungrouped")),[ee.byId,K,ct,u]),et=e(c=>{X||Mt.current.size>0||(Lt.close(),nt(c),St([]),Te(null),pt(null),Q(null),Fe(null),Zt("all"),In(""),c!=="archived"&&$t==="archived"&&Tn("updated"))},"switchTab"),dt=e(async(c,S=!1)=>{if(!(Pt.current||X||!c?.length)){if(jt){Pt.current=!0;try{let Z=await ie("archive",c,{idle:S}),ke=Z?.failures.map(j=>Lr(j.sessionId,j.message)).find(j=>j!==void 0);if(ke!==void 0&&typeof a=="function"){let j=ee.byId[ke.sessionId];zt({sessionId:ke.sessionId,title:j===void 0?ke.sessionId:ot(j,u),kinds:ke.kinds.join(", ")}),Te(null),pt(null),Q(null);return}Z&&(Te(null),pt(null),ve(!1))}finally{Pt.current=!1}return}Pt.current=!0,Xe(!0),Q(null),Fe(null);try{let Z=await n(c);Te(null),pt(null),Z.archivedSessionIdsAdded.length>0&&Fe(u("archives.archiveSuccess",{n:Z.archivedSessionIdsAdded.length})),Z.failures&&Z.failures.length>0?Q(Vn(Z.failures,u)):(St([]),nt("archived"),Zt("all"),In(""))}catch(Z){let ke=Dr(Z);if(ke!==void 0&&typeof a=="function"){let j=ee.byId[ke.sessionId];zt({sessionId:ke.sessionId,title:j===void 0?ke.sessionId:ot(j,u),kinds:ke.kinds.join(", ")}),Te(null),pt(null),Q(null)}else{let j=$n(Z);Q(j===void 0?u("archives.archiveBatchFailed",{detail:Z instanceof Error?Z.message:String(Z)}):u("archives.archiveActive",{kinds:j.join(", ")}))}}finally{Pt.current=!1,Xe(!1)}}},"performArchive"),wn=e(()=>dt(Me,G),"confirmArchive"),Dn=e(async c=>{Q(null),Fe(null);try{await tr(c.id),oe.current&&Fe(u("details.copied"))}catch(S){oe.current&&Q(typeof Xn(S)=="string"&&String(Xn(S)).startsWith("copy.")?u(String(Xn(S))):Be(S))}},"copyId"),ln=(0,l.useMemo)(()=>Jr(_t,$t,An,u,L?K.archivedSessionIds:void 0),[_t,$t,An,u,L,K.archivedSessionIds]);(0,l.useEffect)(()=>{if(X)return;let c=!1;return M().then(S=>{c||_n(Object.fromEntries(S.items.map(Z=>[Z.sessionId,Z.createdAt])))}).catch(()=>{c||_n({})}),()=>{c=!0}},[M,K.archivedSessionIds,X]),(0,l.useEffect)(()=>{wt!=="all"&&!_t.some(c=>c.key===wt)&&Zt("all")},[_t,wt]);let Ct=!vr(Gt,Mn),cn=ln.filter(c=>wt==="all"||wt===c.key).map(c=>({...c,sessions:c.sessions.filter(S=>(!Xt||R.has(S.id))&&ks(S.updatedAt,Gt,Mn))})).filter(c=>c.sessions.length),dn=Ut==="content"&&!Ct,Dt=P(cn.flatMap(c=>c.sessions.map(S=>S.id)),Ht,dn,lt??mn),Qt=new Map(Dt.items.map(c=>[c.sessionId,c])),Lt=B(tt,L?K.archivedSessionIds:[]),as=Ht.trim().toLocaleLowerCase(),Ln=cn.map(c=>({...c,sessions:c.sessions.filter(S=>!as||ot(S,u).toLocaleLowerCase().includes(as)||Qt.has(S.id))})).filter(c=>c.sessions.length),is=mt?Ln.flatMap(c=>c.sessions).filter(c=>Ir(c,{days:Number(b),favorites:R,currentId:nr(ee),pending:Y.pending})).map(c=>c.id):[],zn=(0,l.useMemo)(()=>$r(Ln),[Ln]),hr=(0,l.useMemo)(()=>new Set(It),[It]),Ma=(0,l.useMemo)(()=>{let c=new Set(K.archivedSessionIds);return ue.reduce((S,Z)=>S+(c.has(Z)?1:0),0)},[ue,K.archivedSessionIds]),pr=zn.filter(c=>hr.has(c)).length,Da=zn.length>0&&pr===zn.length;(0,l.useEffect)(()=>{St(c=>Gr(c,ct))},[ct]);let La=e((c,S)=>{St(Z=>cr(Z,[c],S))},"toggleSessionSelection"),za=e(c=>{St(S=>cr(S,zn,c))},"toggleVisibleSelection"),Pa=e(c=>{X||Mt.current.has(c)||(Mt.current.add(c),Rn(new Set(Mt.current)),Q(null),Fe(null),v(c).catch(S=>{Q(Nr(S,u))}).finally(()=>{Mt.current.delete(c),Rn(new Set(Mt.current))}))},"onUnarchive"),os=e(async c=>{if(!X){if(jt){let S=En(K.archivedSessionIds,K.items,c),Z=await ie("restore",S);return Z&&{unarchivedSessionIds:Z.succeeded}}Xe(!0),Q(null),Fe(null);try{let S=await k(c);return S.unarchivedSessionIds.length>0&&Fe(u("archives.restoreSuccess",{n:S.unarchivedSessionIds.length})),S.failures&&S.failures.length>0&&Q(Vn(S.failures,u,Nr)),S}catch(S){Q(u("archives.restoreBatchFailed",{detail:S instanceof Error?S.message:String(S)}))}finally{Xe(!1)}}},"onBatchUnarchive"),Oa=e(async()=>{if(It.length===0)return;let c=await os({scope:"sessions",sessionIds:It});if(c!==void 0){let S=new Set(c.unarchivedSessionIds);St(Z=>Z.filter(ke=>!S.has(ke)))}},"onSelectedUnarchive"),ls=e(()=>{X||Nt(null)},"closeDelete");(0,l.useEffect)(()=>{if(Se===null)return;let c=e(S=>{S.key==="Escape"&&(S.preventDefault(),S.stopPropagation(),"stopImmediatePropagation"in S&&typeof S.stopImmediatePropagation=="function"&&S.stopImmediatePropagation(),X||Nt(null))},"onKeyDown");return window.addEventListener("keydown",c,!0),()=>window.removeEventListener("keydown",c,!0)},[Se,X]);let Fa=e(async()=>{if(X||vn.current||Se===null)return;if(Se.kind!=="batch"){vn.current=!0,Xe(!0),Q(null),Fe(null);try{await f(Se.session.id),Nt(null)}catch(S){Q(sr(S,u))}finally{vn.current=!1,Xe(!1)}return}if(je.current||rn.current||Mt.current.size>0)return;let{target:c}=Se;if(c.scope==="sessions"&&En(K.archivedSessionIds,K.items,c).length===0){Nt(null);return}je.current=!0,Xe(!0),Q(null),Fe(null),de(null),be(null);try{let S=await E(c),Z=Kr(S,u);Z.kind==="error"?Q(Z.message):Fe(Z.message);let ke=new Set([...S.deletedSessionIds,...S.skippedSessionIds]);Ae(Ce=>Ce.filter(ft=>!ke.has(ft))),St(Ce=>Ce.filter(ft=>!ke.has(ft))),kt(Ce=>Ce.filter(ft=>!ke.has(ft)));let j=S.failures.map(Ce=>Ce.sessionId);rt.current=j.length>0?{kind:"delete",ids:j,idle:!1}:null,de({requested:S.requestedSessionIds,succeeded:S.deletedSessionIds,skipped:S.skippedSessionIds,failures:S.failures,remaining:j,refreshError:"refreshError"in S&&typeof S.refreshError=="string"?S.refreshError:null,kind:"delete",tab:He}),Nt(null)}catch(S){Q(sr(S,u))}finally{je.current=!1,Xe(!1)}},"confirmDelete"),Kt=Se?.kind==="batch"?Se.target.scope:null,Ha=Kt==="ungrouped"?u("archives.deleteUngroupedTitle"):Kt==="workspace"?u("archives.deleteProjectTitle",{name:Se?.kind==="batch"?Se.title:""}):u(Kt==="sessions"?"archives.deleteSelectedTitle":"deleteSession.title"),cs=Se===null?void 0:Kt==="ungrouped"?u("archives.deleteUngroupedDesc",{n:Se.kind==="batch"?Se.count:0}):Kt==="workspace"?u("archives.deleteProjectDesc",{name:Se?.kind==="batch"?Se.title:"",n:Se.kind==="batch"?Se.count:0}):Kt==="sessions"?u("archives.deleteSelectedDesc",{n:Se.kind==="batch"?Se.count:0}):u("deleteSession.desc",{name:ot(Se.kind==="session"?Se.session:{},u)}),Ba=u(Kt==="ungrouped"?"archives.deleteUngroupedConfirm":Kt==="workspace"?"archives.deleteProjectConfirm":Kt==="sessions"?"archives.deleteSelectedConfirm":"deleteSession.title");return(0,s.jsxs)("section",{className:"dsham_settings","aria-label":u("archives.title"),children:[(0,s.jsx)("style",{children:ga+ya+wa+Sa+xa}),(0,s.jsxs)("div",{className:"dsham_settingsHeader",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"dsham_settingsTitleRow",children:[(0,s.jsx)("h2",{children:u("archives.title")}),(0,s.jsxs)("div",{className:"dsham_settingsLinks",children:[(0,s.jsx)(h.Button,{variant:"outline",size:"sm","aria-label":u("archives.viewProject"),icon:(0,s.jsx)(sa,{}),onClick:e(()=>window.open("https://github.com/MichengAI/dsh-archive-manager","_blank","noreferrer"),"onClick"),children:u("archives.viewProject")}),(0,s.jsx)(h.Button,{variant:"outline",size:"sm","aria-label":u("archives.feedback"),icon:(0,s.jsx)(aa,{}),onClick:e(()=>window.open("https://github.com/MichengAI/dsh-archive-manager/issues","_blank","noreferrer"),"onClick"),children:u("archives.feedback")})]})]}),(0,s.jsx)("p",{className:"dsham_settingsIntro",children:u("archives.description")})]}),l.createElement("div",D(X||Jt.size>0,(0,s.jsx)(h.SegmentedTabs,{className:"dsham_archiveTabs",label:u("archives.title"),value:He==="unarchived"?"unarchived":"archived",onChange:e(c=>et(c==="unarchived"?"unarchived":"archived"),"onChange"),items:[{value:"archived",label:(0,s.jsxs)("span",{className:"dsham_tabLabel",children:[(0,s.jsx)(h.IconArchiveOutlineMedium,{size:14}),(0,s.jsx)("span",{children:u("archives.tab.archived")})]}),id:"dsham-tab-archived",panelId:"dsham-archive-panel"},{value:"unarchived",label:(0,s.jsxs)("span",{className:"dsham_tabLabel",children:[(0,s.jsx)(h.IconFolderCloseMedium,{size:14}),(0,s.jsx)("span",{children:u("archives.tab.unarchived")})]}),id:"dsham-tab-unarchived",panelId:"dsham-archive-panel"}]})))]}),(0,s.jsxs)("div",{id:"dsham-archive-panel",role:"region","aria-label":u(He==="unarchived"?"archives.tab.unarchived":"archives.tab.archived"),children:[(0,s.jsx)("div",{className:"dsham_settingsToolbar",children:(0,s.jsxs)("div",{className:"dsham_settingsSearch",children:[(0,s.jsx)(lr,{id:"dsham-favorite-filter",className:"dsham_srOnly",tabIndex:-1,"aria-hidden":!0,value:Xt?"favorites":"all",options:[{value:"all",label:u("organizer.allSessions")},{value:"favorites",label:u("organizer.favoritesOnly")}],onChange:e(c=>typeof sn=="function"&&sn(c==="favorites"),"onChange"),"aria-label":u("organizer.favoriteFilter")}),(0,s.jsx)(lr,{id:"dsham-search-scope",className:"dsham_srOnly",tabIndex:-1,"aria-hidden":!0,value:Ut,options:[{value:"title",label:u("discovery.titleOnly")},{value:"content",label:u("discovery.titleAndContent")}],onChange:e(c=>typeof Wt=="function"&&Wt(c),"onChange"),"aria-label":u("discovery.scope")}),(0,s.jsx)(h.Input,{id:"dsham-search-input",className:"dsham_searchField",type:"search",icon:(0,s.jsx)(h.IconSearchOutlineMedium,{size:16,"aria-hidden":!0}),autoComplete:"off",spellCheck:!1,maxLength:200,value:Ht,onChange:e(c=>In(c.target.value),"onChange"),placeholder:u(dn?"discovery.searchPlaceholder":L?"archives.searchPlaceholder":"archives.searchUnarchived"),"aria-label":u(dn?"discovery.searchPlaceholder":L?"archives.searchPlaceholder":"archives.searchUnarchived")}),(0,s.jsx)(ka,{id:"dsham-sort-filter",t:u,disabled:X,favoritesOnly:Xt,setFavoritesOnly:sn,favoriteBusy:X||jn||!mt,sortBy:!L&&$t==="archived"?"updated":$t,setSortBy:Tn,options:[...L?[{value:"archived",label:u("archives.sortArchived")}]:[],{value:"updated",label:u("archives.sortUpdated")},{value:"created",label:u("archives.sortCreated")},{value:"alphabetical",label:u("archives.sortAlphabetical")}]}),(0,s.jsx)(lr,{id:"dsham-project-filter",className:"dsham_projectFilter",value:wt,title:wt==="all"?u("archives.allProjects"):ln.find(c=>c.key===wt)?.title??wt,options:[{value:"all",label:u("archives.allProjects")||"\u6240\u6709\u9879\u76EE",title:u("archives.allProjects")},...ln.map(c=>({value:c.key,label:c.title,title:c.title}))],onChange:Zt,"aria-label":u("archives.projectFilter")}),l.createElement(fe,{t:u,from:Gt,to:Mn,onFrom:Nn,onTo:an,invalid:Ct,onClear:e(()=>{Nn(""),an("")},"onClear")})]})}),l.createElement("style",null,Is),l.createElement(le,{state:Dt,t:u}),jt&&(0,s.jsx)(N,{t:u,archived:L,busy:X||jn||Jt.size>0,ready:mt,days:b,onDays:T,count:is.length,onPreview:e(()=>{gn(is),ve(!0)},"onPreview"),progress:V,result:Re?.tab===He?Re:null,onRetry:e(()=>{let c=rt.current;c&&(c.kind==="delete"?Ft({kind:"batch",target:{scope:"sessions",sessionIds:c.ids},count:c.ids.length}):ie(c.kind,c.ids,{idle:c.idle,retry:!0}))},"onRetry"),undoCount:Ma,onUndo:e(()=>ie("undo",ue,{retry:!0}),"onUndo"),onReload:re,orphanCount:De?.count??0,cacheCount:Ee.diagnosis.count,cacheRepair:Ee,onRebuildCaches:e(()=>Pe(),"onRebuildCaches"),onRetryCaches:e(()=>Pe(!0),"onRetryCaches"),onReloadCaches:e(async()=>{try{await ht?.(),await we.current?.load(),(we.current?.snapshot().diagnosis.count??0)===0&&we.current?.dismiss()}catch(c){oe.current&&Q(Be(c))}},"onReloadCaches"),onDismissCaches:e(()=>we.current?.dismiss(),"onDismissCaches"),orphanSizeBytes:De?.totalSizeBytes??0,orphanCleaning:Ge,onCleanOrphans:Qe}),_t.length>0&&(0,s.jsx)(Wr,{selectedCount:It.length,hiddenCount:It.length-pr,allVisibleSelected:Da,selectedVisibleCount:pr,visibleCount:zn.length,busy:X,t:u,onToggle:za,onClear:e(()=>St([]),"onClear"),onArchive:L?void 0:()=>gn([...It]),onRestore:Oa,onDelete:e(()=>Ft({kind:"batch",target:{scope:"sessions",sessionIds:It},count:It.length}),"onDelete")}),_t.length===0?(0,s.jsx)("div",{className:"dsham_settingsEmpty",children:u(L?"archives.empty":"archives.emptyUnarchived")}):Ln.length===0?(0,s.jsx)("div",{className:"dsham_settingsEmpty",children:Dt.status==="loading"||Dt.status==="error"||Dt.failures.length?null:u("archives.emptyFiltered")}):Ln.map(c=>{let S=Ia(c.key),Z=_t.find(j=>j.key===c.key)?.sessions.map(j=>j.id)??[],ke=L?En(K.archivedSessionIds,K.items,S).length:Z.length;return(0,s.jsxs)("section",{className:"dsham_settingsGroup",children:[(0,s.jsxs)("div",{className:"dsham_settingsGroupHeading",children:[(0,s.jsx)("h3",{className:"dsham_settingsGroupTitle",children:(0,s.jsxs)("button",{type:"button",className:"dsham_groupToggle","aria-expanded":!on.has(c.key),"aria-controls":"dsham-group-"+encodeURIComponent(c.key),onClick:e(()=>d(j=>{let Ce=new Set(j);return Ce.has(c.key)?Ce.delete(c.key):Ce.add(c.key),Ce}),"onClick"),children:[(0,s.jsx)(on.has(c.key)?h.IconChevronRightOutlineMedium:h.IconChevronDownOutlineMedium,{}),(0,s.jsx)(on.has(c.key)?h.IconFolderCloseMedium:h.IconFolderOpenOutlineMedium,{}),(0,s.jsx)("span",{children:c.title})]})}),(0,s.jsxs)("div",{className:"dsham_settingsGroupMeta",children:[(0,s.jsx)("span",{className:"dsham_settingsCount",children:u("archives.sessionCount",{n:c.sessions.length})}),(0,s.jsx)(Ea,{group:c,busy:X,onArchive:L?void 0:()=>gn(Z,c),onRestore:e(()=>os(S),"onRestore"),onDelete:e(()=>Ft({kind:"batch",target:S,title:c.title,count:ke}),"onDelete"),t:u})]})]}),(0,s.jsx)("div",{className:"dsham_settingsList",id:"dsham-group-"+encodeURIComponent(c.key),hidden:on.has(c.key)||void 0,children:!on.has(c.key)&&c.sessions.map(j=>(0,s.jsxs)("div",{className:"dsham_settingsRow","data-selected":hr.has(j.id),children:[(0,s.jsx)(qr,{checked:hr.has(j.id),disabled:X,label:u("archives.selectSession",{name:ot(j,u)}),onChange:e(Ce=>La(j.id,Ce.target.checked),"onChange")}),(0,s.jsxs)("div",{className:"dsham_settingsContent",children:[(0,s.jsx)("button",{type:"button",className:"dsham_settingsTitleLink",title:ot(j,u),"aria-label":u("archives.openSession")+u("common.separator")+ot(j,u),disabled:X||Jt.has(j.id),onClick:e(()=>st(j),"onClick"),children:ot(j,u)}),(0,s.jsx)("div",{className:"dsham_settingsMeta",children:[fa(j.updatedAt,u)]}),Qt.has(j.id)&&l.createElement("button",{type:"button",className:"dsham_settingsSnippet",disabled:X,title:u(L?"discovery.preview":"archives.openSession"),onClick:e(()=>L?Lt.open(j,Ht):st(j),"onClick")},l.createElement(U,{text:Qt.get(j.id)?.snippet??"",query:Ht}))]}),(0,s.jsxs)("div",{className:"dsham_settingsActions",children:[typeof fn=="function"&&g({variant:"outline",className:"dsham_iconAction"+(R.has(j.id)?" dsham_favoriteOn":""),title:u(R.has(j.id)?"organizer.unfavorite":"organizer.favorite"),"aria-pressed":R.has(j.id),"aria-label":u(R.has(j.id)?"organizer.unfavorite":"organizer.favorite")+u("common.separator")+ot(j,u),disabled:X||jn||!mt,onClick:e(()=>_e(j.id),"onClick"),children:(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:R.has(j.id)?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round","aria-hidden":!0,style:{display:"block"},children:(0,s.jsx)("path",{d:qt})})}),g({variant:"outline",className:"dsham_iconAction",title:u(L?"archives.restore":"archives.archiveSelected"),"aria-label":u(L?"archives.restore":"archives.archiveSelected"),disabled:X||Jt.has(j.id),onClick:e(()=>L?Pa(j.id):dt([j.id]),"onClick"),icon:(0,s.jsx)(L?h.IconRefreshOutlineMedium:h.IconArchiveOutlineMedium,{size:16})}),L&&(0,s.jsx)(Ca,{busy:X||Jt.has(j.id),t:u,title:ot(j,u),onCopyId:e(()=>Dn(j),"onCopyId"),onPreview:typeof tt=="function"?()=>Lt.open(j,Ht):void 0,onRestoreOpen:e(()=>st(j,!0),"onRestoreOpen"),onDelete:e(()=>Ft({kind:"session",session:j}),"onDelete")})]})]},j.id))})]},c.key)}),l.createElement(_,{width:900,className:"dsham_modalWide",portalToBody:!0,t:u,open:Lt.target!==null,onClose:Lt.close,title:Lt.target?ot(Lt.target.session,u):u("discovery.preview"),footer:w({variant:"primary",disabled:X,onClick:e(()=>{if(Lt.target){let c=Lt.target.session;return Lt.close(),st(c)}},"onClick"),children:u("discovery.openFull")}),children:l.createElement($,{preview:Lt,t:u,MarkdownText:h.MarkdownText})}),Me===null&&Ot!==null&&(0,s.jsx)("div",{className:"dsham_settingsError",role:"alert",children:Ot}),bn!==null&&(0,s.jsx)("div",{className:"dsham_settingsStatus",role:"status",children:bn}),(0,s.jsx)(_,{t:u,open:Me!==null,onClose:Zn,title:u("archives.archiveTitle",{n:Me?.length??0}),description:We===null?u("archives.archiveSelectedDesc"):u(We.key===Yn?"archives.archiveUngroupedDesc":"archives.archiveProjectDesc",{name:We.title,n:Me?.length??0}),footer:(0,s.jsxs)(s.Fragment,{children:[w({disabled:X,onClick:Zn,children:u("cancel")}),w({variant:"primary",disabled:X||!Me?.length,onClick:wn,children:u("archives.archiveSelected")})]}),children:(0,s.jsxs)(s.Fragment,{children:[jt&&(0,s.jsx)("p",{children:u(G?"organizer.idleConfirm":"organizer.manualConfirm")}),jt&&(0,s.jsx)("div",{className:"dsham_archivePreview",children:(Me??[]).map(c=>(0,s.jsxs)("label",{children:[(0,s.jsx)(mr,{checked:!0,disabled:X,label:ot(ee.byId[c]??{id:c},u),onChange:e(()=>Te(S=>(S??[]).filter(Z=>Z!==c)),"onChange")}),ot(ee.byId[c]??{id:c},u)]},c))}),V&&(0,s.jsxs)("div",{role:"status",children:[(0,s.jsx)("progress",{value:V.done,max:Math.max(1,V.total)}),u("organizer.progressCount",{done:V.done,total:V.total})]}),Ot!==null&&(0,s.jsx)("div",{className:"dsham_settingsError",role:"alert",children:Ot})]})}),(0,s.jsx)(_,{t:u,open:qe!==null,onClose:e(()=>{X||(zt(null),Q(null))},"onClose"),title:u("archiveActive.title"),...qe===null?{}:{description:u("archiveActive.desc",{name:qe.title,kinds:qe.kinds})},footer:(0,s.jsxs)(s.Fragment,{children:[w({disabled:X,onClick:e(()=>{X||(zt(null),Q(null))},"onClick"),children:u("cancel")}),w({danger:!0,disabled:X,onClick:e(async()=>{if(!(Pt.current||X||qe===null||typeof a!="function")){Pt.current=!0,Xe(!0),Q(null);try{await a(qe.sessionId,{stopActivity:!0}),St(c=>c.filter(S=>qe===null||S!==qe.sessionId)),nt("archived"),Fe(u("archives.archiveSuccess",{n:1})),zt(null)}catch(c){Q(c instanceof Error?c.message:String(c))}finally{Pt.current=!1,Xe(!1)}}},"onClick"),children:u("archiveActive.confirm")})]}),children:Ot!==null&&(0,s.jsx)("div",{className:"dsham_settingsError",role:"alert",children:Ot})}),(0,s.jsx)(_,{t:u,open:Se!==null,onClose:ls,title:Ha,...cs===void 0?{}:{description:cs},footer:(0,s.jsxs)(s.Fragment,{children:[w({disabled:X,onClick:ls,children:u("cancel")}),w({danger:!0,disabled:X,onClick:Fa,children:Ba})]}),children:(0,s.jsxs)(s.Fragment,{children:[X&&(0,s.jsxs)("div",{role:"status",children:[Se?.kind==="batch"?u("archives.deleteBatchPending"):u("deleteSession.pending"),V&&(0,s.jsx)("progress",{value:V.done,max:Math.max(1,V.total),"aria-label":u("organizer.progress")}),V&&u("organizer.progressCount",{done:V.done,total:V.total})]}),Ot!==null&&(0,s.jsx)("div",{className:"dsham_settingsError",role:"alert",children:Ot})]})})]})]})}e(Wn,"ArchivedSessionsSection");function jr(n){var a,o,p="";if(typeof n=="string"||typeof n=="number")p+=n;else if(typeof n=="object")if(Array.isArray(n)){var v=n.length;for(a=0;a<v;a++)n[a]&&(o=jr(n[a]))&&(p&&(p+=" "),p+=o)}else for(o in n)n[o]&&(p&&(p+=" "),p+=o);return p}e(jr,"r");function ia(...n){for(var a,o,p=0,v="",f=arguments.length;p<f;p++)(a=arguments[p])&&(o=jr(a))&&(v&&(v+=" "),v+=o);return v}e(ia,"clsx");function qn(n){let a=n instanceof Error?n.message:String(n);return a.includes("UNKNOWN_SESSION")||a.includes("no such session")}e(qn,"isUnknownSessionError");function sr(n,a){if(qn(n))return a("deleteSession.unknown");let o=n instanceof Error?n.message:String(n);return a("deleteSession.failed",{detail:o})}e(sr,"formatDeleteError");function Nr(n,a){if(qn(n))return a("archives.unarchiveUnknown");let o=n instanceof Error?n.message:String(n);return a("archives.unarchiveFailed",{detail:o})}e(Nr,"formatUnarchiveError");function Vn(n,a,o=Mr){return n.map(p=>p.sessionId+a("common.separator")+o(new Error(p.message),a)).join(`
29
+ `)}e(Vn,"formatBatchFailures");function Mr(n,a){if(qn(n))return a("archives.archiveUnknown");let o=n instanceof Error?n.message:String(n);return a("archives.archiveFailed",{detail:o})}e(Mr,"formatArchiveError");function $n(n){if(n===null||typeof n!="object")return;let a=ce(n),o=a.rpcError!==null&&typeof a.rpcError=="object"?ce(a.rpcError):void 0,p=a.name==="WorkspaceActiveSessionError"?a.activity:void 0,v=o?.details,f=a.name==="WorkspaceArchiveError"&&o?.code==="workspace/session-active"&&v!==null&&typeof v=="object"?ce(v).activity:void 0,k=Array.isArray(p)?p:Array.isArray(f)?f:void 0;if(k===void 0)return;let E=k.flatMap(M=>{if(M===null||typeof M!="object")return[];let H=ce(M).kind;return typeof H=="string"&&H.length>0?[H]:[]});return E.length>0?E:void 0}e($n,"activeSessionActivity");function Dr(n){let a=$n(n);if(a===void 0||n===null||typeof n!="object")return;let o=ce(n),p=o.rpcError!==null&&typeof o.rpcError=="object"?ce(o.rpcError).details:void 0,v=p!==null&&typeof p=="object"?ce(p).sessionId:void 0,f=typeof o.sessionId=="string"?o.sessionId:typeof v=="string"?v:void 0;return f===void 0?void 0:{sessionId:f,kinds:a}}e(Dr,"activeSessionRefusal");function Lr(n,a){let o=/^cannot archive session '(?:[^'\\]|\\')*': the session is active \((.*)\)$/.exec(a);if(o===null)return;let p=o[1].split(", ").filter(v=>v.length>0);return p.length>0?{sessionId:n,kinds:p}:void 0}e(Lr,"activeArchiveFromMessage");function oa(n,a){let o=n instanceof Error?n.message:String(n);return a("archives.forkFailed",{detail:o})}e(oa,"formatForkError");function Gn(n,a,o){if(!n||o.has(n))return!1;let p=a?.[n];return!(p===void 0||p.origin==="subagent"||p.blank)}e(Gn,"isWorkspaceTaskCandidate");function zr(n){let a=n?.closest("[data-row-key]")??null;if(a===null)return null;let o=a.getAttribute("data-row-key")??"";if(!o.startsWith("workspace:"))return null;let p=o.slice(10);if(!p)return null;let v=a.querySelector(".title")??a.querySelector("[class*='title']");return{workspaceId:p,title:v?.textContent?.trim()||p}}e(zr,"workspaceMenuTriggerFrom");function ar(n){let a=n.querySelector('[class*="rowActions"]');if(!a)return null;let o=Array.from(a.querySelectorAll("button"));if(o.length===0)return null;let p=e(f=>!!((f.getAttribute("class")??"").includes("dsham_rowStar")||typeof f.closest=="function"&&f.closest(".dsham_starSlot")),"isStarButton");return o.find(f=>{if(p(f))return!1;if(f.getAttribute("aria-haspopup")==="menu")return!0;let k=(f.getAttribute("aria-label")??f.getAttribute("title")??"").toLowerCase();return/new|create|新建|add|\+|созда/.test(k)?!1:/action|操作|действи|more|更多|选项|options|menu/.test(k)})??null}e(ar,"findRowMenuButton");function Pr(n,a){if(ar(a)===n)return!0;let p=(n.getAttribute("aria-label")??n.getAttribute("title")??"").toLowerCase();return/action|操作|действи|more|更多/.test(p)}e(Pr,"isRowMenuButton");function Or(){if(typeof document>"u"||typeof document.addEventListener!="function")return()=>{};let n=e(a=>{let o=a.target;if(!o||o.closest("input, textarea, [contenteditable='true']"))return;let p=o.closest('[data-row-key^="workspace:"], [data-row-key^="session:"]');if(!p)return;let v=o.closest("button");if(v&&!Pr(v,p))return;let f=ar(p);f&&(a.preventDefault(),a.stopPropagation(),f.click())},"onContextMenu");return document.addEventListener("contextmenu",n,!0),()=>{document.removeEventListener("contextmenu",n,!0)}}e(Or,"setupSidebarRowContextMenu");function ir(n,a=!0){let o=(n.textContent??"").toLowerCase();return o.includes("\u5220\u9664\u5DE5\u4F5C\u533A")||o.includes("delete workspace")||o.includes("\u0443\u0434\u0430\u043B\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0435\u0435")?!0:a&&/(?:^|[_\s-])danger(?:$|[_\s-])/i.test(n.className)}e(ir,"isWorkspaceDeleteMenuItem");let la=new Map,ca=new Set,da=new Map;function ua(n){return n(la)}e(ua,"useEmptySessionPendingInteraction");function ha(n){return n(da)}e(ha,"useEmptySessionStatus");function pa(n){let a=new Map,o=new Set;if(n instanceof Map)for(let[p,v]of n)v?.pendingInteraction!==void 0&&a.set(p,v.pendingInteraction),v?.completionUnread===!0&&o.add(p);return{pending:a,completed:o}}e(pa,"factsFromSessionStatus");function ma(n,a,o){let p=n(f=>f),v=a(f=>f);return o?pa(v):{pending:p,completed:ca}}e(ma,"useSessionUiFacts");let Fr={listeners:new Set,request(n){for(let a of this.listeners)a(n)},subscribe(n){return this.listeners.add(n),()=>{this.listeners.delete(n)}}};function ot(n,a){return n.blank?a("session.new"):n.title??n.displayTitle??""}e(ot,"displayTitle");function fa(n,a){let o=new Date(n),p=`${String(o.getHours()).padStart(2,"0")}:${String(o.getMinutes()).padStart(2,"0")}`;return a("archives.timestamp",{date:a("date.ymd",{y:o.getFullYear(),m:o.getMonth()+1,d:o.getDate()}),time:p})}e(fa,"archiveTimeLabel");let ga=[".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(""),Rt="data-dsham-nav-icon",va='[role="dialog"] nav button',or=[`[${Rt}] > svg { display: none !important; }`,`[${Rt}]::before {`," content: '';"," flex: none;"," width: 16px;"," height: 16px;"," background-color: currentColor;",' -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.3%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M13.5%202.5H2.5C1.94772%202.5%201.5%202.94772%201.5%203.5V4.5C1.5%205.05228%201.94772%205.5%202.5%205.5H13.5C14.0523%205.5%2014.5%205.05228%2014.5%204.5V3.5C14.5%202.94772%2014.0523%202.5%2013.5%202.5Z%22%2F%3E%3Cpath%20d%3D%22M2.5%205.5V13.5C2.5%2013.7652%202.60536%2014.0196%202.79289%2014.2071C2.98043%2014.3946%203.23478%2014.5%203.5%2014.5H12.5C12.7652%2014.5%2013.0196%2014.3946%2013.2071%2014.2071C13.3946%2014.0196%2013.5%2013.7652%2013.5%2013.5V5.5%22%2F%3E%3Cpath%20d%3D%22M6.5%209.5H9.5%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") center / contain no-repeat;',' mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.3%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M13.5%202.5H2.5C1.94772%202.5%201.5%202.94772%201.5%203.5V4.5C1.5%205.05228%201.94772%205.5%202.5%205.5H13.5C14.0523%205.5%2014.5%205.05228%2014.5%204.5V3.5C14.5%202.94772%2014.0523%202.5%2013.5%202.5Z%22%2F%3E%3Cpath%20d%3D%22M2.5%205.5V13.5C2.5%2013.7652%202.60536%2014.0196%202.79289%2014.2071C2.98043%2014.3946%203.23478%2014.5%203.5%2014.5H12.5C12.7652%2014.5%2013.0196%2014.3946%2013.2071%2014.2071C13.3946%2014.0196%2013.5%2013.7652%2013.5%2013.5V5.5%22%2F%3E%3Cpath%20d%3D%22M6.5%209.5H9.5%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") center / contain no-repeat;'," -webkit-mask-repeat: no-repeat;"," mask-repeat: no-repeat;"," -webkit-mask-position: center;"," mask-position: center;"," -webkit-mask-size: 16px 16px;"," mask-size: 16px 16px;","}"].join(`
30
+ `);function ba(n,a){let o=String(a??"").trim();return o.length>0&&String(n??"").trim()===o}e(ba,"isOwnSettingsNavRow");function Kn(n,a){for(let o of n){if(o.type==="characterData"){let v=o.target.parentElement;if(v!==null&&v.closest(a)!==null)return!0;continue}let p=o.target;if(p&&p.nodeType===1&&(typeof p.matches=="function"&&p.matches(a)||typeof p.closest=="function"&&p.closest(a)!==null))return!0;if(o.addedNodes)for(let v of o.addedNodes){if(v.nodeType!==1)continue;let f=v;if(typeof f.matches=="function"&&f.matches(a)||typeof f.querySelector=="function"&&f.querySelector(a)!==null||typeof f.closest=="function"&&f.closest(a)!==null)return!0}if(o.removedNodes)for(let v of o.removedNodes){if(v.nodeType!==1)continue;let f=v;if(typeof f.matches=="function"&&f.matches(a)||typeof f.querySelector=="function"&&f.querySelector(a)!==null||typeof f.closest=="function"&&f.closest(a)!==null)return!0}}return!1}e(Kn,"mutationTouches");function Hr(n,a){return ba(n.textContent,a)?Array.from(n.children).some(v=>v.tagName==="SPAN"&&(v.className.includes("navIcon")||v.getAttribute("aria-hidden")==="true"))||!!n.querySelector?.('[class*="navIcon"]')?n.hasAttribute(Rt)?(n.removeAttribute(Rt),!0):!1:n.getAttribute(Rt)===""?!1:(n.setAttribute(Rt,""),!0):n.hasAttribute(Rt)?(n.removeAttribute(Rt),!0):!1}e(Hr,"applySettingsNavIcon");function Br(n){return n.hasAttribute(Rt)?(n.removeAttribute(Rt),!0):!1}e(Br,"restoreSettingsNavIcon");function Ur(n){typeof document>"u"||typeof MutationObserver>"u"||n.effect(()=>{let a="dsham-nav-icon-style",o=document.getElementById(a);o===null?(o=document.createElement("style"),o.id=a,o.textContent=or,(document.head??document.documentElement).append(o)):o.textContent!==or&&(o.textContent=or);let p=!1,v=!1,f=e(()=>{if(v=!1,p)return;let M=n.locale.bind(Oe)("archived.badge");for(let H of document.querySelectorAll(va))Hr(H,M)},"sync"),k=e(()=>{v||p||(v=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(f):setTimeout(f,16))},"schedule");f();let E=new MutationObserver(M=>{Kn(M,'[role="dialog"] nav')&&k()});return E.observe(document.body,{childList:!0,subtree:!0,characterData:!0}),()=>{p=!0,E.disconnect();for(let M of document.querySelectorAll(`[${Rt}]`))Br(M);o?.remove()}},"archive-manager: settings nav icon")}e(Ur,"installSettingsNavIcon");let ya=[".dsham_settings{container-type:inline-size;min-width:0;box-sizing:border-box;width:100%;padding:0 0 32px;color:var(--dsw-alias-label-primary)}",".dsham_settingsHeader{display:flex;flex-direction:column;align-items:stretch;gap:16px;margin-bottom:16px}",".dsham_settings h2{margin:0;font-size:24px;line-height:32px;font-weight:600;letter-spacing:-.4px;white-space:nowrap}",".dsham_settingsIntro{margin:12px 0 0;max-width:42em;color:var(--dsw-alias-label-tertiary);font-size:14px;line-height:22px}",".dsham_settingsToolbar{display:flex;align-items:center;gap:8px;margin-bottom:16px;width:100%;min-width:0}",".dsham_settingsSearch{display:flex;align-items:center;gap:8px;min-width:0;width:100%;flex-wrap:nowrap}","@container(max-width:520px){.dsham_settingsSearch{flex-wrap:wrap}}",".dsham_settingsSearch .dsham_searchField{flex:1 1 0;min-width:120px;width:auto;box-sizing:border-box}",".dsham_viewSortContainer{flex:0 0 auto;position:relative;box-sizing:border-box}",".dsham_viewSortBtn{height:32px!important;padding:0 8px!important;font-size:13px!important;box-sizing:border-box}",".dsham_viewSortBtn.has-filter{border-color:var(--dsw-alias-state-business-primary)!important;color:var(--dsw-alias-state-business-primary)!important}",".dsham_settingsFilter{display:inline-flex;position:relative}",".dsham_settingsSearch .dsham_projectFilter{flex:0 0 auto;max-width:120px;min-width:0;box-sizing:border-box}",".dsham_settingsSearch .dsham_projectFilter > span{display:inline-block;max-width:100%;box-sizing:border-box}",".dsham_settingsSearch .dsham_projectFilter .dsham_menuSelectBtn{display:inline-flex!important;width:100%;max-width:120px;padding:0 8px;box-sizing:border-box;overflow:hidden}",".dsham_settingsSearch .dsham_projectFilter .dsham_selectLabel{flex:1 1 auto;min-width:0;max-width:80px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}",".dsham_settingsSearch .dsham_dateFilter{flex:0 0 125px;width:125px;min-width:125px;position:relative;box-sizing:border-box}",".dsham_dateRange{width:100%;box-sizing:border-box}",".dsham_dateTrigger{height:32px!important;padding:0 8px!important;gap:5px!important;border:0.5px solid var(--dsw-alias-border-l2)!important;border-radius:var(--dsw-radius-sm,8px)!important;background:var(--dsw-alias-bg-layer-1)!important;box-sizing:border-box}",".dsham_dateTrigger .dsham_dateText{font-size:12px!important;line-height:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".dsham_srOnly{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;opacity:0;pointer-events:none}",".dsham_menuSelectBtn{display:inline-flex!important;align-items:center;justify-content:space-between;gap:6px;width:auto!important;max-width:100%;min-width:0!important;height:32px!important;padding:0 10px;border:0.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-sm,8px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);box-sizing:border-box;font:inherit;font-size:13px;cursor:pointer}",".dsham_selectLabel{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:normal;text-align:left}",".dsham_settingsGroup{margin:0 0 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-button-elevated-fill));overflow:hidden;transition:border-color 150ms ease}",".dsham_settingsGroupHeading{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:38px;padding:0 10px;margin:0;user-select:none}",".dsham_settingsGroupTitle{display:flex;align-items:center;gap:8px;min-width:0;margin:0;color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600}",".dsham_settingsGroupTitle svg{flex:none;color:var(--dsw-alias-label-secondary)}",".dsham_settingsCount{flex:none;color:var(--dsw-alias-label-tertiary);font-size:12px}",".dsham_settingsList{display:grid;overflow:hidden;border:0;border-top:1px solid var(--dsw-alias-border-l2);border-radius:0;background:transparent}",".dsham_settingsList[hidden]{display:none!important;border:0!important}",".dsham_settingsRow{display:grid;grid-template-columns:16px minmax(0,1fr) auto;align-items:center;gap:8px;min-height:40px;padding:4px 10px;border-bottom:1px solid var(--dsw-alias-border-l2)}",".dsham_settingsRow:last-child{border-bottom:0}",".dsham_settingsContent{min-width:0;flex:1}",".dsham_settingsMeta{margin-top:1px;color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:13px}",".dsham_settingsActions{display:flex;align-items:center;gap:4px;flex:none}",".dsham_settingsEmpty{padding:28px 8px;color:var(--dsw-alias-label-secondary);text-align:center}",".dsham_settingsError{margin-top:10px;color:var(--dsw-alias-state-error-primary);font-size:12px;white-space:pre-line}","@container(max-width:520px){.dsham_settingsHeader{margin-bottom:16px}.dsham_settingsGroup{margin-bottom:10px}.dsham_settingsRow{padding:4px 8px}.dsham_settingsActions{gap:2px}}"].join(""),wa=".dsham_settingsTitleLink{display:block;max-width:100%;padding:0;border:0;background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;font-weight:600;line-height:16px;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}.dsham_settingsTitleLink:hover:not(:disabled){text-decoration:underline;text-underline-offset:3px}.dsham_settingsTitleLink:disabled{cursor:default;opacity:.6}.dsham_groupToggle{display:flex;align-items:center;gap:8px;min-width:0;max-width:100%;padding:4px 0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}.dsham_groupToggle span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dsham_settingsRow:hover{background:var(--dsw-alias-interactive-bg-hover)}.dsham_settingsRow[data-selected=true]{background:var(--dsw-alias-interactive-bg-hover)}.dsham_settingsTitleLink:focus-visible,.dsham_groupToggle:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary,#3b82f6);outline-offset:2px}@container(max-width:400px){.dsham_settingsRow{gap:6px;padding:4px 6px}.dsham_settingsActions{gap:0}.dsham_settingsMeta{font-size:10px}}.dsham_settingsGroupMeta{display:flex;align-items:center;gap:8px;flex:none;flex-wrap:wrap}.dsham_settingsStatus{margin-top:10px;color:var(--dsw-alias-label-secondary);font-size:12px}.dsham_checkbox{flex:none;box-sizing:border-box;width:16px;height:16px;margin:0;accent-color:var(--dsw-alias-brand-primary);cursor:pointer}.dsham_checkbox:focus-visible{outline:var(--dsw-focus-ring-width,1px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}.dsham_checkbox:disabled{opacity:.5;cursor:default}button.dsham_favoriteOn{color:#e8b931}button.dsham_favoriteOn:not(:disabled):hover{color:#e8b931!important;border-color:#e8b931!important}",Sa=".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}}",xa=".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 lr({id:n,className:a,value:o,options:p,onChange:v,disabled:f=!1,"aria-label":k,title:E,tabIndex:M,"aria-hidden":H}){let[A,z]=l.useState(!1),O=l.useMemo(()=>p.map(Ne=>({id:Ne.value,label:Ne.label})),[p]),u=p.find(Ne=>Ne.value===o),ae=u?.label??k;return(0,s.jsx)("div",{id:n,tabIndex:M,"aria-hidden":H,className:a===void 0?"dsham_settingsFilter":`dsham_settingsFilter ${a}`,children:(0,s.jsx)(h.Menu,{open:A,onClose:e(()=>z(!1),"onClose"),onSelect:e(Ne=>{f||v(Ne),z(!1)},"onSelect"),selectedId:o,align:"start",portal:!0,dense:!0,listClassName:"dsham_selectDropdown",anchor:(0,s.jsxs)(h.Button,{variant:"outline",size:"sm",role:"combobox","aria-label":k,"aria-expanded":A,disabled:f,tabIndex:M,"aria-hidden":H,title:E??u?.title??u?.label??k,className:"dsham_menuSelectBtn"+(A?" is-open":""),onClick:e(()=>{f||z(Ne=>!Ne)},"onClick"),children:[(0,s.jsx)("span",{className:"dsham_selectLabel",children:ae}),(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",style:{marginLeft:4,transition:"transform 150ms ease",transform:A?"rotate(180deg)":"none",flex:"none"},children:(0,s.jsx)("path",{d:"m4 6 4 4 4-4"})})]}),items:O})})}e(lr,"ArchiveProjectSelect");function ka({id:n,t:a,disabled:o=!1,favoritesOnly:p,setFavoritesOnly:v,favoriteBusy:f=!1,sortBy:k,setSortBy:E,options:M}){let[H,A]=l.useState(!1),z=l.useMemo(()=>{let me=[];typeof v=="function"&&(me.push({type:"label",id:"lbl_view_filter",text:a("organizer.favoriteFilter")||"\u7B5B\u9009\u4F1A\u8BDD"}),me.push({id:"filter:all",label:a("organizer.allSessions")||"\u5168\u90E8\u4F1A\u8BDD"}),me.push({id:"filter:favorites",label:a("organizer.favoritesOnly")||"\u53EA\u770B\u6536\u85CF"}),me.push({type:"separator",id:"sep_view_filter"})),me.push({type:"label",id:"lbl_view_sort",text:a("archives.sortLabel")||"\u6392\u5E8F\u65B9\u5F0F"});for(let yt of M)me.push({id:`sort:${yt.value}`,label:yt.label});return me},[a,v,M]),O=e(me=>{me.startsWith("filter:")?typeof v=="function"&&!f&&v(me==="filter:favorites"):me.startsWith("sort:")&&E(me.slice(5)),A(!1)},"onSelect"),u=M.find(me=>me.value===k),ae=p?a("organizer.favoritesOnly")||"\u53EA\u770B\u6536\u85CF":a("organizer.allChats")||"\u5168\u90E8\u804A\u5929",Ne=`${ae} \xB7 ${u?.label??k}`;return(0,s.jsxs)("div",{className:"dsham_viewSortContainer",children:[(0,s.jsx)(h.Menu,{open:H,onClose:e(()=>A(!1),"onClose"),onSelect:O,selectedIds:[p?"filter:favorites":"filter:all",`sort:${k}`],align:"end",portal:!0,dense:!0,listClassName:"dsham_viewSortDropdown",anchor:(0,s.jsxs)(h.Button,{variant:"outline",size:"sm",role:"combobox","aria-label":a("archives.viewOptions")||"\u89C6\u56FE\u9009\u9879","aria-expanded":H,disabled:o,title:Ne,className:"dsham_menuSelectBtn dsham_viewSortBtn"+(H?" is-open":"")+(p?" has-filter":""),onClick:e(()=>{o||A(me=>!me)},"onClick"),children:[(0,s.jsxs)("svg",{viewBox:"0 0 16 16",width:13,height:13,fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round",style:{flex:"none",marginRight:4},children:[(0,s.jsx)("line",{x1:2.5,y1:4.5,x2:13.5,y2:4.5}),(0,s.jsx)("circle",{cx:5,cy:4.5,r:1.5,fill:"var(--dsw-alias-bg-layer-1)"}),(0,s.jsx)("line",{x1:2.5,y1:11.5,x2:13.5,y2:11.5}),(0,s.jsx)("circle",{cx:11,cy:11.5,r:1.5,fill:"var(--dsw-alias-bg-layer-1)"})]}),(0,s.jsx)("span",{className:"dsham_selectLabel",children:ae}),(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:11,height:11,fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",style:{marginLeft:3,transition:"transform 150ms ease",transform:H?"rotate(180deg)":"none",flex:"none"},children:(0,s.jsx)("path",{d:"m4 6 4 4 4-4"})})]}),items:z})]})}e(ka,"ArchiveViewSortMenu");function Wr({selectedCount:n,hiddenCount:a,allVisibleSelected:o,selectedVisibleCount:p,visibleCount:v,busy:f,t:k,onToggle:E,onClear:M,onRestore:H,onDelete:A,onArchive:z}){let O=n>0;return(0,s.jsxs)("div",{className:"dsham_settingsSelection",children:[(0,s.jsxs)("div",{className:"dsham_settingsSelectionMain",children:[(0,s.jsxs)("div",{className:"dsham_settingsSelectionSummary",children:[(0,s.jsxs)("label",{className:"dsham_settingsSelectionToggle",title:k("archives.selectAllFiltered"),children:[(0,s.jsx)(qr,{checked:o,indeterminate:p>0&&!o,disabled:f||v===0,label:k("archives.selectAllFiltered"),onChange:e(u=>E(u.target.checked),"onChange")}),(0,s.jsx)("span",{"aria-live":"polite",children:O?k("archives.selectedCount",{n}):k("archives.selectAllFiltered")})]}),O&&g({disabled:f,"aria-label":k("archives.clearSelection"),onClick:M,children:k("archives.clearSelectionShort")})]}),O&&(0,s.jsxs)("div",{className:"dsham_settingsSelectionActions",children:z?[g({disabled:f,onClick:z,children:k("archives.archiveSelected")})]:[g({disabled:f,"aria-label":k("archives.restoreSelected"),onClick:H,children:k("archives.restore")}),g({disabled:f,className:"dsham_btnDanger","aria-label":k("archives.deleteSelected"),onClick:A,children:k("archives.deleteSelectionShort")})]})]}),a>0&&(0,s.jsx)("p",{className:"dsham_settingsSelectionScope",role:"status",children:k("archives.selectionHiddenHint",{hidden:a})})]})}e(Wr,"ArchiveSelectionToolbar");function qr({checked:n,indeterminate:a=!1,disabled:o=!1,label:p,onChange:v}){return(0,s.jsx)(mr,{checked:n,indeterminate:a,disabled:o,label:p,onChange:v})}e(qr,"ArchiveSelectionCheckbox");function Vr(){return(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,"aria-hidden":!0,focusable:"false",children:[3.5,8,12.5].map(n=>(0,s.jsx)("circle",{cx:n,cy:8,r:1.15,fill:"none",stroke:"currentColor",strokeWidth:1.5},n))})}e(Vr,"moreIcon");function Ca({busy:n,title:a,t:o,onPreview:p,onRestoreOpen:v,onDelete:f,onCopyId:k}){let[E,M]=(0,l.useState)(!1),H=e(z=>{if(!n){if(M(!1),z==="copyId")return k?.();if(z==="preview")return p?.();if(z==="restoreOpen")return v?.();z==="delete"&&f?.()}},"choose"),A=[...p?[{id:"preview",label:o("discovery.preview"),icon:(0,s.jsx)(h.IconBrowseOutlineMedium,{size:16}),danger:!1}]:[],...v?[{id:"restoreOpen",label:o("archives.restoreOpen"),icon:(0,s.jsx)(h.IconUnarchiveOutlineMedium,{size:16}),danger:!1}]:[],...k?[{id:"copyId",label:o("details.copyId"),icon:(0,s.jsx)(h.IconCopyOutlineMedium,{size:16}),danger:!1}]:[],...f?[{id:"delete",label:o("menu.deleteSession"),icon:(0,s.jsx)(h.IconTrashOutlineMedium,{size:16}),danger:!0}]:[]];return(0,s.jsx)(h.Menu,{open:!n&&E,align:"end",portal:!0,dense:!0,items:A,onSelect:H,onClose:e(()=>M(!1),"onClose"),anchor:g({variant:"outline",className:"dsham_iconAction",disabled:n,title:o("archives.moreActions"),"aria-label":o("archives.moreActions")+o("common.separator")+a,"aria-haspopup":"menu","aria-expanded":E&&!n,icon:Vr(),onClick:e(()=>{n||M(z=>!z)},"onClick")})})}e(Ca,"ArchivedSessionMenu");function Ea({group:n,busy:a,onArchive:o,onRestore:p,onDelete:v,t:f}){let k=n.key===Yn,E=o?[{id:"archive",label:f(k?"archives.archiveUngrouped":"archives.archiveProject"),icon:(0,s.jsx)(h.IconArchiveOutlineMedium,{size:16}),danger:!0}]:[{id:"restore",label:f(k?"archives.restoreUngrouped":"archives.restoreProject"),icon:(0,s.jsx)(h.IconUnarchiveOutlineMedium,{size:16}),danger:!1},{id:"delete",label:f(k?"archives.deleteUngrouped":"archives.deleteProject"),icon:(0,s.jsx)(h.IconTrashOutlineMedium,{size:16}),danger:!0}],[M,H]=(0,l.useState)(!1),A=f(k?"archives.ungroupedActions":"archives.projectActions",{name:n.title}),z=e(O=>{a||(O==="archive"?o?.():O==="restore"?p?.():O==="delete"&&v?.())},"choose");return(0,s.jsx)(h.Menu,{open:!a&&M,align:"end",portal:!0,dense:!0,items:E,onSelect:e(O=>{H(!1),z(O)},"onSelect"),onClose:e(()=>H(!1),"onClose"),anchor:g({variant:"outline",className:"dsham_iconAction",disabled:a,"aria-label":A,"aria-haspopup":"menu","aria-expanded":M&&!a,icon:Vr(),onClick:e(()=>{a||H(O=>!O)},"onClick")})})}e(Ea,"ArchivedGroupActions");let Yn="__ungrouped__";function Ia(n){return n===Yn?{scope:"ungrouped"}:{scope:"workspace",workspaceId:n}}e(Ia,"archivedBatchTargetForGroup");function En(n,a,o){let p=[...new Set(n??[])];if(o.scope==="all")return p;if(o.scope==="sessions"){let f=new Set(o.sessionIds??[]);return p.filter(k=>f.has(k))}if(o.scope==="workspace"){let f=new Set(a.find(k=>k.workspaceId===o.workspaceId)?.sessionIds??[]);return p.filter(k=>f.has(k))}let v=new Set(a.flatMap(f=>f.sessionIds));return p.filter(f=>!v.has(f))}e(En,"deriveArchivedBatchIds");function $r(n){return[...new Set(n.flatMap(a=>a.sessions.map(o=>o.id)))]}e($r,"archivedSessionIdsInGroups");function Gr(n,a){let o=new Set(a);return[...new Set(n)].filter(p=>o.has(p))}e(Gr,"pruneArchivedSelection");function cr(n,a,o){let p=new Set(n);for(let v of a)o?p.add(v):p.delete(v);return[...p]}e(cr,"toggleArchivedSelection");function Kr(n,a){let o=n.deletedSessionIds.length,p=n.skippedSessionIds.length;return n.failures.length>0?{kind:"error",message:a("archives.deletePartial",{deleted:o,skipped:p,failed:n.failures.length,detail:n.failures[0].message})}:p>0&&o>0?{kind:"notice",message:a("archives.deleteSuccessWithSkipped",{deleted:o,skipped:p})}:p>0?{kind:"notice",message:a("archives.deleteSkipped",{n:p})}:{kind:"notice",message:a("archives.deleteSuccess",{n:o})}}e(Kr,"archivedDeleteFeedback");function Yr(n,a){let o=new Set(a);return Object.values(n).filter(p=>p.origin!=="subagent"&&!p.blank&&!o.has(p.id)).map(p=>p.id)}e(Yr,"unarchivedSessionIds");function Zr(n,a,o,p){let v=a.map(E=>({key:E.workspaceId,title:E.title,ids:new Set(E.sessionIds),sessions:[]})),f=[];for(let E of o){let M=n[E];if(M===void 0||M.origin==="subagent")continue;let H=v.find(A=>A.ids?.has(E));(H===void 0?f:H.sessions).push(M)}let k=v.filter(E=>E.sessions.length>0);return f.length>0&&k.push({key:Yn,title:p,sessions:f}),k}e(Zr,"deriveArchivedGroups");function Jr(n,a,o,p,v=[]){let f=e((A,z)=>String(A).localeCompare(String(z),void 0,{numeric:!0,sensitivity:"base"}),"compareText"),k=new Map;if(Array.isArray(v))for(let A=0;A<v.length;A++)k.set(v[A],A);let E=e(A=>{let z=a==="created"?o[A.id]:A.updatedAt;return typeof z=="number"&&Number.isFinite(z)?z:Number.NEGATIVE_INFINITY},"timestampOf"),M=e((A,z)=>{if(a==="archived"){let O=k.get(A.id)??-1,ae=(k.get(z.id)??-1)-O;if(ae!==0)return ae}if(a!=="alphabetical"){let O=E(z)-E(A);if(Number.isFinite(O)&&O!==0)return O}return f(ot(A,p),ot(z,p))||f(A.id,z.id)},"compareSessions");return n.map(A=>({...A,sessions:[...A.sessions].sort(M)})).sort((A,z)=>{if(a==="archived"){let O=A.sessions[0]?.id,u=z.sessions[0]?.id,ae=O!==void 0?k.get(O)??-1:-1,me=(u!==void 0?k.get(u)??-1:-1)-ae;if(me!==0)return me}if(a!=="alphabetical"){let O=E(z.sessions[0])-E(A.sessions[0]);if(Number.isFinite(O)&&O!==0)return O}return f(A.title,z.title)||f(A.key,z.key)})}e(Jr,"sortArchivedGroups");let Xr={...Zs,...Ts,"locale.language":"zh","service.unavailable":"\u670D\u52A1\u5C1A\u672A\u5C31\u7EEA\uFF0C\u8BF7\u91CD\u8BD5","common.close":"\u5173\u95ED","entry.location.title":"\u5165\u53E3\u5C55\u793A\u4F4D\u7F6E","entry.location.desc":"\u9009\u62E9\u5F52\u6863\u7BA1\u7406\u5165\u53E3\u7684\u5C55\u793A\u4F4D\u7F6E\uFF08\u81F3\u5C11\u4FDD\u7559\u4E00\u5904\uFF0C\u9632\u6B62\u65E0\u6CD5\u6253\u5F00\u9762\u677F\uFF09\u3002","entry.location.both":"\u4E24\u8FB9\u663E\u793A","entry.location.sidebar":"\u4EC5\u4FA7\u8FB9\u680F","entry.location.settings":"\u4EC5\u8BBE\u7F6E","entry.location.saveFailed":"\u4FDD\u5B58\u5165\u53E3\u8BBE\u7F6E\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u6216\u91CD\u542F\u5BBF\u4E3B\u8FDB\u7A0B","sidebar.favoriteStar.title":"\u4FA7\u680F\u6536\u85CF\u661F\u6807","sidebar.favoriteStar.desc":"\u5728\u4F1A\u8BDD\u5217\u8868\u884C\u524D\u663E\u793A\u6536\u85CF\u661F\u6807\u3002\u5173\u95ED\u540E\u4E0D\u663E\u793A\u56FE\u6807\uFF0C\u4ECD\u53EF\u901A\u8FC7\u83DC\u5355\u6536\u85CF\u548C\u7B5B\u9009\u3002","sidebar.favoriteStar.toggle":"\u5207\u6362\u4FA7\u680F\u6536\u85CF\u661F\u6807","update.entry.title":"\u5728\u7EBF\u66F4\u65B0","update.entry.desc":"\u5141\u8BB8\u68C0\u67E5\u5E76\u5728\u7EBF\u5B89\u88C5\u5F52\u6863\u7BA1\u7406\u5668\u7684\u65B0\u7248\u672C\u3002\u5173\u95ED\u540E\u9690\u85CF\u66F4\u65B0\u5165\u53E3\u3002","update.entry.toggle":"\u5207\u6362\u5728\u7EBF\u66F4\u65B0","update.entry.locked":"\u5728\u7EBF\u66F4\u65B0\u5DF2\u88AB\u5BBF\u4E3B\u914D\u7F6E\u9501\u5B9A\u7981\u7528","archives.archiveProject":"\u5F52\u6863\u8BE5\u9879\u76EE\u7684\u5168\u90E8\u804A\u5929","archives.archiveUngrouped":"\u5F52\u6863\u5168\u90E8\u672A\u5206\u7EC4\u804A\u5929","archives.archiveProjectDesc":"\u5C06\u201C{name}\u201D\u4E2D\u5168\u90E8 {n} \u6761\u672A\u5F52\u6863\u4F1A\u8BDD\u5F52\u6863\uFF0C\u4E0D\u53D7\u5F53\u524D\u641C\u7D22\u7B5B\u9009\u5F71\u54CD\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u6062\u590D\u3002","archives.archiveUngroupedDesc":"\u5C06\u5168\u90E8 {n} \u6761\u672A\u5206\u7EC4\u7684\u672A\u5F52\u6863\u4F1A\u8BDD\u5F52\u6863\uFF0C\u4E0D\u53D7\u5F53\u524D\u641C\u7D22\u7B5B\u9009\u5F71\u54CD\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u6062\u590D\u3002","archives.tab.archived":"\u5DF2\u5F52\u6863","archives.tab.unarchived":"\u672A\u5F52\u6863","archives.searchUnarchived":"\u641C\u7D22\u672A\u5F52\u6863\u804A\u5929","archives.emptyUnarchived":"\u6682\u65E0\u672A\u5F52\u6863\u4F1A\u8BDD\u3002","archives.archiveSelected":"\u5F52\u6863","archives.openSession":"\u6253\u5F00","archives.moreActions":"\u66F4\u591A\u64CD\u4F5C","archives.archiveSelectedDesc":"\u5C06\u9009\u4E2D\u7684\u4F1A\u8BDD\u5F52\u6863\uFF0C\u5305\u542B\u5F53\u524D\u7B5B\u9009\u9690\u85CF\u7684\u5DF2\u9009\u9879\u3002\u4E4B\u540E\u53EF\u5728\u201C\u5DF2\u5F52\u6863\u201D\u4E2D\u67E5\u770B\u548C\u6062\u590D\u3002","archives.archiveSuccess":"\u5DF2\u5F52\u6863 {n} \u6761\u4F1A\u8BDD\u3002","archives.archiveBatchFailed":"\u6279\u91CF\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.navigationUnavailable":"\u5F53\u524D\u5BBF\u4E3B\u65E0\u6CD5\u4FDD\u6301\u5F52\u6863\u5BF9\u8BDD\uFF0C\u8BF7\u4F7F\u7528\u201C\u6062\u590D\u5E76\u6253\u5F00\u201D\u3002","archives.sessionNotRetained":"\u5BBF\u4E3B\u672A\u4FDD\u7559\u76EE\u6807\u4F1A\u8BDD\uFF0C\u8BF7\u91CD\u65B0\u6253\u5F00\u6216\u6062\u590D\u540E\u518D\u8BD5\u3002","archives.restoreOpen":"\u6062\u590D\u6253\u5F00","archives.selectedCount":"\u5DF2\u9009 {n} \u6761","archives.selectionHiddenHint":"\u542B\u5F53\u524D\u672A\u663E\u793A\u7684 {hidden} \u6761\uFF0C\u4E5F\u5C06\u53C2\u4E0E\u64CD\u4F5C","archives.clearSelectionShort":"\u6E05\u7A7A","archives.restore":"\u6062\u590D","archives.archiveTitle":"\u5F52\u6863 {n} \u4E2A\u804A\u5929\uFF1F","archives.deleteSelectionShort":"\u5220\u9664","archives.clearSelection":"\u6E05\u7A7A\u9009\u62E9","group.ungrouped":"\u672A\u5206\u7EC4","session.new":"\u65B0\u4F1A\u8BDD","menu.deleteSession":"\u5220\u9664\u4F1A\u8BDD","archived.badge":"\u5F52\u6863\u4F1A\u8BDD","archives.title":"\u5F52\u6863\u4F1A\u8BDD","archives.description":"\u7BA1\u7406\u5DF2\u5F52\u6863\u4F1A\u8BDD\uFF0C\u6216\u9009\u62E9\u672A\u5F52\u6863\u4F1A\u8BDD\u8FDB\u884C\u6279\u91CF\u5F52\u6863\u3002","archives.viewProject":"GitHub","archives.feedback":"\u95EE\u9898\u53CD\u9988","archives.empty":"\u6682\u65E0\u5DF2\u5F52\u6863\u4F1A\u8BDD","archives.emptyFiltered":"\u6CA1\u6709\u7B26\u5408\u7B5B\u9009\u6761\u4EF6\u7684\u804A\u5929","archives.searchPlaceholder":"\u641C\u7D22\u5DF2\u5F52\u6863\u804A\u5929","archives.sortLabel":"\u6392\u5E8F\u65B9\u5F0F","archives.viewOptions":"\u89C6\u56FE\u9009\u9879","archives.sortArchived":"\u6700\u8FD1\u5F52\u6863","archives.sortUpdated":"\u66F4\u65B0\u65F6\u95F4","archives.sortCreated":"\u521B\u5EFA\u65F6\u95F4","archives.sortAlphabetical":"\u6309\u5B57\u6BCD\u987A\u5E8F","archives.projectFilter":"\u6309\u9879\u76EE\u7B5B\u9009","archives.allProjects":"\u6240\u6709\u9879\u76EE","discovery.timeRange":"\u65F6\u95F4\u8303\u56F4","organizer.allChats":"\u5168\u90E8\u804A\u5929","archives.sessionCount":"{n} \u4E2A\u804A\u5929","archives.selectAllFiltered":"\u5168\u9009\u5F53\u524D\u7B5B\u9009\u7ED3\u679C","archives.selectSession":"\u9009\u62E9\u4F1A\u8BDD\u201C{name}\u201D","archives.restoreSelected":"\u6062\u590D\u6240\u9009","archives.deleteSelected":"\u5220\u9664\u6240\u9009","archives.timestamp":"{date}\uFF0C{time}","archives.restoreProject":"\u6062\u590D\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.restoreUngrouped":"\u5168\u90E8\u6062\u590D","archives.deleteProject":"\u5220\u9664\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.deleteUngrouped":"\u5168\u90E8\u5220\u9664","archives.projectActions":"\u9879\u76EE\u201C{name}\u201D\u7684\u5F52\u6863\u64CD\u4F5C","archives.ungroupedActions":"\u672A\u5206\u7EC4\u804A\u5929\u7684\u5F52\u6863\u64CD\u4F5C","archives.restoreSuccess":"\u5DF2\u6062\u590D {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u3002","archives.restoreBatchFailed":"\u6279\u91CF\u6062\u590D\u5931\u8D25\uFF1A{detail}","archives.deleteSelectedTitle":"\u5220\u9664\u6240\u9009\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteSelectedDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u6240\u9009\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\uFF08\u542B\u6B63\u5728\u8FD0\u884C\u7684\uFF09\u548C\u8BB0\u5F55\u3002\u5176\u4ED6\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteSelectedConfirm":"\u5220\u9664\u6240\u9009\u804A\u5929","archives.deleteProjectTitle":"\u5220\u9664\u201C{name}\u201D\u4E2D\u7684\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteProjectDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u201C{name}\u201D\u4E2D\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\u548C\u8BB0\u5F55\u3002\u9879\u76EE\u76EE\u5F55\u548C\u672A\u5F52\u6863\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteProjectConfirm":"\u5220\u9664\u9879\u76EE\u5168\u90E8\u804A\u5929","archives.deleteUngroupedTitle":"\u5220\u9664\u672A\u5206\u7EC4\u7684\u5DF2\u5F52\u6863\u804A\u5929","archives.deleteUngroupedDesc":"\u5C06\u6C38\u4E45\u5220\u9664\u672A\u5206\u7EC4\u4E2D\u7684 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u53CA\u5176\u5B50\u4EE3\u7406\u548C\u8BB0\u5F55\u3002\u5176\u4ED6\u9879\u76EE\u548C\u672A\u5F52\u6863\u804A\u5929\u4E0D\u4F1A\u53D7\u5F71\u54CD\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","archives.deleteUngroupedConfirm":"\u5220\u9664\u672A\u5206\u7EC4\u7684\u5168\u90E8\u804A\u5929","archives.deleteBatchPending":"\u6B63\u5728\u5220\u9664\u5DF2\u5F52\u6863\u804A\u5929\u2026","archives.deleteSuccess":"\u5DF2\u5220\u9664 {n} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\u3002","archives.deleteSuccessWithSkipped":"\u5DF2\u5220\u9664 {deleted} \u4E2A\u5DF2\u5F52\u6863\u804A\u5929\uFF1B\u53E6\u6E05\u7406 {skipped} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\u3002","archives.deleteSkipped":"\u5DF2\u6E05\u7406 {n} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\u3002","archives.deletePartial":"\u5DF2\u5220\u9664 {deleted} \u4E2A\u804A\u5929\uFF0C\u6E05\u7406 {skipped} \u4E2A\u5DF2\u4E0D\u5B58\u5728\u4F1A\u8BDD\u7684\u5F52\u6863\u8BB0\u5F55\uFF1B{failed} \u4E2A\u5220\u9664\u5931\u8D25\uFF1A{detail}","archives.unarchiveUnknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u53D6\u6D88\u5F52\u6863\u3002","archives.unarchiveFailed":"\u53D6\u6D88\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.archiveUnknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u5F52\u6863\u3002","archives.archiveFailed":"\u5F52\u6863\u5931\u8D25\uFF1A{detail}","archives.archiveActive":"\u4F1A\u8BDD\u4ECD\u5728\u8FD0\u884C\uFF08{kinds}\uFF09\u3002","archiveActive.title":"\u505C\u6B62\u5E76\u5F52\u6863","archiveActive.desc":"\u201C{name}\u201D\u4ECD\u6709\u6B63\u5728\u8FDB\u884C\u7684\u5DE5\u4F5C\uFF1A{kinds}\u3002\u5F52\u6863\u524D\u4F1A\u505C\u6B62\u8FD9\u4E9B\u5DE5\u4F5C\u3002","archiveActive.confirm":"\u505C\u6B62\u5E76\u5F52\u6863","archives.forkFailed":"\u5206\u53C9\u4F1A\u8BDD\u5931\u8D25\uFF1A{detail}","deleteSession.title":"\u5220\u9664\u4F1A\u8BDD","deleteSession.confirmTitle":"\u5220\u9664\u4F1A\u8BDD\uFF1F","deleteSession.desc":"\u5C06\u6C38\u4E45\u5220\u9664\u4F1A\u8BDD\u201C{name}\u201D\u53CA\u5176\u5B50\u4EE3\u7406\uFF08\u542B\u6B63\u5728\u8FD0\u884C\u7684\uFF09\u548C\u5168\u90E8\u8BB0\u5F55\uFF08\u5BF9\u8BDD\u5185\u5BB9\u3001\u7EDF\u8BA1\u3001\u7F13\u5B58\uFF09\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","deleteSession.pending":"\u6B63\u5728\u5220\u9664\u4F1A\u8BDD\u2026","deleteSession.unknown":"\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\u6216\u5DF2\u88AB\u5220\u9664\u3002","deleteSession.failed":"\u5220\u9664\u4F1A\u8BDD\u5931\u8D25\uFF1A{detail}","menu.archiveWorkspace":"\u5F52\u6863\u5DE5\u4F5C\u533A","menu.copyWorkspacePath":"\u590D\u5236\u76EE\u5F55","menu.openInExplorer":"\u6253\u5F00\u76EE\u5F55","menu.moveSession":"\u79FB\u52A8\u5230\u5DE5\u4F5C\u533A","moveSession.noOtherWorkspaces":"\u6682\u65E0\u53EF\u79FB\u52A8\u7684\u5176\u4ED6\u5DE5\u4F5C\u533A","moveSession.success":"\u4F1A\u8BDD\u5DF2\u6210\u529F\u79FB\u52A8\u5230\u201C{name}\u201D","archiveWorkspace.title":"\u5F52\u6863 {n} \u4E2A\u4F1A\u8BDD\uFF1F","archiveWorkspace.desc":"\u8FD9\u4F1A\u5C06\u201C{name}\u201D\u4E2D\u7684\u4F1A\u8BDD\u5F52\u6863\u3002\u4E4B\u540E\u53EF\u4EE5\u5728\u201C\u8BBE\u7F6E \u2192 \u5F52\u6863\u4F1A\u8BDD\u201D\u4E2D\u627E\u5230\u5B83\u4EEC\u3002","archiveWorkspace.confirm":"\u5168\u90E8\u5F52\u6863","archiveWorkspace.pending":"\u6B63\u5728\u5F52\u6863\u4F1A\u8BDD\u2026","date.ymd":"{y}\u5E74{m}\u6708{d}\u65E5"},Qr={...Js,...As,"locale.language":"en","service.unavailable":"The service is not ready. Please retry.","common.close":"Close","entry.location.title":"Entry placement","entry.location.desc":"Choose where to show the entry (at least one is retained to avoid losing access).","entry.location.both":"Both","entry.location.sidebar":"Sidebar only","entry.location.settings":"Settings only","entry.location.saveFailed":"Failed to save entry location. Please check your network or restart the host.","sidebar.favoriteStar.title":"Sidebar favorite star","sidebar.favoriteStar.desc":"Show favorite star on session rows in the sidebar. When disabled, the star is hidden while menu actions and filters stay available.","sidebar.favoriteStar.toggle":"Toggle sidebar favorite star","update.entry.title":"Online updates","update.entry.desc":"Allow checking and installing new versions online. Hides the update entry when disabled.","update.entry.toggle":"Toggle online updates","update.entry.locked":"Online updates are disabled by the host configuration.","archives.moreActions":"More actions","archives.archiveProject":"Archive all chats in this project","archives.archiveUngrouped":"Archive all ungrouped chats","archives.archiveProjectDesc":"Archive all {n} unarchived sessions in \u201C{name}\u201D, regardless of the current search filter. You can restore them in Archived.","archives.archiveUngroupedDesc":"Archive all {n} ungrouped, unarchived sessions, regardless of the current search filter. You can restore them in Archived.","archives.tab.archived":"Archived","archives.tab.unarchived":"Unarchived","archives.searchUnarchived":"Search unarchived chats","archives.emptyUnarchived":"No unarchived sessions.","archives.archiveSelected":"Archive","archives.openSession":"Open session","archives.archiveSelectedDesc":"Archive the selected sessions, including selections hidden by the current filter. You can view and restore them in Archived.","archives.archiveSuccess":"Archived {n} sessions.","archives.archiveBatchFailed":"Batch archive failed: {detail}","archives.navigationUnavailable":"This host cannot keep the conversation archived while opening it. Use \u201CRestore and open\u201D instead.","archives.sessionNotRetained":"The host did not keep the requested conversation open. Try again, or restore it before opening.","archives.restoreOpen":"Restore and open","archives.selectedCount":"{n} selected","archives.selectionHiddenHint":"Includes {hidden} hidden by the current filter; actions apply to them too.","archives.clearSelectionShort":"Clear","archives.restore":"Restore","archives.archiveTitle":"Archive {n} chats?","archives.deleteSelectionShort":"Delete","archives.clearSelection":"Clear selection","group.ungrouped":"Ungrouped","session.new":"New Session","menu.deleteSession":"Delete session","archived.badge":"Archived sessions","archives.title":"Archived sessions","archives.description":"Manage archived sessions or select unarchived sessions to archive in bulk.","archives.viewProject":"GitHub","archives.feedback":"Issues","archives.empty":"No archived sessions.","archives.emptyFiltered":"No chats match your filters.","archives.searchPlaceholder":"Search archived chats","archives.sortLabel":"Sort order","archives.viewOptions":"View options","archives.sortArchived":"Recently archived","archives.sortUpdated":"Last updated","archives.sortCreated":"Created","archives.sortAlphabetical":"Alphabetical","archives.projectFilter":"Filter by project","archives.allProjects":"All projects","discovery.timeRange":"Date range","organizer.allChats":"All chats","archives.sessionCount":"{n} chats","archives.selectAllFiltered":"Select all results","archives.selectSession":"Select chat {name}","archives.restoreSelected":"Restore selected","archives.deleteSelected":"Delete selected","archives.timestamp":"{date}, {time}","archives.restoreProject":"Restore all chats in this project","archives.restoreUngrouped":"Restore all","archives.deleteProject":"Delete all chats in this project","archives.deleteUngrouped":"Delete all","archives.projectActions":"Archive actions for project {name}","archives.ungroupedActions":"Archive actions for ungrouped chats","archives.restoreSuccess":"Restored {n} archived chats.","archives.restoreBatchFailed":"Could not restore the archived chats: {detail}","archives.deleteSelectedTitle":"Delete selected archived chats","archives.deleteSelectedDesc":"This permanently deletes the selected {n} archived chats, their child agents (including any that are still running), and their records. Other chats are not affected. This cannot be undone.","archives.deleteSelectedConfirm":"Delete selected chats","archives.deleteProjectTitle":"Delete archived chats in {name}","archives.deleteProjectDesc":"This permanently deletes the {n} archived chats in {name}, their child agents, and their records. The project directory and unarchived chats are not affected. This cannot be undone.","archives.deleteProjectConfirm":"Delete all project chats","archives.deleteUngroupedTitle":"Delete ungrouped archived chats","archives.deleteUngroupedDesc":"This permanently deletes the {n} ungrouped archived chats, their child agents, and their records. Other projects and unarchived chats are not affected. This cannot be undone.","archives.deleteUngroupedConfirm":"Delete all ungrouped chats","archives.deleteBatchPending":"Deleting archived chats\u2026","archives.deleteSuccess":"Deleted {n} archived chats.","archives.deleteSuccessWithSkipped":"Deleted {deleted} archived chats and cleared {skipped} stale archive entries for sessions that no longer exist.","archives.deleteSkipped":"Cleared {n} stale archive entries for sessions that no longer exist.","archives.deletePartial":"Deleted {deleted} chats and cleared {skipped} stale archive entries; {failed} could not be deleted: {detail}","archives.unarchiveUnknown":"This session no longer exists, so it cannot be unarchived.","archives.unarchiveFailed":"Could not unarchive the session: {detail}","archives.archiveUnknown":"This session no longer exists, so it cannot be archived.","archives.archiveFailed":"Could not archive the session: {detail}","archives.archiveActive":"This conversation is still running ({kinds}).","archiveActive.title":"Stop and archive","archiveActive.desc":"\u201C{name}\u201D still has work in progress: {kinds}. Archiving stops that work first.","archiveActive.confirm":"Stop and archive","archives.forkFailed":"Could not fork the session: {detail}","deleteSession.title":"Delete session","deleteSession.confirmTitle":"Delete session?","deleteSession.desc":"This permanently deletes session \u201C{name}\u201D, its child agents (including any that are still running), and all of its records (conversation, stats, cache). This cannot be undone.","deleteSession.pending":"Deleting session\u2026","deleteSession.unknown":"This session no longer exists or was already deleted.","deleteSession.failed":"Could not delete the session: {detail}","menu.archiveWorkspace":"Archive workspace","menu.copyWorkspacePath":"Copy folder path","menu.openInExplorer":"Open folder","menu.moveSession":"Move to workspace","moveSession.noOtherWorkspaces":"No other workspaces available","moveSession.success":"Session successfully moved to \u201C{name}\u201D","archiveWorkspace.title":"Archive {n} conversations?","archiveWorkspace.desc":"This archives all conversations in \u201C{name}\u201D. You can find them later in Archived sessions.","archiveWorkspace.confirm":"Archive all","archiveWorkspace.pending":"Archiving conversations\u2026","date.ymd":"{y}-{m}-{d}"},Ta={...Xs,..._s,"locale.language":"ru","service.unavailable":"\u0421\u0435\u0440\u0432\u0438\u0441 \u0435\u0449\u0451 \u043D\u0435 \u0433\u043E\u0442\u043E\u0432. \u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435.","common.close":"\u0417\u0430\u043A\u0440\u044B\u0442\u044C","entry.location.title":"\u0420\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u043F\u0443\u043D\u043A\u0442\u0430","entry.location.desc":"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435, \u0433\u0434\u0435 \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0442\u044C \u043F\u0443\u043D\u043A\u0442 \u0432\u0445\u043E\u0434\u0430 (\u0445\u043E\u0442\u044F \u0431\u044B \u043E\u0434\u0438\u043D \u043E\u0441\u0442\u0430\u0435\u0442\u0441\u044F \u0430\u043A\u0442\u0438\u0432\u043D\u044B\u043C).","entry.location.both":"\u041E\u0431\u0430 \u043C\u0435\u0441\u0442\u0430","entry.location.sidebar":"\u0422\u043E\u043B\u044C\u043A\u043E \u0431\u043E\u043A\u043E\u0432\u0430\u044F \u043F\u0430\u043D\u0435\u043B\u044C","entry.location.settings":"\u0422\u043E\u043B\u044C\u043A\u043E \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438","entry.location.saveFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0440\u0430\u0441\u043F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u043F\u0443\u043D\u043A\u0442\u0430. \u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0441\u0435\u0442\u044C \u0438\u043B\u0438 \u043F\u0435\u0440\u0435\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u0442\u0435 \u0445\u043E\u0441\u0442.","sidebar.favoriteStar.title":"\u0417\u0432\u0435\u0437\u0434\u0430 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0432 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","sidebar.favoriteStar.desc":"\u041E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0442\u044C \u0437\u0432\u0435\u0437\u0434\u0443 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0443 \u0441\u0442\u0440\u043E\u043A \u0441\u0435\u0441\u0441\u0438\u0439 \u0432 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438. \u041F\u0440\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0438 \u0437\u043D\u0430\u0447\u043E\u043A \u0441\u043A\u0440\u044B\u0432\u0430\u0435\u0442\u0441\u044F, \u0430 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u043C\u0435\u043D\u044E \u0438 \u0444\u0438\u043B\u044C\u0442\u0440\u0430\u0446\u0438\u044F \u043E\u0441\u0442\u0430\u044E\u0442\u0441\u044F \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u043C\u0438.","sidebar.favoriteStar.toggle":"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0437\u0432\u0435\u0437\u0434\u0443 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E \u0432 \u0431\u043E\u043A\u043E\u0432\u043E\u0439 \u043F\u0430\u043D\u0435\u043B\u0438","update.entry.title":"\u041E\u043D\u043B\u0430\u0439\u043D-\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","update.entry.desc":"\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044C \u043F\u0440\u043E\u0432\u0435\u0440\u043A\u0443 \u0438 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0443 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0439 \u043E\u043D\u043B\u0430\u0439\u043D. \u0421\u043A\u0440\u044B\u0432\u0430\u0435\u0442 \u043F\u0443\u043D\u043A\u0442 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u044F \u043F\u0440\u0438 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0438.","update.entry.toggle":"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u043E\u043D\u043B\u0430\u0439\u043D-\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","update.entry.locked":"\u041E\u043D\u043B\u0430\u0439\u043D-\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D\u043E \u043A\u043E\u043D\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u0445\u043E\u0441\u0442\u0430.","archives.moreActions":"\u0414\u043E\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044C\u043D\u043E","archives.archiveProject":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.archiveUngrouped":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.archiveProjectDesc":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 {n} \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439 \u0432 \xAB{name}\xBB, \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u0444\u0438\u043B\u044C\u0442\u0440\u0430 \u043F\u043E\u0438\u0441\u043A\u0430. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.archiveUngroupedDesc":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435 {n} \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439, \u043D\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043C\u043E \u043E\u0442 \u0442\u0435\u043A\u0443\u0449\u0435\u0433\u043E \u0444\u0438\u043B\u044C\u0442\u0440\u0430 \u043F\u043E\u0438\u0441\u043A\u0430. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.tab.archived":"\u0410\u0440\u0445\u0438\u0432","archives.tab.unarchived":"\u041D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435","archives.searchUnarchived":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C \u0447\u0430\u0442\u0430\u043C","archives.emptyUnarchived":"\u041D\u0435\u0442 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.archiveSelected":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archives.openSession":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","archives.archiveSelectedDesc":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0441\u0435\u0441\u0441\u0438\u0438, \u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0441\u043A\u0440\u044B\u0442\u044B\u0435 \u0442\u0435\u043A\u0443\u0449\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u043C. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archives.archiveSuccess":"\u0417\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043E \u0441\u0435\u0441\u0441\u0438\u0439: {n}.","archives.archiveBatchFailed":"\u041F\u0430\u043A\u0435\u0442\u043D\u0430\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u043D\u0435 \u0443\u0434\u0430\u043B\u0430\u0441\u044C: {detail}","archives.navigationUnavailable":"\u042D\u0442\u043E\u0442 \u0445\u043E\u0441\u0442 \u043D\u0435 \u043C\u043E\u0436\u0435\u0442 \u0434\u0435\u0440\u0436\u0430\u0442\u044C \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u0432 \u0430\u0440\u0445\u0438\u0432\u0435 \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438. \u0412\u043C\u0435\u0441\u0442\u043E \u044D\u0442\u043E\u0433\u043E \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \xAB\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u044C\xBB.","archives.sessionNotRetained":"\u0425\u043E\u0441\u0442 \u043D\u0435 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u043B \u0437\u0430\u043F\u0440\u043E\u0448\u0435\u043D\u043D\u044B\u0439 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u043C. \u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435 \u0438\u043B\u0438 \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0435 \u0435\u0433\u043E \u043F\u0435\u0440\u0435\u0434 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0435\u043C.","archives.restoreOpen":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u044C","archives.selectedCount":"\u0412\u044B\u0431\u0440\u0430\u043D\u043E: {n}","archives.selectionHiddenHint":"\u0412\u043A\u043B\u044E\u0447\u0430\u0435\u0442 {hidden}, \u0441\u043A\u0440\u044B\u0442\u044B\u0445 \u0442\u0435\u043A\u0443\u0449\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u043E\u043C; \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u043F\u0440\u0438\u043C\u0435\u043D\u044F\u044E\u0442\u0441\u044F \u0438 \u043A \u043D\u0438\u043C.","archives.clearSelectionShort":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C","archives.restore":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C","archives.archiveTitle":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C {n} \u0447\u0430\u0442\u043E\u0432?","archives.deleteSelectionShort":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C","archives.clearSelection":"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0432\u044B\u0431\u043E\u0440","group.ungrouped":"\u0411\u0435\u0437 \u0433\u0440\u0443\u043F\u043F\u044B","session.new":"\u041D\u043E\u0432\u0430\u044F \u0441\u0435\u0441\u0441\u0438\u044F","menu.deleteSession":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","archived.badge":"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439","archives.title":"\u0410\u0440\u0445\u0438\u0432 \u0441\u0435\u0441\u0441\u0438\u0439","archives.description":"\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C\u0438 \u0441\u0435\u0441\u0441\u0438\u044F\u043C\u0438 \u0438\u043B\u0438 \u0432\u044B\u0431\u043E\u0440 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0434\u043B\u044F \u043F\u0430\u043A\u0435\u0442\u043D\u043E\u0439 \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438.","archives.viewProject":"GitHub","archives.feedback":"\u041F\u0440\u043E\u0431\u043B\u0435\u043C\u044B","archives.empty":"\u041D\u0435\u0442 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.emptyFiltered":"\u041D\u0438 \u043E\u0434\u0438\u043D \u0447\u0430\u0442 \u043D\u0435 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u0430\u0448\u0438\u043C \u0444\u0438\u043B\u044C\u0442\u0440\u0430\u043C.","archives.searchPlaceholder":"\u041F\u043E\u0438\u0441\u043A \u043F\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u043C \u0447\u0430\u0442\u0430\u043C","archives.sortLabel":"\u0421\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0430","archives.viewOptions":"\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u0432\u0438\u0434\u0430","archives.sortArchived":"\u041D\u0435\u0434\u0430\u0432\u043D\u043E \u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435","archives.sortUpdated":"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0435 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435","archives.sortCreated":"\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F","archives.sortAlphabetical":"\u041F\u043E \u0430\u043B\u0444\u0430\u0432\u0438\u0442\u0443","archives.projectFilter":"\u0424\u0438\u043B\u044C\u0442\u0440 \u043F\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0443","archives.allProjects":"\u0412\u0441\u0435 \u043F\u0440\u043E\u0435\u043A\u0442\u044B","discovery.timeRange":"\u041F\u0435\u0440\u0438\u043E\u0434","organizer.allChats":"\u0412\u0441\u0435 \u0447\u0430\u0442\u044B","archives.sessionCount":"{n} \u0447\u0430\u0442\u043E\u0432","archives.selectAllFiltered":"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u044B","archives.selectSession":"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0447\u0430\u0442 {name}","archives.restoreSelected":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435","archives.deleteSelected":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435","archives.timestamp":"{date}, {time}","archives.restoreProject":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.restoreUngrouped":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0432\u0441\u0435","archives.deleteProject":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u044D\u0442\u043E\u0433\u043E \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.deleteUngrouped":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435","archives.projectActions":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438 \u0434\u043B\u044F \u043F\u0440\u043E\u0435\u043A\u0442\u0430 {name}","archives.ungroupedActions":"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0430\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u0438 \u0434\u043B\u044F \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432","archives.restoreSuccess":"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432: {n}.","archives.restoreBatchFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0432\u043E\u0441\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B: {detail}","archives.deleteSelectedTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteSelectedDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 {n} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B (\u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0435\u0449\u0451 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435) \u0438 \u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0438. \u0414\u0440\u0443\u0433\u0438\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteSelectedConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteProjectTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u0432 {name}","archives.deleteProjectDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 {n} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432 \u0432 {name}, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B \u0438 \u0437\u0430\u043F\u0438\u0441\u0438. \u041A\u0430\u0442\u0430\u043B\u043E\u0433 \u043F\u0440\u043E\u0435\u043A\u0442\u0430 \u0438 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteProjectConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u0447\u0430\u0442\u044B \u043F\u0440\u043E\u0435\u043A\u0442\u0430","archives.deleteUngroupedTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteUngroupedDesc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 {n} \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432, \u0438\u0445 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B \u0438 \u0437\u0430\u043F\u0438\u0441\u0438. \u0414\u0440\u0443\u0433\u0438\u0435 \u043F\u0440\u043E\u0435\u043A\u0442\u044B \u0438 \u043D\u0435\u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B \u043D\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u044E\u0442\u0441\u044F. \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","archives.deleteUngroupedConfirm":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u0441\u0435 \u043D\u0435\u0441\u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0435 \u0447\u0430\u0442\u044B","archives.deleteBatchPending":"\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432\u2026","archives.deleteSuccess":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432: {n}.","archives.deleteSuccessWithSkipped":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E {deleted} \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0445 \u0447\u0430\u0442\u043E\u0432 \u0438 \u043E\u0447\u0438\u0449\u0435\u043D\u043E {skipped} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430 \u0434\u043B\u044F \u043D\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.deleteSkipped":"\u041E\u0447\u0438\u0449\u0435\u043D\u043E {n} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430 \u0434\u043B\u044F \u043D\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0445 \u0441\u0435\u0441\u0441\u0438\u0439.","archives.deletePartial":"\u0423\u0434\u0430\u043B\u0435\u043D\u043E {deleted} \u0447\u0430\u0442\u043E\u0432 \u0438 \u043E\u0447\u0438\u0449\u0435\u043D\u043E {skipped} \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u0430\u0440\u0445\u0438\u0432\u0430; {failed} \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0443\u0434\u0430\u043B\u0438\u0442\u044C: {detail}","archives.unarchiveUnknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0435\u0451 \u043D\u0435\u043B\u044C\u0437\u044F \u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430.","archives.unarchiveFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430: {detail}","archives.archiveUnknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0435\u0451 \u043D\u0435\u043B\u044C\u0437\u044F \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C.","archives.archiveFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E: {detail}","archives.archiveActive":"\u042D\u0442\u043E\u0442 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440 \u0432\u0441\u0451 \u0435\u0449\u0451 \u0432\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u0442\u0441\u044F ({kinds}).","archiveActive.title":"\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archiveActive.desc":"\u0412 \xAB{name}\xBB \u0435\u0449\u0451 \u0438\u0434\u0451\u0442 \u0440\u0430\u0431\u043E\u0442\u0430: {kinds}. \u0410\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u0441\u043D\u0430\u0447\u0430\u043B\u0430 \u043E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442 \u0435\u0451.","archiveActive.confirm":"\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0438 \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C","archives.forkFailed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0432\u0435\u0442\u043A\u0443 \u0441\u0435\u0441\u0441\u0438\u0438: {detail}","deleteSession.title":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E","deleteSession.confirmTitle":"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E?","deleteSession.desc":"\u042D\u0442\u043E \u043E\u043A\u043E\u043D\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E \u0443\u0434\u0430\u043B\u0438\u0442 \u0441\u0435\u0441\u0441\u0438\u044E \xAB{name}\xBB, \u0435\u0451 \u0434\u043E\u0447\u0435\u0440\u043D\u0438\u0435 \u0430\u0433\u0435\u043D\u0442\u044B (\u0432\u043A\u043B\u044E\u0447\u0430\u044F \u0435\u0449\u0451 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435) \u0438 \u0432\u0441\u0435 \u0435\u0451 \u0437\u0430\u043F\u0438\u0441\u0438 (\u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440, \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043A\u0443, \u043A\u044D\u0448). \u042D\u0442\u043E \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043D\u0435\u043E\u0431\u0440\u0430\u0442\u0438\u043C\u043E.","deleteSession.pending":"\u0423\u0434\u0430\u043B\u0435\u043D\u0438\u0435 \u0441\u0435\u0441\u0441\u0438\u0438\u2026","deleteSession.unknown":"\u042D\u0442\u0430 \u0441\u0435\u0441\u0441\u0438\u044F \u0431\u043E\u043B\u044C\u0448\u0435 \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438\u043B\u0438 \u0443\u0436\u0435 \u0443\u0434\u0430\u043B\u0435\u043D\u0430.","deleteSession.failed":"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0443\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u0435\u0441\u0441\u0438\u044E: {detail}","menu.archiveWorkspace":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0440\u0430\u0431\u043E\u0447\u0443\u044E \u043E\u0431\u043B\u0430\u0441\u0442\u044C","menu.copyWorkspacePath":"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u0443\u0442\u044C \u043A \u043F\u0430\u043F\u043A\u0435","menu.openInExplorer":"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u043F\u0430\u043F\u043A\u0443","menu.moveSession":"\u041F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u0432 \u043F\u0440\u043E\u0435\u043A\u0442","moveSession.noOtherWorkspaces":"\u041D\u0435\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0445 \u043F\u0440\u043E\u0435\u043A\u0442\u043E\u0432","moveSession.success":"\u0421\u0435\u0441\u0441\u0438\u044F \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u043F\u0435\u0440\u0435\u043C\u0435\u0449\u0435\u043D\u0430 \u0432 \xAB{name}\xBB","archiveWorkspace.title":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C {n} \u0441\u0435\u0441\u0441\u0438\u0439?","archiveWorkspace.desc":"\u042D\u0442\u043E \u0437\u0430\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u0443\u0435\u0442 \u0441\u0435\u0441\u0441\u0438\u0438 \u0432 \xAB{name}\xBB. \u0418\u0445 \u043C\u043E\u0436\u043D\u043E \u043D\u0430\u0439\u0442\u0438 \u043F\u043E\u0437\u0436\u0435 \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \xAB\u0410\u0440\u0445\u0438\u0432\xBB.","archiveWorkspace.confirm":"\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435","archiveWorkspace.pending":"\u0410\u0440\u0445\u0438\u0432\u0430\u0446\u0438\u044F \u0441\u0435\u0441\u0441\u0438\u0439\u2026","date.ymd":"{y}-{m}-{d}"},Oe="archive-manager-workspace",Aa=["slots","sessions","workspaces","locale","remote","typert"];function dr(n){return{getSnapshot:n.getSnapshot.bind(n),subscribe:n.subscribe.bind(n)}}e(dr,"bindObservable");function es(n){return async a=>{if(typeof n?.unarchiveSession!="function")throw new Error("archive-manager: host unarchiveSession is unavailable");await n.unarchiveSession(a)}}e(es,"createUnarchiveSession");async function ur(n,a,o){let p=new Set(n.list?.getSnapshot?.()?.archivedSessionIds??[]),v=await rr(a,async k=>{try{await n.archiveSession(k)}catch(E){throw E!==null&&typeof E=="object"&&$n(E)!==void 0&&typeof ce(E).sessionId!="string"&&Object.assign(E,{sessionId:k}),E}return!0},{refresh:o}),f=[...n.list?.getSnapshot?.()?.archivedSessionIds??[]];return{archivedSessionIds:f,archivedSessionIdsAdded:f.filter(k=>!p.has(k)),failures:v.failures}}e(ur,"archiveSessionsViaOfficial");async function ts(n,a,o,p){let v=new Set(n.list?.getSnapshot?.()?.archivedSessionIds??[]),f=typeof p=="function"?p:M=>n.unarchiveSession?.(M),k=await rr(a,async M=>(await f(M),!0),{refresh:o}),E=[...n.list?.getSnapshot?.()?.archivedSessionIds??[]];return{archivedSessionIds:E,unarchivedSessionIds:[...v].filter(M=>!E.includes(M)),failures:k.failures}}e(ts,"unarchiveSessionsViaOfficial");let _a=220;function ns({triggerRect:n,viewport:a,itemCount:o,measuredHeight:p,measuredWidth:v}){let f=a.width,k=a.height,E=typeof v=="number"&&v>0?Math.min(280,Math.max(160,v)):_a,M=Math.max(200,k-24),H=Math.min(520,M),A=o===0?44:34*o+8,z=Math.min(H,Math.max(20,typeof p=="number"&&p>0?p:A)),O=n.right+2,u="right";O+E>f-10&&(O=Math.max(10,n.left-E-4),u="left");let ae=n.top-4;if(ae+z>k-10){let me=n.bottom+4-z;me>=10?ae=me:ae=Math.max(10,k-z-10)}ae<10&&(ae=10);let Ne=Math.min(H,Math.max(60,k-10-ae));return{top:ae,left:O,maxHeight:Ne,side:u}}e(ns,"computeSubmenuPosition");function rs(n,a,o){return{height:typeof a=="number"&&a>0?a:n.height,width:typeof o=="number"&&o>0?o:n.width}}e(rs,"mergeSubmenuMeasurement");function ss({surfaceRef:n,submenuId:a,pos:o,workspaces:p,moving:v,t:f,onSelect:k,onEnter:E,onLeave:M}){let H=h.MenuSurface,A=h.MenuItemButton;if(!C())return null;let z=p.length===0?(0,s.jsx)("div",{className:"dsham_moveSubmenuEmpty",children:f("moveSession.noOtherWorkspaces")}):p.map(O=>{let u=O.title||O.path||O.workspaceId,ae=(0,s.jsx)(h.IconFolderCloseMedium,{size:14,"aria-hidden":!0}),Ne=(0,s.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1,minWidth:0},children:u});return(0,s.jsx)(A,{icon:ae,disabled:v,onSelect:e(()=>k(O.workspaceId,u),"onSelect"),children:Ne},O.workspaceId)});return(0,s.jsx)(H,{ref:n,id:a,className:"dsham_moveSubmenu",role:"menu","aria-label":f("menu.moveSession"),"data-dsham-move-submenu":"true","data-dsham-side":o.side,onPointerDown:e(O=>{O.stopPropagation()},"onPointerDown"),onMouseDown:e(O=>{O.stopPropagation()},"onMouseDown"),onMouseEnter:E,onMouseLeave:M,style:{top:o.top,left:o.left,maxHeight:o.maxHeight},children:z})}e(ss,"MoveSubmenu");async function Ra(n){ja(n);let a=n.get("remote"),o=e(()=>{},"disposeRemote");return a!==void 0&&(o=await a.$mount(tn)),async()=>{await o()}}e(Ra,"apply");function ja(n){n.effect(()=>n.locale.register(Oe,{zh:Xr,en:Qr,ru:Ta}),"dsh-archive-manager: dictionaries");let a=e(()=>n.get("uiWorkspace"),"uiWorkspaceAt"),o={},p,v=e(d=>(p=Ls(d,n.sessions,n.workspaces,{onOpened:e(()=>n.get("layout")?.selectPanel(null),"onOpened"),beginNavigation:e(()=>n.get("layout")?.beginNavigation?.(),"beginNavigation")}),()=>p?.dispose()),"attachArchiveNavigation");n.effect(()=>v(a()),"archive-manager: explicit archived navigation");let f=e(d=>{if(p===void 0)throw new en("navigationUnavailable");return Fr.request(d),p.open(d)},"openConversation"),k=e(async d=>{n.get("layout")?.beginNavigation?.(),Fr.request(d)},"focusSessionWorkspace"),E=e(async(d,b)=>{let T=await n.sessions.search(d,b);if(!T.ok)throw new Error(T.error.message);return T.value},"searchSessions"),M=e(async()=>{if(typeof n.sessions.refresh!="function")return null;try{return await ae(),null}catch(d){return console.warn("archive-manager: restored archived sessions but session list refresh failed:",d),d instanceof Error?d.message:String(d)}},"refreshSessionList"),H=es(n.workspaces),A=e(async(d,...b)=>{let T=n.get("remote.workspaceRegistry");if(!T||typeof T[d]!="function")throw new Error(n.locale.bind(Oe)("service.unavailable"));let ve=await T[d].apply(T,b);if(!ve.ok)throw new Error(ve.error.message);return ve.value},"registryCall"),z=e(()=>A("diagnoseOrphanSubagents"),"diagnoseOrphanSubagents"),O=e(()=>A("diagnoseSessionCaches"),"diagnoseSessionCaches"),u=e(d=>A("rebuildSessionCaches",d),"rebuildSessionCaches"),ae=e(async()=>{if(typeof n.sessions.refresh!="function")throw new Error("Official session list refresh is unavailable");let d=await n.sessions.refresh(),b=n.sessions,T=b.manager;if(T?.listState==="error"&&T.listError)throw new Error(Be(T.listError));if(b.listState==="error"&&b.listError)throw new Error(Be(b.listError));let G=b.list?.getSnapshot?.();if(G?.state==="error"&&G.error)throw new Error(Be(G.error));if(d&&typeof d=="object"&&"ok"in d&&d.ok===!1)throw new Error(Be(d.error??"Session list refresh failed"))},"refreshCacheLists"),Ne=e((d={})=>A("cleanOrphanSubagents",d??{}),"cleanOrphanSubagents"),me=e(d=>A("searchArchivedContent",d),"searchArchivedContent"),yt=e(d=>A("searchSessionContent",d),"searchSessionContent"),ht=e(d=>A("previewArchivedSession",d),"previewArchivedSession"),lt=e(()=>A("favoriteSessions"),"favoriteSessions"),mn=e(d=>A("setSessionFavorite",d),"setSessionFavorite"),tt=Rr();tt.bind({favoriteSessions:lt,setSessionFavorite:mn});let $e,fn=_r(n,tt,()=>n.locale.bind(Oe),()=>$e?.isSidebarFavoriteStarEnabled()??!0);n.effect(()=>()=>fn.dispose(),"archive-manager: favorites only filter");let Et=Ks({workspaces:n.workspaces.list,sessions:n.sessions.list,archive:e(d=>n.workspaces.archiveSession(d),"archive"),restore:e(async d=>{await H(d)},"restore"),deleteOne:e(async d=>{let b=n.get("remote.workspaceRegistry");if(!b)throw new Error(n.locale.bind(Oe)("service.unavailable"));let T=await b.deleteSession(d);if(!T.ok)throw new Error(T.error.message)},"deleteOne"),getFavorites:lt,refresh:e(()=>n.sessions.refresh?.(),"refresh"),currentSessionId:nr}),jt=e(async d=>{await H(d),await M()},"unarchiveSession"),q=e(async d=>{let b=n.get("remote.workspaceRegistry");if(b===void 0)throw new Error("archive-manager remote service is unavailable");let T=await b.deleteSession(d);if(!T.ok)throw new Error(T.error.message);await M()},"deleteSession"),Le=e(async(d,b)=>{let T=n.get("remote.workspaceRegistry");if(T===void 0)throw new Error("archive-manager remote service is unavailable");let G=await T.moveSessionToWorkspace({sessionId:d,targetWorkspaceId:b});if(!G.ok)throw new Error(G.error?.message||"move failed");return await M(),G.value},"moveSession"),ee=e(async d=>ur(n.workspaces,d,M),"archiveSessions"),K=e(async d=>{let b=n.workspaces.list?.getSnapshot?.()??{archivedSessionIds:[],items:[]},T=En(b.archivedSessionIds,b.items,d);return ts(n.workspaces,T,M,H)},"unarchiveSessions"),He=e(async d=>{let b=n.get("remote.workspaceRegistry");if(b===void 0)throw new Error("archive-manager remote service is unavailable");let T=await b.deleteArchivedSessions(d);if(!T.ok)throw new Error(T.error.message);let G=await M();return{...T.value,refreshError:G}},"deleteArchivedSessions"),nt=e(async()=>{let d=n.get("remote.workspaceRegistry");if(d===void 0)throw new Error("archive-manager remote service is unavailable");let b=await d.archivedSessionMetadata();if(!b.ok)throw new Error(b.error.message);return b.value},"archivedSessionMetadata"),L="sidebar.workspaces.session.menu.item",Me=null,Te=new Set,We=e(d=>{Me=d;for(let b of Te)b()},"publishDeleteTarget");function pt(){return l.useSyncExternalStore(d=>(Te.add(d),()=>{Te.delete(d)}),()=>Me,()=>Me)}e(pt,"useDeleteRequest");let qe=!1,zt=e(()=>m(d=>{try{return n.get?.(d)??n[d]}catch{return}}),"hasNativeContextMenus"),gn=e(()=>qe&&zt(),"shouldSlotYieldToNative");function Zn({sessionId:d,displayTitle:b,useMenuOpenState:T,t:G}){if(gn())return null;let[,ve]=T(),V=h.MenuItemButton,be=(0,s.jsx)(h.IconTrashOutlineRegular,{size:14}),Re=e(()=>{ve(!1),We({sessionId:d,title:b})},"onSelect");return typeof V=="function"?(0,s.jsx)(V,{danger:!0,icon:be,onSelect:Re,children:G("menu.deleteSession")}):(0,s.jsx)("button",{type:"button",role:"menuitem",onClick:Re,children:G("menu.deleteSession")})}e(Zn,"DeleteSessionMenuItem");function Pt({sessionId:d,favoriteRow:b,useMenuOpenState:T,t:G}){if(gn())return null;let[,ve]=T(),V=(0,l.useSyncExternalStore)(b.subscribe,b.getSnapshot),be=V.ready&&V.ids.has(d),Re=e(()=>{ve(!1),b.toggle(d)},"onSelect"),de=h.MenuItemButton,ue=(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:16,height:16,fill:be?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round","aria-hidden":!0,children:(0,s.jsx)("path",{d:qt})}),Ae=G(be?"organizer.unfavorite":"organizer.favorite");return typeof de=="function"?(0,s.jsx)(de,{icon:ue,onSelect:Re,children:Ae}):(0,s.jsx)("button",{type:"button",role:"menuitem",onClick:Re,children:Ae})}e(Pt,"FavoriteMenuItem");let Se=null,Nt=new Set;function vn(d,b="success"){Se={text:d,tone:b,seq:Date.now()};for(let T of Nt)T()}e(vn,"showToast");function X(){let d=l.useSyncExternalStore(T=>(Nt.add(T),()=>{Nt.delete(T)}),()=>Se,()=>Se);if(!d)return null;let b=h.Toast;return typeof b=="function"?(0,s.jsx)(b,{key:d.seq,text:d.text,tone:d.tone,holdMs:3e3,onDone:e(()=>{if(Se?.seq===d.seq){Se=null;for(let T of Nt)T()}},"onDone")}):(0,s.jsx)("div",{key:d.seq,style:{position:"fixed",top:16,left:"50%",transform:"translateX(-50%)",zIndex:99999,padding:"8px 16px",borderRadius:8,background:d.tone==="danger"?"#7f1d1d":"#14532d",color:"#fff",fontSize:13,boxShadow:"0 4px 16px rgba(0,0,0,0.4)"},children:d.text})}e(X,"GlobalToastOverlay");function Xe({sessionId:d,displayTitle:b,useMenuOpenState:T,t:G}){let[,ve]=T(),V=l.useId(),[be,Re]=l.useState(!1),[de,ue]=l.useState(null),[Ae,je]=l.useState(!1),rt=l.useRef(null),Y=l.useRef(null),te=l.useRef(null),R=l.useRef({}),re=y(n.workspaces.list?.getSnapshot?.()?.items??[],d),_e=h.MenuItemButton;l.useEffect(()=>{let xe=rt.current?.querySelector(':scope > div > button[role="menuitem"], :scope > button[role="menuitem"]');xe&&(xe.setAttribute("aria-haspopup","menu"),xe.setAttribute("aria-expanded",be?"true":"false"),be?xe.setAttribute("aria-controls",V):xe.removeAttribute("aria-controls"))},[be,V]);let ie=e((xe,Ke)=>{if(!rt.current)return;R.current=rs(R.current,xe,Ke);let Qe=rt.current.getBoundingClientRect(),oe=typeof window<"u"?window.innerWidth:1024,At=typeof window<"u"?window.innerHeight:768,st=ns({triggerRect:Qe,viewport:{width:oe,height:At},itemCount:re.length,measuredHeight:R.current.height,measuredWidth:R.current.width});ue(ct=>ct&&ct.top===st.top&&ct.left===st.left&&ct.maxHeight===st.maxHeight&&ct.side===st.side?ct:st)},"updatePosition"),De=e(()=>{te.current&&clearTimeout(te.current),ie(),Re(!0)},"handleMouseEnter");l.useLayoutEffect(()=>{if(!be||!Y.current)return;let xe=Y.current;xe.offsetHeight>0&&ie(xe.offsetHeight,xe.offsetWidth)},[be,re.length]),l.useEffect(()=>{if(!be||typeof window>"u")return;let xe=e(()=>ie(),"reposition");return window.addEventListener("resize",xe),window.addEventListener("scroll",xe,!0),()=>{window.removeEventListener("resize",xe),window.removeEventListener("scroll",xe,!0)}},[be,re.length]),l.useEffect(()=>()=>{te.current&&clearTimeout(te.current)},[]);let ye=e(()=>{te.current=setTimeout(()=>{Re(!1)},180)},"handleMouseLeave"),Ee=e(async(xe,Ke)=>{if(!Ae){je(!0),Re(!1),ve(!1);try{await Le(d,xe),vn(G("moveSession.success",{name:Ke})||`\u4F1A\u8BDD\u5DF2\u6210\u529F\u79FB\u52A8\u5230\u201C${Ke}\u201D`,"success")}catch(Qe){let oe=Qe instanceof Error?Qe.message:String(Qe);console.warn("archive-manager: move session failed",Qe),vn(oe,"danger")}finally{je(!1)}}},"handleSelectWorkspace"),Tt=(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:14,height:14,fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,s.jsx)("path",{d:"M2 3.5C2 2.67157 2.67157 2 3.5 2H6.5L8 4H12.5C13.3284 4 14 4.67157 14 5.5V12.5C14 13.3284 13.3284 14 12.5 14H3.5C2.67157 14 2 13.3284 2 12.5V3.5Z"}),(0,s.jsx)("path",{d:"M8 7.5L10.5 10L8 12.5"}),(0,s.jsx)("path",{d:"M5.5 10H10.5"})]}),we=(0,s.jsx)("svg",{viewBox:"0 0 16 16",width:12,height:12,fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,style:{marginLeft:"auto",opacity:.65},children:(0,s.jsx)("path",{d:"M6 3.5L10.5 8L6 12.5"})}),Pe=(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",gap:8},children:[(0,s.jsx)("span",{children:G("menu.moveSession")}),we]});if(!C())return null;let Ge=(0,s.jsx)(_e,{icon:Tt,onSelect:e(()=>De(),"onSelect"),children:Pe});return(0,s.jsxs)("div",{ref:rt,className:"dsham_moveSessionWrap",onMouseEnter:De,onMouseLeave:ye,children:[Ge,be&&de&&(0,s.jsx)(ss,{surfaceRef:Y,submenuId:V,pos:de,workspaces:re,moving:Ae,t:G,onSelect:e((xe,Ke)=>{Ee(xe,Ke)},"onSelect"),onEnter:De,onLeave:ye})]})}e(Xe,"MoveSessionMenuItem");function Ot(d){try{let b=document.querySelector(`[data-row-key="session:${CSS.escape(d)}"]`);return b?(b.hasAttribute("tabindex")||(b.setAttribute("tabindex","-1"),b.addEventListener("blur",()=>b.removeAttribute("tabindex"),{once:!0})),typeof h.focusWithoutRing=="function"?h.focusWithoutRing(b):b.focus(),!0):!1}catch{return!1}}e(Ot,"focusSessionRow");function Q({t:d}){let b=pt(),[T,G]=(0,l.useState)(!1),[ve,V]=(0,l.useState)(null),[be,Re]=(0,l.useState)(null),de=(0,l.useRef)(null),ue=(0,l.useRef)(null),Ae=(0,l.useRef)(null);if((0,l.useLayoutEffect)(()=>{if(b===null||typeof document>"u"){Re(null);return}let Y=null,te=e(()=>{if(Y&&Y.isConnected)return Y;try{Y=document.querySelector(`[data-row-key="session:${CSS.escape(b.sessionId)}"]`)}catch{Y=null}return Y},"getTargetRow"),R=e(()=>{let _e=de.current,ie=_e?.offsetWidth||290,De=_e?.offsetHeight||160,ye=8,Ee=te();if(!Ee){let Ge=window.innerWidth,xe=window.innerHeight,Ke=Math.max(16,(xe-De)/2),Qe=Math.max(16,(Ge-ie)/2);Re(oe=>oe!==null&&oe.top===Ke&&oe.left===Qe?oe:{top:Ke,left:Qe});return}let Tt=Ee.getBoundingClientRect(),we=Tt.top-4;we+De>window.innerHeight-16&&(we=window.innerHeight-16-De),we<16&&(we=16);let Pe=Tt.right+ye;Pe+ie>window.innerWidth-16&&(Pe=Tt.left-ie-ye),Pe<16&&(Pe=16),Re(Ge=>Ge!==null&&Ge.top===we&&Ge.left===Pe?Ge:{top:we,left:Pe})},"updatePosition");R(),window.addEventListener("scroll",R,!0),window.addEventListener("resize",R);let re=null;return typeof ResizeObserver<"u"&&de.current&&(re=new ResizeObserver(R),re.observe(de.current)),()=>{re?.disconnect(),window.removeEventListener("scroll",R,!0),window.removeEventListener("resize",R)}},[b]),(0,l.useEffect)(()=>{if(b===null)return;ue.current&&!ue.current.disabled?ue.current.focus():de.current?.focus();let Y=b.sessionId;return()=>{if(!Ot(Y)){let R=document.querySelector('[role="treeitem"][aria-selected="true"]');R&&(R.hasAttribute("tabindex")||(R.setAttribute("tabindex","-1"),R.addEventListener("blur",()=>R.removeAttribute("tabindex"),{once:!0})),typeof h.focusWithoutRing=="function"?h.focusWithoutRing(R):R.focus())}}},[b]),(0,l.useEffect)(()=>{b!==null&&T&&de.current?.focus()},[b,T]),(0,l.useEffect)(()=>{if(b===null)return;let Y=e(te=>{if(te.key==="Escape"){te.preventDefault(),te.stopPropagation(),"stopImmediatePropagation"in te&&typeof te.stopImmediatePropagation=="function"&&te.stopImmediatePropagation(),T||(V(null),We(null));return}if(te.key==="Tab"){if(te.preventDefault(),T){de.current?.focus();return}let R=ue.current,re=Ae.current;if(!R||!re)return;te.shiftKey?document.activeElement===R?re.focus():R.focus():document.activeElement===re?R.focus():re.focus()}},"onKey");return window.addEventListener("keydown",Y,!0),()=>window.removeEventListener("keydown",Y,!0)},[b,T]),b===null)return null;let je=e(()=>{T||(V(null),We(null))},"close"),rt=e(()=>{G(!0),V(null),q(b.sessionId).then(()=>{G(!1),We(null)}).catch(Y=>{G(!1),V(sr(Y,d))})},"confirm");return(0,s.jsxs)("div",{className:"dsham_sidebarCardRoot",children:[(0,s.jsx)("div",{className:"dsham_sidebarCardBackdrop",onClick:je}),(0,s.jsxs)("div",{ref:de,role:"dialog","aria-modal":!0,"aria-label":d("deleteSession.title"),tabIndex:-1,className:"dsham_sidebarCard",style:be?{top:be.top,left:be.left,visibility:"visible"}:{visibility:"hidden",top:0,left:0},children:[(0,s.jsx)("h3",{className:"dsham_sidebarCardTitle",children:d("deleteSession.confirmTitle")}),(0,s.jsx)("p",{className:"dsham_sidebarCardDesc",children:d("deleteSession.desc",{name:b.title})}),T&&(0,s.jsx)("div",{className:"dsham_sidebarCardDesc",role:"status",children:d("deleteSession.pending")}),ve!==null&&(0,s.jsx)("div",{className:"dsham_sidebarCardError",role:"alert",children:ve}),(0,s.jsxs)("div",{className:"dsham_sidebarCardFooter",children:[(0,s.jsx)("button",{ref:ue,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnCancel",disabled:T,onClick:je,children:d("cancel")}),(0,s.jsx)("button",{ref:Ae,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnDanger",disabled:T,onClick:rt,children:d("deleteSession.title")})]})]})]})}e(Q,"DeleteSessionOverlay");let bn=null,Fe=new Set,Ft=e(d=>{bn=d;for(let b of Fe)b()},"publishArchiveWsTarget");function Ht(){return l.useSyncExternalStore(d=>(Fe.add(d),()=>{Fe.delete(d)}),()=>bn,()=>bn)}e(Ht,"useArchiveWsRequest");function In(d){try{let b=document.querySelector(`[data-row-key="workspace:${CSS.escape(d)}"]`);return b?(b.hasAttribute("tabindex")||(b.setAttribute("tabindex","-1"),b.addEventListener("blur",()=>b.removeAttribute("tabindex"),{once:!0})),typeof h.focusWithoutRing=="function"?h.focusWithoutRing(b):b.focus(),!0):!1}catch{return!1}}e(In,"focusWorkspaceRow");function wt({t:d}){let b=Ht(),[T,G]=(0,l.useState)(!1),[ve,V]=(0,l.useState)(null),[be,Re]=(0,l.useState)(null),de=(0,l.useRef)(null),ue=(0,l.useRef)(null),Ae=(0,l.useRef)(null);if((0,l.useLayoutEffect)(()=>{if(b===null||typeof document>"u"){Re(null);return}let Y=null,te=e(()=>{if(Y&&Y.isConnected)return Y;try{Y=document.querySelector(`[data-row-key="workspace:${CSS.escape(b.workspaceId)}"]`)}catch{Y=null}return Y},"getTargetRow"),R=e(()=>{let _e=de.current,ie=_e?.offsetWidth||290,De=_e?.offsetHeight||160,ye=8,Ee=te();if(!Ee){let Ge=window.innerWidth,xe=window.innerHeight,Ke=Math.max(16,(xe-De)/2),Qe=Math.max(16,(Ge-ie)/2);Re(oe=>oe!==null&&oe.top===Ke&&oe.left===Qe?oe:{top:Ke,left:Qe});return}let Tt=Ee.getBoundingClientRect(),we=Tt.top-4;we+De>window.innerHeight-16&&(we=window.innerHeight-16-De),we<16&&(we=16);let Pe=Tt.right+ye;Pe+ie>window.innerWidth-16&&(Pe=Tt.left-ie-ye),Pe<16&&(Pe=16),Re(Ge=>Ge!==null&&Ge.top===we&&Ge.left===Pe?Ge:{top:we,left:Pe})},"updatePosition");R(),window.addEventListener("scroll",R,!0),window.addEventListener("resize",R);let re=null;return typeof ResizeObserver<"u"&&de.current&&(re=new ResizeObserver(R),re.observe(de.current)),()=>{re?.disconnect(),window.removeEventListener("scroll",R,!0),window.removeEventListener("resize",R)}},[b]),(0,l.useEffect)(()=>{if(b===null)return;ue.current&&!ue.current.disabled?ue.current.focus():de.current?.focus();let Y=b.workspaceId;return()=>{In(Y)}},[b]),(0,l.useEffect)(()=>{b!==null&&T&&de.current?.focus()},[b,T]),(0,l.useEffect)(()=>{if(b===null)return;let Y=e(te=>{if(te.key==="Escape"){te.preventDefault(),te.stopPropagation(),"stopImmediatePropagation"in te&&typeof te.stopImmediatePropagation=="function"&&te.stopImmediatePropagation(),T||(V(null),Ft(null));return}if(te.key==="Tab"){if(te.preventDefault(),T){de.current?.focus();return}let R=ue.current,re=Ae.current;if(!R||!re)return;te.shiftKey?document.activeElement===R?re.focus():R.focus():document.activeElement===re?R.focus():re.focus()}},"onKey");return window.addEventListener("keydown",Y,!0),()=>window.removeEventListener("keydown",Y,!0)},[b,T]),b===null)return null;let je=e(()=>{T||(V(null),Ft(null))},"close"),rt=e(()=>{G(!0),V(null);let te=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(ie=>ie.workspaceId===b.workspaceId),R=n.sessions.list?.getSnapshot?.()?.byId??{},re=new Set(n.workspaces.list?.getSnapshot?.()?.archivedSessionIds??[]),_e=(te?.sessionIds??[]).filter(ie=>Gn(ie,R,re));ur(n.workspaces,_e,M).then(ie=>{if(G(!1),ie.failures.length>0){V(Vn(ie.failures,d));return}Ft(null)}).catch(ie=>{G(!1),V(Mr(ie,d))})},"confirm");return(0,s.jsxs)("div",{className:"dsham_sidebarCardRoot",children:[(0,s.jsx)("div",{className:"dsham_sidebarCardBackdrop",onClick:je}),(0,s.jsxs)("div",{ref:de,role:"dialog","aria-modal":!0,"aria-label":d("menu.archiveWorkspace"),tabIndex:-1,className:"dsham_sidebarCard",style:be?{top:be.top,left:be.left,visibility:"visible"}:{visibility:"hidden",top:0,left:0},children:[(0,s.jsx)("h3",{className:"dsham_sidebarCardTitle",children:d("archiveWorkspace.title",{n:b.count})}),(0,s.jsx)("p",{className:"dsham_sidebarCardDesc",children:d("archiveWorkspace.desc",{name:b.title})}),T&&(0,s.jsx)("div",{className:"dsham_sidebarCardDesc",role:"status",children:d("archiveWorkspace.pending")}),ve!==null&&(0,s.jsx)("div",{className:"dsham_sidebarCardError",role:"alert",children:ve}),(0,s.jsxs)("div",{className:"dsham_sidebarCardFooter",children:[(0,s.jsx)("button",{ref:ue,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnCancel",disabled:T,onClick:je,children:d("cancel")}),(0,s.jsx)("button",{ref:Ae,type:"button",className:"dsham_sidebarCardBtn dsham_sidebarCardBtnDanger",disabled:T,onClick:rt,children:d("archiveWorkspace.confirm")})]})]})]})}e(wt,"ArchiveWorkspaceOverlay");function Zt(d){if(typeof document>"u"||typeof document.addEventListener!="function"||typeof MutationObserver>"u")return()=>{};let b=null,T=!1,G=new Map,ve=!1,V=e(R=>{let _e=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(ye=>ye.workspaceId===R);if(_e===void 0)return[];let ie=n.sessions.list?.getSnapshot?.()?.byId??{},De=new Set(n.workspaces.list?.getSnapshot?.()?.archivedSessionIds??[]);return _e.sessionIds.filter(ye=>Gn(ye,ie,De))},"workspaceCandidateIds"),be=e(()=>{if(ve=!1,!T)for(let[R,re]of G){if(!R.isConnected){G.delete(R);continue}let _e=V(re.workspaceId).length===0;R.disabled=_e,R.style.opacity=_e?"0.5":"",R.style.cursor=_e?"not-allowed":""}},"revalidateItems"),Re=e(()=>{if(G.size===0||ve||T)return;ve=!0;let R=e(()=>be(),"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(R):setTimeout(R,16)},"scheduleRevalidate"),de=e(R=>{b=zr(R.target)},"rememberWorkspace");document.addEventListener("pointerdown",de,!0),document.addEventListener("click",de,!0);let ue=e(()=>{if(T)return;for(let[re]of G)re.isConnected||G.delete(re);let R=document.querySelectorAll('[role="menu"]');for(let re of R){if(re.querySelector('[data-dsham-archive-workspace="true"]'))continue;let _e=Array.from(re.querySelectorAll('button[role="menuitem"]'));if(_e.length===0)continue;let ie=_e.find(et=>ir(et,!1))??_e.find(et=>ir(et,!0));if(!ie)continue;let De=_e.find(et=>et!==ie)??ie,ye=ie.parentElement;if(!ye)continue;let Ee=b;if(!Ee)continue;let we=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(et=>et.workspaceId===Ee.workspaceId),Pe=we?.path??we?.cwd,xe=V(Ee.workspaceId).length,Ke=document.createElement("div");Ke.className=ye.className;let Qe=De.className.split(/\s+/).filter(et=>!/(?:^|[_-])danger(?:$|[_-])/i.test(et)).join(" "),oe=document.createElement("button");oe.type="button",oe.setAttribute("role","menuitem"),oe.dataset.dshamArchiveWorkspace="true",oe.className=Qe;let At=De.querySelector("span"),st=De.querySelectorAll("span")[1],ct=document.createElement("span");ct.setAttribute("aria-hidden","true"),At?.className&&(ct.className=At.className),ct.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 _t=document.createElement("span");if(st?.className&&(_t.className=st.className),_t.textContent=d("menu.archiveWorkspace"),oe.append(ct,_t),Ke.append(oe),xe===0&&(oe.disabled=!0,oe.style.opacity="0.5",oe.style.cursor="not-allowed"),oe.addEventListener("click",et=>{et.preventDefault(),et.stopPropagation();let dt=V(Ee.workspaceId).length;dt!==0&&(document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),Ft({workspaceId:Ee.workspaceId,title:Ee.title,count:dt}))}),Pe){let et=document.createElement("div");et.className=ye.className;let dt=document.createElement("button");dt.type="button",dt.setAttribute("role","menuitem"),dt.dataset.dshamCopyWorkspacePath="true",dt.className=Qe,dt.disabled=!1,dt.style.opacity="",dt.style.cursor="";let wn=document.createElement("span");wn.setAttribute("aria-hidden","true"),At?.className&&(wn.className=At.className),wn.innerHTML='<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><rect x="5.5" y="5.5" width="8" height="8" rx="1.5"/><path d="M10.5 3.5V2.5C10.5 1.94772 10.0523 1.5 9.5 1.5H3.5C2.94772 1.5 2.5 1.94772 2.5 2.5V8.5C2.5 9.05228 2.94772 9.5 3.5 9.5H4.5"/></svg>';let Dn=document.createElement("span");st?.className&&(Dn.className=st.className),Dn.textContent=d("menu.copyWorkspacePath"),dt.append(wn,Dn),et.append(dt),dt.addEventListener("click",Dt=>{Dt.preventDefault(),Dt.stopPropagation(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),tr(Pe).catch(()=>{})});let ln=document.createElement("div");ln.className=ye.className;let Ct=document.createElement("button");Ct.type="button",Ct.setAttribute("role","menuitem"),Ct.dataset.dshamOpenExplorer="true",Ct.className=Qe,Ct.disabled=!1,Ct.style.opacity="",Ct.style.cursor="";let cn=document.createElement("span");cn.setAttribute("aria-hidden","true"),At?.className&&(cn.className=At.className),cn.innerHTML='<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M1.5 3.5C1.5 2.94772 1.94772 2.5 2.5 2.5H6.5L8 4.5H13.5C14.0523 4.5 14.5 4.94772 14.5 5.5V12.5C14.5 13.0523 14.0523 13.5 13.5 13.5H2.5C1.94772 13.5 1.5 13.0523 1.5 12.5V3.5Z"/><path d="M10 8.5L12 10.5L10 12.5"/><path d="M6.5 10.5H12"/></svg>';let dn=document.createElement("span");st?.className&&(dn.className=st.className),dn.textContent=d("menu.openInExplorer"),Ct.append(cn,dn),ln.append(Ct),Ct.addEventListener("click",Dt=>{Dt.preventDefault(),Dt.stopPropagation(),document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape",bubbles:!0,cancelable:!0})),(async()=>{try{let Qt=await fetch(xn("/open-in-app/open"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({app:"explorer",path:Pe})}).catch(()=>null);if(Qt&&Qt.ok)return}catch{}try{await sn("/open-in-explorer",{method:"POST",body:JSON.stringify({path:Pe,workspaceId:Ee.workspaceId})})}catch(Qt){console.warn("archive-manager: open in explorer failed",Qt)}})()}),ye.parentNode?.insertBefore(et,ye),ye.parentNode?.insertBefore(ln,ye)}ye.parentNode?.insertBefore(Ke,ye),G.set(oe,{workspaceId:Ee.workspaceId})}},"checkAndInject"),Ae=!1,je=e(()=>{if(Ae||T)return;Ae=!0;let R=e(()=>{Ae=!1,!T&&ue()},"run");typeof requestAnimationFrame=="function"?requestAnimationFrame(R):setTimeout(R,16)},"scheduleInject"),rt=new MutationObserver(R=>{Kn(R,'[role="menu"]')&&je()});rt.observe(document.body,{childList:!0,subtree:!0});let Y=n.sessions.list?.subscribe?.(Re),te=n.workspaces.list?.subscribe?.(Re);return()=>{T=!0,document.removeEventListener("pointerdown",de,!0),document.removeEventListener("click",de,!0),rt.disconnect(),Y?.(),te?.(),G.clear();for(let R of document.querySelectorAll('[data-dsham-archive-workspace="true"], [data-dsham-copy-workspace-path="true"], [data-dsham-open-explorer="true"]'))R.parentElement?.remove()}}e(Zt,"setupWorkspaceMenuInjector");function $t(){if(typeof n.slots.entries!="function")return!1;if(n.slots.entries("sidebar.workspaces").some(T=>T.children?.[L]!==void 0)||n.slots.entries("contextMenu.content").some(T=>T.children?.[L]!==void 0))return!0;try{if(n.get("contextMenus")!==void 0&&n.slots.entries("contextMenu.content").length>0)return!0}catch{}return!1}e($t,"hostSidebarDeclaresSessionMenu");let Tn,An,_n,Jt,Rn,Mt,It,St=e(()=>{let d=$t()?"menu":"waiting";d!==Tn&&(Tn=d,d==="menu"&&(An??=n.slots.inject(L,()=>n.slots.register({name:L,id:"archive-manager.delete-session",order:9999,locale:Oe,inject:e(()=>({}),"inject")},Zn)),_n??=n.slots.inject(L,()=>n.slots.register({name:L,id:"archive-manager.favorite",order:1,locale:Oe,inject:e(()=>({favoriteRow:tt}),"inject")},Pt)),C()&&(Jt??=n.slots.inject(L,()=>n.slots.register({name:L,id:"archive-manager.move-session",order:480,locale:Oe,inject:e(()=>({}),"inject")},Xe))),Rn??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.delete-session",locale:Oe,inject:e(()=>({t:n.locale.bind(Oe)}),"inject")},Q)),Mt??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.archive-workspace",locale:Oe,inject:e(()=>({t:n.locale.bind(Oe)}),"inject")},wt)),It??=n.slots.inject("shell.overlay",()=>n.slots.register({name:"shell.overlay",id:"archive-manager.toast",locale:Oe,inject:e(()=>({}),"inject")},X))))},"reconcileSidebar");St();let xt,kt,mt,Bt=e(()=>{try{return typeof n.locale?.bind=="function"?n.locale.bind(Oe):d=>d}catch{return d=>d}},"getTranslator");function jn(d){let b,T,G,ve,V,be,Re,de=e(()=>{qe=!1;try{V?.()}catch{}try{be?.()}catch{}try{Re?.()}catch{}try{b?.()}catch{}try{T?.()}catch{}try{G?.()}catch{}try{ve?.()}catch{}},"cleanup");try{try{b=n.slots.register({name:"contextMenu.icon",key:"archive-manager.explorer"},()=>(0,s.jsx)("svg",{width:14,height:14,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"M1.5 3.5C1.5 2.94772 1.94772 2.5 2.5 2.5H6.5L8 4.5H13.5C14.0523 4.5 14.5 4.94772 14.5 5.5V12.5C14.5 13.0523 14.0523 13.5 13.5 13.5H2.5C1.94772 13.5 1.5 13.0523 1.5 12.5V3.5Z"}),(0,s.jsx)("path",{d:"M10 8.5L12 10.5L10 12.5"}),(0,s.jsx)("path",{d:"M6.5 10.5H12"})]})),T=n.slots.register({name:"contextMenu.icon",key:"archive-manager.star-fill"},()=>(0,s.jsx)("svg",{width:14,height:14,viewBox:"0 0 16 16",fill:"#e8b931",stroke:"#e8b931",strokeWidth:1.2,strokeLinejoin:"round",children:(0,s.jsx)("path",{d:qt})})),G=n.slots.register({name:"contextMenu.icon",key:"archive-manager.star-outline"},()=>(0,s.jsx)("svg",{width:14,height:14,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round",children:(0,s.jsx)("path",{d:qt})})),ve=n.slots.register({name:"contextMenu.icon",key:"archive-manager.workspace-archive"},()=>(0,s.jsx)("svg",{"data-dsham-archive-icon":"true",width:14,height:14,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"M13.5 2.5H2.5C1.94772 2.5 1.5 2.94772 1.5 3.5V4.5C1.5 5.05228 1.94772 5.5 2.5 5.5H13.5C14.0523 5.5 14.5 5.05228 14.5 4.5V3.5C14.5 2.94772 14.0523 2.5 13.5 2.5Z"}),(0,s.jsx)("path",{d:"M2.5 5.5V13.5C2.5 13.7652 2.60536 14.0196 2.79289 14.2071C2.98043 14.3946 3.23478 14.5 3.5 14.5H12.5C12.7652 14.5 13.0196 14.3946 13.2071 14.2071C13.3946 14.0196 13.5 13.7652 13.5 13.5V5.5"}),(0,s.jsx)("path",{d:"M6.5 9.5H9.5"})]}))}catch{}return V=d.register({id:"archive-manager.session-favorite",target:"session",order:1,observe:e(()=>[tt,n.locale],"observe"),resolve:e(({sessionId:ue})=>{let Ae=tt.getSnapshot(),je=Ae.ready&&Ae.ids.has(ue);return[{id:"favorite",label:Bt()(je?"organizer.unfavorite":"organizer.favorite"),icon:{key:je?"archive-manager.star-fill":"archive-manager.star-outline"},run:e(()=>{tt.toggle(ue)},"run")}]},"resolve")}),be=d.register({id:"archive-manager.session-delete",target:"session",order:9999,observe:e(()=>[n.locale],"observe"),resolve:e(({sessionId:ue,displayTitle:Ae})=>[{id:"delete-session",label:Bt()("menu.deleteSession"),icon:{key:"workspace.delete"},danger:!0,afterContent:!0,run:e(()=>{We({sessionId:ue,title:Ae||ue})},"run")}],"resolve")}),Re=d.register({id:"archive-manager.workspace-actions",target:"workspace",order:250,observe:e(()=>[n.workspaces.list,n.sessions.list,n.locale],"observe"),resolve:e(({workspaceId:ue,path:Ae,displayTitle:je})=>{let Y=(n.workspaces.list?.getSnapshot?.()?.items??[]).find(Ee=>Ee.workspaceId===ue),te=n.sessions.list?.getSnapshot?.()?.byId??{},R=new Set(n.workspaces.list?.getSnapshot?.()?.archivedSessionIds??[]),_e=(Y?Y.sessionIds.filter(Ee=>Gn(Ee,te,R)):[]).length,ie=Bt(),De=Ae??Y?.path??Y?.cwd,ye=[];return De&&(ye.push({id:"copy-workspace-path",label:ie("menu.copyWorkspacePath"),icon:{key:"workspace.copy"},run:e(()=>{tr(De).catch(()=>{})},"run")}),ye.push({id:"open-in-explorer",label:ie("menu.openInExplorer"),icon:{key:"archive-manager.explorer"},run:e(()=>{(async()=>{try{let Ee=await fetch(xn("/open-in-app/open"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({app:"explorer",path:De})}).catch(()=>null);if(Ee&&Ee.ok)return}catch{}try{await sn("/open-in-explorer",{method:"POST",body:JSON.stringify({path:De,workspaceId:ue})})}catch(Ee){console.warn("archive-manager: open in explorer failed",Ee)}})()},"run")})),ye.push({id:"archive-workspace",label:ie("menu.archiveWorkspace"),icon:{key:"archive-manager.workspace-archive"},disabled:_e===0,separatorBefore:!0,run:e(()=>{_e!==0&&Ft({workspaceId:ue,title:je||ue,count:_e})},"run")}),ye},"resolve")}),qe=!0,de}catch(ue){console.warn("archive-manager: mount native context menus failed, falling back",ue),de();return}}e(jn,"mountNativeContextMenus");let yn=e(()=>{try{let d=(()=>{try{return n.get?.("contextMenus")??n.contextMenus}catch{return}})();if(d&&typeof d.register=="function"){if(kt!==void 0&&kt!==d){if(xt){try{xt()}catch{}xt=void 0}kt=void 0}if(!xt){let b=jn(d);if(b){if(xt=b,kt=d,mt){try{mt()}catch{}mt=void 0}}else mt||(mt=Zt(Bt()))}}else{if(xt){try{xt()}catch{}xt=void 0}kt=void 0,mt||(mt=Zt(Bt()))}}catch(d){console.warn("archive-manager: reconcile native context menu failed",d)}},"reconcileNativeContextMenu");yn(),Promise.resolve().then(()=>{try{yn()}catch{}}),n.effect(()=>Or(),"archive-manager: sidebar row contextmenu trigger"),Ur(n);let rn=typeof n.on=="function"?n.on("slots/changed",d=>{if(!(d!=="sidebar.workspaces"&&d!=="contextMenu.content"&&d!=="contextMenu"))try{St(),yn()}catch(b){console.warn("archive-manager: sidebar mode switch failed",b)}}):void 0;n.effect(()=>()=>{rn?.();try{xt?.()}catch{}xt=void 0,kt=void 0;try{mt?.()}catch{}mt=void 0,An?.(),_n?.(),Jt?.(),Rn?.(),Mt?.(),It?.()},"archive-manager: sidebar mode");let Xt=e(()=>({archiveSessions:ee,archiveSession:e((d,b)=>n.workspaces.archiveSession(d,b),"archiveSession"),sessionStore:dr(n.sessions.list),workspaceStore:dr(n.workspaces.list),unarchiveSession:jt,deleteSession:q,unarchiveSessions:K,deleteArchivedSessions:He,archivedSessionMetadata:nt,openConversation:f,focusSessionWorkspace:k,viewState:o,favoriteSessions:lt,setSessionFavorite:mn,favoriteSync:tt,organizeBatch:Et,diagnoseOrphanSubagents:z,cleanOrphanSubagents:Ne,diagnoseSessionCaches:O,rebuildSessionCaches:u,refreshCacheLists:ae,searchSessionContent:yt,searchArchivedContent:me,previewArchivedSession:ht,t:n.locale.bind(Oe)}),"buildArchivedSectionProps"),sn=e(async(d,b)=>{let T=xn(`/api/michengai/dsh-archive-manager${d}`),G=Object.assign({"content-type":"application/json","x-michengai-plugin-update":"1"},b?.headers),ve=await fetch(T,Object.assign({},b,{headers:G})),V=await ve.json();if(!ve.ok||!V||V.ok===!1)throw new Error((V&&typeof V=="object"&&typeof V.error=="string"?V.error:void 0)||`HTTP ${ve.status}`);return V},"callSettingsApi"),Ut=null,Wt=null,Gt=!1,Nn=e(({size:d=16})=>(0,s.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:d,height:d,fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"M13.5 2.5H2.5C1.94772 2.5 1.5 2.94772 1.5 3.5V4.5C1.5 5.05228 1.94772 5.5 2.5 5.5H13.5C14.0523 5.5 14.5 5.05228 14.5 4.5V3.5C14.5 2.94772 14.0523 2.5 13.5 2.5Z"}),(0,s.jsx)("path",{d:"M2.5 5.5V13.5C2.5 13.7652 2.60536 14.0196 2.79289 14.2071C2.98043 14.3946 3.23478 14.5 3.5 14.5H12.5C12.7652 14.5 13.0196 14.3946 13.2071 14.2071C13.3946 14.0196 13.5 13.7652 13.5 13.5V5.5"}),(0,s.jsx)("path",{d:"M6.5 9.5H9.5"})]}),"ArchiveNavIcon"),Mn=e(()=>{if(!(!Gt||Ut)&&!($e&&!$e.isSettingsSectionEnabled())){try{let d=n.slots.register({name:"settings.section.icon",id:"archive-manager",locale:Oe},Nn);Wt=typeof d=="function"?d:null}catch{Wt=null}try{let d=n.slots.register({name:"settings.section",id:"archive-manager",order:45,label:e(()=>n.locale.bind(Oe)("archived.badge"),"label"),icon:"archive",locale:Oe,inject:Xt},Wn);Ut=typeof d=="function"?d:()=>{}}catch(d){console.warn("archive-manager: register settings.section failed:",d),Ut=null}}},"mountSettingsSection"),an=e(()=>{if(Wt){try{Wt()}catch{}Wt=null}if(Ut){try{Ut()}catch{}Ut=null}},"unmountSettingsSection"),on=e(()=>{$e?.isSettingsSectionEnabled?.()??!0?Mn():an()},"syncSettingsSection");$e=Cr(n,{callApi:sn,renderPanel:e(d=>(0,s.jsx)(Wn,Object.assign({},Xt(),d)),"renderPanel"),injectProps:Xt,ns:Oe,onOnlineUpdateChange:e(()=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("dsham-update-toggle"))},"onOnlineUpdateChange"),onSidebarFavoriteStarChange:e(d=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("dsham-favorite-star-toggle",{detail:{enabled:d}}))},"onSidebarFavoriteStarChange"),onLocationChange:e(()=>{on()},"onLocationChange")}),n.effect(()=>()=>{$e?.destroy(),an()},"archive-manager: sidebar entry"),n.effect(()=>qs({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:he,isEnabled:e(()=>$e.isOnlineUpdateEnabled(),"isEnabled")}),"dsh-archive-manager: plugin update ui"),n.slots.inject("settings.section",()=>{Gt=!0;try{if($e&&!$e.isSettingsSectionEnabled())return()=>{Gt=!1,an()};try{let b=n.slots.register({name:"settings.section.icon",id:"archive-manager",locale:Oe},Nn);Wt=typeof b=="function"?b:null}catch{Wt=null}let d=n.slots.register({name:"settings.section",id:"archive-manager",order:45,label:e(()=>n.locale.bind(Oe)("archived.badge"),"label"),icon:"archive",locale:Oe,inject:Xt},Wn);return Ut=typeof d=="function"?d:()=>{},()=>{Gt=!1,an()}}catch(d){return console.warn("archive-manager: register settings.section failed:",d),()=>{Gt=!1}}})}e(ja,"applyWorkspaceBrowser");async function Na(n,a,o,p){try{await a(n)}catch(v){o(oa(v,p))}}return e(Na,"forkWithFeedback"),i.__test={computeSubmenuPosition:ns,mergeSubmenuMeasurement:rs,movableWorkspaces:y,MoveSubmenu:ss,forkWithFeedback:Na,hasNativeContextMenuService:m,favoritesOnlyVisibility:Tr,favoriteGroupPredicate:Ar,createFavoriteRowStore:Rr,unarchivedSessionIds:Yr,ArchiveSelectionToolbar:Wr,ArchivedSessionsSection:Wn,zh:Xr,en:Qr,displayTitle:ot,isUnknownSessionError:qn,deriveArchivedGroups:Zr,sortArchivedGroups:Jr,deriveArchivedBatchIds:En,archivedSessionIdsInGroups:$r,pruneArchivedSelection:Gr,toggleArchivedSelection:cr,archivedDeleteFeedback:Kr,isWorkspaceTaskCandidate:Gn,isWorkspaceDeleteMenuItem:ir,workspaceMenuTriggerFrom:zr,findRowMenuButton:ar,isRowMenuButton:Pr,setupSidebarRowContextMenu:Or,applySettingsNavIcon:Hr,restoreSettingsNavIcon:Br,installSettingsNavIcon:Ur,mutationTouches:Kn,resolveRowHasStatus:Vt,activeSessionActivity:$n,activeSessionRefusal:Dr,activeArchiveFromMessage:Lr,archiveSessionsViaOfficial:ur,unarchiveSessionsViaOfficial:ts,createUnarchiveSession:es,bindObservable:dr,ARCHIVE_MANAGER_REMOTE:tn,currentSessionId:nr,setupSidebarEntry:Cr,ArchiveBundleConfigCard:xr,ArchiveBundleConfigCardWrapper:kr,setupWorkspaceFavoritesOnly:_r},i.apply=Ra,i.inject=Aa,r.exports}e(bi,"startArchiveClient");
31
31
 
32
32
  return module.exports.startArchiveClient(require);
33
33
  }