@jait/gateway 0.1.375 → 0.1.377

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.
Files changed (62) hide show
  1. package/dist/providers/provider-auth.d.ts.map +1 -1
  2. package/dist/providers/provider-auth.js +17 -0
  3. package/dist/providers/provider-auth.js.map +1 -1
  4. package/dist/tools/terminal-tools.d.ts.map +1 -1
  5. package/dist/tools/terminal-tools.js +43 -8
  6. package/dist/tools/terminal-tools.js.map +1 -1
  7. package/package.json +1 -1
  8. package/web-dist/assets/{_basePickBy-53iJu97U.js → _basePickBy-Wzv49Akq.js} +1 -1
  9. package/web-dist/assets/{_baseUniq-BYvAbeDg.js → _baseUniq-BSZbCXUo.js} +1 -1
  10. package/web-dist/assets/{arc-CwNDfHZx.js → arc-DpjjQy8H.js} +1 -1
  11. package/web-dist/assets/{architectureDiagram-2XIMDMQ5-B-0c_kNx.js → architectureDiagram-2XIMDMQ5-C6zyje39.js} +1 -1
  12. package/web-dist/assets/{blockDiagram-WCTKOSBZ-DP4dff2t.js → blockDiagram-WCTKOSBZ-Dg5vNEHV.js} +1 -1
  13. package/web-dist/assets/{c4Diagram-IC4MRINW-BAiV3iEA.js → c4Diagram-IC4MRINW-B-CGuYcX.js} +1 -1
  14. package/web-dist/assets/channel-Cfw0FcZ8.js +1 -0
  15. package/web-dist/assets/{chunk-4BX2VUAB-CZaLNMMJ.js → chunk-4BX2VUAB-CeqTXBvl.js} +1 -1
  16. package/web-dist/assets/{chunk-55IACEB6-Coz7vP6q.js → chunk-55IACEB6-BjhCFTwZ.js} +1 -1
  17. package/web-dist/assets/{chunk-FMBD7UC4-DdXZbKln.js → chunk-FMBD7UC4-2VH4w1Cm.js} +1 -1
  18. package/web-dist/assets/{chunk-JSJVCQXG-CgCmgC8e.js → chunk-JSJVCQXG-BC0wOWQH.js} +1 -1
  19. package/web-dist/assets/{chunk-KX2RTZJC-DzLMSsPE.js → chunk-KX2RTZJC-D9HDfnhZ.js} +1 -1
  20. package/web-dist/assets/{chunk-NQ4KR5QH-BJhoUGJU.js → chunk-NQ4KR5QH-SwWifZ9F.js} +1 -1
  21. package/web-dist/assets/{chunk-QZHKN3VN-DUTbPhIZ.js → chunk-QZHKN3VN-C9r4087v.js} +1 -1
  22. package/web-dist/assets/{chunk-WL4C6EOR-BrcFCWM2.js → chunk-WL4C6EOR-BMdij3qU.js} +1 -1
  23. package/web-dist/assets/classDiagram-VBA2DB6C-luXaKhEX.js +1 -0
  24. package/web-dist/assets/classDiagram-v2-RAHNMMFH-luXaKhEX.js +1 -0
  25. package/web-dist/assets/clone-CotxwDmM.js +1 -0
  26. package/web-dist/assets/{cose-bilkent-S5V4N54A-DnsxyVyq.js → cose-bilkent-S5V4N54A-DfIv6ajn.js} +1 -1
  27. package/web-dist/assets/{dagre-KLK3FWXG-BWZ8xz3g.js → dagre-KLK3FWXG-BJsr2FRT.js} +1 -1
  28. package/web-dist/assets/{diagram-E7M64L7V--84PgnUj.js → diagram-E7M64L7V-CzOQpmHA.js} +1 -1
  29. package/web-dist/assets/{diagram-IFDJBPK2-lAfHZB9E.js → diagram-IFDJBPK2-DBOK9xY-.js} +1 -1
  30. package/web-dist/assets/{diagram-P4PSJMXO-BjAXdkjW.js → diagram-P4PSJMXO-BV4mV-cp.js} +1 -1
  31. package/web-dist/assets/{erDiagram-INFDFZHY-Ek05XEfG.js → erDiagram-INFDFZHY-Ba0tZtxl.js} +1 -1
  32. package/web-dist/assets/{flowDiagram-PKNHOUZH-CyTE1i_a.js → flowDiagram-PKNHOUZH-B9Jj988m.js} +1 -1
  33. package/web-dist/assets/{ganttDiagram-A5KZAMGK-CyluJD9T.js → ganttDiagram-A5KZAMGK-CiMqI7tz.js} +1 -1
  34. package/web-dist/assets/{gitGraphDiagram-K3NZZRJ6-BvJoM0-d.js → gitGraphDiagram-K3NZZRJ6-mi0Lj_tL.js} +1 -1
  35. package/web-dist/assets/{graph-C-sS8xWW.js → graph-B1mSAN-r.js} +1 -1
  36. package/web-dist/assets/{index-BnD1HLiI.js → index-Coc8XQg5.js} +4 -4
  37. package/web-dist/assets/index-DaDJMKc_.css +32 -0
  38. package/web-dist/assets/{infoDiagram-LFFYTUFH-Dc3SfWVL.js → infoDiagram-LFFYTUFH-BBJROgHw.js} +1 -1
  39. package/web-dist/assets/{ishikawaDiagram-PHBUUO56-D3PGI_d6.js → ishikawaDiagram-PHBUUO56-CvD1jJdy.js} +1 -1
  40. package/web-dist/assets/{journeyDiagram-4ABVD52K-DzYxytM9.js → journeyDiagram-4ABVD52K-Cee9gxbo.js} +1 -1
  41. package/web-dist/assets/{kanban-definition-K7BYSVSG-2sYGZW7N.js → kanban-definition-K7BYSVSG-DZx02Jgo.js} +1 -1
  42. package/web-dist/assets/{layout-D9_WBvjy.js → layout-FD28oy1q.js} +1 -1
  43. package/web-dist/assets/{linear-t_KdmVjf.js → linear-BfIO_UGQ.js} +1 -1
  44. package/web-dist/assets/{mindmap-definition-YRQLILUH-PJJkEJQN.js → mindmap-definition-YRQLILUH-BDhKfywd.js} +1 -1
  45. package/web-dist/assets/{pieDiagram-SKSYHLDU-x6jkS0t6.js → pieDiagram-SKSYHLDU-Ckqgoc0S.js} +1 -1
  46. package/web-dist/assets/{quadrantDiagram-337W2JSQ-CN0DjzKF.js → quadrantDiagram-337W2JSQ-C-tMRbqn.js} +1 -1
  47. package/web-dist/assets/{requirementDiagram-Z7DCOOCP-QQatHuXf.js → requirementDiagram-Z7DCOOCP-KiArbbU4.js} +1 -1
  48. package/web-dist/assets/{sankeyDiagram-WA2Y5GQK-pC1cAJ1B.js → sankeyDiagram-WA2Y5GQK-BSyF4GDm.js} +1 -1
  49. package/web-dist/assets/{sequenceDiagram-2WXFIKYE-CpDKPlAu.js → sequenceDiagram-2WXFIKYE-ChU2W22g.js} +1 -1
  50. package/web-dist/assets/{stateDiagram-RAJIS63D-BaSM-cZz.js → stateDiagram-RAJIS63D-CYfNyeS2.js} +1 -1
  51. package/web-dist/assets/stateDiagram-v2-FVOUBMTO-CQ11roi0.js +1 -0
  52. package/web-dist/assets/{timeline-definition-YZTLITO2-Csn9zCs-.js → timeline-definition-YZTLITO2-BNGiq9yT.js} +1 -1
  53. package/web-dist/assets/{treemap-KZPCXAKY-A-aCRDAd.js → treemap-KZPCXAKY-7f24nLHF.js} +1 -1
  54. package/web-dist/assets/{vennDiagram-LZ73GAT5-X1xYgQ9Z.js → vennDiagram-LZ73GAT5-B5T32YFj.js} +1 -1
  55. package/web-dist/assets/{xychartDiagram-JWTSCODW-CfdlpmRj.js → xychartDiagram-JWTSCODW-BsCy1_Gu.js} +1 -1
  56. package/web-dist/index.html +2 -2
  57. package/web-dist/assets/channel-C8WFy4SW.js +0 -1
  58. package/web-dist/assets/classDiagram-VBA2DB6C-DLVcc5Iw.js +0 -1
  59. package/web-dist/assets/classDiagram-v2-RAHNMMFH-DLVcc5Iw.js +0 -1
  60. package/web-dist/assets/clone-q1S5VioE.js +0 -1
  61. package/web-dist/assets/index-DLg73qIj.css +0 -32
  62. package/web-dist/assets/stateDiagram-v2-FVOUBMTO-C3QMtbCf.js +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./angular-html-DA-rfuFy.js","./html-pp8916En.js","./javascript-wDzz0qaB.js","./css-CLj8gQPS.js","./angular-ts-BrjP3tb8.js","./scss-D5BDwBP9.js","./astro-HNnZUWAn.js","./json-Cp-IABpG.js","./typescript-BPQ3VLAy.js","./postcss-CXtECtnM.js","./tsx-COt5Ahok.js","./blade-BjGOyj-B.js","./html-derivative-DlHx6ybY.js","./xml-sdJ4AIDG.js","./java-CylS5w8V.js","./sql-BLtJtn59.js","./coffee-Ch7k5sss.js","./cpp-CofmeUqb.js","./regexp-CDVJQ6XC.js","./glsl-DplSGwfg.js","./c-BIGW1oBm.js","./graphql-ChdNCCLP.js","./jsx-g9-lgVsj.js","./haml-D5jkg6IW.js","./handlebars-BpdQsYii.js","./yaml-Buea-lGh.js","./http-jrhK8wxY.js","./shellscript-Yzrsuije.js","./hurl-irOxFIW8.js","./csv-fuZLfV_i.js","./jinja-f2NsQr07.js","./jison-wvAkD_A8.js","./julia-CxzCAyBv.js","./python-B6aJPvgy.js","./r-Dspwwk_N.js","./marko-DjSrsDqO.js","./less-B1dDrJ26.js","./mdc-DTYItulj.js","./markdown-Cvjx9yec.js","./php-R6g_5hLQ.js","./pug-DKIMFp6K.js","./svelte-Cy7k_4gC.js","./ts-tags-DQrlYJgV.js","./vue-D2xRrEX4.js","./vue-html-AaS7Mt5G.js","./vue-vine-BoDAl6tE.js","./stylus-BEDo0Tqx.js","./dagre-KLK3FWXG-BWZ8xz3g.js","./graph-C-sS8xWW.js","./_baseUniq-BYvAbeDg.js","./layout-D9_WBvjy.js","./_basePickBy-53iJu97U.js","./clone-q1S5VioE.js","./cose-bilkent-S5V4N54A-DnsxyVyq.js","./cytoscape.esm-BQaXIfA_.js","./c4Diagram-IC4MRINW-BAiV3iEA.js","./chunk-JSJVCQXG-CgCmgC8e.js","./flowDiagram-PKNHOUZH-CyTE1i_a.js","./chunk-FMBD7UC4-DdXZbKln.js","./chunk-55IACEB6-Coz7vP6q.js","./chunk-KX2RTZJC-DzLMSsPE.js","./channel-C8WFy4SW.js","./erDiagram-INFDFZHY-Ek05XEfG.js","./gitGraphDiagram-K3NZZRJ6-BvJoM0-d.js","./chunk-4BX2VUAB-CZaLNMMJ.js","./chunk-QZHKN3VN-DUTbPhIZ.js","./treemap-KZPCXAKY-A-aCRDAd.js","./ganttDiagram-A5KZAMGK-CyluJD9T.js","./linear-t_KdmVjf.js","./defaultLocale-DX6XiGOO.js","./infoDiagram-LFFYTUFH-Dc3SfWVL.js","./pieDiagram-SKSYHLDU-x6jkS0t6.js","./arc-CwNDfHZx.js","./quadrantDiagram-337W2JSQ-CN0DjzKF.js","./xychartDiagram-JWTSCODW-CfdlpmRj.js","./requirementDiagram-Z7DCOOCP-QQatHuXf.js","./sequenceDiagram-2WXFIKYE-CpDKPlAu.js","./classDiagram-VBA2DB6C-DLVcc5Iw.js","./chunk-WL4C6EOR-BrcFCWM2.js","./classDiagram-v2-RAHNMMFH-DLVcc5Iw.js","./stateDiagram-RAJIS63D-BaSM-cZz.js","./chunk-NQ4KR5QH-BJhoUGJU.js","./stateDiagram-v2-FVOUBMTO-C3QMtbCf.js","./journeyDiagram-4ABVD52K-DzYxytM9.js","./timeline-definition-YZTLITO2-Csn9zCs-.js","./mindmap-definition-YRQLILUH-PJJkEJQN.js","./kanban-definition-K7BYSVSG-2sYGZW7N.js","./diagram-P4PSJMXO-BjAXdkjW.js","./diagram-IFDJBPK2-lAfHZB9E.js","./blockDiagram-WCTKOSBZ-DP4dff2t.js","./architectureDiagram-2XIMDMQ5-B-0c_kNx.js","./diagram-E7M64L7V--84PgnUj.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./angular-html-DA-rfuFy.js","./html-pp8916En.js","./javascript-wDzz0qaB.js","./css-CLj8gQPS.js","./angular-ts-BrjP3tb8.js","./scss-D5BDwBP9.js","./astro-HNnZUWAn.js","./json-Cp-IABpG.js","./typescript-BPQ3VLAy.js","./postcss-CXtECtnM.js","./tsx-COt5Ahok.js","./blade-BjGOyj-B.js","./html-derivative-DlHx6ybY.js","./xml-sdJ4AIDG.js","./java-CylS5w8V.js","./sql-BLtJtn59.js","./coffee-Ch7k5sss.js","./cpp-CofmeUqb.js","./regexp-CDVJQ6XC.js","./glsl-DplSGwfg.js","./c-BIGW1oBm.js","./graphql-ChdNCCLP.js","./jsx-g9-lgVsj.js","./haml-D5jkg6IW.js","./handlebars-BpdQsYii.js","./yaml-Buea-lGh.js","./http-jrhK8wxY.js","./shellscript-Yzrsuije.js","./hurl-irOxFIW8.js","./csv-fuZLfV_i.js","./jinja-f2NsQr07.js","./jison-wvAkD_A8.js","./julia-CxzCAyBv.js","./python-B6aJPvgy.js","./r-Dspwwk_N.js","./marko-DjSrsDqO.js","./less-B1dDrJ26.js","./mdc-DTYItulj.js","./markdown-Cvjx9yec.js","./php-R6g_5hLQ.js","./pug-DKIMFp6K.js","./svelte-Cy7k_4gC.js","./ts-tags-DQrlYJgV.js","./vue-D2xRrEX4.js","./vue-html-AaS7Mt5G.js","./vue-vine-BoDAl6tE.js","./stylus-BEDo0Tqx.js","./dagre-KLK3FWXG-BJsr2FRT.js","./graph-B1mSAN-r.js","./_baseUniq-BSZbCXUo.js","./layout-FD28oy1q.js","./_basePickBy-Wzv49Akq.js","./clone-CotxwDmM.js","./cose-bilkent-S5V4N54A-DfIv6ajn.js","./cytoscape.esm-BQaXIfA_.js","./c4Diagram-IC4MRINW-B-CGuYcX.js","./chunk-JSJVCQXG-BC0wOWQH.js","./flowDiagram-PKNHOUZH-B9Jj988m.js","./chunk-FMBD7UC4-2VH4w1Cm.js","./chunk-55IACEB6-BjhCFTwZ.js","./chunk-KX2RTZJC-D9HDfnhZ.js","./channel-Cfw0FcZ8.js","./erDiagram-INFDFZHY-Ba0tZtxl.js","./gitGraphDiagram-K3NZZRJ6-mi0Lj_tL.js","./chunk-4BX2VUAB-CeqTXBvl.js","./chunk-QZHKN3VN-C9r4087v.js","./treemap-KZPCXAKY-7f24nLHF.js","./ganttDiagram-A5KZAMGK-CiMqI7tz.js","./linear-BfIO_UGQ.js","./defaultLocale-DX6XiGOO.js","./infoDiagram-LFFYTUFH-BBJROgHw.js","./pieDiagram-SKSYHLDU-Ckqgoc0S.js","./arc-DpjjQy8H.js","./quadrantDiagram-337W2JSQ-C-tMRbqn.js","./xychartDiagram-JWTSCODW-BsCy1_Gu.js","./requirementDiagram-Z7DCOOCP-KiArbbU4.js","./sequenceDiagram-2WXFIKYE-ChU2W22g.js","./classDiagram-VBA2DB6C-luXaKhEX.js","./chunk-WL4C6EOR-BMdij3qU.js","./classDiagram-v2-RAHNMMFH-luXaKhEX.js","./stateDiagram-RAJIS63D-CYfNyeS2.js","./chunk-NQ4KR5QH-SwWifZ9F.js","./stateDiagram-v2-FVOUBMTO-CQ11roi0.js","./journeyDiagram-4ABVD52K-Cee9gxbo.js","./timeline-definition-YZTLITO2-BNGiq9yT.js","./mindmap-definition-YRQLILUH-BDhKfywd.js","./kanban-definition-K7BYSVSG-DZx02Jgo.js","./diagram-P4PSJMXO-BV4mV-cp.js","./diagram-IFDJBPK2-DBOK9xY-.js","./blockDiagram-WCTKOSBZ-Dg5vNEHV.js","./architectureDiagram-2XIMDMQ5-C6zyje39.js","./diagram-E7M64L7V-CzOQpmHA.js"])))=>i.map(i=>d[i]);
