@knowsuchagency/fulcrum 2.5.2 → 2.5.4

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
@@ -45641,7 +45641,7 @@ async function runMcpServer(urlOverride, portOverride) {
45641
45641
  const client = new FulcrumClient(urlOverride, portOverride);
45642
45642
  const server = new McpServer({
45643
45643
  name: "fulcrum",
45644
- version: "2.5.2"
45644
+ version: "2.5.4"
45645
45645
  });
45646
45646
  registerTools(server, client);
45647
45647
  const transport = new StdioServerTransport;
@@ -47990,7 +47990,7 @@ var marketplace_default = `{
47990
47990
  "name": "fulcrum",
47991
47991
  "source": "./",
47992
47992
  "description": "Task orchestration for Claude Code",
47993
- "version": "2.5.2",
47993
+ "version": "2.5.4",
47994
47994
  "skills": [
47995
47995
  "./skills/fulcrum"
47996
47996
  ],
@@ -49178,7 +49178,7 @@ function compareVersions(v1, v2) {
49178
49178
  var package_default = {
49179
49179
  name: "@knowsuchagency/fulcrum",
49180
49180
  private: true,
49181
- version: "2.5.2",
49181
+ version: "2.5.4",
49182
49182
  description: "Harness Attention. Orchestrate Agents. Ship.",
49183
49183
  license: "PolyForm-Perimeter-1.0.0",
49184
49184
  type: "module",
@@ -75,7 +75,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
75
75
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:a,tableCell:l,tableRow:o}};function a(m,b,y,v){return u(d(m,y,v),m.align)}function o(m,b,y,v){const _=f(m,y,v),w=u([_]);return w.slice(0,w.indexOf(`
76
76
  `))}function l(m,b,y,v){const _=y.enter("tableCell"),w=y.enter("phrasing"),C=y.containerPhrasing(m,{...v,before:s,after:s});return w(),_(),C}function u(m,b){return Iht(m,{align:b,alignDelimiters:r,padding:n,stringLength:i})}function d(m,b,y){const v=m.children;let _=-1;const w=[],C=b.enter("table");for(;++_<v.length;)w[_]=f(v[_],b,y);return C(),w}function f(m,b,y){const v=m.children;let _=-1;const w=[],C=b.enter("tableRow");for(;++_<v.length;)w[_]=l(v[_],m,b,y);return C(),w}function p(m,b,y){let v=L2e.inlineCode(m,b,y);return y.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function vpt(){return{exit:{taskListCheckValueChecked:Uae,taskListCheckValueUnchecked:Uae,paragraph:_pt}}}function xpt(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Spt}}}function Uae(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function _pt(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 s=-1,a;for(;++s<i.length;){const o=i[s];if(o.type==="paragraph"){a=o;break}}a===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 Spt(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);s&&o.move(a);let l=L2e.listItem(e,t,n,{...r,...o.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(d){return d+a}}function wpt(){return[tht(),Sht(),kht(),fpt(),vpt()]}function Ept(e){return{extensions:[nht(),wht(e),Tht(),ypt(e),xpt()]}}const Cpt={tokenize:Rpt,partial:!0},j2e={tokenize:Ipt,partial:!0},M2e={tokenize:Dpt,partial:!0},F2e={tokenize:Ppt,partial:!0},kpt={tokenize:Lpt,partial:!0},B2e={name:"wwwAutolink",tokenize:Npt,previous:U2e},$2e={name:"protocolAutolink",tokenize:Opt,previous:z2e},Qh={name:"emailAutolink",tokenize:Apt,previous:H2e},Ef={};function Tpt(){return{text:Ef}}let kg=48;for(;kg<123;)Ef[kg]=Qh,kg++,kg===58?kg=65:kg===91&&(kg=97);Ef[43]=Qh;Ef[45]=Qh;Ef[46]=Qh;Ef[95]=Qh;Ef[72]=[Qh,$2e];Ef[104]=[Qh,$2e];Ef[87]=[Qh,B2e];Ef[119]=[Qh,B2e];function Apt(e,t,n){const r=this;let i,s;return a;function a(f){return!XB(f)||!H2e.call(r,r.previous)||QY(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),o(f))}function o(f){return XB(f)?(e.consume(f),o):f===64?(e.consume(f),l):n(f)}function l(f){return f===46?e.check(kpt,d,u)(f):f===45||f===95||wo(f)?(s=!0,e.consume(f),l):d(f)}function u(f){return e.consume(f),i=!0,l}function d(f){return s&&i&&_o(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function Npt(e,t,n){const r=this;return i;function i(a){return a!==87&&a!==119||!U2e.call(r,r.previous)||QY(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Cpt,e.attempt(j2e,e.attempt(M2e,s),n),n)(a))}function s(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function Opt(e,t,n){const r=this;let i="",s=!1;return a;function a(f){return(f===72||f===104)&&z2e.call(r,r.previous)&&!QY(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),o):n(f)}function o(f){if(_o(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),s?u:(s=!0,l)):n(f)}function u(f){return f===null||oO(f)||Ar(f)||Bo(f)||X3(f)?n(f):e.attempt(j2e,e.attempt(M2e,d),n)(f)}function d(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function Rpt(e,t,n){let r=0;return i;function i(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),i):a===46&&r===3?(e.consume(a),s):n(a)}function s(a){return a===null?n(a):t(a)}}function Ipt(e,t,n){let r,i,s;return a;function a(u){return u===46||u===95?e.check(F2e,l,o)(u):u===null||Ar(u)||Bo(u)||u!==45&&X3(u)?l(u):(s=!0,e.consume(u),a)}function o(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),a}function l(u){return i||r||!s?n(u):t(u)}}function Dpt(e,t){let n=0,r=0;return i;function i(a){return a===40?(n++,e.consume(a),i):a===41&&r<n?s(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(F2e,t,s)(a):a===null||Ar(a)||Bo(a)?t(a):(e.consume(a),i)}function s(a){return a===41&&r++,e.consume(a),i}}function Ppt(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),s):o===93?(e.consume(o),i):o===60||o===null||Ar(o)||Bo(o)?t(o):n(o)}function i(o){return o===null||o===40||o===91||Ar(o)||Bo(o)?t(o):r(o)}function s(o){return _o(o)?a(o):n(o)}function a(o){return o===59?(e.consume(o),r):_o(o)?(e.consume(o),a):n(o)}}function Lpt(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return wo(s)?n(s):t(s)}}function U2e(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ar(e)}function z2e(e){return!_o(e)}function H2e(e){return!(e===47||XB(e))}function XB(e){return e===43||e===45||e===46||e===95||wo(e)}function QY(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 jpt={tokenize:Vpt,partial:!0};function Mpt(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Upt,continuation:{tokenize:zpt},exit:Hpt}},text:{91:{name:"gfmFootnoteCall",tokenize:$pt},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Fpt,resolveTo:Bpt}}}}function Fpt(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){a=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(!a||!a._balanced)return n(l);const u=Qc(r.sliceSerialize({start:a.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function Bpt(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 s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function $pt(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,a;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(s>999||f===93&&!a||f===null||f===91||Ar(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 Ar(f)||(a=!0),s++,e.consume(f),f===92?d:u}function d(f){return f===91||f===92||f===93?(e.consume(f),s++,u):u(f)}}function Upt(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,a=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(a>999||b===93&&!o||b===null||b===91||Ar(b))return n(b);if(b===93){e.exit("chunkString");const y=e.exit("gfmFootnoteDefinitionLabelString");return s=Qc(r.sliceSerialize(y)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return Ar(b)||(o=!0),a++,e.consume(b),b===92?f:d}function f(b){return b===91||b===92||b===93?(e.consume(b),a++,d):d(b)}function p(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),i.includes(s)||i.push(s),gr(e,m,"gfmFootnoteDefinitionWhitespace")):n(b)}function m(b){return t(b)}}function zpt(e,t,n){return e.check(a1,t,e.attempt(jpt,t,n))}function Hpt(e){e.exit("gfmFootnoteDefinition")}function Vpt(e,t,n){const r=this;return gr(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(s):n(s)}}function Wpt(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(a,o){let l=-1;for(;++l<a.length;)if(a[l][0]==="enter"&&a[l][1].type==="strikethroughSequenceTemporary"&&a[l][1]._close){let u=l;for(;u--;)if(a[u][0]==="exit"&&a[u][1].type==="strikethroughSequenceTemporary"&&a[u][1]._open&&a[l][1].end.offset-a[l][1].start.offset===a[u][1].end.offset-a[u][1].start.offset){a[l][1].type="strikethroughSequence",a[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},a[u][1].start),end:Object.assign({},a[l][1].end)},f={type:"strikethroughText",start:Object.assign({},a[u][1].end),end:Object.assign({},a[l][1].start)},p=[["enter",d,o],["enter",a[u][1],o],["exit",a[u][1],o],["enter",f,o]],m=o.parser.constructs.insideSpan.null;m&&uu(p,p.length,0,Z3(m,a.slice(u+1,l),o)),uu(p,p.length,0,[["exit",f,o],["enter",a[l][1],o],["exit",a[l][1],o],["exit",d,o]]),uu(a,u-1,l-u+3,p),l=u+p.length-2;break}}for(l=-1;++l<a.length;)a[l][1].type==="strikethroughSequenceTemporary"&&(a[l][1].type="data");return a}function s(a,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):(a.enter("strikethroughSequenceTemporary"),m(b))}function m(b){const y=L0(u);if(b===126)return f>1?l(b):(a.consume(b),f++,m);if(f<2&&!n)return l(b);const v=a.exit("strikethroughSequenceTemporary"),_=L0(b);return v._open=!_||_===2&&!!y,v._close=!y||y===2&&!!_,o(b)}}}class qpt{constructor(){this.map=[]}add(t,n,r){Gpt(this,t,n,r)}consume(t){if(this.map.sort(function(s,a){return s[0]-a[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 s of i)t.push(s);i=r.pop()}this.map.length=0}}function Gpt(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 Kpt(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 s=r.length-1;r[s]=r[s]==="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 Ypt(){return{flow:{null:{name:"table",tokenize:Xpt,resolveAll:Zpt}}}}function Xpt(e,t,n){const r=this;let i=0,s=0,a;return o;function o(D){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,F=L==="tableHead"||L==="tableRow"?S:l;return F===S&&r.parser.lazy[r.now().line]?n(D):F(D)}function l(D){return e.enter("tableHead"),e.enter("tableRow"),u(D)}function u(D){return D===124||(a=!0,s+=1),d(D)}function d(D){return D===null?n(D):yn(D)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),m):n(D):Xn(D)?gr(e,d,"whitespace")(D):(s+=1,a&&(a=!1,i+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),a=!0,d):(e.enter("data"),f(D)))}function f(D){return D===null||D===124||Ar(D)?(e.exit("data"),d(D)):(e.consume(D),D===92?p:f)}function p(D){return D===92||D===124?(e.consume(D),f):f(D)}function m(D){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(D):(e.enter("tableDelimiterRow"),a=!1,Xn(D)?gr(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):b(D))}function b(D){return D===45||D===58?v(D):D===124?(a=!0,e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),y):k(D)}function y(D){return Xn(D)?gr(e,v,"whitespace")(D):v(D)}function v(D){return D===58?(s+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),_):D===45?(s+=1,_(D)):D===null||yn(D)?T(D):k(D)}function _(D){return D===45?(e.enter("tableDelimiterFiller"),w(D)):k(D)}function w(D){return D===45?(e.consume(D),w):D===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(D))}function C(D){return Xn(D)?gr(e,T,"whitespace")(D):T(D)}function T(D){return D===124?b(D):D===null||yn(D)?!a||i!==s?k(D):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(D)):k(D)}function k(D){return n(D)}function S(D){return e.enter("tableRow"),N(D)}function N(D){return D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),N):D===null||yn(D)?(e.exit("tableRow"),t(D)):Xn(D)?gr(e,N,"whitespace")(D):(e.enter("data"),R(D))}function R(D){return D===null||D===124||Ar(D)?(e.exit("data"),N(D)):(e.consume(D),D===92?I:R)}function I(D){return D===92||D===124?(e.consume(D),R):R(D)}}function Zpt(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],a=[0,0,0,0],o=!1,l=0,u,d,f;const p=new qpt;for(;++n<e.length;){const m=e[n],b=m[1];m[0]==="enter"?b.type==="tableHead"?(o=!1,l!==0&&(zae(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,s=[0,0,0,0],a=[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,a[2]===0&&(s[1]!==0&&(a[0]=a[1],f=MT(p,t,s,i,void 0,f),s=[0,0,0,0]),a[2]=n)):b.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(a[0]=a[1],f=MT(p,t,s,i,void 0,f)),s=a,a=[s[1],n,0,0])):b.type==="tableHead"?(o=!0,l=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(l=n,s[1]!==0?(a[0]=a[1],f=MT(p,t,s,i,n,f)):a[1]!==0&&(f=MT(p,t,a,i,n,f)),i=0):i&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(a[3]=n)}for(l!==0&&zae(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=Kpt(t.events,n))}return e}function MT(e,t,n,r,i,s){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",o="tableContent";n[0]!==0&&(s.end=Object.assign({},Rv(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=Rv(t.events,n[1]);if(s={type:a,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const u=Rv(t.events,n[2]),d=Rv(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&&(s.end=Object.assign({},Rv(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function zae(e,t,n,r,i){const s=[],a=Rv(t.events,n);i&&(i.end=Object.assign({},a),s.push(["exit",i,t])),r.end=Object.assign({},a),s.push(["exit",r,t]),e.add(n+1,0,s)}function Rv(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Qpt={name:"tasklistCheck",tokenize:emt};function Jpt(){return{text:{91:Qpt}}}function emt(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"),s)}function s(l){return Ar(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),a):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),a):n(l)}function a(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(l)}function o(l){return yn(l)?t(l):Xn(l)?e.check({tokenize:tmt},t,n)(l):n(l)}}function tmt(e,t,n){return gr(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function nmt(e){return qY([Tpt(),Mpt(),Wpt(e),Ypt(),Jpt()])}const rmt={};function imt(e){const t=this,n=e||rmt,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(nmt(n)),s.push(wpt()),a.push(Ept(n))}const smt=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i,amt=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)(\/.*)?\]/i,omt=({legacyTitle:e=!1,tagName:t="div"}={})=>n=>{no(n,"blockquote",(r,i,s)=>{let a="",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?amt:smt,b=p.match(m);if(b&&(l=!1,a=b[1].toLocaleLowerCase(),o=e&&b[2]||a.toLocaleUpperCase(),p.includes(`
77
77
  `)&&(d.children[0]={type:"text",value:p.replace(m,"").replace(/^\n+/,"")}),!p.includes(`
78
- `))){const y=[];d.children.forEach((v,_)=>{_!=0&&(_==1&&v.type==="break"||y.push(v))}),d.children=[...y]}}return d});a&&(r.data={hName:t,hProperties:{class:`markdown-alert markdown-alert-${a}`,dir:"auto"}},u.unshift({type:"paragraph",children:[lmt(a),{type:"text",value:o.replace(/^\//,"")}],data:{hProperties:{class:"markdown-alert-title",dir:"auto"}}})),r.children=[...u]})};function lmt(e){let t=umt[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 umt={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 cmt(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 V2e(e){if(!e)return null;var t=e;return t.dataset.code&&t.classList.contains("copied")?t:t.parentElement?V2e(t.parentElement):null}function dmt(e){var t=n=>{var r=V2e(n.target);r&&(r.classList.add("active"),cmt(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 fmt=["prefixCls","className","source","style","disableCopy","skipHtml","onScroll","onMouseOver","pluginsFilter","rehypeRewrite","wrapperElement","warpperElement","urlTransform"],hmt=e=>e;const pmt=Z.forwardRef((e,t)=>{var{prefixCls:n="wmde-markdown wmde-markdown-color",className:r,source:i,style:s,disableCopy:a=!1,skipHtml:o=!0,onScroll:l,onMouseOver:u,pluginsFilter:d,wrapperElement:f={},warpperElement:p={},urlTransform:m}=e,b=Qw(e,fmt),y=Z.useRef(null);x.useImperativeHandle(t,()=>mr({},e,{mdp:y}),[y,e]);var v=(n||"")+" "+(r||"");dmt(y);var _=[...b.rehypePlugins||[]],w={allowElement:(k,S,N)=>b.allowElement?b.allowElement(k,S,N):/^[A-Za-z0-9]+$/.test(k.tagName)};o||_.push(ZCe);var C=[omt,...b.remarkPlugins||[],imt],T=mr({},p,f);return c.jsx("div",mr({ref:y,onScroll:l,onMouseOver:u},T,{className:v,style:s,children:c.jsx(Kft,mr({},w,b,{skipHtml:!o,urlTransform:m||hmt,rehypePlugins:d?d("rehype",_):_,remarkPlugins:d?d("remark",C):C,children:i||""}))}))});var mmt=function(t){return n=>{no(n,r=>{r.type==="element"&&r.tagName==="code"&&r.data&&r.data.meta&&(r.properties=mr({},r.properties,{"data-meta":String(r.data.meta)}))})}},gmt=function(t){return n=>{no(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 bmt=/[\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\u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ECE\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\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uF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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,ymt=Object.hasOwnProperty;class vmt{constructor(){this.occurrences,this.reset()}slug(t,n){const r=this;let i=xmt(t,n===!0);const s=i;for(;ymt.call(r.occurrences,i);)r.occurrences[s]++,i=s+"-"+r.occurrences[s];return r.occurrences[i]=0,i}reset(){this.occurrences=Object.create(null)}}function xmt(e,t){return typeof e!="string"?"":(t||(e=e.toLowerCase()),e.replace(bmt,"").replace(/ /g,"-"))}function W2e(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 _mt={},Hae=new vmt;function Smt(e){const n=(e||_mt).prefix||"";return function(r){Hae.reset(),no(r,"element",function(i){W2e(i)&&!i.properties.id&&(i.properties.id=n+Hae.slug(Fv(i)))})}}const q2e=(function(e){if(e==null)return Cmt;if(typeof e=="string")return Emt(e);if(typeof e=="object")return wmt(e);if(typeof e=="function")return JY(e);throw new Error("Expected function, string, or array as `test`")});function wmt(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=q2e(e[n]);return JY(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function Emt(e){return JY(t);function t(n){return n.tagName===e}}function JY(e){return t;function t(n,r,i){return!!(kmt(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Cmt(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function kmt(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const Vae={type:"element",tagName:"span",properties:{className:["icon","icon-link"]},children:[]},Tmt={};function Amt(e){const t=e||Tmt;let n=t.properties;const r=t.headingProperties,i=t.behavior||"prepend",s=t.content,a=t.group,o=q2e(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){no(p,"element",function(m,b,y){if(W2e(m)&&m.properties.id&&o(m,b,y))return Object.assign(m.properties,FT(r,m)),l(m,b,y)})};function u(p){const m=Wae(s||Vae,p);return p.children[i==="prepend"?"unshift":"push"](Bj(p,FT(n,p),m)),[qS]}function d(p,m,b){if(typeof m!="number"||!b)return;const y=Wae(s||Vae,p),v=Bj(p,FT(n,p),y);let _=i==="before"?[v,p]:[p,v];if(a){const w=G2e(a,p);w&&!Array.isArray(w)&&w.type==="element"&&(w.children=_,_=[w])}return b.children.splice(m,1,..._),[qS,m+_.length]}function f(p){let m=p.children,b=[];return typeof s=="function"?(m=[],b=s(p)):s&&(b=eX(s)),p.children=[Bj(p,FT(n,p),Array.isArray(b)?[...m,...b]:[...m,b])],[qS]}}function eX(e){return $b(e)}function Bj(e,t,n){return{type:"element",tagName:"a",properties:{...t,href:"#"+e.properties.id},children:n}}function Wae(e,t){const n=G2e(e,t);return Array.isArray(n)?n:[n]}function G2e(e,t){return typeof e=="function"?e(t):eX(e)}function FT(e,t){return typeof e=="function"?e(t):e?eX(e):{}}const Nmt=(e={})=>{const{openDelimiter:t="rehype:ignore:start",closeDelimiter:n="rehype:ignore:end"}=e;return r=>{no(r,(i,s,a)=>{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 Omt={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 Rmt(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 Imt=(e,t)=>(n,r,i)=>{if(n.type==="element"&&i&&i.type==="root"&&/h(1|2|3|4|5|6)/.test(n.tagName)){var s=n.children&&n.children[0];s&&s.properties&&s.properties.ariaHidden==="true"&&(s.properties=mr({class:"anchor"},s.properties),s.children=[Omt])}if(n.type==="element"&&n.tagName==="pre"&&!e){var a=oCe(n.children);n.children.push(Rmt(a))}t&&t(n,r===null?void 0:r,i===null?void 0:i)},Dmt=[Smt,Amt,Nmt];const xh=Z.forwardRef((e,t)=>{var n,r=[mmt,ZCe,gmt,...Dmt,[Kst,{rewrite:Imt((n=e.disableCopy)!=null?n:!1,e.rehypeRewrite)}],[Zst,{properties:"attr"}],...e.rehypePlugins||[],[$Ee,{ignoreMissing:!0}]];return c.jsx(pmt,mr({},e,{rehypePlugins:r,ref:t}))});function Pmt({role:e,content:t,isStreaming:n,onClick:r}){const i=e==="user",{resolvedTheme:s}=Rl(),a=s==="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(_0e,{className:"w-4 h-4 text-foreground"}):c.jsx(Am,{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":a?"dark":"light",children:c.jsx(xh,{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})]})}const Lmt=10*1024*1024,jmt=["image/png","image/jpeg","image/gif","image/webp"],Mmt=x.forwardRef(function({onSend:t,isLoading:n,placeholder:r,onCancel:i},s){const{t:a}=Mt("assistant"),o=r??a("input.placeholder"),[l,u]=x.useState(""),[d,f]=x.useState([]),p=x.useRef(null),m=x.useRef(null);x.useImperativeHandle(s,()=>({focus:()=>{p.current?.focus()}}));const b=x.useCallback(async k=>{if(!k)return;const S=[];for(const N of Array.from(k)){if(!jmt.includes(N.type)||N.size>Lmt)continue;const R=await new Promise((I,D)=>{const P=new FileReader;P.onload=()=>I(P.result),P.onerror=D,P.readAsDataURL(N)});S.push({id:crypto.randomUUID(),file:N,dataUrl:R,mediaType:N.type})}S.length>0&&f(N=>[...N,...S])},[]),y=x.useCallback(async k=>{const S=k.clipboardData?.items;if(!S)return;const N=[];for(const R of Array.from(S))if(R.type.startsWith("image/")){const I=R.getAsFile();I&&N.push(I)}if(N.length>0){k.preventDefault();const R=new DataTransfer;N.forEach(I=>R.items.add(I)),await b(R.files)}},[b]),v=x.useCallback(k=>{f(S=>S.filter(N=>N.id!==k))},[]),_=x.useCallback(()=>{const k=p.current;k&&(k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,150)}px`)},[]);x.useEffect(()=>{_()},[l,_]);const w=x.useCallback(()=>{const k=l.trim();(k||d.length>0)&&!n&&(t(k,d.length>0?d:void 0),u(""),f([]),p.current&&(p.current.style.height="auto"))},[l,d,n,t]),C=x.useCallback(k=>{k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),w())},[w]),T=l.trim()||d.length>0;return c.jsxs("div",{className:"relative",children:[d.length>0&&c.jsx("div",{className:"px-4 pt-4 flex flex-wrap gap-2",children:d.map(k=>c.jsxs("div",{className:"relative group",children:[c.jsx("img",{src:k.dataUrl,alt:"Attachment",className:"h-16 w-16 object-cover rounded-lg border border-border"}),c.jsx("button",{onClick:()=>v(k.id),className:"absolute -top-1.5 -right-1.5 p-0.5 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity",children:c.jsx(_w,{className:"w-3 h-3"})})]},k.id))}),c.jsx("div",{className:"relative overflow-hidden",children:c.jsx("textarea",{ref:p,value:l,onChange:k=>u(k.target.value),onKeyDown:C,onPaste:y,rows:3,disabled:n,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:o,style:{scrollbarWidth:"none"}})}),c.jsx("input",{ref:m,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",multiple:!0,className:"hidden",onChange:k=>b(k.target.files)}),c.jsx("div",{className:"px-4 pb-4",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("button",{onClick:()=>m.current?.click(),disabled:n,className:Le("p-2 rounded-lg transition-colors","text-muted-foreground hover:text-foreground hover:bg-muted/50","disabled:opacity-50 disabled:cursor-not-allowed"),title:"Attach image",children:c.jsx(g0e,{className:"w-5 h-5"})}),n&&i?c.jsxs("button",{onClick:i,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 bg-destructive text-destructive-foreground hover:bg-destructive/90",style:{boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 0 0 0 color-mix(in oklch, var(--destructive) 30%, transparent)"},title:"Stop generating",children:[c.jsx(v0e,{className:"w-5 h-5 fill-current"}),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-destructive"}),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"})})]}):c.jsxs("button",{onClick:w,disabled:!T||n,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:[n?c.jsx(m0e,{className:"w-5 h-5 animate-spin"}):c.jsx(y0e,{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 Fmt(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 U_(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 Bmt(){const e=Is({select:t=>t.location});return x.useMemo(()=>{const{pathname:t,search:n}=e,r=Fmt(t),i={pageType:r,path:t};switch(r){case"task":i.taskId=U_(t,"/tasks/");break;case"project":i.projectId=U_(t,"/projects/");break;case"repository":i.repositoryId=U_(t,"/repositories/");break;case"app":i.appId=U_(t,"/apps/");break;case"job":i.jobId=U_(t,"/jobs/");break}const s=n;if(r==="tasks"){const a={};typeof s.project=="string"&&(a.project=s.project),typeof s.tags=="string"&&(a.tags=s.tags.split(",").filter(Boolean)),typeof s.view=="string"&&(a.view=s.view),Object.keys(a).length>0&&(i.filters=a)}return r==="monitoring"&&typeof s.tab=="string"&&(i.activeTab=s.tab),i},[e])}const $mt=Lm("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 Hr({className:e,variant:t="default",render:n,...r}){return fHe({defaultTagName:"span",props:td({className:Le($mt({className:e,variant:t}))},r),render:n,state:{slot:"badge",variant:t}})}function K2e({delay:e=0,...t}){return c.jsx(dHe,{"data-slot":"tooltip-provider",delay:e,...t})}function oh({...e}){return c.jsx(K2e,{children:c.jsx(eHe,{"data-slot":"tooltip",...e})})}function lh({...e}){return c.jsx(iHe,{"data-slot":"tooltip-trigger",...e})}function uh({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:i=0,children:s,...a}){return c.jsx(aHe,{children:c.jsx(oHe,{align:r,alignOffset:i,side:t,sideOffset:n,className:"isolate z-50",children:c.jsxs(uHe,{"data-slot":"tooltip-content",className:Le("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),...a,children:[s,c.jsx(cHe,{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 Umt=uy(function(){const{t}=Mt("assistant"),{isOpen:n,isStreaming:r,messages:i,hasMessages:s,error:a,provider:o,model:l,opencodeModel:u,toggle:d,open:f,close:p,sendMessage:m,clearMessages:b,setProvider:y,setModel:v,setOpencodeModel:_,cancelStream:w}=dEe(),C=Bmt(),T=Gt(),{resolvedTheme:k}=Rl(),S=k==="dark",N=x.useRef(null),R=x.useRef(null),I=x.useRef(null),D=x.useRef(null),[P,L]=x.useState(!1),[F,j]=x.useState(null),[$,B]=x.useState(""),z=x.useRef(null),q=x.useRef(!1),{providers:Y,installed:K}=l3(),{data:W}=zx();x.useEffect(()=>{o==="opencode"&&!u&&W&&_(W)},[o,u,W,_]);const X=x.useMemo(()=>i.find(ce=>ce.id===F),[i,F]),U=x.useMemo(()=>({a:({href:ce,children:he,...ue})=>c.jsx("a",{href:ce,target:"_blank",rel:"noopener noreferrer",...ue,children:he})}),[]);x.useEffect(()=>{q.current&&!r&&(T.invalidateQueries({queryKey:["tasks"]}),T.invalidateQueries({queryKey:["task-dependencies"]}),T.invalidateQueries({queryKey:["projects"]}),T.invalidateQueries({queryKey:["repositories"]}),T.invalidateQueries({queryKey:["apps"]}),T.invalidateQueries({queryKey:["assistant-sessions"]})),q.current=r},[r,T]);const Q=i[i.length-1]?.content;x.useEffect(()=>{N.current&&(N.current.scrollTop=N.current.scrollHeight)},[i.length,Q]),x.useEffect(()=>{const ce=he=>{if((he.metaKey||he.ctrlKey)&&he.shiftKey&&he.key.toLowerCase()==="c"&&(he.preventDefault(),d()),(he.metaKey||he.ctrlKey)&&he.key.toLowerCase()==="x"){const ue=he.target,fe=R.current?.contains(ue);(!(ue.tagName==="INPUT"||ue.tagName==="TEXTAREA"||ue.isContentEditable)||fe)&&(he.preventDefault(),n?p():(f(),setTimeout(()=>D.current?.focus(),100)))}he.key==="Escape"&&n&&!F&&p()};return window.addEventListener("keydown",ce),()=>window.removeEventListener("keydown",ce)},[d,f,p,n,F]),x.useEffect(()=>{const ce=he=>{if(R.current&&!R.current.contains(he.target)){const ue=he.target;!ue.closest(".floating-ai-button")&&!ue.closest('[data-slot="dialog-overlay"]')&&!ue.closest('[data-slot="dialog-content"]')&&p()}};if(n)return document.addEventListener("mousedown",ce),()=>document.removeEventListener("mousedown",ce)},[n,p]),x.useEffect(()=>{const ce=he=>{I.current&&!I.current.contains(he.target)&&(L(!1),B(""))};if(P)return document.addEventListener("mousedown",ce),()=>document.removeEventListener("mousedown",ce)},[P]),x.useEffect(()=>{P&&o==="opencode"&&z.current&&setTimeout(()=>z.current?.focus(),50)},[P,o]);const J=x.useCallback((ce,he)=>{m(ce,C,he)},[m,C]),ie=ise.find(ce=>ce.id===l),oe=()=>{if(o==="claude")return ie?.label||t("models.opus");if(u){const ce=u.split("/");return ce.length>1?ce[1]:u}return t("models.selectModel")},le=x.useMemo(()=>{const ce=Object.entries(Y).sort(([ue],[fe])=>ue.localeCompare(fe));if(!$.trim())return ce;const he=$.toLowerCase();return ce.map(([ue,fe])=>{const be=fe.filter(de=>de.toLowerCase().includes(he)||ue.toLowerCase().includes(he));return[ue,be]}).filter(([,ue])=>ue.length>0)},[Y,$]),se=K&&le.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:S?"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:S?"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(_w,{className:"w-7 h-7 text-white"}):c.jsx(Am,{className:"w-8 h-8 text-white"})}),c.jsx("div",{className:`absolute inset-0 rounded-full animate-pulse-slow opacity-30 ${S?"bg-destructive":"bg-accent"}`}),!n&&c.jsx("div",{className:`absolute -inset-1 rounded-full animate-ping-slow opacity-15 ${S?"bg-destructive":"bg-accent"}`})]})}),n&&c.jsx("div",{ref:R,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(oh,{children:[c.jsx(lh,{className:"flex items-center ml-1",children:c.jsx(Hr,{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(uh,{side:"bottom",className:"max-w-[200px]",children:t("preview.tooltip")})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[se&&c.jsxs("div",{className:"hidden sm:flex items-center rounded-full p-0.5 bg-muted/60",children:[c.jsx("button",{onClick:()=>y("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:()=>y("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:I,className:"relative",children:[c.jsxs("button",{onClick:()=>{const ce=!P;L(ce),ce||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:oe()}),c.jsx(pH,{className:`w-3 h-3 transition-transform flex-shrink-0 ${P?"rotate-180":""}`})]}),P&&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:ise.map(ce=>c.jsxs("button",{onClick:()=>{v(ce.id),L(!1)},className:`w-full px-3 py-2 text-left transition-colors flex items-center justify-between hover:bg-muted/50 ${l===ce.id?"bg-accent/10 text-accent":"text-foreground"}`,children:[c.jsxs("div",{children:[c.jsx("div",{className:"font-medium text-xs",children:ce.label}),c.jsx("div",{className:"text-[10px] text-muted-foreground",children:ce.description})]}),l===ce.id&&c.jsx(g0,{className:"w-3.5 h-3.5 flex-shrink-0 text-accent"})]},ce.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:z,type:"text",value:$,onChange:ce=>B(ce.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:ce=>ce.stopPropagation()})}),le.length===0&&$&&c.jsx("div",{className:"px-3 py-4 text-xs text-center text-muted-foreground",children:t("models.noModelsMatch",{filter:$})}),le.map(([ce,he])=>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:ce}),he.map(ue=>{const fe=`${ce}/${ue}`,be=u===fe;return c.jsxs("button",{onClick:()=>{_(fe),L(!1),B("")},className:`w-full px-3 py-1.5 text-left transition-colors flex items-center justify-between hover:bg-muted/50 ${be?"bg-accent/10 text-accent":"text-foreground"}`,children:[c.jsx("span",{className:"text-xs truncate",children:ue}),be&&c.jsx(g0,{className:"w-3.5 h-3.5 flex-shrink-0 ml-2 text-accent"})]},fe)})]},ce))]})]})]}),s&&c.jsx("button",{onClick:b,className:"p-1.5 rounded-full transition-colors hover:bg-muted",title:t("header.clearConversation"),children:c.jsx(x0e,{className:"w-4 h-4 text-muted-foreground"})}),c.jsx("button",{onClick:p,className:"p-1.5 rounded-full transition-colors hover:bg-muted",children:c.jsx(_w,{className:"w-4 h-4 text-muted-foreground"})})]})]}),i.length>0&&c.jsxs("div",{ref:N,className:"overflow-y-auto px-4 py-2 max-h-[350px] scrollbar-thin scrollbar-track-transparent scrollbar-thumb-muted",children:[i.map(ce=>c.jsx(Pmt,{role:ce.role,content:ce.content,isStreaming:ce.isStreaming,onClick:ce.role==="assistant"?()=>j(ce.id):void 0},ce.id)),a&&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:a})]}),i.length===0&&a&&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:a}),c.jsx(Mmt,{ref:D,onSend:J,isLoading:r,placeholder:s?" ":void 0,onCancel:w}),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(N4e,{className:"w-3 h-3"}),c.jsx("span",{children:t("input.shiftEnterHint").split("<kbd>").map((ce,he)=>{if(he===0)return ce;const[ue,fe]=ce.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:ue}),fe]},he)})})]}),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")})]})]}),S&&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:`
78
+ `))){const y=[];d.children.forEach((v,_)=>{_!=0&&(_==1&&v.type==="break"||y.push(v))}),d.children=[...y]}}return d});a&&(r.data={hName:t,hProperties:{class:`markdown-alert markdown-alert-${a}`,dir:"auto"}},u.unshift({type:"paragraph",children:[lmt(a),{type:"text",value:o.replace(/^\//,"")}],data:{hProperties:{class:"markdown-alert-title",dir:"auto"}}})),r.children=[...u]})};function lmt(e){let t=umt[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 umt={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 cmt(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 V2e(e){if(!e)return null;var t=e;return t.dataset.code&&t.classList.contains("copied")?t:t.parentElement?V2e(t.parentElement):null}function dmt(e){var t=n=>{var r=V2e(n.target);r&&(r.classList.add("active"),cmt(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 fmt=["prefixCls","className","source","style","disableCopy","skipHtml","onScroll","onMouseOver","pluginsFilter","rehypeRewrite","wrapperElement","warpperElement","urlTransform"],hmt=e=>e;const pmt=Z.forwardRef((e,t)=>{var{prefixCls:n="wmde-markdown wmde-markdown-color",className:r,source:i,style:s,disableCopy:a=!1,skipHtml:o=!0,onScroll:l,onMouseOver:u,pluginsFilter:d,wrapperElement:f={},warpperElement:p={},urlTransform:m}=e,b=Qw(e,fmt),y=Z.useRef(null);x.useImperativeHandle(t,()=>mr({},e,{mdp:y}),[y,e]);var v=(n||"")+" "+(r||"");dmt(y);var _=[...b.rehypePlugins||[]],w={allowElement:(k,S,N)=>b.allowElement?b.allowElement(k,S,N):/^[A-Za-z0-9]+$/.test(k.tagName)};o||_.push(ZCe);var C=[omt,...b.remarkPlugins||[],imt],T=mr({},p,f);return c.jsx("div",mr({ref:y,onScroll:l,onMouseOver:u},T,{className:v,style:s,children:c.jsx(Kft,mr({},w,b,{skipHtml:!o,urlTransform:m||hmt,rehypePlugins:d?d("rehype",_):_,remarkPlugins:d?d("remark",C):C,children:i||""}))}))});var mmt=function(t){return n=>{no(n,r=>{r.type==="element"&&r.tagName==="code"&&r.data&&r.data.meta&&(r.properties=mr({},r.properties,{"data-meta":String(r.data.meta)}))})}},gmt=function(t){return n=>{no(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 bmt=/[\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\u0B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\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\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\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\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,ymt=Object.hasOwnProperty;class vmt{constructor(){this.occurrences,this.reset()}slug(t,n){const r=this;let i=xmt(t,n===!0);const s=i;for(;ymt.call(r.occurrences,i);)r.occurrences[s]++,i=s+"-"+r.occurrences[s];return r.occurrences[i]=0,i}reset(){this.occurrences=Object.create(null)}}function xmt(e,t){return typeof e!="string"?"":(t||(e=e.toLowerCase()),e.replace(bmt,"").replace(/ /g,"-"))}function W2e(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 _mt={},Hae=new vmt;function Smt(e){const n=(e||_mt).prefix||"";return function(r){Hae.reset(),no(r,"element",function(i){W2e(i)&&!i.properties.id&&(i.properties.id=n+Hae.slug(Fv(i)))})}}const q2e=(function(e){if(e==null)return Cmt;if(typeof e=="string")return Emt(e);if(typeof e=="object")return wmt(e);if(typeof e=="function")return JY(e);throw new Error("Expected function, string, or array as `test`")});function wmt(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=q2e(e[n]);return JY(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function Emt(e){return JY(t);function t(n){return n.tagName===e}}function JY(e){return t;function t(n,r,i){return!!(kmt(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Cmt(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function kmt(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const Vae={type:"element",tagName:"span",properties:{className:["icon","icon-link"]},children:[]},Tmt={};function Amt(e){const t=e||Tmt;let n=t.properties;const r=t.headingProperties,i=t.behavior||"prepend",s=t.content,a=t.group,o=q2e(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){no(p,"element",function(m,b,y){if(W2e(m)&&m.properties.id&&o(m,b,y))return Object.assign(m.properties,FT(r,m)),l(m,b,y)})};function u(p){const m=Wae(s||Vae,p);return p.children[i==="prepend"?"unshift":"push"](Bj(p,FT(n,p),m)),[qS]}function d(p,m,b){if(typeof m!="number"||!b)return;const y=Wae(s||Vae,p),v=Bj(p,FT(n,p),y);let _=i==="before"?[v,p]:[p,v];if(a){const w=G2e(a,p);w&&!Array.isArray(w)&&w.type==="element"&&(w.children=_,_=[w])}return b.children.splice(m,1,..._),[qS,m+_.length]}function f(p){let m=p.children,b=[];return typeof s=="function"?(m=[],b=s(p)):s&&(b=eX(s)),p.children=[Bj(p,FT(n,p),Array.isArray(b)?[...m,...b]:[...m,b])],[qS]}}function eX(e){return $b(e)}function Bj(e,t,n){return{type:"element",tagName:"a",properties:{...t,href:"#"+e.properties.id},children:n}}function Wae(e,t){const n=G2e(e,t);return Array.isArray(n)?n:[n]}function G2e(e,t){return typeof e=="function"?e(t):eX(e)}function FT(e,t){return typeof e=="function"?e(t):e?eX(e):{}}const Nmt=(e={})=>{const{openDelimiter:t="rehype:ignore:start",closeDelimiter:n="rehype:ignore:end"}=e;return r=>{no(r,(i,s,a)=>{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 Omt={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 Rmt(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 Imt=(e,t)=>(n,r,i)=>{if(n.type==="element"&&i&&i.type==="root"&&/h(1|2|3|4|5|6)/.test(n.tagName)){var s=n.children&&n.children[0];s&&s.properties&&s.properties.ariaHidden==="true"&&(s.properties=mr({class:"anchor"},s.properties),s.children=[Omt])}if(n.type==="element"&&n.tagName==="pre"&&!e){var a=oCe(n.children);n.children.push(Rmt(a))}t&&t(n,r===null?void 0:r,i===null?void 0:i)},Dmt=[Smt,Amt,Nmt];const xh=Z.forwardRef((e,t)=>{var n,r=[mmt,ZCe,gmt,...Dmt,[Kst,{rewrite:Imt((n=e.disableCopy)!=null?n:!1,e.rehypeRewrite)}],[Zst,{properties:"attr"}],...e.rehypePlugins||[],[$Ee,{ignoreMissing:!0}]];return c.jsx(pmt,mr({},e,{rehypePlugins:r,ref:t}))});function Pmt({role:e,content:t,isStreaming:n,onClick:r}){const i=e==="user",{resolvedTheme:s}=Rl(),a=s==="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(_0e,{className:"w-4 h-4 text-foreground"}):c.jsx(Am,{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":a?"dark":"light",children:c.jsx(xh,{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})]})}const Lmt=10*1024*1024,jmt=["image/png","image/jpeg","image/gif","image/webp"],Mmt=x.forwardRef(function({onSend:t,isLoading:n,placeholder:r,onCancel:i},s){const{t:a}=Mt("assistant"),o=r??a("input.placeholder"),[l,u]=x.useState(""),[d,f]=x.useState([]),p=x.useRef(null),m=x.useRef(null);x.useImperativeHandle(s,()=>({focus:()=>{p.current?.focus()}}));const b=x.useCallback(async k=>{if(!k)return;const S=[];for(const N of Array.from(k)){if(!jmt.includes(N.type)||N.size>Lmt)continue;const R=await new Promise((I,D)=>{const P=new FileReader;P.onload=()=>I(P.result),P.onerror=D,P.readAsDataURL(N)});S.push({id:crypto.randomUUID(),file:N,dataUrl:R,mediaType:N.type})}S.length>0&&f(N=>[...N,...S])},[]),y=x.useCallback(async k=>{const S=k.clipboardData?.items;if(!S)return;const N=[];for(const R of Array.from(S))if(R.type.startsWith("image/")){const I=R.getAsFile();I&&N.push(I)}if(N.length>0){k.preventDefault();const R=new DataTransfer;N.forEach(I=>R.items.add(I)),await b(R.files)}},[b]),v=x.useCallback(k=>{f(S=>S.filter(N=>N.id!==k))},[]),_=x.useCallback(()=>{const k=p.current;k&&(k.style.height="auto",k.style.height=`${Math.min(k.scrollHeight,150)}px`)},[]);x.useEffect(()=>{_()},[l,_]);const w=x.useCallback(()=>{const k=l.trim();(k||d.length>0)&&!n&&(t(k,d.length>0?d:void 0),u(""),f([]),p.current&&(p.current.style.height="auto"))},[l,d,n,t]),C=x.useCallback(k=>{k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),w())},[w]),T=l.trim()||d.length>0;return c.jsxs("div",{className:"relative",children:[d.length>0&&c.jsx("div",{className:"px-4 pt-4 flex flex-wrap gap-2",children:d.map(k=>c.jsxs("div",{className:"relative group",children:[c.jsx("img",{src:k.dataUrl,alt:"Attachment",className:"h-16 w-16 object-cover rounded-lg border border-border"}),c.jsx("button",{onClick:()=>v(k.id),className:"absolute -top-1.5 -right-1.5 p-0.5 rounded-full bg-destructive text-destructive-foreground opacity-0 group-hover:opacity-100 transition-opacity",children:c.jsx(_w,{className:"w-3 h-3"})})]},k.id))}),c.jsx("div",{className:"relative overflow-hidden",children:c.jsx("textarea",{ref:p,value:l,onChange:k=>u(k.target.value),onKeyDown:C,onPaste:y,rows:3,disabled:n,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:o,style:{scrollbarWidth:"none"}})}),c.jsx("input",{ref:m,type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",multiple:!0,className:"hidden",onChange:k=>b(k.target.files)}),c.jsx("div",{className:"px-4 pb-4",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("button",{onClick:()=>m.current?.click(),disabled:n,className:Le("p-2 rounded-lg transition-colors","text-muted-foreground hover:text-foreground hover:bg-muted/50","disabled:opacity-50 disabled:cursor-not-allowed"),title:"Attach image",children:c.jsx(g0e,{className:"w-5 h-5"})}),n&&i?c.jsxs("button",{onClick:i,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 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)"},title:"Stop generating",children:[c.jsx(v0e,{className:"w-5 h-5 fill-current"}),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"})})]}):c.jsxs("button",{onClick:w,disabled:!T||n,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:[n?c.jsx(m0e,{className:"w-5 h-5 animate-spin"}):c.jsx(y0e,{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 Fmt(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 U_(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 Bmt(){const e=Is({select:t=>t.location});return x.useMemo(()=>{const{pathname:t,search:n}=e,r=Fmt(t),i={pageType:r,path:t};switch(r){case"task":i.taskId=U_(t,"/tasks/");break;case"project":i.projectId=U_(t,"/projects/");break;case"repository":i.repositoryId=U_(t,"/repositories/");break;case"app":i.appId=U_(t,"/apps/");break;case"job":i.jobId=U_(t,"/jobs/");break}const s=n;if(r==="tasks"){const a={};typeof s.project=="string"&&(a.project=s.project),typeof s.tags=="string"&&(a.tags=s.tags.split(",").filter(Boolean)),typeof s.view=="string"&&(a.view=s.view),Object.keys(a).length>0&&(i.filters=a)}return r==="monitoring"&&typeof s.tab=="string"&&(i.activeTab=s.tab),i},[e])}const $mt=Lm("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 Hr({className:e,variant:t="default",render:n,...r}){return fHe({defaultTagName:"span",props:td({className:Le($mt({className:e,variant:t}))},r),render:n,state:{slot:"badge",variant:t}})}function K2e({delay:e=0,...t}){return c.jsx(dHe,{"data-slot":"tooltip-provider",delay:e,...t})}function oh({...e}){return c.jsx(K2e,{children:c.jsx(eHe,{"data-slot":"tooltip",...e})})}function lh({...e}){return c.jsx(iHe,{"data-slot":"tooltip-trigger",...e})}function uh({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:i=0,children:s,...a}){return c.jsx(aHe,{children:c.jsx(oHe,{align:r,alignOffset:i,side:t,sideOffset:n,className:"isolate z-50",children:c.jsxs(uHe,{"data-slot":"tooltip-content",className:Le("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),...a,children:[s,c.jsx(cHe,{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 Umt=uy(function(){const{t}=Mt("assistant"),{isOpen:n,isStreaming:r,messages:i,hasMessages:s,error:a,provider:o,model:l,opencodeModel:u,toggle:d,open:f,close:p,sendMessage:m,clearMessages:b,setProvider:y,setModel:v,setOpencodeModel:_,cancelStream:w}=dEe(),C=Bmt(),T=Gt(),{resolvedTheme:k}=Rl(),S=k==="dark",N=x.useRef(null),R=x.useRef(null),I=x.useRef(null),D=x.useRef(null),[P,L]=x.useState(!1),[F,j]=x.useState(null),[$,B]=x.useState(""),z=x.useRef(null),q=x.useRef(!1),{providers:Y,installed:K}=l3(),{data:W}=zx();x.useEffect(()=>{o==="opencode"&&!u&&W&&_(W)},[o,u,W,_]);const X=x.useMemo(()=>i.find(ce=>ce.id===F),[i,F]),U=x.useMemo(()=>({a:({href:ce,children:he,...ue})=>c.jsx("a",{href:ce,target:"_blank",rel:"noopener noreferrer",...ue,children:he})}),[]);x.useEffect(()=>{q.current&&!r&&(T.invalidateQueries({queryKey:["tasks"]}),T.invalidateQueries({queryKey:["task-dependencies"]}),T.invalidateQueries({queryKey:["projects"]}),T.invalidateQueries({queryKey:["repositories"]}),T.invalidateQueries({queryKey:["apps"]}),T.invalidateQueries({queryKey:["assistant-sessions"]})),q.current=r},[r,T]);const Q=i[i.length-1]?.content;x.useEffect(()=>{N.current&&(N.current.scrollTop=N.current.scrollHeight)},[i.length,Q]),x.useEffect(()=>{const ce=he=>{if((he.metaKey||he.ctrlKey)&&he.shiftKey&&he.key.toLowerCase()==="c"&&(he.preventDefault(),d()),(he.metaKey||he.ctrlKey)&&he.key.toLowerCase()==="x"){const ue=he.target,fe=R.current?.contains(ue);(!(ue.tagName==="INPUT"||ue.tagName==="TEXTAREA"||ue.isContentEditable)||fe)&&(he.preventDefault(),n?p():(f(),setTimeout(()=>D.current?.focus(),100)))}he.key==="Escape"&&n&&!F&&p()};return window.addEventListener("keydown",ce),()=>window.removeEventListener("keydown",ce)},[d,f,p,n,F]),x.useEffect(()=>{const ce=he=>{if(R.current&&!R.current.contains(he.target)){const ue=he.target;!ue.closest(".floating-ai-button")&&!ue.closest('[data-slot="dialog-overlay"]')&&!ue.closest('[data-slot="dialog-content"]')&&p()}};if(n)return document.addEventListener("mousedown",ce),()=>document.removeEventListener("mousedown",ce)},[n,p]),x.useEffect(()=>{const ce=he=>{I.current&&!I.current.contains(he.target)&&(L(!1),B(""))};if(P)return document.addEventListener("mousedown",ce),()=>document.removeEventListener("mousedown",ce)},[P]),x.useEffect(()=>{P&&o==="opencode"&&z.current&&setTimeout(()=>z.current?.focus(),50)},[P,o]);const J=x.useCallback((ce,he)=>{m(ce,C,he)},[m,C]),ie=ise.find(ce=>ce.id===l),oe=()=>{if(o==="claude")return ie?.label||t("models.opus");if(u){const ce=u.split("/");return ce.length>1?ce[1]:u}return t("models.selectModel")},le=x.useMemo(()=>{const ce=Object.entries(Y).sort(([ue],[fe])=>ue.localeCompare(fe));if(!$.trim())return ce;const he=$.toLowerCase();return ce.map(([ue,fe])=>{const be=fe.filter(de=>de.toLowerCase().includes(he)||ue.toLowerCase().includes(he));return[ue,be]}).filter(([,ue])=>ue.length>0)},[Y,$]),se=K&&le.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:S?"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:S?"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(_w,{className:"w-7 h-7 text-white"}):c.jsx(Am,{className:"w-8 h-8 text-white"})}),c.jsx("div",{className:`absolute inset-0 rounded-full animate-pulse-slow opacity-30 ${S?"bg-destructive":"bg-accent"}`}),!n&&c.jsx("div",{className:`absolute -inset-1 rounded-full animate-ping-slow opacity-15 ${S?"bg-destructive":"bg-accent"}`})]})}),n&&c.jsx("div",{ref:R,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(oh,{children:[c.jsx(lh,{className:"flex items-center ml-1",children:c.jsx(Hr,{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(uh,{side:"bottom",className:"max-w-[200px]",children:t("preview.tooltip")})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[se&&c.jsxs("div",{className:"hidden sm:flex items-center rounded-full p-0.5 bg-muted/60",children:[c.jsx("button",{onClick:()=>y("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:()=>y("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:I,className:"relative",children:[c.jsxs("button",{onClick:()=>{const ce=!P;L(ce),ce||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:oe()}),c.jsx(pH,{className:`w-3 h-3 transition-transform flex-shrink-0 ${P?"rotate-180":""}`})]}),P&&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:ise.map(ce=>c.jsxs("button",{onClick:()=>{v(ce.id),L(!1)},className:`w-full px-3 py-2 text-left transition-colors flex items-center justify-between hover:bg-muted/50 ${l===ce.id?"bg-accent/10 text-accent":"text-foreground"}`,children:[c.jsxs("div",{children:[c.jsx("div",{className:"font-medium text-xs",children:ce.label}),c.jsx("div",{className:"text-[10px] text-muted-foreground",children:ce.description})]}),l===ce.id&&c.jsx(g0,{className:"w-3.5 h-3.5 flex-shrink-0 text-accent"})]},ce.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:z,type:"text",value:$,onChange:ce=>B(ce.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:ce=>ce.stopPropagation()})}),le.length===0&&$&&c.jsx("div",{className:"px-3 py-4 text-xs text-center text-muted-foreground",children:t("models.noModelsMatch",{filter:$})}),le.map(([ce,he])=>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:ce}),he.map(ue=>{const fe=`${ce}/${ue}`,be=u===fe;return c.jsxs("button",{onClick:()=>{_(fe),L(!1),B("")},className:`w-full px-3 py-1.5 text-left transition-colors flex items-center justify-between hover:bg-muted/50 ${be?"bg-accent/10 text-accent":"text-foreground"}`,children:[c.jsx("span",{className:"text-xs truncate",children:ue}),be&&c.jsx(g0,{className:"w-3.5 h-3.5 flex-shrink-0 ml-2 text-accent"})]},fe)})]},ce))]})]})]}),s&&c.jsx("button",{onClick:b,className:"p-1.5 rounded-full transition-colors hover:bg-muted",title:t("header.clearConversation"),children:c.jsx(x0e,{className:"w-4 h-4 text-muted-foreground"})}),c.jsx("button",{onClick:p,className:"p-1.5 rounded-full transition-colors hover:bg-muted",children:c.jsx(_w,{className:"w-4 h-4 text-muted-foreground"})})]})]}),i.length>0&&c.jsxs("div",{ref:N,className:"overflow-y-auto px-4 py-2 max-h-[350px] scrollbar-thin scrollbar-track-transparent scrollbar-thumb-muted",children:[i.map(ce=>c.jsx(Pmt,{role:ce.role,content:ce.content,isStreaming:ce.isStreaming,onClick:ce.role==="assistant"?()=>j(ce.id):void 0},ce.id)),a&&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:a})]}),i.length===0&&a&&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:a}),c.jsx(Mmt,{ref:D,onSend:J,isLoading:r,placeholder:s?" ":void 0,onCancel:w}),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(N4e,{className:"w-3 h-3"}),c.jsx("span",{children:t("input.shiftEnterHint").split("<kbd>").map((ce,he)=>{if(he===0)return ce;const[ue,fe]=ce.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:ue}),fe]},he)})})]}),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")})]})]}),S&&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:`
79
79
  @keyframes popIn {
80
80
  0% {
81
81
  opacity: 0;
package/dist/index.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/png" href="/logo.png" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Fulcrum</title>
8
- <script type="module" crossorigin src="/assets/index-DNNOyQp7.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-Bo10xtqF.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-D6ht7k3-.css">
10
10
  </head>
11
11
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowsuchagency/fulcrum",
3
- "version": "2.5.2",
3
+ "version": "2.5.4",
4
4
  "description": "Harness Attention. Orchestrate Agents. Ship.",
5
5
  "license": "PolyForm-Perimeter-1.0.0",
6
6
  "repository": {
package/server/index.js CHANGED
@@ -409304,7 +409304,56 @@ var init_imap_flow = __esm(() => {
409304
409304
  });
409305
409305
 
409306
409306
  // server/services/channels/email-types.ts
409307
- var SIGNATURE_PATTERNS, QUOTED_REPLY_PATTERNS;
409307
+ function isAutomatedEmail(headers) {
409308
+ if (headers.autoSubmitted && headers.autoSubmitted.toLowerCase() !== "no") {
409309
+ return {
409310
+ isAutomated: true,
409311
+ reason: `Auto-Submitted header: ${headers.autoSubmitted}`
409312
+ };
409313
+ }
409314
+ if (headers.precedence) {
409315
+ const precedenceLower = headers.precedence.toLowerCase();
409316
+ if (AUTOMATED_PRECEDENCE_VALUES.includes(precedenceLower)) {
409317
+ return {
409318
+ isAutomated: true,
409319
+ reason: `Precedence header: ${headers.precedence}`
409320
+ };
409321
+ }
409322
+ }
409323
+ if (headers.listUnsubscribe) {
409324
+ return {
409325
+ isAutomated: true,
409326
+ reason: "List-Unsubscribe header present"
409327
+ };
409328
+ }
409329
+ if (headers.xAutoResponseSuppress) {
409330
+ return {
409331
+ isAutomated: true,
409332
+ reason: `X-Auto-Response-Suppress header: ${headers.xAutoResponseSuppress}`
409333
+ };
409334
+ }
409335
+ if (headers.returnPath !== null) {
409336
+ const returnPathTrimmed = headers.returnPath.trim();
409337
+ if (returnPathTrimmed === "<>" || returnPathTrimmed === "") {
409338
+ return {
409339
+ isAutomated: true,
409340
+ reason: "Empty Return-Path (bounce/delivery notification)"
409341
+ };
409342
+ }
409343
+ }
409344
+ if (headers.from) {
409345
+ for (const pattern of AUTOMATED_SENDER_PATTERNS) {
409346
+ if (pattern.test(headers.from)) {
409347
+ return {
409348
+ isAutomated: true,
409349
+ reason: `Sender matches automated pattern: ${headers.from}`
409350
+ };
409351
+ }
409352
+ }
409353
+ }
409354
+ return { isAutomated: false };
409355
+ }
409356
+ var SIGNATURE_PATTERNS, QUOTED_REPLY_PATTERNS, AUTOMATED_SENDER_PATTERNS, AUTOMATED_PRECEDENCE_VALUES;
409308
409357
  var init_email_types = __esm(() => {
409309
409358
  SIGNATURE_PATTERNS = [
409310
409359
  /^--\s*$/m,
@@ -409321,6 +409370,23 @@ var init_email_types = __esm(() => {
409321
409370
  /^To: .+$/m,
409322
409371
  /^Subject: .+$/m
409323
409372
  ];
409373
+ AUTOMATED_SENDER_PATTERNS = [
409374
+ /^noreply@/i,
409375
+ /^no-reply@/i,
409376
+ /^do-not-reply@/i,
409377
+ /^donotreply@/i,
409378
+ /^mailer-daemon@/i,
409379
+ /^postmaster@/i,
409380
+ /^bounces?@/i,
409381
+ /^notifications?@/i,
409382
+ /^alerts?@/i,
409383
+ /^daemon@/i,
409384
+ /^auto@/i,
409385
+ /^automated@/i,
409386
+ /^system@/i,
409387
+ /^info@.*\.noreply\./i
409388
+ ];
409389
+ AUTOMATED_PRECEDENCE_VALUES = ["bulk", "junk", "list", "auto_reply"];
409324
409390
  });
409325
409391
 
409326
409392
  // server/services/channels/email-parser.ts
@@ -409357,7 +409423,12 @@ function parseEmailHeaders(source, envelope) {
409357
409423
  to: parseAddresses(getHeader2("To")),
409358
409424
  cc: parseAddresses(getHeader2("Cc")),
409359
409425
  subject: envelope?.subject || getHeader2("Subject"),
409360
- date: envelope?.date ? new Date(envelope.date) : null
409426
+ date: envelope?.date ? new Date(envelope.date) : null,
409427
+ autoSubmitted: getHeader2("Auto-Submitted"),
409428
+ precedence: getHeader2("Precedence"),
409429
+ listUnsubscribe: getHeader2("List-Unsubscribe"),
409430
+ xAutoResponseSuppress: getHeader2("X-Auto-Response-Suppress"),
409431
+ returnPath: getHeader2("Return-Path")
409361
409432
  };
409362
409433
  }
409363
409434
  async function parseEmailContent(source, connectionId) {
@@ -409822,14 +409893,24 @@ class EmailChannel {
409822
409893
  }
409823
409894
  const authResult = await checkAuthorization(this.connectionId, headers, this.credentials?.allowedSenders || [], this.credentials?.smtp.user.toLowerCase());
409824
409895
  if (!authResult.authorized) {
409825
- log2.messaging.info("Email rejected - not authorized", {
409826
- connectionId: this.connectionId,
409827
- from: headers.from,
409828
- subject: headers.subject,
409829
- reason: authResult.reason
409830
- });
409831
- if (this.transporter) {
409832
- await sendUnauthorizedResponse(this.transporter, this.connectionId, this.getFromAddress(), headers, this.credentials?.bcc);
409896
+ const automatedCheck = isAutomatedEmail(headers);
409897
+ if (automatedCheck.isAutomated) {
409898
+ log2.messaging.info("Email skipped - automated sender", {
409899
+ connectionId: this.connectionId,
409900
+ from: headers.from,
409901
+ subject: headers.subject,
409902
+ reason: automatedCheck.reason
409903
+ });
409904
+ } else {
409905
+ log2.messaging.info("Email rejected - not authorized", {
409906
+ connectionId: this.connectionId,
409907
+ from: headers.from,
409908
+ subject: headers.subject,
409909
+ reason: authResult.reason
409910
+ });
409911
+ if (this.transporter) {
409912
+ await sendUnauthorizedResponse(this.transporter, this.connectionId, this.getFromAddress(), headers, this.credentials?.bcc);
409913
+ }
409833
409914
  }
409834
409915
  await client3.messageFlagsAdd({ uid: message.uid }, ["\\Seen"]);
409835
409916
  continue;
@@ -410099,6 +410180,7 @@ var init_email_channel = __esm(() => {
410099
410180
  init_email_auth();
410100
410181
  init_email_storage();
410101
410182
  init_email_sender();
410183
+ init_email_types();
410102
410184
  });
410103
410185
 
410104
410186
  // server/services/channels/channel-manager.ts
@@ -463858,7 +463940,7 @@ mcpRoutes.all("/", async (c) => {
463858
463940
  });
463859
463941
  const server = new McpServer({
463860
463942
  name: "fulcrum",
463861
- version: "2.5.2"
463943
+ version: "2.5.4"
463862
463944
  });
463863
463945
  const client = new FulcrumClient(`http://localhost:${port}`);
463864
463946
  registerTools(server, client);