dsh-code-server-app 0.2.9 → 0.2.10

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
@@ -1,5 +1,5 @@
1
1
  window.__ModuleLoader__.load({id:'dsh-code-server-app',factory:function(require){var module={exports:{}};var exports=module.exports;
2
- var P=Object.defineProperty;var be=Object.getOwnPropertyDescriptor;var he=Object.getOwnPropertyNames;var ge=Object.prototype.hasOwnProperty;var me=(e,r)=>{for(var n in r)P(e,n,{get:r[n],enumerable:!0})},ye=(e,r,n,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of he(r))!ge.call(e,l)&&l!==n&&P(e,l,{get:()=>r[l],enumerable:!(s=be(r,l))||s.enumerable});return e};var we=e=>ye(P({},"__esModule",{value:!0}),e);var sr={};me(sr,{apply:()=>nr,inject:()=>ar,name:()=>lr});module.exports=we(sr);var J="dsh-resource://file/",Se="sidebar://",X="session";function H(e){return typeof e=="string"&&e.startsWith(Se)}function D(e){if(typeof e!="string"||!e.startsWith(J))return null;for(var r=e.length,n=0;n<e.length;n+=1){var s=e.charAt(n);if(s==="?"||s==="#"){r=n;break}}var l=e.slice(J.length,r).split("/"),i=l.shift();try{if(i==="session"){var d=l.shift();return d===void 0||d===""||l.length===0?null:{scope:"session",sessionId:decodeURIComponent(d),path:V(l)}}if(i==="absolute"){var f=l[0]===""&&l.length>1,p=f?l.slice(1):l,c=V(p);return(c===""||c.charAt(0)==="/")&&!f?null:f?{scope:"absolute",path:"//"+c}:c===""?null:{scope:"absolute",path:q(c)?c:"/"+c}}}catch(u){return null}return null}function V(e){for(var r=[],n=0;n<e.length;n+=1)r.push(decodeURIComponent(e[n]));return r.join("/")}function q(e){return/^[A-Za-z]:($|\/)/.test(e)}function xe(e){return typeof e!="string"||e===""?!1:e.charAt(0)==="/"?!0:q(e)}function K(e){var r=D(e);if(r===null)return"";var n=r.path.replace(/[/\\]+$/,""),s=Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\")),l=s===-1?n:n.slice(s+1);return l}function $(e,r){if(e===null||e==null)return null;var n=typeof e.path=="string"?e.path:"";if(n==="")return null;if(xe(n))return n;if(typeof r!="string"||r==="")return null;var s=r.indexOf("\\")!==-1?"\\":"/",l=r.replace(/[\\/]+$/,"");return l+s+(s==="\\"?n.replace(/\//g,"\\"):n)}function ee(e,r){return e===null||e==null?!1:e.scope==="session"?!0:r==="all"}var ke="[data-sidebar-right-panel]",Ee='[data-sidebar-right-mode="fullscreen"]';function re(e){if(e==null||typeof e.closest!="function")return"no-root";var r,n;try{if(r=e.closest(ke),r==null||typeof r.querySelector!="function")return"no-panel";n=r.querySelector(Ee)}catch(s){return"lookup-failed"}if(n==null||typeof n.click!="function")return"no-control";try{n.click()}catch(s){return"click-failed"}return"clicked"}var A=typeof Element!="undefined"&&typeof Element.prototype.moveBefore=="function",Oe=-2e4,t={park:null,frame:null,currentSrc:null,sameOrigin:null,owner:null,lastRect:null,parkStrategy:"offscreen",degraded:!1,preloaded:!1,nudgeCount:0,nudgeEnabled:!0,lastNudgeAt:0,listeners:new Set};function U(){return{ready:t.frame!==null,docked:t.owner!==null,owner:t.owner,src:t.currentSrc,sameOrigin:t.sameOrigin,parkStrategy:t.parkStrategy,degraded:t.degraded,preloaded:t.preloaded,supportsMoveBefore:A,nudgeCount:t.nudgeCount,lastNudgeAt:t.lastNudgeAt}}function R(){var e=U();t.listeners.forEach(function(r){try{r(e)}catch(n){}})}function ne(e){return t.listeners.add(e),function(){t.listeners.delete(e)}}function te(){return U()}function Ce(e){e!=="offscreen"&&e!=="behind"||t.parkStrategy!==e&&(t.parkStrategy=e,t.frame!==null&&t.owner===null&&_(),R())}function Ne(){return t.parkStrategy}function Le(){var e=t.lastRect;e!==null&&(t.park.style.width=Math.max(1,Math.round(e.width))+"px",t.park.style.height=Math.max(1,Math.round(e.height))+"px")}function _(){if(t.park!==null){if(Le(),t.parkStrategy==="behind"&&t.lastRect!==null){t.park.style.left=Math.round(t.lastRect.left)+"px",t.park.style.top=Math.round(t.lastRect.top)+"px",t.park.style.visibility="visible",t.park.style.zIndex="0";return}t.park.style.left=Oe+"px",t.park.style.top="0px",t.park.style.visibility="hidden",t.park.style.zIndex="0"}}function ae(){t.frame!==null&&(t.frame.setAttribute("inert",""),t.frame.setAttribute("aria-hidden","true"))}function Ae(){t.frame!==null&&(t.frame.removeAttribute("inert"),t.frame.removeAttribute("aria-hidden"))}function Re(){var e=document.createElement("div");e.className="dshcs-park",e.setAttribute("data-dshcs-park",""),e.setAttribute("aria-hidden","true");var r=document.createElement("iframe");return r.className="dshcs-frame",r.setAttribute("title","code-server"),r.setAttribute("allow","clipboard-read; clipboard-write"),r.setAttribute("data-dshcs-resident",""),r.src="about:blank",e.appendChild(r),document.body.appendChild(e),t.park=e,t.frame=r,t.currentSrc="about:blank",t.owner=null,_(),ae(),r}function Me(e){var r=t.frame;if(r!==null){var n=t.sameOrigin!==e;!n&&r.hasAttribute("data-dshcs-attrs")||(e===!0?r.removeAttribute("sandbox"):e===!1&&r.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-pointer-lock allow-clipboard-read allow-clipboard-write"),r.setAttribute("data-dshcs-attrs",e===!0?"same-origin":"cross-origin"),t.sameOrigin=e)}}function F(e){var r=e||{};return t.frame===null&&Re(),typeof r.sameOrigin=="boolean"&&Me(r.sameOrigin),typeof r.src=="string"&&r.src!==""&&r.src!==t.currentSrc&&Te(r.src),t.frame}function Te(e){t.frame===null||typeof e!="string"||e===""||e===t.currentSrc||(t.currentSrc=e,t.frame.src=e,R())}function le(){var e=t.frame;if(t.nudgeEnabled!==!0||e===null||e.isConnected!==!0)return!1;var r=e.style.display;return e.style.display="none",e.offsetHeight,e.style.display=r,t.nudgeCount+=1,t.lastNudgeAt=Date.now(),!0}function Ie(e){return t.nudgeEnabled=e!==!1,t.nudgeEnabled}function se(e){if(t.frame!==null){if(A)try{e.moveBefore(t.frame,null);return}catch(r){t.degraded=!0,t.lastMoveError=(r&&r.name?r.name+": ":"")+(r&&r.message?r.message:String(r))}else t.degraded=!0;e.appendChild(t.frame)}}function B(e,r){if(!(t.frame===null||e==null)){var n=t.owner===null,s=e.getBoundingClientRect();s.width>=1&&s.height>=1&&(t.lastRect={left:s.left,top:s.top,width:s.width,height:s.height}),t.owner=r===void 0?null:r,Ae(),t.park.setAttribute("aria-hidden","true"),se(e),n&&le(),R()}}function M(e){t.frame!==null&&(e!==void 0&&t.owner!==e||(t.owner=null,_(),ae(),t.park.setAttribute("aria-hidden","true"),se(t.park),R()))}function G(e){var r=e||{};return F(r),t.owner===null&&(typeof r.src=="string"&&r.src!==""&&(t.preloaded=!0),M()),t.frame}function De(){t.park!==null&&t.park.parentNode!==null&&t.park.parentNode.removeChild(t.park),t.park=null,t.frame=null,t.currentSrc=null,t.sameOrigin=null,t.owner=null,t.lastRect=null,t.degraded=!1,t.preloaded=!1,t.nudgeCount=0,t.lastNudgeAt=0,R()}typeof window!="undefined"&&(window.__dshcsSurface={snapshot:U,setParkStrategy:Ce,getParkStrategy:Ne,preload:G,dock:B,park:M,nudge:le,setNudgeEnabled:Ie,destroy:De});var a=require("react"),Y=new Set,T={status:null,busy:!1,sidebarUi:"unknown",sidebarRegisterFailed:!1};function E(e){T=Object.assign({},T,e),Y.forEach(function(r){r()})}function je(e){return Y.add(e),function(){Y.delete(e)}}function ze(){return T}function Z(){return a.useSyncExternalStore(je,ze)}var Pe="/api",He="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB2aWV3Qm94PSIwIDAgMTQ3IDE0NyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8c3R5bGU+QG1lZGlhIChwcmVmZXJzLWNvbG9yLXNjaGVtZTogZGFyaykgeyogeyBmaWxsOiB3aGl0ZTsgfX08L3N0eWxlPgogIDxwYXRoIGQ9Im00Mi40MjE0LDM5LjY1NWMtMjQuNDA1NywwIC00Mi4xNTU0LDEzLjE3MjEgLTQyLjE1NTQsMzMuODQ1YzAsMjAuNTgxNCAxOC40ODkyLDMzLjg0NSA0Mi4xNTU0LDMzLjg0NWMyMy42NjYyLDAgMzguMTgwMywtMTEuNjE3MSAzOC43MzQ5LC0yOC43MjI1bC0yMS4wNzc3LC0wLjQ1NzRjLTAuOTI0NCw5LjMzMDMgLTkuMTA1OSwxNS4xODQ1IC0xNy42NTcyLDE1LjE4NDVjLTExLjc0MDYsMCAtMjAuNDMwNiwtNy41OTIyIC0yMC40MzA2LC0xOS44NDk2YzAsLTEyLjI1NzQgOC42OSwtMTkuOTg2OCAyMC40MzA2LC0yMC4yMTU1YzguNTUxMywtMC4xODMgMTYuOTE3Nyw1Ljk0NTcgMTcuNDcyMywxNS4yNzZsMjEuMDc3NywtMC42NDAzYy0wLjQ2MjIsLTE2LjgzMTEgLTE0LjE0NDIsLTI4LjI2NTIgLTM4LjU1LC0yOC4yNjUyem00OC44NDQ2LDJsNTUuNDY4LDBsMCw2NC4wMzExbC01NS40NjgsMGwwLC02NC4wMzExeiIgY2xpcC1ydWxlPSJldmVub2RkIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KPC9zdmc+Cg==";async function k(e,r){var n={method:r===void 0?"GET":"POST",headers:{}};r!==void 0&&(n.headers["content-type"]="application/json",n.body=JSON.stringify(r));var s=await fetch(Pe+e,n),l=await s.text(),i=null;try{i=l===""?null:JSON.parse(l)}catch(d){i=null}return s.ok?i!==null?i:{ok:!1,error:"invalid JSON response"}:{ok:!1,error:"HTTP "+s.status+(i!==null&&i.error!==void 0?": "+i.error:"")}}function pe(e,r){try{var n=e(function(v){return v}),s=r===null?null:typeof r=="function"?r(function(v){return v}):null,l=n!=null?n.current:void 0;if(l!==void 0&&n!=null&&n.byId!=null){var i=n.byId[l];if(i!=null&&typeof i.cwd=="string"&&i.cwd!=="")return i.cwd}var d=s!=null&&Array.isArray(s.items)?s.items:[];if(l!==void 0)for(var f=0;f<d.length;f++){var p=d[f];if(p.sessionIds!=null&&p.sessionIds.indexOf(l)!==-1&&typeof p.path=="string"&&p.path!=="")return p.path}var c=s!=null?s.recentWorkspaceId:void 0;if(c!==void 0){for(var u=0;u<d.length;u++)if(d[u].workspaceId===c&&typeof d[u].path=="string"&&d[u].path!=="")return d[u].path}if(d.length>0&&typeof d[0].path=="string"&&d[0].path!=="")return d[0].path}catch(v){}}function ve(e,r){if(e==null||typeof e.url!="string"||e.url==="")return null;var n=e.pid!=null?String(e.pid):e.startedAt!=null?String(e.startedAt):"0",s=e.url+"?s="+encodeURIComponent(n),l=typeof r=="string"&&r!==""?r:e!=null&&e.cwd!=null?e.cwd:null;if(l==null||l==="")return s;var i=l.replace(/\\/g,"/"),d=i;return(/^[A-Za-z]:\//.test(i)||i.charCodeAt(0)!==47)&&(d="/"+i),s+"&folder="+encodeURIComponent(d)}function Ue(e){var r=e.status,n=e.pageUrl,s=e.reloadTick,l=e.owner,i=a.useRef(null),d=r!=null&&r.ok===!0&&r.running===!0,f=r!=null&&r.status==="starting",p=r!=null&&r.ok===!1,c=r!=null&&r.serve==="dsh";if(a.useLayoutEffect(function(){if(!d||n===null){M(l);return}F({src:n,sameOrigin:c}),i.current!==null&&B(i.current,l)},[d,n,c,s,l]),a.useLayoutEffect(function(){return function(){M(l)}},[l]),d&&n!==null)return a.createElement("div",{ref:i,className:"dshcs-slot","data-code-server-slot":l!=null?l:"code-server"});if(f)return a.createElement("div",{className:"dshcs-loading"},"\u6B63\u5728\u542F\u52A8 code-server\u2026");var u=p&&r!=null&&r.error?r.error:"code-server \u672A\u8FD0\u884C",v=c?"\u5F53\u524D\u4EE5 DSH \u540C\u6E90\u8DEF\u5F84 "+(r!=null&&r.url||"/code-server/")+" \u63D0\u4F9B(\u65E0\u72EC\u7ACB\u7AEF\u53E3)\u3002":"\u5F53\u524D\u4EE5\u72EC\u7ACB\u56DE\u73AF\u7AEF\u53E3\u63D0\u4F9B(\u7AEF\u53E3 "+(r!=null&&r.port!=null?r.port:"8090")+" \u88AB\u5360\u7528\u65F6\u8BF7\u91CA\u653E\u6216\u4FEE\u6539 port \u914D\u7F6E)\u3002",S=A?"\u5E38\u9A7B\u9762:\u53EF\u7528(\u5207\u6807\u7B7E/\u6536\u8D77\u4FA7\u680F\u4E0D\u91CD\u8F7D)\u3002":"\u5E38\u9A7B\u9762:\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 Element.moveBefore \u2014\u2014 \u5207\u6807\u7B7E\u4F1A\u6574\u9875\u91CD\u8F7D(\u5347\u7EA7\u6D4F\u89C8\u5668\u540E\u81EA\u52A8\u53EF\u7528)\u3002";return a.createElement("div",{className:"dshcs-empty"},a.createElement("div",{className:"dshcs-emptybox"},a.createElement("div",null,p?"code-server \u542F\u52A8\u5931\u8D25":"code-server \u672A\u8FD0\u884C"),a.createElement("pre",{className:"dshcs-error"},u),a.createElement("p",{className:"dshcs-hint"},"VS Code \u6811\u968F\u63D2\u4EF6\u5305\u5185\u7F6E\u3001\u5C31\u5730\u8FD0\u884C(\u65E0\u9700\u5168\u5C40\u5B89\u88C5\u3001\u65E0\u9700\u8054\u7F51\u5B89\u88C5\u3001\u65E0\u300C\u5B89\u88C5\u73AF\u5883\u300D\u6B65\u9AA4);\u5185\u90E8\u4F9D\u8D56\u4E0E\u9884\u7F16\u8BD1\u539F\u751F\u6A21\u5757\u7531\u5305\u7BA1\u7406\u5668\u5728\u5B89\u88C5\u63D2\u4EF6\u65F6\u4E00\u5E76\u88C5\u597D(\u65E0\u9700 C++ \u5DE5\u5177\u94FE)\u3002\u82E5\u6B64\u5904\u957F\u671F\u672A\u8FD0\u884C,\u8BF7\u67E5\u770B DSH host \u65E5\u5FD7\u91CC\u7684 [code-server] \u8F93\u51FA(\u6216\u5728\u8BBE\u7F6E\u5361\u7247\u91CC\u5207\u6362\u300C\u540E\u53F0\u5E38\u9A7B\u300D\u89E6\u53D1\u4E00\u6B21\u542F\u52A8)\u3002"+v+S)))}function _e(e){var r=Z(),n=r.status,s=n!=null&&n.ok===!0&&n.running===!0,l=n!=null&&n.keepResident===!0,i=pe(e&&e.useSessions,e&&e.useWorkspaces),d=s?ve(n,i):null;return a.useEffect(function(){!l||!s||d===null||G({src:d,sameOrigin:n!=null&&n.serve==="dsh"})},[l,s,d,n!=null?n.serve:null]),null}var Fe=".dshcs-frame{display:block;position:absolute;inset:0;z-index:1;width:100%;height:100%;border:0;background:var(--dsw-alias-bg-base,#fff)}.dshcs-tabroot{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-width:0;min-height:0;background:var(--dsw-alias-bg-base,#fff)}.dshcs-slot{position:relative;display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;background:var(--dsw-alias-bg-base,#fff)}.dshcs-park{position:fixed;left:-20000px;top:0;width:320px;height:200px;overflow:hidden;pointer-events:none;z-index:0;visibility:hidden;contain:strict}.dshcs-loading{position:absolute;inset:0;z-index:2;display:grid;place-items:center;background:var(--dsw-alias-bg-base,#fff);color:var(--dsw-alias-label-tertiary,#7d8798);font-size:13px}.dshcs-empty{position:relative;z-index:2;flex:1;display:flex;align-items:center;justify-content:center;padding:44px 24px 24px}.dshcs-emptybox{max-width:560px;text-align:left;background:var(--dsw-alias-bg-layer-2,#f7f8fb);border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:12px;padding:16px 18px}.dshcs-error{color:var(--dsw-alias-label-error,#d92d20);white-space:pre-wrap;word-break:break-all;font-family:ui-monospace,Consolas,monospace;font-size:12px;margin:8px 0 0}.dshcs-hint{color:var(--dsw-alias-label-tertiary,#7d8798);font-size:12px;margin:6px 0 0}.dshcs-legacy{color:var(--dsw-alias-label-warning,#b54708);font-size:12px;font-weight:600;margin:0 0 6px}",ie="dsh-code-server/styles";typeof document!="undefined"&&document.querySelector("style[data-dshcs="+JSON.stringify(ie)+"]")===null&&(j=document.createElement("style"),j.setAttribute("data-dshcs",ie),j.textContent=Fe,document.head.appendChild(j));var j,de="code-server",ce="dsh-code-server-app",Be=2500,Ge=1e4,Qe=1500;function We(e){var r=e!=null&&typeof e.size=="number"?e.size:16;return a.createElement("img",{src:He,alt:"","aria-hidden":!0,draggable:!1,className:e!=null?e.className:void 0,style:{width:r,height:r,display:"block",objectFit:"contain",WebkitUserDrag:"none",userSelect:"none"}})}function Ye(){var e=T.status;return e!=null&&e.fileOpenScope==="all"?"all":X}function Ze(e,r){try{var n=e(function(l){return l});if(n!=null&&r!=null&&n.byId!=null){var s=n.byId[r];if(s!=null&&typeof s.cwd=="string"&&s.cwd!=="")return s.cwd}}catch(l){}}function Je(e){var r=e.useTabInfo(),n=r.tab,s=Z(),l=s.status,i=n.navigation,d=i!=null&&typeof i.revision=="number"?i.revision:0,f=i!=null&&typeof i.address=="string"?i.address:"",p=H(f)?null:D(f),c=Ze(e.useSessions,p!=null?p.sessionId:void 0),u=c!==void 0?c:pe(e.useSessions,null),v=$(p,u),S=i!=null&&i.params!=null&&typeof i.params.line=="number"?i.params.line:null,o=a.useRef(void 0),[m,h]=a.useState(0),w=a.useRef(null),N=a.useRef(!1),I=r.tab!=null&&r.tab.visible===!0,O=r.sidebar!=null&&r.sidebar.fullscreen===!0,z=l==null||l.fullscreenOnOpen!==!1;return a.useLayoutEffect(function(){if(!I){N.current=!1;return}if(!(!z||O||N.current)){N.current=!0;var x=re(w.current);x!=="clicked"&&console.warn("[code-server] \u672A\u80FD\u81EA\u52A8\u5207\u5230\u5168\u5C4F\u53F3\u4FA7\u680F("+x+");\u672C\u6B21\u6253\u5F00\u4FDD\u6301\u539F\u6A21\u5F0F")}},[I,O,z]),a.useEffect(function(){if(!(typeof u!="string"||u==="")&&o.current!==u){var x=o.current!==void 0;o.current=u;var g=!1;return k("/code-server/start",{cwd:u}).then(function(C){g||(E({status:C}),x&&C!=null&&C.ok===!0&&C.running===!0&&h(function(L){return L+1}))}).catch(function(){}),function(){g=!0}}},[u]),a.useEffect(function(){k("/code-server/status").then(function(g){g!=null&&E({status:g})}).catch(function(){});var x=window.setInterval(function(){k("/code-server/status").then(function(g){E({status:g})}).catch(function(){})},3e3);return function(){window.clearInterval(x)}},[]),a.useEffect(function(){v!==null&&k("/code-server/open-file",S===null?{file:v}:{file:v,line:S}).catch(function(){})},[d,v,S]),a.createElement("div",{className:"dshcs-tabroot","data-code-server-tab":"body",ref:w},a.createElement(Ue,{status:l,pageUrl:ve(l,u),reloadTick:m,owner:"tab:"+n.id}))}function Q(e,r){if(e==null)return null;var n=e[r];if(n!=null)return n;if(typeof e.get=="function"){var s=e.get(r);if(s!=null)return s}return null}function Ve(e){var r=Q(e,"sidebarRightTabs"),n=Q(e,"sidebarRight");if(r==null||n==null)return console.error("[code-server] \u53F3\u4FA7\u680F\u670D\u52A1\u4E0A\u4E0B\u6587\u4E0D\u53EF\u89C1(sidebarRightTabs="+(r!=null)+", sidebarRight="+(n!=null)+"):\u8DF3\u8FC7\u4FA7\u680F\u6CE8\u518C"),!1;var s=Q(e,"slots");if(e.effect(function(){return r.register({id:ce,kind:de,priority:"extension",patterns:["dsh-resource://file/**"],canOpen:function(l){return ee(D(l),Ye())},title:function(l){if(H(l)||l===void 0||l===null||l==="")return"Code Server";var i=K(l);return i===""?"Code Server":i},guide:[{order:20,title:function(){return"Code Server"},description:function(){return"\u5728\u53F3\u4FA7\u680F\u6807\u7B7E\u91CC\u8FD0\u884C VS Code \u7F51\u9875\u7248,\u8DDF\u968F\u5F53\u524D\u4F1A\u8BDD\u5DE5\u4F5C\u533A;\u4EA7\u7269/\u4EA4\u4ED8\u6587\u4EF6\u70B9\u51FB\u540E\u5728\u6B64\u6253\u5F00\u3002"},icon:We}]})},"code-server: sidebar tab type"),s!=null)e.effect(function(){return s.inject("sidebar.right.pane.tab",function(){return s.register({name:"sidebar.right.pane.tab",key:ce},Je)})},"code-server: sidebar tab body");else return console.error("[code-server] slots \u670D\u52A1\u4E0D\u53EF\u89C1:\u4FA7\u680F\u6807\u7B7E body \u672A\u6CE8\u518C"),!1;return e.effect(function(){return function(){E({sidebarUi:"unknown"})}},"code-server: sidebar mode reset"),console.log("[code-server] right-sidebar tab registered (kind="+de+")"),!0}var Xe=".dshcs-card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.dshcs-card:hover{border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardHeader{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}.dshcs-cardHeader:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.dshcs-cardHeadText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.dshcs-cardName{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.dshcs-cardDescription{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));font-size:13px;line-height:1.5}.dshcs-cardChevron{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));flex:none;transition:transform .16s;display:inline-flex}.dshcs-cardChevronOpen{transform:rotate(180deg)}.dshcs-cardBody{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.dshcs-cardReadOnly{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:12px 0 0;font-size:12px;line-height:1.5}.dshcs-pending{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-cardFooter{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}.dshcs-cardFailed{min-width:0;color:var(--dsw-alias-label-error,var(--dsw-alias-state-error-primary));flex:1;margin:0;font-size:12px;line-height:1.5}.dshcs-cbtn{appearance:none;font:inherit;cursor:pointer;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5;border:1px solid transparent;transition:color .12s ease,background .12s ease}.dshcs-cbtn:disabled{opacity:.4;cursor:default}.dshcs-cbtn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.dshcs-cbtnOutline{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}.dshcs-cbtnOutline:hover:not(:disabled){color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover,transparent)}.dshcs-cbtnPrimary{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3);border-color:var(--dsw-alias-label-primary);font-weight:600}.dshcs-cbtnPrimary:hover:not(:disabled){filter:brightness(.95)}.dshcs-cbtnPrimary:active:not(:disabled){filter:brightness(.9)}.dshcs-field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.dshcs-field+.dshcs-field{border-top:1px solid var(--dsw-alias-border-l2)}.dshcs-fieldHead{align-items:center;gap:8px;display:flex}.dshcs-fieldLabel{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.dshcs-card .dshcs-hint{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:0;font-size:12px;line-height:1.5}.dshcs-check{display:flex;align-items:center;gap:8px;cursor:pointer}.dshcs-check input{accent-color:var(--dsw-alias-brand-primary);width:15px;height:15px;margin:0;flex:none}.dshcs-check input:disabled{cursor:default}.dshcs-select{display:inline-flex;align-items:center}.dshcs-select select{font:inherit;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-3,transparent);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;padding:4px 8px;min-width:220px;cursor:pointer}.dshcs-select select:disabled{opacity:.5;cursor:default}.dshcs-badges{align-items:center;gap:8px;display:inline-flex}.dshcs-badge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}.dshcs-reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.dshcs-reset:disabled{cursor:default}",qe="dsh-code-server/Card.module.css";function Ke(e,r){if(typeof document!="undefined"&&document.querySelector("style[data-plugin-css="+JSON.stringify(e)+"]")===null){var n=document.createElement("style");n.dataset.plugin="dsh-code-server",n.dataset.pluginCss=e,n.textContent=r,document.head.appendChild(n)}}Ke(qe,Xe);function $e(e){return a.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,className:e.className},a.createElement("path",{d:"M3.5 5.25L7 8.75L10.5 5.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))}function oe(e){return a.createElement("button",{type:"button",className:"dshcs-cbtn "+(e.variant==="primary"?"dshcs-cbtnPrimary":"dshcs-cbtnOutline"),disabled:e.disabled===!0,onClick:e.onClick},e.children)}function ue(e){return a.createElement("label",{className:"dshcs-check"},a.createElement("input",{type:"checkbox",checked:e.checked===!0,disabled:e.disabled===!0,onChange:function(r){e.onChange(r.target.checked)}}),a.createElement("span",{className:"dshcs-hint"},e.children))}function er(e){var r=Array.isArray(e.options)?e.options:[];return a.createElement("label",{className:"dshcs-select"},a.createElement("select",{value:e.value,disabled:e.disabled===!0,onChange:function(n){e.onChange(n.target.value)}},r.map(function(n){return a.createElement("option",{key:n.value,value:n.value},n.label)})))}function W(e){var r=[];return e.overridden===!0&&(r.push(a.createElement("span",{className:"dshcs-badge"},e.overriddenLabel)),r.push(a.createElement("button",{type:"button",className:"dshcs-reset",disabled:e.disabled===!0,onClick:e.onReset},e.resetLabel))),r.length===0?null:a.createElement("span",{className:"dshcs-badges"},...r)}function fe(e){var[r,n]=a.useState(e.defaultOpen===!0),s=e.state;if(s==null||s.available!==!0)return null;var l=e.title,i=e.noticeOnly===!0,d=s.dirty!==!0||s.invalid===!0||s.saving===!0;return a.createElement("li",{className:"dshcs-card"+(r?" dshcs-cardOpen":"")},a.createElement("button",{type:"button",className:"dshcs-cardHeader","aria-expanded":r,onClick:function(){n(!r)}},a.createElement("span",{className:"dshcs-cardHeadText"},a.createElement("span",{className:"dshcs-cardName"},l),a.createElement("span",{className:"dshcs-cardDescription"},e.description)),s.dirty===!0?a.createElement("span",{className:"dshcs-pending"},e.unsavedLabel):null,a.createElement($e,{className:"dshcs-cardChevron"+(r?" dshcs-cardChevronOpen":"")})),r===!0?a.createElement("div",{className:"dshcs-cardBody"},i===!0?null:s.writable!==!0?a.createElement("p",{className:"dshcs-cardReadOnly",role:"status"},e.readOnlyLabel):null,e.children,i===!0?null:a.createElement("div",{className:"dshcs-cardFooter"},s.failed===!0?a.createElement("p",{className:"dshcs-cardFailed",role:"status"},e.saveFailedLabel):null,a.createElement(oe,{disabled:s.dirty!==!0||s.saving===!0,onClick:e.onDiscard},e.discardLabel),a.createElement(oe,{variant:"primary",disabled:d,onClick:e.onSave},s.saving===!0?e.savingLabel:e.saveLabel))):null)}function rr(e){try{let g=function(){k("/code-server/status").then(function(b){b!=null&&typeof b=="object"&&E({status:b})}).catch(function(){})};var r=e.scope,[n,s]=a.useState(function(){return r!==void 0?r.getSnapshot():null}),[l,i]=a.useState(null),[d,f]=a.useState(!1),[p,c]=a.useState(!1),u=Z(),[v,S]=a.useState(te());if(a.useEffect(function(){return ne(function(b){S(b)})},[]),a.useEffect(function(){if(r===void 0||typeof r.subscribe!="function")return;function b(){try{s(r.getSnapshot())}catch(ir){}}var y=r.subscribe(b);return function(){typeof y=="function"&&y()}},[r]),r===void 0)return console.error("[code-server] card scope missing"),null;if(n==null||n.status!=="ready")return n!=null&&n.status==="unavailable"&&console.warn("[code-server] settings scope unavailable:",n.status),null;var o=n.value!==void 0&&n.value!==null?n.value:{},m=n.user,h={keepResident:o.keepResident!==!1,fileOpenScope:o.fileOpenScope==="all"?"all":"session",fullscreenOnOpen:o.fullscreenOnOpen!==!1};if(u!=null&&u.sidebarUi==="legacy")return a.createElement(fe,{title:"Code Server",description:"\u5F53\u524D DSH \u7248\u672C\u4E0D\u53D7\u652F\u6301(\u7F3A\u5C11\u53F3\u4FA7\u680F\u670D\u52A1)",defaultOpen:!0,noticeOnly:!0,state:{available:!0,writable:!1,dirty:!1,invalid:!1,saving:!1,failed:!1}},a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-legacy"},"\u672C\u63D2\u4EF6\u81EA 0.2.3 \u8D77\u4E0D\u518D\u517C\u5BB9\u65E7\u7248 DSH\u3002"),a.createElement("div",{className:"dshcs-hint",style:{marginTop:0}},`\u672A\u68C0\u6D4B\u5230\u53F3\u4FA7\u680F\u63D2\u4EF6\u670D\u52A1 sidebarRightTabs / sidebarRight,\u56E0\u6B64\u63D2\u4EF6\u4E0D\u63D0\u4F9B\u4EFB\u4F55\u5165\u53E3(\u65E7\u7248\u7684\u60AC\u6D6E\u7403\u4E0E\u6D6E\u52A8\u7A97\u53E3\u5DF2\u79FB\u9664),\u4E5F\u4E0D\u4F1A\u540E\u53F0\u542F\u52A8 IDE\u3002
2
+ var P=Object.defineProperty;var be=Object.getOwnPropertyDescriptor;var he=Object.getOwnPropertyNames;var ge=Object.prototype.hasOwnProperty;var me=(e,r)=>{for(var n in r)P(e,n,{get:r[n],enumerable:!0})},ye=(e,r,n,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of he(r))!ge.call(e,l)&&l!==n&&P(e,l,{get:()=>r[l],enumerable:!(s=be(r,l))||s.enumerable});return e};var we=e=>ye(P({},"__esModule",{value:!0}),e);var sr={};me(sr,{apply:()=>nr,inject:()=>ar,name:()=>lr});module.exports=we(sr);var J="dsh-resource://file/",Se="sidebar://",X="session";function H(e){return typeof e=="string"&&e.startsWith(Se)}function D(e){if(typeof e!="string"||!e.startsWith(J))return null;for(var r=e.length,n=0;n<e.length;n+=1){var s=e.charAt(n);if(s==="?"||s==="#"){r=n;break}}var l=e.slice(J.length,r).split("/"),i=l.shift();try{if(i==="session"){var d=l.shift();return d===void 0||d===""||l.length===0?null:{scope:"session",sessionId:decodeURIComponent(d),path:V(l)}}if(i==="absolute"){var f=l[0]===""&&l.length>1,p=f?l.slice(1):l,c=V(p);return(c===""||c.charAt(0)==="/")&&!f?null:f?{scope:"absolute",path:"//"+c}:c===""?null:{scope:"absolute",path:q(c)?c:"/"+c}}}catch(u){return null}return null}function V(e){for(var r=[],n=0;n<e.length;n+=1)r.push(decodeURIComponent(e[n]));return r.join("/")}function q(e){return/^[A-Za-z]:($|\/)/.test(e)}function xe(e){return typeof e!="string"||e===""?!1:e.charAt(0)==="/"?!0:q(e)}function K(e){var r=D(e);if(r===null)return"";var n=r.path.replace(/[/\\]+$/,""),s=Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\")),l=s===-1?n:n.slice(s+1);return l}function $(e,r){if(e===null||e==null)return null;var n=typeof e.path=="string"?e.path:"";if(n==="")return null;if(xe(n))return n;if(typeof r!="string"||r==="")return null;var s=r.indexOf("\\")!==-1?"\\":"/",l=r.replace(/[\\/]+$/,"");return l+s+(s==="\\"?n.replace(/\//g,"\\"):n)}function ee(e,r){return e===null||e==null?!1:e.scope==="session"?!0:r==="all"}var ke="[data-sidebar-right-panel]",Ee='[data-sidebar-right-mode="fullscreen"]';function re(e){if(e==null||typeof e.closest!="function")return"no-root";var r,n;try{if(r=e.closest(ke),r==null||typeof r.querySelector!="function")return"no-panel";n=r.querySelector(Ee)}catch(s){return"lookup-failed"}if(n==null||typeof n.click!="function")return"no-control";try{n.click()}catch(s){return"click-failed"}return"clicked"}var A=typeof Element!="undefined"&&typeof Element.prototype.moveBefore=="function",Oe=-2e4,t={park:null,frame:null,currentSrc:null,sameOrigin:null,owner:null,lastRect:null,parkStrategy:"offscreen",degraded:!1,preloaded:!1,nudgeCount:0,nudgeEnabled:!0,lastNudgeAt:0,listeners:new Set};function U(){return{ready:t.frame!==null,docked:t.owner!==null,owner:t.owner,src:t.currentSrc,sameOrigin:t.sameOrigin,parkStrategy:t.parkStrategy,degraded:t.degraded,preloaded:t.preloaded,supportsMoveBefore:A,nudgeCount:t.nudgeCount,lastNudgeAt:t.lastNudgeAt}}function R(){var e=U();t.listeners.forEach(function(r){try{r(e)}catch(n){}})}function ne(e){return t.listeners.add(e),function(){t.listeners.delete(e)}}function te(){return U()}function Ce(e){e!=="offscreen"&&e!=="behind"||t.parkStrategy!==e&&(t.parkStrategy=e,t.frame!==null&&t.owner===null&&_(),R())}function Ne(){return t.parkStrategy}function Le(){var e=t.lastRect;e!==null&&(t.park.style.width=Math.max(1,Math.round(e.width))+"px",t.park.style.height=Math.max(1,Math.round(e.height))+"px")}function _(){if(t.park!==null){if(Le(),t.parkStrategy==="behind"&&t.lastRect!==null){t.park.style.left=Math.round(t.lastRect.left)+"px",t.park.style.top=Math.round(t.lastRect.top)+"px",t.park.style.visibility="visible",t.park.style.zIndex="0";return}t.park.style.left=Oe+"px",t.park.style.top="0px",t.park.style.visibility="hidden",t.park.style.zIndex="0"}}function ae(){t.frame!==null&&(t.frame.setAttribute("inert",""),t.frame.setAttribute("aria-hidden","true"))}function Ae(){t.frame!==null&&(t.frame.removeAttribute("inert"),t.frame.removeAttribute("aria-hidden"))}function Re(){var e=document.createElement("div");e.className="dshcs-park",e.setAttribute("data-dshcs-park",""),e.setAttribute("aria-hidden","true");var r=document.createElement("iframe");return r.className="dshcs-frame",r.setAttribute("title","code-server"),r.setAttribute("allow","clipboard-read; clipboard-write"),r.setAttribute("data-dshcs-resident",""),r.src="about:blank",e.appendChild(r),document.body.appendChild(e),t.park=e,t.frame=r,t.currentSrc="about:blank",t.owner=null,_(),ae(),r}function Me(e){var r=t.frame;if(r!==null){var n=t.sameOrigin!==e;!n&&r.hasAttribute("data-dshcs-attrs")||(e===!0?r.removeAttribute("sandbox"):e===!1&&r.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-pointer-lock allow-clipboard-read allow-clipboard-write"),r.setAttribute("data-dshcs-attrs",e===!0?"same-origin":"cross-origin"),t.sameOrigin=e)}}function F(e){var r=e||{};return t.frame===null&&Re(),typeof r.sameOrigin=="boolean"&&Me(r.sameOrigin),typeof r.src=="string"&&r.src!==""&&r.src!==t.currentSrc&&Te(r.src),t.frame}function Te(e){t.frame===null||typeof e!="string"||e===""||e===t.currentSrc||(t.currentSrc=e,t.frame.src=e,R())}function le(){var e=t.frame;if(t.nudgeEnabled!==!0||e===null||e.isConnected!==!0)return!1;var r=e.style.display;return e.style.display="none",e.offsetHeight,e.style.display=r,t.nudgeCount+=1,t.lastNudgeAt=Date.now(),!0}function Ie(e){return t.nudgeEnabled=e!==!1,t.nudgeEnabled}function se(e){if(t.frame!==null){if(A)try{e.moveBefore(t.frame,null);return}catch(r){t.degraded=!0,t.lastMoveError=(r&&r.name?r.name+": ":"")+(r&&r.message?r.message:String(r))}else t.degraded=!0;e.appendChild(t.frame)}}function B(e,r){if(!(t.frame===null||e==null)){var n=t.owner===null,s=e.getBoundingClientRect();s.width>=1&&s.height>=1&&(t.lastRect={left:s.left,top:s.top,width:s.width,height:s.height}),t.owner=r===void 0?null:r,Ae(),t.park.setAttribute("aria-hidden","true"),se(e),n&&le(),R()}}function M(e){t.frame!==null&&(e!==void 0&&t.owner!==e||(t.owner=null,_(),ae(),t.park.setAttribute("aria-hidden","true"),se(t.park),R()))}function G(e){var r=e||{};return F(r),t.owner===null&&(typeof r.src=="string"&&r.src!==""&&(t.preloaded=!0),M()),t.frame}function De(){t.park!==null&&t.park.parentNode!==null&&t.park.parentNode.removeChild(t.park),t.park=null,t.frame=null,t.currentSrc=null,t.sameOrigin=null,t.owner=null,t.lastRect=null,t.degraded=!1,t.preloaded=!1,t.nudgeCount=0,t.lastNudgeAt=0,R()}typeof window!="undefined"&&(window.__dshcsSurface={snapshot:U,setParkStrategy:Ce,getParkStrategy:Ne,preload:G,dock:B,park:M,nudge:le,setNudgeEnabled:Ie,destroy:De});var a=require("react"),Y=new Set,T={status:null,busy:!1,sidebarUi:"unknown",sidebarRegisterFailed:!1};function E(e){T=Object.assign({},T,e),Y.forEach(function(r){r()})}function je(e){return Y.add(e),function(){Y.delete(e)}}function ze(){return T}function Z(){return a.useSyncExternalStore(je,ze)}var Pe="/api",He="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB2aWV3Qm94PSIwIDAgMTQ3IDE0NyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8c3R5bGU+QG1lZGlhIChwcmVmZXJzLWNvbG9yLXNjaGVtZTogZGFyaykgeyogeyBmaWxsOiB3aGl0ZTsgfX08L3N0eWxlPgogIDxwYXRoIGQ9Im00Mi40MjE0LDM5LjY1NWMtMjQuNDA1NywwIC00Mi4xNTU0LDEzLjE3MjEgLTQyLjE1NTQsMzMuODQ1YzAsMjAuNTgxNCAxOC40ODkyLDMzLjg0NSA0Mi4xNTU0LDMzLjg0NWMyMy42NjYyLDAgMzguMTgwMywtMTEuNjE3MSAzOC43MzQ5LC0yOC43MjI1bC0yMS4wNzc3LC0wLjQ1NzRjLTAuOTI0NCw5LjMzMDMgLTkuMTA1OSwxNS4xODQ1IC0xNy42NTcyLDE1LjE4NDVjLTExLjc0MDYsMCAtMjAuNDMwNiwtNy41OTIyIC0yMC40MzA2LC0xOS44NDk2YzAsLTEyLjI1NzQgOC42OSwtMTkuOTg2OCAyMC40MzA2LC0yMC4yMTU1YzguNTUxMywtMC4xODMgMTYuOTE3Nyw1Ljk0NTcgMTcuNDcyMywxNS4yNzZsMjEuMDc3NywtMC42NDAzYy0wLjQ2MjIsLTE2LjgzMTEgLTE0LjE0NDIsLTI4LjI2NTIgLTM4LjU1LC0yOC4yNjUyem00OC44NDQ2LDJsNTUuNDY4LDBsMCw2NC4wMzExbC01NS40NjgsMGwwLC02NC4wMzExeiIgY2xpcC1ydWxlPSJldmVub2RkIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KPC9zdmc+Cg==";async function k(e,r){var n={method:r===void 0?"GET":"POST",headers:{}};r!==void 0&&(n.headers["content-type"]="application/json",n.body=JSON.stringify(r));var s=await fetch(Pe+e,n),l=await s.text(),i=null;try{i=l===""?null:JSON.parse(l)}catch(d){i=null}return s.ok?i!==null?i:{ok:!1,error:"invalid JSON response"}:{ok:!1,error:"HTTP "+s.status+(i!==null&&i.error!==void 0?": "+i.error:"")}}function pe(e,r){try{var n=e(function(v){return v}),s=r===null?null:typeof r=="function"?r(function(v){return v}):null,l=n!=null?n.current:void 0;if(l!==void 0&&n!=null&&n.byId!=null){var i=n.byId[l];if(i!=null&&typeof i.cwd=="string"&&i.cwd!=="")return i.cwd}var d=s!=null&&Array.isArray(s.items)?s.items:[];if(l!==void 0)for(var f=0;f<d.length;f++){var p=d[f];if(p.sessionIds!=null&&p.sessionIds.indexOf(l)!==-1&&typeof p.path=="string"&&p.path!=="")return p.path}var c=s!=null?s.recentWorkspaceId:void 0;if(c!==void 0){for(var u=0;u<d.length;u++)if(d[u].workspaceId===c&&typeof d[u].path=="string"&&d[u].path!=="")return d[u].path}if(d.length>0&&typeof d[0].path=="string"&&d[0].path!=="")return d[0].path}catch(v){}}function ve(e,r){if(e==null||typeof e.url!="string"||e.url==="")return null;var n=e.pid!=null?String(e.pid):e.startedAt!=null?String(e.startedAt):"0",s=e.url+"?s="+encodeURIComponent(n),l=typeof r=="string"&&r!==""?r:e!=null&&e.cwd!=null?e.cwd:null;if(l==null||l==="")return s;var i=l.replace(/\\/g,"/"),d=i;return(/^[A-Za-z]:\//.test(i)||i.charCodeAt(0)!==47)&&(d="/"+i),s+"&folder="+encodeURIComponent(d)}function Ue(e){var r=e.status,n=e.pageUrl,s=e.reloadTick,l=e.owner,i=a.useRef(null),d=r!=null&&r.ok===!0&&r.running===!0,f=r!=null&&r.status==="starting",p=r!=null&&r.ok===!1,c=r!=null&&r.serve==="dsh";if(a.useLayoutEffect(function(){if(!d||n===null){M(l);return}F({src:n,sameOrigin:c}),i.current!==null&&B(i.current,l)},[d,n,c,s,l]),a.useLayoutEffect(function(){return function(){M(l)}},[l]),d&&n!==null)return a.createElement("div",{ref:i,className:"dshcs-slot","data-code-server-slot":l!=null?l:"code-server"});if(f)return a.createElement("div",{className:"dshcs-loading"},"\u6B63\u5728\u542F\u52A8 code-server\u2026");var u=p&&r!=null&&r.error?r.error:"code-server \u672A\u8FD0\u884C",v=c?"\u5F53\u524D\u4EE5 DSH \u540C\u6E90\u8DEF\u5F84 "+(r!=null&&r.url||"/code-server/")+" \u63D0\u4F9B(\u65E0\u72EC\u7ACB\u7AEF\u53E3)\u3002":"\u5F53\u524D\u4EE5\u72EC\u7ACB\u56DE\u73AF\u7AEF\u53E3\u63D0\u4F9B(\u7AEF\u53E3 "+(r!=null&&r.port!=null?r.port:"8090")+" \u88AB\u5360\u7528\u65F6\u8BF7\u91CA\u653E\u6216\u4FEE\u6539 port \u914D\u7F6E)\u3002",S=A?"\u5E38\u9A7B\u9762:\u53EF\u7528(\u5207\u6807\u7B7E/\u6536\u8D77\u4FA7\u680F\u4E0D\u91CD\u8F7D)\u3002":"\u5E38\u9A7B\u9762:\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 Element.moveBefore \u2014\u2014 \u5207\u6807\u7B7E\u4F1A\u6574\u9875\u91CD\u8F7D(\u5347\u7EA7\u6D4F\u89C8\u5668\u540E\u81EA\u52A8\u53EF\u7528)\u3002";return a.createElement("div",{className:"dshcs-empty"},a.createElement("div",{className:"dshcs-emptybox"},a.createElement("div",null,p?"code-server \u542F\u52A8\u5931\u8D25":"code-server \u672A\u8FD0\u884C"),a.createElement("pre",{className:"dshcs-error"},u),a.createElement("p",{className:"dshcs-hint"},"VS Code \u6811\u968F\u63D2\u4EF6\u5305\u5185\u7F6E\u3001\u5C31\u5730\u8FD0\u884C(\u65E0\u9700\u5168\u5C40\u5B89\u88C5\u3001\u65E0\u9700\u8054\u7F51\u5B89\u88C5\u3001\u65E0\u300C\u5B89\u88C5\u73AF\u5883\u300D\u6B65\u9AA4);\u5185\u90E8\u4F9D\u8D56\u4E0E\u9884\u7F16\u8BD1\u539F\u751F\u6A21\u5757\u7531\u5305\u7BA1\u7406\u5668\u5728\u5B89\u88C5\u63D2\u4EF6\u65F6\u4E00\u5E76\u88C5\u597D(\u65E0\u9700 C++ \u5DE5\u5177\u94FE)\u3002\u82E5\u6B64\u5904\u957F\u671F\u672A\u8FD0\u884C,\u8BF7\u67E5\u770B DSH host \u65E5\u5FD7\u91CC\u7684 [code-server] \u8F93\u51FA(\u6216\u5728\u8BBE\u7F6E\u5361\u7247\u91CC\u5207\u6362\u300C\u540E\u53F0\u5E38\u9A7B\u300D\u89E6\u53D1\u4E00\u6B21\u542F\u52A8)\u3002"+v+S)))}function _e(e){var r=Z(),n=r.status,s=n!=null&&n.ok===!0&&n.running===!0,l=n!=null&&n.keepResident===!0,i=pe(e&&e.useSessions,e&&e.useWorkspaces),d=s?ve(n,i):null;return a.useEffect(function(){!l||!s||d===null||G({src:d,sameOrigin:n!=null&&n.serve==="dsh"})},[l,s,d,n!=null?n.serve:null]),null}var Fe=".dshcs-frame{display:block;position:absolute;inset:0;z-index:1;width:100%;height:100%;border:0;background:var(--dsw-alias-bg-base,#fff)}.dshcs-tabroot{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-width:0;min-height:0;background:var(--dsw-alias-bg-base,#fff)}.dshcs-slot{position:relative;display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;background:var(--dsw-alias-bg-base,#fff)}.dshcs-park{position:fixed;left:-20000px;top:0;width:320px;height:200px;overflow:hidden;pointer-events:none;z-index:0;visibility:hidden;contain:strict}.dshcs-loading{position:absolute;inset:0;z-index:2;display:grid;place-items:center;background:var(--dsw-alias-bg-base,#fff);color:var(--dsw-alias-label-tertiary,#7d8798);font-size:13px}.dshcs-empty{position:relative;z-index:2;flex:1;display:flex;align-items:center;justify-content:center;padding:44px 24px 24px}.dshcs-emptybox{max-width:560px;text-align:left;background:var(--dsw-alias-bg-layer-2,#f7f8fb);border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:12px;padding:16px 18px}.dshcs-error{color:var(--dsw-alias-label-error,#d92d20);white-space:pre-wrap;word-break:break-all;font-family:ui-monospace,Consolas,monospace;font-size:12px;margin:8px 0 0}.dshcs-hint{color:var(--dsw-alias-label-tertiary,#7d8798);font-size:12px;margin:6px 0 0}.dshcs-legacy{color:var(--dsw-alias-label-warning,#b54708);font-size:12px;font-weight:600;margin:0 0 6px}",ie="dsh-code-server/styles";typeof document!="undefined"&&document.querySelector("style[data-dshcs="+JSON.stringify(ie)+"]")===null&&(j=document.createElement("style"),j.setAttribute("data-dshcs",ie),j.textContent=Fe,document.head.appendChild(j));var j,de="code-server",ce="dsh-code-server-app",Be=2500,Ge=1e4,Qe=1500;function We(e){var r=e!=null&&typeof e.size=="number"?e.size:16;return a.createElement("img",{src:He,alt:"","aria-hidden":!0,draggable:!1,className:e!=null?e.className:void 0,style:{width:r,height:r,display:"block",objectFit:"contain",WebkitUserDrag:"none",userSelect:"none"}})}function Ye(){var e=T.status;return e!=null&&e.fileOpenScope==="all"?"all":X}function Ze(e,r){try{var n=e(function(l){return l});if(n!=null&&r!=null&&n.byId!=null){var s=n.byId[r];if(s!=null&&typeof s.cwd=="string"&&s.cwd!=="")return s.cwd}}catch(l){}}function Je(e){var r=e.useTabInfo(),n=r.tab,s=Z(),l=s.status,i=n.navigation,d=i!=null&&typeof i.revision=="number"?i.revision:0,f=i!=null&&typeof i.address=="string"?i.address:"",p=H(f)?null:D(f),c=Ze(e.useSessions,p!=null?p.sessionId:void 0),u=c!==void 0?c:pe(e.useSessions,null),v=$(p,u),S=i!=null&&i.params!=null&&typeof i.params.line=="number"?i.params.line:null,o=a.useRef(void 0),[m,h]=a.useState(0),w=a.useRef(null),N=a.useRef(!1),I=r.tab!=null&&r.tab.visible===!0,O=r.sidebar!=null&&r.sidebar.fullscreen===!0,z=l!=null&&l.fullscreenOnOpen!==!1;return a.useLayoutEffect(function(){if(!I){N.current=!1;return}if(!(!z||O||N.current)){N.current=!0;var x=re(w.current);x!=="clicked"&&console.warn("[code-server] \u672A\u80FD\u81EA\u52A8\u5207\u5230\u5168\u5C4F\u53F3\u4FA7\u680F("+x+");\u672C\u6B21\u6253\u5F00\u4FDD\u6301\u539F\u6A21\u5F0F")}},[I,O,z]),a.useEffect(function(){if(!(typeof u!="string"||u==="")&&o.current!==u){var x=o.current!==void 0;o.current=u;var g=!1;return k("/code-server/start",{cwd:u}).then(function(C){g||(E({status:C}),x&&C!=null&&C.ok===!0&&C.running===!0&&h(function(L){return L+1}))}).catch(function(){}),function(){g=!0}}},[u]),a.useEffect(function(){k("/code-server/status").then(function(g){g!=null&&E({status:g})}).catch(function(){});var x=window.setInterval(function(){k("/code-server/status").then(function(g){E({status:g})}).catch(function(){})},3e3);return function(){window.clearInterval(x)}},[]),a.useEffect(function(){v!==null&&k("/code-server/open-file",S===null?{file:v}:{file:v,line:S}).catch(function(){})},[d,v,S]),a.createElement("div",{className:"dshcs-tabroot","data-code-server-tab":"body",ref:w},a.createElement(Ue,{status:l,pageUrl:ve(l,u),reloadTick:m,owner:"tab:"+n.id}))}function Q(e,r){if(e==null)return null;var n=e[r];if(n!=null)return n;if(typeof e.get=="function"){var s=e.get(r);if(s!=null)return s}return null}function Ve(e){var r=Q(e,"sidebarRightTabs"),n=Q(e,"sidebarRight");if(r==null||n==null)return console.error("[code-server] \u53F3\u4FA7\u680F\u670D\u52A1\u4E0A\u4E0B\u6587\u4E0D\u53EF\u89C1(sidebarRightTabs="+(r!=null)+", sidebarRight="+(n!=null)+"):\u8DF3\u8FC7\u4FA7\u680F\u6CE8\u518C"),!1;var s=Q(e,"slots");if(e.effect(function(){return r.register({id:ce,kind:de,priority:"extension",patterns:["dsh-resource://file/**"],canOpen:function(l){return ee(D(l),Ye())},title:function(l){if(H(l)||l===void 0||l===null||l==="")return"Code Server";var i=K(l);return i===""?"Code Server":i},guide:[{order:20,title:function(){return"Code Server"},description:function(){return"\u5728\u53F3\u4FA7\u680F\u6807\u7B7E\u91CC\u8FD0\u884C VS Code \u7F51\u9875\u7248,\u8DDF\u968F\u5F53\u524D\u4F1A\u8BDD\u5DE5\u4F5C\u533A;\u4EA7\u7269/\u4EA4\u4ED8\u6587\u4EF6\u70B9\u51FB\u540E\u5728\u6B64\u6253\u5F00\u3002"},icon:We}]})},"code-server: sidebar tab type"),s!=null)e.effect(function(){return s.inject("sidebar.right.pane.tab",function(){return s.register({name:"sidebar.right.pane.tab",key:ce},Je)})},"code-server: sidebar tab body");else return console.error("[code-server] slots \u670D\u52A1\u4E0D\u53EF\u89C1:\u4FA7\u680F\u6807\u7B7E body \u672A\u6CE8\u518C"),!1;return e.effect(function(){return function(){E({sidebarUi:"unknown"})}},"code-server: sidebar mode reset"),console.log("[code-server] right-sidebar tab registered (kind="+de+")"),!0}var Xe=".dshcs-card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.dshcs-card:hover{border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardHeader{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}.dshcs-cardHeader:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.dshcs-cardHeadText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.dshcs-cardName{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.dshcs-cardDescription{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));font-size:13px;line-height:1.5}.dshcs-cardChevron{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));flex:none;transition:transform .16s;display:inline-flex}.dshcs-cardChevronOpen{transform:rotate(180deg)}.dshcs-cardBody{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.dshcs-cardReadOnly{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:12px 0 0;font-size:12px;line-height:1.5}.dshcs-pending{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-cardFooter{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}.dshcs-cardFailed{min-width:0;color:var(--dsw-alias-label-error,var(--dsw-alias-state-error-primary));flex:1;margin:0;font-size:12px;line-height:1.5}.dshcs-cbtn{appearance:none;font:inherit;cursor:pointer;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5;border:1px solid transparent;transition:color .12s ease,background .12s ease}.dshcs-cbtn:disabled{opacity:.4;cursor:default}.dshcs-cbtn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.dshcs-cbtnOutline{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}.dshcs-cbtnOutline:hover:not(:disabled){color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover,transparent)}.dshcs-cbtnPrimary{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3);border-color:var(--dsw-alias-label-primary);font-weight:600}.dshcs-cbtnPrimary:hover:not(:disabled){filter:brightness(.95)}.dshcs-cbtnPrimary:active:not(:disabled){filter:brightness(.9)}.dshcs-field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.dshcs-field+.dshcs-field{border-top:1px solid var(--dsw-alias-border-l2)}.dshcs-fieldHead{align-items:center;gap:8px;display:flex}.dshcs-fieldLabel{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.dshcs-card .dshcs-hint{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:0;font-size:12px;line-height:1.5}.dshcs-check{display:flex;align-items:center;gap:8px;cursor:pointer}.dshcs-check input{accent-color:var(--dsw-alias-brand-primary);width:15px;height:15px;margin:0;flex:none}.dshcs-check input:disabled{cursor:default}.dshcs-select{display:inline-flex;align-items:center}.dshcs-select select{font:inherit;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-3,transparent);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;padding:4px 8px;min-width:220px;cursor:pointer}.dshcs-select select:disabled{opacity:.5;cursor:default}.dshcs-badges{align-items:center;gap:8px;display:inline-flex}.dshcs-badge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}.dshcs-reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.dshcs-reset:disabled{cursor:default}",qe="dsh-code-server/Card.module.css";function Ke(e,r){if(typeof document!="undefined"&&document.querySelector("style[data-plugin-css="+JSON.stringify(e)+"]")===null){var n=document.createElement("style");n.dataset.plugin="dsh-code-server",n.dataset.pluginCss=e,n.textContent=r,document.head.appendChild(n)}}Ke(qe,Xe);function $e(e){return a.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,className:e.className},a.createElement("path",{d:"M3.5 5.25L7 8.75L10.5 5.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))}function oe(e){return a.createElement("button",{type:"button",className:"dshcs-cbtn "+(e.variant==="primary"?"dshcs-cbtnPrimary":"dshcs-cbtnOutline"),disabled:e.disabled===!0,onClick:e.onClick},e.children)}function ue(e){return a.createElement("label",{className:"dshcs-check"},a.createElement("input",{type:"checkbox",checked:e.checked===!0,disabled:e.disabled===!0,onChange:function(r){e.onChange(r.target.checked)}}),a.createElement("span",{className:"dshcs-hint"},e.children))}function er(e){var r=Array.isArray(e.options)?e.options:[];return a.createElement("label",{className:"dshcs-select"},a.createElement("select",{value:e.value,disabled:e.disabled===!0,onChange:function(n){e.onChange(n.target.value)}},r.map(function(n){return a.createElement("option",{key:n.value,value:n.value},n.label)})))}function W(e){var r=[];return e.overridden===!0&&(r.push(a.createElement("span",{className:"dshcs-badge"},e.overriddenLabel)),r.push(a.createElement("button",{type:"button",className:"dshcs-reset",disabled:e.disabled===!0,onClick:e.onReset},e.resetLabel))),r.length===0?null:a.createElement("span",{className:"dshcs-badges"},...r)}function fe(e){var[r,n]=a.useState(e.defaultOpen===!0),s=e.state;if(s==null||s.available!==!0)return null;var l=e.title,i=e.noticeOnly===!0,d=s.dirty!==!0||s.invalid===!0||s.saving===!0;return a.createElement("li",{className:"dshcs-card"+(r?" dshcs-cardOpen":"")},a.createElement("button",{type:"button",className:"dshcs-cardHeader","aria-expanded":r,onClick:function(){n(!r)}},a.createElement("span",{className:"dshcs-cardHeadText"},a.createElement("span",{className:"dshcs-cardName"},l),a.createElement("span",{className:"dshcs-cardDescription"},e.description)),s.dirty===!0?a.createElement("span",{className:"dshcs-pending"},e.unsavedLabel):null,a.createElement($e,{className:"dshcs-cardChevron"+(r?" dshcs-cardChevronOpen":"")})),r===!0?a.createElement("div",{className:"dshcs-cardBody"},i===!0?null:s.writable!==!0?a.createElement("p",{className:"dshcs-cardReadOnly",role:"status"},e.readOnlyLabel):null,e.children,i===!0?null:a.createElement("div",{className:"dshcs-cardFooter"},s.failed===!0?a.createElement("p",{className:"dshcs-cardFailed",role:"status"},e.saveFailedLabel):null,a.createElement(oe,{disabled:s.dirty!==!0||s.saving===!0,onClick:e.onDiscard},e.discardLabel),a.createElement(oe,{variant:"primary",disabled:d,onClick:e.onSave},s.saving===!0?e.savingLabel:e.saveLabel))):null)}function rr(e){try{let g=function(){k("/code-server/status").then(function(b){b!=null&&typeof b=="object"&&E({status:b})}).catch(function(){})};var r=e.scope,[n,s]=a.useState(function(){return r!==void 0?r.getSnapshot():null}),[l,i]=a.useState(null),[d,f]=a.useState(!1),[p,c]=a.useState(!1),u=Z(),[v,S]=a.useState(te());if(a.useEffect(function(){return ne(function(b){S(b)})},[]),a.useEffect(function(){if(r===void 0||typeof r.subscribe!="function")return;function b(){try{s(r.getSnapshot())}catch(ir){}}var y=r.subscribe(b);return function(){typeof y=="function"&&y()}},[r]),r===void 0)return console.error("[code-server] card scope missing"),null;if(n==null||n.status!=="ready")return n!=null&&n.status==="unavailable"&&console.warn("[code-server] settings scope unavailable:",n.status),null;var o=n.value!==void 0&&n.value!==null?n.value:{},m=n.user,h={keepResident:o.keepResident!==!1,fileOpenScope:o.fileOpenScope==="all"?"all":"session",fullscreenOnOpen:o.fullscreenOnOpen!==!1};if(u!=null&&u.sidebarUi==="legacy")return a.createElement(fe,{title:"Code Server",description:"\u5F53\u524D DSH \u7248\u672C\u4E0D\u53D7\u652F\u6301(\u7F3A\u5C11\u53F3\u4FA7\u680F\u670D\u52A1)",defaultOpen:!0,noticeOnly:!0,state:{available:!0,writable:!1,dirty:!1,invalid:!1,saving:!1,failed:!1}},a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-legacy"},"\u672C\u63D2\u4EF6\u81EA 0.2.3 \u8D77\u4E0D\u518D\u517C\u5BB9\u65E7\u7248 DSH\u3002"),a.createElement("div",{className:"dshcs-hint",style:{marginTop:0}},`\u672A\u68C0\u6D4B\u5230\u53F3\u4FA7\u680F\u63D2\u4EF6\u670D\u52A1 sidebarRightTabs / sidebarRight,\u56E0\u6B64\u63D2\u4EF6\u4E0D\u63D0\u4F9B\u4EFB\u4F55\u5165\u53E3(\u65E7\u7248\u7684\u60AC\u6D6E\u7403\u4E0E\u6D6E\u52A8\u7A97\u53E3\u5DF2\u79FB\u9664),\u4E5F\u4E0D\u4F1A\u540E\u53F0\u542F\u52A8 IDE\u3002
3
3
  \u5347\u7EA7 DSH \u5230\u5E26\u53F3\u4FA7\u680F\u7684\u7248\u672C(\u2265 0.1.5-alpha.1)\u540E,Code Server \u4F1A\u51FA\u73B0\u5728\u53F3\u4FA7\u680F\u6807\u7B7E\u91CC,\u672C\u9875\u540C\u65F6\u663E\u793A\u5B8C\u6574\u8BBE\u7F6E\u9879;\u5347\u7EA7\u540E\u65E0\u9700\u91CD\u88C5\u672C\u63D2\u4EF6,\u5237\u65B0\u9875\u9762\u5373\u53EF\u3002`)));var w=m!=null&&Object.prototype.hasOwnProperty.call(m,"keepResident"),N=m!=null&&Object.prototype.hasOwnProperty.call(m,"fileOpenScope"),I=m!=null&&Object.prototype.hasOwnProperty.call(m,"fullscreenOnOpen"),O=l!==null&&(l.keepResident!==h.keepResident||l.fileOpenScope!==h.fileOpenScope||l.fullscreenOnOpen!==h.fullscreenOnOpen),z=!O||d,x={available:!0,writable:n.writable,dirty:O,invalid:!1,saving:d,failed:p};async function C(){if(O&&!d){f(!0),c(!1);try{var b=l!==null?l:h;await e.scope.set("keepResident",b.keepResident===!0),await e.scope.set("fileOpenScope",b.fileOpenScope==="all"?"all":"session"),await e.scope.set("fullscreenOnOpen",b.fullscreenOnOpen===!0),i(null),g()}catch(y){c(!0)}f(!1)}}async function L(){if(!(d||n.writable!==!0)){f(!0),c(!1);try{typeof e.scope.unset=="function"?(await e.scope.unset("keepResident"),await e.scope.unset("fileOpenScope"),await e.scope.unset("fullscreenOnOpen")):(await e.scope.set("keepResident",o.keepResident===void 0||o.keepResident===null?!0:o.keepResident),await e.scope.set("fileOpenScope",o.fileOpenScope==="all"?"all":"session"),await e.scope.set("fullscreenOnOpen",o.fullscreenOnOpen===void 0||o.fullscreenOnOpen===null?!0:o.fullscreenOnOpen)),i(null),g()}catch(b){c(!0)}f(!1)}}return a.createElement(fe,{title:"Code Server",description:"\u5165\u53E3:\u53F3\u4FA7\u680F\u6807\u7B7E(DSH \u2265 0.1.5-alpha.1);\u8BA4\u9886\u8303\u56F4\u51B3\u5B9A\u54EA\u4E9B\u6587\u4EF6\u4EA4\u7ED9 Code Server \u6253\u5F00",state:x,unsavedLabel:"\u672A\u4FDD\u5B58",readOnlyLabel:"\u672C\u90E8\u7F72\u7684\u8BBE\u7F6E\u4E3A\u53EA\u8BFB\u3002",saveFailedLabel:"\u672C\u90E8\u7F72\u6CA1\u6709\u63A5\u53D7\u8FD9\u4E9B\u503C\uFF0C\u5DF2\u4FDD\u7559\u4F9B\u4F60\u4FEE\u6539\u3002",discardLabel:"\u653E\u5F03\u4FEE\u6539",saveLabel:"\u4FDD\u5B58",savingLabel:"\u4FDD\u5B58\u4E2D\u2026",onSave:C,onDiscard:function(){i(null),c(!1)}},a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-fieldHead"},a.createElement("span",{className:"dshcs-fieldLabel"},"\u8BA4\u9886\u8303\u56F4(\u54EA\u4E9B\u6587\u4EF6\u4EA4\u7ED9 Code Server)"),N===!0?a.createElement(W,{overridden:!0,disabled:n.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){L()}}):null),a.createElement(er,{value:l!==null?l.fileOpenScope:h.fileOpenScope,disabled:n.writable!==!0,options:[{value:"session",label:"\u4EC5\u4F1A\u8BDD\u5185\u6587\u4EF6(\u63A8\u8350)"},{value:"all",label:"\u6240\u6709\u6587\u4EF6(\u542B\u5DE5\u4F5C\u533A\u5916\u7684\u7EDD\u5BF9\u8DEF\u5F84)"}],onChange:function(b){i(function(y){return Object.assign({},y!==null?y:h,{fileOpenScope:b==="all"?"all":"session"})}),c(!1)}}),a.createElement("div",{className:"dshcs-hint",style:{marginTop:4}},"\u4F1A\u8BDD\u5185\u6587\u4EF6 = DSH \u7528 `dsh-resource://file/session/\u2026` \u547D\u540D\u7684\u6587\u4EF6(\u4EA7\u7269\u3001\u4EA4\u4ED8\u3001\u6B63\u6587\u63D0\u53CA\u3001\u5DE5\u5177\u89C6\u56FE);\u201C\u6240\u6709\u6587\u4EF6\u201D\u8FD8\u4F1A\u8BA4\u9886\u4E0D\u5E26\u4F1A\u8BDD\u7684\u7EDD\u5BF9\u8DEF\u5F84 `dsh-resource://file/absolute/\u2026`\u3002\u672A\u88AB\u8BA4\u9886\u7684\u5730\u5740\u7531 DSH \u81EA\u5E26\u9884\u89C8\u515C\u5E95\u3002")),a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-fieldHead"},a.createElement("span",{className:"dshcs-fieldLabel"},"\u6253\u5F00\u5373\u5168\u5C4F(\u53F3\u4FA7\u680F\u94FA\u6EE1\u7A97\u53E3)"),I===!0?a.createElement(W,{overridden:!0,disabled:n.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){L()}}):null),a.createElement(ue,{checked:l!==null?l.fullscreenOnOpen:h.fullscreenOnOpen,disabled:n.writable!==!0,onChange:function(b){i(function(y){return Object.assign({},y!==null?y:h,{fullscreenOnOpen:b===!0})}),c(!1)}},'\u6253\u5F00 Code Server \u6807\u7B7E(\u542B\u70B9\u5F00\u4EA7\u7269/\u4EA4\u4ED8\u6587\u4EF6)\u65F6,\u81EA\u52A8\u628A\u53F3\u4FA7\u680F\u4ECE"\u4E0E\u5BF9\u8BDD\u5E76\u6392"\u5207\u5230\u5168\u5C4F;\u60F3\u540C\u65F6\u770B\u5BF9\u8BDD\u5C31\u5173\u6389\u5B83,\u6216\u968F\u65F6\u70B9\u53F3\u4FA7\u680F\u7684\u300C\u9000\u51FA\u5168\u5C4F\u300D\u2014\u2014 \u672C\u6B21\u6253\u5F00\u4E0D\u4F1A\u88AB\u62A2\u56DE\u53BB'),a.createElement("div",{className:"dshcs-hint",style:{marginTop:4}},'\u53EA\u5F71\u54CD"\u6253\u5F00\u90A3\u4E00\u523B":\u5207\u8D70\u518D\u5207\u56DE\u3001\u518D\u6B21\u6253\u5F00\u6587\u4EF6 tab \u4F1A\u91CD\u65B0\u5207\u5168\u5C4F;DSH \u672A\u5411\u63D2\u4EF6\u5F00\u653E\u6A21\u5F0F\u63A5\u53E3,\u672C\u9879\u7531\u70B9\u51FB\u53F3\u4FA7\u680F\u81EA\u8EAB\u7684\u300C\u5168\u5C4F\u300D\u6309\u94AE\u5B9E\u73B0\u3002')),a.createElement("div",{className:"dshcs-field"},a.createElement("div",{className:"dshcs-fieldHead"},a.createElement("span",{className:"dshcs-fieldLabel"},"\u540E\u53F0\u5E38\u9A7B(\u5207\u6807\u7B7E\u4E0D\u91CD\u8F7D)"),w===!0?a.createElement(W,{overridden:!0,disabled:n.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){L()}}):null),a.createElement(ue,{checked:l!==null?l.keepResident:h.keepResident,disabled:n.writable!==!0,onChange:function(b){i(function(y){return Object.assign({},y!==null?y:h,{keepResident:b===!0})}),c(!1)}},'\u5F00\u542F\u540E\u5BBF\u4E3B\u542F\u52A8\u5373\u628A IDE \u52A0\u8F7D\u5230\u540E\u53F0"\u505C\u653E\u533A":\u5207\u6362\u53F3\u4FA7\u680F\u6807\u7B7E\u3001\u6536\u8D77/\u5C55\u5F00\u4FA7\u680F\u3001\u62D6\u6210\u6D6E\u52A8\u7A97\u53E3\u90FD\u4E0D\u518D\u91CD\u8F7D,\u9996\u6B21\u6253\u5F00\u514D\u7B49\u5F85;\u5173\u95ED\u5219\u53EA\u5728\u6253\u5F00\u9762\u677F\u65F6\u52A0\u8F7D(\u7701\u5185\u5B58)'),a.createElement("div",{className:"dshcs-hint",style:{marginTop:4}},A?"\u5E38\u9A7B\u9762:"+(v.docked?"\u5DF2\u505C\u9760":v.ready?"\u5DF2\u505C\u653E(\u540E\u53F0\u8FD0\u884C\u4E2D)":"\u672A\u542F\u52A8")+(v.degraded?" \xB7 \u672C\u6B21\u53D1\u751F\u8FC7\u964D\u7EA7\u91CD\u8F7D":""):"\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 Element.moveBefore(Chromium <133)\u2192 \u5E38\u9A7B\u4E0D\u53EF\u7528,\u5207\u6807\u7B7E\u4ECD\u4F1A\u6574\u9875\u91CD\u8F7D(\u5347\u7EA7\u6D4F\u89C8\u5668\u540E\u81EA\u52A8\u751F\u6548)")))}catch(g){return console.error("[code-server] card render error:",g!=null&&g.message!==void 0?g.message:String(g)),null}}function nr(e){try{tr(e)}catch(r){console.error("[code-server] apply failed:",r&&r.stack?r.stack:String(r));try{document.title="CS-ERR "+(r&&r.message||String(r))}catch(n){}}}function tr(e){var r=e.get("slots");if(r===void 0){console.error("[code-server] slots service unavailable");return}var n=e.settingsScope,s=null;if(n!==void 0&&typeof n.bind=="function")s=n.bind({namespace:"code-server"});else{console.error("[code-server] settingsScope unavailable (inject missing?); settings card disabled");return}k("/code-server/status").then(function(o){E({status:o})}).catch(function(){}),r.inject("settings.plugin.item",()=>r.register({name:"settings.plugin.item",key:"code-server",label:"Code Server",inject:function(){return{scope:s}}},rr));var l=!1;function i(o,m){if(!l){l=!0,u();var h=!1;try{h=Ve(o)}catch(w){console.error("[code-server] sidebar tab registration failed:",w!=null&&w.message!=null?w.message:String(w))}T.sidebarUi==="legacy"&&(console.log("[code-server] \u53F3\u4FA7\u680F\u670D\u52A1\u665A\u5230(\u7ECF "+m+"):\u64A4\u9500\u65E7\u7248 DSH \u5224\u5B9A"),k("/code-server/ui-mode",{sidebar:!0}).catch(function(){})),E({sidebarUi:"modern",sidebarRegisterFailed:h!==!0}),r.inject("shell.overlay",()=>r.register({name:"shell.overlay",id:"code-server",order:70,label:"Code Server"},w=>a.createElement(_e,w))),console.log("[code-server] client registered via "+m+": sidebar tab="+h+"(claims dsh-resource://file/**) + resident preload + settings card")}}function d(o){E({sidebarUi:"legacy"}),console.warn("[code-server] \u672A\u63A2\u6D4B\u5230\u53F3\u4FA7\u680F\u670D\u52A1(sidebarRightTabs/sidebarRight): \u672C\u63D2\u4EF6\u81EA 0.2.3 \u8D77\u4E0D\u518D\u517C\u5BB9\u65E7\u7248 DSH \u2014\u2014 \u9664\u300C\u8BBE\u7F6E \u2192 \u63D2\u4EF6 \u2192 Code Server\u300D\u7684\u63D0\u793A\u5916\u4E0D\u63D0\u4F9B\u4EFB\u4F55\u5165\u53E3,\u4E5F\u4E0D\u9884\u70ED IDE\u3002\u8BF7\u5347\u7EA7 DSH\u3002"),o===!0&&k("/code-server/ui-mode",{sidebar:!1}).catch(function(){})}var f=null,p=null,c=null;function u(){f!==null&&(clearTimeout(f),f=null),p!==null&&(clearTimeout(p),p=null),c!==null&&(clearTimeout(c),c=null)}var v=!1;try{typeof e.inject=="function"&&(v=!0,e.inject(["sidebarRightTabs","sidebarRight"],function(o){i(o,"inject")}))}catch(o){console.warn("[code-server] sidebar inject failed:",o!=null&&o.message!=null?o.message:String(o))}var S=typeof e.get=="function"&&e.get("sidebarRightTabs")!==void 0&&e.get("sidebarRight")!==void 0;if(S){c=setTimeout(function(){l||(console.warn("[code-server] ctx.inject \u672A\u5728 1.5s \u5185\u56DE\u8C03,\u6539\u7528\u540C\u6B65\u670D\u52A1\u6CE8\u518C\u4FA7\u680F"),i(e,"sync-fallback"))},Qe);return}if(v!==!0){d(!0);return}f=setTimeout(function(){l||d(!1)},Be),p=setTimeout(function(){l||d(!0)},Ge)}var ar=["slots","settingsScope"],lr="code-server";
4
4
  return module.exports;}});
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-code-server-app",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "description": "VS Code (from a code-server release) inside DSH: a right-sidebar tab driven by the plugin's own launcher over the in-process VS Code server (lib/launcher.mjs). The tab claims DSH file addresses (dsh-resource://file/**), so the product's own produced-file chips, delivered-file previews and inline prose mentions open in the workbench. The IDE is a resident surface moved with Element.moveBefore instead of being remounted, so switching sidebar tabs no longer reloads it. Opening the tab switches the right sidebar to fullscreen by default (setting fullscreenOnOpen). Requires a DSH with the right-sidebar services (sidebarRightTabs/sidebarRight, >= 0.1.5-alpha.1); older DSH versions get a single upgrade notice on the settings page and no other UI. Two serving modes: loopback port (default) or same-origin mount on DSH's own webServer (/code-server, protected by ctx.connection.requestRejection). No code-server Node layer, no argon2, no C++ toolchain.",
5
5
  "homepage": "https://github.com/jinsiyu/dsh-code-server-app",
6
6
  "repository": {
@@ -3,7 +3,7 @@
3
3
  "vscodeVersion": "1.136.1",
4
4
  "productPath": "stable-8d5f383f301ca20681f5b6606b8207d9dc87bdd8",
5
5
  "layout": "vscode-only",
6
- "preparedAt": "2026-09-11T12:32:08.038Z",
6
+ "preparedAt": "2026-09-11T12:34:21.276Z",
7
7
  "source": "registry",
8
8
  "node": "v24.13.1",
9
9
  "platform": "win32",