@hyperdrive.bot/paseo-server 0.3.11 → 0.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server/server/agent/providers/claude/transport/pty-query.d.ts +92 -10
- package/dist/server/server/agent/providers/claude/transport/pty-query.js +615 -38
- package/dist/server/server/relay-transport.js +36 -5
- package/dist/server/web-ui/_expo/static/js/web/{desktop-attachment-bridge-9f03d060da06e8838a4e0fdd5c067757.js → desktop-attachment-bridge-e6e0f92f1a2959279a7c3b2b50bf1df3.js} +5 -5
- package/dist/server/web-ui/_expo/static/js/web/desktop-attachment-bridge-e6e0f92f1a2959279a7c3b2b50bf1df3.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/desktop-attachment-bridge-e6e0f92f1a2959279a7c3b2b50bf1df3.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/desktop-attachment-bridge-e6e0f92f1a2959279a7c3b2b50bf1df3.js.map.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/desktop-attachment-bridge-e6e0f92f1a2959279a7c3b2b50bf1df3.js.map.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/{desktop-attachment-store-d0d9dffa612bf12bf551c5e513c28691.js → desktop-attachment-store-d5c93939344c993e52d655ccf8942928.js} +3 -3
- package/dist/server/web-ui/_expo/static/js/web/desktop-attachment-store-d5c93939344c993e52d655ccf8942928.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/desktop-attachment-store-d5c93939344c993e52d655ccf8942928.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/desktop-attachment-store-d5c93939344c993e52d655ccf8942928.js.map.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/desktop-attachment-store-d5c93939344c993e52d655ccf8942928.js.map.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/{index-5a54792f78b8475572ccfac9808dd926.js → index-853ef1a7fc9c9b7a39577b79564e0896.js} +164 -163
- package/dist/server/web-ui/_expo/static/js/web/index-853ef1a7fc9c9b7a39577b79564e0896.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/index-853ef1a7fc9c9b7a39577b79564e0896.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/index-853ef1a7fc9c9b7a39577b79564e0896.js.map.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/{index-5a54792f78b8475572ccfac9808dd926.js.map.gz → index-853ef1a7fc9c9b7a39577b79564e0896.js.map.gz} +0 -0
- package/dist/server/web-ui/_expo/static/js/web/{indexeddb-attachment-store-54584275ea7a32061741c119074ff13f.js → indexeddb-attachment-store-35fb4ddfe925b1fb6b7a6c1953b21621.js} +3 -3
- package/dist/server/web-ui/_expo/static/js/web/indexeddb-attachment-store-35fb4ddfe925b1fb6b7a6c1953b21621.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/indexeddb-attachment-store-35fb4ddfe925b1fb6b7a6c1953b21621.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/indexeddb-attachment-store-35fb4ddfe925b1fb6b7a6c1953b21621.js.map.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/indexeddb-attachment-store-35fb4ddfe925b1fb6b7a6c1953b21621.js.map.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/{native-file-attachment-store-b53f2ba81a9777f6f6d04a98b0a12c33.js → native-file-attachment-store-8602ccac919e2b56f2e9a252dd06483e.js} +5 -5
- package/dist/server/web-ui/_expo/static/js/web/native-file-attachment-store-8602ccac919e2b56f2e9a252dd06483e.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/native-file-attachment-store-8602ccac919e2b56f2e9a252dd06483e.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/native-file-attachment-store-8602ccac919e2b56f2e9a252dd06483e.js.map.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/native-file-attachment-store-8602ccac919e2b56f2e9a252dd06483e.js.map.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/{profiler-7b2011c26cedb58cc00c02a7c25fc0a0.js → profiler-b3dd30ba0a88aece50e7e403785f34ba.js} +11 -11
- package/dist/server/web-ui/_expo/static/js/web/profiler-b3dd30ba0a88aece50e7e403785f34ba.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/profiler-b3dd30ba0a88aece50e7e403785f34ba.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/profiler-b3dd30ba0a88aece50e7e403785f34ba.js.map.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/profiler-b3dd30ba0a88aece50e7e403785f34ba.js.map.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/{startRecording-1b57837c4c358ef963a1392d9d96354b.js → startRecording-fd9fa11e24a3b8d94e5161aae7f42a5d.js} +60 -60
- package/dist/server/web-ui/_expo/static/js/web/startRecording-fd9fa11e24a3b8d94e5161aae7f42a5d.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/startRecording-fd9fa11e24a3b8d94e5161aae7f42a5d.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/startRecording-fd9fa11e24a3b8d94e5161aae7f42a5d.js.map.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/{startRecording-1b57837c4c358ef963a1392d9d96354b.js.map.gz → startRecording-fd9fa11e24a3b8d94e5161aae7f42a5d.js.map.gz} +0 -0
- package/dist/server/web-ui/index.html +1 -1
- package/dist/server/web-ui/index.html.br +0 -0
- package/dist/server/web-ui/index.html.gz +0 -0
- package/package.json +6 -6
- package/dist/server/web-ui/_expo/static/js/web/desktop-attachment-bridge-9f03d060da06e8838a4e0fdd5c067757.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/desktop-attachment-bridge-9f03d060da06e8838a4e0fdd5c067757.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/desktop-attachment-bridge-9f03d060da06e8838a4e0fdd5c067757.js.map.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/desktop-attachment-bridge-9f03d060da06e8838a4e0fdd5c067757.js.map.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/desktop-attachment-store-d0d9dffa612bf12bf551c5e513c28691.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/desktop-attachment-store-d0d9dffa612bf12bf551c5e513c28691.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/desktop-attachment-store-d0d9dffa612bf12bf551c5e513c28691.js.map.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/desktop-attachment-store-d0d9dffa612bf12bf551c5e513c28691.js.map.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/index-5a54792f78b8475572ccfac9808dd926.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/index-5a54792f78b8475572ccfac9808dd926.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/index-5a54792f78b8475572ccfac9808dd926.js.map.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/indexeddb-attachment-store-54584275ea7a32061741c119074ff13f.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/indexeddb-attachment-store-54584275ea7a32061741c119074ff13f.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/indexeddb-attachment-store-54584275ea7a32061741c119074ff13f.js.map.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/indexeddb-attachment-store-54584275ea7a32061741c119074ff13f.js.map.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/native-file-attachment-store-b53f2ba81a9777f6f6d04a98b0a12c33.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/native-file-attachment-store-b53f2ba81a9777f6f6d04a98b0a12c33.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/native-file-attachment-store-b53f2ba81a9777f6f6d04a98b0a12c33.js.map.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/native-file-attachment-store-b53f2ba81a9777f6f6d04a98b0a12c33.js.map.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/profiler-7b2011c26cedb58cc00c02a7c25fc0a0.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/profiler-7b2011c26cedb58cc00c02a7c25fc0a0.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/profiler-7b2011c26cedb58cc00c02a7c25fc0a0.js.map.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/profiler-7b2011c26cedb58cc00c02a7c25fc0a0.js.map.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/startRecording-1b57837c4c358ef963a1392d9d96354b.js.br +0 -0
- package/dist/server/web-ui/_expo/static/js/web/startRecording-1b57837c4c358ef963a1392d9d96354b.js.gz +0 -0
- package/dist/server/web-ui/_expo/static/js/web/startRecording-1b57837c4c358ef963a1392d9d96354b.js.map.br +0 -0
|
@@ -378,13 +378,13 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
|
|
|
378
378
|
__d(function(g,_r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SYNTAX_THEME_IDS",{enumerable:!0,get:function(){return r}}),Object.defineProperty(e,"SYNTAX_THEME_OPTIONS",{enumerable:!0,get:function(){return n}}),e.isSyntaxThemeId=function(t){return r.includes(t)},e.resolveSyntaxColors=function(r,n){const x="dark"===n;switch(r){case"github":return x?t.darkHighlightColors:t.lightHighlightColors;case"catppuccin":return b(x?c:o);case"dracula":return b(f);case"tokyo-night":return b(x?s:u);case"one":return b(x?l:p);case"nord":return b(x?k:y);case"gruvbox":return b(x?h:w);case"solarized":return b(x?_:v)}};var t=_r(d[0]);const r=["github","catppuccin","dracula","tokyo-night","one","nord","gruvbox","solarized"],n=[{id:"github",label:"GitHub"},{id:"catppuccin",label:"Catppuccin"},{id:"dracula",label:"Dracula"},{id:"tokyo-night",label:"Tokyo Night"},{id:"one",label:"One"},{id:"nord",label:"Nord"},{id:"gruvbox",label:"Gruvbox"},{id:"solarized",label:"Solarized"}];function b(t){return{keyword:t.keyword,comment:t.comment,string:t.string,number:t.number,literal:t.number,function:t.function,definition:t.function,class:t.type,type:t.type,tag:t.tag,attribute:t.attribute,property:t.attribute,variable:t.base,operator:t.operator,punctuation:t.base,regexp:t.string,escape:t.number,meta:t.comment,heading:t.function,link:t.string}}const o={base:"#4c4f69",keyword:"#8839ef",comment:"#8c8fa1",string:"#40a02b",number:"#fe640b",function:"#1e66f5",type:"#df8e1d",tag:"#8839ef",attribute:"#df8e1d",operator:"#04a5e5"},c={base:"#cdd6f4",keyword:"#cba6f7",comment:"#9399b2",string:"#a6e3a1",number:"#fab387",function:"#89b4fa",type:"#f9e2af",tag:"#cba6f7",attribute:"#f9e2af",operator:"#89dceb"},f={base:"#f8f8f2",keyword:"#ff79c6",comment:"#6272a4",string:"#f1fa8c",number:"#bd93f9",function:"#50fa7b",type:"#8be9fd",tag:"#ff79c6",attribute:"#50fa7b",operator:"#ff79c6"},u={base:"#3760bf",keyword:"#9854f1",comment:"#848cb5",string:"#587539",number:"#b15c00",function:"#2e7de9",type:"#007197",tag:"#f52a65",attribute:"#8c6c3e",operator:"#006a83"},s={base:"#c0caf5",keyword:"#bb9af7",comment:"#565f89",string:"#9ece6a",number:"#ff9e64",function:"#7aa2f7",type:"#2ac3de",tag:"#f7768e",attribute:"#e0af68",operator:"#89ddff"},p={base:"#383a42",keyword:"#a626a4",comment:"#a0a1a7",string:"#50a14f",number:"#986801",function:"#4078f2",type:"#c18401",tag:"#e45649",attribute:"#986801",operator:"#0184bc"},l={base:"#abb2bf",keyword:"#c678dd",comment:"#5c6370",string:"#98c379",number:"#d19a66",function:"#61afef",type:"#e5c07b",tag:"#e06c75",attribute:"#d19a66",operator:"#56b6c2"},y={base:"#2e3440",keyword:"#5e81ac",comment:"#6b7280",string:"#4f6f3a",number:"#8f5e91",function:"#2e6f8e",type:"#3b7f87",tag:"#5e81ac",attribute:"#8f5e91",operator:"#5e81ac"},k={base:"#d8dee9",keyword:"#81a1c1",comment:"#616e88",string:"#a3be8c",number:"#b48ead",function:"#88c0d0",type:"#8fbcbb",tag:"#81a1c1",attribute:"#8fbcbb",operator:"#81a1c1"},w={base:"#3c3836",keyword:"#9d0006",comment:"#928374",string:"#79740e",number:"#8f3f71",function:"#427b58",type:"#b57614",tag:"#076678",attribute:"#b57614",operator:"#af3a03"},h={base:"#ebdbb2",keyword:"#fb4934",comment:"#928374",string:"#b8bb26",number:"#d3869b",function:"#8ec07c",type:"#fabd2f",tag:"#83a598",attribute:"#fabd2f",operator:"#fe8019"},v={base:"#657b83",keyword:"#859900",comment:"#93a1a1",string:"#2aa198",number:"#d33682",function:"#268bd2",type:"#b58900",tag:"#268bd2",attribute:"#b58900",operator:"#859900"},_={base:"#839496",keyword:"#859900",comment:"#586e75",string:"#2aa198",number:"#d33682",function:"#268bd2",type:"#b58900",tag:"#268bd2",attribute:"#b58900",operator:"#859900"}},337,[336]);
|
|
379
379
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.initSentry=function(){}},338,[]);
|
|
380
380
|
__d(function(g,r,i,a,m,e,d){"use strict";r(d[0])},339,[340]);
|
|
381
|
-
__d(function(g,r,i,a,m,e,d){"use strict";r(d[0]);var n=r(d[1]);(0,r(d[2]).renderRootComponent)(n.App)},340,[341,344,
|
|
381
|
+
__d(function(g,r,i,a,m,e,d){"use strict";r(d[0]);var n=r(d[1]);(0,r(d[2]).renderRootComponent)(n.App)},340,[341,344,4778]);
|
|
382
382
|
__d(function(g,r,i,a,m,e,d){"use strict";r(d[0]),r(d[1])},341,[342,343]);
|
|
383
383
|
__d(function(g,r,i,a,m,e,d){},342,[]);
|
|
384
384
|
__d(function(g,r,i,a,m,e,d){const _='undefined'==typeof window;globalThis.__webpack_chunk_load__=_=>g[`${__METRO_GLOBAL_PREFIX__}__loadBundleAsync`](_),globalThis.__webpack_require__=o=>{const t=ErrorUtils.reportFatalError;_&&(ErrorUtils.reportFatalError=_=>{throw _});try{return g[`${__METRO_GLOBAL_PREFIX__}__r`](o)}finally{_&&(ErrorUtils.reportFatalError=t)}}},343,[]);
|
|
385
|
-
__d(function(g,r,i,a,m,e,d){"use strict";var t=r(d[0]),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.App=function(){return t.jsx(c.Head.Provider,{children:t.jsx(u.ExpoRoot,{context:n.ctx})})};const n=r(d[1]),u=(o(r(d[2])),r(d[3])),c=r(d[4]);r(d[5])},344,[279,345,36,1510,
|
|
385
|
+
__d(function(g,r,i,a,m,e,d){"use strict";var t=r(d[0]),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.App=function(){return t.jsx(c.Head.Provider,{children:t.jsx(u.ExpoRoot,{context:n.ctx})})};const n=r(d[1]),u=(o(r(d[2])),r(d[3])),c=r(d[4]);r(d[5])},344,[279,345,36,1510,4772,4777]);
|
|
386
386
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ctx",{enumerable:!0,get:function(){return t}});const t=r(d[0])},345,[346]);
|
|
387
|
-
__d(function(g,r,i,a,m,e,d){const t=Object.defineProperties({},{"./_layout.tsx":{enumerable:!0,get:()=>r(d[0])},"./agent/[agentId].tsx":{enumerable:!0,get:()=>r(d[1])},"./h/[serverId]/_layout.tsx":{enumerable:!0,get:()=>r(d[2])},"./h/[serverId]/agent/[agentId].tsx":{enumerable:!0,get:()=>r(d[3])},"./h/[serverId]/agents.tsx":{enumerable:!0,get:()=>r(d[4])},"./h/[serverId]/index.tsx":{enumerable:!0,get:()=>r(d[5])},"./h/[serverId]/kanban.tsx":{enumerable:!0,get:()=>r(d[6])},"./h/[serverId]/meetings.tsx":{enumerable:!0,get:()=>r(d[7])},"./h/[serverId]/meetings/[meetingId].tsx":{enumerable:!0,get:()=>r(d[8])},"./h/[serverId]/open-project.tsx":{enumerable:!0,get:()=>r(d[9])},"./h/[serverId]/preview/[agentId]/[toolCallId].tsx":{enumerable:!0,get:()=>r(d[10])},"./h/[serverId]/sessions.tsx":{enumerable:!0,get:()=>r(d[11])},"./h/[serverId]/settings.tsx":{enumerable:!0,get:()=>r(d[12])},"./h/[serverId]/workspace/[workspaceId]/index.tsx":{enumerable:!0,get:()=>r(d[13])},"./h/[serverId]/workspace/[workspaceId]/workflows/[workflowId].tsx":{enumerable:!0,get:()=>r(d[14])},"./index.tsx":{enumerable:!0,get:()=>r(d[15])},"./is-ipad-two-column.ts":{enumerable:!0,get:()=>r(d[16])},"./new.tsx":{enumerable:!0,get:()=>r(d[17])},"./open-project.tsx":{enumerable:!0,get:()=>r(d[18])},"./pair-scan.tsx":{enumerable:!0,get:()=>r(d[19])},"./schedules.tsx":{enumerable:!0,get:()=>r(d[20])},"./sessions.tsx":{enumerable:!0,get:()=>r(d[21])},"./settings/[section].tsx":{enumerable:!0,get:()=>r(d[22])},"./settings/hosts/[serverId]/[hostSection].tsx":{enumerable:!0,get:()=>r(d[23])},"./settings/hosts/[serverId]/index.tsx":{enumerable:!0,get:()=>r(d[24])},"./settings/index.tsx":{enumerable:!0,get:()=>r(d[25])},"./settings/projects/[projectKey].tsx":{enumerable:!0,get:()=>r(d[26])},"./settings/projects/index.tsx":{enumerable:!0,get:()=>r(d[27])},"./welcome.tsx":{enumerable:!0,get:()=>r(d[28])}});function s(s){return t[s]}s.keys=function(){return Object.keys(t)},s.resolve=function(t){throw new Error('Unimplemented Metro module context functionality')},m.exports=s},346,[347,4394,4395,4398,4404,4415,4416,4420,4428,4435,4436,4450,4451,4452,
|
|
387
|
+
__d(function(g,r,i,a,m,e,d){const t=Object.defineProperties({},{"./_layout.tsx":{enumerable:!0,get:()=>r(d[0])},"./agent/[agentId].tsx":{enumerable:!0,get:()=>r(d[1])},"./h/[serverId]/_layout.tsx":{enumerable:!0,get:()=>r(d[2])},"./h/[serverId]/agent/[agentId].tsx":{enumerable:!0,get:()=>r(d[3])},"./h/[serverId]/agents.tsx":{enumerable:!0,get:()=>r(d[4])},"./h/[serverId]/index.tsx":{enumerable:!0,get:()=>r(d[5])},"./h/[serverId]/kanban.tsx":{enumerable:!0,get:()=>r(d[6])},"./h/[serverId]/meetings.tsx":{enumerable:!0,get:()=>r(d[7])},"./h/[serverId]/meetings/[meetingId].tsx":{enumerable:!0,get:()=>r(d[8])},"./h/[serverId]/open-project.tsx":{enumerable:!0,get:()=>r(d[9])},"./h/[serverId]/preview/[agentId]/[toolCallId].tsx":{enumerable:!0,get:()=>r(d[10])},"./h/[serverId]/sessions.tsx":{enumerable:!0,get:()=>r(d[11])},"./h/[serverId]/settings.tsx":{enumerable:!0,get:()=>r(d[12])},"./h/[serverId]/workspace/[workspaceId]/index.tsx":{enumerable:!0,get:()=>r(d[13])},"./h/[serverId]/workspace/[workspaceId]/workflows/[workflowId].tsx":{enumerable:!0,get:()=>r(d[14])},"./index.tsx":{enumerable:!0,get:()=>r(d[15])},"./is-ipad-two-column.ts":{enumerable:!0,get:()=>r(d[16])},"./new.tsx":{enumerable:!0,get:()=>r(d[17])},"./open-project.tsx":{enumerable:!0,get:()=>r(d[18])},"./pair-scan.tsx":{enumerable:!0,get:()=>r(d[19])},"./schedules.tsx":{enumerable:!0,get:()=>r(d[20])},"./sessions.tsx":{enumerable:!0,get:()=>r(d[21])},"./settings/[section].tsx":{enumerable:!0,get:()=>r(d[22])},"./settings/hosts/[serverId]/[hostSection].tsx":{enumerable:!0,get:()=>r(d[23])},"./settings/hosts/[serverId]/index.tsx":{enumerable:!0,get:()=>r(d[24])},"./settings/index.tsx":{enumerable:!0,get:()=>r(d[25])},"./settings/projects/[projectKey].tsx":{enumerable:!0,get:()=>r(d[26])},"./settings/projects/index.tsx":{enumerable:!0,get:()=>r(d[27])},"./welcome.tsx":{enumerable:!0,get:()=>r(d[28])}});function s(s){return t[s]}s.keys=function(){return Object.keys(t)},s.resolve=function(t){throw new Error('Unimplemented Metro module context functionality')},m.exports=s},346,[347,4394,4395,4398,4404,4415,4416,4420,4428,4435,4436,4450,4451,4452,4643,4644,1570,4645,4654,4688,4703,4717,4721,4765,4766,4767,4768,4769,4770]);
|
|
388
388
|
__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t}function t(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return Tt}}),_e.useEarliestOnlineHostServerId=Xe,_e.useStoreReady=Ve,_e.useHostRuntimeBootstrapState=function(){return(0,S.useContext)(Ce)};var n=r(_d[0]),o=r(_d[1]);r(_d[2]);var s=r(_d[3]),l=r(_d[4]),c=r(_d[5]),u=e(r(_d[6])),d=e(r(_d[7])),h=r(_d[8]),S=r(_d[9]),f=(t(r(_d[10])),t(r(_d[11])));r(_d[12]);var _=r(_d[13]),p=r(_d[14]),v=r(_d[15]),b=r(_d[16]),y=r(_d[17]),x=r(_d[18]),k=r(_d[19]),w=r(_d[20]),O=r(_d[21]),j=r(_d[22]),E=r(_d[23]),P=r(_d[24]),I=r(_d[25]),D=r(_d[26]),T=r(_d[27]),F=r(_d[28]),W=r(_d[29]),C=r(_d[30]),H=r(_d[31]),A=r(_d[32]),R=r(_d[33]),G=r(_d[34]),L=r(_d[35]),X=r(_d[36]),M=r(_d[37]),B=r(_d[38]),z=r(_d[39]),N=r(_d[40]),Y=r(_d[41]),J=r(_d[42]),U=r(_d[43]),V=r(_d[44]),K=r(_d[45]),$=r(_d[46]),q=r(_d[47]),Q=r(_d[48]),Z=r(_d[49]),ee=r(_d[50]),te=r(_d[51]),ne=r(_d[52]),oe=r(_d[53]),re=r(_d[54]),se=r(_d[55]),ae=r(_d[56]),ie=r(_d[57]),le=r(_d[58]),ce=r(_d[59]),ue=r(_d[60]),de=r(_d[61]),he=r(_d[62]),Se=r(_d[63]),me=r(_d[64]),fe=r(_d[65]),pe=r(_d[66]),ge=r(_d[67]),ve=r(_d[68]),be=r(_d[69]),ye=r(_d[70]),xe=r(_d[71]),ke=r(_d[72]),we=r(_d[73]),Oe=r(_d[74]),je=r(_d[75]),Ee=r(_d[76]),Pe=r(_d[77]),Ie=r(_d[78]),De=r(_d[79]),Te=r(_d[80]),Fe=r(_d[81]),We=r(_d[82]);(0,ve.polyfillCrypto)(),(0,Fe.initializeDatadog)();const Ce=(0,S.createContext)({splashError:null,retry:()=>{},hasGivenUpWaitingForHost:!1,storeReady:!1,startupBlocker:{kind:"none"}});function He(){const e=(0,o.c)(5),t=(0,h.useRouter)(),n=(0,S.useRef)(null);let s;(0,Z.useDatadogViewTracking)(),e[0]!==t?(s=e=>{const n=(0,Ie.resolveNotificationTarget)(e),o=n.serverId,s=n.agentId;o&&s?(0,De.navigateToAgent)({serverId:o,agentId:s,pin:!0}):t.navigate((0,Ie.buildNotificationRoute)(e))},e[0]=t,e[1]=s):s=e[1];const l=(0,fe.useStableEvent)(s);let c,u;return e[2]!==l?(c=()=>{if(L.isWeb){let e=null,t=!1;if((0,G.getIsElectronRuntime)()){(0,Te.ensureOsNotificationPermission)();const n=(0,oe.getDesktopHost)()?.events?.on?.("notification-click",e=>{const t="object"==typeof e&&null!==e&&"data"in e&&"object"==typeof e.data&&null!==e.data?e.data:void 0;l(t)});Promise.resolve(n).then(n=>{"function"==typeof n&&(t?n():e=n)})}const n=e=>{const t=e;e.preventDefault(),l(t.detail?.data)};return window.addEventListener(Te.WEB_NOTIFICATION_CLICK_EVENT,n),()=>{t=!0,e?.(),window.removeEventListener(Te.WEB_NOTIFICATION_CLICK_EVENT,n)}}d.setNotificationHandler({handleNotification:Ae}),(0,Q.registerNotificationCategories)(),(0,$.registerBackgroundAgentStateFetch)(),(0,q.registerLiveActivities)();const e=e=>{const t=e.notification.request.identifier;n.current!==t&&(n.current=t,(0,K.handlePermissionNotificationResponse)(e).then(t=>{if(t.handled)return;const n=e.notification.request.content.data;l(n)}))},t=d.addNotificationResponseReceivedListener(e);return d.getLastNotificationResponseAsync().then(t=>{t&&e(t)}),()=>{t.remove()}},u=[l],e[2]=l,e[3]=c,e[4]=u):(c=e[3],u=e[4]),(0,S.useEffect)(c,u),null}async function Ae(){return{shouldShowAlert:!1,shouldShowBanner:!1,shouldShowList:!1,shouldPlaySound:!1,shouldSetBadge:!1}}function Re(e){const t=(0,o.c)(3),{daemon:n}=e,s=(0,ye.useHostRuntimeClient)(n.serverId);if(!s)return null;let l;return t[0]!==s||t[1]!==n.serverId?(l=(0,We.jsx)(M.SessionProvider,{serverId:n.serverId,client:s,children:null},n.serverId),t[0]=s,t[1]=n.serverId,t[2]=l):l=t[2],l}function Ge(){const e=(0,o.c)(4),t=(0,ye.useHosts)();if(0===t.length)return null;let n,s;return e[0]!==t?(n=t.map(Le),e[0]=t,e[1]=n):n=e[1],e[2]!==n?(s=(0,We.jsx)(We.Fragment,{children:n}),e[2]=n,e[3]=s):s=e[3],s}function Le(e){return(0,We.jsx)(Re,{daemon:e},e.serverId)}function Xe(){const e=(0,o.c)(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,ye.getHostRuntimeStore)(),e[0]=t):t=e[0];const n=t;let s;e[1]===Symbol.for("react.memo_cache_sentinel")?(s=e=>{const t=n.subscribeAll(e),o=n.subscribeHostList(e);return()=>{t(),o()}},e[1]=s):s=e[1];const l=s;let c,u;return e[2]===Symbol.for("react.memo_cache_sentinel")?(c=()=>n.getEarliestOnlineHostServerId(),u=()=>n.getEarliestOnlineHostServerId(),e[2]=c,e[3]=u):(c=e[2],u=e[3]),(0,S.useSyncExternalStore)(l,c,u)}function Me(){const e=(0,o.c)(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,xe.getDaemonStartService)({store:(0,ye.getHostRuntimeStore)()}),e[0]=t):t=e[0];const n=t;let s,l,c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s=e=>n.subscribe(e),l=()=>n.getLastError(),c=()=>n.getLastError(),e[1]=s,e[2]=l,e[3]=c):(s=e[1],l=e[2],c=e[3]),(0,S.useSyncExternalStore)(s,l,c)}function Be(){const e=(0,o.c)(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,xe.getDaemonStartService)({store:(0,ye.getHostRuntimeStore)()}),e[0]=t):t=e[0];const n=t;let s,l,c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(s=e=>n.subscribe(e),l=()=>n.isRunning(),c=()=>n.isRunning(),e[1]=s,e[2]=l,e[3]=c):(s=e[1],l=e[2],c=e[3]),(0,S.useSyncExternalStore)(s,l,c)}const ze=5e3;async function Ne(){if(!(0,ee.shouldUseDesktopDaemon)())return!1;if((0,ye.hasConfiguredLocalDaemonOverride)())return!1;return(await(0,re.loadDesktopSettings)()).daemon.manageBuiltInDaemon}function Ye(e){const t=(0,o.c)(23),{children:n}=e;let s;t[0]===Symbol.for("react.memo_cache_sentinel")?(s=[],t[0]=s):s=t[0],(0,S.useEffect)(Ue,s);const l=Xe(),c=Me(),u=Be(),[d,h]=(0,S.useState)(!1);let f;t[1]===Symbol.for("react.memo_cache_sentinel")?(f=(0,ee.shouldUseDesktopDaemon)(),t[1]=f):f=t[1];const _=f;let p;t[2]!==l||t[3]!==c||t[4]!==u?(p=(0,U.resolveStartupBlocker)({isDesktopRuntime:_,anyOnlineHostServerId:l,daemonStartIsRunning:u,daemonStartError:c}),t[2]=l,t[3]=c,t[4]=u,t[5]=p):p=t[5];const v=p;let b;t[6]!==l||t[7]!==d||t[8]!==v?(b=(0,U.shouldRunStartupGiveUpTimer)({startupBlocker:v,anyOnlineHostServerId:l,hasGivenUpWaitingForHost:d}),t[6]=l,t[7]=d,t[8]=v,t[9]=b):b=t[9];const y=b;let x,k;t[10]!==y?(x=()=>{if(!y)return;const e=setTimeout(()=>{h(!0)},ze);return()=>{clearTimeout(e)}},k=[y],t[10]=y,t[11]=x,t[12]=k):(x=t[11],k=t[12]),(0,S.useEffect)(x,k);const w=Je,O="managed-daemon-error"===v.kind?v.message:null;let j;t[13]!==v?(j=(0,U.resolveStartupNavigationReady)({startupBlocker:v}),t[13]=v,t[14]=j):j=t[14];const E=j;let P;t[15]!==d||t[16]!==O||t[17]!==v||t[18]!==E?(P={splashError:O,retry:w,hasGivenUpWaitingForHost:d,storeReady:E,startupBlocker:v},t[15]=d,t[16]=O,t[17]=v,t[18]=E,t[19]=P):P=t[19];const I=P;let D;return t[20]!==n||t[21]!==I?(D=(0,We.jsx)(Ce.Provider,{value:I,children:n}),t[20]=n,t[21]=I,t[22]=D):D=t[22],D}function Je(){const e=(0,xe.getDaemonStartService)({store:(0,ye.getHostRuntimeStore)()});(0,U.startDaemonIfGateAllows)({daemonStartService:e,shouldStartDaemon:Ne,onGateError:t=>e.recordError(t)})}function Ue(){const e=(0,ye.getHostRuntimeStore)(),t=(0,xe.getDaemonStartService)({store:e});(0,U.startHostRuntimeBootstrap)({store:e,daemonStartService:t,shouldStartDaemon:Ne,onGateError:e=>t.recordError(e)})}function Ve(){return(0,S.useContext)(Ce).storeReady}function Ke(e){const t=(0,o.c)(2),{children:n}=e;let s;return t[0]!==n?(s=(0,We.jsx)(c.QueryClientProvider,{client:be.queryClient,children:n}),t[0]=n,t[1]=s):s=t[1],s}const $e={flex:1,flexDirection:"row"},qe={flex:1},Qe=32,Ze=L.isWeb?"auto":"pan-y",et=["dark","zinc","midnight","claude","ghostty","light"];function tt(e){const t=(0,o.c)(58),{children:s,selectedAgentId:l,chromeEnabled:c}=e,u=(0,ye.useHosts)(),{settings:d,updateSettings:S}=(0,me.useAppSettings)(),_=(0,we.usePanelStore)(ct),p=(0,we.usePanelStore)(lt),v=(0,we.usePanelStore)(it),b=(0,we.usePanelStore)(at),y=(0,we.usePanelStore)(st),O=(0,we.usePanelStore)(rt),L=(0,we.usePanelStore)(ot);let X;t[0]!==d.theme||t[1]!==S?(X=()=>{const e=(et.indexOf(d.theme)+1)%et.length;S({theme:et[e]})},t[0]=d.theme,t[1]=S,t[2]=X):X=t[2];const M=X,z=(0,G.useIsCompactFormFactor)(),N=(0,f.default)(),Y=!1;let J;t[3]!==N.height||t[4]!==N.width?(J=(0,x.resolveColumnMode)({width:N.width,height:N.height,isTablet:Y}),t[3]=N.height,t[4]=N.width,t[5]=J):J=t[5];const U=z||Y;(0,he.useCompactWebViewportZoomLock)(U);const V=(0,h.usePathname)(),K=c??u.length>0,$=U?_:p;let q;t[6]!==b||t[7]!==y||t[8]!==v?(q=()=>{const{desktop:e}=we.usePanelStore.getState();(0,je.toggleDesktopSidebarsWithCheckoutIntent)({isAgentListOpen:e.agentListOpen,isFileExplorerOpen:e.fileExplorerOpen,openAgentList:v,closeAgentList:b,closeFileExplorer:y,toggleFocusedFileExplorer:nt})},t[6]=b,t[7]=y,t[8]=v,t[9]=q):q=t[9];const Q=q;let Z;t[10]!==K||t[11]!==V?(Z=K||V.startsWith("/settings"),t[10]=K,t[11]=V,t[12]=Z):Z=t[12];const ee=Z;let te,ne,oe,re;t[13]!==M||t[14]!==U||t[15]!==ee||t[16]!==$||t[17]!==Q||t[18]!==O?(te={enabled:ee,isMobile:U,toggleAgentList:$,toggleBothSidebars:Q,toggleFocusMode:O,cycleTheme:M},t[13]=M,t[14]=U,t[15]=ee,t[16]=$,t[17]=Q,t[18]=O,t[19]=te):te=t[19],(0,ue.useKeyboardShortcuts)(te),(0,ie.useActiveWorktreeNewAction)(),(0,le.useGlobalNewWorkspaceAction)(),t[20]!==K||t[21]!==U||t[22]!==L||t[23]!==l?(ne=!U&&K&&!L&&(0,We.jsx)(D.LeftSidebar,{selectedAgentId:l}),t[20]=K,t[21]=U,t[22]=L,t[23]=l,t[24]=ne):ne=t[24],t[25]!==s||t[26]!==K||t[27]!==U?(oe=U&&K?(0,We.jsx)(B.ExplorerSidebarAnimationProvider,{children:(0,We.jsx)(T.CompactExplorerSidebarHost,{enabled:K,children:(0,We.jsx)(n.View,{style:qe,children:s})})}):(0,We.jsx)(n.View,{style:qe,children:s}),t[25]=s,t[26]=K,t[27]=U,t[28]=oe):oe=t[28],t[29]!==ne||t[30]!==oe?(re=(0,We.jsxs)(n.View,{style:$e,children:[ne,oe]}),t[29]=ne,t[30]=oe,t[31]=re):re=t[31];const ce=re;let de,Se,fe,pe,ge,ve,be,xe,ke,Oe,Ee,Pe,Ie,De,Te,Fe;t[32]===Symbol.for("react.memo_cache_sentinel")?(de=(0,We.jsx)(w.DaemonConnectionBanner,{}),t[32]=de):de=t[32],t[33]===Symbol.for("react.memo_cache_sentinel")?(Se=(0,We.jsx)(A.FloatingPanelPortalHost,{}),t[33]=Se):Se=t[33],t[34]!==K||t[35]!==U||t[36]!==l?(fe=U&&K&&(0,We.jsx)(D.LeftSidebar,{selectedAgentId:l}),t[34]=K,t[35]=U,t[36]=l,t[37]=fe):fe=t[37],t[38]===Symbol.for("react.memo_cache_sentinel")?(pe=(0,We.jsx)(E.DownloadToast,{}),ge=(0,We.jsx)(se.RosettaCalloutSource,{}),ve=(0,We.jsx)(ae.UpdateCalloutSource,{}),be=(0,We.jsx)(j.WorktreeSetupCalloutSource,{}),xe=(0,We.jsx)(k.CommandCenter,{}),ke=(0,We.jsx)(R.HostChooserModal,{}),Oe=(0,We.jsx)(F.ProjectPickerModal,{}),Ee=(0,We.jsx)(W.ProviderSettingsHost,{}),t[38]=pe,t[39]=ge,t[40]=ve,t[41]=be,t[42]=xe,t[43]=ke,t[44]=Oe,t[45]=Ee):(pe=t[38],ge=t[39],ve=t[40],be=t[41],xe=t[42],ke=t[43],Oe=t[44],Ee=t[45]),t[46]!==ee?(Pe=(0,We.jsx)(H.WorkspaceShortcutTargetsSubscriber,{enabled:ee}),t[46]=ee,t[47]=Pe):Pe=t[47],t[48]===Symbol.for("react.memo_cache_sentinel")?(Ie=(0,We.jsx)(C.WorkspaceSetupDialog,{}),De=(0,We.jsx)(I.KeyboardShortcutsDialog,{}),Te=(0,We.jsx)(P.QuittingOverlay,{}),t[48]=Ie,t[49]=De,t[50]=Te):(Ie=t[48],De=t[49],Te=t[50]),t[51]!==fe||t[52]!==Pe||t[53]!==ce?(Fe=(0,We.jsxs)(n.View,{style:Ft.surfaceFill,children:[de,ce,Se,fe,pe,ge,ve,be,xe,ke,Oe,Ee,Pe,Ie,De,Te]}),t[51]=fe,t[52]=Pe,t[53]=ce,t[54]=Fe):Fe=t[54];const Ce=Fe;if(!U)return Ce;let He;return t[55]!==K||t[56]!==Ce?(He=(0,We.jsx)(_t,{chromeEnabled:K,children:Ce}),t[55]=K,t[56]=Ce,t[57]=He):He=t[57],He}function nt(){return ge.keyboardActionDispatcher.dispatch({id:"sidebar.toggle.right",scope:"sidebar"})}function ot(e){return e.desktop.focusModeEnabled}function rt(e){return e.toggleFocusMode}function st(e){return e.closeDesktopFileExplorer}function at(e){return e.closeDesktopAgentList}function it(e){return e.openDesktopAgentList}function lt(e){return e.toggleDesktopAgentList}function ct(e){return e.toggleMobileAgentList}const ut={code:"function _layoutTsx1(){const{isGesturing,runOnJS,setOverlayPeek}=this.__closure;isGesturing.value=false;runOnJS(setOverlayPeek)(false);}"},dt={code:"function _layoutTsx2(event_2){const{isGesturing,windowWidth,animateToOpen,runOnJS,handleGestureOpen,animateToClose}=this.__closure;isGesturing.value=false;const shouldOpen=event_2.translationX>windowWidth/3||event_2.velocityX>500;if(shouldOpen){animateToOpen();runOnJS(handleGestureOpen)();}else{animateToClose();}}"},ht={code:"function _layoutTsx3(event_1){const{windowWidth,translateX,backdropOpacity,interpolate,Extrapolation}=this.__closure;const newTranslateX=Math.min(0,-windowWidth+event_1.translationX);translateX.value=newTranslateX;backdropOpacity.value=interpolate(newTranslateX,[-windowWidth,0],[0,1],Extrapolation.CLAMP);}"},St={code:"function _layoutTsx4(){const{isGesturing,runOnJS,setOverlayPeek}=this.__closure;isGesturing.value=true;runOnJS(setOverlayPeek)(true);}"},mt={code:"function _layoutTsx5(event_0,stateManager){const{touchStartX,touchStartY,canOpenLeftSidebarGesture,mobilePanelState,translateX,windowWidth,horizontalScroll,isWeb,MOBILE_WEB_EDGE_SWIPE_WIDTH}=this.__closure;var _horizontalScroll;const touch_0=event_0.changedTouches[0];if(!touch_0||event_0.numberOfTouches!==1)return;const deltaX=touch_0.absoluteX-touchStartX.value;const deltaY=touch_0.absoluteY-touchStartY.value;const absDeltaX=Math.abs(deltaX);const absDeltaY=Math.abs(deltaY);if(!canOpenLeftSidebarGesture(mobilePanelState.value,translateX.value,windowWidth)){stateManager.fail();return;}if((_horizontalScroll=horizontalScroll)!==null&&_horizontalScroll!==void 0&&_horizontalScroll.isAnyScrolledRight.value){stateManager.fail();return;}if(isWeb&&touchStartX.value>MOBILE_WEB_EDGE_SWIPE_WIDTH){stateManager.fail();return;}if(deltaX<=-10){stateManager.fail();return;}if(absDeltaY>10&&absDeltaY>absDeltaX){stateManager.fail();return;}if(deltaX>15&&absDeltaX>absDeltaY){stateManager.activate();}}"},ft={code:"function _layoutTsx6(event){const{touchStartX,touchStartY}=this.__closure;const touch=event.changedTouches[0];if(touch){touchStartX.value=touch.absoluteX;touchStartY.value=touch.absoluteY;}}"};function _t({children:e,chromeEnabled:t}){const n=(0,we.usePanelStore)(e=>e.showMobileAgentList),o=(0,X.useHorizontalScrollOptional)(),{translateX:s,backdropOpacity:l,windowWidth:c,animateToOpen:u,animateToClose:d,setOverlayPeek:h,isGesturing:f,mobilePanelState:p,gestureAnimatingRef:b,openGestureRef:y}=(0,z.useSidebarAnimation)(),x=(0,v.useSharedValue)(0),k=(0,v.useSharedValue)(0),w=t,O=(0,S.useCallback)(()=>{b.current=!0,n()},[n,b]),j=(0,S.useMemo)(()=>_.Gesture.Pan().withRef(y).enabled(w).manualActivation(!0).failOffsetY([-10,10]).onTouchesDown((function({_worklet_1615879058013_init_data:e,touchStartX:t,touchStartY:n}){const o=function(e){const o=e.changedTouches[0];o&&(t.value=o.absoluteX,n.value=o.absoluteY)};return o.__closure={touchStartX:t,touchStartY:n},o.__workletHash=1615879058013,o.__initData=e,o})({_worklet_1615879058013_init_data:ft,touchStartX:x,touchStartY:k})).onTouchesMove((function({_worklet_8337771416778_init_data:e,touchStartX:t,touchStartY:n,canOpenLeftSidebarGesture:o,mobilePanelState:s,translateX:l,windowWidth:c,horizontalScroll:u,isWeb:d,MOBILE_WEB_EDGE_SWIPE_WIDTH:h}){const S=function(e,S){const f=e.changedTouches[0];if(!f||1!==e.numberOfTouches)return;const _=f.absoluteX-t.value,p=f.absoluteY-n.value,v=Math.abs(_),b=Math.abs(p);o(s.value,l.value,c)?u?.isAnyScrolledRight.value||d&&t.value>h||_<=-10||b>10&&b>v?S.fail():_>15&&v>b&&S.activate():S.fail()};return S.__closure={touchStartX:t,touchStartY:n,canOpenLeftSidebarGesture:o,mobilePanelState:s,translateX:l,windowWidth:c,horizontalScroll:u,isWeb:d,MOBILE_WEB_EDGE_SWIPE_WIDTH:h},S.__workletHash=8337771416778,S.__initData=e,S})({_worklet_8337771416778_init_data:mt,touchStartX:x,touchStartY:k,canOpenLeftSidebarGesture:Ee.canOpenLeftSidebarGesture,mobilePanelState:p,translateX:s,windowWidth:c,horizontalScroll:o,isWeb:L.isWeb,MOBILE_WEB_EDGE_SWIPE_WIDTH:Qe})).onStart((function({_worklet_11112183592680_init_data:e,isGesturing:t,runOnJS:n,setOverlayPeek:o}){const s=function(){t.value=!0,n(o)(!0)};return s.__closure={isGesturing:t,runOnJS:n,setOverlayPeek:o},s.__workletHash=0xa1b41c176e8,s.__initData=e,s})({_worklet_11112183592680_init_data:St,isGesturing:f,runOnJS:v.runOnJS,setOverlayPeek:h})).onUpdate((function({_worklet_4399350013762_init_data:e,windowWidth:t,translateX:n,backdropOpacity:o,interpolate:s,Extrapolation:l}){const c=function(e){const c=Math.min(0,-t+e.translationX);n.value=c,o.value=s(c,[-t,0],[0,1],l.CLAMP)};return c.__closure={windowWidth:t,translateX:n,backdropOpacity:o,interpolate:s,Extrapolation:l},c.__workletHash=4399350013762,c.__initData=e,c})({_worklet_4399350013762_init_data:ht,windowWidth:c,translateX:s,backdropOpacity:l,interpolate:v.interpolate,Extrapolation:v.Extrapolation})).onEnd((function({_worklet_3566839805561_init_data:e,isGesturing:t,windowWidth:n,animateToOpen:o,runOnJS:s,handleGestureOpen:l,animateToClose:c}){const u=function(e){t.value=!1;e.translationX>n/3||e.velocityX>500?(o(),s(l)()):c()};return u.__closure={isGesturing:t,windowWidth:n,animateToOpen:o,runOnJS:s,handleGestureOpen:l,animateToClose:c},u.__workletHash=3566839805561,u.__initData=e,u})({_worklet_3566839805561_init_data:dt,isGesturing:f,windowWidth:c,animateToOpen:u,runOnJS:v.runOnJS,handleGestureOpen:O,animateToClose:d})).onFinalize((function({_worklet_11316004136205_init_data:e,isGesturing:t,runOnJS:n,setOverlayPeek:o}){const s=function(){t.value=!1,n(o)(!1)};return s.__closure={isGesturing:t,runOnJS:n,setOverlayPeek:o},s.__workletHash=0xa4ab668250d,s.__initData=e,s})({_worklet_11316004136205_init_data:ut,isGesturing:f,runOnJS:v.runOnJS,setOverlayPeek:h})),[w,c,s,l,p,u,d,h,O,f,y,o?.isAnyScrolledRight,x,k]);return(0,We.jsx)(_.GestureDetector,{gesture:j,touchAction:Ze,children:e})}function pt(e){const t=(0,o.c)(22),{children:n}=e,{settings:s,isLoading:l}=(0,me.useAppSettings)(),{upsertConnectionFromOfferUrl:c}=(0,ye.useHostMutations)();let u,d,h,f;t[0]!==s.theme||t[1]!==l?(u=()=>{l||("auto"===s.theme?y.UnistylesRuntime.setAdaptiveThemes(!0):(y.UnistylesRuntime.setAdaptiveThemes(!1),y.UnistylesRuntime.setTheme(Oe.THEME_TO_UNISTYLES[s.theme])))},d=[l,s.theme],t[0]=s.theme,t[1]=l,t[2]=u,t[3]=d):(u=t[2],d=t[3]),(0,S.useEffect)(u,d),t[4]!==s.codeFontSize||t[5]!==s.monoFontFamily||t[6]!==s.syntaxTheme||t[7]!==s.uiFontFamily||t[8]!==s.uiFontSize||t[9]!==l?(h=()=>{l||(0,ke.applyAppearance)({uiFontFamily:s.uiFontFamily,monoFontFamily:s.monoFontFamily,uiFontSize:s.uiFontSize,codeFontSize:s.codeFontSize,syntaxTheme:s.syntaxTheme})},f=[l,s.uiFontFamily,s.monoFontFamily,s.uiFontSize,s.codeFontSize,s.syntaxTheme],t[4]=s.codeFontSize,t[5]=s.monoFontFamily,t[6]=s.syntaxTheme,t[7]=s.uiFontFamily,t[8]=s.uiFontSize,t[9]=l,t[10]=h,t[11]=f):(h=t[10],f=t[11]),(0,S.useEffect)(h,f);const _=!l;let p,v,b,x,k;return t[12]!==_?(p=(0,We.jsx)(gt,{enabled:_}),t[12]=_,t[13]=p):p=t[13],t[14]!==c?(v=(0,We.jsx)(bt,{upsertDaemonFromOfferUrl:c}),t[14]=c,t[15]=v):v=t[15],t[16]===Symbol.for("react.memo_cache_sentinel")?(b=(0,We.jsx)(Ge,{}),x=(0,We.jsx)(Ot,{}),t[16]=b,t[17]=x):(b=t[16],x=t[17]),t[18]!==n||t[19]!==p||t[20]!==v?(k=(0,We.jsxs)(J.VoiceProvider,{children:[p,v,b,x,n]}),t[18]=n,t[19]=p,t[20]=v,t[21]=k):k=t[21],k}function gt(e){const t=(0,o.c)(5),{enabled:n}=e,{theme:s}=(0,y.useUnistyles)(),l=s.colors.surface0,c=s.colors.foreground;let u,d;return t[0]!==n||t[1]!==c||t[2]!==l?(u=()=>{n&&!L.isNative&&(0,ne.updateDesktopWindowControls)({backgroundColor:l,foregroundColor:c}).catch(vt)},d=[n,l,c],t[0]=n,t[1]=c,t[2]=l,t[3]=u,t[4]=d):(u=t[3],d=t[4]),(0,S.useEffect)(u,d),null}function vt(e){console.warn("[DesktopWindow] Failed to update window controls overlay",e)}function bt(e){const t=(0,o.c)(4),{upsertDaemonFromOfferUrl:n}=e,s=(0,h.useRouter)();let l,c;return t[0]!==s||t[1]!==n?(l=()=>{let e=!1;const t=t=>{t&&t.includes("#offer=")&&n(t).then(t=>{if(e)return;const n=t?.serverId;"string"==typeof n&&n&&s.replace((0,Pe.buildOpenProjectRoute)())}).catch(t=>{e||console.warn("[Linking] Failed to import pairing offer",t)})};u.getInitialURL().then(t).catch(yt);const o=u.addEventListener("url",e=>{t(e.url)});return()=>{e=!0,o.remove()}},c=[s,n],t[0]=s,t[1]=n,t[2]=l,t[3]=c):(l=t[2],c=t[3]),(0,S.useEffect)(l,c),null}function yt(){}let xt=1;function kt(){const e=(0,R.useHostChooser)(),t=(0,ye.useHostRegistryLoaded)(),[n,o]=(0,S.useState)(null),[s,l]=(0,S.useState)(null),c=(0,Se.useOpenProject)(n?.serverId??null),u=(0,S.useCallback)(n=>{const s=n.trim();s&&(t?e({title:"Choose host",onChooseHost:e=>{o({id:xt++,serverId:e,path:s})}}):l(s))},[e,t]);return(0,S.useEffect)(()=>{if(!t||!s)return;const e=s;l(null),u(e)},[t,u,s]),(0,S.useEffect)(()=>{if(!n)return;let e=!1;return c(n.path).then(t=>e?null:t.ok?(o(e=>e?.id===n.id?null:e),null):(o(e=>e?.id===n.id?null:e),null)),()=>{e=!0}},[c,n]),(0,S.useEffect)(()=>{let e=!1,t=null;return(0,oe.getDesktopHost)()?.getPendingOpenProject?.()?.then(t=>{!e&&t&&u(t)}).catch(()=>{}),(0,te.listenToDesktopEvent)("open-project",t=>{if(e)return;const n="string"==typeof t?.path?t.path.trim():"";u(n)}).then(n=>{e?n():t=n}).catch(()=>{}),()=>{e=!0,t?.()}},[u]),null}function wt(e){const t=(0,o.c)(16),{children:n}=e,s=(0,h.usePathname)(),l=(0,h.useGlobalSearchParams)(),c=(0,ye.useHosts)(),u=Ve();let d;t[0]!==s?(d=(0,Pe.parseServerIdFromPathname)(s),t[0]=s,t[1]=d):d=t[1];const S=d;let f;t[2]!==c||t[3]!==S?(f=null!==S&&c.some(e=>e.serverId===S),t[2]=c,t[3]=S,t[4]=f):f=t[4];const _=u&&("/open-project"===s||"/new"===s||"/sessions"===s||"/schedules"===s||f);let p;if(t[5]!==l.open||t[6]!==s){e:{let e;if(t[8]!==s){const n=s.match(/^\/h\/([^/]+)\/workspace\/[^/]+(?:\/|$)/);e=n?.[1]?.trim()??"",t[8]=s,t[9]=e}else e=t[9];const n=e,o=Array.isArray(l.open)?l.open[0]:l.open,c=(0,Pe.parseWorkspaceOpenIntent)(o);if(n&&"agent"===c?.kind){const e=c.agentId.trim();p=e?`${n}:${e}`:void 0;break e}let u;t[10]!==s?(u=(0,Pe.parseHostAgentRouteFromPathname)(s),t[10]=s,t[11]=u):u=t[11];const d=u;p=d?`${d.serverId}:${d.agentId}`:void 0}t[5]=l.open,t[6]=s,t[7]=p}else p=t[7];const v=_?p:void 0;let b;return t[12]!==n||t[13]!==_||t[14]!==v?(b=(0,We.jsx)(tt,{selectedAgentId:v,chromeEnabled:_,children:n}),t[12]=n,t[13]=_,t[14]=v,t[15]=b):b=t[15],b}function Ot(){return(0,ce.useFaviconStatus)(),null}function jt(){const e=(0,o.c)(22),t=Ve(),{theme:n}=(0,y.useUnistyles)();let s;e[0]!==n.colors.surface0?(s={headerShown:!1,animation:"none",contentStyle:{backgroundColor:n.colors.surface0}},e[0]=n.colors.surface0,e[1]=s):s=e[1];const l=s;let c,u,d,S,f,_,p,v,b,x,k,w,O,j,E,P,I;return e[2]===Symbol.for("react.memo_cache_sentinel")?(c=(0,We.jsx)(h.Stack.Screen,{name:"index"}),u=(0,We.jsx)(h.Stack.Screen,{name:"agent/[agentId]"}),e[2]=c,e[3]=u):(c=e[2],u=e[3]),e[4]===Symbol.for("react.memo_cache_sentinel")?(_=(0,We.jsx)(h.Stack.Screen,{name:"welcome"}),p=(0,We.jsx)(h.Stack.Screen,{name:"settings/index"}),v=(0,We.jsx)(h.Stack.Screen,{name:"settings/[section]"}),b=(0,We.jsx)(h.Stack.Screen,{name:"settings/projects/index"}),x=(0,We.jsx)(h.Stack.Screen,{name:"settings/projects/[projectKey]"}),k=(0,We.jsx)(h.Stack.Screen,{name:"new"}),w=(0,We.jsx)(h.Stack.Screen,{name:"open-project"}),d=(0,We.jsx)(h.Stack.Screen,{name:"sessions"}),S=(0,We.jsx)(h.Stack.Screen,{name:"schedules"}),f=(0,We.jsx)(h.Stack.Screen,{name:"pair-scan"}),e[4]=d,e[5]=S,e[6]=f,e[7]=_,e[8]=p,e[9]=v,e[10]=b,e[11]=x,e[12]=k,e[13]=w):(d=e[4],S=e[5],f=e[6],_=e[7],p=e[8],v=e[9],b=e[10],x=e[11],k=e[12],w=e[13]),e[14]!==t?(O=(0,We.jsxs)(h.Stack.Protected,{guard:t,children:[_,p,v,b,x,k,w,d,S,f]}),e[14]=t,e[15]=O):O=e[15],e[16]===Symbol.for("react.memo_cache_sentinel")?(j=(0,We.jsx)(h.Stack.Screen,{name:"h/[serverId]"}),E=(0,We.jsx)(h.Stack.Screen,{name:"settings/hosts/[serverId]/index"}),P=(0,We.jsx)(h.Stack.Screen,{name:"settings/hosts/[serverId]/[hostSection]"}),e[16]=j,e[17]=E,e[18]=P):(j=e[16],E=e[17],P=e[18]),e[19]!==l||e[20]!==O?(I=(0,We.jsxs)(h.Stack,{screenOptions:l,children:[c,u,O,j,E,P]}),e[19]=l,e[20]=O,e[21]=I):I=e[21],I}function Et(){const e=(0,o.c)(3),t=(0,h.useNavigationContainerRef)();let n,s;return e[0]!==t?(n=()=>(0,V.registerWorkspaceRouteNavigationRef)(t),s=[t],e[0]=t,e[1]=n,e[2]=s):(n=e[1],s=e[2]),(0,S.useEffect)(n,s),null}function Pt(){const e=(0,o.c)(2);let t,n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,We.jsx)(kt,{}),e[0]=t):t=e[0],e[1]===Symbol.for("react.memo_cache_sentinel")?(n=(0,We.jsx)(z.SidebarAnimationProvider,{children:(0,We.jsxs)(X.HorizontalScrollProvider,{children:[t,(0,We.jsx)(O.DaemonRpcBoundary,{children:(0,We.jsxs)(wt,{children:[(0,We.jsx)(Et,{}),(0,We.jsx)(jt,{})]})})]})}),e[1]=n):n=e[1],n}function It(e){const t=(0,o.c)(3),{children:n}=e;let s,l;return t[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,We.jsx)(He,{}),t[0]=s):s=t[0],t[1]!==n?(l=(0,We.jsxs)(Ye,{children:[s,(0,We.jsx)(N.SidebarCalloutProvider,{children:(0,We.jsx)(Y.ToastProvider,{children:(0,We.jsx)(pt,{children:n})})})]}),t[1]=n,t[2]=l):l=t[2],l}function Dt(e){const t=(0,o.c)(2),{children:n}=e;let c;return t[0]!==n?(c=(0,We.jsx)(Ke,{children:(0,We.jsx)(pe.I18nProvider,{children:(0,We.jsx)(b.SafeAreaProvider,{children:(0,We.jsx)(p.KeyboardProvider,{children:(0,We.jsx)(de.KeyboardShiftProvider,{children:(0,We.jsx)(l.PortalProvider,{children:(0,We.jsx)(s.BottomSheetModalProvider,{children:n})})})})})})}),t[0]=n,t[1]=c):c=t[1],c}function Tt(){const e=(0,o.c)(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,We.jsx)(_.GestureHandlerRootView,{style:qe,children:(0,We.jsx)(n.View,{style:Ft.surfaceFill,children:(0,We.jsx)(Dt,{children:(0,We.jsx)(It,{children:(0,We.jsx)(Pt,{})})})})}),e[0]=t):t=e[0],t}const Ft=y.StyleSheet.create(e=>({surfaceFill:{flex:1,backgroundColor:e.colors.surface0,uni__dependencies:[0]}}))},347,[348,349,55,351,875,916,965,972,1143,36,25,1426,146,354,1519,444,1320,56,1570,1571,3517,3518,3520,3544,3563,3566,3567,3699,3892,3900,3911,4086,4016,3453,3457,3407,4087,4088,3854,3581,3521,3499,3991,4124,3492,4125,4126,4133,4136,4137,3403,3565,3608,3404,3576,4139,4141,4145,4146,4147,4155,3884,4158,3894,3575,3523,4159,3269,1,3431,3271,4164,4165,3582,305,4167,3585,3477,4119,3484,4106,4168,279]);
|
|
389
389
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"View",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e};const u=(0,r(d[1]).createUnistylesElement)(n.default)},348,[146,274]);
|
|
390
390
|
__d(function(g,r,i,a,m,e,d){'use strict';m.exports=r(d[0])},349,[350]);
|
|
@@ -1103,7 +1103,7 @@ __d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?
|
|
|
1103
1103
|
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return N}}),Object.defineProperty(_e,"AppOwnership",{enumerable:!0,get:function(){return l.AppOwnership}}),Object.defineProperty(_e,"ExecutionEnvironment",{enumerable:!0,get:function(){return l.ExecutionEnvironment}}),Object.defineProperty(_e,"UserInterfaceIdiom",{enumerable:!0,get:function(){return l.UserInterfaceIdiom}});var n=e(r(d[0])),t=r(d[1]);r(d[2]);var u=e(r(d[3])),l=r(d[4]),o=e(r(d[5]));o.default||console.warn("No native ExponentConstants module found, are you sure the expo-constants's module is linked properly?");const s=(0,t.requireOptionalNativeModule)('ExpoUpdates');let f=null;if(s){let e;s.manifest?e=s.manifest:s.manifestString&&(e=JSON.parse(s.manifestString)),e&&Object.keys(e).length>0&&(f=e)}let c=null;if(u.default.EXDevLauncher){let e;u.default.EXDevLauncher.manifestString&&(e=JSON.parse(u.default.EXDevLauncher.manifestString)),e&&Object.keys(e).length>0&&(c=e)}let p=null;if(o.default&&o.default.manifest){const e=o.default.manifest;p='string'==typeof e?JSON.parse(e):e}let b=f??c??p;const E=o.default||{},{appOwnership:O}=E,x=(0,n.default)(E,["name","appOwnership"]),v=Object.assign({},x,{appOwnership:O??null});function _(e){return!h(e)}function h(e){return'metadata'in e}function S(e=!1){if(!b){const e=null===b?'null':'undefined';if(x.executionEnvironment,l.ExecutionEnvironment.Bare,x.executionEnvironment===l.ExecutionEnvironment.StoreClient||x.executionEnvironment===l.ExecutionEnvironment.Standalone)throw new t.CodedError('ERR_CONSTANTS_MANIFEST_UNAVAILABLE',`Constants.manifest is ${e}, must be an object.`)}return b}Object.defineProperties(v,{__unsafeNoWarnManifest:{get(){const e=S(!0);return e&&_(e)?e:null},enumerable:!1},__unsafeNoWarnManifest2:{get(){const e=S(!0);return e&&h(e)?e:null},enumerable:!1},manifest:{get(){const e=S();return e&&_(e)?e:null},enumerable:!0},manifest2:{get(){const e=S();return e&&h(e)?e:null},enumerable:!0},expoConfig:{get(){const e=S(!0);return e?s&&s.isEmbeddedLaunch?p:h(e)?e.extra?.expoClient??null:_(e)?e:null:null},enumerable:!0},expoGoConfig:{get(){const e=S(!0);return e?h(e)?e.extra?.expoGo??null:_(e)?e:null:null},enumerable:!0},easConfig:{get(){const e=S(!0);return e?h(e)?e.extra?.eas??null:_(e)?e:null:null},enumerable:!0},__rawManifest_TEST:{get:()=>b,set(e){b=e},enumerable:!1}});var N=v},1006,[35,4,25,1007,1008,1009]);
|
|
1104
1104
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),u={UIManager:((e=t)&&e.__esModule?e:{default:e}).default}},1007,[159]);
|
|
1105
1105
|
__d(function(g,r,i,a,m,e,d){"use strict";var t,n,o;Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"AppOwnership",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ExecutionEnvironment",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"UserInterfaceIdiom",{enumerable:!0,get:function(){return o}}),(function(t){t.Expo="expo"})(t||(t={})),(function(t){t.Bare="bare",t.Standalone="standalone",t.StoreClient="storeClient"})(n||(n={})),(function(t){t.Handset="handset",t.Tablet="tablet",t.Desktop="desktop",t.TV="tv",t.Unsupported="unsupported"})(o||(o={}))},1008,[]);
|
|
1106
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return s}});var t=r(d[0]);const n=(Date.now()+'-'+Math.floor(1e9*Math.random())).toString();function o(){if('undefined'!=typeof navigator&&'string'==typeof navigator.userAgent){const t=navigator.userAgent.toLowerCase();if(t.includes('edge'))return'Edge';if(t.includes('edg'))return'Chromium Edge';if(t.includes('opr')&&'opr'in window&&window.opr)return'Opera';if(t.includes('chrome')&&'chrome'in window&&window.chrome)return'Chrome';if(t.includes('trident'))return'IE';if(t.includes('firefox'))return'Firefox';if(t.includes('safari'))return'Safari'}}var s={get appOwnership(){return null},get executionEnvironment(){return t.ExecutionEnvironment.Bare},get sessionId(){return n},get isHeadless(){return'undefined'==typeof navigator||/\bHeadlessChrome\//.test(navigator.userAgent)},get expoVersion(){return this.manifest.sdkVersion||null},get linkingUri(){return'undefined'!=typeof location?location.origin:''},get expoRuntimeVersion(){return this.expoVersion},get deviceName(){return o()},get systemFonts(){return[]},get statusBarHeight(){return 0},get deviceYearClass(){return null},get manifest(){return"{\"name\":\"Paseo\",\"slug\":\"paseo-hyperdrive\",\"version\":\"0.3.
|
|
1106
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return s}});var t=r(d[0]);const n=(Date.now()+'-'+Math.floor(1e9*Math.random())).toString();function o(){if('undefined'!=typeof navigator&&'string'==typeof navigator.userAgent){const t=navigator.userAgent.toLowerCase();if(t.includes('edge'))return'Edge';if(t.includes('edg'))return'Chromium Edge';if(t.includes('opr')&&'opr'in window&&window.opr)return'Opera';if(t.includes('chrome')&&'chrome'in window&&window.chrome)return'Chrome';if(t.includes('trident'))return'IE';if(t.includes('firefox'))return'Firefox';if(t.includes('safari'))return'Safari'}}var s={get appOwnership(){return null},get executionEnvironment(){return t.ExecutionEnvironment.Bare},get sessionId(){return n},get isHeadless(){return'undefined'==typeof navigator||/\bHeadlessChrome\//.test(navigator.userAgent)},get expoVersion(){return this.manifest.sdkVersion||null},get linkingUri(){return'undefined'!=typeof location?location.origin:''},get expoRuntimeVersion(){return this.expoVersion},get deviceName(){return o()},get systemFonts(){return[]},get statusBarHeight(){return 0},get deviceYearClass(){return null},get manifest(){return"{\"name\":\"Paseo\",\"slug\":\"paseo-hyperdrive\",\"version\":\"0.3.12\",\"orientation\":\"portrait\",\"icon\":\"./assets/images/icon.png\",\"scheme\":\"paseo\",\"userInterfaceStyle\":\"automatic\",\"newArchEnabled\":true,\"web\":{\"output\":\"single\",\"favicon\":\"./assets/images/favicon.png\",\"shortName\":\"Paseo\",\"orientation\":\"portrait\",\"name\":\"Paseo\"},\"autolinking\":{\"searchPaths\":[\"../../node_modules\",\"./node_modules\"]},\"experiments\":{\"typedRoutes\":true,\"reactCompiler\":true,\"autolinkingModuleResolution\":true},\"extra\":{\"router\":{},\"eas\":{\"build\":{\"experimental\":{\"ios\":{\"appExtensions\":[{\"bundleIdentifier\":\"bot.hyperdrive.paseo.AgentActivity\",\"targetName\":\"AgentActivity\"}]}}}}},\"sdkVersion\":\"54.0.0\",\"platforms\":[\"ios\",\"android\",\"web\"]}"},get manifest2(){return null},get experienceUrl(){return'undefined'!=typeof location?location.origin:''},get debugMode(){return!1},getWebViewUserAgentAsync:async()=>'undefined'!=typeof navigator?navigator.userAgent:null}},1009,[1008]);
|
|
1107
1107
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),n=r(d[1]),o=(e=n)&&e.__esModule?e:{default:e};async function u(){if(!o.default.unregisterForNotificationsAsync)throw new t.UnavailabilityError('ExpoNotifications','unregisterForNotificationsAsync');return o.default.unregisterForNotificationsAsync()}},1010,[4,1011]);
|
|
1108
1108
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return n}}),r(d[0]);let t=!1;var n={addListener:()=>(t||(console.warn("[expo-notifications] Listening to push token changes is not yet fully supported on web. Adding a listener will have no effect."),t=!0),{remove:()=>{}}),removeListener:()=>{},removeAllListeners:()=>{},emit:()=>{},listenerCount:()=>0}},1011,[4]);
|
|
1109
1109
|
__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var t=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}),t.default=e,t})(r(_d[0])),o=e(r(_d[1])),n=r(_d[2]),c=r(_d[3]),s=e(r(_d[4])),d=e(r(_d[5]));const p='https://exp.host/--/api/v2/';async function u(e={}){const s=e.devicePushToken||await(0,d.default)(),u=e.deviceId||await h(),R=e.projectId||o.default.easConfig?.projectId||o.default.expoConfig?.extra?.eas?.projectId;if(!R)throw new n.CodedError('ERR_NOTIFICATIONS_NO_EXPERIENCE_ID',"No \"projectId\" found. If \"projectId\" can't be inferred from the manifest (for instance, in bare workflow), you have to pass it in yourself.");const w=e.applicationId||t.applicationId;if(!w)throw new n.CodedError('ERR_NOTIFICATIONS_NO_APPLICATION_ID',"No \"applicationId\" found. If it can't be inferred from native configuration by expo-application, you have to pass it in yourself.");const O=e.type||y(s),_=e.development||await I(),v=e.baseUrl??p,N=e.url??`${v}push/getExpoPushToken`,x={type:O,deviceId:u.toLowerCase(),development:_,appId:w,deviceToken:E(s),projectId:R},T=await fetch(N,{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify(x)}).catch(e=>{throw new n.CodedError('ERR_NOTIFICATIONS_NETWORK_ERROR',`Error encountered while fetching Expo token: ${e}.`)});if(!T.ok){const e=T.statusText||T.status;let t;try{t=await T.text()}catch{}throw new n.CodedError('ERR_NOTIFICATIONS_SERVER_ERROR',`Error encountered while fetching Expo token, expected an OK response, received: ${e} (body: "${t}").`)}const b=l(await f(T));try{e.url||e.baseUrl?console.debug("[expo-notifications] Since the URL endpoint to register in has been customized in the options, expo-notifications won't try to auto-update the device push token on the server."):await(0,c.setAutoServerRegistrationEnabledAsync)(!0)}catch(e){console.warn('[expo-notifications] Could not enable automatically registering new device tokens with the Expo notification service',e)}return{type:'expo',data:b}}async function f(e){try{return await e.json()}catch{try{throw new n.CodedError('ERR_NOTIFICATIONS_SERVER_ERROR',`Expected a JSON response from server when fetching Expo token, received body: ${JSON.stringify(await e.text())}.`)}catch{throw new n.CodedError('ERR_NOTIFICATIONS_SERVER_ERROR',`Expected a JSON response from server when fetching Expo token, received response: ${JSON.stringify(e)}.`)}}}function l(e){if(!e||'object'!=typeof e||!e.data||'object'!=typeof e.data||!e.data.expoPushToken||'string'!=typeof e.data.expoPushToken)throw new n.CodedError('ERR_NOTIFICATIONS_SERVER_ERROR',`Malformed response from server, expected "{ data: { expoPushToken: string } }", received: ${JSON.stringify(e,null,2)}.`);return e.data.expoPushToken}async function h(){try{if(!s.default.getInstallationIdAsync)throw new n.UnavailabilityError('ExpoServerRegistrationModule','getInstallationIdAsync');return await s.default.getInstallationIdAsync()}catch(e){throw new n.CodedError('ERR_NOTIF_DEVICE_ID',`Could not have fetched installation ID of the application: ${e}.`)}}function E(e){return'string'==typeof e.data?e.data:JSON.stringify(e.data)}async function I(){return!1}function y(e){switch(e.type){case'ios':return'apns';case'android':return'fcm';default:return e.type}}},1012,[1013,1006,4,1016,1020,1005]);
|
|
@@ -15044,7 +15044,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
|
|
|
15044
15044
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"decodeOfferFragmentPayload",{enumerable:!0,get:function(){return n.decodeOfferFragmentPayload}}),Object.defineProperty(e,"buildDaemonWebSocketUrl",{enumerable:!0,get:function(){return t.buildDaemonWebSocketUrl}}),Object.defineProperty(e,"deriveLabelFromEndpoint",{enumerable:!0,get:function(){return t.deriveLabelFromEndpoint}}),Object.defineProperty(e,"extractHostPortFromWebSocketUrl",{enumerable:!0,get:function(){return t.extractHostPortFromWebSocketUrl}}),Object.defineProperty(e,"normalizeHostPort",{enumerable:!0,get:function(){return t.normalizeHostPort}}),Object.defineProperty(e,"parseConnectionUri",{enumerable:!0,get:function(){return t.parseConnectionUri}}),Object.defineProperty(e,"parseHostPort",{enumerable:!0,get:function(){return t.parseHostPort}}),Object.defineProperty(e,"serializeConnectionUri",{enumerable:!0,get:function(){return t.serializeConnectionUri}}),Object.defineProperty(e,"serializeConnectionUriForStorage",{enumerable:!0,get:function(){return t.serializeConnectionUriForStorage}}),Object.defineProperty(e,"shouldUseTlsForDefaultHostedRelay",{enumerable:!0,get:function(){return t.shouldUseTlsForDefaultHostedRelay}}),e.buildRelayWebSocketUrl=function(n){return(0,t.buildRelayWebSocketUrl)(Object.assign({},n,{role:"client"}))};var t=r(d[0]),n=r(d[1])},3399,[3379,3400]);
|
|
15045
15045
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ConnectionOfferV2Schema",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ConnectionOfferSchema",{enumerable:!0,get:function(){return o}}),e.decodeOfferFragmentPayload=l,e.parseConnectionOfferFromUrl=function(n){const t=f(n);if(!t)return null;const c=l(t);return o.parse(c)};var n=r(d[0]);const t=n.z.object({v:n.z.literal(2),serverId:n.z.string().min(1),daemonPublicKeyB64:n.z.string().min(1),relay:n.z.object({endpoint:n.z.string().min(1),useTls:n.z.boolean().optional()})}),o=t;function c(n){const t=n.replace(/-/g,"+").replace(/_/g,"/"),o=t.padEnd(t.length+(4-t.length%4)%4,"="),c=globalThis.atob(o),l=Uint8Array.from(c,n=>n.charCodeAt(0));return new TextDecoder("utf-8",{fatal:!0}).decode(l)}function l(n){const t=c(n);return JSON.parse(t)}const u="#offer=";function f(n){const t=n.trim();if(!t)return null;const o=t.indexOf(u);if(-1===o)return null;const c=t.slice(o+u.length).trim();return c.length>0?c:null}},3400,[3282]);
|
|
15046
15046
|
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.resolveAppVersion=function(){const e=u(t.default?.version);if(e)return e;const o=u(n.default.expoConfig?.version);if(o)return o;const f=u(n.default.manifest?.version);if(f)return f;return null};var n=e(r(d[0])),t=e(r(d[1]));function u(e){if("string"!=typeof e)return null;const n=e.trim();return 0===n.length?null:n}},3401,[1006,3402]);
|
|
15047
|
-
__d(function(e,t,r,a,o,i,n){o.exports={name:"@hyperdrive.bot/paseo-app",version:"0.3.
|
|
15047
|
+
__d(function(e,t,r,a,o,i,n){o.exports={name:"@hyperdrive.bot/paseo-app",version:"0.3.12",private:!0,main:"index.ts",scripts:{start:"npm run start:expo","start:expo":"cross-env APP_VARIANT=development expo start","reset-project":"node ./scripts/reset-project.js","build:terminal-webview":"node ./scripts/build-terminal-webview-html.mjs","eas-build-post-install":"npm --prefix ../.. run build:app-deps && npm run build:terminal-webview",android:"npm run android:development","android:development":"npm --prefix ../.. run build:client && cross-env APP_VARIANT=development expo prebuild --platform android --non-interactive && cross-env APP_VARIANT=development expo run:android --variant=debug","android:production":"npm --prefix ../.. run build:client && cross-env APP_VARIANT=production expo prebuild --platform android --non-interactive && cross-env APP_VARIANT=production expo run:android --variant=release","android:release":"npm run android:production","android:clear":"node -e \"require('node:fs').rmSync('android', { recursive: true, force: true })\"",ios:"npm --prefix ../.. run build:client && expo run:ios","ios:release":"npm --prefix ../.. run build:client && expo run:ios --configuration Release",web:"npm --prefix ../.. run build:client && concurrently --kill-others --names protocol,client,expo --prefix-colors yellow,blue,magenta \"npm --prefix ../.. run watch:protocol\" \"npm --prefix ../.. run watch:client\" \"npm run web:expo\"","web:expo":"expo start --web",lint:"expo lint",typecheck:"tsgo --noEmit",test:"vitest run","test:browser":"vitest run --project browser","test:e2e":"playwright test --project='Desktop Chrome'","test:e2e:real":"cross-env E2E_FORK_PASEO_HOME_FROM=../../.dev/paseo-home playwright test --project=real-provider","test:e2e:ui":"playwright test --ui","test:coverage":"vitest run --project unit --coverage",build:"npm run build:web","build:web":"npm --prefix ../.. run build:app-deps && expo export --platform web --source-maps","profile:workspace-tabs":"node ./scripts/profile-workspace-tabs.mjs","deploy:web":"npm run build:web && wrangler pages deploy dist --project-name paseo-app --branch main"},dependencies:{"@bacons/apple-targets":"4.0.6","@datadog/browser-rum":"^6.23.0","@datadog/browser-rum-react":"^6.23.0","@datadog/mobile-react-native":"^2.7.0","@datadog/mobile-react-native-session-replay":"^2.14.8","@dnd-kit/core":"^6.3.1","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@expo/image-utils":"0.8.8","@expo/plist":"0.4.9","@expo/prebuild-config":"54.0.8","@floating-ui/react-native":"^0.10.7","@gorhom/bottom-sheet":"^5.2.14","@gorhom/portal":"^1.0.14","@hyperdrive.bot/paseo-client":"*","@hyperdrive.bot/paseo-expo-two-way-audio":"*","@hyperdrive.bot/paseo-extension-sdk":"*","@hyperdrive.bot/paseo-highlight":"*","@react-native-async-storage/async-storage":"2.2.0","@react-native-masked-view/masked-view":"^0.3.2","@react-native/normalize-colors":"^0.81.5","@react-navigation/native":"^7.1.8","@sentry/electron":"^6.11.0","@sentry/react-native":"^6.20.0","@tanstack/react-query":"^5.90.11","@tanstack/react-virtual":"^3.13.21","@xterm/addon-clipboard":"^0.3.0-beta.213","@xterm/addon-fit":"^0.12.0-beta.213","@xterm/addon-image":"^0.10.0-beta.213","@xterm/addon-ligatures":"0.11.0-beta.213","@xterm/addon-search":"^0.17.0-beta.213","@xterm/addon-unicode11":"^0.10.0-beta.213","@xterm/addon-web-links":"^0.13.0-beta.213","@xterm/addon-webgl":"^0.20.0-beta.212","@xterm/xterm":"^6.1.0-beta.213",buffer:"^6.0.3",expo:"^54.0.18","expo-asset":"~12.0.12","expo-audio":"~1.0.13","expo-background-fetch":"~14.0.9","expo-build-properties":"^1.0.9","expo-camera":"~17.0.10","expo-clipboard":"~8.0.7","expo-constants":"~18.0.9","expo-crypto":"^15.0.8","expo-dev-client":"^6.0.15","expo-document-picker":"~14.0.8","expo-file-system":"~19.0.17","expo-haptics":"~15.0.7","expo-image":"~3.0.10","expo-image-manipulator":"~14.0.8","expo-image-picker":"^17.0.8","expo-keep-awake":"^15.0.7","expo-linking":"~8.0.8","expo-localization":"~17.0.9","expo-notifications":"^0.32.16","expo-router":"~6.0.13","expo-sharing":"^14.0.8","expo-speech":"~14.0.8","expo-speech-recognition":"^56.0.1","expo-splash-screen":"~31.0.10","expo-system-ui":"~6.0.7","expo-task-manager":"~14.0.9","fast-deep-equal":"^3.1.3",htmlparser2:"^12.0.0",i18next:"^26.3.0","lucide-react-native":"^0.546.0","markdown-it":"^10.0.0","mnemonic-id":"^3.2.7",qrcode:"^1.5.4",react:"19.1.0","react-dom":"19.1.0","react-i18next":"^17.0.8","react-native":"0.81.5","react-native-draggable-flatlist":"^4.0.3","react-native-edge-to-edge":"^1.7.0","react-native-gesture-handler":"~2.28.0","react-native-keyboard-controller":"^1.21.7","react-native-markdown-display":"^7.0.2","react-native-nitro-modules":"0.35.5","react-native-reanimated":"~4.3.1","react-native-safe-area-context":"~5.6.0","react-native-screens":"~4.16.0","react-native-svg":"^15.14.0","react-native-uitextview":"^2.2.0","react-native-unistyles":"^3.2.4","react-native-web":"~0.21.0","react-native-webview":"^13.16.0","react-native-worklets":"~0.8.3","tiny-invariant":"^1.3.3","use-sync-external-store":"^1.6.0",zod:"^4.4.3",zustand:"^5.0.9"},devDependencies:{"@playwright/test":"^1.56.1","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2","@types/chai":"^5.2.2","@types/markdown-it":"^14.1.2","@types/qrcode":"^1.5.6","@types/react":"~19.2.0","@types/ws":"^8.18.1","@vitest/browser":"^4.1.7","@vitest/browser-playwright":"^4.1.7","@vitest/coverage-v8":"^4.1.7","@xterm/headless":"^6.1.0-beta.213",dotenv:"^17.2.3",eslint:"^9.25.0","eslint-config-expo":"~10.0.0",jsdom:"^20.0.3","material-icon-theme":"^5.32.0",playwright:"^1.56.1","serve-sim":"^0.1.40",typescript:"~5.9.2",vitest:"^4.1.6",wrangler:"^4.105.0",ws:"^8.20.0"}}},3402,[]);
|
|
15048
15048
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.shouldUseDesktopDaemon=function(){return(0,n.isElectronRuntime)()},e.getDesktopDaemonStatus=async function(){return c(await(0,t.invokeDesktopCommand)("desktop_daemon_status"))},e.startDesktopDaemon=async function(){return c(await(0,t.invokeDesktopCommand)("start_desktop_daemon"))},e.stopDesktopDaemon=async function(n="manual_ipc"){return c(await(0,t.invokeDesktopCommand)("stop_desktop_daemon",{reason:n}))},e.restartDesktopDaemon=async function(){return c(await(0,t.invokeDesktopCommand)("restart_desktop_daemon"))},e.getDesktopDaemonLogs=async function(){return p(await(0,t.invokeDesktopCommand)("desktop_daemon_logs"))},e.getDesktopDaemonPairing=async function(){return k(await(0,t.invokeDesktopCommand)("desktop_daemon_pairing"))},e.getCliDaemonStatus=async function(){const n=await(0,t.invokeDesktopCommand)("cli_daemon_status");if("string"!=typeof n)throw new Error("Unexpected CLI daemon status response.");return n},e.listenToLocalTransportEvents=async function(t){const u=(0,n.getDesktopHost)()?.events?.on;if("function"!=typeof u)throw new Error("Desktop events API is unavailable.");const c=await u("local-daemon-transport-event",n=>{o(n)&&t({sessionId:s(n.sessionId)??"",kind:s(n.kind)??"error",text:s(n.text),binaryBase64:s(n.binaryBase64),code:l(n.code),reason:s(n.reason),error:s(n.error)})});return"function"==typeof c?c:()=>{}},e.openLocalTransportSession=async function(n){const o=await(0,t.invokeDesktopCommand)("open_local_daemon_transport",n);if("string"!=typeof o||0===o.trim().length)throw new Error("Unexpected local transport session response.");return o},e.sendLocalTransportMessage=async function(n){await(0,t.invokeDesktopCommand)("send_local_daemon_transport_message",Object.assign({sessionId:n.sessionId},n.text?{text:n.text}:{},n.binaryBase64?{binaryBase64:n.binaryBase64}:{}))},e.closeLocalTransportSession=async function(n){await(0,t.invokeDesktopCommand)("close_local_daemon_transport",{sessionId:n})},e.getCliInstallStatus=async function(){return f(await(0,t.invokeDesktopCommand)("get_cli_install_status"))},e.installCli=async function(){return f(await(0,t.invokeDesktopCommand)("install_cli"))},e.getSkillsStatus=async function(){return y(await(0,t.invokeDesktopCommand)("get_skills_status"))},e.installSkills=async function(){return y(await(0,t.invokeDesktopCommand)("install_skills"))},e.updateSkills=async function(){return y(await(0,t.invokeDesktopCommand)("update_skills"))},e.uninstallSkills=async function(){return y(await(0,t.invokeDesktopCommand)("uninstall_skills"))};var n=r(d[0]),t=r(d[1]);function o(n){return"object"==typeof n&&null!==n}function s(n){return"string"==typeof n&&n.trim().length>0?n:null}function l(n){return"number"==typeof n&&Number.isFinite(n)?n:null}function u(n){const t=s(n)?.toLowerCase();switch(t){case"starting":return"starting";case"running":return"running";case"errored":case"error":return"errored";default:return"stopped"}}function c(n){if(!o(n))throw new Error("Unexpected desktop daemon status response.");return{serverId:s(n.serverId)??"",status:u(n.status),listen:s(n.listen),hostname:s(n.hostname),pid:l(n.pid),home:s(n.home)??"",version:s(n.version),desktopManaged:!0===n.desktopManaged,error:s(n.error)}}function p(n){if(!o(n))throw new Error("Unexpected desktop daemon logs response.");return{logPath:s(n.logPath)??"",contents:"string"==typeof n.contents?n.contents:""}}function k(n){if(!o(n))throw new Error("Unexpected desktop daemon pairing response.");return{relayEnabled:!0===n.relayEnabled,url:s(n.url),qr:s(n.qr)}}function f(n){if(!o(n))throw new Error("Unexpected install status response.");return{installed:!0===n.installed}}function w(n){switch(n){case"not-installed":case"up-to-date":case"drift":return n;default:throw new Error(`Unexpected skills status state: ${String(n)}`)}}function _(n){if(!o(n))throw new Error("Unexpected skill op response.");const t=s(n.name);if(!t)throw new Error("Skill op missing name.");switch(n.kind){case"add":return{kind:"add",name:t};case"update":return{kind:"update",name:t};case"delete":return{kind:"delete",name:t};default:throw new Error(`Unexpected skill op kind: ${String(n.kind)}`)}}function y(n){if(!o(n))throw new Error("Unexpected skills status response.");const t=Array.isArray(n.ops)?n.ops.map(_):[];return{state:w(n.state),ops:t}}},3403,[3404,3406]);
|
|
15049
15049
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.getDesktopHost=n,e.isElectronRuntime=o,e.isElectronRuntimeMac=function(){if(!o())return!1;if("undefined"==typeof navigator)return!1;const t=n()?.platform?.toLowerCase();if("darwin"===t||"mac"===t||"macos"===t)return!0;const u=navigator.userAgent;return u.includes("Mac OS")||u.includes("Macintosh")},r(d[0]);var t=r(d[1]);function n(){return(0,t.getElectronHost)()}function o(){return null!==n()}},3404,[25,3405]);
|
|
15050
15050
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.getElectronHost=function(){if("undefined"==typeof window)return null;const t=window.paseoDesktop;if(!t||"object"!=typeof t)return null;return t}},3405,[]);
|
|
@@ -15573,7 +15573,7 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
|
|
|
15573
15573
|
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.FileDropBackdrop=function(){const e=(0,t.c)(11),{t:o}=(0,p.useTranslation)(),l=(0,h.useFileDropContext)(),_=l?.isDragging,b=l?.suppressed,w=l?.hasSink,j=(0,c.useAnimatedStyle)((function({_worklet_2693010592129_init_data:e,isDragging:n,hasSink:s,suppressed:t,withTiming:o}){const l=function(){return{opacity:o(n?.value&&s?.value&&!t?.value?1:0,{duration:150})}};return l.__closure={isDragging:n,hasSink:s,suppressed:t,withTiming:o},l.__workletHash=2693010592129,l.__initData=e,l})({_worklet_2693010592129_init_data:k,isDragging:_,hasSink:w,suppressed:b,withTiming:c.withTiming}));let x;e[0]!==j?(x=[y.overlay,j],e[0]=j,e[1]=x):x=e[1];const T=x;if(!l)return null;let F,O,z,C,I;e[2]===Symbol.for("react.memo_cache_sentinel")?(F=(0,f.jsx)(s.View,{style:D.backdrop}),e[2]=F):F=e[2];e[3]===Symbol.for("react.memo_cache_sentinel")?(O=(0,f.jsx)(v,{size:32,uniProps:S}),e[3]=O):O=e[3];e[4]!==o?(z=o("composer.attachments.dropFilesHere"),e[4]=o,e[5]=z):z=e[5];e[6]!==z?(C=(0,f.jsxs)(s.View,{style:D.content,children:[O,(0,f.jsx)(n.Text,{style:D.text,children:z})]}),e[6]=z,e[7]=C):C=e[7];e[8]!==T||e[9]!==C?(I=(0,f.jsxs)(u.default.View,{style:T,pointerEvents:"none",children:[F,C]}),e[8]=T,e[9]=C,e[10]=I):I=e[10];return I};var n=r(d[0]),s=r(d[1]),t=r(d[2]);r(d[3]),r(d[4]);var o=e(r(d[5])),l=r(d[6]),c=r(d[7]),u=e(c),_=r(d[8]);r(d[9]);var p=r(d[10]),h=r(d[11]),f=r(d[12]);const v=(0,l.withUnistyles)(_.Upload),S=e=>({color:e.colors.primary}),k={code:"function fileDropBackdropTsx1(){const{isDragging,hasSink,suppressed,withTiming}=this.__closure;var _isDragging,_hasSink,_suppressed;const active=((_isDragging=isDragging)===null||_isDragging===void 0?void 0:_isDragging.value)&&((_hasSink=hasSink)===null||_hasSink===void 0?void 0:_hasSink.value)&&!((_suppressed=suppressed)!==null&&_suppressed!==void 0&&_suppressed.value);return{opacity:withTiming(active?1:0,{duration:150})};}"};const y=o.default.create({overlay:Object.assign({},o.default.absoluteFillObject,{alignItems:"center",justifyContent:"center",zIndex:1e3})}),D=l.StyleSheet.create(e=>({backdrop:Object.assign({},l.StyleSheet.absoluteFillObject,{backgroundColor:e.colors.surface0,opacity:.7,uni__dependencies:[0]}),content:{alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},text:{fontSize:e.fontSize.base,fontWeight:e.fontWeight.medium,color:e.colors.foreground,uni__dependencies:[0]}}))},3918,[711,348,349,146,234,59,56,444,1600,36,1573,3917,279]);
|
|
15574
15574
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.useDropListeners=function({isDragging:n,suppressed:l,hasSink:p,getSink:f,disabled:v}){const y=(0,e.useRef)(null),h=(0,e.useRef)(0),F=(0,e.useRef)(v);return F.current=v,(0,e.useEffect)(()=>{v&&(n.value=!1,h.current=0)},[v,n]),(0,e.useEffect)(()=>{if(!s.isWeb)return;let e,v=!1,D=!1;function L(t){if(D)return;const n=t??e;if(n){D=!0;try{Promise.resolve(n()).catch(e=>{console.warn("[useDropListeners] Failed to remove desktop drag-drop listener:",e)})}catch(e){console.warn("[useDropListeners] Failed to remove desktop drag-drop listener:",e)}}}async function E(){const s=(0,t.getDesktopHost)();if(null===s)return!1;const c=s.window?.getCurrentWindow?.();if(!c||"function"!=typeof c.onDragDropEvent)return!1;try{const t=await c.onDragDropEvent(e=>{const t=e.payload;if("leave"===t.type)return void(n.value=!1);if("enter"===t.type||"over"===t.type)return void(F.current||(n.value=!0));if(n.value=!1,F.current||l.value)return;const s=f();if(!s)return;const c=t.paths.map(e=>({kind:"desktop-path",path:e}));s.onGenericFiles&&c.length>0&&s.onGenericFiles(c);const p=t.paths.filter(o.isRasterImagePath);0!==p.length&&Promise.all(p.map(u)).then(e=>{0!==e.length&&s.onFiles(e)}).catch(e=>{console.error("[useDropListeners] Failed to persist dropped files:",e)})});return v?(L(t),!0):(e=t,!0)}catch(e){return console.warn("[useDropListeners] Failed to listen for desktop drag-drop:",e),!1}}function w(){const t=y.current;function s(e){e.preventDefault(),e.stopPropagation(),F.current||(h.current++,e.dataTransfer?.types.includes("Files")&&(n.value=!0))}function u(e){if(e.preventDefault(),e.stopPropagation(),!e.dataTransfer)return;const t=!F.current&&!l.value&&p.value;e.dataTransfer.dropEffect=t?"copy":"none"}function v(e){e.preventDefault(),e.stopPropagation(),F.current||(h.current--,0===h.current&&(n.value=!1))}async function D(e){if(e.preventDefault(),e.stopPropagation(),n.value=!1,h.current=0,F.current||l.value)return;const t=f();if(!t)return;const s=Array.from(e.dataTransfer?.files??[]),u=s.map(e=>({kind:"web-file",file:e}));t.onGenericFiles&&u.length>0&&t.onGenericFiles(u);const p=s.filter(o.isRasterImageFile);if(0!==p.length)try{const e=await Promise.all(p.map(c));t.onFiles(e)}catch(e){console.error("[useDropListeners] Failed to process dropped files:",e)}}t&&(t.addEventListener("dragenter",s),t.addEventListener("dragover",u),t.addEventListener("dragleave",v),t.addEventListener("drop",D),e=()=>{t.removeEventListener("dragenter",s),t.removeEventListener("dragover",u),t.removeEventListener("dragleave",v),t.removeEventListener("drop",D)})}return(async()=>{const e=await E();v||e||w()})(),()=>{v=!0,L()}},[n,l,p,f]),y};var e=r(d[0]),t=r(d[1]),n=r(d[2]),o=r(d[3]),s=r(d[4]);async function u(e){const t=(0,o.getRasterImageMimeTypeFromPath)(e)??"image/jpeg";return await(0,n.persistAttachmentFromFileUri)({uri:e,mimeType:t})}async function c(e){return await(0,n.persistAttachmentFromBlob)({blob:e,mimeType:e.type||"image/jpeg",fileName:e.name})}},3919,[36,3404,3920,3924,3407]);
|
|
15575
15575
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.persistAttachmentFromBlob=async function(n){const c=await(0,t.getAttachmentStore)();return await c.save({id:n.id,mimeType:n.mimeType,fileName:n.fileName,source:{kind:"blob",blob:n.blob}})},e.persistAttachmentFromDataUrl=async function(n){const c=await(0,t.getAttachmentStore)();return await c.save({id:n.id,mimeType:n.mimeType,fileName:n.fileName,source:{kind:"data_url",dataUrl:n.dataUrl}})},e.persistAttachmentFromBytes=async function(n){const c=await(0,t.getAttachmentStore)();return await c.save({id:n.id,mimeType:n.mimeType,fileName:n.fileName,source:{kind:"bytes",bytes:n.bytes}})},e.persistAttachmentFromFileUri=async function(n){const c=await(0,t.getAttachmentStore)();return await c.save({id:n.id,mimeType:n.mimeType,fileName:n.fileName,source:{kind:"file_uri",uri:n.uri}})},e.encodeAttachmentsForSend=async function(n){if(!n||0===n.length)return;const c=await(0,t.getAttachmentStore)(),o=(await Promise.all(n.map(async t=>{try{return{data:await c.encodeBase64({attachment:t}),mimeType:t.mimeType}}catch(n){return console.error("[attachments] Failed to encode attachment for send",{id:t.id,error:n}),null}}))).filter(t=>null!==t);return o.length>0?o:void 0},e.resolveAttachmentPreviewUrl=async function(n){const c=await(0,t.getAttachmentStore)();return await c.resolvePreviewUrl({attachment:n})},e.releaseAttachmentPreviewUrl=async function(n){const c=await(0,t.getAttachmentStore)();if(!c.releasePreviewUrl)return;await c.releasePreviewUrl({attachment:n.attachment,url:n.url})},e.deleteAttachments=async function(n){if(!n||0===n.length)return;const c=await(0,t.getAttachmentStore)();await Promise.all(n.map(async t=>{try{await c.delete({attachment:t})}catch(n){console.warn("[attachments] Failed to delete attachment",{id:t.id,error:n})}}))},e.garbageCollectAttachments=async function(n){const c=await(0,t.getAttachmentStore)();await c.garbageCollect({referencedIds:n.referencedIds})};var t=r(d[0])},3920,[3921]);
|
|
15576
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.getAttachmentStore=async function(){c||(c=s());return await c},e.__setAttachmentStoreForTests=function(t){c=t?Promise.resolve(t):null};var t=r(d[0]),n=r(d[1]);let c=null;async function s(){if(n.isWeb){if((0,t.isElectronRuntime)()){const{createDesktopAttachmentStore:t}=await r(d[3])(d[2],d.paths),{createDesktopAttachmentBridge:n}=await r(d[3])(d[4],d.paths);return t(n())}const{createIndexedDbAttachmentStore:n}=await r(d[3])(d[5],d.paths);return n()}const{createNativeFileAttachmentStore:c}=await r(d[3])(d[6],d.paths);return c()}},3921,{"0":3404,"1":3407,"2":
|
|
15576
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.getAttachmentStore=async function(){c||(c=s());return await c},e.__setAttachmentStoreForTests=function(t){c=t?Promise.resolve(t):null};var t=r(d[0]),n=r(d[1]);let c=null;async function s(){if(n.isWeb){if((0,t.isElectronRuntime)()){const{createDesktopAttachmentStore:t}=await r(d[3])(d[2],d.paths),{createDesktopAttachmentBridge:n}=await r(d[3])(d[4],d.paths);return t(n())}const{createIndexedDbAttachmentStore:n}=await r(d[3])(d[5],d.paths);return n()}const{createNativeFileAttachmentStore:c}=await r(d[3])(d[6],d.paths);return c()}},3921,{"0":3404,"1":3407,"2":4779,"3":3922,"4":4780,"5":4781,"6":4782,"paths":{"4779":"/_expo/static/js/web/desktop-attachment-store-d5c93939344c993e52d655ccf8942928.js","4780":"/_expo/static/js/web/desktop-attachment-bridge-e6e0f92f1a2959279a7c3b2b50bf1df3.js","4781":"/_expo/static/js/web/indexeddb-attachment-store-35fb4ddfe925b1fb6b7a6c1953b21621.js","4782":"/_expo/static/js/web/native-file-attachment-store-8602ccac919e2b56f2e9a252dd06483e.js"}});
|
|
15577
15577
|
__d(function(g,r,i,a,m,e,d){m.exports=r(d[0])},3922,[3923]);
|
|
15578
15578
|
__d(function(g,r,i,a,m,e,d){function n(n,t){const o=g[`${__METRO_GLOBAL_PREFIX__}__loadBundleAsync`];if(null!=o){const s=String(n);if(null!=t){const n=t[s];if(null!=n)return o(n)}}}function t(t,o){const s=n(t,o),u=()=>r.importAll(t);return null!=s?s.then(u):u()}async function o(n,o,s){return t(n,o)}o.unstable_importMaybeSync=function(n,o){return t(n,o)},o.prefetch=function(t,o,s){n(t,o)?.then(()=>{},()=>{})},o.unstable_resolve=function(n,t){if(!t)throw new Error('Bundle splitting is required for Web Worker imports');const o=t[n];if(!o)throw new Error('Worker import is missing from split bundle paths: '+o);return o},o.unstable_createWorker=function(n,t){if('undefined'==typeof crossOriginIsolated||!crossOriginIsolated)return new Worker(n,t);try{const s=(o=n,`\n const ASYNC_WORKER_BASE = ${JSON.stringify(o)};\n const IMPORT_SCRIPTS = importScripts;\n const FETCH = fetch;\n const fromBaseURL = (input) => new URL(input, ASYNC_WORKER_BASE).href;\n self.fetch = function(input, init) {\n return FETCH(typeof input === 'string' ? fromBaseURL(input) : input, init);\n };\n self.importScripts = function(...urls) {\n return IMPORT_SCRIPTS.apply(self, urls.map(fromBaseURL));\n };\n importScripts(ASYNC_WORKER_BASE);\n `);return n=URL.createObjectURL(new Blob([s],{type:'text/javascript'})),new Worker(n,t)}finally{URL.revokeObjectURL(n)}var o},m.exports=o},3923,[]);
|
|
15579
15579
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"RASTER_IMAGE_FILE_EXTENSIONS",{enumerable:!0,get:function(){return o}}),e.getFileExtension=f,e.getFileTypeLabel=function(t){const n=f(t).slice(1);return n?n.toUpperCase():null},e.getMimeTypeFromPath=function(t){return p(t)??s},e.getRasterImageMimeTypeFromPath=p,e.isRasterImagePath=u,e.isRasterImageMimeType=c,e.isRasterImageFile=function(t){if(c(t.type))return!0;return 0===t.type.trim().length&&u(t.name)};const t={".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".bmp":"image/bmp",".heic":"image/heic",".heif":"image/heif",".avif":"image/avif",".tif":"image/tiff",".tiff":"image/tiff"},n=new Set(Object.values(t)),s="application/octet-stream",o=Object.keys(t).map(t=>t.slice(1));function f(t){const n=t.split("#",1)[0]?.split("?",1)[0]??t,s=n.lastIndexOf(".");return s<0?"":n.slice(s).toLowerCase()}function p(n){return t[f(n)]??null}function u(t){return null!==p(t)}function c(t){const s=t?.split(";",1)[0]?.trim().toLowerCase();return Boolean(s&&n.has(s))}},3924,[]);
|
|
@@ -16031,12 +16031,12 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
|
|
|
16031
16031
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createPostStartStrategy=function(l,p,R,b,v,S){let _,k=0;p.subscribe(9,()=>{2!==k&&3!==k||(P(),k=1)}),p.subscribe(10,()=>{1===k&&O()});const w=new t.Observable;(0,o.startRecorderInitTelemetry)(S,w);const L=async n=>{w.notify({type:'start',forced:n});const[o]=await Promise.all([u(w,{type:'recorder-settled'},(0,s.lazyLoadRecorder)()),u(w,{type:'document-ready'},(0,t.asyncRunOnReadyState)(l,'interactive'))]);if(2!==k)return void w.notify({type:'aborted'});if(!o)return k=0,void w.notify({type:'recorder-load-failed'});const c=v();if(!c)return k=0,void w.notify({type:'deflate-encoder-load-failed'});({stop:_}=o(p,l,R,b,c,S)),k=3,w.notify({type:'succeeded'})};function O(n){const o=R.findTrackedSession();if(c(o,n))return void(k=1);if(y(k))return;k=2;const s=f(o,n)||!1;L(s).catch(t.monitorError),s&&R.setForcedReplay()}function P(){3===k&&(null==_||_()),k=0}return{start:O,stop:P,getSessionReplayLink:()=>(0,n.getSessionReplayLink)(l,R,b,0!==k),isRecording:()=>3===k}};var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]);function c(t,n){return!t||0===t.sessionReplay&&(!n||!n.force)}function y(t){return 2===t||3===t}function f(t,n){return n&&n.force&&0===t.sessionReplay}async function u(t,n,o){try{return await o}finally{t.notify(n)}}},4376,[4170,4377,4378,4379]);
|
|
16032
16032
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.getSessionReplayLink=function(s,t,p,u){const c=t.findTrackedSession(),l=o(c,u),f=p.findView();return(0,n.getSessionReplayUrl)(s,{viewContext:f,errorType:l,session:c})};var n=r(d[0]),s=r(d[1]);function o(n,o){return(0,s.isBrowserSupported)()?n?0===n.sessionReplay?'incorrect-session-plan':o?void 0:'replay-not-started':'rum-not-tracked':'browser-not-supported'}},4377,[4270,4375]);
|
|
16033
16033
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.startRecorderInitTelemetry=function(o,c){if(!o.metricsEnabled)return{stop:t.noop};let s,n,l;const{unsubscribe:p}=c.subscribe(o=>{switch(o.type){case'start':s={forced:o.forced,timestamp:(0,t.timeStampNow)()},n=void 0,l=void 0;break;case'document-ready':s&&(n=(0,t.elapsed)(s.timestamp,(0,t.timeStampNow)()));break;case'recorder-settled':s&&(l=(0,t.elapsed)(s.timestamp,(0,t.timeStampNow)()));break;case'aborted':case'deflate-encoder-load-failed':case'recorder-load-failed':case'succeeded':p(),s&&(0,t.addTelemetryMetrics)("Recorder init metrics",{metrics:(c=s.forced,u=l,f=(0,t.elapsed)(s.timestamp,(0,t.timeStampNow)()),b=o.type,y=n,{forced:c,loadRecorderModuleDuration:u,recorderInitDuration:f,result:b,waitForDocReadyDuration:y})})}var c,u,f,b,y});return{stop:p}};var t=r(d[0])},4378,[4170]);
|
|
16034
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.lazyLoadRecorder=async function(){try{return await(0,t.mockable)(c)()}catch(t){(0,o.reportScriptLoadingError)({error:t,source:'Recorder',scriptType:'module'})}},e.importRecorder=c;var t=r(d[0]),o=r(d[1]);async function c(){return(await r(d[3])(d[2],d.paths)).startRecording}},4379,{"0":4170,"1":4374,"2":
|
|
16034
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.lazyLoadRecorder=async function(){try{return await(0,t.mockable)(c)()}catch(t){(0,o.reportScriptLoadingError)({error:t,source:'Recorder',scriptType:'module'})}},e.importRecorder=c;var t=r(d[0]),o=r(d[1]);async function c(){return(await r(d[3])(d[2],d.paths)).startRecording}},4379,{"0":4170,"1":4374,"2":4783,"3":3922,"paths":{"4783":"/_expo/static/js/web/startRecording-fd9fa11e24a3b8d94e5161aae7f42a5d.js"}});
|
|
16035
16035
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createPreStartStrategy=function(){let n=0;return{strategy:{start(){n=1},stop(){n=2},isRecording:()=>!1,getSessionReplayLink:t.noop},shouldStartImmediately:t=>1===n||0===n&&!t.startSessionReplayRecordingManually}};var t=r(d[0])},4380,[4170]);
|
|
16036
16036
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.makeProfilerApi=function(){let u;return{onRumStart:function(f,p,c,_,P,S){const y=_.findTrackedSession();if(!y)return;if(!(0,t.isSampled)(y.id,c.profilingSampleRate))return;const b=(0,s.startProfilingContext)(p);(0,n.isProfilingSupported)()?(0,l.lazyLoadProfiler)().then(t=>{t?(u=t(c,f,_,b,S,P,void 0),u.start()):b.set({status:'error',error_reason:'failed-to-lazy-load'})}).catch(o.monitorError):b.set({status:'error',error_reason:'not-supported-by-browser'})},stop:()=>{null==u||u.stop()}}};var t=r(d[0]),o=r(d[1]),n=r(d[2]),s=r(d[3]),l=r(d[4])},4381,[4270,4170,4382,4383,4384]);
|
|
16037
16037
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.isProfilingSupported=function(){const o=(0,t.getGlobalObject)();return void 0!==o.Profiler};var t=r(d[0])},4382,[4170]);
|
|
16038
16038
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.startProfilingContext=function(u){let s={status:'starting'};return u.register(0,({eventType:u})=>u!==n.RumEventType.VIEW&&u!==n.RumEventType.LONG_TASK&&u!==n.RumEventType.ACTION&&u!==n.RumEventType.VITAL?t.SKIPPED:{type:u,_dd:{profiling:s}}),{get:()=>s,set:t=>{s=t}}};var t=r(d[0]),n=r(d[1])},4383,[4170,4270]);
|
|
16039
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.lazyLoadProfiler=async function(){try{return await(0,t.mockable)(c)()}catch(t){(0,o.reportScriptLoadingError)({error:t,source:'Profiler',scriptType:'module'})}},e.importProfiler=c;var t=r(d[0]),o=r(d[1]);async function c(){return(await r(d[3])(d[2],d.paths)).createRumProfiler}},4384,{"0":4170,"1":4374,"2":
|
|
16039
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.lazyLoadProfiler=async function(){try{return await(0,t.mockable)(c)()}catch(t){(0,o.reportScriptLoadingError)({error:t,source:'Profiler',scriptType:'module'})}},e.importProfiler=c;var t=r(d[0]),o=r(d[1]);async function c(){return(await r(d[3])(d[2],d.paths)).createRumProfiler}},4384,{"0":4170,"1":4374,"2":4784,"3":3922,"paths":{"4784":"/_expo/static/js/web/profiler-b3dd30ba0a88aece50e7e403785f34ba.js"}});
|
|
16040
16040
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ErrorBoundary",{enumerable:!0,get:function(){return t.ErrorBoundary}}),Object.defineProperty(e,"addReactError",{enumerable:!0,get:function(){return t.addReactError}}),Object.defineProperty(e,"reactPlugin",{enumerable:!0,get:function(){return n.reactPlugin}}),Object.defineProperty(e,"UNSTABLE_ReactComponentTracker",{enumerable:!0,get:function(){return o.UNSTABLE_ReactComponentTracker}});var t=r(d[0]),n=r(d[1]),o=r(d[2])},4385,[4386,4389,4390]);
|
|
16041
16041
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ErrorBoundary",{enumerable:!0,get:function(){return t.ErrorBoundary}}),Object.defineProperty(e,"createErrorBoundary",{enumerable:!0,get:function(){return t.createErrorBoundary}}),Object.defineProperty(e,"addReactError",{enumerable:!0,get:function(){return n.addReactError}});var t=r(d[0]),n=r(d[1])},4386,[4387,4388]);
|
|
16042
16042
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.createErrorBoundary=c,Object.defineProperty(_e,"ErrorBoundary",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),o=(e=t)&&e.__esModule?e:{default:e},s=r(d[1]);const n={didCatch:!1,error:null};function c(e,t="ErrorBoundary"){const s=class extends o.default.Component{constructor(e){super(e),this.resetError=()=>{this.setState(n)},this.state=n}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}componentDidCatch(t,o){e(t,o)}render(){return this.state.didCatch?o.default.createElement(this.props.fallback,{error:this.state.error,resetError:this.resetError}):this.props.children}};return s.displayName=t,s}const u=c(s.addReactError)},4387,[36,4388]);
|
|
@@ -16104,8 +16104,8 @@ __d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',
|
|
|
16104
16104
|
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.DiffViewer=function(e){const t=(0,l.c)(32),{diffLines:c,maxHeight:u,emptyLabel:y,fillAvailableHeight:h}=e,p=void 0!==h&&h,{t:S}=(0,x.useTranslation)(),[v,k]=s.default.useState(0);let C;t[0]!==y||t[1]!==S?(C=y??S("diffViewer.empty"),t[0]=y,t[1]=S,t[2]=C):C=t[2];const w=C,H=(0,f.useWebScrollbarStyle)();let L;t[3]===Symbol.for("react.memo_cache_sentinel")?(L=e=>k(e.nativeEvent.layout.width),t[3]=L):L=t[3];const E=L;let W;t[4]!==u?(W=void 0!==u&&(0,T.inlineUnistylesStyle)({maxHeight:u}),t[4]=u,t[5]=W):W=t[5];const F=p&&$.fillHeight;let M;t[6]!==W||t[7]!==F||t[8]!==H?(M=[$.verticalScroll,W,F,H],t[6]=W,t[7]=F,t[8]=H,t[9]=M):M=t[9];const A=M;let D,I;t[10]!==v?(D=v>0&&(0,T.inlineUnistylesStyle)({minWidth:v}),t[10]=v,t[11]=D):D=t[11];t[12]!==D?(I=[$.linesContainer,D],t[12]=D,t[13]=I):I=t[13];const O=I;let R;t[14]!==c?(R=c.map(z),t[14]=c,t[15]=R):R=t[15];const U=R,B=p&&$.fillHeight;let P;t[16]!==B?(P=[$.verticalContent,B],t[16]=B,t[17]=P):P=t[17];const G=P;if(!c.length){let e;return t[18]!==w?(e=(0,b.jsx)(o.View,{style:$.emptyState,children:(0,b.jsx)(n.Text,{style:$.emptyText,children:w})}),t[18]=w,t[19]=e):e=t[19],e}let q,J;t[20]!==U?(q=U.map(V),t[20]=U,t[21]=q):q=t[21];t[22]!==O||t[23]!==q?(J=(0,b.jsx)(o.View,{style:O,dataSet:_.CODE_SURFACE_DATASET,children:q}),t[22]=O,t[23]=q,t[24]=J):J=t[24];const K=J;let N;t[25]!==K||t[26]!==H?(N=(0,b.jsx)(j,{horizontal:!0,nestedScrollEnabled:!0,showsHorizontalScrollIndicator:!0,style:H,contentContainerStyle:$.horizontalContent,onLayout:E,children:K}),t[25]=K,t[26]=H,t[27]=N):N=t[27];const Q=N;let X;t[28]!==Q||t[29]!==A||t[30]!==G?(X=(0,b.jsx)(j,{style:A,contentContainerStyle:G,nestedScrollEnabled:!0,showsVerticalScrollIndicator:!0,children:Q}),t[28]=Q,t[29]=A,t[30]=G,t[31]=X):X=t[31];return X};var e,t=r(d[0]),n=r(d[1]),o=r(d[2]),l=r(d[3]),c=r(d[4]),s=(e=c)&&e.__esModule?e:{default:e},x=r(d[5]);r(d[6]),r(d[7]),r(d[8]);var u=r(d[9]),y=r(d[10]),h=r(d[11]),p=r(d[12]),f=r(d[13]),T=r(d[14]),S=r(d[15]),_=r(d[16]),v=r(d[17]),b=r(d[18]);const j=v.isWeb?t.ScrollView:u.ScrollView;function k(e){const t=(0,l.c)(35),{line:c}=e,s="header"===c.type&&$.headerLine,x="add"===c.type&&$.addLine,u="remove"===c.type&&$.removeLine,y="context"===c.type&&$.contextLine;let p;t[0]!==s||t[1]!==x||t[2]!==u||t[3]!==y?(p=[$.line,s,x,u,y],t[0]=s,t[1]=x,t[2]=u,t[3]=y,t[4]=p):p=t[4];const f=p,T="header"===c.type&&$.headerText,S="add"===c.type&&$.addText,_="remove"===c.type&&$.removeText,v="context"===c.type&&$.contextText;let j;t[5]!==T||t[6]!==S||t[7]!==_||t[8]!==v?(j=[$.lineText,T,S,_,v],t[5]=T,t[6]=S,t[7]=_,t[8]=v,t[9]=j):j=t[9];const k=j,w="add"===c.type&&$.addText,H="remove"===c.type&&$.removeText,V="context"===c.type&&$.contextText;let z;t[10]!==w||t[11]!==H||t[12]!==V?(z=[w,H,V],t[10]=w,t[11]=H,t[12]=V,t[13]=z):z=t[13];const E=z;if(c.tokens){let e,l,s,x,u;return t[14]!==c?(e=(0,h.diffLinePrefix)(c),t[14]=c,t[15]=e):e=t[15],t[16]!==E||t[17]!==e?(l=(0,b.jsx)(n.Text,{style:E,children:e}),t[16]=E,t[17]=e,t[18]=l):l=t[18],t[19]!==c.tokens?(s=(0,b.jsx)(C,{tokens:c.tokens}),t[19]=c.tokens,t[20]=s):s=t[20],t[21]!==l||t[22]!==s?(x=(0,b.jsxs)(n.Text,{style:$.lineText,children:[l,s]}),t[21]=l,t[22]=s,t[23]=x):x=t[23],t[24]!==f||t[25]!==x?(u=(0,b.jsx)(o.View,{style:f,children:x}),t[24]=f,t[25]=x,t[26]=u):u=t[26],u}let W,F;return t[27]!==c.content||t[28]!==c.segments||t[29]!==c.type||t[30]!==k?(W=c.segments?(0,b.jsxs)(n.Text,{style:$.lineText,children:[(0,b.jsx)(n.Text,{style:"add"===c.type?$.addText:$.removeText,children:c.content[0]}),c.segments.map(e=>(0,b.jsx)(L,{segment:e,lineType:c.type},`${e.changed?"c":"u"}:${e.text}`))]}):(0,b.jsx)(n.Text,{style:k,children:c.content}),t[27]=c.content,t[28]=c.segments,t[29]=c.type,t[30]=k,t[31]=W):W=t[31],t[32]!==f||t[33]!==W?(F=(0,b.jsx)(o.View,{style:f,children:W}),t[32]=f,t[33]=W,t[34]=F):F=t[34],F}function C(e){const t=(0,l.c)(6),{tokens:n}=e;let o;t[0]!==n?(o=n.map(H),t[0]=n,t[1]=o):o=t[1];const c=o;let s,x;return t[2]!==c?(s=c.map(w),t[2]=c,t[3]=s):s=t[3],t[4]!==s?(x=(0,b.jsx)(b.Fragment,{children:s}),t[4]=s,t[5]=x):x=t[5],x}function w(e){const{key:t,token:o}=e;return(0,b.jsx)(n.Text,{style:o.style?(0,p.syntaxTokenStyleFor)(o.style):void 0,children:o.text},t)}function H(e,t){return{key:`${t}-${e.text}`,token:e}}function L(e){const t=(0,l.c)(6),{segment:o,lineType:c}=e,s="add"===c?$.addText:$.removeText,x=o.changed&&("add"===c?$.addHighlight:$.removeHighlight);let u;t[0]!==s||t[1]!==x?(u=[s,x],t[0]=s,t[1]=x,t[2]=u):u=t[2];const y=u;let h;return t[3]!==o.text||t[4]!==y?(h=(0,b.jsx)(n.Text,{style:y,children:o.text}),t[3]=o.text,t[4]=y,t[5]=h):h=t[5],h}function V(e){const{key:t,line:n}=e;return(0,b.jsx)(k,{line:n},t)}function z(e,t){return{key:`${t}-${e.type}-${e.content}`,line:e}}const $=y.StyleSheet.create(e=>{const t=(0,S.getCodeInsets)(e);return{verticalScroll:{},fillHeight:{flex:1,minHeight:0},verticalContent:{flexGrow:1,paddingBottom:t.extraBottom},horizontalContent:{flexDirection:"column",paddingRight:t.extraRight},linesContainer:{alignSelf:"flex-start",padding:t.padding},line:{minWidth:"100%",paddingHorizontal:0,paddingVertical:e.spacing[1],uni__dependencies:[0]},lineText:Object.assign({fontFamily:e.fontFamily.mono,fontSize:e.fontSize.code,color:e.colors.foreground},v.isWeb?{whiteSpace:"pre",overflowWrap:"normal"}:null,{uni__dependencies:[0]}),headerLine:{backgroundColor:e.colors.surface1,uni__dependencies:[0]},headerText:{color:e.colors.foregroundMuted,uni__dependencies:[0]},addLine:{backgroundColor:"rgba(46, 160, 67, 0.15)"},addText:{color:e.colors.foreground,uni__dependencies:[0]},removeLine:{backgroundColor:"rgba(248, 81, 73, 0.1)"},removeText:{color:e.colors.foreground,uni__dependencies:[0]},addHighlight:{backgroundColor:"rgba(46, 160, 67, 0.4)"},removeHighlight:{backgroundColor:"rgba(248, 81, 73, 0.35)"},contextLine:{backgroundColor:e.colors.surface1,uni__dependencies:[0]},contextText:{color:e.colors.foregroundMuted,uni__dependencies:[0]},emptyState:{padding:e.spacing[4],alignItems:"center",justifyContent:"center",uni__dependencies:[0]},emptyText:{fontSize:e.fontSize.sm,color:e.colors.foregroundMuted,uni__dependencies:[0]}}})},4449,[690,711,348,349,36,1573,146,234,182,354,56,4445,3803,3574,3471,3867,3802,3407,279]);
|
|
16105
16105
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}});var t=r(d[0]),n=r(d[1]),c=r(d[2]),o=r(d[3]);function u(){const u=(0,t.c)(1);let s;return u[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,o.jsx)(n.Redirect,{href:(0,c.buildSessionsRoute)()}),u[0]=s):s=u[0],s}},4450,[349,1143,3477,279]);
|
|
16106
16106
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]),s=r(d[1]),n=r(d[2]),o=r(d[3]),u=r(d[4]);function c(){const c=(0,t.c)(4),l=(0,s.useLocalSearchParams)();let f;if(c[0]!==l.serverId){const t="string"==typeof l.serverId?l.serverId.trim():"";f=t.length>0?(0,o.buildSettingsHostRoute)(t):(0,o.buildSettingsRoute)(),c[0]=l.serverId,c[1]=f}else f=c[1];const v=f;let b;return c[2]!==v?(b=(0,u.jsx)(n.HostRouteBootstrapBoundary,{children:(0,u.jsx)(s.Redirect,{href:v})}),c[2]=v,c[3]=b):b=c[3],b}},4451,[349,1143,4399,3477,279]);
|
|
16107
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return R}});var e,t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),c=r(d[4]),u=(e=c)&&e.__esModule?e:{default:e};r(d[5]);var l=r(d[6]),p=r(d[7]),k=r(d[8]),f=r(d[9]),I=r(d[10]),v=r(d[11]),y=r(d[12]),S=r(d[13]),h=r(d[14]),w=r(d[15]),W=r(d[16]),E=r(d[17]);function _(e){if("string"==typeof e)return e.trim();if(Array.isArray(e)){const t=e[0];return"string"==typeof t?t.trim():""}return""}function x(e){return"agent"===e.kind?{kind:"agent",agentId:e.agentId}:"terminal"===e.kind?{kind:"terminal",terminalId:e.terminalId}:"file"===e.kind?{kind:"file",path:e.path}:"setup"===e.kind?{kind:"setup",workspaceId:e.workspaceId}:{kind:"draft",draftId:e.draftId}}function b(){if(!W.isWeb||"undefined"==typeof window)return;const e=new URL(window.location.href);e.searchParams.has("open")&&(e.searchParams.delete("open"),(0,h.replaceBrowserRouteWithCanonicalHostWorkspaceRoute)(`${e.pathname}${e.search}${e.hash}`))}function P(e){e.navigation.setParams({open:void 0}),W.isWeb&&b()}function R(){const e=(0,n.c)(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,E.jsx)(p.HostRouteBootstrapBoundary,{children:(0,E.jsx)(j,{})}),e[0]=t):t=e[0],t}function j(){const e=(0,n.c)(25),t=(0,o.useNavigation)(),c=(0,l.useRootNavigationState)(),u=(0,v.useWorkspaceLayoutStoreHydrated)(),p=(0,s.useRef)(null),[k,f]=(0,s.useState)(!1),I=(0,l.useLocalSearchParams)(),y=(0,l.useGlobalSearchParams)();let W;e[0]!==I.serverId?(W=_(I.serverId),e[0]=I.serverId,e[1]=W):W=e[1];const b=W;let R;if(e[2]!==I.workspaceId){const t=_(I.workspaceId);R=t?(0,S.decodeWorkspaceIdFromPathSegment)(t)??"":"",e[2]=I.workspaceId,e[3]=R}else R=e[3];const j=R;let D;e[4]!==y.open?(D=_(y.open),e[4]=y.open,e[5]=D):D=e[5];const $=D;let H,M,O;e[6]!==b||e[7]!==j?(H=()=>{b&&j&&(0,h.stripHostWorkspaceRouteEchoSearchFromBrowserUrlAfterCommit)()},M=[b,j],e[6]=b,e[7]=j,e[8]=H,e[9]=M):(H=e[8],M=e[9]),(0,s.useEffect)(H,M),e[10]!==u||e[11]!==t||e[12]!==$||e[13]!==c?.key||e[14]!==b||e[15]!==j?(O=()=>{if(!$)return;if(!c?.key)return;if(!u)return;const e=`${b}:${j}:${$}`;if(p.current===e)return P({navigation:t}),void f(!0);p.current=e;const n=(0,S.parseWorkspaceOpenIntent)($);n&&(0,w.prepareWorkspaceTab)({serverId:b,workspaceId:j,target:x(n),pin:"agent"===n.kind}),P({navigation:t}),f(!0)},e[10]=u,e[11]=t,e[12]=$,e[13]=c?.key,e[14]=b,e[15]=j,e[16]=O):O=e[16];const C=c?.key;let K,U;return e[17]!==u||e[18]!==t||e[19]!==$||e[20]!==b||e[21]!==C||e[22]!==j?(K=[u,t,$,C,b,j],e[17]=u,e[18]=t,e[19]=$,e[20]=b,e[21]=C,e[22]=j,e[23]=K):K=e[23],(0,s.useEffect)(O,K),!$||k&&u?(e[24]===Symbol.for("react.memo_cache_sentinel")?(U=(0,E.jsx)(A,{}),e[24]=U):U=e[24],U):null}function A(){const e=(0,n.c)(13),o=(0,k.useActiveWorkspaceSelection)();let c;e[0]!==o?(c=()=>o?[o]:[],e[0]=o,e[1]=c):c=e[1];const[u,l]=(0,s.useState)(c);let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=e=>{l(t=>t.filter(t=>!(0,y.areWorkspaceSelectionsEqual)(t,e)))},e[2]=p):p=e[2];const f=p;let I,v,S,h;if(e[3]!==o?(I=()=>{o&&l(e=>{const t=(0,y.pruneMountedWorkspaceSelections)({currentSelections:e,activeSelection:o,maxMountedWorkspaces:y.WORKSPACE_DECK_MAX_MOUNTED_WORKSPACES});return(0,y.areWorkspaceSelectionListsEqual)(e,t)?e:t})},v=[o],e[3]=o,e[4]=I,e[5]=v):(I=e[4],v=e[5]),(0,s.useEffect)(I,v),!o)return null;if(e[6]!==o||e[7]!==u){let t;e[9]!==o?(t=e=>(0,E.jsx)(D,{selection:e,activeSelection:o,onUnmountInactive:f},(0,y.getWorkspaceSelectionKey)(e)),e[9]=o,e[10]=t):t=e[10],S=u.map(t),e[6]=o,e[7]=u,e[8]=S}else S=e[8];return e[11]!==S?(h=(0,E.jsx)(t.View,{style:$.deck,children:S}),e[11]=S,e[12]=h):h=e[12],h}function D(e){const o=(0,n.c)(13),{selection:c,activeSelection:u,onUnmountInactive:l}=e,p=(0,y.areWorkspaceSelectionsEqual)(c,u),k=(0,f.useHasHydratedWorkspaces)(c.serverId),v=(0,f.useWorkspaceExists)(c.serverId,c.workspaceId),S=(0,y.shouldKeepWorkspaceDeckEntryMounted)({isActive:p,hasHydratedWorkspaces:k,workspaceExists:v});let h,w;if(o[0]!==l||o[1]!==c||o[2]!==S?(h=()=>{S||l(c)},w=[l,c,S],o[0]=l,o[1]=c,o[2]=S,o[3]=h,o[4]=w):(h=o[3],w=o[4]),(0,s.useEffect)(h,w),!S)return null;const W=p?$.activeDeckEntry:$.inactiveDeckEntry,_=`workspace-deck-entry-${c.serverId}:${c.workspaceId}`;let x,b;return o[5]!==p||o[6]!==c.serverId||o[7]!==c.workspaceId?(x=(0,E.jsx)(I.WorkspaceScreen,{serverId:c.serverId,workspaceId:c.workspaceId,isRouteFocused:p}),o[5]=p,o[6]=c.serverId,o[7]=c.workspaceId,o[8]=x):x=o[8],o[9]!==W||o[10]!==_||o[11]!==x?(b=(0,E.jsx)(t.View,{style:W,testID:_,children:x}),o[9]=W,o[10]=_,o[11]=x,o[12]=b):b=o[12],b}const $=u.default.create({deck:{flex:1},activeDeckEntry:{flex:1},inactiveDeckEntry:{display:"none",flex:1}})},4452,[348,349,36,1148,59,146,1143,4399,3487,3525,4453,3436,
|
|
16108
|
-
__d(function(g,r,i,_a,m,_e,_d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"WorkspaceScreen",{enumerable:!0,get:function(){return Yt}});var t=r(_d[0]),n=r(_d[1]),a=r(_d[2]),o=r(_d[3]),s=r(_d[4]),c=r(_d[5]),l=r(_d[6]),d=r(_d[7]);r(_d[8]);var u=e(r(_d[9])),p=e(r(_d[10]));r(_d[11]),r(_d[12]),r(_d[13]);var b=r(_d[14]),k=r(_d[15]),h=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[16])),w=r(_d[17]),f=r(_d[18]),I=r(_d[19]),T=r(_d[20]),y=r(_d[21]),S=e(r(_d[22])),C=r(_d[23]),x=r(_d[24]),v=r(_d[25]),P=r(_d[26]),W=r(_d[27]),j=r(_d[28]),B=r(_d[29]),M=r(_d[30]),A=r(_d[31]),R=r(_d[32]),_=r(_d[33]),D=r(_d[34]),F=r(_d[35]),z=r(_d[36]),L=r(_d[37]),H=r(_d[38]),E=r(_d[39]),O=r(_d[40]),V=r(_d[41]),N=r(_d[42]),U=r(_d[43]),K=r(_d[44]),$=r(_d[45]),q=r(_d[46]),G=r(_d[47]),Q=r(_d[48]),X=r(_d[49]),J=r(_d[50]),Y=r(_d[51]),Z=r(_d[52]),ee=r(_d[53]),te=r(_d[54]),ne=r(_d[55]),ae=r(_d[56]),oe=r(_d[57]),se=r(_d[58]),re=r(_d[59]),ie=r(_d[60]),ce=r(_d[61]),le=r(_d[62]),de=r(_d[63]),ue=r(_d[64]),pe=r(_d[65]),be=r(_d[66]),ge=r(_d[67]),me=r(_d[68]),ke=r(_d[69]),he=r(_d[70]),we=r(_d[71]),fe=r(_d[72]),Ie=r(_d[73]),Te=r(_d[74]),ye=r(_d[75]),Se=r(_d[76]),Ce=r(_d[77]),xe=r(_d[78]),ve=r(_d[79]),Pe=r(_d[80]),We=r(_d[81]),je=r(_d[82]),Be=r(_d[83]),Me=r(_d[84]),Ae=r(_d[85]),Re=r(_d[86]),De=r(_d[87]),Fe=r(_d[88]),ze=r(_d[89]),Le=r(_d[90]),He=r(_d[91]),Ee=r(_d[92]),Oe=r(_d[93]),Ve=r(_d[94]),Ne=r(_d[95]),Ue=r(_d[96]),Ke=r(_d[97]),$e=r(_d[98]),qe=r(_d[99]),Ge=r(_d[100]),Qe=r(_d[101]),Xe=r(_d[102]);const Je=[],Ye=[],Ze=new Set,et=new Set;function tt(e){return e?.scripts??Ye}function nt(e){const t=e?.target;return"file"!==t?.kind?{path:null}:{path:t.path,lineStart:t.lineStart,lineEnd:t.lineEnd}}const at=(0,y.withUnistyles)(o.ActivityIndicator),ot=(0,y.withUnistyles)(I.Ellipsis),st=(0,y.withUnistyles)(I.EllipsisVertical),rt=(0,y.withUnistyles)(I.ChevronDown),it=(0,y.withUnistyles)(I.Copy),ct=(0,y.withUnistyles)(I.RotateCw),lt=(0,y.withUnistyles)(I.ArrowLeftToLine),dt=(0,y.withUnistyles)(I.ArrowRightToLine),ut=(0,y.withUnistyles)(I.CopyX),pt=(0,y.withUnistyles)(I.Pencil),bt=(0,y.withUnistyles)(I.X),gt=(0,y.withUnistyles)(I.SquarePen),mt=(0,y.withUnistyles)(I.SquareTerminal),kt=(0,y.withUnistyles)(I.Globe),ht=(0,y.withUnistyles)(I.Import),wt=(0,y.withUnistyles)(I.Settings),ft=(0,y.withUnistyles)(I.PanelRight),It=(0,y.withUnistyles)(L.SourceControlPanelIcon);const Tt=(0,y.withUnistyles)(function(e){const t=(0,s.c)(6),{iconKey:n,size:a,color:o}=e,c=void 0===o?"":o;let l;t[0]!==n?(l=(0,$e.getProviderIcon)(n),t[0]=n,t[1]=l):l=t[1];const d=l;let u;return t[2]!==d||t[3]!==c||t[4]!==a?(u=(0,Xe.jsx)(d,{size:a,color:c}),t[2]=d,t[3]=c,t[4]=a,t[5]=u):u=t[5],u}),yt=e=>({color:e.colors.foreground}),St=e=>({color:e.colors.foregroundMuted}),Ct={strokeWidth:1.5},xt=(0,Xe.jsx)(gt,{size:16,uniProps:St}),vt=(0,Xe.jsx)(mt,{size:16,uniProps:St}),Pt=(0,Xe.jsx)(kt,{size:16,uniProps:St}),Wt=(0,Xe.jsx)(ht,{size:16,uniProps:St}),jt=(0,Xe.jsx)(it,{size:16,uniProps:St}),Bt=(0,Xe.jsx)(wt,{size:16,uniProps:St}),Mt=(0,Xe.jsx)(C.SidebarMenuToggle,{});function At(e){if("string"!=typeof e)return null;const t=e.trim();return t.length>0?t:null}function Rt(e){try{return decodeURIComponent(e)}catch{return e}}function _t(e){const t=(0,s.c)(6);let n;t[0]!==e.workspaceLayout?(n=(0,ee.getFocusedBrowserId)(e.workspaceLayout),t[0]=e.workspaceLayout,t[1]=n):n=t[1];const a=n;let o,l;t[2]!==a||t[3]!==e.workspaceId?(o=()=>{(0,Ee.getIsElectron)()&&(0,ge.getDesktopHost)()?.browser?.setWorkspaceActiveBrowser?.({workspaceId:e.workspaceId,browserId:a})},l=[a,e.workspaceId],t[2]=a,t[3]=e.workspaceId,t[4]=o,t[5]=l):(o=t[4],l=t[5]),(0,c.useEffect)(o,l)}function Dt(e,t){return"draft"===e.target.kind?t.newAgent:"setup"===e.target.kind?t.setup:"terminal"===e.target.kind?t.terminal:"browser"===e.target.kind?t.browser:"pluginView"===e.target.kind?"Extension":"file"===e.target.kind?e.target.path.split("/").findLast(Boolean)??e.target.path:t.agent}function Ft(e){const t=(0,s.c)(4),{activeTab:n,normalizedServerId:a,normalizedWorkspaceId:o}=e;if(!n)return null;let c;return t[0]!==n||t[1]!==a||t[2]!==o?(c=(0,Xe.jsx)(zt,{activeTab:n,normalizedServerId:a,normalizedWorkspaceId:o}),t[0]=n,t[1]=a,t[2]=o,t[3]=c):c=t[3],c}function zt(e){const a=(0,s.c)(7),{activeTab:o,normalizedServerId:c,normalizedWorkspaceId:l}=e,{t:d}=(0,w.useTranslation)();let u,p;return a[0]!==d?(u=e=>(0,Xe.jsxs)(Xe.Fragment,{children:[(0,Xe.jsx)(t.View,{style:In.switcherTriggerIcon,testID:"workspace-active-tab-icon",children:(0,Xe.jsx)(we.WorkspaceTabIcon,{presentation:e,active:!0})}),(0,Xe.jsx)(n.Text,{style:In.switcherTriggerText,numberOfLines:1,children:"loading"===e.titleState?d("workspace.tabs.loading"):e.label})]}),a[0]=d,a[1]=u):u=a[1],a[2]!==o||a[3]!==c||a[4]!==l||a[5]!==u?(p=(0,Xe.jsx)(we.WorkspaceTabPresentationResolver,{tab:o,serverId:c,workspaceId:l,children:u}),a[2]=o,a[3]=c,a[4]=l,a[5]=u,a[6]=p):p=a[6],p}function Lt(e){const t=(0,s.c)(5),{label:n,titleState:a}=e,{t:o}=(0,w.useTranslation)();let l,d;return t[0]!==n||t[1]!==o||t[2]!==a?(l=()=>{if(Ee.isNative||"undefined"==typeof document)return;const e=n.trim();document.title="loading"===a?o("workspace.tabs.loading"):e||o("workspace.tabs.fallback.workspace")},d=[n,a,o],t[0]=n,t[1]=o,t[2]=a,t[3]=l,t[4]=d):(l=t[3],d=t[4]),(0,c.useEffect)(l,d),null}function Ht(){}function Et({open:e,pressed:t}){return[In.mobileTabMenuTrigger,(Boolean(e)||Boolean(t))&&In.mobileTabMenuTriggerActive]}function Ot({pressed:e}){return[In.switcherTrigger,Boolean(e)&&In.switcherTriggerPressed]}function Vt({pressed:e}){return[In.activeTabCloseButton,Boolean(e)&&In.activeTabCloseButtonPressed]}function Nt({pressed:e}){return[In.undoToastButton,Boolean(e)&&In.undoToastButtonPressed]}function Ut(e){const o=(0,s.c)(8),{label:c,onUndo:l}=e;let d,u,p,b;return o[0]!==c?(d=(0,Xe.jsx)(n.Text,{style:In.undoToastText,children:c}),o[0]=c,o[1]=d):d=o[1],o[2]===Symbol.for("react.memo_cache_sentinel")?(u=(0,Xe.jsx)(n.Text,{style:In.undoToastAction,children:"Undo"}),o[2]=u):u=o[2],o[3]!==l?(p=(0,Xe.jsx)(a.Pressable,{testID:"workspace-tab-close-undo-button",accessibilityRole:"button",accessibilityLabel:"Undo close tab",hitSlop:8,style:Nt,onPress:l,children:u}),o[3]=l,o[4]=p):p=o[4],o[5]!==d||o[6]!==p?(b=(0,Xe.jsxs)(t.View,{style:In.undoToastRow,children:[d,p]}),o[5]=d,o[6]=p,o[7]=b):b=o[7],b}function Kt(e){const t=(0,s.c)(15),{menuTestIDBase:n,presentationLabel:a,menuEntries:o}=e,{t:c}=(0,w.useTranslation)(),l=`${n}-trigger`;let d,u,p,b,k,h;return t[0]!==a||t[1]!==c?(d=c("workspace.tabs.menu.openFor",{label:a}),t[0]=a,t[1]=c,t[2]=d):d=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(u=(0,Xe.jsx)(ot,{size:14,uniProps:St}),t[3]=u):u=t[3],t[4]!==l||t[5]!==d?(p=(0,Xe.jsx)(R.DropdownMenuTrigger,{testID:l,accessibilityRole:"button",accessibilityLabel:d,hitSlop:8,style:Et,children:u}),t[4]=l,t[5]=d,t[6]=p):p=t[6],t[7]!==o?(b=o.map($t),t[7]=o,t[8]=b):b=t[8],t[9]!==n||t[10]!==b?(k=(0,Xe.jsx)(R.DropdownMenuContent,{side:"bottom",align:"end",width:220,testID:n,children:b}),t[9]=n,t[10]=b,t[11]=k):k=t[11],t[12]!==p||t[13]!==k?(h=(0,Xe.jsxs)(R.DropdownMenu,{children:[p,k]}),t[12]=p,t[13]=k,t[14]=h):h=t[14],h}function $t(e){return"separator"===e.kind?(0,Xe.jsx)(R.DropdownMenuSeparator,{},e.key):(0,Xe.jsx)(qt,{entry:e},e.key)}function qt(e){const t=(0,s.c)(18),{entry:a}=e;let o;e:switch(a.icon){case"copy":{let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Xe.jsx)(it,{size:16,uniProps:St}),t[0]=e):e=t[0],o=e;break e}case"rotate-cw":{let e;t[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Xe.jsx)(ct,{size:16,uniProps:St}),t[1]=e):e=t[1],o=e;break e}case"arrow-left-to-line":{let e;t[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Xe.jsx)(lt,{size:16,uniProps:St}),t[2]=e):e=t[2],o=e;break e}case"arrow-right-to-line":{let e;t[3]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Xe.jsx)(dt,{size:16,uniProps:St}),t[3]=e):e=t[3],o=e;break e}case"copy-x":{let e;t[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Xe.jsx)(ut,{size:16,uniProps:St}),t[4]=e):e=t[4],o=e;break e}case"pencil":{let e;t[5]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Xe.jsx)(pt,{size:16,uniProps:St}),t[5]=e):e=t[5],o=e;break e}case"x":{let e;t[6]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Xe.jsx)(bt,{size:16,uniProps:St}),t[6]=e):e=t[6],o=e;break e}default:o=void 0}const c=o;let l;t[7]!==a.hint?(l=a.hint?(0,Xe.jsx)(n.Text,{style:In.menuItemHint,children:a.hint}):void 0,t[7]=a.hint,t[8]=l):l=t[8];const d=l;let u;return t[9]!==a.destructive||t[10]!==a.disabled||t[11]!==a.label||t[12]!==a.onSelect||t[13]!==a.testID||t[14]!==a.tooltip||t[15]!==c||t[16]!==d?(u=(0,Xe.jsx)(R.DropdownMenuItem,{testID:a.testID,disabled:a.disabled,destructive:a.destructive,onSelect:a.onSelect,tooltip:a.tooltip,leading:c,trailing:d,children:a.label}),t[9]=a.destructive,t[10]=a.disabled,t[11]=a.label,t[12]=a.onSelect,t[13]=a.testID,t[14]=a.tooltip,t[15]=c,t[16]=d,t[17]=u):u=t[17],u}function Gt(e){const t=(0,s.c)(90),{tab:n,tabIndex:a,tabCount:o,normalizedServerId:c,normalizedWorkspaceId:l,selected:d,active:u,onPress:p,onCopyResumeCommand:b,onCopyAgentId:k,onCopyFilePath:h,onReloadAgent:f,onRenameTab:I,onCloseTab:T,onCloseTabsAbove:y,onCloseTabsBelow:S,onCloseOtherTabs:C,onRenameAgent:x,onTagAgent:v,onSetKanbanBucket:P}=e,{t:W}=(0,w.useTranslation)();let j,B,M,A,R,_,D,F,z,L,H,E,O;t[0]!==W?(j=W("workspace.tabs.menu.copyResumeCommand"),t[0]=W,t[1]=j):j=t[1],t[2]!==W?(B=W("workspace.tabs.menu.copyAgentId"),t[2]=W,t[3]=B):B=t[3],t[4]!==W?(M=W("workspace.tabs.menu.copyFilePath"),t[4]=W,t[5]=M):M=t[5],t[6]!==W?(A=W("workspace.tabs.menu.rename"),t[6]=W,t[7]=A):A=t[7],t[8]!==W?(R=W("workspace.tabs.menu.closeAbove"),t[8]=W,t[9]=R):R=t[9],t[10]!==W?(_=W("workspace.tabs.menu.closeBelow"),t[10]=W,t[11]=_):_=t[11],t[12]!==W?(D=W("workspace.tabs.menu.closeLeft"),t[12]=W,t[13]=D):D=t[13],t[14]!==W?(F=W("workspace.tabs.menu.closeRight"),t[14]=W,t[15]=F):F=t[15],t[16]!==W?(z=W("workspace.tabs.menu.closeOthers"),t[16]=W,t[17]=z):z=t[17],t[18]!==W?(L=W("workspace.tabs.menu.reloadAgent"),t[18]=W,t[19]=L):L=t[19],t[20]!==W?(H=W("workspace.tabs.menu.reloadAgentTooltip"),t[20]=W,t[21]=H):H=t[21],t[22]!==W?(E=W("workspace.tabs.menu.close"),t[22]=W,t[23]=E):E=t[23],t[24]!==j||t[25]!==L||t[26]!==H||t[27]!==E||t[28]!==B||t[29]!==M||t[30]!==A||t[31]!==R||t[32]!==_||t[33]!==D||t[34]!==F||t[35]!==z?(O={copyResumeCommand:j,copyAgentId:B,copyFilePath:M,rename:A,closeAbove:R,closeBelow:_,closeLeft:D,closeRight:F,closeOthers:z,reloadAgent:L,reloadAgentTooltip:H,close:E},t[24]=j,t[25]=L,t[26]=H,t[27]=E,t[28]=B,t[29]=M,t[30]=A,t[31]=R,t[32]=_,t[33]=D,t[34]=F,t[35]=z,t[36]=O):O=t[36];const V=O;let N;t[37]!==n.target?(N=(0,ae.buildDeterministicWorkspaceTabId)(n.target),t[37]=n.target,t[38]=N):N=t[38];const U=`workspace-tab-menu-${N}`;let K;t[39]!==U||t[40]!==C||t[41]!==T||t[42]!==y||t[43]!==S||t[44]!==k||t[45]!==h||t[46]!==b||t[47]!==f||t[48]!==x||t[49]!==I||t[50]!==P||t[51]!==v||t[52]!==n||t[53]!==o||t[54]!==a||t[55]!==V?(K=(0,Ce.buildWorkspaceTabMenuEntries)({surface:"mobile",tab:n,index:a,tabCount:o,menuTestIDBase:U,onCopyResumeCommand:b,onCopyAgentId:k,onCopyFilePath:h,onReloadAgent:f,onRenameTab:I,onCloseTab:T,onCloseTabsBefore:y,onCloseTabsAfter:S,onCloseOtherTabs:C,onRenameAgent:x,onTagAgent:v,onSetKanbanBucket:P,labels:V}),t[39]=U,t[40]=C,t[41]=T,t[42]=y,t[43]=S,t[44]=k,t[45]=h,t[46]=b,t[47]=f,t[48]=x,t[49]=I,t[50]=P,t[51]=v,t[52]=n,t[53]=o,t[54]=a,t[55]=V,t[56]=K):K=t[56];const $=K;let q,G,Q,X,J,Y;t[57]!==W?(q=W("workspace.tabs.fallback.newAgent"),t[57]=W,t[58]=q):q=t[58],t[59]!==W?(G=W("workspace.tabs.fallback.setup"),t[59]=W,t[60]=G):G=t[60],t[61]!==W?(Q=W("workspace.tabs.fallback.terminal"),t[61]=W,t[62]=Q):Q=t[62],t[63]!==W?(X=W("workspace.tabs.fallback.browser"),t[63]=W,t[64]=X):X=t[64],t[65]!==W?(J=W("workspace.tabs.fallback.agent"),t[65]=W,t[66]=J):J=t[66],t[67]!==q||t[68]!==G||t[69]!==Q||t[70]!==X||t[71]!==J?(Y={newAgent:q,setup:G,terminal:Q,browser:X,agent:J},t[67]=q,t[68]=G,t[69]=Q,t[70]=X,t[71]=J,t[72]=Y):Y=t[72];const Z=Y;let ee;t[73]!==Z||t[74]!==n?(ee=Dt(n,Z),t[73]=Z,t[74]=n,t[75]=ee):ee=t[75];const te=ee;let ne;t[76]!==te||t[77]!==$||t[78]!==U?(ne=(0,Xe.jsx)(Kt,{menuTestIDBase:U,presentationLabel:te,menuEntries:$}),t[76]=te,t[77]=$,t[78]=U,t[79]=ne):ne=t[79];const oe=ne;let se;t[80]!==u||t[81]!==p||t[82]!==d||t[83]!==oe?(se=e=>(0,Xe.jsx)(we.WorkspaceTabOptionRow,{presentation:e,selected:d,active:u,onPress:p,trailingAccessory:oe}),t[80]=u,t[81]=p,t[82]=d,t[83]=oe,t[84]=se):se=t[84];const re=se;let ie;return t[85]!==c||t[86]!==l||t[87]!==re||t[88]!==n?(ie=(0,Xe.jsx)(we.WorkspaceTabPresentationResolver,{tab:n,serverId:c,workspaceId:l,children:re}),t[85]=c,t[86]=l,t[87]=re,t[88]=n,t[89]=ie):ie=t[89],ie}const Qt=(0,c.memo)(function(e){const n=(0,s.c)(57),{tabs:o,activeTabKey:l,activeTab:d,tabSwitcherOptions:u,tabByKey:b,normalizedServerId:k,normalizedWorkspaceId:h,onSelectSwitcherTab:f,onCopyResumeCommand:I,onCopyAgentId:T,onCopyFilePath:y,onReloadAgent:S,onRenameTab:C,onCloseTab:x,onCloseActiveTab:v,onCloseTabsAbove:P,onCloseTabsBelow:W,onCloseOtherTabs:j,onRenameAgent:M,onTagAgent:A,onSetKanbanBucket:R}=e,{t:_}=(0,w.useTranslation)(),[D,F]=(0,c.useState)(!1),z=(0,c.useRef)(null);let L;n[0]!==o?(L=new Map,o.forEach((e,t)=>{L.set(e.key,t)}),n[0]=o,n[1]=L):L=n[1];const H=L;let E;n[2]===Symbol.for("react.memo_cache_sentinel")?(E=()=>{p.default.dismiss(),F(!0)},n[2]=E):E=n[2];const O=E;let V;n[3]!==d||n[4]!==v?(V=()=>{d&&v&&v(d.tabId)},n[3]=d,n[4]=v,n[5]=V):V=n[5];const N=V;let U;n[6]!==k||n[7]!==h||n[8]!==j||n[9]!==x||n[10]!==P||n[11]!==W||n[12]!==T||n[13]!==y||n[14]!==I||n[15]!==S||n[16]!==M||n[17]!==C||n[18]!==R||n[19]!==A||n[20]!==b||n[21]!==H||n[22]!==o.length?(U=e=>{const{option:n,selected:a,active:s,onPress:c}=e,l=b.get(n.id);if(!l)return(0,Xe.jsx)(t.View,{});const d=H.get(l.key)??-1;return d<0?(0,Xe.jsx)(t.View,{}):(0,Xe.jsx)(Gt,{tab:l,tabIndex:d,tabCount:o.length,normalizedServerId:k,normalizedWorkspaceId:h,selected:a,active:s,onPress:c,onCopyResumeCommand:I,onCopyAgentId:T,onCopyFilePath:y,onReloadAgent:S,onRenameTab:C,onCloseTab:x,onCloseTabsAbove:P,onCloseTabsBelow:W,onCloseOtherTabs:j,onRenameAgent:M,onTagAgent:A,onSetKanbanBucket:R})},n[6]=k,n[7]=h,n[8]=j,n[9]=x,n[10]=P,n[11]=W,n[12]=T,n[13]=y,n[14]=I,n[15]=S,n[16]=M,n[17]=C,n[18]=R,n[19]=A,n[20]=b,n[21]=H,n[22]=o.length,n[23]=U):U=n[23];const K=U;let $,q,G,Q,X,J,Y,Z,ee,te;return n[24]!==_||n[25]!==o.length?($=_("workspace.tabs.switcher.trigger",{count:o.length}),n[24]=_,n[25]=o.length,n[26]=$):$=n[26],n[27]!==d||n[28]!==k||n[29]!==h?(q=(0,Xe.jsx)(t.View,{style:In.switcherTriggerLeft,children:(0,Xe.jsx)(Ft,{activeTab:d,normalizedServerId:k,normalizedWorkspaceId:h})}),n[27]=d,n[28]=k,n[29]=h,n[30]=q):q=n[30],n[31]===Symbol.for("react.memo_cache_sentinel")?(G=(0,Xe.jsx)(rt,{size:14,uniProps:St}),n[31]=G):G=n[31],n[32]!==$||n[33]!==q?(Q=(0,Xe.jsxs)(a.Pressable,{ref:z,testID:"workspace-tab-switcher-trigger",accessibilityRole:"button",accessibilityLabel:$,style:Ot,onPress:O,children:[q,G]}),n[32]=$,n[33]=q,n[34]=Q):Q=n[34],n[35]!==d||n[36]!==N||n[37]!==v?(X=d&&v?(0,Xe.jsx)(a.Pressable,{testID:"workspace-active-tab-close",accessibilityRole:"button",accessibilityLabel:"Close current tab",hitSlop:8,style:Vt,onPress:N,children:(0,Xe.jsx)(bt,{size:16,uniProps:St})}):null,n[35]=d,n[36]=N,n[37]=v,n[38]=X):X=n[38],n[39]!==Q||n[40]!==X?(J=(0,Xe.jsxs)(t.View,{style:In.switcherRow,children:[Q,X]}),n[39]=Q,n[40]=X,n[41]=J):J=n[41],n[42]!==_?(Y=_("workspace.tabs.switcher.title"),n[42]=_,n[43]=Y):Y=n[43],n[44]!==_?(Z=_("workspace.tabs.switcher.searchPlaceholder"),n[44]=_,n[45]=Z):Z=n[45],n[46]!==l||n[47]!==D||n[48]!==f||n[49]!==K||n[50]!==Y||n[51]!==Z||n[52]!==u?(ee=(0,Xe.jsx)(B.Combobox,{options:u,value:l,onSelect:f,searchable:!1,title:Y,searchPlaceholder:Z,open:D,onOpenChange:F,anchorRef:z,renderOption:K}),n[46]=l,n[47]=D,n[48]=f,n[49]=K,n[50]=Y,n[51]=Z,n[52]=u,n[53]=ee):ee=n[53],n[54]!==ee||n[55]!==J?(te=(0,Xe.jsxs)(t.View,{style:In.mobileTabsRow,testID:"workspace-tabs-row",children:[J,ee]}),n[54]=ee,n[55]=J,n[56]=te):te=n[56],te}),Xt=(0,c.memo)(function(e){const n=(0,s.c)(18),{tabDescriptor:a,isVisible:o,isWorkspaceFocused:c,isPaneFocused:l,paneId:d,buildPaneContentModel:u}=e;let p;n[0]!==u||n[1]!==d||n[2]!==a?(p=u({paneId:d,tab:a}),n[0]=u,n[1]=d,n[2]=a,n[3]=p):p=n[3];const b=p,k=o?In.mobileMountedTabSlotVisible:In.mobileMountedTabSlotHidden,h=`MobileMountedTabSlot:${a.kind}:${a.tabId}`,w=o?"auto":"none";let f,I,T,y;return n[4]!==b||n[5]!==l||n[6]!==c?(f=(0,Xe.jsx)(Me.WorkspacePaneContent,{content:b,isWorkspaceFocused:c,isPaneFocused:l}),n[4]=b,n[5]=l,n[6]=c,n[7]=f):f=n[7],n[8]!==k||n[9]!==w||n[10]!==f?(I=(0,Xe.jsx)(t.View,{style:k,pointerEvents:w,children:f}),n[8]=k,n[9]=w,n[10]=f,n[11]=I):I=n[11],n[12]!==o||n[13]!==I?(T=(0,Xe.jsx)(z.MountedTabActiveContext,{value:o,children:I}),n[12]=o,n[13]=I,n[14]=T):T=n[14],n[15]!==h||n[16]!==T?(y=(0,Xe.jsx)(Ge.RenderProfile,{id:h,children:T}),n[15]=h,n[16]=T,n[17]=y):y=n[17],y});function Jt(e){const t=(0,c.useRef)(new Map),n=(0,c.useMemo)(()=>{const n=new Map;for(const a of e){const e=t.current.get(a.tabId);e&&e.key===a.key&&e.kind===a.kind&&(0,ae.workspaceTabTargetsEqual)(e.target,a.target)?n.set(a.tabId,e):n.set(a.tabId,a)}return n},[e]);return(0,c.useEffect)(()=>{t.current=n},[n]),n}const Yt=(0,c.memo)(function(e){const t=(0,s.c)(4),{serverId:n,workspaceId:a,isRouteFocused:o}=e,c=(0,d.useIsFocused)(),l=o??c;let u;return t[0]!==n||t[1]!==l||t[2]!==a?(u=(0,Xe.jsx)(fn,{serverId:n,workspaceId:a,isRouteFocused:l}),t[0]=n,t[1]=l,t[2]=a,t[3]=u):u=t[3],u});function Zt(){const e=(0,c.useRef)(new Set),[t,n]=(0,c.useState)(et);return{closingTabIds:t,closeTab:(0,c.useCallback)(async(t,a)=>{const o=t.trim();if(o&&!e.current.has(o)){e.current.add(o),n(new Set(e.current));try{await a()}finally{e.current.delete(o),n(new Set(e.current))}}},[])}}function en(e){const n=(0,s.c)(15),{profile:a,disabled:o,onCreateTerminalWithProfile:c}=e;let l;n[0]!==c||n[1]!==a.args||n[2]!==a.command||n[3]!==a.name?(l=()=>{c({name:a.name,command:a.command,args:a.args})},n[0]=c,n[1]=a.args,n[2]=a.command,n[3]=a.name,n[4]=l):l=n[4];const d=l;let u;n[5]!==a?(u=(0,Ke.getTerminalProfileIcon)(a),n[5]=a,n[6]=u):u=n[6];const p=u;let b;e:{if(!p){let e;n[7]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Xe.jsx)(t.View,{style:In.headerMenuProfileIconWrapper,children:(0,Xe.jsx)(mt,{size:16,uniProps:St})}),n[7]=e):e=n[7],b=e;break e}let e;n[8]!==p?(e=(0,Xe.jsx)(t.View,{style:In.headerMenuProfileIconWrapper,children:(0,Xe.jsx)(Tt,{iconKey:p,size:16,uniProps:St})}),n[8]=p,n[9]=e):e=n[9],b=e}const k=b;let h;return n[10]!==o||n[11]!==d||n[12]!==k||n[13]!==a.name?(h=(0,Xe.jsx)(R.DropdownMenuItem,{leading:k,disabled:o,onSelect:d,children:a.name}),n[10]=o,n[11]=d,n[12]=k,n[13]=a.name,n[14]=h):h=n[14],h}function tn(e){const t=(0,s.c)(3),{hovered:n,open:a,isMobile:o}=e,c=o?st:ot,l=n||a?yt:St;let d;return t[0]!==c||t[1]!==l?(d=(0,Xe.jsx)(c,{size:16,uniProps:l}),t[0]=c,t[1]=l,t[2]=d):d=t[2],d}function nn(e){const t=(0,s.c)(87),{normalizedServerId:n,currentBranchName:a,showWorkspaceSetup:o,showCreateBrowserTab:c,isMobile:l,createTerminalDisabled:d,importAgentDisabled:u,copyPathDisabled:p,menuNewAgentIcon:b,menuNewTerminalIcon:h,menuNewBrowserIcon:f,menuImportIcon:I,menuCopyIcon:T,menuSettingsIcon:y,onCreateDraftTab:S,onCreateTerminal:C,onCreateTerminalWithProfile:x,onCreateBrowser:v,onOpenImportSheet:P,onCopyWorkspacePath:W,onCopyBranchName:j,onOpenSetupTab:B}=e,{t:M}=(0,w.useTranslation)(),A=(0,k.useRouter)(),{config:_}=(0,Ue.useDaemonConfig)(n),D=_?.terminalProfiles;let F;t[0]!==D?(F=(0,Ke.resolveTerminalProfiles)(D),t[0]=D,t[1]=F):F=t[1];const z=F;let L;t[2]!==n||t[3]!==A?(L=()=>{A.push((0,Ve.buildSettingsHostSectionRoute)(n,"terminals"))},t[2]=n,t[3]=A,t[4]=L):L=t[4];const H=L;let E;t[5]!==l?(E=e=>{const{hovered:t,open:n}=e;return(0,Xe.jsx)(tn,{hovered:t,open:n,isMobile:l})},t[5]=l,t[6]=E):E=t[6];const O=E,V=l?In.compactHeaderActionButton:In.headerActionButton;let N,U,K,$,q,G,Q,X,J,Y,Z,ee,te,ne,ae,oe,se,re,ie,ce,le,de;if(t[7]!==M?(N=M("workspace.header.actions.workspaceActions"),t[7]=M,t[8]=N):N=t[8],t[9]!==O||t[10]!==V||t[11]!==N?(U=(0,Xe.jsx)(R.DropdownMenuTrigger,{testID:"workspace-header-menu-trigger",style:V,accessibilityRole:"button",accessibilityLabel:N,children:O}),t[9]=O,t[10]=V,t[11]=N,t[12]=U):U=t[12],t[13]!==M?(K=M("workspace.header.actions.newAgent"),t[13]=M,t[14]=K):K=t[14],t[15]!==b||t[16]!==S||t[17]!==K?($=(0,Xe.jsx)(R.DropdownMenuItem,{testID:"workspace-header-new-agent",leading:b,onSelect:S,children:K}),t[15]=b,t[16]=S,t[17]=K,t[18]=$):$=t[18],t[19]!==f||t[20]!==v||t[21]!==c||t[22]!==M?(q=c?(0,Xe.jsx)(R.DropdownMenuItem,{testID:"workspace-header-new-browser",leading:f,onSelect:v,children:M("workspace.header.actions.newBrowser")}):null,t[19]=f,t[20]=v,t[21]=c,t[22]=M,t[23]=q):q=t[23],t[24]!==M?(G=M("workspace.header.actions.importSession"),t[24]=M,t[25]=G):G=t[25],t[26]!==u||t[27]!==I||t[28]!==P||t[29]!==G?(Q=(0,Xe.jsx)(R.DropdownMenuItem,{testID:"workspace-header-import-agent",leading:I,disabled:u,onSelect:P,children:G}),t[26]=u,t[27]=I,t[28]=P,t[29]=G,t[30]=Q):Q=t[30],t[31]!==M?(X=M("workspace.header.actions.copyPath"),t[31]=M,t[32]=X):X=t[32],t[33]!==p||t[34]!==T||t[35]!==W||t[36]!==X?(J=(0,Xe.jsx)(R.DropdownMenuItem,{testID:"workspace-header-copy-path",leading:T,disabled:p,onSelect:W,children:X}),t[33]=p,t[34]=T,t[35]=W,t[36]=X,t[37]=J):J=t[37],t[38]!==a||t[39]!==T||t[40]!==j||t[41]!==M?(Y=a?(0,Xe.jsx)(R.DropdownMenuItem,{testID:"workspace-header-copy-branch-name",leading:T,onSelect:j,children:M("workspace.header.actions.copyBranchName")}):null,t[38]=a,t[39]=T,t[40]=j,t[41]=M,t[42]=Y):Y=t[42],t[43]!==y||t[44]!==B||t[45]!==o||t[46]!==M?(Z=o?(0,Xe.jsxs)(Xe.Fragment,{children:[(0,Xe.jsx)(R.DropdownMenuSeparator,{}),(0,Xe.jsx)(R.DropdownMenuItem,{testID:"workspace-header-show-setup",leading:y,onSelect:B,children:M("workspace.header.actions.showSetup")})]}):null,t[43]=y,t[44]=B,t[45]=o,t[46]=M,t[47]=Z):Z=t[47],t[48]===Symbol.for("react.memo_cache_sentinel")?(ee=(0,Xe.jsx)(R.DropdownMenuSeparator,{}),t[48]=ee):ee=t[48],t[49]!==M?(te=M("workspace.tabs.actions.terminalProfilesMenu"),t[49]=M,t[50]=te):te=t[50],t[51]!==te?(ne=(0,Xe.jsx)(R.DropdownMenuLabel,{children:te}),t[51]=te,t[52]=ne):ne=t[52],t[53]!==M?(ae=M("workspace.header.actions.newTerminal"),t[53]=M,t[54]=ae):ae=t[54],t[55]!==d||t[56]!==h||t[57]!==C||t[58]!==ae?(oe=(0,Xe.jsx)(R.DropdownMenuItem,{testID:"workspace-header-new-terminal",leading:h,disabled:d,onSelect:C,children:ae}),t[55]=d,t[56]=h,t[57]=C,t[58]=ae,t[59]=oe):oe=t[59],t[60]!==d||t[61]!==x||t[62]!==z){let e;t[64]!==d||t[65]!==x?(e=e=>(0,Xe.jsx)(en,{profile:e,disabled:d,onCreateTerminalWithProfile:x},e.id),t[64]=d,t[65]=x,t[66]=e):e=t[66],se=z.map(e),t[60]=d,t[61]=x,t[62]=z,t[63]=se}else se=t[63];return t[67]===Symbol.for("react.memo_cache_sentinel")?(re=(0,Xe.jsx)(R.DropdownMenuSeparator,{}),t[67]=re):re=t[67],t[68]!==M?(ie=M("workspace.tabs.actions.editTerminalProfiles"),t[68]=M,t[69]=ie):ie=t[69],t[70]!==H||t[71]!==ie?(ce=(0,Xe.jsx)(R.DropdownMenuItem,{testID:"workspace-header-edit-terminal-profiles",onSelect:H,children:ie}),t[70]=H,t[71]=ie,t[72]=ce):ce=t[72],t[73]!==q||t[74]!==Q||t[75]!==J||t[76]!==Y||t[77]!==Z||t[78]!==ne||t[79]!==oe||t[80]!==se||t[81]!==ce||t[82]!==$?(le=(0,Xe.jsxs)(R.DropdownMenuContent,{align:"start",width:220,testID:"workspace-header-menu",children:[$,q,Q,J,Y,Z,ee,ne,oe,se,re,ce]}),t[73]=q,t[74]=Q,t[75]=J,t[76]=Y,t[77]=Z,t[78]=ne,t[79]=oe,t[80]=se,t[81]=ce,t[82]=$,t[83]=le):le=t[83],t[84]!==le||t[85]!==U?(de=(0,Xe.jsxs)(R.DropdownMenu,{children:[U,le]}),t[84]=le,t[85]=U,t[86]=de):de=t[86],de}function an(e){const a=(0,s.c)(43),{isLoading:o,title:c,subtitle:l,showSubtitle:d,currentBranchName:u,normalizedServerId:p,normalizedWorkspaceId:b,workspaceScripts:k,liveTerminalIds:h,showWorkspaceSetup:w,showCreateBrowserTab:f,isMobile:I,createTerminalDisabled:T,importAgentDisabled:y,copyPathDisabled:S,menuNewAgentIcon:C,menuNewTerminalIcon:x,menuNewBrowserIcon:v,menuImportIcon:P,menuCopyIcon:W,menuSettingsIcon:B,onCreateDraftTab:M,onCreateTerminal:A,onCreateTerminalWithProfile:R,onCreateBrowser:_,onOpenImportSheet:D,onCopyWorkspacePath:F,onCopyBranchName:z,onOpenSetupTab:L,onScriptTerminalStarted:H,onViewScriptTerminal:E,onOpenUrlInBrowserTab:V}=e;let N,U,K,$,q;return a[0]!==o||a[1]!==d||a[2]!==l||a[3]!==c?(N=o?(0,Xe.jsx)(t.View,{style:In.headerTitleTextGroup,children:(0,Xe.jsx)(t.View,{style:In.headerTitleSkeleton})}):(0,Xe.jsxs)(t.View,{style:In.headerTitleTextGroup,children:[(0,Xe.jsx)(j.ScreenTitle,{testID:"workspace-header-title",children:c}),d?(0,Xe.jsx)(n.Text,{testID:"workspace-header-subtitle",style:In.headerProjectTitle,numberOfLines:1,children:l}):null]}),a[0]=o,a[1]=d,a[2]=l,a[3]=c,a[4]=N):N=a[4],a[5]!==S||a[6]!==T||a[7]!==u||a[8]!==y||a[9]!==I||a[10]!==W||a[11]!==P||a[12]!==C||a[13]!==v||a[14]!==x||a[15]!==B||a[16]!==p||a[17]!==z||a[18]!==F||a[19]!==_||a[20]!==M||a[21]!==A||a[22]!==R||a[23]!==D||a[24]!==L||a[25]!==f||a[26]!==w?(U=(0,Xe.jsx)(nn,{normalizedServerId:p,currentBranchName:u,showWorkspaceSetup:w,showCreateBrowserTab:f,isMobile:I,createTerminalDisabled:T,importAgentDisabled:y,copyPathDisabled:S,menuNewAgentIcon:C,menuNewTerminalIcon:x,menuNewBrowserIcon:v,menuImportIcon:P,menuCopyIcon:W,menuSettingsIcon:B,onCreateDraftTab:M,onCreateTerminal:A,onCreateTerminalWithProfile:R,onCreateBrowser:_,onOpenImportSheet:D,onCopyWorkspacePath:F,onCopyBranchName:z,onOpenSetupTab:L}),a[5]=S,a[6]=T,a[7]=u,a[8]=y,a[9]=I,a[10]=W,a[11]=P,a[12]=C,a[13]=v,a[14]=x,a[15]=B,a[16]=p,a[17]=z,a[18]=F,a[19]=_,a[20]=M,a[21]=A,a[22]=R,a[23]=D,a[24]=L,a[25]=f,a[26]=w,a[27]=U):U=a[27],a[28]!==I||a[29]!==h||a[30]!==p||a[31]!==b||a[32]!==V||a[33]!==H||a[34]!==E||a[35]!==k?(K=I&&k.length>0?(0,Xe.jsx)(O.WorkspaceScriptsButton,{serverId:p,workspaceId:b,scripts:k,liveTerminalIds:h,onScriptTerminalStarted:H,onViewTerminal:E,onOpenUrlInBrowserTab:V,hideLabels:!0,presentation:"ghost"}):null,a[28]=I,a[29]=h,a[30]=p,a[31]=b,a[32]=V,a[33]=H,a[34]=E,a[35]=k,a[36]=K):K=a[36],a[37]!==U||a[38]!==K?($=(0,Xe.jsxs)(t.View,{style:In.compactHeaderMenuCluster,children:[U,K]}),a[37]=U,a[38]=K,a[39]=$):$=a[39],a[40]!==N||a[41]!==$?(q=(0,Xe.jsxs)(t.View,{style:In.headerTitleContainer,children:[N,$]}),a[40]=N,a[41]=$,a[42]=q):q=a[42],q}function on(e){const t=e.split(".").pop();return"left"===t||"right"===t||"up"===t||"down"===t?t:null}function sn(e){const{isMissingWorkspaceDirectory:a,activeTabDescriptor:o,hasHydratedAgents:s,mountedFocusedPaneTabIds:c,focusedPaneTabDescriptorMap:l,isRouteFocused:d,focusedPaneId:u,buildMobilePaneContentModel:p}=e;return a?(0,Xe.jsx)(t.View,{style:In.emptyState,children:(0,Xe.jsx)(n.Text,{style:In.emptyStateText,children:"Workspace directory is missing. Reload workspace data before opening tabs."})}):o||s?o?c.map(e=>{const t=l.get(e);return t?(0,Xe.jsx)(Xt,{tabDescriptor:t,isVisible:d&&e===o.tabId,isWorkspaceFocused:d,isPaneFocused:e===o.tabId,paneId:u,buildPaneContentModel:p},e):null}):(0,Xe.jsx)(t.View,{style:In.emptyState,children:(0,Xe.jsx)(n.Text,{style:In.emptyStateText,children:"No tabs are available yet. Use New tab to create an agent or terminal."})}):(0,Xe.jsx)(t.View,{style:In.emptyState,children:(0,Xe.jsx)(at,{uniProps:St})})}function rn(e){const t=(0,ve.resolveWorkspaceHeaderRenderState)(e);return"ready"!==t.kind?{isWorkspaceHeaderLoading:!0,workspaceHeaderTitle:"",workspaceHeaderSubtitle:"",shouldShowWorkspaceHeaderSubtitle:!1,isGitCheckout:!1,currentBranchName:null}:{isWorkspaceHeaderLoading:!1,workspaceHeaderTitle:t.title,workspaceHeaderSubtitle:t.subtitle,shouldShowWorkspaceHeaderSubtitle:t.shouldShowSubtitle,isGitCheckout:t.isGitCheckout,currentBranchName:t.currentBranchName}}function cn(e,t){const n=e?.label?.trim();return n||t}function ln(e){const t=(0,s.c)(12),n=(0,k.useRouter)();let a;t[0]!==e?(a=()=>{e&&(0,oe.getHostRuntimeStore)().runProbeCycleNow(e)},t[0]=e,t[1]=a):a=t[1];const o=a;let c;t[2]!==e||t[3]!==n?(c=()=>{e&&n.push((0,Ve.buildSettingsHostRoute)(e))},t[2]=e,t[3]=n,t[4]=c):c=t[4];const l=c;let d;t[5]!==e||t[6]!==n?(d=()=>{n.canGoBack()?n.back():e?n.replace((0,Ve.buildHostRootRoute)(e)):n.replace("/")},t[5]=e,t[6]=n,t[7]=d):d=t[7];const u=d;let p;return t[8]!==u||t[9]!==l||t[10]!==o?(p={handleRetryHost:o,handleManageHost:l,handleDismissMissingWorkspace:u},t[8]=u,t[9]=l,t[10]=o,t[11]=p):p=t[11],p}function dn(e){const t=(0,s.c)(15),n=(0,oe.useHosts)();let a;t[0]!==n||t[1]!==e.serverId?(a=n.find(t=>t.serverId===e.serverId)??null,t[0]=n,t[1]=e.serverId,t[2]=a):a=t[2];const o=a,c=(0,oe.useHostRuntimeSnapshot)(e.serverId);let l;t[3]!==o||t[4]!==e.serverId?(l=cn(o,e.serverId),t[3]=o,t[4]=e.serverId,t[5]=l):l=t[5];const d=l,u=(0,K.useWorkspaceRestoreStatus)(e.serverId,e.workspaceId);let p,b;return t[6]!==d||t[7]!==c?.connectionStatus||t[8]!==c?.lastError||t[9]!==e.hasHydratedWorkspaces||t[10]!==e.workspace||t[11]!==u?(p=()=>(0,Pe.resolveWorkspaceRouteState)({hostName:d,connectionStatus:c?.connectionStatus??"connecting",lastError:c?.lastError??null,workspace:e.workspace,hasHydratedWorkspaces:e.hasHydratedWorkspaces,restoreStatus:u}),t[6]=d,t[7]=c?.connectionStatus,t[8]=c?.lastError,t[9]=e.hasHydratedWorkspaces,t[10]=e.workspace,t[11]=u,t[12]=p):p=t[12],t[13]!==p?(b=p(),t[13]=p,t[14]=b):b=t[14],b}function un(e){const n=(0,s.c)(3),{children:a}=e;let o,c;return n[0]===Symbol.for("react.memo_cache_sentinel")?(o=(0,Xe.jsx)(W.ScreenHeader,{left:Mt}),n[0]=o):o=n[0],n[1]!==a?(c=(0,Xe.jsxs)(Xe.Fragment,{children:[o,(0,Xe.jsx)(t.View,{style:In.centerContent,children:a})]}),n[1]=a,n[2]=c):c=n[2],c}function pn(e){return e.gate?(0,Xe.jsx)(Re.WorkspaceFocusProvider,{workspaceKey:e.workspaceKey,children:(0,Xe.jsx)(t.View,{style:In.container,children:(0,Xe.jsx)(t.View,{style:In.threePaneRow,children:(0,Xe.jsx)(t.View,{style:In.centerColumn,children:(0,Xe.jsx)(un,{children:e.gate})})})})}):null}function bn(e){const t=(0,s.c)(4),{tab:n,serverId:a,workspaceId:o,isRouteFocused:c}=e;if(!c||!Ee.isWeb||!n)return null;let l;return t[0]!==a||t[1]!==n||t[2]!==o?(l=(0,Xe.jsx)(we.WorkspaceTabPresentationResolver,{tab:n,serverId:a,workspaceId:o,children:gn}),t[0]=a,t[1]=n,t[2]=o,t[3]=l):l=t[3],l}function gn(e){return(0,Xe.jsx)(Lt,{label:e.label,titleState:e.titleState})}function mn(e){return!e.isFocusModeEnabled||e.isMobile}function kn(e){return!e.isMobile&&e.isRouteFocused&&mn(e)}function hn(e,t){return e&&t?`${e}:${t}`:null}function wn(e){const t=(0,s.c)(21),{persistenceKey:n,focusWorkspacePane:a,openWorkspaceTabFocused:o,labels:c,toast:l}=e;let d;t[0]!==a||t[1]!==o||t[2]!==n?(d=e=>{const{terminalId:t,paneId:s}=e;n&&(s&&a(n,s),o(n,{kind:"terminal",terminalId:t}))},t[0]=a,t[1]=o,t[2]=n,t[3]=d):d=t[3];const u=d;let p;t[4]!==o||t[5]!==n?(p=e=>{n&&o(n,{kind:"terminal",terminalId:e})},t[4]=o,t[5]=n,t[6]=p):p=t[6];const b=p;let k;t[7]!==c.workspacePathUnavailable||t[8]!==l?(k=()=>{l.error(c.workspacePathUnavailable)},t[7]=c.workspacePathUnavailable,t[8]=l,t[9]=k):k=t[9];const h=k;let w;t[10]!==c.terminalQueued||t[11]!==l?(w=()=>{l.show(c.terminalQueued)},t[10]=c.terminalQueued,t[11]=l,t[12]=w):w=t[12];const f=w;let I;t[13]!==l?(I=e=>{l.error(e)},t[13]=l,t[14]=I):I=t[14];const T=I;let y;return t[15]!==b||t[16]!==T||t[17]!==f||t[18]!==u||t[19]!==h?(y={handleTerminalCreated:u,handleScriptTerminalSelected:b,handleWorkspacePathUnavailable:h,handleTerminalCreateQueued:f,handleTerminalCreateFailed:T},t[15]=b,t[16]=T,t[17]=f,t[18]=u,t[19]=h,t[20]=y):y=t[20],y}function fn({serverId:e,workspaceId:o,isRouteFocused:s}){const{t:d}=(0,w.useTranslation)(),p=((0,T.useSafeAreaInsets)(),(0,N.useToast)()),k=(0,He.useIsCompactFormFactor)(),I=(0,U.usePanelStore)(e=>e.desktop.focusModeEnabled),y=(0,c.useMemo)(()=>At(Rt(e))??"",[e]),{allowMove:j}=(0,Z.useKanbanMoveGuard)(y),B=(0,c.useMemo)(()=>(0,he.resolveWorkspaceRouteId)({routeWorkspaceId:o})??"",[o]),R=(0,ie.useWorkspace)(y,B),L=tt(R),{handleRetryHost:we,handleManageHost:Ce,handleDismissMissingWorkspace:ve}=ln(y),Pe=(0,c.useMemo)(()=>hn(y,B),[y,B]);(0,ce.useWorkspaceTerminalSessionRetention)({scopeKey:Pe});const Ve=(0,oe.useHostRuntimeClient)(y),Ue=(0,oe.useHostRuntimeIsConnected)(y),Ke=(0,oe.useHosts)(),$e=R?.workspaceDirectory||null,Ye=Boolean(R)&&!$e,[at,ot]=(0,c.useState)(!1),st=[Ve,Ue,$e].every(Boolean),rt=(0,c.useCallback)(()=>{ot(!0)},[]),it=(0,c.useCallback)(()=>{ot(!1)},[]);(0,se.useProvidersSnapshot)(y,{cwd:$e,enabled:s});const ct=(0,c.useMemo)(()=>(0,ee.buildWorkspaceTabPersistenceKey)({serverId:y,workspaceId:B}),[y,B]),lt=(0,ee.useWorkspaceLayoutStore)(e=>e.openTabFocused),dt=(0,ee.useWorkspaceLayoutStore)(e=>e.openChildTabFocused),ut=(0,ee.useWorkspaceLayoutStore)(e=>e.focusPane),pt=(0,K.useSessionStore)(e=>e.sessions[y]?.hasHydratedWorkspaces??!1),bt=(0,l.useStoreWithEqualityFn)(K.useSessionStore,e=>(0,je.deriveWorkspaceAgentVisibility)({sessionAgents:e.sessions[y]?.agents,agentDetails:e.sessions[y]?.agentDetails,workspaceId:B}),je.workspaceAgentVisibilityEqual),{handleTerminalCreated:gt,handleScriptTerminalSelected:mt,handleWorkspacePathUnavailable:kt,handleTerminalCreateQueued:ht,handleTerminalCreateFailed:wt}=wn({persistenceKey:ct,focusWorkspacePane:ut,openWorkspaceTabFocused:lt,labels:{workspacePathUnavailable:d("workspace.header.toasts.workspacePathUnavailable"),terminalQueued:d("workspace.header.toasts.terminalQueued")},toast:p}),Tt=(0,b.useQueryClient)(),{createMutation:Mt,createTerminal:Ft,handleScriptTerminalStarted:zt,handleViewScriptTerminal:Lt,invalidateTerminals:Et,killMutation:Ot,knownTerminalIds:Vt,liveTerminalIds:Nt,pendingCreateInput:Kt,query:$t,queryKey:qt,removeTerminalFromCache:Gt,standaloneTerminalIds:Xt,terminals:Yt}=(0,Ne.useWorkspaceTerminals)({client:Ve,isConnected:Ue,isRouteFocused:s,normalizedServerId:y,normalizedWorkspaceId:B,workspaceDirectory:$e,workspaceScripts:L,hasHydratedWorkspaces:pt,isMissingWorkspaceDirectory:Ye,onTerminalCreated:gt,onScriptTerminalSelected:mt,onWorkspacePathUnavailable:kt,onTerminalCreateQueued:ht,onTerminalCreateFailed:wt}),{archiveAgent:en}=(0,de.useArchiveAgent)(),{checkoutQuery:tn,isCheckoutStatusLoading:nn}=(0,Qe.useWorkspaceCheckoutStatus)({client:Ve,isConnected:Ue,isRouteFocused:s,normalizedServerId:y,normalizedWorkspaceId:B,workspaceDirectory:$e}),cn=(0,K.useSessionStore)(e=>e.sessions[y]?.hasHydratedAgents??!1),un=dn({serverId:y,workspaceId:B,workspace:R,hasHydratedWorkspaces:pt}),gn=(fn={isCheckoutStatusLoading:nn,isError:tn.isError,data:tn.data}).isCheckoutStatusLoading?{kind:"pending"}:fn.isError||!fn.data?{kind:"error"}:{kind:"ready",checkout:{isGit:fn.data.isGit,currentBranch:fn.data.currentBranch}};var fn;const{isWorkspaceHeaderLoading:Sn,workspaceHeaderTitle:Cn,workspaceHeaderSubtitle:xn,shouldShowWorkspaceHeaderSubtitle:vn,isGitCheckout:Pn,currentBranchName:Wn}=rn({workspace:R,checkoutState:gn}),jn=(0,U.usePanelStore)(e=>(0,U.selectIsFileExplorerOpen)(e,{isCompact:k})),Bn=(0,U.usePanelStore)(e=>e.toggleFileExplorerForCheckout),Mn=(0,U.usePanelStore)(e=>e.showMobileAgent),An=(0,c.useMemo)(()=>y&&$e?{serverId:y,cwd:$e,isGit:Pn}:null,[Pn,y,$e]),Rn=(0,c.useCallback)(()=>{An&&Bn({isCompact:k,checkout:An})},[An,k,Bn]),_n=(0,c.useMemo)(()=>Boolean(R?.diffStat),[R]),Dn=(0,c.useCallback)(({hovered:e,pressed:t})=>[In.sourceControlButton,_n&&In.sourceControlButtonWithStats,(Boolean(e)||Boolean(t)||jn)&&In.sourceControlButtonHovered],[_n,jn]),Fn=(0,c.useMemo)(()=>({expanded:jn}),[jn]);(0,c.useEffect)(()=>{if(!s||Ee.isWeb||!jn)return;const e=u.default.addEventListener("hardwareBackPress",()=>!!jn&&(Mn(),!0));return()=>e.remove()},[jn,s,Mn]);const zn=(0,ee.useWorkspaceLayoutStore)(e=>ct?e.layoutByWorkspace[ct]??null:null),Ln=(0,ee.useWorkspaceLayoutStoreHydrated)(),Hn=(0,re.useWorkspaceSetupStore)(e=>ct?e.snapshots[ct]??null:null),En=(0,re.useWorkspaceSetupStore)(e=>e.ensureSetupStatus),On=(0,re.shouldShowWorkspaceSetup)(Hn),Vn=(0,c.useMemo)(()=>zn?(0,ee.collectAllTabs)(zn.root):Je,[zn]);_t({workspaceLayout:zn,isRouteFocused:s,workspaceId:B});const Nn=(0,ee.useWorkspaceLayoutStore)(e=>e.openTabInBackground),Un=(0,ee.useWorkspaceLayoutStore)(e=>e.focusTab),Kn=(0,ee.useWorkspaceLayoutStore)(e=>e.closeTab),$n=(0,ee.useWorkspaceLayoutStore)(e=>e.unpinAgent),qn=(0,ee.useWorkspaceLayoutStore)(e=>e.hideAgent),Gn=(0,ee.useWorkspaceLayoutStore)(e=>e.retargetTab),Qn=(0,ee.useWorkspaceLayoutStore)(e=>e.reconcileTabs),Xn=(0,ee.useWorkspaceLayoutStore)(e=>e.splitPane),Jn=(0,ee.useWorkspaceLayoutStore)(e=>e.splitPaneEmpty),Yn=(0,ee.useWorkspaceLayoutStore)(e=>e.moveTabToPane),Zn=(0,c.useRef)(!1),ea=(0,ee.useWorkspaceLayoutStore)(e=>e.resizeSplit),ta=(0,ee.useWorkspaceLayoutStore)(e=>e.reorderTabsInPane),na=((0,ee.useWorkspaceLayoutStore)(e=>ct?e.pinnedAgentIdsByWorkspace[ct]??Ze:Ze),(0,ee.useWorkspaceLayoutStore)(e=>ct?e.hiddenAgentIdsByWorkspace[ct]??et:et),(0,ne.useCreateFlowStore)(e=>e.pendingByDraftId)),{closingTabIds:aa,closeTab:oa}=Zt(),{onLayout:sa,isBelow:ra}=(0,Oe.useContainerWidthBelow)(700),ia=(0,c.useCallback)(function(e){const t=At(e.tabId);if(t&&ct){if("agent"===e.target?.kind&&($n(ct,e.target.agentId),qn(ct,e.target.agentId)),"browser"===e.target?.kind){const{browserId:t}=e.target;be.useBrowserStore.getState().removeBrowser(t),(0,pe.removeResidentBrowserWebview)(t),(0,ge.getDesktopHost)()?.browser?.clearPartition?.(t)}Kn(ct,t)}},[Kn,qn,ct,$n]),ca=(0,c.useMemo)(()=>(0,Be.deriveWorkspacePaneState)({layout:zn,tabs:Vn}),[Vn,zn]),la=(0,K.useSessionStore)(e=>e.setFocusedAgentId),da=(0,K.useSessionStore)(e=>e.setFocusedTerminalId),ua=(0,c.useMemo)(()=>{const e=ca.activeTab?.descriptor.target;return"agent"!==e?.kind?null:e.agentId},[ca.activeTab]),pa=(0,c.useMemo)(()=>{const e=ca.activeTab?.descriptor.target;return"terminal"!==e?.kind?null:e.terminalId},[ca.activeTab]);(0,c.useEffect)(()=>{s&&(la(y,ua),da(y,pa))},[ua,pa,s,y,la,da]),(0,c.useEffect)(()=>{if(s)return()=>{la(y,null),da(y,null)}},[s,y,la,da]);const ba=(0,c.useCallback)(function(e){if(!ct)return null;const t=(0,ae.normalizeWorkspaceTabTarget)({kind:"draft",draftId:At(e?.draftId)??(0,ke.generateDraftId)()});return(0,S.default)("draft"===t?.kind,"Draft tab target must be valid"),!1===e?.focus?Nn(ct,t):lt(ct,t)},[lt,Nn,ct]);(0,c.useEffect)(()=>{if(!s)return;if(!y||!B||!ct)return;if(!Ln)return;const e=Vn.some(e=>{if("draft"!==e.target.kind)return!1;const t=na[e.target.draftId];return t?.serverId===y&&"active"===t.lifecycle});Qn(ct,(0,je.buildWorkspaceTabSnapshot)({agentVisibility:bt,agentsHydrated:cn,terminalsHydrated:$t.isSuccess,knownTerminalIds:Vt,standaloneTerminalIds:Xt,hasActivePendingDraftCreate:e}))},[cn,Ln,s,y,B,na,ct,Qn,Vt,Xt,$t.isSuccess,Vn,bt]);const ga=ca.activeTabId,ma=ca.activeTab,ka=(0,$.useSessionFilterStore)(e=>e.sortTabsByCreationDate),ha=(0,c.useMemo)(()=>{const e=ca.tabs.map(e=>e.descriptor);return ka?(0,Se.sortDescriptorsByCreationDate)(e):e},[ca.tabs,ka]),wa=(0,c.useMemo)(()=>Vn.some(e=>"setup"===e.target.kind&&e.target.workspaceId===B),[B,Vn]),fa=(0,c.useCallback)(function(e){e&&ct&&Un(ct,e)},[Un,ct]),Ia=(0,c.useCallback)(e=>{if(!ct)return;const t=lt(ct,{kind:"agent",agentId:e});t&&fa(t)},[fa,lt,ct]),Ta=(0,c.useRef)(null),ya=(0,c.useRef)(null);(0,c.useEffect)(()=>{s&&Ve&&y&&B&&En({serverId:y,workspaceId:B,client:Ve})},[Ve,En,s,y,B]),(0,c.useEffect)(()=>{if(!(0,De.shouldSeedEmptyWorkspaceDraft)({isRouteFocused:s,hasPersistenceKey:Boolean(ct),hasWorkspaceDirectory:Boolean($e),hasHydratedWorkspaceLayoutStore:Ln,hasHydratedAgents:cn,hasLoadedTerminals:$t.isSuccess,activeAgentCount:bt.activeAgentIds.size,terminalCount:Yt.length,tabCount:ha.length}))return void(Ta.current=null);const e=`${y}:${B}`;Ta.current!==e&&(Ta.current=e,ba())},[y,B,ba,ct,cn,Ln,s,Yt.length,$t.isSuccess,ha.length,$e,bt.activeAgentIds.size]),(0,c.useEffect)(()=>{if(!s)return;if(!ct)return;if(!Hn||!On)return void(ya.current===ct&&(ya.current=null));const e=Date.now()-Hn.updatedAt;if(!("running"===Hn.status||e<=3e4))return;if(wa)return void(ya.current=ct);if(ya.current===ct)return;const t=(0,ae.normalizeWorkspaceTabTarget)({kind:"setup",workspaceId:B});if(!t)return;Nn(ct,t)&&(ya.current=ct)},[wa,s,B,Nn,ct,On,Hn]);const Sa=(0,c.useCallback)(function(e){if(!ct)return;const t=(0,qe.normalizeWorkspaceFileLocation)({path:e});if(!t)return;const n=lt(ct,(0,qe.createWorkspaceFileTabTarget)(t));n&&fa(n)},[fa,lt,ct]),Ca=(0,c.useCallback)((e,t)=>{const n=(0,qe.normalizeWorkspaceFileLocation)(e);if(!n)return;if(k&&Mn(),!ct)return;const a=(0,qe.createWorkspaceFileTabTarget)(n),o=t?.parentTabId?dt(ct,a,t.parentTabId):lt(ct,a);o&&fa(o)},[k,fa,dt,lt,ct,Mn]),xa=(0,c.useCallback)(e=>{const t=(0,qe.normalizeWorkspaceFileLocation)(e.location);if(!t)return;if(!ct||k||!e.sourcePaneId)return void Ca(t,{parentTabId:e.parentTabId});const n=(0,qe.createWorkspaceFileTabTarget)(t),a=(0,Be.resolveSideFileOpenPlacement)({layout:zn,sourcePaneId:e.sourcePaneId,tabs:Vn,target:n});"focus-side-pane"===a.kind?ut(ct,a.paneId):"split-side-pane"===a.kind&&Jn(ct,{targetPaneId:a.paneId,position:"right"});const o=e.parentTabId?dt(ct,n,e.parentTabId):lt(ct,n);o&&fa(o)},[Ca,k,ut,fa,dt,lt,ct,Jn,Vn,zn]),va=(0,ue.useStableEvent)(function({request:e,paneId:t,parentTabId:n,focusPaneBeforeOpen:a}){a&&t&&ct&&ut(ct,t),"side"!==e.disposition?Ca(e.location,{parentTabId:n}):xa({location:e.location,sourcePaneId:t??void 0,parentTabId:n})}),[Pa,Wa]=(0,c.useState)(null),{handleRenameTab:ja,renamingTab:Ba,handleRenameModalSubmit:Ma,handleRenameModalClose:Aa}=(0,fe.useWorkspaceTabRename)({client:Ve,normalizedServerId:y,queryClient:Tt,terminalsData:$t.data,terminalsQueryKey:qt}),{taggingAgent:Ra,handleRequestTagAgent:Da,handleTagModalSubmit:Fa,handleTagModalClose:za}=(0,Ie.useWorkspaceTagEditor)({client:Ve,normalizedServerId:y,queryClient:Tt}),La=(0,c.useMemo)(()=>{const e=new Map;for(const t of ha)e.set(t.key,t);return e},[ha]),Ha=(0,c.useMemo)(()=>{const e=new Map;for(const t of Vn)e.set(t.tabId,{key:t.tabId,tabId:t.tabId,kind:t.target.kind,target:t.target,createdAt:t.createdAt});return e},[Vn]),Ea=(0,c.useMemo)(()=>({all:({agents:e,terminals:t,tabs:n})=>d("workspace.tabs.confirmations.bulk.all",{agents:e,terminals:t,tabs:n}),agentsAndTerminals:({agents:e,terminals:t})=>d("workspace.tabs.confirmations.bulk.agentsAndTerminals",{agents:e,terminals:t}),terminalsAndTabs:({terminals:e,tabs:t})=>d("workspace.tabs.confirmations.bulk.terminalsAndTabs",{terminals:e,tabs:t}),agentsAndTabs:({agents:e,tabs:t})=>d("workspace.tabs.confirmations.bulk.agentsAndTabs",{agents:e,tabs:t}),terminals:({terminals:e})=>d("workspace.tabs.confirmations.bulk.terminals",{terminals:e}),tabs:({tabs:e})=>d("workspace.tabs.confirmations.bulk.tabs",{tabs:e}),agents:({agents:e})=>d("workspace.tabs.confirmations.bulk.agents",{agents:e})}),[d]),Oa=d(jn?"workspace.tabs.explorer.close":"workspace.tabs.explorer.open"),Va=(0,c.useMemo)(()=>ga??"",[ga]),Na=(0,c.useMemo)(()=>({newAgent:d("workspace.tabs.fallback.newAgent"),setup:d("workspace.tabs.fallback.setup"),workspaceSetup:d("workspace.tabs.fallback.workspaceSetup"),terminal:d("workspace.tabs.fallback.terminal"),browser:d("workspace.tabs.fallback.browser"),agent:d("workspace.tabs.fallback.agent")}),[d]),Ua=(0,c.useMemo)(()=>ha.map(e=>{return{id:e.key,label:Dt(e,Na),description:(t=e,n=Na,"draft"===t.target.kind?n.newAgent:"setup"===t.target.kind?n.workspaceSetup:"agent"===t.target.kind?n.agent:"terminal"===t.target.kind?n.terminal:"browser"===t.target.kind?n.browser:"pluginView"===t.target.kind?"Extension":t.target.path)};var t,n}),[Na,ha]),Ka=(0,c.useCallback)(e=>{e?.paneId&&ct&&ut(ct,e.paneId),ba()},[ut,ba,ct]),$a=(0,ue.useStableEvent)(Ft),qa=(0,c.useCallback)(e=>{Ft({profile:e})},[Ft]),Ga=(0,c.useCallback)(e=>{if(!ct||!(0,Ee.getIsElectron)())return;e?.paneId&&ut(ct,e.paneId);const{browserId:t}=(0,be.createWorkspaceBrowser)();lt(ct,{kind:"browser",browserId:t})},[ut,lt,ct]),Qa=(0,c.useCallback)(e=>{if(!ct||!(0,Ee.getIsElectron)())return;const{browserId:t}=(0,be.createWorkspaceBrowser)({initialUrl:e});lt(ct,{kind:"browser",browserId:t})},[lt,ct]);(0,xe.useDesktopBrowserNewTabRequests)({enabled:Boolean(ct),workspaceLayout:zn,openUrl:Qa});const Xa=(0,c.useCallback)(e=>{fa(e)},[fa]),Ja=(0,c.useCallback)(e=>{if(!ct)return;const t=Jn(ct,e);t&&Ka({paneId:t})},[Ka,ct,Jn]),Ya=Ot.mutateAsync,Za=(0,c.useCallback)(async e=>{const{tabId:t,terminalId:n}=e;await oa(t,async()=>{await(0,le.confirmDialog)({title:d("workspace.tabs.confirmations.closeTerminalTitle"),message:d("workspace.tabs.confirmations.closeTerminalMessage"),confirmLabel:d("workspace.tabs.confirmations.close"),cancelLabel:d("workspace.tabs.confirmations.cancel"),destructive:!0})&&(Gt(n),Wa(e=>e===t?null:e),ct&&ia({tabId:t,target:{kind:"terminal",terminalId:n}}),Ya(n).catch(Et))})},[oa,ia,Et,Ya,ct,Gt,d]),eo=(0,c.useCallback)(async e=>{const{tabId:t,agentId:n}=e;await oa(t,async()=>{if(!y)return;const e=K.useSessionStore.getState().sessions[y]?.agents?.get(n)??null,a=(0,ze.resolveCloseAgentTabPolicy)(e);if("running"===e?.status&&"archive-on-close"===a.kind){if(!await(0,le.confirmDialog)({title:d("workspace.tabs.confirmations.archiveRunningAgentTitle"),message:d("workspace.tabs.confirmations.archiveRunningAgentMessage"),confirmLabel:d("workspace.tabs.confirmations.archive"),cancelLabel:d("workspace.tabs.confirmations.cancel"),destructive:!0}))return}Wa(e=>e===t?null:e),ct&&ia({tabId:t,target:{kind:"agent",agentId:n}}),"layout-only"!==a.kind&&en({serverId:y,agentId:n}).catch(()=>{})})},[en,oa,ia,y,ct,d]),to=(0,c.useCallback)(function(e){Wa(t=>t===e.tabId?null:t),ct&&ia({tabId:e.tabId,target:e.target})},[ia,ct]),no=(0,c.useCallback)(async e=>{const t=Ha.get(e);t&&("terminal"!==t.target.kind?"agent"!==t.target.kind?to({tabId:e,target:t.target}):await eo({tabId:e,agentId:t.target.agentId}):await Za({tabId:e,terminalId:t.target.terminalId}))},[Ha,eo,to,Za]),ao=(0,c.useCallback)(async e=>{if(e)try{await h.setStringAsync(e),p.copied(d("workspace.tabs.toasts.agentIdCopiedLabel"))}catch{p.error(d("workspace.tabs.toasts.copyFailed"))}},[p,d]),oo=(0,c.useCallback)(async e=>{if(e)try{await h.setStringAsync(e),p.copied(d("workspace.tabs.toasts.filePathCopiedLabel"))}catch{p.error(d("workspace.tabs.toasts.copyFailed"))}},[p,d]),so=(0,c.useCallback)(async e=>{if(!e)return;const t=K.useSessionStore.getState().sessions[y]?.agents?.get(e)??null,n=t?.runtimeInfo?.sessionId??t?.persistence?.sessionId??null;if(!t||!n)return void p.error(d("workspace.tabs.toasts.resumeIdUnavailable"));const a=(0,me.buildProviderCommand)({provider:t.provider,id:"resume",sessionId:n})??null;if(a)try{await h.setStringAsync(a),p.copied(d("workspace.tabs.toasts.resumeCommandCopiedLabel"))}catch{p.error(d("workspace.tabs.toasts.copyFailed"))}else p.error(d("workspace.tabs.toasts.resumeCommandUnavailable"))},[y,p,d]),ro=(0,c.useCallback)(async e=>{if(Ve&&Ue){p.show(d("workspace.tabs.toasts.reloadingAgent"),{durationMs:null});try{await Ve.refreshAgent(e);const t=K.useSessionStore.getState().sessions[y],n=t?.agentTimelineCursor.get(e);await Ve.fetchAgentTimeline(e,Object.assign({direction:"tail",projection:"projected"},n?{cursor:{epoch:n.epoch,seq:n.endSeq}}:{})),p.show(d("workspace.tabs.toasts.reloadedAgent"),{variant:"success"})}catch(e){p.error(e instanceof Error?e.message:d("workspace.tabs.toasts.failedToReloadAgent"))}}else p.error(d("workspace.terminal.hostDisconnected"))},[Ve,Ue,y,p,d]),io=(0,c.useCallback)(async(e,t)=>{if(!Ve||!Ue)return void p.error("Host is not connected");const n=t.trim();if(!n)return;const a=K.useSessionStore.getState().sessions[y],o=a?.agents?.get(e)??a?.agentDetails?.get(e),s=o?.title??null;try{await Ve.updateAgent(e,{name:n})}catch(e){return void p.error(e instanceof Error?e.message:"Failed to rename session")}const c=Ke.find(e=>e.serverId===y);if((await(0,A.renameSession)({sessionId:e,newName:n,cwd:$e,daemonProfile:c})).ok)p.show("Renamed session",{variant:"success"});else{if(null!==s)try{await Ve.updateAgent(e,{name:s})}catch{}p.error("Couldn't rename tab")}},[Ve,Ue,p,y,Ke,$e]),co=(0,c.useCallback)(e=>{Da(e)},[Da]),lo=(0,c.useCallback)(async(e,t)=>{if(!Ve||!Ue)return void p.error("Host is not connected");const n=K.useSessionStore.getState().sessions[y],a=n?.agents?.get(e)??n?.agentDetails?.get(e),o=(0,Y.getKanbanBoardState)(),s=(0,J.resolveBucketId)({labels:a?.labels},o.validIds,o.defaultBucketId);if(!j(t,s))return;const c=(0,J.buildLabelsForBucketMove)(a?.labels,t,o.defaultBucketId);try{await Ve.updateAgent(e,{labels:c}),p.show(`Moved to ${(0,Y.getBucketLabel)(t)}`,{variant:"success"})}catch(e){p.error(e instanceof Error?e.message:"Failed to update bucket")}},[Ve,Ue,y,p,j]),uo=(0,c.useCallback)(async()=>{if($e)try{await h.setStringAsync($e),p.copied(d("workspace.header.toasts.workspacePathCopiedLabel"))}catch{p.error(d("workspace.tabs.toasts.copyFailed"))}else p.error(d("workspace.header.toasts.workspacePathUnavailable"))},[p,$e,d]),po=(0,c.useCallback)(async()=>{if(Wn)try{await h.setStringAsync(Wn),p.copied(d("workspace.header.toasts.branchNameCopiedLabel"))}catch{p.error(d("workspace.tabs.toasts.copyFailed"))}else p.error(d("workspace.header.toasts.branchNameUnavailable"))},[Wn,p,d]),bo=(0,c.useCallback)(()=>{if(!ct)return;const e=(0,ae.normalizeWorkspaceTabTarget)({kind:"setup",workspaceId:B});e&<(ct,e)},[B,lt,ct]),go=(0,c.useCallback)(async e=>{const{tabsToClose:t,title:n,logLabel:a}=e;if(0===t.length)return;const o=(0,Fe.classifyBulkClosableTabs)(t);if(!await(0,le.confirmDialog)({title:n,message:(0,Fe.buildBulkCloseConfirmationMessage)(o,Ea),confirmLabel:d("workspace.tabs.confirmations.close"),cancelLabel:d("workspace.tabs.confirmations.cancel"),destructive:!0}))return;await(0,Fe.closeBulkWorkspaceTabs)({client:Ve,groups:o,closeTab:oa,closeWorkspaceTabWithCleanup:e=>{ct&&ia(e)},logLabel:a,warn:(e,t)=>{console.warn(e,t)}});const s=new Set(t.map(e=>e.key));Wa(e=>e&&s.has(e)?null:e)},[Ea,Ve,oa,ia,ct,d]),mo=(0,c.useCallback)(async(e,t)=>{const n=t.findIndex(t=>t.tabId===e);n<0||await go({tabsToClose:t.slice(0,n),title:d("workspace.tabs.confirmations.closeTabsLeftTitle"),logLabel:"to the left"})},[go,d]),ko=(0,c.useCallback)(async e=>{await mo(e,ha)},[mo,ha]),ho=(0,c.useCallback)(async(e,t)=>{const n=t.findIndex(t=>t.tabId===e);n<0||await go({tabsToClose:t.slice(n+1),title:d("workspace.tabs.confirmations.closeTabsRightTitle"),logLabel:"to the right"})},[go,d]),wo=(0,c.useCallback)(async e=>{await ho(e,ha)},[ho,ha]),fo=(0,c.useCallback)(async(e,t)=>{const n=t.filter(t=>t.tabId!==e);await go({tabsToClose:n,title:d("workspace.tabs.confirmations.closeOtherTabsTitle"),logLabel:"from close other tabs"})},[go,d]),Io=(0,c.useCallback)(async e=>{await fo(e,ha)},[fo,ha]),To=(0,c.useCallback)(e=>{switch(e.id){case"workspace.tab.new":return Ka(),!0;case"workspace.terminal.new":return $a(),!0;case"workspace.tab.close-current":return ga&&no(ga),!0;case"workspace.tab.navigate-index":{const t=ha[e.index-1]??null;return t?.tabId&&fa(t.tabId),!0}case"workspace.tab.navigate-relative":if(ha.length>0){const t=ha.findIndex(e=>e.tabId===ga),n=((t>=0?t:0)+e.delta+ha.length)%ha.length,a=ha[n]??null;a?.tabId&&fa(a.tabId)}return!0;default:return!1}},[ga,no,Ka,$a,fa,ha]),yo=(0,c.useCallback)(e=>"sidebar.toggle.right"===e.id&&(Rn(),!0),[Rn]),So=(0,c.useCallback)(e=>{if(!ct||!zn)return!0;const t=ca.pane;if(!t)return!0;if("workspace.pane.split.right"===e.id)return Ja({targetPaneId:t.id,position:"right"}),!0;if("workspace.pane.split.down"===e.id)return Ja({targetPaneId:t.id,position:"bottom"}),!0;if(e.id.startsWith("workspace.pane.focus.")){const n=on(e.id);if(n){const e=(0,Le.findAdjacentPane)(zn.root,t.id,n);e&&ut(ct,e)}return!0}if(e.id.startsWith("workspace.pane.move-tab.")){const n=on(e.id);if(n){const e=ca.activeTabId,a=(0,Le.findAdjacentPane)(zn.root,t.id,n);e&&a&&(Zn.current=!0,Yn(ct,e,a),requestAnimationFrame(()=>{Zn.current=!1}))}return!0}if("workspace.pane.close"===e.id){for(const e of t.tabIds)ia({tabId:e,target:Ha.get(e)?.target??null});return!0}return!1},[Ha,ia,ut,Ja,Yn,ct,ca.activeTabId,ca.pane,zn]);(0,te.useKeyboardActionHandler)({handlerId:`workspace-tab-actions:${y}:${B}`,actions:["workspace.tab.new","workspace.tab.close-current","workspace.tab.navigate-index","workspace.tab.navigate-relative","workspace.terminal.new"],enabled:Boolean(s&&y&&B),priority:100,isActive:()=>!0,handle:To}),(0,te.useKeyboardActionHandler)({handlerId:`workspace-pane-actions:${y}:${B}`,actions:["workspace.pane.split.right","workspace.pane.split.down","workspace.pane.focus.left","workspace.pane.focus.right","workspace.pane.focus.up","workspace.pane.focus.down","workspace.pane.move-tab.left","workspace.pane.move-tab.right","workspace.pane.move-tab.up","workspace.pane.move-tab.down","workspace.pane.close"],enabled:Boolean(s&&y&&B),priority:100,isActive:()=>!0,handle:So}),(0,te.useKeyboardActionHandler)({handlerId:`workspace-sidebar-actions:${y}:${B}`,actions:["sidebar.toggle.right"],enabled:Boolean(s&&y&&B),priority:100,isActive:()=>!0,handle:yo});const Co=(0,c.useMemo)(()=>ma?.descriptor??null,[ma]),xo=(0,c.useRef)(null),vo=(0,c.useCallback)(()=>{const e=xo.current;if(!e||!ct)return;xo.current=null;const t=()=>{lt(ct,e),p.show("Tab reopened",{variant:"success",durationMs:1400})};"agent"!==e.kind?t():Promise.resolve(Ve?.refreshAgent(e.agentId)).catch(()=>{}).finally(t)},[ct,Ve,lt,p]),Po=(0,c.useCallback)(async e=>{const t=Co;if(!t||t.tabId!==e||!ct)return void await no(e);const n=t.target;await no(e);ee.useWorkspaceLayoutStore.getState().getWorkspaceTabs(ct).some(t=>t.tabId===e)||"terminal"===n.kind||(xo.current=n,p.show((0,Xe.jsx)(Ut,{label:"Tab closed",onUndo:vo}),{durationMs:6e3,testID:"workspace-tab-close-undo"}))},[Co,no,ct,p,vo]),Wo=nt(Co),jo=Wo.path,Bo=Wo.lineStart,Mo=Wo.lineEnd,Ao=(0,c.useMemo)(()=>{return null===(e={path:jo,lineStart:Bo,lineEnd:Mo}).path?null:{path:e.path,lineStart:e.lineStart,lineEnd:e.lineEnd};var e},[Mo,Bo,jo]),Ro=(0,He.supportsDesktopPaneSplits)(),_o=(0,c.useMemo)(()=>!k&&!Ro,[k,Ro]);(0,c.useEffect)(()=>{!s||Ee.isNative||"undefined"==typeof document||Co||(document.title="Workspace")},[Co,s]);const Do=(0,c.useCallback)(e=>(0,Me.buildWorkspacePaneContentModel)({tab:e.tab,normalizedServerId:y,normalizedWorkspaceId:B,onOpenTab:t=>{if(!ct)return;e.focusPaneBeforeOpen&&e.paneId&&ut(ct,e.paneId);const n=dt(ct,t,e.tab.tabId);n&&fa(n)},onCloseCurrentTab:()=>{no(e.tab.tabId)},onRetargetCurrentTab:t=>{ct&&Gn(ct,e.tab.tabId,t)},onOpenWorkspaceFile:t=>{va({request:t,paneId:e.paneId,parentTabId:e.tab.tabId,focusPaneBeforeOpen:e.focusPaneBeforeOpen})},onOpenImportSheet:rt}),[no,ut,va,fa,y,B,rt,dt,ct,Gn]),Fo=(0,c.useMemo)(()=>ca.pane?.id??null,[ca.pane]),zo=(0,c.useMemo)(()=>ha.map(e=>e.tabId),[ha]),Lo=Jt(ha),{mountedTabIds:Ho}=(0,Ae.useMountedTabSet)({activeTabId:ga,allTabIds:zo,cap:3}),Eo=(0,c.useMemo)(()=>zo.filter(e=>Ho.has(e)),[zo,Ho]),Oo=(0,c.useCallback)(function(e){return Do({tab:e.tab,paneId:e.paneId,focusPaneBeforeOpen:!1})},[Do]),Vo=sn({isMissingWorkspaceDirectory:Ye,activeTabDescriptor:Co,hasHydratedAgents:cn,mountedFocusedPaneTabIds:Eo,focusedPaneTabDescriptorMap:Lo,isRouteFocused:s,focusedPaneId:Fo,buildMobilePaneContentModel:Oo}),No=(0,c.useCallback)(function(e){return Do({tab:e.tab,paneId:e.paneId,focusPaneBeforeOpen:!0})},[Do]),Uo=(0,$.useSessionFilterStore)(e=>e.statusFilters),Ko=(0,$.useSessionFilterStore)(e=>e.tagFilters),$o=(0,$.useSessionFilterStore)(e=>e.kanbanFilters),qo=(0,Y.useKanbanBuckets)(),Go=(0,Y.useDefaultBucketId)(),Qo=(0,c.useMemo)(()=>new Set(qo.map(e=>e.id)),[qo]),Xo=(0,$.useSessionFilterStore)(e=>e.textFilter),Jo=(0,$.useSessionFilterStore)(e=>e.agentNameFilter),Yo=(0,K.useSessionStore)(e=>e.sessions[y]?.agents),Zo=(0,c.useMemo)(()=>(0,X.distinctTagsWithCounts)([...Yo?.values()??[]]),[Yo]),es=(0,c.useMemo)(()=>Ra?.initialTags??[],[Ra]),ts=(0,c.useMemo)(()=>ha.map(e=>{if("agent"!==e.target.kind)return{tab:e,bucket:null,tags:[],kanbanBucket:null,searchableText:"",agentName:null};const t=Yo?.get(e.target.agentId);return t?{tab:e,bucket:(0,G.deriveSidebarStateBucket)({status:t.status,pendingPermissionCount:t.pendingPermissions?.length??0,requiresAttention:t.requiresAttention,attentionReason:t.attentionReason}),tags:(0,X.getAgentTags)(t),kanbanBucket:(0,J.resolveBucketId)(t,Qo,Go),searchableText:`${t.title??""} ${t.cwd??""}`.toLowerCase(),agentName:(0,Q.parseAgentSessionName)(t.title)}:{tab:e,bucket:"done",tags:[],kanbanBucket:Go,searchableText:"",agentName:null}}),[ha,Yo,Qo,Go]),ns=(0,c.useMemo)(()=>ts.filter(e=>null===e.agentName),[ts]),as=(0,c.useMemo)(()=>{const e={};for(const t of qo)e[t.id]=0;for(const t of ns)t.kanbanBucket&&t.kanbanBucket in e&&e[t.kanbanBucket]++;return e},[ns,qo]),os=(0,c.useMemo)(()=>0===$o.length?ns:ns.filter(e=>null===e.kanbanBucket||$o.includes(e.kanbanBucket)),[ns,$o]),ss=(0,c.useMemo)(()=>{const e={needs_input:0,failed:0,running:0,attention:0,done:0};for(const t of os)t.bucket&&e[t.bucket]++;return e},[os]),rs=(0,c.useMemo)(()=>os.filter(e=>null!==e.bucket).length,[os]),is=(0,c.useMemo)(()=>{const e=new Map;for(const t of os)for(const n of t.tags)e.set(n,(e.get(n)??0)+1);return Array.from(e.entries()).map(([e,t])=>({tag:e,count:t})).sort((e,t)=>e.tag.localeCompare(t.tag))},[os]),cs=(0,c.useMemo)(()=>{const e=Xo.trim().toLowerCase(),t=Jo?.trim()??"";if(""===t&&0===Uo.length&&0===Ko.length&&0===$o.length&&""===e){return ts.some(e=>null!==e.agentName&&e.tab.tabId!==Co?.tabId)?ts.filter(e=>e.tab.tabId===Co?.tabId||null===e.agentName).map(e=>e.tab):ha}return ts.filter(({tab:n,bucket:a,tags:o,kanbanBucket:s,searchableText:c,agentName:l})=>n.tabId===Co?.tabId||(""!==t?"agent"===n.target.kind&&l===t:null===l&&("agent"!==n.target.kind||!(Uo.length>0&&(!a||!Uo.includes(a)))&&(!(Ko.length>0&&!Ko.some(e=>o.includes(e)))&&(!($o.length>0&&(!s||!$o.includes(s)))&&!(""!==e&&!c.includes(e))))))).map(e=>e.tab)},[ha,ts,Uo,Ko,$o,Xo,Jo,Co?.tabId]),ls=(0,c.useMemo)(()=>cs.map(e=>({tab:e,isActive:e.tabId===Co?.tabId,isCloseHovered:Pa===e.key,isClosingTab:aa.has(e.tabId)})),[Co?.tabId,aa,Pa,cs]),ds=(0,ue.useStableEvent)(function(e){ct&&!Zn.current&&ut(ct,e)}),us=(0,c.useCallback)(function(e){ct&&Xn(ct,e)},[ct,Xn]),ps=(0,c.useCallback)(function(e,t){ct&&Yn(ct,e,t)},[Yn,ct]),bs=(0,c.useCallback)(function(e,t){ct&&ea(ct,e,t)},[ct,ea]),gs=(0,c.useCallback)(function(e,t){ct&&ta(ct,e,t)},[ct,ta]),ms=(0,c.useCallback)(e=>{Fo&&gs(Fo,e.map(e=>e.tabId))},[Fo,gs]),ks=(0,c.useCallback)(function(){return(0,Xe.jsx)(t.View,{style:In.emptyState,children:(0,Xe.jsx)(n.Text,{style:In.emptyStateText,children:d("workspace.tabs.emptyPane")})})},[d]),hs=Tn,ws=xt,fs=vt,Is=jt,Ts=Bt,ys=pn({gate:(0,We.renderWorkspaceRouteGate)({state:un,actions:{onRetryHost:we,onManageHost:Ce,onDismissMissingWorkspace:ve}}),workspaceKey:ct}),Ss=(0,c.useMemo)(()=>(0,Xe.jsxs)(t.View,{style:In.headerRight,children:[(0,Xe.jsx)(P.BackgroundActivityButton,{serverId:y,workspaceId:B}),(0,Xe.jsx)(v.CommandCenterSearchButton,{}),!k&&R&&R.scripts.length>0?(0,Xe.jsx)(O.WorkspaceScriptsButton,{serverId:y,workspaceId:B,scripts:R.scripts,liveTerminalIds:Nt,onScriptTerminalStarted:zt,onViewTerminal:Lt,onOpenUrlInBrowserTab:Qa,hideLabels:!0}):null,!k&&$e?(0,Xe.jsx)(E.WorkspaceOpenInEditorButton,{serverId:y,cwd:$e,activeFile:Ao,hideLabels:!0}):null,!k&&Pn?(0,Xe.jsxs)(Xe.Fragment,{children:[$e?(0,Xe.jsx)(H.WorkspaceGitActions,{serverId:y,cwd:$e,hideLabels:ra}):null,(0,Xe.jsxs)(_.Tooltip,{delayDuration:0,enabledOnDesktop:!0,enabledOnMobile:!1,children:[(0,Xe.jsx)(_.TooltipTrigger,{asChild:!0,children:(0,Xe.jsx)(a.Pressable,{testID:"workspace-explorer-toggle",onPress:Rn,accessibilityRole:"button",accessibilityLabel:Oa,accessibilityState:Fn,style:Dn,children:({hovered:e,pressed:t})=>{const n=jn||e||t?yt:St;return(0,Xe.jsxs)(Xe.Fragment,{children:[(0,Xe.jsx)(It,{size:16,uniProps:n}),R?.diffStat?(0,Xe.jsx)(f.DiffStat,{additions:R.diffStat.additions,deletions:R.diffStat.deletions}):null]})}})}),(0,Xe.jsx)(_.TooltipContent,{testID:"workspace-explorer-toggle-tooltip",side:"left",align:"center",offset:8,children:(0,Xe.jsxs)(t.View,{style:In.explorerTooltipRow,children:[(0,Xe.jsx)(n.Text,{style:In.explorerTooltipText,children:d("workspace.tabs.explorer.toggle")}),(0,Xe.jsx)(M.Shortcut,{keys:yn,style:In.explorerTooltipShortcut})]})})]})]}):null,k||Pn?null:(0,Xe.jsx)(x.HeaderToggleButton,{testID:"workspace-explorer-toggle",onPress:Rn,tooltipLabel:d("workspace.tabs.explorer.toggle"),tooltipKeys:yn,tooltipSide:"left",style:In.compactHeaderActionButton,accessible:!0,accessibilityRole:"button",accessibilityLabel:Oa,accessibilityState:Fn,children:({hovered:e})=>{const t=jn||e?yt:St;return(0,Xe.jsx)(ft,{size:16,uniProps:t})}}),k?(0,Xe.jsx)(x.HeaderToggleButton,{testID:"workspace-explorer-toggle",onPress:Rn,tooltipLabel:d("workspace.tabs.explorer.toggle"),tooltipKeys:yn,tooltipSide:"left",style:In.headerActionButton,accessible:!0,accessibilityRole:"button",accessibilityLabel:Oa,accessibilityState:Fn,children:({hovered:e})=>{const t=jn||e?yt:St;return Pn?(0,Xe.jsx)(It,Object.assign({size:20,uniProps:t},Ct)):(0,Xe.jsx)(ft,{size:20,uniProps:t})}}):null]}),[k,R,y,B,$e,Ao,Nt,zt,Lt,Qa,ra,Pn,Rn,jn,Oa,Fn,Dn,d]),Cs=(0,c.useMemo)(()=>mn({isFocusModeEnabled:I,isMobile:k}),[I,k]),xs=(0,c.useMemo)(()=>kn({isRouteFocused:s,isFocusModeEnabled:I,isMobile:k}),[s,I,k]),vs=(0,c.useMemo)(()=>Mt.isPending||null!==Kt,[Mt.isPending,Kt]),Ps=(0,Ee.getIsElectron)(),Ws=(0,c.useMemo)(()=>Fo??void 0,[Fo]),js=(0,c.useMemo)(()=>I&&!k,[I,k]),Bs=(0,c.useMemo)(()=>`workspace-floating-panels:${y}:${B}`,[y,B]),Ms=(0,c.useMemo)(()=>Ro&&zn&&ct?(0,Xe.jsx)(z.SplitContainer,{layout:zn,focusModeEnabled:js,workspaceKey:ct,normalizedServerId:y,normalizedWorkspaceId:B,isWorkspaceFocused:s,uiTabs:Vn,hoveredCloseTabKey:Pa,setHoveredCloseTabKey:Wa,closingTabIds:aa,onNavigateTab:fa,onCloseTab:no,onCopyResumeCommand:so,onCopyAgentId:ao,onCopyFilePath:oo,onReloadAgent:ro,onRenameTab:ja,onRenameAgent:io,onTagAgent:co,onSetKanbanBucket:lo,onCloseTabsToLeft:mo,onCloseTabsToRight:ho,onCloseOtherTabs:fo,onCreateDraftTab:Ka,onCreateTerminalTab:$a,onCreateBrowserTab:Ga,showCreateBrowserTab:Ps,buildPaneContentModel:No,onFocusPane:ds,onSplitPane:us,onSplitPaneEmpty:Ja,onMoveTabToPane:ps,onResizeSplit:bs,onReorderTabsInPane:gs,renderPaneEmptyState:ks}):null,[Ro,zn,ct,js,y,B,s,Vn,Pa,aa,fa,no,so,ao,oo,ro,ja,io,co,lo,mo,ho,fo,Ka,$a,Ga,Ps,No,ds,us,Ja,ps,bs,gs,ks])??Vo,As=Jo?null:(0,Xe.jsx)(q.SessionFilterBar,{statusCounts:ss,totalAgents:rs,visibleCount:cs.filter(e=>"agent"===e.target.kind).length,availableTags:is,kanbanCounts:as}),Rs=Cs?(0,Xe.jsx)(W.ScreenHeader,{onRowLayout:sa,left:(0,Xe.jsxs)(Xe.Fragment,{children:[(0,Xe.jsx)(C.SidebarMenuToggle,{}),(0,Xe.jsx)(an,{isLoading:Sn,title:Cn,subtitle:xn,showSubtitle:vn,currentBranchName:Wn,normalizedServerId:y,normalizedWorkspaceId:B,workspaceScripts:L,liveTerminalIds:Nt,showWorkspaceSetup:On,showCreateBrowserTab:Ps,isMobile:k,createTerminalDisabled:vs,importAgentDisabled:!st,copyPathDisabled:!$e,menuNewAgentIcon:ws,menuNewTerminalIcon:fs,menuNewBrowserIcon:Pt,menuImportIcon:Wt,menuCopyIcon:Is,menuSettingsIcon:Ts,onCreateDraftTab:Ka,onCreateTerminal:$a,onCreateTerminalWithProfile:qa,onCreateBrowser:Ga,onOpenImportSheet:rt,onCopyWorkspacePath:uo,onCopyBranchName:po,onOpenSetupTab:bo,onScriptTerminalStarted:zt,onViewScriptTerminal:Lt,onOpenUrlInBrowserTab:Qa})]}),right:Ss}):null,_s=(0,Xe.jsxs)(t.View,{style:In.centerColumn,children:[!k&&Rs,!k&&As,_o?(0,Xe.jsx)(ye.WorkspaceDesktopTabsRow,{paneId:Ws,isFocused:s,tabs:ls,normalizedServerId:y,normalizedWorkspaceId:B,setHoveredCloseTabKey:Wa,onNavigateTab:fa,onCloseTab:no,onCopyResumeCommand:so,onCopyAgentId:ao,onCopyFilePath:oo,onReloadAgent:ro,onRenameAgent:io,onTagAgent:co,onSetKanbanBucket:lo,onCloseTabsToLeft:ko,onCloseTabsToRight:wo,onCloseOtherTabs:Io,onCreateDraftTab:Ka,onCreateTerminalTab:$a,onCreateBrowserTab:Ga,showCreateBrowserTab:Ps,disableCreateTerminal:Mt.isPending,isWaitingOnTerminalReadiness:null!==Kt,onReorderTabs:ms,onSplitRight:Ht,onSplitDown:Ht,showPaneSplitActions:!1}):null,(0,Xe.jsx)(t.View,{style:In.centerContent,children:k?(0,Xe.jsx)(t.View,{style:In.content,children:Vo}):(0,Xe.jsx)(t.View,{style:In.content,children:Ms})})]});return ys??(0,Xe.jsx)(Re.WorkspaceFocusProvider,{workspaceKey:ct,children:(0,Xe.jsx)(Ge.RenderProfile,{id:"WorkspaceScreenContent",children:(0,Xe.jsxs)(t.View,{style:hs,children:[(0,Xe.jsx)(bn,{tab:Co,serverId:y,workspaceId:B,isRouteFocused:s}),(0,Xe.jsxs)(t.View,{style:In.threePaneRow,children:[k&&Rs,k&&As,k?(0,Xe.jsx)(Qt,{tabs:cs,activeTabKey:Va,activeTab:Co,tabSwitcherOptions:Ua,tabByKey:La,normalizedServerId:y,normalizedWorkspaceId:B,onSelectSwitcherTab:Xa,onCopyResumeCommand:so,onCopyAgentId:ao,onCopyFilePath:oo,onReloadAgent:ro,onRenameTab:ja,onCloseTab:no,onCloseActiveTab:Po,onCloseTabsAbove:ko,onCloseTabsBelow:wo,onCloseOtherTabs:Io,onRenameAgent:io,onTagAgent:co,onSetKanbanBucket:lo}):null,(0,Xe.jsx)(D.FloatingPanelPortalHostNameProvider,{hostName:Bs,children:_s}),(0,Xe.jsx)(D.FloatingPanelPortalHost,{name:Bs}),xs&&$e?(0,Xe.jsx)(F.ExplorerSidebar,{serverId:y,workspaceId:B,workspaceRoot:$e,isGit:Pn,onOpenFile:Sa}):null]}),(0,Xe.jsx)(V.ImportSessionSheet,{visible:at,client:Ve,serverId:y,cwd:$e,onClose:it,onImportedAgent:Ia}),(0,Xe.jsx)(fe.WorkspaceTabRenameModal,{renamingTab:Ba,onSubmit:Ma,onClose:Aa}),(0,Xe.jsx)(Te.AdaptiveTagsModal,{visible:null!=Ra,initialTags:es,suggestedTags:Zo,onSubmit:Fa,onClose:za})]})})})}const In=y.StyleSheet.create(e=>({container:{flex:1,backgroundColor:e.colors.surface0,uni__dependencies:[0]},containerWorkspaceBackground:{backgroundColor:e.colors.surfaceWorkspace,uni__dependencies:[0]},threePaneRow:{flex:1,minHeight:0,flexDirection:{xs:"column",sm:"column",md:"row"},alignItems:"stretch"},centerColumn:{flex:1,minHeight:0},headerTitle:{fontSize:e.fontSize.base,fontWeight:{xs:"400",md:"300"},color:e.colors.foreground,flexShrink:1,uni__dependencies:[0]},headerTitleContainer:{flex:1,flexShrink:1,minWidth:0,flexDirection:"row",alignItems:"center",gap:{xs:e.spacing[1],md:e.spacing[2]},overflow:"hidden",uni__dependencies:[0]},headerTitleTextGroup:{minWidth:0,overflow:"hidden",flexShrink:1,flexGrow:{xs:1,md:0},flexDirection:{xs:"column",md:"row"},alignItems:{xs:"flex-start",md:"center"},justifyContent:"flex-start",gap:{xs:0,md:e.spacing[2]},uni__dependencies:[0]},headerProjectTitle:{color:e.colors.foregroundMuted,fontSize:{xs:e.fontSize.sm,md:e.fontSize.base},flexShrink:1,minWidth:0,maxWidth:"60%",uni__dependencies:[0]},headerTitleSkeleton:{width:220,maxWidth:"100%",height:22,borderRadius:e.borderRadius.full,backgroundColor:e.colors.surface3,opacity:.25,uni__dependencies:[0]},headerRight:{flexDirection:"row",alignItems:"center",gap:{xs:e.spacing[1],md:e.spacing[2]},uni__dependencies:[0]},headerActionButton:{paddingVertical:e.spacing[2],paddingHorizontal:e.spacing[2],borderRadius:e.borderRadius.lg,uni__dependencies:[0]},compactHeaderActionButton:{width:e.spacing[8],height:e.spacing[8],padding:0,borderRadius:e.borderRadius.lg,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},compactHeaderMenuCluster:{flexDirection:"row",alignItems:"center",gap:{xs:0,md:e.spacing[2]},uni__dependencies:[0]},sourceControlButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:e.spacing[2],paddingHorizontal:e.spacing[1],paddingVertical:e.spacing[1],minHeight:Math.ceil(1.5*e.fontSize.sm)+2*e.spacing[1],minWidth:Math.ceil(1.5*e.fontSize.sm)+2*e.spacing[1],borderRadius:e.borderRadius.md,uni__dependencies:[0]},sourceControlButtonWithStats:{paddingHorizontal:e.spacing[3],uni__dependencies:[0]},sourceControlButtonHovered:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},newTabActions:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],uni__dependencies:[0]},newTabActionButton:{width:30,height:30,borderRadius:e.borderRadius.md,borderWidth:e.borderWidth[1],borderColor:e.colors.border,backgroundColor:e.colors.surface1,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},newTabActionButtonHovered:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},newTabTooltipText:{fontSize:e.fontSize.sm,color:e.colors.popoverForeground,uni__dependencies:[0]},newTabTooltipRow:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},newTabTooltipShortcut:{},explorerTooltipRow:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},explorerTooltipText:{fontSize:e.fontSize.sm,color:e.colors.popoverForeground,uni__dependencies:[0]},explorerTooltipShortcut:{},mobileTabsRow:{backgroundColor:e.colors.surface0,borderBottomWidth:e.borderWidth[1],borderBottomColor:e.colors.border,uni__dependencies:[0]},switcherRow:{flexDirection:"row",alignItems:"center",paddingRight:e.spacing[2],uni__dependencies:[0]},switcherTrigger:{flex:1,minWidth:0,flexDirection:"row",alignItems:"center",gap:e.spacing[2],paddingHorizontal:e.spacing[2]+e.spacing[3],paddingVertical:e.spacing[2],uni__dependencies:[0]},switcherTriggerPressed:{backgroundColor:e.colors.surface1,uni__dependencies:[0]},switcherTriggerLeft:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],flex:1,minWidth:0,uni__dependencies:[0]},switcherTriggerIcon:{flexShrink:0},switcherTriggerText:{minWidth:0,flex:1,color:e.colors.foreground,fontSize:e.fontSize.sm,uni__dependencies:[0]},mobileTabMenuTrigger:{width:28,height:28,borderRadius:e.borderRadius.md,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},mobileTabMenuTriggerActive:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},activeTabCloseButton:{width:28,height:28,borderRadius:e.borderRadius.md,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},activeTabCloseButtonPressed:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},undoToastRow:{flexDirection:"row",alignItems:"center",gap:e.spacing[3],uni__dependencies:[0]},undoToastText:{color:e.colors.foreground,fontSize:e.fontSize.sm,uni__dependencies:[0]},undoToastButton:{paddingHorizontal:e.spacing[2],paddingVertical:e.spacing[1],borderRadius:e.borderRadius.md,uni__dependencies:[0]},undoToastButtonPressed:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},undoToastAction:{color:e.colors.accent,fontSize:e.fontSize.sm,fontWeight:e.fontWeight.medium,uni__dependencies:[0]},menuItemHint:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,uni__dependencies:[0]},headerMenuProfileIconWrapper:{width:16,height:16},tabsContainer:{borderBottomWidth:1,borderBottomColor:e.colors.border,backgroundColor:e.colors.surface0,flexDirection:"row",alignItems:"center",uni__dependencies:[0]},tabsScroll:{flex:1,minWidth:0},tabsContent:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],paddingHorizontal:e.spacing[2],paddingVertical:e.spacing[1],uni__dependencies:[0]},tabsActions:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],paddingRight:e.spacing[2],paddingVertical:e.spacing[1],uni__dependencies:[0]},centerContent:{flex:1,minHeight:0},tab:{paddingHorizontal:e.spacing[3],paddingVertical:e.spacing[2],borderRadius:e.borderRadius.md,flexDirection:"row",alignItems:"center",gap:e.spacing[1],maxWidth:260,uni__dependencies:[0]},tabHandle:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],flex:1,minWidth:0,uni__dependencies:[0]},tabIcon:{flexShrink:0},tabActive:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},tabHovered:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},tabLabel:{flexShrink:1,minWidth:0,color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,fontWeight:e.fontWeight.normal,uni__dependencies:[0]},tabLabelWithCloseButton:{paddingRight:0},tabLabelActive:{color:e.colors.foreground,uni__dependencies:[0]},tabCloseButton:{width:18,height:18,marginLeft:0,borderRadius:e.borderRadius.sm,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},tabCloseButtonShown:{opacity:1},tabCloseButtonHidden:{opacity:0},tabCloseButtonActive:{backgroundColor:e.colors.surface3,uni__dependencies:[0]},content:{flex:1,minHeight:0,backgroundColor:e.colors.surface0,position:"relative",uni__dependencies:[0]},mobileMountedTabSlotVisible:{position:"absolute",top:0,left:0,right:0,bottom:0,opacity:1},mobileMountedTabSlotHidden:{position:"absolute",top:0,left:0,right:0,bottom:0,opacity:0},contentPlaceholder:{flex:1,minHeight:0,backgroundColor:e.colors.surface0,uni__dependencies:[0]},emptyState:{flex:1,alignItems:"center",justifyContent:"center",gap:e.spacing[3],paddingHorizontal:e.spacing[6],uni__dependencies:[0]},emptyStateText:{color:e.colors.foregroundMuted,textAlign:"center",uni__dependencies:[0]}})),Tn=[In.container,In.containerWorkspaceBackground],yn=["mod","E"]},4453,[348,711,1572,3519,349,36,3526,1148,1401,1376,811,1308,234,146,916,1143,3628,1573,3636,1600,1320,56,3444,4406,4409,4410,4411,4407,4408,3456,3515,4454,3572,3573,4016,3700,4455,4605,4606,4607,4621,4624,3499,3582,3414,3602,4626,3513,3613,3955,3958,3957,3959,3436,3689,3596,3439,3271,3904,4085,3525,4627,3678,4098,3523,3433,3434,3404,4628,3494,3419,4547,4629,4630,3954,4592,4631,4597,4632,4633,4634,4635,4636,4461,4464,4463,3879,4638,4639,4538,4462,3457,3407,4527,3477,4640,3903,4598,3929,3440,4520,3887,279]);
|
|
16107
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return R}});var e,t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),c=r(d[4]),u=(e=c)&&e.__esModule?e:{default:e};r(d[5]);var l=r(d[6]),p=r(d[7]),k=r(d[8]),f=r(d[9]),I=r(d[10]),v=r(d[11]),y=r(d[12]),S=r(d[13]),h=r(d[14]),w=r(d[15]),W=r(d[16]),E=r(d[17]);function _(e){if("string"==typeof e)return e.trim();if(Array.isArray(e)){const t=e[0];return"string"==typeof t?t.trim():""}return""}function x(e){return"agent"===e.kind?{kind:"agent",agentId:e.agentId}:"terminal"===e.kind?{kind:"terminal",terminalId:e.terminalId}:"file"===e.kind?{kind:"file",path:e.path}:"setup"===e.kind?{kind:"setup",workspaceId:e.workspaceId}:{kind:"draft",draftId:e.draftId}}function b(){if(!W.isWeb||"undefined"==typeof window)return;const e=new URL(window.location.href);e.searchParams.has("open")&&(e.searchParams.delete("open"),(0,h.replaceBrowserRouteWithCanonicalHostWorkspaceRoute)(`${e.pathname}${e.search}${e.hash}`))}function P(e){e.navigation.setParams({open:void 0}),W.isWeb&&b()}function R(){const e=(0,n.c)(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,E.jsx)(p.HostRouteBootstrapBoundary,{children:(0,E.jsx)(j,{})}),e[0]=t):t=e[0],t}function j(){const e=(0,n.c)(25),t=(0,o.useNavigation)(),c=(0,l.useRootNavigationState)(),u=(0,v.useWorkspaceLayoutStoreHydrated)(),p=(0,s.useRef)(null),[k,f]=(0,s.useState)(!1),I=(0,l.useLocalSearchParams)(),y=(0,l.useGlobalSearchParams)();let W;e[0]!==I.serverId?(W=_(I.serverId),e[0]=I.serverId,e[1]=W):W=e[1];const b=W;let R;if(e[2]!==I.workspaceId){const t=_(I.workspaceId);R=t?(0,S.decodeWorkspaceIdFromPathSegment)(t)??"":"",e[2]=I.workspaceId,e[3]=R}else R=e[3];const j=R;let D;e[4]!==y.open?(D=_(y.open),e[4]=y.open,e[5]=D):D=e[5];const $=D;let H,M,O;e[6]!==b||e[7]!==j?(H=()=>{b&&j&&(0,h.stripHostWorkspaceRouteEchoSearchFromBrowserUrlAfterCommit)()},M=[b,j],e[6]=b,e[7]=j,e[8]=H,e[9]=M):(H=e[8],M=e[9]),(0,s.useEffect)(H,M),e[10]!==u||e[11]!==t||e[12]!==$||e[13]!==c?.key||e[14]!==b||e[15]!==j?(O=()=>{if(!$)return;if(!c?.key)return;if(!u)return;const e=`${b}:${j}:${$}`;if(p.current===e)return P({navigation:t}),void f(!0);p.current=e;const n=(0,S.parseWorkspaceOpenIntent)($);n&&(0,w.prepareWorkspaceTab)({serverId:b,workspaceId:j,target:x(n),pin:"agent"===n.kind}),P({navigation:t}),f(!0)},e[10]=u,e[11]=t,e[12]=$,e[13]=c?.key,e[14]=b,e[15]=j,e[16]=O):O=e[16];const C=c?.key;let K,U;return e[17]!==u||e[18]!==t||e[19]!==$||e[20]!==b||e[21]!==C||e[22]!==j?(K=[u,t,$,C,b,j],e[17]=u,e[18]=t,e[19]=$,e[20]=b,e[21]=C,e[22]=j,e[23]=K):K=e[23],(0,s.useEffect)(O,K),!$||k&&u?(e[24]===Symbol.for("react.memo_cache_sentinel")?(U=(0,E.jsx)(A,{}),e[24]=U):U=e[24],U):null}function A(){const e=(0,n.c)(13),o=(0,k.useActiveWorkspaceSelection)();let c;e[0]!==o?(c=()=>o?[o]:[],e[0]=o,e[1]=c):c=e[1];const[u,l]=(0,s.useState)(c);let p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=e=>{l(t=>t.filter(t=>!(0,y.areWorkspaceSelectionsEqual)(t,e)))},e[2]=p):p=e[2];const f=p;let I,v,S,h;if(e[3]!==o?(I=()=>{o&&l(e=>{const t=(0,y.pruneMountedWorkspaceSelections)({currentSelections:e,activeSelection:o,maxMountedWorkspaces:y.WORKSPACE_DECK_MAX_MOUNTED_WORKSPACES});return(0,y.areWorkspaceSelectionListsEqual)(e,t)?e:t})},v=[o],e[3]=o,e[4]=I,e[5]=v):(I=e[4],v=e[5]),(0,s.useEffect)(I,v),!o)return null;if(e[6]!==o||e[7]!==u){let t;e[9]!==o?(t=e=>(0,E.jsx)(D,{selection:e,activeSelection:o,onUnmountInactive:f},(0,y.getWorkspaceSelectionKey)(e)),e[9]=o,e[10]=t):t=e[10],S=u.map(t),e[6]=o,e[7]=u,e[8]=S}else S=e[8];return e[11]!==S?(h=(0,E.jsx)(t.View,{style:$.deck,children:S}),e[11]=S,e[12]=h):h=e[12],h}function D(e){const o=(0,n.c)(13),{selection:c,activeSelection:u,onUnmountInactive:l}=e,p=(0,y.areWorkspaceSelectionsEqual)(c,u),k=(0,f.useHasHydratedWorkspaces)(c.serverId),v=(0,f.useWorkspaceExists)(c.serverId,c.workspaceId),S=(0,y.shouldKeepWorkspaceDeckEntryMounted)({isActive:p,hasHydratedWorkspaces:k,workspaceExists:v});let h,w;if(o[0]!==l||o[1]!==c||o[2]!==S?(h=()=>{S||l(c)},w=[l,c,S],o[0]=l,o[1]=c,o[2]=S,o[3]=h,o[4]=w):(h=o[3],w=o[4]),(0,s.useEffect)(h,w),!S)return null;const W=p?$.activeDeckEntry:$.inactiveDeckEntry,_=`workspace-deck-entry-${c.serverId}:${c.workspaceId}`;let x,b;return o[5]!==p||o[6]!==c.serverId||o[7]!==c.workspaceId?(x=(0,E.jsx)(I.WorkspaceScreen,{serverId:c.serverId,workspaceId:c.workspaceId,isRouteFocused:p}),o[5]=p,o[6]=c.serverId,o[7]=c.workspaceId,o[8]=x):x=o[8],o[9]!==W||o[10]!==_||o[11]!==x?(b=(0,E.jsx)(t.View,{style:W,testID:_,children:x}),o[9]=W,o[10]=_,o[11]=x,o[12]=b):b=o[12],b}const $=u.default.create({deck:{flex:1},activeDeckEntry:{flex:1},inactiveDeckEntry:{display:"none",flex:1}})},4452,[348,349,36,1148,59,146,1143,4399,3487,3525,4453,3436,4642,3477,3491,3486,3407,279]);
|
|
16108
|
+
__d(function(e,t,n,o,a,s,r){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(s,'__esModule',{value:!0}),Object.defineProperty(s,"WorkspaceScreen",{enumerable:!0,get:function(){return on}});var c=t(r[0]),l=t(r[1]),d=t(r[2]),u=t(r[3]),p=t(r[4]),b=t(r[5]),m=t(r[6]),g=t(r[7]);t(r[8]);var k=i(t(r[9])),h=i(t(r[10]));t(r[11]),t(r[12]),t(r[13]);var w=t(r[14]),f=t(r[15]),I=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(t(r[16])),T=t(r[17]),S=t(r[18]),y=t(r[19]),C=t(r[20]),v=t(r[21]),x=i(t(r[22])),W=t(r[23]),P=t(r[24]),j=t(r[25]),M=t(r[26]),B=t(r[27]),A=t(r[28]),R=t(r[29]),_=t(r[30]),D=t(r[31]),F=t(r[32]),z=t(r[33]),L=t(r[34]),H=t(r[35]),E=t(r[36]),O=t(r[37]),V=t(r[38]),N=t(r[39]),U=t(r[40]),K=t(r[41]),$=t(r[42]),q=t(r[43]),G=t(r[44]),Q=t(r[45]),X=t(r[46]),J=t(r[47]),Y=t(r[48]),Z=t(r[49]),ee=t(r[50]),te=t(r[51]),ne=t(r[52]),oe=t(r[53]),ae=t(r[54]),se=t(r[55]),re=t(r[56]),ie=t(r[57]),ce=t(r[58]),le=t(r[59]),de=t(r[60]),ue=t(r[61]),pe=t(r[62]),be=t(r[63]),me=t(r[64]),ge=t(r[65]),ke=t(r[66]),he=t(r[67]),we=t(r[68]),fe=t(r[69]),Ie=t(r[70]),Te=t(r[71]),Se=t(r[72]),ye=t(r[73]),Ce=t(r[74]),ve=t(r[75]),xe=t(r[76]),We=t(r[77]),Pe=t(r[78]),je=t(r[79]),Me=t(r[80]),Be=t(r[81]),Ae=t(r[82]),Re=t(r[83]),_e=t(r[84]),De=t(r[85]),Fe=t(r[86]),ze=t(r[87]),Le=t(r[88]),He=t(r[89]),Ee=t(r[90]),Oe=t(r[91]),Ve=t(r[92]),Ne=t(r[93]),Ue=t(r[94]),Ke=t(r[95]),$e=t(r[96]),qe=t(r[97]),Ge=t(r[98]),Qe=t(r[99]),Xe=t(r[100]),Je=t(r[101]),Ye=t(r[102]),Ze=t(r[103]),et=t(r[104]),tt=t(r[105]);const nt=[],ot=[],at=new Set,st=new Set;function rt(e){return e?.scripts??ot}function it(e){const t=e?.target;return"file"!==t?.kind?{path:null}:{path:t.path,lineStart:t.lineStart,lineEnd:t.lineEnd}}const ct=(0,v.withUnistyles)(u.ActivityIndicator),lt=(0,v.withUnistyles)(y.Ellipsis),dt=(0,v.withUnistyles)(y.EllipsisVertical),ut=(0,v.withUnistyles)(y.ChevronDown),pt=(0,v.withUnistyles)(y.Copy),bt=(0,v.withUnistyles)(y.RotateCw),mt=(0,v.withUnistyles)(y.ArrowLeftToLine),gt=(0,v.withUnistyles)(y.ArrowRightToLine),kt=(0,v.withUnistyles)(y.CopyX),ht=(0,v.withUnistyles)(y.Pencil),wt=(0,v.withUnistyles)(y.X),ft=(0,v.withUnistyles)(y.SquarePen),It=(0,v.withUnistyles)(y.SquareTerminal),Tt=(0,v.withUnistyles)(y.Globe),St=(0,v.withUnistyles)(y.Import),yt=(0,v.withUnistyles)(y.Settings),Ct=(0,v.withUnistyles)(y.PanelRight),vt=(0,v.withUnistyles)(O.SourceControlPanelIcon);const xt=(0,v.withUnistyles)(function(e){const t=(0,p.c)(6),{iconKey:n,size:o,color:a}=e,s=void 0===a?"":a;let r;t[0]!==n?(r=(0,Je.getProviderIcon)(n),t[0]=n,t[1]=r):r=t[1];const i=r;let c;return t[2]!==i||t[3]!==s||t[4]!==o?(c=(0,tt.jsx)(i,{size:o,color:s}),t[2]=i,t[3]=s,t[4]=o,t[5]=c):c=t[5],c}),Wt=e=>({color:e.colors.foreground}),Pt=e=>({color:e.colors.foregroundMuted}),jt={strokeWidth:1.5},Mt=(0,tt.jsx)(ft,{size:16,uniProps:Pt}),Bt=(0,tt.jsx)(It,{size:16,uniProps:Pt}),At=(0,tt.jsx)(Tt,{size:16,uniProps:Pt}),Rt=(0,tt.jsx)(St,{size:16,uniProps:Pt}),_t=(0,tt.jsx)(pt,{size:16,uniProps:Pt}),Dt=(0,tt.jsx)(yt,{size:16,uniProps:Pt}),Ft=(0,tt.jsx)(W.SidebarMenuToggle,{});function zt(e){if("string"!=typeof e)return null;const t=e.trim();return t.length>0?t:null}function Lt(e){try{return decodeURIComponent(e)}catch{return e}}function Ht(e){const t=(0,p.c)(6);let n;t[0]!==e.workspaceLayout?(n=(0,re.getFocusedBrowserId)(e.workspaceLayout),t[0]=e.workspaceLayout,t[1]=n):n=t[1];const o=n;let a,s;t[2]!==o||t[3]!==e.workspaceId?(a=()=>{(0,Ke.getIsElectron)()&&(0,Ie.getDesktopHost)()?.browser?.setWorkspaceActiveBrowser?.({workspaceId:e.workspaceId,browserId:o})},s=[o,e.workspaceId],t[2]=o,t[3]=e.workspaceId,t[4]=a,t[5]=s):(a=t[4],s=t[5]),(0,b.useEffect)(a,s)}function Et(e,t){return"draft"===e.target.kind?t.newAgent:"setup"===e.target.kind?t.setup:"terminal"===e.target.kind?t.terminal:"browser"===e.target.kind?t.browser:"pluginView"===e.target.kind?"Extension":"file"===e.target.kind?e.target.path.split("/").findLast(Boolean)??e.target.path:t.agent}function Ot(e){const t=(0,p.c)(4),{activeTab:n,normalizedServerId:o,normalizedWorkspaceId:a}=e;if(!n)return null;let s;return t[0]!==n||t[1]!==o||t[2]!==a?(s=(0,tt.jsx)(Vt,{activeTab:n,normalizedServerId:o,normalizedWorkspaceId:a}),t[0]=n,t[1]=o,t[2]=a,t[3]=s):s=t[3],s}function Vt(e){const t=(0,p.c)(7),{activeTab:n,normalizedServerId:o,normalizedWorkspaceId:a}=e,{t:s}=(0,T.useTranslation)();let r,i;return t[0]!==s?(r=e=>(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(c.View,{style:vn.switcherTriggerIcon,testID:"workspace-active-tab-icon",children:(0,tt.jsx)(Ce.WorkspaceTabIcon,{presentation:e,active:!0})}),(0,tt.jsx)(l.Text,{style:vn.switcherTriggerText,numberOfLines:1,children:"loading"===e.titleState?s("workspace.tabs.loading"):e.label})]}),t[0]=s,t[1]=r):r=t[1],t[2]!==n||t[3]!==o||t[4]!==a||t[5]!==r?(i=(0,tt.jsx)(Ce.WorkspaceTabPresentationResolver,{tab:n,serverId:o,workspaceId:a,children:r}),t[2]=n,t[3]=o,t[4]=a,t[5]=r,t[6]=i):i=t[6],i}function Nt(e){const t=(0,p.c)(5),{label:n,titleState:o}=e,{t:a}=(0,T.useTranslation)();let s,r;return t[0]!==n||t[1]!==a||t[2]!==o?(s=()=>{if(Ke.isNative||"undefined"==typeof document)return;const e=n.trim();document.title="loading"===o?a("workspace.tabs.loading"):e||a("workspace.tabs.fallback.workspace")},r=[n,o,a],t[0]=n,t[1]=a,t[2]=o,t[3]=s,t[4]=r):(s=t[3],r=t[4]),(0,b.useEffect)(s,r),null}function Ut(){}function Kt({open:e,pressed:t}){return[vn.mobileTabMenuTrigger,(Boolean(e)||Boolean(t))&&vn.mobileTabMenuTriggerActive]}function $t({pressed:e}){return[vn.switcherTrigger,Boolean(e)&&vn.switcherTriggerPressed]}function qt({pressed:e}){return[vn.activeTabCloseButton,Boolean(e)&&vn.activeTabCloseButtonPressed]}function Gt({pressed:e}){return[vn.undoToastButton,Boolean(e)&&vn.undoToastButtonPressed]}function Qt(e){const t=(0,p.c)(8),{label:n,onUndo:o}=e;let a,s,r,i;return t[0]!==n?(a=(0,tt.jsx)(l.Text,{style:vn.undoToastText,children:n}),t[0]=n,t[1]=a):a=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,tt.jsx)(l.Text,{style:vn.undoToastAction,children:"Undo"}),t[2]=s):s=t[2],t[3]!==o?(r=(0,tt.jsx)(d.Pressable,{testID:"workspace-tab-close-undo-button",accessibilityRole:"button",accessibilityLabel:"Undo close tab",hitSlop:8,style:Gt,onPress:o,children:s}),t[3]=o,t[4]=r):r=t[4],t[5]!==a||t[6]!==r?(i=(0,tt.jsxs)(c.View,{style:vn.undoToastRow,children:[a,r]}),t[5]=a,t[6]=r,t[7]=i):i=t[7],i}function Xt(e){const t=(0,p.c)(15),{menuTestIDBase:n,presentationLabel:o,menuEntries:a}=e,{t:s}=(0,T.useTranslation)(),r=`${n}-trigger`;let i,c,l,d,u,b;return t[0]!==o||t[1]!==s?(i=s("workspace.tabs.menu.openFor",{label:o}),t[0]=o,t[1]=s,t[2]=i):i=t[2],t[3]===Symbol.for("react.memo_cache_sentinel")?(c=(0,tt.jsx)(lt,{size:14,uniProps:Pt}),t[3]=c):c=t[3],t[4]!==r||t[5]!==i?(l=(0,tt.jsx)(F.DropdownMenuTrigger,{testID:r,accessibilityRole:"button",accessibilityLabel:i,hitSlop:8,style:Kt,children:c}),t[4]=r,t[5]=i,t[6]=l):l=t[6],t[7]!==a?(d=a.map(Jt),t[7]=a,t[8]=d):d=t[8],t[9]!==n||t[10]!==d?(u=(0,tt.jsx)(F.DropdownMenuContent,{side:"bottom",align:"end",width:220,testID:n,children:d}),t[9]=n,t[10]=d,t[11]=u):u=t[11],t[12]!==l||t[13]!==u?(b=(0,tt.jsxs)(F.DropdownMenu,{children:[l,u]}),t[12]=l,t[13]=u,t[14]=b):b=t[14],b}function Jt(e){return"separator"===e.kind?(0,tt.jsx)(F.DropdownMenuSeparator,{},e.key):(0,tt.jsx)(Yt,{entry:e},e.key)}function Yt(e){const t=(0,p.c)(18),{entry:n}=e;let o;e:switch(n.icon){case"copy":{let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,tt.jsx)(pt,{size:16,uniProps:Pt}),t[0]=e):e=t[0],o=e;break e}case"rotate-cw":{let e;t[1]===Symbol.for("react.memo_cache_sentinel")?(e=(0,tt.jsx)(bt,{size:16,uniProps:Pt}),t[1]=e):e=t[1],o=e;break e}case"arrow-left-to-line":{let e;t[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,tt.jsx)(mt,{size:16,uniProps:Pt}),t[2]=e):e=t[2],o=e;break e}case"arrow-right-to-line":{let e;t[3]===Symbol.for("react.memo_cache_sentinel")?(e=(0,tt.jsx)(gt,{size:16,uniProps:Pt}),t[3]=e):e=t[3],o=e;break e}case"copy-x":{let e;t[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,tt.jsx)(kt,{size:16,uniProps:Pt}),t[4]=e):e=t[4],o=e;break e}case"pencil":{let e;t[5]===Symbol.for("react.memo_cache_sentinel")?(e=(0,tt.jsx)(ht,{size:16,uniProps:Pt}),t[5]=e):e=t[5],o=e;break e}case"x":{let e;t[6]===Symbol.for("react.memo_cache_sentinel")?(e=(0,tt.jsx)(wt,{size:16,uniProps:Pt}),t[6]=e):e=t[6],o=e;break e}default:o=void 0}const a=o;let s;t[7]!==n.hint?(s=n.hint?(0,tt.jsx)(l.Text,{style:vn.menuItemHint,children:n.hint}):void 0,t[7]=n.hint,t[8]=s):s=t[8];const r=s;let i;return t[9]!==n.destructive||t[10]!==n.disabled||t[11]!==n.label||t[12]!==n.onSelect||t[13]!==n.testID||t[14]!==n.tooltip||t[15]!==a||t[16]!==r?(i=(0,tt.jsx)(F.DropdownMenuItem,{testID:n.testID,disabled:n.disabled,destructive:n.destructive,onSelect:n.onSelect,tooltip:n.tooltip,leading:a,trailing:r,children:n.label}),t[9]=n.destructive,t[10]=n.disabled,t[11]=n.label,t[12]=n.onSelect,t[13]=n.testID,t[14]=n.tooltip,t[15]=a,t[16]=r,t[17]=i):i=t[17],i}function Zt(e){const t=(0,p.c)(90),{tab:n,tabIndex:o,tabCount:a,normalizedServerId:s,normalizedWorkspaceId:r,selected:i,active:c,onPress:l,onCopyResumeCommand:d,onCopyAgentId:u,onCopyFilePath:b,onReloadAgent:m,onRenameTab:g,onCloseTab:k,onCloseTabsAbove:h,onCloseTabsBelow:w,onCloseOtherTabs:f,onRenameAgent:I,onTagAgent:S,onSetKanbanBucket:y}=e,{t:C}=(0,T.useTranslation)();let v,x,W,P,j,M,B,A,R,_,D,F,z;t[0]!==C?(v=C("workspace.tabs.menu.copyResumeCommand"),t[0]=C,t[1]=v):v=t[1],t[2]!==C?(x=C("workspace.tabs.menu.copyAgentId"),t[2]=C,t[3]=x):x=t[3],t[4]!==C?(W=C("workspace.tabs.menu.copyFilePath"),t[4]=C,t[5]=W):W=t[5],t[6]!==C?(P=C("workspace.tabs.menu.rename"),t[6]=C,t[7]=P):P=t[7],t[8]!==C?(j=C("workspace.tabs.menu.closeAbove"),t[8]=C,t[9]=j):j=t[9],t[10]!==C?(M=C("workspace.tabs.menu.closeBelow"),t[10]=C,t[11]=M):M=t[11],t[12]!==C?(B=C("workspace.tabs.menu.closeLeft"),t[12]=C,t[13]=B):B=t[13],t[14]!==C?(A=C("workspace.tabs.menu.closeRight"),t[14]=C,t[15]=A):A=t[15],t[16]!==C?(R=C("workspace.tabs.menu.closeOthers"),t[16]=C,t[17]=R):R=t[17],t[18]!==C?(_=C("workspace.tabs.menu.reloadAgent"),t[18]=C,t[19]=_):_=t[19],t[20]!==C?(D=C("workspace.tabs.menu.reloadAgentTooltip"),t[20]=C,t[21]=D):D=t[21],t[22]!==C?(F=C("workspace.tabs.menu.close"),t[22]=C,t[23]=F):F=t[23],t[24]!==v||t[25]!==_||t[26]!==D||t[27]!==F||t[28]!==x||t[29]!==W||t[30]!==P||t[31]!==j||t[32]!==M||t[33]!==B||t[34]!==A||t[35]!==R?(z={copyResumeCommand:v,copyAgentId:x,copyFilePath:W,rename:P,closeAbove:j,closeBelow:M,closeLeft:B,closeRight:A,closeOthers:R,reloadAgent:_,reloadAgentTooltip:D,close:F},t[24]=v,t[25]=_,t[26]=D,t[27]=F,t[28]=x,t[29]=W,t[30]=P,t[31]=j,t[32]=M,t[33]=B,t[34]=A,t[35]=R,t[36]=z):z=t[36];const L=z;let H;t[37]!==n.target?(H=(0,le.buildDeterministicWorkspaceTabId)(n.target),t[37]=n.target,t[38]=H):H=t[38];const E=`workspace-tab-menu-${H}`;let O;t[39]!==E||t[40]!==f||t[41]!==k||t[42]!==h||t[43]!==w||t[44]!==u||t[45]!==b||t[46]!==d||t[47]!==m||t[48]!==I||t[49]!==g||t[50]!==y||t[51]!==S||t[52]!==n||t[53]!==a||t[54]!==o||t[55]!==L?(O=(0,Me.buildWorkspaceTabMenuEntries)({surface:"mobile",tab:n,index:o,tabCount:a,menuTestIDBase:E,onCopyResumeCommand:d,onCopyAgentId:u,onCopyFilePath:b,onReloadAgent:m,onRenameTab:g,onCloseTab:k,onCloseTabsBefore:h,onCloseTabsAfter:w,onCloseOtherTabs:f,onRenameAgent:I,onTagAgent:S,onSetKanbanBucket:y,labels:L}),t[39]=E,t[40]=f,t[41]=k,t[42]=h,t[43]=w,t[44]=u,t[45]=b,t[46]=d,t[47]=m,t[48]=I,t[49]=g,t[50]=y,t[51]=S,t[52]=n,t[53]=a,t[54]=o,t[55]=L,t[56]=O):O=t[56];const V=O;let N,U,K,$,q,G;t[57]!==C?(N=C("workspace.tabs.fallback.newAgent"),t[57]=C,t[58]=N):N=t[58],t[59]!==C?(U=C("workspace.tabs.fallback.setup"),t[59]=C,t[60]=U):U=t[60],t[61]!==C?(K=C("workspace.tabs.fallback.terminal"),t[61]=C,t[62]=K):K=t[62],t[63]!==C?($=C("workspace.tabs.fallback.browser"),t[63]=C,t[64]=$):$=t[64],t[65]!==C?(q=C("workspace.tabs.fallback.agent"),t[65]=C,t[66]=q):q=t[66],t[67]!==N||t[68]!==U||t[69]!==K||t[70]!==$||t[71]!==q?(G={newAgent:N,setup:U,terminal:K,browser:$,agent:q},t[67]=N,t[68]=U,t[69]=K,t[70]=$,t[71]=q,t[72]=G):G=t[72];const Q=G;let X;t[73]!==Q||t[74]!==n?(X=Et(n,Q),t[73]=Q,t[74]=n,t[75]=X):X=t[75];const J=X;let Y;t[76]!==J||t[77]!==V||t[78]!==E?(Y=(0,tt.jsx)(Xt,{menuTestIDBase:E,presentationLabel:J,menuEntries:V}),t[76]=J,t[77]=V,t[78]=E,t[79]=Y):Y=t[79];const Z=Y;let ee;t[80]!==c||t[81]!==l||t[82]!==i||t[83]!==Z?(ee=e=>(0,tt.jsx)(Ce.WorkspaceTabOptionRow,{presentation:e,selected:i,active:c,onPress:l,trailingAccessory:Z}),t[80]=c,t[81]=l,t[82]=i,t[83]=Z,t[84]=ee):ee=t[84];const te=ee;let ne;return t[85]!==s||t[86]!==r||t[87]!==te||t[88]!==n?(ne=(0,tt.jsx)(Ce.WorkspaceTabPresentationResolver,{tab:n,serverId:s,workspaceId:r,children:te}),t[85]=s,t[86]=r,t[87]=te,t[88]=n,t[89]=ne):ne=t[89],ne}const en=(0,b.memo)(function(e){const t=(0,p.c)(57),{tabs:n,activeTabKey:o,activeTab:a,tabSwitcherOptions:s,tabByKey:r,normalizedServerId:i,normalizedWorkspaceId:l,onSelectSwitcherTab:u,onCopyResumeCommand:m,onCopyAgentId:g,onCopyFilePath:k,onReloadAgent:w,onRenameTab:f,onCloseTab:I,onCloseActiveTab:S,onCloseTabsAbove:y,onCloseTabsBelow:C,onCloseOtherTabs:v,onRenameAgent:x,onTagAgent:W,onSetKanbanBucket:P}=e,{t:j}=(0,T.useTranslation)(),[M,B]=(0,b.useState)(!1),A=(0,b.useRef)(null);let _;t[0]!==n?(_=new Map,n.forEach((e,t)=>{_.set(e.key,t)}),t[0]=n,t[1]=_):_=t[1];const D=_;let F;t[2]===Symbol.for("react.memo_cache_sentinel")?(F=()=>{h.default.dismiss(),B(!0)},t[2]=F):F=t[2];const z=F;let L;t[3]!==a||t[4]!==S?(L=()=>{a&&S&&S(a.tabId)},t[3]=a,t[4]=S,t[5]=L):L=t[5];const H=L;let E;t[6]!==i||t[7]!==l||t[8]!==v||t[9]!==I||t[10]!==y||t[11]!==C||t[12]!==g||t[13]!==k||t[14]!==m||t[15]!==w||t[16]!==x||t[17]!==f||t[18]!==P||t[19]!==W||t[20]!==r||t[21]!==D||t[22]!==n.length?(E=e=>{const{option:t,selected:o,active:a,onPress:s}=e,d=r.get(t.id);if(!d)return(0,tt.jsx)(c.View,{});const u=D.get(d.key)??-1;return u<0?(0,tt.jsx)(c.View,{}):(0,tt.jsx)(Zt,{tab:d,tabIndex:u,tabCount:n.length,normalizedServerId:i,normalizedWorkspaceId:l,selected:o,active:a,onPress:s,onCopyResumeCommand:m,onCopyAgentId:g,onCopyFilePath:k,onReloadAgent:w,onRenameTab:f,onCloseTab:I,onCloseTabsAbove:y,onCloseTabsBelow:C,onCloseOtherTabs:v,onRenameAgent:x,onTagAgent:W,onSetKanbanBucket:P})},t[6]=i,t[7]=l,t[8]=v,t[9]=I,t[10]=y,t[11]=C,t[12]=g,t[13]=k,t[14]=m,t[15]=w,t[16]=x,t[17]=f,t[18]=P,t[19]=W,t[20]=r,t[21]=D,t[22]=n.length,t[23]=E):E=t[23];const O=E;let V,N,U,K,$,q,G,Q,X,J;return t[24]!==j||t[25]!==n.length?(V=j("workspace.tabs.switcher.trigger",{count:n.length}),t[24]=j,t[25]=n.length,t[26]=V):V=t[26],t[27]!==a||t[28]!==i||t[29]!==l?(N=(0,tt.jsx)(c.View,{style:vn.switcherTriggerLeft,children:(0,tt.jsx)(Ot,{activeTab:a,normalizedServerId:i,normalizedWorkspaceId:l})}),t[27]=a,t[28]=i,t[29]=l,t[30]=N):N=t[30],t[31]===Symbol.for("react.memo_cache_sentinel")?(U=(0,tt.jsx)(ut,{size:14,uniProps:Pt}),t[31]=U):U=t[31],t[32]!==V||t[33]!==N?(K=(0,tt.jsxs)(d.Pressable,{ref:A,testID:"workspace-tab-switcher-trigger",accessibilityRole:"button",accessibilityLabel:V,style:$t,onPress:z,children:[N,U]}),t[32]=V,t[33]=N,t[34]=K):K=t[34],t[35]!==a||t[36]!==H||t[37]!==S?($=a&&S?(0,tt.jsx)(d.Pressable,{testID:"workspace-active-tab-close",accessibilityRole:"button",accessibilityLabel:"Close current tab",hitSlop:8,style:qt,onPress:H,children:(0,tt.jsx)(wt,{size:16,uniProps:Pt})}):null,t[35]=a,t[36]=H,t[37]=S,t[38]=$):$=t[38],t[39]!==K||t[40]!==$?(q=(0,tt.jsxs)(c.View,{style:vn.switcherRow,children:[K,$]}),t[39]=K,t[40]=$,t[41]=q):q=t[41],t[42]!==j?(G=j("workspace.tabs.switcher.title"),t[42]=j,t[43]=G):G=t[43],t[44]!==j?(Q=j("workspace.tabs.switcher.searchPlaceholder"),t[44]=j,t[45]=Q):Q=t[45],t[46]!==o||t[47]!==M||t[48]!==u||t[49]!==O||t[50]!==G||t[51]!==Q||t[52]!==s?(X=(0,tt.jsx)(R.Combobox,{options:s,value:o,onSelect:u,searchable:!1,title:G,searchPlaceholder:Q,open:M,onOpenChange:B,anchorRef:A,renderOption:O}),t[46]=o,t[47]=M,t[48]=u,t[49]=O,t[50]=G,t[51]=Q,t[52]=s,t[53]=X):X=t[53],t[54]!==X||t[55]!==q?(J=(0,tt.jsxs)(c.View,{style:vn.mobileTabsRow,testID:"workspace-tabs-row",children:[q,X]}),t[54]=X,t[55]=q,t[56]=J):J=t[56],J}),tn=(0,b.memo)(function(e){const t=(0,p.c)(18),{tabDescriptor:n,isVisible:o,isWorkspaceFocused:a,isPaneFocused:s,paneId:r,buildPaneContentModel:i}=e;let l;t[0]!==i||t[1]!==r||t[2]!==n?(l=i({paneId:r,tab:n}),t[0]=i,t[1]=r,t[2]=n,t[3]=l):l=t[3];const d=l,u=o?vn.mobileMountedTabSlotVisible:vn.mobileMountedTabSlotHidden,b=`MobileMountedTabSlot:${n.kind}:${n.tabId}`,m=o?"auto":"none";let g,k,h,w;return t[4]!==d||t[5]!==s||t[6]!==a?(g=(0,tt.jsx)(ze.WorkspacePaneContent,{content:d,isWorkspaceFocused:a,isPaneFocused:s}),t[4]=d,t[5]=s,t[6]=a,t[7]=g):g=t[7],t[8]!==u||t[9]!==m||t[10]!==g?(k=(0,tt.jsx)(c.View,{style:u,pointerEvents:m,children:g}),t[8]=u,t[9]=m,t[10]=g,t[11]=k):k=t[11],t[12]!==o||t[13]!==k?(h=(0,tt.jsx)(E.MountedTabActiveContext,{value:o,children:k}),t[12]=o,t[13]=k,t[14]=h):h=t[14],t[15]!==b||t[16]!==h?(w=(0,tt.jsx)(Ze.RenderProfile,{id:b,children:h}),t[15]=b,t[16]=h,t[17]=w):w=t[17],w});function nn(e){const t=(0,b.useRef)(new Map),n=(0,b.useMemo)(()=>{const n=new Map;for(const o of e){const e=t.current.get(o.tabId);e&&e.key===o.key&&e.kind===o.kind&&(0,le.workspaceTabTargetsEqual)(e.target,o.target)?n.set(o.tabId,e):n.set(o.tabId,o)}return n},[e]);return(0,b.useEffect)(()=>{t.current=n},[n]),n}const on=(0,b.memo)(function(e){const t=(0,p.c)(4),{serverId:n,workspaceId:o,isRouteFocused:a}=e,s=(0,g.useIsFocused)(),r=a??s;let i;return t[0]!==n||t[1]!==r||t[2]!==o?(i=(0,tt.jsx)(Cn,{serverId:n,workspaceId:o,isRouteFocused:r}),t[0]=n,t[1]=r,t[2]=o,t[3]=i):i=t[3],i});function an(){const e=(0,b.useRef)(new Set),[t,n]=(0,b.useState)(st);return{closingTabIds:t,closeTab:(0,b.useCallback)(async(t,o)=>{const a=t.trim();if(a&&!e.current.has(a)){e.current.add(a),n(new Set(e.current));try{await o()}finally{e.current.delete(a),n(new Set(e.current))}}},[])}}function sn(e){const t=(0,p.c)(15),{profile:n,disabled:o,onCreateTerminalWithProfile:a}=e;let s;t[0]!==a||t[1]!==n.args||t[2]!==n.command||t[3]!==n.name?(s=()=>{a({name:n.name,command:n.command,args:n.args})},t[0]=a,t[1]=n.args,t[2]=n.command,t[3]=n.name,t[4]=s):s=t[4];const r=s;let i;t[5]!==n?(i=(0,Xe.getTerminalProfileIcon)(n),t[5]=n,t[6]=i):i=t[6];const l=i;let d;e:{if(!l){let e;t[7]===Symbol.for("react.memo_cache_sentinel")?(e=(0,tt.jsx)(c.View,{style:vn.headerMenuProfileIconWrapper,children:(0,tt.jsx)(It,{size:16,uniProps:Pt})}),t[7]=e):e=t[7],d=e;break e}let e;t[8]!==l?(e=(0,tt.jsx)(c.View,{style:vn.headerMenuProfileIconWrapper,children:(0,tt.jsx)(xt,{iconKey:l,size:16,uniProps:Pt})}),t[8]=l,t[9]=e):e=t[9],d=e}const u=d;let b;return t[10]!==o||t[11]!==r||t[12]!==u||t[13]!==n.name?(b=(0,tt.jsx)(F.DropdownMenuItem,{leading:u,disabled:o,onSelect:r,children:n.name}),t[10]=o,t[11]=r,t[12]=u,t[13]=n.name,t[14]=b):b=t[14],b}function rn(e){const t=(0,p.c)(3),{hovered:n,open:o,isMobile:a}=e,s=a?dt:lt,r=n||o?Wt:Pt;let i;return t[0]!==s||t[1]!==r?(i=(0,tt.jsx)(s,{size:16,uniProps:r}),t[0]=s,t[1]=r,t[2]=i):i=t[2],i}function cn(e){const t=(0,p.c)(87),{normalizedServerId:n,currentBranchName:o,showWorkspaceSetup:a,showCreateBrowserTab:s,isMobile:r,createTerminalDisabled:i,importAgentDisabled:c,copyPathDisabled:l,menuNewAgentIcon:d,menuNewTerminalIcon:u,menuNewBrowserIcon:b,menuImportIcon:m,menuCopyIcon:g,menuSettingsIcon:k,onCreateDraftTab:h,onCreateTerminal:w,onCreateTerminalWithProfile:I,onCreateBrowser:S,onOpenImportSheet:y,onCopyWorkspacePath:C,onCopyBranchName:v,onOpenSetupTab:x}=e,{t:W}=(0,T.useTranslation)(),P=(0,f.useRouter)(),{config:j}=(0,Qe.useDaemonConfig)(n),M=j?.terminalProfiles;let B;t[0]!==M?(B=(0,Xe.resolveTerminalProfiles)(M),t[0]=M,t[1]=B):B=t[1];const A=B;let R;t[2]!==n||t[3]!==P?(R=()=>{P.push((0,qe.buildSettingsHostSectionRoute)(n,"terminals"))},t[2]=n,t[3]=P,t[4]=R):R=t[4];const _=R;let D;t[5]!==r?(D=e=>{const{hovered:t,open:n}=e;return(0,tt.jsx)(rn,{hovered:t,open:n,isMobile:r})},t[5]=r,t[6]=D):D=t[6];const z=D,L=r?vn.compactHeaderActionButton:vn.headerActionButton;let H,E,O,V,N,U,K,$,q,G,Q,X,J,Y,Z,ee,te,ne,oe,ae,se,re;if(t[7]!==W?(H=W("workspace.header.actions.workspaceActions"),t[7]=W,t[8]=H):H=t[8],t[9]!==z||t[10]!==L||t[11]!==H?(E=(0,tt.jsx)(F.DropdownMenuTrigger,{testID:"workspace-header-menu-trigger",style:L,accessibilityRole:"button",accessibilityLabel:H,children:z}),t[9]=z,t[10]=L,t[11]=H,t[12]=E):E=t[12],t[13]!==W?(O=W("workspace.header.actions.newAgent"),t[13]=W,t[14]=O):O=t[14],t[15]!==d||t[16]!==h||t[17]!==O?(V=(0,tt.jsx)(F.DropdownMenuItem,{testID:"workspace-header-new-agent",leading:d,onSelect:h,children:O}),t[15]=d,t[16]=h,t[17]=O,t[18]=V):V=t[18],t[19]!==b||t[20]!==S||t[21]!==s||t[22]!==W?(N=s?(0,tt.jsx)(F.DropdownMenuItem,{testID:"workspace-header-new-browser",leading:b,onSelect:S,children:W("workspace.header.actions.newBrowser")}):null,t[19]=b,t[20]=S,t[21]=s,t[22]=W,t[23]=N):N=t[23],t[24]!==W?(U=W("workspace.header.actions.importSession"),t[24]=W,t[25]=U):U=t[25],t[26]!==c||t[27]!==m||t[28]!==y||t[29]!==U?(K=(0,tt.jsx)(F.DropdownMenuItem,{testID:"workspace-header-import-agent",leading:m,disabled:c,onSelect:y,children:U}),t[26]=c,t[27]=m,t[28]=y,t[29]=U,t[30]=K):K=t[30],t[31]!==W?($=W("workspace.header.actions.copyPath"),t[31]=W,t[32]=$):$=t[32],t[33]!==l||t[34]!==g||t[35]!==C||t[36]!==$?(q=(0,tt.jsx)(F.DropdownMenuItem,{testID:"workspace-header-copy-path",leading:g,disabled:l,onSelect:C,children:$}),t[33]=l,t[34]=g,t[35]=C,t[36]=$,t[37]=q):q=t[37],t[38]!==o||t[39]!==g||t[40]!==v||t[41]!==W?(G=o?(0,tt.jsx)(F.DropdownMenuItem,{testID:"workspace-header-copy-branch-name",leading:g,onSelect:v,children:W("workspace.header.actions.copyBranchName")}):null,t[38]=o,t[39]=g,t[40]=v,t[41]=W,t[42]=G):G=t[42],t[43]!==k||t[44]!==x||t[45]!==a||t[46]!==W?(Q=a?(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(F.DropdownMenuSeparator,{}),(0,tt.jsx)(F.DropdownMenuItem,{testID:"workspace-header-show-setup",leading:k,onSelect:x,children:W("workspace.header.actions.showSetup")})]}):null,t[43]=k,t[44]=x,t[45]=a,t[46]=W,t[47]=Q):Q=t[47],t[48]===Symbol.for("react.memo_cache_sentinel")?(X=(0,tt.jsx)(F.DropdownMenuSeparator,{}),t[48]=X):X=t[48],t[49]!==W?(J=W("workspace.tabs.actions.terminalProfilesMenu"),t[49]=W,t[50]=J):J=t[50],t[51]!==J?(Y=(0,tt.jsx)(F.DropdownMenuLabel,{children:J}),t[51]=J,t[52]=Y):Y=t[52],t[53]!==W?(Z=W("workspace.header.actions.newTerminal"),t[53]=W,t[54]=Z):Z=t[54],t[55]!==i||t[56]!==u||t[57]!==w||t[58]!==Z?(ee=(0,tt.jsx)(F.DropdownMenuItem,{testID:"workspace-header-new-terminal",leading:u,disabled:i,onSelect:w,children:Z}),t[55]=i,t[56]=u,t[57]=w,t[58]=Z,t[59]=ee):ee=t[59],t[60]!==i||t[61]!==I||t[62]!==A){let e;t[64]!==i||t[65]!==I?(e=e=>(0,tt.jsx)(sn,{profile:e,disabled:i,onCreateTerminalWithProfile:I},e.id),t[64]=i,t[65]=I,t[66]=e):e=t[66],te=A.map(e),t[60]=i,t[61]=I,t[62]=A,t[63]=te}else te=t[63];return t[67]===Symbol.for("react.memo_cache_sentinel")?(ne=(0,tt.jsx)(F.DropdownMenuSeparator,{}),t[67]=ne):ne=t[67],t[68]!==W?(oe=W("workspace.tabs.actions.editTerminalProfiles"),t[68]=W,t[69]=oe):oe=t[69],t[70]!==_||t[71]!==oe?(ae=(0,tt.jsx)(F.DropdownMenuItem,{testID:"workspace-header-edit-terminal-profiles",onSelect:_,children:oe}),t[70]=_,t[71]=oe,t[72]=ae):ae=t[72],t[73]!==N||t[74]!==K||t[75]!==q||t[76]!==G||t[77]!==Q||t[78]!==Y||t[79]!==ee||t[80]!==te||t[81]!==ae||t[82]!==V?(se=(0,tt.jsxs)(F.DropdownMenuContent,{align:"start",width:220,testID:"workspace-header-menu",children:[V,N,K,q,G,Q,X,Y,ee,te,ne,ae]}),t[73]=N,t[74]=K,t[75]=q,t[76]=G,t[77]=Q,t[78]=Y,t[79]=ee,t[80]=te,t[81]=ae,t[82]=V,t[83]=se):se=t[83],t[84]!==se||t[85]!==E?(re=(0,tt.jsxs)(F.DropdownMenu,{children:[E,se]}),t[84]=se,t[85]=E,t[86]=re):re=t[86],re}function ln(e){const t=(0,p.c)(43),{isLoading:n,title:o,subtitle:a,showSubtitle:s,currentBranchName:r,normalizedServerId:i,normalizedWorkspaceId:d,workspaceScripts:u,liveTerminalIds:b,showWorkspaceSetup:m,showCreateBrowserTab:g,isMobile:k,createTerminalDisabled:h,importAgentDisabled:w,copyPathDisabled:f,menuNewAgentIcon:I,menuNewTerminalIcon:T,menuNewBrowserIcon:S,menuImportIcon:y,menuCopyIcon:C,menuSettingsIcon:v,onCreateDraftTab:x,onCreateTerminal:W,onCreateTerminalWithProfile:P,onCreateBrowser:j,onOpenImportSheet:M,onCopyWorkspacePath:B,onCopyBranchName:R,onOpenSetupTab:_,onScriptTerminalStarted:D,onViewScriptTerminal:F,onOpenUrlInBrowserTab:z}=e;let L,H,E,O,V;return t[0]!==n||t[1]!==s||t[2]!==a||t[3]!==o?(L=n?(0,tt.jsx)(c.View,{style:vn.headerTitleTextGroup,children:(0,tt.jsx)(c.View,{style:vn.headerTitleSkeleton})}):(0,tt.jsxs)(c.View,{style:vn.headerTitleTextGroup,children:[(0,tt.jsx)(A.ScreenTitle,{testID:"workspace-header-title",children:o}),s?(0,tt.jsx)(l.Text,{testID:"workspace-header-subtitle",style:vn.headerProjectTitle,numberOfLines:1,children:a}):null]}),t[0]=n,t[1]=s,t[2]=a,t[3]=o,t[4]=L):L=t[4],t[5]!==f||t[6]!==h||t[7]!==r||t[8]!==w||t[9]!==k||t[10]!==C||t[11]!==y||t[12]!==I||t[13]!==S||t[14]!==T||t[15]!==v||t[16]!==i||t[17]!==R||t[18]!==B||t[19]!==j||t[20]!==x||t[21]!==W||t[22]!==P||t[23]!==M||t[24]!==_||t[25]!==g||t[26]!==m?(H=(0,tt.jsx)(cn,{normalizedServerId:i,currentBranchName:r,showWorkspaceSetup:m,showCreateBrowserTab:g,isMobile:k,createTerminalDisabled:h,importAgentDisabled:w,copyPathDisabled:f,menuNewAgentIcon:I,menuNewTerminalIcon:T,menuNewBrowserIcon:S,menuImportIcon:y,menuCopyIcon:C,menuSettingsIcon:v,onCreateDraftTab:x,onCreateTerminal:W,onCreateTerminalWithProfile:P,onCreateBrowser:j,onOpenImportSheet:M,onCopyWorkspacePath:B,onCopyBranchName:R,onOpenSetupTab:_}),t[5]=f,t[6]=h,t[7]=r,t[8]=w,t[9]=k,t[10]=C,t[11]=y,t[12]=I,t[13]=S,t[14]=T,t[15]=v,t[16]=i,t[17]=R,t[18]=B,t[19]=j,t[20]=x,t[21]=W,t[22]=P,t[23]=M,t[24]=_,t[25]=g,t[26]=m,t[27]=H):H=t[27],t[28]!==k||t[29]!==b||t[30]!==i||t[31]!==d||t[32]!==z||t[33]!==D||t[34]!==F||t[35]!==u?(E=k&&u.length>0?(0,tt.jsx)(U.WorkspaceScriptsButton,{serverId:i,workspaceId:d,scripts:u,liveTerminalIds:b,onScriptTerminalStarted:D,onViewTerminal:F,onOpenUrlInBrowserTab:z,hideLabels:!0,presentation:"ghost"}):null,t[28]=k,t[29]=b,t[30]=i,t[31]=d,t[32]=z,t[33]=D,t[34]=F,t[35]=u,t[36]=E):E=t[36],t[37]!==H||t[38]!==E?(O=(0,tt.jsxs)(c.View,{style:vn.compactHeaderMenuCluster,children:[H,E]}),t[37]=H,t[38]=E,t[39]=O):O=t[39],t[40]!==L||t[41]!==O?(V=(0,tt.jsxs)(c.View,{style:vn.headerTitleContainer,children:[L,O]}),t[40]=L,t[41]=O,t[42]=V):V=t[42],V}function dn(e){const t=e.split(".").pop();return"left"===t||"right"===t||"up"===t||"down"===t?t:null}function un(e){const{isMissingWorkspaceDirectory:t,activeTabDescriptor:n,hasHydratedAgents:o,mountedFocusedPaneTabIds:a,focusedPaneTabDescriptorMap:s,isRouteFocused:r,focusedPaneId:i,buildMobilePaneContentModel:d}=e;return t?(0,tt.jsx)(c.View,{style:vn.emptyState,children:(0,tt.jsx)(l.Text,{style:vn.emptyStateText,children:"Workspace directory is missing. Reload workspace data before opening tabs."})}):n||o?n?a.map(e=>{const t=s.get(e);return t?(0,tt.jsx)(tn,{tabDescriptor:t,isVisible:r&&e===n.tabId,isWorkspaceFocused:r,isPaneFocused:e===n.tabId,paneId:i,buildPaneContentModel:d},e):null}):(0,tt.jsx)(c.View,{style:vn.emptyState,children:(0,tt.jsx)(l.Text,{style:vn.emptyStateText,children:"No tabs are available yet. Use New tab to create an agent or terminal."})}):(0,tt.jsx)(c.View,{style:vn.emptyState,children:(0,tt.jsx)(ct,{uniProps:Pt})})}function pn(e){const t=(0,Ae.resolveWorkspaceHeaderRenderState)(e);return"ready"!==t.kind?{isWorkspaceHeaderLoading:!0,workspaceHeaderTitle:"",workspaceHeaderSubtitle:"",shouldShowWorkspaceHeaderSubtitle:!1,isGitCheckout:!1,currentBranchName:null}:{isWorkspaceHeaderLoading:!1,workspaceHeaderTitle:t.title,workspaceHeaderSubtitle:t.subtitle,shouldShowWorkspaceHeaderSubtitle:t.shouldShowSubtitle,isGitCheckout:t.isGitCheckout,currentBranchName:t.currentBranchName}}function bn(e,t){const n=e?.label?.trim();return n||t}function mn(e){const t=(0,p.c)(12),n=(0,f.useRouter)();let o;t[0]!==e?(o=()=>{e&&(0,de.getHostRuntimeStore)().runProbeCycleNow(e)},t[0]=e,t[1]=o):o=t[1];const a=o;let s;t[2]!==e||t[3]!==n?(s=()=>{e&&n.push((0,qe.buildSettingsHostRoute)(e))},t[2]=e,t[3]=n,t[4]=s):s=t[4];const r=s;let i;t[5]!==e||t[6]!==n?(i=()=>{n.canGoBack()?n.back():e?n.replace((0,qe.buildHostRootRoute)(e)):n.replace("/")},t[5]=e,t[6]=n,t[7]=i):i=t[7];const c=i;let l;return t[8]!==c||t[9]!==r||t[10]!==a?(l={handleRetryHost:a,handleManageHost:r,handleDismissMissingWorkspace:c},t[8]=c,t[9]=r,t[10]=a,t[11]=l):l=t[11],l}function gn(e){const t=(0,p.c)(15),n=(0,de.useHosts)();let o;t[0]!==n||t[1]!==e.serverId?(o=n.find(t=>t.serverId===e.serverId)??null,t[0]=n,t[1]=e.serverId,t[2]=o):o=t[2];const a=o,s=(0,de.useHostRuntimeSnapshot)(e.serverId);let r;t[3]!==a||t[4]!==e.serverId?(r=bn(a,e.serverId),t[3]=a,t[4]=e.serverId,t[5]=r):r=t[5];const i=r,c=(0,G.useWorkspaceRestoreStatus)(e.serverId,e.workspaceId);let l,d;return t[6]!==i||t[7]!==s?.connectionStatus||t[8]!==s?.lastError||t[9]!==e.hasHydratedWorkspaces||t[10]!==e.workspace||t[11]!==c?(l=()=>(0,Re.resolveWorkspaceRouteState)({hostName:i,connectionStatus:s?.connectionStatus??"connecting",lastError:s?.lastError??null,workspace:e.workspace,hasHydratedWorkspaces:e.hasHydratedWorkspaces,restoreStatus:c}),t[6]=i,t[7]=s?.connectionStatus,t[8]=s?.lastError,t[9]=e.hasHydratedWorkspaces,t[10]=e.workspace,t[11]=c,t[12]=l):l=t[12],t[13]!==l?(d=l(),t[13]=l,t[14]=d):d=t[14],d}function kn(e){const t=(0,p.c)(3),{children:n}=e;let o,a;return t[0]===Symbol.for("react.memo_cache_sentinel")?(o=(0,tt.jsx)(B.ScreenHeader,{left:Ft}),t[0]=o):o=t[0],t[1]!==n?(a=(0,tt.jsxs)(tt.Fragment,{children:[o,(0,tt.jsx)(c.View,{style:vn.centerContent,children:n})]}),t[1]=n,t[2]=a):a=t[2],a}function hn(e){return e.gate?(0,tt.jsx)(He.WorkspaceFocusProvider,{workspaceKey:e.workspaceKey,children:(0,tt.jsx)(c.View,{style:vn.container,children:(0,tt.jsx)(c.View,{style:vn.threePaneRow,children:(0,tt.jsx)(c.View,{style:vn.centerColumn,children:(0,tt.jsx)(kn,{children:e.gate})})})})}):null}function wn(e){const t=(0,p.c)(4),{tab:n,serverId:o,workspaceId:a,isRouteFocused:s}=e;if(!s||!Ke.isWeb||!n)return null;let r;return t[0]!==o||t[1]!==n||t[2]!==a?(r=(0,tt.jsx)(Ce.WorkspaceTabPresentationResolver,{tab:n,serverId:o,workspaceId:a,children:fn}),t[0]=o,t[1]=n,t[2]=a,t[3]=r):r=t[3],r}function fn(e){return(0,tt.jsx)(Nt,{label:e.label,titleState:e.titleState})}function In(e){return!e.isFocusModeEnabled||e.isMobile}function Tn(e){return!e.isMobile&&e.isRouteFocused&&In(e)}function Sn(e,t){return e&&t?`${e}:${t}`:null}function yn(e){const t=(0,p.c)(21),{persistenceKey:n,focusWorkspacePane:o,openWorkspaceTabFocused:a,labels:s,toast:r}=e;let i;t[0]!==o||t[1]!==a||t[2]!==n?(i=e=>{const{terminalId:t,paneId:s}=e;n&&(s&&o(n,s),a(n,{kind:"terminal",terminalId:t}))},t[0]=o,t[1]=a,t[2]=n,t[3]=i):i=t[3];const c=i;let l;t[4]!==a||t[5]!==n?(l=e=>{n&&a(n,{kind:"terminal",terminalId:e})},t[4]=a,t[5]=n,t[6]=l):l=t[6];const d=l;let u;t[7]!==s.workspacePathUnavailable||t[8]!==r?(u=()=>{r.error(s.workspacePathUnavailable)},t[7]=s.workspacePathUnavailable,t[8]=r,t[9]=u):u=t[9];const b=u;let m;t[10]!==s.terminalQueued||t[11]!==r?(m=()=>{r.show(s.terminalQueued)},t[10]=s.terminalQueued,t[11]=r,t[12]=m):m=t[12];const g=m;let k;t[13]!==r?(k=e=>{r.error(e)},t[13]=r,t[14]=k):k=t[14];const h=k;let w;return t[15]!==d||t[16]!==h||t[17]!==g||t[18]!==c||t[19]!==b?(w={handleTerminalCreated:c,handleScriptTerminalSelected:d,handleWorkspacePathUnavailable:b,handleTerminalCreateQueued:g,handleTerminalCreateFailed:h},t[15]=d,t[16]=h,t[17]=g,t[18]=c,t[19]=b,t[20]=w):w=t[20],w}function Cn({serverId:e,workspaceId:t,isRouteFocused:n}){const{t:o}=(0,T.useTranslation)(),a=((0,C.useSafeAreaInsets)(),(0,$.useToast)()),s=(0,Ue.useIsCompactFormFactor)(),r=(0,q.usePanelStore)(e=>e.desktop.focusModeEnabled),i=(0,b.useMemo)(()=>zt(Lt(e))??"",[e]),{allowMove:u}=(0,se.useKanbanMoveGuard)(i),p=(0,b.useMemo)(()=>(0,ye.resolveWorkspaceRouteId)({routeWorkspaceId:t})??"",[t]),g=(0,be.useWorkspace)(i,p),h=rt(g),{handleRetryHost:f,handleManageHost:y,handleDismissMissingWorkspace:v}=mn(i),A=(0,b.useMemo)(()=>Sn(i,p),[i,p]);(0,me.useWorkspaceTerminalSessionRetention)({scopeKey:A});const R=(0,de.useHostRuntimeClient)(i),F=(0,de.useHostRuntimeIsConnected)(i),O=(0,de.useHosts)(),Ce=g?.workspaceDirectory||null,Me=Boolean(g)&&!Ce,[Ae,Re]=(0,b.useState)(!1),qe=[R,F,Ce].every(Boolean),Qe=(0,b.useCallback)(()=>{Re(!0)},[]),Xe=(0,b.useCallback)(()=>{Re(!1)},[]);(0,ue.useProvidersSnapshot)(i,{cwd:Ce,enabled:n});const Je=(0,b.useMemo)(()=>(0,re.buildWorkspaceTabPersistenceKey)({serverId:i,workspaceId:p}),[i,p]),ot=(0,re.useWorkspaceLayoutStore)(e=>e.openTabFocused),ct=(0,re.useWorkspaceLayoutStore)(e=>e.openChildTabFocused),lt=(0,re.useWorkspaceLayoutStore)(e=>e.focusPane),dt=(0,G.useSessionStore)(e=>e.sessions[i]?.hasHydratedWorkspaces??!1),ut=(0,m.useStoreWithEqualityFn)(G.useSessionStore,e=>(0,De.deriveWorkspaceAgentVisibility)({sessionAgents:e.sessions[i]?.agents,agentDetails:e.sessions[i]?.agentDetails,workspaceId:p}),De.workspaceAgentVisibilityEqual),{handleTerminalCreated:pt,handleScriptTerminalSelected:bt,handleWorkspacePathUnavailable:mt,handleTerminalCreateQueued:gt,handleTerminalCreateFailed:kt}=yn({persistenceKey:Je,focusWorkspacePane:lt,openWorkspaceTabFocused:ot,labels:{workspacePathUnavailable:o("workspace.header.toasts.workspacePathUnavailable"),terminalQueued:o("workspace.header.toasts.terminalQueued")},toast:a}),ht=(0,w.useQueryClient)(),{createMutation:wt,createTerminal:ft,handleScriptTerminalStarted:It,handleViewScriptTerminal:Tt,invalidateTerminals:St,killMutation:yt,knownTerminalIds:xt,liveTerminalIds:Ft,pendingCreateInput:Ot,query:Vt,queryKey:Nt,removeTerminalFromCache:Kt,standaloneTerminalIds:$t,terminals:qt}=(0,Ge.useWorkspaceTerminals)({client:R,isConnected:F,isRouteFocused:n,normalizedServerId:i,normalizedWorkspaceId:p,workspaceDirectory:Ce,workspaceScripts:h,hasHydratedWorkspaces:dt,isMissingWorkspaceDirectory:Me,onTerminalCreated:pt,onScriptTerminalSelected:bt,onWorkspacePathUnavailable:mt,onTerminalCreateQueued:gt,onTerminalCreateFailed:kt}),{archiveAgent:Gt}=(0,ke.useArchiveAgent)(),{checkoutQuery:Xt,isCheckoutStatusLoading:Jt}=(0,et.useWorkspaceCheckoutStatus)({client:R,isConnected:F,isRouteFocused:n,normalizedServerId:i,normalizedWorkspaceId:p,workspaceDirectory:Ce}),Yt=(0,G.useSessionStore)(e=>e.sessions[i]?.hasHydratedAgents??!1),Zt=gn({serverId:i,workspaceId:p,workspace:g,hasHydratedWorkspaces:dt}),tn=(on={isCheckoutStatusLoading:Jt,isError:Xt.isError,data:Xt.data}).isCheckoutStatusLoading?{kind:"pending"}:on.isError||!on.data?{kind:"error"}:{kind:"ready",checkout:{isGit:on.data.isGit,currentBranch:on.data.currentBranch}};var on;const{isWorkspaceHeaderLoading:sn,workspaceHeaderTitle:rn,workspaceHeaderSubtitle:cn,shouldShowWorkspaceHeaderSubtitle:bn,isGitCheckout:kn,currentBranchName:fn}=pn({workspace:g,checkoutState:tn}),Cn=(0,q.usePanelStore)(e=>(0,q.selectIsFileExplorerOpen)(e,{isCompact:s})),Pn=(0,q.usePanelStore)(e=>e.toggleFileExplorerForCheckout),jn=(0,q.usePanelStore)(e=>e.showMobileAgent),Mn=(0,b.useMemo)(()=>i&&Ce?{serverId:i,cwd:Ce,isGit:kn}:null,[kn,i,Ce]),Bn=(0,b.useCallback)(()=>{Mn&&Pn({isCompact:s,checkout:Mn})},[Mn,s,Pn]),An=(0,b.useMemo)(()=>Boolean(g?.diffStat),[g]),Rn=(0,b.useCallback)(({hovered:e,pressed:t})=>[vn.sourceControlButton,An&&vn.sourceControlButtonWithStats,(Boolean(e)||Boolean(t)||Cn)&&vn.sourceControlButtonHovered],[An,Cn]),_n=(0,b.useMemo)(()=>({expanded:Cn}),[Cn]);(0,b.useEffect)(()=>{if(!n||Ke.isWeb||!Cn)return;const e=k.default.addEventListener("hardwareBackPress",()=>!!Cn&&(jn(),!0));return()=>e.remove()},[Cn,n,jn]);const Dn=(0,re.useWorkspaceLayoutStore)(e=>Je?e.layoutByWorkspace[Je]??null:null),Fn=(0,re.useWorkspaceLayoutStoreHydrated)(),zn=(0,pe.useWorkspaceSetupStore)(e=>Je?e.snapshots[Je]??null:null),Ln=(0,pe.useWorkspaceSetupStore)(e=>e.ensureSetupStatus),Hn=(0,pe.shouldShowWorkspaceSetup)(zn),En=(0,b.useMemo)(()=>Dn?(0,re.collectAllTabs)(Dn.root):nt,[Dn]);Ht({workspaceLayout:Dn,isRouteFocused:n,workspaceId:p});const On=(0,re.useWorkspaceLayoutStore)(e=>e.openTabInBackground),Vn=(0,re.useWorkspaceLayoutStore)(e=>e.focusTab),Nn=(0,re.useWorkspaceLayoutStore)(e=>e.closeTab),Un=(0,re.useWorkspaceLayoutStore)(e=>e.unpinAgent),Kn=(0,re.useWorkspaceLayoutStore)(e=>e.hideAgent),$n=(0,re.useWorkspaceLayoutStore)(e=>e.retargetTab),qn=(0,re.useWorkspaceLayoutStore)(e=>e.reconcileTabs),Gn=(0,re.useWorkspaceLayoutStore)(e=>e.splitPane),Qn=(0,re.useWorkspaceLayoutStore)(e=>e.splitPaneEmpty),Xn=(0,re.useWorkspaceLayoutStore)(e=>e.moveTabToPane),Jn=(0,b.useRef)(!1),Yn=(0,re.useWorkspaceLayoutStore)(e=>e.resizeSplit),Zn=(0,re.useWorkspaceLayoutStore)(e=>e.reorderTabsInPane),eo=((0,re.useWorkspaceLayoutStore)(e=>Je?e.pinnedAgentIdsByWorkspace[Je]??at:at),(0,re.useWorkspaceLayoutStore)(e=>Je?e.hiddenAgentIdsByWorkspace[Je]??st:st),(0,ce.useCreateFlowStore)(e=>e.pendingByDraftId)),{closingTabIds:to,closeTab:no}=an(),{onLayout:oo,isBelow:ao}=(0,$e.useContainerWidthBelow)(700),so=(0,b.useCallback)(function(e){const t=zt(e.tabId);if(t&&Je){if("agent"===e.target?.kind&&(Un(Je,e.target.agentId),Kn(Je,e.target.agentId)),"browser"===e.target?.kind){const{browserId:t}=e.target;fe.useBrowserStore.getState().removeBrowser(t),(0,we.removeResidentBrowserWebview)(t),(0,Ie.getDesktopHost)()?.browser?.clearPartition?.(t)}Nn(Je,t)}},[Nn,Kn,Je,Un]),ro=(0,b.useMemo)(()=>(0,Fe.deriveWorkspacePaneState)({layout:Dn,tabs:En}),[En,Dn]),io=(0,G.useSessionStore)(e=>e.setFocusedAgentId),co=(0,G.useSessionStore)(e=>e.setFocusedTerminalId),lo=(0,b.useMemo)(()=>{const e=ro.activeTab?.descriptor.target;return"agent"!==e?.kind?null:e.agentId},[ro.activeTab]),uo=(0,b.useMemo)(()=>{const e=ro.activeTab?.descriptor.target;return"terminal"!==e?.kind?null:e.terminalId},[ro.activeTab]);(0,b.useEffect)(()=>{n&&(io(i,lo),co(i,uo))},[lo,uo,n,i,io,co]),(0,b.useEffect)(()=>{if(n)return()=>{io(i,null),co(i,null)}},[n,i,io,co]);const po=(0,b.useCallback)(function(e){if(!Je)return null;const t=(0,le.normalizeWorkspaceTabTarget)({kind:"draft",draftId:zt(e?.draftId)??(0,Se.generateDraftId)()});return(0,x.default)("draft"===t?.kind,"Draft tab target must be valid"),!1===e?.focus?On(Je,t):ot(Je,t)},[ot,On,Je]);(0,b.useEffect)(()=>{if(!n)return;if(!i||!p||!Je)return;if(!Fn)return;const e=En.some(e=>{if("draft"!==e.target.kind)return!1;const t=eo[e.target.draftId];return t?.serverId===i&&"active"===t.lifecycle});qn(Je,(0,De.buildWorkspaceTabSnapshot)({agentVisibility:ut,agentsHydrated:Yt,terminalsHydrated:Vt.isSuccess,knownTerminalIds:xt,standaloneTerminalIds:$t,hasActivePendingDraftCreate:e}))},[Yt,Fn,n,i,p,eo,Je,qn,xt,$t,Vt.isSuccess,En,ut]);const bo=ro.activeTabId,mo=ro.activeTab,go=(0,Q.useSessionFilterStore)(e=>e.sortTabsByCreationDate),ko=(0,b.useMemo)(()=>{const e=ro.tabs.map(e=>e.descriptor);return go?(0,je.sortDescriptorsByCreationDate)(e):e},[ro.tabs,go]),ho=(0,b.useMemo)(()=>En.some(e=>"setup"===e.target.kind&&e.target.workspaceId===p),[p,En]),wo=(0,b.useCallback)(function(e){e&&Je&&Vn(Je,e)},[Vn,Je]),fo=(0,b.useCallback)(e=>{if(!Je)return;const t=ot(Je,{kind:"agent",agentId:e});t&&wo(t)},[wo,ot,Je]),Io=(0,b.useRef)(null),To=(0,b.useRef)(null);(0,b.useEffect)(()=>{n&&R&&i&&p&&Ln({serverId:i,workspaceId:p,client:R})},[R,Ln,n,i,p]),(0,b.useEffect)(()=>{if(!(0,Ee.shouldSeedEmptyWorkspaceDraft)({isRouteFocused:n,hasPersistenceKey:Boolean(Je),hasWorkspaceDirectory:Boolean(Ce),hasHydratedWorkspaceLayoutStore:Fn,hasHydratedAgents:Yt,hasLoadedTerminals:Vt.isSuccess,activeAgentCount:ut.activeAgentIds.size,terminalCount:qt.length,tabCount:ko.length}))return void(Io.current=null);const e=`${i}:${p}`;Io.current!==e&&(Io.current=e,po())},[i,p,po,Je,Yt,Fn,n,qt.length,Vt.isSuccess,ko.length,Ce,ut.activeAgentIds.size]),(0,b.useEffect)(()=>{if(!n)return;if(!Je)return;if(!zn||!Hn)return void(To.current===Je&&(To.current=null));const e=Date.now()-zn.updatedAt;if(!("running"===zn.status||e<=3e4))return;if(ho)return void(To.current=Je);if(To.current===Je)return;const t=(0,le.normalizeWorkspaceTabTarget)({kind:"setup",workspaceId:p});if(!t)return;On(Je,t)&&(To.current=Je)},[ho,n,p,On,Je,Hn,zn]);const So=(0,b.useCallback)(function(e){if(!Je)return;const t=(0,Ye.normalizeWorkspaceFileLocation)({path:e});if(!t)return;const n=ot(Je,(0,Ye.createWorkspaceFileTabTarget)(t));n&&wo(n)},[wo,ot,Je]),yo=(0,b.useCallback)((e,t)=>{const n=(0,Ye.normalizeWorkspaceFileLocation)(e);if(!n)return;if(s&&jn(),!Je)return;const o=(0,Ye.createWorkspaceFileTabTarget)(n),a=t?.parentTabId?ct(Je,o,t.parentTabId):ot(Je,o);a&&wo(a)},[s,wo,ct,ot,Je,jn]),Co=(0,b.useCallback)(e=>{const t=(0,Ye.normalizeWorkspaceFileLocation)(e.location);if(!t)return;if(!Je||s||!e.sourcePaneId)return void yo(t,{parentTabId:e.parentTabId});const n=(0,Ye.createWorkspaceFileTabTarget)(t),o=(0,Fe.resolveSideFileOpenPlacement)({layout:Dn,sourcePaneId:e.sourcePaneId,tabs:En,target:n});"focus-side-pane"===o.kind?lt(Je,o.paneId):"split-side-pane"===o.kind&&Qn(Je,{targetPaneId:o.paneId,position:"right"});const a=e.parentTabId?ct(Je,n,e.parentTabId):ot(Je,n);a&&wo(a)},[yo,s,lt,wo,ct,ot,Je,Qn,En,Dn]),vo=(0,he.useStableEvent)(function({request:e,paneId:t,parentTabId:n,focusPaneBeforeOpen:o}){o&&t&&Je&<(Je,t),"side"!==e.disposition?yo(e.location,{parentTabId:n}):Co({location:e.location,sourcePaneId:t??void 0,parentTabId:n})}),[xo,Wo]=(0,b.useState)(null),{handleRenameTab:Po,renamingTab:jo,handleRenameModalSubmit:Mo,handleRenameModalClose:Bo}=(0,ve.useWorkspaceTabRename)({client:R,normalizedServerId:i,queryClient:ht,terminalsData:Vt.data,terminalsQueryKey:Nt}),{taggingAgent:Ao,handleRequestTagAgent:Ro,handleTagModalSubmit:_o,handleTagModalClose:Do}=(0,xe.useWorkspaceTagEditor)({client:R,normalizedServerId:i,queryClient:ht}),Fo=(0,b.useMemo)(()=>{const e=new Map;for(const t of ko)e.set(t.key,t);return e},[ko]),zo=(0,b.useMemo)(()=>{const e=new Map;for(const t of En)e.set(t.tabId,{key:t.tabId,tabId:t.tabId,kind:t.target.kind,target:t.target,createdAt:t.createdAt});return e},[En]),Lo=(0,b.useMemo)(()=>({all:({agents:e,terminals:t,tabs:n})=>o("workspace.tabs.confirmations.bulk.all",{agents:e,terminals:t,tabs:n}),agentsAndTerminals:({agents:e,terminals:t})=>o("workspace.tabs.confirmations.bulk.agentsAndTerminals",{agents:e,terminals:t}),terminalsAndTabs:({terminals:e,tabs:t})=>o("workspace.tabs.confirmations.bulk.terminalsAndTabs",{terminals:e,tabs:t}),agentsAndTabs:({agents:e,tabs:t})=>o("workspace.tabs.confirmations.bulk.agentsAndTabs",{agents:e,tabs:t}),terminals:({terminals:e})=>o("workspace.tabs.confirmations.bulk.terminals",{terminals:e}),tabs:({tabs:e})=>o("workspace.tabs.confirmations.bulk.tabs",{tabs:e}),agents:({agents:e})=>o("workspace.tabs.confirmations.bulk.agents",{agents:e})}),[o]),Ho=o(Cn?"workspace.tabs.explorer.close":"workspace.tabs.explorer.open"),Eo=(0,b.useMemo)(()=>bo??"",[bo]),Oo=(0,b.useMemo)(()=>({newAgent:o("workspace.tabs.fallback.newAgent"),setup:o("workspace.tabs.fallback.setup"),workspaceSetup:o("workspace.tabs.fallback.workspaceSetup"),terminal:o("workspace.tabs.fallback.terminal"),browser:o("workspace.tabs.fallback.browser"),agent:o("workspace.tabs.fallback.agent")}),[o]),Vo=(0,b.useMemo)(()=>ko.map(e=>{return{id:e.key,label:Et(e,Oo),description:(t=e,n=Oo,"draft"===t.target.kind?n.newAgent:"setup"===t.target.kind?n.workspaceSetup:"agent"===t.target.kind?n.agent:"terminal"===t.target.kind?n.terminal:"browser"===t.target.kind?n.browser:"pluginView"===t.target.kind?"Extension":t.target.path)};var t,n}),[Oo,ko]),No=(0,b.useCallback)(e=>{e?.paneId&&Je&<(Je,e.paneId),po()},[lt,po,Je]),Uo=(0,he.useStableEvent)(ft),Ko=(0,b.useCallback)(e=>{ft({profile:e})},[ft]),$o=(0,b.useCallback)(e=>{if(!Je||!(0,Ke.getIsElectron)())return;e?.paneId&<(Je,e.paneId);const{browserId:t}=(0,fe.createWorkspaceBrowser)();ot(Je,{kind:"browser",browserId:t})},[lt,ot,Je]),qo=(0,b.useCallback)(e=>{if(!Je||!(0,Ke.getIsElectron)())return;const{browserId:t}=(0,fe.createWorkspaceBrowser)({initialUrl:e});ot(Je,{kind:"browser",browserId:t})},[ot,Je]);(0,Be.useDesktopBrowserNewTabRequests)({enabled:Boolean(Je),workspaceLayout:Dn,openUrl:qo});const Go=(0,b.useCallback)(e=>{wo(e)},[wo]),Qo=(0,b.useCallback)(e=>{if(!Je)return;const t=Qn(Je,e);t&&No({paneId:t})},[No,Je,Qn]),Xo=yt.mutateAsync,Jo=(0,b.useCallback)(async e=>{const{tabId:t,terminalId:n}=e;await no(t,async()=>{await(0,ge.confirmDialog)({title:o("workspace.tabs.confirmations.closeTerminalTitle"),message:o("workspace.tabs.confirmations.closeTerminalMessage"),confirmLabel:o("workspace.tabs.confirmations.close"),cancelLabel:o("workspace.tabs.confirmations.cancel"),destructive:!0})&&(Kt(n),Wo(e=>e===t?null:e),Je&&so({tabId:t,target:{kind:"terminal",terminalId:n}}),Xo(n).catch(St))})},[no,so,St,Xo,Je,Kt,o]),Yo=(0,b.useCallback)(async e=>{const{tabId:t,agentId:n}=e;await no(t,async()=>{if(!i)return;const e=G.useSessionStore.getState().sessions[i]?.agents?.get(n)??null,a=(0,Ve.resolveCloseAgentTabPolicy)(e);if("running"===e?.status&&"archive-on-close"===a.kind){if(!await(0,ge.confirmDialog)({title:o("workspace.tabs.confirmations.archiveRunningAgentTitle"),message:o("workspace.tabs.confirmations.archiveRunningAgentMessage"),confirmLabel:o("workspace.tabs.confirmations.archive"),cancelLabel:o("workspace.tabs.confirmations.cancel"),destructive:!0}))return}Wo(e=>e===t?null:e),Je&&so({tabId:t,target:{kind:"agent",agentId:n}}),"layout-only"!==a.kind&&Gt({serverId:i,agentId:n}).catch(()=>{})})},[Gt,no,so,i,Je,o]),Zo=(0,b.useCallback)(function(e){Wo(t=>t===e.tabId?null:t),Je&&so({tabId:e.tabId,target:e.target})},[so,Je]),ea=(0,b.useCallback)(async e=>{const t=zo.get(e);t&&("terminal"!==t.target.kind?"agent"!==t.target.kind?Zo({tabId:e,target:t.target}):await Yo({tabId:e,agentId:t.target.agentId}):await Jo({tabId:e,terminalId:t.target.terminalId}))},[zo,Yo,Zo,Jo]),ta=(0,b.useCallback)(async e=>{if(e)try{await I.setStringAsync(e),a.copied(o("workspace.tabs.toasts.agentIdCopiedLabel"))}catch{a.error(o("workspace.tabs.toasts.copyFailed"))}},[a,o]),na=(0,b.useCallback)(async e=>{if(e)try{await I.setStringAsync(e),a.copied(o("workspace.tabs.toasts.filePathCopiedLabel"))}catch{a.error(o("workspace.tabs.toasts.copyFailed"))}},[a,o]),oa=(0,b.useCallback)(async e=>{if(!e)return;const t=G.useSessionStore.getState().sessions[i]?.agents?.get(e)??null,n=t?.runtimeInfo?.sessionId??t?.persistence?.sessionId??null;if(!t||!n)return void a.error(o("workspace.tabs.toasts.resumeIdUnavailable"));const s=(0,Te.buildProviderCommand)({provider:t.provider,id:"resume",sessionId:n})??null;if(s)try{await I.setStringAsync(s),a.copied(o("workspace.tabs.toasts.resumeCommandCopiedLabel"))}catch{a.error(o("workspace.tabs.toasts.copyFailed"))}else a.error(o("workspace.tabs.toasts.resumeCommandUnavailable"))},[i,a,o]),aa=(0,b.useCallback)(async e=>{if(R&&F){a.show(o("workspace.tabs.toasts.reloadingAgent"),{durationMs:null});try{await R.refreshAgent(e);const t=G.useSessionStore.getState().sessions[i],n=t?.agentTimelineCursor.get(e);await R.fetchAgentTimeline(e,Object.assign({direction:"tail",projection:"projected"},n?{cursor:{epoch:n.epoch,seq:n.endSeq}}:{})),a.show(o("workspace.tabs.toasts.reloadedAgent"),{variant:"success"})}catch(e){a.error(e instanceof Error?e.message:o("workspace.tabs.toasts.failedToReloadAgent"))}}else a.error(o("workspace.terminal.hostDisconnected"))},[R,F,i,a,o]),sa=(0,b.useCallback)(async(e,t)=>{if(!R||!F)return void a.error("Host is not connected");const n=t.trim();if(!n)return;const o=G.useSessionStore.getState().sessions[i],s=o?.agents?.get(e)??o?.agentDetails?.get(e),r=s?.title??null;try{await R.updateAgent(e,{name:n})}catch(e){return void a.error(e instanceof Error?e.message:"Failed to rename session")}const c=O.find(e=>e.serverId===i);if((await(0,D.renameSession)({sessionId:e,newName:n,cwd:Ce,daemonProfile:c})).ok)a.show("Renamed session",{variant:"success"});else{if(null!==r)try{await R.updateAgent(e,{name:r})}catch{}a.error("Couldn't rename tab")}},[R,F,a,i,O,Ce]),ra=(0,b.useCallback)(e=>{Ro(e)},[Ro]),ia=(0,b.useCallback)(async(e,t)=>{if(!R||!F)return void a.error("Host is not connected");const n=G.useSessionStore.getState().sessions[i],o=n?.agents?.get(e)??n?.agentDetails?.get(e),s=(0,ae.getKanbanBoardState)(),r=(0,oe.resolveBucketId)({labels:o?.labels},s.validIds,s.defaultBucketId);if(!u(t,r))return;const c=(0,oe.buildLabelsForBucketMove)(o?.labels,t,s.defaultBucketId);try{await R.updateAgent(e,{labels:c}),a.show(`Moved to ${(0,ae.getBucketLabel)(t)}`,{variant:"success"})}catch(e){a.error(e instanceof Error?e.message:"Failed to update bucket")}},[R,F,i,a,u]),ca=(0,b.useCallback)(async()=>{if(Ce)try{await I.setStringAsync(Ce),a.copied(o("workspace.header.toasts.workspacePathCopiedLabel"))}catch{a.error(o("workspace.tabs.toasts.copyFailed"))}else a.error(o("workspace.header.toasts.workspacePathUnavailable"))},[a,Ce,o]),la=(0,b.useCallback)(async()=>{if(fn)try{await I.setStringAsync(fn),a.copied(o("workspace.header.toasts.branchNameCopiedLabel"))}catch{a.error(o("workspace.tabs.toasts.copyFailed"))}else a.error(o("workspace.header.toasts.branchNameUnavailable"))},[fn,a,o]),da=(0,b.useCallback)(()=>{if(!Je)return;const e=(0,le.normalizeWorkspaceTabTarget)({kind:"setup",workspaceId:p});e&&ot(Je,e)},[p,ot,Je]),ua=(0,b.useCallback)(async e=>{const{tabsToClose:t,title:n,logLabel:a}=e;if(0===t.length)return;const s=(0,Oe.classifyBulkClosableTabs)(t);if(!await(0,ge.confirmDialog)({title:n,message:(0,Oe.buildBulkCloseConfirmationMessage)(s,Lo),confirmLabel:o("workspace.tabs.confirmations.close"),cancelLabel:o("workspace.tabs.confirmations.cancel"),destructive:!0}))return;await(0,Oe.closeBulkWorkspaceTabs)({client:R,groups:s,closeTab:no,closeWorkspaceTabWithCleanup:e=>{Je&&so(e)},logLabel:a,warn:(e,t)=>{console.warn(e,t)}});const r=new Set(t.map(e=>e.key));Wo(e=>e&&r.has(e)?null:e)},[Lo,R,no,so,Je,o]),pa=(0,b.useCallback)(async(e,t)=>{const n=t.findIndex(t=>t.tabId===e);n<0||await ua({tabsToClose:t.slice(0,n),title:o("workspace.tabs.confirmations.closeTabsLeftTitle"),logLabel:"to the left"})},[ua,o]),ba=(0,b.useCallback)(async e=>{await pa(e,ko)},[pa,ko]),ma=(0,b.useCallback)(async(e,t)=>{const n=t.findIndex(t=>t.tabId===e);n<0||await ua({tabsToClose:t.slice(n+1),title:o("workspace.tabs.confirmations.closeTabsRightTitle"),logLabel:"to the right"})},[ua,o]),ga=(0,b.useCallback)(async e=>{await ma(e,ko)},[ma,ko]),ka=(0,b.useCallback)(async(e,t)=>{const n=t.filter(t=>t.tabId!==e);await ua({tabsToClose:n,title:o("workspace.tabs.confirmations.closeOtherTabsTitle"),logLabel:"from close other tabs"})},[ua,o]),ha=(0,b.useCallback)(async e=>{await ka(e,ko)},[ka,ko]),wa=(0,b.useCallback)(e=>{switch(e.id){case"workspace.tab.new":return No(),!0;case"workspace.terminal.new":return Uo(),!0;case"workspace.tab.close-current":return bo&&ea(bo),!0;case"workspace.tab.navigate-index":{const t=ko[e.index-1]??null;return t?.tabId&&wo(t.tabId),!0}case"workspace.tab.navigate-relative":if(ko.length>0){const t=ko.findIndex(e=>e.tabId===bo),n=((t>=0?t:0)+e.delta+ko.length)%ko.length,o=ko[n]??null;o?.tabId&&wo(o.tabId)}return!0;default:return!1}},[bo,ea,No,Uo,wo,ko]),fa=(0,b.useCallback)(e=>"sidebar.toggle.right"===e.id&&(Bn(),!0),[Bn]),Ia=(0,b.useCallback)(e=>{if(!Je||!Dn)return!0;const t=ro.pane;if(!t)return!0;if("workspace.pane.split.right"===e.id)return Qo({targetPaneId:t.id,position:"right"}),!0;if("workspace.pane.split.down"===e.id)return Qo({targetPaneId:t.id,position:"bottom"}),!0;if(e.id.startsWith("workspace.pane.focus.")){const n=dn(e.id);if(n){const e=(0,Ne.findAdjacentPane)(Dn.root,t.id,n);e&<(Je,e)}return!0}if(e.id.startsWith("workspace.pane.move-tab.")){const n=dn(e.id);if(n){const e=ro.activeTabId,o=(0,Ne.findAdjacentPane)(Dn.root,t.id,n);e&&o&&(Jn.current=!0,Xn(Je,e,o),requestAnimationFrame(()=>{Jn.current=!1}))}return!0}if("workspace.pane.close"===e.id){for(const e of t.tabIds)so({tabId:e,target:zo.get(e)?.target??null});return!0}return!1},[zo,so,lt,Qo,Xn,Je,ro.activeTabId,ro.pane,Dn]);(0,ie.useKeyboardActionHandler)({handlerId:`workspace-tab-actions:${i}:${p}`,actions:["workspace.tab.new","workspace.tab.close-current","workspace.tab.navigate-index","workspace.tab.navigate-relative","workspace.terminal.new"],enabled:Boolean(n&&i&&p),priority:100,isActive:()=>!0,handle:wa}),(0,ie.useKeyboardActionHandler)({handlerId:`workspace-pane-actions:${i}:${p}`,actions:["workspace.pane.split.right","workspace.pane.split.down","workspace.pane.focus.left","workspace.pane.focus.right","workspace.pane.focus.up","workspace.pane.focus.down","workspace.pane.move-tab.left","workspace.pane.move-tab.right","workspace.pane.move-tab.up","workspace.pane.move-tab.down","workspace.pane.close"],enabled:Boolean(n&&i&&p),priority:100,isActive:()=>!0,handle:Ia}),(0,ie.useKeyboardActionHandler)({handlerId:`workspace-sidebar-actions:${i}:${p}`,actions:["sidebar.toggle.right"],enabled:Boolean(n&&i&&p),priority:100,isActive:()=>!0,handle:fa});const Ta=(0,b.useMemo)(()=>mo?.descriptor??null,[mo]),Sa=(0,b.useRef)(null),ya=(0,b.useCallback)(()=>{const e=Sa.current;if(!e||!Je)return;Sa.current=null;const t=()=>{ot(Je,e),a.show("Tab reopened",{variant:"success",durationMs:1400})};"agent"!==e.kind?t():Promise.resolve(R?.refreshAgent(e.agentId)).catch(()=>{}).finally(t)},[Je,R,ot,a]),Ca=(0,b.useCallback)(async e=>{const t=Ta;if(!t||t.tabId!==e||!Je)return void await ea(e);const n=t.target;await ea(e);re.useWorkspaceLayoutStore.getState().getWorkspaceTabs(Je).some(t=>t.tabId===e)||"terminal"===n.kind||(Sa.current=n,a.show((0,tt.jsx)(Qt,{label:"Tab closed",onUndo:ya}),{durationMs:6e3,testID:"workspace-tab-close-undo"}))},[Ta,ea,Je,a,ya]),va=it(Ta),xa=va.path,Wa=va.lineStart,Pa=va.lineEnd,ja=(0,b.useMemo)(()=>{return null===(e={path:xa,lineStart:Wa,lineEnd:Pa}).path?null:{path:e.path,lineStart:e.lineStart,lineEnd:e.lineEnd};var e},[Pa,Wa,xa]),Ma=(0,Ue.supportsDesktopPaneSplits)(),Ba=(0,b.useMemo)(()=>!s&&!Ma,[s,Ma]);(0,b.useEffect)(()=>{!n||Ke.isNative||"undefined"==typeof document||Ta||(document.title="Workspace")},[Ta,n]);const Aa=(0,b.useCallback)(e=>(0,ze.buildWorkspacePaneContentModel)({tab:e.tab,normalizedServerId:i,normalizedWorkspaceId:p,onOpenTab:t=>{if(!Je)return;e.focusPaneBeforeOpen&&e.paneId&<(Je,e.paneId);const n=ct(Je,t,e.tab.tabId);n&&wo(n)},onCloseCurrentTab:()=>{ea(e.tab.tabId)},onRetargetCurrentTab:t=>{Je&&$n(Je,e.tab.tabId,t)},onOpenWorkspaceFile:t=>{vo({request:t,paneId:e.paneId,parentTabId:e.tab.tabId,focusPaneBeforeOpen:e.focusPaneBeforeOpen})},onOpenImportSheet:Qe}),[ea,lt,vo,wo,i,p,Qe,ct,Je,$n]),Ra=(0,b.useMemo)(()=>ro.pane?.id??null,[ro.pane]),_a=(0,b.useMemo)(()=>ko.map(e=>e.tabId),[ko]),Da=nn(ko),{mountedTabIds:Fa}=(0,Le.useMountedTabSet)({activeTabId:bo,allTabIds:_a,cap:3}),za=(0,b.useMemo)(()=>_a.filter(e=>Fa.has(e)),[_a,Fa]),La=(0,b.useCallback)(function(e){return Aa({tab:e.tab,paneId:e.paneId,focusPaneBeforeOpen:!1})},[Aa]),Ha=un({isMissingWorkspaceDirectory:Me,activeTabDescriptor:Ta,hasHydratedAgents:Yt,mountedFocusedPaneTabIds:za,focusedPaneTabDescriptorMap:Da,isRouteFocused:n,focusedPaneId:Ra,buildMobilePaneContentModel:La}),Ea=(0,b.useCallback)(function(e){return Aa({tab:e.tab,paneId:e.paneId,focusPaneBeforeOpen:!0})},[Aa]),Oa=(0,Q.useSessionFilterStore)(e=>e.statusFilters),Va=(0,Q.useSessionFilterStore)(e=>e.tagFilters),Na=(0,Q.useSessionFilterStore)(e=>e.kanbanFilters),Ua=(0,ae.useKanbanBuckets)(),Ka=(0,ae.useDefaultBucketId)(),$a=(0,b.useMemo)(()=>new Set(Ua.map(e=>e.id)),[Ua]),qa=(0,Q.useSessionFilterStore)(e=>e.textFilter),Ga=(0,Q.useSessionFilterStore)(e=>e.agentNameFilter),Qa=(0,Q.useSessionFilterStore)(e=>e.timeField),Xa=(0,Q.useSessionFilterStore)(e=>e.timeWindow),Ja=(0,Q.useSessionFilterStore)(e=>e.providerFilters),Ya=(0,Q.useSessionFilterStore)(e=>e.originFilters),Za=(0,G.useSessionStore)(e=>e.sessions[i]?.agents),es=(0,b.useMemo)(()=>(0,Z.distinctTagsWithCounts)([...Za?.values()??[]]),[Za]),ts=(0,b.useMemo)(()=>Ao?.initialTags??[],[Ao]),ns=(0,b.useMemo)(()=>ko.map(e=>{if("agent"!==e.target.kind)return{tab:e,bucket:null,tags:[],kanbanBucket:null,searchableText:"",agentName:null,timeValue:null,provider:null,origin:null};const t=Za?.get(e.target.agentId);return t?{tab:e,bucket:(0,J.deriveSidebarStateBucket)({status:t.status,pendingPermissionCount:t.pendingPermissions?.length??0,requiresAttention:t.requiresAttention,attentionReason:t.attentionReason}),tags:(0,Z.getAgentTags)(t),kanbanBucket:(0,oe.resolveBucketId)(t,$a,Ka),searchableText:`${t.title??""} ${t.cwd??""}`.toLowerCase(),agentName:(0,Y.parseAgentSessionName)(t.title),timeValue:(n=t,o=Qa,("created"===o?n.createdAt:n.lastActivityAt)??null),provider:t.provider??null,origin:(0,te.deriveSessionOrigin)(t.labels)}:{tab:e,bucket:"done",tags:[],kanbanBucket:Ka,searchableText:"",agentName:null,timeValue:null,provider:null,origin:null};var n,o}),[ko,Za,$a,Ka,Qa]),os=(0,b.useMemo)(()=>ns.filter(e=>null===e.agentName),[ns]),as=(0,b.useMemo)(()=>{const e={};for(const t of Ua)e[t.id]=0;for(const t of os)t.kanbanBucket&&t.kanbanBucket in e&&e[t.kanbanBucket]++;return e},[os,Ua]),ss=(0,b.useMemo)(()=>0===Na.length?os:os.filter(e=>null===e.kanbanBucket||Na.includes(e.kanbanBucket)),[os,Na]),rs=(0,b.useMemo)(()=>{const e={needs_input:0,failed:0,running:0,attention:0,done:0};for(const t of ss)t.bucket&&e[t.bucket]++;return e},[ss]),is=(0,b.useMemo)(()=>ss.filter(e=>null!==e.bucket).length,[ss]),cs=(0,b.useMemo)(()=>{const e=new Map;for(const t of ss)for(const n of t.tags)e.set(n,(e.get(n)??0)+1);return Array.from(e.entries()).map(([e,t])=>({tag:e,count:t})).sort((e,t)=>e.tag.localeCompare(t.tag))},[ss]),ls=(0,b.useMemo)(()=>{const e=new Date,t=Object.fromEntries(ee.SESSION_TIME_WINDOWS.map(e=>[e,0])),n={root:0,delegated:0},o=new Map;for(const a of ss)if(null!==a.bucket){for(const n of ee.SESSION_TIME_WINDOWS)(0,ee.isWithinSessionTimeWindow)(a.timeValue,n,e)&&t[n]++;a.origin&&n[a.origin]++,a.provider&&o.set(a.provider,(o.get(a.provider)??0)+1)}return{timeCounts:t,providerCounts:[...o.entries()].map(([e,t])=>({provider:e,count:t})).sort((e,t)=>t.count-e.count||e.provider.localeCompare(t.provider)),originCounts:n}},[ss]),ds=(0,b.useMemo)(()=>{const e=qa.trim().toLowerCase(),t=Ga?.trim()??"";if(""===t&&0===Oa.length&&0===Va.length&&0===Na.length&&null===Xa&&0===Ja.length&&0===Ya.length&&""===e){return ns.some(e=>null!==e.agentName&&e.tab.tabId!==Ta?.tabId)?ns.filter(e=>e.tab.tabId===Ta?.tabId||null===e.agentName).map(e=>e.tab):ko}const n=new Date;return ns.filter(o=>{const{tab:a,bucket:s,tags:r,kanbanBucket:i,searchableText:c,agentName:l,timeValue:d,provider:u,origin:p}=o;return a.tabId===Ta?.tabId||(""!==t?"agent"===a.target.kind&&l===t:null===l&&("agent"!==a.target.kind||!(Oa.length>0&&(!s||!Oa.includes(s)))&&(!(Va.length>0&&!Va.some(e=>r.includes(e)))&&(!(Na.length>0&&(!i||!Na.includes(i)))&&(!!(0,ne.passesWorkspaceMetadataFilters)({timeValue:d,provider:u,origin:p},{timeWindow:Xa,providerFilters:Ja,originFilters:Ya},n)&&!(""!==e&&!c.includes(e)))))))}).map(e=>e.tab)},[ko,ns,Oa,Va,Na,qa,Ga,Xa,Ja,Ya,Ta?.tabId]),us=(0,b.useMemo)(()=>ds.map(e=>({tab:e,isActive:e.tabId===Ta?.tabId,isCloseHovered:xo===e.key,isClosingTab:to.has(e.tabId)})),[Ta?.tabId,to,xo,ds]),ps=(0,he.useStableEvent)(function(e){Je&&!Jn.current&<(Je,e)}),bs=(0,b.useCallback)(function(e){Je&&Gn(Je,e)},[Je,Gn]),ms=(0,b.useCallback)(function(e,t){Je&&Xn(Je,e,t)},[Xn,Je]),gs=(0,b.useCallback)(function(e,t){Je&&Yn(Je,e,t)},[Je,Yn]),ks=(0,b.useCallback)(function(e,t){Je&&Zn(Je,e,t)},[Je,Zn]),hs=(0,b.useCallback)(e=>{Ra&&ks(Ra,e.map(e=>e.tabId))},[Ra,ks]),ws=(0,b.useCallback)(function(){return(0,tt.jsx)(c.View,{style:vn.emptyState,children:(0,tt.jsx)(l.Text,{style:vn.emptyStateText,children:o("workspace.tabs.emptyPane")})})},[o]),fs=xn,Is=Mt,Ts=Bt,Ss=_t,ys=Dt,Cs=hn({gate:(0,_e.renderWorkspaceRouteGate)({state:Zt,actions:{onRetryHost:f,onManageHost:y,onDismissMissingWorkspace:v}}),workspaceKey:Je}),vs=(0,b.useMemo)(()=>(0,tt.jsxs)(c.View,{style:vn.headerRight,children:[(0,tt.jsx)(M.BackgroundActivityButton,{serverId:i,workspaceId:p}),(0,tt.jsx)(j.CommandCenterSearchButton,{}),!s&&g&&g.scripts.length>0?(0,tt.jsx)(U.WorkspaceScriptsButton,{serverId:i,workspaceId:p,scripts:g.scripts,liveTerminalIds:Ft,onScriptTerminalStarted:It,onViewTerminal:Tt,onOpenUrlInBrowserTab:qo,hideLabels:!0}):null,!s&&Ce?(0,tt.jsx)(N.WorkspaceOpenInEditorButton,{serverId:i,cwd:Ce,activeFile:ja,hideLabels:!0}):null,!s&&kn?(0,tt.jsxs)(tt.Fragment,{children:[Ce?(0,tt.jsx)(V.WorkspaceGitActions,{serverId:i,cwd:Ce,hideLabels:ao}):null,(0,tt.jsxs)(z.Tooltip,{delayDuration:0,enabledOnDesktop:!0,enabledOnMobile:!1,children:[(0,tt.jsx)(z.TooltipTrigger,{asChild:!0,children:(0,tt.jsx)(d.Pressable,{testID:"workspace-explorer-toggle",onPress:Bn,accessibilityRole:"button",accessibilityLabel:Ho,accessibilityState:_n,style:Rn,children:({hovered:e,pressed:t})=>{const n=Cn||e||t?Wt:Pt;return(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(vt,{size:16,uniProps:n}),g?.diffStat?(0,tt.jsx)(S.DiffStat,{additions:g.diffStat.additions,deletions:g.diffStat.deletions}):null]})}})}),(0,tt.jsx)(z.TooltipContent,{testID:"workspace-explorer-toggle-tooltip",side:"left",align:"center",offset:8,children:(0,tt.jsxs)(c.View,{style:vn.explorerTooltipRow,children:[(0,tt.jsx)(l.Text,{style:vn.explorerTooltipText,children:o("workspace.tabs.explorer.toggle")}),(0,tt.jsx)(_.Shortcut,{keys:Wn,style:vn.explorerTooltipShortcut})]})})]})]}):null,s||kn?null:(0,tt.jsx)(P.HeaderToggleButton,{testID:"workspace-explorer-toggle",onPress:Bn,tooltipLabel:o("workspace.tabs.explorer.toggle"),tooltipKeys:Wn,tooltipSide:"left",style:vn.compactHeaderActionButton,accessible:!0,accessibilityRole:"button",accessibilityLabel:Ho,accessibilityState:_n,children:({hovered:e})=>{const t=Cn||e?Wt:Pt;return(0,tt.jsx)(Ct,{size:16,uniProps:t})}}),s?(0,tt.jsx)(P.HeaderToggleButton,{testID:"workspace-explorer-toggle",onPress:Bn,tooltipLabel:o("workspace.tabs.explorer.toggle"),tooltipKeys:Wn,tooltipSide:"left",style:vn.headerActionButton,accessible:!0,accessibilityRole:"button",accessibilityLabel:Ho,accessibilityState:_n,children:({hovered:e})=>{const t=Cn||e?Wt:Pt;return kn?(0,tt.jsx)(vt,Object.assign({size:20,uniProps:t},jt)):(0,tt.jsx)(Ct,{size:20,uniProps:t})}}):null]}),[s,g,i,p,Ce,ja,Ft,It,Tt,qo,ao,kn,Bn,Cn,Ho,_n,Rn,o]),xs=(0,b.useMemo)(()=>In({isFocusModeEnabled:r,isMobile:s}),[r,s]),Ws=(0,b.useMemo)(()=>Tn({isRouteFocused:n,isFocusModeEnabled:r,isMobile:s}),[n,r,s]),Ps=(0,b.useMemo)(()=>wt.isPending||null!==Ot,[wt.isPending,Ot]),js=(0,Ke.getIsElectron)(),Ms=(0,b.useMemo)(()=>Ra??void 0,[Ra]),Bs=(0,b.useMemo)(()=>r&&!s,[r,s]),As=(0,b.useMemo)(()=>`workspace-floating-panels:${i}:${p}`,[i,p]),Rs=(0,b.useMemo)(()=>Ma&&Dn&&Je?(0,tt.jsx)(E.SplitContainer,{layout:Dn,focusModeEnabled:Bs,workspaceKey:Je,normalizedServerId:i,normalizedWorkspaceId:p,isWorkspaceFocused:n,uiTabs:En,hoveredCloseTabKey:xo,setHoveredCloseTabKey:Wo,closingTabIds:to,onNavigateTab:wo,onCloseTab:ea,onCopyResumeCommand:oa,onCopyAgentId:ta,onCopyFilePath:na,onReloadAgent:aa,onRenameTab:Po,onRenameAgent:sa,onTagAgent:ra,onSetKanbanBucket:ia,onCloseTabsToLeft:pa,onCloseTabsToRight:ma,onCloseOtherTabs:ka,onCreateDraftTab:No,onCreateTerminalTab:Uo,onCreateBrowserTab:$o,showCreateBrowserTab:js,buildPaneContentModel:Ea,onFocusPane:ps,onSplitPane:bs,onSplitPaneEmpty:Qo,onMoveTabToPane:ms,onResizeSplit:gs,onReorderTabsInPane:ks,renderPaneEmptyState:ws}):null,[Ma,Dn,Je,Bs,i,p,n,En,xo,to,wo,ea,oa,ta,na,aa,Po,sa,ra,ia,pa,ma,ka,No,Uo,$o,js,Ea,ps,bs,Qo,ms,gs,ks,ws])??Ha,_s=Ga?null:(0,tt.jsx)(X.SessionFilterBar,{statusCounts:rs,totalAgents:is,visibleCount:ds.filter(e=>"agent"===e.target.kind).length,availableTags:cs,kanbanCounts:as,metadataFacets:ls}),Ds=xs?(0,tt.jsx)(B.ScreenHeader,{onRowLayout:oo,left:(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(W.SidebarMenuToggle,{}),(0,tt.jsx)(ln,{isLoading:sn,title:rn,subtitle:cn,showSubtitle:bn,currentBranchName:fn,normalizedServerId:i,normalizedWorkspaceId:p,workspaceScripts:h,liveTerminalIds:Ft,showWorkspaceSetup:Hn,showCreateBrowserTab:js,isMobile:s,createTerminalDisabled:Ps,importAgentDisabled:!qe,copyPathDisabled:!Ce,menuNewAgentIcon:Is,menuNewTerminalIcon:Ts,menuNewBrowserIcon:At,menuImportIcon:Rt,menuCopyIcon:Ss,menuSettingsIcon:ys,onCreateDraftTab:No,onCreateTerminal:Uo,onCreateTerminalWithProfile:Ko,onCreateBrowser:$o,onOpenImportSheet:Qe,onCopyWorkspacePath:ca,onCopyBranchName:la,onOpenSetupTab:da,onScriptTerminalStarted:It,onViewScriptTerminal:Tt,onOpenUrlInBrowserTab:qo})]}),right:vs}):null,Fs=(0,tt.jsxs)(c.View,{style:vn.centerColumn,children:[!s&&Ds,!s&&_s,Ba?(0,tt.jsx)(Pe.WorkspaceDesktopTabsRow,{paneId:Ms,isFocused:n,tabs:us,normalizedServerId:i,normalizedWorkspaceId:p,setHoveredCloseTabKey:Wo,onNavigateTab:wo,onCloseTab:ea,onCopyResumeCommand:oa,onCopyAgentId:ta,onCopyFilePath:na,onReloadAgent:aa,onRenameAgent:sa,onTagAgent:ra,onSetKanbanBucket:ia,onCloseTabsToLeft:ba,onCloseTabsToRight:ga,onCloseOtherTabs:ha,onCreateDraftTab:No,onCreateTerminalTab:Uo,onCreateBrowserTab:$o,showCreateBrowserTab:js,disableCreateTerminal:wt.isPending,isWaitingOnTerminalReadiness:null!==Ot,onReorderTabs:hs,onSplitRight:Ut,onSplitDown:Ut,showPaneSplitActions:!1}):null,(0,tt.jsx)(c.View,{style:vn.centerContent,children:s?(0,tt.jsx)(c.View,{style:vn.content,children:Ha}):(0,tt.jsx)(c.View,{style:vn.content,children:Rs})})]});return Cs??(0,tt.jsx)(He.WorkspaceFocusProvider,{workspaceKey:Je,children:(0,tt.jsx)(Ze.RenderProfile,{id:"WorkspaceScreenContent",children:(0,tt.jsxs)(c.View,{style:fs,children:[(0,tt.jsx)(wn,{tab:Ta,serverId:i,workspaceId:p,isRouteFocused:n}),(0,tt.jsxs)(c.View,{style:vn.threePaneRow,children:[s&&Ds,s&&_s,s?(0,tt.jsx)(en,{tabs:ds,activeTabKey:Eo,activeTab:Ta,tabSwitcherOptions:Vo,tabByKey:Fo,normalizedServerId:i,normalizedWorkspaceId:p,onSelectSwitcherTab:Go,onCopyResumeCommand:oa,onCopyAgentId:ta,onCopyFilePath:na,onReloadAgent:aa,onRenameTab:Po,onCloseTab:ea,onCloseActiveTab:Ca,onCloseTabsAbove:ba,onCloseTabsBelow:ga,onCloseOtherTabs:ha,onRenameAgent:sa,onTagAgent:ra,onSetKanbanBucket:ia}):null,(0,tt.jsx)(L.FloatingPanelPortalHostNameProvider,{hostName:As,children:Fs}),(0,tt.jsx)(L.FloatingPanelPortalHost,{name:As}),Ws&&Ce?(0,tt.jsx)(H.ExplorerSidebar,{serverId:i,workspaceId:p,workspaceRoot:Ce,isGit:kn,onOpenFile:So}):null]}),(0,tt.jsx)(K.ImportSessionSheet,{visible:Ae,client:R,serverId:i,cwd:Ce,onClose:Xe,onImportedAgent:fo}),(0,tt.jsx)(ve.WorkspaceTabRenameModal,{renamingTab:jo,onSubmit:Mo,onClose:Bo}),(0,tt.jsx)(We.AdaptiveTagsModal,{visible:null!=Ao,initialTags:ts,suggestedTags:es,onSubmit:_o,onClose:Do})]})})})}const vn=v.StyleSheet.create(e=>({container:{flex:1,backgroundColor:e.colors.surface0,uni__dependencies:[0]},containerWorkspaceBackground:{backgroundColor:e.colors.surfaceWorkspace,uni__dependencies:[0]},threePaneRow:{flex:1,minHeight:0,flexDirection:{xs:"column",sm:"column",md:"row"},alignItems:"stretch"},centerColumn:{flex:1,minHeight:0},headerTitle:{fontSize:e.fontSize.base,fontWeight:{xs:"400",md:"300"},color:e.colors.foreground,flexShrink:1,uni__dependencies:[0]},headerTitleContainer:{flex:1,flexShrink:1,minWidth:0,flexDirection:"row",alignItems:"center",gap:{xs:e.spacing[1],md:e.spacing[2]},overflow:"hidden",uni__dependencies:[0]},headerTitleTextGroup:{minWidth:0,overflow:"hidden",flexShrink:1,flexGrow:{xs:1,md:0},flexDirection:{xs:"column",md:"row"},alignItems:{xs:"flex-start",md:"center"},justifyContent:"flex-start",gap:{xs:0,md:e.spacing[2]},uni__dependencies:[0]},headerProjectTitle:{color:e.colors.foregroundMuted,fontSize:{xs:e.fontSize.sm,md:e.fontSize.base},flexShrink:1,minWidth:0,maxWidth:"60%",uni__dependencies:[0]},headerTitleSkeleton:{width:220,maxWidth:"100%",height:22,borderRadius:e.borderRadius.full,backgroundColor:e.colors.surface3,opacity:.25,uni__dependencies:[0]},headerRight:{flexDirection:"row",alignItems:"center",gap:{xs:e.spacing[1],md:e.spacing[2]},uni__dependencies:[0]},headerActionButton:{paddingVertical:e.spacing[2],paddingHorizontal:e.spacing[2],borderRadius:e.borderRadius.lg,uni__dependencies:[0]},compactHeaderActionButton:{width:e.spacing[8],height:e.spacing[8],padding:0,borderRadius:e.borderRadius.lg,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},compactHeaderMenuCluster:{flexDirection:"row",alignItems:"center",gap:{xs:0,md:e.spacing[2]},uni__dependencies:[0]},sourceControlButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:e.spacing[2],paddingHorizontal:e.spacing[1],paddingVertical:e.spacing[1],minHeight:Math.ceil(1.5*e.fontSize.sm)+2*e.spacing[1],minWidth:Math.ceil(1.5*e.fontSize.sm)+2*e.spacing[1],borderRadius:e.borderRadius.md,uni__dependencies:[0]},sourceControlButtonWithStats:{paddingHorizontal:e.spacing[3],uni__dependencies:[0]},sourceControlButtonHovered:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},newTabActions:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],uni__dependencies:[0]},newTabActionButton:{width:30,height:30,borderRadius:e.borderRadius.md,borderWidth:e.borderWidth[1],borderColor:e.colors.border,backgroundColor:e.colors.surface1,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},newTabActionButtonHovered:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},newTabTooltipText:{fontSize:e.fontSize.sm,color:e.colors.popoverForeground,uni__dependencies:[0]},newTabTooltipRow:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},newTabTooltipShortcut:{},explorerTooltipRow:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},explorerTooltipText:{fontSize:e.fontSize.sm,color:e.colors.popoverForeground,uni__dependencies:[0]},explorerTooltipShortcut:{},mobileTabsRow:{backgroundColor:e.colors.surface0,borderBottomWidth:e.borderWidth[1],borderBottomColor:e.colors.border,uni__dependencies:[0]},switcherRow:{flexDirection:"row",alignItems:"center",paddingRight:e.spacing[2],uni__dependencies:[0]},switcherTrigger:{flex:1,minWidth:0,flexDirection:"row",alignItems:"center",gap:e.spacing[2],paddingHorizontal:e.spacing[2]+e.spacing[3],paddingVertical:e.spacing[2],uni__dependencies:[0]},switcherTriggerPressed:{backgroundColor:e.colors.surface1,uni__dependencies:[0]},switcherTriggerLeft:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],flex:1,minWidth:0,uni__dependencies:[0]},switcherTriggerIcon:{flexShrink:0},switcherTriggerText:{minWidth:0,flex:1,color:e.colors.foreground,fontSize:e.fontSize.sm,uni__dependencies:[0]},mobileTabMenuTrigger:{width:28,height:28,borderRadius:e.borderRadius.md,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},mobileTabMenuTriggerActive:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},activeTabCloseButton:{width:28,height:28,borderRadius:e.borderRadius.md,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},activeTabCloseButtonPressed:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},undoToastRow:{flexDirection:"row",alignItems:"center",gap:e.spacing[3],uni__dependencies:[0]},undoToastText:{color:e.colors.foreground,fontSize:e.fontSize.sm,uni__dependencies:[0]},undoToastButton:{paddingHorizontal:e.spacing[2],paddingVertical:e.spacing[1],borderRadius:e.borderRadius.md,uni__dependencies:[0]},undoToastButtonPressed:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},undoToastAction:{color:e.colors.accent,fontSize:e.fontSize.sm,fontWeight:e.fontWeight.medium,uni__dependencies:[0]},menuItemHint:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,uni__dependencies:[0]},headerMenuProfileIconWrapper:{width:16,height:16},tabsContainer:{borderBottomWidth:1,borderBottomColor:e.colors.border,backgroundColor:e.colors.surface0,flexDirection:"row",alignItems:"center",uni__dependencies:[0]},tabsScroll:{flex:1,minWidth:0},tabsContent:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],paddingHorizontal:e.spacing[2],paddingVertical:e.spacing[1],uni__dependencies:[0]},tabsActions:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],paddingRight:e.spacing[2],paddingVertical:e.spacing[1],uni__dependencies:[0]},centerContent:{flex:1,minHeight:0},tab:{paddingHorizontal:e.spacing[3],paddingVertical:e.spacing[2],borderRadius:e.borderRadius.md,flexDirection:"row",alignItems:"center",gap:e.spacing[1],maxWidth:260,uni__dependencies:[0]},tabHandle:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],flex:1,minWidth:0,uni__dependencies:[0]},tabIcon:{flexShrink:0},tabActive:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},tabHovered:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},tabLabel:{flexShrink:1,minWidth:0,color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,fontWeight:e.fontWeight.normal,uni__dependencies:[0]},tabLabelWithCloseButton:{paddingRight:0},tabLabelActive:{color:e.colors.foreground,uni__dependencies:[0]},tabCloseButton:{width:18,height:18,marginLeft:0,borderRadius:e.borderRadius.sm,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},tabCloseButtonShown:{opacity:1},tabCloseButtonHidden:{opacity:0},tabCloseButtonActive:{backgroundColor:e.colors.surface3,uni__dependencies:[0]},content:{flex:1,minHeight:0,backgroundColor:e.colors.surface0,position:"relative",uni__dependencies:[0]},mobileMountedTabSlotVisible:{position:"absolute",top:0,left:0,right:0,bottom:0,opacity:1},mobileMountedTabSlotHidden:{position:"absolute",top:0,left:0,right:0,bottom:0,opacity:0},contentPlaceholder:{flex:1,minHeight:0,backgroundColor:e.colors.surface0,uni__dependencies:[0]},emptyState:{flex:1,alignItems:"center",justifyContent:"center",gap:e.spacing[3],paddingHorizontal:e.spacing[6],uni__dependencies:[0]},emptyStateText:{color:e.colors.foregroundMuted,textAlign:"center",uni__dependencies:[0]}})),xn=[vn.container,vn.containerWorkspaceBackground],Wn=["mod","E"]},4453,[348,711,1572,3519,349,36,3526,1148,1401,1376,811,1308,234,146,916,1143,3628,1573,3636,1600,1320,56,3444,4406,4409,4410,4411,4407,4408,3456,3515,4454,3572,3573,4016,3700,4455,4605,4606,4607,4621,4624,3499,3582,3414,3602,4626,3513,3613,3955,3603,3604,4627,3958,3957,3959,3436,3689,3596,3439,3271,3904,4085,3525,4628,3678,4098,3523,3433,3434,3404,4629,3494,3419,4547,4630,4631,3954,4592,4632,4597,4633,4634,4635,4636,4637,4461,4464,4463,3879,4639,4640,4538,4462,3457,3407,4527,3477,4641,3903,4598,3929,3440,4520,3887,279]);
|
|
16109
16109
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.renameSession=async function(t){const n=o(t.daemonProfile);if(!n)return{ok:!1,status:0,error:"Daemon connection unavailable"};const s=new URL(`/api/sessions/${encodeURIComponent(t.sessionId)}/rename`,n.baseUrl),c={"Content-Type":"application/json"};n.authHeader&&(c.Authorization=n.authHeader);const u={newName:t.newName};t.cwd&&(u.cwd=t.cwd);let l;try{l=await fetch(s.toString(),{method:"POST",headers:c,body:JSON.stringify(u)})}catch(t){return{ok:!1,status:0,error:t instanceof Error?t.message:"Network error"}}if(!l.ok){let t=`HTTP ${l.status}`;try{const o=await l.json();"string"==typeof o.error&&(t=o.error)}catch{}return{ok:!1,status:l.status,error:t}}let p=t.newName;try{const t=await l.json();"string"==typeof t.customTitle&&(p=t.customTitle)}catch{}return{ok:!0,customTitle:p}};var t=r(d[0]);function o(o){const n=o?.connections.find(t=>"directTcp"===t.type)??null;if(!n)return null;let s;try{s=new URL((0,t.buildDaemonWebSocketUrl)(n.endpoint,{useTls:n.useTls??!1}))}catch{return null}"ws:"===s.protocol?s.protocol="http:":"wss:"===s.protocol&&(s.protocol="https:");let c=null;if(s.username||s.password){const t=decodeURIComponent(s.username),o=decodeURIComponent(s.password);c=`Basic ${btoa(`${t}:${o}`)}`,s.username="",s.password=""}return s.pathname=s.pathname.replace(/\/ws\/?$/,"/"),{baseUrl:s.origin,authHeader:c}}},4454,[3399]);
|
|
16110
16110
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"MountedTabActiveContext",{enumerable:!0,get:function(){return A}}),e.SplitContainer=function(n){const o=(0,t.c)(81),{layout:l,workspaceKey:p,normalizedServerId:b,normalizedWorkspaceId:T,isWorkspaceFocused:f,uiTabs:I,hoveredCloseTabKey:v,setHoveredCloseTabKey:C,closingTabIds:h,onNavigateTab:y,onCloseTab:k,onCopyResumeCommand:R,onCopyAgentId:w,onCopyFilePath:S,onReloadAgent:x,onRenameAgent:z,onRenameTab:A,onTagAgent:F,onSetKanbanBucket:j,onCloseTabsToLeft:E,onCloseTabsToRight:M,onCloseOtherTabs:U,onCreateDraftTab:q,onCreateTerminalTab:J,onCreateBrowserTab:Q,showCreateBrowserTab:X,buildPaneContentModel:Y,onFocusPane:ee,onSplitPane:ne,onSplitPaneEmpty:te,onMoveTabToPane:re,onResizeSplit:se,onReorderTabsInPane:ie,renderPaneEmptyState:de,focusModeEnabled:le}=n,ce=void 0===de?Z:de,[ue,pe]=(0,s.useState)(null),[be,ge]=(0,s.useState)(null),[Te,fe]=(0,s.useState)(null);let Ie,ve;o[0]===Symbol.for("react.memo_cache_sentinel")?(Ie={activationConstraint:{distance:8}},o[0]=Ie):Ie=o[0];o[1]===Symbol.for("react.memo_cache_sentinel")?(ve={coordinateGetter:u.sortableKeyboardCoordinates},o[1]=ve):ve=o[1];const me=(0,c.useSensors)((0,c.useSensor)(c.PointerSensor,Ie),(0,c.useSensor)(c.KeyboardSensor,ve));let Ce;o[2]!==l.root?(Ce=oe(l.root),o[2]=l.root,o[3]=Ce):Ce=o[3];const he=Ce;let Pe;e:{if(!le){Pe=l.root;break e}let n;o[4]!==l.focusedPaneId||o[5]!==he?(n=l.focusedPaneId?he.get(l.focusedPaneId):null,o[4]=l.focusedPaneId,o[5]=he,o[6]=n):n=o[6];const t=n;if(!t){Pe=l.root;break e}let s;o[7]!==t?(s={kind:"pane",pane:t},o[7]=t,o[8]=s):s=o[8],Pe=s}const ye=Pe;let ke;o[9]!==ye?(ke=ae(ye),o[9]=ye,o[10]=ke):ke=o[10];const Re=ke;let we;o[11]===Symbol.for("react.memo_cache_sentinel")?(we=n=>{const o=K(n.active.data.current);if(!o)return pe(null),ge(null),void fe(null);pe(o.tabId)},o[11]=we):we=o[11];const Se=we;let De;o[12]===Symbol.for("react.memo_cache_sentinel")?(De=()=>{pe(null),ge(null),fe(null)},o[12]=De):De=o[12];const xe=De;let ze;o[13]!==he||o[14]!==I?(ze=n=>{const o=K(n.active.data.current),t=B(n.over?.data.current);if("workspace-tab"!==o?.kind)return ge(null),void fe(null);const s=_(n);if(!s)return ge(null),void fe(null);if("workspace-tab"===t?.kind){const n=H({activeData:o,overData:t,rects:s,panesById:he,uiTabs:I});return ge(null),void fe(n)}fe(null),ge("split-pane-drop"===t?.kind?L({overData:t,rects:s}):null)},o[13]=he,o[14]=I,o[15]=ze):ze=o[15];const We=ze;let Ae;o[16]!==re||o[17]!==ie||o[18]!==he||o[19]!==Te||o[20]!==I?(Ae=n=>{const{activeData:o,overData:t}=n,s=he.get(o.paneId)??null,l=he.get(t.paneId)??null;if(!s||!l)return;const c=(0,P.getWorkspacePaneDescriptors)({pane:s,tabs:I}),p=(0,P.getWorkspacePaneDescriptors)({pane:l,tabs:I}),b=c.findIndex(n=>n.tabId===o.tabId),T=Te?.paneId===t.paneId?Te:null;if(b<0||!T)return;if(o.paneId===t.paneId){if(b!==T.insertionIndex){const n=(0,u.arrayMove)(c,b,T.insertionIndex);ie(o.paneId,n.map(V))}return}const f=p.map(N);f.splice(T.insertionIndex,0,o.tabId),re(o.tabId,t.paneId),ie(t.paneId,f)},o[16]=re,o[17]=ie,o[18]=he,o[19]=Te,o[20]=I,o[21]=Ae):Ae=o[21];const Fe=Ae;let je;o[22]!==be||o[23]!==re||o[24]!==ne?(je=n=>{const{activeData:o,overData:t}=n;be?.paneId===t.paneId&&("center"!==be.position?ne({tabId:o.tabId,targetPaneId:t.paneId,position:be.position}):o.paneId!==t.paneId&&re(o.tabId,t.paneId))},o[22]=be,o[23]=re,o[24]=ne,o[25]=je):je=o[25];const Ke=je;let Be;o[26]!==Ke||o[27]!==Fe?(Be=n=>{const o=K(n.active.data.current),t=B(n.over?.data.current);pe(null),"workspace-tab"===o?.kind&&n.over&&("workspace-tab"===t?.kind?Fe({activeData:o,overData:t}):"split-pane-drop"===t?.kind&&Ke({activeData:o,overData:t})),ge(null),fe(null)},o[26]=Ke,o[27]=Fe,o[28]=Be):Be=o[28];const Ee=Be,Me=null!==ue;let _e,He,Le,Oe;o[29]!==ue||o[30]!==Y||o[31]!==h||o[32]!==be||o[33]!==v||o[34]!==f||o[35]!==l.focusedPaneId||o[36]!==b||o[37]!==T||o[38]!==U||o[39]!==k||o[40]!==E||o[41]!==M||o[42]!==w||o[43]!==S||o[44]!==R||o[45]!==Q||o[46]!==q||o[47]!==J||o[48]!==ee||o[49]!==y||o[50]!==x||o[51]!==z||o[52]!==A||o[53]!==ie||o[54]!==se||o[55]!==j||o[56]!==ne||o[57]!==te||o[58]!==F||o[59]!==ce||o[60]!==Re||o[61]!==C||o[62]!==X||o[63]!==Me||o[64]!==Te||o[65]!==I||o[66]!==p?(_e=(0,W.jsx)(G,{node:Re,workspaceKey:p,uiTabs:I,focusedPaneId:l.focusedPaneId,normalizedServerId:b,normalizedWorkspaceId:T,isWorkspaceFocused:f,hoveredCloseTabKey:v,setHoveredCloseTabKey:C,closingTabIds:h,onNavigateTab:y,onCloseTab:k,onCopyResumeCommand:R,onCopyAgentId:w,onCopyFilePath:S,onReloadAgent:x,onRenameAgent:z,onRenameTab:A,onTagAgent:F,onSetKanbanBucket:j,onCloseTabsToLeft:E,onCloseTabsToRight:M,onCloseOtherTabs:U,onCreateDraftTab:q,onCreateTerminalTab:J,onCreateBrowserTab:Q,showCreateBrowserTab:X,buildPaneContentModel:Y,onFocusPane:ee,onSplitPane:ne,onSplitPaneEmpty:te,onResizeSplit:se,onReorderTabsInPane:ie,renderPaneEmptyState:ce,activeDragTabId:ue,showDropZones:Me,dropPreview:be,tabDropPreview:Te}),o[29]=ue,o[30]=Y,o[31]=h,o[32]=be,o[33]=v,o[34]=f,o[35]=l.focusedPaneId,o[36]=b,o[37]=T,o[38]=U,o[39]=k,o[40]=E,o[41]=M,o[42]=w,o[43]=S,o[44]=R,o[45]=Q,o[46]=q,o[47]=J,o[48]=ee,o[49]=y,o[50]=x,o[51]=z,o[52]=A,o[53]=ie,o[54]=se,o[55]=j,o[56]=ne,o[57]=te,o[58]=F,o[59]=ce,o[60]=Re,o[61]=C,o[62]=X,o[63]=Me,o[64]=Te,o[65]=I,o[66]=p,o[67]=_e):_e=o[67];o[68]!==ue||o[69]!==b||o[70]!==T||o[71]!==I?(He=ue?(0,W.jsx)($,{tabId:ue,uiTabs:I,normalizedServerId:b,normalizedWorkspaceId:T}):null,o[68]=ue,o[69]=b,o[70]=T,o[71]=I,o[72]=He):He=o[72];o[73]!==He?(Le=(0,W.jsx)(c.DragOverlay,{dropAnimation:null,children:He}),o[73]=He,o[74]=Le):Le=o[74];o[75]!==Ee||o[76]!==me||o[77]!==_e||o[78]!==Le||o[79]!==We?(Oe=(0,W.jsx)(D.RenderProfile,{id:"SplitContainer",children:(0,W.jsxs)(c.DndContext,{sensors:me,collisionDetection:O,onDragStart:Se,onDragMove:We,onDragOver:We,onDragCancel:xe,onDragEnd:Ee,children:[_e,Le]})}),o[75]=Ee,o[76]=me,o[77]=_e,o[78]=Le,o[79]=We,o[80]=Oe):Oe=o[80];return Oe};var n=r(d[0]),o=r(d[1]),t=r(d[2]),s=r(d[3]),l=r(d[4]),c=r(d[5]),u=r(d[6]);r(d[7]),r(d[8]);var p=r(d[9]),b=r(d[10]),T=r(d[11]),f=r(d[12]),I=r(d[13]),v=r(d[14]),C=r(d[15]),h=r(d[16]),P=r(d[17]),y=r(d[18]),k=r(d[19]),R=r(d[20]),w=r(d[21]),S=r(d[22]),D=r(d[23]),x=r(d[24]),z=r(d[25]),W=r(d[26]);const A=(0,s.createContext)(!0);function F(n){return"object"==typeof n&&null!==n&&"workspace-tab"===Reflect.get(n,"kind")}function j(n){return"object"==typeof n&&null!==n&&"split-pane-drop"===Reflect.get(n,"kind")}function K(n){return F(n)?n:void 0}function B(n){return F(n)||j(n)?n:void 0}const E=(0,s.memo)(function(n){const s=(0,t.c)(23),{tabDescriptor:l,isVisible:c,isWorkspaceFocused:u,isPaneFocused:p,paneId:b,onFocusPane:T,buildPaneContentModel:f}=n;let I;s[0]!==f||s[1]!==b||s[2]!==l?(I=f({paneId:b,tab:l}),s[0]=f,s[1]=b,s[2]=l,s[3]=I):I=s[3];const v=I,C=c?"flex":"none";let h;s[4]!==C?(h={display:C,flex:1},s[4]=C,s[5]=h):h=s[5];const P=h;let y;s[6]!==T||s[7]!==b?(y=()=>{T(b)},s[6]=T,s[7]=b,s[8]=y):y=s[8];const R=y,w=`DesktopMountedTabSlot:${l.kind}:${l.tabId}`;let S,x,z,F;return s[9]!==v||s[10]!==R||s[11]!==p||s[12]!==u?(S=(0,W.jsx)(k.WorkspacePaneContent,{content:v,isWorkspaceFocused:u,isPaneFocused:p,onFocusPane:R}),s[9]=v,s[10]=R,s[11]=p,s[12]=u,s[13]=S):S=s[13],s[14]!==S||s[15]!==P?(x=(0,W.jsx)(o.View,{style:P,children:S}),s[14]=S,s[15]=P,s[16]=x):x=s[16],s[17]!==c||s[18]!==x?(z=(0,W.jsx)(A,{value:c,children:x}),s[17]=c,s[18]=x,s[19]=z):z=s[19],s[20]!==w||s[21]!==z?(F=(0,W.jsx)(D.RenderProfile,{id:w,children:z}),s[20]=w,s[21]=z,s[22]=F):F=s[22],F});function M(n){const o=(0,s.useRef)(new Map),t=(0,s.useMemo)(()=>{const t=new Map;for(const s of n){const n=o.current.get(s.tabId);n&&n.key===s.key&&n.kind===s.kind&&(0,x.workspaceTabTargetsEqual)(n.target,s.target)?t.set(s.tabId,n):t.set(s.tabId,s)}return t},[n]);return(0,s.useEffect)(()=>{o.current=t},[t]),t}function _(n){const o=n.active.rect.current.translated,t=n.over?.rect;return!o||!t||t.width<=0||t.height<=0?null:{translatedRect:o,overRect:t}}function H(n){const{activeData:o,overData:t,rects:s,panesById:l,uiTabs:c}=n,u=l.get(t.paneId)??null;if(!u)return null;const p=(0,P.getWorkspacePaneDescriptors)({pane:u,tabs:c});return(0,C.computeTabDropPreview)({activePaneId:o.paneId,activeTabId:o.tabId,overPaneId:t.paneId,overTabId:t.tabId,targetTabs:p,activeRect:{left:s.translatedRect.left,width:s.translatedRect.width},overRect:{left:s.overRect.left,width:s.overRect.width}})}function L(n){const{overData:o,rects:t}=n,s=t.translatedRect.left+t.translatedRect.width/2,l=t.translatedRect.top+t.translatedRect.height/2,c=s-t.overRect.left,u=l-t.overRect.top;return Number.isNaN(c)||Number.isNaN(u)||c<0||c>t.overRect.width||u<0||u>t.overRect.height?null:{paneId:o.paneId,position:(0,h.resolveSplitDropPosition)({width:t.overRect.width,height:t.overRect.height,x:c,y:u})}}const O=n=>{const o=(0,c.pointerWithin)(n),t=o.filter(n=>"workspace-tab"===n.data?.droppableContainer.data.current?.kind);if(t.length>0)return t;const s=o.filter(n=>"split-pane-drop"===n.data?.droppableContainer.data.current?.kind);return s.length>0?s:(0,c.closestCenter)(n)};function N(n){return n.tabId}function V(n){return n.tabId}function Z(){return null}function $(n){const o=(0,t.c)(11),{tabId:s,uiTabs:l,normalizedServerId:c,normalizedWorkspaceId:u}=n;let p;if(o[0]!==s||o[1]!==l){let n;o[3]!==s?(n=n=>n.tabId===s,o[3]=s,o[4]=n):n=o[4],p=l.find(n),o[0]=s,o[1]=l,o[2]=p}else p=o[2];const b=p;let T;o[5]!==b?(T=b?{key:b.tabId,tabId:b.tabId,kind:b.target.kind,target:b.target,createdAt:b.createdAt}:null,o[5]=b,o[6]=T):T=o[6];const f=T;if(!f)return null;let I;return o[7]!==f||o[8]!==c||o[9]!==u?(I=(0,W.jsx)(U,{tab:f,normalizedServerId:c,normalizedWorkspaceId:u}),o[7]=f,o[8]=c,o[9]=u,o[10]=I):I=o[10],I}function U(s){const l=(0,t.c)(14),{tab:c,normalizedServerId:u,normalizedWorkspaceId:T}=s,{t:f}=(0,p.useTranslation)(),{theme:I}=(0,b.useUnistyles)();let v;l[0]!==I.colors.borderAccent||l[1]!==I.colors.surface1?(v=[re.dragOverlayChip,{backgroundColor:I.colors.surface1,borderColor:I.colors.borderAccent}],l[0]=I.colors.borderAccent,l[1]=I.colors.surface1,l[2]=v):v=l[2];const C=v;let h;l[3]!==I.colors.foreground?(h=[re.dragOverlayLabel,{color:I.colors.foreground}],l[3]=I.colors.foreground,l[4]=h):h=l[4];const P=h;let y,k;return l[5]!==P||l[6]!==C||l[7]!==f?(y=t=>{const s="loading"===t.titleState?f("common.states.loading"):t.label;return(0,W.jsxs)(o.View,{style:C,children:[(0,W.jsx)(w.WorkspaceTabIcon,{presentation:t,active:!0,size:14}),(0,W.jsx)(n.Text,{numberOfLines:1,style:P,children:s})]})},l[5]=P,l[6]=C,l[7]=f,l[8]=y):y=l[8],l[9]!==u||l[10]!==T||l[11]!==y||l[12]!==c?(k=(0,W.jsx)(w.WorkspaceTabPresentationResolver,{tab:c,serverId:u,workspaceId:T,children:y}),l[9]=u,l[10]=T,l[11]=y,l[12]=c,l[13]=k):k=l[13],k}function q(n){const s=(0,t.c)(5),{flex:l,children:c}=n;let u;s[0]!==l?(u=[re.groupChild,{flex:l}],s[0]=l,s[1]=u):u=s[1];const p=u;let b;return s[2]!==p||s[3]!==c?(b=(0,W.jsx)(o.View,{style:p,children:c}),s[2]=p,s[3]=c,s[4]=b):b=s[4],b}function G(n){const l=(0,t.c)(129),{node:c,workspaceKey:u,uiTabs:p,focusedPaneId:b,normalizedServerId:f,normalizedWorkspaceId:I,isWorkspaceFocused:v,hoveredCloseTabKey:C,setHoveredCloseTabKey:h,closingTabIds:P,onNavigateTab:y,onCloseTab:k,onCopyResumeCommand:R,onCopyAgentId:w,onCopyFilePath:D,onReloadAgent:x,onRenameAgent:z,onRenameTab:A,onTagAgent:F,onSetKanbanBucket:j,onCloseTabsToLeft:K,onCloseTabsToRight:B,onCloseOtherTabs:E,onCreateDraftTab:M,onCreateTerminalTab:_,onCreateBrowserTab:H,showCreateBrowserTab:L,buildPaneContentModel:O,onFocusPane:N,onSplitPane:V,onSplitPaneEmpty:Z,onResizeSplit:$,onReorderTabsInPane:U,renderPaneEmptyState:Q,activeDragTabId:X,showDropZones:Y,dropPreview:ee,tabDropPreview:ne}=n,oe="group"===c.kind?c.group.id:null,ae="group"===c.kind?c.group.direction:null;let se;l[0]!==oe||l[1]!==u?(se=n=>oe?n.splitSizesByWorkspace[u]?.[oe]:void 0,l[0]=oe,l[1]=u,l[2]=se):se=l[2];const ie=(0,S.useWorkspaceLayoutStore)(se),de="horizontal"===ae?re.groupHorizontal:re.groupVertical;let le;l[3]!==de?(le=[re.group,de],l[3]=de,l[4]=le):le=l[4];const ce=le;if("pane"===c.kind){const n=c.pane.id===b;let o;return l[5]!==X||l[6]!==O||l[7]!==P||l[8]!==ee||l[9]!==C||l[10]!==v||l[11]!==c.pane||l[12]!==f||l[13]!==I||l[14]!==E||l[15]!==k||l[16]!==K||l[17]!==B||l[18]!==w||l[19]!==D||l[20]!==R||l[21]!==H||l[22]!==M||l[23]!==_||l[24]!==N||l[25]!==y||l[26]!==x||l[27]!==z||l[28]!==A||l[29]!==U||l[30]!==j||l[31]!==V||l[32]!==Z||l[33]!==F||l[34]!==Q||l[35]!==h||l[36]!==L||l[37]!==Y||l[38]!==n||l[39]!==ne||l[40]!==p?(o=(0,W.jsx)(J,{pane:c.pane,uiTabs:p,isFocused:n,normalizedServerId:f,normalizedWorkspaceId:I,isWorkspaceFocused:v,hoveredCloseTabKey:C,setHoveredCloseTabKey:h,closingTabIds:P,onNavigateTab:y,onCloseTab:k,onCopyResumeCommand:R,onCopyAgentId:w,onCopyFilePath:D,onReloadAgent:x,onRenameAgent:z,onRenameTab:A,onTagAgent:F,onSetKanbanBucket:j,onCloseTabsToLeft:K,onCloseTabsToRight:B,onCloseOtherTabs:E,onCreateDraftTab:M,onCreateTerminalTab:_,onCreateBrowserTab:H,showCreateBrowserTab:L,buildPaneContentModel:O,onFocusPane:N,onSplitPane:V,onSplitPaneEmpty:Z,onReorderTabsInPane:U,renderPaneEmptyState:Q,activeDragTabId:X,showDropZones:Y,dropPreview:ee,tabDropPreview:ne}),l[5]=X,l[6]=O,l[7]=P,l[8]=ee,l[9]=C,l[10]=v,l[11]=c.pane,l[12]=f,l[13]=I,l[14]=E,l[15]=k,l[16]=K,l[17]=B,l[18]=w,l[19]=D,l[20]=R,l[21]=H,l[22]=M,l[23]=_,l[24]=N,l[25]=y,l[26]=x,l[27]=z,l[28]=A,l[29]=U,l[30]=j,l[31]=V,l[32]=Z,l[33]=F,l[34]=Q,l[35]=h,l[36]=L,l[37]=Y,l[38]=n,l[39]=ne,l[40]=p,l[41]=o):o=l[41],o}const ue=ie??c.group.sizes;let pe,be;if(l[42]!==X||l[43]!==O||l[44]!==P||l[45]!==ee||l[46]!==b||l[47]!==ue||l[48]!==C||l[49]!==v||l[50]!==c.group.children||l[51]!==c.group.direction||l[52]!==c.group.id||l[53]!==f||l[54]!==I||l[55]!==E||l[56]!==k||l[57]!==K||l[58]!==B||l[59]!==w||l[60]!==D||l[61]!==R||l[62]!==H||l[63]!==M||l[64]!==_||l[65]!==N||l[66]!==y||l[67]!==x||l[68]!==z||l[69]!==A||l[70]!==U||l[71]!==$||l[72]!==j||l[73]!==V||l[74]!==Z||l[75]!==F||l[76]!==Q||l[77]!==h||l[78]!==L||l[79]!==Y||l[80]!==ne||l[81]!==p||l[82]!==u){let n;l[84]!==X||l[85]!==O||l[86]!==P||l[87]!==ee||l[88]!==b||l[89]!==ue||l[90]!==C||l[91]!==v||l[92]!==c.group.children.length||l[93]!==c.group.direction||l[94]!==c.group.id||l[95]!==f||l[96]!==I||l[97]!==E||l[98]!==k||l[99]!==K||l[100]!==B||l[101]!==w||l[102]!==D||l[103]!==R||l[104]!==H||l[105]!==M||l[106]!==_||l[107]!==N||l[108]!==y||l[109]!==x||l[110]!==z||l[111]!==A||l[112]!==U||l[113]!==$||l[114]!==j||l[115]!==V||l[116]!==Z||l[117]!==F||l[118]!==Q||l[119]!==h||l[120]!==L||l[121]!==Y||l[122]!==ne||l[123]!==p||l[124]!==u?(n=(n,o)=>(0,W.jsxs)(s.Fragment,{children:[(0,W.jsx)(q,{flex:ue[o]??1,children:(0,W.jsx)(G,{node:n,workspaceKey:u,uiTabs:p,focusedPaneId:b,normalizedServerId:f,normalizedWorkspaceId:I,isWorkspaceFocused:v,hoveredCloseTabKey:C,setHoveredCloseTabKey:h,closingTabIds:P,onNavigateTab:y,onCloseTab:k,onCopyResumeCommand:R,onCopyAgentId:w,onCopyFilePath:D,onReloadAgent:x,onRenameAgent:z,onRenameTab:A,onTagAgent:F,onSetKanbanBucket:j,onCloseTabsToLeft:K,onCloseTabsToRight:B,onCloseOtherTabs:E,onCreateDraftTab:M,onCreateTerminalTab:_,onCreateBrowserTab:H,showCreateBrowserTab:L,buildPaneContentModel:O,onFocusPane:N,onSplitPane:V,onSplitPaneEmpty:Z,onResizeSplit:$,onReorderTabsInPane:U,renderPaneEmptyState:Q,activeDragTabId:X,showDropZones:Y,dropPreview:ee,tabDropPreview:ne})}),o<c.group.children.length-1?(0,W.jsx)(T.ResizeHandle,{direction:c.group.direction,groupId:c.group.id,index:o,sizes:ue,onResizeSplit:$}):null]},te(n)),l[84]=X,l[85]=O,l[86]=P,l[87]=ee,l[88]=b,l[89]=ue,l[90]=C,l[91]=v,l[92]=c.group.children.length,l[93]=c.group.direction,l[94]=c.group.id,l[95]=f,l[96]=I,l[97]=E,l[98]=k,l[99]=K,l[100]=B,l[101]=w,l[102]=D,l[103]=R,l[104]=H,l[105]=M,l[106]=_,l[107]=N,l[108]=y,l[109]=x,l[110]=z,l[111]=A,l[112]=U,l[113]=$,l[114]=j,l[115]=V,l[116]=Z,l[117]=F,l[118]=Q,l[119]=h,l[120]=L,l[121]=Y,l[122]=ne,l[123]=p,l[124]=u,l[125]=n):n=l[125],pe=c.group.children.map(n),l[42]=X,l[43]=O,l[44]=P,l[45]=ee,l[46]=b,l[47]=ue,l[48]=C,l[49]=v,l[50]=c.group.children,l[51]=c.group.direction,l[52]=c.group.id,l[53]=f,l[54]=I,l[55]=E,l[56]=k,l[57]=K,l[58]=B,l[59]=w,l[60]=D,l[61]=R,l[62]=H,l[63]=M,l[64]=_,l[65]=N,l[66]=y,l[67]=x,l[68]=z,l[69]=A,l[70]=U,l[71]=$,l[72]=j,l[73]=V,l[74]=Z,l[75]=F,l[76]=Q,l[77]=h,l[78]=L,l[79]=Y,l[80]=ne,l[81]=p,l[82]=u,l[83]=pe}else pe=l[83];return l[126]!==ce||l[127]!==pe?(be=(0,W.jsx)(o.View,{style:ce,children:pe}),l[126]=ce,l[127]=pe,l[128]=be):be=l[128],be}function J(n){const c=(0,t.c)(103),{pane:u,uiTabs:p,isFocused:T,normalizedServerId:C,normalizedWorkspaceId:k,isWorkspaceFocused:w,hoveredCloseTabKey:S,setHoveredCloseTabKey:x,closingTabIds:A,onNavigateTab:F,onCloseTab:j,onCopyResumeCommand:K,onCopyAgentId:B,onCopyFilePath:_,onReloadAgent:H,onRenameAgent:L,onRenameTab:O,onTagAgent:N,onSetKanbanBucket:V,onCloseTabsToLeft:Z,onCloseTabsToRight:$,onCloseOtherTabs:U,onCreateDraftTab:q,onCreateTerminalTab:G,onCreateBrowserTab:J,showCreateBrowserTab:oe,buildPaneContentModel:te,onFocusPane:ae,onSplitPaneEmpty:se,onReorderTabsInPane:ie,renderPaneEmptyState:de,activeDragTabId:le,showDropZones:ce,dropPreview:ue,tabDropPreview:pe}=n;(0,b.useUnistyles)();const be=(0,s.useRef)(null),ge=(0,l.useStableEvent)(ae),Te=(0,I.useWindowControlsPadding)("tabRow");let fe;c[0]!==u||c[1]!==p?(fe=(0,P.deriveWorkspacePaneState)({pane:u,tabs:p}),c[0]=u,c[1]=p,c[2]=fe):fe=c[2];const Ie=fe;let ve;c[3]!==Ie.tabs?(ve=Ie.tabs.map(ne),c[3]=Ie.tabs,c[4]=ve):ve=c[4];const me=ve;let Ce;c[5]!==me?(Ce=me.map(ee),c[5]=me,c[6]=Ce):Ce=c[6];const he=Ce,Pe=M(me),ye=Ie.activeTab?.descriptor??null,ke=ye?.tabId??null;let Re;c[7]!==he||c[8]!==ke?(Re={activeTabId:ke,allTabIds:he,cap:3},c[7]=he,c[8]=ke,c[9]=Re):Re=c[9];const{mountedTabIds:we}=(0,y.useMountedTabSet)(Re);let Se;if(c[10]!==we||c[11]!==he){let n;c[13]!==we?(n=n=>we.has(n),c[13]=we,c[14]=n):n=c[14],Se=he.filter(n),c[10]=we,c[11]=he,c[12]=Se}else Se=c[12];const De=Se;let xe,ze;c[15]!==ye?.key||c[16]!==A||c[17]!==S||c[18]!==me?(xe=()=>me.map(n=>({tab:n,isActive:n.key===ye?.key,isCloseHovered:S===n.key,isClosingTab:A.has(n.tabId)})),c[15]=ye?.key,c[16]=A,c[17]=S,c[18]=me,c[19]=xe):xe=c[19],c[20]!==xe?(ze=xe(),c[20]=xe,c[21]=ze):ze=c[21];const We=ze;let Ae,Fe;c[22]!==u.id||c[23]!==ge?(Fe=()=>{if(z.isNative)return Y;const n=be.current;if(!(n instanceof HTMLElement))return X;const o=n,t=n=>{(0,f.shouldFocusPaneFromEventTarget)(n.target)&&ge(u.id)},s=n=>{(0,f.shouldFocusPaneFromEventTarget)(n.target)&&ge(u.id)};return o.addEventListener("pointerdown",t,!0),o.addEventListener("focusin",s,!0),()=>{o.removeEventListener("pointerdown",t,!0),o.removeEventListener("focusin",s,!0)}},Ae=[ge,u.id],c[22]=u.id,c[23]=ge,c[24]=Ae,c[25]=Fe):(Ae=c[24],Fe=c[25]),(0,s.useEffect)(Fe,Ae);const je=u.id;let Ke;c[26]!==Z||c[27]!==me?(Ke=n=>Z(n,me),c[26]=Z,c[27]=me,c[28]=Ke):Ke=c[28];const Be=Ke;let Ee;c[29]!==$||c[30]!==me?(Ee=n=>$(n,me),c[29]=$,c[30]=me,c[31]=Ee):Ee=c[31];const Me=Ee;let _e;c[32]!==U||c[33]!==me?(_e=n=>U(n,me),c[32]=U,c[33]=me,c[34]=_e):_e=c[34];const He=_e;let Le;c[35]!==ie||c[36]!==je?(Le=n=>{ie(je,n.map(Q))},c[35]=ie,c[36]=je,c[37]=Le):Le=c[37];const Oe=Le;let Ne;c[38]!==se||c[39]!==je?(Ne=()=>se({targetPaneId:je,position:"right"}),c[38]=se,c[39]=je,c[40]=Ne):Ne=c[40];const Ve=Ne;let Ze;c[41]!==se||c[42]!==je?(Ze=()=>se({targetPaneId:je,position:"bottom"}),c[41]=se,c[42]=je,c[43]=Ze):Ze=c[43];const $e=Ze;let Ue;c[44]!==Te.left||c[45]!==Te.right?(Ue=[re.paneTabs,{paddingLeft:Te.left,paddingRight:Te.right}],c[44]=Te.left,c[45]=Te.right,c[46]=Ue):Ue=c[46];const qe=Ue,Ge=`SplitPaneView:${u.id}`;let Je;c[47]===Symbol.for("react.memo_cache_sentinel")?(Je=(0,W.jsx)(v.TitlebarDragRegion,{}),c[47]=Je):Je=c[47];const Qe=pe?.paneId===u.id?pe.indicatorIndex:null;let Xe,Ye,en,nn,on,tn,an;return c[48]!==le||c[49]!==We||c[50]!==He||c[51]!==Be||c[52]!==Me||c[53]!==Oe||c[54]!==$e||c[55]!==Ve||c[56]!==T||c[57]!==C||c[58]!==k||c[59]!==j||c[60]!==B||c[61]!==_||c[62]!==K||c[63]!==J||c[64]!==q||c[65]!==G||c[66]!==F||c[67]!==H||c[68]!==L||c[69]!==O||c[70]!==V||c[71]!==N||c[72]!==u.id||c[73]!==x||c[74]!==oe||c[75]!==Qe?(Xe=(0,W.jsx)(R.WorkspaceDesktopTabsRow,{paneId:u.id,isFocused:T,tabs:We,normalizedServerId:C,normalizedWorkspaceId:k,setHoveredCloseTabKey:x,onNavigateTab:F,onCloseTab:j,onCopyResumeCommand:K,onCopyAgentId:B,onCopyFilePath:_,onReloadAgent:H,onRenameAgent:L,onRenameTab:O,onTagAgent:N,onSetKanbanBucket:V,onCloseTabsToLeft:Be,onCloseTabsToRight:Me,onCloseOtherTabs:He,onCreateDraftTab:q,onCreateTerminalTab:G,onCreateBrowserTab:J,showCreateBrowserTab:oe,onReorderTabs:Oe,onSplitRight:Ve,onSplitDown:$e,externalDndContext:!0,activeDragTabId:le,tabDropPreviewIndex:Qe}),c[48]=le,c[49]=We,c[50]=He,c[51]=Be,c[52]=Me,c[53]=Oe,c[54]=$e,c[55]=Ve,c[56]=T,c[57]=C,c[58]=k,c[59]=j,c[60]=B,c[61]=_,c[62]=K,c[63]=J,c[64]=q,c[65]=G,c[66]=F,c[67]=H,c[68]=L,c[69]=O,c[70]=V,c[71]=N,c[72]=u.id,c[73]=x,c[74]=oe,c[75]=Qe,c[76]=Xe):Xe=c[76],c[77]!==qe||c[78]!==Xe?(Ye=(0,W.jsxs)(o.View,{style:qe,children:[Je,Xe]}),c[77]=qe,c[78]=Xe,c[79]=Ye):Ye=c[79],c[80]!==ye?.tabId||c[81]!==te||c[82]!==T||c[83]!==w||c[84]!==De||c[85]!==u.id||c[86]!==de||c[87]!==ge||c[88]!==Pe?(en=De.length>0?De.map(n=>{const o=Pe.get(n);return o?(0,W.jsx)(E,{tabDescriptor:o,isVisible:n===ye?.tabId,isWorkspaceFocused:w,isPaneFocused:T&&n===ye?.tabId,paneId:u.id,onFocusPane:ge,buildPaneContentModel:te},n):null}):de?.()??null,c[80]=ye?.tabId,c[81]=te,c[82]=T,c[83]=w,c[84]=De,c[85]=u.id,c[86]=de,c[87]=ge,c[88]=Pe,c[89]=en):en=c[89],c[90]!==ue||c[91]!==u.id||c[92]!==ce?(nn=(0,W.jsx)(h.SplitDropZone,{paneId:u.id,active:ce,preview:ue}),c[90]=ue,c[91]=u.id,c[92]=ce,c[93]=nn):nn=c[93],c[94]!==en||c[95]!==nn?(on=(0,W.jsxs)(o.View,{style:re.paneContent,children:[en,nn]}),c[94]=en,c[95]=nn,c[96]=on):on=c[96],c[97]!==Ye||c[98]!==on?(tn=(0,W.jsxs)(o.View,{ref:be,collapsable:!1,style:re.pane,children:[Ye,on]}),c[97]=Ye,c[98]=on,c[99]=tn):tn=c[99],c[100]!==Ge||c[101]!==tn?(an=(0,W.jsx)(D.RenderProfile,{id:Ge,children:tn}),c[100]=Ge,c[101]=tn,c[102]=an):an=c[102],an}function Q(n){return n.tabId}function X(){}function Y(){}function ee(n){return n.tabId}function ne(n){return n.descriptor}function oe(n){const o=new Map;return(function n(t){if("pane"!==t.kind)for(const o of t.group.children)n(o);else o.set(t.pane.id,t.pane)})(n),o}function te(n){return"pane"===n.kind?n.pane.id:n.group.id}function ae(n){return"group"===n.kind?n:{kind:"group",group:{id:`root:${n.pane.id}`,direction:"horizontal",children:[n],sizes:[1]}}}const re=b.StyleSheet.create(n=>({group:{flex:1,minWidth:0,minHeight:0},groupHorizontal:{flexDirection:"row"},groupVertical:{flexDirection:"column"},groupChild:{flexBasis:0,minWidth:0,minHeight:0},pane:{position:"relative",flex:1,minWidth:0,minHeight:0,backgroundColor:n.colors.surface0,overflow:"hidden",uni__dependencies:[0]},paneTabs:{position:"relative",minWidth:0},paneContent:{position:"relative",flex:1,minWidth:0,minHeight:0},dragOverlayChip:{flexDirection:"row",alignItems:"center",gap:n.spacing[2],paddingHorizontal:n.spacing[3],paddingVertical:n.spacing[1],borderRadius:n.borderRadius.md,borderWidth:1,maxWidth:200,uni__dependencies:[0]},dragOverlayLabel:{fontSize:n.fontSize.sm,flexShrink:1,uni__dependencies:[0]}}))},4455,[711,348,349,36,3523,3661,3664,146,234,1573,56,4456,4458,3607,3568,4459,4460,4461,4463,4464,4592,4547,3436,4520,3439,3407,279]);
|
|
16111
16111
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.ResizeHandle=function(p){const z=(0,n.c)(35),{direction:w,groupId:f,index:v,sizes:b,onResizeSplit:y}=p,{theme:S}=(0,l.useUnistyles)();let E;z[0]===Symbol.for("react.memo_cache_sentinel")?(E=new Map,z[0]=E):E=z[0];const _=(0,o.useRef)(E),V=(0,o.useRef)(null),x=(0,o.useRef)(null),[H,P]=(0,o.useState)(!1),[R,A]=(0,o.useState)(!1),L=H||R;let C;z[1]!==w||z[2]!==f||z[3]!==v||z[4]!==y||z[5]!==b?(C=t=>{const n=t.currentTarget;if(!n)return;const o=n.parentElement?.parentElement??null;if(!o)return;const l=o.getBoundingClientRect(),s="horizontal"===w?l.width:l.height;if(s<=0)return;const u=t.nativeEvent.pointerId;if(_.current.has(u))return;A(!0),_.current.set(u,{containerSize:s,pointerStart:"horizontal"===w?t.nativeEvent.clientX:t.nativeEvent.clientY}),1===_.current.size&&(V.current=document.body.style.cursor);const p="horizontal"===w?"col-resize":"row-resize";document.body.style.cursor=p,t.preventDefault(),t.stopPropagation();const z=n;z.setPointerCapture?.(u),h();function S(t){if(t.pointerId!==u)return;const n=_.current.get(u);if(!n)return;t.preventDefault(),h();const o=(("horizontal"===w?t.clientX:t.clientY)-n.pointerStart)/n.containerSize;y(f,(0,c.computeResizeHandleSizes)({sizes:b,index:v,deltaRatio:o}))}function E(t){t.pointerId===u&&(_.current.delete(u),A(_.current.size>0),0===_.current.size&&(document.body.style.cursor=V.current??"",V.current=null),z.hasPointerCapture?.(u)&&z.releasePointerCapture(u),h(),window.removeEventListener("pointermove",S),window.removeEventListener("pointerup",E),window.removeEventListener("pointercancel",E))}window.addEventListener("pointermove",S),window.addEventListener("pointerup",E),window.addEventListener("pointercancel",E)},z[1]=w,z[2]=f,z[3]=v,z[4]=y,z[5]=b,z[6]=C):C=z[6];const I=C;let j;z[7]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{x.current=setTimeout(()=>{P(!0)},150)},z[7]=j):j=z[7];const T=j;let k;z[8]===Symbol.for("react.memo_cache_sentinel")?(k=()=>{x.current&&(clearTimeout(x.current),x.current=null),P(!1)},z[8]=k):k=z[8];const D=k,X="horizontal"===w?u.handleHorizontal:u.handleVertical;let Y,M;z[9]!==S.colors.border?(Y={backgroundColor:S.colors.border},z[9]=S.colors.border,z[10]=Y):Y=z[10];z[11]!==X||z[12]!==Y?(M=[u.handle,X,Y],z[11]=X,z[12]=Y,z[13]=M):M=z[13];const B=M,O="horizontal"===w?u.highlightHorizontal:u.highlightVertical;let U,q;z[14]!==S.colors.accent?(U={backgroundColor:S.colors.accent},z[14]=S.colors.accent,z[15]=U):U=z[15];z[16]!==O||z[17]!==U?(q=[u.highlight,O,U],z[16]=O,z[17]=U,z[18]=q):q=z[18];const F=q,G="horizontal"===w?u.hitAreaHorizontal:u.hitAreaVertical,J="horizontal"===w?"col-resize":"row-resize";let K;z[19]!==J?(K={cursor:J,touchAction:"none"},z[19]=J,z[20]=K):K=z[20];const N=K;let Q;z[21]!==G||z[22]!==N?(Q=[u.hitArea,G,N],z[21]=G,z[22]=N,z[23]=Q):Q=z[23];const W=Q;let Z;z[24]!==F||z[25]!==L?(Z=L&&(0,s.jsx)(t.View,{pointerEvents:"none",style:F}),z[24]=F,z[25]=L,z[26]=Z):Z=z[26];const $="horizontal"===w?"vertical":"horizontal";let ee,te;z[27]!==I||z[28]!==W||z[29]!==$?(ee=(0,s.jsx)(t.View,{role:"separator","aria-orientation":$,style:W,onPointerDown:I,onPointerEnter:T,onPointerLeave:D}),z[27]=I,z[28]=W,z[29]=$,z[30]=ee):ee=z[30];z[31]!==B||z[32]!==Z||z[33]!==ee?(te=(0,s.jsxs)(t.View,{style:B,children:[Z,ee]}),z[31]=B,z[32]=Z,z[33]=ee,z[34]=te):te=z[34];return te};var t=r(d[0]),n=r(d[1]),o=r(d[2]);r(d[3]);var l=r(d[4]),c=r(d[5]),s=r(d[6]);function h(){0!==window.scrollX&&window.scrollTo(0,window.scrollY)}const u=l.StyleSheet.create(t=>({handle:{position:"relative",flexShrink:0},handleHorizontal:{width:1,alignSelf:"stretch"},handleVertical:{height:1,width:"100%"},highlight:{position:"absolute",zIndex:5},highlightHorizontal:{top:0,bottom:0,width:3,left:-1},highlightVertical:{left:0,right:0,height:3,top:-1},hitArea:{position:"absolute",zIndex:10},hitAreaHorizontal:{left:-5,top:0,bottom:0,width:10},hitAreaVertical:{top:-5,left:0,right:0,height:10}}))},4456,[348,349,36,146,56,4457,279]);
|
|
@@ -16383,159 +16383,160 @@ __d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{v
|
|
|
16383
16383
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.ImportSessionSheet=function(y){const w=(0,n.c)(134),{visible:S,client:j,serverId:R,cwd:C,onClose:U,onImportedAgent:W,onImported:B}=y,{t:Q}=(0,u.useTranslation)(),O=(0,c.useQueryClient)(),{theme:$}=(0,f.useUnistyles)();let q;w[0]!==C||w[1]!==S?(q={cwd:C,enabled:S},w[0]=C,w[1]=S,w[2]=q):q=w[2];const{entries:K,supportsSnapshot:N}=(0,v.useProvidersSnapshot)(R,q);let G;w[3]!==K||w[4]!==N?(G=(0,_.resolveProvidersToFetch)(N,K),w[3]=K,w[4]=N,w[5]=G):G=w[5];const J=G;let X;w[6]!==K?(X=(0,_.buildProviderLabelMap)(K),w[6]=K,w[7]=X):X=w[7];const Y=X,Z=C??null;let ee;w[8]!==Z?(ee=["recent-provider-sessions",Z],w[8]=Z,w[9]=ee):ee=w[9];const te=ee;let oe;w[10]!==j||w[11]!==C||w[12]!==J||w[13]!==te||w[14]!==Q||w[15]!==S?(oe=L({providersToFetch:J,sessionsQueryRoot:te,visible:S,client:j,cwd:C,hostDisconnectedMessage:Q("workspace.terminal.hostDisconnected")}),w[10]=j,w[11]=C,w[12]=J,w[13]=te,w[14]=Q,w[15]=S,w[16]=oe):oe=w[16];const se=oe;let re;w[17]!==se?(re={queries:se},w[17]=se,w[18]=re):re=w[18];const ne=(0,c.useQueries)(re);let ie;w[19]!==ne?(ie=(0,_.aggregateSessionEntries)(ne),w[19]=ne,w[20]=ie):ie=w[20];const le=ie;let de;w[21]!==ne?(de=(0,_.sumFilteredAlreadyImportedCount)(ne),w[21]=ne,w[22]=de):de=w[22];const ce=de;let ae;w[23]!==J?(ae=[...J??[]].sort(),w[23]=J,w[24]=ae):ae=w[24];const ue=ae,[ge,pe]=(0,l.useState)(_.ALL_FILTER_VALUE),[fe,he]=(0,l.useState)(!1),me=(0,l.useRef)(null);let ye,xe,be;w[25]!==ue||w[26]!==ge||w[27]!==S?(ye=()=>{S&&(ge===_.ALL_FILTER_VALUE||ue.includes(ge))||pe(_.ALL_FILTER_VALUE)},xe=[S,ue,ge],w[25]=ue,w[26]=ge,w[27]=S,w[28]=ye,w[29]=xe):(ye=w[28],xe=w[29]);(0,l.useEffect)(ye,xe);e:{if(ge===_.ALL_FILTER_VALUE){be=le;break e}let t;if(w[30]!==le||w[31]!==ge){let o;w[33]!==ge?(o=t=>t.providerId===ge,w[33]=ge,w[34]=o):o=w[34],t=le.filter(o),w[30]=le,w[31]=ge,w[32]=t}else t=w[32];be=t}const we=be;let ve,Se,_e;w[35]!==Q?(ve=Q("importSession.filters.all"),w[35]=Q,w[36]=ve):ve=w[36];w[37]!==ve?(Se={id:_.ALL_FILTER_VALUE,label:ve},w[37]=ve,w[38]=Se):Se=w[38];if(w[39]!==ue||w[40]!==Y||w[41]!==Se){let t;w[43]!==Y?(t=t=>({id:t,label:Y.get(t)??t}),w[43]=Y,w[44]=t):t=w[44],_e=[Se,...ue.map(t)],w[39]=ue,w[40]=Y,w[41]=Se,w[42]=_e}else _e=w[42];const Ie=_e;let Te;w[45]!==Ie||w[46]!==ge||w[47]!==Q?(Te=Ie.find(t=>t.id===ge)?.label??Q("importSession.filters.all"),w[45]=Ie,w[46]=ge,w[47]=Q,w[48]=Te):Te=w[48];const je=Te;let Le;w[49]===Symbol.for("react.memo_cache_sentinel")?(Le=()=>he(!0),w[49]=Le):Le=w[49];const Pe=Le,Me=D;let Re;w[50]===Symbol.for("react.memo_cache_sentinel")?(Re=t=>{pe(t),he(!1)},w[50]=Re):Re=w[50];const ze=Re;let Ee;if(w[51]!==ue||w[52]!==$.colors.foregroundMuted){let t;Ee=new Map,w[54]!==$.colors.foregroundMuted?(t=(0,I.jsx)(p.Layers,{size:14,color:$.colors.foregroundMuted}),w[54]=$.colors.foregroundMuted,w[55]=t):t=w[55],Ee.set(_.ALL_FILTER_VALUE,t);for(const t of ue){const o=(0,b.getProviderIcon)(t);Ee.set(t,(0,I.jsx)(o,{size:14,color:$.colors.foregroundMuted}))}w[51]=ue,w[52]=$.colors.foregroundMuted,w[53]=Ee}else Ee=w[53];const Ce=Ee;let Ae;w[56]!==Ce?(Ae=t=>{const{option:o,selected:s,active:n,onPress:l}=t;return(0,I.jsx)(x.ComboboxItem,{label:o.label,selected:s,active:n,onPress:l,leadingSlot:Ce.get(o.id)})},w[56]=Ce,w[57]=Ae):Ae=w[57];const Ve=Ae;let He,Fe,De;w[58]!==j||w[59]!==Q?(He=async t=>{if(!j)throw new Error(Q("workspace.terminal.hostDisconnected"));if(!t.cwd)throw new Error("Session is missing a working directory");return await j.importAgent({providerId:t.providerId,providerHandleId:t.providerHandleId,cwd:t.cwd})},w[58]=j,w[59]=Q,w[60]=He):He=w[60];w[61]!==U||w[62]!==B||w[63]!==W||w[64]!==O||w[65]!==te?(Fe=async t=>{await O.invalidateQueries({queryKey:te}),U(),W?.(t.id),B?.(t)},w[61]=U,w[62]=B,w[63]=W,w[64]=O,w[65]=te,w[66]=Fe):Fe=w[66];w[67]!==He||w[68]!==Fe?(De={mutationFn:He,onSuccess:Fe},w[67]=He,w[68]=Fe,w[69]=De):De=w[69];const ke=(0,c.useMutation)(De),Ue=ke.isPending&&ke.variables?`${ke.variables.providerId}:${ke.variables.providerHandleId}`:null;let We;w[70]!==ke?(We=t=>{ke.mutate(t)},w[70]=ke,w[71]=We):We=w[71];const Be=We;let Qe;w[72]!==Y||w[73]!==J||w[74]!==ne?(Qe=(0,_.collectErroredProviderLabels)(J,ne,Y),w[72]=Y,w[73]=J,w[74]=ne,w[75]=Qe):Qe=w[75];const Oe=Qe;let $e;w[76]!==ne?($e=ne.some(F),w[76]=ne,w[77]=$e):$e=w[77];const qe=$e;let Ke;w[78]!==O||w[79]!==te?(Ke=()=>{O.invalidateQueries({queryKey:te})},w[78]=O,w[79]=te,w[80]=Ke):Ke=w[80];const Ne=Ke;let Ge,Je,Xe;w[81]!==Q?(Ge=Q("importSession.title"),w[81]=Q,w[82]=Ge):Ge=w[82];w[83]!==Ne||w[84]!==qe?(Je=(0,I.jsx)(M,{isRefreshing:qe,onPress:Ne}),w[83]=Ne,w[84]=qe,w[85]=Je):Je=w[85];w[86]!==Ge||w[87]!==Je?(Xe={title:Ge,actions:Je},w[86]=Ge,w[87]=Je,w[88]=Xe):Xe=w[88];const Ye=Xe,Ze=!N,et=N&&void 0===K,tt=null!==J&&0===J.length,ot=ne.length>0;let st,rt,nt;if(w[89]!==le.length||w[90]!==ot||w[91]!==et||w[92]!==Y||w[93]!==ne||w[94]!==ge||w[95]!==ce||w[96]!==we.length){rt=et||ot&&ne.some(H),st=ot&&ne.every(V);const t=ot&&ne.every(A);nt=(0,_.computeEmptyState)({isLoadingSessions:rt,allQueriesErrored:st,isQueryingProviders:ot,allQueriesSettled:t,selectedProvider:ge,aggregatedCount:le.length,visibleCount:we.length,totalAlreadyImportedCount:ce,providerLabelById:Y}),w[89]=le.length,w[90]=ot,w[91]=et,w[92]=Y,w[93]=ne,w[94]=ge,w[95]=ce,w[96]=we.length,w[97]=st,w[98]=rt,w[99]=nt}else st=w[97],rt=w[98],nt=w[99];const{showEmptyState:it,emptyStateTitle:lt}=nt,dt=ue.length>1;let ct;w[100]!==Ie||w[101]!==fe||w[102]!==Ve||w[103]!==ge||w[104]!==je||w[105]!==dt||w[106]!==$?(ct=dt?(0,I.jsxs)(t.View,{ref:me,collapsable:!1,style:k.filterTriggerWrap,children:[(0,I.jsxs)(s.Pressable,{onPress:Pe,style:Me,testID:"import-session-filter-trigger",accessibilityRole:"button",accessibilityLabel:`Filter: ${je}`,children:[ge===_.ALL_FILTER_VALUE?(0,I.jsx)(p.Layers,{size:14,color:$.colors.foregroundMuted}):(()=>{const t=(0,b.getProviderIcon)(ge);return(0,I.jsx)(t,{size:14,color:$.colors.foregroundMuted})})(),(0,I.jsx)(o.Text,{style:k.filterTriggerText,numberOfLines:1,children:je}),(0,I.jsx)(p.ChevronDown,{size:14,color:$.colors.foregroundMuted})]}),(0,I.jsx)(x.Combobox,{options:Ie,value:ge,onSelect:ze,renderOption:Ve,searchable:!1,title:"Filter by provider",open:fe,onOpenChange:he,anchorRef:me,desktopPlacement:"bottom-start",desktopPreventInitialFlash:!0})]}):null,w[100]=Ie,w[101]=fe,w[102]=Ve,w[103]=ge,w[104]=je,w[105]=dt,w[106]=$,w[107]=ct):ct=w[107];const at=Boolean(j),ut=we.length>0;let gt,pt,ft,ht;w[108]!==st||w[109]!==Oe||w[110]!==tt||w[111]!==ke.isError||w[112]!==rt||w[113]!==Ze||w[114]!==at||w[115]!==ut?(gt=(0,I.jsx)(P,{isClientReady:at,isSnapshotUnsupported:Ze,hasNoImportableProviders:tt,isLoadingSessions:rt,hasRows:ut,allQueriesErrored:st,erroredProviderLabels:Oe,importErrored:ke.isError}),w[108]=st,w[109]=Oe,w[110]=tt,w[111]=ke.isError,w[112]=rt,w[113]=Ze,w[114]=at,w[115]=ut,w[116]=gt):gt=w[116];w[117]!==C||w[118]!==Be||w[119]!==ke.isPending||w[120]!==Ue||w[121]!==we?(pt=we.length>0?(0,I.jsx)(t.View,{style:k.list,children:we.map(t=>(0,I.jsx)(E,{entry:t,disabled:ke.isPending,importing:Ue===`${t.providerId}:${t.providerHandleId}`,showCwd:!C,onImportSession:Be},`${t.providerId}:${t.providerHandleId}`))}):null,w[117]=C,w[118]=Be,w[119]=ke.isPending,w[120]=Ue,w[121]=we,w[122]=pt):pt=w[122];w[123]!==lt||w[124]!==it?(ft=it?(0,I.jsx)(z,{title:lt}):null,w[123]=lt,w[124]=it,w[125]=ft):ft=w[125];w[126]!==Ye||w[127]!==U||w[128]!==ct||w[129]!==gt||w[130]!==pt||w[131]!==ft||w[132]!==S?(ht=(0,I.jsxs)(h.AdaptiveModalSheet,{visible:S,onClose:U,header:Ye,testID:"import-session-sheet",desktopMaxWidth:560,snapPoints:T,children:[ct,gt,pt,ft]}),w[126]=Ye,w[127]=U,w[128]=ct,w[129]=gt,w[130]=pt,w[131]=ft,w[132]=S,w[133]=ht):ht=w[133];return ht};var t=r(d[0]),o=r(d[1]),s=r(d[2]),n=r(d[3]),l=r(d[4]);r(d[5]),r(d[6]),r(d[7]);var c=r(d[8]),u=r(d[9]),p=r(d[10]),f=r(d[11]),h=r(d[12]),y=r(d[13]),x=r(d[14]),b=r(d[15]),w=r(d[16]),v=r(d[17]),S=r(d[18]),_=r(d[19]),I=r(d[20]);const T=["70%","92%"],j={disabled:!0};function L(t){const{providersToFetch:o,sessionsQueryRoot:s,visible:n,client:l,cwd:c,hostDisconnectedMessage:u}=t;if(null===o)return[];const p=n&&Boolean(l);return o.map(t=>({queryKey:[...s,t],enabled:p,queryFn:async()=>{if(!l)throw new Error(u??S.i18n.t("workspace.terminal.hostDisconnected"));return await l.fetchRecentProviderSessions(Object.assign({},c?{cwd:c}:{},{providers:[t],limit:_.PER_PROVIDER_LIMIT}))}}))}function P(s){const l=(0,n.c)(32),{isClientReady:c,isSnapshotUnsupported:p,hasNoImportableProviders:h,isLoadingSessions:x,hasRows:b,allQueriesErrored:w,erroredProviderLabels:v,importErrored:S}=s,{theme:_}=(0,f.useUnistyles)(),{t:T}=(0,u.useTranslation)();if(!c){let t,s;return l[0]!==T?(t=T("importSession.status.connectHost"),l[0]=T,l[1]=t):t=l[1],l[2]!==t?(s=(0,I.jsx)(o.Text,{style:k.statusText,children:t}),l[2]=t,l[3]=s):s=l[3],s}if(p){let t,s;return l[4]!==T?(t=T("importSession.status.updateHost"),l[4]=T,l[5]=t):t=l[5],l[6]!==t?(s=(0,I.jsx)(o.Text,{style:k.statusText,children:t}),l[6]=t,l[7]=s):s=l[7],s}let j,L,P,M,R,z;return l[8]!==h||l[9]!==T?(j=h?(0,I.jsx)(o.Text,{style:k.statusText,children:T("importSession.status.noProviders")}):null,l[8]=h,l[9]=T,l[10]=j):j=l[10],l[11]!==b||l[12]!==x||l[13]!==T||l[14]!==_?(L=x&&!b?(0,I.jsxs)(t.View,{style:k.statusRow,children:[(0,I.jsx)(y.LoadingSpinner,{color:_.colors.foregroundMuted}),(0,I.jsx)(o.Text,{style:k.statusText,children:T("importSession.status.loading")})]}):null,l[11]=b,l[12]=x,l[13]=T,l[14]=_,l[15]=L):L=l[15],l[16]!==w||l[17]!==T?(P=w?(0,I.jsx)(o.Text,{style:k.statusText,children:T("importSession.status.failedAll")}):null,l[16]=w,l[17]=T,l[18]=P):P=l[18],l[19]!==w||l[20]!==v||l[21]!==T?(M=!w&&v.length>0?(0,I.jsx)(o.Text,{style:k.statusText,children:T("importSession.status.failedProviders",{providers:v.join(", ")})}):null,l[19]=w,l[20]=v,l[21]=T,l[22]=M):M=l[22],l[23]!==S||l[24]!==T?(R=S?(0,I.jsx)(o.Text,{style:k.statusText,children:T("importSession.status.failedImport")}):null,l[23]=S,l[24]=T,l[25]=R):R=l[25],l[26]!==j||l[27]!==L||l[28]!==P||l[29]!==M||l[30]!==R?(z=(0,I.jsxs)(I.Fragment,{children:[j,L,P,M,R]}),l[26]=j,l[27]=L,l[28]=P,l[29]=M,l[30]=R,l[31]=z):z=l[31],z}function M(o){const l=(0,n.c)(10),{isRefreshing:c,onPress:h}=o,{theme:x}=(0,f.useUnistyles)(),{t:b}=(0,u.useTranslation)(),w=R;let v,S,_;return l[0]!==b?(v=b("importSession.actions.refresh"),l[0]=b,l[1]=v):v=l[1],l[2]!==c||l[3]!==x.colors.foregroundMuted?(S=(0,I.jsx)(t.View,{style:k.refreshIconSlot,children:c?(0,I.jsx)(y.LoadingSpinner,{color:x.colors.foregroundMuted}):(0,I.jsx)(p.RotateCw,{size:16,color:x.colors.foregroundMuted})}),l[2]=c,l[3]=x.colors.foregroundMuted,l[4]=S):S=l[4],l[5]!==c||l[6]!==h||l[7]!==v||l[8]!==S?(_=(0,I.jsx)(s.Pressable,{onPress:h,disabled:c,accessibilityLabel:v,accessibilityRole:"button",testID:"import-session-refresh",style:w,children:S}),l[5]=c,l[6]=h,l[7]=v,l[8]=S,l[9]=_):_=l[9],_}function R(t){const{pressed:o}=t;return[k.refreshButton,o&&k.refreshButtonPressed]}function z(s){const l=(0,n.c)(8),{title:c}=s,{theme:u}=(0,f.useUnistyles)();let h,y,x;return l[0]!==u.colors.foregroundMuted||l[1]!==u.iconSize.lg?(h=(0,I.jsx)(t.View,{style:k.emptyStateIcon,children:(0,I.jsx)(p.Inbox,{size:u.iconSize.lg,color:u.colors.foregroundMuted,strokeWidth:1.5})}),l[0]=u.colors.foregroundMuted,l[1]=u.iconSize.lg,l[2]=h):h=l[2],l[3]!==c?(y=(0,I.jsx)(o.Text,{style:k.emptyStateTitle,children:c}),l[3]=c,l[4]=y):y=l[4],l[5]!==h||l[6]!==y?(x=(0,I.jsxs)(t.View,{style:k.emptyState,testID:"import-session-empty-state",children:[h,y]}),l[5]=h,l[6]=y,l[7]=x):x=l[7],x}function E(l){const c=(0,n.c)(42),{entry:p,disabled:h,importing:y,showCwd:x,onImportSession:v}=l,{theme:S}=(0,f.useUnistyles)(),{t:T}=(0,u.useTranslation)();let L;c[0]!==p?(L=(0,_.getSessionTitle)(p),c[0]=p,c[1]=L):L=c[1];const P=L;let M;c[2]!==p?(M=(0,_.getPromptPreview)(p),c[2]=p,c[3]=M):M=c[3];const R=M;let z;c[4]!==p.lastActivityAt?(z=(0,w.formatTimeAgo)(new Date(p.lastActivityAt)),c[4]=p.lastActivityAt,c[5]=z):z=c[5];const E=z;let A;c[6]!==p.providerId?(A=(0,b.getProviderIcon)(p.providerId),c[6]=p.providerId,c[7]=A):A=c[7];const V=A,H=h?j:void 0;let F;c[8]!==p||c[9]!==v?(F=()=>{v(p)},c[8]=p,c[9]=v,c[10]=F):F=c[10];const D=F,U=C,W=`import-session-session-${p.providerId}-${p.providerHandleId}`;let B,Q,O,$,q,K,N,G,J;return c[11]!==V||c[12]!==S.colors.foregroundMuted||c[13]!==S.iconSize.md?(B=(0,I.jsx)(t.View,{style:k.rowIconWrap,children:(0,I.jsx)(V,{size:S.iconSize.md,color:S.colors.foregroundMuted})}),c[11]=V,c[12]=S.colors.foregroundMuted,c[13]=S.iconSize.md,c[14]=B):B=c[14],c[15]!==P?(Q=(0,I.jsx)(o.Text,{style:k.rowTitle,numberOfLines:1,children:P}),c[15]=P,c[16]=Q):Q=c[16],c[17]!==y||c[18]!==E||c[19]!==T?(O=y?T("importSession.row.importing"):E,c[17]=y,c[18]=E,c[19]=T,c[20]=O):O=c[20],c[21]!==O?($=(0,I.jsx)(o.Text,{style:k.rowMeta,children:O}),c[21]=O,c[22]=$):$=c[22],c[23]!==$||c[24]!==Q?(q=(0,I.jsxs)(t.View,{style:k.rowHeader,children:[Q,$]}),c[23]=$,c[24]=Q,c[25]=q):q=c[25],c[26]!==R?(K=(0,I.jsx)(o.Text,{style:k.rowPreview,numberOfLines:2,children:R}),c[26]=R,c[27]=K):K=c[27],c[28]!==p.cwd||c[29]!==x?(N=x&&p.cwd?(0,I.jsx)(o.Text,{style:k.rowCwd,numberOfLines:1,children:p.cwd}):null,c[28]=p.cwd,c[29]=x,c[30]=N):N=c[30],c[31]!==q||c[32]!==K||c[33]!==N?(G=(0,I.jsxs)(t.View,{style:k.rowContent,children:[q,K,N]}),c[31]=q,c[32]=K,c[33]=N,c[34]=G):G=c[34],c[35]!==H||c[36]!==h||c[37]!==D||c[38]!==G||c[39]!==W||c[40]!==B?(J=(0,I.jsxs)(s.Pressable,{disabled:h,onPress:D,accessibilityRole:"button",accessibilityState:H,style:U,testID:W,children:[B,G]}),c[35]=H,c[36]=h,c[37]=D,c[38]=G,c[39]=W,c[40]=B,c[41]=J):J=c[41],J}function C(t){const{pressed:o,hovered:s}=t,n=void 0!==s&&s;return[k.row,Boolean(n)&&k.rowHovered,o&&k.rowPressed]}function A(t){return!t.isLoading&&!t.isPending}function V(t){return t.isError}function H(t){return t.isLoading||t.isPending}function F(t){return t.isFetching}function D(t){const{pressed:o,hovered:s}=t,n=void 0!==s&&s;return[k.filterTrigger,Boolean(n)&&k.filterTriggerHovered,o&&k.filterTriggerPressed]}const k=f.StyleSheet.create(t=>({filterTriggerWrap:{paddingBottom:t.spacing[2],uni__dependencies:[0]},filterTrigger:{flexDirection:"row",alignItems:"center",gap:t.spacing[1.5],alignSelf:"flex-start",paddingVertical:t.spacing[1.5],paddingHorizontal:t.spacing[3],borderRadius:t.borderRadius.md,backgroundColor:t.colors.surface1,borderWidth:t.borderWidth[1],borderColor:t.colors.border,uni__dependencies:[0]},filterTriggerHovered:{backgroundColor:t.colors.surface2,uni__dependencies:[0]},filterTriggerPressed:{backgroundColor:t.colors.surface3,uni__dependencies:[0]},filterTriggerText:{color:t.colors.foreground,fontSize:t.fontSize.sm,fontWeight:t.fontWeight.medium,uni__dependencies:[0]},list:{gap:t.spacing[1],uni__dependencies:[0]},row:{flexDirection:"row",alignItems:"flex-start",gap:t.spacing[2],paddingVertical:t.spacing[2],paddingHorizontal:t.spacing[2],marginHorizontal:-t.spacing[2],borderRadius:t.borderRadius.lg,uni__dependencies:[0]},rowHovered:{backgroundColor:t.colors.surface1,uni__dependencies:[0]},rowPressed:{backgroundColor:t.colors.surface2,uni__dependencies:[0]},rowIconWrap:{width:t.iconSize.md,paddingTop:2,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},rowContent:{flex:1,minWidth:0,gap:t.spacing[1],uni__dependencies:[0]},rowHeader:{flexDirection:"row",alignItems:"baseline",justifyContent:"space-between",gap:t.spacing[2],uni__dependencies:[0]},rowTitle:{flex:1,minWidth:0,color:t.colors.foreground,fontSize:t.fontSize.base,uni__dependencies:[0]},rowMeta:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,uni__dependencies:[0]},rowPreview:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,lineHeight:20,uni__dependencies:[0]},rowCwd:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,uni__dependencies:[0]},statusRow:{flexDirection:"row",alignItems:"center",gap:t.spacing[2],paddingVertical:t.spacing[2],uni__dependencies:[0]},statusText:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,uni__dependencies:[0]},emptyState:{alignItems:"center",justifyContent:"center",gap:t.spacing[2],paddingVertical:t.spacing[8],paddingHorizontal:t.spacing[4],uni__dependencies:[0]},emptyStateIcon:{opacity:.6,marginBottom:t.spacing[1],uni__dependencies:[0]},emptyStateTitle:{color:t.colors.foreground,fontSize:t.fontSize.base,textAlign:"center",uni__dependencies:[0]},refreshButton:{padding:t.spacing[2],marginRight:t.spacing[1],borderRadius:t.borderRadius.lg,uni__dependencies:[0]},refreshButtonPressed:{backgroundColor:t.colors.surface2,uni__dependencies:[0]},refreshIconSlot:{width:16,height:16,alignItems:"center",justifyContent:"center"}}))},4624,[348,711,1572,349,36,1308,234,146,916,1573,1600,56,3466,3564,3456,3929,3510,3904,3534,4625,279]);
|
|
16384
16384
|
__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"PER_PROVIDER_LIMIT",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"ALL_FILTER_VALUE",{enumerable:!0,get:function(){return n}}),e.resolveProvidersToFetch=function(t,o){return t&&o?o.filter(t=>!1!==t.enabled).map(t=>t.provider):null},e.buildProviderLabelMap=function(t){const o=new Map;if(!t)return o;for(const n of t)n.label&&o.set(n.provider,n.label);return o},e.aggregateSessionEntries=function(t){const o=new Set,n=[];for(const s of t)if(s.data)for(const t of s.data.entries){const s=`${t.providerId}:${t.providerHandleId}`;o.has(s)||(o.add(s),n.push(t))}return n.sort((t,o)=>new Date(o.lastActivityAt).getTime()-new Date(t.lastActivityAt).getTime()),n},e.sumFilteredAlreadyImportedCount=function(t){let o=0;for(const n of t)o+=n.data?.filteredAlreadyImportedCount??0;return o},e.collectErroredProviderLabels=function(t,o,n){if(null===t)return[];const s=[];for(let l=0;l<o.length;l++)if(o[l]?.isError){const o=t[l];s.push(n.get(o)??o)}return s},e.getSessionTitle=function(o){const n=o.title?.trim();if(n)return n;const s=o.firstPromptPreview?.trim();if(s)return s;return t.i18n.t("importSession.preview.untitledSession")},e.getPromptPreview=function(o){return o.lastPromptPreview?.trim()||o.firstPromptPreview?.trim()||t.i18n.t("importSession.preview.noPrompt")},e.computeEmptyState=function(o){const s=!o.isLoadingSessions&&!o.allQueriesErrored&&o.isQueryingProviders&&o.allQueriesSettled&&0===o.visibleCount;if(!s)return{showEmptyState:s,emptyStateTitle:""};if(o.selectedProvider!==n&&o.aggregatedCount>0){const n=o.providerLabelById.get(o.selectedProvider)??o.selectedProvider;return{showEmptyState:s,emptyStateTitle:t.i18n.t("importSession.empty.noProviderSessions",{provider:n})}}if(o.totalAlreadyImportedCount>0)return{showEmptyState:s,emptyStateTitle:t.i18n.t("importSession.empty.alreadyImported")};return{showEmptyState:s,emptyStateTitle:t.i18n.t("importSession.empty.noRecent")}};var t=r(d[0]);const o=15,n="__all__"},4625,[3534]);
|
|
16385
16385
|
__d(function(g,r,_i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"SessionFilterBar",{enumerable:!0,get:function(){return Ae}});var t=r(d[0]),i=r(d[1]),n=r(d[2]),o=r(d[3]),s=r(d[4]),l=r(d[5]),c=r(d[6]);r(d[7]),r(d[8]),r(d[9]),r(d[10]),r(d[11]);var u=r(d[12]),p=r(d[13]),h=r(d[14]),b=r(d[15]),f=r(d[16]),v=r(d[17]),x=r(d[18]),F=r(d[19]),y=r(d[20]);const S=[],T=[{bucket:"running",label:"Running",glyph:"\u25cf"},{bucket:"needs_input",label:"Waiting",glyph:"\u26a0"},{bucket:"attention",label:"Unread",glyph:"\ud83d\udcec"},{bucket:"failed",label:"Failed",glyph:"\u2715"},{bucket:"done",label:"Done",glyph:"\u2713"}],j=(0,c.memo)(function(t){const i=(0,l.c)(9),{bucket:n,label:o,count:s,isActive:c,dismissable:u,onToggle:p}=t;let h;i[0]!==n||i[1]!==p?(h=()=>p(n),i[0]=n,i[1]=p,i[2]=h):h=i[2];const b=h;let f;return i[3]!==s||i[4]!==u||i[5]!==b||i[6]!==c||i[7]!==o?(f=(0,y.jsx)(_e,{label:o,count:s,isActive:c,dismissable:u,onPress:b}),i[3]=s,i[4]=u,i[5]=b,i[6]=c,i[7]=o,i[8]=f):f=i[8],f}),_=(0,c.memo)(function(t){const i=(0,l.c)(10),{descriptor:n,count:o,isActive:s,dismissable:c,onToggle:u}=t;let p;i[0]!==n.bucket||i[1]!==u?(p=()=>u(n.bucket),i[0]=n.bucket,i[1]=u,i[2]=p):p=i[2];const h=p;let b;return i[3]!==o||i[4]!==n.glyph||i[5]!==n.label||i[6]!==c||i[7]!==h||i[8]!==s?(b=(0,y.jsx)(_e,{label:n.label,glyph:n.glyph,count:o,isActive:s,dismissable:c,onPress:h}),i[3]=o,i[4]=n.glyph,i[5]=n.label,i[6]=c,i[7]=h,i[8]=s,i[9]=b):b=i[9],b}),A=(0,c.memo)(function(t){const i=(0,l.c)(9),{tag:n,count:o,isActive:s,dismissable:c,onToggle:u}=t;let p;i[0]!==u||i[1]!==n?(p=()=>u(n),i[0]=u,i[1]=n,i[2]=p):p=i[2];const h=p;let b;return i[3]!==o||i[4]!==c||i[5]!==h||i[6]!==s||i[7]!==n?(b=(0,y.jsx)(_e,{label:n,glyph:"#",count:o,isActive:s,dismissable:c,onPress:h}),i[3]=o,i[4]=c,i[5]=h,i[6]=s,i[7]=n,i[8]=b):b=i[8],b}),C=(0,c.memo)(function(t){const i=(0,l.c)(5),{count:n,isActive:o,dismissable:s,onToggle:c}=t;let u;return i[0]!==n||i[1]!==s||i[2]!==o||i[3]!==c?(u=(0,y.jsx)(_e,{label:"Archived",glyph:"\ud83d\uddc4",count:n,isActive:o,dismissable:s,onPress:c}),i[0]=n,i[1]=s,i[2]=o,i[3]=c,i[4]=u):u=i[4],u}),w={today:"Today","7d":"7 days","30d":"30 days",stale:"Stale"},W={root:{label:"Top-level",glyph:"\u25c6"},delegated:{label:"Subagent",glyph:"\u2442"}},k=F.SESSION_ORIGINS.map(t=>({origin:t,label:W[t].label,glyph:W[t].glyph})),I={created:"Created",active:"Active"},D=(0,c.memo)(function(t){const i=(0,l.c)(10),{window:n,count:o,isActive:s,dismissable:c,onToggle:u}=t;let p;i[0]!==u||i[1]!==n?(p=()=>u(n),i[0]=u,i[1]=n,i[2]=p):p=i[2];const h=p,b=w[n],f=`marra-filter-chip-time-${n}`;let v;return i[3]!==o||i[4]!==c||i[5]!==h||i[6]!==s||i[7]!==b||i[8]!==f?(v=(0,y.jsx)(_e,{label:b,glyph:"\ud83d\udd58",count:o,isActive:s,dismissable:c,testID:f,onPress:h}),i[3]=o,i[4]=c,i[5]=h,i[6]=s,i[7]=b,i[8]=f,i[9]=v):v=i[9],v}),B=(0,c.memo)(function(t){const i=(0,l.c)(7),{field:n,onToggle:o}=t;let s;i[0]!==n||i[1]!==o?(s=()=>o("created"===n?"active":"created"),i[0]=n,i[1]=o,i[2]=s):s=i[2];const c=s,u=I[n],p=`Dates measured by ${I[n]}. Tap to switch.`;let h;return i[3]!==c||i[4]!==u||i[5]!==p?(h=(0,y.jsx)(_e,{label:u,glyph:"\u21c4",isActive:!0,testID:"marra-filter-chip-time-field",accessibilityLabel:p,onPress:c}),i[3]=c,i[4]=u,i[5]=p,i[6]=h):h=i[6],h}),P=(0,c.memo)(function(t){const i=(0,l.c)(10),{provider:n,count:o,isActive:s,dismissable:c,onToggle:u}=t;let p;i[0]!==u||i[1]!==n?(p=()=>u(n),i[0]=u,i[1]=n,i[2]=p):p=i[2];const h=p,b=`marra-filter-chip-provider-${n}`;let f;return i[3]!==o||i[4]!==c||i[5]!==h||i[6]!==s||i[7]!==n||i[8]!==b?(f=(0,y.jsx)(_e,{label:n,glyph:"\u2699",count:o,isActive:s,dismissable:c,testID:b,onPress:h}),i[3]=o,i[4]=c,i[5]=h,i[6]=s,i[7]=n,i[8]=b,i[9]=f):f=i[9],f}),z=(0,c.memo)(function(t){const i=(0,l.c)(11),{descriptor:n,count:o,isActive:s,dismissable:c,onToggle:u}=t;let p;i[0]!==n.origin||i[1]!==u?(p=()=>u(n.origin),i[0]=n.origin,i[1]=u,i[2]=p):p=i[2];const h=p,b=`marra-filter-chip-origin-${n.origin}`;let f;return i[3]!==o||i[4]!==n.glyph||i[5]!==n.label||i[6]!==c||i[7]!==h||i[8]!==s||i[9]!==b?(f=(0,y.jsx)(_e,{label:n.label,glyph:n.glyph,count:o,isActive:s,dismissable:c,testID:b,onPress:h}),i[3]=o,i[4]=n.glyph,i[5]=n.label,i[6]=c,i[7]=h,i[8]=s,i[9]=b,i[10]=f):f=i[10],f});function L(){const t=(0,l.c)(9),i=(0,f.useSessionFilterStore)(K),n=(0,f.useSessionFilterStore)(E),o=(0,f.useSessionFilterStore)(R),s=(0,f.useSessionFilterStore)(M),c=(0,f.useSessionFilterStore)(O),u=(0,f.useSessionFilterStore)(V),p=(0,f.useSessionFilterStore)(H),h=(0,f.useSessionFilterStore)($);let b;return t[0]!==i||t[1]!==n||t[2]!==o||t[3]!==s||t[4]!==c||t[5]!==u||t[6]!==p||t[7]!==h?(b={timeField:i,timeWindow:n,providerFilters:o,originFilters:s,setTimeField:c,toggleTimeWindow:u,toggleProviderFilter:p,toggleOriginFilter:h},t[0]=i,t[1]=n,t[2]=o,t[3]=s,t[4]=c,t[5]=u,t[6]=p,t[7]=h,t[8]=b):b=t[8],b}function $(t){return t.toggleOriginFilter}function H(t){return t.toggleProviderFilter}function V(t){return t.toggleTimeWindow}function O(t){return t.setTimeField}function M(t){return t.originFilters}function R(t){return t.providerFilters}function E(t){return t.timeWindow}function K(t){return t.timeField}const N=(0,c.memo)(function(t){const i=(0,l.c)(35),{facets:n,onlyActive:o,dismissable:s}=t,c=L();let u;i[0]!==o?(u=t=>void 0===o||o===t,i[0]=o,i[1]=u):u=i[1];const p=u;let h,b,f,v,F;if(i[2]!==c.setTimeField||i[3]!==c.timeField||i[4]!==c.timeWindow||i[5]!==p?(h=null!==c.timeWindow&&p(!0)?(0,y.jsx)(B,{field:c.timeField,onToggle:c.setTimeField}):null,i[2]=c.setTimeField,i[3]=c.timeField,i[4]=c.timeWindow,i[5]=p,i[6]=h):h=i[6],i[7]!==s||i[8]!==c.timeWindow||i[9]!==c.toggleTimeWindow||i[10]!==n.timeCounts||i[11]!==p?(b=x.SESSION_TIME_WINDOWS.map(t=>{const i=n.timeCounts[t],o=c.timeWindow===t;return 0===i&&!o||!p(o)?null:(0,y.jsx)(D,{window:t,count:i,isActive:o,dismissable:s,onToggle:c.toggleTimeWindow},`time:${t}`)}),i[7]=s,i[8]=c.timeWindow,i[9]=c.toggleTimeWindow,i[10]=n.timeCounts,i[11]=p,i[12]=b):b=i[12],i[13]!==s||i[14]!==c.providerFilters||i[15]!==c.toggleProviderFilter||i[16]!==n.providerCounts||i[17]!==p){let t;i[19]!==s||i[20]!==c.providerFilters||i[21]!==c.toggleProviderFilter||i[22]!==p?(t=t=>{const{provider:i,count:n}=t,o=c.providerFilters.includes(i);return p(o)?(0,y.jsx)(P,{provider:i,count:n,isActive:o,dismissable:s,onToggle:c.toggleProviderFilter},`provider:${i}`):null},i[19]=s,i[20]=c.providerFilters,i[21]=c.toggleProviderFilter,i[22]=p,i[23]=t):t=i[23],f=n.providerCounts.map(t),i[13]=s,i[14]=c.providerFilters,i[15]=c.toggleProviderFilter,i[16]=n.providerCounts,i[17]=p,i[18]=f}else f=i[18];return i[24]!==s||i[25]!==c.originFilters||i[26]!==c.toggleOriginFilter||i[27]!==n.originCounts||i[28]!==p?(v=k.map(t=>{const i=n.originCounts[t.origin],o=c.originFilters.includes(t.origin);return 0===i&&!o||!p(o)?null:(0,y.jsx)(z,{descriptor:t,count:i,isActive:o,dismissable:s,onToggle:c.toggleOriginFilter},`origin:${t.origin}`)}),i[24]=s,i[25]=c.originFilters,i[26]=c.toggleOriginFilter,i[27]=n.originCounts,i[28]=p,i[29]=v):v=i[29],i[30]!==h||i[31]!==b||i[32]!==f||i[33]!==v?(F=(0,y.jsxs)(y.Fragment,{children:[h,b,f,v]}),i[30]=h,i[31]=b,i[32]=f,i[33]=v,i[34]=F):F=i[34],F}),G=(0,c.memo)(function(t){const i=(0,l.c)(25),{facets:n}=t,o=L(),s=I[o.timeField];let c;i[0]!==s?(c=s.toLowerCase(),i[0]=s,i[1]=c):c=i[1];const u=`Date (${c})`;let p,h,b,f,v,F;return i[2]!==o.setTimeField||i[3]!==o.timeField?(p=(0,y.jsx)(B,{field:o.timeField,onToggle:o.setTimeField}),i[2]=o.setTimeField,i[3]=o.timeField,i[4]=p):p=i[4],i[5]!==o.timeWindow||i[6]!==o.toggleTimeWindow||i[7]!==n.timeCounts?(h=x.SESSION_TIME_WINDOWS.map(t=>(0,y.jsx)(D,{window:t,count:n.timeCounts[t],isActive:o.timeWindow===t,onToggle:o.toggleTimeWindow},`sheet-time:${t}`)),i[5]=o.timeWindow,i[6]=o.toggleTimeWindow,i[7]=n.timeCounts,i[8]=h):h=i[8],i[9]!==u||i[10]!==p||i[11]!==h?(b=(0,y.jsxs)(Se,{title:u,children:[p,h]}),i[9]=u,i[10]=p,i[11]=h,i[12]=b):b=i[12],i[13]!==o.providerFilters||i[14]!==o.toggleProviderFilter||i[15]!==n.providerCounts?(f=n.providerCounts.length>1?(0,y.jsx)(Se,{title:"Provider",children:n.providerCounts.map(t=>{const{provider:i,count:n}=t;return(0,y.jsx)(P,{provider:i,count:n,isActive:o.providerFilters.includes(i),onToggle:o.toggleProviderFilter},`sheet-provider:${i}`)})}):null,i[13]=o.providerFilters,i[14]=o.toggleProviderFilter,i[15]=n.providerCounts,i[16]=f):f=i[16],i[17]!==o.originFilters||i[18]!==o.toggleOriginFilter||i[19]!==n.originCounts?(v=n.originCounts.delegated>0?(0,y.jsx)(Se,{title:"Origin",children:k.map(t=>(0,y.jsx)(z,{descriptor:t,count:n.originCounts[t.origin],isActive:o.originFilters.includes(t.origin),onToggle:o.toggleOriginFilter},`sheet-origin:${t.origin}`))}):null,i[17]=o.originFilters,i[18]=o.toggleOriginFilter,i[19]=n.originCounts,i[20]=v):v=i[20],i[21]!==b||i[22]!==f||i[23]!==v?(F=(0,y.jsxs)(y.Fragment,{children:[b,f,v]}),i[21]=b,i[22]=f,i[23]=v,i[24]=F):F=i[24],F});function U(t){return[Ce.clearButton,(t.hovered||t.pressed)&&Ce.clearButtonActive]}function X(t){return[Ce.iconButton,(t.hovered||t.pressed)&&Ce.iconButtonActive]}function q(t){return[Ce.iconButton,(t.hovered||t.pressed)&&Ce.iconButtonActive]}function J(u){const h=(0,l.c)(132),{statusCounts:x,totalAgents:F,visibleCount:w,availableTags:W,kanbanCounts:k,archivedCount:I,metadataFacets:D}=u,B=void 0===W?S:W,P=(0,b.useIsCompactFormFactor)(),z=(0,f.useSessionFilterStore)(Fe),L=(0,f.useSessionFilterStore)(xe),$=(0,f.useSessionFilterStore)(ve),H=(0,f.useSessionFilterStore)(fe),V=(0,f.useSessionFilterStore)(me),O=(0,f.useSessionFilterStore)(be),M=(0,f.useSessionFilterStore)(he),R=(0,f.useSessionFilterStore)(pe),E=(0,f.useSessionFilterStore)(ge),K=(0,f.useSessionFilterStore)(ue),G=(0,f.useSessionFilterStore)(de),J=(0,f.useSessionFilterStore)(ae),Se=(0,f.useSessionFilterStore)(ce),Te=(0,f.useSessionFilterStore)(le),je=(0,f.useSessionFilterStore)(se);let Ae;h[0]!==je||h[1]!==Te||h[2]!==Se?(Ae={timeWindow:Se,providerFilters:Te,originFilters:je},h[0]=je,h[1]=Te,h[2]=Se,h[3]=Ae):Ae=h[3];const we=Ae,We=(0,v.useKanbanBuckets)(),[ke,Ie]=(0,c.useState)(!1),[De,Be]=(0,c.useState)(!1);let Pe;h[4]===Symbol.for("react.memo_cache_sentinel")?(Pe=()=>Ie(!0),h[4]=Pe):Pe=h[4];const ze=Pe;let Le;h[5]===Symbol.for("react.memo_cache_sentinel")?(Le=()=>Ie(!1),h[5]=Le):Le=h[5];const $e=Le;let He;h[6]===Symbol.for("react.memo_cache_sentinel")?(He=()=>Be(re),h[6]=He):He=h[6];const Ve=He;let Oe;h[7]!==G?(Oe=()=>{G(""),Be(!1)},h[7]=G,h[8]=Oe):Oe=h[8];const Me=Oe;let Re;h[9]!==K?(Re=()=>{K([])},h[9]=K,h[10]=Re):Re=h[10];const Ee=Re,Ke="number"==typeof I;let Ne;var Ge;h[11]!==D||h[12]!==we?(Ne=D?(null!==(Ge=we).timeWindow?1:0)+Ge.providerFilters.length+Ge.originFilters.length:0,h[11]=D,h[12]=we,h[13]=Ne):Ne=h[13];const Ue=Ne,Xe=z.length+L.length+$.length+(Ke&&H?1:0)+Ue+(V.trim().length>0?1:0),qe=Xe>0;let Je;h[14]!==qe?(Je={selected:qe},h[14]=qe,h[15]=Je):Je=h[15];const Qe=Je;if(0===F&&!qe)return null;if(P){let l;h[16]!==De||h[17]!==V?(l=De||V.trim().length>0,h[16]=De,h[17]=V,h[18]=l):l=h[18];const c=l;let u,b,f,v;if(h[19]!==I||h[20]!==H||h[21]!==B||h[22]!==We||h[23]!==Me||h[24]!==k||h[25]!==$||h[26]!==D||h[27]!==c||h[28]!==De||h[29]!==G||h[30]!==x||h[31]!==z||h[32]!==L||h[33]!==V||h[34]!==E||h[35]!==R||h[36]!==O||h[37]!==M){let n;h[42]!==x||h[43]!==z?(n=t=>({descriptor:t,count:x[t.bucket],isActive:z.includes(t.bucket)}),h[42]=x,h[43]=z,h[44]=n):n=h[44];const l=T.map(n).filter(oe);let F;h[45]!==k||h[46]!==$?(F=t=>({id:t.id,label:t.label,count:k?.[t.id]??0,isActive:$.includes(t.id)}),h[45]=k,h[46]=$,h[47]=F):F=h[47];const S=(k?We:[]).map(F).filter(ne);let w;h[48]!==I||h[49]!==H?(w="number"==typeof I&&(I>0||H)?{count:I,isActive:H}:null,h[48]=I,h[49]=H,h[50]=w):w=h[50];const W=w;let P;h[51]!==L?(P=t=>{const{tag:i,count:n}=t;return{tag:i,count:n,isActive:L.includes(i)}},h[51]=L,h[52]=P):P=h[52];const K=B.map(P);u=t.View,b=Ce.compactRow,f="marra-filter-bar",v=c?(0,y.jsxs)(t.View,{style:Ce.searchWrapExpanded,children:[(0,y.jsx)(p.Search,{size:14,color:"rgba(255,255,255,0.45)"}),(0,y.jsx)(i.TextInput,{style:Ce.searchInput,placeholder:"Find session\u2026",placeholderTextColor:"rgba(255,255,255,0.35)",value:V,onChangeText:G,accessibilityLabel:"Filter sessions by text",testID:"marra-filter-text-input",returnKeyType:"search",autoCorrect:!1,autoCapitalize:"none",autoFocus:De}),(0,y.jsx)(s.Pressable,{onPress:Me,style:q,accessibilityLabel:"Close search",testID:"marra-filter-search-close",hitSlop:6,children:(0,y.jsx)(p.X,{size:15,color:"rgba(255,255,255,0.45)"})})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(s.Pressable,{onPress:Ve,style:q,accessibilityLabel:"Search sessions",testID:"marra-filter-search-toggle",hitSlop:6,children:(0,y.jsx)(p.Search,{size:16,color:"rgba(255,255,255,0.55)"})}),(0,y.jsxs)(o.ScrollView,{horizontal:!0,showsHorizontalScrollIndicator:!1,contentContainerStyle:Ce.rail,style:Ce.railScroll,keyboardShouldPersistTaps:"handled",testID:"marra-filter-rail",children:[l.filter(ie).map(t=>(0,y.jsx)(_,{descriptor:t.descriptor,count:t.count,isActive:!0,dismissable:!0,onToggle:O},`a-status:${t.descriptor.bucket}`)),S.filter(te).map(t=>(0,y.jsx)(j,{bucket:t.id,label:t.label,count:t.count,isActive:!0,dismissable:!0,onToggle:R},`a-kanban:${t.id}`)),W?.isActive?(0,y.jsx)(C,{count:W.count,isActive:!0,dismissable:!0,onToggle:E},"a-archived"):null,D?(0,y.jsx)(N,{facets:D,onlyActive:!0,dismissable:!0}):null,K.filter(ee).map(t=>(0,y.jsx)(A,{tag:t.tag,count:t.count,isActive:!0,dismissable:!0,onToggle:M},`a-tag:${t.tag}`)),l.filter(Z).map(t=>(0,y.jsx)(_,{descriptor:t.descriptor,count:t.count,isActive:!1,onToggle:O},`status:${t.descriptor.bucket}`)),S.filter(Y).map(t=>(0,y.jsx)(j,{bucket:t.id,label:t.label,count:t.count,isActive:!1,onToggle:R},`kanban:${t.id}`)),W&&!W.isActive?(0,y.jsx)(C,{count:W.count,isActive:!1,onToggle:E},"archived"):null,K.filter(Q).map(t=>(0,y.jsx)(A,{tag:t.tag,count:t.count,isActive:!1,onToggle:M},`tag:${t.tag}`))]})]}),h[19]=I,h[20]=H,h[21]=B,h[22]=We,h[23]=Me,h[24]=k,h[25]=$,h[26]=D,h[27]=c,h[28]=De,h[29]=G,h[30]=x,h[31]=z,h[32]=L,h[33]=V,h[34]=E,h[35]=R,h[36]=O,h[37]=M,h[38]=u,h[39]=b,h[40]=f,h[41]=v}else u=h[38],b=h[39],f=h[40],v=h[41];const S=qe?"#bcd2ff":"rgba(255,255,255,0.55)";let W,P,K,U,re,se;return h[53]!==S?(W=(0,y.jsx)(p.ListFilter,{size:16,color:S}),h[53]=S,h[54]=W):W=h[54],h[55]!==Xe?(P=Xe>0?(0,y.jsx)(t.View,{style:Ce.badge,testID:"marra-filter-badge",children:(0,y.jsx)(n.Text,{style:Ce.badgeText,children:Xe})}):null,h[55]=Xe,h[56]=P):P=h[56],h[57]!==Qe||h[58]!==W||h[59]!==P?(K=(0,y.jsxs)(s.Pressable,{onPress:ze,style:X,accessibilityLabel:"Open filters",accessibilityState:Qe,testID:"marra-filter-open-sheet",hitSlop:6,children:[W,P]}),h[57]=Qe,h[58]=W,h[59]=P,h[60]=K):K=h[60],h[61]!==u||h[62]!==b||h[63]!==f||h[64]!==v||h[65]!==K?(U=(0,y.jsxs)(u,{style:b,testID:f,children:[v,K]}),h[61]=u,h[62]=b,h[63]=f,h[64]=v,h[65]=K,h[66]=U):U=h[66],h[67]!==I||h[68]!==H||h[69]!==B||h[70]!==We||h[71]!==J||h[72]!==qe||h[73]!==k||h[74]!==$||h[75]!==D||h[76]!==ke||h[77]!==x||h[78]!==z||h[79]!==L||h[80]!==E||h[81]!==R||h[82]!==O||h[83]!==M||h[84]!==F||h[85]!==w?(re=(0,y.jsx)(ye,{visible:ke,onClose:$e,statusCounts:x,totalAgents:F,visibleCount:w,availableTags:B,kanbanCounts:k,kanbanBuckets:We,archivedCount:I,metadataFacets:D,statusFilters:z,tagFilters:L,kanbanFilters:$,archivedFilter:H,hasActive:qe,toggleStatusFilter:O,toggleKanbanFilter:R,toggleTagFilter:M,toggleArchivedFilter:E,clearFilters:J}),h[67]=I,h[68]=H,h[69]=B,h[70]=We,h[71]=J,h[72]=qe,h[73]=k,h[74]=$,h[75]=D,h[76]=ke,h[77]=x,h[78]=z,h[79]=L,h[80]=E,h[81]=R,h[82]=O,h[83]=M,h[84]=F,h[85]=w,h[86]=re):re=h[86],h[87]!==U||h[88]!==re?(se=(0,y.jsxs)(y.Fragment,{children:[U,re]}),h[87]=U,h[88]=re,h[89]=se):se=h[89],se}let Ye,Ze,et;h[90]===Symbol.for("react.memo_cache_sentinel")?(Ye=(0,y.jsx)(n.Text,{style:Ce.searchIcon,children:"\u2315"}),h[90]=Ye):Ye=h[90],h[91]!==G||h[92]!==V?(Ze=(0,y.jsxs)(t.View,{style:Ce.searchWrap,children:[Ye,(0,y.jsx)(i.TextInput,{style:Ce.searchInput,placeholder:"Find session\u2026",placeholderTextColor:"rgba(255,255,255,0.35)",value:V,onChangeText:G,accessibilityLabel:"Filter sessions by text",testID:"marra-filter-text-input",returnKeyType:"search",autoCorrect:!1,autoCapitalize:"none"})]}),h[91]=G,h[92]=V,h[93]=Ze):Ze=h[93],h[94]===Symbol.for("react.memo_cache_sentinel")?(et=(0,y.jsx)(n.Text,{style:Ce.label,children:"Filter:"}),h[94]=et):et=h[94];const tt=0===z.length;let it,nt,ot,rt,st,lt,ct,at;return h[95]!==Ee||h[96]!==tt||h[97]!==F?(it=(0,y.jsx)(_e,{label:"All",count:F,isActive:tt,onPress:Ee}),h[95]=Ee,h[96]=tt,h[97]=F,h[98]=it):it=h[98],h[99]!==We||h[100]!==k||h[101]!==$||h[102]!==R?(nt=k?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(n.Text,{style:Ce.divider,children:"\xb7"}),We.map(t=>{const i=k[t.id]??0,n=$.includes(t.id);return 0!==i||n?(0,y.jsx)(j,{bucket:t.id,label:t.label,count:i,isActive:n,onToggle:R},`kanban:${t.id}`):null}),(0,y.jsx)(n.Text,{style:Ce.divider,children:"\xb7"})]}):null,h[99]=We,h[100]=k,h[101]=$,h[102]=R,h[103]=nt):nt=h[103],h[104]!==x||h[105]!==z||h[106]!==O?(ot=T.map(t=>{const i=x[t.bucket],n=z.includes(t.bucket);return 0!==i||n?(0,y.jsx)(_,{descriptor:t,count:i,isActive:n,onToggle:O},t.bucket):null}),h[104]=x,h[105]=z,h[106]=O,h[107]=ot):ot=h[107],h[108]!==I||h[109]!==H||h[110]!==E?(rt="number"==typeof I&&(I>0||H)?(0,y.jsx)(C,{count:I,isActive:H,onToggle:E}):null,h[108]=I,h[109]=H,h[110]=E,h[111]=rt):rt=h[111],h[112]!==D?(st=D?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(n.Text,{style:Ce.divider,children:"\xb7"}),(0,y.jsx)(N,{facets:D})]}):null,h[112]=D,h[113]=st):st=h[113],h[114]!==B||h[115]!==L||h[116]!==M?(lt=B.length>0?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(n.Text,{style:Ce.divider,children:"\xb7"}),B.map(t=>{const{tag:i,count:n}=t;return(0,y.jsx)(A,{tag:i,count:n,isActive:L.includes(i),onToggle:M},`tag:${i}`)})]}):null,h[114]=B,h[115]=L,h[116]=M,h[117]=lt):lt=h[117],h[118]!==J||h[119]!==qe||h[120]!==F||h[121]!==w?(ct=qe?(0,y.jsxs)(y.Fragment,{children:["number"==typeof w?(0,y.jsxs)(n.Text,{style:Ce.visibleHint,testID:"marra-filter-visible-count",children:["showing ",w," of ",F]}):null,(0,y.jsx)(s.Pressable,{onPress:J,style:U,accessibilityLabel:"Clear all filters",testID:"marra-clear-filters",children:(0,y.jsx)(n.Text,{style:Ce.clearText,children:"\u2715 clear"})})]}):(0,y.jsx)(n.Text,{style:Ce.tagHint,children:"Right-click a tab \u2192 \"Tag session\u2026\" to add custom tags"}),h[118]=J,h[119]=qe,h[120]=F,h[121]=w,h[122]=ct):ct=h[122],h[123]!==Ze||h[124]!==it||h[125]!==nt||h[126]!==ot||h[127]!==rt||h[128]!==st||h[129]!==lt||h[130]!==ct?(at=(0,y.jsxs)(t.View,{style:Ce.bar,testID:"marra-filter-bar",children:[Ze,et,it,nt,ot,rt,st,lt,ct]}),h[123]=Ze,h[124]=it,h[125]=nt,h[126]=ot,h[127]=rt,h[128]=st,h[129]=lt,h[130]=ct,h[131]=at):at=h[131],at}function Q(t){return!t.isActive}function Y(t){return!t.isActive}function Z(t){return!t.isActive}function ee(t){return t.isActive}function te(t){return t.isActive}function ie(t){return t.isActive}function ne(t){return t.count>0||t.isActive}function oe(t){return t.count>0||t.isActive}function re(t){return!t}function se(t){return t.originFilters}function le(t){return t.providerFilters}function ce(t){return t.timeWindow}function ae(t){return t.clearFilters}function de(t){return t.setTextFilter}function ue(t){return t.setStatusFilters}function ge(t){return t.toggleArchivedFilter}function pe(t){return t.toggleKanbanFilter}function he(t){return t.toggleTagFilter}function be(t){return t.toggleStatusFilter}function me(t){return t.textFilter}function fe(t){return t.archivedFilter}function ve(t){return t.kanbanFilters}function xe(t){return t.tagFilters}function Fe(t){return t.statusFilters}const ye=(0,c.memo)(function(i){const o=(0,l.c)(50),{visible:c,onClose:u,statusCounts:p,totalAgents:b,visibleCount:f,availableTags:v,kanbanCounts:x,kanbanBuckets:F,archivedCount:S,metadataFacets:w,statusFilters:W,tagFilters:k,kanbanFilters:I,archivedFilter:D,hasActive:B,toggleStatusFilter:P,toggleKanbanFilter:z,toggleTagFilter:L,toggleArchivedFilter:$,clearFilters:H}=i;let V,O;o[0]!==b||o[1]!==f?(V="number"==typeof f?(0,y.jsxs)(n.Text,{style:Ce.sheetSubtitle,children:["showing ",f," of ",b]}):void 0,o[0]=b,o[1]=f,o[2]=V):V=o[2],o[3]!==V?(O={title:"Filters",subtitle:V},o[3]=V,o[4]=O):O=o[4];const M=O,R=!B,E=B?Ce.sheetBtnText:Ce.sheetBtnTextDisabled;let K,N,U,X,q;o[5]!==E?(K=(0,y.jsx)(n.Text,{style:E,children:"Clear all"}),o[5]=E,o[6]=K):K=o[6],o[7]!==H||o[8]!==R||o[9]!==K?(N=(0,y.jsx)(s.Pressable,{onPress:H,disabled:R,style:Te,accessibilityLabel:"Clear all filters",testID:"marra-sheet-clear",children:K}),o[7]=H,o[8]=R,o[9]=K,o[10]=N):N=o[10],o[11]===Symbol.for("react.memo_cache_sentinel")?(U=(0,y.jsx)(n.Text,{style:Ce.sheetDoneText,children:"Done"}),o[11]=U):U=o[11],o[12]!==u?(X=(0,y.jsx)(s.Pressable,{onPress:u,style:je,accessibilityLabel:"Apply filters",testID:"marra-sheet-done",children:U}),o[12]=u,o[13]=X):X=o[13],o[14]!==N||o[15]!==X?(q=(0,y.jsxs)(t.View,{style:Ce.sheetFooter,children:[N,X]}),o[14]=N,o[15]=X,o[16]=q):q=o[16];const J=q;let Q,Y,Z,ee,te,ie,ne,oe;return o[17]!==p||o[18]!==W||o[19]!==P?(Q=T.map(t=>(0,y.jsx)(_,{descriptor:t,count:p[t.bucket],isActive:W.includes(t.bucket),onToggle:P},`sheet-status:${t.bucket}`)),o[17]=p,o[18]=W,o[19]=P,o[20]=Q):Q=o[20],o[21]!==S||o[22]!==D||o[23]!==$?(Y="number"==typeof S?(0,y.jsx)(C,{count:S,isActive:D,onToggle:$}):null,o[21]=S,o[22]=D,o[23]=$,o[24]=Y):Y=o[24],o[25]!==Q||o[26]!==Y?(Z=(0,y.jsxs)(Se,{title:"Status",children:[Q,Y]}),o[25]=Q,o[26]=Y,o[27]=Z):Z=o[27],o[28]!==F||o[29]!==x||o[30]!==I||o[31]!==z?(ee=x?(0,y.jsx)(Se,{title:"Kanban",children:F.map(t=>(0,y.jsx)(j,{bucket:t.id,label:t.label,count:x[t.id]??0,isActive:I.includes(t.id),onToggle:z},`sheet-kanban:${t.id}`))}):null,o[28]=F,o[29]=x,o[30]=I,o[31]=z,o[32]=ee):ee=o[32],o[33]!==w?(te=w?(0,y.jsx)(G,{facets:w}):null,o[33]=w,o[34]=te):te=o[34],o[35]!==v||o[36]!==k||o[37]!==L?(ie=v.length>0?(0,y.jsx)(Se,{title:"Tags",children:v.map(t=>{const{tag:i,count:n}=t;return(0,y.jsx)(A,{tag:i,count:n,isActive:k.includes(i),onToggle:L},`sheet-tag:${i}`)})}):null,o[35]=v,o[36]=k,o[37]=L,o[38]=ie):ie=o[38],o[39]!==Z||o[40]!==ee||o[41]!==te||o[42]!==ie?(ne=(0,y.jsxs)(t.View,{style:Ce.sheetBody,children:[Z,ee,te,ie]}),o[39]=Z,o[40]=ee,o[41]=te,o[42]=ie,o[43]=ne):ne=o[43],o[44]!==J||o[45]!==M||o[46]!==u||o[47]!==ne||o[48]!==c?(oe=(0,y.jsx)(h.AdaptiveModalSheet,{visible:c,onClose:u,header:M,footer:J,testID:"marra-filter-sheet",desktopMaxWidth:420,children:ne}),o[44]=J,o[45]=M,o[46]=u,o[47]=ne,o[48]=c,o[49]=oe):oe=o[49],oe});function Se(i){const o=(0,l.c)(7),{title:s,children:c}=i;let u,p,h;return o[0]!==s?(u=(0,y.jsx)(n.Text,{style:Ce.sheetSectionTitle,children:s}),o[0]=s,o[1]=u):u=o[1],o[2]!==c?(p=(0,y.jsx)(t.View,{style:Ce.sheetSectionChips,children:c}),o[2]=c,o[3]=p):p=o[3],o[4]!==u||o[5]!==p?(h=(0,y.jsxs)(t.View,{style:Ce.sheetSection,children:[u,p]}),o[4]=u,o[5]=p,o[6]=h):h=o[6],h}function Te(t){return[Ce.sheetBtn,Ce.sheetBtnClear,t.pressed&&Ce.sheetBtnPressed]}function je(t){return[Ce.sheetBtn,Ce.sheetBtnDone,t.pressed&&Ce.sheetBtnPressed]}function _e(t){const i=(0,l.c)(35),{label:o,count:c,isActive:u,glyph:p,dismissable:h,testID:b,accessibilityLabel:f,onPress:v}=t;let x;i[0]!==u?(x=t=>[Ce.chip,u&&Ce.chipActive,(t.hovered||t.pressed)&&!u&&Ce.chipHovered],i[0]=u,i[1]=x):x=i[1];const F=x;let S;i[2]!==u?(S={selected:u},i[2]=u,i[3]=S):S=i[3];const T=S,j=u&&Ce.chipGlyphActive;let _;i[4]!==j?(_=[Ce.chipGlyph,j],i[4]=j,i[5]=_):_=i[5];const A=_,C=u&&Ce.chipLabelActive;let w;i[6]!==C?(w=[Ce.chipLabel,C],i[6]=C,i[7]=w):w=i[7];const W=w,k=u&&Ce.chipCountActive;let I;i[8]!==k?(I=[Ce.chipCount,k],i[8]=k,i[9]=I):I=i[9];const D=I;let B,P,z,L,$,H;return i[10]!==o||i[11]!==b?(B=b??`marra-filter-chip-${o.toLowerCase()}`,i[10]=o,i[11]=b,i[12]=B):B=i[12],i[13]!==p||i[14]!==A?(P=p?(0,y.jsx)(n.Text,{style:A,children:p}):null,i[13]=p,i[14]=A,i[15]=P):P=i[15],i[16]!==o||i[17]!==W?(z=(0,y.jsx)(n.Text,{style:W,children:o}),i[16]=o,i[17]=W,i[18]=z):z=i[18],i[19]!==c||i[20]!==D?(L="number"==typeof c?(0,y.jsx)(n.Text,{style:D,children:c}):null,i[19]=c,i[20]=D,i[21]=L):L=i[21],i[22]!==h||i[23]!==u?($=h&&u?(0,y.jsx)(n.Text,{style:Ce.chipDismiss,children:"\u2715"}):null,i[22]=h,i[23]=u,i[24]=$):$=i[24],i[25]!==f||i[26]!==T||i[27]!==F||i[28]!==v||i[29]!==P||i[30]!==z||i[31]!==L||i[32]!==$||i[33]!==B?(H=(0,y.jsxs)(s.Pressable,{onPress:v,style:F,accessibilityRole:"button",accessibilityState:T,accessibilityLabel:f,testID:B,children:[P,z,L,$]}),i[25]=f,i[26]=T,i[27]=F,i[28]=v,i[29]=P,i[30]=z,i[31]=L,i[32]=$,i[33]=B,i[34]=H):H=i[34],H}const Ae=(0,c.memo)(J),Ce=u.StyleSheet.create(t=>({bar:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:12,paddingVertical:6,borderBottomWidth:1,borderBottomColor:t.colors.border,flexWrap:"wrap",uni__dependencies:[0]},compactRow:{flexDirection:"row",alignItems:"center",gap:8,paddingHorizontal:10,paddingVertical:6,borderBottomWidth:1,borderBottomColor:t.colors.border,uni__dependencies:[0]},railScroll:{flex:1},rail:{flexDirection:"row",alignItems:"center",gap:6,paddingRight:4},label:{color:t.colors.foregroundMuted,fontSize:11,fontWeight:"500",marginRight:4,textTransform:"uppercase",letterSpacing:.5,uni__dependencies:[0]},searchWrap:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:12,backgroundColor:t.colors.surface1??"rgba(255,255,255,0.04)",borderWidth:1,borderColor:"transparent",minWidth:140,maxWidth:220,uni__dependencies:[0]},searchWrapExpanded:{flex:1,flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:8,paddingVertical:4,borderRadius:12,backgroundColor:t.colors.surface1??"rgba(255,255,255,0.04)",borderWidth:1,borderColor:"transparent",uni__dependencies:[0]},searchIcon:{fontSize:13,color:t.colors.foregroundMuted,opacity:.7,uni__dependencies:[0]},searchInput:{flex:1,fontSize:12,color:t.colors.foreground,paddingVertical:0,paddingHorizontal:0,uni__dependencies:[0]},iconButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",minWidth:30,height:28,paddingHorizontal:6,borderRadius:9,backgroundColor:t.colors.surface1??"rgba(255,255,255,0.04)",borderWidth:1,borderColor:"transparent",uni__dependencies:[0]},iconButtonActive:{backgroundColor:t.colors.surface2??"rgba(255,255,255,0.08)",uni__dependencies:[0]},badge:{minWidth:16,height:16,paddingHorizontal:4,borderRadius:8,marginLeft:3,alignItems:"center",justifyContent:"center",backgroundColor:t.colors.accentBorder??"rgba(80,140,255,0.9)",uni__dependencies:[0]},badgeText:{fontSize:10,fontWeight:"700",color:t.colors.accentForeground??"#ffffff",lineHeight:14,uni__dependencies:[0]},chip:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:12,backgroundColor:t.colors.surface1??"rgba(255,255,255,0.04)",borderWidth:1,borderColor:"transparent",uni__dependencies:[0]},chipHovered:{backgroundColor:t.colors.surface2??"rgba(255,255,255,0.08)",uni__dependencies:[0]},chipActive:{backgroundColor:t.colors.accent??"rgba(80,140,255,0.18)",borderColor:t.colors.accentBorder??"rgba(80,140,255,0.4)",uni__dependencies:[0]},chipGlyph:{fontSize:11,color:t.colors.foregroundMuted,uni__dependencies:[0]},chipGlyphActive:{color:t.colors.accentForeground,uni__dependencies:[0]},chipLabel:{fontSize:12,fontWeight:"500",color:t.colors.foreground,uni__dependencies:[0]},chipLabelActive:{color:t.colors.accentForeground,fontWeight:"600",uni__dependencies:[0]},chipCount:{fontSize:10,color:t.colors.foregroundMuted,fontWeight:"600",minWidth:14,textAlign:"right",uni__dependencies:[0]},chipCountActive:{color:t.colors.accentForeground,uni__dependencies:[0]},chipDismiss:{fontSize:9,fontWeight:"700",color:t.colors.accentForeground,opacity:.8,marginLeft:2,uni__dependencies:[0]},clearButton:{paddingHorizontal:6,paddingVertical:3,marginLeft:4},clearButtonActive:{opacity:.7},clearText:{fontSize:11,color:t.colors.foregroundMuted,fontWeight:"500",uni__dependencies:[0]},visibleHint:{fontSize:11,color:t.colors.foregroundMuted,fontStyle:"italic",marginLeft:4,uni__dependencies:[0]},tagHint:{fontSize:10,color:t.colors.foregroundMuted,opacity:.6,marginLeft:8,fontStyle:"italic",uni__dependencies:[0]},divider:{fontSize:14,color:t.colors.foregroundMuted,opacity:.4,paddingHorizontal:4,uni__dependencies:[0]},sheetBody:{gap:t.spacing[1],paddingBottom:t.spacing[2],uni__dependencies:[0]},sheetSubtitle:{fontSize:12,color:t.colors.foregroundMuted,fontStyle:"italic",uni__dependencies:[0]},sheetSection:{paddingVertical:t.spacing[3],borderBottomWidth:1,borderBottomColor:t.colors.border,uni__dependencies:[0]},sheetSectionTitle:{fontSize:11,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",color:t.colors.foregroundMuted,marginBottom:10,uni__dependencies:[0]},sheetSectionChips:{flexDirection:"row",flexWrap:"wrap",gap:6},sheetFooter:{flexDirection:"row",gap:10,paddingHorizontal:4},sheetBtn:{flex:1,alignItems:"center",justifyContent:"center",paddingVertical:11,borderRadius:10},sheetBtnPressed:{opacity:.75},sheetBtnClear:{backgroundColor:t.colors.surface1??"rgba(255,255,255,0.04)",uni__dependencies:[0]},sheetBtnDone:{backgroundColor:t.colors.accentBorder??"rgba(80,140,255,0.9)",uni__dependencies:[0]},sheetBtnText:{fontSize:13,fontWeight:"600",color:t.colors.foregroundMuted,uni__dependencies:[0]},sheetBtnTextDisabled:{fontSize:13,fontWeight:"600",color:t.colors.foregroundMuted,opacity:.4,uni__dependencies:[0]},sheetDoneText:{fontSize:13,fontWeight:"700",color:t.colors.accentForeground??"#ffffff",uni__dependencies:[0]}}))},4626,[348,714,711,690,1572,349,36,1308,182,234,715,146,56,1600,3466,3457,3602,3957,3603,3604,279]);
|
|
16386
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16387
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),
|
|
16388
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),
|
|
16389
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16390
|
-
__d(function(g,r,i,
|
|
16391
|
-
__d(function(g,r,i,
|
|
16392
|
-
__d(function(g,r,i,
|
|
16393
|
-
__d(function(g,r,i,
|
|
16394
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16395
|
-
__d(function(g,r,i,
|
|
16396
|
-
__d(function(g,r,i,
|
|
16397
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e
|
|
16398
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),
|
|
16399
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),
|
|
16400
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),
|
|
16401
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"
|
|
16402
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return
|
|
16403
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return
|
|
16404
|
-
__d(function(g,r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.NewWorkspaceScreen=function({serverId:o,sourceDirectory:n,projectId:a,displayName:l,draftId:b}){const{theme:j}=(0,p.useUnistyles)(),{t:w}=(0,c.useTranslation)(),v=(0,f.useSafeAreaInsets)(),x=(0,R.useIsCompactFormFactor)(),C=(0,T.useToast)(),D=(0,F.useSessionStore)(e=>e.mergeWorkspaces),{allHosts:K,selectedServerId:V,hostPickerOpen:L,handleSelectHost:N,handleHostPickerOpenChange:$,openHostPicker:G,projects:U,routeProject:X,lastActiveProject:Z}=tt({serverId:o,sourceDirectory:n,projectId:a,displayName:l}),re=(0,z.useHostFeature)(V,"workspaceMultiplicity"),[oe,se]=(0,s.useState)(null),[me,fe]=(0,s.useState)(null),[he,Se]=(0,s.useState)(null),[be,Ie]=(0,s.useState)(null),[ye,Pe]=(0,s.useState)(!1),[De,Oe]=(0,s.useState)(!1),[Me,Re]=(0,s.useState)(!1),[Le,Ne]=(0,s.useState)(""),[Ee,Ge]=(0,s.useState)(""),Ue=(0,s.useRef)(null),Xe=(0,s.useRef)(null),Je=(0,s.useRef)(null),Ye=(0,s.useRef)(null),et=le({draftId:b,selectedServerId:V});(0,s.useEffect)(()=>{const e=Le.trim(),t=setTimeout(()=>Ge(e),180);return()=>clearTimeout(t)},[Le]);const rt=me,st=(jr={pendingAction:he,isDraftHandoffActive:et},null!==jr.pendingAction||jr.isDraftHandoffActive),it=(0,A.useHostRuntimeClient)(V),ct=(0,A.useHostRuntimeIsConnected)(V),{selectedProject:at,selectedSourceDirectory:lt,projectPickerOptions:dt,projectByOptionId:ut,selectedProjectOptionId:pt,projectTriggerLabel:mt,handleSelectProjectOption:ft}=(0,ie.useNewWorkspaceProjectPicker)({selectedServerId:V,projects:U,routeProject:X,lastActiveProject:Z,allowAllProjects:re}),ht=(0,E.useProjectPickerStore)(e=>e.open),St=(0,s.useMemo)(()=>[...dt,{id:ue,label:"Open project\u2026"}],[dt]),bt=(0,s.useMemo)(()=>U.flatMap(e=>{const t=(0,J.getHostProjectSourceDirectory)(e,V)?.trim();return t?[{projectKey:e.projectKey,serverId:V,iconWorkingDir:t}]:[]}),[U,V]),gt=(0,Y.useProjectIconDataByProjectKey)({projects:bt}),It=ze({selectedServerId:V,selectedSourceDirectory:lt,draftId:b}),kt=Ze(b),yt=(0,ee.useDraftWorkspaceAttachmentScopeKey)(b),jt=(0,s.useMemo)(()=>de({isDraftHandoffActive:et,draftContextScopeKey:yt}),[yt,et]),wt=(0,B.useAgentInputDraft)({draftKey:It,composer:qe({serverId:V,isConnected:ct,workspaceDirectory:rt?.workspaceDirectory??null,sourceDirectory:lt,initialSetup:kt?.setup})}),vt=wt.composerState,[xt,Pt]=Qe(wt.attachments),Ct=He(be),Dt=(0,s.useCallback)(()=>{if(!it||!ct)throw new Error(w("newWorkspace.errors.hostDisconnected"));return it},[it,ct,w]),Ot=ct&&Boolean(it),Wt=null!==lt,Mt=ye&&Ot&&Wt,Rt=(0,S.useQuery)({queryKey:["checkout-status",V,lt],queryFn:async()=>{if(!lt)throw new Error("Choose a project");return Dt().getCheckoutStatus(lt)},enabled:Ot&&Wt,staleTime:1/0,refetchOnMount:!1,refetchOnReconnect:!1,refetchOnWindowFocus:!1}),Tt=Rt.data?.currentBranch??null,{effectiveIsolation:Bt,setIsolation:_t,canCreateWorktree:At,showRefPicker:zt}=Te({supportsMultiplicity:re,selectedIsGit:!0===Rt.data?.isGit}),Ht=(0,S.useQuery)({queryKey:["branch-suggestions",V,lt,Ee],queryFn:async()=>{if(!lt)throw new Error("Choose a project");return Dt().getBranchSuggestions({cwd:lt,query:Ee||void 0,limit:20})},enabled:Mt,staleTime:15e3}),Ft=(0,_.useGithubSearchQuery)({client:it,serverId:V,cwd:lt??"",query:Ee,kinds:["github-pr"],enabled:Mt}),Kt=(0,s.useMemo)(()=>Fe(Ht.data),[Ht.data]),Vt=!1!==Ft.data?.githubFeaturesEnabled,Lt=(0,s.useMemo)(()=>Vt?Ft.data?.items??[]:[],[Vt,Ft.data?.items]),{options:Nt,itemById:Et}=(0,s.useMemo)(()=>We(Kt,Lt),[Kt,Lt]),$t=(0,s.useMemo)(()=>{return Ct?"branch"===(e=Ct).kind?e.name:Ce(e.item):Tt??"main";var e},[Tt,Ct]),qt=(0,s.useMemo)(()=>Ct?"branch"===Ct.kind?je(Ct.name):we(Ct.item.number):"",[Ct]),Gt=(0,s.useCallback)(e=>{const t=(0,ne.syncPickerPrAttachment)({attachments:wt.attachments,previousPickerPrNumber:be?.attachedPrNumber??null,item:e});Ie({item:e,attachedPrNumber:t.attachedPrNumber}),t.attachments!==wt.attachments&&wt.setAttachments(t.attachments),Pe(!1)},[wt,be?.attachedPrNumber]),Ut=(0,s.useCallback)(e=>{const t=Et.get(e);t&&Gt(t)},[Et,Gt]),Qt=(0,s.useCallback)(e=>{if(e===ue)return Oe(!1),void ht(V);ft(e),Oe(!1),Ie(null)},[ht,ft,V]),Xt=(0,s.useMemo)(()=>(0,ne.findCheckoutHintPrAttachment)({attachments:wt.attachments,selectedItem:Ct,dismissedPrNumbers:xt}),[wt.attachments,xt,Ct]),Zt=(0,s.useCallback)(()=>{Xt&&Gt({kind:"github-pr",item:Xt.item})},[Xt,Gt]),Jt=(0,s.useCallback)(()=>{if(!Xt)return;const e=Xt.item.number;Pt(t=>{if(t.has(e))return t;const o=new Set(t);return o.add(e),o})},[Xt,Pt]),Yt=(0,s.useCallback)(()=>{Pe(!0)},[]),er=(0,s.useCallback)(()=>{Oe(!0)},[]),tr=(0,s.useCallback)(()=>{Re(!0)},[]),rr=(0,s.useCallback)(e=>{Re(e)},[]),or=(0,s.useMemo)(()=>{const e={id:"local",label:Be(w,"local")};return At?[e,{id:"worktree",label:Be(w,"worktree")}]:[e]},[At,w]),nr=(0,s.useCallback)(e=>{_t("worktree"===e?"worktree":"local"),Re(!1)},[_t]),sr=(0,s.useCallback)(({option:e,selected:t,active:o,onPress:n})=>(0,ce.jsx)(ke,{optionId:e.id,label:e.label,selected:t,active:o,disabled:st,onPress:n,iconColor:j.colors.foregroundMuted,iconSize:j.iconSize.sm}),[st,j.colors.foregroundMuted,j.iconSize.sm]),ir=(0,s.useCallback)(()=>{},[]),cr=(0,s.useCallback)(e=>{Pe(e),e||Ne("")},[]),ar=(0,s.useCallback)(e=>{Oe(e)},[]),lr=(0,s.useCallback)(e=>{const t=lt??e.cwd;if(!t)throw new Error("Choose a folder for this workspace");const o=ae(Ct,Tt),n=pe(e);return Object.assign({cwd:t},at?{projectId:at.projectKey}:{},{worktreeSlug:(0,h.createNameId)()},n?{firstAgentContext:n}:{},o)},[Tt,Ct,at,lt]),dr=(0,s.useCallback)(async e=>{if(me)return me;if(re&&at&<){const t=await Ve({client:Dt(),isolation:Bt,project:at,sourceDirectory:lt,selectedItem:Ct,currentBranch:Tt,withInitialAgent:e.withInitialAgent,prompt:e.prompt,attachments:e.attachments,mergeWorkspaces:D,serverId:V,createFailedMessage:w("newWorkspace.errors.createWorktreeFailed")});return fe(t),t}const t=await Ke({client:Dt(),createInput:lr(e),mergeWorkspaces:D,serverId:V,createFailedMessage:w("newWorkspace.errors.createWorktreeFailed")});return fe(t),t},[lr,me,Tt,Bt,D,Ct,at,V,lt,re,w,Dt]),ur=(0,s.useCallback)(async e=>{try{if(se(null),await(vt?.persistFormPreferences()),(0,te.isEmptyWorkspaceSubmission)(e))return Se("empty"),void await(0,te.runCreateEmptyWorkspace)({payload:e,ensureWorkspace:dr,serverId:V,navigate:(e,t)=>(0,H.navigateToWorkspace)(e,t)});Se("chat"),await $e({payload:e,composerState:vt,forkDraftSetup:kt,ensureWorkspace:dr,serverId:V,draftKey:It,draftId:b,labels:{composerStateRequired:w("newWorkspace.errors.composerStateRequired"),selectModel:w("newWorkspace.errors.selectModel")}})}catch(e){const t=(0,Q.toErrorMessage)(e);Se(null),se(t),C.error(t)}},[vt,b,It,dr,kt,V,w,C]),pr=(0,s.useCallback)(e=>(0,ce.jsx)(ve,Object.assign({},e,{itemById:Et,isPending:st})),[st,Et]),mr=(0,s.useCallback)(e=>e.option.id===ue?(0,ce.jsx)(P.ComboboxItem,{testID:"new-workspace-project-picker-open-project",label:e.option.label,kind:"directory",active:e.active,onPress:e.onPress}):(0,ce.jsx)(xe,Object.assign({},e,{projectByOptionId:ut,projectIconDataByProjectKey:gt,selectedServerId:V,isPending:st,supportsWorkspaceMultiplicity:re})),[st,ut,gt,V,re]),fr=(0,s.useMemo)(()=>Ae({isCompact:x,insetBottom:v.bottom}),[x,v.bottom]),{style:hr}=(0,q.useKeyboardShiftStyle)({mode:"translate"}),Sr=(0,s.useMemo)(()=>[nt.centered,hr],[hr]),br=(0,s.useMemo)(()=>vt?Object.assign({},vt.agentControls,{disabled:st}):void 0,[vt,st]),gr=Ht.isFetching||Ft.isFetching?w("newWorkspace.refPicker.searching"):w("newWorkspace.refPicker.noMatchingRefs"),Ir=ot({isCompact:x,isPending:st,project:{anchorRef:Xe,open:er,options:St,triggerLabel:mt,selectedProject:at,iconDataByProjectKey:gt,selectedOptionId:pt,onSelect:Qt,openState:De,onOpenChange:ar,renderOption:mr},host:{allHosts:K,selectedServerId:V,onSelect:N,openState:L,onOpenChange:$,anchorRef:Ye,open:G},isolation:{anchorRef:Je,open:tr,effectiveIsolation:Bt,options:or,onSelect:nr,openState:Me,onOpenChange:rr,renderOption:sr,canCreateWorktree:At},base:{anchorRef:Ue,open:Yt,selectedSourceDirectory:lt,selectedItem:Ct,triggerLabel:$t,options:Nt,selectedOptionId:qt,onSelect:Ut,openState:ye,onOpenChange:cr,setSearchQuery:Ne,emptyText:gr,renderOption:pr,showRefPicker:zt}}),kr=(0,s.useMemo)(()=>(0,ce.jsxs)(ce.Fragment,{children:[br?(0,ce.jsx)(y.DraftAgentModeControl,Object.assign({placement:"footer"},br)):null,Xt?(0,ce.jsx)(ge,{label:w("newWorkspace.refPicker.checkoutHint",{number:Xt.item.number}),acceptLabel:w("newWorkspace.refPicker.checkoutPr",{number:Xt.item.number}),dismissLabel:w("newWorkspace.refPicker.dismissCheckoutHint",{number:Xt.item.number}),onAccept:Zt,onDismiss:Jt,iconColor:j.colors.foregroundMuted,iconSize:j.iconSize.sm}):null]}),[Zt,br,Xt,Jt,w,j.colors.foregroundMuted,j.iconSize.sm]),yr=(0,s.useMemo)(()=>(0,ce.jsx)(W.SidebarMenuToggle,{}),[]);var jr;return(0,ce.jsxs)(k.FileDropZone,{style:nt.container,children:[(0,ce.jsx)(M.ScreenHeader,{left:yr,borderless:!0}),(0,ce.jsxs)(e.View,{style:fr,children:[(0,ce.jsx)(O.TitlebarDragRegion,{}),(0,ce.jsxs)(u.default.View,{style:Sr,children:[(0,ce.jsx)(e.View,{style:nt.composerTitleContainer,children:(0,ce.jsx)(t.Text,{style:nt.composerTitle,children:w("newWorkspace.title")})}),Ir,(0,ce.jsx)(I.Composer,{externalKeyboardShift:!0,agentId:It,serverId:V,isPaneFocused:!0,onSubmitMessage:ur,allowEmptySubmit:!0,submitButtonAccessibilityLabel:w("newWorkspace.create"),submitButtonTestID:"workspace-create-submit",submitIcon:"return",isSubmitLoading:st,submitBehavior:"preserve-and-lock",blurOnSubmit:!0,value:wt.text,onChangeText:wt.setText,attachments:wt.attachments,attachmentScopeKeys:jt,onChangeAttachments:wt.setAttachments,cwd:lt??"",clearDraft:ir,autoFocus:!0,commandDraftConfig:vt?.commandDraftConfig,agentControls:br,footer:kr}),oe?(0,ce.jsx)(t.Text,{style:nt.errorText,children:oe}):null]})]})]})};var e=r(d[0]),t=r(d[1]),o=r(d[2]),n=r(d[3]),s=r(d[4]),c=r(d[5]);r(d[6]),r(d[7]),r(d[8]);var a,l=r(d[9]),u=(a=l)&&a.__esModule?a:{default:a},p=r(d[10]),f=r(d[11]),h=r(d[12]),S=r(d[13]),b=r(d[14]),I=r(d[15]),k=r(d[16]),y=r(d[17]),j=r(d[18]),w=r(d[19]),v=r(d[20]),x=r(d[21]),P=r(d[22]),C=r(d[23]),D=r(d[24]),O=r(d[25]),W=r(d[26]),M=r(d[27]),R=r(d[28]),T=r(d[29]),B=r(d[30]),_=r(d[31]),A=r(d[32]),z=r(d[33]),H=r(d[34]),F=r(d[35]),K=r(d[36]),V=r(d[37]),L=r(d[38]),N=r(d[39]),E=r(d[40]),$=r(d[41]),q=r(d[42]),G=r(d[43]),U=r(d[44]),Q=r(d[45]),X=r(d[46]),Z=r(d[47]),J=r(d[48]),Y=r(d[49]),ee=r(d[50]),te=r(d[51]),re=r(d[52]),oe=r(d[53]),ne=r(d[54]),se=r(d[55]),ie=r(d[56]),ce=r(d[57]);function ae(e,t){const o=(0,oe.pickerItemToCheckoutRequest)(e);return o||(t?{action:"branch-off",refName:t}:void 0)}function le(e){const t=(0,n.c)(5);let o;t[0]!==e.draftId?(o=e.draftId?.trim()??"",t[0]=e.draftId,t[1]=o):o=t[1];const s=o;let c;return t[2]!==e.selectedServerId||t[3]!==s?(c=t=>(0,N.isActiveCreateFlowForDraft)({draftId:s,serverId:e.selectedServerId,pending:s?t.pendingByDraftId[s]:null}),t[2]=e.selectedServerId,t[3]=s,t[4]=c):c=t[4],(0,N.useCreateFlowStore)(c)}function de(e){return e.isDraftHandoffActive||!e.draftContextScopeKey?[]:[e.draftContextScopeKey]}const ue="action:open-project";function pe(e){const t=e.prompt.trim();if(t||0!==e.attachments.length)return Object.assign({},t?{prompt:t}:{},{attachments:e.attachments})}const me="branch:",fe="github-pr:";function he(o){const s=(0,n.c)(9),{selectedItem:c,triggerLabel:a,iconColor:l,iconSize:u}=o;let p,f,h;return s[0]!==l||s[1]!==u||s[2]!==c?.kind?(p=(0,ce.jsx)(e.View,{style:nt.badgeIconBox,children:"github-pr"===c?.kind?(0,ce.jsx)(b.GitPullRequest,{size:u,color:l}):(0,ce.jsx)(b.GitBranch,{size:u,color:l})}),s[0]=l,s[1]=u,s[2]=c?.kind,s[3]=p):p=s[3],s[4]!==a?(f=(0,ce.jsx)(t.Text,{style:nt.badgeText,numberOfLines:1,children:a}),s[4]=a,s[5]=f):f=s[5],s[6]!==p||s[7]!==f?(h=(0,ce.jsxs)(ce.Fragment,{children:[p,f]}),s[6]=p,s[7]=f,s[8]=h):h=s[8],h}function Se(e){const o=(0,n.c)(17),{pickerAnchorRef:s,onPress:c,disabled:a,badgePressableStyle:l,selectedItem:u,triggerLabel:p,accessibilityLabel:f,tooltipLabel:h,iconColor:S,iconSize:b}=e;let I,k,y,j;return o[0]!==S||o[1]!==b||o[2]!==u||o[3]!==p?(I=(0,ce.jsx)(he,{selectedItem:u,triggerLabel:p,iconColor:S,iconSize:b}),o[0]=S,o[1]=b,o[2]=u,o[3]=p,o[4]=I):I=o[4],o[5]!==f||o[6]!==l||o[7]!==a||o[8]!==c||o[9]!==s||o[10]!==I?(k=(0,ce.jsx)(D.TooltipTrigger,{asChild:!0,triggerRefProp:"ref",children:(0,ce.jsx)(C.ComboboxTrigger,{ref:s,testID:"new-workspace-ref-picker-trigger",onPress:c,disabled:a,style:l,accessibilityRole:"button",accessibilityLabel:f,children:I})}),o[5]=f,o[6]=l,o[7]=a,o[8]=c,o[9]=s,o[10]=I,o[11]=k):k=o[11],o[12]!==h?(y=(0,ce.jsx)(D.TooltipContent,{side:"top",align:"center",offset:8,children:(0,ce.jsx)(t.Text,{style:nt.tooltipText,children:h})}),o[12]=h,o[13]=y):y=o[13],o[14]!==k||o[15]!==y?(j=(0,ce.jsxs)(D.Tooltip,{children:[k,y]}),o[14]=k,o[15]=y,o[16]=j):j=o[16],j}function be(o){const s=(0,n.c)(20),{pickerAnchorRef:c,onPress:a,disabled:l,badgePressableStyle:u,label:p,projectKey:f,iconDataUri:h,iconColor:S,iconSize:I}=o;let k;if(s[0]!==p){k=(0,X.projectIconPlaceholderLabelFromDisplayName)(p).charAt(0).toUpperCase()||"?",s[0]=p,s[1]=k}else k=s[1];const y=k;let j,w,v,P,O;return s[2]!==S||s[3]!==h||s[4]!==I||s[5]!==y||s[6]!==f?(j=(0,ce.jsx)(e.View,{style:nt.badgeIconBox,children:f?(0,ce.jsx)(x.ProjectIconView,{iconDataUri:h,initial:y,projectKey:f,imageStyle:nt.projectIcon,fallbackStyle:nt.projectIconFallback,textStyle:nt.projectIconFallbackText}):(0,ce.jsx)(b.Folder,{size:I,color:S})}),s[2]=S,s[3]=h,s[4]=I,s[5]=y,s[6]=f,s[7]=j):j=s[7],s[8]!==p?(w=(0,ce.jsx)(t.Text,{style:nt.badgeText,numberOfLines:1,children:p}),s[8]=p,s[9]=w):w=s[9],s[10]!==u||s[11]!==l||s[12]!==a||s[13]!==c||s[14]!==j||s[15]!==w?(v=(0,ce.jsx)(D.TooltipTrigger,{asChild:!0,triggerRefProp:"ref",children:(0,ce.jsxs)(C.ComboboxTrigger,{ref:c,testID:"new-workspace-project-picker-trigger",onPress:a,disabled:l,style:u,accessibilityRole:"button",accessibilityLabel:"Workspace project",children:[j,w]})}),s[10]=u,s[11]=l,s[12]=a,s[13]=c,s[14]=j,s[15]=w,s[16]=v):v=s[16],s[17]===Symbol.for("react.memo_cache_sentinel")?(P=(0,ce.jsx)(D.TooltipContent,{side:"top",align:"center",offset:8,children:(0,ce.jsx)(t.Text,{style:nt.tooltipText,children:"Choose project"})}),s[17]=P):P=s[17],s[18]!==v?(O=(0,ce.jsxs)(D.Tooltip,{children:[v,P]}),s[18]=v,s[19]=O):O=s[19],O}function ge(s){const c=(0,n.c)(20),{label:a,acceptLabel:l,dismissLabel:u,onAccept:p,onDismiss:f,iconColor:h,iconSize:S}=s;let I,k,y,j,w,v;return c[0]!==a?(I=(0,ce.jsx)(t.Text,{style:nt.badgeText,numberOfLines:1,children:a}),c[0]=a,c[1]=I):I=c[1],c[2]!==h||c[3]!==S?(k=(0,ce.jsx)(b.Check,{size:S,color:h}),c[2]=h,c[3]=S,c[4]=k):k=c[4],c[5]!==l||c[6]!==p||c[7]!==k?(y=(0,ce.jsx)(o.Pressable,{testID:"new-workspace-checkout-hint-accept",onPress:p,style:nt.checkoutHintAction,accessibilityRole:"button",accessibilityLabel:l,children:k}),c[5]=l,c[6]=p,c[7]=k,c[8]=y):y=c[8],c[9]!==h||c[10]!==S?(j=(0,ce.jsx)(b.X,{size:S,color:h}),c[9]=h,c[10]=S,c[11]=j):j=c[11],c[12]!==u||c[13]!==f||c[14]!==j?(w=(0,ce.jsx)(o.Pressable,{testID:"new-workspace-checkout-hint-dismiss",onPress:f,style:nt.checkoutHintAction,accessibilityRole:"button",accessibilityLabel:u,children:j}),c[12]=u,c[13]=f,c[14]=j,c[15]=w):w=c[15],c[16]!==I||c[17]!==y||c[18]!==w?(v=(0,ce.jsxs)(e.View,{style:nt.checkoutHintBadge,children:[I,y,w]}),c[16]=I,c[17]=y,c[18]=w,c[19]=v):v=c[19],v}function Ie(t){const o=(0,n.c)(13),{testID:s,label:c,description:a,selected:l,active:u,disabled:p,onPress:f,isBranch:h,iconColor:S,iconSize:I}=t;let k;o[0]!==S||o[1]!==I||o[2]!==h?(k=(0,ce.jsx)(e.View,{style:nt.rowIconBox,children:h?(0,ce.jsx)(b.GitBranch,{size:I,color:S}):(0,ce.jsx)(b.GitPullRequest,{size:I,color:S})}),o[0]=S,o[1]=I,o[2]=h,o[3]=k):k=o[3];const y=k;let j;return o[4]!==u||o[5]!==a||o[6]!==p||o[7]!==c||o[8]!==y||o[9]!==f||o[10]!==l||o[11]!==s?(j=(0,ce.jsx)(P.ComboboxItem,{testID:s,label:c,description:a,selected:l,active:u,disabled:p,onPress:f,leadingSlot:y}),o[4]=u,o[5]=a,o[6]=p,o[7]=c,o[8]=y,o[9]=f,o[10]=l,o[11]=s,o[12]=j):j=o[12],j}function ke(t){const o=(0,n.c)(12),{optionId:s,label:c,selected:a,active:l,disabled:u,onPress:p,iconColor:f,iconSize:h}=t;let S;o[0]!==f||o[1]!==h||o[2]!==s?(S=(0,ce.jsx)(e.View,{style:nt.rowIconBox,children:"worktree"===s?(0,ce.jsx)(b.GitBranch,{size:h,color:f}):(0,ce.jsx)(b.Folder,{size:h,color:f})}),o[0]=f,o[1]=h,o[2]=s,o[3]=S):S=o[3];const I=S,k=`workspace-create-isolation-${s}`;let y;return o[4]!==l||o[5]!==u||o[6]!==c||o[7]!==I||o[8]!==p||o[9]!==a||o[10]!==k?(y=(0,ce.jsx)(P.ComboboxItem,{testID:k,label:c,selected:a,active:l,disabled:u,onPress:p,leadingSlot:I}),o[4]=l,o[5]=u,o[6]=c,o[7]=I,o[8]=p,o[9]=a,o[10]=k,o[11]=y):y=o[11],y}function ye(t){const o=(0,n.c)(15),{testID:s,projectKey:c,iconDataUri:a,label:l,description:u,selected:p,active:f,disabled:h,onPress:S}=t;let b;if(o[0]!==l){b=(0,X.projectIconPlaceholderLabelFromDisplayName)(l).charAt(0).toUpperCase()||"?",o[0]=l,o[1]=b}else b=o[1];const I=b;let k;o[2]!==a||o[3]!==I||o[4]!==c?(k=(0,ce.jsx)(e.View,{style:nt.rowIconBox,children:(0,ce.jsx)(x.ProjectIconView,{iconDataUri:a,initial:I,projectKey:c,imageStyle:nt.projectIcon,fallbackStyle:nt.projectIconFallback,textStyle:nt.projectIconFallbackText})}),o[2]=a,o[3]=I,o[4]=c,o[5]=k):k=o[5];const y=k;let j;return o[6]!==f||o[7]!==u||o[8]!==h||o[9]!==l||o[10]!==y||o[11]!==S||o[12]!==p||o[13]!==s?(j=(0,ce.jsx)(P.ComboboxItem,{testID:s,label:l,description:u,selected:p,active:f,disabled:h,onPress:S,leadingSlot:y}),o[6]=f,o[7]=u,o[8]=h,o[9]=l,o[10]=y,o[11]=S,o[12]=p,o[13]=s,o[14]=j):j=o[14],j}function je(e){return`${me}${e}`}function we(e){return`${fe}${e}`}function ve(t){const o=(0,n.c)(23),{option:s,selected:a,active:l,onPress:u,itemById:f,isPending:h}=t,{theme:S}=(0,p.useUnistyles)(),{t:b}=(0,c.useTranslation)();let I,k,y,j,w,v,x;if(o[0]!==f||o[1]!==s.id||o[2]!==b){v=Symbol.for("react.early_return_sentinel");e:{const t=f.get(s.id);if(!t){let t;o[9]!==s.id?(t=(0,ce.jsx)(e.View,{},s.id),o[9]=s.id,o[10]=t):t=o[10],v=t;break e}y="branch"===t.kind;const n=y?`new-workspace-ref-picker-branch-${t.name}`:`new-workspace-ref-picker-pr-${t.item.number}`;k=!y&&t.item.baseRefName?b("newWorkspace.refPicker.intoBase",{baseRef:t.item.baseRefName}):void 0,I=Ie,j=n,w=De(t)}o[0]=f,o[1]=s.id,o[2]=b,o[3]=I,o[4]=k,o[5]=y,o[6]=j,o[7]=w,o[8]=v}else I=o[3],k=o[4],y=o[5],j=o[6],w=o[7],v=o[8];return v!==Symbol.for("react.early_return_sentinel")?v:(o[11]!==I||o[12]!==l||o[13]!==k||o[14]!==y||o[15]!==h||o[16]!==u||o[17]!==a||o[18]!==j||o[19]!==w||o[20]!==S.colors.foregroundMuted||o[21]!==S.iconSize.sm?(x=(0,ce.jsx)(I,{testID:j,label:w,description:k,selected:a,active:l,disabled:h,onPress:u,isBranch:y,iconColor:S.colors.foregroundMuted,iconSize:S.iconSize.sm}),o[11]=I,o[12]=l,o[13]=k,o[14]=y,o[15]=h,o[16]=u,o[17]=a,o[18]=j,o[19]=w,o[20]=S.colors.foregroundMuted,o[21]=S.iconSize.sm,o[22]=x):x=o[22],x)}function xe(t){const o=(0,n.c)(31),{option:s,selected:c,active:a,onPress:l,projectByOptionId:u,projectIconDataByProjectKey:p,selectedServerId:f,isPending:h,supportsWorkspaceMultiplicity:S}=t;let b,I,k,y,j,w,v,x,P,C,D;if(o[0]!==a||o[1]!==h||o[2]!==s.id||o[3]!==u||o[4]!==p||o[5]!==c||o[6]!==f||o[7]!==S){C=Symbol.for("react.early_return_sentinel");e:{const t=u.get(s.id);if(!t){let t;o[18]!==s.id?(t=(0,ce.jsx)(e.View,{},s.id),o[18]=s.id,o[19]=t):t=o[19],C=t;break e}const n=(0,J.getHostProjectSourceDirectory)(t,f)??t.iconWorkingDir;b=ye,I=`new-workspace-project-picker-option-${t.projectKey}`,k=t.projectKey,y=p.get(t.projectKey)??null,j=t.projectName,w=n,v=c,x=a,P=h||!S&&!t.hosts.some(Pe)}o[0]=a,o[1]=h,o[2]=s.id,o[3]=u,o[4]=p,o[5]=c,o[6]=f,o[7]=S,o[8]=b,o[9]=I,o[10]=k,o[11]=y,o[12]=j,o[13]=w,o[14]=v,o[15]=x,o[16]=P,o[17]=C}else b=o[8],I=o[9],k=o[10],y=o[11],j=o[12],w=o[13],v=o[14],x=o[15],P=o[16],C=o[17];return C!==Symbol.for("react.early_return_sentinel")?C:(o[20]!==b||o[21]!==l||o[22]!==I||o[23]!==k||o[24]!==y||o[25]!==j||o[26]!==w||o[27]!==v||o[28]!==x||o[29]!==P?(D=(0,ce.jsx)(b,{testID:I,projectKey:k,iconDataUri:y,label:j,description:w,selected:v,active:x,disabled:P,onPress:l}),o[20]=b,o[21]=l,o[22]=I,o[23]=k,o[24]=y,o[25]=j,o[26]=w,o[27]=v,o[28]=x,o[29]=P,o[30]=D):D=o[30],D)}function Pe(e){return e.canCreateWorktree}function Ce(e){return`#${e.number} ${e.title}`}function De(e){return"branch"===e.kind?e.name:Ce(e.item)}function Oe(e){return`new-workspace-host-picker-option-${e}`}function We(e,t){const o=new Map,n=[];for(const t of e){const e=je(t.name),s={id:e,label:t.name};o.set(e,{kind:"branch",name:t.name}),n.push({option:s,timestamp:t.committerDate})}for(const e of t){if(!e.headRefName)continue;const t=we(e.number),s={id:t,label:Ce(e)};o.set(t,{kind:"github-pr",item:e});const c=e.updatedAt?Date.parse(e.updatedAt):0,a=Number.isNaN(c)?0:Math.floor(c/1e3);n.push({option:s,timestamp:a})}return n.sort((e,t)=>t.timestamp-e.timestamp),{options:n.map(e=>e.option),itemById:o}}function Me(o){const s=(0,n.c)(13),{pickerAnchorRef:c,onPress:a,disabled:l,badgePressableStyle:u,isolation:p,label:f,iconColor:h,iconSize:S}=o;let I,k,y;return s[0]!==h||s[1]!==S||s[2]!==p?(I=(0,ce.jsx)(e.View,{style:nt.badgeIconBox,children:"worktree"===p?(0,ce.jsx)(b.GitBranch,{size:S,color:h}):(0,ce.jsx)(b.Folder,{size:S,color:h})}),s[0]=h,s[1]=S,s[2]=p,s[3]=I):I=s[3],s[4]!==f?(k=(0,ce.jsx)(t.Text,{style:nt.badgeText,numberOfLines:1,children:f}),s[4]=f,s[5]=k):k=s[5],s[6]!==u||s[7]!==l||s[8]!==a||s[9]!==c||s[10]!==I||s[11]!==k?(y=(0,ce.jsxs)(C.ComboboxTrigger,{ref:c,testID:"workspace-create-isolation-trigger",onPress:a,disabled:l,style:u,accessibilityRole:"button",accessibilityLabel:"Workspace isolation",children:[I,k]}),s[6]=u,s[7]=l,s[8]=a,s[9]=c,s[10]=I,s[11]=k,s[12]=y):y=s[12],y}function Re(t){const o=(0,n.c)(2),{children:s}=t;let c;return o[0]!==s?(c=(0,ce.jsx)(e.View,{style:nt.row,children:s}),o[0]=s,o[1]=c):c=o[1],c}function Te(e){const t=(0,n.c)(8),{supportsMultiplicity:o,selectedIsGit:c}=e,{preferences:a,updatePreferences:l}=(0,G.useFormPreferences)(),[u,p]=(0,s.useState)(null),f=u??a.isolation??"local",h=o&&c,S="worktree"===f&&h;let b;t[0]!==l?(b=e=>{p(e),l({isolation:e})},t[0]=l,t[1]=b):b=t[1];const I=b,k=S?"worktree":"local",y=!o||S;let j;return t[2]!==h||t[3]!==f||t[4]!==I||t[5]!==k||t[6]!==y?(j={isolation:f,setIsolation:I,effectiveIsolation:k,canCreateWorktree:h,showRefPicker:y},t[2]=h,t[3]=f,t[4]=I,t[5]=k,t[6]=y,t[7]=j):j=t[7],j}function Be(e,t){return e("worktree"===t?"newWorkspace.isolation.worktree":"newWorkspace.isolation.local")}function Ae(e){return e.isCompact?[nt.content,nt.contentCompact,{paddingBottom:e.insetBottom}]:[nt.content,nt.contentCentered]}function ze(e){const t=e.draftId?.trim();return t?`new-workspace:draft:${t}`:`new-workspace:${e.selectedServerId}:${e.selectedSourceDirectory??"choose-project"}`}function He(e){return e?e.item:null}function Fe(e){const t=e?.branchDetails;if(t&&t.length>0)return t;return(e?.branches??[]).map(e=>({name:e,committerDate:0}))}async function Ke(e){const t=await e.client.createPaseoWorktree(e.createInput);if(t.error||!t.workspace)throw new Error(t.error??e.createFailedMessage);const o=(0,F.normalizeWorkspaceDescriptor)(t.workspace),n=e.createInput.firstAgentContext?Object.assign({},o,{status:"running",statusEnteredAt:new Date}):o;return e.mergeWorkspaces(e.serverId,[n]),o}async function Ve(e){const t="worktree"===e.isolation,o=t?ae(e.selectedItem,e.currentBranch):void 0,n=pe({prompt:e.prompt,attachments:e.attachments}),s=await e.client.createWorkspace(Object.assign({source:t?Object.assign({kind:"worktree",cwd:e.sourceDirectory,projectId:e.project.projectKey,worktreeSlug:(0,h.createNameId)()},o):{kind:"directory",path:e.sourceDirectory,projectId:e.project.projectKey}},n?{firstAgentContext:n}:{}));if(s.error||!s.workspace)throw new Error(s.error??e.createFailedMessage);const c=(0,F.normalizeWorkspaceDescriptor)(s.workspace),a=e.withInitialAgent?Object.assign({},c,{status:"running",statusEnteredAt:new Date}):c;return e.mergeWorkspaces(e.serverId,[a]),c}function Le(e){return{provider:e.provider,cwd:e.cwd,modeId:e.composerState.selectedMode||null,model:e.composerState.effectiveModelId||null,thinkingOptionId:e.composerState.effectiveThinkingOptionId||null,featureValues:e.composerState.featureValues??{}}}function Ne(e){if(e.forkDraftSetup)return Le({cwd:(0,re.remapDraftCwdToWorkspace)({cwd:e.forkDraftSetup.setup.cwd,sourceDirectory:e.forkDraftSetup.sourceDirectory,workspaceDirectory:e.workspaceDirectory}),provider:e.provider,composerState:e.composerState})}function Ee(e){return e.initialSetup?{workingDir:e.workingDir??e.initialSetup.cwd,provider:e.initialSetup.provider,modeId:e.initialSetup.modeId,model:e.initialSetup.model,thinkingOptionId:e.initialSetup.thinkingOptionId}:e.workingDir?{workingDir:e.workingDir}:void 0}async function $e(e){const{payload:t,composerState:o,ensureWorkspace:n,serverId:s,draftKey:c}=e,{text:a,attachments:l,cwd:u}=t;if(!o)throw new Error(e.labels.composerStateRequired);const p=o.selectedProvider;if(!p)throw new Error(e.labels.selectModel);const{attachments:f}=(0,j.splitComposerAttachmentsForSubmit)(l),h=(0,re.getWorkspaceNamingAttachments)(f),S=await n({cwd:u,prompt:a,attachments:h,withInitialAgent:!0}),b=Ne({forkDraftSetup:e.forkDraftSetup,workspaceDirectory:S.workspaceDirectory,provider:p,composerState:o});Ye({serverId:s,draftKey:c,draftId:e.draftId,initialSetup:b,workspaceId:S.id,workspaceDirectory:S.workspaceDirectory,text:a,attachments:l,provider:p,composerState:o})}function qe(e){const{serverId:t,isConnected:o,workspaceDirectory:n,sourceDirectory:s,initialSetup:c}=e,a=n||s||void 0;return{initialServerId:t||null,initialValues:Ee({workingDir:a,initialSetup:c}),initialFeatureValues:c?.featureValues,isVisible:!0,onlineServerIds:o&&t?[t]:[],lockedWorkingDir:a}}function Ge(e){const t=new Set;for(const o of e)"github_pr"===o.kind&&t.add(o.item.number);return t}function Ue(e,t){let o=!1;const n=new Set;for(const s of e)t.has(s)?n.add(s):o=!0;return o?n:e}function Qe(e){const t=(0,n.c)(7),[o,c]=(0,s.useState)(Xe);let a;t[0]!==e?(a=Ge(e),t[0]=e,t[1]=a):a=t[1];const l=a;let u,p,f;return t[2]!==l?(u=()=>{c(e=>Ue(e,l))},p=[l],t[2]=l,t[3]=u,t[4]=p):(u=t[3],p=t[4]),(0,s.useEffect)(u,p),t[5]!==o?(f=[o,c],t[5]=o,t[6]=f):f=t[6],f}function Xe(){return new Set}function Ze(e){const t=(0,n.c)(4);let o;t[0]!==e?(o=e?.trim()??"",t[0]=e,t[1]=o):o=t[1];const s=o;let c;return t[2]!==s?(c=e=>s?e.setupByDraftId[s]??null:null,t[2]=s,t[3]=c):c=t[3],(0,$.useWorkspaceDraftSubmissionStore)(c)}function Je(e){const{draftId:t,workspaceDirectory:o,provider:n,composerState:s,initialSetup:c}=e;return c?{cwd:c.cwd,provider:c.provider,modeId:c.modeId,model:c.model,thinkingOptionId:c.thinkingOptionId,featureValues:c.featureValues,target:{kind:"draft",draftId:t,setup:c}}:{cwd:o,provider:n,modeId:s.selectedMode||null,model:s.effectiveModelId||null,thinkingOptionId:s.effectiveThinkingOptionId||null,featureValues:s.featureValues,target:{kind:"draft",draftId:t}}}function Ye(e){const{serverId:t,draftKey:o,draftId:n,workspaceId:s,workspaceDirectory:c,text:a,attachments:l,provider:u,composerState:p,initialSetup:f}=e,h=n?.trim()||(0,V.generateDraftId)(),S=(0,U.generateMessageId)(),b=Date.now(),I=(0,j.splitComposerAttachmentsForSubmit)(l),k=Je({draftId:h,workspaceDirectory:c,provider:u,composerState:p,initialSetup:f});N.useCreateFlowStore.getState().setPending(Object.assign({serverId:t,draftId:h,workspaceId:s,agentId:null,clientMessageId:S,text:a.trim(),timestamp:b},I.images.length>0?{images:I.images}:{},I.attachments.length>0?{attachments:I.attachments}:{})),$.useWorkspaceDraftSubmissionStore.getState().setPending(Object.assign({serverId:t,workspaceId:s,draftId:h,text:a.trim(),attachments:l,cwd:k.cwd,provider:k.provider,clientMessageId:S,timestamp:b},k.modeId?{modeId:k.modeId}:{},k.model?{model:k.model}:{},k.thinkingOptionId?{thinkingOptionId:k.thinkingOptionId}:{},k.featureValues?{featureValues:k.featureValues}:{},{allowEmptyText:!0})),(0,Z.navigateToPreparedWorkspaceTab)({serverId:t,workspaceId:s,target:k.target}),L.useDraftStore.getState().clearDraftInput({draftKey:o,lifecycle:"sent"})}function et(e){const t=(0,n.c)(41);let o;t[0]!==e.initialServerId?(o=e.initialServerId.trim(),t[0]=e.initialServerId,t[1]=o):o=t[1];const c=o;let a;t[2]!==e.allServerIds||t[3]!==e.hostConnectionStatusByServerId||t[4]!==e.initialServerId||t[5]!==e.lastActiveProject||t[6]!==e.projects||t[7]!==e.workspaceMultiplicityByServerId?(a=(0,se.resolveNewWorkspaceInitialServerId)({allServerIds:e.allServerIds,routeServerId:e.initialServerId,lastActiveProject:e.lastActiveProject,projects:e.projects,hostConnectionStatusByServerId:e.hostConnectionStatusByServerId,workspaceMultiplicityByServerId:e.workspaceMultiplicityByServerId}),t[2]=e.allServerIds,t[3]=e.hostConnectionStatusByServerId,t[4]=e.initialServerId,t[5]=e.lastActiveProject,t[6]=e.projects,t[7]=e.workspaceMultiplicityByServerId,t[8]=a):a=t[8];const l=a;let u;t[9]!==l||t[10]!==c?(u=()=>({routeServerId:c,serverId:l}),t[9]=l,t[10]=c,t[11]=u):u=t[11];const[p,f]=(0,s.useState)(u),[h,S]=(0,s.useState)(null),[b,I]=(0,s.useState)(!1);let k,y,j;t[12]!==l||t[13]!==e.allServerIds||t[14]!==e.hostConnectionStatusByServerId||t[15]!==e.initialServerId||t[16]!==e.lastActiveProject||t[17]!==e.projects||t[18]!==e.workspaceMultiplicityByServerId||t[19]!==c?(k=()=>{f(t=>{const o=t.routeServerId===c?(0,se.resolveNewWorkspaceAutomaticServerId)({allServerIds:e.allServerIds,routeServerId:e.initialServerId,lastActiveProject:e.lastActiveProject,projects:e.projects,hostConnectionStatusByServerId:e.hostConnectionStatusByServerId,workspaceMultiplicityByServerId:e.workspaceMultiplicityByServerId,currentServerId:t.serverId,nextServerId:l}):l;return t.routeServerId===c&&t.serverId===o?t:{routeServerId:c,serverId:o}})},y=[l,e.allServerIds,e.hostConnectionStatusByServerId,e.initialServerId,e.lastActiveProject,e.projects,e.workspaceMultiplicityByServerId,c],t[12]=l,t[13]=e.allServerIds,t[14]=e.hostConnectionStatusByServerId,t[15]=e.initialServerId,t[16]=e.lastActiveProject,t[17]=e.projects,t[18]=e.workspaceMultiplicityByServerId,t[19]=c,t[20]=k,t[21]=y):(k=t[20],y=t[21]),(0,s.useEffect)(k,y),t[22]!==p.routeServerId||t[23]!==p.serverId||t[24]!==l||t[25]!==e.allServerIds||t[26]!==c?(j=p.routeServerId===c&&e.allServerIds.includes(p.serverId)?p.serverId:l,t[22]=p.routeServerId,t[23]=p.serverId,t[24]=l,t[25]=e.allServerIds,t[26]=c,t[27]=j):j=t[27];const w=j;let v;t[28]!==w||t[29]!==e.allServerIds||t[30]!==h||t[31]!==c?(v=h?.routeServerId===c&&e.allServerIds.includes(h.serverId)?h.serverId:w,t[28]=w,t[29]=e.allServerIds,t[30]=h,t[31]=c,t[32]=v):v=t[32];const x=v;let P;t[33]!==c?(P=e=>{S({routeServerId:c,serverId:e}),I(!1)},t[33]=c,t[34]=P):P=t[34];const C=P;let D;t[35]===Symbol.for("react.memo_cache_sentinel")?(D=e=>{I(e)},t[35]=D):D=t[35];const O=D;let W;t[36]===Symbol.for("react.memo_cache_sentinel")?(W=()=>{I(!0)},t[36]=W):W=t[36];const M=W;let R;return t[37]!==C||t[38]!==b||t[39]!==x?(R={selectedServerId:x,hostPickerOpen:b,handleSelectHost:C,handleHostPickerOpenChange:O,openHostPicker:M},t[37]=C,t[38]=b,t[39]=x,t[40]=R):R=t[40],R}function tt(e){const t=(0,n.c)(32),{serverId:o,sourceDirectory:s,projectId:c,displayName:a}=e,l=(0,A.useHosts)();let u;t[0]!==l?(u=l.map(rt),t[0]=l,t[1]=u):u=t[1];const p=u,f=(0,J.useHostProjects)(p);let h;t[2]!==a?(h=a?.trim()??"",t[2]=a,t[3]=h):h=t[3];const S=h;let b;t[4]!==c||t[5]!==S||t[6]!==o||t[7]!==s?(b=(0,J.hostProjectFromRoute)({serverId:o,projectId:c,displayName:S,sourceDirectory:s}),t[4]=c,t[5]=S,t[6]=o,t[7]=s,t[8]=b):b=t[8];const I=b,k=(0,H.useLastWorkspaceSelection)();let y;t[9]!==p||t[10]!==k?(y=k&&p.includes(k.serverId)?k.serverId:null,t[9]=p,t[10]=k,t[11]=y):y=t[11];const j=y,w=j?k.workspaceId:null,v=(0,K.useWorkspace)(j,w);let x;t[12]!==v||t[13]!==j?(x=j?(0,J.hostProjectFromWorkspace)({serverId:j,workspace:v}):null,t[12]=v,t[13]=j,t[14]=x):x=t[14];const P=x,C=(0,A.useHostRuntimeConnectionStatuses)(p),D=(0,z.useHostFeatureMap)(p,"workspaceMultiplicity");let O;t[15]!==p||t[16]!==C||t[17]!==P||t[18]!==f||t[19]!==o||t[20]!==D?(O={initialServerId:o,allServerIds:p,projects:f,lastActiveProject:P,hostConnectionStatusByServerId:C,workspaceMultiplicityByServerId:D},t[15]=p,t[16]=C,t[17]=P,t[18]=f,t[19]=o,t[20]=D,t[21]=O):O=t[21];const{selectedServerId:W,hostPickerOpen:M,handleSelectHost:R,handleHostPickerOpenChange:T,openHostPicker:B}=et(O);let _;return t[22]!==l||t[23]!==T||t[24]!==R||t[25]!==M||t[26]!==P||t[27]!==B||t[28]!==f||t[29]!==I||t[30]!==W?(_={allHosts:l,selectedServerId:W,hostPickerOpen:M,handleSelectHost:R,handleHostPickerOpenChange:T,openHostPicker:B,projects:f,routeProject:I,lastActiveProject:P},t[22]=l,t[23]=T,t[24]=R,t[25]=M,t[26]=P,t[27]=B,t[28]=f,t[29]=I,t[30]=W,t[31]=_):_=t[31],_}function rt(e){return e.serverId}function ot(n){const{theme:a}=(0,p.useUnistyles)(),{t:l}=(0,c.useTranslation)(),{isCompact:u,isPending:f,project:h,host:S,isolation:I,base:k}=n,y=S.allHosts.find(e=>e.serverId===S.selectedServerId)?.label??"Host",j=S.allHosts.length>1,x=Be(l,I.effectiveIsolation),C=(0,s.useCallback)(({pressed:e,hovered:t})=>[nt.badge,Boolean(t)&&!f&&nt.badgeHovered,e&&!f&&nt.badgePressed,f&&nt.badgeDisabled],[f]),D=(0,ce.jsxs)(e.View,{children:[(0,ce.jsx)(be,{pickerAnchorRef:h.anchorRef,onPress:h.open,disabled:f,badgePressableStyle:C,label:h.triggerLabel,projectKey:h.selectedProject?.projectKey??null,iconDataUri:h.selectedProject?h.iconDataByProjectKey.get(h.selectedProject.projectKey)??null:null,iconColor:a.colors.foregroundMuted,iconSize:a.iconSize.sm}),(0,ce.jsx)(P.Combobox,{options:h.options,value:h.selectedOptionId,onSelect:h.onSelect,searchable:!0,searchPlaceholder:"Search projects",title:"Project",open:h.openState,onOpenChange:h.onOpenChange,desktopPlacement:"bottom-start",anchorRef:h.anchorRef,emptyText:"No projects available.",renderOption:h.renderOption})]}),O=j?(0,ce.jsx)(e.View,{children:(0,ce.jsx)(v.HostPicker,{hosts:S.allHosts,value:S.selectedServerId,onSelect:S.onSelect,open:S.openState,onOpenChange:S.onOpenChange,anchorRef:S.anchorRef,searchable:!1,title:"Host",desktopPlacement:"bottom-start",hostOptionTestID:Oe,children:(0,ce.jsxs)(o.Pressable,{ref:S.anchorRef,onPress:S.open,disabled:f||0===S.allHosts.length,style:C,testID:"host-picker-trigger",children:[(0,ce.jsx)(w.HostStatusDot,{serverId:S.selectedServerId}),(0,ce.jsx)(t.Text,{style:nt.badgeText,numberOfLines:1,children:y}),(0,ce.jsx)(b.ChevronDown,{size:a.iconSize.sm,color:a.colors.foregroundMuted})]})})}):null,W=I.canCreateWorktree?(0,ce.jsxs)(e.View,{children:[(0,ce.jsx)(Me,{pickerAnchorRef:I.anchorRef,onPress:I.open,disabled:f,badgePressableStyle:C,isolation:I.effectiveIsolation,label:x,iconColor:a.colors.foregroundMuted,iconSize:a.iconSize.sm}),(0,ce.jsx)(P.Combobox,{options:I.options,value:I.effectiveIsolation,onSelect:I.onSelect,title:l("newWorkspace.isolation.label"),open:I.openState,onOpenChange:I.onOpenChange,desktopPlacement:"bottom-start",anchorRef:I.anchorRef,renderOption:I.renderOption})]}):null,M=k.showRefPicker?(0,ce.jsxs)(e.View,{children:[(0,ce.jsx)(Se,{pickerAnchorRef:k.anchorRef,onPress:k.open,disabled:f||!k.selectedSourceDirectory,badgePressableStyle:C,selectedItem:k.selectedItem,triggerLabel:k.triggerLabel,accessibilityLabel:l("newWorkspace.refPicker.startingRef"),tooltipLabel:l("newWorkspace.refPicker.chooseStart"),iconColor:a.colors.foregroundMuted,iconSize:a.iconSize.sm}),(0,ce.jsx)(P.Combobox,{options:k.options,value:k.selectedOptionId,onSelect:k.onSelect,searchable:!0,searchPlaceholder:l("newWorkspace.refPicker.searchPlaceholder"),title:l("newWorkspace.refPicker.title"),open:k.openState,onOpenChange:k.onOpenChange,onSearchQueryChange:k.setSearchQuery,desktopPlacement:"bottom-start",anchorRef:k.anchorRef,emptyText:k.emptyText,renderOption:k.renderOption})]}):null;return u?(0,ce.jsxs)(e.View,{testID:"new-workspace-ref-picker-row",style:nt.formStack,children:[(0,ce.jsx)(Re,{children:D}),O?(0,ce.jsx)(Re,{children:O}):null,W?(0,ce.jsx)(Re,{children:W}):(0,ce.jsx)(e.View,{style:nt.baseSpacer}),M?(0,ce.jsx)(Re,{children:M}):(0,ce.jsx)(e.View,{style:nt.baseSpacer})]}):(0,ce.jsxs)(e.View,{testID:"new-workspace-ref-picker-row",style:nt.formStackDesktop,children:[D,O,W,M]})}const nt=p.StyleSheet.create(e=>({container:{flex:1,backgroundColor:e.colors.surface0,userSelect:"none",uni__dependencies:[0]},content:{position:"relative",flex:1,alignItems:"center"},contentCentered:{justifyContent:"center",paddingBottom:R.HEADER_INNER_HEIGHT+e.spacing[6],uni__dependencies:[0]},contentCompact:{justifyContent:"flex-end"},centered:{width:"100%",maxWidth:R.MAX_CONTENT_WIDTH},composerTitleContainer:{marginBottom:e.spacing[8],paddingLeft:e.spacing[6],paddingRight:e.spacing[4],uni__dependencies:[0]},composerTitle:{fontSize:e.fontSize.xl,fontWeight:e.fontWeight.normal,color:e.colors.foreground,uni__dependencies:[0]},errorText:{fontSize:e.fontSize.sm,color:e.colors.destructive,lineHeight:20,uni__dependencies:[0]},formStack:{marginBottom:e.spacing[8],gap:e.spacing[2],uni__dependencies:[0]},formStackDesktop:{flexDirection:"row",alignItems:"center",marginBottom:e.spacing[8],paddingLeft:e.spacing[4],gap:e.spacing[2],uni__dependencies:[0]},row:{flexDirection:"row",alignItems:"center",paddingLeft:e.spacing[4],gap:e.spacing[1],uni__dependencies:[0]},baseSpacer:{height:28},badge:{flexDirection:"row",alignItems:"center",height:28,maxWidth:240,overflow:"hidden",paddingHorizontal:e.spacing[2],borderRadius:e.borderRadius["2xl"],gap:e.spacing[1],uni__dependencies:[0]},checkoutHintBadge:{flexDirection:"row",alignItems:"center",height:28,maxWidth:240,paddingHorizontal:e.spacing[2],borderRadius:e.borderRadius["2xl"],gap:e.spacing[1],backgroundColor:e.colors.surface1,uni__dependencies:[0]},checkoutHintAction:{width:e.iconSize.md,height:e.iconSize.md,alignItems:"center",justifyContent:"center",borderRadius:e.borderRadius.full,uni__dependencies:[0]},badgeHovered:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},badgePressed:{backgroundColor:e.colors.surface0,uni__dependencies:[0]},badgeDisabled:{opacity:.6},badgeText:{minWidth:0,fontSize:e.fontSize.sm,color:e.colors.foregroundMuted,flexShrink:1,uni__dependencies:[0]},tooltipText:{fontSize:e.fontSize.sm,color:e.colors.popoverForeground,uni__dependencies:[0]},badgeIconBox:{width:e.iconSize.md,height:e.iconSize.md,alignItems:"center",justifyContent:"center",flexShrink:0,uni__dependencies:[0]},projectIcon:{width:e.iconSize.md,height:e.iconSize.md,borderRadius:e.borderRadius.sm,uni__dependencies:[0]},projectIconFallback:{width:e.iconSize.md,height:e.iconSize.md,borderRadius:e.borderRadius.sm,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},projectIconFallbackText:{fontSize:10,fontWeight:"600"},rowIconBox:{width:e.iconSize.md,height:e.iconSize.md,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},hostStatusDot:{width:8,height:8,borderRadius:4}}))},4645,[348,711,1572,349,36,1573,1308,234,146,444,56,1320,3912,916,1600,3925,3916,3947,4011,3455,3454,3624,3456,3928,3573,3568,4406,4407,3457,3499,4076,4062,3271,3594,3487,3414,3525,3494,4082,3596,3478,4521,3884,3943,3416,3948,3532,3486,3592,3670,3841,4646,4647,4648,4649,4650,4651,279]);
|
|
16405
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.isEmptyWorkspaceSubmission=function(t){return!t.text.trim()&&0===t.attachments.length},e.runCreateEmptyWorkspace=async function(t){const{payload:n,ensureWorkspace:s,serverId:c,navigate:o}=t,u=await s({cwd:n.cwd,prompt:"",attachments:[],withInitialAgent:!1});o(c,u.id)}},4646,[]);
|
|
16406
|
-
__d(function(g,r,i,a,m,e,d){"use strict";
|
|
16407
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16408
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16409
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16410
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16411
|
-
__d(function(g,r,i,a,m,e,d){"use strict";function t({
|
|
16412
|
-
__d(function(g,r,i,a,m,e,d){"use strict";
|
|
16413
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),
|
|
16414
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16415
|
-
__d(function(g,r,i,a,m,
|
|
16416
|
-
__d(function(g,r,i,a,m,
|
|
16417
|
-
__d(function(g,r,i,a,m,
|
|
16418
|
-
__d(function(g,r,i,a,m,_e,
|
|
16419
|
-
__d(function(g,r,i,a,m,
|
|
16420
|
-
__d(function(g,
|
|
16421
|
-
__d(function(g,
|
|
16422
|
-
__d(function(g,r,i,a,m,
|
|
16423
|
-
__d(function(g,r,
|
|
16424
|
-
__d(function(g,r,
|
|
16425
|
-
__d(function(g,r,
|
|
16426
|
-
__d(function(g,r,
|
|
16427
|
-
__d(function(g,r,
|
|
16428
|
-
__d(function(g,r,
|
|
16429
|
-
__d(function(g,r,i,a,m,e,d){const t=r(d[0]);function
|
|
16430
|
-
__d(function(g,r,
|
|
16431
|
-
__d(function(g,r,_i,a,m,e,d){const n=
|
|
16432
|
-
__d(function(g,r,
|
|
16433
|
-
__d(function(g,r,i,a,m,
|
|
16434
|
-
__d(function(g,r,i,a,m,
|
|
16435
|
-
__d(function(g,r,i,a,m,e,d){
|
|
16436
|
-
__d(function(g,r,i,a,m,e,
|
|
16437
|
-
__d(function(g,r,
|
|
16438
|
-
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]);function
|
|
16439
|
-
__d(function(g,r,_i,a,m,e,d){const t=r(d[0])
|
|
16440
|
-
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]);function
|
|
16441
|
-
__d(function(g,r,_i,a,m,e,d){const t=r(d[0])
|
|
16442
|
-
__d(function(g,r,
|
|
16443
|
-
__d(function(g,r,i,
|
|
16444
|
-
__d(function(g,r,
|
|
16445
|
-
__d(function(g,r,_i,a,m,e,d){
|
|
16446
|
-
__d(function(g,r,
|
|
16447
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";
|
|
16448
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return
|
|
16449
|
-
__d(function(g,r,i,a,m,
|
|
16450
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"
|
|
16451
|
-
__d(function(g,r,i,a,m,
|
|
16452
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";
|
|
16453
|
-
__d(function(g,r,i,
|
|
16454
|
-
__d(function(g,r,i,
|
|
16455
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),
|
|
16456
|
-
__d(function(g,r,i,a,m,
|
|
16457
|
-
__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.
|
|
16458
|
-
__d(function(g,r,i,a,m,_e,
|
|
16459
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"
|
|
16460
|
-
__d(function(g,r,i,a,m,
|
|
16461
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),
|
|
16462
|
-
__d(function(g,r,i,
|
|
16463
|
-
__d(function(g,r,i,
|
|
16464
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.ScheduleFormSheet=function({serverId:n,visible:l,onClose:c,mode:u,schedule:h}){const x="edit"===u,T=x&&"agent"===h?.target.type,{projects:C}=(0,I.useProjects)(),{agents:V}=(0,S.useAggregatedAgents)({includeArchived:!0}),B=(0,s.useMemo)(()=>D(C),[C]),L=(0,s.useMemo)(()=>{if(!h||"agent"!==h.target.type)return null;const{agentId:t}=h.target,o=V.find(o=>o.serverId===n&&o.id===t);return o?o.title?.trim()||"Untitled agent":"Agent unavailable"},[V,h,n]),N=(0,s.useMemo)(()=>Array.from(new Set(B.targets.map(t=>t.serverId))),[B.targets]),E=(0,s.useMemo)(()=>x?k(h):void 0,[x,h]),$=(0,j.useAgentFormState)({initialServerId:n??null,initialValues:E,isVisible:l,isCreateFlow:!0,onlineServerIds:N}),{selectedServerId:U,selectedProvider:J,selectedModel:X,selectedMode:q,selectedThinkingOptionId:G,workingDir:Q,setProviderAndModelFromUser:Y,clearProviderSelectionFromUser:Z,setModeFromUser:ee,setSelectedServerId:te,setSelectedServerIdFromUser:re,setWorkingDir:oe,setWorkingDirFromUser:ne,modeOptions:le,modelSelectorProviders:se,isAllModelsLoading:ie,persistFormPreferences:ce}=$,de=(0,s.useMemo)(()=>R({targets:B.targets,serverId:U,cwd:Q}),[B.targets,U,Q]),ae=de?.optionId??"",ue=de?.serverId??U??n??"",ge=(0,s.useCallback)(t=>{U&&U!==t.serverId&&Z(),re(t.serverId),ne(t.cwd)},[Z,U,re,ne]),pe=(0,s.useCallback)(({selectedModelLabel:t,disabled:o,isOpen:n,hovered:l,pressed:s})=>(0,P.jsx)(H,{label:t,provider:J,disabled:o,active:l||s||n,isPlaceholder:!X}),[X,J]),{createSchedule:me,updateSchedule:he,isCreating:be,isUpdating:fe}=(0,y.useScheduleMutations)({serverId:ue}),xe=be||fe,[ve,ye]=(0,s.useState)(()=>h?.name??""),[je,Se]=(0,s.useState)(()=>h?.prompt??""),[Ie,Te]=(0,s.useState)(()=>null!=h?.maxRuns?String(h.maxRuns):""),[_e,we]=(0,s.useState)(()=>h?.cadence??M),[Ce,Pe]=(0,s.useState)(null),[Me,Ve]=(0,s.useState)(0),ke=(0,s.useRef)(!1);(0,s.useEffect)(()=>{l&&!ke.current&&(ye(h?.name??""),Se(h?.prompt??""),Te(null!=h?.maxRuns?String(h.maxRuns):""),we(h?.cadence??M),Pe(null),Ve(t=>t+1),x||(te(null),oe(""))),ke.current=l},[l,h,x,te,oe]);const De=je.trim(),Re=Q.trim(),ze="cron"===_e.type?(0,_.validateCron)(_e.expression):null,Oe=z({providers:se,selectedProvider:J,selectedModel:X}),Ae=A({isAgentTarget:T,isEdit:x,promptTrimmed:De,cadenceError:ze,isSubmitting:xe,selectedModelIsValid:Oe,hasWorkingDir:Re.length>0,hasSelectedProject:Boolean(de)}),Fe=(0,s.useCallback)(async()=>!!h&&(await he({id:h.id,name:ve.trim()||null,prompt:De,cadence:_e,maxRuns:O(Ie)}),!0),[_e,Ie,ve,De,h,he]),Be=(0,s.useCallback)(async()=>{if(!J||!Re)return!1;await ce();const t=O(Ie);return x&&h?(await he({id:h.id,name:ve.trim()||null,prompt:De,cadence:_e,newAgentConfig:{provider:J,model:X||null,modeId:q||null,cwd:Re},maxRuns:t}),!0):(await me(Object.assign({prompt:De,name:ve.trim()||void 0,cadence:_e,target:{type:"new-agent",config:{provider:J,cwd:Re,model:X||void 0,modeId:q||void 0,thinkingOptionId:G||void 0,title:ve.trim()||void 0}}},null!=t?{maxRuns:t}:{})),!0)},[_e,me,x,Ie,ve,ce,De,h,q,X,J,G,Re,he]),Le=(0,s.useCallback)(async()=>{if(De){Pe(null);try{(T?await Fe():await Be())&&c()}catch(t){Pe((0,w.toErrorMessage)(t))}}},[T,c,De,Fe,Be]),We=(0,s.useCallback)(()=>{Le()},[Le]),Ne=(0,s.useMemo)(()=>({title:x?"Edit schedule":"New schedule"}),[x]),Ee=(0,s.useMemo)(()=>(0,P.jsxs)(t.View,{style:K.footer,children:[(0,P.jsx)(b.Button,{style:K.footerButton,variant:"secondary",onPress:c,disabled:xe,children:"Cancel"}),(0,P.jsx)(b.Button,{style:K.footerButton,variant:"default",onPress:We,disabled:!Ae,loading:xe,testID:"schedule-form-submit",children:x?"Save changes":"Create schedule"})]}),[Ae,We,x,xe,c]);return(0,P.jsxs)(p.AdaptiveModalSheet,{header:Ne,visible:l,onClose:c,footer:Ee,webScrollbar:!0,testID:"schedule-form-sheet",children:[(0,P.jsxs)(t.View,{style:K.field,children:[(0,P.jsx)(o.Text,{style:K.label,children:"Name"}),(0,P.jsx)(p.AdaptiveTextInput,{testID:"schedule-name-input",accessibilityLabel:"Schedule name",initialValue:ve,resetKey:`schedule-name-${Me}`,value:ve,onChangeText:ye,placeholder:"Optional",style:K.input,autoCapitalize:"none",autoCorrect:!1})]}),(0,P.jsxs)(t.View,{style:K.field,children:[(0,P.jsx)(o.Text,{style:K.label,children:"Prompt"}),(0,P.jsx)(p.AdaptiveTextInput,{testID:"schedule-prompt-input",accessibilityLabel:"Prompt",initialValue:je,resetKey:`schedule-prompt-${Me}`,value:je,onChangeText:Se,placeholder:"What should the agent do each run?",style:K.multilineInput,multiline:!0,numberOfLines:4,textAlignVertical:"top"})]}),T?(0,P.jsxs)(t.View,{style:K.field,children:[(0,P.jsx)(o.Text,{style:K.label,children:"Target"}),(0,P.jsx)(t.View,{style:K.readonlyField,testID:"schedule-agent-target",children:(0,P.jsx)(o.Text,{style:K.selectTriggerText,numberOfLines:1,children:L})}),(0,P.jsx)(o.Text,{style:K.hint,children:"Runs against this existing agent."})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(t.View,{style:K.field,children:[(0,P.jsx)(o.Text,{style:K.label,children:"Project"}),(0,P.jsx)(W,{options:B.options,targetByOptionId:B.targetByOptionId,value:ae,selectedTarget:de,fallbackCwd:Q,onSelect:ge})]}),(0,P.jsxs)(t.View,{style:K.field,children:[(0,P.jsx)(o.Text,{style:K.label,children:"Model"}),(0,P.jsx)(f.CombinedModelSelector,{providers:se,selectedProvider:J??"",selectedModel:X,onSelect:Y,isLoading:ie,renderTrigger:pe,triggerFill:!0,serverId:ue})]}),le.length>0?(0,P.jsx)(F,{options:le,selectedMode:q,onSelect:ee}):null]}),(0,P.jsxs)(t.View,{style:K.field,children:[(0,P.jsx)(o.Text,{style:K.label,children:"Cadence"}),(0,P.jsx)(v.CadenceEditor,{value:_e,onChange:we,error:ze??void 0})]}),(0,P.jsxs)(t.View,{style:K.field,children:[(0,P.jsx)(o.Text,{style:K.label,children:"Max runs"}),(0,P.jsx)(p.AdaptiveTextInput,{testID:"schedule-max-runs-input",accessibilityLabel:"Max runs",initialValue:Ie,resetKey:`schedule-max-runs-${Me}`,value:Ie,onChangeText:Te,placeholder:"Unlimited",style:K.input,keyboardType:"number-pad"}),(0,P.jsx)(o.Text,{style:K.hint,children:"Leave blank to run indefinitely"})]}),Ce?(0,P.jsx)(o.Text,{style:K.error,children:Ce}):null]})};var t=r(d[0]),o=r(d[1]),n=r(d[2]),l=r(d[3]),s=r(d[4]);r(d[5]),r(d[6]),r(d[7]);var c=r(d[8]),u=r(d[9]),p=r(d[10]),h=r(d[11]),b=r(d[12]),f=r(d[13]),x=r(d[14]),v=r(d[15]),y=r(d[16]),j=r(d[17]),S=r(d[18]),I=r(d[19]),T=r(d[20]),_=r(d[21]),w=r(d[22]),C=r(d[23]),P=r(d[24]);const M={type:"every",everyMs:36e5};function V(t){return t&&"new-agent"===t.target.type?t.target.config:null}function k(t){const o=V(t);if(o)return{provider:o.provider,model:o.model??null,modeId:o.modeId??null,workingDir:o.cwd}}function D(t){const o=(0,T.buildScheduleProjectTargets)(t),n=new Map(o.map(t=>[t.optionId,t])),l=o.map(t=>({id:t.optionId,label:t.projectName,description:`${t.serverName} - ${(0,C.shortenPath)(t.cwd)}`}));return{targets:o,options:l,targetByOptionId:n}}function R(t){const o=t.cwd.trim();return t.serverId&&o?t.targets.find(n=>n.serverId===t.serverId&&n.cwd===o)??null:null}function z(t){if(!t.selectedProvider)return!1;const o=t.providers.find(o=>o.id===t.selectedProvider);if(!o||"models"!==o.modelSelection.kind)return!1;const n=t.selectedModel.trim();return!n||o.modelSelection.rows.some(t=>t.modelId===n)}function O(t){const o=Number.parseInt(t,10);return Number.isFinite(o)&&o>0?o:null}function A(t){return 0!==t.promptTrimmed.length&&null===t.cadenceError&&!t.isSubmitting&&(!!t.isAgentTarget||!!t.selectedModelIsValid&&(t.isEdit?t.hasWorkingDir:t.hasSelectedProject))}function F(u){const p=(0,l.c)(27),{options:b,selectedMode:f,onSelect:x}=u,v=(0,s.useRef)(null),[y,j]=(0,s.useState)(!1);let S;p[0]!==b?(S=b.map(L),p[0]=b,p[1]=S):S=p[1];const I=S;let T;p[2]!==b||p[3]!==f?(T=b.find(t=>t.id===f)?.label??"Default mode",p[2]=b,p[3]=f,p[4]=T):T=p[4];const _=T;let w;p[5]!==x?(w=t=>{x(t),j(!1)},p[5]=x,p[6]=w):w=p[6];const C=w;let M;p[7]===Symbol.for("react.memo_cache_sentinel")?(M=()=>{j(B)},p[7]=M):M=p[7];const V=M;let k;p[8]!==y?(k=t=>{const{hovered:o,pressed:n}=t;return[K.selectTrigger,(Boolean(o)||n||y)&&K.selectTriggerActive]},p[8]=y,p[9]=k):k=p[9];const D=k;let R;p[10]===Symbol.for("react.memo_cache_sentinel")?(R=(0,P.jsx)(o.Text,{style:K.label,children:"Mode"}),p[10]=R):R=p[10];const z=`Select mode (${_})`;let O,A,F;p[11]!==_?(O=(0,P.jsx)(o.Text,{style:K.selectTriggerText,numberOfLines:1,children:_}),p[11]=_,p[12]=O):O=p[12],p[13]===Symbol.for("react.memo_cache_sentinel")?(A=(0,P.jsx)(c.ChevronDown,{size:16,color:K.chevron.color}),p[13]=A):A=p[13],p[14]!==z||p[15]!==O||p[16]!==D?(F=(0,P.jsx)(t.View,{ref:v,collapsable:!1,children:(0,P.jsxs)(n.Pressable,{onPress:V,style:D,accessibilityRole:"button",accessibilityLabel:z,testID:"schedule-mode-trigger",children:[O,A]})}),p[14]=z,p[15]=O,p[16]=D,p[17]=F):F=p[17];const W=I.length>6;let N,E;return p[18]!==I||p[19]!==C||p[20]!==y||p[21]!==f||p[22]!==W?(N=(0,P.jsx)(h.Combobox,{options:I,value:f,onSelect:C,searchable:W,title:"Select mode",open:y,onOpenChange:j,anchorRef:v,desktopPlacement:"bottom-start"}),p[18]=I,p[19]=C,p[20]=y,p[21]=f,p[22]=W,p[23]=N):N=p[23],p[24]!==F||p[25]!==N?(E=(0,P.jsxs)(t.View,{style:K.field,children:[R,F,N]}),p[24]=F,p[25]=N,p[26]=E):E=p[26],E}function B(t){return!t}function L(t){return{id:t.id,label:t.label}}function W(u){const p=(0,l.c)(31),{options:b,targetByOptionId:f,value:x,selectedTarget:v,fallbackCwd:y,onSelect:j}=u,S=(0,s.useRef)(null),[I,T]=(0,s.useState)(!1);let _;p[0]!==j||p[1]!==f?(_=t=>{const o=f.get(t);o&&(j(o),T(!1))},p[0]=j,p[1]=f,p[2]=_):_=p[2];const w=_;let M;p[3]===Symbol.for("react.memo_cache_sentinel")?(M=()=>{T(E)},p[3]=M):M=p[3];const V=M;let k;p[4]!==I?(k=t=>{const{hovered:o,pressed:n}=t;return[K.selectTrigger,(Boolean(o)||n||I)&&K.selectTriggerActive]},p[4]=I,p[5]=k):k=p[5];const D=k;let R,z;p[6]!==y||p[7]!==v?.projectName?(R=y.trim(),z=v?.projectName??(R?(0,C.shortenPath)(R):"Select project"),p[6]=y,p[7]=v?.projectName,p[8]=R,p[9]=z):(R=p[8],z=p[9]);const O=z,A=!v&&!R;let F;p[10]!==v?(F=v?`${v.serverName} - ${(0,C.shortenPath)(v.cwd)}`:null,p[10]=v,p[11]=F):F=p[11];const B=F,L=N,W=`Select project (${O})`,$=A?K.selectTriggerPlaceholder:K.selectTriggerText;let U,H,J,X,q,G;return p[12]!==O||p[13]!==$?(U=(0,P.jsx)(o.Text,{style:$,numberOfLines:1,children:O}),p[12]=O,p[13]=$,p[14]=U):U=p[14],p[15]===Symbol.for("react.memo_cache_sentinel")?(H=(0,P.jsx)(c.ChevronDown,{size:16,color:K.chevron.color}),p[15]=H):H=p[15],p[16]!==W||p[17]!==U||p[18]!==D?(J=(0,P.jsx)(t.View,{ref:S,collapsable:!1,children:(0,P.jsxs)(n.Pressable,{onPress:V,style:D,accessibilityRole:"button",accessibilityLabel:W,testID:"schedule-project-trigger",children:[U,H]})}),p[16]=W,p[17]=U,p[18]=D,p[19]=J):J=p[19],p[20]!==B?(X=B?(0,P.jsx)(o.Text,{style:K.hint,children:B}):null,p[20]=B,p[21]=X):X=p[21],p[22]!==w||p[23]!==I||p[24]!==b||p[25]!==x?(q=(0,P.jsx)(h.Combobox,{options:b,value:x,onSelect:w,searchable:!0,searchPlaceholder:"Search projects...",emptyText:"No projects found",title:"Select project",open:I,onOpenChange:T,anchorRef:S,desktopPlacement:"bottom-start",renderOption:L}),p[22]=w,p[23]=I,p[24]=b,p[25]=x,p[26]=q):q=p[26],p[27]!==J||p[28]!==X||p[29]!==q?(G=(0,P.jsxs)(P.Fragment,{children:[J,X,q]}),p[27]=J,p[28]=X,p[29]=q,p[30]=G):G=p[30],G}function N(t){const{option:o,selected:n,active:l,onPress:s}=t;return(0,P.jsx)($,{option:o,selected:n,active:l,onPress:s})}function E(t){return!t}function $(o){const n=(0,l.c)(10),{option:s,selected:u,active:p,onPress:b}=o;let f;n[0]===Symbol.for("react.memo_cache_sentinel")?(f=(0,P.jsx)(t.View,{style:K.optionIconBox,children:(0,P.jsx)(c.Folder,{size:16,color:K.chevron.color})}),n[0]=f):f=n[0];const x=f;let v;let y;return n[1]!==s.id?(v=`schedule-project-option-${s.id.slice(T.PROJECT_OPTION_PREFIX.length).replace(/^[^:]+:/,"")}`,n[1]=s.id,n[2]=v):v=n[2],n[3]!==p||n[4]!==b||n[5]!==s.description||n[6]!==s.label||n[7]!==u||n[8]!==v?(y=(0,P.jsx)(h.ComboboxItem,{testID:v,label:s.label,description:s.description,selected:u,active:p,onPress:b,leadingSlot:x}),n[3]=p,n[4]=b,n[5]=s.description,n[6]=s.label,n[7]=u,n[8]=v,n[9]=y):y=n[9],y}function U(t){const o=(0,l.c)(4),{provider:n}=t;if(!n)return null;let s;o[0]!==n?(s=(0,x.getProviderIcon)(n),o[0]=n,o[1]=s):s=o[1];const c=s;let u;return o[2]!==c?(u=(0,P.jsx)(c,{size:16,color:K.providerIcon.color}),o[2]=c,o[3]=u):u=o[3],u}function H(n){const s=(0,l.c)(13),{label:u,provider:p,disabled:h,active:b,isPlaceholder:f}=n,x=b&&K.selectTriggerActive,v=h&&K.selectTriggerDisabled;let y;s[0]!==x||s[1]!==v?(y=[K.selectTrigger,x,v],s[0]=x,s[1]=v,s[2]=y):y=s[2];const j=y;let S;s[3]!==p?(S=(0,P.jsx)(U,{provider:p}),s[3]=p,s[4]=S):S=s[4];const I=f?K.selectTriggerPlaceholder:K.selectTriggerText;let T,_,w;return s[5]!==u||s[6]!==I?(T=(0,P.jsx)(o.Text,{style:I,numberOfLines:1,children:u}),s[5]=u,s[6]=I,s[7]=T):T=s[7],s[8]===Symbol.for("react.memo_cache_sentinel")?(_=(0,P.jsx)(c.ChevronDown,{size:16,color:K.chevron.color}),s[8]=_):_=s[8],s[9]!==j||s[10]!==S||s[11]!==T?(w=(0,P.jsxs)(t.View,{pointerEvents:"none",style:j,testID:"schedule-model-trigger",children:[S,T,_]}),s[9]=j,s[10]=S,s[11]=T,s[12]=w):w=s[12],w}const K=u.StyleSheet.create(t=>({field:{gap:t.spacing[2],uni__dependencies:[0]},label:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,fontWeight:t.fontWeight.medium,uni__dependencies:[0]},input:{backgroundColor:t.colors.surface2,borderRadius:t.borderRadius.lg,paddingHorizontal:t.spacing[4],paddingVertical:t.spacing[3],color:t.colors.foreground,borderWidth:1,borderColor:t.colors.border,fontSize:t.fontSize.base,uni__dependencies:[0]},multilineInput:{backgroundColor:t.colors.surface2,borderRadius:t.borderRadius.lg,paddingHorizontal:t.spacing[4],paddingVertical:t.spacing[3],color:t.colors.foreground,borderWidth:1,borderColor:t.colors.border,fontSize:t.fontSize.base,minHeight:96,uni__dependencies:[0]},hint:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,uni__dependencies:[0]},error:{color:t.colors.palette.red[300],fontSize:t.fontSize.xs,uni__dependencies:[0]},readonlyField:{flexDirection:"row",alignItems:"center",backgroundColor:t.colors.surface2,borderRadius:t.borderRadius.lg,borderWidth:1,borderColor:t.colors.border,paddingHorizontal:t.spacing[4],paddingVertical:t.spacing[3],minHeight:44,uni__dependencies:[0]},selectTrigger:{flexDirection:"row",alignItems:"center",gap:t.spacing[2],backgroundColor:t.colors.surface2,borderRadius:t.borderRadius.lg,borderWidth:1,borderColor:t.colors.border,paddingHorizontal:t.spacing[4],paddingVertical:t.spacing[3],minHeight:44,uni__dependencies:[0]},selectTriggerActive:{borderColor:t.colors.borderAccent,uni__dependencies:[0]},selectTriggerDisabled:{opacity:t.opacity[50],uni__dependencies:[0]},selectTriggerText:{flex:1,minWidth:0,color:t.colors.foreground,fontSize:t.fontSize.base,uni__dependencies:[0]},selectTriggerPlaceholder:{flex:1,minWidth:0,color:t.colors.foregroundMuted,fontSize:t.fontSize.base,uni__dependencies:[0]},optionIconBox:{width:18,height:18,alignItems:"center",justifyContent:"center"},footer:{flex:1,flexDirection:"row",gap:t.spacing[3],uni__dependencies:[0]},footerButton:{flex:1},providerIcon:{color:t.colors.foregroundMuted,uni__dependencies:[0]},chevron:{color:t.colors.foregroundMuted,uni__dependencies:[0]}}))},4705,[348,711,1572,349,36,1308,234,146,1600,56,3466,3456,3627,3941,3929,4706,4709,4077,3447,3895,4712,4707,3948,3511,279]);
|
|
16465
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.CadenceEditor=function(o){const c=(0,s.c)(65),{value:S,onChange:T,error:w}=o,I=S.type;let R;c[0]!==S.everyMs||c[1]!==S.type?(R=()=>String((0,y.everyMsToParts)("every"===S.type?S.everyMs:f).value),c[0]=S.everyMs,c[1]=S.type,c[2]=R):R=c[2];const[V,H]=(0,l.useState)(R);let k;c[3]!==S.everyMs||c[4]!==S.type?(k=()=>(0,y.everyMsToParts)("every"===S.type?S.everyMs:f).unit,c[3]=S.everyMs,c[4]=S.type,c[5]=k):k=c[5];const[D,L]=(0,l.useState)(k);let W;c[6]!==S.expression||c[7]!==S.type?(W=()=>"cron"===S.type?S.expression:_,c[6]=S.expression,c[7]=S.type,c[8]=W):W=c[8];const[P,$]=(0,l.useState)(W),[E,F]=(0,l.useReducer)(j,0),N=(0,l.useRef)("cron"===S.type?S.expression:_);let A;if(c[9]!==V){const n=Number.parseInt(V,10);A=Number.isFinite(n)&&n>0?n:1,c[9]=V,c[10]=A}else A=c[10];const K=A;let O;c[11]!==T?(O=(n,t)=>{T({type:"every",everyMs:(0,y.partsToEveryMs)(n,t)})},c[11]=T,c[12]=O):O=c[12];const B=O;let U;c[13]!==T?(U=n=>{N.current=n,T({type:"cron",expression:n})},c[13]=T,c[14]=U):U=c[14];const q=U;let G;c[15]!==P||c[16]!==q||c[17]!==B||c[18]!==D||c[19]!==I||c[20]!==K?(G=n=>{n!==I&&("every"===n?B(K,D):q(P.trim()||N.current))},c[15]=P,c[16]=q,c[17]=B,c[18]=D,c[19]=I,c[20]=K,c[21]=G):G=c[21];const J=G;let Q;c[22]!==B||c[23]!==D?(Q=n=>{const t=n.replace(/[^0-9]/g,"");H(t);const o=Number.parseInt(t,10);B(Number.isFinite(o)&&o>0?o:1,D)},c[22]=B,c[23]=D,c[24]=Q):Q=c[24];const X=Q;let Y;c[25]!==B||c[26]!==K?(Y=n=>{L(n),B(K,n)},c[25]=B,c[26]=K,c[27]=Y):Y=c[27];const Z=Y;let ee;c[28]!==q?(ee=n=>{$(n),q(n.trim())},c[28]=q,c[29]=ee):ee=c[29];const ne=ee;let re;c[30]!==q?(re=n=>{$(n),F(),q(n)},c[30]=q,c[31]=re):re=c[31];const te=re;let oe;c[32]!==D||c[33]!==K?(oe=C(K,D),c[32]=D,c[33]=K,c[34]=oe):oe=c[34];const se=oe;let ie,le,ce;c[35]!==P?(ce=P.trim(),ie=ce?(0,y.validateCron)(ce):null,le=ie?null:(0,y.describeCron)(ce)??ce,c[35]=P,c[36]=ie,c[37]=le,c[38]=ce):(ie=c[36],le=c[37],ce=c[38]);const ae=le;let de,ue,pe,ye,be=null;if(ie){let n;c[39]!==ie?(n=(0,b.jsx)(t.Text,{style:M.error,children:ie}),c[39]=ie,c[40]=n):n=c[40],be=n}else if(ae){let n;c[41]!==ae?(n=(0,b.jsx)(t.Text,{style:M.preview,children:ae}),c[41]=ae,c[42]=n):n=c[42],be=n}c[43]!==J||c[44]!==I?(de=(0,b.jsx)(p.SegmentedControl,{size:"sm",value:I,onValueChange:J,options:x,style:M.modeControl,testID:"cadence-mode"}),c[43]=J,c[44]=I,c[45]=de):de=c[45];c[46]!==be||c[47]!==P||c[48]!==E||c[49]!==ne||c[50]!==X||c[51]!==te||c[52]!==Z||c[53]!==se||c[54]!==D||c[55]!==V||c[56]!==I||c[57]!==ce?(ue="every"===I?(0,b.jsxs)(n.View,{style:M.section,children:[(0,b.jsxs)(n.View,{style:M.intervalRow,children:[(0,b.jsx)(u.AdaptiveTextInput,{testID:"cadence-interval-value",accessibilityLabel:"Interval value",initialValue:V,resetKey:`cadence-interval-${E}`,value:V,onChangeText:X,keyboardType:"number-pad",style:M.intervalInput}),(0,b.jsx)(p.SegmentedControl,{size:"sm",value:D,onValueChange:Z,options:h,testID:"cadence-interval-unit"})]}),(0,b.jsx)(t.Text,{style:M.preview,children:se})]}):(0,b.jsxs)(n.View,{style:M.section,children:[(0,b.jsx)(n.View,{style:M.presetRow,children:v.map(n=>(0,b.jsx)(z,{label:n.label,expression:n.expression,isSelected:ce===n.expression,onSelect:te},n.expression))}),(0,b.jsx)(u.AdaptiveTextInput,{testID:"cadence-cron-expression",accessibilityLabel:"Cron expression",initialValue:P,resetKey:`cadence-cron-${E}`,value:P,onChangeText:ne,placeholder:"0 9 * * *",autoCapitalize:"none",autoCorrect:!1,spellCheck:!1,style:M.cronInput}),be,(0,b.jsx)(t.Text,{style:M.hint,children:"Times are in UTC"})]}),c[46]=be,c[47]=P,c[48]=E,c[49]=ne,c[50]=X,c[51]=te,c[52]=Z,c[53]=se,c[54]=D,c[55]=V,c[56]=I,c[57]=ce,c[58]=ue):ue=c[58];c[59]!==w?(pe=w?(0,b.jsx)(t.Text,{style:M.error,children:w}):null,c[59]=w,c[60]=pe):pe=c[60];c[61]!==de||c[62]!==ue||c[63]!==pe?(ye=(0,b.jsxs)(n.View,{style:M.container,children:[de,ue,pe]}),c[61]=de,c[62]=ue,c[63]=pe,c[64]=ye):ye=c[64];return ye};var n=r(d[0]),t=r(d[1]),o=r(d[2]),s=r(d[3]),l=r(d[4]);r(d[5]),r(d[6]),r(d[7]);var c=r(d[8]),u=r(d[9]),p=r(d[10]),y=r(d[11]),b=r(d[12]);const v=[{label:"Every hour",expression:"0 * * * *"},{label:"Daily 9:00",expression:"0 9 * * *"},{label:"Weekdays 9:00",expression:"0 9 * * 1-5"},{label:"Mondays 9:00",expression:"0 9 * * 1"}],x=[{value:"every",label:"Interval"},{value:"cron",label:"Cron"}],h=[{value:"minutes",label:"Minutes"},{value:"hours",label:"Hours"},{value:"days",label:"Days"}],f=(0,y.partsToEveryMs)(1,"hours"),_="0 9 * * *",S={minutes:"minute",hours:"hour",days:"day"};function C(n,t){const o=S[t];return 1===n?`Runs every ${o}`:`Runs every ${n} ${o}s`}function j(n){return n+1}function z(n){const l=(0,s.c)(17),{label:c,expression:u,isSelected:p,onSelect:y}=n;let v;l[0]!==u||l[1]!==y?(v=()=>{y(u)},l[0]=u,l[1]=y,l[2]=v):v=l[2];const x=v;let h;l[3]!==p?(h=n=>{const{hovered:t,pressed:o}=n;return[M.chip,p&&M.chipSelected,!p&&(Boolean(t)||o)&&M.chipHover]},l[3]=p,l[4]=h):h=l[4];const f=h,_=p&&M.chipLabelSelected;let S;l[5]!==_?(S=[M.chipLabel,_],l[5]=_,l[6]=S):S=l[6];const C=S;let j;l[7]!==p?(j={selected:p},l[7]=p,l[8]=j):j=l[8];const z=j;let T,w;return l[9]!==c||l[10]!==C?(T=(0,b.jsx)(t.Text,{style:C,numberOfLines:1,children:c}),l[9]=c,l[10]=C,l[11]=T):T=l[11],l[12]!==z||l[13]!==f||l[14]!==x||l[15]!==T?(w=(0,b.jsx)(o.Pressable,{accessibilityRole:"button",accessibilityState:z,onPress:x,style:f,children:T}),l[12]=z,l[13]=f,l[14]=x,l[15]=T,l[16]=w):w=l[16],w}const M=c.StyleSheet.create(n=>({container:{gap:n.spacing[3],uni__dependencies:[0]},section:{gap:n.spacing[3],uni__dependencies:[0]},intervalRow:{flexDirection:"row",alignItems:"center",gap:n.spacing[3],uni__dependencies:[0]},intervalInput:{width:88,minHeight:44,backgroundColor:n.colors.surface2,borderRadius:n.borderRadius.lg,paddingHorizontal:n.spacing[4],paddingVertical:n.spacing[3],borderWidth:1,borderColor:n.colors.border,fontSize:n.fontSize.base,uni__dependencies:[0]},modeControl:{alignSelf:"flex-start"},presetRow:{flexDirection:"row",flexWrap:"wrap",gap:n.spacing[2],uni__dependencies:[0]},chip:{minHeight:32,alignItems:"center",justifyContent:"center",paddingHorizontal:n.spacing[3],paddingVertical:n.spacing[2],borderRadius:n.borderRadius.lg,borderWidth:1,borderColor:n.colors.border,backgroundColor:n.colors.surface2,uni__dependencies:[0]},chipHover:{backgroundColor:n.colors.surface3,uni__dependencies:[0]},chipSelected:{backgroundColor:n.colors.surface3,borderColor:n.colors.borderAccent,uni__dependencies:[0]},chipLabel:{fontSize:n.fontSize.xs,fontWeight:n.fontWeight.medium,color:n.colors.foregroundMuted,uni__dependencies:[0]},chipLabelSelected:{color:n.colors.foreground,uni__dependencies:[0]},cronInput:{minHeight:44,backgroundColor:n.colors.surface2,borderRadius:n.borderRadius.lg,paddingHorizontal:n.spacing[4],paddingVertical:n.spacing[3],borderWidth:1,borderColor:n.colors.border,fontSize:n.fontSize.sm,fontFamily:n.fontFamily.mono,uni__dependencies:[0]},preview:{fontSize:n.fontSize.xs,color:n.colors.foregroundMuted,uni__dependencies:[0]},hint:{fontSize:n.fontSize.xs,color:n.colors.foregroundMuted,uni__dependencies:[0]},error:{fontSize:n.fontSize.xs,color:n.colors.palette.red[300],uni__dependencies:[0]}}))},4706,[348,711,1572,349,36,1308,234,146,56,3466,4430,4707,279]);
|
|
16466
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16467
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16468
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16469
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),
|
|
16470
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"
|
|
16471
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"
|
|
16472
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),
|
|
16473
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16474
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16475
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),
|
|
16476
|
-
__d(function(g,r,i,
|
|
16477
|
-
__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16478
|
-
__d(function(g,r,i,
|
|
16479
|
-
__d(function(g,r,i,a,m,
|
|
16480
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return Je}});var t=r(d[0]),s=r(d[1]),n=r(d[2]),o=r(d[3]),l=r(d[4]),c=r(d[5]),u=r(d[6]),p=e(r(d[7]));r(d[8]),r(d[9]),r(d[10]),r(d[11]),r(d[12]);var h=r(d[13]),b=r(d[14]),S=r(d[15]),y=r(d[16]),x=r(d[17]),f=r(d[18]),j=r(d[19]),v=r(d[20]),w=r(d[21]),k=r(d[22]),T=r(d[23]),C=r(d[24]),V=r(d[25]),I=r(d[26]),H=r(d[27]),_=r(d[28]),L=r(d[29]),P=r(d[30]),z=r(d[31]),A=r(d[32]),D=r(d[33]),B=r(d[34]),M=r(d[35]),R=r(d[36]),O=r(d[37]),U=r(d[38]),K=r(d[39]),W=r(d[40]),F=r(d[41]),E=r(d[42]),G=r(d[43]),N=r(d[44]),q=r(d[45]),$=r(d[46]),Q=r(d[47]),J=r(d[48]),X=r(d[49]),Y=r(d[50]),Z=r(d[51]),ee=r(d[52]),te=r(d[53]),se=r(d[54]),ne=r(d[55]),ie=r(d[56]),oe=r(d[57]),le=r(d[58]),re=r(d[59]),ae=r(d[60]),ce=r(d[61]),de=e(r(d[62])),ue=e(r(d[63])),ge=r(d[64]),pe=r(d[65]),he=r(d[66]),be=r(d[67]),Se=r(d[68]),ye=r(d[69]),xe=r(d[70]);const fe=[{id:"general",labelKey:"settings.sections.general",icon:f.Settings},{id:"daemon",labelKey:"settings.sections.daemon",icon:f.Server,desktopOnly:!0},{id:"appearance",labelKey:"settings.sections.appearance",icon:f.Palette},{id:"shortcuts",labelKey:"settings.sections.shortcuts",icon:f.Keyboard,desktopOnly:!0},{id:"integrations",labelKey:"settings.sections.integrations",icon:f.Puzzle,desktopOnly:!0},{id:"permissions",labelKey:"settings.sections.permissions",icon:f.Shield,desktopOnly:!0},{id:"diagnostics",labelKey:"settings.sections.diagnostics",icon:f.Stethoscope},{id:"about",labelKey:"settings.sections.about",icon:f.Info}],me=[{id:"connections",labelKey:"settings.hostSections.connections",icon:f.Network},{id:"agents",labelKey:"settings.hostSections.agents",icon:f.Bot},{id:"workspaces",labelKey:"settings.hostSections.workspaces",icon:f.FolderGit2},{id:"providers",labelKey:"settings.hostSections.providers",icon:f.Boxes},{id:"usage",labelKey:"settings.hostSections.usage",icon:f.Gauge},{id:"terminals",labelKey:"settings.hostSections.terminals",icon:f.SquareTerminal},{id:"host",labelKey:"settings.hostSections.host",icon:f.Server}];function je(e,t){switch(e.section){case"connections":return(0,xe.jsx)(ce.HostConnectionsPage,{serverId:e.serverId});case"agents":return(0,xe.jsx)(ce.HostAgentsPage,{serverId:e.serverId});case"workspaces":return(0,xe.jsx)(ce.HostWorkspacesPage,{serverId:e.serverId});case"providers":return(0,xe.jsx)(ce.HostProvidersPage,{serverId:e.serverId});case"usage":return(0,xe.jsx)(ce.HostUsagePage,{serverId:e.serverId});case"terminals":return(0,xe.jsx)(ce.HostTerminalsPage,{serverId:e.serverId});case"host":return(0,xe.jsx)(ce.HostSettingsPage,{serverId:e.serverId,onHostRemoved:t})}}function ve({pressed:e}){return[Xe.themeTrigger,e&&{opacity:.85}]}function we({hovered:e}){return[Ze.item,Boolean(e)&&Ze.itemHovered]}function ke({hovered:e}){return[Ze.item,Boolean(e)&&Ze.itemHovered,Ze.itemSelected]}const Te=[oe.settingsStyles.row,oe.settingsStyles.rowBorder];function Ce(e){return[{value:"interrupt",label:e("settings.general.defaultSend.options.interrupt")},{value:"queue",label:e("settings.general.defaultSend.options.queue")}]}function Ve(e,t){return{ask:e("settings.general.serviceUrls.options.ask"),"in-app":e("settings.general.serviceUrls.options.inApp"),external:e("settings.general.serviceUrls.options.external")}[t]}function Ie(e){const t=(0,ae.parseAppLanguage)(e);return t&&"system"!==t?t:"en"}const He=["ask","in-app","external"];function Le(e){const t=(0,c.c)(7),{value:s,label:n,selected:o,onChange:l}=e;let u;t[0]!==l||t[1]!==s?(u=()=>{l(s)},t[0]=l,t[1]=s,t[2]=u):u=t[2];const p=u;let h;return t[3]!==p||t[4]!==n||t[5]!==o?(h=(0,xe.jsx)(Y.DropdownMenuItem,{selected:o,onSelect:p,children:n}),t[3]=p,t[4]=n,t[5]=o,t[6]=h):h=t[6],h}function Pe(e){const t=(0,c.c)(13),{value:s,activeLocale:n,selected:o,onChange:l}=e,{t:u}=(0,y.useTranslation)();let p;t[0]!==l||t[1]!==s?(p=()=>{l(s)},t[0]=l,t[1]=s,t[2]=p):p=t[2];const h=p;let b;if(t[3]!==n||t[4]!==u||t[5]!==s){let e;t[7]!==s?(e=e=>e.value===s,t[7]=s,t[8]=e):e=t[8];const o=ae.LANGUAGE_OPTIONS.find(e);b=o?(0,ae.formatLanguageOptionLabel)(o,n,u(o.labelKey)):s,t[3]=n,t[4]=u,t[5]=s,t[6]=b}else b=t[6];const S=b;let x;return t[9]!==h||t[10]!==S||t[11]!==o?(x=(0,xe.jsx)(Y.DropdownMenuItem,{selected:o,onSelect:h,children:S}),t[9]=h,t[10]=S,t[11]=o,t[12]=x):x=t[12],x}function ze(e){const o=(0,c.c)(106),{settings:l,isDesktopApp:p,handleSendBehaviorChange:h,handleServiceUrlBehaviorChange:b,handleLanguageChange:S,handleTerminalScrollbackLinesChange:x,handleFastOfflineModeChange:f}=e,{t:v,i18n:w}=(0,y.useTranslation)();let k,T,C,V;if(o[0]!==w.language||o[1]!==l.language||o[2]!==l.sendBehavior||o[3]!==v){let e,t;k=Ie(w.language),o[8]!==v?(e=Ce(v),o[8]=v,o[9]=e):e=o[9],C=e,T="interrupt"===l.sendBehavior?"settings.general.defaultSend.descriptions.interrupt":"settings.general.defaultSend.descriptions.queue",o[10]!==l.language?(t=e=>e.value===l.language,o[10]=l.language,o[11]=t):t=o[11];const s=ae.LANGUAGE_OPTIONS.find(t);V=s?(0,ae.formatLanguageOptionLabel)(s,k,v(s.labelKey)):l.language,o[0]=w.language,o[1]=l.language,o[2]=l.sendBehavior,o[3]=v,o[4]=k,o[5]=T,o[6]=C,o[7]=V}else k=o[4],T=o[5],C=o[6],V=o[7];const I=V,[H,L]=(0,u.useState)(String(l.terminalScrollbackLines));let z;o[12]===Symbol.for("react.memo_cache_sentinel")?(z=e=>{L(e.replace(/[^\d]/g,""))},o[12]=z):z=o[12];const A=z;let D;o[13]!==x||o[14]!==l.terminalScrollbackLines||o[15]!==H?(D=()=>{const e=(0,P.parseTerminalScrollbackLines)(H)??l.terminalScrollbackLines;L(String(e)),e!==l.terminalScrollbackLines&&x(e)},o[13]=x,o[14]=l.terminalScrollbackLines,o[15]=H,o[16]=D):D=o[16];const R=D;let O,U,K,W,F,E,G,N,q,$,Q,J,Z,ee,te,se,ne,ie,le,re,ce,de,ue,ge,pe,he,be,Se,ye,fe,me,je,we;return o[17]!==l.terminalScrollbackLines?(O=()=>{L(String(l.terminalScrollbackLines))},U=[l.terminalScrollbackLines],o[17]=l.terminalScrollbackLines,o[18]=O,o[19]=U):(O=o[18],U=o[19]),(0,u.useEffect)(O,U),o[20]!==v?(K=v("settings.general.title"),o[20]=v,o[21]=K):K=o[21],o[22]!==v?(W=v("settings.general.defaultSend.label"),o[22]=v,o[23]=W):W=o[23],o[24]!==W?(F=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,children:W}),o[24]=W,o[25]=F):F=o[25],o[26]!==T||o[27]!==v?(E=v(T),o[26]=T,o[27]=v,o[28]=E):E=o[28],o[29]!==E?(G=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:E}),o[29]=E,o[30]=G):G=o[30],o[31]!==G||o[32]!==F?(N=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.rowContent,children:[F,G]}),o[31]=G,o[32]=F,o[33]=N):N=o[33],o[34]!==h||o[35]!==C||o[36]!==l.sendBehavior?(q=(0,xe.jsx)(X.SegmentedControl,{size:"sm",value:l.sendBehavior,onValueChange:h,options:C}),o[34]=h,o[35]=C,o[36]=l.sendBehavior,o[37]=q):q=o[37],o[38]!==N||o[39]!==q?($=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.row,children:[N,q]}),o[38]=N,o[39]=q,o[40]=$):$=o[40],o[41]!==f||o[42]!==l.fastOfflineMode?(Q=M.isNative?(0,xe.jsxs)(t.View,{style:Te,children:[(0,xe.jsxs)(t.View,{style:oe.settingsStyles.rowContent,children:[(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,children:"Fast offline mode"}),(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:"Voice replies and dictation use the on-device iOS engines instead of the daemon \u2014 lower latency, works without a voice connection"})]}),(0,xe.jsx)(B.Switch,{value:l.fastOfflineMode,onValueChange:f,accessibilityLabel:"Toggle fast offline voice mode",testID:"settings-fast-offline-mode"})]}):null,o[41]=f,o[42]=l.fastOfflineMode,o[43]=Q):Q=o[43],o[44]!==v?(J=v("settings.general.language.label"),o[44]=v,o[45]=J):J=o[45],o[46]!==J?(Z=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,children:J}),o[46]=J,o[47]=Z):Z=o[47],o[48]!==v?(ee=v("settings.general.language.description"),o[48]=v,o[49]=ee):ee=o[49],o[50]!==ee?(te=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:ee}),o[50]=ee,o[51]=te):te=o[51],o[52]!==Z||o[53]!==te?(se=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.rowContent,children:[Z,te]}),o[52]=Z,o[53]=te,o[54]=se):se=o[54],o[55]!==I?(ne=(0,xe.jsx)(n.Text,{style:Xe.themeTriggerText,children:I}),o[55]=I,o[56]=ne):ne=o[56],o[57]!==I||o[58]!==ne?(ie=(0,xe.jsx)(j.DropdownTrigger,{accessibilityRole:"button",accessibilityLabel:I,style:ve,children:ne}),o[57]=I,o[58]=ne,o[59]=ie):ie=o[59],o[60]!==k||o[61]!==S||o[62]!==l.language?(le=ae.LANGUAGE_OPTIONS.map(e=>(0,xe.jsx)(Pe,{value:e.value,activeLocale:k,selected:l.language===e.value,onChange:S},e.value)),o[60]=k,o[61]=S,o[62]=l.language,o[63]=le):le=o[63],o[64]!==le?(re=(0,xe.jsx)(Y.DropdownMenuContent,{side:"bottom",align:"end",width:300,children:le}),o[64]=le,o[65]=re):re=o[65],o[66]!==ie||o[67]!==re?(ce=(0,xe.jsxs)(Y.DropdownMenu,{children:[ie,re]}),o[66]=ie,o[67]=re,o[68]=ce):ce=o[68],o[69]!==se||o[70]!==ce?(de=(0,xe.jsxs)(t.View,{style:Te,children:[se,ce]}),o[69]=se,o[70]=ce,o[71]=de):de=o[71],o[72]!==b||o[73]!==p||o[74]!==l.serviceUrlBehavior||o[75]!==v?(ue=p?(0,xe.jsxs)(t.View,{style:Te,children:[(0,xe.jsxs)(t.View,{style:oe.settingsStyles.rowContent,children:[(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,children:v("settings.general.serviceUrls.label")}),(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:v("settings.general.serviceUrls.description")})]}),(0,xe.jsxs)(Y.DropdownMenu,{children:[(0,xe.jsx)(j.DropdownTrigger,{style:ve,children:(0,xe.jsx)(n.Text,{style:Xe.themeTriggerText,children:Ve(v,l.serviceUrlBehavior)})}),(0,xe.jsx)(Y.DropdownMenuContent,{side:"bottom",align:"end",width:200,children:He.map(e=>(0,xe.jsx)(Le,{value:e,label:Ve(v,e),selected:l.serviceUrlBehavior===e,onChange:b},e))})]})]}):null,o[72]=b,o[73]=p,o[74]=l.serviceUrlBehavior,o[75]=v,o[76]=ue):ue=o[76],o[77]!==v?(ge=v("settings.general.terminalScrollback.label"),o[77]=v,o[78]=ge):ge=o[78],o[79]!==ge?(pe=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,children:ge}),o[79]=ge,o[80]=pe):pe=o[80],o[81]!==v?(he=v("settings.general.terminalScrollback.description"),o[81]=v,o[82]=he):he=o[82],o[83]!==he?(be=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:he}),o[83]=he,o[84]=be):be=o[84],o[85]!==pe||o[86]!==be?(Se=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.rowContent,children:[pe,be]}),o[85]=pe,o[86]=be,o[87]=Se):Se=o[87],o[88]!==v?(ye=v("settings.general.terminalScrollback.accessibilityLabel"),o[88]=v,o[89]=ye):ye=o[89],o[90]!==R||o[91]!==ye||o[92]!==H?(fe=(0,xe.jsx)(s.TextInput,{value:H,onChangeText:A,onBlur:R,onSubmitEditing:R,keyboardType:"number-pad",inputMode:"numeric",selectTextOnFocus:!0,style:Xe.terminalScrollbackInput,accessibilityLabel:ye}),o[90]=R,o[91]=ye,o[92]=H,o[93]=fe):fe=o[93],o[94]!==Se||o[95]!==fe?(me=(0,xe.jsxs)(t.View,{style:Te,children:[Se,fe]}),o[94]=Se,o[95]=fe,o[96]=me):me=o[96],o[97]!==$||o[98]!==Q||o[99]!==de||o[100]!==ue||o[101]!==me?(je=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.card,children:[$,Q,de,ue,me]}),o[97]=$,o[98]=Q,o[99]=de,o[100]=ue,o[101]=me,o[102]=je):je=o[102],o[103]!==je||o[104]!==K?(we=(0,xe.jsx)(_.SettingsSection,{title:K,children:je}),o[103]=je,o[104]=K,o[105]=we):we=o[105],we}function Ae(e){const s=(0,c.c)(54),{voiceAudioEngine:o,isPlaybackTestRunning:l,playbackTestResult:p,handlePlaybackTest:h,appVersion:b,isDesktopApp:S}=e,{t:x}=(0,y.useTranslation)(),[f,j]=(0,u.useState)(!1);let w;s[0]!==h?(w=()=>{h()},s[0]=h,s[1]=w):w=s[1];const k=w;let T;s[2]===Symbol.for("react.memo_cache_sentinel")?(T=()=>j(!0),s[2]=T):T=s[2];const C=T;let V;s[3]===Symbol.for("react.memo_cache_sentinel")?(V=()=>j(!1),s[3]=V):V=s[3];const I=V;let H,L,P,z,A,D,B,M,R,O,U,K,W;s[4]!==x?(H=x("settings.diagnostics.title"),s[4]=x,s[5]=H):H=s[5],s[6]!==x?(L=x("settings.diagnostics.app.rowTitle"),s[6]=x,s[7]=L):L=s[7],s[8]!==L?(P=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,children:L}),s[8]=L,s[9]=P):P=s[9],s[10]!==x?(z=x("settings.diagnostics.app.rowHint"),s[10]=x,s[11]=z):z=s[11],s[12]!==z?(A=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:z}),s[12]=z,s[13]=A):A=s[13],s[14]!==P||s[15]!==A?(D=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.rowContent,children:[P,A]}),s[14]=P,s[15]=A,s[16]=D):D=s[16],s[17]!==x?(B=x("settings.diagnostics.app.run"),s[17]=x,s[18]=B):B=s[18],s[19]!==B?(M=(0,xe.jsx)(Q.Button,{variant:"secondary",size:"sm",onPress:C,children:B}),s[19]=B,s[20]=M):M=s[20],s[21]!==M||s[22]!==D?(R=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.row,testID:"app-diagnostic-row",children:[D,M]}),s[21]=M,s[22]=D,s[23]=R):R=s[23],s[24]!==x?(O=x("settings.diagnostics.testAudio"),s[24]=x,s[25]=O):O=s[25],s[26]!==O?(U=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,children:O}),s[26]=O,s[27]=U):U=s[27],s[28]!==p?(K=p?(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:p}):null,s[28]=p,s[29]=K):K=s[29],s[30]!==U||s[31]!==K?(W=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.rowContent,children:[U,K]}),s[30]=U,s[31]=K,s[32]=W):W=s[32];const F=!o||l;let E,G,N,q,$,J;return s[33]!==l||s[34]!==x?(E=x(l?"settings.diagnostics.playing":"settings.diagnostics.playTest"),s[33]=l,s[34]=x,s[35]=E):E=s[35],s[36]!==k||s[37]!==F||s[38]!==E?(G=(0,xe.jsx)(Q.Button,{variant:"secondary",size:"sm",onPress:k,disabled:F,children:E}),s[36]=k,s[37]=F,s[38]=E,s[39]=G):G=s[39],s[40]!==W||s[41]!==G?(N=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.row,children:[W,G]}),s[40]=W,s[41]=G,s[42]=N):N=s[42],s[43]!==R||s[44]!==N?(q=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.card,children:[R,N]}),s[43]=R,s[44]=N,s[45]=q):q=s[45],s[46]!==b||s[47]!==f||s[48]!==S?($=(0,xe.jsx)(v.AppDiagnosticSheet,{visible:f,onClose:I,appVersion:b,isDesktopApp:S}),s[46]=b,s[47]=f,s[48]=S,s[49]=$):$=s[49],s[50]!==q||s[51]!==$||s[52]!==H?(J=(0,xe.jsxs)(_.SettingsSection,{title:H,children:[q,$]}),s[50]=q,s[51]=$,s[52]=H,s[53]=J):J=s[53],J}function De(){const e=(0,c.c)(2),t=(0,he.useActiveServerId)();let s;return e[0]!==t?(s=e=>t?e.sessions[t]?.serverInfo?.version??null:null,e[0]=t,e[1]=s):s=e[1],(0,O.useSessionStore)(s)}function Be(e){const s=(0,c.c)(39),{appVersion:o,appVersionText:l}=e,{t:u}=(0,y.useTranslation)(),p=De();let h;s[0]!==p?(h=(0,ne.formatVersionWithPrefix)(p),s[0]=p,s[1]=h):h=s[1];const b=h;let S,x,f,j,v,w,k,T,C,V,I,H,L,P,z,A,D;return s[2]!==u?(S=u("settings.about.title"),s[2]=u,s[3]=S):S=s[3],s[4]!==u?(x=u("settings.about.appVersion"),s[4]=u,s[5]=x):x=s[5],s[6]!==x?(f=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,children:x}),s[6]=x,s[7]=f):f=s[7],s[8]!==u?(j=u("settings.about.thisDevice"),s[8]=u,s[9]=j):j=s[9],s[10]!==j?(v=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:j}),s[10]=j,s[11]=v):v=s[11],s[12]!==f||s[13]!==v?(w=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.rowContent,children:[f,v]}),s[12]=f,s[13]=v,s[14]=w):w=s[14],s[15]!==l?(k=(0,xe.jsx)(n.Text,{style:Xe.aboutValue,children:l}),s[15]=l,s[16]=k):k=s[16],s[17]!==w||s[18]!==k?(T=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.row,children:[w,k]}),s[17]=w,s[18]=k,s[19]=T):T=s[19],s[20]!==l?(C=(0,xe.jsx)(n.Text,{style:Xe.aboutValue,testID:"settings-about-app-version",children:l}),s[20]=l,s[21]=C):C=s[21],s[22]!==T||s[23]!==C?(V=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.card,children:[T,C]}),s[22]=T,s[23]=C,s[24]=V):V=s[24],s[25]===Symbol.for("react.memo_cache_sentinel")?(I=(0,xe.jsx)(t.View,{style:oe.settingsStyles.rowContent,children:(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,children:"Daemon version"})}),s[25]=I):I=s[25],s[26]!==b?(H=(0,xe.jsxs)(t.View,{style:Te,children:[I,(0,xe.jsx)(n.Text,{style:Xe.aboutValue,testID:"settings-about-daemon-version",children:b})]}),s[26]=b,s[27]=H):H=s[27],s[28]===Symbol.for("react.memo_cache_sentinel")?(L=(0,xe.jsx)(Ke,{}),s[28]=L):L=s[28],s[29]!==V||s[30]!==H||s[31]!==S?(P=(0,xe.jsxs)(_.SettingsSection,{title:S,children:[V,H,L]}),s[29]=V,s[30]=H,s[31]=S,s[32]=P):P=s[32],s[33]!==o?(z=(0,xe.jsx)(Re,{clientVersion:o}),s[33]=o,s[34]=z):z=s[34],s[35]===Symbol.for("react.memo_cache_sentinel")?(A=(0,xe.jsx)(t.View,{style:Xe.aboutCommunity,children:(0,xe.jsx)(J.CommunityLinks,{})}),s[35]=A):A=s[35],s[36]!==P||s[37]!==z?(D=(0,xe.jsxs)(xe.Fragment,{children:[P,z,A]}),s[36]=P,s[37]=z,s[38]=D):D=s[38],D}function Me(e){const t=e?.trim();return t?t.replace(/^v/i,""):null}function Re(e){const s=(0,c.c)(12),{clientVersion:n}=e,{t:o}=(0,y.useTranslation)(),l=(0,R.useHosts)();if(0===l.length)return null;let u,p,h,b;if(s[0]!==o?(u=o("settings.about.connectedHosts"),s[0]=o,s[1]=u):u=s[1],s[2]!==n||s[3]!==l){let e;s[5]!==n?(e=(e,t)=>(0,xe.jsx)(Oe,{host:e,showBorder:t>0,clientVersion:n},e.serverId),s[5]=n,s[6]=e):e=s[6],p=l.map(e),s[2]=n,s[3]=l,s[4]=p}else p=s[4];return s[7]!==p?(h=(0,xe.jsx)(t.View,{style:oe.settingsStyles.card,children:p}),s[7]=p,s[8]=h):h=s[8],s[9]!==u||s[10]!==h?(b=(0,xe.jsx)(_.SettingsSection,{title:u,children:h}),s[9]=u,s[10]=h,s[11]=b):b=s[11],b}function Oe(e){const s=(0,c.c)(31),{host:o,showBorder:l,clientVersion:u}=e,{t:p}=(0,y.useTranslation)(),h=(0,R.useHostRuntimeIsConnected)(o.serverId);let b;s[0]!==o.serverId?(b=e=>e.sessions[o.serverId]?.serverInfo?.version??null,s[0]=o.serverId,s[1]=b):b=s[1];const S=(0,O.useSessionStore)(b),x=l&&oe.settingsStyles.rowBorder;let f;s[2]!==x?(f=[oe.settingsStyles.row,x],s[2]=x,s[3]=f):f=s[3];const j=f;let v,w;if(s[4]!==u||s[5]!==S||s[6]!==h||s[7]!==p){const e=Me(S);let t;s[10]!==u?(t=Me(u),s[10]=u,s[11]=t):t=s[11];if(v=null!==e&&null!==t&&e!==t,h)w=e?(0,ne.formatVersionWithPrefix)(e):"\u2014";else{let e;s[12]!==p?(e=p("settings.about.offline"),s[12]=p,s[13]=e):e=s[13],w=e}s[4]=u,s[5]=S,s[6]=h,s[7]=p,s[8]=v,s[9]=w}else v=s[8],w=s[9];const k=v&&Xe.aboutVersionMismatch;let T;s[14]!==k?(T=[Xe.aboutValue,k],s[14]=k,s[15]=T):T=s[15];const C=T;let V,I,H,_,L;return s[16]!==o.label?(V=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,numberOfLines:1,children:o.label}),s[16]=o.label,s[17]=V):V=s[17],s[18]!==v||s[19]!==p?(I=v?(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:p("settings.about.versionDiffers")}):null,s[18]=v,s[19]=p,s[20]=I):I=s[20],s[21]!==V||s[22]!==I?(H=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.rowContent,children:[V,I]}),s[21]=V,s[22]=I,s[23]=H):H=s[23],s[24]!==C||s[25]!==w?(_=(0,xe.jsx)(n.Text,{style:C,children:w}),s[24]=C,s[25]=w,s[26]=_):_=s[26],s[27]!==j||s[28]!==H||s[29]!==_?(L=(0,xe.jsxs)(t.View,{style:j,children:[H,_]}),s[27]=j,s[28]=H,s[29]=_,s[30]=L):L=s[30],L}function Ue(e,t,s){return t?e("settings.about.updates.installing"):s?e("settings.about.updates.updateTo",{version:(0,ne.formatVersionWithPrefix)(s)}):e("settings.about.updates.update")}function Ke(){const e=(0,c.c)(81),{t:s}=(0,y.useTranslation)(),{settings:o,updateSettings:l}=(0,P.useSettings)(),{isDesktopApp:u,statusText:h,availableUpdate:b,errorMessage:S,isChecking:x,isInstalling:f,checkForUpdates:j,installUpdate:v}=(0,D.useDesktopAppUpdater)();let w,k;e[0]!==j||e[1]!==u?(w=()=>{u&&j({intent:"automatic",silent:!0})},e[0]=j,e[1]=u,e[2]=w):w=e[2],(0,z.useFocusEffect)(w),e[3]!==j||e[4]!==u?(k=()=>{u&&j()},e[3]=j,e[4]=u,e[5]=k):k=e[5];const T=k;let C;e[6]!==l?(C=e=>{l({releaseChannel:e})},e[6]=l,e[7]=C):C=e[7];const V=C;let I,H,_,L,B;e[8]!==s?(I=s("settings.about.releaseChannel.stable"),e[8]=s,e[9]=I):I=e[9],e[10]!==I?(H={value:"stable",label:I},e[10]=I,e[11]=H):H=e[11],e[12]!==s?(_=s("settings.about.releaseChannel.beta"),e[12]=s,e[13]=_):_=e[13],e[14]!==_?(L={value:"beta",label:_},e[14]=_,e[15]=L):L=e[15],e[16]!==H||e[17]!==L?(B=[H,L],e[16]=H,e[17]=L,e[18]=B):B=e[18];const M=B;let R;e[19]!==v||e[20]!==u||e[21]!==s?(R=()=>{u&&(0,A.confirmDialog)({title:s("settings.about.updates.installTitle"),message:s("settings.about.updates.installMessage"),confirmLabel:s("settings.about.updates.installConfirm"),cancelLabel:s("common.actions.cancel")}).then(e=>{e&&v()}).catch(e=>{console.error("[Settings] Failed to open app update confirmation",e),p.default.alert(s("settings.about.updates.alertTitle"),s("settings.about.updates.alertMessage"))})},e[19]=v,e[20]=u,e[21]=s,e[22]=R):R=e[22];const O=R,U=!0===b?.readyToInstall,K=U?b?.latestVersion:null;if(!u)return null;let W,F,E,G,N,q,$,J,Y,Z,ee,te,se;e[23]!==s?(W=s("settings.about.releaseChannel.label"),e[23]=s,e[24]=W):W=e[24],e[25]!==W?(F=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,children:W}),e[25]=W,e[26]=F):F=e[26],e[27]!==s?(E=s("settings.about.releaseChannel.description"),e[27]=s,e[28]=E):E=e[28],e[29]!==E?(G=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:E}),e[29]=E,e[30]=G):G=e[30],e[31]!==F||e[32]!==G?(N=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.rowContent,children:[F,G]}),e[31]=F,e[32]=G,e[33]=N):N=e[33],e[34]!==V||e[35]!==M||e[36]!==o.releaseChannel?(q=(0,xe.jsx)(X.SegmentedControl,{size:"sm",value:o.releaseChannel,onValueChange:V,options:M}),e[34]=V,e[35]=M,e[36]=o.releaseChannel,e[37]=q):q=e[37],e[38]!==N||e[39]!==q?($=(0,xe.jsxs)(t.View,{style:Te,children:[N,q]}),e[38]=N,e[39]=q,e[40]=$):$=e[40],e[41]!==s?(J=s("settings.about.updates.label"),e[41]=s,e[42]=J):J=e[42],e[43]!==J?(Y=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,children:J}),e[43]=J,e[44]=Y):Y=e[44],e[45]!==h?(Z=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:h}),e[45]=h,e[46]=Z):Z=e[46],e[47]!==K||e[48]!==s?(ee=K?(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:s("settings.about.updates.readyToInstall",{version:(0,ne.formatVersionWithPrefix)(K)})}):null,e[47]=K,e[48]=s,e[49]=ee):ee=e[49],e[50]!==S?(te=S?(0,xe.jsx)(n.Text,{style:Xe.aboutErrorText,children:S}):null,e[50]=S,e[51]=te):te=e[51],e[52]!==Y||e[53]!==Z||e[54]!==ee||e[55]!==te?(se=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.rowContent,children:[Y,Z,ee,te]}),e[52]=Y,e[53]=Z,e[54]=ee,e[55]=te,e[56]=se):se=e[56];const ie=x||f;let le,re;e[57]!==x||e[58]!==s?(le=s(x?"settings.about.updates.checking":"settings.about.updates.check"),e[57]=x,e[58]=s,e[59]=le):le=e[59],e[60]!==T||e[61]!==ie||e[62]!==le?(re=(0,xe.jsx)(Q.Button,{variant:"outline",size:"sm",onPress:T,disabled:ie,children:le}),e[60]=T,e[61]=ie,e[62]=le,e[63]=re):re=e[63];const ae=x||f||!U;let ce,de,ue,ge,pe;return e[64]!==f||e[65]!==K||e[66]!==s?(ce=Ue(s,f,K),e[64]=f,e[65]=K,e[66]=s,e[67]=ce):ce=e[67],e[68]!==O||e[69]!==ae||e[70]!==ce?(de=(0,xe.jsx)(Q.Button,{variant:"default",size:"sm",onPress:O,disabled:ae,children:ce}),e[68]=O,e[69]=ae,e[70]=ce,e[71]=de):de=e[71],e[72]!==re||e[73]!==de?(ue=(0,xe.jsxs)(t.View,{style:Xe.aboutUpdateActions,children:[re,de]}),e[72]=re,e[73]=de,e[74]=ue):ue=e[74],e[75]!==se||e[76]!==ue?(ge=(0,xe.jsxs)(t.View,{style:Te,children:[se,ue]}),e[75]=se,e[76]=ue,e[77]=ge):ge=e[77],e[78]!==$||e[79]!==ge?(pe=(0,xe.jsxs)(xe.Fragment,{children:[$,ge]}),e[78]=$,e[79]=ge,e[80]=pe):pe=e[80],pe}function We(e,t){const s=(0,c.c)(3);let n;return s[0]!==e||s[1]!==t?(n=(0,U.orderHostsLocalFirst)(e,t),s[0]=e,s[1]=t,s[2]=n):n=s[2],n}function Fe(e){const t=(0,c.c)(23),{itemId:s,label:o,icon:u,isSelected:p,onSelect:h}=e,{theme:b}=(0,S.useUnistyles)();let y;t[0]!==s||t[1]!==h?(y=()=>{h(s)},t[0]=s,t[1]=h,t[2]=y):y=t[2];const x=y;let f;t[3]!==p?(f={selected:p},t[3]=p,t[4]=f):f=t[4];const j=f;let v,w;t[5]!==p||t[6]!==b.colors.foreground?(v=p&&{color:b.colors.foreground},t[5]=p,t[6]=b.colors.foreground,t[7]=v):v=t[7],t[8]!==v?(w=[Ze.label,v],t[8]=v,t[9]=w):w=t[9];const k=w,T=p?ke:we,C=p?b.colors.foreground:b.colors.foregroundMuted;let V,I,H;return t[10]!==u||t[11]!==C||t[12]!==b.iconSize.md?(V=(0,xe.jsx)(u,{size:b.iconSize.md,color:C}),t[10]=u,t[11]=C,t[12]=b.iconSize.md,t[13]=V):V=t[13],t[14]!==o||t[15]!==k?(I=(0,xe.jsx)(n.Text,{style:k,numberOfLines:1,children:o}),t[14]=o,t[15]=k,t[16]=I):I=t[16],t[17]!==j||t[18]!==x||t[19]!==T||t[20]!==V||t[21]!==I?(H=(0,xe.jsxs)(l.Pressable,{accessibilityRole:"button",accessibilityState:j,onPress:x,style:T,children:[V,I]}),t[17]=j,t[18]=x,t[19]=T,t[20]=V,t[21]=I,t[22]=H):H=t[22],H}function Ee(e){const t=(0,c.c)(24),{itemId:s,label:o,icon:u,isSelected:p,onSelect:h}=e,{theme:b}=(0,S.useUnistyles)();let y;t[0]!==s||t[1]!==h?(y=()=>{h(s)},t[0]=s,t[1]=h,t[2]=y):y=t[2];const x=y;let f;t[3]!==p?(f={selected:p},t[3]=p,t[4]=f):f=t[4];const j=f;let v,w;t[5]!==p||t[6]!==b.colors.foreground?(v=p&&{color:b.colors.foreground},t[5]=p,t[6]=b.colors.foreground,t[7]=v):v=t[7],t[8]!==v?(w=[Ze.label,v],t[8]=v,t[9]=w):w=t[9];const k=w,T=`settings-host-section-${s}`,C=p?ke:we,V=p?b.colors.foreground:b.colors.foregroundMuted;let I,H,_;return t[10]!==u||t[11]!==V||t[12]!==b.iconSize.md?(I=(0,xe.jsx)(u,{size:b.iconSize.md,color:V}),t[10]=u,t[11]=V,t[12]=b.iconSize.md,t[13]=I):I=t[13],t[14]!==o||t[15]!==k?(H=(0,xe.jsx)(n.Text,{style:k,numberOfLines:1,children:o}),t[14]=o,t[15]=k,t[16]=H):H=t[16],t[17]!==j||t[18]!==x||t[19]!==T||t[20]!==C||t[21]!==I||t[22]!==H?(_=(0,xe.jsxs)(l.Pressable,{accessibilityRole:"button",accessibilityState:j,onPress:x,testID:T,style:C,children:[I,H]}),t[17]=j,t[18]=x,t[19]=T,t[20]=C,t[21]=I,t[22]=H,t[23]=_):_=t[23],_}function Ge(e){const t=(0,c.c)(21),{isSelected:s,onSelect:o}=e,{theme:u}=(0,S.useUnistyles)(),{t:p}=(0,y.useTranslation)();let h;t[0]!==s?(h={selected:s},t[0]=s,t[1]=h):h=t[1];const b=h;let x,j;t[2]!==s||t[3]!==u.colors.foreground?(x=s&&{color:u.colors.foreground},t[2]=s,t[3]=u.colors.foreground,t[4]=x):x=t[4],t[5]!==x?(j=[Ze.label,x],t[5]=x,t[6]=j):j=t[6];const v=j,w=s?ke:we,k=s?u.colors.foreground:u.colors.foregroundMuted;let T,C,V,I;return t[7]!==k||t[8]!==u.iconSize.md?(T=(0,xe.jsx)(f.FolderGit2,{size:u.iconSize.md,color:k}),t[7]=k,t[8]=u.iconSize.md,t[9]=T):T=t[9],t[10]!==p?(C=p("settings.projects"),t[10]=p,t[11]=C):C=t[11],t[12]!==v||t[13]!==C?(V=(0,xe.jsx)(n.Text,{style:v,numberOfLines:1,children:C}),t[12]=v,t[13]=C,t[14]=V):V=t[14],t[15]!==b||t[16]!==o||t[17]!==w||t[18]!==T||t[19]!==V?(I=(0,xe.jsxs)(l.Pressable,{accessibilityRole:"button",accessibilityState:b,onPress:o,testID:"settings-projects",style:w,children:[T,V]}),t[15]=b,t[16]=o,t[17]=w,t[18]=T,t[19]=V,t[20]=I):I=t[20],I}function Ne(e){const s=(0,c.c)(27),{activeServerId:o,sortedHosts:l,onSelectHost:p,onAddHost:h}=e,{t:b}=(0,y.useTranslation)(),[S,x]=(0,u.useState)(!1),f=(0,u.useRef)(null);let j;s[0]!==o||s[1]!==l?(j=l.find(e=>e.serverId===o)??l[0]??null,s[0]=o,s[1]=l,s[2]=j):j=s[2];const v=j;let k;s[3]===Symbol.for("react.memo_cache_sentinel")?(k=()=>x(!0),s[3]=k):k=s[3];const T=k,I=$e,H=qe,_=o??"";let L,P,z,A,D,B,M;return s[4]!==b?(L=b("settings.hostPicker.switchHost"),s[4]=b,s[5]=L):L=s[5],s[6]!==b?(P=b("settings.hostPicker.switchHost"),s[6]=b,s[7]=P):P=s[7],s[8]!==v?(z=v?(0,xe.jsx)(t.View,{style:Ze.pickerTriggerDot,children:(0,xe.jsx)(V.HostStatusDot,{serverId:v.serverId})}):null,s[8]=v,s[9]=z):z=s[9],s[10]!==v?.label||s[11]!==b?(A=v?.label??b("settings.groups.host"),s[10]=v?.label,s[11]=b,s[12]=A):A=s[12],s[13]!==A?(D=(0,xe.jsx)(n.Text,{style:Ze.pickerTriggerLabel,numberOfLines:1,children:A}),s[13]=A,s[14]=D):D=s[14],s[15]!==P||s[16]!==z||s[17]!==D?(B=(0,xe.jsxs)(w.ComboboxTrigger,{ref:f,block:!0,style:H,onPress:T,accessibilityRole:"button",accessibilityLabel:P,testID:"settings-host-picker",children:[z,D]}),s[15]=P,s[16]=z,s[17]=D,s[18]=B):B=s[18],s[19]!==S||s[20]!==h||s[21]!==p||s[22]!==l||s[23]!==_||s[24]!==L||s[25]!==B?(M=(0,xe.jsx)(C.HostPicker,{hosts:l,value:_,onSelect:p,open:S,onOpenChange:x,anchorRef:f,includeAddHost:!0,onAddHost:h,showActiveConnection:!0,searchable:!1,title:L,desktopMinWidth:240,addHostTestID:"settings-add-host",hostOptionTestID:I,children:B}),s[19]=S,s[20]=h,s[21]=p,s[22]=l,s[23]=_,s[24]=L,s[25]=B,s[26]=M):M=s[26],M}function qe(e){const{hovered:t}=e,s=void 0!==t&&t;return[Ze.pickerTrigger,s&&Ze.pickerTriggerHovered]}function $e(e){return`settings-host-picker-item-${e}`}function Qe(e){const s=(0,c.c)(50),{view:p,onSelectSection:h,onSelectHostSection:x,onSelectHost:j,onSelectProjects:v,onAddHost:w,onBackToWorkspace:C,activeHostServerId:V,layout:I}=e,{theme:H}=(0,S.useUnistyles)(),{t:_}=(0,y.useTranslation)(),L=We((0,R.useHosts)(),(0,pe.useLocalDaemonServerId)()),P=L.length>0,z=(0,se.isElectronRuntime)(),A=fe.filter(e=>!e.desktopOnly||z),D=(0,b.useSafeAreaInsets)(),B=(0,W.useWindowControlsPadding)("sidebar"),M="desktop"===I,O=M?Ze.desktopContainer:Ze.mobileContainer;let U;s[0]!==O?(U=[O],s[0]=O,s[1]=U):U=s[1];const F=U;let E,G,N;s[2]===Symbol.for("react.memo_cache_sentinel")?(E={flex:1},s[2]=E):E=s[2],s[3]!==D.top||s[4]!==M?(G=M?{paddingTop:D.top}:null,s[3]=D.top,s[4]=M,s[5]=G):G=s[5],s[6]!==G?(N=[E,G],s[6]=G,s[7]=N):N=s[7];const q=N,$="section"===p.kind?p.section:null,Q="host"===p.kind?p.section:null,J="projects"===p.kind||"project"===p.kind;let X;s[8]!==B.top?(X={height:B.top},s[8]=B.top,s[9]=X):X=s[9];const Y=X,Z=t.View,ee=Ze;let te,ne,ie;s[10]!==_?(te=_("settings.groups.app"),s[10]=_,s[11]=te):te=s[11],s[12]!==te?(ne=(0,xe.jsx)(n.Text,{style:Ze.groupLabel,children:te}),s[12]=te,s[13]=ne):ne=s[13],s[14]!==J||s[15]!==v||s[16]!==h||s[17]!==$||s[18]!==_?(ie=e=>(0,xe.jsxs)(u.Fragment,{children:[(0,xe.jsx)(Fe,{itemId:e.id,label:_(e.labelKey),icon:e.icon,isSelected:$===e.id,onSelect:h}),"general"===e.id?(0,xe.jsx)(Ge,{isSelected:J,onSelect:v}):null]},e.id),s[14]=J,s[15]=v,s[16]=h,s[17]=$,s[18]=_,s[19]=ie):ie=s[19];const oe=A.map(ie);let le,re,ae,ce;s[20]!==Z||s[21]!==oe||s[22]!==ee.list||s[23]!==ne?(le=(0,xe.jsxs)(Z,{style:ee.list,children:[ne,oe]}),s[20]=Z,s[21]=oe,s[22]=ee.list,s[23]=ne,s[24]=le):le=s[24],s[25]===Symbol.for("react.memo_cache_sentinel")?(re=(0,xe.jsx)(T.SidebarSeparator,{}),s[25]=re):re=s[25],s[26]!==V||s[27]!==P||s[28]!==w||s[29]!==j||s[30]!==x||s[31]!==Q||s[32]!==L||s[33]!==_||s[34]!==H?(ae=P?(0,xe.jsxs)(t.View,{style:Ze.list,children:[(0,xe.jsx)(n.Text,{style:Ze.groupLabel,children:_("settings.groups.host")}),(0,xe.jsx)(Ne,{activeServerId:V,sortedHosts:L,onSelectHost:j,onAddHost:w}),me.map(e=>(0,xe.jsx)(Ee,{itemId:e.id,label:_(e.labelKey),icon:e.icon,isSelected:Q===e.id,onSelect:x},e.id))]}):(0,xe.jsx)(t.View,{style:Ze.list,children:(0,xe.jsxs)(l.Pressable,{accessibilityRole:"button",accessibilityLabel:_("settings.addHost"),onPress:w,testID:"settings-add-host",style:we,children:[(0,xe.jsx)(f.Plus,{size:H.iconSize.md,color:H.colors.foregroundMuted}),(0,xe.jsx)(n.Text,{style:Ze.label,numberOfLines:1,children:_("settings.addHost")})]})}),s[26]=V,s[27]=P,s[28]=w,s[29]=j,s[30]=x,s[31]=Q,s[32]=L,s[33]=_,s[34]=H,s[35]=ae):ae=s[35],s[36]!==le||s[37]!==ae?(ce=(0,xe.jsxs)(xe.Fragment,{children:[le,re,ae]}),s[36]=le,s[37]=ae,s[38]=ce):ce=s[38];const de=ce;let ue,ge;return s[39]!==q||s[40]!==M||s[41]!==C||s[42]!==B.top||s[43]!==Y||s[44]!==de||s[45]!==_?(ue=M?(0,xe.jsxs)(t.View,{style:q,children:[(0,xe.jsxs)(t.View,{style:Ze.sidebarDragArea,children:[(0,xe.jsx)(K.TitlebarDragRegion,{}),B.top>0?(0,xe.jsx)(t.View,{style:Y}):null,(0,xe.jsx)(k.SidebarHeaderRow,{icon:f.ArrowLeft,label:_("settings.backToWorkspace"),onPress:C,testID:"settings-back-to-workspace"})]}),(0,xe.jsx)(o.ScrollView,{style:Ze.scrollBody,showsVerticalScrollIndicator:!1,children:de})]}):de,s[39]=q,s[40]=M,s[41]=C,s[42]=B.top,s[43]=Y,s[44]=de,s[45]=_,s[46]=ue):ue=s[46],s[47]!==F||s[48]!==ue?(ge=(0,xe.jsx)(t.View,{style:F,testID:"settings-sidebar",children:ue}),s[47]=F,s[48]=ue,s[49]=ge):ge=s[49],ge}function Je({view:e,openAddHostIntent:s=null}){const l=(0,h.useRouter)(),{theme:c}=(0,S.useUnistyles)(),{t:p}=(0,y.useTranslation)(),j=(0,re.useVoiceAudioEngineOptional)(),{settings:v,isLoading:w,updateSettings:k}=(0,P.useAppSettings)(),[T,C]=(0,u.useState)(!1),[V,_]=(0,u.useState)(!1),[z,A]=(0,u.useState)(!1),[D,B]=(0,u.useState)(!1),[M,O]=(0,u.useState)(null),U=(0,u.useRef)(null),K=(0,se.isElectronRuntime)(),W=(0,ie.resolveAppVersion)(),Q=(0,ne.formatVersionWithPrefix)(W),J=(0,ge.useIsCompactFormFactor)(),X=(0,b.useSafeAreaInsets)(),Y=(0,u.useMemo)(()=>({paddingBottom:X.bottom}),[X.bottom]),oe=(0,be.useWebScrollbarStyle)(),ae=(0,u.useMemo)(()=>[Xe.scrollView,oe],[oe]),ce=(0,R.useHosts)(),he=(0,pe.useLocalDaemonServerId)(),ve=We(ce,he),[we,ke]=(0,u.useState)("host"===e.kind?e.serverId:null),Te=(0,u.useMemo)(()=>we&&ce.some(e=>e.serverId===we)?we:null,[ce,we]);(0,u.useEffect)(()=>{"host"===e.kind&&ke(e.serverId)},[e]);const Ce=(0,u.useMemo)(()=>"host"===e.kind?e.serverId:Te??he??ve[0]?.serverId??null,[e,Te,he,ve]),Ve=(0,u.useCallback)(e=>{k({sendBehavior:e})},[k]),Ie=(0,u.useCallback)(e=>{k({fastOfflineMode:e})},[k]),He=(0,u.useCallback)(e=>{k({serviceUrlBehavior:e})},[k]),Le=(0,u.useCallback)(e=>{k({language:e})},[k]),Pe=(0,u.useCallback)(e=>{k({terminalScrollbackLines:e})},[k]),De=(0,u.useCallback)(async()=>{if(j&&!D){B(!0),O(null);try{const e=x.Buffer.from(le.THINKING_TONE_NATIVE_PCM_BASE64,"base64");await j.initialize(),j.stop(),await j.play({type:"audio/pcm;rate=16000;bits=16",size:e.byteLength,arrayBuffer:async()=>Uint8Array.from(e).buffer}),O(null)}catch(e){const t=e instanceof Error?e.message:String(e);console.error("[Settings] Playback test failed",e),O(p("settings.diagnostics.playbackFailed",{message:t}))}finally{B(!1)}}},[D,p,j]),Me=(0,u.useCallback)(()=>{C(!1),_(!1),A(!1)},[]),Re=(0,u.useCallback)(()=>{_(!1),A(!1),C(!0)},[]),Oe=(0,u.useCallback)(()=>{C(!0)},[]);(0,u.useEffect)(()=>{s&&U.current!==s&&(U.current=s,Oe())},[Oe,s]);const Ue=(0,u.useCallback)(()=>{C(!1),_(!0)},[]),Ke=(0,u.useCallback)(()=>{C(!1),A(!0)},[]),Fe=(0,u.useCallback)(({serverId:e})=>{const t=(0,Se.buildSettingsHostSectionRoute)(e,"connections");J?l.push(t):l.replace(t)},[J,l]),Ee=(0,u.useCallback)(e=>{const t=(0,Se.buildSettingsSectionRoute)(e);J?l.push(t):l.replace(t)},[J,l]),Ge=(0,u.useCallback)(t=>{if(ke(t),"host"!==e.kind)return;const s=e.section,n=(0,Se.buildSettingsHostSectionRoute)(t,s);J?l.push(n):l.replace(n)},[J,l,e]),Ne=(0,u.useCallback)(e=>{if(!Ce)return void Oe();const t=(0,Se.buildSettingsHostSectionRoute)(Ce,e);J?l.push(t):l.replace(t)},[Ce,Oe,J,l]),qe=(0,u.useCallback)(()=>{const e=(0,Se.buildProjectsSettingsRoute)();J?l.push(e):l.replace(e)},[J,l]),$e=(0,u.useCallback)(()=>{Me(),l.push({pathname:"/pair-scan",params:{source:"settings"}})},[Me,l]),Je=(0,u.useCallback)(()=>{const e=(0,Se.buildSettingsSectionRoute)("general");J?l.replace("/settings"):l.replace(e)},[J,l]),Ze=(0,u.useCallback)(()=>{l.canGoBack()?l.back():l.replace("/settings")},[l]),et=(0,u.useCallback)(()=>{(0,ye.navigateToLastWorkspace)()||l.replace((0,Se.buildOpenProjectRoute)())},[l]),tt=(()=>{if("host"===e.kind){const t=me.find(t=>t.id===e.section);return t?{title:p(t.labelKey),Icon:t.icon}:null}if("section"===e.kind){const t=fe.find(t=>t.id===e.section);return t?{title:p(t.labelKey),Icon:t.icon}:null}return"project"===e.kind||"projects"===e.kind?{title:p("settings.projects"),Icon:f.FolderGit2}:null})(),st=(()=>{if("host"===e.kind)return je(e,Je);if("projects"===e.kind)return(0,xe.jsx)(de.default,{view:e});if("project"===e.kind)return(0,xe.jsx)(ue.default,{projectKey:e.projectKey});if("section"===e.kind)switch(e.section){case"general":return(0,xe.jsx)(ze,{settings:v,isDesktopApp:K,handleSendBehaviorChange:Ve,handleServiceUrlBehaviorChange:He,handleLanguageChange:Le,handleTerminalScrollbackLinesChange:Pe,handleFastOfflineModeChange:Ie});case"daemon":return(0,xe.jsx)(te.LocalDaemonSection,{});case"appearance":return(0,xe.jsx)(L.AppearanceSection,{});case"shortcuts":return K?(0,xe.jsx)($.KeyboardShortcutsSection,{}):null;case"integrations":return K?(0,xe.jsx)(ee.IntegrationsSection,{}):null;case"permissions":return K?(0,xe.jsx)(Z.DesktopPermissionsSection,{}):null;case"diagnostics":return(0,xe.jsx)(Ae,{voiceAudioEngine:j,isPlaybackTestRunning:D,playbackTestResult:M,handlePlaybackTest:De,appVersion:W,isDesktopApp:K});case"about":return(0,xe.jsx)(Be,{appVersion:W,appVersionText:Q,isDesktopApp:K})}return null})();if(w)return(0,xe.jsx)(t.View,{style:Xe.loadingContainer,children:(0,xe.jsx)(n.Text,{style:Xe.loadingText,children:p("settings.loading")})});const nt=(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)(G.AddHostMethodModal,{visible:T,onClose:Me,onDirectConnection:Ue,onPasteLink:Ke,onScanQr:$e}),(0,xe.jsx)(N.AddHostModal,{visible:V,onClose:Me,onCancel:Re,onSaved:Fe}),(0,xe.jsx)(q.PairLinkModal,{visible:z,onClose:Me,onCancel:Re,onSaved:Fe})]});if(J&&"root"===e.kind)return(0,xe.jsxs)(t.View,{style:Xe.container,children:[(0,xe.jsx)(F.BackHeader,{title:p("settings.title"),onBack:et}),(0,xe.jsx)(o.ScrollView,{style:ae,contentContainerStyle:Y,children:(0,xe.jsx)(Qe,{view:e,onSelectSection:Ee,onSelectHostSection:Ne,onSelectHost:Ge,onSelectProjects:qe,onAddHost:Oe,onBackToWorkspace:et,activeHostServerId:Ce,layout:"mobile"})}),nt]});const it="project"===e.kind?et:Ze;return J?(0,xe.jsxs)(t.View,{style:Xe.container,children:[(0,xe.jsx)(F.BackHeader,{title:tt?.title,titleAccessory:tt?.titleAccessory,onBack:it}),(0,xe.jsx)(o.ScrollView,{style:ae,contentContainerStyle:Y,children:(0,xe.jsx)(t.View,{style:Xe.content,children:st})}),nt]}):(0,xe.jsxs)(t.View,{style:Xe.container,children:[(0,xe.jsxs)(t.View,{style:Ye.row,children:[(0,xe.jsx)(Qe,{view:e,onSelectSection:Ee,onSelectHostSection:Ne,onSelectHost:Ge,onSelectProjects:qe,onAddHost:Oe,onBackToWorkspace:et,activeHostServerId:Ce,layout:"desktop"}),(0,xe.jsxs)(t.View,{style:Ye.contentPane,children:[(0,xe.jsx)(E.ScreenHeader,{borderless:!tt,windowControlsPaddingRole:"detailHeader",left:tt?(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)(H.HeaderIconBadge,{children:(0,xe.jsx)(tt.Icon,{size:c.iconSize.md,color:c.colors.foregroundMuted})}),(0,xe.jsx)(I.ScreenTitle,{testID:"settings-detail-header-title",children:tt.title}),tt.titleAccessory]}):null,leftStyle:Ye.detailLeft}),(0,xe.jsx)(o.ScrollView,{style:ae,contentContainerStyle:Y,children:(0,xe.jsx)(t.View,{style:Xe.content,children:st})})]})]}),nt]})}const Xe=S.StyleSheet.create(e=>({loadingContainer:{flex:1,backgroundColor:e.colors.surface0,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},loadingText:{color:e.colors.foreground,fontSize:e.fontSize.lg,uni__dependencies:[0]},container:{flex:1,backgroundColor:e.colors.surface0,uni__dependencies:[0]},scrollView:{flex:1},content:{padding:e.spacing[4],paddingTop:e.spacing[6],width:"100%",maxWidth:720,alignSelf:"center",uni__dependencies:[0]},aboutValue:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,uni__dependencies:[0]},aboutVersionMismatch:{color:e.colors.palette.amber[500],uni__dependencies:[0]},aboutErrorText:{color:e.colors.palette.red[300],fontSize:e.fontSize.xs,marginTop:e.spacing[1],uni__dependencies:[0]},aboutCommunity:{marginTop:e.spacing[4],uni__dependencies:[0]},aboutUpdateActions:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},themeTrigger:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],paddingVertical:e.spacing[1],paddingHorizontal:e.spacing[2],borderRadius:e.borderRadius.md,borderWidth:1,borderColor:e.colors.border,uni__dependencies:[0]},themeTriggerText:{color:e.colors.foreground,fontSize:e.fontSize.sm,uni__dependencies:[0]},terminalScrollbackInput:{width:112,minHeight:36,paddingVertical:e.spacing[2],paddingHorizontal:e.spacing[3],borderRadius:e.borderRadius.md,borderWidth:1,borderColor:e.colors.border,backgroundColor:e.colors.surface2,color:e.colors.foreground,fontSize:e.fontSize.sm,textAlign:"right",uni__dependencies:[0]},placeholder:{flex:1,alignItems:"center",justifyContent:"center",paddingVertical:e.spacing[8],uni__dependencies:[0]},placeholderText:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,uni__dependencies:[0]}})),Ye=S.StyleSheet.create(e=>({row:{flex:1,flexDirection:"row"},contentPane:{flex:1},detailLeft:{gap:e.spacing[2],uni__dependencies:[0]}})),Ze=S.StyleSheet.create(e=>({desktopContainer:{width:320,borderRightWidth:1,borderRightColor:e.colors.border,backgroundColor:e.colors.surfaceSidebar,uni__dependencies:[0]},scrollBody:{flex:1},sidebarDragArea:{position:"relative"},mobileContainer:{paddingVertical:e.spacing[2],paddingHorizontal:e.spacing[2],uni__dependencies:[0]},list:{paddingVertical:e.spacing[2],paddingHorizontal:e.spacing[2],gap:e.spacing[1],uni__dependencies:[0]},groupLabel:{fontSize:e.fontSize.sm,fontWeight:e.fontWeight.medium,color:e.colors.foregroundMuted,paddingHorizontal:e.spacing[2],paddingVertical:e.spacing[1],uni__dependencies:[0]},item:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],minHeight:36,paddingVertical:e.spacing[2],paddingHorizontal:e.spacing[2],borderRadius:e.borderRadius.lg,uni__dependencies:[0]},itemHovered:{backgroundColor:e.colors.surfaceSidebarHover,uni__dependencies:[0]},itemSelected:{backgroundColor:e.colors.surfaceSidebarHover,uni__dependencies:[0]},label:{fontSize:e.fontSize.base,color:e.colors.foregroundMuted,fontWeight:e.fontWeight.normal,flex:1,uni__dependencies:[0]},pickerTrigger:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],minHeight:36,paddingVertical:e.spacing[2],paddingHorizontal:e.spacing[2],borderRadius:e.borderRadius.lg,uni__dependencies:[0]},pickerTriggerHovered:{backgroundColor:e.colors.surfaceSidebarHover,uni__dependencies:[0]},pickerTriggerLabel:{flex:1,minWidth:0,fontSize:e.fontSize.base,color:e.colors.foreground,fontWeight:e.fontWeight.normal,uni__dependencies:[0]},pickerTriggerDot:{width:e.iconSize.md,height:e.iconSize.md,alignItems:"center",justifyContent:"center",uni__dependencies:[0]}}))},4721,[348,714,711,690,1572,349,36,1389,1308,182,234,715,146,1143,1320,56,1573,52,1600,3927,4722,3928,3569,4724,3454,3455,4408,4725,4726,4727,3575,1148,3678,4143,4730,3407,3271,3414,3397,3568,3607,4701,4407,4731,4732,4733,4734,3627,4655,4430,3572,4735,4739,4741,3404,4140,3401,3907,3998,3991,3579,4746,4759,4760,3457,3475,3497,3574,3477,3487,279]);
|
|
16481
|
-
__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.AppDiagnosticSheet=function({visible:l,onClose:c,appVersion:p,isDesktopApp:f}){const{t:R}=(0,u.useTranslation)(),H=(0,b.useToast)(),E=(0,S.useHosts)(),[O,B]=(0,o.useState)(null),[M,T]=(0,o.useState)(!1),[$,z]=(0,o.useState)([]),L=(0,o.useRef)(0),V=(0,o.useCallback)((e,s,t)=>{z(n=>n.find(s=>s.id===e)?n.map(n=>n.id===e?Object.assign({},n,{label:s,status:t}):n):[...n,{id:e,label:s,status:t}])},[]),N=(0,o.useCallback)(async()=>{const e=L.current+1;L.current=e;const s=()=>L.current===e,t=(e,t,n)=>{s()&&V(e,t,n)};T(!0),B(null),z([]);const n=[];try{if(t("client",R("settings.diagnostics.app.progress.client"),"running"),n.push((0,y.formatAppDiagnosticHeader)({appVersion:p,platform:"web",isDesktopApp:f,hostCount:E.length})),t("client",R("settings.diagnostics.app.progress.client"),"done"),f){const e=R("settings.diagnostics.app.progress.desktop");t("desktop",e,"running");const s=await C();n.push(...s.sections),t("desktop",e,s.status)}const e=(0,S.getHostRuntimeStore)();for(const s of E){const o=`host:${s.serverId}`;t(o,s.label,"running");const l=e.getSnapshot(s.serverId),c=await I(s,l);n.push(...c.sections),t(o,s.label,c.status)}s()&&B((0,y.redactAppDiagnosticReport)(n.join("\n\n"),E))}finally{s()&&T(!1)}},[p,E,f,R,V]);(0,o.useEffect)(()=>{l?N():(L.current+=1,T(!1),B(null),z([]))},[l,N]);const Z=(0,o.useCallback)(()=>{N()},[N]),F=(0,o.useCallback)(()=>{O&&n.setStringAsync(O).then(()=>H.copied(R("settings.diagnostics.app.copyLabel"))).catch(()=>H.error(R("settings.diagnostics.app.copyFailed")))},[O,R,H]),U=(0,o.useCallback)(({hovered:e,pressed:s})=>[A.iconButton,(Boolean(e)||s)&&A.iconButtonHovered],[]),q=(0,o.useCallback)(({hovered:e,pressed:s})=>[A.iconButton,(Boolean(e)||s)&&Boolean(O)&&A.iconButtonHovered,O?null:A.disabled],[O]),G=(0,o.useMemo)(()=>({title:R("settings.diagnostics.app.title"),actions:(0,D.jsxs)(e.View,{style:A.headerActions,children:[(0,D.jsx)(t.Pressable,{onPress:F,disabled:!O,hitSlop:8,style:q,accessibilityRole:"button",accessibilityLabel:R("settings.diagnostics.app.copyAccessibility"),children:(0,D.jsx)(_,{size:v.ICON_SIZE.sm,uniProps:k})}),(0,D.jsx)(t.Pressable,{onPress:Z,disabled:M,hitSlop:8,style:U,accessibilityRole:"button",accessibilityLabel:R(M?"settings.diagnostics.app.refreshingAccessibility":"settings.diagnostics.app.refreshAccessibility"),children:M?(0,D.jsx)(x,{size:v.ICON_SIZE.sm,uniProps:k}):(0,D.jsx)(j,{size:v.ICON_SIZE.sm,uniProps:k})})]})}),[O,q,F,Z,U,M,R]);return(0,D.jsx)(d.AdaptiveModalSheet,{header:G,visible:l,onClose:c,snapPoints:w,scrollable:!1,testID:"app-diagnostic-sheet",children:O?(0,D.jsx)(h.ScrollableCodeSurface,{maxHeight:520,children:O},l?"visible":"hidden"):(0,D.jsx)(h.SurfaceCard,{children:(0,D.jsx)(e.View,{style:A.progressContent,children:0===$.length?(0,D.jsxs)(e.View,{style:A.progressRow,children:[(0,D.jsx)(x,{size:v.ICON_SIZE.sm,uniProps:k}),(0,D.jsx)(s.Text,{style:A.mutedText,children:R("settings.diagnostics.app.running")})]}):$.map(t=>(0,D.jsxs)(e.View,{style:A.progressRow,children:["running"===t.status||"pending"===t.status?(0,D.jsx)(x,{size:v.ICON_SIZE.sm,uniProps:k}):(0,D.jsx)(e.View,{style:"failed"===t.status?A.statusDotFailed:A.statusDot}),(0,D.jsx)(s.Text,{style:A.mutedText,children:`${t.label}: ${P(t.status)}`})]},t.id))})},l?"visible":"hidden")})};var e=r(_d[0]),s=r(_d[1]),t=r(_d[2]),n=(function(e){if(e&&e.__esModule)return e;var s={};return e&&Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),s.default=e,s})(r(_d[3])),o=r(_d[4]);r(_d[5]),r(_d[6]),r(_d[7]),r(_d[8]);var l=r(_d[9]),c=r(_d[10]),u=r(_d[11]),d=r(_d[12]),p=r(_d[13]),h=r(_d[14]),b=r(_d[15]),f=r(_d[16]),y=r(_d[17]),S=r(_d[18]),v=r(_d[19]),D=r(_d[20]);const w=["55%","88%"],_=(0,c.withUnistyles)(l.Copy),j=(0,c.withUnistyles)(l.RotateCw),x=(0,c.withUnistyles)(p.LoadingSpinner),k=e=>({color:e.colors.foregroundMuted});async function C(){try{const[s,t]=await Promise.all([(0,f.getDesktopDaemonStatus)(),(0,f.getDesktopDaemonLogs)()]);return{status:"done",sections:[(0,y.formatDiagnosticSection)("Desktop",[{label:"Daemon status",value:s.status},{label:"Desktop managed",value:String(s.desktopManaged)},{label:"Daemon PID",value:null===s.pid?"none":String(s.pid)},{label:"Daemon version",value:s.version??"unknown"},{label:"Daemon home",value:s.home||"unknown"},{label:"Log path",value:t.logPath||"unknown"},{label:"Error",value:s.error??"none"}]),["Desktop daemon log tail",t.contents?(e=t.contents,e.split("\n").filter(Boolean).map(e=>` ${e}`).join("\n")):" No log lines found"].join("\n")]}}catch(e){return{status:"failed",sections:[(0,y.formatDiagnosticSection)("Desktop",[{label:"Error",value:R(e)}])]}}var e}async function I(e,s){const t=[(0,y.formatHostRuntimeSection)({host:e,snapshot:s})],n=s?.client??null;if("online"!==s?.connectionStatus||!n)return t.push((0,y.formatDiagnosticSection)(`Host diagnostics: ${e.label}`,[{label:"Status",value:"host is not connected"}])),{sections:t,status:"done"};try{const s=n.getLastServerInfoMessage();t.push((0,y.formatServerInfoSection)(s));const o=await n.measureLatency({timeoutMs:5e3});if(t.push((0,y.formatDiagnosticSection)(`Host latency: ${e.label}`,[{label:"Active RTT",value:`${Math.round(o)}ms`}])),!0===s?.features?.daemonDiagnostics){const e=await n.collectDiagnostics();t.push(e.diagnostic)}else t.push((0,y.formatDiagnosticSection)(`Daemon diagnostics: ${e.label}`,[{label:"Status",value:"unsupported by this daemon"}]));return{sections:t,status:"done"}}catch(s){return t.push((0,y.formatDiagnosticSection)(`Host diagnostics: ${e.label}`,[{label:"Error",value:R(s)}])),{sections:t,status:"failed"}}}function R(e){return e instanceof Error?e.message:String(e)}function P(e){switch(e){case"done":return"done";case"failed":return"failed";case"running":case"pending":return"running"}}const A=c.StyleSheet.create(e=>({progressContent:{paddingVertical:e.spacing[4],paddingHorizontal:e.spacing[4],gap:e.spacing[3],uni__dependencies:[0]},progressRow:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],minHeight:24,uni__dependencies:[0]},mutedText:{flex:1,fontSize:e.fontSize.sm,color:e.colors.foregroundMuted,uni__dependencies:[0]},headerActions:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],uni__dependencies:[0]},iconButton:{width:28,height:28,borderRadius:e.borderRadius.full,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},iconButtonHovered:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},disabled:{opacity:.5},statusDot:{width:8,height:8,borderRadius:e.borderRadius.full,backgroundColor:e.colors.success,uni__dependencies:[0]},statusDotFailed:{width:8,height:8,borderRadius:e.borderRadius.full,backgroundColor:e.colors.destructive,uni__dependencies:[0]}}))},4722,[348,711,1572,3628,36,25,1308,234,146,1600,56,1573,3466,3564,3902,3499,3403,4723,3271,305,279]);
|
|
16482
|
-
__d(function(g,r,i,a,m,
|
|
16483
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16484
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16485
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16486
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.AppearanceSection=function(){const n=(0,s.c)(98),{t:o}=(0,c.useTranslation)(),{settings:u,updateSettings:h}=(0,x.useAppSettings)(),p=!F.isNative;let y;n[0]!==o?(y=N(o,f.DEFAULT_UI_FONT_STACK),n[0]=o,n[1]=y):y=n[1];const C=y;let j;n[2]!==o?(j=N(o,f.DEFAULT_MONO_FONT_STACK),n[2]=o,n[3]=j):j=n[3];const T=j,[z,I]=(0,l.useState)(u.uiFontFamily),[E,V]=(0,l.useState)(u.monoFontFamily),[D,M]=(0,l.useState)(String(u.uiFontSize)),[v,A]=(0,l.useState)(String(u.codeFontSize));let H,W,P,B,X;n[4]!==u.uiFontSize?(H=()=>{M(String(u.uiFontSize))},W=[u.uiFontSize],n[4]=u.uiFontSize,n[5]=H,n[6]=W):(H=n[5],W=n[6]);(0,l.useEffect)(H,W),n[7]!==u.codeFontSize?(P=()=>{A(String(u.codeFontSize))},B=[u.codeFontSize],n[7]=u.codeFontSize,n[8]=P,n[9]=B):(P=n[8],B=n[9]);(0,l.useEffect)(P,B),n[10]!==h?(X=t=>{h({theme:t})},n[10]=h,n[11]=X):X=n[11];const K=X;let Y;n[12]!==h?(Y=t=>{h({syntaxTheme:t})},n[12]=h,n[13]=Y):Y=n[13];const G=Y;let q;n[14]!==u.uiFontFamily||n[15]!==h?(q=t=>{const n=(0,x.sanitizeFontFamily)(t);null!==n?(I(n),n!==u.uiFontFamily&&h({uiFontFamily:n})):I(u.uiFontFamily)},n[14]=u.uiFontFamily,n[15]=h,n[16]=q):q=n[16];const J=q;let Q;n[17]!==u.monoFontFamily||n[18]!==h?(Q=t=>{const n=(0,x.sanitizeFontFamily)(t);null!==n?(V(n),n!==u.monoFontFamily&&h({monoFontFamily:n})):V(u.monoFontFamily)},n[17]=u.monoFontFamily,n[18]=h,n[19]=Q):Q=n[19];const $=Q;let ee;n[20]===Symbol.for("react.memo_cache_sentinel")?(ee=t=>{M(t.replace(/[^\d]/g,""))},n[20]=ee):ee=n[20];const te=ee;let ne;n[21]===Symbol.for("react.memo_cache_sentinel")?(ne=t=>{A(t.replace(/[^\d]/g,""))},n[21]=ne):ne=n[21];const ie=ne;let oe;n[22]!==u.uiFontSize||n[23]!==D||n[24]!==h?(oe=()=>{const t=(0,x.parseClampedFontSize)(D,{min:x.MIN_UI_FONT_SIZE,max:x.MAX_UI_FONT_SIZE})??u.uiFontSize;M(String(t)),t!==u.uiFontSize&&h({uiFontSize:t})},n[22]=u.uiFontSize,n[23]=D,n[24]=h,n[25]=oe):oe=n[25];const se=oe;let re;n[26]!==v||n[27]!==u.codeFontSize||n[28]!==h?(re=()=>{const t=(0,x.parseClampedFontSize)(v,{min:x.MIN_CODE_FONT_SIZE,max:x.MAX_CODE_FONT_SIZE})??u.codeFontSize;A(String(t)),t!==u.codeFontSize&&h({codeFontSize:t})},n[26]=v,n[27]=u.codeFontSize,n[28]=h,n[29]=re):re=n[29];const le=re;let ae,ce;n[30]!==v?(ae=O(v),n[30]=v,n[31]=ae):ae=n[31];n[32]!==E||n[33]!==ae?(ce={monoFontFamily:E,codeFontSize:ae},n[32]=E,n[33]=ae,n[34]=ce):ce=n[34];const de=ce;let ue,he,ge,pe,me,ye,Se,xe,fe,Fe,be,_e,we,Ce,je,Te,ze,Ie,Ee;n[35]!==o?(ue=o("settings.appearance.theme.title"),n[35]=o,n[36]=ue):ue=n[36];n[37]!==K||n[38]!==u.theme?(he=(0,w.jsx)(t.View,{style:b.settingsStyles.card,children:(0,w.jsx)(L,{value:u.theme,onChange:K})}),n[37]=K,n[38]=u.theme,n[39]=he):he=n[39];n[40]!==ue||n[41]!==he?(ge=(0,w.jsx)(S.SettingsSection,{title:ue,children:he}),n[40]=ue,n[41]=he,n[42]=ge):ge=n[42];n[43]!==o?(pe=o("settings.appearance.fonts.title"),n[43]=o,n[44]=pe):pe=n[44];n[45]!==J||n[46]!==u.uiFontFamily||n[47]!==o||n[48]!==z||n[49]!==C?(me=p?(0,w.jsx)(Z,{title:o("settings.appearance.fonts.interfaceFont"),hint:o("settings.appearance.fonts.interfaceFontHint"),accessibilityLabel:o("settings.appearance.fonts.interfaceFontAccessibility"),placeholder:C,value:u.uiFontFamily,draft:z,withBorder:!1,onChangeDraft:I,onCommit:J}):null,n[45]=J,n[46]=u.uiFontFamily,n[47]=o,n[48]=z,n[49]=C,n[50]=me):me=n[50];n[51]!==o?(ye=o("settings.appearance.fonts.interfaceSize"),n[51]=o,n[52]=ye):ye=n[52];n[53]!==o?(Se=o("settings.appearance.fonts.interfaceSizeAccessibility"),n[53]=o,n[54]=Se):Se=n[54];n[55]!==se||n[56]!==ye||n[57]!==Se||n[58]!==D?(xe=(0,w.jsx)(k,{title:ye,accessibilityLabel:Se,draft:D,withBorder:p,onChangeDraft:te,onCommit:se}),n[55]=se,n[56]=ye,n[57]=Se,n[58]=D,n[59]=xe):xe=n[59];n[60]!==$||n[61]!==E||n[62]!==T||n[63]!==u.monoFontFamily||n[64]!==o?(fe=p?(0,w.jsx)(Z,{title:o("settings.appearance.fonts.codeFont"),hint:o("settings.appearance.fonts.codeFontHint"),accessibilityLabel:o("settings.appearance.fonts.codeFontAccessibility"),placeholder:T,value:u.monoFontFamily,draft:E,withBorder:!0,onChangeDraft:V,onCommit:$}):null,n[60]=$,n[61]=E,n[62]=T,n[63]=u.monoFontFamily,n[64]=o,n[65]=fe):fe=n[65];n[66]!==o?(Fe=o("settings.appearance.fonts.codeSize"),n[66]=o,n[67]=Fe):Fe=n[67];n[68]!==o?(be=o("settings.appearance.fonts.codeSizeAccessibility"),n[68]=o,n[69]=be):be=n[69];n[70]!==v||n[71]!==le||n[72]!==Fe||n[73]!==be?(_e=(0,w.jsx)(k,{title:Fe,accessibilityLabel:be,draft:v,onChangeDraft:ie,onCommit:le}),n[70]=v,n[71]=le,n[72]=Fe,n[73]=be,n[74]=_e):_e=n[74];n[75]!==me||n[76]!==xe||n[77]!==fe||n[78]!==_e?(we=(0,w.jsxs)(t.View,{style:b.settingsStyles.card,children:[me,xe,fe,_e]}),n[75]=me,n[76]=xe,n[77]=fe,n[78]=_e,n[79]=we):we=n[79];n[80]!==pe||n[81]!==we?(Ce=(0,w.jsx)(S.SettingsSection,{title:pe,children:we}),n[80]=pe,n[81]=we,n[82]=Ce):Ce=n[82];n[83]!==o?(je=o("settings.appearance.syntax.title"),n[83]=o,n[84]=je):je=n[84];n[85]!==G||n[86]!==u.syntaxTheme?(Te=(0,w.jsx)(t.View,{style:b.settingsStyles.card,children:(0,w.jsx)(U,{value:u.syntaxTheme,onChange:G})}),n[85]=G,n[86]=u.syntaxTheme,n[87]=Te):Te=n[87];n[88]!==de?(ze=(0,w.jsx)(t.View,{style:R.preview,children:(0,w.jsx)(_.AppearancePreview,{overrides:de})}),n[88]=de,n[89]=ze):ze=n[89];n[90]!==je||n[91]!==Te||n[92]!==ze?(Ie=(0,w.jsxs)(S.SettingsSection,{title:je,children:[Te,ze]}),n[90]=je,n[91]=Te,n[92]=ze,n[93]=Ie):Ie=n[93];n[94]!==ge||n[95]!==Ce||n[96]!==Ie?(Ee=(0,w.jsxs)(t.View,{children:[ge,Ce,Ie]}),n[94]=ge,n[95]=Ce,n[96]=Ie,n[97]=Ee):Ee=n[97];return Ee};var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),l=r(d[4]),c=r(d[5]);r(d[6]),r(d[7]),r(d[8]);var u=r(d[9]),h=r(d[10]),p=r(d[11]),y=r(d[12]),S=r(d[13]),x=r(d[14]),f=r(d[15]),F=r(d[16]),b=r(d[17]),_=r(d[18]),w=r(d[19]);const C=(0,u.withUnistyles)(h.Sun),j=(0,u.withUnistyles)(h.Moon),T=(0,u.withUnistyles)(h.Monitor),z=(0,u.withUnistyles)(h.ChevronDown),I=t=>({color:t.colors.foregroundMuted});function E(t,n){return t({light:"settings.appearance.theme.options.light",dark:"settings.appearance.theme.options.dark",zinc:"settings.appearance.theme.options.zinc",midnight:"settings.appearance.theme.options.midnight",claude:"settings.appearance.theme.options.claude",ghostty:"settings.appearance.theme.options.ghostty",auto:"settings.appearance.theme.options.auto"}[n])}const V=["light","dark","auto"],D=["zinc","midnight","claude","ghostty"],M=new Set(["normal","monospace"]);function N(t,n){return M.has(n)?t("settings.appearance.fonts.systemDefault"):n}function O(t){if(0===t.length)return;const n=Number.parseInt(t,10);return Number.isFinite(n)?n:void 0}function v({pressed:t}){return[R.trigger,t?R.triggerPressed:null]}function A(t){const n=(0,s.c)(5),{themeValue:o}=t;switch(o){case"light":{let t;return n[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,w.jsx)(C,{size:f.ICON_SIZE.md,uniProps:I}),n[0]=t):t=n[0],t}case"dark":{let t;return n[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,w.jsx)(j,{size:f.ICON_SIZE.md,uniProps:I}),n[1]=t):t=n[1],t}case"auto":{let t;return n[2]===Symbol.for("react.memo_cache_sentinel")?(t=(0,w.jsx)(T,{size:f.ICON_SIZE.md,uniProps:I}),n[2]=t):t=n[2],t}default:{const t=f.THEME_SWATCHES[o];let s;return n[3]!==t?(s=(0,w.jsx)(H,{color:t}),n[3]=t,n[4]=s):s=n[4],s}}}function H(n){const o=(0,s.c)(4),{color:l}=n;let c;o[0]!==l?(c=[R.swatch,{backgroundColor:l}],o[0]=l,o[1]=c):c=o[1];const u=c;let h;return o[2]!==u?(h=(0,w.jsx)(t.View,{style:u}),o[2]=u,o[3]=h):h=o[3],h}function W(t){const n=(0,s.c)(13),{themeValue:o,selected:l,onChange:u}=t,{t:h}=(0,c.useTranslation)();let p;n[0]!==u||n[1]!==o?(p=()=>{u(o)},n[0]=u,n[1]=o,n[2]=p):p=n[2];const S=p;let x;n[3]!==o?(x=(0,w.jsx)(A,{themeValue:o}),n[3]=o,n[4]=x):x=n[4];const f=x;let F,b;return n[5]!==h||n[6]!==o?(F=E(h,o),n[5]=h,n[6]=o,n[7]=F):F=n[7],n[8]!==S||n[9]!==f||n[10]!==l||n[11]!==F?(b=(0,w.jsx)(y.DropdownMenuItem,{selected:l,onSelect:S,leading:f,children:F}),n[8]=S,n[9]=f,n[10]=l,n[11]=F,n[12]=b):b=n[12],b}function L(n){const l=(0,s.c)(44),{value:u,onChange:h}=n,{t:p}=(0,c.useTranslation)();let S,x,F,_,C,j,T,M,N,O,H,L,Z,k,P,B,U,X;if(l[0]!==p||l[1]!==u){let n;_=E(p,u),F=t.View,T=b.settingsStyles.row,l[10]!==p?(n=p("settings.appearance.theme.title"),l[10]=p,l[11]=n):n=l[11],l[12]!==n?(M=(0,w.jsx)(t.View,{style:b.settingsStyles.rowContent,children:(0,w.jsx)(o.Text,{style:b.settingsStyles.rowTitle,children:n})}),l[12]=n,l[13]=M):M=l[13],x=y.DropdownMenu,S=y.DropdownMenuTrigger,C=v,j=p("settings.appearance.theme.accessibilityLabel",{value:_}),l[0]=p,l[1]=u,l[2]=S,l[3]=x,l[4]=F,l[5]=_,l[6]=C,l[7]=j,l[8]=T,l[9]=M}else S=l[2],x=l[3],F=l[4],_=l[5],C=l[6],j=l[7],T=l[8],M=l[9];return l[14]!==u?(N=(0,w.jsx)(A,{themeValue:u}),l[14]=u,l[15]=N):N=l[15],l[16]!==_?(O=(0,w.jsx)(o.Text,{style:R.triggerText,children:_}),l[16]=_,l[17]=O):O=l[17],l[18]===Symbol.for("react.memo_cache_sentinel")?(H=(0,w.jsx)(z,{size:f.ICON_SIZE.sm,uniProps:I}),l[18]=H):H=l[18],l[19]!==S||l[20]!==C||l[21]!==j||l[22]!==N||l[23]!==O?(L=(0,w.jsxs)(S,{style:C,accessibilityLabel:j,children:[N,O,H]}),l[19]=S,l[20]=C,l[21]=j,l[22]=N,l[23]=O,l[24]=L):L=l[24],l[25]!==h||l[26]!==u?(Z=V.map(t=>(0,w.jsx)(W,{themeValue:t,selected:u===t,onChange:h},t)),l[25]=h,l[26]=u,l[27]=Z):Z=l[27],l[28]===Symbol.for("react.memo_cache_sentinel")?(k=(0,w.jsx)(y.DropdownMenuSeparator,{}),l[28]=k):k=l[28],l[29]!==h||l[30]!==u?(P=D.map(t=>(0,w.jsx)(W,{themeValue:t,selected:u===t,onChange:h},t)),l[29]=h,l[30]=u,l[31]=P):P=l[31],l[32]!==P||l[33]!==Z?(B=(0,w.jsxs)(y.DropdownMenuContent,{side:"bottom",align:"end",width:200,children:[Z,k,P]}),l[32]=P,l[33]=Z,l[34]=B):B=l[34],l[35]!==x||l[36]!==B||l[37]!==L?(U=(0,w.jsxs)(x,{children:[L,B]}),l[35]=x,l[36]=B,l[37]=L,l[38]=U):U=l[38],l[39]!==F||l[40]!==U||l[41]!==T||l[42]!==M?(X=(0,w.jsxs)(F,{style:T,children:[M,U]}),l[39]=F,l[40]=U,l[41]=T,l[42]=M,l[43]=X):X=l[43],X}function Z({title:s,hint:c,accessibilityLabel:u,placeholder:h,value:p,draft:y,withBorder:S,onChangeDraft:x,onCommit:f}){const F=(0,l.useCallback)(()=>{f(y)},[y,f]);return(0,l.useEffect)(()=>{x(p)},[p]),(0,w.jsxs)(t.View,{style:S?R.rowWithBorder:b.settingsStyles.row,children:[(0,w.jsxs)(t.View,{style:b.settingsStyles.rowContent,children:[(0,w.jsx)(o.Text,{style:b.settingsStyles.rowTitle,children:s}),(0,w.jsx)(o.Text,{style:b.settingsStyles.rowHint,children:c})]}),(0,w.jsx)(n.TextInput,{value:y,onChangeText:x,onBlur:F,onSubmitEditing:F,placeholder:h,placeholderTextColor:R.placeholderColor.color,autoCapitalize:"none",autoCorrect:!1,spellCheck:!1,style:R.fontFamilyInput,accessibilityLabel:u})]})}function k(l){const c=(0,s.c)(14),{title:u,accessibilityLabel:h,draft:p,withBorder:y,onChangeDraft:S,onCommit:x}=l,f=void 0===y||y?R.rowWithBorder:b.settingsStyles.row;let F,_,C,j,T;return c[0]!==u?(F=(0,w.jsx)(t.View,{style:b.settingsStyles.rowContent,children:(0,w.jsx)(o.Text,{style:b.settingsStyles.rowTitle,children:u})}),c[0]=u,c[1]=F):F=c[1],c[2]!==h||c[3]!==p||c[4]!==S||c[5]!==x?(_=(0,w.jsx)(n.TextInput,{value:p,onChangeText:S,onBlur:x,onSubmitEditing:x,keyboardType:"number-pad",inputMode:"numeric",selectTextOnFocus:!0,style:R.sizeInput,accessibilityLabel:h}),c[2]=h,c[3]=p,c[4]=S,c[5]=x,c[6]=_):_=c[6],c[7]===Symbol.for("react.memo_cache_sentinel")?(C=(0,w.jsx)(o.Text,{style:R.unit,children:"px"}),c[7]=C):C=c[7],c[8]!==_?(j=(0,w.jsxs)(t.View,{style:R.sizeField,children:[_,C]}),c[8]=_,c[9]=j):j=c[9],c[10]!==f||c[11]!==F||c[12]!==j?(T=(0,w.jsxs)(t.View,{style:f,children:[F,j]}),c[10]=f,c[11]=F,c[12]=j,c[13]=T):T=c[13],T}function P(t){const n=p.SYNTAX_THEME_OPTIONS.find(n=>n.id===t);return n?n.label:t}function B(t){const n=(0,s.c)(7),{option:o,selected:l,onChange:c}=t;let u;n[0]!==c||n[1]!==o.id?(u=()=>{c(o.id)},n[0]=c,n[1]=o.id,n[2]=u):u=n[2];const h=u;let p;return n[3]!==h||n[4]!==o.label||n[5]!==l?(p=(0,w.jsx)(y.DropdownMenuItem,{selected:l,onSelect:h,children:o.label}),n[3]=h,n[4]=o.label,n[5]=l,n[6]=p):p=n[6],p}function U(n){const l=(0,s.c)(43),{value:u,onChange:h}=n,{t:S}=(0,c.useTranslation)();let x,F,_,C,j,T,E,V,D,M,N,O,A,H,W;if(l[0]!==S||l[1]!==u){let n,s,c,h;C=P(u),_=t.View,E=b.settingsStyles.row,l[10]!==S?(n=S("settings.appearance.syntax.highlightTheme"),l[10]=S,l[11]=n):n=l[11],l[12]!==n?(s=(0,w.jsx)(o.Text,{style:b.settingsStyles.rowTitle,children:n}),l[12]=n,l[13]=s):s=l[13],l[14]!==S?(c=S("settings.appearance.syntax.highlightThemeHint"),l[14]=S,l[15]=c):c=l[15],l[16]!==c?(h=(0,w.jsx)(o.Text,{style:b.settingsStyles.rowHint,children:c}),l[16]=c,l[17]=h):h=l[17],l[18]!==s||l[19]!==h?(V=(0,w.jsxs)(t.View,{style:b.settingsStyles.rowContent,children:[s,h]}),l[18]=s,l[19]=h,l[20]=V):V=l[20],F=y.DropdownMenu,x=y.DropdownMenuTrigger,j=v,T=S("settings.appearance.syntax.highlightThemeAccessibility",{value:C}),l[0]=S,l[1]=u,l[2]=x,l[3]=F,l[4]=_,l[5]=C,l[6]=j,l[7]=T,l[8]=E,l[9]=V}else x=l[2],F=l[3],_=l[4],C=l[5],j=l[6],T=l[7],E=l[8],V=l[9];return l[21]!==C?(D=(0,w.jsx)(o.Text,{style:R.triggerText,children:C}),l[21]=C,l[22]=D):D=l[22],l[23]===Symbol.for("react.memo_cache_sentinel")?(M=(0,w.jsx)(z,{size:f.ICON_SIZE.sm,uniProps:I}),l[23]=M):M=l[23],l[24]!==x||l[25]!==j||l[26]!==T||l[27]!==D?(N=(0,w.jsxs)(x,{style:j,accessibilityLabel:T,children:[D,M]}),l[24]=x,l[25]=j,l[26]=T,l[27]=D,l[28]=N):N=l[28],l[29]!==h||l[30]!==u?(O=p.SYNTAX_THEME_OPTIONS.map(t=>(0,w.jsx)(B,{option:t,selected:u===t.id,onChange:h},t.id)),l[29]=h,l[30]=u,l[31]=O):O=l[31],l[32]!==O?(A=(0,w.jsx)(y.DropdownMenuContent,{side:"bottom",align:"end",width:200,children:O}),l[32]=O,l[33]=A):A=l[33],l[34]!==F||l[35]!==N||l[36]!==A?(H=(0,w.jsxs)(F,{children:[N,A]}),l[34]=F,l[35]=N,l[36]=A,l[37]=H):H=l[37],l[38]!==_||l[39]!==H||l[40]!==E||l[41]!==V?(W=(0,w.jsxs)(_,{style:E,children:[V,H]}),l[38]=_,l[39]=H,l[40]=E,l[41]=V,l[42]=W):W=l[42],W}const R=u.StyleSheet.create(t=>({preview:{marginTop:t.spacing[4],uni__dependencies:[0]},rowWithBorder:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:t.spacing[4],paddingHorizontal:t.spacing[4],borderTopWidth:t.borderWidth[1],borderTopColor:t.colors.border,uni__dependencies:[0]},trigger:{flexDirection:"row",alignItems:"center",gap:t.spacing[1],paddingVertical:t.spacing[1],paddingHorizontal:t.spacing[2],borderRadius:t.borderRadius.md,borderWidth:t.borderWidth[1],borderColor:t.colors.border,uni__dependencies:[0]},triggerPressed:{opacity:.85},triggerText:{color:t.colors.foreground,fontSize:t.fontSize.sm,uni__dependencies:[0]},swatch:{width:f.ICON_SIZE.md,height:f.ICON_SIZE.md,borderRadius:f.ICON_SIZE.md/2,borderWidth:t.borderWidth[1],borderColor:t.colors.border,uni__dependencies:[0]},fontFamilyInput:{flexGrow:1,flexShrink:1,maxWidth:280,minHeight:36,paddingVertical:t.spacing[2],paddingHorizontal:t.spacing[3],borderRadius:t.borderRadius.md,borderWidth:t.borderWidth[1],borderColor:t.colors.border,backgroundColor:t.colors.surface2,color:t.colors.foreground,fontSize:t.fontSize.sm,textAlign:"left",uni__dependencies:[0]},sizeField:{flexDirection:"row",alignItems:"center",gap:t.spacing[2],uni__dependencies:[0]},sizeInput:{width:64,minHeight:36,paddingVertical:t.spacing[2],paddingHorizontal:t.spacing[3],borderRadius:t.borderRadius.md,borderWidth:t.borderWidth[1],borderColor:t.colors.border,backgroundColor:t.colors.surface2,color:t.colors.foreground,fontSize:t.fontSize.sm,textAlign:"right",uni__dependencies:[0]},unit:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,uni__dependencies:[0]},placeholderColor:{color:t.colors.foregroundMuted,uni__dependencies:[0]}}))},4727,[348,714,711,349,36,1573,234,715,146,56,1600,306,3572,4726,3575,305,3407,3907,4728,279]);
|
|
16487
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.AppearancePreview=function(c){const s=(0,t.c)(15),{overrides:f}=c,{t:_}=(0,l.useTranslation)();let y;s[0]===Symbol.for("react.memo_cache_sentinel")?(y=S(),s[0]=y):y=s[0];const p=y;let E;s[1]!==f?(E=R(f),s[1]=f,s[2]=E):E=s[2];const h=E;let k;s[3]!==h?(k=[w.codeLine,h],s[3]=h,s[4]=k):k=s[4];const v=k;let x;s[5]===Symbol.for("react.memo_cache_sentinel")?(x=[w.row,w.addRow],s[5]=x):x=s[5];const A=x;let C;s[6]===Symbol.for("react.memo_cache_sentinel")?(C=[w.row,w.removeRow],s[6]=C):C=s[6];const O=C;let W;s[7]===Symbol.for("react.memo_cache_sentinel")?(W=function(o){return"add"===o?A:"remove"===o?O:w.row},s[7]=W):W=s[7];const j=W;let I,V,P;s[8]!==_?(I=_("settings.appearance.syntax.previewAccessibility"),s[8]=_,s[9]=I):I=s[9];s[10]!==v?(V=p.map(t=>(0,b.jsx)(o.View,{style:j(t.type),children:(0,b.jsxs)(n.Text,{style:v,children:[(0,b.jsx)(n.Text,{style:F(t.type),children:t.marker}),t.tokens?t.tokens.map(T):t.fallbackText]})},t.key)),s[10]=v,s[11]=V):V=s[11];s[12]!==I||s[13]!==V?(P=(0,b.jsx)(o.View,{accessibilityRole:"image",accessibilityLabel:I,dataSet:u.CODE_SURFACE_DATASET,style:w.card,children:V}),s[12]=I,s[13]=V,s[14]=P):P=s[14];return P};var o=r(d[0]),n=r(d[1]),t=r(d[2]);r(d[3]);var l=r(d[4]);r(d[5]),r(d[6]);var c=r(d[7]),s=r(d[8]),u=r(d[9]),f=r(d[10]),_=r(d[11]),y=r(d[12]),p=r(d[13]),E=r(d[14]),b=r(d[15]);const h="ts",k="\u200b";function v(o,n){if(void 0===o)return;const t=o.trim();return 0===t.length?n:t}function R(o){if(!o)return{};const n={},t=v(o.monoFontFamily,_.DEFAULT_MONO_FONT_STACK);void 0!==t&&(n.fontFamily=t);const l="number"==typeof(c=o.codeFontSize)&&Number.isFinite(c)?c:void 0;var c;return void 0!==l&&(n.fontSize=l,n.lineHeight=Math.round(1.5*l)),(0,y.inlineUnistylesStyle)(n)}function x(o,n,t,l,c){const s=c&&c.length>0?c.map((n,t)=>({key:`${o}-${t}`,style:n.style,text:n.text})):null;return{key:o,type:n,marker:t,tokens:s,fallbackText:l.length>0?l:k}}function S(){const o=(0,p.tokenizeToLines)(E.PREVIEW_BEFORE.join("\n"),h),n=(0,p.tokenizeToLines)(E.PREVIEW_AFTER.join("\n"),h),t=[];for(let l=0;l<E.PREVIEW_BEFORE.length;l+=1)E.CHANGED_LINE_INDICES.has(l)?(t.push(x(`r-${l}`,"remove","- ",E.PREVIEW_BEFORE[l],o?.[l]??null)),t.push(x(`a-${l}`,"add","+ ",E.PREVIEW_AFTER[l],n?.[l]??null))):t.push(x(`c-${l}`,"context"," ",E.PREVIEW_BEFORE[l],o?.[l]??null));return t}function F(o){return"add"===o?w.markerAdd:"remove"===o?w.markerRemove:w.markerContext}function T(o){return(0,b.jsx)(n.Text,{style:o.style?(0,f.syntaxTokenStyleFor)(o.style):void 0,children:o.text},o.key)}const w=c.StyleSheet.create(o=>({card:{backgroundColor:o.colors.surface1,borderRadius:o.borderRadius.lg,borderWidth:o.borderWidth[1],borderColor:o.colors.border,overflow:"hidden",paddingVertical:o.spacing[2],uni__dependencies:[0]},row:{paddingHorizontal:o.spacing[3],uni__dependencies:[0]},addRow:{backgroundColor:"rgba(46, 160, 67, 0.15)"},removeRow:{backgroundColor:"rgba(248, 81, 73, 0.1)"},codeLine:Object.assign({fontFamily:o.fontFamily.mono,fontSize:o.fontSize.code,lineHeight:o.lineHeight.diff,color:o.colors.foreground},s.isWeb?{whiteSpace:"pre",overflowWrap:"normal"}:null,{uni__dependencies:[0]}),markerContext:{color:o.colors.foregroundMuted,uni__dependencies:[0]},markerAdd:{color:o.colors.diffAddition,uni__dependencies:[0]},markerRemove:{color:o.colors.diffDeletion,uni__dependencies:[0]}}))},4728,[348,711,349,36,1573,234,146,56,3407,3802,3803,305,3471,3804,4729,279]);
|
|
16488
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),
|
|
16489
|
-
__d(function(g,r,i,a,m,
|
|
16490
|
-
__d(function(g,r,i,a,m,
|
|
16491
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.AddHostModal=function({visible:e,onClose:c,onCancel:y,onSaved:x}){const{theme:_}=(0,p.useUnistyles)(),{t:D}=(0,l.useTranslation)(),M=(0,f.useHosts)(),{probeAndUpsertDirectConnection:z}=(0,f.useHostMutations)(),V=(0,h.useIsCompactFormFactor)(),[E,F]=(0,n.useState)(!1),[P,$]=(0,n.useState)(""),[A,W]=(0,n.useState)(""),[L,U]=(0,n.useState)("6767"),[K,O]=(0,n.useState)(!1),[N,B]=(0,n.useState)(""),[H,q]=(0,n.useState)(!1),[G,J]=(0,n.useState)(!1),[Q,X]=(0,n.useState)(""),[Y,Z]=(0,n.useReducer)(e=>e+1,0),ee=(0,n.useCallback)(()=>{W(""),U("6767"),O(!1),B(""),q(!1),J(!1),X(""),Z()},[]),te=(0,n.useMemo)(()=>(0,T.jsx)(b.Link2,{size:16,color:_.colors.accentForeground}),[_.colors.accentForeground]),re=(0,n.useMemo)(()=>[j.field,j.hostField],[]),ie=(0,n.useMemo)(()=>[j.field,j.portField],[]),oe=(0,n.useMemo)(()=>[j.checkbox,K?j.checkboxChecked:null],[K]),se=(0,n.useMemo)(()=>[j.input,j.passwordInput],[]),ne=(0,n.useMemo)(()=>({checked:K,disabled:E}),[E,K]),le=(0,n.useMemo)(()=>({hostRequired:D("pairing.direct.errors.hostRequired"),invalidPort:D("pairing.direct.errors.invalidPort"),invalidConnection:D("pairing.direct.errors.invalidConnection"),failedToConnect:e=>D("pairing.direct.errors.failedToConnect",{endpoint:e}),noAdditionalDetails:e=>D("pairing.direct.errors.noAdditionalDetails",{detail:e}),timedOut:D("pairing.direct.errors.timedOut"),refused:D("pairing.direct.errors.refused"),hostNotFound:D("pairing.direct.errors.hostNotFound"),hostUnreachable:D("pairing.direct.errors.hostUnreachable"),tlsError:D("pairing.direct.errors.tlsError"),unableToConnect:D("pairing.direct.errors.unableToConnect")}),[D]),de=(0,n.useMemo)(()=>({title:D("pairing.direct.title")}),[D]),ae=(0,n.useCallback)(()=>{E||(ee(),$(""),c())},[E,ee,c]),ce=(0,n.useCallback)(()=>{E||(ee(),$(""),(y??c)())},[E,ee,y,c]),ue=(0,n.useCallback)(async()=>{if(E)return;let e;try{e=S({host:A,port:L,useTls:K,password:N},le)}catch(e){const t=e instanceof Error?e.message:le.invalidConnection;return void $(t)}try{F(!0),$("");const{profile:t,serverId:o,hostname:s}=await z(Object.assign({endpoint:e.endpoint,useTls:e.useTls},e.password?{password:e.password}:{})),n=!M.some(e=>e.serverId===o);x?.({profile:t,serverId:o,hostname:s,isNewHost:n}),ae()}catch(t){const{title:o,detail:s,raw:n}=R({endpoint:e.uri,error:t,labels:le});let l;l=n&&s&&n!==s?`${o}\n${s}\n${D("pairing.direct.errors.details",{detail:n})}`:s?`${o}\n${s}`:o,$(l),V||u.default.alert(D("pairing.direct.errors.failedTitle"),l)}finally{F(!1)}},[M,le,ae,A,V,E,x,N,L,z,D,K]),pe=(0,n.useCallback)(()=>{ue()},[ue]),he=(0,n.useCallback)(()=>{ue()},[ue]),ge=(0,n.useCallback)(()=>{E||O(e=>!e)},[E]),be=(0,n.useCallback)(()=>{q(e=>!e)},[]),fe=(0,n.useCallback)(()=>{if(!G){try{X(I({host:A,port:L,useTls:K,password:N},le))}catch{X("")}return $(""),void J(!0)}try{const e=k(Q);W(e.host),U(e.port),O(e.useTls),B(e.password),$(""),Z()}catch{$("")}J(!1)},[Q,le,A,G,N,L,K]),ye=G?b.ChevronDown:b.ChevronRight,xe=H?b.EyeOff:b.Eye;return(0,T.jsxs)(w.AdaptiveModalSheet,{header:de,visible:e,onClose:ae,testID:"add-host-modal",children:[(0,T.jsx)(o.Text,{style:j.helper,children:D("pairing.direct.helper")}),(0,T.jsxs)(t.View,{style:j.portRow,children:[(0,T.jsxs)(t.View,{style:re,children:[(0,T.jsx)(o.Text,{style:j.label,children:D("pairing.direct.fields.host")}),(0,T.jsx)(w.AdaptiveTextInput,{testID:"direct-host-input",nativeID:"direct-host-input",accessibilityLabel:D("pairing.direct.fields.host"),initialValue:A,resetKey:`direct-host-${Y}`,value:A,onChangeText:W,placeholder:"localhost",placeholderTextColor:_.colors.foregroundMuted,style:j.input,autoCapitalize:"none",autoCorrect:!1,keyboardType:"url",editable:!E,returnKeyType:"next"})]}),(0,T.jsxs)(t.View,{style:ie,children:[(0,T.jsx)(o.Text,{style:j.label,children:D("pairing.direct.fields.port")}),(0,T.jsx)(w.AdaptiveTextInput,{testID:"direct-port-input",nativeID:"direct-port-input",accessibilityLabel:D("pairing.direct.fields.port"),initialValue:L,resetKey:`direct-port-${Y}`,value:L,onChangeText:U,placeholder:"6767",placeholderTextColor:_.colors.foregroundMuted,style:j.input,autoCapitalize:"none",autoCorrect:!1,keyboardType:"number-pad",editable:!E,returnKeyType:"done",onSubmitEditing:pe})]})]}),(0,T.jsxs)(s.Pressable,{style:j.checkboxRow,onPress:ge,disabled:E,accessibilityRole:"checkbox",accessibilityLabel:D("pairing.direct.fields.useSsl"),accessibilityState:ne,testID:"direct-ssl-toggle",children:[(0,T.jsx)(t.View,{style:oe,children:K?(0,T.jsx)(t.View,{testID:"direct-ssl-toggle-checked",children:(0,T.jsx)(b.Check,{size:14,color:_.colors.accentForeground})}):null}),(0,T.jsx)(o.Text,{style:j.label,children:D("pairing.direct.fields.useSsl")})]}),(0,T.jsxs)(t.View,{style:j.field,children:[(0,T.jsx)(o.Text,{style:j.label,children:D("pairing.direct.fields.password")}),(0,T.jsxs)(t.View,{style:j.passwordRow,children:[(0,T.jsx)(w.AdaptiveTextInput,{testID:"direct-password-input",nativeID:"direct-password-input",accessibilityLabel:D("pairing.direct.fields.password"),initialValue:N,resetKey:`direct-password-${Y}`,value:N,onChangeText:B,placeholder:D("pairing.direct.fields.optional"),placeholderTextColor:_.colors.foregroundMuted,style:se,autoCapitalize:"none",autoCorrect:!1,secureTextEntry:!H,editable:!E,returnKeyType:"done",onSubmitEditing:pe}),(0,T.jsx)(s.Pressable,{style:j.iconButton,onPress:be,disabled:E,accessibilityRole:"button",accessibilityLabel:D(H?"pairing.direct.passwordVisibility.hide":"pairing.direct.passwordVisibility.show"),testID:"direct-password-visibility-toggle",children:(0,T.jsx)(xe,{size:18,color:_.colors.foregroundMuted})})]})]}),(0,T.jsxs)(t.View,{style:j.field,children:[(0,T.jsxs)(s.Pressable,{style:j.advancedToggle,onPress:fe,disabled:E,accessibilityRole:"button",accessibilityLabel:D(G?"pairing.direct.advanced.hide":"pairing.direct.advanced.show"),testID:"direct-host-advanced-toggle",children:[(0,T.jsx)(ye,{size:16,color:_.colors.foregroundMuted}),(0,T.jsx)(o.Text,{style:j.advancedText,children:D("pairing.direct.advanced.label")})]}),G?(0,T.jsx)(w.AdaptiveTextInput,{testID:"direct-host-uri-input",nativeID:"direct-host-uri-input",accessibilityLabel:D("pairing.direct.fields.connectionUri"),initialValue:Q,resetKey:`direct-host-uri-${Y}`,value:Q,onChangeText:X,placeholder:"tcp://localhost:6767?ssl=true",placeholderTextColor:_.colors.foregroundMuted,style:j.input,autoCapitalize:"none",autoCorrect:!1,keyboardType:"url",editable:!E,returnKeyType:"done",onSubmitEditing:fe}):null,P?(0,T.jsx)(o.Text,{style:j.error,children:P}):null]}),(0,T.jsxs)(t.View,{style:j.actions,children:[(0,T.jsx)(C.Button,{style:v,variant:"secondary",onPress:ce,disabled:E,children:D("pairing.direct.actions.cancel")}),(0,T.jsx)(C.Button,{style:v,variant:"default",onPress:he,disabled:E,leftIcon:te,testID:"direct-host-submit",children:D(E?"pairing.direct.actions.connecting":"pairing.direct.actions.connect")})]})]})};var e,t=r(d[0]),o=r(d[1]),s=r(d[2]),n=r(d[3]),l=r(d[4]),c=r(d[5]),u=(e=c)&&e.__esModule?e:{default:e};r(d[6]),r(d[7]),r(d[8]);var p=r(d[9]),h=r(d[10]),b=r(d[11]),f=r(d[12]),y=r(d[13]),x=r(d[14]),w=r(d[15]),C=r(d[16]),T=r(d[17]);const v={flex:1},j=p.StyleSheet.create(e=>({field:{gap:e.spacing[2],uni__dependencies:[0]},label:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,fontWeight:e.fontWeight.medium,uni__dependencies:[0]},input:{backgroundColor:e.colors.surface2,borderRadius:e.borderRadius.lg,paddingHorizontal:e.spacing[4],paddingVertical:e.spacing[3],color:e.colors.foreground,borderWidth:1,borderColor:e.colors.border,uni__dependencies:[0]},portRow:{flexDirection:"row",gap:e.spacing[3],uni__dependencies:[0]},hostField:{flex:1,minWidth:0},portField:{width:112},passwordRow:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},passwordInput:{flex:1,minWidth:0},iconButton:{width:44,height:44,alignItems:"center",justifyContent:"center",borderRadius:e.borderRadius.lg,backgroundColor:e.colors.surface2,borderWidth:1,borderColor:e.colors.border,uni__dependencies:[0]},checkboxRow:{flexDirection:"row",alignItems:"center",gap:e.spacing[3],uni__dependencies:[0]},checkbox:{width:22,height:22,borderRadius:e.borderRadius.sm,borderWidth:1,borderColor:e.colors.border,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},checkboxChecked:{backgroundColor:e.colors.accent,borderColor:e.colors.accent,uni__dependencies:[0]},advancedToggle:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],alignSelf:"flex-start",paddingVertical:e.spacing[1],uni__dependencies:[0]},advancedText:{color:e.colors.foreground,fontSize:e.fontSize.sm,fontWeight:e.fontWeight.medium,uni__dependencies:[0]},actions:{flexDirection:"row",gap:e.spacing[3],marginTop:e.spacing[2],uni__dependencies:[0]},helper:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,uni__dependencies:[0]},error:{color:e.colors.destructive,fontSize:e.fontSize.sm,uni__dependencies:[0]}}));function _(e){return e.includes(":")&&!e.startsWith("[")&&!e.endsWith("]")}function I(e,t){const o=e.host.trim(),s=Number(e.port.trim());if(!o)throw new Error(t.hostRequired);if(!Number.isInteger(s)||s<1||s>65535)throw new Error(t.invalidPort);return(0,y.serializeConnectionUriForStorage)(Object.assign({host:o,port:s,isIpv6:_(o),useTls:e.useTls},e.password?{password:e.password}:{}))}function S(e,t){const o=(0,y.parseConnectionUri)(I(e,t)),s=o.isIpv6?`[${o.host}]:${o.port}`:`${o.host}:${o.port}`;return Object.assign({uri:(0,y.serializeConnectionUri)(o),endpoint:s,useTls:o.useTls},o.password?{password:o.password}:{})}function k(e){const t=(0,y.parseConnectionUri)(e);return{host:t.host,port:String(t.port),useTls:t.useTls,password:t.password??""}}function D(e){if(!e)return null;const t=e.trim();return t||null}function M(e,t){const o=Array.from(new Set(e.map(e=>D(e)).filter(e=>Boolean(e)).map(e=>e.trim()).filter(e=>e.length>0)));if(0===o.length)return null;return o.every(e=>{const t=e.toLowerCase();return"transport error"===t||"transport closed"===t})?t.noAdditionalDetails(o[0]??""):o.join(" \u2014 ")}function R(e){const{endpoint:t,error:o,labels:s}=e,n=s.failedToConnect(t),l=o instanceof x.DaemonConnectionTestError?M([o.reason,o.lastError],s)??D(o.message):o instanceof Error?D(o.message):null,c=l?.toLowerCase()??"";let u=null;return u="Incorrect password"===l||"Password required"===l?l:c.includes("timed out")?s.timedOut:c.includes("econnrefused")||c.includes("connection refused")||c.includes("err_connection_refused")?s.refused:c.includes("enotfound")||c.includes("not found")?s.hostNotFound:c.includes("ehostunreach")||c.includes("host is unreachable")?s.hostUnreachable:c.includes("certificate")||c.includes("tls")||c.includes("ssl")?s.tlsError:s.unableToConnect,{title:n,detail:u,raw:l}}},4732,[348,711,1572,36,1573,1389,1308,234,146,56,3457,1600,3271,3399,3408,3466,3627,279]);
|
|
16492
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.PairLinkModal=function({visible:e,onClose:s,onCancel:I,onSaved:S}){const{theme:j}=(0,u.useUnistyles)(),{t:z}=(0,l.useTranslation)(),M=(0,b.useHosts)(),{upsertConnectionFromOfferUrl:w}=(0,b.useHostMutations)(),P=(0,p.useIsCompactFormFactor)(),D=(0,t.useRef)(""),F=(0,t.useRef)(null),[O,R]=(0,t.useState)(!1),[H,L]=(0,t.useState)(""),B=(0,t.useCallback)(()=>{D.current="",F.current?.clear()},[]),E=(0,t.useMemo)(()=>(0,C.jsx)(f.Link,{size:16,color:j.colors.accentForeground}),[j.colors.accentForeground]),V=(0,t.useCallback)(()=>{O||(B(),L(""),s())},[O,B,s]),W=(0,t.useCallback)(()=>{O||(B(),L(""),(I??s)())},[O,B,I,s]),A=(0,t.useCallback)(async()=>{if(O)return;const e=D.current.trim();if(!e)return void L(z("pairing.link.errors.required"));if(!e.includes("#offer="))return void L(z("pairing.link.errors.missingOffer"));const n=(()=>{try{const n=e.indexOf("#offer="),o=e.slice(n+7).trim();if(!o)throw new Error(z("pairing.link.errors.emptyOffer"));const t=(0,y.decodeOfferFragmentPayload)(o);return h.ConnectionOfferSchema.parse(t)}catch(e){const n=e instanceof Error?e.message:z("pairing.link.errors.invalid");return L(n),P||c.default.alert(z("pairing.link.alert.failedTitle"),n),null}})();if(n)try{R(!0),L("");const{client:o,hostname:t}=await(0,k.connectToDaemon)({id:"probe",type:"relay",relayEndpoint:(0,y.normalizeHostPort)(n.relay.endpoint),useTls:n.relay.useTls,daemonPublicKeyB64:n.daemonPublicKeyB64},{serverId:n.serverId});await o.close().catch(()=>{});const l=!M.some(e=>e.serverId===n.serverId),s=await w(e,t??void 0);S?.({profile:s,serverId:n.serverId,hostname:t,isNewHost:l}),V()}catch(e){const n=e instanceof Error?e.message:z("pairing.link.errors.unableToPair");L(n),P||c.default.alert(z("pairing.link.alert.failedTitle"),n)}finally{R(!1)}},[M,V,P,O,S,z,w]),K=(0,t.useCallback)(e=>{D.current=e},[]),U=(0,t.useCallback)(()=>{A()},[A]),q=(0,t.useMemo)(()=>({title:z("pairing.link.title")}),[z]);return(0,C.jsxs)(v.AdaptiveModalSheet,{header:q,visible:e,onClose:V,testID:"pair-link-modal",children:[(0,C.jsx)(o.Text,{style:T.helper,children:z("pairing.link.helper")}),(0,C.jsxs)(n.View,{style:T.field,children:[(0,C.jsx)(o.Text,{style:T.label,children:z("pairing.link.label")}),(0,C.jsx)(v.AdaptiveTextInput,{ref:F,testID:"pair-link-input",nativeID:"pair-link-input",accessibilityLabel:z("pairing.link.label"),onChangeText:K,placeholder:"https://app.paseo.sh/#offer=...",placeholderTextColor:j.colors.foregroundMuted,style:T.input,autoFocus:!0,autoCapitalize:"none",autoCorrect:!1,keyboardType:"url"}),H?(0,C.jsx)(o.Text,{style:T.error,children:H}):null]}),(0,C.jsxs)(n.View,{style:T.actions,children:[(0,C.jsx)(x.Button,{style:_,variant:"secondary",onPress:W,disabled:O,testID:"pair-link-cancel",accessibilityRole:"button",accessibilityLabel:z("pairing.link.actions.cancel"),children:z("pairing.link.actions.cancel")}),(0,C.jsx)(x.Button,{style:_,variant:"default",onPress:U,disabled:O,testID:"pair-link-submit",accessibilityRole:"button",accessibilityLabel:z("pairing.link.actions.pair"),leftIcon:E,children:z(O?"pairing.link.actions.pairing":"pairing.link.actions.pair")})]})]})};var e,n=r(d[0]),o=r(d[1]),t=r(d[2]),l=r(d[3]),s=r(d[4]),c=(e=s)&&e.__esModule?e:{default:e};r(d[5]),r(d[6]);var u=r(d[7]),p=r(d[8]),f=r(d[9]),b=r(d[10]),y=r(d[11]),k=r(d[12]),h=r(d[13]),v=r(d[14]),x=r(d[15]),C=r(d[16]);const _={flex:1},T=u.StyleSheet.create(e=>({helper:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,uni__dependencies:[0]},field:{gap:e.spacing[2],uni__dependencies:[0]},label:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,fontWeight:e.fontWeight.medium,uni__dependencies:[0]},input:{backgroundColor:e.colors.surface2,borderRadius:e.borderRadius.lg,paddingHorizontal:e.spacing[4],paddingVertical:e.spacing[3],color:e.colors.foreground,borderWidth:1,borderColor:e.colors.border,uni__dependencies:[0]},error:{color:e.colors.destructive,fontSize:e.fontSize.sm,uni__dependencies:[0]},actions:{flexDirection:"row",gap:e.spacing[3],marginTop:e.spacing[2],uni__dependencies:[0]}}))},4733,[348,711,36,1573,1389,234,146,56,3457,1600,3271,3399,3408,3400,3466,3627,279]);
|
|
16493
|
-
__d(function(g,r,i,a,m,
|
|
16494
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16495
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16496
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16497
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16498
|
-
__d(function(g,r,i,
|
|
16499
|
-
__d(function(g,r,i,
|
|
16500
|
-
__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.LocalDaemonSection=function(){const o=(0,s.c)(79),{t:l}=(0,p.useTranslation)(),{theme:d}=(0,h.useUnistyles)(),c=(0,w.shouldUseDesktopDaemon)(),u=(0,M.resolveAppVersion)(),{settings:x,updateSettings:C,isLoading:T}=(0,A.useDesktopSettings)(),z=x.daemon;let R;o[0]!==C?(R=e=>C({daemon:e}),o[0]=C,o[1]=R):R=o[1];const B=R,{data:H,isLoading:E,error:K,setStatus:G,refetch:W}=(0,v.useDaemonStatus)(),q=H?.status??null,J=H?.logs??null,N=q?.version??null,X=(0,k.isVersionMismatch)(u,N);let Y;o[2]!==q?.status||o[3]!==K||o[4]!==l?(Y=K??l("running"===q?.status?"desktop.daemon.status.running":"desktop.daemon.status.notRunning"),o[2]=q?.status,o[3]=K,o[4]=l,o[5]=Y):Y=o[5];const Z=Y,$=q?.pid?q.pid:"\u2014";let ee;o[6]!==l||o[7]!==$?(ee=l("desktop.daemon.status.pid",{pid:$}),o[6]=l,o[7]=$,o[8]=ee):ee=o[8];const te=ee,ne=!z.manageBuiltInDaemon;let se;o[9]!==z||o[10]!==q||o[11]!==W||o[12]!==G||o[13]!==B?(se={daemonStatus:q,settings:z,updateSettings:B,setStatus:G,refreshStatus:W},o[9]=z,o[10]=q,o[11]=W,o[12]=G,o[13]=B,o[14]=se):se=o[14];const{isUpdating:oe,toggle:ie}=(0,b.useBuiltInDaemonManagement)(se);let le;o[15]!==z||o[16]!==B?(le={settings:z,updateSettings:B},o[15]=z,o[16]=B,o[17]=le):le=o[17];const{isUpdatingKeepRunningAfterQuit:ae,handleToggleKeepRunningAfterQuit:de}=P(le),{isLogsModalOpen:re,handleCopyLogPath:ce,handleOpenLogs:ue,handleCloseLogsModal:ge}=D(J),{cliStatusOutput:pe,isCliStatusModalOpen:me,isLoadingCliStatus:he,handleCopyCliStatus:Se,handleOpenCliStatus:ye,handleCloseCliStatusModal:fe}=L();let xe;o[18]!==ye?(xe=()=>{ye()},o[18]=ye,o[19]=xe):xe=o[19];const je=xe,Ce=Q;let Te;o[20]!==d.colors.foregroundMuted||o[21]!==d.iconSize.sm?(Te=(0,_.jsx)(f.ArrowUpRight,{size:d.iconSize.sm,color:d.colors.foregroundMuted}),o[20]=d.colors.foregroundMuted,o[21]=d.iconSize.sm,o[22]=Te):Te=o[22];const ke=Te;let we;o[23]!==d.colors.foreground||o[24]!==d.iconSize.sm?(we=(0,_.jsx)(f.Copy,{size:d.iconSize.sm,color:d.colors.foreground}),o[23]=d.colors.foreground,o[24]=d.iconSize.sm,o[25]=we):we=o[25];const be=we;let ve;o[26]!==d.colors.foreground||o[27]!==d.iconSize.sm?(ve=(0,_.jsx)(f.FileText,{size:d.iconSize.sm,color:d.colors.foreground}),o[26]=d.colors.foreground,o[27]=d.iconSize.sm,o[28]=ve):ve=o[28];const Ae=ve;let Me;o[29]!==d.colors.foreground||o[30]!==d.iconSize.sm?(Me=(0,_.jsx)(f.Activity,{size:d.iconSize.sm,color:d.colors.foreground}),o[29]=d.colors.foreground,o[30]=d.iconSize.sm,o[31]=Me):Me=o[31];const ze=Me;let Pe,Re,Le;o[32]!==l?(Pe=l("desktop.daemon.openAdvancedSettings"),o[32]=l,o[33]=Pe):Pe=o[33];o[34]!==l?(Re=l("desktop.daemon.advancedSettings"),o[34]=l,o[35]=Re):Re=o[35];o[36]!==ke||o[37]!==Pe||o[38]!==Re?(Le=(0,_.jsx)(j.Button,{variant:"ghost",size:"sm",leftIcon:ke,textStyle:S.settingsStyles.sectionHeaderLinkText,style:S.settingsStyles.sectionHeaderLink,onPress:Ce,accessibilityLabel:Pe,children:Re}),o[36]=ke,o[37]=Pe,o[38]=Re,o[39]=Le):Le=o[39];const De=Le;if(!c)return null;let Ve,Oe,Ie,Qe,Be;o[40]!==l?(Ve=l("desktop.daemon.title"),o[40]=l,o[41]=Ve):Ve=o[41];o[42]!==ze||o[43]!==be||o[44]!==J||o[45]!==z.keepRunningAfterQuit||o[46]!==te||o[47]!==Z||o[48]!==X||o[49]!==Ae||o[50]!==ce||o[51]!==ue||o[52]!==je||o[53]!==ie||o[54]!==de||o[55]!==ne||o[56]!==E||o[57]!==he||o[58]!==T||o[59]!==oe||o[60]!==ae||o[61]!==l||o[62]!==d.colors.foregroundMuted?(Oe=E||T?(0,_.jsx)(e.View,{style:F,children:(0,_.jsx)(n.ActivityIndicator,{size:"small",color:d.colors.foregroundMuted})}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(I,{daemonStatusStateText:Z,daemonStatusDetailText:te,isDaemonManagementPaused:ne,copyIcon:be,fileTextIcon:Ae,activityIcon:ze,handleToggleDaemonManagement:ie,isUpdatingDaemonManagement:oe,keepRunningAfterQuit:z.keepRunningAfterQuit,handleToggleKeepRunningAfterQuit:de,isUpdatingKeepRunningAfterQuit:ae,daemonLogs:J,handleCopyLogPath:ce,handleOpenLogs:ue,handleRunCliStatus:je,isLoadingCliStatus:he}),X?(0,_.jsx)(e.View,{style:U.warningCard,children:(0,_.jsx)(t.Text,{style:U.warningText,children:l("desktop.daemon.versionMismatch")})}):null]}),o[42]=ze,o[43]=be,o[44]=J,o[45]=z.keepRunningAfterQuit,o[46]=te,o[47]=Z,o[48]=X,o[49]=Ae,o[50]=ce,o[51]=ue,o[52]=je,o[53]=ie,o[54]=de,o[55]=ne,o[56]=E,o[57]=he,o[58]=T,o[59]=oe,o[60]=ae,o[61]=l,o[62]=d.colors.foregroundMuted,o[63]=Oe):Oe=o[63];o[64]!==J||o[65]!==ge||o[66]!==re?(Ie=(0,_.jsx)(V,{visible:re,onClose:ge,daemonLogs:J}),o[64]=J,o[65]=ge,o[66]=re,o[67]=Ie):Ie=o[67];o[68]!==pe||o[69]!==fe||o[70]!==Se||o[71]!==me?(Qe=(0,_.jsx)(O,{visible:me,onClose:fe,cliStatusOutput:pe,onCopy:Se}),o[68]=pe,o[69]=fe,o[70]=Se,o[71]=me,o[72]=Qe):Qe=o[72];o[73]!==De||o[74]!==Ve||o[75]!==Oe||o[76]!==Ie||o[77]!==Qe?(Be=(0,_.jsxs)(y.SettingsSection,{title:Ve,trailing:De,testID:"host-page-daemon-lifecycle-card",children:[Oe,Ie,Qe]}),o[73]=De,o[74]=Ve,o[75]=Oe,o[76]=Ie,o[77]=Qe,o[78]=Be):Be=o[78];return Be};var e=r(_d[0]),t=r(_d[1]),n=r(_d[2]),s=r(_d[3]),o=r(_d[4]);r(_d[5]);var l,d=r(_d[6]),c=(l=d)&&l.__esModule?l:{default:l};r(_d[7]),r(_d[8]);var u=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[9])),p=r(_d[10]),h=r(_d[11]),S=r(_d[12]),y=r(_d[13]),f=r(_d[14]),x=r(_d[15]),j=r(_d[16]),C=r(_d[17]),T=r(_d[18]),k=r(_d[19]),w=r(_d[20]),b=r(_d[21]),v=r(_d[22]),A=r(_d[23]),M=r(_d[24]),z=r(_d[25]),_=r(_d[26]);function P(e){const t=(0,s.c)(6),{settings:n,updateSettings:l}=e,[d,c]=(0,o.useState)(!1);let u;t[0]!==n.keepRunningAfterQuit||t[1]!==l?(u=()=>{c(!0),l({keepRunningAfterQuit:!n.keepRunningAfterQuit}).catch(R).finally(()=>{c(!1)})},t[0]=n.keepRunningAfterQuit,t[1]=l,t[2]=u):u=t[2];const p=u;let h;return t[3]!==p||t[4]!==d?(h={isUpdatingKeepRunningAfterQuit:d,handleToggleKeepRunningAfterQuit:p},t[3]=p,t[4]=d,t[5]=h):h=t[5],h}function R(){}function L(){const{t:e}=(0,p.useTranslation)(),[t,n]=(0,o.useState)(null),[s,l]=(0,o.useState)(!1),[d,h]=(0,o.useState)(!1),S=(0,o.useCallback)(async()=>{h(!0);try{n(await(0,w.getCliDaemonStatus)()),l(!0)}catch(t){const s=t instanceof Error?t.message:String(t);n(e("desktop.daemon.fullStatus.fetchFailed",{message:s})),l(!0)}finally{h(!1)}},[e]),y=(0,o.useCallback)(()=>{t&&u.setStringAsync(t).then(()=>{c.default.alert(e("common.states.copied"),e("desktop.daemon.fullStatus.copied"))}).catch(e=>{console.error("[Settings] Failed to copy daemon status",e)})},[t,e]),f=(0,o.useCallback)(()=>l(!1),[]);return{cliStatusOutput:t,isCliStatusModalOpen:s,isLoadingCliStatus:d,handleCopyCliStatus:y,handleOpenCliStatus:S,handleCloseCliStatusModal:f}}function D(e){const t=(0,s.c)(10),{t:n}=(0,p.useTranslation)(),[l,d]=(0,o.useState)(!1);let h;t[0]!==e?.logPath||t[1]!==n?(h=()=>{const t=e?.logPath;t&&u.setStringAsync(t).then(()=>{c.default.alert(n("common.states.copied"),n("desktop.daemon.logs.copied"))}).catch(e=>{console.error("[Settings] Failed to copy log path",e),c.default.alert(n("common.errors.error"),n("desktop.daemon.logs.copyFailed"))})},t[0]=e?.logPath,t[1]=n,t[2]=h):h=t[2];const S=h;let y;t[3]!==e?(y=()=>{e&&d(!0)},t[3]=e,t[4]=y):y=t[4];const f=y;let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=()=>d(!1),t[5]=x):x=t[5];const j=x;let C;return t[6]!==S||t[7]!==f||t[8]!==l?(C={isLogsModalOpen:l,handleCopyLogPath:S,handleOpenLogs:f,handleCloseLogsModal:j},t[6]=S,t[7]=f,t[8]=l,t[9]=C):C=t[9],C}function V(n){const o=(0,s.c)(22),{visible:l,onClose:d,daemonLogs:c}=n,{t:u}=(0,p.useTranslation)();let h,y;o[0]!==u?(h=u("desktop.daemon.logs.modalTitle"),o[0]=u,o[1]=h):h=o[1],o[2]!==h?(y={title:h},o[2]=h,o[3]=y):y=o[3];const f=y;let j,C,T,k,w,b;return o[4]!==c?.logPath||o[5]!==u?(j=c?.logPath??u("desktop.daemon.logs.unavailable"),o[4]=c?.logPath,o[5]=u,o[6]=j):j=o[6],o[7]!==j?(C=(0,_.jsx)(t.Text,{style:S.settingsStyles.rowHint,children:j}),o[7]=j,o[8]=C):C=o[8],o[9]!==c||o[10]!==u?(T=c?.contents?.length?c.contents:u("desktop.daemon.logs.empty"),o[9]=c,o[10]=u,o[11]=T):T=o[11],o[12]!==T?(k=(0,_.jsx)(t.Text,{style:U.logOutput,selectable:!0,dataSet:z.CODE_SURFACE_DATASET,children:T}),o[12]=T,o[13]=k):k=o[13],o[14]!==C||o[15]!==k?(w=(0,_.jsxs)(e.View,{style:U.modalBody,children:[C,k]}),o[14]=C,o[15]=k,o[16]=w):w=o[16],o[17]!==f||o[18]!==d||o[19]!==w||o[20]!==l?(b=(0,_.jsx)(x.AdaptiveModalSheet,{visible:l,onClose:d,header:f,testID:"managed-daemon-logs-dialog",snapPoints:E,children:w}),o[17]=f,o[18]=d,o[19]=w,o[20]=l,o[21]=b):b=o[21],b}function O(n){const o=(0,s.c)(27),{visible:l,onClose:d,cliStatusOutput:c,onCopy:u}=n,{t:h}=(0,p.useTranslation)();let S,y;o[0]!==h?(S=h("desktop.daemon.fullStatus.modalTitle"),o[0]=h,o[1]=S):S=o[1],o[2]!==S?(y={title:S},o[2]=S,o[3]=y):y=o[3];const f=y,C=c??"";let T,k,w,b,v,A,M,P;return o[4]!==C?(T=(0,_.jsx)(t.Text,{style:U.logOutput,selectable:!0,dataSet:z.CODE_SURFACE_DATASET,children:C}),o[4]=C,o[5]=T):T=o[5],o[6]!==h?(k=h("common.actions.close"),o[6]=h,o[7]=k):k=o[7],o[8]!==d||o[9]!==k?(w=(0,_.jsx)(j.Button,{variant:"outline",size:"sm",onPress:d,children:k}),o[8]=d,o[9]=k,o[10]=w):w=o[10],o[11]!==h?(b=h("common.actions.copy"),o[11]=h,o[12]=b):b=o[12],o[13]!==u||o[14]!==b?(v=(0,_.jsx)(j.Button,{size:"sm",onPress:u,children:b}),o[13]=u,o[14]=b,o[15]=v):v=o[15],o[16]!==w||o[17]!==v?(A=(0,_.jsxs)(e.View,{style:U.modalActions,children:[w,v]}),o[16]=w,o[17]=v,o[18]=A):A=o[18],o[19]!==T||o[20]!==A?(M=(0,_.jsxs)(e.View,{style:U.modalBody,children:[T,A]}),o[19]=T,o[20]=A,o[21]=M):M=o[21],o[22]!==f||o[23]!==d||o[24]!==M||o[25]!==l?(P=(0,_.jsx)(x.AdaptiveModalSheet,{visible:l,onClose:d,header:f,testID:"daemon-cli-status-dialog",snapPoints:K,children:M}),o[22]=f,o[23]=d,o[24]=M,o[25]=l,o[26]=P):P=o[26],P}function I(n){const o=(0,s.c)(121),{t:l}=(0,p.useTranslation)(),{daemonStatusStateText:d,daemonStatusDetailText:c,isDaemonManagementPaused:u,copyIcon:h,fileTextIcon:y,activityIcon:f,handleToggleDaemonManagement:x,isUpdatingDaemonManagement:T,keepRunningAfterQuit:k,handleToggleKeepRunningAfterQuit:w,isUpdatingKeepRunningAfterQuit:b,daemonLogs:v,handleCopyLogPath:A,handleOpenLogs:M,handleRunCliStatus:z,isLoadingCliStatus:P}=n;let R,L,D,V,O,I,Q,B,F,E,K,G,W,q;o[0]!==l?(R=l("desktop.daemon.status.title"),o[0]=l,o[1]=R):R=o[1],o[2]!==R?(L=(0,_.jsx)(t.Text,{style:S.settingsStyles.rowTitle,children:R}),o[2]=R,o[3]=L):L=o[3],o[4]!==l?(D=l("desktop.daemon.status.builtInOnly"),o[4]=l,o[5]=D):D=o[5],o[6]!==D?(V=(0,_.jsx)(t.Text,{style:S.settingsStyles.rowHint,children:D}),o[6]=D,o[7]=V):V=o[7],o[8]!==L||o[9]!==V?(O=(0,_.jsxs)(e.View,{style:S.settingsStyles.rowContent,children:[L,V]}),o[8]=L,o[9]=V,o[10]=O):O=o[10],o[11]!==d?(I=(0,_.jsx)(t.Text,{style:U.valueText,children:d}),o[11]=d,o[12]=I):I=o[12],o[13]!==c?(Q=(0,_.jsx)(t.Text,{style:U.valueSubtext,children:c}),o[13]=c,o[14]=Q):Q=o[14],o[15]!==I||o[16]!==Q?(B=(0,_.jsxs)(e.View,{style:U.statusValueGroup,children:[I,Q]}),o[15]=I,o[16]=Q,o[17]=B):B=o[17],o[18]!==O||o[19]!==B?(F=(0,_.jsxs)(e.View,{style:S.settingsStyles.row,children:[O,B]}),o[18]=O,o[19]=B,o[20]=F):F=o[20],o[21]!==l?(E=l("desktop.daemon.management.title"),o[21]=l,o[22]=E):E=o[22],o[23]!==E?(K=(0,_.jsx)(t.Text,{style:S.settingsStyles.rowTitle,children:E}),o[23]=E,o[24]=K):K=o[24],o[25]!==l?(G=l("desktop.daemon.management.hint"),o[25]=l,o[26]=G):G=o[26],o[27]!==G?(W=(0,_.jsx)(t.Text,{style:S.settingsStyles.rowHint,children:G}),o[27]=G,o[28]=W):W=o[28],o[29]!==K||o[30]!==W?(q=(0,_.jsxs)(e.View,{style:S.settingsStyles.rowContent,children:[K,W]}),o[29]=K,o[30]=W,o[31]=q):q=o[31];const J=!u;let N,X,Y,Z,$,ee,te,ne,se,oe,ie,le,ae,de,re,ce,ue;o[32]!==l?(N=l("desktop.daemon.management.title"),o[32]=l,o[33]=N):N=o[33],o[34]!==x||o[35]!==T||o[36]!==J||o[37]!==N?(X=(0,_.jsx)(C.Switch,{value:J,onValueChange:x,disabled:T,accessibilityLabel:N}),o[34]=x,o[35]=T,o[36]=J,o[37]=N,o[38]=X):X=o[38],o[39]!==q||o[40]!==X?(Y=(0,_.jsxs)(e.View,{style:H,children:[q,X]}),o[39]=q,o[40]=X,o[41]=Y):Y=o[41],o[42]!==l?(Z=l("desktop.daemon.keepRunning.title"),o[42]=l,o[43]=Z):Z=o[43],o[44]!==Z?($=(0,_.jsx)(t.Text,{style:S.settingsStyles.rowTitle,children:Z}),o[44]=Z,o[45]=$):$=o[45],o[46]!==l?(ee=l("desktop.daemon.keepRunning.hint"),o[46]=l,o[47]=ee):ee=o[47],o[48]!==ee?(te=(0,_.jsx)(t.Text,{style:S.settingsStyles.rowHint,children:ee}),o[48]=ee,o[49]=te):te=o[49],o[50]!==$||o[51]!==te?(ne=(0,_.jsxs)(e.View,{style:S.settingsStyles.rowContent,children:[$,te]}),o[50]=$,o[51]=te,o[52]=ne):ne=o[52],o[53]!==l?(se=l("desktop.daemon.keepRunning.title"),o[53]=l,o[54]=se):se=o[54],o[55]!==w||o[56]!==b||o[57]!==k||o[58]!==se?(oe=(0,_.jsx)(C.Switch,{value:k,onValueChange:w,disabled:b,accessibilityLabel:se}),o[55]=w,o[56]=b,o[57]=k,o[58]=se,o[59]=oe):oe=o[59],o[60]!==ne||o[61]!==oe?(ie=(0,_.jsxs)(e.View,{style:H,children:[ne,oe]}),o[60]=ne,o[61]=oe,o[62]=ie):ie=o[62],o[63]!==l?(le=l("desktop.daemon.logs.title"),o[63]=l,o[64]=le):le=o[64],o[65]!==le?(ae=(0,_.jsx)(t.Text,{style:S.settingsStyles.rowTitle,children:le}),o[65]=le,o[66]=ae):ae=o[66],o[67]!==v?.logPath||o[68]!==l?(de=v?.logPath??l("desktop.daemon.logs.unavailable"),o[67]=v?.logPath,o[68]=l,o[69]=de):de=o[69],o[70]!==de?(re=(0,_.jsx)(t.Text,{style:S.settingsStyles.rowHint,children:de}),o[70]=de,o[71]=re):re=o[71],o[72]!==ae||o[73]!==re?(ce=(0,_.jsxs)(e.View,{style:S.settingsStyles.rowContent,children:[ae,re]}),o[72]=ae,o[73]=re,o[74]=ce):ce=o[74],o[75]!==h||o[76]!==v?.logPath||o[77]!==A||o[78]!==l?(ue=v?.logPath?(0,_.jsx)(j.Button,{variant:"outline",size:"sm",leftIcon:h,onPress:A,children:l("desktop.daemon.logs.copyPath")}):null,o[75]=h,o[76]=v?.logPath,o[77]=A,o[78]=l,o[79]=ue):ue=o[79];const ge=!v;let pe,me,he,Se,ye,fe,xe,je,Ce,Te,ke,we,be;return o[80]!==l?(pe=l("desktop.daemon.logs.open"),o[80]=l,o[81]=pe):pe=o[81],o[82]!==y||o[83]!==M||o[84]!==ge||o[85]!==pe?(me=(0,_.jsx)(j.Button,{variant:"outline",size:"sm",leftIcon:y,onPress:M,disabled:ge,children:pe}),o[82]=y,o[83]=M,o[84]=ge,o[85]=pe,o[86]=me):me=o[86],o[87]!==ue||o[88]!==me?(he=(0,_.jsxs)(e.View,{style:U.actionGroup,children:[ue,me]}),o[87]=ue,o[88]=me,o[89]=he):he=o[89],o[90]!==ce||o[91]!==he?(Se=(0,_.jsxs)(e.View,{style:H,children:[ce,he]}),o[90]=ce,o[91]=he,o[92]=Se):Se=o[92],o[93]!==l?(ye=l("desktop.daemon.fullStatus.title"),o[93]=l,o[94]=ye):ye=o[94],o[95]!==ye?(fe=(0,_.jsx)(t.Text,{style:S.settingsStyles.rowTitle,children:ye}),o[95]=ye,o[96]=fe):fe=o[96],o[97]!==l?(xe=l("desktop.daemon.fullStatus.hint"),o[97]=l,o[98]=xe):xe=o[98],o[99]!==xe?(je=(0,_.jsx)(t.Text,{style:S.settingsStyles.rowHint,children:xe}),o[99]=xe,o[100]=je):je=o[100],o[101]!==fe||o[102]!==je?(Ce=(0,_.jsxs)(e.View,{style:S.settingsStyles.rowContent,children:[fe,je]}),o[101]=fe,o[102]=je,o[103]=Ce):Ce=o[103],o[104]!==P||o[105]!==l?(Te=l(P?"common.states.loading":"desktop.daemon.fullStatus.view"),o[104]=P,o[105]=l,o[106]=Te):Te=o[106],o[107]!==f||o[108]!==z||o[109]!==P||o[110]!==Te?(ke=(0,_.jsx)(j.Button,{variant:"outline",size:"sm",leftIcon:f,onPress:z,disabled:P,children:Te}),o[107]=f,o[108]=z,o[109]=P,o[110]=Te,o[111]=ke):ke=o[111],o[112]!==Ce||o[113]!==ke?(we=(0,_.jsxs)(e.View,{style:H,children:[Ce,ke]}),o[112]=Ce,o[113]=ke,o[114]=we):we=o[114],o[115]!==Y||o[116]!==ie||o[117]!==Se||o[118]!==we||o[119]!==F?(be=(0,_.jsxs)(e.View,{style:S.settingsStyles.card,children:[F,Y,ie,Se,we]}),o[115]=Y,o[116]=ie,o[117]=Se,o[118]=we,o[119]=F,o[120]=be):be=o[120],be}function Q(){(0,T.openExternalUrl)(B)}const B="https://paseo.sh/docs/configuration",U=h.StyleSheet.create(e=>({actionGroup:{flexDirection:"row",gap:e.spacing[2],flexWrap:"wrap",justifyContent:"flex-end",uni__dependencies:[0]},loadingCard:{alignItems:"center",justifyContent:"center",paddingVertical:e.spacing[6],uni__dependencies:[0]},statusValueGroup:{alignItems:"flex-end",gap:2},valueText:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,uni__dependencies:[0]},valueSubtext:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,uni__dependencies:[0]},warningCard:{marginTop:e.spacing[3],borderRadius:e.borderRadius.lg,borderWidth:1,borderColor:e.colors.palette.amber[500],backgroundColor:"rgba(245, 158, 11, 0.12)",paddingVertical:e.spacing[2],paddingHorizontal:e.spacing[3],uni__dependencies:[0]},warningText:{color:e.colors.palette.amber[500],fontSize:e.fontSize.xs,uni__dependencies:[0]},modalBody:{gap:e.spacing[3],paddingBottom:e.spacing[2],uni__dependencies:[0]},logOutput:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",lineHeight:18,uni__dependencies:[0]},modalActions:{flexDirection:"row",justifyContent:"flex-end",gap:e.spacing[2],uni__dependencies:[0]}})),F=[S.settingsStyles.card,U.loadingCard],H=[S.settingsStyles.row,S.settingsStyles.rowBorder],E=["70%","92%"],K=["60%","85%"]},4741,[348,711,3519,349,36,1401,1389,234,146,3628,1573,56,3907,4726,1600,3466,3627,4730,3562,4140,3403,4742,4745,3576,3401,3802,279]);
|
|
16501
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useBuiltInDaemonManagement=function(f){const{t:k}=(0,o.useTranslation)(),{daemonStatus:w,settings:b,updateSettings:E,setStatus:M,refreshStatus:h}=f,I=(0,l.useDesktopIpcErrorReporter)(),{mutate:_,isPending:v}=(0,n.useMutation)({mutationFn:async()=>{const t=b.manageBuiltInDaemon;try{const n=await(0,u.executeDaemonManagementToggle)(t,w,{confirm:()=>(0,S.confirmDialog)({title:k("desktop.daemon.management.pauseTitle"),message:k("desktop.daemon.management.pauseMessage"),confirmLabel:k("desktop.daemon.management.pauseAndStop"),cancelLabel:k("common.actions.cancel"),destructive:!0}),persistSettings:t=>E(t),startDaemon:s.startDesktopDaemon,stopDaemon:()=>(0,s.stopDesktopDaemon)("settings")});if("enabled"===n.kind){const t=await(0,D.upsertDesktopDaemonConnection)((0,p.getHostRuntimeStore)(),n.newStatus);if(!t.ok)throw new c.DaemonConnectionRegistrationError(t.error)}return n}catch(n){throw new c.DaemonManagementOperationError(n instanceof Error?n:new Error(String(n)),t)}},onError:t=>{const n=(0,c.getDaemonManagementErrorPresentation)(t,b.manageBuiltInDaemon);n.refreshStatus&&h(),I({error:t,message:n.message,logLabel:"[Settings] Failed to update built-in daemon management"})},onSuccess:t=>{"cancelled"!==t.kind&&(t.newStatus&&M(t.newStatus),h())}}),y=(0,t.useCallback)(()=>{v||_()},[v,_]);return{isUpdating:v,toggle:y}};var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),u=r(d[4]),c=r(d[5]),l=r(d[6]),p=r(d[7]),D=r(d[8]),S=r(d[9])},4742,[36,916,1573,3403,4743,4744,3577,3271,4164,3678]);
|
|
16502
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16503
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),
|
|
16504
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),
|
|
16505
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.HostConnectionsPage=function(e){const s=(0,o.c)(12),{serverId:n}=e,{t:l}=(0,u.useTranslation)(),c=ce(n),h=(0,z.useIsLocalDaemon)(n);if(!c){let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Z.jsx)(de,{}),s[0]=e):e=s[0],e}let f,p,y,x;s[1]!==n?(f=(0,Z.jsx)(ue,{serverId:n}),s[1]=n,s[2]=f):f=s[2];s[3]!==c?(p=(0,Z.jsx)(he,{host:c}),s[3]=c,s[4]=p):p=s[4];s[5]!==h||s[6]!==l?(y=h?(0,Z.jsx)(k.SettingsSection,{title:l("settings.host.pairDevices.title"),children:(0,Z.jsx)(Pe,{})}):null,s[5]=h,s[6]=l,s[7]=y):y=s[7];s[8]!==f||s[9]!==p||s[10]!==y?(x=(0,Z.jsxs)(t.View,{children:[f,p,y]}),s[8]=f,s[9]=p,s[10]=y,s[11]=x):x=s[11];return x},_e.HostAgentsPage=function(e){const n=(0,o.c)(5),{serverId:l}=e,{t:c}=(0,u.useTranslation)(),h=ce(l),f=(0,M.useHostRuntimeIsConnected)(l);if(!h){let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Z.jsx)(de,{}),n[0]=e):e=n[0],e}let p;n[1]!==f||n[2]!==l||n[3]!==c?(p=(0,Z.jsx)(t.View,{children:f?(0,Z.jsxs)(k.SettingsSection,{title:c("settings.hostSections.agents"),children:[(0,Z.jsx)(ve,{serverId:l}),(0,Z.jsx)(q.BrowserToolsOptInCard,{serverId:l}),(0,Z.jsx)(Ie,{serverId:l})]}):(0,Z.jsx)(t.View,{style:Le,children:(0,Z.jsx)(s.Text,{style:Re.emptyText,children:c("settings.host.agents.unavailable")})})}),n[1]=f,n[2]=l,n[3]=c,n[4]=p):p=n[4];return p},_e.HostWorkspacesPage=function(e){const n=(0,o.c)(5),{serverId:l}=e,{t:c}=(0,u.useTranslation)(),h=ce(l),f=(0,M.useHostRuntimeIsConnected)(l);if(!h){let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Z.jsx)(de,{}),n[0]=e):e=n[0],e}let p;n[1]!==f||n[2]!==l||n[3]!==c?(p=(0,Z.jsx)(t.View,{children:f?(0,Z.jsx)(k.SettingsSection,{title:c("settings.hostSections.workspaces"),children:(0,Z.jsx)(Se,{serverId:l})}):(0,Z.jsx)(t.View,{style:Le,children:(0,Z.jsx)(s.Text,{style:Re.emptyText,children:c("settings.host.workspaces.unavailable")})})}),n[1]=f,n[2]=l,n[3]=c,n[4]=p):p=n[4];return p},_e.HostProvidersPage=function(e){const s=(0,o.c)(3),{serverId:n}=e;if(!ce(n)){let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Z.jsx)(de,{}),s[0]=e):e=s[0],e}let l;s[1]!==n?(l=(0,Z.jsx)(t.View,{children:(0,Z.jsx)(H.ProvidersSection,{serverId:n})}),s[1]=n,s[2]=l):l=s[2];return l},_e.HostUsagePage=function(e){const s=(0,o.c)(6),{serverId:n}=e,l=ce(n),{view:c,refresh:u}=(0,R.useProviderUsage)(n);let h;s[0]!==u?(h=()=>{u()},s[0]=u,s[1]=h):h=s[1];const f=h;if(!l){let e;return s[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Z.jsx)(de,{}),s[2]=e):e=s[2],e}let p;s[3]!==f||s[4]!==c?(p=(0,Z.jsx)(t.View,{children:(0,Z.jsx)(V.ProviderUsageSettingsSection,{view:c,onRefresh:f})}),s[3]=f,s[4]=c,s[5]=p):p=s[5];return p},_e.HostSettingsPage=function(e){const n=(0,o.c)(25),{serverId:l,onHostRemoved:c}=e,u=ce(l),h=(0,z.useIsLocalDaemon)(l);if(!u){let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Z.jsx)(de,{}),n[0]=e):e=n[0],e}let f,p,y,x,v,S,b,w;n[1]!==u.label?(f=(0,Z.jsx)(s.Text,{style:Re.daemonHeaderLabel,numberOfLines:1,children:u.label}),n[1]=u.label,n[2]=f):f=n[2];n[3]!==u?(p=(0,Z.jsx)(ge,{host:u}),n[3]=u,n[4]=p):p=n[4];n[5]!==f||n[6]!==p?(y=(0,Z.jsxs)(t.View,{style:Re.daemonHeader,children:[f,p]}),n[5]=f,n[6]=p,n[7]=y):y=n[7];n[8]!==l?(x=(0,Z.jsx)(me,{serverId:l}),n[8]=l,n[9]=x):x=n[9];n[10]!==h?(v=h?(0,Z.jsx)(T.LocalDaemonSection,{}):null,n[10]=h,n[11]=v):v=n[11];n[12]!==u||n[13]!==h?(S=h?null:(0,Z.jsx)(xe,{host:u}),n[12]=u,n[13]=h,n[14]=S):S=n[14];n[15]!==u||n[16]!==h||n[17]!==c?(b=(0,Z.jsx)(Ce,{host:u,isLocalDaemon:h,onRemoved:c}),n[15]=u,n[16]=h,n[17]=c,n[18]=b):b=n[18];n[19]!==y||n[20]!==x||n[21]!==v||n[22]!==S||n[23]!==b?(w=(0,Z.jsxs)(t.View,{children:[y,x,v,S,b]}),n[19]=y,n[20]=x,n[21]=v,n[22]=S,n[23]=b,n[24]=w):w=n[24];return w},_e.HostRenameButton=ge,_e.HostTerminalsPage=function(e){const s=(0,o.c)(3),{serverId:n}=e;if(!ce(n)){let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Z.jsx)(de,{}),s[0]=e):e=s[0],e}let l;s[1]!==n?(l=(0,Z.jsxs)(t.View,{children:[(0,Z.jsx)(k.SettingsSection,{title:"Terminal agents",children:(0,Z.jsx)(we,{serverId:n})}),(0,Z.jsx)(He,{serverId:n})]}),s[1]=n,s[2]=l):l=s[2];return l};var e,t=r(d[0]),s=r(d[1]),n=r(d[2]),o=r(d[3]),l=r(d[4]),c=r(d[5]),u=r(d[6]),h=r(d[7]),f=(e=h)&&e.__esModule?e:{default:e};r(d[8]),r(d[9]),r(d[10]);var p=r(d[11]),y=r(d[12]),x=r(d[13]),v=r(d[14]),S=r(d[15]),b=r(d[16]),w=r(d[17]),j=r(d[18]),I=r(d[19]),T=r(d[20]),_=r(d[21]),P=r(d[22]),C=r(d[23]),D=r(d[24]),z=r(d[25]),M=r(d[26]),H=r(d[27]),V=r(d[28]),R=r(d[29]),k=r(d[30]),L=r(d[31]),B=r(d[32]),A=r(d[33]),E=r(d[34]),U=r(d[35]),F=r(d[36]),$=r(d[37]),O=r(d[38]),W=r(d[39]),q=r(d[40]),Z=r(d[41]);const N=(0,p.withUnistyles)(l.ArrowUp),G=(0,p.withUnistyles)(l.ArrowDown),K=(0,p.withUnistyles)(l.Pencil),J=(0,p.withUnistyles)(l.Trash2),Q=(0,p.withUnistyles)(l.SquareTerminal),X=(0,p.withUnistyles)(l.Plus);const Y=(0,p.withUnistyles)(function(e){const t=(0,o.c)(6),{iconKey:s,size:n,color:l}=e,c=void 0===l?"":l;let u;t[0]!==s?(u=(0,W.getProviderIcon)(s),t[0]=s,t[1]=u):u=t[1];const h=u;let f;return t[2]!==h||t[3]!==c||t[4]!==n?(f=(0,Z.jsx)(h,{size:n,color:c}),t[2]=h,t[3]=c,t[4]=n,t[5]=f):f=t[5],f}),ee=e=>({color:e.colors.foregroundMuted}),te=(0,Z.jsx)(N,{size:O.ICON_SIZE.sm,uniProps:ee}),se=(0,Z.jsx)(G,{size:O.ICON_SIZE.sm,uniProps:ee}),ne=(0,Z.jsx)(K,{size:O.ICON_SIZE.sm,uniProps:ee}),oe=(0,Z.jsx)(J,{size:O.ICON_SIZE.sm,uniProps:e=>({color:e.colors.destructive})}),ie=(0,Z.jsx)(X,{size:O.ICON_SIZE.sm,uniProps:ee});function re(e,t){return"relay"===e.type?`${t("settings.host.badges.relay")} (${e.relayEndpoint})`:"directSocket"===e.type||"directPipe"===e.type?`${t("settings.host.badges.local")} (${e.path})`:`TCP (${e.endpoint})`}function le(e,t,s){return e?"relay"===e.type?{icon:(0,Z.jsx)(l.Globe,{size:t.iconSize.sm,color:t.colors.foregroundMuted}),text:s("settings.host.badges.relay")}:"directSocket"===e.type||"directPipe"===e.type?{icon:(0,Z.jsx)(l.Monitor,{size:t.iconSize.sm,color:t.colors.foregroundMuted}),text:s("settings.host.badges.local")}:{icon:(0,Z.jsx)(l.Monitor,{size:t.iconSize.sm,color:t.colors.foregroundMuted}),text:e.display}:null}function ae(e){const t=e?.trim();return t?t.startsWith("v")?t:`v${t}`:null}function ce(e){const t=(0,o.c)(3),s=(0,M.useHosts)();let n;return t[0]!==s||t[1]!==e?(n=s.find(t=>t.serverId===e)??null,t[0]=s,t[1]=e,t[2]=n):n=t[2],n}function de(){const e=(0,o.c)(4),{t:n}=(0,u.useTranslation)();let l,c;return e[0]!==n?(l=n("settings.host.notFound"),e[0]=n,e[1]=l):l=e[1],e[2]!==l?(c=(0,Z.jsx)(t.View,{children:(0,Z.jsx)(t.View,{style:Le,children:(0,Z.jsx)(s.Text,{style:Re.emptyText,children:l})})}),e[2]=l,e[3]=c):c=e[3],c}function me(e){const n=(0,o.c)(42),{serverId:l}=e,{t:c}=(0,u.useTranslation)(),{theme:h}=(0,p.useUnistyles)(),f=(0,M.useHostRuntimeSnapshot)(l);let y;n[0]!==l?(y=e=>e.sessions[l]?.serverInfo?.version??null,n[0]=l,n[1]=y):y=n[1];const x=(0,L.useSessionStore)(y),v=f?.connectionStatus??"connecting",S=f?.activeConnection??null;let b;n[2]!==v?(b=(0,F.formatConnectionStatus)(v),n[2]=v,n[3]=b):b=n[3];const w=b;let j;n[4]!==v?(j=(0,F.getConnectionStatusTone)(v),n[4]=v,n[5]=j):j=n[5];const I=j;let T,_,P;n[6]!==I||n[7]!==h.colors.destructive||n[8]!==h.colors.foregroundMuted||n[9]!==h.colors.palette?(T="success"===I?h.colors.palette.green[400]:"warning"===I?h.colors.palette.amber[500]:"error"===I?h.colors.destructive:h.colors.foregroundMuted,n[6]=I,n[7]=h.colors.destructive,n[8]=h.colors.foregroundMuted,n[9]=h.colors.palette,n[10]=T):T=n[10],n[11]!==I?(_="success"===I?"rgba(74, 222, 128, 0.1)":"warning"===I?"rgba(245, 158, 11, 0.1)":"error"===I?"rgba(248, 113, 113, 0.1)":"rgba(161, 161, 170, 0.1)",n[11]=I,n[12]=_):_=n[12],n[13]!==S||n[14]!==c||n[15]!==h?(P=le(S,h,c),n[13]=S,n[14]=c,n[15]=h,n[16]=P):P=n[16];const C=P;let D;n[17]!==x?(D=ae(x),n[17]=x,n[18]=D):D=n[18];const z=D;let H;n[19]!==_?(H=[Re.statusPill,{backgroundColor:_}],n[19]=_,n[20]=H):H=n[20];const V=H;let R;n[21]!==T?(R=[Re.statusDot,{backgroundColor:T}],n[21]=T,n[22]=R):R=n[22];const k=R;let B;n[23]!==T?(B=[Re.statusText,{color:T}],n[23]=T,n[24]=B):B=n[24];const A=B;let E,U,$,O,W,q;return n[25]!==k?(E=(0,Z.jsx)(t.View,{style:k}),n[25]=k,n[26]=E):E=n[26],n[27]!==w||n[28]!==A?(U=(0,Z.jsx)(s.Text,{style:A,children:w}),n[27]=w,n[28]=A,n[29]=U):U=n[29],n[30]!==V||n[31]!==U||n[32]!==E?($=(0,Z.jsxs)(t.View,{style:V,children:[E,U]}),n[30]=V,n[31]=U,n[32]=E,n[33]=$):$=n[33],n[34]!==C?(O=C?(0,Z.jsxs)(t.View,{style:Re.badgePill,children:[C.icon,(0,Z.jsx)(s.Text,{style:Re.badgeText,numberOfLines:1,children:C.text})]}):null,n[34]=C,n[35]=O):O=n[35],n[36]!==z?(W=z?(0,Z.jsx)(t.View,{style:Re.badgePill,children:(0,Z.jsx)(s.Text,{style:Re.badgeText,numberOfLines:1,children:z})}):null,n[36]=z,n[37]=W):W=n[37],n[38]!==$||n[39]!==O||n[40]!==W?(q=(0,Z.jsxs)(t.View,{style:Re.identityBadges,testID:"host-page-identity",children:[$,O,W]}),n[38]=$,n[39]=O,n[40]=W,n[41]=q):q=n[41],q}function ue(e){const t=(0,o.c)(4),{serverId:n}=e,l=(0,M.useHostRuntimeSnapshot)(n),c=l?.lastError??null;let u;t[0]!==c?(u="string"==typeof c&&c.trim().length>0?c.trim():null,t[0]=c,t[1]=u):u=t[1];const h=u;if(!h)return null;let f;return t[2]!==h?(f=(0,Z.jsx)(s.Text,{style:Re.errorText,children:h}),t[2]=h,t[3]=f):f=t[3],f}function ge(e){const t=(0,o.c)(30),{host:s}=e,{t:h}=(0,u.useTranslation)(),{theme:f}=(0,p.useUnistyles)(),{renameHost:y}=(0,M.useHostMutations)(),[x,S]=(0,c.useState)(!1);let b;t[0]!==s.label||t[1]!==s.serverId||t[2]!==y?(b=async e=>{const t=e.trim();t!==s.label.trim()&&await y(s.serverId,t)},t[0]=s.label,t[1]=s.serverId,t[2]=y,t[3]=b):b=t[3];const w=b;let j;t[4]===Symbol.for("react.memo_cache_sentinel")?(j=()=>S(!0),t[4]=j):j=t[4];const I=j;let T;t[5]===Symbol.for("react.memo_cache_sentinel")?(T=()=>S(!1),t[5]=T):T=t[5];const _=T;let P,C,D,z;t[6]!==h?(P=h("settings.host.daemon.rename.editLabel"),t[6]=h,t[7]=P):P=t[7],t[8]!==f.colors.foregroundMuted||t[9]!==f.iconSize.sm?(C=(0,Z.jsx)(l.Pencil,{size:f.iconSize.sm,color:f.colors.foregroundMuted}),t[8]=f.colors.foregroundMuted,t[9]=f.iconSize.sm,t[10]=C):C=t[10],t[11]!==P||t[12]!==C?(D=(0,Z.jsx)(n.Pressable,{onPress:I,hitSlop:8,style:Re.identityEditButton,accessibilityRole:"button",accessibilityLabel:P,testID:"host-page-label-edit-button",children:C}),t[11]=P,t[12]=C,t[13]=D):D=t[13],t[14]!==h?(z=h("settings.host.daemon.rename.title"),t[14]=h,t[15]=z):z=t[15];const H=s.label;let V,R,k,L;return t[16]!==h?(V=h("settings.host.daemon.rename.placeholder"),t[16]=h,t[17]=V):V=t[17],t[18]!==h?(R=h("settings.host.daemon.rename.submit"),t[18]=h,t[19]=R):R=t[19],t[20]!==w||t[21]!==s.label||t[22]!==x||t[23]!==R||t[24]!==z||t[25]!==V?(k=(0,Z.jsx)(v.AdaptiveRenameModal,{visible:x,title:z,initialValue:H,placeholder:V,submitLabel:R,onClose:_,onSubmit:w,testID:"host-page-rename-modal"}),t[20]=w,t[21]=s.label,t[22]=x,t[23]=R,t[24]=z,t[25]=V,t[26]=k):k=t[26],t[27]!==k||t[28]!==D?(L=(0,Z.jsxs)(Z.Fragment,{children:[D,k]}),t[27]=k,t[28]=D,t[29]=L):L=t[29],L}function he(e){const n=(0,o.c)(38),{host:l}=e,{t:h}=(0,u.useTranslation)(),{removeConnection:p}=(0,M.useHostMutations)(),y=(0,M.useHostRuntimeSnapshot)(l.serverId);let v;n[0]!==y?.probeByConnectionId?(v=y?.probeByConnectionId??new Map,n[0]=y?.probeByConnectionId,n[1]=v):v=n[1];const S=v,[w,j]=(0,c.useState)(null),[I,T]=(0,c.useState)(!1);let _,P;n[2]!==h?(_=h("settings.host.connections.removeTitle"),n[2]=h,n[3]=_):_=n[3],n[4]!==_?(P={title:_},n[4]=_,n[5]=P):P=n[5];const C=P;let D;n[6]!==h?(D=e=>{j({connectionId:e.id,title:re(e,h)})},n[6]=h,n[7]=D):D=n[7];const z=D;let H;n[8]!==I?(H=()=>{I||j(null)},n[8]=I,n[9]=H):H=n[9];const V=H;let R;n[10]===Symbol.for("react.memo_cache_sentinel")?(R=()=>{j(null)},n[10]=R):R=n[10];const L=R;let A;n[11]!==l.serverId||n[12]!==w||n[13]!==p||n[14]!==h?(A=()=>{if(!w)return;const{connectionId:e}=w;T(!0),p(l.serverId,e).then(()=>j(null)).catch(e=>{console.error("[HostPage] Failed to remove connection",e),f.default.alert(h("settings.host.connections.removeErrorTitle"),h("settings.host.connections.removeErrorMessage"))}).finally(()=>T(!1))},n[11]=l.serverId,n[12]=w,n[13]=p,n[14]=h,n[15]=A):A=n[15];const E=A;let U,F,$,O,W;if(n[16]!==h?(U=h("settings.host.connections.title"),n[16]=h,n[17]=U):U=n[17],n[18]!==z||n[19]!==l.connections||n[20]!==S){let e;n[22]!==z||n[23]!==S?(e=(e,t)=>{const s=S.get(e.id);return(0,Z.jsx)(fe,{connection:e,showBorder:t>0,latencyMs:"available"===s?.status?s.latencyMs:void 0,latencyLoading:!s||"pending"===s.status,latencyError:"unavailable"===s?.status,onRemove:z},e.id)},n[22]=z,n[23]=S,n[24]=e):e=n[24],F=l.connections.map(e),n[18]=z,n[19]=l.connections,n[20]=S,n[21]=F}else F=n[21];return n[25]!==F?($=(0,Z.jsx)(t.View,{style:B.settingsStyles.card,testID:"host-page-connections-card",children:F}),n[25]=F,n[26]=$):$=n[26],n[27]!==V||n[28]!==E||n[29]!==I||n[30]!==w||n[31]!==C||n[32]!==h?(O=w?(0,Z.jsxs)(x.AdaptiveModalSheet,{header:C,visible:!0,onClose:V,testID:"remove-connection-confirm-modal",children:[(0,Z.jsx)(s.Text,{style:Re.confirmText,children:h("settings.host.connections.removeMessage",{name:w.title})}),(0,Z.jsxs)(t.View,{style:Re.confirmActions,children:[(0,Z.jsx)(b.Button,{variant:"secondary",size:"sm",style:ke,onPress:L,disabled:I,children:h("common.actions.cancel")}),(0,Z.jsx)(b.Button,{variant:"destructive",size:"sm",style:ke,onPress:E,disabled:I,testID:"remove-connection-confirm",children:h("settings.host.connections.removeAction")})]})]}):null,n[27]=V,n[28]=E,n[29]=I,n[30]=w,n[31]=C,n[32]=h,n[33]=O):O=n[33],n[34]!==$||n[35]!==O||n[36]!==U?(W=(0,Z.jsxs)(k.SettingsSection,{title:U,children:[$,O]}),n[34]=$,n[35]=O,n[36]=U,n[37]=W):W=n[37],W}function fe(e){const n=(0,o.c)(32),{connection:l,showBorder:c,latencyMs:h,latencyLoading:f,latencyError:y,onRemove:x}=e,{t:v}=(0,u.useTranslation)(),{theme:S}=(0,p.useUnistyles)();let w;n[0]!==l||n[1]!==v?(w=re(l,v),n[0]=l,n[1]=v,n[2]=w):w=n[2];const j=w;let I;e:if(f)I="...";else{if(y){let e;n[3]!==v?(e=v("settings.host.connections.timeout"),n[3]=v,n[4]=e):e=n[4],I=e;break e}if(null!=h){let e;n[5]!==h?(e=(0,$.formatLatency)(h),n[5]=h,n[6]=e):e=n[6],I=e;break e}I="\u2014"}const T=I,_=y?S.colors.palette.red[300]:S.colors.foregroundMuted;let P;n[7]!==l||n[8]!==x?(P=()=>{x(l)},n[7]=l,n[8]=x,n[9]=P):P=n[9];const C=P,D=c&&B.settingsStyles.rowBorder;let z;n[10]!==D?(z=[B.settingsStyles.row,D],n[10]=D,n[11]=z):z=n[11];const M=z;let H;n[12]!==_?(H=[Re.connectionLatency,{color:_}],n[12]=_,n[13]=H):H=n[13];const V=H;let R;n[14]!==S.colors.destructive?(R={color:S.colors.destructive},n[14]=S.colors.destructive,n[15]=R):R=n[15];const k=R;let L,A,E,U,F;return n[16]!==j?(L=(0,Z.jsx)(t.View,{style:B.settingsStyles.rowContent,children:(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowTitle,numberOfLines:1,children:j})}),n[16]=j,n[17]=L):L=n[17],n[18]!==T||n[19]!==V?(A=(0,Z.jsx)(s.Text,{style:V,children:T}),n[18]=T,n[19]=V,n[20]=A):A=n[20],n[21]!==v?(E=v("settings.host.connections.removeAction"),n[21]=v,n[22]=E):E=n[22],n[23]!==k||n[24]!==C||n[25]!==E?(U=(0,Z.jsx)(b.Button,{variant:"ghost",size:"sm",textStyle:k,onPress:C,children:E}),n[23]=k,n[24]=C,n[25]=E,n[26]=U):U=n[26],n[27]!==M||n[28]!==U||n[29]!==L||n[30]!==A?(F=(0,Z.jsxs)(t.View,{style:M,children:[L,A,U]}),n[27]=M,n[28]=U,n[29]=L,n[30]=A,n[31]=F):F=n[31],F}const pe=e=>new Promise(t=>{setTimeout(t,e)});function ye(e){const n=(0,o.c)(42),{host:h}=e,{t:y}=(0,u.useTranslation)(),{theme:x}=(0,p.useUnistyles)(),v=(0,M.useHostRuntimeClient)(h.serverId),S=(0,M.useHostRuntimeIsConnected)(h.serverId);let w;n[0]===Symbol.for("react.memo_cache_sentinel")?(w=(0,M.getHostRuntimeStore)(),n[0]=w):w=n[0];const j=w,[I,T]=(0,c.useState)(!1),_=(0,c.useRef)(!0);let P,C,D;n[1]===Symbol.for("react.memo_cache_sentinel")?(P=()=>()=>{_.current=!1},C=[],n[1]=P,n[2]=C):(P=n[1],C=n[2]),(0,c.useEffect)(P,C),n[3]!==h.serverId?(D=()=>(0,M.isHostRuntimeConnected)(j.getSnapshot(h.serverId)),n[3]=h.serverId,n[4]=D):D=n[4];const z=D;let H;n[5]===Symbol.for("react.memo_cache_sentinel")?(H=async(e,t,s)=>{const n=void 0===s?250:s,o=Date.now()+t;for(;Date.now()<o;){if(!_.current)return!1;if(e())return!0;await pe(n)}return e()},n[5]=H):H=n[5];const V=H;let R;n[6]!==h.label||n[7]!==z||n[8]!==y?(R=async()=>{z()&&await V(()=>!z(),7e3);const e=await V(()=>z(),3e4);_.current&&(T(!1),e||f.default.alert(y("settings.host.daemon.restart.unableToReconnectTitle"),y("settings.host.daemon.restart.unableToReconnectMessage",{name:h.label})))},n[6]=h.label,n[7]=z,n[8]=y,n[9]=R):R=n[9];const k=R;let L;n[10]!==v||n[11]!==h.label||n[12]!==h.serverId||n[13]!==z||n[14]!==y||n[15]!==k?(L=()=>{v?z()?(0,A.confirmDialog)({title:y("settings.host.daemon.restart.confirmTitle",{name:h.label}),message:y("settings.host.daemon.restart.confirmMessage"),confirmLabel:y("settings.host.daemon.restart.confirm"),cancelLabel:y("common.actions.cancel"),destructive:!0}).then(e=>{e&&(T(!0),v.restartServer(`settings_daemon_restart_${h.serverId}`).catch(e=>{console.error(`[HostPage] Failed to restart daemon ${h.label}`,e),_.current&&(T(!1),f.default.alert(y("settings.host.daemon.restart.requestFailedTitle"),y("settings.host.daemon.restart.requestFailedMessage")))}),k())}).catch(e=>{console.error(`[HostPage] Failed to open restart confirmation for ${h.label}`,e),f.default.alert(y("settings.host.daemon.restart.requestFailedTitle"),y("settings.host.daemon.restart.dialogFailedMessage"))}):f.default.alert(y("settings.host.daemon.restart.offlineTitle"),y("settings.host.daemon.restart.offlineMessage")):f.default.alert(y("settings.host.daemon.restart.unavailableTitle"),y("settings.host.daemon.restart.unavailableMessage"))},n[10]=v,n[11]=h.label,n[12]=h.serverId,n[13]=z,n[14]=y,n[15]=k,n[16]=L):L=n[16];const E=L;let U;n[17]!==x.colors.foreground||n[18]!==x.iconSize.sm?(U=(0,Z.jsx)(l.RotateCw,{size:x.iconSize.sm,color:x.colors.foreground}),n[17]=x.colors.foreground,n[18]=x.iconSize.sm,n[19]=U):U=n[19];const F=U;let $,O,W,q,N;n[20]!==y?($=y("settings.host.daemon.restart.title"),n[20]=y,n[21]=$):$=n[21],n[22]!==$?(O=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowTitle,children:$}),n[22]=$,n[23]=O):O=n[23],n[24]!==y?(W=y("settings.host.daemon.restart.hint"),n[24]=y,n[25]=W):W=n[25],n[26]!==W?(q=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowHint,children:W}),n[26]=W,n[27]=q):q=n[27],n[28]!==O||n[29]!==q?(N=(0,Z.jsxs)(t.View,{style:B.settingsStyles.rowContent,children:[O,q]}),n[28]=O,n[29]=q,n[30]=N):N=n[30];const G=I||!v||!S;let K,J,Q;return n[31]!==I||n[32]!==y?(K=y(I?"settings.host.daemon.restart.restarting":"settings.host.daemon.restart.confirm"),n[31]=I,n[32]=y,n[33]=K):K=n[33],n[34]!==E||n[35]!==F||n[36]!==G||n[37]!==K?(J=(0,Z.jsx)(b.Button,{variant:"outline",size:"sm",leftIcon:F,onPress:E,disabled:G,testID:"host-page-restart-button",children:K}),n[34]=E,n[35]=F,n[36]=G,n[37]=K,n[38]=J):J=n[38],n[39]!==N||n[40]!==J?(Q=(0,Z.jsx)(t.View,{style:B.settingsStyles.card,testID:"host-page-restart-card",children:(0,Z.jsxs)(t.View,{style:B.settingsStyles.row,children:[N,J]})}),n[39]=N,n[40]=J,n[41]=Q):Q=n[41],Q}function xe(e){const n=(0,o.c)(50),{host:h}=e,{t:y}=(0,u.useTranslation)(),{theme:x}=(0,p.useUnistyles)(),v=(0,M.useHostRuntimeClient)(h.serverId),S=(0,M.useHostRuntimeIsConnected)(h.serverId);let w;n[0]===Symbol.for("react.memo_cache_sentinel")?(w=(0,M.getHostRuntimeStore)(),n[0]=w):w=n[0];const j=w,[I,T]=(0,c.useState)(!1),[_,P]=(0,c.useState)(null),C=(0,c.useRef)(!0),D=(0,c.useRef)(null);let z;n[1]!==h.serverId?(z=e=>e.sessions[h.serverId]?.serverInfo?.version??null,n[1]=h.serverId,n[2]=z):z=n[2];const H=(0,L.useSessionStore)(z);let V;n[3]!==h.serverId?(V=e=>!0===e.sessions[h.serverId]?.serverInfo?.features?.daemonSelfUpdate,n[3]=h.serverId,n[4]=V):V=n[4];const R=(0,L.useSessionStore)(V),k=(0,U.resolveAppVersion)(),F=(0,E.isVersionMismatch)(k,H);let $,O,W;n[5]===Symbol.for("react.memo_cache_sentinel")?($=()=>()=>{C.current=!1,D.current?.()},O=[],n[5]=$,n[6]=O):($=n[5],O=n[6]),(0,c.useEffect)($,O),n[7]!==h.serverId?(W=()=>(0,M.isHostRuntimeConnected)(j.getSnapshot(h.serverId)),n[7]=h.serverId,n[8]=W):W=n[8];const q=W;let N;n[9]!==h.serverId?(N=e=>{const t=j.getSnapshot(h.serverId);return!(!t||!(0,M.isHostRuntimeConnected)(t))&&(null===e||t.clientGeneration!==e)},n[9]=h.serverId,n[10]=N):N=n[10];const G=N;let K;n[11]===Symbol.for("react.memo_cache_sentinel")?(K=async(e,t,s)=>{const n=void 0===s?250:s,o=Date.now()+t;for(;Date.now()<o;){if(!C.current)return!1;if(e())return!0;await pe(n)}return e()},n[11]=K):K=n[11];const J=K;let Q;n[12]!==G||n[13]!==h.label||n[14]!==q||n[15]!==y?(Q=async e=>{!G(e)&&q()&&await J(()=>!q()||G(e),15e3);const t=G(e)||await J(()=>G(e),12e4);C.current&&(T(!1),P(null),t||f.default.alert(y("settings.host.daemon.update.unableToReconnectTitle"),y("settings.host.daemon.update.unableToReconnectMessage",{name:h.label})))},n[12]=G,n[13]=h.label,n[14]=q,n[15]=y,n[16]=Q):Q=n[16];const X=Q;let Y;n[17]!==v||n[18]!==h.label||n[19]!==h.serverId||n[20]!==q||n[21]!==y||n[22]!==X?(Y=()=>{v?q()?(0,A.confirmDialog)({title:y("settings.host.daemon.update.confirmTitle",{name:h.label}),message:y("settings.host.daemon.update.confirmMessage"),confirmLabel:y("settings.host.daemon.update.confirm"),cancelLabel:y("common.actions.cancel"),destructive:!1}).then(e=>{if(!e)return;const t=j.getSnapshot(h.serverId)?.clientGeneration??null;T(!0),P(y("settings.host.daemon.update.phaseStarting"));const s=`settings_daemon_update_${h.serverId}`,n=v.on("daemon.update.progress",e=>{if(e.payload.requestId!==s)return;if(!C.current)return;const{phase:t}=e.payload;"starting"===t?P(y("settings.host.daemon.update.phaseStarting")):"downloading"===t?P(y("settings.host.daemon.update.phaseDownloading")):"installing"===t?P(y("settings.host.daemon.update.phaseInstalling")):"complete"===t&&P(y("settings.host.daemon.update.phaseComplete"))});D.current=n,v.updateDaemon(s).then(e=>{if(D.current=null,n(),!e.success){if(!C.current)return;return T(!1),P(null),void f.default.alert(y("settings.host.daemon.update.requestFailedTitle"),y("settings.host.daemon.update.requestFailedMessage",{error:e.error??"Unknown error"}))}X(t)}).catch(e=>{D.current=null,n(),console.error(`[HostPage] Failed to update daemon ${h.label}`,e),C.current&&(T(!1),P(null),f.default.alert(y("settings.host.daemon.update.requestFailedTitle"),y("settings.host.daemon.update.requestFailedMessage",{error:e instanceof Error?e.message:"Unknown error"})))})}).catch(e=>{console.error(`[HostPage] Failed to open update confirmation for ${h.label}`,e),f.default.alert(y("settings.host.daemon.update.requestFailedTitle"),y("settings.host.daemon.update.dialogFailedMessage"))}):f.default.alert(y("settings.host.daemon.update.offlineTitle"),y("settings.host.daemon.update.offlineMessage")):f.default.alert(y("settings.host.daemon.update.unavailableTitle"),y("settings.host.daemon.update.unavailableMessage"))},n[17]=v,n[18]=h.label,n[19]=h.serverId,n[20]=q,n[21]=y,n[22]=X,n[23]=Y):Y=n[23];const ee=Y;let te;n[24]!==x.colors.foreground||n[25]!==x.iconSize.sm?(te=(0,Z.jsx)(l.ArrowUpToLine,{size:x.iconSize.sm,color:x.colors.foreground}),n[24]=x.colors.foreground,n[25]=x.iconSize.sm,n[26]=te):te=n[26];const se=te;if(!R||!F)return null;let ne;n[27]!==I||n[28]!==_||n[29]!==y?(ne=I?_??y("settings.host.daemon.update.updating"):y("settings.host.daemon.update.confirm"),n[27]=I,n[28]=_,n[29]=y,n[30]=ne):ne=n[30];const oe=ne;let ie,re,le,ae,ce;n[31]!==y?(ie=y("settings.host.daemon.update.title"),n[31]=y,n[32]=ie):ie=n[32],n[33]!==ie?(re=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowTitle,children:ie}),n[33]=ie,n[34]=re):re=n[34],n[35]!==y?(le=y("settings.host.daemon.update.hint"),n[35]=y,n[36]=le):le=n[36],n[37]!==le?(ae=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowHint,children:le}),n[37]=le,n[38]=ae):ae=n[38],n[39]!==re||n[40]!==ae?(ce=(0,Z.jsxs)(t.View,{style:B.settingsStyles.rowContent,children:[re,ae]}),n[39]=re,n[40]=ae,n[41]=ce):ce=n[41];const de=I||!v||!S;let me,ue;return n[42]!==oe||n[43]!==ee||n[44]!==de||n[45]!==se?(me=(0,Z.jsx)(b.Button,{variant:"outline",size:"sm",leftIcon:se,onPress:ee,disabled:de,testID:"host-page-update-button",children:oe}),n[42]=oe,n[43]=ee,n[44]=de,n[45]=se,n[46]=me):me=n[46],n[47]!==ce||n[48]!==me?(ue=(0,Z.jsx)(t.View,{style:B.settingsStyles.card,testID:"host-page-update-card",children:(0,Z.jsxs)(t.View,{style:B.settingsStyles.row,children:[ce,me]})}),n[47]=ce,n[48]=me,n[49]=ue):ue=n[49],ue}function ve(e){const n=(0,o.c)(22),{serverId:l}=e,{t:c}=(0,u.useTranslation)(),h=(0,M.useHostRuntimeIsConnected)(l),{config:f,patchConfig:p}=(0,D.useDaemonConfig)(l);let y;n[0]!==p?(y=e=>{p({mcp:{injectIntoAgents:e}})},n[0]=p,n[1]=y):y=n[1];const x=y;if(!h)return null;let v,S,b,j,I;n[2]!==c?(v=c("settings.host.orchestration.enableTools.title"),n[2]=c,n[3]=v):v=n[3],n[4]!==v?(S=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowTitle,children:v}),n[4]=v,n[5]=S):S=n[5],n[6]!==c?(b=c("settings.host.orchestration.enableTools.hint"),n[6]=c,n[7]=b):b=n[7],n[8]!==b?(j=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowHint,children:b}),n[8]=b,n[9]=j):j=n[9],n[10]!==S||n[11]!==j?(I=(0,Z.jsxs)(t.View,{style:B.settingsStyles.rowContent,children:[S,j]}),n[10]=S,n[11]=j,n[12]=I):I=n[12];const T=!1!==f?.mcp.injectIntoAgents;let _,P,C;return n[13]!==c?(_=c("settings.host.orchestration.enableTools.accessibilityLabel"),n[13]=c,n[14]=_):_=n[14],n[15]!==x||n[16]!==T||n[17]!==_?(P=(0,Z.jsx)(w.Switch,{value:T,onValueChange:x,accessibilityLabel:_}),n[15]=x,n[16]=T,n[17]=_,n[18]=P):P=n[18],n[19]!==I||n[20]!==P?(C=(0,Z.jsx)(t.View,{style:B.settingsStyles.card,testID:"host-page-inject-mcp-card",children:(0,Z.jsxs)(t.View,{style:B.settingsStyles.row,children:[I,P]})}),n[19]=I,n[20]=P,n[21]=C):C=n[21],C}function Se(e){const n=(0,o.c)(6),{serverId:l}=e,c=(0,M.useHostRuntimeIsConnected)(l),{config:u,patchConfig:h}=(0,D.useDaemonConfig)(l);let f;n[0]!==h?(f=e=>{h({autoArchiveAfterMerge:e}).catch(be)},n[0]=h,n[1]=f):f=n[1];const p=f;if(!c)return null;let y;n[2]===Symbol.for("react.memo_cache_sentinel")?(y=(0,Z.jsxs)(t.View,{style:B.settingsStyles.rowContent,children:[(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowTitle,children:"Archive merged PR workspaces"}),(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowHint,children:"Automatically archive clean Paseo workspaces after their pull request is merged"})]}),n[2]=y):y=n[2];const x=!0===u?.autoArchiveAfterMerge;let v;return n[3]!==p||n[4]!==x?(v=(0,Z.jsx)(t.View,{style:B.settingsStyles.card,testID:"host-page-auto-archive-merged-workspaces-card",children:(0,Z.jsxs)(t.View,{style:B.settingsStyles.row,children:[y,(0,Z.jsx)(w.Switch,{value:x,onValueChange:p,accessibilityLabel:"Archive merged PR workspaces",testID:"host-page-auto-archive-merged-workspaces-switch"})]})}),n[3]=p,n[4]=x,n[5]=v):v=n[5],v}function be(e){console.error("[HostPage] Failed to update auto-archive after merge",e),f.default.alert("Unable to update workspaces",e instanceof Error?e.message:String(e))}function we(e){const n=(0,o.c)(6),{serverId:l}=e,c=(0,M.useHostRuntimeIsConnected)(l),{config:u,patchConfig:h}=(0,D.useDaemonConfig)(l);let f;n[0]!==h?(f=e=>{h({enableTerminalAgentHooks:e}).catch(je)},n[0]=h,n[1]=f):f=n[1];const p=f;if(!c)return null;let y;n[2]===Symbol.for("react.memo_cache_sentinel")?(y=(0,Z.jsxs)(t.View,{style:B.settingsStyles.rowContent,children:[(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowTitle,children:"Enable terminal agent hooks"}),(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowHint,children:"Get notifications and status from terminal agents. This installs hooks in your agent config files."})]}),n[2]=y):y=n[2];const x=!0===u?.enableTerminalAgentHooks;let v;return n[3]!==p||n[4]!==x?(v=(0,Z.jsx)(t.View,{style:B.settingsStyles.card,testID:"host-page-terminal-agent-hooks-card",children:(0,Z.jsxs)(t.View,{style:B.settingsStyles.row,children:[y,(0,Z.jsx)(w.Switch,{value:x,onValueChange:p,accessibilityLabel:"Enable terminal agent hooks",testID:"host-page-terminal-agent-hooks-switch"})]})}),n[3]=p,n[4]=x,n[5]=v):v=n[5],v}function je(e){console.error("[HostPage] Failed to update terminal agent hooks",e),f.default.alert("Unable to update terminal agent hooks",e instanceof Error?e.message:String(e))}function Ie(e){const n=(0,o.c)(49),{serverId:l}=e,{t:h}=(0,u.useTranslation)(),f=(0,M.useHostRuntimeIsConnected)(l),{config:p,patchConfig:y}=(0,D.useDaemonConfig)(l),v=p?.appendSystemPrompt??"",[w,j]=(0,c.useState)(v),[I,T]=(0,c.useState)(!1),[_,P]=(0,c.useState)(!1);let C,z;n[0]!==h?(C=h("settings.host.orchestration.systemPrompt.sheetTitle"),n[0]=h,n[1]=C):C=n[1],n[2]!==C?(z={title:C},n[2]=C,n[3]=z):z=n[3];const H=z;let V,R;n[4]!==v?(V=()=>{j(v)},R=[v],n[4]=v,n[5]=V,n[6]=R):(V=n[5],R=n[6]),(0,c.useEffect)(V,R);const k=w!==v;let L;n[7]!==v?(L=()=>{j(v),T(!0)},n[7]=v,n[8]=L):L=n[8];const A=L;let E;n[9]!==_||n[10]!==v?(E=()=>{_||(j(v),T(!1))},n[9]=_,n[10]=v,n[11]=E):E=n[11];const U=E;let F;n[12]!==w||n[13]!==y?(F=()=>{P(!0),y({appendSystemPrompt:w}).then(()=>{T(!1)}).catch(Te).finally(()=>P(!1))},n[12]=w,n[13]=y,n[14]=F):F=n[14];const $=F;let O;n[15]!==v?(O=()=>{j(v)},n[15]=v,n[16]=O):O=n[16];const W=O;if(!f)return null;let q,N,G,K,J,Q,X,Y,ee,te;return n[17]!==h?(q=h("settings.host.orchestration.systemPrompt.title"),n[17]=h,n[18]=q):q=n[18],n[19]!==q?(N=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowTitle,children:q}),n[19]=q,n[20]=N):N=n[20],n[21]!==h?(G=h("settings.host.orchestration.systemPrompt.hint"),n[21]=h,n[22]=G):G=n[22],n[23]!==G?(K=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowHint,children:G}),n[23]=G,n[24]=K):K=n[24],n[25]!==N||n[26]!==K?(J=(0,Z.jsxs)(t.View,{style:B.settingsStyles.rowContent,children:[N,K]}),n[25]=N,n[26]=K,n[27]=J):J=n[27],n[28]!==h?(Q=h("settings.host.orchestration.systemPrompt.edit"),n[28]=h,n[29]=Q):Q=n[29],n[30]!==A||n[31]!==Q?(X=(0,Z.jsx)(b.Button,{variant:"outline",size:"sm",onPress:A,testID:"host-page-append-system-prompt-edit",children:Q}),n[30]=A,n[31]=Q,n[32]=X):X=n[32],n[33]!==J||n[34]!==X?(Y=(0,Z.jsx)(t.View,{style:B.settingsStyles.card,testID:"host-page-append-system-prompt-card",children:(0,Z.jsxs)(t.View,{style:B.settingsStyles.row,children:[J,X]})}),n[33]=J,n[34]=X,n[35]=Y):Y=n[35],n[36]!==w||n[37]!==U||n[38]!==W||n[39]!==$||n[40]!==k||n[41]!==H||n[42]!==I||n[43]!==_||n[44]!==h?(ee=I?(0,Z.jsxs)(x.AdaptiveModalSheet,{header:H,visible:!0,onClose:U,testID:"host-page-append-system-prompt-sheet",desktopMaxWidth:560,children:[(0,Z.jsx)(S.SettingsTextAreaCard,{testID:"host-page-append-system-prompt-input",accessibilityLabel:h("settings.host.orchestration.systemPrompt.accessibilityLabel"),value:w,onChangeText:j,placeholder:h("settings.host.orchestration.systemPrompt.placeholder")}),(0,Z.jsxs)(t.View,{style:Re.appendPromptActions,children:[(0,Z.jsx)(b.Button,{variant:"ghost",size:"sm",onPress:W,disabled:!k||_,testID:"host-page-append-system-prompt-reset",children:h("settings.host.orchestration.systemPrompt.reset")}),(0,Z.jsx)(b.Button,{variant:"default",size:"sm",onPress:$,disabled:!k||_,testID:"host-page-append-system-prompt-save",children:h(_?"settings.host.orchestration.systemPrompt.saving":"settings.host.orchestration.systemPrompt.save")})]})]}):null,n[36]=w,n[37]=U,n[38]=W,n[39]=$,n[40]=k,n[41]=H,n[42]=I,n[43]=_,n[44]=h,n[45]=ee):ee=n[45],n[46]!==Y||n[47]!==ee?(te=(0,Z.jsxs)(Z.Fragment,{children:[Y,ee]}),n[46]=Y,n[47]=ee,n[48]=te):te=n[48],te}function Te(e){console.error("[HostPage] Failed to save append system prompt",e)}function Pe(){const e=(0,o.c)(24),{t:h}=(0,u.useTranslation)(),{theme:f}=(0,p.useUnistyles)(),[y,x]=(0,c.useState)(!1);let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=()=>x(!0),e[0]=v):v=e[0];const S=v;let b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b=()=>x(!1),e[1]=b):b=e[1];const w=b;let j,I,T,_,P,D,z,M,H;return e[2]!==h?(j=h("settings.host.pairDevices.rowTitle"),e[2]=h,e[3]=j):j=e[3],e[4]!==j?(I=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowTitle,children:j}),e[4]=j,e[5]=I):I=e[5],e[6]!==h?(T=h("settings.host.pairDevices.rowHint"),e[6]=h,e[7]=T):T=e[7],e[8]!==T?(_=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowHint,children:T}),e[8]=T,e[9]=_):_=e[9],e[10]!==I||e[11]!==_?(P=(0,Z.jsxs)(t.View,{style:B.settingsStyles.rowContent,children:[I,_]}),e[10]=I,e[11]=_,e[12]=P):P=e[12],e[13]!==f.colors.foregroundMuted||e[14]!==f.iconSize.sm?(D=(0,Z.jsx)(l.ChevronRight,{size:f.iconSize.sm,color:f.colors.foregroundMuted}),e[13]=f.colors.foregroundMuted,e[14]=f.iconSize.sm,e[15]=D):D=e[15],e[16]!==P||e[17]!==D?(z=(0,Z.jsxs)(n.Pressable,{style:B.settingsStyles.row,onPress:S,accessibilityRole:"button",testID:"host-page-pair-device-row",children:[P,D]}),e[16]=P,e[17]=D,e[18]=z):z=e[18],e[19]!==y?(M=(0,Z.jsx)(C.PairDeviceModal,{visible:y,onClose:w,testID:"host-page-pair-device-card"}),e[19]=y,e[20]=M):M=e[20],e[21]!==z||e[22]!==M?(H=(0,Z.jsxs)(t.View,{style:B.settingsStyles.card,children:[z,M]}),e[21]=z,e[22]=M,e[23]=H):H=e[23],H}function Ce({host:e,isLocalDaemon:n,onRemoved:o}){const{t:h}=(0,u.useTranslation)(),{theme:y}=(0,p.useUnistyles)(),{removeHost:v}=(0,M.useHostMutations)(),{updateSettings:S}=(0,P.useDesktopSettings)(),{data:w,setStatus:j}=(0,_.useDaemonStatus)(),[T,C]=(0,c.useState)(!1),[D,z]=(0,c.useState)(!1),H=w?.status??null,V=(0,c.useMemo)(()=>({title:h(n?"settings.host.daemon.remove.localConfirmTitle":"settings.host.daemon.remove.title")}),[n,h]),R=(0,c.useMemo)(()=>({color:y.colors.destructive}),[y.colors.destructive]),L=(0,c.useCallback)(()=>C(!0),[]),A=(0,c.useCallback)(()=>{D||C(!1)},[D]),E=(0,c.useCallback)(()=>C(!1),[]),U=(0,c.useCallback)(async e=>{await S({daemon:{manageBuiltInDaemon:!0}}),e&&j(await(0,I.startDesktopDaemon)())},[j,S]),F=(0,c.useCallback)(()=>{z(!0);(async()=>{let t=!1,s=!1;if(n)try{await S({daemon:{manageBuiltInDaemon:!1}}),t=!0,"running"===H?.status&&H.desktopManaged&&(j(await(0,I.stopDesktopDaemon)("host_remove")),s=!0),await v(e.serverId)}catch(e){if(t)try{await U(s)}catch(e){console.error("[HostPage] Failed to roll back localhost removal",e)}throw e}else await v(e.serverId)})().then(()=>{C(!1),o?.()}).catch(e=>{console.error("[HostPage] Failed to remove host",e),f.default.alert(h("settings.host.daemon.remove.errorTitle"),h(n?"settings.host.daemon.remove.localErrorMessage":"settings.host.daemon.remove.errorMessage"))}).finally(()=>z(!1))},[H,e.serverId,n,o,v,U,j,h,S]),$=(0,c.useMemo)(()=>(0,Z.jsx)(l.Trash2,{size:y.iconSize.sm,color:y.colors.destructive}),[y.iconSize.sm,y.colors.destructive]);return(0,Z.jsxs)(k.SettingsSection,{title:h("settings.host.daemon.dangerZone"),testID:"host-page-remove-host-card",children:[(0,Z.jsx)(ye,{host:e}),(0,Z.jsx)(t.View,{style:B.settingsStyles.card,children:(0,Z.jsxs)(t.View,{style:B.settingsStyles.row,children:[(0,Z.jsxs)(t.View,{style:B.settingsStyles.rowContent,children:[(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowTitle,children:h(n?"settings.host.daemon.remove.localTitle":"settings.host.daemon.remove.title")}),(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowHint,children:h(n?"settings.host.daemon.remove.localHint":"settings.host.daemon.remove.hint")})]}),(0,Z.jsx)(b.Button,{variant:"outline",size:"sm",leftIcon:$,textStyle:R,onPress:L,testID:"host-page-remove-host-button",children:h("settings.host.connections.removeAction")})]})}),T?(0,Z.jsxs)(x.AdaptiveModalSheet,{header:V,visible:!0,onClose:A,testID:"remove-host-confirm-modal",children:[(0,Z.jsx)(s.Text,{style:Re.confirmText,children:n?h("settings.host.daemon.remove.localConfirmMessage"):h("settings.host.daemon.remove.confirmMessage",{name:e.label})}),(0,Z.jsxs)(t.View,{style:Re.confirmActions,children:[(0,Z.jsx)(b.Button,{variant:"secondary",size:"sm",style:ke,onPress:E,disabled:D,children:h("common.actions.cancel")}),(0,Z.jsx)(b.Button,{variant:"destructive",size:"sm",style:ke,onPress:F,disabled:D,testID:"remove-host-confirm",children:h("settings.host.connections.removeAction")})]})]}):null]})}function De(e){const t=e.trim();if(t)return t.split(/\s+/).map(e=>e.trim()).filter(Boolean)}const ze={name:"",command:"",args:""};function Me(e){const n=(0,o.c)(65),{profile:l,isFirst:c,isLast:h,onEdit:f,onRemove:p,onMoveUp:x,onMoveDown:v}=e,{t:S}=(0,u.useTranslation)();let w;n[0]!==f||n[1]!==l.id?(w=()=>f(l.id),n[0]=f,n[1]=l.id,n[2]=w):w=n[2];const j=w;let I;n[3]!==p||n[4]!==l.id?(I=()=>p(l.id),n[3]=p,n[4]=l.id,n[5]=I):I=n[5];const T=I;let _;n[6]!==x||n[7]!==l.id?(_=()=>x(l.id),n[6]=x,n[7]=l.id,n[8]=_):_=n[8];const P=_;let C;n[9]!==v||n[10]!==l.id?(C=()=>v(l.id),n[9]=v,n[10]=l.id,n[11]=C):C=n[11];const D=C;let z;n[12]!==l.args||n[13]!==l.command?(z=l.args&&l.args.length>0?`${l.command} ${l.args.join(" ")}`:l.command,n[12]=l.args,n[13]=l.command,n[14]=z):z=n[14];const M=z,H=!c&&B.settingsStyles.rowBorder;let V;n[15]!==H?(V=[B.settingsStyles.row,H,Ve.row],n[15]=H,n[16]=V):V=n[16];const R=V;let k;n[17]!==l?(k=(0,y.getTerminalProfileIcon)(l),n[17]=l,n[18]=k):k=n[18];const L=k,A=`terminal-profile-row-${l.id}`;let E,U,F,$,W;n[19]!==L?(E=(0,Z.jsx)(t.View,{style:Ve.iconWrapper,children:L?(0,Z.jsx)(Y,{iconKey:L,size:O.ICON_SIZE.md,uniProps:ee}):(0,Z.jsx)(Q,{size:O.ICON_SIZE.md,uniProps:ee})}),n[19]=L,n[20]=E):E=n[20],n[21]!==l.name?(U=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowTitle,numberOfLines:1,children:l.name}),n[21]=l.name,n[22]=U):U=n[22],n[23]!==M?(F=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowHint,numberOfLines:1,children:M}),n[23]=M,n[24]=F):F=n[24],n[25]!==U||n[26]!==F?($=(0,Z.jsxs)(t.View,{style:B.settingsStyles.rowContent,children:[U,F]}),n[25]=U,n[26]=F,n[27]=$):$=n[27],n[28]!==S?(W=S("settings.host.terminalProfiles.moveUp"),n[28]=S,n[29]=W):W=n[29];const q=`terminal-profile-move-up-${l.id}`;let N,G;n[30]!==P||n[31]!==c||n[32]!==W||n[33]!==q?(N=(0,Z.jsx)(b.Button,{variant:"ghost",size:"sm",leftIcon:te,onPress:P,disabled:c,accessibilityLabel:W,testID:q}),n[30]=P,n[31]=c,n[32]=W,n[33]=q,n[34]=N):N=n[34],n[35]!==S?(G=S("settings.host.terminalProfiles.moveDown"),n[35]=S,n[36]=G):G=n[36];const K=`terminal-profile-move-down-${l.id}`;let J,X;n[37]!==D||n[38]!==h||n[39]!==G||n[40]!==K?(J=(0,Z.jsx)(b.Button,{variant:"ghost",size:"sm",leftIcon:se,onPress:D,disabled:h,accessibilityLabel:G,testID:K}),n[37]=D,n[38]=h,n[39]=G,n[40]=K,n[41]=J):J=n[41],n[42]!==S?(X=S("settings.host.terminalProfiles.editProfile"),n[42]=S,n[43]=X):X=n[43];const ie=`terminal-profile-edit-${l.id}`;let re,le;n[44]!==j||n[45]!==X||n[46]!==ie?(re=(0,Z.jsx)(b.Button,{variant:"ghost",size:"sm",leftIcon:ne,onPress:j,accessibilityLabel:X,testID:ie}),n[44]=j,n[45]=X,n[46]=ie,n[47]=re):re=n[47],n[48]!==S?(le=S("settings.host.terminalProfiles.remove"),n[48]=S,n[49]=le):le=n[49];const ae=`terminal-profile-remove-${l.id}`;let ce,de,me;return n[50]!==T||n[51]!==le||n[52]!==ae?(ce=(0,Z.jsx)(b.Button,{variant:"ghost",size:"sm",leftIcon:oe,onPress:T,accessibilityLabel:le,testID:ae}),n[50]=T,n[51]=le,n[52]=ae,n[53]=ce):ce=n[53],n[54]!==N||n[55]!==J||n[56]!==re||n[57]!==ce?(de=(0,Z.jsxs)(t.View,{style:Ve.rowActions,children:[N,J,re,ce]}),n[54]=N,n[55]=J,n[56]=re,n[57]=ce,n[58]=de):de=n[58],n[59]!==R||n[60]!==E||n[61]!==$||n[62]!==de||n[63]!==A?(me=(0,Z.jsxs)(t.View,{style:R,testID:A,children:[E,$,de]}),n[59]=R,n[60]=E,n[61]=$,n[62]=de,n[63]=A,n[64]=me):me=n[64],me}function He(e){const n=(0,o.c)(63),{serverId:l}=e,{t:h}=(0,u.useTranslation)(),p=(0,M.useHostRuntimeIsConnected)(l),{config:x,patchConfig:v}=(0,D.useDaemonConfig)(l),[S,w]=(0,c.useState)(null),[I,T]=(0,c.useState)(!1);let _;n[0]!==x?(_=x?(0,y.resolveTerminalProfiles)(x.terminalProfiles):null,n[0]=x,n[1]=_):_=n[1];const P=_;let C;n[2]!==v?(C=async e=>{await v({terminalProfiles:e})},n[2]=v,n[3]=C):C=n[3];const z=C;let H;n[4]===Symbol.for("react.memo_cache_sentinel")?(H=()=>T(!0),n[4]=H):H=n[4];const V=H;let R;n[5]===Symbol.for("react.memo_cache_sentinel")?(R=()=>T(!1),n[5]=R):R=n[5];const L=R;let E;n[6]!==P||n[7]!==z?(E=async e=>{const t=[...P?[...P]:[],{id:`profile_${Date.now().toString(36)}_${Math.random().toString(36).slice(2)}`,name:e.name,command:e.command,args:De(e.args)}];await z(t),T(!1)},n[6]=P,n[7]=z,n[8]=E):E=n[8];const U=E;let F;n[9]!==P?(F=e=>{const t=P?.find(t=>t.id===e);t&&w({id:e,draft:{name:t.name,command:t.command,args:t.args?t.args.join(" "):""}})},n[9]=P,n[10]=F):F=n[10];const $=F;let O;n[11]===Symbol.for("react.memo_cache_sentinel")?(O=()=>w(null),n[11]=O):O=n[11];const W=O;let q;n[12]!==S||n[13]!==P||n[14]!==z?(q=async e=>{if(!S||!P)return;const t=P.map(t=>t.id===S.id?Object.assign({},t,{name:e.name,command:e.command,args:De(e.args)}):t);await z(t),w(null)},n[12]=S,n[13]=P,n[14]=z,n[15]=q):q=n[15];const N=q;let G;n[16]!==P||n[17]!==z||n[18]!==h?(G=e=>{const t=P?.find(t=>t.id===e);t&&(0,A.confirmDialog)({title:h("settings.host.terminalProfiles.removeConfirmTitle"),message:h("settings.host.terminalProfiles.removeConfirmMessage",{name:t.name}),confirmLabel:h("settings.host.terminalProfiles.remove"),cancelLabel:h("common.actions.cancel"),destructive:!0}).then(async t=>{if(t&&P)try{await z(P.filter(t=>t.id!==e))}catch(e){const t=e;f.default.alert(h("common.errors.unableToSave"),t instanceof Error?t.message:String(t))}})},n[16]=P,n[17]=z,n[18]=h,n[19]=G):G=n[19];const K=G;let J;n[20]!==P||n[21]!==z||n[22]!==h?(J=async e=>{if(!P)return;const t=P.findIndex(t=>t.id===e);if(t<=0)return;const s=[...P],[n]=s.splice(t,1);s.splice(t-1,0,n);try{await z(s)}catch(e){const t=e;f.default.alert(h("common.errors.unableToSave"),t instanceof Error?t.message:String(t))}},n[20]=P,n[21]=z,n[22]=h,n[23]=J):J=n[23];const Q=J;let X;n[24]!==P||n[25]!==z||n[26]!==h?(X=async e=>{if(!P)return;const t=P.findIndex(t=>t.id===e);if(t<0||t>=P.length-1)return;const s=[...P],[n]=s.splice(t,1);s.splice(t+1,0,n);try{await z(s)}catch(e){const t=e;f.default.alert(h("common.errors.unableToSave"),t instanceof Error?t.message:String(t))}},n[24]=P,n[25]=z,n[26]=h,n[27]=X):X=n[27];const Y=X,ee=!p||!P;let te;n[28]!==ee?(te=(0,Z.jsx)(b.Button,{variant:"ghost",size:"sm",leftIcon:ie,onPress:V,disabled:ee,testID:"terminal-profiles-add-button"}),n[28]=ee,n[29]=te):te=n[29];const se=te;if(!p){let e,o;return n[30]!==h?(e=h("settings.host.terminalProfiles.unavailable"),n[30]=h,n[31]=e):e=n[31],n[32]!==e?(o=(0,Z.jsx)(t.View,{style:B.settingsStyles.card,testID:"terminal-profiles-unavailable",children:(0,Z.jsx)(t.View,{style:Ve.emptyCard,children:(0,Z.jsx)(s.Text,{style:Ve.emptyText,children:e})})}),n[32]=e,n[33]=o):o=n[33],o}let ne,oe,re,le,ae,ce,de,me;return n[34]!==h?(ne=h("settings.host.terminalProfiles.sectionTitle"),n[34]=h,n[35]=ne):ne=n[35],n[36]!==$||n[37]!==Y||n[38]!==Q||n[39]!==K||n[40]!==P||n[41]!==h?(oe=P&&P.length>0?P.map((e,t)=>(0,Z.jsx)(Me,{profile:e,isFirst:0===t,isLast:t===P.length-1,onEdit:$,onRemove:K,onMoveUp:Q,onMoveDown:Y},e.id)):(0,Z.jsx)(t.View,{style:Ve.emptyCard,children:(0,Z.jsx)(s.Text,{style:Ve.emptyText,children:h("settings.host.terminalProfiles.emptyState")})}),n[36]=$,n[37]=Y,n[38]=Q,n[39]=K,n[40]=P,n[41]=h,n[42]=oe):oe=n[42],n[43]!==oe?(re=(0,Z.jsx)(t.View,{style:B.settingsStyles.card,testID:"terminal-profiles-card",children:oe}),n[43]=oe,n[44]=re):re=n[44],n[45]!==se||n[46]!==ne||n[47]!==re?(le=(0,Z.jsx)(k.SettingsSection,{title:ne,trailing:se,testID:"terminal-profiles-section",children:re}),n[45]=se,n[46]=ne,n[47]=re,n[48]=le):le=n[48],n[49]!==h?(ae=h("settings.host.terminalProfiles.addProfileTitle"),n[49]=h,n[50]=ae):ae=n[50],n[51]!==U||n[52]!==I||n[53]!==ae?(ce=(0,Z.jsx)(j.TerminalProfileEditModal,{visible:I,title:ae,initialDraft:ze,onClose:L,onSave:U,testID:"terminal-profile-edit-modal"}),n[51]=U,n[52]=I,n[53]=ae,n[54]=ce):ce=n[54],n[55]!==S||n[56]!==N||n[57]!==h?(de=S?(0,Z.jsx)(j.TerminalProfileEditModal,{visible:!0,title:h("settings.host.terminalProfiles.editProfileTitle"),initialDraft:S.draft,onClose:W,onSave:N}):null,n[55]=S,n[56]=N,n[57]=h,n[58]=de):de=n[58],n[59]!==le||n[60]!==ce||n[61]!==de?(me=(0,Z.jsxs)(Z.Fragment,{children:[le,ce,de]}),n[59]=le,n[60]=ce,n[61]=de,n[62]=me):me=n[62],me}const Ve=p.StyleSheet.create(e=>({row:{gap:e.spacing[2],minHeight:56,uni__dependencies:[0]},iconWrapper:{width:e.iconSize.md,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},rowActions:{flexDirection:"row",alignItems:"center",gap:0},emptyCard:{padding:e.spacing[4],alignItems:"center",uni__dependencies:[0]},emptyText:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,textAlign:"center",uni__dependencies:[0]}})),Re=p.StyleSheet.create(e=>({identityEditButton:{padding:e.spacing[1],borderRadius:e.borderRadius.md,uni__dependencies:[0]},daemonHeader:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],marginBottom:e.spacing[4],uni__dependencies:[0]},daemonHeaderLabel:{flexShrink:1,fontSize:e.fontSize.base,fontWeight:e.fontWeight.medium,color:e.colors.foreground,uni__dependencies:[0]},identityBadges:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],flexWrap:"wrap",marginBottom:e.spacing[6],uni__dependencies:[0]},statusPill:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:e.spacing[2],paddingVertical:4,borderRadius:e.borderRadius.full,uni__dependencies:[0]},statusDot:{width:6,height:6,borderRadius:e.borderRadius.full,uni__dependencies:[0]},statusText:{fontSize:e.fontSize.xs,fontWeight:e.fontWeight.normal,uni__dependencies:[0]},badgePill:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:e.spacing[2],paddingVertical:4,borderRadius:e.borderRadius.full,borderWidth:1,borderColor:e.colors.border,backgroundColor:e.colors.surface3,maxWidth:200,uni__dependencies:[0]},badgeText:{fontSize:e.fontSize.xs,fontWeight:e.fontWeight.normal,color:e.colors.foregroundMuted,flexShrink:1,uni__dependencies:[0]},errorText:{color:e.colors.palette.red[300],fontSize:e.fontSize.xs,marginBottom:e.spacing[2],uni__dependencies:[0]},connectionLatency:{fontSize:e.fontSize.sm,marginRight:e.spacing[2],uni__dependencies:[0]},confirmText:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,uni__dependencies:[0]},confirmActions:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],marginTop:e.spacing[4],uni__dependencies:[0]},appendPromptActions:{flexDirection:"row",justifyContent:"flex-end",gap:e.spacing[2],uni__dependencies:[0]},emptyCard:{padding:e.spacing[4],alignItems:"center",uni__dependencies:[0]},emptyText:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,uni__dependencies:[0]}})),ke={flex:1},Le=[B.settingsStyles.card,Re.emptyCard]},4746,[348,711,1572,349,1600,36,1573,1389,1308,234,146,56,4598,3466,3626,4747,3627,4730,4748,3403,4741,4745,3576,4657,3903,3475,3271,4750,4753,3972,4726,3414,3907,3678,4140,3401,3605,4756,305,3929,4757,279]);
|
|
16506
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.SettingsTextArea=u,e.SettingsTextAreaCard=function(n){const s=(0,o.c)(2);let p;s[0]!==n?(p=(0,c.jsx)(t.View,{style:l.settingsStyles.card,children:(0,c.jsx)(u,Object.assign({},n))}),s[0]=n,s[1]=p):p=s[1];return p};var t=r(d[0]),n=r(d[1]),o=r(d[2]);r(d[3]),r(d[4]),r(d[5]);var s=r(d[6]),l=r(d[7]),c=r(d[8]);function u(t){const l=(0,o.c)(10),{accessibilityLabel:u,value:f,onChangeText:x,placeholder:h,testID:y,style:S}=t,{theme:b}=(0,s.useUnistyles)();let T;l[0]!==S?(T=[p.input,S],l[0]=S,l[1]=T):T=l[1];const _=T;let j;return l[2]!==u||l[3]!==_||l[4]!==x||l[5]!==h||l[6]!==y||l[7]!==b.colors.foregroundMuted||l[8]!==f?(j=(0,c.jsx)(n.TextInput,{testID:y,accessibilityLabel:u,multiline:!0,value:f,onChangeText:x,placeholder:h,placeholderTextColor:b.colors.foregroundMuted,style:_}),l[2]=u,l[3]=_,l[4]=x,l[5]=h,l[6]=y,l[7]=b.colors.foregroundMuted,l[8]=f,l[9]=j):j=l[9],j}const p=s.StyleSheet.create(t=>({input:{color:t.colors.foreground,fontSize:t.fontSize.sm,paddingVertical:t.spacing[3],paddingHorizontal:t.spacing[4],minHeight:96,textAlignVertical:"top",uni__dependencies:[0]}}))},4747,[348,714,349,36,715,146,56,3907,279]);
|
|
16507
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16508
|
-
__d(function(g,r,i,a,m,
|
|
16509
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.
|
|
16510
|
-
__d(function(g,r,i,a,m,
|
|
16511
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16512
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16513
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16514
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16515
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16516
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16517
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),
|
|
16518
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"
|
|
16519
|
-
__d(function(g,r,i,a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return W}});var t=r(_d[0]),s=r(_d[1]),o=r(_d[2]),n=r(_d[3]),c=r(_d[4]),l=r(_d[5]),d=r(_d[6]);r(_d[7]),r(_d[8]),r(_d[9]),r(_d[10]);var p=r(_d[11]),u=r(_d[12]),j=r(_d[13]),h=r(_d[14]),f=r(_d[15]),x=r(_d[16]),y=r(_d[17]),b=r(_d[18]),_=r(_d[19]),I=r(_d[20]),S=r(_d[21]),T=r(_d[22]),v=r(_d[23]),w=r(_d[24]),D=r(_d[25]),C=r(_d[26]),R=r(_d[27]),k=r(_d[28]),P=r(_d[29]),z=r(_d[30]),E=r(_d[31]),H=r(_d[32]),K=r(_d[33]),M=r(_d[34]),L=r(_d[35]);const N="service",V=14,B={branchName:{titleKey:"settings.project.metadata.branchName",placeholderKey:"settings.project.metadata.branchNamePlaceholder",sectionTestID:"metadata-prompt-branch-name-section",inputTestID:"metadata-prompt-branch-name-input"},commitMessage:{titleKey:"settings.project.metadata.commitMessage",placeholderKey:"settings.project.metadata.commitMessagePlaceholder",sectionTestID:"metadata-prompt-commit-message-section",inputTestID:"metadata-prompt-commit-message-input"},pullRequest:{titleKey:"settings.project.metadata.pullRequest",placeholderKey:"settings.project.metadata.pullRequestPlaceholder",sectionTestID:"metadata-prompt-pull-request-section",inputTestID:"metadata-prompt-pull-request-input"}},F="https://paseo.sh/docs/worktrees";function W(t){const s=(0,c.c)(25),{projectKey:o}=t,{projects:n}=(0,k.useProjects)();let d;if(s[0]!==o||s[1]!==n){let t;s[3]!==o?(t=t=>t.projectKey===o,s[3]=o,s[4]=t):t=s[4],d=n.find(t),s[0]=o,s[1]=n,s[2]=d}else d=s[2];const p=d;let u;s[5]!==p?(u=O(p),s[5]=p,s[6]=u):u=s[6];const j=u;let h;s[7]!==j[0]?.serverId?(h=()=>j[0]?.serverId??"",s[7]=j[0]?.serverId,s[8]=h):h=s[8];const[f,x]=(0,l.useState)(h);let y,b;s[9]!==j||s[10]!==f?(y=()=>{j.some(t=>t.serverId===f)||x(j[0]?.serverId??"")},b=[j,f],s[9]=j,s[10]=f,s[11]=y,s[12]=b):(y=s[11],b=s[12]),(0,l.useEffect)(y,b);const _=(0,z.useHostRuntimeSnapshot)(f),I=Boolean(f)&&("offline"===_?.connectionStatus||"error"===_?.connectionStatus);let S;if(s[13]!==j||s[14]!==f){let t;s[16]!==f?(t=t=>t.serverId===f,s[16]=f,s[17]=t):t=s[17],S=j.find(t),s[13]=j,s[14]=f,s[15]=S}else S=s[15];const T=S,v=(0,z.useHostRuntimeClient)(T?.serverId??"");if(!p||0===j.length||!T||!v){let t;return s[18]===Symbol.for("react.memo_cache_sentinel")?(t=(0,L.jsx)(q,{}),s[18]=t):t=s[18],t}let w;return s[19]!==v||s[20]!==j||s[21]!==I||s[22]!==p||s[23]!==T?(w=(0,L.jsx)(Q,{project:p,hosts:j,selectedHost:T,onSelectHost:x,client:v,isHostGone:I}),s[19]=v,s[20]=j,s[21]=I,s[22]=p,s[23]=T,s[24]=w):w=s[24],w}function O(t){return t?t.hosts.filter(t=>t.isOnline&&t.serverId.trim().length>0&&t.repoRoot.trim().length>0):[]}function A(){p.router.navigate((0,M.buildProjectsSettingsRoute)())}function q(){const s=(0,c.c)(12),{t:n}=(0,d.useTranslation)();let l,p,u,j,h,f;return s[0]===Symbol.for("react.memo_cache_sentinel")?(l=(0,L.jsx)($,{}),s[0]=l):l=s[0],s[1]!==n?(p=n("settings.project.noEditableTarget"),s[1]=n,s[2]=p):p=s[2],s[3]!==p?(u=(0,L.jsx)(o.Text,{style:ge.noTargetText,children:p}),s[3]=p,s[4]=u):u=s[4],s[5]!==n?(j=n("settings.project.backToProjects"),s[5]=n,s[6]=j):j=s[6],s[7]!==j?(h=(0,L.jsx)(y.Button,{testID:"project-settings-back-button",onPress:A,variant:"secondary",size:"md",children:j}),s[7]=j,s[8]=h):h=s[8],s[9]!==u||s[10]!==h?(f=(0,L.jsxs)(t.View,{style:ge.noTargetContainer,children:[l,u,h]}),s[9]=u,s[10]=h,s[11]=f):f=s[11],f}function $(){const t=(0,c.c)(7),{t:s}=(0,d.useTranslation)();let o,n,l;return t[0]!==s?(o=s("settings.project.backToProjects"),t[0]=s,t[1]=o):o=t[1],t[2]!==s?(n=s("settings.project.backToProjects"),t[2]=s,t[3]=n):n=t[3],t[4]!==o||t[5]!==n?(l=(0,L.jsx)(y.Button,{testID:"project-settings-back-link",accessibilityLabel:o,onPress:A,variant:"ghost",size:"sm",leftIcon:h.ArrowLeft,style:ge.backButton,children:n}),t[4]=o,t[5]=n,t[6]=l):l=t[6],l}function Q(s){const o=(0,c.c)(49),{project:n,hosts:l,selectedHost:d,onSelectHost:p,client:u,isHostGone:h}=s;let f;o[0]!==d.repoRoot||o[1]!==d.serverId?(f=["project-config",d.serverId,d.repoRoot],o[0]=d.repoRoot,o[1]=d.serverId,o[2]=f):f=o[2];const x=f;let y,b;o[3]!==u||o[4]!==d.repoRoot?(y=()=>u.readProjectConfig(d.repoRoot),o[3]=u,o[4]=d.repoRoot,o[5]=y):y=o[5],o[6]!==x||o[7]!==y?(b={queryKey:x,queryFn:y,retry:!1},o[6]=x,o[7]=y,o[8]=b):b=o[8];const _=(0,j.useQuery)(b),I=_.data;let S;o[9]!==n.projectKey||o[10]!==d.repoRoot||o[11]!==d.serverId?(S=[{serverId:d.serverId,projectKey:n.projectKey,iconWorkingDir:d.repoRoot}],o[9]=n.projectKey,o[10]=d.repoRoot,o[11]=d.serverId,o[12]=S):S=o[12];const T=S;let v;o[13]!==T?(v={projects:T},o[13]=T,o[14]=v):v=o[14];const w=(0,P.useProjectIconDataByProjectKey)(v);let D;o[15]!==n.projectKey||o[16]!==w?(D=w.get(n.projectKey)??null,o[15]=n.projectKey,o[16]=w,o[17]=D):D=o[17];const C=D;let R;if(o[18]!==u||o[19]!==I||o[20]!==l||o[21]!==h||o[22]!==p||o[23]!==n||o[24]!==C||o[25]!==x||o[26]!==_||o[27]!==d){const s=I?.ok?I.config??{}:null,c=I?.ok?I.revision:null,j=I&&!I.ok?I.error:null;let f;o[29]!==_?(f=()=>{_.refetch()},o[29]=_,o[30]=f):f=o[30];const y=f,b=l.length>1;let S,T,v,w,D,k;o[31]===Symbol.for("react.memo_cache_sentinel")?(S=(0,L.jsx)($,{}),o[31]=S):S=o[31],o[32]!==n.projectKey||o[33]!==n.projectName||o[34]!==C?(T=(0,L.jsx)(se,{iconDataUri:C,projectName:n.projectName,projectKey:n.projectKey}),o[32]=n.projectKey,o[33]=n.projectName,o[34]=C,o[35]=T):T=o[35],o[36]!==u||o[37]!==n?(v=(0,L.jsx)(te,{project:n,client:u}),o[36]=u,o[37]=n,o[38]=v):v=o[38],o[39]!==T||o[40]!==v?(w=(0,L.jsxs)(t.View,{style:ge.titleRow,children:[T,v]}),o[39]=T,o[40]=v,o[41]=w):w=o[41],o[42]!==l||o[43]!==p||o[44]!==d?(D=(0,L.jsx)(oe,{hosts:l,selectedHost:d,onSelectHost:p}),o[42]=l,o[43]=p,o[44]=d,o[45]=D):D=o[45],o[46]!==w||o[47]!==D?(k=(0,L.jsxs)(t.View,{style:ge.headerBlock,children:[w,D]}),o[46]=w,o[47]=D,o[48]=k):k=o[48],R=(0,L.jsxs)(t.View,{style:ge.body,children:[S,k,G({readQuery:_,loadedConfig:s,loadedRevision:c,readError:j,selectedHost:d,queryKey:x,client:u,onReload:y,hasMultipleHosts:b,isHostGone:h})]}),o[18]=u,o[19]=I,o[20]=l,o[21]=h,o[22]=p,o[23]=n,o[24]=C,o[25]=x,o[26]=_,o[27]=d,o[28]=R}else R=o[28];return R}function G({readQuery:s,loadedConfig:o,loadedRevision:n,readError:c,selectedHost:l,queryKey:d,client:p,onReload:u,hasMultipleHosts:j,isHostGone:h}){if(s.isLoading)return(0,L.jsx)(t.View,{style:ge.centered,children:(0,L.jsx)(S.LoadingSpinner,{color:ee()})});if(s.isError)return(0,L.jsx)(Y,{kind:"transport",error:s.error,onReload:u,hasMultipleHosts:j});if(c)return(0,L.jsx)(Y,{kind:c.code,error:null,onReload:u,hasMultipleHosts:j});if(h)return(0,L.jsx)(q,{});if(!o)return(0,L.jsx)(t.View,{style:ge.centered,children:(0,L.jsx)(S.LoadingSpinner,{color:ee()})});const f=`${l.serverId}::${l.repoRoot}::${U(n)}`;return(0,L.jsx)(Z,{baseConfig:o,revision:n,repoRoot:l.repoRoot,queryKey:d,client:p,onReload:u},f)}function U(t){return t?`${t.mtimeMs}-${t.size}`:"none"}function Y(s){const o=(0,c.c)(16),{kind:n,error:l,onReload:p,hasMultipleHosts:u}=s,{t:j}=(0,d.useTranslation)();let h;o[0]!==l||o[1]!==u||o[2]!==n||o[3]!==j?(h=X({kind:n,error:l,hasMultipleHosts:u,t:j}),o[0]=l,o[1]=u,o[2]=n,o[3]=j,o[4]=h):h=o[4];const{testID:f,title:x,description:b}=h,I=`${f}-action-0`;let S,T,v;return o[5]!==j?(S=j("settings.project.actions.reload"),o[5]=j,o[6]=S):S=o[6],o[7]!==p||o[8]!==I||o[9]!==S?(T=(0,L.jsx)(y.Button,{testID:I,onPress:p,variant:"outline",size:"sm",children:S}),o[7]=p,o[8]=I,o[9]=S,o[10]=T):T=o[10],o[11]!==b||o[12]!==T||o[13]!==f||o[14]!==x?(v=(0,L.jsx)(t.View,{style:ge.errorBlock,children:(0,L.jsx)(_.Alert,{testID:f,variant:"error",title:x,description:b,children:T})}),o[11]=b,o[12]=T,o[13]=f,o[14]=x,o[15]=v):v=o[15],v}function X(t){if("invalid_project_config"===t.kind)return{testID:"invalid-callout",title:t.t("settings.project.readFailures.invalidTitle"),description:t.t("settings.project.readFailures.invalidDescription")};if("project_not_found"===t.kind)return{testID:"project-not-found-callout",title:t.t("settings.project.readFailures.missingTitle"),description:t.hasMultipleHosts?t.t("settings.project.readFailures.missingWithHosts"):t.t("settings.project.readFailures.missingSingleHost")};if("transport"===t.kind){const s=J(t.error);return{testID:"read-transport-callout",title:t.t("settings.project.readFailures.transportTitle"),description:s??t.t("settings.project.readFailures.transportFallback")}}return{testID:"read-failed-callout",title:t.t("settings.project.readFailures.failedTitle"),description:t.t("settings.project.readFailures.failedDescription")}}function J(t){return t instanceof Error&&t.message.length>0?t.message:"string"==typeof t&&t.length>0?t:null}function Z(s){const p=(0,c.c)(150),{baseConfig:u,revision:f,repoRoot:x,queryKey:b,client:S,onReload:T}=s,{t:v}=(0,d.useTranslation)(),k=(0,j.useQueryClient)(),P=(0,E.useToast)();let z;p[0]!==u?(z=()=>(0,K.configToDraft)(u),p[0]=u,p[1]=z):z=p[1];const[M,N]=(0,l.useState)(z),[B,W]=(0,l.useState)(null),[O,A]=(0,l.useState)(null);let q,$,Q;p[2]!==S||p[3]!==x?(q=async t=>S.writeProjectConfig({repoRoot:x,config:t.config,expectedRevision:t.expectedRevision}),p[2]=S,p[3]=x,p[4]=q):q=p[4],p[5]!==k||p[6]!==b||p[7]!==x||p[8]!==v||p[9]!==P?($=t=>{if(t.ok){const s={ok:!0,config:t.config,revision:t.revision,requestId:"local-cache",repoRoot:x};k.setQueryData(b,s),W(null),k.invalidateQueries({queryKey:["projects"]}),P.show(v("settings.project.actions.saved"),{variant:"success"})}else W(t.error)},p[5]=k,p[6]=b,p[7]=x,p[8]=v,p[9]=P,p[10]=$):$=p[10],p[11]!==q||p[12]!==$?(Q={mutationFn:q,onSuccess:$},p[11]=q,p[12]=$,p[13]=Q):Q=p[13];const G=(0,j.useMutation)(Q);let U;p[14]!==u||p[15]!==M||p[16]!==f||p[17]!==G||p[18]!==B?.code?(U=()=>{if("stale_project_config"===B?.code)return;const t=(0,K.applyDraftToConfig)({draft:M,base:u});G.mutate({config:t,expectedRevision:f})},p[14]=u,p[15]=M,p[16]=f,p[17]=G,p[18]=B?.code,p[19]=U):U=p[19];const Y=U;let X;p[20]!==T?(X=()=>{W(null),T()},p[20]=T,p[21]=X):X=p[21];const J=X;let Z;p[22]===Symbol.for("react.memo_cache_sentinel")?(Z=t=>{N(s=>t(s))},p[22]=Z):Z=p[22];const ee=Z;let te;p[23]===Symbol.for("react.memo_cache_sentinel")?(te=t=>ee(s=>Object.assign({},s,{setupText:t})),p[23]=te):te=p[23];const se=te;let oe;p[24]===Symbol.for("react.memo_cache_sentinel")?(oe=t=>ee(s=>Object.assign({},s,{teardownText:t})),p[24]=oe):oe=p[24];const ne=oe;let re;p[25]===Symbol.for("react.memo_cache_sentinel")?(re=(t,s)=>ee(o=>Object.assign({},o,{metadataPrompts:Object.assign({},o.metadataPrompts,{[t]:s})})),p[25]=re):re=p[25];const ie=re;let ae;p[26]!==v?(ae=async t=>{await(0,H.confirmDialog)({title:v("settings.project.scripts.removeTitle"),message:v("settings.project.scripts.removeMessage",{name:t.name||v("settings.project.scripts.removeFallbackName")}),confirmLabel:v("settings.project.scripts.actions.remove"),cancelLabel:v("settings.project.actions.cancel"),destructive:!0})&&ee(s=>Object.assign({},s,{scripts:s.scripts.filter(s=>s.id!==t.id)}))},p[26]=v,p[27]=ae):ae=p[27];const pe=ae;let ue;p[28]===Symbol.for("react.memo_cache_sentinel")?(ue=t=>{A(t.id)},p[28]=ue):ue=p[28];const je=ue;let he;p[29]===Symbol.for("react.memo_cache_sentinel")?(he=()=>{const t=`script-draft-new-${Date.now()}`;ee(s=>Object.assign({},s,{scripts:[...s.scripts,{id:t,name:"",commandText:"",commandOriginalKind:"missing",type:"",portText:"",rawEntry:{}}]})),A(t)},p[29]=he):he=p[29];const fe=he;let xe;p[30]===Symbol.for("react.memo_cache_sentinel")?(xe=t=>{ee(s=>Object.assign({},s,{scripts:s.scripts.map(s=>s.id===t.id?t:s)}))},p[30]=xe):xe=p[30];const ye=xe;let be;p[31]!==O?(be=()=>{O&&(ee(t=>{const s=t.scripts.find(t=>t.id===O);if(!s)return t;return 0===s.name.trim().length&&0===s.commandText.trim().length&&0===s.type.trim().length&&0===s.portText.trim().length?Object.assign({},t,{scripts:t.scripts.filter(t=>t.id!==O)}):t}),A(null))},p[31]=O,p[32]=be):be=p[32];const _e=be;let Ie;p[33]===Symbol.for("react.memo_cache_sentinel")?(Ie=()=>{A(null)},p[33]=Ie):Ie=p[33];const Se=Ie;let Te;if(p[34]!==M.scripts||p[35]!==O){let t;p[37]!==O?(t=t=>t.id===O,p[37]=O,p[38]=t):t=p[38],Te=M.scripts.find(t),p[34]=M.scripts,p[35]=O,p[36]=Te}else Te=p[36];const ve=Te;let we;if(p[39]!==M.scripts||p[40]!==v){let t;p[42]!==v?(t=t=>de(t,v).hasErrors,p[42]=v,p[43]=t):t=p[43],we=M.scripts.some(t),p[39]=M.scripts,p[40]=v,p[41]=we}else we=p[41];const De=we;let Ce,Re,ke;p[44]!==v?(Ce=v("settings.project.scripts.actions.add"),p[44]=v,p[45]=Ce):Ce=p[45],p[46]===Symbol.for("react.memo_cache_sentinel")?(Re=(0,L.jsx)(h.Plus,{size:V,color:ge.iconColor.color}),p[46]=Re):Re=p[46],p[47]!==Ce?(ke=(0,L.jsx)(n.Pressable,{onPress:fe,hitSlop:8,style:R.settingsStyles.sectionHeaderLink,accessibilityRole:"button",accessibilityLabel:Ce,testID:"scripts-add-button",children:Re}),p[47]=Ce,p[48]=ke):ke=p[48];const Pe=ke;let ze,Ee,He;p[49]!==v?(ze=v("settings.project.worktree.docs"),p[49]=v,p[50]=ze):ze=p[50],p[51]!==v?(Ee=v("settings.project.worktree.docsTooltip"),p[51]=v,p[52]=Ee):Ee=p[52],p[53]!==ze||p[54]!==Ee?(He=(0,L.jsx)(I.ExternalLink,{href:F,label:ze,tooltip:Ee,testID:"worktree-setup-docs-link"}),p[53]=ze,p[54]=Ee,p[55]=He):He=p[55];const Ke=He;let Me,Le,Ne;p[56]!==v?(Me=v("settings.project.worktree.docs"),p[56]=v,p[57]=Me):Me=p[57],p[58]!==v?(Le=v("settings.project.worktree.docsTooltip"),p[58]=v,p[59]=Le):Le=p[59],p[60]!==Me||p[61]!==Le?(Ne=(0,L.jsx)(I.ExternalLink,{href:F,label:Me,tooltip:Le,testID:"worktree-teardown-docs-link"}),p[60]=Me,p[61]=Le,p[62]=Ne):Ne=p[62];const Ve=Ne,Be="stale_project_config"===B?.code,Fe="write_failed"===B?.code,We=G.isPending||Be||De;let Oe,Ae,qe,$e,Qe,Ge,Ue,Ye,Xe,Je,Ze,et,tt,st,ot,nt,rt,it,ct,lt,at,dt,pt,ut,mt,gt,jt;return p[63]!==v?(Oe=v("settings.project.worktree.title"),p[63]=v,p[64]=Oe):Oe=p[64],p[65]!==v?(Ae=v("settings.project.worktree.info"),p[65]=v,p[66]=Ae):Ae=p[66],p[67]!==v?(qe=v("settings.project.worktree.setup"),p[67]=v,p[68]=qe):qe=p[68],p[69]!==v?($e=v("settings.project.worktree.setupAccessibility"),p[69]=v,p[70]=$e):$e=p[70],p[71]!==M.setupText||p[72]!==$e?(Qe=(0,L.jsx)(w.SettingsTextAreaCard,{testID:"worktree-setup-input",accessibilityLabel:$e,value:M.setupText,onChangeText:se,placeholder:"npm install"}),p[71]=M.setupText,p[72]=$e,p[73]=Qe):Qe=p[73],p[74]!==Ke||p[75]!==qe||p[76]!==Qe?(Ge=(0,L.jsx)(C.SettingsSection,{title:qe,testID:"worktree-setup-section",trailing:Ke,children:Qe}),p[74]=Ke,p[75]=qe,p[76]=Qe,p[77]=Ge):Ge=p[77],p[78]!==v?(Ue=v("settings.project.worktree.teardown"),p[78]=v,p[79]=Ue):Ue=p[79],p[80]!==v?(Ye=v("settings.project.worktree.teardownAccessibility"),p[80]=v,p[81]=Ye):Ye=p[81],p[82]!==M.teardownText||p[83]!==Ye?(Xe=(0,L.jsx)(w.SettingsTextAreaCard,{testID:"worktree-teardown-input",accessibilityLabel:Ye,value:M.teardownText,onChangeText:ne,placeholder:"docker compose down"}),p[82]=M.teardownText,p[83]=Ye,p[84]=Xe):Xe=p[84],p[85]!==Ue||p[86]!==Xe||p[87]!==Ve?(Je=(0,L.jsx)(C.SettingsSection,{title:Ue,testID:"worktree-teardown-section",trailing:Ve,flush:!0,children:Xe}),p[85]=Ue,p[86]=Xe,p[87]=Ve,p[88]=Je):Je=p[88],p[89]!==Oe||p[90]!==Ae||p[91]!==Ge||p[92]!==Je?(Ze=(0,L.jsxs)(D.SettingsGroup,{title:Oe,info:Ae,testID:"worktree-group",children:[Ge,Je]}),p[89]=Oe,p[90]=Ae,p[91]=Ge,p[92]=Je,p[93]=Ze):Ze=p[93],p[94]!==v?(et=v("settings.project.scripts.title"),p[94]=v,p[95]=et):et=p[95],p[96]!==v?(tt=v("settings.project.scripts.info"),p[96]=v,p[97]=tt):tt=p[97],p[98]!==M.scripts||p[99]!==pe||p[100]!==v?(st=0===M.scripts.length?(0,L.jsx)(t.View,{style:R.settingsStyles.row,children:(0,L.jsx)(o.Text,{style:ge.emptyScripts,children:v("settings.project.scripts.empty")})}):M.scripts.map((t,s)=>(0,L.jsx)(le,{script:t,isFirst:0===s,onEdit:je,onRemove:pe},t.id)),p[98]=M.scripts,p[99]=pe,p[100]=v,p[101]=st):st=p[101],p[102]!==st?(ot=(0,L.jsx)(t.View,{style:R.settingsStyles.card,testID:"scripts-list",children:st}),p[102]=st,p[103]=ot):ot=p[103],p[104]!==Pe||p[105]!==et||p[106]!==tt||p[107]!==ot?(nt=(0,L.jsx)(D.SettingsGroup,{title:et,info:tt,trailing:Pe,testID:"scripts-group",children:ot}),p[104]=Pe,p[105]=et,p[106]=tt,p[107]=ot,p[108]=nt):nt=p[108],p[109]!==v?(rt=v("settings.project.metadata.title"),p[109]=v,p[110]=rt):rt=p[110],p[111]!==v?(it=v("settings.project.metadata.info"),p[111]=v,p[112]=it):it=p[112],p[113]!==M.metadataPrompts?(ct=K.METADATA_PROMPT_KEYS.map((t,s)=>(0,L.jsx)(ce,{promptKey:t,value:M.metadataPrompts[t],onChange:ie,flush:s===K.METADATA_PROMPT_KEYS.length-1},t)),p[113]=M.metadataPrompts,p[114]=ct):ct=p[114],p[115]!==rt||p[116]!==it||p[117]!==ct?(lt=(0,L.jsx)(D.SettingsGroup,{title:rt,info:it,testID:"metadata-group",children:ct}),p[115]=rt,p[116]=it,p[117]=ct,p[118]=lt):lt=p[118],p[119]!==J||p[120]!==Be||p[121]!==v?(at=Be?(0,L.jsx)(t.View,{style:ge.calloutWrap,children:(0,L.jsx)(_.Alert,{testID:"stale-callout",variant:"error",title:v("settings.project.writeFailures.staleTitle"),description:v("settings.project.writeFailures.staleDescription"),children:(0,L.jsx)(y.Button,{testID:"stale-callout-action-0",onPress:J,variant:"outline",size:"sm",children:v("settings.project.actions.reload")})})}):null,p[119]=J,p[120]=Be,p[121]=v,p[122]=at):at=p[122],p[123]!==J||p[124]!==Y||p[125]!==Fe||p[126]!==v?(dt=Fe?(0,L.jsx)(t.View,{style:ge.calloutWrap,children:(0,L.jsxs)(_.Alert,{testID:"write-failed-callout",variant:"error",title:v("settings.project.writeFailures.failedTitle"),description:v("settings.project.writeFailures.failedDescription"),children:[(0,L.jsx)(y.Button,{testID:"write-failed-callout-action-0",onPress:Y,variant:"outline",size:"sm",children:v("settings.project.actions.tryAgain")}),(0,L.jsx)(y.Button,{testID:"write-failed-callout-action-1",onPress:J,variant:"outline",size:"sm",children:v("settings.project.actions.reload")})]})}):null,p[123]=J,p[124]=Y,p[125]=Fe,p[126]=v,p[127]=dt):dt=p[127],p[128]!==v?(pt=v("settings.project.actions.save"),p[128]=v,p[129]=pt):pt=p[129],p[130]!==G.isPending||p[131]!==v?(ut=G.isPending?v("settings.project.actions.saving"):v("settings.project.actions.save"),p[130]=G.isPending,p[131]=v,p[132]=ut):ut=p[132],p[133]!==Y||p[134]!==We||p[135]!==G.isPending||p[136]!==pt||p[137]!==ut?(mt=(0,L.jsx)(t.View,{style:ge.footer,children:(0,L.jsx)(y.Button,{testID:"save-button",accessibilityLabel:pt,variant:"default",size:"md",disabled:We,loading:G.isPending,onPress:Y,children:ut})}),p[133]=Y,p[134]=We,p[135]=G.isPending,p[136]=pt,p[137]=ut,p[138]=mt):mt=p[138],p[139]!==ve||p[140]!==_e?(gt=ve?(0,L.jsx)(me,{script:ve,onChange:ye,onCancel:_e,onSave:Se}):null,p[139]=ve,p[140]=_e,p[141]=gt):gt=p[141],p[142]!==Ze||p[143]!==nt||p[144]!==lt||p[145]!==at||p[146]!==dt||p[147]!==mt||p[148]!==gt?(jt=(0,L.jsxs)(t.View,{children:[Ze,nt,lt,at,dt,mt,gt]}),p[142]=Ze,p[143]=nt,p[144]=lt,p[145]=at,p[146]=dt,p[147]=mt,p[148]=gt,p[149]=jt):jt=p[149],jt}function ee(){return ge.spinnerColor.color}function te(p){const u=(0,c.c)(67),{project:f,client:x}=p,{t:y}=(0,d.useTranslation)(),b=(0,j.useQueryClient)(),_=(0,E.useToast)(),[I,S]=(0,l.useState)(!1),[T,v]=(0,l.useState)(f.projectCustomName??"");let w,D,C,R;u[0]!==x||u[1]!==f.projectKey?(w=t=>x.renameProject(f.projectKey,t),u[0]=x,u[1]=f.projectKey,u[2]=w):w=u[2],u[3]!==b||u[4]!==y||u[5]!==_?(D=()=>{b.invalidateQueries({queryKey:["projects"]}),S(!1),_.show(y("settings.project.rename.renamedToast"),{variant:"success"})},u[3]=b,u[4]=y,u[5]=_,u[6]=D):D=u[6],u[7]!==y||u[8]!==_?(C=t=>{const s=t instanceof Error?t.message:y("settings.project.rename.errorFallback");_.show(s,{variant:"error"})},u[7]=y,u[8]=_,u[9]=C):C=u[9],u[10]!==w||u[11]!==D||u[12]!==C?(R={mutationFn:w,onSuccess:D,onError:C},u[10]=w,u[11]=D,u[12]=C,u[13]=R):R=u[13];const k=(0,j.useMutation)(R);let P;u[14]!==f.projectCustomName?(P=()=>{v(f.projectCustomName??""),S(!0)},u[14]=f.projectCustomName,u[15]=P):P=u[15];const z=P;let H;u[16]!==f.projectCustomName?(H=()=>{S(!1),v(f.projectCustomName??"")},u[16]=f.projectCustomName,u[17]=H):H=u[17];const K=H;let M;u[18]!==f.projectCustomName||u[19]!==k||u[20]!==T?(M=()=>{const t=T.trim(),s=0===t.length?null:t;s!==(f.projectCustomName??null)?k.mutate(s):S(!1)},u[18]=f.projectCustomName,u[19]=k,u[20]=T,u[21]=M):M=u[21];const N=M;let B;u[22]!==k?(B=()=>{k.mutate(null)},u[22]=k,u[23]=B):B=u[23];const F=B;if(!I){let s,c,l,d,p,j;return u[24]!==f.projectName?(s=(0,L.jsx)(o.Text,{style:ge.projectTitle,numberOfLines:1,children:f.projectName}),u[24]=f.projectName,u[25]=s):s=u[25],u[26]!==y?(c=y("settings.project.rename.renameLabel"),u[26]=y,u[27]=c):c=u[27],u[28]===Symbol.for("react.memo_cache_sentinel")?(l=(0,L.jsx)(h.Pencil,{size:V,color:ge.iconColor.color}),u[28]=l):l=u[28],u[29]!==z||u[30]!==c?(d=(0,L.jsx)(n.Pressable,{testID:"project-name-edit-button",accessibilityLabel:c,onPress:z,hitSlop:8,style:ge.nameEditorIconButton,children:l}),u[29]=z,u[30]=c,u[31]=d):d=u[31],u[32]!==F||u[33]!==f.projectCustomName||u[34]!==k.isPending||u[35]!==y?(p=f.projectCustomName?(0,L.jsx)(n.Pressable,{testID:"project-name-reset-button",accessibilityLabel:y("settings.project.rename.resetLabel"),onPress:F,disabled:k.isPending,hitSlop:8,style:ge.nameEditorResetButton,children:(0,L.jsx)(o.Text,{style:ge.nameEditorResetText,children:y("settings.project.rename.reset")})}):null,u[32]=F,u[33]=f.projectCustomName,u[34]=k.isPending,u[35]=y,u[36]=p):p=u[36],u[37]!==d||u[38]!==p||u[39]!==s?(j=(0,L.jsxs)(t.View,{style:ge.nameEditorRow,children:[s,d,p]}),u[37]=d,u[38]=p,u[39]=s,u[40]=j):j=u[40],j}let W;u[41]!==y?(W=y("settings.project.rename.projectNameLabel"),u[41]=y,u[42]=W):W=u[42];const O=!k.isPending;let A,q,$,Q,G,U,Y,X;return u[43]!==N||u[44]!==f.projectName||u[45]!==O||u[46]!==W||u[47]!==T?(A=(0,L.jsx)(s.TextInput,{testID:"project-name-input",accessibilityLabel:W,value:T,onChangeText:v,placeholder:f.projectName,placeholderTextColor:ge.placeholderColor.color,autoFocus:!0,style:ge.nameEditorInput,editable:O,onSubmitEditing:N,returnKeyType:"done"}),u[43]=N,u[44]=f.projectName,u[45]=O,u[46]=W,u[47]=T,u[48]=A):A=u[48],u[49]!==y?(q=y("settings.project.rename.saveLabel"),u[49]=y,u[50]=q):q=u[50],u[51]===Symbol.for("react.memo_cache_sentinel")?($=(0,L.jsx)(h.Check,{size:V,color:ge.iconColor.color}),u[51]=$):$=u[51],u[52]!==N||u[53]!==k.isPending||u[54]!==q?(Q=(0,L.jsx)(n.Pressable,{testID:"project-name-save-button",accessibilityLabel:q,onPress:N,disabled:k.isPending,hitSlop:8,style:ge.nameEditorIconButton,children:$}),u[52]=N,u[53]=k.isPending,u[54]=q,u[55]=Q):Q=u[55],u[56]!==y?(G=y("settings.project.rename.cancelLabel"),u[56]=y,u[57]=G):G=u[57],u[58]===Symbol.for("react.memo_cache_sentinel")?(U=(0,L.jsx)(h.X,{size:V,color:ge.iconColor.color}),u[58]=U):U=u[58],u[59]!==K||u[60]!==k.isPending||u[61]!==G?(Y=(0,L.jsx)(n.Pressable,{testID:"project-name-cancel-button",accessibilityLabel:G,onPress:K,disabled:k.isPending,hitSlop:8,style:ge.nameEditorIconButton,children:U}),u[59]=K,u[60]=k.isPending,u[61]=G,u[62]=Y):Y=u[62],u[63]!==A||u[64]!==Q||u[65]!==Y?(X=(0,L.jsxs)(t.View,{style:ge.nameEditorRow,children:[A,Q,Y]}),u[63]=A,u[64]=Q,u[65]=Y,u[66]=X):X=u[66],X}function se(t){const s=(0,c.c)(6),{iconDataUri:o,projectName:n,projectKey:l}=t;let d;s[0]!==n?(d=n.trim().charAt(0).toUpperCase()||"?",s[0]=n,s[1]=d):d=s[1];const p=d;let u;return s[2]!==o||s[3]!==p||s[4]!==l?(u=(0,L.jsx)(f.ProjectIconView,{iconDataUri:o,initial:p,projectKey:l,imageStyle:ge.titleIcon,fallbackStyle:ge.titleIconFallback,textStyle:ge.titleIconFallbackText}),s[2]=o,s[3]=p,s[4]=l,s[5]=u):u=s[5],u}function oe(s){const n=(0,c.c)(11),{hosts:l,selectedHost:d,onSelectHost:p}=s;if(l.length>1){let t;return n[0]!==l||n[1]!==p||n[2]!==d?(t=(0,L.jsx)(ne,{hosts:l,selectedHost:d,onSelectHost:p}),n[0]=l,n[1]=p,n[2]=d,n[3]=t):t=n[3],t}let u,j,h;return n[4]!==d.serverId?(u=(0,L.jsx)(x.HostStatusDotSlot,{serverId:d.serverId}),n[4]=d.serverId,n[5]=u):u=n[5],n[6]!==d.serverName?(j=(0,L.jsx)(o.Text,{style:ge.hostName,numberOfLines:1,children:d.serverName}),n[6]=d.serverName,n[7]=j):j=n[7],n[8]!==u||n[9]!==j?(h=(0,L.jsxs)(t.View,{testID:"host-indicator",style:ge.hostIndicator,children:[u,j]}),n[8]=u,n[9]=j,n[10]=h):h=n[10],h}function ne(t){const s=(0,c.c)(23),{hosts:p,selectedHost:u,onSelectHost:j}=t,{t:f}=(0,d.useTranslation)(),[y,b]=(0,l.useState)(!1),_=(0,l.useRef)(null);let I;s[0]!==p?(I=p.map(ie),s[0]=p,s[1]=I):I=s[1];const S=I;let T;s[2]===Symbol.for("react.memo_cache_sentinel")?(T=()=>b(!0),s[2]=T):T=s[2];const v=T,w=re,D=u.serverId;let C,R,k,P,z,E,H;return s[3]!==f?(C=f("settings.project.switchHost"),s[3]=f,s[4]=C):C=s[4],s[5]!==f?(R=f("settings.project.switchHost"),s[5]=f,s[6]=R):R=s[6],s[7]!==u.serverId?(k=(0,L.jsx)(x.HostStatusDotSlot,{serverId:u.serverId}),s[7]=u.serverId,s[8]=k):k=s[8],s[9]!==u.serverName?(P=(0,L.jsx)(o.Text,{style:ge.hostName,numberOfLines:1,children:u.serverName}),s[9]=u.serverName,s[10]=P):P=s[10],s[11]===Symbol.for("react.memo_cache_sentinel")?(z=(0,L.jsx)(h.ChevronDown,{size:V,color:ge.chevronColor.color}),s[11]=z):z=s[11],s[12]!==R||s[13]!==k||s[14]!==P?(E=(0,L.jsxs)(n.Pressable,{ref:_,accessibilityLabel:R,testID:"host-picker",style:ge.hostIndicator,onPress:v,children:[k,P,z]}),s[12]=R,s[13]=k,s[14]=P,s[15]=E):E=s[15],s[16]!==S||s[17]!==j||s[18]!==y||s[19]!==u.serverId||s[20]!==C||s[21]!==E?(H=(0,L.jsx)(x.HostPicker,{hosts:S,value:D,onSelect:j,open:y,onOpenChange:b,anchorRef:_,searchable:!1,title:C,desktopPlacement:"bottom-start",desktopMinWidth:240,hostOptionTestID:w,children:E}),s[16]=S,s[17]=j,s[18]=y,s[19]=u.serverId,s[20]=C,s[21]=E,s[22]=H):H=s[22],H}function re(t){return`host-picker-item-${t}`}function ie(t){return{serverId:t.serverId,label:t.serverName}}function ce(t){const s=(0,c.c)(20),{promptKey:o,value:n,onChange:l,flush:p}=t,{t:u}=(0,d.useTranslation)(),j=B[o];let h;s[0]!==j.titleKey||s[1]!==u?(h=u(j.titleKey),s[0]=j.titleKey,s[1]=u,s[2]=h):h=s[2];const f=h;let x;s[3]!==l||s[4]!==o?(x=t=>l(o,t),s[3]=l,s[4]=o,s[5]=x):x=s[5];const y=x,b=j.sectionTestID,_=j.inputTestID;let I,S,T;return s[6]!==j.placeholderKey||s[7]!==u?(I=u(j.placeholderKey),s[6]=j.placeholderKey,s[7]=u,s[8]=I):I=s[8],s[9]!==y||s[10]!==j.inputTestID||s[11]!==I||s[12]!==f||s[13]!==n?(S=(0,L.jsx)(w.SettingsTextAreaCard,{testID:_,accessibilityLabel:f,value:n,onChangeText:y,placeholder:I}),s[9]=y,s[10]=j.inputTestID,s[11]=I,s[12]=f,s[13]=n,s[14]=S):S=s[14],s[15]!==p||s[16]!==j.sectionTestID||s[17]!==S||s[18]!==f?(T=(0,L.jsx)(C.SettingsSection,{title:f,testID:b,flush:p,children:S}),s[15]=p,s[16]=j.sectionTestID,s[17]=S,s[18]=f,s[19]=T):T=s[19],T}function le(s){const l=(0,c.c)(49),{script:p,isFirst:u,onEdit:j,onRemove:f}=s,{t:x}=(0,d.useTranslation)();let y;l[0]!==j||l[1]!==p?(y=()=>j(p),l[0]=j,l[1]=p,l[2]=y):y=l[2];const _=y;let I;l[3]!==f||l[4]!==p?(I=()=>f(p),l[3]=f,l[4]=p,l[5]=I):I=l[5];const S=I,T=u?ge.scriptRow:ge.scriptRowWithBorder,v=`script-row-${p.id}`;let w,D,C,k,P,z;l[6]!==p.name||l[7]!==x?(w=p.name||x("settings.project.scripts.untitled"),l[6]=p.name,l[7]=x,l[8]=w):w=l[8],l[9]!==w?(D=(0,L.jsx)(o.Text,{style:R.settingsStyles.rowTitle,numberOfLines:1,children:w}),l[9]=w,l[10]=D):D=l[10],l[11]!==p||l[12]!==x?(C=ae(p,x),l[11]=p,l[12]=x,l[13]=C):C=l[13],l[14]!==C?(k=(0,L.jsx)(o.Text,{style:R.settingsStyles.rowHint,numberOfLines:1,children:C}),l[14]=C,l[15]=k):k=l[15],l[16]!==_||l[17]!==D||l[18]!==k?(P=(0,L.jsxs)(n.Pressable,{style:ge.scriptRowMain,onPress:_,children:[D,k]}),l[16]=_,l[17]=D,l[18]=k,l[19]=P):P=l[19],l[20]!==x?(z=x("settings.project.scripts.menuAccessibility"),l[20]=x,l[21]=z):z=l[21];const E=`script-row-menu-${p.id}`;let H,K;l[22]===Symbol.for("react.memo_cache_sentinel")?(H=(0,L.jsx)(h.MoreVertical,{size:V,color:ge.chevronColor.color}),l[22]=H):H=l[22],l[23]!==E||l[24]!==z?(K=(0,L.jsx)(b.DropdownMenuTrigger,{accessibilityLabel:z,testID:E,style:ge.scriptKebab,children:H}),l[23]=E,l[24]=z,l[25]=K):K=l[25];const M=`script-action-${p.id}-edit`;let N,B;l[26]!==x?(N=x("settings.project.scripts.actions.edit"),l[26]=x,l[27]=N):N=l[27],l[28]!==_||l[29]!==M||l[30]!==N?(B=(0,L.jsx)(b.DropdownMenuItem,{testID:M,onSelect:_,children:N}),l[28]=_,l[29]=M,l[30]=N,l[31]=B):B=l[31];const F=`script-action-${p.id}-remove`;let W,O,A,q,$;return l[32]!==x?(W=x("settings.project.scripts.actions.remove"),l[32]=x,l[33]=W):W=l[33],l[34]!==S||l[35]!==F||l[36]!==W?(O=(0,L.jsx)(b.DropdownMenuItem,{testID:F,destructive:!0,onSelect:S,children:W}),l[34]=S,l[35]=F,l[36]=W,l[37]=O):O=l[37],l[38]!==B||l[39]!==O?(A=(0,L.jsxs)(b.DropdownMenuContent,{align:"end",minWidth:160,children:[B,O]}),l[38]=B,l[39]=O,l[40]=A):A=l[40],l[41]!==K||l[42]!==A?(q=(0,L.jsxs)(b.DropdownMenu,{children:[K,A]}),l[41]=K,l[42]=A,l[43]=q):q=l[43],l[44]!==T||l[45]!==q||l[46]!==v||l[47]!==P?($=(0,L.jsxs)(t.View,{style:T,testID:v,children:[P,q]}),l[44]=T,l[45]=q,l[46]=v,l[47]=P,l[48]=$):$=l[48],$}function ae(t,s){const o=[];return t.type&&o.push(t.type),t.portText&&o.push(s("settings.project.scripts.port",{port:t.portText})),t.commandText&&o.push(t.commandText.split("\n")[0]??""),o.join(" \xb7 ")}function de(t,s){const o=0===t.name.trim().length?s("settings.project.scripts.nameRequired"):null,n=0===t.commandText.trim().length?s("settings.project.scripts.commandRequired"):null;return{hasErrors:Boolean(o||n),nameError:o,commandError:n}}const pe={name:!0,command:!0},ue={name:!1,command:!1};function me(n){const p=(0,c.c)(100),{script:u,onChange:j,onCancel:h,onSave:f}=n,{t:x}=(0,d.useTranslation)(),[b,_]=(0,l.useState)(ue);let I,S,w;p[0]===Symbol.for("react.memo_cache_sentinel")?(I=()=>{_(ue)},p[0]=I):I=p[0],p[1]!==u.id?(S=[u.id],p[1]=u.id,p[2]=S):S=p[2],(0,l.useEffect)(I,S),p[3]===Symbol.for("react.memo_cache_sentinel")?(w=t=>{_(s=>s[t]?s:Object.assign({},s,{[t]:!0}))},p[3]=w):w=p[3];const D=w;let C;p[4]!==j||p[5]!==u?(C=t=>j(Object.assign({},u,{name:t})),p[4]=j,p[5]=u,p[6]=C):C=p[6];const R=C;let k;p[7]!==j||p[8]!==u?(k=t=>j(Object.assign({},u,{commandText:t})),p[7]=j,p[8]=u,p[9]=k):k=p[9];const P=k;let z;p[10]!==j||p[11]!==u?(z=t=>j(Object.assign({},u,{type:t?N:""})),p[10]=j,p[11]=u,p[12]=z):z=p[12];const E=z;let H;p[13]===Symbol.for("react.memo_cache_sentinel")?(H=()=>D("name"),p[13]=H):H=p[13];const K=H;let M;p[14]===Symbol.for("react.memo_cache_sentinel")?(M=()=>D("command"),p[14]=M):M=p[14];const V=M;let B;p[15]!==u||p[16]!==x?(B=de(u,x),p[15]=u,p[16]=x,p[17]=B):B=p[17];const F=B;let W;p[18]!==f||p[19]!==F.hasErrors?(W=()=>{F.hasErrors?_(pe):f()},p[18]=f,p[19]=F.hasErrors,p[20]=W):W=p[20];const O=W,A=b.name&&F.nameError,q=b.command&&F.commandError,$=u.type===N;let Q,G;p[21]!==u.name||p[22]!==x?(Q=u.name?x("settings.project.scripts.editScript",{name:u.name}):x("settings.project.scripts.newScript"),p[21]=u.name,p[22]=x,p[23]=Q):Q=p[23],p[24]!==Q?(G={title:Q},p[24]=Q,p[25]=G):G=p[25];const U=G;let Y,X,J,Z,ee,te,se,oe,ne,re,ie,ce,le,ae,me,je,he,fe,xe,ye,be,_e,Ie,Se,Te,ve;return p[26]!==x?(Y=x("settings.project.scripts.name"),p[26]=x,p[27]=Y):Y=p[27],p[28]!==Y?(X=(0,L.jsx)(o.Text,{style:ge.modalLabel,children:Y}),p[28]=Y,p[29]=X):X=p[29],p[30]!==x?(J=x("settings.project.scripts.nameAccessibility"),p[30]=x,p[31]=J):J=p[31],p[32]!==R||p[33]!==u.name||p[34]!==J?(Z=(0,L.jsx)(s.TextInput,{testID:"script-edit-name",accessibilityLabel:J,value:u.name,onChangeText:R,onBlur:K,placeholder:"dev",placeholderTextColor:ge.placeholderColor.color,style:ge.modalInput}),p[32]=R,p[33]=u.name,p[34]=J,p[35]=Z):Z=p[35],p[36]!==A||p[37]!==F.nameError?(ee=A?(0,L.jsx)(o.Text,{testID:"script-edit-name-error",style:ge.fieldError,children:F.nameError}):null,p[36]=A,p[37]=F.nameError,p[38]=ee):ee=p[38],p[39]!==X||p[40]!==Z||p[41]!==ee?(te=(0,L.jsxs)(t.View,{style:ge.modalSection,children:[X,Z,ee]}),p[39]=X,p[40]=Z,p[41]=ee,p[42]=te):te=p[42],p[43]!==x?(se=x("settings.project.scripts.command"),p[43]=x,p[44]=se):se=p[44],p[45]!==se?(oe=(0,L.jsx)(o.Text,{style:ge.modalLabel,children:se}),p[45]=se,p[46]=oe):oe=p[46],p[47]!==x?(ne=x("settings.project.scripts.commandAccessibility"),p[47]=x,p[48]=ne):ne=p[48],p[49]!==P||p[50]!==u.commandText||p[51]!==ne?(re=(0,L.jsx)(s.TextInput,{testID:"script-edit-command",accessibilityLabel:ne,multiline:!0,value:u.commandText,onChangeText:P,onBlur:V,placeholder:"npm run dev",placeholderTextColor:ge.placeholderColor.color,style:ge.modalMultilineInput}),p[49]=P,p[50]=u.commandText,p[51]=ne,p[52]=re):re=p[52],p[53]!==q||p[54]!==F.commandError?(ie=q?(0,L.jsx)(o.Text,{testID:"script-edit-command-error",style:ge.fieldError,children:F.commandError}):null,p[53]=q,p[54]=F.commandError,p[55]=ie):ie=p[55],p[56]!==oe||p[57]!==re||p[58]!==ie?(ce=(0,L.jsxs)(t.View,{style:ge.modalSection,children:[oe,re,ie]}),p[56]=oe,p[57]=re,p[58]=ie,p[59]=ce):ce=p[59],p[60]!==x?(le=x("settings.project.scripts.runAsService"),p[60]=x,p[61]=le):le=p[61],p[62]!==le?(ae=(0,L.jsx)(o.Text,{style:ge.serviceToggleLabel,children:le}),p[62]=le,p[63]=ae):ae=p[63],p[64]!==x?(me=x("settings.project.scripts.serviceHint"),p[64]=x,p[65]=me):me=p[65],p[66]!==me?(je=(0,L.jsx)(o.Text,{style:ge.modalHint,children:me}),p[66]=me,p[67]=je):je=p[67],p[68]!==ae||p[69]!==je?(he=(0,L.jsxs)(t.View,{style:ge.serviceToggleText,children:[ae,je]}),p[68]=ae,p[69]=je,p[70]=he):he=p[70],p[71]!==x?(fe=x("settings.project.scripts.runAsService"),p[71]=x,p[72]=fe):fe=p[72],p[73]!==E||p[74]!==$||p[75]!==fe?(xe=(0,L.jsx)(T.Switch,{value:$,onValueChange:E,accessibilityLabel:fe,testID:"script-edit-service-toggle"}),p[73]=E,p[74]=$,p[75]=fe,p[76]=xe):xe=p[76],p[77]!==he||p[78]!==xe?(ye=(0,L.jsx)(t.View,{style:ge.modalSection,children:(0,L.jsxs)(t.View,{style:ge.serviceToggleRow,children:[he,xe]})}),p[77]=he,p[78]=xe,p[79]=ye):ye=p[79],p[80]!==x?(be=x("settings.project.actions.cancel"),p[80]=x,p[81]=be):be=p[81],p[82]!==h||p[83]!==be?(_e=(0,L.jsx)(y.Button,{onPress:h,variant:"ghost",size:"md",testID:"script-edit-cancel",children:be}),p[82]=h,p[83]=be,p[84]=_e):_e=p[84],p[85]!==x?(Ie=x("settings.project.actions.save"),p[85]=x,p[86]=Ie):Ie=p[86],p[87]!==O||p[88]!==Ie?(Se=(0,L.jsx)(y.Button,{onPress:O,variant:"default",size:"md",testID:"script-edit-save",children:Ie}),p[87]=O,p[88]=Ie,p[89]=Se):Se=p[89],p[90]!==_e||p[91]!==Se?(Te=(0,L.jsxs)(t.View,{style:ge.modalFooter,children:[_e,Se]}),p[90]=_e,p[91]=Se,p[92]=Te):Te=p[92],p[93]!==h||p[94]!==U||p[95]!==te||p[96]!==ce||p[97]!==ye||p[98]!==Te?(ve=(0,L.jsxs)(v.AdaptiveModalSheet,{visible:!0,header:U,onClose:h,testID:"script-edit-modal",desktopMaxWidth:560,children:[te,ce,ye,Te]}),p[93]=h,p[94]=U,p[95]=te,p[96]=ce,p[97]=ye,p[98]=Te,p[99]=ve):ve=p[99],ve}const ge=u.StyleSheet.create(t=>({noTargetContainer:{padding:t.spacing[4],alignItems:"flex-start",gap:t.spacing[3],uni__dependencies:[0]},noTargetText:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,uni__dependencies:[0]},body:{padding:t.spacing[4],gap:t.spacing[2],uni__dependencies:[0]},backButton:{alignSelf:"flex-start",paddingHorizontal:0},headerBlock:{marginTop:t.spacing[2],marginBottom:t.spacing[4],gap:t.spacing[2],uni__dependencies:[0]},titleRow:{flexDirection:"row",alignItems:"center",gap:t.spacing[3],uni__dependencies:[0]},projectTitle:{color:t.colors.foreground,fontSize:t.fontSize.lg,fontWeight:t.fontWeight.medium,flexShrink:1,uni__dependencies:[0]},nameEditorRow:{flex:1,flexDirection:"row",alignItems:"center",gap:t.spacing[2],minWidth:0,uni__dependencies:[0]},nameEditorIconButton:{padding:t.spacing[1],uni__dependencies:[0]},nameEditorInput:{flex:1,color:t.colors.foreground,fontSize:t.fontSize.lg,fontWeight:t.fontWeight.medium,paddingVertical:t.spacing[1],paddingHorizontal:t.spacing[2],borderRadius:t.borderRadius.md,borderWidth:1,borderColor:t.colors.border,backgroundColor:t.colors.surface2,minWidth:0,uni__dependencies:[0]},nameEditorResetButton:{paddingVertical:t.spacing[1],paddingHorizontal:t.spacing[2],uni__dependencies:[0]},nameEditorResetText:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,uni__dependencies:[0]},titleIcon:{width:28,height:28,borderRadius:t.borderRadius.md,uni__dependencies:[0]},titleIconFallback:{width:28,height:28,borderRadius:t.borderRadius.md,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},titleIconFallbackText:{fontSize:t.fontSize.sm,fontWeight:t.fontWeight.medium,uni__dependencies:[0]},iconColor:{color:t.colors.foregroundMuted,uni__dependencies:[0]},hostIndicator:{flexDirection:"row",alignItems:"center",gap:t.spacing[2],paddingHorizontal:t.spacing[2],paddingVertical:t.spacing[1],borderRadius:t.borderRadius.lg,alignSelf:"flex-start",minWidth:0,uni__dependencies:[0]},hostName:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,flexShrink:1,minWidth:0,uni__dependencies:[0]},centered:{flex:1,alignItems:"center",justifyContent:"center",padding:t.spacing[6],uni__dependencies:[0]},errorBlock:{marginTop:t.spacing[2],uni__dependencies:[0]},emptyScripts:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,uni__dependencies:[0]},scriptRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:t.spacing[4],paddingHorizontal:t.spacing[4],uni__dependencies:[0]},scriptRowWithBorder:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:t.spacing[4],paddingHorizontal:t.spacing[4],borderTopWidth:1,borderTopColor:t.colors.border,uni__dependencies:[0]},scriptRowMain:{flex:1,minWidth:0,gap:t.spacing[1],uni__dependencies:[0]},scriptKebab:{padding:t.spacing[1],uni__dependencies:[0]},calloutWrap:{marginTop:t.spacing[3],uni__dependencies:[0]},footer:{marginTop:t.spacing[4],flexDirection:"row",justifyContent:"flex-end",uni__dependencies:[0]},modalSection:{gap:t.spacing[2],uni__dependencies:[0]},modalLabel:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,uni__dependencies:[0]},modalInput:{color:t.colors.foreground,fontSize:t.fontSize.sm,paddingVertical:t.spacing[2],paddingHorizontal:t.spacing[3],borderRadius:t.borderRadius.md,borderWidth:1,borderColor:t.colors.border,backgroundColor:t.colors.surface2,uni__dependencies:[0]},modalMultilineInput:{color:t.colors.foreground,fontSize:t.fontSize.sm,paddingVertical:t.spacing[2],paddingHorizontal:t.spacing[3],borderRadius:t.borderRadius.md,borderWidth:1,borderColor:t.colors.border,backgroundColor:t.colors.surface2,minHeight:100,textAlignVertical:"top",uni__dependencies:[0]},modalFooter:{flexDirection:"row",justifyContent:"flex-end",gap:t.spacing[2],marginTop:t.spacing[2],uni__dependencies:[0]},fieldError:{color:t.colors.palette.red[300],fontSize:t.fontSize.xs,uni__dependencies:[0]},serviceToggleRow:{flexDirection:"row",alignItems:"center",gap:t.spacing[3],uni__dependencies:[0]},serviceToggleText:{flex:1,minWidth:0,gap:t.spacing[1],uni__dependencies:[0]},serviceToggleLabel:{color:t.colors.foreground,fontSize:t.fontSize.sm,fontWeight:t.fontWeight.medium,uni__dependencies:[0]},modalHint:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,uni__dependencies:[0]},placeholderColor:{color:t.colors.foregroundMuted,uni__dependencies:[0]},chevronColor:{color:t.colors.foregroundMuted,uni__dependencies:[0]},spinnerColor:{color:t.colors.foregroundMuted,uni__dependencies:[0]}}))},4760,[348,714,711,1572,349,36,1573,1308,234,715,146,1143,56,916,1600,3624,3454,3627,3572,4754,4761,3564,4730,3466,4747,4762,4726,3907,3895,3670,3271,3499,3678,4763,3477,279]);
|
|
16520
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.ExternalLink=function(x){const h=(0,l.c)(19),{href:b,label:y,tooltip:_,testID:j,accessibilityLabel:S}=x,{theme:T}=(0,s.useUnistyles)();let z;h[0]!==b?(z=()=>{(0,u.openExternalUrl)(b)},h[0]=b,h[1]=z):z=h[1];const M=z,D=S??y;let k,v,I;h[2]!==y?(k=(0,f.jsx)(t.Text,{style:p.label,children:y}),h[2]=y,h[3]=k):k=h[3];h[4]!==T.colors.foregroundMuted?(v=(0,f.jsx)(n.ArrowUpRight,{size:12,color:T.colors.foregroundMuted}),h[4]=T.colors.foregroundMuted,h[5]=v):v=h[5];h[6]!==M||h[7]!==D||h[8]!==k||h[9]!==v||h[10]!==j?(I=(0,f.jsxs)(o.Pressable,{onPress:M,hitSlop:8,accessibilityRole:"link",accessibilityLabel:D,testID:j,style:p.trigger,children:[k,v]}),h[6]=M,h[7]=D,h[8]=k,h[9]=v,h[10]=j,h[11]=I):I=h[11];const L=I;if(!_)return L;let O,P,U;h[12]!==L?(O=(0,f.jsx)(c.TooltipTrigger,{asChild:!0,children:L}),h[12]=L,h[13]=O):O=h[13];h[14]!==_?(P=(0,f.jsx)(c.TooltipContent,{side:"top",align:"end",offset:6,children:(0,f.jsx)(t.Text,{style:p.tooltipText,children:_})}),h[14]=_,h[15]=P):P=h[15];h[16]!==O||h[17]!==P?(U=(0,f.jsxs)(c.Tooltip,{delayDuration:0,enabledOnDesktop:!0,enabledOnMobile:!0,children:[O,P]}),h[16]=O,h[17]=P,h[18]=U):U=h[18];return U};var t=r(d[0]),o=r(d[1]),l=r(d[2]);r(d[3]),r(d[4]),r(d[5]);var n=r(d[6]),s=r(d[7]),c=r(d[8]),u=r(d[9]),f=r(d[10]);const p=s.StyleSheet.create(t=>({trigger:{flexDirection:"row",alignItems:"center",gap:t.spacing[1],uni__dependencies:[0]},label:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,uni__dependencies:[0]},tooltipText:{color:t.colors.foreground,fontSize:t.fontSize.sm,maxWidth:280,lineHeight:1.4*t.fontSize.sm,uni__dependencies:[0]}}))},4761,[711,1572,349,36,1308,234,1600,56,3573,3562,279]);
|
|
16521
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.
|
|
16522
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),
|
|
16523
|
-
__d(function(g,r,i,a,m,
|
|
16524
|
-
__d(function(g,r,i,a,m,
|
|
16525
|
-
__d(function(g,r,i,a,m,
|
|
16526
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return
|
|
16527
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return
|
|
16528
|
-
__d(function(g,r,i,a,m,
|
|
16529
|
-
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),
|
|
16530
|
-
__d(function(g,r,i,a,
|
|
16531
|
-
__d(function(g,r,i,a,
|
|
16532
|
-
__d(function(g,r,_i,a,m,e,d){"use strict";var t=r(d[0]);const s=["children"],n=["children"];var i,o=Object.create,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,u=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty,y=(t,s,n,i)=>{if(s&&"object"==typeof s||"function"==typeof s)for(let o of p(s))h.call(t,o)||o===n||c(t,o,{get:()=>s[o],enumerable:!(i=l(s,o))||i.enumerable});return t},b=(t,s,n)=>(n=null!=t?o(u(t)):{},y(!s&&t&&t.__esModule?n:c(n,"default",{value:t,enumerable:!0}),t)),f={};((t,s)=>{for(var n in s)c(t,n,{get:s[n],enumerable:!0})})(f,{Helmet:()=>Oe,HelmetData:()=>ce,HelmetProvider:()=>pe}),m.exports=(i=f,y(c({},"__esModule",{value:!0}),i));var T=b(r(d[1])),O=b(r(d[2])),A=b(r(d[3])),j=b(r(d[1])),C=b(r(d[1])),w=(t=>(t.BASE="base",t.BODY="body",t.HEAD="head",t.HTML="html",t.LINK="link",t.META="meta",t.NOSCRIPT="noscript",t.SCRIPT="script",t.STYLE="style",t.TITLE="title",t.FRAGMENT="Symbol(react.fragment)",t))(w||{}),x={rel:["amphtml","canonical","alternate"]},v={type:["application/ld+json"]},$={charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},k=Object.values(w),S={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},M=Object.entries(S).reduce((t,[s,n])=>(t[n]=s,t),{}),E="data-rh",P="defaultTitle",H="defer",D="encodeSpecialCharacters",L="onChangeClientState",I="titleTemplate",U="prioritizeSeoTags",N=(t,s)=>{for(let n=t.length-1;n>=0;n-=1){const i=t[n];if(Object.prototype.hasOwnProperty.call(i,s))return i[s]}return null},q=t=>{let s=N(t,"title");const n=N(t,I);if(Array.isArray(s)&&(s=s.join("")),n&&s)return n.replace(/%s/g,()=>s);const i=N(t,P);return s||i||void 0},_=t=>N(t,L)||(()=>{}),R=(t,s)=>s.filter(s=>void 0!==s[t]).map(s=>s[t]).reduce((t,s)=>Object.assign({},t,s),{}),z=(t,s)=>s.filter(t=>void 0!==t.base).map(t=>t.base).reverse().reduce((s,n)=>{if(!s.length){const i=Object.keys(n);for(let o=0;o<i.length;o+=1){const c=i[o].toLowerCase();if(-1!==t.indexOf(c)&&n[c])return s.concat(n)}}return s},[]),B=(t,s,n)=>{const i={};return n.filter(s=>{return!!Array.isArray(s[t])||(void 0!==s[t]&&(n=`Helmet: ${t} should be of type "Array". Instead found type "${typeof s[t]}"`,console&&"function"==typeof console.warn&&console.warn(n)),!1);var n}).map(s=>s[t]).reverse().reduce((t,n)=>{const o={};n.filter(t=>{let n;const c=Object.keys(t);for(let i=0;i<c.length;i+=1){const o=c[i],l=o.toLowerCase();-1===s.indexOf(l)||"rel"===n&&"canonical"===t[n].toLowerCase()||"rel"===l&&"stylesheet"===t[l].toLowerCase()||(n=l),-1===s.indexOf(o)||"innerHTML"!==o&&"cssText"!==o&&"itemprop"!==o||(n=o)}if(!n||!t[n])return!1;const l=t[n].toLowerCase();return i[n]||(i[n]={}),o[n]||(o[n]={}),!i[n][l]&&(o[n][l]=!0,!0)}).reverse().forEach(s=>t.push(s));const c=Object.keys(o);for(let t=0;t<c.length;t+=1){const s=c[t],n=Object.assign({},i[s],o[s]);i[s]=n}return t},[]).reverse()},F=(t,s)=>{if(Array.isArray(t)&&t.length)for(let n=0;n<t.length;n+=1){if(t[n][s])return!0}return!1},Y=t=>Array.isArray(t)?t.join(""):t,K=(t,s)=>{const n=Object.keys(t);for(let i=0;i<n.length;i+=1)if(s[n[i]]&&s[n[i]].includes(t[n[i]]))return!0;return!1},G=(t,s)=>Array.isArray(t)?t.reduce((t,n)=>(K(n,s)?t.priority.push(n):t.default.push(n),t),{priority:[],default:[]}):{default:t,priority:[]},W=(t,s)=>Object.assign({},t,{[s]:void 0}),J=["noscript","script","style"],Q=(t,s=!0)=>!1===s?String(t):String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),V=t=>Object.keys(t).reduce((s,n)=>{const i=void 0!==t[n]?`${n}="${t[n]}"`:`${n}`;return s?`${s} ${i}`:i},""),X=(t,s,n,i)=>{const o=V(n),c=Y(s);return o?`<${t} ${E}="true" ${o}>${Q(c,i)}</${t}>`:`<${t} ${E}="true">${Q(c,i)}</${t}>`},Z=(t,s,n=!0)=>s.reduce((s,i)=>{const o=i,c=Object.keys(o).filter(t=>!("innerHTML"===t||"cssText"===t)).reduce((t,s)=>{const i=void 0===o[s]?s:`${s}="${Q(o[s],n)}"`;return t?`${t} ${i}`:i},""),l=o.innerHTML||o.cssText||"",p=-1===J.indexOf(t);return`${s}<${t} ${E}="true" ${c}${p?"/>":`>${l}</${t}>`}`},""),ee=(t,s={})=>Object.keys(t).reduce((s,n)=>(s[S[n]||n]=t[n],s),s),te=(t,s,n)=>{const i=ee(n,{key:s,[E]:!0});return[C.default.createElement("title",i,s)]},re=(t,s)=>s.map((s,n)=>{const i={key:n,[E]:!0};return Object.keys(s).forEach(t=>{const n=S[t]||t;if("innerHTML"===n||"cssText"===n){const t=s.innerHTML||s.cssText;i.dangerouslySetInnerHTML={__html:t}}else i[n]=s[t]}),C.default.createElement(t,i)}),se=(t,s,n=!0)=>{switch(t){case"title":return{toComponent:()=>te(0,s.title,s.titleAttributes),toString:()=>X(t,s.title,s.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>ee(s),toString:()=>V(s)};default:return{toComponent:()=>re(t,s),toString:()=>Z(t,s,n)}}},ne=({metaTags:t,linkTags:s,scriptTags:n,encode:i})=>{const o=G(t,$),c=G(s,x),l=G(n,v);return{priorityMethods:{toComponent:()=>[...re("meta",o.priority),...re("link",c.priority),...re("script",l.priority)],toString:()=>`${se("meta",o.priority,i)} ${se("link",c.priority,i)} ${se("script",l.priority,i)}`},metaTags:o.default,linkTags:c.default,scriptTags:l.default}},ie=t=>{const{baseTag:s,bodyAttributes:n,encode:i=!0,htmlAttributes:o,noscriptTags:c,styleTags:l,title:p="",titleAttributes:u,prioritizeSeoTags:h}=t;let{linkTags:y,metaTags:b,scriptTags:f}=t,T={toComponent:()=>{},toString:()=>""};return h&&({priorityMethods:T,linkTags:y,metaTags:b,scriptTags:f}=ne(t)),{priority:T,base:se("base",s,i),bodyAttributes:se("bodyAttributes",n,i),htmlAttributes:se("htmlAttributes",o,i),link:se("link",y,i),meta:se("meta",b,i),noscript:se("noscript",c,i),script:se("script",f,i),style:se("style",l,i),title:se("title",{title:p,titleAttributes:u},i)}},oe=[],ae=!("undefined"==typeof window||!window.document||!window.document.createElement),ce=class{instances=[];canUseDOM=ae;value={setHelmet:t=>{this.context.helmet=t},helmetInstances:{get:()=>this.canUseDOM?oe:this.instances,add:t=>{(this.canUseDOM?oe:this.instances).push(t)},remove:t=>{const s=(this.canUseDOM?oe:this.instances).indexOf(t);(this.canUseDOM?oe:this.instances).splice(s,1)}}};constructor(t,s){this.context=t,this.canUseDOM=s||!1,s||(t.helmet=ie({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},le=j.default.createContext({}),pe=class t extends j.Component{static canUseDOM=ae;constructor(s){super(s),this.helmetData=new ce(this.props.context||{},t.canUseDOM)}render(){return j.default.createElement(le.Provider,{value:this.helmetData.value},this.props.children)}},ue=r(d[1]),de=b(r(d[4])),he=(t,s)=>{const n=document.head||document.querySelector("head"),i=n.querySelectorAll(`${t}[${E}]`),o=[].slice.call(i),c=[];let l;return s&&s.length&&s.forEach(s=>{const n=document.createElement(t);for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t))if("innerHTML"===t)n.innerHTML=s.innerHTML;else if("cssText"===t)n.styleSheet?n.styleSheet.cssText=s.cssText:n.appendChild(document.createTextNode(s.cssText));else{const i=t,o=void 0===s[i]?"":s[i];n.setAttribute(t,o)}n.setAttribute(E,"true"),o.some((t,s)=>(l=s,n.isEqualNode(t)))?o.splice(l,1):c.push(n)}),o.forEach(t=>t.parentNode?.removeChild(t)),c.forEach(t=>n.appendChild(t)),{oldTags:o,newTags:c}},me=(t,s)=>{const n=document.getElementsByTagName(t)[0];if(!n)return;const i=n.getAttribute(E),o=i?i.split(","):[],c=[...o],l=Object.keys(s);for(const t of l){const i=s[t]||"";n.getAttribute(t)!==i&&n.setAttribute(t,i),-1===o.indexOf(t)&&o.push(t);const l=c.indexOf(t);-1!==l&&c.splice(l,1)}for(let t=c.length-1;t>=0;t-=1)n.removeAttribute(c[t]);o.length===c.length?n.removeAttribute(E):n.getAttribute(E)!==l.join(",")&&n.setAttribute(E,l.join(","))},ge=(t,s)=>{void 0!==t&&document.title!==t&&(document.title=Y(t)),me("title",s)},ye=(t,s)=>{const{baseTag:n,bodyAttributes:i,htmlAttributes:o,linkTags:c,metaTags:l,noscriptTags:p,onChangeClientState:u,scriptTags:h,styleTags:y,title:b,titleAttributes:f}=t;me("body",i),me("html",o),ge(b,f);const T={baseTag:he("base",n),linkTags:he("link",c),metaTags:he("meta",l),noscriptTags:he("noscript",p),scriptTags:he("script",h),styleTags:he("style",y)},O={},A={};Object.keys(T).forEach(t=>{const{newTags:s,oldTags:n}=T[t];s.length&&(O[t]=s),n.length&&(A[t]=T[t].oldTags)}),s&&s(),u(t,O,A)},be=null,fe=t=>{be&&cancelAnimationFrame(be),t.defer?be=requestAnimationFrame(()=>{ye(t,()=>{be=null})}):(ye(t),be=null)},Te=class extends ue.Component{rendered=!1;shouldComponentUpdate(t){return!(0,de.default)(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:s}=this.props.context;let n=null;const i=(o=t.get().map(t=>{const s=Object.assign({},t.props);return delete s.context,s}),{baseTag:z(["href"],o),bodyAttributes:R("bodyAttributes",o),defer:N(o,H),encode:N(o,D),htmlAttributes:R("htmlAttributes",o),linkTags:B("link",["rel","href"],o),metaTags:B("meta",["name","charset","http-equiv","property","itemprop"],o),noscriptTags:B("noscript",["innerHTML"],o),onChangeClientState:_(o),scriptTags:B("script",["src","innerHTML"],o),styleTags:B("style",["cssText"],o),title:q(o),titleAttributes:R("titleAttributes",o),prioritizeSeoTags:F(o,U)});var o;pe.canUseDOM?fe(i):ie&&(n=ie(i)),s(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},Oe=class extends T.Component{static defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1};shouldComponentUpdate(t){return!(0,O.default)(W(this.props,"helmetData"),W(t,"helmetData"))}mapNestedChildrenToProps(t,s){if(!s)return null;switch(t.type){case"script":case"noscript":return{innerHTML:s};case"style":return{cssText:s};default:throw new Error(`<${t.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(t,s,n,i){return Object.assign({},s,{[t.type]:[...s[t.type]||[],Object.assign({},n,this.mapNestedChildrenToProps(t,i))]})}mapObjectTypeChildren(t,s,n,i){switch(t.type){case"title":return Object.assign({},s,{[t.type]:i,titleAttributes:Object.assign({},n)});case"body":return Object.assign({},s,{bodyAttributes:Object.assign({},n)});case"html":return Object.assign({},s,{htmlAttributes:Object.assign({},n)});default:return Object.assign({},s,{[t.type]:Object.assign({},n)})}}mapArrayTypeChildrenToProps(t,s){let n=Object.assign({},s);return Object.keys(t).forEach(s=>{n=Object.assign({},n,{[s]:t[s]})}),n}warnOnInvalidChildren(t,s){return(0,A.default)(k.some(s=>t.type===s),"function"==typeof t.type?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${k.join(", ")} are allowed. Helmet does not support rendering <${t.type}> elements. Refer to our API for more information.`),(0,A.default)(!s||"string"==typeof s||Array.isArray(s)&&!s.some(t=>"string"!=typeof t),`Helmet expects a string as a child of <${t.type}>. Did you forget to wrap your children in braces? ( <${t.type}>{\`\`}</${t.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(n,i){let o={};return T.default.Children.forEach(n,n=>{if(!n||!n.props)return;const c=n.props,{children:l}=c,p=t(c,s),u=Object.keys(p).reduce((t,s)=>(t[M[s]||s]=p[s],t),{});let{type:h}=n;switch("symbol"==typeof h?h=h.toString():this.warnOnInvalidChildren(n,l),h){case"Symbol(react.fragment)":i=this.mapChildrenToProps(l,i);break;case"link":case"meta":case"noscript":case"script":case"style":o=this.flattenArrayTypeChildren(n,o,u,l);break;default:i=this.mapObjectTypeChildren(n,i,u,l)}}),this.mapArrayTypeChildrenToProps(o,i)}render(){const s=this.props,{children:i}=s,o=t(s,n);let c=Object.assign({},o),{helmetData:l}=o;if(i&&(c=this.mapChildrenToProps(i,c)),l&&!(l instanceof ce)){l=new ce(l.context,!0),delete c.helmetData}return l?T.default.createElement(Te,Object.assign({},c,{context:l.value})):T.default.createElement(le.Consumer,null,t=>T.default.createElement(Te,Object.assign({},c,{context:t})))}}},4773,[35,36,4774,42,4775]);
|
|
16533
|
-
__d(function(g,r,_i,_a,m,e,d){var t='undefined'!=typeof Element,n='function'==typeof Map,f='function'==typeof Set,o='function'==typeof ArrayBuffer&&!!ArrayBuffer.isView;function i(u,a){if(u===a)return!0;if(u&&a&&'object'==typeof u&&'object'==typeof a){if(u.constructor!==a.constructor)return!1;var c,s,l,p;if(Array.isArray(u)){if((c=u.length)!=a.length)return!1;for(s=c;0!==s--;)if(!i(u[s],a[s]))return!1;return!0}if(n&&u instanceof Map&&a instanceof Map){if(u.size!==a.size)return!1;for(p=u.entries();!(s=p.next()).done;)if(!a.has(s.value[0]))return!1;for(p=u.entries();!(s=p.next()).done;)if(!i(s.value[1],a.get(s.value[0])))return!1;return!0}if(f&&u instanceof Set&&a instanceof Set){if(u.size!==a.size)return!1;for(p=u.entries();!(s=p.next()).done;)if(!a.has(s.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(u)&&ArrayBuffer.isView(a)){if((c=u.length)!=a.length)return!1;for(s=c;0!==s--;)if(u[s]!==a[s])return!1;return!0}if(u.constructor===RegExp)return u.source===a.source&&u.flags===a.flags;if(u.valueOf!==Object.prototype.valueOf&&'function'==typeof u.valueOf&&'function'==typeof a.valueOf)return u.valueOf()===a.valueOf();if(u.toString!==Object.prototype.toString&&'function'==typeof u.toString&&'function'==typeof a.toString)return u.toString()===a.toString();if((c=(l=Object.keys(u)).length)!==Object.keys(a).length)return!1;for(s=c;0!==s--;)if(!Object.prototype.hasOwnProperty.call(a,l[s]))return!1;if(t&&u instanceof Element)return!1;for(s=c;0!==s--;)if(('_owner'!==l[s]&&'__v'!==l[s]&&'__o'!==l[s]||!u.$$typeof)&&!i(u[l[s]],a[l[s]]))return!1;return!0}return u!=u&&a!=a}m.exports=function(t,n){try{return i(t,n)}catch(t){if((t.message||'').match(/stack|recursion/i))return console.warn('react-fast-compare cannot handle circular refs'),!1;throw t}}},4774,[]);
|
|
16534
|
-
__d(function(g,r,
|
|
16535
|
-
__d(function(g,r,i,a,m,e,d){"
|
|
16536
|
-
__d(function(g,r,
|
|
16386
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.passesWorkspaceMetadataFilters=function(t,s,o){const{timeWindow:u,providerFilters:l,originFilters:c}=s;if(null!==u&&!(0,n.isWithinSessionTimeWindow)(t.timeValue,u,o))return!1;if(l.length>0&&(!t.provider||!l.includes(t.provider)))return!1;if(c.length>0&&(!t.origin||!c.includes(t.origin)))return!1;return!0};var n=r(d[0])},4627,[3603]);
|
|
16387
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useWorkspaceTerminalSessionRetention=function(n){const t=(0,s.c)(3);let p,y;t[0]!==n.scopeKey?(p=()=>{if(n.scopeKey)return(0,c.retainWorkspaceTerminalSession)({scopeKey:n.scopeKey}),()=>{(0,c.releaseWorkspaceTerminalSession)({scopeKey:n.scopeKey})}},y=[n.scopeKey],t[0]=n.scopeKey,t[1]=p,t[2]=y):(p=t[1],y=t[2]);(0,o.useEffect)(p,y)};var s=r(d[0]),o=r(d[1]),c=r(d[2])},4628,[349,36,4569]);
|
|
16388
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"PROVIDER_COMMAND_TEMPLATES",{enumerable:!0,get:function(){return s}}),e.buildProviderCommand=function(o){const u=s[o.provider]?.[o.id]??null;if(!u)return null;return n(u,{sessionId:o.sessionId})};const s={codex:{resume:"codex resume {sessionId}"},claude:{resume:"claude --resume {sessionId}"},pi:{resume:"pi --session {sessionId}"},omp:{resume:"omp --session {sessionId}"},opencode:{resume:"opencode --session {sessionId}"}};function n(s,n){return s.replace(/\{(\w+)\}/g,(s,o)=>n[o]??"")}},4629,[]);
|
|
16389
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useWorkspaceTabRename=function(s){const u=(0,t.c)(15),{client:c,normalizedServerId:b,queryClient:k,terminalsData:f,terminalsQueryKey:y}=s,{t:T}=(0,l.useTranslation)(),[v,w]=(0,n.useState)(null);let p;u[0]!==b||u[1]!==f?.terminals?(p=t=>{if("terminal"===t.target.kind){const{terminalId:n}=t.target,l=f?.terminals.find(t=>t.id===n)??null;return void w({kind:"terminal",id:n,currentTitle:l?.title??l?.name??""})}if("agent"===t.target.kind){const{agentId:n}=t.target,l=o.useSessionStore.getState().sessions[b]?.agents?.get(n)??null;w({kind:"agent",id:n,currentTitle:l?.title??""})}},u[0]=b,u[1]=f?.terminals,u[2]=p):p=u[2];const S=p;let h;u[3]!==c||u[4]!==b||u[5]!==k||u[6]!==v||u[7]!==T||u[8]!==y?(h=async t=>{if(!v)return;if(!c)throw new Error(T("workspace.terminal.hostDisconnected"));const n=t.trim();if("terminal"===v.kind){const t=await c.renameTerminal({terminalId:v.id,title:n});if(!t.success)throw new Error(t.error??"Failed to rename terminal");return void k.invalidateQueries({queryKey:y})}await c.updateAgent(v.id,{name:n}),k.invalidateQueries({queryKey:["sidebarAgentsList",b]}),k.invalidateQueries({queryKey:["allAgents",b]})},u[3]=c,u[4]=b,u[5]=k,u[6]=v,u[7]=T,u[8]=y,u[9]=h):h=u[9];const R=h;let _;u[10]===Symbol.for("react.memo_cache_sentinel")?(_=()=>{w(null)},u[10]=_):_=u[10];const A=_;let I;u[11]!==R||u[12]!==S||u[13]!==v?(I={renamingTab:v,handleRenameTab:S,handleRenameModalSubmit:R,handleRenameModalClose:A},u[11]=R,u[12]=S,u[13]=v,u[14]=I):I=u[14];return I},e.WorkspaceTabRenameModal=function(n){const o=(0,t.c)(13),{renamingTab:c,onClose:b,onSubmit:k}=n,{t:f}=(0,l.useTranslation)();let y;o[0]!==c?.kind||o[1]!==f?(y=f("terminal"===c?.kind?"workspace.tabs.menu.renameTerminal":"workspace.tabs.menu.renameAgent"),o[0]=c?.kind,o[1]=f,o[2]=y):y=o[2];const T=y,v=c?.currentTitle??"",w=c?`workspace-tab-rename-modal-${c.kind}-${c.id}`:void 0,p=null!==c;let S,h;o[3]!==f?(S=f("workspace.tabs.menu.rename"),o[3]=f,o[4]=S):S=o[4];o[5]!==v||o[6]!==b||o[7]!==k||o[8]!==p||o[9]!==S||o[10]!==w||o[11]!==T?(h=(0,u.jsx)(s.AdaptiveRenameModal,{visible:p,title:T,initialValue:v,submitLabel:S,maxLength:200,onClose:b,onSubmit:k,testID:w}),o[5]=v,o[6]=b,o[7]=k,o[8]=p,o[9]=S,o[10]=w,o[11]=T,o[12]=h):h=o[12];return h};var t=r(d[0]),n=r(d[1]),l=r(d[2]),s=r(d[3]),o=r(d[4]),u=r(d[5])},4630,[349,36,1573,3626,3414,279]);
|
|
16390
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useWorkspaceTagEditor=function(o){const u=(0,t.c)(12),{client:c,normalizedServerId:S,queryClient:b}=o,[y,T]=(0,n.useState)(null);let f;u[0]!==S?(f=t=>{const n=s.useSessionStore.getState().sessions[S]?.agents?.get(t)??null,o=(0,l.getAgentTags)(n??{});T({agentId:t,initialTags:o})},u[0]=S,u[1]=f):f=u[1];const A=f;let _;u[2]!==c||u[3]!==S||u[4]!==b||u[5]!==y?(_=async t=>{if(!y)return;if(!c)throw new Error("Host is not connected");const n=s.useSessionStore.getState().sessions[S]?.agents?.get(y.agentId)??null;await c.updateAgent(y.agentId,{labels:(0,l.buildLabelsForTagSet)(n?.labels,t)}),b.invalidateQueries({queryKey:["sidebarAgentsList",S]}),b.invalidateQueries({queryKey:["allAgents",S]})},u[2]=c,u[3]=S,u[4]=b,u[5]=y,u[6]=_):_=u[6];const h=_;let v;u[7]===Symbol.for("react.memo_cache_sentinel")?(v=()=>{T(null)},u[7]=v):v=u[7];const q=v;let I;u[8]!==A||u[9]!==h||u[10]!==y?(I={taggingAgent:y,handleRequestTagAgent:A,handleTagModalSubmit:h,handleTagModalClose:q},u[8]=A,u[9]=h,u[10]=y,u[11]=I):I=u[11];return I};var t=r(d[0]),n=r(d[1]),s=r(d[2]),l=r(d[3])},4631,[349,36,3414,3955]);
|
|
16391
|
+
__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.sortDescriptorsByCreationDate=function(t){return[...t].sort((t,a)=>t.createdAt!==a.createdAt?t.createdAt-a.createdAt:t.tabId<a.tabId?-1:t.tabId>a.tabId?1:0)},e.buildWorkspaceTabId=function(t){return(0,a.buildDeterministicWorkspaceTabId)(t)},e.deriveWorkspaceTabModel=function(a){const c=(0,t.deriveWorkspacePaneState)({tabs:a.tabs,focusedTabId:a.focusedTabId,preferredTarget:a.preferredTarget});return{tabs:c.tabs,activeTabId:c.activeTabId,activeTab:c.activeTab}};var t=r(d[0]),a=r(d[1])},4632,[4461,3439]);
|
|
16392
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.resolveBrowserNewTabRequest=b,e.useDesktopBrowserNewTabRequests=function(s){const l=(0,t.c)(6);let w;l[0]!==s?(w=t=>{const o=b({payload:t,workspaceLayout:s.workspaceLayout});o&&s.openUrl(o.url)},l[0]=s,l[1]=w):w=l[1];const p=(0,c.useStableEvent)(w);let y,k;l[2]!==p||l[3]!==s.enabled?(y=()=>{if(!s.enabled||!(0,u.getIsElectron)())return;const t=(0,n.getDesktopHost)()?.events?.on?.("browser-new-tab-request",p);return"function"==typeof t?t:()=>{t?.then(f)}},k=[p,s.enabled],l[2]=p,l[3]=s.enabled,l[4]=y,l[5]=k):(y=l[4],k=l[5]);(0,o.useEffect)(y,k)};var t=r(d[0]),o=r(d[1]),n=r(d[2]),s=r(d[3]),u=r(d[4]),c=r(d[5]);function l(t){try{const o=new URL(t);return"http:"===o.protocol||"https:"===o.protocol||"about:blank"===o.href}catch{return!1}}function w(t){if(!t||"object"!=typeof t)return null;const o=t;return"string"==typeof o.sourceBrowserId&&o.sourceBrowserId.trim()&&"string"==typeof o.url&&l(o.url)?{sourceBrowserId:o.sourceBrowserId,url:o.url}:null}function p(t){return!!t.workspaceLayout&&(0,s.collectAllTabs)(t.workspaceLayout.root).some(o=>"browser"===o.target.kind&&o.target.browserId===t.browserId)}function b(t){const o=w(t.payload);return o&&p({workspaceLayout:t.workspaceLayout,browserId:o.sourceBrowserId})?o:null}function f(t){return t()}},4633,[349,36,3404,3436,3407,3523]);
|
|
16393
|
+
__d(function(g,r,i,_a,m,e,d){"use strict";function t(t){if("string"!=typeof t)return null;const n=t.trim();return n.length>0?n:null}function n(n,o){const c=t(n)?.toLocaleLowerCase(),s=t(o)?.toLocaleLowerCase();return!(!c||!s)&&c===s}function o(t){return{title:t.workspace.name,subtitle:t.workspace.projectDisplayName}}Object.defineProperty(e,'__esModule',{value:!0}),e.resolveWorkspaceHeader=o,e.resolveWorkspaceHeaderRenderState=function(c){if(!c.workspace)return{kind:"skeleton"};if("pending"===c.checkoutState.kind&&"git"===c.workspace.projectKind)return{kind:"skeleton"};const s=o({workspace:c.workspace}),u="ready"===c.checkoutState.kind?c.checkoutState.checkout:null,a=u?.isGit&&"HEAD"!==u.currentBranch?t(u.currentBranch):null;return{kind:"ready",title:s.title,subtitle:s.subtitle,shouldShowSubtitle:!n(s.title,s.subtitle),isGitCheckout:u?.isGit??!1,currentBranchName:a}},e.shouldRenderMissingWorkspaceDescriptor=function(t){return!t.workspace&&t.hasHydratedWorkspaces}},4634,[]);
|
|
16394
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.resolveWorkspaceRouteState=function(t){if(t.workspace)return"online"===t.connectionStatus?{kind:"ready"}:{kind:"reconnecting",hostName:t.hostName,connectionStatus:t.connectionStatus,lastError:t.lastError};if("online"===t.connectionStatus)return"restoring"===t.restoreStatus?{kind:"restoring",hostName:t.hostName}:"needs-host-upgrade"===t.restoreStatus?{kind:"needsHostUpgrade",hostName:t.hostName}:t.hasHydratedWorkspaces?{kind:"missing",hostName:t.hostName,restoreFailed:"failed"===t.restoreStatus}:{kind:"loading",hostName:t.hostName};return{kind:"unreachable",hostName:t.hostName,connectionStatus:t.connectionStatus,lastError:t.lastError}}},4635,[]);
|
|
16395
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.renderWorkspaceRouteGate=function(t){switch(t.state.kind){case"loading":return(0,f.jsx)(S,{hostName:t.state.hostName});case"restoring":return(0,f.jsx)(j,{hostName:t.state.hostName});case"needsHostUpgrade":return(0,f.jsx)(k,{titleKey:"workspace.route.needsHostUpgrade",hostName:t.state.hostName,onDismiss:t.actions.onDismissMissingWorkspace});case"unreachable":return(0,f.jsx)(w,{state:t.state,onRetry:t.actions.onRetryHost,onManageHost:t.actions.onManageHost});case"missing":return(0,f.jsx)(k,{titleKey:t.state.restoreFailed?"workspace.route.restoreFailed":"workspace.route.missing",hostName:t.state.hostName,onDismiss:t.actions.onDismissMissingWorkspace});case"ready":case"reconnecting":return null}};var t=r(d[0]),n=r(d[1]),s=r(d[2]);r(d[3]),r(d[4]);var o=r(d[5]),c=r(d[6]),l=r(d[7]),u=r(d[8]),h=r(d[9]),x=r(d[10]),p=r(d[11]),f=r(d[12]);function y(t,n){return"connecting"===t.connectionStatus||"idle"===t.connectionStatus?n("workspace.route.connecting"):"offline"===t.connectionStatus?n("workspace.route.hostOffline",{hostName:t.hostName}):n("workspace.route.cannotReachHost",{hostName:t.hostName})}function S(o){const u=(0,s.c)(14),{hostName:x}=o,{theme:p}=(0,l.useUnistyles)(),{t:y}=(0,c.useTranslation)();let S,j,w,k,N,_;return u[0]!==p.colors.foregroundMuted?(S=(0,f.jsx)(h.LoadingSpinner,{size:"small",color:p.colors.foregroundMuted}),u[0]=p.colors.foregroundMuted,u[1]=S):S=u[1],u[2]!==y?(j=y("workspace.route.loading"),u[2]=y,u[3]=j):j=u[3],u[4]!==j?(w=(0,f.jsx)(n.Text,{style:T.title,children:j}),u[4]=j,u[5]=w):w=u[5],u[6]!==x?(k=(0,f.jsx)(n.Text,{style:T.description,children:x}),u[6]=x,u[7]=k):k=u[7],u[8]!==w||u[9]!==k?(N=(0,f.jsxs)(t.View,{style:T.textStack,children:[w,k]}),u[8]=w,u[9]=k,u[10]=N):N=u[10],u[11]!==S||u[12]!==N?(_=(0,f.jsxs)(t.View,{style:T.emptyState,children:[S,N]}),u[11]=S,u[12]=N,u[13]=_):_=u[13],_}function j(o){const u=(0,s.c)(14),{hostName:x}=o,{theme:p}=(0,l.useUnistyles)(),{t:y}=(0,c.useTranslation)();let S,j,w,k,N,_;return u[0]!==p.colors.foregroundMuted?(S=(0,f.jsx)(h.LoadingSpinner,{size:"small",color:p.colors.foregroundMuted}),u[0]=p.colors.foregroundMuted,u[1]=S):S=u[1],u[2]!==y?(j=y("workspace.route.restoring"),u[2]=y,u[3]=j):j=u[3],u[4]!==j?(w=(0,f.jsx)(n.Text,{style:T.title,children:j}),u[4]=j,u[5]=w):w=u[5],u[6]!==x?(k=(0,f.jsx)(n.Text,{style:T.description,children:x}),u[6]=x,u[7]=k):k=u[7],u[8]!==w||u[9]!==k?(N=(0,f.jsxs)(t.View,{style:T.textStack,children:[w,k]}),u[8]=w,u[9]=k,u[10]=N):N=u[10],u[11]!==S||u[12]!==N?(_=(0,f.jsxs)(t.View,{style:T.emptyState,children:[S,N]}),u[11]=S,u[12]=N,u[13]=_):_=u[13],_}function w(S){const j=(0,s.c)(29),{state:w,onRetry:k,onManageHost:N}=S,{theme:_}=(0,l.useUnistyles)(),{t:z}=(0,c.useTranslation)(),M="offline"===w.connectionStatus||"error"===w.connectionStatus;let H,V,b,v,D,W,C,I,L;return j[0]!==w.connectionStatus||j[1]!==_?(H="connecting"===w.connectionStatus||"idle"===w.connectionStatus?(0,f.jsx)(h.LoadingSpinner,{size:"small",color:_.colors.foregroundMuted}):null,j[0]=w.connectionStatus,j[1]=_,j[2]=H):H=j[2],j[3]!==w||j[4]!==z?(V=y(w,z),j[3]=w,j[4]=z,j[5]=V):V=j[5],j[6]!==V?(b=(0,f.jsx)(n.Text,{style:T.title,children:V}),j[6]=V,j[7]=b):b=j[7],j[8]!==w.connectionStatus||j[9]!==w.hostName||j[10]!==z?(v="connecting"===w.connectionStatus||"idle"===w.connectionStatus?w.hostName:z("workspace.route.hostStatus",{status:(0,p.formatConnectionStatus)(w.connectionStatus)}),j[8]=w.connectionStatus,j[9]=w.hostName,j[10]=z,j[11]=v):v=j[11],j[12]!==v?(D=(0,f.jsx)(n.Text,{style:T.description,children:v}),j[12]=v,j[13]=D):D=j[13],j[14]!==w.lastError?(W=w.lastError?(0,f.jsxs)(x.Tooltip,{delayDuration:0,enabledOnDesktop:!0,enabledOnMobile:!1,children:[(0,f.jsx)(x.TooltipTrigger,{asChild:!0,children:(0,f.jsx)(n.Text,{style:T.error,numberOfLines:3,children:w.lastError})}),(0,f.jsx)(x.TooltipContent,{side:"top",align:"center",offset:8,children:(0,f.jsx)(n.Text,{style:T.errorTooltip,children:w.lastError})})]}):null,j[14]=w.lastError,j[15]=W):W=j[15],j[16]!==b||j[17]!==D||j[18]!==W?(C=(0,f.jsxs)(t.View,{style:T.textStack,children:[b,D,W]}),j[16]=b,j[17]=D,j[18]=W,j[19]=C):C=j[19],j[20]!==M||j[21]!==N||j[22]!==k||j[23]!==z?(I=M?(0,f.jsxs)(t.View,{style:T.actions,children:[(0,f.jsx)(u.Button,{size:"sm",variant:"default",leftIcon:o.RotateCw,onPress:k,children:z("common.actions.retry")}),(0,f.jsx)(u.Button,{size:"sm",variant:"outline",leftIcon:o.Settings,onPress:N,children:z("workspace.route.manageHost")})]}):null,j[20]=M,j[21]=N,j[22]=k,j[23]=z,j[24]=I):I=j[24],j[25]!==H||j[26]!==C||j[27]!==I?(L=(0,f.jsxs)(t.View,{style:T.emptyState,children:[H,C,I]}),j[25]=H,j[26]=C,j[27]=I,j[28]=L):L=j[28],L}function k(l){const h=(0,s.c)(18),{titleKey:x,hostName:p,onDismiss:y}=l,{t:S}=(0,c.useTranslation)();let j,w,k,N,_,z,M;return h[0]!==S||h[1]!==x?(j=S(x),h[0]=S,h[1]=x,h[2]=j):j=h[2],h[3]!==j?(w=(0,f.jsx)(n.Text,{style:T.title,children:j}),h[3]=j,h[4]=w):w=h[4],h[5]!==p?(k=(0,f.jsx)(n.Text,{style:T.description,children:p}),h[5]=p,h[6]=k):k=h[6],h[7]!==w||h[8]!==k?(N=(0,f.jsxs)(t.View,{style:T.textStack,children:[w,k]}),h[7]=w,h[8]=k,h[9]=N):N=h[9],h[10]!==S?(_=S("common.actions.back"),h[10]=S,h[11]=_):_=h[11],h[12]!==y||h[13]!==_?(z=(0,f.jsx)(t.View,{style:T.actions,children:(0,f.jsx)(u.Button,{size:"sm",variant:"default",leftIcon:o.ArrowLeftToLine,onPress:y,children:_})}),h[12]=y,h[13]=_,h[14]=z):z=h[14],h[15]!==N||h[16]!==z?(M=(0,f.jsxs)(t.View,{style:T.emptyState,children:[N,z]}),h[15]=N,h[16]=z,h[17]=M):M=h[17],M}const T=l.StyleSheet.create(t=>({emptyState:{flex:1,alignItems:"center",justifyContent:"center",gap:t.spacing[3],paddingHorizontal:t.spacing[6],uni__dependencies:[0]},textStack:{alignItems:"center",gap:t.spacing[2],maxWidth:520,uni__dependencies:[0]},title:{color:t.colors.foreground,fontSize:t.fontSize.base,fontWeight:t.fontWeight.normal,textAlign:"center",uni__dependencies:[0]},description:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,textAlign:"center",uni__dependencies:[0]},error:{color:t.colors.destructive,fontSize:t.fontSize.sm,lineHeight:Math.round(1.4*t.fontSize.sm),textAlign:"center",uni__dependencies:[0]},errorTooltip:{color:t.colors.popoverForeground,fontSize:t.fontSize.sm,maxWidth:420,uni__dependencies:[0]},actions:{flexDirection:"row",alignItems:"center",justifyContent:"center",flexWrap:"wrap",gap:t.spacing[2],uni__dependencies:[0]}}))},4636,[348,711,349,234,146,1600,1573,56,3627,3564,3573,3605,279]);
|
|
16396
|
+
__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.deriveWorkspaceAgentVisibility=function(s){const{sessionAgents:o,agentDetails:u}=s,c=(0,t.normalizeWorkspaceOpaqueId)(s.workspaceId);if(!o&&!u||!c)return{activeAgentIds:new Set,autoOpenAgentIds:new Set,knownAgentIds:new Set};const I=new Set,A=new Set,l=new Set;for(const t of o?.values()??[])a(t,c)&&(l.add(t.id),t.archivedAt||(I.add(t.id),(0,n.shouldAutoOpenAgentTab)(t)&&A.add(t.id)));for(const n of u?.values()??[])a(n,c)&&l.add(n.id);return{activeAgentIds:I,autoOpenAgentIds:A,knownAgentIds:l}},e.buildWorkspaceTabSnapshot=function(n){return{agentsHydrated:n.agentsHydrated,terminalsHydrated:n.terminalsHydrated,activeAgentIds:n.agentVisibility.activeAgentIds,autoOpenAgentIds:n.agentVisibility.autoOpenAgentIds,knownAgentIds:n.agentVisibility.knownAgentIds,knownTerminalIds:n.knownTerminalIds,standaloneTerminalIds:n.standaloneTerminalIds,hasActivePendingDraftCreate:n.hasActivePendingDraftCreate}},e.workspaceAgentVisibilityEqual=function(n,t){return s(n.activeAgentIds,t.activeAgentIds)&&s(n.autoOpenAgentIds,t.autoOpenAgentIds)&&s(n.knownAgentIds,t.knownAgentIds)},e.shouldPruneWorkspaceAgentTab=function(n){if(!n.agentId.trim())return!1;if(!n.agentsHydrated)return!1;return!n.activeAgentIds.has(n.agentId)};var n=r(d[0]),t=r(d[1]);function a(n,a){return(0,t.normalizeWorkspaceOpaqueId)(n.workspaceId)===a}function s(n,t){if(n.size!==t.size)return!1;for(const a of n)if(!t.has(a))return!1;return!0}},4637,[4638,3419]);
|
|
16397
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"resolveCloseAgentTabPolicy",{enumerable:!0,get:function(){return t.resolveCloseAgentTabPolicy}}),Object.defineProperty(e,"shouldAutoOpenAgentTab",{enumerable:!0,get:function(){return n.shouldAutoOpenAgentTab}});var t=r(d[0]),n=r(d[1])},4638,[4544,4545]);
|
|
16398
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.shouldSeedEmptyWorkspaceDraft=function(t){if(!(t.isRouteFocused&&t.hasPersistenceKey&&t.hasWorkspaceDirectory&&t.hasHydratedWorkspaceLayoutStore&&t.hasHydratedAgents&&t.hasLoadedTerminals))return!1;return 0===t.activeAgentCount&&0===t.terminalCount&&0===t.tabCount}},4639,[]);
|
|
16399
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DEFAULT_BULK_CLOSE_CONFIRMATION_LABELS",{enumerable:!0,get:function(){return n}}),e.classifyBulkClosableTabs=function(t){const n={agentTabs:[],terminalTabs:[],otherTabs:[]};for(const s of t)"agent"!==s.target.kind?"terminal"!==s.target.kind?n.otherTabs.push({tabId:s.tabId,target:s.target}):n.terminalTabs.push({tabId:s.tabId,terminalId:s.target.terminalId}):n.agentTabs.push({tabId:s.tabId,agentId:s.target.agentId});return n},e.buildBulkCloseConfirmationMessage=function(t,s=n){const{agentTabs:l,terminalTabs:o,otherTabs:b}=t;if(l.length>0&&o.length>0&&b.length>0)return s.all({agents:l.length,terminals:o.length,tabs:b.length});if(l.length>0&&o.length>0)return s.agentsAndTerminals({agents:l.length,terminals:o.length});if(o.length>0&&b.length>0)return s.terminalsAndTabs({terminals:o.length,tabs:b.length});if(l.length>0&&b.length>0)return s.agentsAndTabs({agents:l.length,tabs:b.length});if(o.length>0)return s.terminals({terminals:o.length});if(b.length>0)return s.tabs({tabs:b.length});return s.agents({agents:l.length})},e.closeBulkWorkspaceTabs=async function(n){const{client:s,groups:l,closeTab:o,closeWorkspaceTabWithCleanup:b,logLabel:c,warn:h}=n,T=l.agentTabs.length>0||l.terminalTabs.length>0;T&&s?s.closeItems({agentIds:l.agentTabs.map(t=>t.agentId),terminalIds:l.terminalTabs.map(t=>t.terminalId)}).catch(t=>{h?.(`[WorkspaceScreen] Failed to bulk close tabs ${c}`,{error:t})}):T&&h?.(`[WorkspaceScreen] Failed to bulk close tabs ${c}`,{error:new Error(t.i18n.t("common.errors.daemonClientUnavailable"))});for(const{tabId:t,agentId:n}of l.agentTabs)o(t,async()=>{b({tabId:t,target:{kind:"agent",agentId:n}})});for(const{tabId:t,terminalId:n}of l.terminalTabs)o(t,async()=>{b({tabId:t,target:{kind:"terminal",terminalId:n}})});for(const{tabId:t,target:n}of l.otherTabs)o(t,async()=>{b({tabId:t,target:n})})};var t=r(d[0]);const n={all:({agents:t,terminals:n,tabs:s})=>`This will archive ${t} agent(s), close ${n} terminal(s), and close ${s} tab(s). Any running process in a closed terminal will be stopped immediately.`,agentsAndTerminals:({agents:t,terminals:n})=>`This will archive ${t} agent(s) and close ${n} terminal(s). Any running process in a closed terminal will be stopped immediately.`,terminalsAndTabs:({terminals:t,tabs:n})=>`This will close ${t} terminal(s) and close ${n} tab(s). Any running process in a closed terminal will be stopped immediately.`,agentsAndTabs:({agents:t,tabs:n})=>`This will archive ${t} agent(s) and close ${n} tab(s).`,terminals:({terminals:t})=>`This will close ${t} terminal(s). Any running process in a closed terminal will be stopped immediately.`,tabs:({tabs:t})=>`This will close ${t} tab(s).`,agents:({agents:t})=>`This will archive ${t} agent(s).`}},4640,[3534]);
|
|
16400
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useWorkspaceTerminals=function(p){const w=(0,t.c)(112),{client:T,isConnected:y,isRouteFocused:f,normalizedServerId:I,normalizedWorkspaceId:k,workspaceDirectory:v,workspaceScripts:S,hasHydratedWorkspaces:h,isMissingWorkspaceDirectory:E,onTerminalCreated:C,onScriptTerminalSelected:D,onWorkspacePathUnavailable:M,onTerminalCreateQueued:Q,onTerminalCreateFailed:b}=p,{t:_}=(0,o.useTranslation)(),q=(0,s.useQueryClient)(),[F,U]=(0,n.useState)(null);let A;w[0]!==T||w[1]!==y||w[2]!==f||w[3]!==v?(A=(0,l.canCreateWorkspaceTerminal)({isRouteFocused:f,client:T,isConnected:y,workspaceDirectory:v}),w[0]=T,w[1]=y,w[2]=f,w[3]=v,w[4]=A):A=w[4];const K=A,P=k||null;let W;w[5]!==I||w[6]!==P||w[7]!==v?(W=(0,l.buildTerminalsQueryKey)(I,v,P),w[5]=I,w[6]=P,w[7]=v,w[8]=W):W=w[8];const R=W;let z,L;w[9]!==T||w[10]!==k||w[11]!==_||w[12]!==v?(z=async()=>{if(!T||!v)throw new Error(_("workspace.terminal.hostDisconnected"));return await T.listTerminals(v,void 0,{workspaceId:k||void 0})},w[9]=T,w[10]=k,w[11]=_,w[12]=v,w[13]=z):z=w[13];w[14]!==K||w[15]!==R||w[16]!==z?(L={queryKey:R,enabled:K,queryFn:z,staleTime:l.TERMINALS_QUERY_STALE_TIME},w[14]=K,w[15]=R,w[16]=z,w[17]=L):L=w[17];const N=(0,s.useQuery)(L);let j;w[18]!==N.data?.terminals?(j=N.data?.terminals??[],w[18]=N.data?.terminals,w[19]=j):j=w[19];const H=j;let O;w[20]!==H?(O=H.map(u),w[20]=H,w[21]=O):O=w[21];const V=O,[Y,$]=(0,n.useState)(c);let x,B;w[22]===Symbol.for("react.memo_cache_sentinel")?(x=()=>{$(new Map)},w[22]=x):x=w[22];w[23]!==I||w[24]!==k?(B=[I,k],w[23]=I,w[24]=k,w[25]=B):B=w[25];(0,n.useEffect)(x,B);const G=N.dataUpdatedAt;let J,X,Z;w[26]!==G||w[27]!==V?(X=()=>{$((0,l.reconcilePendingScriptTerminals)(V,G))},J=[V,G],w[26]=G,w[27]=V,w[28]=J,w[29]=X):(J=w[28],X=w[29]);(0,n.useEffect)(X,J),w[30]!==V||w[31]!==Y?(Z=(0,l.collectKnownTerminalIds)({liveTerminalIds:V,pendingScriptTerminalIds:Y}),w[30]=V,w[31]=Y,w[32]=Z):Z=w[32];const ee=Z;let te;w[33]!==Y||w[34]!==S?(te=(0,l.collectScriptTerminalIds)({pendingScriptTerminalIds:Y,scripts:S}),w[33]=Y,w[34]=S,w[35]=te):te=w[35];const re=te;let ne;w[36]!==re||w[37]!==H?(ne=(0,l.collectStandaloneTerminalIds)({terminals:H,scriptTerminalIds:re}),w[36]=re,w[37]=H,w[38]=ne):ne=w[38];const ae=ne;let ie,se,oe,le;w[39]!==T||w[40]!==k||w[41]!==_||w[42]!==v?(ie=async t=>{if(!T||!v)throw new Error(_("workspace.terminal.hostDisconnected"));const n=t?.profile?await T.createTerminal(v,t.profile.name,void 0,{command:t.profile.command,args:t.profile.args,workspaceId:k||void 0}):await T.createTerminal(v,void 0,void 0,{workspaceId:k||void 0});if(!n.terminal&&n.error)throw new Error(n.error);return n},w[39]=T,w[40]=k,w[41]=_,w[42]=v,w[43]=ie):ie=w[43];w[44]!==C||w[45]!==q||w[46]!==R||w[47]!==v?(se=(t,n)=>{const s=t.terminal;s&&q.setQueryData(R,t=>(0,l.upsertCreatedTerminalPayload)({current:t,terminal:s,workspaceDirectory:v})),q.invalidateQueries({queryKey:R}),s&&C({terminalId:s.id,paneId:n?.paneId})},w[44]=C,w[45]=q,w[46]=R,w[47]=v,w[48]=se):se=w[48];w[49]!==b?(oe=t=>{b(t instanceof Error?t.message:String(t))},w[49]=b,w[50]=oe):oe=w[50];w[51]!==ie||w[52]!==se||w[53]!==oe?(le={mutationFn:ie,onSuccess:se,onError:oe},w[51]=ie,w[52]=se,w[53]=oe,w[54]=le):le=w[54];const ce=(0,s.useMutation)(le);let de;w[55]!==T||w[56]!==_?(de={mutationFn:async t=>{if(!T)throw new Error(_("workspace.terminal.hostDisconnected"));const n=await T.killTerminal(t);if(!n.success)throw new Error("Unable to close terminal");return n}},w[55]=T,w[56]=_,w[57]=de):de=w[57];const ue=(0,s.useMutation)(de);let me,pe,we,Te,ye;w[58]!==T||w[59]!==y||w[60]!==f||w[61]!==k||w[62]!==q||w[63]!==R||w[64]!==v?(me=()=>{if(!(f&&T&&y&&v))return;const t=k||void 0,n=T.on("terminals_changed",n=>{if(n.payload.cwd!==v)return;const s=n.payload.terminals.filter(n=>n.workspaceId===t);q.setQueryData(R,t=>({cwd:n.payload.cwd,terminals:s,requestId:t?.requestId??`terminals-changed-${Date.now()}`}))});return T.subscribeTerminals({cwd:v,workspaceId:t}),()=>{n(),T.unsubscribeTerminals({cwd:v,workspaceId:t})}},pe=[T,y,f,k,q,R,v],w[58]=T,w[59]=y,w[60]=f,w[61]=k,w[62]=q,w[63]=R,w[64]=v,w[65]=me,w[66]=pe):(me=w[65],pe=w[66]);(0,n.useEffect)(me,pe),w[67]!==K||w[68]!==ce||w[69]!==h||w[70]!==E||w[71]!==M||w[72]!==F?(we=()=>{if(F){if(K&&!ce.isPending){const t=F;return U(null),void ce.mutate(t)}h&&E&&(U(null),M())}},Te=[K,ce,h,E,M,F],w[67]=K,w[68]=ce,w[69]=h,w[70]=E,w[71]=M,w[72]=F,w[73]=we,w[74]=Te):(we=w[73],Te=w[74]);(0,n.useEffect)(we,Te),w[75]!==K||w[76]!==ce||w[77]!==h||w[78]!==E||w[79]!==Q||w[80]!==M||w[81]!==F?(ye=t=>{ce.isPending||F||(K?ce.mutate(t):h&&E?M():(U(t??{}),Q()))},w[75]=K,w[76]=ce,w[77]=h,w[78]=E,w[79]=Q,w[80]=M,w[81]=F,w[82]=ye):ye=w[82];const fe=ye;let Ie;w[83]!==D||w[84]!==N.dataUpdatedAt||w[85]!==q||w[86]!==R?(Ie=t=>{$(n=>{if(n.get(t)===N.dataUpdatedAt)return n;const s=new Map(n);return s.set(t,N.dataUpdatedAt),s}),D(t),q.invalidateQueries({queryKey:R})},w[83]=D,w[84]=N.dataUpdatedAt,w[85]=q,w[86]=R,w[87]=Ie):Ie=w[87];const ke=Ie;let ve;w[88]!==D?(ve=t=>{D(t)},w[88]=D,w[89]=ve):ve=w[89];const Se=ve;let he;w[90]!==q||w[91]!==R?(he=t=>{q.setQueryData(R,(0,l.removeTerminalFromPayload)(t))},w[90]=q,w[91]=R,w[92]=he):he=w[92];const Ee=he;let ge;w[93]!==q||w[94]!==R?(ge=()=>{q.invalidateQueries({queryKey:R})},w[93]=q,w[94]=R,w[95]=ge):ge=w[95];const Ce=ge;let De;w[96]!==K||w[97]!==ce||w[98]!==fe||w[99]!==ke||w[100]!==Se||w[101]!==Ce||w[102]!==ue||w[103]!==ee||w[104]!==V||w[105]!==F||w[106]!==N||w[107]!==R||w[108]!==Ee||w[109]!==ae||w[110]!==H?(De={canCreateNow:K,createMutation:ce,createTerminal:fe,handleScriptTerminalStarted:ke,handleViewScriptTerminal:Se,invalidateTerminals:Ce,killMutation:ue,knownTerminalIds:ee,liveTerminalIds:V,pendingCreateInput:F,query:N,queryKey:R,removeTerminalFromCache:Ee,standaloneTerminalIds:ae,terminals:H},w[96]=K,w[97]=ce,w[98]=fe,w[99]=ke,w[100]=Se,w[101]=Ce,w[102]=ue,w[103]=ee,w[104]=V,w[105]=F,w[106]=N,w[107]=R,w[108]=Ee,w[109]=ae,w[110]=H,w[111]=De):De=w[111];return De};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),l=r(d[4]);function c(){return new Map}function u(t){return t.id}},4641,[349,36,916,1573,3888]);
|
|
16401
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"WORKSPACE_DECK_MAX_MOUNTED_WORKSPACES",{enumerable:!0,get:function(){return t}}),e.getWorkspaceSelectionKey=n,e.areWorkspaceSelectionsEqual=o,e.areWorkspaceSelectionListsEqual=function(t,n){if(t.length!==n.length)return!1;return t.every((t,c)=>o(t,n[c]??null))},e.pruneMountedWorkspaceSelections=function({currentSelections:c,activeSelection:s,maxMountedWorkspaces:u=t}){if(!s)return[];const f=Math.max(1,u),l=[],p=new Set;function k(t){if(l.length>=f)return;const o=n(t);p.has(o)||(p.add(o),l.push(t))}k(s);for(const t of c)o(t,s)||k(t);return l},e.shouldKeepWorkspaceDeckEntryMounted=function({isActive:t,hasHydratedWorkspaces:n,workspaceExists:o}){if(t)return!0;if(!n)return!0;return o};const t=3;function n(t){return`${t.serverId}:${t.workspaceId}`}function o(t,n){return t?.serverId===n?.serverId&&t?.workspaceId===n?.workspaceId}},4642,[]);
|
|
16402
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return z}});var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),l=r(d[4]),c=r(d[5]);r(d[6]),r(d[7]),r(d[8]),r(d[9]);var u=r(d[10]),f=r(d[11]),p=r(d[12]),h=r(d[13]),x=r(d[14]),b=r(d[15]),y=r(d[16]),w=r(d[17]);const _=(0,u.withUnistyles)(p.ChevronLeft),S=(0,u.withUnistyles)(p.ChevronRight),j=t=>({color:t.colors.foregroundMuted}),T=new Set(["completed","failed","cancelled"]);function k(t){switch(t){case"completed":return"success";case"failed":case"cancelled":return"error";default:return"muted"}}function C(t){return t.charAt(0).toUpperCase()+t.slice(1)}function z(){const l=(0,f.useLocalSearchParams)(),u="string"==typeof l.serverId?l.serverId:"",p="string"==typeof l.workflowId?l.workflowId:"",y=(0,x.useWorkflowsFeatureEnabled)(u||null),S=(0,b.useHostRuntimeClient)(u),z=(0,b.useHostRuntimeIsConnected)(u),[P,V]=(0,c.useState)(null),[W,A]=(0,c.useState)(!1),[L,B]=(0,c.useState)(!1),[H,M]=(0,c.useState)(null);(0,c.useEffect)(()=>{if(!(y&&S&&z&&p))return;let t=!1;return(async()=>{try{const n=await S.getWorkflow(p);t||V(n)}catch{}})(),()=>{t=!0}},[y,S,z,p]);const O=(0,c.useCallback)(()=>{f.router.back()},[]),$=(0,c.useCallback)(()=>{M(null),A(!0)},[]),U=(0,c.useCallback)(()=>{A(!1)},[]),E=(0,c.useCallback)(()=>{S&&p&&(async()=>{B(!0),M(null);try{const t=await S.cancelWorkflow(p);V(t),A(!1)}catch(t){M(t instanceof Error?t.message:"Failed to cancel the workflow.")}finally{B(!1)}})()},[S,p]);if(!y)return(0,w.jsx)(t.View,{style:v.centered,children:(0,w.jsx)(n.Text,{style:v.message,children:"Update the host to use this."})});if(!P)return(0,w.jsx)(t.View,{style:v.centered,testID:`workflow-detail-${p}`,children:(0,w.jsx)(n.Text,{style:v.message,children:"Loading workflow\u2026"})});const F=!T.has(P.status);return(0,w.jsxs)(s.ScrollView,{style:v.screen,contentContainerStyle:v.content,showsVerticalScrollIndicator:!1,testID:`workflow-detail-${p}`,children:[(0,w.jsxs)(t.View,{style:v.header,children:[(0,w.jsx)(o.Pressable,{onPress:O,style:R,accessibilityRole:"button",accessibilityLabel:"Back",testID:"workflow-detail-back",children:(0,w.jsx)(_,{size:18,uniProps:j})}),(0,w.jsx)(n.Text,{style:v.title,numberOfLines:1,children:P.title?.trim()||"Workflow"}),(0,w.jsx)(h.StatusBadge,{label:C(P.status),variant:k(P.status)})]}),(0,w.jsxs)(n.Text,{style:v.storyTotal,children:[P.completedStoryCount,"/",P.totalStoryCount??P.completedStoryCount," ","stories"]}),(0,w.jsxs)(t.View,{style:v.section,testID:"workflow-detail-phases",children:[(0,w.jsx)(n.Text,{style:v.sectionTitle,children:"Phases"}),0===P.phases.length?(0,w.jsx)(n.Text,{style:v.emptyText,children:"No phases."}):P.phases.map(s=>(0,w.jsxs)(t.View,{style:v.phaseRow,testID:`workflow-phase-${s.id}`,children:[(0,w.jsx)(n.Text,{style:v.phaseTitle,numberOfLines:1,children:s.title}),(0,w.jsxs)(n.Text,{style:v.phaseStories,children:[s.completedStoryCount??0,"/",s.storyCount??0]}),(0,w.jsx)(h.StatusBadge,{label:C(s.status),variant:k(s.status)})]},s.id))]}),(0,w.jsxs)(t.View,{style:v.section,children:[(0,w.jsx)(n.Text,{style:v.sectionTitle,children:"Child agents"}),0===P.childAgentIds.length?(0,w.jsx)(n.Text,{style:v.emptyText,children:"No child agents yet."}):P.childAgentIds.map(t=>(0,w.jsx)(I,{serverId:u,agentId:t},t))]}),F?(0,w.jsxs)(t.View,{style:v.section,children:[W?(0,w.jsxs)(t.View,{style:v.confirmBox,children:[(0,w.jsx)(n.Text,{style:v.confirmText,children:"Cancel this workflow? This cannot be undone."}),(0,w.jsxs)(t.View,{style:v.confirmActions,children:[(0,w.jsx)(o.Pressable,{onPress:U,style:R,accessibilityRole:"button",accessibilityLabel:"Keep running",testID:"workflow-cancel-dismiss-btn",disabled:L,children:(0,w.jsx)(n.Text,{style:v.secondaryActionText,children:"Keep running"})}),(0,w.jsx)(o.Pressable,{onPress:E,style:D,accessibilityRole:"button",accessibilityLabel:"Confirm cancel",testID:"workflow-cancel-confirm-btn",disabled:L,children:(0,w.jsx)(n.Text,{style:v.dangerActionText,children:L?"Cancelling\u2026":"Confirm cancel"})})]})]}):(0,w.jsx)(o.Pressable,{onPress:$,style:D,accessibilityRole:"button",accessibilityLabel:"Cancel workflow",testID:"workflow-cancel-btn",children:(0,w.jsx)(n.Text,{style:v.dangerActionText,children:"Cancel workflow"})}),H?(0,w.jsx)(n.Text,{style:v.errorText,testID:"workflow-cancel-error",children:H}):null]}):null]})}function I(t){const s=(0,l.c)(11),{serverId:c,agentId:u}=t;let p;s[0]!==u||s[1]!==c?(p=()=>{c&&f.router.push((0,y.buildHostAgentDetailRoute)(c,u))},s[0]=u,s[1]=c,s[2]=p):p=s[2];const h=p,x=`Open agent ${u}`,b=`workflow-child-agent-${u}`;let _,T,k;return s[3]!==u?(_=(0,w.jsx)(n.Text,{style:v.childAgentLabel,numberOfLines:1,children:u}),s[3]=u,s[4]=_):_=s[4],s[5]===Symbol.for("react.memo_cache_sentinel")?(T=(0,w.jsx)(S,{size:16,uniProps:j}),s[5]=T):T=s[5],s[6]!==h||s[7]!==x||s[8]!==b||s[9]!==_?(k=(0,w.jsxs)(o.Pressable,{onPress:h,style:R,accessibilityRole:"button",accessibilityLabel:x,testID:b,children:[_,T]}),s[6]=h,s[7]=x,s[8]=b,s[9]=_,s[10]=k):k=s[10],k}function R({hovered:t}){return[v.row,Boolean(t)&&v.rowHovered]}function D({hovered:t}){return[v.dangerButton,Boolean(t)&&v.dangerButtonHovered]}const v=u.StyleSheet.create(t=>({screen:{flex:1,backgroundColor:t.colors.surface0,uni__dependencies:[0]},content:{padding:t.spacing[4],gap:t.spacing[4],uni__dependencies:[0]},centered:{flex:1,alignItems:"center",justifyContent:"center",padding:t.spacing[6],backgroundColor:t.colors.surface0,uni__dependencies:[0]},message:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,uni__dependencies:[0]},header:{flexDirection:"row",alignItems:"center",gap:t.spacing[2],uni__dependencies:[0]},title:{flex:1,fontSize:t.fontSize.lg,fontWeight:t.fontWeight.semibold,color:t.colors.foreground,uni__dependencies:[0]},storyTotal:{fontSize:t.fontSize.sm,color:t.colors.foregroundMuted,uni__dependencies:[0]},section:{gap:t.spacing[2],uni__dependencies:[0]},sectionTitle:{fontSize:t.fontSize.sm,fontWeight:t.fontWeight.semibold,color:t.colors.foregroundMuted,uni__dependencies:[0]},emptyText:{fontSize:t.fontSize.sm,color:t.colors.foregroundMuted,uni__dependencies:[0]},phaseRow:{flexDirection:"row",alignItems:"center",gap:t.spacing[2],paddingVertical:t.spacing[2],paddingHorizontal:t.spacing[3],borderRadius:t.borderRadius.lg,backgroundColor:t.colors.surface1,uni__dependencies:[0]},phaseTitle:{flex:1,fontSize:t.fontSize.base,color:t.colors.foreground,uni__dependencies:[0]},phaseStories:{fontSize:t.fontSize.xs,color:t.colors.foregroundMuted,uni__dependencies:[0]},row:{flexDirection:"row",alignItems:"center",gap:t.spacing[2],paddingVertical:t.spacing[2],paddingHorizontal:t.spacing[3],borderRadius:t.borderRadius.lg,userSelect:"none",uni__dependencies:[0]},rowHovered:{backgroundColor:t.colors.surface1,uni__dependencies:[0]},childAgentLabel:{flex:1,fontSize:t.fontSize.base,color:t.colors.foreground,uni__dependencies:[0]},confirmBox:{gap:t.spacing[3],padding:t.spacing[3],borderRadius:t.borderRadius.lg,borderWidth:1,borderColor:t.colors.border,backgroundColor:t.colors.surface1,uni__dependencies:[0]},confirmText:{fontSize:t.fontSize.sm,color:t.colors.foreground,uni__dependencies:[0]},confirmActions:{flexDirection:"row",alignItems:"center",justifyContent:"flex-end",gap:t.spacing[2],uni__dependencies:[0]},secondaryActionText:{fontSize:t.fontSize.sm,fontWeight:t.fontWeight.medium,color:t.colors.foregroundMuted,uni__dependencies:[0]},dangerButton:{alignSelf:"flex-start",paddingVertical:t.spacing[2],paddingHorizontal:t.spacing[3],borderRadius:t.borderRadius.lg,borderWidth:1,borderColor:t.colors.statusDanger,userSelect:"none",uni__dependencies:[0]},dangerButtonHovered:{backgroundColor:t.colors.surface1,uni__dependencies:[0]},dangerActionText:{fontSize:t.fontSize.sm,fontWeight:t.fontWeight.medium,color:t.colors.statusDanger,uni__dependencies:[0]},errorText:{fontSize:t.fontSize.xs,color:t.colors.statusDanger,uni__dependencies:[0]}}))},4643,[348,711,690,1572,349,36,1308,182,234,146,56,1143,1600,3617,3615,3271,3477,279]);
|
|
16403
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return v}});var t=r(d[0]);r(d[1]);var s=r(d[2]),o=r(d[3]),n=r(d[4]),u=r(d[5]),c=r(d[6]),l=r(d[7]),p=r(d[8]),k=r(d[9]),S=r(d[10]);const h=(0,k.shouldUseDesktopDaemon)();function v(){const k=(0,t.c)(15),v=(0,s.usePathname)(),H=(0,n.useHostRuntimeBootstrapState)(),f=(0,n.useEarliestOnlineHostServerId)(),W=(0,c.useHosts)(),y=(0,c.useHostRegistryStatus)(),x=(0,p.useLastWorkspaceSelection)(),B=(0,p.useIsLastWorkspaceSelectionHydrated)(),I=x?.serverId??null,R=x?.workspaceId??null,U=(0,l.useHasHydratedWorkspaces)(I),b=(0,l.useWorkspaceExists)(I,R);let j;k[0]!==f||k[1]!==H.hasGivenUpWaitingForHost||k[2]!==H.startupBlocker||k[3]!==U||k[4]!==y||k[5]!==W||k[6]!==B||k[7]!==v||k[8]!==x||k[9]!==b?(j=(0,u.resolveStartupRoute)({route:{kind:"index",pathname:v},startupBlocker:H.startupBlocker,hostRegistryStatus:y,hosts:W,anyOnlineHostServerId:f,workspaceSelection:x,workspaceSelectionStatus:(0,u.resolveWorkspaceSelectionStatus)({hasHydratedWorkspaces:U,workspaceExists:b}),isWorkspaceSelectionLoaded:B,hasGivenUpWaitingForHost:H.hasGivenUpWaitingForHost}),k[0]=f,k[1]=H.hasGivenUpWaitingForHost,k[2]=H.startupBlocker,k[3]=U,k[4]=y,k[5]=W,k[6]=B,k[7]=v,k[8]=x,k[9]=b,k[10]=j):j=k[10];const w=j;if("redirect"===w.kind){let t;return k[11]!==w.href?(t=(0,S.jsx)(s.Redirect,{href:w.href}),k[11]=w.href,k[12]=t):t=k[12],t}const F=h?H:void 0;let G;return k[13]!==F?(G=(0,S.jsx)(o.StartupSplashScreen,{bootstrapState:F}),k[13]=F,k[14]=G):G=k[14],G}},4644,[349,36,1143,4400,347,4124,3271,3525,3487,3403,279]);
|
|
16404
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}});var t=r(d[0]),o=r(d[1]),n=r(d[2]),s=r(d[3]),c=r(d[4]);function u(){const u=(0,t.c)(13),l=(0,o.useLocalSearchParams)(),f="string"==typeof l.serverId?l.serverId:"",p="string"==typeof l.dir?l.dir:void 0,y="string"==typeof l.name?l.name:void 0,v="string"==typeof l.projectId?l.projectId:void 0,I="string"==typeof l.draftId?l.draftId:void 0;let j;u[0]!==y||u[1]!==I||u[2]!==v||u[3]!==f||u[4]!==p?(j=JSON.stringify([f,p??null,y??null,v??null,I??null]),u[0]=y,u[1]=I,u[2]=v,u[3]=f,u[4]=p,u[5]=j):j=u[5];const _=j;let b;return u[6]!==y||u[7]!==I||u[8]!==v||u[9]!==_||u[10]!==f||u[11]!==p?(b=(0,c.jsx)(n.HostRouteBootstrapBoundary,{children:(0,c.jsx)(s.NewWorkspaceScreen,{serverId:f,sourceDirectory:p,displayName:y,projectId:v,draftId:I},_)}),u[6]=y,u[7]=I,u[8]=v,u[9]=_,u[10]=f,u[11]=p,u[12]=b):b=u[12],b}},4645,[349,1143,4399,4646,279]);
|
|
16405
|
+
__d(function(g,r,i,_a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.NewWorkspaceScreen=function({serverId:o,sourceDirectory:n,projectId:a,displayName:l,draftId:b}){const{theme:j}=(0,p.useUnistyles)(),{t:w}=(0,c.useTranslation)(),v=(0,f.useSafeAreaInsets)(),x=(0,R.useIsCompactFormFactor)(),C=(0,T.useToast)(),D=(0,F.useSessionStore)(e=>e.mergeWorkspaces),{allHosts:K,selectedServerId:V,hostPickerOpen:L,handleSelectHost:N,handleHostPickerOpenChange:$,openHostPicker:G,projects:U,routeProject:X,lastActiveProject:Z}=tt({serverId:o,sourceDirectory:n,projectId:a,displayName:l}),re=(0,z.useHostFeature)(V,"workspaceMultiplicity"),[oe,se]=(0,s.useState)(null),[me,fe]=(0,s.useState)(null),[he,Se]=(0,s.useState)(null),[be,Ie]=(0,s.useState)(null),[ye,Pe]=(0,s.useState)(!1),[De,Oe]=(0,s.useState)(!1),[Me,Re]=(0,s.useState)(!1),[Le,Ne]=(0,s.useState)(""),[Ee,Ge]=(0,s.useState)(""),Ue=(0,s.useRef)(null),Xe=(0,s.useRef)(null),Je=(0,s.useRef)(null),Ye=(0,s.useRef)(null),et=le({draftId:b,selectedServerId:V});(0,s.useEffect)(()=>{const e=Le.trim(),t=setTimeout(()=>Ge(e),180);return()=>clearTimeout(t)},[Le]);const rt=me,st=(jr={pendingAction:he,isDraftHandoffActive:et},null!==jr.pendingAction||jr.isDraftHandoffActive),it=(0,A.useHostRuntimeClient)(V),ct=(0,A.useHostRuntimeIsConnected)(V),{selectedProject:at,selectedSourceDirectory:lt,projectPickerOptions:dt,projectByOptionId:ut,selectedProjectOptionId:pt,projectTriggerLabel:mt,handleSelectProjectOption:ft}=(0,ie.useNewWorkspaceProjectPicker)({selectedServerId:V,projects:U,routeProject:X,lastActiveProject:Z,allowAllProjects:re}),ht=(0,E.useProjectPickerStore)(e=>e.open),St=(0,s.useMemo)(()=>[...dt,{id:ue,label:"Open project\u2026"}],[dt]),bt=(0,s.useMemo)(()=>U.flatMap(e=>{const t=(0,J.getHostProjectSourceDirectory)(e,V)?.trim();return t?[{projectKey:e.projectKey,serverId:V,iconWorkingDir:t}]:[]}),[U,V]),gt=(0,Y.useProjectIconDataByProjectKey)({projects:bt}),It=ze({selectedServerId:V,selectedSourceDirectory:lt,draftId:b}),kt=Ze(b),yt=(0,ee.useDraftWorkspaceAttachmentScopeKey)(b),jt=(0,s.useMemo)(()=>de({isDraftHandoffActive:et,draftContextScopeKey:yt}),[yt,et]),wt=(0,B.useAgentInputDraft)({draftKey:It,composer:qe({serverId:V,isConnected:ct,workspaceDirectory:rt?.workspaceDirectory??null,sourceDirectory:lt,initialSetup:kt?.setup})}),vt=wt.composerState,[xt,Pt]=Qe(wt.attachments),Ct=He(be),Dt=(0,s.useCallback)(()=>{if(!it||!ct)throw new Error(w("newWorkspace.errors.hostDisconnected"));return it},[it,ct,w]),Ot=ct&&Boolean(it),Wt=null!==lt,Mt=ye&&Ot&&Wt,Rt=(0,S.useQuery)({queryKey:["checkout-status",V,lt],queryFn:async()=>{if(!lt)throw new Error("Choose a project");return Dt().getCheckoutStatus(lt)},enabled:Ot&&Wt,staleTime:1/0,refetchOnMount:!1,refetchOnReconnect:!1,refetchOnWindowFocus:!1}),Tt=Rt.data?.currentBranch??null,{effectiveIsolation:Bt,setIsolation:_t,canCreateWorktree:At,showRefPicker:zt}=Te({supportsMultiplicity:re,selectedIsGit:!0===Rt.data?.isGit}),Ht=(0,S.useQuery)({queryKey:["branch-suggestions",V,lt,Ee],queryFn:async()=>{if(!lt)throw new Error("Choose a project");return Dt().getBranchSuggestions({cwd:lt,query:Ee||void 0,limit:20})},enabled:Mt,staleTime:15e3}),Ft=(0,_.useGithubSearchQuery)({client:it,serverId:V,cwd:lt??"",query:Ee,kinds:["github-pr"],enabled:Mt}),Kt=(0,s.useMemo)(()=>Fe(Ht.data),[Ht.data]),Vt=!1!==Ft.data?.githubFeaturesEnabled,Lt=(0,s.useMemo)(()=>Vt?Ft.data?.items??[]:[],[Vt,Ft.data?.items]),{options:Nt,itemById:Et}=(0,s.useMemo)(()=>We(Kt,Lt),[Kt,Lt]),$t=(0,s.useMemo)(()=>{return Ct?"branch"===(e=Ct).kind?e.name:Ce(e.item):Tt??"main";var e},[Tt,Ct]),qt=(0,s.useMemo)(()=>Ct?"branch"===Ct.kind?je(Ct.name):we(Ct.item.number):"",[Ct]),Gt=(0,s.useCallback)(e=>{const t=(0,ne.syncPickerPrAttachment)({attachments:wt.attachments,previousPickerPrNumber:be?.attachedPrNumber??null,item:e});Ie({item:e,attachedPrNumber:t.attachedPrNumber}),t.attachments!==wt.attachments&&wt.setAttachments(t.attachments),Pe(!1)},[wt,be?.attachedPrNumber]),Ut=(0,s.useCallback)(e=>{const t=Et.get(e);t&&Gt(t)},[Et,Gt]),Qt=(0,s.useCallback)(e=>{if(e===ue)return Oe(!1),void ht(V);ft(e),Oe(!1),Ie(null)},[ht,ft,V]),Xt=(0,s.useMemo)(()=>(0,ne.findCheckoutHintPrAttachment)({attachments:wt.attachments,selectedItem:Ct,dismissedPrNumbers:xt}),[wt.attachments,xt,Ct]),Zt=(0,s.useCallback)(()=>{Xt&&Gt({kind:"github-pr",item:Xt.item})},[Xt,Gt]),Jt=(0,s.useCallback)(()=>{if(!Xt)return;const e=Xt.item.number;Pt(t=>{if(t.has(e))return t;const o=new Set(t);return o.add(e),o})},[Xt,Pt]),Yt=(0,s.useCallback)(()=>{Pe(!0)},[]),er=(0,s.useCallback)(()=>{Oe(!0)},[]),tr=(0,s.useCallback)(()=>{Re(!0)},[]),rr=(0,s.useCallback)(e=>{Re(e)},[]),or=(0,s.useMemo)(()=>{const e={id:"local",label:Be(w,"local")};return At?[e,{id:"worktree",label:Be(w,"worktree")}]:[e]},[At,w]),nr=(0,s.useCallback)(e=>{_t("worktree"===e?"worktree":"local"),Re(!1)},[_t]),sr=(0,s.useCallback)(({option:e,selected:t,active:o,onPress:n})=>(0,ce.jsx)(ke,{optionId:e.id,label:e.label,selected:t,active:o,disabled:st,onPress:n,iconColor:j.colors.foregroundMuted,iconSize:j.iconSize.sm}),[st,j.colors.foregroundMuted,j.iconSize.sm]),ir=(0,s.useCallback)(()=>{},[]),cr=(0,s.useCallback)(e=>{Pe(e),e||Ne("")},[]),ar=(0,s.useCallback)(e=>{Oe(e)},[]),lr=(0,s.useCallback)(e=>{const t=lt??e.cwd;if(!t)throw new Error("Choose a folder for this workspace");const o=ae(Ct,Tt),n=pe(e);return Object.assign({cwd:t},at?{projectId:at.projectKey}:{},{worktreeSlug:(0,h.createNameId)()},n?{firstAgentContext:n}:{},o)},[Tt,Ct,at,lt]),dr=(0,s.useCallback)(async e=>{if(me)return me;if(re&&at&<){const t=await Ve({client:Dt(),isolation:Bt,project:at,sourceDirectory:lt,selectedItem:Ct,currentBranch:Tt,withInitialAgent:e.withInitialAgent,prompt:e.prompt,attachments:e.attachments,mergeWorkspaces:D,serverId:V,createFailedMessage:w("newWorkspace.errors.createWorktreeFailed")});return fe(t),t}const t=await Ke({client:Dt(),createInput:lr(e),mergeWorkspaces:D,serverId:V,createFailedMessage:w("newWorkspace.errors.createWorktreeFailed")});return fe(t),t},[lr,me,Tt,Bt,D,Ct,at,V,lt,re,w,Dt]),ur=(0,s.useCallback)(async e=>{try{if(se(null),await(vt?.persistFormPreferences()),(0,te.isEmptyWorkspaceSubmission)(e))return Se("empty"),void await(0,te.runCreateEmptyWorkspace)({payload:e,ensureWorkspace:dr,serverId:V,navigate:(e,t)=>(0,H.navigateToWorkspace)(e,t)});Se("chat"),await $e({payload:e,composerState:vt,forkDraftSetup:kt,ensureWorkspace:dr,serverId:V,draftKey:It,draftId:b,labels:{composerStateRequired:w("newWorkspace.errors.composerStateRequired"),selectModel:w("newWorkspace.errors.selectModel")}})}catch(e){const t=(0,Q.toErrorMessage)(e);Se(null),se(t),C.error(t)}},[vt,b,It,dr,kt,V,w,C]),pr=(0,s.useCallback)(e=>(0,ce.jsx)(ve,Object.assign({},e,{itemById:Et,isPending:st})),[st,Et]),mr=(0,s.useCallback)(e=>e.option.id===ue?(0,ce.jsx)(P.ComboboxItem,{testID:"new-workspace-project-picker-open-project",label:e.option.label,kind:"directory",active:e.active,onPress:e.onPress}):(0,ce.jsx)(xe,Object.assign({},e,{projectByOptionId:ut,projectIconDataByProjectKey:gt,selectedServerId:V,isPending:st,supportsWorkspaceMultiplicity:re})),[st,ut,gt,V,re]),fr=(0,s.useMemo)(()=>Ae({isCompact:x,insetBottom:v.bottom}),[x,v.bottom]),{style:hr}=(0,q.useKeyboardShiftStyle)({mode:"translate"}),Sr=(0,s.useMemo)(()=>[nt.centered,hr],[hr]),br=(0,s.useMemo)(()=>vt?Object.assign({},vt.agentControls,{disabled:st}):void 0,[vt,st]),gr=Ht.isFetching||Ft.isFetching?w("newWorkspace.refPicker.searching"):w("newWorkspace.refPicker.noMatchingRefs"),Ir=ot({isCompact:x,isPending:st,project:{anchorRef:Xe,open:er,options:St,triggerLabel:mt,selectedProject:at,iconDataByProjectKey:gt,selectedOptionId:pt,onSelect:Qt,openState:De,onOpenChange:ar,renderOption:mr},host:{allHosts:K,selectedServerId:V,onSelect:N,openState:L,onOpenChange:$,anchorRef:Ye,open:G},isolation:{anchorRef:Je,open:tr,effectiveIsolation:Bt,options:or,onSelect:nr,openState:Me,onOpenChange:rr,renderOption:sr,canCreateWorktree:At},base:{anchorRef:Ue,open:Yt,selectedSourceDirectory:lt,selectedItem:Ct,triggerLabel:$t,options:Nt,selectedOptionId:qt,onSelect:Ut,openState:ye,onOpenChange:cr,setSearchQuery:Ne,emptyText:gr,renderOption:pr,showRefPicker:zt}}),kr=(0,s.useMemo)(()=>(0,ce.jsxs)(ce.Fragment,{children:[br?(0,ce.jsx)(y.DraftAgentModeControl,Object.assign({placement:"footer"},br)):null,Xt?(0,ce.jsx)(ge,{label:w("newWorkspace.refPicker.checkoutHint",{number:Xt.item.number}),acceptLabel:w("newWorkspace.refPicker.checkoutPr",{number:Xt.item.number}),dismissLabel:w("newWorkspace.refPicker.dismissCheckoutHint",{number:Xt.item.number}),onAccept:Zt,onDismiss:Jt,iconColor:j.colors.foregroundMuted,iconSize:j.iconSize.sm}):null]}),[Zt,br,Xt,Jt,w,j.colors.foregroundMuted,j.iconSize.sm]),yr=(0,s.useMemo)(()=>(0,ce.jsx)(W.SidebarMenuToggle,{}),[]);var jr;return(0,ce.jsxs)(k.FileDropZone,{style:nt.container,children:[(0,ce.jsx)(M.ScreenHeader,{left:yr,borderless:!0}),(0,ce.jsxs)(e.View,{style:fr,children:[(0,ce.jsx)(O.TitlebarDragRegion,{}),(0,ce.jsxs)(u.default.View,{style:Sr,children:[(0,ce.jsx)(e.View,{style:nt.composerTitleContainer,children:(0,ce.jsx)(t.Text,{style:nt.composerTitle,children:w("newWorkspace.title")})}),Ir,(0,ce.jsx)(I.Composer,{externalKeyboardShift:!0,agentId:It,serverId:V,isPaneFocused:!0,onSubmitMessage:ur,allowEmptySubmit:!0,submitButtonAccessibilityLabel:w("newWorkspace.create"),submitButtonTestID:"workspace-create-submit",submitIcon:"return",isSubmitLoading:st,submitBehavior:"preserve-and-lock",blurOnSubmit:!0,value:wt.text,onChangeText:wt.setText,attachments:wt.attachments,attachmentScopeKeys:jt,onChangeAttachments:wt.setAttachments,cwd:lt??"",clearDraft:ir,autoFocus:!0,commandDraftConfig:vt?.commandDraftConfig,agentControls:br,footer:kr}),oe?(0,ce.jsx)(t.Text,{style:nt.errorText,children:oe}):null]})]})]})};var e=r(d[0]),t=r(d[1]),o=r(d[2]),n=r(d[3]),s=r(d[4]),c=r(d[5]);r(d[6]),r(d[7]),r(d[8]);var a,l=r(d[9]),u=(a=l)&&a.__esModule?a:{default:a},p=r(d[10]),f=r(d[11]),h=r(d[12]),S=r(d[13]),b=r(d[14]),I=r(d[15]),k=r(d[16]),y=r(d[17]),j=r(d[18]),w=r(d[19]),v=r(d[20]),x=r(d[21]),P=r(d[22]),C=r(d[23]),D=r(d[24]),O=r(d[25]),W=r(d[26]),M=r(d[27]),R=r(d[28]),T=r(d[29]),B=r(d[30]),_=r(d[31]),A=r(d[32]),z=r(d[33]),H=r(d[34]),F=r(d[35]),K=r(d[36]),V=r(d[37]),L=r(d[38]),N=r(d[39]),E=r(d[40]),$=r(d[41]),q=r(d[42]),G=r(d[43]),U=r(d[44]),Q=r(d[45]),X=r(d[46]),Z=r(d[47]),J=r(d[48]),Y=r(d[49]),ee=r(d[50]),te=r(d[51]),re=r(d[52]),oe=r(d[53]),ne=r(d[54]),se=r(d[55]),ie=r(d[56]),ce=r(d[57]);function ae(e,t){const o=(0,oe.pickerItemToCheckoutRequest)(e);return o||(t?{action:"branch-off",refName:t}:void 0)}function le(e){const t=(0,n.c)(5);let o;t[0]!==e.draftId?(o=e.draftId?.trim()??"",t[0]=e.draftId,t[1]=o):o=t[1];const s=o;let c;return t[2]!==e.selectedServerId||t[3]!==s?(c=t=>(0,N.isActiveCreateFlowForDraft)({draftId:s,serverId:e.selectedServerId,pending:s?t.pendingByDraftId[s]:null}),t[2]=e.selectedServerId,t[3]=s,t[4]=c):c=t[4],(0,N.useCreateFlowStore)(c)}function de(e){return e.isDraftHandoffActive||!e.draftContextScopeKey?[]:[e.draftContextScopeKey]}const ue="action:open-project";function pe(e){const t=e.prompt.trim();if(t||0!==e.attachments.length)return Object.assign({},t?{prompt:t}:{},{attachments:e.attachments})}const me="branch:",fe="github-pr:";function he(o){const s=(0,n.c)(9),{selectedItem:c,triggerLabel:a,iconColor:l,iconSize:u}=o;let p,f,h;return s[0]!==l||s[1]!==u||s[2]!==c?.kind?(p=(0,ce.jsx)(e.View,{style:nt.badgeIconBox,children:"github-pr"===c?.kind?(0,ce.jsx)(b.GitPullRequest,{size:u,color:l}):(0,ce.jsx)(b.GitBranch,{size:u,color:l})}),s[0]=l,s[1]=u,s[2]=c?.kind,s[3]=p):p=s[3],s[4]!==a?(f=(0,ce.jsx)(t.Text,{style:nt.badgeText,numberOfLines:1,children:a}),s[4]=a,s[5]=f):f=s[5],s[6]!==p||s[7]!==f?(h=(0,ce.jsxs)(ce.Fragment,{children:[p,f]}),s[6]=p,s[7]=f,s[8]=h):h=s[8],h}function Se(e){const o=(0,n.c)(17),{pickerAnchorRef:s,onPress:c,disabled:a,badgePressableStyle:l,selectedItem:u,triggerLabel:p,accessibilityLabel:f,tooltipLabel:h,iconColor:S,iconSize:b}=e;let I,k,y,j;return o[0]!==S||o[1]!==b||o[2]!==u||o[3]!==p?(I=(0,ce.jsx)(he,{selectedItem:u,triggerLabel:p,iconColor:S,iconSize:b}),o[0]=S,o[1]=b,o[2]=u,o[3]=p,o[4]=I):I=o[4],o[5]!==f||o[6]!==l||o[7]!==a||o[8]!==c||o[9]!==s||o[10]!==I?(k=(0,ce.jsx)(D.TooltipTrigger,{asChild:!0,triggerRefProp:"ref",children:(0,ce.jsx)(C.ComboboxTrigger,{ref:s,testID:"new-workspace-ref-picker-trigger",onPress:c,disabled:a,style:l,accessibilityRole:"button",accessibilityLabel:f,children:I})}),o[5]=f,o[6]=l,o[7]=a,o[8]=c,o[9]=s,o[10]=I,o[11]=k):k=o[11],o[12]!==h?(y=(0,ce.jsx)(D.TooltipContent,{side:"top",align:"center",offset:8,children:(0,ce.jsx)(t.Text,{style:nt.tooltipText,children:h})}),o[12]=h,o[13]=y):y=o[13],o[14]!==k||o[15]!==y?(j=(0,ce.jsxs)(D.Tooltip,{children:[k,y]}),o[14]=k,o[15]=y,o[16]=j):j=o[16],j}function be(o){const s=(0,n.c)(20),{pickerAnchorRef:c,onPress:a,disabled:l,badgePressableStyle:u,label:p,projectKey:f,iconDataUri:h,iconColor:S,iconSize:I}=o;let k;if(s[0]!==p){k=(0,X.projectIconPlaceholderLabelFromDisplayName)(p).charAt(0).toUpperCase()||"?",s[0]=p,s[1]=k}else k=s[1];const y=k;let j,w,v,P,O;return s[2]!==S||s[3]!==h||s[4]!==I||s[5]!==y||s[6]!==f?(j=(0,ce.jsx)(e.View,{style:nt.badgeIconBox,children:f?(0,ce.jsx)(x.ProjectIconView,{iconDataUri:h,initial:y,projectKey:f,imageStyle:nt.projectIcon,fallbackStyle:nt.projectIconFallback,textStyle:nt.projectIconFallbackText}):(0,ce.jsx)(b.Folder,{size:I,color:S})}),s[2]=S,s[3]=h,s[4]=I,s[5]=y,s[6]=f,s[7]=j):j=s[7],s[8]!==p?(w=(0,ce.jsx)(t.Text,{style:nt.badgeText,numberOfLines:1,children:p}),s[8]=p,s[9]=w):w=s[9],s[10]!==u||s[11]!==l||s[12]!==a||s[13]!==c||s[14]!==j||s[15]!==w?(v=(0,ce.jsx)(D.TooltipTrigger,{asChild:!0,triggerRefProp:"ref",children:(0,ce.jsxs)(C.ComboboxTrigger,{ref:c,testID:"new-workspace-project-picker-trigger",onPress:a,disabled:l,style:u,accessibilityRole:"button",accessibilityLabel:"Workspace project",children:[j,w]})}),s[10]=u,s[11]=l,s[12]=a,s[13]=c,s[14]=j,s[15]=w,s[16]=v):v=s[16],s[17]===Symbol.for("react.memo_cache_sentinel")?(P=(0,ce.jsx)(D.TooltipContent,{side:"top",align:"center",offset:8,children:(0,ce.jsx)(t.Text,{style:nt.tooltipText,children:"Choose project"})}),s[17]=P):P=s[17],s[18]!==v?(O=(0,ce.jsxs)(D.Tooltip,{children:[v,P]}),s[18]=v,s[19]=O):O=s[19],O}function ge(s){const c=(0,n.c)(20),{label:a,acceptLabel:l,dismissLabel:u,onAccept:p,onDismiss:f,iconColor:h,iconSize:S}=s;let I,k,y,j,w,v;return c[0]!==a?(I=(0,ce.jsx)(t.Text,{style:nt.badgeText,numberOfLines:1,children:a}),c[0]=a,c[1]=I):I=c[1],c[2]!==h||c[3]!==S?(k=(0,ce.jsx)(b.Check,{size:S,color:h}),c[2]=h,c[3]=S,c[4]=k):k=c[4],c[5]!==l||c[6]!==p||c[7]!==k?(y=(0,ce.jsx)(o.Pressable,{testID:"new-workspace-checkout-hint-accept",onPress:p,style:nt.checkoutHintAction,accessibilityRole:"button",accessibilityLabel:l,children:k}),c[5]=l,c[6]=p,c[7]=k,c[8]=y):y=c[8],c[9]!==h||c[10]!==S?(j=(0,ce.jsx)(b.X,{size:S,color:h}),c[9]=h,c[10]=S,c[11]=j):j=c[11],c[12]!==u||c[13]!==f||c[14]!==j?(w=(0,ce.jsx)(o.Pressable,{testID:"new-workspace-checkout-hint-dismiss",onPress:f,style:nt.checkoutHintAction,accessibilityRole:"button",accessibilityLabel:u,children:j}),c[12]=u,c[13]=f,c[14]=j,c[15]=w):w=c[15],c[16]!==I||c[17]!==y||c[18]!==w?(v=(0,ce.jsxs)(e.View,{style:nt.checkoutHintBadge,children:[I,y,w]}),c[16]=I,c[17]=y,c[18]=w,c[19]=v):v=c[19],v}function Ie(t){const o=(0,n.c)(13),{testID:s,label:c,description:a,selected:l,active:u,disabled:p,onPress:f,isBranch:h,iconColor:S,iconSize:I}=t;let k;o[0]!==S||o[1]!==I||o[2]!==h?(k=(0,ce.jsx)(e.View,{style:nt.rowIconBox,children:h?(0,ce.jsx)(b.GitBranch,{size:I,color:S}):(0,ce.jsx)(b.GitPullRequest,{size:I,color:S})}),o[0]=S,o[1]=I,o[2]=h,o[3]=k):k=o[3];const y=k;let j;return o[4]!==u||o[5]!==a||o[6]!==p||o[7]!==c||o[8]!==y||o[9]!==f||o[10]!==l||o[11]!==s?(j=(0,ce.jsx)(P.ComboboxItem,{testID:s,label:c,description:a,selected:l,active:u,disabled:p,onPress:f,leadingSlot:y}),o[4]=u,o[5]=a,o[6]=p,o[7]=c,o[8]=y,o[9]=f,o[10]=l,o[11]=s,o[12]=j):j=o[12],j}function ke(t){const o=(0,n.c)(12),{optionId:s,label:c,selected:a,active:l,disabled:u,onPress:p,iconColor:f,iconSize:h}=t;let S;o[0]!==f||o[1]!==h||o[2]!==s?(S=(0,ce.jsx)(e.View,{style:nt.rowIconBox,children:"worktree"===s?(0,ce.jsx)(b.GitBranch,{size:h,color:f}):(0,ce.jsx)(b.Folder,{size:h,color:f})}),o[0]=f,o[1]=h,o[2]=s,o[3]=S):S=o[3];const I=S,k=`workspace-create-isolation-${s}`;let y;return o[4]!==l||o[5]!==u||o[6]!==c||o[7]!==I||o[8]!==p||o[9]!==a||o[10]!==k?(y=(0,ce.jsx)(P.ComboboxItem,{testID:k,label:c,selected:a,active:l,disabled:u,onPress:p,leadingSlot:I}),o[4]=l,o[5]=u,o[6]=c,o[7]=I,o[8]=p,o[9]=a,o[10]=k,o[11]=y):y=o[11],y}function ye(t){const o=(0,n.c)(15),{testID:s,projectKey:c,iconDataUri:a,label:l,description:u,selected:p,active:f,disabled:h,onPress:S}=t;let b;if(o[0]!==l){b=(0,X.projectIconPlaceholderLabelFromDisplayName)(l).charAt(0).toUpperCase()||"?",o[0]=l,o[1]=b}else b=o[1];const I=b;let k;o[2]!==a||o[3]!==I||o[4]!==c?(k=(0,ce.jsx)(e.View,{style:nt.rowIconBox,children:(0,ce.jsx)(x.ProjectIconView,{iconDataUri:a,initial:I,projectKey:c,imageStyle:nt.projectIcon,fallbackStyle:nt.projectIconFallback,textStyle:nt.projectIconFallbackText})}),o[2]=a,o[3]=I,o[4]=c,o[5]=k):k=o[5];const y=k;let j;return o[6]!==f||o[7]!==u||o[8]!==h||o[9]!==l||o[10]!==y||o[11]!==S||o[12]!==p||o[13]!==s?(j=(0,ce.jsx)(P.ComboboxItem,{testID:s,label:l,description:u,selected:p,active:f,disabled:h,onPress:S,leadingSlot:y}),o[6]=f,o[7]=u,o[8]=h,o[9]=l,o[10]=y,o[11]=S,o[12]=p,o[13]=s,o[14]=j):j=o[14],j}function je(e){return`${me}${e}`}function we(e){return`${fe}${e}`}function ve(t){const o=(0,n.c)(23),{option:s,selected:a,active:l,onPress:u,itemById:f,isPending:h}=t,{theme:S}=(0,p.useUnistyles)(),{t:b}=(0,c.useTranslation)();let I,k,y,j,w,v,x;if(o[0]!==f||o[1]!==s.id||o[2]!==b){v=Symbol.for("react.early_return_sentinel");e:{const t=f.get(s.id);if(!t){let t;o[9]!==s.id?(t=(0,ce.jsx)(e.View,{},s.id),o[9]=s.id,o[10]=t):t=o[10],v=t;break e}y="branch"===t.kind;const n=y?`new-workspace-ref-picker-branch-${t.name}`:`new-workspace-ref-picker-pr-${t.item.number}`;k=!y&&t.item.baseRefName?b("newWorkspace.refPicker.intoBase",{baseRef:t.item.baseRefName}):void 0,I=Ie,j=n,w=De(t)}o[0]=f,o[1]=s.id,o[2]=b,o[3]=I,o[4]=k,o[5]=y,o[6]=j,o[7]=w,o[8]=v}else I=o[3],k=o[4],y=o[5],j=o[6],w=o[7],v=o[8];return v!==Symbol.for("react.early_return_sentinel")?v:(o[11]!==I||o[12]!==l||o[13]!==k||o[14]!==y||o[15]!==h||o[16]!==u||o[17]!==a||o[18]!==j||o[19]!==w||o[20]!==S.colors.foregroundMuted||o[21]!==S.iconSize.sm?(x=(0,ce.jsx)(I,{testID:j,label:w,description:k,selected:a,active:l,disabled:h,onPress:u,isBranch:y,iconColor:S.colors.foregroundMuted,iconSize:S.iconSize.sm}),o[11]=I,o[12]=l,o[13]=k,o[14]=y,o[15]=h,o[16]=u,o[17]=a,o[18]=j,o[19]=w,o[20]=S.colors.foregroundMuted,o[21]=S.iconSize.sm,o[22]=x):x=o[22],x)}function xe(t){const o=(0,n.c)(31),{option:s,selected:c,active:a,onPress:l,projectByOptionId:u,projectIconDataByProjectKey:p,selectedServerId:f,isPending:h,supportsWorkspaceMultiplicity:S}=t;let b,I,k,y,j,w,v,x,P,C,D;if(o[0]!==a||o[1]!==h||o[2]!==s.id||o[3]!==u||o[4]!==p||o[5]!==c||o[6]!==f||o[7]!==S){C=Symbol.for("react.early_return_sentinel");e:{const t=u.get(s.id);if(!t){let t;o[18]!==s.id?(t=(0,ce.jsx)(e.View,{},s.id),o[18]=s.id,o[19]=t):t=o[19],C=t;break e}const n=(0,J.getHostProjectSourceDirectory)(t,f)??t.iconWorkingDir;b=ye,I=`new-workspace-project-picker-option-${t.projectKey}`,k=t.projectKey,y=p.get(t.projectKey)??null,j=t.projectName,w=n,v=c,x=a,P=h||!S&&!t.hosts.some(Pe)}o[0]=a,o[1]=h,o[2]=s.id,o[3]=u,o[4]=p,o[5]=c,o[6]=f,o[7]=S,o[8]=b,o[9]=I,o[10]=k,o[11]=y,o[12]=j,o[13]=w,o[14]=v,o[15]=x,o[16]=P,o[17]=C}else b=o[8],I=o[9],k=o[10],y=o[11],j=o[12],w=o[13],v=o[14],x=o[15],P=o[16],C=o[17];return C!==Symbol.for("react.early_return_sentinel")?C:(o[20]!==b||o[21]!==l||o[22]!==I||o[23]!==k||o[24]!==y||o[25]!==j||o[26]!==w||o[27]!==v||o[28]!==x||o[29]!==P?(D=(0,ce.jsx)(b,{testID:I,projectKey:k,iconDataUri:y,label:j,description:w,selected:v,active:x,disabled:P,onPress:l}),o[20]=b,o[21]=l,o[22]=I,o[23]=k,o[24]=y,o[25]=j,o[26]=w,o[27]=v,o[28]=x,o[29]=P,o[30]=D):D=o[30],D)}function Pe(e){return e.canCreateWorktree}function Ce(e){return`#${e.number} ${e.title}`}function De(e){return"branch"===e.kind?e.name:Ce(e.item)}function Oe(e){return`new-workspace-host-picker-option-${e}`}function We(e,t){const o=new Map,n=[];for(const t of e){const e=je(t.name),s={id:e,label:t.name};o.set(e,{kind:"branch",name:t.name}),n.push({option:s,timestamp:t.committerDate})}for(const e of t){if(!e.headRefName)continue;const t=we(e.number),s={id:t,label:Ce(e)};o.set(t,{kind:"github-pr",item:e});const c=e.updatedAt?Date.parse(e.updatedAt):0,a=Number.isNaN(c)?0:Math.floor(c/1e3);n.push({option:s,timestamp:a})}return n.sort((e,t)=>t.timestamp-e.timestamp),{options:n.map(e=>e.option),itemById:o}}function Me(o){const s=(0,n.c)(13),{pickerAnchorRef:c,onPress:a,disabled:l,badgePressableStyle:u,isolation:p,label:f,iconColor:h,iconSize:S}=o;let I,k,y;return s[0]!==h||s[1]!==S||s[2]!==p?(I=(0,ce.jsx)(e.View,{style:nt.badgeIconBox,children:"worktree"===p?(0,ce.jsx)(b.GitBranch,{size:S,color:h}):(0,ce.jsx)(b.Folder,{size:S,color:h})}),s[0]=h,s[1]=S,s[2]=p,s[3]=I):I=s[3],s[4]!==f?(k=(0,ce.jsx)(t.Text,{style:nt.badgeText,numberOfLines:1,children:f}),s[4]=f,s[5]=k):k=s[5],s[6]!==u||s[7]!==l||s[8]!==a||s[9]!==c||s[10]!==I||s[11]!==k?(y=(0,ce.jsxs)(C.ComboboxTrigger,{ref:c,testID:"workspace-create-isolation-trigger",onPress:a,disabled:l,style:u,accessibilityRole:"button",accessibilityLabel:"Workspace isolation",children:[I,k]}),s[6]=u,s[7]=l,s[8]=a,s[9]=c,s[10]=I,s[11]=k,s[12]=y):y=s[12],y}function Re(t){const o=(0,n.c)(2),{children:s}=t;let c;return o[0]!==s?(c=(0,ce.jsx)(e.View,{style:nt.row,children:s}),o[0]=s,o[1]=c):c=o[1],c}function Te(e){const t=(0,n.c)(8),{supportsMultiplicity:o,selectedIsGit:c}=e,{preferences:a,updatePreferences:l}=(0,G.useFormPreferences)(),[u,p]=(0,s.useState)(null),f=u??a.isolation??"local",h=o&&c,S="worktree"===f&&h;let b;t[0]!==l?(b=e=>{p(e),l({isolation:e})},t[0]=l,t[1]=b):b=t[1];const I=b,k=S?"worktree":"local",y=!o||S;let j;return t[2]!==h||t[3]!==f||t[4]!==I||t[5]!==k||t[6]!==y?(j={isolation:f,setIsolation:I,effectiveIsolation:k,canCreateWorktree:h,showRefPicker:y},t[2]=h,t[3]=f,t[4]=I,t[5]=k,t[6]=y,t[7]=j):j=t[7],j}function Be(e,t){return e("worktree"===t?"newWorkspace.isolation.worktree":"newWorkspace.isolation.local")}function Ae(e){return e.isCompact?[nt.content,nt.contentCompact,{paddingBottom:e.insetBottom}]:[nt.content,nt.contentCentered]}function ze(e){const t=e.draftId?.trim();return t?`new-workspace:draft:${t}`:`new-workspace:${e.selectedServerId}:${e.selectedSourceDirectory??"choose-project"}`}function He(e){return e?e.item:null}function Fe(e){const t=e?.branchDetails;if(t&&t.length>0)return t;return(e?.branches??[]).map(e=>({name:e,committerDate:0}))}async function Ke(e){const t=await e.client.createPaseoWorktree(e.createInput);if(t.error||!t.workspace)throw new Error(t.error??e.createFailedMessage);const o=(0,F.normalizeWorkspaceDescriptor)(t.workspace),n=e.createInput.firstAgentContext?Object.assign({},o,{status:"running",statusEnteredAt:new Date}):o;return e.mergeWorkspaces(e.serverId,[n]),o}async function Ve(e){const t="worktree"===e.isolation,o=t?ae(e.selectedItem,e.currentBranch):void 0,n=pe({prompt:e.prompt,attachments:e.attachments}),s=await e.client.createWorkspace(Object.assign({source:t?Object.assign({kind:"worktree",cwd:e.sourceDirectory,projectId:e.project.projectKey,worktreeSlug:(0,h.createNameId)()},o):{kind:"directory",path:e.sourceDirectory,projectId:e.project.projectKey}},n?{firstAgentContext:n}:{}));if(s.error||!s.workspace)throw new Error(s.error??e.createFailedMessage);const c=(0,F.normalizeWorkspaceDescriptor)(s.workspace),a=e.withInitialAgent?Object.assign({},c,{status:"running",statusEnteredAt:new Date}):c;return e.mergeWorkspaces(e.serverId,[a]),c}function Le(e){return{provider:e.provider,cwd:e.cwd,modeId:e.composerState.selectedMode||null,model:e.composerState.effectiveModelId||null,thinkingOptionId:e.composerState.effectiveThinkingOptionId||null,featureValues:e.composerState.featureValues??{}}}function Ne(e){if(e.forkDraftSetup)return Le({cwd:(0,re.remapDraftCwdToWorkspace)({cwd:e.forkDraftSetup.setup.cwd,sourceDirectory:e.forkDraftSetup.sourceDirectory,workspaceDirectory:e.workspaceDirectory}),provider:e.provider,composerState:e.composerState})}function Ee(e){return e.initialSetup?{workingDir:e.workingDir??e.initialSetup.cwd,provider:e.initialSetup.provider,modeId:e.initialSetup.modeId,model:e.initialSetup.model,thinkingOptionId:e.initialSetup.thinkingOptionId}:e.workingDir?{workingDir:e.workingDir}:void 0}async function $e(e){const{payload:t,composerState:o,ensureWorkspace:n,serverId:s,draftKey:c}=e,{text:a,attachments:l,cwd:u}=t;if(!o)throw new Error(e.labels.composerStateRequired);const p=o.selectedProvider;if(!p)throw new Error(e.labels.selectModel);const{attachments:f}=(0,j.splitComposerAttachmentsForSubmit)(l),h=(0,re.getWorkspaceNamingAttachments)(f),S=await n({cwd:u,prompt:a,attachments:h,withInitialAgent:!0}),b=Ne({forkDraftSetup:e.forkDraftSetup,workspaceDirectory:S.workspaceDirectory,provider:p,composerState:o});Ye({serverId:s,draftKey:c,draftId:e.draftId,initialSetup:b,workspaceId:S.id,workspaceDirectory:S.workspaceDirectory,text:a,attachments:l,provider:p,composerState:o})}function qe(e){const{serverId:t,isConnected:o,workspaceDirectory:n,sourceDirectory:s,initialSetup:c}=e,a=n||s||void 0;return{initialServerId:t||null,initialValues:Ee({workingDir:a,initialSetup:c}),initialFeatureValues:c?.featureValues,isVisible:!0,onlineServerIds:o&&t?[t]:[],lockedWorkingDir:a}}function Ge(e){const t=new Set;for(const o of e)"github_pr"===o.kind&&t.add(o.item.number);return t}function Ue(e,t){let o=!1;const n=new Set;for(const s of e)t.has(s)?n.add(s):o=!0;return o?n:e}function Qe(e){const t=(0,n.c)(7),[o,c]=(0,s.useState)(Xe);let a;t[0]!==e?(a=Ge(e),t[0]=e,t[1]=a):a=t[1];const l=a;let u,p,f;return t[2]!==l?(u=()=>{c(e=>Ue(e,l))},p=[l],t[2]=l,t[3]=u,t[4]=p):(u=t[3],p=t[4]),(0,s.useEffect)(u,p),t[5]!==o?(f=[o,c],t[5]=o,t[6]=f):f=t[6],f}function Xe(){return new Set}function Ze(e){const t=(0,n.c)(4);let o;t[0]!==e?(o=e?.trim()??"",t[0]=e,t[1]=o):o=t[1];const s=o;let c;return t[2]!==s?(c=e=>s?e.setupByDraftId[s]??null:null,t[2]=s,t[3]=c):c=t[3],(0,$.useWorkspaceDraftSubmissionStore)(c)}function Je(e){const{draftId:t,workspaceDirectory:o,provider:n,composerState:s,initialSetup:c}=e;return c?{cwd:c.cwd,provider:c.provider,modeId:c.modeId,model:c.model,thinkingOptionId:c.thinkingOptionId,featureValues:c.featureValues,target:{kind:"draft",draftId:t,setup:c}}:{cwd:o,provider:n,modeId:s.selectedMode||null,model:s.effectiveModelId||null,thinkingOptionId:s.effectiveThinkingOptionId||null,featureValues:s.featureValues,target:{kind:"draft",draftId:t}}}function Ye(e){const{serverId:t,draftKey:o,draftId:n,workspaceId:s,workspaceDirectory:c,text:a,attachments:l,provider:u,composerState:p,initialSetup:f}=e,h=n?.trim()||(0,V.generateDraftId)(),S=(0,U.generateMessageId)(),b=Date.now(),I=(0,j.splitComposerAttachmentsForSubmit)(l),k=Je({draftId:h,workspaceDirectory:c,provider:u,composerState:p,initialSetup:f});N.useCreateFlowStore.getState().setPending(Object.assign({serverId:t,draftId:h,workspaceId:s,agentId:null,clientMessageId:S,text:a.trim(),timestamp:b},I.images.length>0?{images:I.images}:{},I.attachments.length>0?{attachments:I.attachments}:{})),$.useWorkspaceDraftSubmissionStore.getState().setPending(Object.assign({serverId:t,workspaceId:s,draftId:h,text:a.trim(),attachments:l,cwd:k.cwd,provider:k.provider,clientMessageId:S,timestamp:b},k.modeId?{modeId:k.modeId}:{},k.model?{model:k.model}:{},k.thinkingOptionId?{thinkingOptionId:k.thinkingOptionId}:{},k.featureValues?{featureValues:k.featureValues}:{},{allowEmptyText:!0})),(0,Z.navigateToPreparedWorkspaceTab)({serverId:t,workspaceId:s,target:k.target}),L.useDraftStore.getState().clearDraftInput({draftKey:o,lifecycle:"sent"})}function et(e){const t=(0,n.c)(41);let o;t[0]!==e.initialServerId?(o=e.initialServerId.trim(),t[0]=e.initialServerId,t[1]=o):o=t[1];const c=o;let a;t[2]!==e.allServerIds||t[3]!==e.hostConnectionStatusByServerId||t[4]!==e.initialServerId||t[5]!==e.lastActiveProject||t[6]!==e.projects||t[7]!==e.workspaceMultiplicityByServerId?(a=(0,se.resolveNewWorkspaceInitialServerId)({allServerIds:e.allServerIds,routeServerId:e.initialServerId,lastActiveProject:e.lastActiveProject,projects:e.projects,hostConnectionStatusByServerId:e.hostConnectionStatusByServerId,workspaceMultiplicityByServerId:e.workspaceMultiplicityByServerId}),t[2]=e.allServerIds,t[3]=e.hostConnectionStatusByServerId,t[4]=e.initialServerId,t[5]=e.lastActiveProject,t[6]=e.projects,t[7]=e.workspaceMultiplicityByServerId,t[8]=a):a=t[8];const l=a;let u;t[9]!==l||t[10]!==c?(u=()=>({routeServerId:c,serverId:l}),t[9]=l,t[10]=c,t[11]=u):u=t[11];const[p,f]=(0,s.useState)(u),[h,S]=(0,s.useState)(null),[b,I]=(0,s.useState)(!1);let k,y,j;t[12]!==l||t[13]!==e.allServerIds||t[14]!==e.hostConnectionStatusByServerId||t[15]!==e.initialServerId||t[16]!==e.lastActiveProject||t[17]!==e.projects||t[18]!==e.workspaceMultiplicityByServerId||t[19]!==c?(k=()=>{f(t=>{const o=t.routeServerId===c?(0,se.resolveNewWorkspaceAutomaticServerId)({allServerIds:e.allServerIds,routeServerId:e.initialServerId,lastActiveProject:e.lastActiveProject,projects:e.projects,hostConnectionStatusByServerId:e.hostConnectionStatusByServerId,workspaceMultiplicityByServerId:e.workspaceMultiplicityByServerId,currentServerId:t.serverId,nextServerId:l}):l;return t.routeServerId===c&&t.serverId===o?t:{routeServerId:c,serverId:o}})},y=[l,e.allServerIds,e.hostConnectionStatusByServerId,e.initialServerId,e.lastActiveProject,e.projects,e.workspaceMultiplicityByServerId,c],t[12]=l,t[13]=e.allServerIds,t[14]=e.hostConnectionStatusByServerId,t[15]=e.initialServerId,t[16]=e.lastActiveProject,t[17]=e.projects,t[18]=e.workspaceMultiplicityByServerId,t[19]=c,t[20]=k,t[21]=y):(k=t[20],y=t[21]),(0,s.useEffect)(k,y),t[22]!==p.routeServerId||t[23]!==p.serverId||t[24]!==l||t[25]!==e.allServerIds||t[26]!==c?(j=p.routeServerId===c&&e.allServerIds.includes(p.serverId)?p.serverId:l,t[22]=p.routeServerId,t[23]=p.serverId,t[24]=l,t[25]=e.allServerIds,t[26]=c,t[27]=j):j=t[27];const w=j;let v;t[28]!==w||t[29]!==e.allServerIds||t[30]!==h||t[31]!==c?(v=h?.routeServerId===c&&e.allServerIds.includes(h.serverId)?h.serverId:w,t[28]=w,t[29]=e.allServerIds,t[30]=h,t[31]=c,t[32]=v):v=t[32];const x=v;let P;t[33]!==c?(P=e=>{S({routeServerId:c,serverId:e}),I(!1)},t[33]=c,t[34]=P):P=t[34];const C=P;let D;t[35]===Symbol.for("react.memo_cache_sentinel")?(D=e=>{I(e)},t[35]=D):D=t[35];const O=D;let W;t[36]===Symbol.for("react.memo_cache_sentinel")?(W=()=>{I(!0)},t[36]=W):W=t[36];const M=W;let R;return t[37]!==C||t[38]!==b||t[39]!==x?(R={selectedServerId:x,hostPickerOpen:b,handleSelectHost:C,handleHostPickerOpenChange:O,openHostPicker:M},t[37]=C,t[38]=b,t[39]=x,t[40]=R):R=t[40],R}function tt(e){const t=(0,n.c)(32),{serverId:o,sourceDirectory:s,projectId:c,displayName:a}=e,l=(0,A.useHosts)();let u;t[0]!==l?(u=l.map(rt),t[0]=l,t[1]=u):u=t[1];const p=u,f=(0,J.useHostProjects)(p);let h;t[2]!==a?(h=a?.trim()??"",t[2]=a,t[3]=h):h=t[3];const S=h;let b;t[4]!==c||t[5]!==S||t[6]!==o||t[7]!==s?(b=(0,J.hostProjectFromRoute)({serverId:o,projectId:c,displayName:S,sourceDirectory:s}),t[4]=c,t[5]=S,t[6]=o,t[7]=s,t[8]=b):b=t[8];const I=b,k=(0,H.useLastWorkspaceSelection)();let y;t[9]!==p||t[10]!==k?(y=k&&p.includes(k.serverId)?k.serverId:null,t[9]=p,t[10]=k,t[11]=y):y=t[11];const j=y,w=j?k.workspaceId:null,v=(0,K.useWorkspace)(j,w);let x;t[12]!==v||t[13]!==j?(x=j?(0,J.hostProjectFromWorkspace)({serverId:j,workspace:v}):null,t[12]=v,t[13]=j,t[14]=x):x=t[14];const P=x,C=(0,A.useHostRuntimeConnectionStatuses)(p),D=(0,z.useHostFeatureMap)(p,"workspaceMultiplicity");let O;t[15]!==p||t[16]!==C||t[17]!==P||t[18]!==f||t[19]!==o||t[20]!==D?(O={initialServerId:o,allServerIds:p,projects:f,lastActiveProject:P,hostConnectionStatusByServerId:C,workspaceMultiplicityByServerId:D},t[15]=p,t[16]=C,t[17]=P,t[18]=f,t[19]=o,t[20]=D,t[21]=O):O=t[21];const{selectedServerId:W,hostPickerOpen:M,handleSelectHost:R,handleHostPickerOpenChange:T,openHostPicker:B}=et(O);let _;return t[22]!==l||t[23]!==T||t[24]!==R||t[25]!==M||t[26]!==P||t[27]!==B||t[28]!==f||t[29]!==I||t[30]!==W?(_={allHosts:l,selectedServerId:W,hostPickerOpen:M,handleSelectHost:R,handleHostPickerOpenChange:T,openHostPicker:B,projects:f,routeProject:I,lastActiveProject:P},t[22]=l,t[23]=T,t[24]=R,t[25]=M,t[26]=P,t[27]=B,t[28]=f,t[29]=I,t[30]=W,t[31]=_):_=t[31],_}function rt(e){return e.serverId}function ot(n){const{theme:a}=(0,p.useUnistyles)(),{t:l}=(0,c.useTranslation)(),{isCompact:u,isPending:f,project:h,host:S,isolation:I,base:k}=n,y=S.allHosts.find(e=>e.serverId===S.selectedServerId)?.label??"Host",j=S.allHosts.length>1,x=Be(l,I.effectiveIsolation),C=(0,s.useCallback)(({pressed:e,hovered:t})=>[nt.badge,Boolean(t)&&!f&&nt.badgeHovered,e&&!f&&nt.badgePressed,f&&nt.badgeDisabled],[f]),D=(0,ce.jsxs)(e.View,{children:[(0,ce.jsx)(be,{pickerAnchorRef:h.anchorRef,onPress:h.open,disabled:f,badgePressableStyle:C,label:h.triggerLabel,projectKey:h.selectedProject?.projectKey??null,iconDataUri:h.selectedProject?h.iconDataByProjectKey.get(h.selectedProject.projectKey)??null:null,iconColor:a.colors.foregroundMuted,iconSize:a.iconSize.sm}),(0,ce.jsx)(P.Combobox,{options:h.options,value:h.selectedOptionId,onSelect:h.onSelect,searchable:!0,searchPlaceholder:"Search projects",title:"Project",open:h.openState,onOpenChange:h.onOpenChange,desktopPlacement:"bottom-start",anchorRef:h.anchorRef,emptyText:"No projects available.",renderOption:h.renderOption})]}),O=j?(0,ce.jsx)(e.View,{children:(0,ce.jsx)(v.HostPicker,{hosts:S.allHosts,value:S.selectedServerId,onSelect:S.onSelect,open:S.openState,onOpenChange:S.onOpenChange,anchorRef:S.anchorRef,searchable:!1,title:"Host",desktopPlacement:"bottom-start",hostOptionTestID:Oe,children:(0,ce.jsxs)(o.Pressable,{ref:S.anchorRef,onPress:S.open,disabled:f||0===S.allHosts.length,style:C,testID:"host-picker-trigger",children:[(0,ce.jsx)(w.HostStatusDot,{serverId:S.selectedServerId}),(0,ce.jsx)(t.Text,{style:nt.badgeText,numberOfLines:1,children:y}),(0,ce.jsx)(b.ChevronDown,{size:a.iconSize.sm,color:a.colors.foregroundMuted})]})})}):null,W=I.canCreateWorktree?(0,ce.jsxs)(e.View,{children:[(0,ce.jsx)(Me,{pickerAnchorRef:I.anchorRef,onPress:I.open,disabled:f,badgePressableStyle:C,isolation:I.effectiveIsolation,label:x,iconColor:a.colors.foregroundMuted,iconSize:a.iconSize.sm}),(0,ce.jsx)(P.Combobox,{options:I.options,value:I.effectiveIsolation,onSelect:I.onSelect,title:l("newWorkspace.isolation.label"),open:I.openState,onOpenChange:I.onOpenChange,desktopPlacement:"bottom-start",anchorRef:I.anchorRef,renderOption:I.renderOption})]}):null,M=k.showRefPicker?(0,ce.jsxs)(e.View,{children:[(0,ce.jsx)(Se,{pickerAnchorRef:k.anchorRef,onPress:k.open,disabled:f||!k.selectedSourceDirectory,badgePressableStyle:C,selectedItem:k.selectedItem,triggerLabel:k.triggerLabel,accessibilityLabel:l("newWorkspace.refPicker.startingRef"),tooltipLabel:l("newWorkspace.refPicker.chooseStart"),iconColor:a.colors.foregroundMuted,iconSize:a.iconSize.sm}),(0,ce.jsx)(P.Combobox,{options:k.options,value:k.selectedOptionId,onSelect:k.onSelect,searchable:!0,searchPlaceholder:l("newWorkspace.refPicker.searchPlaceholder"),title:l("newWorkspace.refPicker.title"),open:k.openState,onOpenChange:k.onOpenChange,onSearchQueryChange:k.setSearchQuery,desktopPlacement:"bottom-start",anchorRef:k.anchorRef,emptyText:k.emptyText,renderOption:k.renderOption})]}):null;return u?(0,ce.jsxs)(e.View,{testID:"new-workspace-ref-picker-row",style:nt.formStack,children:[(0,ce.jsx)(Re,{children:D}),O?(0,ce.jsx)(Re,{children:O}):null,W?(0,ce.jsx)(Re,{children:W}):(0,ce.jsx)(e.View,{style:nt.baseSpacer}),M?(0,ce.jsx)(Re,{children:M}):(0,ce.jsx)(e.View,{style:nt.baseSpacer})]}):(0,ce.jsxs)(e.View,{testID:"new-workspace-ref-picker-row",style:nt.formStackDesktop,children:[D,O,W,M]})}const nt=p.StyleSheet.create(e=>({container:{flex:1,backgroundColor:e.colors.surface0,userSelect:"none",uni__dependencies:[0]},content:{position:"relative",flex:1,alignItems:"center"},contentCentered:{justifyContent:"center",paddingBottom:R.HEADER_INNER_HEIGHT+e.spacing[6],uni__dependencies:[0]},contentCompact:{justifyContent:"flex-end"},centered:{width:"100%",maxWidth:R.MAX_CONTENT_WIDTH},composerTitleContainer:{marginBottom:e.spacing[8],paddingLeft:e.spacing[6],paddingRight:e.spacing[4],uni__dependencies:[0]},composerTitle:{fontSize:e.fontSize.xl,fontWeight:e.fontWeight.normal,color:e.colors.foreground,uni__dependencies:[0]},errorText:{fontSize:e.fontSize.sm,color:e.colors.destructive,lineHeight:20,uni__dependencies:[0]},formStack:{marginBottom:e.spacing[8],gap:e.spacing[2],uni__dependencies:[0]},formStackDesktop:{flexDirection:"row",alignItems:"center",marginBottom:e.spacing[8],paddingLeft:e.spacing[4],gap:e.spacing[2],uni__dependencies:[0]},row:{flexDirection:"row",alignItems:"center",paddingLeft:e.spacing[4],gap:e.spacing[1],uni__dependencies:[0]},baseSpacer:{height:28},badge:{flexDirection:"row",alignItems:"center",height:28,maxWidth:240,overflow:"hidden",paddingHorizontal:e.spacing[2],borderRadius:e.borderRadius["2xl"],gap:e.spacing[1],uni__dependencies:[0]},checkoutHintBadge:{flexDirection:"row",alignItems:"center",height:28,maxWidth:240,paddingHorizontal:e.spacing[2],borderRadius:e.borderRadius["2xl"],gap:e.spacing[1],backgroundColor:e.colors.surface1,uni__dependencies:[0]},checkoutHintAction:{width:e.iconSize.md,height:e.iconSize.md,alignItems:"center",justifyContent:"center",borderRadius:e.borderRadius.full,uni__dependencies:[0]},badgeHovered:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},badgePressed:{backgroundColor:e.colors.surface0,uni__dependencies:[0]},badgeDisabled:{opacity:.6},badgeText:{minWidth:0,fontSize:e.fontSize.sm,color:e.colors.foregroundMuted,flexShrink:1,uni__dependencies:[0]},tooltipText:{fontSize:e.fontSize.sm,color:e.colors.popoverForeground,uni__dependencies:[0]},badgeIconBox:{width:e.iconSize.md,height:e.iconSize.md,alignItems:"center",justifyContent:"center",flexShrink:0,uni__dependencies:[0]},projectIcon:{width:e.iconSize.md,height:e.iconSize.md,borderRadius:e.borderRadius.sm,uni__dependencies:[0]},projectIconFallback:{width:e.iconSize.md,height:e.iconSize.md,borderRadius:e.borderRadius.sm,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},projectIconFallbackText:{fontSize:10,fontWeight:"600"},rowIconBox:{width:e.iconSize.md,height:e.iconSize.md,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},hostStatusDot:{width:8,height:8,borderRadius:4}}))},4646,[348,711,1572,349,36,1573,1308,234,146,444,56,1320,3912,916,1600,3925,3916,3947,4011,3455,3454,3624,3456,3928,3573,3568,4406,4407,3457,3499,4076,4062,3271,3594,3487,3414,3525,3494,4082,3596,3478,4521,3884,3943,3416,3948,3532,3486,3592,3670,3841,4647,4648,4649,4650,4651,4652,279]);
|
|
16406
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.isEmptyWorkspaceSubmission=function(t){return!t.text.trim()&&0===t.attachments.length},e.runCreateEmptyWorkspace=async function(t){const{payload:n,ensureWorkspace:s,serverId:c,navigate:o}=t,u=await s({cwd:n.cwd,prompt:"",attachments:[],withInitialAgent:!1});o(c,u.id)}},4647,[]);
|
|
16407
|
+
__d(function(g,r,i,a,m,e,d){"use strict";function t(t){return/^[a-zA-Z]:\//.test(t)}function n(t){return"text"===t.type&&"chat_history"===t.contextKind}Object.defineProperty(e,'__esModule',{value:!0}),e.getWorkspaceNamingAttachments=function(t){return t.filter(t=>!n(t))},e.remapDraftCwdToWorkspace=function(n){const c=n.cwd.trim(),o=n.sourceDirectory?.trim(),s=n.workspaceDirectory.trim();if(!c||!o)return s;const u=c.replace(/\\/g,"/").replace(/\/+$/,""),l=o.replace(/\\/g,"/").replace(/\/+$/,""),f=t(u)||t(l),p=f?u.toLowerCase():u,h=f?l.toLowerCase():l;if(p===h)return s;const w=p.startsWith(`${h}/`)?u.slice(l.length+1):"";if(!w)return s;const y=s.includes("\\")&&!s.includes("/")?"\\":"/";return[s.replace(/[\\/]+$/,""),...w.split("/")].filter(Boolean).join(y)}},4648,[]);
|
|
16408
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.pickerItemToCheckoutRequest=function(t){if(!t)return;switch(t.kind){case"branch":return{action:"branch-off",refName:t.name};case"github-pr":{const c=t.item.headRefName?.trim();return Object.assign({action:"checkout"},c?{refName:c}:{},{githubPrNumber:t.item.number})}}}},4649,[]);
|
|
16409
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.syncPickerPrAttachment=function(t){let n=t.attachments,u=null;null!==t.previousPickerPrNumber&&(n=n.filter(n=>"github_pr"!==n.kind||n.item.number!==t.previousPickerPrNumber));if("github-pr"===t.item.kind){const c=t.item.item;n.some(t=>"github_pr"===t.kind&&t.item.number===c.number)||(n=[...n,{kind:"github_pr",item:c}],u=c.number)}return{attachments:n,attachedPrNumber:u}},e.findCheckoutHintPrAttachment=function(t){const n="github-pr"===t.selectedItem?.kind?t.selectedItem.item.number:null;for(const u of t.attachments){if("github_pr"!==u.kind)continue;const c=u.item.number;if(c!==n&&!t.dismissedPrNumbers.has(c))return u}return null}},4650,[]);
|
|
16410
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.resolveNewWorkspaceInitialServerId=function(t){const s=new Set(t.allServerIds),c=o(s,t.routeServerId);if(c)return c;const p=t.allServerIds.filter(o=>u(t.hostConnectionStatusByServerId,o)),I=p.filter(o=>l({projects:t.projects,serverId:o,workspaceMultiplicityByServerId:t.workspaceMultiplicityByServerId})),S=t.allServerIds.filter(o=>l({projects:t.projects,serverId:o,workspaceMultiplicityByServerId:t.workspaceMultiplicityByServerId})),y=n({serverIds:s,lastActiveProject:t.lastActiveProject,projects:t.projects,workspaceMultiplicityByServerId:t.workspaceMultiplicityByServerId});if(y&&u(t.hostConnectionStatusByServerId,y))return y;if(I.length>0)return I[0]??"";if(1===p.length)return p[0]??"";if(p.length>0)return p[0]??"";const f=S.filter(o=>!v(t.hostConnectionStatusByServerId,o));if(1===f.length)return f[0]??"";if(y)return y;if(1===S.length)return S[0]??"";return t.allServerIds[0]??""},e.resolveNewWorkspaceAutomaticServerId=function(t){const s=new Set(t.allServerIds),c=o(s,t.currentServerId),p=o(s,t.nextServerId)??t.allServerIds[0]??"";if(!c||c===p)return p;if(u(t.hostConnectionStatusByServerId,p)&&!u(t.hostConnectionStatusByServerId,c))return p;if(o(s,t.routeServerId)===p)return p;const I=n({serverIds:s,lastActiveProject:t.lastActiveProject,projects:t.projects,workspaceMultiplicityByServerId:t.workspaceMultiplicityByServerId}),S=t.allServerIds.some(o=>u(t.hostConnectionStatusByServerId,o));if(I===p&&(u(t.hostConnectionStatusByServerId,p)||!S))return p;const y=l({projects:t.projects,serverId:c,workspaceMultiplicityByServerId:t.workspaceMultiplicityByServerId}),f=l({projects:t.projects,serverId:p,workspaceMultiplicityByServerId:t.workspaceMultiplicityByServerId});if(v(t.hostConnectionStatusByServerId,c)&&f&&!v(t.hostConnectionStatusByServerId,p))return p;if(!y&&f&&(!u(t.hostConnectionStatusByServerId,c)||u(t.hostConnectionStatusByServerId,p)))return p;return c};var t=r(d[0]);function o(t,o){const s=o?.trim()??"";return s&&t.has(s)?s:null}function s(t){return t.projects.find(o=>o.projectKey===t.candidate.projectKey&&o.hosts.some(o=>o.serverId===t.serverId))??t.candidate}function c(o){const c=s({candidate:o.project,projects:o.projects,serverId:o.serverId});return(0,t.canCreateWorkspaceForHostProject)({project:c,serverId:o.serverId,allowAllProjects:(n=o.workspaceMultiplicityByServerId,l=o.serverId,!0===n.get(l))});var n,l}function n(t){if(!t.lastActiveProject)return null;for(const o of t.lastActiveProject.hosts)if(t.serverIds.has(o.serverId)&&c({project:t.lastActiveProject,projects:t.projects,serverId:o.serverId,workspaceMultiplicityByServerId:t.workspaceMultiplicityByServerId}))return o.serverId;return null}function l(t){return t.projects.some(o=>c({project:o,projects:t.projects,serverId:t.serverId,workspaceMultiplicityByServerId:t.workspaceMultiplicityByServerId}))}function u(t,o){return"online"===t.get(o)}function v(t,o){const s=t.get(o);return"offline"===s||"error"===s}},4651,[3592]);
|
|
16411
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useNewWorkspaceProjectPicker=function(c){const l=(0,t.c)(64),{selectedServerId:u,projects:y,routeProject:S,lastActiveProject:I,allowAllProjects:K}=c;let f;l[0]!==K||l[1]!==y||l[2]!==u?(f=(0,s.filterWorkspaceProjectsForHost)({projects:y,serverId:u,allowAllProjects:K}),l[0]=K,l[1]=y,l[2]=u,l[3]=f):f=l[3];const k=f;let w;l[4]!==K||l[5]!==I||l[6]!==S||l[7]!==k||l[8]!==u?(w=(0,s.resolveInitialWorkspaceProject)({routeProject:S,lastActiveProject:I,projects:k,serverId:u,allowAllProjects:K}),l[4]=K,l[5]=I,l[6]=S,l[7]=k,l[8]=u,l[9]=w):w=l[9];const A=w,h=S?.projectKey??null;let O;l[10]!==K||l[11]!==h||l[12]!==u?(O=(0,n.createProjectSelectionContextKey)({selectedServerId:u,routeProjectKey:h,allowAllProjects:K}),l[10]=K,l[11]=h,l[12]=u,l[13]=O):O=l[13];const W=O;let x;l[14]!==h||l[15]!==u?(x=(0,n.createManualProjectSelectionContextKey)({selectedServerId:u,routeProjectKey:h}),l[14]=h,l[15]=u,l[16]=x):x=l[16];const C=x;let D;l[17]!==u?(D=t=>P({selectedServerId:u,project:t}),l[17]=u,l[18]=D):D=l[18];const M=D;let _,b;l[19]!==A||l[20]!==I||l[21]!==S?(_=(0,n.resolveInitialProjectSelectionSource)({initialProject:A,routeProject:S,lastActiveProject:I}),l[19]=A,l[20]=I,l[21]=S,l[22]=_):_=l[22];l[23]!==A||l[24]!==I||l[25]!==C||l[26]!==S||l[27]!==k||l[28]!==W||l[29]!==M||l[30]!==_?(b={contextKey:W,manualContextKey:C,initialProject:A,initialProjectSource:_,projects:k,routeProject:S,lastActiveProject:I,shouldPreserveMissingProject:M},l[23]=A,l[24]=I,l[25]=C,l[26]=S,l[27]=k,l[28]=W,l[29]=M,l[30]=_,l[31]=b):b=l[31];const B=b;let H;l[32]!==B?(H=()=>(0,n.createProjectSelection)(B),l[32]=B,l[33]=H):H=l[33];const[N,$]=(0,o.useState)(H);let E,F,L,T,q,z,G,J,Q;l[34]!==B?(F=()=>{$(t=>(0,n.reconcileProjectSelection)(t,B))},E=[B],l[34]=B,l[35]=E,l[36]=F):(E=l[35],F=l[36]);if((0,o.useEffect)(F,E),l[37]!==K||l[38]!==C||l[39]!==N||l[40]!==k||l[41]!==u||l[42]!==B){const t=(0,n.reconcileProjectSelection)(N,B);let o;T=(0,n.resolveProjectSelection)(t,B),l[50]!==k?(o=p(k),l[50]=k,l[51]=o):o=l[51];const{options:c,projectByOptionId:P}=o;let y;l[52]!==K||l[53]!==C||l[54]!==P?(y=t=>{const o=P.get(t);o&&(K||o.hosts.some(v))&&$({contextKey:C,projectKey:o.projectKey,project:o,source:"manual"})},l[52]=K,l[53]=C,l[54]=P,l[55]=y):y=l[55],L=y,q=T,z=T?(0,s.getHostProjectSourceDirectory)(T,u):null,G=c,J=P,Q=T?j(T.projectKey):"",l[37]=K,l[38]=C,l[39]=N,l[40]=k,l[41]=u,l[42]=B,l[43]=L,l[44]=T,l[45]=q,l[46]=z,l[47]=G,l[48]=J,l[49]=Q}else L=l[43],T=l[44],q=l[45],z=l[46],G=l[47],J=l[48],Q=l[49];const R=T?.projectName??"Choose project";let U;l[56]!==L||l[57]!==q||l[58]!==z||l[59]!==G||l[60]!==J||l[61]!==Q||l[62]!==R?(U={selectedProject:q,selectedSourceDirectory:z,projectPickerOptions:G,projectByOptionId:J,selectedProjectOptionId:Q,projectTriggerLabel:R,handleSelectProjectOption:L},l[56]=L,l[57]=q,l[58]=z,l[59]=G,l[60]=J,l[61]=Q,l[62]=R,l[63]=U):U=l[63];return U};var t=r(d[0]),o=r(d[1]),c=r(d[2]),s=r(d[3]),n=r(d[4]);const l="project:";function j(t){return`${l}${t}`}function p(t){const o=new Map;return{options:t.map(t=>{const c=j(t.projectKey);return o.set(c,t),{id:c,label:t.projectName}}),projectByOptionId:o}}function u(t){const o=`${t.selectedServerId}:`;return t.workspaceKey.startsWith(o)?t.workspaceKey.slice(o.length):null}function P(t){for(const o of t.project.workspaceKeys){const s=u({selectedServerId:t.selectedServerId,workspaceKey:o});if(s&&(0,c.isWorkspaceArchivePending)({serverId:t.selectedServerId,workspaceId:s}))return!0}const o=(0,s.getHostProjectSourceDirectory)(t.project,t.selectedServerId);return(0,c.isWorkspaceArchivePending)({serverId:t.selectedServerId,workspaceDirectory:o})}function v(t){return t.canCreateWorktree}},4652,[349,36,3598,3592,4653]);
|
|
16412
|
+
__d(function(g,r,i,a,m,e,d){"use strict";function t({contextKey:t,initialProject:o}){return{contextKey:t,projectKey:o?.projectKey??null,project:o,source:"initial"}}function o(t){return(t.projectKey?.trim()??"")||null}function c(t,o){return(o.routeProject?.projectKey===t?o.routeProject:null)??(o.lastActiveProject?.projectKey===t?o.lastActiveProject:null)}function n(t,o){return t.projectKey===o.projectKey&&t.project===o?t:Object.assign({},t,{projectKey:o.projectKey,project:o})}function l(t,o){return!("initial"!==t.source||!o.initialProject||"lastActive"!==o.initialProjectSource)&&t.projectKey!==o.initialProject.projectKey}function u(t,n){const l=o(t);if(!l)return null;const u=n.projects.find(t=>t.projectKey===l);return u||(t.project?.projectKey===l&&n.shouldPreserveMissingProject(t.project)?t.project:"manual"!==t.source?c(l,n):null)}Object.defineProperty(e,'__esModule',{value:!0}),e.createProjectSelectionContextKey=function(t){const o=t.allowAllProjects?"all-projects":"worktree-projects";return`${t.selectedServerId}:${o}:${t.routeProjectKey??""}`},e.createManualProjectSelectionContextKey=function(t){return`${t.selectedServerId}:${t.routeProjectKey??""}`},e.createProjectSelection=t,e.resolveInitialProjectSelectionSource=function(t){if(!t.initialProject)return null;if(t.routeProject?.projectKey===t.initialProject.projectKey)return"route";if(t.lastActiveProject?.projectKey===t.initialProject.projectKey)return"lastActive";return"fallback"},e.resolveProjectSelection=u,e.reconcileProjectSelection=function(o,c){const j=t(c),s="manual"===o.source?c.manualContextKey:c.contextKey;if(o.contextKey!==s)return j;if(l(o,c))return j;const p=u(o,c);if(p)return n(o,p);return j}},4653,[]);
|
|
16413
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),c=r(d[3]);function u(){const u=(0,t.c)(1);let s;return u[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,c.jsx)(n.HostRouteBootstrapBoundary,{children:(0,c.jsx)(o.OpenProjectScreen,{})}),u[0]=s):s=u[0],s}},4654,[349,4399,4655,279]);
|
|
16414
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.OpenProjectScreen=function(){const t=(0,n.c)(65),{t:o}=(0,l.useTranslation)(),p=(0,u.useRouter)(),A=(0,b.usePanelStore)(T),N=(0,h.useOpenProjectPicker)(),M=(0,P.useHostChooser)(),L=(0,y.useLocalDaemonServerId)(),[k,z]=(0,c.useState)(null),B=(0,v.useHostRuntimeClient)(k??""),G=(0,R.useOpenProject)(k),[V,W]=(0,c.useState)(!1),[F,U]=(0,c.useState)(!1),q=(0,I.useIsCompactFormFactor)();let J,K,Q;t[0]!==q||t[1]!==A?(J=()=>{q||A()},K=[q,A],t[0]=q,t[1]=A,t[2]=J,t[3]=K):(J=t[2],K=t[3]);(0,c.useEffect)(J,K),t[4]!==N?(Q=()=>{N()},t[4]=N,t[5]=Q):Q=t[5];const X=Q;let Y;t[6]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>W(!0),t[6]=Y):Y=t[6];const Z=Y;let $;t[7]===Symbol.for("react.memo_cache_sentinel")?($=()=>W(!1),t[7]=$):$=t[7];const ee=$;let te;t[8]!==M?(te=()=>{M({title:"Import from host",onChooseHost:t=>{z(t),U(!0)}})},t[8]=M,t[9]=te):te=t[9];const oe=te;let se;t[10]===Symbol.for("react.memo_cache_sentinel")?(se=()=>U(!1),t[10]=se):se=t[10];const ne=se;let ie;t[11]!==k||t[12]!==G||t[13]!==p?(ie=t=>{k&&(async()=>{(await G(t.cwd)).ok&&p.push((0,H.buildHostAgentDetailRoute)(k,t.id))})()},t[11]=k,t[12]=G,t[13]=p,t[14]=ie):ie=t[14];const re=ie;let ce;t[15]!==M||t[16]!==p?(ce=()=>{M({title:"Choose host",onChooseHost:t=>{p.push((0,H.buildSettingsHostSectionRoute)(t,"providers"))}})},t[15]=M,t[16]=p,t[17]=ce):ce=t[17];const le=ce;let de,ae,pe,ue,me,_e,ge,je,xe,fe,he,Pe,be,Ie,Se,ye,De,He;t[18]===Symbol.for("react.memo_cache_sentinel")?(de=(0,C.jsx)(f.MenuHeader,{borderless:!0}),t[18]=de):de=t[18];t[19]===Symbol.for("react.memo_cache_sentinel")?(ae=(0,C.jsx)(S.TitlebarDragRegion,{}),t[19]=ae):ae=t[19];t[20]===Symbol.for("react.memo_cache_sentinel")?(pe=(0,C.jsx)(s.View,{style:O.logo,children:(0,C.jsx)(j.PaseoLogo,{size:52})}),t[20]=pe):pe=t[20];t[21]!==o?(ue=o("openProject.tiles.addProject.title"),t[21]=o,t[22]=ue):ue=t[22];t[23]!==o?(me=o("openProject.tiles.addProject.description"),t[23]=o,t[24]=me):me=t[24];t[25]!==X||t[26]!==ue||t[27]!==me?(_e=(0,C.jsx)(w,{icon:_.FolderOpen,title:ue,description:me,onPress:X,testID:"open-project-submit",accent:!0}),t[25]=X,t[26]=ue,t[27]=me,t[28]=_e):_e=t[28];t[29]!==o?(ge=o("openProject.tiles.importSession.title"),t[29]=o,t[30]=ge):ge=t[30];t[31]!==o?(je=o("openProject.tiles.importSession.description"),t[31]=o,t[32]=je):je=t[32];t[33]!==oe||t[34]!==ge||t[35]!==je?(xe=(0,C.jsx)(w,{icon:_.Inbox,title:ge,description:je,onPress:oe,testID:"open-project-import-session"}),t[33]=oe,t[34]=ge,t[35]=je,t[36]=xe):xe=t[36];t[37]!==o?(fe=o("openProject.tiles.setupProviders.title"),t[37]=o,t[38]=fe):fe=t[38];t[39]!==o?(he=o("openProject.tiles.setupProviders.description"),t[39]=o,t[40]=he):he=t[40];t[41]!==le||t[42]!==fe||t[43]!==he?(Pe=(0,C.jsx)(w,{icon:_.Plug,title:fe,description:he,onPress:le,testID:"open-project-setup-providers"}),t[41]=le,t[42]=fe,t[43]=he,t[44]=Pe):Pe=t[44];t[45]!==L||t[46]!==o?(be=L?(0,C.jsx)(w,{icon:_.Smartphone,title:o("openProject.tiles.pairDevice.title"),description:o("openProject.tiles.pairDevice.description"),onPress:Z,testID:"open-project-pair-device"}):null,t[45]=L,t[46]=o,t[47]=be):be=t[47];t[48]!==_e||t[49]!==xe||t[50]!==Pe||t[51]!==be?(Ie=(0,C.jsxs)(s.View,{style:O.content,children:[ae,pe,(0,C.jsxs)(s.View,{style:O.tiles,children:[_e,xe,Pe,be]})]}),t[48]=_e,t[49]=xe,t[50]=Pe,t[51]=be,t[52]=Ie):Ie=t[52];t[53]===Symbol.for("react.memo_cache_sentinel")?(Se=(0,C.jsx)(s.View,{style:O.communityRow,children:(0,C.jsx)(x.CommunityLinks,{})}),t[53]=Se):Se=t[53];t[54]!==V?(ye=(0,C.jsx)(D.PairDeviceModal,{visible:V,onClose:ee,testID:"open-project-pair-device-modal"}),t[54]=V,t[55]=ye):ye=t[55];t[56]!==re||t[57]!==B||t[58]!==k||t[59]!==F?(De=(0,C.jsx)(E.ImportSessionSheet,{visible:F,client:B,serverId:k,onClose:ne,onImported:re}),t[56]=re,t[57]=B,t[58]=k,t[59]=F,t[60]=De):De=t[60];t[61]!==Ie||t[62]!==ye||t[63]!==De?(He=(0,C.jsxs)(s.View,{style:O.container,children:[de,Ie,Se,ye,De]}),t[61]=Ie,t[62]=ye,t[63]=De,t[64]=He):He=t[64];return He};var t=r(d[0]),o=r(d[1]),s=r(d[2]),n=r(d[3]),c=r(d[4]),l=r(d[5]);r(d[6]),r(d[7]),r(d[8]);var p=r(d[9]),u=r(d[10]),_=r(d[11]),j=r(d[12]),x=r(d[13]),f=r(d[14]),h=r(d[15]),P=r(d[16]),b=r(d[17]),I=r(d[18]),S=r(d[19]),y=r(d[20]),D=r(d[21]),H=r(d[22]),E=r(d[23]),v=r(d[24]),R=r(d[25]),C=r(d[26]);function T(t){return t.openDesktopAgentList}function w(l){const u=(0,n.c)(20),{icon:_,title:j,description:x,onPress:f,testID:h,accent:P}=l,{theme:b}=(0,p.useUnistyles)(),[I,S]=(0,c.useState)(!1);let y;u[0]===Symbol.for("react.memo_cache_sentinel")?(y=()=>S(!0),u[0]=y):y=u[0];const D=y;let H;u[1]===Symbol.for("react.memo_cache_sentinel")?(H=()=>S(!1),u[1]=H):H=u[1];const E=H,v=P?b.colors.accent:b.colors.foregroundMuted;let R;u[2]!==I?(R=t=>{const{pressed:o}=t;return[O.tile,I&&O.tileHovered,o&&O.tilePressed]},u[2]=I,u[3]=R):R=u[3];const T=R;let w,A,N,M,L;return u[4]!==_||u[5]!==v?(w=(0,C.jsx)(_,{size:20,color:v}),u[4]=_,u[5]=v,u[6]=w):w=u[6],u[7]!==j?(A=(0,C.jsx)(o.Text,{style:O.tileTitle,children:j}),u[7]=j,u[8]=A):A=u[8],u[9]!==x?(N=(0,C.jsx)(o.Text,{style:O.tileDescription,children:x}),u[9]=x,u[10]=N):N=u[10],u[11]!==A||u[12]!==N?(M=(0,C.jsxs)(s.View,{style:O.tileText,children:[A,N]}),u[11]=A,u[12]=N,u[13]=M):M=u[13],u[14]!==f||u[15]!==T||u[16]!==w||u[17]!==M||u[18]!==h?(L=(0,C.jsxs)(t.Pressable,{onPress:f,onHoverIn:D,onHoverOut:E,testID:h,style:T,children:[w,M]}),u[14]=f,u[15]=T,u[16]=w,u[17]=M,u[18]=h,u[19]=L):L=u[19],L}const O=p.StyleSheet.create(t=>({container:{flex:1,backgroundColor:t.colors.surface0,userSelect:"none",uni__dependencies:[0]},content:{position:"relative",flex:1,justifyContent:{xs:"flex-start",md:"center"},alignItems:"center",gap:0,padding:t.spacing[6],paddingTop:{xs:t.spacing[12],md:t.spacing[6]},paddingBottom:{xs:I.HEADER_INNER_HEIGHT_MOBILE+I.HEADER_TOP_PADDING_MOBILE+t.spacing[6],md:I.HEADER_INNER_HEIGHT+t.spacing[6]},uni__dependencies:[0]},logo:{marginBottom:t.spacing[8],uni__dependencies:[0]},tiles:{marginTop:{xs:t.spacing[6],md:t.spacing[12]},width:"100%",maxWidth:452,flexDirection:"row",flexWrap:"wrap",justifyContent:"flex-start",gap:t.spacing[3],uni__dependencies:[0]},tile:{width:{xs:"100%",md:220},minHeight:{xs:0,md:132},padding:t.spacing[4],backgroundColor:t.colors.surface1,borderWidth:1,borderColor:t.colors.border,borderRadius:t.borderRadius.xl,gap:t.spacing[3],uni__dependencies:[0]},tileHovered:{backgroundColor:t.colors.surface2,borderColor:t.colors.borderAccent,uni__dependencies:[0]},tilePressed:{opacity:.85},tileText:{gap:t.spacing[1],uni__dependencies:[0]},tileTitle:{color:t.colors.foreground,fontSize:t.fontSize.base,fontWeight:t.fontWeight.normal,uni__dependencies:[0]},tileDescription:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,lineHeight:18,uni__dependencies:[0]},communityRow:{position:"absolute",left:0,right:0,bottom:{xs:I.HEADER_INNER_HEIGHT_MOBILE+I.HEADER_TOP_PADDING_MOBILE+t.spacing[2],md:I.HEADER_INNER_HEIGHT+t.spacing[2]},flexDirection:"row",justifyContent:"center",alignItems:"center",gap:0,uni__dependencies:[0]}}))},4655,[1572,711,348,349,36,1573,146,234,1308,56,1143,1600,4403,4656,4406,3452,3453,3582,3457,3568,3475,4658,3477,4624,3271,3894,279]);
|
|
16415
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.CommunityLinks=function(){const o=(0,n.c)(1),l=I,u=j,h=y;let v;o[0]===Symbol.for("react.memo_cache_sentinel")?(v=(0,p.jsxs)(t.View,{style:b.row,children:[(0,p.jsx)(c.Button,{variant:"ghost",size:"sm",leftIcon:f,onPress:l,testID:"community-links-github-star",children:"Star"}),(0,p.jsx)(c.Button,{variant:"ghost",size:"sm",leftIcon:s.Heart,onPress:u,testID:"community-links-sponsor",children:"Sponsor"}),(0,p.jsx)(c.Button,{variant:"ghost",size:"sm",leftIcon:x,onPress:h,testID:"community-links-discord",children:"Community"})]}),o[0]=v):v=o[0];return v};var t=r(d[0]),n=r(d[1]);r(d[2]),r(d[3]);var o=r(d[4]),s=r(d[5]),c=r(d[6]),l=r(d[7]),u=r(d[8]),h=r(d[9]),p=r(d[10]);const f=t=>(0,p.jsx)(l.GitHubIcon,{color:t,size:14}),x=t=>(0,p.jsx)(u.DiscordIcon,{color:t,size:14});function y(){(0,h.openExternalUrl)("https://discord.gg/jz8T2uahpH")}function j(){(0,h.openExternalUrl)("https://github.com/sponsors/boudra")}function I(){(0,h.openExternalUrl)("https://github.com/getpaseo/paseo")}const b=o.StyleSheet.create(()=>({row:{flexDirection:"row",justifyContent:"center",alignItems:"center",gap:0}}))},4656,[348,349,36,146,56,1600,3627,3675,4657,3562,279]);
|
|
16416
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.DiscordIcon=function(c){const n=(0,e.c)(4),{size:s,color:u}=c,_=void 0===s?16:s,f=void 0===u?"currentColor":u;let h,v;n[0]===Symbol.for("react.memo_cache_sentinel")?(h=(0,l.jsx)(o.Path,{d:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"}),n[0]=h):h=n[0];n[1]!==f||n[2]!==_?(v=(0,l.jsx)(t.default,{width:_,height:_,viewBox:"0 0 24 24",fill:f,children:h}),n[1]=f,n[2]=_,n[3]=v):v=n[3];return v};var c,e=r(d[0]),o=r(d[1]),t=(c=o)&&c.__esModule?c:{default:c},l=r(d[2])},4657,[349,1604,279]);
|
|
16417
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.PairDeviceModal=function(v){const u=(0,t.c)(10),{visible:h,onClose:_,testID:p}=v,{t:D}=(0,s.useTranslation)();let b,f;u[0]!==D?(b=D("settings.host.pairDevices.rowTitle"),u[0]=D,u[1]=b):b=u[1];u[2]!==b?(f={title:b},u[2]=b,u[3]=f):f=u[3];const M=f;let P,j;u[4]===Symbol.for("react.memo_cache_sentinel")?(P=(0,c.jsx)(n.PairDeviceSection,{}),u[4]=P):P=u[4];u[5]!==M||u[6]!==_||u[7]!==p||u[8]!==h?(j=(0,c.jsx)(o.AdaptiveModalSheet,{header:M,visible:h,onClose:_,snapPoints:l,desktopMaxWidth:640,testID:p,children:P}),u[5]=M,u[6]=_,u[7]=p,u[8]=h,u[9]=j):j=u[9];return j};var t=r(d[0]);r(d[1]);var s=r(d[2]),o=r(d[3]),n=r(d[4]),c=r(d[5]);const l=["82%","94%"]},4658,[349,36,1573,3466,4659,279]);
|
|
16418
|
+
__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){if(e&&e.__esModule)return e;var n={};return e&&Object.keys(e).forEach(function(t){var o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,o.get?o:{enumerable:!0,get:function(){return e[t]}})}),n.default=e,n}Object.defineProperty(_e,'__esModule',{value:!0}),_e.PairDeviceSection=function(){const{theme:e}=(0,b.useUnistyles)(),{t:t}=(0,u.useTranslation)(),o=(0,j.shouldUseDesktopDaemon)(),[l,s]=(0,d.useState)(!1),c=(0,y.useQuery)({queryKey:["desktop-daemon-pairing"],queryFn:j.getDesktopDaemonPairing,enabled:o,staleTime:3e5,retry:1}),x=(0,y.useQuery)({queryKey:["desktop-daemon-pairing-qr",c.data?.url],queryFn:()=>f.toDataURL(c.data.url,{errorCorrectionLevel:"M",margin:1,width:480}),enabled:!!c.data?.url,staleTime:1/0}),_=(0,d.useCallback)(async()=>{c.data?.url&&(await p.setStringAsync(c.data.url),s(!0),setTimeout(()=>s(!1),2e3))},[c.data?.url]),w=(0,d.useCallback)(()=>{c.refetch()},[c]),z=(0,d.useCallback)(()=>{_()},[_]),C=(0,d.useMemo)(()=>x.data?{uri:x.data}:null,[x.data]),k=(0,d.useMemo)(()=>(0,S.jsx)(h.RotateCw,{size:e.iconSize.sm,color:e.colors.foreground}),[e.iconSize.sm,e.colors.foreground]),O=(0,d.useMemo)(()=>l?(0,S.jsx)(h.Check,{size:e.iconSize.sm,color:e.colors.accent}):(0,S.jsx)(h.Copy,{size:e.iconSize.sm,color:e.colors.foreground}),[l,e.iconSize.sm,e.colors.accent,e.colors.foreground]),T=(0,d.useMemo)(()=>({loadingOffer:t("pairing.device.loadingOffer"),hint:t("pairing.device.hint"),qrUnavailable:t("pairing.device.qrUnavailable"),retry:t("pairing.device.retry"),copy:t("pairing.device.copy"),copied:t("pairing.device.copied")}),[t]);if(!o)return null;const D=q({isPending:c.isPending,isError:c.isError,error:c.error,data:c.data,labels:{failedToLoadOffer:t("pairing.device.failedToLoadOffer"),relayDisabled:t("pairing.device.relayDisabled"),unavailable:t("pairing.device.unavailable")}});return(0,S.jsx)(n.View,{style:v.settingsStyles.section,testID:"host-page-pair-device-card",children:(0,S.jsx)(n.View,{style:v.settingsStyles.card,children:(0,S.jsx)(I,{viewState:D,theme:e,retryIcon:k,copyButtonIcon:O,qrImageSource:C,qrQuery:x,copied:l,handleRefetch:w,handleCopyPress:z,labels:T})})})};var n=r(_d[0]),t=r(_d[1]),o=r(_d[2]),l=r(_d[3]),s=r(_d[4]),c=r(_d[5]),d=r(_d[6]),u=r(_d[7]);r(_d[8]),r(_d[9]),r(_d[10]),r(_d[11]),r(_d[12]);var p=e(r(_d[13])),f=e(r(_d[14])),y=r(_d[15]),b=r(_d[16]),h=r(_d[17]),v=r(_d[18]),x=r(_d[19]),j=r(_d[20]),S=r(_d[21]);function q(e){if(e.isPending)return{tag:"loading"};if(e.isError){return{tag:"error",message:e.error instanceof Error?e.error.message:e.labels.failedToLoadOffer}}if(!e.data?.url){return{tag:"unavailable",message:!1===e.data?.relayEnabled?e.labels.relayDisabled:e.labels.unavailable}}return{tag:"ready",url:e.data.url}}function I(e){const l=(0,c.c)(32),{viewState:d,theme:u,retryIcon:p,copyButtonIcon:f,qrImageSource:y,qrQuery:b,copied:h,handleRefetch:v,handleCopyPress:j,labels:q}=e;if("loading"===d.tag){let e,t;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,S.jsx)(s.ActivityIndicator,{size:"small"}),l[0]=e):e=l[0],l[1]!==q.loadingOffer?(t=(0,S.jsxs)(n.View,{style:w.centered,children:[e,(0,S.jsx)(o.Text,{style:w.hint,children:q.loadingOffer})]}),l[1]=q.loadingOffer,l[2]=t):t=l[2],t}if("error"===d.tag||"unavailable"===d.tag){let e,t,s;return l[3]!==d.message?(e=(0,S.jsx)(o.Text,{style:w.hint,children:d.message}),l[3]=d.message,l[4]=e):e=l[4],l[5]!==v||l[6]!==q.retry||l[7]!==p?(t=(0,S.jsx)(x.Button,{variant:"outline",size:"sm",leftIcon:p,onPress:v,children:q.retry}),l[5]=v,l[6]=q.retry,l[7]=p,l[8]=t):t=l[8],l[9]!==e||l[10]!==t?(s=(0,S.jsxs)(n.View,{style:w.centered,children:[e,t]}),l[9]=e,l[10]=t,l[11]=s):s=l[11],s}let I,z,C;l[12]!==q.hint?(I=(0,S.jsx)(o.Text,{style:w.hint,children:q.hint}),l[12]=q.hint,l[13]=I):I=l[13],l[14]!==q.qrUnavailable||l[15]!==y||l[16]!==b?(z=(0,S.jsx)(n.View,{style:w.qrContainer,children:(0,S.jsx)(_,{qrImageSource:y,qrQuery:b,unavailableLabel:q.qrUnavailable})}),l[14]=q.qrUnavailable,l[15]=y,l[16]=b,l[17]=z):z=l[17],l[18]!==u.colors.accent||l[19]!==d.url?(C=(0,S.jsx)(n.View,{style:w.inputWrapper,children:(0,S.jsx)(t.TextInput,{style:w.linkInput,value:d.url,readOnly:!0,selectTextOnFocus:!0,selectionColor:u.colors.accent})}),l[18]=u.colors.accent,l[19]=d.url,l[20]=C):C=l[20];const k=h?q.copied:q.copy;let O,T,D;return l[21]!==f||l[22]!==j||l[23]!==k?(O=(0,S.jsx)(x.Button,{variant:"outline",size:"sm",leftIcon:f,onPress:j,children:k}),l[21]=f,l[22]=j,l[23]=k,l[24]=O):O=l[24],l[25]!==C||l[26]!==O?(T=(0,S.jsxs)(n.View,{style:w.linkRow,children:[C,O]}),l[25]=C,l[26]=O,l[27]=T):T=l[27],l[28]!==I||l[29]!==z||l[30]!==T?(D=(0,S.jsxs)(n.View,{style:w.content,children:[I,z,T]}),l[28]=I,l[29]=z,l[30]=T,l[31]=D):D=l[31],D}function _(e){const n=(0,c.c)(5);if(e.qrImageSource){let t;return n[0]!==e.qrImageSource?(t=(0,S.jsx)(l.Image,{source:e.qrImageSource,style:w.qrImage,resizeMode:"contain"}),n[0]=e.qrImageSource,n[1]=t):t=n[1],t}if(e.qrQuery.isError){let t;return n[2]!==e.unavailableLabel?(t=(0,S.jsx)(o.Text,{style:w.hint,children:e.unavailableLabel}),n[2]=e.unavailableLabel,n[3]=t):t=n[3],t}let t;return n[4]===Symbol.for("react.memo_cache_sentinel")?(t=(0,S.jsx)(s.ActivityIndicator,{size:"small"}),n[4]=t):t=n[4],t}const w=b.StyleSheet.create(e=>({centered:{alignItems:"center",justifyContent:"center",gap:e.spacing[3],paddingVertical:e.spacing[6],paddingHorizontal:e.spacing[4],uni__dependencies:[0]},content:{gap:e.spacing[3],padding:e.spacing[4],uni__dependencies:[0]},hint:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,textAlign:"center",uni__dependencies:[0]},qrContainer:{alignItems:"center",justifyContent:"center",alignSelf:"center",width:320,height:320,borderRadius:e.borderRadius.lg,borderWidth:1,borderColor:e.colors.border,backgroundColor:e.colors.surface0,padding:e.spacing[2],uni__dependencies:[0]},qrImage:{width:"100%",height:"100%"},linkRow:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},inputWrapper:{flex:1,borderRadius:e.borderRadius.md,borderWidth:1,borderColor:e.colors.border,backgroundColor:e.colors.surface0,overflow:"hidden",uni__dependencies:[0]},linkInput:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,paddingVertical:e.spacing[2],paddingHorizontal:e.spacing[3],outlineStyle:"none"}}))},4659,[348,714,711,688,3519,349,36,1573,1401,224,234,715,146,3628,4660,916,56,1600,3907,3627,3403,279]);
|
|
16419
|
+
__d(function(g,r,i,a,m,_e,d){const t=r(d[0]),n=r(d[1]),e=r(d[2]),o=r(d[3]);function c(e,o,c,l,u){const f=[].slice.call(arguments,1),s=f.length,v='function'==typeof f[s-1];if(!v&&!t())throw new Error('Callback required as last argument');if(!v){if(s<1)throw new Error('Too few arguments provided');return 1===s?(c=o,o=l=void 0):2!==s||o.getContext||(l=c,c=o,o=void 0),new Promise(function(t,u){try{const u=n.create(c,l);t(e(u,o,l))}catch(t){u(t)}})}if(s<2)throw new Error('Too few arguments provided');2===s?(u=c,c=o,o=l=void 0):3===s&&(o.getContext&&void 0===u?(u=l,l=void 0):(u=l,l=c,c=o,o=void 0));try{const t=n.create(c,l);u(null,e(t,o,l))}catch(t){u(t)}}_e.create=n.create,_e.toCanvas=c.bind(null,e.render),_e.toDataURL=c.bind(null,e.renderToDataURL),_e.toString=c.bind(null,function(t,n,e){return o.render(t,e)})},4660,[4661,4662,4685,4687]);
|
|
16420
|
+
__d(function(g,r,i,a,m,e,d){m.exports=function(){return'function'==typeof Promise&&Promise.prototype&&Promise.prototype.then}},4661,[]);
|
|
16421
|
+
__d(function(g,_r,_i,a,m,e,d){const t=_r(d[0]),o=_r(d[1]),n=_r(d[2]),r=_r(d[3]),s=_r(d[4]),i=_r(d[5]),f=_r(d[6]),c=_r(d[7]),l=_r(d[8]),u=_r(d[9]),h=_r(d[10]),w=_r(d[11]),C=_r(d[12]);function y(t,o){const n=t.size,r=i.getPositions(o);for(let o=0;o<r.length;o++){const s=r[o][0],i=r[o][1];for(let o=-1;o<=7;o++)if(!(s+o<=-1||n<=s+o))for(let r=-1;r<=7;r++)i+r<=-1||n<=i+r||(o>=0&&o<=6&&(0===r||6===r)||r>=0&&r<=6&&(0===o||6===o)||o>=2&&o<=4&&r>=2&&r<=4?t.set(s+o,i+r,!0,!0):t.set(s+o,i+r,!1,!0))}}function S(t){const o=t.size;for(let n=8;n<o-8;n++){const o=n%2==0;t.set(n,6,o,!0),t.set(6,n,o,!0)}}function p(t,o){const n=s.getPositions(o);for(let o=0;o<n.length;o++){const r=n[o][0],s=n[o][1];for(let o=-2;o<=2;o++)for(let n=-2;n<=2;n++)-2===o||2===o||-2===n||2===n||0===o&&0===n?t.set(r+o,s+n,!0,!0):t.set(r+o,s+n,!1,!0)}}function v(t,o){const n=t.size,r=u.getEncodedBits(o);let s,i,f;for(let o=0;o<18;o++)s=Math.floor(o/3),i=o%3+n-8-3,f=1==(r>>o&1),t.set(s,i,f,!0),t.set(i,s,f,!0)}function B(t,o,n){const r=t.size,s=h.getEncodedBits(o,n);let i,f;for(i=0;i<15;i++)f=1==(s>>i&1),i<6?t.set(i,8,f,!0):i<8?t.set(i+1,8,f,!0):t.set(r-15+i,8,f,!0),i<8?t.set(8,r-i-1,f,!0):i<9?t.set(8,15-i-1+1,f,!0):t.set(8,15-i-1,f,!0);t.set(r-8,8,1,!0)}function b(t,o){const n=t.size;let r=-1,s=n-1,i=7,f=0;for(let c=n-1;c>0;c-=2)for(6===c&&c--;;){for(let n=0;n<2;n++)if(!t.isReserved(s,c-n)){let r=!1;f<o.length&&(r=1==(o[f]>>>i&1)),t.set(s,c-n,r),i--,-1===i&&(f++,i=7)}if(s+=r,s<0||n<=s){s-=r,r=-r;break}}}function M(o,r,s){const i=new n;s.forEach(function(t){i.put(t.mode.bit,4),i.put(t.getLength(),w.getCharCountIndicator(t.mode,o)),t.write(i)});const f=8*(t.getSymbolTotalCodewords(o)-c.getTotalCodewordsCount(o,r));for(i.getLengthInBits()+4<=f&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);const l=(f-i.getLengthInBits())/8;for(let t=0;t<l;t++)i.put(t%2?17:236,8);return I(i,o,r)}function I(o,n,r){const s=t.getSymbolTotalCodewords(n),i=s-c.getTotalCodewordsCount(n,r),f=c.getBlocksCount(n,r),u=f-s%f,h=Math.floor(s/f),w=Math.floor(i/f),C=w+1,y=h-w,S=new l(y);let p=0;const v=new Array(f),B=new Array(f);let b=0;const M=new Uint8Array(o.buffer);for(let t=0;t<f;t++){const o=t<u?w:C;v[t]=M.slice(p,p+o),B[t]=S.encode(v[t]),p+=o,b=Math.max(b,o)}const I=new Uint8Array(s);let A,E,T=0;for(A=0;A<b;A++)for(E=0;E<f;E++)A<v[E].length&&(I[T++]=v[E][A]);for(A=0;A<y;A++)for(E=0;E<f;E++)I[T++]=B[E][A];return I}function A(o,n,s,i){let c;if(Array.isArray(o))c=C.fromArray(o);else{if('string'!=typeof o)throw new Error('Invalid data');{let t=n;if(!t){const n=C.rawSplit(o);t=u.getBestVersionForData(n,s)}c=C.fromString(o,t||40)}}const l=u.getBestVersionForData(c,s);if(!l)throw new Error('The amount of data is too big to be stored in a QR Code');if(n){if(n<l)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+l+'.\n')}else n=l;const h=M(n,s,c),w=t.getSymbolSize(n),I=new r(w);return y(I,n),S(I),p(I,n),B(I,s,0),n>=7&&v(I,n),b(I,h),isNaN(i)&&(i=f.getBestMask(I,B.bind(null,I,s))),f.applyMask(i,I),B(I,s,i),{modules:I,version:n,errorCorrectionLevel:s,maskPattern:i,segments:c}}e.create=function(n,r){if(void 0===n||''===n)throw new Error('No input text');let s,i,c=o.M;return void 0!==r&&(c=o.from(r.errorCorrectionLevel,o.M),s=u.from(r.version),i=f.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),A(n,s,c,i)}},4662,[4663,4664,4665,4666,4667,4668,4669,4670,4671,4674,4678,4675,4679]);
|
|
16422
|
+
__d(function(g,r,i,a,m,e,d){let n;const o=[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(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return 4*n+17},e.getSymbolTotalCodewords=function(n){return o[n]},e.getBCHDigit=function(n){let o=0;for(;0!==n;)o++,n>>>=1;return o},e.setToSJISFunction=function(o){if('function'!=typeof o)throw new Error('"toSJISFunc" is not a valid function.');n=o},e.isKanjiModeEnabled=function(){return void 0!==n},e.toSJIS=function(o){return n(o)}},4663,[]);
|
|
16423
|
+
__d(function(g,r,i,a,m,_e,d){function t(t){if('string'!=typeof t)throw new 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 new Error('Unknown EC Level: '+t)}}_e.L={bit:1},_e.M={bit:0},_e.Q={bit:3},_e.H={bit:2},_e.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},_e.from=function(e,n){if(_e.isValid(e))return e;try{return t(e)}catch(t){return n}}},4664,[]);
|
|
16424
|
+
__d(function(g,r,_i,a,m,e,d){function t(){this.buffer=[],this.length=0}t.prototype={get:function(t){const n=Math.floor(t/8);return 1==(this.buffer[n]>>>7-t%8&1)},put:function(t,n){for(let h=0;h<n;h++)this.putBit(1==(t>>>n-h-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},m.exports=t},4665,[]);
|
|
16425
|
+
__d(function(g,r,i,a,m,e,d){function t(t){if(!t||t<1)throw new Error('BitMatrix size must be defined and greater than 0');this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}t.prototype.set=function(t,s,n,o){const h=t*this.size+s;this.data[h]=n,o&&(this.reservedBit[h]=!0)},t.prototype.get=function(t,s){return this.data[t*this.size+s]},t.prototype.xor=function(t,s,n){this.data[t*this.size+s]^=n},t.prototype.isReserved=function(t,s){return this.reservedBit[t*this.size+s]},m.exports=t},4666,[]);
|
|
16426
|
+
__d(function(g,r,_i,a,m,e,d){const o=r(d[0]).getSymbolSize;e.getRowColCoords=function(t){if(1===t)return[];const n=Math.floor(t/7)+2,s=o(t),l=145===s?26:2*Math.ceil((s-13)/(2*n-2)),f=[s-7];for(let o=1;o<n-1;o++)f[o]=f[o-1]-l;return f.push(6),f.reverse()},e.getPositions=function(o){const t=[],n=e.getRowColCoords(o),s=n.length;for(let o=0;o<s;o++)for(let l=0;l<s;l++)0===o&&0===l||0===o&&l===s-1||o===s-1&&0===l||t.push([n[o],n[l]]);return t}},4667,[4663]);
|
|
16427
|
+
__d(function(g,r,i,a,m,e,d){const n=r(d[0]).getSymbolSize;e.getPositions=function(t){const o=n(t);return[[0,0],[o-7,0],[0,o-7]]}},4668,[4663]);
|
|
16428
|
+
__d(function(g,r,_i,a,m,e,d){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t=3,n=3,s=40,l=10;function o(t,n,s){switch(t){case e.Patterns.PATTERN000:return(n+s)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return s%3==0;case e.Patterns.PATTERN011:return(n+s)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(s/3))%2==0;case e.Patterns.PATTERN101:return n*s%2+n*s%3==0;case e.Patterns.PATTERN110:return(n*s%2+n*s%3)%2==0;case e.Patterns.PATTERN111:return(n*s%3+(n+s)%2)%2==0;default:throw new Error('bad maskPattern:'+t)}}e.isValid=function(t){return null!=t&&''!==t&&!isNaN(t)&&t>=0&&t<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(n){const s=n.size;let l=0,o=0,P=0,T=null,c=null;for(let u=0;u<s;u++){o=P=0,T=c=null;for(let N=0;N<s;N++){let s=n.get(u,N);s===T?o++:(o>=5&&(l+=t+(o-5)),T=s,o=1),s=n.get(N,u),s===c?P++:(P>=5&&(l+=t+(P-5)),c=s,P=1)}o>=5&&(l+=t+(o-5)),P>=5&&(l+=t+(P-5))}return l},e.getPenaltyN2=function(t){const s=t.size;let l=0;for(let n=0;n<s-1;n++)for(let o=0;o<s-1;o++){const s=t.get(n,o)+t.get(n,o+1)+t.get(n+1,o)+t.get(n+1,o+1);4!==s&&0!==s||l++}return l*n},e.getPenaltyN3=function(t){const n=t.size;let l=0,o=0,P=0;for(let s=0;s<n;s++){o=P=0;for(let T=0;T<n;T++)o=o<<1&2047|t.get(s,T),T>=10&&(1488===o||93===o)&&l++,P=P<<1&2047|t.get(T,s),T>=10&&(1488===P||93===P)&&l++}return l*s},e.getPenaltyN4=function(t){let n=0;const s=t.data.length;for(let l=0;l<s;l++)n+=t.data[l];return Math.abs(Math.ceil(100*n/s/5)-10)*l},e.applyMask=function(t,n){const s=n.size;for(let l=0;l<s;l++)for(let P=0;P<s;P++)n.isReserved(P,l)||n.xor(P,l,o(t,P,l))},e.getBestMask=function(t,n){const s=Object.keys(e.Patterns).length;let l=0,o=1/0;for(let P=0;P<s;P++){n(P),e.applyMask(P,t);const s=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(P,t),s<o&&(o=s,l=P)}return l}},4669,[]);
|
|
16429
|
+
__d(function(g,r,i,a,m,e,d){const t=r(d[0]),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],u=[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(u,c){switch(c){case t.L:return n[4*(u-1)+0];case t.M:return n[4*(u-1)+1];case t.Q:return n[4*(u-1)+2];case t.H:return n[4*(u-1)+3];default:return}},e.getTotalCodewordsCount=function(n,c){switch(c){case t.L:return u[4*(n-1)+0];case t.M:return u[4*(n-1)+1];case t.Q:return u[4*(n-1)+2];case t.H:return u[4*(n-1)+3];default:return}}},4670,[4664]);
|
|
16430
|
+
__d(function(g,r,i,a,m,e,d){const t=r(d[0]);function n(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}n.prototype.initialize=function(n){this.degree=n,this.genPoly=t.generateECPolynomial(this.degree)},n.prototype.encode=function(n){if(!this.genPoly)throw new Error('Encoder not initialized');const o=new Uint8Array(n.length+this.degree);o.set(n);const s=t.mod(o,this.genPoly),h=this.degree-s.length;if(h>0){const t=new Uint8Array(this.degree);return t.set(s,h),t}return s},m.exports=n},4671,[4672]);
|
|
16431
|
+
__d(function(g,r,_i,a,m,e,d){const n=r(d[0]);e.mul=function(t,l){const o=new Uint8Array(t.length+l.length-1);for(let u=0;u<t.length;u++)for(let f=0;f<l.length;f++)o[u+f]^=n.mul(t[u],l[f]);return o},e.mod=function(t,l){let o=new Uint8Array(t);for(;o.length-l.length>=0;){const t=o[0];for(let u=0;u<l.length;u++)o[u]^=n.mul(l[u],t);let u=0;for(;u<o.length&&0===o[u];)u++;o=o.slice(u)}return o},e.generateECPolynomial=function(t){let l=new Uint8Array([1]);for(let o=0;o<t;o++)l=e.mul(l,new Uint8Array([1,n.exp(o)]));return l}},4672,[4673]);
|
|
16432
|
+
__d(function(g,r,_i,a,m,e,d){const n=new Uint8Array(512),t=new Uint8Array(256);!(function(){let o=1;for(let u=0;u<255;u++)n[u]=o,t[o]=u,o<<=1,256&o&&(o^=285);for(let t=255;t<512;t++)n[t]=n[t-255]})(),e.log=function(n){if(n<1)throw new Error('log('+n+')');return t[n]},e.exp=function(t){return n[t]},e.mul=function(o,u){return 0===o||0===u?0:n[t[o]+t[u]]}},4673,[]);
|
|
16433
|
+
__d(function(g,r,i,a,m,e,_d){const t=r(_d[0]),n=r(_d[1]),o=r(_d[2]),f=r(_d[3]),u=r(_d[4]),c=t.getBCHDigit(7973);function s(t,n,o){for(let f=1;f<=40;f++)if(n<=e.getCapacity(f,o,t))return f}function l(t,n){return f.getCharCountIndicator(t,n)+4}function d(t,n){let o=0;return t.forEach(function(t){const f=l(t.mode,n);o+=f+t.getBitsLength()}),o}function C(t,n){for(let o=1;o<=40;o++){if(d(t,o)<=e.getCapacity(o,n,f.MIXED))return o}}e.from=function(t,n){return u.isValid(t)?parseInt(t,10):n},e.getCapacity=function(o,c,s){if(!u.isValid(o))throw new Error('Invalid QR Code version');void 0===s&&(s=f.BYTE);const d=8*(t.getSymbolTotalCodewords(o)-n.getTotalCodewordsCount(o,c));if(s===f.MIXED)return d;const C=d-l(s,o);switch(s){case f.NUMERIC:return Math.floor(C/10*3);case f.ALPHANUMERIC:return Math.floor(C/11*2);case f.KANJI:return Math.floor(C/13);case f.BYTE:default:return Math.floor(C/8)}},e.getBestVersionForData=function(t,n){let f;const u=o.from(n,o.M);if(Array.isArray(t)){if(t.length>1)return C(t,u);if(0===t.length)return 1;f=t[0]}else f=t;return s(f.mode,f.getLength(),u)},e.getEncodedBits=function(n){if(!u.isValid(n)||n<7)throw new Error('Invalid QR Code version');let o=n<<12;for(;t.getBCHDigit(o)-c>=0;)o^=7973<<t.getBCHDigit(o)-c;return n<<12|o}},4674,[4663,4670,4664,4675,4676]);
|
|
16434
|
+
__d(function(g,r,i,a,m,_e,d){const t=r(d[0]),n=r(d[1]);function e(t){if('string'!=typeof t)throw new 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 new Error('Unknown mode: '+t)}}_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(n,e){if(!n.ccBits)throw new Error('Invalid mode: '+n);if(!t.isValid(e))throw new Error('Invalid version: '+e);return e>=1&&e<10?n.ccBits[0]:e<27?n.ccBits[1]:n.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(t){if(t&&t.id)return t.id;throw new Error('Invalid mode')},_e.isValid=function(t){return t&&t.bit&&t.ccBits},_e.from=function(t,n){if(_e.isValid(t))return t;try{return e(t)}catch(t){return n}}},4675,[4676,4677]);
|
|
16435
|
+
__d(function(g,r,i,a,m,e,d){e.isValid=function(n){return!isNaN(n)&&n>=1&&n<=40}},4676,[]);
|
|
16436
|
+
__d(function(g,r,i,a,m,e,d){let u="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";u=u.replace(/u/g,'\\u');const n='(?:(?![A-Z0-9 $%*+\\-./:]|'+u+')(?:.|[\r\n]))+';e.KANJI=new RegExp(u,'g'),e.BYTE_KANJI=new RegExp('[^A-Z0-9 $%*+\\-./:]+','g'),e.BYTE=new RegExp(n,'g'),e.NUMERIC=new RegExp('[0-9]+','g'),e.ALPHANUMERIC=new RegExp('[A-Z $%*+\\-./:]+','g');const t=new RegExp('^'+u+'$'),E=new RegExp("^[0-9]+$"),A=new RegExp('^[A-Z0-9 $%*+\\-./:]+$');e.testKanji=function(u){return t.test(u)},e.testNumeric=function(u){return E.test(u)},e.testAlphanumeric=function(u){return A.test(u)}},4677,[]);
|
|
16437
|
+
__d(function(g,r,i,a,m,e,_d){const t=r(_d[0]),n=t.getBCHDigit(1335);e.getEncodedBits=function(o,c){const B=o.bit<<3|c;let d=B<<10;for(;t.getBCHDigit(d)-n>=0;)d^=1335<<t.getBCHDigit(d)-n;return 21522^(B<<10|d)}},4678,[4663]);
|
|
16438
|
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]),n=r(d[1]),o=r(d[2]),u=r(d[3]),s=r(d[4]),l=r(d[5]),c=r(d[6]),h=r(d[7]);function i(t){return unescape(encodeURIComponent(t)).length}function f(t,n,o){const u=[];let s;for(;null!==(s=t.exec(o));)u.push({data:s[0],index:s.index,mode:n,length:s[0].length});return u}function E(n){const o=f(l.NUMERIC,t.NUMERIC,n),u=f(l.ALPHANUMERIC,t.ALPHANUMERIC,n);let s,h;c.isKanjiModeEnabled()?(s=f(l.BYTE,t.BYTE,n),h=f(l.KANJI,t.KANJI,n)):(s=f(l.BYTE_KANJI,t.BYTE,n),h=[]);return o.concat(u,s,h).sort(function(t,n){return t.index-n.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function A(l,c){switch(c){case t.NUMERIC:return n.getBitsLength(l);case t.ALPHANUMERIC:return o.getBitsLength(l);case t.KANJI:return s.getBitsLength(l);case t.BYTE:return u.getBitsLength(l)}}function I(t){return t.reduce(function(t,n){const o=t.length-1>=0?t[t.length-1]:null;return o&&o.mode===n.mode?(t[t.length-1].data+=n.data,t):(t.push(n),t)},[])}function C(n){const o=[];for(let u=0;u<n.length;u++){const s=n[u];switch(s.mode){case t.NUMERIC:o.push([s,{data:s.data,mode:t.ALPHANUMERIC,length:s.length},{data:s.data,mode:t.BYTE,length:s.length}]);break;case t.ALPHANUMERIC:o.push([s,{data:s.data,mode:t.BYTE,length:s.length}]);break;case t.KANJI:o.push([s,{data:s.data,mode:t.BYTE,length:i(s.data)}]);break;case t.BYTE:o.push([{data:s.data,mode:t.BYTE,length:i(s.data)}])}}return o}function p(n,o){const u={},s={start:{}};let l=['start'];for(let c=0;c<n.length;c++){const h=n[c],i=[];for(let n=0;n<h.length;n++){const f=h[n],E=''+c+n;i.push(E),u[E]={node:f,lastCount:0},s[E]={};for(let n=0;n<l.length;n++){const c=l[n];u[c]&&u[c].node.mode===f.mode?(s[c][E]=A(u[c].lastCount+f.length,f.mode)-A(u[c].lastCount,f.mode),u[c].lastCount+=f.length):(u[c]&&(u[c].lastCount=f.length),s[c][E]=A(f.length,f.mode)+4+t.getCharCountIndicator(f.mode,o))}}l=i}for(let t=0;t<l.length;t++)s[l[t]].end=0;return{map:s,table:u}}function B(l,h){let i;const f=t.getBestModeForData(l);if(i=t.from(h,f),i!==t.BYTE&&i.bit<f.bit)throw new Error('"'+l+"\" cannot be encoded with mode "+t.toString(i)+'.\n Suggested mode is: '+t.toString(f));switch(i!==t.KANJI||c.isKanjiModeEnabled()||(i=t.BYTE),i){case t.NUMERIC:return new n(l);case t.ALPHANUMERIC:return new o(l);case t.KANJI:return new s(l);case t.BYTE:return new u(l)}}e.fromArray=function(t){return t.reduce(function(t,n){return'string'==typeof n?t.push(B(n,null)):n.data&&t.push(B(n.data,n.mode)),t},[])},e.fromString=function(t,n){const o=p(C(E(t,c.isKanjiModeEnabled())),n),u=h.find_path(o.map,'start','end'),s=[];for(let t=1;t<u.length-1;t++)s.push(o.table[u[t]].node);return e.fromArray(I(s))},e.rawSplit=function(t){return e.fromArray(E(t,c.isKanjiModeEnabled()))}},4679,[4675,4680,4681,4682,4683,4677,4663,4684]);
|
|
16439
|
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]);function n(n){this.mode=t.NUMERIC,this.data=n.toString()}n.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){let n,o,s;for(n=0;n+3<=this.data.length;n+=3)o=this.data.substr(n,3),s=parseInt(o,10),t.put(s,10);const i=this.data.length-n;i>0&&(o=this.data.substr(n),s=parseInt(o,10),t.put(s,3*i+1))},m.exports=n},4680,[4675]);
|
|
16440
|
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]),n=['0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',' ','$','%','*','+','-','.','/',':'];function i(n){this.mode=t.ALPHANUMERIC,this.data=n}i.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){let i;for(i=0;i+2<=this.data.length;i+=2){let h=45*n.indexOf(this.data[i]);h+=n.indexOf(this.data[i+1]),t.put(h,11)}this.data.length%2&&t.put(n.indexOf(this.data[i]),6)},m.exports=i},4681,[4675]);
|
|
16441
|
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]);function n(n){this.mode=t.BYTE,this.data='string'==typeof n?(new TextEncoder).encode(n):new Uint8Array(n)}n.getBitsLength=function(t){return 8*t},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){for(let n=0,o=this.data.length;n<o;n++)t.put(this.data[n],8)},m.exports=n},4682,[4675]);
|
|
16442
|
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]),n=r(d[1]);function i(n){this.mode=t.KANJI,this.data=n}i.getBitsLength=function(t){return 13*t},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){let i;for(i=0;i<this.data.length;i++){let o=n.toSJIS(this.data[i]);if(o>=33088&&o<=40956)o-=33088;else{if(!(o>=57408&&o<=60351))throw new Error('Invalid SJIS character: '+this.data[i]+"\nMake sure your charset is UTF-8");o-=49472}o=192*(o>>>8&255)+(255&o),t.put(o,13)}},m.exports=i},4683,[4675,4663]);
|
|
16443
|
+
__d(function(g,r,i,_a,m,e,_d){'use strict';var t={single_source_shortest_paths:function(o,s,u){var n={},a={};a[s]=0;var h,f,p,_,c,v,d,l=t.PriorityQueue.make();for(l.push(s,0);!l.empty();)for(p in f=(h=l.pop()).value,_=h.cost,c=o[f]||{})c.hasOwnProperty(p)&&(v=_+c[p],d=a[p],(void 0===a[p]||d>v)&&(a[p]=v,l.push(p,v),n[p]=f));if(void 0!==u&&void 0===a[u]){var y=['Could not find a path from ',s,' to ',u,'.'].join('');throw new Error(y)}return n},extract_shortest_path_from_predecessor_list:function(t,o){for(var s=[],u=o;u;)s.push(u),t[u],u=t[u];return s.reverse(),s},find_path:function(o,s,u){var n=t.single_source_shortest_paths(o,s,u);return t.extract_shortest_path_from_predecessor_list(n,u)},PriorityQueue:{make:function(o){var s,u=t.PriorityQueue,n={};for(s in o=o||{},u)u.hasOwnProperty(s)&&(n[s]=u[s]);return n.queue=[],n.sorter=o.sorter||u.default_sorter,n},default_sorter:function(t,o){return t.cost-o.cost},push:function(t,o){var s={value:t,cost:o};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};void 0!==m&&(m.exports=t)},4684,[]);
|
|
16444
|
+
__d(function(g,r,i,a,m,_e,d){const t=r(d[0]);function e(t,e,n){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=n,e.width=n,e.style.height=n+'px',e.style.width=n+'px'}function n(){try{return document.createElement('canvas')}catch(t){throw new Error('You need to specify a canvas element')}}_e.render=function(o,c,s){let u=s,h=c;void 0!==u||c&&c.getContext||(u=c,c=void 0),c||(h=n()),u=t.getOptions(u);const l=t.getImageWidth(o.modules.size,u),p=h.getContext('2d'),y=p.createImageData(l,l);return t.qrToImageData(y.data,o,u),e(p,h,l),p.putImageData(y,0,0),h},_e.renderToDataURL=function(t,e,n){let o=n;void 0!==o||e&&e.getContext||(o=e,e=void 0),o||(o={});const c=_e.render(t,e,o),s=o.type||'image/png',u=o.rendererOpts||{};return c.toDataURL(s,u.quality)}},4685,[4686]);
|
|
16445
|
+
__d(function(g,r,_i,a,m,e,d){function t(t){if('number'==typeof t&&(t=t.toString()),'string'!=typeof t)throw new Error('Color should be defined as hex string');let o=t.slice().replace('#','').split('');if(o.length<3||5===o.length||o.length>8)throw new Error('Invalid hex color: '+t);3!==o.length&&4!==o.length||(o=Array.prototype.concat.apply([],o.map(function(t){return[t,t]}))),6===o.length&&o.push('F','F');const n=parseInt(o.join(''),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:'#'+o.slice(0,6).join('')}}e.getOptions=function(o){o||(o={}),o.color||(o.color={});const n=void 0===o.margin||null===o.margin||o.margin<0?4:o.margin,i=o.width&&o.width>=21?o.width:void 0,l=o.scale||4;return{width:i,scale:i?4:l,margin:n,color:{dark:t(o.color.dark||'#000000ff'),light:t(o.color.light||'#ffffffff')},type:o.type,rendererOpts:o.rendererOpts||{}}},e.getScale=function(t,o){return o.width&&o.width>=t+2*o.margin?o.width/(t+2*o.margin):o.scale},e.getImageWidth=function(t,o){const n=e.getScale(t,o);return Math.floor((t+2*o.margin)*n)},e.qrToImageData=function(t,o,n){const i=o.modules.size,l=o.modules.data,c=e.getScale(i,n),f=Math.floor((i+2*n.margin)*c),h=n.margin*c,s=[n.color.light,n.color.dark];for(let o=0;o<f;o++)for(let u=0;u<f;u++){let p=4*(o*f+u),w=n.color.light;if(o>=h&&u>=h&&o<f-h&&u<f-h){w=s[l[Math.floor((o-h)/c)*i+Math.floor((u-h)/c)]?1:0]}t[p++]=w.r,t[p++]=w.g,t[p++]=w.b,t[p]=w.a}}},4686,[]);
|
|
16446
|
+
__d(function(g,r,_i,a,m,e,d){const t=r(d[0]);function o(t,o){const n=t.a/255,i=o+'="'+t.hex+'"';return n<1?i+' '+o+'-opacity="'+n.toFixed(2).slice(1)+'"':i}function n(t,o,n){let i=t+o;return void 0!==n&&(i+=' '+n),i}function i(t,o,i){let l='',h=0,s=!1,c=0;for(let u=0;u<t.length;u++){const f=Math.floor(u%o),w=Math.floor(u/o);f||s||(s=!0),t[u]?(c++,u>0&&f>0&&t[u-1]||(l+=s?n('M',f+i,.5+w+i):n('m',h,0),h=0,s=!1),f+1<o&&t[u+1]||(l+=n('h',c),c=0)):h++}return l}e.render=function(n,l,h){const s=t.getOptions(l),c=n.modules.size,u=n.modules.data,f=c+2*s.margin,w=s.color.light.a?'<path '+o(s.color.light,'fill')+' d="M0 0h'+f+'v'+f+'H0z"/>':'',p='<path '+o(s.color.dark,'stroke')+' d="'+i(u,c,s.margin)+'"/>',v="viewBox=\"0 0 "+f+' '+f+'"',x='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':'')+v+' shape-rendering="crispEdges">'+w+p+'</svg>\n';return'function'==typeof h&&h(null,x),x}},4687,[4686]);
|
|
16447
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return k}});var e,n=r(d[0]),o=r(d[1]),t=r(d[2]),s=r(d[3]),c=r(d[4]),l=r(d[5]),u=(e=l)&&e.__esModule?e:{default:e};r(d[6]),r(d[7]),r(d[8]);var p=r(d[9]),b=r(d[10]),f=r(d[11]),h=r(d[12]),y=r(d[13]),x=r(d[14]),T=r(d[15]),j=r(d[16]),B=r(d[17]),_=r(d[18]),w=r(d[19]),R=r(d[20]);const C=f.StyleSheet.create(e=>({container:{flex:1,backgroundColor:e.colors.surface0,uni__dependencies:[0]},body:{flex:1,paddingHorizontal:e.spacing[6],uni__dependencies:[0]},cameraWrap:{flex:1,overflow:"hidden",borderRadius:e.borderRadius.xl,backgroundColor:e.colors.surface2,uni__dependencies:[0]},camera:{flex:1},overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,justifyContent:"center",alignItems:"center"},scanFrame:{width:260,height:260},corner:{position:"absolute",width:36,height:36,borderColor:e.colors.accent,uni__dependencies:[0]},cornerTL:{left:0,top:0,borderLeftWidth:4,borderTopWidth:4,borderTopLeftRadius:12},cornerTR:{right:0,top:0,borderRightWidth:4,borderTopWidth:4,borderTopRightRadius:12},cornerBL:{left:0,bottom:0,borderLeftWidth:4,borderBottomWidth:4,borderBottomLeftRadius:12},cornerBR:{right:0,bottom:0,borderRightWidth:4,borderBottomWidth:4,borderBottomRightRadius:12},helperText:{marginTop:e.spacing[6],color:e.colors.foregroundMuted,textAlign:"center",fontSize:e.fontSize.base,uni__dependencies:[0]},permissionCard:{marginTop:e.spacing[6],padding:e.spacing[6],borderRadius:e.borderRadius.xl,backgroundColor:e.colors.surface2,gap:e.spacing[4],uni__dependencies:[0]},permissionTitle:{color:e.colors.foreground,fontSize:e.fontSize.lg,fontWeight:e.fontWeight.semibold,uni__dependencies:[0]},permissionBody:{color:e.colors.foregroundMuted,fontSize:e.fontSize.base,uni__dependencies:[0]},permissionButton:{alignSelf:"flex-start",paddingHorizontal:e.spacing[6],paddingVertical:e.spacing[3],borderRadius:e.borderRadius.lg,backgroundColor:e.colors.palette.blue[500],uni__dependencies:[0]},permissionButtonText:{color:e.colors.palette.white,fontWeight:e.fontWeight.semibold,uni__dependencies:[0]}}));function S(e){const n="string"==typeof e.data?e.data.trim():"";return n&&n.includes("#offer=")?n:null}function k(){const{theme:e}=(0,f.useUnistyles)(),{t:l}=(0,c.useTranslation)(),k=(0,b.useSafeAreaInsets)(),L=(0,p.useRouter)(),H=(0,p.useLocalSearchParams)(),M="string"==typeof H.source?H.source:"settings",{upsertConnectionFromOfferUrl:O}=(0,y.useHostMutations)(),[I,E]=(0,h.useCameraPermissions)(),[F,U]=(0,s.useState)(!1),A=(0,s.useRef)(null),K=(0,s.useCallback)(e=>{"onboarding"!==M?L.replace((0,B.buildSettingsHostRoute)(e)):L.replace((0,B.buildHostRootRoute)(e))},[L,M]),q=(0,s.useCallback)(()=>{try{L.back()}catch{L.replace("/")}},[L]);(0,s.useEffect)(()=>{_.isWeb||I&&I.granted||E().catch(()=>{})},[I,E]);const D=(0,s.useCallback)(async e=>{if(F)return;const n=S(e);if(n&&A.current!==n){A.current=n;try{U(!0);const e=n.indexOf("#offer="),o=n.slice(e+7).trim(),t=(0,x.decodeOfferFragmentPayload)(o),s=j.ConnectionOfferSchema.parse(t),{client:c,hostname:l}=await(0,T.connectToDaemon)({id:"probe",type:"relay",relayEndpoint:(0,x.normalizeHostPort)(s.relay.endpoint),useTls:s.relay.useTls,daemonPublicKeyB64:s.daemonPublicKeyB64},{serverId:s.serverId});await c.close().catch(()=>{});const u=await O(n,l??void 0);K(u.serverId)}catch(e){A.current=null;const n=e instanceof Error?e.message:l("pairing.scan.unableToPair");u.default.alert(l("pairing.scan.errorTitle"),n)}finally{U(!1)}}},[F,K,l,O]),G=(0,s.useCallback)(()=>L.back(),[L]),J=(0,s.useCallback)(()=>{E()},[E]),N=(0,s.useMemo)(()=>[C.body,{paddingBottom:k.bottom+e.spacing[6]}],[k.bottom,e.spacing]),Q=(0,s.useMemo)(()=>[C.helperText,{color:e.colors.foreground}],[e.colors.foreground]);if(_.isWeb)return(0,R.jsxs)(n.View,{style:C.container,children:[(0,R.jsx)(w.BackHeader,{title:l("pairing.scan.title"),onBack:G}),(0,R.jsx)(n.View,{style:N,children:(0,R.jsxs)(n.View,{style:C.permissionCard,children:[(0,R.jsx)(o.Text,{style:C.permissionTitle,children:l("pairing.scan.webUnavailableTitle")}),(0,R.jsx)(o.Text,{style:C.permissionBody,children:l("pairing.scan.webUnavailableBody")}),(0,R.jsx)(t.Pressable,{style:C.permissionButton,onPress:q,children:(0,R.jsx)(o.Text,{style:C.permissionButtonText,children:l("pairing.scan.backToSettings")})})]})})]});const X=Boolean(I?.granted);return(0,R.jsxs)(n.View,{style:C.container,children:[(0,R.jsx)(w.BackHeader,{title:l("pairing.scan.title"),onBack:q}),(0,R.jsx)(n.View,{style:N,children:X?(0,R.jsxs)(n.View,{style:C.cameraWrap,children:[(0,R.jsx)(h.CameraView,{style:C.camera,facing:"back",barcodeScannerSettings:P,onBarcodeScanned:D}),(0,R.jsxs)(n.View,{style:C.overlay,pointerEvents:"none",children:[(0,R.jsxs)(n.View,{style:C.scanFrame,children:[(0,R.jsx)(n.View,{style:W}),(0,R.jsx)(n.View,{style:V}),(0,R.jsx)(n.View,{style:v}),(0,R.jsx)(n.View,{style:z})]}),F?(0,R.jsx)(o.Text,{style:Q,children:l("pairing.scan.pairing")}):null]})]}):(0,R.jsxs)(n.View,{style:C.permissionCard,children:[(0,R.jsx)(o.Text,{style:C.permissionTitle,children:l("pairing.scan.cameraPermissionTitle")}),(0,R.jsx)(o.Text,{style:C.permissionBody,children:l("pairing.scan.cameraPermissionBody")}),(0,R.jsx)(t.Pressable,{style:C.permissionButton,onPress:J,children:(0,R.jsx)(o.Text,{style:C.permissionButtonText,children:l("pairing.scan.grantPermission")})})]})})]})}const P={barcodeTypes:["qr"]},W=[C.corner,C.cornerTL],V=[C.corner,C.cornerTR],v=[C.corner,C.cornerBL],z=[C.corner,C.cornerBR]},4688,[348,711,1572,36,1573,1389,1308,234,146,1143,1320,56,4689,3271,3399,3408,3400,3477,3407,4702,279]);
|
|
16448
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"CameraView",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(_e,"useCameraPermissions",{enumerable:!0,get:function(){return y}}),Object.defineProperty(_e,"useMicrophonePermissions",{enumerable:!0,get:function(){return p}}),_e.scanFromURLAsync=b,Object.defineProperty(_e,"Camera",{enumerable:!0,get:function(){return h}});var n=r(d[0]),t=e(r(d[1])),s=e(r(d[2])),o=r(d[3]);Object.keys(o).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return o[e]}})});var c=r(d[4]);async function u(){return t.default.getCameraPermissionsAsync()}async function f(){return t.default.requestCameraPermissionsAsync()}Object.keys(c).forEach(function(e){'default'===e||Object.prototype.hasOwnProperty.call(_e,e)||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return c[e]}})});const y=(0,n.createPermissionHook)({getMethod:u,requestMethod:f});async function l(){return t.default.getMicrophonePermissionsAsync()}async function P(){return t.default.requestMicrophonePermissionsAsync()}const p=(0,n.createPermissionHook)({getMethod:l,requestMethod:P});async function b(e,n=['qr']){return t.default.scanFromURLAsync(e,n)}const h={getCameraPermissionsAsync:u,requestCameraPermissionsAsync:f,getMicrophonePermissionsAsync:l,requestMicrophonePermissionsAsync:P,scanFromURLAsync:b}},4689,[4,4690,4693,4691,4701]);
|
|
16449
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return v}});var e=r(d[0]),t=r(d[1]),s=r(d[2]);function n(e){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)return navigator.mediaDevices.getUserMedia(e);const t=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||function(){const e=new Error('Permission unimplemented');throw e.code=0,e.name='NotAllowedError',e};return new Promise((s,n)=>{t.call(navigator,e,s,n)})}function o({message:e}){return'Permission dismissed'===e?{status:t.PermissionStatus.UNDETERMINED,expires:'never',canAskAgain:!0,granted:!1}:{status:t.PermissionStatus.DENIED,expires:'never',canAskAgain:!0,granted:!1}}async function c(){try{const e=await n({video:!0});return e.getTracks().forEach(t=>{t.stop(),e.removeTrack(t)}),{status:t.PermissionStatus.GRANTED,expires:'never',canAskAgain:!0,granted:!0}}catch(e){return o(e.message)}}async function u(s){if(!navigator?.permissions?.query)throw new e.UnavailabilityError('expo-camera','navigator.permissions API is not available');try{const{state:e}=await navigator.permissions.query({name:s});switch(e){case'prompt':return{status:t.PermissionStatus.UNDETERMINED,expires:'never',canAskAgain:!0,granted:!1};case'granted':return{status:t.PermissionStatus.GRANTED,expires:'never',canAskAgain:!0,granted:!0};case'denied':return{status:t.PermissionStatus.DENIED,expires:'never',canAskAgain:!0,granted:!1}}}catch(e){if(e instanceof TypeError)return{status:t.PermissionStatus.UNDETERMINED,expires:'never',canAskAgain:!0,granted:!1};throw e}}var v={get Type(){return{back:'back',front:'front'}},get FlashMode(){return{on:'on',off:'off',auto:'auto',torch:'torch'}},get AutoFocus(){return{on:'on',off:'off',auto:'auto',singleShot:'singleShot'}},get WhiteBalance(){return{auto:'auto',continuous:'continuous',manual:'manual'}},get VideoQuality(){return{}},get VideoStabilization(){return{}},isAvailableAsync:async()=>(0,s.canGetUserMedia)(),takePicture:async(e,t)=>await t.takePicture(e),async pausePreview(e){await e.pausePreview()},resumePreview:async e=>await e.resumePreview(),async getAvailableCameraTypesAsync(){if(!(0,s.canGetUserMedia)()||!navigator.mediaDevices.enumerateDevices)return[];const e=await navigator.mediaDevices.enumerateDevices();return(await Promise.all([await(0,s.isFrontCameraAvailableAsync)(e)&&'front',await(0,s.isBackCameraAvailableAsync)()&&'back'])).filter(Boolean)},getAvailablePictureSizes:async(e,t)=>await t.getAvailablePictureSizes(e),getPermissionsAsync:async()=>u('camera'),requestPermissionsAsync:async()=>c(),getCameraPermissionsAsync:async()=>u('camera'),requestCameraPermissionsAsync:async()=>c(),getMicrophonePermissionsAsync:async()=>u('microphone'),async requestMicrophonePermissionsAsync(){try{return await n({audio:!0}),{status:t.PermissionStatus.GRANTED,expires:'never',canAskAgain:!0,granted:!0}}catch(e){return o(e.message)}}}},4690,[4,4691,4692]);
|
|
16450
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"PermissionStatus",{enumerable:!0,get:function(){return t.PermissionStatus}});var t=r(d[0])},4691,[4]);
|
|
16451
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"userMediaRequested",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"mountedInstances",{enumerable:!0,get:function(){return o}}),e.requestUserMediaAsync=async function(t,n=!0){if(v())return await c(n,t.audio,t.video);const[o,u]=await s(t);return await c(n,o,u)},e.getAnyUserMediaAsync=u,e.getUserMediaAsync=l,e.canGetUserMedia=v,e.isFrontCameraAvailableAsync=async function(t){return await f(['front','user','facetime'],'user',t)},e.isBackCameraAvailableAsync=async function(t){return await f(['back','rear'],'environment',t)};var t=r(d[0]);const n=!1,o=[];async function s(t){const n=t=>({optional:[{sourceId:t}]}),o=t=>{const{deviceId:n}=t;return'string'==typeof n?n:Array.isArray(n)?n[0]??null:'object'==typeof n&&n.ideal?n.ideal:null},s=await new Promise(t=>MediaStreamTrack.getSources(n=>t(n)));let c=null,u=null;s.forEach(t=>{'audio'===t.kind?c=t.id:'video'===t.kind&&(u=t.id)});const l=o(t.audioConstraints);l&&(c=l);const v=o(t.videoConstraints);return v&&(u=v),[n(c),n(u)]}async function c(t,n,o){const s={video:void 0===o||o};return t||(s.audio=void 0===n||n),await u(s)}async function u(t,n=!1){try{return await l(Object.assign({},t,{video:n||t.video}))}catch(o){if(!n&&'object'==typeof o&&'ConstraintNotSatisfiedError'===o?.name)return await u(t,!0);throw o}}async function l(t){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)return navigator.mediaDevices.getUserMedia(t);const n=navigator.mozGetUserMedia||navigator.webkitGetUserMedia||navigator.msGetUserMedia;return new Promise((o,s)=>n.call(navigator,t,o,s))}function v(){return t.Platform.isDOMAvailable&&!!(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia||navigator.mozGetUserMedia||navigator.webkitGetUserMedia||navigator.msGetUserMedia)}async function f(t,n,o){if(!o){if(!navigator.mediaDevices.enumerateDevices)return null;o=await navigator.mediaDevices.enumerateDevices()}const s=o.filter(t=>'videoinput'===t.kind),[c]=s.filter(n=>t.some(t=>n.label.toLowerCase().includes(t))),[u]=s.filter(t=>{if(!('getCapabilities'in t))return null;const o=t.getCapabilities();return o.facingMode?o.facingMode.find(t=>n):null});return u?.deviceId||c?.deviceId||null}},4692,[4]);
|
|
16452
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return b}});var n=r(d[0]),t=r(d[1]),s=e(r(d[2])),o=e(r(d[3])),c=r(d[4]),l=r(d[5]);const u={};let v=!1,h=1;function p(e){if(!e||'object'!=typeof e)return{};if(void 0===e.quality&&(e.quality=1),e.mirror&&console.warn('The `mirror` option is deprecated. Please use the `mirror` prop on the `CameraView` instead.'),e.onPictureSaved){const n=h++;u[n]=e.onPictureSaved,e.id=n,e.fastMode=!0}return e}function f(e={}){return e&&'object'==typeof e?(e.mirror&&console.warn('The `mirror` option is deprecated. Please use the `mirror` prop on the `CameraView` instead.'),e):{}}function y({nativeEvent:e}){const{id:n,data:t}=e,s=u[n];s&&(s(t),delete u[n])}class b extends t.Component{static isModernBarcodeScannerAvailable=o.default.isModernBarcodeScannerAvailable;static async isAvailableAsync(){if(!o.default.isAvailableAsync)throw new n.UnavailabilityError('expo-camera','isAvailableAsync');return o.default.isAvailableAsync()}static async getAvailableVideoCodecsAsync(){if(!o.default.getAvailableVideoCodecsAsync)throw new n.UnavailabilityError('Camera','getAvailableVideoCodecsAsync');return o.default.getAvailableVideoCodecsAsync()}async getAvailablePictureSizesAsync(){return await(this._cameraRef.current?.getAvailablePictureSizes())??[]}async getAvailableLensesAsync(){return await(this._cameraRef.current?.getAvailableLenses())??[]}getSupportedFeatures(){return{isModernBarcodeScannerAvailable:o.default.isModernBarcodeScannerAvailable,toggleRecordingAsyncAvailable:o.default.toggleRecordingAsyncAvailable}}async resumePreview(){return this._cameraRef.current?.resumePreview()}async pausePreview(){return this._cameraRef.current?.pausePreview()}static ConversionTables=c.ConversionTables;static defaultProps={zoom:0,facing:'back',enableTorch:!1,mode:'picture',flash:'off'};_cameraRef=(0,t.createRef)();_lastEvents={};_lastEventsTimes={};async takePictureAsync(e){const n=p(e);return this._cameraRef.current?.takePicture(n)}static async launchScanner(e){e||(e={barcodeTypes:[]})}static async dismissScanner(){}static onModernBarcodeScanned(e){return o.default.addListener('onModernBarcodeScanned',e)}async recordAsync(e){const n=f(e);return this._cameraRef.current?.record(n)}async toggleRecordingAsync(){return this._cameraRef.current?.toggleRecording()}stopRecording(){this._cameraRef.current?.stopRecording()}_onCameraReady=()=>{this.props.onCameraReady&&this.props.onCameraReady()};_onAvailableLensesChanged=({nativeEvent:e})=>{this.props.onAvailableLensesChanged&&this.props.onAvailableLensesChanged(e)};_onMountError=({nativeEvent:e})=>{this.props.onMountError&&this.props.onMountError(e)};_onResponsiveOrientationChanged=({nativeEvent:e})=>{this.props.onResponsiveOrientationChanged&&this.props.onResponsiveOrientationChanged(e)};_onObjectDetected=e=>({nativeEvent:n})=>{const{type:t}=n;this._lastEvents[t]&&this._lastEventsTimes[t]&&JSON.stringify(n)===this._lastEvents[t]&&(new Date).getTime()-this._lastEventsTimes[t].getTime()<500||e&&(e(n),this._lastEventsTimes[t]=new Date,this._lastEvents[t]=JSON.stringify(n))};_setReference=e=>{e&&(this._cameraHandle=e)};render(){const e=(0,c.ensureNativeProps)(this.props),n=this.props.onBarcodeScanned?this._onObjectDetected(this.props.onBarcodeScanned):void 0;return e.children&&!v&&(console.warn('The <CameraView> component does not support children. This may lead to inconsistent behaviour or crashes. If you want to render content on top of the Camera, consider using absolute positioning.'),v=!0),(0,l.jsx)(s.default,Object.assign({},e,{ref:this._cameraRef,onCameraReady:this._onCameraReady,onMountError:this._onMountError,onBarcodeScanned:n,onAvailableLensesChanged:this._onAvailableLensesChanged,onPictureSaved:y,onResponsiveOrientationChanged:this._onResponsiveOrientationChanged}))}}},4693,[4,36,4694,4690,4700,279]);
|
|
16453
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";const e=["facing","poster","ref"];function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return E}});var t=n(r(d[0])),o=r(d[1]),c=r(d[2]),s=n(r(d[3])),u=n(r(d[4])),l=n(r(d[5])),p=n(r(d[6])),v=r(d[7]),y=r(d[8]),f=r(d[9]),S=r(d[10]),b=r(d[11]);var E=n=>{let{facing:l,poster:E,ref:P}=n,_=(0,t.default)(n,e);const M=(0,c.useRef)(null),h=(0,f.useWebCameraStream)(M,l,_,{onCameraReady(){_.onCameraReady&&_.onCameraReady()},onMountError:_.onMountError}),A=(0,c.useMemo)(()=>Boolean(_.barcodeScannerSettings?.barcodeTypes?.includes('qr')&&!!_.onBarcodeScanned),[_.barcodeScannerSettings?.barcodeTypes,_.onBarcodeScanned]);(0,S.useWebQRScanner)(M,{interval:300,isEnabled:A,captureOptions:{scale:1,isImageMirror:'front'===h.type},onScanned(e){_.onBarcodeScanned&&_.onBarcodeScanned(e)}}),(0,c.useImperativeHandle)(P,()=>({getAvailablePictureSizes:async()=>y.PictureSizes,async takePicture(e){if(!M.current||M.current?.readyState!==M.current?.HAVE_ENOUGH_DATA)throw new o.CodedError('ERR_CAMERA_NOT_READY','HTMLVideoElement does not have enough camera data to construct an image yet.');const n=h.mediaTrackSettings;if(!n)throw new o.CodedError('ERR_CAMERA_NOT_READY','MediaStream is not ready yet.');return(0,v.capture)(M.current,n,Object.assign({},e,{onPictureSaved(n){e.onPictureSaved&&e.onPictureSaved(n),_.onPictureSaved&&_.onPictureSaved({nativeEvent:{data:n,id:-1}})}}))},async resumePreview(){M.current&&M.current.play()},async pausePreview(){M.current&&M.current.pause()},async stopRecording(){console.warn('stopRecording is not supported on web.')},record:async()=>(console.warn('record is not supported on web.'),{uri:''}),async toggleRecording(){console.warn('toggleRecording is not supported on web.')},async launchModernScanner(){console.warn('launchModernScanner is not supported on web.')},getAvailableLenses:async()=>(console.warn('getAvailableLenses is not supported on web.'),[])}),[h.mediaTrackSettings,_.onPictureSaved]);const T=(0,c.useMemo)(()=>{const e=h.type===p.default.Type.front;return[s.default.absoluteFill,R.video,{pointerEvents:_.pointerEvents,transform:e?[{scaleX:-1}]:void 0}]},[_.pointerEvents,h.type]);return(0,b.jsxs)(u.default,{style:[R.videoWrapper,_.style],children:[(0,b.jsx)(w,{autoPlay:!0,playsInline:!0,muted:!0,poster:E,ref:M,style:T}),_.children]})};const w=e=>(0,l.default)('video',Object.assign({},e)),R=s.default.create({videoWrapper:{flex:1,alignItems:'stretch',pointerEvents:'box-none'},video:{width:'100%',height:'100%',objectFit:'cover'}})},4694,[35,4,36,59,146,147,4690,4695,4697,4698,4699,279]);
|
|
16454
|
+
__d(function(g,r,i,_a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.getImageSize=s,_e.toDataURL=u,_e.hasValidConstraints=d,_e.captureImageData=function(e,t={}){if(!e||e.readyState!==e.HAVE_ENOUGH_DATA)return null;const n=p(e,t),o=n.getContext('2d',{alpha:!1});if(!o||!n.width||!n.height)return null;return o.getImageData(0,0,n.width,n.height)},_e.captureImageContext=p,_e.captureImage=l,_e.getIdealConstraints=v,_e.getPreferredStreamDevice=async function(e,t,n){try{return await w(e,t,n)}catch(o){if(o instanceof OverconstrainedError&&'facingMode'===o.constraint){const o='back'===e?'front':'back';return await w(o,t,n)}throw o}},_e.getStreamDevice=w,_e.isWebKit=y,_e.compareStreams=function(e,t){if(!e||!t)return!1;const n=e.getTracks()[0].getSettings(),o=t.getTracks()[0].getSettings();return n.deviceId===o.deviceId},_e.capture=function(e,t,n){const o=l(e,n),a={uri:o,base64:o,width:0,height:0,format:n.imageType??'jpg'};if(t){const{width:e=0,height:n=0}=t;a.width=e,a.height=n,a.exif=t}n.onPictureSaved&&n.onPictureSaved(a);return a},_e.syncTrackCapabilities=async function(e,t,n={}){t?.getVideoTracks&&await Promise.all(t.getVideoTracks().map(t=>b(e,t,n)))},_e.stopMediaStream=function(e){if(!e)return;e.getAudioTracks&&e.getAudioTracks().forEach(e=>e.stop());e.getVideoTracks&&e.getVideoTracks().forEach(e=>e.stop());t=e,'function'==typeof t.stop&&e.stop();var t},_e.setVideoSource=function(e,t){const n=window.URL.createObjectURL??window.webkitURL.createObjectURL;void 0!==e.srcObject?e.srcObject=t:void 0!==e.mozSrcObject?e.mozSrcObject=t:t&&n&&(e.src=n(t));if(!t){const t=window.URL.revokeObjectURL??window.webkitURL.revokeObjectURL,n=e.src??e.srcObject??e.mozSrcObject;t&&'string'==typeof n&&t(n)}},_e.isCapabilityAvailable=function(e,t){const n=e.srcObject;if(n instanceof MediaStream){const e=n.getVideoTracks()[0];return!!e.getCapabilities?.()?.[t]}return!1};var e,t=r(_d[0]),n=(e=t)&&e.__esModule?e:{default:e},o=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[1])),a=r(_d[2]),c=r(_d[3]);function s(e,t,n){const o=e*n;return{width:o,height:t/(e/o)}}function u(e,t,o){const c=['png','jpg'];(0,n.default)(c.includes(t),`expo-camera: ${t} is not a valid ImageType. Expected a string from: ${c.join(', ')}`);const s=a.ImageTypeFormat[t];return'jpg'===t?((0,n.default)(o<=1&&o>=0,`expo-camera: ${o} is not a valid image quality. Expected a number from 0...1`),e.toDataURL(s,o)):e.toDataURL(s)}function d(e,t,n){return void 0!==e&&void 0!==t&&void 0!==n}function f(e){const t={scale:1,imageType:'png',isImageMirror:!1};for(const n in e){const o=n;o in e&&void 0!==e[o]&&o in t&&(t[o]=e[o])}return t}const h=.92;function p(e,{scale:t=1,isImageMirror:n=!1}){const{videoWidth:o,videoHeight:a}=e,{width:c,height:u}=s(o,a,t),d=document.createElement('canvas');d.width=c,d.height=u;const f=d.getContext('2d',{alpha:!1});if(!f)throw new Error('Context is not defined');return n&&f.setTransform(-1,0,0,1,d.width,0),f.drawImage(e,0,0,c,u),d}function l(e,t){const n=f(t),o=p(e,n),{imageType:a,quality:c=h}=n;return u(o,a,c)}function v(e,t,n){const o={audio:!1,video:{}};if(d(e,t,n))return a.MinimumConstraints;const c=navigator.mediaDevices&&navigator.mediaDevices.getSupportedConstraints?navigator.mediaDevices.getSupportedConstraints():null;if(!(c&&c.facingMode&&c.width&&c.height))return a.MinimumConstraints;if(e&&['front','back'].includes(e)){const t=a.CameraTypeToFacingMode[e];if(y()){const e='user'===t?'exact':'ideal';o.video.facingMode={[e]:t}}else o.video.facingMode={ideal:a.CameraTypeToFacingMode[e]}}var s;return(s=o.video)&&'boolean'!=typeof s.video&&(o.video.width=t,o.video.height=n),o}async function w(e,t,n){const o=v(e,t,n);return await(0,c.requestUserMediaAsync)(o)}function y(){return/WebKit/.test(navigator.userAgent)&&!/Edg/.test(navigator.userAgent)}async function b(e,t,n={}){if('function'!=typeof t.getCapabilities)return;const a=t.getCapabilities(),c={},s=['exposureCompensation','colorTemperature','iso','brightness','contrast','saturation','sharpness','focusDistance','zoom'];for(const e of s)a[e]&&(c[e]=M(a[e],n[e]));function u(t,o,c){return S({constraintKey:t,settingsKey:o,convertedSetting:c(n[o]),capabilities:a,settings:n,cameraType:e})}a.focusMode&&void 0!==n.autoFocus&&(c.focusMode=u('focusMode','autoFocus',o.convertAutoFocusJSONToNative)),a.torch&&void 0!==n.flashMode&&(c.torch=u('torch','flashMode',o.convertFlashModeJSONToNative)),a.whiteBalanceMode&&void 0!==n.whiteBalance&&(c.whiteBalanceMode=u('whiteBalanceMode','whiteBalance',o.convertWhiteBalanceJSONToNative));try{await t.applyConstraints({advanced:[c]})}catch(e){}}function M(e,t){if(!t)return;const n=T(t,[e.min,e.max]);return Math.min(e.max,Math.max(e.min,n))}function T(e,t,n=[0,1]){return(e-n[0])*(t[1]-t[0])/(n[1]-n[0])+t[0]}function S(e){const{constraintKey:t,settingsKey:n,convertedSetting:o,capabilities:a,settings:c,cameraType:s}=e;c[n];if(!Array.isArray(a[t])||!o||a[t].includes(o))return o}},4695,[42,4696,4697,4692]);
|
|
16455
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.convertFlashModeJSONToNative=function(t){if('torch'===t)return!0;return!1},e.convertWhiteBalanceJSONToNative=function(t){switch(t){case'on':case'auto':return'continuous';case'off':return'none';case'singleShot':return'single-shot';default:return}},e.convertAutoFocusJSONToNative=function(t){switch(t){case'on':case'auto':return'continuous';case'off':return'manual';case'singleShot':return'single-shot';default:return}}},4696,[]);
|
|
16456
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"VIDEO_ASPECT_RATIOS",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"PictureSizes",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"ImageTypeFormat",{enumerable:!0,get:function(){return o}}),Object.defineProperty(e,"MinimumConstraints",{enumerable:!0,get:function(){return u}}),Object.defineProperty(e,"CameraTypeToFacingMode",{enumerable:!0,get:function(){return c}}),Object.defineProperty(e,"FacingModeToCameraType",{enumerable:!0,get:function(){return b}});const n={'3840x2160':1.7777777777777777,'1920x1080':1.7777777777777777,'1280x720':1.7777777777777777,'640x480':1.3333333333333333,'352x288':1.2222222222222223},t=Object.keys(n),o={jpg:'image/jpeg',png:'image/png'},u={audio:!1,video:!0},c={front:'user',back:'environment'},b={user:'front',environment:'back'}},4697,[]);
|
|
16457
|
+
__d(function(g,r,i,a,m,_e,_d){"use strict";function e(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var c=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,c.get?c:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t}Object.defineProperty(_e,'__esModule',{value:!0}),_e.useWebCameraStream=function(e,u,f,{onCameraReady:l,onMountError:d}){const p=t.useRef(!1),h=t.useRef([]),b=t.useRef({autoFocus:'continuous',flashMode:'off',whiteBalance:'continuous',zoom:1}),[y,M]=t.useState(null),C=t.useMemo(()=>y?y.getTracks()[0].getSettings():null,[y]),E=t.useMemo(()=>{if(!C)return null;const{facingMode:e="user"}=C;return c.FacingModeToCameraType[e]},[C]),S=t.useCallback(async()=>{try{return await n.getPreferredStreamDevice(u)}catch(e){return d&&d({nativeEvent:e}),null}},[u,d]),k=t.useCallback(async()=>{const e=await S();return n.compareStreams(e,y)||(h.current.some(t=>t.id===e?.id)||h.current.push(e),M(e),l&&l()),!1},[S,M,l,y,h.current]);return t.useEffect(()=>{p.current||(p.current=!0,k().then(e=>{p.current=e}).catch(()=>{p.current=!1}))},[u]),t.useEffect(()=>{const e={};for(const t of o)if(t in f){const n=f[t];n!==b.current[t]&&(e[t]=n)}const t=!!Object.keys(e).length,c=Object.assign({},b.current,e);t&&n.syncTrackCapabilities(u,y,e),b.current=c},[f.autoFocus,f.flashMode,f.exposureCompensation,f.colorTemperature,f.iso,f.brightness,f.contrast,f.saturation,f.sharpness,f.focusDistance,f.whiteBalance,f.zoom]),t.useEffect(()=>{e.current&&n.setVideoSource(e.current,y)},[e.current,y]),t.useEffect(()=>()=>{for(const e of h.current)n.stopMediaStream(e);e.current&&n.setVideoSource(e.current,y)},[]),s(e.current,()=>{n.syncTrackCapabilities(u,y,b.current)}),{type:E,mediaTrackSettings:C}};var t=e(r(_d[0])),n=e(r(_d[1])),c=r(_d[2]);const o=['autoFocus','flashMode','exposureCompensation','colorTemperature','iso','brightness','contrast','saturation','sharpness','focusDistance','whiteBalance','zoom'];function s(e,n){t.useEffect(()=>{e&&e.addEventListener('loadedmetadata',()=>{requestAnimationFrame(()=>{n()})})},[e])}},4698,[36,4695,4697]);
|
|
16458
|
+
__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.useWebQRScanner=function(o,{isEnabled:s,captureOptions:c,interval:u,onScanned:f,onError:l}){const d=e.useRef(!1),p=e.useRef(void 0);async function h(){if(d.current&&f)try{const e=(0,t.captureImageData)(o.current,c);if(e){const t=await n(e);t?.data&&f({nativeEvent:t})}}catch(e){l&&l({nativeEvent:e})}finally{if(0===u)return void v();const e=!u||u<0?16:u;p.current=setTimeout(()=>{h()},e)}else v()}function v(){d.current=!1,clearTimeout(p.current)}e.useEffect(()=>(s&&(d.current=!0,h()),()=>{s&&v()}),[s])};var e=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[0])),t=r(_d[1]);const n=((e,t)=>{if('undefined'==typeof window)return async()=>{throw new Error('Cannot use createWorkerAsyncFunction in a non-browser environment')};const n=[`self.func = ${e.toString()};`,'self.onmessage = (e) => {',' const result = self.func(e.data);',' self.postMessage(result);','};'];t.length>0&&n.unshift(`importScripts(${t.map(e=>`'${e}'`).join(', ')});`);const o=new Blob(n,{type:'text/javascript'}),s=new Worker(URL.createObjectURL(o)),c=[];return s.onmessage=e=>c.shift()?.resolve(e.data),e=>new Promise((t,n)=>{c.push({resolve:t,reject:n}),s.postMessage(e)})})(({data:e,width:t,height:n})=>{const o=self.jsQR(e,t,n,{inversionAttempts:'attemptBoth'});let s;try{s=JSON.parse(o)}catch{s=o}if(s?.data){const e={type:'qr',data:s.data,cornerPoints:[],bounds:{origin:{x:0,y:0},size:{width:0,height:0}}};return s.location&&(e.cornerPoints=[s.location.topLeftCorner,s.location.bottomLeftCorner,s.location.topRightCorner,s.location.bottomRightCorner]),e}return s},['https://cdn.jsdelivr.net/npm/jsqr@1.2.0/dist/jsQR.min.js'])},4699,[36,4695]);
|
|
16459
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"ConversionTables",{enumerable:!0,get:function(){return n}}),_e.convertNativeProps=u,_e.ensureNativeProps=function(e){const t=u(e);return t.barcodeScannerEnabled=!!e?.onBarcodeScanned,t.flashMode=e?.flash??'off',t.mute=e?.mute??!1,t.autoFocus=e?.autofocus??'off',t},r(d[0]);var e,t=r(d[1]),o=(e=t)&&e.__esModule?e:{default:e};const n={type:o.default.Type,flash:o.default.FlashMode};function u(e){if(!e||'object'!=typeof e)return{};const t={};for(const[o,u]of Object.entries(e)){const e=o;'string'==typeof u&&n[e]?t[o]=n[e][u]:t[o]=u}return t}},4700,[4,4690]);
|
|
16460
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return u}});var e,t=r(d[0]),u=((e=t)&&e.__esModule?e:{default:e}).default.Picture},4701,[4690]);
|
|
16461
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.BackHeader=function(y){const S=(0,n.c)(20),{title:_,titleAccessory:h,rightContent:j,onBack:k}=y,{theme:x}=(0,o.useUnistyles)(),{t:v}=(0,s.useTranslation)();let z;S[0]!==k?(z=()=>{k?k():c.router.back()},S[0]=k,S[1]=z):z=S[1];const B=z;let M,P,R,A,H,L;S[2]!==v?(M=v("common.actions.back"),S[2]=v,S[3]=M):M=S[3];S[4]!==x.colors.foregroundMuted||S[5]!==x.iconSize.lg?(P=(0,f.jsx)(l.ArrowLeft,{size:x.iconSize.lg,color:x.colors.foregroundMuted}),S[4]=x.colors.foregroundMuted,S[5]=x.iconSize.lg,S[6]=P):P=S[6];S[7]!==B||S[8]!==M||S[9]!==P?(R=(0,f.jsx)(t.Pressable,{onPress:B,style:p.backButton,accessibilityRole:"button",accessibilityLabel:M,children:P}),S[7]=B,S[8]=M,S[9]=P,S[10]=R):R=S[10];S[11]!==_?(A=_&&(0,f.jsx)(b.ScreenTitle,{children:_}),S[11]=_,S[12]=A):A=S[12];S[13]!==R||S[14]!==A||S[15]!==h?(H=(0,f.jsxs)(f.Fragment,{children:[R,A,h]}),S[13]=R,S[14]=A,S[15]=h,S[16]=H):H=S[16];S[17]!==j||S[18]!==H?(L=(0,f.jsx)(u.ScreenHeader,{left:H,right:j,leftStyle:p.left}),S[17]=j,S[18]=H,S[19]=L):L=S[19];return L};var t=r(d[0]),n=r(d[1]);r(d[2]);var s=r(d[3]);r(d[4]);var c=r(d[5]),o=r(d[6]),l=r(d[7]),u=r(d[8]),b=r(d[9]),f=r(d[10]);const p=o.StyleSheet.create(t=>({left:{gap:t.spacing[2],uni__dependencies:[0]},backButton:{padding:{xs:t.spacing[3],md:t.spacing[2]},borderRadius:t.borderRadius.lg,uni__dependencies:[0]}}))},4702,[1572,349,36,1573,1308,1143,56,1600,4407,4408,279]);
|
|
16462
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),c=r(d[3]);function u(){const u=(0,t.c)(1);let s;return u[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,c.jsx)(n.HostRouteBootstrapBoundary,{children:(0,c.jsx)(o.SchedulesScreen,{})}),u[0]=s):s=u[0],s}},4703,[349,4399,4704,279]);
|
|
16463
|
+
__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.SchedulesScreen=function(){const s=(0,o.c)(2);if(!(0,c.useIsFocused)()){let n;return s[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,D.jsx)(t.View,{style:B.container}),s[0]=n):n=s[0],n}let n;s[1]===Symbol.for("react.memo_cache_sentinel")?(n=(0,D.jsx)(E,{}),s[1]=n):n=s[1];return n};var t=r(d[0]),s=r(d[1]),n=r(d[2]),o=r(d[3]),l=r(d[4]);r(d[5]),r(d[6]),r(d[7]);var c=r(d[8]),a=r(d[9]),u=r(d[10]),h=r(d[11]),p=r(d[12]),f=r(d[13]),_=r(d[14]),S=r(d[15]),y=r(d[16]),x=r(d[17]),I=r(d[18]),v=r(d[19]),b=r(d[20]),j=r(d[21]),w=r(d[22]),T=r(d[23]),H=r(d[24]),D=r(d[25]);const C=[{value:"runnable",label:"Active",testID:"schedules-filter-active"},{value:"ended",label:"Ended",testID:"schedules-filter-ended"}];function E(){const s=(0,o.c)(54),{schedules:n,hostErrors:c,isInitialLoad:a,isError:u,refetch:p}=(0,j.useSchedules)();let S;s[0]===Symbol.for("react.memo_cache_sentinel")?(S={includeArchived:!0},s[0]=S):S=s[0];const{agents:y}=(0,v.useAggregatedAgents)(S),{projects:x}=(0,b.useProjects)(),I=(0,w.useHosts)();let C;s[1]===Symbol.for("react.memo_cache_sentinel")?(C=(0,w.getHostRuntimeStore)(),s[1]=C):C=s[1];const E=C;let P,A,N;s[2]===Symbol.for("react.memo_cache_sentinel")?(P=t=>E.subscribeAll(t),A=()=>E.getVersion(),N=()=>E.getVersion(),s[2]=P,s[3]=A,s[4]=N):(P=s[2],A=s[3],N=s[4]);(0,l.useSyncExternalStore)(P,A,N);let O;if(s[5]!==I){O=new Set;for(const t of I)E.getSnapshot(t.serverId)?.hasEverLoadedAgentDirectory&&O.add(t.serverId);s[5]=I,s[6]=O}else O=s[6];const z=O;let F;s[7]===Symbol.for("react.memo_cache_sentinel")?(F={mode:"closed"},s[7]=F):F=s[7];const[R,M]=(0,l.useState)(F),[k,W]=(0,l.useState)(f.ALL_HOSTS_OPTION_ID),[$,K]=(0,l.useState)("runnable");let U,q,G;s[8]!==I||s[9]!==k?(U=()=>{k===f.ALL_HOSTS_OPTION_ID||I.some(t=>t.serverId===k)||W(f.ALL_HOSTS_OPTION_ID)},q=[I,k],s[8]=I,s[9]=k,s[10]=U,s[11]=q):(U=s[10],q=s[11]),(0,l.useEffect)(U,q),s[12]===Symbol.for("react.memo_cache_sentinel")?(G=()=>M({mode:"create"}),s[12]=G):G=s[12];const J=G;let Q;s[13]===Symbol.for("react.memo_cache_sentinel")?(Q=t=>{M({mode:"edit",serverId:t.serverId,schedule:t})},s[13]=Q):Q=s[13];const X=Q;let Y;s[14]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>M({mode:"closed"}),s[14]=Y):Y=s[14];const Z=Y;let ee;if(s[15]!==y){ee=new Map;for(const t of y)ee.set(`${t.serverId}:${t.id}`,{title:t.title,provider:t.provider});s[15]=y,s[16]=ee}else ee=s[16];const te=ee;let se;s[17]!==x?(se=(0,H.buildProjectNameByCwd)((0,H.buildScheduleProjectTargets)(x)),s[17]=x,s[18]=se):se=s[18];const re=se;let ne;if(s[19]!==z||s[20]!==te||s[21]!==re||s[22]!==n){const t=Date.now();ne=n.map(s=>({schedule:s,resolved:(0,T.resolveSchedule)({schedule:s,serverId:s.serverId,now:t,agentsByKey:te,projectNameByCwd:re,agentDataLoaded:z.has(s.serverId)})})),s[19]=z,s[20]=te,s[21]=re,s[22]=n,s[23]=ne}else ne=s[23];const oe=ne,le=I.length<=1;let ce;if(s[24]!==oe||s[25]!==k||s[26]!==le||s[27]!==$){let t,n;s[29]!==k||s[30]!==$?(t=t=>{const{schedule:s,resolved:n}=t;return(k===f.ALL_HOSTS_OPTION_ID||s.serverId===k)&&n.bucket===$},s[29]=k,s[30]=$,s[31]=t):t=s[31],s[32]!==le?(n=t=>{const{schedule:s,resolved:n}=t;return{schedule:s,targetLabel:n.target.label,provider:n.target.provider,state:n.state,serverName:s.serverName,singleHost:le}},s[32]=le,s[33]=n):n=s[33],ce=oe.filter(t).sort(L).map(n),s[24]=oe,s[25]=k,s[26]=le,s[27]=$,s[28]=ce}else ce=s[28];const ie=ce,de=u&&0===n.length,ae=I.length>1;let ue;s[34]===Symbol.for("react.memo_cache_sentinel")?(ue=(0,D.jsx)(h.MenuHeader,{title:"Schedules"}),s[34]=ue):ue=s[34];const he=n.length>0;let ge;s[35]!==c||s[36]!==I||s[37]!==a||s[38]!==p||s[39]!==k||s[40]!==ae||s[41]!==de||s[42]!==$||s[43]!==he||s[44]!==ie?(ge=(0,D.jsx)(V,{rows:ie,hostErrors:c,hasSchedules:he,isInitialLoad:a,showLoadError:de,statusFilter:$,onStatusFilterChange:K,showHostFilter:ae,hosts:I,selectedHost:k,onSelectHost:W,onRetry:p,onCreate:J,onEdit:X}),s[35]=c,s[36]=I,s[37]=a,s[38]=p,s[39]=k,s[40]=ae,s[41]=de,s[42]=$,s[43]=he,s[44]=ie,s[45]=ge):ge=s[45];const me="edit"===R.mode?R.serverId:void 0,pe="create"===R.mode||"edit"===R.mode,fe="edit"===R.mode?"edit":"create",_e="edit"===R.mode?R.schedule:void 0;let Se,ye;return s[46]!==me||s[47]!==pe||s[48]!==fe||s[49]!==_e?(Se=(0,D.jsx)(_.ScheduleFormSheet,{serverId:me,visible:pe,onClose:Z,mode:fe,schedule:_e}),s[46]=me,s[47]=pe,s[48]=fe,s[49]=_e,s[50]=Se):Se=s[50],s[51]!==ge||s[52]!==Se?(ye=(0,D.jsxs)(t.View,{style:B.container,children:[ue,ge,Se]}),s[51]=ge,s[52]=Se,s[53]=ye):ye=s[53],ye}function L(t,s){return Date.parse(s.schedule.createdAt)-Date.parse(t.schedule.createdAt)}function V(l){const c=(0,o.c)(40),{rows:u,hostErrors:h,hasSchedules:f,isInitialLoad:_,showLoadError:v,statusFilter:b,onStatusFilterChange:j,showHostFilter:w,hosts:T,selectedHost:H,onSelectHost:E,onRetry:L,onCreate:V,onEdit:A}=l;if(_){let s;return c[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,D.jsx)(t.View,{style:B.centered,children:(0,D.jsx)(x.LoadingSpinner,{size:"large",color:B.spinner.color})}),c[0]=s):s=c[0],s}if(v){let n,o;return c[1]===Symbol.for("react.memo_cache_sentinel")?(n=(0,D.jsx)(s.Text,{style:B.message,children:"Unable to load schedules"}),c[1]=n):n=c[1],c[2]!==L?(o=(0,D.jsxs)(t.View,{style:B.centered,children:[n,(0,D.jsx)(y.Button,{variant:"ghost",onPress:L,testID:"schedules-retry",children:"Try again"})]}),c[2]=L,c[3]=o):o=c[3],o}if(!f){let n,o,l,u;return c[4]!==h?(n=h.length>0?(0,D.jsx)(P,{errors:h}):null,c[4]=h,c[5]=n):n=c[5],c[6]===Symbol.for("react.memo_cache_sentinel")?(o=(0,D.jsx)(s.Text,{style:B.message,children:"No schedules yet"}),c[6]=o):o=c[6],c[7]!==V?(l=(0,D.jsx)(y.Button,{variant:"ghost",leftIcon:a.Plus,onPress:V,testID:"schedules-empty-new",children:"Create a schedule"}),c[7]=V,c[8]=l):l=c[8],c[9]!==n||c[10]!==l?(u=(0,D.jsxs)(t.View,{style:B.centered,testID:"schedules-empty",children:[n,o,l]}),c[9]=n,c[10]=l,c[11]=u):u=c[11],u}const N="ended"===b?"No ended schedules":"No active schedules";let O,z,F,R,M,k,W,$,K;return c[12]!==T||c[13]!==E||c[14]!==H||c[15]!==w?(O=w?(0,D.jsx)(p.HostFilter,{hosts:T,selectedHost:H,onSelectHost:E,triggerTestID:"schedules-host-filter-trigger"}):null,c[12]=T,c[13]=E,c[14]=H,c[15]=w,c[16]=O):O=c[16],c[17]!==j||c[18]!==b?(z=(0,D.jsx)(I.SegmentedControl,{size:"sm",value:b,onValueChange:j,options:C,testID:"schedules-status-filter"}),c[17]=j,c[18]=b,c[19]=z):z=c[19],c[20]!==O||c[21]!==z?(F=(0,D.jsxs)(t.View,{style:B.filterRowControls,children:[O,z]}),c[20]=O,c[21]=z,c[22]=F):F=c[22],c[23]!==V?(R=(0,D.jsx)(y.Button,{leftIcon:a.Plus,onPress:V,size:"sm",testID:"schedules-new",children:"New schedule"}),c[23]=V,c[24]=R):R=c[24],c[25]!==F||c[26]!==R?(M=(0,D.jsxs)(t.View,{style:B.filterRow,children:[F,R]}),c[25]=F,c[26]=R,c[27]=M):M=c[27],c[28]!==h?(k=h.length>0?(0,D.jsx)(P,{errors:h}):null,c[28]=h,c[29]=k):k=c[29],c[30]!==N||c[31]!==A||c[32]!==u?(W=u.length>0?(0,D.jsx)(S.SchedulesTable,{rows:u,onEditSchedule:A}):(0,D.jsx)(t.View,{style:B.filterEmpty,children:(0,D.jsx)(s.Text,{style:B.filterEmptyText,children:N})}),c[30]=N,c[31]=A,c[32]=u,c[33]=W):W=c[33],c[34]!==k||c[35]!==W?($=(0,D.jsxs)(n.ScrollView,{style:B.scroll,contentContainerStyle:B.scrollContent,showsVerticalScrollIndicator:!1,keyboardShouldPersistTaps:"handled",testID:"schedules-list",children:[k,W]}),c[34]=k,c[35]=W,c[36]=$):$=c[36],c[37]!==M||c[38]!==$?(K=(0,D.jsxs)(t.View,{style:B.body,children:[M,$]}),c[37]=M,c[38]=$,c[39]=K):K=c[39],K}function P(s){const n=(0,o.c)(4),{errors:l}=s;let c,a;return n[0]!==l?(c=l.map(A),n[0]=l,n[1]=c):c=n[1],n[2]!==c?(a=(0,D.jsx)(t.View,{style:B.errorsBannerWrap,children:(0,D.jsx)(t.View,{style:B.errorsBanner,testID:"schedules-host-errors",children:c})}),n[2]=c,n[3]=a):a=n[3],a}function A(t){return(0,D.jsx)(s.Text,{style:B.errorsBannerText,children:`${t.serverName}: Could not load schedules`},t.serverId)}const B=u.StyleSheet.create(t=>({container:{flex:1,backgroundColor:t.colors.surface0,uni__dependencies:[0]},body:{flex:1,minHeight:0},centered:{flex:1,justifyContent:"center",alignItems:"center",gap:t.spacing[6],padding:t.spacing[6],uni__dependencies:[0]},filterRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:t.spacing[3],paddingHorizontal:{xs:t.spacing[3],md:t.spacing[6]},paddingTop:t.spacing[4],uni__dependencies:[0]},filterRowControls:{flexDirection:"row",alignItems:"center",gap:t.spacing[3],flexShrink:1,flexWrap:"wrap",uni__dependencies:[0]},scroll:{flex:1,minHeight:0},scrollContent:{gap:t.spacing[3],paddingTop:t.spacing[4],paddingBottom:t.spacing[6],uni__dependencies:[0]},errorsBannerWrap:{paddingHorizontal:{xs:t.spacing[3],md:t.spacing[6]},uni__dependencies:[0]},errorsBanner:{borderWidth:1,borderColor:t.colors.border,borderRadius:t.borderRadius.lg,padding:t.spacing[3],gap:t.spacing[1],uni__dependencies:[0]},errorsBannerText:{color:t.colors.palette.red[300],fontSize:t.fontSize.xs,uni__dependencies:[0]},filterEmpty:{paddingHorizontal:{xs:t.spacing[3],md:t.spacing[6]},paddingVertical:t.spacing[6],alignItems:"center",uni__dependencies:[0]},filterEmptyText:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,uni__dependencies:[0]},message:{color:t.colors.foregroundMuted,fontSize:t.fontSize.lg,textAlign:"center",uni__dependencies:[0]},spinner:{color:t.colors.foregroundMuted,uni__dependencies:[0]}}))},4704,[348,711,690,349,36,182,234,146,1148,1600,56,4406,4705,3454,4706,4714,3627,3564,4430,3447,3895,4711,3271,4716,4713,279]);
|
|
16464
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.HostFilter=function(c){const u=(0,l.c)(20),{hosts:x,selectedHost:y,onSelectHost:H,triggerTestID:v}=c,[P,j]=(0,n.useState)(!1),k=(0,n.useRef)(null);let C;u[0]!==x||u[1]!==y?(C=(0,f.getHostPickerLabel)(x,y,{includeAllHost:!0}),u[0]=x,u[1]=y,u[2]=C):C=u[2];const D=C;let I;u[3]===Symbol.for("react.memo_cache_sentinel")?(I=()=>j(!0),u[3]=I):I=u[3];const O=I,W=S,w=`Filter: ${D}`;let z,L,R,A,F;u[4]!==y?(z=y===f.ALL_HOSTS_OPTION_ID?(0,b.jsx)(h,{size:14,uniProps:_}):(0,b.jsx)(f.HostStatusDotSlot,{serverId:y}),u[4]=y,u[5]=z):z=u[5];u[6]!==D?(L=(0,b.jsx)(o.Text,{style:T.filterTriggerText,numberOfLines:1,children:D}),u[6]=D,u[7]=L):L=u[7];u[8]===Symbol.for("react.memo_cache_sentinel")?(R=(0,b.jsx)(p,{size:14,uniProps:_}),u[8]=R):R=u[8];u[9]!==w||u[10]!==z||u[11]!==L||u[12]!==v?(A=(0,b.jsx)(t.View,{ref:k,collapsable:!1,style:T.filterTriggerWrap,children:(0,b.jsxs)(s.Pressable,{onPress:O,style:W,testID:v,accessibilityRole:"button",accessibilityLabel:w,children:[z,L,R]})}),u[9]=w,u[10]=z,u[11]=L,u[12]=v,u[13]=A):A=u[13];u[14]!==x||u[15]!==P||u[16]!==H||u[17]!==y||u[18]!==A?(F=(0,b.jsx)(f.HostPicker,{hosts:x,value:y,onSelect:H,open:P,onOpenChange:j,anchorRef:k,includeAllHost:!0,searchable:!1,title:"Filter by host",desktopPlacement:"bottom-start",children:A}),u[14]=x,u[15]=P,u[16]=H,u[17]=y,u[18]=A,u[19]=F):F=u[19];return F};var t=r(d[0]),o=r(d[1]),s=r(d[2]),l=r(d[3]),n=r(d[4]);r(d[5]),r(d[6]),r(d[7]);var c=r(d[8]),u=r(d[9]),f=r(d[10]),b=r(d[11]);const h=(0,u.withUnistyles)(c.Server),p=(0,u.withUnistyles)(c.ChevronDown),_=t=>({color:t.colors.foregroundMuted});function S(t){const{pressed:o,hovered:s}=t,l=void 0!==s&&s;return[T.filterTrigger,Boolean(l)&&T.filterTriggerHovered,o&&T.filterTriggerPressed]}const T=u.StyleSheet.create(t=>({filterTriggerWrap:{alignSelf:"flex-start"},filterTrigger:{flexDirection:"row",alignItems:"center",gap:t.spacing[1.5],alignSelf:"flex-start",paddingVertical:t.spacing[1.5],paddingHorizontal:t.spacing[3],borderRadius:t.borderRadius.md,backgroundColor:t.colors.surface1,borderWidth:t.borderWidth[1],borderColor:t.colors.border,uni__dependencies:[0]},filterTriggerHovered:{backgroundColor:t.colors.surface2,uni__dependencies:[0]},filterTriggerPressed:{backgroundColor:t.colors.surface3,uni__dependencies:[0]},filterTriggerText:{color:t.colors.foreground,fontSize:t.fontSize.sm,fontWeight:t.fontWeight.medium,uni__dependencies:[0]}}))},4705,[348,711,1572,349,36,1308,234,146,1600,56,3454,279]);
|
|
16465
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.ScheduleFormSheet=function({serverId:n,visible:l,onClose:c,mode:u,schedule:h}){const x="edit"===u,T=x&&"agent"===h?.target.type,{projects:C}=(0,I.useProjects)(),{agents:V}=(0,S.useAggregatedAgents)({includeArchived:!0}),B=(0,s.useMemo)(()=>D(C),[C]),L=(0,s.useMemo)(()=>{if(!h||"agent"!==h.target.type)return null;const{agentId:t}=h.target,o=V.find(o=>o.serverId===n&&o.id===t);return o?o.title?.trim()||"Untitled agent":"Agent unavailable"},[V,h,n]),N=(0,s.useMemo)(()=>Array.from(new Set(B.targets.map(t=>t.serverId))),[B.targets]),E=(0,s.useMemo)(()=>x?k(h):void 0,[x,h]),$=(0,j.useAgentFormState)({initialServerId:n??null,initialValues:E,isVisible:l,isCreateFlow:!0,onlineServerIds:N}),{selectedServerId:U,selectedProvider:J,selectedModel:X,selectedMode:q,selectedThinkingOptionId:G,workingDir:Q,setProviderAndModelFromUser:Y,clearProviderSelectionFromUser:Z,setModeFromUser:ee,setSelectedServerId:te,setSelectedServerIdFromUser:re,setWorkingDir:oe,setWorkingDirFromUser:ne,modeOptions:le,modelSelectorProviders:se,isAllModelsLoading:ie,persistFormPreferences:ce}=$,de=(0,s.useMemo)(()=>R({targets:B.targets,serverId:U,cwd:Q}),[B.targets,U,Q]),ae=de?.optionId??"",ue=de?.serverId??U??n??"",ge=(0,s.useCallback)(t=>{U&&U!==t.serverId&&Z(),re(t.serverId),ne(t.cwd)},[Z,U,re,ne]),pe=(0,s.useCallback)(({selectedModelLabel:t,disabled:o,isOpen:n,hovered:l,pressed:s})=>(0,P.jsx)(H,{label:t,provider:J,disabled:o,active:l||s||n,isPlaceholder:!X}),[X,J]),{createSchedule:me,updateSchedule:he,isCreating:be,isUpdating:fe}=(0,y.useScheduleMutations)({serverId:ue}),xe=be||fe,[ve,ye]=(0,s.useState)(()=>h?.name??""),[je,Se]=(0,s.useState)(()=>h?.prompt??""),[Ie,Te]=(0,s.useState)(()=>null!=h?.maxRuns?String(h.maxRuns):""),[_e,we]=(0,s.useState)(()=>h?.cadence??M),[Ce,Pe]=(0,s.useState)(null),[Me,Ve]=(0,s.useState)(0),ke=(0,s.useRef)(!1);(0,s.useEffect)(()=>{l&&!ke.current&&(ye(h?.name??""),Se(h?.prompt??""),Te(null!=h?.maxRuns?String(h.maxRuns):""),we(h?.cadence??M),Pe(null),Ve(t=>t+1),x||(te(null),oe(""))),ke.current=l},[l,h,x,te,oe]);const De=je.trim(),Re=Q.trim(),ze="cron"===_e.type?(0,_.validateCron)(_e.expression):null,Oe=z({providers:se,selectedProvider:J,selectedModel:X}),Ae=A({isAgentTarget:T,isEdit:x,promptTrimmed:De,cadenceError:ze,isSubmitting:xe,selectedModelIsValid:Oe,hasWorkingDir:Re.length>0,hasSelectedProject:Boolean(de)}),Fe=(0,s.useCallback)(async()=>!!h&&(await he({id:h.id,name:ve.trim()||null,prompt:De,cadence:_e,maxRuns:O(Ie)}),!0),[_e,Ie,ve,De,h,he]),Be=(0,s.useCallback)(async()=>{if(!J||!Re)return!1;await ce();const t=O(Ie);return x&&h?(await he({id:h.id,name:ve.trim()||null,prompt:De,cadence:_e,newAgentConfig:{provider:J,model:X||null,modeId:q||null,cwd:Re},maxRuns:t}),!0):(await me(Object.assign({prompt:De,name:ve.trim()||void 0,cadence:_e,target:{type:"new-agent",config:{provider:J,cwd:Re,model:X||void 0,modeId:q||void 0,thinkingOptionId:G||void 0,title:ve.trim()||void 0}}},null!=t?{maxRuns:t}:{})),!0)},[_e,me,x,Ie,ve,ce,De,h,q,X,J,G,Re,he]),Le=(0,s.useCallback)(async()=>{if(De){Pe(null);try{(T?await Fe():await Be())&&c()}catch(t){Pe((0,w.toErrorMessage)(t))}}},[T,c,De,Fe,Be]),We=(0,s.useCallback)(()=>{Le()},[Le]),Ne=(0,s.useMemo)(()=>({title:x?"Edit schedule":"New schedule"}),[x]),Ee=(0,s.useMemo)(()=>(0,P.jsxs)(t.View,{style:K.footer,children:[(0,P.jsx)(b.Button,{style:K.footerButton,variant:"secondary",onPress:c,disabled:xe,children:"Cancel"}),(0,P.jsx)(b.Button,{style:K.footerButton,variant:"default",onPress:We,disabled:!Ae,loading:xe,testID:"schedule-form-submit",children:x?"Save changes":"Create schedule"})]}),[Ae,We,x,xe,c]);return(0,P.jsxs)(p.AdaptiveModalSheet,{header:Ne,visible:l,onClose:c,footer:Ee,webScrollbar:!0,testID:"schedule-form-sheet",children:[(0,P.jsxs)(t.View,{style:K.field,children:[(0,P.jsx)(o.Text,{style:K.label,children:"Name"}),(0,P.jsx)(p.AdaptiveTextInput,{testID:"schedule-name-input",accessibilityLabel:"Schedule name",initialValue:ve,resetKey:`schedule-name-${Me}`,value:ve,onChangeText:ye,placeholder:"Optional",style:K.input,autoCapitalize:"none",autoCorrect:!1})]}),(0,P.jsxs)(t.View,{style:K.field,children:[(0,P.jsx)(o.Text,{style:K.label,children:"Prompt"}),(0,P.jsx)(p.AdaptiveTextInput,{testID:"schedule-prompt-input",accessibilityLabel:"Prompt",initialValue:je,resetKey:`schedule-prompt-${Me}`,value:je,onChangeText:Se,placeholder:"What should the agent do each run?",style:K.multilineInput,multiline:!0,numberOfLines:4,textAlignVertical:"top"})]}),T?(0,P.jsxs)(t.View,{style:K.field,children:[(0,P.jsx)(o.Text,{style:K.label,children:"Target"}),(0,P.jsx)(t.View,{style:K.readonlyField,testID:"schedule-agent-target",children:(0,P.jsx)(o.Text,{style:K.selectTriggerText,numberOfLines:1,children:L})}),(0,P.jsx)(o.Text,{style:K.hint,children:"Runs against this existing agent."})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(t.View,{style:K.field,children:[(0,P.jsx)(o.Text,{style:K.label,children:"Project"}),(0,P.jsx)(W,{options:B.options,targetByOptionId:B.targetByOptionId,value:ae,selectedTarget:de,fallbackCwd:Q,onSelect:ge})]}),(0,P.jsxs)(t.View,{style:K.field,children:[(0,P.jsx)(o.Text,{style:K.label,children:"Model"}),(0,P.jsx)(f.CombinedModelSelector,{providers:se,selectedProvider:J??"",selectedModel:X,onSelect:Y,isLoading:ie,renderTrigger:pe,triggerFill:!0,serverId:ue})]}),le.length>0?(0,P.jsx)(F,{options:le,selectedMode:q,onSelect:ee}):null]}),(0,P.jsxs)(t.View,{style:K.field,children:[(0,P.jsx)(o.Text,{style:K.label,children:"Cadence"}),(0,P.jsx)(v.CadenceEditor,{value:_e,onChange:we,error:ze??void 0})]}),(0,P.jsxs)(t.View,{style:K.field,children:[(0,P.jsx)(o.Text,{style:K.label,children:"Max runs"}),(0,P.jsx)(p.AdaptiveTextInput,{testID:"schedule-max-runs-input",accessibilityLabel:"Max runs",initialValue:Ie,resetKey:`schedule-max-runs-${Me}`,value:Ie,onChangeText:Te,placeholder:"Unlimited",style:K.input,keyboardType:"number-pad"}),(0,P.jsx)(o.Text,{style:K.hint,children:"Leave blank to run indefinitely"})]}),Ce?(0,P.jsx)(o.Text,{style:K.error,children:Ce}):null]})};var t=r(d[0]),o=r(d[1]),n=r(d[2]),l=r(d[3]),s=r(d[4]);r(d[5]),r(d[6]),r(d[7]);var c=r(d[8]),u=r(d[9]),p=r(d[10]),h=r(d[11]),b=r(d[12]),f=r(d[13]),x=r(d[14]),v=r(d[15]),y=r(d[16]),j=r(d[17]),S=r(d[18]),I=r(d[19]),T=r(d[20]),_=r(d[21]),w=r(d[22]),C=r(d[23]),P=r(d[24]);const M={type:"every",everyMs:36e5};function V(t){return t&&"new-agent"===t.target.type?t.target.config:null}function k(t){const o=V(t);if(o)return{provider:o.provider,model:o.model??null,modeId:o.modeId??null,workingDir:o.cwd}}function D(t){const o=(0,T.buildScheduleProjectTargets)(t),n=new Map(o.map(t=>[t.optionId,t])),l=o.map(t=>({id:t.optionId,label:t.projectName,description:`${t.serverName} - ${(0,C.shortenPath)(t.cwd)}`}));return{targets:o,options:l,targetByOptionId:n}}function R(t){const o=t.cwd.trim();return t.serverId&&o?t.targets.find(n=>n.serverId===t.serverId&&n.cwd===o)??null:null}function z(t){if(!t.selectedProvider)return!1;const o=t.providers.find(o=>o.id===t.selectedProvider);if(!o||"models"!==o.modelSelection.kind)return!1;const n=t.selectedModel.trim();return!n||o.modelSelection.rows.some(t=>t.modelId===n)}function O(t){const o=Number.parseInt(t,10);return Number.isFinite(o)&&o>0?o:null}function A(t){return 0!==t.promptTrimmed.length&&null===t.cadenceError&&!t.isSubmitting&&(!!t.isAgentTarget||!!t.selectedModelIsValid&&(t.isEdit?t.hasWorkingDir:t.hasSelectedProject))}function F(u){const p=(0,l.c)(27),{options:b,selectedMode:f,onSelect:x}=u,v=(0,s.useRef)(null),[y,j]=(0,s.useState)(!1);let S;p[0]!==b?(S=b.map(L),p[0]=b,p[1]=S):S=p[1];const I=S;let T;p[2]!==b||p[3]!==f?(T=b.find(t=>t.id===f)?.label??"Default mode",p[2]=b,p[3]=f,p[4]=T):T=p[4];const _=T;let w;p[5]!==x?(w=t=>{x(t),j(!1)},p[5]=x,p[6]=w):w=p[6];const C=w;let M;p[7]===Symbol.for("react.memo_cache_sentinel")?(M=()=>{j(B)},p[7]=M):M=p[7];const V=M;let k;p[8]!==y?(k=t=>{const{hovered:o,pressed:n}=t;return[K.selectTrigger,(Boolean(o)||n||y)&&K.selectTriggerActive]},p[8]=y,p[9]=k):k=p[9];const D=k;let R;p[10]===Symbol.for("react.memo_cache_sentinel")?(R=(0,P.jsx)(o.Text,{style:K.label,children:"Mode"}),p[10]=R):R=p[10];const z=`Select mode (${_})`;let O,A,F;p[11]!==_?(O=(0,P.jsx)(o.Text,{style:K.selectTriggerText,numberOfLines:1,children:_}),p[11]=_,p[12]=O):O=p[12],p[13]===Symbol.for("react.memo_cache_sentinel")?(A=(0,P.jsx)(c.ChevronDown,{size:16,color:K.chevron.color}),p[13]=A):A=p[13],p[14]!==z||p[15]!==O||p[16]!==D?(F=(0,P.jsx)(t.View,{ref:v,collapsable:!1,children:(0,P.jsxs)(n.Pressable,{onPress:V,style:D,accessibilityRole:"button",accessibilityLabel:z,testID:"schedule-mode-trigger",children:[O,A]})}),p[14]=z,p[15]=O,p[16]=D,p[17]=F):F=p[17];const W=I.length>6;let N,E;return p[18]!==I||p[19]!==C||p[20]!==y||p[21]!==f||p[22]!==W?(N=(0,P.jsx)(h.Combobox,{options:I,value:f,onSelect:C,searchable:W,title:"Select mode",open:y,onOpenChange:j,anchorRef:v,desktopPlacement:"bottom-start"}),p[18]=I,p[19]=C,p[20]=y,p[21]=f,p[22]=W,p[23]=N):N=p[23],p[24]!==F||p[25]!==N?(E=(0,P.jsxs)(t.View,{style:K.field,children:[R,F,N]}),p[24]=F,p[25]=N,p[26]=E):E=p[26],E}function B(t){return!t}function L(t){return{id:t.id,label:t.label}}function W(u){const p=(0,l.c)(31),{options:b,targetByOptionId:f,value:x,selectedTarget:v,fallbackCwd:y,onSelect:j}=u,S=(0,s.useRef)(null),[I,T]=(0,s.useState)(!1);let _;p[0]!==j||p[1]!==f?(_=t=>{const o=f.get(t);o&&(j(o),T(!1))},p[0]=j,p[1]=f,p[2]=_):_=p[2];const w=_;let M;p[3]===Symbol.for("react.memo_cache_sentinel")?(M=()=>{T(E)},p[3]=M):M=p[3];const V=M;let k;p[4]!==I?(k=t=>{const{hovered:o,pressed:n}=t;return[K.selectTrigger,(Boolean(o)||n||I)&&K.selectTriggerActive]},p[4]=I,p[5]=k):k=p[5];const D=k;let R,z;p[6]!==y||p[7]!==v?.projectName?(R=y.trim(),z=v?.projectName??(R?(0,C.shortenPath)(R):"Select project"),p[6]=y,p[7]=v?.projectName,p[8]=R,p[9]=z):(R=p[8],z=p[9]);const O=z,A=!v&&!R;let F;p[10]!==v?(F=v?`${v.serverName} - ${(0,C.shortenPath)(v.cwd)}`:null,p[10]=v,p[11]=F):F=p[11];const B=F,L=N,W=`Select project (${O})`,$=A?K.selectTriggerPlaceholder:K.selectTriggerText;let U,H,J,X,q,G;return p[12]!==O||p[13]!==$?(U=(0,P.jsx)(o.Text,{style:$,numberOfLines:1,children:O}),p[12]=O,p[13]=$,p[14]=U):U=p[14],p[15]===Symbol.for("react.memo_cache_sentinel")?(H=(0,P.jsx)(c.ChevronDown,{size:16,color:K.chevron.color}),p[15]=H):H=p[15],p[16]!==W||p[17]!==U||p[18]!==D?(J=(0,P.jsx)(t.View,{ref:S,collapsable:!1,children:(0,P.jsxs)(n.Pressable,{onPress:V,style:D,accessibilityRole:"button",accessibilityLabel:W,testID:"schedule-project-trigger",children:[U,H]})}),p[16]=W,p[17]=U,p[18]=D,p[19]=J):J=p[19],p[20]!==B?(X=B?(0,P.jsx)(o.Text,{style:K.hint,children:B}):null,p[20]=B,p[21]=X):X=p[21],p[22]!==w||p[23]!==I||p[24]!==b||p[25]!==x?(q=(0,P.jsx)(h.Combobox,{options:b,value:x,onSelect:w,searchable:!0,searchPlaceholder:"Search projects...",emptyText:"No projects found",title:"Select project",open:I,onOpenChange:T,anchorRef:S,desktopPlacement:"bottom-start",renderOption:L}),p[22]=w,p[23]=I,p[24]=b,p[25]=x,p[26]=q):q=p[26],p[27]!==J||p[28]!==X||p[29]!==q?(G=(0,P.jsxs)(P.Fragment,{children:[J,X,q]}),p[27]=J,p[28]=X,p[29]=q,p[30]=G):G=p[30],G}function N(t){const{option:o,selected:n,active:l,onPress:s}=t;return(0,P.jsx)($,{option:o,selected:n,active:l,onPress:s})}function E(t){return!t}function $(o){const n=(0,l.c)(10),{option:s,selected:u,active:p,onPress:b}=o;let f;n[0]===Symbol.for("react.memo_cache_sentinel")?(f=(0,P.jsx)(t.View,{style:K.optionIconBox,children:(0,P.jsx)(c.Folder,{size:16,color:K.chevron.color})}),n[0]=f):f=n[0];const x=f;let v;let y;return n[1]!==s.id?(v=`schedule-project-option-${s.id.slice(T.PROJECT_OPTION_PREFIX.length).replace(/^[^:]+:/,"")}`,n[1]=s.id,n[2]=v):v=n[2],n[3]!==p||n[4]!==b||n[5]!==s.description||n[6]!==s.label||n[7]!==u||n[8]!==v?(y=(0,P.jsx)(h.ComboboxItem,{testID:v,label:s.label,description:s.description,selected:u,active:p,onPress:b,leadingSlot:x}),n[3]=p,n[4]=b,n[5]=s.description,n[6]=s.label,n[7]=u,n[8]=v,n[9]=y):y=n[9],y}function U(t){const o=(0,l.c)(4),{provider:n}=t;if(!n)return null;let s;o[0]!==n?(s=(0,x.getProviderIcon)(n),o[0]=n,o[1]=s):s=o[1];const c=s;let u;return o[2]!==c?(u=(0,P.jsx)(c,{size:16,color:K.providerIcon.color}),o[2]=c,o[3]=u):u=o[3],u}function H(n){const s=(0,l.c)(13),{label:u,provider:p,disabled:h,active:b,isPlaceholder:f}=n,x=b&&K.selectTriggerActive,v=h&&K.selectTriggerDisabled;let y;s[0]!==x||s[1]!==v?(y=[K.selectTrigger,x,v],s[0]=x,s[1]=v,s[2]=y):y=s[2];const j=y;let S;s[3]!==p?(S=(0,P.jsx)(U,{provider:p}),s[3]=p,s[4]=S):S=s[4];const I=f?K.selectTriggerPlaceholder:K.selectTriggerText;let T,_,w;return s[5]!==u||s[6]!==I?(T=(0,P.jsx)(o.Text,{style:I,numberOfLines:1,children:u}),s[5]=u,s[6]=I,s[7]=T):T=s[7],s[8]===Symbol.for("react.memo_cache_sentinel")?(_=(0,P.jsx)(c.ChevronDown,{size:16,color:K.chevron.color}),s[8]=_):_=s[8],s[9]!==j||s[10]!==S||s[11]!==T?(w=(0,P.jsxs)(t.View,{pointerEvents:"none",style:j,testID:"schedule-model-trigger",children:[S,T,_]}),s[9]=j,s[10]=S,s[11]=T,s[12]=w):w=s[12],w}const K=u.StyleSheet.create(t=>({field:{gap:t.spacing[2],uni__dependencies:[0]},label:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,fontWeight:t.fontWeight.medium,uni__dependencies:[0]},input:{backgroundColor:t.colors.surface2,borderRadius:t.borderRadius.lg,paddingHorizontal:t.spacing[4],paddingVertical:t.spacing[3],color:t.colors.foreground,borderWidth:1,borderColor:t.colors.border,fontSize:t.fontSize.base,uni__dependencies:[0]},multilineInput:{backgroundColor:t.colors.surface2,borderRadius:t.borderRadius.lg,paddingHorizontal:t.spacing[4],paddingVertical:t.spacing[3],color:t.colors.foreground,borderWidth:1,borderColor:t.colors.border,fontSize:t.fontSize.base,minHeight:96,uni__dependencies:[0]},hint:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,uni__dependencies:[0]},error:{color:t.colors.palette.red[300],fontSize:t.fontSize.xs,uni__dependencies:[0]},readonlyField:{flexDirection:"row",alignItems:"center",backgroundColor:t.colors.surface2,borderRadius:t.borderRadius.lg,borderWidth:1,borderColor:t.colors.border,paddingHorizontal:t.spacing[4],paddingVertical:t.spacing[3],minHeight:44,uni__dependencies:[0]},selectTrigger:{flexDirection:"row",alignItems:"center",gap:t.spacing[2],backgroundColor:t.colors.surface2,borderRadius:t.borderRadius.lg,borderWidth:1,borderColor:t.colors.border,paddingHorizontal:t.spacing[4],paddingVertical:t.spacing[3],minHeight:44,uni__dependencies:[0]},selectTriggerActive:{borderColor:t.colors.borderAccent,uni__dependencies:[0]},selectTriggerDisabled:{opacity:t.opacity[50],uni__dependencies:[0]},selectTriggerText:{flex:1,minWidth:0,color:t.colors.foreground,fontSize:t.fontSize.base,uni__dependencies:[0]},selectTriggerPlaceholder:{flex:1,minWidth:0,color:t.colors.foregroundMuted,fontSize:t.fontSize.base,uni__dependencies:[0]},optionIconBox:{width:18,height:18,alignItems:"center",justifyContent:"center"},footer:{flex:1,flexDirection:"row",gap:t.spacing[3],uni__dependencies:[0]},footerButton:{flex:1},providerIcon:{color:t.colors.foregroundMuted,uni__dependencies:[0]},chevron:{color:t.colors.foregroundMuted,uni__dependencies:[0]}}))},4706,[348,711,1572,349,36,1308,234,146,1600,56,3466,3456,3627,3941,3929,4707,4710,4077,3447,3895,4713,4708,3948,3511,279]);
|
|
16466
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.CadenceEditor=function(o){const c=(0,s.c)(65),{value:S,onChange:T,error:w}=o,I=S.type;let R;c[0]!==S.everyMs||c[1]!==S.type?(R=()=>String((0,y.everyMsToParts)("every"===S.type?S.everyMs:f).value),c[0]=S.everyMs,c[1]=S.type,c[2]=R):R=c[2];const[V,H]=(0,l.useState)(R);let k;c[3]!==S.everyMs||c[4]!==S.type?(k=()=>(0,y.everyMsToParts)("every"===S.type?S.everyMs:f).unit,c[3]=S.everyMs,c[4]=S.type,c[5]=k):k=c[5];const[D,L]=(0,l.useState)(k);let W;c[6]!==S.expression||c[7]!==S.type?(W=()=>"cron"===S.type?S.expression:_,c[6]=S.expression,c[7]=S.type,c[8]=W):W=c[8];const[P,$]=(0,l.useState)(W),[E,F]=(0,l.useReducer)(j,0),N=(0,l.useRef)("cron"===S.type?S.expression:_);let A;if(c[9]!==V){const n=Number.parseInt(V,10);A=Number.isFinite(n)&&n>0?n:1,c[9]=V,c[10]=A}else A=c[10];const K=A;let O;c[11]!==T?(O=(n,t)=>{T({type:"every",everyMs:(0,y.partsToEveryMs)(n,t)})},c[11]=T,c[12]=O):O=c[12];const B=O;let U;c[13]!==T?(U=n=>{N.current=n,T({type:"cron",expression:n})},c[13]=T,c[14]=U):U=c[14];const q=U;let G;c[15]!==P||c[16]!==q||c[17]!==B||c[18]!==D||c[19]!==I||c[20]!==K?(G=n=>{n!==I&&("every"===n?B(K,D):q(P.trim()||N.current))},c[15]=P,c[16]=q,c[17]=B,c[18]=D,c[19]=I,c[20]=K,c[21]=G):G=c[21];const J=G;let Q;c[22]!==B||c[23]!==D?(Q=n=>{const t=n.replace(/[^0-9]/g,"");H(t);const o=Number.parseInt(t,10);B(Number.isFinite(o)&&o>0?o:1,D)},c[22]=B,c[23]=D,c[24]=Q):Q=c[24];const X=Q;let Y;c[25]!==B||c[26]!==K?(Y=n=>{L(n),B(K,n)},c[25]=B,c[26]=K,c[27]=Y):Y=c[27];const Z=Y;let ee;c[28]!==q?(ee=n=>{$(n),q(n.trim())},c[28]=q,c[29]=ee):ee=c[29];const ne=ee;let re;c[30]!==q?(re=n=>{$(n),F(),q(n)},c[30]=q,c[31]=re):re=c[31];const te=re;let oe;c[32]!==D||c[33]!==K?(oe=C(K,D),c[32]=D,c[33]=K,c[34]=oe):oe=c[34];const se=oe;let ie,le,ce;c[35]!==P?(ce=P.trim(),ie=ce?(0,y.validateCron)(ce):null,le=ie?null:(0,y.describeCron)(ce)??ce,c[35]=P,c[36]=ie,c[37]=le,c[38]=ce):(ie=c[36],le=c[37],ce=c[38]);const ae=le;let de,ue,pe,ye,be=null;if(ie){let n;c[39]!==ie?(n=(0,b.jsx)(t.Text,{style:M.error,children:ie}),c[39]=ie,c[40]=n):n=c[40],be=n}else if(ae){let n;c[41]!==ae?(n=(0,b.jsx)(t.Text,{style:M.preview,children:ae}),c[41]=ae,c[42]=n):n=c[42],be=n}c[43]!==J||c[44]!==I?(de=(0,b.jsx)(p.SegmentedControl,{size:"sm",value:I,onValueChange:J,options:x,style:M.modeControl,testID:"cadence-mode"}),c[43]=J,c[44]=I,c[45]=de):de=c[45];c[46]!==be||c[47]!==P||c[48]!==E||c[49]!==ne||c[50]!==X||c[51]!==te||c[52]!==Z||c[53]!==se||c[54]!==D||c[55]!==V||c[56]!==I||c[57]!==ce?(ue="every"===I?(0,b.jsxs)(n.View,{style:M.section,children:[(0,b.jsxs)(n.View,{style:M.intervalRow,children:[(0,b.jsx)(u.AdaptiveTextInput,{testID:"cadence-interval-value",accessibilityLabel:"Interval value",initialValue:V,resetKey:`cadence-interval-${E}`,value:V,onChangeText:X,keyboardType:"number-pad",style:M.intervalInput}),(0,b.jsx)(p.SegmentedControl,{size:"sm",value:D,onValueChange:Z,options:h,testID:"cadence-interval-unit"})]}),(0,b.jsx)(t.Text,{style:M.preview,children:se})]}):(0,b.jsxs)(n.View,{style:M.section,children:[(0,b.jsx)(n.View,{style:M.presetRow,children:v.map(n=>(0,b.jsx)(z,{label:n.label,expression:n.expression,isSelected:ce===n.expression,onSelect:te},n.expression))}),(0,b.jsx)(u.AdaptiveTextInput,{testID:"cadence-cron-expression",accessibilityLabel:"Cron expression",initialValue:P,resetKey:`cadence-cron-${E}`,value:P,onChangeText:ne,placeholder:"0 9 * * *",autoCapitalize:"none",autoCorrect:!1,spellCheck:!1,style:M.cronInput}),be,(0,b.jsx)(t.Text,{style:M.hint,children:"Times are in UTC"})]}),c[46]=be,c[47]=P,c[48]=E,c[49]=ne,c[50]=X,c[51]=te,c[52]=Z,c[53]=se,c[54]=D,c[55]=V,c[56]=I,c[57]=ce,c[58]=ue):ue=c[58];c[59]!==w?(pe=w?(0,b.jsx)(t.Text,{style:M.error,children:w}):null,c[59]=w,c[60]=pe):pe=c[60];c[61]!==de||c[62]!==ue||c[63]!==pe?(ye=(0,b.jsxs)(n.View,{style:M.container,children:[de,ue,pe]}),c[61]=de,c[62]=ue,c[63]=pe,c[64]=ye):ye=c[64];return ye};var n=r(d[0]),t=r(d[1]),o=r(d[2]),s=r(d[3]),l=r(d[4]);r(d[5]),r(d[6]),r(d[7]);var c=r(d[8]),u=r(d[9]),p=r(d[10]),y=r(d[11]),b=r(d[12]);const v=[{label:"Every hour",expression:"0 * * * *"},{label:"Daily 9:00",expression:"0 9 * * *"},{label:"Weekdays 9:00",expression:"0 9 * * 1-5"},{label:"Mondays 9:00",expression:"0 9 * * 1"}],x=[{value:"every",label:"Interval"},{value:"cron",label:"Cron"}],h=[{value:"minutes",label:"Minutes"},{value:"hours",label:"Hours"},{value:"days",label:"Days"}],f=(0,y.partsToEveryMs)(1,"hours"),_="0 9 * * *",S={minutes:"minute",hours:"hour",days:"day"};function C(n,t){const o=S[t];return 1===n?`Runs every ${o}`:`Runs every ${n} ${o}s`}function j(n){return n+1}function z(n){const l=(0,s.c)(17),{label:c,expression:u,isSelected:p,onSelect:y}=n;let v;l[0]!==u||l[1]!==y?(v=()=>{y(u)},l[0]=u,l[1]=y,l[2]=v):v=l[2];const x=v;let h;l[3]!==p?(h=n=>{const{hovered:t,pressed:o}=n;return[M.chip,p&&M.chipSelected,!p&&(Boolean(t)||o)&&M.chipHover]},l[3]=p,l[4]=h):h=l[4];const f=h,_=p&&M.chipLabelSelected;let S;l[5]!==_?(S=[M.chipLabel,_],l[5]=_,l[6]=S):S=l[6];const C=S;let j;l[7]!==p?(j={selected:p},l[7]=p,l[8]=j):j=l[8];const z=j;let T,w;return l[9]!==c||l[10]!==C?(T=(0,b.jsx)(t.Text,{style:C,numberOfLines:1,children:c}),l[9]=c,l[10]=C,l[11]=T):T=l[11],l[12]!==z||l[13]!==f||l[14]!==x||l[15]!==T?(w=(0,b.jsx)(o.Pressable,{accessibilityRole:"button",accessibilityState:z,onPress:x,style:f,children:T}),l[12]=z,l[13]=f,l[14]=x,l[15]=T,l[16]=w):w=l[16],w}const M=c.StyleSheet.create(n=>({container:{gap:n.spacing[3],uni__dependencies:[0]},section:{gap:n.spacing[3],uni__dependencies:[0]},intervalRow:{flexDirection:"row",alignItems:"center",gap:n.spacing[3],uni__dependencies:[0]},intervalInput:{width:88,minHeight:44,backgroundColor:n.colors.surface2,borderRadius:n.borderRadius.lg,paddingHorizontal:n.spacing[4],paddingVertical:n.spacing[3],borderWidth:1,borderColor:n.colors.border,fontSize:n.fontSize.base,uni__dependencies:[0]},modeControl:{alignSelf:"flex-start"},presetRow:{flexDirection:"row",flexWrap:"wrap",gap:n.spacing[2],uni__dependencies:[0]},chip:{minHeight:32,alignItems:"center",justifyContent:"center",paddingHorizontal:n.spacing[3],paddingVertical:n.spacing[2],borderRadius:n.borderRadius.lg,borderWidth:1,borderColor:n.colors.border,backgroundColor:n.colors.surface2,uni__dependencies:[0]},chipHover:{backgroundColor:n.colors.surface3,uni__dependencies:[0]},chipSelected:{backgroundColor:n.colors.surface3,borderColor:n.colors.borderAccent,uni__dependencies:[0]},chipLabel:{fontSize:n.fontSize.xs,fontWeight:n.fontWeight.medium,color:n.colors.foregroundMuted,uni__dependencies:[0]},chipLabelSelected:{color:n.colors.foreground,uni__dependencies:[0]},cronInput:{minHeight:44,backgroundColor:n.colors.surface2,borderRadius:n.borderRadius.lg,paddingHorizontal:n.spacing[4],paddingVertical:n.spacing[3],borderWidth:1,borderColor:n.colors.border,fontSize:n.fontSize.sm,fontFamily:n.fontFamily.mono,uni__dependencies:[0]},preview:{fontSize:n.fontSize.xs,color:n.colors.foregroundMuted,uni__dependencies:[0]},hint:{fontSize:n.fontSize.xs,color:n.colors.foregroundMuted,uni__dependencies:[0]},error:{fontSize:n.fontSize.xs,color:n.colors.palette.red[300],uni__dependencies:[0]}}))},4707,[348,711,1572,349,36,1308,234,146,56,3466,4430,4708,279]);
|
|
16467
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.isNewAgentSchedule=function(n){return"new-agent"===n.target.type},e.resolveScheduleTitle=function(n){const t=n.name?.trim();if(t)return t;if("new-agent"===n.target.type){const t=n.target.config.title?.trim();if(t)return t}return n.prompt.split("\n").map(n=>n.trim()).find(n=>n.length>0)||"Untitled schedule"},e.everyMsToParts=c,e.partsToEveryMs=function(n,t){return(Number.isFinite(n)?Math.max(1,Math.round(n)):1)*o[t]},e.formatCadence=function(n){if("every"===n.type)return h(n.everyMs);return v(n.expression)??n.expression},e.describeCron=v,e.validateCron=$,e.formatNextRun=function(n){if(!n)return"";const o=new Date(n).getTime();if(Number.isNaN(o))return"";const f=o-Date.now();if(f<=0)return"soon";if(f<t)return"soon";if(f<u)return`in ${Math.round(f/t)}m`;if(f<s)return`in ${Math.round(f/u)}h`;return`in ${Math.round(f/s)}d`};var n=r(d[0]);const t=6e4,u=36e5,s=864e5,o={minutes:t,hours:u,days:s},f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function l(n,t){return 1===n?`1 ${t}`:`${n} ${t}s`}function c(n){return!Number.isFinite(n)||n<=0?{value:1,unit:"hours"}:n%s===0?{value:n/s,unit:"days"}:n%u===0?{value:n/u,unit:"hours"}:{value:Math.max(1,Math.round(n/t)),unit:"minutes"}}const y={minutes:"minute",hours:"hour",days:"day"};function h(n){const{value:t,unit:u}=c(n);return`Every ${l(t,y[u])}`}function v(n){const t=n.trim();if(null!==$(t))return null;const[u,s,o,l,c]=t.split(/\s+/),y=Number.parseInt(u,10);if(!/^\d+$/.test(u)||!("*"===l)||!("*"===o))return null;if("*"===s)return"*"!==c?null:0===y?"Every hour":`Every hour at :${p(y)}`;if(!/^\d+$/.test(s))return null;const h=`${p(Number.parseInt(s,10))}:${p(y)}`;if("*"===c)return`Daily at ${h} UTC`;if("1-5"===c)return`Weekdays at ${h} UTC`;if("0,6"===c||"6,0"===c)return`Weekends at ${h} UTC`;if(/^\d$/.test(c)){const n=f[Number.parseInt(c,10)];if(n)return`${n}s at ${h} UTC`}return null}function $(t){const u=t.trim();if(!u)return"Enter a cron expression";const s=(0,n.validateCronExpression)(u);return s?.replace(/^Invalid cron /,"Invalid ")??null}function p(n){return n<10?`0${n}`:String(n)}},4708,[4709]);
|
|
16468
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.parseCronExpression=c,e.validateCronExpression=function(n){try{return c(n),null}catch(n){return n instanceof Error?n.message:"Invalid cron expression"}};const n=[{min:0,max:59,name:"minute"},{min:0,max:23,name:"hour"},{min:1,max:31,name:"day-of-month"},{min:1,max:12,name:"month"},{min:0,max:6,name:"day-of-week"}];function t(n,t,o){const s=[];for(let c=n;c<=t;c+=o)s.push(c);return s}function o(n,t){const o=n.split("/");if(o.length>2)throw new Error(`Invalid cron ${t.name} step`);const[s,c]=o,f=c?.trim(),u=void 0===f?1:Number.parseInt(f,10);if(!Number.isInteger(u)||u<=0||void 0!==f&&String(u)!==f)throw new Error(`Invalid cron ${t.name} step`);return{base:s,step:u}}function s(n,s){const c=n.trim();if(!c)throw new Error(`Invalid cron ${s.name} field`);const f=new Set;for(const n of c.split(",")){const c=n.trim();if(!c)throw new Error(`Invalid cron ${s.name} field`);const{base:u,step:l}=o(c,s);if("*"===u){for(const n of t(s.min,s.max,l))f.add(n);continue}const h=u.match(/^(\d+)-(\d+)$/);if(h){const n=Number.parseInt(h[1],10),o=Number.parseInt(h[2],10);if(n>o||n<s.min||o>s.max)throw new Error(`Invalid cron ${s.name} range`);for(const s of t(n,o,l))f.add(s);continue}if(!/^\d+$/.test(u))throw new Error(`Invalid cron ${s.name} value`);const p=Number.parseInt(u,10);if(!Number.isInteger(p)||p<s.min||p>s.max)throw new Error(`Invalid cron ${s.name} value`);f.add(p)}return{matches:n=>f.has(n)}}function c(t){const o=t.trim().split(/\s+/);if(5!==o.length)throw new Error("Cron expressions must have 5 fields");return{minute:s(o[0],n[0]),hour:s(o[1],n[1]),dayOfMonth:s(o[2],n[2]),month:s(o[3],n[3]),dayOfWeek:s(o[4],n[4])}}},4709,[]);
|
|
16469
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useScheduleMutations=function(u){const w=(0,n.c)(84),{serverId:f}=u,S=(0,t.useQueryClient)(),{t:v}=(0,s.useTranslation)();let Q;w[0]!==S?(Q=()=>{S.invalidateQueries({queryKey:o.schedulesQueryBaseKey})},w[0]=S,w[1]=Q):Q=w[1];const K=Q;let p,M;w[2]!==f||w[3]!==v?(p=async n=>{const t=c(f,v("common.errors.daemonClientUnavailable")),s=await t.scheduleCreate(n);if(s.error)throw new Error(s.error)},w[2]=f,w[3]=v,w[4]=p):p=w[4];w[5]!==K||w[6]!==p?(M={mutationFn:p,onSettled:K},w[5]=K,w[6]=p,w[7]=M):M=w[7];const E=(0,t.useMutation)(M);let b,C;w[8]!==f||w[9]!==v?(b=async n=>{const t=c(f,v("common.errors.daemonClientUnavailable")),s=await t.scheduleUpdate(n);if(s.error)throw new Error(s.error)},w[8]=f,w[9]=v,w[10]=b):b=w[10];w[11]!==K||w[12]!==b?(C={mutationFn:b,onSettled:K},w[11]=K,w[12]=b,w[13]=C):C=w[13];const U=(0,t.useMutation)(C);let A,q,B,D;w[14]!==f||w[15]!==v?(A=async n=>{const t=c(f,v("common.errors.daemonClientUnavailable")),s=await t.schedulePause({id:n});if(s.error)throw new Error(s.error)},w[14]=f,w[15]=v,w[16]=A):A=w[16];w[17]!==S||w[18]!==f?(q=async n=>{await S.cancelQueries({queryKey:o.schedulesQueryBaseKey});const t=l(S);return h(S,f,n,"paused"),t},w[17]=S,w[18]=f,w[19]=q):q=w[19];w[20]!==S?(B=(n,t,s)=>{s&&y(S,s)},w[20]=S,w[21]=B):B=w[21];w[22]!==K||w[23]!==A||w[24]!==q||w[25]!==B?(D={mutationFn:A,onMutate:q,onError:B,onSettled:K},w[22]=K,w[23]=A,w[24]=q,w[25]=B,w[26]=D):D=w[26];const F=(0,t.useMutation)(D);let O,I,R,_;w[27]!==f||w[28]!==v?(O=async n=>{const t=c(f,v("common.errors.daemonClientUnavailable")),s=await t.scheduleResume({id:n});if(s.error)throw new Error(s.error)},w[27]=f,w[28]=v,w[29]=O):O=w[29];w[30]!==S||w[31]!==f?(I=async n=>{await S.cancelQueries({queryKey:o.schedulesQueryBaseKey});const t=l(S);return h(S,f,n,"active"),t},w[30]=S,w[31]=f,w[32]=I):I=w[32];w[33]!==S?(R=(n,t,s)=>{s&&y(S,s)},w[33]=S,w[34]=R):R=w[34];w[35]!==K||w[36]!==O||w[37]!==I||w[38]!==R?(_={mutationFn:O,onMutate:I,onError:R,onSettled:K},w[35]=K,w[36]=O,w[37]=I,w[38]=R,w[39]=_):_=w[39];const j=(0,t.useMutation)(_);let N,T,k,x;w[40]!==f||w[41]!==v?(N=async n=>{const t=c(f,v("common.errors.daemonClientUnavailable")),s=await t.scheduleDelete({id:n});if(s.error)throw new Error(s.error)},w[40]=f,w[41]=v,w[42]=N):N=w[42];w[43]!==S||w[44]!==f?(T=async n=>{await S.cancelQueries({queryKey:o.schedulesQueryBaseKey});const t=l(S);return P(S,f,n),t},w[43]=S,w[44]=f,w[45]=T):T=w[45];w[46]!==S?(k=(n,t,s)=>{s&&y(S,s)},w[46]=S,w[47]=k):k=w[47];w[48]!==K||w[49]!==N||w[50]!==T||w[51]!==k?(x={mutationFn:N,onMutate:T,onError:k,onSettled:K},w[48]=K,w[49]=N,w[50]=T,w[51]=k,w[52]=x):x=w[52];const z=(0,t.useMutation)(x);let G,H;w[53]!==f||w[54]!==v?(G=async n=>{const t=c(f,v("common.errors.daemonClientUnavailable")),s=await t.scheduleRunOnce({id:n});if(s.error)throw new Error(s.error)},w[53]=f,w[54]=v,w[55]=G):G=w[55];w[56]!==K||w[57]!==G?(H={mutationFn:G,onSettled:K},w[56]=K,w[57]=G,w[58]=H):H=w[58];const J=(0,t.useMutation)(H);let L;w[59]!==E?(L=async n=>{await E.mutateAsync(n)},w[59]=E,w[60]=L):L=w[60];const V=L;let W;w[61]!==U?(W=async n=>{await U.mutateAsync(n)},w[61]=U,w[62]=W):W=w[62];const X=W;let Y;w[63]!==F?(Y=async n=>{await F.mutateAsync(n)},w[63]=F,w[64]=Y):Y=w[64];const Z=Y;let $;w[65]!==j?($=async n=>{await j.mutateAsync(n)},w[65]=j,w[66]=$):$=w[66];const ee=$;let ne;w[67]!==z?(ne=async n=>{await z.mutateAsync(n)},w[67]=z,w[68]=ne):ne=w[68];const te=ne;let se;w[69]!==J?(se=async n=>{await J.mutateAsync(n)},w[69]=J,w[70]=se):se=w[70];const re=se;let ae;w[71]!==E.isPending||w[72]!==V||w[73]!==z.isPending||w[74]!==te||w[75]!==F.isPending||w[76]!==Z||w[77]!==j.isPending||w[78]!==ee||w[79]!==J.isPending||w[80]!==re||w[81]!==U.isPending||w[82]!==X?(ae={createSchedule:V,updateSchedule:X,pauseSchedule:Z,resumeSchedule:ee,deleteSchedule:te,runScheduleNow:re,isCreating:E.isPending,isUpdating:U.isPending,isPausing:F.isPending,isResuming:j.isPending,isDeleting:z.isPending,isRunningNow:J.isPending},w[71]=E.isPending,w[72]=V,w[73]=z.isPending,w[74]=te,w[75]=F.isPending,w[76]=Z,w[77]=j.isPending,w[78]=ee,w[79]=J.isPending,w[80]=re,w[81]=U.isPending,w[82]=X,w[83]=ae):ae=w[83];return ae};var n=r(d[0]);r(d[1]);var t=r(d[2]),s=r(d[3]),o=r(d[4]),u=r(d[5]);function c(n,t){const s=u.useSessionStore.getState().sessions[n]?.client??null;if(!s)throw new Error(t);return s}function l(n){return{previous:n.getQueriesData({queryKey:o.schedulesQueryBaseKey})}}function y(n,t){for(const[s,o]of t.previous)n.setQueryData(s,o)}function w(n,t){n.setQueriesData({queryKey:o.schedulesQueryBaseKey},n=>n?Object.assign({},n,{schedules:t(n.schedules)}):n)}function h(n,t,s,o){const u="paused"===o?(new Date).toISOString():null;w(n,n=>n.map(n=>n.serverId===t&&n.id===s?Object.assign({},n,{status:o,pausedAt:u}):n))}function P(n,t,s){w(n,n=>n.filter(n=>!(n.serverId===t&&n.id===s)))}},4710,[349,36,916,1573,4711,3414]);
|
|
16470
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"schedulesQueryBaseKey",{enumerable:!0,get:function(){return u}}),e.schedulesQueryKey=l,e.useSchedules=function(){const u=(0,t.c)(28),y=(0,n.useHosts)();let E;u[0]===Symbol.for("react.memo_cache_sentinel")?(E=(0,n.getHostRuntimeStore)(),u[0]=E):E=u[0];const b=E;let v,_,S;u[1]===Symbol.for("react.memo_cache_sentinel")?(v=t=>b.subscribeAll(t),_=()=>b.getVersion(),S=()=>b.getVersion(),u[1]=v,u[2]=_,u[3]=S):(v=u[1],_=u[2],S=u[3]);const p=(0,s.useSyncExternalStore)(v,_,S);let R;u[4]!==y?(R=y.map(f),u[4]=y,u[5]=R):R=u[5];const I=R;let j,K,P;u[6]!==I||u[7]!==p?(j=[...l(I.map(h)),p],u[6]=I,u[7]=p,u[8]=j):j=u[8];u[9]!==I?(K=()=>(0,c.fetchAggregatedSchedules)({hosts:I,runtime:b}),u[9]=I,u[10]=K):K=u[10];u[11]!==j||u[12]!==K?(P={queryKey:j,queryFn:K,staleTime:5e3,placeholderData:o.keepPreviousData},u[11]=j,u[12]=K,u[13]=P):P=u[13];const Q=(0,o.useQuery)(P);let q,A;u[14]!==Q.data?.schedules?(q=Q.data?.schedules??[],u[14]=Q.data?.schedules,u[15]=q):q=u[15];u[16]!==Q.data?.hostErrors?(A=Q.data?.hostErrors??[],u[16]=Q.data?.hostErrors,u[17]=A):A=u[17];const D=Q.isLoading&&void 0===Q.data;let H,L;u[18]!==Q?(H=()=>{Q.refetch()},u[18]=Q,u[19]=H):H=u[19];u[20]!==Q.error||u[21]!==Q.isError||u[22]!==Q.isRefetching||u[23]!==D||u[24]!==H||u[25]!==q||u[26]!==A?(L={schedules:q,hostErrors:A,isInitialLoad:D,isError:Q.isError,error:Q.error,refetch:H,isRefetching:Q.isRefetching},u[20]=Q.error,u[21]=Q.isError,u[22]=Q.isRefetching,u[23]=D,u[24]=H,u[25]=q,u[26]=A,u[27]=L):L=u[27];return L};var t=r(d[0]),s=r(d[1]),o=r(d[2]),n=r(d[3]),c=r(d[4]);const u=["schedules"];function l(t){return[...u,[...t].sort().join("|")]}function h(t){return t.serverId}function f(t){return{serverId:t.serverId,serverName:t.label}}},4711,[349,36,916,3271,4712]);
|
|
16471
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"ALL_SCHEDULE_HOSTS_FAILED_MESSAGE",{enumerable:!0,get:function(){return t}}),e.fetchAggregatedSchedules=async function(n){const o=[],c=[];let u=0;if(await Promise.all(n.hosts.map(async t=>{const h=n.runtime.getSnapshot(t.serverId),l="online"===h?.connectionStatus,v=n.runtime.getClient(t.serverId);if(v&&l){u+=1;try{const s=await v.scheduleList();if(s.error)throw new Error(s.error);for(const n of s.schedules)o.push(Object.assign({},n,{serverId:t.serverId,serverName:t.serverName}))}catch(n){c.push({serverId:t.serverId,serverName:t.serverName,message:(0,s.toErrorMessage)(n)})}}})),u>0&&0===o.length&&c.length===u)throw new Error(t);return{schedules:o,hostErrors:c}};var s=r(d[0]);const t="No connected hosts could load schedules"},4712,[3948]);
|
|
16472
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"PROJECT_OPTION_PREFIX",{enumerable:!0,get:function(){return o}}),e.buildProjectOptionId=n,e.buildScheduleProjectTargets=function(t){const o=[];for(const c of t)for(const t of c.hosts){const s=t.repoRoot.trim();t.isOnline&&s&&o.push({optionId:n(t.serverId,c.projectKey),serverId:t.serverId,serverName:t.serverName,projectKey:c.projectKey,projectName:c.projectName,cwd:s})}return o},e.buildProjectNameByCwd=function(t){const o=new Map;for(const n of t)o.set(c(n.serverId,n.cwd),n.projectName);return o},e.describeScheduleCwd=function(o){return o.projectNameByCwd.get(c(o.serverId,o.cwd))??(0,t.shortenPath)(o.cwd)};var t=r(d[0]);const o="project:";function n(t,n){return`${o}${t}:${n}`}function c(t,o){return`${t}:${o.trim()}`}},4713,[3511]);
|
|
16473
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.SchedulesTable=function(l){const n=(0,t.c)(7),{rows:c,onEditSchedule:u}=l;let h,b;if(n[0]!==u||n[1]!==c){let s;n[3]!==u?(s=(s,t)=>(0,S.jsx)(w,{row:s,isFirst:0===t,onEditSchedule:u},`${s.schedule.serverId}:${s.schedule.id}`),n[3]=u,n[4]=s):s=n[4],h=c.map(s),n[0]=u,n[1]=c,n[2]=h}else h=n[2];n[5]!==h?(b=(0,S.jsx)(s.View,{style:p.listContent,testID:"schedules-table",children:(0,S.jsx)(s.View,{style:o.settingsStyles.card,children:h})}),n[5]=h,n[6]=b):b=n[6];return b};var s=r(d[0]),t=r(d[1]),l=r(d[2]);r(d[3]);var n=r(d[4]),c=r(d[5]),u=r(d[6]),o=r(d[7]),h=r(d[8]),b=r(d[9]),S=r(d[10]);const v={};function w({row:s,isFirst:t,onEditSchedule:n}){const{schedule:o}=s,{id:w,serverId:p}=o,y=(0,u.useScheduleMutations)({serverId:p}),[f,C]=(0,l.useState)(v),j=(0,l.useCallback)(async(s,t)=>{C(t=>Object.assign({},t,{[s]:!0}));try{await t()}catch{}finally{C(t=>{const l=Object.assign({},t);return delete l[s],l})}},[]),k=(0,l.useCallback)(()=>{n(o)},[n,o]),D=(0,l.useCallback)(()=>{j("pause",()=>y.pauseSchedule(w))},[j,y,w]),_=(0,l.useCallback)(()=>{j("resume",()=>y.resumeSchedule(w))},[j,y,w]),x=(0,l.useCallback)(()=>{j("runNow",()=>y.runScheduleNow(w))},[j,y,w]),N=(0,l.useCallback)(()=>{(async()=>{await(0,h.confirmDialog)({title:"Delete schedule",message:`Delete "${(0,b.resolveScheduleTitle)(o)}"? This cannot be undone.`,confirmLabel:"Delete",destructive:!0})&&await j("delete",()=>y.deleteSchedule(w))})()},[j,y,w,o]);return(0,S.jsx)(c.ScheduleRow,{schedule:o,targetLabel:s.targetLabel,provider:s.provider,state:s.state,serverName:s.serverName,singleHost:s.singleHost,isFirst:t,pending:f,onEdit:k,onPause:D,onResume:_,onRunNow:x,onDelete:N})}const p=n.StyleSheet.create(s=>({listContent:{paddingHorizontal:{xs:s.spacing[3],md:s.spacing[6]},uni__dependencies:[0]}}))},4714,[348,349,36,146,56,4715,4710,3907,3678,4708,279]);
|
|
16474
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.ScheduleRow=function(l){const u=(0,o.c)(52),{schedule:p,targetLabel:b,provider:w,state:j,serverName:_,singleHost:D,pending:S,isFirst:P,onEdit:R,onPause:I,onResume:T,onRunNow:M,onDelete:L}=l,C=(0,x.useIsCompactFormFactor)(),[k,A]=(0,c.useState)(!1);let E;u[0]===Symbol.for("react.memo_cache_sentinel")?(E=()=>A(!0),u[0]=E):E=u[0];const H=E;let U;u[1]===Symbol.for("react.memo_cache_sentinel")?(U=()=>A(!1),u[1]=U):U=u[1];const V=U;let O;u[2]!==p?(O=(0,v.resolveScheduleTitle)(p),u[2]=p,u[3]=O):O=u[3];const B=O;let W;u[4]!==j?(W=$(j),u[4]=j,u[5]=W):W=u[5];const q=W,J=D??!1;let K;u[6]!==p||u[7]!==_||u[8]!==j||u[9]!==J?(K=z(p,j,_,J),u[6]=p,u[7]=_,u[8]=j,u[9]=J,u[10]=K):K=u[10];const Q=K,X="active"===j||"paused"===j;let Y;u[11]!==C||u[12]!==P||u[13]!==k?(Y=n=>{const{pressed:t}=n;return[f.settingsStyles.row,G.row,!P&&f.settingsStyles.rowBorder,k&&!C&&G.rowHovered,t&&G.rowPressed]},u[11]=C,u[12]=P,u[13]=k,u[14]=Y):Y=u[14];const Z=Y,ee=`Edit schedule ${B}`,ne=`schedule-row-${p.id}`;let te,se,ie,re,oe,le,de,ae,ce,ue;u[15]!==w?(te=(0,y.jsx)(n.View,{style:G.leading,children:(0,y.jsx)(N,{provider:w})}),u[15]=w,u[16]=te):te=u[16];u[17]!==B?(se=(0,y.jsx)(t.Text,{style:f.settingsStyles.rowTitle,numberOfLines:1,children:B}),u[17]=B,u[18]=se):se=u[18];u[19]!==b?(ie=(0,y.jsx)(t.Text,{style:G.target,numberOfLines:1,children:b}),u[19]=b,u[20]=ie):ie=u[20];u[21]!==Q?(re=(0,y.jsx)(t.Text,{style:f.settingsStyles.rowHint,numberOfLines:1,children:Q}),u[21]=Q,u[22]=re):re=u[22];u[23]!==se||u[24]!==ie||u[25]!==re?(oe=(0,y.jsxs)(n.View,{style:G.textGroup,children:[se,ie,re]}),u[23]=se,u[24]=ie,u[25]=re,u[26]=oe):oe=u[26];u[27]!==te||u[28]!==oe?(le=(0,y.jsxs)(n.View,{style:G.main,children:[te,oe]}),u[27]=te,u[28]=oe,u[29]=le):le=u[29];u[30]!==q.label||u[31]!==q.variant?(de=(0,y.jsx)(h.StatusBadge,{label:q.label,variant:q.variant}),u[30]=q.label,u[31]=q.variant,u[32]=de):de=u[32];u[33]!==X||u[34]!==L||u[35]!==R||u[36]!==I||u[37]!==T||u[38]!==M||u[39]!==S||u[40]!==p?(ae=(0,y.jsx)(F,{schedule:p,canRun:X,pending:S,onEdit:R,onPause:I,onResume:T,onRunNow:M,onDelete:L}),u[33]=X,u[34]=L,u[35]=R,u[36]=I,u[37]=T,u[38]=M,u[39]=S,u[40]=p,u[41]=ae):ae=u[41];u[42]!==de||u[43]!==ae?(ce=(0,y.jsxs)(n.View,{style:G.trailing,children:[de,ae]}),u[42]=de,u[43]=ae,u[44]=ce):ce=u[44];u[45]!==R||u[46]!==Z||u[47]!==le||u[48]!==ce||u[49]!==ee||u[50]!==ne?(ue=(0,y.jsx)(n.View,{style:G.rowContainer,onPointerEnter:H,onPointerLeave:V,children:(0,y.jsxs)(s.Pressable,{style:Z,onPress:R,accessibilityRole:"button",accessibilityLabel:ee,testID:ne,children:[le,ce]})}),u[45]=R,u[46]=Z,u[47]=le,u[48]=ce,u[49]=ee,u[50]=ne,u[51]=ue):ue=u[51];return ue};var n=r(d[0]),t=r(d[1]),s=r(d[2]),o=r(d[3]),l=r(d[4]),c=r(d[5]);r(d[6]),r(d[7]),r(d[8]);var u=r(d[9]),p=r(d[10]),h=r(d[11]),b=r(d[12]),w=r(d[13]),x=r(d[14]),f=r(d[15]),v=r(d[16]),j=r(d[17]),y=r(d[18]);const _=(0,u.withUnistyles)(l.Pencil),D=(0,u.withUnistyles)(l.Pause),S=(0,u.withUnistyles)(l.Play),P=(0,u.withUnistyles)(l.RotateCw),R=(0,u.withUnistyles)(l.Trash2),I=(0,u.withUnistyles)(l.MoreVertical),T=n=>({color:n.colors.foregroundMuted}),M=n=>({color:n.colors.foreground}),L=14,C=16;function $(n){switch(n){case"active":return{label:"Active",variant:"success"};case"paused":return{label:"Paused",variant:"muted"};case"expired":return{label:"Expired",variant:"muted"};case"finished":return{label:"Finished",variant:"muted"};case"targetGone":return{label:"Target gone",variant:"error"}}}function z(n,t,s,o){const l=[(0,v.formatCadence)(n.cadence),`Created ${(0,j.formatTimeAgo)(new Date(n.createdAt))}`,n.lastRunAt?`Last run ${(0,j.formatTimeAgo)(new Date(n.lastRunAt))}`:"Never run"];if("active"===t){const t=(0,v.formatNextRun)(n.nextRunAt);t&&l.push(`Next run ${t}`)}return s&&!o&&l.unshift(s),l.join(" \xb7 ")}function N(n){const t=(0,o.c)(4),{provider:s}=n;if(!s)return null;let l;t[0]!==s?(l=(0,b.getProviderIcon)(s),t[0]=s,t[1]=l):l=t[1];const c=l;let u;return t[2]!==c?(u=(0,y.jsx)(c,{size:C,color:G.providerIcon.color}),t[2]=c,t[3]=u):u=t[3],u}const k=(0,y.jsx)(_,{size:L,uniProps:T}),A=(0,y.jsx)(D,{size:L,uniProps:T}),E=(0,y.jsx)(S,{size:L,uniProps:T}),H=(0,y.jsx)(P,{size:L,uniProps:T}),U=(0,y.jsx)(R,{size:L,uniProps:n=>({color:n.colors.destructive})});function V({hovered:n}){return(0,y.jsx)(I,{size:L,uniProps:n?M:T})}function F(n){const t=(0,o.c)(31),{schedule:s,canRun:l,pending:c,onEdit:u,onPause:h,onResume:b,onRunNow:x,onDelete:f}=n,v=`schedule-kebab-${s.id}`;let j;t[0]!==v?(j=(0,y.jsx)(p.DropdownMenuTrigger,{hitSlop:8,style:O,accessibilityRole:w.isNative?"button":void 0,accessibilityLabel:"Schedule actions",testID:v,children:V}),t[0]=v,t[1]=j):j=t[1];const _=`schedule-menu-edit-${s.id}`;let D,S;t[2]!==u||t[3]!==_?(D=(0,y.jsx)(p.DropdownMenuItem,{leading:k,onSelect:u,testID:_,children:"Edit schedule"}),t[2]=u,t[3]=_,t[4]=D):D=t[4],t[5]!==l||t[6]!==h||t[7]!==b||t[8]!==c?.pause||t[9]!==c?.resume||t[10]!==s.id||t[11]!==s.status?(S="paused"===s.status?(0,y.jsx)(p.DropdownMenuItem,{leading:E,disabled:!l,status:c?.resume?"pending":"idle",pendingLabel:"Resuming...",onSelect:b,testID:`schedule-menu-resume-${s.id}`,children:"Resume schedule"}):(0,y.jsx)(p.DropdownMenuItem,{leading:A,disabled:"completed"===s.status||!l,status:c?.pause?"pending":"idle",pendingLabel:"Pausing...",onSelect:h,testID:`schedule-menu-pause-${s.id}`,children:"Pause schedule"}),t[5]=l,t[6]=h,t[7]=b,t[8]=c?.pause,t[9]=c?.resume,t[10]=s.id,t[11]=s.status,t[12]=S):S=t[12];const P=!l,R=c?.runNow?"pending":"idle",I=`schedule-menu-run-${s.id}`;let T,M;t[13]!==x||t[14]!==P||t[15]!==R||t[16]!==I?(T=(0,y.jsx)(p.DropdownMenuItem,{leading:H,disabled:P,status:R,pendingLabel:"Starting...",onSelect:x,testID:I,children:"Run now"}),t[13]=x,t[14]=P,t[15]=R,t[16]=I,t[17]=T):T=t[17],t[18]===Symbol.for("react.memo_cache_sentinel")?(M=(0,y.jsx)(p.DropdownMenuSeparator,{}),t[18]=M):M=t[18];const L=c?.delete?"pending":"idle",C=`schedule-menu-delete-${s.id}`;let $,z,N;return t[19]!==f||t[20]!==L||t[21]!==C?($=(0,y.jsx)(p.DropdownMenuItem,{leading:U,destructive:!0,status:L,pendingLabel:"Deleting...",onSelect:f,testID:C,children:"Delete schedule"}),t[19]=f,t[20]=L,t[21]=C,t[22]=$):$=t[22],t[23]!==$||t[24]!==D||t[25]!==S||t[26]!==T?(z=(0,y.jsxs)(p.DropdownMenuContent,{align:"end",width:220,children:[D,S,T,M,$]}),t[23]=$,t[24]=D,t[25]=S,t[26]=T,t[27]=z):z=t[27],t[28]!==z||t[29]!==j?(N=(0,y.jsxs)(p.DropdownMenu,{children:[j,z]}),t[28]=z,t[29]=j,t[30]=N):N=t[30],N}function O({hovered:n=!1}){return[G.kebabTrigger,n&&G.kebabTriggerHovered]}const G=u.StyleSheet.create(n=>({providerIcon:{color:n.colors.foregroundMuted,uni__dependencies:[0]},rowContainer:{position:"relative"},row:{gap:n.spacing[3],uni__dependencies:[0]},rowHovered:{backgroundColor:n.colors.surface2,uni__dependencies:[0]},rowPressed:{backgroundColor:n.colors.surface3,uni__dependencies:[0]},main:{flex:1,minWidth:0,flexDirection:"row",alignItems:"center",gap:n.spacing[3],uni__dependencies:[0]},leading:{width:C,height:C,alignItems:"center",justifyContent:"center"},textGroup:{flex:1,minWidth:0},target:{marginTop:n.spacing[1],color:n.colors.foregroundMuted,fontSize:n.fontSize.sm,uni__dependencies:[0]},trailing:{flexDirection:"row",alignItems:"center",gap:n.spacing[2],uni__dependencies:[0]},kebabTrigger:{padding:n.spacing[1],borderRadius:n.borderRadius.base,uni__dependencies:[0]},kebabTriggerHovered:{backgroundColor:n.colors.surface2,uni__dependencies:[0]}}))},4715,[348,711,1572,349,1600,36,1308,234,146,56,3572,3617,3929,3407,3457,3907,4708,3510,279]);
|
|
16475
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.scheduleBucket=l,e.resolveSchedule=function(t){const n=o(t);return{state:n,bucket:l(n),target:s(t)}};var t=r(d[0]);function n(t,n){return`${t}:${n}`}function u(t,n){if(!t.expiresAt)return!1;const u=Date.parse(t.expiresAt);return Number.isFinite(u)&&u<=n}function c(t){const{schedule:u,serverId:c,agentsByKey:s,agentDataLoaded:o}=t;return!("agent"!==u.target.type||!o)&&!s.has(n(c,u.target.agentId))}function s(u){const{schedule:c,serverId:s,agentsByKey:o,projectNameByCwd:l}=u;if("agent"===c.target.type){const t=o.get(n(s,c.target.agentId));return t?{label:t.title?.trim()||"Untitled agent",provider:t.provider}:{label:"Agent unavailable",provider:null}}return{label:(0,t.describeScheduleCwd)({serverId:s,cwd:c.target.config.cwd,projectNameByCwd:l}),provider:c.target.config.provider}}function o(t){const{schedule:n,now:s}=t;return u(n,s)?"expired":c(t)?"targetGone":"completed"===n.status?"finished":"paused"===n.status?"paused":"active"}function l(t){return"active"===t||"paused"===t?"runnable":"ended"}},4716,[4713]);
|
|
16476
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return s}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),c=r(d[3]);function s(){const s=(0,t.c)(1);let u;return s[0]===Symbol.for("react.memo_cache_sentinel")?(u=(0,c.jsx)(n.HostRouteBootstrapBoundary,{children:(0,c.jsx)(o.SessionsScreen,{})}),s[0]=u):u=s[0],u}},4717,[349,4399,4718,279]);
|
|
16477
|
+
__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.SessionsScreen=function(){const t=(0,s.c)(2);if(!(0,a.useIsFocused)()){let s;return t[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,w.jsx)(n.View,{style:X.container}),t[0]=s):s=t[0],s}let o;t[1]===Symbol.for("react.memo_cache_sentinel")?(o=(0,w.jsx)(R,{}),t[1]=o):o=t[1];return o};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]);r(d[4]),r(d[5]);var a=r(d[6]),l=r(d[7]),c=r(d[8]),u=r(d[9]),f=r(d[10]),h=r(d[11]),p=r(d[12]),S=r(d[13]),y=r(d[14]),x=r(d[15]),_=r(d[16]),v=r(d[17]),T=r(d[18]),L=r(d[19]),C=r(d[20]),F=r(d[21]),M=r(d[22]),A=r(d[23]),I=r(d[24]),j=r(d[25]),O=r(d[26]),b=r(d[27]),w=r(d[28]);const B={needs_input:0,failed:0,running:0,attention:0,done:0};function R(){const t=(0,s.c)(86),{t:a}=(0,f.useTranslation)(),l=(0,L.useHosts)(),[c,u]=(0,o.useState)(_.ALL_HOSTS_OPTION_ID),S=c===_.ALL_HOSTS_OPTION_ID?null:c;let y;t[0]!==S?(y={serverId:S},t[0]=S,t[1]=y):y=t[1];const{agents:M,hasMore:I,isInitialLoad:R,isLoadingMore:Y,isError:ee,loadMore:te,refreshAll:ne}=(0,T.useAgentHistory)(y);let se,oe;t[2]!==l||t[3]!==c?(se=()=>{c===_.ALL_HOSTS_OPTION_ID||l.some(t=>t.serverId===c)||u(_.ALL_HOSTS_OPTION_ID)},oe=[l,c],t[2]=l,t[3]=c,t[4]=se,t[5]=oe):(se=t[4],oe=t[5]),(0,o.useEffect)(se,oe);const ie=(0,C.useSessionFilterStore)(J),re=(0,C.useSessionFilterStore)(G),ae=(0,C.useSessionFilterStore)(Q),le=(0,C.useSessionFilterStore)($),ce=(0,C.useSessionFilterStore)(Z),ue=(0,C.useSessionFilterStore)(U),de=(0,C.useSessionFilterStore)(q),ge=(0,C.useSessionFilterStore)(z),[fe,he]=(0,o.useState)(!1);let me;t[6]!==ne?(me=()=>{he(!0),ne().finally(()=>he(!1))},t[6]=ne,t[7]=me):me=t[7];const pe=me;let Se;t[8]!==M?(Se=[...M].filter(W).sort(E),t[8]=M,t[9]=Se):Se=t[9];const ye=Se;let xe;t[10]!==c||t[11]!==a?(xe=c===_.ALL_HOSTS_OPTION_ID?a("sessions.empty"):"No sessions for this host",t[10]=c,t[11]=a,t[12]=xe):xe=t[12];const _e=xe,ve=l.length>1,Te=ee&&0===ye.length;let Le;if(t[13]!==ye||t[14]!==ce){let n;t[16]!==ce?(n=t=>{return{agent:t,statusBucket:(0,A.deriveSidebarStateBucket)({status:t.status,pendingPermissionCount:t.pendingPermissionCount,requiresAttention:t.requiresAttention,attentionReason:t.attentionReason}),tags:(0,F.getAgentTags)(t),timeValue:(n=t,s=ce,("created"===s?n.createdAt:n.lastActivityAt)??null),provider:t.provider,origin:(0,O.deriveSessionOrigin)(t.labels),searchableText:`${t.title??""} ${t.cwd??""}`.toLowerCase()};var n,s},t[16]=ce,t[17]=n):n=t[17],Le=ye.map(n),t[13]=ye,t[14]=ce,t[15]=Le}else Le=t[15];const Ce=Le;let Fe;if(t[18]!==Ce){Fe=Object.assign({},B);for(const t of Ce)Fe[t.statusBucket]=Fe[t.statusBucket]+1;t[18]=Ce,t[19]=Fe}else Fe=t[19];const Me=Fe;let Ae;t[20]!==ye?(Ae=(0,F.distinctTagsWithCounts)(ye),t[20]=ye,t[21]=Ae):Ae=t[21];const Ie=Ae;let je;t[22]!==ye?(je=ye.reduce(D,0),t[22]=ye,t[23]=je):je=t[23];const Oe=je;let be;t[24]!==le?(be=le.trim().toLowerCase(),t[24]=le,t[25]=be):be=t[25];const we=be,Be=ie.length>0||re.length>0||ae||null!==ue||de.length>0||ge.length>0||we.length>0;let Re;if(t[26]!==ae||t[27]!==Ce||t[28]!==Be||t[29]!==we||t[30]!==ge||t[31]!==de||t[32]!==ye||t[33]!==ie||t[34]!==re||t[35]!==ue){e:{const n=new Date,s=Object.fromEntries(j.SESSION_TIME_WINDOWS.map(N)),o={root:0,delegated:0},a=new Map;for(const t of Ce){for(const o of j.SESSION_TIME_WINDOWS)(0,j.isWithinSessionTimeWindow)(t.timeValue,o,n)&&(s[o]=s[o]+1);o[t.origin]=o[t.origin]+1,a.set(t.provider,(a.get(t.provider)??0)+1)}const l=[...a.entries()].map(V).sort(H);let c;t[37]!==o||t[38]!==l||t[39]!==s?(c={timeCounts:s,providerCounts:l,originCounts:o},t[37]=o,t[38]=l,t[39]=s,t[40]=c):c=t[40];const u=c;if(!Be){let n;t[41]!==u||t[42]!==ye?(n={metadataFacets:u,filteredAgents:ye},t[41]=u,t[42]=ye,t[43]=n):n=t[43],Re=n;break e}const f={statusFilters:ie,tagFilters:re,archivedOnly:ae,timeWindow:ue,providerFilters:de,originFilters:ge,textQuery:we},h=Ce.filter(t=>(0,b.sessionPassesListFilter)({statusBucket:t.statusBucket,tags:t.tags,isArchived:Boolean(t.agent.archivedAt),timeValue:t.timeValue,provider:t.provider,origin:t.origin,searchableText:t.searchableText},f,n)).map(P);let p;t[44]!==u||t[45]!==h?(p={metadataFacets:u,filteredAgents:h},t[44]=u,t[45]=h,t[46]=p):p=t[46],Re=p}t[26]=ae,t[27]=Ce,t[28]=Be,t[29]=we,t[30]=ge,t[31]=de,t[32]=ye,t[33]=ie,t[34]=re,t[35]=ue,t[36]=Re}else Re=t[36];const{metadataFacets:ke,filteredAgents:Pe}=Re,He=k;let Ve;t[47]!==I||t[48]!==Y||t[49]!==te||t[50]!==a?(Ve=I?(0,w.jsx)(n.View,{style:X.footer,children:(0,w.jsx)(p.Button,{variant:"ghost",onPress:te,disabled:Y,children:Y?"Loading...":a("sessions.actions.loadMore")})}):null,t[47]=I,t[48]=Y,t[49]=te,t[50]=a,t[51]=Ve):Ve=t[51];const Ne=Ve,De=ye.length>0||Be,Ee=!R&&ye.length>0&&0===Pe.length;let We,ze,qe,Ue,Ze,$e;return t[52]!==a?(We=a("sessions.title"),t[52]=a,t[53]=We):We=t[53],t[54]!==We?(ze=(0,w.jsx)(h.MenuHeader,{title:We}),t[54]=We,t[55]=ze):ze=t[55],t[56]!==l||t[57]!==c||t[58]!==ve?(qe=ve?(0,w.jsx)(n.View,{style:X.filterContainer,children:(0,w.jsx)(x.HostFilter,{hosts:l,selectedHost:c,onSelectHost:u,triggerTestID:"sessions-host-filter-trigger"})}):null,t[56]=l,t[57]=c,t[58]=ve,t[59]=qe):qe=t[59],t[60]!==Oe||t[61]!==Ie||t[62]!==Pe||t[63]!==ke||t[64]!==De||t[65]!==ye.length||t[66]!==Me?(Ue=De?(0,w.jsx)(v.SessionFilterBar,{statusCounts:Me,totalAgents:ye.length,visibleCount:Pe.length,availableTags:Ie,archivedCount:Oe,metadataFacets:ke}):null,t[60]=Oe,t[61]=Ie,t[62]=Pe,t[63]=ke,t[64]=De,t[65]=ye.length,t[66]=Me,t[67]=Ue):Ue=t[67],t[68]!==_e||t[69]!==Pe||t[70]!==pe||t[71]!==I||t[72]!==Ee||t[73]!==R||t[74]!==Y||t[75]!==fe||t[76]!==Ne||t[77]!==te||t[78]!==Te||t[79]!==ye.length?(Ze=(0,w.jsx)(K,{isInitialLoad:R,showLoadError:Te,baseCount:ye.length,emptyText:_e,hasZeroMatches:Ee,hasMore:I,isLoadingMore:Y,filteredAgents:Pe,isManualRefresh:fe,listFooterComponent:Ne,onRefresh:pe,onBack:He,onLoadMore:te}),t[68]=_e,t[69]=Pe,t[70]=pe,t[71]=I,t[72]=Ee,t[73]=R,t[74]=Y,t[75]=fe,t[76]=Ne,t[77]=te,t[78]=Te,t[79]=ye.length,t[80]=Ze):Ze=t[80],t[81]!==ze||t[82]!==qe||t[83]!==Ue||t[84]!==Ze?($e=(0,w.jsxs)(n.View,{style:X.container,children:[ze,qe,Ue,Ze]}),t[81]=ze,t[82]=qe,t[83]=Ue,t[84]=Ze,t[85]=$e):$e=t[85],$e}function k(){l.router.navigate((0,M.buildOpenProjectRoute)())}function P(t){return t.agent}function H(t,n){return n.count-t.count||t.provider.localeCompare(n.provider)}function V(t){const[n,s]=t;return{provider:n,count:s}}function N(t){return[t,0]}function D(t,n){return n.archivedAt?t+1:t}function E(t,n){return n.lastActivityAt.getTime()-t.lastActivityAt.getTime()}function W(t){return!(0,I.isAgentTitledSession)(t.title)}function z(t){return t.originFilters}function q(t){return t.providerFilters}function U(t){return t.timeWindow}function Z(t){return t.timeField}function $(t){return t.textFilter}function Q(t){return t.archivedFilter}function G(t){return t.tagFilters}function J(t){return t.statusFilters}function K(o){const a=(0,s.c)(24),{theme:l}=(0,c.useUnistyles)(),{isInitialLoad:f,showLoadError:h,baseCount:x,filteredAgents:_}=o;if(f){let t;return a[0]!==l.colors.foregroundMuted?(t=(0,w.jsx)(n.View,{style:X.loadingContainer,children:(0,w.jsx)(S.LoadingSpinner,{size:"large",color:l.colors.foregroundMuted})}),a[0]=l.colors.foregroundMuted,a[1]=t):t=a[1],t}if(h){let s,l;return a[2]===Symbol.for("react.memo_cache_sentinel")?(s=(0,w.jsx)(t.Text,{style:X.emptyText,children:"Unable to load sessions"}),a[2]=s):s=a[2],a[3]!==o.onRefresh?(l=(0,w.jsxs)(n.View,{style:X.emptyContainer,children:[s,(0,w.jsx)(p.Button,{variant:"ghost",onPress:o.onRefresh,children:"Try again"})]}),a[3]=o.onRefresh,a[4]=l):l=a[4],l}if(0===x){let s,l,c;return a[5]!==o.emptyText?(s=(0,w.jsx)(t.Text,{style:X.emptyText,children:o.emptyText}),a[5]=o.emptyText,a[6]=s):s=a[6],a[7]!==o.onBack?(l=(0,w.jsx)(p.Button,{variant:"ghost",leftIcon:u.ChevronLeft,onPress:o.onBack,children:"Back"}),a[7]=o.onBack,a[8]=l):l=a[8],a[9]!==s||a[10]!==l?(c=(0,w.jsxs)(n.View,{style:X.emptyContainer,children:[s,l]}),a[9]=s,a[10]=l,a[11]=c):c=a[11],c}if(o.hasZeroMatches){let s,l,c;return a[12]===Symbol.for("react.memo_cache_sentinel")?(s=(0,w.jsx)(t.Text,{style:X.emptyText,children:"No sessions match your filters"}),a[12]=s):s=a[12],a[13]!==o.hasMore||a[14]!==o.isLoadingMore||a[15]!==o.onLoadMore?(l=o.hasMore?(0,w.jsx)(p.Button,{variant:"ghost",onPress:o.onLoadMore,disabled:o.isLoadingMore,children:o.isLoadingMore?"Loading...":"Load more history"}):null,a[13]=o.hasMore,a[14]=o.isLoadingMore,a[15]=o.onLoadMore,a[16]=l):l=a[16],a[17]!==l?(c=(0,w.jsxs)(n.View,{style:X.emptyContainer,children:[s,l]}),a[17]=l,a[18]=c):c=a[18],c}if(_.length>0){let t;return a[19]!==_||a[20]!==o.isManualRefresh||a[21]!==o.listFooterComponent||a[22]!==o.onRefresh?(t=(0,w.jsx)(y.AgentList,{agents:_,showCheckoutInfo:!1,isRefreshing:o.isManualRefresh,onRefresh:o.onRefresh,listFooterComponent:o.listFooterComponent,showAttentionIndicator:!1,showHostColumn:!0}),a[19]=_,a[20]=o.isManualRefresh,a[21]=o.listFooterComponent,a[22]=o.onRefresh,a[23]=t):t=a[23],t}return null}const X=c.StyleSheet.create(t=>({container:{flex:1,backgroundColor:t.colors.surface0,uni__dependencies:[0]},filterContainer:{paddingHorizontal:{xs:t.spacing[3],md:t.spacing[6]},paddingTop:t.spacing[4],uni__dependencies:[0]},emptyContainer:{flex:1,justifyContent:"center",alignItems:"center",gap:t.spacing[6],padding:t.spacing[6],uni__dependencies:[0]},emptyText:{color:t.colors.foregroundMuted,fontSize:t.fontSize.lg,uni__dependencies:[0]},loadingContainer:{flex:1,justifyContent:"center",alignItems:"center"},footer:{alignItems:"center",paddingVertical:t.spacing[4],uni__dependencies:[0]}}))},4718,[711,348,349,36,146,234,1148,1143,56,1600,1573,4406,3627,3564,4413,4705,3454,4626,4719,3271,3602,3955,3477,3513,3613,3603,3604,4720,279]);
|
|
16478
|
+
__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.fetchAgentHistoryPage=p,e.fetchAgentHistoryBatch=I,e.useAgentHistory=function(l){const u=(0,t.c)(51),{t:h}=(0,a.useTranslation)(),f=(0,o.useHosts)();let p;u[0]===Symbol.for("react.memo_cache_sentinel")?(p=(0,o.getHostRuntimeStore)(),u[0]=p):p=u[0];const j=p;let L,M,H;u[1]===Symbol.for("react.memo_cache_sentinel")?(L=t=>j.subscribeAll(t),M=()=>j.getVersion(),H=()=>j.getVersion(),u[1]=L,u[2]=M,u[3]=H):(L=u[1],M=u[2],H=u[3]);(0,s.useSyncExternalStore)(L,M,H);const O=l.serverId;let _;u[4]!==O?(_="string"==typeof O&&O.trim().length>0?O.trim():null,u[4]=O,u[5]=_):_=u[5];const x=_,k=l.enabled??!0;let B;u[6]!==f?(B=new Map(f.map(S)),u[6]=f,u[7]=B):B=u[7];const E=B;let T;if(u[8]!==f||u[9]!==x||u[10]!==E){const t=x?[x]:f.map(P);T=[];for(const n of t){const t=j.getSnapshot(n),s=j.getClient(n);s&&(0,o.isHostRuntimeConnected)(t)&&T.push({serverId:n,serverLabel:E.get(n)??n,client:s})}u[8]=f,u[9]=x,u[10]=E,u[11]=T}else T=u[11];const C=T;let N;u[12]!==C?(N=C.map(w),u[12]=C,u[13]=N):N=u[13];const R=N;let q;u[14]!==x||u[15]!==R?(q=x?(0,c.agentHistoryQueryKey)(x):(0,c.allAgentHistoryQueryKey)(R),u[14]=x,u[15]=R,u[16]=q):q=u[16];const F=q;let K;u[17]!==f?(K=new Map(f.map(A)),u[17]=f,u[18]=K):K=u[18];const Q=K,D=Boolean(k&&C.length>0);let V,z;u[19]!==h||u[20]!==C?(V=async t=>{const{pageParam:n}=t;if(0===C.length)throw new Error(h("workspace.terminal.hostDisconnected"));return I({hosts:C,cursorByServerId:n})},u[19]=h,u[20]=C,u[21]=V):V=u[21];u[22]!==F||u[23]!==V||u[24]!==D?(z={queryKey:F,enabled:D,staleTime:3e4,initialPageParam:null,getNextPageParam:y,queryFn:V},u[22]=F,u[23]=V,u[24]=D,u[25]=z):z=u[25];const G=(0,n.useInfiniteQuery)(z),{data:J,fetchNextPage:U,hasNextPage:W,isError:X,isFetching:Y,isFetchingNextPage:Z,isLoading:$,refetch:ee}=G;let te;u[26]!==k||u[27]!==ee||u[28]!==C.length?(te=async()=>{k&&0!==C.length&&await ee()},u[26]=k,u[27]=ee,u[28]=C.length,u[29]=te):te=u[29];const re=te;let ne;u[30]!==k||u[31]!==U||u[32]!==W||u[33]!==Z||u[34]!==C.length?(ne=()=>{k&&0!==C.length&&W&&!Z&&U()},u[30]=k,u[31]=U,u[32]=W,u[33]=Z,u[34]=C.length,u[35]=ne):ne=u[35];const se=ne;let ae;if(u[36]!==J?.pages||u[37]!==Q){const t=(J?.pages??[]).flatMap(b);let n;u[39]!==Q?(n=t=>Object.assign({},t,{serverLabel:Q.get(t.serverId)??t.serverLabel}),u[39]=Q,u[40]=n):n=u[40];ae=v(t.map(n)),u[36]=J?.pages,u[37]=Q,u[38]=ae}else ae=u[38];const oe=ae,ie=$&&0===oe.length,le=Y&&!Z&&oe.length>0;let ce;u[41]!==oe||u[42]!==W||u[43]!==X||u[44]!==Z||u[45]!==ie||u[46]!==$||u[47]!==le||u[48]!==se||u[49]!==re?(ce={agents:oe,isLoading:$,isInitialLoad:ie,isRevalidating:le,isError:X,hasMore:W,isLoadingMore:Z,refreshAll:re,loadMore:se},u[41]=oe,u[42]=W,u[43]=X,u[44]=Z,u[45]=ie,u[46]=$,u[47]=le,u[48]=se,u[49]=re,u[50]=ce):ce=u[50];return ce};var t=r(d[0]),n=r(d[1]),s=r(d[2]),a=r(d[3]),o=r(d[4]),l=r(d[5]),c=r(d[6]);const u=200,h=[{key:"updated_at",direction:"desc"}],f="No connected hosts could load agent history";async function p(t){const n=await t.client.fetchAgentHistory({sort:h,page:t.cursor?{limit:u,cursor:t.cursor}:{limit:u}}),{agents:s}=(0,l.buildAgentDirectoryState)({serverId:t.serverId,entries:n.entries});return{agents:Array.from(s.values(),n=>({id:n.id,serverId:t.serverId,serverLabel:t.serverId,title:n.title??null,status:n.status,lastActivityAt:n.lastActivityAt,cwd:n.cwd,workspaceId:n.workspaceId,provider:n.provider,pendingPermissionCount:n.pendingPermissions.length,requiresAttention:n.requiresAttention,attentionReason:n.attentionReason,attentionTimestamp:n.attentionTimestamp??null,archivedAt:n.archivedAt??null,createdAt:n.createdAt,labels:n.labels,projectPlacement:n.projectPlacement})),pageInfo:n.pageInfo}}function v(t){return[...t].sort((t,n)=>n.lastActivityAt.getTime()-t.lastActivityAt.getTime())}function y(t){const n={};for(const[s,a]of Object.entries(t.pageInfoByServerId))a.hasMore&&a.nextCursor&&(n[s]=a.nextCursor);return Object.keys(n).length>0?n:null}async function I(t){const n=t.cursorByServerId??{},s=Object.keys(n).length>0?t.hosts.filter(t=>Object.hasOwn(n,t.serverId)):t.hosts,a=(await Promise.allSettled(s.map(async t=>({host:t,page:await p({client:t.client,serverId:t.serverId,cursor:n[t.serverId]??null})})))).flatMap(t=>"fulfilled"===t.status?[t.value]:[]);if(0===a.length)throw new Error(f);const o=a.flatMap(({host:t,page:n})=>n.agents.map(n=>Object.assign({},n,{serverLabel:t.serverLabel}))),l=Object.fromEntries(a.map(({host:t,page:n})=>[t.serverId,n.pageInfo]));return{agents:v(o),pageInfoByServerId:l}}function b(t){return t.agents}function A(t){return[t.serverId,t.label]}function w(t){return t.serverId}function P(t){return t.serverId}function S(t){return[t.serverId,t.label]}},4719,[349,916,36,1573,3271,3413,4099]);
|
|
16479
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.sessionPassesListFilter=function(n,s,u){const{statusFilters:l,tagFilters:c,archivedOnly:o,timeWindow:f,providerFilters:h,originFilters:v,textQuery:F}=s;if(l.length>0&&!l.includes(n.statusBucket))return!1;if(c.length>0&&!c.some(t=>n.tags.includes(t)))return!1;if(o&&!n.isArchived)return!1;if(null!==f&&!(0,t.isWithinSessionTimeWindow)(n.timeValue,f,u))return!1;if(h.length>0&&!h.includes(n.provider))return!1;if(v.length>0&&!v.includes(n.origin))return!1;if(F.length>0&&!n.searchableText.includes(F))return!1;return!0};var t=r(d[0])},4720,[3603]);
|
|
16480
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return l}});var e=r(d[0]),t=r(d[1]);r(d[2]);var n,o=r(d[3]),s=(n=o)&&n.__esModule?n:{default:n},c=r(d[4]),u=r(d[5]);function l(){const n=(0,e.c)(7),o=(0,t.useLocalSearchParams)(),l="string"==typeof o.section?o.section:"";let f;n[0]!==l?(f=(0,c.isSettingsSectionSlug)(l)?l:"general",n[0]=l,n[1]=f):f=n[1];const _=f,p="string"==typeof o.addHost?o.addHost:null;let v;n[2]!==_?(v={kind:"section",section:_},n[2]=_,n[3]=v):v=n[3];const y=v;let S;return n[4]!==p||n[5]!==y?(S=(0,u.jsx)(s.default,{view:y,openAddHostIntent:p}),n[4]=p,n[5]=y,n[6]=S):S=n[6],S}},4721,[349,1143,36,4722,3477,279]);
|
|
16481
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return Je}});var t=r(d[0]),s=r(d[1]),n=r(d[2]),o=r(d[3]),l=r(d[4]),c=r(d[5]),u=r(d[6]),p=e(r(d[7]));r(d[8]),r(d[9]),r(d[10]),r(d[11]),r(d[12]);var h=r(d[13]),b=r(d[14]),S=r(d[15]),y=r(d[16]),x=r(d[17]),f=r(d[18]),j=r(d[19]),v=r(d[20]),w=r(d[21]),k=r(d[22]),T=r(d[23]),C=r(d[24]),V=r(d[25]),I=r(d[26]),H=r(d[27]),_=r(d[28]),L=r(d[29]),P=r(d[30]),z=r(d[31]),A=r(d[32]),D=r(d[33]),B=r(d[34]),M=r(d[35]),R=r(d[36]),O=r(d[37]),U=r(d[38]),K=r(d[39]),W=r(d[40]),F=r(d[41]),E=r(d[42]),G=r(d[43]),N=r(d[44]),q=r(d[45]),$=r(d[46]),Q=r(d[47]),J=r(d[48]),X=r(d[49]),Y=r(d[50]),Z=r(d[51]),ee=r(d[52]),te=r(d[53]),se=r(d[54]),ne=r(d[55]),ie=r(d[56]),oe=r(d[57]),le=r(d[58]),re=r(d[59]),ae=r(d[60]),ce=r(d[61]),de=e(r(d[62])),ue=e(r(d[63])),ge=r(d[64]),pe=r(d[65]),he=r(d[66]),be=r(d[67]),Se=r(d[68]),ye=r(d[69]),xe=r(d[70]);const fe=[{id:"general",labelKey:"settings.sections.general",icon:f.Settings},{id:"daemon",labelKey:"settings.sections.daemon",icon:f.Server,desktopOnly:!0},{id:"appearance",labelKey:"settings.sections.appearance",icon:f.Palette},{id:"shortcuts",labelKey:"settings.sections.shortcuts",icon:f.Keyboard,desktopOnly:!0},{id:"integrations",labelKey:"settings.sections.integrations",icon:f.Puzzle,desktopOnly:!0},{id:"permissions",labelKey:"settings.sections.permissions",icon:f.Shield,desktopOnly:!0},{id:"diagnostics",labelKey:"settings.sections.diagnostics",icon:f.Stethoscope},{id:"about",labelKey:"settings.sections.about",icon:f.Info}],me=[{id:"connections",labelKey:"settings.hostSections.connections",icon:f.Network},{id:"agents",labelKey:"settings.hostSections.agents",icon:f.Bot},{id:"workspaces",labelKey:"settings.hostSections.workspaces",icon:f.FolderGit2},{id:"providers",labelKey:"settings.hostSections.providers",icon:f.Boxes},{id:"usage",labelKey:"settings.hostSections.usage",icon:f.Gauge},{id:"terminals",labelKey:"settings.hostSections.terminals",icon:f.SquareTerminal},{id:"host",labelKey:"settings.hostSections.host",icon:f.Server}];function je(e,t){switch(e.section){case"connections":return(0,xe.jsx)(ce.HostConnectionsPage,{serverId:e.serverId});case"agents":return(0,xe.jsx)(ce.HostAgentsPage,{serverId:e.serverId});case"workspaces":return(0,xe.jsx)(ce.HostWorkspacesPage,{serverId:e.serverId});case"providers":return(0,xe.jsx)(ce.HostProvidersPage,{serverId:e.serverId});case"usage":return(0,xe.jsx)(ce.HostUsagePage,{serverId:e.serverId});case"terminals":return(0,xe.jsx)(ce.HostTerminalsPage,{serverId:e.serverId});case"host":return(0,xe.jsx)(ce.HostSettingsPage,{serverId:e.serverId,onHostRemoved:t})}}function ve({pressed:e}){return[Xe.themeTrigger,e&&{opacity:.85}]}function we({hovered:e}){return[Ze.item,Boolean(e)&&Ze.itemHovered]}function ke({hovered:e}){return[Ze.item,Boolean(e)&&Ze.itemHovered,Ze.itemSelected]}const Te=[oe.settingsStyles.row,oe.settingsStyles.rowBorder];function Ce(e){return[{value:"interrupt",label:e("settings.general.defaultSend.options.interrupt")},{value:"queue",label:e("settings.general.defaultSend.options.queue")}]}function Ve(e,t){return{ask:e("settings.general.serviceUrls.options.ask"),"in-app":e("settings.general.serviceUrls.options.inApp"),external:e("settings.general.serviceUrls.options.external")}[t]}function Ie(e){const t=(0,ae.parseAppLanguage)(e);return t&&"system"!==t?t:"en"}const He=["ask","in-app","external"];function Le(e){const t=(0,c.c)(7),{value:s,label:n,selected:o,onChange:l}=e;let u;t[0]!==l||t[1]!==s?(u=()=>{l(s)},t[0]=l,t[1]=s,t[2]=u):u=t[2];const p=u;let h;return t[3]!==p||t[4]!==n||t[5]!==o?(h=(0,xe.jsx)(Y.DropdownMenuItem,{selected:o,onSelect:p,children:n}),t[3]=p,t[4]=n,t[5]=o,t[6]=h):h=t[6],h}function Pe(e){const t=(0,c.c)(13),{value:s,activeLocale:n,selected:o,onChange:l}=e,{t:u}=(0,y.useTranslation)();let p;t[0]!==l||t[1]!==s?(p=()=>{l(s)},t[0]=l,t[1]=s,t[2]=p):p=t[2];const h=p;let b;if(t[3]!==n||t[4]!==u||t[5]!==s){let e;t[7]!==s?(e=e=>e.value===s,t[7]=s,t[8]=e):e=t[8];const o=ae.LANGUAGE_OPTIONS.find(e);b=o?(0,ae.formatLanguageOptionLabel)(o,n,u(o.labelKey)):s,t[3]=n,t[4]=u,t[5]=s,t[6]=b}else b=t[6];const S=b;let x;return t[9]!==h||t[10]!==S||t[11]!==o?(x=(0,xe.jsx)(Y.DropdownMenuItem,{selected:o,onSelect:h,children:S}),t[9]=h,t[10]=S,t[11]=o,t[12]=x):x=t[12],x}function ze(e){const o=(0,c.c)(106),{settings:l,isDesktopApp:p,handleSendBehaviorChange:h,handleServiceUrlBehaviorChange:b,handleLanguageChange:S,handleTerminalScrollbackLinesChange:x,handleFastOfflineModeChange:f}=e,{t:v,i18n:w}=(0,y.useTranslation)();let k,T,C,V;if(o[0]!==w.language||o[1]!==l.language||o[2]!==l.sendBehavior||o[3]!==v){let e,t;k=Ie(w.language),o[8]!==v?(e=Ce(v),o[8]=v,o[9]=e):e=o[9],C=e,T="interrupt"===l.sendBehavior?"settings.general.defaultSend.descriptions.interrupt":"settings.general.defaultSend.descriptions.queue",o[10]!==l.language?(t=e=>e.value===l.language,o[10]=l.language,o[11]=t):t=o[11];const s=ae.LANGUAGE_OPTIONS.find(t);V=s?(0,ae.formatLanguageOptionLabel)(s,k,v(s.labelKey)):l.language,o[0]=w.language,o[1]=l.language,o[2]=l.sendBehavior,o[3]=v,o[4]=k,o[5]=T,o[6]=C,o[7]=V}else k=o[4],T=o[5],C=o[6],V=o[7];const I=V,[H,L]=(0,u.useState)(String(l.terminalScrollbackLines));let z;o[12]===Symbol.for("react.memo_cache_sentinel")?(z=e=>{L(e.replace(/[^\d]/g,""))},o[12]=z):z=o[12];const A=z;let D;o[13]!==x||o[14]!==l.terminalScrollbackLines||o[15]!==H?(D=()=>{const e=(0,P.parseTerminalScrollbackLines)(H)??l.terminalScrollbackLines;L(String(e)),e!==l.terminalScrollbackLines&&x(e)},o[13]=x,o[14]=l.terminalScrollbackLines,o[15]=H,o[16]=D):D=o[16];const R=D;let O,U,K,W,F,E,G,N,q,$,Q,J,Z,ee,te,se,ne,ie,le,re,ce,de,ue,ge,pe,he,be,Se,ye,fe,me,je,we;return o[17]!==l.terminalScrollbackLines?(O=()=>{L(String(l.terminalScrollbackLines))},U=[l.terminalScrollbackLines],o[17]=l.terminalScrollbackLines,o[18]=O,o[19]=U):(O=o[18],U=o[19]),(0,u.useEffect)(O,U),o[20]!==v?(K=v("settings.general.title"),o[20]=v,o[21]=K):K=o[21],o[22]!==v?(W=v("settings.general.defaultSend.label"),o[22]=v,o[23]=W):W=o[23],o[24]!==W?(F=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,children:W}),o[24]=W,o[25]=F):F=o[25],o[26]!==T||o[27]!==v?(E=v(T),o[26]=T,o[27]=v,o[28]=E):E=o[28],o[29]!==E?(G=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:E}),o[29]=E,o[30]=G):G=o[30],o[31]!==G||o[32]!==F?(N=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.rowContent,children:[F,G]}),o[31]=G,o[32]=F,o[33]=N):N=o[33],o[34]!==h||o[35]!==C||o[36]!==l.sendBehavior?(q=(0,xe.jsx)(X.SegmentedControl,{size:"sm",value:l.sendBehavior,onValueChange:h,options:C}),o[34]=h,o[35]=C,o[36]=l.sendBehavior,o[37]=q):q=o[37],o[38]!==N||o[39]!==q?($=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.row,children:[N,q]}),o[38]=N,o[39]=q,o[40]=$):$=o[40],o[41]!==f||o[42]!==l.fastOfflineMode?(Q=M.isNative?(0,xe.jsxs)(t.View,{style:Te,children:[(0,xe.jsxs)(t.View,{style:oe.settingsStyles.rowContent,children:[(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,children:"Fast offline mode"}),(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:"Voice replies and dictation use the on-device iOS engines instead of the daemon \u2014 lower latency, works without a voice connection"})]}),(0,xe.jsx)(B.Switch,{value:l.fastOfflineMode,onValueChange:f,accessibilityLabel:"Toggle fast offline voice mode",testID:"settings-fast-offline-mode"})]}):null,o[41]=f,o[42]=l.fastOfflineMode,o[43]=Q):Q=o[43],o[44]!==v?(J=v("settings.general.language.label"),o[44]=v,o[45]=J):J=o[45],o[46]!==J?(Z=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,children:J}),o[46]=J,o[47]=Z):Z=o[47],o[48]!==v?(ee=v("settings.general.language.description"),o[48]=v,o[49]=ee):ee=o[49],o[50]!==ee?(te=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:ee}),o[50]=ee,o[51]=te):te=o[51],o[52]!==Z||o[53]!==te?(se=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.rowContent,children:[Z,te]}),o[52]=Z,o[53]=te,o[54]=se):se=o[54],o[55]!==I?(ne=(0,xe.jsx)(n.Text,{style:Xe.themeTriggerText,children:I}),o[55]=I,o[56]=ne):ne=o[56],o[57]!==I||o[58]!==ne?(ie=(0,xe.jsx)(j.DropdownTrigger,{accessibilityRole:"button",accessibilityLabel:I,style:ve,children:ne}),o[57]=I,o[58]=ne,o[59]=ie):ie=o[59],o[60]!==k||o[61]!==S||o[62]!==l.language?(le=ae.LANGUAGE_OPTIONS.map(e=>(0,xe.jsx)(Pe,{value:e.value,activeLocale:k,selected:l.language===e.value,onChange:S},e.value)),o[60]=k,o[61]=S,o[62]=l.language,o[63]=le):le=o[63],o[64]!==le?(re=(0,xe.jsx)(Y.DropdownMenuContent,{side:"bottom",align:"end",width:300,children:le}),o[64]=le,o[65]=re):re=o[65],o[66]!==ie||o[67]!==re?(ce=(0,xe.jsxs)(Y.DropdownMenu,{children:[ie,re]}),o[66]=ie,o[67]=re,o[68]=ce):ce=o[68],o[69]!==se||o[70]!==ce?(de=(0,xe.jsxs)(t.View,{style:Te,children:[se,ce]}),o[69]=se,o[70]=ce,o[71]=de):de=o[71],o[72]!==b||o[73]!==p||o[74]!==l.serviceUrlBehavior||o[75]!==v?(ue=p?(0,xe.jsxs)(t.View,{style:Te,children:[(0,xe.jsxs)(t.View,{style:oe.settingsStyles.rowContent,children:[(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,children:v("settings.general.serviceUrls.label")}),(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:v("settings.general.serviceUrls.description")})]}),(0,xe.jsxs)(Y.DropdownMenu,{children:[(0,xe.jsx)(j.DropdownTrigger,{style:ve,children:(0,xe.jsx)(n.Text,{style:Xe.themeTriggerText,children:Ve(v,l.serviceUrlBehavior)})}),(0,xe.jsx)(Y.DropdownMenuContent,{side:"bottom",align:"end",width:200,children:He.map(e=>(0,xe.jsx)(Le,{value:e,label:Ve(v,e),selected:l.serviceUrlBehavior===e,onChange:b},e))})]})]}):null,o[72]=b,o[73]=p,o[74]=l.serviceUrlBehavior,o[75]=v,o[76]=ue):ue=o[76],o[77]!==v?(ge=v("settings.general.terminalScrollback.label"),o[77]=v,o[78]=ge):ge=o[78],o[79]!==ge?(pe=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,children:ge}),o[79]=ge,o[80]=pe):pe=o[80],o[81]!==v?(he=v("settings.general.terminalScrollback.description"),o[81]=v,o[82]=he):he=o[82],o[83]!==he?(be=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:he}),o[83]=he,o[84]=be):be=o[84],o[85]!==pe||o[86]!==be?(Se=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.rowContent,children:[pe,be]}),o[85]=pe,o[86]=be,o[87]=Se):Se=o[87],o[88]!==v?(ye=v("settings.general.terminalScrollback.accessibilityLabel"),o[88]=v,o[89]=ye):ye=o[89],o[90]!==R||o[91]!==ye||o[92]!==H?(fe=(0,xe.jsx)(s.TextInput,{value:H,onChangeText:A,onBlur:R,onSubmitEditing:R,keyboardType:"number-pad",inputMode:"numeric",selectTextOnFocus:!0,style:Xe.terminalScrollbackInput,accessibilityLabel:ye}),o[90]=R,o[91]=ye,o[92]=H,o[93]=fe):fe=o[93],o[94]!==Se||o[95]!==fe?(me=(0,xe.jsxs)(t.View,{style:Te,children:[Se,fe]}),o[94]=Se,o[95]=fe,o[96]=me):me=o[96],o[97]!==$||o[98]!==Q||o[99]!==de||o[100]!==ue||o[101]!==me?(je=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.card,children:[$,Q,de,ue,me]}),o[97]=$,o[98]=Q,o[99]=de,o[100]=ue,o[101]=me,o[102]=je):je=o[102],o[103]!==je||o[104]!==K?(we=(0,xe.jsx)(_.SettingsSection,{title:K,children:je}),o[103]=je,o[104]=K,o[105]=we):we=o[105],we}function Ae(e){const s=(0,c.c)(54),{voiceAudioEngine:o,isPlaybackTestRunning:l,playbackTestResult:p,handlePlaybackTest:h,appVersion:b,isDesktopApp:S}=e,{t:x}=(0,y.useTranslation)(),[f,j]=(0,u.useState)(!1);let w;s[0]!==h?(w=()=>{h()},s[0]=h,s[1]=w):w=s[1];const k=w;let T;s[2]===Symbol.for("react.memo_cache_sentinel")?(T=()=>j(!0),s[2]=T):T=s[2];const C=T;let V;s[3]===Symbol.for("react.memo_cache_sentinel")?(V=()=>j(!1),s[3]=V):V=s[3];const I=V;let H,L,P,z,A,D,B,M,R,O,U,K,W;s[4]!==x?(H=x("settings.diagnostics.title"),s[4]=x,s[5]=H):H=s[5],s[6]!==x?(L=x("settings.diagnostics.app.rowTitle"),s[6]=x,s[7]=L):L=s[7],s[8]!==L?(P=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,children:L}),s[8]=L,s[9]=P):P=s[9],s[10]!==x?(z=x("settings.diagnostics.app.rowHint"),s[10]=x,s[11]=z):z=s[11],s[12]!==z?(A=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:z}),s[12]=z,s[13]=A):A=s[13],s[14]!==P||s[15]!==A?(D=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.rowContent,children:[P,A]}),s[14]=P,s[15]=A,s[16]=D):D=s[16],s[17]!==x?(B=x("settings.diagnostics.app.run"),s[17]=x,s[18]=B):B=s[18],s[19]!==B?(M=(0,xe.jsx)(Q.Button,{variant:"secondary",size:"sm",onPress:C,children:B}),s[19]=B,s[20]=M):M=s[20],s[21]!==M||s[22]!==D?(R=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.row,testID:"app-diagnostic-row",children:[D,M]}),s[21]=M,s[22]=D,s[23]=R):R=s[23],s[24]!==x?(O=x("settings.diagnostics.testAudio"),s[24]=x,s[25]=O):O=s[25],s[26]!==O?(U=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,children:O}),s[26]=O,s[27]=U):U=s[27],s[28]!==p?(K=p?(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:p}):null,s[28]=p,s[29]=K):K=s[29],s[30]!==U||s[31]!==K?(W=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.rowContent,children:[U,K]}),s[30]=U,s[31]=K,s[32]=W):W=s[32];const F=!o||l;let E,G,N,q,$,J;return s[33]!==l||s[34]!==x?(E=x(l?"settings.diagnostics.playing":"settings.diagnostics.playTest"),s[33]=l,s[34]=x,s[35]=E):E=s[35],s[36]!==k||s[37]!==F||s[38]!==E?(G=(0,xe.jsx)(Q.Button,{variant:"secondary",size:"sm",onPress:k,disabled:F,children:E}),s[36]=k,s[37]=F,s[38]=E,s[39]=G):G=s[39],s[40]!==W||s[41]!==G?(N=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.row,children:[W,G]}),s[40]=W,s[41]=G,s[42]=N):N=s[42],s[43]!==R||s[44]!==N?(q=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.card,children:[R,N]}),s[43]=R,s[44]=N,s[45]=q):q=s[45],s[46]!==b||s[47]!==f||s[48]!==S?($=(0,xe.jsx)(v.AppDiagnosticSheet,{visible:f,onClose:I,appVersion:b,isDesktopApp:S}),s[46]=b,s[47]=f,s[48]=S,s[49]=$):$=s[49],s[50]!==q||s[51]!==$||s[52]!==H?(J=(0,xe.jsxs)(_.SettingsSection,{title:H,children:[q,$]}),s[50]=q,s[51]=$,s[52]=H,s[53]=J):J=s[53],J}function De(){const e=(0,c.c)(2),t=(0,he.useActiveServerId)();let s;return e[0]!==t?(s=e=>t?e.sessions[t]?.serverInfo?.version??null:null,e[0]=t,e[1]=s):s=e[1],(0,O.useSessionStore)(s)}function Be(e){const s=(0,c.c)(39),{appVersion:o,appVersionText:l}=e,{t:u}=(0,y.useTranslation)(),p=De();let h;s[0]!==p?(h=(0,ne.formatVersionWithPrefix)(p),s[0]=p,s[1]=h):h=s[1];const b=h;let S,x,f,j,v,w,k,T,C,V,I,H,L,P,z,A,D;return s[2]!==u?(S=u("settings.about.title"),s[2]=u,s[3]=S):S=s[3],s[4]!==u?(x=u("settings.about.appVersion"),s[4]=u,s[5]=x):x=s[5],s[6]!==x?(f=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,children:x}),s[6]=x,s[7]=f):f=s[7],s[8]!==u?(j=u("settings.about.thisDevice"),s[8]=u,s[9]=j):j=s[9],s[10]!==j?(v=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:j}),s[10]=j,s[11]=v):v=s[11],s[12]!==f||s[13]!==v?(w=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.rowContent,children:[f,v]}),s[12]=f,s[13]=v,s[14]=w):w=s[14],s[15]!==l?(k=(0,xe.jsx)(n.Text,{style:Xe.aboutValue,children:l}),s[15]=l,s[16]=k):k=s[16],s[17]!==w||s[18]!==k?(T=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.row,children:[w,k]}),s[17]=w,s[18]=k,s[19]=T):T=s[19],s[20]!==l?(C=(0,xe.jsx)(n.Text,{style:Xe.aboutValue,testID:"settings-about-app-version",children:l}),s[20]=l,s[21]=C):C=s[21],s[22]!==T||s[23]!==C?(V=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.card,children:[T,C]}),s[22]=T,s[23]=C,s[24]=V):V=s[24],s[25]===Symbol.for("react.memo_cache_sentinel")?(I=(0,xe.jsx)(t.View,{style:oe.settingsStyles.rowContent,children:(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,children:"Daemon version"})}),s[25]=I):I=s[25],s[26]!==b?(H=(0,xe.jsxs)(t.View,{style:Te,children:[I,(0,xe.jsx)(n.Text,{style:Xe.aboutValue,testID:"settings-about-daemon-version",children:b})]}),s[26]=b,s[27]=H):H=s[27],s[28]===Symbol.for("react.memo_cache_sentinel")?(L=(0,xe.jsx)(Ke,{}),s[28]=L):L=s[28],s[29]!==V||s[30]!==H||s[31]!==S?(P=(0,xe.jsxs)(_.SettingsSection,{title:S,children:[V,H,L]}),s[29]=V,s[30]=H,s[31]=S,s[32]=P):P=s[32],s[33]!==o?(z=(0,xe.jsx)(Re,{clientVersion:o}),s[33]=o,s[34]=z):z=s[34],s[35]===Symbol.for("react.memo_cache_sentinel")?(A=(0,xe.jsx)(t.View,{style:Xe.aboutCommunity,children:(0,xe.jsx)(J.CommunityLinks,{})}),s[35]=A):A=s[35],s[36]!==P||s[37]!==z?(D=(0,xe.jsxs)(xe.Fragment,{children:[P,z,A]}),s[36]=P,s[37]=z,s[38]=D):D=s[38],D}function Me(e){const t=e?.trim();return t?t.replace(/^v/i,""):null}function Re(e){const s=(0,c.c)(12),{clientVersion:n}=e,{t:o}=(0,y.useTranslation)(),l=(0,R.useHosts)();if(0===l.length)return null;let u,p,h,b;if(s[0]!==o?(u=o("settings.about.connectedHosts"),s[0]=o,s[1]=u):u=s[1],s[2]!==n||s[3]!==l){let e;s[5]!==n?(e=(e,t)=>(0,xe.jsx)(Oe,{host:e,showBorder:t>0,clientVersion:n},e.serverId),s[5]=n,s[6]=e):e=s[6],p=l.map(e),s[2]=n,s[3]=l,s[4]=p}else p=s[4];return s[7]!==p?(h=(0,xe.jsx)(t.View,{style:oe.settingsStyles.card,children:p}),s[7]=p,s[8]=h):h=s[8],s[9]!==u||s[10]!==h?(b=(0,xe.jsx)(_.SettingsSection,{title:u,children:h}),s[9]=u,s[10]=h,s[11]=b):b=s[11],b}function Oe(e){const s=(0,c.c)(31),{host:o,showBorder:l,clientVersion:u}=e,{t:p}=(0,y.useTranslation)(),h=(0,R.useHostRuntimeIsConnected)(o.serverId);let b;s[0]!==o.serverId?(b=e=>e.sessions[o.serverId]?.serverInfo?.version??null,s[0]=o.serverId,s[1]=b):b=s[1];const S=(0,O.useSessionStore)(b),x=l&&oe.settingsStyles.rowBorder;let f;s[2]!==x?(f=[oe.settingsStyles.row,x],s[2]=x,s[3]=f):f=s[3];const j=f;let v,w;if(s[4]!==u||s[5]!==S||s[6]!==h||s[7]!==p){const e=Me(S);let t;s[10]!==u?(t=Me(u),s[10]=u,s[11]=t):t=s[11];if(v=null!==e&&null!==t&&e!==t,h)w=e?(0,ne.formatVersionWithPrefix)(e):"\u2014";else{let e;s[12]!==p?(e=p("settings.about.offline"),s[12]=p,s[13]=e):e=s[13],w=e}s[4]=u,s[5]=S,s[6]=h,s[7]=p,s[8]=v,s[9]=w}else v=s[8],w=s[9];const k=v&&Xe.aboutVersionMismatch;let T;s[14]!==k?(T=[Xe.aboutValue,k],s[14]=k,s[15]=T):T=s[15];const C=T;let V,I,H,_,L;return s[16]!==o.label?(V=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,numberOfLines:1,children:o.label}),s[16]=o.label,s[17]=V):V=s[17],s[18]!==v||s[19]!==p?(I=v?(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:p("settings.about.versionDiffers")}):null,s[18]=v,s[19]=p,s[20]=I):I=s[20],s[21]!==V||s[22]!==I?(H=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.rowContent,children:[V,I]}),s[21]=V,s[22]=I,s[23]=H):H=s[23],s[24]!==C||s[25]!==w?(_=(0,xe.jsx)(n.Text,{style:C,children:w}),s[24]=C,s[25]=w,s[26]=_):_=s[26],s[27]!==j||s[28]!==H||s[29]!==_?(L=(0,xe.jsxs)(t.View,{style:j,children:[H,_]}),s[27]=j,s[28]=H,s[29]=_,s[30]=L):L=s[30],L}function Ue(e,t,s){return t?e("settings.about.updates.installing"):s?e("settings.about.updates.updateTo",{version:(0,ne.formatVersionWithPrefix)(s)}):e("settings.about.updates.update")}function Ke(){const e=(0,c.c)(81),{t:s}=(0,y.useTranslation)(),{settings:o,updateSettings:l}=(0,P.useSettings)(),{isDesktopApp:u,statusText:h,availableUpdate:b,errorMessage:S,isChecking:x,isInstalling:f,checkForUpdates:j,installUpdate:v}=(0,D.useDesktopAppUpdater)();let w,k;e[0]!==j||e[1]!==u?(w=()=>{u&&j({intent:"automatic",silent:!0})},e[0]=j,e[1]=u,e[2]=w):w=e[2],(0,z.useFocusEffect)(w),e[3]!==j||e[4]!==u?(k=()=>{u&&j()},e[3]=j,e[4]=u,e[5]=k):k=e[5];const T=k;let C;e[6]!==l?(C=e=>{l({releaseChannel:e})},e[6]=l,e[7]=C):C=e[7];const V=C;let I,H,_,L,B;e[8]!==s?(I=s("settings.about.releaseChannel.stable"),e[8]=s,e[9]=I):I=e[9],e[10]!==I?(H={value:"stable",label:I},e[10]=I,e[11]=H):H=e[11],e[12]!==s?(_=s("settings.about.releaseChannel.beta"),e[12]=s,e[13]=_):_=e[13],e[14]!==_?(L={value:"beta",label:_},e[14]=_,e[15]=L):L=e[15],e[16]!==H||e[17]!==L?(B=[H,L],e[16]=H,e[17]=L,e[18]=B):B=e[18];const M=B;let R;e[19]!==v||e[20]!==u||e[21]!==s?(R=()=>{u&&(0,A.confirmDialog)({title:s("settings.about.updates.installTitle"),message:s("settings.about.updates.installMessage"),confirmLabel:s("settings.about.updates.installConfirm"),cancelLabel:s("common.actions.cancel")}).then(e=>{e&&v()}).catch(e=>{console.error("[Settings] Failed to open app update confirmation",e),p.default.alert(s("settings.about.updates.alertTitle"),s("settings.about.updates.alertMessage"))})},e[19]=v,e[20]=u,e[21]=s,e[22]=R):R=e[22];const O=R,U=!0===b?.readyToInstall,K=U?b?.latestVersion:null;if(!u)return null;let W,F,E,G,N,q,$,J,Y,Z,ee,te,se;e[23]!==s?(W=s("settings.about.releaseChannel.label"),e[23]=s,e[24]=W):W=e[24],e[25]!==W?(F=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,children:W}),e[25]=W,e[26]=F):F=e[26],e[27]!==s?(E=s("settings.about.releaseChannel.description"),e[27]=s,e[28]=E):E=e[28],e[29]!==E?(G=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:E}),e[29]=E,e[30]=G):G=e[30],e[31]!==F||e[32]!==G?(N=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.rowContent,children:[F,G]}),e[31]=F,e[32]=G,e[33]=N):N=e[33],e[34]!==V||e[35]!==M||e[36]!==o.releaseChannel?(q=(0,xe.jsx)(X.SegmentedControl,{size:"sm",value:o.releaseChannel,onValueChange:V,options:M}),e[34]=V,e[35]=M,e[36]=o.releaseChannel,e[37]=q):q=e[37],e[38]!==N||e[39]!==q?($=(0,xe.jsxs)(t.View,{style:Te,children:[N,q]}),e[38]=N,e[39]=q,e[40]=$):$=e[40],e[41]!==s?(J=s("settings.about.updates.label"),e[41]=s,e[42]=J):J=e[42],e[43]!==J?(Y=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowTitle,children:J}),e[43]=J,e[44]=Y):Y=e[44],e[45]!==h?(Z=(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:h}),e[45]=h,e[46]=Z):Z=e[46],e[47]!==K||e[48]!==s?(ee=K?(0,xe.jsx)(n.Text,{style:oe.settingsStyles.rowHint,children:s("settings.about.updates.readyToInstall",{version:(0,ne.formatVersionWithPrefix)(K)})}):null,e[47]=K,e[48]=s,e[49]=ee):ee=e[49],e[50]!==S?(te=S?(0,xe.jsx)(n.Text,{style:Xe.aboutErrorText,children:S}):null,e[50]=S,e[51]=te):te=e[51],e[52]!==Y||e[53]!==Z||e[54]!==ee||e[55]!==te?(se=(0,xe.jsxs)(t.View,{style:oe.settingsStyles.rowContent,children:[Y,Z,ee,te]}),e[52]=Y,e[53]=Z,e[54]=ee,e[55]=te,e[56]=se):se=e[56];const ie=x||f;let le,re;e[57]!==x||e[58]!==s?(le=s(x?"settings.about.updates.checking":"settings.about.updates.check"),e[57]=x,e[58]=s,e[59]=le):le=e[59],e[60]!==T||e[61]!==ie||e[62]!==le?(re=(0,xe.jsx)(Q.Button,{variant:"outline",size:"sm",onPress:T,disabled:ie,children:le}),e[60]=T,e[61]=ie,e[62]=le,e[63]=re):re=e[63];const ae=x||f||!U;let ce,de,ue,ge,pe;return e[64]!==f||e[65]!==K||e[66]!==s?(ce=Ue(s,f,K),e[64]=f,e[65]=K,e[66]=s,e[67]=ce):ce=e[67],e[68]!==O||e[69]!==ae||e[70]!==ce?(de=(0,xe.jsx)(Q.Button,{variant:"default",size:"sm",onPress:O,disabled:ae,children:ce}),e[68]=O,e[69]=ae,e[70]=ce,e[71]=de):de=e[71],e[72]!==re||e[73]!==de?(ue=(0,xe.jsxs)(t.View,{style:Xe.aboutUpdateActions,children:[re,de]}),e[72]=re,e[73]=de,e[74]=ue):ue=e[74],e[75]!==se||e[76]!==ue?(ge=(0,xe.jsxs)(t.View,{style:Te,children:[se,ue]}),e[75]=se,e[76]=ue,e[77]=ge):ge=e[77],e[78]!==$||e[79]!==ge?(pe=(0,xe.jsxs)(xe.Fragment,{children:[$,ge]}),e[78]=$,e[79]=ge,e[80]=pe):pe=e[80],pe}function We(e,t){const s=(0,c.c)(3);let n;return s[0]!==e||s[1]!==t?(n=(0,U.orderHostsLocalFirst)(e,t),s[0]=e,s[1]=t,s[2]=n):n=s[2],n}function Fe(e){const t=(0,c.c)(23),{itemId:s,label:o,icon:u,isSelected:p,onSelect:h}=e,{theme:b}=(0,S.useUnistyles)();let y;t[0]!==s||t[1]!==h?(y=()=>{h(s)},t[0]=s,t[1]=h,t[2]=y):y=t[2];const x=y;let f;t[3]!==p?(f={selected:p},t[3]=p,t[4]=f):f=t[4];const j=f;let v,w;t[5]!==p||t[6]!==b.colors.foreground?(v=p&&{color:b.colors.foreground},t[5]=p,t[6]=b.colors.foreground,t[7]=v):v=t[7],t[8]!==v?(w=[Ze.label,v],t[8]=v,t[9]=w):w=t[9];const k=w,T=p?ke:we,C=p?b.colors.foreground:b.colors.foregroundMuted;let V,I,H;return t[10]!==u||t[11]!==C||t[12]!==b.iconSize.md?(V=(0,xe.jsx)(u,{size:b.iconSize.md,color:C}),t[10]=u,t[11]=C,t[12]=b.iconSize.md,t[13]=V):V=t[13],t[14]!==o||t[15]!==k?(I=(0,xe.jsx)(n.Text,{style:k,numberOfLines:1,children:o}),t[14]=o,t[15]=k,t[16]=I):I=t[16],t[17]!==j||t[18]!==x||t[19]!==T||t[20]!==V||t[21]!==I?(H=(0,xe.jsxs)(l.Pressable,{accessibilityRole:"button",accessibilityState:j,onPress:x,style:T,children:[V,I]}),t[17]=j,t[18]=x,t[19]=T,t[20]=V,t[21]=I,t[22]=H):H=t[22],H}function Ee(e){const t=(0,c.c)(24),{itemId:s,label:o,icon:u,isSelected:p,onSelect:h}=e,{theme:b}=(0,S.useUnistyles)();let y;t[0]!==s||t[1]!==h?(y=()=>{h(s)},t[0]=s,t[1]=h,t[2]=y):y=t[2];const x=y;let f;t[3]!==p?(f={selected:p},t[3]=p,t[4]=f):f=t[4];const j=f;let v,w;t[5]!==p||t[6]!==b.colors.foreground?(v=p&&{color:b.colors.foreground},t[5]=p,t[6]=b.colors.foreground,t[7]=v):v=t[7],t[8]!==v?(w=[Ze.label,v],t[8]=v,t[9]=w):w=t[9];const k=w,T=`settings-host-section-${s}`,C=p?ke:we,V=p?b.colors.foreground:b.colors.foregroundMuted;let I,H,_;return t[10]!==u||t[11]!==V||t[12]!==b.iconSize.md?(I=(0,xe.jsx)(u,{size:b.iconSize.md,color:V}),t[10]=u,t[11]=V,t[12]=b.iconSize.md,t[13]=I):I=t[13],t[14]!==o||t[15]!==k?(H=(0,xe.jsx)(n.Text,{style:k,numberOfLines:1,children:o}),t[14]=o,t[15]=k,t[16]=H):H=t[16],t[17]!==j||t[18]!==x||t[19]!==T||t[20]!==C||t[21]!==I||t[22]!==H?(_=(0,xe.jsxs)(l.Pressable,{accessibilityRole:"button",accessibilityState:j,onPress:x,testID:T,style:C,children:[I,H]}),t[17]=j,t[18]=x,t[19]=T,t[20]=C,t[21]=I,t[22]=H,t[23]=_):_=t[23],_}function Ge(e){const t=(0,c.c)(21),{isSelected:s,onSelect:o}=e,{theme:u}=(0,S.useUnistyles)(),{t:p}=(0,y.useTranslation)();let h;t[0]!==s?(h={selected:s},t[0]=s,t[1]=h):h=t[1];const b=h;let x,j;t[2]!==s||t[3]!==u.colors.foreground?(x=s&&{color:u.colors.foreground},t[2]=s,t[3]=u.colors.foreground,t[4]=x):x=t[4],t[5]!==x?(j=[Ze.label,x],t[5]=x,t[6]=j):j=t[6];const v=j,w=s?ke:we,k=s?u.colors.foreground:u.colors.foregroundMuted;let T,C,V,I;return t[7]!==k||t[8]!==u.iconSize.md?(T=(0,xe.jsx)(f.FolderGit2,{size:u.iconSize.md,color:k}),t[7]=k,t[8]=u.iconSize.md,t[9]=T):T=t[9],t[10]!==p?(C=p("settings.projects"),t[10]=p,t[11]=C):C=t[11],t[12]!==v||t[13]!==C?(V=(0,xe.jsx)(n.Text,{style:v,numberOfLines:1,children:C}),t[12]=v,t[13]=C,t[14]=V):V=t[14],t[15]!==b||t[16]!==o||t[17]!==w||t[18]!==T||t[19]!==V?(I=(0,xe.jsxs)(l.Pressable,{accessibilityRole:"button",accessibilityState:b,onPress:o,testID:"settings-projects",style:w,children:[T,V]}),t[15]=b,t[16]=o,t[17]=w,t[18]=T,t[19]=V,t[20]=I):I=t[20],I}function Ne(e){const s=(0,c.c)(27),{activeServerId:o,sortedHosts:l,onSelectHost:p,onAddHost:h}=e,{t:b}=(0,y.useTranslation)(),[S,x]=(0,u.useState)(!1),f=(0,u.useRef)(null);let j;s[0]!==o||s[1]!==l?(j=l.find(e=>e.serverId===o)??l[0]??null,s[0]=o,s[1]=l,s[2]=j):j=s[2];const v=j;let k;s[3]===Symbol.for("react.memo_cache_sentinel")?(k=()=>x(!0),s[3]=k):k=s[3];const T=k,I=$e,H=qe,_=o??"";let L,P,z,A,D,B,M;return s[4]!==b?(L=b("settings.hostPicker.switchHost"),s[4]=b,s[5]=L):L=s[5],s[6]!==b?(P=b("settings.hostPicker.switchHost"),s[6]=b,s[7]=P):P=s[7],s[8]!==v?(z=v?(0,xe.jsx)(t.View,{style:Ze.pickerTriggerDot,children:(0,xe.jsx)(V.HostStatusDot,{serverId:v.serverId})}):null,s[8]=v,s[9]=z):z=s[9],s[10]!==v?.label||s[11]!==b?(A=v?.label??b("settings.groups.host"),s[10]=v?.label,s[11]=b,s[12]=A):A=s[12],s[13]!==A?(D=(0,xe.jsx)(n.Text,{style:Ze.pickerTriggerLabel,numberOfLines:1,children:A}),s[13]=A,s[14]=D):D=s[14],s[15]!==P||s[16]!==z||s[17]!==D?(B=(0,xe.jsxs)(w.ComboboxTrigger,{ref:f,block:!0,style:H,onPress:T,accessibilityRole:"button",accessibilityLabel:P,testID:"settings-host-picker",children:[z,D]}),s[15]=P,s[16]=z,s[17]=D,s[18]=B):B=s[18],s[19]!==S||s[20]!==h||s[21]!==p||s[22]!==l||s[23]!==_||s[24]!==L||s[25]!==B?(M=(0,xe.jsx)(C.HostPicker,{hosts:l,value:_,onSelect:p,open:S,onOpenChange:x,anchorRef:f,includeAddHost:!0,onAddHost:h,showActiveConnection:!0,searchable:!1,title:L,desktopMinWidth:240,addHostTestID:"settings-add-host",hostOptionTestID:I,children:B}),s[19]=S,s[20]=h,s[21]=p,s[22]=l,s[23]=_,s[24]=L,s[25]=B,s[26]=M):M=s[26],M}function qe(e){const{hovered:t}=e,s=void 0!==t&&t;return[Ze.pickerTrigger,s&&Ze.pickerTriggerHovered]}function $e(e){return`settings-host-picker-item-${e}`}function Qe(e){const s=(0,c.c)(50),{view:p,onSelectSection:h,onSelectHostSection:x,onSelectHost:j,onSelectProjects:v,onAddHost:w,onBackToWorkspace:C,activeHostServerId:V,layout:I}=e,{theme:H}=(0,S.useUnistyles)(),{t:_}=(0,y.useTranslation)(),L=We((0,R.useHosts)(),(0,pe.useLocalDaemonServerId)()),P=L.length>0,z=(0,se.isElectronRuntime)(),A=fe.filter(e=>!e.desktopOnly||z),D=(0,b.useSafeAreaInsets)(),B=(0,W.useWindowControlsPadding)("sidebar"),M="desktop"===I,O=M?Ze.desktopContainer:Ze.mobileContainer;let U;s[0]!==O?(U=[O],s[0]=O,s[1]=U):U=s[1];const F=U;let E,G,N;s[2]===Symbol.for("react.memo_cache_sentinel")?(E={flex:1},s[2]=E):E=s[2],s[3]!==D.top||s[4]!==M?(G=M?{paddingTop:D.top}:null,s[3]=D.top,s[4]=M,s[5]=G):G=s[5],s[6]!==G?(N=[E,G],s[6]=G,s[7]=N):N=s[7];const q=N,$="section"===p.kind?p.section:null,Q="host"===p.kind?p.section:null,J="projects"===p.kind||"project"===p.kind;let X;s[8]!==B.top?(X={height:B.top},s[8]=B.top,s[9]=X):X=s[9];const Y=X,Z=t.View,ee=Ze;let te,ne,ie;s[10]!==_?(te=_("settings.groups.app"),s[10]=_,s[11]=te):te=s[11],s[12]!==te?(ne=(0,xe.jsx)(n.Text,{style:Ze.groupLabel,children:te}),s[12]=te,s[13]=ne):ne=s[13],s[14]!==J||s[15]!==v||s[16]!==h||s[17]!==$||s[18]!==_?(ie=e=>(0,xe.jsxs)(u.Fragment,{children:[(0,xe.jsx)(Fe,{itemId:e.id,label:_(e.labelKey),icon:e.icon,isSelected:$===e.id,onSelect:h}),"general"===e.id?(0,xe.jsx)(Ge,{isSelected:J,onSelect:v}):null]},e.id),s[14]=J,s[15]=v,s[16]=h,s[17]=$,s[18]=_,s[19]=ie):ie=s[19];const oe=A.map(ie);let le,re,ae,ce;s[20]!==Z||s[21]!==oe||s[22]!==ee.list||s[23]!==ne?(le=(0,xe.jsxs)(Z,{style:ee.list,children:[ne,oe]}),s[20]=Z,s[21]=oe,s[22]=ee.list,s[23]=ne,s[24]=le):le=s[24],s[25]===Symbol.for("react.memo_cache_sentinel")?(re=(0,xe.jsx)(T.SidebarSeparator,{}),s[25]=re):re=s[25],s[26]!==V||s[27]!==P||s[28]!==w||s[29]!==j||s[30]!==x||s[31]!==Q||s[32]!==L||s[33]!==_||s[34]!==H?(ae=P?(0,xe.jsxs)(t.View,{style:Ze.list,children:[(0,xe.jsx)(n.Text,{style:Ze.groupLabel,children:_("settings.groups.host")}),(0,xe.jsx)(Ne,{activeServerId:V,sortedHosts:L,onSelectHost:j,onAddHost:w}),me.map(e=>(0,xe.jsx)(Ee,{itemId:e.id,label:_(e.labelKey),icon:e.icon,isSelected:Q===e.id,onSelect:x},e.id))]}):(0,xe.jsx)(t.View,{style:Ze.list,children:(0,xe.jsxs)(l.Pressable,{accessibilityRole:"button",accessibilityLabel:_("settings.addHost"),onPress:w,testID:"settings-add-host",style:we,children:[(0,xe.jsx)(f.Plus,{size:H.iconSize.md,color:H.colors.foregroundMuted}),(0,xe.jsx)(n.Text,{style:Ze.label,numberOfLines:1,children:_("settings.addHost")})]})}),s[26]=V,s[27]=P,s[28]=w,s[29]=j,s[30]=x,s[31]=Q,s[32]=L,s[33]=_,s[34]=H,s[35]=ae):ae=s[35],s[36]!==le||s[37]!==ae?(ce=(0,xe.jsxs)(xe.Fragment,{children:[le,re,ae]}),s[36]=le,s[37]=ae,s[38]=ce):ce=s[38];const de=ce;let ue,ge;return s[39]!==q||s[40]!==M||s[41]!==C||s[42]!==B.top||s[43]!==Y||s[44]!==de||s[45]!==_?(ue=M?(0,xe.jsxs)(t.View,{style:q,children:[(0,xe.jsxs)(t.View,{style:Ze.sidebarDragArea,children:[(0,xe.jsx)(K.TitlebarDragRegion,{}),B.top>0?(0,xe.jsx)(t.View,{style:Y}):null,(0,xe.jsx)(k.SidebarHeaderRow,{icon:f.ArrowLeft,label:_("settings.backToWorkspace"),onPress:C,testID:"settings-back-to-workspace"})]}),(0,xe.jsx)(o.ScrollView,{style:Ze.scrollBody,showsVerticalScrollIndicator:!1,children:de})]}):de,s[39]=q,s[40]=M,s[41]=C,s[42]=B.top,s[43]=Y,s[44]=de,s[45]=_,s[46]=ue):ue=s[46],s[47]!==F||s[48]!==ue?(ge=(0,xe.jsx)(t.View,{style:F,testID:"settings-sidebar",children:ue}),s[47]=F,s[48]=ue,s[49]=ge):ge=s[49],ge}function Je({view:e,openAddHostIntent:s=null}){const l=(0,h.useRouter)(),{theme:c}=(0,S.useUnistyles)(),{t:p}=(0,y.useTranslation)(),j=(0,re.useVoiceAudioEngineOptional)(),{settings:v,isLoading:w,updateSettings:k}=(0,P.useAppSettings)(),[T,C]=(0,u.useState)(!1),[V,_]=(0,u.useState)(!1),[z,A]=(0,u.useState)(!1),[D,B]=(0,u.useState)(!1),[M,O]=(0,u.useState)(null),U=(0,u.useRef)(null),K=(0,se.isElectronRuntime)(),W=(0,ie.resolveAppVersion)(),Q=(0,ne.formatVersionWithPrefix)(W),J=(0,ge.useIsCompactFormFactor)(),X=(0,b.useSafeAreaInsets)(),Y=(0,u.useMemo)(()=>({paddingBottom:X.bottom}),[X.bottom]),oe=(0,be.useWebScrollbarStyle)(),ae=(0,u.useMemo)(()=>[Xe.scrollView,oe],[oe]),ce=(0,R.useHosts)(),he=(0,pe.useLocalDaemonServerId)(),ve=We(ce,he),[we,ke]=(0,u.useState)("host"===e.kind?e.serverId:null),Te=(0,u.useMemo)(()=>we&&ce.some(e=>e.serverId===we)?we:null,[ce,we]);(0,u.useEffect)(()=>{"host"===e.kind&&ke(e.serverId)},[e]);const Ce=(0,u.useMemo)(()=>"host"===e.kind?e.serverId:Te??he??ve[0]?.serverId??null,[e,Te,he,ve]),Ve=(0,u.useCallback)(e=>{k({sendBehavior:e})},[k]),Ie=(0,u.useCallback)(e=>{k({fastOfflineMode:e})},[k]),He=(0,u.useCallback)(e=>{k({serviceUrlBehavior:e})},[k]),Le=(0,u.useCallback)(e=>{k({language:e})},[k]),Pe=(0,u.useCallback)(e=>{k({terminalScrollbackLines:e})},[k]),De=(0,u.useCallback)(async()=>{if(j&&!D){B(!0),O(null);try{const e=x.Buffer.from(le.THINKING_TONE_NATIVE_PCM_BASE64,"base64");await j.initialize(),j.stop(),await j.play({type:"audio/pcm;rate=16000;bits=16",size:e.byteLength,arrayBuffer:async()=>Uint8Array.from(e).buffer}),O(null)}catch(e){const t=e instanceof Error?e.message:String(e);console.error("[Settings] Playback test failed",e),O(p("settings.diagnostics.playbackFailed",{message:t}))}finally{B(!1)}}},[D,p,j]),Me=(0,u.useCallback)(()=>{C(!1),_(!1),A(!1)},[]),Re=(0,u.useCallback)(()=>{_(!1),A(!1),C(!0)},[]),Oe=(0,u.useCallback)(()=>{C(!0)},[]);(0,u.useEffect)(()=>{s&&U.current!==s&&(U.current=s,Oe())},[Oe,s]);const Ue=(0,u.useCallback)(()=>{C(!1),_(!0)},[]),Ke=(0,u.useCallback)(()=>{C(!1),A(!0)},[]),Fe=(0,u.useCallback)(({serverId:e})=>{const t=(0,Se.buildSettingsHostSectionRoute)(e,"connections");J?l.push(t):l.replace(t)},[J,l]),Ee=(0,u.useCallback)(e=>{const t=(0,Se.buildSettingsSectionRoute)(e);J?l.push(t):l.replace(t)},[J,l]),Ge=(0,u.useCallback)(t=>{if(ke(t),"host"!==e.kind)return;const s=e.section,n=(0,Se.buildSettingsHostSectionRoute)(t,s);J?l.push(n):l.replace(n)},[J,l,e]),Ne=(0,u.useCallback)(e=>{if(!Ce)return void Oe();const t=(0,Se.buildSettingsHostSectionRoute)(Ce,e);J?l.push(t):l.replace(t)},[Ce,Oe,J,l]),qe=(0,u.useCallback)(()=>{const e=(0,Se.buildProjectsSettingsRoute)();J?l.push(e):l.replace(e)},[J,l]),$e=(0,u.useCallback)(()=>{Me(),l.push({pathname:"/pair-scan",params:{source:"settings"}})},[Me,l]),Je=(0,u.useCallback)(()=>{const e=(0,Se.buildSettingsSectionRoute)("general");J?l.replace("/settings"):l.replace(e)},[J,l]),Ze=(0,u.useCallback)(()=>{l.canGoBack()?l.back():l.replace("/settings")},[l]),et=(0,u.useCallback)(()=>{(0,ye.navigateToLastWorkspace)()||l.replace((0,Se.buildOpenProjectRoute)())},[l]),tt=(()=>{if("host"===e.kind){const t=me.find(t=>t.id===e.section);return t?{title:p(t.labelKey),Icon:t.icon}:null}if("section"===e.kind){const t=fe.find(t=>t.id===e.section);return t?{title:p(t.labelKey),Icon:t.icon}:null}return"project"===e.kind||"projects"===e.kind?{title:p("settings.projects"),Icon:f.FolderGit2}:null})(),st=(()=>{if("host"===e.kind)return je(e,Je);if("projects"===e.kind)return(0,xe.jsx)(de.default,{view:e});if("project"===e.kind)return(0,xe.jsx)(ue.default,{projectKey:e.projectKey});if("section"===e.kind)switch(e.section){case"general":return(0,xe.jsx)(ze,{settings:v,isDesktopApp:K,handleSendBehaviorChange:Ve,handleServiceUrlBehaviorChange:He,handleLanguageChange:Le,handleTerminalScrollbackLinesChange:Pe,handleFastOfflineModeChange:Ie});case"daemon":return(0,xe.jsx)(te.LocalDaemonSection,{});case"appearance":return(0,xe.jsx)(L.AppearanceSection,{});case"shortcuts":return K?(0,xe.jsx)($.KeyboardShortcutsSection,{}):null;case"integrations":return K?(0,xe.jsx)(ee.IntegrationsSection,{}):null;case"permissions":return K?(0,xe.jsx)(Z.DesktopPermissionsSection,{}):null;case"diagnostics":return(0,xe.jsx)(Ae,{voiceAudioEngine:j,isPlaybackTestRunning:D,playbackTestResult:M,handlePlaybackTest:De,appVersion:W,isDesktopApp:K});case"about":return(0,xe.jsx)(Be,{appVersion:W,appVersionText:Q,isDesktopApp:K})}return null})();if(w)return(0,xe.jsx)(t.View,{style:Xe.loadingContainer,children:(0,xe.jsx)(n.Text,{style:Xe.loadingText,children:p("settings.loading")})});const nt=(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)(G.AddHostMethodModal,{visible:T,onClose:Me,onDirectConnection:Ue,onPasteLink:Ke,onScanQr:$e}),(0,xe.jsx)(N.AddHostModal,{visible:V,onClose:Me,onCancel:Re,onSaved:Fe}),(0,xe.jsx)(q.PairLinkModal,{visible:z,onClose:Me,onCancel:Re,onSaved:Fe})]});if(J&&"root"===e.kind)return(0,xe.jsxs)(t.View,{style:Xe.container,children:[(0,xe.jsx)(F.BackHeader,{title:p("settings.title"),onBack:et}),(0,xe.jsx)(o.ScrollView,{style:ae,contentContainerStyle:Y,children:(0,xe.jsx)(Qe,{view:e,onSelectSection:Ee,onSelectHostSection:Ne,onSelectHost:Ge,onSelectProjects:qe,onAddHost:Oe,onBackToWorkspace:et,activeHostServerId:Ce,layout:"mobile"})}),nt]});const it="project"===e.kind?et:Ze;return J?(0,xe.jsxs)(t.View,{style:Xe.container,children:[(0,xe.jsx)(F.BackHeader,{title:tt?.title,titleAccessory:tt?.titleAccessory,onBack:it}),(0,xe.jsx)(o.ScrollView,{style:ae,contentContainerStyle:Y,children:(0,xe.jsx)(t.View,{style:Xe.content,children:st})}),nt]}):(0,xe.jsxs)(t.View,{style:Xe.container,children:[(0,xe.jsxs)(t.View,{style:Ye.row,children:[(0,xe.jsx)(Qe,{view:e,onSelectSection:Ee,onSelectHostSection:Ne,onSelectHost:Ge,onSelectProjects:qe,onAddHost:Oe,onBackToWorkspace:et,activeHostServerId:Ce,layout:"desktop"}),(0,xe.jsxs)(t.View,{style:Ye.contentPane,children:[(0,xe.jsx)(E.ScreenHeader,{borderless:!tt,windowControlsPaddingRole:"detailHeader",left:tt?(0,xe.jsxs)(xe.Fragment,{children:[(0,xe.jsx)(H.HeaderIconBadge,{children:(0,xe.jsx)(tt.Icon,{size:c.iconSize.md,color:c.colors.foregroundMuted})}),(0,xe.jsx)(I.ScreenTitle,{testID:"settings-detail-header-title",children:tt.title}),tt.titleAccessory]}):null,leftStyle:Ye.detailLeft}),(0,xe.jsx)(o.ScrollView,{style:ae,contentContainerStyle:Y,children:(0,xe.jsx)(t.View,{style:Xe.content,children:st})})]})]}),nt]})}const Xe=S.StyleSheet.create(e=>({loadingContainer:{flex:1,backgroundColor:e.colors.surface0,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},loadingText:{color:e.colors.foreground,fontSize:e.fontSize.lg,uni__dependencies:[0]},container:{flex:1,backgroundColor:e.colors.surface0,uni__dependencies:[0]},scrollView:{flex:1},content:{padding:e.spacing[4],paddingTop:e.spacing[6],width:"100%",maxWidth:720,alignSelf:"center",uni__dependencies:[0]},aboutValue:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,uni__dependencies:[0]},aboutVersionMismatch:{color:e.colors.palette.amber[500],uni__dependencies:[0]},aboutErrorText:{color:e.colors.palette.red[300],fontSize:e.fontSize.xs,marginTop:e.spacing[1],uni__dependencies:[0]},aboutCommunity:{marginTop:e.spacing[4],uni__dependencies:[0]},aboutUpdateActions:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},themeTrigger:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],paddingVertical:e.spacing[1],paddingHorizontal:e.spacing[2],borderRadius:e.borderRadius.md,borderWidth:1,borderColor:e.colors.border,uni__dependencies:[0]},themeTriggerText:{color:e.colors.foreground,fontSize:e.fontSize.sm,uni__dependencies:[0]},terminalScrollbackInput:{width:112,minHeight:36,paddingVertical:e.spacing[2],paddingHorizontal:e.spacing[3],borderRadius:e.borderRadius.md,borderWidth:1,borderColor:e.colors.border,backgroundColor:e.colors.surface2,color:e.colors.foreground,fontSize:e.fontSize.sm,textAlign:"right",uni__dependencies:[0]},placeholder:{flex:1,alignItems:"center",justifyContent:"center",paddingVertical:e.spacing[8],uni__dependencies:[0]},placeholderText:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,uni__dependencies:[0]}})),Ye=S.StyleSheet.create(e=>({row:{flex:1,flexDirection:"row"},contentPane:{flex:1},detailLeft:{gap:e.spacing[2],uni__dependencies:[0]}})),Ze=S.StyleSheet.create(e=>({desktopContainer:{width:320,borderRightWidth:1,borderRightColor:e.colors.border,backgroundColor:e.colors.surfaceSidebar,uni__dependencies:[0]},scrollBody:{flex:1},sidebarDragArea:{position:"relative"},mobileContainer:{paddingVertical:e.spacing[2],paddingHorizontal:e.spacing[2],uni__dependencies:[0]},list:{paddingVertical:e.spacing[2],paddingHorizontal:e.spacing[2],gap:e.spacing[1],uni__dependencies:[0]},groupLabel:{fontSize:e.fontSize.sm,fontWeight:e.fontWeight.medium,color:e.colors.foregroundMuted,paddingHorizontal:e.spacing[2],paddingVertical:e.spacing[1],uni__dependencies:[0]},item:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],minHeight:36,paddingVertical:e.spacing[2],paddingHorizontal:e.spacing[2],borderRadius:e.borderRadius.lg,uni__dependencies:[0]},itemHovered:{backgroundColor:e.colors.surfaceSidebarHover,uni__dependencies:[0]},itemSelected:{backgroundColor:e.colors.surfaceSidebarHover,uni__dependencies:[0]},label:{fontSize:e.fontSize.base,color:e.colors.foregroundMuted,fontWeight:e.fontWeight.normal,flex:1,uni__dependencies:[0]},pickerTrigger:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],minHeight:36,paddingVertical:e.spacing[2],paddingHorizontal:e.spacing[2],borderRadius:e.borderRadius.lg,uni__dependencies:[0]},pickerTriggerHovered:{backgroundColor:e.colors.surfaceSidebarHover,uni__dependencies:[0]},pickerTriggerLabel:{flex:1,minWidth:0,fontSize:e.fontSize.base,color:e.colors.foreground,fontWeight:e.fontWeight.normal,uni__dependencies:[0]},pickerTriggerDot:{width:e.iconSize.md,height:e.iconSize.md,alignItems:"center",justifyContent:"center",uni__dependencies:[0]}}))},4722,[348,714,711,690,1572,349,36,1389,1308,182,234,715,146,1143,1320,56,1573,52,1600,3927,4723,3928,3569,4725,3454,3455,4408,4726,4727,4728,3575,1148,3678,4143,4731,3407,3271,3414,3397,3568,3607,4702,4407,4732,4733,4734,4735,3627,4656,4430,3572,4736,4740,4742,3404,4140,3401,3907,3998,3991,3579,4747,4760,4761,3457,3475,3497,3574,3477,3487,279]);
|
|
16482
|
+
__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.AppDiagnosticSheet=function({visible:l,onClose:c,appVersion:p,isDesktopApp:f}){const{t:R}=(0,u.useTranslation)(),H=(0,b.useToast)(),E=(0,S.useHosts)(),[O,B]=(0,o.useState)(null),[M,T]=(0,o.useState)(!1),[$,z]=(0,o.useState)([]),L=(0,o.useRef)(0),V=(0,o.useCallback)((e,s,t)=>{z(n=>n.find(s=>s.id===e)?n.map(n=>n.id===e?Object.assign({},n,{label:s,status:t}):n):[...n,{id:e,label:s,status:t}])},[]),N=(0,o.useCallback)(async()=>{const e=L.current+1;L.current=e;const s=()=>L.current===e,t=(e,t,n)=>{s()&&V(e,t,n)};T(!0),B(null),z([]);const n=[];try{if(t("client",R("settings.diagnostics.app.progress.client"),"running"),n.push((0,y.formatAppDiagnosticHeader)({appVersion:p,platform:"web",isDesktopApp:f,hostCount:E.length})),t("client",R("settings.diagnostics.app.progress.client"),"done"),f){const e=R("settings.diagnostics.app.progress.desktop");t("desktop",e,"running");const s=await C();n.push(...s.sections),t("desktop",e,s.status)}const e=(0,S.getHostRuntimeStore)();for(const s of E){const o=`host:${s.serverId}`;t(o,s.label,"running");const l=e.getSnapshot(s.serverId),c=await I(s,l);n.push(...c.sections),t(o,s.label,c.status)}s()&&B((0,y.redactAppDiagnosticReport)(n.join("\n\n"),E))}finally{s()&&T(!1)}},[p,E,f,R,V]);(0,o.useEffect)(()=>{l?N():(L.current+=1,T(!1),B(null),z([]))},[l,N]);const Z=(0,o.useCallback)(()=>{N()},[N]),F=(0,o.useCallback)(()=>{O&&n.setStringAsync(O).then(()=>H.copied(R("settings.diagnostics.app.copyLabel"))).catch(()=>H.error(R("settings.diagnostics.app.copyFailed")))},[O,R,H]),U=(0,o.useCallback)(({hovered:e,pressed:s})=>[A.iconButton,(Boolean(e)||s)&&A.iconButtonHovered],[]),q=(0,o.useCallback)(({hovered:e,pressed:s})=>[A.iconButton,(Boolean(e)||s)&&Boolean(O)&&A.iconButtonHovered,O?null:A.disabled],[O]),G=(0,o.useMemo)(()=>({title:R("settings.diagnostics.app.title"),actions:(0,D.jsxs)(e.View,{style:A.headerActions,children:[(0,D.jsx)(t.Pressable,{onPress:F,disabled:!O,hitSlop:8,style:q,accessibilityRole:"button",accessibilityLabel:R("settings.diagnostics.app.copyAccessibility"),children:(0,D.jsx)(_,{size:v.ICON_SIZE.sm,uniProps:k})}),(0,D.jsx)(t.Pressable,{onPress:Z,disabled:M,hitSlop:8,style:U,accessibilityRole:"button",accessibilityLabel:R(M?"settings.diagnostics.app.refreshingAccessibility":"settings.diagnostics.app.refreshAccessibility"),children:M?(0,D.jsx)(x,{size:v.ICON_SIZE.sm,uniProps:k}):(0,D.jsx)(j,{size:v.ICON_SIZE.sm,uniProps:k})})]})}),[O,q,F,Z,U,M,R]);return(0,D.jsx)(d.AdaptiveModalSheet,{header:G,visible:l,onClose:c,snapPoints:w,scrollable:!1,testID:"app-diagnostic-sheet",children:O?(0,D.jsx)(h.ScrollableCodeSurface,{maxHeight:520,children:O},l?"visible":"hidden"):(0,D.jsx)(h.SurfaceCard,{children:(0,D.jsx)(e.View,{style:A.progressContent,children:0===$.length?(0,D.jsxs)(e.View,{style:A.progressRow,children:[(0,D.jsx)(x,{size:v.ICON_SIZE.sm,uniProps:k}),(0,D.jsx)(s.Text,{style:A.mutedText,children:R("settings.diagnostics.app.running")})]}):$.map(t=>(0,D.jsxs)(e.View,{style:A.progressRow,children:["running"===t.status||"pending"===t.status?(0,D.jsx)(x,{size:v.ICON_SIZE.sm,uniProps:k}):(0,D.jsx)(e.View,{style:"failed"===t.status?A.statusDotFailed:A.statusDot}),(0,D.jsx)(s.Text,{style:A.mutedText,children:`${t.label}: ${P(t.status)}`})]},t.id))})},l?"visible":"hidden")})};var e=r(_d[0]),s=r(_d[1]),t=r(_d[2]),n=(function(e){if(e&&e.__esModule)return e;var s={};return e&&Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),s.default=e,s})(r(_d[3])),o=r(_d[4]);r(_d[5]),r(_d[6]),r(_d[7]),r(_d[8]);var l=r(_d[9]),c=r(_d[10]),u=r(_d[11]),d=r(_d[12]),p=r(_d[13]),h=r(_d[14]),b=r(_d[15]),f=r(_d[16]),y=r(_d[17]),S=r(_d[18]),v=r(_d[19]),D=r(_d[20]);const w=["55%","88%"],_=(0,c.withUnistyles)(l.Copy),j=(0,c.withUnistyles)(l.RotateCw),x=(0,c.withUnistyles)(p.LoadingSpinner),k=e=>({color:e.colors.foregroundMuted});async function C(){try{const[s,t]=await Promise.all([(0,f.getDesktopDaemonStatus)(),(0,f.getDesktopDaemonLogs)()]);return{status:"done",sections:[(0,y.formatDiagnosticSection)("Desktop",[{label:"Daemon status",value:s.status},{label:"Desktop managed",value:String(s.desktopManaged)},{label:"Daemon PID",value:null===s.pid?"none":String(s.pid)},{label:"Daemon version",value:s.version??"unknown"},{label:"Daemon home",value:s.home||"unknown"},{label:"Log path",value:t.logPath||"unknown"},{label:"Error",value:s.error??"none"}]),["Desktop daemon log tail",t.contents?(e=t.contents,e.split("\n").filter(Boolean).map(e=>` ${e}`).join("\n")):" No log lines found"].join("\n")]}}catch(e){return{status:"failed",sections:[(0,y.formatDiagnosticSection)("Desktop",[{label:"Error",value:R(e)}])]}}var e}async function I(e,s){const t=[(0,y.formatHostRuntimeSection)({host:e,snapshot:s})],n=s?.client??null;if("online"!==s?.connectionStatus||!n)return t.push((0,y.formatDiagnosticSection)(`Host diagnostics: ${e.label}`,[{label:"Status",value:"host is not connected"}])),{sections:t,status:"done"};try{const s=n.getLastServerInfoMessage();t.push((0,y.formatServerInfoSection)(s));const o=await n.measureLatency({timeoutMs:5e3});if(t.push((0,y.formatDiagnosticSection)(`Host latency: ${e.label}`,[{label:"Active RTT",value:`${Math.round(o)}ms`}])),!0===s?.features?.daemonDiagnostics){const e=await n.collectDiagnostics();t.push(e.diagnostic)}else t.push((0,y.formatDiagnosticSection)(`Daemon diagnostics: ${e.label}`,[{label:"Status",value:"unsupported by this daemon"}]));return{sections:t,status:"done"}}catch(s){return t.push((0,y.formatDiagnosticSection)(`Host diagnostics: ${e.label}`,[{label:"Error",value:R(s)}])),{sections:t,status:"failed"}}}function R(e){return e instanceof Error?e.message:String(e)}function P(e){switch(e){case"done":return"done";case"failed":return"failed";case"running":case"pending":return"running"}}const A=c.StyleSheet.create(e=>({progressContent:{paddingVertical:e.spacing[4],paddingHorizontal:e.spacing[4],gap:e.spacing[3],uni__dependencies:[0]},progressRow:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],minHeight:24,uni__dependencies:[0]},mutedText:{flex:1,fontSize:e.fontSize.sm,color:e.colors.foregroundMuted,uni__dependencies:[0]},headerActions:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],uni__dependencies:[0]},iconButton:{width:28,height:28,borderRadius:e.borderRadius.full,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},iconButtonHovered:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},disabled:{opacity:.5},statusDot:{width:8,height:8,borderRadius:e.borderRadius.full,backgroundColor:e.colors.success,uni__dependencies:[0]},statusDotFailed:{width:8,height:8,borderRadius:e.borderRadius.full,backgroundColor:e.colors.destructive,uni__dependencies:[0]}}))},4723,[348,711,1572,3628,36,25,1308,234,146,1600,56,1573,3466,3564,3902,3499,3403,4724,3271,305,279]);
|
|
16483
|
+
__d(function(g,r,i,a,m,e,d){"use strict";function t(t,n){return[t,...n.map(t=>` ${t.label}: ${t.value}`)].join("\n")}function n(t){switch(t){case"directTcp":return"direct TCP";case"directSocket":return"local socket";case"directPipe":return"local pipe";case"relay":return"relay";default:return"unknown"}}function o(t){const n=new Set;for(const o of t)for(const t of o.connections)n.add(t.id),"directTcp"===t.type?(n.add(t.endpoint),t.password&&n.add(t.password)):"relay"===t.type?(n.add(t.relayEndpoint),n.add(t.daemonPublicKeyB64)):"directSocket"!==t.type&&"directPipe"!==t.type||n.add(t.path);return[...n].filter(t=>t.trim().length>0)}Object.defineProperty(e,'__esModule',{value:!0}),e.formatDiagnosticSection=t,e.formatAppDiagnosticHeader=function(n){return t("Paseo app diagnostics",[{label:"Collected at",value:(new Date).toISOString()},{label:"App version",value:n.appVersion??"unknown"},{label:"Platform",value:n.platform},{label:"Desktop app",value:String(n.isDesktopApp)},{label:"Saved hosts",value:String(n.hostCount)}])},e.formatHostRuntimeSection=function(o){const{host:l,snapshot:c}=o,s=[{label:"Server ID",value:l.serverId},{label:"Status",value:c?.connectionStatus??"not started"},{label:"Active connection",value:c?.activeConnection?n(c.activeConnection.type):"none"},{label:"Last online",value:c?.lastOnlineAt??"never"},{label:"Last error",value:c?.lastError??"none"},{label:"Agent directory",value:c?.agentDirectoryStatus??"unknown"}],u=l.connections.map((t,o)=>{const l=c?.probeByConnectionId.get(t.id)??null,s=c?.activeConnectionId===t.id;return{label:`Connection ${o+1}`,value:[n(t.type),s?"active":"inactive",l?`probe=${l.status}`:"probe=unknown","available"===l?.status?`latency=${Math.round(l.latencyMs)}ms`:null].filter(Boolean).join(", ")}});return t(`Host: ${l.label}`,[...s,...u])},e.formatServerInfoSection=function(n){if(!n)return t("Server info",[{label:"Status",value:"not received"}]);const o=n.features?Object.keys(n.features).sort():[];return t("Server info",[{label:"Server ID",value:n.serverId},{label:"Hostname",value:n.hostname??"unknown"},{label:"Version",value:n.version??"unknown"},{label:"Features",value:o.length>0?o.join(", "):"none"}])},e.describeConnectionKind=n,e.redactAppDiagnosticReport=function(t,n){let l=t;for(const t of o(n))l=l.split(t).join("[redacted]");return l.replace(/paseo:\/\/\S+/gi,"paseo://[redacted]").replace(/([?&](?:password|token|secret|key|publicKey|daemonPublicKeyB64)=)[^&\s"']+/gi,"$1[redacted]").replace(/((?:password|token|secret|authorization|api[_-]?key|daemonPublicKeyB64|relayKey)\s*[:=]\s*)("[^"]+"|'[^']+'|[^\s,}]+)/gi,"$1[redacted]")}},4724,[]);
|
|
16484
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.SidebarSeparator=function(){const n=(0,o.c)(1);let s;n[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,c.jsx)(t.View,{style:l.line}),n[0]=s):s=n[0];return s};var t=r(d[0]),o=r(d[1]);r(d[2]);var n=r(d[3]),c=r(d[4]);const l=n.StyleSheet.create(t=>({line:{borderBottomWidth:1,borderBottomColor:t.colors.border,uni__dependencies:[0]}}))},4725,[348,349,146,56,279]);
|
|
16485
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.HeaderIconBadge=function(o){const s=(0,n.c)(2),{children:u}=o;let _;s[0]!==u?(_=(0,l.jsx)(t.View,{style:c.headerIconSlotStyle.slot,children:u}),s[0]=u,s[1]=_):_=s[1];return _};var t=r(d[0]),n=r(d[1]);r(d[2]);var c=r(d[3]),l=r(d[4])},4726,[348,349,146,4409,279]);
|
|
16486
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.SettingsSection=function(c){const h=(0,s.c)(15),{title:p,trailing:y,testID:f,style:_,flush:j,children:x}=c,S=j?u.flush:null;let w;h[0]!==_||h[1]!==S?(w=[l.settingsStyles.section,S,_],h[0]=_,h[1]=S,h[2]=w):w=h[2];const v=w;let D,I,V,b;h[3]!==p?(D=(0,o.jsx)(n.Text,{style:l.settingsStyles.sectionHeaderTitle,children:p}),h[3]=p,h[4]=D):D=h[4];h[5]!==D||h[6]!==y?(I=(0,o.jsxs)(t.View,{style:u.header,children:[D,y]}),h[5]=D,h[6]=y,h[7]=I):I=h[7];h[8]!==x?(V=(0,o.jsx)(t.View,{style:u.content,children:x}),h[8]=x,h[9]=V):V=h[9];h[10]!==v||h[11]!==I||h[12]!==V||h[13]!==f?(b=(0,o.jsxs)(t.View,{style:v,testID:f,children:[I,V]}),h[10]=v,h[11]=I,h[12]=V,h[13]=f,h[14]=b):b=h[14];return b};var t=r(d[0]),n=r(d[1]),s=r(d[2]);r(d[3]),r(d[4]),r(d[5]);var c=r(d[6]),l=r(d[7]),o=r(d[8]);const u=c.StyleSheet.create(t=>({header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:t.spacing[2],marginBottom:t.spacing[3],marginLeft:t.spacing[1],uni__dependencies:[0]},content:{gap:t.spacing[3],uni__dependencies:[0]},flush:{marginBottom:0}}))},4727,[348,711,349,36,234,146,56,3907,279]);
|
|
16487
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.AppearanceSection=function(){const n=(0,s.c)(98),{t:o}=(0,c.useTranslation)(),{settings:u,updateSettings:h}=(0,x.useAppSettings)(),p=!F.isNative;let y;n[0]!==o?(y=N(o,f.DEFAULT_UI_FONT_STACK),n[0]=o,n[1]=y):y=n[1];const C=y;let j;n[2]!==o?(j=N(o,f.DEFAULT_MONO_FONT_STACK),n[2]=o,n[3]=j):j=n[3];const T=j,[z,I]=(0,l.useState)(u.uiFontFamily),[E,V]=(0,l.useState)(u.monoFontFamily),[D,M]=(0,l.useState)(String(u.uiFontSize)),[v,A]=(0,l.useState)(String(u.codeFontSize));let H,W,P,B,X;n[4]!==u.uiFontSize?(H=()=>{M(String(u.uiFontSize))},W=[u.uiFontSize],n[4]=u.uiFontSize,n[5]=H,n[6]=W):(H=n[5],W=n[6]);(0,l.useEffect)(H,W),n[7]!==u.codeFontSize?(P=()=>{A(String(u.codeFontSize))},B=[u.codeFontSize],n[7]=u.codeFontSize,n[8]=P,n[9]=B):(P=n[8],B=n[9]);(0,l.useEffect)(P,B),n[10]!==h?(X=t=>{h({theme:t})},n[10]=h,n[11]=X):X=n[11];const K=X;let Y;n[12]!==h?(Y=t=>{h({syntaxTheme:t})},n[12]=h,n[13]=Y):Y=n[13];const G=Y;let q;n[14]!==u.uiFontFamily||n[15]!==h?(q=t=>{const n=(0,x.sanitizeFontFamily)(t);null!==n?(I(n),n!==u.uiFontFamily&&h({uiFontFamily:n})):I(u.uiFontFamily)},n[14]=u.uiFontFamily,n[15]=h,n[16]=q):q=n[16];const J=q;let Q;n[17]!==u.monoFontFamily||n[18]!==h?(Q=t=>{const n=(0,x.sanitizeFontFamily)(t);null!==n?(V(n),n!==u.monoFontFamily&&h({monoFontFamily:n})):V(u.monoFontFamily)},n[17]=u.monoFontFamily,n[18]=h,n[19]=Q):Q=n[19];const $=Q;let ee;n[20]===Symbol.for("react.memo_cache_sentinel")?(ee=t=>{M(t.replace(/[^\d]/g,""))},n[20]=ee):ee=n[20];const te=ee;let ne;n[21]===Symbol.for("react.memo_cache_sentinel")?(ne=t=>{A(t.replace(/[^\d]/g,""))},n[21]=ne):ne=n[21];const ie=ne;let oe;n[22]!==u.uiFontSize||n[23]!==D||n[24]!==h?(oe=()=>{const t=(0,x.parseClampedFontSize)(D,{min:x.MIN_UI_FONT_SIZE,max:x.MAX_UI_FONT_SIZE})??u.uiFontSize;M(String(t)),t!==u.uiFontSize&&h({uiFontSize:t})},n[22]=u.uiFontSize,n[23]=D,n[24]=h,n[25]=oe):oe=n[25];const se=oe;let re;n[26]!==v||n[27]!==u.codeFontSize||n[28]!==h?(re=()=>{const t=(0,x.parseClampedFontSize)(v,{min:x.MIN_CODE_FONT_SIZE,max:x.MAX_CODE_FONT_SIZE})??u.codeFontSize;A(String(t)),t!==u.codeFontSize&&h({codeFontSize:t})},n[26]=v,n[27]=u.codeFontSize,n[28]=h,n[29]=re):re=n[29];const le=re;let ae,ce;n[30]!==v?(ae=O(v),n[30]=v,n[31]=ae):ae=n[31];n[32]!==E||n[33]!==ae?(ce={monoFontFamily:E,codeFontSize:ae},n[32]=E,n[33]=ae,n[34]=ce):ce=n[34];const de=ce;let ue,he,ge,pe,me,ye,Se,xe,fe,Fe,be,_e,we,Ce,je,Te,ze,Ie,Ee;n[35]!==o?(ue=o("settings.appearance.theme.title"),n[35]=o,n[36]=ue):ue=n[36];n[37]!==K||n[38]!==u.theme?(he=(0,w.jsx)(t.View,{style:b.settingsStyles.card,children:(0,w.jsx)(L,{value:u.theme,onChange:K})}),n[37]=K,n[38]=u.theme,n[39]=he):he=n[39];n[40]!==ue||n[41]!==he?(ge=(0,w.jsx)(S.SettingsSection,{title:ue,children:he}),n[40]=ue,n[41]=he,n[42]=ge):ge=n[42];n[43]!==o?(pe=o("settings.appearance.fonts.title"),n[43]=o,n[44]=pe):pe=n[44];n[45]!==J||n[46]!==u.uiFontFamily||n[47]!==o||n[48]!==z||n[49]!==C?(me=p?(0,w.jsx)(Z,{title:o("settings.appearance.fonts.interfaceFont"),hint:o("settings.appearance.fonts.interfaceFontHint"),accessibilityLabel:o("settings.appearance.fonts.interfaceFontAccessibility"),placeholder:C,value:u.uiFontFamily,draft:z,withBorder:!1,onChangeDraft:I,onCommit:J}):null,n[45]=J,n[46]=u.uiFontFamily,n[47]=o,n[48]=z,n[49]=C,n[50]=me):me=n[50];n[51]!==o?(ye=o("settings.appearance.fonts.interfaceSize"),n[51]=o,n[52]=ye):ye=n[52];n[53]!==o?(Se=o("settings.appearance.fonts.interfaceSizeAccessibility"),n[53]=o,n[54]=Se):Se=n[54];n[55]!==se||n[56]!==ye||n[57]!==Se||n[58]!==D?(xe=(0,w.jsx)(k,{title:ye,accessibilityLabel:Se,draft:D,withBorder:p,onChangeDraft:te,onCommit:se}),n[55]=se,n[56]=ye,n[57]=Se,n[58]=D,n[59]=xe):xe=n[59];n[60]!==$||n[61]!==E||n[62]!==T||n[63]!==u.monoFontFamily||n[64]!==o?(fe=p?(0,w.jsx)(Z,{title:o("settings.appearance.fonts.codeFont"),hint:o("settings.appearance.fonts.codeFontHint"),accessibilityLabel:o("settings.appearance.fonts.codeFontAccessibility"),placeholder:T,value:u.monoFontFamily,draft:E,withBorder:!0,onChangeDraft:V,onCommit:$}):null,n[60]=$,n[61]=E,n[62]=T,n[63]=u.monoFontFamily,n[64]=o,n[65]=fe):fe=n[65];n[66]!==o?(Fe=o("settings.appearance.fonts.codeSize"),n[66]=o,n[67]=Fe):Fe=n[67];n[68]!==o?(be=o("settings.appearance.fonts.codeSizeAccessibility"),n[68]=o,n[69]=be):be=n[69];n[70]!==v||n[71]!==le||n[72]!==Fe||n[73]!==be?(_e=(0,w.jsx)(k,{title:Fe,accessibilityLabel:be,draft:v,onChangeDraft:ie,onCommit:le}),n[70]=v,n[71]=le,n[72]=Fe,n[73]=be,n[74]=_e):_e=n[74];n[75]!==me||n[76]!==xe||n[77]!==fe||n[78]!==_e?(we=(0,w.jsxs)(t.View,{style:b.settingsStyles.card,children:[me,xe,fe,_e]}),n[75]=me,n[76]=xe,n[77]=fe,n[78]=_e,n[79]=we):we=n[79];n[80]!==pe||n[81]!==we?(Ce=(0,w.jsx)(S.SettingsSection,{title:pe,children:we}),n[80]=pe,n[81]=we,n[82]=Ce):Ce=n[82];n[83]!==o?(je=o("settings.appearance.syntax.title"),n[83]=o,n[84]=je):je=n[84];n[85]!==G||n[86]!==u.syntaxTheme?(Te=(0,w.jsx)(t.View,{style:b.settingsStyles.card,children:(0,w.jsx)(U,{value:u.syntaxTheme,onChange:G})}),n[85]=G,n[86]=u.syntaxTheme,n[87]=Te):Te=n[87];n[88]!==de?(ze=(0,w.jsx)(t.View,{style:R.preview,children:(0,w.jsx)(_.AppearancePreview,{overrides:de})}),n[88]=de,n[89]=ze):ze=n[89];n[90]!==je||n[91]!==Te||n[92]!==ze?(Ie=(0,w.jsxs)(S.SettingsSection,{title:je,children:[Te,ze]}),n[90]=je,n[91]=Te,n[92]=ze,n[93]=Ie):Ie=n[93];n[94]!==ge||n[95]!==Ce||n[96]!==Ie?(Ee=(0,w.jsxs)(t.View,{children:[ge,Ce,Ie]}),n[94]=ge,n[95]=Ce,n[96]=Ie,n[97]=Ee):Ee=n[97];return Ee};var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),l=r(d[4]),c=r(d[5]);r(d[6]),r(d[7]),r(d[8]);var u=r(d[9]),h=r(d[10]),p=r(d[11]),y=r(d[12]),S=r(d[13]),x=r(d[14]),f=r(d[15]),F=r(d[16]),b=r(d[17]),_=r(d[18]),w=r(d[19]);const C=(0,u.withUnistyles)(h.Sun),j=(0,u.withUnistyles)(h.Moon),T=(0,u.withUnistyles)(h.Monitor),z=(0,u.withUnistyles)(h.ChevronDown),I=t=>({color:t.colors.foregroundMuted});function E(t,n){return t({light:"settings.appearance.theme.options.light",dark:"settings.appearance.theme.options.dark",zinc:"settings.appearance.theme.options.zinc",midnight:"settings.appearance.theme.options.midnight",claude:"settings.appearance.theme.options.claude",ghostty:"settings.appearance.theme.options.ghostty",auto:"settings.appearance.theme.options.auto"}[n])}const V=["light","dark","auto"],D=["zinc","midnight","claude","ghostty"],M=new Set(["normal","monospace"]);function N(t,n){return M.has(n)?t("settings.appearance.fonts.systemDefault"):n}function O(t){if(0===t.length)return;const n=Number.parseInt(t,10);return Number.isFinite(n)?n:void 0}function v({pressed:t}){return[R.trigger,t?R.triggerPressed:null]}function A(t){const n=(0,s.c)(5),{themeValue:o}=t;switch(o){case"light":{let t;return n[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,w.jsx)(C,{size:f.ICON_SIZE.md,uniProps:I}),n[0]=t):t=n[0],t}case"dark":{let t;return n[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,w.jsx)(j,{size:f.ICON_SIZE.md,uniProps:I}),n[1]=t):t=n[1],t}case"auto":{let t;return n[2]===Symbol.for("react.memo_cache_sentinel")?(t=(0,w.jsx)(T,{size:f.ICON_SIZE.md,uniProps:I}),n[2]=t):t=n[2],t}default:{const t=f.THEME_SWATCHES[o];let s;return n[3]!==t?(s=(0,w.jsx)(H,{color:t}),n[3]=t,n[4]=s):s=n[4],s}}}function H(n){const o=(0,s.c)(4),{color:l}=n;let c;o[0]!==l?(c=[R.swatch,{backgroundColor:l}],o[0]=l,o[1]=c):c=o[1];const u=c;let h;return o[2]!==u?(h=(0,w.jsx)(t.View,{style:u}),o[2]=u,o[3]=h):h=o[3],h}function W(t){const n=(0,s.c)(13),{themeValue:o,selected:l,onChange:u}=t,{t:h}=(0,c.useTranslation)();let p;n[0]!==u||n[1]!==o?(p=()=>{u(o)},n[0]=u,n[1]=o,n[2]=p):p=n[2];const S=p;let x;n[3]!==o?(x=(0,w.jsx)(A,{themeValue:o}),n[3]=o,n[4]=x):x=n[4];const f=x;let F,b;return n[5]!==h||n[6]!==o?(F=E(h,o),n[5]=h,n[6]=o,n[7]=F):F=n[7],n[8]!==S||n[9]!==f||n[10]!==l||n[11]!==F?(b=(0,w.jsx)(y.DropdownMenuItem,{selected:l,onSelect:S,leading:f,children:F}),n[8]=S,n[9]=f,n[10]=l,n[11]=F,n[12]=b):b=n[12],b}function L(n){const l=(0,s.c)(44),{value:u,onChange:h}=n,{t:p}=(0,c.useTranslation)();let S,x,F,_,C,j,T,M,N,O,H,L,Z,k,P,B,U,X;if(l[0]!==p||l[1]!==u){let n;_=E(p,u),F=t.View,T=b.settingsStyles.row,l[10]!==p?(n=p("settings.appearance.theme.title"),l[10]=p,l[11]=n):n=l[11],l[12]!==n?(M=(0,w.jsx)(t.View,{style:b.settingsStyles.rowContent,children:(0,w.jsx)(o.Text,{style:b.settingsStyles.rowTitle,children:n})}),l[12]=n,l[13]=M):M=l[13],x=y.DropdownMenu,S=y.DropdownMenuTrigger,C=v,j=p("settings.appearance.theme.accessibilityLabel",{value:_}),l[0]=p,l[1]=u,l[2]=S,l[3]=x,l[4]=F,l[5]=_,l[6]=C,l[7]=j,l[8]=T,l[9]=M}else S=l[2],x=l[3],F=l[4],_=l[5],C=l[6],j=l[7],T=l[8],M=l[9];return l[14]!==u?(N=(0,w.jsx)(A,{themeValue:u}),l[14]=u,l[15]=N):N=l[15],l[16]!==_?(O=(0,w.jsx)(o.Text,{style:R.triggerText,children:_}),l[16]=_,l[17]=O):O=l[17],l[18]===Symbol.for("react.memo_cache_sentinel")?(H=(0,w.jsx)(z,{size:f.ICON_SIZE.sm,uniProps:I}),l[18]=H):H=l[18],l[19]!==S||l[20]!==C||l[21]!==j||l[22]!==N||l[23]!==O?(L=(0,w.jsxs)(S,{style:C,accessibilityLabel:j,children:[N,O,H]}),l[19]=S,l[20]=C,l[21]=j,l[22]=N,l[23]=O,l[24]=L):L=l[24],l[25]!==h||l[26]!==u?(Z=V.map(t=>(0,w.jsx)(W,{themeValue:t,selected:u===t,onChange:h},t)),l[25]=h,l[26]=u,l[27]=Z):Z=l[27],l[28]===Symbol.for("react.memo_cache_sentinel")?(k=(0,w.jsx)(y.DropdownMenuSeparator,{}),l[28]=k):k=l[28],l[29]!==h||l[30]!==u?(P=D.map(t=>(0,w.jsx)(W,{themeValue:t,selected:u===t,onChange:h},t)),l[29]=h,l[30]=u,l[31]=P):P=l[31],l[32]!==P||l[33]!==Z?(B=(0,w.jsxs)(y.DropdownMenuContent,{side:"bottom",align:"end",width:200,children:[Z,k,P]}),l[32]=P,l[33]=Z,l[34]=B):B=l[34],l[35]!==x||l[36]!==B||l[37]!==L?(U=(0,w.jsxs)(x,{children:[L,B]}),l[35]=x,l[36]=B,l[37]=L,l[38]=U):U=l[38],l[39]!==F||l[40]!==U||l[41]!==T||l[42]!==M?(X=(0,w.jsxs)(F,{style:T,children:[M,U]}),l[39]=F,l[40]=U,l[41]=T,l[42]=M,l[43]=X):X=l[43],X}function Z({title:s,hint:c,accessibilityLabel:u,placeholder:h,value:p,draft:y,withBorder:S,onChangeDraft:x,onCommit:f}){const F=(0,l.useCallback)(()=>{f(y)},[y,f]);return(0,l.useEffect)(()=>{x(p)},[p]),(0,w.jsxs)(t.View,{style:S?R.rowWithBorder:b.settingsStyles.row,children:[(0,w.jsxs)(t.View,{style:b.settingsStyles.rowContent,children:[(0,w.jsx)(o.Text,{style:b.settingsStyles.rowTitle,children:s}),(0,w.jsx)(o.Text,{style:b.settingsStyles.rowHint,children:c})]}),(0,w.jsx)(n.TextInput,{value:y,onChangeText:x,onBlur:F,onSubmitEditing:F,placeholder:h,placeholderTextColor:R.placeholderColor.color,autoCapitalize:"none",autoCorrect:!1,spellCheck:!1,style:R.fontFamilyInput,accessibilityLabel:u})]})}function k(l){const c=(0,s.c)(14),{title:u,accessibilityLabel:h,draft:p,withBorder:y,onChangeDraft:S,onCommit:x}=l,f=void 0===y||y?R.rowWithBorder:b.settingsStyles.row;let F,_,C,j,T;return c[0]!==u?(F=(0,w.jsx)(t.View,{style:b.settingsStyles.rowContent,children:(0,w.jsx)(o.Text,{style:b.settingsStyles.rowTitle,children:u})}),c[0]=u,c[1]=F):F=c[1],c[2]!==h||c[3]!==p||c[4]!==S||c[5]!==x?(_=(0,w.jsx)(n.TextInput,{value:p,onChangeText:S,onBlur:x,onSubmitEditing:x,keyboardType:"number-pad",inputMode:"numeric",selectTextOnFocus:!0,style:R.sizeInput,accessibilityLabel:h}),c[2]=h,c[3]=p,c[4]=S,c[5]=x,c[6]=_):_=c[6],c[7]===Symbol.for("react.memo_cache_sentinel")?(C=(0,w.jsx)(o.Text,{style:R.unit,children:"px"}),c[7]=C):C=c[7],c[8]!==_?(j=(0,w.jsxs)(t.View,{style:R.sizeField,children:[_,C]}),c[8]=_,c[9]=j):j=c[9],c[10]!==f||c[11]!==F||c[12]!==j?(T=(0,w.jsxs)(t.View,{style:f,children:[F,j]}),c[10]=f,c[11]=F,c[12]=j,c[13]=T):T=c[13],T}function P(t){const n=p.SYNTAX_THEME_OPTIONS.find(n=>n.id===t);return n?n.label:t}function B(t){const n=(0,s.c)(7),{option:o,selected:l,onChange:c}=t;let u;n[0]!==c||n[1]!==o.id?(u=()=>{c(o.id)},n[0]=c,n[1]=o.id,n[2]=u):u=n[2];const h=u;let p;return n[3]!==h||n[4]!==o.label||n[5]!==l?(p=(0,w.jsx)(y.DropdownMenuItem,{selected:l,onSelect:h,children:o.label}),n[3]=h,n[4]=o.label,n[5]=l,n[6]=p):p=n[6],p}function U(n){const l=(0,s.c)(43),{value:u,onChange:h}=n,{t:S}=(0,c.useTranslation)();let x,F,_,C,j,T,E,V,D,M,N,O,A,H,W;if(l[0]!==S||l[1]!==u){let n,s,c,h;C=P(u),_=t.View,E=b.settingsStyles.row,l[10]!==S?(n=S("settings.appearance.syntax.highlightTheme"),l[10]=S,l[11]=n):n=l[11],l[12]!==n?(s=(0,w.jsx)(o.Text,{style:b.settingsStyles.rowTitle,children:n}),l[12]=n,l[13]=s):s=l[13],l[14]!==S?(c=S("settings.appearance.syntax.highlightThemeHint"),l[14]=S,l[15]=c):c=l[15],l[16]!==c?(h=(0,w.jsx)(o.Text,{style:b.settingsStyles.rowHint,children:c}),l[16]=c,l[17]=h):h=l[17],l[18]!==s||l[19]!==h?(V=(0,w.jsxs)(t.View,{style:b.settingsStyles.rowContent,children:[s,h]}),l[18]=s,l[19]=h,l[20]=V):V=l[20],F=y.DropdownMenu,x=y.DropdownMenuTrigger,j=v,T=S("settings.appearance.syntax.highlightThemeAccessibility",{value:C}),l[0]=S,l[1]=u,l[2]=x,l[3]=F,l[4]=_,l[5]=C,l[6]=j,l[7]=T,l[8]=E,l[9]=V}else x=l[2],F=l[3],_=l[4],C=l[5],j=l[6],T=l[7],E=l[8],V=l[9];return l[21]!==C?(D=(0,w.jsx)(o.Text,{style:R.triggerText,children:C}),l[21]=C,l[22]=D):D=l[22],l[23]===Symbol.for("react.memo_cache_sentinel")?(M=(0,w.jsx)(z,{size:f.ICON_SIZE.sm,uniProps:I}),l[23]=M):M=l[23],l[24]!==x||l[25]!==j||l[26]!==T||l[27]!==D?(N=(0,w.jsxs)(x,{style:j,accessibilityLabel:T,children:[D,M]}),l[24]=x,l[25]=j,l[26]=T,l[27]=D,l[28]=N):N=l[28],l[29]!==h||l[30]!==u?(O=p.SYNTAX_THEME_OPTIONS.map(t=>(0,w.jsx)(B,{option:t,selected:u===t.id,onChange:h},t.id)),l[29]=h,l[30]=u,l[31]=O):O=l[31],l[32]!==O?(A=(0,w.jsx)(y.DropdownMenuContent,{side:"bottom",align:"end",width:200,children:O}),l[32]=O,l[33]=A):A=l[33],l[34]!==F||l[35]!==N||l[36]!==A?(H=(0,w.jsxs)(F,{children:[N,A]}),l[34]=F,l[35]=N,l[36]=A,l[37]=H):H=l[37],l[38]!==_||l[39]!==H||l[40]!==E||l[41]!==V?(W=(0,w.jsxs)(_,{style:E,children:[V,H]}),l[38]=_,l[39]=H,l[40]=E,l[41]=V,l[42]=W):W=l[42],W}const R=u.StyleSheet.create(t=>({preview:{marginTop:t.spacing[4],uni__dependencies:[0]},rowWithBorder:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:t.spacing[4],paddingHorizontal:t.spacing[4],borderTopWidth:t.borderWidth[1],borderTopColor:t.colors.border,uni__dependencies:[0]},trigger:{flexDirection:"row",alignItems:"center",gap:t.spacing[1],paddingVertical:t.spacing[1],paddingHorizontal:t.spacing[2],borderRadius:t.borderRadius.md,borderWidth:t.borderWidth[1],borderColor:t.colors.border,uni__dependencies:[0]},triggerPressed:{opacity:.85},triggerText:{color:t.colors.foreground,fontSize:t.fontSize.sm,uni__dependencies:[0]},swatch:{width:f.ICON_SIZE.md,height:f.ICON_SIZE.md,borderRadius:f.ICON_SIZE.md/2,borderWidth:t.borderWidth[1],borderColor:t.colors.border,uni__dependencies:[0]},fontFamilyInput:{flexGrow:1,flexShrink:1,maxWidth:280,minHeight:36,paddingVertical:t.spacing[2],paddingHorizontal:t.spacing[3],borderRadius:t.borderRadius.md,borderWidth:t.borderWidth[1],borderColor:t.colors.border,backgroundColor:t.colors.surface2,color:t.colors.foreground,fontSize:t.fontSize.sm,textAlign:"left",uni__dependencies:[0]},sizeField:{flexDirection:"row",alignItems:"center",gap:t.spacing[2],uni__dependencies:[0]},sizeInput:{width:64,minHeight:36,paddingVertical:t.spacing[2],paddingHorizontal:t.spacing[3],borderRadius:t.borderRadius.md,borderWidth:t.borderWidth[1],borderColor:t.colors.border,backgroundColor:t.colors.surface2,color:t.colors.foreground,fontSize:t.fontSize.sm,textAlign:"right",uni__dependencies:[0]},unit:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,uni__dependencies:[0]},placeholderColor:{color:t.colors.foregroundMuted,uni__dependencies:[0]}}))},4728,[348,714,711,349,36,1573,234,715,146,56,1600,306,3572,4727,3575,305,3407,3907,4729,279]);
|
|
16488
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.AppearancePreview=function(c){const s=(0,t.c)(15),{overrides:f}=c,{t:_}=(0,l.useTranslation)();let y;s[0]===Symbol.for("react.memo_cache_sentinel")?(y=S(),s[0]=y):y=s[0];const p=y;let E;s[1]!==f?(E=R(f),s[1]=f,s[2]=E):E=s[2];const h=E;let k;s[3]!==h?(k=[w.codeLine,h],s[3]=h,s[4]=k):k=s[4];const v=k;let x;s[5]===Symbol.for("react.memo_cache_sentinel")?(x=[w.row,w.addRow],s[5]=x):x=s[5];const A=x;let C;s[6]===Symbol.for("react.memo_cache_sentinel")?(C=[w.row,w.removeRow],s[6]=C):C=s[6];const O=C;let W;s[7]===Symbol.for("react.memo_cache_sentinel")?(W=function(o){return"add"===o?A:"remove"===o?O:w.row},s[7]=W):W=s[7];const j=W;let I,V,P;s[8]!==_?(I=_("settings.appearance.syntax.previewAccessibility"),s[8]=_,s[9]=I):I=s[9];s[10]!==v?(V=p.map(t=>(0,b.jsx)(o.View,{style:j(t.type),children:(0,b.jsxs)(n.Text,{style:v,children:[(0,b.jsx)(n.Text,{style:F(t.type),children:t.marker}),t.tokens?t.tokens.map(T):t.fallbackText]})},t.key)),s[10]=v,s[11]=V):V=s[11];s[12]!==I||s[13]!==V?(P=(0,b.jsx)(o.View,{accessibilityRole:"image",accessibilityLabel:I,dataSet:u.CODE_SURFACE_DATASET,style:w.card,children:V}),s[12]=I,s[13]=V,s[14]=P):P=s[14];return P};var o=r(d[0]),n=r(d[1]),t=r(d[2]);r(d[3]);var l=r(d[4]);r(d[5]),r(d[6]);var c=r(d[7]),s=r(d[8]),u=r(d[9]),f=r(d[10]),_=r(d[11]),y=r(d[12]),p=r(d[13]),E=r(d[14]),b=r(d[15]);const h="ts",k="\u200b";function v(o,n){if(void 0===o)return;const t=o.trim();return 0===t.length?n:t}function R(o){if(!o)return{};const n={},t=v(o.monoFontFamily,_.DEFAULT_MONO_FONT_STACK);void 0!==t&&(n.fontFamily=t);const l="number"==typeof(c=o.codeFontSize)&&Number.isFinite(c)?c:void 0;var c;return void 0!==l&&(n.fontSize=l,n.lineHeight=Math.round(1.5*l)),(0,y.inlineUnistylesStyle)(n)}function x(o,n,t,l,c){const s=c&&c.length>0?c.map((n,t)=>({key:`${o}-${t}`,style:n.style,text:n.text})):null;return{key:o,type:n,marker:t,tokens:s,fallbackText:l.length>0?l:k}}function S(){const o=(0,p.tokenizeToLines)(E.PREVIEW_BEFORE.join("\n"),h),n=(0,p.tokenizeToLines)(E.PREVIEW_AFTER.join("\n"),h),t=[];for(let l=0;l<E.PREVIEW_BEFORE.length;l+=1)E.CHANGED_LINE_INDICES.has(l)?(t.push(x(`r-${l}`,"remove","- ",E.PREVIEW_BEFORE[l],o?.[l]??null)),t.push(x(`a-${l}`,"add","+ ",E.PREVIEW_AFTER[l],n?.[l]??null))):t.push(x(`c-${l}`,"context"," ",E.PREVIEW_BEFORE[l],o?.[l]??null));return t}function F(o){return"add"===o?w.markerAdd:"remove"===o?w.markerRemove:w.markerContext}function T(o){return(0,b.jsx)(n.Text,{style:o.style?(0,f.syntaxTokenStyleFor)(o.style):void 0,children:o.text},o.key)}const w=c.StyleSheet.create(o=>({card:{backgroundColor:o.colors.surface1,borderRadius:o.borderRadius.lg,borderWidth:o.borderWidth[1],borderColor:o.colors.border,overflow:"hidden",paddingVertical:o.spacing[2],uni__dependencies:[0]},row:{paddingHorizontal:o.spacing[3],uni__dependencies:[0]},addRow:{backgroundColor:"rgba(46, 160, 67, 0.15)"},removeRow:{backgroundColor:"rgba(248, 81, 73, 0.1)"},codeLine:Object.assign({fontFamily:o.fontFamily.mono,fontSize:o.fontSize.code,lineHeight:o.lineHeight.diff,color:o.colors.foreground},s.isWeb?{whiteSpace:"pre",overflowWrap:"normal"}:null,{uni__dependencies:[0]}),markerContext:{color:o.colors.foregroundMuted,uni__dependencies:[0]},markerAdd:{color:o.colors.diffAddition,uni__dependencies:[0]},markerRemove:{color:o.colors.diffDeletion,uni__dependencies:[0]}}))},4729,[348,711,349,36,1573,234,146,56,3407,3802,3803,305,3471,3804,4730,279]);
|
|
16489
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"PREVIEW_BEFORE",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"PREVIEW_AFTER",{enumerable:!0,get:function(){return n}}),Object.defineProperty(e,"CHANGED_LINE_INDICES",{enumerable:!0,get:function(){return o}});const t=["// Format a price for display","export function formatPrice(cents: number) {"," const amount = cents / 100;",' return "$" + amount;',"}"],n=["// Format a price for display","export function formatPrice(cents: number): string {"," const amount = cents / 100;"," return `$${amount.toFixed(2)}`;","}"],o=new Set([1,3])},4730,[]);
|
|
16490
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Switch=function(o){const f=(0,t.c)(30),{value:y,onValueChange:C,disabled:T,accessibilityLabel:k,testID:I,style:S}=o,x=void 0!==T&&T,{theme:M}=(0,n.useUnistyles)(),D=(h.height-u)/2,j=h.width-u-2*D,G=(0,s.useDerivedValue)((function({_worklet_2397555475930_init_data:e,withTiming:t,value:o,TIMING:s}){const l=()=>t(o?1:0,s);return l.__closure={withTiming:t,value:o,TIMING:s},l.__workletHash=2397555475930,l.__initData=e,l})({_worklet_2397555475930_init_data:p,withTiming:s.withTiming,value:y,TIMING:_})),N=(0,s.useAnimatedStyle)((function({_worklet_15691876049171_init_data:e,interpolateColor:t,progress:o,theme:s}){const l=()=>({backgroundColor:t(o.value,[0,1],[s.colors.surface3,s.colors.accent])});return l.__closure={interpolateColor:t,progress:o,theme:s},l.__workletHash=0xe458cb2a113,l.__initData=e,l})({_worklet_15691876049171_init_data:w,interpolateColor:s.interpolateColor,progress:G,theme:M})),O=(0,s.useAnimatedStyle)((function({_worklet_15129374660955_init_data:e,interpolateColor:t,progress:o,theme:s,thumbTravel:l}){const n=()=>({backgroundColor:t(o.value,[0,1],[s.colors.palette.white,s.colors.accentForeground]),transform:[{translateX:o.value*l}]});return n.__closure={interpolateColor:t,progress:o,theme:s,thumbTravel:l},n.__workletHash=0xdc29500995b,n.__initData=e,n})({_worklet_15129374660955_init_data:b,interpolateColor:s.interpolateColor,progress:G,theme:M,thumbTravel:j}));let P;f[0]!==x||f[1]!==C||f[2]!==y?(P=e=>{e.stopPropagation(),x||C?.(!y)},f[0]=x,f[1]=C,f[2]=y,f[3]=P):P=f[3];const R=P;let V;f[4]!==x||f[5]!==y?(V={checked:y,disabled:x},f[4]=x,f[5]=y,f[6]=V):V=f[6];const H=V,A=x?v.disabled:null;let E;f[7]!==S||f[8]!==A?(E=[A,S],f[7]=S,f[8]=A,f[9]=E):E=f[9];const F=E;let L,X;f[10]===Symbol.for("react.memo_cache_sentinel")?(L={width:h.width,height:h.height,borderRadius:h.height/2,padding:D},f[10]=L):L=f[10];f[11]!==N?(X=[v.track,L,N],f[11]=N,f[12]=X):X=f[12];const U=X;let q,z;f[13]===Symbol.for("react.memo_cache_sentinel")?(q={width:u,height:u,borderRadius:8},f[13]=q):q=f[13];f[14]!==O?(z=[v.thumb,q,O],f[14]=O,f[15]=z):z=f[15];const B=z;let J,K,Q;f[16]!==B?(J=(0,c.jsx)(l.default.View,{style:B}),f[16]=B,f[17]=J):J=f[17];f[18]!==J||f[19]!==U?(K=(0,c.jsx)(l.default.View,{style:U,children:J}),f[18]=J,f[19]=U,f[20]=K):K=f[20];f[21]!==k||f[22]!==H||f[23]!==x||f[24]!==R||f[25]!==F||f[26]!==K||f[27]!==I||f[28]!==y?(Q=(0,c.jsx)(e.Pressable,{onPress:R,disabled:x,hitSlop:8,accessibilityRole:"switch",accessibilityState:H,accessibilityLabel:k,"aria-checked":y,testID:I,style:F,children:K}),f[21]=k,f[22]=H,f[23]=x,f[24]=R,f[25]=F,f[26]=K,f[27]=I,f[28]=y,f[29]=Q):Q=f[29];return Q};var e=r(d[0]),t=r(d[1]);r(d[2]),r(d[3]);var o,s=r(d[4]),l=(o=s)&&o.__esModule?o:{default:o},n=r(d[5]),c=r(d[6]);const h={width:34,height:20},u=16,_={duration:180,easing:s.Easing.inOut(s.Easing.ease)},p={code:"function switchTsx1(){const{withTiming,value,TIMING}=this.__closure;return withTiming(value?1:0,TIMING);}"},w={code:"function switchTsx2(){const{interpolateColor,progress,theme}=this.__closure;return{backgroundColor:interpolateColor(progress.value,[0,1],[theme.colors.surface3,theme.colors.accent])};}"},b={code:"function switchTsx3(){const{interpolateColor,progress,theme,thumbTravel}=this.__closure;return{backgroundColor:interpolateColor(progress.value,[0,1],[theme.colors.palette.white,theme.colors.accentForeground]),transform:[{translateX:progress.value*thumbTravel}]};}"};const v=n.StyleSheet.create(e=>({track:{justifyContent:"center"},thumb:{shadowColor:"rgba(0, 0, 0, 0.25)",shadowOffset:{width:0,height:1},shadowRadius:2,shadowOpacity:1,elevation:2},disabled:{opacity:e.opacity[50],uni__dependencies:[0]}}))},4731,[1572,349,36,1308,444,56,279]);
|
|
16491
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.AddHostMethodModal=function(y){const f=(0,s.c)(61),{visible:j,onClose:M,onDirectConnection:S,onScanQr:T,onPasteLink:_}=y,{theme:P}=(0,l.useUnistyles)(),{t:v}=(0,c.useTranslation)();let L,k;f[0]!==v?(L=v("pairing.connectionMethods.title"),f[0]=v,f[1]=L):L=f[1];f[2]!==L?(k={title:L},f[2]=L,f[3]=k):k=f[3];const z=k;let C;f[4]!==S?(C=()=>{S()},f[4]=S,f[5]=C):C=f[5];const D=C;let Q;f[6]!==T?(Q=()=>{T()},f[6]=T,f[7]=Q):Q=f[7];const R=Q;let w;f[8]!==_?(w=()=>{_()},f[8]=_,f[9]=w):w=f[9];const B=w;let I,V,W,A,H,N,O,U,q,E,F,G,J,K,X,Y,Z,$;f[10]!==v?(I=v("pairing.connectionMethods.direct.title"),f[10]=v,f[11]=I):I=f[11];f[12]!==P.colors.foreground?(V=(0,x.jsx)(p.Link2,{size:18,color:P.colors.foreground}),f[12]=P.colors.foreground,f[13]=V):V=f[13];f[14]!==v?(W=v("pairing.connectionMethods.direct.title"),f[14]=v,f[15]=W):W=f[15];f[16]!==W?(A=(0,x.jsx)(t.Text,{style:b.optionText,children:W}),f[16]=W,f[17]=A):A=f[17];f[18]!==v?(H=v("pairing.connectionMethods.direct.description"),f[18]=v,f[19]=H):H=f[19];f[20]!==H?(N=(0,x.jsx)(t.Text,{style:b.optionSubtext,children:H}),f[20]=H,f[21]=N):N=f[21];f[22]!==N||f[23]!==A?(O=(0,x.jsxs)(o.View,{style:b.optionBody,children:[A,N]}),f[22]=N,f[23]=A,f[24]=O):O=f[24];f[25]!==D||f[26]!==O||f[27]!==I||f[28]!==V?(U=(0,x.jsxs)(n.Pressable,{style:b.option,onPress:D,accessibilityRole:"button",accessibilityLabel:I,testID:"add-host-method-direct",children:[V,O]}),f[25]=D,f[26]=O,f[27]=I,f[28]=V,f[29]=U):U=f[29];f[30]!==R||f[31]!==v||f[32]!==P.colors.foreground?(q=u.isNative?(0,x.jsxs)(n.Pressable,{style:b.option,onPress:R,accessibilityRole:"button",accessibilityLabel:v("pairing.connectionMethods.scanQr.title"),children:[(0,x.jsx)(p.QrCode,{size:18,color:P.colors.foreground}),(0,x.jsxs)(o.View,{style:b.optionBody,children:[(0,x.jsx)(t.Text,{style:b.optionText,children:v("pairing.connectionMethods.scanQr.title")}),(0,x.jsx)(t.Text,{style:b.optionSubtext,children:v("pairing.connectionMethods.scanQr.description")})]})]}):null,f[30]=R,f[31]=v,f[32]=P.colors.foreground,f[33]=q):q=f[33];f[34]!==v?(E=v("pairing.connectionMethods.pasteLink.title"),f[34]=v,f[35]=E):E=f[35];f[36]!==P.colors.foreground?(F=(0,x.jsx)(p.ClipboardPaste,{size:18,color:P.colors.foreground}),f[36]=P.colors.foreground,f[37]=F):F=f[37];f[38]!==v?(G=v("pairing.connectionMethods.pasteLink.title"),f[38]=v,f[39]=G):G=f[39];f[40]!==G?(J=(0,x.jsx)(t.Text,{style:b.optionText,children:G}),f[40]=G,f[41]=J):J=f[41];f[42]!==v?(K=v("pairing.connectionMethods.pasteLink.description"),f[42]=v,f[43]=K):K=f[43];f[44]!==K?(X=(0,x.jsx)(t.Text,{style:b.optionSubtext,children:K}),f[44]=K,f[45]=X):X=f[45];f[46]!==J||f[47]!==X?(Y=(0,x.jsxs)(o.View,{style:b.optionBody,children:[J,X]}),f[46]=J,f[47]=X,f[48]=Y):Y=f[48];f[49]!==B||f[50]!==E||f[51]!==F||f[52]!==Y?(Z=(0,x.jsxs)(n.Pressable,{style:b.option,onPress:B,accessibilityRole:"button",accessibilityLabel:E,testID:"add-host-method-pair-link",children:[F,Y]}),f[49]=B,f[50]=E,f[51]=F,f[52]=Y,f[53]=Z):Z=f[53];f[54]!==z||f[55]!==M||f[56]!==U||f[57]!==q||f[58]!==Z||f[59]!==j?($=(0,x.jsxs)(h.AdaptiveModalSheet,{header:z,visible:j,onClose:M,testID:"add-host-method-modal",children:[U,q,Z]}),f[54]=z,f[55]=M,f[56]=U,f[57]=q,f[58]=Z,f[59]=j,f[60]=$):$=f[60];return $};var o=r(d[0]),t=r(d[1]),n=r(d[2]),s=r(d[3]);r(d[4]);var c=r(d[5]);r(d[6]),r(d[7]),r(d[8]);var l=r(d[9]),p=r(d[10]),h=r(d[11]),u=r(d[12]),x=r(d[13]);const b=l.StyleSheet.create(o=>({option:{flexDirection:"row",alignItems:"center",gap:o.spacing[4],padding:o.spacing[4],borderRadius:o.borderRadius.xl,backgroundColor:o.colors.surface2,borderWidth:1,borderColor:o.colors.border,uni__dependencies:[0]},optionText:{color:o.colors.foreground,fontSize:o.fontSize.base,fontWeight:o.fontWeight.normal,uni__dependencies:[0]},optionSubtext:{color:o.colors.foregroundMuted,fontSize:o.fontSize.sm,marginTop:o.spacing[1],uni__dependencies:[0]},optionBody:{flex:1}}))},4732,[348,711,1572,349,36,1573,1308,234,146,56,1600,3466,3407,279]);
|
|
16492
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.AddHostModal=function({visible:e,onClose:c,onCancel:y,onSaved:x}){const{theme:_}=(0,p.useUnistyles)(),{t:D}=(0,l.useTranslation)(),M=(0,f.useHosts)(),{probeAndUpsertDirectConnection:z}=(0,f.useHostMutations)(),V=(0,h.useIsCompactFormFactor)(),[E,F]=(0,n.useState)(!1),[P,$]=(0,n.useState)(""),[A,W]=(0,n.useState)(""),[L,U]=(0,n.useState)("6767"),[K,O]=(0,n.useState)(!1),[N,B]=(0,n.useState)(""),[H,q]=(0,n.useState)(!1),[G,J]=(0,n.useState)(!1),[Q,X]=(0,n.useState)(""),[Y,Z]=(0,n.useReducer)(e=>e+1,0),ee=(0,n.useCallback)(()=>{W(""),U("6767"),O(!1),B(""),q(!1),J(!1),X(""),Z()},[]),te=(0,n.useMemo)(()=>(0,T.jsx)(b.Link2,{size:16,color:_.colors.accentForeground}),[_.colors.accentForeground]),re=(0,n.useMemo)(()=>[j.field,j.hostField],[]),ie=(0,n.useMemo)(()=>[j.field,j.portField],[]),oe=(0,n.useMemo)(()=>[j.checkbox,K?j.checkboxChecked:null],[K]),se=(0,n.useMemo)(()=>[j.input,j.passwordInput],[]),ne=(0,n.useMemo)(()=>({checked:K,disabled:E}),[E,K]),le=(0,n.useMemo)(()=>({hostRequired:D("pairing.direct.errors.hostRequired"),invalidPort:D("pairing.direct.errors.invalidPort"),invalidConnection:D("pairing.direct.errors.invalidConnection"),failedToConnect:e=>D("pairing.direct.errors.failedToConnect",{endpoint:e}),noAdditionalDetails:e=>D("pairing.direct.errors.noAdditionalDetails",{detail:e}),timedOut:D("pairing.direct.errors.timedOut"),refused:D("pairing.direct.errors.refused"),hostNotFound:D("pairing.direct.errors.hostNotFound"),hostUnreachable:D("pairing.direct.errors.hostUnreachable"),tlsError:D("pairing.direct.errors.tlsError"),unableToConnect:D("pairing.direct.errors.unableToConnect")}),[D]),de=(0,n.useMemo)(()=>({title:D("pairing.direct.title")}),[D]),ae=(0,n.useCallback)(()=>{E||(ee(),$(""),c())},[E,ee,c]),ce=(0,n.useCallback)(()=>{E||(ee(),$(""),(y??c)())},[E,ee,y,c]),ue=(0,n.useCallback)(async()=>{if(E)return;let e;try{e=S({host:A,port:L,useTls:K,password:N},le)}catch(e){const t=e instanceof Error?e.message:le.invalidConnection;return void $(t)}try{F(!0),$("");const{profile:t,serverId:o,hostname:s}=await z(Object.assign({endpoint:e.endpoint,useTls:e.useTls},e.password?{password:e.password}:{})),n=!M.some(e=>e.serverId===o);x?.({profile:t,serverId:o,hostname:s,isNewHost:n}),ae()}catch(t){const{title:o,detail:s,raw:n}=R({endpoint:e.uri,error:t,labels:le});let l;l=n&&s&&n!==s?`${o}\n${s}\n${D("pairing.direct.errors.details",{detail:n})}`:s?`${o}\n${s}`:o,$(l),V||u.default.alert(D("pairing.direct.errors.failedTitle"),l)}finally{F(!1)}},[M,le,ae,A,V,E,x,N,L,z,D,K]),pe=(0,n.useCallback)(()=>{ue()},[ue]),he=(0,n.useCallback)(()=>{ue()},[ue]),ge=(0,n.useCallback)(()=>{E||O(e=>!e)},[E]),be=(0,n.useCallback)(()=>{q(e=>!e)},[]),fe=(0,n.useCallback)(()=>{if(!G){try{X(I({host:A,port:L,useTls:K,password:N},le))}catch{X("")}return $(""),void J(!0)}try{const e=k(Q);W(e.host),U(e.port),O(e.useTls),B(e.password),$(""),Z()}catch{$("")}J(!1)},[Q,le,A,G,N,L,K]),ye=G?b.ChevronDown:b.ChevronRight,xe=H?b.EyeOff:b.Eye;return(0,T.jsxs)(w.AdaptiveModalSheet,{header:de,visible:e,onClose:ae,testID:"add-host-modal",children:[(0,T.jsx)(o.Text,{style:j.helper,children:D("pairing.direct.helper")}),(0,T.jsxs)(t.View,{style:j.portRow,children:[(0,T.jsxs)(t.View,{style:re,children:[(0,T.jsx)(o.Text,{style:j.label,children:D("pairing.direct.fields.host")}),(0,T.jsx)(w.AdaptiveTextInput,{testID:"direct-host-input",nativeID:"direct-host-input",accessibilityLabel:D("pairing.direct.fields.host"),initialValue:A,resetKey:`direct-host-${Y}`,value:A,onChangeText:W,placeholder:"localhost",placeholderTextColor:_.colors.foregroundMuted,style:j.input,autoCapitalize:"none",autoCorrect:!1,keyboardType:"url",editable:!E,returnKeyType:"next"})]}),(0,T.jsxs)(t.View,{style:ie,children:[(0,T.jsx)(o.Text,{style:j.label,children:D("pairing.direct.fields.port")}),(0,T.jsx)(w.AdaptiveTextInput,{testID:"direct-port-input",nativeID:"direct-port-input",accessibilityLabel:D("pairing.direct.fields.port"),initialValue:L,resetKey:`direct-port-${Y}`,value:L,onChangeText:U,placeholder:"6767",placeholderTextColor:_.colors.foregroundMuted,style:j.input,autoCapitalize:"none",autoCorrect:!1,keyboardType:"number-pad",editable:!E,returnKeyType:"done",onSubmitEditing:pe})]})]}),(0,T.jsxs)(s.Pressable,{style:j.checkboxRow,onPress:ge,disabled:E,accessibilityRole:"checkbox",accessibilityLabel:D("pairing.direct.fields.useSsl"),accessibilityState:ne,testID:"direct-ssl-toggle",children:[(0,T.jsx)(t.View,{style:oe,children:K?(0,T.jsx)(t.View,{testID:"direct-ssl-toggle-checked",children:(0,T.jsx)(b.Check,{size:14,color:_.colors.accentForeground})}):null}),(0,T.jsx)(o.Text,{style:j.label,children:D("pairing.direct.fields.useSsl")})]}),(0,T.jsxs)(t.View,{style:j.field,children:[(0,T.jsx)(o.Text,{style:j.label,children:D("pairing.direct.fields.password")}),(0,T.jsxs)(t.View,{style:j.passwordRow,children:[(0,T.jsx)(w.AdaptiveTextInput,{testID:"direct-password-input",nativeID:"direct-password-input",accessibilityLabel:D("pairing.direct.fields.password"),initialValue:N,resetKey:`direct-password-${Y}`,value:N,onChangeText:B,placeholder:D("pairing.direct.fields.optional"),placeholderTextColor:_.colors.foregroundMuted,style:se,autoCapitalize:"none",autoCorrect:!1,secureTextEntry:!H,editable:!E,returnKeyType:"done",onSubmitEditing:pe}),(0,T.jsx)(s.Pressable,{style:j.iconButton,onPress:be,disabled:E,accessibilityRole:"button",accessibilityLabel:D(H?"pairing.direct.passwordVisibility.hide":"pairing.direct.passwordVisibility.show"),testID:"direct-password-visibility-toggle",children:(0,T.jsx)(xe,{size:18,color:_.colors.foregroundMuted})})]})]}),(0,T.jsxs)(t.View,{style:j.field,children:[(0,T.jsxs)(s.Pressable,{style:j.advancedToggle,onPress:fe,disabled:E,accessibilityRole:"button",accessibilityLabel:D(G?"pairing.direct.advanced.hide":"pairing.direct.advanced.show"),testID:"direct-host-advanced-toggle",children:[(0,T.jsx)(ye,{size:16,color:_.colors.foregroundMuted}),(0,T.jsx)(o.Text,{style:j.advancedText,children:D("pairing.direct.advanced.label")})]}),G?(0,T.jsx)(w.AdaptiveTextInput,{testID:"direct-host-uri-input",nativeID:"direct-host-uri-input",accessibilityLabel:D("pairing.direct.fields.connectionUri"),initialValue:Q,resetKey:`direct-host-uri-${Y}`,value:Q,onChangeText:X,placeholder:"tcp://localhost:6767?ssl=true",placeholderTextColor:_.colors.foregroundMuted,style:j.input,autoCapitalize:"none",autoCorrect:!1,keyboardType:"url",editable:!E,returnKeyType:"done",onSubmitEditing:fe}):null,P?(0,T.jsx)(o.Text,{style:j.error,children:P}):null]}),(0,T.jsxs)(t.View,{style:j.actions,children:[(0,T.jsx)(C.Button,{style:v,variant:"secondary",onPress:ce,disabled:E,children:D("pairing.direct.actions.cancel")}),(0,T.jsx)(C.Button,{style:v,variant:"default",onPress:he,disabled:E,leftIcon:te,testID:"direct-host-submit",children:D(E?"pairing.direct.actions.connecting":"pairing.direct.actions.connect")})]})]})};var e,t=r(d[0]),o=r(d[1]),s=r(d[2]),n=r(d[3]),l=r(d[4]),c=r(d[5]),u=(e=c)&&e.__esModule?e:{default:e};r(d[6]),r(d[7]),r(d[8]);var p=r(d[9]),h=r(d[10]),b=r(d[11]),f=r(d[12]),y=r(d[13]),x=r(d[14]),w=r(d[15]),C=r(d[16]),T=r(d[17]);const v={flex:1},j=p.StyleSheet.create(e=>({field:{gap:e.spacing[2],uni__dependencies:[0]},label:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,fontWeight:e.fontWeight.medium,uni__dependencies:[0]},input:{backgroundColor:e.colors.surface2,borderRadius:e.borderRadius.lg,paddingHorizontal:e.spacing[4],paddingVertical:e.spacing[3],color:e.colors.foreground,borderWidth:1,borderColor:e.colors.border,uni__dependencies:[0]},portRow:{flexDirection:"row",gap:e.spacing[3],uni__dependencies:[0]},hostField:{flex:1,minWidth:0},portField:{width:112},passwordRow:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},passwordInput:{flex:1,minWidth:0},iconButton:{width:44,height:44,alignItems:"center",justifyContent:"center",borderRadius:e.borderRadius.lg,backgroundColor:e.colors.surface2,borderWidth:1,borderColor:e.colors.border,uni__dependencies:[0]},checkboxRow:{flexDirection:"row",alignItems:"center",gap:e.spacing[3],uni__dependencies:[0]},checkbox:{width:22,height:22,borderRadius:e.borderRadius.sm,borderWidth:1,borderColor:e.colors.border,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},checkboxChecked:{backgroundColor:e.colors.accent,borderColor:e.colors.accent,uni__dependencies:[0]},advancedToggle:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],alignSelf:"flex-start",paddingVertical:e.spacing[1],uni__dependencies:[0]},advancedText:{color:e.colors.foreground,fontSize:e.fontSize.sm,fontWeight:e.fontWeight.medium,uni__dependencies:[0]},actions:{flexDirection:"row",gap:e.spacing[3],marginTop:e.spacing[2],uni__dependencies:[0]},helper:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,uni__dependencies:[0]},error:{color:e.colors.destructive,fontSize:e.fontSize.sm,uni__dependencies:[0]}}));function _(e){return e.includes(":")&&!e.startsWith("[")&&!e.endsWith("]")}function I(e,t){const o=e.host.trim(),s=Number(e.port.trim());if(!o)throw new Error(t.hostRequired);if(!Number.isInteger(s)||s<1||s>65535)throw new Error(t.invalidPort);return(0,y.serializeConnectionUriForStorage)(Object.assign({host:o,port:s,isIpv6:_(o),useTls:e.useTls},e.password?{password:e.password}:{}))}function S(e,t){const o=(0,y.parseConnectionUri)(I(e,t)),s=o.isIpv6?`[${o.host}]:${o.port}`:`${o.host}:${o.port}`;return Object.assign({uri:(0,y.serializeConnectionUri)(o),endpoint:s,useTls:o.useTls},o.password?{password:o.password}:{})}function k(e){const t=(0,y.parseConnectionUri)(e);return{host:t.host,port:String(t.port),useTls:t.useTls,password:t.password??""}}function D(e){if(!e)return null;const t=e.trim();return t||null}function M(e,t){const o=Array.from(new Set(e.map(e=>D(e)).filter(e=>Boolean(e)).map(e=>e.trim()).filter(e=>e.length>0)));if(0===o.length)return null;return o.every(e=>{const t=e.toLowerCase();return"transport error"===t||"transport closed"===t})?t.noAdditionalDetails(o[0]??""):o.join(" \u2014 ")}function R(e){const{endpoint:t,error:o,labels:s}=e,n=s.failedToConnect(t),l=o instanceof x.DaemonConnectionTestError?M([o.reason,o.lastError],s)??D(o.message):o instanceof Error?D(o.message):null,c=l?.toLowerCase()??"";let u=null;return u="Incorrect password"===l||"Password required"===l?l:c.includes("timed out")?s.timedOut:c.includes("econnrefused")||c.includes("connection refused")||c.includes("err_connection_refused")?s.refused:c.includes("enotfound")||c.includes("not found")?s.hostNotFound:c.includes("ehostunreach")||c.includes("host is unreachable")?s.hostUnreachable:c.includes("certificate")||c.includes("tls")||c.includes("ssl")?s.tlsError:s.unableToConnect,{title:n,detail:u,raw:l}}},4733,[348,711,1572,36,1573,1389,1308,234,146,56,3457,1600,3271,3399,3408,3466,3627,279]);
|
|
16493
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.PairLinkModal=function({visible:e,onClose:s,onCancel:I,onSaved:S}){const{theme:j}=(0,u.useUnistyles)(),{t:z}=(0,l.useTranslation)(),M=(0,b.useHosts)(),{upsertConnectionFromOfferUrl:w}=(0,b.useHostMutations)(),P=(0,p.useIsCompactFormFactor)(),D=(0,t.useRef)(""),F=(0,t.useRef)(null),[O,R]=(0,t.useState)(!1),[H,L]=(0,t.useState)(""),B=(0,t.useCallback)(()=>{D.current="",F.current?.clear()},[]),E=(0,t.useMemo)(()=>(0,C.jsx)(f.Link,{size:16,color:j.colors.accentForeground}),[j.colors.accentForeground]),V=(0,t.useCallback)(()=>{O||(B(),L(""),s())},[O,B,s]),W=(0,t.useCallback)(()=>{O||(B(),L(""),(I??s)())},[O,B,I,s]),A=(0,t.useCallback)(async()=>{if(O)return;const e=D.current.trim();if(!e)return void L(z("pairing.link.errors.required"));if(!e.includes("#offer="))return void L(z("pairing.link.errors.missingOffer"));const n=(()=>{try{const n=e.indexOf("#offer="),o=e.slice(n+7).trim();if(!o)throw new Error(z("pairing.link.errors.emptyOffer"));const t=(0,y.decodeOfferFragmentPayload)(o);return h.ConnectionOfferSchema.parse(t)}catch(e){const n=e instanceof Error?e.message:z("pairing.link.errors.invalid");return L(n),P||c.default.alert(z("pairing.link.alert.failedTitle"),n),null}})();if(n)try{R(!0),L("");const{client:o,hostname:t}=await(0,k.connectToDaemon)({id:"probe",type:"relay",relayEndpoint:(0,y.normalizeHostPort)(n.relay.endpoint),useTls:n.relay.useTls,daemonPublicKeyB64:n.daemonPublicKeyB64},{serverId:n.serverId});await o.close().catch(()=>{});const l=!M.some(e=>e.serverId===n.serverId),s=await w(e,t??void 0);S?.({profile:s,serverId:n.serverId,hostname:t,isNewHost:l}),V()}catch(e){const n=e instanceof Error?e.message:z("pairing.link.errors.unableToPair");L(n),P||c.default.alert(z("pairing.link.alert.failedTitle"),n)}finally{R(!1)}},[M,V,P,O,S,z,w]),K=(0,t.useCallback)(e=>{D.current=e},[]),U=(0,t.useCallback)(()=>{A()},[A]),q=(0,t.useMemo)(()=>({title:z("pairing.link.title")}),[z]);return(0,C.jsxs)(v.AdaptiveModalSheet,{header:q,visible:e,onClose:V,testID:"pair-link-modal",children:[(0,C.jsx)(o.Text,{style:T.helper,children:z("pairing.link.helper")}),(0,C.jsxs)(n.View,{style:T.field,children:[(0,C.jsx)(o.Text,{style:T.label,children:z("pairing.link.label")}),(0,C.jsx)(v.AdaptiveTextInput,{ref:F,testID:"pair-link-input",nativeID:"pair-link-input",accessibilityLabel:z("pairing.link.label"),onChangeText:K,placeholder:"https://app.paseo.sh/#offer=...",placeholderTextColor:j.colors.foregroundMuted,style:T.input,autoFocus:!0,autoCapitalize:"none",autoCorrect:!1,keyboardType:"url"}),H?(0,C.jsx)(o.Text,{style:T.error,children:H}):null]}),(0,C.jsxs)(n.View,{style:T.actions,children:[(0,C.jsx)(x.Button,{style:_,variant:"secondary",onPress:W,disabled:O,testID:"pair-link-cancel",accessibilityRole:"button",accessibilityLabel:z("pairing.link.actions.cancel"),children:z("pairing.link.actions.cancel")}),(0,C.jsx)(x.Button,{style:_,variant:"default",onPress:U,disabled:O,testID:"pair-link-submit",accessibilityRole:"button",accessibilityLabel:z("pairing.link.actions.pair"),leftIcon:E,children:z(O?"pairing.link.actions.pairing":"pairing.link.actions.pair")})]})]})};var e,n=r(d[0]),o=r(d[1]),t=r(d[2]),l=r(d[3]),s=r(d[4]),c=(e=s)&&e.__esModule?e:{default:e};r(d[5]),r(d[6]);var u=r(d[7]),p=r(d[8]),f=r(d[9]),b=r(d[10]),y=r(d[11]),k=r(d[12]),h=r(d[13]),v=r(d[14]),x=r(d[15]),C=r(d[16]);const _={flex:1},T=u.StyleSheet.create(e=>({helper:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,uni__dependencies:[0]},field:{gap:e.spacing[2],uni__dependencies:[0]},label:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,fontWeight:e.fontWeight.medium,uni__dependencies:[0]},input:{backgroundColor:e.colors.surface2,borderRadius:e.borderRadius.lg,paddingHorizontal:e.spacing[4],paddingVertical:e.spacing[3],color:e.colors.foreground,borderWidth:1,borderColor:e.colors.border,uni__dependencies:[0]},error:{color:e.colors.destructive,fontSize:e.fontSize.sm,uni__dependencies:[0]},actions:{flexDirection:"row",gap:e.spacing[3],marginTop:e.spacing[2],uni__dependencies:[0]}}))},4734,[348,711,36,1573,1389,234,146,56,3457,1600,3271,3399,3408,3400,3466,3627,279]);
|
|
16494
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.KeyboardShortcutsSection=function(){const u=(0,o.c)(41),{t:b}=(0,c.useTranslation)(),[M,z]=(0,s.useState)(null);let D;u[0]===Symbol.for("react.memo_cache_sentinel")?(D=[],u[0]=D):D=u[0];const[P,R]=(0,s.useState)(D),[V,B]=(0,s.useState)(null),{overrides:A,hasOverrides:F,setOverride:L,removeOverride:H,resetAll:N}=(0,S.useKeyboardShortcutOverrides)(),q=(0,y.useKeyboardShortcutsStore)(I),G=(0,l.useIsFocused)();let J;u[1]===Symbol.for("react.memo_cache_sentinel")?(J=(0,C.getShortcutOs)(),u[1]=J):J=u[1];const Q="mac"===J,U=(0,w.getIsElectronRuntime)(),W=(0,v.buildKeyboardShortcutHelpSections)({isMac:Q,isDesktop:U});let X;u[2]!==q?(X=()=>{R([]),B(null),z(null),q(!1)},u[2]=q,u[3]=X):X=u[3];const Y=X;let Z;u[4]!==q?(Z=t=>{R([]),B(null),z(t),q(!0)},u[4]=q,u[5]=Z):Z=u[5];const $=Z;let ee;u[6]!==Y||u[7]!==P||u[8]!==M||u[9]!==L?(ee=()=>{null!==M&&0!==P.length&&(L(M,P.join(" ")),Y())},u[6]=Y,u[7]=P,u[8]=M,u[9]=L,u[10]=ee):ee=u[10];const te=ee;let ne,oe,se,re,ie,ce,le;u[11]!==Y||u[12]!==M||u[13]!==G?(ne=()=>{G||null===M||Y()},oe=[G,M,Y],u[11]=Y,u[12]=M,u[13]=G,u[14]=ne,u[15]=oe):(ne=u[14],oe=u[15]);(0,s.useEffect)(ne,oe),u[16]!==M?(se=()=>{if(j.isNative)return;if(null===M)return;const t=function(t){t.preventDefault(),t.stopPropagation();if("Backspace"===(t.key??""))return void R(K);const n=(0,x.keyboardEventToComboString)(t);null!==n?(B(null),R(t=>[...t,n])):B((0,x.heldModifiersFromEvent)(t))};return window.addEventListener("keydown",t,!0),()=>{window.removeEventListener("keydown",t,!0)}},re=[M],u[16]=M,u[17]=se,u[18]=re):(se=u[17],re=u[18]);(0,s.useEffect)(se,re),u[19]!==q?(ce=()=>()=>{q(!1)},ie=[q],u[19]=q,u[20]=ie,u[21]=ce):(ie=u[20],ce=u[21]);(0,s.useEffect)(ce,ie),u[22]!==N?(le=()=>{N()},u[22]=N,u[23]=le):le=u[23];const de=le;let ue;u[24]!==H?(ue=t=>{H(t)},u[24]=H,u[25]=ue):ue=u[25];const ae=ue;if(j.isNative){let o,s,c,l;return u[26]!==b?(o=b("settings.sections.shortcuts"),u[26]=b,u[27]=o):o=u[27],u[28]!==b?(s=b("settings.shortcuts.unavailableOnMobile"),u[28]=b,u[29]=s):s=u[29],u[30]!==s?(c=(0,_.jsx)(n.View,{style:E,children:(0,_.jsx)(t.Text,{style:O.mobileText,children:s})}),u[30]=s,u[31]=c):c=u[31],u[32]!==o||u[33]!==c?(l=(0,_.jsx)(p.SettingsSection,{title:o,children:c}),u[32]=o,u[33]=c,u[34]=l):l=u[34],l}let he;u[35]!==de||u[36]!==F||u[37]!==b?(he=F?(0,_.jsx)(f.Button,{variant:"ghost",size:"sm",onPress:de,children:b("settings.shortcuts.actions.resetAll")}):void 0,u[35]=de,u[36]=F,u[37]=b,u[38]=he):he=u[38];const ge=he,pe=W.map(function(t,o){return(0,_.jsx)(p.SettingsSection,{title:b(t.titleKey),trailing:0===o?ge:void 0,children:(0,_.jsx)(n.View,{style:h.settingsStyles.card,children:t.rows.map(function(o,s){const c=(0,v.getBindingIdForAction)(o.id,{isMac:Q,isDesktop:U}),l=c?A[c]:void 0;return(0,_.jsxs)(n.View,{children:[(0,_.jsx)(k,{row:o,bindingId:c,overrideCombo:l,isCapturing:M===c,capturedCombos:M===c?P:T,heldModifiers:M===c?V:null,onStartCapture:$,onSaveCapture:te,onCancelCapture:Y,onRemoveOverride:ae}),s<t.rows.length-1&&(0,_.jsx)(n.View,{style:O.separator})]},o.id)})})},t.id)});let fe;u[39]!==pe?(fe=(0,_.jsx)(_.Fragment,{children:pe}),u[39]=pe,u[40]=fe):fe=u[40];return fe};var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),c=r(d[4]);r(d[5]),r(d[6]);var l=r(d[7]),u=r(d[8]),h=r(d[9]),p=r(d[10]),f=r(d[11]),b=r(d[12]),S=r(d[13]),v=r(d[14]),x=r(d[15]),y=r(d[16]),C=r(d[17]),w=r(d[18]),j=r(d[19]),_=r(d[20]);const T=[];function M(n){const s=(0,o.c)(9),{chord:l,heldModifiers:u}=n,{t:h}=(0,c.useTranslation)();let p;if(s[0]!==l||s[1]!==u){const t=[...l??[]];u&&t.push(u),p=t.map(x.comboStringToShortcutKeys),s[0]=l,s[1]=u,s[2]=p}else p=s[2];const f=p;if(!(l&&0!==l.length||u)){let n,o;return s[3]!==h?(n=h("settings.shortcuts.capturePrompt"),s[3]=h,s[4]=n):n=s[4],s[5]!==n?(o=(0,_.jsx)(t.Text,{style:O.capturingText,children:n}),s[5]=n,s[6]=o):o=s[6],o}let S;return s[7]!==f?(S=(0,_.jsx)(b.Shortcut,{chord:f}),s[7]=f,s[8]=S):S=s[8],S}function k(t){const n=(0,o.c)(17),{row:s,bindingId:c,overrideCombo:l,isCapturing:u,capturedCombos:h,heldModifiers:p,onStartCapture:f,onSaveCapture:b,onCancelCapture:S,onRemoveOverride:v}=t;let x;n[0]!==c||n[1]!==f?(x=()=>{c&&f(c)},n[0]=c,n[1]=f,n[2]=x):x=n[2];const y=x;let C;n[3]!==c||n[4]!==v?(C=()=>{c&&v(c)},n[3]=c,n[4]=v,n[5]=C):C=n[5];const w=C;let j;return n[6]!==c||n[7]!==h||n[8]!==y||n[9]!==w||n[10]!==p||n[11]!==u||n[12]!==S||n[13]!==b||n[14]!==l||n[15]!==s?(j=(0,_.jsx)(z,{row:s,bindingId:c,overrideCombo:l,isCapturing:u,capturedCombos:h,heldModifiers:p,onRebind:y,onDone:b,onCancel:S,onReset:w}),n[6]=c,n[7]=h,n[8]=y,n[9]=w,n[10]=p,n[11]=u,n[12]=S,n[13]=b,n[14]=l,n[15]=s,n[16]=j):j=n[16],j}function z(s){const l=(0,o.c)(36),{row:u,bindingId:h,overrideCombo:p,isCapturing:S,capturedCombos:v,heldModifiers:y,onRebind:C,onDone:w,onCancel:j,onReset:T}=s,{t:k}=(0,c.useTranslation)();let z;l[0]!==p||l[1]!==u.keys?(z=p?(0,x.chordStringToShortcutKeys)(p):[u.keys],l[0]=p,l[1]=u.keys,l[2]=z):z=l[2];const K=z,I=S&&O.rowCapturing;let E;l[3]!==I?(E=[O.row,I],l[3]=I,l[4]=E):E=l[4];const D=E;let P,R,V,B,A,F,L;return l[5]!==u.labelKey||l[6]!==k?(P=k(u.labelKey),l[5]=u.labelKey,l[6]=k,l[7]=P):P=l[7],l[8]!==P?(R=(0,_.jsx)(t.Text,{style:O.rowLabel,children:P}),l[8]=P,l[9]=R):R=l[9],l[10]!==v||l[11]!==K||l[12]!==y||l[13]!==S?(V=S?(0,_.jsx)(M,{chord:v,heldModifiers:y}):(0,_.jsx)(b.Shortcut,{chord:K}),l[10]=v,l[11]=K,l[12]=y,l[13]=S,l[14]=V):V=l[14],l[15]!==h||l[16]!==v||l[17]!==S||l[18]!==j||l[19]!==w||l[20]!==C||l[21]!==k?(B=null!==h&&(0,_.jsxs)(_.Fragment,{children:[S&&v.length>0?(0,_.jsx)(f.Button,{variant:"ghost",size:"sm",onPress:w,children:k("settings.shortcuts.actions.done")}):null,(0,_.jsx)(f.Button,{variant:"ghost",size:"sm",onPress:S?j:C,children:k(S?"settings.shortcuts.actions.cancel":"settings.shortcuts.actions.rebind")})]}),l[15]=h,l[16]=v,l[17]=S,l[18]=j,l[19]=w,l[20]=C,l[21]=k,l[22]=B):B=l[22],l[23]!==S||l[24]!==T||l[25]!==p||l[26]!==k?(A=void 0!==p&&!S&&(0,_.jsx)(f.Button,{variant:"ghost",size:"sm",onPress:T,children:(0,_.jsx)(t.Text,{style:O.resetText,children:k("settings.shortcuts.actions.reset")})}),l[23]=S,l[24]=T,l[25]=p,l[26]=k,l[27]=A):A=l[27],l[28]!==V||l[29]!==B||l[30]!==A?(F=(0,_.jsxs)(n.View,{style:O.rowActions,children:[V,B,A]}),l[28]=V,l[29]=B,l[30]=A,l[31]=F):F=l[31],l[32]!==D||l[33]!==R||l[34]!==F?(L=(0,_.jsxs)(n.View,{style:D,children:[R,F]}),l[32]=D,l[33]=R,l[34]=F,l[35]=L):L=l[35],L}function K(t){return t.length>0?t.slice(0,-1):t}function I(t){return t.setCapturingShortcut}const O=u.StyleSheet.create(t=>({row:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingHorizontal:t.spacing[3],paddingVertical:t.spacing[3],uni__dependencies:[0]},rowCapturing:{backgroundColor:t.colors.surface2,uni__dependencies:[0]},rowLabel:{fontSize:t.fontSize.sm,color:t.colors.foreground,flexShrink:1,uni__dependencies:[0]},rowActions:{flexDirection:"row",alignItems:"center",gap:t.spacing[2],uni__dependencies:[0]},capturingText:{fontSize:t.fontSize.sm,color:t.colors.foregroundMuted,uni__dependencies:[0]},resetText:{color:t.colors.foregroundMuted,uni__dependencies:[0]},separator:{height:1,backgroundColor:t.colors.border,uni__dependencies:[0]},mobileCard:{padding:t.spacing[4],uni__dependencies:[0]},mobileText:{fontSize:t.fontSize.sm,color:t.colors.foregroundMuted,uni__dependencies:[0]}})),E=[h.settingsStyles.card,O.mobileCard]},4735,[711,348,349,36,1573,146,234,1148,56,3907,4727,3627,3515,3482,3481,3480,3265,3483,3457,3407,279]);
|
|
16495
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.DesktopPermissionsSection=function(){const y=(0,n.c)(72),{t:q}=(0,o.useTranslation)(),{theme:P}=(0,c.useUnistyles)(),{isDesktopApp:j,snapshot:v,isRefreshing:z,requestingPermission:R,isSendingTestNotification:A,testNotificationError:D,refreshPermissions:T,requestPermission:_,sendTestNotification:k}=(0,f.useDesktopPermissions)();let w;y[0]!==P.colors.destructive?(w=[b.errorText,{color:P.colors.destructive}],y[0]=P.colors.destructive,y[1]=w):w=y[1];const E=w;let B;y[2]!==T?(B=()=>{T()},y[2]=T,y[3]=B):B=y[3];const M=B;let N;y[4]!==_?(N=()=>{_("notifications")},y[4]=_,y[5]=N):N=y[5];const L=N;let C;y[6]!==_?(C=()=>{_("microphone")},y[6]=_,y[7]=C):C=y[7];const H=C;let I;y[8]!==k?(I=()=>{k()},y[8]=k,y[9]=I):I=y[9];const O=I,U=z||null!==R,V="granted"===v?.notifications.state;let F;y[10]!==P.colors.foregroundMuted||y[11]!==P.iconSize.md?(F=(0,S.jsx)(l.RotateCw,{size:P.iconSize.md,color:P.colors.foregroundMuted}),y[10]=P.colors.foregroundMuted,y[11]=P.iconSize.md,y[12]=F):F=y[12];const G=F;let J,K,Q;y[13]!==q?(J=q("settings.permissions.refreshAccessibility"),y[13]=q,y[14]=J):J=y[14];y[15]!==z||y[16]!==q?(K=q(z?"settings.permissions.refreshing":"settings.permissions.refresh"),y[15]=z,y[16]=q,y[17]=K):K=y[17];y[18]!==M||y[19]!==U||y[20]!==G||y[21]!==J||y[22]!==K?(Q=(0,S.jsx)(u.Button,{variant:"ghost",size:"sm",leftIcon:G,onPress:M,disabled:U,accessibilityLabel:J,children:K}),y[18]=M,y[19]=U,y[20]=G,y[21]=J,y[22]=K,y[23]=Q):Q=y[23];const W=Q;let X,Y,Z,$,ss;y[24]!==q?(X=q("settings.permissions.actions.granted"),y[24]=q,y[25]=X):X=y[25];y[26]!==q?(Y=q("settings.permissions.actions.request"),y[26]=q,y[27]=Y):Y=y[27];y[28]!==q?(Z=q("settings.permissions.actions.requesting"),y[28]=q,y[29]=Z):Z=y[29];y[30]!==q?($=s=>q("settings.permissions.actions.busySuffix",{label:s}),y[30]=q,y[31]=$):$=y[31];y[32]!==Y||y[33]!==Z||y[34]!==$||y[35]!==X?(ss={granted:X,request:Y,requesting:Z,busyExtraAction:$},y[32]=Y,y[33]=Z,y[34]=$,y[35]=X,y[36]=ss):ss=y[36];const es=ss;if(!j)return null;let ts,is;y[37]!==q?(ts=q("settings.permissions.title"),y[37]=q,y[38]=ts):ts=y[38];y[39]!==q?(is=q("settings.permissions.notifications"),y[39]=q,y[40]=is):is=y[40];const ns=v?.notifications??null,os="notifications"===R;let rs;y[41]!==q?(rs=q("settings.permissions.test"),y[41]=q,y[42]=rs):rs=y[42];const cs=!V||U;let ls,as,us;y[43]!==L||y[44]!==O||y[45]!==A||y[46]!==es||y[47]!==is||y[48]!==ns||y[49]!==os||y[50]!==rs||y[51]!==cs?(ls=(0,S.jsx)(p.DesktopPermissionRow,{title:is,status:ns,isRequesting:os,onRequest:L,labels:es,extraActionLabel:rs,isExtraActionBusy:A,isExtraActionDisabled:cs,onExtraAction:O}),y[43]=L,y[44]=O,y[45]=A,y[46]=es,y[47]=is,y[48]=ns,y[49]=os,y[50]=rs,y[51]=cs,y[52]=ls):ls=y[52];y[53]!==E||y[54]!==D?(as=D?(0,S.jsx)(s.Text,{style:E,children:D}):null,y[53]=E,y[54]=D,y[55]=as):as=y[55];y[56]!==q?(us=q("settings.permissions.microphone"),y[56]=q,y[57]=us):us=y[57];const ds=v?.microphone??null,gs="microphone"===R;let ps,ms,fs;y[58]!==H||y[59]!==es||y[60]!==us||y[61]!==ds||y[62]!==gs?(ps=(0,S.jsx)(p.DesktopPermissionRow,{title:us,showBorder:!0,status:ds,isRequesting:gs,onRequest:H,labels:es}),y[58]=H,y[59]=es,y[60]=us,y[61]=ds,y[62]=gs,y[63]=ps):ps=y[63];y[64]!==ls||y[65]!==as||y[66]!==ps?(ms=(0,S.jsxs)(t.View,{style:h.settingsStyles.card,children:[ls,as,ps]}),y[64]=ls,y[65]=as,y[66]=ps,y[67]=ms):ms=y[67];y[68]!==W||y[69]!==ts||y[70]!==ms?(fs=(0,S.jsx)(x.SettingsSection,{title:ts,trailing:W,children:ms}),y[68]=W,y[69]=ts,y[70]=ms,y[71]=fs):fs=y[71];return fs};var s=r(d[0]),t=r(d[1]),n=r(d[2]);r(d[3]);var o=r(d[4]);r(d[5]),r(d[6]);var c=r(d[7]),l=r(d[8]),u=r(d[9]),p=r(d[10]),f=r(d[11]),h=r(d[12]),x=r(d[13]),S=r(d[14]);const b=c.StyleSheet.create(s=>({errorText:{fontSize:s.fontSize.xs,paddingHorizontal:s.spacing[4],paddingBottom:s.spacing[2],uni__dependencies:[0]}}))},4736,[711,348,349,36,1573,146,234,56,1600,3627,4737,4738,3907,4727,279]);
|
|
16496
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.DesktopPermissionRow=function(h){const y=(0,n.c)(27),{title:f,status:w,isRequesting:S,labels:_,showBorder:b,onRequest:j,extraActionLabel:A,isExtraActionBusy:z,isExtraActionDisabled:T,onExtraAction:v}=h,R=void 0!==z&&z,D=void 0!==T&&T,{theme:P}=(0,o.useUnistyles)(),V=w?.state??"unknown",B="granted"===V;let C;y[0]!==V||y[1]!==w?(C=null!==w&&w.detail.trim().length>0&&"granted"!==V&&"prompt"!==V&&"not-granted"!==V,y[0]=V,y[1]=w,y[2]=C):C=y[2];const k=C,q=b&&u.settingsStyles.rowBorder;let E;y[3]!==q?(E=[u.settingsStyles.row,q],y[3]=q,y[4]=E):E=y[4];const M=E;let I,W,G,H,L;y[5]!==f?(I=(0,x.jsx)(s.View,{style:u.settingsStyles.rowContent,children:(0,x.jsx)(t.Text,{style:u.settingsStyles.rowTitle,children:f})}),y[5]=f,y[6]=I):I=y[6];y[7]!==A||y[8]!==R||y[9]!==D||y[10]!==B||y[11]!==S||y[12]!==_||y[13]!==v||y[14]!==j||y[15]!==P?(W=B?(0,x.jsxs)(s.View,{style:p.permissionGrantedActions,children:[(0,x.jsxs)(s.View,{style:p.permissionStatusPill,children:[(0,x.jsx)(l.Check,{size:P.iconSize.sm,color:P.colors.foregroundMuted}),(0,x.jsx)(t.Text,{style:p.permissionStatusText,children:_.granted})]}),A&&v?(0,x.jsx)(c.Button,{variant:"outline",size:"sm",onPress:v,disabled:D||R,children:R?_.busyExtraAction(A):A}):null]}):(0,x.jsx)(c.Button,{variant:"outline",size:"sm",onPress:j,disabled:S,children:S?_.requesting:_.request}),y[7]=A,y[8]=R,y[9]=D,y[10]=B,y[11]=S,y[12]=_,y[13]=v,y[14]=j,y[15]=P,y[16]=W):W=y[16];y[17]!==k||y[18]!==w?.detail?(G=k?(0,x.jsx)(t.Text,{style:p.permissionDetailText,children:w?.detail}):null,y[17]=k,y[18]=w?.detail,y[19]=G):G=y[19];y[20]!==W||y[21]!==G?(H=(0,x.jsxs)(s.View,{style:p.permissionRowActions,children:[W,G]}),y[20]=W,y[21]=G,y[22]=H):H=y[22];y[23]!==M||y[24]!==I||y[25]!==H?(L=(0,x.jsxs)(s.View,{style:M,children:[I,H]}),y[23]=M,y[24]=I,y[25]=H,y[26]=L):L=y[26];return L};var t=r(d[0]),s=r(d[1]),n=r(d[2]);r(d[3]),r(d[4]),r(d[5]);var o=r(d[6]),l=r(d[7]),c=r(d[8]),u=r(d[9]),x=r(d[10]);const p=o.StyleSheet.create(t=>({permissionRowActions:{alignItems:"flex-end",gap:t.spacing[1],uni__dependencies:[0]},permissionGrantedActions:{flexDirection:"row",alignItems:"center",gap:t.spacing[2],uni__dependencies:[0]},permissionStatusPill:{flexDirection:"row",alignItems:"center",gap:t.spacing[1],borderRadius:t.borderRadius.full,borderWidth:1,borderColor:t.colors.border,backgroundColor:t.colors.surface3,paddingHorizontal:t.spacing[2],paddingVertical:4,minWidth:88,justifyContent:"center",uni__dependencies:[0]},permissionStatusText:{fontSize:t.fontSize.xs,color:t.colors.foregroundMuted,uni__dependencies:[0]},permissionDetailText:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,maxWidth:220,textAlign:"right",uni__dependencies:[0]}}))},4737,[711,348,349,36,146,234,56,1600,3627,3907,279]);
|
|
16497
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useDesktopPermissions=function(){const{t:c}=(0,s.useTranslation)(),u=(0,n.shouldShowDesktopPermissionSection)(),l=(0,t.useRef)(!0),[f,p]=(0,t.useState)(null),[k,h]=(0,t.useState)(!1),[y,S]=(0,t.useState)(null),[w,D]=(0,t.useState)(!1);(0,t.useEffect)(()=>()=>{l.current=!1},[]);const b=(0,t.useCallback)(async()=>{if(u){h(!0);try{const t=await(0,n.getDesktopPermissionSnapshot)();if(!l.current)return;p(t)}catch(t){console.error("[Settings] Failed to load desktop permission status",t)}finally{l.current&&h(!1)}}},[u]),N=(0,t.useCallback)(async t=>{if(u){S(t);try{const s=await(0,n.requestDesktopPermission)({kind:t});if(!l.current)return;p(n=>{const o=n??{checkedAt:Date.now(),notifications:{state:"unknown",detail:c("desktop.permissions.empty.notifications")},microphone:{state:"unknown",detail:c("desktop.permissions.empty.microphone")}};return"notifications"===t?Object.assign({},o,{checkedAt:Date.now(),notifications:s}):Object.assign({},o,{checkedAt:Date.now(),microphone:s})})}catch(s){console.error(`[Settings] Failed to request ${t} permission`,s)}finally{l.current&&S(null),await b()}}},[u,b,c]),[P,q]=(0,t.useState)(null),A=(0,t.useCallback)(async()=>{if(u){D(!0),q(null);try{await(0,o.sendOsNotification)({title:c("desktop.permissions.testNotification.title"),body:c("desktop.permissions.testNotification.body")})||q(c("desktop.permissions.testNotification.notDelivered"))}catch{q(c("desktop.permissions.testNotification.failed"))}finally{l.current&&D(!1)}}},[u,c]);return(0,t.useEffect)(()=>{u&&b()},[u,b]),{isDesktopApp:u,snapshot:f,isRefreshing:k,requestingPermission:y,isSendingTestNotification:w,testNotificationError:P,refreshPermissions:b,requestPermission:N,sendTestNotification:A}};var t=r(d[0]),s=r(d[1]),n=r(d[2]),o=r(d[3])},4738,[36,1573,4739,4106]);
|
|
16498
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.createDesktopPermissions=f,Object.defineProperty(e,"shouldShowDesktopPermissionSection",{enumerable:!0,get:function(){return b}}),Object.defineProperty(e,"getDesktopPermissionSnapshot",{enumerable:!0,get:function(){return y}}),Object.defineProperty(e,"requestDesktopPermission",{enumerable:!0,get:function(){return h}});var t=r(d[0]),n=r(d[1]),s=r(d[2]);function o(t){return"object"==typeof t&&null!==t}function p(t){return t instanceof Error&&"string"==typeof t.message?t.message:String(t)}function u(t){if(!o(t))return null;const n=t.name;return"string"==typeof n&&n.length>0?n:null}function c(t){const n=p(t);return!(!n.includes("Can only call Permissions.query on instances of Permissions")&&!n.includes("Illegal invocation"))}function l(t){return"granted"===t?{state:"granted",detail:s.i18n.t("desktop.permissions.notifications.allowed")}:"denied"===t?{state:"denied",detail:s.i18n.t("desktop.permissions.notifications.denied")}:"default"===t?{state:"prompt",detail:s.i18n.t("desktop.permissions.notifications.notGranted")}:{state:"unknown",detail:s.i18n.t("desktop.permissions.notifications.unexpectedState",{state:t})}}function f(t){async function n(){if(!t.isWeb)return{state:"unavailable",detail:s.i18n.t("desktop.permissions.notifications.webOnly")};const n=t.getDesktopHost();if(n&&"function"==typeof n.notification?.isSupported)try{const t=await n.notification.isSupported();return{state:t?"granted":"unavailable",detail:t?s.i18n.t("desktop.permissions.notifications.supported"):s.i18n.t("desktop.permissions.notifications.unsupported")}}catch{}const o=t.getNotification();return o&&"string"==typeof o.permission?l(o.permission):{state:"unavailable",detail:s.i18n.t("desktop.permissions.notifications.apiUnavailable")}}async function o(){if(!t.isWeb)return{state:"unavailable",detail:s.i18n.t("desktop.permissions.microphone.webOnly")};const n=t.getNavigator();if(!n)return{state:"unavailable",detail:s.i18n.t("desktop.permissions.microphone.navigatorUnavailable")};const o=n.permissions;if(o&&"function"==typeof o.query)try{const t=await o.query({name:"microphone"});return"granted"===t?.state?{state:"granted",detail:s.i18n.t("desktop.permissions.microphone.granted")}:"denied"===t?.state?{state:"denied",detail:s.i18n.t("desktop.permissions.microphone.denied")}:"prompt"===t?.state?{state:"prompt",detail:s.i18n.t("desktop.permissions.microphone.notGranted")}:{state:"unknown",detail:s.i18n.t("desktop.permissions.microphone.unexpectedState",{state:t?.state??"unknown"})}}catch(t){return c(t)?{state:"unknown",detail:s.i18n.t("desktop.permissions.microphone.statusApiUnavailable")}:{state:"unknown",detail:s.i18n.t("desktop.permissions.microphone.queryFailed",{message:p(t)})}}return"function"!=typeof n.mediaDevices?.getUserMedia?{state:"unavailable",detail:s.i18n.t("desktop.permissions.microphone.captureUnavailable")}:{state:"unknown",detail:s.i18n.t("desktop.permissions.microphone.permissionApiUnavailable")}}async function f(){if(!t.isWeb)return{state:"unavailable",detail:s.i18n.t("desktop.permissions.notifications.requestsWebOnly")};const n=t.getNotification();if(n&&"function"==typeof n.requestPermission)try{return l(await n.requestPermission())}catch(t){return{state:"unknown",detail:s.i18n.t("desktop.permissions.notifications.requestFailed",{message:p(t)})}}return{state:"unavailable",detail:s.i18n.t("desktop.permissions.notifications.requestUnavailable")}}async function k(){if(!t.isWeb)return{state:"unavailable",detail:s.i18n.t("desktop.permissions.microphone.requestsWebOnly")};const n=t.getNavigator();if(!n||"function"!=typeof n.mediaDevices?.getUserMedia)return{state:"unavailable",detail:s.i18n.t("desktop.permissions.microphone.captureApiUnavailable")};try{const t=await n.mediaDevices.getUserMedia({audio:!0});return(t&&"function"==typeof t.getTracks?t.getTracks():[]).forEach(t=>{"function"==typeof t.stop&&t.stop()}),await o()}catch(t){const n=u(t);return"NotAllowedError"===n||"PermissionDeniedError"===n?{state:"denied",detail:s.i18n.t("desktop.permissions.microphone.requestDenied")}:"NotFoundError"===n||"DevicesNotFoundError"===n?{state:"unavailable",detail:s.i18n.t("desktop.permissions.microphone.noDevice")}:{state:"unknown",detail:s.i18n.t("desktop.permissions.microphone.requestFailed",{message:p(t)})}}}return{shouldShowDesktopPermissionSection:function(){return t.isWeb&&null!==t.getDesktopHost()},getDesktopPermissionSnapshot:async function(){const[t,s]=await Promise.all([n(),o()]);return{checkedAt:Date.now(),notifications:t,microphone:s}},requestDesktopPermission:async function(t){return"notifications"===t.kind?await f():await k()}}}const k=f({isWeb:n.isWeb,getDesktopHost:t.getDesktopHost,getNotification:function(){if(n.isNative)return null;const t=globalThis.Notification;return null==t||"function"!=typeof t&&"object"!=typeof t?null:t},getNavigator:function(){if(n.isNative)return null;const t=globalThis.navigator;return o(t)?t:null}}),b=k.shouldShowDesktopPermissionSection,y=k.getDesktopPermissionSnapshot,h=k.requestDesktopPermission},4739,[3404,3407,3534]);
|
|
16499
|
+
__d(function(g,r,i,_a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.IntegrationsSection=function(){const h=(0,n.c)(103),{t:j}=(0,o.useTranslation)(),{theme:k}=(0,a.useUnistyles)();let T;h[0]===Symbol.for("react.memo_cache_sentinel")?(T=(0,p.shouldUseDesktopDaemon)(),h[0]=T):T=h[0];const b=T,{status:I,isInstalling:U,install:B,refresh:D}=(0,w.useCliInstall)(),{status:P,isWorking:C,install:R,update:H,uninstall:E,refresh:W}=(0,w.useSkillsStatus)();let A,F;h[1]!==D||h[2]!==W?(A=()=>{b&&(D(),W())},h[1]=D,h[2]=W,h[3]=A):A=h[3];(0,l.useFocusEffect)(A),h[4]!==B||h[5]!==U?(F=()=>{U||B()},h[4]=B,h[5]=U,h[6]=F):F=h[6];const $=F;let O;h[7]!==R||h[8]!==C?(O=()=>{C||R()},h[7]=R,h[8]=C,h[9]=O):O=h[9];const q=O;let G;h[10]!==C||h[11]!==P?.ops||h[12]!==j||h[13]!==H?(G=async()=>{if(C)return;const t=P?.ops??[];await(0,y.confirmDialog)({title:j("settings.integrations.skills.updateTitle"),message:t.length>0?L(t,j):j("settings.integrations.skills.updateFallback"),confirmLabel:j("settings.integrations.actions.update")})&&await H()},h[10]=C,h[11]=P?.ops,h[12]=j,h[13]=H,h[14]=G):G=h[14];const J=G;let K;h[15]!==C||h[16]!==j||h[17]!==E?(K=async()=>{if(C)return;await(0,y.confirmDialog)({title:j("settings.integrations.skills.uninstallTitle"),message:j("settings.integrations.skills.uninstallMessage"),confirmLabel:j("settings.integrations.actions.uninstall"),destructive:!0})&&await E()},h[15]=C,h[16]=j,h[17]=E,h[18]=K):K=h[18];const N=K,Q=v,X=_;let Y;h[19]!==k.colors.foregroundMuted||h[20]!==k.iconSize.sm?(Y=(0,S.jsx)(c.ArrowUpRight,{size:k.iconSize.sm,color:k.colors.foregroundMuted}),h[19]=k.colors.foregroundMuted,h[20]=k.iconSize.sm,h[21]=Y):Y=h[21];const Z=Y;let tt,et,st,nt,it,ot,lt;h[22]!==j?(tt=j("settings.integrations.docs.openCli"),h[22]=j,h[23]=tt):tt=h[23];h[24]!==j?(et=j("settings.integrations.docs.cli"),h[24]=j,h[25]=et):et=h[25];h[26]!==Z||h[27]!==tt||h[28]!==et?(st=(0,S.jsx)(f.Button,{variant:"ghost",size:"sm",leftIcon:Z,textStyle:u.settingsStyles.sectionHeaderLinkText,style:u.settingsStyles.sectionHeaderLink,onPress:Q,accessibilityLabel:tt,children:et}),h[26]=Z,h[27]=tt,h[28]=et,h[29]=st):st=h[29];h[30]!==j?(nt=j("settings.integrations.docs.openSkills"),h[30]=j,h[31]=nt):nt=h[31];h[32]!==j?(it=j("settings.integrations.docs.skills"),h[32]=j,h[33]=it):it=h[33];h[34]!==Z||h[35]!==nt||h[36]!==it?(ot=(0,S.jsx)(f.Button,{variant:"ghost",size:"sm",leftIcon:Z,textStyle:u.settingsStyles.sectionHeaderLinkText,style:u.settingsStyles.sectionHeaderLink,onPress:X,accessibilityLabel:nt,children:it}),h[34]=Z,h[35]=nt,h[36]=it,h[37]=ot):ot=h[37];h[38]!==ot||h[39]!==st?(lt=(0,S.jsxs)(t.View,{style:V.headerLinks,children:[st,ot]}),h[38]=ot,h[39]=st,h[40]=lt):lt=h[40];const rt=lt;if(!b)return null;const at=P?.state??null;let ct,dt,gt,ut,xt,ft,mt,ht,yt,pt,wt,St,jt,kt,zt,Tt,bt,Lt,_t,vt,Mt;h[41]!==j?(ct=j("settings.integrations.title"),h[41]=j,h[42]=ct):ct=h[42];h[43]!==k.colors.foreground||h[44]!==k.iconSize.md?(dt=(0,S.jsx)(c.Terminal,{size:k.iconSize.md,color:k.colors.foreground}),h[43]=k.colors.foreground,h[44]=k.iconSize.md,h[45]=dt):dt=h[45];h[46]!==j?(gt=j("settings.integrations.commandLine.title"),h[46]=j,h[47]=gt):gt=h[47];h[48]!==gt?(ut=(0,S.jsx)(s.Text,{style:u.settingsStyles.rowTitle,children:gt}),h[48]=gt,h[49]=ut):ut=h[49];h[50]!==dt||h[51]!==ut?(xt=(0,S.jsxs)(t.View,{style:V.rowTitleRow,children:[dt,ut]}),h[50]=dt,h[51]=ut,h[52]=xt):xt=h[52];h[53]!==j?(ft=j("settings.integrations.commandLine.description"),h[53]=j,h[54]=ft):ft=h[54];h[55]!==ft?(mt=(0,S.jsx)(s.Text,{style:u.settingsStyles.rowHint,children:ft}),h[55]=ft,h[56]=mt):mt=h[56];h[57]!==xt||h[58]!==mt?(ht=(0,S.jsxs)(t.View,{style:u.settingsStyles.rowContent,children:[xt,mt]}),h[57]=xt,h[58]=mt,h[59]=ht):ht=h[59];h[60]!==I?.installed||h[61]!==$||h[62]!==U||h[63]!==j||h[64]!==k.colors.foregroundMuted?(yt=I?.installed?(0,S.jsxs)(t.View,{style:V.installedLabel,children:[(0,S.jsx)(c.Check,{size:14,color:k.colors.foregroundMuted}),(0,S.jsx)(s.Text,{style:V.mutedText,children:j("settings.integrations.actions.installed")})]}):(0,S.jsx)(f.Button,{variant:"outline",size:"sm",onPress:$,disabled:U,children:j(U?"settings.integrations.actions.installing":"settings.integrations.actions.install")}),h[60]=I?.installed,h[61]=$,h[62]=U,h[63]=j,h[64]=k.colors.foregroundMuted,h[65]=yt):yt=h[65];h[66]!==ht||h[67]!==yt?(pt=(0,S.jsxs)(t.View,{style:u.settingsStyles.row,children:[ht,yt]}),h[66]=ht,h[67]=yt,h[68]=pt):pt=h[68];h[69]!==k.colors.foreground||h[70]!==k.iconSize.md?(wt=(0,S.jsx)(c.Blocks,{size:k.iconSize.md,color:k.colors.foreground}),h[69]=k.colors.foreground,h[70]=k.iconSize.md,h[71]=wt):wt=h[71];h[72]!==j?(St=j("settings.integrations.skills.title"),h[72]=j,h[73]=St):St=h[73];h[74]!==St?(jt=(0,S.jsx)(s.Text,{style:u.settingsStyles.rowTitle,children:St}),h[74]=St,h[75]=jt):jt=h[75];h[76]!==wt||h[77]!==jt?(kt=(0,S.jsxs)(t.View,{style:V.rowTitleRow,children:[wt,jt]}),h[76]=wt,h[77]=jt,h[78]=kt):kt=h[78];h[79]!==at||h[80]!==j?(zt=j("drift"===at?"settings.integrations.skills.updateAvailable":"settings.integrations.skills.description"),h[79]=at,h[80]=j,h[81]=zt):zt=h[81];h[82]!==zt?(Tt=(0,S.jsx)(s.Text,{style:u.settingsStyles.rowHint,children:zt}),h[82]=zt,h[83]=Tt):Tt=h[83];h[84]!==kt||h[85]!==Tt?(bt=(0,S.jsxs)(t.View,{style:u.settingsStyles.rowContent,children:[kt,Tt]}),h[84]=kt,h[85]=Tt,h[86]=bt):bt=h[86];h[87]!==q||h[88]!==N||h[89]!==J||h[90]!==C||h[91]!==at?(Lt=(0,S.jsx)(M,{state:at,isWorking:C,onInstall:q,onUpdate:J,onUninstall:N}),h[87]=q,h[88]=N,h[89]=J,h[90]=C,h[91]=at,h[92]=Lt):Lt=h[92];h[93]!==bt||h[94]!==Lt?(_t=(0,S.jsxs)(t.View,{style:z,children:[bt,Lt]}),h[93]=bt,h[94]=Lt,h[95]=_t):_t=h[95];h[96]!==pt||h[97]!==_t?(vt=(0,S.jsxs)(t.View,{style:u.settingsStyles.card,children:[pt,_t]}),h[96]=pt,h[97]=_t,h[98]=vt):vt=h[98];h[99]!==ct||h[100]!==vt||h[101]!==rt?(Mt=(0,S.jsx)(x.SettingsSection,{title:ct,trailing:rt,children:vt}),h[99]=ct,h[100]=vt,h[101]=rt,h[102]=Mt):Mt=h[102];return Mt};var t=r(d[0]),s=r(d[1]),n=r(d[2]);r(d[3]);var o=r(d[4]);r(d[5]),r(d[6]);var l=r(d[7]),a=r(d[8]),c=r(d[9]),u=r(d[10]),x=r(d[11]),f=r(d[12]),h=r(d[13]),y=r(d[14]),p=r(d[15]),w=r(d[16]),S=r(d[17]);const j="https://paseo.sh/docs/cli",k="https://paseo.sh/docs/skills",z=[u.settingsStyles.row,u.settingsStyles.rowBorder],T={add:0,update:1,delete:2},b={add:"settings.integrations.operations.add",update:"settings.integrations.operations.update",delete:"settings.integrations.operations.delete"};function L(t,s){return[...t].sort((t,s)=>{const n=T[t.kind]-T[s.kind];return 0!==n?n:t.name.localeCompare(s.name)}).map(t=>`${s(b[t.kind])} ${t.name}`).join("\n")}function _(){(0,h.openExternalUrl)(k)}function v(){(0,h.openExternalUrl)(j)}function M(l){const u=(0,n.c)(41),{state:x,isWorking:h,onInstall:y,onUpdate:p,onUninstall:w}=l,{t:j}=(0,o.useTranslation)(),{theme:k}=(0,a.useUnistyles)();if("up-to-date"===x){let n,o,l,a,x,y,p;return u[0]!==k.colors.foregroundMuted?(n=(0,S.jsx)(c.Check,{size:14,color:k.colors.foregroundMuted}),u[0]=k.colors.foregroundMuted,u[1]=n):n=u[1],u[2]!==j?(o=j("settings.integrations.actions.installed"),u[2]=j,u[3]=o):o=u[3],u[4]!==o?(l=(0,S.jsx)(s.Text,{style:V.mutedText,children:o}),u[4]=o,u[5]=l):l=u[5],u[6]!==n||u[7]!==l?(a=(0,S.jsxs)(t.View,{style:V.installedLabel,children:[n,l]}),u[6]=n,u[7]=l,u[8]=a):a=u[8],u[9]!==j?(x=j("settings.integrations.actions.uninstall"),u[9]=j,u[10]=x):x=u[10],u[11]!==h||u[12]!==w||u[13]!==x?(y=(0,S.jsx)(f.Button,{variant:"outline",size:"sm",onPress:w,disabled:h,children:x}),u[11]=h,u[12]=w,u[13]=x,u[14]=y):y=u[14],u[15]!==a||u[16]!==y?(p=(0,S.jsxs)(t.View,{style:V.actionsRow,children:[a,y]}),u[15]=a,u[16]=y,u[17]=p):p=u[17],p}if("drift"===x){let s,n,o,l,a;return u[18]!==h||u[19]!==j?(s=j(h?"settings.integrations.actions.working":"settings.integrations.actions.update"),u[18]=h,u[19]=j,u[20]=s):s=u[20],u[21]!==h||u[22]!==p||u[23]!==s?(n=(0,S.jsx)(f.Button,{variant:"outline",size:"sm",onPress:p,disabled:h,children:s}),u[21]=h,u[22]=p,u[23]=s,u[24]=n):n=u[24],u[25]!==j?(o=j("settings.integrations.actions.uninstall"),u[25]=j,u[26]=o):o=u[26],u[27]!==h||u[28]!==w||u[29]!==o?(l=(0,S.jsx)(f.Button,{variant:"outline",size:"sm",onPress:w,disabled:h,children:o}),u[27]=h,u[28]=w,u[29]=o,u[30]=l):l=u[30],u[31]!==n||u[32]!==l?(a=(0,S.jsxs)(t.View,{style:V.actionsRow,children:[n,l]}),u[31]=n,u[32]=l,u[33]=a):a=u[33],a}let z,T;return u[34]!==h||u[35]!==j?(z=j(h?"settings.integrations.actions.installing":"settings.integrations.actions.install"),u[34]=h,u[35]=j,u[36]=z):z=u[36],u[37]!==h||u[38]!==y||u[39]!==z?(T=(0,S.jsx)(f.Button,{variant:"outline",size:"sm",onPress:y,disabled:h,children:z}),u[37]=h,u[38]=y,u[39]=z,u[40]=T):T=u[40],T}const V=a.StyleSheet.create(t=>({headerLinks:{flexDirection:"row",alignItems:"center",gap:t.spacing[0],uni__dependencies:[0]},rowTitleRow:{flexDirection:"row",alignItems:"center",gap:t.spacing[2],uni__dependencies:[0]},installedLabel:{flexDirection:"row",alignItems:"center",gap:4},mutedText:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,uni__dependencies:[0]},actionsRow:{flexDirection:"row",alignItems:"center",gap:t.spacing[2],uni__dependencies:[0]}}))},4740,[348,711,349,36,1573,234,146,1148,56,1600,3907,4727,3627,3562,3678,3403,4741,279]);
|
|
16500
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useCliInstall=function(){const c=(0,t.c)(24),{t:y}=(0,n.useTranslation)(),k=(0,s.useQueryClient)(),p=(0,l.useDesktopIpcErrorReporter)();let F;c[0]===Symbol.for("react.memo_cache_sentinel")?(F=(0,o.shouldUseDesktopDaemon)(),c[0]=F):F=c[0];const S=F;let f;c[1]===Symbol.for("react.memo_cache_sentinel")?(f={queryKey:u,queryFn:o.getCliInstallStatus,enabled:S,retry:!1},c[1]=f):f=c[1];const I=(0,s.useQuery)(f),{data:b,error:h,isLoading:L,refetch:_}=I,D=I.error;let Q,E,C,q,M;c[2]!==y?(Q=y("desktop.integrations.cli.statusFailed"),c[2]=y,c[3]=Q):Q=c[3];c[4]!==I.error||c[5]!==Q?(E={error:D,message:Q,logLabel:"[Integrations] Failed to load CLI status"},c[4]=I.error,c[5]=Q,c[6]=E):E=c[6];(0,l.useDesktopIpcQueryErrorToast)(E),c[7]!==p||c[8]!==y?(C=t=>{p({error:t,message:y("desktop.integrations.cli.installFailed"),logLabel:"[Integrations] Failed to install CLI"})},c[7]=p,c[8]=y,c[9]=C):C=c[9];c[10]!==k?(q=t=>{k.setQueryData(u,t),k.invalidateQueries({queryKey:u})},c[10]=k,c[11]=q):q=c[11];c[12]!==C||c[13]!==q?(M={mutationFn:o.installCli,onError:C,onSuccess:q},c[12]=C,c[13]=q,c[14]=M):M=c[14];const P=(0,s.useMutation)(M),{error:v,isPending:w,mutate:T}=P;let A;c[15]!==_?(A=()=>{_()},c[15]=_,c[16]=A):A=c[16];const K=A,R=b??null,U=h??v??null;let j;c[17]!==T||c[18]!==w||c[19]!==L||c[20]!==K||c[21]!==U||c[22]!==R?(j={status:R,isLoading:L,isInstalling:w,error:U,install:T,refresh:K},c[17]=T,c[18]=w,c[19]=L,c[20]=K,c[21]=U,c[22]=R,c[23]=j):j=c[23];return j},e.useSkillsStatus=function(){const u=(0,t.c)(44),{t:F}=(0,n.useTranslation)(),S=(0,s.useQueryClient)(),f=(0,l.useDesktopIpcErrorReporter)();let I;u[0]===Symbol.for("react.memo_cache_sentinel")?(I=(0,o.shouldUseDesktopDaemon)(),u[0]=I):I=u[0];const b=I;let h;u[1]===Symbol.for("react.memo_cache_sentinel")?(h={queryKey:c,queryFn:o.getSkillsStatus,enabled:b,retry:!1},u[1]=h):h=u[1];const L=(0,s.useQuery)(h),{data:_,error:D,isLoading:Q,refetch:E}=L,C=L.error;let q,M,P;u[2]!==F?(q=F("desktop.integrations.skills.statusFailed"),u[2]=F,u[3]=q):q=u[3];u[4]!==L.error||u[5]!==q?(M={error:C,message:q,logLabel:"[Integrations] Failed to load skills status"},u[4]=L.error,u[5]=q,u[6]=M):M=u[6];(0,l.useDesktopIpcQueryErrorToast)(M),u[7]!==S?(P=t=>{S.setQueryData(c,t)},u[7]=S,u[8]=P):P=u[8];const v=P;let w,T;u[9]!==f||u[10]!==F?(w=t=>{f({error:t,message:F("desktop.integrations.skills.installFailed"),logLabel:"[Integrations] Failed to install skills"})},u[9]=f,u[10]=F,u[11]=w):w=u[11];u[12]!==v||u[13]!==w?(T={mutationFn:o.installSkills,onError:w,onSuccess:v},u[12]=v,u[13]=w,u[14]=T):T=u[14];const A=(0,s.useMutation)(T);let K,R;u[15]!==f||u[16]!==F?(K=t=>{f({error:t,message:F("desktop.integrations.skills.updateFailed"),logLabel:"[Integrations] Failed to update skills"})},u[15]=f,u[16]=F,u[17]=K):K=u[17];u[18]!==v||u[19]!==K?(R={mutationFn:o.updateSkills,onError:K,onSuccess:v},u[18]=v,u[19]=K,u[20]=R):R=u[20];const U=(0,s.useMutation)(R);let j,O;u[21]!==f||u[22]!==F?(j=t=>{f({error:t,message:F("desktop.integrations.skills.uninstallFailed"),logLabel:"[Integrations] Failed to uninstall skills"})},u[21]=f,u[22]=F,u[23]=j):j=u[23];u[24]!==v||u[25]!==j?(O={mutationFn:o.uninstallSkills,onError:j,onSuccess:v},u[24]=v,u[25]=j,u[26]=O):O=u[26];const W=(0,s.useMutation)(O),x=A.isPending||U.isPending||W.isPending;let z;u[27]!==E?(z=async()=>{await E()},u[27]=E,u[28]=z):z=u[28];const B=z;let G;u[29]!==A?(G=async()=>{await A.mutateAsync().catch(p)},u[29]=A,u[30]=G):G=u[30];const H=G;let J;u[31]!==U?(J=async()=>{await U.mutateAsync().catch(k)},u[31]=U,u[32]=J):J=u[32];const N=J;let V;u[33]!==W?(V=async()=>{await W.mutateAsync().catch(y)},u[33]=W,u[34]=V):V=u[34];const X=V,Y=_??null,Z=D??A.error??U.error??W.error??null;let $;u[35]!==H||u[36]!==Q||u[37]!==x||u[38]!==B||u[39]!==Y||u[40]!==Z||u[41]!==X||u[42]!==N?($={status:Y,isLoading:Q,isWorking:x,error:Z,refresh:B,install:H,update:N,uninstall:X},u[35]=H,u[36]=Q,u[37]=x,u[38]=B,u[39]=Y,u[40]=Z,u[41]=X,u[42]=N,u[43]=$):$=u[43];return $};var t=r(d[0]);r(d[1]);var s=r(d[2]),n=r(d[3]),o=r(d[4]),l=r(d[5]);const u=["desktop","integrations","cli-install-status"],c=["desktop","integrations","skills-status"];function y(){}function k(){}function p(){}},4741,[349,36,916,1573,3403,3577]);
|
|
16501
|
+
__d(function(g,r,i,a,m,_e,_d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.LocalDaemonSection=function(){const o=(0,s.c)(79),{t:l}=(0,p.useTranslation)(),{theme:d}=(0,h.useUnistyles)(),c=(0,w.shouldUseDesktopDaemon)(),u=(0,M.resolveAppVersion)(),{settings:x,updateSettings:C,isLoading:T}=(0,A.useDesktopSettings)(),z=x.daemon;let R;o[0]!==C?(R=e=>C({daemon:e}),o[0]=C,o[1]=R):R=o[1];const B=R,{data:H,isLoading:E,error:K,setStatus:G,refetch:W}=(0,v.useDaemonStatus)(),q=H?.status??null,J=H?.logs??null,N=q?.version??null,X=(0,k.isVersionMismatch)(u,N);let Y;o[2]!==q?.status||o[3]!==K||o[4]!==l?(Y=K??l("running"===q?.status?"desktop.daemon.status.running":"desktop.daemon.status.notRunning"),o[2]=q?.status,o[3]=K,o[4]=l,o[5]=Y):Y=o[5];const Z=Y,$=q?.pid?q.pid:"\u2014";let ee;o[6]!==l||o[7]!==$?(ee=l("desktop.daemon.status.pid",{pid:$}),o[6]=l,o[7]=$,o[8]=ee):ee=o[8];const te=ee,ne=!z.manageBuiltInDaemon;let se;o[9]!==z||o[10]!==q||o[11]!==W||o[12]!==G||o[13]!==B?(se={daemonStatus:q,settings:z,updateSettings:B,setStatus:G,refreshStatus:W},o[9]=z,o[10]=q,o[11]=W,o[12]=G,o[13]=B,o[14]=se):se=o[14];const{isUpdating:oe,toggle:ie}=(0,b.useBuiltInDaemonManagement)(se);let le;o[15]!==z||o[16]!==B?(le={settings:z,updateSettings:B},o[15]=z,o[16]=B,o[17]=le):le=o[17];const{isUpdatingKeepRunningAfterQuit:ae,handleToggleKeepRunningAfterQuit:de}=P(le),{isLogsModalOpen:re,handleCopyLogPath:ce,handleOpenLogs:ue,handleCloseLogsModal:ge}=D(J),{cliStatusOutput:pe,isCliStatusModalOpen:me,isLoadingCliStatus:he,handleCopyCliStatus:Se,handleOpenCliStatus:ye,handleCloseCliStatusModal:fe}=L();let xe;o[18]!==ye?(xe=()=>{ye()},o[18]=ye,o[19]=xe):xe=o[19];const je=xe,Ce=Q;let Te;o[20]!==d.colors.foregroundMuted||o[21]!==d.iconSize.sm?(Te=(0,_.jsx)(f.ArrowUpRight,{size:d.iconSize.sm,color:d.colors.foregroundMuted}),o[20]=d.colors.foregroundMuted,o[21]=d.iconSize.sm,o[22]=Te):Te=o[22];const ke=Te;let we;o[23]!==d.colors.foreground||o[24]!==d.iconSize.sm?(we=(0,_.jsx)(f.Copy,{size:d.iconSize.sm,color:d.colors.foreground}),o[23]=d.colors.foreground,o[24]=d.iconSize.sm,o[25]=we):we=o[25];const be=we;let ve;o[26]!==d.colors.foreground||o[27]!==d.iconSize.sm?(ve=(0,_.jsx)(f.FileText,{size:d.iconSize.sm,color:d.colors.foreground}),o[26]=d.colors.foreground,o[27]=d.iconSize.sm,o[28]=ve):ve=o[28];const Ae=ve;let Me;o[29]!==d.colors.foreground||o[30]!==d.iconSize.sm?(Me=(0,_.jsx)(f.Activity,{size:d.iconSize.sm,color:d.colors.foreground}),o[29]=d.colors.foreground,o[30]=d.iconSize.sm,o[31]=Me):Me=o[31];const ze=Me;let Pe,Re,Le;o[32]!==l?(Pe=l("desktop.daemon.openAdvancedSettings"),o[32]=l,o[33]=Pe):Pe=o[33];o[34]!==l?(Re=l("desktop.daemon.advancedSettings"),o[34]=l,o[35]=Re):Re=o[35];o[36]!==ke||o[37]!==Pe||o[38]!==Re?(Le=(0,_.jsx)(j.Button,{variant:"ghost",size:"sm",leftIcon:ke,textStyle:S.settingsStyles.sectionHeaderLinkText,style:S.settingsStyles.sectionHeaderLink,onPress:Ce,accessibilityLabel:Pe,children:Re}),o[36]=ke,o[37]=Pe,o[38]=Re,o[39]=Le):Le=o[39];const De=Le;if(!c)return null;let Ve,Oe,Ie,Qe,Be;o[40]!==l?(Ve=l("desktop.daemon.title"),o[40]=l,o[41]=Ve):Ve=o[41];o[42]!==ze||o[43]!==be||o[44]!==J||o[45]!==z.keepRunningAfterQuit||o[46]!==te||o[47]!==Z||o[48]!==X||o[49]!==Ae||o[50]!==ce||o[51]!==ue||o[52]!==je||o[53]!==ie||o[54]!==de||o[55]!==ne||o[56]!==E||o[57]!==he||o[58]!==T||o[59]!==oe||o[60]!==ae||o[61]!==l||o[62]!==d.colors.foregroundMuted?(Oe=E||T?(0,_.jsx)(e.View,{style:F,children:(0,_.jsx)(n.ActivityIndicator,{size:"small",color:d.colors.foregroundMuted})}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(I,{daemonStatusStateText:Z,daemonStatusDetailText:te,isDaemonManagementPaused:ne,copyIcon:be,fileTextIcon:Ae,activityIcon:ze,handleToggleDaemonManagement:ie,isUpdatingDaemonManagement:oe,keepRunningAfterQuit:z.keepRunningAfterQuit,handleToggleKeepRunningAfterQuit:de,isUpdatingKeepRunningAfterQuit:ae,daemonLogs:J,handleCopyLogPath:ce,handleOpenLogs:ue,handleRunCliStatus:je,isLoadingCliStatus:he}),X?(0,_.jsx)(e.View,{style:U.warningCard,children:(0,_.jsx)(t.Text,{style:U.warningText,children:l("desktop.daemon.versionMismatch")})}):null]}),o[42]=ze,o[43]=be,o[44]=J,o[45]=z.keepRunningAfterQuit,o[46]=te,o[47]=Z,o[48]=X,o[49]=Ae,o[50]=ce,o[51]=ue,o[52]=je,o[53]=ie,o[54]=de,o[55]=ne,o[56]=E,o[57]=he,o[58]=T,o[59]=oe,o[60]=ae,o[61]=l,o[62]=d.colors.foregroundMuted,o[63]=Oe):Oe=o[63];o[64]!==J||o[65]!==ge||o[66]!==re?(Ie=(0,_.jsx)(V,{visible:re,onClose:ge,daemonLogs:J}),o[64]=J,o[65]=ge,o[66]=re,o[67]=Ie):Ie=o[67];o[68]!==pe||o[69]!==fe||o[70]!==Se||o[71]!==me?(Qe=(0,_.jsx)(O,{visible:me,onClose:fe,cliStatusOutput:pe,onCopy:Se}),o[68]=pe,o[69]=fe,o[70]=Se,o[71]=me,o[72]=Qe):Qe=o[72];o[73]!==De||o[74]!==Ve||o[75]!==Oe||o[76]!==Ie||o[77]!==Qe?(Be=(0,_.jsxs)(y.SettingsSection,{title:Ve,trailing:De,testID:"host-page-daemon-lifecycle-card",children:[Oe,Ie,Qe]}),o[73]=De,o[74]=Ve,o[75]=Oe,o[76]=Ie,o[77]=Qe,o[78]=Be):Be=o[78];return Be};var e=r(_d[0]),t=r(_d[1]),n=r(_d[2]),s=r(_d[3]),o=r(_d[4]);r(_d[5]);var l,d=r(_d[6]),c=(l=d)&&l.__esModule?l:{default:l};r(_d[7]),r(_d[8]);var u=(function(e){if(e&&e.__esModule)return e;var t={};return e&&Object.keys(e).forEach(function(n){var s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:function(){return e[n]}})}),t.default=e,t})(r(_d[9])),p=r(_d[10]),h=r(_d[11]),S=r(_d[12]),y=r(_d[13]),f=r(_d[14]),x=r(_d[15]),j=r(_d[16]),C=r(_d[17]),T=r(_d[18]),k=r(_d[19]),w=r(_d[20]),b=r(_d[21]),v=r(_d[22]),A=r(_d[23]),M=r(_d[24]),z=r(_d[25]),_=r(_d[26]);function P(e){const t=(0,s.c)(6),{settings:n,updateSettings:l}=e,[d,c]=(0,o.useState)(!1);let u;t[0]!==n.keepRunningAfterQuit||t[1]!==l?(u=()=>{c(!0),l({keepRunningAfterQuit:!n.keepRunningAfterQuit}).catch(R).finally(()=>{c(!1)})},t[0]=n.keepRunningAfterQuit,t[1]=l,t[2]=u):u=t[2];const p=u;let h;return t[3]!==p||t[4]!==d?(h={isUpdatingKeepRunningAfterQuit:d,handleToggleKeepRunningAfterQuit:p},t[3]=p,t[4]=d,t[5]=h):h=t[5],h}function R(){}function L(){const{t:e}=(0,p.useTranslation)(),[t,n]=(0,o.useState)(null),[s,l]=(0,o.useState)(!1),[d,h]=(0,o.useState)(!1),S=(0,o.useCallback)(async()=>{h(!0);try{n(await(0,w.getCliDaemonStatus)()),l(!0)}catch(t){const s=t instanceof Error?t.message:String(t);n(e("desktop.daemon.fullStatus.fetchFailed",{message:s})),l(!0)}finally{h(!1)}},[e]),y=(0,o.useCallback)(()=>{t&&u.setStringAsync(t).then(()=>{c.default.alert(e("common.states.copied"),e("desktop.daemon.fullStatus.copied"))}).catch(e=>{console.error("[Settings] Failed to copy daemon status",e)})},[t,e]),f=(0,o.useCallback)(()=>l(!1),[]);return{cliStatusOutput:t,isCliStatusModalOpen:s,isLoadingCliStatus:d,handleCopyCliStatus:y,handleOpenCliStatus:S,handleCloseCliStatusModal:f}}function D(e){const t=(0,s.c)(10),{t:n}=(0,p.useTranslation)(),[l,d]=(0,o.useState)(!1);let h;t[0]!==e?.logPath||t[1]!==n?(h=()=>{const t=e?.logPath;t&&u.setStringAsync(t).then(()=>{c.default.alert(n("common.states.copied"),n("desktop.daemon.logs.copied"))}).catch(e=>{console.error("[Settings] Failed to copy log path",e),c.default.alert(n("common.errors.error"),n("desktop.daemon.logs.copyFailed"))})},t[0]=e?.logPath,t[1]=n,t[2]=h):h=t[2];const S=h;let y;t[3]!==e?(y=()=>{e&&d(!0)},t[3]=e,t[4]=y):y=t[4];const f=y;let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=()=>d(!1),t[5]=x):x=t[5];const j=x;let C;return t[6]!==S||t[7]!==f||t[8]!==l?(C={isLogsModalOpen:l,handleCopyLogPath:S,handleOpenLogs:f,handleCloseLogsModal:j},t[6]=S,t[7]=f,t[8]=l,t[9]=C):C=t[9],C}function V(n){const o=(0,s.c)(22),{visible:l,onClose:d,daemonLogs:c}=n,{t:u}=(0,p.useTranslation)();let h,y;o[0]!==u?(h=u("desktop.daemon.logs.modalTitle"),o[0]=u,o[1]=h):h=o[1],o[2]!==h?(y={title:h},o[2]=h,o[3]=y):y=o[3];const f=y;let j,C,T,k,w,b;return o[4]!==c?.logPath||o[5]!==u?(j=c?.logPath??u("desktop.daemon.logs.unavailable"),o[4]=c?.logPath,o[5]=u,o[6]=j):j=o[6],o[7]!==j?(C=(0,_.jsx)(t.Text,{style:S.settingsStyles.rowHint,children:j}),o[7]=j,o[8]=C):C=o[8],o[9]!==c||o[10]!==u?(T=c?.contents?.length?c.contents:u("desktop.daemon.logs.empty"),o[9]=c,o[10]=u,o[11]=T):T=o[11],o[12]!==T?(k=(0,_.jsx)(t.Text,{style:U.logOutput,selectable:!0,dataSet:z.CODE_SURFACE_DATASET,children:T}),o[12]=T,o[13]=k):k=o[13],o[14]!==C||o[15]!==k?(w=(0,_.jsxs)(e.View,{style:U.modalBody,children:[C,k]}),o[14]=C,o[15]=k,o[16]=w):w=o[16],o[17]!==f||o[18]!==d||o[19]!==w||o[20]!==l?(b=(0,_.jsx)(x.AdaptiveModalSheet,{visible:l,onClose:d,header:f,testID:"managed-daemon-logs-dialog",snapPoints:E,children:w}),o[17]=f,o[18]=d,o[19]=w,o[20]=l,o[21]=b):b=o[21],b}function O(n){const o=(0,s.c)(27),{visible:l,onClose:d,cliStatusOutput:c,onCopy:u}=n,{t:h}=(0,p.useTranslation)();let S,y;o[0]!==h?(S=h("desktop.daemon.fullStatus.modalTitle"),o[0]=h,o[1]=S):S=o[1],o[2]!==S?(y={title:S},o[2]=S,o[3]=y):y=o[3];const f=y,C=c??"";let T,k,w,b,v,A,M,P;return o[4]!==C?(T=(0,_.jsx)(t.Text,{style:U.logOutput,selectable:!0,dataSet:z.CODE_SURFACE_DATASET,children:C}),o[4]=C,o[5]=T):T=o[5],o[6]!==h?(k=h("common.actions.close"),o[6]=h,o[7]=k):k=o[7],o[8]!==d||o[9]!==k?(w=(0,_.jsx)(j.Button,{variant:"outline",size:"sm",onPress:d,children:k}),o[8]=d,o[9]=k,o[10]=w):w=o[10],o[11]!==h?(b=h("common.actions.copy"),o[11]=h,o[12]=b):b=o[12],o[13]!==u||o[14]!==b?(v=(0,_.jsx)(j.Button,{size:"sm",onPress:u,children:b}),o[13]=u,o[14]=b,o[15]=v):v=o[15],o[16]!==w||o[17]!==v?(A=(0,_.jsxs)(e.View,{style:U.modalActions,children:[w,v]}),o[16]=w,o[17]=v,o[18]=A):A=o[18],o[19]!==T||o[20]!==A?(M=(0,_.jsxs)(e.View,{style:U.modalBody,children:[T,A]}),o[19]=T,o[20]=A,o[21]=M):M=o[21],o[22]!==f||o[23]!==d||o[24]!==M||o[25]!==l?(P=(0,_.jsx)(x.AdaptiveModalSheet,{visible:l,onClose:d,header:f,testID:"daemon-cli-status-dialog",snapPoints:K,children:M}),o[22]=f,o[23]=d,o[24]=M,o[25]=l,o[26]=P):P=o[26],P}function I(n){const o=(0,s.c)(121),{t:l}=(0,p.useTranslation)(),{daemonStatusStateText:d,daemonStatusDetailText:c,isDaemonManagementPaused:u,copyIcon:h,fileTextIcon:y,activityIcon:f,handleToggleDaemonManagement:x,isUpdatingDaemonManagement:T,keepRunningAfterQuit:k,handleToggleKeepRunningAfterQuit:w,isUpdatingKeepRunningAfterQuit:b,daemonLogs:v,handleCopyLogPath:A,handleOpenLogs:M,handleRunCliStatus:z,isLoadingCliStatus:P}=n;let R,L,D,V,O,I,Q,B,F,E,K,G,W,q;o[0]!==l?(R=l("desktop.daemon.status.title"),o[0]=l,o[1]=R):R=o[1],o[2]!==R?(L=(0,_.jsx)(t.Text,{style:S.settingsStyles.rowTitle,children:R}),o[2]=R,o[3]=L):L=o[3],o[4]!==l?(D=l("desktop.daemon.status.builtInOnly"),o[4]=l,o[5]=D):D=o[5],o[6]!==D?(V=(0,_.jsx)(t.Text,{style:S.settingsStyles.rowHint,children:D}),o[6]=D,o[7]=V):V=o[7],o[8]!==L||o[9]!==V?(O=(0,_.jsxs)(e.View,{style:S.settingsStyles.rowContent,children:[L,V]}),o[8]=L,o[9]=V,o[10]=O):O=o[10],o[11]!==d?(I=(0,_.jsx)(t.Text,{style:U.valueText,children:d}),o[11]=d,o[12]=I):I=o[12],o[13]!==c?(Q=(0,_.jsx)(t.Text,{style:U.valueSubtext,children:c}),o[13]=c,o[14]=Q):Q=o[14],o[15]!==I||o[16]!==Q?(B=(0,_.jsxs)(e.View,{style:U.statusValueGroup,children:[I,Q]}),o[15]=I,o[16]=Q,o[17]=B):B=o[17],o[18]!==O||o[19]!==B?(F=(0,_.jsxs)(e.View,{style:S.settingsStyles.row,children:[O,B]}),o[18]=O,o[19]=B,o[20]=F):F=o[20],o[21]!==l?(E=l("desktop.daemon.management.title"),o[21]=l,o[22]=E):E=o[22],o[23]!==E?(K=(0,_.jsx)(t.Text,{style:S.settingsStyles.rowTitle,children:E}),o[23]=E,o[24]=K):K=o[24],o[25]!==l?(G=l("desktop.daemon.management.hint"),o[25]=l,o[26]=G):G=o[26],o[27]!==G?(W=(0,_.jsx)(t.Text,{style:S.settingsStyles.rowHint,children:G}),o[27]=G,o[28]=W):W=o[28],o[29]!==K||o[30]!==W?(q=(0,_.jsxs)(e.View,{style:S.settingsStyles.rowContent,children:[K,W]}),o[29]=K,o[30]=W,o[31]=q):q=o[31];const J=!u;let N,X,Y,Z,$,ee,te,ne,se,oe,ie,le,ae,de,re,ce,ue;o[32]!==l?(N=l("desktop.daemon.management.title"),o[32]=l,o[33]=N):N=o[33],o[34]!==x||o[35]!==T||o[36]!==J||o[37]!==N?(X=(0,_.jsx)(C.Switch,{value:J,onValueChange:x,disabled:T,accessibilityLabel:N}),o[34]=x,o[35]=T,o[36]=J,o[37]=N,o[38]=X):X=o[38],o[39]!==q||o[40]!==X?(Y=(0,_.jsxs)(e.View,{style:H,children:[q,X]}),o[39]=q,o[40]=X,o[41]=Y):Y=o[41],o[42]!==l?(Z=l("desktop.daemon.keepRunning.title"),o[42]=l,o[43]=Z):Z=o[43],o[44]!==Z?($=(0,_.jsx)(t.Text,{style:S.settingsStyles.rowTitle,children:Z}),o[44]=Z,o[45]=$):$=o[45],o[46]!==l?(ee=l("desktop.daemon.keepRunning.hint"),o[46]=l,o[47]=ee):ee=o[47],o[48]!==ee?(te=(0,_.jsx)(t.Text,{style:S.settingsStyles.rowHint,children:ee}),o[48]=ee,o[49]=te):te=o[49],o[50]!==$||o[51]!==te?(ne=(0,_.jsxs)(e.View,{style:S.settingsStyles.rowContent,children:[$,te]}),o[50]=$,o[51]=te,o[52]=ne):ne=o[52],o[53]!==l?(se=l("desktop.daemon.keepRunning.title"),o[53]=l,o[54]=se):se=o[54],o[55]!==w||o[56]!==b||o[57]!==k||o[58]!==se?(oe=(0,_.jsx)(C.Switch,{value:k,onValueChange:w,disabled:b,accessibilityLabel:se}),o[55]=w,o[56]=b,o[57]=k,o[58]=se,o[59]=oe):oe=o[59],o[60]!==ne||o[61]!==oe?(ie=(0,_.jsxs)(e.View,{style:H,children:[ne,oe]}),o[60]=ne,o[61]=oe,o[62]=ie):ie=o[62],o[63]!==l?(le=l("desktop.daemon.logs.title"),o[63]=l,o[64]=le):le=o[64],o[65]!==le?(ae=(0,_.jsx)(t.Text,{style:S.settingsStyles.rowTitle,children:le}),o[65]=le,o[66]=ae):ae=o[66],o[67]!==v?.logPath||o[68]!==l?(de=v?.logPath??l("desktop.daemon.logs.unavailable"),o[67]=v?.logPath,o[68]=l,o[69]=de):de=o[69],o[70]!==de?(re=(0,_.jsx)(t.Text,{style:S.settingsStyles.rowHint,children:de}),o[70]=de,o[71]=re):re=o[71],o[72]!==ae||o[73]!==re?(ce=(0,_.jsxs)(e.View,{style:S.settingsStyles.rowContent,children:[ae,re]}),o[72]=ae,o[73]=re,o[74]=ce):ce=o[74],o[75]!==h||o[76]!==v?.logPath||o[77]!==A||o[78]!==l?(ue=v?.logPath?(0,_.jsx)(j.Button,{variant:"outline",size:"sm",leftIcon:h,onPress:A,children:l("desktop.daemon.logs.copyPath")}):null,o[75]=h,o[76]=v?.logPath,o[77]=A,o[78]=l,o[79]=ue):ue=o[79];const ge=!v;let pe,me,he,Se,ye,fe,xe,je,Ce,Te,ke,we,be;return o[80]!==l?(pe=l("desktop.daemon.logs.open"),o[80]=l,o[81]=pe):pe=o[81],o[82]!==y||o[83]!==M||o[84]!==ge||o[85]!==pe?(me=(0,_.jsx)(j.Button,{variant:"outline",size:"sm",leftIcon:y,onPress:M,disabled:ge,children:pe}),o[82]=y,o[83]=M,o[84]=ge,o[85]=pe,o[86]=me):me=o[86],o[87]!==ue||o[88]!==me?(he=(0,_.jsxs)(e.View,{style:U.actionGroup,children:[ue,me]}),o[87]=ue,o[88]=me,o[89]=he):he=o[89],o[90]!==ce||o[91]!==he?(Se=(0,_.jsxs)(e.View,{style:H,children:[ce,he]}),o[90]=ce,o[91]=he,o[92]=Se):Se=o[92],o[93]!==l?(ye=l("desktop.daemon.fullStatus.title"),o[93]=l,o[94]=ye):ye=o[94],o[95]!==ye?(fe=(0,_.jsx)(t.Text,{style:S.settingsStyles.rowTitle,children:ye}),o[95]=ye,o[96]=fe):fe=o[96],o[97]!==l?(xe=l("desktop.daemon.fullStatus.hint"),o[97]=l,o[98]=xe):xe=o[98],o[99]!==xe?(je=(0,_.jsx)(t.Text,{style:S.settingsStyles.rowHint,children:xe}),o[99]=xe,o[100]=je):je=o[100],o[101]!==fe||o[102]!==je?(Ce=(0,_.jsxs)(e.View,{style:S.settingsStyles.rowContent,children:[fe,je]}),o[101]=fe,o[102]=je,o[103]=Ce):Ce=o[103],o[104]!==P||o[105]!==l?(Te=l(P?"common.states.loading":"desktop.daemon.fullStatus.view"),o[104]=P,o[105]=l,o[106]=Te):Te=o[106],o[107]!==f||o[108]!==z||o[109]!==P||o[110]!==Te?(ke=(0,_.jsx)(j.Button,{variant:"outline",size:"sm",leftIcon:f,onPress:z,disabled:P,children:Te}),o[107]=f,o[108]=z,o[109]=P,o[110]=Te,o[111]=ke):ke=o[111],o[112]!==Ce||o[113]!==ke?(we=(0,_.jsxs)(e.View,{style:H,children:[Ce,ke]}),o[112]=Ce,o[113]=ke,o[114]=we):we=o[114],o[115]!==Y||o[116]!==ie||o[117]!==Se||o[118]!==we||o[119]!==F?(be=(0,_.jsxs)(e.View,{style:S.settingsStyles.card,children:[F,Y,ie,Se,we]}),o[115]=Y,o[116]=ie,o[117]=Se,o[118]=we,o[119]=F,o[120]=be):be=o[120],be}function Q(){(0,T.openExternalUrl)(B)}const B="https://paseo.sh/docs/configuration",U=h.StyleSheet.create(e=>({actionGroup:{flexDirection:"row",gap:e.spacing[2],flexWrap:"wrap",justifyContent:"flex-end",uni__dependencies:[0]},loadingCard:{alignItems:"center",justifyContent:"center",paddingVertical:e.spacing[6],uni__dependencies:[0]},statusValueGroup:{alignItems:"flex-end",gap:2},valueText:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,uni__dependencies:[0]},valueSubtext:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,uni__dependencies:[0]},warningCard:{marginTop:e.spacing[3],borderRadius:e.borderRadius.lg,borderWidth:1,borderColor:e.colors.palette.amber[500],backgroundColor:"rgba(245, 158, 11, 0.12)",paddingVertical:e.spacing[2],paddingHorizontal:e.spacing[3],uni__dependencies:[0]},warningText:{color:e.colors.palette.amber[500],fontSize:e.fontSize.xs,uni__dependencies:[0]},modalBody:{gap:e.spacing[3],paddingBottom:e.spacing[2],uni__dependencies:[0]},logOutput:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",lineHeight:18,uni__dependencies:[0]},modalActions:{flexDirection:"row",justifyContent:"flex-end",gap:e.spacing[2],uni__dependencies:[0]}})),F=[S.settingsStyles.card,U.loadingCard],H=[S.settingsStyles.row,S.settingsStyles.rowBorder],E=["70%","92%"],K=["60%","85%"]},4742,[348,711,3519,349,36,1401,1389,234,146,3628,1573,56,3907,4727,1600,3466,3627,4731,3562,4140,3403,4743,4746,3576,3401,3802,279]);
|
|
16502
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useBuiltInDaemonManagement=function(f){const{t:k}=(0,o.useTranslation)(),{daemonStatus:w,settings:b,updateSettings:E,setStatus:M,refreshStatus:h}=f,I=(0,l.useDesktopIpcErrorReporter)(),{mutate:_,isPending:v}=(0,n.useMutation)({mutationFn:async()=>{const t=b.manageBuiltInDaemon;try{const n=await(0,u.executeDaemonManagementToggle)(t,w,{confirm:()=>(0,S.confirmDialog)({title:k("desktop.daemon.management.pauseTitle"),message:k("desktop.daemon.management.pauseMessage"),confirmLabel:k("desktop.daemon.management.pauseAndStop"),cancelLabel:k("common.actions.cancel"),destructive:!0}),persistSettings:t=>E(t),startDaemon:s.startDesktopDaemon,stopDaemon:()=>(0,s.stopDesktopDaemon)("settings")});if("enabled"===n.kind){const t=await(0,D.upsertDesktopDaemonConnection)((0,p.getHostRuntimeStore)(),n.newStatus);if(!t.ok)throw new c.DaemonConnectionRegistrationError(t.error)}return n}catch(n){throw new c.DaemonManagementOperationError(n instanceof Error?n:new Error(String(n)),t)}},onError:t=>{const n=(0,c.getDaemonManagementErrorPresentation)(t,b.manageBuiltInDaemon);n.refreshStatus&&h(),I({error:t,message:n.message,logLabel:"[Settings] Failed to update built-in daemon management"})},onSuccess:t=>{"cancelled"!==t.kind&&(t.newStatus&&M(t.newStatus),h())}}),y=(0,t.useCallback)(()=>{v||_()},[v,_]);return{isUpdating:v,toggle:y}};var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),u=r(d[4]),c=r(d[5]),l=r(d[6]),p=r(d[7]),D=r(d[8]),S=r(d[9])},4743,[36,916,1573,3403,4744,4745,3577,3271,4164,3678]);
|
|
16503
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.executeDaemonManagementToggle=async function(n,t,s){if(!n){await s.persistSettings({manageBuiltInDaemon:!0});return{kind:"enabled",newStatus:await s.startDaemon()}}if(!await s.confirm())return{kind:"cancelled"};if(await s.persistSettings({manageBuiltInDaemon:!1}),"running"===t?.status&&t.desktopManaged){return{kind:"disabled",newStatus:await s.stopDaemon()}}return{kind:"disabled",newStatus:null}}},4744,[]);
|
|
16504
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"DaemonConnectionRegistrationError",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"DaemonManagementOperationError",{enumerable:!0,get:function(){return o}}),e.getDaemonManagementErrorPresentation=function(s,u){const c=s instanceof o?s.originalError:s,f=s instanceof o?s.wasManagingDaemon:u;if(c instanceof t)return{message:n.i18n.t("desktop.daemon.management.registrationFailed"),refreshStatus:!0};if(f)return{message:n.i18n.t("desktop.daemon.management.pausedStopFailed"),refreshStatus:!1};return{message:n.i18n.t("desktop.daemon.management.updateFailed"),refreshStatus:!1}};var n=r(d[0]);class t extends Error{constructor(n){super(n),this.name="DaemonConnectionRegistrationError"}}class o extends Error{constructor(n,t){super(n.message),this.name=n.name,this.cause=n,this.originalError=n,this.wasManagingDaemon=t}}},4745,[3534]);
|
|
16505
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.useDaemonStatus=function(){const y=(0,t.c)(17),{t:D}=(0,s.useTranslation)(),f=(0,o.useQueryClient)();let p;y[0]===Symbol.for("react.memo_cache_sentinel")?(p=(0,n.shouldUseDesktopDaemon)(),y[0]=p):p=y[0];const _=p;let k;y[1]===Symbol.for("react.memo_cache_sentinel")?(k={queryKey:l,enabled:_,staleTime:3e4,refetchOnMount:"always",retry:!1,queryFn:c},y[1]=k):k=y[1];const b=(0,o.useQuery)(k),L=b.error;let S,h,v;y[2]!==D?(S=D("desktop.daemon.loadFailed"),y[2]=D,y[3]=S):S=y[3];y[4]!==b.error||y[5]!==S?(h={error:L,message:S,logLabel:"[DesktopDaemon] Failed to load daemon status"},y[4]=b.error,y[5]=S,y[6]=h):h=y[6];(0,u.useDesktopIpcQueryErrorToast)(h),y[7]!==f?(v=t=>{f.setQueryData(l,o=>o?Object.assign({},o,{status:t}):void 0)},y[7]=f,y[8]=v):v=y[8];const Q=v;let q;y[9]!==f?(q=()=>{f.invalidateQueries({queryKey:l})},y[9]=f,y[10]=q):q=y[10];const F=q,O=b.data??null,T=b.error instanceof Error?b.error.message:null;let j;y[11]!==b.isLoading||y[12]!==F||y[13]!==Q||y[14]!==O||y[15]!==T?(j={data:O,isLoading:b.isLoading,error:T,setStatus:Q,refetch:F},y[11]=b.isLoading,y[12]=F,y[13]=Q,y[14]=O,y[15]=T,y[16]=j):j=y[16];return j};var t=r(d[0]);r(d[1]);var o=r(d[2]),s=r(d[3]),n=r(d[4]),u=r(d[5]);const l=["desktopDaemonStatus"];async function c(){const[t,o]=await Promise.all([(0,n.getDesktopDaemonStatus)(),(0,n.getDesktopDaemonLogs)()]);return{status:t,logs:o}}},4746,[349,36,916,1573,3403,3577]);
|
|
16506
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.HostConnectionsPage=function(e){const s=(0,o.c)(12),{serverId:n}=e,{t:l}=(0,u.useTranslation)(),c=ce(n),h=(0,z.useIsLocalDaemon)(n);if(!c){let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Z.jsx)(de,{}),s[0]=e):e=s[0],e}let f,p,y,x;s[1]!==n?(f=(0,Z.jsx)(ue,{serverId:n}),s[1]=n,s[2]=f):f=s[2];s[3]!==c?(p=(0,Z.jsx)(he,{host:c}),s[3]=c,s[4]=p):p=s[4];s[5]!==h||s[6]!==l?(y=h?(0,Z.jsx)(k.SettingsSection,{title:l("settings.host.pairDevices.title"),children:(0,Z.jsx)(Pe,{})}):null,s[5]=h,s[6]=l,s[7]=y):y=s[7];s[8]!==f||s[9]!==p||s[10]!==y?(x=(0,Z.jsxs)(t.View,{children:[f,p,y]}),s[8]=f,s[9]=p,s[10]=y,s[11]=x):x=s[11];return x},_e.HostAgentsPage=function(e){const n=(0,o.c)(5),{serverId:l}=e,{t:c}=(0,u.useTranslation)(),h=ce(l),f=(0,M.useHostRuntimeIsConnected)(l);if(!h){let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Z.jsx)(de,{}),n[0]=e):e=n[0],e}let p;n[1]!==f||n[2]!==l||n[3]!==c?(p=(0,Z.jsx)(t.View,{children:f?(0,Z.jsxs)(k.SettingsSection,{title:c("settings.hostSections.agents"),children:[(0,Z.jsx)(ve,{serverId:l}),(0,Z.jsx)(q.BrowserToolsOptInCard,{serverId:l}),(0,Z.jsx)(Ie,{serverId:l})]}):(0,Z.jsx)(t.View,{style:Le,children:(0,Z.jsx)(s.Text,{style:Re.emptyText,children:c("settings.host.agents.unavailable")})})}),n[1]=f,n[2]=l,n[3]=c,n[4]=p):p=n[4];return p},_e.HostWorkspacesPage=function(e){const n=(0,o.c)(5),{serverId:l}=e,{t:c}=(0,u.useTranslation)(),h=ce(l),f=(0,M.useHostRuntimeIsConnected)(l);if(!h){let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Z.jsx)(de,{}),n[0]=e):e=n[0],e}let p;n[1]!==f||n[2]!==l||n[3]!==c?(p=(0,Z.jsx)(t.View,{children:f?(0,Z.jsx)(k.SettingsSection,{title:c("settings.hostSections.workspaces"),children:(0,Z.jsx)(Se,{serverId:l})}):(0,Z.jsx)(t.View,{style:Le,children:(0,Z.jsx)(s.Text,{style:Re.emptyText,children:c("settings.host.workspaces.unavailable")})})}),n[1]=f,n[2]=l,n[3]=c,n[4]=p):p=n[4];return p},_e.HostProvidersPage=function(e){const s=(0,o.c)(3),{serverId:n}=e;if(!ce(n)){let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Z.jsx)(de,{}),s[0]=e):e=s[0],e}let l;s[1]!==n?(l=(0,Z.jsx)(t.View,{children:(0,Z.jsx)(H.ProvidersSection,{serverId:n})}),s[1]=n,s[2]=l):l=s[2];return l},_e.HostUsagePage=function(e){const s=(0,o.c)(6),{serverId:n}=e,l=ce(n),{view:c,refresh:u}=(0,R.useProviderUsage)(n);let h;s[0]!==u?(h=()=>{u()},s[0]=u,s[1]=h):h=s[1];const f=h;if(!l){let e;return s[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Z.jsx)(de,{}),s[2]=e):e=s[2],e}let p;s[3]!==f||s[4]!==c?(p=(0,Z.jsx)(t.View,{children:(0,Z.jsx)(V.ProviderUsageSettingsSection,{view:c,onRefresh:f})}),s[3]=f,s[4]=c,s[5]=p):p=s[5];return p},_e.HostSettingsPage=function(e){const n=(0,o.c)(25),{serverId:l,onHostRemoved:c}=e,u=ce(l),h=(0,z.useIsLocalDaemon)(l);if(!u){let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Z.jsx)(de,{}),n[0]=e):e=n[0],e}let f,p,y,x,v,S,b,w;n[1]!==u.label?(f=(0,Z.jsx)(s.Text,{style:Re.daemonHeaderLabel,numberOfLines:1,children:u.label}),n[1]=u.label,n[2]=f):f=n[2];n[3]!==u?(p=(0,Z.jsx)(ge,{host:u}),n[3]=u,n[4]=p):p=n[4];n[5]!==f||n[6]!==p?(y=(0,Z.jsxs)(t.View,{style:Re.daemonHeader,children:[f,p]}),n[5]=f,n[6]=p,n[7]=y):y=n[7];n[8]!==l?(x=(0,Z.jsx)(me,{serverId:l}),n[8]=l,n[9]=x):x=n[9];n[10]!==h?(v=h?(0,Z.jsx)(T.LocalDaemonSection,{}):null,n[10]=h,n[11]=v):v=n[11];n[12]!==u||n[13]!==h?(S=h?null:(0,Z.jsx)(xe,{host:u}),n[12]=u,n[13]=h,n[14]=S):S=n[14];n[15]!==u||n[16]!==h||n[17]!==c?(b=(0,Z.jsx)(Ce,{host:u,isLocalDaemon:h,onRemoved:c}),n[15]=u,n[16]=h,n[17]=c,n[18]=b):b=n[18];n[19]!==y||n[20]!==x||n[21]!==v||n[22]!==S||n[23]!==b?(w=(0,Z.jsxs)(t.View,{children:[y,x,v,S,b]}),n[19]=y,n[20]=x,n[21]=v,n[22]=S,n[23]=b,n[24]=w):w=n[24];return w},_e.HostRenameButton=ge,_e.HostTerminalsPage=function(e){const s=(0,o.c)(3),{serverId:n}=e;if(!ce(n)){let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,Z.jsx)(de,{}),s[0]=e):e=s[0],e}let l;s[1]!==n?(l=(0,Z.jsxs)(t.View,{children:[(0,Z.jsx)(k.SettingsSection,{title:"Terminal agents",children:(0,Z.jsx)(we,{serverId:n})}),(0,Z.jsx)(He,{serverId:n})]}),s[1]=n,s[2]=l):l=s[2];return l};var e,t=r(d[0]),s=r(d[1]),n=r(d[2]),o=r(d[3]),l=r(d[4]),c=r(d[5]),u=r(d[6]),h=r(d[7]),f=(e=h)&&e.__esModule?e:{default:e};r(d[8]),r(d[9]),r(d[10]);var p=r(d[11]),y=r(d[12]),x=r(d[13]),v=r(d[14]),S=r(d[15]),b=r(d[16]),w=r(d[17]),j=r(d[18]),I=r(d[19]),T=r(d[20]),_=r(d[21]),P=r(d[22]),C=r(d[23]),D=r(d[24]),z=r(d[25]),M=r(d[26]),H=r(d[27]),V=r(d[28]),R=r(d[29]),k=r(d[30]),L=r(d[31]),B=r(d[32]),A=r(d[33]),E=r(d[34]),U=r(d[35]),F=r(d[36]),$=r(d[37]),O=r(d[38]),W=r(d[39]),q=r(d[40]),Z=r(d[41]);const N=(0,p.withUnistyles)(l.ArrowUp),G=(0,p.withUnistyles)(l.ArrowDown),K=(0,p.withUnistyles)(l.Pencil),J=(0,p.withUnistyles)(l.Trash2),Q=(0,p.withUnistyles)(l.SquareTerminal),X=(0,p.withUnistyles)(l.Plus);const Y=(0,p.withUnistyles)(function(e){const t=(0,o.c)(6),{iconKey:s,size:n,color:l}=e,c=void 0===l?"":l;let u;t[0]!==s?(u=(0,W.getProviderIcon)(s),t[0]=s,t[1]=u):u=t[1];const h=u;let f;return t[2]!==h||t[3]!==c||t[4]!==n?(f=(0,Z.jsx)(h,{size:n,color:c}),t[2]=h,t[3]=c,t[4]=n,t[5]=f):f=t[5],f}),ee=e=>({color:e.colors.foregroundMuted}),te=(0,Z.jsx)(N,{size:O.ICON_SIZE.sm,uniProps:ee}),se=(0,Z.jsx)(G,{size:O.ICON_SIZE.sm,uniProps:ee}),ne=(0,Z.jsx)(K,{size:O.ICON_SIZE.sm,uniProps:ee}),oe=(0,Z.jsx)(J,{size:O.ICON_SIZE.sm,uniProps:e=>({color:e.colors.destructive})}),ie=(0,Z.jsx)(X,{size:O.ICON_SIZE.sm,uniProps:ee});function re(e,t){return"relay"===e.type?`${t("settings.host.badges.relay")} (${e.relayEndpoint})`:"directSocket"===e.type||"directPipe"===e.type?`${t("settings.host.badges.local")} (${e.path})`:`TCP (${e.endpoint})`}function le(e,t,s){return e?"relay"===e.type?{icon:(0,Z.jsx)(l.Globe,{size:t.iconSize.sm,color:t.colors.foregroundMuted}),text:s("settings.host.badges.relay")}:"directSocket"===e.type||"directPipe"===e.type?{icon:(0,Z.jsx)(l.Monitor,{size:t.iconSize.sm,color:t.colors.foregroundMuted}),text:s("settings.host.badges.local")}:{icon:(0,Z.jsx)(l.Monitor,{size:t.iconSize.sm,color:t.colors.foregroundMuted}),text:e.display}:null}function ae(e){const t=e?.trim();return t?t.startsWith("v")?t:`v${t}`:null}function ce(e){const t=(0,o.c)(3),s=(0,M.useHosts)();let n;return t[0]!==s||t[1]!==e?(n=s.find(t=>t.serverId===e)??null,t[0]=s,t[1]=e,t[2]=n):n=t[2],n}function de(){const e=(0,o.c)(4),{t:n}=(0,u.useTranslation)();let l,c;return e[0]!==n?(l=n("settings.host.notFound"),e[0]=n,e[1]=l):l=e[1],e[2]!==l?(c=(0,Z.jsx)(t.View,{children:(0,Z.jsx)(t.View,{style:Le,children:(0,Z.jsx)(s.Text,{style:Re.emptyText,children:l})})}),e[2]=l,e[3]=c):c=e[3],c}function me(e){const n=(0,o.c)(42),{serverId:l}=e,{t:c}=(0,u.useTranslation)(),{theme:h}=(0,p.useUnistyles)(),f=(0,M.useHostRuntimeSnapshot)(l);let y;n[0]!==l?(y=e=>e.sessions[l]?.serverInfo?.version??null,n[0]=l,n[1]=y):y=n[1];const x=(0,L.useSessionStore)(y),v=f?.connectionStatus??"connecting",S=f?.activeConnection??null;let b;n[2]!==v?(b=(0,F.formatConnectionStatus)(v),n[2]=v,n[3]=b):b=n[3];const w=b;let j;n[4]!==v?(j=(0,F.getConnectionStatusTone)(v),n[4]=v,n[5]=j):j=n[5];const I=j;let T,_,P;n[6]!==I||n[7]!==h.colors.destructive||n[8]!==h.colors.foregroundMuted||n[9]!==h.colors.palette?(T="success"===I?h.colors.palette.green[400]:"warning"===I?h.colors.palette.amber[500]:"error"===I?h.colors.destructive:h.colors.foregroundMuted,n[6]=I,n[7]=h.colors.destructive,n[8]=h.colors.foregroundMuted,n[9]=h.colors.palette,n[10]=T):T=n[10],n[11]!==I?(_="success"===I?"rgba(74, 222, 128, 0.1)":"warning"===I?"rgba(245, 158, 11, 0.1)":"error"===I?"rgba(248, 113, 113, 0.1)":"rgba(161, 161, 170, 0.1)",n[11]=I,n[12]=_):_=n[12],n[13]!==S||n[14]!==c||n[15]!==h?(P=le(S,h,c),n[13]=S,n[14]=c,n[15]=h,n[16]=P):P=n[16];const C=P;let D;n[17]!==x?(D=ae(x),n[17]=x,n[18]=D):D=n[18];const z=D;let H;n[19]!==_?(H=[Re.statusPill,{backgroundColor:_}],n[19]=_,n[20]=H):H=n[20];const V=H;let R;n[21]!==T?(R=[Re.statusDot,{backgroundColor:T}],n[21]=T,n[22]=R):R=n[22];const k=R;let B;n[23]!==T?(B=[Re.statusText,{color:T}],n[23]=T,n[24]=B):B=n[24];const A=B;let E,U,$,O,W,q;return n[25]!==k?(E=(0,Z.jsx)(t.View,{style:k}),n[25]=k,n[26]=E):E=n[26],n[27]!==w||n[28]!==A?(U=(0,Z.jsx)(s.Text,{style:A,children:w}),n[27]=w,n[28]=A,n[29]=U):U=n[29],n[30]!==V||n[31]!==U||n[32]!==E?($=(0,Z.jsxs)(t.View,{style:V,children:[E,U]}),n[30]=V,n[31]=U,n[32]=E,n[33]=$):$=n[33],n[34]!==C?(O=C?(0,Z.jsxs)(t.View,{style:Re.badgePill,children:[C.icon,(0,Z.jsx)(s.Text,{style:Re.badgeText,numberOfLines:1,children:C.text})]}):null,n[34]=C,n[35]=O):O=n[35],n[36]!==z?(W=z?(0,Z.jsx)(t.View,{style:Re.badgePill,children:(0,Z.jsx)(s.Text,{style:Re.badgeText,numberOfLines:1,children:z})}):null,n[36]=z,n[37]=W):W=n[37],n[38]!==$||n[39]!==O||n[40]!==W?(q=(0,Z.jsxs)(t.View,{style:Re.identityBadges,testID:"host-page-identity",children:[$,O,W]}),n[38]=$,n[39]=O,n[40]=W,n[41]=q):q=n[41],q}function ue(e){const t=(0,o.c)(4),{serverId:n}=e,l=(0,M.useHostRuntimeSnapshot)(n),c=l?.lastError??null;let u;t[0]!==c?(u="string"==typeof c&&c.trim().length>0?c.trim():null,t[0]=c,t[1]=u):u=t[1];const h=u;if(!h)return null;let f;return t[2]!==h?(f=(0,Z.jsx)(s.Text,{style:Re.errorText,children:h}),t[2]=h,t[3]=f):f=t[3],f}function ge(e){const t=(0,o.c)(30),{host:s}=e,{t:h}=(0,u.useTranslation)(),{theme:f}=(0,p.useUnistyles)(),{renameHost:y}=(0,M.useHostMutations)(),[x,S]=(0,c.useState)(!1);let b;t[0]!==s.label||t[1]!==s.serverId||t[2]!==y?(b=async e=>{const t=e.trim();t!==s.label.trim()&&await y(s.serverId,t)},t[0]=s.label,t[1]=s.serverId,t[2]=y,t[3]=b):b=t[3];const w=b;let j;t[4]===Symbol.for("react.memo_cache_sentinel")?(j=()=>S(!0),t[4]=j):j=t[4];const I=j;let T;t[5]===Symbol.for("react.memo_cache_sentinel")?(T=()=>S(!1),t[5]=T):T=t[5];const _=T;let P,C,D,z;t[6]!==h?(P=h("settings.host.daemon.rename.editLabel"),t[6]=h,t[7]=P):P=t[7],t[8]!==f.colors.foregroundMuted||t[9]!==f.iconSize.sm?(C=(0,Z.jsx)(l.Pencil,{size:f.iconSize.sm,color:f.colors.foregroundMuted}),t[8]=f.colors.foregroundMuted,t[9]=f.iconSize.sm,t[10]=C):C=t[10],t[11]!==P||t[12]!==C?(D=(0,Z.jsx)(n.Pressable,{onPress:I,hitSlop:8,style:Re.identityEditButton,accessibilityRole:"button",accessibilityLabel:P,testID:"host-page-label-edit-button",children:C}),t[11]=P,t[12]=C,t[13]=D):D=t[13],t[14]!==h?(z=h("settings.host.daemon.rename.title"),t[14]=h,t[15]=z):z=t[15];const H=s.label;let V,R,k,L;return t[16]!==h?(V=h("settings.host.daemon.rename.placeholder"),t[16]=h,t[17]=V):V=t[17],t[18]!==h?(R=h("settings.host.daemon.rename.submit"),t[18]=h,t[19]=R):R=t[19],t[20]!==w||t[21]!==s.label||t[22]!==x||t[23]!==R||t[24]!==z||t[25]!==V?(k=(0,Z.jsx)(v.AdaptiveRenameModal,{visible:x,title:z,initialValue:H,placeholder:V,submitLabel:R,onClose:_,onSubmit:w,testID:"host-page-rename-modal"}),t[20]=w,t[21]=s.label,t[22]=x,t[23]=R,t[24]=z,t[25]=V,t[26]=k):k=t[26],t[27]!==k||t[28]!==D?(L=(0,Z.jsxs)(Z.Fragment,{children:[D,k]}),t[27]=k,t[28]=D,t[29]=L):L=t[29],L}function he(e){const n=(0,o.c)(38),{host:l}=e,{t:h}=(0,u.useTranslation)(),{removeConnection:p}=(0,M.useHostMutations)(),y=(0,M.useHostRuntimeSnapshot)(l.serverId);let v;n[0]!==y?.probeByConnectionId?(v=y?.probeByConnectionId??new Map,n[0]=y?.probeByConnectionId,n[1]=v):v=n[1];const S=v,[w,j]=(0,c.useState)(null),[I,T]=(0,c.useState)(!1);let _,P;n[2]!==h?(_=h("settings.host.connections.removeTitle"),n[2]=h,n[3]=_):_=n[3],n[4]!==_?(P={title:_},n[4]=_,n[5]=P):P=n[5];const C=P;let D;n[6]!==h?(D=e=>{j({connectionId:e.id,title:re(e,h)})},n[6]=h,n[7]=D):D=n[7];const z=D;let H;n[8]!==I?(H=()=>{I||j(null)},n[8]=I,n[9]=H):H=n[9];const V=H;let R;n[10]===Symbol.for("react.memo_cache_sentinel")?(R=()=>{j(null)},n[10]=R):R=n[10];const L=R;let A;n[11]!==l.serverId||n[12]!==w||n[13]!==p||n[14]!==h?(A=()=>{if(!w)return;const{connectionId:e}=w;T(!0),p(l.serverId,e).then(()=>j(null)).catch(e=>{console.error("[HostPage] Failed to remove connection",e),f.default.alert(h("settings.host.connections.removeErrorTitle"),h("settings.host.connections.removeErrorMessage"))}).finally(()=>T(!1))},n[11]=l.serverId,n[12]=w,n[13]=p,n[14]=h,n[15]=A):A=n[15];const E=A;let U,F,$,O,W;if(n[16]!==h?(U=h("settings.host.connections.title"),n[16]=h,n[17]=U):U=n[17],n[18]!==z||n[19]!==l.connections||n[20]!==S){let e;n[22]!==z||n[23]!==S?(e=(e,t)=>{const s=S.get(e.id);return(0,Z.jsx)(fe,{connection:e,showBorder:t>0,latencyMs:"available"===s?.status?s.latencyMs:void 0,latencyLoading:!s||"pending"===s.status,latencyError:"unavailable"===s?.status,onRemove:z},e.id)},n[22]=z,n[23]=S,n[24]=e):e=n[24],F=l.connections.map(e),n[18]=z,n[19]=l.connections,n[20]=S,n[21]=F}else F=n[21];return n[25]!==F?($=(0,Z.jsx)(t.View,{style:B.settingsStyles.card,testID:"host-page-connections-card",children:F}),n[25]=F,n[26]=$):$=n[26],n[27]!==V||n[28]!==E||n[29]!==I||n[30]!==w||n[31]!==C||n[32]!==h?(O=w?(0,Z.jsxs)(x.AdaptiveModalSheet,{header:C,visible:!0,onClose:V,testID:"remove-connection-confirm-modal",children:[(0,Z.jsx)(s.Text,{style:Re.confirmText,children:h("settings.host.connections.removeMessage",{name:w.title})}),(0,Z.jsxs)(t.View,{style:Re.confirmActions,children:[(0,Z.jsx)(b.Button,{variant:"secondary",size:"sm",style:ke,onPress:L,disabled:I,children:h("common.actions.cancel")}),(0,Z.jsx)(b.Button,{variant:"destructive",size:"sm",style:ke,onPress:E,disabled:I,testID:"remove-connection-confirm",children:h("settings.host.connections.removeAction")})]})]}):null,n[27]=V,n[28]=E,n[29]=I,n[30]=w,n[31]=C,n[32]=h,n[33]=O):O=n[33],n[34]!==$||n[35]!==O||n[36]!==U?(W=(0,Z.jsxs)(k.SettingsSection,{title:U,children:[$,O]}),n[34]=$,n[35]=O,n[36]=U,n[37]=W):W=n[37],W}function fe(e){const n=(0,o.c)(32),{connection:l,showBorder:c,latencyMs:h,latencyLoading:f,latencyError:y,onRemove:x}=e,{t:v}=(0,u.useTranslation)(),{theme:S}=(0,p.useUnistyles)();let w;n[0]!==l||n[1]!==v?(w=re(l,v),n[0]=l,n[1]=v,n[2]=w):w=n[2];const j=w;let I;e:if(f)I="...";else{if(y){let e;n[3]!==v?(e=v("settings.host.connections.timeout"),n[3]=v,n[4]=e):e=n[4],I=e;break e}if(null!=h){let e;n[5]!==h?(e=(0,$.formatLatency)(h),n[5]=h,n[6]=e):e=n[6],I=e;break e}I="\u2014"}const T=I,_=y?S.colors.palette.red[300]:S.colors.foregroundMuted;let P;n[7]!==l||n[8]!==x?(P=()=>{x(l)},n[7]=l,n[8]=x,n[9]=P):P=n[9];const C=P,D=c&&B.settingsStyles.rowBorder;let z;n[10]!==D?(z=[B.settingsStyles.row,D],n[10]=D,n[11]=z):z=n[11];const M=z;let H;n[12]!==_?(H=[Re.connectionLatency,{color:_}],n[12]=_,n[13]=H):H=n[13];const V=H;let R;n[14]!==S.colors.destructive?(R={color:S.colors.destructive},n[14]=S.colors.destructive,n[15]=R):R=n[15];const k=R;let L,A,E,U,F;return n[16]!==j?(L=(0,Z.jsx)(t.View,{style:B.settingsStyles.rowContent,children:(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowTitle,numberOfLines:1,children:j})}),n[16]=j,n[17]=L):L=n[17],n[18]!==T||n[19]!==V?(A=(0,Z.jsx)(s.Text,{style:V,children:T}),n[18]=T,n[19]=V,n[20]=A):A=n[20],n[21]!==v?(E=v("settings.host.connections.removeAction"),n[21]=v,n[22]=E):E=n[22],n[23]!==k||n[24]!==C||n[25]!==E?(U=(0,Z.jsx)(b.Button,{variant:"ghost",size:"sm",textStyle:k,onPress:C,children:E}),n[23]=k,n[24]=C,n[25]=E,n[26]=U):U=n[26],n[27]!==M||n[28]!==U||n[29]!==L||n[30]!==A?(F=(0,Z.jsxs)(t.View,{style:M,children:[L,A,U]}),n[27]=M,n[28]=U,n[29]=L,n[30]=A,n[31]=F):F=n[31],F}const pe=e=>new Promise(t=>{setTimeout(t,e)});function ye(e){const n=(0,o.c)(42),{host:h}=e,{t:y}=(0,u.useTranslation)(),{theme:x}=(0,p.useUnistyles)(),v=(0,M.useHostRuntimeClient)(h.serverId),S=(0,M.useHostRuntimeIsConnected)(h.serverId);let w;n[0]===Symbol.for("react.memo_cache_sentinel")?(w=(0,M.getHostRuntimeStore)(),n[0]=w):w=n[0];const j=w,[I,T]=(0,c.useState)(!1),_=(0,c.useRef)(!0);let P,C,D;n[1]===Symbol.for("react.memo_cache_sentinel")?(P=()=>()=>{_.current=!1},C=[],n[1]=P,n[2]=C):(P=n[1],C=n[2]),(0,c.useEffect)(P,C),n[3]!==h.serverId?(D=()=>(0,M.isHostRuntimeConnected)(j.getSnapshot(h.serverId)),n[3]=h.serverId,n[4]=D):D=n[4];const z=D;let H;n[5]===Symbol.for("react.memo_cache_sentinel")?(H=async(e,t,s)=>{const n=void 0===s?250:s,o=Date.now()+t;for(;Date.now()<o;){if(!_.current)return!1;if(e())return!0;await pe(n)}return e()},n[5]=H):H=n[5];const V=H;let R;n[6]!==h.label||n[7]!==z||n[8]!==y?(R=async()=>{z()&&await V(()=>!z(),7e3);const e=await V(()=>z(),3e4);_.current&&(T(!1),e||f.default.alert(y("settings.host.daemon.restart.unableToReconnectTitle"),y("settings.host.daemon.restart.unableToReconnectMessage",{name:h.label})))},n[6]=h.label,n[7]=z,n[8]=y,n[9]=R):R=n[9];const k=R;let L;n[10]!==v||n[11]!==h.label||n[12]!==h.serverId||n[13]!==z||n[14]!==y||n[15]!==k?(L=()=>{v?z()?(0,A.confirmDialog)({title:y("settings.host.daemon.restart.confirmTitle",{name:h.label}),message:y("settings.host.daemon.restart.confirmMessage"),confirmLabel:y("settings.host.daemon.restart.confirm"),cancelLabel:y("common.actions.cancel"),destructive:!0}).then(e=>{e&&(T(!0),v.restartServer(`settings_daemon_restart_${h.serverId}`).catch(e=>{console.error(`[HostPage] Failed to restart daemon ${h.label}`,e),_.current&&(T(!1),f.default.alert(y("settings.host.daemon.restart.requestFailedTitle"),y("settings.host.daemon.restart.requestFailedMessage")))}),k())}).catch(e=>{console.error(`[HostPage] Failed to open restart confirmation for ${h.label}`,e),f.default.alert(y("settings.host.daemon.restart.requestFailedTitle"),y("settings.host.daemon.restart.dialogFailedMessage"))}):f.default.alert(y("settings.host.daemon.restart.offlineTitle"),y("settings.host.daemon.restart.offlineMessage")):f.default.alert(y("settings.host.daemon.restart.unavailableTitle"),y("settings.host.daemon.restart.unavailableMessage"))},n[10]=v,n[11]=h.label,n[12]=h.serverId,n[13]=z,n[14]=y,n[15]=k,n[16]=L):L=n[16];const E=L;let U;n[17]!==x.colors.foreground||n[18]!==x.iconSize.sm?(U=(0,Z.jsx)(l.RotateCw,{size:x.iconSize.sm,color:x.colors.foreground}),n[17]=x.colors.foreground,n[18]=x.iconSize.sm,n[19]=U):U=n[19];const F=U;let $,O,W,q,N;n[20]!==y?($=y("settings.host.daemon.restart.title"),n[20]=y,n[21]=$):$=n[21],n[22]!==$?(O=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowTitle,children:$}),n[22]=$,n[23]=O):O=n[23],n[24]!==y?(W=y("settings.host.daemon.restart.hint"),n[24]=y,n[25]=W):W=n[25],n[26]!==W?(q=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowHint,children:W}),n[26]=W,n[27]=q):q=n[27],n[28]!==O||n[29]!==q?(N=(0,Z.jsxs)(t.View,{style:B.settingsStyles.rowContent,children:[O,q]}),n[28]=O,n[29]=q,n[30]=N):N=n[30];const G=I||!v||!S;let K,J,Q;return n[31]!==I||n[32]!==y?(K=y(I?"settings.host.daemon.restart.restarting":"settings.host.daemon.restart.confirm"),n[31]=I,n[32]=y,n[33]=K):K=n[33],n[34]!==E||n[35]!==F||n[36]!==G||n[37]!==K?(J=(0,Z.jsx)(b.Button,{variant:"outline",size:"sm",leftIcon:F,onPress:E,disabled:G,testID:"host-page-restart-button",children:K}),n[34]=E,n[35]=F,n[36]=G,n[37]=K,n[38]=J):J=n[38],n[39]!==N||n[40]!==J?(Q=(0,Z.jsx)(t.View,{style:B.settingsStyles.card,testID:"host-page-restart-card",children:(0,Z.jsxs)(t.View,{style:B.settingsStyles.row,children:[N,J]})}),n[39]=N,n[40]=J,n[41]=Q):Q=n[41],Q}function xe(e){const n=(0,o.c)(50),{host:h}=e,{t:y}=(0,u.useTranslation)(),{theme:x}=(0,p.useUnistyles)(),v=(0,M.useHostRuntimeClient)(h.serverId),S=(0,M.useHostRuntimeIsConnected)(h.serverId);let w;n[0]===Symbol.for("react.memo_cache_sentinel")?(w=(0,M.getHostRuntimeStore)(),n[0]=w):w=n[0];const j=w,[I,T]=(0,c.useState)(!1),[_,P]=(0,c.useState)(null),C=(0,c.useRef)(!0),D=(0,c.useRef)(null);let z;n[1]!==h.serverId?(z=e=>e.sessions[h.serverId]?.serverInfo?.version??null,n[1]=h.serverId,n[2]=z):z=n[2];const H=(0,L.useSessionStore)(z);let V;n[3]!==h.serverId?(V=e=>!0===e.sessions[h.serverId]?.serverInfo?.features?.daemonSelfUpdate,n[3]=h.serverId,n[4]=V):V=n[4];const R=(0,L.useSessionStore)(V),k=(0,U.resolveAppVersion)(),F=(0,E.isVersionMismatch)(k,H);let $,O,W;n[5]===Symbol.for("react.memo_cache_sentinel")?($=()=>()=>{C.current=!1,D.current?.()},O=[],n[5]=$,n[6]=O):($=n[5],O=n[6]),(0,c.useEffect)($,O),n[7]!==h.serverId?(W=()=>(0,M.isHostRuntimeConnected)(j.getSnapshot(h.serverId)),n[7]=h.serverId,n[8]=W):W=n[8];const q=W;let N;n[9]!==h.serverId?(N=e=>{const t=j.getSnapshot(h.serverId);return!(!t||!(0,M.isHostRuntimeConnected)(t))&&(null===e||t.clientGeneration!==e)},n[9]=h.serverId,n[10]=N):N=n[10];const G=N;let K;n[11]===Symbol.for("react.memo_cache_sentinel")?(K=async(e,t,s)=>{const n=void 0===s?250:s,o=Date.now()+t;for(;Date.now()<o;){if(!C.current)return!1;if(e())return!0;await pe(n)}return e()},n[11]=K):K=n[11];const J=K;let Q;n[12]!==G||n[13]!==h.label||n[14]!==q||n[15]!==y?(Q=async e=>{!G(e)&&q()&&await J(()=>!q()||G(e),15e3);const t=G(e)||await J(()=>G(e),12e4);C.current&&(T(!1),P(null),t||f.default.alert(y("settings.host.daemon.update.unableToReconnectTitle"),y("settings.host.daemon.update.unableToReconnectMessage",{name:h.label})))},n[12]=G,n[13]=h.label,n[14]=q,n[15]=y,n[16]=Q):Q=n[16];const X=Q;let Y;n[17]!==v||n[18]!==h.label||n[19]!==h.serverId||n[20]!==q||n[21]!==y||n[22]!==X?(Y=()=>{v?q()?(0,A.confirmDialog)({title:y("settings.host.daemon.update.confirmTitle",{name:h.label}),message:y("settings.host.daemon.update.confirmMessage"),confirmLabel:y("settings.host.daemon.update.confirm"),cancelLabel:y("common.actions.cancel"),destructive:!1}).then(e=>{if(!e)return;const t=j.getSnapshot(h.serverId)?.clientGeneration??null;T(!0),P(y("settings.host.daemon.update.phaseStarting"));const s=`settings_daemon_update_${h.serverId}`,n=v.on("daemon.update.progress",e=>{if(e.payload.requestId!==s)return;if(!C.current)return;const{phase:t}=e.payload;"starting"===t?P(y("settings.host.daemon.update.phaseStarting")):"downloading"===t?P(y("settings.host.daemon.update.phaseDownloading")):"installing"===t?P(y("settings.host.daemon.update.phaseInstalling")):"complete"===t&&P(y("settings.host.daemon.update.phaseComplete"))});D.current=n,v.updateDaemon(s).then(e=>{if(D.current=null,n(),!e.success){if(!C.current)return;return T(!1),P(null),void f.default.alert(y("settings.host.daemon.update.requestFailedTitle"),y("settings.host.daemon.update.requestFailedMessage",{error:e.error??"Unknown error"}))}X(t)}).catch(e=>{D.current=null,n(),console.error(`[HostPage] Failed to update daemon ${h.label}`,e),C.current&&(T(!1),P(null),f.default.alert(y("settings.host.daemon.update.requestFailedTitle"),y("settings.host.daemon.update.requestFailedMessage",{error:e instanceof Error?e.message:"Unknown error"})))})}).catch(e=>{console.error(`[HostPage] Failed to open update confirmation for ${h.label}`,e),f.default.alert(y("settings.host.daemon.update.requestFailedTitle"),y("settings.host.daemon.update.dialogFailedMessage"))}):f.default.alert(y("settings.host.daemon.update.offlineTitle"),y("settings.host.daemon.update.offlineMessage")):f.default.alert(y("settings.host.daemon.update.unavailableTitle"),y("settings.host.daemon.update.unavailableMessage"))},n[17]=v,n[18]=h.label,n[19]=h.serverId,n[20]=q,n[21]=y,n[22]=X,n[23]=Y):Y=n[23];const ee=Y;let te;n[24]!==x.colors.foreground||n[25]!==x.iconSize.sm?(te=(0,Z.jsx)(l.ArrowUpToLine,{size:x.iconSize.sm,color:x.colors.foreground}),n[24]=x.colors.foreground,n[25]=x.iconSize.sm,n[26]=te):te=n[26];const se=te;if(!R||!F)return null;let ne;n[27]!==I||n[28]!==_||n[29]!==y?(ne=I?_??y("settings.host.daemon.update.updating"):y("settings.host.daemon.update.confirm"),n[27]=I,n[28]=_,n[29]=y,n[30]=ne):ne=n[30];const oe=ne;let ie,re,le,ae,ce;n[31]!==y?(ie=y("settings.host.daemon.update.title"),n[31]=y,n[32]=ie):ie=n[32],n[33]!==ie?(re=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowTitle,children:ie}),n[33]=ie,n[34]=re):re=n[34],n[35]!==y?(le=y("settings.host.daemon.update.hint"),n[35]=y,n[36]=le):le=n[36],n[37]!==le?(ae=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowHint,children:le}),n[37]=le,n[38]=ae):ae=n[38],n[39]!==re||n[40]!==ae?(ce=(0,Z.jsxs)(t.View,{style:B.settingsStyles.rowContent,children:[re,ae]}),n[39]=re,n[40]=ae,n[41]=ce):ce=n[41];const de=I||!v||!S;let me,ue;return n[42]!==oe||n[43]!==ee||n[44]!==de||n[45]!==se?(me=(0,Z.jsx)(b.Button,{variant:"outline",size:"sm",leftIcon:se,onPress:ee,disabled:de,testID:"host-page-update-button",children:oe}),n[42]=oe,n[43]=ee,n[44]=de,n[45]=se,n[46]=me):me=n[46],n[47]!==ce||n[48]!==me?(ue=(0,Z.jsx)(t.View,{style:B.settingsStyles.card,testID:"host-page-update-card",children:(0,Z.jsxs)(t.View,{style:B.settingsStyles.row,children:[ce,me]})}),n[47]=ce,n[48]=me,n[49]=ue):ue=n[49],ue}function ve(e){const n=(0,o.c)(22),{serverId:l}=e,{t:c}=(0,u.useTranslation)(),h=(0,M.useHostRuntimeIsConnected)(l),{config:f,patchConfig:p}=(0,D.useDaemonConfig)(l);let y;n[0]!==p?(y=e=>{p({mcp:{injectIntoAgents:e}})},n[0]=p,n[1]=y):y=n[1];const x=y;if(!h)return null;let v,S,b,j,I;n[2]!==c?(v=c("settings.host.orchestration.enableTools.title"),n[2]=c,n[3]=v):v=n[3],n[4]!==v?(S=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowTitle,children:v}),n[4]=v,n[5]=S):S=n[5],n[6]!==c?(b=c("settings.host.orchestration.enableTools.hint"),n[6]=c,n[7]=b):b=n[7],n[8]!==b?(j=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowHint,children:b}),n[8]=b,n[9]=j):j=n[9],n[10]!==S||n[11]!==j?(I=(0,Z.jsxs)(t.View,{style:B.settingsStyles.rowContent,children:[S,j]}),n[10]=S,n[11]=j,n[12]=I):I=n[12];const T=!1!==f?.mcp.injectIntoAgents;let _,P,C;return n[13]!==c?(_=c("settings.host.orchestration.enableTools.accessibilityLabel"),n[13]=c,n[14]=_):_=n[14],n[15]!==x||n[16]!==T||n[17]!==_?(P=(0,Z.jsx)(w.Switch,{value:T,onValueChange:x,accessibilityLabel:_}),n[15]=x,n[16]=T,n[17]=_,n[18]=P):P=n[18],n[19]!==I||n[20]!==P?(C=(0,Z.jsx)(t.View,{style:B.settingsStyles.card,testID:"host-page-inject-mcp-card",children:(0,Z.jsxs)(t.View,{style:B.settingsStyles.row,children:[I,P]})}),n[19]=I,n[20]=P,n[21]=C):C=n[21],C}function Se(e){const n=(0,o.c)(6),{serverId:l}=e,c=(0,M.useHostRuntimeIsConnected)(l),{config:u,patchConfig:h}=(0,D.useDaemonConfig)(l);let f;n[0]!==h?(f=e=>{h({autoArchiveAfterMerge:e}).catch(be)},n[0]=h,n[1]=f):f=n[1];const p=f;if(!c)return null;let y;n[2]===Symbol.for("react.memo_cache_sentinel")?(y=(0,Z.jsxs)(t.View,{style:B.settingsStyles.rowContent,children:[(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowTitle,children:"Archive merged PR workspaces"}),(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowHint,children:"Automatically archive clean Paseo workspaces after their pull request is merged"})]}),n[2]=y):y=n[2];const x=!0===u?.autoArchiveAfterMerge;let v;return n[3]!==p||n[4]!==x?(v=(0,Z.jsx)(t.View,{style:B.settingsStyles.card,testID:"host-page-auto-archive-merged-workspaces-card",children:(0,Z.jsxs)(t.View,{style:B.settingsStyles.row,children:[y,(0,Z.jsx)(w.Switch,{value:x,onValueChange:p,accessibilityLabel:"Archive merged PR workspaces",testID:"host-page-auto-archive-merged-workspaces-switch"})]})}),n[3]=p,n[4]=x,n[5]=v):v=n[5],v}function be(e){console.error("[HostPage] Failed to update auto-archive after merge",e),f.default.alert("Unable to update workspaces",e instanceof Error?e.message:String(e))}function we(e){const n=(0,o.c)(6),{serverId:l}=e,c=(0,M.useHostRuntimeIsConnected)(l),{config:u,patchConfig:h}=(0,D.useDaemonConfig)(l);let f;n[0]!==h?(f=e=>{h({enableTerminalAgentHooks:e}).catch(je)},n[0]=h,n[1]=f):f=n[1];const p=f;if(!c)return null;let y;n[2]===Symbol.for("react.memo_cache_sentinel")?(y=(0,Z.jsxs)(t.View,{style:B.settingsStyles.rowContent,children:[(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowTitle,children:"Enable terminal agent hooks"}),(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowHint,children:"Get notifications and status from terminal agents. This installs hooks in your agent config files."})]}),n[2]=y):y=n[2];const x=!0===u?.enableTerminalAgentHooks;let v;return n[3]!==p||n[4]!==x?(v=(0,Z.jsx)(t.View,{style:B.settingsStyles.card,testID:"host-page-terminal-agent-hooks-card",children:(0,Z.jsxs)(t.View,{style:B.settingsStyles.row,children:[y,(0,Z.jsx)(w.Switch,{value:x,onValueChange:p,accessibilityLabel:"Enable terminal agent hooks",testID:"host-page-terminal-agent-hooks-switch"})]})}),n[3]=p,n[4]=x,n[5]=v):v=n[5],v}function je(e){console.error("[HostPage] Failed to update terminal agent hooks",e),f.default.alert("Unable to update terminal agent hooks",e instanceof Error?e.message:String(e))}function Ie(e){const n=(0,o.c)(49),{serverId:l}=e,{t:h}=(0,u.useTranslation)(),f=(0,M.useHostRuntimeIsConnected)(l),{config:p,patchConfig:y}=(0,D.useDaemonConfig)(l),v=p?.appendSystemPrompt??"",[w,j]=(0,c.useState)(v),[I,T]=(0,c.useState)(!1),[_,P]=(0,c.useState)(!1);let C,z;n[0]!==h?(C=h("settings.host.orchestration.systemPrompt.sheetTitle"),n[0]=h,n[1]=C):C=n[1],n[2]!==C?(z={title:C},n[2]=C,n[3]=z):z=n[3];const H=z;let V,R;n[4]!==v?(V=()=>{j(v)},R=[v],n[4]=v,n[5]=V,n[6]=R):(V=n[5],R=n[6]),(0,c.useEffect)(V,R);const k=w!==v;let L;n[7]!==v?(L=()=>{j(v),T(!0)},n[7]=v,n[8]=L):L=n[8];const A=L;let E;n[9]!==_||n[10]!==v?(E=()=>{_||(j(v),T(!1))},n[9]=_,n[10]=v,n[11]=E):E=n[11];const U=E;let F;n[12]!==w||n[13]!==y?(F=()=>{P(!0),y({appendSystemPrompt:w}).then(()=>{T(!1)}).catch(Te).finally(()=>P(!1))},n[12]=w,n[13]=y,n[14]=F):F=n[14];const $=F;let O;n[15]!==v?(O=()=>{j(v)},n[15]=v,n[16]=O):O=n[16];const W=O;if(!f)return null;let q,N,G,K,J,Q,X,Y,ee,te;return n[17]!==h?(q=h("settings.host.orchestration.systemPrompt.title"),n[17]=h,n[18]=q):q=n[18],n[19]!==q?(N=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowTitle,children:q}),n[19]=q,n[20]=N):N=n[20],n[21]!==h?(G=h("settings.host.orchestration.systemPrompt.hint"),n[21]=h,n[22]=G):G=n[22],n[23]!==G?(K=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowHint,children:G}),n[23]=G,n[24]=K):K=n[24],n[25]!==N||n[26]!==K?(J=(0,Z.jsxs)(t.View,{style:B.settingsStyles.rowContent,children:[N,K]}),n[25]=N,n[26]=K,n[27]=J):J=n[27],n[28]!==h?(Q=h("settings.host.orchestration.systemPrompt.edit"),n[28]=h,n[29]=Q):Q=n[29],n[30]!==A||n[31]!==Q?(X=(0,Z.jsx)(b.Button,{variant:"outline",size:"sm",onPress:A,testID:"host-page-append-system-prompt-edit",children:Q}),n[30]=A,n[31]=Q,n[32]=X):X=n[32],n[33]!==J||n[34]!==X?(Y=(0,Z.jsx)(t.View,{style:B.settingsStyles.card,testID:"host-page-append-system-prompt-card",children:(0,Z.jsxs)(t.View,{style:B.settingsStyles.row,children:[J,X]})}),n[33]=J,n[34]=X,n[35]=Y):Y=n[35],n[36]!==w||n[37]!==U||n[38]!==W||n[39]!==$||n[40]!==k||n[41]!==H||n[42]!==I||n[43]!==_||n[44]!==h?(ee=I?(0,Z.jsxs)(x.AdaptiveModalSheet,{header:H,visible:!0,onClose:U,testID:"host-page-append-system-prompt-sheet",desktopMaxWidth:560,children:[(0,Z.jsx)(S.SettingsTextAreaCard,{testID:"host-page-append-system-prompt-input",accessibilityLabel:h("settings.host.orchestration.systemPrompt.accessibilityLabel"),value:w,onChangeText:j,placeholder:h("settings.host.orchestration.systemPrompt.placeholder")}),(0,Z.jsxs)(t.View,{style:Re.appendPromptActions,children:[(0,Z.jsx)(b.Button,{variant:"ghost",size:"sm",onPress:W,disabled:!k||_,testID:"host-page-append-system-prompt-reset",children:h("settings.host.orchestration.systemPrompt.reset")}),(0,Z.jsx)(b.Button,{variant:"default",size:"sm",onPress:$,disabled:!k||_,testID:"host-page-append-system-prompt-save",children:h(_?"settings.host.orchestration.systemPrompt.saving":"settings.host.orchestration.systemPrompt.save")})]})]}):null,n[36]=w,n[37]=U,n[38]=W,n[39]=$,n[40]=k,n[41]=H,n[42]=I,n[43]=_,n[44]=h,n[45]=ee):ee=n[45],n[46]!==Y||n[47]!==ee?(te=(0,Z.jsxs)(Z.Fragment,{children:[Y,ee]}),n[46]=Y,n[47]=ee,n[48]=te):te=n[48],te}function Te(e){console.error("[HostPage] Failed to save append system prompt",e)}function Pe(){const e=(0,o.c)(24),{t:h}=(0,u.useTranslation)(),{theme:f}=(0,p.useUnistyles)(),[y,x]=(0,c.useState)(!1);let v;e[0]===Symbol.for("react.memo_cache_sentinel")?(v=()=>x(!0),e[0]=v):v=e[0];const S=v;let b;e[1]===Symbol.for("react.memo_cache_sentinel")?(b=()=>x(!1),e[1]=b):b=e[1];const w=b;let j,I,T,_,P,D,z,M,H;return e[2]!==h?(j=h("settings.host.pairDevices.rowTitle"),e[2]=h,e[3]=j):j=e[3],e[4]!==j?(I=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowTitle,children:j}),e[4]=j,e[5]=I):I=e[5],e[6]!==h?(T=h("settings.host.pairDevices.rowHint"),e[6]=h,e[7]=T):T=e[7],e[8]!==T?(_=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowHint,children:T}),e[8]=T,e[9]=_):_=e[9],e[10]!==I||e[11]!==_?(P=(0,Z.jsxs)(t.View,{style:B.settingsStyles.rowContent,children:[I,_]}),e[10]=I,e[11]=_,e[12]=P):P=e[12],e[13]!==f.colors.foregroundMuted||e[14]!==f.iconSize.sm?(D=(0,Z.jsx)(l.ChevronRight,{size:f.iconSize.sm,color:f.colors.foregroundMuted}),e[13]=f.colors.foregroundMuted,e[14]=f.iconSize.sm,e[15]=D):D=e[15],e[16]!==P||e[17]!==D?(z=(0,Z.jsxs)(n.Pressable,{style:B.settingsStyles.row,onPress:S,accessibilityRole:"button",testID:"host-page-pair-device-row",children:[P,D]}),e[16]=P,e[17]=D,e[18]=z):z=e[18],e[19]!==y?(M=(0,Z.jsx)(C.PairDeviceModal,{visible:y,onClose:w,testID:"host-page-pair-device-card"}),e[19]=y,e[20]=M):M=e[20],e[21]!==z||e[22]!==M?(H=(0,Z.jsxs)(t.View,{style:B.settingsStyles.card,children:[z,M]}),e[21]=z,e[22]=M,e[23]=H):H=e[23],H}function Ce({host:e,isLocalDaemon:n,onRemoved:o}){const{t:h}=(0,u.useTranslation)(),{theme:y}=(0,p.useUnistyles)(),{removeHost:v}=(0,M.useHostMutations)(),{updateSettings:S}=(0,P.useDesktopSettings)(),{data:w,setStatus:j}=(0,_.useDaemonStatus)(),[T,C]=(0,c.useState)(!1),[D,z]=(0,c.useState)(!1),H=w?.status??null,V=(0,c.useMemo)(()=>({title:h(n?"settings.host.daemon.remove.localConfirmTitle":"settings.host.daemon.remove.title")}),[n,h]),R=(0,c.useMemo)(()=>({color:y.colors.destructive}),[y.colors.destructive]),L=(0,c.useCallback)(()=>C(!0),[]),A=(0,c.useCallback)(()=>{D||C(!1)},[D]),E=(0,c.useCallback)(()=>C(!1),[]),U=(0,c.useCallback)(async e=>{await S({daemon:{manageBuiltInDaemon:!0}}),e&&j(await(0,I.startDesktopDaemon)())},[j,S]),F=(0,c.useCallback)(()=>{z(!0);(async()=>{let t=!1,s=!1;if(n)try{await S({daemon:{manageBuiltInDaemon:!1}}),t=!0,"running"===H?.status&&H.desktopManaged&&(j(await(0,I.stopDesktopDaemon)("host_remove")),s=!0),await v(e.serverId)}catch(e){if(t)try{await U(s)}catch(e){console.error("[HostPage] Failed to roll back localhost removal",e)}throw e}else await v(e.serverId)})().then(()=>{C(!1),o?.()}).catch(e=>{console.error("[HostPage] Failed to remove host",e),f.default.alert(h("settings.host.daemon.remove.errorTitle"),h(n?"settings.host.daemon.remove.localErrorMessage":"settings.host.daemon.remove.errorMessage"))}).finally(()=>z(!1))},[H,e.serverId,n,o,v,U,j,h,S]),$=(0,c.useMemo)(()=>(0,Z.jsx)(l.Trash2,{size:y.iconSize.sm,color:y.colors.destructive}),[y.iconSize.sm,y.colors.destructive]);return(0,Z.jsxs)(k.SettingsSection,{title:h("settings.host.daemon.dangerZone"),testID:"host-page-remove-host-card",children:[(0,Z.jsx)(ye,{host:e}),(0,Z.jsx)(t.View,{style:B.settingsStyles.card,children:(0,Z.jsxs)(t.View,{style:B.settingsStyles.row,children:[(0,Z.jsxs)(t.View,{style:B.settingsStyles.rowContent,children:[(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowTitle,children:h(n?"settings.host.daemon.remove.localTitle":"settings.host.daemon.remove.title")}),(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowHint,children:h(n?"settings.host.daemon.remove.localHint":"settings.host.daemon.remove.hint")})]}),(0,Z.jsx)(b.Button,{variant:"outline",size:"sm",leftIcon:$,textStyle:R,onPress:L,testID:"host-page-remove-host-button",children:h("settings.host.connections.removeAction")})]})}),T?(0,Z.jsxs)(x.AdaptiveModalSheet,{header:V,visible:!0,onClose:A,testID:"remove-host-confirm-modal",children:[(0,Z.jsx)(s.Text,{style:Re.confirmText,children:n?h("settings.host.daemon.remove.localConfirmMessage"):h("settings.host.daemon.remove.confirmMessage",{name:e.label})}),(0,Z.jsxs)(t.View,{style:Re.confirmActions,children:[(0,Z.jsx)(b.Button,{variant:"secondary",size:"sm",style:ke,onPress:E,disabled:D,children:h("common.actions.cancel")}),(0,Z.jsx)(b.Button,{variant:"destructive",size:"sm",style:ke,onPress:F,disabled:D,testID:"remove-host-confirm",children:h("settings.host.connections.removeAction")})]})]}):null]})}function De(e){const t=e.trim();if(t)return t.split(/\s+/).map(e=>e.trim()).filter(Boolean)}const ze={name:"",command:"",args:""};function Me(e){const n=(0,o.c)(65),{profile:l,isFirst:c,isLast:h,onEdit:f,onRemove:p,onMoveUp:x,onMoveDown:v}=e,{t:S}=(0,u.useTranslation)();let w;n[0]!==f||n[1]!==l.id?(w=()=>f(l.id),n[0]=f,n[1]=l.id,n[2]=w):w=n[2];const j=w;let I;n[3]!==p||n[4]!==l.id?(I=()=>p(l.id),n[3]=p,n[4]=l.id,n[5]=I):I=n[5];const T=I;let _;n[6]!==x||n[7]!==l.id?(_=()=>x(l.id),n[6]=x,n[7]=l.id,n[8]=_):_=n[8];const P=_;let C;n[9]!==v||n[10]!==l.id?(C=()=>v(l.id),n[9]=v,n[10]=l.id,n[11]=C):C=n[11];const D=C;let z;n[12]!==l.args||n[13]!==l.command?(z=l.args&&l.args.length>0?`${l.command} ${l.args.join(" ")}`:l.command,n[12]=l.args,n[13]=l.command,n[14]=z):z=n[14];const M=z,H=!c&&B.settingsStyles.rowBorder;let V;n[15]!==H?(V=[B.settingsStyles.row,H,Ve.row],n[15]=H,n[16]=V):V=n[16];const R=V;let k;n[17]!==l?(k=(0,y.getTerminalProfileIcon)(l),n[17]=l,n[18]=k):k=n[18];const L=k,A=`terminal-profile-row-${l.id}`;let E,U,F,$,W;n[19]!==L?(E=(0,Z.jsx)(t.View,{style:Ve.iconWrapper,children:L?(0,Z.jsx)(Y,{iconKey:L,size:O.ICON_SIZE.md,uniProps:ee}):(0,Z.jsx)(Q,{size:O.ICON_SIZE.md,uniProps:ee})}),n[19]=L,n[20]=E):E=n[20],n[21]!==l.name?(U=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowTitle,numberOfLines:1,children:l.name}),n[21]=l.name,n[22]=U):U=n[22],n[23]!==M?(F=(0,Z.jsx)(s.Text,{style:B.settingsStyles.rowHint,numberOfLines:1,children:M}),n[23]=M,n[24]=F):F=n[24],n[25]!==U||n[26]!==F?($=(0,Z.jsxs)(t.View,{style:B.settingsStyles.rowContent,children:[U,F]}),n[25]=U,n[26]=F,n[27]=$):$=n[27],n[28]!==S?(W=S("settings.host.terminalProfiles.moveUp"),n[28]=S,n[29]=W):W=n[29];const q=`terminal-profile-move-up-${l.id}`;let N,G;n[30]!==P||n[31]!==c||n[32]!==W||n[33]!==q?(N=(0,Z.jsx)(b.Button,{variant:"ghost",size:"sm",leftIcon:te,onPress:P,disabled:c,accessibilityLabel:W,testID:q}),n[30]=P,n[31]=c,n[32]=W,n[33]=q,n[34]=N):N=n[34],n[35]!==S?(G=S("settings.host.terminalProfiles.moveDown"),n[35]=S,n[36]=G):G=n[36];const K=`terminal-profile-move-down-${l.id}`;let J,X;n[37]!==D||n[38]!==h||n[39]!==G||n[40]!==K?(J=(0,Z.jsx)(b.Button,{variant:"ghost",size:"sm",leftIcon:se,onPress:D,disabled:h,accessibilityLabel:G,testID:K}),n[37]=D,n[38]=h,n[39]=G,n[40]=K,n[41]=J):J=n[41],n[42]!==S?(X=S("settings.host.terminalProfiles.editProfile"),n[42]=S,n[43]=X):X=n[43];const ie=`terminal-profile-edit-${l.id}`;let re,le;n[44]!==j||n[45]!==X||n[46]!==ie?(re=(0,Z.jsx)(b.Button,{variant:"ghost",size:"sm",leftIcon:ne,onPress:j,accessibilityLabel:X,testID:ie}),n[44]=j,n[45]=X,n[46]=ie,n[47]=re):re=n[47],n[48]!==S?(le=S("settings.host.terminalProfiles.remove"),n[48]=S,n[49]=le):le=n[49];const ae=`terminal-profile-remove-${l.id}`;let ce,de,me;return n[50]!==T||n[51]!==le||n[52]!==ae?(ce=(0,Z.jsx)(b.Button,{variant:"ghost",size:"sm",leftIcon:oe,onPress:T,accessibilityLabel:le,testID:ae}),n[50]=T,n[51]=le,n[52]=ae,n[53]=ce):ce=n[53],n[54]!==N||n[55]!==J||n[56]!==re||n[57]!==ce?(de=(0,Z.jsxs)(t.View,{style:Ve.rowActions,children:[N,J,re,ce]}),n[54]=N,n[55]=J,n[56]=re,n[57]=ce,n[58]=de):de=n[58],n[59]!==R||n[60]!==E||n[61]!==$||n[62]!==de||n[63]!==A?(me=(0,Z.jsxs)(t.View,{style:R,testID:A,children:[E,$,de]}),n[59]=R,n[60]=E,n[61]=$,n[62]=de,n[63]=A,n[64]=me):me=n[64],me}function He(e){const n=(0,o.c)(63),{serverId:l}=e,{t:h}=(0,u.useTranslation)(),p=(0,M.useHostRuntimeIsConnected)(l),{config:x,patchConfig:v}=(0,D.useDaemonConfig)(l),[S,w]=(0,c.useState)(null),[I,T]=(0,c.useState)(!1);let _;n[0]!==x?(_=x?(0,y.resolveTerminalProfiles)(x.terminalProfiles):null,n[0]=x,n[1]=_):_=n[1];const P=_;let C;n[2]!==v?(C=async e=>{await v({terminalProfiles:e})},n[2]=v,n[3]=C):C=n[3];const z=C;let H;n[4]===Symbol.for("react.memo_cache_sentinel")?(H=()=>T(!0),n[4]=H):H=n[4];const V=H;let R;n[5]===Symbol.for("react.memo_cache_sentinel")?(R=()=>T(!1),n[5]=R):R=n[5];const L=R;let E;n[6]!==P||n[7]!==z?(E=async e=>{const t=[...P?[...P]:[],{id:`profile_${Date.now().toString(36)}_${Math.random().toString(36).slice(2)}`,name:e.name,command:e.command,args:De(e.args)}];await z(t),T(!1)},n[6]=P,n[7]=z,n[8]=E):E=n[8];const U=E;let F;n[9]!==P?(F=e=>{const t=P?.find(t=>t.id===e);t&&w({id:e,draft:{name:t.name,command:t.command,args:t.args?t.args.join(" "):""}})},n[9]=P,n[10]=F):F=n[10];const $=F;let O;n[11]===Symbol.for("react.memo_cache_sentinel")?(O=()=>w(null),n[11]=O):O=n[11];const W=O;let q;n[12]!==S||n[13]!==P||n[14]!==z?(q=async e=>{if(!S||!P)return;const t=P.map(t=>t.id===S.id?Object.assign({},t,{name:e.name,command:e.command,args:De(e.args)}):t);await z(t),w(null)},n[12]=S,n[13]=P,n[14]=z,n[15]=q):q=n[15];const N=q;let G;n[16]!==P||n[17]!==z||n[18]!==h?(G=e=>{const t=P?.find(t=>t.id===e);t&&(0,A.confirmDialog)({title:h("settings.host.terminalProfiles.removeConfirmTitle"),message:h("settings.host.terminalProfiles.removeConfirmMessage",{name:t.name}),confirmLabel:h("settings.host.terminalProfiles.remove"),cancelLabel:h("common.actions.cancel"),destructive:!0}).then(async t=>{if(t&&P)try{await z(P.filter(t=>t.id!==e))}catch(e){const t=e;f.default.alert(h("common.errors.unableToSave"),t instanceof Error?t.message:String(t))}})},n[16]=P,n[17]=z,n[18]=h,n[19]=G):G=n[19];const K=G;let J;n[20]!==P||n[21]!==z||n[22]!==h?(J=async e=>{if(!P)return;const t=P.findIndex(t=>t.id===e);if(t<=0)return;const s=[...P],[n]=s.splice(t,1);s.splice(t-1,0,n);try{await z(s)}catch(e){const t=e;f.default.alert(h("common.errors.unableToSave"),t instanceof Error?t.message:String(t))}},n[20]=P,n[21]=z,n[22]=h,n[23]=J):J=n[23];const Q=J;let X;n[24]!==P||n[25]!==z||n[26]!==h?(X=async e=>{if(!P)return;const t=P.findIndex(t=>t.id===e);if(t<0||t>=P.length-1)return;const s=[...P],[n]=s.splice(t,1);s.splice(t+1,0,n);try{await z(s)}catch(e){const t=e;f.default.alert(h("common.errors.unableToSave"),t instanceof Error?t.message:String(t))}},n[24]=P,n[25]=z,n[26]=h,n[27]=X):X=n[27];const Y=X,ee=!p||!P;let te;n[28]!==ee?(te=(0,Z.jsx)(b.Button,{variant:"ghost",size:"sm",leftIcon:ie,onPress:V,disabled:ee,testID:"terminal-profiles-add-button"}),n[28]=ee,n[29]=te):te=n[29];const se=te;if(!p){let e,o;return n[30]!==h?(e=h("settings.host.terminalProfiles.unavailable"),n[30]=h,n[31]=e):e=n[31],n[32]!==e?(o=(0,Z.jsx)(t.View,{style:B.settingsStyles.card,testID:"terminal-profiles-unavailable",children:(0,Z.jsx)(t.View,{style:Ve.emptyCard,children:(0,Z.jsx)(s.Text,{style:Ve.emptyText,children:e})})}),n[32]=e,n[33]=o):o=n[33],o}let ne,oe,re,le,ae,ce,de,me;return n[34]!==h?(ne=h("settings.host.terminalProfiles.sectionTitle"),n[34]=h,n[35]=ne):ne=n[35],n[36]!==$||n[37]!==Y||n[38]!==Q||n[39]!==K||n[40]!==P||n[41]!==h?(oe=P&&P.length>0?P.map((e,t)=>(0,Z.jsx)(Me,{profile:e,isFirst:0===t,isLast:t===P.length-1,onEdit:$,onRemove:K,onMoveUp:Q,onMoveDown:Y},e.id)):(0,Z.jsx)(t.View,{style:Ve.emptyCard,children:(0,Z.jsx)(s.Text,{style:Ve.emptyText,children:h("settings.host.terminalProfiles.emptyState")})}),n[36]=$,n[37]=Y,n[38]=Q,n[39]=K,n[40]=P,n[41]=h,n[42]=oe):oe=n[42],n[43]!==oe?(re=(0,Z.jsx)(t.View,{style:B.settingsStyles.card,testID:"terminal-profiles-card",children:oe}),n[43]=oe,n[44]=re):re=n[44],n[45]!==se||n[46]!==ne||n[47]!==re?(le=(0,Z.jsx)(k.SettingsSection,{title:ne,trailing:se,testID:"terminal-profiles-section",children:re}),n[45]=se,n[46]=ne,n[47]=re,n[48]=le):le=n[48],n[49]!==h?(ae=h("settings.host.terminalProfiles.addProfileTitle"),n[49]=h,n[50]=ae):ae=n[50],n[51]!==U||n[52]!==I||n[53]!==ae?(ce=(0,Z.jsx)(j.TerminalProfileEditModal,{visible:I,title:ae,initialDraft:ze,onClose:L,onSave:U,testID:"terminal-profile-edit-modal"}),n[51]=U,n[52]=I,n[53]=ae,n[54]=ce):ce=n[54],n[55]!==S||n[56]!==N||n[57]!==h?(de=S?(0,Z.jsx)(j.TerminalProfileEditModal,{visible:!0,title:h("settings.host.terminalProfiles.editProfileTitle"),initialDraft:S.draft,onClose:W,onSave:N}):null,n[55]=S,n[56]=N,n[57]=h,n[58]=de):de=n[58],n[59]!==le||n[60]!==ce||n[61]!==de?(me=(0,Z.jsxs)(Z.Fragment,{children:[le,ce,de]}),n[59]=le,n[60]=ce,n[61]=de,n[62]=me):me=n[62],me}const Ve=p.StyleSheet.create(e=>({row:{gap:e.spacing[2],minHeight:56,uni__dependencies:[0]},iconWrapper:{width:e.iconSize.md,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},rowActions:{flexDirection:"row",alignItems:"center",gap:0},emptyCard:{padding:e.spacing[4],alignItems:"center",uni__dependencies:[0]},emptyText:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,textAlign:"center",uni__dependencies:[0]}})),Re=p.StyleSheet.create(e=>({identityEditButton:{padding:e.spacing[1],borderRadius:e.borderRadius.md,uni__dependencies:[0]},daemonHeader:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],marginBottom:e.spacing[4],uni__dependencies:[0]},daemonHeaderLabel:{flexShrink:1,fontSize:e.fontSize.base,fontWeight:e.fontWeight.medium,color:e.colors.foreground,uni__dependencies:[0]},identityBadges:{flexDirection:"row",alignItems:"center",gap:e.spacing[1],flexWrap:"wrap",marginBottom:e.spacing[6],uni__dependencies:[0]},statusPill:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:e.spacing[2],paddingVertical:4,borderRadius:e.borderRadius.full,uni__dependencies:[0]},statusDot:{width:6,height:6,borderRadius:e.borderRadius.full,uni__dependencies:[0]},statusText:{fontSize:e.fontSize.xs,fontWeight:e.fontWeight.normal,uni__dependencies:[0]},badgePill:{flexDirection:"row",alignItems:"center",gap:6,paddingHorizontal:e.spacing[2],paddingVertical:4,borderRadius:e.borderRadius.full,borderWidth:1,borderColor:e.colors.border,backgroundColor:e.colors.surface3,maxWidth:200,uni__dependencies:[0]},badgeText:{fontSize:e.fontSize.xs,fontWeight:e.fontWeight.normal,color:e.colors.foregroundMuted,flexShrink:1,uni__dependencies:[0]},errorText:{color:e.colors.palette.red[300],fontSize:e.fontSize.xs,marginBottom:e.spacing[2],uni__dependencies:[0]},connectionLatency:{fontSize:e.fontSize.sm,marginRight:e.spacing[2],uni__dependencies:[0]},confirmText:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,uni__dependencies:[0]},confirmActions:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],marginTop:e.spacing[4],uni__dependencies:[0]},appendPromptActions:{flexDirection:"row",justifyContent:"flex-end",gap:e.spacing[2],uni__dependencies:[0]},emptyCard:{padding:e.spacing[4],alignItems:"center",uni__dependencies:[0]},emptyText:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,uni__dependencies:[0]}})),ke={flex:1},Le=[B.settingsStyles.card,Re.emptyCard]},4747,[348,711,1572,349,1600,36,1573,1389,1308,234,146,56,4598,3466,3626,4748,3627,4731,4749,3403,4742,4746,3576,4658,3903,3475,3271,4751,4754,3972,4727,3414,3907,3678,4140,3401,3605,4757,305,3929,4758,279]);
|
|
16507
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.SettingsTextArea=u,e.SettingsTextAreaCard=function(n){const s=(0,o.c)(2);let p;s[0]!==n?(p=(0,c.jsx)(t.View,{style:l.settingsStyles.card,children:(0,c.jsx)(u,Object.assign({},n))}),s[0]=n,s[1]=p):p=s[1];return p};var t=r(d[0]),n=r(d[1]),o=r(d[2]);r(d[3]),r(d[4]),r(d[5]);var s=r(d[6]),l=r(d[7]),c=r(d[8]);function u(t){const l=(0,o.c)(10),{accessibilityLabel:u,value:f,onChangeText:x,placeholder:h,testID:y,style:S}=t,{theme:b}=(0,s.useUnistyles)();let T;l[0]!==S?(T=[p.input,S],l[0]=S,l[1]=T):T=l[1];const _=T;let j;return l[2]!==u||l[3]!==_||l[4]!==x||l[5]!==h||l[6]!==y||l[7]!==b.colors.foregroundMuted||l[8]!==f?(j=(0,c.jsx)(n.TextInput,{testID:y,accessibilityLabel:u,multiline:!0,value:f,onChangeText:x,placeholder:h,placeholderTextColor:b.colors.foregroundMuted,style:_}),l[2]=u,l[3]=_,l[4]=x,l[5]=h,l[6]=y,l[7]=b.colors.foregroundMuted,l[8]=f,l[9]=j):j=l[9],j}const p=s.StyleSheet.create(t=>({input:{color:t.colors.foreground,fontSize:t.fontSize.sm,paddingVertical:t.spacing[3],paddingHorizontal:t.spacing[4],minHeight:96,textAlignVertical:"top",uni__dependencies:[0]}}))},4748,[348,714,349,36,715,146,56,3907,279]);
|
|
16508
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.TerminalProfileEditModal=function({visible:o,title:h,initialDraft:y,onClose:x,onSave:P,testID:C}){const{t:v}=(0,l.useTranslation)(),[I,j]=(0,s.useState)(y.name),[D,S]=(0,s.useState)(y.command),[T,k]=(0,s.useState)(y.args),[_,F]=(0,s.useState)({}),[L,E]=(0,s.useState)(null),[B,K]=(0,s.useState)(!1),z=(0,s.useRef)(null),M=(0,s.useRef)(null),R=(0,s.useRef)(null),V=(0,s.useCallback)(t=>{j(t),F(t=>Object.assign({},t,{name:void 0}))},[]),w=(0,s.useCallback)(t=>{S(t),F(t=>Object.assign({},t,{command:void 0}))},[]),O=(0,s.useCallback)(t=>{k(t)},[]),q=(0,s.useMemo)(()=>({title:h}),[h]);(0,s.useEffect)(()=>{if(!o)return void K(!1);j(y.name),S(y.command),k(y.args),F({}),E(null),K(!1);const t=setTimeout(()=>{z.current?.focus()},50);return()=>clearTimeout(t)},[o,y.name,y.command,y.args]);const A=(0,s.useCallback)(()=>{const t={};return 0===I.trim().length&&(t.name=v("settings.host.terminalProfiles.nameRequired")),0===D.trim().length&&(t.command=v("settings.host.terminalProfiles.commandRequired")),F(t),0===Object.keys(t).length},[D,I,v]),H=(0,s.useCallback)(async()=>{if(!B&&(E(null),A())){K(!0);try{await P({name:I.trim(),command:D.trim(),args:T}),x()}catch(t){E(t instanceof Error?t.message:v("common.errors.unableToSave"))}finally{K(!1)}}},[T,D,B,I,x,P,v,A]),W=(0,s.useCallback)(()=>{B||x()},[B,x]),G=(0,s.useCallback)(()=>{M.current?.focus()},[]),J=(0,s.useCallback)(()=>{R.current?.focus()},[]),N=(0,s.useCallback)(()=>{H()},[H]),Q=_.name,U=_.command;return(0,p.jsx)(c.AdaptiveModalSheet,{visible:o,header:q,onClose:W,testID:C,desktopMaxWidth:480,children:(0,p.jsxs)(t.View,{style:b.body,children:[(0,p.jsx)(f.FormField,{label:v("settings.host.terminalProfiles.nameLabel"),error:Q,testID:"terminal-profile-name-field",children:(0,p.jsx)(f.FormTextInput,{ref:z,initialValue:y.name,resetKey:o?"open":"closed",onChangeText:V,placeholder:v("settings.host.terminalProfiles.namePlaceholder"),autoCapitalize:"none",autoCorrect:!1,editable:!B,returnKeyType:"next",onSubmitEditing:G,nativeID:"terminal-profile-name-input",accessibilityLabel:v("settings.host.terminalProfiles.nameLabel"),testID:"terminal-profile-name-input"})}),(0,p.jsx)(f.FormField,{label:v("settings.host.terminalProfiles.commandLabel"),error:U,testID:"terminal-profile-command-field",children:(0,p.jsx)(f.FormTextInput,{ref:M,initialValue:y.command,resetKey:o?"open":"closed",onChangeText:w,placeholder:v("settings.host.terminalProfiles.commandPlaceholder"),autoCapitalize:"none",autoCorrect:!1,editable:!B,returnKeyType:"next",onSubmitEditing:J,nativeID:"terminal-profile-command-input",accessibilityLabel:v("settings.host.terminalProfiles.commandLabel"),testID:"terminal-profile-command-input"})}),(0,p.jsx)(f.FormField,{label:v("settings.host.terminalProfiles.argsLabel"),hint:v("settings.host.terminalProfiles.argsHint"),testID:"terminal-profile-args-field",children:(0,p.jsx)(f.FormTextInput,{ref:R,initialValue:y.args,resetKey:o?"open":"closed",onChangeText:O,placeholder:v("settings.host.terminalProfiles.argsPlaceholder"),autoCapitalize:"none",autoCorrect:!1,editable:!B,returnKeyType:"done",onSubmitEditing:N,nativeID:"terminal-profile-args-input",accessibilityLabel:v("settings.host.terminalProfiles.argsLabel"),testID:"terminal-profile-args-input"})}),L?(0,p.jsx)(n.Text,{style:b.submitError,testID:"terminal-profile-submit-error",children:L}):null,(0,p.jsxs)(t.View,{style:b.actions,children:[(0,p.jsx)(u.Button,{variant:"secondary",style:b.actionButton,onPress:W,disabled:B,testID:"terminal-profile-cancel-button",children:v("common.actions.cancel")}),(0,p.jsx)(u.Button,{variant:"default",style:b.actionButton,onPress:H,disabled:B,testID:"terminal-profile-save-button",children:v(B?"settings.host.terminalProfiles.saving":"settings.host.terminalProfiles.save")})]})]})})};var t=r(d[0]),n=r(d[1]),s=r(d[2]);r(d[3]),r(d[4]);var l=r(d[5]),o=r(d[6]),c=r(d[7]),u=r(d[8]),f=r(d[9]),p=r(d[10]);const b=o.StyleSheet.create(t=>({body:{gap:t.spacing[4],paddingBottom:t.spacing[2],uni__dependencies:[0]},actions:{flexDirection:"row",alignItems:"center",gap:t.spacing[2],marginTop:t.spacing[2],uni__dependencies:[0]},actionButton:{flex:1},submitError:{color:t.colors.palette.red[300],fontSize:t.fontSize.sm,uni__dependencies:[0]}}))},4749,[348,711,36,234,146,1573,56,3466,3627,4750,279]);
|
|
16509
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";const e=["style"];Object.defineProperty(_e,'__esModule',{value:!0}),_e.FormField=function(e){const t=(0,c.c)(13),{label:n,children:o,hint:u,error:f,testID:p}=e,x=p?`${p}-hint`:void 0,h=p?`${p}-error`:void 0;let S;e:{if(f){let e;t[0]!==f||t[1]!==h?(e=(0,b.jsx)(s.Text,{style:_.errorText,testID:h,children:f}),t[0]=f,t[1]=h,t[2]=e):e=t[2],S=e;break e}if(u){let e;t[3]!==u||t[4]!==x?(e=(0,b.jsx)(s.Text,{style:_.hintText,testID:x,children:u}),t[3]=u,t[4]=x,t[5]=e):e=t[5],S=e;break e}S=null}const y=S;let z,T;t[6]!==n?(z=(0,b.jsx)(s.Text,{style:_.label,children:n}),t[6]=n,t[7]=z):z=t[7];t[8]!==o||t[9]!==y||t[10]!==z||t[11]!==p?(T=(0,b.jsxs)(l.View,{style:_.container,testID:p,children:[z,o,y]}),t[8]=o,t[9]=y,t[10]=z,t[11]=p,t[12]=T):T=t[12];return T},Object.defineProperty(_e,"FormTextInput",{enumerable:!0,get:function(){return x}});var t,n=r(d[0]),o=(t=n)&&t.__esModule?t:{default:t},l=r(d[1]),s=r(d[2]),c=r(d[3]),u=r(d[4]);r(d[5]),r(d[6]);var f=r(d[7]),p=r(d[8]),b=r(d[9]);const x=(0,u.forwardRef)(function(t,n){const l=(0,c.c)(9);let s,u,f;if(l[0]!==t){var x=t;({style:u}=x),s=(0,o.default)(x,e),l[0]=t,l[1]=s,l[2]=u}else s=l[1],u=l[2];l[3]!==u?(f=[h.input,u],l[3]=u,l[4]=f):f=l[4];const _=f;let S;return l[5]!==_||l[6]!==s||l[7]!==n?(S=(0,b.jsx)(p.AdaptiveTextInput,Object.assign({ref:n},s,{style:_})),l[5]=_,l[6]=s,l[7]=n,l[8]=S):S=l[8],S}),_=f.StyleSheet.create(e=>({container:{gap:e.spacing[2],uni__dependencies:[0]},label:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,fontWeight:e.fontWeight.medium,uni__dependencies:[0]},hintText:{color:e.colors.foregroundMuted,fontSize:e.fontSize.xs,uni__dependencies:[0]},errorText:{color:e.colors.palette.red[300],fontSize:e.fontSize.xs,uni__dependencies:[0]}})),h=f.StyleSheet.create(e=>({input:{backgroundColor:e.colors.surface2,borderRadius:e.borderRadius.lg,paddingHorizontal:e.spacing[4],paddingVertical:e.spacing[3],color:e.colors.foreground,borderWidth:1,borderColor:e.colors.border,fontSize:e.fontSize.base,uni__dependencies:[0]}}))},4750,[35,348,711,349,36,234,146,56,3466,279]);
|
|
16510
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.ProvidersSection=function({serverId:e}){const{t:n}=(0,c.useTranslation)(),o=(0,b.useHostRuntimeIsConnected)(e),{entries:u,isLoading:f,refresh:_}=(0,h.useProvidersSnapshot)(e),{patchConfig:j}=(0,v.useDaemonConfig)(e),C=(0,P.useProviderSettingsStore)(e=>e.open),[z,D]=(0,l.useState)(null),[L,V]=(0,l.useState)(null),E=(0,l.useMemo)(()=>(0,y.buildProviderDefinitions)(u),[u]),F=e.length>0,H=(0,l.useCallback)(t=>{C({serverId:e,provider:t})},[C,e]),O=(0,l.useCallback)(async(e,t)=>{D(e);try{await j({providers:{[e]:{enabled:t}}})}catch(e){p.default.alert(n("settings.providers.updateErrorTitle"),e instanceof Error?e.message:String(e))}finally{D(t=>t===e?null:t)}},[j,n]),B=(0,l.useCallback)(async e=>{if(!L){V(e.id);try{await j((0,S.buildAcpProviderConfigPatch)(e)),await _([e.id])}catch(e){p.default.alert(n("settings.providers.addErrorTitle"),e instanceof Error?e.message:String(e))}finally{V(t=>t===e.id?null:t)}}},[L,j,_,n]);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(T.SettingsSection,{title:n("settings.providers.title"),testID:"host-page-providers-card",style:R.sectionSpacing,children:[F&&o?null:(0,I.jsx)(t.View,{style:k,children:(0,I.jsx)(s.Text,{style:R.emptyText,children:n("settings.providers.unavailable")})}),F&&o&&f?(0,I.jsx)(t.View,{style:k,children:(0,I.jsx)(s.Text,{style:R.emptyText,children:n("settings.providers.loading")})}):null,F&&o&&!f&&E.length>0?(0,I.jsx)(t.View,{style:x.settingsStyles.card,children:E.map((e,t)=>{const s=u?.find(t=>t.provider===e.id);return s?(0,I.jsx)(M,{def:e,entry:s,enabled:s.enabled??!0,isToggling:z===e.id,isFirst:0===t,onPress:H,onToggleEnabled:O},e.id):null})}):null]}),F&&o?(0,I.jsx)(T.SettingsSection,{title:n("settings.providers.addProvider"),testID:"host-page-add-provider-card",style:R.addProviderSection,children:(0,I.jsx)(w.ProviderCatalogList,{serverId:e,installingProviderId:L,onInstall:B})}):null]})};var e,t=r(d[0]),s=r(d[1]),n=r(d[2]),o=r(d[3]),l=r(d[4]),c=r(d[5]),u=r(d[6]),p=(e=u)&&e.__esModule?e:{default:e};r(d[7]),r(d[8]),r(d[9]);var f=r(d[10]),x=r(d[11]),b=r(d[12]),h=r(d[13]),v=r(d[14]),y=r(d[15]),S=r(d[16]),w=r(d[17]),_=r(d[18]),j=r(d[19]),C=r(d[20]),T=r(d[21]),P=r(d[22]),z=r(d[23]),I=r(d[24]);function D(e,t,s,n){return t?"loading"===e?{tone:"loading",label:n("settings.providers.statuses.loading"),modelCount:null}:"error"===e?{tone:"danger",label:n("settings.providers.statuses.error"),modelCount:null}:"ready"===e?{tone:"success",label:n("settings.providers.statuses.available"),modelCount:s>0?s:null}:{tone:"warning",label:n("settings.providers.statuses.notInstalled"),modelCount:null}:{tone:"muted",label:n("settings.providers.statuses.disabled"),modelCount:null}}function M(e){const l=(0,o.c)(40),{def:u,entry:p,enabled:b,isToggling:h,isFirst:v,onPress:y,onToggleEnabled:S}=e,{t:w}=(0,c.useTranslation)(),{theme:j}=(0,f.useUnistyles)();let T;l[0]!==u.id?(T=(0,_.getProviderIcon)(u.id),l[0]=u.id,l[1]=T):T=l[1];const P=T;let M;l[2]!==b||l[3]!==p.error||l[4]!==p.status?(M=b&&"error"===p.status&&"string"==typeof p.error&&p.error.trim().length>0?p.error.trim():null,l[2]=b,l[3]=p.error,l[4]=p.status,l[5]=M):M=l[5];const L=M,k=p.models?.length??0;let E;l[6]!==b||l[7]!==p.status||l[8]!==k||l[9]!==w?(E=D(p.status,b,k,w),l[6]=b,l[7]=p.status,l[8]=k,l[9]=w,l[10]=E):E=l[10];const F=E;let H;l[11]!==u.id||l[12]!==y?(H=()=>{y(u.id)},l[11]=u.id,l[12]=y,l[13]=H):H=l[13];const O=H;let B;l[14]!==u.id||l[15]!==S?(B=e=>{S(u.id,e)},l[14]=u.id,l[15]=S,l[16]=B):B=l[16];const U=B;let W;l[17]!==v?(W=e=>{const{pressed:t,hovered:s}=e;return[x.settingsStyles.row,!v&&x.settingsStyles.rowBorder,R.row,s&&R.rowHovered,t&&R.rowPressed]},l[17]=v,l[18]=W):W=l[18];const A=W;let q,G,J;return l[19]!==u.label||l[20]!==w?(q=w("settings.providers.providerDetails",{name:u.label}),l[19]=u.label,l[20]=w,l[21]=q):q=l[21],l[22]!==P||l[23]!==u.label||l[24]!==b||l[25]!==U||l[26]!==h||l[27]!==L||l[28]!==F||l[29]!==w||l[30]!==j.colors.foreground||l[31]!==j.colors.foregroundMuted||l[32]!==j.iconSize.md||l[33]!==j.iconSize.sm?(G=e=>{const{hovered:n}=e;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(t.View,{style:R.rowContent,children:[(0,I.jsx)(z.ChevronRight,{size:j.iconSize.sm,color:n?j.colors.foreground:j.colors.foregroundMuted}),(0,I.jsx)(P,{size:j.iconSize.md,color:j.colors.foreground}),(0,I.jsxs)(t.View,{style:R.textColumn,children:[(0,I.jsxs)(t.View,{style:R.titleRow,children:[(0,I.jsx)(s.Text,{style:x.settingsStyles.rowTitle,numberOfLines:1,children:u.label}),(0,I.jsx)(s.Text,{style:R.separator,children:"\xb7"}),(0,I.jsx)(V,{status:F})]}),L?(0,I.jsx)(s.Text,{style:R.errorText,numberOfLines:3,children:L}):null]})]}),(0,I.jsx)(C.Switch,{value:b,onValueChange:U,disabled:h,accessibilityLabel:w("settings.providers.enableProvider",{name:u.label})})]})},l[22]=P,l[23]=u.label,l[24]=b,l[25]=U,l[26]=h,l[27]=L,l[28]=F,l[29]=w,l[30]=j.colors.foreground,l[31]=j.colors.foregroundMuted,l[32]=j.iconSize.md,l[33]=j.iconSize.sm,l[34]=G):G=l[34],l[35]!==O||l[36]!==A||l[37]!==q||l[38]!==G?(J=(0,I.jsx)(n.Pressable,{style:A,onPress:O,accessibilityRole:"button",accessibilityLabel:q,children:G}),l[35]=O,l[36]=A,l[37]=q,l[38]=G,l[39]=J):J=l[39],J}function L(e,t){switch(e){case"success":return t.colors.statusSuccess;case"warning":return t.colors.statusWarning;case"danger":return t.colors.statusDanger;default:return t.colors.foregroundMuted}}function V(e){const n=(0,o.c)(18),{status:l}=e,{t:u}=(0,c.useTranslation)(),{theme:p}=(0,f.useUnistyles)();let x,b;n[0]!==l.tone||n[1]!==p?(x=L(l.tone,p),n[0]=l.tone,n[1]=p,n[2]=x):x=n[2],n[3]!==x?(b=[R.statusDot,{backgroundColor:x}],n[3]=x,n[4]=b):b=n[4];const h=b;let v,y,S,w;return n[5]!==h||n[6]!==l.tone||n[7]!==p?(v="loading"===l.tone?(0,I.jsx)(j.LoadingSpinner,{size:10,color:p.colors.foregroundMuted}):(0,I.jsx)(t.View,{style:h}),n[5]=h,n[6]=l.tone,n[7]=p,n[8]=v):v=n[8],n[9]!==l.label?(y=(0,I.jsx)(s.Text,{style:R.statusLabel,children:l.label}),n[9]=l.label,n[10]=y):y=n[10],n[11]!==l.modelCount||n[12]!==u?(S=null!==l.modelCount?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(s.Text,{style:R.separator,children:"\xb7"}),(0,I.jsx)(s.Text,{style:R.statusLabel,children:1===l.modelCount?u("settings.providers.models.one"):u("settings.providers.models.many",{count:l.modelCount})})]}):null,n[11]=l.modelCount,n[12]=u,n[13]=S):S=n[13],n[14]!==v||n[15]!==y||n[16]!==S?(w=(0,I.jsxs)(t.View,{style:R.statusRow,children:[v,y,S]}),n[14]=v,n[15]=y,n[16]=S,n[17]=w):w=n[17],w}const R=f.StyleSheet.create(e=>({sectionSpacing:{marginBottom:e.spacing[4],uni__dependencies:[0]},addProviderSection:{marginTop:e.spacing[4],uni__dependencies:[0]},emptyCard:{padding:e.spacing[4],alignItems:"center",uni__dependencies:[0]},emptyText:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,uni__dependencies:[0]},row:{gap:e.spacing[3],minHeight:56,uni__dependencies:[0]},rowHovered:{backgroundColor:e.colors.surface2,uni__dependencies:[0]},rowPressed:{backgroundColor:e.colors.surface3,uni__dependencies:[0]},rowContent:{flex:1,flexDirection:"row",alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},textColumn:{flex:1,minWidth:0},titleRow:{flexDirection:"row",alignItems:"center",gap:e.spacing[2],uni__dependencies:[0]},statusRow:{flexDirection:"row",alignItems:"center",gap:e.spacing[1.5],uni__dependencies:[0]},statusDot:{width:8,height:8,borderRadius:4},statusLabel:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,uni__dependencies:[0]},separator:{color:e.colors.foregroundMuted,fontSize:e.fontSize.sm,uni__dependencies:[0]},errorText:{color:e.colors.palette.red[300],fontSize:e.fontSize.xs,marginTop:e.spacing[1],uni__dependencies:[0]}})),k=[x.settingsStyles.card,R.emptyCard]},4751,[348,711,1572,349,36,1573,1389,1308,234,146,56,3907,3271,3904,3903,3908,4752,4753,3929,3564,4731,4727,3910,1600,279]);
|
|
16511
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.getAcpProviderCatalog=function(){return c.ACP_PROVIDER_CATALOG},e.buildAcpProviderConfigPatch=function(t){return{providers:{[t.id]:Object.assign({extends:"acp",label:t.title,description:t.description,command:[...t.command],env:t.env?Object.assign({},t.env):{}},t.params?{params:Object.assign({},t.params)}:{})}}},e.useAcpProviderCatalog=function(){const s=(0,t.c)(5),[o]=(0,n.useState)(c.ACP_PROVIDER_CATALOG);let u;s[0]!==o?(u=async()=>o,s[0]=o,s[1]=u):u=s[1];const l=u;let p;s[2]!==o||s[3]!==l?(p={entries:o,loading:!1,error:null,refetch:l},s[2]=o,s[3]=l,s[4]=p):p=s[4];return p};var t=r(d[0]),n=r(d[1]),c=r(d[2])},4752,[349,36,3937]);
|
|
16512
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.ProviderCatalogList=function(t){const s=(0,l.c)(27),{serverId:p,installingProviderId:h,onInstall:f}=t,{t:x}=(0,u.useTranslation)(),{entries:b}=(0,_.useAcpProviderCatalog)(),{entries:y}=(0,v.useProvidersSnapshot)(p),[C,j]=(0,c.useState)("");let I;s[0]!==y?(I=new Set(y?.map(B)??[]),s[0]=y,s[1]=I):I=s[1];const z=I;let L;if(s[2]!==b||s[3]!==z||s[4]!==C){let n,t;s[6]!==z?(n=n=>!z.has(n.id),s[6]=z,s[7]=n):n=s[7],s[8]!==C?(t=n=>W(n,C),s[8]=C,s[9]=t):t=s[9],L=b.filter(n).filter(t),s[2]=b,s[3]=z,s[4]=C,s[5]=L}else L=s[5];const T=L;let U,F,O,E,H,A;s[10]===Symbol.for("react.memo_cache_sentinel")?(U=(0,S.jsx)(n.View,{style:M.searchIcon,children:(0,S.jsx)(k,{size:w,uniProps:R})}),s[10]=U):U=s[10];s[11]!==x?(F=x("providerCatalog.search"),s[11]=x,s[12]=F):F=s[12];s[13]!==x?(O=x("providerCatalog.search"),s[13]=x,s[14]=O):O=s[14];s[15]!==C||s[16]!==F||s[17]!==O?(E=(0,S.jsxs)(n.View,{style:M.searchField,children:[U,(0,S.jsx)(P,{testID:"provider-catalog-search",value:C,onChangeText:j,accessibilityLabel:F,placeholder:O,style:D,autoCapitalize:"none",autoCorrect:!1})]}),s[15]=C,s[16]=F,s[17]=O,s[18]=E):E=s[18];s[19]!==T||s[20]!==h||s[21]!==f||s[22]!==x?(H=0===T.length?(0,S.jsx)(n.View,{style:M.stateBox,children:(0,S.jsx)(o.Text,{style:M.stateText,children:x("providerCatalog.noProviders")})}):(0,S.jsx)(n.View,{style:M.list,children:T.map(n=>(0,S.jsx)(V,{entry:n,installing:h===n.id,onInstall:f},n.id))}),s[19]=T,s[20]=h,s[21]=f,s[22]=x,s[23]=H):H=s[23];s[24]!==E||s[25]!==H?(A=(0,S.jsxs)(n.View,{children:[E,H]}),s[24]=E,s[25]=H,s[26]=A):A=s[26];return A};var n=r(d[0]),t=r(d[1]),o=r(d[2]),s=r(d[3]),l=r(d[4]),c=r(d[5]),u=r(d[6]);r(d[7]),r(d[8]),r(d[9]),r(d[10]);var p=r(d[11]),h=r(d[12]),f=r(d[13]),x=r(d[14]),b=r(d[15]),_=r(d[16]),v=r(d[17]),y=r(d[18]),S=r(d[19]);const w=16,C=20,j=24,I=(0,h.withUnistyles)(f.PackagePlus),z=(0,h.withUnistyles)(p.SvgXml),k=(0,h.withUnistyles)(f.Search),L=(0,h.withUnistyles)(f.ExternalLink),P=(0,h.withUnistyles)(t.TextInput,n=>({placeholderTextColor:n.colors.foregroundMuted})),T=n=>({color:n.colors.foreground}),R=n=>({color:n.colors.foregroundMuted});function W(n,t){const o=t.trim().toLowerCase();return!o||[n.title,n.id,n.description].some(n=>n.toLowerCase().includes(o))}function V(t){const c=(0,l.c)(44),{entry:p,installing:h,onInstall:f}=t,{t:b}=(0,u.useTranslation)();let _;c[0]!==h||c[1]!==b?(_=b(h?"providerCatalog.actions.adding":"providerCatalog.actions.add"),c[0]=h,c[1]=b,c[2]=_):_=c[2];const v=_;let w;c[3]!==p||c[4]!==f?(w=()=>{f(p)},c[3]=p,c[4]=f,c[5]=w):w=c[5];const k=w;let P;c[6]!==p.installLink?(P=()=>{(0,y.openExternalUrl)(p.installLink)},c[6]=p.installLink,c[7]=P):P=c[7];const W=P;let V,B,D,U;c[8]!==p.iconSvg?(V=(0,S.jsx)(n.View,{style:M.iconFrame,children:p.iconSvg?(0,S.jsx)(z,{xml:p.iconSvg,width:j,height:j,uniProps:T}):(0,S.jsx)(I,{size:C,uniProps:T})}),c[8]=p.iconSvg,c[9]=V):V=c[9],c[10]!==p.title?(B=(0,S.jsx)(o.Text,{style:M.name,numberOfLines:1,children:p.title}),c[10]=p.title,c[11]=B):B=c[11],c[12]!==p.version?(D=(0,S.jsx)(o.Text,{style:M.version,numberOfLines:1,children:p.version}),c[12]=p.version,c[13]=D):D=c[13],c[14]!==B||c[15]!==D?(U=(0,S.jsxs)(n.View,{style:M.titleRow,children:[B,D]}),c[14]=B,c[15]=D,c[16]=U):U=c[16];const F=p.description||p.id;let O,E,H,A,X,$,q;c[17]!==F?(O=(0,S.jsx)(o.Text,{style:M.description,numberOfLines:1,children:F}),c[17]=F,c[18]=O):O=c[18],c[19]!==p.title||c[20]!==b?(E=b("providerCatalog.actions.installInstructionsFor",{provider:p.title}),c[19]=p.title,c[20]=b,c[21]=E):E=c[21],c[22]!==b?(H=b("providerCatalog.actions.installInstructions"),c[22]=b,c[23]=H):H=c[23],c[24]!==H?(A=(0,S.jsx)(o.Text,{style:M.installLinkText,numberOfLines:1,children:H}),c[24]=H,c[25]=A):A=c[25],c[26]===Symbol.for("react.memo_cache_sentinel")?(X=(0,S.jsx)(L,{size:12,uniProps:R}),c[26]=X):X=c[26],c[27]!==W||c[28]!==E||c[29]!==A?($=(0,S.jsxs)(s.Pressable,{accessibilityRole:"link",accessibilityLabel:E,onPress:W,style:M.installLink,children:[A,X]}),c[27]=W,c[28]=E,c[29]=A,c[30]=$):$=c[30],c[31]!==$||c[32]!==U||c[33]!==O?(q=(0,S.jsxs)(n.View,{style:M.textColumn,children:[U,O,$]}),c[31]=$,c[32]=U,c[33]=O,c[34]=q):q=c[34];const G=`install-provider-${p.id}`;let J,K;return c[35]!==v||c[36]!==k||c[37]!==h||c[38]!==G?(J=(0,S.jsx)(x.Button,{size:"sm",variant:"default",disabled:h,loading:h,onPress:k,style:M.actionButton,testID:G,children:v}),c[35]=v,c[36]=k,c[37]=h,c[38]=G,c[39]=J):J=c[39],c[40]!==q||c[41]!==J||c[42]!==V?(K=(0,S.jsxs)(n.View,{style:M.row,children:[V,q,J]}),c[40]=q,c[41]=J,c[42]=V,c[43]=K):K=c[43],K}function B(n){return n.provider}const M=h.StyleSheet.create(n=>({searchField:{flexDirection:"row",alignItems:"center",gap:n.spacing[2],backgroundColor:n.colors.surface2,borderRadius:n.borderRadius.lg,borderWidth:1,borderColor:n.colors.border,paddingHorizontal:n.spacing[3],marginBottom:n.spacing[3],uni__dependencies:[0]},searchIcon:{width:18,alignItems:"center"},searchInput:{flex:1,minWidth:0,paddingVertical:n.spacing[3],color:n.colors.foreground,fontSize:n.fontSize.sm,uni__dependencies:[0]},list:{borderRadius:n.borderRadius.lg,borderWidth:1,borderColor:n.colors.border,overflow:"hidden",uni__dependencies:[0]},row:{flexDirection:"row",alignItems:"center",gap:n.spacing[3],padding:n.spacing[3],borderBottomWidth:1,borderBottomColor:n.colors.border,uni__dependencies:[0]},iconFrame:{width:36,height:36,borderRadius:n.borderRadius.md,backgroundColor:n.colors.surface2,alignItems:"center",justifyContent:"center",flexShrink:0,uni__dependencies:[0]},textColumn:{flex:1,minWidth:0,gap:n.spacing[1],uni__dependencies:[0]},titleRow:{flexDirection:"row",alignItems:"center",gap:n.spacing[2],minWidth:0,uni__dependencies:[0]},name:{color:n.colors.foreground,fontSize:n.fontSize.sm,fontWeight:n.fontWeight.medium,flexShrink:1,uni__dependencies:[0]},version:{color:n.colors.foregroundMuted,fontSize:n.fontSize.xs,flexShrink:0,uni__dependencies:[0]},description:{color:n.colors.foregroundMuted,fontSize:n.fontSize.xs,uni__dependencies:[0]},installLink:{alignSelf:"flex-start",flexDirection:"row",alignItems:"center",gap:n.spacing[1],maxWidth:"100%",uni__dependencies:[0]},installLinkText:{color:n.colors.foregroundMuted,fontSize:n.fontSize.xs,uni__dependencies:[0]},actionButton:{width:92,flexShrink:0},stateBox:{minHeight:96,borderRadius:n.borderRadius.lg,borderWidth:1,borderColor:n.colors.border,backgroundColor:n.colors.surface1,alignItems:"center",justifyContent:"center",gap:n.spacing[3],padding:n.spacing[4],uni__dependencies:[0]},stateText:{color:n.colors.foregroundMuted,fontSize:n.fontSize.sm,uni__dependencies:[0]}})),D=[M.searchInput,b.isWeb&&{outlineStyle:"none"}]},4753,[348,714,711,1572,349,36,1573,1308,234,715,146,1604,56,1600,3627,3407,4752,3904,3562,279]);
|
|
16513
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.ProviderUsageSettingsSection=function(t){const s=(0,n.c)(10),{view:l,onRefresh:c}=t,y="loading"===l.kind||"ready"===l.kind&&l.isRefreshing,h=y?f.providerUsageCopy.refreshing:f.providerUsageCopy.refresh;let _;s[0]!==y||s[1]!==c||s[2]!==h?(_=(0,u.jsx)(p.Button,{variant:"ghost",size:"sm",leftIcon:o.RefreshCw,loading:y,onPress:c,accessibilityLabel:f.providerUsageCopy.refresh,children:h}),s[0]=y,s[1]=c,s[2]=h,s[3]=_):_=s[3];const j=_;let C,S;s[4]!==c||s[5]!==l?(C=(0,u.jsx)(x,{view:l,onRefresh:c}),s[4]=c,s[5]=l,s[6]=C):C=s[6];s[7]!==j||s[8]!==C?(S=(0,u.jsx)(v.SettingsSection,{title:f.providerUsageCopy.title,testID:"provider-usage-card",trailing:j,children:C}),s[7]=j,s[8]=C,s[9]=S):S=s[9];return S};var t=r(d[0]),s=r(d[1]),n=r(d[2]),o=r(d[3]);r(d[4]),r(d[5]),r(d[6]);var l=r(d[7]),c=r(d[8]),p=r(d[9]),y=r(d[10]),v=r(d[11]),f=r(d[12]),h=r(d[13]),u=r(d[14]);function x(o){const l=(0,n.c)(9),{view:y,onRefresh:v}=o;if("loading"===y.kind){let n;return l[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,u.jsx)(t.View,{style:j,children:(0,u.jsx)(s.Text,{style:_.emptyText,children:f.providerUsageCopy.loading})}),l[0]=n):n=l[0],n}if("error"===y.kind){let t,s;return l[1]!==v?(t=(0,u.jsx)(p.Button,{variant:"outline",size:"sm",onPress:v,children:f.providerUsageCopy.retry}),l[1]=v,l[2]=t):t=l[2],l[3]!==t||l[4]!==y.message?(s=(0,u.jsx)(c.Alert,{variant:"error",title:f.providerUsageCopy.errorTitle,description:y.message,children:t}),l[3]=t,l[4]=y.message,l[5]=s):s=l[5],s}if(0===y.payload.providers.length){let n;return l[6]===Symbol.for("react.memo_cache_sentinel")?(n=(0,u.jsx)(t.View,{style:j,children:(0,u.jsx)(s.Text,{style:_.emptyText,children:f.providerUsageCopy.empty})}),l[6]=n):n=l[6],n}let x;return l[7]!==y.payload.providers?(x=(0,u.jsx)(h.ProviderUsageList,{providers:y.payload.providers}),l[7]=y.payload.providers,l[8]=x):x=l[8],x}const _=l.StyleSheet.create(t=>({emptyCard:{padding:t.spacing[4],alignItems:"center",uni__dependencies:[0]},emptyText:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,uni__dependencies:[0]}})),j=[y.settingsStyles.card,_.emptyCard]},4754,[348,711,349,1600,36,234,146,56,4755,3627,3907,4727,3971,4756,279]);
|
|
16514
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.Alert=function(l){const h=(0,t.c)(38),{title:x,description:b,variant:_,icon:y,children:S,testID:j}=l,w=void 0===_?"default":_,{theme:z}=(0,s.useUnistyles)();let v;h[0]!==z||h[1]!==w?(v=p(w,z),h[0]=z,h[1]=w,h[2]=v):v=h[2];const C=v;let V,W;h[3]!==C?(V=C?{borderColor:C}:null,h[3]=C,h[4]=V):V=h[4];h[5]!==V?(W=[f.container,V],h[5]=V,h[6]=W):W=h[6];const k=W;let T,D;h[7]!==C?(T=C?{color:C}:null,h[7]=C,h[8]=T):T=h[8];h[9]!==T?(D=[f.title,T],h[9]=T,h[10]=D):D=h[10];const I=D;let R;e:{if(void 0!==y){R=y;break e}if("default"===w){R=null;break e}const n=u[w],o=C??z.colors.foreground;let t;h[11]!==n||h[12]!==o||h[13]!==z.iconSize.sm?(t=(0,c.jsx)(n,{size:z.iconSize.sm,color:o}),h[11]=n,h[12]=o,h[13]=z.iconSize.sm,h[14]=t):t=h[14],R=t}const A=R,M=null!=b&&""!==b;let H,O,P,U,X,q,B;h[15]!==A?(H=A?(0,c.jsx)(n.View,{style:f.iconSlot,children:A}):null,h[15]=A,h[16]=H):H=h[16];h[17]!==x||h[18]!==I?(O=x?(0,c.jsx)(o.Text,{style:I,children:x}):null,h[17]=x,h[18]=I,h[19]=O):O=h[19];h[20]!==b||h[21]!==M?(P=M&&"string"==typeof b?(0,c.jsx)(o.Text,{style:f.description,children:b}):null,h[20]=b,h[21]=M,h[22]=P):P=h[22];h[23]!==b||h[24]!==M?(U=M&&"string"!=typeof b?(0,c.jsx)(n.View,{style:f.descriptionSlot,children:b}):null,h[23]=b,h[24]=M,h[25]=U):U=h[25];h[26]!==S?(X=S?(0,c.jsx)(n.View,{style:f.actions,children:S}):null,h[26]=S,h[27]=X):X=h[27];h[28]!==P||h[29]!==U||h[30]!==X||h[31]!==O?(q=(0,c.jsxs)(n.View,{style:f.body,children:[O,P,U,X]}),h[28]=P,h[29]=U,h[30]=X,h[31]=O,h[32]=q):q=h[32];h[33]!==k||h[34]!==q||h[35]!==H||h[36]!==j?(B=(0,c.jsxs)(n.View,{style:k,testID:j,accessibilityRole:"alert",children:[H,q]}),h[33]=k,h[34]=q,h[35]=H,h[36]=j,h[37]=B):B=h[37];return B};var n=r(d[0]),o=r(d[1]),t=r(d[2]),l=r(d[3]);r(d[4]),r(d[5]),r(d[6]);var s=r(d[7]),c=r(d[8]);const u={info:l.Info,success:l.CheckCircle2,warning:l.AlertTriangle,error:l.XCircle};function p(n,o){return"info"===n?o.colors.palette.blue[300]:"success"===n?o.colors.palette.green[400]:"warning"===n?o.colors.palette.amber[500]:"error"===n?o.colors.destructive:null}const f=s.StyleSheet.create(n=>({container:{flexDirection:"row",alignItems:"flex-start",gap:n.spacing[3],borderWidth:n.borderWidth[1],borderColor:n.colors.border,backgroundColor:"transparent",borderRadius:n.borderRadius.xl,paddingVertical:n.spacing[3],paddingHorizontal:n.spacing[4],uni__dependencies:[0]},iconSlot:{paddingTop:2},body:{flex:1,minWidth:0,gap:n.spacing[1],uni__dependencies:[0]},title:{color:n.colors.foreground,fontSize:n.fontSize.sm,fontWeight:n.fontWeight.medium,uni__dependencies:[0]},description:{color:n.colors.foregroundMuted,fontSize:n.fontSize.xs,uni__dependencies:[0]},descriptionSlot:{flexShrink:1,minWidth:0,gap:n.spacing[2],uni__dependencies:[0]},actions:{flexDirection:"row",gap:n.spacing[2],marginTop:n.spacing[2],uni__dependencies:[0]}}))},4755,[348,711,349,1600,36,234,146,56,279]);
|
|
16515
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.ProviderUsageList=function(n){const o=(0,s.c)(4),{providers:l}=n;let _,h;o[0]!==l?(_=l.map(v),o[0]=l,o[1]=_):_=o[1];o[2]!==_?(h=(0,u.jsx)(t.View,{style:c.settingsStyles.card,children:_}),o[2]=_,o[3]=h):h=o[3];return h};var t=r(d[0]),s=r(d[1]),n=r(d[2]);r(d[3]);var o=r(d[4]),c=r(d[5]),l=r(d[6]),u=r(d[7]);function v(s,o){return(0,u.jsxs)(n.Fragment,{children:[o>0?(0,u.jsx)(t.View,{style:_.divider}):null,(0,u.jsx)(l.ProviderUsageCard,{usage:s})]},s.providerId)}const _=o.StyleSheet.create(t=>({divider:{height:1,backgroundColor:t.colors.border,uni__dependencies:[0]}}))},4756,[348,349,36,146,56,3907,3965,279]);
|
|
16516
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.formatLatency=function(t){if(t<1)return`${Math.round(1e3*t)}\xb5s`;if(t<1e3)return`${Math.round(t)}ms`;const n=t/1e3,u=Math.round(10*n)/10;return Number.isInteger(u)?`${u}s`:`${u.toFixed(1)}s`}},4757,[]);
|
|
16517
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.BrowserToolsOptInCard=function(b){const y=(0,n.c)(31),{serverId:S}=b,{t:f}=(0,l.useTranslation)(),j=(0,u.useHostRuntimeIsConnected)(S),{config:D,patchConfig:p}=(0,w.useDaemonConfig)(S);let C;y[0]!==D||y[1]!==j?(C=(0,x.getBrowserToolsCardState)({isConnected:j,config:D}),y[0]=D,y[1]=j,y[2]=C):C=y[2];const I=C;let E;y[3]!==p||y[4]!==f?(E={mutationFn:async t=>{const s=await p((0,x.createBrowserToolsPatch)(t));if(!s)throw new Error(f("workspace.terminal.hostDisconnected"));return s}},y[3]=p,y[4]=f,y[5]=E):E=y[5];const P=(0,o.useMutation)(E);let V;y[6]!==P.error||y[7]!==P.isPending?(V=(0,x.getBrowserToolsMutationViewState)({isPending:P.isPending,error:P.error}),y[6]=P.error,y[7]=P.isPending,y[8]=V):V=y[8];const v=V;let B;y[9]!==P?(B=t=>{P.mutate(t)},y[9]=P,y[10]=B):B=y[10];const _=B;if(!I.isVisible)return null;let H,M,O,k,F,L,R;y[11]!==I.title?(H=(0,T.jsx)(s.Text,{style:h.settingsStyles.rowTitle,children:I.title}),y[11]=I.title,y[12]=H):H=y[12];y[13]!==I.warning?(M=(0,T.jsx)(s.Text,{style:h.settingsStyles.rowHint,children:I.warning}),y[13]=I.warning,y[14]=M):M=y[14];y[15]!==v.loadingText?(O=v.loadingText?(0,T.jsx)(s.Text,{style:h.settingsStyles.rowHint,testID:"host-page-browser-tools-loading",children:v.loadingText}):null,y[15]=v.loadingText,y[16]=O):O=y[16];y[17]!==v.errorText?(k=v.errorText?(0,T.jsx)(s.Text,{style:h.settingsStyles.rowError,testID:"host-page-browser-tools-error",children:v.errorText}):null,y[17]=v.errorText,y[18]=k):k=y[18];y[19]!==H||y[20]!==M||y[21]!==O||y[22]!==k?(F=(0,T.jsxs)(t.View,{style:h.settingsStyles.rowContent,children:[H,M,O,k]}),y[19]=H,y[20]=M,y[21]=O,y[22]=k,y[23]=F):F=y[23];y[24]!==_||y[25]!==v.isSwitchDisabled||y[26]!==I.isEnabled?(L=(0,T.jsx)(c.Switch,{value:I.isEnabled,onValueChange:_,disabled:v.isSwitchDisabled,accessibilityLabel:"Enable browser tools",testID:"host-page-browser-tools-switch"}),y[24]=_,y[25]=v.isSwitchDisabled,y[26]=I.isEnabled,y[27]=L):L=y[27];y[28]!==L||y[29]!==F?(R=(0,T.jsx)(t.View,{style:h.settingsStyles.card,testID:"host-page-browser-tools-card",children:(0,T.jsxs)(t.View,{style:h.settingsStyles.row,children:[F,L]})}),y[28]=L,y[29]=F,y[30]=R):R=y[30];return R};var t=r(d[0]),s=r(d[1]),n=r(d[2]);r(d[3]),r(d[4]),r(d[5]);var o=r(d[6]),l=r(d[7]),c=r(d[8]),w=r(d[9]),u=r(d[10]),h=r(d[11]),x=r(d[12]),T=r(d[13])},4758,[348,711,349,36,234,146,916,1573,4731,3903,3271,3907,4759,279]);
|
|
16518
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"BROWSER_TOOLS_TITLE",{enumerable:!0,get:function(){return t}}),Object.defineProperty(e,"BROWSER_TOOLS_WARNING",{enumerable:!0,get:function(){return n}}),e.getBrowserToolsCardState=function(o){return{isVisible:o.isConnected,isEnabled:!0===o.config?.browserTools.enabled,title:t,warning:n}},e.createBrowserToolsPatch=function(t){return{browserTools:{enabled:t}}},e.getBrowserToolsMutationViewState=function(t){return{isSwitchDisabled:t.isPending,loadingText:t.isPending?"Updating browser tools\u2026":null,errorText:t.error?(n=t.error,n instanceof Error?n.message:String(n)):null};var n};const t="Browser tools",n="Allow agents to access and control Paseo browser tabs, including logged-in browser state. Only enable this for agents you trust."},4759,[]);
|
|
16519
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return w}});var t=r(d[0]),o=r(d[1]),n=r(d[2]),s=r(d[3]);r(d[4]),r(d[5]),r(d[6]),r(d[7]);var c=r(d[8]),l=r(d[9]),u=r(d[10]),p=r(d[11]),j=r(d[12]),y=r(d[13]),f=r(d[14]),h=r(d[15]),x=r(d[16]),_=r(d[17]),b=r(d[18]);function w(n){const c=(0,s.c)(23),{view:l}=n,{t:u}=(0,p.useTranslation)(),{projects:j,hostErrors:_,isLoading:w}=(0,f.useProjects)(),D="project"===l.kind?l.projectKey:null;let P;c[0]!==j?(P=j.flatMap(S),c[0]=j,c[1]=P):P=c[1];const z=P;let C;c[2]!==z?(C={projects:z},c[2]=z,c[3]=C):C=c[3];const K=(0,h.useProjectIconDataByProjectKey)(C);if(w&&0===j.length){let o;return c[4]===Symbol.for("react.memo_cache_sentinel")?(o=(0,b.jsx)(t.View,{style:T.centered,testID:"projects-list",children:(0,b.jsx)(y.LoadingSpinner,{size:"large",color:T.spinnerColor.color})}),c[4]=o):o=c[4],o}if(0===j.length){let n,s;return c[5]!==u?(n=u("sidebar.project.empty.title"),c[5]=u,c[6]=n):n=c[6],c[7]!==n?(s=(0,b.jsx)(t.View,{style:T.centered,testID:"projects-list",children:(0,b.jsx)(o.Text,{style:T.emptyText,children:n})}),c[7]=n,c[8]=s):s=c[8],s}let k,R,M,V;if(c[9]!==_?(k=_.length>0?(0,b.jsx)(I,{errors:_}):null,c[9]=_,c[10]=k):k=c[10],c[11]!==K||c[12]!==j||c[13]!==D){let t;c[15]!==K||c[16]!==D?(t=(t,o)=>(0,b.jsx)(v,{project:t,isFirst:0===o,isSelected:D===t.projectKey,iconDataUri:K.get(t.projectKey)??null},t.projectKey),c[15]=K,c[16]=D,c[17]=t):t=c[17],R=j.map(t),c[11]=K,c[12]=j,c[13]=D,c[14]=R}else R=c[14];return c[18]!==R?(M=(0,b.jsx)(t.View,{style:x.settingsStyles.card,children:R}),c[18]=R,c[19]=M):M=c[19],c[20]!==k||c[21]!==M?(V=(0,b.jsxs)(t.View,{testID:"projects-list",children:[k,M]}),c[20]=k,c[21]=M,c[22]=V):V=c[22],V}function S(t){const o=t.hosts[0];return o?[{serverId:o.serverId,projectKey:t.projectKey,iconWorkingDir:o.repoRoot}]:[]}function I(n){const c=(0,s.c)(7),{errors:l}=n,{t:u}=(0,p.useTranslation)();let j,y;if(c[0]!==l||c[1]!==u){let t;c[3]!==u?(t=t=>(0,b.jsx)(o.Text,{style:T.errorsBannerText,children:u("settings.projectList.hostLoadFailed",{hostName:t.serverName,message:t.message})},t.serverId),c[3]=u,c[4]=t):t=c[4],j=l.map(t),c[0]=l,c[1]=u,c[2]=j}else j=c[2];return c[5]!==j?(y=(0,b.jsx)(t.View,{style:T.errorsBanner,testID:"projects-host-errors",children:j}),c[5]=j,c[6]=y):y=c[6],y}function v(j){const y=(0,s.c)(28),{project:f,isFirst:h,isSelected:w,iconDataUri:S}=j,{t:I}=(0,p.useTranslation)(),{theme:v}=(0,l.useUnistyles)(),{projectKey:P,projectName:z}=f;let C;y[0]!==P?(C=()=>{c.router.navigate((0,_.buildProjectSettingsRoute)(P))},y[0]=P,y[1]=C):C=y[1];const K=C;let k;y[2]!==h||y[3]!==w?(k=t=>{const{pressed:o,hovered:n}=t;return[x.settingsStyles.row,!h&&x.settingsStyles.rowBorder,T.row,w&&T.rowSelected,n&&!w&&T.rowHovered,o&&T.rowPressed]},y[2]=h,y[3]=w,y[4]=k):k=y[4];const R=k;let M;y[5]!==z||y[6]!==I?(M=I("settings.projectList.editProject",{projectName:z}),y[5]=z,y[6]=I,y[7]=M):M=y[7];const V=`project-row-${P}`,B=w?"true":"false";let F,L,U,N,H;return y[8]!==S||y[9]!==P||y[10]!==z?(F=(0,b.jsx)(t.View,{style:T.leading,children:(0,b.jsx)(D,{iconDataUri:S,projectName:z,projectKey:P})}),y[8]=S,y[9]=P,y[10]=z,y[11]=F):F=y[11],y[12]!==z?(L=(0,b.jsx)(o.Text,{style:x.settingsStyles.rowTitle,numberOfLines:1,children:z}),y[12]=z,y[13]=L):L=y[13],y[14]!==F||y[15]!==L?(U=(0,b.jsxs)(t.View,{style:T.rowMain,children:[F,L]}),y[14]=F,y[15]=L,y[16]=U):U=y[16],y[17]!==v.colors.foregroundMuted||y[18]!==v.iconSize.sm?(N=(0,b.jsx)(u.ChevronRight,{size:v.iconSize.sm,color:v.colors.foregroundMuted}),y[17]=v.colors.foregroundMuted,y[18]=v.iconSize.sm,y[19]=N):N=y[19],y[20]!==K||y[21]!==R||y[22]!==M||y[23]!==V||y[24]!==B||y[25]!==U||y[26]!==N?(H=(0,b.jsxs)(n.Pressable,{style:R,onPress:K,accessibilityRole:"button",accessibilityLabel:M,testID:V,"data-selected":B,children:[U,N]}),y[20]=K,y[21]=R,y[22]=M,y[23]=V,y[24]=B,y[25]=U,y[26]=N,y[27]=H):H=y[27],H}function D(t){const o=(0,s.c)(6),{iconDataUri:n,projectName:c,projectKey:l}=t;let u;o[0]!==c?(u=c.trim().charAt(0).toUpperCase()||"?",o[0]=c,o[1]=u):u=o[1];const p=u;let y;return o[2]!==n||o[3]!==p||o[4]!==l?(y=(0,b.jsx)(j.ProjectIconView,{iconDataUri:n,initial:p,projectKey:l,imageStyle:T.iconImage,fallbackStyle:T.iconFallback,textStyle:T.iconFallbackText}),o[2]=n,o[3]=p,o[4]=l,o[5]=y):y=o[5],y}const T=l.StyleSheet.create(t=>({centered:{flex:1,alignItems:"center",justifyContent:"center",padding:t.spacing[6],uni__dependencies:[0]},emptyText:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,uni__dependencies:[0]},errorsBanner:{borderWidth:1,borderColor:t.colors.border,borderRadius:t.borderRadius.lg,padding:t.spacing[3],marginBottom:t.spacing[3],gap:t.spacing[1],uni__dependencies:[0]},errorsBannerText:{color:t.colors.palette.red[300],fontSize:t.fontSize.xs,uni__dependencies:[0]},row:{gap:t.spacing[3],uni__dependencies:[0]},rowMain:{flex:1,minWidth:0,flexDirection:"row",alignItems:"center",gap:t.spacing[3],uni__dependencies:[0]},rowHovered:{backgroundColor:t.colors.surface2,uni__dependencies:[0]},rowPressed:{backgroundColor:t.colors.surface3,uni__dependencies:[0]},rowSelected:{backgroundColor:t.colors.surfaceSidebarHover,uni__dependencies:[0]},leading:{width:16,height:16,alignItems:"center",justifyContent:"center"},iconImage:{width:16,height:16,borderRadius:t.borderRadius.sm,uni__dependencies:[0]},iconFallback:{width:16,height:16,borderRadius:t.borderRadius.sm,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},iconFallbackText:{fontSize:t.fontSize.xs,uni__dependencies:[0]},spinnerColor:{color:t.colors.foregroundMuted,uni__dependencies:[0]}}))},4760,[348,711,1572,349,36,1308,234,146,1143,56,1600,1573,3624,3564,3895,3670,3907,3477,279]);
|
|
16520
|
+
__d(function(g,r,i,a,m,e,_d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return W}});var t=r(_d[0]),s=r(_d[1]),o=r(_d[2]),n=r(_d[3]),c=r(_d[4]),l=r(_d[5]),d=r(_d[6]);r(_d[7]),r(_d[8]),r(_d[9]),r(_d[10]);var p=r(_d[11]),u=r(_d[12]),j=r(_d[13]),h=r(_d[14]),f=r(_d[15]),x=r(_d[16]),y=r(_d[17]),b=r(_d[18]),_=r(_d[19]),I=r(_d[20]),S=r(_d[21]),T=r(_d[22]),v=r(_d[23]),w=r(_d[24]),D=r(_d[25]),C=r(_d[26]),R=r(_d[27]),k=r(_d[28]),P=r(_d[29]),z=r(_d[30]),E=r(_d[31]),H=r(_d[32]),K=r(_d[33]),M=r(_d[34]),L=r(_d[35]);const N="service",V=14,B={branchName:{titleKey:"settings.project.metadata.branchName",placeholderKey:"settings.project.metadata.branchNamePlaceholder",sectionTestID:"metadata-prompt-branch-name-section",inputTestID:"metadata-prompt-branch-name-input"},commitMessage:{titleKey:"settings.project.metadata.commitMessage",placeholderKey:"settings.project.metadata.commitMessagePlaceholder",sectionTestID:"metadata-prompt-commit-message-section",inputTestID:"metadata-prompt-commit-message-input"},pullRequest:{titleKey:"settings.project.metadata.pullRequest",placeholderKey:"settings.project.metadata.pullRequestPlaceholder",sectionTestID:"metadata-prompt-pull-request-section",inputTestID:"metadata-prompt-pull-request-input"}},F="https://paseo.sh/docs/worktrees";function W(t){const s=(0,c.c)(25),{projectKey:o}=t,{projects:n}=(0,k.useProjects)();let d;if(s[0]!==o||s[1]!==n){let t;s[3]!==o?(t=t=>t.projectKey===o,s[3]=o,s[4]=t):t=s[4],d=n.find(t),s[0]=o,s[1]=n,s[2]=d}else d=s[2];const p=d;let u;s[5]!==p?(u=O(p),s[5]=p,s[6]=u):u=s[6];const j=u;let h;s[7]!==j[0]?.serverId?(h=()=>j[0]?.serverId??"",s[7]=j[0]?.serverId,s[8]=h):h=s[8];const[f,x]=(0,l.useState)(h);let y,b;s[9]!==j||s[10]!==f?(y=()=>{j.some(t=>t.serverId===f)||x(j[0]?.serverId??"")},b=[j,f],s[9]=j,s[10]=f,s[11]=y,s[12]=b):(y=s[11],b=s[12]),(0,l.useEffect)(y,b);const _=(0,z.useHostRuntimeSnapshot)(f),I=Boolean(f)&&("offline"===_?.connectionStatus||"error"===_?.connectionStatus);let S;if(s[13]!==j||s[14]!==f){let t;s[16]!==f?(t=t=>t.serverId===f,s[16]=f,s[17]=t):t=s[17],S=j.find(t),s[13]=j,s[14]=f,s[15]=S}else S=s[15];const T=S,v=(0,z.useHostRuntimeClient)(T?.serverId??"");if(!p||0===j.length||!T||!v){let t;return s[18]===Symbol.for("react.memo_cache_sentinel")?(t=(0,L.jsx)(q,{}),s[18]=t):t=s[18],t}let w;return s[19]!==v||s[20]!==j||s[21]!==I||s[22]!==p||s[23]!==T?(w=(0,L.jsx)(Q,{project:p,hosts:j,selectedHost:T,onSelectHost:x,client:v,isHostGone:I}),s[19]=v,s[20]=j,s[21]=I,s[22]=p,s[23]=T,s[24]=w):w=s[24],w}function O(t){return t?t.hosts.filter(t=>t.isOnline&&t.serverId.trim().length>0&&t.repoRoot.trim().length>0):[]}function A(){p.router.navigate((0,M.buildProjectsSettingsRoute)())}function q(){const s=(0,c.c)(12),{t:n}=(0,d.useTranslation)();let l,p,u,j,h,f;return s[0]===Symbol.for("react.memo_cache_sentinel")?(l=(0,L.jsx)($,{}),s[0]=l):l=s[0],s[1]!==n?(p=n("settings.project.noEditableTarget"),s[1]=n,s[2]=p):p=s[2],s[3]!==p?(u=(0,L.jsx)(o.Text,{style:ge.noTargetText,children:p}),s[3]=p,s[4]=u):u=s[4],s[5]!==n?(j=n("settings.project.backToProjects"),s[5]=n,s[6]=j):j=s[6],s[7]!==j?(h=(0,L.jsx)(y.Button,{testID:"project-settings-back-button",onPress:A,variant:"secondary",size:"md",children:j}),s[7]=j,s[8]=h):h=s[8],s[9]!==u||s[10]!==h?(f=(0,L.jsxs)(t.View,{style:ge.noTargetContainer,children:[l,u,h]}),s[9]=u,s[10]=h,s[11]=f):f=s[11],f}function $(){const t=(0,c.c)(7),{t:s}=(0,d.useTranslation)();let o,n,l;return t[0]!==s?(o=s("settings.project.backToProjects"),t[0]=s,t[1]=o):o=t[1],t[2]!==s?(n=s("settings.project.backToProjects"),t[2]=s,t[3]=n):n=t[3],t[4]!==o||t[5]!==n?(l=(0,L.jsx)(y.Button,{testID:"project-settings-back-link",accessibilityLabel:o,onPress:A,variant:"ghost",size:"sm",leftIcon:h.ArrowLeft,style:ge.backButton,children:n}),t[4]=o,t[5]=n,t[6]=l):l=t[6],l}function Q(s){const o=(0,c.c)(49),{project:n,hosts:l,selectedHost:d,onSelectHost:p,client:u,isHostGone:h}=s;let f;o[0]!==d.repoRoot||o[1]!==d.serverId?(f=["project-config",d.serverId,d.repoRoot],o[0]=d.repoRoot,o[1]=d.serverId,o[2]=f):f=o[2];const x=f;let y,b;o[3]!==u||o[4]!==d.repoRoot?(y=()=>u.readProjectConfig(d.repoRoot),o[3]=u,o[4]=d.repoRoot,o[5]=y):y=o[5],o[6]!==x||o[7]!==y?(b={queryKey:x,queryFn:y,retry:!1},o[6]=x,o[7]=y,o[8]=b):b=o[8];const _=(0,j.useQuery)(b),I=_.data;let S;o[9]!==n.projectKey||o[10]!==d.repoRoot||o[11]!==d.serverId?(S=[{serverId:d.serverId,projectKey:n.projectKey,iconWorkingDir:d.repoRoot}],o[9]=n.projectKey,o[10]=d.repoRoot,o[11]=d.serverId,o[12]=S):S=o[12];const T=S;let v;o[13]!==T?(v={projects:T},o[13]=T,o[14]=v):v=o[14];const w=(0,P.useProjectIconDataByProjectKey)(v);let D;o[15]!==n.projectKey||o[16]!==w?(D=w.get(n.projectKey)??null,o[15]=n.projectKey,o[16]=w,o[17]=D):D=o[17];const C=D;let R;if(o[18]!==u||o[19]!==I||o[20]!==l||o[21]!==h||o[22]!==p||o[23]!==n||o[24]!==C||o[25]!==x||o[26]!==_||o[27]!==d){const s=I?.ok?I.config??{}:null,c=I?.ok?I.revision:null,j=I&&!I.ok?I.error:null;let f;o[29]!==_?(f=()=>{_.refetch()},o[29]=_,o[30]=f):f=o[30];const y=f,b=l.length>1;let S,T,v,w,D,k;o[31]===Symbol.for("react.memo_cache_sentinel")?(S=(0,L.jsx)($,{}),o[31]=S):S=o[31],o[32]!==n.projectKey||o[33]!==n.projectName||o[34]!==C?(T=(0,L.jsx)(se,{iconDataUri:C,projectName:n.projectName,projectKey:n.projectKey}),o[32]=n.projectKey,o[33]=n.projectName,o[34]=C,o[35]=T):T=o[35],o[36]!==u||o[37]!==n?(v=(0,L.jsx)(te,{project:n,client:u}),o[36]=u,o[37]=n,o[38]=v):v=o[38],o[39]!==T||o[40]!==v?(w=(0,L.jsxs)(t.View,{style:ge.titleRow,children:[T,v]}),o[39]=T,o[40]=v,o[41]=w):w=o[41],o[42]!==l||o[43]!==p||o[44]!==d?(D=(0,L.jsx)(oe,{hosts:l,selectedHost:d,onSelectHost:p}),o[42]=l,o[43]=p,o[44]=d,o[45]=D):D=o[45],o[46]!==w||o[47]!==D?(k=(0,L.jsxs)(t.View,{style:ge.headerBlock,children:[w,D]}),o[46]=w,o[47]=D,o[48]=k):k=o[48],R=(0,L.jsxs)(t.View,{style:ge.body,children:[S,k,G({readQuery:_,loadedConfig:s,loadedRevision:c,readError:j,selectedHost:d,queryKey:x,client:u,onReload:y,hasMultipleHosts:b,isHostGone:h})]}),o[18]=u,o[19]=I,o[20]=l,o[21]=h,o[22]=p,o[23]=n,o[24]=C,o[25]=x,o[26]=_,o[27]=d,o[28]=R}else R=o[28];return R}function G({readQuery:s,loadedConfig:o,loadedRevision:n,readError:c,selectedHost:l,queryKey:d,client:p,onReload:u,hasMultipleHosts:j,isHostGone:h}){if(s.isLoading)return(0,L.jsx)(t.View,{style:ge.centered,children:(0,L.jsx)(S.LoadingSpinner,{color:ee()})});if(s.isError)return(0,L.jsx)(Y,{kind:"transport",error:s.error,onReload:u,hasMultipleHosts:j});if(c)return(0,L.jsx)(Y,{kind:c.code,error:null,onReload:u,hasMultipleHosts:j});if(h)return(0,L.jsx)(q,{});if(!o)return(0,L.jsx)(t.View,{style:ge.centered,children:(0,L.jsx)(S.LoadingSpinner,{color:ee()})});const f=`${l.serverId}::${l.repoRoot}::${U(n)}`;return(0,L.jsx)(Z,{baseConfig:o,revision:n,repoRoot:l.repoRoot,queryKey:d,client:p,onReload:u},f)}function U(t){return t?`${t.mtimeMs}-${t.size}`:"none"}function Y(s){const o=(0,c.c)(16),{kind:n,error:l,onReload:p,hasMultipleHosts:u}=s,{t:j}=(0,d.useTranslation)();let h;o[0]!==l||o[1]!==u||o[2]!==n||o[3]!==j?(h=X({kind:n,error:l,hasMultipleHosts:u,t:j}),o[0]=l,o[1]=u,o[2]=n,o[3]=j,o[4]=h):h=o[4];const{testID:f,title:x,description:b}=h,I=`${f}-action-0`;let S,T,v;return o[5]!==j?(S=j("settings.project.actions.reload"),o[5]=j,o[6]=S):S=o[6],o[7]!==p||o[8]!==I||o[9]!==S?(T=(0,L.jsx)(y.Button,{testID:I,onPress:p,variant:"outline",size:"sm",children:S}),o[7]=p,o[8]=I,o[9]=S,o[10]=T):T=o[10],o[11]!==b||o[12]!==T||o[13]!==f||o[14]!==x?(v=(0,L.jsx)(t.View,{style:ge.errorBlock,children:(0,L.jsx)(_.Alert,{testID:f,variant:"error",title:x,description:b,children:T})}),o[11]=b,o[12]=T,o[13]=f,o[14]=x,o[15]=v):v=o[15],v}function X(t){if("invalid_project_config"===t.kind)return{testID:"invalid-callout",title:t.t("settings.project.readFailures.invalidTitle"),description:t.t("settings.project.readFailures.invalidDescription")};if("project_not_found"===t.kind)return{testID:"project-not-found-callout",title:t.t("settings.project.readFailures.missingTitle"),description:t.hasMultipleHosts?t.t("settings.project.readFailures.missingWithHosts"):t.t("settings.project.readFailures.missingSingleHost")};if("transport"===t.kind){const s=J(t.error);return{testID:"read-transport-callout",title:t.t("settings.project.readFailures.transportTitle"),description:s??t.t("settings.project.readFailures.transportFallback")}}return{testID:"read-failed-callout",title:t.t("settings.project.readFailures.failedTitle"),description:t.t("settings.project.readFailures.failedDescription")}}function J(t){return t instanceof Error&&t.message.length>0?t.message:"string"==typeof t&&t.length>0?t:null}function Z(s){const p=(0,c.c)(150),{baseConfig:u,revision:f,repoRoot:x,queryKey:b,client:S,onReload:T}=s,{t:v}=(0,d.useTranslation)(),k=(0,j.useQueryClient)(),P=(0,E.useToast)();let z;p[0]!==u?(z=()=>(0,K.configToDraft)(u),p[0]=u,p[1]=z):z=p[1];const[M,N]=(0,l.useState)(z),[B,W]=(0,l.useState)(null),[O,A]=(0,l.useState)(null);let q,$,Q;p[2]!==S||p[3]!==x?(q=async t=>S.writeProjectConfig({repoRoot:x,config:t.config,expectedRevision:t.expectedRevision}),p[2]=S,p[3]=x,p[4]=q):q=p[4],p[5]!==k||p[6]!==b||p[7]!==x||p[8]!==v||p[9]!==P?($=t=>{if(t.ok){const s={ok:!0,config:t.config,revision:t.revision,requestId:"local-cache",repoRoot:x};k.setQueryData(b,s),W(null),k.invalidateQueries({queryKey:["projects"]}),P.show(v("settings.project.actions.saved"),{variant:"success"})}else W(t.error)},p[5]=k,p[6]=b,p[7]=x,p[8]=v,p[9]=P,p[10]=$):$=p[10],p[11]!==q||p[12]!==$?(Q={mutationFn:q,onSuccess:$},p[11]=q,p[12]=$,p[13]=Q):Q=p[13];const G=(0,j.useMutation)(Q);let U;p[14]!==u||p[15]!==M||p[16]!==f||p[17]!==G||p[18]!==B?.code?(U=()=>{if("stale_project_config"===B?.code)return;const t=(0,K.applyDraftToConfig)({draft:M,base:u});G.mutate({config:t,expectedRevision:f})},p[14]=u,p[15]=M,p[16]=f,p[17]=G,p[18]=B?.code,p[19]=U):U=p[19];const Y=U;let X;p[20]!==T?(X=()=>{W(null),T()},p[20]=T,p[21]=X):X=p[21];const J=X;let Z;p[22]===Symbol.for("react.memo_cache_sentinel")?(Z=t=>{N(s=>t(s))},p[22]=Z):Z=p[22];const ee=Z;let te;p[23]===Symbol.for("react.memo_cache_sentinel")?(te=t=>ee(s=>Object.assign({},s,{setupText:t})),p[23]=te):te=p[23];const se=te;let oe;p[24]===Symbol.for("react.memo_cache_sentinel")?(oe=t=>ee(s=>Object.assign({},s,{teardownText:t})),p[24]=oe):oe=p[24];const ne=oe;let re;p[25]===Symbol.for("react.memo_cache_sentinel")?(re=(t,s)=>ee(o=>Object.assign({},o,{metadataPrompts:Object.assign({},o.metadataPrompts,{[t]:s})})),p[25]=re):re=p[25];const ie=re;let ae;p[26]!==v?(ae=async t=>{await(0,H.confirmDialog)({title:v("settings.project.scripts.removeTitle"),message:v("settings.project.scripts.removeMessage",{name:t.name||v("settings.project.scripts.removeFallbackName")}),confirmLabel:v("settings.project.scripts.actions.remove"),cancelLabel:v("settings.project.actions.cancel"),destructive:!0})&&ee(s=>Object.assign({},s,{scripts:s.scripts.filter(s=>s.id!==t.id)}))},p[26]=v,p[27]=ae):ae=p[27];const pe=ae;let ue;p[28]===Symbol.for("react.memo_cache_sentinel")?(ue=t=>{A(t.id)},p[28]=ue):ue=p[28];const je=ue;let he;p[29]===Symbol.for("react.memo_cache_sentinel")?(he=()=>{const t=`script-draft-new-${Date.now()}`;ee(s=>Object.assign({},s,{scripts:[...s.scripts,{id:t,name:"",commandText:"",commandOriginalKind:"missing",type:"",portText:"",rawEntry:{}}]})),A(t)},p[29]=he):he=p[29];const fe=he;let xe;p[30]===Symbol.for("react.memo_cache_sentinel")?(xe=t=>{ee(s=>Object.assign({},s,{scripts:s.scripts.map(s=>s.id===t.id?t:s)}))},p[30]=xe):xe=p[30];const ye=xe;let be;p[31]!==O?(be=()=>{O&&(ee(t=>{const s=t.scripts.find(t=>t.id===O);if(!s)return t;return 0===s.name.trim().length&&0===s.commandText.trim().length&&0===s.type.trim().length&&0===s.portText.trim().length?Object.assign({},t,{scripts:t.scripts.filter(t=>t.id!==O)}):t}),A(null))},p[31]=O,p[32]=be):be=p[32];const _e=be;let Ie;p[33]===Symbol.for("react.memo_cache_sentinel")?(Ie=()=>{A(null)},p[33]=Ie):Ie=p[33];const Se=Ie;let Te;if(p[34]!==M.scripts||p[35]!==O){let t;p[37]!==O?(t=t=>t.id===O,p[37]=O,p[38]=t):t=p[38],Te=M.scripts.find(t),p[34]=M.scripts,p[35]=O,p[36]=Te}else Te=p[36];const ve=Te;let we;if(p[39]!==M.scripts||p[40]!==v){let t;p[42]!==v?(t=t=>de(t,v).hasErrors,p[42]=v,p[43]=t):t=p[43],we=M.scripts.some(t),p[39]=M.scripts,p[40]=v,p[41]=we}else we=p[41];const De=we;let Ce,Re,ke;p[44]!==v?(Ce=v("settings.project.scripts.actions.add"),p[44]=v,p[45]=Ce):Ce=p[45],p[46]===Symbol.for("react.memo_cache_sentinel")?(Re=(0,L.jsx)(h.Plus,{size:V,color:ge.iconColor.color}),p[46]=Re):Re=p[46],p[47]!==Ce?(ke=(0,L.jsx)(n.Pressable,{onPress:fe,hitSlop:8,style:R.settingsStyles.sectionHeaderLink,accessibilityRole:"button",accessibilityLabel:Ce,testID:"scripts-add-button",children:Re}),p[47]=Ce,p[48]=ke):ke=p[48];const Pe=ke;let ze,Ee,He;p[49]!==v?(ze=v("settings.project.worktree.docs"),p[49]=v,p[50]=ze):ze=p[50],p[51]!==v?(Ee=v("settings.project.worktree.docsTooltip"),p[51]=v,p[52]=Ee):Ee=p[52],p[53]!==ze||p[54]!==Ee?(He=(0,L.jsx)(I.ExternalLink,{href:F,label:ze,tooltip:Ee,testID:"worktree-setup-docs-link"}),p[53]=ze,p[54]=Ee,p[55]=He):He=p[55];const Ke=He;let Me,Le,Ne;p[56]!==v?(Me=v("settings.project.worktree.docs"),p[56]=v,p[57]=Me):Me=p[57],p[58]!==v?(Le=v("settings.project.worktree.docsTooltip"),p[58]=v,p[59]=Le):Le=p[59],p[60]!==Me||p[61]!==Le?(Ne=(0,L.jsx)(I.ExternalLink,{href:F,label:Me,tooltip:Le,testID:"worktree-teardown-docs-link"}),p[60]=Me,p[61]=Le,p[62]=Ne):Ne=p[62];const Ve=Ne,Be="stale_project_config"===B?.code,Fe="write_failed"===B?.code,We=G.isPending||Be||De;let Oe,Ae,qe,$e,Qe,Ge,Ue,Ye,Xe,Je,Ze,et,tt,st,ot,nt,rt,it,ct,lt,at,dt,pt,ut,mt,gt,jt;return p[63]!==v?(Oe=v("settings.project.worktree.title"),p[63]=v,p[64]=Oe):Oe=p[64],p[65]!==v?(Ae=v("settings.project.worktree.info"),p[65]=v,p[66]=Ae):Ae=p[66],p[67]!==v?(qe=v("settings.project.worktree.setup"),p[67]=v,p[68]=qe):qe=p[68],p[69]!==v?($e=v("settings.project.worktree.setupAccessibility"),p[69]=v,p[70]=$e):$e=p[70],p[71]!==M.setupText||p[72]!==$e?(Qe=(0,L.jsx)(w.SettingsTextAreaCard,{testID:"worktree-setup-input",accessibilityLabel:$e,value:M.setupText,onChangeText:se,placeholder:"npm install"}),p[71]=M.setupText,p[72]=$e,p[73]=Qe):Qe=p[73],p[74]!==Ke||p[75]!==qe||p[76]!==Qe?(Ge=(0,L.jsx)(C.SettingsSection,{title:qe,testID:"worktree-setup-section",trailing:Ke,children:Qe}),p[74]=Ke,p[75]=qe,p[76]=Qe,p[77]=Ge):Ge=p[77],p[78]!==v?(Ue=v("settings.project.worktree.teardown"),p[78]=v,p[79]=Ue):Ue=p[79],p[80]!==v?(Ye=v("settings.project.worktree.teardownAccessibility"),p[80]=v,p[81]=Ye):Ye=p[81],p[82]!==M.teardownText||p[83]!==Ye?(Xe=(0,L.jsx)(w.SettingsTextAreaCard,{testID:"worktree-teardown-input",accessibilityLabel:Ye,value:M.teardownText,onChangeText:ne,placeholder:"docker compose down"}),p[82]=M.teardownText,p[83]=Ye,p[84]=Xe):Xe=p[84],p[85]!==Ue||p[86]!==Xe||p[87]!==Ve?(Je=(0,L.jsx)(C.SettingsSection,{title:Ue,testID:"worktree-teardown-section",trailing:Ve,flush:!0,children:Xe}),p[85]=Ue,p[86]=Xe,p[87]=Ve,p[88]=Je):Je=p[88],p[89]!==Oe||p[90]!==Ae||p[91]!==Ge||p[92]!==Je?(Ze=(0,L.jsxs)(D.SettingsGroup,{title:Oe,info:Ae,testID:"worktree-group",children:[Ge,Je]}),p[89]=Oe,p[90]=Ae,p[91]=Ge,p[92]=Je,p[93]=Ze):Ze=p[93],p[94]!==v?(et=v("settings.project.scripts.title"),p[94]=v,p[95]=et):et=p[95],p[96]!==v?(tt=v("settings.project.scripts.info"),p[96]=v,p[97]=tt):tt=p[97],p[98]!==M.scripts||p[99]!==pe||p[100]!==v?(st=0===M.scripts.length?(0,L.jsx)(t.View,{style:R.settingsStyles.row,children:(0,L.jsx)(o.Text,{style:ge.emptyScripts,children:v("settings.project.scripts.empty")})}):M.scripts.map((t,s)=>(0,L.jsx)(le,{script:t,isFirst:0===s,onEdit:je,onRemove:pe},t.id)),p[98]=M.scripts,p[99]=pe,p[100]=v,p[101]=st):st=p[101],p[102]!==st?(ot=(0,L.jsx)(t.View,{style:R.settingsStyles.card,testID:"scripts-list",children:st}),p[102]=st,p[103]=ot):ot=p[103],p[104]!==Pe||p[105]!==et||p[106]!==tt||p[107]!==ot?(nt=(0,L.jsx)(D.SettingsGroup,{title:et,info:tt,trailing:Pe,testID:"scripts-group",children:ot}),p[104]=Pe,p[105]=et,p[106]=tt,p[107]=ot,p[108]=nt):nt=p[108],p[109]!==v?(rt=v("settings.project.metadata.title"),p[109]=v,p[110]=rt):rt=p[110],p[111]!==v?(it=v("settings.project.metadata.info"),p[111]=v,p[112]=it):it=p[112],p[113]!==M.metadataPrompts?(ct=K.METADATA_PROMPT_KEYS.map((t,s)=>(0,L.jsx)(ce,{promptKey:t,value:M.metadataPrompts[t],onChange:ie,flush:s===K.METADATA_PROMPT_KEYS.length-1},t)),p[113]=M.metadataPrompts,p[114]=ct):ct=p[114],p[115]!==rt||p[116]!==it||p[117]!==ct?(lt=(0,L.jsx)(D.SettingsGroup,{title:rt,info:it,testID:"metadata-group",children:ct}),p[115]=rt,p[116]=it,p[117]=ct,p[118]=lt):lt=p[118],p[119]!==J||p[120]!==Be||p[121]!==v?(at=Be?(0,L.jsx)(t.View,{style:ge.calloutWrap,children:(0,L.jsx)(_.Alert,{testID:"stale-callout",variant:"error",title:v("settings.project.writeFailures.staleTitle"),description:v("settings.project.writeFailures.staleDescription"),children:(0,L.jsx)(y.Button,{testID:"stale-callout-action-0",onPress:J,variant:"outline",size:"sm",children:v("settings.project.actions.reload")})})}):null,p[119]=J,p[120]=Be,p[121]=v,p[122]=at):at=p[122],p[123]!==J||p[124]!==Y||p[125]!==Fe||p[126]!==v?(dt=Fe?(0,L.jsx)(t.View,{style:ge.calloutWrap,children:(0,L.jsxs)(_.Alert,{testID:"write-failed-callout",variant:"error",title:v("settings.project.writeFailures.failedTitle"),description:v("settings.project.writeFailures.failedDescription"),children:[(0,L.jsx)(y.Button,{testID:"write-failed-callout-action-0",onPress:Y,variant:"outline",size:"sm",children:v("settings.project.actions.tryAgain")}),(0,L.jsx)(y.Button,{testID:"write-failed-callout-action-1",onPress:J,variant:"outline",size:"sm",children:v("settings.project.actions.reload")})]})}):null,p[123]=J,p[124]=Y,p[125]=Fe,p[126]=v,p[127]=dt):dt=p[127],p[128]!==v?(pt=v("settings.project.actions.save"),p[128]=v,p[129]=pt):pt=p[129],p[130]!==G.isPending||p[131]!==v?(ut=G.isPending?v("settings.project.actions.saving"):v("settings.project.actions.save"),p[130]=G.isPending,p[131]=v,p[132]=ut):ut=p[132],p[133]!==Y||p[134]!==We||p[135]!==G.isPending||p[136]!==pt||p[137]!==ut?(mt=(0,L.jsx)(t.View,{style:ge.footer,children:(0,L.jsx)(y.Button,{testID:"save-button",accessibilityLabel:pt,variant:"default",size:"md",disabled:We,loading:G.isPending,onPress:Y,children:ut})}),p[133]=Y,p[134]=We,p[135]=G.isPending,p[136]=pt,p[137]=ut,p[138]=mt):mt=p[138],p[139]!==ve||p[140]!==_e?(gt=ve?(0,L.jsx)(me,{script:ve,onChange:ye,onCancel:_e,onSave:Se}):null,p[139]=ve,p[140]=_e,p[141]=gt):gt=p[141],p[142]!==Ze||p[143]!==nt||p[144]!==lt||p[145]!==at||p[146]!==dt||p[147]!==mt||p[148]!==gt?(jt=(0,L.jsxs)(t.View,{children:[Ze,nt,lt,at,dt,mt,gt]}),p[142]=Ze,p[143]=nt,p[144]=lt,p[145]=at,p[146]=dt,p[147]=mt,p[148]=gt,p[149]=jt):jt=p[149],jt}function ee(){return ge.spinnerColor.color}function te(p){const u=(0,c.c)(67),{project:f,client:x}=p,{t:y}=(0,d.useTranslation)(),b=(0,j.useQueryClient)(),_=(0,E.useToast)(),[I,S]=(0,l.useState)(!1),[T,v]=(0,l.useState)(f.projectCustomName??"");let w,D,C,R;u[0]!==x||u[1]!==f.projectKey?(w=t=>x.renameProject(f.projectKey,t),u[0]=x,u[1]=f.projectKey,u[2]=w):w=u[2],u[3]!==b||u[4]!==y||u[5]!==_?(D=()=>{b.invalidateQueries({queryKey:["projects"]}),S(!1),_.show(y("settings.project.rename.renamedToast"),{variant:"success"})},u[3]=b,u[4]=y,u[5]=_,u[6]=D):D=u[6],u[7]!==y||u[8]!==_?(C=t=>{const s=t instanceof Error?t.message:y("settings.project.rename.errorFallback");_.show(s,{variant:"error"})},u[7]=y,u[8]=_,u[9]=C):C=u[9],u[10]!==w||u[11]!==D||u[12]!==C?(R={mutationFn:w,onSuccess:D,onError:C},u[10]=w,u[11]=D,u[12]=C,u[13]=R):R=u[13];const k=(0,j.useMutation)(R);let P;u[14]!==f.projectCustomName?(P=()=>{v(f.projectCustomName??""),S(!0)},u[14]=f.projectCustomName,u[15]=P):P=u[15];const z=P;let H;u[16]!==f.projectCustomName?(H=()=>{S(!1),v(f.projectCustomName??"")},u[16]=f.projectCustomName,u[17]=H):H=u[17];const K=H;let M;u[18]!==f.projectCustomName||u[19]!==k||u[20]!==T?(M=()=>{const t=T.trim(),s=0===t.length?null:t;s!==(f.projectCustomName??null)?k.mutate(s):S(!1)},u[18]=f.projectCustomName,u[19]=k,u[20]=T,u[21]=M):M=u[21];const N=M;let B;u[22]!==k?(B=()=>{k.mutate(null)},u[22]=k,u[23]=B):B=u[23];const F=B;if(!I){let s,c,l,d,p,j;return u[24]!==f.projectName?(s=(0,L.jsx)(o.Text,{style:ge.projectTitle,numberOfLines:1,children:f.projectName}),u[24]=f.projectName,u[25]=s):s=u[25],u[26]!==y?(c=y("settings.project.rename.renameLabel"),u[26]=y,u[27]=c):c=u[27],u[28]===Symbol.for("react.memo_cache_sentinel")?(l=(0,L.jsx)(h.Pencil,{size:V,color:ge.iconColor.color}),u[28]=l):l=u[28],u[29]!==z||u[30]!==c?(d=(0,L.jsx)(n.Pressable,{testID:"project-name-edit-button",accessibilityLabel:c,onPress:z,hitSlop:8,style:ge.nameEditorIconButton,children:l}),u[29]=z,u[30]=c,u[31]=d):d=u[31],u[32]!==F||u[33]!==f.projectCustomName||u[34]!==k.isPending||u[35]!==y?(p=f.projectCustomName?(0,L.jsx)(n.Pressable,{testID:"project-name-reset-button",accessibilityLabel:y("settings.project.rename.resetLabel"),onPress:F,disabled:k.isPending,hitSlop:8,style:ge.nameEditorResetButton,children:(0,L.jsx)(o.Text,{style:ge.nameEditorResetText,children:y("settings.project.rename.reset")})}):null,u[32]=F,u[33]=f.projectCustomName,u[34]=k.isPending,u[35]=y,u[36]=p):p=u[36],u[37]!==d||u[38]!==p||u[39]!==s?(j=(0,L.jsxs)(t.View,{style:ge.nameEditorRow,children:[s,d,p]}),u[37]=d,u[38]=p,u[39]=s,u[40]=j):j=u[40],j}let W;u[41]!==y?(W=y("settings.project.rename.projectNameLabel"),u[41]=y,u[42]=W):W=u[42];const O=!k.isPending;let A,q,$,Q,G,U,Y,X;return u[43]!==N||u[44]!==f.projectName||u[45]!==O||u[46]!==W||u[47]!==T?(A=(0,L.jsx)(s.TextInput,{testID:"project-name-input",accessibilityLabel:W,value:T,onChangeText:v,placeholder:f.projectName,placeholderTextColor:ge.placeholderColor.color,autoFocus:!0,style:ge.nameEditorInput,editable:O,onSubmitEditing:N,returnKeyType:"done"}),u[43]=N,u[44]=f.projectName,u[45]=O,u[46]=W,u[47]=T,u[48]=A):A=u[48],u[49]!==y?(q=y("settings.project.rename.saveLabel"),u[49]=y,u[50]=q):q=u[50],u[51]===Symbol.for("react.memo_cache_sentinel")?($=(0,L.jsx)(h.Check,{size:V,color:ge.iconColor.color}),u[51]=$):$=u[51],u[52]!==N||u[53]!==k.isPending||u[54]!==q?(Q=(0,L.jsx)(n.Pressable,{testID:"project-name-save-button",accessibilityLabel:q,onPress:N,disabled:k.isPending,hitSlop:8,style:ge.nameEditorIconButton,children:$}),u[52]=N,u[53]=k.isPending,u[54]=q,u[55]=Q):Q=u[55],u[56]!==y?(G=y("settings.project.rename.cancelLabel"),u[56]=y,u[57]=G):G=u[57],u[58]===Symbol.for("react.memo_cache_sentinel")?(U=(0,L.jsx)(h.X,{size:V,color:ge.iconColor.color}),u[58]=U):U=u[58],u[59]!==K||u[60]!==k.isPending||u[61]!==G?(Y=(0,L.jsx)(n.Pressable,{testID:"project-name-cancel-button",accessibilityLabel:G,onPress:K,disabled:k.isPending,hitSlop:8,style:ge.nameEditorIconButton,children:U}),u[59]=K,u[60]=k.isPending,u[61]=G,u[62]=Y):Y=u[62],u[63]!==A||u[64]!==Q||u[65]!==Y?(X=(0,L.jsxs)(t.View,{style:ge.nameEditorRow,children:[A,Q,Y]}),u[63]=A,u[64]=Q,u[65]=Y,u[66]=X):X=u[66],X}function se(t){const s=(0,c.c)(6),{iconDataUri:o,projectName:n,projectKey:l}=t;let d;s[0]!==n?(d=n.trim().charAt(0).toUpperCase()||"?",s[0]=n,s[1]=d):d=s[1];const p=d;let u;return s[2]!==o||s[3]!==p||s[4]!==l?(u=(0,L.jsx)(f.ProjectIconView,{iconDataUri:o,initial:p,projectKey:l,imageStyle:ge.titleIcon,fallbackStyle:ge.titleIconFallback,textStyle:ge.titleIconFallbackText}),s[2]=o,s[3]=p,s[4]=l,s[5]=u):u=s[5],u}function oe(s){const n=(0,c.c)(11),{hosts:l,selectedHost:d,onSelectHost:p}=s;if(l.length>1){let t;return n[0]!==l||n[1]!==p||n[2]!==d?(t=(0,L.jsx)(ne,{hosts:l,selectedHost:d,onSelectHost:p}),n[0]=l,n[1]=p,n[2]=d,n[3]=t):t=n[3],t}let u,j,h;return n[4]!==d.serverId?(u=(0,L.jsx)(x.HostStatusDotSlot,{serverId:d.serverId}),n[4]=d.serverId,n[5]=u):u=n[5],n[6]!==d.serverName?(j=(0,L.jsx)(o.Text,{style:ge.hostName,numberOfLines:1,children:d.serverName}),n[6]=d.serverName,n[7]=j):j=n[7],n[8]!==u||n[9]!==j?(h=(0,L.jsxs)(t.View,{testID:"host-indicator",style:ge.hostIndicator,children:[u,j]}),n[8]=u,n[9]=j,n[10]=h):h=n[10],h}function ne(t){const s=(0,c.c)(23),{hosts:p,selectedHost:u,onSelectHost:j}=t,{t:f}=(0,d.useTranslation)(),[y,b]=(0,l.useState)(!1),_=(0,l.useRef)(null);let I;s[0]!==p?(I=p.map(ie),s[0]=p,s[1]=I):I=s[1];const S=I;let T;s[2]===Symbol.for("react.memo_cache_sentinel")?(T=()=>b(!0),s[2]=T):T=s[2];const v=T,w=re,D=u.serverId;let C,R,k,P,z,E,H;return s[3]!==f?(C=f("settings.project.switchHost"),s[3]=f,s[4]=C):C=s[4],s[5]!==f?(R=f("settings.project.switchHost"),s[5]=f,s[6]=R):R=s[6],s[7]!==u.serverId?(k=(0,L.jsx)(x.HostStatusDotSlot,{serverId:u.serverId}),s[7]=u.serverId,s[8]=k):k=s[8],s[9]!==u.serverName?(P=(0,L.jsx)(o.Text,{style:ge.hostName,numberOfLines:1,children:u.serverName}),s[9]=u.serverName,s[10]=P):P=s[10],s[11]===Symbol.for("react.memo_cache_sentinel")?(z=(0,L.jsx)(h.ChevronDown,{size:V,color:ge.chevronColor.color}),s[11]=z):z=s[11],s[12]!==R||s[13]!==k||s[14]!==P?(E=(0,L.jsxs)(n.Pressable,{ref:_,accessibilityLabel:R,testID:"host-picker",style:ge.hostIndicator,onPress:v,children:[k,P,z]}),s[12]=R,s[13]=k,s[14]=P,s[15]=E):E=s[15],s[16]!==S||s[17]!==j||s[18]!==y||s[19]!==u.serverId||s[20]!==C||s[21]!==E?(H=(0,L.jsx)(x.HostPicker,{hosts:S,value:D,onSelect:j,open:y,onOpenChange:b,anchorRef:_,searchable:!1,title:C,desktopPlacement:"bottom-start",desktopMinWidth:240,hostOptionTestID:w,children:E}),s[16]=S,s[17]=j,s[18]=y,s[19]=u.serverId,s[20]=C,s[21]=E,s[22]=H):H=s[22],H}function re(t){return`host-picker-item-${t}`}function ie(t){return{serverId:t.serverId,label:t.serverName}}function ce(t){const s=(0,c.c)(20),{promptKey:o,value:n,onChange:l,flush:p}=t,{t:u}=(0,d.useTranslation)(),j=B[o];let h;s[0]!==j.titleKey||s[1]!==u?(h=u(j.titleKey),s[0]=j.titleKey,s[1]=u,s[2]=h):h=s[2];const f=h;let x;s[3]!==l||s[4]!==o?(x=t=>l(o,t),s[3]=l,s[4]=o,s[5]=x):x=s[5];const y=x,b=j.sectionTestID,_=j.inputTestID;let I,S,T;return s[6]!==j.placeholderKey||s[7]!==u?(I=u(j.placeholderKey),s[6]=j.placeholderKey,s[7]=u,s[8]=I):I=s[8],s[9]!==y||s[10]!==j.inputTestID||s[11]!==I||s[12]!==f||s[13]!==n?(S=(0,L.jsx)(w.SettingsTextAreaCard,{testID:_,accessibilityLabel:f,value:n,onChangeText:y,placeholder:I}),s[9]=y,s[10]=j.inputTestID,s[11]=I,s[12]=f,s[13]=n,s[14]=S):S=s[14],s[15]!==p||s[16]!==j.sectionTestID||s[17]!==S||s[18]!==f?(T=(0,L.jsx)(C.SettingsSection,{title:f,testID:b,flush:p,children:S}),s[15]=p,s[16]=j.sectionTestID,s[17]=S,s[18]=f,s[19]=T):T=s[19],T}function le(s){const l=(0,c.c)(49),{script:p,isFirst:u,onEdit:j,onRemove:f}=s,{t:x}=(0,d.useTranslation)();let y;l[0]!==j||l[1]!==p?(y=()=>j(p),l[0]=j,l[1]=p,l[2]=y):y=l[2];const _=y;let I;l[3]!==f||l[4]!==p?(I=()=>f(p),l[3]=f,l[4]=p,l[5]=I):I=l[5];const S=I,T=u?ge.scriptRow:ge.scriptRowWithBorder,v=`script-row-${p.id}`;let w,D,C,k,P,z;l[6]!==p.name||l[7]!==x?(w=p.name||x("settings.project.scripts.untitled"),l[6]=p.name,l[7]=x,l[8]=w):w=l[8],l[9]!==w?(D=(0,L.jsx)(o.Text,{style:R.settingsStyles.rowTitle,numberOfLines:1,children:w}),l[9]=w,l[10]=D):D=l[10],l[11]!==p||l[12]!==x?(C=ae(p,x),l[11]=p,l[12]=x,l[13]=C):C=l[13],l[14]!==C?(k=(0,L.jsx)(o.Text,{style:R.settingsStyles.rowHint,numberOfLines:1,children:C}),l[14]=C,l[15]=k):k=l[15],l[16]!==_||l[17]!==D||l[18]!==k?(P=(0,L.jsxs)(n.Pressable,{style:ge.scriptRowMain,onPress:_,children:[D,k]}),l[16]=_,l[17]=D,l[18]=k,l[19]=P):P=l[19],l[20]!==x?(z=x("settings.project.scripts.menuAccessibility"),l[20]=x,l[21]=z):z=l[21];const E=`script-row-menu-${p.id}`;let H,K;l[22]===Symbol.for("react.memo_cache_sentinel")?(H=(0,L.jsx)(h.MoreVertical,{size:V,color:ge.chevronColor.color}),l[22]=H):H=l[22],l[23]!==E||l[24]!==z?(K=(0,L.jsx)(b.DropdownMenuTrigger,{accessibilityLabel:z,testID:E,style:ge.scriptKebab,children:H}),l[23]=E,l[24]=z,l[25]=K):K=l[25];const M=`script-action-${p.id}-edit`;let N,B;l[26]!==x?(N=x("settings.project.scripts.actions.edit"),l[26]=x,l[27]=N):N=l[27],l[28]!==_||l[29]!==M||l[30]!==N?(B=(0,L.jsx)(b.DropdownMenuItem,{testID:M,onSelect:_,children:N}),l[28]=_,l[29]=M,l[30]=N,l[31]=B):B=l[31];const F=`script-action-${p.id}-remove`;let W,O,A,q,$;return l[32]!==x?(W=x("settings.project.scripts.actions.remove"),l[32]=x,l[33]=W):W=l[33],l[34]!==S||l[35]!==F||l[36]!==W?(O=(0,L.jsx)(b.DropdownMenuItem,{testID:F,destructive:!0,onSelect:S,children:W}),l[34]=S,l[35]=F,l[36]=W,l[37]=O):O=l[37],l[38]!==B||l[39]!==O?(A=(0,L.jsxs)(b.DropdownMenuContent,{align:"end",minWidth:160,children:[B,O]}),l[38]=B,l[39]=O,l[40]=A):A=l[40],l[41]!==K||l[42]!==A?(q=(0,L.jsxs)(b.DropdownMenu,{children:[K,A]}),l[41]=K,l[42]=A,l[43]=q):q=l[43],l[44]!==T||l[45]!==q||l[46]!==v||l[47]!==P?($=(0,L.jsxs)(t.View,{style:T,testID:v,children:[P,q]}),l[44]=T,l[45]=q,l[46]=v,l[47]=P,l[48]=$):$=l[48],$}function ae(t,s){const o=[];return t.type&&o.push(t.type),t.portText&&o.push(s("settings.project.scripts.port",{port:t.portText})),t.commandText&&o.push(t.commandText.split("\n")[0]??""),o.join(" \xb7 ")}function de(t,s){const o=0===t.name.trim().length?s("settings.project.scripts.nameRequired"):null,n=0===t.commandText.trim().length?s("settings.project.scripts.commandRequired"):null;return{hasErrors:Boolean(o||n),nameError:o,commandError:n}}const pe={name:!0,command:!0},ue={name:!1,command:!1};function me(n){const p=(0,c.c)(100),{script:u,onChange:j,onCancel:h,onSave:f}=n,{t:x}=(0,d.useTranslation)(),[b,_]=(0,l.useState)(ue);let I,S,w;p[0]===Symbol.for("react.memo_cache_sentinel")?(I=()=>{_(ue)},p[0]=I):I=p[0],p[1]!==u.id?(S=[u.id],p[1]=u.id,p[2]=S):S=p[2],(0,l.useEffect)(I,S),p[3]===Symbol.for("react.memo_cache_sentinel")?(w=t=>{_(s=>s[t]?s:Object.assign({},s,{[t]:!0}))},p[3]=w):w=p[3];const D=w;let C;p[4]!==j||p[5]!==u?(C=t=>j(Object.assign({},u,{name:t})),p[4]=j,p[5]=u,p[6]=C):C=p[6];const R=C;let k;p[7]!==j||p[8]!==u?(k=t=>j(Object.assign({},u,{commandText:t})),p[7]=j,p[8]=u,p[9]=k):k=p[9];const P=k;let z;p[10]!==j||p[11]!==u?(z=t=>j(Object.assign({},u,{type:t?N:""})),p[10]=j,p[11]=u,p[12]=z):z=p[12];const E=z;let H;p[13]===Symbol.for("react.memo_cache_sentinel")?(H=()=>D("name"),p[13]=H):H=p[13];const K=H;let M;p[14]===Symbol.for("react.memo_cache_sentinel")?(M=()=>D("command"),p[14]=M):M=p[14];const V=M;let B;p[15]!==u||p[16]!==x?(B=de(u,x),p[15]=u,p[16]=x,p[17]=B):B=p[17];const F=B;let W;p[18]!==f||p[19]!==F.hasErrors?(W=()=>{F.hasErrors?_(pe):f()},p[18]=f,p[19]=F.hasErrors,p[20]=W):W=p[20];const O=W,A=b.name&&F.nameError,q=b.command&&F.commandError,$=u.type===N;let Q,G;p[21]!==u.name||p[22]!==x?(Q=u.name?x("settings.project.scripts.editScript",{name:u.name}):x("settings.project.scripts.newScript"),p[21]=u.name,p[22]=x,p[23]=Q):Q=p[23],p[24]!==Q?(G={title:Q},p[24]=Q,p[25]=G):G=p[25];const U=G;let Y,X,J,Z,ee,te,se,oe,ne,re,ie,ce,le,ae,me,je,he,fe,xe,ye,be,_e,Ie,Se,Te,ve;return p[26]!==x?(Y=x("settings.project.scripts.name"),p[26]=x,p[27]=Y):Y=p[27],p[28]!==Y?(X=(0,L.jsx)(o.Text,{style:ge.modalLabel,children:Y}),p[28]=Y,p[29]=X):X=p[29],p[30]!==x?(J=x("settings.project.scripts.nameAccessibility"),p[30]=x,p[31]=J):J=p[31],p[32]!==R||p[33]!==u.name||p[34]!==J?(Z=(0,L.jsx)(s.TextInput,{testID:"script-edit-name",accessibilityLabel:J,value:u.name,onChangeText:R,onBlur:K,placeholder:"dev",placeholderTextColor:ge.placeholderColor.color,style:ge.modalInput}),p[32]=R,p[33]=u.name,p[34]=J,p[35]=Z):Z=p[35],p[36]!==A||p[37]!==F.nameError?(ee=A?(0,L.jsx)(o.Text,{testID:"script-edit-name-error",style:ge.fieldError,children:F.nameError}):null,p[36]=A,p[37]=F.nameError,p[38]=ee):ee=p[38],p[39]!==X||p[40]!==Z||p[41]!==ee?(te=(0,L.jsxs)(t.View,{style:ge.modalSection,children:[X,Z,ee]}),p[39]=X,p[40]=Z,p[41]=ee,p[42]=te):te=p[42],p[43]!==x?(se=x("settings.project.scripts.command"),p[43]=x,p[44]=se):se=p[44],p[45]!==se?(oe=(0,L.jsx)(o.Text,{style:ge.modalLabel,children:se}),p[45]=se,p[46]=oe):oe=p[46],p[47]!==x?(ne=x("settings.project.scripts.commandAccessibility"),p[47]=x,p[48]=ne):ne=p[48],p[49]!==P||p[50]!==u.commandText||p[51]!==ne?(re=(0,L.jsx)(s.TextInput,{testID:"script-edit-command",accessibilityLabel:ne,multiline:!0,value:u.commandText,onChangeText:P,onBlur:V,placeholder:"npm run dev",placeholderTextColor:ge.placeholderColor.color,style:ge.modalMultilineInput}),p[49]=P,p[50]=u.commandText,p[51]=ne,p[52]=re):re=p[52],p[53]!==q||p[54]!==F.commandError?(ie=q?(0,L.jsx)(o.Text,{testID:"script-edit-command-error",style:ge.fieldError,children:F.commandError}):null,p[53]=q,p[54]=F.commandError,p[55]=ie):ie=p[55],p[56]!==oe||p[57]!==re||p[58]!==ie?(ce=(0,L.jsxs)(t.View,{style:ge.modalSection,children:[oe,re,ie]}),p[56]=oe,p[57]=re,p[58]=ie,p[59]=ce):ce=p[59],p[60]!==x?(le=x("settings.project.scripts.runAsService"),p[60]=x,p[61]=le):le=p[61],p[62]!==le?(ae=(0,L.jsx)(o.Text,{style:ge.serviceToggleLabel,children:le}),p[62]=le,p[63]=ae):ae=p[63],p[64]!==x?(me=x("settings.project.scripts.serviceHint"),p[64]=x,p[65]=me):me=p[65],p[66]!==me?(je=(0,L.jsx)(o.Text,{style:ge.modalHint,children:me}),p[66]=me,p[67]=je):je=p[67],p[68]!==ae||p[69]!==je?(he=(0,L.jsxs)(t.View,{style:ge.serviceToggleText,children:[ae,je]}),p[68]=ae,p[69]=je,p[70]=he):he=p[70],p[71]!==x?(fe=x("settings.project.scripts.runAsService"),p[71]=x,p[72]=fe):fe=p[72],p[73]!==E||p[74]!==$||p[75]!==fe?(xe=(0,L.jsx)(T.Switch,{value:$,onValueChange:E,accessibilityLabel:fe,testID:"script-edit-service-toggle"}),p[73]=E,p[74]=$,p[75]=fe,p[76]=xe):xe=p[76],p[77]!==he||p[78]!==xe?(ye=(0,L.jsx)(t.View,{style:ge.modalSection,children:(0,L.jsxs)(t.View,{style:ge.serviceToggleRow,children:[he,xe]})}),p[77]=he,p[78]=xe,p[79]=ye):ye=p[79],p[80]!==x?(be=x("settings.project.actions.cancel"),p[80]=x,p[81]=be):be=p[81],p[82]!==h||p[83]!==be?(_e=(0,L.jsx)(y.Button,{onPress:h,variant:"ghost",size:"md",testID:"script-edit-cancel",children:be}),p[82]=h,p[83]=be,p[84]=_e):_e=p[84],p[85]!==x?(Ie=x("settings.project.actions.save"),p[85]=x,p[86]=Ie):Ie=p[86],p[87]!==O||p[88]!==Ie?(Se=(0,L.jsx)(y.Button,{onPress:O,variant:"default",size:"md",testID:"script-edit-save",children:Ie}),p[87]=O,p[88]=Ie,p[89]=Se):Se=p[89],p[90]!==_e||p[91]!==Se?(Te=(0,L.jsxs)(t.View,{style:ge.modalFooter,children:[_e,Se]}),p[90]=_e,p[91]=Se,p[92]=Te):Te=p[92],p[93]!==h||p[94]!==U||p[95]!==te||p[96]!==ce||p[97]!==ye||p[98]!==Te?(ve=(0,L.jsxs)(v.AdaptiveModalSheet,{visible:!0,header:U,onClose:h,testID:"script-edit-modal",desktopMaxWidth:560,children:[te,ce,ye,Te]}),p[93]=h,p[94]=U,p[95]=te,p[96]=ce,p[97]=ye,p[98]=Te,p[99]=ve):ve=p[99],ve}const ge=u.StyleSheet.create(t=>({noTargetContainer:{padding:t.spacing[4],alignItems:"flex-start",gap:t.spacing[3],uni__dependencies:[0]},noTargetText:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,uni__dependencies:[0]},body:{padding:t.spacing[4],gap:t.spacing[2],uni__dependencies:[0]},backButton:{alignSelf:"flex-start",paddingHorizontal:0},headerBlock:{marginTop:t.spacing[2],marginBottom:t.spacing[4],gap:t.spacing[2],uni__dependencies:[0]},titleRow:{flexDirection:"row",alignItems:"center",gap:t.spacing[3],uni__dependencies:[0]},projectTitle:{color:t.colors.foreground,fontSize:t.fontSize.lg,fontWeight:t.fontWeight.medium,flexShrink:1,uni__dependencies:[0]},nameEditorRow:{flex:1,flexDirection:"row",alignItems:"center",gap:t.spacing[2],minWidth:0,uni__dependencies:[0]},nameEditorIconButton:{padding:t.spacing[1],uni__dependencies:[0]},nameEditorInput:{flex:1,color:t.colors.foreground,fontSize:t.fontSize.lg,fontWeight:t.fontWeight.medium,paddingVertical:t.spacing[1],paddingHorizontal:t.spacing[2],borderRadius:t.borderRadius.md,borderWidth:1,borderColor:t.colors.border,backgroundColor:t.colors.surface2,minWidth:0,uni__dependencies:[0]},nameEditorResetButton:{paddingVertical:t.spacing[1],paddingHorizontal:t.spacing[2],uni__dependencies:[0]},nameEditorResetText:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,uni__dependencies:[0]},titleIcon:{width:28,height:28,borderRadius:t.borderRadius.md,uni__dependencies:[0]},titleIconFallback:{width:28,height:28,borderRadius:t.borderRadius.md,alignItems:"center",justifyContent:"center",uni__dependencies:[0]},titleIconFallbackText:{fontSize:t.fontSize.sm,fontWeight:t.fontWeight.medium,uni__dependencies:[0]},iconColor:{color:t.colors.foregroundMuted,uni__dependencies:[0]},hostIndicator:{flexDirection:"row",alignItems:"center",gap:t.spacing[2],paddingHorizontal:t.spacing[2],paddingVertical:t.spacing[1],borderRadius:t.borderRadius.lg,alignSelf:"flex-start",minWidth:0,uni__dependencies:[0]},hostName:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,flexShrink:1,minWidth:0,uni__dependencies:[0]},centered:{flex:1,alignItems:"center",justifyContent:"center",padding:t.spacing[6],uni__dependencies:[0]},errorBlock:{marginTop:t.spacing[2],uni__dependencies:[0]},emptyScripts:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,uni__dependencies:[0]},scriptRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:t.spacing[4],paddingHorizontal:t.spacing[4],uni__dependencies:[0]},scriptRowWithBorder:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:t.spacing[4],paddingHorizontal:t.spacing[4],borderTopWidth:1,borderTopColor:t.colors.border,uni__dependencies:[0]},scriptRowMain:{flex:1,minWidth:0,gap:t.spacing[1],uni__dependencies:[0]},scriptKebab:{padding:t.spacing[1],uni__dependencies:[0]},calloutWrap:{marginTop:t.spacing[3],uni__dependencies:[0]},footer:{marginTop:t.spacing[4],flexDirection:"row",justifyContent:"flex-end",uni__dependencies:[0]},modalSection:{gap:t.spacing[2],uni__dependencies:[0]},modalLabel:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,uni__dependencies:[0]},modalInput:{color:t.colors.foreground,fontSize:t.fontSize.sm,paddingVertical:t.spacing[2],paddingHorizontal:t.spacing[3],borderRadius:t.borderRadius.md,borderWidth:1,borderColor:t.colors.border,backgroundColor:t.colors.surface2,uni__dependencies:[0]},modalMultilineInput:{color:t.colors.foreground,fontSize:t.fontSize.sm,paddingVertical:t.spacing[2],paddingHorizontal:t.spacing[3],borderRadius:t.borderRadius.md,borderWidth:1,borderColor:t.colors.border,backgroundColor:t.colors.surface2,minHeight:100,textAlignVertical:"top",uni__dependencies:[0]},modalFooter:{flexDirection:"row",justifyContent:"flex-end",gap:t.spacing[2],marginTop:t.spacing[2],uni__dependencies:[0]},fieldError:{color:t.colors.palette.red[300],fontSize:t.fontSize.xs,uni__dependencies:[0]},serviceToggleRow:{flexDirection:"row",alignItems:"center",gap:t.spacing[3],uni__dependencies:[0]},serviceToggleText:{flex:1,minWidth:0,gap:t.spacing[1],uni__dependencies:[0]},serviceToggleLabel:{color:t.colors.foreground,fontSize:t.fontSize.sm,fontWeight:t.fontWeight.medium,uni__dependencies:[0]},modalHint:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,uni__dependencies:[0]},placeholderColor:{color:t.colors.foregroundMuted,uni__dependencies:[0]},chevronColor:{color:t.colors.foregroundMuted,uni__dependencies:[0]},spinnerColor:{color:t.colors.foregroundMuted,uni__dependencies:[0]}}))},4761,[348,714,711,1572,349,36,1573,1308,234,715,146,1143,56,916,1600,3624,3454,3627,3572,4755,4762,3564,4731,3466,4748,4763,4727,3907,3895,3670,3271,3499,3678,4764,3477,279]);
|
|
16521
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.ExternalLink=function(x){const h=(0,l.c)(19),{href:b,label:y,tooltip:_,testID:j,accessibilityLabel:S}=x,{theme:T}=(0,s.useUnistyles)();let z;h[0]!==b?(z=()=>{(0,u.openExternalUrl)(b)},h[0]=b,h[1]=z):z=h[1];const M=z,D=S??y;let k,v,I;h[2]!==y?(k=(0,f.jsx)(t.Text,{style:p.label,children:y}),h[2]=y,h[3]=k):k=h[3];h[4]!==T.colors.foregroundMuted?(v=(0,f.jsx)(n.ArrowUpRight,{size:12,color:T.colors.foregroundMuted}),h[4]=T.colors.foregroundMuted,h[5]=v):v=h[5];h[6]!==M||h[7]!==D||h[8]!==k||h[9]!==v||h[10]!==j?(I=(0,f.jsxs)(o.Pressable,{onPress:M,hitSlop:8,accessibilityRole:"link",accessibilityLabel:D,testID:j,style:p.trigger,children:[k,v]}),h[6]=M,h[7]=D,h[8]=k,h[9]=v,h[10]=j,h[11]=I):I=h[11];const L=I;if(!_)return L;let O,P,U;h[12]!==L?(O=(0,f.jsx)(c.TooltipTrigger,{asChild:!0,children:L}),h[12]=L,h[13]=O):O=h[13];h[14]!==_?(P=(0,f.jsx)(c.TooltipContent,{side:"top",align:"end",offset:6,children:(0,f.jsx)(t.Text,{style:p.tooltipText,children:_})}),h[14]=_,h[15]=P):P=h[15];h[16]!==O||h[17]!==P?(U=(0,f.jsxs)(c.Tooltip,{delayDuration:0,enabledOnDesktop:!0,enabledOnMobile:!0,children:[O,P]}),h[16]=O,h[17]=P,h[18]=U):U=h[18];return U};var t=r(d[0]),o=r(d[1]),l=r(d[2]);r(d[3]),r(d[4]),r(d[5]);var n=r(d[6]),s=r(d[7]),c=r(d[8]),u=r(d[9]),f=r(d[10]);const p=s.StyleSheet.create(t=>({trigger:{flexDirection:"row",alignItems:"center",gap:t.spacing[1],uni__dependencies:[0]},label:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,uni__dependencies:[0]},tooltipText:{color:t.colors.foreground,fontSize:t.fontSize.sm,maxWidth:280,lineHeight:1.4*t.fontSize.sm,uni__dependencies:[0]}}))},4762,[711,1572,349,36,1308,234,1600,56,3573,3562,279]);
|
|
16522
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.SettingsGroup=function(x){const _=(0,s.c)(21),{title:y,info:j,trailing:b,testID:S,style:T,children:w}=x,{t:z}=(0,l.useTranslation)(),{theme:D}=(0,p.useUnistyles)();let I;_[0]!==T?(I=[h.group,T],_[0]=T,_[1]=I):I=_[1];const v=I;let B,C,M,O,R;_[2]!==y?(B=(0,f.jsx)(n.Text,{style:h.title,children:y}),_[2]=y,_[3]=B):B=_[3];_[4]!==j||_[5]!==z||_[6]!==S||_[7]!==D||_[8]!==y?(C=j?(0,f.jsxs)(u.Tooltip,{delayDuration:0,enabledOnDesktop:!0,enabledOnMobile:!0,children:[(0,f.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,f.jsx)(o.Pressable,{accessibilityRole:"button",accessibilityLabel:z("settings.groupInfo",{title:y}),testID:S?`${S}-info`:void 0,hitSlop:8,style:h.infoButton,children:(0,f.jsx)(c.Info,{size:D.iconSize.sm,color:D.colors.foregroundMuted})})}),(0,f.jsx)(u.TooltipContent,{side:"top",align:"start",offset:8,children:(0,f.jsx)(n.Text,{style:h.tooltipText,children:j})})]}):null,_[4]=j,_[5]=z,_[6]=S,_[7]=D,_[8]=y,_[9]=C):C=_[9];_[10]!==B||_[11]!==C?(M=(0,f.jsxs)(t.View,{style:h.titleRow,children:[B,C]}),_[10]=B,_[11]=C,_[12]=M):M=_[12];_[13]!==M||_[14]!==b?(O=(0,f.jsxs)(t.View,{style:h.header,children:[M,b]}),_[13]=M,_[14]=b,_[15]=O):O=_[15];_[16]!==w||_[17]!==v||_[18]!==O||_[19]!==S?(R=(0,f.jsxs)(t.View,{style:v,testID:S,children:[O,w]}),_[16]=w,_[17]=v,_[18]=O,_[19]=S,_[20]=R):R=_[20];return R};var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]);r(d[4]),r(d[5]),r(d[6]),r(d[7]);var l=r(d[8]),c=r(d[9]),p=r(d[10]),u=r(d[11]),f=r(d[12]);const h=p.StyleSheet.create(t=>({group:{marginBottom:t.spacing[8],uni__dependencies:[0]},header:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",gap:t.spacing[2],marginBottom:t.spacing[4],uni__dependencies:[0]},titleRow:{flexDirection:"row",alignItems:"center",gap:t.spacing[2],uni__dependencies:[0]},title:{color:t.colors.foreground,fontSize:t.fontSize.base,fontWeight:t.fontWeight.normal,uni__dependencies:[0]},infoButton:{padding:t.spacing[1],marginLeft:-t.spacing[1],uni__dependencies:[0]},tooltipText:{color:t.colors.foreground,fontSize:t.fontSize.sm,maxWidth:280,lineHeight:1.4*t.fontSize.sm,uni__dependencies:[0]}}))},4763,[348,711,1572,349,36,1308,234,146,1573,1600,56,3573,279]);
|
|
16523
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"METADATA_PROMPT_KEYS",{enumerable:!0,get:function(){return t}}),e.configToDraft=function(o){const f=o?.worktree??{},u=n(f.setup),p=n(f.teardown),y=[],b=o?.scripts??{};for(const[t,o]of Object.entries(b)){const f=n(o.command);y.push({id:l(),name:t,commandText:f.text,commandOriginalKind:f.kind,type:s(o.type),portText:c(o.port),rawEntry:o})}const O=o?.metadataGeneration,j={branchName:"",commitMessage:"",pullRequest:""};for(const n of t){const t=O?.[n]?.instructions;"string"==typeof t&&(j[n]=t)}return{setupText:u.text,setupOriginalKind:u.kind,teardownText:p.text,teardownOriginalKind:p.kind,scripts:y,metadataPrompts:j,metadataGenerationBase:O}},e.applyDraftToConfig=function(n){const s=n.base??{},c=s.worktree??{},u=Object.assign({},c),l=o(n.draft.setupText,n.draft.setupOriginalKind);void 0===l?delete u.setup:u.setup=l;const p=o(n.draft.teardownText,n.draft.teardownOriginalKind);void 0===p?delete u.teardown:u.teardown=p;const y={};for(const t of n.draft.scripts){const n=t.name.trim();if(0===n.length)continue;const s=t.rawEntry,c=Object.assign({},s),u=o(t.commandText,t.commandOriginalKind);void 0===u?delete c.command:c.command=u;const l=t.type.trim();0===l.length?delete c.type:c.type=l;const p=f(t.portText);void 0===p?delete c.port:c.port=p,y[n]=c}const b=Object.assign({},n.draft.metadataGenerationBase);for(const o of t){const t=n.draft.metadataPrompts[o],s=n.draft.metadataGenerationBase?.[o];if(0===t.trim().length)if(s){const t=Object.assign({},s);delete t.instructions,0===Object.keys(t).length?delete b[o]:b[o]=t}else delete b[o];else b[o]=Object.assign({},s,{instructions:t})}const O=Object.assign({},s);0===Object.keys(u).length?delete O.worktree:O.worktree=u;0===Object.keys(y).length?delete O.scripts:O.scripts=y;0===Object.keys(b).length?delete O.metadataGeneration:O.metadataGeneration=b;return O};const t=["branchName","commitMessage","pullRequest"];function n(t){if("string"==typeof t)return{text:t,kind:"string"};if(Array.isArray(t)){return{text:t.filter(t=>"string"==typeof t).join("\n"),kind:"array"}}return{text:"",kind:"missing"}}function o(t,n){const o=t.split("\n").filter(t=>t.trim().length>0);if(0!==o.length)return"string"===n?o.join("\n"):"array"===n?o:1===o.length?o[0]:o}function s(t){return"string"==typeof t?t:""}function c(t){return"number"==typeof t&&Number.isFinite(t)?String(t):"string"==typeof t?t:""}function f(t){const n=t.trim();if(0!==n.length){if(/^[0-9]+$/.test(n)){const t=Number(n);if(Number.isFinite(t))return t}return n}}let u=0;function l(){return u+=1,`script-draft-${u}`}},4764,[]);
|
|
16524
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return f}});var e=r(d[0]),t=r(d[1]);r(d[2]);var o,n=r(d[3]),s=r(d[4]),c=(o=s)&&o.__esModule?o:{default:o},u=r(d[5]),l=r(d[6]);function f(){const o=(0,e.c)(9),s=(0,t.useLocalSearchParams)();let f;o[0]!==s.serverId?(f="string"==typeof s.serverId?s.serverId.trim():"",o[0]=s.serverId,o[1]=f):f=o[1];const v=f,_="string"==typeof s.hostSection?s.hostSection:"";let h;o[2]!==_?(h=(0,u.normalizeHostSectionSlug)(_)??"connections",o[2]=_,o[3]=h):h=o[3];const p=h;let y;o[4]!==p||o[5]!==v?(y={kind:"host",serverId:v,section:p},o[4]=p,o[5]=v,o[6]=y):y=o[6];const I=y;let S;return o[7]!==I?(S=(0,l.jsx)(n.HostRouteBootstrapBoundary,{children:(0,l.jsx)(c.default,{view:I})}),o[7]=I,o[8]=S):S=o[8],S}},4765,[349,1143,36,4399,4722,3477,279]);
|
|
16525
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return c}});var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]);function c(){const c=(0,t.c)(8),l=(0,n.useLocalSearchParams)();let u,f,_,b;if(c[0]!==l.serverId){_=Symbol.for("react.early_return_sentinel");e:{const t="string"==typeof l.serverId?l.serverId.trim():"";if(!t){let t;c[4]===Symbol.for("react.memo_cache_sentinel")?(t=(0,s.jsx)(n.Redirect,{href:(0,o.buildSettingsRoute)()}),c[4]=t):t=c[4],_=t;break e}u=n.Redirect,f=(0,o.buildSettingsHostSectionRoute)(t,"connections")}c[0]=l.serverId,c[1]=u,c[2]=f,c[3]=_}else u=c[1],f=c[2],_=c[3];return _!==Symbol.for("react.early_return_sentinel")?_:(c[5]!==u||c[6]!==f?(b=(0,s.jsx)(u,{href:f}),c[5]=u,c[6]=f,c[7]=b):b=c[7],b)}},4766,[349,1143,3477,279]);
|
|
16526
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return _}});var e,t=r(d[0]),n=r(d[1]),o=r(d[2]),c=r(d[3]),u=(e=c)&&e.__esModule?e:{default:e},l=r(d[4]),s=r(d[5]);const f={kind:"root"};function _(){const e=(0,t.c)(2);if(!(0,o.useIsCompactFormFactor)()){let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,s.jsx)(n.Redirect,{href:(0,l.buildSettingsSectionRoute)("general")}),e[0]=t):t=e[0],t}let c;return e[1]===Symbol.for("react.memo_cache_sentinel")?(c=(0,s.jsx)(u.default,{view:f}),e[1]=c):c=e[1],c}},4767,[349,1143,3457,4722,3477,279]);
|
|
16527
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return s}});var e=r(d[0]),t=r(d[1]);r(d[2]);var o,c=r(d[3]),n=(o=c)&&o.__esModule?o:{default:o},u=r(d[4]);function s(){const o=(0,e.c)(4),c=(0,t.useLocalSearchParams)(),s=Array.isArray(c.projectKey)?c.projectKey[0]:c.projectKey,l="string"==typeof s?decodeURIComponent(s):"";let f;o[0]!==l?(f={kind:"project",projectKey:l},o[0]=l,o[1]=f):f=o[1];const p=f;let y;return o[2]!==p?(y=(0,u.jsx)(n.default,{view:p}),o[2]=p,o[3]=y):y=o[3],y}},4768,[349,1143,36,4722,279]);
|
|
16528
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return l}});var e,t=r(d[0]),n=r(d[1]),c=(e=n)&&e.__esModule?e:{default:e},o=r(d[2]);const u={kind:"projects"};function l(){const e=(0,t.c)(1);let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,o.jsx)(c.default,{view:u}),e[0]=n):n=e[0],n}},4769,[349,4722,279]);
|
|
16529
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});var t=r(d[0]),n=r(d[1]),c=r(d[2]);function o(){const o=(0,t.c)(1);let u;return o[0]===Symbol.for("react.memo_cache_sentinel")?(u=(0,c.jsx)(n.WelcomeScreen,{}),o[0]=u):u=o[0],u}},4770,[349,4771,279]);
|
|
16530
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.WelcomeScreen=function(I){const V=(0,c.c)(63),{onHostAdded:W}=I,{theme:A}=(0,f.useUnistyles)(),{t:M}=(0,u.useTranslation)(),R=(0,h.useSafeAreaInsets)(),H=(0,p.useRouter)();let O;if(V[0]===Symbol.for("react.memo_cache_sentinel")){const t=(0,j.resolveAppVersion)();O=(0,k.formatVersionWithPrefix)(t),V[0]=O}else O=V[0];const E=O,[U,q]=(0,l.useState)(!1),[F,G]=(0,l.useState)(!1),Q=(0,b.useHosts)();let N;V[1]!==Q?(N=Q.map(B),V[1]=Q,V[2]=N):N=V[2];const J=v(N);let K,X,Y;V[3]!==J||V[4]!==H?(K=()=>{J&&H.replace((0,P.buildOpenProjectRoute)())},X=[J,H],V[3]=J,V[4]=H,V[5]=K,V[6]=X):(K=V[5],X=V[6]);(0,l.useEffect)(K,X),V[7]!==H?(Y=()=>{H.replace((0,P.buildOpenProjectRoute)())},V[7]=H,V[8]=Y):Y=V[8];const Z=Y,$=L;let ee;V[9]!==H?(ee=()=>{H.push("/settings")},V[9]=H,V[10]=ee):ee=V[10];const te=ee;let ne;V[11]===Symbol.for("react.memo_cache_sentinel")?(ne=()=>q(!0),V[11]=ne):ne=V[11];const oe=ne;let se;V[12]===Symbol.for("react.memo_cache_sentinel")?(se=()=>q(!1),V[12]=se):se=V[12];const ie=se;let ce;V[13]===Symbol.for("react.memo_cache_sentinel")?(ce=()=>G(!0),V[13]=ce):ce=V[13];const re=ce;let le;V[14]===Symbol.for("react.memo_cache_sentinel")?(le=()=>G(!1),V[14]=le):le=V[14];const ae=le;let de;V[15]!==H?(de=()=>{H.push("/pair-scan?source=onboarding")},V[15]=H,V[16]=de):de=V[16];const ue=de;let pe;V[17]!==Z||V[18]!==W?(pe=t=>{const{profile:n}=t;W?.(n),Z()},V[17]=Z,V[18]=W,V[19]=pe):pe=V[19];const me=pe;let ge;V[20]!==ue||V[21]!==M?(ge=C.isWeb?[{key:"direct-connection",label:M("pairing.connectionMethods.direct.title"),testID:"welcome-direct-connection",primary:!0,icon:y.Link2,onPress:oe},{key:"paste-pairing-link",label:M("pairing.connectionMethods.pasteLink.title"),testID:"welcome-paste-pairing-link",primary:!1,icon:y.ClipboardPaste,onPress:re}]:[{key:"scan-qr",label:M("pairing.connectionMethods.scanQr.title"),testID:"welcome-scan-qr",primary:!0,icon:y.QrCode,onPress:ue},{key:"direct-connection",label:M("pairing.connectionMethods.direct.title"),testID:"welcome-direct-connection",primary:!1,icon:y.Link2,onPress:oe},{key:"paste-pairing-link",label:M("pairing.connectionMethods.pasteLink.title"),testID:"welcome-paste-pairing-link",primary:!1,icon:y.ClipboardPaste,onPress:re}],V[20]=ue,V[21]=M,V[22]=ge):ge=V[22];const fe=ge,ye=A.spacing[6]+R.bottom;let he;V[23]!==ye?(he=[T.container,{paddingBottom:ye}],V[23]=ye,V[24]=he):he=V[24];const be=he;let _e,xe,Se,je,ke,Pe,we,Ie,Ce,ze,Te,ve,De,Le,Be;V[25]===Symbol.for("react.memo_cache_sentinel")?(_e=(0,z.jsx)(w.PaseoLogo,{size:96}),V[25]=_e):_e=V[25];V[26]!==M?(xe=M("onboarding.title"),V[26]=M,V[27]=xe):xe=V[27];V[28]!==xe?(Se=(0,z.jsx)(o.Text,{style:T.title,children:xe}),V[28]=xe,V[29]=Se):Se=V[29];V[30]!==M?(je=M("onboarding.subtitle"),V[30]=M,V[31]=je):je=V[31];V[32]!==je?(ke=(0,z.jsx)(o.Text,{style:T.subtitle,children:je}),V[32]=je,V[33]=ke):ke=V[33];V[34]!==A.colors?(Pe=C.isNative?(0,z.jsxs)(s.Pressable,{style:T.setupLink,onPress:$,children:[(0,z.jsx)(o.Text,{style:T.setupLinkText,children:"paseo.sh"}),(0,z.jsx)(y.ExternalLink,{size:14,color:A.colors.accent})]}):null,V[34]=A.colors,V[35]=Pe):Pe=V[35];V[36]!==Se||V[37]!==ke||V[38]!==Pe?(we=(0,z.jsxs)(n.View,{style:T.copyBlock,children:[Se,ke,Pe]}),V[36]=Se,V[37]=ke,V[38]=Pe,V[39]=we):we=V[39];V[40]!==fe?(Ie=(0,z.jsx)(n.View,{style:T.actions,children:fe.map(D)}),V[40]=fe,V[41]=Ie):Ie=V[41];V[42]!==M?(Ce=M("onboarding.actions.settings"),V[42]=M,V[43]=Ce):Ce=V[43];V[44]!==te||V[45]!==Ce?(ze=(0,z.jsx)(S.Button,{variant:"ghost",size:"sm",leftIcon:y.Settings,onPress:te,style:T.settingsButton,testID:"welcome-open-settings",children:Ce}),V[44]=te,V[45]=Ce,V[46]=ze):ze=V[46];V[47]!==we||V[48]!==Ie||V[49]!==ze?(Te=(0,z.jsxs)(n.View,{style:T.content,children:[_e,we,Ie,ze]}),V[47]=we,V[48]=Ie,V[49]=ze,V[50]=Te):Te=V[50];V[51]===Symbol.for("react.memo_cache_sentinel")?(ve=(0,z.jsx)(o.Text,{style:T.versionLabel,children:E}),V[51]=ve):ve=V[51];V[52]!==me||V[53]!==U?(De=(0,z.jsx)(_.AddHostModal,{visible:U,onClose:ie,onSaved:me}),V[52]=me,V[53]=U,V[54]=De):De=V[54];V[55]!==me||V[56]!==F?(Le=(0,z.jsx)(x.PairLinkModal,{visible:F,onClose:ae,onSaved:me}),V[55]=me,V[56]=F,V[57]=Le):Le=V[57];V[58]!==be||V[59]!==Te||V[60]!==De||V[61]!==Le?(Be=(0,z.jsx)(n.View,{style:T.root,children:(0,z.jsxs)(t.ScrollView,{style:T.scrollView,contentContainerStyle:be,showsVerticalScrollIndicator:!1,testID:"welcome-screen",children:[Te,ve,De,Le]})}),V[58]=be,V[59]=Te,V[60]=De,V[61]=Le,V[62]=Be):Be=V[62];return Be};var t=r(d[0]),n=r(d[1]),o=r(d[2]),s=r(d[3]),c=r(d[4]),l=r(d[5]),u=r(d[6]);r(d[7]),r(d[8]),r(d[9]),r(d[10]);var p=r(d[11]),f=r(d[12]),y=r(d[13]),h=r(d[14]),b=r(d[15]),_=r(d[16]),x=r(d[17]),S=r(d[18]),j=r(d[19]),k=r(d[20]),P=r(d[21]),w=r(d[22]),I=r(d[23]),C=r(d[24]),z=r(d[25]);const T=f.StyleSheet.create(t=>({root:{flex:1,backgroundColor:t.colors.surface0,uni__dependencies:[0]},scrollView:{flex:1},container:{flexGrow:1,padding:t.spacing[6],paddingBottom:0,alignItems:"center",uni__dependencies:[0]},content:{width:"100%",flexGrow:1,justifyContent:"center",alignItems:"center"},title:{color:t.colors.foreground,fontSize:t.fontSize.xl,fontWeight:t.fontWeight.medium,textAlign:"center",uni__dependencies:[0]},subtitle:{color:t.colors.foregroundMuted,fontSize:t.fontSize.sm,textAlign:"center",uni__dependencies:[0]},copyBlock:{alignItems:"center",gap:t.spacing[2],marginBottom:t.spacing[12],uni__dependencies:[0]},actions:{width:"100%",maxWidth:420,gap:t.spacing[3],uni__dependencies:[0]},actionButton:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:t.spacing[3],paddingVertical:t.spacing[4],borderRadius:t.borderRadius.xl,backgroundColor:t.colors.surface2,borderWidth:1,borderColor:t.colors.border,uni__dependencies:[0]},actionButtonPrimary:{backgroundColor:t.colors.accent,borderColor:t.colors.accent,uni__dependencies:[0]},actionText:{color:t.colors.foreground,fontSize:t.fontSize.base,fontWeight:t.fontWeight.medium,uni__dependencies:[0]},actionTextPrimary:{color:t.colors.accentForeground,uni__dependencies:[0]},setupLink:{flexDirection:"row",alignItems:"center",justifyContent:"center",gap:6},setupLinkText:{color:t.colors.accent,fontSize:t.fontSize.sm,fontWeight:t.fontWeight.medium,uni__dependencies:[0]},versionLabel:{color:t.colors.foregroundMuted,fontSize:t.fontSize.xs,textAlign:"center",marginTop:t.spacing[6],uni__dependencies:[0]},settingsButton:{alignSelf:"center",marginTop:t.spacing[6],uni__dependencies:[0]}}));function v(t){const n=(0,c.c)(5);let o;n[0]===Symbol.for("react.memo_cache_sentinel")?(o=(0,b.getHostRuntimeStore)(),n[0]=o):o=n[0];const s=o;let u,p,f;return n[1]===Symbol.for("react.memo_cache_sentinel")?(u=t=>s.subscribeAll(t),n[1]=u):u=n[1],n[2]!==t?(p=()=>{let n=null,o=null;for(const c of t){const t=s.getSnapshot(c),l=t?.lastOnlineAt??null;(0,b.isHostRuntimeConnected)(t)&&l&&((!o||l<o)&&(o=l,n=c))}return n},f=()=>{let n=null,o=null;for(const c of t){const t=s.getSnapshot(c),l=t?.lastOnlineAt??null;(0,b.isHostRuntimeConnected)(t)&&l&&((!o||l<o)&&(o=l,n=c))}return n},n[2]=t,n[3]=p,n[4]=f):(p=n[3],f=n[4]),(0,l.useSyncExternalStore)(u,p,f)}function D(t){return(0,z.jsx)(V,{action:t},t.key)}function L(){(0,I.openExternalUrl)("https://paseo.sh")}function B(t){return t.serverId}function V(t){const n=(0,c.c)(16),{action:l}=t,{theme:u}=(0,f.useUnistyles)(),p=l.icon,y=l.primary?T.actionButtonPrimary:null;let h;n[0]!==y?(h=[T.actionButton,y],n[0]=y,n[1]=h):h=n[1];const b=h,_=l.primary?T.actionTextPrimary:null;let x;n[2]!==_?(x=[T.actionText,_],n[2]=_,n[3]=x):x=n[3];const S=x,j=l.primary?u.colors.accentForeground:u.colors.foreground;let k,P,w;return n[4]!==p||n[5]!==j?(k=(0,z.jsx)(p,{size:18,color:j}),n[4]=p,n[5]=j,n[6]=k):k=n[6],n[7]!==l.label||n[8]!==S?(P=(0,z.jsx)(o.Text,{style:S,children:l.label}),n[7]=l.label,n[8]=S,n[9]=P):P=n[9],n[10]!==l.onPress||n[11]!==l.testID||n[12]!==b||n[13]!==k||n[14]!==P?(w=(0,z.jsxs)(s.Pressable,{style:b,onPress:l.onPress,testID:l.testID,children:[k,P]}),n[10]=l.onPress,n[11]=l.testID,n[12]=b,n[13]=k,n[14]=P,n[15]=w):w=n[15],w}},4771,[690,348,711,1572,349,36,1573,1308,234,146,182,1143,56,1600,1320,3271,4733,4734,3627,3401,4140,3477,4403,3562,3407,279]);
|
|
16531
|
+
__d(function(g,r,i,a,_m,e,d){"use strict";var t=this&&this.__createBinding||(Object.create?function(t,n,o,c){void 0===c&&(c=o);var u=Object.getOwnPropertyDescriptor(n,o);u&&!("get"in u?!n.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return n[o]}}),Object.defineProperty(t,c,u)}:function(t,n,o,c){void 0===c&&(c=o),t[c]=n[o]}),n=this&&this.__exportStar||function(n,o){for(var c in n)"default"===c||Object.prototype.hasOwnProperty.call(o,c)||t(o,n,c)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(d[0]),e)},4772,[4773]);
|
|
16532
|
+
__d(function(g,r,i,a,m,e,d){"use strict";var t=r(d[0]),n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Head=void 0;const u=r(d[1]),l=(n(r(d[2])),r(d[3]));function o({children:n}){return t.jsx(l.Helmet,{children:n})}e.Head=({children:n})=>(0,u.useIsFocused)()?t.jsx(o,{children:n}):null,e.Head.Provider=l.HelmetProvider},4773,[279,1148,36,4774]);
|
|
16533
|
+
__d(function(g,r,_i,a,m,e,d){"use strict";var t=r(d[0]);const s=["children"],n=["children"];var i,o=Object.create,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyNames,u=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty,y=(t,s,n,i)=>{if(s&&"object"==typeof s||"function"==typeof s)for(let o of p(s))h.call(t,o)||o===n||c(t,o,{get:()=>s[o],enumerable:!(i=l(s,o))||i.enumerable});return t},b=(t,s,n)=>(n=null!=t?o(u(t)):{},y(!s&&t&&t.__esModule?n:c(n,"default",{value:t,enumerable:!0}),t)),f={};((t,s)=>{for(var n in s)c(t,n,{get:s[n],enumerable:!0})})(f,{Helmet:()=>Oe,HelmetData:()=>ce,HelmetProvider:()=>pe}),m.exports=(i=f,y(c({},"__esModule",{value:!0}),i));var T=b(r(d[1])),O=b(r(d[2])),A=b(r(d[3])),j=b(r(d[1])),C=b(r(d[1])),w=(t=>(t.BASE="base",t.BODY="body",t.HEAD="head",t.HTML="html",t.LINK="link",t.META="meta",t.NOSCRIPT="noscript",t.SCRIPT="script",t.STYLE="style",t.TITLE="title",t.FRAGMENT="Symbol(react.fragment)",t))(w||{}),x={rel:["amphtml","canonical","alternate"]},v={type:["application/ld+json"]},$={charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},k=Object.values(w),S={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},M=Object.entries(S).reduce((t,[s,n])=>(t[n]=s,t),{}),E="data-rh",P="defaultTitle",H="defer",D="encodeSpecialCharacters",L="onChangeClientState",I="titleTemplate",U="prioritizeSeoTags",N=(t,s)=>{for(let n=t.length-1;n>=0;n-=1){const i=t[n];if(Object.prototype.hasOwnProperty.call(i,s))return i[s]}return null},q=t=>{let s=N(t,"title");const n=N(t,I);if(Array.isArray(s)&&(s=s.join("")),n&&s)return n.replace(/%s/g,()=>s);const i=N(t,P);return s||i||void 0},_=t=>N(t,L)||(()=>{}),R=(t,s)=>s.filter(s=>void 0!==s[t]).map(s=>s[t]).reduce((t,s)=>Object.assign({},t,s),{}),z=(t,s)=>s.filter(t=>void 0!==t.base).map(t=>t.base).reverse().reduce((s,n)=>{if(!s.length){const i=Object.keys(n);for(let o=0;o<i.length;o+=1){const c=i[o].toLowerCase();if(-1!==t.indexOf(c)&&n[c])return s.concat(n)}}return s},[]),B=(t,s,n)=>{const i={};return n.filter(s=>{return!!Array.isArray(s[t])||(void 0!==s[t]&&(n=`Helmet: ${t} should be of type "Array". Instead found type "${typeof s[t]}"`,console&&"function"==typeof console.warn&&console.warn(n)),!1);var n}).map(s=>s[t]).reverse().reduce((t,n)=>{const o={};n.filter(t=>{let n;const c=Object.keys(t);for(let i=0;i<c.length;i+=1){const o=c[i],l=o.toLowerCase();-1===s.indexOf(l)||"rel"===n&&"canonical"===t[n].toLowerCase()||"rel"===l&&"stylesheet"===t[l].toLowerCase()||(n=l),-1===s.indexOf(o)||"innerHTML"!==o&&"cssText"!==o&&"itemprop"!==o||(n=o)}if(!n||!t[n])return!1;const l=t[n].toLowerCase();return i[n]||(i[n]={}),o[n]||(o[n]={}),!i[n][l]&&(o[n][l]=!0,!0)}).reverse().forEach(s=>t.push(s));const c=Object.keys(o);for(let t=0;t<c.length;t+=1){const s=c[t],n=Object.assign({},i[s],o[s]);i[s]=n}return t},[]).reverse()},F=(t,s)=>{if(Array.isArray(t)&&t.length)for(let n=0;n<t.length;n+=1){if(t[n][s])return!0}return!1},Y=t=>Array.isArray(t)?t.join(""):t,K=(t,s)=>{const n=Object.keys(t);for(let i=0;i<n.length;i+=1)if(s[n[i]]&&s[n[i]].includes(t[n[i]]))return!0;return!1},G=(t,s)=>Array.isArray(t)?t.reduce((t,n)=>(K(n,s)?t.priority.push(n):t.default.push(n),t),{priority:[],default:[]}):{default:t,priority:[]},W=(t,s)=>Object.assign({},t,{[s]:void 0}),J=["noscript","script","style"],Q=(t,s=!0)=>!1===s?String(t):String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),V=t=>Object.keys(t).reduce((s,n)=>{const i=void 0!==t[n]?`${n}="${t[n]}"`:`${n}`;return s?`${s} ${i}`:i},""),X=(t,s,n,i)=>{const o=V(n),c=Y(s);return o?`<${t} ${E}="true" ${o}>${Q(c,i)}</${t}>`:`<${t} ${E}="true">${Q(c,i)}</${t}>`},Z=(t,s,n=!0)=>s.reduce((s,i)=>{const o=i,c=Object.keys(o).filter(t=>!("innerHTML"===t||"cssText"===t)).reduce((t,s)=>{const i=void 0===o[s]?s:`${s}="${Q(o[s],n)}"`;return t?`${t} ${i}`:i},""),l=o.innerHTML||o.cssText||"",p=-1===J.indexOf(t);return`${s}<${t} ${E}="true" ${c}${p?"/>":`>${l}</${t}>`}`},""),ee=(t,s={})=>Object.keys(t).reduce((s,n)=>(s[S[n]||n]=t[n],s),s),te=(t,s,n)=>{const i=ee(n,{key:s,[E]:!0});return[C.default.createElement("title",i,s)]},re=(t,s)=>s.map((s,n)=>{const i={key:n,[E]:!0};return Object.keys(s).forEach(t=>{const n=S[t]||t;if("innerHTML"===n||"cssText"===n){const t=s.innerHTML||s.cssText;i.dangerouslySetInnerHTML={__html:t}}else i[n]=s[t]}),C.default.createElement(t,i)}),se=(t,s,n=!0)=>{switch(t){case"title":return{toComponent:()=>te(0,s.title,s.titleAttributes),toString:()=>X(t,s.title,s.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>ee(s),toString:()=>V(s)};default:return{toComponent:()=>re(t,s),toString:()=>Z(t,s,n)}}},ne=({metaTags:t,linkTags:s,scriptTags:n,encode:i})=>{const o=G(t,$),c=G(s,x),l=G(n,v);return{priorityMethods:{toComponent:()=>[...re("meta",o.priority),...re("link",c.priority),...re("script",l.priority)],toString:()=>`${se("meta",o.priority,i)} ${se("link",c.priority,i)} ${se("script",l.priority,i)}`},metaTags:o.default,linkTags:c.default,scriptTags:l.default}},ie=t=>{const{baseTag:s,bodyAttributes:n,encode:i=!0,htmlAttributes:o,noscriptTags:c,styleTags:l,title:p="",titleAttributes:u,prioritizeSeoTags:h}=t;let{linkTags:y,metaTags:b,scriptTags:f}=t,T={toComponent:()=>{},toString:()=>""};return h&&({priorityMethods:T,linkTags:y,metaTags:b,scriptTags:f}=ne(t)),{priority:T,base:se("base",s,i),bodyAttributes:se("bodyAttributes",n,i),htmlAttributes:se("htmlAttributes",o,i),link:se("link",y,i),meta:se("meta",b,i),noscript:se("noscript",c,i),script:se("script",f,i),style:se("style",l,i),title:se("title",{title:p,titleAttributes:u},i)}},oe=[],ae=!("undefined"==typeof window||!window.document||!window.document.createElement),ce=class{instances=[];canUseDOM=ae;value={setHelmet:t=>{this.context.helmet=t},helmetInstances:{get:()=>this.canUseDOM?oe:this.instances,add:t=>{(this.canUseDOM?oe:this.instances).push(t)},remove:t=>{const s=(this.canUseDOM?oe:this.instances).indexOf(t);(this.canUseDOM?oe:this.instances).splice(s,1)}}};constructor(t,s){this.context=t,this.canUseDOM=s||!1,s||(t.helmet=ie({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},le=j.default.createContext({}),pe=class t extends j.Component{static canUseDOM=ae;constructor(s){super(s),this.helmetData=new ce(this.props.context||{},t.canUseDOM)}render(){return j.default.createElement(le.Provider,{value:this.helmetData.value},this.props.children)}},ue=r(d[1]),de=b(r(d[4])),he=(t,s)=>{const n=document.head||document.querySelector("head"),i=n.querySelectorAll(`${t}[${E}]`),o=[].slice.call(i),c=[];let l;return s&&s.length&&s.forEach(s=>{const n=document.createElement(t);for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t))if("innerHTML"===t)n.innerHTML=s.innerHTML;else if("cssText"===t)n.styleSheet?n.styleSheet.cssText=s.cssText:n.appendChild(document.createTextNode(s.cssText));else{const i=t,o=void 0===s[i]?"":s[i];n.setAttribute(t,o)}n.setAttribute(E,"true"),o.some((t,s)=>(l=s,n.isEqualNode(t)))?o.splice(l,1):c.push(n)}),o.forEach(t=>t.parentNode?.removeChild(t)),c.forEach(t=>n.appendChild(t)),{oldTags:o,newTags:c}},me=(t,s)=>{const n=document.getElementsByTagName(t)[0];if(!n)return;const i=n.getAttribute(E),o=i?i.split(","):[],c=[...o],l=Object.keys(s);for(const t of l){const i=s[t]||"";n.getAttribute(t)!==i&&n.setAttribute(t,i),-1===o.indexOf(t)&&o.push(t);const l=c.indexOf(t);-1!==l&&c.splice(l,1)}for(let t=c.length-1;t>=0;t-=1)n.removeAttribute(c[t]);o.length===c.length?n.removeAttribute(E):n.getAttribute(E)!==l.join(",")&&n.setAttribute(E,l.join(","))},ge=(t,s)=>{void 0!==t&&document.title!==t&&(document.title=Y(t)),me("title",s)},ye=(t,s)=>{const{baseTag:n,bodyAttributes:i,htmlAttributes:o,linkTags:c,metaTags:l,noscriptTags:p,onChangeClientState:u,scriptTags:h,styleTags:y,title:b,titleAttributes:f}=t;me("body",i),me("html",o),ge(b,f);const T={baseTag:he("base",n),linkTags:he("link",c),metaTags:he("meta",l),noscriptTags:he("noscript",p),scriptTags:he("script",h),styleTags:he("style",y)},O={},A={};Object.keys(T).forEach(t=>{const{newTags:s,oldTags:n}=T[t];s.length&&(O[t]=s),n.length&&(A[t]=T[t].oldTags)}),s&&s(),u(t,O,A)},be=null,fe=t=>{be&&cancelAnimationFrame(be),t.defer?be=requestAnimationFrame(()=>{ye(t,()=>{be=null})}):(ye(t),be=null)},Te=class extends ue.Component{rendered=!1;shouldComponentUpdate(t){return!(0,de.default)(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:s}=this.props.context;let n=null;const i=(o=t.get().map(t=>{const s=Object.assign({},t.props);return delete s.context,s}),{baseTag:z(["href"],o),bodyAttributes:R("bodyAttributes",o),defer:N(o,H),encode:N(o,D),htmlAttributes:R("htmlAttributes",o),linkTags:B("link",["rel","href"],o),metaTags:B("meta",["name","charset","http-equiv","property","itemprop"],o),noscriptTags:B("noscript",["innerHTML"],o),onChangeClientState:_(o),scriptTags:B("script",["src","innerHTML"],o),styleTags:B("style",["cssText"],o),title:q(o),titleAttributes:R("titleAttributes",o),prioritizeSeoTags:F(o,U)});var o;pe.canUseDOM?fe(i):ie&&(n=ie(i)),s(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},Oe=class extends T.Component{static defaultProps={defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1};shouldComponentUpdate(t){return!(0,O.default)(W(this.props,"helmetData"),W(t,"helmetData"))}mapNestedChildrenToProps(t,s){if(!s)return null;switch(t.type){case"script":case"noscript":return{innerHTML:s};case"style":return{cssText:s};default:throw new Error(`<${t.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(t,s,n,i){return Object.assign({},s,{[t.type]:[...s[t.type]||[],Object.assign({},n,this.mapNestedChildrenToProps(t,i))]})}mapObjectTypeChildren(t,s,n,i){switch(t.type){case"title":return Object.assign({},s,{[t.type]:i,titleAttributes:Object.assign({},n)});case"body":return Object.assign({},s,{bodyAttributes:Object.assign({},n)});case"html":return Object.assign({},s,{htmlAttributes:Object.assign({},n)});default:return Object.assign({},s,{[t.type]:Object.assign({},n)})}}mapArrayTypeChildrenToProps(t,s){let n=Object.assign({},s);return Object.keys(t).forEach(s=>{n=Object.assign({},n,{[s]:t[s]})}),n}warnOnInvalidChildren(t,s){return(0,A.default)(k.some(s=>t.type===s),"function"==typeof t.type?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${k.join(", ")} are allowed. Helmet does not support rendering <${t.type}> elements. Refer to our API for more information.`),(0,A.default)(!s||"string"==typeof s||Array.isArray(s)&&!s.some(t=>"string"!=typeof t),`Helmet expects a string as a child of <${t.type}>. Did you forget to wrap your children in braces? ( <${t.type}>{\`\`}</${t.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(n,i){let o={};return T.default.Children.forEach(n,n=>{if(!n||!n.props)return;const c=n.props,{children:l}=c,p=t(c,s),u=Object.keys(p).reduce((t,s)=>(t[M[s]||s]=p[s],t),{});let{type:h}=n;switch("symbol"==typeof h?h=h.toString():this.warnOnInvalidChildren(n,l),h){case"Symbol(react.fragment)":i=this.mapChildrenToProps(l,i);break;case"link":case"meta":case"noscript":case"script":case"style":o=this.flattenArrayTypeChildren(n,o,u,l);break;default:i=this.mapObjectTypeChildren(n,i,u,l)}}),this.mapArrayTypeChildrenToProps(o,i)}render(){const s=this.props,{children:i}=s,o=t(s,n);let c=Object.assign({},o),{helmetData:l}=o;if(i&&(c=this.mapChildrenToProps(i,c)),l&&!(l instanceof ce)){l=new ce(l.context,!0),delete c.helmetData}return l?T.default.createElement(Te,Object.assign({},c,{context:l.value})):T.default.createElement(le.Consumer,null,t=>T.default.createElement(Te,Object.assign({},c,{context:t})))}}},4774,[35,36,4775,42,4776]);
|
|
16534
|
+
__d(function(g,r,_i,_a,m,e,d){var t='undefined'!=typeof Element,n='function'==typeof Map,f='function'==typeof Set,o='function'==typeof ArrayBuffer&&!!ArrayBuffer.isView;function i(u,a){if(u===a)return!0;if(u&&a&&'object'==typeof u&&'object'==typeof a){if(u.constructor!==a.constructor)return!1;var c,s,l,p;if(Array.isArray(u)){if((c=u.length)!=a.length)return!1;for(s=c;0!==s--;)if(!i(u[s],a[s]))return!1;return!0}if(n&&u instanceof Map&&a instanceof Map){if(u.size!==a.size)return!1;for(p=u.entries();!(s=p.next()).done;)if(!a.has(s.value[0]))return!1;for(p=u.entries();!(s=p.next()).done;)if(!i(s.value[1],a.get(s.value[0])))return!1;return!0}if(f&&u instanceof Set&&a instanceof Set){if(u.size!==a.size)return!1;for(p=u.entries();!(s=p.next()).done;)if(!a.has(s.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(u)&&ArrayBuffer.isView(a)){if((c=u.length)!=a.length)return!1;for(s=c;0!==s--;)if(u[s]!==a[s])return!1;return!0}if(u.constructor===RegExp)return u.source===a.source&&u.flags===a.flags;if(u.valueOf!==Object.prototype.valueOf&&'function'==typeof u.valueOf&&'function'==typeof a.valueOf)return u.valueOf()===a.valueOf();if(u.toString!==Object.prototype.toString&&'function'==typeof u.toString&&'function'==typeof a.toString)return u.toString()===a.toString();if((c=(l=Object.keys(u)).length)!==Object.keys(a).length)return!1;for(s=c;0!==s--;)if(!Object.prototype.hasOwnProperty.call(a,l[s]))return!1;if(t&&u instanceof Element)return!1;for(s=c;0!==s--;)if(('_owner'!==l[s]&&'__v'!==l[s]&&'__o'!==l[s]||!u.$$typeof)&&!i(u[l[s]],a[l[s]]))return!1;return!0}return u!=u&&a!=a}m.exports=function(t,n){try{return i(t,n)}catch(t){if((t.message||'').match(/stack|recursion/i))return console.warn('react-fast-compare cannot handle circular refs'),!1;throw t}}},4775,[]);
|
|
16535
|
+
__d(function(g,r,i,a,m,e,d){m.exports=function(t,n,o,f){var c=o?o.call(f,t,n):void 0;if(void 0!==c)return!!c;if(t===n)return!0;if("object"!=typeof t||!t||"object"!=typeof n||!n)return!1;var u=Object.keys(t),v=Object.keys(n);if(u.length!==v.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(n),b=0;b<u.length;b++){var p=u[b];if(!l(p))return!1;var y=t[p],j=n[p];if(!1===(c=o?o.call(f,y,j,p):void 0)||void 0===c&&y!==j)return!1}return!0}},4776,[]);
|
|
16536
|
+
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4777,[]);
|
|
16537
|
+
__d(function(g,r,_i,a,_m,_e,d){"use strict";var e,t=r(d[0]),n=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,i)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||(e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)},function(t){if(t&&t.__esModule)return t;var i={};if(null!=t)for(var c=e(t),u=0;u<c.length;u++)"default"!==c[u]&&n(i,t,c[u]);return o(i,t),i});Object.defineProperty(_e,"__esModule",{value:!0}),_e.renderRootComponent=function(e){try{setTimeout(()=>{f._internal_preventAutoHideAsync?.()}),u.startTransition(()=>{(0,c.registerRootComponent)(e)})}catch(e){f.hideAsync();const n=b(e);(0,c.registerRootComponent)(()=>t.jsx(s.View,{})),console.error(n),console.error("A runtime error has occurred while rendering the root component."),setTimeout(()=>{throw n})}};const c=r(d[1]),u=i(r(d[2])),s=r(d[3]),f=i(r(d[4]));function l(e){if('[object Object]'!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function p(e){return e&&'object'==typeof e&&'string'==typeof e.name&&'string'==typeof e.message}function b(e){return p(e)?e:l(e)?new Error(JSON.stringify(e)):new Error(String(e))}},4778,[279,973,36,1387,1431]);
|
|
16537
16538
|
__r(975);
|
|
16538
16539
|
__r(341);
|
|
16539
16540
|
__r(0);
|
|
16540
|
-
//# sourceMappingURL=/_expo/static/js/web/index-
|
|
16541
|
-
//# debugId=
|
|
16541
|
+
//# sourceMappingURL=/_expo/static/js/web/index-853ef1a7fc9c9b7a39577b79564e0896.js.map
|
|
16542
|
+
//# debugId=ed3f2c4a-0671-41a3-aa1f-06d6f5d2e9f6
|