nextclaw 0.19.31-beta.7 → 0.19.31

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 (21) hide show
  1. package/package.json +16 -16
  2. package/ui-dist/assets/{channels-list-page-D-tv11dc.js → channels-list-page-DXH1qYLs.js} +1 -1
  3. package/ui-dist/assets/{chat-page-MyXEZI8R.js → chat-page-Cpo0AFHb.js} +1 -1
  4. package/ui-dist/assets/{desktop-update-config-oZpIKKtS.js → desktop-update-config-Be8x1jNy.js} +1 -1
  5. package/ui-dist/assets/doc-browser-BI7HSaMK.js +3 -0
  6. package/ui-dist/assets/doc-browser-yTfN7UBH.js +1 -0
  7. package/ui-dist/assets/{index-D2H2CKYR.js → index-GVTiCf1s.js} +4 -4
  8. package/ui-dist/assets/{mcp-marketplace-page-CegP14Hl.js → mcp-marketplace-page-DDjeHd1I.js} +1 -1
  9. package/ui-dist/assets/mcp-marketplace-page-WUkc7n94.js +1 -0
  10. package/ui-dist/assets/{model-config-fIE_Asps.js → model-config-BjXMpU9U.js} +1 -1
  11. package/ui-dist/assets/{provider-scoped-model-input-D4zRsGZ6.js → provider-scoped-model-input-t1tCP5y5.js} +1 -1
  12. package/ui-dist/assets/{providers-list-CqsOk2hr.js → providers-list-C1D5p9kK.js} +1 -1
  13. package/ui-dist/assets/remote-BHeENKxL.js +1 -0
  14. package/ui-dist/assets/{runtime-config-page-BJ86cC8a.js → runtime-config-page--O0Wq01S.js} +1 -1
  15. package/ui-dist/assets/{search-config-TbCPlRE7.js → search-config-Dzpizo-_.js} +1 -1
  16. package/ui-dist/assets/{secrets-config-DBIEKP_V.js → secrets-config-D1AUSEXX.js} +1 -1
  17. package/ui-dist/index.html +2 -2
  18. package/ui-dist/assets/doc-browser-B2OFjScU.js +0 -3
  19. package/ui-dist/assets/doc-browser-BrUQEZ1j.js +0 -1
  20. package/ui-dist/assets/mcp-marketplace-page-MjpFEEkY.js +0 -1
  21. package/ui-dist/assets/remote-BMWQUPDW.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextclaw",
3
- "version": "0.19.31-beta.7",
3
+ "version": "0.19.31",
4
4
  "description": "Powerful AI assistant for coordinating agents, skills, CLI tools, automations, and messaging apps.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -41,20 +41,20 @@
41
41
  "commander": "^12.1.0",
42
42
  "jszip": "^3.10.1",
43
43
  "yaml": "^2.8.1",
44
- "@nextclaw/kernel": "0.1.15-beta.7",
45
- "@nextclaw/ncp-agent-runtime": "0.3.29-beta.7",
46
- "@nextclaw/ncp": "0.5.18-beta.7",
47
- "@nextclaw/ncp-toolkit": "0.5.23-beta.7",
48
- "@nextclaw/nextclaw-hermes-acp-bridge": "0.1.17-beta.7",
49
- "@nextclaw/nextclaw-ncp-runtime-http-client": "0.1.17-beta.7",
50
- "@nextclaw/core": "0.12.25-beta.7",
51
- "@nextclaw/ncp-mcp": "0.1.92-beta.7",
52
- "@nextclaw/mcp": "0.1.90-beta.7",
53
- "@nextclaw/nextclaw-ncp-runtime-stdio-client": "0.1.18-beta.7",
54
- "@nextclaw/service": "0.1.18-beta.7",
55
- "@nextclaw/runtime": "0.2.57-beta.7",
56
- "@nextclaw/server": "0.12.26-beta.7",
57
- "@nextclaw/remote": "0.1.103-beta.7"
44
+ "@nextclaw/core": "0.12.25",
45
+ "@nextclaw/mcp": "0.1.90",
46
+ "@nextclaw/ncp": "0.5.18",
47
+ "@nextclaw/ncp-agent-runtime": "0.3.29",
48
+ "@nextclaw/ncp-mcp": "0.1.92",
49
+ "@nextclaw/ncp-toolkit": "0.5.23",
50
+ "@nextclaw/kernel": "0.1.15",
51
+ "@nextclaw/nextclaw-ncp-runtime-stdio-client": "0.1.18",
52
+ "@nextclaw/nextclaw-hermes-acp-bridge": "0.1.17",
53
+ "@nextclaw/nextclaw-ncp-runtime-http-client": "0.1.17",
54
+ "@nextclaw/server": "0.12.26",
55
+ "@nextclaw/remote": "0.1.103",
56
+ "@nextclaw/runtime": "0.2.57",
57
+ "@nextclaw/service": "0.1.18"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/node": "^20.17.6",
@@ -62,7 +62,7 @@
62
62
  "tsx": "^4.19.2",
63
63
  "typescript": "^5.6.3",
64
64
  "vitest": "^4.1.2",
65
- "@nextclaw/ui": "0.12.35-beta.7"
65
+ "@nextclaw/ui": "0.12.35"
66
66
  },