2
2
  var _he=Object.defineProperty;var whe=(e,r,n)=>r in e?_he(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n;var ze=(e,r,n)=>whe(e,typeof r!="symbol"?r+"":r,n);function She(e,r){for(var n=0;n<r.length;n++){const i=r[n];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(i,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>i[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function z0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function w1t(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var r=e.default;if(typeof r=="function"){var n=function i(){return this instanceof i?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};n.prototype=r.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}),n}var oN={exports:{}},Zx={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -861,7 +861,7 @@ Referenced files:
861
861
  `,n=e.indexOf(r);if(n===-1)return{text:e,files:[],displaySegments:h5(e)};const i=e.slice(0,n).trimEnd(),s=e.slice(n+r.length),o=[];for(const a of s.split(`
862
862
  `)){const l=a.match(/^- (.+)$/);if(!l)continue;const d=l[1].trim();o.push({path:d,name:d.split(/[\\/]/).pop()??d})}return{text:i,files:o,displaySegments:h5(i,o)}}function QJ(e){return As(e).map(r=>r.type==="text"?r.text:r.type==="file"?`@${r.path}${sB(r.lineRange)}`:r.type==="workspace"?`[workspace:${r.path}]`:r.type==="terminal"?`[terminal:${r.terminalId}${sB(r.lineRange)}]`:`[image:${r.name}]`).join("")}function h8e(e){var o,a,l,d;if(!e.includes("@")&&!e.includes("[terminal:")&&!e.includes("[workspace:"))return[];const r=[],n=/(^|[\s(])(?:@([A-Za-z0-9._-]+(?:\/[A-Za-z0-9._-]+)*)(#L\d+(?:-L\d+)?)?|\[terminal:([A-Za-z0-9._:-]+)(#L\d+(?:-L\d+)?)?\]|\[workspace:([^\]]+)\])/g;let i=0;for(const u of e.matchAll(n)){const f=u.index??-1;if(f<0)continue;const p=u[0]??"",g=u[1]??"",v=(o=u[2])==null?void 0:o.trim(),b=oB(u[3]),_=(a=u[4])==null?void 0:a.trim(),S=oB(u[5]),w=(l=u[6])==null?void 0:l.trim(),C=f+g.length;C>i&&r.push({type:"text",text:e.slice(i,C)}),v?(r.push({type:"file",path:v,name:v.split("/").pop()||v,...b?{lineRange:b}:{}}),i=C+1+v.length+(((d=u[3])==null?void 0:d.length)??0)):_?(r.push({type:"terminal",terminalId:_,name:_,...S?{lineRange:S}:{}}),i=f+p.length):w?(r.push({type:"workspace",path:w,name:w.split(/[\\/]/).pop()||w}),i=f+p.length):(r.push({type:"text",text:p}),i=f+p.length)}i<e.length&&r.push({type:"text",text:e.slice(i)});const s=As(r);return s.some(u=>u.type==="file"||u.type==="workspace"||u.type==="terminal")?s:[]}function eQ(e){const r=As(e);return r.length>0?JSON.stringify({version:1,segments:r}):null}function f8e(e){if(!e)return[];try{const r=JSON.parse(e);return r.version!==1?[]:M9(r.segments)}catch{return[]}}function M9(e){if(!Array.isArray(e))return[];const r=[];for(const n of e){if(!n||typeof n!="object")continue;const i=n;if(i.type==="text"&&typeof i.text=="string"){r.push({type:"text",text:i.text});continue}if(i.type==="file"&&typeof i.path=="string"){r.push({type:"file",path:i.path,name:typeof i.name=="string"?i.name:i.path.split(/[\\/]/).pop()??i.path,...i.kind==="file"||i.kind==="dir"?{kind:i.kind}:{},...ik(i)?{lineRange:ik(i)}:{}});continue}if(i.type==="workspace"&&typeof i.path=="string"){r.push({type:"workspace",path:i.path,name:typeof i.name=="string"?i.name:i.path.split(/[\\/]/).pop()??i.path});continue}if(i.type==="terminal"&&typeof i.terminalId=="string"){r.push({type:"terminal",terminalId:i.terminalId,name:typeof i.name=="string"?i.name:i.terminalId,...typeof i.workspaceRoot=="string"?{workspaceRoot:i.workspaceRoot}:{},...ik(i)?{lineRange:ik(i)}:{},...typeof i.selectedText=="string"?{selectedText:i.selectedText}:{}});continue}i.type==="image"&&typeof i.data=="string"&&typeof i.mimeType=="string"&&i.mimeType.startsWith("image/")&&r.push({type:"image",data:i.data,mimeType:i.mimeType,name:typeof i.name=="string"?i.name:"Image"})}return As(r)}function Rf(e){if(!e)return null;const r=Number.isFinite(e.startLine)?Math.max(1,Math.floor(e.startLine)):0,n=Number.isFinite(e.endLine)?Math.max(r,Math.floor(e.endLine)):0;return r>0&&n>=r?{startLine:r,endLine:n}:null}function o2(e){const r=Rf(e);return r?r.startLine===r.endLine?`line ${r.startLine}`:`lines ${r.startLine}-${r.endLine}`:""}function sB(e){const r=Rf(e);return r?r.startLine===r.endLine?`#L${r.startLine}`:`#L${r.startLine}-L${r.endLine}`:""}function tQ(e,r){const n=Rf(r);return n?`${e}:L${n.startLine}-L${n.endLine}`:e}function ik(e){const r=e.lineRange;if(!r||typeof r!="object")return null;const n=r;return Rf({startLine:typeof n.startLine=="number"?n.startLine:Number.NaN,endLine:typeof n.endLine=="number"?n.endLine:Number.NaN})}function oB(e){if(!e)return null;const r=e.match(/^#L(\d+)(?:-L(\d+))?$/);if(!r)return null;const n=Number.parseInt(r[1]??"",10),i=r[2]?Number.parseInt(r[2],10):n;return Rf({startLine:n,endLine:i})}function rQ(e,r){const n=e.trim();if(!n)return null;const i=d8e(n,r);return{text:n,referencedFiles:Z1(i),displaySegments:i}}function p8e(e,r,n){const i=rQ(e,n);return i?i.text===r.trim()&&JSON.stringify(i.displaySegments)===JSON.stringify(n??[]):!1}const lT=[{value:"ask",label:"Ask",icon:Sm,description:"Read-only — questions, explanations, analysis"},{value:"agent",label:"Agent",icon:lK,description:"Full agentic — reads, writes, runs commands"},{value:"plan",label:"Plan",icon:Hge,description:"Propose changes — review before executing"}];function m8e({mode:e,onChange:r,disabled:n,className:i,compact:s=!1}){const o=lT.find(l=>l.value===e)??lT[1],a=o.icon;return c.jsxs(mu,{children:[c.jsx(gu,{asChild:!0,disabled:n,children:c.jsxs("button",{type:"button",className:We("flex h-8 items-center gap-1 rounded-md border border-transparent px-1.5 py-1 text-xs font-medium text-muted-foreground","hover:text-foreground hover:bg-muted/60 transition-colors","focus-visible:outline-none focus-visible:border-ring/60 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring/50","disabled:pointer-events-none disabled:opacity-50",i),title:`Mode: ${o.label}`,children:[c.jsx(a,{className:"h-4 w-4"}),!s&&c.jsx("span",{children:o.label}),c.jsx(hl,{className:"h-3 w-3 opacity-60"})]})}),c.jsx(kc,{align:"start",side:"top",className:"w-64",children:lT.map(l=>{const d=l.icon,u=e===l.value;return c.jsxs(Wi,{onClick:()=>r(l.value),className:"flex items-start gap-2.5 py-2 cursor-pointer",children:[c.jsx(d,{className:"h-4 w-4 mt-0.5 shrink-0"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"text-sm font-medium",children:l.label}),c.jsx("div",{className:"text-xs text-muted-foreground",children:l.description})]}),u&&c.jsx(hs,{className:"h-4 w-4 mt-0.5 shrink-0 text-primary"})]},l.value)})})]})}const cT=[{value:"normal",label:"Normal",icon:J0e,description:"Default Jait tone with normal explanatory prose"},{value:"simple",label:"Simple",icon:a0e,description:"Shorter, cleaner, less filler. Keep normal grammar."},{value:"caveman",label:"Caveman",icon:sD,description:"Terse fragments, minimal filler, exact technical meaning."},{value:"caveman-ultra",label:"Caveman Ultra",icon:sD,description:"Maximum compression. Use when shortness matters most."}];function g8e({value:e,onChange:r,disabled:n,className:i,compact:s=!1}){const o=cT.find(l=>l.value===e)??cT[0],a=o.icon;return c.jsxs(mu,{children:[c.jsx(gu,{asChild:!0,disabled:n,children:c.jsxs("button",{type:"button",className:We("flex h-8 items-center gap-1 rounded-md border border-transparent px-1.5 py-1 text-xs font-medium text-muted-foreground","hover:text-foreground hover:bg-muted/60 transition-colors","focus-visible:outline-none focus-visible:border-ring/60 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring/50","disabled:pointer-events-none disabled:opacity-50",i),title:`Style: ${o.label}`,children:[c.jsx(a,{className:"h-4 w-4"}),!s&&c.jsx("span",{children:o.label}),c.jsx(hl,{className:"h-3 w-3 opacity-60"})]})}),c.jsx(kc,{align:"start",side:"top",className:"w-64",children:cT.map(l=>{const d=l.icon,u=e===l.value;return c.jsxs(Wi,{onClick:()=>r(l.value),className:"flex items-start gap-2.5 py-2 cursor-pointer",children:[c.jsx(d,{className:"h-4 w-4 mt-0.5 shrink-0"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"text-sm font-medium",children:l.label}),c.jsx("div",{className:"text-xs text-muted-foreground",children:l.description})]}),u&&c.jsx(hs,{className:"h-4 w-4 mt-0.5 shrink-0 text-primary"})]},l.value)})})]})}const y8e=768,v8e=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i,x8e=1024;function b8e(e=window){if(e.innerWidth<y8e)return!0;const n=e.navigator.userAgentData;if(n!=null&&n.mobile||v8e.test(e.navigator.userAgent))return!0;const i=typeof e.matchMedia=="function"?e.matchMedia("(pointer: coarse)").matches:!1,s=Math.min(e.innerWidth,e.innerHeight);return i&&s<=x8e}function Cv(){const e=()=>b8e(),[r,n]=y.useState(e);return y.useEffect(()=>{const i=()=>n(e());return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]),r}const aB=[{value:"agent",label:"Agent",icon:lK,description:"Send to the current coding chat session"},{value:"thread",label:"Thread",icon:u0,description:"Create or continue an automation thread for the selected repo"}];function nQ({target:e,onChange:r,disabled:n,className:i,compact:s=!1}){const o=Cv(),a=s||o,l=aB.findIndex(u=>u.value===e),d=l>=0?l:0;return c.jsxs("div",{role:"tablist","aria-label":"Send target",className:We("relative inline-grid h-8 grid-cols-2 rounded-lg border border-border/70 bg-muted/40 p-0.5","shadow-sm transition-colors",n&&"pointer-events-none opacity-50",i),children:[c.jsx("div",{"aria-hidden":"true",className:"absolute inset-y-0.5 left-0.5 w-[calc(50%-2px)] rounded-md bg-background shadow-sm transition-transform duration-200 ease-out",style:{transform:`translateX(${d*100}%)`}}),aB.map(u=>{const f=u.icon,p=e===u.value;return c.jsxs("button",{type:"button",role:"tab","aria-selected":p,"aria-label":u.label,title:`${u.label}: ${u.description}`,disabled:n,onClick:()=>r(u.value),className:We("relative z-10 flex min-w-0 items-center justify-center gap-1.5 rounded-md px-2 text-xs font-medium","transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",p?"text-foreground":"text-muted-foreground hover:text-foreground",a?"w-9":"min-w-[5.25rem]"),children:[c.jsx(f,{className:"h-3.5 w-3.5 shrink-0"}),!a&&c.jsx("span",{children:u.label})]},u.value)})]})}var iQ="comm",sQ="rule",oQ="decl",_8e="@import",w8e="@namespace",S8e="@keyframes",k8e="@layer",aQ=Math.abs,P9=String.fromCharCode;function lQ(e){return e.trim()}function lC(e,r,n){return e.replace(r,n)}function C8e(e,r,n){return e.indexOf(r,n)}function N1(e,r){return e.charCodeAt(r)|0}function J1(e,r,n){return e.slice(r,n)}function fh(e){return e.length}function j8e(e){return e.length}function sk(e,r){return r.push(e),e}var jj=1,Q1=1,cQ=0,wu=0,Fs=0,jv="";function L9(e,r,n,i,s,o,a,l){return{value:e,root:r,parent:n,type:i,props:s,children:o,line:jj,column:Q1,length:a,return:"",siblings:l}}function N8e(){return Fs}function T8e(){return Fs=wu>0?N1(jv,--wu):0,Q1--,Fs===10&&(Q1=1,jj--),Fs}function vd(){return Fs=wu<cQ?N1(jv,wu++):0,Q1++,Fs===10&&(Q1=1,jj++),Fs}function km(){return N1(jv,wu)}function cC(){return wu}function Nj(e,r){return J1(jv,e,r)}function a2(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function E8e(e){return jj=Q1=1,cQ=fh(jv=e),wu=0,[]}function A8e(e){return jv="",e}function uT(e){return lQ(Nj(wu-1,pA(e===91?e+2:e===40?e+1:e)))}function O8e(e){for(;(Fs=km())&&Fs<33;)vd();return a2(e)>2||a2(Fs)>3?"":" "}function R8e(e,r){for(;--r&&vd()&&!(Fs<48||Fs>102||Fs>57&&Fs<65||Fs>70&&Fs<97););return Nj(e,cC()+(r<6&&km()==32&&vd()==32))}function pA(e){for(;vd();)switch(Fs){case e:return wu;case 34:case 39:e!==34&&e!==39&&pA(Fs);break;case 40:e===41&&pA(e);break;case 92:vd();break}return wu}function M8e(e,r){for(;vd()&&e+Fs!==57;)if(e+Fs===84&&km()===47)break;return"/*"+Nj(r,wu-1)+"*"+P9(e===47?e:vd())}function P8e(e){for(;!a2(km());)vd();return Nj(e,wu)}function L8e(e){return A8e(uC("",null,null,null,[""],e=E8e(e),0,[0],e))}function uC(e,r,n,i,s,o,a,l,d){for(var u=0,f=0,p=a,g=0,v=0,b=0,_=1,S=1,w=1,C=0,j="",N=s,A=o,E=i,R=j;S;)switch(b=C,C=vd()){case 40:if(b!=108&&N1(R,p-1)==58){C8e(R+=lC(uT(C),"&","&\f"),"&\f",aQ(u?l[u-1]:0))!=-1&&(w=-1);break}case 34:case 39:case 91:R+=uT(C);break;case 9:case 10:case 13:case 32:R+=O8e(b);break;case 92:R+=R8e(cC()-1,7);continue;case 47:switch(km()){case 42:case 47:sk($8e(M8e(vd(),cC()),r,n,d),d),(a2(b||1)==5||a2(km()||1)==5)&&fh(R)&&J1(R,-1,void 0)!==" "&&(R+=" ");break;default:R+="/"}break;case 123*_:l[u++]=fh(R)*w;case 125*_:case 59:case 0:switch(C){case 0:case 125:S=0;case 59+f:w==-1&&(R=lC(R,/\f/g,"")),v>0&&(fh(R)-p||_===0&&b===47)&&sk(v>32?cB(R+";",i,n,p-1,d):cB(lC(R," ","")+";",i,n,p-2,d),d);break;case 59:R+=";";default:if(sk(E=lB(R,r,n,u,f,s,l,j,N=[],A=[],p,o),o),C===123)if(f===0)uC(R,r,E,E,N,o,p,l,A);else{switch(g){case 99:if(N1(R,3)===110)break;case 108:if(N1(R,2)===97)break;default:f=0;case 100:case 109:case 115:}f?uC(e,E,E,i&&sk(lB(e,E,E,0,0,s,l,j,s,N=[],p,A),A),s,A,p,l,i?N:A):uC(R,E,E,E,[""],A,0,l,A)}}u=f=v=0,_=w=1,j=R="",p=a;break;case 58:p=1+fh(R),v=b;default:if(_<1){if(C==123)--_;else if(C==125&&_++==0&&T8e()==125)continue}switch(R+=P9(C),C*_){case 38:w=f>0?1:(R+="\f",-1);break;case 44:l[u++]=(fh(R)-1)*w,w=1;break;case 64:km()===45&&(R+=uT(vd())),g=km(),f=p=fh(j=R+=P8e(cC())),C++;break;case 45:b===45&&fh(R)==2&&(_=0)}}return o}function lB(e,r,n,i,s,o,a,l,d,u,f,p){for(var g=s-1,v=s===0?o:[""],b=j8e(v),_=0,S=0,w=0;_<i;++_)for(var C=0,j=J1(e,g+1,g=aQ(S=a[_])),N=e;C<b;++C)(N=lQ(S>0?v[C]+" "+j:lC(j,/&\f/g,v[C])))&&(d[w++]=N);return L9(e,r,n,s===0?sQ:l,d,u,f,p)}function $8e(e,r,n,i){return L9(e,r,n,iQ,P9(N8e()),J1(e,2,-2),0,i)}function cB(e,r,n,i,s){return L9(e,r,n,oQ,J1(e,0,i),J1(e,i+1,-1),i,s)}function mA(e,r){for(var n="",i=0;i<e.length;i++)n+=r(e[i],i,e,r)||"";return n}function D8e(e,r,n,i){switch(e.type){case k8e:if(e.children.length)break;case _8e:case w8e:case oQ:return e.return=e.return||e.value;case iQ:return"";case S8e:return e.return=e.value+"{"+mA(e.children,i)+"}";case sQ:if(!fh(e.value=e.props.join(",")))return""}return fh(n=mA(e.children,i))?e.return=e.value+"{"+n+"}":""}var dC={exports:{}},I8e=dC.exports,uB;function B8e(){return uB||(uB=1,(function(e,r){(function(n,i){e.exports=i()})(I8e,(function(){var n=1e3,i=6e4,s=36e5,o="millisecond",a="second",l="minute",d="hour",u="day",f="week",p="month",g="quarter",v="year",b="date",_="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(M){var I=["th","st","nd","rd"],P=M%100;return"["+M+(I[(P-20)%10]||I[P]||I[0])+"]"}},j=function(M,I,P){var F=String(M);return!F||F.length>=I?M:""+Array(I+1-F.length).join(P)+M},N={s:j,z:function(M){var I=-M.utcOffset(),P=Math.abs(I),F=Math.floor(P/60),V=P%60;return(I<=0?"+":"-")+j(F,2,"0")+":"+j(V,2,"0")},m:function M(I,P){if(I.date()<P.date())return-M(P,I);var F=12*(P.year()-I.year())+(P.month()-I.month()),V=I.clone().add(F,p),Y=P-V<0,H=I.clone().add(F+(Y?-1:1),p);return+(-(F+(P-V)/(Y?V-H:H-V))||0)},a:function(M){return M<0?Math.ceil(M)||0:Math.floor(M)},p:function(M){return{M:p,y:v,w:f,d:u,D:b,h:d,m:l,s:a,ms:o,Q:g}[M]||String(M||"").toLowerCase().replace(/s$/,"")},u:function(M){return M===void 0}},A="en",E={};E[A]=C;var R="$isDayjsObject",L=function(M){return M instanceof B||!(!M||!M[R])},z=function M(I,P,F){var V;if(!I)return A;if(typeof I=="string"){var Y=I.toLowerCase();E[Y]&&(V=Y),P&&(E[Y]=P,V=Y);var H=I.split("-");if(!V&&H.length>1)return M(H[0])}else{var U=I.name;E[U]=I,V=U}return!F&&V&&(A=V),V||!F&&A},$=function(M,I){if(L(M))return M.clone();var P=typeof I=="object"?I:{};return P.date=M,P.args=arguments,new B(P)},W=N;W.l=z,W.i=L,W.w=function(M,I){return $(M,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var B=(function(){function M(P){this.$L=z(P.locale,null,!0),this.parse(P),this.$x=this.$x||P.x||{},this[R]=!0}var I=M.prototype;return I.parse=function(P){this.$d=(function(F){var V=F.date,Y=F.utc;if(V===null)return new Date(NaN);if(W.u(V))return new Date;if(V instanceof Date)return new Date(V);if(typeof V=="string"&&!/Z$/i.test(V)){var H=V.match(S);if(H){var U=H[2]-1||0,J=(H[7]||"0").substring(0,3);return Y?new Date(Date.UTC(H[1],U,H[3]||1,H[4]||0,H[5]||0,H[6]||0,J)):new Date(H[1],U,H[3]||1,H[4]||0,H[5]||0,H[6]||0,J)}}return new Date(V)})(P),this.init()},I.init=function(){var P=this.$d;this.$y=P.getFullYear(),this.$M=P.getMonth(),this.$D=P.getDate(),this.$W=P.getDay(),this.$H=P.getHours(),this.$m=P.getMinutes(),this.$s=P.getSeconds(),this.$ms=P.getMilliseconds()},I.$utils=function(){return W},I.isValid=function(){return this.$d.toString()!==_},I.isSame=function(P,F){var V=$(P);return this.startOf(F)<=V&&V<=this.endOf(F)},I.isAfter=function(P,F){return $(P)<this.startOf(F)},I.isBefore=function(P,F){return this.endOf(F)<$(P)},I.$g=function(P,F,V){return W.u(P)?this[F]:this.set(V,P)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function(P,F){var V=this,Y=!!W.u(F)||F,H=W.p(P),U=function(ie,ge){var le=W.w(V.$u?Date.UTC(V.$y,ge,ie):new Date(V.$y,ge,ie),V);return Y?le:le.endOf(u)},J=function(ie,ge){return W.w(V.toDate()[ie].apply(V.toDate("s"),(Y?[0,0,0,0]:[23,59,59,999]).slice(ge)),V)},q=this.$W,ee=this.$M,te=this.$D,ue="set"+(this.$u?"UTC":"");switch(H){case v:return Y?U(1,0):U(31,11);case p:return Y?U(1,ee):U(0,ee+1);case f:var fe=this.$locale().weekStart||0,re=(q<fe?q+7:q)-fe;return U(Y?te-re:te+(6-re),ee);case u:case b:return J(ue+"Hours",0);case d:return J(ue+"Minutes",1);case l:return J(ue+"Seconds",2);case a:return J(ue+"Milliseconds",3);default:return this.clone()}},I.endOf=function(P){return this.startOf(P,!1)},I.$set=function(P,F){var V,Y=W.p(P),H="set"+(this.$u?"UTC":""),U=(V={},V[u]=H+"Date",V[b]=H+"Date",V[p]=H+"Month",V[v]=H+"FullYear",V[d]=H+"Hours",V[l]=H+"Minutes",V[a]=H+"Seconds",V[o]=H+"Milliseconds",V)[Y],J=Y===u?this.$D+(F-this.$W):F;if(Y===p||Y===v){var q=this.clone().set(b,1);q.$d[U](J),q.init(),this.$d=q.set(b,Math.min(this.$D,q.daysInMonth())).$d}else U&&this.$d[U](J);return this.init(),this},I.set=function(P,F){return this.clone().$set(P,F)},I.get=function(P){return this[W.p(P)]()},I.add=function(P,F){var V,Y=this;P=Number(P);var H=W.p(F),U=function(ee){var te=$(Y);return W.w(te.date(te.date()+Math.round(ee*P)),Y)};if(H===p)return this.set(p,this.$M+P);if(H===v)return this.set(v,this.$y+P);if(H===u)return U(1);if(H===f)return U(7);var J=(V={},V[l]=i,V[d]=s,V[a]=n,V)[H]||1,q=this.$d.getTime()+P*J;return W.w(q,this)},I.subtract=function(P,F){return this.add(-1*P,F)},I.format=function(P){var F=this,V=this.$locale();if(!this.isValid())return V.invalidDate||_;var Y=P||"YYYY-MM-DDTHH:mm:ssZ",H=W.z(this),U=this.$H,J=this.$m,q=this.$M,ee=V.weekdays,te=V.months,ue=V.meridiem,fe=function(ge,le,et,Xe){return ge&&(ge[le]||ge(F,Y))||et[le].slice(0,Xe)},re=function(ge){return W.s(U%12||12,ge,"0")},ie=ue||function(ge,le,et){var Xe=ge<12?"AM":"PM";return et?Xe.toLowerCase():Xe};return Y.replace(w,(function(ge,le){return le||(function(et){switch(et){case"YY":return String(F.$y).slice(-2);case"YYYY":return W.s(F.$y,4,"0");case"M":return q+1;case"MM":return W.s(q+1,2,"0");case"MMM":return fe(V.monthsShort,q,te,3);case"MMMM":return fe(te,q);case"D":return F.$D;case"DD":return W.s(F.$D,2,"0");case"d":return String(F.$W);case"dd":return fe(V.weekdaysMin,F.$W,ee,2);case"ddd":return fe(V.weekdaysShort,F.$W,ee,3);case"dddd":return ee[F.$W];case"H":return String(U);case"HH":return W.s(U,2,"0");case"h":return re(1);case"hh":return re(2);case"a":return ie(U,J,!0);case"A":return ie(U,J,!1);case"m":return String(J);case"mm":return W.s(J,2,"0");case"s":return String(F.$s);case"ss":return W.s(F.$s,2,"0");case"SSS":return W.s(F.$ms,3,"0");case"Z":return H}return null})(ge)||H.replace(":","")}))},I.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},I.diff=function(P,F,V){var Y,H=this,U=W.p(F),J=$(P),q=(J.utcOffset()-this.utcOffset())*i,ee=this-J,te=function(){return W.m(H,J)};switch(U){case v:Y=te()/12;break;case p:Y=te();break;case g:Y=te()/3;break;case f:Y=(ee-q)/6048e5;break;case u:Y=(ee-q)/864e5;break;case d:Y=ee/s;break;case l:Y=ee/i;break;case a:Y=ee/n;break;default:Y=ee}return V?Y:W.a(Y)},I.daysInMonth=function(){return this.endOf(p).$D},I.$locale=function(){return E[this.$L]},I.locale=function(P,F){if(!P)return this.$L;var V=this.clone(),Y=z(P,F,!0);return Y&&(V.$L=Y),V},I.clone=function(){return W.w(this.$d,this)},I.toDate=function(){return new Date(this.valueOf())},I.toJSON=function(){return this.isValid()?this.toISOString():null},I.toISOString=function(){return this.$d.toISOString()},I.toString=function(){return this.$d.toUTCString()},M})(),K=B.prototype;return $.prototype=K,[["$ms",o],["$s",a],["$m",l],["$H",d],["$W",u],["$M",p],["$y",v],["$D",b]].forEach((function(M){K[M[1]]=function(I){return this.$g(I,M[0],M[1])}})),$.extend=function(M,I){return M.$i||(M(I,B,$),M.$i=!0),$},$.locale=z,$.isDayjs=L,$.unix=function(M){return $(1e3*M)},$.en=E[A],$.Ls=E,$.p={},$}))})(dC)),dC.exports}var z8e=B8e();const F8e=z0(z8e);var H8e=function(r){return typeof window<"u"?matchMedia&&matchMedia("(prefers-color-scheme: ".concat(r,")")):{matches:!1}},dT,W8e=y.createContext({appearance:"light",setAppearance:function(){},isDarkMode:!1,themeMode:"light",setThemeMode:function(){},browserPrefers:(dT=H8e("dark"))!==null&&dT!==void 0&&dT.matches?"dark":"light"}),U8e=function(){return y.useContext(W8e)};const uQ=(e,r)=>{if(r)return"row";switch(e){case"horizontal":return"row";case"horizontal-reverse":return"row-reverse";case"vertical":default:return"column";case"vertical-reverse":return"column-reverse"}},V8e=e=>{if(e)return["space-between","space-around","space-evenly"].includes(e)},q8e=(e,r)=>uQ(e,r)==="row",Xy=e=>typeof e=="number"?`${e}px`:e,G8e=({visible:e,flex:r,gap:n,direction:i,horizontal:s,align:o,justify:a,distribution:l,height:d,width:u,allowShrink:f,padding:p,paddingInline:g,paddingBlock:v,prefixCls:b,as:_="div",className:S,style:w,children:C,wrap:j,ref:N,...A})=>{const E=a||l,L=q8e(i,s)&&!u&&V8e(E)?"100%":Xy(u),z={...r!==void 0?{"--lobe-flex":String(r)}:{},...i||s?{"--lobe-flex-direction":uQ(i,s)}:{},...j!==void 0?{"--lobe-flex-wrap":j}:{},...E!==void 0?{"--lobe-flex-justify":E}:{},...o!==void 0?{"--lobe-flex-align":o}:{},...L!==void 0?{"--lobe-flex-width":L}:{},...d!==void 0?{"--lobe-flex-height":Xy(d)}:{},...p!==void 0?{"--lobe-flex-padding":Xy(p)}:{},...g!==void 0?{"--lobe-flex-padding-inline":Xy(g)}:{},...v!==void 0?{"--lobe-flex-padding-block":Xy(v)}:{},...n!==void 0?{"--lobe-flex-gap":Xy(n)}:{},...f?{minWidth:0}:{},...w},$="lobe-flex",W=[$,e===!1?`${$}--hidden`:void 0,b?`${b}-flex`:void 0,S].filter(Boolean).join(" ");return c.jsx(_,{ref:N,...A,className:W,style:z,children:C})};var dQ=y.memo(G8e);const K8e=({children:e,ref:r,...n})=>c.jsx(dQ,{...n,align:"center",justify:"center",ref:r,children:e});var Y8e=K8e;const X8e=new RegExp("\\p{Lu}?\\p{Ll}+|[0-9]+|\\p{Lu}+(?!\\p{Ll})|\\p{Emoji_Presentation}|\\p{Extended_Pictographic}|\\p{L}+","gu");function Z8e(e){return Array.from(e.match(X8e)??[])}function hQ(e){return Z8e(e).map(n=>n.toLowerCase()).join("-")}y.createContext(null);var J8e=function(r,n){if(n){if(r&&n==="#000")return"0 0 0 1px rgba(255,255,255,0.1) inset";if(!r&&n==="#fff")return"0 0 0 1px rgba(0,0,0,0.05) inset"}};function l2(e){"@babel/helpers - typeof";return l2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},l2(e)}var Q8e=["shape","color","background","size","style","iconMultiple","Icon","iconStyle","iconClassName"];function dB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function ok(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?dB(Object(n),!0).forEach(function(i){eAe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function eAe(e,r,n){return r=tAe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function tAe(e){var r=rAe(e,"string");return l2(r)=="symbol"?r:String(r)}function rAe(e,r){if(l2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(l2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function nAe(e,r){if(e==null)return{};var n=iAe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function iAe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var pl=y.memo(function(e){var r=e.shape,n=r===void 0?"circle":r,i=e.color,s=i===void 0?"#fff":i,o=e.background,a=e.size,l=e.style,d=e.iconMultiple,u=d===void 0?.75:d,f=e.Icon,p=e.iconStyle,g=e.iconClassName,v=nAe(e,Q8e),b=U8e(),_=b.isDarkMode;return c.jsx(Y8e,ok(ok({flex:"none",style:ok({background:o,borderRadius:n==="circle"?"50%":Math.floor(a*.1),boxShadow:J8e(_,o),color:s,height:a,width:a},l)},v),{},{children:f&&c.jsx(f,{className:g,color:s,size:a,style:ok({transform:"scale(".concat(u,")")},p)})}))}),bS="OpenAI",sAe=.75,oAe=.1,fQ="#000",pQ="#19C37D",mQ="#AB68FF",gQ="#F86AA4",$9="#F9C322",yQ="#0099FF",vQ="#0000FE",aAe=fQ,lAe="#fff",cAe=.75;function c2(e){"@babel/helpers - typeof";return c2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},c2(e)}var uAe=["size","style"];function hB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function hT(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?hB(Object(n),!0).forEach(function(i){dAe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function dAe(e,r,n){return r=hAe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function hAe(e){var r=fAe(e,"string");return c2(r)=="symbol"?r:String(r)}function fAe(e,r){if(c2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(c2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function pAe(e,r){if(e==null)return{};var n=mAe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function mAe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var D9=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=pAe(e,uAe);return c.jsxs("svg",hT(hT({fill:"currentColor",fillRule:"evenodd",height:n,style:hT({flex:"none",lineHeight:1},i),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:bS}),c.jsx("path",{d:"M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z"})]}))});function u2(e){"@babel/helpers - typeof";return u2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},u2(e)}var gAe=["type"];function fB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function yAe(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?fB(Object(n),!0).forEach(function(i){vAe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function vAe(e,r,n){return r=xAe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function xAe(e){var r=bAe(e,"string");return u2(r)=="symbol"?r:String(r)}function bAe(e,r){if(u2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(u2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function _Ae(e,r){if(e==null)return{};var n=wAe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function wAe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var SAe=y.memo(function(e){var r=e.type,n=r===void 0?"normal":r,i=_Ae(e,gAe),s=y.useMemo(function(){switch(n){case"gpt3":return pQ;case"gpt4":return mQ;case"gpt5":return gQ;case"o3":case"o1":return $9;case"oss":return yQ;case"platform":return vQ;default:return aAe}},[n]);return c.jsx(pl,yAe({Icon:D9,"aria-label":bS,background:s,color:lAe,iconMultiple:cAe},i))});function d2(e){"@babel/helpers - typeof";return d2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},d2(e)}var kAe=["Icon","style","Text","color","size","spaceMultiple","textMultiple","extra","extraStyle","showText","showLogo","extraClassName","iconProps","inverse"];function pB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function om(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?pB(Object(n),!0).forEach(function(i){CAe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function CAe(e,r,n){return r=jAe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function jAe(e){var r=NAe(e,"string");return d2(r)=="symbol"?r:String(r)}function NAe(e,r){if(d2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(d2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function TAe(e,r){if(e==null)return{};var n=EAe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function EAe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var ml=y.memo(function(e){var r=e.Icon,n=e.style,i=e.Text,s=e.color,o=e.size,a=o===void 0?24:o,l=e.spaceMultiple,d=l===void 0?1:l,u=e.textMultiple,f=u===void 0?1:u,p=e.extra,g=e.extraStyle,v=e.showText,b=v===void 0?!0:v,_=e.showLogo,S=_===void 0?!0:_,w=e.extraClassName,C=e.iconProps,j=e.inverse,N=TAe(e,kAe),A=r&&S&&c.jsx(r,om(om({size:a},C),{},{style:om(j?{marginLeft:a*d}:{marginRight:a*d},C==null?void 0:C.style)})),E=b&&i&&c.jsx(i,{size:a*f});return c.jsxs(dQ,om(om({align:"center",flex:"none",horizontal:!0,justify:"flex-start",style:om({color:s},n)},N),{},{children:[j?c.jsxs(c.Fragment,{children:[E,A]}):c.jsxs(c.Fragment,{children:[A,E]}),p&&c.jsx("span",{className:w,style:om({fontSize:a*f*.95,lineHeight:1},g),children:p})]}))});function h2(e){"@babel/helpers - typeof";return h2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},h2(e)}var AAe=["size","style"];function mB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function fT(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?mB(Object(n),!0).forEach(function(i){OAe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function OAe(e,r,n){return r=RAe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function RAe(e){var r=MAe(e,"string");return h2(r)=="symbol"?r:String(r)}function MAe(e,r){if(h2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(h2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function PAe(e,r){if(e==null)return{};var n=LAe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function LAe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var xQ=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=PAe(e,AAe);return c.jsxs("svg",fT(fT({fill:"currentColor",fillRule:"evenodd",height:n,style:fT({flex:"none",lineHeight:1},i),viewBox:"0 0 86 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:bS}),c.jsx("path",{d:"M10.703 2C5.916 2 2 5.916 2 10.703c0 4.787 3.916 8.704 8.703 8.704 4.787 0 8.704-3.893 8.704-8.704A8.698 8.698 0 0010.703 2zm0 14.288c-2.973 0-5.367-2.442-5.367-5.585S7.73 5.12 10.703 5.12c2.974 0 5.367 2.441 5.367 5.584s-2.393 5.585-5.367 5.585zM28.206 6.835c-1.57 0-3.094.629-3.892 1.693v-1.45h-3.143V24h3.143v-6.116c.798.99 2.273 1.523 3.892 1.523 3.385 0 6.045-2.66 6.045-6.286 0-3.626-2.66-6.286-6.044-6.286zm-.531 9.84c-1.79 0-3.385-1.402-3.385-3.554s1.596-3.554 3.385-3.554c1.789 0 3.384 1.402 3.384 3.554s-1.595 3.554-3.384 3.554zM41.649 6.835c-3.433 0-6.141 2.684-6.141 6.286 0 3.602 2.37 6.286 6.237 6.286 3.167 0 5.198-1.91 5.827-4.062h-3.07c-.388.895-1.475 1.523-2.78 1.523-1.62 0-2.854-1.136-3.144-2.756h9.139V12.88c0-3.288-2.297-6.044-6.068-6.044zm-3.047 5.053c.339-1.523 1.596-2.514 3.12-2.514 1.619 0 2.852 1.064 2.997 2.514h-6.117zM56.081 6.835c-1.402 0-2.877.629-3.553 1.669V7.077h-3.143v12.088h3.143v-6.503c0-1.886 1.015-3.119 2.659-3.119 1.523 0 2.345 1.16 2.345 2.78v6.842h3.143v-7.35c0-2.997-1.838-4.98-4.594-4.98zM68.724 2.242l-6.841 16.923h3.36l1.45-3.699h7.785l1.45 3.7h3.41L72.543 2.241h-3.82zm-.943 10.42l2.805-7.084 2.78 7.084H67.78zM83.81 2.242h-3.191v16.923h3.19V2.242z"})]}))});function f2(e){"@babel/helpers - typeof";return f2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},f2(e)}var $Ae=["extraStyle"];function gB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function yB(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?gB(Object(n),!0).forEach(function(i){DAe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function DAe(e,r,n){return r=IAe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function IAe(e){var r=BAe(e,"string");return f2(r)=="symbol"?r:String(r)}function BAe(e,r){if(f2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(f2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function zAe(e,r){if(e==null)return{};var n=FAe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function FAe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var HAe=y.memo(function(e){var r=e.extraStyle,n=zAe(e,$Ae);return c.jsx(ml,yB({Icon:D9,Text:xQ,"aria-label":bS,extraStyle:yB({fontWeight:600},r),spaceMultiple:oAe,textMultiple:sAe},n))}),es=D9;es.Text=xQ;es.Combine=HAe;es.Avatar=SAe;es.colorPrimary=fQ;es.colorGpt3=pQ;es.colorGpt4=mQ;es.colorGpt5=gQ;es.colorO1=$9;es.colorO3=$9;es.colorOss=yQ;es.colorPlatform=vQ;es.title=bS;var Nv="Claude",WAe=.8,UAe=.1,bQ="#D97757",VAe=bQ,qAe="#fff",GAe=.75;function p2(e){"@babel/helpers - typeof";return p2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},p2(e)}var KAe=["size","style"];function vB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function pT(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?vB(Object(n),!0).forEach(function(i){YAe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function YAe(e,r,n){return r=XAe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function XAe(e){var r=ZAe(e,"string");return p2(r)=="symbol"?r:String(r)}function ZAe(e,r){if(p2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(p2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function JAe(e,r){if(e==null)return{};var n=QAe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function QAe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var I9=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=JAe(e,KAe);return c.jsxs("svg",pT(pT({fill:"currentColor",fillRule:"evenodd",height:n,style:pT({flex:"none",lineHeight:1},i),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:Nv}),c.jsx("path",{d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z"})]}))});function m2(e){"@babel/helpers - typeof";return m2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},m2(e)}function xB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function eOe(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?xB(Object(n),!0).forEach(function(i){tOe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function tOe(e,r,n){return r=rOe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function rOe(e){var r=nOe(e,"string");return m2(r)=="symbol"?r:String(r)}function nOe(e,r){if(m2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(m2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function iOe(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var sOe=y.memo(function(e){var r=Object.assign({},(iOe(e),e));return c.jsx(pl,eOe({Icon:I9,"aria-label":Nv,background:VAe,color:qAe,iconMultiple:GAe},r))});function g2(e){"@babel/helpers - typeof";return g2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},g2(e)}var oOe=["size","style"];function bB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function mT(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?bB(Object(n),!0).forEach(function(i){aOe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function aOe(e,r,n){return r=lOe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function lOe(e){var r=cOe(e,"string");return g2(r)=="symbol"?r:String(r)}function cOe(e,r){if(g2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(g2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function uOe(e,r){if(e==null)return{};var n=dOe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function dOe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var _Q=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=uOe(e,oOe);return c.jsxs("svg",mT(mT({height:n,style:mT({flex:"none",lineHeight:1},i),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:Nv}),c.jsx("path",{d:"M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z",fill:"#D97757",fillRule:"nonzero"})]}))});function y2(e){"@babel/helpers - typeof";return y2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},y2(e)}var hOe=["size","style"];function _B(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function gT(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?_B(Object(n),!0).forEach(function(i){fOe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_B(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function fOe(e,r,n){return r=pOe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function pOe(e){var r=mOe(e,"string");return y2(r)=="symbol"?r:String(r)}function mOe(e,r){if(y2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(y2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function gOe(e,r){if(e==null)return{};var n=yOe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function yOe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var wQ=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=gOe(e,hOe);return c.jsxs("svg",gT(gT({fill:"currentColor",fillRule:"nonzero",height:n,style:gT({flex:"none",lineHeight:1},i),viewBox:"0 0 97 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:Nv}),c.jsx("path",{d:"M13.623 20.222c-3.417 0-5.753-1.901-6.855-4.827a12.992 12.992 0 01-.838-4.772c0-4.907 2.206-8.315 7.08-8.315 3.275 0 5.297 1.425 6.448 4.826h1.402l-.19-4.69C18.709 1.18 16.258.543 13.276.543c-4.2 0-7.775 1.874-9.763 5.254a11.357 11.357 0 00-1.511 5.872c0 3.753 1.777 7.08 5.113 8.926a11.95 11.95 0 005.943 1.398c3.254 0 5.835-.617 8.122-1.697l.593-5.172h-1.43c-.858 2.362-1.88 3.78-3.574 4.534-.831.373-1.88.564-3.146.564zm14.74-17.914L28.499 0h-.967L23.23 1.29v.699l1.907.882v16.142c0 1.1-.565 1.344-2.043 1.528v1.18h7.319v-1.18c-1.484-.184-2.042-.428-2.042-1.528V2.315l-.007-.007zm29.104 19.685h.565l4.95-.937v-1.208l-.695-.054c-1.157-.109-1.457-.346-1.457-1.29V9.897l.137-2.763h-.783l-4.678.672v1.181l.457.082c1.266.183 1.64.536 1.64 1.419v7.67c-1.212.937-2.369 1.527-3.744 1.527-1.525 0-2.471-.774-2.471-2.58V9.905l.136-2.763h-.804l-4.684.672v1.181l.484.082c1.266.183 1.64.536 1.64 1.418v7.08c0 3 1.703 4.426 4.412 4.426 2.07 0 3.765-1.1 5.038-2.627L57.474 22l-.007-.007zm-13.602-9.55c0-3.836-2.043-5.309-5.733-5.309-3.254 0-5.616 1.344-5.616 3.57 0 .666.238 1.175.721 1.528l2.478-.326c-.109-.746-.163-1.201-.163-1.391 0-1.263.674-1.901 2.042-1.901 2.022 0 3.044 1.419 3.044 3.7v.746l-5.106 1.527c-1.702.462-2.67.863-3.316 1.8a3.386 3.386 0 00-.476 1.9c0 2.172 1.497 3.706 4.057 3.706 1.852 0 3.493-.835 4.922-2.416.51 1.581 1.294 2.416 2.69 2.416 1.13 0 2.15-.455 3.063-1.344l-.272-.937a4.363 4.363 0 01-1.178.163c-.783 0-1.157-.617-1.157-1.826v-5.607zm-6.536 7.378c-1.396 0-2.26-.808-2.26-2.226 0-.964.456-1.528 1.43-1.854l4.139-1.31v3.965c-1.321.997-2.097 1.425-3.31 1.425zm43.095 1.235v-1.208l-.701-.054c-1.158-.109-1.45-.346-1.45-1.29V2.308L78.409 0h-.974l-4.302 1.29v.699l1.906.882V8.18a6.024 6.024 0 00-3.656-1.046c-4.276 0-7.612 3.245-7.612 8.098 0 3.998 2.397 6.761 6.346 6.761 2.042 0 3.819-.99 4.922-2.525l-.136 2.525h.571l4.95-.937zm-8.96-12.313c2.043 0 3.575 1.181 3.575 3.353v6.11a4.91 4.91 0 01-3.547 1.425c-2.928 0-4.412-2.308-4.412-5.39 0-3.462 1.695-5.498 4.385-5.498zm19.424 3.055c-.381-1.792-1.484-2.81-3.016-2.81-2.288 0-3.874 1.717-3.874 4.18 0 3.646 1.934 6.008 5.059 6.008a5.858 5.858 0 005.03-2.953l.913.245c-.408 3.163-3.281 5.525-6.808 5.525-4.14 0-6.992-3.054-6.992-7.399 0-4.378 3.098-7.46 7.237-7.46 3.09 0 5.27 1.853 5.97 5.07l-10.783 3.3V14.05l7.264-2.247v-.006z"})]}))});function v2(e){"@babel/helpers - typeof";return v2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},v2(e)}var vOe=["type"];function wB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function xOe(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?wB(Object(n),!0).forEach(function(i){bOe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function bOe(e,r,n){return r=_Oe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function _Oe(e){var r=wOe(e,"string");return v2(r)=="symbol"?r:String(r)}function wOe(e,r){if(v2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(v2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function SOe(e,r){if(e==null)return{};var n=kOe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function kOe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var COe=y.memo(function(e){var r=e.type,n=r===void 0?"mono":r,i=SOe(e,vOe),s=n==="color"?_Q:I9;return c.jsx(ml,xOe({Icon:s,Text:wQ,"aria-label":Nv,spaceMultiple:UAe,textMultiple:WAe},i))}),Fl=I9;Fl.Color=_Q;Fl.Text=wQ;Fl.Combine=COe;Fl.Avatar=sOe;Fl.colorPrimary=bQ;Fl.title=Nv;var w0="Gemini",jOe=.8,NOe=.2,SQ="#fff",TOe=SQ,EOe="#fff",AOe=.8,OOe=function(r){var n="lobe-icons-".concat(hQ(r),"-fill");return y.useMemo(function(){return{fill:"url(#".concat(n,")"),id:n}},[r])},Tj=function(r,n){return y.useMemo(function(){var i=Array.from({length:n},function(s,o){var a="lobe-icons-".concat(hQ(r),"-fill-").concat(o);return{fill:"url(#".concat(a,")"),id:a}});return i},[r,n])};function x2(e){"@babel/helpers - typeof";return x2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},x2(e)}var ROe=["size","style"];function SB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function yT(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?SB(Object(n),!0).forEach(function(i){MOe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function MOe(e,r,n){return r=POe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function POe(e){var r=LOe(e,"string");return x2(r)=="symbol"?r:String(r)}function LOe(e,r){if(x2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(x2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function $Oe(e,r){return zOe(e)||BOe(e,r)||IOe(e,r)||DOe()}function DOe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
863
863
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IOe(e,r){if(e){if(typeof e=="string")return kB(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kB(e,r)}}function kB(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,i=new Array(r);n<r;n++)i[n]=e[n];return i}function BOe(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i,s,o,a,l=[],d=!0,u=!1;try{if(o=(n=n.call(e)).next,r!==0)for(;!(d=(i=o.call(n)).done)&&(l.push(i.value),l.length!==r);d=!0);}catch(f){u=!0,s=f}finally{try{if(!d&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw s}}return l}}function zOe(e){if(Array.isArray(e))return e}function FOe(e,r){if(e==null)return{};var n=HOe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function HOe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var B9=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=FOe(e,ROe),o=Tj(w0,3),a=$Oe(o,3),l=a[0],d=a[1],u=a[2];return c.jsxs("svg",yT(yT({height:n,style:yT({flex:"none",lineHeight:1},i),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:w0}),c.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z",fill:"#3186FF"}),c.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z",fill:l.fill}),c.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z",fill:d.fill}),c.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z",fill:u.fill}),c.jsxs("defs",{children:[c.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:l.id,x1:"7",x2:"11",y1:"15.5",y2:"12",children:[c.jsx("stop",{stopColor:"#08B962"}),c.jsx("stop",{offset:"1",stopColor:"#08B962",stopOpacity:"0"})]}),c.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:d.id,x1:"8",x2:"11.5",y1:"5.5",y2:"11",children:[c.jsx("stop",{stopColor:"#F94543"}),c.jsx("stop",{offset:"1",stopColor:"#F94543",stopOpacity:"0"})]}),c.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:u.id,x1:"3.5",x2:"17.5",y1:"13.5",y2:"12",children:[c.jsx("stop",{stopColor:"#FABC12"}),c.jsx("stop",{offset:".46",stopColor:"#FABC12",stopOpacity:"0"})]})]})]}))});function b2(e){"@babel/helpers - typeof";return b2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},b2(e)}function CB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function WOe(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?CB(Object(n),!0).forEach(function(i){UOe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function UOe(e,r,n){return r=VOe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function VOe(e){var r=qOe(e,"string");return b2(r)=="symbol"?r:String(r)}function qOe(e,r){if(b2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(b2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function GOe(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var KOe=y.memo(function(e){var r=Object.assign({},(GOe(e),e));return c.jsx(pl,WOe({Icon:B9,"aria-label":w0,background:TOe,color:EOe,iconMultiple:AOe},r))});function _2(e){"@babel/helpers - typeof";return _2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_2(e)}var YOe=["size","style"];function jB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function vT(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?jB(Object(n),!0).forEach(function(i){XOe(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function XOe(e,r,n){return r=ZOe(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function ZOe(e){var r=JOe(e,"string");return _2(r)=="symbol"?r:String(r)}function JOe(e,r){if(_2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(_2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function QOe(e,r){if(e==null)return{};var n=e7e(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function e7e(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var kQ=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=QOe(e,YOe);return c.jsxs("svg",vT(vT({fill:"currentColor",fillRule:"evenodd",height:n,style:vT({flex:"none",lineHeight:1},i),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:w0}),c.jsx("path",{d:"M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z"})]}))});function w2(e){"@babel/helpers - typeof";return w2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},w2(e)}var t7e=["size","style"];function NB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function xT(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?NB(Object(n),!0).forEach(function(i){r7e(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function r7e(e,r,n){return r=n7e(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function n7e(e){var r=i7e(e,"string");return w2(r)=="symbol"?r:String(r)}function i7e(e,r){if(w2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(w2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function s7e(e,r){if(e==null)return{};var n=o7e(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function o7e(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var CQ=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=s7e(e,t7e);return c.jsxs("svg",xT(xT({fill:"currentColor",fillRule:"evenodd",height:n,style:xT({flex:"none",lineHeight:1},i),viewBox:"0 0 98 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:w0}),c.jsx("path",{d:"M21.186 12.67c0 2.649-.786 4.759-2.359 6.33-1.766 1.87-4.09 2.806-6.969 2.806-2.756 0-5.088-.953-6.996-2.86C2.954 17.04 2 14.693 2 11.904c0-2.789.954-5.137 2.862-7.043C6.77 2.953 9.102 2 11.858 2c1.396 0 2.712.247 3.949.741 1.236.495 2.252 1.192 3.047 2.092l-1.749 1.748c-.583-.706-1.338-1.258-2.266-1.655a7.49 7.49 0 00-2.981-.596c-2.067 0-3.816.715-5.247 2.145-1.413 1.448-2.12 3.257-2.12 5.428s.707 3.98 2.12 5.428c1.431 1.43 3.18 2.145 5.247 2.145 1.89 0 3.463-.53 4.717-1.588 1.254-1.06 1.979-2.516 2.173-4.37h-6.89v-2.277h9.196c.088.495.132.971.132 1.43m7.652-4.633c1.946 0 3.494.629 4.645 1.886 1.15 1.257 1.726 3.018 1.726 5.282l-.027.268H24.877c.036 1.284.464 2.318 1.285 3.102.82.785 1.802 1.177 2.944 1.177 1.57 0 2.802-.784 3.694-2.354l2.195 1.07a6.54 6.54 0 01-2.45 2.595C31.503 21.688 30.32 22 29 22c-1.927 0-3.516-.66-4.765-1.98-1.249-1.319-1.873-2.986-1.873-5.001 0-1.997.606-3.66 1.82-4.988 1.213-1.329 2.766-1.993 4.657-1.993m-.053 2.247c-.928 0-1.727.285-2.396.856-.67.57-1.11 1.337-1.325 2.3h7.522c-.071-.91-.442-1.663-1.111-2.26-.67-.598-1.566-.896-2.69-.896M39.247 21.53h-2.455V8.465h2.348v1.813h.107c.374-.64.947-1.173 1.721-1.6.774-.427 1.544-.64 2.309-.64.96 0 1.806.222 2.535.667a3.931 3.931 0 011.601 1.84c1.085-1.671 2.589-2.507 4.51-2.507 1.513 0 2.678.462 3.496 1.387.819.924 1.228 2.24 1.228 3.946v8.16h-2.455v-7.786c0-1.227-.223-2.112-.668-2.654-.444-.542-1.192-.813-2.241-.813-.943 0-1.735.4-2.375 1.2-.64.8-.961 1.742-.961 2.826v7.227h-2.455v-7.786c0-1.227-.223-2.112-.668-2.654-.444-.542-1.191-.813-2.241-.813-.943 0-1.735.4-2.375 1.2-.64.8-.961 1.742-.961 2.826v7.227zM61.911 3.93c0 .48-.17.89-.508 1.228a1.675 1.675 0 01-1.23.508c-.48 0-.89-.17-1.229-.508a1.673 1.673 0 01-.508-1.228c0-.481.17-.89.508-1.229a1.675 1.675 0 011.23-.508c.48 0 .89.17 1.23.508.338.338.507.748.507 1.228m-.11 4.514v13.088h-2.857V8.443h2.857zM80 3.93c0 .48-.17.89-.508 1.228a1.675 1.675 0 01-1.23.508c-.48 0-.89-.17-1.229-.508a1.673 1.673 0 01-.508-1.228c0-.481.17-.89.508-1.229a1.675 1.675 0 011.23-.508c.48 0 .89.17 1.23.508.338.338.507.748.507 1.228m-.11 4.514v13.088h-2.857V8.443h2.857zm-16.343.022h2.349v1.813h.107c.373-.64.947-1.173 1.721-1.6a4.935 4.935 0 012.415-.64c1.601 0 2.833.458 3.696 1.373.863.916 1.294 2.218 1.294 3.907v8.213h-2.455v-8.053c-.053-2.133-1.13-3.2-3.229-3.2-.978 0-1.797.395-2.455 1.187-.658.79-.987 1.737-.987 2.84v7.226h-2.456V8.465z"})]}))});function S2(e){"@babel/helpers - typeof";return S2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},S2(e)}var a7e=["type"];function TB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function l7e(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?TB(Object(n),!0).forEach(function(i){c7e(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function c7e(e,r,n){return r=u7e(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function u7e(e){var r=d7e(e,"string");return S2(r)=="symbol"?r:String(r)}function d7e(e,r){if(S2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(S2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function h7e(e,r){if(e==null)return{};var n=f7e(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function f7e(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var p7e=y.memo(function(e){var r=e.type,n=r===void 0?"mono":r,i=h7e(e,a7e),s=n==="color"?B9:kQ;return c.jsx(ml,l7e({Icon:s,Text:CQ,"aria-label":w0,spaceMultiple:NOe,textMultiple:jOe},i))}),Oh=kQ;Oh.Color=B9;Oh.Text=CQ;Oh.Combine=p7e;Oh.Avatar=KOe;Oh.colorPrimary=SQ;Oh.title=w0;var S0="Copilot",m7e=.8,g7e=.2,jQ="#fff",y7e=jQ,v7e="#fff",x7e=.75;function k2(e){"@babel/helpers - typeof";return k2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},k2(e)}var b7e=["size","style"];function EB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function bT(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?EB(Object(n),!0).forEach(function(i){_7e(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function _7e(e,r,n){return r=w7e(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function w7e(e){var r=S7e(e,"string");return k2(r)=="symbol"?r:String(r)}function S7e(e,r){if(k2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(k2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function k7e(e,r){return T7e(e)||N7e(e,r)||j7e(e,r)||C7e()}function C7e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
864
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function j7e(e,r){if(e){if(typeof e=="string")return AB(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return AB(e,r)}}function AB(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,i=new Array(r);n<r;n++)i[n]=e[n];return i}function N7e(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i,s,o,a,l=[],d=!0,u=!1;try{if(o=(n=n.call(e)).next,r!==0)for(;!(d=(i=o.call(n)).done)&&(l.push(i.value),l.length!==r);d=!0);}catch(f){u=!0,s=f}finally{try{if(!d&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw s}}return l}}function T7e(e){if(Array.isArray(e))return e}function E7e(e,r){if(e==null)return{};var n=A7e(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function A7e(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var z9=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=E7e(e,b7e),o=Tj(S0,6),a=k7e(o,6),l=a[0],d=a[1],u=a[2],f=a[3],p=a[4],g=a[5];return c.jsxs("svg",bT(bT({height:n,style:bT({flex:"none",lineHeight:1},i),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:S0}),c.jsx("path",{d:"M17.533 1.829A2.528 2.528 0 0015.11 0h-.737a2.531 2.531 0 00-2.484 2.087l-1.263 6.937.314-1.08a2.528 2.528 0 012.424-1.833h4.284l1.797.706 1.731-.706h-.505a2.528 2.528 0 01-2.423-1.829l-.715-2.453z",fill:l.fill,transform:"translate(0 1)"}),c.jsx("path",{d:"M6.726 20.16A2.528 2.528 0 009.152 22h1.566c1.37 0 2.49-1.1 2.525-2.48l.17-6.69-.357 1.228a2.528 2.528 0 01-2.423 1.83h-4.32l-1.54-.842-1.667.843h.497c1.124 0 2.113.75 2.426 1.84l.697 2.432z",fill:d.fill,transform:"translate(0 1)"}),c.jsx("path",{d:"M15 0H6.252c-2.5 0-4 3.331-5 6.662-1.184 3.947-2.734 9.225 1.75 9.225H6.78c1.13 0 2.12-.753 2.43-1.847.657-2.317 1.809-6.359 2.713-9.436.46-1.563.842-2.906 1.43-3.742A1.97 1.97 0 0115 0",fill:u.fill,transform:"translate(0 1)"}),c.jsx("path",{d:"M15 0H6.252c-2.5 0-4 3.331-5 6.662-1.184 3.947-2.734 9.225 1.75 9.225H6.78c1.13 0 2.12-.753 2.43-1.847.657-2.317 1.809-6.359 2.713-9.436.46-1.563.842-2.906 1.43-3.742A1.97 1.97 0 0115 0",fill:f.fill,transform:"translate(0 1)"}),c.jsx("path",{d:"M9 22h8.749c2.5 0 4-3.332 5-6.663 1.184-3.948 2.734-9.227-1.75-9.227H17.22c-1.129 0-2.12.754-2.43 1.848a1149.2 1149.2 0 01-2.713 9.437c-.46 1.564-.842 2.907-1.43 3.743A1.97 1.97 0 019 22",fill:p.fill,transform:"translate(0 1)"}),c.jsx("path",{d:"M9 22h8.749c2.5 0 4-3.332 5-6.663 1.184-3.948 2.734-9.227-1.75-9.227H17.22c-1.129 0-2.12.754-2.43 1.848a1149.2 1149.2 0 01-2.713 9.437c-.46 1.564-.842 2.907-1.43 3.743A1.97 1.97 0 019 22",fill:g.fill,transform:"translate(0 1)"}),c.jsxs("defs",{children:[c.jsxs("radialGradient",{cx:"85.44%",cy:"100.653%",fx:"85.44%",fy:"100.653%",gradientTransform:"scale(-.8553 -1) rotate(50.927 2.041 -1.946)",id:l.id,r:"105.116%",children:[c.jsx("stop",{offset:"9.6%",stopColor:"#00AEFF"}),c.jsx("stop",{offset:"77.3%",stopColor:"#2253CE"}),c.jsx("stop",{offset:"100%",stopColor:"#0736C4"})]}),c.jsxs("radialGradient",{cx:"18.143%",cy:"32.928%",fx:"18.143%",fy:"32.928%",gradientTransform:"scale(.8897 1) rotate(52.069 .193 .352)",id:d.id,r:"95.612%",children:[c.jsx("stop",{offset:"0%",stopColor:"#FFB657"}),c.jsx("stop",{offset:"63.4%",stopColor:"#FF5F3D"}),c.jsx("stop",{offset:"92.3%",stopColor:"#C02B3C"})]}),c.jsxs("radialGradient",{cx:"82.987%",cy:"-9.792%",fx:"82.987%",fy:"-9.792%",gradientTransform:"scale(-1 -.9441) rotate(-70.872 .142 1.17)",id:p.id,r:"140.622%",children:[c.jsx("stop",{offset:"6.6%",stopColor:"#8C48FF"}),c.jsx("stop",{offset:"50%",stopColor:"#F2598A"}),c.jsx("stop",{offset:"89.6%",stopColor:"#FFB152"})]}),c.jsxs("linearGradient",{id:u.id,x1:"39.465%",x2:"46.884%",y1:"12.117%",y2:"103.774%",children:[c.jsx("stop",{offset:"15.6%",stopColor:"#0D91E1"}),c.jsx("stop",{offset:"48.7%",stopColor:"#52B471"}),c.jsx("stop",{offset:"65.2%",stopColor:"#98BD42"}),c.jsx("stop",{offset:"93.7%",stopColor:"#FFC800"})]}),c.jsxs("linearGradient",{id:f.id,x1:"45.949%",x2:"50%",y1:"0%",y2:"100%",children:[c.jsx("stop",{offset:"0%",stopColor:"#3DCBFF"}),c.jsx("stop",{offset:"24.7%",stopColor:"#0588F7",stopOpacity:"0"})]}),c.jsxs("linearGradient",{id:g.id,x1:"83.507%",x2:"83.453%",y1:"-6.106%",y2:"21.131%",children:[c.jsx("stop",{offset:"5.8%",stopColor:"#F8ADFA"}),c.jsx("stop",{offset:"70.8%",stopColor:"#A86EDD",stopOpacity:"0"})]})]})]}))});function C2(e){"@babel/helpers - typeof";return C2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},C2(e)}function OB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function O7e(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?OB(Object(n),!0).forEach(function(i){R7e(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function R7e(e,r,n){return r=M7e(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function M7e(e){var r=P7e(e,"string");return C2(r)=="symbol"?r:String(r)}function P7e(e,r){if(C2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(C2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function L7e(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var $7e=y.memo(function(e){var r=Object.assign({},(L7e(e),e));return c.jsx(pl,O7e({Icon:z9,"aria-label":S0,background:y7e,color:v7e,iconMultiple:x7e},r))});function j2(e){"@babel/helpers - typeof";return j2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},j2(e)}var D7e=["size","style"];function RB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function _T(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?RB(Object(n),!0).forEach(function(i){I7e(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function I7e(e,r,n){return r=B7e(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function B7e(e){var r=z7e(e,"string");return j2(r)=="symbol"?r:String(r)}function z7e(e,r){if(j2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(j2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function F7e(e,r){if(e==null)return{};var n=H7e(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function H7e(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var NQ=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=F7e(e,D7e);return c.jsxs("svg",_T(_T({fill:"currentColor",fillRule:"evenodd",height:n,style:_T({flex:"none",lineHeight:1},i),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:S0}),c.jsx("path",{d:"M9 23l.073-.001a2.53 2.53 0 01-2.347-1.838l-.697-2.433a2.529 2.529 0 00-2.426-1.839h-.497l-.104-.002c-4.485 0-2.935-5.278-1.75-9.225l.162-.525C2.412 3.99 3.883 1 6.25 1h8.86c1.12 0 2.106.745 2.422 1.829l.715 2.453a2.53 2.53 0 002.247 1.823l.147.005.534.001c3.557.115 3.088 3.745 2.156 7.206l-.113.413c-.154.548-.315 1.089-.47 1.607l-.163.525C21.588 20.01 20.116 23 17.75 23h-8.75zm8.22-15.89l-3.856.001a2.526 2.526 0 00-2.35 1.615L9.21 15.04a2.529 2.529 0 01-2.43 1.847l3.853.002c1.056 0 1.992-.661 2.361-1.644l1.796-6.287a2.529 2.529 0 012.43-1.848z"})]}))});function N2(e){"@babel/helpers - typeof";return N2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},N2(e)}var W7e=["size","style"];function MB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function wT(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?MB(Object(n),!0).forEach(function(i){U7e(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function U7e(e,r,n){return r=V7e(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function V7e(e){var r=q7e(e,"string");return N2(r)=="symbol"?r:String(r)}function q7e(e,r){if(N2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(N2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function G7e(e,r){if(e==null)return{};var n=K7e(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function K7e(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var TQ=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=G7e(e,W7e);return c.jsxs("svg",wT(wT({fill:"currentColor",fillRule:"evenodd",height:n,style:wT({flex:"none",lineHeight:1},i),viewBox:"0 0 73 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:S0}),c.jsx("path",{d:"M34.977 6.95c1.544 0 2.778.547 3.66 1.636.861 1.064 1.287 2.473 1.287 4.208 0 1.918-.476 3.479-1.437 4.663-.98 1.207-2.33 1.815-4.008 1.815-1.051 0-1.953-.308-2.69-.915l-.12-.104V24h-2.72V7.204h2.72v1.028l.054-.054c.804-.76 1.809-1.171 2.997-1.223l.257-.005zm22.557 0c1.75 0 3.147.549 4.154 1.65.999 1.093 1.493 2.59 1.493 4.469 0 1.847-.533 3.353-1.604 4.49-1.076 1.142-2.52 1.713-4.298 1.713-1.735 0-3.146-.557-4.201-1.67-1.05-1.109-1.573-2.572-1.573-4.364 0-1.94.543-3.486 1.636-4.607 1.095-1.122 2.57-1.681 4.393-1.681zm-36.031 0c1.75 0 3.147.549 4.154 1.65.999 1.093 1.493 2.59 1.493 4.469 0 1.847-.533 3.353-1.604 4.49-1.076 1.142-2.52 1.713-4.298 1.713-1.734 0-3.146-.557-4.2-1.67-1.05-1.109-1.574-2.572-1.574-4.364 0-1.94.543-3.486 1.636-4.607 1.095-1.122 2.57-1.681 4.393-1.681zM10.257 2.613c1.506 0 2.766.22 3.782.666l.294.129v3.05l-.728-.405c-1.015-.565-2.136-.847-3.37-.847-1.615 0-2.9.528-3.891 1.59-.996 1.066-1.496 2.5-1.496 4.327 0 1.73.466 3.08 1.391 4.08.92.993 2.12 1.488 3.636 1.488 1.442 0 2.677-.316 3.715-.945l.743-.45v2.893l-.263.139c-1.2.632-2.678.944-4.429.944-2.295 0-4.158-.746-5.556-2.238C2.695 15.549 2 13.604 2 11.228c0-2.55.779-4.634 2.337-6.225 1.558-1.591 3.542-2.39 5.92-2.39zm58.006 1.203l-.001 3.387H71V9.67l-2.738-.001v5.611c0 .556.08.946.212 1.17l.052.077c.143.18.412.281.848.281.336 0 .61-.087.842-.261l.784-.59v2.756l-.255.14c-.49.27-1.11.4-1.859.4-2.185 0-3.344-1.29-3.344-3.666V9.668h-1.867V7.205l1.866-.001.001-2.51.34-.11 1.74-.56.64-.207zm-23.82 3.388v11.814h-2.72V7.204h2.72zM49.707 2v17.018h-2.72V2h2.72zm-28.33 7.394c-.98 0-1.727.32-2.281.966-.568.66-.858 1.592-.858 2.815 0 1.17.291 2.064.863 2.707.561.632 1.308.946 2.276.946.986 0 1.711-.304 2.218-.913.523-.628.793-1.55.793-2.783 0-1.248-.27-2.181-.795-2.816-.506-.615-1.231-.922-2.216-.922zm13.166 0c-.873 0-1.552.293-2.072.885-.534.609-.8 1.372-.8 2.314v1.512c0 .772.245 1.41.742 1.942.49.524 1.1.781 1.865.781.902 0 1.581-.33 2.085-1.008.527-.71.799-1.725.799-3.058 0-1.1-.247-1.935-.727-2.522-.463-.567-1.08-.846-1.892-.846zm22.865 0c-.98 0-1.727.32-2.281.966-.568.66-.858 1.592-.858 2.815 0 1.17.291 2.064.863 2.707.561.632 1.308.946 2.276.946.986 0 1.711-.304 2.218-.913.523-.628.793-1.55.793-2.783 0-1.248-.27-2.181-.795-2.816-.507-.615-1.231-.922-2.216-.922zM43.105 2.2c.444 0 .836.156 1.151.46.32.309.485.707.485 1.164 0 .443-.165.834-.482 1.145a1.605 1.605 0 01-1.154.468c-.437 0-.825-.154-1.136-.454a1.561 1.561 0 01-.48-1.16c0-.454.162-.851.477-1.16.312-.306.7-.463 1.139-.463z"})]}))});function T2(e){"@babel/helpers - typeof";return T2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},T2(e)}var Y7e=["type"];function PB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function X7e(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?PB(Object(n),!0).forEach(function(i){Z7e(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Z7e(e,r,n){return r=J7e(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function J7e(e){var r=Q7e(e,"string");return T2(r)=="symbol"?r:String(r)}function Q7e(e,r){if(T2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(T2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function eRe(e,r){if(e==null)return{};var n=tRe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function tRe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var rRe=y.memo(function(e){var r=e.type,n=r===void 0?"mono":r,i=eRe(e,Y7e),s=n==="color"?z9:NQ;return c.jsx(ml,X7e({Icon:s,Text:TQ,"aria-label":S0,spaceMultiple:g7e,textMultiple:m7e},i))}),G0=NQ;G0.Color=z9;G0.Text=TQ;G0.Combine=rRe;G0.Avatar=$7e;G0.colorPrimary=jQ;G0.title=S0;const hd="jait-auth-token",f5="token",F9="jait-auth-token";let fd=null;function k0(){if(typeof window>"u")return null;try{return window.localStorage}catch{return null}}function H9(){if(typeof window>"u")return null;try{return window.sessionStorage}catch{return null}}function W9(){return typeof window>"u"?null:window.jaitDesktop??null}function ev(){return typeof window>"u"?!1:!!window.jaitDesktop||!!window.Capacitor}async function nRe(){const e=W9();if(e!=null&&e.credentialGet)try{const i=await e.credentialGet(F9);if(i!=null&&i.value){fd=i.value;return}}catch{}if(!ev()){LB();const i=k0(),s=(i==null?void 0:i.getItem(hd))??null;if(s){fd=s,i==null||i.removeItem(hd);return}try{const{getApiUrl:o}=await Ke(async()=>{const{getApiUrl:l}=await Promise.resolve().then(()=>AQ);return{getApiUrl:l}},void 0,import.meta.url),a=await fetch(`${o()}/api/auth/refresh`,{method:"POST",credentials:"include"});if(a.ok){const l=await a.json();if(l.access_token){fd=l.access_token;return}}}catch{}return}LB();const r=k0(),n=(r==null?void 0:r.getItem(hd))??null;n&&(fd=n)}function LB(){const e=H9(),r=k0(),n=(e==null?void 0:e.getItem(hd))??null;n&&(ev()&&(r==null||r.setItem(hd,n)),e==null||e.removeItem(hd),fd||(fd=n));const i=(r==null?void 0:r.getItem(f5))??null;i&&(ev()&&(r==null||r.setItem(hd,i)),r==null||r.removeItem(f5),fd||(fd=i))}function h0(){return fd}function iRe(e){var r,n,i;if(fd=e,ev()){(r=k0())==null||r.setItem(hd,e),(n=k0())==null||n.removeItem(f5),(i=H9())==null||i.removeItem(hd);const s=W9();s!=null&&s.credentialStore&&s.credentialStore(F9,e).catch(()=>{})}}function ST(){var e,r,n;if(fd=null,(e=k0())==null||e.removeItem(hd),(r=k0())==null||r.removeItem(f5),(n=H9())==null||n.removeItem(hd),ev()){const i=W9();i!=null&&i.credentialClear&&i.credentialClear(F9).catch(()=>{})}}async function sRe(){if(!ev())try{const{getApiUrl:e}=await Ke(async()=>{const{getApiUrl:r}=await Promise.resolve().then(()=>AQ);return{getApiUrl:r}},void 0,import.meta.url);await fetch(`${e()}/api/auth/logout`,{method:"POST",credentials:"include"})}catch{}}const hC="jait-gateway-url";function oRe(){return typeof window>"u"?!1:!!(window.jaitDesktop||window.Capacitor)}function p5(){return oRe()}function aRe(){var e;return typeof window<"u"&&((e=window.location)!=null&&e.origin)&&window.location.origin!=="null"?window.location.origin:"http://localhost:8000"}function lRe(){var e;return typeof window<"u"&&((e=window.location)!=null&&e.origin)&&window.location.origin!=="null"?window.location.origin:"http://localhost:8000"}function Om(e){return e.endsWith("/")?e.slice(0,-1):e}function kT(e){return e.replace(/^http/,"ws")}function cRe(e,r=!1){try{const n=new URL(e);return r&&n.port&&n.port!=="8000"&&(n.port="8000"),Om(n.toString())}catch{return Om(e)}}function tv(){if(!p5())return null;try{const e=localStorage.getItem(hC);return e&&e.trim()?e.trim():null}catch{return null}}function EQ(e){if(!p5()){try{localStorage.removeItem(hC)}catch{}window.dispatchEvent(new Event("jait-gateway-url-changed"));return}try{e&&e.trim()?localStorage.setItem(hC,Om(e.trim())):localStorage.removeItem(hC)}catch{}window.dispatchEvent(new Event("jait-gateway-url-changed"))}function $n(){var n;const e=tv();if(e)return Om(e);const r=typeof window<"u"?(n=window.jaitDesktop)==null?void 0:n.gatewayUrl:void 0;return r?Om(r):aRe()}function K0(){var n;const e=tv();if(e)return Om(kT(e));const r=typeof window<"u"?(n=window.jaitDesktop)==null?void 0:n.gatewayUrl:void 0;return Om(kT(r||lRe()))}function gA(){var e;return!!(p5()&&tv()||typeof window<"u"&&((e=window.jaitDesktop)!=null&&e.gatewayUrl)||!p5())}const uRe=$n(),dRe=K0(),AQ=Object.freeze(Object.defineProperty({__proto__:null,API_URL:uRe,WS_URL:dRe,getApiUrl:$n,getStoredGatewayUrl:tv,getWsUrl:K0,isGatewayConfigured:gA,normalizeDirectGatewayBase:cRe,setStoredGatewayUrl:EQ},Symbol.toStringTag,{value:"Module"})),Xn=$n();class hRe{constructor(){ze(this,"_providersInflight",null);ze(this,"_providersCachedAt",0);ze(this,"_modelsInflight",new Map);ze(this,"_modelsCachedAt",new Map)}getToken(){return h0()}getHeaders(r=!1){const n={};r&&(n["Content-Type"]="application/json");const i=this.getToken();return i&&(n.Authorization=`Bearer ${i}`),n}async listProviders(){const r=Date.now();return this._providersInflight&&r-this._providersCachedAt<5e3?this._providersInflight:(this._providersCachedAt=r,this._providersInflight=(async()=>{const n=await fetch(`${Xn}/api/providers`,{headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to list providers: ${n.statusText}`);const i=await n.json();return{providers:i.providers,remoteProviders:i.remoteProviders??[]}})(),this._providersInflight.catch(()=>{this._providersInflight=null,this._providersCachedAt=0}),this._providersInflight)}async listProvidersFresh(){return this._providersInflight=null,this._providersCachedAt=0,this.listProviders()}async getProviderAuthStatus(r){const n=await fetch(`${Xn}/api/providers/${r}/auth/status`,{headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to get provider auth status: ${n.statusText}`);return n.json()}async startProviderLogin(r){const n=await fetch(`${Xn}/api/providers/${r}/auth/login`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify({})}),i=await n.json().catch(()=>null);if(!n.ok){const s=i&&"message"in i&&typeof i.message=="string"?i.message:i&&"error"in i&&typeof i.error=="string"?i.error:`Failed to start provider login: ${n.statusText}`;throw new Error(s)}return i}async logoutProvider(r){const n=await fetch(`${Xn}/api/providers/${r}/auth/logout`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify({})}),i=await n.json().catch(()=>null);if(!n.ok){const s=i&&"message"in i&&typeof i.message=="string"?i.message:i&&"error"in i&&typeof i.error=="string"?i.error:`Failed to log out provider: ${n.statusText}`;throw new Error(s)}return i}async listProviderModels(r){const n=Date.now(),i=this._modelsCachedAt.get(r)??0,s=this._modelsInflight.get(r);if(s&&n-i<5e3)return s;this._modelsCachedAt.set(r,n);const o=(async()=>{const a=await fetch(`${Xn}/api/providers/${r}/models`,{headers:this.getHeaders()});if(!a.ok)throw new Error(`Failed to list models: ${a.statusText}`);return a.json()})();return this._modelsInflight.set(r,o),o.catch(()=>{this._modelsInflight.delete(r),this._modelsCachedAt.delete(r)}),o}async listThreads(r){return(await this.listThreadsPage({sessionId:r})).threads}async listThreadsPage(r={}){const n=new URLSearchParams;r.sessionId&&n.set("sessionId",r.sessionId),typeof r.limit=="number"&&n.set("limit",String(r.limit));const i=n.toString(),s=await fetch(`${Xn}/api/threads${i?`?${i}`:""}`,{headers:this.getHeaders()});if(!s.ok)throw new Error(`Failed to list threads: ${s.statusText}`);const o=await s.json();return{threads:o.threads,hasMore:!!o.hasMore}}async getThread(r){const n=await fetch(`${Xn}/api/threads/${r}`,{headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to get thread: ${n.statusText}`);return n.json()}async createThread(r){const n=await fetch(`${Xn}/api/threads`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify(r)});if(!n.ok)throw new Error(`Failed to create thread: ${n.statusText}`);return n.json()}async updateThread(r,n){const i=await fetch(`${Xn}/api/threads/${r}`,{method:"PATCH",headers:this.getHeaders(!0),body:JSON.stringify(n)});if(!i.ok)throw new Error(`Failed to update thread: ${i.statusText}`);return i.json()}async deleteThread(r){const n=await fetch(`${Xn}/api/threads/${r}`,{method:"DELETE",headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to delete thread: ${n.statusText}`)}async startThread(r,n){const i=typeof n=="string"?{message:n}:n??{},s=await fetch(`${Xn}/api/threads/${r}/start`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify(i)});if(!s.ok){const o=await s.json().catch(()=>({})),a=new Error(o.error||`Failed to start thread: ${s.statusText}`);throw o.code&&(a.code=o.code),a}return s.json()}async sendTurn(r,n){const i=typeof n=="string"?{message:n}:n,s=await fetch(`${Xn}/api/threads/${r}/send`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify(i)});if(!s.ok)throw new Error(`Failed to send turn: ${s.statusText}`)}async stopThread(r){const n=await fetch(`${Xn}/api/threads/${r}/stop`,{method:"POST",headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to stop thread: ${n.statusText}`)}async interruptThread(r){const n=await fetch(`${Xn}/api/threads/${r}/interrupt`,{method:"POST",headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to interrupt thread: ${n.statusText}`)}async approveToolCall(r,n,i){const s=await fetch(`${Xn}/api/threads/${r}/approve`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify({requestId:n,approved:i})});if(!s.ok)throw new Error(`Failed to approve: ${s.statusText}`)}async createPullRequest(r,n){const i=await fetch(`${Xn}/api/threads/${r}/create-pr`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify(n)});if(!i.ok){const s=await i.json().catch(()=>({}));throw new Error(s.error||`Failed to create pull request: ${i.statusText}`)}return i.json()}async getActivities(r,n){const i=typeof n=="number"?`?limit=${n}`:"",s=await fetch(`${Xn}/api/threads/${r}/activities${i}`,{headers:this.getHeaders()});if(!s.ok)throw new Error(`Failed to get activities: ${s.statusText}`);return(await s.json()).activities}async listRepos(){const r=await fetch(`${Xn}/api/repos`,{headers:this.getHeaders()});if(!r.ok)throw new Error(`Failed to list repos: ${r.statusText}`);return(await r.json()).repos}async createRepo(r){const n=await fetch(`${Xn}/api/repos`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify(r)});if(!n.ok)throw new Error(`Failed to create repo: ${n.statusText}`);return(await n.json()).repo}async updateRepo(r,n){const i=await fetch(`${Xn}/api/repos/${r}`,{method:"PATCH",headers:this.getHeaders(!0),body:JSON.stringify(n)});if(!i.ok)throw new Error(`Failed to update repo: ${i.statusText}`);return(await i.json()).repo}async deleteRepo(r){const n=await fetch(`${Xn}/api/repos/${r}`,{method:"DELETE",headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to delete repo: ${n.statusText}`)}async getRepoStrategy(r){const n=await fetch(`${Xn}/api/repos/${r}/strategy`,{headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to get strategy: ${n.statusText}`);return(await n.json()).strategy}async updateRepoStrategy(r,n){const i=await fetch(`${Xn}/api/repos/${r}/strategy`,{method:"PUT",headers:this.getHeaders(!0),body:JSON.stringify({strategy:n})});if(!i.ok)throw new Error(`Failed to update strategy: ${i.statusText}`);return(await i.json()).strategy}async generateRepoStrategy(r){const n=await fetch(`${Xn}/api/repos/${r}/strategy/generate`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify({})});if(!n.ok){const s=await n.json().catch(()=>({error:n.statusText}));throw new Error(s.error||`Failed to generate strategy: ${n.statusText}`)}return(await n.json()).strategy}async listPlans(r){const n=await fetch(`${Xn}/api/repos/${r}/plans`,{headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to list plans: ${n.statusText}`);return(await n.json()).plans}async createPlan(r,n){const i=await fetch(`${Xn}/api/repos/${r}/plans`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify(n??{})});if(!i.ok)throw new Error(`Failed to create plan: ${i.statusText}`);return(await i.json()).plan}async getPlan(r){const n=await fetch(`${Xn}/api/plans/${r}`,{headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to get plan: ${n.statusText}`);return(await n.json()).plan}async updatePlan(r,n){const i=await fetch(`${Xn}/api/plans/${r}`,{method:"PATCH",headers:this.getHeaders(!0),body:JSON.stringify(n)});if(!i.ok)throw new Error(`Failed to update plan: ${i.statusText}`);return(await i.json()).plan}async deletePlan(r){const n=await fetch(`${Xn}/api/plans/${r}`,{method:"DELETE",headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to delete plan: ${n.statusText}`)}async generatePlanTasks(r,n){const i=await fetch(`${Xn}/api/plans/${r}/generate`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify(n??{})});if(!i.ok){const s=await i.json().catch(()=>({error:i.statusText}));throw new Error(s.error||`Failed to generate tasks: ${i.statusText}`)}return await i.json()}async startPlanTask(r,n){const i=await fetch(`${Xn}/api/plans/${r}/tasks/${n}/start`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify({})});if(!i.ok)throw new Error(`Failed to start task: ${i.statusText}`);return await i.json()}async startAllPlanTasks(r){const n=await fetch(`${Xn}/api/plans/${r}/start`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify({})});if(!n.ok){const i=await n.json().catch(()=>({error:n.statusText}));throw new Error(i.error||`Failed to start tasks: ${n.statusText}`)}return await n.json()}}const Yr=new hRe,qg=$n(),CT={theme:"system",api_keys:{},stt_provider:"whisper",chat_provider:"jait",jait_backend:"openai",recent_models:[],workspace_picker_path:null,workspace_picker_node_id:null,updated_at:new Date(0).toISOString()};async function jT(e){try{const r=await fetch(`${qg}/api/auth/settings`,{headers:{Authorization:`Bearer ${e}`}});return r.ok?await r.json():null}catch{return null}}function OQ(){const[e,r]=y.useState({user:null,token:null,settings:null,isLoading:!0}),n=y.useCallback(async p=>{try{const g=await fetch(`${qg}/api/auth/me`,{headers:{Authorization:`Bearer ${p}`}});if(!g.ok){ST(),r({user:null,token:null,settings:null,isLoading:!1});return}const v=await g.json(),b=await jT(p);r({user:v,token:p,settings:b??CT,isLoading:!1})}catch{ST(),r({user:null,token:null,settings:null,isLoading:!1})}},[]);y.useEffect(()=>{(async()=>{await nRe();const p=h0();if(p){n(p);return}r(g=>({...g,isLoading:!1}))})()},[n]);const i=y.useCallback(async p=>{iRe(p.access_token),r({user:p.user,token:p.access_token,settings:CT,isLoading:!1});const g=await jT(p.access_token);g&&r(v=>v.token!==p.access_token?v:{...v,settings:g})},[]),s=y.useCallback(async(p,g)=>{const v=await fetch(`${qg}/api/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({username:p,password:g})});if(!v.ok){const _=await v.json().catch(()=>({detail:"Login failed"}));throw new Error(_.detail??"Login failed")}const b=await v.json();return await i(b),b},[i]),o=y.useCallback(async(p,g)=>{const v=await fetch(`${qg}/api/auth/register`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({username:p,password:g})});if(!v.ok){const _=await v.json().catch(()=>({detail:"Registration failed"}));throw new Error(_.detail??"Registration failed")}const b=await v.json();return await i(b),b},[i]),a=y.useCallback(()=>{ST(),sRe(),r({user:null,token:null,settings:null,isLoading:!1})},[]),l=y.useCallback(async()=>{if(!e.token)return null;const p=await jT(e.token);return p?(r(g=>({...g,settings:p})),p):null},[e.token]),d=y.useCallback(async p=>{if(!e.token)throw new Error("Not authenticated");const g=await fetch(`${qg}/api/auth/settings`,{method:"PATCH",headers:{Authorization:`Bearer ${e.token}`,"Content-Type":"application/json"},body:JSON.stringify(p)});if(!g.ok){const b=await g.json().catch(()=>({detail:"Failed to update settings"}));throw new Error(b.detail??"Failed to update settings")}const v=await g.json();return r(b=>({...b,settings:v})),v},[e.token]),u=y.useCallback(async()=>{if(!e.token)throw new Error("Not authenticated");const p=await fetch(`${qg}/api/auth/settings/archive`,{method:"DELETE",headers:{Authorization:`Bearer ${e.token}`}});if(!p.ok){const g=await p.json().catch(()=>({detail:"Failed to clear archive"}));throw new Error(g.detail??"Failed to clear archive")}return await p.json()},[e.token]),f=y.useCallback(async p=>{if(e.token)try{await fetch(`${qg}/api/auth/session/bind`,{method:"POST",headers:{Authorization:`Bearer ${e.token}`,"Content-Type":"application/json"},body:JSON.stringify({session_id:p})})}catch{}},[e.token]);return{user:e.user,token:e.token,settings:e.settings??CT,isLoading:e.isLoading,isAuthenticated:!!e.user,login:s,register:o,logout:a,bindSession:f,refreshSettings:l,updateSettings:d,clearSessionArchive:u}}const fRe=({className:e})=>c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 1024 1024",className:e,children:[c.jsx("path",{d:"M318 372 L430 486 L318 600",fill:"none",stroke:"currentColor",strokeWidth:"88",strokeLinecap:"round",strokeLinejoin:"round"}),c.jsx("path",{d:"M610 258 L610 642 C610 734 549 796 455 796 C393 796 338 766 299 715",fill:"none",stroke:"currentColor",strokeWidth:"88",strokeLinecap:"round",strokeLinejoin:"round"})]}),pRe=({className:e})=>c.jsx(es,{size:16,className:e}),mRe=({className:e})=>c.jsx(Fl,{size:16,className:e}),gRe=({className:e})=>c.jsx(Oh,{size:16,className:e}),yRe=({className:e})=>c.jsx(G0,{size:16,className:e}),vRe=[{value:"jait",label:"Jait",icon:fRe,description:"Native Jait agent loop with full tool access"},{value:"codex",label:"Codex",icon:pRe,description:"OpenAI Codex CLI — coding agent with MCP tools"},{value:"claude-code",label:"Claude Code",icon:mRe,description:"Anthropic Claude Code CLI — coding agent with MCP tools"},{value:"gemini",label:"Gemini CLI",icon:gRe,description:"Google Gemini CLI — coding agent"},{value:"opencode",label:"OpenCode",icon:rK,description:"OpenCode CLI — open-source coding agent"},{value:"copilot",label:"Copilot",icon:yRe,description:"GitHub Copilot CLI — coding agent"}],RQ="jait-recent-models",U9=5;function xRe(e){const r=e.toLowerCase();return r.includes("not installed")||r.includes("not found")?"not installed":r.includes("not authenticated")||r.includes("login")?"not authenticated":"unavailable"}function yA(){try{const e=localStorage.getItem(RQ);if(!e)return[];const r=JSON.parse(e);return Array.isArray(r)?r.filter(n=>typeof n=="string").slice(0,U9):[]}catch{return[]}}function bRe(e){const r=yA().filter(n=>n!==e);r.unshift(e),localStorage.setItem(RQ,JSON.stringify(r.slice(0,U9)))}function _Re({provider:e,model:r,onProviderChange:n,onModelChange:i,disabled:s,className:o,compact:a=!1,repoRuntime:l,onMoveToGateway:d,sessionInfo:u,workspaceNodeId:f}){const p=Cv(),{updateSettings:g}=OQ(),[v,b]=y.useState(!1),[_,S]=y.useState(""),[w,C]=y.useState({}),[j,N]=y.useState([]),[A,E]=y.useState([]),[R,L]=y.useState([]),[z,$]=y.useState(!1),[W,B]=y.useState(null),[K,M]=y.useState(null),[I,P]=y.useState(null),F=y.useRef(null),V=(Me=!1)=>{(Me?Yr.listProvidersFresh():Yr.listProviders()).then(({providers:Je,remoteProviders:Ot})=>{const _e={};for(const Re of Je)_e[Re.id]=Re;C(_e),N(Ot)}).catch(()=>{})};y.useEffect(()=>{V()},[]);const Y=async(Me,nt)=>{try{await navigator.clipboard.writeText(nt),P(Je=>Je&&Je.providerId===Me?{...Je,copied:!0}:Je)}catch{P(Je=>Je&&Je.providerId===Me?{...Je,copied:!1}:Je)}},H=async(Me,nt)=>{if(!K){b(!1),M(Me),P({providerId:Me,label:nt,tone:"loading",message:`Starting ${nt} login...`});try{const Je=await Yr.startProviderLogin(Me);let Ot=!1;if(Je.userCode)try{await navigator.clipboard.writeText(Je.userCode),Ot=!0}catch{Ot=!1}P({providerId:Me,label:nt,tone:"success",message:Je.userCode?`Device code ${Ot?"copied to clipboard.":"is ready to copy."}`:Je.message,userCode:Je.userCode,verificationUri:Je.verificationUri,copied:Ot}),V(!0)}catch(Je){P({providerId:Me,label:nt,tone:"error",message:Je instanceof Error?Je.message:`Failed to start ${nt} login.`})}finally{M(null)}}};y.useEffect(()=>{v&&(S(""),requestAnimationFrame(()=>{var Me;return(Me=F.current)==null?void 0:Me.focus()}))},[v]),y.useEffect(()=>{E([]),L(yA());let Me=!1;return $(!0),Yr.listProviderModels(e).then(nt=>{var Je;Me||(E(nt.models),(Je=nt.recentModels)!=null&&Je.length&&L(nt.recentModels),nt.currentBackend&&B(nt.currentBackend))}).catch(()=>{Me||E([])}).finally(()=>{Me||$(!1)}),()=>{Me=!0}},[e]),y.useEffect(()=>{if(e==="jait"||z||A.length===0||r&&A.some(Je=>Je.id===r))return;const Me=A.find(Je=>Je.isDefault)??A[0]??null,nt=(Me==null?void 0:Me.id)??null;nt!==r&&i(nt)},[e,z,r,A,i]);const U=l!=null,J=(l==null?void 0:l.availableProviders)??[],q=(l==null?void 0:l.online)??!0,ee=(l==null?void 0:l.loading)??!1,te=(l==null?void 0:l.hostType)==="gateway",ue=!!(f&&f!=="gateway"),fe=ue?j.find(Me=>Me.nodeId===f):void 0,re=ue&&!U,ie=y.useMemo(()=>vRe.map(Me=>{const nt=w[Me.value];let Je,Ot,_e;if(U)Me.value==="jait"?(Je=!0,_e="Gateway"):te?(Je=(nt==null?void 0:nt.available)!==!1,Ot=nt==null?void 0:nt.unavailableReason,_e="Gateway"):ee?(Je=!1,Ot="Checking device…"):q?(Je=J.includes(Me.value),Ot=Je?void 0:"Not available on this device",_e=(l==null?void 0:l.locationLabel)??"device"):(Je=!1,Ot="Device is offline");else if(re)Me.value==="jait"?(Je=!0,_e="Gateway"):fe?(Je=fe.providers.includes(Me.value),Ot=Je?void 0:"Not available on this device",_e=fe.nodeName):(Je=!1,Ot="Device is offline");else{const Re=(nt==null?void 0:nt.available)!==!1,ke=Re?void 0:j.find($e=>$e.providers.includes(Me.value));Je=Re||!!ke,Ot=nt==null?void 0:nt.unavailableReason,_e=!(nt!=null&&nt.available)&&ke?ke.nodeName:"Gateway"}return{...Me,isAvailable:Je,reason:Ot,nodeLabel:_e,auth:nt==null?void 0:nt.auth}}),[w,j,U,te,ee,q,J,l==null?void 0:l.locationLabel,re,fe]),ge=ie.find(Me=>Me.value===e)??ie[0],le=ge.icon,et=r?A.find(Me=>Me.id===r):null,Xe=z?"Loading":(et==null?void 0:et.name)??r??"Default",De=U?te?"Gateway":l==null?void 0:l.locationLabel:re?(fe==null?void 0:fe.nodeName)??f:u!=null&&u.isRemote&&u.remoteNode?u.remoteNode.nodeName:void 0,de=_.trim().toLowerCase(),Qe=y.useMemo(()=>de?A.filter(Me=>{var nt;return Me.id.toLowerCase().includes(de)||Me.name.toLowerCase().includes(de)||((nt=Me.description)==null?void 0:nt.toLowerCase().includes(de))}):A,[A,de]),Ie=y.useMemo(()=>{if(de)return[];const Me=new Map(A.map(nt=>[nt.id,nt]));return R.filter(nt=>Me.has(nt)).map(nt=>Me.get(nt)).slice(0,U9)},[A,R,de]),Oe=y.useMemo(()=>{if(de)return Qe;const Me=new Set(Ie.map(nt=>nt.id));return Qe.filter(nt=>!Me.has(nt.id))},[Qe,Ie,de]),qe=Me=>{n(Me)},kt={OpenAI:"openai",OpenRouter:"openrouter",Ollama:"ollama"},vt=Me=>{const nt=A.find(Je=>Je.id===Me);if(e==="jait"&&(nt!=null&&nt.group)){const Je=kt[nt.group];Je&&Je!==W&&g({jait_backend:Je}).then(()=>{B(Je)}).catch(()=>{})}i(Me),bRe(Me),L(yA()),b(!1)};return c.jsxs(c.Fragment,{children:[c.jsxs(YR,{open:v,onOpenChange:b,children:[c.jsx(XR,{asChild:!0,disabled:s,children:c.jsxs("button",{type:"button",className:We("flex h-8 items-center gap-1 rounded-md border border-transparent px-1.5 py-1 text-xs font-medium text-muted-foreground","hover:text-foreground hover:bg-muted/60 transition-colors","focus-visible:outline-none focus-visible:border-ring/60 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring/50","disabled:pointer-events-none disabled:opacity-50",o),title:`Provider: ${ge.label} · Model: ${Xe}`,"aria-label":`Provider ${ge.label}, model ${Xe}`,children:[c.jsx(le,{className:"h-4 w-4 shrink-0"}),!a&&c.jsxs(c.Fragment,{children:[c.jsx("span",{children:ge.label}),c.jsx("span",{className:"max-w-[112px] truncate font-mono text-xs opacity-80",children:Xe})]}),!a&&De&&c.jsxs("span",{className:"flex max-w-[72px] items-center gap-0.5 truncate text-2xs text-blue-500",children:[c.jsx(Ra,{className:"h-3 w-3"}),De]}),z?c.jsx(ir,{className:"h-3 w-3 animate-spin opacity-70"}):null,c.jsx(hl,{className:"h-3 w-3 opacity-60"})]})}),c.jsxs(ZR,{align:"start",side:p?"bottom":"top",collisionPadding:8,className:"flex w-[min(22rem,calc(100vw-1rem))] flex-col overflow-hidden p-0",style:{maxHeight:p?"min(32rem, calc(var(--radix-popover-content-available-height, 100dvh) - 0.75rem))":"min(32rem, var(--radix-popover-content-available-height, 80dvh))"},children:[c.jsx("div",{className:"shrink-0 border-b px-3 py-2",children:c.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-muted-foreground",children:"Providers"})}),U&&!te&&!q&&!ee&&c.jsx("div",{className:"shrink-0 border-b px-3 py-2 text-xs text-amber-600 dark:text-amber-400",children:"Device is offline — only Jait (gateway) is available"}),U&&ee&&c.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 border-b px-3 py-2 text-xs text-muted-foreground",children:[c.jsx(ir,{className:"h-3 w-3 animate-spin"}),"Connecting to device…"]}),re&&!fe&&c.jsx("div",{className:"shrink-0 border-b px-3 py-2 text-xs text-amber-600 dark:text-amber-400",children:"Device is offline — only Jait (gateway) is available"}),c.jsxs("div",{className:"min-h-24 max-h-56 shrink-0 overflow-y-auto p-1",children:[ie.map(Me=>{var Re,ke;const nt=Me.icon,Je=Me.value===e,Ot=!!((Re=Me.auth)!=null&&Re.login)&&((ke=Me.auth)==null?void 0:ke.authenticated)!==!0&&!re&&(!U||te),_e=K===Me.value;return c.jsxs("div",{className:We("rounded-sm",Je&&"bg-accent/50"),children:[c.jsxs("button",{type:"button",onClick:()=>qe(Me.value),disabled:!Me.isAvailable,className:We("flex w-full items-start gap-2.5 rounded-sm px-2 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",!Me.isAvailable&&"cursor-not-allowed opacity-60"),children:[c.jsx(nt,{className:"mt-0.5 h-4 w-4 shrink-0"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-sm font-medium",children:[Me.label,Me.isAvailable&&Me.nodeLabel&&c.jsxs("span",{className:"flex items-center gap-0.5 text-2xs text-muted-foreground",children:[c.jsx(Ra,{className:"h-3 w-3"}),Me.nodeLabel]}),!Me.isAvailable&&c.jsxs("span",{className:"flex items-center gap-0.5 text-2xs text-destructive/80",children:[c.jsx(nC,{className:"h-3 w-3"}),Me.reason?xRe(Me.reason):"unavailable"]}),Me.auth&&Me.auth.authenticated===!0&&c.jsx("span",{className:"text-2xs text-emerald-600 dark:text-emerald-400",children:"signed in"})]}),c.jsx("div",{className:"text-xs leading-snug text-muted-foreground",children:!Me.isAvailable&&Me.reason?Me.reason:Me.description})]}),Je&&c.jsx(hs,{className:"mt-0.5 h-4 w-4 shrink-0 text-primary"})]}),Ot&&c.jsx("div",{className:"ml-8 mr-2 mb-2",children:c.jsx("button",{type:"button",title:`Login to ${Me.label}`,"aria-label":`Login to ${Me.label}`,onClick:$e=>{$e.preventDefault(),$e.stopPropagation(),H(Me.value,Me.label)},disabled:!!K,className:"inline-flex h-7 w-7 items-center justify-center rounded-md border border-border bg-background text-foreground transition-colors hover:bg-muted disabled:opacity-50",children:_e?c.jsx(ir,{className:"h-3.5 w-3.5 animate-spin"}):c.jsx(q0e,{className:"h-3.5 w-3.5"})})})]},Me.value)}),U&&!te&&!q&&!ee&&d&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"mx-2 my-1 border-t"}),c.jsxs("button",{type:"button",onClick:d,className:We("flex w-full items-start gap-2.5 rounded-sm px-2 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground"),children:[c.jsx(ro,{className:"mt-0.5 h-4 w-4 shrink-0"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("div",{className:"text-sm font-medium",children:"Move to Gateway"}),c.jsx("div",{className:"text-xs leading-snug text-muted-foreground",children:"Run this repo on the gateway server instead"})]})]})]})]}),c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"shrink-0 border-y px-3 py-2",children:c.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-muted-foreground",children:"Models"})}),c.jsx("div",{className:"shrink-0 border-b px-3 py-2",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Vl,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),c.jsx("input",{ref:F,type:"text",value:_,onChange:Me=>S(Me.target.value),placeholder:"Search models...",className:"flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]})}),c.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-1",children:[Ie.length>0&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5",children:[c.jsx(Xm,{className:"h-3 w-3 text-muted-foreground"}),c.jsx("span",{className:"text-2xs font-medium uppercase tracking-wider text-muted-foreground",children:"Recent"})]}),Ie.map(Me=>c.jsx(NT,{model:Me,selected:r===Me.id,onSelect:vt},`recent-${Me.id}`)),c.jsx("div",{className:"mx-2 my-1 border-t"})]}),!de&&Ie.length>0&&c.jsx("div",{className:"px-2 py-1.5",children:c.jsx("span",{className:"text-2xs font-medium uppercase tracking-wider text-muted-foreground",children:"All models"})}),z&&c.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 text-xs text-muted-foreground",children:[c.jsx(ir,{className:"h-3.5 w-3.5 animate-spin"}),"Loading models…"]}),!z&&(()=>{if(!Oe.some(Ot=>Ot.group))return Oe.map(Ot=>c.jsx(NT,{model:Ot,selected:r===Ot.id,onSelect:vt},Ot.id));const nt=[],Je=new Set;for(const Ot of Oe){const _e=Ot.group||"Other";Je.has(_e)||(Je.add(_e),nt.push({label:_e,items:[]})),nt.find(Re=>Re.label===_e).items.push(Ot)}return nt.map(Ot=>c.jsxs("div",{children:[c.jsx("div",{className:"sticky top-0 z-10 bg-popover px-2 py-1.5",children:c.jsx("span",{className:"text-2xs font-medium uppercase tracking-wider text-muted-foreground",children:Ot.label})}),Ot.items.map(_e=>c.jsx(NT,{model:_e,selected:r===_e.id,onSelect:vt},_e.id))]},Ot.label))})(),!z&&Qe.length===0&&c.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:_?`No models matching "${_}"`:"No models available"})]})]})]})]}),c.jsx(Td,{open:!!I,onOpenChange:Me=>{Me||P(null)},children:c.jsxs(ku,{className:"w-[calc(100vw-1.5rem)] max-w-md",children:[c.jsxs(wd,{children:[c.jsxs(_u,{children:[(I==null?void 0:I.label)??"Provider"," login"]}),c.jsx($m,{children:(I==null?void 0:I.tone)==="loading"?I.message:"Use the device code below on the provider login page."})]}),I&&c.jsxs("div",{className:"space-y-4",children:[I.tone!=="loading"&&c.jsx("div",{className:We("rounded-md border px-3 py-2 text-sm",I.tone==="success"?"border-emerald-500/25 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"border-destructive/25 bg-destructive/10 text-destructive"),children:I.message}),I.tone==="loading"&&c.jsxs("div",{className:"flex items-center gap-2 rounded-md border px-3 py-2 text-sm text-muted-foreground",children:[c.jsx(ir,{className:"h-4 w-4 animate-spin"}),"Starting device login..."]}),I.userCode&&c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("div",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Device code"}),c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx("code",{className:"min-w-0 flex-1 rounded-md border bg-muted px-3 py-2 text-center font-mono text-lg font-semibold [overflow-wrap:anywhere]",children:I.userCode}),c.jsxs(be,{variant:"outline",size:"sm",onClick:()=>void Y(I.providerId,I.userCode),children:[c.jsx(wc,{className:"mr-1.5 h-3.5 w-3.5"}),I.copied?"Copied":"Copy"]})]})]})]}),c.jsxs(W0,{className:"gap-2 sm:gap-0",children:[c.jsx(be,{variant:"outline",onClick:()=>P(null),children:"Close"}),(I==null?void 0:I.verificationUri)&&c.jsxs(be,{onClick:()=>window.open(I.verificationUri,"_blank","noopener,noreferrer"),children:[c.jsx(Uf,{className:"mr-1.5 h-4 w-4"}),"Open login page"]})]})]})})]})}function NT({model:e,selected:r,onSelect:n}){return c.jsxs("button",{type:"button",onClick:()=>n(e.id),className:We("flex w-full items-start gap-2 rounded-sm px-2 py-1.5 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent/50"),children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"truncate text-sm font-medium",children:[e.name,e.isDefault&&c.jsx("span",{className:"ml-1.5 text-2xs font-normal text-muted-foreground",children:"(default)"})]}),e.description&&c.jsx("div",{className:"truncate text-xs leading-snug text-muted-foreground",children:e.description})]}),r&&c.jsx(hs,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-primary"})]})}const $B={"full-access":{label:"Full access",description:"Provider runs without approval prompts when supported.",icon:H4},supervised:{label:"Supervised",description:"Provider asks for approvals when it supports them.",icon:Ef}};function wRe({provider:e,value:r,onChange:n,disabled:i,className:s,compact:o=!1}){const[a,l]=y.useState({});y.useEffect(()=>{Yr.listProviders().then(({providers:g})=>{const v={};for(const b of g)v[b.id]=b;l(v)}).catch(()=>{})},[]);const d=y.useMemo(()=>{var v;const g=(v=a[e])==null?void 0:v.modes;return!g||g.length===0?e==="jait"?[]:["full-access","supervised"]:g},[e,a]);if(e==="jait"||d.length<=1)return null;const u=d.includes(r)?r:d[0],f=$B[u],p=f.icon;return c.jsxs(mu,{children:[c.jsx(gu,{asChild:!0,disabled:i,children:c.jsxs("button",{type:"button",className:We("flex h-8 items-center gap-1 rounded-md border border-transparent px-1.5 py-1 text-xs font-medium text-muted-foreground","hover:text-foreground hover:bg-muted/60 transition-colors","focus-visible:outline-none focus-visible:border-ring/60 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring/50","disabled:pointer-events-none disabled:opacity-50",s),title:`Runtime: ${f.label}`,"aria-label":`Runtime: ${f.label}`,children:[c.jsx(p,{className:"h-4 w-4"}),!o&&c.jsx("span",{children:f.label}),c.jsx(hl,{className:"h-3 w-3 opacity-60"})]})}),c.jsx(kc,{align:"start",side:"top",className:"w-64",children:d.map(g=>{const v=$B[g],b=v.icon,_=u===g;return c.jsxs(Wi,{onClick:()=>n(g),className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[c.jsx(b,{className:"mt-0.5 h-4 w-4 shrink-0"}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"truncate text-sm font-medium",children:v.label}),c.jsx("div",{className:"text-xs text-muted-foreground",children:v.description})]})]}),_&&c.jsx(hs,{className:"mt-0.5 h-4 w-4 shrink-0"})]},g)})})]})}const MQ="application/x-jait-workspace+json",PQ="application/x-jait-terminal+json";function SRe(e,r){return{path:e,name:r||e.split(/[\\/]/).pop()||e}}function kRe(e,r,n){return{terminalId:e,name:r||e,...n?{workspaceRoot:n}:{}}}function fC(e,r){return JSON.stringify({value:e,segments:As(r)})}function CRe(e,r,n,i){const s=fC(r,n);if(e===s)return!1;const o=As(n);return o.length>0?JSON.stringify(i)!==JSON.stringify(o):i.length===0?r.length>0:X1(i)!==r}function jRe(e){const{startContainerIsRoot:r,startContainerIsText:n,startOffset:i,childIndex:s}=e;return s<=0?!1:r?!0:i===0}function NRe(e,r){return Math.max(0,Math.min(e-1,r))}const DB="https://cdn.jsdelivr.net/gh/vscode-icons/vscode-icons@12.9.0/icons/",IB=[];function m5(e){const r="lineRange"in e?e.lineRange:void 0,n=r?`:L${r.startLine}-L${r.endLine}`:"";if("type"in e&&e.type==="workspace")return`workspace:${e.path}`;if("type"in e&&e.type==="terminal"){const i=e.selectedText?`:${TRe(e.selectedText)}`:"";return`terminal:${e.terminalId}${n}${i}`}return`file:${e.path}${n}`}function TRe(e){let r=5381;for(let n=0;n<e.length;n++)r=(r<<5)+r^e.charCodeAt(n);return(r>>>0).toString(36)}function g5(e,r){const n=document.createElement("span");n.contentEditable="false";const i=m5(e);n.setAttribute("data-chip-ref",i),"type"in e&&e.type==="workspace"?(n.setAttribute("data-segment-type","workspace"),n.setAttribute("data-workspace-path",e.path),n.setAttribute("data-chip-name",e.name)):"type"in e&&e.type==="terminal"?(n.setAttribute("data-segment-type","terminal"),n.setAttribute("data-terminal-id",e.terminalId),n.setAttribute("data-chip-name",e.name),e.workspaceRoot&&n.setAttribute("data-workspace-root",e.workspaceRoot),e.lineRange&&(n.setAttribute("data-line-start",String(e.lineRange.startLine)),n.setAttribute("data-line-end",String(e.lineRange.endLine))),e.selectedText&&n.setAttribute("data-selected-text",e.selectedText)):(n.setAttribute("data-segment-type","file"),n.setAttribute("data-file-path",e.path),n.setAttribute("data-chip-name",e.name),e.kind&&n.setAttribute("data-kind",e.kind),e.lineRange&&(n.setAttribute("data-line-start",String(e.lineRange.startLine)),n.setAttribute("data-line-end",String(e.lineRange.endLine)))),n.className="inline-flex items-center gap-1.5 align-middle text-xs font-medium leading-none mx-[2px] rounded-md border border-border/70 bg-muted/45 pl-2 pr-1 py-1 text-foreground cursor-default whitespace-nowrap transition-colors";const s=document.createElement("span");if(s.className="inline-flex items-center shrink-0","type"in e&&e.type==="workspace")s.innerHTML=`<img src="${DB}${dd.DEFAULT_FOLDER}" alt="" class="h-3.5 w-3.5" draggable="false" />`;else if("type"in e&&e.type==="terminal")s.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.1" stroke-linecap="round" stroke-linejoin="round" class="h-3.5 w-3.5 text-muted-foreground"><path d="M4 17l6-6-6-6"/><path d="M12 19h8"/></svg>';else{const d=e.kind==="dir"?ARe(e.name):ERe(e.name);s.innerHTML=`<img src="${DB}${d}" alt="" class="h-3.5 w-3.5" draggable="false" />`}n.appendChild(s);const o=document.createElement("span");o.className="truncate max-w-[180px]";const a="lineRange"in e?o2(e.lineRange):"";o.textContent=a?`${e.name}:${a.replace(/^lines? /,"")}`:e.name,n.appendChild(o);const l=document.createElement("button");return l.type="button",l.className="inline-flex items-center p-0.5 rounded hover:bg-foreground/10 transition-colors text-muted-foreground hover:text-foreground",l.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',l.addEventListener("mousedown",d=>{d.preventDefault(),d.stopPropagation()}),l.addEventListener("click",d=>{d.preventDefault(),d.stopPropagation(),n.remove(),r==null||r(i)}),n.appendChild(l),n}function ERe(e){return dd.getIconForFile(e)??dd.DEFAULT_FILE}function ARe(e){return dd.getIconForFolder(e)??dd.DEFAULT_FOLDER}function Go(e){let r="";const n=e.childNodes;for(let i=0;i<n.length;i++){const s=n[i];if(s.nodeType===Node.TEXT_NODE)r+=s.textContent??"";else if(s instanceof HTMLElement){if(s.hasAttribute("data-chip-ref"))continue;s.tagName==="BR"?i===n.length-1||(r+=`
864
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function j7e(e,r){if(e){if(typeof e=="string")return AB(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return AB(e,r)}}function AB(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,i=new Array(r);n<r;n++)i[n]=e[n];return i}function N7e(e,r){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i,s,o,a,l=[],d=!0,u=!1;try{if(o=(n=n.call(e)).next,r!==0)for(;!(d=(i=o.call(n)).done)&&(l.push(i.value),l.length!==r);d=!0);}catch(f){u=!0,s=f}finally{try{if(!d&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw s}}return l}}function T7e(e){if(Array.isArray(e))return e}function E7e(e,r){if(e==null)return{};var n=A7e(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function A7e(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var z9=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=E7e(e,b7e),o=Tj(S0,6),a=k7e(o,6),l=a[0],d=a[1],u=a[2],f=a[3],p=a[4],g=a[5];return c.jsxs("svg",bT(bT({height:n,style:bT({flex:"none",lineHeight:1},i),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:S0}),c.jsx("path",{d:"M17.533 1.829A2.528 2.528 0 0015.11 0h-.737a2.531 2.531 0 00-2.484 2.087l-1.263 6.937.314-1.08a2.528 2.528 0 012.424-1.833h4.284l1.797.706 1.731-.706h-.505a2.528 2.528 0 01-2.423-1.829l-.715-2.453z",fill:l.fill,transform:"translate(0 1)"}),c.jsx("path",{d:"M6.726 20.16A2.528 2.528 0 009.152 22h1.566c1.37 0 2.49-1.1 2.525-2.48l.17-6.69-.357 1.228a2.528 2.528 0 01-2.423 1.83h-4.32l-1.54-.842-1.667.843h.497c1.124 0 2.113.75 2.426 1.84l.697 2.432z",fill:d.fill,transform:"translate(0 1)"}),c.jsx("path",{d:"M15 0H6.252c-2.5 0-4 3.331-5 6.662-1.184 3.947-2.734 9.225 1.75 9.225H6.78c1.13 0 2.12-.753 2.43-1.847.657-2.317 1.809-6.359 2.713-9.436.46-1.563.842-2.906 1.43-3.742A1.97 1.97 0 0115 0",fill:u.fill,transform:"translate(0 1)"}),c.jsx("path",{d:"M15 0H6.252c-2.5 0-4 3.331-5 6.662-1.184 3.947-2.734 9.225 1.75 9.225H6.78c1.13 0 2.12-.753 2.43-1.847.657-2.317 1.809-6.359 2.713-9.436.46-1.563.842-2.906 1.43-3.742A1.97 1.97 0 0115 0",fill:f.fill,transform:"translate(0 1)"}),c.jsx("path",{d:"M9 22h8.749c2.5 0 4-3.332 5-6.663 1.184-3.948 2.734-9.227-1.75-9.227H17.22c-1.129 0-2.12.754-2.43 1.848a1149.2 1149.2 0 01-2.713 9.437c-.46 1.564-.842 2.907-1.43 3.743A1.97 1.97 0 019 22",fill:p.fill,transform:"translate(0 1)"}),c.jsx("path",{d:"M9 22h8.749c2.5 0 4-3.332 5-6.663 1.184-3.948 2.734-9.227-1.75-9.227H17.22c-1.129 0-2.12.754-2.43 1.848a1149.2 1149.2 0 01-2.713 9.437c-.46 1.564-.842 2.907-1.43 3.743A1.97 1.97 0 019 22",fill:g.fill,transform:"translate(0 1)"}),c.jsxs("defs",{children:[c.jsxs("radialGradient",{cx:"85.44%",cy:"100.653%",fx:"85.44%",fy:"100.653%",gradientTransform:"scale(-.8553 -1) rotate(50.927 2.041 -1.946)",id:l.id,r:"105.116%",children:[c.jsx("stop",{offset:"9.6%",stopColor:"#00AEFF"}),c.jsx("stop",{offset:"77.3%",stopColor:"#2253CE"}),c.jsx("stop",{offset:"100%",stopColor:"#0736C4"})]}),c.jsxs("radialGradient",{cx:"18.143%",cy:"32.928%",fx:"18.143%",fy:"32.928%",gradientTransform:"scale(.8897 1) rotate(52.069 .193 .352)",id:d.id,r:"95.612%",children:[c.jsx("stop",{offset:"0%",stopColor:"#FFB657"}),c.jsx("stop",{offset:"63.4%",stopColor:"#FF5F3D"}),c.jsx("stop",{offset:"92.3%",stopColor:"#C02B3C"})]}),c.jsxs("radialGradient",{cx:"82.987%",cy:"-9.792%",fx:"82.987%",fy:"-9.792%",gradientTransform:"scale(-1 -.9441) rotate(-70.872 .142 1.17)",id:p.id,r:"140.622%",children:[c.jsx("stop",{offset:"6.6%",stopColor:"#8C48FF"}),c.jsx("stop",{offset:"50%",stopColor:"#F2598A"}),c.jsx("stop",{offset:"89.6%",stopColor:"#FFB152"})]}),c.jsxs("linearGradient",{id:u.id,x1:"39.465%",x2:"46.884%",y1:"12.117%",y2:"103.774%",children:[c.jsx("stop",{offset:"15.6%",stopColor:"#0D91E1"}),c.jsx("stop",{offset:"48.7%",stopColor:"#52B471"}),c.jsx("stop",{offset:"65.2%",stopColor:"#98BD42"}),c.jsx("stop",{offset:"93.7%",stopColor:"#FFC800"})]}),c.jsxs("linearGradient",{id:f.id,x1:"45.949%",x2:"50%",y1:"0%",y2:"100%",children:[c.jsx("stop",{offset:"0%",stopColor:"#3DCBFF"}),c.jsx("stop",{offset:"24.7%",stopColor:"#0588F7",stopOpacity:"0"})]}),c.jsxs("linearGradient",{id:g.id,x1:"83.507%",x2:"83.453%",y1:"-6.106%",y2:"21.131%",children:[c.jsx("stop",{offset:"5.8%",stopColor:"#F8ADFA"}),c.jsx("stop",{offset:"70.8%",stopColor:"#A86EDD",stopOpacity:"0"})]})]})]}))});function C2(e){"@babel/helpers - typeof";return C2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},C2(e)}function OB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function O7e(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?OB(Object(n),!0).forEach(function(i){R7e(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function R7e(e,r,n){return r=M7e(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function M7e(e){var r=P7e(e,"string");return C2(r)=="symbol"?r:String(r)}function P7e(e,r){if(C2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(C2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function L7e(e){if(e==null)throw new TypeError("Cannot destructure "+e)}var $7e=y.memo(function(e){var r=Object.assign({},(L7e(e),e));return c.jsx(pl,O7e({Icon:z9,"aria-label":S0,background:y7e,color:v7e,iconMultiple:x7e},r))});function j2(e){"@babel/helpers - typeof";return j2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},j2(e)}var D7e=["size","style"];function RB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function _T(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?RB(Object(n),!0).forEach(function(i){I7e(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function I7e(e,r,n){return r=B7e(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function B7e(e){var r=z7e(e,"string");return j2(r)=="symbol"?r:String(r)}function z7e(e,r){if(j2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(j2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function F7e(e,r){if(e==null)return{};var n=H7e(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function H7e(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var NQ=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=F7e(e,D7e);return c.jsxs("svg",_T(_T({fill:"currentColor",fillRule:"evenodd",height:n,style:_T({flex:"none",lineHeight:1},i),viewBox:"0 0 24 24",width:n,xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:S0}),c.jsx("path",{d:"M9 23l.073-.001a2.53 2.53 0 01-2.347-1.838l-.697-2.433a2.529 2.529 0 00-2.426-1.839h-.497l-.104-.002c-4.485 0-2.935-5.278-1.75-9.225l.162-.525C2.412 3.99 3.883 1 6.25 1h8.86c1.12 0 2.106.745 2.422 1.829l.715 2.453a2.53 2.53 0 002.247 1.823l.147.005.534.001c3.557.115 3.088 3.745 2.156 7.206l-.113.413c-.154.548-.315 1.089-.47 1.607l-.163.525C21.588 20.01 20.116 23 17.75 23h-8.75zm8.22-15.89l-3.856.001a2.526 2.526 0 00-2.35 1.615L9.21 15.04a2.529 2.529 0 01-2.43 1.847l3.853.002c1.056 0 1.992-.661 2.361-1.644l1.796-6.287a2.529 2.529 0 012.43-1.848z"})]}))});function N2(e){"@babel/helpers - typeof";return N2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},N2(e)}var W7e=["size","style"];function MB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function wT(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?MB(Object(n),!0).forEach(function(i){U7e(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function U7e(e,r,n){return r=V7e(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function V7e(e){var r=q7e(e,"string");return N2(r)=="symbol"?r:String(r)}function q7e(e,r){if(N2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(N2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function G7e(e,r){if(e==null)return{};var n=K7e(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function K7e(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var TQ=y.memo(function(e){var r=e.size,n=r===void 0?"1em":r,i=e.style,s=G7e(e,W7e);return c.jsxs("svg",wT(wT({fill:"currentColor",fillRule:"evenodd",height:n,style:wT({flex:"none",lineHeight:1},i),viewBox:"0 0 73 24",xmlns:"http://www.w3.org/2000/svg"},s),{},{children:[c.jsx("title",{children:S0}),c.jsx("path",{d:"M34.977 6.95c1.544 0 2.778.547 3.66 1.636.861 1.064 1.287 2.473 1.287 4.208 0 1.918-.476 3.479-1.437 4.663-.98 1.207-2.33 1.815-4.008 1.815-1.051 0-1.953-.308-2.69-.915l-.12-.104V24h-2.72V7.204h2.72v1.028l.054-.054c.804-.76 1.809-1.171 2.997-1.223l.257-.005zm22.557 0c1.75 0 3.147.549 4.154 1.65.999 1.093 1.493 2.59 1.493 4.469 0 1.847-.533 3.353-1.604 4.49-1.076 1.142-2.52 1.713-4.298 1.713-1.735 0-3.146-.557-4.201-1.67-1.05-1.109-1.573-2.572-1.573-4.364 0-1.94.543-3.486 1.636-4.607 1.095-1.122 2.57-1.681 4.393-1.681zm-36.031 0c1.75 0 3.147.549 4.154 1.65.999 1.093 1.493 2.59 1.493 4.469 0 1.847-.533 3.353-1.604 4.49-1.076 1.142-2.52 1.713-4.298 1.713-1.734 0-3.146-.557-4.2-1.67-1.05-1.109-1.574-2.572-1.574-4.364 0-1.94.543-3.486 1.636-4.607 1.095-1.122 2.57-1.681 4.393-1.681zM10.257 2.613c1.506 0 2.766.22 3.782.666l.294.129v3.05l-.728-.405c-1.015-.565-2.136-.847-3.37-.847-1.615 0-2.9.528-3.891 1.59-.996 1.066-1.496 2.5-1.496 4.327 0 1.73.466 3.08 1.391 4.08.92.993 2.12 1.488 3.636 1.488 1.442 0 2.677-.316 3.715-.945l.743-.45v2.893l-.263.139c-1.2.632-2.678.944-4.429.944-2.295 0-4.158-.746-5.556-2.238C2.695 15.549 2 13.604 2 11.228c0-2.55.779-4.634 2.337-6.225 1.558-1.591 3.542-2.39 5.92-2.39zm58.006 1.203l-.001 3.387H71V9.67l-2.738-.001v5.611c0 .556.08.946.212 1.17l.052.077c.143.18.412.281.848.281.336 0 .61-.087.842-.261l.784-.59v2.756l-.255.14c-.49.27-1.11.4-1.859.4-2.185 0-3.344-1.29-3.344-3.666V9.668h-1.867V7.205l1.866-.001.001-2.51.34-.11 1.74-.56.64-.207zm-23.82 3.388v11.814h-2.72V7.204h2.72zM49.707 2v17.018h-2.72V2h2.72zm-28.33 7.394c-.98 0-1.727.32-2.281.966-.568.66-.858 1.592-.858 2.815 0 1.17.291 2.064.863 2.707.561.632 1.308.946 2.276.946.986 0 1.711-.304 2.218-.913.523-.628.793-1.55.793-2.783 0-1.248-.27-2.181-.795-2.816-.506-.615-1.231-.922-2.216-.922zm13.166 0c-.873 0-1.552.293-2.072.885-.534.609-.8 1.372-.8 2.314v1.512c0 .772.245 1.41.742 1.942.49.524 1.1.781 1.865.781.902 0 1.581-.33 2.085-1.008.527-.71.799-1.725.799-3.058 0-1.1-.247-1.935-.727-2.522-.463-.567-1.08-.846-1.892-.846zm22.865 0c-.98 0-1.727.32-2.281.966-.568.66-.858 1.592-.858 2.815 0 1.17.291 2.064.863 2.707.561.632 1.308.946 2.276.946.986 0 1.711-.304 2.218-.913.523-.628.793-1.55.793-2.783 0-1.248-.27-2.181-.795-2.816-.507-.615-1.231-.922-2.216-.922zM43.105 2.2c.444 0 .836.156 1.151.46.32.309.485.707.485 1.164 0 .443-.165.834-.482 1.145a1.605 1.605 0 01-1.154.468c-.437 0-.825-.154-1.136-.454a1.561 1.561 0 01-.48-1.16c0-.454.162-.851.477-1.16.312-.306.7-.463 1.139-.463z"})]}))});function T2(e){"@babel/helpers - typeof";return T2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},T2(e)}var Y7e=["type"];function PB(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,i)}return n}function X7e(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?PB(Object(n),!0).forEach(function(i){Z7e(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PB(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Z7e(e,r,n){return r=J7e(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function J7e(e){var r=Q7e(e,"string");return T2(r)=="symbol"?r:String(r)}function Q7e(e,r){if(T2(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,r);if(T2(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function eRe(e,r){if(e==null)return{};var n=tRe(e,r),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)i=o[s],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function tRe(e,r){if(e==null)return{};var n={},i=Object.keys(e),s,o;for(o=0;o<i.length;o++)s=i[o],!(r.indexOf(s)>=0)&&(n[s]=e[s]);return n}var rRe=y.memo(function(e){var r=e.type,n=r===void 0?"mono":r,i=eRe(e,Y7e),s=n==="color"?z9:NQ;return c.jsx(ml,X7e({Icon:s,Text:TQ,"aria-label":S0,spaceMultiple:g7e,textMultiple:m7e},i))}),G0=NQ;G0.Color=z9;G0.Text=TQ;G0.Combine=rRe;G0.Avatar=$7e;G0.colorPrimary=jQ;G0.title=S0;const hd="jait-auth-token",f5="token",F9="jait-auth-token";let fd=null;function k0(){if(typeof window>"u")return null;try{return window.localStorage}catch{return null}}function H9(){if(typeof window>"u")return null;try{return window.sessionStorage}catch{return null}}function W9(){return typeof window>"u"?null:window.jaitDesktop??null}function ev(){return typeof window>"u"?!1:!!window.jaitDesktop||!!window.Capacitor}async function nRe(){const e=W9();if(e!=null&&e.credentialGet)try{const i=await e.credentialGet(F9);if(i!=null&&i.value){fd=i.value;return}}catch{}if(!ev()){LB();const i=k0(),s=(i==null?void 0:i.getItem(hd))??null;if(s){fd=s,i==null||i.removeItem(hd);return}try{const{getApiUrl:o}=await Ke(async()=>{const{getApiUrl:l}=await Promise.resolve().then(()=>AQ);return{getApiUrl:l}},void 0,import.meta.url),a=await fetch(`${o()}/api/auth/refresh`,{method:"POST",credentials:"include"});if(a.ok){const l=await a.json();if(l.access_token){fd=l.access_token;return}}}catch{}return}LB();const r=k0(),n=(r==null?void 0:r.getItem(hd))??null;n&&(fd=n)}function LB(){const e=H9(),r=k0(),n=(e==null?void 0:e.getItem(hd))??null;n&&(ev()&&(r==null||r.setItem(hd,n)),e==null||e.removeItem(hd),fd||(fd=n));const i=(r==null?void 0:r.getItem(f5))??null;i&&(ev()&&(r==null||r.setItem(hd,i)),r==null||r.removeItem(f5),fd||(fd=i))}function h0(){return fd}function iRe(e){var r,n,i;if(fd=e,ev()){(r=k0())==null||r.setItem(hd,e),(n=k0())==null||n.removeItem(f5),(i=H9())==null||i.removeItem(hd);const s=W9();s!=null&&s.credentialStore&&s.credentialStore(F9,e).catch(()=>{})}}function ST(){var e,r,n;if(fd=null,(e=k0())==null||e.removeItem(hd),(r=k0())==null||r.removeItem(f5),(n=H9())==null||n.removeItem(hd),ev()){const i=W9();i!=null&&i.credentialClear&&i.credentialClear(F9).catch(()=>{})}}async function sRe(){if(!ev())try{const{getApiUrl:e}=await Ke(async()=>{const{getApiUrl:r}=await Promise.resolve().then(()=>AQ);return{getApiUrl:r}},void 0,import.meta.url);await fetch(`${e()}/api/auth/logout`,{method:"POST",credentials:"include"})}catch{}}const hC="jait-gateway-url";function oRe(){return typeof window>"u"?!1:!!(window.jaitDesktop||window.Capacitor)}function p5(){return oRe()}function aRe(){var e;return typeof window<"u"&&((e=window.location)!=null&&e.origin)&&window.location.origin!=="null"?window.location.origin:"http://localhost:8000"}function lRe(){var e;return typeof window<"u"&&((e=window.location)!=null&&e.origin)&&window.location.origin!=="null"?window.location.origin:"http://localhost:8000"}function Om(e){return e.endsWith("/")?e.slice(0,-1):e}function kT(e){return e.replace(/^http/,"ws")}function cRe(e,r=!1){try{const n=new URL(e);return r&&n.port&&n.port!=="8000"&&(n.port="8000"),Om(n.toString())}catch{return Om(e)}}function tv(){if(!p5())return null;try{const e=localStorage.getItem(hC);return e&&e.trim()?e.trim():null}catch{return null}}function EQ(e){if(!p5()){try{localStorage.removeItem(hC)}catch{}window.dispatchEvent(new Event("jait-gateway-url-changed"));return}try{e&&e.trim()?localStorage.setItem(hC,Om(e.trim())):localStorage.removeItem(hC)}catch{}window.dispatchEvent(new Event("jait-gateway-url-changed"))}function $n(){var n;const e=tv();if(e)return Om(e);const r=typeof window<"u"?(n=window.jaitDesktop)==null?void 0:n.gatewayUrl:void 0;return r?Om(r):aRe()}function K0(){var n;const e=tv();if(e)return Om(kT(e));const r=typeof window<"u"?(n=window.jaitDesktop)==null?void 0:n.gatewayUrl:void 0;return Om(kT(r||lRe()))}function gA(){var e;return!!(p5()&&tv()||typeof window<"u"&&((e=window.jaitDesktop)!=null&&e.gatewayUrl)||!p5())}const uRe=$n(),dRe=K0(),AQ=Object.freeze(Object.defineProperty({__proto__:null,API_URL:uRe,WS_URL:dRe,getApiUrl:$n,getStoredGatewayUrl:tv,getWsUrl:K0,isGatewayConfigured:gA,normalizeDirectGatewayBase:cRe,setStoredGatewayUrl:EQ},Symbol.toStringTag,{value:"Module"})),Xn=$n();class hRe{constructor(){ze(this,"_providersInflight",null);ze(this,"_providersCachedAt",0);ze(this,"_modelsInflight",new Map);ze(this,"_modelsCachedAt",new Map)}getToken(){return h0()}getHeaders(r=!1){const n={};r&&(n["Content-Type"]="application/json");const i=this.getToken();return i&&(n.Authorization=`Bearer ${i}`),n}async listProviders(){const r=Date.now();return this._providersInflight&&r-this._providersCachedAt<5e3?this._providersInflight:(this._providersCachedAt=r,this._providersInflight=(async()=>{const n=await fetch(`${Xn}/api/providers`,{headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to list providers: ${n.statusText}`);const i=await n.json();return{providers:i.providers,remoteProviders:i.remoteProviders??[]}})(),this._providersInflight.catch(()=>{this._providersInflight=null,this._providersCachedAt=0}),this._providersInflight)}async listProvidersFresh(){return this._providersInflight=null,this._providersCachedAt=0,this.listProviders()}async getProviderAuthStatus(r){const n=await fetch(`${Xn}/api/providers/${r}/auth/status`,{headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to get provider auth status: ${n.statusText}`);return n.json()}async startProviderLogin(r){const n=await fetch(`${Xn}/api/providers/${r}/auth/login`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify({})}),i=await n.json().catch(()=>null);if(!n.ok){const s=i&&"message"in i&&typeof i.message=="string"?i.message:i&&"error"in i&&typeof i.error=="string"?i.error:`Failed to start provider login: ${n.statusText}`;throw new Error(s)}return i}async logoutProvider(r){const n=await fetch(`${Xn}/api/providers/${r}/auth/logout`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify({})}),i=await n.json().catch(()=>null);if(!n.ok){const s=i&&"message"in i&&typeof i.message=="string"?i.message:i&&"error"in i&&typeof i.error=="string"?i.error:`Failed to log out provider: ${n.statusText}`;throw new Error(s)}return i}async listProviderModels(r){const n=Date.now(),i=this._modelsCachedAt.get(r)??0,s=this._modelsInflight.get(r);if(s&&n-i<5e3)return s;this._modelsCachedAt.set(r,n);const o=(async()=>{const a=await fetch(`${Xn}/api/providers/${r}/models`,{headers:this.getHeaders()});if(!a.ok)throw new Error(`Failed to list models: ${a.statusText}`);return a.json()})();return this._modelsInflight.set(r,o),o.catch(()=>{this._modelsInflight.delete(r),this._modelsCachedAt.delete(r)}),o}async listThreads(r){return(await this.listThreadsPage({sessionId:r})).threads}async listThreadsPage(r={}){const n=new URLSearchParams;r.sessionId&&n.set("sessionId",r.sessionId),typeof r.limit=="number"&&n.set("limit",String(r.limit));const i=n.toString(),s=await fetch(`${Xn}/api/threads${i?`?${i}`:""}`,{headers:this.getHeaders()});if(!s.ok)throw new Error(`Failed to list threads: ${s.statusText}`);const o=await s.json();return{threads:o.threads,hasMore:!!o.hasMore}}async getThread(r){const n=await fetch(`${Xn}/api/threads/${r}`,{headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to get thread: ${n.statusText}`);return n.json()}async createThread(r){const n=await fetch(`${Xn}/api/threads`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify(r)});if(!n.ok)throw new Error(`Failed to create thread: ${n.statusText}`);return n.json()}async updateThread(r,n){const i=await fetch(`${Xn}/api/threads/${r}`,{method:"PATCH",headers:this.getHeaders(!0),body:JSON.stringify(n)});if(!i.ok)throw new Error(`Failed to update thread: ${i.statusText}`);return i.json()}async deleteThread(r){const n=await fetch(`${Xn}/api/threads/${r}`,{method:"DELETE",headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to delete thread: ${n.statusText}`)}async startThread(r,n){const i=typeof n=="string"?{message:n}:n??{},s=await fetch(`${Xn}/api/threads/${r}/start`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify(i)});if(!s.ok){const o=await s.json().catch(()=>({})),a=new Error(o.error||`Failed to start thread: ${s.statusText}`);throw o.code&&(a.code=o.code),a}return s.json()}async sendTurn(r,n){const i=typeof n=="string"?{message:n}:n,s=await fetch(`${Xn}/api/threads/${r}/send`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify(i)});if(!s.ok)throw new Error(`Failed to send turn: ${s.statusText}`)}async stopThread(r){const n=await fetch(`${Xn}/api/threads/${r}/stop`,{method:"POST",headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to stop thread: ${n.statusText}`)}async interruptThread(r){const n=await fetch(`${Xn}/api/threads/${r}/interrupt`,{method:"POST",headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to interrupt thread: ${n.statusText}`)}async approveToolCall(r,n,i){const s=await fetch(`${Xn}/api/threads/${r}/approve`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify({requestId:n,approved:i})});if(!s.ok)throw new Error(`Failed to approve: ${s.statusText}`)}async createPullRequest(r,n){const i=await fetch(`${Xn}/api/threads/${r}/create-pr`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify(n)});if(!i.ok){const s=await i.json().catch(()=>({}));throw new Error(s.error||`Failed to create pull request: ${i.statusText}`)}return i.json()}async getActivities(r,n){const i=typeof n=="number"?`?limit=${n}`:"",s=await fetch(`${Xn}/api/threads/${r}/activities${i}`,{headers:this.getHeaders()});if(!s.ok)throw new Error(`Failed to get activities: ${s.statusText}`);return(await s.json()).activities}async listRepos(){const r=await fetch(`${Xn}/api/repos`,{headers:this.getHeaders()});if(!r.ok)throw new Error(`Failed to list repos: ${r.statusText}`);return(await r.json()).repos}async createRepo(r){const n=await fetch(`${Xn}/api/repos`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify(r)});if(!n.ok)throw new Error(`Failed to create repo: ${n.statusText}`);return(await n.json()).repo}async updateRepo(r,n){const i=await fetch(`${Xn}/api/repos/${r}`,{method:"PATCH",headers:this.getHeaders(!0),body:JSON.stringify(n)});if(!i.ok)throw new Error(`Failed to update repo: ${i.statusText}`);return(await i.json()).repo}async deleteRepo(r){const n=await fetch(`${Xn}/api/repos/${r}`,{method:"DELETE",headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to delete repo: ${n.statusText}`)}async getRepoStrategy(r){const n=await fetch(`${Xn}/api/repos/${r}/strategy`,{headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to get strategy: ${n.statusText}`);return(await n.json()).strategy}async updateRepoStrategy(r,n){const i=await fetch(`${Xn}/api/repos/${r}/strategy`,{method:"PUT",headers:this.getHeaders(!0),body:JSON.stringify({strategy:n})});if(!i.ok)throw new Error(`Failed to update strategy: ${i.statusText}`);return(await i.json()).strategy}async generateRepoStrategy(r){const n=await fetch(`${Xn}/api/repos/${r}/strategy/generate`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify({})});if(!n.ok){const s=await n.json().catch(()=>({error:n.statusText}));throw new Error(s.error||`Failed to generate strategy: ${n.statusText}`)}return(await n.json()).strategy}async listPlans(r){const n=await fetch(`${Xn}/api/repos/${r}/plans`,{headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to list plans: ${n.statusText}`);return(await n.json()).plans}async createPlan(r,n){const i=await fetch(`${Xn}/api/repos/${r}/plans`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify(n??{})});if(!i.ok)throw new Error(`Failed to create plan: ${i.statusText}`);return(await i.json()).plan}async getPlan(r){const n=await fetch(`${Xn}/api/plans/${r}`,{headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to get plan: ${n.statusText}`);return(await n.json()).plan}async updatePlan(r,n){const i=await fetch(`${Xn}/api/plans/${r}`,{method:"PATCH",headers:this.getHeaders(!0),body:JSON.stringify(n)});if(!i.ok)throw new Error(`Failed to update plan: ${i.statusText}`);return(await i.json()).plan}async deletePlan(r){const n=await fetch(`${Xn}/api/plans/${r}`,{method:"DELETE",headers:this.getHeaders()});if(!n.ok)throw new Error(`Failed to delete plan: ${n.statusText}`)}async generatePlanTasks(r,n){const i=await fetch(`${Xn}/api/plans/${r}/generate`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify(n??{})});if(!i.ok){const s=await i.json().catch(()=>({error:i.statusText}));throw new Error(s.error||`Failed to generate tasks: ${i.statusText}`)}return await i.json()}async startPlanTask(r,n){const i=await fetch(`${Xn}/api/plans/${r}/tasks/${n}/start`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify({})});if(!i.ok)throw new Error(`Failed to start task: ${i.statusText}`);return await i.json()}async startAllPlanTasks(r){const n=await fetch(`${Xn}/api/plans/${r}/start`,{method:"POST",headers:this.getHeaders(!0),body:JSON.stringify({})});if(!n.ok){const i=await n.json().catch(()=>({error:n.statusText}));throw new Error(i.error||`Failed to start tasks: ${n.statusText}`)}return await n.json()}}const Yr=new hRe,qg=$n(),CT={theme:"system",api_keys:{},stt_provider:"whisper",chat_provider:"jait",jait_backend:"openai",recent_models:[],workspace_picker_path:null,workspace_picker_node_id:null,updated_at:new Date(0).toISOString()};async function jT(e){try{const r=await fetch(`${qg}/api/auth/settings`,{headers:{Authorization:`Bearer ${e}`}});return r.ok?await r.json():null}catch{return null}}function OQ(){const[e,r]=y.useState({user:null,token:null,settings:null,isLoading:!0}),n=y.useCallback(async p=>{try{const g=await fetch(`${qg}/api/auth/me`,{headers:{Authorization:`Bearer ${p}`}});if(!g.ok){ST(),r({user:null,token:null,settings:null,isLoading:!1});return}const v=await g.json(),b=await jT(p);r({user:v,token:p,settings:b??CT,isLoading:!1})}catch{ST(),r({user:null,token:null,settings:null,isLoading:!1})}},[]);y.useEffect(()=>{(async()=>{await nRe();const p=h0();if(p){n(p);return}r(g=>({...g,isLoading:!1}))})()},[n]);const i=y.useCallback(async p=>{iRe(p.access_token),r({user:p.user,token:p.access_token,settings:CT,isLoading:!1});const g=await jT(p.access_token);g&&r(v=>v.token!==p.access_token?v:{...v,settings:g})},[]),s=y.useCallback(async(p,g)=>{const v=await fetch(`${qg}/api/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({username:p,password:g})});if(!v.ok){const _=await v.json().catch(()=>({detail:"Login failed"}));throw new Error(_.detail??"Login failed")}const b=await v.json();return await i(b),b},[i]),o=y.useCallback(async(p,g)=>{const v=await fetch(`${qg}/api/auth/register`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({username:p,password:g})});if(!v.ok){const _=await v.json().catch(()=>({detail:"Registration failed"}));throw new Error(_.detail??"Registration failed")}const b=await v.json();return await i(b),b},[i]),a=y.useCallback(()=>{ST(),sRe(),r({user:null,token:null,settings:null,isLoading:!1})},[]),l=y.useCallback(async()=>{if(!e.token)return null;const p=await jT(e.token);return p?(r(g=>({...g,settings:p})),p):null},[e.token]),d=y.useCallback(async p=>{if(!e.token)throw new Error("Not authenticated");const g=await fetch(`${qg}/api/auth/settings`,{method:"PATCH",headers:{Authorization:`Bearer ${e.token}`,"Content-Type":"application/json"},body:JSON.stringify(p)});if(!g.ok){const b=await g.json().catch(()=>({detail:"Failed to update settings"}));throw new Error(b.detail??"Failed to update settings")}const v=await g.json();return r(b=>({...b,settings:v})),v},[e.token]),u=y.useCallback(async()=>{if(!e.token)throw new Error("Not authenticated");const p=await fetch(`${qg}/api/auth/settings/archive`,{method:"DELETE",headers:{Authorization:`Bearer ${e.token}`}});if(!p.ok){const g=await p.json().catch(()=>({detail:"Failed to clear archive"}));throw new Error(g.detail??"Failed to clear archive")}return await p.json()},[e.token]),f=y.useCallback(async p=>{if(e.token)try{await fetch(`${qg}/api/auth/session/bind`,{method:"POST",headers:{Authorization:`Bearer ${e.token}`,"Content-Type":"application/json"},body:JSON.stringify({session_id:p})})}catch{}},[e.token]);return{user:e.user,token:e.token,settings:e.settings??CT,isLoading:e.isLoading,isAuthenticated:!!e.user,login:s,register:o,logout:a,bindSession:f,refreshSettings:l,updateSettings:d,clearSessionArchive:u}}const fRe=({className:e})=>c.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 1024 1024",className:e,children:[c.jsx("path",{d:"M318 372 L430 486 L318 600",fill:"none",stroke:"currentColor",strokeWidth:"88",strokeLinecap:"round",strokeLinejoin:"round"}),c.jsx("path",{d:"M610 258 L610 642 C610 734 549 796 455 796 C393 796 338 766 299 715",fill:"none",stroke:"currentColor",strokeWidth:"88",strokeLinecap:"round",strokeLinejoin:"round"})]}),pRe=({className:e})=>c.jsx(es,{size:16,className:e}),mRe=({className:e})=>c.jsx(Fl,{size:16,className:e}),gRe=({className:e})=>c.jsx(Oh,{size:16,className:e}),yRe=({className:e})=>c.jsx(G0,{size:16,className:e}),vRe=[{value:"jait",label:"Jait",icon:fRe,description:"Native Jait agent loop with full tool access"},{value:"codex",label:"Codex",icon:pRe,description:"OpenAI Codex CLI — coding agent with MCP tools"},{value:"claude-code",label:"Claude Code",icon:mRe,description:"Anthropic Claude Code CLI — coding agent with MCP tools"},{value:"gemini",label:"Gemini CLI",icon:gRe,description:"Google Gemini CLI — coding agent"},{value:"opencode",label:"OpenCode",icon:rK,description:"OpenCode CLI — open-source coding agent"},{value:"copilot",label:"Copilot",icon:yRe,description:"GitHub Copilot CLI — coding agent"}],RQ="jait-recent-models",U9=5;function xRe(e){const r=e.toLowerCase();return r.includes("not installed")||r.includes("not found")?"not installed":r.includes("not authenticated")||r.includes("login")?"not authenticated":"unavailable"}function yA(){try{const e=localStorage.getItem(RQ);if(!e)return[];const r=JSON.parse(e);return Array.isArray(r)?r.filter(n=>typeof n=="string").slice(0,U9):[]}catch{return[]}}function bRe(e){const r=yA().filter(n=>n!==e);r.unshift(e),localStorage.setItem(RQ,JSON.stringify(r.slice(0,U9)))}function _Re({provider:e,model:r,onProviderChange:n,onModelChange:i,disabled:s,className:o,compact:a=!1,repoRuntime:l,onMoveToGateway:d,sessionInfo:u,workspaceNodeId:f}){const p=Cv(),{updateSettings:g}=OQ(),[v,b]=y.useState(!1),[_,S]=y.useState(""),[w,C]=y.useState({}),[j,N]=y.useState([]),[A,E]=y.useState([]),[R,L]=y.useState([]),[z,$]=y.useState(!1),[W,B]=y.useState(null),[K,M]=y.useState(null),[I,P]=y.useState(null),F=y.useRef(null),V=(Me=!1)=>{(Me?Yr.listProvidersFresh():Yr.listProviders()).then(({providers:Je,remoteProviders:Ot})=>{const _e={};for(const Re of Je)_e[Re.id]=Re;C(_e),N(Ot)}).catch(()=>{})};y.useEffect(()=>{V()},[]);const Y=async(Me,nt)=>{try{await navigator.clipboard.writeText(nt),P(Je=>Je&&Je.providerId===Me?{...Je,copied:!0}:Je)}catch{P(Je=>Je&&Je.providerId===Me?{...Je,copied:!1}:Je)}},H=async(Me,nt)=>{if(!K){b(!1),M(Me),P({providerId:Me,label:nt,tone:"loading",message:`Starting ${nt} login...`});try{const Je=await Yr.startProviderLogin(Me);let Ot=!1;if(Je.userCode)try{await navigator.clipboard.writeText(Je.userCode),Ot=!0}catch{Ot=!1}P({providerId:Me,label:nt,tone:"success",message:Je.userCode?`Device code ${Ot?"copied to clipboard.":"is ready to copy."}`:Je.message,userCode:Je.userCode,verificationUri:Je.verificationUri,copied:Ot}),V(!0)}catch(Je){P({providerId:Me,label:nt,tone:"error",message:Je instanceof Error?Je.message:`Failed to start ${nt} login.`})}finally{M(null)}}};y.useEffect(()=>{v&&(S(""),requestAnimationFrame(()=>{var Me;return(Me=F.current)==null?void 0:Me.focus()}))},[v]),y.useEffect(()=>{E([]),L(yA());let Me=!1;return $(!0),Yr.listProviderModels(e).then(nt=>{var Je;Me||(E(nt.models),(Je=nt.recentModels)!=null&&Je.length&&L(nt.recentModels),nt.currentBackend&&B(nt.currentBackend))}).catch(()=>{Me||E([])}).finally(()=>{Me||$(!1)}),()=>{Me=!0}},[e]),y.useEffect(()=>{if(e==="jait"||z||A.length===0||r&&A.some(Je=>Je.id===r))return;const Me=A.find(Je=>Je.isDefault)??A[0]??null,nt=(Me==null?void 0:Me.id)??null;nt!==r&&i(nt)},[e,z,r,A,i]);const U=l!=null,J=(l==null?void 0:l.availableProviders)??[],q=(l==null?void 0:l.online)??!0,ee=(l==null?void 0:l.loading)??!1,te=(l==null?void 0:l.hostType)==="gateway",ue=!!(f&&f!=="gateway"),fe=ue?j.find(Me=>Me.nodeId===f):void 0,re=ue&&!U,ie=y.useMemo(()=>vRe.map(Me=>{const nt=w[Me.value];let Je,Ot,_e;if(U)Me.value==="jait"?(Je=!0,_e="Gateway"):te?(Je=(nt==null?void 0:nt.available)!==!1,Ot=nt==null?void 0:nt.unavailableReason,_e="Gateway"):ee?(Je=!1,Ot="Checking device…"):q?(Je=J.includes(Me.value),Ot=Je?void 0:"Not available on this device",_e=(l==null?void 0:l.locationLabel)??"device"):(Je=!1,Ot="Device is offline");else if(re)Me.value==="jait"?(Je=!0,_e="Gateway"):fe?(Je=fe.providers.includes(Me.value),Ot=Je?void 0:"Not available on this device",_e=fe.nodeName):(Je=!1,Ot="Device is offline");else{const Re=(nt==null?void 0:nt.available)!==!1,ke=Re?void 0:j.find($e=>$e.providers.includes(Me.value));Je=Re||!!ke,Ot=nt==null?void 0:nt.unavailableReason,_e=!(nt!=null&&nt.available)&&ke?ke.nodeName:"Gateway"}return{...Me,isAvailable:Je,reason:Ot,nodeLabel:_e,auth:nt==null?void 0:nt.auth}}),[w,j,U,te,ee,q,J,l==null?void 0:l.locationLabel,re,fe]),ge=ie.find(Me=>Me.value===e)??ie[0],le=ge.icon,et=r?A.find(Me=>Me.id===r):null,Xe=z?"Loading":(et==null?void 0:et.name)??r??"Default",De=U?te?"Gateway":l==null?void 0:l.locationLabel:re?(fe==null?void 0:fe.nodeName)??f:u!=null&&u.isRemote&&u.remoteNode?u.remoteNode.nodeName:void 0,de=_.trim().toLowerCase(),Qe=y.useMemo(()=>de?A.filter(Me=>{var nt;return Me.id.toLowerCase().includes(de)||Me.name.toLowerCase().includes(de)||((nt=Me.description)==null?void 0:nt.toLowerCase().includes(de))}):A,[A,de]),Ie=y.useMemo(()=>{if(de)return[];const Me=new Map(A.map(nt=>[nt.id,nt]));return R.filter(nt=>Me.has(nt)).map(nt=>Me.get(nt)).slice(0,U9)},[A,R,de]),Oe=y.useMemo(()=>{if(de)return Qe;const Me=new Set(Ie.map(nt=>nt.id));return Qe.filter(nt=>!Me.has(nt.id))},[Qe,Ie,de]),qe=Me=>{n(Me)},kt={OpenAI:"openai",OpenRouter:"openrouter",Ollama:"ollama"},vt=Me=>{const nt=A.find(Je=>Je.id===Me);if(e==="jait"&&(nt!=null&&nt.group)){const Je=kt[nt.group];Je&&Je!==W&&g({jait_backend:Je}).then(()=>{B(Je)}).catch(()=>{})}i(Me),bRe(Me),L(yA()),b(!1)};return c.jsxs(c.Fragment,{children:[c.jsxs(YR,{open:v,onOpenChange:b,children:[c.jsx(XR,{asChild:!0,disabled:s,children:c.jsxs("button",{type:"button",className:We("flex h-8 items-center gap-1 rounded-md border border-transparent px-1.5 py-1 text-xs font-medium text-muted-foreground","hover:text-foreground hover:bg-muted/60 transition-colors","focus-visible:outline-none focus-visible:border-ring/60 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring/50","disabled:pointer-events-none disabled:opacity-50",o),title:`Provider: ${ge.label} · Model: ${Xe}`,"aria-label":`Provider ${ge.label}, model ${Xe}`,children:[c.jsx(le,{className:"h-4 w-4 shrink-0"}),!a&&c.jsxs(c.Fragment,{children:[c.jsx("span",{children:ge.label}),c.jsx("span",{className:"max-w-[112px] truncate font-mono text-xs opacity-80",children:Xe})]}),!a&&De&&c.jsxs("span",{className:"flex max-w-[72px] items-center gap-0.5 truncate text-2xs text-blue-500",children:[c.jsx(Ra,{className:"h-3 w-3"}),De]}),z?c.jsx(ir,{className:"h-3 w-3 animate-spin opacity-70"}):null,c.jsx(hl,{className:"h-3 w-3 opacity-60"})]})}),c.jsxs(ZR,{align:"start",side:p?"bottom":"top",collisionPadding:8,className:"flex w-[min(22rem,calc(100vw-1rem))] flex-col overflow-hidden p-0",style:{maxHeight:p?"min(32rem, calc(var(--radix-popover-content-available-height, 100dvh) - 0.75rem))":"min(32rem, var(--radix-popover-content-available-height, 80dvh))"},children:[c.jsx("div",{className:"shrink-0 border-b px-3 py-2",children:c.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-muted-foreground",children:"Providers"})}),U&&!te&&!q&&!ee&&c.jsx("div",{className:"shrink-0 border-b px-3 py-2 text-xs text-amber-600 dark:text-amber-400",children:"Device is offline — only Jait (gateway) is available"}),U&&ee&&c.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 border-b px-3 py-2 text-xs text-muted-foreground",children:[c.jsx(ir,{className:"h-3 w-3 animate-spin"}),"Connecting to device…"]}),re&&!fe&&c.jsx("div",{className:"shrink-0 border-b px-3 py-2 text-xs text-amber-600 dark:text-amber-400",children:"Device is offline — only Jait (gateway) is available"}),c.jsxs("div",{className:"min-h-24 max-h-56 shrink-0 overflow-y-auto p-1",children:[ie.map(Me=>{var Re,ke;const nt=Me.icon,Je=Me.value===e,Ot=!!((Re=Me.auth)!=null&&Re.login)&&((ke=Me.auth)==null?void 0:ke.authenticated)!==!0&&!re&&(!U||te),_e=K===Me.value;return c.jsx("div",{className:We("rounded-sm",Je&&"bg-accent/50"),children:c.jsxs("div",{className:"flex items-start gap-1.5",children:[c.jsxs("button",{type:"button",onClick:()=>qe(Me.value),disabled:!Me.isAvailable,className:We("flex min-w-0 flex-1 items-start gap-2.5 rounded-sm px-2 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",!Me.isAvailable&&"cursor-not-allowed opacity-60"),children:[c.jsx(nt,{className:"mt-0.5 h-4 w-4 shrink-0"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-sm font-medium",children:[Me.label,Me.isAvailable&&Me.nodeLabel&&c.jsxs("span",{className:"flex items-center gap-0.5 text-2xs text-muted-foreground",children:[c.jsx(Ra,{className:"h-3 w-3"}),Me.nodeLabel]}),!Me.isAvailable&&c.jsxs("span",{className:"flex items-center gap-0.5 text-2xs text-destructive/80",children:[c.jsx(nC,{className:"h-3 w-3"}),Me.reason?xRe(Me.reason):"unavailable"]}),Me.auth&&Me.auth.authenticated===!0&&c.jsx("span",{className:"text-2xs text-emerald-600 dark:text-emerald-400",children:"signed in"})]}),c.jsx("div",{className:"text-xs leading-snug text-muted-foreground",children:!Me.isAvailable&&Me.reason?Me.reason:Me.description})]}),Je&&c.jsx(hs,{className:"mt-0.5 h-4 w-4 shrink-0 text-primary"})]}),Ot&&c.jsx("button",{type:"button",title:`Login to ${Me.label}`,"aria-label":`Login to ${Me.label}`,onClick:$e=>{$e.preventDefault(),$e.stopPropagation(),H(Me.value,Me.label)},disabled:!!K,className:"mr-1 mt-2 inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-border bg-background text-foreground transition-colors hover:bg-muted disabled:opacity-50",children:_e?c.jsx(ir,{className:"h-3.5 w-3.5 animate-spin"}):c.jsx(q0e,{className:"h-3.5 w-3.5"})})]})},Me.value)}),U&&!te&&!q&&!ee&&d&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"mx-2 my-1 border-t"}),c.jsxs("button",{type:"button",onClick:d,className:We("flex w-full items-start gap-2.5 rounded-sm px-2 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground"),children:[c.jsx(ro,{className:"mt-0.5 h-4 w-4 shrink-0"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("div",{className:"text-sm font-medium",children:"Move to Gateway"}),c.jsx("div",{className:"text-xs leading-snug text-muted-foreground",children:"Run this repo on the gateway server instead"})]})]})]})]}),c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"shrink-0 border-y px-3 py-2",children:c.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-muted-foreground",children:"Models"})}),c.jsx("div",{className:"shrink-0 border-b px-3 py-2",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Vl,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),c.jsx("input",{ref:F,type:"text",value:_,onChange:Me=>S(Me.target.value),placeholder:"Search models...",className:"flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]})}),c.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-1",children:[Ie.length>0&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5",children:[c.jsx(Xm,{className:"h-3 w-3 text-muted-foreground"}),c.jsx("span",{className:"text-2xs font-medium uppercase tracking-wider text-muted-foreground",children:"Recent"})]}),Ie.map(Me=>c.jsx(NT,{model:Me,selected:r===Me.id,onSelect:vt},`recent-${Me.id}`)),c.jsx("div",{className:"mx-2 my-1 border-t"})]}),!de&&Ie.length>0&&c.jsx("div",{className:"px-2 py-1.5",children:c.jsx("span",{className:"text-2xs font-medium uppercase tracking-wider text-muted-foreground",children:"All models"})}),z&&c.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 text-xs text-muted-foreground",children:[c.jsx(ir,{className:"h-3.5 w-3.5 animate-spin"}),"Loading models…"]}),!z&&(()=>{if(!Oe.some(Ot=>Ot.group))return Oe.map(Ot=>c.jsx(NT,{model:Ot,selected:r===Ot.id,onSelect:vt},Ot.id));const nt=[],Je=new Set;for(const Ot of Oe){const _e=Ot.group||"Other";Je.has(_e)||(Je.add(_e),nt.push({label:_e,items:[]})),nt.find(Re=>Re.label===_e).items.push(Ot)}return nt.map(Ot=>c.jsxs("div",{children:[c.jsx("div",{className:"sticky top-0 z-10 bg-popover px-2 py-1.5",children:c.jsx("span",{className:"text-2xs font-medium uppercase tracking-wider text-muted-foreground",children:Ot.label})}),Ot.items.map(_e=>c.jsx(NT,{model:_e,selected:r===_e.id,onSelect:vt},_e.id))]},Ot.label))})(),!z&&Qe.length===0&&c.jsx("div",{className:"px-3 py-4 text-center text-xs text-muted-foreground",children:_?`No models matching "${_}"`:"No models available"})]})]})]})]}),c.jsx(Td,{open:!!I,onOpenChange:Me=>{Me||P(null)},children:c.jsxs(ku,{className:"w-[calc(100vw-1.5rem)] max-w-md",children:[c.jsxs(wd,{children:[c.jsxs(_u,{children:[(I==null?void 0:I.label)??"Provider"," login"]}),c.jsx($m,{children:(I==null?void 0:I.tone)==="loading"?I.message:"Use the device code below on the provider login page."})]}),I&&c.jsxs("div",{className:"space-y-4",children:[I.tone!=="loading"&&c.jsx("div",{className:We("rounded-md border px-3 py-2 text-sm",I.tone==="success"?"border-emerald-500/25 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":"border-destructive/25 bg-destructive/10 text-destructive"),children:I.message}),I.tone==="loading"&&c.jsxs("div",{className:"flex items-center gap-2 rounded-md border px-3 py-2 text-sm text-muted-foreground",children:[c.jsx(ir,{className:"h-4 w-4 animate-spin"}),"Starting device login..."]}),I.userCode&&c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("div",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Device code"}),c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx("code",{className:"min-w-0 flex-1 rounded-md border bg-muted px-3 py-2 text-center font-mono text-lg font-semibold [overflow-wrap:anywhere]",children:I.userCode}),c.jsxs(be,{variant:"outline",size:"sm",onClick:()=>void Y(I.providerId,I.userCode),children:[c.jsx(wc,{className:"mr-1.5 h-3.5 w-3.5"}),I.copied?"Copied":"Copy"]})]})]})]}),c.jsxs(W0,{className:"gap-2 sm:gap-0",children:[c.jsx(be,{variant:"outline",onClick:()=>P(null),children:"Close"}),(I==null?void 0:I.verificationUri)&&c.jsxs(be,{onClick:()=>window.open(I.verificationUri,"_blank","noopener,noreferrer"),children:[c.jsx(Uf,{className:"mr-1.5 h-4 w-4"}),"Open login page"]})]})]})})]})}function NT({model:e,selected:r,onSelect:n}){return c.jsxs("button",{type:"button",onClick:()=>n(e.id),className:We("flex w-full items-start gap-2 rounded-sm px-2 py-1.5 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent/50"),children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"truncate text-sm font-medium",children:[e.name,e.isDefault&&c.jsx("span",{className:"ml-1.5 text-2xs font-normal text-muted-foreground",children:"(default)"})]}),e.description&&c.jsx("div",{className:"truncate text-xs leading-snug text-muted-foreground",children:e.description})]}),r&&c.jsx(hs,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-primary"})]})}const $B={"full-access":{label:"Full access",description:"Provider runs without approval prompts when supported.",icon:H4},supervised:{label:"Supervised",description:"Provider asks for approvals when it supports them.",icon:Ef}};function wRe({provider:e,value:r,onChange:n,disabled:i,className:s,compact:o=!1}){const[a,l]=y.useState({});y.useEffect(()=>{Yr.listProviders().then(({providers:g})=>{const v={};for(const b of g)v[b.id]=b;l(v)}).catch(()=>{})},[]);const d=y.useMemo(()=>{var v;const g=(v=a[e])==null?void 0:v.modes;return!g||g.length===0?e==="jait"?[]:["full-access","supervised"]:g},[e,a]);if(e==="jait"||d.length<=1)return null;const u=d.includes(r)?r:d[0],f=$B[u],p=f.icon;return c.jsxs(mu,{children:[c.jsx(gu,{asChild:!0,disabled:i,children:c.jsxs("button",{type:"button",className:We("flex h-8 items-center gap-1 rounded-md border border-transparent px-1.5 py-1 text-xs font-medium text-muted-foreground","hover:text-foreground hover:bg-muted/60 transition-colors","focus-visible:outline-none focus-visible:border-ring/60 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring/50","disabled:pointer-events-none disabled:opacity-50",s),title:`Runtime: ${f.label}`,"aria-label":`Runtime: ${f.label}`,children:[c.jsx(p,{className:"h-4 w-4"}),!o&&c.jsx("span",{children:f.label}),c.jsx(hl,{className:"h-3 w-3 opacity-60"})]})}),c.jsx(kc,{align:"start",side:"top",className:"w-64",children:d.map(g=>{const v=$B[g],b=v.icon,_=u===g;return c.jsxs(Wi,{onClick:()=>n(g),className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[c.jsx(b,{className:"mt-0.5 h-4 w-4 shrink-0"}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"truncate text-sm font-medium",children:v.label}),c.jsx("div",{className:"text-xs text-muted-foreground",children:v.description})]})]}),_&&c.jsx(hs,{className:"mt-0.5 h-4 w-4 shrink-0"})]},g)})})]})}const MQ="application/x-jait-workspace+json",PQ="application/x-jait-terminal+json";function SRe(e,r){return{path:e,name:r||e.split(/[\\/]/).pop()||e}}function kRe(e,r,n){return{terminalId:e,name:r||e,...n?{workspaceRoot:n}:{}}}function fC(e,r){return JSON.stringify({value:e,segments:As(r)})}function CRe(e,r,n,i){const s=fC(r,n);if(e===s)return!1;const o=As(n);return o.length>0?JSON.stringify(i)!==JSON.stringify(o):i.length===0?r.length>0:X1(i)!==r}function jRe(e){const{startContainerIsRoot:r,startContainerIsText:n,startOffset:i,childIndex:s}=e;return s<=0?!1:r?!0:i===0}function NRe(e,r){return Math.max(0,Math.min(e-1,r))}const DB="https://cdn.jsdelivr.net/gh/vscode-icons/vscode-icons@12.9.0/icons/",IB=[];function m5(e){const r="lineRange"in e?e.lineRange:void 0,n=r?`:L${r.startLine}-L${r.endLine}`:"";if("type"in e&&e.type==="workspace")return`workspace:${e.path}`;if("type"in e&&e.type==="terminal"){const i=e.selectedText?`:${TRe(e.selectedText)}`:"";return`terminal:${e.terminalId}${n}${i}`}return`file:${e.path}${n}`}function TRe(e){let r=5381;for(let n=0;n<e.length;n++)r=(r<<5)+r^e.charCodeAt(n);return(r>>>0).toString(36)}function g5(e,r){const n=document.createElement("span");n.contentEditable="false";const i=m5(e);n.setAttribute("data-chip-ref",i),"type"in e&&e.type==="workspace"?(n.setAttribute("data-segment-type","workspace"),n.setAttribute("data-workspace-path",e.path),n.setAttribute("data-chip-name",e.name)):"type"in e&&e.type==="terminal"?(n.setAttribute("data-segment-type","terminal"),n.setAttribute("data-terminal-id",e.terminalId),n.setAttribute("data-chip-name",e.name),e.workspaceRoot&&n.setAttribute("data-workspace-root",e.workspaceRoot),e.lineRange&&(n.setAttribute("data-line-start",String(e.lineRange.startLine)),n.setAttribute("data-line-end",String(e.lineRange.endLine))),e.selectedText&&n.setAttribute("data-selected-text",e.selectedText)):(n.setAttribute("data-segment-type","file"),n.setAttribute("data-file-path",e.path),n.setAttribute("data-chip-name",e.name),e.kind&&n.setAttribute("data-kind",e.kind),e.lineRange&&(n.setAttribute("data-line-start",String(e.lineRange.startLine)),n.setAttribute("data-line-end",String(e.lineRange.endLine)))),n.className="inline-flex items-center gap-1.5 align-middle text-xs font-medium leading-none mx-[2px] rounded-md border border-border/70 bg-muted/45 pl-2 pr-1 py-1 text-foreground cursor-default whitespace-nowrap transition-colors";const s=document.createElement("span");if(s.className="inline-flex items-center shrink-0","type"in e&&e.type==="workspace")s.innerHTML=`<img src="${DB}${dd.DEFAULT_FOLDER}" alt="" class="h-3.5 w-3.5" draggable="false" />`;else if("type"in e&&e.type==="terminal")s.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.1" stroke-linecap="round" stroke-linejoin="round" class="h-3.5 w-3.5 text-muted-foreground"><path d="M4 17l6-6-6-6"/><path d="M12 19h8"/></svg>';else{const d=e.kind==="dir"?ARe(e.name):ERe(e.name);s.innerHTML=`<img src="${DB}${d}" alt="" class="h-3.5 w-3.5" draggable="false" />`}n.appendChild(s);const o=document.createElement("span");o.className="truncate max-w-[180px]";const a="lineRange"in e?o2(e.lineRange):"";o.textContent=a?`${e.name}:${a.replace(/^lines? /,"")}`:e.name,n.appendChild(o);const l=document.createElement("button");return l.type="button",l.className="inline-flex items-center p-0.5 rounded hover:bg-foreground/10 transition-colors text-muted-foreground hover:text-foreground",l.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',l.addEventListener("mousedown",d=>{d.preventDefault(),d.stopPropagation()}),l.addEventListener("click",d=>{d.preventDefault(),d.stopPropagation(),n.remove(),r==null||r(i)}),n.appendChild(l),n}function ERe(e){return dd.getIconForFile(e)??dd.DEFAULT_FILE}function ARe(e){return dd.getIconForFolder(e)??dd.DEFAULT_FOLDER}function Go(e){let r="";const n=e.childNodes;for(let i=0;i<n.length;i++){const s=n[i];if(s.nodeType===Node.TEXT_NODE)r+=s.textContent??"";else if(s instanceof HTMLElement){if(s.hasAttribute("data-chip-ref"))continue;s.tagName==="BR"?i===n.length-1||(r+=`
865
865
  `):r+=Go(s)}}return r}function ORe(e){return e.replace(/[\u200B\u200C\u200D\uFEFF]/g,"")}function vf(e){return ORe(e).length===0}function RRe(e){const r=[];return e.querySelectorAll('[data-segment-type="file"][data-file-path]').forEach(n=>{r.push(n.getAttribute("data-file-path"))}),r}function TT(e){const r=[];return e.querySelectorAll('[data-segment-type="file"][data-file-path]').forEach(n=>{const i=n.getAttribute("data-kind");r.push({path:n.getAttribute("data-file-path"),name:n.getAttribute("data-chip-name")||n.getAttribute("data-file-path").split(/[\\/]/).pop(),...i==="file"||i==="dir"?{kind:i}:{},...E2(n)})}),r}function Qa(e){const r=[],n=i=>{if(i.nodeType===Node.TEXT_NODE){const s=i.textContent??"";s&&r.push({type:"text",text:s});return}if(i instanceof HTMLElement){if(i.hasAttribute("data-chip-ref")){const s=i.getAttribute("data-segment-type");if(s==="workspace"){const l=i.getAttribute("data-workspace-path");if(!l)return;r.push({type:"workspace",path:l,name:i.getAttribute("data-chip-name")||l.split(/[\\/]/).pop()||l});return}if(s==="terminal"){const l=i.getAttribute("data-terminal-id");if(!l)return;const d=i.getAttribute("data-workspace-root");r.push({type:"terminal",terminalId:l,name:i.getAttribute("data-chip-name")||l,...d?{workspaceRoot:d}:{},...E2(i),...i.getAttribute("data-selected-text")?{selectedText:i.getAttribute("data-selected-text")}:{}});return}const o=i.getAttribute("data-file-path");if(!o)return;const a=i.getAttribute("data-kind");r.push({type:"file",path:o,name:i.getAttribute("data-chip-name")||o.split(/[\\/]/).pop()||o,...a==="file"||a==="dir"?{kind:a}:{},...E2(i)});return}if(i.tagName==="BR"){r.push({type:"text",text:`
866
866
  `});return}for(const s of i.childNodes)n(s)}};for(const i of e.childNodes)n(i);return As(r)}function E2(e){const r=Number.parseInt(e.getAttribute("data-line-start")??"",10),n=Number.parseInt(e.getAttribute("data-line-end")??"",10);return!Number.isFinite(r)||!Number.isFinite(n)||r<1||n<r?{}:{lineRange:{startLine:r,endLine:n}}}function xf(e){return!!(e!=null&&e.querySelector("[data-chip-ref]"))}function BB(e,r,n){const i=window.getSelection();if(!i)return;const s=document.createRange();(r==null?void 0:r.nodeType)===Node.TEXT_NODE?s.setStart(r,0):(r==null?void 0:r.parentNode)===e?s.setStart(e,Array.from(e.childNodes).indexOf(r)):s.setStart(e,NRe(n,e.childNodes.length)),s.collapse(!0),i.removeAllRanges(),i.addRange(s)}function zB(e,r,n){BB(e,r,n),requestAnimationFrame(()=>{e.isConnected&&BB(e,r,n)})}function ET(e,r,n,i){e.innerHTML="";const s=As(r);if(s.length===0){n&&e.appendChild(document.createTextNode(n));return}for(const o of s)vA(e,o,i)}function vA(e,r,n){if(r.type==="text"){e.appendChild(document.createTextNode(r.text));return}if(r.type==="file"||r.type==="workspace"||r.type==="terminal"){e.appendChild(g5(r,n));return}e.appendChild(document.createTextNode(`[image:${r.name}]`))}function MRe(e,r,n){var d;const i=window.getSelection();if(!i||i.rangeCount===0){for(const u of r)vA(e,u,n);c1(e);return}const s=i.getRangeAt(0);s.deleteContents();const o=document.createDocumentFragment();for(const u of r)vA(o,u,n);const a=o.lastChild;if(s.insertNode(o),!a)return;const l=document.createRange();a.nodeType===Node.TEXT_NODE?l.setStart(a,((d=a.textContent)==null?void 0:d.length)??0):l.setStartAfter(a),l.collapse(!0),i.removeAllRanges(),i.addRange(l)}function c1(e){const r=window.getSelection();if(r){const n=document.createRange();n.selectNodeContents(e),n.collapse(!1),r.removeAllRanges(),r.addRange(n)}}function xA(e){for(let r=e.childNodes.length-1;r>=0;r--){const n=e.childNodes[r];(n instanceof HTMLElement&&n.tagName==="BR"||n.nodeType===Node.TEXT_NODE&&!n.textContent)&&n.remove()}}function PRe(e){for(let r=e.childNodes.length-1;r>=0;r--){const n=e.childNodes[r];if(n.nodeType!==Node.TEXT_NODE){if(!(n instanceof HTMLElement)){n.remove();continue}if(!(n.hasAttribute("data-chip-ref")||n.tagName==="BR")){if(n.matches('button, a, input, textarea, select, svg, [role="button"]')||n.querySelector('button, a, input, textarea, select, svg, [role="button"]')){n.remove();continue}n.replaceWith(document.createTextNode(n.textContent??""))}}}}function FB(e,r,n){xA(e);for(const i of As(r)){if(i.type==="text"){i.text&&e.appendChild(document.createTextNode(i.text));continue}i.type!=="image"&&(e.querySelector(`[data-chip-ref="${CSS.escape(m5(i))}"]`)||(e.appendChild(g5(i,n)),e.appendChild(document.createTextNode(" "))))}}const ak=new Map,LRe=560;function $Re({levels:e=[],compact:r=!1}){const n=e.length>0?e:Array.from({length:28},()=>.05),i=r?n.slice(-16):n,s=r?24:30;return c.jsx("span",{className:We("flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden rounded-full border border-black/10 bg-gradient-to-b from-black/5 via-black/10 to-black/5 px-3 py-1 dark:border-white/10 dark:from-white/5 dark:via-white/10 dark:to-white/5",r?"h-8 max-w-[210px]":"h-10 max-w-[320px]"),children:i.map((o,a)=>c.jsx("span",{className:We("block shrink-0 rounded-full bg-black/75 transition-[height,opacity,transform] duration-300 ease-out dark:bg-white/80",r?"w-[2px]":"w-[3px]"),style:{height:`${6+o*s}px`,opacity:.18+o*.82,transform:`translateY(${(1-o)*1.5}px)`}},a))})}const Zb=y.forwardRef(function({value:r,onChange:n,onSubmit:i,onStop:s,onQueue:o,isLoading:a,disabled:l,controlsDisabled:d,placeholder:u="Ask anything...",className:f,footerLeadingContent:p,footerTrailingContent:g,onVoiceInput:v,voiceRecording:b,voiceLevels:_,voiceTranscribing:S,onVoiceStop:w,mode:C,onModeChange:j,sendTarget:N,onSendTargetChange:A,showSendTargetSelector:E=!0,provider:R,onProviderChange:L,responseStyle:z,onResponseStyleChange:$,providerRuntimeMode:W,onProviderRuntimeModeChange:B,cliModel:K,onCliModelChange:M,repoRuntime:I,onMoveToGateway:P,sessionInfo:F,workspaceNodeId:V,workspaceName:Y,workspacePath:H,availableFiles:U=IB,segments:J,onSearchFiles:q,workspaceOpen:ee=!1,draftStateKey:te,syncKey:ue},fe){const re=y.useRef(null),ie=y.useRef(null),ge=y.useRef(null),le=Cv(),[et,Xe]=y.useState(!1),[De,de]=y.useState(!1),Qe=y.useRef(0),[Ie,Oe]=y.useState(vf(r)),[qe,kt]=y.useState(()=>te?ak.get(te)??[]:[]),vt=y.useRef(null),Me=y.useRef(As(J)),nt=y.useRef(null),Je=y.useRef([]),Ot=y.useRef([]),_e=y.useRef(null),[Re,ke]=y.useState(!1),[$e,at]=y.useState(""),[gt,lt]=y.useState(0),ut=y.useRef(!1);y.useEffect(()=>{ut.current=Re},[Re]);const Ht=y.useRef(U);y.useEffect(()=>{Ht.current=U},[U]);const Fe=y.useRef(n);y.useEffect(()=>{Fe.current=n},[n]);const Ye=y.useRef(q);y.useEffect(()=>{Ye.current=q},[q]);const Pt=y.useRef(ee);y.useEffect(()=>{Pt.current=ee},[ee]);const ot=y.useRef(()=>{}),[Yt,tt]=y.useState([]),[Ge,It]=y.useState(!1),jt=y.useRef(null),Se=!!l,Et=!!(d??l??!1),yt=!!(R&&L&&M),mr=!!(z&&$),Er=!!(R&&W&&B),pn=!!(C&&j&&N!=="thread"&&(!R||R==="jait")),$r=E&&!!(N&&A),it=(Y==null?void 0:Y.trim())||(H==null?void 0:H.trim())||null,Rt=$r||yt||mr||Er||pn||!!p,Lr=Rt;y.useEffect(()=>{const Ce=re.current;if(!Ce||typeof ResizeObserver>"u"){Xe(!1);return}const Be=()=>{Xe(Ce.clientWidth<LRe)};Be();const Nt=new ResizeObserver(()=>Be());return Nt.observe(Ce),()=>Nt.disconnect()},[]);const ft=y.useRef(!1);y.useEffect(()=>{te&&kt(ak.get(te)??[])},[te]),y.useEffect(()=>{if(te){if(qe.length===0){ak.delete(te);return}ak.set(te,qe)}},[te,qe]);const fr=y.useCallback(Ce=>{var Nt;const Be=ie.current;Be&&(ot.current(!0),(Nt=Be.querySelector(`[data-chip-ref="${CSS.escape(Ce)}"]`))==null||Nt.remove(),Me.current=Qa(Be),ft.current=!0,Fe.current(Go(Be)),ft.current=!1,Oe(vf(Go(Be))&&!xf(Be)))},[]),Lt=y.useCallback(()=>{const Ce=ie.current;Ce&&(ET(Ce,[],"",fr),Me.current=[],nt.current=fC("",[]),ft.current=!0,Fe.current(""),ft.current=!1,Oe(!0),Je.current=[],Ot.current=[])},[fr]),Un=y.useCallback(Ce=>{const Be=()=>{const Nt=[...Me.current],pr=Je.current;pr.length>0&&JSON.stringify(pr[pr.length-1])===JSON.stringify(Nt)||(pr.push(Nt),pr.length>100&&pr.shift(),Ot.current=[])};Ce?(_e.current&&(clearTimeout(_e.current),_e.current=null),Be()):(_e.current&&clearTimeout(_e.current),_e.current=setTimeout(Be,300))},[]);y.useEffect(()=>{ot.current=Un},[Un]);const dt=y.useCallback(Ce=>{const Be=ie.current;if(!Be)return;ft.current=!0,ET(Be,Ce,"",fr),Me.current=Qa(Be);const Nt=Go(Be);Fe.current(Nt),Oe(vf(Nt)&&!xf(Be)),ft.current=!1,c1(Be)},[fr]);y.useImperativeHandle(fe,()=>({insertChip:Ce=>{const Be=ie.current;if(!Be||Be.querySelector(`[data-chip-ref="${CSS.escape(m5(Ce))}"]`))return;ot.current(!0),xA(Be);const Nt=g5(Ce,fr);Be.appendChild(Nt),Be.appendChild(document.createTextNode(" ")),Me.current=Qa(Be),c1(Be),ft.current=!0,Fe.current(Go(Be)),ft.current=!1,Oe(!1)},insertSegments:Ce=>{const Be=ie.current;if(!Be)return;const Nt=As(Ce);Nt.length&&(ot.current(!0),FB(Be,Nt,fr),Me.current=Qa(Be),c1(Be),ft.current=!0,Fe.current(Go(Be)),ft.current=!1,Oe(!1))},getSegments:()=>{const Ce=ie.current;return Ce?Qa(Ce):As(J)},focus:()=>{const Ce=ie.current;Ce&&(Ce.focus(),c1(Ce))},addAttachment:Ce=>{kt(Be=>[...Be,Ce]),Oe(!1)}}),[fr,J]),y.useEffect(()=>{var sr;if(!Re){tt(Qr=>Qr.length===0?Qr:IB);return}(sr=jt.current)==null||sr.abort();const Ce=new Set(ie.current?RRe(ie.current):[]),Be=Ht.current;if(!$e){const Qr=Be.filter(Ct=>!Ce.has(Ct.path)).slice(0,15);tt(Qr),It(!1);return}const Nt=Be.filter(Qr=>{if(Ce.has(Qr.path))return!1;const Ct=$e.toLowerCase();return Qr.name.toLowerCase().includes(Ct)||Qr.path.toLowerCase().includes(Ct)}).slice(0,10);tt(Nt);const pr=Ye.current;if(!pr){It(!1);return}It(!0);const lr=new AbortController;jt.current=lr;const Wr=setTimeout(async()=>{try{const Qr=await pr($e,15,lr.signal);if(lr.signal.aborted)return;const Ct=new Set,Xt=[];for(const nr of Qr)Ce.has(nr.path)||Ct.has(nr.path)||(Ct.add(nr.path),Xt.push(nr));for(const nr of Nt)Ct.has(nr.path)||(Ct.add(nr.path),Xt.push(nr));tt(Xt.slice(0,15))}catch{}finally{lr.signal.aborted||It(!1)}},150);return()=>{clearTimeout(Wr),lr.abort()}},[Re,$e]),y.useEffect(()=>{const Ce=ie.current;if(!Ce||ft.current)return;if(Ce.childNodes.length>0&&((Ce.textContent??"").length>0||xf(Ce))&&!CRe(nt.current,r,J,Me.current)){nt.current=fC(r,J);return}ft.current=!0,ET(Ce,J,r,fr),Me.current=Qa(Ce),Oe(vf(r)&&!xf(ie.current)),ft.current=!1,nt.current=fC(r,J)},[r,J,fr,ue]),y.useEffect(()=>{if(!Re)return;const Ce=Be=>{ge.current&&!ge.current.contains(Be.target)&&ke(!1)};return document.addEventListener("mousedown",Ce),()=>document.removeEventListener("mousedown",Ce)},[Re]),y.useEffect(()=>{lt(0)},[$e]);const ur=y.useCallback(Ce=>{const Be=ie.current;if(!Be)return;Un(!0);const Nt=window.getSelection();if(Nt&&Nt.rangeCount>0){const pr=Nt.getRangeAt(0),lr=pr.startContainer;if(lr.nodeType===Node.TEXT_NODE&&lr.textContent){const Wr=lr.textContent,sr=pr.startOffset,Qr=Wr.lastIndexOf("@",sr-1);if(Qr>=0){lr.textContent=Wr.slice(0,Qr)+Wr.slice(sr);const Ct=lr.textContent.slice(0,Qr),Xt=lr.textContent.slice(Qr);lr.textContent=Ct;const nr=g5(Ce,fr),bn=document.createTextNode(Xt||" "),Ee=lr.parentNode;if(Ct)lr.nextSibling?(Ee.insertBefore(bn,lr.nextSibling),Ee.insertBefore(nr,bn)):(Ee.appendChild(nr),Ee.appendChild(bn));else{const Ws=lr.nextSibling;Ee.removeChild(lr),Ws?(Ee.insertBefore(bn,Ws),Ee.insertBefore(nr,bn)):(Ee.appendChild(nr),Ee.appendChild(bn))}const In=document.createRange();In.setStart(bn,Xt?0:1),In.collapse(!0),Nt.removeAllRanges(),Nt.addRange(In)}}}ke(!1),at(""),Me.current=Qa(Be),ft.current=!0,n(Go(Be)),ft.current=!1},[n,Un]);y.useEffect(()=>{const Ce=ie.current;if(!Ce)return;const Be=()=>{ft.current=!0,PRe(Ce);const Nt=Go(Ce);Me.current=Qa(Ce),Fe.current(Nt),Oe(vf(Nt)&&!xf(Ce)),ft.current=!1,ot.current();const pr=window.getSelection();if(!pr||pr.rangeCount===0)return;const lr=pr.getRangeAt(0);let Wr=lr.startContainer,sr=lr.startOffset;if(Wr.nodeType!==Node.TEXT_NODE){const Xt=Wr.childNodes[sr-1]??Wr.childNodes[sr];if((Xt==null?void 0:Xt.nodeType)===Node.TEXT_NODE)Wr=Xt,sr=Xt.length;else if(sr>0&&Wr.childNodes[sr-1]){let nr=Wr.childNodes[sr-1];for(;nr&&nr.nodeType!==Node.TEXT_NODE&&nr.lastChild;)nr=nr.lastChild;if((nr==null?void 0:nr.nodeType)===Node.TEXT_NODE)Wr=nr,sr=nr.length;else return}else return}const Qr=Wr.textContent??"";if(ut.current){const Xt=Qr.lastIndexOf("@",sr-1);if(Xt<0||sr<=Xt){ke(!1);return}const nr=Qr.slice(Xt+1,sr);nr.includes(" ")||nr.includes(`
867
867
  `)?ke(!1):at(nr)}else if(sr>0&&Qr[sr-1]==="@"){const Xt=sr>1?Qr[sr-2]:" ";(Xt===" "||Xt===`
@@ -1121,8 +1121,8 @@ Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error
1121
1121
  node : x:${e.x} y:${e.y} w:${e.width} h:${e.height}`);const i=e.x,s=e.y,o=Math.abs(i-n.x),a=e.width/2;let l=n.x<r.x?a-o:a+o;const d=e.height/2,u=Math.abs(r.y-n.y),f=Math.abs(r.x-n.x);if(Math.abs(s-r.y)*a>Math.abs(i-r.x)*d){let p=n.y<r.y?r.y-d-s:s-d-r.y;l=f*p/u;const g={x:n.x<r.x?n.x+l:n.x-f+l,y:n.y<r.y?n.y+u-p:n.y-u+p};return l===0&&(g.x=r.x,g.y=r.y),f===0&&(g.x=r.x),u===0&&(g.y=r.y),St.debug(`abc89 top/bottom calc, Q ${u}, q ${p}, R ${f}, r ${l}`,g),g}else{n.x<r.x?l=r.x-a-i:l=i-a-r.x;let p=u*l/f,g=n.x<r.x?n.x+f-l:n.x-f+l,v=n.y<r.y?n.y+p:n.y-p;return St.debug(`sides calc abc89, Q ${u}, q ${p}, R ${f}, r ${l}`,{_x:g,_y:v}),l===0&&(g=r.x,v=r.y),f===0&&(g=r.x),u===0&&(v=r.y),{x:g,y:v}}},"intersection"),EF=X((e,r)=>{St.warn("abc88 cutPathAtIntersect",e,r);let n=[],i=e[0],s=!1;return e.forEach(o=>{if(St.info("abc88 checking point",o,r),!cVe(r,o)&&!s){const a=uVe(r,i,o);St.debug("abc88 inside",o,i,a),St.debug("abc88 intersection",a,r);let l=!1;n.forEach(d=>{l=l||d.x===a.x&&d.y===a.y}),n.some(d=>d.x===a.x&&d.y===a.y)?St.warn("abc88 no intersect",a,n):n.push(a),s=!0}else St.warn("abc88 outside",o,i),i=o,s||n.push(o)}),St.debug("returning points",n),n},"cutPathAtIntersect");function xse(e){const r=[],n=[];for(let i=1;i<e.length-1;i++){const s=e[i-1],o=e[i],a=e[i+1];(s.x===o.x&&o.y===a.y&&Math.abs(o.x-a.x)>5&&Math.abs(o.y-s.y)>5||s.y===o.y&&o.x===a.x&&Math.abs(o.x-s.x)>5&&Math.abs(o.y-a.y)>5)&&(r.push(o),n.push(i))}return{cornerPoints:r,cornerPointPositions:n}}X(xse,"extractCornerPoints");var AF=X(function(e,r,n){const i=r.x-e.x,s=r.y-e.y,o=Math.sqrt(i*i+s*s),a=n/o;return{x:r.x-a*i,y:r.y-a*s}},"findAdjacentPoint"),dVe=X(function(e){const{cornerPointPositions:r}=xse(e),n=[];for(let i=0;i<e.length;i++)if(r.includes(i)){const s=e[i-1],o=e[i+1],a=e[i],l=AF(s,a,5),d=AF(o,a,5),u=d.x-l.x,f=d.y-l.y;n.push(l);const p=Math.sqrt(2)*2;let g={x:a.x,y:a.y};if(Math.abs(o.x-s.x)>10&&Math.abs(o.y-s.y)>=10){St.debug("Corner point fixing",Math.abs(o.x-s.x),Math.abs(o.y-s.y));const v=5;a.x===l.x?g={x:u<0?l.x-v+p:l.x+v-p,y:f<0?l.y-p:l.y+p}:g={x:u<0?l.x-p:l.x+p,y:f<0?l.y-v+p:l.y+v-p}}else St.debug("Corner point skipping fixing",Math.abs(o.x-s.x),Math.abs(o.y-s.y));n.push(g,d)}else n.push(e[i]);return n},"fixCorners"),hVe=X((e,r,n)=>{const i=e-r-n,s=2,o=2,a=s+o,l=Math.floor(i/a),d=Array(l).fill(`${s} ${o}`).join(" ");return`0 ${r} ${d} ${n}`},"generateDashArray"),fVe=X(function(e,r,n,i,s,o,a,l=!1){var P;const{handDrawnSeed:d}=ii();let u=r.points,f=!1;const p=s;var g=o;const v=[];for(const F in r.cssCompiledStyles)xne(F)||v.push(r.cssCompiledStyles[F]);St.debug("UIO intersect check",r.points,g.x,p.x),g.intersect&&p.intersect&&!l&&(u=u.slice(1,r.points.length-1),u.unshift(p.intersect(u[0])),St.debug("Last point UIO",r.start,"-->",r.end,u[u.length-1],g,g.intersect(u[u.length-1])),u.push(g.intersect(u[u.length-1])));const b=btoa(JSON.stringify(u));r.toCluster&&(St.info("to cluster abc88",n.get(r.toCluster)),u=EF(r.points,n.get(r.toCluster).node),f=!0),r.fromCluster&&(St.debug("from cluster abc88",n.get(r.fromCluster),JSON.stringify(u,null,2)),u=EF(u.reverse(),n.get(r.fromCluster).node).reverse(),f=!0);let _=u.filter(F=>!Number.isNaN(F.y));const S=oVe(r.curve);S!=="rounded"&&(_=dVe(_));let w=R_;switch(S){case"linear":w=R_;break;case"basis":w=DA;break;case"cardinal":w=Qee;break;case"bumpX":w=Kee;break;case"bumpY":w=Yee;break;case"catmullRom":w=tte;break;case"monotoneX":w=ate;break;case"monotoneY":w=lte;break;case"natural":w=ute;break;case"step":w=dte;break;case"stepAfter":w=fte;break;case"stepBefore":w=hte;break;case"rounded":w=R_;break;default:w=DA}const{x:C,y:j}=cze(r),N=BIe().x(C).y(j).curve(w);let A;switch(r.thickness){case"normal":A="edge-thickness-normal";break;case"thick":A="edge-thickness-thick";break;case"invisible":A="edge-thickness-invisible";break;default:A="edge-thickness-normal"}switch(r.pattern){case"solid":A+=" edge-pattern-solid";break;case"dotted":A+=" edge-pattern-dotted";break;case"dashed":A+=" edge-pattern-dashed";break;default:A+=" edge-pattern-solid"}let E,R=S==="rounded"?bse(_se(_,r),5):N(_);const L=Array.isArray(r.style)?r.style:[r.style];let z=L.find(F=>F==null?void 0:F.startsWith("stroke:")),$="";r.animate&&($="edge-animation-fast"),r.animation&&($="edge-animation-"+r.animation);let W=!1;if(r.look==="handDrawn"){const F=wr.svg(e);Object.assign([],_);const V=F.path(R,{roughness:.3,seed:d});A+=" transition",E=Fr(V).select("path").attr("id",r.id).attr("class"," "+A+(r.classes?" "+r.classes:"")+($?" "+$:"")).attr("style",L?L.reduce((H,U)=>H+";"+U,""):"");let Y=E.attr("d");E.attr("d",Y),e.node().appendChild(E.node())}else{const F=v.join(";"),V=L?L.reduce((ee,te)=>ee+te+";",""):"",Y=(F?F+";"+V+";":V)+";"+(L?L.reduce((ee,te)=>ee+";"+te,""):"");E=e.append("path").attr("d",R).attr("id",r.id).attr("class"," "+A+(r.classes?" "+r.classes:"")+($?" "+$:"")).attr("style",Y),z=(P=Y.match(/stroke:([^;]+)/))==null?void 0:P[1],W=r.animate===!0||!!r.animation||F.includes("animation");const H=E.node(),U=typeof H.getTotalLength=="function"?H.getTotalLength():0,J=Vz[r.arrowTypeStart]||0,q=Vz[r.arrowTypeEnd]||0;if(r.look==="neo"&&!W){const te=`stroke-dasharray: ${r.pattern==="dotted"||r.pattern==="dashed"?hVe(U,J,q):`0 ${J} ${U-J-q} ${q}`}; stroke-dashoffset: 0;`;E.attr("style",te+E.attr("style"))}}E.attr("data-edge",!0),E.attr("data-et","edge"),E.attr("data-id",r.id),E.attr("data-points",b),r.showPoints&&_.forEach(F=>{e.append("circle").style("stroke","red").style("fill","red").attr("r",1).attr("cx",F.x).attr("cy",F.y)});let B="";(ii().flowchart.arrowMarkerAbsolute||ii().state.arrowMarkerAbsolute)&&(B=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,B=B.replace(/\(/g,"\\(").replace(/\)/g,"\\)")),St.info("arrowTypeStart",r.arrowTypeStart),St.info("arrowTypeEnd",r.arrowTypeEnd),iVe(E,r,B,a,i,z);const K=Math.floor(u.length/2),M=u[K];ld.isLabelCoordinateInPath(M,E.attr("d"))||(f=!0);let I={};return f&&(I.updatedPath=u),I.originalPath=r.points,I},"insertEdge");function bse(e,r){if(e.length<2)return"";let n="";const i=e.length,s=1e-5;for(let o=0;o<i;o++){const a=e[o],l=e[o-1],d=e[o+1];if(o===0)n+=`M${a.x},${a.y}`;else if(o===i-1)n+=`L${a.x},${a.y}`;else{const u=a.x-l.x,f=a.y-l.y,p=d.x-a.x,g=d.y-a.y,v=Math.hypot(u,f),b=Math.hypot(p,g);if(v<s||b<s){n+=`L${a.x},${a.y}`;continue}const _=u/v,S=f/v,w=p/b,C=g/b,j=_*w+S*C,N=Math.max(-1,Math.min(1,j)),A=Math.acos(N);if(A<s||Math.abs(Math.PI-A)<s){n+=`L${a.x},${a.y}`;continue}const E=Math.min(r/Math.sin(A/2),v/2,b/2),R=a.x-_*E,L=a.y-S*E,z=a.x+w*E,$=a.y+C*E;n+=`L${R},${L}`,n+=`Q${a.x},${a.y} ${z},${$}`}}return n}X(bse,"generateRoundedPath");function dO(e,r){if(!e||!r)return{angle:0,deltaX:0,deltaY:0};const n=r.x-e.x,i=r.y-e.y;return{angle:Math.atan2(i,n),deltaX:n,deltaY:i}}X(dO,"calculateDeltaAndAngle");function _se(e,r){const n=e.map(s=>({...s}));if(e.length>=2&&Na[r.arrowTypeStart]){const s=Na[r.arrowTypeStart],o=e[0],a=e[1],{angle:l}=dO(o,a),d=s*Math.cos(l),u=s*Math.sin(l);n[0].x=o.x+d,n[0].y=o.y+u}const i=e.length;if(i>=2&&Na[r.arrowTypeEnd]){const s=Na[r.arrowTypeEnd],o=e[i-1],a=e[i-2],{angle:l}=dO(a,o),d=s*Math.cos(l),u=s*Math.sin(l);n[i-1].x=o.x-d,n[i-1].y=o.y-u}return n}X(_se,"applyMarkerOffsetsToPoints");var pVe=X((e,r,n,i)=>{r.forEach(s=>{AVe[s](e,n,i)})},"insertMarkers"),mVe=X((e,r,n)=>{St.trace("Making markers for ",n),e.append("defs").append("marker").attr("id",n+"_"+r+"-extensionStart").attr("class","marker extension "+r).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),e.append("defs").append("marker").attr("id",n+"_"+r+"-extensionEnd").attr("class","marker extension "+r).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),gVe=X((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-compositionStart").attr("class","marker composition "+r).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+r+"-compositionEnd").attr("class","marker composition "+r).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),yVe=X((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-aggregationStart").attr("class","marker aggregation "+r).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+r+"-aggregationEnd").attr("class","marker aggregation "+r).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),vVe=X((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-dependencyStart").attr("class","marker dependency "+r).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),e.append("defs").append("marker").attr("id",n+"_"+r+"-dependencyEnd").attr("class","marker dependency "+r).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),xVe=X((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-lollipopStart").attr("class","marker lollipop "+r).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),e.append("defs").append("marker").attr("id",n+"_"+r+"-lollipopEnd").attr("class","marker lollipop "+r).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),bVe=X((e,r,n)=>{e.append("marker").attr("id",n+"_"+r+"-pointEnd").attr("class","marker "+r).attr("viewBox","0 0 10 10").attr("refX",5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+r+"-pointStart").attr("class","marker "+r).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",8).attr("markerHeight",8).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),_Ve=X((e,r,n)=>{e.append("marker").attr("id",n+"_"+r+"-circleEnd").attr("class","marker "+r).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+r+"-circleStart").attr("class","marker "+r).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),wVe=X((e,r,n)=>{e.append("marker").attr("id",n+"_"+r+"-crossEnd").attr("class","marker cross "+r).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),e.append("marker").attr("id",n+"_"+r+"-crossStart").attr("class","marker cross "+r).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),SVe=X((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb"),kVe=X((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-onlyOneStart").attr("class","marker onlyOne "+r).attr("refX",0).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M9,0 L9,18 M15,0 L15,18"),e.append("defs").append("marker").attr("id",n+"_"+r+"-onlyOneEnd").attr("class","marker onlyOne "+r).attr("refX",18).attr("refY",9).attr("markerWidth",18).attr("markerHeight",18).attr("orient","auto").append("path").attr("d","M3,0 L3,18 M9,0 L9,18")},"only_one"),CVe=X((e,r,n)=>{const i=e.append("defs").append("marker").attr("id",n+"_"+r+"-zeroOrOneStart").attr("class","marker zeroOrOne "+r).attr("refX",0).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",21).attr("cy",9).attr("r",6),i.append("path").attr("d","M9,0 L9,18");const s=e.append("defs").append("marker").attr("id",n+"_"+r+"-zeroOrOneEnd").attr("class","marker zeroOrOne "+r).attr("refX",30).attr("refY",9).attr("markerWidth",30).attr("markerHeight",18).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",9).attr("cy",9).attr("r",6),s.append("path").attr("d","M21,0 L21,18")},"zero_or_one"),jVe=X((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-oneOrMoreStart").attr("class","marker oneOrMore "+r).attr("refX",18).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M0,18 Q 18,0 36,18 Q 18,36 0,18 M42,9 L42,27"),e.append("defs").append("marker").attr("id",n+"_"+r+"-oneOrMoreEnd").attr("class","marker oneOrMore "+r).attr("refX",27).attr("refY",18).attr("markerWidth",45).attr("markerHeight",36).attr("orient","auto").append("path").attr("d","M3,9 L3,27 M9,18 Q27,0 45,18 Q27,36 9,18")},"one_or_more"),NVe=X((e,r,n)=>{const i=e.append("defs").append("marker").attr("id",n+"_"+r+"-zeroOrMoreStart").attr("class","marker zeroOrMore "+r).attr("refX",18).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");i.append("circle").attr("fill","white").attr("cx",48).attr("cy",18).attr("r",6),i.append("path").attr("d","M0,18 Q18,0 36,18 Q18,36 0,18");const s=e.append("defs").append("marker").attr("id",n+"_"+r+"-zeroOrMoreEnd").attr("class","marker zeroOrMore "+r).attr("refX",39).attr("refY",18).attr("markerWidth",57).attr("markerHeight",36).attr("orient","auto");s.append("circle").attr("fill","white").attr("cx",9).attr("cy",18).attr("r",6),s.append("path").attr("d","M21,18 Q39,0 57,18 Q39,36 21,18")},"zero_or_more"),TVe=X((e,r,n)=>{e.append("defs").append("marker").attr("id",n+"_"+r+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("path").attr("d",`M0,0
1122
1122
  L20,10
1123
1123
  M20,10
1124
- L0,20`)},"requirement_arrow"),EVe=X((e,r,n)=>{const i=e.append("defs").append("marker").attr("id",n+"_"+r+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),AVe={extension:mVe,composition:gVe,aggregation:yVe,dependency:vVe,lollipop:xVe,point:bVe,circle:_Ve,cross:wVe,barb:SVe,only_one:kVe,zero_or_one:CVe,one_or_more:jVe,zero_or_more:NVe,requirement_arrow:TVe,requirement_contains:EVe},OVe=pVe,RVe={common:kS,getConfig:Ma,insertCluster:IUe,insertEdge:fVe,insertEdgeLabel:aVe,insertMarkers:OVe,insertNode:vse,interpolateToCurve:EM,labelHelper:qr,log:St,positionEdgeLabel:lVe},V2={},wse=X(e=>{for(const r of e)V2[r.name]=r},"registerLayoutLoaders"),MVe=X(()=>{wse([{name:"dagre",loader:X(async()=>await Ke(()=>import("./dagre-KLK3FWXG-BWZ8xz3g.js"),__vite__mapDeps([47,48,49,50,51,52]),import.meta.url),"loader")},{name:"cose-bilkent",loader:X(async()=>await Ke(()=>import("./cose-bilkent-S5V4N54A-DnsxyVyq.js"),__vite__mapDeps([53,54]),import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");MVe();var cvt=X(async(e,r)=>{if(!(e.layoutAlgorithm in V2))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const n=V2[e.layoutAlgorithm];return(await n.loader()).render(e,r,RVe,{algorithm:n.algorithm})},"render"),uvt=X((e="",{fallback:r="dagre"}={})=>{if(e in V2)return e;if(r in V2)return St.warn(`Layout algorithm ${e} is not registered. Using ${r} as fallback.`),r;throw new Error(`Both layout algorithms ${e} and ${r} are not registered.`)},"getRegisteredLayoutAlgorithm"),PVe=Jre(Object.keys,Object),LVe=Object.prototype,$Ve=LVe.hasOwnProperty;function DVe(e){if(!qj(e))return PVe(e);var r=[];for(var n in Object(e))$Ve.call(e,n)&&n!="constructor"&&r.push(n);return r}var hO=Z0(Ad,"DataView"),fO=Z0(Ad,"Promise"),pO=Z0(Ad,"Set"),mO=Z0(Ad,"WeakMap"),OF="[object Map]",IVe="[object Object]",RF="[object Promise]",MF="[object Set]",PF="[object WeakMap]",LF="[object DataView]",BVe=X0(hO),zVe=X0(W2),FVe=X0(fO),HVe=X0(pO),WVe=X0(mO),Yg=Y0;(hO&&Yg(new hO(new ArrayBuffer(1)))!=LF||W2&&Yg(new W2)!=OF||fO&&Yg(fO.resolve())!=RF||pO&&Yg(new pO)!=MF||mO&&Yg(new mO)!=PF)&&(Yg=function(e){var r=Y0(e),n=r==IVe?e.constructor:void 0,i=n?X0(n):"";if(i)switch(i){case BVe:return LF;case zVe:return OF;case FVe:return RF;case HVe:return MF;case WVe:return PF}return r});var UVe="[object Map]",VVe="[object Set]",qVe=Object.prototype,GVe=qVe.hasOwnProperty;function $F(e){if(e==null)return!0;if(Gj(e)&&(H5(e)||typeof e=="string"||typeof e.splice=="function"||NM(e)||TM(e)||F5(e)))return!e.length;var r=Yg(e);if(r==UVe||r==VVe)return!e.size;if(qj(e))return!DVe(e).length;for(var n in e)if(GVe.call(e,n))return!1;return!0}var Sse="c4",KVe=X(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),YVe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./c4Diagram-IC4MRINW-BAiV3iEA.js");return{diagram:r}},__vite__mapDeps([55,56]),import.meta.url);return{id:Sse,diagram:e}},"loader"),XVe={id:Sse,detector:KVe,loader:YVe},ZVe=XVe,kse="flowchart",JVe=X((e,r)=>{var n,i;return((n=r==null?void 0:r.flowchart)==null?void 0:n.defaultRenderer)==="dagre-wrapper"||((i=r==null?void 0:r.flowchart)==null?void 0:i.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)},"detector"),QVe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./flowDiagram-PKNHOUZH-CyTE1i_a.js");return{diagram:r}},__vite__mapDeps([57,58,56,59,60,61]),import.meta.url);return{id:kse,diagram:e}},"loader"),eqe={id:kse,detector:JVe,loader:QVe},tqe=eqe,Cse="flowchart-v2",rqe=X((e,r)=>{var n,i,s;return((n=r==null?void 0:r.flowchart)==null?void 0:n.defaultRenderer)==="dagre-d3"?!1:(((i=r==null?void 0:r.flowchart)==null?void 0:i.defaultRenderer)==="elk"&&(r.layout="elk"),/^\s*graph/.test(e)&&((s=r==null?void 0:r.flowchart)==null?void 0:s.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(e))},"detector"),nqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./flowDiagram-PKNHOUZH-CyTE1i_a.js");return{diagram:r}},__vite__mapDeps([57,58,56,59,60,61]),import.meta.url);return{id:Cse,diagram:e}},"loader"),iqe={id:Cse,detector:rqe,loader:nqe},sqe=iqe,jse="er",oqe=X(e=>/^\s*erDiagram/.test(e),"detector"),aqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./erDiagram-INFDFZHY-Ek05XEfG.js");return{diagram:r}},__vite__mapDeps([62,59,60,61]),import.meta.url);return{id:jse,diagram:e}},"loader"),lqe={id:jse,detector:oqe,loader:aqe},cqe=lqe,Nse="gitGraph",uqe=X(e=>/^\s*gitGraph/.test(e),"detector"),dqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./gitGraphDiagram-K3NZZRJ6-BvJoM0-d.js");return{diagram:r}},__vite__mapDeps([63,64,65,66,49,51,52]),import.meta.url);return{id:Nse,diagram:e}},"loader"),hqe={id:Nse,detector:uqe,loader:dqe},fqe=hqe,Tse="gantt",pqe=X(e=>/^\s*gantt/.test(e),"detector"),mqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./ganttDiagram-A5KZAMGK-CyluJD9T.js");return{diagram:r}},__vite__mapDeps([67,68,69]),import.meta.url);return{id:Tse,diagram:e}},"loader"),gqe={id:Tse,detector:pqe,loader:mqe},yqe=gqe,Ese="info",vqe=X(e=>/^\s*info/.test(e),"detector"),xqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./infoDiagram-LFFYTUFH-Dc3SfWVL.js");return{diagram:r}},__vite__mapDeps([70,66,49,51,52]),import.meta.url);return{id:Ese,diagram:e}},"loader"),bqe={id:Ese,detector:vqe,loader:xqe},Ase="pie",_qe=X(e=>/^\s*pie/.test(e),"detector"),wqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./pieDiagram-SKSYHLDU-x6jkS0t6.js");return{diagram:r}},__vite__mapDeps([71,64,66,49,51,52,72]),import.meta.url);return{id:Ase,diagram:e}},"loader"),Sqe={id:Ase,detector:_qe,loader:wqe},Ose="quadrantChart",kqe=X(e=>/^\s*quadrantChart/.test(e),"detector"),Cqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./quadrantDiagram-337W2JSQ-CN0DjzKF.js");return{diagram:r}},__vite__mapDeps([73,68,69]),import.meta.url);return{id:Ose,diagram:e}},"loader"),jqe={id:Ose,detector:kqe,loader:Cqe},Nqe=jqe,Rse="xychart",Tqe=X(e=>/^\s*xychart(-beta)?/.test(e),"detector"),Eqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./xychartDiagram-JWTSCODW-CfdlpmRj.js");return{diagram:r}},__vite__mapDeps([74,68,69]),import.meta.url);return{id:Rse,diagram:e}},"loader"),Aqe={id:Rse,detector:Tqe,loader:Eqe},Oqe=Aqe,Mse="requirement",Rqe=X(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),Mqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./requirementDiagram-Z7DCOOCP-QQatHuXf.js");return{diagram:r}},__vite__mapDeps([75,59,60]),import.meta.url);return{id:Mse,diagram:e}},"loader"),Pqe={id:Mse,detector:Rqe,loader:Mqe},Lqe=Pqe,Pse="sequence",$qe=X(e=>/^\s*sequenceDiagram/.test(e),"detector"),Dqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./sequenceDiagram-2WXFIKYE-CpDKPlAu.js");return{diagram:r}},__vite__mapDeps([76,56,65]),import.meta.url);return{id:Pse,diagram:e}},"loader"),Iqe={id:Pse,detector:$qe,loader:Dqe},Bqe=Iqe,Lse="class",zqe=X((e,r)=>{var n;return((n=r==null?void 0:r.class)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e)},"detector"),Fqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./classDiagram-VBA2DB6C-DLVcc5Iw.js");return{diagram:r}},__vite__mapDeps([77,78,58,56,59,60]),import.meta.url);return{id:Lse,diagram:e}},"loader"),Hqe={id:Lse,detector:zqe,loader:Fqe},Wqe=Hqe,$se="classDiagram",Uqe=X((e,r)=>{var n;return/^\s*classDiagram/.test(e)&&((n=r==null?void 0:r.class)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e)},"detector"),Vqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./classDiagram-v2-RAHNMMFH-DLVcc5Iw.js");return{diagram:r}},__vite__mapDeps([79,78,58,56,59,60]),import.meta.url);return{id:$se,diagram:e}},"loader"),qqe={id:$se,detector:Uqe,loader:Vqe},Gqe=qqe,Dse="state",Kqe=X((e,r)=>{var n;return((n=r==null?void 0:r.state)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e)},"detector"),Yqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./stateDiagram-RAJIS63D-BaSM-cZz.js");return{diagram:r}},__vite__mapDeps([80,81,59,60,48,49,50,51]),import.meta.url);return{id:Dse,diagram:e}},"loader"),Xqe={id:Dse,detector:Kqe,loader:Yqe},Zqe=Xqe,Ise="stateDiagram",Jqe=X((e,r)=>{var n;return!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&((n=r==null?void 0:r.state)==null?void 0:n.defaultRenderer)==="dagre-wrapper")},"detector"),Qqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./stateDiagram-v2-FVOUBMTO-C3QMtbCf.js");return{diagram:r}},__vite__mapDeps([82,81,59,60]),import.meta.url);return{id:Ise,diagram:e}},"loader"),eGe={id:Ise,detector:Jqe,loader:Qqe},tGe=eGe,Bse="journey",rGe=X(e=>/^\s*journey/.test(e),"detector"),nGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./journeyDiagram-4ABVD52K-DzYxytM9.js");return{diagram:r}},__vite__mapDeps([83,58,56,72]),import.meta.url);return{id:Bse,diagram:e}},"loader"),iGe={id:Bse,detector:rGe,loader:nGe},sGe=iGe,oGe=X((e,r,n)=>{St.debug(`rendering svg for syntax error
1125
- `);const i=tBe(r),s=i.append("g");i.attr("viewBox","0 0 2412 512"),pee(i,100,512,!0),s.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),s.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),s.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),s.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),s.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),s.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),s.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),s.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${n}`)},"draw"),zse={draw:oGe},aGe=zse,lGe={db:{},renderer:zse,parser:{parse:X(()=>{},"parse")}},cGe=lGe,Fse="flowchart-elk",uGe=X((e,r={})=>{var n;return/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&((n=r==null?void 0:r.flowchart)==null?void 0:n.defaultRenderer)==="elk"?(r.layout="elk",!0):!1},"detector"),dGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./flowDiagram-PKNHOUZH-CyTE1i_a.js");return{diagram:r}},__vite__mapDeps([57,58,56,59,60,61]),import.meta.url);return{id:Fse,diagram:e}},"loader"),hGe={id:Fse,detector:uGe,loader:dGe},fGe=hGe,Hse="timeline",pGe=X(e=>/^\s*timeline/.test(e),"detector"),mGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./timeline-definition-YZTLITO2-Csn9zCs-.js");return{diagram:r}},__vite__mapDeps([84,72]),import.meta.url);return{id:Hse,diagram:e}},"loader"),gGe={id:Hse,detector:pGe,loader:mGe},yGe=gGe,Wse="mindmap",vGe=X(e=>/^\s*mindmap/.test(e),"detector"),xGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./mindmap-definition-YRQLILUH-PJJkEJQN.js");return{diagram:r}},__vite__mapDeps([85,59,60]),import.meta.url);return{id:Wse,diagram:e}},"loader"),bGe={id:Wse,detector:vGe,loader:xGe},_Ge=bGe,Use="kanban",wGe=X(e=>/^\s*kanban/.test(e),"detector"),SGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./kanban-definition-K7BYSVSG-2sYGZW7N.js");return{diagram:r}},__vite__mapDeps([86,58]),import.meta.url);return{id:Use,diagram:e}},"loader"),kGe={id:Use,detector:wGe,loader:SGe},CGe=kGe,Vse="sankey",jGe=X(e=>/^\s*sankey(-beta)?/.test(e),"detector"),NGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./sankeyDiagram-WA2Y5GQK-pC1cAJ1B.js");return{diagram:r}},[],import.meta.url);return{id:Vse,diagram:e}},"loader"),TGe={id:Vse,detector:jGe,loader:NGe},EGe=TGe,qse="packet",AGe=X(e=>/^\s*packet(-beta)?/.test(e),"detector"),OGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./diagram-P4PSJMXO-BjAXdkjW.js");return{diagram:r}},__vite__mapDeps([87,64,66,49,51,52]),import.meta.url);return{id:qse,diagram:e}},"loader"),RGe={id:qse,detector:AGe,loader:OGe},Gse="radar",MGe=X(e=>/^\s*radar-beta/.test(e),"detector"),PGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./diagram-IFDJBPK2-lAfHZB9E.js");return{diagram:r}},__vite__mapDeps([88,64,66,49,51,52]),import.meta.url);return{id:Gse,diagram:e}},"loader"),LGe={id:Gse,detector:MGe,loader:PGe},Kse="block",$Ge=X(e=>/^\s*block(-beta)?/.test(e),"detector"),DGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./blockDiagram-WCTKOSBZ-DP4dff2t.js");return{diagram:r}},__vite__mapDeps([89,58,52,49,48,61]),import.meta.url);return{id:Kse,diagram:e}},"loader"),IGe={id:Kse,detector:$Ge,loader:DGe},BGe=IGe,Yse="architecture",zGe=X(e=>/^\s*architecture/.test(e),"detector"),FGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./architectureDiagram-2XIMDMQ5-B-0c_kNx.js");return{diagram:r}},__vite__mapDeps([90,64,66,49,51,52,54]),import.meta.url);return{id:Yse,diagram:e}},"loader"),HGe={id:Yse,detector:zGe,loader:FGe},WGe=HGe,Xse="ishikawa",UGe=X(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),VGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./ishikawaDiagram-PHBUUO56-D3PGI_d6.js");return{diagram:r}},[],import.meta.url);return{id:Xse,diagram:e}},"loader"),qGe={id:Xse,detector:UGe,loader:VGe},Zse="venn",GGe=X(e=>/^\s*venn-beta/.test(e),"detector"),KGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./vennDiagram-LZ73GAT5-X1xYgQ9Z.js");return{diagram:r}},[],import.meta.url);return{id:Zse,diagram:e}},"loader"),YGe={id:Zse,detector:GGe,loader:KGe},XGe=YGe,Jse="treemap",ZGe=X(e=>/^\s*treemap/.test(e),"detector"),JGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./diagram-E7M64L7V--84PgnUj.js");return{diagram:r}},__vite__mapDeps([91,60,64,66,49,51,52,69]),import.meta.url);return{id:Jse,diagram:e}},"loader"),QGe={id:Jse,detector:ZGe,loader:JGe},DF=!1,t6=X(()=>{DF||(DF=!0,S5("error",cGe,e=>e.toLowerCase().trim()==="error"),S5("---",{db:{clear:X(()=>{},"clear")},styles:{},renderer:{draw:X(()=>{},"draw")},parser:{parse:X(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:X(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),wA(fGe,_Ge,WGe),wA(ZVe,CGe,Gqe,Wqe,cqe,yqe,bqe,Sqe,Lqe,Bqe,sqe,tqe,yGe,fqe,tGe,Zqe,sGe,Nqe,EGe,RGe,Oqe,BGe,LGe,qGe,QGe,XGe))},"addDiagrams"),eKe=X(async()=>{St.debug("Loading registered diagrams");const r=(await Promise.allSettled(Object.entries(j0).map(async([n,{detector:i,loader:s}])=>{if(s)try{jA(n)}catch{try{const{diagram:o,id:a}=await s();S5(a,o,i)}catch(o){throw St.error(`Failed to load external diagram with key ${n}. Removing from detectors.`),delete j0[n],o}}}))).filter(n=>n.status==="rejected");if(r.length>0){St.error(`Failed to load ${r.length} external diagrams`);for(const n of r)St.error(n);throw new Error(`Failed to load ${r.length} external diagrams`)}},"loadRegisteredDiagrams"),tKe="graphics-document document";function Qse(e,r){e.attr("role",tKe),r!==""&&e.attr("aria-roledescription",r)}X(Qse,"setA11yDiagramInfo");function eoe(e,r,n,i){if(e.insert!==void 0){if(n){const s=`chart-desc-${i}`;e.attr("aria-describedby",s),e.insert("desc",":first-child").attr("id",s).text(n)}if(r){const s=`chart-title-${i}`;e.attr("aria-labelledby",s),e.insert("title",":first-child").attr("id",s).text(r)}}}X(eoe,"addSVGa11yTitleDescription");var y0,gO=(y0=class{constructor(r,n,i,s,o){this.type=r,this.text=n,this.db=i,this.parser=s,this.renderer=o}static async fromText(r,n={}){var u,f;const i=Ma(),s=X9(r,i);r=iWe(r)+`
1124
+ L0,20`)},"requirement_arrow"),EVe=X((e,r,n)=>{const i=e.append("defs").append("marker").attr("id",n+"_"+r+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),AVe={extension:mVe,composition:gVe,aggregation:yVe,dependency:vVe,lollipop:xVe,point:bVe,circle:_Ve,cross:wVe,barb:SVe,only_one:kVe,zero_or_one:CVe,one_or_more:jVe,zero_or_more:NVe,requirement_arrow:TVe,requirement_contains:EVe},OVe=pVe,RVe={common:kS,getConfig:Ma,insertCluster:IUe,insertEdge:fVe,insertEdgeLabel:aVe,insertMarkers:OVe,insertNode:vse,interpolateToCurve:EM,labelHelper:qr,log:St,positionEdgeLabel:lVe},V2={},wse=X(e=>{for(const r of e)V2[r.name]=r},"registerLayoutLoaders"),MVe=X(()=>{wse([{name:"dagre",loader:X(async()=>await Ke(()=>import("./dagre-KLK3FWXG-BJsr2FRT.js"),__vite__mapDeps([47,48,49,50,51,52]),import.meta.url),"loader")},{name:"cose-bilkent",loader:X(async()=>await Ke(()=>import("./cose-bilkent-S5V4N54A-DfIv6ajn.js"),__vite__mapDeps([53,54]),import.meta.url),"loader")}])},"registerDefaultLayoutLoaders");MVe();var cvt=X(async(e,r)=>{if(!(e.layoutAlgorithm in V2))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);const n=V2[e.layoutAlgorithm];return(await n.loader()).render(e,r,RVe,{algorithm:n.algorithm})},"render"),uvt=X((e="",{fallback:r="dagre"}={})=>{if(e in V2)return e;if(r in V2)return St.warn(`Layout algorithm ${e} is not registered. Using ${r} as fallback.`),r;throw new Error(`Both layout algorithms ${e} and ${r} are not registered.`)},"getRegisteredLayoutAlgorithm"),PVe=Jre(Object.keys,Object),LVe=Object.prototype,$Ve=LVe.hasOwnProperty;function DVe(e){if(!qj(e))return PVe(e);var r=[];for(var n in Object(e))$Ve.call(e,n)&&n!="constructor"&&r.push(n);return r}var hO=Z0(Ad,"DataView"),fO=Z0(Ad,"Promise"),pO=Z0(Ad,"Set"),mO=Z0(Ad,"WeakMap"),OF="[object Map]",IVe="[object Object]",RF="[object Promise]",MF="[object Set]",PF="[object WeakMap]",LF="[object DataView]",BVe=X0(hO),zVe=X0(W2),FVe=X0(fO),HVe=X0(pO),WVe=X0(mO),Yg=Y0;(hO&&Yg(new hO(new ArrayBuffer(1)))!=LF||W2&&Yg(new W2)!=OF||fO&&Yg(fO.resolve())!=RF||pO&&Yg(new pO)!=MF||mO&&Yg(new mO)!=PF)&&(Yg=function(e){var r=Y0(e),n=r==IVe?e.constructor:void 0,i=n?X0(n):"";if(i)switch(i){case BVe:return LF;case zVe:return OF;case FVe:return RF;case HVe:return MF;case WVe:return PF}return r});var UVe="[object Map]",VVe="[object Set]",qVe=Object.prototype,GVe=qVe.hasOwnProperty;function $F(e){if(e==null)return!0;if(Gj(e)&&(H5(e)||typeof e=="string"||typeof e.splice=="function"||NM(e)||TM(e)||F5(e)))return!e.length;var r=Yg(e);if(r==UVe||r==VVe)return!e.size;if(qj(e))return!DVe(e).length;for(var n in e)if(GVe.call(e,n))return!1;return!0}var Sse="c4",KVe=X(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),YVe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./c4Diagram-IC4MRINW-B-CGuYcX.js");return{diagram:r}},__vite__mapDeps([55,56]),import.meta.url);return{id:Sse,diagram:e}},"loader"),XVe={id:Sse,detector:KVe,loader:YVe},ZVe=XVe,kse="flowchart",JVe=X((e,r)=>{var n,i;return((n=r==null?void 0:r.flowchart)==null?void 0:n.defaultRenderer)==="dagre-wrapper"||((i=r==null?void 0:r.flowchart)==null?void 0:i.defaultRenderer)==="elk"?!1:/^\s*graph/.test(e)},"detector"),QVe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./flowDiagram-PKNHOUZH-B9Jj988m.js");return{diagram:r}},__vite__mapDeps([57,58,56,59,60,61]),import.meta.url);return{id:kse,diagram:e}},"loader"),eqe={id:kse,detector:JVe,loader:QVe},tqe=eqe,Cse="flowchart-v2",rqe=X((e,r)=>{var n,i,s;return((n=r==null?void 0:r.flowchart)==null?void 0:n.defaultRenderer)==="dagre-d3"?!1:(((i=r==null?void 0:r.flowchart)==null?void 0:i.defaultRenderer)==="elk"&&(r.layout="elk"),/^\s*graph/.test(e)&&((s=r==null?void 0:r.flowchart)==null?void 0:s.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(e))},"detector"),nqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./flowDiagram-PKNHOUZH-B9Jj988m.js");return{diagram:r}},__vite__mapDeps([57,58,56,59,60,61]),import.meta.url);return{id:Cse,diagram:e}},"loader"),iqe={id:Cse,detector:rqe,loader:nqe},sqe=iqe,jse="er",oqe=X(e=>/^\s*erDiagram/.test(e),"detector"),aqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./erDiagram-INFDFZHY-Ba0tZtxl.js");return{diagram:r}},__vite__mapDeps([62,59,60,61]),import.meta.url);return{id:jse,diagram:e}},"loader"),lqe={id:jse,detector:oqe,loader:aqe},cqe=lqe,Nse="gitGraph",uqe=X(e=>/^\s*gitGraph/.test(e),"detector"),dqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./gitGraphDiagram-K3NZZRJ6-mi0Lj_tL.js");return{diagram:r}},__vite__mapDeps([63,64,65,66,49,51,52]),import.meta.url);return{id:Nse,diagram:e}},"loader"),hqe={id:Nse,detector:uqe,loader:dqe},fqe=hqe,Tse="gantt",pqe=X(e=>/^\s*gantt/.test(e),"detector"),mqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./ganttDiagram-A5KZAMGK-CiMqI7tz.js");return{diagram:r}},__vite__mapDeps([67,68,69]),import.meta.url);return{id:Tse,diagram:e}},"loader"),gqe={id:Tse,detector:pqe,loader:mqe},yqe=gqe,Ese="info",vqe=X(e=>/^\s*info/.test(e),"detector"),xqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./infoDiagram-LFFYTUFH-BBJROgHw.js");return{diagram:r}},__vite__mapDeps([70,66,49,51,52]),import.meta.url);return{id:Ese,diagram:e}},"loader"),bqe={id:Ese,detector:vqe,loader:xqe},Ase="pie",_qe=X(e=>/^\s*pie/.test(e),"detector"),wqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./pieDiagram-SKSYHLDU-Ckqgoc0S.js");return{diagram:r}},__vite__mapDeps([71,64,66,49,51,52,72]),import.meta.url);return{id:Ase,diagram:e}},"loader"),Sqe={id:Ase,detector:_qe,loader:wqe},Ose="quadrantChart",kqe=X(e=>/^\s*quadrantChart/.test(e),"detector"),Cqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./quadrantDiagram-337W2JSQ-C-tMRbqn.js");return{diagram:r}},__vite__mapDeps([73,68,69]),import.meta.url);return{id:Ose,diagram:e}},"loader"),jqe={id:Ose,detector:kqe,loader:Cqe},Nqe=jqe,Rse="xychart",Tqe=X(e=>/^\s*xychart(-beta)?/.test(e),"detector"),Eqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./xychartDiagram-JWTSCODW-BsCy1_Gu.js");return{diagram:r}},__vite__mapDeps([74,68,69]),import.meta.url);return{id:Rse,diagram:e}},"loader"),Aqe={id:Rse,detector:Tqe,loader:Eqe},Oqe=Aqe,Mse="requirement",Rqe=X(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),Mqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./requirementDiagram-Z7DCOOCP-KiArbbU4.js");return{diagram:r}},__vite__mapDeps([75,59,60]),import.meta.url);return{id:Mse,diagram:e}},"loader"),Pqe={id:Mse,detector:Rqe,loader:Mqe},Lqe=Pqe,Pse="sequence",$qe=X(e=>/^\s*sequenceDiagram/.test(e),"detector"),Dqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./sequenceDiagram-2WXFIKYE-ChU2W22g.js");return{diagram:r}},__vite__mapDeps([76,56,65]),import.meta.url);return{id:Pse,diagram:e}},"loader"),Iqe={id:Pse,detector:$qe,loader:Dqe},Bqe=Iqe,Lse="class",zqe=X((e,r)=>{var n;return((n=r==null?void 0:r.class)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(e)},"detector"),Fqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./classDiagram-VBA2DB6C-luXaKhEX.js");return{diagram:r}},__vite__mapDeps([77,78,58,56,59,60]),import.meta.url);return{id:Lse,diagram:e}},"loader"),Hqe={id:Lse,detector:zqe,loader:Fqe},Wqe=Hqe,$se="classDiagram",Uqe=X((e,r)=>{var n;return/^\s*classDiagram/.test(e)&&((n=r==null?void 0:r.class)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(e)},"detector"),Vqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./classDiagram-v2-RAHNMMFH-luXaKhEX.js");return{diagram:r}},__vite__mapDeps([79,78,58,56,59,60]),import.meta.url);return{id:$se,diagram:e}},"loader"),qqe={id:$se,detector:Uqe,loader:Vqe},Gqe=qqe,Dse="state",Kqe=X((e,r)=>{var n;return((n=r==null?void 0:r.state)==null?void 0:n.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(e)},"detector"),Yqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./stateDiagram-RAJIS63D-CYfNyeS2.js");return{diagram:r}},__vite__mapDeps([80,81,59,60,48,49,50,51]),import.meta.url);return{id:Dse,diagram:e}},"loader"),Xqe={id:Dse,detector:Kqe,loader:Yqe},Zqe=Xqe,Ise="stateDiagram",Jqe=X((e,r)=>{var n;return!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&((n=r==null?void 0:r.state)==null?void 0:n.defaultRenderer)==="dagre-wrapper")},"detector"),Qqe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./stateDiagram-v2-FVOUBMTO-CQ11roi0.js");return{diagram:r}},__vite__mapDeps([82,81,59,60]),import.meta.url);return{id:Ise,diagram:e}},"loader"),eGe={id:Ise,detector:Jqe,loader:Qqe},tGe=eGe,Bse="journey",rGe=X(e=>/^\s*journey/.test(e),"detector"),nGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./journeyDiagram-4ABVD52K-Cee9gxbo.js");return{diagram:r}},__vite__mapDeps([83,58,56,72]),import.meta.url);return{id:Bse,diagram:e}},"loader"),iGe={id:Bse,detector:rGe,loader:nGe},sGe=iGe,oGe=X((e,r,n)=>{St.debug(`rendering svg for syntax error
1125
+ `);const i=tBe(r),s=i.append("g");i.attr("viewBox","0 0 2412 512"),pee(i,100,512,!0),s.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),s.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),s.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),s.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),s.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),s.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),s.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),s.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${n}`)},"draw"),zse={draw:oGe},aGe=zse,lGe={db:{},renderer:zse,parser:{parse:X(()=>{},"parse")}},cGe=lGe,Fse="flowchart-elk",uGe=X((e,r={})=>{var n;return/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&((n=r==null?void 0:r.flowchart)==null?void 0:n.defaultRenderer)==="elk"?(r.layout="elk",!0):!1},"detector"),dGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./flowDiagram-PKNHOUZH-B9Jj988m.js");return{diagram:r}},__vite__mapDeps([57,58,56,59,60,61]),import.meta.url);return{id:Fse,diagram:e}},"loader"),hGe={id:Fse,detector:uGe,loader:dGe},fGe=hGe,Hse="timeline",pGe=X(e=>/^\s*timeline/.test(e),"detector"),mGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./timeline-definition-YZTLITO2-BNGiq9yT.js");return{diagram:r}},__vite__mapDeps([84,72]),import.meta.url);return{id:Hse,diagram:e}},"loader"),gGe={id:Hse,detector:pGe,loader:mGe},yGe=gGe,Wse="mindmap",vGe=X(e=>/^\s*mindmap/.test(e),"detector"),xGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./mindmap-definition-YRQLILUH-BDhKfywd.js");return{diagram:r}},__vite__mapDeps([85,59,60]),import.meta.url);return{id:Wse,diagram:e}},"loader"),bGe={id:Wse,detector:vGe,loader:xGe},_Ge=bGe,Use="kanban",wGe=X(e=>/^\s*kanban/.test(e),"detector"),SGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./kanban-definition-K7BYSVSG-DZx02Jgo.js");return{diagram:r}},__vite__mapDeps([86,58]),import.meta.url);return{id:Use,diagram:e}},"loader"),kGe={id:Use,detector:wGe,loader:SGe},CGe=kGe,Vse="sankey",jGe=X(e=>/^\s*sankey(-beta)?/.test(e),"detector"),NGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./sankeyDiagram-WA2Y5GQK-BSyF4GDm.js");return{diagram:r}},[],import.meta.url);return{id:Vse,diagram:e}},"loader"),TGe={id:Vse,detector:jGe,loader:NGe},EGe=TGe,qse="packet",AGe=X(e=>/^\s*packet(-beta)?/.test(e),"detector"),OGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./diagram-P4PSJMXO-BV4mV-cp.js");return{diagram:r}},__vite__mapDeps([87,64,66,49,51,52]),import.meta.url);return{id:qse,diagram:e}},"loader"),RGe={id:qse,detector:AGe,loader:OGe},Gse="radar",MGe=X(e=>/^\s*radar-beta/.test(e),"detector"),PGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./diagram-IFDJBPK2-DBOK9xY-.js");return{diagram:r}},__vite__mapDeps([88,64,66,49,51,52]),import.meta.url);return{id:Gse,diagram:e}},"loader"),LGe={id:Gse,detector:MGe,loader:PGe},Kse="block",$Ge=X(e=>/^\s*block(-beta)?/.test(e),"detector"),DGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./blockDiagram-WCTKOSBZ-Dg5vNEHV.js");return{diagram:r}},__vite__mapDeps([89,58,52,49,48,61]),import.meta.url);return{id:Kse,diagram:e}},"loader"),IGe={id:Kse,detector:$Ge,loader:DGe},BGe=IGe,Yse="architecture",zGe=X(e=>/^\s*architecture/.test(e),"detector"),FGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./architectureDiagram-2XIMDMQ5-C6zyje39.js");return{diagram:r}},__vite__mapDeps([90,64,66,49,51,52,54]),import.meta.url);return{id:Yse,diagram:e}},"loader"),HGe={id:Yse,detector:zGe,loader:FGe},WGe=HGe,Xse="ishikawa",UGe=X(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),VGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./ishikawaDiagram-PHBUUO56-CvD1jJdy.js");return{diagram:r}},[],import.meta.url);return{id:Xse,diagram:e}},"loader"),qGe={id:Xse,detector:UGe,loader:VGe},Zse="venn",GGe=X(e=>/^\s*venn-beta/.test(e),"detector"),KGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./vennDiagram-LZ73GAT5-B5T32YFj.js");return{diagram:r}},[],import.meta.url);return{id:Zse,diagram:e}},"loader"),YGe={id:Zse,detector:GGe,loader:KGe},XGe=YGe,Jse="treemap",ZGe=X(e=>/^\s*treemap/.test(e),"detector"),JGe=X(async()=>{const{diagram:e}=await Ke(async()=>{const{diagram:r}=await import("./diagram-E7M64L7V-CzOQpmHA.js");return{diagram:r}},__vite__mapDeps([91,60,64,66,49,51,52,69]),import.meta.url);return{id:Jse,diagram:e}},"loader"),QGe={id:Jse,detector:ZGe,loader:JGe},DF=!1,t6=X(()=>{DF||(DF=!0,S5("error",cGe,e=>e.toLowerCase().trim()==="error"),S5("---",{db:{clear:X(()=>{},"clear")},styles:{},renderer:{draw:X(()=>{},"draw")},parser:{parse:X(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:X(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),wA(fGe,_Ge,WGe),wA(ZVe,CGe,Gqe,Wqe,cqe,yqe,bqe,Sqe,Lqe,Bqe,sqe,tqe,yGe,fqe,tGe,Zqe,sGe,Nqe,EGe,RGe,Oqe,BGe,LGe,qGe,QGe,XGe))},"addDiagrams"),eKe=X(async()=>{St.debug("Loading registered diagrams");const r=(await Promise.allSettled(Object.entries(j0).map(async([n,{detector:i,loader:s}])=>{if(s)try{jA(n)}catch{try{const{diagram:o,id:a}=await s();S5(a,o,i)}catch(o){throw St.error(`Failed to load external diagram with key ${n}. Removing from detectors.`),delete j0[n],o}}}))).filter(n=>n.status==="rejected");if(r.length>0){St.error(`Failed to load ${r.length} external diagrams`);for(const n of r)St.error(n);throw new Error(`Failed to load ${r.length} external diagrams`)}},"loadRegisteredDiagrams"),tKe="graphics-document document";function Qse(e,r){e.attr("role",tKe),r!==""&&e.attr("aria-roledescription",r)}X(Qse,"setA11yDiagramInfo");function eoe(e,r,n,i){if(e.insert!==void 0){if(n){const s=`chart-desc-${i}`;e.attr("aria-describedby",s),e.insert("desc",":first-child").attr("id",s).text(n)}if(r){const s=`chart-title-${i}`;e.attr("aria-labelledby",s),e.insert("title",":first-child").attr("id",s).text(r)}}}X(eoe,"addSVGa11yTitleDescription");var y0,gO=(y0=class{constructor(r,n,i,s,o){this.type=r,this.text=n,this.db=i,this.parser=s,this.renderer=o}static async fromText(r,n={}){var u,f;const i=Ma(),s=X9(r,i);r=iWe(r)+`
1126
1126
  `;try{jA(s)}catch{const p=qMe(s);if(!p)throw new eee(`Diagram ${s} not found.`);const{id:g,diagram:v}=await p();S5(g,v)}const{db:o,parser:a,renderer:l,init:d}=jA(s);return a.parser&&(a.parser.yy=o),(u=o.clear)==null||u.call(o),d==null||d(i),n.title&&((f=o.setDiagramTitle)==null||f.call(o,n.title)),await a.parse(r),new y0(s,r,o,a,l)}async render(r,n){await this.renderer.draw(this.text,r,n,this)}getParser(){return this.parser}getType(){return this.type}},X(y0,"Diagram"),y0),IF=[],rKe=X(()=>{IF.forEach(e=>{e()}),IF=[]},"attachFunctions"),nKe=X(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function toe(e){const r=e.match(QQ);if(!r)return{text:e,metadata:{}};let n=lze(r[1],{schema:aze})??{};n=typeof n=="object"&&!Array.isArray(n)?n:{};const i={};return n.displayMode&&(i.displayMode=n.displayMode.toString()),n.title&&(i.title=n.title.toString()),n.config&&(i.config=n.config),{text:e.slice(r[0].length),metadata:i}}X(toe,"extractFrontMatter");var iKe=X(e=>e.replace(/\r\n?/g,`
