@lemoncat7/dsh-ssh 1.3.14 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/lib/client.d.ts +1 -1
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +3 -3
- package/lib/client.js.map +2 -2
- package/lib/file-transfer-tools.js +6 -6
- package/lib/file-transfer-tools.js.map +1 -1
- package/lib/project-session-dialog.d.ts +1 -1
- package/lib/project-session-dialog.d.ts.map +1 -1
- package/lib/project-session-dialog.js +1 -1
- package/lib/project-session-dialog.js.map +1 -1
- package/lib/remote-workspace-tree.d.ts +1 -1
- package/lib/remote-workspace-tree.d.ts.map +1 -1
- package/lib/sftp-client.js +1 -1
- package/lib/sftp-client.js.map +1 -1
- package/lib/tools.js +5 -9
- package/lib/tools.js.map +1 -1
- package/lib/ui-components.js +1 -1
- package/lib/ui-components.js.map +1 -1
- package/package.json +30 -18
package/lib/client.js
CHANGED
|
@@ -35,7 +35,7 @@ WARNING: This link could potentially be dangerous`)){let d=window.open();if(d){t
|
|
|
35
35
|
`))+1))}let n="#".repeat(o),a=s.enter("headingAtx"),h=s.enter("phrasing");i.move(n+" ");let l=s.containerPhrasing(e,{before:"# ",after:`
|
|
36
36
|
`,...i.current()});return/^[\t ]/.test(l)&&(l=gs(l.charCodeAt(0))+l.slice(1)),l=l?n+" "+l:n,s.options.closeAtx&&(l+=" "+n),h(),a(),l}sa.peek=cb;function sa(e){return e.value||""}function cb(){return"<"}ra.peek=db;function ra(e,t,s,r){let o=fr(s),i=o==='"'?"Quote":"Apostrophe",n=s.enter("image"),a=s.enter("label"),h=s.createTracker(r),l=h.move("![");return l+=h.move(s.safe(e.alt,{before:l,after:"]",...h.current()})),l+=h.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=s.enter("destinationLiteral"),l+=h.move("<"),l+=h.move(s.safe(e.url,{before:l,after:">",...h.current()})),l+=h.move(">")):(a=s.enter("destinationRaw"),l+=h.move(s.safe(e.url,{before:l,after:e.title?" ":")",...h.current()}))),a(),e.title&&(a=s.enter(`title${i}`),l+=h.move(" "+o),l+=h.move(s.safe(e.title,{before:l,after:o,...h.current()})),l+=h.move(o),a()),l+=h.move(")"),n(),l}function db(){return"!"}ia.peek=ub;function ia(e,t,s,r){let o=e.referenceType,i=s.enter("imageReference"),n=s.enter("label"),a=s.createTracker(r),h=a.move("!["),l=s.safe(e.alt,{before:h,after:"]",...a.current()});h+=a.move(l+"]["),n();let c=s.stack;s.stack=[],n=s.enter("reference");let f=s.safe(s.associationId(e),{before:h,after:"]",...a.current()});return n(),s.stack=c,i(),o==="full"||!l||l!==f?h+=a.move(f+"]"):o==="shortcut"?h=h.slice(0,-1):h+=a.move("]"),h}function ub(){return"!"}na.peek=pb;function na(e,t,s){let r=e.value||"",o="`",i=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++i<s.unsafe.length;){let n=s.unsafe[i],a=s.compilePattern(n),h;if(n.atBreak)for(;h=a.exec(r);){let l=h.index;r.charCodeAt(l)===10&&r.charCodeAt(l-1)===13&&l--,r=r.slice(0,l)+" "+r.slice(h.index+1)}}return o+r+o}function pb(){return"`"}function oa(e,t){let s=Bs(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(s===e.url||"mailto:"+s===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}aa.peek=fb;function aa(e,t,s,r){let o=fr(s),i=o==='"'?"Quote":"Apostrophe",n=s.createTracker(r),a,h;if(oa(e,s)){let c=s.stack;s.stack=[],a=s.enter("autolink");let f=n.move("<");return f+=n.move(s.containerPhrasing(e,{before:f,after:">",...n.current()})),f+=n.move(">"),a(),s.stack=c,f}a=s.enter("link"),h=s.enter("label");let l=n.move("[");return l+=n.move(s.containerPhrasing(e,{before:l,after:"](",...n.current()})),l+=n.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=s.enter("destinationLiteral"),l+=n.move("<"),l+=n.move(s.safe(e.url,{before:l,after:">",...n.current()})),l+=n.move(">")):(h=s.enter("destinationRaw"),l+=n.move(s.safe(e.url,{before:l,after:e.title?" ":")",...n.current()}))),h(),e.title&&(h=s.enter(`title${i}`),l+=n.move(" "+o),l+=n.move(s.safe(e.title,{before:l,after:o,...n.current()})),l+=n.move(o),h()),l+=n.move(")"),a(),l}function fb(e,t,s){return oa(e,s)?"<":"["}la.peek=mb;function la(e,t,s,r){let o=e.referenceType,i=s.enter("linkReference"),n=s.enter("label"),a=s.createTracker(r),h=a.move("["),l=s.containerPhrasing(e,{before:h,after:"]",...a.current()});h+=a.move(l+"]["),n();let c=s.stack;s.stack=[],n=s.enter("reference");let f=s.safe(s.associationId(e),{before:h,after:"]",...a.current()});return n(),s.stack=c,i(),o==="full"||!l||l!==f?h+=a.move(f+"]"):o==="shortcut"?h=h.slice(0,-1):h+=a.move("]"),h}function mb(){return"["}function gr(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Md(e){let t=gr(e),s=e.options.bulletOther;if(!s)return t==="*"?"-":"*";if(s!=="*"&&s!=="+"&&s!=="-")throw new Error("Cannot serialize items with `"+s+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(s===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+s+"`) to be different");return s}function Fd(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function rn(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Bd(e,t,s,r){let o=s.enter("list"),i=s.bulletCurrent,n=e.ordered?Fd(s):gr(s),a=e.ordered?n==="."?")":".":Md(s),h=t&&s.bulletLastUsed?n===s.bulletLastUsed:!1;if(!e.ordered){let c=e.children?e.children[0]:void 0;if((n==="*"||n==="-")&&c&&(!c.children||!c.children[0])&&s.stack[s.stack.length-1]==="list"&&s.stack[s.stack.length-2]==="listItem"&&s.stack[s.stack.length-3]==="list"&&s.stack[s.stack.length-4]==="listItem"&&s.indexStack[s.indexStack.length-1]===0&&s.indexStack[s.indexStack.length-2]===0&&s.indexStack[s.indexStack.length-3]===0&&(h=!0),rn(s)===n&&c){let f=-1;for(;++f<e.children.length;){let v=e.children[f];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(n=a),s.bulletCurrent=n;let l=s.containerFlow(e,r);return s.bulletLastUsed=n,s.bulletCurrent=i,o(),l}function Nd(e){let t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function zd(e,t,s,r){let o=Nd(s),i=s.bulletCurrent||gr(s);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(s.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let n=i.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(n=Math.ceil(n/4)*4);let a=s.createTracker(r);a.move(i+" ".repeat(n-i.length)),a.shift(n);let h=s.enter("listItem"),l=s.indentLines(s.containerFlow(e,a.current()),c);return h(),l;function c(f,v,g){return v?(g?"":" ".repeat(n))+f:(g?i:i+" ".repeat(n-i.length))+f}}function Hd(e,t,s,r){let o=s.enter("paragraph"),i=s.enter("phrasing"),n=s.containerPhrasing(e,r);return i(),o(),n}var ha=ms(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function $d(e,t,s,r){return(e.children.some(function(n){return ha(n)})?s.containerPhrasing:s.containerFlow).call(s,e,r)}function Ud(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ca.peek=gb;function ca(e,t,s,r){let o=Ud(s),i=s.enter("strong"),n=s.createTracker(r),a=n.move(o+o),h=n.move(s.containerPhrasing(e,{after:o,before:a,...n.current()})),l=h.charCodeAt(0),c=mr(r.before.charCodeAt(r.before.length-1),l,o);c.inside&&(h=gs(l)+h.slice(1));let f=h.charCodeAt(h.length-1),v=mr(r.after.charCodeAt(0),f,o);v.inside&&(h=h.slice(0,-1)+gs(f));let g=n.move(o+o);return i(),s.attentionEncodeSurroundingInfo={after:v.outside,before:c.outside},a+h+g}function gb(e,t,s){return s.options.strong||"*"}function Vd(e,t,s,r){return s.safe(e.value,r)}function jd(e){let t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Wd(e,t,s){let r=(rn(s)+(s.options.ruleSpaces?" ":"")).repeat(jd(s));return s.options.ruleSpaces?r.slice(0,-1):r}var Zr={blockquote:kd,break:ea,code:Rd,definition:Ad,emphasis:ta,hardBreak:ea,heading:Od,html:sa,image:ra,imageReference:ia,inlineCode:na,link:aa,linkReference:la,list:Bd,listItem:zd,paragraph:Hd,root:$d,strong:ca,text:Vd,thematicBreak:Wd};function ua(){return{enter:{table:vb,tableData:qd,tableHeader:qd,tableRow:_b},exit:{codeText:xb,table:bb,tableData:da,tableHeader:da,tableRow:da}}}function vb(e){let t=e._align;this.enter({type:"table",align:t.map(function(s){return s==="none"?null:s}),children:[]},e),this.data.inTable=!0}function bb(e){this.exit(e),this.data.inTable=void 0}function _b(e){this.enter({type:"tableRow",children:[]},e)}function da(e){this.exit(e)}function qd(e){this.enter({type:"tableCell",children:[]},e)}function xb(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,yb));let s=this.stack[this.stack.length-1];s.type,s.value=t,this.exit(e)}function yb(e,t){return t==="|"?t:e}function pa(e){let t=e||{},s=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,i=s?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
37
37
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:n,tableCell:h,tableRow:a}};function n(g,u,d,m){return l(c(g,d,m),g.align)}function a(g,u,d,m){let p=f(g,d,m),b=l([p]);return b.slice(0,b.indexOf(`
|
|
38
|
-
`))}function h(g,u,d,m){let p=d.enter("tableCell"),b=d.enter("phrasing"),x=d.containerPhrasing(g,{...m,before:i,after:i});return b(),p(),x}function l(g,u){return Sd(g,{align:u,alignDelimiters:r,padding:s,stringLength:o})}function c(g,u,d){let m=g.children,p=-1,b=[],x=u.enter("table");for(;++p<m.length;)b[p]=f(m[p],u,d);return x(),b}function f(g,u,d){let m=g.children,p=-1,b=[],x=u.enter("tableRow");for(;++p<m.length;)b[p]=h(m[p],g,u,d);return x(),b}function v(g,u,d){let m=Zr.inlineCode(g,u,d);return d.stack.includes("tableCell")&&(m=m.replace(/\|/g,"\\$&")),m}}function fa(){return{exit:{taskListCheckValueChecked:Kd,taskListCheckValueUnchecked:Kd,paragraph:wb}}}function ma(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Sb}}}function Kd(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function wb(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let s=this.stack[this.stack.length-1];s.type;let r=s.children[0];if(r&&r.type==="text"){let o=t.children,i=-1,n;for(;++i<o.length;){let a=o[i];if(a.type==="paragraph"){n=a;break}}n===s&&(r.value=r.value.slice(1),r.value.length===0?s.children.shift():s.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,s.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Sb(e,t,s,r){let o=e.children[0],i=typeof e.checked=="boolean"&&o&&o.type==="paragraph",n="["+(e.checked?"x":" ")+"] ",a=s.createTracker(r);i&&a.move(n);let h=Zr.listItem(e,t,s,{...r,...a.current()});return i&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),h;function l(c){return c+n}}function ga(){return[Go(),Jo(),Qo(),ua(),fa()]}function va(e){return{extensions:[Xo(),Yo(e),Zo(),pa(e),ma()]}}var kb={tokenize:Db,partial:!0},Gd={tokenize:Rb,partial:!0},Xd={tokenize:Ab,partial:!0},Jd={tokenize:Ib,partial:!0},Cb={tokenize:Lb,partial:!0},Yd={name:"wwwAutolink",tokenize:Tb,previous:Zd},Qd={name:"protocolAutolink",tokenize:Pb,previous:eu},ts={name:"emailAutolink",tokenize:Eb,previous:tu},Ht={};function _a(){return{text:Ht}}var Ks=48;for(;Ks<123;)Ht[Ks]=ts,Ks++,Ks===58?Ks=65:Ks===91&&(Ks=97);Ht[43]=ts;Ht[45]=ts;Ht[46]=ts;Ht[95]=ts;Ht[72]=[ts,Qd];Ht[104]=[ts,Qd];Ht[87]=[ts,Yd];Ht[119]=[ts,Yd];function Eb(e,t,s){let r=this,o,i;return n;function n(f){return!ba(f)||!tu.call(r,r.previous)||xa(r.events)?s(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(f))}function a(f){return ba(f)?(e.consume(f),a):f===64?(e.consume(f),h):s(f)}function h(f){return f===46?e.check(Cb,c,l)(f):f===45||f===95||Be(f)?(i=!0,e.consume(f),h):c(f)}function l(f){return e.consume(f),o=!0,h}function c(f){return i&&o&&We(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):s(f)}}function Tb(e,t,s){let r=this;return o;function o(n){return n!==87&&n!==119||!Zd.call(r,r.previous)||xa(r.events)?s(n):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(kb,e.attempt(Gd,e.attempt(Xd,i),s),s)(n))}function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}}function Pb(e,t,s){let r=this,o="",i=!1;return n;function n(f){return(f===72||f===104)&&eu.call(r,r.previous)&&!xa(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(f),e.consume(f),a):s(f)}function a(f){if(We(f)&&o.length<5)return o+=String.fromCodePoint(f),e.consume(f),a;if(f===58){let v=o.toLowerCase();if(v==="http"||v==="https")return e.consume(f),h}return s(f)}function h(f){return f===47?(e.consume(f),i?l:(i=!0,h)):s(f)}function l(f){return f===null||Ns(f)||_e(f)||Nt(f)||zs(f)?s(f):e.attempt(Gd,e.attempt(Xd,c),s)(f)}function c(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function Db(e,t,s){let r=0;return o;function o(n){return(n===87||n===119)&&r<3?(r++,e.consume(n),o):n===46&&r===3?(e.consume(n),i):s(n)}function i(n){return n===null?s(n):t(n)}}function Rb(e,t,s){let r,o,i;return n;function n(l){return l===46||l===95?e.check(Jd,h,a)(l):l===null||_e(l)||Nt(l)||l!==45&&zs(l)?h(l):(i=!0,e.consume(l),n)}function a(l){return l===95?r=!0:(o=r,r=void 0),e.consume(l),n}function h(l){return o||r||!i?s(l):t(l)}}function Ab(e,t){let s=0,r=0;return o;function o(n){return n===40?(s++,e.consume(n),o):n===41&&r<s?i(n):n===33||n===34||n===38||n===39||n===41||n===42||n===44||n===46||n===58||n===59||n===60||n===63||n===93||n===95||n===126?e.check(Jd,t,i)(n):n===null||_e(n)||Nt(n)?t(n):(e.consume(n),o)}function i(n){return n===41&&r++,e.consume(n),o}}function Ib(e,t,s){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),i):a===93?(e.consume(a),o):a===60||a===null||_e(a)||Nt(a)?t(a):s(a)}function o(a){return a===null||a===40||a===91||_e(a)||Nt(a)?t(a):r(a)}function i(a){return We(a)?n(a):s(a)}function n(a){return a===59?(e.consume(a),r):We(a)?(e.consume(a),n):s(a)}}function Lb(e,t,s){return r;function r(i){return e.consume(i),o}function o(i){return Be(i)?s(i):t(i)}}function Zd(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||_e(e)}function eu(e){return!We(e)}function tu(e){return!(e===47||ba(e))}function ba(e){return e===43||e===45||e===46||e===95||Be(e)}function xa(e){let t=e.length,s=!1;for(;t--;){let r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){s=!0;break}if(r._gfmAutolinkLiteralWalkedInto){s=!1;break}}return e.length>0&&!s&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}var Ob={tokenize:$b,partial:!0};function ya(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Nb,continuation:{tokenize:zb},exit:Hb}},text:{91:{name:"gfmFootnoteCall",tokenize:Bb},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Mb,resolveTo:Fb}}}}function Mb(e,t,s){let r=this,o=r.events.length,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),n;for(;o--;){let h=r.events[o][1];if(h.type==="labelImage"){n=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return a;function a(h){if(!n||!n._balanced)return s(h);let l=Ze(r.sliceSerialize({start:n.end,end:r.now()}));return l.codePointAt(0)!==94||!i.includes(l.slice(1))?s(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function Fb(e,t){let s=e.length,r;for(;s--;)if(e[s][1].type==="labelImage"&&e[s][0]==="enter"){r=e[s][1];break}e[s+1][1].type="data",e[s+3][1].type="gfmFootnoteCallLabelMarker";let o={type:"gfmFootnoteCall",start:Object.assign({},e[s+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[s+3][1].end),end:Object.assign({},e[s+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let n={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},n.start),end:Object.assign({},n.end)},h=[e[s+1],e[s+2],["enter",o,t],e[s+3],e[s+4],["enter",i,t],["exit",i,t],["enter",n,t],["enter",a,t],["exit",a,t],["exit",n,t],e[e.length-2],e[e.length-1],["exit",o,t]];return e.splice(s,e.length-s+1,...h),e}function Bb(e,t,s){let r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),i=0,n;return a;function a(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),h}function h(f){return f!==94?s(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(f){if(i>999||f===93&&!n||f===null||f===91||_e(f))return s(f);if(f===93){e.exit("chunkString");let v=e.exit("gfmFootnoteCallString");return o.includes(Ze(r.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):s(f)}return _e(f)||(n=!0),i++,e.consume(f),f===92?c:l}function c(f){return f===91||f===92||f===93?(e.consume(f),i++,l):l(f)}}function Nb(e,t,s){let r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),i,n=0,a;return h;function h(u){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(u),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(u){return u===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(u),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):s(u)}function c(u){if(n>999||u===93&&!a||u===null||u===91||_e(u))return s(u);if(u===93){e.exit("chunkString");let d=e.exit("gfmFootnoteDefinitionLabelString");return i=Ze(r.sliceSerialize(d)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(u),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return _e(u)||(a=!0),n++,e.consume(u),u===92?f:c}function f(u){return u===91||u===92||u===93?(e.consume(u),n++,c):c(u)}function v(u){return u===58?(e.enter("definitionMarker"),e.consume(u),e.exit("definitionMarker"),o.includes(i)||o.push(i),he(e,g,"gfmFootnoteDefinitionWhitespace")):s(u)}function g(u){return t(u)}}function zb(e,t,s){return e.check(zt,t,e.attempt(Ob,t,s))}function Hb(e){e.exit("gfmFootnoteDefinition")}function $b(e,t,s){let r=this;return he(e,o,"gfmFootnoteDefinitionIndent",5);function o(i){let n=r.events[r.events.length-1];return n&&n[1].type==="gfmFootnoteDefinitionIndent"&&n[2].sliceSerialize(n[1],!0).length===4?t(i):s(i)}}function wa(e){let s=(e||{}).singleTilde,r={name:"strikethrough",tokenize:i,resolveAll:o};return s==null&&(s=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(n,a){let h=-1;for(;++h<n.length;)if(n[h][0]==="enter"&&n[h][1].type==="strikethroughSequenceTemporary"&&n[h][1]._close){let l=h;for(;l--;)if(n[l][0]==="exit"&&n[l][1].type==="strikethroughSequenceTemporary"&&n[l][1]._open&&n[h][1].end.offset-n[h][1].start.offset===n[l][1].end.offset-n[l][1].start.offset){n[h][1].type="strikethroughSequence",n[l][1].type="strikethroughSequence";let c={type:"strikethrough",start:Object.assign({},n[l][1].start),end:Object.assign({},n[h][1].end)},f={type:"strikethroughText",start:Object.assign({},n[l][1].end),end:Object.assign({},n[h][1].start)},v=[["enter",c,a],["enter",n[l][1],a],["exit",n[l][1],a],["enter",f,a]],g=a.parser.constructs.insideSpan.null;g&&$e(v,v.length,0,ps(g,n.slice(l+1,h),a)),$e(v,v.length,0,[["exit",f,a],["enter",n[h][1],a],["exit",n[h][1],a],["exit",c,a]]),$e(n,l-1,h-l+3,v),h=l+v.length-2;break}}for(h=-1;++h<n.length;)n[h][1].type==="strikethroughSequenceTemporary"&&(n[h][1].type="data");return n}function i(n,a,h){let l=this.previous,c=this.events,f=0;return v;function v(u){return l===126&&c[c.length-1][1].type!=="characterEscape"?h(u):(n.enter("strikethroughSequenceTemporary"),g(u))}function g(u){let d=es(l);if(u===126)return f>1?h(u):(n.consume(u),f++,g);if(f<2&&!s)return h(u);let m=n.exit("strikethroughSequenceTemporary"),p=es(u);return m._open=!p||p===2&&!!d,m._close=!d||d===2&&!!p,a(u)}}}var nn=class{constructor(){this.map=[]}add(t,s,r){Ub(this,t,s,r)}consume(t){if(this.map.sort(function(i,n){return i[0]-n[0]}),this.map.length===0)return;let s=this.map.length,r=[];for(;s>0;)s-=1,r.push(t.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),t.length=this.map[s][0];r.push(t.slice()),t.length=0;let o=r.pop();for(;o;){for(let i of o)t.push(i);o=r.pop()}this.map.length=0}};function Ub(e,t,s,r){let o=0;if(!(s===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=s,e.map[o][2].push(...r);return}o+=1}e.map.push([t,s,r])}}function su(e,t){let s=!1,r=[];for(;t<e.length;){let o=e[t];if(s){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(s=!0);t+=1}return r}function Sa(){return{flow:{null:{name:"table",tokenize:Vb,resolveAll:jb}}}}function Vb(e,t,s){let r=this,o=0,i=0,n;return a;function a(T){let A=r.events.length-1;for(;A>-1;){let U=r.events[A][1].type;if(U==="lineEnding"||U==="linePrefix")A--;else break}let F=A>-1?r.events[A][1].type:null,B=F==="tableHead"||F==="tableRow"?_:h;return B===_&&r.parser.lazy[r.now().line]?s(T):B(T)}function h(T){return e.enter("tableHead"),e.enter("tableRow"),l(T)}function l(T){return T===124||(n=!0,i+=1),c(T)}function c(T){return T===null?s(T):ie(T)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),g):s(T):ue(T)?he(e,c,"whitespace")(T):(i+=1,n&&(n=!1,o+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),n=!0,c):(e.enter("data"),f(T)))}function f(T){return T===null||T===124||_e(T)?(e.exit("data"),c(T)):(e.consume(T),T===92?v:f)}function v(T){return T===92||T===124?(e.consume(T),f):f(T)}function g(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?s(T):(e.enter("tableDelimiterRow"),n=!1,ue(T)?he(e,u,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):u(T))}function u(T){return T===45||T===58?m(T):T===124?(n=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),d):S(T)}function d(T){return ue(T)?he(e,m,"whitespace")(T):m(T)}function m(T){return T===58?(i+=1,n=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),p):T===45?(i+=1,p(T)):T===null||ie(T)?y(T):S(T)}function p(T){return T===45?(e.enter("tableDelimiterFiller"),b(T)):S(T)}function b(T){return T===45?(e.consume(T),b):T===58?(n=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(T))}function x(T){return ue(T)?he(e,y,"whitespace")(T):y(T)}function y(T){return T===124?u(T):T===null||ie(T)?!n||o!==i?S(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):S(T)}function S(T){return s(T)}function _(T){return e.enter("tableRow"),w(T)}function w(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),w):T===null||ie(T)?(e.exit("tableRow"),t(T)):ue(T)?he(e,w,"whitespace")(T):(e.enter("data"),C(T))}function C(T){return T===null||T===124||_e(T)?(e.exit("data"),w(T)):(e.consume(T),T===92?P:C)}function P(T){return T===92||T===124?(e.consume(T),C):C(T)}}function jb(e,t){let s=-1,r=!0,o=0,i=[0,0,0,0],n=[0,0,0,0],a=!1,h=0,l,c,f,v=new nn;for(;++s<e.length;){let g=e[s],u=g[1];g[0]==="enter"?u.type==="tableHead"?(a=!1,h!==0&&(ru(v,t,h,l,c),c=void 0,h=0),l={type:"table",start:Object.assign({},u.start),end:Object.assign({},u.end)},v.add(s,0,[["enter",l,t]])):u.type==="tableRow"||u.type==="tableDelimiterRow"?(r=!0,f=void 0,i=[0,0,0,0],n=[0,s+1,0,0],a&&(a=!1,c={type:"tableBody",start:Object.assign({},u.start),end:Object.assign({},u.end)},v.add(s,0,[["enter",c,t]])),o=u.type==="tableDelimiterRow"?2:c?3:1):o&&(u.type==="data"||u.type==="tableDelimiterMarker"||u.type==="tableDelimiterFiller")?(r=!1,n[2]===0&&(i[1]!==0&&(n[0]=n[1],f=on(v,t,i,o,void 0,f),i=[0,0,0,0]),n[2]=s)):u.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(n[0]=n[1],f=on(v,t,i,o,void 0,f)),i=n,n=[i[1],s,0,0])):u.type==="tableHead"?(a=!0,h=s):u.type==="tableRow"||u.type==="tableDelimiterRow"?(h=s,i[1]!==0?(n[0]=n[1],f=on(v,t,i,o,s,f)):n[1]!==0&&(f=on(v,t,n,o,s,f)),o=0):o&&(u.type==="data"||u.type==="tableDelimiterMarker"||u.type==="tableDelimiterFiller")&&(n[3]=s)}for(h!==0&&ru(v,t,h,l,c),v.consume(t.events),s=-1;++s<t.events.length;){let g=t.events[s];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=su(t.events,s))}return e}function on(e,t,s,r,o,i){let n=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";s[0]!==0&&(i.end=Object.assign({},vr(t.events,s[0])),e.add(s[0],0,[["exit",i,t]]));let h=vr(t.events,s[1]);if(i={type:n,start:Object.assign({},h),end:Object.assign({},h)},e.add(s[1],0,[["enter",i,t]]),s[2]!==0){let l=vr(t.events,s[2]),c=vr(t.events,s[3]),f={type:a,start:Object.assign({},l),end:Object.assign({},c)};if(e.add(s[2],0,[["enter",f,t]]),r!==2){let v=t.events[s[2]],g=t.events[s[3]];if(v[1].end=Object.assign({},g[1].end),v[1].type="chunkText",v[1].contentType="text",s[3]>s[2]+1){let u=s[2]+1,d=s[3]-s[2]-1;e.add(u,d,[])}}e.add(s[3]+1,0,[["exit",f,t]])}return o!==void 0&&(i.end=Object.assign({},vr(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function ru(e,t,s,r,o){let i=[],n=vr(t.events,s);o&&(o.end=Object.assign({},n),i.push(["exit",o,t])),r.end=Object.assign({},n),i.push(["exit",r,t]),e.add(s+1,0,i)}function vr(e,t){let s=e[t],r=s[0]==="enter"?"start":"end";return s[1][r]}var Wb={name:"tasklistCheck",tokenize:qb};function ka(){return{text:{91:Wb}}}function qb(e,t,s){let r=this;return o;function o(h){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?s(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),i)}function i(h){return _e(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),n):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),n):s(h)}function n(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):s(h)}function a(h){return ie(h)?t(h):ue(h)?e.check({tokenize:Kb},t,s)(h):s(h)}}function Kb(e,t,s){return he(e,r,"whitespace");function r(o){return o===null?s(o):t(o)}}function iu(e){return Ii([_a(),ya(),wa(e),Sa(),ka()])}var Gb={};function an(e){let t=this,s=e||Gb,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),n=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(iu(s)),i.push(ga()),n.push(va(s))}var Ce=require("@deepseek-ai/dsh-client-ui-primitives");var Ft="application/x-dsh-remote-files";function hn(e){return e.kind==="directory"||e.navigable===!0}function ei(e,t){return e.endpointId===t.endpointId&&ln(e.directory)===ln(t.directory)}function ti(e,t,s){if(e.endpointId!==s.endpointId)return!0;let r=ln(s.directory);return!t.some(o=>{let i=ln(o);return r===i||r.startsWith(`${i}/`)})}function si(e,t){return ei(e,t)?"none":ti(e,e.paths,t)?e.endpointId===t.endpointId?"move":"copy":"invalid"}function br(e){try{let t=JSON.parse(e);return typeof t.paneId=="string"&&typeof t.endpointId=="string"&&typeof t.directory=="string"&&Array.isArray(t.paths)&&t.paths.every(s=>typeof s=="string")?{paneId:t.paneId,endpointId:t.endpointId,directory:t.directory,paths:t.paths}:void 0}catch{return}}function ln(e){return e.replaceAll("\\","/").replace(/\/{2,}/g,"/").replace(/\/$/,"")||"/"}async function cn(e,t){let s=si(e,t);if(s==="none")return{operation:s};if(s==="invalid")throw new Error("\u4E0D\u80FD\u628A\u76EE\u5F55\u79FB\u52A8\u5230\u81EA\u8EAB\u6216\u5176\u5B50\u76EE\u5F55");if(s==="move")return await Ul({paneId:t.paneId,endpointId:t.endpointId,sourceDirectory:e.directory,destinationDirectory:t.directory,paths:e.paths}),{operation:s};let r=await Nr({sourceEndpointId:e.endpointId,sourcePaths:e.paths,destinationEndpointId:t.endpointId,destinationDirectory:t.directory,conflictPolicy:"fail"});return{operation:s,job:r}}var Sl=require("react"),Ar=require("@deepseek-ai/dsh-client-ui-primitives");var Me=require("react"),Kt=require("@deepseek-ai/dsh-client-ui-primitives");var $t=require("react"),ri=require("react/jsx-runtime"),Xb=28;function Ca(e,t,s){return Math.min(Math.max(e,t),s)}function _r(){let e=(0,$t.useRef)(null),t=(0,$t.useRef)(void 0),s=(0,$t.useRef)(void 0),r=(0,$t.useCallback)(()=>{t.current=void 0;let n=e.current,a=s.current;if(n===null||a===void 0)return;let h=n.getBoundingClientRect(),l=Ca(a.clientX-h.left,0,h.width),c=Ca(a.clientY-h.top,0,h.height),f=Math.min(l,h.width-l,c,h.height-c),v=Ca(1-f/Xb,0,1),g=Math.atan2(c-h.height/2,l-h.width/2)*(180/Math.PI)+90;n.style.setProperty("--ssh-border-glow-proximity",v.toFixed(3)),n.style.setProperty("--ssh-border-glow-angle",`${g.toFixed(2)}deg`)},[]),o=(0,$t.useCallback)(n=>{s.current={clientX:n.clientX,clientY:n.clientY},t.current===void 0&&(t.current=requestAnimationFrame(r))},[r]),i=(0,$t.useCallback)(()=>{s.current=void 0;let n=e.current;n!==null&&n.style.setProperty("--ssh-border-glow-proximity","0")},[]);return(0,$t.useEffect)(()=>()=>{t.current!==void 0&&cancelAnimationFrame(t.current)},[]),{ref:e,onPointerMove:o,onPointerLeave:i}}function nu({children:e,className:t}){let s=_r();return(0,ri.jsxs)("div",{ref:s.ref,className:`dsh-ssh-border-glow${t===void 0?"":` ${t}`}`,onPointerMove:s.onPointerMove,onPointerLeave:s.onPointerLeave,children:[(0,ri.jsx)("span",{className:"dsh-ssh-border-glow-edge","aria-hidden":"true"}),(0,ri.jsx)("div",{className:"dsh-ssh-border-glow-inner",children:e})]})}var Ea=require("react/jsx-runtime");function Jb(e,t){let s=e.trim().replace(/^#/,"");if(/^[\da-f]{3}$/i.test(s)){let[r="0",o="0",i="0"]=s;return`rgba(${parseInt(r+r,16)}, ${parseInt(o+o,16)}, ${parseInt(i+i,16)}, ${t})`}return/^[\da-f]{6}$/i.test(s)?`rgba(${parseInt(s.slice(0,2),16)}, ${parseInt(s.slice(2,4),16)}, ${parseInt(s.slice(4,6),16)}, ${t})`:`color-mix(in srgb, ${e} ${Math.round(t*100)}%, transparent)`}function ou({children:e,className:t,glareColor:s="#ffffff",glareOpacity:r=.28,glareAngle:o=-30,glareSize:i=300,transitionDuration:n=800}){let a={"--dsh-ssh-glare-angle":`${o}deg`,"--dsh-ssh-glare-color":Jb(s,r),"--dsh-ssh-glare-duration":`${n}ms`,"--dsh-ssh-glare-size":`${i}px`};return(0,Ea.jsx)("div",{className:`dsh-ssh-glare-hover${t===void 0?"":` ${t}`}`,style:a,children:(0,Ea.jsx)("div",{className:"dsh-ssh-glare-hover-inner",children:e})})}var _l=require("react");function ss(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mu(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var ft={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},hi={duration:.5,overwrite:!1,delay:0},ja,Xe,Ae,Rt=1e8,Te=1/Rt,Oa=Math.PI*2,Yb=Oa/4,Qb=0,gu=Math.sqrt,Zb=Math.cos,e_=Math.sin,qe=function(t){return typeof t=="string"},Ne=function(t){return typeof t=="function"},is=function(t){return typeof t=="number"},xn=function(t){return typeof t>"u"},jt=function(t){return typeof t=="object"},pt=function(t){return t!==!1},Wa=function(){return typeof window<"u"},dn=function(t){return Ne(t)||qe(t)},vu=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},st=Array.isArray,t_=/random\([^)]+\)/g,s_=/,\s*/g,au=/(?:-?\.?\d|\.)+/gi,qa=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Ys=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Ta=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Ka=/[+-]=-?[.\d]+/,r_=/[^,'"\[\]\s]+/gi,i_=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Le,Ut,Ma,Ga,xt={},mn={},bu,_u=function(t){return(mn=yr(t,xt))&&rt},yn=function(t,s){return console.warn("Invalid property",t,"set to",s,"Missing plugin? gsap.registerPlugin()")},ci=function(t,s){return!s&&console.warn(t)},xu=function(t,s){return t&&(xt[t]=s)&&mn&&(mn[t]=s)||xt},di=function(){return 0},n_={suppressEvents:!0,isStart:!0,kill:!1},un={suppressEvents:!0,kill:!1},o_={suppressEvents:!0},Xa={},bs=[],Fa={},yu,dt={},Pa={},lu=30,pn=[],Ja="",Ya=function(t){var s=t[0],r,o;if(jt(s)||Ne(s)||(t=[t]),!(r=(s._gsap||{}).harness)){for(o=pn.length;o--&&!pn[o].targetTest(s););r=pn[o]}for(o=t.length;o--;)t[o]&&(t[o]._gsap||(t[o]._gsap=new tl(t[o],r)))||t.splice(o,1);return t},_s=function(t){return t._gsap||Ya(At(t))[0]._gsap},Qa=function(t,s,r){return(r=t[s])&&Ne(r)?t[s]():xn(r)&&t.getAttribute&&t.getAttribute(s)||r},nt=function(t,s){return(t=t.split(",")).forEach(s)||t},ze=function(t){return Math.round(t*1e5)/1e5||0},Ie=function(t){return Math.round(t*1e7)/1e7||0},Qs=function(t,s){var r=s.charAt(0),o=parseFloat(s.substr(2));return t=parseFloat(t),r==="+"?t+o:r==="-"?t-o:r==="*"?t*o:t/o},a_=function(t,s){for(var r=s.length,o=0;t.indexOf(s[o])<0&&++o<r;);return o<r},gn=function(){var t=bs.length,s=bs.slice(0),r,o;for(Fa={},bs.length=0,r=0;r<t;r++)o=s[r],o&&o._lazy&&(o.render(o._lazy[0],o._lazy[1],!0)._lazy=0)},Za=function(t){return!!(t._initted||t._startAt||t.add)},wu=function(t,s,r,o){bs.length&&!Xe&&gn(),t.render(s,r,o||!!(Xe&&s<0&&Za(t))),bs.length&&!Xe&&gn()},Su=function(t){var s=parseFloat(t);return(s||s===0)&&(t+"").match(r_).length<2?s:qe(t)?t.trim():t},ku=function(t){return t},yt=function(t,s){for(var r in s)r in t||(t[r]=s[r]);return t},l_=function(t){return function(s,r){for(var o in r)o in s||o==="duration"&&t||o==="ease"||(s[o]=r[o])}},yr=function(t,s){for(var r in s)t[r]=s[r];return t},hu=function e(t,s){for(var r in s)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(t[r]=jt(s[r])?e(t[r]||(t[r]={}),s[r]):s[r]);return t},vn=function(t,s){var r={},o;for(o in t)o in s||(r[o]=t[o]);return r},oi=function(t){var s=t.parent||Le,r=t.keyframes?l_(st(t.keyframes)):yt;if(pt(t.inherit))for(;s;)r(t,s.vars.defaults),s=s.parent||s._dp;return t},h_=function(t,s){for(var r=t.length,o=r===s.length;o&&r--&&t[r]===s[r];);return r<0},Cu=function(t,s,r,o,i){r===void 0&&(r="_first"),o===void 0&&(o="_last");var n=t[o],a;if(i)for(a=s[i];n&&n[i]>a;)n=n._prev;return n?(s._next=n._next,n._next=s):(s._next=t[r],t[r]=s),s._next?s._next._prev=s:t[o]=s,s._prev=n,s.parent=s._dp=t,s},wn=function(t,s,r,o){r===void 0&&(r="_first"),o===void 0&&(o="_last");var i=s._prev,n=s._next;i?i._next=n:t[r]===s&&(t[r]=n),n?n._prev=i:t[o]===s&&(t[o]=i),s._next=s._prev=s.parent=null},xs=function(t,s){t.parent&&(!s||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},Gs=function(t,s){if(t&&(!s||s._end>t._dur||s._start<0))for(var r=t;r;)r._dirty=1,r=r.parent;return t},c_=function(t){for(var s=t.parent;s&&s.parent;)s._dirty=1,s.totalDuration(),s=s.parent;return t},Ba=function(t,s,r,o){return t._startAt&&(Xe?t._startAt.revert(un):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(s,!0,o))},d_=function e(t){return!t||t._ts&&e(t.parent)},cu=function(t){return t._repeat?wr(t._tTime,t=t.duration()+t._rDelay)*t:0},wr=function(t,s){var r=Math.floor(t=Ie(t/s));return t&&r===t?r-1:r},bn=function(t,s){return(t-s._start)*s._ts+(s._ts>=0?0:s._dirty?s.totalDuration():s._tDur)},Sn=function(t){return t._end=Ie(t._start+(t._tDur/Math.abs(t._ts||t._rts||Te)||0))},kn=function(t,s){var r=t._dp;return r&&r.smoothChildTiming&&t._ts&&(t._start=Ie(r._time-(t._ts>0?s/t._ts:((t._dirty?t.totalDuration():t._tDur)-s)/-t._ts)),Sn(t),r._dirty||Gs(r,t)),t},Eu=function(t,s){var r;if((s._time||!s._dur&&s._initted||s._start<t._time&&(s._dur||!s.add))&&(r=bn(t.rawTime(),s),(!s._dur||fi(0,s.totalDuration(),r)-s._tTime>Te)&&s.render(r,!0)),Gs(t,s)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(r=t;r._dp;)r.rawTime()>=0&&r.totalTime(r._tTime),r=r._dp;t._zTime=-Te}},Vt=function(t,s,r,o){return s.parent&&xs(s),s._start=Ie((is(r)?r:r||t!==Le?Dt(t,r,s):t._time)+s._delay),s._end=Ie(s._start+(s.totalDuration()/Math.abs(s.timeScale())||0)),Cu(t,s,"_first","_last",t._sort?"_start":0),Na(s)||(t._recent=s),o||Eu(t,s),t._ts<0&&kn(t,t._tTime),t},Tu=function(t,s){return(xt.ScrollTrigger||yn("scrollTrigger",s))&&xt.ScrollTrigger.create(s,t)},Pu=function(t,s,r,o,i){if(il(t,s,i),!t._initted)return 1;if(!r&&t._pt&&!Xe&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&yu!==ut.frame)return bs.push(t),t._lazy=[i,o],1},u_=function e(t){var s=t.parent;return s&&s._ts&&s._initted&&!s._lock&&(s.rawTime()<0||e(s))},Na=function(t){var s=t.data;return s==="isFromStart"||s==="isStart"},p_=function(t,s,r,o){var i=t.ratio,n=s<0||!s&&(!t._start&&u_(t)&&!(!t._initted&&Na(t))||(t._ts<0||t._dp._ts<0)&&!Na(t))?0:1,a=t._rDelay,h=0,l,c,f;if(a&&t._repeat&&(h=fi(0,t._tDur,s),c=wr(h,a),t._yoyo&&c&1&&(n=1-n),c!==wr(t._tTime,a)&&(i=1-n,t.vars.repeatRefresh&&t._initted&&t.invalidate())),n!==i||Xe||o||t._zTime===Te||!s&&t._zTime){if(!t._initted&&Pu(t,s,o,r,h))return;for(f=t._zTime,t._zTime=s||(r?Te:0),r||(r=s&&!f),t.ratio=n,t._from&&(n=1-n),t._time=0,t._tTime=h,l=t._pt;l;)l.r(n,l.d),l=l._next;s<0&&Ba(t,s,r,!0),t._onUpdate&&!r&&_t(t,"onUpdate"),h&&t._repeat&&!r&&t.parent&&_t(t,"onRepeat"),(s>=t._tDur||s<0)&&t.ratio===n&&(n&&xs(t,1),!r&&!Xe&&(_t(t,n?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=s)},f_=function(t,s,r){var o;if(r>s)for(o=t._first;o&&o._start<=r;){if(o.data==="isPause"&&o._start>s)return o;o=o._next}else for(o=t._last;o&&o._start>=r;){if(o.data==="isPause"&&o._start<s)return o;o=o._prev}},Sr=function(t,s,r,o){var i=t._repeat,n=Ie(s)||0,a=t._tTime/t._tDur;return a&&!o&&(t._time*=n/t._dur),t._dur=n,t._tDur=i?i<0?1e10:Ie(n*(i+1)+t._rDelay*i):n,a>0&&!o&&kn(t,t._tTime=t._tDur*a),t.parent&&Sn(t),r||Gs(t.parent,t),t},du=function(t){return t instanceof tt?Gs(t):Sr(t,t._dur)},m_={_start:0,endTime:di,totalDuration:di},Dt=function e(t,s,r){var o=t.labels,i=t._recent||m_,n=t.duration()>=Rt?i.endTime(!1):t._dur,a,h,l;return qe(s)&&(isNaN(s)||s in o)?(h=s.charAt(0),l=s.substr(-1)==="%",a=s.indexOf("="),h==="<"||h===">"?(a>=0&&(s=s.replace(/=/,"")),(h==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(s.substr(1))||0)*(l?(a<0?i:r).totalDuration()/100:1)):a<0?(s in o||(o[s]=n),o[s]):(h=parseFloat(s.charAt(a-1)+s.substr(a+1)),l&&r&&(h=h/100*(st(r)?r[0]:r).totalDuration()),a>1?e(t,s.substr(0,a-1),r)+h:n+h)):s==null?n:+s},ai=function(t,s,r){var o=is(s[1]),i=(o?2:1)+(t<2?0:1),n=s[i],a,h;if(o&&(n.duration=s[1]),n.parent=r,t){for(a=n,h=r;h&&!("immediateRender"in a);)a=h.vars.defaults||{},h=pt(h.vars.inherit)&&h.parent;n.immediateRender=pt(a.immediateRender),t<2?n.runBackwards=1:n.startAt=s[i-1]}return new Ue(s[0],n,s[i+1])},ys=function(t,s){return t||t===0?s(t):s},fi=function(t,s,r){return r<t?t:r>s?s:r},Je=function(t,s){return!qe(t)||!(s=i_.exec(t))?"":s[1]},g_=function(t,s,r){return ys(r,function(o){return fi(t,s,o)})},za=[].slice,Du=function(t,s){return t&&jt(t)&&"length"in t&&(!s&&!t.length||t.length-1 in t&&jt(t[0]))&&!t.nodeType&&t!==Ut},v_=function(t,s,r){return r===void 0&&(r=[]),t.forEach(function(o){var i;return qe(o)&&!s||Du(o,1)?(i=r).push.apply(i,At(o)):r.push(o)})||r},At=function(t,s,r){return Ae&&!s&&Ae.selector?Ae.selector(t):qe(t)&&!r&&(Ma||!kr())?za.call((s||Ga).querySelectorAll(t),0):st(t)?v_(t,r):Du(t)?za.call(t,0):t?[t]:[]},Ha=function(t){return t=At(t)[0]||ci("Invalid scope")||{},function(s){var r=t.current||t.nativeElement||t;return At(s,r.querySelectorAll?r:r===t?ci("Invalid scope")||Ga.createElement("div"):t)}},Ru=function(t){return t.sort(function(){return .5-Math.random()})},Au=function(t){if(Ne(t))return t;var s=jt(t)?t:{each:t},r=Xs(s.ease),o=s.from||0,i=parseFloat(s.base)||0,n={},a=o>0&&o<1,h=isNaN(o)||a,l=s.axis,c=o,f=o;return qe(o)?c=f={center:.5,edges:.5,end:1}[o]||0:!a&&h&&(c=o[0],f=o[1]),function(v,g,u){var d=(u||s).length,m=n[d],p,b,x,y,S,_,w,C,P;if(!m){if(P=s.grid==="auto"?0:(s.grid||[1,Rt])[1],!P){for(w=-Rt;w<(w=u[P++].getBoundingClientRect().left)&&P<d;);P<d&&P--}for(m=n[d]=[],p=h?Math.min(P,d)*c-.5:o%P,b=P===Rt?0:h?d*f/P-.5:o/P|0,w=0,C=Rt,_=0;_<d;_++)x=_%P-p,y=b-(_/P|0),m[_]=S=l?Math.abs(l==="y"?y:x):gu(x*x+y*y),S>w&&(w=S),S<C&&(C=S);o==="random"&&Ru(m),m.max=w-C,m.min=C,m.v=d=(parseFloat(s.amount)||parseFloat(s.each)*(P>d?d-1:l?l==="y"?d/P:P:Math.max(P,d/P))||0)*(o==="edges"?-1:1),m.b=d<0?i-d:i,m.u=Je(s.amount||s.each)||0,r=r&&d<0?R_(r):r}return d=(m[v]-m.min)/m.max||0,Ie(m.b+(r?r(d):d)*m.v)+m.u}},$a=function(t){var s=Math.pow(10,((t+"").split(".")[1]||"").length);return function(r){var o=Ie(Math.round(parseFloat(r)/t)*t*s);return(o-o%1)/s+(is(r)?0:Je(r))}},Iu=function(t,s){var r=st(t),o,i;return!r&&jt(t)&&(o=r=t.radius||Rt,t.values?(t=At(t.values),(i=!is(t[0]))&&(o*=o)):t=$a(t.increment)),ys(s,r?Ne(t)?function(n){return i=t(n),Math.abs(i-n)<=o?i:n}:function(n){for(var a=parseFloat(i?n.x:n),h=parseFloat(i?n.y:0),l=Rt,c=0,f=t.length,v,g;f--;)i?(v=t[f].x-a,g=t[f].y-h,v=v*v+g*g):v=Math.abs(t[f]-a),v<l&&(l=v,c=f);return c=!o||l<=o?t[c]:n,i||c===n||is(n)?c:c+Je(n)}:$a(t))},Lu=function(t,s,r,o){return ys(st(t)?!s:r===!0?!!(r=0):!o,function(){return st(t)?t[~~(Math.random()*t.length)]:(r=r||1e-5)&&(o=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((t-r/2+Math.random()*(s-t+r*.99))/r)*r*o)/o})},b_=function(){for(var t=arguments.length,s=new Array(t),r=0;r<t;r++)s[r]=arguments[r];return function(o){return s.reduce(function(i,n){return n(i)},o)}},__=function(t,s){return function(r){return t(parseFloat(r))+(s||Je(r))}},x_=function(t,s,r){return Mu(t,s,0,1,r)},Ou=function(t,s,r){return ys(r,function(o){return t[~~s(o)]})},y_=function e(t,s,r){var o=s-t;return st(t)?Ou(t,e(0,t.length),s):ys(r,function(i){return(o+(i-t)%o)%o+t})},w_=function e(t,s,r){var o=s-t,i=o*2;return st(t)?Ou(t,e(0,t.length-1),s):ys(r,function(n){return n=(i+(n-t)%i)%i||0,t+(n>o?i-n:n)})},Cr=function(t){return t.replace(t_,function(s){var r=s.indexOf("[")+1,o=s.substring(r||7,r?s.indexOf("]"):s.length-1).split(s_);return Lu(r?o:+o[0],r?0:+o[1],+o[2]||1e-5)})},Mu=function(t,s,r,o,i){var n=s-t,a=o-r;return ys(i,function(h){return r+((h-t)/n*a||0)})},S_=function e(t,s,r,o){var i=isNaN(t+s)?0:function(g){return(1-g)*t+g*s};if(!i){var n=qe(t),a={},h,l,c,f,v;if(r===!0&&(o=1)&&(r=null),n)t={p:t},s={p:s};else if(st(t)&&!st(s)){for(c=[],f=t.length,v=f-2,l=1;l<f;l++)c.push(e(t[l-1],t[l]));f--,i=function(u){u*=f;var d=Math.min(v,~~u);return c[d](u-d)},r=s}else o||(t=yr(st(t)?[]:{},t));if(!c){for(h in s)sl.call(a,t,h,"get",s[h]);i=function(u){return al(u,a)||(n?t.p:t)}}}return ys(r,i)},uu=function(t,s,r){var o=t.labels,i=Rt,n,a,h;for(n in o)a=o[n]-s,a<0==!!r&&a&&i>(a=Math.abs(a))&&(h=n,i=a);return h},_t=function(t,s,r){var o=t.vars,i=o[s],n=Ae,a=t._ctx,h,l,c;if(i)return h=o[s+"Params"],l=o.callbackScope||t,r&&bs.length&&gn(),a&&(Ae=a),c=h?i.apply(l,h):i.call(l),Ae=n,c},ii=function(t){return xs(t),t.scrollTrigger&&t.scrollTrigger.kill(!!Xe),t.progress()<1&&_t(t,"onInterrupt"),t},xr,Fu=[],Bu=function(t){if(t)if(t=!t.name&&t.default||t,Wa()||t.headless){var s=t.name,r=Ne(t),o=s&&!r&&t.init?function(){this._props=[]}:t,i={init:di,render:al,add:sl,kill:H_,modifier:z_,rawVars:0},n={targetTest:0,get:0,getSetter:Cn,aliases:{},register:0};if(kr(),t!==o){if(dt[s])return;yt(o,yt(vn(t,i),n)),yr(o.prototype,yr(i,vn(t,n))),dt[o.prop=s]=o,t.targetTest&&(pn.push(o),Xa[s]=1),s=(s==="css"?"CSS":s.charAt(0).toUpperCase()+s.substr(1))+"Plugin"}xu(s,o),t.register&&t.register(rt,o,ot)}else Fu.push(t)},Ee=255,ni={aqua:[0,Ee,Ee],lime:[0,Ee,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Ee],navy:[0,0,128],white:[Ee,Ee,Ee],olive:[128,128,0],yellow:[Ee,Ee,0],orange:[Ee,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Ee,0,0],pink:[Ee,192,203],cyan:[0,Ee,Ee],transparent:[Ee,Ee,Ee,0]},Da=function(t,s,r){return t+=t<0?1:t>1?-1:0,(t*6<1?s+(r-s)*t*6:t<.5?r:t*3<2?s+(r-s)*(2/3-t)*6:s)*Ee+.5|0},Nu=function(t,s,r){var o=t?is(t)?[t>>16,t>>8&Ee,t&Ee]:0:ni.black,i,n,a,h,l,c,f,v,g,u;if(!o){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),ni[t])o=ni[t];else if(t.charAt(0)==="#"){if(t.length<6&&(i=t.charAt(1),n=t.charAt(2),a=t.charAt(3),t="#"+i+i+n+n+a+a+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return o=parseInt(t.substr(1,6),16),[o>>16,o>>8&Ee,o&Ee,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),o=[t>>16,t>>8&Ee,t&Ee]}else if(t.substr(0,3)==="hsl"){if(o=u=t.match(au),!s)h=+o[0]%360/360,l=+o[1]/100,c=+o[2]/100,n=c<=.5?c*(l+1):c+l-c*l,i=c*2-n,o.length>3&&(o[3]*=1),o[0]=Da(h+1/3,i,n),o[1]=Da(h,i,n),o[2]=Da(h-1/3,i,n);else if(~t.indexOf("="))return o=t.match(qa),r&&o.length<4&&(o[3]=1),o}else o=t.match(au)||ni.transparent;o=o.map(Number)}return s&&!u&&(i=o[0]/Ee,n=o[1]/Ee,a=o[2]/Ee,f=Math.max(i,n,a),v=Math.min(i,n,a),c=(f+v)/2,f===v?h=l=0:(g=f-v,l=c>.5?g/(2-f-v):g/(f+v),h=f===i?(n-a)/g+(n<a?6:0):f===n?(a-i)/g+2:(i-n)/g+4,h*=60),o[0]=~~(h+.5),o[1]=~~(l*100+.5),o[2]=~~(c*100+.5)),r&&o.length<4&&(o[3]=1),o},zu=function(t){var s=[],r=[],o=-1;return t.split(rs).forEach(function(i){var n=i.match(Ys)||[];s.push.apply(s,n),r.push(o+=n.length+1)}),s.c=r,s},pu=function(t,s,r){var o="",i=(t+o).match(rs),n=s?"hsla(":"rgba(",a=0,h,l,c,f;if(!i)return t;if(i=i.map(function(v){return(v=Nu(v,s,1))&&n+(s?v[0]+","+v[1]+"%,"+v[2]+"%,"+v[3]:v.join(","))+")"}),r&&(c=zu(t),h=r.c,h.join(o)!==c.c.join(o)))for(l=t.replace(rs,"1").split(Ys),f=l.length-1;a<f;a++)o+=l[a]+(~h.indexOf(a)?i.shift()||n+"0,0,0,0)":(c.length?c:i.length?i:r).shift());if(!l)for(l=t.split(rs),f=l.length-1;a<f;a++)o+=l[a]+i[a];return o+l[f]},rs=(function(){var e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in ni)e+="|"+t+"\\b";return new RegExp(e+")","gi")})(),k_=/hsl[a]?\(/,el=function(t){var s=t.join(" "),r;if(rs.lastIndex=0,rs.test(s))return r=k_.test(s),t[1]=pu(t[1],r),t[0]=pu(t[0],r,zu(t[1])),!0},ui,ut=(function(){var e=Date.now,t=500,s=33,r=e(),o=r,i=1e3/240,n=i,a=[],h,l,c,f,v,g,u=function d(m){var p=e()-o,b=m===!0,x,y,S,_;if((p>t||p<0)&&(r+=p-s),o+=p,S=o-r,x=S-n,(x>0||b)&&(_=++f.frame,v=S-f.time*1e3,f.time=S=S/1e3,n+=x+(x>=i?4:i-x),y=1),b||(h=l(d)),y)for(g=0;g<a.length;g++)a[g](S,v,_,m)};return f={time:0,frame:0,tick:function(){u(!0)},deltaRatio:function(m){return v/(1e3/(m||60))},wake:function(){bu&&(!Ma&&Wa()&&(Ut=Ma=window,Ga=Ut.document||{},xt.gsap=rt,(Ut.gsapVersions||(Ut.gsapVersions=[])).push(rt.version),_u(mn||Ut.GreenSockGlobals||!Ut.gsap&&Ut||{}),Fu.forEach(Bu)),c=typeof requestAnimationFrame<"u"&&requestAnimationFrame,h&&f.sleep(),l=c||function(m){return setTimeout(m,n-f.time*1e3+1|0)},ui=1,u(2))},sleep:function(){(c?cancelAnimationFrame:clearTimeout)(h),ui=0,l=di},lagSmoothing:function(m,p){t=m||1/0,s=Math.min(p||33,t)},fps:function(m){i=1e3/(m||240),n=f.time*1e3+i},add:function(m,p,b){var x=p?function(y,S,_,w){m(y,S,_,w),f.remove(x)}:m;return f.remove(m),a[b?"unshift":"push"](x),kr(),x},remove:function(m,p){~(p=a.indexOf(m))&&a.splice(p,1)&&g>=p&&g--},_listeners:a},f})(),kr=function(){return!ui&&ut.wake()},we={},C_=/^[\d.\-M][\d.\-,\s]/,E_=/["']/g,T_=function(t){for(var s={},r=t.substr(1,t.length-3).split(":"),o=r[0],i=1,n=r.length,a,h,l;i<n;i++)h=r[i],a=i!==n-1?h.lastIndexOf(","):h.length,l=h.substr(0,a),s[o]=isNaN(l)?l.replace(E_,"").trim():+l,o=h.substr(a+1).trim();return s},P_=function(t){var s=t.indexOf("(")+1,r=t.indexOf(")"),o=t.indexOf("(",s);return t.substring(s,~o&&o<r?t.indexOf(")",r+1):r)},D_=function(t){var s=(t+"").split("("),r=we[s[0]];return r&&s.length>1&&r.config?r.config.apply(null,~t.indexOf("{")?[T_(s[1])]:P_(t).split(",").map(Su)):we._CE&&C_.test(t)?we._CE("",t):r},R_=function(t){return function(s){return 1-t(1-s)}},Xs=function(t,s){return t&&(Ne(t)?t:we[t]||D_(t))||s},Zs=function(t,s,r,o){r===void 0&&(r=function(h){return 1-s(1-h)}),o===void 0&&(o=function(h){return h<.5?s(h*2)/2:1-s((1-h)*2)/2});var i={easeIn:s,easeOut:r,easeInOut:o},n;return nt(t,function(a){we[a]=xt[a]=i,we[n=a.toLowerCase()]=r;for(var h in i)we[n+(h==="easeIn"?".in":h==="easeOut"?".out":".inOut")]=we[a+"."+h]=i[h]}),i},Hu=function(t){return function(s){return s<.5?(1-t(1-s*2))/2:.5+t((s-.5)*2)/2}},Ra=function e(t,s,r){var o=s>=1?s:1,i=(r||(t?.3:.45))/(s<1?s:1),n=i/Oa*(Math.asin(1/o)||0),a=function(c){return c===1?1:o*Math.pow(2,-10*c)*e_((c-n)*i)+1},h=t==="out"?a:t==="in"?function(l){return 1-a(1-l)}:Hu(a);return i=Oa/i,h.config=function(l,c){return e(t,l,c)},h},Aa=function e(t,s){s===void 0&&(s=1.70158);var r=function(n){return n?--n*n*((s+1)*n+s)+1:0},o=t==="out"?r:t==="in"?function(i){return 1-r(1-i)}:Hu(r);return o.config=function(i){return e(t,i)},o};nt("Linear,Quad,Cubic,Quart,Quint,Strong",function(e,t){var s=t<5?t+1:t;Zs(e+",Power"+(s-1),t?function(r){return Math.pow(r,s)}:function(r){return r},function(r){return 1-Math.pow(1-r,s)},function(r){return r<.5?Math.pow(r*2,s)/2:1-Math.pow((1-r)*2,s)/2})});we.Linear.easeNone=we.none=we.Linear.easeIn;Zs("Elastic",Ra("in"),Ra("out"),Ra());(function(e,t){var s=1/t,r=2*s,o=2.5*s,i=function(a){return a<s?e*a*a:a<r?e*Math.pow(a-1.5/t,2)+.75:a<o?e*(a-=2.25/t)*a+.9375:e*Math.pow(a-2.625/t,2)+.984375};Zs("Bounce",function(n){return 1-i(1-n)},i)})(7.5625,2.75);Zs("Expo",function(e){return Math.pow(2,10*(e-1))*e+e*e*e*e*e*e*(1-e)});Zs("Circ",function(e){return-(gu(1-e*e)-1)});Zs("Sine",function(e){return e===1?1:-Zb(e*Yb)+1});Zs("Back",Aa("in"),Aa("out"),Aa());we.SteppedEase=we.steps=xt.SteppedEase={config:function(t,s){t===void 0&&(t=1);var r=1/t,o=t+(s?0:1),i=s?1:0,n=1-Te;return function(a){return((o*fi(0,n,a)|0)+i)*r}}};hi.ease=we["quad.out"];nt("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(e){return Ja+=e+","+e+"Params,"});var tl=function(t,s){this.id=Qb++,t._gsap=this,this.target=t,this.harness=s,this.get=s?s.get:Qa,this.set=s?s.getSetter:Cn},pi=(function(){function e(s){this.vars=s,this._delay=+s.delay||0,(this._repeat=s.repeat===1/0?-2:s.repeat||0)&&(this._rDelay=s.repeatDelay||0,this._yoyo=!!s.yoyo||!!s.yoyoEase),this._ts=1,Sr(this,+s.duration,1,1),this.data=s.data,Ae&&(this._ctx=Ae,Ae.data.push(this)),ui||ut.wake()}var t=e.prototype;return t.delay=function(r){return r||r===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+r-this._delay),this._delay=r,this):this._delay},t.duration=function(r){return arguments.length?this.totalDuration(this._repeat>0?r+(r+this._rDelay)*this._repeat:r):this.totalDuration()&&this._dur},t.totalDuration=function(r){return arguments.length?(this._dirty=0,Sr(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(r,o){if(kr(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(kn(this,r),!i._dp||i.parent||Eu(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&r<this._tDur||this._ts<0&&r>0||!this._tDur&&!r)&&Vt(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!o||this._initted&&Math.abs(this._zTime)===Te||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),wu(this,r,o)),this},t.time=function(r,o){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+cu(this))%(this._dur+this._rDelay)||(r?this._dur:0),o):this._time},t.totalProgress=function(r,o){return arguments.length?this.totalTime(this.totalDuration()*r,o):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},t.progress=function(r,o){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-r:r)+cu(this),o):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(r,o){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(r-1)*i,o):this._repeat?wr(this._tTime,i)+1:1},t.timeScale=function(r,o){if(!arguments.length)return this._rts===-Te?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?bn(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-Te?0:this._rts,this.totalTime(fi(-Math.abs(this._delay),this.totalDuration(),i),o!==!1),Sn(this),c_(this)},t.paused=function(r){return arguments.length?(this._ps!==r&&(this._ps=r,r?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(kr(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Te&&(this._tTime-=Te)))),this):this._ps},t.startTime=function(r){if(arguments.length){this._start=Ie(r);var o=this.parent||this._dp;return o&&(o._sort||!this.parent)&&Vt(o,this,this._start-this._delay),this}return this._start},t.endTime=function(r){return this._start+(pt(r)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(r){var o=this.parent||this._dp;return o?r&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?bn(o.rawTime(r),this):this._tTime:this._tTime},t.revert=function(r){r===void 0&&(r=o_);var o=Xe;return Xe=r,Za(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),Xe=o,this},t.globalTime=function(r){for(var o=this,i=arguments.length?r:o.rawTime();o;)i=o._start+i/(Math.abs(o._ts)||1),o=o._dp;return!this.parent&&this._sat?this._sat.globalTime(r):i},t.repeat=function(r){return arguments.length?(this._repeat=r===1/0?-2:r,du(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(r){if(arguments.length){var o=this._time;return this._rDelay=r,du(this),o?this.time(o):this}return this._rDelay},t.yoyo=function(r){return arguments.length?(this._yoyo=r,this):this._yoyo},t.seek=function(r,o){return this.totalTime(Dt(this,r),pt(o))},t.restart=function(r,o){return this.play().totalTime(r?-this._delay:0,pt(o)),this._dur||(this._zTime=-Te),this},t.play=function(r,o){return r!=null&&this.seek(r,o),this.reversed(!1).paused(!1)},t.reverse=function(r,o){return r!=null&&this.seek(r||this.totalDuration(),o),this.reversed(!0).paused(!1)},t.pause=function(r,o){return r!=null&&this.seek(r,o),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(r){return arguments.length?(!!r!==this.reversed()&&this.timeScale(-this._rts||(r?-Te:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-Te,this},t.isActive=function(){var r=this.parent||this._dp,o=this._start,i;return!!(!r||this._ts&&this._initted&&r.isActive()&&(i=r.rawTime(!0))>=o&&i<this.endTime(!0)-Te)},t.eventCallback=function(r,o,i){var n=this.vars;return arguments.length>1?(o?(n[r]=o,i&&(n[r+"Params"]=i),r==="onUpdate"&&(this._onUpdate=o)):delete n[r],this):n[r]},t.then=function(r){var o=this,i=o._prom;return new Promise(function(n){var a=Ne(r)?r:ku,h=function(){var c=o.then;o.then=null,i&&i(),Ne(a)&&(a=a(o))&&(a.then||a===o)&&(o.then=c),n(a),o.then=c};o._initted&&o.totalProgress()===1&&o._ts>=0||!o._tTime&&o._ts<0?h():o._prom=h})},t.kill=function(){ii(this)},e})();yt(pi.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Te,_prom:0,_ps:!1,_rts:1});var tt=(function(e){mu(t,e);function t(r,o){var i;return r===void 0&&(r={}),i=e.call(this,r)||this,i.labels={},i.smoothChildTiming=!!r.smoothChildTiming,i.autoRemoveChildren=!!r.autoRemoveChildren,i._sort=pt(r.sortChildren),Le&&Vt(r.parent||Le,ss(i),o),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&Tu(ss(i),r.scrollTrigger),i}var s=t.prototype;return s.to=function(o,i,n){return ai(0,arguments,this),this},s.from=function(o,i,n){return ai(1,arguments,this),this},s.fromTo=function(o,i,n,a){return ai(2,arguments,this),this},s.set=function(o,i,n){return i.duration=0,i.parent=this,oi(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new Ue(o,i,Dt(this,n),1),this},s.call=function(o,i,n){return Vt(this,Ue.delayedCall(0,o,i),n)},s.staggerTo=function(o,i,n,a,h,l,c){return n.duration=i,n.stagger=n.stagger||a,n.onComplete=l,n.onCompleteParams=c,n.parent=this,new Ue(o,n,Dt(this,h)),this},s.staggerFrom=function(o,i,n,a,h,l,c){return n.runBackwards=1,oi(n).immediateRender=pt(n.immediateRender),this.staggerTo(o,i,n,a,h,l,c)},s.staggerFromTo=function(o,i,n,a,h,l,c,f){return a.startAt=n,oi(a).immediateRender=pt(a.immediateRender),this.staggerTo(o,i,a,h,l,c,f)},s.render=function(o,i,n){var a=this._time,h=this._dirty?this.totalDuration():this._tDur,l=this._dur,c=o<=0?0:Ie(o),f=this._zTime<0!=o<0&&(this._initted||!l),v,g,u,d,m,p,b,x,y,S,_,w;if(this!==Le&&c>h&&o>=0&&(c=h),c!==this._tTime||n||f){if(a!==this._time&&l&&(c+=this._time-a,o+=this._time-a),v=c,y=this._start,x=this._ts,p=!x,f&&(l||(a=this._zTime),(o||!i)&&(this._zTime=o)),this._repeat){if(_=this._yoyo,m=l+this._rDelay,this._repeat<-1&&o<0)return this.totalTime(m*100+o,i,n);if(v=Ie(c%m),c===h?(d=this._repeat,v=l):(S=Ie(c/m),d=~~S,d&&d===S&&(v=l,d--),v>l&&(v=l)),S=wr(this._tTime,m),!a&&this._tTime&&S!==d&&this._tTime-S*m-this._dur<=0&&(S=d),_&&d&1&&(v=l-v,w=1),d!==S&&!this._lock){var C=_&&S&1,P=C===(_&&d&1);if(d<S&&(C=!C),a=C?0:c%l?l:c,this._lock=1,this.render(a||(w?0:Ie(d*m)),i,!l)._lock=0,this._tTime=c,!i&&this.parent&&_t(this,"onRepeat"),this.vars.repeatRefresh&&!w&&(this.invalidate()._lock=1,S=d),a&&a!==this._time||p!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(l=this._dur,h=this._tDur,P&&(this._lock=2,a=C?l:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!w&&this.invalidate()),this._lock=0,!this._ts&&!p)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(b=f_(this,Ie(a),Ie(v)),b&&(c-=v-(v=b._start))),this._tTime=c,this._time=v,this._act=!!x,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=o,a=0),!a&&c&&l&&!i&&!S&&(_t(this,"onStart"),this._tTime!==c))return this;if(v>=a&&o>=0)for(g=this._first;g;){if(u=g._next,(g._act||v>=g._start)&&g._ts&&b!==g){if(g.parent!==this)return this.render(o,i,n);if(g.render(g._ts>0?(v-g._start)*g._ts:(g._dirty?g.totalDuration():g._tDur)+(v-g._start)*g._ts,i,n),v!==this._time||!this._ts&&!p){b=0,u&&(c+=this._zTime=-Te);break}}g=u}else{g=this._last;for(var T=o<0?o:v;g;){if(u=g._prev,(g._act||T<=g._end)&&g._ts&&b!==g){if(g.parent!==this)return this.render(o,i,n);if(g.render(g._ts>0?(T-g._start)*g._ts:(g._dirty?g.totalDuration():g._tDur)+(T-g._start)*g._ts,i,n||Xe&&Za(g)),v!==this._time||!this._ts&&!p){b=0,u&&(c+=this._zTime=T?-Te:Te);break}}g=u}}if(b&&!i&&(this.pause(),b.render(v>=a?0:-Te)._zTime=v>=a?1:-1,this._ts))return this._start=y,Sn(this),this.render(o,i,n);this._onUpdate&&!i&&_t(this,"onUpdate",!0),(c===h&&this._tTime>=this.totalDuration()||!c&&a)&&(y===this._start||Math.abs(x)!==Math.abs(this._ts))&&(this._lock||((o||!l)&&(c===h&&this._ts>0||!c&&this._ts<0)&&xs(this,1),!i&&!(o<0&&!a)&&(c||a||!h)&&(_t(this,c===h&&o>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(c<h&&this.timeScale()>0)&&this._prom())))}return this},s.add=function(o,i){var n=this;if(is(i)||(i=Dt(this,i,o)),!(o instanceof pi)){if(st(o))return o.forEach(function(a){return n.add(a,i)}),this;if(qe(o))return this.addLabel(o,i);if(Ne(o))o=Ue.delayedCall(0,o);else return this}return this!==o?Vt(this,o,i):this},s.getChildren=function(o,i,n,a){o===void 0&&(o=!0),i===void 0&&(i=!0),n===void 0&&(n=!0),a===void 0&&(a=-Rt);for(var h=[],l=this._first;l;)l._start>=a&&(l instanceof Ue?i&&h.push(l):(n&&h.push(l),o&&h.push.apply(h,l.getChildren(!0,i,n)))),l=l._next;return h},s.getById=function(o){for(var i=this.getChildren(1,1,1),n=i.length;n--;)if(i[n].vars.id===o)return i[n]},s.remove=function(o){return qe(o)?this.removeLabel(o):Ne(o)?this.killTweensOf(o):(o.parent===this&&wn(this,o),o===this._recent&&(this._recent=this._last),Gs(this))},s.totalTime=function(o,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Ie(ut.time-(this._ts>0?o/this._ts:(this.totalDuration()-o)/-this._ts))),e.prototype.totalTime.call(this,o,i),this._forcing=0,this):this._tTime},s.addLabel=function(o,i){return this.labels[o]=Dt(this,i),this},s.removeLabel=function(o){return delete this.labels[o],this},s.addPause=function(o,i,n){var a=Ue.delayedCall(0,i||di,n);return a.data="isPause",this._hasPause=1,Vt(this,a,Dt(this,o))},s.removePause=function(o){var i=this._first;for(o=Dt(this,o);i;)i._start===o&&i.data==="isPause"&&xs(i),i=i._next},s.killTweensOf=function(o,i,n){for(var a=this.getTweensOf(o,n),h=a.length;h--;)vs!==a[h]&&a[h].kill(o,i);return this},s.getTweensOf=function(o,i){for(var n=[],a=At(o),h=this._first,l=is(i),c;h;)h instanceof Ue?a_(h._targets,a)&&(l?(!vs||h._initted&&h._ts)&&h.globalTime(0)<=i&&h.globalTime(h.totalDuration())>i:!i||h.isActive())&&n.push(h):(c=h.getTweensOf(a,i)).length&&n.push.apply(n,c),h=h._next;return n},s.tweenTo=function(o,i){i=i||{};var n=this,a=Dt(n,o),h=i,l=h.startAt,c=h.onStart,f=h.onStartParams,v=h.immediateRender,g,u=Ue.to(n,yt({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:i.duration||Math.abs((a-(l&&"time"in l?l.time:n._time))/n.timeScale())||Te,onStart:function(){if(n.pause(),!g){var m=i.duration||Math.abs((a-(l&&"time"in l?l.time:n._time))/n.timeScale());u._dur!==m&&Sr(u,m,0,1).render(u._time,!0,!0),g=1}c&&c.apply(u,f||[])}},i));return v?u.render(0):u},s.tweenFromTo=function(o,i,n){return this.tweenTo(i,yt({startAt:{time:Dt(this,o)}},n))},s.recent=function(){return this._recent},s.nextLabel=function(o){return o===void 0&&(o=this._time),uu(this,Dt(this,o))},s.previousLabel=function(o){return o===void 0&&(o=this._time),uu(this,Dt(this,o),1)},s.currentLabel=function(o){return arguments.length?this.seek(o,!0):this.previousLabel(this._time+Te)},s.shiftChildren=function(o,i,n){n===void 0&&(n=0);var a=this._first,h=this.labels,l;for(o=Ie(o);a;)a._start>=n&&(a._start+=o,a._end+=o),a=a._next;if(i)for(l in h)h[l]>=n&&(h[l]+=o);return Gs(this)},s.invalidate=function(o){var i=this._first;for(this._lock=0;i;)i.invalidate(o),i=i._next;return e.prototype.invalidate.call(this,o)},s.clear=function(o){o===void 0&&(o=!0);for(var i=this._first,n;i;)n=i._next,this.remove(i),i=n;return this._dp&&(this._time=this._tTime=this._pTime=0),o&&(this.labels={}),Gs(this)},s.totalDuration=function(o){var i=0,n=this,a=n._last,h=Rt,l,c,f;if(arguments.length)return n.timeScale((n._repeat<0?n.duration():n.totalDuration())/(n.reversed()?-o:o));if(n._dirty){for(f=n.parent;a;)l=a._prev,a._dirty&&a.totalDuration(),c=a._start,c>h&&n._sort&&a._ts&&!n._lock?(n._lock=1,Vt(n,a,c-a._delay,1)._lock=0):h=c,c<0&&a._ts&&(i-=c,(!f&&!n._dp||f&&f.smoothChildTiming)&&(n._start+=Ie(c/n._ts),n._time-=c,n._tTime-=c),n.shiftChildren(-c,!1,-1/0),h=0),a._end>i&&a._ts&&(i=a._end),a=l;Sr(n,n===Le&&n._time>i?n._time:i,1,1),n._dirty=0}return n._tDur},t.updateRoot=function(o){if(Le._ts&&(wu(Le,bn(o,Le)),yu=ut.frame),ut.frame>=lu){lu+=ft.autoSleep||120;var i=Le._first;if((!i||!i._ts)&&ft.autoSleep&&ut._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||ut.sleep()}}},t})(pi);yt(tt.prototype,{_lock:0,_hasPause:0,_forcing:0});var A_=function(t,s,r,o,i,n,a){var h=new ot(this._pt,t,s,0,1,ol,null,i),l=0,c=0,f,v,g,u,d,m,p,b;for(h.b=r,h.e=o,r+="",o+="",(p=~o.indexOf("random("))&&(o=Cr(o)),n&&(b=[r,o],n(b,t,s),r=b[0],o=b[1]),v=r.match(Ta)||[];f=Ta.exec(o);)u=f[0],d=o.substring(l,f.index),g?g=(g+1)%5:d.substr(-5)==="rgba("&&(g=1),u!==v[c++]&&(m=parseFloat(v[c-1])||0,h._pt={_next:h._pt,p:d||c===1?d:",",s:m,c:u.charAt(1)==="="?Qs(m,u)-m:parseFloat(u)-m,m:g&&g<4?Math.round:0},l=Ta.lastIndex);return h.c=l<o.length?o.substring(l,o.length):"",h.fp=a,(Ka.test(o)||p)&&(h.e=0),this._pt=h,h},sl=function(t,s,r,o,i,n,a,h,l,c){Ne(o)&&(o=o(i||0,t,n));var f=t[s],v=r!=="get"?r:Ne(f)?l?t[s.indexOf("set")||!Ne(t["get"+s.substr(3)])?s:"get"+s.substr(3)](l):t[s]():f,g=Ne(f)?l?F_:Vu:nl,u;if(qe(o)&&(~o.indexOf("random(")&&(o=Cr(o)),o.charAt(1)==="="&&(u=Qs(v,o)+(Je(v)||0),(u||u===0)&&(o=u))),!c||v!==o||Ua)return!isNaN(v*o)&&o!==""?(u=new ot(this._pt,t,s,+v||0,o-(v||0),typeof f=="boolean"?N_:ju,0,g),l&&(u.fp=l),a&&u.modifier(a,this,t),this._pt=u):(!f&&!(s in t)&&yn(s,o),A_.call(this,t,s,v,o,g,h||ft.stringFilter,l))},I_=function(t,s,r,o,i){if(Ne(t)&&(t=li(t,i,s,r,o)),!jt(t)||t.style&&t.nodeType||st(t)||vu(t))return qe(t)?li(t,i,s,r,o):t;var n={},a;for(a in t)n[a]=li(t[a],i,s,r,o);return n},rl=function(t,s,r,o,i,n){var a,h,l,c;if(dt[t]&&(a=new dt[t]).init(i,a.rawVars?s[t]:I_(s[t],o,i,n,r),r,o,n)!==!1&&(r._pt=h=new ot(r._pt,i,t,0,1,a.render,a,0,a.priority),r!==xr))for(l=r._ptLookup[r._targets.indexOf(i)],c=a._props.length;c--;)l[a._props[c]]=h;return a},vs,Ua,il=function e(t,s,r){var o=t.vars,i=o.ease,n=o.startAt,a=o.immediateRender,h=o.lazy,l=o.onUpdate,c=o.runBackwards,f=o.yoyoEase,v=o.keyframes,g=o.autoRevert,u=t._dur,d=t._startAt,m=t._targets,p=t.parent,b=p&&p.data==="nested"?p.vars.targets:m,x=t._overwrite==="auto"&&!ja,y=t.timeline,S=o.easeReverse||f,_,w,C,P,T,A,F,B,U,N,H,E,R;if(y&&(!v||!i)&&(i="none"),t._ease=Xs(i,hi.ease),t._rEase=S&&(Xs(S)||t._ease),t._from=!y&&!!o.runBackwards,t._from&&(t.ratio=1),!y||v&&!o.stagger){if(B=m[0]?_s(m[0]).harness:0,E=B&&o[B.prop],_=vn(o,Xa),d&&(d._zTime<0&&d.progress(1),s<0&&c&&a&&!g?d.render(-1,!0):d.revert(c&&u?un:n_),d._lazy=0),n){if(xs(t._startAt=Ue.set(m,yt({data:"isStart",overwrite:!1,parent:p,immediateRender:!0,lazy:!d&&pt(h),startAt:null,delay:0,onUpdate:l&&function(){return _t(t,"onUpdate")},stagger:0},n))),t._startAt._dp=0,t._startAt._sat=t,s<0&&(Xe||!a&&!g)&&t._startAt.revert(un),a&&u&&s<=0&&r<=0){s&&(t._zTime=s);return}}else if(c&&u&&!d){if(s&&(a=!1),C=yt({overwrite:!1,data:"isFromStart",lazy:a&&!d&&pt(h),immediateRender:a,stagger:0,parent:p},_),E&&(C[B.prop]=E),xs(t._startAt=Ue.set(m,C)),t._startAt._dp=0,t._startAt._sat=t,s<0&&(Xe?t._startAt.revert(un):t._startAt.render(-1,!0)),t._zTime=s,!a)e(t._startAt,Te,Te);else if(!s)return}for(t._pt=t._ptCache=0,h=u&&pt(h)||h&&!u,w=0;w<m.length;w++){if(T=m[w],F=T._gsap||Ya(m)[w]._gsap,t._ptLookup[w]=N={},Fa[F.id]&&bs.length&&gn(),H=b===m?w:b.indexOf(T),B&&(U=new B).init(T,E||_,t,H,b)!==!1&&(t._pt=P=new ot(t._pt,T,U.name,0,1,U.render,U,0,U.priority),U._props.forEach(function(L){N[L]=P}),U.priority&&(A=1)),!B||E)for(C in _)dt[C]&&(U=rl(C,_,t,H,T,b))?U.priority&&(A=1):N[C]=P=sl.call(t,T,C,"get",_[C],H,b,0,o.stringFilter);t._op&&t._op[w]&&t.kill(T,t._op[w]),x&&t._pt&&(vs=t,Le.killTweensOf(T,N,t.globalTime(s)),R=!t.parent,vs=0),t._pt&&h&&(Fa[F.id]=1)}A&&ll(t),t._onInit&&t._onInit(t)}t._onUpdate=l,t._initted=(!t._op||t._pt)&&!R,v&&s<=0&&y.render(Rt,!0,!0)},L_=function(t,s,r,o,i,n,a,h){var l=(t._pt&&t._ptCache||(t._ptCache={}))[s],c,f,v,g;if(!l)for(l=t._ptCache[s]=[],v=t._ptLookup,g=t._targets.length;g--;){if(c=v[g][s],c&&c.d&&c.d._pt)for(c=c.d._pt;c&&c.p!==s&&c.fp!==s;)c=c._next;if(!c)return Ua=1,t.vars[s]="+=0",il(t,a),Ua=0,h?ci(s+" not eligible for reset. Try splitting into individual properties"):1;l.push(c)}for(g=l.length;g--;)f=l[g],c=f._pt||f,c.s=(o||o===0)&&!i?o:c.s+(o||0)+n*c.c,c.c=r-c.s,f.e&&(f.e=ze(r)+Je(f.e)),f.b&&(f.b=c.s+Je(f.b))},O_=function(t,s){var r=t[0]?_s(t[0]).harness:0,o=r&&r.aliases,i,n,a,h;if(!o)return s;i=yr({},s);for(n in o)if(n in i)for(h=o[n].split(","),a=h.length;a--;)i[h[a]]=i[n];return i},M_=function(t,s,r,o){var i=s.ease||o||"power1.inOut",n,a;if(st(s))a=r[t]||(r[t]=[]),s.forEach(function(h,l){return a.push({t:l/(s.length-1)*100,v:h,e:i})});else for(n in s)a=r[n]||(r[n]=[]),n==="ease"||a.push({t:parseFloat(t),v:s[n],e:i})},li=function(t,s,r,o,i){return Ne(t)?t.call(s,r,o,i):qe(t)&&~t.indexOf("random(")?Cr(t):t},$u=Ja+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",Uu={};nt($u+",id,stagger,delay,duration,paused,scrollTrigger",function(e){return Uu[e]=1});var Ue=(function(e){mu(t,e);function t(r,o,i,n){var a;typeof o=="number"&&(i.duration=o,o=i,i=null),a=e.call(this,n?o:oi(o))||this;var h=a.vars,l=h.duration,c=h.delay,f=h.immediateRender,v=h.stagger,g=h.overwrite,u=h.keyframes,d=h.defaults,m=h.scrollTrigger,p=o.parent||Le,b=(st(r)||vu(r)?is(r[0]):"length"in o)?[r]:At(r),x,y,S,_,w,C,P,T;if(a._targets=b.length?Ya(b):ci("GSAP target "+r+" not found. https://gsap.com",!ft.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=g,u||v||dn(l)||dn(c)){o=a.vars;var A=o.easeReverse||o.yoyoEase;if(x=a.timeline=new tt({data:"nested",defaults:d||{},targets:p&&p.data==="nested"?p.vars.targets:b}),x.kill(),x.parent=x._dp=ss(a),x._start=0,v||dn(l)||dn(c)){if(_=b.length,P=v&&Au(v),jt(v))for(w in v)~$u.indexOf(w)&&(T||(T={}),T[w]=v[w]);for(y=0;y<_;y++)S=vn(o,Uu),S.stagger=0,A&&(S.easeReverse=A),T&&yr(S,T),C=b[y],S.duration=+li(l,ss(a),y,C,b),S.delay=(+li(c,ss(a),y,C,b)||0)-a._delay,!v&&_===1&&S.delay&&(a._delay=c=S.delay,a._start+=c,S.delay=0),x.to(C,S,P?P(y,C,b):0),x._ease=we.none;x.duration()?l=c=0:a.timeline=0}else if(u){oi(yt(x.vars.defaults,{ease:"none"})),x._ease=Xs(u.ease||o.ease||"none");var F=0,B,U,N;if(st(u))u.forEach(function(H){return x.to(b,H,">")}),x.duration();else{S={};for(w in u)w==="ease"||w==="easeEach"||M_(w,u[w],S,u.easeEach);for(w in S)for(B=S[w].sort(function(H,E){return H.t-E.t}),F=0,y=0;y<B.length;y++)U=B[y],N={ease:U.e,duration:(U.t-(y?B[y-1].t:0))/100*l},N[w]=U.v,x.to(b,N,F),F+=N.duration;x.duration()<l&&x.to({},{duration:l-x.duration()})}}l||a.duration(l=x.duration())}else a.timeline=0;return g===!0&&!ja&&(vs=ss(a),Le.killTweensOf(b),vs=0),Vt(p,ss(a),i),o.reversed&&a.reverse(),o.paused&&a.paused(!0),(f||!l&&!u&&a._start===Ie(p._time)&&pt(f)&&d_(ss(a))&&p.data!=="nested")&&(a._tTime=-Te,a.render(Math.max(0,-c)||0)),m&&Tu(ss(a),m),a}var s=t.prototype;return s.render=function(o,i,n){var a=this._time,h=this._tDur,l=this._dur,c=o<0,f=o>h-Te&&!c?h:o<Te?0:o,v,g,u,d,m,p,b,x;if(!l)p_(this,o,i,n);else if(f!==this._tTime||!o||n||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==c||this._lazy){if(v=f,x=this.timeline,this._repeat){if(d=l+this._rDelay,this._repeat<-1&&c)return this.totalTime(d*100+o,i,n);if(v=Ie(f%d),f===h?(u=this._repeat,v=l):(m=Ie(f/d),u=~~m,u&&u===m?(v=l,u--):v>l&&(v=l)),p=this._yoyo&&u&1,p&&(v=l-v),m=wr(this._tTime,d),v===a&&!n&&this._initted&&u===m)return this._tTime=f,this;u!==m&&this.vars.repeatRefresh&&!p&&!this._lock&&v!==d&&this._initted&&(this._lock=n=1,this.render(Ie(d*u),!0).invalidate()._lock=0)}if(!this._initted){if(Pu(this,c?o:v,n,i,f))return this._tTime=0,this;if(a!==this._time&&!(n&&this.vars.repeatRefresh&&u!==m))return this;if(l!==this._dur)return this.render(o,i,n)}if(this._rEase){var y=v<a;if(y!==this._inv){var S=y?a:l-a;this._inv=y,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=a,this._invRecip=S?(y?-1:1)/S:0,this._invScale=y?-this.ratio:1-this.ratio,this._invEase=y?this._rEase:this._ease}this.ratio=b=this._invRatio+this._invScale*this._invEase((v-this._invTime)*this._invRecip)}else this.ratio=b=this._ease(v/l);if(this._from&&(this.ratio=b=1-b),this._tTime=f,this._time=v,!this._act&&this._ts&&(this._act=1,this._lazy=0),!a&&f&&!i&&!m&&(_t(this,"onStart"),this._tTime!==f))return this;for(g=this._pt;g;)g.r(b,g.d),g=g._next;x&&x.render(o<0?o:x._dur*x._ease(v/this._dur),i,n)||this._startAt&&(this._zTime=o),this._onUpdate&&!i&&(c&&Ba(this,o,i,n),_t(this,"onUpdate")),this._repeat&&u!==m&&this.vars.onRepeat&&!i&&this.parent&&_t(this,"onRepeat"),(f===this._tDur||!f)&&this._tTime===f&&(c&&!this._onUpdate&&Ba(this,o,!0,!0),(o||!l)&&(f===this._tDur&&this._ts>0||!f&&this._ts<0)&&xs(this,1),!i&&!(c&&!a)&&(f||a||p)&&(_t(this,f===h?"onComplete":"onReverseComplete",!0),this._prom&&!(f<h&&this.timeScale()>0)&&this._prom()))}return this},s.targets=function(){return this._targets},s.invalidate=function(o){return(!o||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(o),e.prototype.invalidate.call(this,o)},s.resetTo=function(o,i,n,a,h){ui||ut.wake(),this._ts||this.play();var l=Math.min(this._dur,(this._dp._time-this._start)*this._ts),c;return this._initted||il(this,l),c=this._ease(l/this._dur),L_(this,o,i,n,a,c,l,h)?this.resetTo(o,i,n,a,1):(kn(this,0),this.parent||Cu(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},s.kill=function(o,i){if(i===void 0&&(i="all"),!o&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?ii(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Xe),this;if(this.timeline){var n=this.timeline.totalDuration();return this.timeline.killTweensOf(o,i,vs&&vs.vars.overwrite!==!0)._first||ii(this),this.parent&&n!==this.timeline.totalDuration()&&Sr(this,this._dur*this.timeline._tDur/n,0,1),this}var a=this._targets,h=o?At(o):a,l=this._ptLookup,c=this._pt,f,v,g,u,d,m,p;if((!i||i==="all")&&h_(a,h))return i==="all"&&(this._pt=0),ii(this);for(f=this._op=this._op||[],i!=="all"&&(qe(i)&&(d={},nt(i,function(b){return d[b]=1}),i=d),i=O_(a,i)),p=a.length;p--;)if(~h.indexOf(a[p])){v=l[p],i==="all"?(f[p]=i,u=v,g={}):(g=f[p]=f[p]||{},u=i);for(d in u)m=v&&v[d],m&&((!("kill"in m.d)||m.d.kill(d)===!0)&&wn(this,m,"_pt"),delete v[d]),g!=="all"&&(g[d]=1)}return this._initted&&!this._pt&&c&&ii(this),this},t.to=function(o,i){return new t(o,i,arguments[2])},t.from=function(o,i){return ai(1,arguments)},t.delayedCall=function(o,i,n,a){return new t(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:o,onComplete:i,onReverseComplete:i,onCompleteParams:n,onReverseCompleteParams:n,callbackScope:a})},t.fromTo=function(o,i,n){return ai(2,arguments)},t.set=function(o,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new t(o,i)},t.killTweensOf=function(o,i,n){return Le.killTweensOf(o,i,n)},t})(pi);yt(Ue.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});nt("staggerTo,staggerFrom,staggerFromTo",function(e){Ue[e]=function(){var t=new tt,s=za.call(arguments,0);return s.splice(e==="staggerFromTo"?5:4,0,0),t[e].apply(t,s)}});var nl=function(t,s,r){return t[s]=r},Vu=function(t,s,r){return t[s](r)},F_=function(t,s,r,o){return t[s](o.fp,r)},B_=function(t,s,r){return t.setAttribute(s,r)},Cn=function(t,s){return Ne(t[s])?Vu:xn(t[s])&&t.setAttribute?B_:nl},ju=function(t,s){return s.set(s.t,s.p,Math.round((s.s+s.c*t)*1e6)/1e6,s)},N_=function(t,s){return s.set(s.t,s.p,!!(s.s+s.c*t),s)},ol=function(t,s){var r=s._pt,o="";if(!t&&s.b)o=s.b;else if(t===1&&s.e)o=s.e;else{for(;r;)o=r.p+(r.m?r.m(r.s+r.c*t):Math.round((r.s+r.c*t)*1e4)/1e4)+o,r=r._next;o+=s.c}s.set(s.t,s.p,o,s)},al=function(t,s){for(var r=s._pt;r;)r.r(t,r.d),r=r._next},z_=function(t,s,r,o){for(var i=this._pt,n;i;)n=i._next,i.p===o&&i.modifier(t,s,r),i=n},H_=function(t){for(var s=this._pt,r,o;s;)o=s._next,s.p===t&&!s.op||s.op===t?wn(this,s,"_pt"):s.dep||(r=1),s=o;return!r},$_=function(t,s,r,o){o.mSet(t,s,o.m.call(o.tween,r,o.mt),o)},ll=function(t){for(var s=t._pt,r,o,i,n;s;){for(r=s._next,o=i;o&&o.pr>s.pr;)o=o._next;(s._prev=o?o._prev:n)?s._prev._next=s:i=s,(s._next=o)?o._prev=s:n=s,s=r}t._pt=i},ot=(function(){function e(s,r,o,i,n,a,h,l,c){this.t=r,this.s=i,this.c=n,this.p=o,this.r=a||ju,this.d=h||this,this.set=l||nl,this.pr=c||0,this._next=s,s&&(s._prev=this)}var t=e.prototype;return t.modifier=function(r,o,i){this.mSet=this.mSet||this.set,this.set=$_,this.m=r,this.mt=i,this.tween=o},e})();nt(Ja+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse",function(e){return Xa[e]=1});xt.TweenMax=xt.TweenLite=Ue;xt.TimelineLite=xt.TimelineMax=tt;Le=new tt({sortChildren:!1,defaults:hi,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});ft.stringFilter=el;var Js=[],fn={},U_=[],fu=0,V_=0,Ia=function(t){return(fn[t]||U_).map(function(s){return s()})},Va=function(){var t=Date.now(),s=[];t-fu>2&&(Ia("matchMediaInit"),Js.forEach(function(r){var o=r.queries,i=r.conditions,n,a,h,l;for(a in o)n=Ut.matchMedia(o[a]).matches,n&&(h=1),n!==i[a]&&(i[a]=n,l=1);l&&(r.revert(),h&&s.push(r))}),Ia("matchMediaRevert"),s.forEach(function(r){return r.onMatch(r,function(o){return r.add(null,o)})}),fu=t,Ia("matchMedia"))},Wu=(function(){function e(s,r){this.selector=r&&Ha(r),this.data=[],this._r=[],this.isReverted=!1,this.id=V_++,s&&this.add(s)}var t=e.prototype;return t.add=function(r,o,i){Ne(r)&&(i=o,o=r,r=Ne);var n=this,a=function(){var l=Ae,c=n.selector,f;return l&&l!==n&&l.data.push(n),i&&(n.selector=Ha(i)),Ae=n,f=o.apply(n,arguments),Ne(f)&&n._r.push(f),Ae=l,n.selector=c,n.isReverted=!1,f};return n.last=a,r===Ne?a(n,function(h){return n.add(null,h)}):r?n[r]=a:a},t.ignore=function(r){var o=Ae;Ae=null,r(this),Ae=o},t.getTweens=function(){var r=[];return this.data.forEach(function(o){return o instanceof e?r.push.apply(r,o.getTweens()):o instanceof Ue&&!(o.parent&&o.parent.data==="nested")&&r.push(o)}),r},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(r,o){var i=this;if(r?(function(){for(var a=i.getTweens(),h=i.data.length,l;h--;)l=i.data[h],l.data==="isFlip"&&(l.revert(),l.getChildren(!0,!0,!1).forEach(function(c){return a.splice(a.indexOf(c),1)}));for(a.map(function(c){return{g:c._dur||c._delay||c._sat&&!c._sat.vars.immediateRender?c.globalTime(0):-1/0,t:c}}).sort(function(c,f){return f.g-c.g||-1/0}).forEach(function(c){return c.t.revert(r)}),h=i.data.length;h--;)l=i.data[h],l instanceof tt?l.data!=="nested"&&(l.scrollTrigger&&l.scrollTrigger.revert(),l.kill()):!(l instanceof Ue)&&l.revert&&l.revert(r);i._r.forEach(function(c){return c(r,i)}),i.isReverted=!0})():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),o)for(var n=Js.length;n--;)Js[n].id===this.id&&Js.splice(n,1)},t.revert=function(r){this.kill(r||{})},e})(),j_=(function(){function e(s){this.contexts=[],this.scope=s,Ae&&Ae.data.push(this)}var t=e.prototype;return t.add=function(r,o,i){jt(r)||(r={matches:r});var n=new Wu(0,i||this.scope),a=n.conditions={},h,l,c;Ae&&!n.selector&&(n.selector=Ae.selector),this.contexts.push(n),o=n.add("onMatch",o),n.queries=r;for(l in r)l==="all"?c=1:(h=Ut.matchMedia(r[l]),h&&(Js.indexOf(n)<0&&Js.push(n),(a[l]=h.matches)&&(c=1),h.addListener?h.addListener(Va):h.addEventListener("change",Va)));return c&&o(n,function(f){return n.add(null,f)}),this},t.revert=function(r){this.kill(r||{})},t.kill=function(r){this.contexts.forEach(function(o){return o.kill(r,!0)})},e})(),_n={registerPlugin:function(){for(var t=arguments.length,s=new Array(t),r=0;r<t;r++)s[r]=arguments[r];s.forEach(function(o){return Bu(o)})},timeline:function(t){return new tt(t)},getTweensOf:function(t,s){return Le.getTweensOf(t,s)},getProperty:function(t,s,r,o){qe(t)&&(t=At(t)[0]);var i=_s(t||{}).get,n=r?ku:Su;return r==="native"&&(r=""),t&&(s?n((dt[s]&&dt[s].get||i)(t,s,r,o)):function(a,h,l){return n((dt[a]&&dt[a].get||i)(t,a,h,l))})},quickSetter:function(t,s,r){if(t=At(t),t.length>1){var o=t.map(function(c){return rt.quickSetter(c,s,r)}),i=o.length;return function(c){for(var f=i;f--;)o[f](c)}}t=t[0]||{};var n=dt[s],a=_s(t),h=a.harness&&(a.harness.aliases||{})[s]||s,l=n?function(c){var f=new n;xr._pt=0,f.init(t,r?c+r:c,xr,0,[t]),f.render(1,f),xr._pt&&al(1,xr)}:a.set(t,h);return n?l:function(c){return l(t,h,r?c+r:c,a,1)}},quickTo:function(t,s,r){var o,i=rt.to(t,yt((o={},o[s]="+=0.1",o.paused=!0,o.stagger=0,o),r||{})),n=function(h,l,c){return i.resetTo(s,h,l,c)};return n.tween=i,n},isTweening:function(t){return Le.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=Xs(t.ease,hi.ease)),hu(hi,t||{})},config:function(t){return hu(ft,t||{})},registerEffect:function(t){var s=t.name,r=t.effect,o=t.plugins,i=t.defaults,n=t.extendTimeline;(o||"").split(",").forEach(function(a){return a&&!dt[a]&&!xt[a]&&ci(s+" effect requires "+a+" plugin.")}),Pa[s]=function(a,h,l){return r(At(a),yt(h||{},i),l)},n&&(tt.prototype[s]=function(a,h,l){return this.add(Pa[s](a,jt(h)?h:(l=h)&&{},this),l)})},registerEase:function(t,s){we[t]=Xs(s)},parseEase:function(t,s){return arguments.length?Xs(t,s):we},getById:function(t){return Le.getById(t)},exportRoot:function(t,s){t===void 0&&(t={});var r=new tt(t),o,i;for(r.smoothChildTiming=pt(t.smoothChildTiming),Le.remove(r),r._dp=0,r._time=r._tTime=Le._time,o=Le._first;o;)i=o._next,(s||!(!o._dur&&o instanceof Ue&&o.vars.onComplete===o._targets[0]))&&Vt(r,o,o._start-o._delay),o=i;return Vt(Le,r,0),r},context:function(t,s){return t?new Wu(t,s):Ae},matchMedia:function(t){return new j_(t)},matchMediaRefresh:function(){return Js.forEach(function(t){var s=t.conditions,r,o;for(o in s)s[o]&&(s[o]=!1,r=1);r&&t.revert()})||Va()},addEventListener:function(t,s){var r=fn[t]||(fn[t]=[]);~r.indexOf(s)||r.push(s)},removeEventListener:function(t,s){var r=fn[t],o=r&&r.indexOf(s);o>=0&&r.splice(o,1)},utils:{wrap:y_,wrapYoyo:w_,distribute:Au,random:Lu,snap:Iu,normalize:x_,getUnit:Je,clamp:g_,splitColor:Nu,toArray:At,selector:Ha,mapRange:Mu,pipe:b_,unitize:__,interpolate:S_,shuffle:Ru},install:_u,effects:Pa,ticker:ut,updateRoot:tt.updateRoot,plugins:dt,globalTimeline:Le,core:{PropTween:ot,globals:xu,Tween:Ue,Timeline:tt,Animation:pi,getCache:_s,_removeLinkedListItem:wn,reverting:function(){return Xe},context:function(t){return t&&Ae&&(Ae.data.push(t),t._ctx=Ae),Ae},suppressOverwrites:function(t){return ja=t}}};nt("to,from,fromTo,delayedCall,set,killTweensOf",function(e){return _n[e]=Ue[e]});ut.add(tt.updateRoot);xr=_n.to({},{duration:0});var W_=function(t,s){for(var r=t._pt;r&&r.p!==s&&r.op!==s&&r.fp!==s;)r=r._next;return r},q_=function(t,s){var r=t._targets,o,i,n;for(o in s)for(i=r.length;i--;)n=t._ptLookup[i][o],n&&(n=n.d)&&(n._pt&&(n=W_(n,o)),n&&n.modifier&&n.modifier(s[o],t,r[i],o))},La=function(t,s){return{name:t,headless:1,rawVars:1,init:function(o,i,n){n._onInit=function(a){var h,l;if(qe(i)&&(h={},nt(i,function(c){return h[c]=1}),i=h),s){h={};for(l in i)h[l]=s(i[l]);i=h}q_(a,i)}}}},rt=_n.registerPlugin({name:"attr",init:function(t,s,r,o,i){var n,a,h;this.tween=r;for(n in s)h=t.getAttribute(n)||"",a=this.add(t,"setAttribute",(h||0)+"",s[n],o,i,0,0,n),a.op=n,a.b=h,this._props.push(n)},render:function(t,s){for(var r=s._pt;r;)Xe?r.set(r.t,r.p,r.b,r):r.r(t,r.d),r=r._next}},{name:"endArray",headless:1,init:function(t,s){for(var r=s.length;r--;)this.add(t,r,t[r]||0,s[r],0,0,0,0,0,1)}},La("roundProps",$a),La("modifiers"),La("snap",Iu))||_n;Ue.version=tt.version=rt.version="3.15.0";bu=1;Wa()&&kr();var K_=we.Power0,G_=we.Power1,X_=we.Power2,J_=we.Power3,Y_=we.Power4,Q_=we.Linear,Z_=we.Quad,e0=we.Cubic,t0=we.Quart,s0=we.Quint,r0=we.Strong,i0=we.Elastic,n0=we.Back,o0=we.SteppedEase,a0=we.Bounce,l0=we.Sine,h0=we.Expo,c0=we.Circ;var qu,ws,Tr,fl,rr,d0,Ku,ml,u0=function(){return typeof window<"u"},os={},sr=180/Math.PI,Pr=Math.PI/180,Er=Math.atan2,Gu=1e8,gl=/([A-Z])/g,p0=/(left|right|width|margin|padding|x)/i,f0=/[\s,\(]\S/,Wt={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},cl=function(t,s){return s.set(s.t,s.p,Math.round((s.s+s.c*t)*1e4)/1e4+s.u,s)},m0=function(t,s){return s.set(s.t,s.p,t===1?s.e:Math.round((s.s+s.c*t)*1e4)/1e4+s.u,s)},g0=function(t,s){return s.set(s.t,s.p,t?Math.round((s.s+s.c*t)*1e4)/1e4+s.u:s.b,s)},v0=function(t,s){return s.set(s.t,s.p,t===1?s.e:t?Math.round((s.s+s.c*t)*1e4)/1e4+s.u:s.b,s)},b0=function(t,s){var r=s.s+s.c*t;s.set(s.t,s.p,~~(r+(r<0?-.5:.5))+s.u,s)},sp=function(t,s){return s.set(s.t,s.p,t?s.e:s.b,s)},rp=function(t,s){return s.set(s.t,s.p,t!==1?s.b:s.e,s)},_0=function(t,s,r){return t.style[s]=r},x0=function(t,s,r){return t.style.setProperty(s,r)},y0=function(t,s,r){return t._gsap[s]=r},w0=function(t,s,r){return t._gsap.scaleX=t._gsap.scaleY=r},S0=function(t,s,r,o,i){var n=t._gsap;n.scaleX=n.scaleY=r,n.renderTransform(i,n)},k0=function(t,s,r,o,i){var n=t._gsap;n[s]=r,n.renderTransform(i,n)},Oe="transform",mt=Oe+"Origin",C0=function e(t,s){var r=this,o=this.target,i=o.style,n=o._gsap;if(t in os&&i){if(this.tfm=this.tfm||{},t!=="transform")t=Wt[t]||t,~t.indexOf(",")?t.split(",").forEach(function(a){return r.tfm[a]=ns(o,a)}):this.tfm[t]=n.x?n[t]:ns(o,t),t===mt&&(this.tfm.zOrigin=n.zOrigin);else return Wt.transform.split(",").forEach(function(a){return e.call(r,a,s)});if(this.props.indexOf(Oe)>=0)return;n.svg&&(this.svgo=o.getAttribute("data-svg-origin"),this.props.push(mt,s,"")),t=Oe}(i||s)&&this.props.push(t,s,i[t])},ip=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},E0=function(){var t=this.props,s=this.target,r=s.style,o=s._gsap,i,n;for(i=0;i<t.length;i+=3)t[i+1]?t[i+1]===2?s[t[i]](t[i+2]):s[t[i]]=t[i+2]:t[i+2]?r[t[i]]=t[i+2]:r.removeProperty(t[i].substr(0,2)==="--"?t[i]:t[i].replace(gl,"-$1").toLowerCase());if(this.tfm){for(n in this.tfm)o[n]=this.tfm[n];o.svg&&(o.renderTransform(),s.setAttribute("data-svg-origin",this.svgo||"")),i=ml(),(!i||!i.isStart)&&!r[Oe]&&(ip(r),o.zOrigin&&r[mt]&&(r[mt]+=" "+o.zOrigin+"px",o.zOrigin=0,o.renderTransform()),o.uncache=1)}},np=function(t,s){var r={target:t,props:[],revert:E0,save:C0};return t._gsap||rt.core.getCache(t),s&&t.style&&t.nodeType&&s.split(",").forEach(function(o){return r.save(o)}),r},op,dl=function(t,s){var r=ws.createElementNS?ws.createElementNS((s||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):ws.createElement(t);return r&&r.style?r:ws.createElement(t)},wt=function e(t,s,r){var o=getComputedStyle(t);return o[s]||o.getPropertyValue(s.replace(gl,"-$1").toLowerCase())||o.getPropertyValue(s)||!r&&e(t,Dr(s)||s,1)||""},Xu="O,Moz,ms,Ms,Webkit".split(","),Dr=function(t,s,r){var o=s||rr,i=o.style,n=5;if(t in i&&!r)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);n--&&!(Xu[n]+t in i););return n<0?null:(n===3?"ms":n>=0?Xu[n]:"")+t},ul=function(){u0()&&window.document&&(qu=window,ws=qu.document,Tr=ws.documentElement,rr=dl("div")||{style:{}},d0=dl("div"),Oe=Dr(Oe),mt=Oe+"Origin",rr.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",op=!!Dr("perspective"),ml=rt.core.reverting,fl=1)},Ju=function(t){var s=t.ownerSVGElement,r=dl("svg",s&&s.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),o=t.cloneNode(!0),i;o.style.display="block",r.appendChild(o),Tr.appendChild(r);try{i=o.getBBox()}catch{}return r.removeChild(o),Tr.removeChild(r),i},Yu=function(t,s){for(var r=s.length;r--;)if(t.hasAttribute(s[r]))return t.getAttribute(s[r])},ap=function(t){var s,r;try{s=t.getBBox()}catch{s=Ju(t),r=1}return s&&(s.width||s.height)||r||(s=Ju(t)),s&&!s.width&&!s.x&&!s.y?{x:+Yu(t,["x","cx","x1"])||0,y:+Yu(t,["y","cy","y1"])||0,width:0,height:0}:s},lp=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&ap(t))},ks=function(t,s){if(s){var r=t.style,o;s in os&&s!==mt&&(s=Oe),r.removeProperty?(o=s.substr(0,2),(o==="ms"||s.substr(0,6)==="webkit")&&(s="-"+s),r.removeProperty(o==="--"?s:s.replace(gl,"-$1").toLowerCase())):r.removeAttribute(s)}},Ss=function(t,s,r,o,i,n){var a=new ot(t._pt,s,r,0,1,n?rp:sp);return t._pt=a,a.b=o,a.e=i,t._props.push(r),a},Qu={deg:1,rad:1,turn:1},T0={grid:1,flex:1},Cs=function e(t,s,r,o){var i=parseFloat(r)||0,n=(r+"").trim().substr((i+"").length)||"px",a=rr.style,h=p0.test(s),l=t.tagName.toLowerCase()==="svg",c=(l?"client":"offset")+(h?"Width":"Height"),f=100,v=o==="px",g=o==="%",u,d,m,p;if(o===n||!i||Qu[o]||Qu[n])return i;if(n!=="px"&&!v&&(i=e(t,s,r,"px")),p=t.getCTM&&lp(t),(g||n==="%")&&(os[s]||~s.indexOf("adius")))return u=p?t.getBBox()[h?"width":"height"]:t[c],ze(g?i/u*f:i/100*u);if(a[h?"width":"height"]=f+(v?n:o),d=o!=="rem"&&~s.indexOf("adius")||o==="em"&&t.appendChild&&!l?t:t.parentNode,p&&(d=(t.ownerSVGElement||{}).parentNode),(!d||d===ws||!d.appendChild)&&(d=ws.body),m=d._gsap,m&&g&&m.width&&h&&m.time===ut.time&&!m.uncache)return ze(i/m.width*f);if(g&&(s==="height"||s==="width")){var b=t.style[s];t.style[s]=f+o,u=t[c],b?t.style[s]=b:ks(t,s)}else(g||n==="%")&&!T0[wt(d,"display")]&&(a.position=wt(t,"position")),d===t&&(a.position="static"),d.appendChild(rr),u=rr[c],d.removeChild(rr),a.position="absolute";return h&&g&&(m=_s(d),m.time=ut.time,m.width=d[c]),ze(v?u*i/f:u&&i?f/u*i:0)},ns=function(t,s,r,o){var i;return fl||ul(),s in Wt&&s!=="transform"&&(s=Wt[s],~s.indexOf(",")&&(s=s.split(",")[0])),os[s]&&s!=="transform"?(i=vi(t,o),i=s!=="transformOrigin"?i[s]:i.svg?i.origin:Tn(wt(t,mt))+" "+i.zOrigin+"px"):(i=t.style[s],(!i||i==="auto"||o||~(i+"").indexOf("calc("))&&(i=En[s]&&En[s](t,s,r)||wt(t,s)||Qa(t,s)||(s==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?Cs(t,s,i,r)+r:i},P0=function(t,s,r,o){if(!r||r==="none"){var i=Dr(s,t,1),n=i&&wt(t,i,1);n&&n!==r?(s=i,r=n):s==="borderColor"&&(r=wt(t,"borderTopColor"))}var a=new ot(this._pt,t.style,s,0,1,ol),h=0,l=0,c,f,v,g,u,d,m,p,b,x,y,S;if(a.b=r,a.e=o,r+="",o+="",o.substring(0,6)==="var(--"&&(o=wt(t,o.substring(4,o.indexOf(")")))),o==="auto"&&(d=t.style[s],t.style[s]=o,o=wt(t,s)||o,d?t.style[s]=d:ks(t,s)),c=[r,o],el(c),r=c[0],o=c[1],v=r.match(Ys)||[],S=o.match(Ys)||[],S.length){for(;f=Ys.exec(o);)m=f[0],b=o.substring(h,f.index),u?u=(u+1)%5:(b.substr(-5)==="rgba("||b.substr(-5)==="hsla(")&&(u=1),m!==(d=v[l++]||"")&&(g=parseFloat(d)||0,y=d.substr((g+"").length),m.charAt(1)==="="&&(m=Qs(g,m)+y),p=parseFloat(m),x=m.substr((p+"").length),h=Ys.lastIndex-x.length,x||(x=x||ft.units[s]||y,h===o.length&&(o+=x,a.e+=x)),y!==x&&(g=Cs(t,s,d,x)||0),a._pt={_next:a._pt,p:b||l===1?b:",",s:g,c:p-g,m:u&&u<4||s==="zIndex"?Math.round:0});a.c=h<o.length?o.substring(h,o.length):""}else a.r=s==="display"&&o==="none"?rp:sp;return Ka.test(o)&&(a.e=0),this._pt=a,a},Zu={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},D0=function(t){var s=t.split(" "),r=s[0],o=s[1]||"50%";return(r==="top"||r==="bottom"||o==="left"||o==="right")&&(t=r,r=o,o=t),s[0]=Zu[r]||r,s[1]=Zu[o]||o,s.join(" ")},R0=function(t,s){if(s.tween&&s.tween._time===s.tween._dur){var r=s.t,o=r.style,i=s.u,n=r._gsap,a,h,l;if(i==="all"||i===!0)o.cssText="",h=1;else for(i=i.split(","),l=i.length;--l>-1;)a=i[l],os[a]&&(h=1,a=a==="transformOrigin"?mt:Oe),ks(r,a);h&&(ks(r,Oe),n&&(n.svg&&r.removeAttribute("transform"),o.scale=o.rotate=o.translate="none",vi(r,1),n.uncache=1,ip(o)))}},En={clearProps:function(t,s,r,o,i){if(i.data!=="isFromStart"){var n=t._pt=new ot(t._pt,s,r,0,0,R0);return n.u=o,n.pr=-10,n.tween=i,t._props.push(r),1}}},gi=[1,0,0,1,0,0],hp={},cp=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},ep=function(t){var s=wt(t,Oe);return cp(s)?gi:s.substr(7).match(qa).map(ze)},vl=function(t,s){var r=t._gsap||_s(t),o=t.style,i=ep(t),n,a,h,l;return r.svg&&t.getAttribute("transform")?(h=t.transform.baseVal.consolidate().matrix,i=[h.a,h.b,h.c,h.d,h.e,h.f],i.join(",")==="1,0,0,1,0,0"?gi:i):(i===gi&&!t.offsetParent&&t!==Tr&&!r.svg&&(h=o.display,o.display="block",n=t.parentNode,(!n||!t.offsetParent&&!t.getBoundingClientRect().width)&&(l=1,a=t.nextElementSibling,Tr.appendChild(t)),i=ep(t),h?o.display=h:ks(t,"display"),l&&(a?n.insertBefore(t,a):n?n.appendChild(t):Tr.removeChild(t))),s&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},pl=function(t,s,r,o,i,n){var a=t._gsap,h=i||vl(t,!0),l=a.xOrigin||0,c=a.yOrigin||0,f=a.xOffset||0,v=a.yOffset||0,g=h[0],u=h[1],d=h[2],m=h[3],p=h[4],b=h[5],x=s.split(" "),y=parseFloat(x[0])||0,S=parseFloat(x[1])||0,_,w,C,P;r?h!==gi&&(w=g*m-u*d)&&(C=y*(m/w)+S*(-d/w)+(d*b-m*p)/w,P=y*(-u/w)+S*(g/w)-(g*b-u*p)/w,y=C,S=P):(_=ap(t),y=_.x+(~x[0].indexOf("%")?y/100*_.width:y),S=_.y+(~(x[1]||x[0]).indexOf("%")?S/100*_.height:S)),o||o!==!1&&a.smooth?(p=y-l,b=S-c,a.xOffset=f+(p*g+b*d)-p,a.yOffset=v+(p*u+b*m)-b):a.xOffset=a.yOffset=0,a.xOrigin=y,a.yOrigin=S,a.smooth=!!o,a.origin=s,a.originIsAbsolute=!!r,t.style[mt]="0px 0px",n&&(Ss(n,a,"xOrigin",l,y),Ss(n,a,"yOrigin",c,S),Ss(n,a,"xOffset",f,a.xOffset),Ss(n,a,"yOffset",v,a.yOffset)),t.setAttribute("data-svg-origin",y+" "+S)},vi=function(t,s){var r=t._gsap||new tl(t);if("x"in r&&!s&&!r.uncache)return r;var o=t.style,i=r.scaleX<0,n="px",a="deg",h=getComputedStyle(t),l=wt(t,mt)||"0",c,f,v,g,u,d,m,p,b,x,y,S,_,w,C,P,T,A,F,B,U,N,H,E,R,L,k,$,X,O,se,z;return c=f=v=d=m=p=b=x=y=0,g=u=1,r.svg=!!(t.getCTM&&lp(t)),h.translate&&((h.translate!=="none"||h.scale!=="none"||h.rotate!=="none")&&(o[Oe]=(h.translate!=="none"?"translate3d("+(h.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(h.rotate!=="none"?"rotate("+h.rotate+") ":"")+(h.scale!=="none"?"scale("+h.scale.split(" ").join(",")+") ":"")+(h[Oe]!=="none"?h[Oe]:"")),o.scale=o.rotate=o.translate="none"),w=vl(t,r.svg),r.svg&&(r.uncache?(R=t.getBBox(),l=r.xOrigin-R.x+"px "+(r.yOrigin-R.y)+"px",E=""):E=!s&&t.getAttribute("data-svg-origin"),pl(t,E||l,!!E||r.originIsAbsolute,r.smooth!==!1,w)),S=r.xOrigin||0,_=r.yOrigin||0,w!==gi&&(A=w[0],F=w[1],B=w[2],U=w[3],c=N=w[4],f=H=w[5],w.length===6?(g=Math.sqrt(A*A+F*F),u=Math.sqrt(U*U+B*B),d=A||F?Er(F,A)*sr:0,b=B||U?Er(B,U)*sr+d:0,b&&(u*=Math.abs(Math.cos(b*Pr))),r.svg&&(c-=S-(S*A+_*B),f-=_-(S*F+_*U))):(z=w[6],O=w[7],k=w[8],$=w[9],X=w[10],se=w[11],c=w[12],f=w[13],v=w[14],C=Er(z,X),m=C*sr,C&&(P=Math.cos(-C),T=Math.sin(-C),E=N*P+k*T,R=H*P+$*T,L=z*P+X*T,k=N*-T+k*P,$=H*-T+$*P,X=z*-T+X*P,se=O*-T+se*P,N=E,H=R,z=L),C=Er(-B,X),p=C*sr,C&&(P=Math.cos(-C),T=Math.sin(-C),E=A*P-k*T,R=F*P-$*T,L=B*P-X*T,se=U*T+se*P,A=E,F=R,B=L),C=Er(F,A),d=C*sr,C&&(P=Math.cos(C),T=Math.sin(C),E=A*P+F*T,R=N*P+H*T,F=F*P-A*T,H=H*P-N*T,A=E,N=R),m&&Math.abs(m)+Math.abs(d)>359.9&&(m=d=0,p=180-p),g=ze(Math.sqrt(A*A+F*F+B*B)),u=ze(Math.sqrt(H*H+z*z)),C=Er(N,H),b=Math.abs(C)>2e-4?C*sr:0,y=se?1/(se<0?-se:se):0),r.svg&&(E=t.getAttribute("transform"),r.forceCSS=t.setAttribute("transform","")||!cp(wt(t,Oe)),E&&t.setAttribute("transform",E))),Math.abs(b)>90&&Math.abs(b)<270&&(i?(g*=-1,b+=d<=0?180:-180,d+=d<=0?180:-180):(u*=-1,b+=b<=0?180:-180)),s=s||r.uncache,r.x=c-((r.xPercent=c&&(!s&&r.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-c)?-50:0)))?t.offsetWidth*r.xPercent/100:0)+n,r.y=f-((r.yPercent=f&&(!s&&r.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-f)?-50:0)))?t.offsetHeight*r.yPercent/100:0)+n,r.z=v+n,r.scaleX=ze(g),r.scaleY=ze(u),r.rotation=ze(d)+a,r.rotationX=ze(m)+a,r.rotationY=ze(p)+a,r.skewX=b+a,r.skewY=x+a,r.transformPerspective=y+n,(r.zOrigin=parseFloat(l.split(" ")[2])||!s&&r.zOrigin||0)&&(o[mt]=Tn(l)),r.xOffset=r.yOffset=0,r.force3D=ft.force3D,r.renderTransform=r.svg?I0:op?dp:A0,r.uncache=0,r},Tn=function(t){return(t=t.split(" "))[0]+" "+t[1]},hl=function(t,s,r){var o=Je(s);return ze(parseFloat(s)+parseFloat(Cs(t,"x",r+"px",o)))+o},A0=function(t,s){s.z="0px",s.rotationY=s.rotationX="0deg",s.force3D=0,dp(t,s)},er="0deg",mi="0px",tr=") ",dp=function(t,s){var r=s||this,o=r.xPercent,i=r.yPercent,n=r.x,a=r.y,h=r.z,l=r.rotation,c=r.rotationY,f=r.rotationX,v=r.skewX,g=r.skewY,u=r.scaleX,d=r.scaleY,m=r.transformPerspective,p=r.force3D,b=r.target,x=r.zOrigin,y="",S=p==="auto"&&t&&t!==1||p===!0;if(x&&(f!==er||c!==er)){var _=parseFloat(c)*Pr,w=Math.sin(_),C=Math.cos(_),P;_=parseFloat(f)*Pr,P=Math.cos(_),n=hl(b,n,w*P*-x),a=hl(b,a,-Math.sin(_)*-x),h=hl(b,h,C*P*-x+x)}m!==mi&&(y+="perspective("+m+tr),(o||i)&&(y+="translate("+o+"%, "+i+"%) "),(S||n!==mi||a!==mi||h!==mi)&&(y+=h!==mi||S?"translate3d("+n+", "+a+", "+h+") ":"translate("+n+", "+a+tr),l!==er&&(y+="rotate("+l+tr),c!==er&&(y+="rotateY("+c+tr),f!==er&&(y+="rotateX("+f+tr),(v!==er||g!==er)&&(y+="skew("+v+", "+g+tr),(u!==1||d!==1)&&(y+="scale("+u+", "+d+tr),b.style[Oe]=y||"translate(0, 0)"},I0=function(t,s){var r=s||this,o=r.xPercent,i=r.yPercent,n=r.x,a=r.y,h=r.rotation,l=r.skewX,c=r.skewY,f=r.scaleX,v=r.scaleY,g=r.target,u=r.xOrigin,d=r.yOrigin,m=r.xOffset,p=r.yOffset,b=r.forceCSS,x=parseFloat(n),y=parseFloat(a),S,_,w,C,P;h=parseFloat(h),l=parseFloat(l),c=parseFloat(c),c&&(c=parseFloat(c),l+=c,h+=c),h||l?(h*=Pr,l*=Pr,S=Math.cos(h)*f,_=Math.sin(h)*f,w=Math.sin(h-l)*-v,C=Math.cos(h-l)*v,l&&(c*=Pr,P=Math.tan(l-c),P=Math.sqrt(1+P*P),w*=P,C*=P,c&&(P=Math.tan(c),P=Math.sqrt(1+P*P),S*=P,_*=P)),S=ze(S),_=ze(_),w=ze(w),C=ze(C)):(S=f,C=v,_=w=0),(x&&!~(n+"").indexOf("px")||y&&!~(a+"").indexOf("px"))&&(x=Cs(g,"x",n,"px"),y=Cs(g,"y",a,"px")),(u||d||m||p)&&(x=ze(x+u-(u*S+d*w)+m),y=ze(y+d-(u*_+d*C)+p)),(o||i)&&(P=g.getBBox(),x=ze(x+o/100*P.width),y=ze(y+i/100*P.height)),P="matrix("+S+","+_+","+w+","+C+","+x+","+y+")",g.setAttribute("transform",P),b&&(g.style[Oe]=P)},L0=function(t,s,r,o,i){var n=360,a=qe(i),h=parseFloat(i)*(a&&~i.indexOf("rad")?sr:1),l=h-o,c=o+l+"deg",f,v;return a&&(f=i.split("_")[1],f==="short"&&(l%=n,l!==l%(n/2)&&(l+=l<0?n:-n)),f==="cw"&&l<0?l=(l+n*Gu)%n-~~(l/n)*n:f==="ccw"&&l>0&&(l=(l-n*Gu)%n-~~(l/n)*n)),t._pt=v=new ot(t._pt,s,r,o,l,m0),v.e=c,v.u="deg",t._props.push(r),v},tp=function(t,s){for(var r in s)t[r]=s[r];return t},O0=function(t,s,r){var o=tp({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",n=r.style,a,h,l,c,f,v,g,u;o.svg?(l=r.getAttribute("transform"),r.setAttribute("transform",""),n[Oe]=s,a=vi(r,1),ks(r,Oe),r.setAttribute("transform",l)):(l=getComputedStyle(r)[Oe],n[Oe]=s,a=vi(r,1),n[Oe]=l);for(h in os)l=o[h],c=a[h],l!==c&&i.indexOf(h)<0&&(g=Je(l),u=Je(c),f=g!==u?Cs(r,h,l,u):parseFloat(l),v=parseFloat(c),t._pt=new ot(t._pt,a,h,f,v-f,cl),t._pt.u=u||0,t._props.push(h));tp(a,o)};nt("padding,margin,Width,Radius",function(e,t){var s="Top",r="Right",o="Bottom",i="Left",n=(t<3?[s,r,o,i]:[s+i,s+r,o+r,o+i]).map(function(a){return t<2?e+a:"border"+a+e});En[t>1?"border"+e:e]=function(a,h,l,c,f){var v,g;if(arguments.length<4)return v=n.map(function(u){return ns(a,u,l)}),g=v.join(" "),g.split(v[0]).length===5?v[0]:g;v=(c+"").split(" "),g={},n.forEach(function(u,d){return g[u]=v[d]=v[d]||v[(d-1)/2|0]}),a.init(h,g,f)}});var bl={name:"css",register:ul,targetTest:function(t){return t.style&&t.nodeType},init:function(t,s,r,o,i){var n=this._props,a=t.style,h=r.vars.startAt,l,c,f,v,g,u,d,m,p,b,x,y,S,_,w,C,P;fl||ul(),this.styles=this.styles||np(t),C=this.styles.props,this.tween=r;for(d in s)if(d!=="autoRound"&&(c=s[d],!(dt[d]&&rl(d,s,r,o,t,i)))){if(g=typeof c,u=En[d],g==="function"&&(c=c.call(r,o,t,i),g=typeof c),g==="string"&&~c.indexOf("random(")&&(c=Cr(c)),u)u(this,t,d,c,r)&&(w=1);else if(d.substr(0,2)==="--")l=(getComputedStyle(t).getPropertyValue(d)+"").trim(),c+="",rs.lastIndex=0,rs.test(l)||(m=Je(l),p=Je(c),p?m!==p&&(l=Cs(t,d,l,p)+p):m&&(c+=m)),this.add(a,"setProperty",l,c,o,i,0,0,d),n.push(d),C.push(d,0,a[d]);else if(g!=="undefined"){if(h&&d in h?(l=typeof h[d]=="function"?h[d].call(r,o,t,i):h[d],qe(l)&&~l.indexOf("random(")&&(l=Cr(l)),Je(l+"")||l==="auto"||(l+=ft.units[d]||Je(ns(t,d))||""),(l+"").charAt(1)==="="&&(l=ns(t,d))):l=ns(t,d),v=parseFloat(l),b=g==="string"&&c.charAt(1)==="="&&c.substr(0,2),b&&(c=c.substr(2)),f=parseFloat(c),d in Wt&&(d==="autoAlpha"&&(v===1&&ns(t,"visibility")==="hidden"&&f&&(v=0),C.push("visibility",0,a.visibility),Ss(this,a,"visibility",v?"inherit":"hidden",f?"inherit":"hidden",!f)),d!=="scale"&&d!=="transform"&&(d=Wt[d],~d.indexOf(",")&&(d=d.split(",")[0]))),x=d in os,x){if(this.styles.save(d),P=c,g==="string"&&c.substring(0,6)==="var(--"){if(c=wt(t,c.substring(4,c.indexOf(")"))),c.substring(0,5)==="calc("){var T=t.style.perspective;t.style.perspective=c,c=wt(t,"perspective"),T?t.style.perspective=T:ks(t,"perspective")}f=parseFloat(c)}if(y||(S=t._gsap,S.renderTransform&&!s.parseTransform||vi(t,s.parseTransform),_=s.smoothOrigin!==!1&&S.smooth,y=this._pt=new ot(this._pt,a,Oe,0,1,S.renderTransform,S,0,-1),y.dep=1),d==="scale")this._pt=new ot(this._pt,S,"scaleY",S.scaleY,(b?Qs(S.scaleY,b+f):f)-S.scaleY||0,cl),this._pt.u=0,n.push("scaleY",d),d+="X";else if(d==="transformOrigin"){C.push(mt,0,a[mt]),c=D0(c),S.svg?pl(t,c,0,_,0,this):(p=parseFloat(c.split(" ")[2])||0,p!==S.zOrigin&&Ss(this,S,"zOrigin",S.zOrigin,p),Ss(this,a,d,Tn(l),Tn(c)));continue}else if(d==="svgOrigin"){pl(t,c,1,_,0,this);continue}else if(d in hp){L0(this,S,d,v,b?Qs(v,b+c):c);continue}else if(d==="smoothOrigin"){Ss(this,S,"smooth",S.smooth,c);continue}else if(d==="force3D"){S[d]=c;continue}else if(d==="transform"){O0(this,c,t);continue}}else d in a||(d=Dr(d)||d);if(x||(f||f===0)&&(v||v===0)&&!f0.test(c)&&d in a)m=(l+"").substr((v+"").length),f||(f=0),p=Je(c)||(d in ft.units?ft.units[d]:m),m!==p&&(v=Cs(t,d,l,p)),this._pt=new ot(this._pt,x?S:a,d,v,(b?Qs(v,b+f):f)-v,!x&&(p==="px"||d==="zIndex")&&s.autoRound!==!1?b0:cl),this._pt.u=p||0,x&&P!==c?(this._pt.b=l,this._pt.e=P,this._pt.r=v0):m!==p&&p!=="%"&&(this._pt.b=l,this._pt.r=g0);else if(d in a)P0.call(this,t,d,l,b?b+c:c);else if(d in t)this.add(t,d,l||t[d],b?b+c:c,o,i);else if(d!=="parseTransform"){yn(d,c);continue}x||(d in a?C.push(d,0,a[d]):typeof t[d]=="function"?C.push(d,2,t[d]()):C.push(d,1,l||t[d])),n.push(d)}}w&&ll(this)},render:function(t,s){if(s.tween._time||!ml())for(var r=s._pt;r;)r.r(t,r.d),r=r._next;else s.styles.revert()},get:ns,aliases:Wt,getSetter:function(t,s,r){var o=Wt[s];return o&&o.indexOf(",")<0&&(s=o),s in os&&s!==mt&&(t._gsap.x||ns(t,"x"))?r&&Ku===r?s==="scale"?w0:y0:(Ku=r||{})&&(s==="scale"?S0:k0):t.style&&!xn(t.style[s])?_0:~s.indexOf("-")?x0:Cn(t,s)},core:{_removeProperty:ks,_getMatrix:vl}};rt.utils.checkPrefix=Dr;rt.core.getStyleSaver=np;(function(e,t,s,r){var o=nt(e+","+t+","+s,function(i){os[i]=1});nt(t,function(i){ft.units[i]="deg",hp[i]=1}),Wt[o[13]]=e+","+t,nt(r,function(i){var n=i.split(":");Wt[n[1]]=o[n[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");nt("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(e){ft.units[e]="px"});rt.registerPlugin(bl);var qt=rt.registerPlugin(bl)||rt,c5=qt.core.Tween;var Es=require("react");var up=typeof document<"u"?Es.useLayoutEffect:Es.useEffect,pp=e=>e&&!Array.isArray(e)&&typeof e=="object",Pn=[],M0={},fp=qt,ir=(e,t=Pn)=>{let s=M0;pp(e)?(s=e,e=null,t="dependencies"in s?s.dependencies:Pn):pp(t)&&(s=t,t="dependencies"in s?s.dependencies:Pn),e&&typeof e!="function"&&console.warn("First parameter must be a function or config object");let{scope:r,revertOnUpdate:o}=s,i=(0,Es.useRef)(!1),n=(0,Es.useRef)(fp.context(()=>{},r)),a=(0,Es.useRef)(l=>n.current.add(null,l)),h=t&&t.length&&!o;return h&&up(()=>(i.current=!0,()=>n.current.revert()),Pn),up(()=>{if(e&&n.current.add(e,r),!h||!i.current)return()=>n.current.revert()},t),{context:n.current,contextSafe:a.current}};ir.register=e=>{fp=e};ir.headless=!0;qt.registerPlugin(ir);var F0="(prefers-reduced-motion: reduce)";function Dn(){return!window.matchMedia(F0).matches}function mp(e,t){let s=(0,_l.useRef)(t),r=(0,_l.useRef)(!1);s.current=t;let{contextSafe:o}=ir(()=>{let i=e.current;if(i===null||!Dn())return;let n=Array.from(i.children),a=qt.timeline({defaults:{ease:"power2.out"}});return a.fromTo(i,{autoAlpha:0,y:10,scale:.985,transformOrigin:"50% 36%"},{autoAlpha:1,y:0,scale:1,duration:.22,clearProps:"transform,opacity,visibility"}).fromTo(n,{autoAlpha:.58,y:4},{autoAlpha:1,y:0,duration:.18,stagger:.025,clearProps:"transform,opacity,visibility"},"<0.035"),()=>{a.kill()}},{scope:e});return o(()=>{if(r.current)return;let i=e.current;if(i===null||!Dn()){s.current();return}r.current=!0;let n=Array.from(i.children);qt.killTweensOf([i,...n]),qt.timeline({defaults:{ease:"power1.in"},onComplete:()=>{s.current()}}).to(n,{autoAlpha:0,y:-2,duration:.08,stagger:{each:.012,from:"end"}}).to(i,{autoAlpha:0,y:6,scale:.99,transformOrigin:"50% 36%",duration:.12},"<0.025")})}function gp(e,t){ir(()=>{let s=e.current;!t||s===null||!Dn()||qt.fromTo(s,{y:1,scale:.975},{y:0,scale:1,duration:.2,ease:"power2.out",overwrite:"auto",clearProps:"transform"})},{scope:e,dependencies:[t],revertOnUpdate:!0})}function vp(e,t=":scope > *"){ir(()=>{let s=e.current;if(s===null||!Dn())return;let r=s.querySelectorAll(t);qt.fromTo(r,{autoAlpha:0,y:5},{autoAlpha:1,y:0,duration:.24,stagger:.035,ease:"power2.out",clearProps:"transform,opacity,visibility"})},{scope:e})}var Se=require("react/jsx-runtime");function Ye({title:e,subtitle:t,className:s,onClose:r,children:o}){let i=(0,Me.useId)(),n=(0,Me.useId)(),a=(0,Me.useRef)(null),h=mp(a,r),l=c=>{!(c.target instanceof Element)||c.target.closest("[data-ssh-dialog-close]")===null||(c.preventDefault(),c.stopPropagation(),h())};return(0,Se.jsx)(Kt.Modal,{open:!0,onClose:h,title:e,closeLabel:"\u5173\u95ED",headless:!0,className:`dsh-ssh-dialog-modal${s===void 0?"":` ${s}-modal`}`,children:(0,Se.jsx)(nu,{children:(0,Se.jsx)(ou,{children:(0,Se.jsxs)("section",{ref:a,className:`dsh-ssh-dialog dsh-ssh-scroll-surface${s===void 0?"":` ${s}`}`,"aria-labelledby":i,"aria-describedby":t===void 0?void 0:n,onClickCapture:l,children:[(0,Se.jsxs)("header",{children:[(0,Se.jsxs)("span",{children:[(0,Se.jsx)("h2",{id:i,children:e}),t&&(0,Se.jsx)("p",{id:n,children:t})]}),(0,Se.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",onClick:h,"aria-label":"\u5173\u95ED",children:(0,Se.jsx)(Kt.IconCloseOutline16,{size:16})})]}),o]})})})})}function le({label:e,hint:t,children:s}){return(0,Se.jsxs)("label",{className:"dsh-ssh-field",children:[(0,Se.jsx)("span",{children:e}),s,t&&(0,Se.jsx)("small",{children:t})]})}function Rr({value:e,options:t,placeholder:s,maxLength:r,multiple:o=!1,ariaLabel:i,onChange:n}){let a=(0,Me.useId)(),h=(0,Me.useRef)(null),l=(0,Me.useRef)(null),c=(0,Me.useRef)(!1),f=(0,Me.useMemo)(()=>yl(t).sort((w,C)=>w.localeCompare(C,void 0,{numeric:!0,sensitivity:"base"})),[t]),[v,g]=(0,Me.useState)(!1),[u,d]=(0,Me.useState)(""),[m,p]=(0,Me.useState)(0),b=(0,Me.useMemo)(()=>o?bp(e):e.trim()?[e.trim()]:[],[o,e]),x=(0,Me.useMemo)(()=>{let w=u.trim().toLocaleLowerCase();return f.filter(C=>(!o||!b.some(P=>xl(P,C)))&&(w.length===0||C.toLocaleLowerCase().includes(w)))},[u,o,f,b]);(0,Me.useEffect)(()=>{if(!v)return;let w=C=>{C.target instanceof Node&&!h.current?.contains(C.target)&&g(!1)};return document.addEventListener("pointerdown",w),()=>document.removeEventListener("pointerdown",w)},[v]),(0,Me.useEffect)(()=>{p(w=>Math.min(w,Math.max(0,x.length-1)))},[x.length]);let y=w=>{if(!o)n(w);else{let C=bp(e),P=u.trim().length>0&&C.length>0;n(yl([...P?C.slice(0,-1):C,w]).join(", "))}d(""),g(!1),document.activeElement!==l.current&&(c.current=!0,l.current?.focus())},S=w=>{if(w.key==="ArrowDown"||w.key==="ArrowUp"){if(w.preventDefault(),!v){g(!0),p(0);return}let C=w.key==="ArrowDown"?1:-1;p(P=>(P+C+x.length)%Math.max(1,x.length))}else w.key==="Enter"&&v&&x[m]!==void 0?(w.preventDefault(),y(x[m])):w.key==="Escape"&&v&&(w.preventDefault(),g(!1))},_=w=>{n(w),d(o?w.split(/[,,]/u).at(-1)?.trim()??"":w),p(0),g(!0)};return(0,Se.jsxs)("div",{ref:h,className:`dsh-ssh-suggestion-input${v?" is-open":""}`,children:[(0,Se.jsx)("input",{ref:l,role:"combobox","aria-label":i,"aria-autocomplete":"list","aria-expanded":v,"aria-controls":a,"aria-activedescendant":v&&x[m]!==void 0?`${a}-${m}`:void 0,value:e,maxLength:r,placeholder:s,onChange:w=>_(w.target.value),onFocus:()=>{if(c.current){c.current=!1;return}d(o?"":e),f.length>0&&g(!0)},onKeyDown:S}),(0,Se.jsx)("button",{type:"button",className:"dsh-ssh-suggestion-toggle","aria-label":`${v?"\u6536\u8D77":"\u5C55\u5F00"}${i}\u5DF2\u6709\u9009\u9879`,"aria-expanded":v,onClick:()=>{if(v){g(!1);return}d(""),p(0),g(!0),l.current?.focus()},children:(0,Se.jsx)(Kt.IconChevronDownOutline14,{size:14})}),v&&(0,Se.jsx)("div",{id:a,className:"dsh-ssh-suggestion-menu dsh-ssh-scroll-surface",role:"listbox","aria-label":`${i}\u5DF2\u6709\u9009\u9879`,children:x.length===0?(0,Se.jsx)("p",{children:f.length===0?"\u6682\u65E0\u5DF2\u6709\u9009\u9879\uFF0C\u53EF\u76F4\u63A5\u8F93\u5165":"\u6CA1\u6709\u5339\u914D\u9879\uFF0C\u53EF\u76F4\u63A5\u8F93\u5165\u65B0\u5185\u5BB9"}):x.map((w,C)=>(0,Se.jsxs)("button",{id:`${a}-${C}`,type:"button",role:"option","aria-selected":!o&&xl(e,w),className:C===m?"is-active":"",onPointerMove:()=>p(C),onClick:()=>y(w),children:[(0,Se.jsx)("span",{children:w}),!o&&xl(e,w)&&(0,Se.jsx)(Kt.IconCheckOutline14,{size:14})]},w))})]})}function wl(e){let[t,s]=(0,Me.useState)(!1);return(0,Se.jsxs)("div",{className:"dsh-ssh-password-input",children:[(0,Se.jsx)("input",{...e,type:t?"text":"password"}),(0,Se.jsx)("button",{type:"button","aria-label":t?"\u9690\u85CF\u5BC6\u7801":"\u663E\u793A\u5BC6\u7801","aria-pressed":t,onClick:()=>s(r=>!r),children:t?"\u9690\u85CF":"\u663E\u793A"})]})}function nr({active:e,onClick:t,children:s}){let r=(0,Me.useRef)(null);return gp(r,e),(0,Se.jsx)("button",{ref:r,type:"button",role:"tab","data-ssh-interactive":"choice",className:e?"is-active":"","aria-selected":e,onClick:t,children:s})}function _p(){let e=(0,Me.useRef)(null);return vp(e),(0,Se.jsxs)("div",{ref:e,className:"dsh-ssh-empty-state",children:[(0,Se.jsx)("span",{children:(0,Se.jsx)(Ts,{})}),(0,Se.jsx)("h1",{children:"\u8FDE\u63A5\u4F60\u7684\u7B2C\u4E00\u53F0\u8FDC\u7AEF\u4E3B\u673A"}),(0,Se.jsx)("p",{children:"\u4F7F\u7528\u201C\u4E3B\u673A\u4E0E\u9879\u76EE\u201D\u65C1\u7684\u6DFB\u52A0\u6309\u94AE\u4FDD\u5B58 SSH \u914D\u7F6E\uFF0C\u968F\u540E\u5373\u53EF\u6253\u5F00\u7EC8\u7AEF\u3001\u5EFA\u7ACB\u7AEF\u53E3\u8F6C\u53D1\uFF0C\u5E76\u6309\u4F1A\u8BDD\u6388\u6743\u7ED9 AI\u3002"})]})}function Ts(){return(0,Se.jsx)("span",{className:"dsh-ssh-server-glyph",children:(0,Se.jsx)(Kt.IconDataOutline16,{size:17})})}function De(e){return e instanceof Error?e.message:String(e)}function xp(e){return e.length<=16?e:`${e.slice(0,8)}\u2026${e.slice(-5)}`}function bp(e){return yl(e.split(/[,,]/u))}function xl(e,t){return e.trim().localeCompare(t.trim(),void 0,{sensitivity:"accent"})===0}function yl(e){let t=new Map;for(let s of e){let r=s.trim();r.length>0&&!t.has(r.toLocaleLowerCase())&&t.set(r.toLocaleLowerCase(),r)}return[...t.values()]}var Ve=require("react/jsx-runtime");function Rn({locationName:e,locationKind:t,entries:s,onClose:r,onDelete:o}){let[i,n]=(0,Sl.useState)(!1),[a,h]=(0,Sl.useState)(),l=s.filter(f=>f.kind==="directory").length,c=async()=>{n(!0),h(void 0);try{await o(),n(!1),r()}catch(f){h(De(f)),n(!1)}};return(0,Ve.jsxs)(Ye,{className:"dsh-ssh-file-delete-dialog",title:`\u5220\u9664 ${s.length} \u9879\uFF1F`,subtitle:`${e} \xB7 \u6B64\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500`,onClose:()=>{i||r()},children:[(0,Ve.jsxs)("div",{className:"dsh-ssh-file-delete-copy",children:[(0,Ve.jsx)("span",{children:(0,Ve.jsx)(Ar.IconTrashOutline16,{size:18})}),(0,Ve.jsxs)("p",{children:["\u5C06\u76F4\u63A5\u4ECE",t==="local"?"\u5F53\u524D\u4F1A\u8BDD\u76EE\u5F55":"\u8FDC\u7AEF","\u5220\u9664\u6240\u9009\u5185\u5BB9\u3002",l>0?`\u5176\u4E2D ${l} \u4E2A\u76EE\u5F55\u53CA\u5176\u5168\u90E8\u5185\u5BB9\u4F1A\u88AB\u9012\u5F52\u5220\u9664\u3002`:""]})]}),(0,Ve.jsxs)("div",{className:"dsh-ssh-file-delete-list",children:[s.slice(0,6).map(f=>(0,Ve.jsxs)("div",{children:[f.kind==="directory"?(0,Ve.jsx)(Ar.IconFolderClose16,{size:17}):(0,Ve.jsx)(Ar.IconDataOutline16,{size:17}),(0,Ve.jsxs)("span",{children:[(0,Ve.jsx)("strong",{children:f.name}),(0,Ve.jsx)("small",{title:f.path,children:f.path})]})]},f.path)),s.length>6&&(0,Ve.jsxs)("p",{children:["\u4EE5\u53CA\u5176\u4ED6 ",s.length-6," \u9879"]})]}),a&&(0,Ve.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:a}),(0,Ve.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,Ve.jsx)("span",{}),(0,Ve.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:i,onClick:r,children:"\u53D6\u6D88"}),(0,Ve.jsx)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:i,onClick:()=>{c()},children:i?"\u6B63\u5728\u5220\u9664\u2026":"\u786E\u8BA4\u5220\u9664"})]})]})}var G=require("react/jsx-runtime"),B0=512*1024*1024;function wp({sessionId:e}){let t=(0,xe.useCallback)(i=>th(e,i||void 0),[e]),s=(0,xe.useCallback)(i=>sh(e,i),[e]),r=(0,xe.useCallback)((i,n=!1)=>ih(e,i,n),[e]),o=(0,xe.useCallback)((i,n)=>rh(e,i,n),[e]);return(0,G.jsx)(Cl,{initialPath:"",loadDirectory:t,loadPreview:s,fileUrl:r,deletion:{locationName:"\u672C\u5730\u4F1A\u8BDD",locationKind:"local",remove:o}})}function Sp({sessionId:e,profile:t,profiles:s,onProfile:r,onSaved:o}){let i=(0,xe.useCallback)(async(g,u)=>{let d=u?(await gh(e,t.id,g)).cwd:g,m=await eh(e,t.id,d);return u&&await o(),m},[o,t.id,e]),n=(0,xe.useCallback)(g=>nh(e,t.id,g),[t.id,e]),a=(0,xe.useCallback)((g,u=!1)=>oh(e,t.id,g,u),[t.id,e]),h=(0,xe.useCallback)((g,u,d)=>Wn(t.id,g,u,d),[t.id]),l=Cp(`activity-sftp-${e}-${t.id}`),c=`sftp:${t.id}`,f=(0,xe.useCallback)((g,u)=>Br({paneId:l,endpointId:c,directory:g,paths:u}),[c,l]),v=(0,G.jsxs)("div",{className:"dsh-ssh-sftp-hostbar",children:[(0,G.jsx)("span",{className:"dsh-ssh-host-monogram",children:t.name.slice(0,1).toUpperCase()}),(0,G.jsxs)("label",{children:[(0,G.jsx)("span",{className:"sr-only",children:"\u9009\u62E9\u8FDC\u7AEF\u4E3B\u673A"}),(0,G.jsx)("select",{value:t.id,onChange:g=>r(g.target.value),children:s.map(g=>(0,G.jsx)("option",{value:g.id,children:g.name},g.id))}),(0,G.jsxs)("small",{children:[t.username,"@",t.host,":",t.port]})]})]});return(0,G.jsx)(Cl,{initialPath:t.cwd,header:v,loadDirectory:i,loadPreview:n,fileUrl:a,uploadFile:h,operations:{paneId:l,endpointId:c,endpointName:t.name},deletion:{locationName:t.name,locationKind:"remote",remove:f}})}function kp({profile:e,initialPath:t="~",onEdit:s,onDelete:r,embedded:o=!1}){let i=(0,xe.useCallback)(v=>ah(e.id,v),[e.id]),n=(0,xe.useCallback)(v=>lh(e.id,v),[e.id]),a=(0,xe.useCallback)((v,g=!1)=>hh(e.id,v,g),[e.id]),h=(0,xe.useCallback)((v,g,u)=>Wn(e.id,v,g,u),[e.id]),l=Cp(`profile-sftp-${e.id}`),c=`sftp:${e.id}`,f=(0,xe.useCallback)((v,g)=>Br({paneId:l,endpointId:c,directory:v,paths:g}),[c,l]);return(0,G.jsxs)("div",{className:`dsh-ssh-profile-sftp-pane${o?" is-embedded":""}`,children:[(0,G.jsxs)("div",{className:"dsh-ssh-content-heading",children:[(0,G.jsxs)("div",{children:[(0,G.jsx)("h1",{children:o?"SFTP":`${e.name} \xB7 SFTP`}),(0,G.jsx)("p",{children:o?t:`${Yt(e)} \xB7 ${t}`})]}),(0,G.jsxs)("div",{className:"dsh-ssh-heading-actions",children:[r&&(0,G.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":`\u5220\u9664\u4E3B\u673A ${e.name}`,title:"\u5220\u9664\u4E3B\u673A",onClick:r,children:(0,G.jsx)(Ce.IconTrashOutline16,{size:16})}),s&&(0,G.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:s,children:[(0,G.jsx)(Ce.IconEditOutline16,{size:16}),"\u7F16\u8F91\u4E3B\u673A"]})]})]}),(0,G.jsx)(Cl,{workspace:!0,initialPath:t,loadDirectory:i,loadPreview:n,fileUrl:a,uploadFile:h,operations:{paneId:l,endpointId:c,endpointName:e.name},deletion:{locationName:e.name,locationKind:"remote",remove:f}})]})}function Cl({initialPath:e,header:t,workspace:s=!1,loadDirectory:r,loadPreview:o,fileUrl:i,uploadFile:n,operations:a,deletion:h}){let l=(0,xe.useRef)(null),c=(0,xe.useRef)(0),[f,v]=(0,xe.useState)(),[g,u]=(0,xe.useState)(),[d,m]=(0,xe.useState)(e),[p,b]=(0,xe.useState)(!0),[x,y]=(0,xe.useState)(),[S,_]=(0,xe.useState)(),[w,C]=(0,xe.useState)(!1),[P,T]=(0,xe.useState)(),[A,F]=(0,xe.useState)(),[B,U]=(0,xe.useState)(),[N,H]=(0,xe.useState)(),[E,R]=(0,xe.useState)(),L=(0,xe.useCallback)(async(W,ae)=>{b(!0),R(void 0),u(void 0),_(void 0);try{let me=await r(W,ae);v(me),m(me.path)}catch(me){R(An(me))}finally{b(!1)}},[r]);(0,xe.useEffect)(()=>{L(e,!1)},[L,e]);let k=W=>{W.preventDefault(),L(d,!0)},$=async(W,ae=f?.path,me=!1)=>{if(n===void 0||ae===void 0||W.length===0)return;let Re=W.filter(Pe=>Pe.size<=B0),re=W.length-Re.length;if(Re.length===0){R("\u5355\u4E2A\u6587\u4EF6\u4E0D\u80FD\u8D85\u8FC7 512 MB");return}_(void 0),R(void 0);for(let Pe=0;Pe<Re.length;Pe+=1){let gt=Re[Pe],hs=me&&Pe===0;y(gt.name);try{await n(ae,gt,hs)}catch(Bt){!hs&&Bt instanceof cs&&Bt.status===409?_({file:gt,remaining:Re.slice(Pe+1),directory:ae}):R(An(Bt)),y(void 0);return}}y(void 0),await L(ae,!1),re>0&&R(`\u5DF2\u8DF3\u8FC7 ${re} \u4E2A\u8D85\u8FC7 512 MB \u7684\u6587\u4EF6`)},X=n!==void 0&&f!==void 0&&x===void 0&&S===void 0,O=W=>Array.from(W.dataTransfer.types).includes("Files"),se=W=>Array.from(W.dataTransfer.types).includes(Ft),z=W=>{!X||!O(W)||(W.preventDefault(),c.current+=1,C(!0))},I=W=>{if(X&&O(W)){W.preventDefault(),W.dataTransfer.dropEffect="copy";return}if(a===void 0||f===void 0||!se(W))return;let ae=P===void 0?"copy":si(P,{endpointId:a.endpointId,directory:f.path});ae==="none"||ae==="invalid"||(W.preventDefault(),W.dataTransfer.dropEffect=ae)},J=W=>{O(W)&&(c.current=Math.max(0,c.current-1),c.current===0&&C(!1))},Y=W=>{if(c.current=0,C(!1),X&&O(W)){W.preventDefault();let me=Array.from(W.dataTransfer.files);me.length>0&&$(me);return}if(a===void 0||f===void 0||!se(W))return;W.preventDefault();let ae=br(W.dataTransfer.getData(Ft));ae!==void 0&&V(ae,f.path)},V=async(W,ae)=>{if(a!==void 0){F(void 0),T(void 0),H(void 0),R(void 0);try{let me=await cn(W,{paneId:a.paneId,endpointId:a.endpointId,directory:ae});me.operation==="move"&&(H("\u5DF2\u79FB\u52A8"),await L(f?.path??ae,!1)),me.operation==="copy"&&H("\u5DF2\u52A0\u5165\u4F20\u8F93\u4EFB\u52A1\uFF0C\u53EF\u5728\u6587\u4EF6\u4F20\u8F93\u4E2D\u67E5\u770B\u8FDB\u5EA6")}catch(me){R(An(me))}}},Q=async()=>{h===void 0||f===void 0||B===void 0||(await h.remove(f.path,[B.path]),await L(f.path,!1))};return(0,G.jsxs)("div",{className:`dsh-ssh-sftp${s?" is-workspace":""}${w?" is-dragging-files":""}`,onDragEnter:z,onDragOver:I,onDragLeave:J,onDrop:Y,children:[t,g?(0,G.jsx)(N0,{entry:g,loadPreview:o,fileUrl:i,onBack:()=>u(void 0)}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)("form",{className:`dsh-ssh-sftp-pathbar${n===void 0?"":" has-upload"}`,onSubmit:k,children:[(0,G.jsx)("button",{type:"button","aria-label":"\u8FD4\u56DE\u4E0A\u7EA7\u76EE\u5F55",title:"\u8FD4\u56DE\u4E0A\u7EA7\u76EE\u5F55",disabled:f?.parent==null||p,onClick:()=>{f?.parent&&L(f.parent,!0)},children:(0,G.jsx)(Ce.IconChevronLeftOutline14,{size:14})}),(0,G.jsx)("input",{"aria-label":"\u5F53\u524D\u8FDC\u7AEF\u76EE\u5F55",value:d,spellCheck:!1,onChange:W=>m(W.target.value)}),(0,G.jsx)("button",{type:"button","aria-label":"\u5237\u65B0\u76EE\u5F55",title:"\u5237\u65B0\u76EE\u5F55",disabled:p,onClick:()=>{L(f?.path??d,!1)},children:(0,G.jsx)(Ce.IconRefreshOutline16,{size:15})}),n!==void 0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("input",{ref:l,className:"sr-only",type:"file",multiple:!0,tabIndex:-1,onChange:W=>{let ae=Array.from(W.target.files??[]);W.target.value="",ae.length>0&&$(ae)}}),(0,G.jsxs)("button",{type:"button",className:"dsh-ssh-sftp-upload-button",disabled:f===void 0||x!==void 0||S!==void 0,onClick:()=>l.current?.click(),children:[(0,G.jsx)(Ce.IconSendOutline14,{size:14}),x===void 0?"\u4E0A\u4F20":"\u4E0A\u4F20\u4E2D"]})]})]}),S!==void 0&&(0,G.jsxs)("div",{className:"dsh-ssh-upload-conflict",role:"alert",children:[(0,G.jsxs)("span",{children:[(0,G.jsx)("strong",{children:"\u540C\u540D\u6587\u4EF6\u5DF2\u5B58\u5728"}),(0,G.jsx)("small",{children:S.file.name})]}),(0,G.jsxs)("span",{children:[(0,G.jsx)("button",{type:"button",onClick:()=>{let W=S;_(void 0),$(W.remaining,W.directory)},children:"\u8DF3\u8FC7"}),(0,G.jsx)("button",{type:"button",className:"is-primary",disabled:x!==void 0,onClick:()=>{let W=S;$([W.file,...W.remaining],W.directory,!0)},children:"\u8986\u76D6\u4E0A\u4F20"})]})]}),N&&(0,G.jsxs)("div",{className:"dsh-ssh-sftp-operation-status",role:"status",children:[(0,G.jsx)("span",{children:N}),(0,G.jsx)("button",{type:"button","aria-label":"\u5173\u95ED\u63D0\u793A",onClick:()=>H(void 0),children:(0,G.jsx)(Ce.IconCloseOutline16,{size:14})})]}),E&&(0,G.jsx)("p",{className:"dsh-ssh-directory-error",role:"alert",children:E}),(0,G.jsxs)("div",{className:"dsh-ssh-sftp-table dsh-ssh-scroll-surface","aria-busy":p,children:[(0,G.jsxs)("div",{className:"dsh-ssh-sftp-columns",children:[(0,G.jsx)("span",{children:"\u540D\u79F0"}),(0,G.jsx)("span",{children:"\u5927\u5C0F"}),(0,G.jsx)("span",{children:"\u4FEE\u6539\u65F6\u95F4"}),(0,G.jsx)("span",{"aria-hidden":"true"})]}),p&&f===void 0?(0,G.jsx)("p",{className:"dsh-ssh-sftp-state",children:"\u6B63\u5728\u8BFB\u53D6\u8FDC\u7AEF\u76EE\u5F55\u2026"}):f?.entries.length===0?(0,G.jsx)("p",{className:"dsh-ssh-sftp-state",children:"\u6B64\u76EE\u5F55\u4E3A\u7A7A"}):f?.entries.map(W=>{let ae=hn(W),me=P===void 0||a===void 0?void 0:si(P,{endpointId:a.endpointId,directory:W.path}),Re=ae&&me!=="none"&&me!=="invalid";return(0,G.jsxs)("div",{role:"row",tabIndex:0,"aria-label":`${W.name}${ae?"\uFF0C\u76EE\u5F55\uFF0C\u5355\u51FB\u8FDB\u5165\uFF1B\u53EF\u63A5\u6536\u62D6\u653E":"\uFF0C\u6587\u4EF6\uFF0C\u5355\u51FB\u9884\u89C8"}`,"data-ssh-interactive":"row","data-ssh-context-row":!0,draggable:a!==void 0&&(W.kind==="file"||ae),className:`dsh-ssh-sftp-row is-${ae?"directory":W.kind}${A===W.path?" is-drop-target":""}`,onClick:()=>{ae?L(W.path,!0):u(W)},onKeyDown:re=>{re.target===re.currentTarget&&re.key==="Enter"&&(ae?L(W.path,!0):u(W))},onDragStart:re=>{if(a===void 0||f===void 0)return;let Pe={paneId:a.paneId,endpointId:a.endpointId,directory:f.path,paths:[W.path]};T(Pe),re.dataTransfer.effectAllowed="copyMove",re.dataTransfer.setData(Ft,JSON.stringify(Pe))},onDragEnd:()=>{T(void 0),F(void 0)},onDragOver:re=>{let Pe=X&&O(re);!ae||!Pe&&!se(re)||!Pe&&!Re||(re.preventDefault(),re.stopPropagation(),re.dataTransfer.dropEffect=Pe||me!=="move"?"copy":"move",F(W.path))},onDragLeave:re=>{re.currentTarget.contains(re.relatedTarget)||F(void 0)},onDrop:re=>{if(!ae)return;if(re.preventDefault(),re.stopPropagation(),F(void 0),X&&O(re)){let gt=Array.from(re.dataTransfer.files);gt.length>0&&$(gt,W.path);return}let Pe=br(re.dataTransfer.getData(Ft));Pe!==void 0&&V(Pe,W.path)},children:[(0,G.jsxs)("span",{children:[ae?(0,G.jsx)(Ce.IconFolderClose16,{size:16}):(0,G.jsx)(Ce.IconDataOutline16,{size:16}),(0,G.jsx)("strong",{title:W.name,children:W.name})]}),(0,G.jsx)("small",{children:ae?"-":kl(W.size)}),(0,G.jsx)("small",{children:z0(W.modifiedAt)}),h!==void 0&&(0,G.jsx)("button",{type:"button",className:"dsh-ssh-sftp-row-delete dsh-ssh-context-action",draggable:!1,"aria-label":`\u5220\u9664 ${W.name}`,title:`\u5220\u9664 ${W.name}`,onClick:re=>{re.stopPropagation(),U(W)},children:(0,G.jsx)(Ce.IconTrashOutline16,{size:14})})]},W.path)})]})]}),w&&(0,G.jsx)("div",{className:"dsh-ssh-sftp-dropzone","aria-hidden":"true",children:(0,G.jsxs)("span",{children:[(0,G.jsx)("strong",{children:"\u677E\u5F00\u4EE5\u4E0A\u4F20"}),(0,G.jsxs)("small",{children:["\u4E0A\u4F20\u5230 ",f?.path??d]})]})}),B!==void 0&&h!==void 0&&(0,G.jsx)(Rn,{locationName:h.locationName,locationKind:h.locationKind,entries:[B],onClose:()=>U(void 0),onDelete:Q})]})}function N0({entry:e,loadPreview:t,fileUrl:s,onBack:r}){let[o,i]=(0,xe.useState)(),[n,a]=(0,xe.useState)(),[h,l]=(0,xe.useState)(!1);(0,xe.useEffect)(()=>{let f=!1;return i(void 0),a(void 0),t(e.path).then(v=>{f||i(v)}).catch(v=>{f||a(An(v))}),()=>{f=!0}},[e.path,t]);let c=s(e.path);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)("section",{className:"dsh-ssh-file-preview",children:[(0,G.jsxs)("header",{children:[(0,G.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u8FD4\u56DE\u76EE\u5F55",title:"\u8FD4\u56DE\u76EE\u5F55",onClick:r,children:(0,G.jsx)(Ce.IconChevronLeftOutline14,{size:14})}),(0,G.jsxs)("span",{className:"dsh-ssh-file-preview-title",children:[(0,G.jsx)("strong",{title:e.name,children:e.name}),(0,G.jsx)("small",{children:kl(e.size)})]}),(0,G.jsxs)("span",{className:"dsh-ssh-file-preview-actions",children:[(0,G.jsx)("a",{href:c,"aria-label":"\u4E0B\u8F7D\u6587\u4EF6",title:"\u4E0B\u8F7D\u6587\u4EF6",children:(0,G.jsx)(Ce.IconDownloadOutline16,{size:16})}),(0,G.jsx)("button",{type:"button","aria-label":"\u653E\u5927\u9884\u89C8",title:"\u653E\u5927\u9884\u89C8",onClick:()=>l(!0),children:(0,G.jsx)(Ce.IconFullscreenOutline16,{size:16})})]})]}),(0,G.jsx)("div",{className:"dsh-ssh-file-preview-body dsh-ssh-scroll-surface",children:(0,G.jsx)(yp,{entry:e,preview:o,error:n,fileUrl:s,downloadUrl:c})})]}),(0,G.jsx)(Ce.Modal,{open:h,onClose:()=>l(!1),title:`\u9884\u89C8 ${e.name}`,closeLabel:"\u5173\u95ED\u9884\u89C8",headless:!0,className:"dsh-ssh-preview-modal",children:(0,G.jsxs)("section",{className:"dsh-ssh-preview-modal-shell",children:[(0,G.jsxs)("header",{children:[(0,G.jsxs)("span",{children:[(0,G.jsx)("strong",{title:e.name,children:e.name}),(0,G.jsx)("small",{children:kl(e.size)})]}),(0,G.jsxs)("span",{className:"dsh-ssh-file-preview-actions",children:[(0,G.jsx)("a",{href:c,"aria-label":"\u4E0B\u8F7D\u6587\u4EF6",title:"\u4E0B\u8F7D\u6587\u4EF6",children:(0,G.jsx)(Ce.IconDownloadOutline16,{size:16})}),(0,G.jsx)("button",{type:"button","aria-label":"\u5173\u95ED\u9884\u89C8",title:"\u5173\u95ED\u9884\u89C8",onClick:()=>l(!1),children:(0,G.jsx)(Ce.IconCloseOutline16,{size:16})})]})]}),(0,G.jsx)("div",{className:"dsh-ssh-file-preview-body is-modal dsh-ssh-scroll-surface",children:(0,G.jsx)(yp,{entry:e,preview:o,error:n,fileUrl:s,downloadUrl:c})})]})})]})}function yp({entry:e,preview:t,error:s,fileUrl:r,downloadUrl:o}){return s?(0,G.jsx)("p",{className:"dsh-ssh-directory-error",role:"alert",children:s}):t===void 0?(0,G.jsx)("p",{className:"dsh-ssh-sftp-state",children:"\u6B63\u5728\u6253\u5F00\u6587\u4EF6\u2026"}):t.kind==="text"&&t.mimeType==="text/markdown"?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("article",{className:"dsh-ssh-markdown-preview",children:(0,G.jsx)($o,{remarkPlugins:[an],components:{a:i=>(0,G.jsx)("a",{...i,target:"_blank",rel:"noreferrer"})},children:t.text||""})}),t.truncated&&(0,G.jsx)("small",{children:"\u6587\u4EF6\u8F83\u5927\uFF0C\u4EC5\u663E\u793A\u524D 1 MB\u3002\u4E0B\u8F7D\u53EF\u67E5\u770B\u5B8C\u6574\u5185\u5BB9\u3002"})]}):t.kind==="text"?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("pre",{children:t.text||""}),t.truncated&&(0,G.jsx)("small",{children:"\u6587\u4EF6\u8F83\u5927\uFF0C\u4EC5\u663E\u793A\u524D 1 MB\u3002\u4E0B\u8F7D\u53EF\u67E5\u770B\u5B8C\u6574\u5185\u5BB9\u3002"})]}):t.kind==="image"?(0,G.jsx)("img",{src:r(e.path,!0),alt:e.name}):t.kind==="pdf"?(0,G.jsx)("iframe",{src:r(e.path,!0),title:e.name}):(0,G.jsxs)("div",{className:"dsh-ssh-file-binary",children:[(0,G.jsx)(Ce.IconDataOutline16,{size:24}),(0,G.jsx)("strong",{children:"\u6B64\u6587\u4EF6\u65E0\u6CD5\u76F4\u63A5\u9884\u89C8"}),(0,G.jsx)("p",{children:t.mimeType}),(0,G.jsxs)("a",{href:o,children:[(0,G.jsx)(Ce.IconDownloadOutline16,{size:16}),"\u4E0B\u8F7D\u6587\u4EF6"]})]})}function kl(e){if(e<1024)return`${e} B`;let t=["KB","MB","GB","TB"],s=e/1024,r=0;for(;s>=1024&&r<t.length-1;)s/=1024,r+=1;return`${s>=10?s.toFixed(0):s.toFixed(1)} ${t[r]}`}function z0(e){return new Intl.DateTimeFormat("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(e)}function An(e){return e instanceof Error?e.message:String(e)}function Cp(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-").slice(0,100)}var Ir=class{constructor(t){this.endpoints=t}input="";inputSequence=0;inputScheduled=!1;disposed=!1;sendInput(t,s){this.disposed||!t||(this.input+=t,!this.inputScheduled&&(this.inputScheduled=!0,queueMicrotask(()=>{if(this.inputScheduled=!1,this.disposed)return;let r=this.input;if(this.input="",!r)return;let o=this.inputSequence++;this.deliverInput(r,o,s)})))}observe(t){let s=!1,r=0,o,i,n,a=!1,h=()=>{s||(s=!0,o?.close(),i!==void 0&&clearTimeout(i),n!==void 0&&clearTimeout(n))},l=v=>{s||(r=v.cursor,t.output(v),v.closed&&h())},c=async()=>{if(!s)try{let v=await this.endpoints.read(r);l(v),s||(n=window.setTimeout(()=>{c()},document.hidden?500:v.data?16:64))}catch(v){if(s)return;t.error(v),n=window.setTimeout(()=>{c()},500)}},f=()=>{s||n!==void 0||(o?.close(),o=void 0,c())};return typeof EventSource>"u"?(f(),h):(o=new EventSource(this.endpoints.streamUrl),o.onmessage=v=>{try{let g=H0(v.data);a=!0,i!==void 0&&(clearTimeout(i),i=void 0),l(g)}catch(g){t.error(g),f()}},o.onerror=()=>{!a&&o?.readyState===EventSource.CLOSED&&f()},i=window.setTimeout(()=>{a||f()},1500),h)}dispose(){this.disposed=!0,this.input=""}deliverInput(t,s,r,o=0){this.endpoints.send(t,s).catch(i=>{if(!this.disposed){if(o<2&&$0(i)){window.setTimeout(()=>this.deliverInput(t,s,r,o+1),60*(o+1));return}r(i)}})}};function H0(e){let t=JSON.parse(e);if(typeof t.data!="string"||typeof t.cursor!="number"||!Number.isSafeInteger(t.cursor)||t.cursor<0||typeof t.truncated!="boolean"||typeof t.closed!="boolean")throw new Error("SSH terminal stream returned an invalid event");return t}function $0(e){if(typeof e!="object"||e===null||!("status"in e))return!0;let t=Number(e.status);return!Number.isFinite(t)||t>=500}var Pp=Fr(Tp(),1),U0={background:"#101719",foreground:"#e3eaeb",cursor:"#8aced0",cursorAccent:"#101719",selectionBackground:"#69b6ba40",black:"#101719",red:"#ff453a",green:"#30d158",yellow:"#ffd60a",blue:"#69b6ba",magenta:"#bf5af2",cyan:"#8aced0",white:"#d5dede",brightBlack:"#687a7e",brightRed:"#ff6961",brightGreen:"#66d47e",brightYellow:"#ffe45c",brightBlue:"#8aced0",brightMagenta:"#da8fff",brightCyan:"#b9e5e7",brightWhite:"#f1f5f5"};function Ln(e){return new Pp.Terminal({convertEol:!0,cursorBlink:e.readOnly!==!0,cursorInactiveStyle:"outline",disableStdin:e.readOnly===!0,fontFamily:'"SFMono-Regular", "Cascadia Code", "Liberation Mono", monospace',fontSize:e.compact===!0?12:13,fontWeight:"400",fontWeightBold:"600",letterSpacing:0,lineHeight:1.25,scrollback:e.scrollback,theme:U0})}function On(e,t,s,r){let o,i=!1,n="",a=()=>{if(i||e.clientWidth===0||e.clientHeight===0)return;s.fit(),t.scrollToBottom();let c=`${t.cols}x${t.rows}`;c!==n&&(n=c,r?.(t.cols,t.rows))},h=()=>{o!==void 0&&cancelAnimationFrame(o),o=requestAnimationFrame(()=>{o=void 0,a()})},l=new ResizeObserver(h);return l.observe(e),document.fonts?.ready.then(h).catch(()=>{}),h(),{fit:a,dispose(){i=!0,o!==void 0&&cancelAnimationFrame(o),l.disconnect()}}}var ce=require("react/jsx-runtime");function Rp(e){let t=String(e.sessionId),[s,r]=(0,Ge.useState)(),[o,i]=(0,Ge.useState)(()=>e.controller.requestedView(t)??"local-directory"),[n,a]=(0,Ge.useState)();(0,Ge.useEffect)(()=>e.controller.subscribe(()=>{let l=e.controller.requestedView(t);l!==void 0&&i(l)}),[e.controller,t]);let h=(0,Ge.useCallback)(async()=>{try{let l=await Ql(t);r(l),l.injection?.permission!=="terminal"&&(e.controller.requestedView(t)==="terminals"&&e.controller.open(t,void 0,"local-directory"),i(c=>c==="terminals"?"local-directory":c)),a(void 0)}catch(l){a(De(l))}},[e.controller,t]);return(0,Ge.useEffect)(()=>{let l=!1,c,f=!1,v=async()=>{if(f||(f=!0,await h(),f=!1,l))return;let u=o==="terminals"?2200:3200;c=window.setTimeout(()=>{v()},document.visibilityState==="hidden"?12e3:u)},g=()=>{document.visibilityState!=="visible"||l||(c!==void 0&&window.clearTimeout(c),c=void 0,v())};return document.addEventListener("visibilitychange",g),v(),()=>{l=!0,c!==void 0&&window.clearTimeout(c),document.removeEventListener("visibilitychange",g)}},[h,o]),(0,ce.jsxs)("section",{className:"dsh-ssh-activity-panel","aria-label":"SSH \u6D3B\u52A8",children:[(0,ce.jsxs)("header",{className:"dsh-ssh-activity-header",children:[(0,ce.jsxs)("div",{className:"dsh-ssh-activity-title",children:[(0,ce.jsx)("span",{className:"dsh-ssh-activity-mark",children:(0,ce.jsx)(Ts,{})}),(0,ce.jsxs)("span",{children:[(0,ce.jsx)("strong",{children:"SSH \u6D3B\u52A8"}),(0,ce.jsxs)("small",{children:["\u5F53\u524D\u4F1A\u8BDD \xB7 ",xp(t)]})]})]}),(0,ce.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u5173\u95ED SSH \u6D3B\u52A8",onClick:()=>e.controller.close(t),children:(0,ce.jsx)(as.IconCloseOutline16,{size:16})})]}),s&&(0,ce.jsxs)("nav",{className:"dsh-ssh-activity-tabs","aria-label":"SSH \u6D3B\u52A8\u89C6\u56FE",children:[(0,ce.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:o==="local-directory"?"is-active":"","aria-pressed":o==="local-directory",onClick:()=>e.controller.open(t,void 0,"local-directory"),children:[(0,ce.jsx)(as.IconFolderOpenOutline16,{size:16}),"\u4F1A\u8BDD\u76EE\u5F55"]}),s.profiles.length>0&&(0,ce.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:o==="remote-directory"?"is-active":"","aria-pressed":o==="remote-directory",onClick:()=>e.controller.open(t,void 0,"remote-directory"),children:[(0,ce.jsx)(Ts,{}),"\u8FDC\u7AEF\u76EE\u5F55"]}),s.injection?.permission==="terminal"&&(0,ce.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:o==="terminals"?"is-active":"","aria-pressed":o==="terminals",onClick:()=>e.controller.open(t,void 0,"terminals"),children:[(0,ce.jsx)(as.IconCodeOutline16,{size:16}),"\u7EC8\u7AEF",s.terminals.length>0&&(0,ce.jsx)("em",{children:s.terminals.length})]})]}),(0,ce.jsxs)("div",{className:"dsh-ssh-activity-body",children:[s===void 0?(0,ce.jsx)("p",{className:"dsh-ssh-activity-state",role:"status",children:"\u6B63\u5728\u8BFB\u53D6 SSH \u4F1A\u8BDD\u2026"}):o==="local-directory"?(0,ce.jsx)(wp,{sessionId:t}):o==="remote-directory"?(0,ce.jsx)(V0,{sessionId:t,profiles:s.profiles,selectedProfileId:e.controller.selected(t),onProfile:l=>e.controller.open(t,l,"remote-directory"),onSaved:h}):(0,ce.jsx)(j0,{sessionId:t,terminals:s.terminals,onClosed:h}),n&&(0,ce.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:n})]})]})}function V0({sessionId:e,profiles:t,selectedProfileId:s,onProfile:r,onSaved:o}){let i=t.find(n=>n.id===s)??t[0];return i===void 0?(0,ce.jsxs)("div",{className:"dsh-ssh-activity-empty",children:[(0,ce.jsx)(as.IconFolderOpenOutline16,{size:22}),(0,ce.jsx)("strong",{children:"\u6CA1\u6709\u53EF\u6D4F\u89C8\u7684\u8FDC\u7AEF"}),(0,ce.jsx)("p",{children:"\u8BF7\u5148\u5728 SSH \u9762\u677F\u4E2D\u5141\u8BB8\u5F53\u524D\u4F1A\u8BDD\u8BBF\u95EE\u4E00\u53F0\u4E3B\u673A\u3002"})]}):(0,ce.jsx)(Sp,{sessionId:e,profile:i,profiles:t,onProfile:r,onSaved:o},i.id)}function j0({sessionId:e,terminals:t,onClosed:s}){let r=[...t].reverse().find(g=>g.status.kind==="running")??t.at(-1),[o,i]=(0,Ge.useState)(r?.terminalId),[n,a]=(0,Ge.useState)(),[h,l]=(0,Ge.useState)(),c=t.find(g=>g.terminalId===o)??r;if((0,Ge.useEffect)(()=>{(o===void 0||!t.some(g=>g.terminalId===o))&&i(r?.terminalId)},[r?.terminalId,o,t]),c===void 0)return(0,ce.jsxs)("div",{className:"dsh-ssh-activity-empty",children:[(0,ce.jsx)(as.IconCodeOutline16,{size:22}),(0,ce.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u6253\u5F00\u7684\u7EC8\u7AEF"}),(0,ce.jsx)("p",{children:"AI \u6253\u5F00\u4EA4\u4E92\u7EC8\u7AEF\u540E\uFF0C\u4F1A\u76F4\u63A5\u663E\u793A\u5728\u8FD9\u91CC\u3002"})]});let f=async()=>{if(n===void 0){a(c.terminalId),l(void 0);try{await mh(e,c.terminalId),await s()}catch(g){l(De(g))}finally{a(void 0)}}},v=c.status.kind==="running"?"\u7ED3\u675F":"\u79FB\u9664";return(0,ce.jsxs)("div",{className:"dsh-ssh-terminal-workbench",children:[t.length>1&&(0,ce.jsx)("nav",{className:"dsh-ssh-terminal-switcher dsh-ssh-scroll-surface","aria-label":"SSH \u7EC8\u7AEF",children:t.map((g,u)=>{let d=g.name||`\u7EC8\u7AEF ${u+1}`;return(0,ce.jsxs)("button",{type:"button","data-ssh-interactive":"choice",title:d,className:g.terminalId===c.terminalId?"is-active":"","aria-pressed":g.terminalId===c.terminalId,onClick:()=>i(g.terminalId),children:[(0,ce.jsx)("span",{className:`dsh-ssh-terminal-state-dot is-${g.status.kind}`}),(0,ce.jsx)("span",{className:"dsh-ssh-terminal-switcher-label",children:d})]},g.terminalId)})}),(0,ce.jsxs)("div",{className:"dsh-ssh-terminal-observer",children:[(0,ce.jsxs)("div",{className:"dsh-ssh-terminal-observer-heading",children:[(0,ce.jsxs)("span",{children:[(0,ce.jsx)("strong",{children:c.name}),(0,ce.jsx)("small",{children:c.cwd})]}),(0,ce.jsxs)("div",{className:"dsh-ssh-terminal-observer-actions",children:[(0,ce.jsx)("span",{className:`dsh-ssh-terminal-state is-${c.status.kind}`,children:c.status.kind==="running"?"\u8FD0\u884C\u4E2D":"\u5DF2\u9000\u51FA"}),(0,ce.jsxs)("button",{type:"button",className:"dsh-ssh-terminal-close",disabled:n!==void 0,"aria-label":`${v}\u7EC8\u7AEF ${c.name}`,title:c.status.kind==="running"?"\u7ED3\u675F\u5E76\u5173\u95ED\u8FD9\u4E2A\u7EC8\u7AEF":"\u4ECE\u6D3B\u52A8\u9762\u677F\u79FB\u9664\u8FD9\u4E2A\u7EC8\u7AEF",onClick:()=>{f()},children:[(0,ce.jsx)(as.IconCloseOutline16,{size:14}),(0,ce.jsx)("span",{children:n===c.terminalId?"\u5904\u7406\u4E2D":v})]})]})]}),(0,ce.jsx)(W0,{sessionId:e,terminal:c,onError:l},c.terminalId)]}),h&&(0,ce.jsx)("p",{className:"dsh-ssh-terminal-input-error",role:"alert",children:h})]})}function W0({sessionId:e,terminal:t,onError:s}){let r=(0,Ge.useRef)(null),o=(0,Ge.useRef)();return(0,Ge.useEffect)(()=>{let i=r.current;if(i===null)return;let n=Ln({compact:!0,readOnly:t.status.kind!=="running",scrollback:4e3}),a=new Dp.FitAddon;n.loadAddon(a),n.open(i),o.current=n,n.focus();let h=new Ir({streamUrl:uh(e,t.terminalId),read:v=>dh(e,t.terminalId,v),send:(v,g)=>ch(e,t.terminalId,v,g)}),l=n.onData(v=>h.sendInput(v,g=>s(De(g)))),c=h.observe({output:v=>{v.truncated&&n.reset(),v.data&&n.write(v.data),n.scrollToBottom(),s(void 0)},error:v=>s(De(v))}),f=On(i,n,a,(v,g)=>{fh(e,t.terminalId,v,g).catch(u=>s(De(u)))});return()=>{c(),h.dispose(),l.dispose(),f.dispose(),n.dispose(),o.current=void 0}},[t.terminalId,s,e]),(0,Ge.useEffect)(()=>{let i=o.current;i!==void 0&&(i.options.disableStdin=t.status.kind!=="running")},[t.status.kind]),(0,ce.jsx)("div",{className:"dsh-ssh-terminal-screen","aria-label":"\u4EA4\u4E92\u5F0F SSH \u7EC8\u7AEF",children:(0,ce.jsx)("div",{ref:r,className:"dsh-ssh-terminal-viewport"})})}var Ps=require("react"),St=require("react/jsx-runtime");function Ip({className:e,toolbar:t,notice:s,navigation:r,navigationLabel:o,navigationIcon:i,inspector:n,inspectorLabel:a="\u8BE6\u60C5",inspectorIcon:h,children:l}){let[c,f]=(0,Ps.useState)(),v=(0,Ps.useRef)(null),g=(0,Ps.useRef)(null),u=(0,Ps.useRef)(null),d=()=>{f(void 0),window.requestAnimationFrame(()=>{let p=u.current;p?.isConnected&&p.focus()})},m={closePanel:d,openPanel:p=>f(p)};return(0,Ps.useEffect)(()=>{if(c===void 0)return;u.current=document.activeElement instanceof HTMLElement?document.activeElement:null;let b=(c==="navigation"?v.current:g.current)?.querySelector('input:not(:disabled), button:not(:disabled), select:not(:disabled), textarea:not(:disabled), a[href], [tabindex]:not([tabindex="-1"])');window.requestAnimationFrame(()=>b?.focus());let x=y=>{y.key==="Escape"&&d()};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[c]),(0,St.jsxs)("main",{className:`dsh-ssh-adaptive-workspace${e===void 0?"":` ${e}`}`,"data-panel":c??"none","data-has-inspector":n===void 0?"false":"true",children:[t,s,(0,St.jsxs)("nav",{className:"dsh-ssh-mobile-actions","aria-label":"\u5DE5\u4F5C\u533A\u9762\u677F",children:[(0,St.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":c==="navigation","aria-controls":"dsh-ssh-adaptive-navigation","aria-expanded":c==="navigation",onClick:()=>c==="navigation"?d():f("navigation"),children:[i,(0,St.jsx)("span",{children:o})]}),n!==void 0&&(0,St.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":c==="inspector","aria-controls":"dsh-ssh-adaptive-inspector","aria-expanded":c==="inspector",onClick:()=>c==="inspector"?d():f("inspector"),children:[h,(0,St.jsx)("span",{children:a})]})]}),(0,St.jsxs)("div",{className:"dsh-ssh-adaptive-shell",children:[(0,St.jsx)("aside",{ref:v,id:"dsh-ssh-adaptive-navigation",className:"dsh-ssh-adaptive-navigation","aria-label":o,children:Ap(r,m)}),(0,St.jsx)("section",{className:"dsh-ssh-adaptive-content",children:l}),n!==void 0&&(0,St.jsx)("aside",{ref:g,id:"dsh-ssh-adaptive-inspector",className:"dsh-ssh-adaptive-inspector","aria-label":a,children:Ap(n,m)}),(0,St.jsx)("button",{type:"button",className:"dsh-ssh-adaptive-backdrop","aria-label":"\u5173\u95ED\u9762\u677F",tabIndex:c===void 0?-1:0,onClick:d})]})]})}function Ap(e,t){return typeof e=="function"?e(t):e}var Lp=`.dsh-ssh-adaptive-workspace {
|
|
38
|
+
`))}function h(g,u,d,m){let p=d.enter("tableCell"),b=d.enter("phrasing"),x=d.containerPhrasing(g,{...m,before:i,after:i});return b(),p(),x}function l(g,u){return Sd(g,{align:u,alignDelimiters:r,padding:s,stringLength:o})}function c(g,u,d){let m=g.children,p=-1,b=[],x=u.enter("table");for(;++p<m.length;)b[p]=f(m[p],u,d);return x(),b}function f(g,u,d){let m=g.children,p=-1,b=[],x=u.enter("tableRow");for(;++p<m.length;)b[p]=h(m[p],g,u,d);return x(),b}function v(g,u,d){let m=Zr.inlineCode(g,u,d);return d.stack.includes("tableCell")&&(m=m.replace(/\|/g,"\\$&")),m}}function fa(){return{exit:{taskListCheckValueChecked:Kd,taskListCheckValueUnchecked:Kd,paragraph:wb}}}function ma(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Sb}}}function Kd(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function wb(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let s=this.stack[this.stack.length-1];s.type;let r=s.children[0];if(r&&r.type==="text"){let o=t.children,i=-1,n;for(;++i<o.length;){let a=o[i];if(a.type==="paragraph"){n=a;break}}n===s&&(r.value=r.value.slice(1),r.value.length===0?s.children.shift():s.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,s.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Sb(e,t,s,r){let o=e.children[0],i=typeof e.checked=="boolean"&&o&&o.type==="paragraph",n="["+(e.checked?"x":" ")+"] ",a=s.createTracker(r);i&&a.move(n);let h=Zr.listItem(e,t,s,{...r,...a.current()});return i&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),h;function l(c){return c+n}}function ga(){return[Go(),Jo(),Qo(),ua(),fa()]}function va(e){return{extensions:[Xo(),Yo(e),Zo(),pa(e),ma()]}}var kb={tokenize:Db,partial:!0},Gd={tokenize:Rb,partial:!0},Xd={tokenize:Ab,partial:!0},Jd={tokenize:Ib,partial:!0},Cb={tokenize:Lb,partial:!0},Yd={name:"wwwAutolink",tokenize:Tb,previous:Zd},Qd={name:"protocolAutolink",tokenize:Pb,previous:eu},ts={name:"emailAutolink",tokenize:Eb,previous:tu},Ht={};function _a(){return{text:Ht}}var Ks=48;for(;Ks<123;)Ht[Ks]=ts,Ks++,Ks===58?Ks=65:Ks===91&&(Ks=97);Ht[43]=ts;Ht[45]=ts;Ht[46]=ts;Ht[95]=ts;Ht[72]=[ts,Qd];Ht[104]=[ts,Qd];Ht[87]=[ts,Yd];Ht[119]=[ts,Yd];function Eb(e,t,s){let r=this,o,i;return n;function n(f){return!ba(f)||!tu.call(r,r.previous)||xa(r.events)?s(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(f))}function a(f){return ba(f)?(e.consume(f),a):f===64?(e.consume(f),h):s(f)}function h(f){return f===46?e.check(Cb,c,l)(f):f===45||f===95||Be(f)?(i=!0,e.consume(f),h):c(f)}function l(f){return e.consume(f),o=!0,h}function c(f){return i&&o&&We(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):s(f)}}function Tb(e,t,s){let r=this;return o;function o(n){return n!==87&&n!==119||!Zd.call(r,r.previous)||xa(r.events)?s(n):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(kb,e.attempt(Gd,e.attempt(Xd,i),s),s)(n))}function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}}function Pb(e,t,s){let r=this,o="",i=!1;return n;function n(f){return(f===72||f===104)&&eu.call(r,r.previous)&&!xa(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(f),e.consume(f),a):s(f)}function a(f){if(We(f)&&o.length<5)return o+=String.fromCodePoint(f),e.consume(f),a;if(f===58){let v=o.toLowerCase();if(v==="http"||v==="https")return e.consume(f),h}return s(f)}function h(f){return f===47?(e.consume(f),i?l:(i=!0,h)):s(f)}function l(f){return f===null||Ns(f)||_e(f)||Nt(f)||zs(f)?s(f):e.attempt(Gd,e.attempt(Xd,c),s)(f)}function c(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function Db(e,t,s){let r=0;return o;function o(n){return(n===87||n===119)&&r<3?(r++,e.consume(n),o):n===46&&r===3?(e.consume(n),i):s(n)}function i(n){return n===null?s(n):t(n)}}function Rb(e,t,s){let r,o,i;return n;function n(l){return l===46||l===95?e.check(Jd,h,a)(l):l===null||_e(l)||Nt(l)||l!==45&&zs(l)?h(l):(i=!0,e.consume(l),n)}function a(l){return l===95?r=!0:(o=r,r=void 0),e.consume(l),n}function h(l){return o||r||!i?s(l):t(l)}}function Ab(e,t){let s=0,r=0;return o;function o(n){return n===40?(s++,e.consume(n),o):n===41&&r<s?i(n):n===33||n===34||n===38||n===39||n===41||n===42||n===44||n===46||n===58||n===59||n===60||n===63||n===93||n===95||n===126?e.check(Jd,t,i)(n):n===null||_e(n)||Nt(n)?t(n):(e.consume(n),o)}function i(n){return n===41&&r++,e.consume(n),o}}function Ib(e,t,s){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),i):a===93?(e.consume(a),o):a===60||a===null||_e(a)||Nt(a)?t(a):s(a)}function o(a){return a===null||a===40||a===91||_e(a)||Nt(a)?t(a):r(a)}function i(a){return We(a)?n(a):s(a)}function n(a){return a===59?(e.consume(a),r):We(a)?(e.consume(a),n):s(a)}}function Lb(e,t,s){return r;function r(i){return e.consume(i),o}function o(i){return Be(i)?s(i):t(i)}}function Zd(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||_e(e)}function eu(e){return!We(e)}function tu(e){return!(e===47||ba(e))}function ba(e){return e===43||e===45||e===46||e===95||Be(e)}function xa(e){let t=e.length,s=!1;for(;t--;){let r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){s=!0;break}if(r._gfmAutolinkLiteralWalkedInto){s=!1;break}}return e.length>0&&!s&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}var Ob={tokenize:$b,partial:!0};function ya(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Nb,continuation:{tokenize:zb},exit:Hb}},text:{91:{name:"gfmFootnoteCall",tokenize:Bb},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Mb,resolveTo:Fb}}}}function Mb(e,t,s){let r=this,o=r.events.length,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),n;for(;o--;){let h=r.events[o][1];if(h.type==="labelImage"){n=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return a;function a(h){if(!n||!n._balanced)return s(h);let l=Ze(r.sliceSerialize({start:n.end,end:r.now()}));return l.codePointAt(0)!==94||!i.includes(l.slice(1))?s(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function Fb(e,t){let s=e.length,r;for(;s--;)if(e[s][1].type==="labelImage"&&e[s][0]==="enter"){r=e[s][1];break}e[s+1][1].type="data",e[s+3][1].type="gfmFootnoteCallLabelMarker";let o={type:"gfmFootnoteCall",start:Object.assign({},e[s+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[s+3][1].end),end:Object.assign({},e[s+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let n={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},n.start),end:Object.assign({},n.end)},h=[e[s+1],e[s+2],["enter",o,t],e[s+3],e[s+4],["enter",i,t],["exit",i,t],["enter",n,t],["enter",a,t],["exit",a,t],["exit",n,t],e[e.length-2],e[e.length-1],["exit",o,t]];return e.splice(s,e.length-s+1,...h),e}function Bb(e,t,s){let r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),i=0,n;return a;function a(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),h}function h(f){return f!==94?s(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(f){if(i>999||f===93&&!n||f===null||f===91||_e(f))return s(f);if(f===93){e.exit("chunkString");let v=e.exit("gfmFootnoteCallString");return o.includes(Ze(r.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):s(f)}return _e(f)||(n=!0),i++,e.consume(f),f===92?c:l}function c(f){return f===91||f===92||f===93?(e.consume(f),i++,l):l(f)}}function Nb(e,t,s){let r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),i,n=0,a;return h;function h(u){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(u),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(u){return u===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(u),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):s(u)}function c(u){if(n>999||u===93&&!a||u===null||u===91||_e(u))return s(u);if(u===93){e.exit("chunkString");let d=e.exit("gfmFootnoteDefinitionLabelString");return i=Ze(r.sliceSerialize(d)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(u),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return _e(u)||(a=!0),n++,e.consume(u),u===92?f:c}function f(u){return u===91||u===92||u===93?(e.consume(u),n++,c):c(u)}function v(u){return u===58?(e.enter("definitionMarker"),e.consume(u),e.exit("definitionMarker"),o.includes(i)||o.push(i),he(e,g,"gfmFootnoteDefinitionWhitespace")):s(u)}function g(u){return t(u)}}function zb(e,t,s){return e.check(zt,t,e.attempt(Ob,t,s))}function Hb(e){e.exit("gfmFootnoteDefinition")}function $b(e,t,s){let r=this;return he(e,o,"gfmFootnoteDefinitionIndent",5);function o(i){let n=r.events[r.events.length-1];return n&&n[1].type==="gfmFootnoteDefinitionIndent"&&n[2].sliceSerialize(n[1],!0).length===4?t(i):s(i)}}function wa(e){let s=(e||{}).singleTilde,r={name:"strikethrough",tokenize:i,resolveAll:o};return s==null&&(s=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(n,a){let h=-1;for(;++h<n.length;)if(n[h][0]==="enter"&&n[h][1].type==="strikethroughSequenceTemporary"&&n[h][1]._close){let l=h;for(;l--;)if(n[l][0]==="exit"&&n[l][1].type==="strikethroughSequenceTemporary"&&n[l][1]._open&&n[h][1].end.offset-n[h][1].start.offset===n[l][1].end.offset-n[l][1].start.offset){n[h][1].type="strikethroughSequence",n[l][1].type="strikethroughSequence";let c={type:"strikethrough",start:Object.assign({},n[l][1].start),end:Object.assign({},n[h][1].end)},f={type:"strikethroughText",start:Object.assign({},n[l][1].end),end:Object.assign({},n[h][1].start)},v=[["enter",c,a],["enter",n[l][1],a],["exit",n[l][1],a],["enter",f,a]],g=a.parser.constructs.insideSpan.null;g&&$e(v,v.length,0,ps(g,n.slice(l+1,h),a)),$e(v,v.length,0,[["exit",f,a],["enter",n[h][1],a],["exit",n[h][1],a],["exit",c,a]]),$e(n,l-1,h-l+3,v),h=l+v.length-2;break}}for(h=-1;++h<n.length;)n[h][1].type==="strikethroughSequenceTemporary"&&(n[h][1].type="data");return n}function i(n,a,h){let l=this.previous,c=this.events,f=0;return v;function v(u){return l===126&&c[c.length-1][1].type!=="characterEscape"?h(u):(n.enter("strikethroughSequenceTemporary"),g(u))}function g(u){let d=es(l);if(u===126)return f>1?h(u):(n.consume(u),f++,g);if(f<2&&!s)return h(u);let m=n.exit("strikethroughSequenceTemporary"),p=es(u);return m._open=!p||p===2&&!!d,m._close=!d||d===2&&!!p,a(u)}}}var nn=class{constructor(){this.map=[]}add(t,s,r){Ub(this,t,s,r)}consume(t){if(this.map.sort(function(i,n){return i[0]-n[0]}),this.map.length===0)return;let s=this.map.length,r=[];for(;s>0;)s-=1,r.push(t.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),t.length=this.map[s][0];r.push(t.slice()),t.length=0;let o=r.pop();for(;o;){for(let i of o)t.push(i);o=r.pop()}this.map.length=0}};function Ub(e,t,s,r){let o=0;if(!(s===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===t){e.map[o][1]+=s,e.map[o][2].push(...r);return}o+=1}e.map.push([t,s,r])}}function su(e,t){let s=!1,r=[];for(;t<e.length;){let o=e[t];if(s){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let i=r.length-1;r[i]=r[i]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(s=!0);t+=1}return r}function Sa(){return{flow:{null:{name:"table",tokenize:Vb,resolveAll:jb}}}}function Vb(e,t,s){let r=this,o=0,i=0,n;return a;function a(T){let A=r.events.length-1;for(;A>-1;){let U=r.events[A][1].type;if(U==="lineEnding"||U==="linePrefix")A--;else break}let F=A>-1?r.events[A][1].type:null,B=F==="tableHead"||F==="tableRow"?_:h;return B===_&&r.parser.lazy[r.now().line]?s(T):B(T)}function h(T){return e.enter("tableHead"),e.enter("tableRow"),l(T)}function l(T){return T===124||(n=!0,i+=1),c(T)}function c(T){return T===null?s(T):ie(T)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),g):s(T):ue(T)?he(e,c,"whitespace")(T):(i+=1,n&&(n=!1,o+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),n=!0,c):(e.enter("data"),f(T)))}function f(T){return T===null||T===124||_e(T)?(e.exit("data"),c(T)):(e.consume(T),T===92?v:f)}function v(T){return T===92||T===124?(e.consume(T),f):f(T)}function g(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?s(T):(e.enter("tableDelimiterRow"),n=!1,ue(T)?he(e,u,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):u(T))}function u(T){return T===45||T===58?m(T):T===124?(n=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),d):S(T)}function d(T){return ue(T)?he(e,m,"whitespace")(T):m(T)}function m(T){return T===58?(i+=1,n=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),p):T===45?(i+=1,p(T)):T===null||ie(T)?y(T):S(T)}function p(T){return T===45?(e.enter("tableDelimiterFiller"),b(T)):S(T)}function b(T){return T===45?(e.consume(T),b):T===58?(n=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(T))}function x(T){return ue(T)?he(e,y,"whitespace")(T):y(T)}function y(T){return T===124?u(T):T===null||ie(T)?!n||o!==i?S(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):S(T)}function S(T){return s(T)}function _(T){return e.enter("tableRow"),w(T)}function w(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),w):T===null||ie(T)?(e.exit("tableRow"),t(T)):ue(T)?he(e,w,"whitespace")(T):(e.enter("data"),C(T))}function C(T){return T===null||T===124||_e(T)?(e.exit("data"),w(T)):(e.consume(T),T===92?P:C)}function P(T){return T===92||T===124?(e.consume(T),C):C(T)}}function jb(e,t){let s=-1,r=!0,o=0,i=[0,0,0,0],n=[0,0,0,0],a=!1,h=0,l,c,f,v=new nn;for(;++s<e.length;){let g=e[s],u=g[1];g[0]==="enter"?u.type==="tableHead"?(a=!1,h!==0&&(ru(v,t,h,l,c),c=void 0,h=0),l={type:"table",start:Object.assign({},u.start),end:Object.assign({},u.end)},v.add(s,0,[["enter",l,t]])):u.type==="tableRow"||u.type==="tableDelimiterRow"?(r=!0,f=void 0,i=[0,0,0,0],n=[0,s+1,0,0],a&&(a=!1,c={type:"tableBody",start:Object.assign({},u.start),end:Object.assign({},u.end)},v.add(s,0,[["enter",c,t]])),o=u.type==="tableDelimiterRow"?2:c?3:1):o&&(u.type==="data"||u.type==="tableDelimiterMarker"||u.type==="tableDelimiterFiller")?(r=!1,n[2]===0&&(i[1]!==0&&(n[0]=n[1],f=on(v,t,i,o,void 0,f),i=[0,0,0,0]),n[2]=s)):u.type==="tableCellDivider"&&(r?r=!1:(i[1]!==0&&(n[0]=n[1],f=on(v,t,i,o,void 0,f)),i=n,n=[i[1],s,0,0])):u.type==="tableHead"?(a=!0,h=s):u.type==="tableRow"||u.type==="tableDelimiterRow"?(h=s,i[1]!==0?(n[0]=n[1],f=on(v,t,i,o,s,f)):n[1]!==0&&(f=on(v,t,n,o,s,f)),o=0):o&&(u.type==="data"||u.type==="tableDelimiterMarker"||u.type==="tableDelimiterFiller")&&(n[3]=s)}for(h!==0&&ru(v,t,h,l,c),v.consume(t.events),s=-1;++s<t.events.length;){let g=t.events[s];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=su(t.events,s))}return e}function on(e,t,s,r,o,i){let n=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";s[0]!==0&&(i.end=Object.assign({},vr(t.events,s[0])),e.add(s[0],0,[["exit",i,t]]));let h=vr(t.events,s[1]);if(i={type:n,start:Object.assign({},h),end:Object.assign({},h)},e.add(s[1],0,[["enter",i,t]]),s[2]!==0){let l=vr(t.events,s[2]),c=vr(t.events,s[3]),f={type:a,start:Object.assign({},l),end:Object.assign({},c)};if(e.add(s[2],0,[["enter",f,t]]),r!==2){let v=t.events[s[2]],g=t.events[s[3]];if(v[1].end=Object.assign({},g[1].end),v[1].type="chunkText",v[1].contentType="text",s[3]>s[2]+1){let u=s[2]+1,d=s[3]-s[2]-1;e.add(u,d,[])}}e.add(s[3]+1,0,[["exit",f,t]])}return o!==void 0&&(i.end=Object.assign({},vr(t.events,o)),e.add(o,0,[["exit",i,t]]),i=void 0),i}function ru(e,t,s,r,o){let i=[],n=vr(t.events,s);o&&(o.end=Object.assign({},n),i.push(["exit",o,t])),r.end=Object.assign({},n),i.push(["exit",r,t]),e.add(s+1,0,i)}function vr(e,t){let s=e[t],r=s[0]==="enter"?"start":"end";return s[1][r]}var Wb={name:"tasklistCheck",tokenize:qb};function ka(){return{text:{91:Wb}}}function qb(e,t,s){let r=this;return o;function o(h){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?s(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),i)}function i(h){return _e(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),n):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),n):s(h)}function n(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):s(h)}function a(h){return ie(h)?t(h):ue(h)?e.check({tokenize:Kb},t,s)(h):s(h)}}function Kb(e,t,s){return he(e,r,"whitespace");function r(o){return o===null?s(o):t(o)}}function iu(e){return Ii([_a(),ya(),wa(e),Sa(),ka()])}var Gb={};function an(e){let t=this,s=e||Gb,r=t.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),i=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),n=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(iu(s)),i.push(ga()),n.push(va(s))}var Ce=require("@deepseek-ai/dsh-client-ui-primitives");var Ft="application/x-dsh-remote-files";function hn(e){return e.kind==="directory"||e.navigable===!0}function ei(e,t){return e.endpointId===t.endpointId&&ln(e.directory)===ln(t.directory)}function ti(e,t,s){if(e.endpointId!==s.endpointId)return!0;let r=ln(s.directory);return!t.some(o=>{let i=ln(o);return r===i||r.startsWith(`${i}/`)})}function si(e,t){return ei(e,t)?"none":ti(e,e.paths,t)?e.endpointId===t.endpointId?"move":"copy":"invalid"}function br(e){try{let t=JSON.parse(e);return typeof t.paneId=="string"&&typeof t.endpointId=="string"&&typeof t.directory=="string"&&Array.isArray(t.paths)&&t.paths.every(s=>typeof s=="string")?{paneId:t.paneId,endpointId:t.endpointId,directory:t.directory,paths:t.paths}:void 0}catch{return}}function ln(e){return e.replaceAll("\\","/").replace(/\/{2,}/g,"/").replace(/\/$/,"")||"/"}async function cn(e,t){let s=si(e,t);if(s==="none")return{operation:s};if(s==="invalid")throw new Error("\u4E0D\u80FD\u628A\u76EE\u5F55\u79FB\u52A8\u5230\u81EA\u8EAB\u6216\u5176\u5B50\u76EE\u5F55");if(s==="move")return await Ul({paneId:t.paneId,endpointId:t.endpointId,sourceDirectory:e.directory,destinationDirectory:t.directory,paths:e.paths}),{operation:s};let r=await Nr({sourceEndpointId:e.endpointId,sourcePaths:e.paths,destinationEndpointId:t.endpointId,destinationDirectory:t.directory,conflictPolicy:"fail"});return{operation:s,job:r}}var Sl=require("react"),Ar=require("@deepseek-ai/dsh-client-ui-primitives");var Me=require("react"),Kt=require("@deepseek-ai/dsh-client-ui-primitives");var $t=require("react"),ri=require("react/jsx-runtime"),Xb=28;function Ca(e,t,s){return Math.min(Math.max(e,t),s)}function _r(){let e=(0,$t.useRef)(null),t=(0,$t.useRef)(void 0),s=(0,$t.useRef)(void 0),r=(0,$t.useCallback)(()=>{t.current=void 0;let n=e.current,a=s.current;if(n===null||a===void 0)return;let h=n.getBoundingClientRect(),l=Ca(a.clientX-h.left,0,h.width),c=Ca(a.clientY-h.top,0,h.height),f=Math.min(l,h.width-l,c,h.height-c),v=Ca(1-f/Xb,0,1),g=Math.atan2(c-h.height/2,l-h.width/2)*(180/Math.PI)+90;n.style.setProperty("--ssh-border-glow-proximity",v.toFixed(3)),n.style.setProperty("--ssh-border-glow-angle",`${g.toFixed(2)}deg`)},[]),o=(0,$t.useCallback)(n=>{s.current={clientX:n.clientX,clientY:n.clientY},t.current===void 0&&(t.current=requestAnimationFrame(r))},[r]),i=(0,$t.useCallback)(()=>{s.current=void 0;let n=e.current;n!==null&&n.style.setProperty("--ssh-border-glow-proximity","0")},[]);return(0,$t.useEffect)(()=>()=>{t.current!==void 0&&cancelAnimationFrame(t.current)},[]),{ref:e,onPointerMove:o,onPointerLeave:i}}function nu({children:e,className:t}){let s=_r();return(0,ri.jsxs)("div",{ref:s.ref,className:`dsh-ssh-border-glow${t===void 0?"":` ${t}`}`,onPointerMove:s.onPointerMove,onPointerLeave:s.onPointerLeave,children:[(0,ri.jsx)("span",{className:"dsh-ssh-border-glow-edge","aria-hidden":"true"}),(0,ri.jsx)("div",{className:"dsh-ssh-border-glow-inner",children:e})]})}var Ea=require("react/jsx-runtime");function Jb(e,t){let s=e.trim().replace(/^#/,"");if(/^[\da-f]{3}$/i.test(s)){let[r="0",o="0",i="0"]=s;return`rgba(${parseInt(r+r,16)}, ${parseInt(o+o,16)}, ${parseInt(i+i,16)}, ${t})`}return/^[\da-f]{6}$/i.test(s)?`rgba(${parseInt(s.slice(0,2),16)}, ${parseInt(s.slice(2,4),16)}, ${parseInt(s.slice(4,6),16)}, ${t})`:`color-mix(in srgb, ${e} ${Math.round(t*100)}%, transparent)`}function ou({children:e,className:t,glareColor:s="#ffffff",glareOpacity:r=.28,glareAngle:o=-30,glareSize:i=300,transitionDuration:n=800}){let a={"--dsh-ssh-glare-angle":`${o}deg`,"--dsh-ssh-glare-color":Jb(s,r),"--dsh-ssh-glare-duration":`${n}ms`,"--dsh-ssh-glare-size":`${i}px`};return(0,Ea.jsx)("div",{className:`dsh-ssh-glare-hover${t===void 0?"":` ${t}`}`,style:a,children:(0,Ea.jsx)("div",{className:"dsh-ssh-glare-hover-inner",children:e})})}var _l=require("react");function ss(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mu(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var ft={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},hi={duration:.5,overwrite:!1,delay:0},ja,Xe,Ae,Rt=1e8,Te=1/Rt,Oa=Math.PI*2,Yb=Oa/4,Qb=0,gu=Math.sqrt,Zb=Math.cos,e_=Math.sin,qe=function(t){return typeof t=="string"},Ne=function(t){return typeof t=="function"},is=function(t){return typeof t=="number"},xn=function(t){return typeof t>"u"},jt=function(t){return typeof t=="object"},pt=function(t){return t!==!1},Wa=function(){return typeof window<"u"},dn=function(t){return Ne(t)||qe(t)},vu=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},st=Array.isArray,t_=/random\([^)]+\)/g,s_=/,\s*/g,au=/(?:-?\.?\d|\.)+/gi,qa=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Ys=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Ta=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Ka=/[+-]=-?[.\d]+/,r_=/[^,'"\[\]\s]+/gi,i_=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Le,Ut,Ma,Ga,xt={},mn={},bu,_u=function(t){return(mn=yr(t,xt))&&rt},yn=function(t,s){return console.warn("Invalid property",t,"set to",s,"Missing plugin? gsap.registerPlugin()")},ci=function(t,s){return!s&&console.warn(t)},xu=function(t,s){return t&&(xt[t]=s)&&mn&&(mn[t]=s)||xt},di=function(){return 0},n_={suppressEvents:!0,isStart:!0,kill:!1},un={suppressEvents:!0,kill:!1},o_={suppressEvents:!0},Xa={},bs=[],Fa={},yu,dt={},Pa={},lu=30,pn=[],Ja="",Ya=function(t){var s=t[0],r,o;if(jt(s)||Ne(s)||(t=[t]),!(r=(s._gsap||{}).harness)){for(o=pn.length;o--&&!pn[o].targetTest(s););r=pn[o]}for(o=t.length;o--;)t[o]&&(t[o]._gsap||(t[o]._gsap=new tl(t[o],r)))||t.splice(o,1);return t},_s=function(t){return t._gsap||Ya(At(t))[0]._gsap},Qa=function(t,s,r){return(r=t[s])&&Ne(r)?t[s]():xn(r)&&t.getAttribute&&t.getAttribute(s)||r},nt=function(t,s){return(t=t.split(",")).forEach(s)||t},ze=function(t){return Math.round(t*1e5)/1e5||0},Ie=function(t){return Math.round(t*1e7)/1e7||0},Qs=function(t,s){var r=s.charAt(0),o=parseFloat(s.substr(2));return t=parseFloat(t),r==="+"?t+o:r==="-"?t-o:r==="*"?t*o:t/o},a_=function(t,s){for(var r=s.length,o=0;t.indexOf(s[o])<0&&++o<r;);return o<r},gn=function(){var t=bs.length,s=bs.slice(0),r,o;for(Fa={},bs.length=0,r=0;r<t;r++)o=s[r],o&&o._lazy&&(o.render(o._lazy[0],o._lazy[1],!0)._lazy=0)},Za=function(t){return!!(t._initted||t._startAt||t.add)},wu=function(t,s,r,o){bs.length&&!Xe&&gn(),t.render(s,r,o||!!(Xe&&s<0&&Za(t))),bs.length&&!Xe&&gn()},Su=function(t){var s=parseFloat(t);return(s||s===0)&&(t+"").match(r_).length<2?s:qe(t)?t.trim():t},ku=function(t){return t},yt=function(t,s){for(var r in s)r in t||(t[r]=s[r]);return t},l_=function(t){return function(s,r){for(var o in r)o in s||o==="duration"&&t||o==="ease"||(s[o]=r[o])}},yr=function(t,s){for(var r in s)t[r]=s[r];return t},hu=function e(t,s){for(var r in s)r!=="__proto__"&&r!=="constructor"&&r!=="prototype"&&(t[r]=jt(s[r])?e(t[r]||(t[r]={}),s[r]):s[r]);return t},vn=function(t,s){var r={},o;for(o in t)o in s||(r[o]=t[o]);return r},oi=function(t){var s=t.parent||Le,r=t.keyframes?l_(st(t.keyframes)):yt;if(pt(t.inherit))for(;s;)r(t,s.vars.defaults),s=s.parent||s._dp;return t},h_=function(t,s){for(var r=t.length,o=r===s.length;o&&r--&&t[r]===s[r];);return r<0},Cu=function(t,s,r,o,i){r===void 0&&(r="_first"),o===void 0&&(o="_last");var n=t[o],a;if(i)for(a=s[i];n&&n[i]>a;)n=n._prev;return n?(s._next=n._next,n._next=s):(s._next=t[r],t[r]=s),s._next?s._next._prev=s:t[o]=s,s._prev=n,s.parent=s._dp=t,s},wn=function(t,s,r,o){r===void 0&&(r="_first"),o===void 0&&(o="_last");var i=s._prev,n=s._next;i?i._next=n:t[r]===s&&(t[r]=n),n?n._prev=i:t[o]===s&&(t[o]=i),s._next=s._prev=s.parent=null},xs=function(t,s){t.parent&&(!s||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},Gs=function(t,s){if(t&&(!s||s._end>t._dur||s._start<0))for(var r=t;r;)r._dirty=1,r=r.parent;return t},c_=function(t){for(var s=t.parent;s&&s.parent;)s._dirty=1,s.totalDuration(),s=s.parent;return t},Ba=function(t,s,r,o){return t._startAt&&(Xe?t._startAt.revert(un):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(s,!0,o))},d_=function e(t){return!t||t._ts&&e(t.parent)},cu=function(t){return t._repeat?wr(t._tTime,t=t.duration()+t._rDelay)*t:0},wr=function(t,s){var r=Math.floor(t=Ie(t/s));return t&&r===t?r-1:r},bn=function(t,s){return(t-s._start)*s._ts+(s._ts>=0?0:s._dirty?s.totalDuration():s._tDur)},Sn=function(t){return t._end=Ie(t._start+(t._tDur/Math.abs(t._ts||t._rts||Te)||0))},kn=function(t,s){var r=t._dp;return r&&r.smoothChildTiming&&t._ts&&(t._start=Ie(r._time-(t._ts>0?s/t._ts:((t._dirty?t.totalDuration():t._tDur)-s)/-t._ts)),Sn(t),r._dirty||Gs(r,t)),t},Eu=function(t,s){var r;if((s._time||!s._dur&&s._initted||s._start<t._time&&(s._dur||!s.add))&&(r=bn(t.rawTime(),s),(!s._dur||fi(0,s.totalDuration(),r)-s._tTime>Te)&&s.render(r,!0)),Gs(t,s)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(r=t;r._dp;)r.rawTime()>=0&&r.totalTime(r._tTime),r=r._dp;t._zTime=-Te}},Vt=function(t,s,r,o){return s.parent&&xs(s),s._start=Ie((is(r)?r:r||t!==Le?Dt(t,r,s):t._time)+s._delay),s._end=Ie(s._start+(s.totalDuration()/Math.abs(s.timeScale())||0)),Cu(t,s,"_first","_last",t._sort?"_start":0),Na(s)||(t._recent=s),o||Eu(t,s),t._ts<0&&kn(t,t._tTime),t},Tu=function(t,s){return(xt.ScrollTrigger||yn("scrollTrigger",s))&&xt.ScrollTrigger.create(s,t)},Pu=function(t,s,r,o,i){if(il(t,s,i),!t._initted)return 1;if(!r&&t._pt&&!Xe&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&yu!==ut.frame)return bs.push(t),t._lazy=[i,o],1},u_=function e(t){var s=t.parent;return s&&s._ts&&s._initted&&!s._lock&&(s.rawTime()<0||e(s))},Na=function(t){var s=t.data;return s==="isFromStart"||s==="isStart"},p_=function(t,s,r,o){var i=t.ratio,n=s<0||!s&&(!t._start&&u_(t)&&!(!t._initted&&Na(t))||(t._ts<0||t._dp._ts<0)&&!Na(t))?0:1,a=t._rDelay,h=0,l,c,f;if(a&&t._repeat&&(h=fi(0,t._tDur,s),c=wr(h,a),t._yoyo&&c&1&&(n=1-n),c!==wr(t._tTime,a)&&(i=1-n,t.vars.repeatRefresh&&t._initted&&t.invalidate())),n!==i||Xe||o||t._zTime===Te||!s&&t._zTime){if(!t._initted&&Pu(t,s,o,r,h))return;for(f=t._zTime,t._zTime=s||(r?Te:0),r||(r=s&&!f),t.ratio=n,t._from&&(n=1-n),t._time=0,t._tTime=h,l=t._pt;l;)l.r(n,l.d),l=l._next;s<0&&Ba(t,s,r,!0),t._onUpdate&&!r&&_t(t,"onUpdate"),h&&t._repeat&&!r&&t.parent&&_t(t,"onRepeat"),(s>=t._tDur||s<0)&&t.ratio===n&&(n&&xs(t,1),!r&&!Xe&&(_t(t,n?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=s)},f_=function(t,s,r){var o;if(r>s)for(o=t._first;o&&o._start<=r;){if(o.data==="isPause"&&o._start>s)return o;o=o._next}else for(o=t._last;o&&o._start>=r;){if(o.data==="isPause"&&o._start<s)return o;o=o._prev}},Sr=function(t,s,r,o){var i=t._repeat,n=Ie(s)||0,a=t._tTime/t._tDur;return a&&!o&&(t._time*=n/t._dur),t._dur=n,t._tDur=i?i<0?1e10:Ie(n*(i+1)+t._rDelay*i):n,a>0&&!o&&kn(t,t._tTime=t._tDur*a),t.parent&&Sn(t),r||Gs(t.parent,t),t},du=function(t){return t instanceof tt?Gs(t):Sr(t,t._dur)},m_={_start:0,endTime:di,totalDuration:di},Dt=function e(t,s,r){var o=t.labels,i=t._recent||m_,n=t.duration()>=Rt?i.endTime(!1):t._dur,a,h,l;return qe(s)&&(isNaN(s)||s in o)?(h=s.charAt(0),l=s.substr(-1)==="%",a=s.indexOf("="),h==="<"||h===">"?(a>=0&&(s=s.replace(/=/,"")),(h==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(s.substr(1))||0)*(l?(a<0?i:r).totalDuration()/100:1)):a<0?(s in o||(o[s]=n),o[s]):(h=parseFloat(s.charAt(a-1)+s.substr(a+1)),l&&r&&(h=h/100*(st(r)?r[0]:r).totalDuration()),a>1?e(t,s.substr(0,a-1),r)+h:n+h)):s==null?n:+s},ai=function(t,s,r){var o=is(s[1]),i=(o?2:1)+(t<2?0:1),n=s[i],a,h;if(o&&(n.duration=s[1]),n.parent=r,t){for(a=n,h=r;h&&!("immediateRender"in a);)a=h.vars.defaults||{},h=pt(h.vars.inherit)&&h.parent;n.immediateRender=pt(a.immediateRender),t<2?n.runBackwards=1:n.startAt=s[i-1]}return new Ue(s[0],n,s[i+1])},ys=function(t,s){return t||t===0?s(t):s},fi=function(t,s,r){return r<t?t:r>s?s:r},Je=function(t,s){return!qe(t)||!(s=i_.exec(t))?"":s[1]},g_=function(t,s,r){return ys(r,function(o){return fi(t,s,o)})},za=[].slice,Du=function(t,s){return t&&jt(t)&&"length"in t&&(!s&&!t.length||t.length-1 in t&&jt(t[0]))&&!t.nodeType&&t!==Ut},v_=function(t,s,r){return r===void 0&&(r=[]),t.forEach(function(o){var i;return qe(o)&&!s||Du(o,1)?(i=r).push.apply(i,At(o)):r.push(o)})||r},At=function(t,s,r){return Ae&&!s&&Ae.selector?Ae.selector(t):qe(t)&&!r&&(Ma||!kr())?za.call((s||Ga).querySelectorAll(t),0):st(t)?v_(t,r):Du(t)?za.call(t,0):t?[t]:[]},Ha=function(t){return t=At(t)[0]||ci("Invalid scope")||{},function(s){var r=t.current||t.nativeElement||t;return At(s,r.querySelectorAll?r:r===t?ci("Invalid scope")||Ga.createElement("div"):t)}},Ru=function(t){return t.sort(function(){return .5-Math.random()})},Au=function(t){if(Ne(t))return t;var s=jt(t)?t:{each:t},r=Xs(s.ease),o=s.from||0,i=parseFloat(s.base)||0,n={},a=o>0&&o<1,h=isNaN(o)||a,l=s.axis,c=o,f=o;return qe(o)?c=f={center:.5,edges:.5,end:1}[o]||0:!a&&h&&(c=o[0],f=o[1]),function(v,g,u){var d=(u||s).length,m=n[d],p,b,x,y,S,_,w,C,P;if(!m){if(P=s.grid==="auto"?0:(s.grid||[1,Rt])[1],!P){for(w=-Rt;w<(w=u[P++].getBoundingClientRect().left)&&P<d;);P<d&&P--}for(m=n[d]=[],p=h?Math.min(P,d)*c-.5:o%P,b=P===Rt?0:h?d*f/P-.5:o/P|0,w=0,C=Rt,_=0;_<d;_++)x=_%P-p,y=b-(_/P|0),m[_]=S=l?Math.abs(l==="y"?y:x):gu(x*x+y*y),S>w&&(w=S),S<C&&(C=S);o==="random"&&Ru(m),m.max=w-C,m.min=C,m.v=d=(parseFloat(s.amount)||parseFloat(s.each)*(P>d?d-1:l?l==="y"?d/P:P:Math.max(P,d/P))||0)*(o==="edges"?-1:1),m.b=d<0?i-d:i,m.u=Je(s.amount||s.each)||0,r=r&&d<0?R_(r):r}return d=(m[v]-m.min)/m.max||0,Ie(m.b+(r?r(d):d)*m.v)+m.u}},$a=function(t){var s=Math.pow(10,((t+"").split(".")[1]||"").length);return function(r){var o=Ie(Math.round(parseFloat(r)/t)*t*s);return(o-o%1)/s+(is(r)?0:Je(r))}},Iu=function(t,s){var r=st(t),o,i;return!r&&jt(t)&&(o=r=t.radius||Rt,t.values?(t=At(t.values),(i=!is(t[0]))&&(o*=o)):t=$a(t.increment)),ys(s,r?Ne(t)?function(n){return i=t(n),Math.abs(i-n)<=o?i:n}:function(n){for(var a=parseFloat(i?n.x:n),h=parseFloat(i?n.y:0),l=Rt,c=0,f=t.length,v,g;f--;)i?(v=t[f].x-a,g=t[f].y-h,v=v*v+g*g):v=Math.abs(t[f]-a),v<l&&(l=v,c=f);return c=!o||l<=o?t[c]:n,i||c===n||is(n)?c:c+Je(n)}:$a(t))},Lu=function(t,s,r,o){return ys(st(t)?!s:r===!0?!!(r=0):!o,function(){return st(t)?t[~~(Math.random()*t.length)]:(r=r||1e-5)&&(o=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((t-r/2+Math.random()*(s-t+r*.99))/r)*r*o)/o})},b_=function(){for(var t=arguments.length,s=new Array(t),r=0;r<t;r++)s[r]=arguments[r];return function(o){return s.reduce(function(i,n){return n(i)},o)}},__=function(t,s){return function(r){return t(parseFloat(r))+(s||Je(r))}},x_=function(t,s,r){return Mu(t,s,0,1,r)},Ou=function(t,s,r){return ys(r,function(o){return t[~~s(o)]})},y_=function e(t,s,r){var o=s-t;return st(t)?Ou(t,e(0,t.length),s):ys(r,function(i){return(o+(i-t)%o)%o+t})},w_=function e(t,s,r){var o=s-t,i=o*2;return st(t)?Ou(t,e(0,t.length-1),s):ys(r,function(n){return n=(i+(n-t)%i)%i||0,t+(n>o?i-n:n)})},Cr=function(t){return t.replace(t_,function(s){var r=s.indexOf("[")+1,o=s.substring(r||7,r?s.indexOf("]"):s.length-1).split(s_);return Lu(r?o:+o[0],r?0:+o[1],+o[2]||1e-5)})},Mu=function(t,s,r,o,i){var n=s-t,a=o-r;return ys(i,function(h){return r+((h-t)/n*a||0)})},S_=function e(t,s,r,o){var i=isNaN(t+s)?0:function(g){return(1-g)*t+g*s};if(!i){var n=qe(t),a={},h,l,c,f,v;if(r===!0&&(o=1)&&(r=null),n)t={p:t},s={p:s};else if(st(t)&&!st(s)){for(c=[],f=t.length,v=f-2,l=1;l<f;l++)c.push(e(t[l-1],t[l]));f--,i=function(u){u*=f;var d=Math.min(v,~~u);return c[d](u-d)},r=s}else o||(t=yr(st(t)?[]:{},t));if(!c){for(h in s)sl.call(a,t,h,"get",s[h]);i=function(u){return al(u,a)||(n?t.p:t)}}}return ys(r,i)},uu=function(t,s,r){var o=t.labels,i=Rt,n,a,h;for(n in o)a=o[n]-s,a<0==!!r&&a&&i>(a=Math.abs(a))&&(h=n,i=a);return h},_t=function(t,s,r){var o=t.vars,i=o[s],n=Ae,a=t._ctx,h,l,c;if(i)return h=o[s+"Params"],l=o.callbackScope||t,r&&bs.length&&gn(),a&&(Ae=a),c=h?i.apply(l,h):i.call(l),Ae=n,c},ii=function(t){return xs(t),t.scrollTrigger&&t.scrollTrigger.kill(!!Xe),t.progress()<1&&_t(t,"onInterrupt"),t},xr,Fu=[],Bu=function(t){if(t)if(t=!t.name&&t.default||t,Wa()||t.headless){var s=t.name,r=Ne(t),o=s&&!r&&t.init?function(){this._props=[]}:t,i={init:di,render:al,add:sl,kill:H_,modifier:z_,rawVars:0},n={targetTest:0,get:0,getSetter:Cn,aliases:{},register:0};if(kr(),t!==o){if(dt[s])return;yt(o,yt(vn(t,i),n)),yr(o.prototype,yr(i,vn(t,n))),dt[o.prop=s]=o,t.targetTest&&(pn.push(o),Xa[s]=1),s=(s==="css"?"CSS":s.charAt(0).toUpperCase()+s.substr(1))+"Plugin"}xu(s,o),t.register&&t.register(rt,o,ot)}else Fu.push(t)},Ee=255,ni={aqua:[0,Ee,Ee],lime:[0,Ee,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,Ee],navy:[0,0,128],white:[Ee,Ee,Ee],olive:[128,128,0],yellow:[Ee,Ee,0],orange:[Ee,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[Ee,0,0],pink:[Ee,192,203],cyan:[0,Ee,Ee],transparent:[Ee,Ee,Ee,0]},Da=function(t,s,r){return t+=t<0?1:t>1?-1:0,(t*6<1?s+(r-s)*t*6:t<.5?r:t*3<2?s+(r-s)*(2/3-t)*6:s)*Ee+.5|0},Nu=function(t,s,r){var o=t?is(t)?[t>>16,t>>8&Ee,t&Ee]:0:ni.black,i,n,a,h,l,c,f,v,g,u;if(!o){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),ni[t])o=ni[t];else if(t.charAt(0)==="#"){if(t.length<6&&(i=t.charAt(1),n=t.charAt(2),a=t.charAt(3),t="#"+i+i+n+n+a+a+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return o=parseInt(t.substr(1,6),16),[o>>16,o>>8&Ee,o&Ee,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),o=[t>>16,t>>8&Ee,t&Ee]}else if(t.substr(0,3)==="hsl"){if(o=u=t.match(au),!s)h=+o[0]%360/360,l=+o[1]/100,c=+o[2]/100,n=c<=.5?c*(l+1):c+l-c*l,i=c*2-n,o.length>3&&(o[3]*=1),o[0]=Da(h+1/3,i,n),o[1]=Da(h,i,n),o[2]=Da(h-1/3,i,n);else if(~t.indexOf("="))return o=t.match(qa),r&&o.length<4&&(o[3]=1),o}else o=t.match(au)||ni.transparent;o=o.map(Number)}return s&&!u&&(i=o[0]/Ee,n=o[1]/Ee,a=o[2]/Ee,f=Math.max(i,n,a),v=Math.min(i,n,a),c=(f+v)/2,f===v?h=l=0:(g=f-v,l=c>.5?g/(2-f-v):g/(f+v),h=f===i?(n-a)/g+(n<a?6:0):f===n?(a-i)/g+2:(i-n)/g+4,h*=60),o[0]=~~(h+.5),o[1]=~~(l*100+.5),o[2]=~~(c*100+.5)),r&&o.length<4&&(o[3]=1),o},zu=function(t){var s=[],r=[],o=-1;return t.split(rs).forEach(function(i){var n=i.match(Ys)||[];s.push.apply(s,n),r.push(o+=n.length+1)}),s.c=r,s},pu=function(t,s,r){var o="",i=(t+o).match(rs),n=s?"hsla(":"rgba(",a=0,h,l,c,f;if(!i)return t;if(i=i.map(function(v){return(v=Nu(v,s,1))&&n+(s?v[0]+","+v[1]+"%,"+v[2]+"%,"+v[3]:v.join(","))+")"}),r&&(c=zu(t),h=r.c,h.join(o)!==c.c.join(o)))for(l=t.replace(rs,"1").split(Ys),f=l.length-1;a<f;a++)o+=l[a]+(~h.indexOf(a)?i.shift()||n+"0,0,0,0)":(c.length?c:i.length?i:r).shift());if(!l)for(l=t.split(rs),f=l.length-1;a<f;a++)o+=l[a]+i[a];return o+l[f]},rs=(function(){var e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",t;for(t in ni)e+="|"+t+"\\b";return new RegExp(e+")","gi")})(),k_=/hsl[a]?\(/,el=function(t){var s=t.join(" "),r;if(rs.lastIndex=0,rs.test(s))return r=k_.test(s),t[1]=pu(t[1],r),t[0]=pu(t[0],r,zu(t[1])),!0},ui,ut=(function(){var e=Date.now,t=500,s=33,r=e(),o=r,i=1e3/240,n=i,a=[],h,l,c,f,v,g,u=function d(m){var p=e()-o,b=m===!0,x,y,S,_;if((p>t||p<0)&&(r+=p-s),o+=p,S=o-r,x=S-n,(x>0||b)&&(_=++f.frame,v=S-f.time*1e3,f.time=S=S/1e3,n+=x+(x>=i?4:i-x),y=1),b||(h=l(d)),y)for(g=0;g<a.length;g++)a[g](S,v,_,m)};return f={time:0,frame:0,tick:function(){u(!0)},deltaRatio:function(m){return v/(1e3/(m||60))},wake:function(){bu&&(!Ma&&Wa()&&(Ut=Ma=window,Ga=Ut.document||{},xt.gsap=rt,(Ut.gsapVersions||(Ut.gsapVersions=[])).push(rt.version),_u(mn||Ut.GreenSockGlobals||!Ut.gsap&&Ut||{}),Fu.forEach(Bu)),c=typeof requestAnimationFrame<"u"&&requestAnimationFrame,h&&f.sleep(),l=c||function(m){return setTimeout(m,n-f.time*1e3+1|0)},ui=1,u(2))},sleep:function(){(c?cancelAnimationFrame:clearTimeout)(h),ui=0,l=di},lagSmoothing:function(m,p){t=m||1/0,s=Math.min(p||33,t)},fps:function(m){i=1e3/(m||240),n=f.time*1e3+i},add:function(m,p,b){var x=p?function(y,S,_,w){m(y,S,_,w),f.remove(x)}:m;return f.remove(m),a[b?"unshift":"push"](x),kr(),x},remove:function(m,p){~(p=a.indexOf(m))&&a.splice(p,1)&&g>=p&&g--},_listeners:a},f})(),kr=function(){return!ui&&ut.wake()},we={},C_=/^[\d.\-M][\d.\-,\s]/,E_=/["']/g,T_=function(t){for(var s={},r=t.substr(1,t.length-3).split(":"),o=r[0],i=1,n=r.length,a,h,l;i<n;i++)h=r[i],a=i!==n-1?h.lastIndexOf(","):h.length,l=h.substr(0,a),s[o]=isNaN(l)?l.replace(E_,"").trim():+l,o=h.substr(a+1).trim();return s},P_=function(t){var s=t.indexOf("(")+1,r=t.indexOf(")"),o=t.indexOf("(",s);return t.substring(s,~o&&o<r?t.indexOf(")",r+1):r)},D_=function(t){var s=(t+"").split("("),r=we[s[0]];return r&&s.length>1&&r.config?r.config.apply(null,~t.indexOf("{")?[T_(s[1])]:P_(t).split(",").map(Su)):we._CE&&C_.test(t)?we._CE("",t):r},R_=function(t){return function(s){return 1-t(1-s)}},Xs=function(t,s){return t&&(Ne(t)?t:we[t]||D_(t))||s},Zs=function(t,s,r,o){r===void 0&&(r=function(h){return 1-s(1-h)}),o===void 0&&(o=function(h){return h<.5?s(h*2)/2:1-s((1-h)*2)/2});var i={easeIn:s,easeOut:r,easeInOut:o},n;return nt(t,function(a){we[a]=xt[a]=i,we[n=a.toLowerCase()]=r;for(var h in i)we[n+(h==="easeIn"?".in":h==="easeOut"?".out":".inOut")]=we[a+"."+h]=i[h]}),i},Hu=function(t){return function(s){return s<.5?(1-t(1-s*2))/2:.5+t((s-.5)*2)/2}},Ra=function e(t,s,r){var o=s>=1?s:1,i=(r||(t?.3:.45))/(s<1?s:1),n=i/Oa*(Math.asin(1/o)||0),a=function(c){return c===1?1:o*Math.pow(2,-10*c)*e_((c-n)*i)+1},h=t==="out"?a:t==="in"?function(l){return 1-a(1-l)}:Hu(a);return i=Oa/i,h.config=function(l,c){return e(t,l,c)},h},Aa=function e(t,s){s===void 0&&(s=1.70158);var r=function(n){return n?--n*n*((s+1)*n+s)+1:0},o=t==="out"?r:t==="in"?function(i){return 1-r(1-i)}:Hu(r);return o.config=function(i){return e(t,i)},o};nt("Linear,Quad,Cubic,Quart,Quint,Strong",function(e,t){var s=t<5?t+1:t;Zs(e+",Power"+(s-1),t?function(r){return Math.pow(r,s)}:function(r){return r},function(r){return 1-Math.pow(1-r,s)},function(r){return r<.5?Math.pow(r*2,s)/2:1-Math.pow((1-r)*2,s)/2})});we.Linear.easeNone=we.none=we.Linear.easeIn;Zs("Elastic",Ra("in"),Ra("out"),Ra());(function(e,t){var s=1/t,r=2*s,o=2.5*s,i=function(a){return a<s?e*a*a:a<r?e*Math.pow(a-1.5/t,2)+.75:a<o?e*(a-=2.25/t)*a+.9375:e*Math.pow(a-2.625/t,2)+.984375};Zs("Bounce",function(n){return 1-i(1-n)},i)})(7.5625,2.75);Zs("Expo",function(e){return Math.pow(2,10*(e-1))*e+e*e*e*e*e*e*(1-e)});Zs("Circ",function(e){return-(gu(1-e*e)-1)});Zs("Sine",function(e){return e===1?1:-Zb(e*Yb)+1});Zs("Back",Aa("in"),Aa("out"),Aa());we.SteppedEase=we.steps=xt.SteppedEase={config:function(t,s){t===void 0&&(t=1);var r=1/t,o=t+(s?0:1),i=s?1:0,n=1-Te;return function(a){return((o*fi(0,n,a)|0)+i)*r}}};hi.ease=we["quad.out"];nt("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(e){return Ja+=e+","+e+"Params,"});var tl=function(t,s){this.id=Qb++,t._gsap=this,this.target=t,this.harness=s,this.get=s?s.get:Qa,this.set=s?s.getSetter:Cn},pi=(function(){function e(s){this.vars=s,this._delay=+s.delay||0,(this._repeat=s.repeat===1/0?-2:s.repeat||0)&&(this._rDelay=s.repeatDelay||0,this._yoyo=!!s.yoyo||!!s.yoyoEase),this._ts=1,Sr(this,+s.duration,1,1),this.data=s.data,Ae&&(this._ctx=Ae,Ae.data.push(this)),ui||ut.wake()}var t=e.prototype;return t.delay=function(r){return r||r===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+r-this._delay),this._delay=r,this):this._delay},t.duration=function(r){return arguments.length?this.totalDuration(this._repeat>0?r+(r+this._rDelay)*this._repeat:r):this.totalDuration()&&this._dur},t.totalDuration=function(r){return arguments.length?(this._dirty=0,Sr(this,this._repeat<0?r:(r-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(r,o){if(kr(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(kn(this,r),!i._dp||i.parent||Eu(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&r<this._tDur||this._ts<0&&r>0||!this._tDur&&!r)&&Vt(this._dp,this,this._start-this._delay)}return(this._tTime!==r||!this._dur&&!o||this._initted&&Math.abs(this._zTime)===Te||!this._initted&&this._dur&&r||!r&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=r),wu(this,r,o)),this},t.time=function(r,o){return arguments.length?this.totalTime(Math.min(this.totalDuration(),r+cu(this))%(this._dur+this._rDelay)||(r?this._dur:0),o):this._time},t.totalProgress=function(r,o){return arguments.length?this.totalTime(this.totalDuration()*r,o):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},t.progress=function(r,o){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-r:r)+cu(this),o):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(r,o){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(r-1)*i,o):this._repeat?wr(this._tTime,i)+1:1},t.timeScale=function(r,o){if(!arguments.length)return this._rts===-Te?0:this._rts;if(this._rts===r)return this;var i=this.parent&&this._ts?bn(this.parent._time,this):this._tTime;return this._rts=+r||0,this._ts=this._ps||r===-Te?0:this._rts,this.totalTime(fi(-Math.abs(this._delay),this.totalDuration(),i),o!==!1),Sn(this),c_(this)},t.paused=function(r){return arguments.length?(this._ps!==r&&(this._ps=r,r?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(kr(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Te&&(this._tTime-=Te)))),this):this._ps},t.startTime=function(r){if(arguments.length){this._start=Ie(r);var o=this.parent||this._dp;return o&&(o._sort||!this.parent)&&Vt(o,this,this._start-this._delay),this}return this._start},t.endTime=function(r){return this._start+(pt(r)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(r){var o=this.parent||this._dp;return o?r&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?bn(o.rawTime(r),this):this._tTime:this._tTime},t.revert=function(r){r===void 0&&(r=o_);var o=Xe;return Xe=r,Za(this)&&(this.timeline&&this.timeline.revert(r),this.totalTime(-.01,r.suppressEvents)),this.data!=="nested"&&r.kill!==!1&&this.kill(),Xe=o,this},t.globalTime=function(r){for(var o=this,i=arguments.length?r:o.rawTime();o;)i=o._start+i/(Math.abs(o._ts)||1),o=o._dp;return!this.parent&&this._sat?this._sat.globalTime(r):i},t.repeat=function(r){return arguments.length?(this._repeat=r===1/0?-2:r,du(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(r){if(arguments.length){var o=this._time;return this._rDelay=r,du(this),o?this.time(o):this}return this._rDelay},t.yoyo=function(r){return arguments.length?(this._yoyo=r,this):this._yoyo},t.seek=function(r,o){return this.totalTime(Dt(this,r),pt(o))},t.restart=function(r,o){return this.play().totalTime(r?-this._delay:0,pt(o)),this._dur||(this._zTime=-Te),this},t.play=function(r,o){return r!=null&&this.seek(r,o),this.reversed(!1).paused(!1)},t.reverse=function(r,o){return r!=null&&this.seek(r||this.totalDuration(),o),this.reversed(!0).paused(!1)},t.pause=function(r,o){return r!=null&&this.seek(r,o),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(r){return arguments.length?(!!r!==this.reversed()&&this.timeScale(-this._rts||(r?-Te:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-Te,this},t.isActive=function(){var r=this.parent||this._dp,o=this._start,i;return!!(!r||this._ts&&this._initted&&r.isActive()&&(i=r.rawTime(!0))>=o&&i<this.endTime(!0)-Te)},t.eventCallback=function(r,o,i){var n=this.vars;return arguments.length>1?(o?(n[r]=o,i&&(n[r+"Params"]=i),r==="onUpdate"&&(this._onUpdate=o)):delete n[r],this):n[r]},t.then=function(r){var o=this,i=o._prom;return new Promise(function(n){var a=Ne(r)?r:ku,h=function(){var c=o.then;o.then=null,i&&i(),Ne(a)&&(a=a(o))&&(a.then||a===o)&&(o.then=c),n(a),o.then=c};o._initted&&o.totalProgress()===1&&o._ts>=0||!o._tTime&&o._ts<0?h():o._prom=h})},t.kill=function(){ii(this)},e})();yt(pi.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Te,_prom:0,_ps:!1,_rts:1});var tt=(function(e){mu(t,e);function t(r,o){var i;return r===void 0&&(r={}),i=e.call(this,r)||this,i.labels={},i.smoothChildTiming=!!r.smoothChildTiming,i.autoRemoveChildren=!!r.autoRemoveChildren,i._sort=pt(r.sortChildren),Le&&Vt(r.parent||Le,ss(i),o),r.reversed&&i.reverse(),r.paused&&i.paused(!0),r.scrollTrigger&&Tu(ss(i),r.scrollTrigger),i}var s=t.prototype;return s.to=function(o,i,n){return ai(0,arguments,this),this},s.from=function(o,i,n){return ai(1,arguments,this),this},s.fromTo=function(o,i,n,a){return ai(2,arguments,this),this},s.set=function(o,i,n){return i.duration=0,i.parent=this,oi(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new Ue(o,i,Dt(this,n),1),this},s.call=function(o,i,n){return Vt(this,Ue.delayedCall(0,o,i),n)},s.staggerTo=function(o,i,n,a,h,l,c){return n.duration=i,n.stagger=n.stagger||a,n.onComplete=l,n.onCompleteParams=c,n.parent=this,new Ue(o,n,Dt(this,h)),this},s.staggerFrom=function(o,i,n,a,h,l,c){return n.runBackwards=1,oi(n).immediateRender=pt(n.immediateRender),this.staggerTo(o,i,n,a,h,l,c)},s.staggerFromTo=function(o,i,n,a,h,l,c,f){return a.startAt=n,oi(a).immediateRender=pt(a.immediateRender),this.staggerTo(o,i,a,h,l,c,f)},s.render=function(o,i,n){var a=this._time,h=this._dirty?this.totalDuration():this._tDur,l=this._dur,c=o<=0?0:Ie(o),f=this._zTime<0!=o<0&&(this._initted||!l),v,g,u,d,m,p,b,x,y,S,_,w;if(this!==Le&&c>h&&o>=0&&(c=h),c!==this._tTime||n||f){if(a!==this._time&&l&&(c+=this._time-a,o+=this._time-a),v=c,y=this._start,x=this._ts,p=!x,f&&(l||(a=this._zTime),(o||!i)&&(this._zTime=o)),this._repeat){if(_=this._yoyo,m=l+this._rDelay,this._repeat<-1&&o<0)return this.totalTime(m*100+o,i,n);if(v=Ie(c%m),c===h?(d=this._repeat,v=l):(S=Ie(c/m),d=~~S,d&&d===S&&(v=l,d--),v>l&&(v=l)),S=wr(this._tTime,m),!a&&this._tTime&&S!==d&&this._tTime-S*m-this._dur<=0&&(S=d),_&&d&1&&(v=l-v,w=1),d!==S&&!this._lock){var C=_&&S&1,P=C===(_&&d&1);if(d<S&&(C=!C),a=C?0:c%l?l:c,this._lock=1,this.render(a||(w?0:Ie(d*m)),i,!l)._lock=0,this._tTime=c,!i&&this.parent&&_t(this,"onRepeat"),this.vars.repeatRefresh&&!w&&(this.invalidate()._lock=1,S=d),a&&a!==this._time||p!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(l=this._dur,h=this._tDur,P&&(this._lock=2,a=C?l:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!w&&this.invalidate()),this._lock=0,!this._ts&&!p)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(b=f_(this,Ie(a),Ie(v)),b&&(c-=v-(v=b._start))),this._tTime=c,this._time=v,this._act=!!x,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=o,a=0),!a&&c&&l&&!i&&!S&&(_t(this,"onStart"),this._tTime!==c))return this;if(v>=a&&o>=0)for(g=this._first;g;){if(u=g._next,(g._act||v>=g._start)&&g._ts&&b!==g){if(g.parent!==this)return this.render(o,i,n);if(g.render(g._ts>0?(v-g._start)*g._ts:(g._dirty?g.totalDuration():g._tDur)+(v-g._start)*g._ts,i,n),v!==this._time||!this._ts&&!p){b=0,u&&(c+=this._zTime=-Te);break}}g=u}else{g=this._last;for(var T=o<0?o:v;g;){if(u=g._prev,(g._act||T<=g._end)&&g._ts&&b!==g){if(g.parent!==this)return this.render(o,i,n);if(g.render(g._ts>0?(T-g._start)*g._ts:(g._dirty?g.totalDuration():g._tDur)+(T-g._start)*g._ts,i,n||Xe&&Za(g)),v!==this._time||!this._ts&&!p){b=0,u&&(c+=this._zTime=T?-Te:Te);break}}g=u}}if(b&&!i&&(this.pause(),b.render(v>=a?0:-Te)._zTime=v>=a?1:-1,this._ts))return this._start=y,Sn(this),this.render(o,i,n);this._onUpdate&&!i&&_t(this,"onUpdate",!0),(c===h&&this._tTime>=this.totalDuration()||!c&&a)&&(y===this._start||Math.abs(x)!==Math.abs(this._ts))&&(this._lock||((o||!l)&&(c===h&&this._ts>0||!c&&this._ts<0)&&xs(this,1),!i&&!(o<0&&!a)&&(c||a||!h)&&(_t(this,c===h&&o>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(c<h&&this.timeScale()>0)&&this._prom())))}return this},s.add=function(o,i){var n=this;if(is(i)||(i=Dt(this,i,o)),!(o instanceof pi)){if(st(o))return o.forEach(function(a){return n.add(a,i)}),this;if(qe(o))return this.addLabel(o,i);if(Ne(o))o=Ue.delayedCall(0,o);else return this}return this!==o?Vt(this,o,i):this},s.getChildren=function(o,i,n,a){o===void 0&&(o=!0),i===void 0&&(i=!0),n===void 0&&(n=!0),a===void 0&&(a=-Rt);for(var h=[],l=this._first;l;)l._start>=a&&(l instanceof Ue?i&&h.push(l):(n&&h.push(l),o&&h.push.apply(h,l.getChildren(!0,i,n)))),l=l._next;return h},s.getById=function(o){for(var i=this.getChildren(1,1,1),n=i.length;n--;)if(i[n].vars.id===o)return i[n]},s.remove=function(o){return qe(o)?this.removeLabel(o):Ne(o)?this.killTweensOf(o):(o.parent===this&&wn(this,o),o===this._recent&&(this._recent=this._last),Gs(this))},s.totalTime=function(o,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Ie(ut.time-(this._ts>0?o/this._ts:(this.totalDuration()-o)/-this._ts))),e.prototype.totalTime.call(this,o,i),this._forcing=0,this):this._tTime},s.addLabel=function(o,i){return this.labels[o]=Dt(this,i),this},s.removeLabel=function(o){return delete this.labels[o],this},s.addPause=function(o,i,n){var a=Ue.delayedCall(0,i||di,n);return a.data="isPause",this._hasPause=1,Vt(this,a,Dt(this,o))},s.removePause=function(o){var i=this._first;for(o=Dt(this,o);i;)i._start===o&&i.data==="isPause"&&xs(i),i=i._next},s.killTweensOf=function(o,i,n){for(var a=this.getTweensOf(o,n),h=a.length;h--;)vs!==a[h]&&a[h].kill(o,i);return this},s.getTweensOf=function(o,i){for(var n=[],a=At(o),h=this._first,l=is(i),c;h;)h instanceof Ue?a_(h._targets,a)&&(l?(!vs||h._initted&&h._ts)&&h.globalTime(0)<=i&&h.globalTime(h.totalDuration())>i:!i||h.isActive())&&n.push(h):(c=h.getTweensOf(a,i)).length&&n.push.apply(n,c),h=h._next;return n},s.tweenTo=function(o,i){i=i||{};var n=this,a=Dt(n,o),h=i,l=h.startAt,c=h.onStart,f=h.onStartParams,v=h.immediateRender,g,u=Ue.to(n,yt({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:i.duration||Math.abs((a-(l&&"time"in l?l.time:n._time))/n.timeScale())||Te,onStart:function(){if(n.pause(),!g){var m=i.duration||Math.abs((a-(l&&"time"in l?l.time:n._time))/n.timeScale());u._dur!==m&&Sr(u,m,0,1).render(u._time,!0,!0),g=1}c&&c.apply(u,f||[])}},i));return v?u.render(0):u},s.tweenFromTo=function(o,i,n){return this.tweenTo(i,yt({startAt:{time:Dt(this,o)}},n))},s.recent=function(){return this._recent},s.nextLabel=function(o){return o===void 0&&(o=this._time),uu(this,Dt(this,o))},s.previousLabel=function(o){return o===void 0&&(o=this._time),uu(this,Dt(this,o),1)},s.currentLabel=function(o){return arguments.length?this.seek(o,!0):this.previousLabel(this._time+Te)},s.shiftChildren=function(o,i,n){n===void 0&&(n=0);var a=this._first,h=this.labels,l;for(o=Ie(o);a;)a._start>=n&&(a._start+=o,a._end+=o),a=a._next;if(i)for(l in h)h[l]>=n&&(h[l]+=o);return Gs(this)},s.invalidate=function(o){var i=this._first;for(this._lock=0;i;)i.invalidate(o),i=i._next;return e.prototype.invalidate.call(this,o)},s.clear=function(o){o===void 0&&(o=!0);for(var i=this._first,n;i;)n=i._next,this.remove(i),i=n;return this._dp&&(this._time=this._tTime=this._pTime=0),o&&(this.labels={}),Gs(this)},s.totalDuration=function(o){var i=0,n=this,a=n._last,h=Rt,l,c,f;if(arguments.length)return n.timeScale((n._repeat<0?n.duration():n.totalDuration())/(n.reversed()?-o:o));if(n._dirty){for(f=n.parent;a;)l=a._prev,a._dirty&&a.totalDuration(),c=a._start,c>h&&n._sort&&a._ts&&!n._lock?(n._lock=1,Vt(n,a,c-a._delay,1)._lock=0):h=c,c<0&&a._ts&&(i-=c,(!f&&!n._dp||f&&f.smoothChildTiming)&&(n._start+=Ie(c/n._ts),n._time-=c,n._tTime-=c),n.shiftChildren(-c,!1,-1/0),h=0),a._end>i&&a._ts&&(i=a._end),a=l;Sr(n,n===Le&&n._time>i?n._time:i,1,1),n._dirty=0}return n._tDur},t.updateRoot=function(o){if(Le._ts&&(wu(Le,bn(o,Le)),yu=ut.frame),ut.frame>=lu){lu+=ft.autoSleep||120;var i=Le._first;if((!i||!i._ts)&&ft.autoSleep&&ut._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||ut.sleep()}}},t})(pi);yt(tt.prototype,{_lock:0,_hasPause:0,_forcing:0});var A_=function(t,s,r,o,i,n,a){var h=new ot(this._pt,t,s,0,1,ol,null,i),l=0,c=0,f,v,g,u,d,m,p,b;for(h.b=r,h.e=o,r+="",o+="",(p=~o.indexOf("random("))&&(o=Cr(o)),n&&(b=[r,o],n(b,t,s),r=b[0],o=b[1]),v=r.match(Ta)||[];f=Ta.exec(o);)u=f[0],d=o.substring(l,f.index),g?g=(g+1)%5:d.substr(-5)==="rgba("&&(g=1),u!==v[c++]&&(m=parseFloat(v[c-1])||0,h._pt={_next:h._pt,p:d||c===1?d:",",s:m,c:u.charAt(1)==="="?Qs(m,u)-m:parseFloat(u)-m,m:g&&g<4?Math.round:0},l=Ta.lastIndex);return h.c=l<o.length?o.substring(l,o.length):"",h.fp=a,(Ka.test(o)||p)&&(h.e=0),this._pt=h,h},sl=function(t,s,r,o,i,n,a,h,l,c){Ne(o)&&(o=o(i||0,t,n));var f=t[s],v=r!=="get"?r:Ne(f)?l?t[s.indexOf("set")||!Ne(t["get"+s.substr(3)])?s:"get"+s.substr(3)](l):t[s]():f,g=Ne(f)?l?F_:Vu:nl,u;if(qe(o)&&(~o.indexOf("random(")&&(o=Cr(o)),o.charAt(1)==="="&&(u=Qs(v,o)+(Je(v)||0),(u||u===0)&&(o=u))),!c||v!==o||Ua)return!isNaN(v*o)&&o!==""?(u=new ot(this._pt,t,s,+v||0,o-(v||0),typeof f=="boolean"?N_:ju,0,g),l&&(u.fp=l),a&&u.modifier(a,this,t),this._pt=u):(!f&&!(s in t)&&yn(s,o),A_.call(this,t,s,v,o,g,h||ft.stringFilter,l))},I_=function(t,s,r,o,i){if(Ne(t)&&(t=li(t,i,s,r,o)),!jt(t)||t.style&&t.nodeType||st(t)||vu(t))return qe(t)?li(t,i,s,r,o):t;var n={},a;for(a in t)n[a]=li(t[a],i,s,r,o);return n},rl=function(t,s,r,o,i,n){var a,h,l,c;if(dt[t]&&(a=new dt[t]).init(i,a.rawVars?s[t]:I_(s[t],o,i,n,r),r,o,n)!==!1&&(r._pt=h=new ot(r._pt,i,t,0,1,a.render,a,0,a.priority),r!==xr))for(l=r._ptLookup[r._targets.indexOf(i)],c=a._props.length;c--;)l[a._props[c]]=h;return a},vs,Ua,il=function e(t,s,r){var o=t.vars,i=o.ease,n=o.startAt,a=o.immediateRender,h=o.lazy,l=o.onUpdate,c=o.runBackwards,f=o.yoyoEase,v=o.keyframes,g=o.autoRevert,u=t._dur,d=t._startAt,m=t._targets,p=t.parent,b=p&&p.data==="nested"?p.vars.targets:m,x=t._overwrite==="auto"&&!ja,y=t.timeline,S=o.easeReverse||f,_,w,C,P,T,A,F,B,U,N,H,E,R;if(y&&(!v||!i)&&(i="none"),t._ease=Xs(i,hi.ease),t._rEase=S&&(Xs(S)||t._ease),t._from=!y&&!!o.runBackwards,t._from&&(t.ratio=1),!y||v&&!o.stagger){if(B=m[0]?_s(m[0]).harness:0,E=B&&o[B.prop],_=vn(o,Xa),d&&(d._zTime<0&&d.progress(1),s<0&&c&&a&&!g?d.render(-1,!0):d.revert(c&&u?un:n_),d._lazy=0),n){if(xs(t._startAt=Ue.set(m,yt({data:"isStart",overwrite:!1,parent:p,immediateRender:!0,lazy:!d&&pt(h),startAt:null,delay:0,onUpdate:l&&function(){return _t(t,"onUpdate")},stagger:0},n))),t._startAt._dp=0,t._startAt._sat=t,s<0&&(Xe||!a&&!g)&&t._startAt.revert(un),a&&u&&s<=0&&r<=0){s&&(t._zTime=s);return}}else if(c&&u&&!d){if(s&&(a=!1),C=yt({overwrite:!1,data:"isFromStart",lazy:a&&!d&&pt(h),immediateRender:a,stagger:0,parent:p},_),E&&(C[B.prop]=E),xs(t._startAt=Ue.set(m,C)),t._startAt._dp=0,t._startAt._sat=t,s<0&&(Xe?t._startAt.revert(un):t._startAt.render(-1,!0)),t._zTime=s,!a)e(t._startAt,Te,Te);else if(!s)return}for(t._pt=t._ptCache=0,h=u&&pt(h)||h&&!u,w=0;w<m.length;w++){if(T=m[w],F=T._gsap||Ya(m)[w]._gsap,t._ptLookup[w]=N={},Fa[F.id]&&bs.length&&gn(),H=b===m?w:b.indexOf(T),B&&(U=new B).init(T,E||_,t,H,b)!==!1&&(t._pt=P=new ot(t._pt,T,U.name,0,1,U.render,U,0,U.priority),U._props.forEach(function(L){N[L]=P}),U.priority&&(A=1)),!B||E)for(C in _)dt[C]&&(U=rl(C,_,t,H,T,b))?U.priority&&(A=1):N[C]=P=sl.call(t,T,C,"get",_[C],H,b,0,o.stringFilter);t._op&&t._op[w]&&t.kill(T,t._op[w]),x&&t._pt&&(vs=t,Le.killTweensOf(T,N,t.globalTime(s)),R=!t.parent,vs=0),t._pt&&h&&(Fa[F.id]=1)}A&&ll(t),t._onInit&&t._onInit(t)}t._onUpdate=l,t._initted=(!t._op||t._pt)&&!R,v&&s<=0&&y.render(Rt,!0,!0)},L_=function(t,s,r,o,i,n,a,h){var l=(t._pt&&t._ptCache||(t._ptCache={}))[s],c,f,v,g;if(!l)for(l=t._ptCache[s]=[],v=t._ptLookup,g=t._targets.length;g--;){if(c=v[g][s],c&&c.d&&c.d._pt)for(c=c.d._pt;c&&c.p!==s&&c.fp!==s;)c=c._next;if(!c)return Ua=1,t.vars[s]="+=0",il(t,a),Ua=0,h?ci(s+" not eligible for reset. Try splitting into individual properties"):1;l.push(c)}for(g=l.length;g--;)f=l[g],c=f._pt||f,c.s=(o||o===0)&&!i?o:c.s+(o||0)+n*c.c,c.c=r-c.s,f.e&&(f.e=ze(r)+Je(f.e)),f.b&&(f.b=c.s+Je(f.b))},O_=function(t,s){var r=t[0]?_s(t[0]).harness:0,o=r&&r.aliases,i,n,a,h;if(!o)return s;i=yr({},s);for(n in o)if(n in i)for(h=o[n].split(","),a=h.length;a--;)i[h[a]]=i[n];return i},M_=function(t,s,r,o){var i=s.ease||o||"power1.inOut",n,a;if(st(s))a=r[t]||(r[t]=[]),s.forEach(function(h,l){return a.push({t:l/(s.length-1)*100,v:h,e:i})});else for(n in s)a=r[n]||(r[n]=[]),n==="ease"||a.push({t:parseFloat(t),v:s[n],e:i})},li=function(t,s,r,o,i){return Ne(t)?t.call(s,r,o,i):qe(t)&&~t.indexOf("random(")?Cr(t):t},$u=Ja+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",Uu={};nt($u+",id,stagger,delay,duration,paused,scrollTrigger",function(e){return Uu[e]=1});var Ue=(function(e){mu(t,e);function t(r,o,i,n){var a;typeof o=="number"&&(i.duration=o,o=i,i=null),a=e.call(this,n?o:oi(o))||this;var h=a.vars,l=h.duration,c=h.delay,f=h.immediateRender,v=h.stagger,g=h.overwrite,u=h.keyframes,d=h.defaults,m=h.scrollTrigger,p=o.parent||Le,b=(st(r)||vu(r)?is(r[0]):"length"in o)?[r]:At(r),x,y,S,_,w,C,P,T;if(a._targets=b.length?Ya(b):ci("GSAP target "+r+" not found. https://gsap.com",!ft.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=g,u||v||dn(l)||dn(c)){o=a.vars;var A=o.easeReverse||o.yoyoEase;if(x=a.timeline=new tt({data:"nested",defaults:d||{},targets:p&&p.data==="nested"?p.vars.targets:b}),x.kill(),x.parent=x._dp=ss(a),x._start=0,v||dn(l)||dn(c)){if(_=b.length,P=v&&Au(v),jt(v))for(w in v)~$u.indexOf(w)&&(T||(T={}),T[w]=v[w]);for(y=0;y<_;y++)S=vn(o,Uu),S.stagger=0,A&&(S.easeReverse=A),T&&yr(S,T),C=b[y],S.duration=+li(l,ss(a),y,C,b),S.delay=(+li(c,ss(a),y,C,b)||0)-a._delay,!v&&_===1&&S.delay&&(a._delay=c=S.delay,a._start+=c,S.delay=0),x.to(C,S,P?P(y,C,b):0),x._ease=we.none;x.duration()?l=c=0:a.timeline=0}else if(u){oi(yt(x.vars.defaults,{ease:"none"})),x._ease=Xs(u.ease||o.ease||"none");var F=0,B,U,N;if(st(u))u.forEach(function(H){return x.to(b,H,">")}),x.duration();else{S={};for(w in u)w==="ease"||w==="easeEach"||M_(w,u[w],S,u.easeEach);for(w in S)for(B=S[w].sort(function(H,E){return H.t-E.t}),F=0,y=0;y<B.length;y++)U=B[y],N={ease:U.e,duration:(U.t-(y?B[y-1].t:0))/100*l},N[w]=U.v,x.to(b,N,F),F+=N.duration;x.duration()<l&&x.to({},{duration:l-x.duration()})}}l||a.duration(l=x.duration())}else a.timeline=0;return g===!0&&!ja&&(vs=ss(a),Le.killTweensOf(b),vs=0),Vt(p,ss(a),i),o.reversed&&a.reverse(),o.paused&&a.paused(!0),(f||!l&&!u&&a._start===Ie(p._time)&&pt(f)&&d_(ss(a))&&p.data!=="nested")&&(a._tTime=-Te,a.render(Math.max(0,-c)||0)),m&&Tu(ss(a),m),a}var s=t.prototype;return s.render=function(o,i,n){var a=this._time,h=this._tDur,l=this._dur,c=o<0,f=o>h-Te&&!c?h:o<Te?0:o,v,g,u,d,m,p,b,x;if(!l)p_(this,o,i,n);else if(f!==this._tTime||!o||n||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==c||this._lazy){if(v=f,x=this.timeline,this._repeat){if(d=l+this._rDelay,this._repeat<-1&&c)return this.totalTime(d*100+o,i,n);if(v=Ie(f%d),f===h?(u=this._repeat,v=l):(m=Ie(f/d),u=~~m,u&&u===m?(v=l,u--):v>l&&(v=l)),p=this._yoyo&&u&1,p&&(v=l-v),m=wr(this._tTime,d),v===a&&!n&&this._initted&&u===m)return this._tTime=f,this;u!==m&&this.vars.repeatRefresh&&!p&&!this._lock&&v!==d&&this._initted&&(this._lock=n=1,this.render(Ie(d*u),!0).invalidate()._lock=0)}if(!this._initted){if(Pu(this,c?o:v,n,i,f))return this._tTime=0,this;if(a!==this._time&&!(n&&this.vars.repeatRefresh&&u!==m))return this;if(l!==this._dur)return this.render(o,i,n)}if(this._rEase){var y=v<a;if(y!==this._inv){var S=y?a:l-a;this._inv=y,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=a,this._invRecip=S?(y?-1:1)/S:0,this._invScale=y?-this.ratio:1-this.ratio,this._invEase=y?this._rEase:this._ease}this.ratio=b=this._invRatio+this._invScale*this._invEase((v-this._invTime)*this._invRecip)}else this.ratio=b=this._ease(v/l);if(this._from&&(this.ratio=b=1-b),this._tTime=f,this._time=v,!this._act&&this._ts&&(this._act=1,this._lazy=0),!a&&f&&!i&&!m&&(_t(this,"onStart"),this._tTime!==f))return this;for(g=this._pt;g;)g.r(b,g.d),g=g._next;x&&x.render(o<0?o:x._dur*x._ease(v/this._dur),i,n)||this._startAt&&(this._zTime=o),this._onUpdate&&!i&&(c&&Ba(this,o,i,n),_t(this,"onUpdate")),this._repeat&&u!==m&&this.vars.onRepeat&&!i&&this.parent&&_t(this,"onRepeat"),(f===this._tDur||!f)&&this._tTime===f&&(c&&!this._onUpdate&&Ba(this,o,!0,!0),(o||!l)&&(f===this._tDur&&this._ts>0||!f&&this._ts<0)&&xs(this,1),!i&&!(c&&!a)&&(f||a||p)&&(_t(this,f===h?"onComplete":"onReverseComplete",!0),this._prom&&!(f<h&&this.timeScale()>0)&&this._prom()))}return this},s.targets=function(){return this._targets},s.invalidate=function(o){return(!o||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(o),e.prototype.invalidate.call(this,o)},s.resetTo=function(o,i,n,a,h){ui||ut.wake(),this._ts||this.play();var l=Math.min(this._dur,(this._dp._time-this._start)*this._ts),c;return this._initted||il(this,l),c=this._ease(l/this._dur),L_(this,o,i,n,a,c,l,h)?this.resetTo(o,i,n,a,1):(kn(this,0),this.parent||Cu(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},s.kill=function(o,i){if(i===void 0&&(i="all"),!o&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?ii(this):this.scrollTrigger&&this.scrollTrigger.kill(!!Xe),this;if(this.timeline){var n=this.timeline.totalDuration();return this.timeline.killTweensOf(o,i,vs&&vs.vars.overwrite!==!0)._first||ii(this),this.parent&&n!==this.timeline.totalDuration()&&Sr(this,this._dur*this.timeline._tDur/n,0,1),this}var a=this._targets,h=o?At(o):a,l=this._ptLookup,c=this._pt,f,v,g,u,d,m,p;if((!i||i==="all")&&h_(a,h))return i==="all"&&(this._pt=0),ii(this);for(f=this._op=this._op||[],i!=="all"&&(qe(i)&&(d={},nt(i,function(b){return d[b]=1}),i=d),i=O_(a,i)),p=a.length;p--;)if(~h.indexOf(a[p])){v=l[p],i==="all"?(f[p]=i,u=v,g={}):(g=f[p]=f[p]||{},u=i);for(d in u)m=v&&v[d],m&&((!("kill"in m.d)||m.d.kill(d)===!0)&&wn(this,m,"_pt"),delete v[d]),g!=="all"&&(g[d]=1)}return this._initted&&!this._pt&&c&&ii(this),this},t.to=function(o,i){return new t(o,i,arguments[2])},t.from=function(o,i){return ai(1,arguments)},t.delayedCall=function(o,i,n,a){return new t(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:o,onComplete:i,onReverseComplete:i,onCompleteParams:n,onReverseCompleteParams:n,callbackScope:a})},t.fromTo=function(o,i,n){return ai(2,arguments)},t.set=function(o,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new t(o,i)},t.killTweensOf=function(o,i,n){return Le.killTweensOf(o,i,n)},t})(pi);yt(Ue.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});nt("staggerTo,staggerFrom,staggerFromTo",function(e){Ue[e]=function(){var t=new tt,s=za.call(arguments,0);return s.splice(e==="staggerFromTo"?5:4,0,0),t[e].apply(t,s)}});var nl=function(t,s,r){return t[s]=r},Vu=function(t,s,r){return t[s](r)},F_=function(t,s,r,o){return t[s](o.fp,r)},B_=function(t,s,r){return t.setAttribute(s,r)},Cn=function(t,s){return Ne(t[s])?Vu:xn(t[s])&&t.setAttribute?B_:nl},ju=function(t,s){return s.set(s.t,s.p,Math.round((s.s+s.c*t)*1e6)/1e6,s)},N_=function(t,s){return s.set(s.t,s.p,!!(s.s+s.c*t),s)},ol=function(t,s){var r=s._pt,o="";if(!t&&s.b)o=s.b;else if(t===1&&s.e)o=s.e;else{for(;r;)o=r.p+(r.m?r.m(r.s+r.c*t):Math.round((r.s+r.c*t)*1e4)/1e4)+o,r=r._next;o+=s.c}s.set(s.t,s.p,o,s)},al=function(t,s){for(var r=s._pt;r;)r.r(t,r.d),r=r._next},z_=function(t,s,r,o){for(var i=this._pt,n;i;)n=i._next,i.p===o&&i.modifier(t,s,r),i=n},H_=function(t){for(var s=this._pt,r,o;s;)o=s._next,s.p===t&&!s.op||s.op===t?wn(this,s,"_pt"):s.dep||(r=1),s=o;return!r},$_=function(t,s,r,o){o.mSet(t,s,o.m.call(o.tween,r,o.mt),o)},ll=function(t){for(var s=t._pt,r,o,i,n;s;){for(r=s._next,o=i;o&&o.pr>s.pr;)o=o._next;(s._prev=o?o._prev:n)?s._prev._next=s:i=s,(s._next=o)?o._prev=s:n=s,s=r}t._pt=i},ot=(function(){function e(s,r,o,i,n,a,h,l,c){this.t=r,this.s=i,this.c=n,this.p=o,this.r=a||ju,this.d=h||this,this.set=l||nl,this.pr=c||0,this._next=s,s&&(s._prev=this)}var t=e.prototype;return t.modifier=function(r,o,i){this.mSet=this.mSet||this.set,this.set=$_,this.m=r,this.mt=i,this.tween=o},e})();nt(Ja+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse",function(e){return Xa[e]=1});xt.TweenMax=xt.TweenLite=Ue;xt.TimelineLite=xt.TimelineMax=tt;Le=new tt({sortChildren:!1,defaults:hi,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});ft.stringFilter=el;var Js=[],fn={},U_=[],fu=0,V_=0,Ia=function(t){return(fn[t]||U_).map(function(s){return s()})},Va=function(){var t=Date.now(),s=[];t-fu>2&&(Ia("matchMediaInit"),Js.forEach(function(r){var o=r.queries,i=r.conditions,n,a,h,l;for(a in o)n=Ut.matchMedia(o[a]).matches,n&&(h=1),n!==i[a]&&(i[a]=n,l=1);l&&(r.revert(),h&&s.push(r))}),Ia("matchMediaRevert"),s.forEach(function(r){return r.onMatch(r,function(o){return r.add(null,o)})}),fu=t,Ia("matchMedia"))},Wu=(function(){function e(s,r){this.selector=r&&Ha(r),this.data=[],this._r=[],this.isReverted=!1,this.id=V_++,s&&this.add(s)}var t=e.prototype;return t.add=function(r,o,i){Ne(r)&&(i=o,o=r,r=Ne);var n=this,a=function(){var l=Ae,c=n.selector,f;return l&&l!==n&&l.data.push(n),i&&(n.selector=Ha(i)),Ae=n,f=o.apply(n,arguments),Ne(f)&&n._r.push(f),Ae=l,n.selector=c,n.isReverted=!1,f};return n.last=a,r===Ne?a(n,function(h){return n.add(null,h)}):r?n[r]=a:a},t.ignore=function(r){var o=Ae;Ae=null,r(this),Ae=o},t.getTweens=function(){var r=[];return this.data.forEach(function(o){return o instanceof e?r.push.apply(r,o.getTweens()):o instanceof Ue&&!(o.parent&&o.parent.data==="nested")&&r.push(o)}),r},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(r,o){var i=this;if(r?(function(){for(var a=i.getTweens(),h=i.data.length,l;h--;)l=i.data[h],l.data==="isFlip"&&(l.revert(),l.getChildren(!0,!0,!1).forEach(function(c){return a.splice(a.indexOf(c),1)}));for(a.map(function(c){return{g:c._dur||c._delay||c._sat&&!c._sat.vars.immediateRender?c.globalTime(0):-1/0,t:c}}).sort(function(c,f){return f.g-c.g||-1/0}).forEach(function(c){return c.t.revert(r)}),h=i.data.length;h--;)l=i.data[h],l instanceof tt?l.data!=="nested"&&(l.scrollTrigger&&l.scrollTrigger.revert(),l.kill()):!(l instanceof Ue)&&l.revert&&l.revert(r);i._r.forEach(function(c){return c(r,i)}),i.isReverted=!0})():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),o)for(var n=Js.length;n--;)Js[n].id===this.id&&Js.splice(n,1)},t.revert=function(r){this.kill(r||{})},e})(),j_=(function(){function e(s){this.contexts=[],this.scope=s,Ae&&Ae.data.push(this)}var t=e.prototype;return t.add=function(r,o,i){jt(r)||(r={matches:r});var n=new Wu(0,i||this.scope),a=n.conditions={},h,l,c;Ae&&!n.selector&&(n.selector=Ae.selector),this.contexts.push(n),o=n.add("onMatch",o),n.queries=r;for(l in r)l==="all"?c=1:(h=Ut.matchMedia(r[l]),h&&(Js.indexOf(n)<0&&Js.push(n),(a[l]=h.matches)&&(c=1),h.addListener?h.addListener(Va):h.addEventListener("change",Va)));return c&&o(n,function(f){return n.add(null,f)}),this},t.revert=function(r){this.kill(r||{})},t.kill=function(r){this.contexts.forEach(function(o){return o.kill(r,!0)})},e})(),_n={registerPlugin:function(){for(var t=arguments.length,s=new Array(t),r=0;r<t;r++)s[r]=arguments[r];s.forEach(function(o){return Bu(o)})},timeline:function(t){return new tt(t)},getTweensOf:function(t,s){return Le.getTweensOf(t,s)},getProperty:function(t,s,r,o){qe(t)&&(t=At(t)[0]);var i=_s(t||{}).get,n=r?ku:Su;return r==="native"&&(r=""),t&&(s?n((dt[s]&&dt[s].get||i)(t,s,r,o)):function(a,h,l){return n((dt[a]&&dt[a].get||i)(t,a,h,l))})},quickSetter:function(t,s,r){if(t=At(t),t.length>1){var o=t.map(function(c){return rt.quickSetter(c,s,r)}),i=o.length;return function(c){for(var f=i;f--;)o[f](c)}}t=t[0]||{};var n=dt[s],a=_s(t),h=a.harness&&(a.harness.aliases||{})[s]||s,l=n?function(c){var f=new n;xr._pt=0,f.init(t,r?c+r:c,xr,0,[t]),f.render(1,f),xr._pt&&al(1,xr)}:a.set(t,h);return n?l:function(c){return l(t,h,r?c+r:c,a,1)}},quickTo:function(t,s,r){var o,i=rt.to(t,yt((o={},o[s]="+=0.1",o.paused=!0,o.stagger=0,o),r||{})),n=function(h,l,c){return i.resetTo(s,h,l,c)};return n.tween=i,n},isTweening:function(t){return Le.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=Xs(t.ease,hi.ease)),hu(hi,t||{})},config:function(t){return hu(ft,t||{})},registerEffect:function(t){var s=t.name,r=t.effect,o=t.plugins,i=t.defaults,n=t.extendTimeline;(o||"").split(",").forEach(function(a){return a&&!dt[a]&&!xt[a]&&ci(s+" effect requires "+a+" plugin.")}),Pa[s]=function(a,h,l){return r(At(a),yt(h||{},i),l)},n&&(tt.prototype[s]=function(a,h,l){return this.add(Pa[s](a,jt(h)?h:(l=h)&&{},this),l)})},registerEase:function(t,s){we[t]=Xs(s)},parseEase:function(t,s){return arguments.length?Xs(t,s):we},getById:function(t){return Le.getById(t)},exportRoot:function(t,s){t===void 0&&(t={});var r=new tt(t),o,i;for(r.smoothChildTiming=pt(t.smoothChildTiming),Le.remove(r),r._dp=0,r._time=r._tTime=Le._time,o=Le._first;o;)i=o._next,(s||!(!o._dur&&o instanceof Ue&&o.vars.onComplete===o._targets[0]))&&Vt(r,o,o._start-o._delay),o=i;return Vt(Le,r,0),r},context:function(t,s){return t?new Wu(t,s):Ae},matchMedia:function(t){return new j_(t)},matchMediaRefresh:function(){return Js.forEach(function(t){var s=t.conditions,r,o;for(o in s)s[o]&&(s[o]=!1,r=1);r&&t.revert()})||Va()},addEventListener:function(t,s){var r=fn[t]||(fn[t]=[]);~r.indexOf(s)||r.push(s)},removeEventListener:function(t,s){var r=fn[t],o=r&&r.indexOf(s);o>=0&&r.splice(o,1)},utils:{wrap:y_,wrapYoyo:w_,distribute:Au,random:Lu,snap:Iu,normalize:x_,getUnit:Je,clamp:g_,splitColor:Nu,toArray:At,selector:Ha,mapRange:Mu,pipe:b_,unitize:__,interpolate:S_,shuffle:Ru},install:_u,effects:Pa,ticker:ut,updateRoot:tt.updateRoot,plugins:dt,globalTimeline:Le,core:{PropTween:ot,globals:xu,Tween:Ue,Timeline:tt,Animation:pi,getCache:_s,_removeLinkedListItem:wn,reverting:function(){return Xe},context:function(t){return t&&Ae&&(Ae.data.push(t),t._ctx=Ae),Ae},suppressOverwrites:function(t){return ja=t}}};nt("to,from,fromTo,delayedCall,set,killTweensOf",function(e){return _n[e]=Ue[e]});ut.add(tt.updateRoot);xr=_n.to({},{duration:0});var W_=function(t,s){for(var r=t._pt;r&&r.p!==s&&r.op!==s&&r.fp!==s;)r=r._next;return r},q_=function(t,s){var r=t._targets,o,i,n;for(o in s)for(i=r.length;i--;)n=t._ptLookup[i][o],n&&(n=n.d)&&(n._pt&&(n=W_(n,o)),n&&n.modifier&&n.modifier(s[o],t,r[i],o))},La=function(t,s){return{name:t,headless:1,rawVars:1,init:function(o,i,n){n._onInit=function(a){var h,l;if(qe(i)&&(h={},nt(i,function(c){return h[c]=1}),i=h),s){h={};for(l in i)h[l]=s(i[l]);i=h}q_(a,i)}}}},rt=_n.registerPlugin({name:"attr",init:function(t,s,r,o,i){var n,a,h;this.tween=r;for(n in s)h=t.getAttribute(n)||"",a=this.add(t,"setAttribute",(h||0)+"",s[n],o,i,0,0,n),a.op=n,a.b=h,this._props.push(n)},render:function(t,s){for(var r=s._pt;r;)Xe?r.set(r.t,r.p,r.b,r):r.r(t,r.d),r=r._next}},{name:"endArray",headless:1,init:function(t,s){for(var r=s.length;r--;)this.add(t,r,t[r]||0,s[r],0,0,0,0,0,1)}},La("roundProps",$a),La("modifiers"),La("snap",Iu))||_n;Ue.version=tt.version=rt.version="3.15.0";bu=1;Wa()&&kr();var K_=we.Power0,G_=we.Power1,X_=we.Power2,J_=we.Power3,Y_=we.Power4,Q_=we.Linear,Z_=we.Quad,e0=we.Cubic,t0=we.Quart,s0=we.Quint,r0=we.Strong,i0=we.Elastic,n0=we.Back,o0=we.SteppedEase,a0=we.Bounce,l0=we.Sine,h0=we.Expo,c0=we.Circ;var qu,ws,Tr,fl,rr,d0,Ku,ml,u0=function(){return typeof window<"u"},os={},sr=180/Math.PI,Pr=Math.PI/180,Er=Math.atan2,Gu=1e8,gl=/([A-Z])/g,p0=/(left|right|width|margin|padding|x)/i,f0=/[\s,\(]\S/,Wt={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},cl=function(t,s){return s.set(s.t,s.p,Math.round((s.s+s.c*t)*1e4)/1e4+s.u,s)},m0=function(t,s){return s.set(s.t,s.p,t===1?s.e:Math.round((s.s+s.c*t)*1e4)/1e4+s.u,s)},g0=function(t,s){return s.set(s.t,s.p,t?Math.round((s.s+s.c*t)*1e4)/1e4+s.u:s.b,s)},v0=function(t,s){return s.set(s.t,s.p,t===1?s.e:t?Math.round((s.s+s.c*t)*1e4)/1e4+s.u:s.b,s)},b0=function(t,s){var r=s.s+s.c*t;s.set(s.t,s.p,~~(r+(r<0?-.5:.5))+s.u,s)},sp=function(t,s){return s.set(s.t,s.p,t?s.e:s.b,s)},rp=function(t,s){return s.set(s.t,s.p,t!==1?s.b:s.e,s)},_0=function(t,s,r){return t.style[s]=r},x0=function(t,s,r){return t.style.setProperty(s,r)},y0=function(t,s,r){return t._gsap[s]=r},w0=function(t,s,r){return t._gsap.scaleX=t._gsap.scaleY=r},S0=function(t,s,r,o,i){var n=t._gsap;n.scaleX=n.scaleY=r,n.renderTransform(i,n)},k0=function(t,s,r,o,i){var n=t._gsap;n[s]=r,n.renderTransform(i,n)},Oe="transform",mt=Oe+"Origin",C0=function e(t,s){var r=this,o=this.target,i=o.style,n=o._gsap;if(t in os&&i){if(this.tfm=this.tfm||{},t!=="transform")t=Wt[t]||t,~t.indexOf(",")?t.split(",").forEach(function(a){return r.tfm[a]=ns(o,a)}):this.tfm[t]=n.x?n[t]:ns(o,t),t===mt&&(this.tfm.zOrigin=n.zOrigin);else return Wt.transform.split(",").forEach(function(a){return e.call(r,a,s)});if(this.props.indexOf(Oe)>=0)return;n.svg&&(this.svgo=o.getAttribute("data-svg-origin"),this.props.push(mt,s,"")),t=Oe}(i||s)&&this.props.push(t,s,i[t])},ip=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},E0=function(){var t=this.props,s=this.target,r=s.style,o=s._gsap,i,n;for(i=0;i<t.length;i+=3)t[i+1]?t[i+1]===2?s[t[i]](t[i+2]):s[t[i]]=t[i+2]:t[i+2]?r[t[i]]=t[i+2]:r.removeProperty(t[i].substr(0,2)==="--"?t[i]:t[i].replace(gl,"-$1").toLowerCase());if(this.tfm){for(n in this.tfm)o[n]=this.tfm[n];o.svg&&(o.renderTransform(),s.setAttribute("data-svg-origin",this.svgo||"")),i=ml(),(!i||!i.isStart)&&!r[Oe]&&(ip(r),o.zOrigin&&r[mt]&&(r[mt]+=" "+o.zOrigin+"px",o.zOrigin=0,o.renderTransform()),o.uncache=1)}},np=function(t,s){var r={target:t,props:[],revert:E0,save:C0};return t._gsap||rt.core.getCache(t),s&&t.style&&t.nodeType&&s.split(",").forEach(function(o){return r.save(o)}),r},op,dl=function(t,s){var r=ws.createElementNS?ws.createElementNS((s||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):ws.createElement(t);return r&&r.style?r:ws.createElement(t)},wt=function e(t,s,r){var o=getComputedStyle(t);return o[s]||o.getPropertyValue(s.replace(gl,"-$1").toLowerCase())||o.getPropertyValue(s)||!r&&e(t,Dr(s)||s,1)||""},Xu="O,Moz,ms,Ms,Webkit".split(","),Dr=function(t,s,r){var o=s||rr,i=o.style,n=5;if(t in i&&!r)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);n--&&!(Xu[n]+t in i););return n<0?null:(n===3?"ms":n>=0?Xu[n]:"")+t},ul=function(){u0()&&window.document&&(qu=window,ws=qu.document,Tr=ws.documentElement,rr=dl("div")||{style:{}},d0=dl("div"),Oe=Dr(Oe),mt=Oe+"Origin",rr.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",op=!!Dr("perspective"),ml=rt.core.reverting,fl=1)},Ju=function(t){var s=t.ownerSVGElement,r=dl("svg",s&&s.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),o=t.cloneNode(!0),i;o.style.display="block",r.appendChild(o),Tr.appendChild(r);try{i=o.getBBox()}catch{}return r.removeChild(o),Tr.removeChild(r),i},Yu=function(t,s){for(var r=s.length;r--;)if(t.hasAttribute(s[r]))return t.getAttribute(s[r])},ap=function(t){var s,r;try{s=t.getBBox()}catch{s=Ju(t),r=1}return s&&(s.width||s.height)||r||(s=Ju(t)),s&&!s.width&&!s.x&&!s.y?{x:+Yu(t,["x","cx","x1"])||0,y:+Yu(t,["y","cy","y1"])||0,width:0,height:0}:s},lp=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&ap(t))},ks=function(t,s){if(s){var r=t.style,o;s in os&&s!==mt&&(s=Oe),r.removeProperty?(o=s.substr(0,2),(o==="ms"||s.substr(0,6)==="webkit")&&(s="-"+s),r.removeProperty(o==="--"?s:s.replace(gl,"-$1").toLowerCase())):r.removeAttribute(s)}},Ss=function(t,s,r,o,i,n){var a=new ot(t._pt,s,r,0,1,n?rp:sp);return t._pt=a,a.b=o,a.e=i,t._props.push(r),a},Qu={deg:1,rad:1,turn:1},T0={grid:1,flex:1},Cs=function e(t,s,r,o){var i=parseFloat(r)||0,n=(r+"").trim().substr((i+"").length)||"px",a=rr.style,h=p0.test(s),l=t.tagName.toLowerCase()==="svg",c=(l?"client":"offset")+(h?"Width":"Height"),f=100,v=o==="px",g=o==="%",u,d,m,p;if(o===n||!i||Qu[o]||Qu[n])return i;if(n!=="px"&&!v&&(i=e(t,s,r,"px")),p=t.getCTM&&lp(t),(g||n==="%")&&(os[s]||~s.indexOf("adius")))return u=p?t.getBBox()[h?"width":"height"]:t[c],ze(g?i/u*f:i/100*u);if(a[h?"width":"height"]=f+(v?n:o),d=o!=="rem"&&~s.indexOf("adius")||o==="em"&&t.appendChild&&!l?t:t.parentNode,p&&(d=(t.ownerSVGElement||{}).parentNode),(!d||d===ws||!d.appendChild)&&(d=ws.body),m=d._gsap,m&&g&&m.width&&h&&m.time===ut.time&&!m.uncache)return ze(i/m.width*f);if(g&&(s==="height"||s==="width")){var b=t.style[s];t.style[s]=f+o,u=t[c],b?t.style[s]=b:ks(t,s)}else(g||n==="%")&&!T0[wt(d,"display")]&&(a.position=wt(t,"position")),d===t&&(a.position="static"),d.appendChild(rr),u=rr[c],d.removeChild(rr),a.position="absolute";return h&&g&&(m=_s(d),m.time=ut.time,m.width=d[c]),ze(v?u*i/f:u&&i?f/u*i:0)},ns=function(t,s,r,o){var i;return fl||ul(),s in Wt&&s!=="transform"&&(s=Wt[s],~s.indexOf(",")&&(s=s.split(",")[0])),os[s]&&s!=="transform"?(i=vi(t,o),i=s!=="transformOrigin"?i[s]:i.svg?i.origin:Tn(wt(t,mt))+" "+i.zOrigin+"px"):(i=t.style[s],(!i||i==="auto"||o||~(i+"").indexOf("calc("))&&(i=En[s]&&En[s](t,s,r)||wt(t,s)||Qa(t,s)||(s==="opacity"?1:0))),r&&!~(i+"").trim().indexOf(" ")?Cs(t,s,i,r)+r:i},P0=function(t,s,r,o){if(!r||r==="none"){var i=Dr(s,t,1),n=i&&wt(t,i,1);n&&n!==r?(s=i,r=n):s==="borderColor"&&(r=wt(t,"borderTopColor"))}var a=new ot(this._pt,t.style,s,0,1,ol),h=0,l=0,c,f,v,g,u,d,m,p,b,x,y,S;if(a.b=r,a.e=o,r+="",o+="",o.substring(0,6)==="var(--"&&(o=wt(t,o.substring(4,o.indexOf(")")))),o==="auto"&&(d=t.style[s],t.style[s]=o,o=wt(t,s)||o,d?t.style[s]=d:ks(t,s)),c=[r,o],el(c),r=c[0],o=c[1],v=r.match(Ys)||[],S=o.match(Ys)||[],S.length){for(;f=Ys.exec(o);)m=f[0],b=o.substring(h,f.index),u?u=(u+1)%5:(b.substr(-5)==="rgba("||b.substr(-5)==="hsla(")&&(u=1),m!==(d=v[l++]||"")&&(g=parseFloat(d)||0,y=d.substr((g+"").length),m.charAt(1)==="="&&(m=Qs(g,m)+y),p=parseFloat(m),x=m.substr((p+"").length),h=Ys.lastIndex-x.length,x||(x=x||ft.units[s]||y,h===o.length&&(o+=x,a.e+=x)),y!==x&&(g=Cs(t,s,d,x)||0),a._pt={_next:a._pt,p:b||l===1?b:",",s:g,c:p-g,m:u&&u<4||s==="zIndex"?Math.round:0});a.c=h<o.length?o.substring(h,o.length):""}else a.r=s==="display"&&o==="none"?rp:sp;return Ka.test(o)&&(a.e=0),this._pt=a,a},Zu={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},D0=function(t){var s=t.split(" "),r=s[0],o=s[1]||"50%";return(r==="top"||r==="bottom"||o==="left"||o==="right")&&(t=r,r=o,o=t),s[0]=Zu[r]||r,s[1]=Zu[o]||o,s.join(" ")},R0=function(t,s){if(s.tween&&s.tween._time===s.tween._dur){var r=s.t,o=r.style,i=s.u,n=r._gsap,a,h,l;if(i==="all"||i===!0)o.cssText="",h=1;else for(i=i.split(","),l=i.length;--l>-1;)a=i[l],os[a]&&(h=1,a=a==="transformOrigin"?mt:Oe),ks(r,a);h&&(ks(r,Oe),n&&(n.svg&&r.removeAttribute("transform"),o.scale=o.rotate=o.translate="none",vi(r,1),n.uncache=1,ip(o)))}},En={clearProps:function(t,s,r,o,i){if(i.data!=="isFromStart"){var n=t._pt=new ot(t._pt,s,r,0,0,R0);return n.u=o,n.pr=-10,n.tween=i,t._props.push(r),1}}},gi=[1,0,0,1,0,0],hp={},cp=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},ep=function(t){var s=wt(t,Oe);return cp(s)?gi:s.substr(7).match(qa).map(ze)},vl=function(t,s){var r=t._gsap||_s(t),o=t.style,i=ep(t),n,a,h,l;return r.svg&&t.getAttribute("transform")?(h=t.transform.baseVal.consolidate().matrix,i=[h.a,h.b,h.c,h.d,h.e,h.f],i.join(",")==="1,0,0,1,0,0"?gi:i):(i===gi&&!t.offsetParent&&t!==Tr&&!r.svg&&(h=o.display,o.display="block",n=t.parentNode,(!n||!t.offsetParent&&!t.getBoundingClientRect().width)&&(l=1,a=t.nextElementSibling,Tr.appendChild(t)),i=ep(t),h?o.display=h:ks(t,"display"),l&&(a?n.insertBefore(t,a):n?n.appendChild(t):Tr.removeChild(t))),s&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},pl=function(t,s,r,o,i,n){var a=t._gsap,h=i||vl(t,!0),l=a.xOrigin||0,c=a.yOrigin||0,f=a.xOffset||0,v=a.yOffset||0,g=h[0],u=h[1],d=h[2],m=h[3],p=h[4],b=h[5],x=s.split(" "),y=parseFloat(x[0])||0,S=parseFloat(x[1])||0,_,w,C,P;r?h!==gi&&(w=g*m-u*d)&&(C=y*(m/w)+S*(-d/w)+(d*b-m*p)/w,P=y*(-u/w)+S*(g/w)-(g*b-u*p)/w,y=C,S=P):(_=ap(t),y=_.x+(~x[0].indexOf("%")?y/100*_.width:y),S=_.y+(~(x[1]||x[0]).indexOf("%")?S/100*_.height:S)),o||o!==!1&&a.smooth?(p=y-l,b=S-c,a.xOffset=f+(p*g+b*d)-p,a.yOffset=v+(p*u+b*m)-b):a.xOffset=a.yOffset=0,a.xOrigin=y,a.yOrigin=S,a.smooth=!!o,a.origin=s,a.originIsAbsolute=!!r,t.style[mt]="0px 0px",n&&(Ss(n,a,"xOrigin",l,y),Ss(n,a,"yOrigin",c,S),Ss(n,a,"xOffset",f,a.xOffset),Ss(n,a,"yOffset",v,a.yOffset)),t.setAttribute("data-svg-origin",y+" "+S)},vi=function(t,s){var r=t._gsap||new tl(t);if("x"in r&&!s&&!r.uncache)return r;var o=t.style,i=r.scaleX<0,n="px",a="deg",h=getComputedStyle(t),l=wt(t,mt)||"0",c,f,v,g,u,d,m,p,b,x,y,S,_,w,C,P,T,A,F,B,U,N,H,E,R,L,k,$,X,O,se,z;return c=f=v=d=m=p=b=x=y=0,g=u=1,r.svg=!!(t.getCTM&&lp(t)),h.translate&&((h.translate!=="none"||h.scale!=="none"||h.rotate!=="none")&&(o[Oe]=(h.translate!=="none"?"translate3d("+(h.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(h.rotate!=="none"?"rotate("+h.rotate+") ":"")+(h.scale!=="none"?"scale("+h.scale.split(" ").join(",")+") ":"")+(h[Oe]!=="none"?h[Oe]:"")),o.scale=o.rotate=o.translate="none"),w=vl(t,r.svg),r.svg&&(r.uncache?(R=t.getBBox(),l=r.xOrigin-R.x+"px "+(r.yOrigin-R.y)+"px",E=""):E=!s&&t.getAttribute("data-svg-origin"),pl(t,E||l,!!E||r.originIsAbsolute,r.smooth!==!1,w)),S=r.xOrigin||0,_=r.yOrigin||0,w!==gi&&(A=w[0],F=w[1],B=w[2],U=w[3],c=N=w[4],f=H=w[5],w.length===6?(g=Math.sqrt(A*A+F*F),u=Math.sqrt(U*U+B*B),d=A||F?Er(F,A)*sr:0,b=B||U?Er(B,U)*sr+d:0,b&&(u*=Math.abs(Math.cos(b*Pr))),r.svg&&(c-=S-(S*A+_*B),f-=_-(S*F+_*U))):(z=w[6],O=w[7],k=w[8],$=w[9],X=w[10],se=w[11],c=w[12],f=w[13],v=w[14],C=Er(z,X),m=C*sr,C&&(P=Math.cos(-C),T=Math.sin(-C),E=N*P+k*T,R=H*P+$*T,L=z*P+X*T,k=N*-T+k*P,$=H*-T+$*P,X=z*-T+X*P,se=O*-T+se*P,N=E,H=R,z=L),C=Er(-B,X),p=C*sr,C&&(P=Math.cos(-C),T=Math.sin(-C),E=A*P-k*T,R=F*P-$*T,L=B*P-X*T,se=U*T+se*P,A=E,F=R,B=L),C=Er(F,A),d=C*sr,C&&(P=Math.cos(C),T=Math.sin(C),E=A*P+F*T,R=N*P+H*T,F=F*P-A*T,H=H*P-N*T,A=E,N=R),m&&Math.abs(m)+Math.abs(d)>359.9&&(m=d=0,p=180-p),g=ze(Math.sqrt(A*A+F*F+B*B)),u=ze(Math.sqrt(H*H+z*z)),C=Er(N,H),b=Math.abs(C)>2e-4?C*sr:0,y=se?1/(se<0?-se:se):0),r.svg&&(E=t.getAttribute("transform"),r.forceCSS=t.setAttribute("transform","")||!cp(wt(t,Oe)),E&&t.setAttribute("transform",E))),Math.abs(b)>90&&Math.abs(b)<270&&(i?(g*=-1,b+=d<=0?180:-180,d+=d<=0?180:-180):(u*=-1,b+=b<=0?180:-180)),s=s||r.uncache,r.x=c-((r.xPercent=c&&(!s&&r.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-c)?-50:0)))?t.offsetWidth*r.xPercent/100:0)+n,r.y=f-((r.yPercent=f&&(!s&&r.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-f)?-50:0)))?t.offsetHeight*r.yPercent/100:0)+n,r.z=v+n,r.scaleX=ze(g),r.scaleY=ze(u),r.rotation=ze(d)+a,r.rotationX=ze(m)+a,r.rotationY=ze(p)+a,r.skewX=b+a,r.skewY=x+a,r.transformPerspective=y+n,(r.zOrigin=parseFloat(l.split(" ")[2])||!s&&r.zOrigin||0)&&(o[mt]=Tn(l)),r.xOffset=r.yOffset=0,r.force3D=ft.force3D,r.renderTransform=r.svg?I0:op?dp:A0,r.uncache=0,r},Tn=function(t){return(t=t.split(" "))[0]+" "+t[1]},hl=function(t,s,r){var o=Je(s);return ze(parseFloat(s)+parseFloat(Cs(t,"x",r+"px",o)))+o},A0=function(t,s){s.z="0px",s.rotationY=s.rotationX="0deg",s.force3D=0,dp(t,s)},er="0deg",mi="0px",tr=") ",dp=function(t,s){var r=s||this,o=r.xPercent,i=r.yPercent,n=r.x,a=r.y,h=r.z,l=r.rotation,c=r.rotationY,f=r.rotationX,v=r.skewX,g=r.skewY,u=r.scaleX,d=r.scaleY,m=r.transformPerspective,p=r.force3D,b=r.target,x=r.zOrigin,y="",S=p==="auto"&&t&&t!==1||p===!0;if(x&&(f!==er||c!==er)){var _=parseFloat(c)*Pr,w=Math.sin(_),C=Math.cos(_),P;_=parseFloat(f)*Pr,P=Math.cos(_),n=hl(b,n,w*P*-x),a=hl(b,a,-Math.sin(_)*-x),h=hl(b,h,C*P*-x+x)}m!==mi&&(y+="perspective("+m+tr),(o||i)&&(y+="translate("+o+"%, "+i+"%) "),(S||n!==mi||a!==mi||h!==mi)&&(y+=h!==mi||S?"translate3d("+n+", "+a+", "+h+") ":"translate("+n+", "+a+tr),l!==er&&(y+="rotate("+l+tr),c!==er&&(y+="rotateY("+c+tr),f!==er&&(y+="rotateX("+f+tr),(v!==er||g!==er)&&(y+="skew("+v+", "+g+tr),(u!==1||d!==1)&&(y+="scale("+u+", "+d+tr),b.style[Oe]=y||"translate(0, 0)"},I0=function(t,s){var r=s||this,o=r.xPercent,i=r.yPercent,n=r.x,a=r.y,h=r.rotation,l=r.skewX,c=r.skewY,f=r.scaleX,v=r.scaleY,g=r.target,u=r.xOrigin,d=r.yOrigin,m=r.xOffset,p=r.yOffset,b=r.forceCSS,x=parseFloat(n),y=parseFloat(a),S,_,w,C,P;h=parseFloat(h),l=parseFloat(l),c=parseFloat(c),c&&(c=parseFloat(c),l+=c,h+=c),h||l?(h*=Pr,l*=Pr,S=Math.cos(h)*f,_=Math.sin(h)*f,w=Math.sin(h-l)*-v,C=Math.cos(h-l)*v,l&&(c*=Pr,P=Math.tan(l-c),P=Math.sqrt(1+P*P),w*=P,C*=P,c&&(P=Math.tan(c),P=Math.sqrt(1+P*P),S*=P,_*=P)),S=ze(S),_=ze(_),w=ze(w),C=ze(C)):(S=f,C=v,_=w=0),(x&&!~(n+"").indexOf("px")||y&&!~(a+"").indexOf("px"))&&(x=Cs(g,"x",n,"px"),y=Cs(g,"y",a,"px")),(u||d||m||p)&&(x=ze(x+u-(u*S+d*w)+m),y=ze(y+d-(u*_+d*C)+p)),(o||i)&&(P=g.getBBox(),x=ze(x+o/100*P.width),y=ze(y+i/100*P.height)),P="matrix("+S+","+_+","+w+","+C+","+x+","+y+")",g.setAttribute("transform",P),b&&(g.style[Oe]=P)},L0=function(t,s,r,o,i){var n=360,a=qe(i),h=parseFloat(i)*(a&&~i.indexOf("rad")?sr:1),l=h-o,c=o+l+"deg",f,v;return a&&(f=i.split("_")[1],f==="short"&&(l%=n,l!==l%(n/2)&&(l+=l<0?n:-n)),f==="cw"&&l<0?l=(l+n*Gu)%n-~~(l/n)*n:f==="ccw"&&l>0&&(l=(l-n*Gu)%n-~~(l/n)*n)),t._pt=v=new ot(t._pt,s,r,o,l,m0),v.e=c,v.u="deg",t._props.push(r),v},tp=function(t,s){for(var r in s)t[r]=s[r];return t},O0=function(t,s,r){var o=tp({},r._gsap),i="perspective,force3D,transformOrigin,svgOrigin",n=r.style,a,h,l,c,f,v,g,u;o.svg?(l=r.getAttribute("transform"),r.setAttribute("transform",""),n[Oe]=s,a=vi(r,1),ks(r,Oe),r.setAttribute("transform",l)):(l=getComputedStyle(r)[Oe],n[Oe]=s,a=vi(r,1),n[Oe]=l);for(h in os)l=o[h],c=a[h],l!==c&&i.indexOf(h)<0&&(g=Je(l),u=Je(c),f=g!==u?Cs(r,h,l,u):parseFloat(l),v=parseFloat(c),t._pt=new ot(t._pt,a,h,f,v-f,cl),t._pt.u=u||0,t._props.push(h));tp(a,o)};nt("padding,margin,Width,Radius",function(e,t){var s="Top",r="Right",o="Bottom",i="Left",n=(t<3?[s,r,o,i]:[s+i,s+r,o+r,o+i]).map(function(a){return t<2?e+a:"border"+a+e});En[t>1?"border"+e:e]=function(a,h,l,c,f){var v,g;if(arguments.length<4)return v=n.map(function(u){return ns(a,u,l)}),g=v.join(" "),g.split(v[0]).length===5?v[0]:g;v=(c+"").split(" "),g={},n.forEach(function(u,d){return g[u]=v[d]=v[d]||v[(d-1)/2|0]}),a.init(h,g,f)}});var bl={name:"css",register:ul,targetTest:function(t){return t.style&&t.nodeType},init:function(t,s,r,o,i){var n=this._props,a=t.style,h=r.vars.startAt,l,c,f,v,g,u,d,m,p,b,x,y,S,_,w,C,P;fl||ul(),this.styles=this.styles||np(t),C=this.styles.props,this.tween=r;for(d in s)if(d!=="autoRound"&&(c=s[d],!(dt[d]&&rl(d,s,r,o,t,i)))){if(g=typeof c,u=En[d],g==="function"&&(c=c.call(r,o,t,i),g=typeof c),g==="string"&&~c.indexOf("random(")&&(c=Cr(c)),u)u(this,t,d,c,r)&&(w=1);else if(d.substr(0,2)==="--")l=(getComputedStyle(t).getPropertyValue(d)+"").trim(),c+="",rs.lastIndex=0,rs.test(l)||(m=Je(l),p=Je(c),p?m!==p&&(l=Cs(t,d,l,p)+p):m&&(c+=m)),this.add(a,"setProperty",l,c,o,i,0,0,d),n.push(d),C.push(d,0,a[d]);else if(g!=="undefined"){if(h&&d in h?(l=typeof h[d]=="function"?h[d].call(r,o,t,i):h[d],qe(l)&&~l.indexOf("random(")&&(l=Cr(l)),Je(l+"")||l==="auto"||(l+=ft.units[d]||Je(ns(t,d))||""),(l+"").charAt(1)==="="&&(l=ns(t,d))):l=ns(t,d),v=parseFloat(l),b=g==="string"&&c.charAt(1)==="="&&c.substr(0,2),b&&(c=c.substr(2)),f=parseFloat(c),d in Wt&&(d==="autoAlpha"&&(v===1&&ns(t,"visibility")==="hidden"&&f&&(v=0),C.push("visibility",0,a.visibility),Ss(this,a,"visibility",v?"inherit":"hidden",f?"inherit":"hidden",!f)),d!=="scale"&&d!=="transform"&&(d=Wt[d],~d.indexOf(",")&&(d=d.split(",")[0]))),x=d in os,x){if(this.styles.save(d),P=c,g==="string"&&c.substring(0,6)==="var(--"){if(c=wt(t,c.substring(4,c.indexOf(")"))),c.substring(0,5)==="calc("){var T=t.style.perspective;t.style.perspective=c,c=wt(t,"perspective"),T?t.style.perspective=T:ks(t,"perspective")}f=parseFloat(c)}if(y||(S=t._gsap,S.renderTransform&&!s.parseTransform||vi(t,s.parseTransform),_=s.smoothOrigin!==!1&&S.smooth,y=this._pt=new ot(this._pt,a,Oe,0,1,S.renderTransform,S,0,-1),y.dep=1),d==="scale")this._pt=new ot(this._pt,S,"scaleY",S.scaleY,(b?Qs(S.scaleY,b+f):f)-S.scaleY||0,cl),this._pt.u=0,n.push("scaleY",d),d+="X";else if(d==="transformOrigin"){C.push(mt,0,a[mt]),c=D0(c),S.svg?pl(t,c,0,_,0,this):(p=parseFloat(c.split(" ")[2])||0,p!==S.zOrigin&&Ss(this,S,"zOrigin",S.zOrigin,p),Ss(this,a,d,Tn(l),Tn(c)));continue}else if(d==="svgOrigin"){pl(t,c,1,_,0,this);continue}else if(d in hp){L0(this,S,d,v,b?Qs(v,b+c):c);continue}else if(d==="smoothOrigin"){Ss(this,S,"smooth",S.smooth,c);continue}else if(d==="force3D"){S[d]=c;continue}else if(d==="transform"){O0(this,c,t);continue}}else d in a||(d=Dr(d)||d);if(x||(f||f===0)&&(v||v===0)&&!f0.test(c)&&d in a)m=(l+"").substr((v+"").length),f||(f=0),p=Je(c)||(d in ft.units?ft.units[d]:m),m!==p&&(v=Cs(t,d,l,p)),this._pt=new ot(this._pt,x?S:a,d,v,(b?Qs(v,b+f):f)-v,!x&&(p==="px"||d==="zIndex")&&s.autoRound!==!1?b0:cl),this._pt.u=p||0,x&&P!==c?(this._pt.b=l,this._pt.e=P,this._pt.r=v0):m!==p&&p!=="%"&&(this._pt.b=l,this._pt.r=g0);else if(d in a)P0.call(this,t,d,l,b?b+c:c);else if(d in t)this.add(t,d,l||t[d],b?b+c:c,o,i);else if(d!=="parseTransform"){yn(d,c);continue}x||(d in a?C.push(d,0,a[d]):typeof t[d]=="function"?C.push(d,2,t[d]()):C.push(d,1,l||t[d])),n.push(d)}}w&&ll(this)},render:function(t,s){if(s.tween._time||!ml())for(var r=s._pt;r;)r.r(t,r.d),r=r._next;else s.styles.revert()},get:ns,aliases:Wt,getSetter:function(t,s,r){var o=Wt[s];return o&&o.indexOf(",")<0&&(s=o),s in os&&s!==mt&&(t._gsap.x||ns(t,"x"))?r&&Ku===r?s==="scale"?w0:y0:(Ku=r||{})&&(s==="scale"?S0:k0):t.style&&!xn(t.style[s])?_0:~s.indexOf("-")?x0:Cn(t,s)},core:{_removeProperty:ks,_getMatrix:vl}};rt.utils.checkPrefix=Dr;rt.core.getStyleSaver=np;(function(e,t,s,r){var o=nt(e+","+t+","+s,function(i){os[i]=1});nt(t,function(i){ft.units[i]="deg",hp[i]=1}),Wt[o[13]]=e+","+t,nt(r,function(i){var n=i.split(":");Wt[n[1]]=o[n[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");nt("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(e){ft.units[e]="px"});rt.registerPlugin(bl);var qt=rt.registerPlugin(bl)||rt,c5=qt.core.Tween;var Es=require("react");var up=typeof document<"u"?Es.useLayoutEffect:Es.useEffect,pp=e=>e&&!Array.isArray(e)&&typeof e=="object",Pn=[],M0={},fp=qt,ir=(e,t=Pn)=>{let s=M0;pp(e)?(s=e,e=null,t="dependencies"in s?s.dependencies:Pn):pp(t)&&(s=t,t="dependencies"in s?s.dependencies:Pn),e&&typeof e!="function"&&console.warn("First parameter must be a function or config object");let{scope:r,revertOnUpdate:o}=s,i=(0,Es.useRef)(!1),n=(0,Es.useRef)(fp.context(()=>{},r)),a=(0,Es.useRef)(l=>n.current.add(null,l)),h=t&&t.length&&!o;return h&&up(()=>(i.current=!0,()=>n.current.revert()),Pn),up(()=>{if(e&&n.current.add(e,r),!h||!i.current)return()=>n.current.revert()},t),{context:n.current,contextSafe:a.current}};ir.register=e=>{fp=e};ir.headless=!0;qt.registerPlugin(ir);var F0="(prefers-reduced-motion: reduce)";function Dn(){return!window.matchMedia(F0).matches}function mp(e,t){let s=(0,_l.useRef)(t),r=(0,_l.useRef)(!1);s.current=t;let{contextSafe:o}=ir(()=>{let i=e.current;if(i===null||!Dn())return;let n=Array.from(i.children),a=qt.timeline({defaults:{ease:"power2.out"}});return a.fromTo(i,{autoAlpha:0,y:10,scale:.985,transformOrigin:"50% 36%"},{autoAlpha:1,y:0,scale:1,duration:.22,clearProps:"transform,opacity,visibility"}).fromTo(n,{autoAlpha:.58,y:4},{autoAlpha:1,y:0,duration:.18,stagger:.025,clearProps:"transform,opacity,visibility"},"<0.035"),()=>{a.kill()}},{scope:e});return o(()=>{if(r.current)return;let i=e.current;if(i===null||!Dn()){s.current();return}r.current=!0;let n=Array.from(i.children);qt.killTweensOf([i,...n]),qt.timeline({defaults:{ease:"power1.in"},onComplete:()=>{s.current()}}).to(n,{autoAlpha:0,y:-2,duration:.08,stagger:{each:.012,from:"end"}}).to(i,{autoAlpha:0,y:6,scale:.99,transformOrigin:"50% 36%",duration:.12},"<0.025")})}function gp(e,t){ir(()=>{let s=e.current;!t||s===null||!Dn()||qt.fromTo(s,{y:1,scale:.975},{y:0,scale:1,duration:.2,ease:"power2.out",overwrite:"auto",clearProps:"transform"})},{scope:e,dependencies:[t],revertOnUpdate:!0})}function vp(e,t=":scope > *"){ir(()=>{let s=e.current;if(s===null||!Dn())return;let r=s.querySelectorAll(t);qt.fromTo(r,{autoAlpha:0,y:5},{autoAlpha:1,y:0,duration:.24,stagger:.035,ease:"power2.out",clearProps:"transform,opacity,visibility"})},{scope:e})}var Se=require("react/jsx-runtime");function Ye({title:e,subtitle:t,className:s,onClose:r,children:o}){let i=(0,Me.useId)(),n=(0,Me.useId)(),a=(0,Me.useRef)(null),h=mp(a,r),l=c=>{!(c.target instanceof Element)||c.target.closest("[data-ssh-dialog-close]")===null||(c.preventDefault(),c.stopPropagation(),h())};return(0,Se.jsx)(Kt.Modal,{open:!0,onClose:h,title:e,headless:!0,className:`dsh-ssh-dialog-modal${s===void 0?"":` ${s}-modal`}`,children:(0,Se.jsx)(nu,{children:(0,Se.jsx)(ou,{children:(0,Se.jsxs)("section",{ref:a,className:`dsh-ssh-dialog dsh-ssh-scroll-surface${s===void 0?"":` ${s}`}`,"aria-labelledby":i,"aria-describedby":t===void 0?void 0:n,onClickCapture:l,children:[(0,Se.jsxs)("header",{children:[(0,Se.jsxs)("span",{children:[(0,Se.jsx)("h2",{id:i,children:e}),t&&(0,Se.jsx)("p",{id:n,children:t})]}),(0,Se.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",onClick:h,"aria-label":"\u5173\u95ED",children:(0,Se.jsx)(Kt.IconCloseOutline16,{size:16})})]}),o]})})})})}function le({label:e,hint:t,children:s}){return(0,Se.jsxs)("label",{className:"dsh-ssh-field",children:[(0,Se.jsx)("span",{children:e}),s,t&&(0,Se.jsx)("small",{children:t})]})}function Rr({value:e,options:t,placeholder:s,maxLength:r,multiple:o=!1,ariaLabel:i,onChange:n}){let a=(0,Me.useId)(),h=(0,Me.useRef)(null),l=(0,Me.useRef)(null),c=(0,Me.useRef)(!1),f=(0,Me.useMemo)(()=>yl(t).sort((w,C)=>w.localeCompare(C,void 0,{numeric:!0,sensitivity:"base"})),[t]),[v,g]=(0,Me.useState)(!1),[u,d]=(0,Me.useState)(""),[m,p]=(0,Me.useState)(0),b=(0,Me.useMemo)(()=>o?bp(e):e.trim()?[e.trim()]:[],[o,e]),x=(0,Me.useMemo)(()=>{let w=u.trim().toLocaleLowerCase();return f.filter(C=>(!o||!b.some(P=>xl(P,C)))&&(w.length===0||C.toLocaleLowerCase().includes(w)))},[u,o,f,b]);(0,Me.useEffect)(()=>{if(!v)return;let w=C=>{C.target instanceof Node&&!h.current?.contains(C.target)&&g(!1)};return document.addEventListener("pointerdown",w),()=>document.removeEventListener("pointerdown",w)},[v]),(0,Me.useEffect)(()=>{p(w=>Math.min(w,Math.max(0,x.length-1)))},[x.length]);let y=w=>{if(!o)n(w);else{let C=bp(e),P=u.trim().length>0&&C.length>0;n(yl([...P?C.slice(0,-1):C,w]).join(", "))}d(""),g(!1),document.activeElement!==l.current&&(c.current=!0,l.current?.focus())},S=w=>{if(w.key==="ArrowDown"||w.key==="ArrowUp"){if(w.preventDefault(),!v){g(!0),p(0);return}let C=w.key==="ArrowDown"?1:-1;p(P=>(P+C+x.length)%Math.max(1,x.length))}else w.key==="Enter"&&v&&x[m]!==void 0?(w.preventDefault(),y(x[m])):w.key==="Escape"&&v&&(w.preventDefault(),g(!1))},_=w=>{n(w),d(o?w.split(/[,,]/u).at(-1)?.trim()??"":w),p(0),g(!0)};return(0,Se.jsxs)("div",{ref:h,className:`dsh-ssh-suggestion-input${v?" is-open":""}`,children:[(0,Se.jsx)("input",{ref:l,role:"combobox","aria-label":i,"aria-autocomplete":"list","aria-expanded":v,"aria-controls":a,"aria-activedescendant":v&&x[m]!==void 0?`${a}-${m}`:void 0,value:e,maxLength:r,placeholder:s,onChange:w=>_(w.target.value),onFocus:()=>{if(c.current){c.current=!1;return}d(o?"":e),f.length>0&&g(!0)},onKeyDown:S}),(0,Se.jsx)("button",{type:"button",className:"dsh-ssh-suggestion-toggle","aria-label":`${v?"\u6536\u8D77":"\u5C55\u5F00"}${i}\u5DF2\u6709\u9009\u9879`,"aria-expanded":v,onClick:()=>{if(v){g(!1);return}d(""),p(0),g(!0),l.current?.focus()},children:(0,Se.jsx)(Kt.IconChevronDownOutline14,{size:14})}),v&&(0,Se.jsx)("div",{id:a,className:"dsh-ssh-suggestion-menu dsh-ssh-scroll-surface",role:"listbox","aria-label":`${i}\u5DF2\u6709\u9009\u9879`,children:x.length===0?(0,Se.jsx)("p",{children:f.length===0?"\u6682\u65E0\u5DF2\u6709\u9009\u9879\uFF0C\u53EF\u76F4\u63A5\u8F93\u5165":"\u6CA1\u6709\u5339\u914D\u9879\uFF0C\u53EF\u76F4\u63A5\u8F93\u5165\u65B0\u5185\u5BB9"}):x.map((w,C)=>(0,Se.jsxs)("button",{id:`${a}-${C}`,type:"button",role:"option","aria-selected":!o&&xl(e,w),className:C===m?"is-active":"",onPointerMove:()=>p(C),onClick:()=>y(w),children:[(0,Se.jsx)("span",{children:w}),!o&&xl(e,w)&&(0,Se.jsx)(Kt.IconCheckOutline14,{size:14})]},w))})]})}function wl(e){let[t,s]=(0,Me.useState)(!1);return(0,Se.jsxs)("div",{className:"dsh-ssh-password-input",children:[(0,Se.jsx)("input",{...e,type:t?"text":"password"}),(0,Se.jsx)("button",{type:"button","aria-label":t?"\u9690\u85CF\u5BC6\u7801":"\u663E\u793A\u5BC6\u7801","aria-pressed":t,onClick:()=>s(r=>!r),children:t?"\u9690\u85CF":"\u663E\u793A"})]})}function nr({active:e,onClick:t,children:s}){let r=(0,Me.useRef)(null);return gp(r,e),(0,Se.jsx)("button",{ref:r,type:"button",role:"tab","data-ssh-interactive":"choice",className:e?"is-active":"","aria-selected":e,onClick:t,children:s})}function _p(){let e=(0,Me.useRef)(null);return vp(e),(0,Se.jsxs)("div",{ref:e,className:"dsh-ssh-empty-state",children:[(0,Se.jsx)("span",{children:(0,Se.jsx)(Ts,{})}),(0,Se.jsx)("h1",{children:"\u8FDE\u63A5\u4F60\u7684\u7B2C\u4E00\u53F0\u8FDC\u7AEF\u4E3B\u673A"}),(0,Se.jsx)("p",{children:"\u4F7F\u7528\u201C\u4E3B\u673A\u4E0E\u9879\u76EE\u201D\u65C1\u7684\u6DFB\u52A0\u6309\u94AE\u4FDD\u5B58 SSH \u914D\u7F6E\uFF0C\u968F\u540E\u5373\u53EF\u6253\u5F00\u7EC8\u7AEF\u3001\u5EFA\u7ACB\u7AEF\u53E3\u8F6C\u53D1\uFF0C\u5E76\u6309\u4F1A\u8BDD\u6388\u6743\u7ED9 AI\u3002"})]})}function Ts(){return(0,Se.jsx)("span",{className:"dsh-ssh-server-glyph",children:(0,Se.jsx)(Kt.IconDataOutline16,{size:17})})}function De(e){return e instanceof Error?e.message:String(e)}function xp(e){return e.length<=16?e:`${e.slice(0,8)}\u2026${e.slice(-5)}`}function bp(e){return yl(e.split(/[,,]/u))}function xl(e,t){return e.trim().localeCompare(t.trim(),void 0,{sensitivity:"accent"})===0}function yl(e){let t=new Map;for(let s of e){let r=s.trim();r.length>0&&!t.has(r.toLocaleLowerCase())&&t.set(r.toLocaleLowerCase(),r)}return[...t.values()]}var Ve=require("react/jsx-runtime");function Rn({locationName:e,locationKind:t,entries:s,onClose:r,onDelete:o}){let[i,n]=(0,Sl.useState)(!1),[a,h]=(0,Sl.useState)(),l=s.filter(f=>f.kind==="directory").length,c=async()=>{n(!0),h(void 0);try{await o(),n(!1),r()}catch(f){h(De(f)),n(!1)}};return(0,Ve.jsxs)(Ye,{className:"dsh-ssh-file-delete-dialog",title:`\u5220\u9664 ${s.length} \u9879\uFF1F`,subtitle:`${e} \xB7 \u6B64\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500`,onClose:()=>{i||r()},children:[(0,Ve.jsxs)("div",{className:"dsh-ssh-file-delete-copy",children:[(0,Ve.jsx)("span",{children:(0,Ve.jsx)(Ar.IconTrashOutline16,{size:18})}),(0,Ve.jsxs)("p",{children:["\u5C06\u76F4\u63A5\u4ECE",t==="local"?"\u5F53\u524D\u4F1A\u8BDD\u76EE\u5F55":"\u8FDC\u7AEF","\u5220\u9664\u6240\u9009\u5185\u5BB9\u3002",l>0?`\u5176\u4E2D ${l} \u4E2A\u76EE\u5F55\u53CA\u5176\u5168\u90E8\u5185\u5BB9\u4F1A\u88AB\u9012\u5F52\u5220\u9664\u3002`:""]})]}),(0,Ve.jsxs)("div",{className:"dsh-ssh-file-delete-list",children:[s.slice(0,6).map(f=>(0,Ve.jsxs)("div",{children:[f.kind==="directory"?(0,Ve.jsx)(Ar.IconFolderClose16,{size:17}):(0,Ve.jsx)(Ar.IconDataOutline16,{size:17}),(0,Ve.jsxs)("span",{children:[(0,Ve.jsx)("strong",{children:f.name}),(0,Ve.jsx)("small",{title:f.path,children:f.path})]})]},f.path)),s.length>6&&(0,Ve.jsxs)("p",{children:["\u4EE5\u53CA\u5176\u4ED6 ",s.length-6," \u9879"]})]}),a&&(0,Ve.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:a}),(0,Ve.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,Ve.jsx)("span",{}),(0,Ve.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:i,onClick:r,children:"\u53D6\u6D88"}),(0,Ve.jsx)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:i,onClick:()=>{c()},children:i?"\u6B63\u5728\u5220\u9664\u2026":"\u786E\u8BA4\u5220\u9664"})]})]})}var G=require("react/jsx-runtime"),B0=512*1024*1024;function wp({sessionId:e}){let t=(0,xe.useCallback)(i=>th(e,i||void 0),[e]),s=(0,xe.useCallback)(i=>sh(e,i),[e]),r=(0,xe.useCallback)((i,n=!1)=>ih(e,i,n),[e]),o=(0,xe.useCallback)((i,n)=>rh(e,i,n),[e]);return(0,G.jsx)(Cl,{initialPath:"",loadDirectory:t,loadPreview:s,fileUrl:r,deletion:{locationName:"\u672C\u5730\u4F1A\u8BDD",locationKind:"local",remove:o}})}function Sp({sessionId:e,profile:t,profiles:s,onProfile:r,onSaved:o}){let i=(0,xe.useCallback)(async(g,u)=>{let d=u?(await gh(e,t.id,g)).cwd:g,m=await eh(e,t.id,d);return u&&await o(),m},[o,t.id,e]),n=(0,xe.useCallback)(g=>nh(e,t.id,g),[t.id,e]),a=(0,xe.useCallback)((g,u=!1)=>oh(e,t.id,g,u),[t.id,e]),h=(0,xe.useCallback)((g,u,d)=>Wn(t.id,g,u,d),[t.id]),l=Cp(`activity-sftp-${e}-${t.id}`),c=`sftp:${t.id}`,f=(0,xe.useCallback)((g,u)=>Br({paneId:l,endpointId:c,directory:g,paths:u}),[c,l]),v=(0,G.jsxs)("div",{className:"dsh-ssh-sftp-hostbar",children:[(0,G.jsx)("span",{className:"dsh-ssh-host-monogram",children:t.name.slice(0,1).toUpperCase()}),(0,G.jsxs)("label",{children:[(0,G.jsx)("span",{className:"sr-only",children:"\u9009\u62E9\u8FDC\u7AEF\u4E3B\u673A"}),(0,G.jsx)("select",{value:t.id,onChange:g=>r(g.target.value),children:s.map(g=>(0,G.jsx)("option",{value:g.id,children:g.name},g.id))}),(0,G.jsxs)("small",{children:[t.username,"@",t.host,":",t.port]})]})]});return(0,G.jsx)(Cl,{initialPath:t.cwd,header:v,loadDirectory:i,loadPreview:n,fileUrl:a,uploadFile:h,operations:{paneId:l,endpointId:c,endpointName:t.name},deletion:{locationName:t.name,locationKind:"remote",remove:f}})}function kp({profile:e,initialPath:t="~",onEdit:s,onDelete:r,embedded:o=!1}){let i=(0,xe.useCallback)(v=>ah(e.id,v),[e.id]),n=(0,xe.useCallback)(v=>lh(e.id,v),[e.id]),a=(0,xe.useCallback)((v,g=!1)=>hh(e.id,v,g),[e.id]),h=(0,xe.useCallback)((v,g,u)=>Wn(e.id,v,g,u),[e.id]),l=Cp(`profile-sftp-${e.id}`),c=`sftp:${e.id}`,f=(0,xe.useCallback)((v,g)=>Br({paneId:l,endpointId:c,directory:v,paths:g}),[c,l]);return(0,G.jsxs)("div",{className:`dsh-ssh-profile-sftp-pane${o?" is-embedded":""}`,children:[(0,G.jsxs)("div",{className:"dsh-ssh-content-heading",children:[(0,G.jsxs)("div",{children:[(0,G.jsx)("h1",{children:o?"SFTP":`${e.name} \xB7 SFTP`}),(0,G.jsx)("p",{children:o?t:`${Yt(e)} \xB7 ${t}`})]}),(0,G.jsxs)("div",{className:"dsh-ssh-heading-actions",children:[r&&(0,G.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":`\u5220\u9664\u4E3B\u673A ${e.name}`,title:"\u5220\u9664\u4E3B\u673A",onClick:r,children:(0,G.jsx)(Ce.IconTrashOutline16,{size:16})}),s&&(0,G.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:s,children:[(0,G.jsx)(Ce.IconEditOutline16,{size:16}),"\u7F16\u8F91\u4E3B\u673A"]})]})]}),(0,G.jsx)(Cl,{workspace:!0,initialPath:t,loadDirectory:i,loadPreview:n,fileUrl:a,uploadFile:h,operations:{paneId:l,endpointId:c,endpointName:e.name},deletion:{locationName:e.name,locationKind:"remote",remove:f}})]})}function Cl({initialPath:e,header:t,workspace:s=!1,loadDirectory:r,loadPreview:o,fileUrl:i,uploadFile:n,operations:a,deletion:h}){let l=(0,xe.useRef)(null),c=(0,xe.useRef)(0),[f,v]=(0,xe.useState)(),[g,u]=(0,xe.useState)(),[d,m]=(0,xe.useState)(e),[p,b]=(0,xe.useState)(!0),[x,y]=(0,xe.useState)(),[S,_]=(0,xe.useState)(),[w,C]=(0,xe.useState)(!1),[P,T]=(0,xe.useState)(),[A,F]=(0,xe.useState)(),[B,U]=(0,xe.useState)(),[N,H]=(0,xe.useState)(),[E,R]=(0,xe.useState)(),L=(0,xe.useCallback)(async(W,ae)=>{b(!0),R(void 0),u(void 0),_(void 0);try{let me=await r(W,ae);v(me),m(me.path)}catch(me){R(An(me))}finally{b(!1)}},[r]);(0,xe.useEffect)(()=>{L(e,!1)},[L,e]);let k=W=>{W.preventDefault(),L(d,!0)},$=async(W,ae=f?.path,me=!1)=>{if(n===void 0||ae===void 0||W.length===0)return;let Re=W.filter(Pe=>Pe.size<=B0),re=W.length-Re.length;if(Re.length===0){R("\u5355\u4E2A\u6587\u4EF6\u4E0D\u80FD\u8D85\u8FC7 512 MB");return}_(void 0),R(void 0);for(let Pe=0;Pe<Re.length;Pe+=1){let gt=Re[Pe],hs=me&&Pe===0;y(gt.name);try{await n(ae,gt,hs)}catch(Bt){!hs&&Bt instanceof cs&&Bt.status===409?_({file:gt,remaining:Re.slice(Pe+1),directory:ae}):R(An(Bt)),y(void 0);return}}y(void 0),await L(ae,!1),re>0&&R(`\u5DF2\u8DF3\u8FC7 ${re} \u4E2A\u8D85\u8FC7 512 MB \u7684\u6587\u4EF6`)},X=n!==void 0&&f!==void 0&&x===void 0&&S===void 0,O=W=>Array.from(W.dataTransfer.types).includes("Files"),se=W=>Array.from(W.dataTransfer.types).includes(Ft),z=W=>{!X||!O(W)||(W.preventDefault(),c.current+=1,C(!0))},I=W=>{if(X&&O(W)){W.preventDefault(),W.dataTransfer.dropEffect="copy";return}if(a===void 0||f===void 0||!se(W))return;let ae=P===void 0?"copy":si(P,{endpointId:a.endpointId,directory:f.path});ae==="none"||ae==="invalid"||(W.preventDefault(),W.dataTransfer.dropEffect=ae)},J=W=>{O(W)&&(c.current=Math.max(0,c.current-1),c.current===0&&C(!1))},Y=W=>{if(c.current=0,C(!1),X&&O(W)){W.preventDefault();let me=Array.from(W.dataTransfer.files);me.length>0&&$(me);return}if(a===void 0||f===void 0||!se(W))return;W.preventDefault();let ae=br(W.dataTransfer.getData(Ft));ae!==void 0&&V(ae,f.path)},V=async(W,ae)=>{if(a!==void 0){F(void 0),T(void 0),H(void 0),R(void 0);try{let me=await cn(W,{paneId:a.paneId,endpointId:a.endpointId,directory:ae});me.operation==="move"&&(H("\u5DF2\u79FB\u52A8"),await L(f?.path??ae,!1)),me.operation==="copy"&&H("\u5DF2\u52A0\u5165\u4F20\u8F93\u4EFB\u52A1\uFF0C\u53EF\u5728\u6587\u4EF6\u4F20\u8F93\u4E2D\u67E5\u770B\u8FDB\u5EA6")}catch(me){R(An(me))}}},Q=async()=>{h===void 0||f===void 0||B===void 0||(await h.remove(f.path,[B.path]),await L(f.path,!1))};return(0,G.jsxs)("div",{className:`dsh-ssh-sftp${s?" is-workspace":""}${w?" is-dragging-files":""}`,onDragEnter:z,onDragOver:I,onDragLeave:J,onDrop:Y,children:[t,g?(0,G.jsx)(N0,{entry:g,loadPreview:o,fileUrl:i,onBack:()=>u(void 0)}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)("form",{className:`dsh-ssh-sftp-pathbar${n===void 0?"":" has-upload"}`,onSubmit:k,children:[(0,G.jsx)("button",{type:"button","aria-label":"\u8FD4\u56DE\u4E0A\u7EA7\u76EE\u5F55",title:"\u8FD4\u56DE\u4E0A\u7EA7\u76EE\u5F55",disabled:f?.parent==null||p,onClick:()=>{f?.parent&&L(f.parent,!0)},children:(0,G.jsx)(Ce.IconChevronLeftOutline14,{size:14})}),(0,G.jsx)("input",{"aria-label":"\u5F53\u524D\u8FDC\u7AEF\u76EE\u5F55",value:d,spellCheck:!1,onChange:W=>m(W.target.value)}),(0,G.jsx)("button",{type:"button","aria-label":"\u5237\u65B0\u76EE\u5F55",title:"\u5237\u65B0\u76EE\u5F55",disabled:p,onClick:()=>{L(f?.path??d,!1)},children:(0,G.jsx)(Ce.IconRefreshOutline16,{size:15})}),n!==void 0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("input",{ref:l,className:"sr-only",type:"file",multiple:!0,tabIndex:-1,onChange:W=>{let ae=Array.from(W.target.files??[]);W.target.value="",ae.length>0&&$(ae)}}),(0,G.jsxs)("button",{type:"button",className:"dsh-ssh-sftp-upload-button",disabled:f===void 0||x!==void 0||S!==void 0,onClick:()=>l.current?.click(),children:[(0,G.jsx)(Ce.IconSendOutline14,{size:14}),x===void 0?"\u4E0A\u4F20":"\u4E0A\u4F20\u4E2D"]})]})]}),S!==void 0&&(0,G.jsxs)("div",{className:"dsh-ssh-upload-conflict",role:"alert",children:[(0,G.jsxs)("span",{children:[(0,G.jsx)("strong",{children:"\u540C\u540D\u6587\u4EF6\u5DF2\u5B58\u5728"}),(0,G.jsx)("small",{children:S.file.name})]}),(0,G.jsxs)("span",{children:[(0,G.jsx)("button",{type:"button",onClick:()=>{let W=S;_(void 0),$(W.remaining,W.directory)},children:"\u8DF3\u8FC7"}),(0,G.jsx)("button",{type:"button",className:"is-primary",disabled:x!==void 0,onClick:()=>{let W=S;$([W.file,...W.remaining],W.directory,!0)},children:"\u8986\u76D6\u4E0A\u4F20"})]})]}),N&&(0,G.jsxs)("div",{className:"dsh-ssh-sftp-operation-status",role:"status",children:[(0,G.jsx)("span",{children:N}),(0,G.jsx)("button",{type:"button","aria-label":"\u5173\u95ED\u63D0\u793A",onClick:()=>H(void 0),children:(0,G.jsx)(Ce.IconCloseOutline16,{size:14})})]}),E&&(0,G.jsx)("p",{className:"dsh-ssh-directory-error",role:"alert",children:E}),(0,G.jsxs)("div",{className:"dsh-ssh-sftp-table dsh-ssh-scroll-surface","aria-busy":p,children:[(0,G.jsxs)("div",{className:"dsh-ssh-sftp-columns",children:[(0,G.jsx)("span",{children:"\u540D\u79F0"}),(0,G.jsx)("span",{children:"\u5927\u5C0F"}),(0,G.jsx)("span",{children:"\u4FEE\u6539\u65F6\u95F4"}),(0,G.jsx)("span",{"aria-hidden":"true"})]}),p&&f===void 0?(0,G.jsx)("p",{className:"dsh-ssh-sftp-state",children:"\u6B63\u5728\u8BFB\u53D6\u8FDC\u7AEF\u76EE\u5F55\u2026"}):f?.entries.length===0?(0,G.jsx)("p",{className:"dsh-ssh-sftp-state",children:"\u6B64\u76EE\u5F55\u4E3A\u7A7A"}):f?.entries.map(W=>{let ae=hn(W),me=P===void 0||a===void 0?void 0:si(P,{endpointId:a.endpointId,directory:W.path}),Re=ae&&me!=="none"&&me!=="invalid";return(0,G.jsxs)("div",{role:"row",tabIndex:0,"aria-label":`${W.name}${ae?"\uFF0C\u76EE\u5F55\uFF0C\u5355\u51FB\u8FDB\u5165\uFF1B\u53EF\u63A5\u6536\u62D6\u653E":"\uFF0C\u6587\u4EF6\uFF0C\u5355\u51FB\u9884\u89C8"}`,"data-ssh-interactive":"row","data-ssh-context-row":!0,draggable:a!==void 0&&(W.kind==="file"||ae),className:`dsh-ssh-sftp-row is-${ae?"directory":W.kind}${A===W.path?" is-drop-target":""}`,onClick:()=>{ae?L(W.path,!0):u(W)},onKeyDown:re=>{re.target===re.currentTarget&&re.key==="Enter"&&(ae?L(W.path,!0):u(W))},onDragStart:re=>{if(a===void 0||f===void 0)return;let Pe={paneId:a.paneId,endpointId:a.endpointId,directory:f.path,paths:[W.path]};T(Pe),re.dataTransfer.effectAllowed="copyMove",re.dataTransfer.setData(Ft,JSON.stringify(Pe))},onDragEnd:()=>{T(void 0),F(void 0)},onDragOver:re=>{let Pe=X&&O(re);!ae||!Pe&&!se(re)||!Pe&&!Re||(re.preventDefault(),re.stopPropagation(),re.dataTransfer.dropEffect=Pe||me!=="move"?"copy":"move",F(W.path))},onDragLeave:re=>{re.currentTarget.contains(re.relatedTarget)||F(void 0)},onDrop:re=>{if(!ae)return;if(re.preventDefault(),re.stopPropagation(),F(void 0),X&&O(re)){let gt=Array.from(re.dataTransfer.files);gt.length>0&&$(gt,W.path);return}let Pe=br(re.dataTransfer.getData(Ft));Pe!==void 0&&V(Pe,W.path)},children:[(0,G.jsxs)("span",{children:[ae?(0,G.jsx)(Ce.IconFolderClose16,{size:16}):(0,G.jsx)(Ce.IconDataOutline16,{size:16}),(0,G.jsx)("strong",{title:W.name,children:W.name})]}),(0,G.jsx)("small",{children:ae?"-":kl(W.size)}),(0,G.jsx)("small",{children:z0(W.modifiedAt)}),h!==void 0&&(0,G.jsx)("button",{type:"button",className:"dsh-ssh-sftp-row-delete dsh-ssh-context-action",draggable:!1,"aria-label":`\u5220\u9664 ${W.name}`,title:`\u5220\u9664 ${W.name}`,onClick:re=>{re.stopPropagation(),U(W)},children:(0,G.jsx)(Ce.IconTrashOutline16,{size:14})})]},W.path)})]})]}),w&&(0,G.jsx)("div",{className:"dsh-ssh-sftp-dropzone","aria-hidden":"true",children:(0,G.jsxs)("span",{children:[(0,G.jsx)("strong",{children:"\u677E\u5F00\u4EE5\u4E0A\u4F20"}),(0,G.jsxs)("small",{children:["\u4E0A\u4F20\u5230 ",f?.path??d]})]})}),B!==void 0&&h!==void 0&&(0,G.jsx)(Rn,{locationName:h.locationName,locationKind:h.locationKind,entries:[B],onClose:()=>U(void 0),onDelete:Q})]})}function N0({entry:e,loadPreview:t,fileUrl:s,onBack:r}){let[o,i]=(0,xe.useState)(),[n,a]=(0,xe.useState)(),[h,l]=(0,xe.useState)(!1);(0,xe.useEffect)(()=>{let f=!1;return i(void 0),a(void 0),t(e.path).then(v=>{f||i(v)}).catch(v=>{f||a(An(v))}),()=>{f=!0}},[e.path,t]);let c=s(e.path);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)("section",{className:"dsh-ssh-file-preview",children:[(0,G.jsxs)("header",{children:[(0,G.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u8FD4\u56DE\u76EE\u5F55",title:"\u8FD4\u56DE\u76EE\u5F55",onClick:r,children:(0,G.jsx)(Ce.IconChevronLeftOutline14,{size:14})}),(0,G.jsxs)("span",{className:"dsh-ssh-file-preview-title",children:[(0,G.jsx)("strong",{title:e.name,children:e.name}),(0,G.jsx)("small",{children:kl(e.size)})]}),(0,G.jsxs)("span",{className:"dsh-ssh-file-preview-actions",children:[(0,G.jsx)("a",{href:c,"aria-label":"\u4E0B\u8F7D\u6587\u4EF6",title:"\u4E0B\u8F7D\u6587\u4EF6",children:(0,G.jsx)(Ce.IconDownloadOutline16,{size:16})}),(0,G.jsx)("button",{type:"button","aria-label":"\u653E\u5927\u9884\u89C8",title:"\u653E\u5927\u9884\u89C8",onClick:()=>l(!0),children:(0,G.jsx)(Ce.IconFullscreenOutline16,{size:16})})]})]}),(0,G.jsx)("div",{className:"dsh-ssh-file-preview-body dsh-ssh-scroll-surface",children:(0,G.jsx)(yp,{entry:e,preview:o,error:n,fileUrl:s,downloadUrl:c})})]}),(0,G.jsx)(Ce.Modal,{open:h,onClose:()=>l(!1),title:`\u9884\u89C8 ${e.name}`,headless:!0,className:"dsh-ssh-preview-modal",children:(0,G.jsxs)("section",{className:"dsh-ssh-preview-modal-shell",children:[(0,G.jsxs)("header",{children:[(0,G.jsxs)("span",{children:[(0,G.jsx)("strong",{title:e.name,children:e.name}),(0,G.jsx)("small",{children:kl(e.size)})]}),(0,G.jsxs)("span",{className:"dsh-ssh-file-preview-actions",children:[(0,G.jsx)("a",{href:c,"aria-label":"\u4E0B\u8F7D\u6587\u4EF6",title:"\u4E0B\u8F7D\u6587\u4EF6",children:(0,G.jsx)(Ce.IconDownloadOutline16,{size:16})}),(0,G.jsx)("button",{type:"button","aria-label":"\u5173\u95ED\u9884\u89C8",title:"\u5173\u95ED\u9884\u89C8",onClick:()=>l(!1),children:(0,G.jsx)(Ce.IconCloseOutline16,{size:16})})]})]}),(0,G.jsx)("div",{className:"dsh-ssh-file-preview-body is-modal dsh-ssh-scroll-surface",children:(0,G.jsx)(yp,{entry:e,preview:o,error:n,fileUrl:s,downloadUrl:c})})]})})]})}function yp({entry:e,preview:t,error:s,fileUrl:r,downloadUrl:o}){return s?(0,G.jsx)("p",{className:"dsh-ssh-directory-error",role:"alert",children:s}):t===void 0?(0,G.jsx)("p",{className:"dsh-ssh-sftp-state",children:"\u6B63\u5728\u6253\u5F00\u6587\u4EF6\u2026"}):t.kind==="text"&&t.mimeType==="text/markdown"?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("article",{className:"dsh-ssh-markdown-preview",children:(0,G.jsx)($o,{remarkPlugins:[an],components:{a:i=>(0,G.jsx)("a",{...i,target:"_blank",rel:"noreferrer"})},children:t.text||""})}),t.truncated&&(0,G.jsx)("small",{children:"\u6587\u4EF6\u8F83\u5927\uFF0C\u4EC5\u663E\u793A\u524D 1 MB\u3002\u4E0B\u8F7D\u53EF\u67E5\u770B\u5B8C\u6574\u5185\u5BB9\u3002"})]}):t.kind==="text"?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)("pre",{children:t.text||""}),t.truncated&&(0,G.jsx)("small",{children:"\u6587\u4EF6\u8F83\u5927\uFF0C\u4EC5\u663E\u793A\u524D 1 MB\u3002\u4E0B\u8F7D\u53EF\u67E5\u770B\u5B8C\u6574\u5185\u5BB9\u3002"})]}):t.kind==="image"?(0,G.jsx)("img",{src:r(e.path,!0),alt:e.name}):t.kind==="pdf"?(0,G.jsx)("iframe",{src:r(e.path,!0),title:e.name}):(0,G.jsxs)("div",{className:"dsh-ssh-file-binary",children:[(0,G.jsx)(Ce.IconDataOutline16,{size:24}),(0,G.jsx)("strong",{children:"\u6B64\u6587\u4EF6\u65E0\u6CD5\u76F4\u63A5\u9884\u89C8"}),(0,G.jsx)("p",{children:t.mimeType}),(0,G.jsxs)("a",{href:o,children:[(0,G.jsx)(Ce.IconDownloadOutline16,{size:16}),"\u4E0B\u8F7D\u6587\u4EF6"]})]})}function kl(e){if(e<1024)return`${e} B`;let t=["KB","MB","GB","TB"],s=e/1024,r=0;for(;s>=1024&&r<t.length-1;)s/=1024,r+=1;return`${s>=10?s.toFixed(0):s.toFixed(1)} ${t[r]}`}function z0(e){return new Intl.DateTimeFormat("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(e)}function An(e){return e instanceof Error?e.message:String(e)}function Cp(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-").slice(0,100)}var Ir=class{constructor(t){this.endpoints=t}input="";inputSequence=0;inputScheduled=!1;disposed=!1;sendInput(t,s){this.disposed||!t||(this.input+=t,!this.inputScheduled&&(this.inputScheduled=!0,queueMicrotask(()=>{if(this.inputScheduled=!1,this.disposed)return;let r=this.input;if(this.input="",!r)return;let o=this.inputSequence++;this.deliverInput(r,o,s)})))}observe(t){let s=!1,r=0,o,i,n,a=!1,h=()=>{s||(s=!0,o?.close(),i!==void 0&&clearTimeout(i),n!==void 0&&clearTimeout(n))},l=v=>{s||(r=v.cursor,t.output(v),v.closed&&h())},c=async()=>{if(!s)try{let v=await this.endpoints.read(r);l(v),s||(n=window.setTimeout(()=>{c()},document.hidden?500:v.data?16:64))}catch(v){if(s)return;t.error(v),n=window.setTimeout(()=>{c()},500)}},f=()=>{s||n!==void 0||(o?.close(),o=void 0,c())};return typeof EventSource>"u"?(f(),h):(o=new EventSource(this.endpoints.streamUrl),o.onmessage=v=>{try{let g=H0(v.data);a=!0,i!==void 0&&(clearTimeout(i),i=void 0),l(g)}catch(g){t.error(g),f()}},o.onerror=()=>{!a&&o?.readyState===EventSource.CLOSED&&f()},i=window.setTimeout(()=>{a||f()},1500),h)}dispose(){this.disposed=!0,this.input=""}deliverInput(t,s,r,o=0){this.endpoints.send(t,s).catch(i=>{if(!this.disposed){if(o<2&&$0(i)){window.setTimeout(()=>this.deliverInput(t,s,r,o+1),60*(o+1));return}r(i)}})}};function H0(e){let t=JSON.parse(e);if(typeof t.data!="string"||typeof t.cursor!="number"||!Number.isSafeInteger(t.cursor)||t.cursor<0||typeof t.truncated!="boolean"||typeof t.closed!="boolean")throw new Error("SSH terminal stream returned an invalid event");return t}function $0(e){if(typeof e!="object"||e===null||!("status"in e))return!0;let t=Number(e.status);return!Number.isFinite(t)||t>=500}var Pp=Fr(Tp(),1),U0={background:"#101719",foreground:"#e3eaeb",cursor:"#8aced0",cursorAccent:"#101719",selectionBackground:"#69b6ba40",black:"#101719",red:"#ff453a",green:"#30d158",yellow:"#ffd60a",blue:"#69b6ba",magenta:"#bf5af2",cyan:"#8aced0",white:"#d5dede",brightBlack:"#687a7e",brightRed:"#ff6961",brightGreen:"#66d47e",brightYellow:"#ffe45c",brightBlue:"#8aced0",brightMagenta:"#da8fff",brightCyan:"#b9e5e7",brightWhite:"#f1f5f5"};function Ln(e){return new Pp.Terminal({convertEol:!0,cursorBlink:e.readOnly!==!0,cursorInactiveStyle:"outline",disableStdin:e.readOnly===!0,fontFamily:'"SFMono-Regular", "Cascadia Code", "Liberation Mono", monospace',fontSize:e.compact===!0?12:13,fontWeight:"400",fontWeightBold:"600",letterSpacing:0,lineHeight:1.25,scrollback:e.scrollback,theme:U0})}function On(e,t,s,r){let o,i=!1,n="",a=()=>{if(i||e.clientWidth===0||e.clientHeight===0)return;s.fit(),t.scrollToBottom();let c=`${t.cols}x${t.rows}`;c!==n&&(n=c,r?.(t.cols,t.rows))},h=()=>{o!==void 0&&cancelAnimationFrame(o),o=requestAnimationFrame(()=>{o=void 0,a()})},l=new ResizeObserver(h);return l.observe(e),document.fonts?.ready.then(h).catch(()=>{}),h(),{fit:a,dispose(){i=!0,o!==void 0&&cancelAnimationFrame(o),l.disconnect()}}}var ce=require("react/jsx-runtime");function Rp(e){let t=String(e.sessionId),[s,r]=(0,Ge.useState)(),[o,i]=(0,Ge.useState)(()=>e.controller.requestedView(t)??"local-directory"),[n,a]=(0,Ge.useState)();(0,Ge.useEffect)(()=>e.controller.subscribe(()=>{let l=e.controller.requestedView(t);l!==void 0&&i(l)}),[e.controller,t]);let h=(0,Ge.useCallback)(async()=>{try{let l=await Ql(t);r(l),l.injection?.permission!=="terminal"&&(e.controller.requestedView(t)==="terminals"&&e.controller.open(t,void 0,"local-directory"),i(c=>c==="terminals"?"local-directory":c)),a(void 0)}catch(l){a(De(l))}},[e.controller,t]);return(0,Ge.useEffect)(()=>{let l=!1,c,f=!1,v=async()=>{if(f||(f=!0,await h(),f=!1,l))return;let u=o==="terminals"?2200:3200;c=window.setTimeout(()=>{v()},document.visibilityState==="hidden"?12e3:u)},g=()=>{document.visibilityState!=="visible"||l||(c!==void 0&&window.clearTimeout(c),c=void 0,v())};return document.addEventListener("visibilitychange",g),v(),()=>{l=!0,c!==void 0&&window.clearTimeout(c),document.removeEventListener("visibilitychange",g)}},[h,o]),(0,ce.jsxs)("section",{className:"dsh-ssh-activity-panel","aria-label":"SSH \u6D3B\u52A8",children:[(0,ce.jsxs)("header",{className:"dsh-ssh-activity-header",children:[(0,ce.jsxs)("div",{className:"dsh-ssh-activity-title",children:[(0,ce.jsx)("span",{className:"dsh-ssh-activity-mark",children:(0,ce.jsx)(Ts,{})}),(0,ce.jsxs)("span",{children:[(0,ce.jsx)("strong",{children:"SSH \u6D3B\u52A8"}),(0,ce.jsxs)("small",{children:["\u5F53\u524D\u4F1A\u8BDD \xB7 ",xp(t)]})]})]}),(0,ce.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u5173\u95ED SSH \u6D3B\u52A8",onClick:()=>e.controller.close(t),children:(0,ce.jsx)(as.IconCloseOutline16,{size:16})})]}),s&&(0,ce.jsxs)("nav",{className:"dsh-ssh-activity-tabs","aria-label":"SSH \u6D3B\u52A8\u89C6\u56FE",children:[(0,ce.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:o==="local-directory"?"is-active":"","aria-pressed":o==="local-directory",onClick:()=>e.controller.open(t,void 0,"local-directory"),children:[(0,ce.jsx)(as.IconFolderOpenOutline16,{size:16}),"\u4F1A\u8BDD\u76EE\u5F55"]}),s.profiles.length>0&&(0,ce.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:o==="remote-directory"?"is-active":"","aria-pressed":o==="remote-directory",onClick:()=>e.controller.open(t,void 0,"remote-directory"),children:[(0,ce.jsx)(Ts,{}),"\u8FDC\u7AEF\u76EE\u5F55"]}),s.injection?.permission==="terminal"&&(0,ce.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:o==="terminals"?"is-active":"","aria-pressed":o==="terminals",onClick:()=>e.controller.open(t,void 0,"terminals"),children:[(0,ce.jsx)(as.IconCodeOutline16,{size:16}),"\u7EC8\u7AEF",s.terminals.length>0&&(0,ce.jsx)("em",{children:s.terminals.length})]})]}),(0,ce.jsxs)("div",{className:"dsh-ssh-activity-body",children:[s===void 0?(0,ce.jsx)("p",{className:"dsh-ssh-activity-state",role:"status",children:"\u6B63\u5728\u8BFB\u53D6 SSH \u4F1A\u8BDD\u2026"}):o==="local-directory"?(0,ce.jsx)(wp,{sessionId:t}):o==="remote-directory"?(0,ce.jsx)(V0,{sessionId:t,profiles:s.profiles,selectedProfileId:e.controller.selected(t),onProfile:l=>e.controller.open(t,l,"remote-directory"),onSaved:h}):(0,ce.jsx)(j0,{sessionId:t,terminals:s.terminals,onClosed:h}),n&&(0,ce.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:n})]})]})}function V0({sessionId:e,profiles:t,selectedProfileId:s,onProfile:r,onSaved:o}){let i=t.find(n=>n.id===s)??t[0];return i===void 0?(0,ce.jsxs)("div",{className:"dsh-ssh-activity-empty",children:[(0,ce.jsx)(as.IconFolderOpenOutline16,{size:22}),(0,ce.jsx)("strong",{children:"\u6CA1\u6709\u53EF\u6D4F\u89C8\u7684\u8FDC\u7AEF"}),(0,ce.jsx)("p",{children:"\u8BF7\u5148\u5728 SSH \u9762\u677F\u4E2D\u5141\u8BB8\u5F53\u524D\u4F1A\u8BDD\u8BBF\u95EE\u4E00\u53F0\u4E3B\u673A\u3002"})]}):(0,ce.jsx)(Sp,{sessionId:e,profile:i,profiles:t,onProfile:r,onSaved:o},i.id)}function j0({sessionId:e,terminals:t,onClosed:s}){let r=[...t].reverse().find(g=>g.status.kind==="running")??t.at(-1),[o,i]=(0,Ge.useState)(r?.terminalId),[n,a]=(0,Ge.useState)(),[h,l]=(0,Ge.useState)(),c=t.find(g=>g.terminalId===o)??r;if((0,Ge.useEffect)(()=>{(o===void 0||!t.some(g=>g.terminalId===o))&&i(r?.terminalId)},[r?.terminalId,o,t]),c===void 0)return(0,ce.jsxs)("div",{className:"dsh-ssh-activity-empty",children:[(0,ce.jsx)(as.IconCodeOutline16,{size:22}),(0,ce.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u6253\u5F00\u7684\u7EC8\u7AEF"}),(0,ce.jsx)("p",{children:"AI \u6253\u5F00\u4EA4\u4E92\u7EC8\u7AEF\u540E\uFF0C\u4F1A\u76F4\u63A5\u663E\u793A\u5728\u8FD9\u91CC\u3002"})]});let f=async()=>{if(n===void 0){a(c.terminalId),l(void 0);try{await mh(e,c.terminalId),await s()}catch(g){l(De(g))}finally{a(void 0)}}},v=c.status.kind==="running"?"\u7ED3\u675F":"\u79FB\u9664";return(0,ce.jsxs)("div",{className:"dsh-ssh-terminal-workbench",children:[t.length>1&&(0,ce.jsx)("nav",{className:"dsh-ssh-terminal-switcher dsh-ssh-scroll-surface","aria-label":"SSH \u7EC8\u7AEF",children:t.map((g,u)=>{let d=g.name||`\u7EC8\u7AEF ${u+1}`;return(0,ce.jsxs)("button",{type:"button","data-ssh-interactive":"choice",title:d,className:g.terminalId===c.terminalId?"is-active":"","aria-pressed":g.terminalId===c.terminalId,onClick:()=>i(g.terminalId),children:[(0,ce.jsx)("span",{className:`dsh-ssh-terminal-state-dot is-${g.status.kind}`}),(0,ce.jsx)("span",{className:"dsh-ssh-terminal-switcher-label",children:d})]},g.terminalId)})}),(0,ce.jsxs)("div",{className:"dsh-ssh-terminal-observer",children:[(0,ce.jsxs)("div",{className:"dsh-ssh-terminal-observer-heading",children:[(0,ce.jsxs)("span",{children:[(0,ce.jsx)("strong",{children:c.name}),(0,ce.jsx)("small",{children:c.cwd})]}),(0,ce.jsxs)("div",{className:"dsh-ssh-terminal-observer-actions",children:[(0,ce.jsx)("span",{className:`dsh-ssh-terminal-state is-${c.status.kind}`,children:c.status.kind==="running"?"\u8FD0\u884C\u4E2D":"\u5DF2\u9000\u51FA"}),(0,ce.jsxs)("button",{type:"button",className:"dsh-ssh-terminal-close",disabled:n!==void 0,"aria-label":`${v}\u7EC8\u7AEF ${c.name}`,title:c.status.kind==="running"?"\u7ED3\u675F\u5E76\u5173\u95ED\u8FD9\u4E2A\u7EC8\u7AEF":"\u4ECE\u6D3B\u52A8\u9762\u677F\u79FB\u9664\u8FD9\u4E2A\u7EC8\u7AEF",onClick:()=>{f()},children:[(0,ce.jsx)(as.IconCloseOutline16,{size:14}),(0,ce.jsx)("span",{children:n===c.terminalId?"\u5904\u7406\u4E2D":v})]})]})]}),(0,ce.jsx)(W0,{sessionId:e,terminal:c,onError:l},c.terminalId)]}),h&&(0,ce.jsx)("p",{className:"dsh-ssh-terminal-input-error",role:"alert",children:h})]})}function W0({sessionId:e,terminal:t,onError:s}){let r=(0,Ge.useRef)(null),o=(0,Ge.useRef)();return(0,Ge.useEffect)(()=>{let i=r.current;if(i===null)return;let n=Ln({compact:!0,readOnly:t.status.kind!=="running",scrollback:4e3}),a=new Dp.FitAddon;n.loadAddon(a),n.open(i),o.current=n,n.focus();let h=new Ir({streamUrl:uh(e,t.terminalId),read:v=>dh(e,t.terminalId,v),send:(v,g)=>ch(e,t.terminalId,v,g)}),l=n.onData(v=>h.sendInput(v,g=>s(De(g)))),c=h.observe({output:v=>{v.truncated&&n.reset(),v.data&&n.write(v.data),n.scrollToBottom(),s(void 0)},error:v=>s(De(v))}),f=On(i,n,a,(v,g)=>{fh(e,t.terminalId,v,g).catch(u=>s(De(u)))});return()=>{c(),h.dispose(),l.dispose(),f.dispose(),n.dispose(),o.current=void 0}},[t.terminalId,s,e]),(0,Ge.useEffect)(()=>{let i=o.current;i!==void 0&&(i.options.disableStdin=t.status.kind!=="running")},[t.status.kind]),(0,ce.jsx)("div",{className:"dsh-ssh-terminal-screen","aria-label":"\u4EA4\u4E92\u5F0F SSH \u7EC8\u7AEF",children:(0,ce.jsx)("div",{ref:r,className:"dsh-ssh-terminal-viewport"})})}var Ps=require("react"),St=require("react/jsx-runtime");function Ip({className:e,toolbar:t,notice:s,navigation:r,navigationLabel:o,navigationIcon:i,inspector:n,inspectorLabel:a="\u8BE6\u60C5",inspectorIcon:h,children:l}){let[c,f]=(0,Ps.useState)(),v=(0,Ps.useRef)(null),g=(0,Ps.useRef)(null),u=(0,Ps.useRef)(null),d=()=>{f(void 0),window.requestAnimationFrame(()=>{let p=u.current;p?.isConnected&&p.focus()})},m={closePanel:d,openPanel:p=>f(p)};return(0,Ps.useEffect)(()=>{if(c===void 0)return;u.current=document.activeElement instanceof HTMLElement?document.activeElement:null;let b=(c==="navigation"?v.current:g.current)?.querySelector('input:not(:disabled), button:not(:disabled), select:not(:disabled), textarea:not(:disabled), a[href], [tabindex]:not([tabindex="-1"])');window.requestAnimationFrame(()=>b?.focus());let x=y=>{y.key==="Escape"&&d()};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[c]),(0,St.jsxs)("main",{className:`dsh-ssh-adaptive-workspace${e===void 0?"":` ${e}`}`,"data-panel":c??"none","data-has-inspector":n===void 0?"false":"true",children:[t,s,(0,St.jsxs)("nav",{className:"dsh-ssh-mobile-actions","aria-label":"\u5DE5\u4F5C\u533A\u9762\u677F",children:[(0,St.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":c==="navigation","aria-controls":"dsh-ssh-adaptive-navigation","aria-expanded":c==="navigation",onClick:()=>c==="navigation"?d():f("navigation"),children:[i,(0,St.jsx)("span",{children:o})]}),n!==void 0&&(0,St.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":c==="inspector","aria-controls":"dsh-ssh-adaptive-inspector","aria-expanded":c==="inspector",onClick:()=>c==="inspector"?d():f("inspector"),children:[h,(0,St.jsx)("span",{children:a})]})]}),(0,St.jsxs)("div",{className:"dsh-ssh-adaptive-shell",children:[(0,St.jsx)("aside",{ref:v,id:"dsh-ssh-adaptive-navigation",className:"dsh-ssh-adaptive-navigation","aria-label":o,children:Ap(r,m)}),(0,St.jsx)("section",{className:"dsh-ssh-adaptive-content",children:l}),n!==void 0&&(0,St.jsx)("aside",{ref:g,id:"dsh-ssh-adaptive-inspector",className:"dsh-ssh-adaptive-inspector","aria-label":a,children:Ap(n,m)}),(0,St.jsx)("button",{type:"button",className:"dsh-ssh-adaptive-backdrop","aria-label":"\u5173\u95ED\u9762\u677F",tabIndex:c===void 0?-1:0,onClick:d})]})]})}function Ap(e,t){return typeof e=="function"?e(t):e}var Lp=`.dsh-ssh-adaptive-workspace {
|
|
39
39
|
container: dsh-ssh-workspace/inline-size;
|
|
40
40
|
position: relative;
|
|
41
41
|
display: flex;
|
|
@@ -5547,7 +5547,7 @@ body[data-ds-dark-theme] :is(
|
|
|
5547
5547
|
background: var(--ssh-surface-raised);
|
|
5548
5548
|
}
|
|
5549
5549
|
}
|
|
5550
|
-
`;var Up=require("react");function Vp(e){(0,Up.useEffect)(()=>{let t=e.current,s=t?.parentElement;if(t==null||s===null||s===void 0)return;let r=s,o=!1,i,n=()=>{let a=t.parentElement;for(;a!==null&&a!==document.body;){let h=a.previousElementSibling;if(h instanceof HTMLElement){let l=getComputedStyle(h),c=Number.parseFloat(l.flexGrow);if(l.display==="flex"&&l.flexDirection==="column"&&c>0)return h.insertBefore(t,h.firstChild),t.dataset.dshSshAnchored="true",o=!0,!0}a=a.parentElement}return!1};return n()||(i=new MutationObserver(()=>{n()&&i?.disconnect()}),i.observe(document.body,{childList:!0,subtree:!0})),()=>{i?.disconnect(),delete t.dataset.dshSshAnchored,o&&r.isConnected&&r.append(t)}},[e])}var at=require("react"),Qe=require("@deepseek-ai/dsh-client-ui-primitives");var ls=require("react"),or=require("@deepseek-ai/dsh-client-ui-primitives"),ge=require("react/jsx-runtime");function jp({profile:e,project:t,workspaces:s,currentWorkspaceId:r,recentWorkspaceId:o,returnFocus:i,onClose:n,onCreate:a}){let h=s.some(x=>String(x.workspaceId)===r)?r:s.some(x=>String(x.workspaceId)===o)?o:s[0]===void 0?void 0:String(s[0].workspaceId),[l,c]=(0,ls.useState)(h),[f,v]=(0,ls.useState)(!1),[g,u]=(0,ls.useState)(),d=(0,ls.useRef)(null),m=(0,ls.useRef)(null);(0,ls.useEffect)(()=>((d.current??m.current)?.focus(),()=>{i.isConnected&&i.focus()}),[i]);let p=()=>{f||n()},b=async x=>{if(x.preventDefault(),l!==void 0){v(!0),u(void 0);try{await a(t,l)}catch(y){u(tx(y)),v(!1)}}};return(0,ge.jsx)(or.Modal,{open:!0,onClose:p,title:"\u9009\u62E9\u4F1A\u8BDD\u5F52\u5C5E\u7A7A\u95F4",closeLabel:"\u5173\u95ED",headless:!0,className:"dsh-ssh-session-create-modal",children:(0,ge.jsxs)("section",{className:"dsh-ssh-session-create-shell",onKeyDown:ex,children:[(0,ge.jsxs)("header",{children:[(0,ge.jsxs)("span",{children:[(0,ge.jsx)("h2",{children:"\u65B0\u5EFA\u8FDC\u7AEF\u4F1A\u8BDD"}),(0,ge.jsx)("p",{children:"\u9009\u62E9\u8FD9\u4E2A\u4F1A\u8BDD\u5728 DSH \u4E2D\u5F52\u5C5E\u7684\u672C\u5730\u9879\u76EE"})]}),(0,ge.jsx)("button",{ref:m,type:"button",className:"dsh-ssh-icon-button",disabled:f,onClick:p,"aria-label":"\u5173\u95ED",children:(0,ge.jsx)(or.IconCloseOutline16,{size:16})})]}),(0,ge.jsxs)("form",{onSubmit:x=>{b(x)},children:[(0,ge.jsxs)("dl",{className:"dsh-ssh-session-create-target",children:[(0,ge.jsxs)("div",{children:[(0,ge.jsx)("dt",{children:"\u8FDC\u7AEF\u4E3B\u673A"}),(0,ge.jsxs)("dd",{children:[e.name,(0,ge.jsxs)("small",{children:[e.username,"@",e.host,":",e.port]})]})]}),(0,ge.jsxs)("div",{children:[(0,ge.jsx)("dt",{children:"\u8FDC\u7AEF\u5DE5\u4F5C\u76EE\u5F55"}),(0,ge.jsxs)("dd",{children:[t.name,(0,ge.jsx)("small",{title:t.path,children:t.path})]})]})]}),(0,ge.jsxs)("fieldset",{className:"dsh-ssh-workspace-picker",children:[(0,ge.jsx)("legend",{children:"\u4F1A\u8BDD\u5F52\u5C5E\u7A7A\u95F4"}),(0,ge.jsx)("p",{children:"\u4F1A\u8BDD\u8BB0\u5F55\u4FDD\u5B58\u5728\u6240\u9009 DSH \u9879\u76EE\u4E2D\uFF0CSSH \u547D\u4EE4\u4E0E\u7EC8\u7AEF\u56FA\u5B9A\u4F7F\u7528\u4E0A\u9762\u7684\u8FDC\u7AEF\u76EE\u5F55\u3002"}),s.length===0?(0,ge.jsxs)("div",{className:"dsh-ssh-workspace-picker-empty",children:[(0,ge.jsx)(or.IconFolderClose16,{size:18}),(0,ge.jsxs)("span",{children:[(0,ge.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u53EF\u7528\u7684 DSH \u9879\u76EE"}),(0,ge.jsx)("small",{children:"\u8BF7\u5148\u5173\u95ED\u6B64\u7A97\u53E3\uFF0C\u5728 DSH \u5DE6\u4FA7\u7A7A\u95F4\u4E2D\u65B0\u5EFA\u6216\u6DFB\u52A0\u9879\u76EE\u3002"})]})]}):(0,ge.jsx)("div",{className:"dsh-ssh-workspace-options dsh-ssh-scroll-surface",role:"radiogroup","aria-label":"\u9009\u62E9 DSH \u9879\u76EE",children:s.map(x=>{let y=String(x.workspaceId),S=y===r?"\u5F53\u524D\u9879\u76EE":y===o?"\u6700\u8FD1\u4F7F\u7528":void 0;return(0,ge.jsxs)("label",{className:"dsh-ssh-workspace-option",children:[(0,ge.jsx)("input",{ref:y===h?d:void 0,className:"sr-only",type:"radio",name:"dsh-ssh-session-workspace",value:y,checked:l===y,disabled:f,onChange:()=>c(y)}),(0,ge.jsxs)("span",{children:[(0,ge.jsx)("span",{className:"dsh-ssh-workspace-option-icon",children:(0,ge.jsx)(or.IconFolderClose16,{size:16})}),(0,ge.jsxs)("span",{className:"dsh-ssh-workspace-option-copy",children:[(0,ge.jsx)("strong",{children:x.title}),(0,ge.jsx)("small",{title:x.path,children:x.path})]}),S&&(0,ge.jsx)("em",{children:S}),(0,ge.jsx)("i",{"aria-hidden":"true"})]})]},y)})})]}),g&&(0,ge.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:g}),(0,ge.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,ge.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",disabled:f,onClick:p,children:"\u53D6\u6D88"}),(0,ge.jsx)("button",{type:"submit",className:"dsh-ssh-primary-button",disabled:f||l===void 0,children:f?"\u6B63\u5728\u65B0\u5EFA\u2026":"\u65B0\u5EFA\u5E76\u6253\u5F00"})]})]})]})})}function ex(e){if(e.key!=="Tab")return;let t=Array.from(e.currentTarget.querySelectorAll('button:not(:disabled), input:not(:disabled), a[href], [tabindex]:not([tabindex="-1"])')).filter(o=>o.getClientRects().length>0),s=t[0],r=t[t.length-1];s===void 0||r===void 0||(e.shiftKey&&document.activeElement===s?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),s.focus()))}function tx(e){return e instanceof Error?e.message:String(e)}var te=require("react/jsx-runtime");function Wp(e){let t=_r(),[s,r]=(0,at.useState)(""),[o,i]=(0,at.useState)(()=>new Set),[n,a]=(0,at.useState)(()=>new Set),[h,l]=(0,at.useState)({}),[c,f]=(0,at.useState)(),[v,g]=(0,at.useState)(),[u,d]=(0,at.useState)(),[m,p]=(0,at.useState)(),b=s.trim().toLocaleLowerCase(),x=(0,at.useMemo)(()=>ix(e.profiles.filter(C=>nx(C).includes(b))),[b,e.profiles]),y=async C=>{f(C);try{let P=await Gl(C);l(T=>({...T,[C]:P})),p(void 0)}catch(P){p(Dl(P))}finally{f(P=>P===C?void 0:P)}},S=C=>{a(new Set([C])),h[C]===void 0&&y(C),e.onSelect({profileId:C,path:"~"})},_=C=>{let P=e.access?.profileIds??[],T=P.includes(C);e.onProfiles(T?P.filter(A=>A!==C):[...P,C]),T&&e.onDirectory(C,void 0)},w=C=>i(P=>{let T=new Set(P);return T.has(C)?T.delete(C):T.add(C),T});return(0,te.jsxs)("aside",{ref:t.ref,onPointerMove:t.onPointerMove,onPointerLeave:t.onPointerLeave,className:"dsh-ssh-remote-tree dsh-ssh-border-surface",children:[(0,te.jsxs)("header",{className:"dsh-ssh-tree-header",children:[(0,te.jsxs)("span",{children:[(0,te.jsx)("strong",{children:"\u4E3B\u673A\u4E0E\u9879\u76EE"}),(0,te.jsxs)("small",{children:[e.profiles.length," \u53F0\u4E3B\u673A"]})]}),(0,te.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",onClick:e.onNewProfile,"aria-label":"\u65B0\u5EFA\u8FDE\u63A5",title:"\u65B0\u5EFA\u8FDE\u63A5",children:(0,te.jsx)(Qe.IconPlusOutline16,{size:16})})]}),(0,te.jsxs)("label",{className:"dsh-ssh-search",children:[(0,te.jsx)("span",{className:"sr-only",children:"\u641C\u7D22\u4E3B\u673A"}),(0,te.jsx)("input",{value:s,onChange:C=>r(C.target.value),placeholder:"\u641C\u7D22\u4E3B\u673A\u3001\u5206\u7EC4\u3001\u6807\u7B7E\u2026"})]}),(0,te.jsxs)("div",{className:"dsh-ssh-tree-scroll dsh-ssh-scroll-surface",children:[x.map(C=>{let P=o.has(C.name);return(0,te.jsxs)("section",{className:"dsh-ssh-tree-group","data-collapsed":P,children:[(0,te.jsx)("h3",{children:(0,te.jsxs)("button",{type:"button","aria-expanded":!P,onClick:()=>w(C.name),children:[P?(0,te.jsx)(Qe.IconChevronRightOutline14,{size:14}):(0,te.jsx)(Qe.IconChevronDownOutline14,{size:14}),(0,te.jsx)("span",{children:C.name}),(0,te.jsx)("small",{children:C.profiles.length})]})}),!P&&C.profiles.map(T=>{let A=n.has(T.id),F=e.access?.profileIds.includes(T.id)===!0,B=h[T.id]??[],U=e.selected?.profileId===T.id&&e.selected.projectId===void 0;return(0,te.jsxs)("div",{className:"dsh-ssh-tree-host","data-open":A,children:[(0,te.jsxs)("div",{"data-ssh-interactive":"row","data-ssh-context-row":!0,className:`dsh-ssh-tree-host-row${F?" is-authorized":""}${U?" is-active":""}`,children:[(0,te.jsxs)("button",{type:"button",className:"dsh-ssh-tree-host-main","aria-pressed":U,"aria-expanded":A,title:`\u9009\u62E9\u5E76\u5C55\u5F00 ${T.name}`,onClick:()=>S(T.id),children:[(0,te.jsx)("span",{className:"dsh-ssh-host-monogram",children:T.name.slice(0,1).toUpperCase()}),(0,te.jsxs)("span",{children:[(0,te.jsx)("strong",{children:T.name}),(0,te.jsxs)("small",{children:[T.username,"@",T.host]})]})]}),(0,te.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-tree-mount dsh-ssh-context-action${F?" is-mounted":""}`,"aria-label":`${F?"\u5378\u8F7D":"\u6302\u8F7D"} ${T.name}`,"aria-pressed":F,title:e.access===null?"\u6253\u5F00\u4E00\u4E2A DSH \u4F1A\u8BDD\u540E\u624D\u80FD\u6302\u8F7D\u4E3B\u673A":F?"\u4ECE\u5F53\u524D\u4F1A\u8BDD\u5378\u8F7D":"\u6302\u8F7D\u5230\u5F53\u524D\u4F1A\u8BDD",disabled:e.access===null||e.accessLoading||e.accessSaving,onClick:()=>_(T.id),children:F?"\u5378\u8F7D":"\u6302\u8F7D"}),(0,te.jsx)("button",{type:"button",className:"dsh-ssh-tree-add","aria-label":`\u4E3A ${T.name} \u6DFB\u52A0\u56FA\u5B9A\u76EE\u5F55`,title:"\u6DFB\u52A0\u56FA\u5B9A\u76EE\u5F55",onClick:()=>g({profile:T}),children:(0,te.jsx)(Qe.IconPlusOutline16,{size:14})})]}),A&&(0,te.jsx)("div",{className:"dsh-ssh-tree-branches",children:c===T.id&&h[T.id]===void 0?(0,te.jsx)("p",{className:"dsh-ssh-tree-state",children:"\u6B63\u5728\u8BFB\u53D6\u56FA\u5B9A\u76EE\u5F55\u2026"}):B.length===0?(0,te.jsxs)("button",{type:"button",className:"dsh-ssh-tree-empty",onClick:()=>g({profile:T}),children:[(0,te.jsx)(Qe.IconPlusOutline16,{size:13}),"\u6DFB\u52A0\u9879\u76EE\u76EE\u5F55"]}):B.map(N=>{let H=e.selected?.projectId===N.id,E=e.access?.workingProjectIds[T.id]===N.id;return(0,te.jsx)("div",{className:"dsh-ssh-tree-project",children:(0,te.jsxs)("div",{"data-ssh-interactive":"row",className:`dsh-ssh-tree-project-row${H?" is-active":""}${E?" is-bound":""}`,children:[(0,te.jsxs)("button",{type:"button",className:"dsh-ssh-tree-project-main","aria-pressed":e.access===null?void 0:E,title:e.access===null?"\u5F53\u524D\u6CA1\u6709\u53EF\u56FA\u5B9A\u76EE\u5F55\u7684 DSH \u4F1A\u8BDD":F?E?"\u53D6\u6D88\u5F53\u524D\u4F1A\u8BDD\u7684\u56FA\u5B9A\u76EE\u5F55":"\u56FA\u5B9A\u4E3A\u5F53\u524D\u4F1A\u8BDD\u76EE\u5F55":"\u8BF7\u5148\u6302\u8F7D\u8BE5\u4E3B\u673A",onClick:()=>{F&&!e.accessLoading&&!e.accessSaving&&(e.onDirectory(T.id,E?void 0:N.path,E?void 0:N.id),e.onSelect(E?{profileId:T.id,path:"~"}:{profileId:T.id,path:N.path,projectId:N.id}))},children:[(0,te.jsx)("span",{children:E?(0,te.jsx)(Qe.IconFolderOpenOutline16,{size:15}):(0,te.jsx)(Qe.IconFolderClose16,{size:15})}),(0,te.jsxs)("span",{children:[(0,te.jsx)("strong",{children:N.name}),(0,te.jsx)("small",{children:N.path}),E&&(0,te.jsx)("em",{children:"\u5F53\u524D\u4F1A\u8BDD\u5DF2\u56FA\u5B9A\u8BE5\u8DEF\u5F84"})]})]}),(0,te.jsx)("button",{type:"button",className:"dsh-ssh-tree-project-new","aria-label":`\u5728 ${N.name} \u65B0\u5EFA\u4F1A\u8BDD`,title:"\u65B0\u5EFA\u4F1A\u8BDD",onClick:R=>{p(void 0),d({profile:T,project:N,returnFocus:R.currentTarget})},children:(0,te.jsx)(Qe.IconPlusOutline16,{size:13})}),(0,te.jsx)("button",{type:"button",className:"dsh-ssh-tree-project-edit","aria-label":`\u7F16\u8F91 ${N.name}`,title:"\u7F16\u8F91\u56FA\u5B9A\u76EE\u5F55",onClick:()=>g({profile:T,project:N}),children:(0,te.jsx)(Qe.IconEditOutline16,{size:13})})]})},N.id)})})]},T.id)})]},C.name)}),x.length===0&&(0,te.jsx)("p",{className:"dsh-ssh-tree-no-results",children:e.profiles.length===0?"\u8FD8\u6CA1\u6709 SSH \u4E3B\u673A":"\u6CA1\u6709\u5339\u914D\u7684\u4E3B\u673A"})]}),(0,te.jsx)(sx,{access:e.access,loading:e.accessLoading,saving:e.accessSaving,error:e.accessError??m,onPermission:e.onPermission,onApproval:e.onApproval}),v!==void 0&&(0,te.jsx)(rx,{profile:v.profile,project:v.project,onClose:()=>g(void 0),onSaved:async()=>{let C=v.profile.id;g(void 0),await y(C)}}),u!==void 0&&(0,te.jsx)(jp,{...u,workspaces:e.workspaces,currentWorkspaceId:e.currentWorkspaceId,recentWorkspaceId:e.recentWorkspaceId,onClose:()=>d(void 0),onCreate:e.onCreateSession})]})}function sx({access:e,loading:t,saving:s,error:r,onPermission:o,onApproval:i}){return(0,te.jsxs)("footer",{className:"dsh-ssh-access-footer",children:[(0,te.jsxs)("div",{className:"dsh-ssh-access-heading",children:[(0,te.jsxs)("span",{children:[(0,te.jsx)("strong",{children:"\u5F53\u524D\u4F1A\u8BDD\u6743\u9650"}),(0,te.jsxs)("small",{children:[e?.profileIds.length??0," \u53F0\u4E3B\u673A\u53EF\u7528"]})]}),(0,te.jsx)("em",{children:t?"\u8BFB\u53D6\u4E2D":s?"\u4FDD\u5B58\u4E2D":"\u5DF2\u540C\u6B65"})]}),(0,te.jsxs)("div",{className:"dsh-ssh-access-segments","aria-label":"SSH \u6743\u9650",children:[(0,te.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:e?.permission==="exec"?"is-active":"","aria-pressed":e?.permission==="exec",disabled:e===null,onClick:()=>o("exec"),children:"\u4EC5\u547D\u4EE4"}),(0,te.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:e?.permission==="terminal"?"is-active":"","aria-pressed":e?.permission==="terminal",disabled:e===null,onClick:()=>o("terminal"),children:"\u7EC8\u7AEF\u63A7\u5236"})]}),(0,te.jsxs)("label",{className:"dsh-ssh-access-approval",children:[(0,te.jsxs)("span",{children:[(0,te.jsx)("strong",{children:"\u6267\u884C\u524D\u786E\u8BA4"}),(0,te.jsx)("small",{children:e?.requireCommandApproval===!1?"\u5173\u95ED\u540E\u6309\u5F53\u524D\u4F1A\u8BDD\u6743\u9650\u76F4\u63A5\u6267\u884C":"\u9700 DSH \u4F7F\u7528 Ask\uFF1BFull Access \u4F1A\u76F4\u63A5\u62D2\u7EDD"})]}),(0,te.jsx)("input",{type:"checkbox",checked:e?.requireCommandApproval??!0,disabled:e===null,onChange:n=>i(n.target.checked)}),(0,te.jsx)("i",{"aria-hidden":"true"})]}),r&&(0,te.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:r})]})}function rx({profile:e,project:t,onClose:s,onSaved:r}){let[o,i]=(0,at.useState)(t?.name??""),[n,a]=(0,at.useState)(t?.path??""),[h,l]=(0,at.useState)(!1),[c,f]=(0,at.useState)(),v=async u=>{u.preventDefault(),l(!0),f(void 0);try{t===void 0?await Xl(e.id,{name:o,path:n}):await Jl(e.id,t.id,{name:o,path:n}),await r()}catch(d){f(Dl(d)),l(!1)}},g=async()=>{if(!(t===void 0||!window.confirm(`\u5220\u9664\u56FA\u5B9A\u76EE\u5F55\u201C${t.name}\u201D\uFF1F\u76F8\u5173 DSH \u4F1A\u8BDD\u4E0D\u4F1A\u5220\u9664\u3002`))){l(!0),f(void 0);try{await Yl(e.id,t.id),await r()}catch(u){f(Dl(u)),l(!1)}}};return(0,te.jsx)(Ye,{className:"dsh-ssh-project-dialog",title:t===void 0?"\u6DFB\u52A0\u56FA\u5B9A\u76EE\u5F55":"\u7F16\u8F91\u56FA\u5B9A\u76EE\u5F55",subtitle:`${e.name} \xB7 \u7EC8\u7AEF\u4E0E SFTP \u7684\u9ED8\u8BA4\u8FDC\u7AEF\u8DEF\u5F84`,onClose:s,children:(0,te.jsxs)("form",{className:"dsh-ssh-form",onSubmit:u=>{v(u)},children:[(0,te.jsxs)("label",{className:"dsh-ssh-field",children:[(0,te.jsx)("span",{children:"\u540D\u79F0"}),(0,te.jsx)("input",{required:!0,maxLength:80,value:o,placeholder:"\u7F51\u7AD9\u9879\u76EE",onChange:u=>i(u.target.value)})]}),(0,te.jsxs)("label",{className:"dsh-ssh-field",children:[(0,te.jsx)("span",{children:"\u8FDC\u7AEF\u8DEF\u5F84"}),(0,te.jsx)("input",{required:!0,maxLength:4096,value:n,spellCheck:!1,placeholder:"/var/www/example",onChange:u=>a(u.target.value)}),(0,te.jsx)("small",{children:"\u4FDD\u5B58\u524D\u4F1A\u5728\u53F3\u4FA7 SFTP \u4E2D\u9A8C\u8BC1\u8DEF\u5F84\u662F\u5426\u53EF\u8BBF\u95EE\u3002"})]}),c&&(0,te.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:c}),(0,te.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[t!==void 0&&(0,te.jsxs)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:h,onClick:()=>{g()},children:[(0,te.jsx)(Qe.IconTrashOutline16,{size:15}),"\u5220\u9664"]}),(0,te.jsx)("span",{className:"dsh-ssh-dialog-spacer"}),(0,te.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:h,onClick:s,children:"\u53D6\u6D88"}),(0,te.jsx)("button",{className:"dsh-ssh-primary-button",disabled:h,children:h?"\u4FDD\u5B58\u4E2D\u2026":"\u4FDD\u5B58\u76EE\u5F55"})]})]})})}function ix(e){let t=new Map;for(let s of e){let r=s.group?.trim()||"\u672A\u5206\u7EC4",o=t.get(r);o===void 0?t.set(r,[s]):o.push(s)}return[...t].map(([s,r])=>({name:s,profiles:r}))}function nx(e){return`${e.name} ${e.group??""} ${e.host} ${e.username} ${e.tags.join(" ")}`.toLocaleLowerCase()}function Dl(e){return e instanceof Error?e.message:String(e)}var lt=require("react");var Rl=new Set;function Mn(e){for(let t of Rl)t(e)}function qp(e){return Rl.add(e),()=>Rl.delete(e)}function Gp(e){let[t,s]=(0,lt.useState)(null),[r,o]=(0,lt.useState)(e!==void 0),[i,n]=(0,lt.useState)(!1),[a,h]=(0,lt.useState)(),l=(0,lt.useRef)(null),c=(0,lt.useRef)(e),f=(0,lt.useRef)(Promise.resolve()),v=(0,lt.useRef)(0);c.current=e,(0,lt.useEffect)(()=>{let d=!1;return l.current=null,s(null),h(void 0),o(e!==void 0),e===void 0?()=>{d=!0}:(Si(e).then(m=>{if(d)return;let p=m??bi(e);l.current=p,s(p),Mn(p)}).catch(m=>{d||h(Kp(m))}).finally(()=>{d||o(!1)}),()=>{d=!0})},[e]);let g=(0,lt.useCallback)(async d=>{l.current=d,s(d),Mn(d),h(void 0),v.current+=1,n(!0);let m=f.current.catch(()=>{}).then(()=>ki(d));f.current=m;try{let p=await m;return c.current===p.sessionId&&l.current===d&&(l.current=p,s(p),Mn(p)),p}catch(p){throw c.current===d.sessionId&&h(Kp(p)),p}finally{v.current=Math.max(0,v.current-1),c.current===d.sessionId&&v.current===0&&n(!1)}},[]),u=(0,lt.useCallback)(d=>{let m=c.current;if(m===void 0)return;let p=l.current??bi(m);g({...p,...d,sessionId:m}).catch(()=>{})},[g]);return{value:t,loading:r,saving:i,error:a,setProfiles:d=>u({profileIds:d}),setDirectory:(d,m,p)=>{let b=c.current;if(b===void 0)return;let x=l.current??bi(b),y={...x.workingDirectories},S={...x.workingProjectIds};m===void 0?delete y[d]:y[d]=m,p===void 0?delete S[d]:S[d]=p,u({workingDirectories:y,workingProjectIds:S})},setPermission:d=>u({permission:d}),setRequireCommandApproval:d=>u({requireCommandApproval:d}),setFileEndpoints:d=>u({fileEndpointIds:d}),setFilePermission:d=>u({filePermission:d}),setRequireFileApproval:d=>u({requireFileApproval:d}),replace:g}}function bi(e){return{sessionId:e,profileIds:[],permission:"exec",requireCommandApproval:!0,fileEndpointIds:[],filePermission:"browse",requireFileApproval:!0,workingDirectories:{},workingProjectIds:{},updatedAt:0}}function Kp(e){return e instanceof Error?e.message:String(e)}var ar=require("react"),Bn=require("react/jsx-runtime"),Fn=38,_i=28,xi=66,ox=320,ax=280,lx=7;function Xp(e,t,s){return Math.min(s,Math.max(t,e))}function hx(e){if(typeof window>"u")return Fn;try{let t=Number.parseFloat(window.localStorage.getItem(e)??"");return Number.isFinite(t)?Xp(t,_i,xi):Fn}catch{return Fn}}function Al(e,t){try{window.localStorage.setItem(e,t.toFixed(2))}catch{}}function cx(e){if(e<=0)return{min:_i,max:xi};let t=ax/e*100,s=(e-ox-lx)/e*100,r=Math.max(_i,t),o=Math.max(r,Math.min(xi,s));return{min:r,max:o}}function Jp({primary:e,secondary:t,storageKey:s,label:r}){let[o,i]=(0,ar.useState)(()=>hx(s)),n=(0,ar.useRef)(null),a=(0,ar.useRef)(null),h=(0,ar.useRef)(o),l=(0,ar.useRef)(),c=p=>{let b=n.current;if(b===null)return p;let x=cx(b.getBoundingClientRect().width),y=Xp(p,x.min,x.max);return b.style.setProperty("--ssh-sftp-width",`${y}%`),a.current?.setAttribute("aria-valuenow",String(Math.round(y))),h.current=y,y},f=p=>{if(l.current===void 0)return;let b=a.current;l.current=void 0,p!==void 0&&b?.hasPointerCapture(p)&&b.releasePointerCapture(p),n.current?.classList.remove("is-resizing");let x=h.current;i(x),Al(s,x)},v=p=>{p.button===0&&(l.current=p.pointerId,h.current=o,p.currentTarget.setPointerCapture(p.pointerId),n.current?.classList.add("is-resizing"),p.preventDefault())},g=p=>{if(l.current!==p.pointerId)return;let b=n.current?.getBoundingClientRect();b===void 0||b.width===0||(c((b.right-p.clientX)/b.width*100),p.preventDefault())},u=p=>{let b=p.shiftKey?5:2,x;if(p.key==="ArrowLeft"&&(x=o+b),p.key==="ArrowRight"&&(x=o-b),p.key==="Home"&&(x=_i),p.key==="End"&&(x=xi),x===void 0)return;let y=c(x);i(y),Al(s,y),p.preventDefault()},d=()=>{let p=c(Fn);i(p),Al(s,p)},m={"--ssh-sftp-width":`${o}%`};return(0,Bn.jsxs)("div",{ref:n,className:"dsh-ssh-workbench-split",style:m,children:[e,(0,Bn.jsx)("div",{ref:a,className:"dsh-ssh-workbench-resizer",role:"separator","aria-label":r,"aria-orientation":"vertical","aria-valuemin":_i,"aria-valuemax":xi,"aria-valuenow":Math.round(o),tabIndex:0,title:"\u62D6\u52A8\u8C03\u6574\u5BBD\u5EA6\uFF0C\u53CC\u51FB\u6062\u590D\u9ED8\u8BA4",onDoubleClick:d,onKeyDown:u,onPointerDown:v,onPointerMove:g,onPointerUp:p=>f(p.pointerId),onPointerCancel:p=>f(p.pointerId),onLostPointerCapture:()=>f()}),t]})}var It=require("react"),kt=require("@deepseek-ai/dsh-client-ui-primitives");var K=require("react/jsx-runtime");function Yp({profile:e,dependents:t,onClose:s,onDeleted:r}){let[o,i]=(0,It.useState)(!1),[n,a]=(0,It.useState)(),h=async()=>{if(!(o||t.length>0)){i(!0),a(void 0);try{await oe(`/profiles/${encodeURIComponent(e.id)}`,{method:"DELETE"}),r()}catch(l){a(De(l))}finally{i(!1)}}};return(0,K.jsx)(Ye,{title:`\u5220\u9664 ${e.name}`,subtitle:Yt(e),onClose:s,children:(0,K.jsxs)("div",{className:"dsh-ssh-delete-profile",children:[(0,K.jsx)("span",{className:"dsh-ssh-delete-profile-mark",children:(0,K.jsx)(kt.IconTrashOutline16,{size:19})}),(0,K.jsxs)("div",{children:[(0,K.jsx)("strong",{children:"\u8FD9\u4E2A\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500"}),(0,K.jsx)("p",{children:"\u8FDE\u63A5\u914D\u7F6E\u3001\u8BE5\u4E3B\u673A\u7684\u72EC\u7ACB\u51ED\u636E\u548C\u5173\u8054\u7AEF\u53E3\u8F6C\u53D1\u4F1A\u4E00\u5E76\u5220\u9664\uFF1B\u5B83\u4E5F\u4F1A\u4ECE\u6240\u6709\u4F1A\u8BDD\u6388\u6743\u4E2D\u79FB\u9664\u3002\u5BC6\u94A5\u5E93\u4E2D\u7684\u5171\u4EAB\u51ED\u636E\u4E0D\u4F1A\u5220\u9664\u3002"})]}),t.length>0&&(0,K.jsxs)("div",{className:"dsh-ssh-delete-profile-block",role:"alert",children:[(0,K.jsx)("strong",{children:"\u6682\u65F6\u4E0D\u80FD\u5220\u9664"}),(0,K.jsxs)("p",{children:["\u4EE5\u4E0B\u8FDE\u63A5\u4ECD\u5C06\u5B83\u4F5C\u4E3A SSH \u8DF3\u677F\uFF1A",t.map(l=>l.name).join("\u3001"),"\u3002\u8BF7\u5148\u4FEE\u6539\u8FD9\u4E9B\u8FDE\u63A5\u7684\u8DF3\u677F\u94FE\u3002"]})]}),n&&(0,K.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:n}),(0,K.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,K.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:o,onClick:s,children:"\u53D6\u6D88"}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:o||t.length>0,onClick:()=>{h()},children:o?"\u6B63\u5728\u5220\u9664\u2026":"\u5220\u9664\u4E3B\u673A"})]})]})})}function Qp({profile:e,profiles:t,vaultEntries:s,proxyEntries:r,onClose:o,onSaved:i}){let[n,a]=(0,It.useState)(()=>({name:e?.name??"",group:e?.group??"",host:e?.host??"",port:String(e?.port??22),username:e?.username??"",authType:e?.authType??"password",credentialId:e?.credentialId??"",proxyType:e?.proxy.type??"none",proxyEntryId:e?.proxy.type==="saved"?e.proxy.proxyId:"",proxyHost:e?.proxy.type==="http"||e?.proxy.type==="socks5"?e.proxy.host:"",proxyPort:e?.proxy.type==="http"||e?.proxy.type==="socks5"?String(e.proxy.port):"1080",proxyUsername:e?.proxy.type==="http"||e?.proxy.type==="socks5"?e.proxy.username??"":"",jumpProfileIds:e?.proxy.type==="jump"?e.proxy.profileIds:[],tags:e?.tags.join(", ")??"",password:"",privateKey:"",passphrase:"",proxyPassword:"",hostFingerprint:e?.hostFingerprint??""})),[h,l]=(0,It.useState)(!1),[c,f]=(0,It.useState)(!1),[v,g]=(0,It.useState)(),[u,d]=(0,It.useState)(),[m,p]=(0,It.useState)(),b=P=>({value:n[P],onChange:T=>{a(A=>({...A,[P]:T.target.value})),g(void 0),d(void 0)}}),x=s.find(P=>P.id===n.credentialId),y=(0,It.useMemo)(()=>t.flatMap(P=>P.group===void 0?[]:[P.group]),[t]),S=(0,It.useMemo)(()=>t.flatMap(P=>P.tags),[t]),_=(P=n.hostFingerprint)=>{let T=n.proxyType==="none"?{type:"none"}:n.proxyType==="saved"?{type:"saved",proxyId:n.proxyEntryId}:n.proxyType==="jump"?{type:"jump",profileIds:n.jumpProfileIds}:{type:n.proxyType,host:n.proxyHost,port:Number(n.proxyPort),...n.proxyUsername.trim()?{username:n.proxyUsername.trim()}:{}};return{profile:{name:n.name,...n.group.trim()?{group:n.group.trim()}:{},host:n.host,port:Number(n.port),username:x?.username??n.username,authType:x?.authType??n.authType,...n.credentialId?{credentialId:n.credentialId}:{},...P?{hostFingerprint:P}:{},proxy:T,keepAliveIntervalMs:e?.keepAliveIntervalMs??15e3,connectTimeoutMs:e?.connectTimeoutMs??15e3,terminalType:e?.terminalType??"xterm-256color",tags:n.tags.split(",").map(A=>A.trim()).filter(Boolean)},secrets:{password:n.password,privateKey:n.privateKey,passphrase:n.passphrase,proxyPassword:n.proxyPassword}}},w=async P=>{f(!0),p(void 0),g(void 0),d(void 0);try{await oe("/profiles/test-draft",{method:"POST",body:JSON.stringify({..._(P),...e===void 0?{}:{profileId:e.id}})}),P!==void 0&&a(T=>({...T,hostFingerprint:P})),g("success")}catch(T){T instanceof cs&&T.body?.code==="HOST_KEY_REQUIRED"&&typeof T.body.fingerprint=="string"?d(T.body.fingerprint):p(De(T))}finally{f(!1)}},C=async P=>{P.preventDefault(),l(!0),p(void 0);try{await oe(e===void 0?"/profiles":`/profiles/${e.id}`,{method:e===void 0?"POST":"PUT",body:JSON.stringify(_())}),i()}catch(T){p(De(T))}finally{l(!1)}};return(0,K.jsx)(Ye,{title:e===void 0?"\u65B0\u5EFA SSH \u8FDE\u63A5":`\u7F16\u8F91 ${e.name}`,subtitle:"\u51ED\u636E\u4FDD\u5B58\u540E\u4E0D\u4F1A\u56DE\u663E",onClose:o,children:(0,K.jsxs)("form",{className:"dsh-ssh-form",onSubmit:P=>{C(P)},children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section",children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,K.jsx)("strong",{children:"\u8FDE\u63A5\u4FE1\u606F"}),(0,K.jsx)("small",{children:"\u4E3B\u673A\u5730\u5740\u4E0E\u663E\u793A\u65B9\u5F0F"})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,K.jsx)(le,{label:"\u540D\u79F0",children:(0,K.jsx)("input",{required:!0,maxLength:80,placeholder:"\u5F00\u53D1\u670D\u52A1\u5668",...b("name")})}),(0,K.jsx)(le,{label:"\u5206\u7EC4",children:(0,K.jsx)(Rr,{ariaLabel:"\u4E3B\u673A\u5206\u7EC4",maxLength:64,options:y,placeholder:"\u9009\u62E9\u5DF2\u6709\u5206\u7EC4\u6216\u8F93\u5165\u65B0\u5206\u7EC4",value:n.group,onChange:P=>a(T=>({...T,group:P}))})})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,K.jsx)(le,{label:"\u4E3B\u673A",children:(0,K.jsx)("input",{required:!0,placeholder:"server.example.com",spellCheck:!1,...b("host")})}),(0,K.jsx)(le,{label:"\u7AEF\u53E3",children:(0,K.jsx)("input",{required:!0,type:"number",inputMode:"numeric",min:"1",max:"65535",...b("port")})})]}),(0,K.jsx)(le,{label:"\u6807\u7B7E",hint:"\u53EF\u9009\u62E9\u5DF2\u6709\u6807\u7B7E\u6216\u76F4\u63A5\u8F93\u5165\uFF1B\u591A\u4E2A\u6807\u7B7E\u4F7F\u7528\u9017\u53F7\u5206\u9694\u3002",children:(0,K.jsx)(Rr,{ariaLabel:"\u4E3B\u673A\u6807\u7B7E",multiple:!0,options:S,placeholder:"\u9009\u62E9\u6216\u8F93\u5165\u6807\u7B7E",value:n.tags,onChange:P=>a(T=>({...T,tags:P}))})})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-section",children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,K.jsx)("strong",{children:"\u8EAB\u4EFD\u8BA4\u8BC1"}),(0,K.jsx)("small",{children:"\u9009\u62E9\u5171\u4EAB\u51ED\u636E\u6216\u5355\u72EC\u4FDD\u5B58"})]}),(0,K.jsx)(le,{label:"\u51ED\u636E\u6765\u6E90",hint:"\u53EF\u4F7F\u7528\u6B64\u8FDE\u63A5\u81EA\u5DF1\u7684\u51ED\u636E\uFF0C\u6216\u5F15\u7528\u5BC6\u94A5\u5E93\u4E2D\u7684\u5E38\u7528\u8D26\u53F7\u3002",children:(0,K.jsxs)("select",{...b("credentialId"),children:[(0,K.jsx)("option",{value:"",children:"\u6B64\u8FDE\u63A5\u72EC\u7ACB\u4FDD\u5B58"}),s.map(P=>(0,K.jsxs)("option",{value:P.id,children:[P.name," \xB7 ",P.username]},P.id))]})}),x?(0,K.jsxs)("div",{className:"dsh-ssh-credential-reference",children:[(0,K.jsx)("span",{children:(0,K.jsx)(kt.IconUserOutline16,{size:16})}),(0,K.jsxs)("span",{children:[(0,K.jsx)("strong",{children:x.name}),(0,K.jsxs)("small",{children:[x.username," \xB7 ",x.authType==="password"?"\u5BC6\u7801":"\u79C1\u94A5"]})]}),(0,K.jsx)("em",{children:x.credential.configured?"\u5DF2\u5C31\u7EEA":"\u7F3A\u5C11\u51ED\u636E"})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,K.jsx)(le,{label:"\u7528\u6237\u540D",children:(0,K.jsx)("input",{required:!0,autoComplete:"username",...b("username")})}),(0,K.jsx)(le,{label:"\u8BA4\u8BC1\u65B9\u5F0F",children:(0,K.jsxs)("select",{...b("authType"),children:[(0,K.jsx)("option",{value:"password",children:"\u5BC6\u7801"}),(0,K.jsx)("option",{value:"private-key",children:"\u79C1\u94A5"}),(0,K.jsx)("option",{value:"agent",children:"SSH Agent"})]})})]}),n.authType==="password"&&(0,K.jsx)(le,{label:"\u5BC6\u7801",hint:e?.credential.source==="profile"&&e.credential.fields.includes("password")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u4FDD\u5B58\u540E\u4E0D\u53EF\u8BFB\u56DE",children:(0,K.jsx)("input",{required:e===void 0,type:"password",autoComplete:"new-password",placeholder:e?.credential.source==="profile"&&e.credential.fields.includes("password")?"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022":"",...b("password")})}),n.authType==="private-key"&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(le,{label:"\u79C1\u94A5",hint:e?.credential.source==="profile"&&e.credential.fields.includes("privateKey")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u7C98\u8D34 OpenSSH/PEM \u79C1\u94A5",children:(0,K.jsx)("textarea",{required:e===void 0,rows:5,spellCheck:!1,...b("privateKey")})}),(0,K.jsx)(le,{label:"\u79C1\u94A5\u53E3\u4EE4",children:(0,K.jsx)("input",{type:"password",autoComplete:"new-password",...b("passphrase")})})]})]})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-section",children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,K.jsx)("strong",{children:"\u8FDE\u63A5\u8DEF\u5F84"}),(0,K.jsx)("small",{children:"\u76F4\u8FDE\u3001\u4EE3\u7406\u6216\u8DF3\u677F\u94FE"})]}),(0,K.jsx)(le,{label:"\u8FDE\u63A5\u65B9\u5F0F",children:(0,K.jsxs)("select",{...b("proxyType"),children:[(0,K.jsx)("option",{value:"none",children:"\u76F4\u8FDE"}),(0,K.jsx)("option",{value:"saved",children:"\u5E38\u7528\u4EE3\u7406"}),(0,K.jsx)("option",{value:"http",children:"\u81EA\u5B9A\u4E49 HTTP CONNECT"}),(0,K.jsx)("option",{value:"socks5",children:"\u81EA\u5B9A\u4E49 SOCKS5"}),(0,K.jsx)("option",{value:"jump",children:"SSH \u8DF3\u677F"})]})}),n.proxyType==="saved"&&(0,K.jsx)(le,{label:"\u5E38\u7528\u4EE3\u7406",hint:r.length===0?"\u8BF7\u5148\u5728\u4EE3\u7406\u5E93\u4E2D\u6DFB\u52A0 HTTP \u6216 SOCKS5 \u4EE3\u7406\u3002":"\u591A\u53F0\u4E3B\u673A\u53EF\u5F15\u7528\u540C\u4E00\u6761\u4EE3\u7406\u914D\u7F6E\u3002",children:(0,K.jsxs)("select",{required:!0,...b("proxyEntryId"),children:[(0,K.jsx)("option",{value:"",children:"\u9009\u62E9\u4EE3\u7406"}),r.map(P=>(0,K.jsxs)("option",{value:P.id,children:[P.name," \xB7 ",P.proxyType==="http"?"HTTP":"SOCKS5"," \xB7 ",P.host,":",P.port]},P.id))]})}),(n.proxyType==="http"||n.proxyType==="socks5")&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,K.jsx)(le,{label:"\u4EE3\u7406\u4E3B\u673A",children:(0,K.jsx)("input",{required:!0,spellCheck:!1,...b("proxyHost")})}),(0,K.jsx)(le,{label:"\u4EE3\u7406\u7AEF\u53E3",children:(0,K.jsx)("input",{required:!0,type:"number",inputMode:"numeric",min:"1",max:"65535",...b("proxyPort")})})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,K.jsx)(le,{label:"\u4EE3\u7406\u7528\u6237\u540D",children:(0,K.jsx)("input",{autoComplete:"username",...b("proxyUsername")})}),(0,K.jsx)(le,{label:"\u4EE3\u7406\u5BC6\u7801",children:(0,K.jsx)("input",{type:"password",autoComplete:"new-password",...b("proxyPassword")})})]})]}),n.proxyType==="jump"&&(0,K.jsx)(dx,{profiles:t.filter(P=>P.id!==e?.id),value:n.jumpProfileIds,onChange:P=>a(T=>({...T,jumpProfileIds:P}))})]}),u&&(0,K.jsxs)("div",{className:"dsh-ssh-test-result is-warning",role:"alert",children:[(0,K.jsxs)("span",{children:[(0,K.jsx)("strong",{children:"\u9996\u6B21\u8FDE\u63A5\uFF0C\u8BF7\u6838\u5BF9\u4E3B\u673A\u6307\u7EB9"}),(0,K.jsx)("code",{children:u})]}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-small-primary",disabled:c,onClick:()=>{w(u)},children:"\u786E\u8BA4\u5E76\u91CD\u8BD5"})]}),v==="success"&&(0,K.jsxs)("p",{className:"dsh-ssh-test-result is-success",role:"status",children:[(0,K.jsx)(kt.IconCheckOutline14,{size:14}),"\u8FDE\u63A5\u6D4B\u8BD5\u6210\u529F"]}),m&&(0,K.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:m}),(0,K.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,K.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button dsh-ssh-test-button",disabled:h||c,onClick:P=>{P.currentTarget.form?.reportValidity()&&w()},children:c?"\u6B63\u5728\u6D4B\u8BD5\u2026":"\u6D4B\u8BD5\u8FDE\u63A5"}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:h||c,onClick:o,children:"\u53D6\u6D88"}),(0,K.jsx)("button",{className:"dsh-ssh-primary-button",disabled:h||c,children:h?"\u6B63\u5728\u4FDD\u5B58\u2026":"\u4FDD\u5B58\u8FDE\u63A5"})]})]})})}function dx({profiles:e,value:t,onChange:s}){let r=()=>{let n=e.find(a=>!t.includes(a.id));n!==void 0&&t.length<8&&s([...t,n.id])},o=(n,a)=>s(t.map((h,l)=>l===n?a:h)),i=(n,a)=>{let h=n+a;if(h<0||h>=t.length)return;let l=[...t];[l[n],l[h]]=[l[h],l[n]],s(l)};return(0,K.jsxs)("fieldset",{className:"dsh-ssh-jump-chain",children:[(0,K.jsx)("legend",{children:"\u8DF3\u677F\u94FE"}),(0,K.jsx)("p",{children:"\u8FDE\u63A5\u4F1A\u6309\u4ECE\u4E0A\u5230\u4E0B\u7684\u987A\u5E8F\u9010\u7EA7\u5EFA\u7ACB\u3002"}),(0,K.jsx)("div",{children:t.map((n,a)=>(0,K.jsxs)("div",{className:"dsh-ssh-jump-row",children:[(0,K.jsx)("em",{children:a+1}),(0,K.jsxs)("select",{required:!0,value:n,onChange:h=>o(a,h.target.value),children:[(0,K.jsx)("option",{value:"",children:"\u9009\u62E9\u5DF2\u6709\u8FDE\u63A5"}),e.filter(h=>h.id===n||!t.includes(h.id)).map(h=>(0,K.jsxs)("option",{value:h.id,children:[h.name," \xB7 ",h.host]},h.id))]}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",disabled:a===0,"aria-label":"\u4E0A\u79FB\u8DF3\u677F",onClick:()=>i(a,-1),children:(0,K.jsx)(kt.IconChevronUpOutline14,{size:14})}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",disabled:a===t.length-1,"aria-label":"\u4E0B\u79FB\u8DF3\u677F",onClick:()=>i(a,1),children:(0,K.jsx)(kt.IconChevronDownOutline14,{size:14})}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":"\u79FB\u9664\u8DF3\u677F",onClick:()=>s(t.filter((h,l)=>l!==a)),children:(0,K.jsx)(kt.IconTrashOutline16,{size:15})})]},`${n}-${a}`))}),t.length===0&&(0,K.jsx)("p",{className:"dsh-ssh-jump-empty",children:"\u81F3\u5C11\u6DFB\u52A0\u4E00\u53F0\u8DF3\u677F\u4E3B\u673A\u3002"}),(0,K.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",disabled:t.length>=8||e.every(n=>t.includes(n.id)),onClick:r,children:[(0,K.jsx)(kt.IconPlusOutline16,{size:15}),"\u6DFB\u52A0\u8DF3\u677F"]})]})}var be=require("react"),Ot=require("@deepseek-ai/dsh-client-ui-primitives");var Ct=require("react"),Lt=require("@deepseek-ai/dsh-client-ui-primitives");var j=require("react/jsx-runtime");function Zp({profiles:e,vaultEntries:t,proxyEntries:s,onClose:r,onChanged:o}){let[i,n]=(0,Ct.useState)(),[a,h]=(0,Ct.useState)(),[l,c]=(0,Ct.useState)(),f=i!==void 0||a!==void 0,v=m=>{h(void 0),n(m),c(void 0)},g=()=>{h(void 0),n("new"),c(void 0)},u=m=>{n(void 0),h(m),c(void 0)},d=async m=>{c(void 0);try{await oe(`/ftp-profiles/${encodeURIComponent(m.id)}`,{method:"DELETE"}),h(void 0),o()}catch(p){c(De(p))}};return(0,j.jsx)(Ye,{className:"dsh-ssh-ftp-manager-dialog",title:"\u6587\u4EF6\u8FDE\u63A5",subtitle:"\u7BA1\u7406 FTP \u4E0E FTPS\uFF1BSFTP \u76F4\u63A5\u590D\u7528\u5DF2\u6709 SSH \u4E3B\u673A",onClose:r,children:(0,j.jsxs)("div",{className:`dsh-ssh-ftp-manager${f?" has-detail":""}`,children:[(0,j.jsxs)("aside",{className:"dsh-ssh-ftp-manager-list",children:[(0,j.jsxs)("header",{children:[(0,j.jsxs)("span",{children:[(0,j.jsx)("strong",{children:"FTP / FTPS"}),(0,j.jsxs)("small",{children:[e.length," \u4E2A\u8FDE\u63A5"]})]}),(0,j.jsxs)("button",{type:"button",className:"dsh-ssh-primary-button",onClick:g,children:[(0,j.jsx)(Lt.IconPlusOutline16,{size:15}),"\u65B0\u5EFA"]})]}),e.length===0?(0,j.jsxs)("div",{className:"dsh-ssh-ftp-list-empty",children:[(0,j.jsx)("span",{children:(0,j.jsx)(Lt.IconDataOutline16,{size:20})}),(0,j.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u72EC\u7ACB\u6587\u4EF6\u8FDE\u63A5"}),(0,j.jsx)("p",{children:"SFTP \u4F1A\u663E\u793A\u5728\u6587\u4EF6\u7A97\u683C\u7684\u8FDE\u63A5\u5217\u8868\u4E2D\uFF1B\u8FD9\u91CC\u53EA\u7BA1\u7406 FTP \u4E0E FTPS\u3002"}),(0,j.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:g,children:"\u65B0\u5EFA FTPS \u8FDE\u63A5"})]}):(0,j.jsx)("div",{className:"dsh-ssh-ftp-profile-list",role:"list",children:e.map(m=>{let p=i!=="new"&&i?.id===m.id||a?.id===m.id;return(0,j.jsxs)("article",{role:"listitem","data-ssh-interactive":"choice","aria-selected":p,className:p?"is-active":"",children:[(0,j.jsxs)("button",{type:"button",className:"dsh-ssh-ftp-profile-main",onClick:()=>v(m),children:[(0,j.jsx)("span",{className:`dsh-ssh-protocol-badge is-${m.protocol}`,children:fx(m.protocol)}),(0,j.jsxs)("span",{children:[(0,j.jsx)("strong",{title:m.name,children:m.name}),(0,j.jsxs)("small",{title:`${m.username}@${m.host}:${m.port}`,children:[m.username,"@",m.host,":",m.port]})]}),(0,j.jsx)("i",{className:m.credential.configured?"is-ready":"is-missing",children:m.credential.configured?"\u53EF\u7528":"\u7F3A\u5C11\u5BC6\u7801"})]}),(0,j.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":`\u5220\u9664 ${m.name}`,onClick:()=>u(m),children:(0,j.jsx)(Lt.IconTrashOutline16,{size:15})})]},m.id)})})]}),(0,j.jsx)("main",{className:"dsh-ssh-ftp-manager-detail",children:a!==void 0?(0,j.jsx)(ux,{profile:a,error:l,onBack:()=>h(void 0),onDelete:()=>d(a)}):i!==void 0?(0,j.jsx)(px,{value:i==="new"?void 0:i,profiles:e,vaultEntries:t,proxyEntries:s,onBack:()=>n(void 0),onSaved:()=>{n(void 0),o()}},i==="new"?"new":i.id):(0,j.jsxs)("div",{className:"dsh-ssh-ftp-manager-overview",children:[(0,j.jsx)("span",{children:(0,j.jsx)(Lt.IconDataOutline16,{size:22})}),(0,j.jsx)("h3",{children:"\u9009\u62E9\u4E00\u4E2A\u8FDE\u63A5\u8FDB\u884C\u7F16\u8F91"}),(0,j.jsx)("p",{children:"\u6587\u4EF6\u7A97\u683C\u4F1A\u628A\u8FD9\u91CC\u4FDD\u5B58\u7684 FTP\u3001FTPS \u4E0E SSH \u4E3B\u673A\u63D0\u4F9B\u7684 SFTP \u6C47\u603B\u6210\u8FDE\u63A5\u5217\u8868\u3002"}),(0,j.jsxs)("dl",{children:[(0,j.jsxs)("div",{children:[(0,j.jsx)("dt",{children:"FTPS"}),(0,j.jsx)("dd",{children:"\u52A0\u5BC6\u63A7\u5236\u4E0E\u6587\u4EF6\u6570\u636E\uFF0C\u9ED8\u8BA4\u4E25\u683C\u6821\u9A8C\u8BC1\u4E66"})]}),(0,j.jsxs)("div",{children:[(0,j.jsx)("dt",{children:"FTP"}),(0,j.jsx)("dd",{children:"\u517C\u5BB9\u65E7\u670D\u52A1\u5668\uFF0C\u4F46\u8D26\u53F7\u548C\u6587\u4EF6\u5185\u5BB9\u4E0D\u52A0\u5BC6"})]}),(0,j.jsxs)("div",{children:[(0,j.jsx)("dt",{children:"SFTP"}),(0,j.jsx)("dd",{children:"\u7531 SSH \u4E3B\u673A\u7BA1\u7406\uFF0C\u4E0D\u5728\u8FD9\u91CC\u91CD\u590D\u914D\u7F6E"})]})]})]})})]})})}function ux({profile:e,error:t,onBack:s,onDelete:r}){let[o,i]=(0,Ct.useState)(!1);return(0,j.jsxs)("div",{className:"dsh-ssh-ftp-delete-panel",children:[(0,j.jsxs)("button",{type:"button",className:"dsh-ssh-ftp-detail-back",onClick:s,children:[(0,j.jsx)(Lt.IconChevronLeftOutline14,{size:14}),"\u8FD4\u56DE\u8FDE\u63A5\u5217\u8868"]}),(0,j.jsx)("span",{className:"dsh-ssh-ftp-delete-mark",children:(0,j.jsx)(Lt.IconWarningOutline16,{size:20})}),(0,j.jsxs)("h3",{children:["\u5220\u9664\u201C",e.name,"\u201D\uFF1F"]}),(0,j.jsx)("p",{children:"\u5C06\u79FB\u9664\u8BE5 FTP/FTPS \u8FDE\u63A5\u53CA\u5176\u72EC\u7ACB\u4FDD\u5B58\u7684\u5BC6\u7801\uFF0C\u4E0D\u4F1A\u5220\u9664\u8FDC\u7AEF\u670D\u52A1\u5668\u4E0A\u7684\u4EFB\u4F55\u6587\u4EF6\u3002"}),(0,j.jsxs)("code",{children:[e.username,"@",e.host,":",e.port]}),t&&(0,j.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:t}),(0,j.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,j.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:s,disabled:o,children:"\u53D6\u6D88"}),(0,j.jsx)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:o,onClick:()=>{i(!0),r().finally(()=>i(!1))},children:o?"\u6B63\u5728\u5220\u9664\u2026":"\u5220\u9664\u8FDE\u63A5"})]})]})}function px({value:e,profiles:t,vaultEntries:s,proxyEntries:r,onBack:o,onSaved:i}){let n=s.filter(w=>w.authType==="password"),[a,h]=(0,Ct.useState)({name:e?.name??"",group:e?.group??"",protocol:e?.protocol??"ftps-explicit",host:e?.host??"",port:String(e?.port??21),username:e?.username??"",credentialId:e?.credentialId??"",password:"",proxyId:e?.proxy.type==="saved"?e.proxy.proxyId:"",initialPath:e?.initialPath??"/",connectTimeoutMs:String(e?.connectTimeoutMs??15e3),tlsServerName:e?.tlsServerName??"",tags:e?.tags.join(", ")??""}),[l,c]=(0,Ct.useState)(!1),[f,v]=(0,Ct.useState)(!1),[g,u]=(0,Ct.useState)(),[d,m]=(0,Ct.useState)(),p=()=>({profile:{name:a.name,...a.group.trim()?{group:a.group.trim()}:{},protocol:a.protocol,host:a.host,port:Number(a.port),username:a.username,...a.credentialId?{credentialId:a.credentialId}:{},proxy:a.proxyId?{type:"saved",proxyId:a.proxyId}:{type:"none"},initialPath:a.initialPath,connectTimeoutMs:Number(a.connectTimeoutMs),...a.tlsServerName.trim()?{tlsServerName:a.tlsServerName.trim()}:{},tags:a.tags.split(/[,,]/u).map(w=>w.trim()).filter(Boolean)},secrets:{password:a.password}}),b=async w=>{w.preventDefault(),c(!0),m(void 0),u(void 0);try{await oe(e===void 0?"/ftp-profiles":`/ftp-profiles/${encodeURIComponent(e.id)}`,{method:e===void 0?"POST":"PUT",body:JSON.stringify(p())}),i()}catch(C){m(De(C))}finally{c(!1)}},x=async()=>{v(!0),m(void 0),u(void 0);try{await oe("/ftp-profiles/test-draft",{method:"POST",body:JSON.stringify({...p(),...e===void 0?{}:{profileId:e.id}})}),u("\u8FDE\u63A5\u6210\u529F\uFF0C\u521D\u59CB\u76EE\u5F55\u53EF\u8BFB\u53D6")}catch(w){m(De(w))}finally{v(!1)}},y=w=>h(C=>({...C,protocol:w,port:C.port==="21"||C.port==="990"?String(w==="ftps-implicit"?990:21):C.port})),S=(0,Ct.useMemo)(()=>t.flatMap(w=>w.group===void 0?[]:[w.group]),[t]),_=(0,Ct.useMemo)(()=>t.flatMap(w=>w.tags),[t]);return(0,j.jsxs)("form",{className:"dsh-ssh-ftp-editor-form",onSubmit:w=>{b(w)},children:[(0,j.jsxs)("header",{className:"dsh-ssh-ftp-editor-heading",children:[(0,j.jsxs)("button",{type:"button",className:"dsh-ssh-ftp-detail-back",onClick:o,children:[(0,j.jsx)(Lt.IconChevronLeftOutline14,{size:14}),"\u8FD4\u56DE\u8FDE\u63A5\u5217\u8868"]}),(0,j.jsxs)("span",{children:[(0,j.jsx)("strong",{children:e===void 0?"\u65B0\u5EFA\u6587\u4EF6\u8FDE\u63A5":e.name}),(0,j.jsx)("small",{children:e===void 0?"\u586B\u5199\u670D\u52A1\u5668\u548C\u8BA4\u8BC1\u4FE1\u606F":"\u4FEE\u6539\u540E\u53EF\u5148\u6D4B\u8BD5\u518D\u4FDD\u5B58"})]})]}),(0,j.jsxs)("div",{className:"dsh-ssh-ftp-editor-scroll",children:[(0,j.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,j.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,j.jsx)("strong",{children:"\u8FDE\u63A5\u7C7B\u578B"}),(0,j.jsx)("small",{children:"\u4F18\u5148\u4F7F\u7528 FTPS\uFF1B\u4EC5\u5728\u670D\u52A1\u5668\u4E0D\u652F\u6301 TLS \u65F6\u9009\u62E9 FTP"})]}),(0,j.jsx)("div",{className:"dsh-ssh-ftp-protocol-options",role:"radiogroup","aria-label":"\u8FDE\u63A5\u534F\u8BAE",children:[["ftps-explicit","FTPS","\u663E\u5F0F TLS \xB7 \u63A8\u8350"],["ftps-implicit","FTPS-I","\u9690\u5F0F TLS"],["ftp","FTP","\u672A\u52A0\u5BC6"]].map(w=>(0,j.jsxs)("button",{type:"button","data-ssh-interactive":"choice",role:"radio","aria-checked":a.protocol===w[0],className:a.protocol===w[0]?"is-active":"",onClick:()=>y(w[0]),children:[(0,j.jsx)("span",{className:`dsh-ssh-protocol-badge is-${w[0]}`,children:w[1]}),(0,j.jsxs)("span",{children:[(0,j.jsx)("strong",{children:w[1]}),(0,j.jsx)("small",{children:w[2]})]})]},w[0]))}),a.protocol==="ftp"&&(0,j.jsx)("p",{className:"dsh-ssh-form-warning",children:"\u666E\u901A FTP \u7684\u8D26\u53F7\u3001\u5BC6\u7801\u548C\u6587\u4EF6\u5185\u5BB9\u5747\u4E0D\u52A0\u5BC6\u3002"})]}),(0,j.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,j.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,j.jsx)("strong",{children:"\u670D\u52A1\u5668"}),(0,j.jsx)("small",{children:"\u540D\u79F0\u7528\u4E8E\u8FDE\u63A5\u5217\u8868\uFF0C\u5206\u7EC4\u4E0E\u6807\u7B7E\u53EF\u590D\u7528\u5DF2\u6709\u9009\u9879"})]}),(0,j.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,j.jsx)(le,{label:"\u8FDE\u63A5\u540D\u79F0",children:(0,j.jsx)("input",{autoFocus:e===void 0,required:!0,maxLength:80,value:a.name,onChange:w=>h({...a,name:w.target.value})})}),(0,j.jsx)(le,{label:"\u5206\u7EC4\uFF08\u53EF\u9009\uFF09",children:(0,j.jsx)(Rr,{ariaLabel:"FTP \u5206\u7EC4",maxLength:64,options:S,placeholder:"\u9009\u62E9\u5DF2\u6709\u5206\u7EC4\u6216\u8F93\u5165\u65B0\u5206\u7EC4",value:a.group,onChange:w=>h(C=>({...C,group:w}))})})]}),(0,j.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,j.jsx)(le,{label:"\u670D\u52A1\u5668\u5730\u5740",children:(0,j.jsx)("input",{required:!0,maxLength:253,spellCheck:!1,value:a.host,onChange:w=>h({...a,host:w.target.value})})}),(0,j.jsx)(le,{label:"\u7AEF\u53E3",children:(0,j.jsx)("input",{required:!0,type:"number",min:"1",max:"65535",value:a.port,onChange:w=>h({...a,port:w.target.value})})})]}),(0,j.jsx)(le,{label:"\u6807\u7B7E\uFF08\u53EF\u9009\uFF09",hint:"\u53EF\u9009\u62E9\u5DF2\u6709\u6807\u7B7E\u6216\u76F4\u63A5\u8F93\u5165\uFF1B\u591A\u4E2A\u6807\u7B7E\u4F7F\u7528\u9017\u53F7\u5206\u9694\u3002",children:(0,j.jsx)(Rr,{ariaLabel:"FTP \u6807\u7B7E",multiple:!0,options:_,placeholder:"\u9009\u62E9\u6216\u8F93\u5165\u6807\u7B7E",value:a.tags,onChange:w=>h(C=>({...C,tags:w}))})})]}),(0,j.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,j.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,j.jsx)("strong",{children:"\u8EAB\u4EFD\u8BA4\u8BC1"}),(0,j.jsx)("small",{children:"\u5BC6\u7801\u53EA\u5199\u5165 DSH \u51ED\u636E\u670D\u52A1\uFF0C\u4E0D\u4F1A\u5728\u754C\u9762\u56DE\u663E"})]}),(0,j.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,j.jsx)(le,{label:"\u7528\u6237\u540D",children:(0,j.jsx)("input",{required:!0,maxLength:128,autoComplete:"username",value:a.username,onChange:w=>h({...a,username:w.target.value})})}),(0,j.jsx)(le,{label:"\u51ED\u636E\u6765\u6E90",children:(0,j.jsxs)("select",{value:a.credentialId,onChange:w=>h({...a,credentialId:w.target.value}),children:[(0,j.jsx)("option",{value:"",children:"\u6B64\u8FDE\u63A5\u5355\u72EC\u4FDD\u5B58\u5BC6\u7801"}),n.map(w=>(0,j.jsxs)("option",{value:w.id,children:[w.name," \xB7 ",w.username]},w.id))]})})]}),!a.credentialId&&(0,j.jsx)(le,{label:"\u5BC6\u7801",hint:e?.credential.configured&&e.credential.source==="profile"?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u4FDD\u5B58\u540E\u4E0D\u4F1A\u56DE\u663E",children:(0,j.jsx)("input",{required:e===void 0||e.credential.source!=="profile"||!e.credential.configured,type:"password",autoComplete:"new-password",value:a.password,onChange:w=>h({...a,password:w.target.value})})})]}),(0,j.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,j.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,j.jsx)("strong",{children:"\u8DEF\u5F84\u4E0E\u7F51\u7EDC"}),(0,j.jsx)("small",{children:"\u4EE3\u7406\u590D\u7528 SSH \u63D2\u4EF6\u7684\u4EE3\u7406\u5E93\uFF0C\u63A7\u5236\u548C\u6570\u636E\u8FDE\u63A5\u4F7F\u7528\u540C\u4E00\u8DEF\u5F84"})]}),(0,j.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,j.jsx)(le,{label:"\u521D\u59CB\u76EE\u5F55",children:(0,j.jsx)("input",{required:!0,maxLength:4096,spellCheck:!1,value:a.initialPath,onChange:w=>h({...a,initialPath:w.target.value})})}),(0,j.jsx)(le,{label:"\u8FDE\u63A5\u4EE3\u7406",children:(0,j.jsxs)("select",{value:a.proxyId,onChange:w=>h({...a,proxyId:w.target.value}),children:[(0,j.jsx)("option",{value:"",children:"\u76F4\u8FDE"}),r.map(w=>(0,j.jsxs)("option",{value:w.id,children:[w.name," \xB7 ",w.proxyType.toUpperCase()]},w.id))]})})]}),(0,j.jsxs)("details",{className:"dsh-ssh-form-advanced",children:[(0,j.jsx)("summary",{children:"\u9AD8\u7EA7\u8FDE\u63A5\u8BBE\u7F6E"}),(0,j.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,j.jsx)(le,{label:"\u8FDE\u63A5\u8D85\u65F6\uFF08\u6BEB\u79D2\uFF09",children:(0,j.jsx)("input",{required:!0,type:"number",min:"1000",max:"120000",step:"1000",value:a.connectTimeoutMs,onChange:w=>h({...a,connectTimeoutMs:w.target.value})})}),(0,j.jsx)(le,{label:"TLS \u670D\u52A1\u5668\u540D\u79F0",hint:"\u8BC1\u4E66\u540D\u79F0\u4E0E\u4E3B\u673A\u4E0D\u540C\u65F6\u586B\u5199",children:(0,j.jsx)("input",{maxLength:253,spellCheck:!1,value:a.tlsServerName,onChange:w=>h({...a,tlsServerName:w.target.value})})})]})]})]}),g&&(0,j.jsx)("p",{className:"dsh-ssh-inline-success",role:"status",children:g}),d&&(0,j.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:d})]}),(0,j.jsxs)("footer",{className:"dsh-ssh-ftp-editor-actions",children:[(0,j.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:()=>{x()},disabled:f||l,children:f?"\u6B63\u5728\u6D4B\u8BD5\u2026":"\u6D4B\u8BD5\u8FDE\u63A5"}),(0,j.jsx)("span",{}),(0,j.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:o,disabled:l||f,children:"\u53D6\u6D88"}),(0,j.jsx)("button",{type:"submit",className:"dsh-ssh-primary-button",disabled:l||f,children:l?"\u6B63\u5728\u4FDD\u5B58\u2026":"\u4FDD\u5B58\u8FDE\u63A5"})]})]})}function fx(e){return e==="ftp"?"FTP":e==="ftps-explicit"?"FTPS":"FTPS-I"}function ef(e,t,s){let r=s==="asc"?1:-1;return e.map((o,i)=>({entry:o,index:i})).sort((o,i)=>{let n=o.entry.kind==="directory"||o.entry.navigable===!0,a=i.entry.kind==="directory"||i.entry.navigable===!0;if(n!==a)return n?-1:1;let h=mx(o.entry,i.entry,t);if(h!==0)return h*r;let l=o.entry.name.localeCompare(i.entry.name,void 0,{numeric:!0,sensitivity:"base"});return l!==0?l:o.index-i.index}).map(o=>o.entry)}function mx(e,t,s){return s==="name"?e.name.localeCompare(t.name,void 0,{numeric:!0,sensitivity:"base"}):e[s]-t[s]}var M=require("react/jsx-runtime"),rf="dsh-ssh:file-transfer:tabs:v2",Il=38,gx=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"});function nf({ftpProfiles:e,vaultEntries:t,proxyEntries:s,access:r,onProfilesChanged:o}){let[i,n]=(0,be.useState)([]),[a,h]=(0,be.useState)([]),[l,c]=(0,be.useState)(()=>Px()),[f,v]=(0,be.useState)(()=>l[0]?.id??"transfer-1"),[g,u]=(0,be.useState)(!1),[d,m]=(0,be.useState)(!1),[p,b]=(0,be.useState)(),[x,y]=(0,be.useState)(),[S,_]=(0,be.useState)(),[w,C]=(0,be.useState)({}),P=(0,be.useRef)(new Map),T=(0,be.useCallback)(async()=>{try{let R=await zl();n(R),c(L=>Dx(L,R))}catch(R){_(De(R))}},[]);(0,be.useEffect)(()=>{T()},[T,e]),(0,be.useEffect)(()=>{try{localStorage.setItem(rf,JSON.stringify(l))}catch{}},[l]),(0,be.useEffect)(()=>{let R=P.current,L=a.filter(k=>tf(k.state)&&R.has(k.id)&&!tf(R.get(k.id)));P.current=new Map(a.map(k=>[k.id,k.state])),L.length!==0&&C(k=>{let $={...k};for(let X of L){let O=Nn(X.request.destinationEndpointId,X.request.destinationDirectory);$[O]=($[O]??0)+1}return $})},[a]),(0,be.useEffect)(()=>{let R=!1,L,k=async()=>{if(document.visibilityState==="hidden"){L=window.setTimeout(()=>{k()},1800);return}try{let $=await Vl();R||h($)}catch{}R||(L=window.setTimeout(()=>{k()},800))};return k(),()=>{R=!0,L!==void 0&&clearTimeout(L)}},[]);let A=l.find(R=>R.id===f)??l[0],F=R=>c(L=>L.map(k=>k.id===A?.id?R(k):k)),B=()=>{let R=`transfer-${Date.now().toString(36)}`,L=Ol(R,l.length+1);c(k=>[...k,L]),v(R)},U=R=>{if(l.length===1)return;let L=l.findIndex($=>$.id===R),k=l.filter($=>$.id!==R);c(k),f===R&&v(k[Math.max(0,L-1)].id)},N=R=>F(L=>({...L,panes:Array.from({length:R},(k,$)=>L.panes[$]??zn(`${L.id}-pane-${$}`))})),H=async(R,L,k,$,X)=>{let O={endpointId:R,directory:L},se={endpointId:$,directory:X};if(!(ei(O,se)||!ti(O,k,se)))try{_(void 0);let z=await Nr({sourceEndpointId:R,sourcePaths:k,destinationEndpointId:$,destinationDirectory:X,conflictPolicy:"fail"});h(I=>[z,...I.filter(J=>J.id!==z.id)])}catch(z){_(De(z))}},E=async(R,L,k)=>{try{_(void 0);let $=await cn(R,{paneId:L.id,endpointId:L.endpointId,directory:k});$.job!==void 0&&h(X=>[$.job,...X.filter(O=>O.id!==$.job.id)]),$.operation==="move"&&C(X=>{let O={...X};for(let se of[Nn(R.endpointId,R.directory),Nn(L.endpointId,k)])O[se]=(O[se]??0)+1;return O})}catch($){_(De($))}};return(0,M.jsxs)("div",{className:"dsh-ssh-transfer-workspace",children:[(0,M.jsxs)("header",{className:"dsh-ssh-transfer-header",children:[(0,M.jsxs)("div",{children:[(0,M.jsx)("h1",{children:"\u6587\u4EF6\u4F20\u8F93"}),(0,M.jsx)("p",{children:"FTP\u3001FTPS \u4E0E SFTP \u4E4B\u95F4\u76F4\u63A5\u6D41\u5F0F\u4E92\u4F20"})]}),(0,M.jsxs)("div",{className:"dsh-ssh-transfer-actions",children:[(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-secondary-button",onClick:()=>m(!0),children:["\u4F1A\u8BDD\u8BBF\u95EE \xB7 ",r.value?.fileEndpointIds.length??0]}),(0,M.jsx)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-secondary-button",onClick:()=>u(!0),children:"FTP \u7BA1\u7406"})]})]}),S&&(0,M.jsxs)("div",{className:"dsh-ssh-banner is-error",role:"alert",children:[(0,M.jsx)("span",{children:S}),(0,M.jsx)("button",{type:"button",onClick:()=>_(void 0),"aria-label":"\u5173\u95ED",children:(0,M.jsx)(Ot.IconCloseOutline16,{size:16})})]}),(0,M.jsxs)("div",{className:"dsh-ssh-transfer-tabbar",role:"tablist","aria-label":"\u6587\u4EF6\u4F20\u8F93\u4EFB\u52A1\u9875",children:[(0,M.jsxs)("div",{className:"dsh-ssh-transfer-tabs",children:[l.map(R=>(0,M.jsxs)("span",{"data-ssh-interactive":"choice",className:`dsh-ssh-transfer-tab${R.id===A?.id?" is-active":""}`,children:[(0,M.jsx)("button",{type:"button",role:"tab","aria-selected":R.id===A?.id,onClick:()=>v(R.id),children:R.name}),l.length>1&&(0,M.jsx)("button",{type:"button",className:"is-close","aria-label":`\u5173\u95ED ${R.name}`,onClick:()=>U(R.id),children:(0,M.jsx)(Ot.IconCloseOutline16,{size:13})})]},R.id)),(0,M.jsx)("button",{type:"button","data-ssh-interactive":"control",className:"is-add","aria-label":"\u65B0\u5EFA\u4F20\u8F93\u4EFB\u52A1\u9875",onClick:B,children:(0,M.jsx)(Ot.IconPlusOutline16,{size:15})})]}),(0,M.jsx)("div",{className:"dsh-ssh-pane-layout","aria-label":"\u7A97\u683C\u6570\u91CF",children:[2,3,4].map(R=>(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":A?.panes.length===R,className:A?.panes.length===R?"is-active":"",onClick:()=>N(R),children:[R," \u680F"]},R))})]}),i.length===0?(0,M.jsxs)("div",{className:"dsh-ssh-transfer-empty",children:[(0,M.jsx)(Ot.IconDataOutline16,{size:24}),(0,M.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u53EF\u7528\u6587\u4EF6\u8FDE\u63A5"}),(0,M.jsx)("p",{children:"\u65B0\u5EFA FTP/FTPS \u8FDE\u63A5\uFF0C\u6216\u5148\u6DFB\u52A0\u4E00\u53F0 SSH \u4E3B\u673A\u4F7F\u7528 SFTP\u3002"}),(0,M.jsx)("button",{type:"button",className:"dsh-ssh-primary-button",onClick:()=>u(!0),children:"\u65B0\u5EFA FTP \u8FDE\u63A5"})]}):A&&(0,M.jsx)("div",{className:`dsh-ssh-transfer-panes has-${A.panes.length}`,children:A.panes.map((R,L)=>{let k=A.panes[(L+1)%A.panes.length];return(0,M.jsx)(vx,{pane:R,endpoints:i,dragSource:x,refreshRevision:w[Nn(R.endpointId,R.path)]??0,...k===void 0?{}:{destination:k},onManageConnections:()=>u(!0),onDragSourceChange:y,onChange:$=>F(X=>({...X,panes:X.panes.map(O=>O.id===R.id?{...O,...$}:O)})),onTransfer:($,X)=>{H(R.endpointId,R.path,$,X.endpointId,X.path)},onExternalDrop:($,X)=>{E($,R,X)}},R.id)})}),(0,M.jsx)(yx,{jobs:a,endpoints:i,onCancel:async R=>{try{await jl(R),h(L=>L.map(k=>k.id===R?{...k,state:"cancelled"}:k))}catch(L){_(De(L))}},onConflict:b}),g&&(0,M.jsx)(Zp,{profiles:e,vaultEntries:t,proxyEntries:s,onClose:()=>u(!1),onChanged:()=>{o(),T()}}),d&&(0,M.jsx)(Sx,{endpoints:i,access:r,onClose:()=>m(!1)}),p&&(0,M.jsx)(wx,{job:p,onClose:()=>b(void 0),onRetry:async R=>{try{let L=await Nr({...p.request,conflictPolicy:R});h(k=>[L,...k]),b(void 0)}catch(L){_(De(L))}}})]})}function vx({pane:e,endpoints:t,destination:s,dragSource:r,refreshRevision:o,onChange:i,onTransfer:n,onExternalDrop:a,onDragSourceChange:h,onManageConnections:l}){let[c,f]=(0,be.useState)(),[v,g]=(0,be.useState)([]),[u,d]=(0,be.useState)(e.path),[m,p]=(0,be.useState)(!1),[b,x]=(0,be.useState)(0),[y,S]=(0,be.useState)({key:"name",direction:"asc"}),[_,w]=(0,be.useState)(!1),[C,P]=(0,be.useState)(),[T,A]=(0,be.useState)(),[F,B]=(0,be.useState)(),U=(0,be.useRef)(null),N=(0,be.useRef)(0),H=t.find(V=>V.id===e.endpointId),E=(0,be.useMemo)(()=>ef(c?.entries??[],y.key,y.direction),[c?.entries,y]),R=E.length>200,L=R?Math.max(0,Math.floor(b/Il)-8):0,k=(0,be.useMemo)(()=>R?E.slice(L,Math.min(E.length,L+56)):E,[E,L,R]),$=(0,be.useCallback)(async(V=e.path)=>{if(H===void 0)return;let Q=++N.current;p(!0),B(void 0);try{let W=await Hl(e.id,H.id,V);if(Q!==N.current)return;f(W),d(W.path),g([]),x(0),U.current&&(U.current.scrollTop=0),i({endpointId:H.id,path:W.path})}catch(W){Q===N.current&&B(De(W))}finally{Q===N.current&&p(!1)}},[H?.id,e.path]);(0,be.useEffect)(()=>{H!==void 0&&$(e.path)},[H?.id,o]),(0,be.useEffect)(()=>{r===void 0&&(w(!1),P(void 0))},[r]);let X=V=>{V.preventDefault(),$(u)},O=V=>{S(Q=>Q.key===V?{key:V,direction:Q.direction==="asc"?"desc":"asc"}:{key:V,direction:"asc"}),x(0),U.current&&(U.current.scrollTop=0)},se=V=>{N.current+=1,i({endpointId:V.id,path:V.initialPath}),d(V.initialPath),f(void 0),B(void 0)},z=()=>{N.current+=1,i({endpointId:"",path:"/"}),f(void 0),g([]),B(void 0),p(!1)},I=(V,Q)=>g(W=>Q?W.includes(V.path)?W.filter(ae=>ae!==V.path):[...W,V.path]:[V.path]),J=async()=>{if(!(T===void 0||c===void 0||H===void 0))try{await Br({paneId:e.id,endpointId:H.id,directory:c.path,paths:T.map(V=>V.path)}),g([])}finally{await $(c.path)}},Y=V=>{V.preventDefault(),w(!1);let Q=br(V.dataTransfer.getData(Ft));h(void 0),!(Q===void 0||Q.paneId===e.id||ei(Q,{endpointId:e.endpointId,directory:e.path}))&&a(Q,e.path)};return H===void 0?(0,M.jsxs)("section",{className:"dsh-ssh-file-pane is-connections",children:[(0,M.jsxs)("header",{children:[(0,M.jsxs)("span",{className:"dsh-ssh-pane-heading",children:[(0,M.jsx)("strong",{children:"\u8FDE\u63A5\u5217\u8868"}),(0,M.jsx)("small",{children:"\u5355\u51FB\u8FDE\u63A5\u540E\u6D4F\u89C8\u8FDC\u7AEF\u6587\u4EF6"})]}),(0,M.jsx)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-pane-manage-button",onClick:l,children:"FTP \u7BA1\u7406"})]}),(0,M.jsx)("div",{className:"dsh-ssh-endpoint-list",children:t.map(V=>(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"row",className:"dsh-ssh-endpoint-row",onClick:()=>se(V),children:[(0,M.jsx)("span",{className:`dsh-ssh-protocol-badge is-${V.protocol}`,children:Ml(V.protocol)}),(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{title:V.name,children:V.name}),(0,M.jsx)("small",{title:V.address,children:V.address})]}),(0,M.jsxs)("span",{children:[(0,M.jsx)("i",{className:`dsh-ssh-protocol-dot is-${V.protocol}`,"aria-hidden":"true"}),V.group??(V.kind==="sftp"?"SSH \u4E3B\u673A":"\u6587\u4EF6\u8FDE\u63A5")]})]},V.id))}),(0,M.jsxs)("footer",{children:[(0,M.jsxs)("span",{children:[t.length," \u4E2A\u53EF\u7528\u8FDE\u63A5"]}),(0,M.jsx)("small",{children:"SFTP \u590D\u7528 SSH \u4E3B\u673A\u914D\u7F6E"})]})]}):(0,M.jsxs)("section",{className:`dsh-ssh-file-pane${_?" is-drop-target":""}`,onDragOver:V=>{V.dataTransfer.types.includes(Ft)&&Ax(r,e)?(V.preventDefault(),V.dataTransfer.dropEffect=r?.endpointId===e.endpointId?"move":"copy",P(void 0),w(!0)):_&&w(!1)},onDragLeave:V=>{V.currentTarget.contains(V.relatedTarget)||(w(!1),P(void 0))},onDrop:Y,children:[(0,M.jsxs)("header",{children:[(0,M.jsx)("button",{type:"button",className:"dsh-ssh-pane-back","aria-label":"\u8FD4\u56DE\u8FDE\u63A5\u5217\u8868",onClick:z,children:(0,M.jsx)(Ot.IconChevronLeftOutline14,{size:14})}),(0,M.jsxs)("span",{className:"dsh-ssh-pane-endpoint",children:[(0,M.jsx)("strong",{children:H.name}),(0,M.jsx)("small",{title:H.address,children:H.address})]}),(0,M.jsx)("span",{className:`dsh-ssh-protocol-badge is-${H.protocol}`,children:Ml(H.protocol)})]}),(0,M.jsxs)("form",{className:"dsh-ssh-file-pathbar",onSubmit:X,children:[(0,M.jsx)("button",{type:"button","aria-label":"\u4E0A\u4E00\u7EA7\u76EE\u5F55",disabled:c?.parent===null||m,onClick:()=>{c?.parent&&$(c.parent)},children:(0,M.jsx)(Fx,{})}),(0,M.jsx)("button",{type:"button","aria-label":"\u5237\u65B0\u76EE\u5F55",disabled:m,onClick:()=>{$()},children:(0,M.jsx)(Bx,{})}),(0,M.jsx)("input",{"aria-label":"\u8FDC\u7AEF\u8DEF\u5F84",value:u,onChange:V=>d(V.target.value)}),(0,M.jsx)("button",{type:"submit",disabled:m,children:"\u524D\u5F80"})]}),(0,M.jsxs)("div",{className:"dsh-ssh-file-table",role:"grid","aria-busy":m,children:[(0,M.jsxs)("div",{className:"dsh-ssh-file-table-head",role:"row",children:[(0,M.jsx)(Ll,{label:"\u540D\u79F0",sortKey:"name",current:y,onSort:O}),(0,M.jsx)(Ll,{label:"\u5927\u5C0F",sortKey:"size",current:y,onSort:O}),(0,M.jsx)(Ll,{label:"\u4FEE\u6539\u65F6\u95F4",sortKey:"modifiedAt",current:y,onSort:O}),(0,M.jsx)("span",{role:"columnheader","aria-label":"\u64CD\u4F5C"})]}),(0,M.jsx)("div",{ref:U,className:"dsh-ssh-file-table-body",onScroll:V=>{R&&x(V.currentTarget.scrollTop)},children:m&&!c?(0,M.jsx)("div",{className:"dsh-ssh-file-loading",children:"\u6B63\u5728\u8BFB\u53D6\u76EE\u5F55\u2026"}):F?(0,M.jsxs)("div",{className:"dsh-ssh-file-error",children:[(0,M.jsx)("span",{children:F}),(0,M.jsx)("button",{type:"button",onClick:()=>{$()},children:"\u91CD\u8BD5"})]}):E.length===0?(0,M.jsx)("div",{className:"dsh-ssh-table-empty",children:"\u8FD9\u4E2A\u76EE\u5F55\u662F\u7A7A\u7684\u3002"}):(0,M.jsx)("div",{className:R?"dsh-ssh-file-virtual-list":void 0,style:R?{height:`${E.length*Il}px`}:void 0,children:k.map((V,Q)=>(0,M.jsx)(xx,{entry:V,paneId:e.id,endpointId:H.id,sourceDirectory:c?.path??e.path,dragSource:r,dropTarget:C===V.path,selected:v.includes(V.path),selectedPaths:v,...R?{style:{position:"absolute",insetInline:0,transform:`translateY(${(L+Q)*Il}px)`}}:{},onDelete:()=>A([V]),onDirectoryTarget:W=>{w(!1),P(W)},onDropIntoDirectory:(W,ae)=>{P(void 0),h(void 0),a(W,ae)},onDragSourceChange:h,onSelect:W=>I(V,W),onOpen:()=>{$(V.path)}},V.path))})})]}),(0,M.jsxs)("footer",{children:[(0,M.jsx)("span",{children:v.length>0?`\u5DF2\u9009\u62E9 ${v.length} \u9879`:`${c?.entries.length??0} \u9879`}),(0,M.jsx)("span",{className:"dsh-ssh-file-pane-actions",children:(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-transfer-to-button",disabled:v.length===0||s===void 0||!s.endpointId||m,onClick:()=>{s?.endpointId&&n(v,s)},children:["\u4F20\u9001\u5230\u4E0B\u4E00\u680F ",(0,M.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]})})]}),_&&(0,M.jsxs)("div",{className:"dsh-ssh-file-drop-overlay",children:[(0,M.jsx)("strong",{children:r?.endpointId===e.endpointId?"\u79FB\u52A8\u5230\u6B64\u76EE\u5F55":"\u590D\u5236\u5230\u6B64\u76EE\u5F55"}),(0,M.jsx)("span",{children:c?.path??e.path})]}),T!==void 0&&(0,M.jsx)(Rn,{locationName:H.name,locationKind:"remote",entries:T,onClose:()=>A(void 0),onDelete:J})]})}function Ll({label:e,sortKey:t,current:s,onSort:r}){let o=s.key===t;return(0,M.jsx)("span",{role:"columnheader","aria-sort":o?s.direction==="asc"?"ascending":"descending":"none",children:(0,M.jsxs)("button",{type:"button",onClick:()=>r(t),children:[e,(0,M.jsx)(bx,{active:o,direction:s.direction})]})})}function bx({active:e,direction:t}){return(0,M.jsx)("svg",{className:e?"is-active":"",viewBox:"0 0 12 12","aria-hidden":"true",children:(0,M.jsx)("path",{d:"m3.5 5 2.5 2.5L8.5 5",transform:t==="desc"?void 0:"rotate(180 6 6)"})})}function _x(){return(0,M.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,M.jsx)("path",{d:"M8 2v7m0 0 2.6-2.6M8 9 5.4 6.4M3 11.5v1.25h10V11.5"})})}function xx({entry:e,paneId:t,endpointId:s,sourceDirectory:r,dragSource:o,dropTarget:i,selected:n,selectedPaths:a,style:h,onSelect:l,onOpen:c,onDelete:f,onDirectoryTarget:v,onDropIntoDirectory:g,onDragSourceChange:u}){let d=hn(e),m=d&&(o===void 0||ti(o,o.paths,{endpointId:s,directory:e.path})),p=b=>{if(!d)return;b.preventDefault(),b.stopPropagation(),v(void 0);let x=br(b.dataTransfer.getData(Ft));x!==void 0&&ti(x,x.paths,{endpointId:s,directory:e.path})&&g(x,e.path)};return(0,M.jsxs)("div",{role:"row","data-ssh-interactive":"row","data-ssh-context-row":!0,tabIndex:0,"aria-selected":n,"aria-label":`${e.name}${d?"\uFF0C\u76EE\u5F55\uFF0C\u5355\u51FB\u8FDB\u5165\uFF1B\u53EF\u63A5\u6536\u62D6\u653E":""}`,draggable:e.kind==="file"||d,className:`dsh-ssh-file-row is-${d?"directory":e.kind}${n?" is-selected":""}${i?" is-drop-target":""}`,style:h,onClick:b=>{d&&!b.ctrlKey&&!b.metaKey&&!b.shiftKey?c():l(b.ctrlKey||b.metaKey)},onKeyDown:b=>{b.target===b.currentTarget&&(b.key==="Enter"&&d&&c(),b.key===" "&&(b.preventDefault(),l(b.ctrlKey||b.metaKey)))},onDragStart:b=>{let x=n?a:[e.path],y={paneId:t,endpointId:s,directory:r,paths:x};u(y),b.dataTransfer.effectAllowed="copyMove",b.dataTransfer.setData(Ft,JSON.stringify(y))},onDragEnd:()=>u(void 0),onDragOver:b=>{b.dataTransfer.types.includes(Ft)&&m&&(b.preventDefault(),b.stopPropagation(),b.dataTransfer.dropEffect=o?.endpointId===s?"move":"copy",v(e.path))},onDragLeave:b=>{i&&!b.currentTarget.contains(b.relatedTarget)&&v(void 0)},onDrop:p,children:[(0,M.jsxs)("span",{children:[(0,M.jsx)(Nx,{directory:d}),(0,M.jsx)("i",{title:e.name,children:e.name})]}),(0,M.jsx)("span",{children:d?"\u2014":af(e.size)}),(0,M.jsx)("span",{children:e.modifiedAt>0?new Date(e.modifiedAt).toLocaleString():"\u2014"}),(0,M.jsxs)("span",{className:"dsh-ssh-file-row-actions dsh-ssh-context-action",children:[(e.kind==="file"||e.kind==="directory")&&(0,M.jsx)("a",{className:"dsh-ssh-file-row-download",href:$l(s,e.path),download:e.kind==="directory"?`${e.name}.tar`:e.name,draggable:!1,"aria-label":`\u4E0B\u8F7D ${e.name} \u5230\u672C\u5730`,title:e.kind==="directory"?`\u5C06 ${e.name} \u6253\u5305\u4E0B\u8F7D\u5230\u672C\u5730`:`\u4E0B\u8F7D ${e.name} \u5230\u672C\u5730`,onClick:b=>b.stopPropagation(),children:(0,M.jsx)(_x,{})}),(0,M.jsx)("button",{type:"button",className:"dsh-ssh-file-row-delete",draggable:!1,"aria-label":`\u5220\u9664 ${e.name}`,title:`\u5220\u9664 ${e.name}`,onClick:b=>{b.stopPropagation(),f()},children:(0,M.jsx)(Ot.IconTrashOutline16,{size:14})})]})]})}function yx({jobs:e,endpoints:t,onCancel:s,onConflict:r}){let[o,i]=(0,be.useState)(!0),n=e.filter(a=>a.state==="queued"||a.state==="scanning"||a.state==="transferring");return(0,M.jsxs)("section",{className:`dsh-ssh-transfer-queue${o?" is-open":""}`,children:[(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-transfer-queue-heading","aria-expanded":o,onClick:()=>i(a=>!a),children:[(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{children:"\u4F20\u8F93\u4EFB\u52A1"}),(0,M.jsx)("small",{children:n.length>0?`${n.length} \u4E2A\u8FDB\u884C\u4E2D`:e.length>0?"\u6700\u8FD1\u4EFB\u52A1":"\u6682\u65E0\u4EFB\u52A1"})]}),(0,M.jsx)("span",{children:o?"\u6536\u8D77":"\u5C55\u5F00"})]}),o&&(0,M.jsx)("div",{className:"dsh-ssh-transfer-job-list",children:e.length===0?(0,M.jsx)("p",{children:"\u4ECE\u4E00\u4E2A\u7A97\u683C\u62D6\u5230\u53E6\u4E00\u4E2A\u7A97\u683C\uFF0C\u6216\u9009\u4E2D\u6587\u4EF6\u540E\u70B9\u51FB\u201C\u4F20\u9001\u5230\u4E0B\u4E00\u680F\u201D\u3002"}):e.slice(0,12).map(a=>{let h=a.totalBytes>0?Math.min(100,a.transferredBytes/a.totalBytes*100):a.state==="completed"?100:0;return(0,M.jsxs)("article",{children:[(0,M.jsx)("span",{className:`dsh-ssh-transfer-state is-${a.state}`,"aria-hidden":"true"}),(0,M.jsxs)("span",{className:"dsh-ssh-transfer-job-copy",children:[(0,M.jsxs)("strong",{children:[of(a.request.sourcePaths)," ",(0,M.jsx)("i",{children:"\u2192"})," ",Rx(t,a.request.destinationEndpointId)]}),(0,M.jsx)("small",{children:a.error??Ix(a,h)}),(0,M.jsx)("span",{className:"dsh-ssh-transfer-job-time",children:Lx(a)}),(0,M.jsx)("span",{className:"dsh-ssh-transfer-progress",children:(0,M.jsx)("i",{style:{transform:`scaleX(${h/100})`}})})]}),a.state==="queued"||a.state==="scanning"||a.state==="transferring"?(0,M.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u53D6\u6D88\u4F20\u8F93",onClick:()=>{s(a.id)},children:(0,M.jsx)(Ot.IconCloseOutline16,{size:15})}):a.state==="failed"&&a.error?.includes("destination already contains")?(0,M.jsx)("button",{type:"button",className:"dsh-ssh-job-resolve",onClick:()=>r(a),children:"\u5904\u7406"}):null]},a.id)})})]})}function wx({job:e,onClose:t,onRetry:s}){let[r,o]=(0,be.useState)("rename"),[i,n]=(0,be.useState)(!1);return(0,M.jsxs)(Ye,{className:"dsh-ssh-transfer-conflict-dialog",title:"\u76EE\u6807\u4E2D\u5B58\u5728\u540C\u540D\u6587\u4EF6",subtitle:"\u4E3A\u672C\u6279\u4F20\u8F93\u9009\u62E9\u5904\u7406\u65B9\u5F0F",onClose:t,children:[(0,M.jsxs)("div",{className:"dsh-ssh-transfer-conflict-copy",children:[(0,M.jsx)("strong",{children:of(e.request.sourcePaths)}),(0,M.jsx)("span",{children:e.request.destinationDirectory})]}),(0,M.jsx)("div",{className:"dsh-ssh-conflict-options",children:[["rename","\u81EA\u52A8\u91CD\u547D\u540D","\u4FDD\u7559\u4E24\u4EFD\u6587\u4EF6\uFF0C\u5728\u540D\u79F0\u540E\u6DFB\u52A0\u5E8F\u53F7"],["skip","\u8DF3\u8FC7\u540C\u540D\u6587\u4EF6","\u7EE7\u7EED\u4F20\u8F93\u5176\u4ED6\u5185\u5BB9"],["overwrite","\u8986\u76D6\u76EE\u6807\u6587\u4EF6","\u4F7F\u7528\u6765\u6E90\u5185\u5BB9\u66FF\u6362\u76EE\u6807\u5185\u5BB9"]].map(a=>(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":r===a[0],className:r===a[0]?"is-active":"",onClick:()=>o(a[0]),children:[(0,M.jsx)("i",{"aria-hidden":"true"}),(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{children:a[1]}),(0,M.jsx)("small",{children:a[2]})]})]},a[0]))}),(0,M.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,M.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,onClick:t,children:"\u53D6\u6D88"}),(0,M.jsx)("button",{type:"button",className:"dsh-ssh-primary-button",disabled:i,onClick:()=>{n(!0),s(r).finally(()=>n(!1))},children:i?"\u6B63\u5728\u91CD\u65B0\u52A0\u5165\u961F\u5217\u2026":"\u7EE7\u7EED\u4F20\u8F93"})]})]})}function Sx({endpoints:e,access:t,onClose:s}){let r=t.value,o=e.filter(n=>r?.fileEndpointIds.includes(n.id)).length,i=n=>t.setFileEndpoints(r?.fileEndpointIds.includes(n)?r.fileEndpointIds.filter(a=>a!==n):[...r?.fileEndpointIds??[],n]);return(0,M.jsxs)(Ye,{className:"dsh-ssh-file-access-dialog",title:"\u4F1A\u8BDD\u8BBF\u95EE",subtitle:"\u5355\u72EC\u7BA1\u7406\u5F53\u524D\u4F1A\u8BDD\u53EF\u4F7F\u7528\u7684\u8FDC\u7AEF\u6587\u4EF6\u8FDE\u63A5",onClose:s,children:[(0,M.jsxs)("div",{className:"dsh-ssh-file-access-body dsh-ssh-scroll-surface",children:[t.error&&(0,M.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:t.error}),(0,M.jsxs)("section",{className:"dsh-ssh-file-access-section","aria-labelledby":"dsh-ssh-file-access-connections",children:[(0,M.jsxs)("header",{children:[(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{id:"dsh-ssh-file-access-connections",children:"\u6587\u4EF6\u8FDE\u63A5"}),(0,M.jsx)("small",{children:"\u5141\u8BB8\u5F53\u524D\u4F1A\u8BDD\u6D4F\u89C8\u6307\u5B9A\u7684 FTP\u3001FTPS \u6216 SFTP"})]}),(0,M.jsxs)("i",{children:[o.toString().padStart(2,"0")," / ",e.length.toString().padStart(2,"0")]})]}),(0,M.jsx)("div",{className:"dsh-ssh-file-access-list",children:t.loading?(0,M.jsx)(Cx,{}):e.length===0?(0,M.jsxs)("div",{className:"dsh-ssh-file-access-empty",children:[(0,M.jsx)("strong",{children:"\u6CA1\u6709\u53EF\u7528\u8FDE\u63A5"}),(0,M.jsx)("small",{children:"\u8BF7\u5148\u5728\u6587\u4EF6\u4F20\u8F93\u4E2D\u6DFB\u52A0 FTP\uFF0C\u6216\u5728\u4E3B\u673A\u9762\u677F\u4E2D\u6DFB\u52A0 SSH \u4E3B\u673A\u3002"})]}):e.map(n=>(0,M.jsx)(kx,{endpoint:n,enabled:r?.fileEndpointIds.includes(n.id)??!1,onToggle:()=>i(n.id)},n.id))})]}),(0,M.jsxs)("section",{className:"dsh-ssh-file-access-section is-options","aria-labelledby":"dsh-ssh-file-access-policy",children:[(0,M.jsx)("header",{children:(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{id:"dsh-ssh-file-access-policy",children:"\u8BBF\u95EE\u7B56\u7565"}),(0,M.jsx)("small",{children:"\u6587\u4EF6\u6743\u9650\u4E0E SSH \u547D\u4EE4\u3001\u7EC8\u7AEF\u6743\u9650\u76F8\u4E92\u72EC\u7ACB"})]})}),(0,M.jsxs)("div",{className:"dsh-ssh-file-access-options",children:[(0,M.jsxs)("div",{className:"dsh-ssh-file-access-policy-row",children:[(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{children:"\u6587\u4EF6\u64CD\u4F5C\u6743\u9650"}),(0,M.jsx)("small",{children:"\u6D4F\u89C8\u6A21\u5F0F\u4E0D\u4F1A\u5411 AI \u66B4\u9732\u8DE8\u7AEF\u4F20\u8F93\u5DE5\u5177"})]}),(0,M.jsx)(Ex,{value:r?.filePermission??"browse",onChange:t.setFilePermission})]}),(0,M.jsxs)("div",{className:"dsh-ssh-file-access-policy-row",children:[(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{children:"\u4F20\u8F93\u524D\u786E\u8BA4"}),(0,M.jsx)("small",{children:"AI \u53D1\u8D77\u4F20\u8F93\u65F6\u8BF7\u6C42 DSH \u6388\u6743"})]}),(0,M.jsx)(Tx,{checked:r?.requireFileApproval??!0,onChange:t.setRequireFileApproval})]})]})]})]}),(0,M.jsxs)("footer",{className:"dsh-ssh-file-access-footer",children:[(0,M.jsxs)("span",{className:t.saving?"is-saving":"is-saved",children:[(0,M.jsx)("i",{"aria-hidden":"true"}),t.saving?"\u6B63\u5728\u4FDD\u5B58\u66F4\u6539":`${o>0?`\u5DF2\u6388\u6743 ${o} \u4E2A\u8FDE\u63A5`:"\u672A\u6388\u6743\u8FDE\u63A5"} \xB7 \u81EA\u52A8\u4FDD\u5B58`]}),(0,M.jsx)("button",{type:"button",className:"dsh-ssh-primary-button","data-ssh-dialog-close":!0,disabled:t.saving,onClick:s,children:t.saving?"\u4FDD\u5B58\u4E2D\u2026":"\u5B8C\u6210"})]})]})}function kx({endpoint:e,enabled:t,onToggle:s}){return(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-file-access-endpoint${t?" is-mounted":""}`,"aria-pressed":t,onClick:s,children:[(0,M.jsx)("span",{className:`dsh-ssh-protocol-badge is-${e.protocol}`,children:Ml(e.protocol)}),(0,M.jsxs)("span",{className:"dsh-ssh-file-access-endpoint-copy",children:[(0,M.jsx)("strong",{title:e.name,children:e.name}),(0,M.jsx)("small",{title:e.address,children:e.address})]}),(0,M.jsxs)("span",{className:"dsh-ssh-file-access-state",children:[(0,M.jsx)("i",{"aria-hidden":"true",children:(0,M.jsx)("b",{})}),(0,M.jsx)("em",{children:t?"\u5DF2\u6388\u6743":"\u672A\u6388\u6743"})]})]})}function Cx(){return(0,M.jsx)("div",{className:"dsh-ssh-file-access-skeleton","aria-label":"\u6B63\u5728\u8BFB\u53D6\u4F1A\u8BDD\u6743\u9650",children:[0,1,2].map(e=>(0,M.jsxs)("span",{style:{"--ssh-skeleton-index":e},children:[(0,M.jsx)("i",{}),(0,M.jsxs)("b",{children:[(0,M.jsx)("i",{}),(0,M.jsx)("i",{})]}),(0,M.jsx)("em",{})]},e))})}function Ex({value:e,onChange:t}){return(0,M.jsx)("div",{className:"dsh-ssh-file-permission-picker",role:"radiogroup","aria-label":"\u6587\u4EF6\u64CD\u4F5C\u6743\u9650",children:[["browse","\u4EC5\u6D4F\u89C8"],["transfer","\u5141\u8BB8\u4F20\u8F93"]].map(([s,r])=>(0,M.jsx)("button",{type:"button","data-ssh-interactive":"choice",role:"radio","aria-checked":e===s,className:e===s?"is-active":"",onClick:()=>t(s),children:r},s))})}function Tx({checked:e,onChange:t}){return(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"choice",role:"switch","aria-checked":e,className:`dsh-ssh-file-approval-switch${e?" is-active":""}`,onClick:()=>t(!e),children:[(0,M.jsx)("i",{"aria-hidden":"true",children:(0,M.jsx)("b",{})}),(0,M.jsx)("span",{children:e?"\u9700\u8981\u786E\u8BA4":"\u76F4\u63A5\u6267\u884C"})]})}function Px(){try{let e=JSON.parse(localStorage.getItem(rf)??"[]");if(!Array.isArray(e))return[Ol("transfer-1",1)];let t=e.slice(0,8).flatMap(s=>{if(typeof s!="object"||s===null)return[];let r=s;if(typeof r.id!="string"||!/^[a-zA-Z0-9_-]{1,100}$/.test(r.id)||typeof r.name!="string"||!Array.isArray(r.panes))return[];let o=r.panes.slice(0,4).flatMap(i=>{if(typeof i!="object"||i===null)return[];let n=i;return typeof n.id=="string"&&/^[a-zA-Z0-9_-]{1,100}$/.test(n.id)&&typeof n.endpointId=="string"&&typeof n.path=="string"?[{id:n.id,endpointId:"",path:"/"}]:[]});return o.length>=2?[{id:r.id,name:r.name.slice(0,40),panes:o}]:[]});if(t.length>0)return t}catch{}return[Ol("transfer-1",1)]}function Ol(e,t){return{id:e,name:`\u4EFB\u52A1 ${t}`,panes:[zn(`${e}-a`),zn(`${e}-b`)]}}function zn(e){return{id:e,endpointId:"",path:"/"}}function Dx(e,t){return e.map(s=>({...s,panes:s.panes.map(r=>!r.endpointId||t.some(o=>o.id===r.endpointId)?r:zn(r.id))}))}function Rx(e,t){return e.find(s=>s.id===t)?.name??t}function of(e){let t=e[0]?.replaceAll("\\","/").split("/").filter(Boolean).at(-1)??"\u6587\u4EF6";return e.length>1?`${t} \u7B49 ${e.length} \u9879`:t}function Ml(e){return e==="sftp"?"SFTP":e==="ftp"?"FTP":e==="ftps-explicit"?"FTPS":"FTPS-I"}function Nn(e,t){return JSON.stringify([e,t.replaceAll("\\","/").replace(/\/+$/,"")||"/"])}function Ax(e,t){return e===void 0||e.paneId!==t.id&&!ei(e,{endpointId:t.endpointId,directory:t.path})}function tf(e){return e==="completed"||e==="failed"||e==="cancelled"}function af(e){return e<1024?`${e} B`:e<1024**2?`${(e/1024).toFixed(1)} KB`:e<1024**3?`${(e/1024**2).toFixed(1)} MB`:`${(e/1024**3).toFixed(2)} GB`}function Ix(e,t){if(e.state==="queued")return"\u7B49\u5F85\u4F20\u8F93";if(e.state==="scanning")return"\u6B63\u5728\u626B\u63CF\u76EE\u5F55";if(e.state==="transferring"){let s=Math.max(1,(Date.now()-(e.startedAt??Date.now()))/1e3),r=e.transferredBytes/s,o=r>0?Math.max(0,(e.totalBytes-e.transferredBytes)/r):0;return`${t.toFixed(0)}% \xB7 ${af(r)}/s${o>1?` \xB7 \u7EA6 ${Mx(o)}`:""}`}return e.state==="completed"?`\u5DF2\u5B8C\u6210 ${e.completedFiles} \u4E2A\u6587\u4EF6${e.skippedFiles?`\uFF0C\u8DF3\u8FC7 ${e.skippedFiles}`:""}`:e.state==="cancelled"?"\u5DF2\u53D6\u6D88":"\u4F20\u8F93\u5931\u8D25"}function Lx(e){if(e.startedAt===void 0)return`\u521B\u5EFA\u4E8E ${sf(e.createdAt)}`;let t=e.completedAt??Date.now(),s=Ox(Math.max(0,t-e.startedAt));return e.completedAt===void 0?`\u5DF2\u6267\u884C ${s}`:`\u8017\u65F6 ${s} \xB7 \u5B8C\u6210\u4E8E ${sf(e.completedAt)}`}function sf(e){return gx.format(e)}function Ox(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t} \u79D2`;let s=Math.floor(t/60);return s<60?`${s} \u5206 ${String(t%60).padStart(2,"0")} \u79D2`:`${Math.floor(s/60)} \u5C0F\u65F6 ${String(s%60).padStart(2,"0")} \u5206`}function Mx(e){if(e<60)return`${Math.ceil(e)} \u79D2`;let t=Math.ceil(e/60);return t<60?`${t} \u5206\u949F`:`${Math.floor(t/60)} \u5C0F\u65F6 ${t%60} \u5206\u949F`}function Fx(){return(0,M.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,M.jsx)("path",{d:"M8 12V4m0 0L4.8 7.2M8 4l3.2 3.2"})})}function Bx(){return(0,M.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,M.jsx)("path",{d:"M12.2 5.2A5 5 0 1 0 13 9M12.2 5.2V2.5m0 2.7H9.5"})})}function Nx({directory:e}){return(0,M.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:e?(0,M.jsx)("path",{d:"M2 4.3h4l1.2 1.4H14v6.8H2z"}):(0,M.jsx)("path",{d:"M3.2 2h6l3.6 3.6V14H3.2zm6 0v3.6h3.6"})})}var lf=`.dsh-ssh-transfer-workspace {
|
|
5550
|
+
`;var Up=require("react");function Vp(e){(0,Up.useEffect)(()=>{let t=e.current,s=t?.parentElement;if(t==null||s===null||s===void 0)return;let r=s,o=!1,i,n=()=>{let a=t.parentElement;for(;a!==null&&a!==document.body;){let h=a.previousElementSibling;if(h instanceof HTMLElement){let l=getComputedStyle(h),c=Number.parseFloat(l.flexGrow);if(l.display==="flex"&&l.flexDirection==="column"&&c>0)return h.insertBefore(t,h.firstChild),t.dataset.dshSshAnchored="true",o=!0,!0}a=a.parentElement}return!1};return n()||(i=new MutationObserver(()=>{n()&&i?.disconnect()}),i.observe(document.body,{childList:!0,subtree:!0})),()=>{i?.disconnect(),delete t.dataset.dshSshAnchored,o&&r.isConnected&&r.append(t)}},[e])}var at=require("react"),Qe=require("@deepseek-ai/dsh-client-ui-primitives");var ls=require("react"),or=require("@deepseek-ai/dsh-client-ui-primitives"),ge=require("react/jsx-runtime");function jp({profile:e,project:t,workspaces:s,currentWorkspaceId:r,recentWorkspaceId:o,returnFocus:i,onClose:n,onCreate:a}){let h=s.some(x=>String(x.workspaceId)===r)?r:s.some(x=>String(x.workspaceId)===o)?o:s[0]===void 0?void 0:String(s[0].workspaceId),[l,c]=(0,ls.useState)(h),[f,v]=(0,ls.useState)(!1),[g,u]=(0,ls.useState)(),d=(0,ls.useRef)(null),m=(0,ls.useRef)(null);(0,ls.useEffect)(()=>((d.current??m.current)?.focus(),()=>{i.isConnected&&i.focus()}),[i]);let p=()=>{f||n()},b=async x=>{if(x.preventDefault(),l!==void 0){v(!0),u(void 0);try{await a(t,l)}catch(y){u(tx(y)),v(!1)}}};return(0,ge.jsx)(or.Modal,{open:!0,onClose:p,title:"\u9009\u62E9\u4F1A\u8BDD\u5F52\u5C5E\u7A7A\u95F4",headless:!0,className:"dsh-ssh-session-create-modal",children:(0,ge.jsxs)("section",{className:"dsh-ssh-session-create-shell",onKeyDown:ex,children:[(0,ge.jsxs)("header",{children:[(0,ge.jsxs)("span",{children:[(0,ge.jsx)("h2",{children:"\u65B0\u5EFA\u8FDC\u7AEF\u4F1A\u8BDD"}),(0,ge.jsx)("p",{children:"\u9009\u62E9\u8FD9\u4E2A\u4F1A\u8BDD\u5728 DSH \u4E2D\u5F52\u5C5E\u7684\u672C\u5730\u9879\u76EE"})]}),(0,ge.jsx)("button",{ref:m,type:"button",className:"dsh-ssh-icon-button",disabled:f,onClick:p,"aria-label":"\u5173\u95ED",children:(0,ge.jsx)(or.IconCloseOutline16,{size:16})})]}),(0,ge.jsxs)("form",{onSubmit:x=>{b(x)},children:[(0,ge.jsxs)("dl",{className:"dsh-ssh-session-create-target",children:[(0,ge.jsxs)("div",{children:[(0,ge.jsx)("dt",{children:"\u8FDC\u7AEF\u4E3B\u673A"}),(0,ge.jsxs)("dd",{children:[e.name,(0,ge.jsxs)("small",{children:[e.username,"@",e.host,":",e.port]})]})]}),(0,ge.jsxs)("div",{children:[(0,ge.jsx)("dt",{children:"\u8FDC\u7AEF\u5DE5\u4F5C\u76EE\u5F55"}),(0,ge.jsxs)("dd",{children:[t.name,(0,ge.jsx)("small",{title:t.path,children:t.path})]})]})]}),(0,ge.jsxs)("fieldset",{className:"dsh-ssh-workspace-picker",children:[(0,ge.jsx)("legend",{children:"\u4F1A\u8BDD\u5F52\u5C5E\u7A7A\u95F4"}),(0,ge.jsx)("p",{children:"\u4F1A\u8BDD\u8BB0\u5F55\u4FDD\u5B58\u5728\u6240\u9009 DSH \u9879\u76EE\u4E2D\uFF0CSSH \u547D\u4EE4\u4E0E\u7EC8\u7AEF\u56FA\u5B9A\u4F7F\u7528\u4E0A\u9762\u7684\u8FDC\u7AEF\u76EE\u5F55\u3002"}),s.length===0?(0,ge.jsxs)("div",{className:"dsh-ssh-workspace-picker-empty",children:[(0,ge.jsx)(or.IconFolderClose16,{size:18}),(0,ge.jsxs)("span",{children:[(0,ge.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u53EF\u7528\u7684 DSH \u9879\u76EE"}),(0,ge.jsx)("small",{children:"\u8BF7\u5148\u5173\u95ED\u6B64\u7A97\u53E3\uFF0C\u5728 DSH \u5DE6\u4FA7\u7A7A\u95F4\u4E2D\u65B0\u5EFA\u6216\u6DFB\u52A0\u9879\u76EE\u3002"})]})]}):(0,ge.jsx)("div",{className:"dsh-ssh-workspace-options dsh-ssh-scroll-surface",role:"radiogroup","aria-label":"\u9009\u62E9 DSH \u9879\u76EE",children:s.map(x=>{let y=String(x.workspaceId),S=y===r?"\u5F53\u524D\u9879\u76EE":y===o?"\u6700\u8FD1\u4F7F\u7528":void 0;return(0,ge.jsxs)("label",{className:"dsh-ssh-workspace-option",children:[(0,ge.jsx)("input",{ref:y===h?d:void 0,className:"sr-only",type:"radio",name:"dsh-ssh-session-workspace",value:y,checked:l===y,disabled:f,onChange:()=>c(y)}),(0,ge.jsxs)("span",{children:[(0,ge.jsx)("span",{className:"dsh-ssh-workspace-option-icon",children:(0,ge.jsx)(or.IconFolderClose16,{size:16})}),(0,ge.jsxs)("span",{className:"dsh-ssh-workspace-option-copy",children:[(0,ge.jsx)("strong",{children:x.title}),(0,ge.jsx)("small",{title:x.path,children:x.path})]}),S&&(0,ge.jsx)("em",{children:S}),(0,ge.jsx)("i",{"aria-hidden":"true"})]})]},y)})})]}),g&&(0,ge.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:g}),(0,ge.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,ge.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",disabled:f,onClick:p,children:"\u53D6\u6D88"}),(0,ge.jsx)("button",{type:"submit",className:"dsh-ssh-primary-button",disabled:f||l===void 0,children:f?"\u6B63\u5728\u65B0\u5EFA\u2026":"\u65B0\u5EFA\u5E76\u6253\u5F00"})]})]})]})})}function ex(e){if(e.key!=="Tab")return;let t=Array.from(e.currentTarget.querySelectorAll('button:not(:disabled), input:not(:disabled), a[href], [tabindex]:not([tabindex="-1"])')).filter(o=>o.getClientRects().length>0),s=t[0],r=t[t.length-1];s===void 0||r===void 0||(e.shiftKey&&document.activeElement===s?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),s.focus()))}function tx(e){return e instanceof Error?e.message:String(e)}var te=require("react/jsx-runtime");function Wp(e){let t=_r(),[s,r]=(0,at.useState)(""),[o,i]=(0,at.useState)(()=>new Set),[n,a]=(0,at.useState)(()=>new Set),[h,l]=(0,at.useState)({}),[c,f]=(0,at.useState)(),[v,g]=(0,at.useState)(),[u,d]=(0,at.useState)(),[m,p]=(0,at.useState)(),b=s.trim().toLocaleLowerCase(),x=(0,at.useMemo)(()=>ix(e.profiles.filter(C=>nx(C).includes(b))),[b,e.profiles]),y=async C=>{f(C);try{let P=await Gl(C);l(T=>({...T,[C]:P})),p(void 0)}catch(P){p(Dl(P))}finally{f(P=>P===C?void 0:P)}},S=C=>{a(new Set([C])),h[C]===void 0&&y(C),e.onSelect({profileId:C,path:"~"})},_=C=>{let P=e.access?.profileIds??[],T=P.includes(C);e.onProfiles(T?P.filter(A=>A!==C):[...P,C]),T&&e.onDirectory(C,void 0)},w=C=>i(P=>{let T=new Set(P);return T.has(C)?T.delete(C):T.add(C),T});return(0,te.jsxs)("aside",{ref:t.ref,onPointerMove:t.onPointerMove,onPointerLeave:t.onPointerLeave,className:"dsh-ssh-remote-tree dsh-ssh-border-surface",children:[(0,te.jsxs)("header",{className:"dsh-ssh-tree-header",children:[(0,te.jsxs)("span",{children:[(0,te.jsx)("strong",{children:"\u4E3B\u673A\u4E0E\u9879\u76EE"}),(0,te.jsxs)("small",{children:[e.profiles.length," \u53F0\u4E3B\u673A"]})]}),(0,te.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",onClick:e.onNewProfile,"aria-label":"\u65B0\u5EFA\u8FDE\u63A5",title:"\u65B0\u5EFA\u8FDE\u63A5",children:(0,te.jsx)(Qe.IconPlusOutline16,{size:16})})]}),(0,te.jsxs)("label",{className:"dsh-ssh-search",children:[(0,te.jsx)("span",{className:"sr-only",children:"\u641C\u7D22\u4E3B\u673A"}),(0,te.jsx)("input",{value:s,onChange:C=>r(C.target.value),placeholder:"\u641C\u7D22\u4E3B\u673A\u3001\u5206\u7EC4\u3001\u6807\u7B7E\u2026"})]}),(0,te.jsxs)("div",{className:"dsh-ssh-tree-scroll dsh-ssh-scroll-surface",children:[x.map(C=>{let P=o.has(C.name);return(0,te.jsxs)("section",{className:"dsh-ssh-tree-group","data-collapsed":P,children:[(0,te.jsx)("h3",{children:(0,te.jsxs)("button",{type:"button","aria-expanded":!P,onClick:()=>w(C.name),children:[P?(0,te.jsx)(Qe.IconChevronRightOutline14,{size:14}):(0,te.jsx)(Qe.IconChevronDownOutline14,{size:14}),(0,te.jsx)("span",{children:C.name}),(0,te.jsx)("small",{children:C.profiles.length})]})}),!P&&C.profiles.map(T=>{let A=n.has(T.id),F=e.access?.profileIds.includes(T.id)===!0,B=h[T.id]??[],U=e.selected?.profileId===T.id&&e.selected.projectId===void 0;return(0,te.jsxs)("div",{className:"dsh-ssh-tree-host","data-open":A,children:[(0,te.jsxs)("div",{"data-ssh-interactive":"row","data-ssh-context-row":!0,className:`dsh-ssh-tree-host-row${F?" is-authorized":""}${U?" is-active":""}`,children:[(0,te.jsxs)("button",{type:"button",className:"dsh-ssh-tree-host-main","aria-pressed":U,"aria-expanded":A,title:`\u9009\u62E9\u5E76\u5C55\u5F00 ${T.name}`,onClick:()=>S(T.id),children:[(0,te.jsx)("span",{className:"dsh-ssh-host-monogram",children:T.name.slice(0,1).toUpperCase()}),(0,te.jsxs)("span",{children:[(0,te.jsx)("strong",{children:T.name}),(0,te.jsxs)("small",{children:[T.username,"@",T.host]})]})]}),(0,te.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-tree-mount dsh-ssh-context-action${F?" is-mounted":""}`,"aria-label":`${F?"\u5378\u8F7D":"\u6302\u8F7D"} ${T.name}`,"aria-pressed":F,title:e.access===null?"\u6253\u5F00\u4E00\u4E2A DSH \u4F1A\u8BDD\u540E\u624D\u80FD\u6302\u8F7D\u4E3B\u673A":F?"\u4ECE\u5F53\u524D\u4F1A\u8BDD\u5378\u8F7D":"\u6302\u8F7D\u5230\u5F53\u524D\u4F1A\u8BDD",disabled:e.access===null||e.accessLoading||e.accessSaving,onClick:()=>_(T.id),children:F?"\u5378\u8F7D":"\u6302\u8F7D"}),(0,te.jsx)("button",{type:"button",className:"dsh-ssh-tree-add","aria-label":`\u4E3A ${T.name} \u6DFB\u52A0\u56FA\u5B9A\u76EE\u5F55`,title:"\u6DFB\u52A0\u56FA\u5B9A\u76EE\u5F55",onClick:()=>g({profile:T}),children:(0,te.jsx)(Qe.IconPlusOutline16,{size:14})})]}),A&&(0,te.jsx)("div",{className:"dsh-ssh-tree-branches",children:c===T.id&&h[T.id]===void 0?(0,te.jsx)("p",{className:"dsh-ssh-tree-state",children:"\u6B63\u5728\u8BFB\u53D6\u56FA\u5B9A\u76EE\u5F55\u2026"}):B.length===0?(0,te.jsxs)("button",{type:"button",className:"dsh-ssh-tree-empty",onClick:()=>g({profile:T}),children:[(0,te.jsx)(Qe.IconPlusOutline16,{size:13}),"\u6DFB\u52A0\u9879\u76EE\u76EE\u5F55"]}):B.map(N=>{let H=e.selected?.projectId===N.id,E=e.access?.workingProjectIds[T.id]===N.id;return(0,te.jsx)("div",{className:"dsh-ssh-tree-project",children:(0,te.jsxs)("div",{"data-ssh-interactive":"row",className:`dsh-ssh-tree-project-row${H?" is-active":""}${E?" is-bound":""}`,children:[(0,te.jsxs)("button",{type:"button",className:"dsh-ssh-tree-project-main","aria-pressed":e.access===null?void 0:E,title:e.access===null?"\u5F53\u524D\u6CA1\u6709\u53EF\u56FA\u5B9A\u76EE\u5F55\u7684 DSH \u4F1A\u8BDD":F?E?"\u53D6\u6D88\u5F53\u524D\u4F1A\u8BDD\u7684\u56FA\u5B9A\u76EE\u5F55":"\u56FA\u5B9A\u4E3A\u5F53\u524D\u4F1A\u8BDD\u76EE\u5F55":"\u8BF7\u5148\u6302\u8F7D\u8BE5\u4E3B\u673A",onClick:()=>{F&&!e.accessLoading&&!e.accessSaving&&(e.onDirectory(T.id,E?void 0:N.path,E?void 0:N.id),e.onSelect(E?{profileId:T.id,path:"~"}:{profileId:T.id,path:N.path,projectId:N.id}))},children:[(0,te.jsx)("span",{children:E?(0,te.jsx)(Qe.IconFolderOpenOutline16,{size:15}):(0,te.jsx)(Qe.IconFolderClose16,{size:15})}),(0,te.jsxs)("span",{children:[(0,te.jsx)("strong",{children:N.name}),(0,te.jsx)("small",{children:N.path}),E&&(0,te.jsx)("em",{children:"\u5F53\u524D\u4F1A\u8BDD\u5DF2\u56FA\u5B9A\u8BE5\u8DEF\u5F84"})]})]}),(0,te.jsx)("button",{type:"button",className:"dsh-ssh-tree-project-new","aria-label":`\u5728 ${N.name} \u65B0\u5EFA\u4F1A\u8BDD`,title:"\u65B0\u5EFA\u4F1A\u8BDD",onClick:R=>{p(void 0),d({profile:T,project:N,returnFocus:R.currentTarget})},children:(0,te.jsx)(Qe.IconPlusOutline16,{size:13})}),(0,te.jsx)("button",{type:"button",className:"dsh-ssh-tree-project-edit","aria-label":`\u7F16\u8F91 ${N.name}`,title:"\u7F16\u8F91\u56FA\u5B9A\u76EE\u5F55",onClick:()=>g({profile:T,project:N}),children:(0,te.jsx)(Qe.IconEditOutline16,{size:13})})]})},N.id)})})]},T.id)})]},C.name)}),x.length===0&&(0,te.jsx)("p",{className:"dsh-ssh-tree-no-results",children:e.profiles.length===0?"\u8FD8\u6CA1\u6709 SSH \u4E3B\u673A":"\u6CA1\u6709\u5339\u914D\u7684\u4E3B\u673A"})]}),(0,te.jsx)(sx,{access:e.access,loading:e.accessLoading,saving:e.accessSaving,error:e.accessError??m,onPermission:e.onPermission,onApproval:e.onApproval}),v!==void 0&&(0,te.jsx)(rx,{profile:v.profile,project:v.project,onClose:()=>g(void 0),onSaved:async()=>{let C=v.profile.id;g(void 0),await y(C)}}),u!==void 0&&(0,te.jsx)(jp,{...u,workspaces:e.workspaces,currentWorkspaceId:e.currentWorkspaceId,recentWorkspaceId:e.recentWorkspaceId,onClose:()=>d(void 0),onCreate:e.onCreateSession})]})}function sx({access:e,loading:t,saving:s,error:r,onPermission:o,onApproval:i}){return(0,te.jsxs)("footer",{className:"dsh-ssh-access-footer",children:[(0,te.jsxs)("div",{className:"dsh-ssh-access-heading",children:[(0,te.jsxs)("span",{children:[(0,te.jsx)("strong",{children:"\u5F53\u524D\u4F1A\u8BDD\u6743\u9650"}),(0,te.jsxs)("small",{children:[e?.profileIds.length??0," \u53F0\u4E3B\u673A\u53EF\u7528"]})]}),(0,te.jsx)("em",{children:t?"\u8BFB\u53D6\u4E2D":s?"\u4FDD\u5B58\u4E2D":"\u5DF2\u540C\u6B65"})]}),(0,te.jsxs)("div",{className:"dsh-ssh-access-segments","aria-label":"SSH \u6743\u9650",children:[(0,te.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:e?.permission==="exec"?"is-active":"","aria-pressed":e?.permission==="exec",disabled:e===null,onClick:()=>o("exec"),children:"\u4EC5\u547D\u4EE4"}),(0,te.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:e?.permission==="terminal"?"is-active":"","aria-pressed":e?.permission==="terminal",disabled:e===null,onClick:()=>o("terminal"),children:"\u7EC8\u7AEF\u63A7\u5236"})]}),(0,te.jsxs)("label",{className:"dsh-ssh-access-approval",children:[(0,te.jsxs)("span",{children:[(0,te.jsx)("strong",{children:"\u6267\u884C\u524D\u786E\u8BA4"}),(0,te.jsx)("small",{children:e?.requireCommandApproval===!1?"\u5173\u95ED\u540E\u6309\u5F53\u524D\u4F1A\u8BDD\u6743\u9650\u76F4\u63A5\u6267\u884C":"\u9700 DSH \u4F7F\u7528 Ask\uFF1BFull Access \u4F1A\u76F4\u63A5\u62D2\u7EDD"})]}),(0,te.jsx)("input",{type:"checkbox",checked:e?.requireCommandApproval??!0,disabled:e===null,onChange:n=>i(n.target.checked)}),(0,te.jsx)("i",{"aria-hidden":"true"})]}),r&&(0,te.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:r})]})}function rx({profile:e,project:t,onClose:s,onSaved:r}){let[o,i]=(0,at.useState)(t?.name??""),[n,a]=(0,at.useState)(t?.path??""),[h,l]=(0,at.useState)(!1),[c,f]=(0,at.useState)(),v=async u=>{u.preventDefault(),l(!0),f(void 0);try{t===void 0?await Xl(e.id,{name:o,path:n}):await Jl(e.id,t.id,{name:o,path:n}),await r()}catch(d){f(Dl(d)),l(!1)}},g=async()=>{if(!(t===void 0||!window.confirm(`\u5220\u9664\u56FA\u5B9A\u76EE\u5F55\u201C${t.name}\u201D\uFF1F\u76F8\u5173 DSH \u4F1A\u8BDD\u4E0D\u4F1A\u5220\u9664\u3002`))){l(!0),f(void 0);try{await Yl(e.id,t.id),await r()}catch(u){f(Dl(u)),l(!1)}}};return(0,te.jsx)(Ye,{className:"dsh-ssh-project-dialog",title:t===void 0?"\u6DFB\u52A0\u56FA\u5B9A\u76EE\u5F55":"\u7F16\u8F91\u56FA\u5B9A\u76EE\u5F55",subtitle:`${e.name} \xB7 \u7EC8\u7AEF\u4E0E SFTP \u7684\u9ED8\u8BA4\u8FDC\u7AEF\u8DEF\u5F84`,onClose:s,children:(0,te.jsxs)("form",{className:"dsh-ssh-form",onSubmit:u=>{v(u)},children:[(0,te.jsxs)("label",{className:"dsh-ssh-field",children:[(0,te.jsx)("span",{children:"\u540D\u79F0"}),(0,te.jsx)("input",{required:!0,maxLength:80,value:o,placeholder:"\u7F51\u7AD9\u9879\u76EE",onChange:u=>i(u.target.value)})]}),(0,te.jsxs)("label",{className:"dsh-ssh-field",children:[(0,te.jsx)("span",{children:"\u8FDC\u7AEF\u8DEF\u5F84"}),(0,te.jsx)("input",{required:!0,maxLength:4096,value:n,spellCheck:!1,placeholder:"/var/www/example",onChange:u=>a(u.target.value)}),(0,te.jsx)("small",{children:"\u4FDD\u5B58\u524D\u4F1A\u5728\u53F3\u4FA7 SFTP \u4E2D\u9A8C\u8BC1\u8DEF\u5F84\u662F\u5426\u53EF\u8BBF\u95EE\u3002"})]}),c&&(0,te.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:c}),(0,te.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[t!==void 0&&(0,te.jsxs)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:h,onClick:()=>{g()},children:[(0,te.jsx)(Qe.IconTrashOutline16,{size:15}),"\u5220\u9664"]}),(0,te.jsx)("span",{className:"dsh-ssh-dialog-spacer"}),(0,te.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:h,onClick:s,children:"\u53D6\u6D88"}),(0,te.jsx)("button",{className:"dsh-ssh-primary-button",disabled:h,children:h?"\u4FDD\u5B58\u4E2D\u2026":"\u4FDD\u5B58\u76EE\u5F55"})]})]})})}function ix(e){let t=new Map;for(let s of e){let r=s.group?.trim()||"\u672A\u5206\u7EC4",o=t.get(r);o===void 0?t.set(r,[s]):o.push(s)}return[...t].map(([s,r])=>({name:s,profiles:r}))}function nx(e){return`${e.name} ${e.group??""} ${e.host} ${e.username} ${e.tags.join(" ")}`.toLocaleLowerCase()}function Dl(e){return e instanceof Error?e.message:String(e)}var lt=require("react");var Rl=new Set;function Mn(e){for(let t of Rl)t(e)}function qp(e){return Rl.add(e),()=>Rl.delete(e)}function Gp(e){let[t,s]=(0,lt.useState)(null),[r,o]=(0,lt.useState)(e!==void 0),[i,n]=(0,lt.useState)(!1),[a,h]=(0,lt.useState)(),l=(0,lt.useRef)(null),c=(0,lt.useRef)(e),f=(0,lt.useRef)(Promise.resolve()),v=(0,lt.useRef)(0);c.current=e,(0,lt.useEffect)(()=>{let d=!1;return l.current=null,s(null),h(void 0),o(e!==void 0),e===void 0?()=>{d=!0}:(Si(e).then(m=>{if(d)return;let p=m??bi(e);l.current=p,s(p),Mn(p)}).catch(m=>{d||h(Kp(m))}).finally(()=>{d||o(!1)}),()=>{d=!0})},[e]);let g=(0,lt.useCallback)(async d=>{l.current=d,s(d),Mn(d),h(void 0),v.current+=1,n(!0);let m=f.current.catch(()=>{}).then(()=>ki(d));f.current=m;try{let p=await m;return c.current===p.sessionId&&l.current===d&&(l.current=p,s(p),Mn(p)),p}catch(p){throw c.current===d.sessionId&&h(Kp(p)),p}finally{v.current=Math.max(0,v.current-1),c.current===d.sessionId&&v.current===0&&n(!1)}},[]),u=(0,lt.useCallback)(d=>{let m=c.current;if(m===void 0)return;let p=l.current??bi(m);g({...p,...d,sessionId:m}).catch(()=>{})},[g]);return{value:t,loading:r,saving:i,error:a,setProfiles:d=>u({profileIds:d}),setDirectory:(d,m,p)=>{let b=c.current;if(b===void 0)return;let x=l.current??bi(b),y={...x.workingDirectories},S={...x.workingProjectIds};m===void 0?delete y[d]:y[d]=m,p===void 0?delete S[d]:S[d]=p,u({workingDirectories:y,workingProjectIds:S})},setPermission:d=>u({permission:d}),setRequireCommandApproval:d=>u({requireCommandApproval:d}),setFileEndpoints:d=>u({fileEndpointIds:d}),setFilePermission:d=>u({filePermission:d}),setRequireFileApproval:d=>u({requireFileApproval:d}),replace:g}}function bi(e){return{sessionId:e,profileIds:[],permission:"exec",requireCommandApproval:!0,fileEndpointIds:[],filePermission:"browse",requireFileApproval:!0,workingDirectories:{},workingProjectIds:{},updatedAt:0}}function Kp(e){return e instanceof Error?e.message:String(e)}var ar=require("react"),Bn=require("react/jsx-runtime"),Fn=38,_i=28,xi=66,ox=320,ax=280,lx=7;function Xp(e,t,s){return Math.min(s,Math.max(t,e))}function hx(e){if(typeof window>"u")return Fn;try{let t=Number.parseFloat(window.localStorage.getItem(e)??"");return Number.isFinite(t)?Xp(t,_i,xi):Fn}catch{return Fn}}function Al(e,t){try{window.localStorage.setItem(e,t.toFixed(2))}catch{}}function cx(e){if(e<=0)return{min:_i,max:xi};let t=ax/e*100,s=(e-ox-lx)/e*100,r=Math.max(_i,t),o=Math.max(r,Math.min(xi,s));return{min:r,max:o}}function Jp({primary:e,secondary:t,storageKey:s,label:r}){let[o,i]=(0,ar.useState)(()=>hx(s)),n=(0,ar.useRef)(null),a=(0,ar.useRef)(null),h=(0,ar.useRef)(o),l=(0,ar.useRef)(),c=p=>{let b=n.current;if(b===null)return p;let x=cx(b.getBoundingClientRect().width),y=Xp(p,x.min,x.max);return b.style.setProperty("--ssh-sftp-width",`${y}%`),a.current?.setAttribute("aria-valuenow",String(Math.round(y))),h.current=y,y},f=p=>{if(l.current===void 0)return;let b=a.current;l.current=void 0,p!==void 0&&b?.hasPointerCapture(p)&&b.releasePointerCapture(p),n.current?.classList.remove("is-resizing");let x=h.current;i(x),Al(s,x)},v=p=>{p.button===0&&(l.current=p.pointerId,h.current=o,p.currentTarget.setPointerCapture(p.pointerId),n.current?.classList.add("is-resizing"),p.preventDefault())},g=p=>{if(l.current!==p.pointerId)return;let b=n.current?.getBoundingClientRect();b===void 0||b.width===0||(c((b.right-p.clientX)/b.width*100),p.preventDefault())},u=p=>{let b=p.shiftKey?5:2,x;if(p.key==="ArrowLeft"&&(x=o+b),p.key==="ArrowRight"&&(x=o-b),p.key==="Home"&&(x=_i),p.key==="End"&&(x=xi),x===void 0)return;let y=c(x);i(y),Al(s,y),p.preventDefault()},d=()=>{let p=c(Fn);i(p),Al(s,p)},m={"--ssh-sftp-width":`${o}%`};return(0,Bn.jsxs)("div",{ref:n,className:"dsh-ssh-workbench-split",style:m,children:[e,(0,Bn.jsx)("div",{ref:a,className:"dsh-ssh-workbench-resizer",role:"separator","aria-label":r,"aria-orientation":"vertical","aria-valuemin":_i,"aria-valuemax":xi,"aria-valuenow":Math.round(o),tabIndex:0,title:"\u62D6\u52A8\u8C03\u6574\u5BBD\u5EA6\uFF0C\u53CC\u51FB\u6062\u590D\u9ED8\u8BA4",onDoubleClick:d,onKeyDown:u,onPointerDown:v,onPointerMove:g,onPointerUp:p=>f(p.pointerId),onPointerCancel:p=>f(p.pointerId),onLostPointerCapture:()=>f()}),t]})}var It=require("react"),kt=require("@deepseek-ai/dsh-client-ui-primitives");var K=require("react/jsx-runtime");function Yp({profile:e,dependents:t,onClose:s,onDeleted:r}){let[o,i]=(0,It.useState)(!1),[n,a]=(0,It.useState)(),h=async()=>{if(!(o||t.length>0)){i(!0),a(void 0);try{await oe(`/profiles/${encodeURIComponent(e.id)}`,{method:"DELETE"}),r()}catch(l){a(De(l))}finally{i(!1)}}};return(0,K.jsx)(Ye,{title:`\u5220\u9664 ${e.name}`,subtitle:Yt(e),onClose:s,children:(0,K.jsxs)("div",{className:"dsh-ssh-delete-profile",children:[(0,K.jsx)("span",{className:"dsh-ssh-delete-profile-mark",children:(0,K.jsx)(kt.IconTrashOutline16,{size:19})}),(0,K.jsxs)("div",{children:[(0,K.jsx)("strong",{children:"\u8FD9\u4E2A\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500"}),(0,K.jsx)("p",{children:"\u8FDE\u63A5\u914D\u7F6E\u3001\u8BE5\u4E3B\u673A\u7684\u72EC\u7ACB\u51ED\u636E\u548C\u5173\u8054\u7AEF\u53E3\u8F6C\u53D1\u4F1A\u4E00\u5E76\u5220\u9664\uFF1B\u5B83\u4E5F\u4F1A\u4ECE\u6240\u6709\u4F1A\u8BDD\u6388\u6743\u4E2D\u79FB\u9664\u3002\u5BC6\u94A5\u5E93\u4E2D\u7684\u5171\u4EAB\u51ED\u636E\u4E0D\u4F1A\u5220\u9664\u3002"})]}),t.length>0&&(0,K.jsxs)("div",{className:"dsh-ssh-delete-profile-block",role:"alert",children:[(0,K.jsx)("strong",{children:"\u6682\u65F6\u4E0D\u80FD\u5220\u9664"}),(0,K.jsxs)("p",{children:["\u4EE5\u4E0B\u8FDE\u63A5\u4ECD\u5C06\u5B83\u4F5C\u4E3A SSH \u8DF3\u677F\uFF1A",t.map(l=>l.name).join("\u3001"),"\u3002\u8BF7\u5148\u4FEE\u6539\u8FD9\u4E9B\u8FDE\u63A5\u7684\u8DF3\u677F\u94FE\u3002"]})]}),n&&(0,K.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:n}),(0,K.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,K.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:o,onClick:s,children:"\u53D6\u6D88"}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:o||t.length>0,onClick:()=>{h()},children:o?"\u6B63\u5728\u5220\u9664\u2026":"\u5220\u9664\u4E3B\u673A"})]})]})})}function Qp({profile:e,profiles:t,vaultEntries:s,proxyEntries:r,onClose:o,onSaved:i}){let[n,a]=(0,It.useState)(()=>({name:e?.name??"",group:e?.group??"",host:e?.host??"",port:String(e?.port??22),username:e?.username??"",authType:e?.authType??"password",credentialId:e?.credentialId??"",proxyType:e?.proxy.type??"none",proxyEntryId:e?.proxy.type==="saved"?e.proxy.proxyId:"",proxyHost:e?.proxy.type==="http"||e?.proxy.type==="socks5"?e.proxy.host:"",proxyPort:e?.proxy.type==="http"||e?.proxy.type==="socks5"?String(e.proxy.port):"1080",proxyUsername:e?.proxy.type==="http"||e?.proxy.type==="socks5"?e.proxy.username??"":"",jumpProfileIds:e?.proxy.type==="jump"?e.proxy.profileIds:[],tags:e?.tags.join(", ")??"",password:"",privateKey:"",passphrase:"",proxyPassword:"",hostFingerprint:e?.hostFingerprint??""})),[h,l]=(0,It.useState)(!1),[c,f]=(0,It.useState)(!1),[v,g]=(0,It.useState)(),[u,d]=(0,It.useState)(),[m,p]=(0,It.useState)(),b=P=>({value:n[P],onChange:T=>{a(A=>({...A,[P]:T.target.value})),g(void 0),d(void 0)}}),x=s.find(P=>P.id===n.credentialId),y=(0,It.useMemo)(()=>t.flatMap(P=>P.group===void 0?[]:[P.group]),[t]),S=(0,It.useMemo)(()=>t.flatMap(P=>P.tags),[t]),_=(P=n.hostFingerprint)=>{let T=n.proxyType==="none"?{type:"none"}:n.proxyType==="saved"?{type:"saved",proxyId:n.proxyEntryId}:n.proxyType==="jump"?{type:"jump",profileIds:n.jumpProfileIds}:{type:n.proxyType,host:n.proxyHost,port:Number(n.proxyPort),...n.proxyUsername.trim()?{username:n.proxyUsername.trim()}:{}};return{profile:{name:n.name,...n.group.trim()?{group:n.group.trim()}:{},host:n.host,port:Number(n.port),username:x?.username??n.username,authType:x?.authType??n.authType,...n.credentialId?{credentialId:n.credentialId}:{},...P?{hostFingerprint:P}:{},proxy:T,keepAliveIntervalMs:e?.keepAliveIntervalMs??15e3,connectTimeoutMs:e?.connectTimeoutMs??15e3,terminalType:e?.terminalType??"xterm-256color",tags:n.tags.split(",").map(A=>A.trim()).filter(Boolean)},secrets:{password:n.password,privateKey:n.privateKey,passphrase:n.passphrase,proxyPassword:n.proxyPassword}}},w=async P=>{f(!0),p(void 0),g(void 0),d(void 0);try{await oe("/profiles/test-draft",{method:"POST",body:JSON.stringify({..._(P),...e===void 0?{}:{profileId:e.id}})}),P!==void 0&&a(T=>({...T,hostFingerprint:P})),g("success")}catch(T){T instanceof cs&&T.body?.code==="HOST_KEY_REQUIRED"&&typeof T.body.fingerprint=="string"?d(T.body.fingerprint):p(De(T))}finally{f(!1)}},C=async P=>{P.preventDefault(),l(!0),p(void 0);try{await oe(e===void 0?"/profiles":`/profiles/${e.id}`,{method:e===void 0?"POST":"PUT",body:JSON.stringify(_())}),i()}catch(T){p(De(T))}finally{l(!1)}};return(0,K.jsx)(Ye,{title:e===void 0?"\u65B0\u5EFA SSH \u8FDE\u63A5":`\u7F16\u8F91 ${e.name}`,subtitle:"\u51ED\u636E\u4FDD\u5B58\u540E\u4E0D\u4F1A\u56DE\u663E",onClose:o,children:(0,K.jsxs)("form",{className:"dsh-ssh-form",onSubmit:P=>{C(P)},children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section",children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,K.jsx)("strong",{children:"\u8FDE\u63A5\u4FE1\u606F"}),(0,K.jsx)("small",{children:"\u4E3B\u673A\u5730\u5740\u4E0E\u663E\u793A\u65B9\u5F0F"})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,K.jsx)(le,{label:"\u540D\u79F0",children:(0,K.jsx)("input",{required:!0,maxLength:80,placeholder:"\u5F00\u53D1\u670D\u52A1\u5668",...b("name")})}),(0,K.jsx)(le,{label:"\u5206\u7EC4",children:(0,K.jsx)(Rr,{ariaLabel:"\u4E3B\u673A\u5206\u7EC4",maxLength:64,options:y,placeholder:"\u9009\u62E9\u5DF2\u6709\u5206\u7EC4\u6216\u8F93\u5165\u65B0\u5206\u7EC4",value:n.group,onChange:P=>a(T=>({...T,group:P}))})})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,K.jsx)(le,{label:"\u4E3B\u673A",children:(0,K.jsx)("input",{required:!0,placeholder:"server.example.com",spellCheck:!1,...b("host")})}),(0,K.jsx)(le,{label:"\u7AEF\u53E3",children:(0,K.jsx)("input",{required:!0,type:"number",inputMode:"numeric",min:"1",max:"65535",...b("port")})})]}),(0,K.jsx)(le,{label:"\u6807\u7B7E",hint:"\u53EF\u9009\u62E9\u5DF2\u6709\u6807\u7B7E\u6216\u76F4\u63A5\u8F93\u5165\uFF1B\u591A\u4E2A\u6807\u7B7E\u4F7F\u7528\u9017\u53F7\u5206\u9694\u3002",children:(0,K.jsx)(Rr,{ariaLabel:"\u4E3B\u673A\u6807\u7B7E",multiple:!0,options:S,placeholder:"\u9009\u62E9\u6216\u8F93\u5165\u6807\u7B7E",value:n.tags,onChange:P=>a(T=>({...T,tags:P}))})})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-section",children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,K.jsx)("strong",{children:"\u8EAB\u4EFD\u8BA4\u8BC1"}),(0,K.jsx)("small",{children:"\u9009\u62E9\u5171\u4EAB\u51ED\u636E\u6216\u5355\u72EC\u4FDD\u5B58"})]}),(0,K.jsx)(le,{label:"\u51ED\u636E\u6765\u6E90",hint:"\u53EF\u4F7F\u7528\u6B64\u8FDE\u63A5\u81EA\u5DF1\u7684\u51ED\u636E\uFF0C\u6216\u5F15\u7528\u5BC6\u94A5\u5E93\u4E2D\u7684\u5E38\u7528\u8D26\u53F7\u3002",children:(0,K.jsxs)("select",{...b("credentialId"),children:[(0,K.jsx)("option",{value:"",children:"\u6B64\u8FDE\u63A5\u72EC\u7ACB\u4FDD\u5B58"}),s.map(P=>(0,K.jsxs)("option",{value:P.id,children:[P.name," \xB7 ",P.username]},P.id))]})}),x?(0,K.jsxs)("div",{className:"dsh-ssh-credential-reference",children:[(0,K.jsx)("span",{children:(0,K.jsx)(kt.IconUserOutline16,{size:16})}),(0,K.jsxs)("span",{children:[(0,K.jsx)("strong",{children:x.name}),(0,K.jsxs)("small",{children:[x.username," \xB7 ",x.authType==="password"?"\u5BC6\u7801":"\u79C1\u94A5"]})]}),(0,K.jsx)("em",{children:x.credential.configured?"\u5DF2\u5C31\u7EEA":"\u7F3A\u5C11\u51ED\u636E"})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,K.jsx)(le,{label:"\u7528\u6237\u540D",children:(0,K.jsx)("input",{required:!0,autoComplete:"username",...b("username")})}),(0,K.jsx)(le,{label:"\u8BA4\u8BC1\u65B9\u5F0F",children:(0,K.jsxs)("select",{...b("authType"),children:[(0,K.jsx)("option",{value:"password",children:"\u5BC6\u7801"}),(0,K.jsx)("option",{value:"private-key",children:"\u79C1\u94A5"}),(0,K.jsx)("option",{value:"agent",children:"SSH Agent"})]})})]}),n.authType==="password"&&(0,K.jsx)(le,{label:"\u5BC6\u7801",hint:e?.credential.source==="profile"&&e.credential.fields.includes("password")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u4FDD\u5B58\u540E\u4E0D\u53EF\u8BFB\u56DE",children:(0,K.jsx)("input",{required:e===void 0,type:"password",autoComplete:"new-password",placeholder:e?.credential.source==="profile"&&e.credential.fields.includes("password")?"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022":"",...b("password")})}),n.authType==="private-key"&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(le,{label:"\u79C1\u94A5",hint:e?.credential.source==="profile"&&e.credential.fields.includes("privateKey")?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u7C98\u8D34 OpenSSH/PEM \u79C1\u94A5",children:(0,K.jsx)("textarea",{required:e===void 0,rows:5,spellCheck:!1,...b("privateKey")})}),(0,K.jsx)(le,{label:"\u79C1\u94A5\u53E3\u4EE4",children:(0,K.jsx)("input",{type:"password",autoComplete:"new-password",...b("passphrase")})})]})]})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-section",children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,K.jsx)("strong",{children:"\u8FDE\u63A5\u8DEF\u5F84"}),(0,K.jsx)("small",{children:"\u76F4\u8FDE\u3001\u4EE3\u7406\u6216\u8DF3\u677F\u94FE"})]}),(0,K.jsx)(le,{label:"\u8FDE\u63A5\u65B9\u5F0F",children:(0,K.jsxs)("select",{...b("proxyType"),children:[(0,K.jsx)("option",{value:"none",children:"\u76F4\u8FDE"}),(0,K.jsx)("option",{value:"saved",children:"\u5E38\u7528\u4EE3\u7406"}),(0,K.jsx)("option",{value:"http",children:"\u81EA\u5B9A\u4E49 HTTP CONNECT"}),(0,K.jsx)("option",{value:"socks5",children:"\u81EA\u5B9A\u4E49 SOCKS5"}),(0,K.jsx)("option",{value:"jump",children:"SSH \u8DF3\u677F"})]})}),n.proxyType==="saved"&&(0,K.jsx)(le,{label:"\u5E38\u7528\u4EE3\u7406",hint:r.length===0?"\u8BF7\u5148\u5728\u4EE3\u7406\u5E93\u4E2D\u6DFB\u52A0 HTTP \u6216 SOCKS5 \u4EE3\u7406\u3002":"\u591A\u53F0\u4E3B\u673A\u53EF\u5F15\u7528\u540C\u4E00\u6761\u4EE3\u7406\u914D\u7F6E\u3002",children:(0,K.jsxs)("select",{required:!0,...b("proxyEntryId"),children:[(0,K.jsx)("option",{value:"",children:"\u9009\u62E9\u4EE3\u7406"}),r.map(P=>(0,K.jsxs)("option",{value:P.id,children:[P.name," \xB7 ",P.proxyType==="http"?"HTTP":"SOCKS5"," \xB7 ",P.host,":",P.port]},P.id))]})}),(n.proxyType==="http"||n.proxyType==="socks5")&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,K.jsx)(le,{label:"\u4EE3\u7406\u4E3B\u673A",children:(0,K.jsx)("input",{required:!0,spellCheck:!1,...b("proxyHost")})}),(0,K.jsx)(le,{label:"\u4EE3\u7406\u7AEF\u53E3",children:(0,K.jsx)("input",{required:!0,type:"number",inputMode:"numeric",min:"1",max:"65535",...b("proxyPort")})})]}),(0,K.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,K.jsx)(le,{label:"\u4EE3\u7406\u7528\u6237\u540D",children:(0,K.jsx)("input",{autoComplete:"username",...b("proxyUsername")})}),(0,K.jsx)(le,{label:"\u4EE3\u7406\u5BC6\u7801",children:(0,K.jsx)("input",{type:"password",autoComplete:"new-password",...b("proxyPassword")})})]})]}),n.proxyType==="jump"&&(0,K.jsx)(dx,{profiles:t.filter(P=>P.id!==e?.id),value:n.jumpProfileIds,onChange:P=>a(T=>({...T,jumpProfileIds:P}))})]}),u&&(0,K.jsxs)("div",{className:"dsh-ssh-test-result is-warning",role:"alert",children:[(0,K.jsxs)("span",{children:[(0,K.jsx)("strong",{children:"\u9996\u6B21\u8FDE\u63A5\uFF0C\u8BF7\u6838\u5BF9\u4E3B\u673A\u6307\u7EB9"}),(0,K.jsx)("code",{children:u})]}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-small-primary",disabled:c,onClick:()=>{w(u)},children:"\u786E\u8BA4\u5E76\u91CD\u8BD5"})]}),v==="success"&&(0,K.jsxs)("p",{className:"dsh-ssh-test-result is-success",role:"status",children:[(0,K.jsx)(kt.IconCheckOutline14,{size:14}),"\u8FDE\u63A5\u6D4B\u8BD5\u6210\u529F"]}),m&&(0,K.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:m}),(0,K.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,K.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button dsh-ssh-test-button",disabled:h||c,onClick:P=>{P.currentTarget.form?.reportValidity()&&w()},children:c?"\u6B63\u5728\u6D4B\u8BD5\u2026":"\u6D4B\u8BD5\u8FDE\u63A5"}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,disabled:h||c,onClick:o,children:"\u53D6\u6D88"}),(0,K.jsx)("button",{className:"dsh-ssh-primary-button",disabled:h||c,children:h?"\u6B63\u5728\u4FDD\u5B58\u2026":"\u4FDD\u5B58\u8FDE\u63A5"})]})]})})}function dx({profiles:e,value:t,onChange:s}){let r=()=>{let n=e.find(a=>!t.includes(a.id));n!==void 0&&t.length<8&&s([...t,n.id])},o=(n,a)=>s(t.map((h,l)=>l===n?a:h)),i=(n,a)=>{let h=n+a;if(h<0||h>=t.length)return;let l=[...t];[l[n],l[h]]=[l[h],l[n]],s(l)};return(0,K.jsxs)("fieldset",{className:"dsh-ssh-jump-chain",children:[(0,K.jsx)("legend",{children:"\u8DF3\u677F\u94FE"}),(0,K.jsx)("p",{children:"\u8FDE\u63A5\u4F1A\u6309\u4ECE\u4E0A\u5230\u4E0B\u7684\u987A\u5E8F\u9010\u7EA7\u5EFA\u7ACB\u3002"}),(0,K.jsx)("div",{children:t.map((n,a)=>(0,K.jsxs)("div",{className:"dsh-ssh-jump-row",children:[(0,K.jsx)("em",{children:a+1}),(0,K.jsxs)("select",{required:!0,value:n,onChange:h=>o(a,h.target.value),children:[(0,K.jsx)("option",{value:"",children:"\u9009\u62E9\u5DF2\u6709\u8FDE\u63A5"}),e.filter(h=>h.id===n||!t.includes(h.id)).map(h=>(0,K.jsxs)("option",{value:h.id,children:[h.name," \xB7 ",h.host]},h.id))]}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",disabled:a===0,"aria-label":"\u4E0A\u79FB\u8DF3\u677F",onClick:()=>i(a,-1),children:(0,K.jsx)(kt.IconChevronUpOutline14,{size:14})}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-icon-button",disabled:a===t.length-1,"aria-label":"\u4E0B\u79FB\u8DF3\u677F",onClick:()=>i(a,1),children:(0,K.jsx)(kt.IconChevronDownOutline14,{size:14})}),(0,K.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":"\u79FB\u9664\u8DF3\u677F",onClick:()=>s(t.filter((h,l)=>l!==a)),children:(0,K.jsx)(kt.IconTrashOutline16,{size:15})})]},`${n}-${a}`))}),t.length===0&&(0,K.jsx)("p",{className:"dsh-ssh-jump-empty",children:"\u81F3\u5C11\u6DFB\u52A0\u4E00\u53F0\u8DF3\u677F\u4E3B\u673A\u3002"}),(0,K.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",disabled:t.length>=8||e.every(n=>t.includes(n.id)),onClick:r,children:[(0,K.jsx)(kt.IconPlusOutline16,{size:15}),"\u6DFB\u52A0\u8DF3\u677F"]})]})}var be=require("react"),Ot=require("@deepseek-ai/dsh-client-ui-primitives");var Ct=require("react"),Lt=require("@deepseek-ai/dsh-client-ui-primitives");var j=require("react/jsx-runtime");function Zp({profiles:e,vaultEntries:t,proxyEntries:s,onClose:r,onChanged:o}){let[i,n]=(0,Ct.useState)(),[a,h]=(0,Ct.useState)(),[l,c]=(0,Ct.useState)(),f=i!==void 0||a!==void 0,v=m=>{h(void 0),n(m),c(void 0)},g=()=>{h(void 0),n("new"),c(void 0)},u=m=>{n(void 0),h(m),c(void 0)},d=async m=>{c(void 0);try{await oe(`/ftp-profiles/${encodeURIComponent(m.id)}`,{method:"DELETE"}),h(void 0),o()}catch(p){c(De(p))}};return(0,j.jsx)(Ye,{className:"dsh-ssh-ftp-manager-dialog",title:"\u6587\u4EF6\u8FDE\u63A5",subtitle:"\u7BA1\u7406 FTP \u4E0E FTPS\uFF1BSFTP \u76F4\u63A5\u590D\u7528\u5DF2\u6709 SSH \u4E3B\u673A",onClose:r,children:(0,j.jsxs)("div",{className:`dsh-ssh-ftp-manager${f?" has-detail":""}`,children:[(0,j.jsxs)("aside",{className:"dsh-ssh-ftp-manager-list",children:[(0,j.jsxs)("header",{children:[(0,j.jsxs)("span",{children:[(0,j.jsx)("strong",{children:"FTP / FTPS"}),(0,j.jsxs)("small",{children:[e.length," \u4E2A\u8FDE\u63A5"]})]}),(0,j.jsxs)("button",{type:"button",className:"dsh-ssh-primary-button",onClick:g,children:[(0,j.jsx)(Lt.IconPlusOutline16,{size:15}),"\u65B0\u5EFA"]})]}),e.length===0?(0,j.jsxs)("div",{className:"dsh-ssh-ftp-list-empty",children:[(0,j.jsx)("span",{children:(0,j.jsx)(Lt.IconDataOutline16,{size:20})}),(0,j.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u72EC\u7ACB\u6587\u4EF6\u8FDE\u63A5"}),(0,j.jsx)("p",{children:"SFTP \u4F1A\u663E\u793A\u5728\u6587\u4EF6\u7A97\u683C\u7684\u8FDE\u63A5\u5217\u8868\u4E2D\uFF1B\u8FD9\u91CC\u53EA\u7BA1\u7406 FTP \u4E0E FTPS\u3002"}),(0,j.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:g,children:"\u65B0\u5EFA FTPS \u8FDE\u63A5"})]}):(0,j.jsx)("div",{className:"dsh-ssh-ftp-profile-list",role:"list",children:e.map(m=>{let p=i!=="new"&&i?.id===m.id||a?.id===m.id;return(0,j.jsxs)("article",{role:"listitem","data-ssh-interactive":"choice","aria-selected":p,className:p?"is-active":"",children:[(0,j.jsxs)("button",{type:"button",className:"dsh-ssh-ftp-profile-main",onClick:()=>v(m),children:[(0,j.jsx)("span",{className:`dsh-ssh-protocol-badge is-${m.protocol}`,children:fx(m.protocol)}),(0,j.jsxs)("span",{children:[(0,j.jsx)("strong",{title:m.name,children:m.name}),(0,j.jsxs)("small",{title:`${m.username}@${m.host}:${m.port}`,children:[m.username,"@",m.host,":",m.port]})]}),(0,j.jsx)("i",{className:m.credential.configured?"is-ready":"is-missing",children:m.credential.configured?"\u53EF\u7528":"\u7F3A\u5C11\u5BC6\u7801"})]}),(0,j.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":`\u5220\u9664 ${m.name}`,onClick:()=>u(m),children:(0,j.jsx)(Lt.IconTrashOutline16,{size:15})})]},m.id)})})]}),(0,j.jsx)("main",{className:"dsh-ssh-ftp-manager-detail",children:a!==void 0?(0,j.jsx)(ux,{profile:a,error:l,onBack:()=>h(void 0),onDelete:()=>d(a)}):i!==void 0?(0,j.jsx)(px,{value:i==="new"?void 0:i,profiles:e,vaultEntries:t,proxyEntries:s,onBack:()=>n(void 0),onSaved:()=>{n(void 0),o()}},i==="new"?"new":i.id):(0,j.jsxs)("div",{className:"dsh-ssh-ftp-manager-overview",children:[(0,j.jsx)("span",{children:(0,j.jsx)(Lt.IconDataOutline16,{size:22})}),(0,j.jsx)("h3",{children:"\u9009\u62E9\u4E00\u4E2A\u8FDE\u63A5\u8FDB\u884C\u7F16\u8F91"}),(0,j.jsx)("p",{children:"\u6587\u4EF6\u7A97\u683C\u4F1A\u628A\u8FD9\u91CC\u4FDD\u5B58\u7684 FTP\u3001FTPS \u4E0E SSH \u4E3B\u673A\u63D0\u4F9B\u7684 SFTP \u6C47\u603B\u6210\u8FDE\u63A5\u5217\u8868\u3002"}),(0,j.jsxs)("dl",{children:[(0,j.jsxs)("div",{children:[(0,j.jsx)("dt",{children:"FTPS"}),(0,j.jsx)("dd",{children:"\u52A0\u5BC6\u63A7\u5236\u4E0E\u6587\u4EF6\u6570\u636E\uFF0C\u9ED8\u8BA4\u4E25\u683C\u6821\u9A8C\u8BC1\u4E66"})]}),(0,j.jsxs)("div",{children:[(0,j.jsx)("dt",{children:"FTP"}),(0,j.jsx)("dd",{children:"\u517C\u5BB9\u65E7\u670D\u52A1\u5668\uFF0C\u4F46\u8D26\u53F7\u548C\u6587\u4EF6\u5185\u5BB9\u4E0D\u52A0\u5BC6"})]}),(0,j.jsxs)("div",{children:[(0,j.jsx)("dt",{children:"SFTP"}),(0,j.jsx)("dd",{children:"\u7531 SSH \u4E3B\u673A\u7BA1\u7406\uFF0C\u4E0D\u5728\u8FD9\u91CC\u91CD\u590D\u914D\u7F6E"})]})]})]})})]})})}function ux({profile:e,error:t,onBack:s,onDelete:r}){let[o,i]=(0,Ct.useState)(!1);return(0,j.jsxs)("div",{className:"dsh-ssh-ftp-delete-panel",children:[(0,j.jsxs)("button",{type:"button",className:"dsh-ssh-ftp-detail-back",onClick:s,children:[(0,j.jsx)(Lt.IconChevronLeftOutline14,{size:14}),"\u8FD4\u56DE\u8FDE\u63A5\u5217\u8868"]}),(0,j.jsx)("span",{className:"dsh-ssh-ftp-delete-mark",children:(0,j.jsx)(Lt.IconWarningOutline16,{size:20})}),(0,j.jsxs)("h3",{children:["\u5220\u9664\u201C",e.name,"\u201D\uFF1F"]}),(0,j.jsx)("p",{children:"\u5C06\u79FB\u9664\u8BE5 FTP/FTPS \u8FDE\u63A5\u53CA\u5176\u72EC\u7ACB\u4FDD\u5B58\u7684\u5BC6\u7801\uFF0C\u4E0D\u4F1A\u5220\u9664\u8FDC\u7AEF\u670D\u52A1\u5668\u4E0A\u7684\u4EFB\u4F55\u6587\u4EF6\u3002"}),(0,j.jsxs)("code",{children:[e.username,"@",e.host,":",e.port]}),t&&(0,j.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:t}),(0,j.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,j.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:s,disabled:o,children:"\u53D6\u6D88"}),(0,j.jsx)("button",{type:"button",className:"dsh-ssh-danger-button",disabled:o,onClick:()=>{i(!0),r().finally(()=>i(!1))},children:o?"\u6B63\u5728\u5220\u9664\u2026":"\u5220\u9664\u8FDE\u63A5"})]})]})}function px({value:e,profiles:t,vaultEntries:s,proxyEntries:r,onBack:o,onSaved:i}){let n=s.filter(w=>w.authType==="password"),[a,h]=(0,Ct.useState)({name:e?.name??"",group:e?.group??"",protocol:e?.protocol??"ftps-explicit",host:e?.host??"",port:String(e?.port??21),username:e?.username??"",credentialId:e?.credentialId??"",password:"",proxyId:e?.proxy.type==="saved"?e.proxy.proxyId:"",initialPath:e?.initialPath??"/",connectTimeoutMs:String(e?.connectTimeoutMs??15e3),tlsServerName:e?.tlsServerName??"",tags:e?.tags.join(", ")??""}),[l,c]=(0,Ct.useState)(!1),[f,v]=(0,Ct.useState)(!1),[g,u]=(0,Ct.useState)(),[d,m]=(0,Ct.useState)(),p=()=>({profile:{name:a.name,...a.group.trim()?{group:a.group.trim()}:{},protocol:a.protocol,host:a.host,port:Number(a.port),username:a.username,...a.credentialId?{credentialId:a.credentialId}:{},proxy:a.proxyId?{type:"saved",proxyId:a.proxyId}:{type:"none"},initialPath:a.initialPath,connectTimeoutMs:Number(a.connectTimeoutMs),...a.tlsServerName.trim()?{tlsServerName:a.tlsServerName.trim()}:{},tags:a.tags.split(/[,,]/u).map(w=>w.trim()).filter(Boolean)},secrets:{password:a.password}}),b=async w=>{w.preventDefault(),c(!0),m(void 0),u(void 0);try{await oe(e===void 0?"/ftp-profiles":`/ftp-profiles/${encodeURIComponent(e.id)}`,{method:e===void 0?"POST":"PUT",body:JSON.stringify(p())}),i()}catch(C){m(De(C))}finally{c(!1)}},x=async()=>{v(!0),m(void 0),u(void 0);try{await oe("/ftp-profiles/test-draft",{method:"POST",body:JSON.stringify({...p(),...e===void 0?{}:{profileId:e.id}})}),u("\u8FDE\u63A5\u6210\u529F\uFF0C\u521D\u59CB\u76EE\u5F55\u53EF\u8BFB\u53D6")}catch(w){m(De(w))}finally{v(!1)}},y=w=>h(C=>({...C,protocol:w,port:C.port==="21"||C.port==="990"?String(w==="ftps-implicit"?990:21):C.port})),S=(0,Ct.useMemo)(()=>t.flatMap(w=>w.group===void 0?[]:[w.group]),[t]),_=(0,Ct.useMemo)(()=>t.flatMap(w=>w.tags),[t]);return(0,j.jsxs)("form",{className:"dsh-ssh-ftp-editor-form",onSubmit:w=>{b(w)},children:[(0,j.jsxs)("header",{className:"dsh-ssh-ftp-editor-heading",children:[(0,j.jsxs)("button",{type:"button",className:"dsh-ssh-ftp-detail-back",onClick:o,children:[(0,j.jsx)(Lt.IconChevronLeftOutline14,{size:14}),"\u8FD4\u56DE\u8FDE\u63A5\u5217\u8868"]}),(0,j.jsxs)("span",{children:[(0,j.jsx)("strong",{children:e===void 0?"\u65B0\u5EFA\u6587\u4EF6\u8FDE\u63A5":e.name}),(0,j.jsx)("small",{children:e===void 0?"\u586B\u5199\u670D\u52A1\u5668\u548C\u8BA4\u8BC1\u4FE1\u606F":"\u4FEE\u6539\u540E\u53EF\u5148\u6D4B\u8BD5\u518D\u4FDD\u5B58"})]})]}),(0,j.jsxs)("div",{className:"dsh-ssh-ftp-editor-scroll",children:[(0,j.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,j.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,j.jsx)("strong",{children:"\u8FDE\u63A5\u7C7B\u578B"}),(0,j.jsx)("small",{children:"\u4F18\u5148\u4F7F\u7528 FTPS\uFF1B\u4EC5\u5728\u670D\u52A1\u5668\u4E0D\u652F\u6301 TLS \u65F6\u9009\u62E9 FTP"})]}),(0,j.jsx)("div",{className:"dsh-ssh-ftp-protocol-options",role:"radiogroup","aria-label":"\u8FDE\u63A5\u534F\u8BAE",children:[["ftps-explicit","FTPS","\u663E\u5F0F TLS \xB7 \u63A8\u8350"],["ftps-implicit","FTPS-I","\u9690\u5F0F TLS"],["ftp","FTP","\u672A\u52A0\u5BC6"]].map(w=>(0,j.jsxs)("button",{type:"button","data-ssh-interactive":"choice",role:"radio","aria-checked":a.protocol===w[0],className:a.protocol===w[0]?"is-active":"",onClick:()=>y(w[0]),children:[(0,j.jsx)("span",{className:`dsh-ssh-protocol-badge is-${w[0]}`,children:w[1]}),(0,j.jsxs)("span",{children:[(0,j.jsx)("strong",{children:w[1]}),(0,j.jsx)("small",{children:w[2]})]})]},w[0]))}),a.protocol==="ftp"&&(0,j.jsx)("p",{className:"dsh-ssh-form-warning",children:"\u666E\u901A FTP \u7684\u8D26\u53F7\u3001\u5BC6\u7801\u548C\u6587\u4EF6\u5185\u5BB9\u5747\u4E0D\u52A0\u5BC6\u3002"})]}),(0,j.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,j.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,j.jsx)("strong",{children:"\u670D\u52A1\u5668"}),(0,j.jsx)("small",{children:"\u540D\u79F0\u7528\u4E8E\u8FDE\u63A5\u5217\u8868\uFF0C\u5206\u7EC4\u4E0E\u6807\u7B7E\u53EF\u590D\u7528\u5DF2\u6709\u9009\u9879"})]}),(0,j.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,j.jsx)(le,{label:"\u8FDE\u63A5\u540D\u79F0",children:(0,j.jsx)("input",{autoFocus:e===void 0,required:!0,maxLength:80,value:a.name,onChange:w=>h({...a,name:w.target.value})})}),(0,j.jsx)(le,{label:"\u5206\u7EC4\uFF08\u53EF\u9009\uFF09",children:(0,j.jsx)(Rr,{ariaLabel:"FTP \u5206\u7EC4",maxLength:64,options:S,placeholder:"\u9009\u62E9\u5DF2\u6709\u5206\u7EC4\u6216\u8F93\u5165\u65B0\u5206\u7EC4",value:a.group,onChange:w=>h(C=>({...C,group:w}))})})]}),(0,j.jsxs)("div",{className:"dsh-ssh-form-grid is-host",children:[(0,j.jsx)(le,{label:"\u670D\u52A1\u5668\u5730\u5740",children:(0,j.jsx)("input",{required:!0,maxLength:253,spellCheck:!1,value:a.host,onChange:w=>h({...a,host:w.target.value})})}),(0,j.jsx)(le,{label:"\u7AEF\u53E3",children:(0,j.jsx)("input",{required:!0,type:"number",min:"1",max:"65535",value:a.port,onChange:w=>h({...a,port:w.target.value})})})]}),(0,j.jsx)(le,{label:"\u6807\u7B7E\uFF08\u53EF\u9009\uFF09",hint:"\u53EF\u9009\u62E9\u5DF2\u6709\u6807\u7B7E\u6216\u76F4\u63A5\u8F93\u5165\uFF1B\u591A\u4E2A\u6807\u7B7E\u4F7F\u7528\u9017\u53F7\u5206\u9694\u3002",children:(0,j.jsx)(Rr,{ariaLabel:"FTP \u6807\u7B7E",multiple:!0,options:_,placeholder:"\u9009\u62E9\u6216\u8F93\u5165\u6807\u7B7E",value:a.tags,onChange:w=>h(C=>({...C,tags:w}))})})]}),(0,j.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,j.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,j.jsx)("strong",{children:"\u8EAB\u4EFD\u8BA4\u8BC1"}),(0,j.jsx)("small",{children:"\u5BC6\u7801\u53EA\u5199\u5165 DSH \u51ED\u636E\u670D\u52A1\uFF0C\u4E0D\u4F1A\u5728\u754C\u9762\u56DE\u663E"})]}),(0,j.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,j.jsx)(le,{label:"\u7528\u6237\u540D",children:(0,j.jsx)("input",{required:!0,maxLength:128,autoComplete:"username",value:a.username,onChange:w=>h({...a,username:w.target.value})})}),(0,j.jsx)(le,{label:"\u51ED\u636E\u6765\u6E90",children:(0,j.jsxs)("select",{value:a.credentialId,onChange:w=>h({...a,credentialId:w.target.value}),children:[(0,j.jsx)("option",{value:"",children:"\u6B64\u8FDE\u63A5\u5355\u72EC\u4FDD\u5B58\u5BC6\u7801"}),n.map(w=>(0,j.jsxs)("option",{value:w.id,children:[w.name," \xB7 ",w.username]},w.id))]})})]}),!a.credentialId&&(0,j.jsx)(le,{label:"\u5BC6\u7801",hint:e?.credential.configured&&e.credential.source==="profile"?"\u5DF2\u4FDD\u5B58\uFF1B\u7559\u7A7A\u4FDD\u6301\u4E0D\u53D8":"\u4FDD\u5B58\u540E\u4E0D\u4F1A\u56DE\u663E",children:(0,j.jsx)("input",{required:e===void 0||e.credential.source!=="profile"||!e.credential.configured,type:"password",autoComplete:"new-password",value:a.password,onChange:w=>h({...a,password:w.target.value})})})]}),(0,j.jsxs)("section",{className:"dsh-ssh-ftp-editor-section",children:[(0,j.jsxs)("div",{className:"dsh-ssh-form-section-heading",children:[(0,j.jsx)("strong",{children:"\u8DEF\u5F84\u4E0E\u7F51\u7EDC"}),(0,j.jsx)("small",{children:"\u4EE3\u7406\u590D\u7528 SSH \u63D2\u4EF6\u7684\u4EE3\u7406\u5E93\uFF0C\u63A7\u5236\u548C\u6570\u636E\u8FDE\u63A5\u4F7F\u7528\u540C\u4E00\u8DEF\u5F84"})]}),(0,j.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,j.jsx)(le,{label:"\u521D\u59CB\u76EE\u5F55",children:(0,j.jsx)("input",{required:!0,maxLength:4096,spellCheck:!1,value:a.initialPath,onChange:w=>h({...a,initialPath:w.target.value})})}),(0,j.jsx)(le,{label:"\u8FDE\u63A5\u4EE3\u7406",children:(0,j.jsxs)("select",{value:a.proxyId,onChange:w=>h({...a,proxyId:w.target.value}),children:[(0,j.jsx)("option",{value:"",children:"\u76F4\u8FDE"}),r.map(w=>(0,j.jsxs)("option",{value:w.id,children:[w.name," \xB7 ",w.proxyType.toUpperCase()]},w.id))]})})]}),(0,j.jsxs)("details",{className:"dsh-ssh-form-advanced",children:[(0,j.jsx)("summary",{children:"\u9AD8\u7EA7\u8FDE\u63A5\u8BBE\u7F6E"}),(0,j.jsxs)("div",{className:"dsh-ssh-form-grid",children:[(0,j.jsx)(le,{label:"\u8FDE\u63A5\u8D85\u65F6\uFF08\u6BEB\u79D2\uFF09",children:(0,j.jsx)("input",{required:!0,type:"number",min:"1000",max:"120000",step:"1000",value:a.connectTimeoutMs,onChange:w=>h({...a,connectTimeoutMs:w.target.value})})}),(0,j.jsx)(le,{label:"TLS \u670D\u52A1\u5668\u540D\u79F0",hint:"\u8BC1\u4E66\u540D\u79F0\u4E0E\u4E3B\u673A\u4E0D\u540C\u65F6\u586B\u5199",children:(0,j.jsx)("input",{maxLength:253,spellCheck:!1,value:a.tlsServerName,onChange:w=>h({...a,tlsServerName:w.target.value})})})]})]})]}),g&&(0,j.jsx)("p",{className:"dsh-ssh-inline-success",role:"status",children:g}),d&&(0,j.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:d})]}),(0,j.jsxs)("footer",{className:"dsh-ssh-ftp-editor-actions",children:[(0,j.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:()=>{x()},disabled:f||l,children:f?"\u6B63\u5728\u6D4B\u8BD5\u2026":"\u6D4B\u8BD5\u8FDE\u63A5"}),(0,j.jsx)("span",{}),(0,j.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:o,disabled:l||f,children:"\u53D6\u6D88"}),(0,j.jsx)("button",{type:"submit",className:"dsh-ssh-primary-button",disabled:l||f,children:l?"\u6B63\u5728\u4FDD\u5B58\u2026":"\u4FDD\u5B58\u8FDE\u63A5"})]})]})}function fx(e){return e==="ftp"?"FTP":e==="ftps-explicit"?"FTPS":"FTPS-I"}function ef(e,t,s){let r=s==="asc"?1:-1;return e.map((o,i)=>({entry:o,index:i})).sort((o,i)=>{let n=o.entry.kind==="directory"||o.entry.navigable===!0,a=i.entry.kind==="directory"||i.entry.navigable===!0;if(n!==a)return n?-1:1;let h=mx(o.entry,i.entry,t);if(h!==0)return h*r;let l=o.entry.name.localeCompare(i.entry.name,void 0,{numeric:!0,sensitivity:"base"});return l!==0?l:o.index-i.index}).map(o=>o.entry)}function mx(e,t,s){return s==="name"?e.name.localeCompare(t.name,void 0,{numeric:!0,sensitivity:"base"}):e[s]-t[s]}var M=require("react/jsx-runtime"),rf="dsh-ssh:file-transfer:tabs:v2",Il=38,gx=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"});function nf({ftpProfiles:e,vaultEntries:t,proxyEntries:s,access:r,onProfilesChanged:o}){let[i,n]=(0,be.useState)([]),[a,h]=(0,be.useState)([]),[l,c]=(0,be.useState)(()=>Px()),[f,v]=(0,be.useState)(()=>l[0]?.id??"transfer-1"),[g,u]=(0,be.useState)(!1),[d,m]=(0,be.useState)(!1),[p,b]=(0,be.useState)(),[x,y]=(0,be.useState)(),[S,_]=(0,be.useState)(),[w,C]=(0,be.useState)({}),P=(0,be.useRef)(new Map),T=(0,be.useCallback)(async()=>{try{let R=await zl();n(R),c(L=>Dx(L,R))}catch(R){_(De(R))}},[]);(0,be.useEffect)(()=>{T()},[T,e]),(0,be.useEffect)(()=>{try{localStorage.setItem(rf,JSON.stringify(l))}catch{}},[l]),(0,be.useEffect)(()=>{let R=P.current,L=a.filter(k=>tf(k.state)&&R.has(k.id)&&!tf(R.get(k.id)));P.current=new Map(a.map(k=>[k.id,k.state])),L.length!==0&&C(k=>{let $={...k};for(let X of L){let O=Nn(X.request.destinationEndpointId,X.request.destinationDirectory);$[O]=($[O]??0)+1}return $})},[a]),(0,be.useEffect)(()=>{let R=!1,L,k=async()=>{if(document.visibilityState==="hidden"){L=window.setTimeout(()=>{k()},1800);return}try{let $=await Vl();R||h($)}catch{}R||(L=window.setTimeout(()=>{k()},800))};return k(),()=>{R=!0,L!==void 0&&clearTimeout(L)}},[]);let A=l.find(R=>R.id===f)??l[0],F=R=>c(L=>L.map(k=>k.id===A?.id?R(k):k)),B=()=>{let R=`transfer-${Date.now().toString(36)}`,L=Ol(R,l.length+1);c(k=>[...k,L]),v(R)},U=R=>{if(l.length===1)return;let L=l.findIndex($=>$.id===R),k=l.filter($=>$.id!==R);c(k),f===R&&v(k[Math.max(0,L-1)].id)},N=R=>F(L=>({...L,panes:Array.from({length:R},(k,$)=>L.panes[$]??zn(`${L.id}-pane-${$}`))})),H=async(R,L,k,$,X)=>{let O={endpointId:R,directory:L},se={endpointId:$,directory:X};if(!(ei(O,se)||!ti(O,k,se)))try{_(void 0);let z=await Nr({sourceEndpointId:R,sourcePaths:k,destinationEndpointId:$,destinationDirectory:X,conflictPolicy:"fail"});h(I=>[z,...I.filter(J=>J.id!==z.id)])}catch(z){_(De(z))}},E=async(R,L,k)=>{try{_(void 0);let $=await cn(R,{paneId:L.id,endpointId:L.endpointId,directory:k});$.job!==void 0&&h(X=>[$.job,...X.filter(O=>O.id!==$.job.id)]),$.operation==="move"&&C(X=>{let O={...X};for(let se of[Nn(R.endpointId,R.directory),Nn(L.endpointId,k)])O[se]=(O[se]??0)+1;return O})}catch($){_(De($))}};return(0,M.jsxs)("div",{className:"dsh-ssh-transfer-workspace",children:[(0,M.jsxs)("header",{className:"dsh-ssh-transfer-header",children:[(0,M.jsxs)("div",{children:[(0,M.jsx)("h1",{children:"\u6587\u4EF6\u4F20\u8F93"}),(0,M.jsx)("p",{children:"FTP\u3001FTPS \u4E0E SFTP \u4E4B\u95F4\u76F4\u63A5\u6D41\u5F0F\u4E92\u4F20"})]}),(0,M.jsxs)("div",{className:"dsh-ssh-transfer-actions",children:[(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-secondary-button",onClick:()=>m(!0),children:["\u4F1A\u8BDD\u8BBF\u95EE \xB7 ",r.value?.fileEndpointIds.length??0]}),(0,M.jsx)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-secondary-button",onClick:()=>u(!0),children:"FTP \u7BA1\u7406"})]})]}),S&&(0,M.jsxs)("div",{className:"dsh-ssh-banner is-error",role:"alert",children:[(0,M.jsx)("span",{children:S}),(0,M.jsx)("button",{type:"button",onClick:()=>_(void 0),"aria-label":"\u5173\u95ED",children:(0,M.jsx)(Ot.IconCloseOutline16,{size:16})})]}),(0,M.jsxs)("div",{className:"dsh-ssh-transfer-tabbar",role:"tablist","aria-label":"\u6587\u4EF6\u4F20\u8F93\u4EFB\u52A1\u9875",children:[(0,M.jsxs)("div",{className:"dsh-ssh-transfer-tabs",children:[l.map(R=>(0,M.jsxs)("span",{"data-ssh-interactive":"choice",className:`dsh-ssh-transfer-tab${R.id===A?.id?" is-active":""}`,children:[(0,M.jsx)("button",{type:"button",role:"tab","aria-selected":R.id===A?.id,onClick:()=>v(R.id),children:R.name}),l.length>1&&(0,M.jsx)("button",{type:"button",className:"is-close","aria-label":`\u5173\u95ED ${R.name}`,onClick:()=>U(R.id),children:(0,M.jsx)(Ot.IconCloseOutline16,{size:13})})]},R.id)),(0,M.jsx)("button",{type:"button","data-ssh-interactive":"control",className:"is-add","aria-label":"\u65B0\u5EFA\u4F20\u8F93\u4EFB\u52A1\u9875",onClick:B,children:(0,M.jsx)(Ot.IconPlusOutline16,{size:15})})]}),(0,M.jsx)("div",{className:"dsh-ssh-pane-layout","aria-label":"\u7A97\u683C\u6570\u91CF",children:[2,3,4].map(R=>(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":A?.panes.length===R,className:A?.panes.length===R?"is-active":"",onClick:()=>N(R),children:[R," \u680F"]},R))})]}),i.length===0?(0,M.jsxs)("div",{className:"dsh-ssh-transfer-empty",children:[(0,M.jsx)(Ot.IconDataOutline16,{size:24}),(0,M.jsx)("strong",{children:"\u8FD8\u6CA1\u6709\u53EF\u7528\u6587\u4EF6\u8FDE\u63A5"}),(0,M.jsx)("p",{children:"\u65B0\u5EFA FTP/FTPS \u8FDE\u63A5\uFF0C\u6216\u5148\u6DFB\u52A0\u4E00\u53F0 SSH \u4E3B\u673A\u4F7F\u7528 SFTP\u3002"}),(0,M.jsx)("button",{type:"button",className:"dsh-ssh-primary-button",onClick:()=>u(!0),children:"\u65B0\u5EFA FTP \u8FDE\u63A5"})]}):A&&(0,M.jsx)("div",{className:`dsh-ssh-transfer-panes has-${A.panes.length}`,children:A.panes.map((R,L)=>{let k=A.panes[(L+1)%A.panes.length];return(0,M.jsx)(vx,{pane:R,endpoints:i,dragSource:x,refreshRevision:w[Nn(R.endpointId,R.path)]??0,...k===void 0?{}:{destination:k},onManageConnections:()=>u(!0),onDragSourceChange:y,onChange:$=>F(X=>({...X,panes:X.panes.map(O=>O.id===R.id?{...O,...$}:O)})),onTransfer:($,X)=>{H(R.endpointId,R.path,$,X.endpointId,X.path)},onExternalDrop:($,X)=>{E($,R,X)}},R.id)})}),(0,M.jsx)(yx,{jobs:a,endpoints:i,onCancel:async R=>{try{await jl(R),h(L=>L.map(k=>k.id===R?{...k,state:"cancelled"}:k))}catch(L){_(De(L))}},onConflict:b}),g&&(0,M.jsx)(Zp,{profiles:e,vaultEntries:t,proxyEntries:s,onClose:()=>u(!1),onChanged:()=>{o(),T()}}),d&&(0,M.jsx)(Sx,{endpoints:i,access:r,onClose:()=>m(!1)}),p&&(0,M.jsx)(wx,{job:p,onClose:()=>b(void 0),onRetry:async R=>{try{let L=await Nr({...p.request,conflictPolicy:R});h(k=>[L,...k]),b(void 0)}catch(L){_(De(L))}}})]})}function vx({pane:e,endpoints:t,destination:s,dragSource:r,refreshRevision:o,onChange:i,onTransfer:n,onExternalDrop:a,onDragSourceChange:h,onManageConnections:l}){let[c,f]=(0,be.useState)(),[v,g]=(0,be.useState)([]),[u,d]=(0,be.useState)(e.path),[m,p]=(0,be.useState)(!1),[b,x]=(0,be.useState)(0),[y,S]=(0,be.useState)({key:"name",direction:"asc"}),[_,w]=(0,be.useState)(!1),[C,P]=(0,be.useState)(),[T,A]=(0,be.useState)(),[F,B]=(0,be.useState)(),U=(0,be.useRef)(null),N=(0,be.useRef)(0),H=t.find(V=>V.id===e.endpointId),E=(0,be.useMemo)(()=>ef(c?.entries??[],y.key,y.direction),[c?.entries,y]),R=E.length>200,L=R?Math.max(0,Math.floor(b/Il)-8):0,k=(0,be.useMemo)(()=>R?E.slice(L,Math.min(E.length,L+56)):E,[E,L,R]),$=(0,be.useCallback)(async(V=e.path)=>{if(H===void 0)return;let Q=++N.current;p(!0),B(void 0);try{let W=await Hl(e.id,H.id,V);if(Q!==N.current)return;f(W),d(W.path),g([]),x(0),U.current&&(U.current.scrollTop=0),i({endpointId:H.id,path:W.path})}catch(W){Q===N.current&&B(De(W))}finally{Q===N.current&&p(!1)}},[H?.id,e.path]);(0,be.useEffect)(()=>{H!==void 0&&$(e.path)},[H?.id,o]),(0,be.useEffect)(()=>{r===void 0&&(w(!1),P(void 0))},[r]);let X=V=>{V.preventDefault(),$(u)},O=V=>{S(Q=>Q.key===V?{key:V,direction:Q.direction==="asc"?"desc":"asc"}:{key:V,direction:"asc"}),x(0),U.current&&(U.current.scrollTop=0)},se=V=>{N.current+=1,i({endpointId:V.id,path:V.initialPath}),d(V.initialPath),f(void 0),B(void 0)},z=()=>{N.current+=1,i({endpointId:"",path:"/"}),f(void 0),g([]),B(void 0),p(!1)},I=(V,Q)=>g(W=>Q?W.includes(V.path)?W.filter(ae=>ae!==V.path):[...W,V.path]:[V.path]),J=async()=>{if(!(T===void 0||c===void 0||H===void 0))try{await Br({paneId:e.id,endpointId:H.id,directory:c.path,paths:T.map(V=>V.path)}),g([])}finally{await $(c.path)}},Y=V=>{V.preventDefault(),w(!1);let Q=br(V.dataTransfer.getData(Ft));h(void 0),!(Q===void 0||Q.paneId===e.id||ei(Q,{endpointId:e.endpointId,directory:e.path}))&&a(Q,e.path)};return H===void 0?(0,M.jsxs)("section",{className:"dsh-ssh-file-pane is-connections",children:[(0,M.jsxs)("header",{children:[(0,M.jsxs)("span",{className:"dsh-ssh-pane-heading",children:[(0,M.jsx)("strong",{children:"\u8FDE\u63A5\u5217\u8868"}),(0,M.jsx)("small",{children:"\u5355\u51FB\u8FDE\u63A5\u540E\u6D4F\u89C8\u8FDC\u7AEF\u6587\u4EF6"})]}),(0,M.jsx)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-pane-manage-button",onClick:l,children:"FTP \u7BA1\u7406"})]}),(0,M.jsx)("div",{className:"dsh-ssh-endpoint-list",children:t.map(V=>(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"row",className:"dsh-ssh-endpoint-row",onClick:()=>se(V),children:[(0,M.jsx)("span",{className:`dsh-ssh-protocol-badge is-${V.protocol}`,children:Ml(V.protocol)}),(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{title:V.name,children:V.name}),(0,M.jsx)("small",{title:V.address,children:V.address})]}),(0,M.jsxs)("span",{children:[(0,M.jsx)("i",{className:`dsh-ssh-protocol-dot is-${V.protocol}`,"aria-hidden":"true"}),V.group??(V.kind==="sftp"?"SSH \u4E3B\u673A":"\u6587\u4EF6\u8FDE\u63A5")]})]},V.id))}),(0,M.jsxs)("footer",{children:[(0,M.jsxs)("span",{children:[t.length," \u4E2A\u53EF\u7528\u8FDE\u63A5"]}),(0,M.jsx)("small",{children:"SFTP \u590D\u7528 SSH \u4E3B\u673A\u914D\u7F6E"})]})]}):(0,M.jsxs)("section",{className:`dsh-ssh-file-pane${_?" is-drop-target":""}`,onDragOver:V=>{V.dataTransfer.types.includes(Ft)&&Ax(r,e)?(V.preventDefault(),V.dataTransfer.dropEffect=r?.endpointId===e.endpointId?"move":"copy",P(void 0),w(!0)):_&&w(!1)},onDragLeave:V=>{V.currentTarget.contains(V.relatedTarget)||(w(!1),P(void 0))},onDrop:Y,children:[(0,M.jsxs)("header",{children:[(0,M.jsx)("button",{type:"button",className:"dsh-ssh-pane-back","aria-label":"\u8FD4\u56DE\u8FDE\u63A5\u5217\u8868",onClick:z,children:(0,M.jsx)(Ot.IconChevronLeftOutline14,{size:14})}),(0,M.jsxs)("span",{className:"dsh-ssh-pane-endpoint",children:[(0,M.jsx)("strong",{children:H.name}),(0,M.jsx)("small",{title:H.address,children:H.address})]}),(0,M.jsx)("span",{className:`dsh-ssh-protocol-badge is-${H.protocol}`,children:Ml(H.protocol)})]}),(0,M.jsxs)("form",{className:"dsh-ssh-file-pathbar",onSubmit:X,children:[(0,M.jsx)("button",{type:"button","aria-label":"\u4E0A\u4E00\u7EA7\u76EE\u5F55",disabled:c?.parent===null||m,onClick:()=>{c?.parent&&$(c.parent)},children:(0,M.jsx)(Fx,{})}),(0,M.jsx)("button",{type:"button","aria-label":"\u5237\u65B0\u76EE\u5F55",disabled:m,onClick:()=>{$()},children:(0,M.jsx)(Bx,{})}),(0,M.jsx)("input",{"aria-label":"\u8FDC\u7AEF\u8DEF\u5F84",value:u,onChange:V=>d(V.target.value)}),(0,M.jsx)("button",{type:"submit",disabled:m,children:"\u524D\u5F80"})]}),(0,M.jsxs)("div",{className:"dsh-ssh-file-table",role:"grid","aria-busy":m,children:[(0,M.jsxs)("div",{className:"dsh-ssh-file-table-head",role:"row",children:[(0,M.jsx)(Ll,{label:"\u540D\u79F0",sortKey:"name",current:y,onSort:O}),(0,M.jsx)(Ll,{label:"\u5927\u5C0F",sortKey:"size",current:y,onSort:O}),(0,M.jsx)(Ll,{label:"\u4FEE\u6539\u65F6\u95F4",sortKey:"modifiedAt",current:y,onSort:O}),(0,M.jsx)("span",{role:"columnheader","aria-label":"\u64CD\u4F5C"})]}),(0,M.jsx)("div",{ref:U,className:"dsh-ssh-file-table-body",onScroll:V=>{R&&x(V.currentTarget.scrollTop)},children:m&&!c?(0,M.jsx)("div",{className:"dsh-ssh-file-loading",children:"\u6B63\u5728\u8BFB\u53D6\u76EE\u5F55\u2026"}):F?(0,M.jsxs)("div",{className:"dsh-ssh-file-error",children:[(0,M.jsx)("span",{children:F}),(0,M.jsx)("button",{type:"button",onClick:()=>{$()},children:"\u91CD\u8BD5"})]}):E.length===0?(0,M.jsx)("div",{className:"dsh-ssh-table-empty",children:"\u8FD9\u4E2A\u76EE\u5F55\u662F\u7A7A\u7684\u3002"}):(0,M.jsx)("div",{className:R?"dsh-ssh-file-virtual-list":void 0,style:R?{height:`${E.length*Il}px`}:void 0,children:k.map((V,Q)=>(0,M.jsx)(xx,{entry:V,paneId:e.id,endpointId:H.id,sourceDirectory:c?.path??e.path,dragSource:r,dropTarget:C===V.path,selected:v.includes(V.path),selectedPaths:v,...R?{style:{position:"absolute",insetInline:0,transform:`translateY(${(L+Q)*Il}px)`}}:{},onDelete:()=>A([V]),onDirectoryTarget:W=>{w(!1),P(W)},onDropIntoDirectory:(W,ae)=>{P(void 0),h(void 0),a(W,ae)},onDragSourceChange:h,onSelect:W=>I(V,W),onOpen:()=>{$(V.path)}},V.path))})})]}),(0,M.jsxs)("footer",{children:[(0,M.jsx)("span",{children:v.length>0?`\u5DF2\u9009\u62E9 ${v.length} \u9879`:`${c?.entries.length??0} \u9879`}),(0,M.jsx)("span",{className:"dsh-ssh-file-pane-actions",children:(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-transfer-to-button",disabled:v.length===0||s===void 0||!s.endpointId||m,onClick:()=>{s?.endpointId&&n(v,s)},children:["\u4F20\u9001\u5230\u4E0B\u4E00\u680F ",(0,M.jsx)("span",{"aria-hidden":"true",children:"\u2192"})]})})]}),_&&(0,M.jsxs)("div",{className:"dsh-ssh-file-drop-overlay",children:[(0,M.jsx)("strong",{children:r?.endpointId===e.endpointId?"\u79FB\u52A8\u5230\u6B64\u76EE\u5F55":"\u590D\u5236\u5230\u6B64\u76EE\u5F55"}),(0,M.jsx)("span",{children:c?.path??e.path})]}),T!==void 0&&(0,M.jsx)(Rn,{locationName:H.name,locationKind:"remote",entries:T,onClose:()=>A(void 0),onDelete:J})]})}function Ll({label:e,sortKey:t,current:s,onSort:r}){let o=s.key===t;return(0,M.jsx)("span",{role:"columnheader","aria-sort":o?s.direction==="asc"?"ascending":"descending":"none",children:(0,M.jsxs)("button",{type:"button",onClick:()=>r(t),children:[e,(0,M.jsx)(bx,{active:o,direction:s.direction})]})})}function bx({active:e,direction:t}){return(0,M.jsx)("svg",{className:e?"is-active":"",viewBox:"0 0 12 12","aria-hidden":"true",children:(0,M.jsx)("path",{d:"m3.5 5 2.5 2.5L8.5 5",transform:t==="desc"?void 0:"rotate(180 6 6)"})})}function _x(){return(0,M.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,M.jsx)("path",{d:"M8 2v7m0 0 2.6-2.6M8 9 5.4 6.4M3 11.5v1.25h10V11.5"})})}function xx({entry:e,paneId:t,endpointId:s,sourceDirectory:r,dragSource:o,dropTarget:i,selected:n,selectedPaths:a,style:h,onSelect:l,onOpen:c,onDelete:f,onDirectoryTarget:v,onDropIntoDirectory:g,onDragSourceChange:u}){let d=hn(e),m=d&&(o===void 0||ti(o,o.paths,{endpointId:s,directory:e.path})),p=b=>{if(!d)return;b.preventDefault(),b.stopPropagation(),v(void 0);let x=br(b.dataTransfer.getData(Ft));x!==void 0&&ti(x,x.paths,{endpointId:s,directory:e.path})&&g(x,e.path)};return(0,M.jsxs)("div",{role:"row","data-ssh-interactive":"row","data-ssh-context-row":!0,tabIndex:0,"aria-selected":n,"aria-label":`${e.name}${d?"\uFF0C\u76EE\u5F55\uFF0C\u5355\u51FB\u8FDB\u5165\uFF1B\u53EF\u63A5\u6536\u62D6\u653E":""}`,draggable:e.kind==="file"||d,className:`dsh-ssh-file-row is-${d?"directory":e.kind}${n?" is-selected":""}${i?" is-drop-target":""}`,style:h,onClick:b=>{d&&!b.ctrlKey&&!b.metaKey&&!b.shiftKey?c():l(b.ctrlKey||b.metaKey)},onKeyDown:b=>{b.target===b.currentTarget&&(b.key==="Enter"&&d&&c(),b.key===" "&&(b.preventDefault(),l(b.ctrlKey||b.metaKey)))},onDragStart:b=>{let x=n?a:[e.path],y={paneId:t,endpointId:s,directory:r,paths:x};u(y),b.dataTransfer.effectAllowed="copyMove",b.dataTransfer.setData(Ft,JSON.stringify(y))},onDragEnd:()=>u(void 0),onDragOver:b=>{b.dataTransfer.types.includes(Ft)&&m&&(b.preventDefault(),b.stopPropagation(),b.dataTransfer.dropEffect=o?.endpointId===s?"move":"copy",v(e.path))},onDragLeave:b=>{i&&!b.currentTarget.contains(b.relatedTarget)&&v(void 0)},onDrop:p,children:[(0,M.jsxs)("span",{children:[(0,M.jsx)(Nx,{directory:d}),(0,M.jsx)("i",{title:e.name,children:e.name})]}),(0,M.jsx)("span",{children:d?"\u2014":af(e.size)}),(0,M.jsx)("span",{children:e.modifiedAt>0?new Date(e.modifiedAt).toLocaleString():"\u2014"}),(0,M.jsxs)("span",{className:"dsh-ssh-file-row-actions dsh-ssh-context-action",children:[(e.kind==="file"||e.kind==="directory")&&(0,M.jsx)("a",{className:"dsh-ssh-file-row-download",href:$l(s,e.path),download:e.kind==="directory"?`${e.name}.tar`:e.name,draggable:!1,"aria-label":`\u4E0B\u8F7D ${e.name} \u5230\u672C\u5730`,title:e.kind==="directory"?`\u5C06 ${e.name} \u6253\u5305\u4E0B\u8F7D\u5230\u672C\u5730`:`\u4E0B\u8F7D ${e.name} \u5230\u672C\u5730`,onClick:b=>b.stopPropagation(),children:(0,M.jsx)(_x,{})}),(0,M.jsx)("button",{type:"button",className:"dsh-ssh-file-row-delete",draggable:!1,"aria-label":`\u5220\u9664 ${e.name}`,title:`\u5220\u9664 ${e.name}`,onClick:b=>{b.stopPropagation(),f()},children:(0,M.jsx)(Ot.IconTrashOutline16,{size:14})})]})]})}function yx({jobs:e,endpoints:t,onCancel:s,onConflict:r}){let[o,i]=(0,be.useState)(!0),n=e.filter(a=>a.state==="queued"||a.state==="scanning"||a.state==="transferring");return(0,M.jsxs)("section",{className:`dsh-ssh-transfer-queue${o?" is-open":""}`,children:[(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"control",className:"dsh-ssh-transfer-queue-heading","aria-expanded":o,onClick:()=>i(a=>!a),children:[(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{children:"\u4F20\u8F93\u4EFB\u52A1"}),(0,M.jsx)("small",{children:n.length>0?`${n.length} \u4E2A\u8FDB\u884C\u4E2D`:e.length>0?"\u6700\u8FD1\u4EFB\u52A1":"\u6682\u65E0\u4EFB\u52A1"})]}),(0,M.jsx)("span",{children:o?"\u6536\u8D77":"\u5C55\u5F00"})]}),o&&(0,M.jsx)("div",{className:"dsh-ssh-transfer-job-list",children:e.length===0?(0,M.jsx)("p",{children:"\u4ECE\u4E00\u4E2A\u7A97\u683C\u62D6\u5230\u53E6\u4E00\u4E2A\u7A97\u683C\uFF0C\u6216\u9009\u4E2D\u6587\u4EF6\u540E\u70B9\u51FB\u201C\u4F20\u9001\u5230\u4E0B\u4E00\u680F\u201D\u3002"}):e.slice(0,12).map(a=>{let h=a.totalBytes>0?Math.min(100,a.transferredBytes/a.totalBytes*100):a.state==="completed"?100:0;return(0,M.jsxs)("article",{children:[(0,M.jsx)("span",{className:`dsh-ssh-transfer-state is-${a.state}`,"aria-hidden":"true"}),(0,M.jsxs)("span",{className:"dsh-ssh-transfer-job-copy",children:[(0,M.jsxs)("strong",{children:[of(a.request.sourcePaths)," ",(0,M.jsx)("i",{children:"\u2192"})," ",Rx(t,a.request.destinationEndpointId)]}),(0,M.jsx)("small",{children:a.error??Ix(a,h)}),(0,M.jsx)("span",{className:"dsh-ssh-transfer-job-time",children:Lx(a)}),(0,M.jsx)("span",{className:"dsh-ssh-transfer-progress",children:(0,M.jsx)("i",{style:{transform:`scaleX(${h/100})`}})})]}),a.state==="queued"||a.state==="scanning"||a.state==="transferring"?(0,M.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u53D6\u6D88\u4F20\u8F93",onClick:()=>{s(a.id)},children:(0,M.jsx)(Ot.IconCloseOutline16,{size:15})}):a.state==="failed"&&a.error?.includes("destination already contains")?(0,M.jsx)("button",{type:"button",className:"dsh-ssh-job-resolve",onClick:()=>r(a),children:"\u5904\u7406"}):null]},a.id)})})]})}function wx({job:e,onClose:t,onRetry:s}){let[r,o]=(0,be.useState)("rename"),[i,n]=(0,be.useState)(!1);return(0,M.jsxs)(Ye,{className:"dsh-ssh-transfer-conflict-dialog",title:"\u76EE\u6807\u4E2D\u5B58\u5728\u540C\u540D\u6587\u4EF6",subtitle:"\u4E3A\u672C\u6279\u4F20\u8F93\u9009\u62E9\u5904\u7406\u65B9\u5F0F",onClose:t,children:[(0,M.jsxs)("div",{className:"dsh-ssh-transfer-conflict-copy",children:[(0,M.jsx)("strong",{children:of(e.request.sourcePaths)}),(0,M.jsx)("span",{children:e.request.destinationDirectory})]}),(0,M.jsx)("div",{className:"dsh-ssh-conflict-options",children:[["rename","\u81EA\u52A8\u91CD\u547D\u540D","\u4FDD\u7559\u4E24\u4EFD\u6587\u4EF6\uFF0C\u5728\u540D\u79F0\u540E\u6DFB\u52A0\u5E8F\u53F7"],["skip","\u8DF3\u8FC7\u540C\u540D\u6587\u4EF6","\u7EE7\u7EED\u4F20\u8F93\u5176\u4ED6\u5185\u5BB9"],["overwrite","\u8986\u76D6\u76EE\u6807\u6587\u4EF6","\u4F7F\u7528\u6765\u6E90\u5185\u5BB9\u66FF\u6362\u76EE\u6807\u5185\u5BB9"]].map(a=>(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":r===a[0],className:r===a[0]?"is-active":"",onClick:()=>o(a[0]),children:[(0,M.jsx)("i",{"aria-hidden":"true"}),(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{children:a[1]}),(0,M.jsx)("small",{children:a[2]})]})]},a[0]))}),(0,M.jsxs)("div",{className:"dsh-ssh-dialog-actions",children:[(0,M.jsx)("button",{type:"button",className:"dsh-ssh-secondary-button","data-ssh-dialog-close":!0,onClick:t,children:"\u53D6\u6D88"}),(0,M.jsx)("button",{type:"button",className:"dsh-ssh-primary-button",disabled:i,onClick:()=>{n(!0),s(r).finally(()=>n(!1))},children:i?"\u6B63\u5728\u91CD\u65B0\u52A0\u5165\u961F\u5217\u2026":"\u7EE7\u7EED\u4F20\u8F93"})]})]})}function Sx({endpoints:e,access:t,onClose:s}){let r=t.value,o=e.filter(n=>r?.fileEndpointIds.includes(n.id)).length,i=n=>t.setFileEndpoints(r?.fileEndpointIds.includes(n)?r.fileEndpointIds.filter(a=>a!==n):[...r?.fileEndpointIds??[],n]);return(0,M.jsxs)(Ye,{className:"dsh-ssh-file-access-dialog",title:"\u4F1A\u8BDD\u8BBF\u95EE",subtitle:"\u5355\u72EC\u7BA1\u7406\u5F53\u524D\u4F1A\u8BDD\u53EF\u4F7F\u7528\u7684\u8FDC\u7AEF\u6587\u4EF6\u8FDE\u63A5",onClose:s,children:[(0,M.jsxs)("div",{className:"dsh-ssh-file-access-body dsh-ssh-scroll-surface",children:[t.error&&(0,M.jsx)("p",{className:"dsh-ssh-inline-error",role:"alert",children:t.error}),(0,M.jsxs)("section",{className:"dsh-ssh-file-access-section","aria-labelledby":"dsh-ssh-file-access-connections",children:[(0,M.jsxs)("header",{children:[(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{id:"dsh-ssh-file-access-connections",children:"\u6587\u4EF6\u8FDE\u63A5"}),(0,M.jsx)("small",{children:"\u5141\u8BB8\u5F53\u524D\u4F1A\u8BDD\u6D4F\u89C8\u6307\u5B9A\u7684 FTP\u3001FTPS \u6216 SFTP"})]}),(0,M.jsxs)("i",{children:[o.toString().padStart(2,"0")," / ",e.length.toString().padStart(2,"0")]})]}),(0,M.jsx)("div",{className:"dsh-ssh-file-access-list",children:t.loading?(0,M.jsx)(Cx,{}):e.length===0?(0,M.jsxs)("div",{className:"dsh-ssh-file-access-empty",children:[(0,M.jsx)("strong",{children:"\u6CA1\u6709\u53EF\u7528\u8FDE\u63A5"}),(0,M.jsx)("small",{children:"\u8BF7\u5148\u5728\u6587\u4EF6\u4F20\u8F93\u4E2D\u6DFB\u52A0 FTP\uFF0C\u6216\u5728\u4E3B\u673A\u9762\u677F\u4E2D\u6DFB\u52A0 SSH \u4E3B\u673A\u3002"})]}):e.map(n=>(0,M.jsx)(kx,{endpoint:n,enabled:r?.fileEndpointIds.includes(n.id)??!1,onToggle:()=>i(n.id)},n.id))})]}),(0,M.jsxs)("section",{className:"dsh-ssh-file-access-section is-options","aria-labelledby":"dsh-ssh-file-access-policy",children:[(0,M.jsx)("header",{children:(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{id:"dsh-ssh-file-access-policy",children:"\u8BBF\u95EE\u7B56\u7565"}),(0,M.jsx)("small",{children:"\u6587\u4EF6\u6743\u9650\u4E0E SSH \u547D\u4EE4\u3001\u7EC8\u7AEF\u6743\u9650\u76F8\u4E92\u72EC\u7ACB"})]})}),(0,M.jsxs)("div",{className:"dsh-ssh-file-access-options",children:[(0,M.jsxs)("div",{className:"dsh-ssh-file-access-policy-row",children:[(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{children:"\u6587\u4EF6\u64CD\u4F5C\u6743\u9650"}),(0,M.jsx)("small",{children:"\u6D4F\u89C8\u6A21\u5F0F\u4E0D\u4F1A\u5411 AI \u66B4\u9732\u8DE8\u7AEF\u4F20\u8F93\u5DE5\u5177"})]}),(0,M.jsx)(Ex,{value:r?.filePermission??"browse",onChange:t.setFilePermission})]}),(0,M.jsxs)("div",{className:"dsh-ssh-file-access-policy-row",children:[(0,M.jsxs)("span",{children:[(0,M.jsx)("strong",{children:"\u4F20\u8F93\u524D\u786E\u8BA4"}),(0,M.jsx)("small",{children:"AI \u53D1\u8D77\u4F20\u8F93\u65F6\u8BF7\u6C42 DSH \u6388\u6743"})]}),(0,M.jsx)(Tx,{checked:r?.requireFileApproval??!0,onChange:t.setRequireFileApproval})]})]})]})]}),(0,M.jsxs)("footer",{className:"dsh-ssh-file-access-footer",children:[(0,M.jsxs)("span",{className:t.saving?"is-saving":"is-saved",children:[(0,M.jsx)("i",{"aria-hidden":"true"}),t.saving?"\u6B63\u5728\u4FDD\u5B58\u66F4\u6539":`${o>0?`\u5DF2\u6388\u6743 ${o} \u4E2A\u8FDE\u63A5`:"\u672A\u6388\u6743\u8FDE\u63A5"} \xB7 \u81EA\u52A8\u4FDD\u5B58`]}),(0,M.jsx)("button",{type:"button",className:"dsh-ssh-primary-button","data-ssh-dialog-close":!0,disabled:t.saving,onClick:s,children:t.saving?"\u4FDD\u5B58\u4E2D\u2026":"\u5B8C\u6210"})]})]})}function kx({endpoint:e,enabled:t,onToggle:s}){return(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-file-access-endpoint${t?" is-mounted":""}`,"aria-pressed":t,onClick:s,children:[(0,M.jsx)("span",{className:`dsh-ssh-protocol-badge is-${e.protocol}`,children:Ml(e.protocol)}),(0,M.jsxs)("span",{className:"dsh-ssh-file-access-endpoint-copy",children:[(0,M.jsx)("strong",{title:e.name,children:e.name}),(0,M.jsx)("small",{title:e.address,children:e.address})]}),(0,M.jsxs)("span",{className:"dsh-ssh-file-access-state",children:[(0,M.jsx)("i",{"aria-hidden":"true",children:(0,M.jsx)("b",{})}),(0,M.jsx)("em",{children:t?"\u5DF2\u6388\u6743":"\u672A\u6388\u6743"})]})]})}function Cx(){return(0,M.jsx)("div",{className:"dsh-ssh-file-access-skeleton","aria-label":"\u6B63\u5728\u8BFB\u53D6\u4F1A\u8BDD\u6743\u9650",children:[0,1,2].map(e=>(0,M.jsxs)("span",{style:{"--ssh-skeleton-index":e},children:[(0,M.jsx)("i",{}),(0,M.jsxs)("b",{children:[(0,M.jsx)("i",{}),(0,M.jsx)("i",{})]}),(0,M.jsx)("em",{})]},e))})}function Ex({value:e,onChange:t}){return(0,M.jsx)("div",{className:"dsh-ssh-file-permission-picker",role:"radiogroup","aria-label":"\u6587\u4EF6\u64CD\u4F5C\u6743\u9650",children:[["browse","\u4EC5\u6D4F\u89C8"],["transfer","\u5141\u8BB8\u4F20\u8F93"]].map(([s,r])=>(0,M.jsx)("button",{type:"button","data-ssh-interactive":"choice",role:"radio","aria-checked":e===s,className:e===s?"is-active":"",onClick:()=>t(s),children:r},s))})}function Tx({checked:e,onChange:t}){return(0,M.jsxs)("button",{type:"button","data-ssh-interactive":"choice",role:"switch","aria-checked":e,className:`dsh-ssh-file-approval-switch${e?" is-active":""}`,onClick:()=>t(!e),children:[(0,M.jsx)("i",{"aria-hidden":"true",children:(0,M.jsx)("b",{})}),(0,M.jsx)("span",{children:e?"\u9700\u8981\u786E\u8BA4":"\u76F4\u63A5\u6267\u884C"})]})}function Px(){try{let e=JSON.parse(localStorage.getItem(rf)??"[]");if(!Array.isArray(e))return[Ol("transfer-1",1)];let t=e.slice(0,8).flatMap(s=>{if(typeof s!="object"||s===null)return[];let r=s;if(typeof r.id!="string"||!/^[a-zA-Z0-9_-]{1,100}$/.test(r.id)||typeof r.name!="string"||!Array.isArray(r.panes))return[];let o=r.panes.slice(0,4).flatMap(i=>{if(typeof i!="object"||i===null)return[];let n=i;return typeof n.id=="string"&&/^[a-zA-Z0-9_-]{1,100}$/.test(n.id)&&typeof n.endpointId=="string"&&typeof n.path=="string"?[{id:n.id,endpointId:"",path:"/"}]:[]});return o.length>=2?[{id:r.id,name:r.name.slice(0,40),panes:o}]:[]});if(t.length>0)return t}catch{}return[Ol("transfer-1",1)]}function Ol(e,t){return{id:e,name:`\u4EFB\u52A1 ${t}`,panes:[zn(`${e}-a`),zn(`${e}-b`)]}}function zn(e){return{id:e,endpointId:"",path:"/"}}function Dx(e,t){return e.map(s=>({...s,panes:s.panes.map(r=>!r.endpointId||t.some(o=>o.id===r.endpointId)?r:zn(r.id))}))}function Rx(e,t){return e.find(s=>s.id===t)?.name??t}function of(e){let t=e[0]?.replaceAll("\\","/").split("/").filter(Boolean).at(-1)??"\u6587\u4EF6";return e.length>1?`${t} \u7B49 ${e.length} \u9879`:t}function Ml(e){return e==="sftp"?"SFTP":e==="ftp"?"FTP":e==="ftps-explicit"?"FTPS":"FTPS-I"}function Nn(e,t){return JSON.stringify([e,t.replaceAll("\\","/").replace(/\/+$/,"")||"/"])}function Ax(e,t){return e===void 0||e.paneId!==t.id&&!ei(e,{endpointId:t.endpointId,directory:t.path})}function tf(e){return e==="completed"||e==="failed"||e==="cancelled"}function af(e){return e<1024?`${e} B`:e<1024**2?`${(e/1024).toFixed(1)} KB`:e<1024**3?`${(e/1024**2).toFixed(1)} MB`:`${(e/1024**3).toFixed(2)} GB`}function Ix(e,t){if(e.state==="queued")return"\u7B49\u5F85\u4F20\u8F93";if(e.state==="scanning")return"\u6B63\u5728\u626B\u63CF\u76EE\u5F55";if(e.state==="transferring"){let s=Math.max(1,(Date.now()-(e.startedAt??Date.now()))/1e3),r=e.transferredBytes/s,o=r>0?Math.max(0,(e.totalBytes-e.transferredBytes)/r):0;return`${t.toFixed(0)}% \xB7 ${af(r)}/s${o>1?` \xB7 \u7EA6 ${Mx(o)}`:""}`}return e.state==="completed"?`\u5DF2\u5B8C\u6210 ${e.completedFiles} \u4E2A\u6587\u4EF6${e.skippedFiles?`\uFF0C\u8DF3\u8FC7 ${e.skippedFiles}`:""}`:e.state==="cancelled"?"\u5DF2\u53D6\u6D88":"\u4F20\u8F93\u5931\u8D25"}function Lx(e){if(e.startedAt===void 0)return`\u521B\u5EFA\u4E8E ${sf(e.createdAt)}`;let t=e.completedAt??Date.now(),s=Ox(Math.max(0,t-e.startedAt));return e.completedAt===void 0?`\u5DF2\u6267\u884C ${s}`:`\u8017\u65F6 ${s} \xB7 \u5B8C\u6210\u4E8E ${sf(e.completedAt)}`}function sf(e){return gx.format(e)}function Ox(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t} \u79D2`;let s=Math.floor(t/60);return s<60?`${s} \u5206 ${String(t%60).padStart(2,"0")} \u79D2`:`${Math.floor(s/60)} \u5C0F\u65F6 ${String(s%60).padStart(2,"0")} \u5206`}function Mx(e){if(e<60)return`${Math.ceil(e)} \u79D2`;let t=Math.ceil(e/60);return t<60?`${t} \u5206\u949F`:`${Math.floor(t/60)} \u5C0F\u65F6 ${t%60} \u5206\u949F`}function Fx(){return(0,M.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,M.jsx)("path",{d:"M8 12V4m0 0L4.8 7.2M8 4l3.2 3.2"})})}function Bx(){return(0,M.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,M.jsx)("path",{d:"M12.2 5.2A5 5 0 1 0 13 9M12.2 5.2V2.5m0 2.7H9.5"})})}function Nx({directory:e}){return(0,M.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:e?(0,M.jsx)("path",{d:"M2 4.3h4l1.2 1.4H14v6.8H2z"}):(0,M.jsx)("path",{d:"M3.2 2h6l3.6 3.6V14H3.2zm6 0v3.6h3.6"})})}var lf=`.dsh-ssh-transfer-workspace {
|
|
5551
5551
|
display: grid;
|
|
5552
5552
|
grid-template-rows: auto auto minmax(0, 1fr) auto;
|
|
5553
5553
|
width: 100%;
|
|
@@ -6512,7 +6512,7 @@ body[data-ds-dark-theme] :is(
|
|
|
6512
6512
|
background: var(--ssh-modal-surface);
|
|
6513
6513
|
}
|
|
6514
6514
|
}
|
|
6515
|
-
`;var D=require("react/jsx-runtime"),Hn="@lemoncat7/dsh-ssh",hf=`${Hn}/client`,Hx=["slots","layout","sessions","workspaces"];function $x(e){e.effect(cy,"dsh-ssh: styles");let t=Vx(e),s=Ux(e,()=>t.close());e.effect(()=>Bp(Hn,()=>{s.close(),t.close()}),"dsh-ssh: exclusive workspace"),e.effect(()=>()=>{s.close(),t.dispose()},"dsh-ssh: workspace lifecycle"),e.slots.inject("sidebar.footer.action",()=>e.slots.register({name:"sidebar.footer.action",id:"ssh-remote",order:-100},r=>(0,D.jsx)(jx,{...r,controller:s,activityController:t,collapseSidebar:()=>e.layout.toggleSidebar()})))}function Ux(e,t){let s=e,r=new Set,o,i,n=()=>{for(let h of r)h()},a={open(h){t(),h!==void 0&&(o=h),i===void 0&&(Pl(Hn),i=e.slots.register({name:"conversation",priority:-2},l=>(0,D.jsx)(Wx,{...l,controller:a}))),n()},toggle(){i===void 0?a.open():a.close()},close(){if(i===void 0)return;let h=i;i=void 0,h(),n()},isOpen:()=>i!==void 0,selected:()=>o,subscribe(h){return r.add(h),()=>r.delete(h)},async createProjectSession(h,l,c,f){let v=await s.workspaces.connectWorkspace(h);return await ki({...bi(String(v)),profileIds:[l.profileId],permission:c,requireCommandApproval:f,workingDirectories:{[l.profileId]:l.path},workingProjectIds:{[l.profileId]:l.id}}),s.sessions.open(v),String(v)}};return a}function Vx(e){let t=e,s=new Set,r=new Map,o=cf(t.sessions.list.getSnapshot().current),i,n,a,h=()=>{for(let d of s)d()},l=()=>{n!==void 0&&(window.cancelAnimationFrame(n),n=void 0)},c=()=>{if(a===void 0)return!1;let d=a;return a=void 0,i=void 0,d(),!0},f=(d,m=!0)=>{i===d&&a!==void 0||(c(),i=d,a=e.slots.register({name:"details",priority:-2},p=>(0,D.jsx)(Rp,{...p,controller:g})),m&&e.layout.openDetails())},v=()=>{let d=t.sessions.list.getSnapshot(),m=cf(d.current);if(m===o)return;l();let p=c();o=m,m!==void 0&&r.get(m)?.open===!0?(f(m,!1),n=window.requestAnimationFrame(()=>{n=void 0,o===m&&i===m&&r.get(m)?.open===!0&&e.layout.openDetails()})):p&&e.layout.closeDetails(),h()},g={open(d,m,p){let b=p??(m===void 0?"local-directory":"remote-directory"),x=r.get(d),y=m??x?.selectedProfileId;r.set(d,{open:!0,...y===void 0?{}:{selectedProfileId:y},requestedView:b}),Pl(Hn),d===o&&(l(),f(d),e.layout.openDetails()),h()},toggle(d){if(r.get(d)?.open===!0)return g.close(d);g.open(d)},close(d){let m=d??o;if(m===void 0)return;let p=r.get(m);p!==void 0&&r.set(m,{...p,open:!1}),m===o&&(l(),c()&&e.layout.closeDetails()),h()},isOpen:d=>r.get(d)?.open===!0,selected:d=>r.get(d)?.selectedProfileId,requestedView:d=>r.get(d)?.requestedView,subscribe(d){return s.add(d),()=>s.delete(d)},dispose(){u(),l(),c(),r.clear(),s.clear()}},u=t.sessions.list.subscribe(v);return g}function cf(e){return typeof e=="string"&&e.length>0?e:void 0}function jx(e){let t=(0,ne.useRef)(null);Vp(t);let s=e.useSessions(p=>p.current),r=s===void 0?void 0:String(s),[o,i]=(0,ne.useState)([]),[n,a]=(0,ne.useState)(null),[h,l]=(0,ne.useState)(!0),c=(0,ne.useSyncExternalStore)(e.controller.subscribe,e.controller.isOpen),f=(0,ne.useSyncExternalStore)(e.activityController.subscribe,()=>r!==void 0&&e.activityController.isOpen(r));(0,ne.useEffect)(()=>qp(p=>{p.sessionId===r&&a(p)}),[r]);let v=(0,ne.useCallback)(async()=>{let p=await jn().catch(()=>[]);i(p),a(s===void 0?null:await Si(String(s)).catch(()=>null))},[s]);(0,ne.useEffect)(()=>{v()},[v,c]);let g=n===null?[]:n.profileIds.map(p=>o.find(b=>b.id===p)).filter(p=>p!==void 0);(0,ne.useEffect)(()=>{if(r===void 0||n?.permission!=="terminal")return;let p=new EventSource(Zl(r)),b=x=>{let y=ay(x);y===void 0||y.sessionId!==r||(e.controller.close(),e.activityController.open(r,y.profileId,"terminals"))};return p.addEventListener("terminal-opened",b),()=>{p.removeEventListener("terminal-opened",b),p.close()}},[r,n?.permission,e.activityController,e.controller]);let u=p=>{r!==void 0&&(e.controller.close(),e.activityController.open(r,p,p===void 0?"local-directory":"remote-directory"))},d=()=>{r!==void 0&&(f?e.activityController.close(r):u())},m=()=>{e.controller.open(),e.wide&&window.matchMedia("(max-width: 820px)").matches&&e.collapseSidebar()};return e.wide?(0,D.jsxs)("section",{ref:t,className:"dsh-ssh-sidebar",children:[(0,D.jsxs)("div",{className:"dsh-ssh-sidebar-heading",children:[(0,D.jsxs)("button",{type:"button",className:"dsh-ssh-sidebar-title","aria-expanded":h,onClick:()=>l(p=>!p),children:[(0,D.jsx)("span",{className:"dsh-ssh-disclosure","data-open":h,children:(0,D.jsx)(ye.IconChevronDownOutline14,{size:14})}),(0,D.jsx)("span",{children:"\u8FDC\u7AEF"})]}),(0,D.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-icon-button${f?" is-active":""}`,"aria-label":f?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F",title:r===void 0?"\u6253\u5F00\u4F1A\u8BDD\u540E\u53EF\u67E5\u770B SSH \u4FA7\u680F":f?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F","aria-pressed":f,disabled:r===void 0,onClick:d,children:(0,D.jsx)(ye.IconPanelLeftOutline16,{size:16,className:"dsh-ssh-panel-right-icon"})})]}),h&&(0,D.jsxs)("div",{className:"dsh-ssh-sidebar-list",children:[(0,D.jsxs)("button",{type:"button",className:"dsh-ssh-sidebar-panel",onClick:m,children:[(0,D.jsx)(Ts,{}),(0,D.jsx)("span",{children:"SSH \u9762\u677F"})]}),r===void 0?(0,D.jsx)("p",{className:"dsh-ssh-sidebar-note",children:"\u6253\u5F00\u4F1A\u8BDD\u540E\u663E\u793A\u53EF\u7528\u8FDC\u7AEF"}):g.length===0?(0,D.jsx)("p",{className:"dsh-ssh-sidebar-note",children:"\u5F53\u524D\u4F1A\u8BDD\u672A\u6388\u6743\u8FDC\u7AEF"}):g.slice(0,6).map(p=>(0,D.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":f&&e.activityController.selected(r)===p.id,className:`dsh-ssh-sidebar-row${f&&e.activityController.selected(r)===p.id?" is-active":""}`,onClick:()=>u(p.id),children:[(0,D.jsx)("span",{className:"dsh-ssh-status-dot is-injected","aria-hidden":"true"}),(0,D.jsxs)("span",{className:"dsh-ssh-sidebar-copy",children:[(0,D.jsx)("strong",{children:p.name}),(0,D.jsx)("small",{children:p.host})]}),(0,D.jsx)("span",{className:"dsh-ssh-injected-mark",children:"\u5DF2\u6302\u8F7D"})]},p.id)),g.length>6&&(0,D.jsxs)("button",{type:"button",className:"dsh-ssh-sidebar-more",onClick:d,children:["\u8FD8\u6709 ",g.length-6," \u53F0\u53EF\u7528\u8FDC\u7AEF"]})]})]}):(0,D.jsx)("section",{ref:t,className:"dsh-ssh-sidebar is-rail",children:(0,D.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-rail-button${f?" is-active":""}`,title:r===void 0?"\u6253\u5F00\u4F1A\u8BDD\u540E\u53EF\u67E5\u770B SSH \u4FA7\u680F":f?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F","aria-label":f?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F","aria-pressed":f,disabled:r===void 0,onClick:d,children:(0,D.jsx)(Ts,{})})})}function Wx(e){let t=_r(),s=e.useSessions(N=>N.current),r=e.useWorkspaces(N=>N),[o,i]=(0,ne.useState)([]),[n,a]=(0,ne.useState)([]),[h,l]=(0,ne.useState)([]),[c,f]=(0,ne.useState)([]),[v,g]=(0,ne.useState)(()=>e.controller.selected()===void 0?null:{profileId:e.controller.selected(),path:"~"}),[u,d]=(0,ne.useState)("workspace"),[m,p]=(0,ne.useState)(),[b,x]=(0,ne.useState)(),[y,S]=(0,ne.useState)(0),[_,w]=(0,ne.useState)(),C=Gp(s===void 0?void 0:String(s)),P=(0,ne.useRef)(s),T=(0,ne.useCallback)(async()=>{try{let[N,H,E,R]=await Promise.all([jn(),Nl(),Wl(),ql()]);i(N),f(H),a(E),l(R),g(L=>L!==null&&N.some(k=>k.id===L.profileId)?L:N[0]===void 0?null:{profileId:N[0].id,path:"~"}),w(void 0)}catch(N){w(je(N))}},[]);(0,ne.useEffect)(()=>{let N=()=>{let H=e.controller.selected();H!==void 0&&g(E=>({profileId:H,path:E?.profileId===H?E.path:"~"}))};return N(),e.controller.subscribe(N)},[e.controller]),(0,ne.useEffect)(()=>{T()},[T,y]),(0,ne.useEffect)(()=>{P.current!==s&&e.controller.close()},[e.controller,s]);let A=o.find(N=>N.id===v?.profileId),F=r.items.find(N=>s!==void 0&&N.sessionIds.includes(s))?.workspaceId,B=(0,D.jsxs)("header",{ref:t.ref,onPointerMove:t.onPointerMove,onPointerLeave:t.onPointerLeave,className:"dsh-ssh-toolbar dsh-ssh-border-surface",children:[(0,D.jsxs)("div",{className:"dsh-ssh-brand",children:[(0,D.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u8FD4\u56DE\u4F1A\u8BDD",title:"\u8FD4\u56DE\u4F1A\u8BDD",onClick:()=>e.controller.close(),children:(0,D.jsx)(ye.IconChevronLeftOutline14,{size:15})}),(0,D.jsx)("span",{className:"dsh-ssh-brand-glyph",children:(0,D.jsx)(Ts,{})}),(0,D.jsxs)("span",{children:[(0,D.jsx)("strong",{children:"SSH \u5DE5\u4F5C\u53F0"}),(0,D.jsx)("small",{children:u==="transfer"?"FTP \xB7 FTPS \xB7 SFTP":A===void 0?"\u9009\u62E9\u4E00\u53F0\u4E3B\u673A":`${A.username}@${A.host}`})]})]}),(0,D.jsxs)("nav",{className:"dsh-ssh-segments",role:"tablist","aria-label":"SSH \u5DE5\u4F5C\u53F0\u89C6\u56FE",children:[(0,D.jsx)(nr,{active:u==="workspace",onClick:()=>d("workspace"),children:"\u7EC8\u7AEF\u4E0E\u6587\u4EF6"}),(0,D.jsx)(nr,{active:u==="transfer",onClick:()=>d("transfer"),children:"\u6587\u4EF6\u4F20\u8F93"}),(0,D.jsx)(nr,{active:u==="forwards",onClick:()=>d("forwards"),children:"\u7AEF\u53E3\u8F6C\u53D1"}),(0,D.jsx)(nr,{active:u==="vault",onClick:()=>d("vault"),children:"\u5BC6\u94A5\u5E93"}),(0,D.jsx)(nr,{active:u==="proxies",onClick:()=>d("proxies"),children:"\u4EE3\u7406\u5E93"}),(0,D.jsx)(nr,{active:u==="settings",onClick:()=>d("settings"),children:"\u8BBE\u7F6E"})]})]});return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Ip,{className:"dsh-ssh-workspace",toolbar:B,notice:_&&(0,D.jsxs)("div",{className:"dsh-ssh-banner is-error",role:"alert",children:[(0,D.jsx)("span",{children:_}),(0,D.jsx)("button",{onClick:()=>w(void 0),"aria-label":"\u5173\u95ED",children:(0,D.jsx)(ye.IconCloseOutline16,{size:16})})]}),navigationLabel:"\u4E3B\u673A",navigationIcon:(0,D.jsx)(ye.IconDataOutline16,{size:15}),navigation:N=>(0,D.jsx)(Wp,{profiles:o,access:C.value,accessLoading:C.loading,accessSaving:C.saving,accessError:C.error,workspaces:r.items,currentWorkspaceId:F===void 0?void 0:String(F),recentWorkspaceId:r.recentWorkspaceId===void 0?void 0:String(r.recentWorkspaceId),selected:v,onSelect:H=>{g(H),d("workspace"),e.controller.open(H.profileId),N.closePanel()},onProfiles:C.setProfiles,onDirectory:(H,E,R)=>{C.setDirectory(H,E,R),E!==void 0&&(g({profileId:H,path:E,...R===void 0?{}:{projectId:R}}),d("workspace"))},onPermission:C.setPermission,onApproval:C.setRequireCommandApproval,onCreateSession:async(H,E)=>{await e.controller.createProjectSession(E,H,C.value?.permission??"exec",C.value?.requireCommandApproval??!0),e.controller.close()},onNewProfile:()=>{p("new"),N.closePanel()}}),children:(0,D.jsx)("section",{className:"dsh-ssh-main-panel dsh-ssh-scroll-surface",children:u==="transfer"?(0,D.jsx)(nf,{ftpProfiles:c,vaultEntries:n,proxyEntries:h,access:C,onProfilesChanged:()=>S(N=>N+1)}):u==="vault"?(0,D.jsx)(Xx,{entries:n,onChanged:()=>S(N=>N+1)}):u==="proxies"?(0,D.jsx)(Yx,{entries:h,onChanged:()=>S(N=>N+1)}):A===void 0?(0,D.jsx)(_p,{}):u==="workspace"?(0,D.jsx)(qx,{profile:A,initialPath:v?.path??"~",onEdit:()=>p(A),onDelete:()=>x(A)},A.id):u==="forwards"?(0,D.jsx)(Gx,{profiles:o,selected:A}):(0,D.jsx)(Zx,{})})}),m!==void 0&&(0,D.jsx)(Qp,{profile:m==="new"?void 0:m,profiles:o,vaultEntries:n,proxyEntries:h,onClose:()=>p(void 0),onSaved:()=>{p(void 0),S(N=>N+1)}}),b!==void 0&&(0,D.jsx)(Yp,{profile:b,dependents:o.filter(N=>N.id!==b.id&&N.proxy.type==="jump"&&N.proxy.profileIds.includes(b.id)),onClose:()=>x(void 0),onDeleted:()=>{x(void 0),p(void 0),S(N=>N+1)}})]})}function qx({profile:e,initialPath:t,onEdit:s,onDelete:r}){let[o,i]=(0,ne.useState)(!1),n=_r();return(0,D.jsxs)("div",{className:"dsh-ssh-host-workbench",children:[(0,D.jsxs)("header",{ref:n.ref,onPointerMove:n.onPointerMove,onPointerLeave:n.onPointerLeave,className:"dsh-ssh-workbench-heading dsh-ssh-border-surface",children:[(0,D.jsxs)("div",{children:[(0,D.jsx)("span",{className:"dsh-ssh-host-monogram",children:e.name.slice(0,1).toUpperCase()}),(0,D.jsxs)("span",{children:[(0,D.jsx)("h1",{children:e.name}),(0,D.jsxs)("p",{children:[Yt(e)," \xB7 ",pf(e)]})]})]}),(0,D.jsxs)("div",{className:"dsh-ssh-heading-actions",children:[(0,D.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":`\u5220\u9664\u4E3B\u673A ${e.name}`,title:"\u5220\u9664\u4E3B\u673A",onClick:r,children:(0,D.jsx)(ye.IconTrashOutline16,{size:16})}),(0,D.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:s,children:[(0,D.jsx)(ye.IconEditOutline16,{size:16}),"\u7F16\u8F91\u4E3B\u673A"]})]})]}),(0,D.jsx)(Jp,{storageKey:"dsh-ssh:workbench:sftp-width",label:"\u8C03\u6574\u7EC8\u7AEF\u4E0E SFTP \u7684\u5BBD\u5EA6",primary:(0,D.jsx)("section",{className:"dsh-ssh-workbench-terminal","aria-label":`${e.name} \u7EC8\u7AEF`,children:(0,D.jsx)(Kx,{profile:e,onEdit:s,onDelete:r,onConnected:()=>i(!0),embedded:!0})}),secondary:(0,D.jsx)("section",{className:"dsh-ssh-workbench-files","aria-label":`${e.name} SFTP`,children:o?(0,D.jsx)(kp,{profile:e,initialPath:t,embedded:!0},`${e.id}:${t}`):(0,D.jsxs)("div",{className:"dsh-ssh-sftp-deferred",children:[(0,D.jsx)("span",{children:"SFTP"}),(0,D.jsx)("strong",{children:"\u7B49\u5F85\u7EC8\u7AEF\u8FDE\u63A5"}),(0,D.jsx)("p",{children:"\u6253\u5F00\u7EC8\u7AEF\u540E\u518D\u8BFB\u53D6\u8FDC\u7AEF\u76EE\u5F55\u3002"})]})})})]})}function Kx({profile:e,onEdit:t,onDelete:s,onConnected:r,embedded:o=!1}){let i=(0,ne.useRef)(null),n=(0,ne.useRef)(),a=(0,ne.useRef)(),h=(0,ne.useRef)(),[l,c]=(0,ne.useState)(),[f,v]=(0,ne.useState)("idle"),[g,u]=(0,ne.useState)();(0,ne.useEffect)(()=>{let p=i.current;if(p===null)return;let b=Ln({scrollback:5e3}),x=new df.FitAddon;b.loadAddon(x),b.open(p),n.current=b,a.current=x;let y=On(p,b,x,(S,_)=>{let w=h.current;w!==void 0&&oe(`/terminals/${w}/resize`,{method:"POST",body:JSON.stringify({cols:S,rows:_})}).catch(()=>{})});return()=>{y.dispose(),b.dispose(),n.current=void 0,a.current=void 0}},[]),(0,ne.useEffect)(()=>{h.current=l},[l]),(0,ne.useEffect)(()=>{if(l===void 0)return;let p=n.current;if(p===void 0)return;let b=new Ir({streamUrl:ph(l),read:S=>oe(`/terminals/${l}/output?cursor=${S}`),send:(S,_)=>oe(`/terminals/${l}/input`,{method:"POST",body:JSON.stringify({text:S,sequence:_})})}),x=p.onData(S=>b.sendInput(S,_=>u(je(_)))),y=b.observe({output:S=>{S.truncated&&p.write(`\r
|
|
6515
|
+
`;var D=require("react/jsx-runtime"),Hn="@lemoncat7/dsh-ssh",hf=`${Hn}/client`,Hx=["slots","layout","sessions","workspaces"];function $x(e){e.effect(cy,"dsh-ssh: styles");let t=Vx(e),s=Ux(e,()=>t.close());e.effect(()=>Bp(Hn,()=>{s.close(),t.close()}),"dsh-ssh: exclusive workspace"),e.effect(()=>()=>{s.close(),t.dispose()},"dsh-ssh: workspace lifecycle"),e.slots.inject("sidebar.footer.action",()=>e.slots.register({name:"sidebar.footer.action",id:"ssh-remote",order:-100},r=>(0,D.jsx)(jx,{...r,controller:s,activityController:t,collapseSidebar:()=>e.layout.toggleSidebar()})))}function Ux(e,t){let s=e,r=new Set,o,i,n=()=>{for(let h of r)h()},a={open(h){t(),h!==void 0&&(o=h),i===void 0&&(Pl(Hn),i=e.slots.register({name:"conversation",priority:-2},l=>(0,D.jsx)(Wx,{...l,controller:a}))),n()},toggle(){i===void 0?a.open():a.close()},close(){if(i===void 0)return;let h=i;i=void 0,h(),n()},isOpen:()=>i!==void 0,selected:()=>o,subscribe(h){return r.add(h),()=>r.delete(h)},async createProjectSession(h,l,c,f){let v=await s.sessions.create({workspaceId:h});return await ki({...bi(String(v)),profileIds:[l.profileId],permission:c,requireCommandApproval:f,workingDirectories:{[l.profileId]:l.path},workingProjectIds:{[l.profileId]:l.id}}),s.sessions.open(v),String(v)}};return a}function Vx(e){let t=e,s=new Set,r=new Map,o=cf(t.sessions.list.getSnapshot().current),i,n,a,h=()=>{for(let d of s)d()},l=()=>{n!==void 0&&(window.cancelAnimationFrame(n),n=void 0)},c=()=>{if(a===void 0)return!1;let d=a;return a=void 0,i=void 0,d(),!0},f=(d,m=!0)=>{i===d&&a!==void 0||(c(),i=d,a=e.slots.register({name:"details",priority:-2},p=>(0,D.jsx)(Rp,{...p,controller:g})),m&&e.layout.openDetails())},v=()=>{let d=t.sessions.list.getSnapshot(),m=cf(d.current);if(m===o)return;l();let p=c();o=m,m!==void 0&&r.get(m)?.open===!0?(f(m,!1),n=window.requestAnimationFrame(()=>{n=void 0,o===m&&i===m&&r.get(m)?.open===!0&&e.layout.openDetails()})):p&&e.layout.closeDetails(),h()},g={open(d,m,p){let b=p??(m===void 0?"local-directory":"remote-directory"),x=r.get(d),y=m??x?.selectedProfileId;r.set(d,{open:!0,...y===void 0?{}:{selectedProfileId:y},requestedView:b}),Pl(Hn),d===o&&(l(),f(d),e.layout.openDetails()),h()},toggle(d){if(r.get(d)?.open===!0)return g.close(d);g.open(d)},close(d){let m=d??o;if(m===void 0)return;let p=r.get(m);p!==void 0&&r.set(m,{...p,open:!1}),m===o&&(l(),c()&&e.layout.closeDetails()),h()},isOpen:d=>r.get(d)?.open===!0,selected:d=>r.get(d)?.selectedProfileId,requestedView:d=>r.get(d)?.requestedView,subscribe(d){return s.add(d),()=>s.delete(d)},dispose(){u(),l(),c(),r.clear(),s.clear()}},u=t.sessions.list.subscribe(v);return g}function cf(e){return typeof e=="string"&&e.length>0?e:void 0}function jx(e){let t=(0,ne.useRef)(null);Vp(t);let s=e.useSessions(p=>p.current),r=s===void 0?void 0:String(s),[o,i]=(0,ne.useState)([]),[n,a]=(0,ne.useState)(null),[h,l]=(0,ne.useState)(!0),c=(0,ne.useSyncExternalStore)(e.controller.subscribe,e.controller.isOpen),f=(0,ne.useSyncExternalStore)(e.activityController.subscribe,()=>r!==void 0&&e.activityController.isOpen(r));(0,ne.useEffect)(()=>qp(p=>{p.sessionId===r&&a(p)}),[r]);let v=(0,ne.useCallback)(async()=>{let p=await jn().catch(()=>[]);i(p),a(s===void 0?null:await Si(String(s)).catch(()=>null))},[s]);(0,ne.useEffect)(()=>{v()},[v,c]);let g=n===null?[]:n.profileIds.map(p=>o.find(b=>b.id===p)).filter(p=>p!==void 0);(0,ne.useEffect)(()=>{if(r===void 0||n?.permission!=="terminal")return;let p=new EventSource(Zl(r)),b=x=>{let y=ay(x);y===void 0||y.sessionId!==r||(e.controller.close(),e.activityController.open(r,y.profileId,"terminals"))};return p.addEventListener("terminal-opened",b),()=>{p.removeEventListener("terminal-opened",b),p.close()}},[r,n?.permission,e.activityController,e.controller]);let u=p=>{r!==void 0&&(e.controller.close(),e.activityController.open(r,p,p===void 0?"local-directory":"remote-directory"))},d=()=>{r!==void 0&&(f?e.activityController.close(r):u())},m=()=>{e.controller.open(),e.wide&&window.matchMedia("(max-width: 820px)").matches&&e.collapseSidebar()};return e.wide?(0,D.jsxs)("section",{ref:t,className:"dsh-ssh-sidebar",children:[(0,D.jsxs)("div",{className:"dsh-ssh-sidebar-heading",children:[(0,D.jsxs)("button",{type:"button",className:"dsh-ssh-sidebar-title","aria-expanded":h,onClick:()=>l(p=>!p),children:[(0,D.jsx)("span",{className:"dsh-ssh-disclosure","data-open":h,children:(0,D.jsx)(ye.IconChevronDownOutline14,{size:14})}),(0,D.jsx)("span",{children:"\u8FDC\u7AEF"})]}),(0,D.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-icon-button${f?" is-active":""}`,"aria-label":f?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F",title:r===void 0?"\u6253\u5F00\u4F1A\u8BDD\u540E\u53EF\u67E5\u770B SSH \u4FA7\u680F":f?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F","aria-pressed":f,disabled:r===void 0,onClick:d,children:(0,D.jsx)(ye.IconPanelLeftOutline16,{size:16,className:"dsh-ssh-panel-right-icon"})})]}),h&&(0,D.jsxs)("div",{className:"dsh-ssh-sidebar-list",children:[(0,D.jsxs)("button",{type:"button",className:"dsh-ssh-sidebar-panel",onClick:m,children:[(0,D.jsx)(Ts,{}),(0,D.jsx)("span",{children:"SSH \u9762\u677F"})]}),r===void 0?(0,D.jsx)("p",{className:"dsh-ssh-sidebar-note",children:"\u6253\u5F00\u4F1A\u8BDD\u540E\u663E\u793A\u53EF\u7528\u8FDC\u7AEF"}):g.length===0?(0,D.jsx)("p",{className:"dsh-ssh-sidebar-note",children:"\u5F53\u524D\u4F1A\u8BDD\u672A\u6388\u6743\u8FDC\u7AEF"}):g.slice(0,6).map(p=>(0,D.jsxs)("button",{type:"button","data-ssh-interactive":"choice","aria-pressed":f&&e.activityController.selected(r)===p.id,className:`dsh-ssh-sidebar-row${f&&e.activityController.selected(r)===p.id?" is-active":""}`,onClick:()=>u(p.id),children:[(0,D.jsx)("span",{className:"dsh-ssh-status-dot is-injected","aria-hidden":"true"}),(0,D.jsxs)("span",{className:"dsh-ssh-sidebar-copy",children:[(0,D.jsx)("strong",{children:p.name}),(0,D.jsx)("small",{children:p.host})]}),(0,D.jsx)("span",{className:"dsh-ssh-injected-mark",children:"\u5DF2\u6302\u8F7D"})]},p.id)),g.length>6&&(0,D.jsxs)("button",{type:"button",className:"dsh-ssh-sidebar-more",onClick:d,children:["\u8FD8\u6709 ",g.length-6," \u53F0\u53EF\u7528\u8FDC\u7AEF"]})]})]}):(0,D.jsx)("section",{ref:t,className:"dsh-ssh-sidebar is-rail",children:(0,D.jsx)("button",{type:"button","data-ssh-interactive":"choice",className:`dsh-ssh-rail-button${f?" is-active":""}`,title:r===void 0?"\u6253\u5F00\u4F1A\u8BDD\u540E\u53EF\u67E5\u770B SSH \u4FA7\u680F":f?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F","aria-label":f?"\u6536\u8D77 SSH \u4FA7\u680F":"\u5C55\u5F00 SSH \u4FA7\u680F","aria-pressed":f,disabled:r===void 0,onClick:d,children:(0,D.jsx)(Ts,{})})})}function Wx(e){let t=_r(),s=e.useSessions(N=>N.current),r=e.useWorkspaces(N=>N),[o,i]=(0,ne.useState)([]),[n,a]=(0,ne.useState)([]),[h,l]=(0,ne.useState)([]),[c,f]=(0,ne.useState)([]),[v,g]=(0,ne.useState)(()=>e.controller.selected()===void 0?null:{profileId:e.controller.selected(),path:"~"}),[u,d]=(0,ne.useState)("workspace"),[m,p]=(0,ne.useState)(),[b,x]=(0,ne.useState)(),[y,S]=(0,ne.useState)(0),[_,w]=(0,ne.useState)(),C=Gp(s===void 0?void 0:String(s)),P=(0,ne.useRef)(s),T=(0,ne.useCallback)(async()=>{try{let[N,H,E,R]=await Promise.all([jn(),Nl(),Wl(),ql()]);i(N),f(H),a(E),l(R),g(L=>L!==null&&N.some(k=>k.id===L.profileId)?L:N[0]===void 0?null:{profileId:N[0].id,path:"~"}),w(void 0)}catch(N){w(je(N))}},[]);(0,ne.useEffect)(()=>{let N=()=>{let H=e.controller.selected();H!==void 0&&g(E=>({profileId:H,path:E?.profileId===H?E.path:"~"}))};return N(),e.controller.subscribe(N)},[e.controller]),(0,ne.useEffect)(()=>{T()},[T,y]),(0,ne.useEffect)(()=>{P.current!==s&&e.controller.close()},[e.controller,s]);let A=o.find(N=>N.id===v?.profileId),F=r.items.find(N=>s!==void 0&&N.sessionIds.includes(s))?.workspaceId,B=(0,D.jsxs)("header",{ref:t.ref,onPointerMove:t.onPointerMove,onPointerLeave:t.onPointerLeave,className:"dsh-ssh-toolbar dsh-ssh-border-surface",children:[(0,D.jsxs)("div",{className:"dsh-ssh-brand",children:[(0,D.jsx)("button",{type:"button",className:"dsh-ssh-icon-button","aria-label":"\u8FD4\u56DE\u4F1A\u8BDD",title:"\u8FD4\u56DE\u4F1A\u8BDD",onClick:()=>e.controller.close(),children:(0,D.jsx)(ye.IconChevronLeftOutline14,{size:15})}),(0,D.jsx)("span",{className:"dsh-ssh-brand-glyph",children:(0,D.jsx)(Ts,{})}),(0,D.jsxs)("span",{children:[(0,D.jsx)("strong",{children:"SSH \u5DE5\u4F5C\u53F0"}),(0,D.jsx)("small",{children:u==="transfer"?"FTP \xB7 FTPS \xB7 SFTP":A===void 0?"\u9009\u62E9\u4E00\u53F0\u4E3B\u673A":`${A.username}@${A.host}`})]})]}),(0,D.jsxs)("nav",{className:"dsh-ssh-segments",role:"tablist","aria-label":"SSH \u5DE5\u4F5C\u53F0\u89C6\u56FE",children:[(0,D.jsx)(nr,{active:u==="workspace",onClick:()=>d("workspace"),children:"\u7EC8\u7AEF\u4E0E\u6587\u4EF6"}),(0,D.jsx)(nr,{active:u==="transfer",onClick:()=>d("transfer"),children:"\u6587\u4EF6\u4F20\u8F93"}),(0,D.jsx)(nr,{active:u==="forwards",onClick:()=>d("forwards"),children:"\u7AEF\u53E3\u8F6C\u53D1"}),(0,D.jsx)(nr,{active:u==="vault",onClick:()=>d("vault"),children:"\u5BC6\u94A5\u5E93"}),(0,D.jsx)(nr,{active:u==="proxies",onClick:()=>d("proxies"),children:"\u4EE3\u7406\u5E93"}),(0,D.jsx)(nr,{active:u==="settings",onClick:()=>d("settings"),children:"\u8BBE\u7F6E"})]})]});return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Ip,{className:"dsh-ssh-workspace",toolbar:B,notice:_&&(0,D.jsxs)("div",{className:"dsh-ssh-banner is-error",role:"alert",children:[(0,D.jsx)("span",{children:_}),(0,D.jsx)("button",{onClick:()=>w(void 0),"aria-label":"\u5173\u95ED",children:(0,D.jsx)(ye.IconCloseOutline16,{size:16})})]}),navigationLabel:"\u4E3B\u673A",navigationIcon:(0,D.jsx)(ye.IconDataOutline16,{size:15}),navigation:N=>(0,D.jsx)(Wp,{profiles:o,access:C.value,accessLoading:C.loading,accessSaving:C.saving,accessError:C.error,workspaces:r.items,currentWorkspaceId:F===void 0?void 0:String(F),recentWorkspaceId:r.recentWorkspaceId===void 0?void 0:String(r.recentWorkspaceId),selected:v,onSelect:H=>{g(H),d("workspace"),e.controller.open(H.profileId),N.closePanel()},onProfiles:C.setProfiles,onDirectory:(H,E,R)=>{C.setDirectory(H,E,R),E!==void 0&&(g({profileId:H,path:E,...R===void 0?{}:{projectId:R}}),d("workspace"))},onPermission:C.setPermission,onApproval:C.setRequireCommandApproval,onCreateSession:async(H,E)=>{await e.controller.createProjectSession(E,H,C.value?.permission??"exec",C.value?.requireCommandApproval??!0),e.controller.close()},onNewProfile:()=>{p("new"),N.closePanel()}}),children:(0,D.jsx)("section",{className:"dsh-ssh-main-panel dsh-ssh-scroll-surface",children:u==="transfer"?(0,D.jsx)(nf,{ftpProfiles:c,vaultEntries:n,proxyEntries:h,access:C,onProfilesChanged:()=>S(N=>N+1)}):u==="vault"?(0,D.jsx)(Xx,{entries:n,onChanged:()=>S(N=>N+1)}):u==="proxies"?(0,D.jsx)(Yx,{entries:h,onChanged:()=>S(N=>N+1)}):A===void 0?(0,D.jsx)(_p,{}):u==="workspace"?(0,D.jsx)(qx,{profile:A,initialPath:v?.path??"~",onEdit:()=>p(A),onDelete:()=>x(A)},A.id):u==="forwards"?(0,D.jsx)(Gx,{profiles:o,selected:A}):(0,D.jsx)(Zx,{})})}),m!==void 0&&(0,D.jsx)(Qp,{profile:m==="new"?void 0:m,profiles:o,vaultEntries:n,proxyEntries:h,onClose:()=>p(void 0),onSaved:()=>{p(void 0),S(N=>N+1)}}),b!==void 0&&(0,D.jsx)(Yp,{profile:b,dependents:o.filter(N=>N.id!==b.id&&N.proxy.type==="jump"&&N.proxy.profileIds.includes(b.id)),onClose:()=>x(void 0),onDeleted:()=>{x(void 0),p(void 0),S(N=>N+1)}})]})}function qx({profile:e,initialPath:t,onEdit:s,onDelete:r}){let[o,i]=(0,ne.useState)(!1),n=_r();return(0,D.jsxs)("div",{className:"dsh-ssh-host-workbench",children:[(0,D.jsxs)("header",{ref:n.ref,onPointerMove:n.onPointerMove,onPointerLeave:n.onPointerLeave,className:"dsh-ssh-workbench-heading dsh-ssh-border-surface",children:[(0,D.jsxs)("div",{children:[(0,D.jsx)("span",{className:"dsh-ssh-host-monogram",children:e.name.slice(0,1).toUpperCase()}),(0,D.jsxs)("span",{children:[(0,D.jsx)("h1",{children:e.name}),(0,D.jsxs)("p",{children:[Yt(e)," \xB7 ",pf(e)]})]})]}),(0,D.jsxs)("div",{className:"dsh-ssh-heading-actions",children:[(0,D.jsx)("button",{type:"button",className:"dsh-ssh-icon-button is-danger","aria-label":`\u5220\u9664\u4E3B\u673A ${e.name}`,title:"\u5220\u9664\u4E3B\u673A",onClick:r,children:(0,D.jsx)(ye.IconTrashOutline16,{size:16})}),(0,D.jsxs)("button",{type:"button",className:"dsh-ssh-secondary-button",onClick:s,children:[(0,D.jsx)(ye.IconEditOutline16,{size:16}),"\u7F16\u8F91\u4E3B\u673A"]})]})]}),(0,D.jsx)(Jp,{storageKey:"dsh-ssh:workbench:sftp-width",label:"\u8C03\u6574\u7EC8\u7AEF\u4E0E SFTP \u7684\u5BBD\u5EA6",primary:(0,D.jsx)("section",{className:"dsh-ssh-workbench-terminal","aria-label":`${e.name} \u7EC8\u7AEF`,children:(0,D.jsx)(Kx,{profile:e,onEdit:s,onDelete:r,onConnected:()=>i(!0),embedded:!0})}),secondary:(0,D.jsx)("section",{className:"dsh-ssh-workbench-files","aria-label":`${e.name} SFTP`,children:o?(0,D.jsx)(kp,{profile:e,initialPath:t,embedded:!0},`${e.id}:${t}`):(0,D.jsxs)("div",{className:"dsh-ssh-sftp-deferred",children:[(0,D.jsx)("span",{children:"SFTP"}),(0,D.jsx)("strong",{children:"\u7B49\u5F85\u7EC8\u7AEF\u8FDE\u63A5"}),(0,D.jsx)("p",{children:"\u6253\u5F00\u7EC8\u7AEF\u540E\u518D\u8BFB\u53D6\u8FDC\u7AEF\u76EE\u5F55\u3002"})]})})})]})}function Kx({profile:e,onEdit:t,onDelete:s,onConnected:r,embedded:o=!1}){let i=(0,ne.useRef)(null),n=(0,ne.useRef)(),a=(0,ne.useRef)(),h=(0,ne.useRef)(),[l,c]=(0,ne.useState)(),[f,v]=(0,ne.useState)("idle"),[g,u]=(0,ne.useState)();(0,ne.useEffect)(()=>{let p=i.current;if(p===null)return;let b=Ln({scrollback:5e3}),x=new df.FitAddon;b.loadAddon(x),b.open(p),n.current=b,a.current=x;let y=On(p,b,x,(S,_)=>{let w=h.current;w!==void 0&&oe(`/terminals/${w}/resize`,{method:"POST",body:JSON.stringify({cols:S,rows:_})}).catch(()=>{})});return()=>{y.dispose(),b.dispose(),n.current=void 0,a.current=void 0}},[]),(0,ne.useEffect)(()=>{h.current=l},[l]),(0,ne.useEffect)(()=>{if(l===void 0)return;let p=n.current;if(p===void 0)return;let b=new Ir({streamUrl:ph(l),read:S=>oe(`/terminals/${l}/output?cursor=${S}`),send:(S,_)=>oe(`/terminals/${l}/input`,{method:"POST",body:JSON.stringify({text:S,sequence:_})})}),x=p.onData(S=>b.sendInput(S,_=>u(je(_)))),y=b.observe({output:S=>{S.truncated&&p.write(`\r
|
|
6516
6516
|
\x1B[33m[\u8F83\u65E9\u8F93\u51FA\u5DF2\u622A\u65AD]\x1B[0m\r
|
|
6517
6517
|
`),S.data&&p.write(S.data),S.closed&&(v("idle"),c(void 0))},error:S=>{u(je(S)),v("error")}});return()=>{y(),b.dispose(),x.dispose()}},[l]),(0,ne.useEffect)(()=>()=>{l!==void 0&&oe(`/terminals/${l}`,{method:"DELETE"}).catch(()=>{})},[l]),(0,ne.useEffect)(()=>{c(void 0),v("idle"),n.current?.clear()},[e.id]);let d=async()=>{let p=n.current;if(p!==void 0){v("connecting"),u(void 0),p.clear(),p.write(`\x1B[2m\u6B63\u5728\u8FDE\u63A5 ${Yt(e)}\u2026\x1B[0m\r
|
|
6518
6518
|
`);try{a.current?.fit();let b=await oe("/terminals",{method:"POST",body:JSON.stringify({profileId:e.id,cols:p.cols,rows:p.rows})});c(b.id),v("connected"),r?.(),p.focus()}catch(b){v("error"),u(je(b)),p.write(`\r
|