67
67
  "scripts": {
68
68
  "dev": "tsx watch --tsconfig ../../scripts/dev/dev-runtime.tsconfig.json src/cli/app/index.ts",
@@ -1,4 +1,4 @@
1
- import{d as e,g as t,h as n,i as r,m as i,n as a,o,v as s}from"./react-B2X_ph0a.js";import{At as c,Ct as l,Lt as u,Mt as d,Nt as f,Rt as p,Xt as m,et as h,ft as g,jt as _,kt as v,nt as y,ot as b,tt as x,zt as S}from"./api-DruAcori.js";import{t as C}from"./createLucideIcon-Br1EFMEr.js";import{t as w}from"./search-CdhgFNwf.js";import{t as T}from"./book-open-cPX0Za7Z.js";import{t as E}from"./external-link-C3usm3se.js";import{t as D}from"./x-Chb07O-Y.js";import{$ as O,At as k,Dt as ee,Gt as A,J as j,K as M,Ot as N,Q as te,U as ne,W as re,X as ie,Xt as ae,Y as oe,Z as se,an as ce,en as le,it as ue,kt as de,ln as fe,nn as pe,pt as me,q as he,rn as ge,xt as _e}from"./index-D2H2CKYR.js";import{t as ve}from"./tabs-custom-BBXu1OGs.js";import{t as ye}from"./tag-chip-ix15P-r4.js";import{t as P}from"./config-hints-CY1lg9IE.js";import{a as F,c as I,i as be,n as xe,o as L,r as Se,s as Ce,t as we}from"./config-split-page-BFh_Qixx.js";var Te=C(`Hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),Ee=C(`Mail`,[[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}],[`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`,key:`1ocrg3`}]]),R=C(`MessageCircleMore`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}]]),z=C(`QrCode`,[[`rect`,{width:`5`,height:`5`,x:`3`,y:`3`,rx:`1`,key:`1tu5fj`}],[`rect`,{width:`5`,height:`5`,x:`16`,y:`3`,rx:`1`,key:`1v8r4q`}],[`rect`,{width:`5`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`1x03jg`}],[`path`,{d:`M21 16h-3a2 2 0 0 0-2 2v3`,key:`177gqh`}],[`path`,{d:`M21 21v.01`,key:`ents32`}],[`path`,{d:`M12 7v3a2 2 0 0 1-2 2H7`,key:`8crl2c`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M12 3h.01`,key:`n36tog`}],[`path`,{d:`M12 16v.01`,key:`133mhm`}],[`path`,{d:`M16 12h1`,key:`1slzba`}],[`path`,{d:`M21 12v.01`,key:`1lwtk9`}],[`path`,{d:`M12 21v-1`,key:`1880an`}]]),De=C(`ToggleLeft`,[[`rect`,{width:`20`,height:`12`,x:`2`,y:`6`,rx:`6`,ry:`6`,key:`f2vt7d`}],[`circle`,{cx:`8`,cy:`12`,r:`2`,key:`1nvbw3`}]]),B=s(n(),1),V=i();function Oe({value:t,onChange:n,className:i,placeholder:a=``}){let[o,s]=(0,B.useState)(``),c=e=>{e.key===`Enter`&&o.trim()?(e.preventDefault(),n([...t,o.trim()]),s(``)):e.key===`Backspace`&&!o&&t.length>0&&n(t.slice(0,-1))},l=e=>{n(t.filter((t,n)=>n!==e))};return(0,V.jsxs)(`div`,{className:e(`flex min-h-[42px] flex-wrap gap-2 rounded-xl border border-gray-200/80 bg-white p-2`,i),children:[t.map((e,t)=>(0,V.jsxs)(ye,{tone:`info`,className:`gap-1 px-2 py-1 text-sm`,children:[e,(0,V.jsx)(`button`,{type:`button`,onClick:()=>l(t),className:`transition-colors hover:text-rose-200`,children:(0,V.jsx)(D,{className:`h-3 w-3`})})]},t)),(0,V.jsx)(`input`,{type:`text`,value:o,onChange:e=>s(e.target.value),onKeyDown:c,className:`flex-1 outline-none min-w-[100px] bg-transparent text-sm`,placeholder:a||r(`enterTag`)})]})}function ke(e){return e.includes(`token`)||e.includes(`secret`)||e.includes(`password`)?(0,V.jsx)(ge,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`url`)||e.includes(`host`)?(0,V.jsx)(ce,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`email`)||e.includes(`mail`)?(0,V.jsx)(Ee,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`id`)||e.includes(`from`)?(0,V.jsx)(Te,{className:`h-3.5 w-3.5 text-gray-500`}):e===`enabled`||e===`consentGranted`?(0,V.jsx)(De,{className:`h-3.5 w-3.5 text-gray-500`}):(0,V.jsx)(ae,{className:`h-3.5 w-3.5 text-gray-500`})}function Ae({channelName:e,fields:t,formData:n,jsonDrafts:i,setJsonDrafts:a,updateField:o,uiHints:s}){return(0,V.jsx)(V.Fragment,{children:t.map(t=>{let c=P(`channels.${e}.${t.name}`,s),l=c?.label??t.label,u=c?.placeholder;return(0,V.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,V.jsxs)(_,{htmlFor:t.name,className:`flex items-center gap-2 text-sm font-medium text-gray-900`,children:[ke(t.name),l]}),t.type===`boolean`&&(0,V.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl bg-gray-50 p-3`,children:[(0,V.jsx)(`span`,{className:`text-sm text-gray-500`,children:n[t.name]?r(`enabled`):r(`disabled`)}),(0,V.jsx)(g,{id:t.name,checked:n[t.name]||!1,onCheckedChange:e=>o(t.name,e),className:`data-[state=checked]:bg-emerald-500`})]}),(t.type===`text`||t.type===`email`)&&(0,V.jsx)(d,{id:t.name,type:t.type,value:n[t.name]||``,onChange:e=>o(t.name,e.target.value),placeholder:u,className:`rounded-xl`}),t.type===`password`&&(0,V.jsx)(d,{id:t.name,type:`password`,value:n[t.name]||``,onChange:e=>o(t.name,e.target.value),placeholder:u??r(`leaveBlankToKeepUnchanged`),className:`rounded-xl`}),t.type===`number`&&(0,V.jsx)(d,{id:t.name,type:`number`,value:n[t.name]||0,onChange:e=>o(t.name,parseInt(e.target.value,10)||0),placeholder:u,className:`rounded-xl`}),t.type===`tags`&&(0,V.jsx)(Oe,{value:n[t.name]||[],onChange:e=>o(t.name,e)}),t.type===`select`&&(0,V.jsxs)(M,{value:n[t.name]||``,onValueChange:e=>o(t.name,e),children:[(0,V.jsx)(oe,{className:`rounded-xl`,children:(0,V.jsx)(ie,{})}),(0,V.jsx)(he,{children:(t.options??[]).map(e=>(0,V.jsx)(j,{value:e.value,children:e.label},e.value))})]}),t.type===`json`&&(0,V.jsx)(`textarea`,{id:t.name,value:i[t.name]??`{}`,onChange:e=>a(n=>({...n,[t.name]:e.target.value})),className:`min-h-[120px] w-full resize-none rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs font-mono`})]},t.name)})})}var je=t(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),H=t((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),U=t((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),Me=t(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),Ne=t(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),Pe=t((e=>{var t=H().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),Fe=t((e=>{var t=H().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),Ie=t((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),W=t((e=>{var t=U(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),Le=t((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),Re=t((e=>{var t=Le();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),ze=t(((e,t)=>{var n=Re();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),G=t((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),K=t((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
1
+ import{d as e,g as t,h as n,i as r,m as i,n as a,o,v as s}from"./react-B2X_ph0a.js";import{At as c,Ct as l,Lt as u,Mt as d,Nt as f,Rt as p,Xt as m,et as h,ft as g,jt as _,kt as v,nt as y,ot as b,tt as x,zt as S}from"./api-DruAcori.js";import{t as C}from"./createLucideIcon-Br1EFMEr.js";import{t as w}from"./search-CdhgFNwf.js";import{t as T}from"./book-open-cPX0Za7Z.js";import{t as E}from"./external-link-C3usm3se.js";import{t as D}from"./x-Chb07O-Y.js";import{$ as O,At as k,Dt as ee,Gt as A,J as j,K as M,Ot as N,Q as te,U as ne,W as re,X as ie,Xt as ae,Y as oe,Z as se,an as ce,en as le,it as ue,kt as de,ln as fe,nn as pe,pt as me,q as he,rn as ge,xt as _e}from"./index-GVTiCf1s.js";import{t as ve}from"./tabs-custom-BBXu1OGs.js";import{t as ye}from"./tag-chip-ix15P-r4.js";import{t as P}from"./config-hints-CY1lg9IE.js";import{a as F,c as I,i as be,n as xe,o as L,r as Se,s as Ce,t as we}from"./config-split-page-BFh_Qixx.js";var Te=C(`Hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),Ee=C(`Mail`,[[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}],[`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`,key:`1ocrg3`}]]),R=C(`MessageCircleMore`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}]]),z=C(`QrCode`,[[`rect`,{width:`5`,height:`5`,x:`3`,y:`3`,rx:`1`,key:`1tu5fj`}],[`rect`,{width:`5`,height:`5`,x:`16`,y:`3`,rx:`1`,key:`1v8r4q`}],[`rect`,{width:`5`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`1x03jg`}],[`path`,{d:`M21 16h-3a2 2 0 0 0-2 2v3`,key:`177gqh`}],[`path`,{d:`M21 21v.01`,key:`ents32`}],[`path`,{d:`M12 7v3a2 2 0 0 1-2 2H7`,key:`8crl2c`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M12 3h.01`,key:`n36tog`}],[`path`,{d:`M12 16v.01`,key:`133mhm`}],[`path`,{d:`M16 12h1`,key:`1slzba`}],[`path`,{d:`M21 12v.01`,key:`1lwtk9`}],[`path`,{d:`M12 21v-1`,key:`1880an`}]]),De=C(`ToggleLeft`,[[`rect`,{width:`20`,height:`12`,x:`2`,y:`6`,rx:`6`,ry:`6`,key:`f2vt7d`}],[`circle`,{cx:`8`,cy:`12`,r:`2`,key:`1nvbw3`}]]),B=s(n(),1),V=i();function Oe({value:t,onChange:n,className:i,placeholder:a=``}){let[o,s]=(0,B.useState)(``),c=e=>{e.key===`Enter`&&o.trim()?(e.preventDefault(),n([...t,o.trim()]),s(``)):e.key===`Backspace`&&!o&&t.length>0&&n(t.slice(0,-1))},l=e=>{n(t.filter((t,n)=>n!==e))};return(0,V.jsxs)(`div`,{className:e(`flex min-h-[42px] flex-wrap gap-2 rounded-xl border border-gray-200/80 bg-white p-2`,i),children:[t.map((e,t)=>(0,V.jsxs)(ye,{tone:`info`,className:`gap-1 px-2 py-1 text-sm`,children:[e,(0,V.jsx)(`button`,{type:`button`,onClick:()=>l(t),className:`transition-colors hover:text-rose-200`,children:(0,V.jsx)(D,{className:`h-3 w-3`})})]},t)),(0,V.jsx)(`input`,{type:`text`,value:o,onChange:e=>s(e.target.value),onKeyDown:c,className:`flex-1 outline-none min-w-[100px] bg-transparent text-sm`,placeholder:a||r(`enterTag`)})]})}function ke(e){return e.includes(`token`)||e.includes(`secret`)||e.includes(`password`)?(0,V.jsx)(ge,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`url`)||e.includes(`host`)?(0,V.jsx)(ce,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`email`)||e.includes(`mail`)?(0,V.jsx)(Ee,{className:`h-3.5 w-3.5 text-gray-500`}):e.includes(`id`)||e.includes(`from`)?(0,V.jsx)(Te,{className:`h-3.5 w-3.5 text-gray-500`}):e===`enabled`||e===`consentGranted`?(0,V.jsx)(De,{className:`h-3.5 w-3.5 text-gray-500`}):(0,V.jsx)(ae,{className:`h-3.5 w-3.5 text-gray-500`})}function Ae({channelName:e,fields:t,formData:n,jsonDrafts:i,setJsonDrafts:a,updateField:o,uiHints:s}){return(0,V.jsx)(V.Fragment,{children:t.map(t=>{let c=P(`channels.${e}.${t.name}`,s),l=c?.label??t.label,u=c?.placeholder;return(0,V.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,V.jsxs)(_,{htmlFor:t.name,className:`flex items-center gap-2 text-sm font-medium text-gray-900`,children:[ke(t.name),l]}),t.type===`boolean`&&(0,V.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl bg-gray-50 p-3`,children:[(0,V.jsx)(`span`,{className:`text-sm text-gray-500`,children:n[t.name]?r(`enabled`):r(`disabled`)}),(0,V.jsx)(g,{id:t.name,checked:n[t.name]||!1,onCheckedChange:e=>o(t.name,e),className:`data-[state=checked]:bg-emerald-500`})]}),(t.type===`text`||t.type===`email`)&&(0,V.jsx)(d,{id:t.name,type:t.type,value:n[t.name]||``,onChange:e=>o(t.name,e.target.value),placeholder:u,className:`rounded-xl`}),t.type===`password`&&(0,V.jsx)(d,{id:t.name,type:`password`,value:n[t.name]||``,onChange:e=>o(t.name,e.target.value),placeholder:u??r(`leaveBlankToKeepUnchanged`),className:`rounded-xl`}),t.type===`number`&&(0,V.jsx)(d,{id:t.name,type:`number`,value:n[t.name]||0,onChange:e=>o(t.name,parseInt(e.target.value,10)||0),placeholder:u,className:`rounded-xl`}),t.type===`tags`&&(0,V.jsx)(Oe,{value:n[t.name]||[],onChange:e=>o(t.name,e)}),t.type===`select`&&(0,V.jsxs)(M,{value:n[t.name]||``,onValueChange:e=>o(t.name,e),children:[(0,V.jsx)(oe,{className:`rounded-xl`,children:(0,V.jsx)(ie,{})}),(0,V.jsx)(he,{children:(t.options??[]).map(e=>(0,V.jsx)(j,{value:e.value,children:e.label},e.value))})]}),t.type===`json`&&(0,V.jsx)(`textarea`,{id:t.name,value:i[t.name]??`{}`,onChange:e=>a(n=>({...n,[t.name]:e.target.value})),className:`min-h-[120px] w-full resize-none rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs font-mono`})]},t.name)})})}var je=t(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),H=t((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),U=t((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),Me=t(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),Ne=t(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),Pe=t((e=>{var t=H().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),Fe=t((e=>{var t=H().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),Ie=t((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),W=t((e=>{var t=U(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),Le=t((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),Re=t((e=>{var t=Le();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),ze=t(((e,t)=>{var n=Re();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),G=t((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),K=t((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
2
2
  ]))+`;e.KANJI=new RegExp(r,`g`),e.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),e.BYTE=new RegExp(i,`g`),e.NUMERIC=new RegExp(t,`g`),e.ALPHANUMERIC=new RegExp(n,`g`);var a=RegExp(`^`+r+`$`),o=RegExp(`^`+t+`$`),s=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);e.testKanji=function(e){return a.test(e)},e.testNumeric=function(e){return o.test(e)},e.testAlphanumeric=function(e){return s.test(e)}})),q=t((e=>{var t=G(),n=K();e.NUMERIC={id:`Numeric`,bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:`Alphanumeric`,bit:2,ccBits:[9,11,13]},e.BYTE={id:`Byte`,bit:4,ccBits:[8,16,16]},e.KANJI={id:`Kanji`,bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw Error(`Invalid mode: `+e);if(!t.isValid(n))throw Error(`Invalid version: `+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw Error(`Invalid mode`)},e.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`numeric`:return e.NUMERIC;case`alphanumeric`:return e.ALPHANUMERIC;case`kanji`:return e.KANJI;case`byte`:return e.BYTE;default:throw Error(`Unknown mode: `+t)}}e.from=function(t,n){if(e.isValid(t))return t;try{return r(t)}catch{return n}}})),Be=t((e=>{var t=H(),n=W(),r=U(),i=q(),a=G(),o=7973,s=t.getBCHDigit(o);function c(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){let r=l(e.mode,t);n+=r+e.getBitsLength()}),n}function d(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,i.MIXED))return r}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,o){if(!a.isValid(e))throw Error(`Invalid QR Code version`);o===void 0&&(o=i.BYTE);let s=(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r))*8;if(o===i.MIXED)return s;let c=s-l(o,e);switch(o){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(e,t){let n,i=r.from(t,r.M);if(Array.isArray(e)){if(e.length>1)return d(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return c(n.mode,n.getLength(),i)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error(`Invalid QR Code version`);let n=e<<12;for(;t.getBCHDigit(n)-s>=0;)n^=o<<t.getBCHDigit(n)-s;return e<<12|n}})),Ve=t((e=>{var t=H(),n=1335,r=21522,i=t.getBCHDigit(n);e.getEncodedBits=function(e,a){let o=e.bit<<3|a,s=o<<10;for(;t.getBCHDigit(s)-i>=0;)s^=n<<t.getBCHDigit(s)-i;return(o<<10|s)^r}})),He=t(((e,t)=>{var n=q();function r(e){this.mode=n.NUMERIC,this.data=e.toString()}r.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},t.exports=r})),Ue=t(((e,t)=>{var n=q(),r=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=r.indexOf(this.data[t])*45;n+=r.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},t.exports=i})),We=t(((e,t)=>{var n=q();function r(e){this.mode=n.BYTE,typeof e==`string`?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}r.getBitsLength=function(e){return e*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},t.exports=r})),Ge=t(((e,t)=>{var n=q(),r=H();function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=r.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw Error(`Invalid SJIS character: `+this.data[t]+`
3
3
  Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},t.exports=i})),Ke=t(((e,t)=>{var n={single_source_shortest_paths:function(e,t,r){var i={},a={};a[t]=0;var o=n.PriorityQueue.make();o.push(t,0);for(var s,c,l,u,d,f,p,m,h;!o.empty();)for(l in s=o.pop(),c=s.value,u=s.cost,d=e[c]||{},d)d.hasOwnProperty(l)&&(f=d[l],p=u+f,m=a[l],h=a[l]===void 0,(h||m>p)&&(a[l]=p,o.push(l,p),i[l]=c));if(r!==void 0&&a[r]===void 0){var g=[`Could not find a path from `,t,` to `,r,`.`].join(``);throw Error(g)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t=n.PriorityQueue,r={},i;for(i in e||={},t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t!==void 0&&(t.exports=n)})),qe=t((e=>{var t=q(),n=He(),r=Ue(),i=We(),a=Ge(),o=K(),s=H(),c=Ke();function l(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function d(e){let n=u(o.NUMERIC,t.NUMERIC,e),r=u(o.ALPHANUMERIC,t.ALPHANUMERIC,e),i,a;return s.isKanjiModeEnabled()?(i=u(o.BYTE,t.BYTE,e),a=u(o.KANJI,t.KANJI,e)):(i=u(o.BYTE_KANJI,t.BYTE,e),a=[]),n.concat(r,i,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,o){switch(o){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e){return e.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function m(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case t.NUMERIC:n.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:n.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:n.push([i,{data:i.data,mode:t.BYTE,length:l(i.data)}]);break;case t.BYTE:n.push([{data:i.data,mode:t.BYTE,length:l(i.data)}])}}return n}function h(e,n){let r={},i={start:{}},a=[`start`];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let l=s[e],u=``+o+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<a.length;e++){let o=a[e];r[o]&&r[o].node.mode===l.mode?(i[o][u]=f(r[o].lastCount+l.length,l.mode)-f(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][u]=f(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}a=c}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:r}}function g(e,o){let c,l=t.getBestModeForData(e);if(c=t.from(o,l),c!==t.BYTE&&c.bit<l.bit)throw Error(`"`+e+`" cannot be encoded with mode `+t.toString(c)+`.
4
4
  Suggested mode is: `+t.toString(l));switch(c===t.KANJI&&!s.isKanjiModeEnabled()&&(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return typeof t==`string`?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},e.fromString=function(t,n){let r=h(m(d(t,s.isKanjiModeEnabled())),n),i=c.find_path(r.map,`start`,`end`),a=[];for(let e=1;e<i.length-1;e++)a.push(r.table[i[e]].node);return e.fromArray(p(a))},e.rawSplit=function(t){return e.fromArray(d(t,s.isKanjiModeEnabled()))}})),Je=t((e=>{var t=H(),n=U(),r=Me(),i=Ne(),a=Pe(),o=Fe(),s=Ie(),c=W(),l=ze(),u=Be(),d=Ve(),f=q(),p=qe();function m(e,t){let n=e.size,r=o.getPositions(t);for(let t=0;t<r.length;t++){let i=r[t][0],a=r[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let r=-1;r<=7;r++)a+r<=-1||n<=a+r||(t>=0&&t<=6&&(r===0||r===6)||r>=0&&r<=6&&(t===0||t===6)||t>=2&&t<=4&&r>=2&&r<=4?e.set(i+t,a+r,!0,!0):e.set(i+t,a+r,!1,!0))}}function h(e){let t=e.size;for(let n=8;n<t-8;n++){let t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function g(e,t){let n=a.getPositions(t);for(let t=0;t<n.length;t++){let r=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)t===-2||t===2||n===-2||n===2||t===0&&n===0?e.set(r+t,i+n,!0,!0):e.set(r+t,i+n,!1,!0)}}function _(e,t){let n=e.size,r=u.getEncodedBits(t),i,a,o;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+n-8-3,o=(r>>t&1)==1,e.set(i,a,o,!0),e.set(a,i,o,!0)}function v(e,t,n){let r=e.size,i=d.getEncodedBits(t,n),a,o;for(a=0;a<15;a++)o=(i>>a&1)==1,a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(r-15+a,8,o,!0),a<8?e.set(8,r-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(r-8,8,1,!0)}function y(e,t){let n=e.size,r=-1,i=n-1,a=7,o=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,s-n)){let r=!1;o<t.length&&(r=(t[o]>>>a&1)==1),e.set(i,s-n,r),a--,a===-1&&(o++,a=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function b(e,n,i){let a=new r;i.forEach(function(t){a.put(t.mode.bit,4),a.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(a)});let o=(t.getSymbolTotalCodewords(e)-c.getTotalCodewordsCount(e,n))*8;for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(0);let s=(o-a.getLengthInBits())/8;for(let e=0;e<s;e++)a.put(e%2?17:236,8);return x(a,e,n)}function x(e,n,r){let i=t.getSymbolTotalCodewords(n),a=i-c.getTotalCodewordsCount(n,r),o=c.getBlocksCount(n,r),s=o-i%o,u=Math.floor(i/o),d=Math.floor(a/o),f=d+1,p=u-d,m=new l(p),h=0,g=Array(o),_=Array(o),v=0,y=new Uint8Array(e.buffer);for(let e=0;e<o;e++){let t=e<s?d:f;g[e]=y.slice(h,h+t),_[e]=m.encode(g[e]),h+=t,v=Math.max(v,t)}let b=new Uint8Array(i),x=0,S,C;for(S=0;S<v;S++)for(C=0;C<o;C++)S<g[C].length&&(b[x++]=g[C][S]);for(S=0;S<p;S++)for(C=0;C<o;C++)b[x++]=_[C][S];return b}function S(e,n,r,a){let o;if(Array.isArray(e))o=p.fromArray(e);else if(typeof e==`string`){let t=n;if(!t){let n=p.rawSplit(e);t=u.getBestVersionForData(n,r)}o=p.fromString(e,t||40)}else throw Error(`Invalid data`);let c=u.getBestVersionForData(o,r);if(!c)throw Error(`The amount of data is too big to be stored in a QR Code`);if(!n)n=c;else if(n<c)throw Error(`
@@ -1,4 +1,4 @@
1
- import{d as e,h as t,i as n,m as r,v as i}from"./react-B2X_ph0a.js";import{A as a,At as o,D as s,E as c,Gt as l,Ht as u,Jt as d,Kt as f,Lt as p,Mt as m,Nt as h,O as g,Rt as _,Tt as v,Ut as y,Vt as b,Wt as x,Xt as S,_t as C,an as w,en as T,in as E,j as D,k as O,kt as ee,nn as te,qt as ne,rn as re,tn as k,wt as A,zt as j}from"./api-DruAcori.js";import{d as ie,f as ae,p as oe}from"./doc-browser-B2OFjScU.js";import{a as se,c as M,i as N,l as ce,n as le,o as ue,r as de,s as P}from"./mcp-marketplace-page-CegP14Hl.js";import{a as F,c as fe,i as I,n as pe,o as L,r as R,s as me}from"./confirm-dialog-B0TP-vPd.js";import{t as z}from"./createLucideIcon-Br1EFMEr.js";import{n as he}from"./search-CdhgFNwf.js";import{i as ge,n as _e,r as ve,t as ye}from"./provider-scoped-model-input-D4zRsGZ6.js";import{t as be}from"./play-CqNi0u02.js";import{t as xe}from"./plus-BcIC8dG1.js";import{n as Se}from"./doc-browser-context-DB6TTHeE.js";import{$t as Ce,A as we,B as Te,C as Ee,Ct as De,D as Oe,E as ke,Et as Ae,F as je,H as Me,I as B,J as V,Jt as Ne,K as Pe,Kt as H,L as Fe,M as Ie,Mt as Le,N as Re,Nt as ze,O as Be,P as Ve,Q as He,Qt as Ue,R as We,S as Ge,St as Ke,T as qe,Tt as Je,V as Ye,X as Xe,Y as Ze,Yt as Qe,Z as $e,_ as et,a as tt,b as nt,c as rt,cn as it,d as at,dn as ot,f as st,fn as ct,ft as lt,g as ut,h as dt,i as ft,in as pt,j as mt,jt as ht,k as gt,l as _t,lt as vt,m as yt,n as bt,nt as xt,o as St,ot as Ct,p as wt,q as Tt,r as Et,s as Dt,sn as Ot,st as kt,t as At,tn as jt,tt as Mt,u as U,v as Nt,w as Pt,wt as Ft,x as W,xt as It,y as G,z as Lt}from"./index-D2H2CKYR.js";import{t as Rt}from"./tabs-custom-BBXu1OGs.js";import{t as zt}from"./tag-chip-ix15P-r4.js";function Bt(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function Vt(e,t,n){let r=e.slice(0);return r[t]=n,r}var Ht=class extends w{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#p(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,k.batch(()=>{let e=this.#i,t=this.#f(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!E(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Bt(e,n).forEach(e=>{e.destroy()}),Bt(n,e).forEach(e=>{e.subscribe(t=>{this.#p(e,t)})})),this.#m()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#f(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(!this.#a||this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=re(this.#a,t(e))),this.#a}return e}#f(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new T(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#p(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=Vt(this.#t,n,t),this.#m())}#m(){if(this.hasListeners()){let e=this.#a,t=this.#u(this.#t,this.#l);e!==this.#d(t,this.#r?.combine)&&k.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},K=i(t(),1);function Ut({queries:e,...t},n){let r=S(n),i=d(),a=ne(),o=K.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{b(e),x(e,a,r.getQueryCache().get(e.queryHash))}),f(a);let[s]=K.useState(()=>new Ht(r,o,t)),[c,p,m]=s.getOptimisticResult(o,t.combine),h=!i&&t.subscribed!==!1;K.useSyncExternalStore(K.useCallback(e=>h?s.subscribe(k.batchCalls(e)):te,[s,h]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),K.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let g=c.some((e,t)=>y(o[t],e))?c.flatMap((e,t)=>{let n=o[t];return n&&y(n,e)?u(n,new T(r,n),a):[]}):[];if(g.length>0)throw Promise.all(g);let _=c.find((e,t)=>{let n=o[t];return n&&l({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(_?.error)throw _.error;return p(m())}var Wt=z(`BriefcaseBusiness`,[[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2`,key:`1ksdt3`}],[`path`,{d:`M22 13a18.15 18.15 0 0 1-20 0`,key:`12hx5q`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),Gt=z(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Kt=z(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),qt=z(`Compass`,[[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Jt=z(`Earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Yt=z(`Ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Xt=z(`MessagesSquare`,[[`path`,{d:`M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z`,key:`p1xzt8`}],[`path`,{d:`M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1`,key:`1cx29u`}]]),Zt=z(`PenLine`,[[`path`,{d:`M12 20h9`,key:`t2du7b`}],[`path`,{d:`M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z`,key:`1ykcvy`}]]),Qt=z(`Power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),$t=z(`SquareTerminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),q=r(),en=K.forwardRef(({className:t,...n},r)=>(0,q.jsx)(`textarea`,{className:e(`flex min-h-28 w-full rounded-xl border border-gray-200/80 bg-white px-3.5 py-2.5 text-sm text-gray-900 placeholder:text-gray-300 placeholder:font-normal focus:outline-none focus:ring-1 focus:ring-primary/40 focus:border-primary/40 transition-colors disabled:cursor-not-allowed disabled:opacity-50`,t),ref:r,...n}));en.displayName=`Textarea`;function tn(e){return{displayName:e.displayName??``,description:e.description??``,avatar:e.avatar??``,model:e.model??``,runtime:e.runtime??e.engine??``}}function nn(e){let{runtimeOptions:t,currentRuntime:n}=e,r=n.trim();if(!r)return t;let i=G(r);return t.some(e=>e.value===i)?t:[...t,{value:i,label:W(i),icon:null,ready:!1,reason:`unavailable`,reasonMessage:null,supportedModels:void 0,recommendedModel:null,cta:null}].sort((e,t)=>e.value===`native`?-1:t.value===`native`?1:e.value.localeCompare(t.value))}function rn({value:e,disabled:t=!1,runtimeOptions:r,defaultRuntime:i,onChange:a}){let o=e.trim()?G(e):``,s=nn({runtimeOptions:r,currentRuntime:e}),c=s.find(e=>e.value===o)??null,l=c?.reasonMessage?.trim()||(c?.ready===!1?n(`agentsRuntimeUnavailableHelp`):``);return(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsxs)(Pe,{value:o||i,onValueChange:e=>a(e===i?``:e),disabled:t,children:[(0,q.jsx)(Ze,{"aria-label":n(`agentsCardRuntimeLabel`),className:`rounded-xl`,children:(0,q.jsx)(Xe,{placeholder:n(`agentsRuntimeSelectPlaceholder`)})}),(0,q.jsx)(Tt,{className:`rounded-xl`,children:s.map(e=>(0,q.jsx)(V,{value:e.value,disabled:e.ready===!1&&e.value!==o,className:`rounded-lg`,children:e.label},e.value))})]}),l?(0,q.jsx)(`p`,{className:`text-xs text-gray-500`,children:l}):null]})}function an({agent:e,pending:t,providerCatalog:n,runtimeOptions:r,defaultRuntime:i,onOpenChange:a,onSubmit:o}){return(0,q.jsx)(R,{open:e!==null,onOpenChange:a,children:e?(0,q.jsx)(on,{agent:e,pending:t,providerCatalog:n,runtimeOptions:r,defaultRuntime:i,onOpenChange:a,onSubmit:o},e.id):null})}function on(e){let{agent:t,pending:r,providerCatalog:i,runtimeOptions:a,defaultRuntime:o,onOpenChange:s,onSubmit:c}=e,[l,u]=(0,K.useState)(tn(t));return(0,q.jsxs)(I,{className:`flex max-h-[calc(100vh-2rem)] flex-col overflow-hidden border-none bg-[linear-gradient(180deg,#fff9f1_0%,#ffffff_24%)] p-0 sm:max-h-[760px] sm:max-w-xl`,children:[(0,q.jsx)(`div`,{className:`shrink-0 border-b border-[#f0e2c8] px-6 py-6`,children:(0,q.jsxs)(me,{className:`text-left`,children:[(0,q.jsx)(fe,{children:n(`agentsEditDialogTitle`)}),(0,q.jsx)(F,{children:n(`agentsEditDialogDescription`)})]})}),(0,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-6 py-6`,children:(0,q.jsxs)(`div`,{className:`space-y-4`,children:[(0,q.jsx)(pe,{tone:`warning`,title:n(`agentsEditHomeReadonly`),description:n(`agentsEditHomeReadonlyHint`),children:(0,q.jsx)(`div`,{className:`break-all text-sm text-amber-950`,children:t.workspace??`-`})}),(0,q.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,q.jsx)(m,{value:l.displayName,onChange:e=>u(t=>({...t,displayName:e.target.value})),placeholder:n(`agentsFormNamePlaceholder`)}),(0,q.jsx)(en,{value:l.description,onChange:e=>u(t=>({...t,description:e.target.value})),placeholder:n(`agentsFormDescriptionPlaceholder`),rows:4,className:`md:col-span-2`}),(0,q.jsx)(m,{value:l.avatar,onChange:e=>u(t=>({...t,avatar:e.target.value})),placeholder:n(`agentsFormAvatarPlaceholder`)}),(0,q.jsx)(ye,{value:l.model,onChange:e=>u(t=>({...t,model:e})),providerCatalog:i,disabled:r,className:`md:col-span-2`}),(0,q.jsx)(rn,{value:l.runtime,onChange:e=>u(t=>({...t,runtime:e})),runtimeOptions:a,defaultRuntime:o,disabled:r})]})]})}),(0,q.jsxs)(L,{className:`shrink-0 border-t border-[#f1e7d4] px-6 py-5`,children:[(0,q.jsx)(h,{type:`button`,variant:`ghost`,onClick:()=>s(!1),disabled:r,children:n(`cancel`)}),(0,q.jsxs)(h,{type:`button`,variant:`primary`,className:`rounded-2xl px-5`,onClick:()=>c(t.id,l),disabled:r,children:[(0,q.jsx)(Ce,{className:`mr-2 h-4 w-4`}),n(`agentsEditSaveAction`)]})]})]})}var sn=`请直接创建一个默认示例 Agent,不要问我问题。创建完成后,简单告诉我它能做什么。`;function cn(e){let{agentCount:t,onCreate:r}=e;return(0,q.jsxs)(`section`,{className:`flex flex-col gap-3 border-b border-gray-200 pb-4 sm:flex-row sm:items-end sm:justify-between`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsx)(`h1`,{className:`text-xl font-semibold text-gray-950`,children:n(`agentsHeroEyebrow`)}),(0,q.jsx)(`span`,{className:`rounded-full border border-gray-200 bg-white px-2 py-0.5 text-xs font-medium text-gray-500`,children:t})]}),(0,q.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-gray-500`,children:n(`agentsHeroDescription`)})]}),(0,q.jsxs)(h,{type:`button`,variant:`primary`,className:`h-9 shrink-0 rounded-xl px-4 text-sm font-semibold`,onClick:r,children:[(0,q.jsx)(xe,{className:`mr-2 h-4 w-4`}),n(`agentsCreateButton`)]})]})}function ln(t){let{icon:n,label:r,disabled:i=!1,destructive:a=!1,onClick:o}=t;return(0,q.jsxs)(`button`,{type:`button`,className:e(`flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50`,a?`text-destructive hover:bg-destructive/10`:`text-gray-700 hover:bg-gray-100`),onClick:o,disabled:i,children:[(0,q.jsx)(n,{className:`h-4 w-4 shrink-0`}),(0,q.jsx)(`span`,{children:r})]})}function un(e){let{agent:t,runtimeOptions:r,defaultRuntimeLabel:i,updatePending:a,deletePending:o,onStartChat:s,onEdit:c,onDelete:l}=e,u=t.runtime?.trim()||t.engine?.trim()||``,d=u?r.find(e=>e.value===G(u))?.label??W(u):i;return(0,q.jsx)(A,{className:`group overflow-hidden border border-gray-200 bg-white shadow-none transition-colors duration-200 hover:border-gray-300`,children:(0,q.jsxs)(v,{className:`relative flex h-full flex-col gap-3 px-3.5 py-3.5`,children:[(0,q.jsxs)(`div`,{className:`flex items-start gap-2.5 pr-16`,children:[(0,q.jsx)(Me,{agentId:t.id,displayName:t.displayName,avatarUrl:t.avatarUrl,className:`h-9 w-9 shrink-0`}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(`div`,{className:`truncate text-sm font-semibold text-gray-950`,children:t.displayName?.trim()||t.id}),t.builtIn?(0,q.jsxs)(zt,{tone:`warning`,className:`h-5 gap-1 border-amber-200 bg-amber-50 px-1.5 text-[10px] text-amber-700`,children:[(0,q.jsx)(Qe,{className:`h-3 w-3`}),n(`agentsCardBuiltInTag`)]}):null]}),(0,q.jsxs)(`div`,{className:`truncate text-xs text-gray-400`,children:[`@`,t.id]})]})]}),(0,q.jsxs)(`div`,{className:`absolute right-2.5 top-2.5 flex items-center gap-1 opacity-100 transition-opacity md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100`,children:[(0,q.jsx)(h,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-lg text-gray-400 hover:text-gray-800`,"aria-label":n(`agentsCardStartChat`),title:n(`agentsCardStartChat`),onClick:s,children:(0,q.jsx)(jt,{className:`h-4 w-4`})}),(0,q.jsxs)(ht,{children:[(0,q.jsx)(ze,{asChild:!0,children:(0,q.jsx)(h,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-lg text-gray-400 hover:text-gray-800`,"aria-label":n(`chatSessionMoreActions`),title:n(`chatSessionMoreActions`),children:(0,q.jsx)(Yt,{className:`h-4 w-4`})})}),(0,q.jsxs)(Le,{align:`end`,className:`w-44 p-1.5`,children:[(0,q.jsx)(ln,{icon:Ce,label:n(`agentsEditAction`),onClick:c,disabled:a}),t.builtIn?null:(0,q.jsx)(ln,{icon:H,label:n(`agentsRemoveAction`),onClick:l,disabled:o,destructive:!0})]})]})]}),(0,q.jsx)(`p`,{className:`line-clamp-2 min-h-10 text-sm leading-5 text-gray-600`,children:t.description?.trim()||(t.builtIn?n(`agentsCardBuiltInSummary`):n(`agentsCardCustomSummary`))}),(0,q.jsxs)(`div`,{className:`mt-auto grid gap-2 border-t border-gray-100 pt-2 text-xs text-gray-500`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(Ne,{className:`h-3.5 w-3.5 shrink-0 text-gray-300`}),(0,q.jsx)(`span`,{className:`truncate`,children:d})]}),(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(pt,{className:`h-3.5 w-3.5 shrink-0 text-gray-300`}),(0,q.jsx)(`span`,{className:`truncate`,children:t.workspace??`-`})]})]})]})})}function dn(){let e=Lt(),t=Ee(),r=$e(),i=He(),a=Dt(),s=qe(),c=Pt(),[l,u]=(0,K.useState)(null),d=(0,K.useMemo)(()=>t.data?.agents??[],[t.data?.agents]),f=(0,K.useMemo)(()=>[...d].sort((e,t)=>Number(!!t.builtIn)-Number(!!e.builtIn)||e.id.localeCompare(t.id)),[d]),p=(0,K.useMemo)(()=>_e({config:r.data,meta:i.data,onlyConfigured:!0}),[i.data,r.data]),m=(0,K.useMemo)(()=>Nt(a.data?.options??[]),[a.data?.options]),g=(0,K.useMemo)(()=>G(a.data?.defaultType??`native`),[a.data?.defaultType]),_=(0,K.useMemo)(()=>m.find(e=>e.value===g)?.label??W(g),[g,m]),y=e=>{u(e)},b=async(e,t)=>{await s.mutateAsync({agentId:e,data:{displayName:t.displayName,description:t.description,avatar:t.avatar,model:t.model,...t.runtime.trim()?{runtime:t.runtime.trim()}:{runtime:``}}}),u(null)},x=t=>{e.chatSessionListManager.startAgentDraftChat(t.id,nt(t,g))};return(0,q.jsxs)(o,{className:`space-y-5`,children:[(0,q.jsx)(cn,{agentCount:d.length,onCreate:()=>e.startAgentCreationDraft(sn)}),(0,q.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-3`,children:t.isLoading?(0,q.jsx)(A,{className:`md:col-span-2 xl:col-span-3 border-dashed border-[#d9dce3] bg-white/70`,children:(0,q.jsx)(v,{className:`py-14 text-center text-sm text-gray-500`,children:n(`agentsLoading`)})}):f.length===0?(0,q.jsx)(A,{className:`md:col-span-2 xl:col-span-3 overflow-hidden border-dashed border-[#d9dce3] bg-[linear-gradient(135deg,#fff7ea_0%,#f4fbff_100%)]`,children:(0,q.jsxs)(v,{className:`flex min-h-[240px] flex-col items-center justify-center px-6 py-14 text-center`,children:[(0,q.jsx)(`div`,{className:`mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-white/80 shadow-[0_18px_44px_rgba(0,0,0,0.08)]`,children:(0,q.jsx)(ot,{className:`h-8 w-8 text-[#d39a3b]`})}),(0,q.jsx)(`div`,{className:`text-lg font-semibold text-[#2f2212]`,children:n(`agentsEmpty`)}),(0,q.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-[#78644d]`,children:n(`agentsEmptyDescription`)}),(0,q.jsxs)(h,{type:`button`,variant:`primary`,className:`mt-5 rounded-2xl px-5`,onClick:()=>e.startAgentCreationDraft(sn),children:[(0,q.jsx)(xe,{className:`mr-2 h-4 w-4`}),n(`agentsCreateButton`)]})]})}):f.map(e=>(0,q.jsx)(un,{agent:e,runtimeOptions:m,defaultRuntimeLabel:_,updatePending:s.isPending,deletePending:c.isPending,onStartChat:()=>x(e),onEdit:()=>y(e),onDelete:()=>c.mutate({agentId:e.id})},e.id))}),(0,q.jsx)(an,{agent:l,pending:s.isPending,providerCatalog:p,runtimeOptions:m,defaultRuntime:g,onOpenChange:e=>{!e&&!s.isPending&&u(null)},onSubmit:b})]})}function fn(e,t){let n=t.trim().toLowerCase();return n?[e.id,e.name,e.payload.message,e.payload.sessionId??``,e.payload.channel??``,e.payload.to??``].join(` `).toLowerCase().includes(n):!0}function pn(e,t){return t===`all`?!0:t===`enabled`?e.enabled:!e.enabled}function mn(t){let{job:r,onDelete:i,onRun:a,onToggle:o}=t;return(0,q.jsx)(A,{className:`border border-gray-200`,children:(0,q.jsx)(v,{className:`pt-5 pb-5`,children:(0,q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,q.jsxs)(`div`,{className:`min-w-[220px] flex-1`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-semibold text-gray-900`,children:r.name||r.id}),(0,q.jsx)(`span`,{className:`rounded-full bg-gray-100 px-2 py-0.5 text-[10px] font-semibold text-gray-500`,children:r.id}),(0,q.jsx)(`span`,{className:e(`rounded-full px-2 py-0.5 text-[10px] font-semibold`,r.enabled?`bg-emerald-50 text-emerald-700`:`bg-gray-100 text-gray-500`),children:r.enabled?n(`enabled`):n(`disabled`)}),r.deleteAfterRun?(0,q.jsx)(`span`,{className:`rounded-full bg-amber-50 px-2 py-0.5 text-[10px] font-semibold text-amber-700`,children:n(`cronOneShot`)}):null]}),(0,q.jsxs)(`div`,{className:`mt-2 text-xs text-gray-500`,children:[n(`cronScheduleLabel`),`: `,st(r)]}),(0,q.jsx)(`div`,{className:`mt-2 whitespace-pre-wrap break-words text-sm text-gray-700`,children:r.payload.message}),(0,q.jsxs)(`div`,{className:`mt-2 text-xs text-gray-500`,children:[n(`cronSessionLabel`),`: `,wt(r)]}),(0,q.jsxs)(`div`,{className:`mt-2 text-xs text-gray-500`,children:[n(`cronDeliverTo`),`: `,at(r)]})]}),(0,q.jsxs)(`div`,{className:`min-w-[220px] space-y-2 text-xs text-gray-500`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[n(`cronNextRun`),`:`]}),` `,yt(r.state.nextRunAt)]}),(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[n(`cronLastRun`),`:`]}),` `,yt(r.state.lastRunAt)]}),(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[n(`cronLastStatus`),`:`]}),` `,r.state.lastStatus??`-`]}),r.state.lastError?(0,q.jsx)(`div`,{className:`break-words text-[11px] text-red-500`,children:r.state.lastError}):null]}),(0,q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-end gap-2`,children:[(0,q.jsxs)(h,{variant:`subtle`,size:`sm`,onClick:()=>a(r),className:`gap-1`,children:[(0,q.jsx)(be,{className:`h-3.5 w-3.5`}),n(`cronRunNow`)]}),(0,q.jsxs)(h,{variant:r.enabled?`outline`:`primary`,size:`sm`,onClick:()=>o(r),className:`gap-1`,children:[(0,q.jsx)(Qt,{className:`h-3.5 w-3.5`}),r.enabled?n(`cronDisable`):n(`cronEnable`)]}),(0,q.jsxs)(h,{variant:`destructive`,size:`sm`,onClick:()=>i(r),className:`gap-1`,children:[(0,q.jsx)(H,{className:`h-3.5 w-3.5`}),n(`delete`)]})]})]})})})}function hn(){let[t,r]=(0,K.useState)(``),[i,a]=(0,K.useState)(`all`),s=Mt({all:!0}),c=xt(),l=lt(),u=vt(),{confirm:d,ConfirmDialog:f}=dt(),p=(0,K.useMemo)(()=>(s.data?.jobs??[]).filter(e=>fn(e,t)).filter(e=>pn(e,i)),[s.data,t,i]),g=async e=>{await d({title:`${n(`cronDeleteConfirm`)}?`,description:e.name?`${e.name} (${e.id})`:e.id,variant:`destructive`,confirmLabel:n(`delete`)})&&c.mutate({id:e.id})},_=async e=>{let t=!e.enabled;await d({title:t?`${n(`cronEnableConfirm`)}?`:`${n(`cronDisableConfirm`)}?`,description:e.name?`${e.name} (${e.id})`:e.id,variant:t?`default`:`destructive`,confirmLabel:n(t?`cronEnable`:`cronDisable`)})&&l.mutate({id:e.id,enabled:t})},v=async e=>{let t=!e.enabled;await d({title:t?`${n(`cronRunForceConfirm`)}?`:`${n(`cronRunConfirm`)}?`,description:e.name?`${e.name} (${e.id})`:e.id,confirmLabel:n(`cronRunNow`)})&&u.mutate({id:e.id,force:t})};return(0,q.jsxs)(o,{fullHeight:!0,children:[(0,q.jsx)(ee,{title:n(`cronPageTitle`),description:n(`cronPageDescription`),actions:(0,q.jsx)(h,{variant:`ghost`,size:`icon`,className:`h-9 w-9 rounded-lg text-gray-400 hover:text-gray-700 hover:bg-gray-100`,onClick:()=>s.refetch(),children:(0,q.jsx)(Ue,{className:e(`h-4 w-4`,s.isFetching&&`animate-spin`)})})}),(0,q.jsx)(`div`,{className:`mb-6`,children:(0,q.jsxs)(`div`,{className:`flex flex-wrap gap-3 items-center`,children:[(0,q.jsxs)(`div`,{className:`relative flex-1 min-w-[240px]`,children:[(0,q.jsx)(m,{value:t,onChange:e=>r(e.target.value),placeholder:n(`cronSearchPlaceholder`),className:`pl-9`}),(0,q.jsx)(ct,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`})]}),(0,q.jsx)(`div`,{className:`min-w-[180px]`,children:(0,q.jsxs)(Pe,{value:i,onValueChange:e=>a(e),children:[(0,q.jsx)(Ze,{className:`w-full`,children:(0,q.jsx)(Xe,{placeholder:n(`cronStatusLabel`)})}),(0,q.jsxs)(Tt,{children:[(0,q.jsx)(V,{value:`all`,children:n(`cronStatusAll`)}),(0,q.jsx)(V,{value:`enabled`,children:n(`cronStatusEnabled`)}),(0,q.jsx)(V,{value:`disabled`,children:n(`cronStatusDisabled`)})]})]})}),(0,q.jsxs)(`div`,{className:`text-xs text-gray-500 ml-auto`,children:[n(`cronTotalLabel`),`: `,s.data?.total??0,` / `,p.length]})]})}),(0,q.jsx)(`div`,{className:`flex-1 overflow-auto custom-scrollbar`,children:s.isLoading?(0,q.jsx)(`div`,{className:`text-sm text-gray-400 p-4 text-center`,children:n(`cronLoading`)}):p.length===0?(0,q.jsx)(`div`,{className:`text-sm text-gray-400 p-4 text-center`,children:n(`cronEmpty`)}):(0,q.jsx)(`div`,{className:`space-y-4`,children:p.map(e=>(0,q.jsx)(mn,{job:e,onDelete:g,onRun:v,onToggle:_},e.id))})}),(0,q.jsx)(f,{})]})}function gn(e){return Array.from(new Set(e.map(e=>e.spec).filter(Boolean)))}function _n(e){let t=new Date().toISOString();return e.result.type===`skill`?{type:`skill`,spec:e.result.spec,id:e.request.skill??e.result.spec,label:e.request.skill??e.result.name??e.result.spec,source:`workspace`,installPath:e.request.installPath,installedAt:t}:{type:e.result.type,spec:e.result.spec,id:e.result.name??e.result.spec,label:e.result.name??e.result.spec,source:`marketplace`,origin:`marketplace`,enabled:e.request.enabled??!0,runtimeStatus:e.request.enabled===!1?`disabled`:`ready`,installedAt:t}}function vn(e,t){return!!(t.spec&&e.spec===t.spec||t.id&&e.id===t.id)}function yn(e,t){return t??{type:e,total:0,specs:[],records:[]}}function bn(e){let t=yn(e.result.type,e.view),n=_n(e),r=t.records.findIndex(e=>vn(e,{id:n.id,spec:n.spec})),i=[...t.records];return r>=0?i[r]={...i[r],...n}:i.unshift(n),{...t,type:e.result.type,records:i,specs:gn(i),total:i.length}}function xn(e){let t=yn(e.result.type,e.view);if(e.result.action===`uninstall`||e.result.action===`remove`){let n=t.records.filter(t=>!vn(t,{id:e.result.id,spec:e.request.spec}));return{...t,records:n,specs:gn(n),total:n.length}}let n=t.records.map(t=>vn(t,{id:e.result.id,spec:e.request.spec})?e.result.action===`disable`?{...t,enabled:!1,runtimeStatus:`disabled`}:{...t,enabled:!0,runtimeStatus:`ready`}:t);return{...t,records:n,specs:gn(n),total:n.length}}function Sn(e){let t=ce({queryKey:[`marketplace-items`,e],initialPageParam:1,queryFn:({pageParam:t})=>s({...e,page:t}),getNextPageParam:e=>e.page<e.totalPages?e.page+1:void 0,placeholderData:(t,n)=>{let r=n?.queryKey?.[1];if(!(!r||typeof r!=`object`||!r))return(`type`in r?r.type:void 0)===e.type&&Cn(r,e)?t:void 0},staleTime:15e3}),n=(0,K.useMemo)(()=>M(t.data),[t.data]);return{...t,data:n}}function Cn(e,t){return e.q===t.q&&e.tag===t.tag&&e.scene===t.scene&&e.sort===t.sort&&e.pageSize===t.pageSize}function wn(e=!0){return j({queryKey:[`marketplace-skill-scenes`],queryFn:O,enabled:e,staleTime:6e4})}function Tn(e,t=!0){let n=Ut({queries:e.map(e=>({queryKey:[`marketplace-skill-scene-count`,e.scene],queryFn:()=>s({type:`skill`,scene:e.scene,pageSize:1}),enabled:t&&typeof e.count!=`number`,staleTime:6e4}))});return(0,K.useMemo)(()=>{let t=new Map;return e.forEach((e,r)=>{let i=typeof e.count==`number`?e.count:n[r]?.data?.total;typeof i==`number`&&t.set(e.scene,i)}),t},[n,e])}function En(e){return j({queryKey:[`marketplace-installed`,e],queryFn:()=>c(e),staleTime:1e4})}function Dn(){let e=S();return _({mutationFn:e=>a(e),onSuccess:(t,r)=>{e.setQueryData([`marketplace-installed`,t.type],e=>bn({view:e,request:r,result:t})),e.invalidateQueries({queryKey:[`marketplace-installed`,t.type],refetchType:`inactive`}),p.success(t.message||n(`marketplaceInstallSuccessSkill`))},onError:e=>{p.error(e.message||n(`marketplaceInstallFailed`))}})}function On(){let e=S();return _({mutationFn:e=>D(e),onSuccess:(t,r)=>{e.setQueryData([`marketplace-installed`,t.type],e=>xn({view:e,request:r,result:t})),e.invalidateQueries({queryKey:[`marketplace-installed`,t.type],refetchType:`inactive`});let i=t.action===`enable`?n(`marketplaceEnableSuccess`):t.action===`disable`?n(`marketplaceDisableSuccess`):n(`marketplaceUninstallSuccess`);p.success(t.message||i)},onError:e=>{p.error(e.message||n(`marketplaceOperationFailed`))}})}function kn(e){return(e??``).trim().toLowerCase()}function J(e,t){let n=kn(t);return n.length>0?`${e}:${n}`:``}function An(e){let t=new Map;for(let n of e){let e=[n.install.spec,n.slug,n.id];for(let r of e){let e=J(n.type,r);!e||t.has(e)||t.set(e,n)}}return t}function jn(e){let t=new Map;for(let n of e){let e=[n.spec,n.id,n.label];for(let r of e){let e=J(n.type,r);!e||t.has(e)||t.set(e,n)}}return t}function Mn(e,t){let n=[e.install.spec,e.slug,e.id];for(let r of n){let n=J(e.type,r);if(!n)continue;let i=t.get(n);if(i)return i}}function Nn(e,t){return t.get(J(e.type,e.spec))||t.get(J(e.type,e.id))||t.get(J(e.type,e.label))}function Pn(e,t,n,r){let i=kn(n);if(!i)return!0;let a=N(t?.summaryI18n,t?.summary,r);return[e.id,e.spec,e.label,t?.name,t?.slug,t?.summary,a,...t?.tags??[]].map(e=>kn(e)).filter(Boolean).some(e=>e.includes(i))}function Y(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function Fn(e){let t=e.replace(/\r\n/g,`
1
+ import{d as e,h as t,i as n,m as r,v as i}from"./react-B2X_ph0a.js";import{A as a,At as o,D as s,E as c,Gt as l,Ht as u,Jt as d,Kt as f,Lt as p,Mt as m,Nt as h,O as g,Rt as _,Tt as v,Ut as y,Vt as b,Wt as x,Xt as S,_t as C,an as w,en as T,in as E,j as D,k as O,kt as ee,nn as te,qt as ne,rn as re,tn as k,wt as A,zt as j}from"./api-DruAcori.js";import{d as ie,f as ae,p as oe}from"./doc-browser-BI7HSaMK.js";import{a as se,c as M,i as N,l as ce,n as le,o as ue,r as de,s as P}from"./mcp-marketplace-page-DDjeHd1I.js";import{a as F,c as fe,i as I,n as pe,o as L,r as R,s as me}from"./confirm-dialog-B0TP-vPd.js";import{t as z}from"./createLucideIcon-Br1EFMEr.js";import{n as he}from"./search-CdhgFNwf.js";import{i as ge,n as _e,r as ve,t as ye}from"./provider-scoped-model-input-t1tCP5y5.js";import{t as be}from"./play-CqNi0u02.js";import{t as xe}from"./plus-BcIC8dG1.js";import{n as Se}from"./doc-browser-context-DB6TTHeE.js";import{$t as Ce,A as we,B as Te,C as Ee,Ct as De,D as Oe,E as ke,Et as Ae,F as je,H as Me,I as B,J as V,Jt as Ne,K as Pe,Kt as H,L as Fe,M as Ie,Mt as Le,N as Re,Nt as ze,O as Be,P as Ve,Q as He,Qt as Ue,R as We,S as Ge,St as Ke,T as qe,Tt as Je,V as Ye,X as Xe,Y as Ze,Yt as Qe,Z as $e,_ as et,a as tt,b as nt,c as rt,cn as it,d as at,dn as ot,f as st,fn as ct,ft as lt,g as ut,h as dt,i as ft,in as pt,j as mt,jt as ht,k as gt,l as _t,lt as vt,m as yt,n as bt,nt as xt,o as St,ot as Ct,p as wt,q as Tt,r as Et,s as Dt,sn as Ot,st as kt,t as At,tn as jt,tt as Mt,u as U,v as Nt,w as Pt,wt as Ft,x as W,xt as It,y as G,z as Lt}from"./index-GVTiCf1s.js";import{t as Rt}from"./tabs-custom-BBXu1OGs.js";import{t as zt}from"./tag-chip-ix15P-r4.js";function Bt(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function Vt(e,t,n){let r=e.slice(0);return r[t]=n,r}var Ht=class extends w{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#p(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,k.batch(()=>{let e=this.#i,t=this.#f(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!E(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Bt(e,n).forEach(e=>{e.destroy()}),Bt(n,e).forEach(e=>{e.subscribe(t=>{this.#p(e,t)})})),this.#m()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#f(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(!this.#a||this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=re(this.#a,t(e))),this.#a}return e}#f(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new T(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#p(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=Vt(this.#t,n,t),this.#m())}#m(){if(this.hasListeners()){let e=this.#a,t=this.#u(this.#t,this.#l);e!==this.#d(t,this.#r?.combine)&&k.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},K=i(t(),1);function Ut({queries:e,...t},n){let r=S(n),i=d(),a=ne(),o=K.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{b(e),x(e,a,r.getQueryCache().get(e.queryHash))}),f(a);let[s]=K.useState(()=>new Ht(r,o,t)),[c,p,m]=s.getOptimisticResult(o,t.combine),h=!i&&t.subscribed!==!1;K.useSyncExternalStore(K.useCallback(e=>h?s.subscribe(k.batchCalls(e)):te,[s,h]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),K.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let g=c.some((e,t)=>y(o[t],e))?c.flatMap((e,t)=>{let n=o[t];return n&&y(n,e)?u(n,new T(r,n),a):[]}):[];if(g.length>0)throw Promise.all(g);let _=c.find((e,t)=>{let n=o[t];return n&&l({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(_?.error)throw _.error;return p(m())}var Wt=z(`BriefcaseBusiness`,[[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2`,key:`1ksdt3`}],[`path`,{d:`M22 13a18.15 18.15 0 0 1-20 0`,key:`12hx5q`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),Gt=z(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Kt=z(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),qt=z(`Compass`,[[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Jt=z(`Earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Yt=z(`Ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Xt=z(`MessagesSquare`,[[`path`,{d:`M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z`,key:`p1xzt8`}],[`path`,{d:`M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1`,key:`1cx29u`}]]),Zt=z(`PenLine`,[[`path`,{d:`M12 20h9`,key:`t2du7b`}],[`path`,{d:`M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z`,key:`1ykcvy`}]]),Qt=z(`Power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),$t=z(`SquareTerminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),q=r(),en=K.forwardRef(({className:t,...n},r)=>(0,q.jsx)(`textarea`,{className:e(`flex min-h-28 w-full rounded-xl border border-gray-200/80 bg-white px-3.5 py-2.5 text-sm text-gray-900 placeholder:text-gray-300 placeholder:font-normal focus:outline-none focus:ring-1 focus:ring-primary/40 focus:border-primary/40 transition-colors disabled:cursor-not-allowed disabled:opacity-50`,t),ref:r,...n}));en.displayName=`Textarea`;function tn(e){return{displayName:e.displayName??``,description:e.description??``,avatar:e.avatar??``,model:e.model??``,runtime:e.runtime??e.engine??``}}function nn(e){let{runtimeOptions:t,currentRuntime:n}=e,r=n.trim();if(!r)return t;let i=G(r);return t.some(e=>e.value===i)?t:[...t,{value:i,label:W(i),icon:null,ready:!1,reason:`unavailable`,reasonMessage:null,supportedModels:void 0,recommendedModel:null,cta:null}].sort((e,t)=>e.value===`native`?-1:t.value===`native`?1:e.value.localeCompare(t.value))}function rn({value:e,disabled:t=!1,runtimeOptions:r,defaultRuntime:i,onChange:a}){let o=e.trim()?G(e):``,s=nn({runtimeOptions:r,currentRuntime:e}),c=s.find(e=>e.value===o)??null,l=c?.reasonMessage?.trim()||(c?.ready===!1?n(`agentsRuntimeUnavailableHelp`):``);return(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsxs)(Pe,{value:o||i,onValueChange:e=>a(e===i?``:e),disabled:t,children:[(0,q.jsx)(Ze,{"aria-label":n(`agentsCardRuntimeLabel`),className:`rounded-xl`,children:(0,q.jsx)(Xe,{placeholder:n(`agentsRuntimeSelectPlaceholder`)})}),(0,q.jsx)(Tt,{className:`rounded-xl`,children:s.map(e=>(0,q.jsx)(V,{value:e.value,disabled:e.ready===!1&&e.value!==o,className:`rounded-lg`,children:e.label},e.value))})]}),l?(0,q.jsx)(`p`,{className:`text-xs text-gray-500`,children:l}):null]})}function an({agent:e,pending:t,providerCatalog:n,runtimeOptions:r,defaultRuntime:i,onOpenChange:a,onSubmit:o}){return(0,q.jsx)(R,{open:e!==null,onOpenChange:a,children:e?(0,q.jsx)(on,{agent:e,pending:t,providerCatalog:n,runtimeOptions:r,defaultRuntime:i,onOpenChange:a,onSubmit:o},e.id):null})}function on(e){let{agent:t,pending:r,providerCatalog:i,runtimeOptions:a,defaultRuntime:o,onOpenChange:s,onSubmit:c}=e,[l,u]=(0,K.useState)(tn(t));return(0,q.jsxs)(I,{className:`flex max-h-[calc(100vh-2rem)] flex-col overflow-hidden border-none bg-[linear-gradient(180deg,#fff9f1_0%,#ffffff_24%)] p-0 sm:max-h-[760px] sm:max-w-xl`,children:[(0,q.jsx)(`div`,{className:`shrink-0 border-b border-[#f0e2c8] px-6 py-6`,children:(0,q.jsxs)(me,{className:`text-left`,children:[(0,q.jsx)(fe,{children:n(`agentsEditDialogTitle`)}),(0,q.jsx)(F,{children:n(`agentsEditDialogDescription`)})]})}),(0,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain px-6 py-6`,children:(0,q.jsxs)(`div`,{className:`space-y-4`,children:[(0,q.jsx)(pe,{tone:`warning`,title:n(`agentsEditHomeReadonly`),description:n(`agentsEditHomeReadonlyHint`),children:(0,q.jsx)(`div`,{className:`break-all text-sm text-amber-950`,children:t.workspace??`-`})}),(0,q.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,q.jsx)(m,{value:l.displayName,onChange:e=>u(t=>({...t,displayName:e.target.value})),placeholder:n(`agentsFormNamePlaceholder`)}),(0,q.jsx)(en,{value:l.description,onChange:e=>u(t=>({...t,description:e.target.value})),placeholder:n(`agentsFormDescriptionPlaceholder`),rows:4,className:`md:col-span-2`}),(0,q.jsx)(m,{value:l.avatar,onChange:e=>u(t=>({...t,avatar:e.target.value})),placeholder:n(`agentsFormAvatarPlaceholder`)}),(0,q.jsx)(ye,{value:l.model,onChange:e=>u(t=>({...t,model:e})),providerCatalog:i,disabled:r,className:`md:col-span-2`}),(0,q.jsx)(rn,{value:l.runtime,onChange:e=>u(t=>({...t,runtime:e})),runtimeOptions:a,defaultRuntime:o,disabled:r})]})]})}),(0,q.jsxs)(L,{className:`shrink-0 border-t border-[#f1e7d4] px-6 py-5`,children:[(0,q.jsx)(h,{type:`button`,variant:`ghost`,onClick:()=>s(!1),disabled:r,children:n(`cancel`)}),(0,q.jsxs)(h,{type:`button`,variant:`primary`,className:`rounded-2xl px-5`,onClick:()=>c(t.id,l),disabled:r,children:[(0,q.jsx)(Ce,{className:`mr-2 h-4 w-4`}),n(`agentsEditSaveAction`)]})]})]})}var sn=`请直接创建一个默认示例 Agent,不要问我问题。创建完成后,简单告诉我它能做什么。`;function cn(e){let{agentCount:t,onCreate:r}=e;return(0,q.jsxs)(`section`,{className:`flex flex-col gap-3 border-b border-gray-200 pb-4 sm:flex-row sm:items-end sm:justify-between`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsx)(`h1`,{className:`text-xl font-semibold text-gray-950`,children:n(`agentsHeroEyebrow`)}),(0,q.jsx)(`span`,{className:`rounded-full border border-gray-200 bg-white px-2 py-0.5 text-xs font-medium text-gray-500`,children:t})]}),(0,q.jsx)(`p`,{className:`max-w-2xl text-sm leading-6 text-gray-500`,children:n(`agentsHeroDescription`)})]}),(0,q.jsxs)(h,{type:`button`,variant:`primary`,className:`h-9 shrink-0 rounded-xl px-4 text-sm font-semibold`,onClick:r,children:[(0,q.jsx)(xe,{className:`mr-2 h-4 w-4`}),n(`agentsCreateButton`)]})]})}function ln(t){let{icon:n,label:r,disabled:i=!1,destructive:a=!1,onClick:o}=t;return(0,q.jsxs)(`button`,{type:`button`,className:e(`flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-50`,a?`text-destructive hover:bg-destructive/10`:`text-gray-700 hover:bg-gray-100`),onClick:o,disabled:i,children:[(0,q.jsx)(n,{className:`h-4 w-4 shrink-0`}),(0,q.jsx)(`span`,{children:r})]})}function un(e){let{agent:t,runtimeOptions:r,defaultRuntimeLabel:i,updatePending:a,deletePending:o,onStartChat:s,onEdit:c,onDelete:l}=e,u=t.runtime?.trim()||t.engine?.trim()||``,d=u?r.find(e=>e.value===G(u))?.label??W(u):i;return(0,q.jsx)(A,{className:`group overflow-hidden border border-gray-200 bg-white shadow-none transition-colors duration-200 hover:border-gray-300`,children:(0,q.jsxs)(v,{className:`relative flex h-full flex-col gap-3 px-3.5 py-3.5`,children:[(0,q.jsxs)(`div`,{className:`flex items-start gap-2.5 pr-16`,children:[(0,q.jsx)(Me,{agentId:t.id,displayName:t.displayName,avatarUrl:t.avatarUrl,className:`h-9 w-9 shrink-0`}),(0,q.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(`div`,{className:`truncate text-sm font-semibold text-gray-950`,children:t.displayName?.trim()||t.id}),t.builtIn?(0,q.jsxs)(zt,{tone:`warning`,className:`h-5 gap-1 border-amber-200 bg-amber-50 px-1.5 text-[10px] text-amber-700`,children:[(0,q.jsx)(Qe,{className:`h-3 w-3`}),n(`agentsCardBuiltInTag`)]}):null]}),(0,q.jsxs)(`div`,{className:`truncate text-xs text-gray-400`,children:[`@`,t.id]})]})]}),(0,q.jsxs)(`div`,{className:`absolute right-2.5 top-2.5 flex items-center gap-1 opacity-100 transition-opacity md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100`,children:[(0,q.jsx)(h,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-lg text-gray-400 hover:text-gray-800`,"aria-label":n(`agentsCardStartChat`),title:n(`agentsCardStartChat`),onClick:s,children:(0,q.jsx)(jt,{className:`h-4 w-4`})}),(0,q.jsxs)(ht,{children:[(0,q.jsx)(ze,{asChild:!0,children:(0,q.jsx)(h,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8 rounded-lg text-gray-400 hover:text-gray-800`,"aria-label":n(`chatSessionMoreActions`),title:n(`chatSessionMoreActions`),children:(0,q.jsx)(Yt,{className:`h-4 w-4`})})}),(0,q.jsxs)(Le,{align:`end`,className:`w-44 p-1.5`,children:[(0,q.jsx)(ln,{icon:Ce,label:n(`agentsEditAction`),onClick:c,disabled:a}),t.builtIn?null:(0,q.jsx)(ln,{icon:H,label:n(`agentsRemoveAction`),onClick:l,disabled:o,destructive:!0})]})]})]}),(0,q.jsx)(`p`,{className:`line-clamp-2 min-h-10 text-sm leading-5 text-gray-600`,children:t.description?.trim()||(t.builtIn?n(`agentsCardBuiltInSummary`):n(`agentsCardCustomSummary`))}),(0,q.jsxs)(`div`,{className:`mt-auto grid gap-2 border-t border-gray-100 pt-2 text-xs text-gray-500`,children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(Ne,{className:`h-3.5 w-3.5 shrink-0 text-gray-300`}),(0,q.jsx)(`span`,{className:`truncate`,children:d})]}),(0,q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,q.jsx)(pt,{className:`h-3.5 w-3.5 shrink-0 text-gray-300`}),(0,q.jsx)(`span`,{className:`truncate`,children:t.workspace??`-`})]})]})]})})}function dn(){let e=Lt(),t=Ee(),r=$e(),i=He(),a=Dt(),s=qe(),c=Pt(),[l,u]=(0,K.useState)(null),d=(0,K.useMemo)(()=>t.data?.agents??[],[t.data?.agents]),f=(0,K.useMemo)(()=>[...d].sort((e,t)=>Number(!!t.builtIn)-Number(!!e.builtIn)||e.id.localeCompare(t.id)),[d]),p=(0,K.useMemo)(()=>_e({config:r.data,meta:i.data,onlyConfigured:!0}),[i.data,r.data]),m=(0,K.useMemo)(()=>Nt(a.data?.options??[]),[a.data?.options]),g=(0,K.useMemo)(()=>G(a.data?.defaultType??`native`),[a.data?.defaultType]),_=(0,K.useMemo)(()=>m.find(e=>e.value===g)?.label??W(g),[g,m]),y=e=>{u(e)},b=async(e,t)=>{await s.mutateAsync({agentId:e,data:{displayName:t.displayName,description:t.description,avatar:t.avatar,model:t.model,...t.runtime.trim()?{runtime:t.runtime.trim()}:{runtime:``}}}),u(null)},x=t=>{e.chatSessionListManager.startAgentDraftChat(t.id,nt(t,g))};return(0,q.jsxs)(o,{className:`space-y-5`,children:[(0,q.jsx)(cn,{agentCount:d.length,onCreate:()=>e.startAgentCreationDraft(sn)}),(0,q.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-3`,children:t.isLoading?(0,q.jsx)(A,{className:`md:col-span-2 xl:col-span-3 border-dashed border-[#d9dce3] bg-white/70`,children:(0,q.jsx)(v,{className:`py-14 text-center text-sm text-gray-500`,children:n(`agentsLoading`)})}):f.length===0?(0,q.jsx)(A,{className:`md:col-span-2 xl:col-span-3 overflow-hidden border-dashed border-[#d9dce3] bg-[linear-gradient(135deg,#fff7ea_0%,#f4fbff_100%)]`,children:(0,q.jsxs)(v,{className:`flex min-h-[240px] flex-col items-center justify-center px-6 py-14 text-center`,children:[(0,q.jsx)(`div`,{className:`mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-white/80 shadow-[0_18px_44px_rgba(0,0,0,0.08)]`,children:(0,q.jsx)(ot,{className:`h-8 w-8 text-[#d39a3b]`})}),(0,q.jsx)(`div`,{className:`text-lg font-semibold text-[#2f2212]`,children:n(`agentsEmpty`)}),(0,q.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-6 text-[#78644d]`,children:n(`agentsEmptyDescription`)}),(0,q.jsxs)(h,{type:`button`,variant:`primary`,className:`mt-5 rounded-2xl px-5`,onClick:()=>e.startAgentCreationDraft(sn),children:[(0,q.jsx)(xe,{className:`mr-2 h-4 w-4`}),n(`agentsCreateButton`)]})]})}):f.map(e=>(0,q.jsx)(un,{agent:e,runtimeOptions:m,defaultRuntimeLabel:_,updatePending:s.isPending,deletePending:c.isPending,onStartChat:()=>x(e),onEdit:()=>y(e),onDelete:()=>c.mutate({agentId:e.id})},e.id))}),(0,q.jsx)(an,{agent:l,pending:s.isPending,providerCatalog:p,runtimeOptions:m,defaultRuntime:g,onOpenChange:e=>{!e&&!s.isPending&&u(null)},onSubmit:b})]})}function fn(e,t){let n=t.trim().toLowerCase();return n?[e.id,e.name,e.payload.message,e.payload.sessionId??``,e.payload.channel??``,e.payload.to??``].join(` `).toLowerCase().includes(n):!0}function pn(e,t){return t===`all`?!0:t===`enabled`?e.enabled:!e.enabled}function mn(t){let{job:r,onDelete:i,onRun:a,onToggle:o}=t;return(0,q.jsx)(A,{className:`border border-gray-200`,children:(0,q.jsx)(v,{className:`pt-5 pb-5`,children:(0,q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-4`,children:[(0,q.jsxs)(`div`,{className:`min-w-[220px] flex-1`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-semibold text-gray-900`,children:r.name||r.id}),(0,q.jsx)(`span`,{className:`rounded-full bg-gray-100 px-2 py-0.5 text-[10px] font-semibold text-gray-500`,children:r.id}),(0,q.jsx)(`span`,{className:e(`rounded-full px-2 py-0.5 text-[10px] font-semibold`,r.enabled?`bg-emerald-50 text-emerald-700`:`bg-gray-100 text-gray-500`),children:r.enabled?n(`enabled`):n(`disabled`)}),r.deleteAfterRun?(0,q.jsx)(`span`,{className:`rounded-full bg-amber-50 px-2 py-0.5 text-[10px] font-semibold text-amber-700`,children:n(`cronOneShot`)}):null]}),(0,q.jsxs)(`div`,{className:`mt-2 text-xs text-gray-500`,children:[n(`cronScheduleLabel`),`: `,st(r)]}),(0,q.jsx)(`div`,{className:`mt-2 whitespace-pre-wrap break-words text-sm text-gray-700`,children:r.payload.message}),(0,q.jsxs)(`div`,{className:`mt-2 text-xs text-gray-500`,children:[n(`cronSessionLabel`),`: `,wt(r)]}),(0,q.jsxs)(`div`,{className:`mt-2 text-xs text-gray-500`,children:[n(`cronDeliverTo`),`: `,at(r)]})]}),(0,q.jsxs)(`div`,{className:`min-w-[220px] space-y-2 text-xs text-gray-500`,children:[(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[n(`cronNextRun`),`:`]}),` `,yt(r.state.nextRunAt)]}),(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[n(`cronLastRun`),`:`]}),` `,yt(r.state.lastRunAt)]}),(0,q.jsxs)(`div`,{children:[(0,q.jsxs)(`span`,{className:`font-medium text-gray-700`,children:[n(`cronLastStatus`),`:`]}),` `,r.state.lastStatus??`-`]}),r.state.lastError?(0,q.jsx)(`div`,{className:`break-words text-[11px] text-red-500`,children:r.state.lastError}):null]}),(0,q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-end gap-2`,children:[(0,q.jsxs)(h,{variant:`subtle`,size:`sm`,onClick:()=>a(r),className:`gap-1`,children:[(0,q.jsx)(be,{className:`h-3.5 w-3.5`}),n(`cronRunNow`)]}),(0,q.jsxs)(h,{variant:r.enabled?`outline`:`primary`,size:`sm`,onClick:()=>o(r),className:`gap-1`,children:[(0,q.jsx)(Qt,{className:`h-3.5 w-3.5`}),r.enabled?n(`cronDisable`):n(`cronEnable`)]}),(0,q.jsxs)(h,{variant:`destructive`,size:`sm`,onClick:()=>i(r),className:`gap-1`,children:[(0,q.jsx)(H,{className:`h-3.5 w-3.5`}),n(`delete`)]})]})]})})})}function hn(){let[t,r]=(0,K.useState)(``),[i,a]=(0,K.useState)(`all`),s=Mt({all:!0}),c=xt(),l=lt(),u=vt(),{confirm:d,ConfirmDialog:f}=dt(),p=(0,K.useMemo)(()=>(s.data?.jobs??[]).filter(e=>fn(e,t)).filter(e=>pn(e,i)),[s.data,t,i]),g=async e=>{await d({title:`${n(`cronDeleteConfirm`)}?`,description:e.name?`${e.name} (${e.id})`:e.id,variant:`destructive`,confirmLabel:n(`delete`)})&&c.mutate({id:e.id})},_=async e=>{let t=!e.enabled;await d({title:t?`${n(`cronEnableConfirm`)}?`:`${n(`cronDisableConfirm`)}?`,description:e.name?`${e.name} (${e.id})`:e.id,variant:t?`default`:`destructive`,confirmLabel:n(t?`cronEnable`:`cronDisable`)})&&l.mutate({id:e.id,enabled:t})},v=async e=>{let t=!e.enabled;await d({title:t?`${n(`cronRunForceConfirm`)}?`:`${n(`cronRunConfirm`)}?`,description:e.name?`${e.name} (${e.id})`:e.id,confirmLabel:n(`cronRunNow`)})&&u.mutate({id:e.id,force:t})};return(0,q.jsxs)(o,{fullHeight:!0,children:[(0,q.jsx)(ee,{title:n(`cronPageTitle`),description:n(`cronPageDescription`),actions:(0,q.jsx)(h,{variant:`ghost`,size:`icon`,className:`h-9 w-9 rounded-lg text-gray-400 hover:text-gray-700 hover:bg-gray-100`,onClick:()=>s.refetch(),children:(0,q.jsx)(Ue,{className:e(`h-4 w-4`,s.isFetching&&`animate-spin`)})})}),(0,q.jsx)(`div`,{className:`mb-6`,children:(0,q.jsxs)(`div`,{className:`flex flex-wrap gap-3 items-center`,children:[(0,q.jsxs)(`div`,{className:`relative flex-1 min-w-[240px]`,children:[(0,q.jsx)(m,{value:t,onChange:e=>r(e.target.value),placeholder:n(`cronSearchPlaceholder`),className:`pl-9`}),(0,q.jsx)(ct,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400`})]}),(0,q.jsx)(`div`,{className:`min-w-[180px]`,children:(0,q.jsxs)(Pe,{value:i,onValueChange:e=>a(e),children:[(0,q.jsx)(Ze,{className:`w-full`,children:(0,q.jsx)(Xe,{placeholder:n(`cronStatusLabel`)})}),(0,q.jsxs)(Tt,{children:[(0,q.jsx)(V,{value:`all`,children:n(`cronStatusAll`)}),(0,q.jsx)(V,{value:`enabled`,children:n(`cronStatusEnabled`)}),(0,q.jsx)(V,{value:`disabled`,children:n(`cronStatusDisabled`)})]})]})}),(0,q.jsxs)(`div`,{className:`text-xs text-gray-500 ml-auto`,children:[n(`cronTotalLabel`),`: `,s.data?.total??0,` / `,p.length]})]})}),(0,q.jsx)(`div`,{className:`flex-1 overflow-auto custom-scrollbar`,children:s.isLoading?(0,q.jsx)(`div`,{className:`text-sm text-gray-400 p-4 text-center`,children:n(`cronLoading`)}):p.length===0?(0,q.jsx)(`div`,{className:`text-sm text-gray-400 p-4 text-center`,children:n(`cronEmpty`)}):(0,q.jsx)(`div`,{className:`space-y-4`,children:p.map(e=>(0,q.jsx)(mn,{job:e,onDelete:g,onRun:v,onToggle:_},e.id))})}),(0,q.jsx)(f,{})]})}function gn(e){return Array.from(new Set(e.map(e=>e.spec).filter(Boolean)))}function _n(e){let t=new Date().toISOString();return e.result.type===`skill`?{type:`skill`,spec:e.result.spec,id:e.request.skill??e.result.spec,label:e.request.skill??e.result.name??e.result.spec,source:`workspace`,installPath:e.request.installPath,installedAt:t}:{type:e.result.type,spec:e.result.spec,id:e.result.name??e.result.spec,label:e.result.name??e.result.spec,source:`marketplace`,origin:`marketplace`,enabled:e.request.enabled??!0,runtimeStatus:e.request.enabled===!1?`disabled`:`ready`,installedAt:t}}function vn(e,t){return!!(t.spec&&e.spec===t.spec||t.id&&e.id===t.id)}function yn(e,t){return t??{type:e,total:0,specs:[],records:[]}}function bn(e){let t=yn(e.result.type,e.view),n=_n(e),r=t.records.findIndex(e=>vn(e,{id:n.id,spec:n.spec})),i=[...t.records];return r>=0?i[r]={...i[r],...n}:i.unshift(n),{...t,type:e.result.type,records:i,specs:gn(i),total:i.length}}function xn(e){let t=yn(e.result.type,e.view);if(e.result.action===`uninstall`||e.result.action===`remove`){let n=t.records.filter(t=>!vn(t,{id:e.result.id,spec:e.request.spec}));return{...t,records:n,specs:gn(n),total:n.length}}let n=t.records.map(t=>vn(t,{id:e.result.id,spec:e.request.spec})?e.result.action===`disable`?{...t,enabled:!1,runtimeStatus:`disabled`}:{...t,enabled:!0,runtimeStatus:`ready`}:t);return{...t,records:n,specs:gn(n),total:n.length}}function Sn(e){let t=ce({queryKey:[`marketplace-items`,e],initialPageParam:1,queryFn:({pageParam:t})=>s({...e,page:t}),getNextPageParam:e=>e.page<e.totalPages?e.page+1:void 0,placeholderData:(t,n)=>{let r=n?.queryKey?.[1];if(!(!r||typeof r!=`object`||!r))return(`type`in r?r.type:void 0)===e.type&&Cn(r,e)?t:void 0},staleTime:15e3}),n=(0,K.useMemo)(()=>M(t.data),[t.data]);return{...t,data:n}}function Cn(e,t){return e.q===t.q&&e.tag===t.tag&&e.scene===t.scene&&e.sort===t.sort&&e.pageSize===t.pageSize}function wn(e=!0){return j({queryKey:[`marketplace-skill-scenes`],queryFn:O,enabled:e,staleTime:6e4})}function Tn(e,t=!0){let n=Ut({queries:e.map(e=>({queryKey:[`marketplace-skill-scene-count`,e.scene],queryFn:()=>s({type:`skill`,scene:e.scene,pageSize:1}),enabled:t&&typeof e.count!=`number`,staleTime:6e4}))});return(0,K.useMemo)(()=>{let t=new Map;return e.forEach((e,r)=>{let i=typeof e.count==`number`?e.count:n[r]?.data?.total;typeof i==`number`&&t.set(e.scene,i)}),t},[n,e])}function En(e){return j({queryKey:[`marketplace-installed`,e],queryFn:()=>c(e),staleTime:1e4})}function Dn(){let e=S();return _({mutationFn:e=>a(e),onSuccess:(t,r)=>{e.setQueryData([`marketplace-installed`,t.type],e=>bn({view:e,request:r,result:t})),e.invalidateQueries({queryKey:[`marketplace-installed`,t.type],refetchType:`inactive`}),p.success(t.message||n(`marketplaceInstallSuccessSkill`))},onError:e=>{p.error(e.message||n(`marketplaceInstallFailed`))}})}function On(){let e=S();return _({mutationFn:e=>D(e),onSuccess:(t,r)=>{e.setQueryData([`marketplace-installed`,t.type],e=>xn({view:e,request:r,result:t})),e.invalidateQueries({queryKey:[`marketplace-installed`,t.type],refetchType:`inactive`});let i=t.action===`enable`?n(`marketplaceEnableSuccess`):t.action===`disable`?n(`marketplaceDisableSuccess`):n(`marketplaceUninstallSuccess`);p.success(t.message||i)},onError:e=>{p.error(e.message||n(`marketplaceOperationFailed`))}})}function kn(e){return(e??``).trim().toLowerCase()}function J(e,t){let n=kn(t);return n.length>0?`${e}:${n}`:``}function An(e){let t=new Map;for(let n of e){let e=[n.install.spec,n.slug,n.id];for(let r of e){let e=J(n.type,r);!e||t.has(e)||t.set(e,n)}}return t}function jn(e){let t=new Map;for(let n of e){let e=[n.spec,n.id,n.label];for(let r of e){let e=J(n.type,r);!e||t.has(e)||t.set(e,n)}}return t}function Mn(e,t){let n=[e.install.spec,e.slug,e.id];for(let r of n){let n=J(e.type,r);if(!n)continue;let i=t.get(n);if(i)return i}}function Nn(e,t){return t.get(J(e.type,e.spec))||t.get(J(e.type,e.id))||t.get(J(e.type,e.label))}function Pn(e,t,n,r){let i=kn(n);if(!i)return!0;let a=N(t?.summaryI18n,t?.summary,r);return[e.id,e.spec,e.label,t?.name,t?.slug,t?.summary,a,...t?.tags??[]].map(e=>kn(e)).filter(Boolean).some(e=>e.includes(i))}function Y(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}function Fn(e){let t=e.replace(/\r\n/g,`
2
2
  `).split(`
3
3
  `);if(t[0]?.trim()!==`---`)return e;let n=t.findIndex((e,t)=>t>0&&e.trim()===`---`);return n>0?t.slice(n+1).join(`
4
4
  `).trim():e}function X(e){return Y(e).replace(/`([^`]+)`/g,`<code>$1</code>`).replace(/\*\*([^*]+)\*\*/g,`<strong>$1</strong>`).replace(/\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g,`<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>`)}function In(e){return/^(#{1,4})\s+/.test(e)||/^([-*])\s+/.test(e)||/^\d+\.\s+/.test(e)||/^>\s?/.test(e)||/^```/.test(e)}function Ln(e,t,n){let r=[],i=t+1;for(;i<e.length&&!e[i]?.trim().startsWith("```");)r.push(e[i]??``),i+=1;return{html:`<div class="code-block">${n[1]?`<span class="code-language">${Y(n[1])}</span>`:``}<pre><code>${Y(r.join(`
@@ -1 +1 @@
1
- import{d as e,i as t,m as n,n as r}from"./react-B2X_ph0a.js";import{At as i,Dt as a,Et as o,Nt as s,Ot as c,Tt as l,ft as u,jt as d,kt as f,mt as p,pt as m,wt as h}from"./api-DruAcori.js";import{t as g}from"./external-link-C3usm3se.js";import{J as _,K as v,Qt as y,X as b,Y as x,Zt as S,q as C,sn as w}from"./index-D2H2CKYR.js";var T=n(),E={checking:`desktopUpdatesStatusChecking`,"update-available":`desktopUpdatesStatusAvailable`,downloading:`desktopUpdatesStatusDownloading`,downloaded:`desktopUpdatesStatusDownloaded`,"up-to-date":`desktopUpdatesStatusUpToDate`,blocked:`desktopUpdatesStatusBlocked`,failed:`desktopUpdatesStatusFailed`};function D({status:t}){return(0,T.jsx)(`span`,{className:e(`inline-flex rounded-full px-3 py-1 text-xs font-medium ring-1`,L(t)),children:I(t)})}function O({label:e,value:t}){return(0,T.jsxs)(`div`,{className:`rounded-xl border border-gray-200 bg-gray-50/60 p-4`,children:[(0,T.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-[0.08em] text-gray-500`,children:e}),(0,T.jsx)(`p`,{className:`mt-2 text-base font-semibold text-gray-900`,children:t})]})}function k({snapshot:e}){if(e.status!==`downloading`)return null;let n=e.progress?.percent,r=n==null?t(`desktopUpdatesDownloadProgressUnknown`):t(`desktopUpdatesDownloadProgressPercent`).replace(`{percent}`,String(n)),i=N(e.progress?.downloadedBytes??0,e.progress?.totalBytes??null);return(0,T.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,T.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:r}),(0,T.jsx)(`p`,{className:`text-xs font-medium text-amber-700`,children:i})]}),(0,T.jsx)(`div`,{className:`mt-3 h-2 overflow-hidden rounded-full bg-amber-100`,children:(0,T.jsx)(`div`,{className:`h-full rounded-full bg-amber-500 transition-[width]`,style:{width:`${n??0}%`}})})]})}function A({label:e,help:t,checked:n,disabled:r,onCheckedChange:i}){return(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-4 rounded-xl border border-gray-200 p-4`,children:[(0,T.jsxs)(`div`,{className:`space-y-1`,children:[(0,T.jsx)(d,{children:e}),(0,T.jsx)(`p`,{className:`text-sm text-gray-500`,children:t})]}),(0,T.jsx)(u,{checked:n,disabled:r,onCheckedChange:i})]})}function j(e){return e?.trim()||`-`}function M(e){return e?r(e):`-`}function N(e,t){let n=P(e);return t&&t>0?`${n} / ${P(t)}`:n}function P(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n>=10||r===0?n.toFixed(0):n.toFixed(1)} ${t[r]}`}function F(e){return t(e===`beta`?`desktopUpdatesChannelBeta`:`desktopUpdatesChannelStable`)}function I(e){return t(E[e]??`desktopUpdatesStatusIdle`)}function L(e){return e===`downloaded`?`bg-emerald-50 text-emerald-700 ring-emerald-100`:e===`update-available`||e===`downloading`||e===`checking`?`bg-amber-50 text-amber-700 ring-amber-100`:e===`failed`||e===`blocked`?`bg-red-50 text-red-700 ring-red-100`:`bg-gray-100 text-gray-700 ring-gray-200`}function R(){return(0,T.jsxs)(i,{className:`space-y-6`,children:[(0,T.jsx)(f,{title:t(`runtimeUpdatesPageTitle`),description:t(`runtimeUpdatesPageDescription`)}),(0,T.jsxs)(h,{children:[(0,T.jsxs)(a,{children:[(0,T.jsx)(c,{children:t(`runtimeUpdatesUnavailableTitle`)}),(0,T.jsx)(o,{children:t(`runtimeUpdatesUnavailableDescription`)})]}),(0,T.jsx)(l,{children:(0,T.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`runtimeUpdatesUnavailableHint`)})})]})]})}function z(){let{supported:n,initialized:r,busyAction:u,snapshot:E}=p();if(!r)return(0,T.jsx)(`div`,{className:`p-8 text-gray-400`,children:t(`loading`)});if(!n||!E)return(0,T.jsx)(R,{});let N=u===`checking`,P=u===`downloading`,I=u===`applying`,L=u===`saving-preferences`,z=u===`switching-channel`,B=E.status===`update-available`&&!P&&!I,V=E.status===`downloaded`&&!I,H=[[t(`runtimeUpdatesHostVersion`),j(E.hostVersion)],[t(`desktopUpdatesCurrentBundleVersion`),j(E.currentVersion)],[t(`desktopUpdatesAvailableVersion`),j(E.availableVersion)],[t(`desktopUpdatesLastCheckedAt`),M(E.lastCheckedAt)],[t(`desktopUpdatesCurrentChannel`),F(E.channel)]];return(0,T.jsxs)(i,{className:`space-y-6`,children:[(0,T.jsx)(f,{title:t(`runtimeUpdatesPageTitle`),description:t(`runtimeUpdatesPageDescription`),actions:(0,T.jsxs)(s,{variant:`outline`,onClick:()=>void m.checkForUpdates(),disabled:N||P||I,children:[(0,T.jsx)(y,{className:e(`mr-2 h-4 w-4`,N&&`animate-spin`)}),t(`desktopUpdatesCheckNow`)]})}),(0,T.jsxs)(h,{children:[(0,T.jsxs)(a,{children:[(0,T.jsx)(c,{children:t(`desktopUpdatesOverviewTitle`)}),(0,T.jsx)(o,{children:t(`desktopUpdatesOverviewDescription`)})]}),(0,T.jsxs)(l,{className:`space-y-5`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,T.jsx)(`span`,{className:`text-sm font-medium text-gray-700`,children:t(`desktopUpdatesStatusLabel`)}),(0,T.jsx)(D,{status:E.status})]}),(0,T.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-5`,children:H.map(([e,t])=>(0,T.jsx)(O,{label:e,value:t},e))}),E.channel===`beta`?(0,T.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,T.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:t(`desktopUpdatesBetaBadgeTitle`)}),(0,T.jsx)(`p`,{className:`mt-1 text-sm text-amber-700`,children:t(`desktopUpdatesBetaBadgeDescription`)})]}):null,E.downloadedVersion?(0,T.jsxs)(`div`,{className:`rounded-2xl border border-emerald-200 bg-emerald-50/70 p-4`,children:[(0,T.jsx)(`p`,{className:`text-sm font-semibold text-emerald-800`,children:t(`desktopUpdatesDownloadedBannerTitle`)}),(0,T.jsx)(`p`,{className:`mt-1 text-sm text-emerald-700`,children:t(`runtimeUpdatesDownloadedBannerDescription`).replace(`{version}`,E.downloadedVersion)})]}):null,(0,T.jsx)(k,{snapshot:E}),E.status===`blocked`?(0,T.jsxs)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4`,children:[(0,T.jsx)(`p`,{className:`text-sm font-semibold text-red-800`,children:t(`desktopUpdatesBlockedTitle`)}),(0,T.jsx)(`p`,{className:`mt-1 text-sm text-red-700`,children:E.errorMessage??t(`desktopUpdatesBlockedDescription`)}),E.recoveryCommand?(0,T.jsx)(`code`,{className:`mt-3 block rounded-lg bg-white/70 px-3 py-2 text-xs text-red-800`,children:E.recoveryCommand}):null]}):null,E.errorMessage&&E.status!==`blocked`?(0,T.jsx)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4 text-sm text-red-700`,children:E.errorMessage}):null]})]}),(0,T.jsxs)(h,{children:[(0,T.jsxs)(a,{children:[(0,T.jsx)(c,{children:t(`desktopUpdatesPreferencesTitle`)}),(0,T.jsx)(o,{children:t(`desktopUpdatesPreferencesDescription`)})]}),(0,T.jsxs)(l,{className:`space-y-5`,children:[(0,T.jsx)(`div`,{className:`rounded-xl border border-gray-200 p-4`,children:(0,T.jsxs)(`div`,{className:`space-y-3`,children:[(0,T.jsxs)(`div`,{className:`space-y-1`,children:[(0,T.jsx)(d,{children:t(`desktopUpdatesReleaseChannel`)}),(0,T.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`desktopUpdatesReleaseChannelHelp`)})]}),(0,T.jsxs)(v,{value:E.channel,disabled:z||N||P||I,onValueChange:e=>void m.updateChannel(e),children:[(0,T.jsx)(x,{className:`w-full max-w-sm`,children:(0,T.jsx)(b,{placeholder:t(`desktopUpdatesReleaseChannel`)})}),(0,T.jsxs)(C,{children:[(0,T.jsx)(_,{value:`stable`,children:t(`desktopUpdatesChannelStable`)}),(0,T.jsx)(_,{value:`beta`,children:t(`desktopUpdatesChannelBeta`)})]})]}),(0,T.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`desktopUpdatesReleaseChannelDowngradeHint`)})]})}),(0,T.jsx)(A,{label:t(`desktopUpdatesAutomaticChecks`),help:t(`desktopUpdatesAutomaticChecksHelp`),checked:E.preferences.automaticChecks,disabled:L||z,onCheckedChange:e=>void m.updatePreferences({automaticChecks:e})}),(0,T.jsx)(A,{label:t(`desktopUpdatesAutoDownload`),help:t(`desktopUpdatesAutoDownloadHelp`),checked:E.preferences.autoDownload,disabled:L||z,onCheckedChange:e=>void m.updatePreferences({autoDownload:e})})]})]}),(0,T.jsxs)(h,{children:[(0,T.jsxs)(a,{children:[(0,T.jsx)(c,{children:t(`desktopUpdatesActionsTitle`)}),(0,T.jsx)(o,{children:t(`runtimeUpdatesActionsDescription`)})]}),(0,T.jsxs)(l,{className:`flex flex-wrap items-center gap-3`,children:[(0,T.jsxs)(s,{variant:`outline`,onClick:()=>void m.checkForUpdates(),disabled:N||P||I,children:[(0,T.jsx)(y,{className:e(`mr-2 h-4 w-4`,N&&`animate-spin`)}),t(`desktopUpdatesCheckNow`)]}),(0,T.jsxs)(s,{onClick:()=>void m.downloadUpdate(),disabled:!B,children:[(0,T.jsx)(w,{className:e(`mr-2 h-4 w-4`,P&&`animate-bounce`)}),t(`desktopUpdatesDownloadNow`)]}),(0,T.jsxs)(s,{variant:`secondary`,onClick:()=>void m.applyDownloadedUpdate(),disabled:!V,children:[(0,T.jsx)(S,{className:e(`mr-2 h-4 w-4`,I&&`animate-spin`)}),t(`runtimeUpdatesApplyNow`)]}),E.releaseNotesUrl?(0,T.jsxs)(s,{variant:`ghost`,onClick:()=>window.open(E.releaseNotesUrl??``,`_blank`,`noopener,noreferrer`),children:[(0,T.jsx)(g,{className:`mr-2 h-4 w-4`}),t(`desktopUpdatesReleaseNotes`)]}):null]})]})]})}export{z as DesktopUpdateConfig};
1
+ import{d as e,i as t,m as n,n as r}from"./react-B2X_ph0a.js";import{At as i,Dt as a,Et as o,Nt as s,Ot as c,Tt as l,ft as u,jt as d,kt as f,mt as p,pt as m,wt as h}from"./api-DruAcori.js";import{t as g}from"./external-link-C3usm3se.js";import{J as _,K as v,Qt as y,X as b,Y as x,Zt as S,q as C,sn as w}from"./index-GVTiCf1s.js";var T=n(),E={checking:`desktopUpdatesStatusChecking`,"update-available":`desktopUpdatesStatusAvailable`,downloading:`desktopUpdatesStatusDownloading`,downloaded:`desktopUpdatesStatusDownloaded`,"up-to-date":`desktopUpdatesStatusUpToDate`,blocked:`desktopUpdatesStatusBlocked`,failed:`desktopUpdatesStatusFailed`};function D({status:t}){return(0,T.jsx)(`span`,{className:e(`inline-flex rounded-full px-3 py-1 text-xs font-medium ring-1`,L(t)),children:I(t)})}function O({label:e,value:t}){return(0,T.jsxs)(`div`,{className:`rounded-xl border border-gray-200 bg-gray-50/60 p-4`,children:[(0,T.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-[0.08em] text-gray-500`,children:e}),(0,T.jsx)(`p`,{className:`mt-2 text-base font-semibold text-gray-900`,children:t})]})}function k({snapshot:e}){if(e.status!==`downloading`)return null;let n=e.progress?.percent,r=n==null?t(`desktopUpdatesDownloadProgressUnknown`):t(`desktopUpdatesDownloadProgressPercent`).replace(`{percent}`,String(n)),i=N(e.progress?.downloadedBytes??0,e.progress?.totalBytes??null);return(0,T.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,T.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:r}),(0,T.jsx)(`p`,{className:`text-xs font-medium text-amber-700`,children:i})]}),(0,T.jsx)(`div`,{className:`mt-3 h-2 overflow-hidden rounded-full bg-amber-100`,children:(0,T.jsx)(`div`,{className:`h-full rounded-full bg-amber-500 transition-[width]`,style:{width:`${n??0}%`}})})]})}function A({label:e,help:t,checked:n,disabled:r,onCheckedChange:i}){return(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-4 rounded-xl border border-gray-200 p-4`,children:[(0,T.jsxs)(`div`,{className:`space-y-1`,children:[(0,T.jsx)(d,{children:e}),(0,T.jsx)(`p`,{className:`text-sm text-gray-500`,children:t})]}),(0,T.jsx)(u,{checked:n,disabled:r,onCheckedChange:i})]})}function j(e){return e?.trim()||`-`}function M(e){return e?r(e):`-`}function N(e,t){let n=P(e);return t&&t>0?`${n} / ${P(t)}`:n}function P(e){if(!Number.isFinite(e)||e<=0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=e,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n>=10||r===0?n.toFixed(0):n.toFixed(1)} ${t[r]}`}function F(e){return t(e===`beta`?`desktopUpdatesChannelBeta`:`desktopUpdatesChannelStable`)}function I(e){return t(E[e]??`desktopUpdatesStatusIdle`)}function L(e){return e===`downloaded`?`bg-emerald-50 text-emerald-700 ring-emerald-100`:e===`update-available`||e===`downloading`||e===`checking`?`bg-amber-50 text-amber-700 ring-amber-100`:e===`failed`||e===`blocked`?`bg-red-50 text-red-700 ring-red-100`:`bg-gray-100 text-gray-700 ring-gray-200`}function R(){return(0,T.jsxs)(i,{className:`space-y-6`,children:[(0,T.jsx)(f,{title:t(`runtimeUpdatesPageTitle`),description:t(`runtimeUpdatesPageDescription`)}),(0,T.jsxs)(h,{children:[(0,T.jsxs)(a,{children:[(0,T.jsx)(c,{children:t(`runtimeUpdatesUnavailableTitle`)}),(0,T.jsx)(o,{children:t(`runtimeUpdatesUnavailableDescription`)})]}),(0,T.jsx)(l,{children:(0,T.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`runtimeUpdatesUnavailableHint`)})})]})]})}function z(){let{supported:n,initialized:r,busyAction:u,snapshot:E}=p();if(!r)return(0,T.jsx)(`div`,{className:`p-8 text-gray-400`,children:t(`loading`)});if(!n||!E)return(0,T.jsx)(R,{});let N=u===`checking`,P=u===`downloading`,I=u===`applying`,L=u===`saving-preferences`,z=u===`switching-channel`,B=E.status===`update-available`&&!P&&!I,V=E.status===`downloaded`&&!I,H=[[t(`runtimeUpdatesHostVersion`),j(E.hostVersion)],[t(`desktopUpdatesCurrentBundleVersion`),j(E.currentVersion)],[t(`desktopUpdatesAvailableVersion`),j(E.availableVersion)],[t(`desktopUpdatesLastCheckedAt`),M(E.lastCheckedAt)],[t(`desktopUpdatesCurrentChannel`),F(E.channel)]];return(0,T.jsxs)(i,{className:`space-y-6`,children:[(0,T.jsx)(f,{title:t(`runtimeUpdatesPageTitle`),description:t(`runtimeUpdatesPageDescription`),actions:(0,T.jsxs)(s,{variant:`outline`,onClick:()=>void m.checkForUpdates(),disabled:N||P||I,children:[(0,T.jsx)(y,{className:e(`mr-2 h-4 w-4`,N&&`animate-spin`)}),t(`desktopUpdatesCheckNow`)]})}),(0,T.jsxs)(h,{children:[(0,T.jsxs)(a,{children:[(0,T.jsx)(c,{children:t(`desktopUpdatesOverviewTitle`)}),(0,T.jsx)(o,{children:t(`desktopUpdatesOverviewDescription`)})]}),(0,T.jsxs)(l,{className:`space-y-5`,children:[(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,T.jsx)(`span`,{className:`text-sm font-medium text-gray-700`,children:t(`desktopUpdatesStatusLabel`)}),(0,T.jsx)(D,{status:E.status})]}),(0,T.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-5`,children:H.map(([e,t])=>(0,T.jsx)(O,{label:e,value:t},e))}),E.channel===`beta`?(0,T.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50/70 p-4`,children:[(0,T.jsx)(`p`,{className:`text-sm font-semibold text-amber-800`,children:t(`desktopUpdatesBetaBadgeTitle`)}),(0,T.jsx)(`p`,{className:`mt-1 text-sm text-amber-700`,children:t(`desktopUpdatesBetaBadgeDescription`)})]}):null,E.downloadedVersion?(0,T.jsxs)(`div`,{className:`rounded-2xl border border-emerald-200 bg-emerald-50/70 p-4`,children:[(0,T.jsx)(`p`,{className:`text-sm font-semibold text-emerald-800`,children:t(`desktopUpdatesDownloadedBannerTitle`)}),(0,T.jsx)(`p`,{className:`mt-1 text-sm text-emerald-700`,children:t(`runtimeUpdatesDownloadedBannerDescription`).replace(`{version}`,E.downloadedVersion)})]}):null,(0,T.jsx)(k,{snapshot:E}),E.status===`blocked`?(0,T.jsxs)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4`,children:[(0,T.jsx)(`p`,{className:`text-sm font-semibold text-red-800`,children:t(`desktopUpdatesBlockedTitle`)}),(0,T.jsx)(`p`,{className:`mt-1 text-sm text-red-700`,children:E.errorMessage??t(`desktopUpdatesBlockedDescription`)}),E.recoveryCommand?(0,T.jsx)(`code`,{className:`mt-3 block rounded-lg bg-white/70 px-3 py-2 text-xs text-red-800`,children:E.recoveryCommand}):null]}):null,E.errorMessage&&E.status!==`blocked`?(0,T.jsx)(`div`,{className:`rounded-2xl border border-red-200 bg-red-50/70 p-4 text-sm text-red-700`,children:E.errorMessage}):null]})]}),(0,T.jsxs)(h,{children:[(0,T.jsxs)(a,{children:[(0,T.jsx)(c,{children:t(`desktopUpdatesPreferencesTitle`)}),(0,T.jsx)(o,{children:t(`desktopUpdatesPreferencesDescription`)})]}),(0,T.jsxs)(l,{className:`space-y-5`,children:[(0,T.jsx)(`div`,{className:`rounded-xl border border-gray-200 p-4`,children:(0,T.jsxs)(`div`,{className:`space-y-3`,children:[(0,T.jsxs)(`div`,{className:`space-y-1`,children:[(0,T.jsx)(d,{children:t(`desktopUpdatesReleaseChannel`)}),(0,T.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`desktopUpdatesReleaseChannelHelp`)})]}),(0,T.jsxs)(v,{value:E.channel,disabled:z||N||P||I,onValueChange:e=>void m.updateChannel(e),children:[(0,T.jsx)(x,{className:`w-full max-w-sm`,children:(0,T.jsx)(b,{placeholder:t(`desktopUpdatesReleaseChannel`)})}),(0,T.jsxs)(C,{children:[(0,T.jsx)(_,{value:`stable`,children:t(`desktopUpdatesChannelStable`)}),(0,T.jsx)(_,{value:`beta`,children:t(`desktopUpdatesChannelBeta`)})]})]}),(0,T.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`desktopUpdatesReleaseChannelDowngradeHint`)})]})}),(0,T.jsx)(A,{label:t(`desktopUpdatesAutomaticChecks`),help:t(`desktopUpdatesAutomaticChecksHelp`),checked:E.preferences.automaticChecks,disabled:L||z,onCheckedChange:e=>void m.updatePreferences({automaticChecks:e})}),(0,T.jsx)(A,{label:t(`desktopUpdatesAutoDownload`),help:t(`desktopUpdatesAutoDownloadHelp`),checked:E.preferences.autoDownload,disabled:L||z,onCheckedChange:e=>void m.updatePreferences({autoDownload:e})})]})]}),(0,T.jsxs)(h,{children:[(0,T.jsxs)(a,{children:[(0,T.jsx)(c,{children:t(`desktopUpdatesActionsTitle`)}),(0,T.jsx)(o,{children:t(`runtimeUpdatesActionsDescription`)})]}),(0,T.jsxs)(l,{className:`flex flex-wrap items-center gap-3`,children:[(0,T.jsxs)(s,{variant:`outline`,onClick:()=>void m.checkForUpdates(),disabled:N||P||I,children:[(0,T.jsx)(y,{className:e(`mr-2 h-4 w-4`,N&&`animate-spin`)}),t(`desktopUpdatesCheckNow`)]}),(0,T.jsxs)(s,{onClick:()=>void m.downloadUpdate(),disabled:!B,children:[(0,T.jsx)(w,{className:e(`mr-2 h-4 w-4`,P&&`animate-bounce`)}),t(`desktopUpdatesDownloadNow`)]}),(0,T.jsxs)(s,{variant:`secondary`,onClick:()=>void m.applyDownloadedUpdate(),disabled:!V,children:[(0,T.jsx)(S,{className:e(`mr-2 h-4 w-4`,I&&`animate-spin`)}),t(`runtimeUpdatesApplyNow`)]}),E.releaseNotesUrl?(0,T.jsxs)(s,{variant:`ghost`,onClick:()=>window.open(E.releaseNotesUrl??``,`_blank`,`noopener,noreferrer`),children:[(0,T.jsx)(g,{className:`mr-2 h-4 w-4`}),t(`desktopUpdatesReleaseNotes`)]}):null]})]})]})}export{z as DesktopUpdateConfig};
@@ -0,0 +1,3 @@
1
+ import{d as e,h as t,i as n,m as r,v as i}from"./react-B2X_ph0a.js";import{t as a}from"./createLucideIcon-Br1EFMEr.js";import{n as o,t as s}from"./search-CdhgFNwf.js";import{t as c}from"./book-open-cPX0Za7Z.js";import{n as l,t as u}from"./wrench-qVIwShTF.js";import{t as d}from"./external-link-C3usm3se.js";import{t as f}from"./plus-BcIC8dG1.js";import{t as p}from"./x-Chb07O-Y.js";import{a as m,i as h,l as g,o as _,u as v}from"./doc-browser-route-registry.utils-x5ijvk0u.js";import{n as ee}from"./doc-browser-context-DB6TTHeE.js";var y=`modulepreload`,b=function(e){return`/`+e},x={},S=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=b(t,n),t in x)return;x[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:y,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},C=i(t(),1),w=`popstate`;function T(e={}){let{initialEntries:t=[`/`],initialIndex:n,v5Compat:r=!1}=e,i;i=t.map((e,t)=>u(e,typeof e==`string`?null:e.state,t===0?`default`:void 0));let a=c(n??i.length-1),o=`POP`,s=null;function c(e){return Math.min(Math.max(e,0),i.length-1)}function l(){return i[a]}function u(e,t=null,n){let r=k(i?l().pathname:`/`,e,t,n);return D(r.pathname.charAt(0)===`/`,`relative pathnames are not supported in memory history: ${JSON.stringify(e)}`),r}function d(e){return typeof e==`string`?e:A(e)}return{get index(){return a},get action(){return o},get location(){return l()},createHref:d,createURL(e){return new URL(d(e),`http://localhost`)},encodeLocation(e){let t=typeof e==`string`?j(e):e;return{pathname:t.pathname||``,search:t.search||``,hash:t.hash||``}},push(e,t){o=`PUSH`;let n=u(e,t);a+=1,i.splice(a,i.length,n),r&&s&&s({action:o,location:n,delta:1})},replace(e,t){o=`REPLACE`;let n=u(e,t);i[a]=n,r&&s&&s({action:o,location:n,delta:0})},go(e){o=`POP`;let t=c(a+e),n=i[t];a=t,s&&s({action:o,location:n,delta:e})},listen(e){return s=e,()=>{s=null}}}}function te(e={}){function t(e,t){let{pathname:n,search:r,hash:i}=e.location;return k(``,{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||`default`)}function n(e,t){return typeof t==`string`?t:A(t)}return M(t,n,null,e)}function E(e,t){if(e===!1||e==null)throw Error(t)}function D(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function ne(){return Math.random().toString(36).substring(2,10)}function O(e,t){return{usr:e.state,key:e.key,idx:t}}function k(e,t,n=null,r){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?j(t):t,state:n,key:t&&t.key||r||ne()}}function A({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function j(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function M(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=k(h.location,e,t);n&&n(r,e),l=u()+1;let d=O(r,l),f=h.createHref(r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=k(h.location,e,t);n&&n(r,e),l=u();let i=O(r,l),d=h.createHref(r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return re(e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(w,d),c=e,()=>{i.removeEventListener(w,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function re(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),E(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:A(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function N(e,t,n=`/`){return ie(e,t,n,!1)}function ie(e,t,n,r){let i=B((typeof t==`string`?j(t):t).pathname||`/`,n);if(i==null)return null;let a=ae(e);se(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=he(i);o=pe(a[e],t,r)}return o}function P(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function ae(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;E(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=V([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(E(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),ae(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:R(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of oe(e.path))a(e,t,!0,n)}),t}function oe(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=oe(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function se(e){e.sort((e,t)=>e.score===t.score?fe(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var F=/^:[\w-]+$/,ce=3,I=2,le=1,ue=10,de=-2,L=e=>e===`*`;function R(e,t){let n=e.split(`/`),r=n.length;return n.some(L)&&(r+=de),t&&(r+=I),n.filter(e=>!L(e)).reduce((e,t)=>e+(F.test(t)?ce:t===``?le:ue),r)}function fe(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function pe(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=z({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=z({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:V([a,u.pathname]),pathnameBase:Ce(V([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=V([a,u.pathnameBase]))}return o}function z(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=me(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function me(e,t=!1,n=!0){D(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:n!=null}),n?`/?([^\\/]+)?`:`/([^\\/]+)`)).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function he(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return D(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function B(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var ge=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function _e(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?j(e):e,a;return n?(n=n.replace(/\/\/+/g,`/`),a=n.startsWith(`/`)?ve(n.substring(1),`/`):ve(n,t)):a=t,{pathname:a,search:we(r),hash:Te(i)}}function ve(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function ye(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function be(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function xe(e){let t=be(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Se(e,t,n,r=!1){let i;typeof e==`string`?i=j(e):(i={...e},E(!i.pathname||!i.pathname.includes(`?`),ye(`?`,`pathname`,`search`,i)),E(!i.pathname||!i.pathname.includes(`#`),ye(`#`,`pathname`,`hash`,i)),E(!i.search||!i.search.includes(`#`),ye(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=_e(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var V=e=>e.join(`/`).replace(/\/\/+/g,`/`),Ce=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),we=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Te=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Ee=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function De(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Oe(e){return e.map(e=>e.route.path).filter(Boolean).join(`/`).replace(/\/\/*/g,`/`)||`/`}var ke=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ae(e,t){let n=e;if(typeof n!=`string`||!ge.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(ke)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=B(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{D(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var je=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(je);var Me=[`GET`,...je];new Set(Me);var H=C.createContext(null);H.displayName=`DataRouter`;var U=C.createContext(null);U.displayName=`DataRouterState`;var Ne=C.createContext(!1),Pe=C.createContext({isTransitioning:!1});Pe.displayName=`ViewTransition`;var Fe=C.createContext(new Map);Fe.displayName=`Fetchers`;var Ie=C.createContext(null);Ie.displayName=`Await`;var W=C.createContext(null);W.displayName=`Navigation`;var G=C.createContext(null);G.displayName=`Location`;var K=C.createContext({outlet:null,matches:[],isDataRoute:!1});K.displayName=`Route`;var Le=C.createContext(null);Le.displayName=`RouteError`;var Re=`REACT_ROUTER_ERROR`,ze=`REDIRECT`,Be=`ROUTE_ERROR_RESPONSE`;function Ve(e){if(e.startsWith(`${Re}:${ze}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function He(e){if(e.startsWith(`${Re}:${Be}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Ee(t.status,t.statusText,t.data)}catch{}}function Ue(e,{relative:t}={}){E(q(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=C.useContext(W),{hash:i,pathname:a,search:o}=Y(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:V([n,a])),r.createHref({pathname:s,search:o,hash:i})}function q(){return C.useContext(G)!=null}function J(){return E(q(),`useLocation() may be used only in the context of a <Router> component.`),C.useContext(G).location}var We=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Ge(e){C.useContext(W).static||C.useLayoutEffect(e)}function Ke(){let{isDataRoute:e}=C.useContext(K);return e?pt():qe()}function qe(){E(q(),`useNavigate() may be used only in the context of a <Router> component.`);let e=C.useContext(H),{basename:t,navigator:n}=C.useContext(W),{matches:r}=C.useContext(K),{pathname:i}=J(),a=JSON.stringify(xe(r)),o=C.useRef(!1);return Ge(()=>{o.current=!0}),C.useCallback((r,s={})=>{if(D(o.current,We),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Se(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:V([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}C.createContext(null);function Je(){let{matches:e}=C.useContext(K),t=e[e.length-1];return t?t.params:{}}function Y(e,{relative:t}={}){let{matches:n}=C.useContext(K),{pathname:r}=J(),i=JSON.stringify(xe(n));return C.useMemo(()=>Se(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Ye(e,t){return Xe(e,t)}function Xe(e,t,n,r,i){E(q(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:a}=C.useContext(W),{matches:o}=C.useContext(K),s=o[o.length-1],c=s?s.params:{},l=s?s.pathname:`/`,u=s?s.pathnameBase:`/`,d=s&&s.route;{let e=d&&d.path||``;ht(l,!d||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
2
+
3
+ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let f=J(),p;if(t){let e=typeof t==`string`?j(t):t;E(u===`/`||e.pathname?.startsWith(u),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${e.pathname}" was given in the \`location\` prop.`),p=e}else p=f;let m=p.pathname||`/`,h=m;if(u!==`/`){let e=u.replace(/^\//,``).split(`/`);h=`/`+m.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let g=N(e,{pathname:h});D(d||g!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),D(g==null||g[g.length-1].route.element!==void 0||g[g.length-1].route.Component!==void 0||g[g.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let _=rt(g&&g.map(e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:V([u,a.encodeLocation?a.encodeLocation(e.pathname.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?u:V([u,a.encodeLocation?a.encodeLocation(e.pathnameBase.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),o,n,r,i);return t&&_?C.createElement(G.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,...p},navigationType:`POP`}},_):_}function Ze(){let e=ft(),t=De(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=C.createElement(C.Fragment,null,C.createElement(`p`,null,`💿 Hey developer 👋`),C.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,C.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,C.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),C.createElement(C.Fragment,null,C.createElement(`h2`,null,`Unexpected Application Error!`),C.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?C.createElement(`pre`,{style:i},n):null,o)}var Qe=C.createElement(Ze,null),$e=class extends C.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=He(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:C.createElement(K.Provider,{value:this.props.routeContext},C.createElement(Le.Provider,{value:e,children:this.props.component}));return this.context?C.createElement(tt,{error:e},t):t}};$e.contextType=Ne;var et=new WeakMap;function tt({children:e,error:t}){let{basename:n}=C.useContext(W);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Ve(t.digest);if(e){let r=et.get(t);if(r)throw r;let i=Ae(e.location,n);if(ke&&!et.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw et.set(t,n),n}return C.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function nt({routeContext:e,match:t,children:n}){let r=C.useContext(H);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),C.createElement(K.Provider,{value:e},n)}function rt(e,t=[],n=null,r=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n?.errors;if(o!=null){let e=a.findIndex(e=>e.route.id&&o?.[e.route.id]!==void 0);E(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(`,`)}`),a=a.slice(0,Math.min(a.length,e+1))}let s=!1,c=-1;if(n)for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(c=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!r||r[t.route.id]===void 0);if(t.route.lazy||i){s=!0,a=c>=0?a.slice(0,c+1):[a[0]];break}}}let l=n&&r?(e,t)=>{r(e,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:Oe(n.matches),errorInfo:t})}:void 0;return a.reduceRight((e,r,i)=>{let u,d=!1,f=null,p=null;n&&(u=o&&r.route.id?o[r.route.id]:void 0,f=r.route.errorElement||Qe,s&&(c<0&&i===0?(ht(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):c===i&&(d=!0,p=r.route.hydrateFallbackElement||null)));let m=t.concat(a.slice(0,i+1)),h=()=>{let t;return t=u?f:d?p:r.route.Component?C.createElement(r.route.Component,null):r.route.element?r.route.element:e,C.createElement(nt,{match:r,routeContext:{outlet:e,matches:m,isDataRoute:n!=null},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||i===0)?C.createElement($e,{location:n.location,revalidation:n.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function it(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function at(e){let t=C.useContext(H);return E(t,it(e)),t}function ot(e){let t=C.useContext(U);return E(t,it(e)),t}function st(e){let t=C.useContext(K);return E(t,it(e)),t}function ct(e){let t=st(e),n=t.matches[t.matches.length-1];return E(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function lt(){return ct(`useRouteId`)}function ut(){return ot(`useNavigation`).navigation}function dt(){let{matches:e,loaderData:t}=ot(`useMatches`);return C.useMemo(()=>e.map(e=>P(e,t)),[e,t])}function ft(){let e=C.useContext(Le),t=ot(`useRouteError`),n=ct(`useRouteError`);return e===void 0?t.errors?.[n]:e}function pt(){let{router:e}=at(`useNavigate`),t=ct(`useNavigate`),n=C.useRef(!1);return Ge(()=>{n.current=!0}),C.useCallback(async(r,i={})=>{D(n.current,We),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var mt={};function ht(e,t,n){!t&&!mt[e]&&(mt[e]=!0,D(!1,n))}C.useOptimistic,C.memo(gt);function gt({routes:e,future:t,state:n,onError:r}){return Xe(e,void 0,n,r,t)}function _t({basename:e,children:t,initialEntries:n,initialIndex:r,unstable_useTransitions:i}){let a=C.useRef();a.current??=T({initialEntries:n,initialIndex:r,v5Compat:!0});let o=a.current,[s,c]=C.useState({action:o.action,location:o.location}),l=C.useCallback(e=>{i===!1?c(e):C.startTransition(()=>c(e))},[i]);return C.useLayoutEffect(()=>o.listen(l),[o,l]),C.createElement(bt,{basename:e,children:t,location:s.location,navigationType:s.action,navigator:o,unstable_useTransitions:i})}function vt({to:e,replace:t,state:n,relative:r}){E(q(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=C.useContext(W);D(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=C.useContext(K),{pathname:o}=J(),s=Ke(),c=Se(e,xe(a),o,r===`path`),l=JSON.stringify(c);return C.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function yt(e){E(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function bt({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,unstable_useTransitions:o}){E(!q(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=C.useMemo(()=>({basename:s,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=j(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`}=n,m=C.useMemo(()=>{let e=B(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p},navigationType:r}},[s,l,u,d,f,p,r]);return D(m!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),m==null?null:C.createElement(W.Provider,{value:c},C.createElement(G.Provider,{children:t,value:m}))}function xt({children:e,location:t}){return Ye(St(e),t)}C.Component;function St(e,t=[]){let n=[];return C.Children.forEach(e,(e,r)=>{if(!C.isValidElement(e))return;let i=[...t,r];if(e.type===C.Fragment){n.push.apply(n,St(e.props.children,i));return}E(e.type===yt,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),E(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=St(e.props.children,i)),n.push(a)}),n}var Ct=`get`,wt=`application/x-www-form-urlencoded`;function Tt(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Et(e){return Tt(e)&&e.tagName.toLowerCase()===`button`}function Dt(e){return Tt(e)&&e.tagName.toLowerCase()===`form`}function Ot(e){return Tt(e)&&e.tagName.toLowerCase()===`input`}function kt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function At(e,t){return e.button===0&&(!t||t===`_self`)&&!kt(e)}var jt=null;function Mt(){if(jt===null)try{new FormData(document.createElement(`form`),0),jt=!1}catch{jt=!0}return jt}var Nt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Pt(e){return e!=null&&!Nt.has(e)?(D(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${wt}"`),null):e}function Ft(e,t){let n,r,i,a,o;if(Dt(e)){let o=e.getAttribute(`action`);r=o?B(o,t):null,n=e.getAttribute(`method`)||Ct,i=Pt(e.getAttribute(`enctype`))||wt,a=new FormData(e)}else if(Et(e)||Ot(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?B(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Ct,i=Pt(e.getAttribute(`formenctype`))||Pt(o.getAttribute(`enctype`))||wt,a=new FormData(o,e),!Mt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Tt(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Ct,r=null,i=wt,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var It={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Lt=/[&><\u2028\u2029]/g;function Rt(e){return e.replace(Lt,e=>It[e])}function zt(e,t){if(e===!1||e==null)throw Error(t)}function Bt(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&B(i.pathname,t)===`/`?i.pathname=`${t.replace(/\/$/,``)}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,``)}.${r}`,i}async function Vt(e,t){if(e.id in t)return t[e.id];try{let n=await S(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ht(e){return e!=null&&typeof e.page==`string`}function Ut(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Wt(e,t,n){return Yt((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Vt(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Ut).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Gt(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Kt(e,t,{includeHydrateFallback:n}={}){return qt(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function qt(e){return[...new Set(e)]}function Jt(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Yt(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Ht(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Jt(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Xt(){let e=C.useContext(H);return zt(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Zt(){let e=C.useContext(U);return zt(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Qt=C.createContext(void 0);Qt.displayName=`FrameworkContext`;function $t(){let e=C.useContext(Qt);return zt(e,`You must render this element inside a <HydratedRouter> element`),e}function en(e,t){let n=C.useContext(Qt),[r,i]=C.useState(!1),[a,o]=C.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=C.useRef(null);C.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),C.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:X(s,p),onBlur:X(c,m),onMouseEnter:X(l,p),onMouseLeave:X(u,m),onTouchStart:X(d,p)}]:[a,f,{}]:[!1,f,{}]}function X(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function tn({page:e,...t}){let{router:n}=Xt(),r=C.useMemo(()=>N(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?C.createElement(rn,{page:e,matches:r,...t}):null}function nn(e){let{manifest:t,routeModules:n}=$t(),[r,i]=C.useState([]);return C.useEffect(()=>{let r=!1;return Wt(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function rn({page:e,matches:t,...n}){let r=J(),{future:i,manifest:a,routeModules:o}=$t(),{basename:s}=Xt(),{loaderData:c,matches:l}=Zt(),u=C.useMemo(()=>Gt(e,t,l,a,r,`data`),[e,t,l,a,r]),d=C.useMemo(()=>Gt(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=C.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Bt(e,s,i.unstable_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.unstable_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=C.useMemo(()=>Kt(d,a),[d,a]),m=nn(d);return C.createElement(C.Fragment,null,f.map(e=>C.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>C.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>C.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function an(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}C.Component;var on=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{on&&(window.__reactRouterVersion=`7.13.0`)}catch{}function sn({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=C.useRef();i.current??=te({window:r,v5Compat:!0});let a=i.current,[o,s]=C.useState({action:a.action,location:a.location}),c=C.useCallback(e=>{n===!1?s(e):C.startTransition(()=>s(e))},[n]);return C.useLayoutEffect(()=>a.listen(c),[a,c]),C.createElement(bt,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}function cn({basename:e,children:t,history:n,unstable_useTransitions:r}){let[i,a]=C.useState({action:n.action,location:n.location}),o=C.useCallback(e=>{r===!1?a(e):C.startTransition(()=>a(e))},[r]);return C.useLayoutEffect(()=>n.listen(o),[n,o]),C.createElement(bt,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,unstable_useTransitions:r})}cn.displayName=`unstable_HistoryRouter`;var ln=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,un=C.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,state:o,target:s,to:c,preventScrollReset:l,viewTransition:u,unstable_defaultShouldRevalidate:d,...f},p){let{basename:m,unstable_useTransitions:h}=C.useContext(W),g=typeof c==`string`&&ln.test(c),_=Ae(c,m);c=_.to;let v=Ue(c,{relative:r}),[ee,y,b]=en(n,f),x=_n(c,{replace:a,state:o,target:s,preventScrollReset:l,relative:r,viewTransition:u,unstable_defaultShouldRevalidate:d,unstable_useTransitions:h});function S(t){e&&e(t),t.defaultPrevented||x(t)}let w=C.createElement(`a`,{...f,...b,href:_.absoluteURL||v,onClick:_.isExternal||i?e:S,ref:an(p,y),target:s,"data-discover":!g&&t===`render`?`true`:void 0});return ee&&!g?C.createElement(C.Fragment,null,w,C.createElement(tn,{page:v})):w});un.displayName=`Link`;var dn=C.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Y(a,{relative:c.relative}),d=J(),f=C.useContext(U),{navigator:p,basename:m}=C.useContext(W),h=f!=null&&Dn(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=B(v,m)||v);let ee=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,y=_===g||!r&&_.startsWith(g)&&_.charAt(ee)===`/`,b=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),x={isActive:y,isPending:b,isTransitioning:h},S=y?e:void 0,w;w=typeof n==`function`?n(x):[n,y?`active`:null,b?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(x):i;return C.createElement(un,{...c,"aria-current":S,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(x):s)});dn.displayName=`NavLink`;var fn=C.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Ct,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m)=>{let{unstable_useTransitions:h}=C.useContext(W),g=bn(),_=xn(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,ee=typeof s==`string`&&ln.test(s);return C.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f});h&&n!==!1?C.startTransition(()=>p()):p()},...p,"data-discover":!ee&&e===`render`?`true`:void 0})});fn.displayName=`Form`;function pn({getKey:e,storageKey:t,...n}){let r=C.useContext(Qt),{basename:i}=C.useContext(W),a=J(),o=dt();Tn({getKey:e,storageKey:t});let s=C.useMemo(()=>{if(!r||!e)return null;let t=wn(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return C.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${Rt(JSON.stringify(t||Sn))}, ${Rt(JSON.stringify(s))})`}})}pn.displayName=`ScrollRestoration`;function mn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function hn(e){let t=C.useContext(H);return E(t,mn(e)),t}function gn(e){let t=C.useContext(U);return E(t,mn(e)),t}function _n(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:a,viewTransition:o,unstable_defaultShouldRevalidate:s,unstable_useTransitions:c}={}){let l=Ke(),u=J(),d=Y(e,{relative:a});return C.useCallback(f=>{if(At(f,t)){f.preventDefault();let t=n===void 0?A(u)===A(d):n,p=()=>l(e,{replace:t,state:r,preventScrollReset:i,relative:a,viewTransition:o,unstable_defaultShouldRevalidate:s});c?C.startTransition(()=>p()):p()}},[u,l,d,n,r,t,e,i,a,o,s,c])}var vn=0,yn=()=>`__${String(++vn)}__`;function bn(){let{router:e}=hn(`useSubmit`),{basename:t}=C.useContext(W),n=lt(),r=e.fetch,i=e.navigate;return C.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Ft(e,t);a.navigate===!1?await r(a.fetcherKey||yn(),n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function xn(e,{relative:t}={}){let{basename:n}=C.useContext(W),r=C.useContext(K);E(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Y(e||`.`,{relative:t})},o=J();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:V([n,a.pathname])),A(a)}var Sn=`react-router-scroll-positions`,Cn={};function wn(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:B(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Tn({getKey:e,storageKey:t}={}){let{router:n}=hn(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=gn(`useScrollRestoration`),{basename:a}=C.useContext(W),o=J(),s=dt(),c=ut();C.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),En(C.useCallback(()=>{if(c.state===`idle`){let t=wn(o,s,a,e);Cn[t]=window.scrollY}try{sessionStorage.setItem(t||Sn,JSON.stringify(Cn))}catch(e){D(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(C.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Sn);e&&(Cn=JSON.parse(e))}catch{}},[t]),C.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Cn,()=>window.scrollY,e?(t,n)=>wn(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),C.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{D(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function En(e,t){let{capture:n}=t||{};C.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Dn(e,{relative:t}={}){let n=C.useContext(Pe);E(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=hn(`useViewTransitionState`),i=Y(e,{relative:t});if(!n.isTransitioning)return!1;let a=B(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=B(n.nextLocation.pathname,r)||n.nextLocation.pathname;return z(i.pathname,o)!=null||z(i.pathname,a)!=null}var On=a(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),kn=a(`BrainCircuit`,[[`path`,{d:`M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z`,key:`l5xja`}],[`path`,{d:`M9 13a4.5 4.5 0 0 0 3-4`,key:`10igwf`}],[`path`,{d:`M6.003 5.125A3 3 0 0 0 6.401 6.5`,key:`105sqy`}],[`path`,{d:`M3.477 10.896a4 4 0 0 1 .585-.396`,key:`ql3yin`}],[`path`,{d:`M6 18a4 4 0 0 1-1.967-.516`,key:`2e4loj`}],[`path`,{d:`M12 13h4`,key:`1ku699`}],[`path`,{d:`M12 18h6a2 2 0 0 1 2 2v1`,key:`105ag5`}],[`path`,{d:`M12 8h8`,key:`1lhi5i`}],[`path`,{d:`M16 8V5a2 2 0 0 1 2-2`,key:`u6izg6`}],[`circle`,{cx:`16`,cy:`13`,r:`.5`,key:`ry7gng`}],[`circle`,{cx:`18`,cy:`3`,r:`.5`,key:`1aiba7`}],[`circle`,{cx:`20`,cy:`21`,r:`.5`,key:`yhc1fs`}],[`circle`,{cx:`20`,cy:`8`,r:`.5`,key:`1e43v0`}]]),An=a(`Grid3x3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),jn=a(`GripVertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),Mn=a(`Maximize2`,[[`polyline`,{points:`15 3 21 3 21 9`,key:`mznyad`}],[`polyline`,{points:`9 21 3 21 3 15`,key:`1avn1i`}],[`line`,{x1:`21`,x2:`14`,y1:`3`,y2:`10`,key:`ota7mn`}],[`line`,{x1:`3`,x2:`10`,y1:`21`,y2:`14`,key:`1atl0r`}]]),Nn=a(`PanelRightOpen`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),Z=r(),Pn={apps:{accentClassName:`bg-emerald-50 text-emerald-700 border-emerald-100`,icon:(0,Z.jsx)(l,{className:`h-5 w-5`})},"service-apps":{accentClassName:`bg-sky-50 text-sky-700 border-sky-100`,icon:(0,Z.jsx)(An,{className:`h-5 w-5`})},docs:{accentClassName:`bg-amber-50 text-amber-700 border-amber-100`,icon:(0,Z.jsx)(c,{className:`h-5 w-5`})},"skill-marketplace":{accentClassName:`bg-rose-50 text-rose-700 border-rose-100`,icon:(0,Z.jsx)(kn,{className:`h-5 w-5`})},"mcp-marketplace":{accentClassName:`bg-indigo-50 text-indigo-700 border-indigo-100`,icon:(0,Z.jsx)(u,{className:`h-5 w-5`})}};function Fn(e){return Pn[e.id]??{accentClassName:`bg-gray-50 text-gray-700 border-gray-100`,icon:(0,Z.jsx)(l,{className:`h-5 w-5`})}}function In({open:t}){let n=Ke(),r=h.getHomeNavigationItems(),i=e=>{if(e.type===`app-route`){n(e.path);return}t(e.url,e.options)};return(0,Z.jsx)(`div`,{className:`h-full overflow-auto bg-[#fbfaf7] px-5 py-6`,children:(0,Z.jsx)(`div`,{className:`mx-auto w-full max-w-[640px]`,children:(0,Z.jsx)(`div`,{className:`grid grid-cols-[repeat(auto-fit,minmax(88px,1fr))] gap-x-3 gap-y-5`,children:r.map(t=>{let n=Fn(t);return(0,Z.jsxs)(`button`,{type:`button`,onClick:()=>i(t.target),className:`group flex min-h-[82px] flex-col items-center gap-2 rounded-lg px-2 py-2 text-center transition-colors hover:bg-white/80`,children:[(0,Z.jsx)(`span`,{className:e(`flex h-12 w-12 shrink-0 items-center justify-center rounded-2xl border shadow-[0_1px_2px_rgba(30,20,10,0.04)] transition-transform group-hover:scale-[1.03]`,n.accentClassName),children:n.icon}),(0,Z.jsx)(`span`,{className:`min-w-0 max-w-full`,children:(0,Z.jsx)(`span`,{className:`line-clamp-2 block text-xs font-medium leading-snug text-gray-800`,children:t.label})})]},t.id)})})})})}function Ln({isDocsTab:e,onSubmit:t,onUrlInputChange:r,urlInput:i}){return e?(0,Z.jsx)(`div`,{className:`flex items-center gap-2 px-3.5 py-2 bg-white border-b border-gray-100 shrink-0`,children:(0,Z.jsxs)(`form`,{onSubmit:t,className:`flex-1 relative`,children:[(0,Z.jsx)(s,{className:`w-3.5 h-3.5 absolute left-3 top-1/2 -translate-y-1/2 text-gray-400`}),(0,Z.jsx)(`input`,{type:`text`,value:i,onChange:e=>r(e.target.value),placeholder:n(`docBrowserSearchPlaceholder`),className:`w-full h-8 pl-8 pr-3 rounded-lg bg-gray-50 border border-gray-200 text-xs text-gray-700 focus:outline-none focus:ring-1 focus:ring-primary/30 focus:border-primary/40 transition-colors placeholder:text-gray-400`})]})}):null}function Rn({currentTab:e,currentUrl:t,customContent:n,iframeRef:r,iframeInstanceId:i,iframeSandbox:a,isDragging:o,isResizing:s}){return(0,Z.jsxs)(`div`,{className:`flex-1 relative overflow-hidden`,children:[n||(0,Z.jsx)(`iframe`,{ref:r,src:t,className:`absolute inset-0 w-full h-full border-0`,title:e?.title||`NextClaw Docs`,sandbox:a,allow:`clipboard-read; clipboard-write`},i),(s||o)&&(0,Z.jsx)(`div`,{className:`absolute inset-0 z-10`})]})}function zn({currentUrl:e,isDocsTab:t}){return!t||!g(e)?null:(0,Z.jsx)(`div`,{className:`flex items-center justify-between px-4 py-2 bg-gray-50 border-t border-gray-200 shrink-0`,children:(0,Z.jsxs)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,"data-doc-external":!0,className:`flex items-center gap-1.5 text-xs text-primary hover:text-primary-hover font-medium transition-colors`,children:[n(`docBrowserOpenExternal`),(0,Z.jsx)(d,{className:`w-3 h-3`})]})})}function Bn({tabs:t,activeTabId:r,canGoBack:i,canGoForward:a,isDocked:s,isFullscreen:c,onGoBack:l,onGoForward:u,onOpenNewTab:d,onSetActiveTab:m,onCloseTab:h,onClose:g,onDragStart:_,onToggleMode:v}){return(0,Z.jsxs)(`div`,{"data-testid":`doc-browser-tab-strip`,className:e(`flex h-11 items-stretch gap-2 px-2.5 bg-background border-b border-[#f1e7d4] shrink-0 select-none`,c&&`h-[calc(env(safe-area-inset-top,0px)+2.75rem)] pt-[env(safe-area-inset-top,0px)]`),onPointerDown:!s&&!c?_:void 0,children:[(0,Z.jsx)(`div`,{className:`doc-browser-tab-scrollbar flex h-full min-w-0 flex-1 items-center gap-1.5 overflow-x-auto`,onPointerDown:e=>e.stopPropagation(),children:t.map(t=>(0,Z.jsxs)(`div`,{className:e(`inline-flex items-center gap-1 h-7 px-1.5 rounded-lg text-xs border max-w-[220px] shrink-0 transition-colors`,t.id===r?`bg-amber-50/80 border-amber-200 text-amber-900 shadow-[0_1px_2px_rgba(30,20,10,0.04)]`:`bg-[#f9f8f5] border-[#eee3d1] text-[#78644d] hover:bg-[#fff7ea] hover:text-[#2f2212]`),children:[(0,Z.jsx)(`button`,{type:`button`,onClick:()=>m(t.id),className:`truncate text-left px-1`,title:t.title,children:t.title||n(`docBrowserTabUntitled`)}),(0,Z.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),h(t.id)},className:`rounded p-0.5 hover:bg-black/10`,"aria-label":n(`docBrowserCloseTab`),children:(0,Z.jsx)(p,{className:`w-3 h-3`})})]},t.id))}),(0,Z.jsxs)(`div`,{className:`flex h-full items-center gap-1 shrink-0`,"data-testid":`doc-browser-tab-actions`,onPointerDown:e=>e.stopPropagation(),children:[(0,Z.jsx)(`button`,{type:`button`,onClick:l,disabled:!i,className:`rounded-md p-1.5 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 disabled:cursor-not-allowed disabled:text-gray-300 disabled:opacity-60 disabled:hover:bg-transparent disabled:hover:text-gray-300`,title:n(`docBrowserBack`),children:(0,Z.jsx)(o,{className:`w-3.5 h-3.5`})}),(0,Z.jsx)(`button`,{type:`button`,onClick:u,disabled:!a,className:`rounded-md p-1.5 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 disabled:cursor-not-allowed disabled:text-gray-300 disabled:opacity-60 disabled:hover:bg-transparent disabled:hover:text-gray-300`,title:n(`docBrowserForward`),children:(0,Z.jsx)(On,{className:`w-3.5 h-3.5`})}),(0,Z.jsx)(`button`,{type:`button`,onClick:d,className:`hover:bg-gray-100 rounded-md p-1.5 text-gray-500 hover:text-gray-700 transition-colors`,title:n(`docBrowserNewTab`),children:(0,Z.jsx)(f,{className:`w-3.5 h-3.5`})}),c?null:(0,Z.jsx)(`button`,{type:`button`,onClick:v,className:`hover:bg-gray-100 rounded-md p-1.5 text-gray-500 hover:text-gray-700 transition-colors`,title:n(s?`docBrowserFloatMode`:`docBrowserDockMode`),children:s?(0,Z.jsx)(Mn,{className:`w-3.5 h-3.5`}):(0,Z.jsx)(Nn,{className:`w-3.5 h-3.5`})}),(0,Z.jsx)(`button`,{type:`button`,onClick:g,className:`hover:bg-gray-100 rounded-md p-1.5 text-gray-500 hover:text-gray-700 transition-colors`,title:n(`docBrowserClose`),children:(0,Z.jsx)(p,{className:`w-3.5 h-3.5`})})]})]})}function Vn({children:t,className:n,style:r,defaultWidth:i=420,minWidth:a=320,maxWidth:o=860,overlay:s=!1,...c}){let l=(0,C.useRef)(null),[u,d]=(0,C.useState)(!1),[f,p]=(0,C.useState)(i),m=e=>{if(s)return;e.preventDefault(),e.stopPropagation(),d(!0),l.current={startX:e.clientX,startWidth:f};let t=e=>{let t=l.current;if(!t)return;let n=t.startWidth+t.startX-e.clientX;p(Math.max(a,Math.min(o,n)))},n=()=>{d(!1),l.current=null,window.removeEventListener(`mousemove`,t),window.removeEventListener(`mouseup`,n)};window.addEventListener(`mousemove`,t),window.addEventListener(`mouseup`,n)};return(0,Z.jsxs)(`aside`,{...c,className:e(`relative flex h-full min-h-0 shrink-0 overflow-hidden bg-white`,s?`fixed inset-0 z-40`:`border-l border-gray-200`,n),style:s?r:{...r,width:f},children:[s?null:(0,Z.jsx)(`div`,{className:`absolute left-0 top-0 z-20 h-full w-1.5 cursor-ew-resize transition-colors hover:bg-primary/10`,"data-testid":`resizable-right-panel-handle`,onMouseDown:m}),(0,Z.jsx)(`div`,{className:`flex h-full min-h-0 w-full flex-col overflow-hidden`,children:t}),u?(0,Z.jsx)(`div`,{className:`absolute inset-0 z-10`}):null]})}var Q=40,Hn=360,Un=400;function $(e,t,n){return Math.min(n,Math.max(t,e))}function Wn(){return{x:Math.max(Q,window.innerWidth-520),y:80,w:480,h:600}}function Gn({customTabRenderers:t={},displayMode:n=`desktop`}){let{isOpen:r,mode:i,tabs:a,activeTabId:o,activeHistory:s,activeHistoryIndex:c,currentTab:l,open:u,openNewTab:d,close:f,toggleMode:p,goBack:h,goForward:g,navigate:y,syncUrl:b,setActiveTab:x,closeTab:S}=ee(),[w,T]=(0,C.useState)(``),[te,E]=(0,C.useState)(0),[D,ne]=(0,C.useState)(Wn),[O,k]=(0,C.useState)(null),A=(0,C.useRef)(null),j=l?.currentUrl??m,M=l?.navVersion??0,re=`${o}:${M}:${te}`,N=(0,C.useRef)(null),ie=(0,C.useRef)(M),P=l?.kind===`docs`,ae=l?.kind===_,oe=c>0,se=c<s.length-1,F=l?t[l.kind]:void 0;(0,C.useEffect)(()=>{if(!P){T(``);return}try{T(new URL(j).pathname)}catch{T(j)}},[j,o,P]),(0,C.useEffect)(()=>{if(!P){N.current=null;return}if(M!==ie.current){ie.current=M,N.current=v(j);return}if(A.current?.contentWindow)try{let e=new URL(j).pathname;N.current=v(j),A.current.contentWindow.postMessage({type:`docs-navigate`,path:e},`*`)}catch{}},[j,M,P]),(0,C.useEffect)(()=>{let e=e=>{if(P&&e.data?.type===`docs-route-change`&&typeof e.data.url==`string`){let t=v(e.data.url);if(N.current&&t!==N.current)return;N.current=null,b(e.data.url)}};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[j,b,P]),(0,C.useEffect)(()=>{if(!l||!F?.onIframeMessage)return;let e=e=>{F.onIframeMessage?.({event:e,iframe:A.current,iframeInstanceId:re,tab:l})};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[l,F,re]);let ce=(0,C.useCallback)(e=>{e.preventDefault(),k({kind:`drag`,startX:e.clientX,startY:e.clientY,startRect:D})},[D]),I=(0,C.useCallback)(e=>t=>{t.preventDefault(),t.stopPropagation(),k({kind:`resize`,edge:e,startX:t.clientX,startY:t.clientY,startRect:D})},[D]);(0,C.useEffect)(()=>{if(!O)return;let e=e=>{let{startRect:t,startX:n,startY:r}=O,i=e.clientX-n,a=e.clientY-r;if(O.kind===`drag`){ne({...t,x:$(t.x+i,Q,window.innerWidth-Q-t.w),y:$(t.y+a,Q,window.innerHeight-Q-t.h)});return}if(O.edge===`left`||O.edge===`top`){let e=O.edge===`left`,n=e?t.x+t.w:t.y+t.h,r=$(e?t.x+i:t.y+a,Q,n-(e?Hn:Un));ne(e?{...t,x:r,w:n-r}:{...t,y:r,h:n-r});return}let o=$(t.x+t.w+i,t.x+Hn,window.innerWidth-Q),s=$(t.y+t.h+a,t.y+Un,window.innerHeight-Q);ne({...t,w:O.edge===`bottom`?t.w:o-t.x,h:O.edge===`right`?t.h:s-t.y})},t=()=>k(null);return window.addEventListener(`pointermove`,e),window.addEventListener(`pointerup`,t),window.addEventListener(`pointercancel`,t),()=>{window.removeEventListener(`pointermove`,e),window.removeEventListener(`pointerup`,t),window.removeEventListener(`pointercancel`,t)}},[O]);let le=(0,C.useCallback)(e=>{if(e.preventDefault(),!P)return;let t=w.trim();t&&(t.startsWith(`/`)?y(`${m}${t}`):t.startsWith(`http`)?y(t):y(`${m}/${t}`))},[w,y,P]),ue=(0,C.useCallback)(()=>{E(e=>e+1)},[]);if(!r)return null;let de=i===`docked`,L=n===`fullscreen`,R=l?{currentUrl:j,open:u,refreshIframe:ue,tab:l}:void 0,fe=R?F?.renderToolbar?.(R):null,pe=R?F?.renderContent?.(R)??(ae?(0,Z.jsx)(In,{open:u}):null):null,z=l?F?.getIframeSandbox?.(l)??`allow-same-origin allow-scripts allow-popups allow-forms`:`allow-same-origin allow-scripts allow-popups allow-forms`,me=(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Bn,{tabs:a,activeTabId:o,canGoBack:oe,canGoForward:se,isDocked:de,isFullscreen:L,onGoBack:h,onGoForward:g,onOpenNewTab:d,onSetActiveTab:x,onCloseTab:S,onClose:f,onDragStart:ce,onToggleMode:p}),(0,Z.jsx)(Ln,{isDocsTab:P,onSubmit:le,onUrlInputChange:T,urlInput:w}),fe,(0,Z.jsx)(Rn,{currentTab:l,currentUrl:j,customContent:pe,iframeRef:A,iframeInstanceId:re,iframeSandbox:z,isDragging:O?.kind===`drag`,isResizing:O?.kind===`resize`}),(0,Z.jsx)(zn,{currentUrl:j,isDocsTab:P})]});return de&&!L?(0,Z.jsx)(Vn,{"data-testid":`doc-browser-panel`,defaultWidth:420,minWidth:320,maxWidth:860,children:me}):(0,Z.jsxs)(`div`,{"data-testid":`doc-browser-panel`,className:e(`flex flex-col bg-white overflow-hidden relative`,L?`fixed inset-0 z-[9999] h-[100dvh] w-screen rounded-none border-0 shadow-2xl`:`rounded-2xl shadow-2xl border border-gray-200`),style:L?void 0:{position:`fixed`,left:D.x,top:D.y,width:D.w,height:D.h,zIndex:9999},children:[me,!de&&!L&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`absolute top-0 left-0 h-1.5 w-full cursor-ns-resize z-20 hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-top`,onPointerDown:I(`top`)}),(0,Z.jsx)(`div`,{className:`absolute top-0 left-0 w-1.5 h-full cursor-ew-resize z-20 hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-left`,onPointerDown:I(`left`)}),(0,Z.jsx)(`div`,{className:`absolute top-0 right-0 w-1.5 h-full cursor-ew-resize z-20 hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-right`,onPointerDown:I(`right`)}),(0,Z.jsx)(`div`,{className:`absolute bottom-0 left-0 h-1.5 w-full cursor-ns-resize z-20 hover:bg-primary/10 transition-colors`,"data-testid":`doc-browser-resize-bottom`,onPointerDown:I(`bottom`)}),(0,Z.jsx)(`div`,{className:`absolute bottom-0 right-0 w-4 h-4 cursor-se-resize z-30 flex items-center justify-center text-gray-300 hover:text-gray-500 transition-colors`,"data-testid":`doc-browser-resize-bottom-right`,onPointerDown:I(`bottom-right`),children:(0,Z.jsx)(jn,{className:`w-3 h-3 rotate-[-45deg]`})})]})]})}export{un as a,vt as c,J as d,Ke as f,sn as i,yt as l,S as m,Vn as n,_t as o,Je as p,kn as r,dn as s,Gn as t,xt as u};
@@ -0,0 +1 @@
1
+ import{t as e}from"./doc-browser-BI7HSaMK.js";export{e as DocBrowser};