1127
1127
  `).replace(/<(\w+)([^>]*)>/g,(r,n,i)=>"<"+n+i.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),sKe=X(e=>{const{text:r,metadata:n}=toe(e),{displayMode:i,title:s,config:o={}}=n;return i&&(o.gantt||(o.gantt={}),o.gantt.displayMode=i),{title:s,config:o,text:r}},"processFrontmatter"),oKe=X(e=>{const r=ld.detectInit(e)??{},n=ld.detectDirective(e,"wrap");return Array.isArray(n)?r.wrap=n.some(({type:i})=>i==="wrap"):(n==null?void 0:n.type)==="wrap"&&(r.wrap=!0),{text:VHe(e),directive:r}},"processDirectives");function XM(e){const r=iKe(e),n=sKe(r),i=oKe(n.text),s=PM(n.config,i.directive);return e=nKe(i.text),{code:e,title:n.title,config:s}}X(XM,"preprocessDiagram");function roe(e){const r=new TextEncoder().encode(e),n=Array.from(r,i=>String.fromCodePoint(i)).join("");return btoa(n)}X(roe,"toBase64");var aKe=5e4,lKe="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",cKe="sandbox",uKe="loose",dKe="http://www.w3.org/2000/svg",hKe="http://www.w3.org/1999/xlink",fKe="http://www.w3.org/1999/xhtml",pKe="100%",mKe="100%",gKe="border:0;margin:0;",yKe="margin:0",vKe="allow-top-navigation-by-user-activation allow-popups",xKe='The "iframe" tag is not supported by your browser.',bKe=["foreignobject"],_Ke=["dominant-baseline"];function ZM(e){const r=XM(e);return _5(),lPe(r.config??{}),r}X(ZM,"processAndSetConfigs");async function noe(e,r){t6();try{const{code:n,config:i}=ZM(e);return{diagramType:(await soe(n)).type,config:i}}catch(n){if(r!=null&&r.suppressErrors)return!1;throw n}}X(noe,"parse");var BF=X((e,r,n=[])=>`
1128
1128
  .${e} ${r} { ${n.join(" !important; ")} !important; }`,"cssImportantStyles"),wKe=X((e,r=new Map)=>{let n="";if(e.themeCSS!==void 0&&(n+=`