@knowsuchagency/fulcrum 2.1.1 → 2.1.2
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/bin/fulcrum.js
CHANGED
|
@@ -44758,7 +44758,7 @@ async function runMcpServer(urlOverride, portOverride) {
|
|
|
44758
44758
|
const client = new FulcrumClient(urlOverride, portOverride);
|
|
44759
44759
|
const server = new McpServer({
|
|
44760
44760
|
name: "fulcrum",
|
|
44761
|
-
version: "2.1.
|
|
44761
|
+
version: "2.1.2"
|
|
44762
44762
|
});
|
|
44763
44763
|
registerTools(server, client);
|
|
44764
44764
|
const transport = new StdioServerTransport;
|
|
@@ -47107,7 +47107,7 @@ var marketplace_default = `{
|
|
|
47107
47107
|
"name": "fulcrum",
|
|
47108
47108
|
"source": "./",
|
|
47109
47109
|
"description": "Task orchestration for Claude Code",
|
|
47110
|
-
"version": "2.1.
|
|
47110
|
+
"version": "2.1.2",
|
|
47111
47111
|
"skills": [
|
|
47112
47112
|
"./skills/fulcrum"
|
|
47113
47113
|
],
|
|
@@ -48295,7 +48295,7 @@ function compareVersions(v1, v2) {
|
|
|
48295
48295
|
var package_default = {
|
|
48296
48296
|
name: "@knowsuchagency/fulcrum",
|
|
48297
48297
|
private: true,
|
|
48298
|
-
version: "2.1.
|
|
48298
|
+
version: "2.1.2",
|
|
48299
48299
|
description: "Harness Attention. Orchestrate Agents. Ship.",
|
|
48300
48300
|
license: "PolyForm-Perimeter-1.0.0",
|
|
48301
48301
|
type: "module",
|
|
@@ -79,7 +79,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
79
79
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:s,tableCell:l,tableRow:o}};function s(m,b,y,v){return u(d(m,y,v),m.align)}function o(m,b,y,v){const _=f(m,y,v),E=u([_]);return E.slice(0,E.indexOf(`
|
|
80
80
|
`))}function l(m,b,y,v){const _=y.enter("tableCell"),E=y.enter("phrasing"),C=y.containerPhrasing(m,{...v,before:a,after:a});return E(),_(),C}function u(m,b){return Zft(m,{align:b,alignDelimiters:r,padding:n,stringLength:i})}function d(m,b,y){const v=m.children;let _=-1;const E=[],C=b.enter("table");for(;++_<v.length;)E[_]=f(v[_],b,y);return C(),E}function f(m,b,y){const v=m.children;let _=-1;const E=[],C=b.enter("tableRow");for(;++_<v.length;)E[_]=l(v[_],m,b,y);return C(),E}function p(m,b,y){let v=t2e.inlineCode(m,b,y);return y.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function Fht(){return{exit:{taskListCheckValueChecked:hse,taskListCheckValueUnchecked:hse,paragraph:$ht}}}function Bht(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Uht}}}function hse(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function $ht(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let a=-1,s;for(;++a<i.length;){const o=i[a];if(o.type==="paragraph"){s=o;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Uht(e,t,n,r){const i=e.children[0],a=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);a&&o.move(s);let l=t2e.listItem(e,t,n,{...r,...o.current()});return a&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(d){return d+s}}function zht(){return[xft(),Uft(),Wft(),Rht(),Fht()]}function Hht(e){return{extensions:[_ft(),zft(e),qft(),jht(e),Bht()]}}const Vht={tokenize:Xht,partial:!0},n2e={tokenize:Zht,partial:!0},r2e={tokenize:Qht,partial:!0},i2e={tokenize:Jht,partial:!0},Wht={tokenize:ept,partial:!0},a2e={name:"wwwAutolink",tokenize:Kht,previous:o2e},s2e={name:"protocolAutolink",tokenize:Yht,previous:l2e},Xh={name:"emailAutolink",tokenize:Ght,previous:u2e},yf={};function qht(){return{text:yf}}let yg=48;for(;yg<123;)yf[yg]=Xh,yg++,yg===58?yg=65:yg===91&&(yg=97);yf[43]=Xh;yf[45]=Xh;yf[46]=Xh;yf[95]=Xh;yf[72]=[Xh,s2e];yf[104]=[Xh,s2e];yf[87]=[Xh,a2e];yf[119]=[Xh,a2e];function Ght(e,t,n){const r=this;let i,a;return s;function s(f){return!bB(f)||!u2e.call(r,r.previous)||xY(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(f))}function o(f){return bB(f)?(e.consume(f),o):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(Wht,d,u)(f):f===45||f===95||ho(f)?(a=!0,e.consume(f),l):d(f)}function u(f){return e.consume(f),i=!0,l}function d(f){return a&&i&&co(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function Kht(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!o2e.call(r,r.previous)||xY(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Vht,e.attempt(n2e,e.attempt(r2e,a),n),n)(s))}function a(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function Yht(e,t,n){const r=this;let i="",a=!1;return s;function s(f){return(f===72||f===104)&&l2e.call(r,r.previous)&&!xY(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),o):n(f)}function o(f){if(co(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),o;if(f===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(f),l}return n(f)}function l(f){return f===47?(e.consume(f),a?u:(a=!0,l)):n(f)}function u(f){return f===null||DN(f)||_r(f)||Ro(f)||gD(f)?n(f):e.attempt(n2e,e.attempt(r2e,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function Xht(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),a):n(s)}function a(s){return s===null?n(s):t(s)}}function Zht(e,t,n){let r,i,a;return s;function s(u){return u===46||u===95?e.check(i2e,l,o)(u):u===null||_r(u)||Ro(u)||u!==45&&gD(u)?l(u):(a=!0,e.consume(u),s)}function o(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),s}function l(u){return i||r||!a?n(u):t(u)}}function Qht(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?a(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(i2e,t,a)(s):s===null||_r(s)||Ro(s)?t(s):(e.consume(s),i)}function a(s){return s===41&&r++,e.consume(s),i}}function Jht(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||_r(o)||Ro(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||_r(o)||Ro(o)?t(o):r(o)}function a(o){return co(o)?s(o):n(o)}function s(o){return o===59?(e.consume(o),r):co(o)?(e.consume(o),s):n(o)}}function ept(e,t,n){return r;function r(a){return e.consume(a),i}function i(a){return ho(a)?n(a):t(a)}}function o2e(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||_r(e)}function l2e(e){return!co(e)}function u2e(e){return!(e===47||bB(e))}function bB(e){return e===43||e===45||e===46||e===95||ho(e)}function xY(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const tpt={tokenize:upt,partial:!0};function npt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:spt,continuation:{tokenize:opt},exit:lpt}},text:{91:{name:"gfmFootnoteCall",tokenize:apt},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:rpt,resolveTo:ipt}}}}function rpt(e,t,n){const r=this;let i=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){s=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return o;function o(l){if(!s||!s._balanced)return n(l);const u=qc(r.sliceSerialize({start:s.end,end:r.now()}));return u.codePointAt(0)!==94||!a.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function ipt(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function apt(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,s;return o;function o(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),l}function l(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(a>999||f===93&&!s||f===null||f===91||_r(f))return n(f);if(f===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(qc(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return _r(f)||(s=!0),a++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),a++,u):u(f)}}function spt(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,s=0,o;return l;function l(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(b)}function d(b){if(s>999||b===93&&!o||b===null||b===91||_r(b))return n(b);if(b===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return a=qc(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return _r(b)||(o=!0),s++,e.consume(b),b===92?f:d}function f(b){return b===91||b===92||b===93?(e.consume(b),s++,d):d(b)}function p(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),i.includes(a)||i.push(a),cr(e,m,"gfmFootnoteDefinitionWhitespace")):n(b)}function m(b){return t(b)}}function opt(e,t,n){return e.check(Y1,t,e.attempt(tpt,t,n))}function lpt(e){e.exit("gfmFootnoteDefinition")}function upt(e,t,n){const r=this;return cr(e,i,"gfmFootnoteDefinitionIndent",5);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(a):n(a)}}function cpt(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,o){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let u=l;for(;u--;)if(s[u][0]==="exit"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[u][1].end.offset-s[u][1].start.offset){s[l][1].type="strikethroughSequence",s[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},s[u][1].start),end:Object.assign({},s[l][1].end)},f={type:"strikethroughText",start:Object.assign({},s[u][1].end),end:Object.assign({},s[l][1].start)},p=[["enter",d,o],["enter",s[u][1],o],["exit",s[u][1],o],["enter",f,o]],m=o.parser.constructs.insideSpan.null;m&&ru(p,p.length,0,bD(m,s.slice(u+1,l),o)),ru(p,p.length,0,[["exit",f,o],["enter",s[l][1],o],["exit",s[l][1],o],["exit",d,o]]),ru(s,u-1,l-u+3,p),l=u+p.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function a(s,o,l){const u=this.previous,d=this.events;let f=0;return p;function p(b){return u===126&&d[d.length-1][1].type!=="characterEscape"?l(b):(s.enter("strikethroughSequenceTemporary"),m(b))}function m(b){const y=k0(u);if(b===126)return f>1?l(b):(s.consume(b),f++,m);if(f<2&&!n)return l(b);const v=s.exit("strikethroughSequenceTemporary"),_=k0(b);return v._open=!_||_===2&&!!y,v._close=!y||y===2&&!!_,o(b)}}}class dpt{constructor(){this.map=[]}add(t,n,r){fpt(this,t,n,r)}consume(t){if(this.map.sort(function(a,s){return a[0]-s[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const a of i)t.push(a);i=r.pop()}this.map.length=0}}function fpt(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function hpt(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function ppt(){return{flow:{null:{name:"table",tokenize:mpt,resolveAll:gpt}}}}function mpt(e,t,n){const r=this;let i=0,a=0,s;return o;function o(I){let P=r.events.length-1;for(;P>-1;){const j=r.events[P][1].type;if(j==="lineEnding"||j==="linePrefix")P--;else break}const L=P>-1?r.events[P][1].type:null,B=L==="tableHead"||L==="tableRow"?S:l;return B===S&&r.parser.lazy[r.now().line]?n(I):B(I)}function l(I){return e.enter("tableHead"),e.enter("tableRow"),u(I)}function u(I){return I===124||(s=!0,a+=1),d(I)}function d(I){return I===null?n(I):mn(I)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),m):n(I):Vn(I)?cr(e,d,"whitespace")(I):(a+=1,s&&(s=!1,i+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),s=!0,d):(e.enter("data"),f(I)))}function f(I){return I===null||I===124||_r(I)?(e.exit("data"),d(I)):(e.consume(I),I===92?p:f)}function p(I){return I===92||I===124?(e.consume(I),f):f(I)}function m(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),s=!1,Vn(I)?cr(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):b(I))}function b(I){return I===45||I===58?v(I):I===124?(s=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),y):k(I)}function y(I){return Vn(I)?cr(e,v,"whitespace")(I):v(I)}function v(I){return I===58?(a+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),_):I===45?(a+=1,_(I)):I===null||mn(I)?T(I):k(I)}function _(I){return I===45?(e.enter("tableDelimiterFiller"),E(I)):k(I)}function E(I){return I===45?(e.consume(I),E):I===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(I))}function C(I){return Vn(I)?cr(e,T,"whitespace")(I):T(I)}function T(I){return I===124?b(I):I===null||mn(I)?!s||i!==a?k(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):k(I)}function k(I){return n(I)}function S(I){return e.enter("tableRow"),N(I)}function N(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),N):I===null||mn(I)?(e.exit("tableRow"),t(I)):Vn(I)?cr(e,N,"whitespace")(I):(e.enter("data"),R(I))}function R(I){return I===null||I===124||_r(I)?(e.exit("data"),N(I)):(e.consume(I),I===92?D:R)}function D(I){return I===92||I===124?(e.consume(I),R):R(I)}}function gpt(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],s=[0,0,0,0],o=!1,l=0,u,d,f;const p=new dpt;for(;++n<e.length;){const m=e[n],b=m[1];m[0]==="enter"?b.type==="tableHead"?(o=!1,l!==0&&(pse(p,t,l,u,d),d=void 0,l=0),u={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},p.add(n,0,[["enter",u,t]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(r=!0,f=void 0,a=[0,0,0,0],s=[0,n+1,0,0],o&&(o=!1,d={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},p.add(n,0,[["enter",d,t]])),i=b.type==="tableDelimiterRow"?2:d?3:1):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(a[1]!==0&&(s[0]=s[1],f=cT(p,t,a,i,void 0,f),a=[0,0,0,0]),s[2]=n)):b.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(s[0]=s[1],f=cT(p,t,a,i,void 0,f)),a=s,s=[a[1],n,0,0])):b.type==="tableHead"?(o=!0,l=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(l=n,a[1]!==0?(s[0]=s[1],f=cT(p,t,a,i,n,f)):s[1]!==0&&(f=cT(p,t,s,i,n,f)),i=0):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&pse(p,t,l,u,d),p.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=hpt(t.events,n))}return e}function cT(e,t,n,r,i,a){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(a.end=Object.assign({},Sv(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));const l=Sv(t.events,n[1]);if(a={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",a,t]]),n[2]!==0){const u=Sv(t.events,n[2]),d=Sv(t.events,n[3]),f={type:o,start:Object.assign({},u),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const p=t.events[n[2]],m=t.events[n[3]];if(p[1].end=Object.assign({},m[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const b=n[2]+1,y=n[3]-n[2]-1;e.add(b,y,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(a.end=Object.assign({},Sv(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function pse(e,t,n,r,i){const a=[],s=Sv(t.events,n);i&&(i.end=Object.assign({},s),a.push(["exit",i,t])),r.end=Object.assign({},s),a.push(["exit",r,t]),e.add(n+1,0,a)}function Sv(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const bpt={name:"tasklistCheck",tokenize:vpt};function ypt(){return{text:{91:bpt}}}function vpt(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),a)}function a(l){return _r(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return mn(l)?t(l):Vn(l)?e.check({tokenize:xpt},t,n)(l):n(l)}}function xpt(e,t,n){return cr(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function _pt(e){return pY([qht(),npt(),cpt(e),ppt(),ypt()])}const Spt={};function Ept(e){const t=this,n=e||Spt,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(_pt(n)),a.push(zht()),s.push(Hht(n))}const wpt=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i,Cpt=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)(\/.*)?\]/i,kpt=({legacyTitle:e=!1,tagName:t="div"}={})=>n=>{Gs(n,"blockquote",(r,i,a)=>{let s="",o="",l=!0,u=r.children.map(d=>{if(l&&d.type==="paragraph"){const f=d.children[0],p=f.type==="text"?f.value:"",m=e?Cpt:wpt,b=p.match(m);if(b&&(l=!1,s=b[1].toLocaleLowerCase(),o=e&&b[2]||s.toLocaleUpperCase(),p.includes(`
|
|
81
81
|
`)&&(d.children[0]={type:"text",value:p.replace(m,"").replace(/^\n+/,"")}),!p.includes(`
|
|
82
|
-
`))){const y=[];d.children.forEach((v,_)=>{_!=0&&(_==1&&v.type==="break"||y.push(v))}),d.children=[...y]}}return d});s&&(r.data={hName:t,hProperties:{class:`markdown-alert markdown-alert-${s}`,dir:"auto"}},u.unshift({type:"paragraph",children:[Tpt(s),{type:"text",value:o.replace(/^\//,"")}],data:{hProperties:{class:"markdown-alert-title",dir:"auto"}}})),r.children=[...u]})};function Tpt(e){let t=Apt[e]??"";return{type:"emphasis",data:{hName:"svg",hProperties:{class:"octicon",viewBox:"0 0 16 16",width:"16",height:"16",ariaHidden:"true"}},children:[{type:"emphasis",data:{hName:"path",hProperties:{d:t}},children:[]}]}}const Apt={note:"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z",tip:"M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z",important:"M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",warning:"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",caution:"M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"};function Npt(e,t){if(typeof document>"u")return;const n=document.createElement("textarea");n.value=e,n.setAttribute("readonly",""),n.style={position:"absolute",left:"-9999px"},document.body.appendChild(n);const r=document.getSelection().rangeCount>0?document.getSelection().getRangeAt(0):!1;n.select();let i=!1;try{i=!!document.execCommand("copy")}catch{i=!1}document.body.removeChild(n),r&&document.getSelection&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(r)),t&&t(i)}function c2e(e){if(!e)return null;var t=e;return t.dataset.code&&t.classList.contains("copied")?t:t.parentElement?c2e(t.parentElement):null}function Opt(e){var t=n=>{var r=c2e(n.target);r&&(r.classList.add("active"),Npt(r.dataset.code,function(){setTimeout(()=>{r.classList.remove("active")},2e3)}))};x.useEffect(()=>{var n,r;return(n=e.current)==null||n.removeEventListener("click",t,!1),(r=e.current)==null||r.addEventListener("click",t,!1),()=>{var i;(i=e.current)==null||i.removeEventListener("click",t,!1)}},[e])}var Rpt=["prefixCls","className","source","style","disableCopy","skipHtml","onScroll","onMouseOver","pluginsFilter","rehypeRewrite","wrapperElement","warpperElement","urlTransform"],Ipt=e=>e;const Dpt=Z.forwardRef((e,t)=>{var{prefixCls:n="wmde-markdown wmde-markdown-color",className:r,source:i,style:a,disableCopy:s=!1,skipHtml:o=!0,onScroll:l,onMouseOver:u,pluginsFilter:d,wrapperElement:f={},warpperElement:p={},urlTransform:m}=e,b=FE(e,Rpt),y=Z.useRef(null);x.useImperativeHandle(t,()=>ur({},e,{mdp:y}),[y,e]);var v=(n||"")+" "+(r||"");Opt(y);var _=[...b.rehypePlugins||[]],E={allowElement:(k,S,N)=>b.allowElement?b.allowElement(k,S,N):/^[A-Za-z0-9]+$/.test(k.tagName)};o||_.push(bCe);var C=[kpt,...b.remarkPlugins||[],Ept],T=ur({},p,f);return c.jsx("div",ur({ref:y,onScroll:l,onMouseOver:u},T,{className:v,style:a,children:c.jsx(hft,ur({},E,b,{skipHtml:!o,urlTransform:m||Ipt,rehypePlugins:d?d("rehype",_):_,remarkPlugins:d?d("remark",C):C,children:i||""}))}))});var Ppt=function(t){return n=>{Gs(n,r=>{r.type==="element"&&r.tagName==="code"&&r.data&&r.data.meta&&(r.properties=ur({},r.properties,{"data-meta":String(r.data.meta)}))})}},Lpt=function(t){return n=>{Gs(n,r=>{if(r.type==="element"&&r.tagName==="code"&&r.properties&&r.properties.dataMeta){r.data||(r.data={});var i=r.properties.dataMeta;typeof i=="string"&&(r.data.meta=i),delete r.properties.dataMeta}})}};const Mpt=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u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0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6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[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g,jpt=Object.hasOwnProperty;class Fpt{constructor(){this.occurrences,this.reset()}slug(t,n){const r=this;let i=Bpt(t,n===!0);const a=i;for(;jpt.call(r.occurrences,i);)r.occurrences[a]++,i=a+"-"+r.occurrences[a];return r.occurrences[i]=0,i}reset(){this.occurrences=Object.create(null)}}function Bpt(e,t){return typeof e!="string"?"":(t||(e=e.toLowerCase()),e.replace(Mpt,"").replace(/ /g,"-"))}function d2e(e){const t=e.type==="element"?e.tagName.toLowerCase():"",n=t.length===2&&t.charCodeAt(0)===104?t.charCodeAt(1):0;return n>48&&n<55?n-48:void 0}const $pt={},mse=new Fpt;function Upt(e){const n=(e||$pt).prefix||"";return function(r){mse.reset(),Gs(r,"element",function(i){d2e(i)&&!i.properties.id&&(i.properties.id=n+mse.slug(Nv(i)))})}}const f2e=(function(e){if(e==null)return Vpt;if(typeof e=="string")return Hpt(e);if(typeof e=="object")return zpt(e);if(typeof e=="function")return _Y(e);throw new Error("Expected function, string, or array as `test`")});function zpt(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=f2e(e[n]);return _Y(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function Hpt(e){return _Y(t);function t(n){return n.tagName===e}}function _Y(e){return t;function t(n,r,i){return!!(Wpt(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Vpt(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function Wpt(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const gse={type:"element",tagName:"span",properties:{className:["icon","icon-link"]},children:[]},qpt={};function Gpt(e){const t=e||qpt;let n=t.properties;const r=t.headingProperties,i=t.behavior||"prepend",a=t.content,s=t.group,o=f2e(t.test);let l;return i==="after"||i==="before"?l=d:i==="wrap"?l=f:(l=u,n||(n={ariaHidden:"true",tabIndex:-1})),function(p){Gs(p,"element",function(m,b,y){if(d2e(m)&&m.properties.id&&o(m,b,y))return Object.assign(m.properties,dT(r,m)),l(m,b,y)})};function u(p){const m=bse(a||gse,p);return p.children[i==="prepend"?"unshift":"push"](aM(p,dT(n,p),m)),[DS]}function d(p,m,b){if(typeof m!="number"||!b)return;const y=bse(a||gse,p),v=aM(p,dT(n,p),y);let _=i==="before"?[v,p]:[p,v];if(s){const E=h2e(s,p);E&&!Array.isArray(E)&&E.type==="element"&&(E.children=_,_=[E])}return b.children.splice(m,1,..._),[DS,m+_.length]}function f(p){let m=p.children,b=[];return typeof a=="function"?(m=[],b=a(p)):a&&(b=SY(a)),p.children=[aM(p,dT(n,p),Array.isArray(b)?[...m,...b]:[...m,b])],[DS]}}function SY(e){return Db(e)}function aM(e,t,n){return{type:"element",tagName:"a",properties:{...t,href:"#"+e.properties.id},children:n}}function bse(e,t){const n=h2e(e,t);return Array.isArray(n)?n:[n]}function h2e(e,t){return typeof e=="function"?e(t):SY(e)}function dT(e,t){return typeof e=="function"?e(t):e?SY(e):{}}const Kpt=(e={})=>{const{openDelimiter:t="rehype:ignore:start",closeDelimiter:n="rehype:ignore:end"}=e;return r=>{Gs(r,(i,a,s)=>{if(i.type==="element"||i.type==="root"){let o=!1;i.children=i.children.filter(l=>{if(l.type==="raw"||l.type==="comment"){let u=(l.value||"").trim();if(u=u.replace(/^<!--(.*?)-->/,"$1"),u===t)return o=!0,!1;if(u===n)return o=!1,!1}return!o})}})}};var Ypt={type:"element",tagName:"svg",properties:{className:"octicon octicon-link",viewBox:"0 0 16 16",version:"1.1",width:"16",height:"16",ariaHidden:"true"},children:[{type:"element",tagName:"path",children:[],properties:{fillRule:"evenodd",d:"M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"}}]};function Xpt(e){return e===void 0&&(e=""),{type:"element",tagName:"div",properties:{class:"copied","data-code":e},children:[{type:"element",tagName:"svg",properties:{className:"octicon-copy",ariaHidden:"true",viewBox:"0 0 16 16",fill:"currentColor",height:12,width:12},children:[{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"},children:[]},{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"},children:[]}]},{type:"element",tagName:"svg",properties:{className:"octicon-check",ariaHidden:"true",viewBox:"0 0 16 16",fill:"currentColor",height:12,width:12},children:[{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"},children:[]}]}]}}var Zpt=(e,t)=>(n,r,i)=>{if(n.type==="element"&&i&&i.type==="root"&&/h(1|2|3|4|5|6)/.test(n.tagName)){var a=n.children&&n.children[0];a&&a.properties&&a.properties.ariaHidden==="true"&&(a.properties=ur({class:"anchor"},a.properties),a.children=[Ypt])}if(n.type==="element"&&n.tagName==="pre"&&!e){var s=Twe(n.children);n.children.push(Xpt(s))}t&&t(n,r===null?void 0:r,i===null?void 0:i)},Qpt=[Upt,Gpt,Kpt];const gh=Z.forwardRef((e,t)=>{var n,r=[Ppt,bCe,Lpt,...Qpt,[hat,{rewrite:Zpt((n=e.disableCopy)!=null?n:!1,e.rehypeRewrite)}],[gat,{properties:"attr"}],...e.rehypePlugins||[],[swe,{ignoreMissing:!0}]];return c.jsx(Dpt,ur({},e,{rehypePlugins:r,ref:t}))});function Jpt({role:e,content:t,isStreaming:n,onClick:r}){const i=e==="user",{resolvedTheme:a}=Sl(),s=a==="dark",o=!i&&t&&r,l=x.useMemo(()=>({a:({href:u,children:d,...f})=>c.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",...f,children:d})}),[]);return c.jsxs("div",{className:`flex gap-3 py-3 animate-in fade-in-0 duration-200 ${i?"flex-row-reverse slide-in-from-right-2":"flex-row slide-in-from-left-2"}`,children:[c.jsx("div",{className:`w-8 h-8 flex-shrink-0 rounded-full flex items-center justify-center ${i?"bg-muted border border-border":"bg-gradient-to-br from-accent/30 to-accent/20 border border-accent/40"}`,style:i?void 0:{boxShadow:"0 0 10px color-mix(in oklch, var(--accent) 30%, transparent), 0 0 20px color-mix(in oklch, var(--accent) 15%, transparent)"},children:i?c.jsx(Hve,{className:"w-4 h-4 text-foreground"}):c.jsx(_m,{className:"w-4 h-4 text-accent"})}),c.jsx("div",{onClick:o?r:void 0,className:`flex-1 min-w-0 max-w-[85%] rounded-2xl px-4 py-3 text-sm overflow-hidden text-foreground ${i?"bg-muted/50 border border-border/50 rounded-tr-sm":"bg-card/50 border border-border/50 rounded-tl-sm"} ${o?"cursor-pointer hover:ring-2 hover:ring-offset-1 transition-all hover:ring-accent/40 hover:ring-offset-background":""}`,title:o?"Click to expand":void 0,children:i?c.jsx("p",{className:"whitespace-pre-wrap leading-relaxed",children:t}):t?c.jsx("div",{"data-color-mode":s?"dark":"light",children:c.jsx(gh,{source:t,style:{backgroundColor:"transparent",fontSize:"13px",lineHeight:"1.6",color:"var(--foreground)",fontFamily:"var(--font-sans)"},components:l,className:"prose-sm max-w-none [&_table]:block [&_table]:overflow-x-auto [&_table]:max-w-full [&_pre]:overflow-x-auto [&_pre]:bg-muted/50 [&_pre]:border [&_pre]:border-border/50 [&_pre]:text-xs [&_code]:text-xs [&_code]:text-accent [&_a]:text-accent [&_a:hover]:text-accent/80 [&_strong]:text-foreground [&_h1]:text-foreground [&_h2]:text-foreground [&_h3]:text-foreground [&_h4]:text-foreground [&_li]:text-foreground [&_table]:border-border [&_th]:bg-muted [&_th]:border-border [&_td]:border-border"})}):n?c.jsxs("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[c.jsx("span",{className:"animate-pulse",children:"Thinking"}),c.jsxs("span",{className:"inline-flex gap-0.5",children:[c.jsx("span",{className:"w-1 h-1 rounded-full animate-bounce bg-accent",style:{animationDelay:"0ms"}}),c.jsx("span",{className:"w-1 h-1 rounded-full animate-bounce bg-accent",style:{animationDelay:"150ms"}}),c.jsx("span",{className:"w-1 h-1 rounded-full animate-bounce bg-accent",style:{animationDelay:"300ms"}})]})]}):null})]})}function emt({onSend:e,isLoading:t,placeholder:n}){const{t:r}=Mt("assistant"),i=n??r("input.placeholder"),[a,s]=x.useState(""),o=x.useRef(null),l=x.useCallback(()=>{const f=o.current;f&&(f.style.height="auto",f.style.height=`${Math.min(f.scrollHeight,150)}px`)},[]);x.useEffect(()=>{l()},[a,l]);const u=x.useCallback(()=>{const f=a.trim();f&&!t&&(e(f),s(""),o.current&&(o.current.style.height="auto"))},[a,t,e]),d=x.useCallback(f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),u())},[u]);return c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:"relative overflow-hidden",children:c.jsx("textarea",{ref:o,value:a,onChange:f=>s(f.target.value),onKeyDown:d,rows:3,disabled:t,className:"w-full px-6 py-4 bg-transparent border-none outline-none resize-none text-base font-sans font-normal leading-relaxed min-h-[100px] disabled:opacity-50 text-foreground placeholder-muted-foreground caret-current",placeholder:i,style:{scrollbarWidth:"none"}})}),c.jsx("div",{className:"px-4 pb-4",children:c.jsx("div",{className:"flex items-center justify-end",children:c.jsxs("button",{onClick:u,disabled:!a.trim()||t,className:"group relative p-3 border-none rounded-xl cursor-pointer transition-all duration-300 shadow-lg hover:scale-105 hover:shadow-xl active:scale-95 transform disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:scale-100 disabled:hover:shadow-lg bg-accent text-accent-foreground hover:bg-accent/90",style:{boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 0 0 0 color-mix(in oklch, var(--accent) 30%, transparent)"},children:[t?c.jsx(Bve,{className:"w-5 h-5 animate-spin"}):c.jsx(Uve,{className:"w-5 h-5 transition-all duration-300 group-hover:-translate-y-0.5 group-hover:translate-x-0.5 group-hover:rotate-12"}),c.jsx("div",{className:"absolute inset-0 rounded-xl opacity-0 group-hover:opacity-50 transition-opacity duration-300 blur-lg transform scale-110 bg-accent"}),c.jsx("div",{className:"absolute inset-0 rounded-xl overflow-hidden",children:c.jsx("div",{className:"absolute inset-0 bg-white/20 transform scale-0 group-active:scale-100 transition-transform duration-200 rounded-xl"})})]})})})]})}function tmt(e){const t=e.replace(/\/$/,"")||"/";return t==="/"||t==="/tasks"?"tasks":t.startsWith("/tasks/")&&t.split("/").length===3?"task":t==="/projects"?"projects":t.startsWith("/projects/")&&t.split("/").length===3?"project":t==="/repositories"?"repositories":t.startsWith("/repositories/")&&t.split("/").length===3?"repository":t==="/monitoring"?"monitoring":t==="/terminals"?"terminals":t==="/apps"?"apps":t.startsWith("/apps/")&&t.split("/").length===3&&t.split("/")[2]!=="new"?"app":t==="/jobs"?"jobs":t.startsWith("/jobs/")&&t.split("/").length===3&&t.split("/")[2]!=="new"?"job":t==="/settings"?"settings":"unknown"}function O_(e,t){const n=e.replace(/\/$/,"");if(!n.startsWith(t))return;const r=n.slice(t.length).split("/")[0];if(!(!r||r==="new"))return r}function nmt(){const e=Sa({select:t=>t.location});return x.useMemo(()=>{const{pathname:t,search:n}=e,r=tmt(t),i={pageType:r,path:t};switch(r){case"task":i.taskId=O_(t,"/tasks/");break;case"project":i.projectId=O_(t,"/projects/");break;case"repository":i.repositoryId=O_(t,"/repositories/");break;case"app":i.appId=O_(t,"/apps/");break;case"job":i.jobId=O_(t,"/jobs/");break}const a=n;if(r==="tasks"){const s={};typeof a.project=="string"&&(s.project=a.project),typeof a.tags=="string"&&(s.tags=a.tags.split(",").filter(Boolean)),typeof a.view=="string"&&(s.view=a.view),Object.keys(s).length>0&&(i.filters=s)}return r==="monitoring"&&typeof a.tab=="string"&&(i.activeTab=a.tab),i},[e])}const rmt=Am("h-5 gap-1 rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-2.5! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-colors overflow-hidden group/badge",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground bg-input/20 dark:bg-input/30",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function Xr({className:e,variant:t="default",render:n,...r}){return Vze({defaultTagName:"span",props:Yc({className:je(rmt({className:e,variant:t}))},r),render:n,state:{slot:"badge",variant:t}})}function p2e({delay:e=0,...t}){return c.jsx(Hze,{"data-slot":"tooltip-provider",delay:e,...t})}function rh({...e}){return c.jsx(p2e,{children:c.jsx(Ize,{"data-slot":"tooltip",...e})})}function ih({...e}){return c.jsx(Mze,{"data-slot":"tooltip-trigger",...e})}function ah({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:i=0,children:a,...s}){return c.jsx(Fze,{children:c.jsx(Bze,{align:r,alignOffset:i,side:t,sideOffset:n,className:"isolate z-50",children:c.jsxs(Uze,{"data-slot":"tooltip-content",className:je("data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-md px-3 py-1.5 text-xs **:data-[slot=kbd]:rounded-md bg-foreground text-background z-50 w-fit max-w-xs origin-(--transform-origin)",e),...s,children:[a,c.jsx(zze,{className:"size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground z-50 data-[side=bottom]:top-1 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const imt=ty(function(){const{t}=Mt("assistant"),{isOpen:n,isStreaming:r,messages:i,hasMessages:a,error:s,provider:o,model:l,opencodeModel:u,toggle:d,close:f,sendMessage:p,clearMessages:m,setProvider:b,setModel:y,setOpencodeModel:v}=REe(),_=nmt(),E=gn(),{resolvedTheme:C}=Sl(),T=C==="dark",k=x.useRef(null),S=x.useRef(null),N=x.useRef(null),[R,D]=x.useState(!1),[I,P]=x.useState(null),[L,B]=x.useState(""),j=x.useRef(null),$=x.useRef(!1),{providers:F,installed:z}=AI(),{data:q}=O1();x.useEffect(()=>{o==="opencode"&&!u&&q&&v(q)},[o,u,q,v]);const Y=x.useMemo(()=>i.find(ae=>ae.id===I),[i,I]),K=x.useMemo(()=>({a:({href:ae,children:oe,...se})=>c.jsx("a",{href:ae,target:"_blank",rel:"noopener noreferrer",...se,children:oe})}),[]);x.useEffect(()=>{$.current&&!r&&(E.invalidateQueries({queryKey:["tasks"]}),E.invalidateQueries({queryKey:["task-dependencies"]}),E.invalidateQueries({queryKey:["projects"]}),E.invalidateQueries({queryKey:["repositories"]}),E.invalidateQueries({queryKey:["apps"]})),$.current=r},[r,E]);const W=i[i.length-1]?.content;x.useEffect(()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)},[i.length,W]),x.useEffect(()=>{const ae=oe=>{(oe.metaKey||oe.ctrlKey)&&oe.shiftKey&&oe.key.toLowerCase()==="c"&&(oe.preventDefault(),d()),oe.key==="Escape"&&n&&!I&&f()};return window.addEventListener("keydown",ae),()=>window.removeEventListener("keydown",ae)},[d,f,n,I]),x.useEffect(()=>{const ae=oe=>{if(S.current&&!S.current.contains(oe.target)){const se=oe.target;!se.closest(".floating-ai-button")&&!se.closest('[data-slot="dialog-overlay"]')&&!se.closest('[data-slot="dialog-content"]')&&f()}};if(n)return document.addEventListener("mousedown",ae),()=>document.removeEventListener("mousedown",ae)},[n,f]),x.useEffect(()=>{const ae=oe=>{N.current&&!N.current.contains(oe.target)&&(D(!1),B(""))};if(R)return document.addEventListener("mousedown",ae),()=>document.removeEventListener("mousedown",ae)},[R]),x.useEffect(()=>{R&&o==="opencode"&&j.current&&setTimeout(()=>j.current?.focus(),50)},[R,o]);const X=x.useCallback(ae=>{p(ae,_)},[p,_]),U=Rie.find(ae=>ae.id===l),Q=()=>{if(o==="claude")return U?.label||t("models.opus");if(u){const ae=u.split("/");return ae.length>1?ae[1]:u}return t("models.selectModel")},J=x.useMemo(()=>{const ae=Object.entries(F).sort(([se],[ue])=>se.localeCompare(ue));if(!L.trim())return ae;const oe=L.toLowerCase();return ae.map(([se,ue])=>{const fe=ue.filter(ce=>ce.toLowerCase().includes(oe)||se.toLowerCase().includes(oe));return[se,fe]}).filter(([,se])=>se.length>0)},[F,L]),re=z&&J.length>0;return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed bottom-6 right-6 z-50 hidden sm:block",children:c.jsxs("button",{className:`floating-ai-button relative w-16 h-16 rounded-full flex items-center justify-center transition-all duration-500 transform ${n?"rotate-90":"rotate-0"} hover:scale-110`,onClick:d,style:{cursor:"pointer",background:T?"linear-gradient(135deg, var(--destructive) 0%, color-mix(in oklch, var(--destructive) 80%, black) 100%)":"linear-gradient(135deg, var(--accent) 0%, color-mix(in oklch, var(--accent) 80%, black) 100%)",boxShadow:T?"0 0 20px color-mix(in oklch, var(--destructive) 50%, transparent), 0 0 40px color-mix(in oklch, var(--destructive) 30%, transparent)":"0 0 20px color-mix(in oklch, var(--accent) 50%, transparent), 0 0 40px color-mix(in oklch, var(--accent) 30%, transparent)",border:"2px solid rgba(255, 255, 255, 0.2)"},children:[c.jsx("div",{className:"absolute inset-0 rounded-full bg-gradient-to-b from-white/20 to-transparent opacity-30"}),c.jsx("div",{className:"absolute inset-0 rounded-full border-2 border-white/10"}),c.jsx("div",{className:"relative z-10",children:n?c.jsx(aF,{className:"w-7 h-7 text-white"}):c.jsx(_m,{className:"w-8 h-8 text-white"})}),c.jsx("div",{className:`absolute inset-0 rounded-full animate-pulse opacity-30 ${T?"bg-destructive":"bg-accent"}`}),!n&&c.jsx("div",{className:`absolute -inset-1 rounded-full animate-ping opacity-15 ${T?"bg-destructive":"bg-accent"}`})]})}),n&&c.jsx("div",{ref:S,className:"fixed bottom-6 right-6 sm:bottom-24 z-50 w-[420px] max-w-[calc(100vw-48px)] transition-all duration-300 origin-bottom-right",style:{animation:"popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards"},children:c.jsxs("div",{className:"film-grain relative flex flex-col font-sans rounded-3xl shadow-2xl overflow-hidden max-h-[min(600px,calc(100vh-140px))] bg-popover border border-border",style:{background:"var(--gradient-card)"},children:[c.jsxs("div",{className:"flex items-center justify-between px-3 sm:px-6 pt-3 sm:pt-4 pb-2",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 animate-pulse"}),c.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:t("title")}),c.jsxs(rh,{children:[c.jsx(ih,{className:"flex items-center ml-1",children:c.jsx(Xr,{variant:"destructive",className:"text-[0.55rem] h-3.5 px-1 cursor-help leading-none border border-destructive/30",children:t("preview.badge")})}),c.jsx(ah,{side:"bottom",className:"max-w-[200px]",children:t("preview.tooltip")})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[re&&c.jsxs("div",{className:"hidden sm:flex items-center rounded-full p-0.5 bg-muted/60",children:[c.jsx("button",{onClick:()=>b("claude"),className:`px-2 py-1 text-[10px] font-medium rounded-full transition-all ${o==="claude"?"bg-accent/20 text-accent":"text-muted-foreground hover:text-foreground"}`,children:t("providers.claude")}),c.jsx("button",{onClick:()=>b("opencode"),className:`px-2 py-1 text-[10px] font-medium rounded-full transition-all ${o==="opencode"?"bg-accent/20 text-accent":"text-muted-foreground hover:text-foreground"}`,children:t("providers.opencode")})]}),c.jsxs("div",{ref:N,className:"relative",children:[c.jsxs("button",{onClick:()=>{const ae=!R;D(ae),ae||B("")},className:"flex items-center gap-1 px-2 py-1 text-xs font-medium rounded-2xl transition-colors bg-muted/60 text-foreground hover:bg-muted",children:[c.jsx("span",{className:"max-w-[60px] sm:max-w-[80px] truncate",children:Q()}),c.jsx(Lz,{className:`w-3 h-3 transition-transform flex-shrink-0 ${R?"rotate-180":""}`})]}),R&&c.jsxs("div",{className:"absolute top-full right-0 mt-1 w-48 max-h-64 overflow-y-auto rounded-xl shadow-xl backdrop-blur-sm z-10 animate-in fade-in-0 slide-in-from-top-1 duration-150 scrollbar-thin bg-popover/95 border border-border scrollbar-thumb-muted",children:[o==="claude"&&c.jsx(c.Fragment,{children:Rie.map(ae=>c.jsxs("button",{onClick:()=>{y(ae.id),D(!1)},className:`w-full px-3 py-2 text-left transition-colors flex items-center justify-between hover:bg-muted/50 ${l===ae.id?"bg-accent/10 text-accent":"text-foreground"}`,children:[c.jsxs("div",{children:[c.jsx("div",{className:"font-medium text-xs",children:ae.label}),c.jsx("div",{className:"text-[10px] text-muted-foreground",children:ae.description})]}),l===ae.id&&c.jsx(o0,{className:"w-3.5 h-3.5 flex-shrink-0 text-accent"})]},ae.id))}),o==="opencode"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sticky top-0 p-2 bg-popover/95",children:c.jsx("input",{ref:j,type:"text",value:L,onChange:ae=>B(ae.target.value),placeholder:t("models.filterModels"),className:"w-full px-2.5 py-1.5 text-xs rounded-lg outline-none transition-colors bg-muted border border-border text-foreground placeholder:text-muted-foreground focus:border-ring",onKeyDown:ae=>ae.stopPropagation()})}),J.length===0&&L&&c.jsx("div",{className:"px-3 py-4 text-xs text-center text-muted-foreground",children:t("models.noModelsMatch",{filter:L})}),J.map(([ae,oe])=>c.jsxs("div",{children:[c.jsx("div",{className:"px-3 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground bg-muted/50",children:ae}),oe.map(se=>{const ue=`${ae}/${se}`,fe=u===ue;return c.jsxs("button",{onClick:()=>{v(ue),D(!1),B("")},className:`w-full px-3 py-1.5 text-left transition-colors flex items-center justify-between hover:bg-muted/50 ${fe?"bg-accent/10 text-accent":"text-foreground"}`,children:[c.jsx("span",{className:"text-xs truncate",children:se}),fe&&c.jsx(o0,{className:"w-3.5 h-3.5 flex-shrink-0 ml-2 text-accent"})]},ue)})]},ae))]})]})]}),a&&c.jsx("button",{onClick:m,className:"p-1.5 rounded-full transition-colors hover:bg-muted",title:t("header.clearConversation"),children:c.jsx(zve,{className:"w-4 h-4 text-muted-foreground"})}),c.jsx("button",{onClick:f,className:"p-1.5 rounded-full transition-colors hover:bg-muted",children:c.jsx(aF,{className:"w-4 h-4 text-muted-foreground"})})]})]}),i.length>0&&c.jsxs("div",{ref:k,className:"overflow-y-auto px-4 py-2 max-h-[350px] scrollbar-thin scrollbar-track-transparent scrollbar-thumb-muted",children:[i.map(ae=>c.jsx(Jpt,{role:ae.role,content:ae.content,isStreaming:ae.isStreaming,onClick:ae.role==="assistant"?()=>P(ae.id):void 0},ae.id)),s&&c.jsx("div",{className:"mt-2 p-3 rounded-lg bg-red-500/10 border border-red-500/20 text-red-400 text-sm",children:s})]}),i.length===0&&s&&c.jsx("div",{className:"mx-4 my-2 p-3 rounded-lg bg-red-500/10 border border-red-500/20 text-red-400 text-sm",children:s}),c.jsx(emt,{onSend:X,isLoading:r,placeholder:a?" ":void 0}),c.jsxs("div",{className:"hidden sm:flex items-center justify-between px-4 pb-3 pt-1 text-xs gap-4 text-muted-foreground",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(gje,{className:"w-3 h-3"}),c.jsx("span",{children:t("input.shiftEnterHint").split("<kbd>").map((ae,oe)=>{if(oe===0)return ae;const[se,ue]=ae.split("</kbd>");return c.jsxs("span",{children:[c.jsx("kbd",{className:"px-1.5 py-0.5 rounded font-mono text-xs shadow-sm bg-muted border border-border text-muted-foreground",children:se}),ue]},oe)})})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("div",{className:"w-1.5 h-1.5 bg-green-500 rounded-full"}),c.jsx("span",{children:t("header.connected")})]})]}),T&&c.jsx("div",{className:"absolute inset-0 rounded-3xl pointer-events-none",style:{background:"linear-gradient(135deg, color-mix(in oklch, var(--destructive) 3%, transparent), transparent, color-mix(in oklch, var(--accent) 3%, transparent))"}})]})}),c.jsx("style",{children:`
|
|
82
|
+
`))){const y=[];d.children.forEach((v,_)=>{_!=0&&(_==1&&v.type==="break"||y.push(v))}),d.children=[...y]}}return d});s&&(r.data={hName:t,hProperties:{class:`markdown-alert markdown-alert-${s}`,dir:"auto"}},u.unshift({type:"paragraph",children:[Tpt(s),{type:"text",value:o.replace(/^\//,"")}],data:{hProperties:{class:"markdown-alert-title",dir:"auto"}}})),r.children=[...u]})};function Tpt(e){let t=Apt[e]??"";return{type:"emphasis",data:{hName:"svg",hProperties:{class:"octicon",viewBox:"0 0 16 16",width:"16",height:"16",ariaHidden:"true"}},children:[{type:"emphasis",data:{hName:"path",hProperties:{d:t}},children:[]}]}}const Apt={note:"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z",tip:"M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z",important:"M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",warning:"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",caution:"M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"};function Npt(e,t){if(typeof document>"u")return;const n=document.createElement("textarea");n.value=e,n.setAttribute("readonly",""),n.style={position:"absolute",left:"-9999px"},document.body.appendChild(n);const r=document.getSelection().rangeCount>0?document.getSelection().getRangeAt(0):!1;n.select();let i=!1;try{i=!!document.execCommand("copy")}catch{i=!1}document.body.removeChild(n),r&&document.getSelection&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(r)),t&&t(i)}function c2e(e){if(!e)return null;var t=e;return t.dataset.code&&t.classList.contains("copied")?t:t.parentElement?c2e(t.parentElement):null}function Opt(e){var t=n=>{var r=c2e(n.target);r&&(r.classList.add("active"),Npt(r.dataset.code,function(){setTimeout(()=>{r.classList.remove("active")},2e3)}))};x.useEffect(()=>{var n,r;return(n=e.current)==null||n.removeEventListener("click",t,!1),(r=e.current)==null||r.addEventListener("click",t,!1),()=>{var i;(i=e.current)==null||i.removeEventListener("click",t,!1)}},[e])}var Rpt=["prefixCls","className","source","style","disableCopy","skipHtml","onScroll","onMouseOver","pluginsFilter","rehypeRewrite","wrapperElement","warpperElement","urlTransform"],Ipt=e=>e;const Dpt=Z.forwardRef((e,t)=>{var{prefixCls:n="wmde-markdown wmde-markdown-color",className:r,source:i,style:a,disableCopy:s=!1,skipHtml:o=!0,onScroll:l,onMouseOver:u,pluginsFilter:d,wrapperElement:f={},warpperElement:p={},urlTransform:m}=e,b=FE(e,Rpt),y=Z.useRef(null);x.useImperativeHandle(t,()=>ur({},e,{mdp:y}),[y,e]);var v=(n||"")+" "+(r||"");Opt(y);var _=[...b.rehypePlugins||[]],E={allowElement:(k,S,N)=>b.allowElement?b.allowElement(k,S,N):/^[A-Za-z0-9]+$/.test(k.tagName)};o||_.push(bCe);var C=[kpt,...b.remarkPlugins||[],Ept],T=ur({},p,f);return c.jsx("div",ur({ref:y,onScroll:l,onMouseOver:u},T,{className:v,style:a,children:c.jsx(hft,ur({},E,b,{skipHtml:!o,urlTransform:m||Ipt,rehypePlugins:d?d("rehype",_):_,remarkPlugins:d?d("remark",C):C,children:i||""}))}))});var Ppt=function(t){return n=>{Gs(n,r=>{r.type==="element"&&r.tagName==="code"&&r.data&&r.data.meta&&(r.properties=ur({},r.properties,{"data-meta":String(r.data.meta)}))})}},Lpt=function(t){return n=>{Gs(n,r=>{if(r.type==="element"&&r.tagName==="code"&&r.properties&&r.properties.dataMeta){r.data||(r.data={});var i=r.properties.dataMeta;typeof i=="string"&&(r.data.meta=i),delete r.properties.dataMeta}})}};const Mpt=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAAD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A8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g,jpt=Object.hasOwnProperty;class Fpt{constructor(){this.occurrences,this.reset()}slug(t,n){const r=this;let i=Bpt(t,n===!0);const a=i;for(;jpt.call(r.occurrences,i);)r.occurrences[a]++,i=a+"-"+r.occurrences[a];return r.occurrences[i]=0,i}reset(){this.occurrences=Object.create(null)}}function Bpt(e,t){return typeof e!="string"?"":(t||(e=e.toLowerCase()),e.replace(Mpt,"").replace(/ /g,"-"))}function d2e(e){const t=e.type==="element"?e.tagName.toLowerCase():"",n=t.length===2&&t.charCodeAt(0)===104?t.charCodeAt(1):0;return n>48&&n<55?n-48:void 0}const $pt={},mse=new Fpt;function Upt(e){const n=(e||$pt).prefix||"";return function(r){mse.reset(),Gs(r,"element",function(i){d2e(i)&&!i.properties.id&&(i.properties.id=n+mse.slug(Nv(i)))})}}const f2e=(function(e){if(e==null)return Vpt;if(typeof e=="string")return Hpt(e);if(typeof e=="object")return zpt(e);if(typeof e=="function")return _Y(e);throw new Error("Expected function, string, or array as `test`")});function zpt(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=f2e(e[n]);return _Y(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function Hpt(e){return _Y(t);function t(n){return n.tagName===e}}function _Y(e){return t;function t(n,r,i){return!!(Wpt(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Vpt(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function Wpt(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const gse={type:"element",tagName:"span",properties:{className:["icon","icon-link"]},children:[]},qpt={};function Gpt(e){const t=e||qpt;let n=t.properties;const r=t.headingProperties,i=t.behavior||"prepend",a=t.content,s=t.group,o=f2e(t.test);let l;return i==="after"||i==="before"?l=d:i==="wrap"?l=f:(l=u,n||(n={ariaHidden:"true",tabIndex:-1})),function(p){Gs(p,"element",function(m,b,y){if(d2e(m)&&m.properties.id&&o(m,b,y))return Object.assign(m.properties,dT(r,m)),l(m,b,y)})};function u(p){const m=bse(a||gse,p);return p.children[i==="prepend"?"unshift":"push"](aM(p,dT(n,p),m)),[DS]}function d(p,m,b){if(typeof m!="number"||!b)return;const y=bse(a||gse,p),v=aM(p,dT(n,p),y);let _=i==="before"?[v,p]:[p,v];if(s){const E=h2e(s,p);E&&!Array.isArray(E)&&E.type==="element"&&(E.children=_,_=[E])}return b.children.splice(m,1,..._),[DS,m+_.length]}function f(p){let m=p.children,b=[];return typeof a=="function"?(m=[],b=a(p)):a&&(b=SY(a)),p.children=[aM(p,dT(n,p),Array.isArray(b)?[...m,...b]:[...m,b])],[DS]}}function SY(e){return Db(e)}function aM(e,t,n){return{type:"element",tagName:"a",properties:{...t,href:"#"+e.properties.id},children:n}}function bse(e,t){const n=h2e(e,t);return Array.isArray(n)?n:[n]}function h2e(e,t){return typeof e=="function"?e(t):SY(e)}function dT(e,t){return typeof e=="function"?e(t):e?SY(e):{}}const Kpt=(e={})=>{const{openDelimiter:t="rehype:ignore:start",closeDelimiter:n="rehype:ignore:end"}=e;return r=>{Gs(r,(i,a,s)=>{if(i.type==="element"||i.type==="root"){let o=!1;i.children=i.children.filter(l=>{if(l.type==="raw"||l.type==="comment"){let u=(l.value||"").trim();if(u=u.replace(/^<!--(.*?)-->/,"$1"),u===t)return o=!0,!1;if(u===n)return o=!1,!1}return!o})}})}};var Ypt={type:"element",tagName:"svg",properties:{className:"octicon octicon-link",viewBox:"0 0 16 16",version:"1.1",width:"16",height:"16",ariaHidden:"true"},children:[{type:"element",tagName:"path",children:[],properties:{fillRule:"evenodd",d:"M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"}}]};function Xpt(e){return e===void 0&&(e=""),{type:"element",tagName:"div",properties:{class:"copied","data-code":e},children:[{type:"element",tagName:"svg",properties:{className:"octicon-copy",ariaHidden:"true",viewBox:"0 0 16 16",fill:"currentColor",height:12,width:12},children:[{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"},children:[]},{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"},children:[]}]},{type:"element",tagName:"svg",properties:{className:"octicon-check",ariaHidden:"true",viewBox:"0 0 16 16",fill:"currentColor",height:12,width:12},children:[{type:"element",tagName:"path",properties:{fillRule:"evenodd",d:"M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"},children:[]}]}]}}var Zpt=(e,t)=>(n,r,i)=>{if(n.type==="element"&&i&&i.type==="root"&&/h(1|2|3|4|5|6)/.test(n.tagName)){var a=n.children&&n.children[0];a&&a.properties&&a.properties.ariaHidden==="true"&&(a.properties=ur({class:"anchor"},a.properties),a.children=[Ypt])}if(n.type==="element"&&n.tagName==="pre"&&!e){var s=Twe(n.children);n.children.push(Xpt(s))}t&&t(n,r===null?void 0:r,i===null?void 0:i)},Qpt=[Upt,Gpt,Kpt];const gh=Z.forwardRef((e,t)=>{var n,r=[Ppt,bCe,Lpt,...Qpt,[hat,{rewrite:Zpt((n=e.disableCopy)!=null?n:!1,e.rehypeRewrite)}],[gat,{properties:"attr"}],...e.rehypePlugins||[],[swe,{ignoreMissing:!0}]];return c.jsx(Dpt,ur({},e,{rehypePlugins:r,ref:t}))});function Jpt({role:e,content:t,isStreaming:n,onClick:r}){const i=e==="user",{resolvedTheme:a}=Sl(),s=a==="dark",o=!i&&t&&r,l=x.useMemo(()=>({a:({href:u,children:d,...f})=>c.jsx("a",{href:u,target:"_blank",rel:"noopener noreferrer",...f,children:d})}),[]);return c.jsxs("div",{className:`flex gap-3 py-3 animate-in fade-in-0 duration-200 ${i?"flex-row-reverse slide-in-from-right-2":"flex-row slide-in-from-left-2"}`,children:[c.jsx("div",{className:`w-8 h-8 flex-shrink-0 rounded-full flex items-center justify-center ${i?"bg-muted border border-border":"bg-gradient-to-br from-accent/30 to-accent/20 border border-accent/40"}`,style:i?void 0:{boxShadow:"0 0 10px color-mix(in oklch, var(--accent) 30%, transparent), 0 0 20px color-mix(in oklch, var(--accent) 15%, transparent)"},children:i?c.jsx(Hve,{className:"w-4 h-4 text-foreground"}):c.jsx(_m,{className:"w-4 h-4 text-accent"})}),c.jsx("div",{onClick:o?r:void 0,className:`flex-1 min-w-0 max-w-[85%] rounded-lg px-4 py-3 text-sm overflow-hidden text-foreground ${i?"bg-muted/50 border border-border/50 rounded-tr-sm":"bg-card/50 border border-border/50 rounded-tl-sm"} ${o?"cursor-pointer hover:ring-2 hover:ring-offset-1 transition-all hover:ring-accent/40 hover:ring-offset-background":""}`,title:o?"Click to expand":void 0,children:i?c.jsx("p",{className:"whitespace-pre-wrap leading-relaxed",children:t}):t?c.jsx("div",{"data-color-mode":s?"dark":"light",children:c.jsx(gh,{source:t,style:{backgroundColor:"transparent",fontSize:"13px",lineHeight:"1.6",color:"var(--foreground)",fontFamily:"var(--font-sans)"},components:l,className:"prose-sm max-w-none [&_table]:block [&_table]:overflow-x-auto [&_table]:max-w-full [&_pre]:overflow-x-auto [&_pre]:bg-muted/50 [&_pre]:border [&_pre]:border-border/50 [&_pre]:text-xs [&_code]:text-xs [&_code]:text-accent [&_a]:text-accent [&_a:hover]:text-accent/80 [&_strong]:text-foreground [&_h1]:text-foreground [&_h2]:text-foreground [&_h3]:text-foreground [&_h4]:text-foreground [&_li]:text-foreground [&_table]:border-border [&_th]:bg-muted [&_th]:border-border [&_td]:border-border"})}):n?c.jsxs("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[c.jsx("span",{className:"animate-pulse",children:"Thinking"}),c.jsxs("span",{className:"inline-flex gap-0.5",children:[c.jsx("span",{className:"w-1 h-1 rounded-full animate-bounce bg-accent",style:{animationDelay:"0ms"}}),c.jsx("span",{className:"w-1 h-1 rounded-full animate-bounce bg-accent",style:{animationDelay:"150ms"}}),c.jsx("span",{className:"w-1 h-1 rounded-full animate-bounce bg-accent",style:{animationDelay:"300ms"}})]})]}):null})]})}function emt({onSend:e,isLoading:t,placeholder:n}){const{t:r}=Mt("assistant"),i=n??r("input.placeholder"),[a,s]=x.useState(""),o=x.useRef(null),l=x.useCallback(()=>{const f=o.current;f&&(f.style.height="auto",f.style.height=`${Math.min(f.scrollHeight,150)}px`)},[]);x.useEffect(()=>{l()},[a,l]);const u=x.useCallback(()=>{const f=a.trim();f&&!t&&(e(f),s(""),o.current&&(o.current.style.height="auto"))},[a,t,e]),d=x.useCallback(f=>{f.key==="Enter"&&!f.shiftKey&&(f.preventDefault(),u())},[u]);return c.jsxs("div",{className:"relative",children:[c.jsx("div",{className:"relative overflow-hidden",children:c.jsx("textarea",{ref:o,value:a,onChange:f=>s(f.target.value),onKeyDown:d,rows:3,disabled:t,className:"w-full px-6 py-4 bg-transparent border-none outline-none resize-none text-base font-sans font-normal leading-relaxed min-h-[100px] disabled:opacity-50 text-foreground placeholder-muted-foreground caret-current",placeholder:i,style:{scrollbarWidth:"none"}})}),c.jsx("div",{className:"px-4 pb-4",children:c.jsx("div",{className:"flex items-center justify-end",children:c.jsxs("button",{onClick:u,disabled:!a.trim()||t,className:"group relative p-3 border-none rounded-lg cursor-pointer transition-all duration-300 shadow-lg hover:scale-105 hover:shadow-xl active:scale-95 transform disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:scale-100 disabled:hover:shadow-lg bg-accent text-accent-foreground hover:bg-accent/90",style:{boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 0 0 0 color-mix(in oklch, var(--accent) 30%, transparent)"},children:[t?c.jsx(Bve,{className:"w-5 h-5 animate-spin"}):c.jsx(Uve,{className:"w-5 h-5 transition-all duration-300 group-hover:-translate-y-0.5 group-hover:translate-x-0.5 group-hover:rotate-12"}),c.jsx("div",{className:"absolute inset-0 rounded-lg opacity-0 group-hover:opacity-50 transition-opacity duration-300 blur-lg transform scale-110 bg-accent"}),c.jsx("div",{className:"absolute inset-0 rounded-lg overflow-hidden",children:c.jsx("div",{className:"absolute inset-0 bg-white/20 transform scale-0 group-active:scale-100 transition-transform duration-200 rounded-lg"})})]})})})]})}function tmt(e){const t=e.replace(/\/$/,"")||"/";return t==="/"||t==="/tasks"?"tasks":t.startsWith("/tasks/")&&t.split("/").length===3?"task":t==="/projects"?"projects":t.startsWith("/projects/")&&t.split("/").length===3?"project":t==="/repositories"?"repositories":t.startsWith("/repositories/")&&t.split("/").length===3?"repository":t==="/monitoring"?"monitoring":t==="/terminals"?"terminals":t==="/apps"?"apps":t.startsWith("/apps/")&&t.split("/").length===3&&t.split("/")[2]!=="new"?"app":t==="/jobs"?"jobs":t.startsWith("/jobs/")&&t.split("/").length===3&&t.split("/")[2]!=="new"?"job":t==="/settings"?"settings":"unknown"}function O_(e,t){const n=e.replace(/\/$/,"");if(!n.startsWith(t))return;const r=n.slice(t.length).split("/")[0];if(!(!r||r==="new"))return r}function nmt(){const e=Sa({select:t=>t.location});return x.useMemo(()=>{const{pathname:t,search:n}=e,r=tmt(t),i={pageType:r,path:t};switch(r){case"task":i.taskId=O_(t,"/tasks/");break;case"project":i.projectId=O_(t,"/projects/");break;case"repository":i.repositoryId=O_(t,"/repositories/");break;case"app":i.appId=O_(t,"/apps/");break;case"job":i.jobId=O_(t,"/jobs/");break}const a=n;if(r==="tasks"){const s={};typeof a.project=="string"&&(s.project=a.project),typeof a.tags=="string"&&(s.tags=a.tags.split(",").filter(Boolean)),typeof a.view=="string"&&(s.view=a.view),Object.keys(s).length>0&&(i.filters=s)}return r==="monitoring"&&typeof a.tab=="string"&&(i.activeTab=a.tab),i},[e])}const rmt=Am("h-5 gap-1 rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-2.5! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-colors overflow-hidden group/badge",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground bg-input/20 dark:bg-input/30",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function Xr({className:e,variant:t="default",render:n,...r}){return Vze({defaultTagName:"span",props:Yc({className:je(rmt({className:e,variant:t}))},r),render:n,state:{slot:"badge",variant:t}})}function p2e({delay:e=0,...t}){return c.jsx(Hze,{"data-slot":"tooltip-provider",delay:e,...t})}function rh({...e}){return c.jsx(p2e,{children:c.jsx(Ize,{"data-slot":"tooltip",...e})})}function ih({...e}){return c.jsx(Mze,{"data-slot":"tooltip-trigger",...e})}function ah({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:i=0,children:a,...s}){return c.jsx(Fze,{children:c.jsx(Bze,{align:r,alignOffset:i,side:t,sideOffset:n,className:"isolate z-50",children:c.jsxs(Uze,{"data-slot":"tooltip-content",className:je("data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-md px-3 py-1.5 text-xs **:data-[slot=kbd]:rounded-md bg-foreground text-background z-50 w-fit max-w-xs origin-(--transform-origin)",e),...s,children:[a,c.jsx(zze,{className:"size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground z-50 data-[side=bottom]:top-1 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const imt=ty(function(){const{t}=Mt("assistant"),{isOpen:n,isStreaming:r,messages:i,hasMessages:a,error:s,provider:o,model:l,opencodeModel:u,toggle:d,close:f,sendMessage:p,clearMessages:m,setProvider:b,setModel:y,setOpencodeModel:v}=REe(),_=nmt(),E=gn(),{resolvedTheme:C}=Sl(),T=C==="dark",k=x.useRef(null),S=x.useRef(null),N=x.useRef(null),[R,D]=x.useState(!1),[I,P]=x.useState(null),[L,B]=x.useState(""),j=x.useRef(null),$=x.useRef(!1),{providers:F,installed:z}=AI(),{data:q}=O1();x.useEffect(()=>{o==="opencode"&&!u&&q&&v(q)},[o,u,q,v]);const Y=x.useMemo(()=>i.find(ae=>ae.id===I),[i,I]),K=x.useMemo(()=>({a:({href:ae,children:oe,...se})=>c.jsx("a",{href:ae,target:"_blank",rel:"noopener noreferrer",...se,children:oe})}),[]);x.useEffect(()=>{$.current&&!r&&(E.invalidateQueries({queryKey:["tasks"]}),E.invalidateQueries({queryKey:["task-dependencies"]}),E.invalidateQueries({queryKey:["projects"]}),E.invalidateQueries({queryKey:["repositories"]}),E.invalidateQueries({queryKey:["apps"]})),$.current=r},[r,E]);const W=i[i.length-1]?.content;x.useEffect(()=>{k.current&&(k.current.scrollTop=k.current.scrollHeight)},[i.length,W]),x.useEffect(()=>{const ae=oe=>{(oe.metaKey||oe.ctrlKey)&&oe.shiftKey&&oe.key.toLowerCase()==="c"&&(oe.preventDefault(),d()),oe.key==="Escape"&&n&&!I&&f()};return window.addEventListener("keydown",ae),()=>window.removeEventListener("keydown",ae)},[d,f,n,I]),x.useEffect(()=>{const ae=oe=>{if(S.current&&!S.current.contains(oe.target)){const se=oe.target;!se.closest(".floating-ai-button")&&!se.closest('[data-slot="dialog-overlay"]')&&!se.closest('[data-slot="dialog-content"]')&&f()}};if(n)return document.addEventListener("mousedown",ae),()=>document.removeEventListener("mousedown",ae)},[n,f]),x.useEffect(()=>{const ae=oe=>{N.current&&!N.current.contains(oe.target)&&(D(!1),B(""))};if(R)return document.addEventListener("mousedown",ae),()=>document.removeEventListener("mousedown",ae)},[R]),x.useEffect(()=>{R&&o==="opencode"&&j.current&&setTimeout(()=>j.current?.focus(),50)},[R,o]);const X=x.useCallback(ae=>{p(ae,_)},[p,_]),U=Rie.find(ae=>ae.id===l),Q=()=>{if(o==="claude")return U?.label||t("models.opus");if(u){const ae=u.split("/");return ae.length>1?ae[1]:u}return t("models.selectModel")},J=x.useMemo(()=>{const ae=Object.entries(F).sort(([se],[ue])=>se.localeCompare(ue));if(!L.trim())return ae;const oe=L.toLowerCase();return ae.map(([se,ue])=>{const fe=ue.filter(ce=>ce.toLowerCase().includes(oe)||se.toLowerCase().includes(oe));return[se,fe]}).filter(([,se])=>se.length>0)},[F,L]),re=z&&J.length>0;return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed bottom-6 right-6 z-50 hidden sm:block",children:c.jsxs("button",{className:`floating-ai-button relative w-16 h-16 rounded-full flex items-center justify-center transition-all duration-500 transform ${n?"rotate-90":"rotate-0"} hover:scale-110`,onClick:d,style:{cursor:"pointer",background:T?"linear-gradient(135deg, var(--destructive) 0%, color-mix(in oklch, var(--destructive) 80%, black) 100%)":"linear-gradient(135deg, var(--accent) 0%, color-mix(in oklch, var(--accent) 80%, black) 100%)",boxShadow:T?"0 0 20px color-mix(in oklch, var(--destructive) 50%, transparent), 0 0 40px color-mix(in oklch, var(--destructive) 30%, transparent)":"0 0 20px color-mix(in oklch, var(--accent) 50%, transparent), 0 0 40px color-mix(in oklch, var(--accent) 30%, transparent)",border:"2px solid rgba(255, 255, 255, 0.2)"},children:[c.jsx("div",{className:"absolute inset-0 rounded-full bg-gradient-to-b from-white/20 to-transparent opacity-30"}),c.jsx("div",{className:"absolute inset-0 rounded-full border-2 border-white/10"}),c.jsx("div",{className:"relative z-10",children:n?c.jsx(aF,{className:"w-7 h-7 text-white"}):c.jsx(_m,{className:"w-8 h-8 text-white"})}),c.jsx("div",{className:`absolute inset-0 rounded-full animate-pulse opacity-30 ${T?"bg-destructive":"bg-accent"}`}),!n&&c.jsx("div",{className:`absolute -inset-1 rounded-full animate-ping opacity-15 ${T?"bg-destructive":"bg-accent"}`})]})}),n&&c.jsx("div",{ref:S,className:"fixed bottom-6 right-6 sm:bottom-24 z-50 w-[420px] max-w-[calc(100vw-48px)] transition-all duration-300 origin-bottom-right",style:{animation:"popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards"},children:c.jsxs("div",{className:"film-grain relative flex flex-col font-sans rounded-xl shadow-2xl overflow-hidden max-h-[min(600px,calc(100vh-140px))] bg-popover border border-border",style:{background:"var(--gradient-card)"},children:[c.jsxs("div",{className:"flex items-center justify-between px-3 sm:px-6 pt-3 sm:pt-4 pb-2",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 animate-pulse"}),c.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:t("title")}),c.jsxs(rh,{children:[c.jsx(ih,{className:"flex items-center ml-1",children:c.jsx(Xr,{variant:"destructive",className:"text-[0.55rem] h-3.5 px-1 cursor-help leading-none border border-destructive/30",children:t("preview.badge")})}),c.jsx(ah,{side:"bottom",className:"max-w-[200px]",children:t("preview.tooltip")})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[re&&c.jsxs("div",{className:"hidden sm:flex items-center rounded-full p-0.5 bg-muted/60",children:[c.jsx("button",{onClick:()=>b("claude"),className:`px-2 py-1 text-[10px] font-medium rounded-full transition-all ${o==="claude"?"bg-accent/20 text-accent":"text-muted-foreground hover:text-foreground"}`,children:t("providers.claude")}),c.jsx("button",{onClick:()=>b("opencode"),className:`px-2 py-1 text-[10px] font-medium rounded-full transition-all ${o==="opencode"?"bg-accent/20 text-accent":"text-muted-foreground hover:text-foreground"}`,children:t("providers.opencode")})]}),c.jsxs("div",{ref:N,className:"relative",children:[c.jsxs("button",{onClick:()=>{const ae=!R;D(ae),ae||B("")},className:"flex items-center gap-1 px-2 py-1 text-xs font-medium rounded-lg transition-colors bg-muted/60 text-foreground hover:bg-muted",children:[c.jsx("span",{className:"max-w-[60px] sm:max-w-[80px] truncate",children:Q()}),c.jsx(Lz,{className:`w-3 h-3 transition-transform flex-shrink-0 ${R?"rotate-180":""}`})]}),R&&c.jsxs("div",{className:"absolute top-full right-0 mt-1 w-48 max-h-64 overflow-y-auto rounded-lg shadow-xl backdrop-blur-sm z-10 animate-in fade-in-0 slide-in-from-top-1 duration-150 scrollbar-thin bg-popover/95 border border-border scrollbar-thumb-muted",children:[o==="claude"&&c.jsx(c.Fragment,{children:Rie.map(ae=>c.jsxs("button",{onClick:()=>{y(ae.id),D(!1)},className:`w-full px-3 py-2 text-left transition-colors flex items-center justify-between hover:bg-muted/50 ${l===ae.id?"bg-accent/10 text-accent":"text-foreground"}`,children:[c.jsxs("div",{children:[c.jsx("div",{className:"font-medium text-xs",children:ae.label}),c.jsx("div",{className:"text-[10px] text-muted-foreground",children:ae.description})]}),l===ae.id&&c.jsx(o0,{className:"w-3.5 h-3.5 flex-shrink-0 text-accent"})]},ae.id))}),o==="opencode"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"sticky top-0 p-2 bg-popover/95",children:c.jsx("input",{ref:j,type:"text",value:L,onChange:ae=>B(ae.target.value),placeholder:t("models.filterModels"),className:"w-full px-2.5 py-1.5 text-xs rounded-lg outline-none transition-colors bg-muted border border-border text-foreground placeholder:text-muted-foreground focus:border-ring",onKeyDown:ae=>ae.stopPropagation()})}),J.length===0&&L&&c.jsx("div",{className:"px-3 py-4 text-xs text-center text-muted-foreground",children:t("models.noModelsMatch",{filter:L})}),J.map(([ae,oe])=>c.jsxs("div",{children:[c.jsx("div",{className:"px-3 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground bg-muted/50",children:ae}),oe.map(se=>{const ue=`${ae}/${se}`,fe=u===ue;return c.jsxs("button",{onClick:()=>{v(ue),D(!1),B("")},className:`w-full px-3 py-1.5 text-left transition-colors flex items-center justify-between hover:bg-muted/50 ${fe?"bg-accent/10 text-accent":"text-foreground"}`,children:[c.jsx("span",{className:"text-xs truncate",children:se}),fe&&c.jsx(o0,{className:"w-3.5 h-3.5 flex-shrink-0 ml-2 text-accent"})]},ue)})]},ae))]})]})]}),a&&c.jsx("button",{onClick:m,className:"p-1.5 rounded-full transition-colors hover:bg-muted",title:t("header.clearConversation"),children:c.jsx(zve,{className:"w-4 h-4 text-muted-foreground"})}),c.jsx("button",{onClick:f,className:"p-1.5 rounded-full transition-colors hover:bg-muted",children:c.jsx(aF,{className:"w-4 h-4 text-muted-foreground"})})]})]}),i.length>0&&c.jsxs("div",{ref:k,className:"overflow-y-auto px-4 py-2 max-h-[350px] scrollbar-thin scrollbar-track-transparent scrollbar-thumb-muted",children:[i.map(ae=>c.jsx(Jpt,{role:ae.role,content:ae.content,isStreaming:ae.isStreaming,onClick:ae.role==="assistant"?()=>P(ae.id):void 0},ae.id)),s&&c.jsx("div",{className:"mt-2 p-3 rounded-lg bg-red-500/10 border border-red-500/20 text-red-400 text-sm",children:s})]}),i.length===0&&s&&c.jsx("div",{className:"mx-4 my-2 p-3 rounded-lg bg-red-500/10 border border-red-500/20 text-red-400 text-sm",children:s}),c.jsx(emt,{onSend:X,isLoading:r,placeholder:a?" ":void 0}),c.jsxs("div",{className:"hidden sm:flex items-center justify-between px-4 pb-3 pt-1 text-xs gap-4 text-muted-foreground",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(gje,{className:"w-3 h-3"}),c.jsx("span",{children:t("input.shiftEnterHint").split("<kbd>").map((ae,oe)=>{if(oe===0)return ae;const[se,ue]=ae.split("</kbd>");return c.jsxs("span",{children:[c.jsx("kbd",{className:"px-1.5 py-0.5 rounded font-mono text-xs shadow-sm bg-muted border border-border text-muted-foreground",children:se}),ue]},oe)})})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("div",{className:"w-1.5 h-1.5 bg-green-500 rounded-full"}),c.jsx("span",{children:t("header.connected")})]})]}),T&&c.jsx("div",{className:"absolute inset-0 rounded-xl pointer-events-none",style:{background:"linear-gradient(135deg, color-mix(in oklch, var(--destructive) 3%, transparent), transparent, color-mix(in oklch, var(--accent) 3%, transparent))"}})]})}),c.jsx("style",{children:`
|
|
83
83
|
@keyframes popIn {
|
|
84
84
|
0% {
|
|
85
85
|
opacity: 0;
|