@muyichengshayu/promptx 0.1.20 → 0.1.21

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.
@@ -0,0 +1,236 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodexSessionManagerDialog-4PTYEnnh.js","assets/index-CPEYh7Do.js","assets/index-Dd5oL2Cq.css","assets/info-DUErgVjs.js","assets/TaskDiffReviewDialog-DJeBWA9i.js","assets/WorkbenchSettingsDialog-D_Lykg61.js"])))=>i.map(i=>d[i]);
2
+ import{h as Xn,w as Ee,o as at,a as T,c as Se,b as O,d as p,n as we,e as oe,u as l,t as E,f as xe,g as Ue,T as cu,i as ce,j as kt,F as ht,r as Dt,k as sn,l as du,m as Iu,p as au,q as mn,s as V,v as Ie,x as Pe,y as Zt,z as Ju,A as To,B as St,C as wn,D as br,E as Sn,G as mi,H as Yn,_ as Jn,I as Fu,J as gi,K as bi,L as vi,M as ou,N as ru,O as Eo}from"./index-CPEYh7Do.js";/**
3
+ * @license lucide-vue-next v0.577.0 - ISC
4
+ *
5
+ * This source code is licensed under the ISC license.
6
+ * See the LICENSE file in the root directory of this source tree.
7
+ */const xi=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
8
+ * @license lucide-vue-next v0.577.0 - ISC
9
+ *
10
+ * This source code is licensed under the ISC license.
11
+ * See the LICENSE file in the root directory of this source tree.
12
+ */const Ao=e=>e==="";/**
13
+ * @license lucide-vue-next v0.577.0 - ISC
14
+ *
15
+ * This source code is licensed under the ISC license.
16
+ * See the LICENSE file in the root directory of this source tree.
17
+ */const yi=(...e)=>e.filter((t,u,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===u).join(" ").trim();/**
18
+ * @license lucide-vue-next v0.577.0 - ISC
19
+ *
20
+ * This source code is licensed under the ISC license.
21
+ * See the LICENSE file in the root directory of this source tree.
22
+ */const Do=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
23
+ * @license lucide-vue-next v0.577.0 - ISC
24
+ *
25
+ * This source code is licensed under the ISC license.
26
+ * See the LICENSE file in the root directory of this source tree.
27
+ */const ki=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,u,n)=>n?n.toUpperCase():u.toLowerCase());/**
28
+ * @license lucide-vue-next v0.577.0 - ISC
29
+ *
30
+ * This source code is licensed under the ISC license.
31
+ * See the LICENSE file in the root directory of this source tree.
32
+ */const _i=e=>{const t=ki(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
33
+ * @license lucide-vue-next v0.577.0 - ISC
34
+ *
35
+ * This source code is licensed under the ISC license.
36
+ * See the LICENSE file in the root directory of this source tree.
37
+ */var Eu={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
38
+ * @license lucide-vue-next v0.577.0 - ISC
39
+ *
40
+ * This source code is licensed under the ISC license.
41
+ * See the LICENSE file in the root directory of this source tree.
42
+ */const wi=({name:e,iconNode:t,absoluteStrokeWidth:u,"absolute-stroke-width":n,strokeWidth:r,"stroke-width":o,size:i=Eu.width,color:s=Eu.stroke,...a},{slots:d})=>Xn("svg",{...Eu,...a,width:i,height:i,stroke:s,"stroke-width":Ao(u)||Ao(n)||u===!0||n===!0?Number(r||o||Eu["stroke-width"])*24/Number(i):r||o||Eu["stroke-width"],class:yi("lucide",a.class,...e?[`lucide-${Do(_i(e))}-icon`,`lucide-${Do(e)}`]:["lucide-icon"]),...!d.default&&!xi(a)&&{"aria-hidden":"true"}},[...t.map(c=>Xn(...c)),...d.default?[d.default()]:[]]);/**
43
+ * @license lucide-vue-next v0.577.0 - ISC
44
+ *
45
+ * This source code is licensed under the ISC license.
46
+ * See the LICENSE file in the root directory of this source tree.
47
+ */const $e=(e,t)=>(u,{slots:n,attrs:r})=>Xn(wi,{...r,...u,iconNode:t,name:e},n);/**
48
+ * @license lucide-vue-next v0.577.0 - ISC
49
+ *
50
+ * This source code is licensed under the ISC license.
51
+ * See the LICENSE file in the root directory of this source tree.
52
+ */const Si=$e("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
53
+ * @license lucide-vue-next v0.577.0 - ISC
54
+ *
55
+ * This source code is licensed under the ISC license.
56
+ * See the LICENSE file in the root directory of this source tree.
57
+ */const Ci=$e("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
58
+ * @license lucide-vue-next v0.577.0 - ISC
59
+ *
60
+ * This source code is licensed under the ISC license.
61
+ * See the LICENSE file in the root directory of this source tree.
62
+ */const Ti=$e("arrow-up-left",[["path",{d:"M7 17V7h10",key:"11bw93"}],["path",{d:"M17 17 7 7",key:"2786uv"}]]);/**
63
+ * @license lucide-vue-next v0.577.0 - ISC
64
+ *
65
+ * This source code is licensed under the ISC license.
66
+ * See the LICENSE file in the root directory of this source tree.
67
+ */const Io=$e("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);/**
68
+ * @license lucide-vue-next v0.577.0 - ISC
69
+ *
70
+ * This source code is licensed under the ISC license.
71
+ * See the LICENSE file in the root directory of this source tree.
72
+ */const Ei=$e("blocks",[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]]);/**
73
+ * @license lucide-vue-next v0.577.0 - ISC
74
+ *
75
+ * This source code is licensed under the ISC license.
76
+ * See the LICENSE file in the root directory of this source tree.
77
+ */const Ai=$e("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
78
+ * @license lucide-vue-next v0.577.0 - ISC
79
+ *
80
+ * This source code is licensed under the ISC license.
81
+ * See the LICENSE file in the root directory of this source tree.
82
+ */const Di=$e("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
83
+ * @license lucide-vue-next v0.577.0 - ISC
84
+ *
85
+ * This source code is licensed under the ISC license.
86
+ * See the LICENSE file in the root directory of this source tree.
87
+ */const Mu=$e("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
88
+ * @license lucide-vue-next v0.577.0 - ISC
89
+ *
90
+ * This source code is licensed under the ISC license.
91
+ * See the LICENSE file in the root directory of this source tree.
92
+ */const Ii=$e("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
93
+ * @license lucide-vue-next v0.577.0 - ISC
94
+ *
95
+ * This source code is licensed under the ISC license.
96
+ * See the LICENSE file in the root directory of this source tree.
97
+ */const Pn=$e("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
98
+ * @license lucide-vue-next v0.577.0 - ISC
99
+ *
100
+ * This source code is licensed under the ISC license.
101
+ * See the LICENSE file in the root directory of this source tree.
102
+ */const vr=$e("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
103
+ * @license lucide-vue-next v0.577.0 - ISC
104
+ *
105
+ * This source code is licensed under the ISC license.
106
+ * See the LICENSE file in the root directory of this source tree.
107
+ */const Fi=$e("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
108
+ * @license lucide-vue-next v0.577.0 - ISC
109
+ *
110
+ * This source code is licensed under the ISC license.
111
+ * See the LICENSE file in the root directory of this source tree.
112
+ */const $i=$e("circle-stop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);/**
113
+ * @license lucide-vue-next v0.577.0 - ISC
114
+ *
115
+ * This source code is licensed under the ISC license.
116
+ * See the LICENSE file in the root directory of this source tree.
117
+ */const gn=$e("clock-3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]);/**
118
+ * @license lucide-vue-next v0.577.0 - ISC
119
+ *
120
+ * This source code is licensed under the ISC license.
121
+ * See the LICENSE file in the root directory of this source tree.
122
+ */const Fo=$e("file-diff",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);/**
123
+ * @license lucide-vue-next v0.577.0 - ISC
124
+ *
125
+ * This source code is licensed under the ISC license.
126
+ * See the LICENSE file in the root directory of this source tree.
127
+ */const Qn=$e("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
128
+ * @license lucide-vue-next v0.577.0 - ISC
129
+ *
130
+ * This source code is licensed under the ISC license.
131
+ * See the LICENSE file in the root directory of this source tree.
132
+ */const Bn=$e("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);/**
133
+ * @license lucide-vue-next v0.577.0 - ISC
134
+ *
135
+ * This source code is licensed under the ISC license.
136
+ * See the LICENSE file in the root directory of this source tree.
137
+ */const Qu=$e("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
138
+ * @license lucide-vue-next v0.577.0 - ISC
139
+ *
140
+ * This source code is licensed under the ISC license.
141
+ * See the LICENSE file in the root directory of this source tree.
142
+ */const co=$e("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
143
+ * @license lucide-vue-next v0.577.0 - ISC
144
+ *
145
+ * This source code is licensed under the ISC license.
146
+ * See the LICENSE file in the root directory of this source tree.
147
+ */const Lt=$e("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
148
+ * @license lucide-vue-next v0.577.0 - ISC
149
+ *
150
+ * This source code is licensed under the ISC license.
151
+ * See the LICENSE file in the root directory of this source tree.
152
+ */const xr=$e("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]);/**
153
+ * @license lucide-vue-next v0.577.0 - ISC
154
+ *
155
+ * This source code is licensed under the ISC license.
156
+ * See the LICENSE file in the root directory of this source tree.
157
+ */const Bu=$e("pencil-line",[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);/**
158
+ * @license lucide-vue-next v0.577.0 - ISC
159
+ *
160
+ * This source code is licensed under the ISC license.
161
+ * See the LICENSE file in the root directory of this source tree.
162
+ */const yr=$e("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
163
+ * @license lucide-vue-next v0.577.0 - ISC
164
+ *
165
+ * This source code is licensed under the ISC license.
166
+ * See the LICENSE file in the root directory of this source tree.
167
+ */const Mi=$e("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
168
+ * @license lucide-vue-next v0.577.0 - ISC
169
+ *
170
+ * This source code is licensed under the ISC license.
171
+ * See the LICENSE file in the root directory of this source tree.
172
+ */const Pi=$e("scan-text",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["path",{d:"M7 8h8",key:"1jbsf9"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h6",key:"1vyc9m"}]]);/**
173
+ * @license lucide-vue-next v0.577.0 - ISC
174
+ *
175
+ * This source code is licensed under the ISC license.
176
+ * See the LICENSE file in the root directory of this source tree.
177
+ */const Bi=$e("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);/**
178
+ * @license lucide-vue-next v0.577.0 - ISC
179
+ *
180
+ * This source code is licensed under the ISC license.
181
+ * See the LICENSE file in the root directory of this source tree.
182
+ */const Ri=$e("send-horizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);/**
183
+ * @license lucide-vue-next v0.577.0 - ISC
184
+ *
185
+ * This source code is licensed under the ISC license.
186
+ * See the LICENSE file in the root directory of this source tree.
187
+ */const Li=$e("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
188
+ * @license lucide-vue-next v0.577.0 - ISC
189
+ *
190
+ * This source code is licensed under the ISC license.
191
+ * See the LICENSE file in the root directory of this source tree.
192
+ */const Pu=$e("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/**
193
+ * @license lucide-vue-next v0.577.0 - ISC
194
+ *
195
+ * This source code is licensed under the ISC license.
196
+ * See the LICENSE file in the root directory of this source tree.
197
+ */const Ni=$e("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
198
+ * @license lucide-vue-next v0.577.0 - ISC
199
+ *
200
+ * This source code is licensed under the ISC license.
201
+ * See the LICENSE file in the root directory of this source tree.
202
+ */const Oi=$e("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);/**
203
+ * @license lucide-vue-next v0.577.0 - ISC
204
+ *
205
+ * This source code is licensed under the ISC license.
206
+ * See the LICENSE file in the root directory of this source tree.
207
+ */const zi=$e("wand-sparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
208
+ * @license lucide-vue-next v0.577.0 - ISC
209
+ *
210
+ * This source code is licensed under the ISC license.
211
+ * See the LICENSE file in the root directory of this source tree.
212
+ */const Cn=$e("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),qi={class:"panel w-full max-w-md overflow-hidden"},Ui={class:"theme-divider flex items-start justify-between gap-3 border-b px-5 py-4"},ji={class:"flex items-start gap-3"},Vi={class:"theme-heading text-base font-semibold"},Hi={key:0,class:"theme-muted-text mt-1 text-sm leading-6"},Wi=["disabled"],Ki={class:"flex justify-end gap-2 px-5 py-4"},Gi=["disabled"],Zi=["disabled"],en={__name:"ConfirmDialog",props:{open:{type:Boolean,default:!1},title:{type:String,default:""},description:{type:String,default:""},confirmText:{type:String,default:""},cancelText:{type:String,default:""},loading:{type:Boolean,default:!1},danger:{type:Boolean,default:!1}},emits:["cancel","confirm"],setup(e,{emit:t}){const u=e,n=t,{t:r}=kt(),o=ce(()=>u.title||r("common.confirm")),i=ce(()=>u.confirmText||r("common.confirm")),s=ce(()=>u.cancelText||r("common.cancel"));function a(d){!u.open||u.loading||d.key==="Escape"&&n("cancel")}return Ee(()=>u.open,d=>{if(document.body.classList.toggle("overflow-hidden",d),d){window.addEventListener("keydown",a);return}window.removeEventListener("keydown",a)}),at(()=>{document.body.classList.remove("overflow-hidden"),window.removeEventListener("keydown",a)}),(d,c)=>(T(),Se(cu,{to:"body"},[e.open?(T(),O("div",{key:0,class:"theme-modal-backdrop fixed inset-0 z-[90] flex items-center justify-center px-4",onClick:c[3]||(c[3]=Ue(f=>!e.loading&&n("cancel"),["self"]))},[p("section",qi,[p("div",Ui,[p("div",ji,[p("span",{class:we(["inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-sm border border-dashed",e.danger?"theme-status-danger":"theme-status-neutral"])},[oe(l(Ni),{class:"h-4 w-4"})],2),p("div",null,[p("h2",Vi,E(o.value),1),e.description?(T(),O("p",Hi,E(e.description),1)):xe("",!0)])]),p("button",{type:"button",class:"theme-icon-button h-8 w-8",disabled:e.loading,onClick:c[0]||(c[0]=f=>n("cancel"))},[oe(l(Cn),{class:"h-4 w-4"})],8,Wi)]),p("div",Ki,[p("button",{type:"button",class:"tool-button px-4 py-2 text-sm",disabled:e.loading,onClick:c[1]||(c[1]=f=>n("cancel"))},E(s.value),9,Gi),p("button",{type:"button",class:we(["tool-button px-4 py-2 text-sm",e.danger?"tool-button-danger":"tool-button-primary"]),disabled:e.loading,onClick:c[2]||(c[2]=f=>n("confirm"))},E(e.loading?l(r)("common.processing"):i.value),11,Zi)])])])):xe("",!0)]))}},jt={NONE:"none",LATEST:"latest",ALL:"all"};function Xi(e="",t={}){const u=String(e||"").trim().toLowerCase();return u===jt.ALL?jt.ALL:u===jt.LATEST?jt.LATEST:u===jt.NONE?jt.NONE:t.includeEvents?jt.ALL:t.includeLatestEvents?jt.LATEST:jt.NONE}const wt={SESSION:"session",SESSION_UPDATED:"session.updated",STATUS:"status",STDOUT:"stdout",STDERR:"stderr",AGENT_EVENT:"agent_event",COMPLETED:"completed",STOPPED:"stopped",ERROR:"error"};function kr(e=""){const t=String(e||"").trim().toLowerCase();return t==="codex"?wt.AGENT_EVENT:t}const Je={THREAD_STARTED:"thread.started",TURN_STARTED:"turn.started",TURN_COMPLETED:"turn.completed",TURN_FAILED:"turn.failed",ERROR:"error",ITEM_STARTED:"item.started",ITEM_UPDATED:"item.updated",ITEM_COMPLETED:"item.completed"},Le={REASONING:"reasoning",WEB_SEARCH:"web_search",COLLAB_TOOL_CALL:"collab_tool_call",FILE_CHANGE:"file_change",COMMAND_EXECUTION:"command_execution",TODO_LIST:"todo_list",AGENT_MESSAGE:"agent_message"},Yi={none:{label:"不过期",hours:null}};Object.entries(Yi).map(([e,t])=>({value:e,label:t.label}));const an={CODEX:"codex",CLAUDE_CODE:"claude-code",OPENCODE:"opencode"},_r=[{value:an.CODEX,label:"Codex",enabled:!0},{value:an.CLAUDE_CODE,label:"Claude Code",enabled:!0},{value:an.OPENCODE,label:"OpenCode",enabled:!0}],Me={TEXT:"text",IMAGE:"image",IMPORTED_TEXT:"imported_text"};Me.TEXT+"",Me.IMAGE+"",Me.IMPORTED_TEXT+"";const Ji=[{value:"local",label:"跟随本机时区"}],Qi={SKIP:"skip"},es=[{value:Qi.SKIP,label:"已有运行时跳过本次"}],Rn={DINGTALK:"dingtalk",FEISHU:"feishu",WEBHOOK:"webhook"},ts=[{value:Rn.DINGTALK,label:"钉钉 Webhook"},{value:Rn.FEISHU,label:"飞书 Webhook"},{value:Rn.WEBHOOK,label:"通用 Webhook"}],Ln={COMPLETED:"completed",SUCCESS:"success",ERROR:"error"},us=[{value:Ln.COMPLETED,label:"本次运行结束后"},{value:Ln.SUCCESS,label:"本次运行成功后"},{value:Ln.ERROR,label:"本次运行失败后"}],ns={SUMMARY:"summary"},os=[{value:ns.SUMMARY,label:"摘要消息"}],$o={ZH_CN:"zh-CN",EN_US:"en-US"},rs=[{value:$o.ZH_CN,label:"简体中文"},{value:$o.EN_US,label:"English"}];function wr(e){var u;const t=String(e||"").trim().toLowerCase();return((u=_r.find(n=>n.value===t))==null?void 0:u.value)||an.CODEX}function We(e){var t;return((t=_r.find(u=>u.value===wr(e)))==null?void 0:t.label)||"Codex"}function is(e=[],t=10){const u=e.find(n=>{var r;return(n.type===Me.TEXT||n.type===Me.IMPORTED_TEXT)&&((r=n.content)==null?void 0:r.trim())});return u?u.content.replace(/\s+/g," ").trim().slice(0,t):""}const ss={class:"theme-divider settings-dialog-nav border-b px-3 py-3 sm:w-60 sm:shrink-0 sm:border-b-0 sm:border-r sm:px-4 sm:py-4"},as={class:"settings-nav flex gap-2 overflow-x-auto sm:flex-col sm:overflow-visible"},ls=["onClick"],cs={class:"min-w-0"},ds={class:"text-sm font-medium"},fs={class:"theme-muted-text mt-1 hidden text-xs leading-5 sm:block"},ps={__name:"DialogSideNav",props:{modelValue:{type:String,default:""},sections:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(e,{emit:t}){const u=t;function n(r=""){u("update:modelValue",String(r||""))}return(r,o)=>(T(),O("aside",ss,[p("nav",as,[(T(!0),O(ht,null,Dt(e.sections,i=>(T(),O("button",{key:i.id,type:"button",class:we(["settings-nav__item flex min-w-0 items-start gap-3 rounded-sm border px-3 py-3 text-left transition sm:w-full",e.modelValue===i.id?"theme-card-selected":"theme-card-idle-muted border-dashed hover:border-[var(--theme-borderStrong)] hover:bg-[var(--theme-appPanelStrong)]"]),onClick:s=>n(i.id)},[(T(),Se(sn(i.icon),{class:"mt-0.5 h-4 w-4 shrink-0"})),p("div",cs,[p("div",ds,E(i.label),1),p("p",fs,E(i.description),1)])],10,ls))),128))])]))}},hs=["disabled","onKeydown"],ms={class:"min-w-0 flex-1"},gs={class:"theme-muted-text text-sm"},bs={class:"flex min-h-0 w-full flex-col"},vs={class:"min-h-0 flex-1 space-y-2 overflow-y-auto p-2"},xs=["onClick"],ys={class:"theme-empty-state px-3 py-4 text-sm"},Ht={__name:"WorkbenchSelect",props:{modelValue:{type:[String,Number],default:""},options:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:""},emptyText:{type:String,default:""},getOptionValue:{type:Function,default:e=>(e==null?void 0:e.id)??(e==null?void 0:e.value)??""}},emits:["update:modelValue","refresh-intent"],setup(e,{emit:t}){const u=e,n=t,{t:r}=kt(),o=V(null),i=V(null),s=V(!1),a=V(!1),d=V({}),c=ce(()=>{const $=String(u.modelValue??"");return u.options.find(te=>String(u.getOptionValue(te)??"")===$)||null}),f=ce(()=>u.placeholder||r("common.select")),m=ce(()=>u.emptyText||r("common.noOptions"));function k($){return $&&typeof $=="object"&&Object.prototype.hasOwnProperty.call($,"label")?String($.label||""):String(u.getOptionValue($)??"")}function g(){u.disabled||(s.value||n("refresh-intent"),s.value=!0)}function F(){s.value=!1}function B(){if(s.value){F();return}g()}function x($){n("update:modelValue",String(u.getOptionValue($)??"").trim()),F()}function v(){if(!s.value||!o.value||typeof window>"u")return;const $=o.value.getBoundingClientRect(),te=window.innerWidth,C=window.innerHeight,Q=8,J=8,N=160,z=360,ue=Math.max(0,C-$.bottom-J),ae=Math.max(0,$.top-J);a.value=ue<260&&ae>ue;const ge=a.value?ae-Q:ue-Q,de=Math.max(Math.min(z,Math.max(ge,0)),Math.min(N,a.value?ae:ue)),ke=Math.min($.width,te-J*2),U=Math.min(Math.max(J,$.left),Math.max(J,te-J-ke));d.value={left:`${U}px`,top:a.value?`${$.top-Q}px`:`${$.bottom+Q}px`,width:`${ke}px`,maxHeight:`${Math.max(de,120)}px`,transform:a.value?"translateY(-100%)":"none"}}function D($){var te;!s.value||!o.value||o.value.contains($.target)||(te=i.value)!=null&&te.contains($.target)||F()}function L($){$.key==="Escape"&&F()}return Ee(()=>u.disabled,$=>{$&&F()}),Ee(s,async $=>{$&&(await Ie(),v())}),du(()=>{document.addEventListener("pointerdown",D),document.addEventListener("keydown",L),window.addEventListener("resize",v),window.addEventListener("scroll",v,!0)}),at(()=>{document.removeEventListener("pointerdown",D),document.removeEventListener("keydown",L),window.removeEventListener("resize",v),window.removeEventListener("scroll",v,!0)}),($,te)=>(T(),O("div",{ref_key:"rootRef",ref:o,class:"relative min-w-0"},[p("button",{type:"button",class:we(["workbench-select-trigger flex w-full items-center gap-3 rounded-sm border px-3 py-2 text-left transition focus:outline-none focus:ring-2",e.disabled?"cursor-not-allowed border-[color-mix(in_srgb,var(--theme-borderDefault)_88%,var(--theme-textMuted))] bg-[color-mix(in_srgb,var(--theme-appPanelMuted)_82%,var(--theme-appBg))] text-[var(--theme-textMuted)]":"theme-input-shell text-[var(--theme-textPrimary)] hover:border-[var(--theme-borderStrong)] focus:border-[var(--theme-borderStrong)] focus:ring-[var(--theme-focusRing)]"]),disabled:e.disabled,onClick:B,onKeydown:[au(Ue(g,["prevent"]),["down"]),au(Ue(B,["prevent"]),["enter"]),au(Ue(B,["prevent"]),["space"])]},[p("div",ms,[Iu($.$slots,"trigger",{selectedOption:c.value,open:s.value,loading:e.loading,disabled:e.disabled},()=>[p("div",gs,E(c.value?k(c.value):f.value),1)])]),p("div",{class:we(["flex shrink-0 items-center gap-2",e.disabled?"text-[var(--theme-textMuted)] opacity-80":"theme-muted-text"])},[e.loading?(T(),Se(l(Lt),{key:0,class:"h-4 w-4 animate-spin"})):xe("",!0),oe(l(Mu),{class:we(["h-4 w-4 transition",s.value?"rotate-180":""])},null,8,["class"])],2)],42,hs),(T(),Se(cu,{to:"body"},[s.value?(T(),O("div",{key:0,ref_key:"panelRef",ref:i,class:"workbench-select-panel theme-popover fixed z-[90] flex overflow-hidden rounded-sm border",style:mn(d.value)},[p("div",bs,[Iu($.$slots,"header",{loading:e.loading,options:e.options}),p("div",vs,[e.options.length?(T(!0),O(ht,{key:0},Dt(e.options,C=>Iu($.$slots,"option",{key:String(e.getOptionValue(C)??""),option:C,selected:String(e.getOptionValue(C)??"")===String(e.modelValue??""),select:()=>x(C)},()=>[p("button",{type:"button",class:"workbench-select-option theme-filter-idle w-full rounded-sm border border-dashed px-3 py-2 text-left text-sm",onClick:Q=>x(C)},E(k(C)),9,xs)])),128)):Iu($.$slots,"empty",{key:1},()=>[p("div",ys,E(m.value),1)])])])],4)):xe("",!0)]))],512))}},Mo={},Sr=typeof import.meta<"u"&&Mo?Mo:{};function ks(){if(typeof window>"u")return"http://localhost:3000";const e=new URL(window.location.origin),t=String(Sr.VITE_API_PORT||"").trim();if(t)return e.port=t,e.toString().replace(/\/$/,"");const u=String(e.port||"");return new Set(["4173","5173","5174"]).has(u)?(e.port="3000",e.toString().replace(/\/$/,"")):e.toString().replace(/\/$/,"")}const fo=(Sr.VITE_API_BASE_URL||ks()).replace(/\/$/,"");function po(e={},t="errors.requestFailed"){const u=String((e==null?void 0:e.messageKey)||"").trim();if(u){const n=Pe(u);if(n&&n!==u)return n}return(e==null?void 0:e.message)||Pe(t)}async function je(e,t={}){const u=typeof t.body<"u"&&!(t.body instanceof FormData),n=await fetch(`${fo}${e}`,{headers:{...u?{"Content-Type":"application/json"}:{},...t.headers||{}},...t});if(!n.ok){const o=await n.json().catch(()=>({}));throw new Error(po(o))}return n.status===204?null:(n.headers.get("content-type")||"").includes("application/json")?n.json():n.text()}function ho(){return fo}function ln(e){return e?e.startsWith("http")?e:`${fo}${e}`:""}function um(){return je("/api/meta",{cache:"no-store"})}function _s(){return je("/api/tasks")}function ws(e=30){const t=new URLSearchParams,u=Math.max(1,Number(e)||30);return t.set("limit",String(u)),je(`/api/tasks/workspace-diff-summaries?${t.toString()}`,{cache:"no-store"})}function Ss(e){return je("/api/tasks",{method:"POST",body:JSON.stringify(e)})}function Cr(e){return je(`/api/tasks/${e}`)}function Tr(e,t){return je(`/api/tasks/${e}`,{method:"PUT",body:JSON.stringify(t)})}function Cs(e){return je(`/api/tasks/${e}`,{method:"DELETE"})}const Er=ho();async function Ts(e){const t=new FormData;t.append("file",e);const u=await fetch(`${Er}/api/uploads`,{method:"POST",body:t});if(!u.ok){const n=await u.json().catch(()=>({}));throw new Error(po(n,"errors.uploadFailed"))}return u.json()}async function Es(e){const t=new FormData;t.append("file",e);const u=await fetch(`${Er}/api/imports/pdf`,{method:"POST",body:t});if(!u.ok){const n=await u.json().catch(()=>({}));throw new Error(po(n,"errors.pdfImportFailed"))}return u.json()}function As(){return je("/api/codex/sessions")}function Ds(e={}){const t=new URLSearchParams,u=String(e.engine||"").trim();u&&t.set("engine",u);const n=t.toString();return je(`/api/codex/workspaces${n?`?${n}`:""}`)}function nm(e={}){const t=new URLSearchParams,u=String(e.path||"").trim(),n=Number(e.limit||0);u&&t.set("path",u),Number.isFinite(n)&&n>0&&t.set("limit",String(n));const r=t.toString();return je(`/api/codex/directories/tree${r?`?${r}`:""}`,{cache:"no-store"})}function om(e,t={}){const u=new URLSearchParams,n=String(e||"").trim(),r=String(t.path||"").trim(),o=Number(t.limit||0);n&&u.set("q",n),r&&u.set("path",r),Number.isFinite(o)&&o>0&&u.set("limit",String(o));const i=u.toString();return je(`/api/codex/directories/search${i?`?${i}`:""}`,{cache:"no-store"})}function Is(e){return je("/api/codex/sessions",{method:"POST",body:JSON.stringify(e)})}function Fs(e,t){return je(`/api/codex/sessions/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}function $s(e){return je(`/api/codex/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})}function Ms(e,t={}){const u=new URLSearchParams,n=String(t.path||"").trim(),r=String(t.refreshToken||"").trim();n&&u.set("path",n),r&&u.set("_",r);const o=u.toString();return je(`/api/codex/sessions/${encodeURIComponent(e)}/files/tree${o?`?${o}`:""}`,{cache:"no-store"})}function Ps(e,t,u={}){const n=new URLSearchParams,r=String(t||"").trim(),o=Number(u.limit||60),i=String(u.refreshToken||"").trim();r&&n.set("q",r),Number.isFinite(o)&&o>0&&n.set("limit",String(o)),i&&n.set("_",i);const s=n.toString();return je(`/api/codex/sessions/${encodeURIComponent(e)}/files/search${s?`?${s}`:""}`,{cache:"no-store"})}function Bs(e,t){return je(`/api/tasks/${encodeURIComponent(e)}/codex-session`,{method:"POST",body:JSON.stringify({sessionId:t})})}function Rs(e,t={}){const u=new URLSearchParams,n=Number(t.limit||20),r=Xi(t.events,t);Number.isFinite(n)&&n>0&&u.set("limit",String(n)),u.set("events",r);const o=u.toString();return je(`/api/tasks/${encodeURIComponent(e)}/codex-runs${o?`?${o}`:""}`,{cache:"no-store"})}function Ls(e,t={}){const u=new URLSearchParams,n=Math.max(0,Number(t.afterSeq)||0),r=Math.max(1,Number(t.limit)||5e3);n>0&&u.set("afterSeq",String(n)),r>0&&u.set("limit",String(r));const o=u.toString();return je(`/api/codex/runs/${encodeURIComponent(e)}/events${o?`?${o}`:""}`,{cache:"no-store"})}function rm(e,t={}){const u=new URLSearchParams,n=String(t.scope||"workspace").trim(),r=String(t.runId||"").trim(),o=String(t.filePath||"").trim(),i=t.includeFiles!==!1,s=t.includeStats!==!1;n==="run"?u.set("scope","run"):n==="task"?u.set("scope","task"):u.set("scope","workspace"),r&&u.set("runId",r),o&&u.set("filePath",o),i||u.set("includeFiles","false"),s||u.set("includeStats","false");const a=u.toString();return je(`/api/tasks/${encodeURIComponent(e)}/git-diff${a?`?${a}`:""}`,{cache:"no-store"})}function Ns(e,t){return je(`/api/tasks/${encodeURIComponent(e)}/codex-runs`,{method:"POST",body:JSON.stringify(t)})}function Os(e){return je(`/api/tasks/${encodeURIComponent(e)}/codex-runs`,{method:"DELETE"})}function zs(e){return je(`/api/codex/runs/${encodeURIComponent(e)}/stop`,{method:"POST"})}const qs={class:"panel settings-dialog-panel flex h-full w-full max-w-5xl flex-col overflow-hidden sm:h-[42rem] sm:max-h-[88vh]"},Us={class:"theme-divider settings-dialog-header flex items-start justify-between gap-4 border-b px-5 py-4"},js={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},Vs={class:"theme-muted-text mt-1 text-xs"},Hs={class:"settings-dialog-body min-h-0 flex flex-1 flex-col sm:flex-row"},Ws={class:"settings-dialog-content min-h-0 flex-1 overflow-y-auto px-5 py-5"},Ks={key:0,class:"theme-muted-text flex items-center gap-2 py-4 text-sm"},Gs={key:1,class:"space-y-4"},Zs={key:0,class:"space-y-4"},Xs={class:"theme-heading text-base font-medium"},Ys={class:"theme-muted-text mt-1 text-xs leading-5"},Js={class:"settings-section-card px-4 py-4"},Qs={class:"block space-y-1.5"},ea={class:"theme-muted-text text-xs"},ta=["placeholder"],ua={key:1,class:"space-y-4"},na={class:"flex items-start justify-between gap-3"},oa={class:"theme-heading inline-flex items-center gap-2 text-base font-medium"},ra={class:"theme-muted-text mt-1 text-xs leading-5"},ia={class:"inline-flex items-center gap-2 text-sm text-[var(--theme-textPrimary)]"},sa={class:"settings-section-card px-4 py-4"},aa={class:"grid gap-4 sm:grid-cols-2"},la={class:"space-y-1.5 sm:col-span-2"},ca={class:"theme-muted-text text-xs"},da={class:"truncate text-sm text-[var(--theme-textPrimary)]"},fa={class:"space-y-1.5"},pa={class:"theme-muted-text text-xs"},ha=["disabled"],ma={key:0,class:"space-y-1.5"},ga={class:"theme-muted-text text-xs"},ba={class:"truncate text-sm text-[var(--theme-textPrimary)]"},va={class:"space-y-1.5"},xa={class:"theme-muted-text text-xs"},ya={class:"truncate text-sm text-[var(--theme-textPrimary)]"},ka={class:"theme-muted-text text-xs"},_a={class:"truncate text-sm text-[var(--theme-textPrimary)]"},wa={class:"theme-muted-text mt-3 space-y-1 text-xs leading-6"},Sa={key:2,class:"space-y-4"},Ca={class:"flex items-start justify-between gap-3"},Ta={class:"theme-heading inline-flex items-center gap-2 text-base font-medium"},Ea={class:"theme-muted-text mt-1 text-xs leading-5"},Aa={class:"inline-flex items-center gap-2 text-sm text-[var(--theme-textPrimary)]"},Da={class:"settings-section-card px-4 py-4"},Ia={class:"grid gap-4 sm:grid-cols-2"},Fa={class:"space-y-1.5"},$a={class:"theme-muted-text text-xs"},Ma={class:"truncate text-sm text-[var(--theme-textPrimary)]"},Pa={class:"space-y-1.5"},Ba={class:"theme-muted-text text-xs"},Ra={class:"truncate text-sm text-[var(--theme-textPrimary)]"},La={class:"space-y-1.5 sm:col-span-2"},Na={class:"theme-muted-text text-xs"},Oa=["placeholder","disabled"],za={class:"space-y-1.5"},qa={class:"theme-muted-text text-xs"},Ua=["placeholder","disabled"],ja={class:"space-y-1.5"},Va={class:"theme-muted-text text-xs"},Ha={class:"truncate text-sm text-[var(--theme-textPrimary)]"},Wa={class:"space-y-1.5"},Ka={class:"theme-muted-text text-xs"},Ga={class:"truncate text-sm text-[var(--theme-textPrimary)]"},Za={class:"theme-muted-text mt-3 space-y-1 text-xs leading-6"},Xa={key:0,class:"theme-danger-text"},Ya={key:3,class:"theme-danger-text text-sm"},Ja={class:"theme-divider flex flex-col gap-3 border-t px-5 py-4 sm:flex-row sm:items-center sm:justify-between"},Qa={class:"theme-muted-text theme-note-text"},el={class:"flex items-center justify-end gap-2"},tl=["disabled"],ul=["disabled"],nl="0 9 * * 1-5",Nn="weekdays",Au="09:00",gu="1",ol={__name:"EditTaskDialog",props:{open:{type:Boolean,default:!1},taskSlug:{type:String,default:""},taskTitle:{type:String,default:""}},emits:["close","saved"],setup(e,{emit:t}){const u=e,n=t,{locale:r,t:o}=kt(),i=V(!1),s=V(!1),a=V(""),d=V("basic"),c=wn({title:"",automationEnabled:!1,automationMode:Nn,automationTime:Au,automationWeekday:gu,automationTimezone:"local",automationConcurrencyPolicy:"skip",automationLastTriggeredAt:"",automationNextTriggerAt:"",notificationEnabled:!1,notificationChannelType:"dingtalk",notificationWebhookUrl:"",notificationSecret:"",notificationTriggerOn:"completed",notificationLocale:"zh-CN",notificationMessageMode:"summary",notificationLastStatus:"",notificationLastError:"",notificationLastSentAt:""}),f=ce(()=>String(u.taskTitle||"").trim()||o("workbench.untitledTask")),m=ce(()=>[{id:"basic",label:o("taskDialog.sections.basic.label"),description:o("taskDialog.sections.basic.description"),icon:Bu},{id:"automation",label:o("taskDialog.sections.automation.label"),description:o("taskDialog.sections.automation.description"),icon:gn},{id:"notification",label:o("taskDialog.sections.notification.label"),description:o("taskDialog.sections.notification.description"),icon:Io}]),k=ce(()=>[{value:"daily",label:o("taskDialog.sections.automation.modeDaily")},{value:"weekdays",label:o("taskDialog.sections.automation.modeWeekdays")},{value:"weekly",label:o("taskDialog.sections.automation.modeWeekly")}]),g=ce(()=>[{value:"1",label:o("taskDialog.sections.automation.weekday1")},{value:"2",label:o("taskDialog.sections.automation.weekday2")},{value:"3",label:o("taskDialog.sections.automation.weekday3")},{value:"4",label:o("taskDialog.sections.automation.weekday4")},{value:"5",label:o("taskDialog.sections.automation.weekday5")},{value:"6",label:o("taskDialog.sections.automation.weekday6")},{value:"0",label:o("taskDialog.sections.automation.weekday0")}]),F=ce(()=>Ji.map(U=>({...U,label:U.value==="local"?o("taskDialog.sections.automation.timezoneLocal"):U.label}))),B=ce(()=>es.map(U=>({...U,label:U.value==="skip"?o("taskDialog.sections.automation.concurrencySkip"):U.label}))),x=ce(()=>ts.map(U=>({...U,label:U.value==="dingtalk"?o("taskDialog.sections.notification.channelDingtalk"):U.value==="feishu"?o("taskDialog.sections.notification.channelFeishu"):U.value==="webhook"?o("taskDialog.sections.notification.channelWebhook"):U.label}))),v=ce(()=>us.map(U=>({...U,label:U.value==="completed"?o("taskDialog.sections.notification.triggerCompleted"):U.value==="success"?o("taskDialog.sections.notification.triggerSuccess"):U.value==="error"?o("taskDialog.sections.notification.triggerError"):U.label}))),D=ce(()=>os.map(U=>({...U,label:U.value==="summary"?o("taskDialog.sections.notification.messageSummary"):U.label}))),L=ce(()=>rs.map(U=>({...U,label:U.value==="zh-CN"?o("taskDialog.sections.notification.localeZhCn"):U.value==="en-US"?o("taskDialog.sections.notification.localeEnUs"):U.label}))),$=ce(()=>c.notificationEnabled?c.notificationLastStatus==="success"?o("taskDialog.sections.notification.statusSuccess"):c.notificationLastStatus==="error"?o("taskDialog.sections.notification.statusError"):o("taskDialog.sections.notification.statusPending"):o("taskDialog.sections.notification.statusDisabled"));function te(){c.title="",c.automationEnabled=!1,c.automationMode=Nn,c.automationTime=Au,c.automationWeekday=gu,c.automationTimezone="local",c.automationConcurrencyPolicy="skip",c.automationLastTriggeredAt="",c.automationNextTriggerAt="",c.notificationEnabled=!1,c.notificationChannelType="dingtalk",c.notificationWebhookUrl="",c.notificationSecret="",c.notificationTriggerOn="completed",c.notificationLocale=String(r.value||"zh-CN"),c.notificationMessageMode="summary",c.notificationLastStatus="",c.notificationLastError="",c.notificationLastSentAt=""}function C(U=0){return String(U).padStart(2,"0")}function Q(U=""){const K=String(U||"").trim().replace(/\s+/g," ");let S=K.match(/^(\d{1,2}) (\d{1,2}) \* \* 1-5$/);return S?{mode:"weekdays",time:`${C(S[2])}:${C(S[1])}`,weekday:gu}:(S=K.match(/^(\d{1,2}) (\d{1,2}) \* \* \*$/),S?{mode:"daily",time:`${C(S[2])}:${C(S[1])}`,weekday:gu}:(S=K.match(/^(\d{1,2}) (\d{1,2}) \* \* ([0-6])$/),S?{mode:"weekly",time:`${C(S[2])}:${C(S[1])}`,weekday:String(S[3])}:{mode:Nn,time:Au,weekday:gu}))}function J(U=""){const S=String(U||"").trim().match(/^(\d{1,2}):(\d{2})$/);if(!S)return Au;const X=Number(S[1]),fe=Number(S[2]);return!Number.isInteger(X)||!Number.isInteger(fe)||X<0||X>23||fe<0||fe>59?Au:`${C(X)}:${C(fe)}`}function N(){var q;const U=J(c.automationTime),[K,S]=U.split(":"),X=Number(K),fe=Number(S);if(c.automationMode==="daily")return`${fe} ${X} * * *`;if(c.automationMode==="weekly"){const H=((q=g.value.find(Y=>Y.value===String(c.automationWeekday||"")))==null?void 0:q.value)||gu;return`${fe} ${X} * * ${H}`}return`${fe} ${X} * * 1-5`}function z(U={}){var S,X,fe,q,H,Y,be,se,Ae,_e,Be,De,re,Ke,Xe,He;c.title=String(U.title||""),c.automationEnabled=!!((S=U.automation)!=null&&S.enabled);const K=Q(((X=U.automation)==null?void 0:X.cron)||nl);c.automationMode=K.mode,c.automationTime=K.time,c.automationWeekday=K.weekday,c.automationTimezone=String(((fe=U.automation)==null?void 0:fe.timezone)||"local"),c.automationConcurrencyPolicy=String(((q=U.automation)==null?void 0:q.concurrencyPolicy)||"skip"),c.automationLastTriggeredAt=String(((H=U.automation)==null?void 0:H.lastTriggeredAt)||""),c.automationNextTriggerAt=String(((Y=U.automation)==null?void 0:Y.nextTriggerAt)||""),c.notificationEnabled=!!((be=U.notification)!=null&&be.enabled),c.notificationChannelType=String(((se=U.notification)==null?void 0:se.channelType)||"dingtalk"),c.notificationWebhookUrl=String(((Ae=U.notification)==null?void 0:Ae.webhookUrl)||""),c.notificationSecret=String(((_e=U.notification)==null?void 0:_e.secret)||""),c.notificationTriggerOn=String(((Be=U.notification)==null?void 0:Be.triggerOn)||"completed"),c.notificationLocale=String(((De=U.notification)==null?void 0:De.locale)||r.value||"zh-CN"),c.notificationMessageMode=String(((re=U.notification)==null?void 0:re.messageMode)||"summary"),c.notificationLastStatus=String(((Ke=U.notification)==null?void 0:Ke.lastStatus)||""),c.notificationLastError=String(((Xe=U.notification)==null?void 0:Xe.lastError)||""),c.notificationLastSentAt=String(((He=U.notification)==null?void 0:He.lastSentAt)||"")}async function ue(){const U=String(u.taskSlug||"").trim();if(!U){te();return}i.value=!0,a.value="";try{const K=await Cr(U);z(K)}catch(K){a.value=(K==null?void 0:K.message)||o("taskDialog.loadFailed")}finally{i.value=!1}}function ae(){return{title:c.title,automation:{enabled:c.automationEnabled,cron:N(),timezone:c.automationTimezone,concurrencyPolicy:c.automationConcurrencyPolicy},notification:{enabled:c.notificationEnabled,channelType:c.notificationChannelType,webhookUrl:c.notificationWebhookUrl,secret:c.notificationSecret,triggerOn:c.notificationTriggerOn,locale:c.notificationLocale,messageMode:c.notificationMessageMode}}}async function ge(){const U=String(u.taskSlug||"").trim();if(!(!U||i.value||s.value)){s.value=!0,a.value="";try{const K=await Tr(U,ae());z(K),n("saved",K),n("close")}catch(K){a.value=(K==null?void 0:K.message)||o("taskDialog.saveFailed")}finally{s.value=!1}}}function de(U){u.open&&U.key==="Escape"&&n("close")}function ke(U=""){if(!U)return o("common.notAvailable");const K=new Date(U);return Number.isNaN(K.getTime())?o("common.notAvailable"):br(K.toISOString(),{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return Ee(()=>u.open,U=>{if(document.body.classList.toggle("overflow-hidden",U),U){window.addEventListener("keydown",de),d.value="basic",ue();return}window.removeEventListener("keydown",de)},{immediate:!0}),Ee(()=>u.taskSlug,()=>{u.open&&ue()}),at(()=>{document.body.classList.remove("overflow-hidden"),window.removeEventListener("keydown",de)}),(U,K)=>(T(),Se(cu,{to:"body"},[e.open?(T(),O("div",{key:0,class:"theme-modal-backdrop fixed inset-0 z-[75] flex items-center justify-center px-4 py-6",onClick:K[17]||(K[17]=Ue(S=>n("close"),["self"]))},[p("section",qs,[p("div",Us,[p("div",null,[p("div",js,[oe(l(Bu),{class:"h-4 w-4"}),p("span",null,E(l(o)("taskDialog.title")),1)]),p("p",Vs,E(l(o)("taskDialog.currentTask",{title:f.value})),1)]),p("button",{type:"button",class:"theme-icon-button h-8 w-8 shrink-0",onClick:K[0]||(K[0]=S=>n("close"))},[oe(l(Cn),{class:"h-4 w-4"})])]),p("div",Hs,[oe(ps,{modelValue:d.value,"onUpdate:modelValue":K[1]||(K[1]=S=>d.value=S),sections:m.value},null,8,["modelValue","sections"]),p("div",Ws,[i.value?(T(),O("div",Ks,[oe(l(Lt),{class:"h-4 w-4 animate-spin"}),p("span",null,E(l(o)("taskDialog.loading")),1)])):(T(),O("div",Gs,[d.value==="basic"?(T(),O("section",Zs,[p("div",null,[p("div",Xs,E(l(o)("taskDialog.sections.basic.title")),1),p("p",Ys,E(l(o)("taskDialog.sections.basic.intro")),1)]),p("section",Js,[p("label",Qs,[p("span",ea,E(l(o)("taskDialog.sections.basic.taskTitle")),1),Zt(p("input",{"onUpdate:modelValue":K[2]||(K[2]=S=>c.title=S),type:"text",maxlength:"140",class:"tool-input",placeholder:l(o)("taskDialog.sections.basic.taskTitlePlaceholder")},null,8,ta),[[Ju,c.title]])])])])):d.value==="automation"?(T(),O("section",ua,[p("div",na,[p("div",null,[p("div",oa,[oe(l(gn),{class:"h-4 w-4"}),p("span",null,E(l(o)("taskDialog.sections.automation.title")),1)]),p("p",ra,E(l(o)("taskDialog.sections.automation.intro")),1)]),p("label",ia,[Zt(p("input",{"onUpdate:modelValue":K[3]||(K[3]=S=>c.automationEnabled=S),type:"checkbox",class:"h-4 w-4"},null,512),[[To,c.automationEnabled]]),p("span",null,E(l(o)("taskDialog.enabled")),1)])]),p("section",sa,[p("div",aa,[p("label",la,[p("span",ca,E(l(o)("taskDialog.sections.automation.mode")),1),oe(Ht,{modelValue:c.automationMode,"onUpdate:modelValue":K[4]||(K[4]=S=>c.automationMode=S),options:k.value,disabled:!c.automationEnabled,"get-option-value":S=>S.value},{trigger:St(({selectedOption:S})=>[p("div",da,E((S==null?void 0:S.label)||l(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])]),p("label",fa,[p("span",pa,E(l(o)("taskDialog.sections.automation.time")),1),Zt(p("input",{"onUpdate:modelValue":K[5]||(K[5]=S=>c.automationTime=S),type:"time",class:"tool-input",disabled:!c.automationEnabled},null,8,ha),[[Ju,c.automationTime]])]),c.automationMode==="weekly"?(T(),O("label",ma,[p("span",ga,E(l(o)("taskDialog.sections.automation.weekday")),1),oe(Ht,{modelValue:c.automationWeekday,"onUpdate:modelValue":K[6]||(K[6]=S=>c.automationWeekday=S),options:g.value,disabled:!c.automationEnabled,"get-option-value":S=>S.value},{trigger:St(({selectedOption:S})=>[p("div",ba,E((S==null?void 0:S.label)||l(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])])):xe("",!0),p("label",va,[p("span",xa,E(l(o)("taskDialog.sections.automation.timezone")),1),oe(Ht,{modelValue:c.automationTimezone,"onUpdate:modelValue":K[7]||(K[7]=S=>c.automationTimezone=S),options:F.value,disabled:!c.automationEnabled,"get-option-value":S=>S.value},{trigger:St(({selectedOption:S})=>[p("div",ya,E((S==null?void 0:S.label)||l(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])]),p("label",{class:we(["space-y-1.5",c.automationMode==="weekly"?"":"sm:col-span-2"])},[p("span",ka,E(l(o)("taskDialog.sections.automation.concurrencyPolicy")),1),oe(Ht,{modelValue:c.automationConcurrencyPolicy,"onUpdate:modelValue":K[8]||(K[8]=S=>c.automationConcurrencyPolicy=S),options:B.value,disabled:!c.automationEnabled,"get-option-value":S=>S.value},{trigger:St(({selectedOption:S})=>[p("div",_a,E((S==null?void 0:S.label)||l(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])],2)]),p("div",wa,[p("p",null,E(l(o)("taskDialog.sections.automation.lastTriggered",{value:ke(c.automationLastTriggeredAt)})),1),p("p",null,E(l(o)("taskDialog.sections.automation.nextTriggered",{value:ke(c.automationNextTriggerAt)})),1)])])])):(T(),O("section",Sa,[p("div",Ca,[p("div",null,[p("div",Ta,[oe(l(Io),{class:"h-4 w-4"}),p("span",null,E(l(o)("taskDialog.sections.notification.title")),1)]),p("p",Ea,E(l(o)("taskDialog.sections.notification.intro")),1)]),p("label",Aa,[Zt(p("input",{"onUpdate:modelValue":K[9]||(K[9]=S=>c.notificationEnabled=S),type:"checkbox",class:"h-4 w-4"},null,512),[[To,c.notificationEnabled]]),p("span",null,E(l(o)("taskDialog.enabled")),1)])]),p("section",Da,[p("div",Ia,[p("label",Fa,[p("span",$a,E(l(o)("taskDialog.sections.notification.channelType")),1),oe(Ht,{modelValue:c.notificationChannelType,"onUpdate:modelValue":K[10]||(K[10]=S=>c.notificationChannelType=S),options:x.value,disabled:!c.notificationEnabled,"get-option-value":S=>S.value},{trigger:St(({selectedOption:S})=>[p("div",Ma,E((S==null?void 0:S.label)||l(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])]),p("label",Pa,[p("span",Ba,E(l(o)("taskDialog.sections.notification.triggerOn")),1),oe(Ht,{modelValue:c.notificationTriggerOn,"onUpdate:modelValue":K[11]||(K[11]=S=>c.notificationTriggerOn=S),options:v.value,disabled:!c.notificationEnabled,"get-option-value":S=>S.value},{trigger:St(({selectedOption:S})=>[p("div",Ra,E((S==null?void 0:S.label)||l(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])]),p("label",La,[p("span",Na,E(l(o)("taskDialog.sections.notification.webhookUrl")),1),Zt(p("input",{"onUpdate:modelValue":K[12]||(K[12]=S=>c.notificationWebhookUrl=S),type:"text",class:"tool-input",placeholder:l(o)("taskDialog.sections.notification.webhookUrlPlaceholder"),disabled:!c.notificationEnabled},null,8,Oa),[[Ju,c.notificationWebhookUrl]])]),p("label",za,[p("span",qa,E(l(o)("taskDialog.sections.notification.secret")),1),Zt(p("input",{"onUpdate:modelValue":K[13]||(K[13]=S=>c.notificationSecret=S),type:"text",class:"tool-input",placeholder:l(o)("taskDialog.sections.notification.secretPlaceholder"),disabled:!c.notificationEnabled},null,8,Ua),[[Ju,c.notificationSecret]])]),p("label",ja,[p("span",Va,E(l(o)("taskDialog.sections.notification.locale")),1),oe(Ht,{modelValue:c.notificationLocale,"onUpdate:modelValue":K[14]||(K[14]=S=>c.notificationLocale=S),options:L.value,disabled:!c.notificationEnabled,"get-option-value":S=>S.value},{trigger:St(({selectedOption:S})=>[p("div",Ha,E((S==null?void 0:S.label)||l(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])]),p("label",Wa,[p("span",Ka,E(l(o)("taskDialog.sections.notification.messageMode")),1),oe(Ht,{modelValue:c.notificationMessageMode,"onUpdate:modelValue":K[15]||(K[15]=S=>c.notificationMessageMode=S),options:D.value,disabled:!c.notificationEnabled,"get-option-value":S=>S.value},{trigger:St(({selectedOption:S})=>[p("div",Ga,E((S==null?void 0:S.label)||l(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])])]),p("div",Za,[p("p",null,E(l(o)("taskDialog.sections.notification.status",{value:$.value})),1),p("p",null,E(l(o)("taskDialog.sections.notification.lastSent",{value:ke(c.notificationLastSentAt)})),1),c.notificationLastError?(T(),O("p",Xa,E(l(o)("taskDialog.sections.notification.lastError",{value:c.notificationLastError})),1)):xe("",!0)])])])),a.value?(T(),O("p",Ya,E(a.value),1)):xe("",!0)]))])]),p("div",Ja,[p("p",Qa,E(l(o)("taskDialog.footerHint")),1),p("div",el,[p("button",{type:"button",class:"tool-button px-3 py-2 text-sm",disabled:s.value,onClick:K[16]||(K[16]=S=>n("close"))},E(l(o)("common.cancel")),9,tl),p("button",{type:"button",class:"tool-button tool-button-primary inline-flex items-center gap-2 px-3 py-2 text-sm",disabled:s.value||i.value,onClick:ge},[s.value?(T(),Se(l(Lt),{key:0,class:"h-4 w-4 animate-spin"})):(T(),Se(l(Mi),{key:1,class:"h-4 w-4"})),p("span",null,E(s.value?l(o)("common.saving"):l(o)("taskDialog.saveTaskConfig")),1)],8,ul)])])])])):xe("",!0)]))}},rl={key:0,class:"flex items-center gap-2 text-sm"},il={class:"min-w-0 flex-1 truncate"},sl={class:"theme-muted-text ml-2 font-mono text-[11px]"},al={class:"theme-status-neutral inline-flex items-center rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]"},ll={key:1,class:"theme-muted-text text-sm"},cl={class:"theme-divider theme-muted-text flex items-center justify-between gap-3 border-b border-dashed px-3 py-2 text-[11px]"},dl=["onClick"],fl={class:"flex items-start gap-3"},pl={class:"min-w-0 flex-1"},hl={class:"flex items-center gap-2 text-sm"},ml={class:"min-w-0 flex-1 truncate"},gl={class:"font-medium text-[var(--theme-textPrimary)]"},bl={class:"theme-muted-text ml-2 font-mono text-[11px]"},vl={class:"theme-status-neutral inline-flex items-center rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]"},xl={__name:"CodexSessionSelect",props:{modelValue:{type:String,default:""},sessions:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","refresh-intent"],setup(e,{emit:t}){const u=t,{t:n}=kt();function r(d){return(d==null?void 0:d.title)||n("projectManager.untitledProject")}function o(d){return(d==null?void 0:d.cwd)||n("projectManager.notSet")}function i(d){return d!=null&&d.running?n("projectManager.running"):n("projectManager.idle")}function s(d){return d!=null&&d.running?"theme-status-warning":"theme-status-success"}function a(d){return d?"theme-filter-active":"theme-filter-idle"}return(d,c)=>(T(),Se(Ht,{"model-value":e.modelValue,options:e.sessions,loading:e.loading,disabled:e.disabled,placeholder:l(n)("projectManager.selectProject"),"empty-text":l(n)("projectManager.noProjectsInSelect"),"get-option-value":f=>(f==null?void 0:f.id)||"","onUpdate:modelValue":c[0]||(c[0]=f=>u("update:modelValue",f)),onRefreshIntent:c[1]||(c[1]=f=>u("refresh-intent"))},{trigger:St(({selectedOption:f,disabled:m})=>[f?(T(),O("div",rl,[p("span",il,[p("span",{class:we(["font-medium",m?"theme-muted-text":"text-[var(--theme-textPrimary)]"])},E(r(f)),3),p("span",sl,E(o(f)),1)]),p("span",al,E(l(We)(f.engine)),1),p("span",{class:we(["inline-flex items-center rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",s(f)])},E(i(f)),3)])):(T(),O("div",ll,E(e.loading?l(n)("projectManager.syncingProjects"):l(n)("projectManager.selectProject")),1))]),header:St(()=>[p("div",cl,[p("span",null,E(e.loading?l(n)("projectManager.syncingLatestProjects"):l(n)("projectManager.projectCount",{count:e.sessions.length})),1),e.loading?(T(),Se(l(Lt),{key:0,class:"h-3.5 w-3.5 animate-spin"})):xe("",!0)])]),option:St(({option:f,selected:m,select:k})=>[p("button",{type:"button",class:we(["w-full rounded-sm border border-dashed p-3 text-left transition",a(m)]),onClick:k},[p("div",fl,[p("div",pl,[p("div",hl,[p("span",ml,[p("span",gl,E(r(f)),1),p("span",bl,E(o(f)),1)]),p("span",vl,E(l(We)(f.engine)),1),p("span",{class:we(["inline-flex items-center rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",s(f)])},E(i(f)),3)])]),m?(T(),Se(l(Di),{key:0,class:"mt-0.5 h-4 w-4 shrink-0 text-[var(--theme-textSecondary)]"})):xe("",!0)])],10,dl)]),_:1},8,["model-value","options","loading","disabled","placeholder","empty-text","get-option-value"]))}},yl=["disabled"],kl=["disabled"],_l=["src","alt"],Ar={__name:"ImagePreviewOverlay",props:{modelValue:{type:String,default:""},images:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(e,{emit:t}){const u=e,n=t,{t:r}=kt(),o=V(1),i=ce(()=>u.images.map(x=>String(x||"").trim()).filter(Boolean)),s=ce(()=>i.value.findIndex(x=>x===u.modelValue)),a=ce(()=>s.value>=0?i.value[s.value]:"");function d(){n("update:modelValue",""),o.value=1}function c(x){n("update:modelValue",String(x||"").trim()),o.value=1}function f(){s.value<=0||c(i.value[s.value-1])}function m(){s.value<0||s.value>=i.value.length-1||c(i.value[s.value+1])}function k(x){const v=Math.min(3,Math.max(.5,o.value+x));o.value=Math.round(v*100)/100}function g(){o.value=1}function F(x){a.value&&(x.preventDefault(),k(x.deltaY<0?.1:-.1))}function B(x){if(a.value){if(x.key==="Escape"){x.preventDefault(),d();return}if(x.key==="ArrowLeft"){x.preventDefault(),f();return}if(x.key==="ArrowRight"){x.preventDefault(),m();return}if(x.key==="+"||x.key==="="){x.preventDefault(),k(.1);return}if(x.key==="-"){x.preventDefault(),k(-.1);return}x.key==="0"&&(x.preventDefault(),g())}}return Ee(()=>u.modelValue,x=>{x||(o.value=1)}),Ee(i,x=>{if(u.modelValue){if(!x.length){d();return}if(!x.includes(u.modelValue)){const v=Math.min(s.value,x.length-1);c(x[v]||x[0])}}},{immediate:!0}),du(()=>{window.addEventListener("keydown",B)}),at(()=>{window.removeEventListener("keydown",B)}),(x,v)=>(T(),Se(cu,{to:"body"},[a.value?(T(),O("div",{key:0,class:"image-preview-overlay fixed inset-0 z-50 flex items-center justify-center p-6",onClick:d,onWheel:F},[p("div",{class:"absolute left-4 top-4 flex items-center gap-2",onClick:v[2]||(v[2]=Ue(()=>{},["stop"]))},[p("button",{type:"button",class:"image-preview-overlay__button rounded-sm border px-3 py-2 text-sm transition",onClick:v[0]||(v[0]=D=>k(-.1))},E(l(r)("imagePreview.zoomOut")),1),p("button",{type:"button",class:"image-preview-overlay__button rounded-sm border px-3 py-2 text-sm transition",onClick:g},E(Math.round(o.value*100))+"% ",1),p("button",{type:"button",class:"image-preview-overlay__button rounded-sm border px-3 py-2 text-sm transition",onClick:v[1]||(v[1]=D=>k(.1))},E(l(r)("imagePreview.zoomIn")),1)]),p("div",{class:"absolute right-4 top-4 flex items-center gap-2",onClick:v[3]||(v[3]=Ue(()=>{},["stop"]))},[p("button",{type:"button",class:"image-preview-overlay__button rounded-sm border px-3 py-2 text-sm transition disabled:cursor-not-allowed disabled:opacity-40",disabled:s.value<=0,onClick:f},E(l(r)("imagePreview.previous")),9,yl),p("button",{type:"button",class:"image-preview-overlay__button rounded-sm border px-3 py-2 text-sm transition disabled:cursor-not-allowed disabled:opacity-40",disabled:s.value<0||s.value>=i.value.length-1,onClick:m},E(l(r)("imagePreview.next")),9,kl),p("button",{type:"button",class:"image-preview-overlay__button rounded-sm border px-3 py-2 text-sm transition",onClick:d},E(l(r)("imagePreview.close")),1)]),p("img",{src:a.value,alt:l(r)("imagePreview.alt"),class:"image-preview-overlay__image max-h-[90vh] max-w-[90vw] object-contain shadow-2xl transition-transform",style:mn({transform:`scale(${o.value})`}),onClick:v[4]||(v[4]=Ue(()=>{},["stop"]))},null,12,_l)],32)):xe("",!0)]))}},wl=`${ho()}/api/events/stream`,vu=new Set;let iu=null,cn=null;function eo(){cn&&(window.clearTimeout(cn),cn=null)}function Dr(){iu&&(iu.close(),iu=null)}function Sl(e){vu.forEach(t=>{try{t(e)}catch{}})}function Ir(){typeof window>"u"||typeof window.EventSource>"u"||iu||!vu.size||(eo(),iu=new window.EventSource(wl),iu.onmessage=e=>{try{const t=JSON.parse(String(e.data||"{}"));if(!(t!=null&&t.type))return;Sl(t)}catch{}},iu.onerror=()=>{Dr(),vu.size&&(eo(),cn=window.setTimeout(()=>{Ir()},1500))})}function Cl(e){return typeof e!="function"?()=>{}:(vu.add(e),Ir(),()=>{vu.delete(e),!vu.size&&(eo(),Dr())})}const Fr=V(0),dn=V(0),fn=V(""),pn=V(0),$r=wn({}),to=wn({}),Mr=wn({}),$u=new Map;let Po=!1;function On(e,t=""){const u=String(t||"").trim();u&&(e[u]=Math.max(0,Number(e[u])||0)+1)}function Tl(e={}){const t=String(e.type||"").trim(),u=String(e.reason||"").trim();return{updatesTaskList:t==="ready"||t==="tasks.changed"||t==="runs.changed",updatesSessions:t==="ready"||t==="runs.changed"||t==="sessions.changed",updatesTaskRuns:t==="runs.changed",updatesTaskDiff:t==="runs.changed"||t==="tasks.changed"&&(u==="session-linked"||u==="session-cleared")}}function El(e="",t={}){const u=String(e||"").trim();if(!u)return;const n=$u.get(u);n!=null&&n.size&&n.forEach(r=>{try{r(t)}catch{}})}function Al(e={}){const t=String(e.type||"").trim(),u=String(e.taskSlug||"").trim(),n=Tl(e);if(t){if(t==="ready"){Fr.value+=1,fn.value="",dn.value+=1,pn.value+=1;return}if(t==="tasks.changed"){fn.value=u,n.updatesTaskList&&(dn.value+=1),n.updatesTaskDiff&&On(to,u);return}if(t==="runs.changed"){fn.value=u,u&&(Mr[u]={runId:String(e.runId||"").trim(),status:String(e.status||"").trim(),sentAt:String(e.sentAt||"").trim()}),n.updatesTaskList&&(dn.value+=1),n.updatesSessions&&(pn.value+=1),n.updatesTaskRuns&&On($r,u),n.updatesTaskDiff&&On(to,u);return}if(t==="sessions.changed"){n.updatesSessions&&(pn.value+=1);return}t==="run.event"&&El(u,{taskSlug:u,runId:String(e.runId||"").trim(),event:e.event||null})}}function Pr(){Po||typeof window>"u"||(Cl(e=>{Al(e)}),Po=!0)}function Dl(e=""){const t=String(e||"").trim();return t?Math.max(0,Number($r[t])||0):0}function Il(e=""){const t=String(e||"").trim();return t?Math.max(0,Number(to[t])||0):0}function Fl(e=""){const t=String(e||"").trim();return t&&Mr[t]||null}function $l(e="",t){const u=String(e||"").trim();if(!u||typeof t!="function")return()=>{};Pr();const n=$u.get(u)||new Set;return n.add(t),$u.set(u,n),()=>{const r=$u.get(u);r&&(r.delete(t),r.size||$u.delete(u))}}function Br(){return Pr(),{readyVersion:Fr,listSyncVersion:dn,listSyncTaskSlug:fn,sessionsSyncVersion:pn,getTaskRunSyncVersion:Dl,getTaskRunChange:Fl,getTaskDiffSyncVersion:Il}}const Ml=new Set(["queued","starting","running","stopping"]);function su(){return Sn()==="en-US"}function P(e,t){return su()?t:e}function Bo(e=""){const t=Date.parse(String(e||""));return Number.isFinite(t)?t:0}function Ro(e=[],t=""){return[...e].sort((u,n)=>{const r=+!!(n!=null&&n.running)-+!!(u!=null&&u.running);if(r)return r;const o=+((n==null?void 0:n.id)===t)-+((u==null?void 0:u.id)===t);if(o)return o;const i=Bo(n.updatedAt)-Bo(u.updatedAt);return i||String(u.title||u.cwd||u.id).localeCompare(String(n.title||n.cwd||n.id),Sn())})}function Pl(e="",t=500){const u=String(e||"").trim();return u?u.length<=t?u:`${u.slice(0,t)}...`:""}function zn(e=[]){const t=Array.isArray(e)?e:[];return t.length?t.map(u=>`${u.completed?"[x]":"[ ]"} ${u.text||P("未命名任务","Untitled Task")}`).join(`
213
+ `):""}function At(e=0){const t=Number(e||0);return Number.isFinite(t)?t.toLocaleString(Sn()):"0"}function Rr(e=0){const t=Math.max(0,Math.floor(Number(e)||0));if(t<66)return`${t}s`;const u=Math.floor(t/3600),n=Math.floor(t%3600/60),r=t%60;return u>0?su()?`${u}h ${n}m ${r}s`:`${u}小时${n}分${r}秒`:su()?`${n}m ${r}s`:`${n}分${r}秒`}function tt(e="",t=140){const u=String(e||"").replace(/\s+/g," ").trim();return u?u.length<=t?u:`${u.slice(0,t)}...`:""}function Lr(e="",t=[]){const u=t.filter(Boolean);if(!u.length)return"";const n=u.map(r=>`- ${r}`).join(`
214
+ `);return e?`${e}
215
+ ${n}`:n}function wu(){return{commandCount:0,webSearchCount:0,fileChangeCount:0,subAgentCount:0,waitingAgentCount:0,currentActivity:"",latestActivity:"",latestDetail:""}}function uo(e=[],t=""){const u=String(t||"").trim();return u&&(Array.isArray(e)?e:[]).find(n=>(n==null?void 0:n.runId)===u)||null}function Bl(e,t,u,n,r){const o=uo(e,t);return o?(o.events=[],o.lastEventSeq=0,o.summary=wu(),((u==null?void 0:u.items)||[]).forEach(i=>{go(o,i,n,r)}),o.eventCount=Math.max(Math.max(0,Number(o.eventCount)||0),Array.isArray(u==null?void 0:u.items)?u.items.length:0,Math.max(0,Number(o.lastEventSeq)||0)),o.eventsLoaded=!0,o.eventsLoading=!1,o):null}function bn(e={}){return wr(e==null?void 0:e.engine)}function pt(e={}){return We(bn(e))}function Ru(e=""){return Ml.has(String(e||"").trim())}function mo(e=""){const t=String(e||"").trim();if(!t)return null;const u=t.match(/^Reconnecting\.\.\.\s*(\d+)\/(\d+)\s*\(([\s\S]+)\)$/i);return u?{attempt:Number(u[1]||0),total:Number(u[2]||0),reason:String(u[3]||"").trim(),rawMessage:t}:null}function Lo(e={},t="completed"){const u=e.action||{},n=String(u.type||"").trim(),r=String(e.query||u.query||"").trim(),o=Array.isArray(u.queries)?u.queries.map(s=>String(s||"").trim()).filter(Boolean):[],i=String(u.url||r||"").trim();return n==="search"?{kind:"command",title:t==="started"?P("正在搜索网页","Searching the web"):P("已搜索网页","Web search completed"),detail:Lr(r?P(`关键词:${r}`,`Query: ${r}`):"",o.length>1?o:[])}:n==="open_page"?{kind:"command",title:t==="started"?P("正在打开网页","Opening page"):P("已打开网页","Page opened"),detail:i}:{kind:"command",title:t==="started"?P("准备网页检索","Preparing web search"):P("网页检索已更新","Web search updated"),detail:r}}function No(e={},t="completed"){const u=String(e.tool||"").trim(),n=Array.isArray(e.receiver_thread_ids)?e.receiver_thread_ids.filter(Boolean).length:0,r=tt(e.prompt);return u==="spawn_agent"?{kind:"todo",title:t==="started"?P("正在启动子代理","Starting sub-agent"):P(`已启动 ${n||1} 个子代理`,`Started ${n||1} sub-agent(s)`),detail:r?P(`任务:${r}`,`Task: ${r}`):""}:u==="wait"?{kind:"todo",title:t==="started"?n?P(`等待 ${n} 个子代理返回结果`,`Waiting for ${n} sub-agent result(s)`):P("等待子代理返回结果","Waiting for sub-agent results"):P("子代理结果已汇总","Sub-agent results aggregated"),detail:r?P(`等待内容:${r}`,`Waiting on: ${r}`):""}:{kind:"todo",title:t==="started"?P(`正在执行协作工具:${u||"未知工具"}`,`Running collaboration tool: ${u||"Unknown tool"}`):P(`协作工具完成:${u||"未知工具"}`,`Collaboration tool completed: ${u||"Unknown tool"}`),detail:r?P(`任务:${r}`,`Task: ${r}`):""}}function Oo(e={},t="completed"){const u=Array.isArray(e.changes)?e.changes:[],n={create:P("新增","Added"),update:P("更新","Updated"),delete:P("删除","Deleted")};return{kind:"command",title:t==="started"?P("正在整理文件变更","Collecting file changes"):P(`已记录 ${u.length||0} 个文件改动`,`Recorded ${u.length||0} file change(s)`),detail:Lr("",u.map(r=>{const o=String((r==null?void 0:r.path)||"").trim();return`${n[String((r==null?void 0:r.kind)||"").trim()]||P("变更","Changed")} ${o||P("未命名文件","Unnamed file")}`}))}}function Rl(e,t={}){var i,s,a,d,c,f,m,k;e!=null&&e.summary||(e.summary=wu());const u=e.summary,n=pt(e),r=String(t.type||"").trim(),o=t.item||{};if(r===Je.TURN_STARTED){u.currentActivity=P("正在分析任务","Analyzing task"),u.latestActivity=P(`${n} 开始执行`,`${n} started`),u.latestDetail="";return}if(r===Je.TURN_COMPLETED){u.currentActivity="",u.waitingAgentCount=0,u.latestActivity=P(`${n} 执行完成`,`${n} completed`),u.latestDetail="";return}if(r===Je.TURN_FAILED){u.currentActivity="",u.waitingAgentCount=0,u.latestActivity=P("本轮运行失败","This run failed"),u.latestDetail="";return}if(r===Je.ERROR){const g=mo(Lu(t));if(g){u.currentActivity=P(`网络异常,正在重试 (${g.attempt}/${g.total})`,`Network error, retrying (${g.attempt}/${g.total})`),u.latestActivity=u.currentActivity,u.latestDetail=tt(g.reason,120);return}u.currentActivity="",u.latestActivity=P(`${n} 返回错误`,`${n} returned an error`),u.latestDetail=tt(Lu(t),120);return}if(r===Je.ITEM_STARTED){if(o.type===Le.REASONING){u.currentActivity=P("正在思考","Thinking"),u.latestActivity=P("正在思考","Thinking"),u.latestDetail=tt(o.text,120);return}if(o.type===Le.COMMAND_EXECUTION){u.currentActivity=P("正在执行命令","Running command"),u.latestActivity=P("开始执行命令","Command started"),u.latestDetail=tt(o.command,120);return}if(o.type===Le.WEB_SEARCH){u.currentActivity=((i=o.action)==null?void 0:i.type)==="open_page"?P("正在打开网页","Opening page"):P("正在搜索网页","Searching the web"),u.latestActivity=u.currentActivity,u.latestDetail=tt(((s=o.action)==null?void 0:s.type)==="open_page"?((a=o.action)==null?void 0:a.url)||o.query:o.query||((d=o.action)==null?void 0:d.query),120);return}if(o.type===Le.COLLAB_TOOL_CALL){if(o.tool==="wait"){const g=Array.isArray(o.receiver_thread_ids)?o.receiver_thread_ids.filter(Boolean).length:0;u.waitingAgentCount=g,u.currentActivity=g?P(`等待 ${g} 个子代理返回结果`,`Waiting for ${g} sub-agent result(s)`):P("等待子代理返回结果","Waiting for sub-agent results"),u.latestActivity=u.currentActivity,u.latestDetail=tt(o.prompt,120);return}if(o.tool==="spawn_agent"){u.currentActivity=P("正在启动子代理","Starting sub-agent"),u.latestActivity=P("正在启动子代理","Starting sub-agent"),u.latestDetail=tt(o.prompt,120);return}}if(o.type===Le.FILE_CHANGE){u.currentActivity=P("正在整理文件变更","Collecting file changes"),u.latestActivity=P("正在整理文件变更","Collecting file changes"),u.latestDetail=tt((o.changes||[]).map(g=>g==null?void 0:g.path).filter(Boolean).join(su()?", ":","),120);return}o.type===Le.TODO_LIST&&(u.currentActivity=P("正在规划执行步骤","Planning steps"),u.latestActivity=P("正在规划执行步骤","Planning steps"),u.latestDetail=tt((o.items||[]).map(g=>g==null?void 0:g.text).filter(Boolean).join(su()?"; ":";"),120));return}if(r===Je.ITEM_COMPLETED){if(o.type===Le.COMMAND_EXECUTION){u.commandCount+=1,u.currentActivity="",u.latestActivity=P("命令执行完成","Command completed"),u.latestDetail=tt(o.command,120);return}if(o.type===Le.WEB_SEARCH){u.webSearchCount+=1,u.currentActivity="",u.latestActivity=((c=o.action)==null?void 0:c.type)==="open_page"?P("已打开网页","Page opened"):P("已搜索网页","Web search completed"),u.latestDetail=tt(((f=o.action)==null?void 0:f.type)==="open_page"?((m=o.action)==null?void 0:m.url)||o.query:o.query||((k=o.action)==null?void 0:k.query),120);return}if(o.type===Le.COLLAB_TOOL_CALL){if(o.tool==="spawn_agent"){const g=Array.isArray(o.receiver_thread_ids)?o.receiver_thread_ids.filter(Boolean).length:0;u.subAgentCount+=g,u.currentActivity="",u.latestActivity=g?P(`已启动 ${g} 个子代理`,`Started ${g} sub-agent(s)`):P("已启动子代理","Started sub-agent"),u.latestDetail=tt(o.prompt,120);return}if(o.tool==="wait"){u.waitingAgentCount=0,u.currentActivity="",u.latestActivity=P("子代理结果已汇总","Sub-agent results aggregated"),u.latestDetail=tt(o.prompt,120);return}u.currentActivity="",u.latestActivity=P(`协作工具完成:${o.tool||"未知工具"}`,`Collaboration tool completed: ${o.tool||"Unknown tool"}`),u.latestDetail=tt(o.prompt,120);return}if(o.type===Le.FILE_CHANGE){const g=Array.isArray(o.changes)?o.changes:[];u.fileChangeCount+=g.length,u.currentActivity="",u.latestActivity=g.length?P(`已记录 ${g.length} 个文件改动`,`Recorded ${g.length} file change(s)`):P("已记录文件改动","Recorded file changes"),u.latestDetail=tt(g.map(F=>F==null?void 0:F.path).filter(Boolean).join(su()?", ":","),120);return}if(o.type===Le.TODO_LIST){u.currentActivity="",u.latestActivity=P("待办列表已更新","Todo list updated"),u.latestDetail=tt((o.items||[]).map(g=>g==null?void 0:g.text).filter(Boolean).join(su()?"; ":";"),120);return}o.type===Le.AGENT_MESSAGE&&(u.currentActivity="",u.latestActivity=P(`${n} 已返回结果`,`${n} returned a result`),u.latestDetail=tt(o.text,120))}}function Ll(e={},t={}){const u=Date.parse(String(e.startedAt||""));if(!Number.isFinite(u))return 0;if(Ru(e.status)){if(t.currentRunningRunId&&String(t.currentRunningRunId)===String(e.runId||"")&&Number.isFinite(Number(t.runningElapsedSeconds)))return Math.max(0,Math.floor(Number(t.runningElapsedSeconds)||0));const r=Number(t.nowMs)||Date.now();return Math.max(0,Math.floor((r-u)/1e3))}const n=Date.parse(String(e.finishedAt||""));return Number.isFinite(n)&&n>=u?Math.max(0,Math.floor((n-u)/1e3)):0}function Nr(e={},t={}){const u=e.summary||wu(),n=[],r=Ll(e,t);return r>0&&n.push({key:"elapsed",label:P("耗时","Elapsed"),value:Rr(r)}),u.webSearchCount&&n.push({key:"web",label:P("网页","Web"),value:At(u.webSearchCount)}),u.commandCount&&n.push({key:"command",label:P("命令","Command"),value:At(u.commandCount)}),u.fileChangeCount&&n.push({key:"file",label:P("改动","Changes"),value:At(u.fileChangeCount)}),u.subAgentCount&&n.push({key:"agent",label:P("子代理","Sub-agent"),value:At(u.subAgentCount)}),n}function Or(e={}){const t=e.summary||wu();return t.waitingAgentCount>0?P(`当前:等待 ${At(t.waitingAgentCount)} 个子代理返回结果`,`Current: waiting for ${At(t.waitingAgentCount)} sub-agent result(s)`):t.currentActivity?P(`当前:${t.currentActivity}`,`Current: ${t.currentActivity}`):t.latestActivity?P(`最近:${t.latestActivity}`,`Latest: ${t.latestActivity}`):Ru(e.status)?P(`当前:正在等待 ${pt(e)} 返回更多事件`,`Current: waiting for more events from ${pt(e)}`):""}function zr(e={}){const t=e.summary||wu();return String(t.latestDetail||"").trim()}function Nl(e={}){return!!(Nr(e).length||Or(e)||zr(e))}const Ol=[{type:"startup_config",title:e=>P(`${We(e)} 启动配置冲突`,`${We(e)} startup config conflict`),summary:e=>P(`${We(e)} 当前启动参数可能与本机包装脚本、别名或外部环境配置冲突,请检查 CLI 启动方式。`,`${We(e)} startup arguments may conflict with your local wrapper script, alias, or external environment configuration. Please check how the CLI is launched.`),patterns:[/not inside a trusted directory/i,/do you trust the contents of this directory/i,/trusted directory/i,/skip-git-repo-check/i,/prompt injection/i,/目录.*信任/,/可信目录/]},{type:"billing",title:P("额度或账单异常","Quota or billing issue"),summary:e=>P(`${We(e)} 可能因为额度不足、欠费或账单限制而无法继续执行。`,`${We(e)} may be unable to continue due to quota exhaustion, billing issues, or account limits.`),patterns:[/insufficient_quota/i,/exceeded your current quota/i,/\bquota\b/i,/\bbilling\b/i,/credit balance/i,/payment required/i,/余额不足/,/欠费/,/账单/,/充值/]},{type:"permission",title:P("权限不足","Insufficient permissions"),summary:e=>P(`${We(e)} 当前权限不够,无法访问所需文件、命令或资源。`,`${We(e)} does not currently have permission to access the required files, commands, or resources.`),patterns:[/permission denied/i,/insufficient permissions?/i,/forbidden/i,/unauthorized/i,/access denied/i,/not allowed/i,/权限不足/,/没有权限/,/无权/,/拒绝访问/]},{type:"rate_limit",title:P("请求过于频繁","Too many requests"),summary:e=>P(`${We(e)} 可能触发了限流,请稍后再试。`,`${We(e)} may have hit a rate limit. Please try again later.`),patterns:[/rate limit/i,/too many requests/i,/\b429\b/,/请求过于频繁/,/限流/]},{type:"context_limit",title:P("上下文过长","Context too long"),summary:P("这次发送的内容可能过长,超过了模型可处理的上下文限制。","The content sent in this run may be too long and exceed the model context limit."),patterns:[/context length/i,/maximum context length/i,/context_length_exceeded/i,/token limit/i,/prompt is too long/i,/上下文过长/,/超过.*token/i,/超出.*上下文/]},{type:"model_unavailable",title:P("模型或服务暂不可用","Model or service unavailable"),summary:e=>P(`${We(e)} 背后的模型或服务当前不可用,请稍后重试。`,`The model or service behind ${We(e)} is currently unavailable. Please try again later.`),patterns:[/model .*not found/i,/model .*unavailable/i,/service unavailable/i,/server error/i,/overloaded/i,/\b503\b/,/模型不可用/,/服务不可用/]},{type:"network",title:P("网络连接异常","Network connection issue"),summary:e=>P(`${We(e)} 在请求过程中遇到了网络问题或连接超时。`,`${We(e)} encountered a network problem or timeout while making the request.`),patterns:[/timed out/i,/\btimeout\b/i,/stream disconnected/i,/error sending request/i,/connection reset/i,/connection closed/i,/socket hang up/i,/network error/i,/fetch failed/i,/econnreset/i,/econnrefused/i,/enotfound/i,/network is unreachable/i,/temporary failure in name resolution/i,/网络异常/,/连接超时/]},{type:"cli_missing",title:e=>P(`${We(e)} CLI 不可用`,`${We(e)} CLI unavailable`),summary:e=>P(`当前环境没有正确安装或配置 ${We(e)} CLI。`,`${We(e)} CLI is not correctly installed or configured in the current environment.`),patterns:[/找不到 Codex CLI/,/找不到 Claude Code CLI/,/找不到 OpenCode CLI/,/codex --version/i,/claude --version/i,/opencode --version/i,/enoent/i,/not recognized as an internal or external command/i,/command not found/i]}];function yu(e="",t="codex"){const u=String(e||"").trim();if(!u)return null;const n=Ol.find(r=>r.patterns.some(o=>o.test(u)));return n?{type:n.type,title:typeof n.title=="function"?n.title(t):n.title,summary:typeof n.summary=="function"?n.summary(t):n.summary,rawMessage:u}:null}function lu(e="",t="codex"){const u=String(e||"").trim();if(!u)return"";const n=yu(u,t);return n?`${n.summary}
216
+
217
+ ${P("原始错误","Raw error")}: ${n.rawMessage}`:u}function no(e,t=0){if(!e||t>4)return"";if(typeof e=="string")return e.trim();if(typeof e!="object")return"";const u=["message","detail","error","last_error","cause","reason","stderr","text","summary"];for(const n of u){if(!Object.prototype.hasOwnProperty.call(e,n))continue;const r=no(e[n],t+1);if(r)return r}for(const n of Object.values(e)){const r=no(n,t+1);if(r)return r}return""}function Lu(e={}){return no(e)}function zl(e={},t="Codex",u="codex"){const n=String(e.type||"").trim(),r=e.item||{};if(!n)return{title:P(`收到 ${t} 事件`,`Received ${t} event`),detail:""};if(n===Je.THREAD_STARTED)return{title:P(`${t} 会话已创建`,`${t} session created`),detail:e.thread_id?P(`线程 ID: ${e.thread_id}`,`Thread ID: ${e.thread_id}`):""};if(n===Je.TURN_STARTED)return{title:P(`${t} 开始执行`,`${t} started`),detail:""};if(n===Je.TURN_COMPLETED){const o=e.usage?[P(`输入 ${At(e.usage.input_tokens)}`,`Input ${At(e.usage.input_tokens)}`),e.usage.cached_input_tokens?P(`缓存 ${At(e.usage.cached_input_tokens)}`,`Cached ${At(e.usage.cached_input_tokens)}`):"",P(`输出 ${At(e.usage.output_tokens)}`,`Output ${At(e.usage.output_tokens)}`)].filter(Boolean).join(" / "):"";return{title:P(`${t} 执行完成`,`${t} completed`),detail:o}}if(n===Je.ERROR||n===Je.TURN_FAILED){const o=Lu(e)||P(`${t} 执行失败`,`${t} failed`),i=n===Je.ERROR?mo(o):null;if(i)return{kind:"info",title:P(`网络异常,正在重试 (${i.attempt}/${i.total})`,`Network error, retrying (${i.attempt}/${i.total})`),detail:lu(i.reason||i.rawMessage,u)};const s=yu(o,u);return{kind:"error",title:(s==null?void 0:s.title)||(n===Je.TURN_FAILED?P("本轮运行失败","This run failed"):P(`${t} 返回错误`,`${t} returned an error`)),detail:lu(o,u)}}if(n===Je.ITEM_STARTED)return r.type===Le.REASONING?{kind:"info",title:P("正在思考","Thinking"),detail:r.text||""}:r.type===Le.WEB_SEARCH?Lo(r,"started"):r.type===Le.COLLAB_TOOL_CALL?No(r,"started"):r.type===Le.FILE_CHANGE?Oo(r,"started"):r.type===Le.COMMAND_EXECUTION?{kind:"command",title:P("开始执行命令","Command started"),detail:r.command||""}:r.type===Le.TODO_LIST?{kind:"todo",title:P("更新待办列表","Update todo list"),detail:zn(r.items)}:{title:P(`开始处理 ${r.type||"未知项目"}`,`Started handling ${r.type||"unknown item"}`),detail:""};if(n===Je.ITEM_UPDATED&&r.type===Le.TODO_LIST)return{kind:"todo",title:P("更新待办列表","Update todo list"),detail:zn(r.items)};if(n===Je.ITEM_COMPLETED){if(r.type===Le.AGENT_MESSAGE&&r.text)return{kind:"result",title:P(`${t} 已返回结果`,`${t} returned a result`),detail:""};if(r.type===Le.WEB_SEARCH)return Lo(r,"completed");if(r.type===Le.COLLAB_TOOL_CALL)return No(r,"completed");if(r.type===Le.FILE_CHANGE)return Oo(r,"completed");if(r.type===Le.COMMAND_EXECUTION){const o=r.exit_code===0||r.status==="completed";return{kind:o?"command":"error",title:o?P("命令执行完成","Command completed"):P(`命令执行失败(exit ${r.exit_code??"?"})`,`Command failed (exit ${r.exit_code??"?"})`),detail:[r.command,Pl(r.aggregated_output)].filter(Boolean).join(`
218
+
219
+ `)}}return r.type===Le.TODO_LIST?{kind:"todo",title:P("更新待办列表","Update todo list"),detail:zn(r.items)}:{title:P(`完成 ${r.type||"未知项目"}`,`Completed ${r.type||"unknown item"}`),detail:""}}return{title:P(`事件: ${n}`,`Event: ${n}`),detail:""}}function ql(e){return e.status==="queued"?P("排队中","Queued"):e.status==="starting"?P("启动中","Starting"):e.status==="stopping"?P("停止中","Stopping"):e.status==="running"?P("进行中","Running"):e.status==="error"?P("失败","Failed"):e.status==="interrupted"?P("已中断","Interrupted"):e.status==="stopped"?P("已停止","Stopped"):e.status==="stop_timeout"?P("停止超时","Stop timeout"):P("已完成","Completed")}function qr(e={},t){if(typeof e=="string"){const r=e.trim();return r?{id:t(),kind:"info",title:r,detail:""}:null}const u=String(e.title||"").trim(),n=String(e.detail||"").trim();return!u&&!n?null:{id:t(),kind:e.kind||"info",title:u||n,detail:u?n:""}}function Ul(e={},t){const u=Array.isArray(e.promptBlocks)?e.promptBlocks.map(n=>({...n,meta:n!=null&&n.meta?{...n.meta}:{},content:(n==null?void 0:n.type)==="image"?ln(n.content):n.content})):[];return{id:t(),runId:String(e.id||"").trim(),engine:bn(e),prompt:String(e.prompt||"").trim(),promptBlocks:u,status:"completed",startedAt:e.startedAt||e.createdAt||"",finishedAt:e.finishedAt||"",events:[],eventCount:Math.max(0,Number(e.eventCount)||(Array.isArray(e.events)?e.events.length:0)),eventsLoaded:!!e.eventsIncluded,eventsLoading:!1,responseMessage:"",errorMessage:"",lastEventSeq:0,summary:wu()}}function Vt(e,t,u){const n=qr(t,u);n&&(e.events.push(n),e.events.length>120&&e.events.splice(0,e.events.length-120))}function jl(e,t,u){var r;const n=qr(t,u);if(n){for(let o=e.events.length-1;o>=0;o-=1){const i=P("网络异常,正在重试","Network error, retrying");if(String(((r=e.events[o])==null?void 0:r.title)||"").startsWith(i)){e.events.splice(o,1,n);return}}e.events.push(n),e.events.length>120&&e.events.splice(0,e.events.length-120)}}function Vl(e,t={},u,n=()=>{}){var o,i,s,a,d,c,f,m,k,g,F,B;const r=kr(t.type);if(r===wt.SESSION){n(t.session),e.engine=bn(t.session||e),Vt(e,{title:P(`已连接项目:${((o=t.session)==null?void 0:o.title)||"未命名项目"}`,`Connected project: ${((i=t.session)==null?void 0:i.title)||"Untitled Project"}`),detail:(s=t.session)!=null&&s.cwd?P(`工作目录:${t.session.cwd}`,`Working directory: ${t.session.cwd}`):""},u);return}if(r===wt.SESSION_UPDATED){n(t.session),e.engine=bn(t.session||e),Vt(e,{title:P("项目会话已更新","Project session updated"),detail:(a=t.session)!=null&&a.started?P("后续请求会继续复用当前项目的执行引擎会话。","Subsequent requests will continue reusing the current engine session for this project."):""},u);return}if(r===wt.STATUS){if(t.stage==="starting"||t.stage==="resuming")return;Vt(e,{title:t.message||P("状态已更新","Status updated"),detail:""},u);return}if(r===wt.STDERR){const x=yu(t.text,e.engine);Vt(e,{kind:"error",title:(x==null?void 0:x.title)||"stderr",detail:lu(t.text,e.engine)},u);return}if(r===wt.STDOUT){Vt(e,{kind:"command",title:"stdout",detail:t.text},u);return}if(r===wt.AGENT_EVENT){Rl(e,t.event);const x=zl(t.event,pt(e),e.engine);String(x.title||"").startsWith(P("网络异常,正在重试","Network error, retrying"))?jl(e,x,u):Vt(e,x,u),((d=t.event)==null?void 0:d.type)===Je.ITEM_COMPLETED&&((f=(c=t.event)==null?void 0:c.item)==null?void 0:f.type)===Le.AGENT_MESSAGE&&((k=(m=t.event)==null?void 0:m.item)!=null&&k.text)&&(e.responseMessage=t.event.item.text);const v=Lu(t.event)||P(`${pt(e)} 执行失败`,`${pt(e)} failed`);if(!(((g=t.event)==null?void 0:g.type)==="error"?mo(v):null)&&(((F=t.event)==null?void 0:F.type)===Je.ERROR||((B=t.event)==null?void 0:B.type)===Je.TURN_FAILED)){const L=Lu(t.event)||P(`${pt(e)} 执行失败`,`${pt(e)} failed`);e.errorMessage=lu(L,e.engine),e.status="error"}return}if(r===wt.COMPLETED){Vt(e,{kind:"result",title:P("本轮执行结束","Run finished"),detail:""},u),t.message&&(e.responseMessage=t.message);return}if(r===wt.STOPPED){Vt(e,{title:t.message||P("执行已手动停止","Execution stopped manually"),detail:""},u);return}if(r===wt.ERROR){const x=yu(t.message,e.engine);Vt(e,{kind:"error",title:(x==null?void 0:x.title)||P("执行失败","Execution failed"),detail:lu(t.message||P(`${pt(e)} 执行失败`,`${pt(e)} failed`),e.engine)},u)}}function Hl(e="",t="",u="codex"){const n=String(e||"").trim(),r=String(t||"").trim();if(!r)return!1;if(!n||/no last agent message|wrote empty content/i.test(n)||/执行失败[。.]?$/i.test(n))return!0;const o=yu(n,u),i=yu(r,u);return!o&&!!i}function Wl(e,t={}){e.status=t.status||"completed",e.responseMessage=String(t.responseMessage||e.responseMessage||""),e.finishedAt=String(t.finishedAt||e.finishedAt||"");const u=lu(String(t.errorMessage||""),e.engine),n=String(e.errorMessage||"");return e.errorMessage=Hl(t.errorMessage,n,e.engine)?n:u,e.status==="completed"&&!e.responseMessage&&(e.responseMessage=P(`本轮 ${pt(e)} 执行已完成,没有返回额外文本。`,`${pt(e)} completed in this run without returning additional text.`)),e}function go(e,t={},u,n=()=>{}){const r=Math.max(0,Number(t==null?void 0:t.seq)||0);if(r&&r<=Number(e.lastEventSeq||0))return!1;const o=(t==null?void 0:t.payload)||{};Vl(e,o,u,n);const i=kr(o.type);return i===wt.COMPLETED?(e.status="completed",e.finishedAt=new Date().toISOString()):i===wt.STOPPED?(e.status="stopped",e.errorMessage="",e.finishedAt=new Date().toISOString()):i===wt.ERROR&&(e.status="error",e.errorMessage=lu(String(o.message||e.errorMessage||P(`${pt(e)} 执行失败`,`${pt(e)} failed`)),e.engine),e.finishedAt=new Date().toISOString()),r&&(e.lastEventSeq=r),e.eventCount=Math.max(Math.max(0,Number(e.eventCount)||0),r,Array.isArray(e.events)?e.events.length:0),(r||Array.isArray(e.events)&&e.events.length)&&(e.eventsLoaded=!0),!0}function zo(e,t,u,n){const r=Ul(e,t);return(e.events||[]).forEach(o=>{go(r,o,u,n)}),Wl(r,e)}const Kl=1800,Gl=7200;function Zl(){return{commandCount:0,webSearchCount:0,fileChangeCount:0,subAgentCount:0,waitingAgentCount:0,currentActivity:"",latestActivity:"",latestDetail:""}}function Xl(e={}){const{props:t,turns:u,sessions:n,sending:r,sendingStartedAt:o,currentRunningRunId:i,sessionError:s,supportsServerEvents:a,scheduleScrollToBottom:d,resetAutoStickToBottom:c,mergeSessionRecord:f,mergeSession:m,loadSessions:k}=e;let g=0,F=0,B=null,x="",v=null,D="",L=0;const $=new Map;function te(){return g+=1,g}function C(){return F+=1,F}function Q(){v&&(window.clearInterval(v),v=null)}function J(){L=Date.now()}function N(){$.clear(),u.value=[],r.value=!1,o.value=0,i.value="",D="",x="",g=0,F=0,c()}function z(){const q=[...u.value].reverse().find(H=>Ru(H.status))||null;if(i.value=(q==null?void 0:q.runId)||"",r.value=!!q,q!=null&&q.startedAt){const H=Date.parse(String(q.startedAt||""));o.value=Number.isFinite(H)?H:Date.now();return}o.value=0}function ue(q=null){return q?{...q}:Zl()}function ae(q,H=null){if(!(H!=null&&H.runId)||q.eventsLoaded||!H.eventsLoaded)return $.has(q.runId)&&(q.eventsLoading=!0),q;const Y=Math.max(Math.max(0,Number(H.lastEventSeq)||0),Math.max(0,Number(H.eventCount)||0),Array.isArray(H.events)?H.events.length:0),be=Math.max(0,Number(q.eventCount)||0);return Y<be?($.has(q.runId)&&(q.eventsLoading=!0),q):(q.events=Array.isArray(H.events)?[...H.events]:[],q.eventCount=Math.max(Math.max(0,Number(q.eventCount)||0),Math.max(0,Number(H.eventCount)||0),q.events.length),q.eventsLoaded=!0,q.eventsLoading=$.has(q.runId),q.lastEventSeq=Math.max(0,Number(H.lastEventSeq)||0),q.summary=ue(H.summary),q)}function ge(q,H){const Y=uo(u.value,q);return Y?(Y.eventsLoading=!!H,u.value=[...u.value],Y):null}async function de(q,H={}){const Y=String((q==null?void 0:q.runId)||"").trim(),{force:be=!1}=H;if(!Y)return[];const se=uo(u.value,Y)||q;if(se!=null&&se.eventsLoaded&&!be)return se.events;if($.has(Y))return $.get(Y);ge(Y,!0);const Ae=(async()=>{var _e;try{const Be=await Ls(Y,{limit:5e3}),De=Bl(u.value,Y,Be,C,re=>{m(re,{preserveRunning:!0})});return De?(u.value=[...u.value],t.active&&((_e=u.value.at(-1))==null?void 0:_e.runId)===Y&&d(),De.events):Array.isArray(se==null?void 0:se.events)?se.events:[]}catch(Be){throw s.value=Be.message,Be}finally{ge(Y,!1),$.delete(Y)}})();return $.set(Y,Ae),Ae}function ke(q,H){const Y=String(q||"").trim();if(!Y||!H)return!1;const be=u.value.findIndex(_e=>_e.runId===Y);if(be<0)return!1;const se=u.value[be];return go(se,H,C,_e=>{m(_e,{preserveRunning:!0})})&&(u.value=[...u.value],z(),d()),!0}function U(){Q(),!(a||!t.active||!r.value||!t.taskSlug)&&(v=window.setInterval(()=>{S({force:!0}).catch(()=>{});const q=Date.now();q-L<Gl||(L=q,k({force:!0}).catch(()=>{}))},Kl))}function K(q=[]){const H=[...n.value],Y=new Map(u.value.filter(se=>String((se==null?void 0:se.runId)||"").trim()).map(se=>[String(se.runId||"").trim(),se])),be=se=>{if(!(se!=null&&se.id))return;const Ae=H.findIndex(_e=>_e.id===se.id);Ae>=0?H[Ae]=f(H[Ae],se,{preserveRunning:!0}):H.unshift(f(null,se,{preserveRunning:!0}))};g=0,F=0,u.value=[...q||[]].reverse().map(se=>{const Ae=zo(se,te,C,be);return ae(Ae,Y.get(String((se==null?void 0:se.id)||"").trim())||null)}),n.value=H,z()}async function S(q={}){const{force:H=!1,scrollToLatest:Y=!1}=q,be=String(t.taskSlug||"").trim();if(!(!be||!t.active&&!H))return B&&x===be||B&&!H||(x=be,B=(async()=>{try{const Ae=(await Rs(be,{limit:30,events:"latest"})).items||[],_e=JSON.stringify(Ae.map(re=>({id:re.id,status:re.status,updatedAt:re.updatedAt,eventCount:Math.max(0,Number(re.eventCount)||0)}))),Be=Y||D&&_e!==D;K(Ae),D=_e,U();const De=u.value.at(-1)||null;De!=null&&De.runId&&!De.eventsLoaded&&de(De).catch(()=>{}),Be&&d()}catch(se){s.value=se.message}finally{B=null,x=""}})()),B}function X(q={}){const H=(q==null?void 0:q.run)||null,Y=(q==null?void 0:q.session)||null;if(Y&&m(Y,{preserveRunning:!0}),!(H!=null&&H.id)){z(),d({force:!0});return}const se=zo(H,te,C,_e=>{m(_e,{preserveRunning:!0})}),Ae=u.value.findIndex(_e=>_e.runId===se.runId);if(Ae>=0){const _e=[...u.value];_e.splice(Ae,1,se),u.value=_e}else u.value=[...u.value,se];z(),d({force:!0})}async function fe(){if(!(!t.taskSlug||r.value))try{await Os(t.taskSlug),N(),d({force:!0})}catch(q){s.value=q.message}}return{applyCreatedRun:X,applyIncomingRunEvent:ke,clearRunPollTimer:Q,clearTurns:fe,loadTurnEvents:de,markFallbackSessionPollNow:J,refreshRunHistory:S,resetRunHistoryState:N,syncRunningStateFromTurns:z,updatePollingState:U}}const Yl=1500,Jl=3e4;function Ql(e={}){const{props:t,sessions:u,workspaces:n,loading:r,managerBusy:o,sending:i,stopping:s,sessionError:a,showManager:d,selectedSessionId:c,currentRunningRunId:f,supportsServerEvents:m,mergeSession:k,applyCreatedRun:g,refreshRunHistory:F,markFallbackSessionPollNow:B}=e;let x=null,v=null,D=0,L=0;const $=ce(()=>typeof t.buildPrompt=="function"||!!String(t.prompt||"").trim()),te=ce(()=>u.value.length>0),C=ce(()=>Ro(u.value,c.value)),Q=ce(()=>te.value?"":Pe("projectManager.noProjects"));async function J(q={}){const{force:H=!1}=q;if(x)return x;const Y=Date.now();return!H&&D&&Y-D<Yl?{items:u.value,workspaces:n.value}:(x=(async()=>{r.value=!0,a.value="";try{const se=(await As()).items||[];return u.value=se,D=Date.now(),{items:se,workspaces:n.value}}catch(be){throw a.value=be.message,be}finally{r.value=!1,x=null}})(),x)}async function N(q={}){const{force:H=!1}=q;if(v)return v;const Y=Date.now();return!H&&L&&Y-L<Jl?{items:n.value}:(v=(async()=>{try{const be=await Ds();return n.value=be.items||[],L=Date.now(),{items:n.value}}finally{v=null}})(),v)}async function z(q={}){const{forceSessions:H=!1,forceWorkspaces:Y=!1}=q,[be,se]=await Promise.all([J({force:H}),N({force:Y})]);return{items:(be==null?void 0:be.items)||u.value,workspaces:(se==null?void 0:se.items)||n.value}}function ue(q=""){const H=String(q||"").trim();!H||n.value.includes(H)||(n.value=[H,...n.value])}function ae(){d.value=!0,N().catch(()=>{})}function ge(){d.value=!1}function de(q){const H=String(q||"").trim();if(t.sessionSelectionLocked&&H&&H!==c.value){a.value=t.sessionSelectionLockReason||Pe("taskActions.sessionLocked");return}c.value=H}function ke(){z({forceSessions:!0,forceWorkspaces:!0}).catch(()=>{})}async function U(q){o.value=!0,a.value="";try{const H=await Is(q);return k(H),ue(H.cwd),c.value=H.id,H}catch(H){throw a.value=H.message,H}finally{o.value=!1}}async function K(q,H){o.value=!0,a.value="";try{const Y=await Fs(q,H);return k(Y),ue(Y.cwd),Y}catch(Y){throw a.value=Y.message,Y}finally{o.value=!1}}async function S(q){var Y;const H=String(q||"").trim();if(!H)return{deletedSessionId:"",selectedSessionId:c.value};o.value=!0,a.value="";try{await $s(H);const be=u.value.filter(Ae=>Ae.id!==H);u.value=be;let se=c.value;return c.value===H&&(se=((Y=Ro(be,"")[0])==null?void 0:Y.id)||"",c.value=se),{deletedSessionId:H,selectedSessionId:se}}catch(be){throw a.value=be.message,be}finally{o.value=!1}}async function X(){if(!t.taskSlug||!$.value||i.value||s.value)return!1;if(!c.value)return ae(),a.value=Pe("projectManager.selectProject"),!1;a.value="";try{await z({forceSessions:!0});const q=u.value.find(se=>se.id===c.value)||null;if(!q)return a.value=Pe("projectManager.projectMissing"),!1;if(q.running)return a.value=Pe("sessionTurns.currentProjectRunning"),!1;const H=typeof t.buildPrompt=="function"?await t.buildPrompt():t.prompt,Y=typeof t.buildPromptBlocks=="function"?await t.buildPromptBlocks():[];if(!String(H||"").trim())return a.value=Pe("sessionTurns.noPromptToSend"),!1;const be=await Ns(t.taskSlug,{sessionId:c.value,prompt:H,promptBlocks:Y});return g(be),typeof t.afterSend=="function"&&Promise.resolve(t.afterSend()).catch(se=>{console.error("[promptx] afterSend failed",se)}),m||(B(),Promise.all([F({force:!0}),J({force:!0})]).catch(se=>{a.value=se.message})),!0}catch(q){return a.value=q.message,!1}}async function fe(){if(!(!f.value||s.value))try{s.value=!0,await zs(f.value),m||(B(),await Promise.all([F({force:!0}),J({force:!0})]))}catch(q){s.value=!1,a.value=q.message}}return{closeManager:ge,handleCreateSession:U,handleDeleteSession:S,handleSelectSession:de,handleSend:X,handleUpdateSession:K,hasPrompt:$,helperText:Q,loadSessions:J,loadSessionResources:z,loadWorkspaces:N,openManager:ae,refreshSessionsForSelection:ke,sortedSessions:C,stopSending:fe}}function ec(e={}){const{transcriptRef:t,hasNewerMessages:u,threshold:n=48}=e;let r=0,o=[],i=!1,s=!1,a=0,d=!0;function c(){if(typeof window>"u"||!o.length){o=[];return}o.forEach(J=>{window.cancelAnimationFrame(J)}),o=[]}function f(){r+=1,c()}function m(J){s=!!J,(u==null?void 0:u.value)!==void 0&&(u.value=s)}function k(){i=!1,a+=1,d=!0,m(!1)}function g(J=t==null?void 0:t.value){return J?J.scrollHeight-J.scrollTop-J.clientHeight<=n:!0}function F(){return d&&!i}function B(){d&&!i&&m(!1)}function x(){if(d=g(),!d){f();return}B()}function v(){a+=1,i=!0,f()}function D(){const J=a+1;a=J,Ie(()=>{J===a&&requestAnimationFrame(()=>{J===a&&(i=!1,d=g(),B())})})}function L(){i=!0,f()}function $(){D()}function te(J={}){const{force:N=!1}=J;N&&k(),f();const z=r;Ie(()=>{if(!(t==null?void 0:t.value)||z!==r)return;if(!N&&!F()){m(!0);return}const ae=()=>{const de=t==null?void 0:t.value;!de||z!==r||(de.scrollTop=de.scrollHeight,d=!0,m(!1))};ae(),o=[requestAnimationFrame(()=>{ae(),o=[requestAnimationFrame(ae)]})]})}function C(){te({force:!0})}function Q(){a+=1,f()}return{cancelScheduledScrollToBottom:f,destroy:Q,handleTranscriptScroll:x,handleTranscriptTouchEnd:$,handleTranscriptTouchMove:L,handleTranscriptTouchStart:v,isTranscriptNearBottom:g,resetAutoStickToBottom:k,scheduleScrollToBottom:te,scrollToBottom:C}}const tc=150;function uc(e,t){const u=Br(),n=V([]),r=V([]),o=V(!1),i=V(!1),s=V(!1),a=V(!1),d=V(""),c=V([]),f=V(null),m=V(0),k=V(0),g=V(!1),F=V(""),B=V(!1),x=typeof window<"u"&&typeof window.EventSource<"u";let v=null,D=null,L=null,$={sessions:!1,runs:!1};const te=ce({get(){return String(e.selectedSessionId||"").trim()},set(y){t("selected-session-change",String(y||"").trim())}}),C=ce(()=>a.value?Pe("sessionPanel.stopping"):`${Pe("projectManager.running")} (${Rr(k.value)})`),{destroy:Q,handleTranscriptScroll:J,handleTranscriptTouchEnd:N,handleTranscriptTouchMove:z,handleTranscriptTouchStart:ue,resetAutoStickToBottom:ae,scheduleScrollToBottom:ge,scrollToBottom:de}=ec({transcriptRef:f,hasNewerMessages:B});function ke(y,ve,Re={}){const{preserveRunning:st=!1}=Re;return ve!=null&&ve.id?st?{...ve,running:!!(y!=null&&y.running)}:ve:y||null}function U(y,ve={}){if(!(y!=null&&y.id))return;const Re=[...n.value],st=Re.findIndex(Mt=>Mt.id===y.id);st>=0?Re[st]=ke(Re[st],y,ve):Re.unshift(ke(null,y,ve)),n.value=Re}const{applyCreatedRun:K,applyIncomingRunEvent:S,clearRunPollTimer:X,clearTurns:fe,loadTurnEvents:q,markFallbackSessionPollNow:H,refreshRunHistory:Y,resetRunHistoryState:be,updatePollingState:se}=Xl({props:e,turns:c,sessions:n,sending:s,sendingStartedAt:m,currentRunningRunId:F,sessionError:d,supportsServerEvents:x,scheduleScrollToBottom:ge,resetAutoStickToBottom:ae,mergeSessionRecord:ke,mergeSession:U,loadSessions:(...y)=>He(...y)}),{closeManager:Ae,handleCreateSession:_e,handleDeleteSession:Be,handleSelectSession:De,handleSend:re,handleUpdateSession:Ke,helperText:Xe,loadSessions:He,loadSessionResources:lt,loadWorkspaces:Ye,openManager:Ge,refreshSessionsForSelection:ct,sortedSessions:mt,stopSending:ot}=Ql({props:e,sessions:n,workspaces:r,loading:o,managerBusy:i,sending:s,stopping:a,sessionError:d,showManager:g,selectedSessionId:te,currentRunningRunId:F,supportsServerEvents:x,mergeSession:U,applyCreatedRun:K,refreshRunHistory:Y,markFallbackSessionPollNow:H});function Ve(){v&&(window.clearInterval(v),v=null)}function gt(){Ve(),m.value||(m.value=Date.now()),k.value=Math.max(0,Math.floor((Date.now()-m.value)/1e3)),v=window.setInterval(()=>{k.value=Math.max(0,Math.floor((Date.now()-m.value)/1e3))},1e3)}function bt(){L&&(window.clearTimeout(L),L=null)}function _t(){bt();const y=$;$={sessions:!1,runs:!1},y.sessions&&He({force:!0}).catch(()=>{}),y.runs&&Y({force:!0}).catch(()=>{})}function Qe(y={}){typeof window>"u"||($={sessions:$.sessions||!!y.sessions,runs:$.runs||!!y.runs},!(L||!$.sessions&&!$.runs)&&(L=window.setTimeout(()=>{_t()},tc)))}function it(y){return Nr(y,{currentRunningRunId:F.value,runningElapsedSeconds:k.value,nowMs:Date.now()})}function Oe(y=""){if(!y)return"";const ve=new Date(y);return Number.isNaN(ve.getTime())?"":ve.toLocaleTimeString(Sn(),{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Ce(y){return y.status==="error"||y.status==="stop_timeout"?"theme-process-error":y.status==="interrupted"||y.status==="stopped"?"theme-process-stopped":y.status==="completed"?"theme-process-completed":"theme-process-running"}function me(y){return!!(y.responseMessage||y.errorMessage||y.status==="completed")}return Ee(s,y=>{y?(m.value||(m.value=Date.now()),gt()):(Ve(),m.value=0,k.value=0,a.value=!1),se(),t("sending-change",y)},{immediate:!0}),Ee(()=>!!e.taskRunning,y=>{!e.active||y||!s.value||Qe({sessions:!0,runs:!0})}),Ee(()=>e.active,y=>{if(y){lt({forceSessions:!0}).catch(()=>{});return}bt(),X()},{immediate:!0}),Ee(()=>e.taskSlug,()=>{be(),g.value=!1,d.value="",e.active&&Y({force:!0,scrollToLatest:!0}).catch(()=>{})},{immediate:!0}),at(()=>{Ve(),X(),bt(),Q(),D==null||D()}),Ee(()=>u.readyVersion.value,()=>{const y=String(e.taskSlug||"").trim();!e.active&&!g.value||(g.value&&Ye().catch(()=>{}),Qe({sessions:!0,runs:!!y}))}),Ee(()=>u.sessionsSyncVersion.value,()=>{!e.active&&!g.value||Qe({sessions:!0})}),Ee(()=>u.getTaskRunSyncVersion(e.taskSlug),()=>{!e.active||!e.taskSlug||Qe({sessions:!0,runs:!0})}),Ee(()=>String(e.taskSlug||"").trim(),y=>{D==null||D(),D=null,y&&(D=$l(y,({runId:ve,event:Re})=>{if(!e.active)return;S(ve,Re)||Qe({sessions:!0,runs:!0})}))},{immediate:!0}),{clearTurns:fe,closeManager:Ae,formatTurnTime:Oe,getProcessCardClass:Ce,getProcessStatus:ql,getTurnAgentLabel:pt,getTurnSummaryDetail:zr,getDisplayTurnSummaryItems:it,getTurnSummaryStatus:Or,handleCreateSession:_e,handleDeleteSession:Be,handleSelectSession:De,handleSend:re,handleUpdateSession:Ke,loadTurnEvents:q,hasTurnSummary:Nl,helperText:Xe,loading:o,managerBusy:i,openManager:Ge,refreshSessionsForSelection:ct,selectedSessionId:te,sending:s,stopping:a,sessionError:d,shouldShowResponse:me,showManager:g,sortedSessions:mt,stopSending:ot,hasNewerMessages:B,transcriptRef:f,turns:c,workspaces:r,workingLabel:C,sessions:n,loadSessions:He,handleTranscriptScroll:J,handleTranscriptTouchEnd:N,handleTranscriptTouchMove:z,handleTranscriptTouchStart:ue,scrollToBottom:de}}const nc=8,oc=320,rc=10,ic=400;function qo(e,t,u){const n=String(e||"").trimEnd();return n?n.split(/\r?\n/).length>t||n.length>u:!1}function sc(e={}){const{turns:t,loadTurnEvents:u}=e,n=V({}),r=V({}),o=V({});function i(C){return String((C==null?void 0:C.runId)||(C==null?void 0:C.id)||"").trim()}function s(C){const Q=i(C);return!!Q&&Q===i(t.value.at(-1))}function a(C){return Math.max(Math.max(0,Number(C==null?void 0:C.eventCount)||0),Array.isArray(C==null?void 0:C.events)?C.events.length:0)}function d(C){return!Ru(C==null?void 0:C.status)&&!s(C)&&a(C)>3}function c(C){return qo(C==null?void 0:C.prompt,nc,oc)}function f(C){return!Ru(C==null?void 0:C.status)&&!s(C)&&c(C)}function m(C){return String((C==null?void 0:C.errorMessage)||(C==null?void 0:C.responseMessage)||"")}function k(C){return qo(m(C),rc,ic)}function g(C){return!(C!=null&&C.errorMessage)&&!s(C)&&k(C)}function F(C){return a(C)>0}function B(C=[]){const Q=new Set((C||[]).map(z=>i(z)).filter(Boolean));n.value=Object.fromEntries(Object.entries(n.value).filter(([z])=>Q.has(z))),r.value=Object.fromEntries(Object.entries(r.value).filter(([z])=>Q.has(z))),o.value=Object.fromEntries(Object.entries(o.value).filter(([z])=>Q.has(z)));const J=(C||[]).at(-1)||null,N=i(J);N&&(Object.prototype.hasOwnProperty.call(n.value,N)||(n.value={...n.value,[N]:!1}),Object.prototype.hasOwnProperty.call(r.value,N)||(r.value={...r.value,[N]:!1}),Object.prototype.hasOwnProperty.call(o.value,N)||(o.value={...o.value,[N]:!1}))}function x(C){const Q=i(C);return Q?Object.prototype.hasOwnProperty.call(n.value,Q)?!!n.value[Q]:d(C):!1}async function v(C){const Q=i(C);if(!Q)return;const J=!x(C);n.value={...n.value,[Q]:J},!J&&F(C)&&!C.eventsLoaded&&!C.eventsLoading&&await u(C).catch(()=>{})}function D(C){const Q=i(C);return Q?Object.prototype.hasOwnProperty.call(r.value,Q)?!!r.value[Q]:f(C):!1}function L(C){const Q=i(C);!Q||!c(C)||(r.value={...r.value,[Q]:!D(C)})}function $(C){const Q=i(C);return Q?Object.prototype.hasOwnProperty.call(o.value,Q)?!!o.value[Q]:g(C):!1}function te(C){const Q=i(C);!Q||!k(C)||(o.value={...o.value,[Q]:!$(C)})}return Ee(t,C=>{B(C)},{immediate:!0,deep:!0}),{canCollapsePrompt:c,canCollapseResponse:k,getTurnEventCollapseKey:i,getTurnEventCount:a,hasTurnEventHistory:F,isLatestTurn:s,isPromptCollapsed:D,isResponseCollapsed:$,isTurnEventsCollapsed:x,togglePrompt:L,toggleResponse:te,toggleTurnEvents:v}}const Uo={};function ac(e){let t=Uo[e];if(t)return t;t=Uo[e]=[];for(let u=0;u<128;u++){const n=String.fromCharCode(u);t.push(n)}for(let u=0;u<e.length;u++){const n=e.charCodeAt(u);t[n]="%"+("0"+n.toString(16).toUpperCase()).slice(-2)}return t}function ku(e,t){typeof t!="string"&&(t=ku.defaultChars);const u=ac(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(n){let r="";for(let o=0,i=n.length;o<i;o+=3){const s=parseInt(n.slice(o+1,o+3),16);if(s<128){r+=u[s];continue}if((s&224)===192&&o+3<i){const a=parseInt(n.slice(o+4,o+6),16);if((a&192)===128){const d=s<<6&1984|a&63;d<128?r+="��":r+=String.fromCharCode(d),o+=3;continue}}if((s&240)===224&&o+6<i){const a=parseInt(n.slice(o+4,o+6),16),d=parseInt(n.slice(o+7,o+9),16);if((a&192)===128&&(d&192)===128){const c=s<<12&61440|a<<6&4032|d&63;c<2048||c>=55296&&c<=57343?r+="���":r+=String.fromCharCode(c),o+=6;continue}}if((s&248)===240&&o+9<i){const a=parseInt(n.slice(o+4,o+6),16),d=parseInt(n.slice(o+7,o+9),16),c=parseInt(n.slice(o+10,o+12),16);if((a&192)===128&&(d&192)===128&&(c&192)===128){let f=s<<18&1835008|a<<12&258048|d<<6&4032|c&63;f<65536||f>1114111?r+="����":(f-=65536,r+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),o+=9;continue}}r+="�"}return r})}ku.defaultChars=";/?:@&=+$,#";ku.componentChars="";const jo={};function lc(e){let t=jo[e];if(t)return t;t=jo[e]=[];for(let u=0;u<128;u++){const n=String.fromCharCode(u);/^[0-9a-z]$/i.test(n)?t.push(n):t.push("%"+("0"+u.toString(16).toUpperCase()).slice(-2))}for(let u=0;u<e.length;u++)t[e.charCodeAt(u)]=e[u];return t}function Uu(e,t,u){typeof t!="string"&&(u=t,t=Uu.defaultChars),typeof u>"u"&&(u=!0);const n=lc(t);let r="";for(let o=0,i=e.length;o<i;o++){const s=e.charCodeAt(o);if(u&&s===37&&o+2<i&&/^[0-9a-f]{2}$/i.test(e.slice(o+1,o+3))){r+=e.slice(o,o+3),o+=2;continue}if(s<128){r+=n[s];continue}if(s>=55296&&s<=57343){if(s>=55296&&s<=56319&&o+1<i){const a=e.charCodeAt(o+1);if(a>=56320&&a<=57343){r+=encodeURIComponent(e[o]+e[o+1]),o++;continue}}r+="%EF%BF%BD";continue}r+=encodeURIComponent(e[o])}return r}Uu.defaultChars=";/?:@&=+$,-_.!~*'()#";Uu.componentChars="-_.!~*'()";function bo(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function vn(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const cc=/^([a-z0-9.+-]+:)/i,dc=/:[0-9]*$/,fc=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,pc=["<",">",'"',"`"," ","\r",`
220
+ `," "],hc=["{","}","|","\\","^","`"].concat(pc),mc=["'"].concat(hc),Vo=["%","/","?",";","#"].concat(mc),Ho=["/","?","#"],gc=255,Wo=/^[+a-z0-9A-Z_-]{0,63}$/,bc=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Ko={javascript:!0,"javascript:":!0},Go={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vo(e,t){if(e&&e instanceof vn)return e;const u=new vn;return u.parse(e,t),u}vn.prototype.parse=function(e,t){let u,n,r,o=e;if(o=o.trim(),!t&&e.split("#").length===1){const d=fc.exec(o);if(d)return this.pathname=d[1],d[2]&&(this.search=d[2]),this}let i=cc.exec(o);if(i&&(i=i[0],u=i.toLowerCase(),this.protocol=i,o=o.substr(i.length)),(t||i||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(r=o.substr(0,2)==="//",r&&!(i&&Ko[i])&&(o=o.substr(2),this.slashes=!0)),!Ko[i]&&(r||i&&!Go[i])){let d=-1;for(let g=0;g<Ho.length;g++)n=o.indexOf(Ho[g]),n!==-1&&(d===-1||n<d)&&(d=n);let c,f;d===-1?f=o.lastIndexOf("@"):f=o.lastIndexOf("@",d),f!==-1&&(c=o.slice(0,f),o=o.slice(f+1),this.auth=c),d=-1;for(let g=0;g<Vo.length;g++)n=o.indexOf(Vo[g]),n!==-1&&(d===-1||n<d)&&(d=n);d===-1&&(d=o.length),o[d-1]===":"&&d--;const m=o.slice(0,d);o=o.slice(d),this.parseHost(m),this.hostname=this.hostname||"";const k=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!k){const g=this.hostname.split(/\./);for(let F=0,B=g.length;F<B;F++){const x=g[F];if(x&&!x.match(Wo)){let v="";for(let D=0,L=x.length;D<L;D++)x.charCodeAt(D)>127?v+="x":v+=x[D];if(!v.match(Wo)){const D=g.slice(0,F),L=g.slice(F+1),$=x.match(bc);$&&(D.push($[1]),L.unshift($[2])),L.length&&(o=L.join(".")+o),this.hostname=D.join(".");break}}}}this.hostname.length>gc&&(this.hostname=""),k&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const s=o.indexOf("#");s!==-1&&(this.hash=o.substr(s),o=o.slice(0,s));const a=o.indexOf("?");return a!==-1&&(this.search=o.substr(a),o=o.slice(0,a)),o&&(this.pathname=o),Go[u]&&this.hostname&&!this.pathname&&(this.pathname=""),this};vn.prototype.parseHost=function(e){let t=dc.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const vc=Object.freeze(Object.defineProperty({__proto__:null,decode:ku,encode:Uu,format:bo,parse:vo},Symbol.toStringTag,{value:"Module"})),Ur=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,jr=/[\0-\x1F\x7F-\x9F]/,xc=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,xo=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Vr=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Hr=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,yc=Object.freeze(Object.defineProperty({__proto__:null,Any:Ur,Cc:jr,Cf:xc,P:xo,S:Vr,Z:Hr},Symbol.toStringTag,{value:"Module"})),kc=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),_c=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var qn;const wc=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Sc=(qn=String.fromCodePoint)!==null&&qn!==void 0?qn:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function Cc(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=wc.get(e))!==null&&t!==void 0?t:e}var nt;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(nt||(nt={}));const Tc=32;var Jt;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Jt||(Jt={}));function oo(e){return e>=nt.ZERO&&e<=nt.NINE}function Ec(e){return e>=nt.UPPER_A&&e<=nt.UPPER_F||e>=nt.LOWER_A&&e<=nt.LOWER_F}function Ac(e){return e>=nt.UPPER_A&&e<=nt.UPPER_Z||e>=nt.LOWER_A&&e<=nt.LOWER_Z||oo(e)}function Dc(e){return e===nt.EQUALS||Ac(e)}var ut;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(ut||(ut={}));var Yt;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Yt||(Yt={}));class Ic{constructor(t,u,n){this.decodeTree=t,this.emitCodePoint=u,this.errors=n,this.state=ut.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Yt.Strict}startEntity(t){this.decodeMode=t,this.state=ut.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,u){switch(this.state){case ut.EntityStart:return t.charCodeAt(u)===nt.NUM?(this.state=ut.NumericStart,this.consumed+=1,this.stateNumericStart(t,u+1)):(this.state=ut.NamedEntity,this.stateNamedEntity(t,u));case ut.NumericStart:return this.stateNumericStart(t,u);case ut.NumericDecimal:return this.stateNumericDecimal(t,u);case ut.NumericHex:return this.stateNumericHex(t,u);case ut.NamedEntity:return this.stateNamedEntity(t,u)}}stateNumericStart(t,u){return u>=t.length?-1:(t.charCodeAt(u)|Tc)===nt.LOWER_X?(this.state=ut.NumericHex,this.consumed+=1,this.stateNumericHex(t,u+1)):(this.state=ut.NumericDecimal,this.stateNumericDecimal(t,u))}addToNumericResult(t,u,n,r){if(u!==n){const o=n-u;this.result=this.result*Math.pow(r,o)+parseInt(t.substr(u,o),r),this.consumed+=o}}stateNumericHex(t,u){const n=u;for(;u<t.length;){const r=t.charCodeAt(u);if(oo(r)||Ec(r))u+=1;else return this.addToNumericResult(t,n,u,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(t,n,u,16),-1}stateNumericDecimal(t,u){const n=u;for(;u<t.length;){const r=t.charCodeAt(u);if(oo(r))u+=1;else return this.addToNumericResult(t,n,u,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(t,n,u,10),-1}emitNumericEntity(t,u){var n;if(this.consumed<=u)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===nt.SEMI)this.consumed+=1;else if(this.decodeMode===Yt.Strict)return 0;return this.emitCodePoint(Cc(this.result),this.consumed),this.errors&&(t!==nt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,u){const{decodeTree:n}=this;let r=n[this.treeIndex],o=(r&Jt.VALUE_LENGTH)>>14;for(;u<t.length;u++,this.excess++){const i=t.charCodeAt(u);if(this.treeIndex=Fc(n,r,this.treeIndex+Math.max(1,o),i),this.treeIndex<0)return this.result===0||this.decodeMode===Yt.Attribute&&(o===0||Dc(i))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],o=(r&Jt.VALUE_LENGTH)>>14,o!==0){if(i===nt.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Yt.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:u,decodeTree:n}=this,r=(n[u]&Jt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(u,r,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,u,n){const{decodeTree:r}=this;return this.emitCodePoint(u===1?r[t]&~Jt.VALUE_LENGTH:r[t+1],n),u===3&&this.emitCodePoint(r[t+2],n),n}end(){var t;switch(this.state){case ut.NamedEntity:return this.result!==0&&(this.decodeMode!==Yt.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ut.NumericDecimal:return this.emitNumericEntity(0,2);case ut.NumericHex:return this.emitNumericEntity(0,3);case ut.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ut.EntityStart:return 0}}}function Wr(e){let t="";const u=new Ic(e,n=>t+=Sc(n));return function(r,o){let i=0,s=0;for(;(s=r.indexOf("&",s))>=0;){t+=r.slice(i,s),u.startEntity(o);const d=u.write(r,s+1);if(d<0){i=s+u.end();break}i=s+d,s=d===0?i+1:i}const a=t+r.slice(i);return t="",a}}function Fc(e,t,u,n){const r=(t&Jt.BRANCH_LENGTH)>>7,o=t&Jt.JUMP_TABLE;if(r===0)return o!==0&&n===o?u:-1;if(o){const a=n-o;return a<0||a>=r?-1:e[u+a]-1}let i=u,s=i+r-1;for(;i<=s;){const a=i+s>>>1,d=e[a];if(d<n)i=a+1;else if(d>n)s=a-1;else return e[a+r]}return-1}const $c=Wr(kc);Wr(_c);function Kr(e,t=Yt.Legacy){return $c(e,t)}function Mc(e){return Object.prototype.toString.call(e)}function yo(e){return Mc(e)==="[object String]"}const Pc=Object.prototype.hasOwnProperty;function Bc(e,t){return Pc.call(e,t)}function Tn(e){return Array.prototype.slice.call(arguments,1).forEach(function(u){if(u){if(typeof u!="object")throw new TypeError(u+"must be object");Object.keys(u).forEach(function(n){e[n]=u[n]})}}),e}function Gr(e,t,u){return[].concat(e.slice(0,t),u,e.slice(t+1))}function ko(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function xn(e){if(e>65535){e-=65536;const t=55296+(e>>10),u=56320+(e&1023);return String.fromCharCode(t,u)}return String.fromCharCode(e)}const Zr=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Rc=/&([a-z#][a-z0-9]{1,31});/gi,Lc=new RegExp(Zr.source+"|"+Rc.source,"gi"),Nc=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Oc(e,t){if(t.charCodeAt(0)===35&&Nc.test(t)){const n=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return ko(n)?xn(n):e}const u=Kr(e);return u!==e?u:e}function zc(e){return e.indexOf("\\")<0?e:e.replace(Zr,"$1")}function _u(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(Lc,function(t,u,n){return u||Oc(t,n)})}const qc=/[&<>"]/,Uc=/[&<>"]/g,jc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function Vc(e){return jc[e]}function eu(e){return qc.test(e)?e.replace(Uc,Vc):e}const Hc=/[.?*+^$[\]\\(){}|-]/g;function Wc(e){return e.replace(Hc,"\\$&")}function Ne(e){switch(e){case 9:case 32:return!0}return!1}function Nu(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Ou(e){return xo.test(e)||Vr.test(e)}function zu(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function En(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}const Kc={mdurl:vc,ucmicro:yc},Gc=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:Gr,assign:Tn,escapeHtml:eu,escapeRE:Wc,fromCodePoint:xn,has:Bc,isMdAsciiPunct:zu,isPunctChar:Ou,isSpace:Ne,isString:yo,isValidEntityCode:ko,isWhiteSpace:Nu,lib:Kc,normalizeReference:En,unescapeAll:_u,unescapeMd:zc},Symbol.toStringTag,{value:"Module"}));function Zc(e,t,u){let n,r,o,i;const s=e.posMax,a=e.pos;for(e.pos=t+1,n=1;e.pos<s;){if(o=e.src.charCodeAt(e.pos),o===93&&(n--,n===0)){r=!0;break}if(i=e.pos,e.md.inline.skipToken(e),o===91){if(i===e.pos-1)n++;else if(u)return e.pos=a,-1}}let d=-1;return r&&(d=e.pos),e.pos=a,d}function Xc(e,t,u){let n,r=t;const o={ok:!1,pos:0,str:""};if(e.charCodeAt(r)===60){for(r++;r<u;){if(n=e.charCodeAt(r),n===10||n===60)return o;if(n===62)return o.pos=r+1,o.str=_u(e.slice(t+1,r)),o.ok=!0,o;if(n===92&&r+1<u){r+=2;continue}r++}return o}let i=0;for(;r<u&&(n=e.charCodeAt(r),!(n===32||n<32||n===127));){if(n===92&&r+1<u){if(e.charCodeAt(r+1)===32)break;r+=2;continue}if(n===40&&(i++,i>32))return o;if(n===41){if(i===0)break;i--}r++}return t===r||i!==0||(o.str=_u(e.slice(t,r)),o.pos=r,o.ok=!0),o}function Yc(e,t,u,n){let r,o=t;const i={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(n)i.str=n.str,i.marker=n.marker;else{if(o>=u)return i;let s=e.charCodeAt(o);if(s!==34&&s!==39&&s!==40)return i;t++,o++,s===40&&(s=41),i.marker=s}for(;o<u;){if(r=e.charCodeAt(o),r===i.marker)return i.pos=o+1,i.str+=_u(e.slice(t,o)),i.ok=!0,i;if(r===40&&i.marker===41)return i;r===92&&o+1<u&&o++,o++}return i.can_continue=!0,i.str+=_u(e.slice(t,o)),i}const Jc=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:Xc,parseLinkLabel:Zc,parseLinkTitle:Yc},Symbol.toStringTag,{value:"Module"})),Nt={};Nt.code_inline=function(e,t,u,n,r){const o=e[t];return"<code"+r.renderAttrs(o)+">"+eu(o.content)+"</code>"};Nt.code_block=function(e,t,u,n,r){const o=e[t];return"<pre"+r.renderAttrs(o)+"><code>"+eu(e[t].content)+`</code></pre>
221
+ `};Nt.fence=function(e,t,u,n,r){const o=e[t],i=o.info?_u(o.info).trim():"";let s="",a="";if(i){const c=i.split(/(\s+)/g);s=c[0],a=c.slice(2).join("")}let d;if(u.highlight?d=u.highlight(o.content,s,a)||eu(o.content):d=eu(o.content),d.indexOf("<pre")===0)return d+`
222
+ `;if(i){const c=o.attrIndex("class"),f=o.attrs?o.attrs.slice():[];c<0?f.push(["class",u.langPrefix+s]):(f[c]=f[c].slice(),f[c][1]+=" "+u.langPrefix+s);const m={attrs:f};return`<pre><code${r.renderAttrs(m)}>${d}</code></pre>
223
+ `}return`<pre><code${r.renderAttrs(o)}>${d}</code></pre>
224
+ `};Nt.image=function(e,t,u,n,r){const o=e[t];return o.attrs[o.attrIndex("alt")][1]=r.renderInlineAsText(o.children,u,n),r.renderToken(e,t,u)};Nt.hardbreak=function(e,t,u){return u.xhtmlOut?`<br />
225
+ `:`<br>
226
+ `};Nt.softbreak=function(e,t,u){return u.breaks?u.xhtmlOut?`<br />
227
+ `:`<br>
228
+ `:`
229
+ `};Nt.text=function(e,t){return eu(e[t].content)};Nt.html_block=function(e,t){return e[t].content};Nt.html_inline=function(e,t){return e[t].content};function Su(){this.rules=Tn({},Nt)}Su.prototype.renderAttrs=function(t){let u,n,r;if(!t.attrs)return"";for(r="",u=0,n=t.attrs.length;u<n;u++)r+=" "+eu(t.attrs[u][0])+'="'+eu(t.attrs[u][1])+'"';return r};Su.prototype.renderToken=function(t,u,n){const r=t[u];let o="";if(r.hidden)return"";r.block&&r.nesting!==-1&&u&&t[u-1].hidden&&(o+=`
230
+ `),o+=(r.nesting===-1?"</":"<")+r.tag,o+=this.renderAttrs(r),r.nesting===0&&n.xhtmlOut&&(o+=" /");let i=!1;if(r.block&&(i=!0,r.nesting===1&&u+1<t.length)){const s=t[u+1];(s.type==="inline"||s.hidden||s.nesting===-1&&s.tag===r.tag)&&(i=!1)}return o+=i?`>
231
+ `:">",o};Su.prototype.renderInline=function(e,t,u){let n="";const r=this.rules;for(let o=0,i=e.length;o<i;o++){const s=e[o].type;typeof r[s]<"u"?n+=r[s](e,o,t,u,this):n+=this.renderToken(e,o,t)}return n};Su.prototype.renderInlineAsText=function(e,t,u){let n="";for(let r=0,o=e.length;r<o;r++)switch(e[r].type){case"text":n+=e[r].content;break;case"image":n+=this.renderInlineAsText(e[r].children,t,u);break;case"html_inline":case"html_block":n+=e[r].content;break;case"softbreak":case"hardbreak":n+=`
232
+ `;break}return n};Su.prototype.render=function(e,t,u){let n="";const r=this.rules;for(let o=0,i=e.length;o<i;o++){const s=e[o].type;s==="inline"?n+=this.renderInline(e[o].children,t,u):typeof r[s]<"u"?n+=r[s](e,o,t,u,this):n+=this.renderToken(e,o,t,u)}return n};function yt(){this.__rules__=[],this.__cache__=null}yt.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1};yt.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(u){u.enabled&&u.alt.forEach(function(n){t.indexOf(n)<0&&t.push(n)})}),e.__cache__={},t.forEach(function(u){e.__cache__[u]=[],e.__rules__.forEach(function(n){n.enabled&&(u&&n.alt.indexOf(u)<0||e.__cache__[u].push(n.fn))})})};yt.prototype.at=function(e,t,u){const n=this.__find__(e),r=u||{};if(n===-1)throw new Error("Parser rule not found: "+e);this.__rules__[n].fn=t,this.__rules__[n].alt=r.alt||[],this.__cache__=null};yt.prototype.before=function(e,t,u,n){const r=this.__find__(e),o=n||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r,0,{name:t,enabled:!0,fn:u,alt:o.alt||[]}),this.__cache__=null};yt.prototype.after=function(e,t,u,n){const r=this.__find__(e),o=n||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r+1,0,{name:t,enabled:!0,fn:u,alt:o.alt||[]}),this.__cache__=null};yt.prototype.push=function(e,t,u){const n=u||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:n.alt||[]}),this.__cache__=null};yt.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const u=[];return e.forEach(function(n){const r=this.__find__(n);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+n)}this.__rules__[r].enabled=!0,u.push(n)},this),this.__cache__=null,u};yt.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(u){u.enabled=!1}),this.enable(e,t)};yt.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const u=[];return e.forEach(function(n){const r=this.__find__(n);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+n)}this.__rules__[r].enabled=!1,u.push(n)},this),this.__cache__=null,u};yt.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function $t(e,t,u){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=u,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}$t.prototype.attrIndex=function(t){if(!this.attrs)return-1;const u=this.attrs;for(let n=0,r=u.length;n<r;n++)if(u[n][0]===t)return n;return-1};$t.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]};$t.prototype.attrSet=function(t,u){const n=this.attrIndex(t),r=[t,u];n<0?this.attrPush(r):this.attrs[n]=r};$t.prototype.attrGet=function(t){const u=this.attrIndex(t);let n=null;return u>=0&&(n=this.attrs[u][1]),n};$t.prototype.attrJoin=function(t,u){const n=this.attrIndex(t);n<0?this.attrPush([t,u]):this.attrs[n][1]=this.attrs[n][1]+" "+u};function Xr(e,t,u){this.src=e,this.env=u,this.tokens=[],this.inlineMode=!1,this.md=t}Xr.prototype.Token=$t;const Qc=/\r\n?|\n/g,e0=/\0/g;function t0(e){let t;t=e.src.replace(Qc,`
233
+ `),t=t.replace(e0,"�"),e.src=t}function u0(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function n0(e){const t=e.tokens;for(let u=0,n=t.length;u<n;u++){const r=t[u];r.type==="inline"&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function o0(e){return/^<a[>\s]/i.test(e)}function r0(e){return/^<\/a\s*>/i.test(e)}function i0(e){const t=e.tokens;if(e.md.options.linkify)for(let u=0,n=t.length;u<n;u++){if(t[u].type!=="inline"||!e.md.linkify.pretest(t[u].content))continue;let r=t[u].children,o=0;for(let i=r.length-1;i>=0;i--){const s=r[i];if(s.type==="link_close"){for(i--;r[i].level!==s.level&&r[i].type!=="link_open";)i--;continue}if(s.type==="html_inline"&&(o0(s.content)&&o>0&&o--,r0(s.content)&&o++),!(o>0)&&s.type==="text"&&e.md.linkify.test(s.content)){const a=s.content;let d=e.md.linkify.match(a);const c=[];let f=s.level,m=0;d.length>0&&d[0].index===0&&i>0&&r[i-1].type==="text_special"&&(d=d.slice(1));for(let k=0;k<d.length;k++){const g=d[k].url,F=e.md.normalizeLink(g);if(!e.md.validateLink(F))continue;let B=d[k].text;d[k].schema?d[k].schema==="mailto:"&&!/^mailto:/i.test(B)?B=e.md.normalizeLinkText("mailto:"+B).replace(/^mailto:/,""):B=e.md.normalizeLinkText(B):B=e.md.normalizeLinkText("http://"+B).replace(/^http:\/\//,"");const x=d[k].index;if(x>m){const $=new e.Token("text","",0);$.content=a.slice(m,x),$.level=f,c.push($)}const v=new e.Token("link_open","a",1);v.attrs=[["href",F]],v.level=f++,v.markup="linkify",v.info="auto",c.push(v);const D=new e.Token("text","",0);D.content=B,D.level=f,c.push(D);const L=new e.Token("link_close","a",-1);L.level=--f,L.markup="linkify",L.info="auto",c.push(L),m=d[k].lastIndex}if(m<a.length){const k=new e.Token("text","",0);k.content=a.slice(m),k.level=f,c.push(k)}t[u].children=r=Gr(r,i,c)}}}}const Yr=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,s0=/\((c|tm|r)\)/i,a0=/\((c|tm|r)\)/ig,l0={c:"©",r:"®",tm:"™"};function c0(e,t){return l0[t.toLowerCase()]}function d0(e){let t=0;for(let u=e.length-1;u>=0;u--){const n=e[u];n.type==="text"&&!t&&(n.content=n.content.replace(a0,c0)),n.type==="link_open"&&n.info==="auto"&&t--,n.type==="link_close"&&n.info==="auto"&&t++}}function f0(e){let t=0;for(let u=e.length-1;u>=0;u--){const n=e[u];n.type==="text"&&!t&&Yr.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),n.type==="link_open"&&n.info==="auto"&&t--,n.type==="link_close"&&n.info==="auto"&&t++}}function p0(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(s0.test(e.tokens[t].content)&&d0(e.tokens[t].children),Yr.test(e.tokens[t].content)&&f0(e.tokens[t].children))}const h0=/['"]/,Zo=/['"]/g,Xo="’";function tn(e,t,u){return e.slice(0,t)+u+e.slice(t+1)}function m0(e,t){let u;const n=[];for(let r=0;r<e.length;r++){const o=e[r],i=e[r].level;for(u=n.length-1;u>=0&&!(n[u].level<=i);u--);if(n.length=u+1,o.type!=="text")continue;let s=o.content,a=0,d=s.length;e:for(;a<d;){Zo.lastIndex=a;const c=Zo.exec(s);if(!c)break;let f=!0,m=!0;a=c.index+1;const k=c[0]==="'";let g=32;if(c.index-1>=0)g=s.charCodeAt(c.index-1);else for(u=r-1;u>=0&&!(e[u].type==="softbreak"||e[u].type==="hardbreak");u--)if(e[u].content){g=e[u].content.charCodeAt(e[u].content.length-1);break}let F=32;if(a<d)F=s.charCodeAt(a);else for(u=r+1;u<e.length&&!(e[u].type==="softbreak"||e[u].type==="hardbreak");u++)if(e[u].content){F=e[u].content.charCodeAt(0);break}const B=zu(g)||Ou(String.fromCharCode(g)),x=zu(F)||Ou(String.fromCharCode(F)),v=Nu(g),D=Nu(F);if(D?f=!1:x&&(v||B||(f=!1)),v?m=!1:B&&(D||x||(m=!1)),F===34&&c[0]==='"'&&g>=48&&g<=57&&(m=f=!1),f&&m&&(f=B,m=x),!f&&!m){k&&(o.content=tn(o.content,c.index,Xo));continue}if(m)for(u=n.length-1;u>=0;u--){let L=n[u];if(n[u].level<i)break;if(L.single===k&&n[u].level===i){L=n[u];let $,te;k?($=t.md.options.quotes[2],te=t.md.options.quotes[3]):($=t.md.options.quotes[0],te=t.md.options.quotes[1]),o.content=tn(o.content,c.index,te),e[L.token].content=tn(e[L.token].content,L.pos,$),a+=te.length-1,L.token===r&&(a+=$.length-1),s=o.content,d=s.length,n.length=u;continue e}}f?n.push({token:r,pos:c.index,single:k,level:i}):m&&k&&(o.content=tn(o.content,c.index,Xo))}}}function g0(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!h0.test(e.tokens[t].content)||m0(e.tokens[t].children,e)}function b0(e){let t,u;const n=e.tokens,r=n.length;for(let o=0;o<r;o++){if(n[o].type!=="inline")continue;const i=n[o].children,s=i.length;for(t=0;t<s;t++)i[t].type==="text_special"&&(i[t].type="text");for(t=u=0;t<s;t++)i[t].type==="text"&&t+1<s&&i[t+1].type==="text"?i[t+1].content=i[t].content+i[t+1].content:(t!==u&&(i[u]=i[t]),u++);t!==u&&(i.length=u)}}const Un=[["normalize",t0],["block",u0],["inline",n0],["linkify",i0],["replacements",p0],["smartquotes",g0],["text_join",b0]];function _o(){this.ruler=new yt;for(let e=0;e<Un.length;e++)this.ruler.push(Un[e][0],Un[e][1])}_o.prototype.process=function(e){const t=this.ruler.getRules("");for(let u=0,n=t.length;u<n;u++)t[u](e)};_o.prototype.State=Xr;function Ot(e,t,u,n){this.src=e,this.md=t,this.env=u,this.tokens=n,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const r=this.src;for(let o=0,i=0,s=0,a=0,d=r.length,c=!1;i<d;i++){const f=r.charCodeAt(i);if(!c)if(Ne(f)){s++,f===9?a+=4-a%4:a++;continue}else c=!0;(f===10||i===d-1)&&(f!==10&&i++,this.bMarks.push(o),this.eMarks.push(i),this.tShift.push(s),this.sCount.push(a),this.bsCount.push(0),c=!1,s=0,a=0,o=i+1)}this.bMarks.push(r.length),this.eMarks.push(r.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}Ot.prototype.push=function(e,t,u){const n=new $t(e,t,u);return n.block=!0,u<0&&this.level--,n.level=this.level,u>0&&this.level++,this.tokens.push(n),n};Ot.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};Ot.prototype.skipEmptyLines=function(t){for(let u=this.lineMax;t<u&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t};Ot.prototype.skipSpaces=function(t){for(let u=this.src.length;t<u;t++){const n=this.src.charCodeAt(t);if(!Ne(n))break}return t};Ot.prototype.skipSpacesBack=function(t,u){if(t<=u)return t;for(;t>u;)if(!Ne(this.src.charCodeAt(--t)))return t+1;return t};Ot.prototype.skipChars=function(t,u){for(let n=this.src.length;t<n&&this.src.charCodeAt(t)===u;t++);return t};Ot.prototype.skipCharsBack=function(t,u,n){if(t<=n)return t;for(;t>n;)if(u!==this.src.charCodeAt(--t))return t+1;return t};Ot.prototype.getLines=function(t,u,n,r){if(t>=u)return"";const o=new Array(u-t);for(let i=0,s=t;s<u;s++,i++){let a=0;const d=this.bMarks[s];let c=d,f;for(s+1<u||r?f=this.eMarks[s]+1:f=this.eMarks[s];c<f&&a<n;){const m=this.src.charCodeAt(c);if(Ne(m))m===9?a+=4-(a+this.bsCount[s])%4:a++;else if(c-d<this.tShift[s])a++;else break;c++}a>n?o[i]=new Array(a-n+1).join(" ")+this.src.slice(c,f):o[i]=this.src.slice(c,f)}return o.join("")};Ot.prototype.Token=$t;const v0=65536;function jn(e,t){const u=e.bMarks[t]+e.tShift[t],n=e.eMarks[t];return e.src.slice(u,n)}function Yo(e){const t=[],u=e.length;let n=0,r=e.charCodeAt(n),o=!1,i=0,s="";for(;n<u;)r===124&&(o?(s+=e.substring(i,n-1),i=n):(t.push(s+e.substring(i,n)),s="",i=n+1)),o=r===92,n++,r=e.charCodeAt(n);return t.push(s+e.substring(i)),t}function x0(e,t,u,n){if(t+2>u)return!1;let r=t+1;if(e.sCount[r]<e.blkIndent||e.sCount[r]-e.blkIndent>=4)return!1;let o=e.bMarks[r]+e.tShift[r];if(o>=e.eMarks[r])return!1;const i=e.src.charCodeAt(o++);if(i!==124&&i!==45&&i!==58||o>=e.eMarks[r])return!1;const s=e.src.charCodeAt(o++);if(s!==124&&s!==45&&s!==58&&!Ne(s)||i===45&&Ne(s))return!1;for(;o<e.eMarks[r];){const L=e.src.charCodeAt(o);if(L!==124&&L!==45&&L!==58&&!Ne(L))return!1;o++}let a=jn(e,t+1),d=a.split("|");const c=[];for(let L=0;L<d.length;L++){const $=d[L].trim();if(!$){if(L===0||L===d.length-1)continue;return!1}if(!/^:?-+:?$/.test($))return!1;$.charCodeAt($.length-1)===58?c.push($.charCodeAt(0)===58?"center":"right"):$.charCodeAt(0)===58?c.push("left"):c.push("")}if(a=jn(e,t).trim(),a.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;d=Yo(a),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop();const f=d.length;if(f===0||f!==c.length)return!1;if(n)return!0;const m=e.parentType;e.parentType="table";const k=e.md.block.ruler.getRules("blockquote"),g=e.push("table_open","table",1),F=[t,0];g.map=F;const B=e.push("thead_open","thead",1);B.map=[t,t+1];const x=e.push("tr_open","tr",1);x.map=[t,t+1];for(let L=0;L<d.length;L++){const $=e.push("th_open","th",1);c[L]&&($.attrs=[["style","text-align:"+c[L]]]);const te=e.push("inline","",0);te.content=d[L].trim(),te.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let v,D=0;for(r=t+2;r<u&&!(e.sCount[r]<e.blkIndent);r++){let L=!1;for(let te=0,C=k.length;te<C;te++)if(k[te](e,r,u,!0)){L=!0;break}if(L||(a=jn(e,r).trim(),!a)||e.sCount[r]-e.blkIndent>=4||(d=Yo(a),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),D+=f-d.length,D>v0))break;if(r===t+2){const te=e.push("tbody_open","tbody",1);te.map=v=[t+2,0]}const $=e.push("tr_open","tr",1);$.map=[r,r+1];for(let te=0;te<f;te++){const C=e.push("td_open","td",1);c[te]&&(C.attrs=[["style","text-align:"+c[te]]]);const Q=e.push("inline","",0);Q.content=d[te]?d[te].trim():"",Q.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return v&&(e.push("tbody_close","tbody",-1),v[1]=r),e.push("table_close","table",-1),F[1]=r,e.parentType=m,e.line=r,!0}function y0(e,t,u){if(e.sCount[t]-e.blkIndent<4)return!1;let n=t+1,r=n;for(;n<u;){if(e.isEmpty(n)){n++;continue}if(e.sCount[n]-e.blkIndent>=4){n++,r=n;continue}break}e.line=r;const o=e.push("code_block","code",0);return o.content=e.getLines(t,r,4+e.blkIndent,!1)+`
234
+ `,o.map=[t,e.line],!0}function k0(e,t,u,n){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||r+3>o)return!1;const i=e.src.charCodeAt(r);if(i!==126&&i!==96)return!1;let s=r;r=e.skipChars(r,i);let a=r-s;if(a<3)return!1;const d=e.src.slice(s,r),c=e.src.slice(r,o);if(i===96&&c.indexOf(String.fromCharCode(i))>=0)return!1;if(n)return!0;let f=t,m=!1;for(;f++,!(f>=u||(r=s=e.bMarks[f]+e.tShift[f],o=e.eMarks[f],r<o&&e.sCount[f]<e.blkIndent));)if(e.src.charCodeAt(r)===i&&!(e.sCount[f]-e.blkIndent>=4)&&(r=e.skipChars(r,i),!(r-s<a)&&(r=e.skipSpaces(r),!(r<o)))){m=!0;break}a=e.sCount[t],e.line=f+(m?1:0);const k=e.push("fence","code",0);return k.info=c,k.content=e.getLines(t+1,f,a,!0),k.markup=d,k.map=[t,e.line],!0}function _0(e,t,u,n){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];const i=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==62)return!1;if(n)return!0;const s=[],a=[],d=[],c=[],f=e.md.block.ruler.getRules("blockquote"),m=e.parentType;e.parentType="blockquote";let k=!1,g;for(g=t;g<u;g++){const D=e.sCount[g]<e.blkIndent;if(r=e.bMarks[g]+e.tShift[g],o=e.eMarks[g],r>=o)break;if(e.src.charCodeAt(r++)===62&&!D){let $=e.sCount[g]+1,te,C;e.src.charCodeAt(r)===32?(r++,$++,C=!1,te=!0):e.src.charCodeAt(r)===9?(te=!0,(e.bsCount[g]+$)%4===3?(r++,$++,C=!1):C=!0):te=!1;let Q=$;for(s.push(e.bMarks[g]),e.bMarks[g]=r;r<o;){const J=e.src.charCodeAt(r);if(Ne(J))J===9?Q+=4-(Q+e.bsCount[g]+(C?1:0))%4:Q++;else break;r++}k=r>=o,a.push(e.bsCount[g]),e.bsCount[g]=e.sCount[g]+1+(te?1:0),d.push(e.sCount[g]),e.sCount[g]=Q-$,c.push(e.tShift[g]),e.tShift[g]=r-e.bMarks[g];continue}if(k)break;let L=!1;for(let $=0,te=f.length;$<te;$++)if(f[$](e,g,u,!0)){L=!0;break}if(L){e.lineMax=g,e.blkIndent!==0&&(s.push(e.bMarks[g]),a.push(e.bsCount[g]),c.push(e.tShift[g]),d.push(e.sCount[g]),e.sCount[g]-=e.blkIndent);break}s.push(e.bMarks[g]),a.push(e.bsCount[g]),c.push(e.tShift[g]),d.push(e.sCount[g]),e.sCount[g]=-1}const F=e.blkIndent;e.blkIndent=0;const B=e.push("blockquote_open","blockquote",1);B.markup=">";const x=[t,0];B.map=x,e.md.block.tokenize(e,t,g);const v=e.push("blockquote_close","blockquote",-1);v.markup=">",e.lineMax=i,e.parentType=m,x[1]=e.line;for(let D=0;D<c.length;D++)e.bMarks[D+t]=s[D],e.tShift[D+t]=c[D],e.sCount[D+t]=d[D],e.bsCount[D+t]=a[D];return e.blkIndent=F,!0}function w0(e,t,u,n){const r=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.bMarks[t]+e.tShift[t];const i=e.src.charCodeAt(o++);if(i!==42&&i!==45&&i!==95)return!1;let s=1;for(;o<r;){const d=e.src.charCodeAt(o++);if(d!==i&&!Ne(d))return!1;d===i&&s++}if(s<3)return!1;if(n)return!0;e.line=t+1;const a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=Array(s+1).join(String.fromCharCode(i)),!0}function Jo(e,t){const u=e.eMarks[t];let n=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(n++);if(r!==42&&r!==45&&r!==43)return-1;if(n<u){const o=e.src.charCodeAt(n);if(!Ne(o))return-1}return n}function Qo(e,t){const u=e.bMarks[t]+e.tShift[t],n=e.eMarks[t];let r=u;if(r+1>=n)return-1;let o=e.src.charCodeAt(r++);if(o<48||o>57)return-1;for(;;){if(r>=n)return-1;if(o=e.src.charCodeAt(r++),o>=48&&o<=57){if(r-u>=10)return-1;continue}if(o===41||o===46)break;return-1}return r<n&&(o=e.src.charCodeAt(r),!Ne(o))?-1:r}function S0(e,t){const u=e.level+2;for(let n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===u&&e.tokens[n].type==="paragraph_open"&&(e.tokens[n+2].hidden=!0,e.tokens[n].hidden=!0,n+=2)}function C0(e,t,u,n){let r,o,i,s,a=t,d=!0;if(e.sCount[a]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[a]-e.listIndent>=4&&e.sCount[a]<e.blkIndent)return!1;let c=!1;n&&e.parentType==="paragraph"&&e.sCount[a]>=e.blkIndent&&(c=!0);let f,m,k;if((k=Qo(e,a))>=0){if(f=!0,i=e.bMarks[a]+e.tShift[a],m=Number(e.src.slice(i,k-1)),c&&m!==1)return!1}else if((k=Jo(e,a))>=0)f=!1;else return!1;if(c&&e.skipSpaces(k)>=e.eMarks[a])return!1;if(n)return!0;const g=e.src.charCodeAt(k-1),F=e.tokens.length;f?(s=e.push("ordered_list_open","ol",1),m!==1&&(s.attrs=[["start",m]])):s=e.push("bullet_list_open","ul",1);const B=[a,0];s.map=B,s.markup=String.fromCharCode(g);let x=!1;const v=e.md.block.ruler.getRules("list"),D=e.parentType;for(e.parentType="list";a<u;){o=k,r=e.eMarks[a];const L=e.sCount[a]+k-(e.bMarks[a]+e.tShift[a]);let $=L;for(;o<r;){const de=e.src.charCodeAt(o);if(de===9)$+=4-($+e.bsCount[a])%4;else if(de===32)$++;else break;o++}const te=o;let C;te>=r?C=1:C=$-L,C>4&&(C=1);const Q=L+C;s=e.push("list_item_open","li",1),s.markup=String.fromCharCode(g);const J=[a,0];s.map=J,f&&(s.info=e.src.slice(i,k-1));const N=e.tight,z=e.tShift[a],ue=e.sCount[a],ae=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=Q,e.tight=!0,e.tShift[a]=te-e.bMarks[a],e.sCount[a]=$,te>=r&&e.isEmpty(a+1)?e.line=Math.min(e.line+2,u):e.md.block.tokenize(e,a,u,!0),(!e.tight||x)&&(d=!1),x=e.line-a>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ae,e.tShift[a]=z,e.sCount[a]=ue,e.tight=N,s=e.push("list_item_close","li",-1),s.markup=String.fromCharCode(g),a=e.line,J[1]=a,a>=u||e.sCount[a]<e.blkIndent||e.sCount[a]-e.blkIndent>=4)break;let ge=!1;for(let de=0,ke=v.length;de<ke;de++)if(v[de](e,a,u,!0)){ge=!0;break}if(ge)break;if(f){if(k=Qo(e,a),k<0)break;i=e.bMarks[a]+e.tShift[a]}else if(k=Jo(e,a),k<0)break;if(g!==e.src.charCodeAt(k-1))break}return f?s=e.push("ordered_list_close","ol",-1):s=e.push("bullet_list_close","ul",-1),s.markup=String.fromCharCode(g),B[1]=a,e.line=a,e.parentType=D,d&&S0(e,F),!0}function T0(e,t,u,n){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],i=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==91)return!1;function s(v){const D=e.lineMax;if(v>=D||e.isEmpty(v))return null;let L=!1;if(e.sCount[v]-e.blkIndent>3&&(L=!0),e.sCount[v]<0&&(L=!0),!L){const C=e.md.block.ruler.getRules("reference"),Q=e.parentType;e.parentType="reference";let J=!1;for(let N=0,z=C.length;N<z;N++)if(C[N](e,v,D,!0)){J=!0;break}if(e.parentType=Q,J)return null}const $=e.bMarks[v]+e.tShift[v],te=e.eMarks[v];return e.src.slice($,te+1)}let a=e.src.slice(r,o+1);o=a.length;let d=-1;for(r=1;r<o;r++){const v=a.charCodeAt(r);if(v===91)return!1;if(v===93){d=r;break}else if(v===10){const D=s(i);D!==null&&(a+=D,o=a.length,i++)}else if(v===92&&(r++,r<o&&a.charCodeAt(r)===10)){const D=s(i);D!==null&&(a+=D,o=a.length,i++)}}if(d<0||a.charCodeAt(d+1)!==58)return!1;for(r=d+2;r<o;r++){const v=a.charCodeAt(r);if(v===10){const D=s(i);D!==null&&(a+=D,o=a.length,i++)}else if(!Ne(v))break}const c=e.md.helpers.parseLinkDestination(a,r,o);if(!c.ok)return!1;const f=e.md.normalizeLink(c.str);if(!e.md.validateLink(f))return!1;r=c.pos;const m=r,k=i,g=r;for(;r<o;r++){const v=a.charCodeAt(r);if(v===10){const D=s(i);D!==null&&(a+=D,o=a.length,i++)}else if(!Ne(v))break}let F=e.md.helpers.parseLinkTitle(a,r,o);for(;F.can_continue;){const v=s(i);if(v===null)break;a+=v,r=o,o=a.length,i++,F=e.md.helpers.parseLinkTitle(a,r,o,F)}let B;for(r<o&&g!==r&&F.ok?(B=F.str,r=F.pos):(B="",r=m,i=k);r<o;){const v=a.charCodeAt(r);if(!Ne(v))break;r++}if(r<o&&a.charCodeAt(r)!==10&&B)for(B="",r=m,i=k;r<o;){const v=a.charCodeAt(r);if(!Ne(v))break;r++}if(r<o&&a.charCodeAt(r)!==10)return!1;const x=En(a.slice(1,d));return x?(n||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[x]>"u"&&(e.env.references[x]={title:B,href:f}),e.line=i),!0):!1}const E0=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],A0="[a-zA-Z_:][a-zA-Z0-9:._-]*",D0="[^\"'=<>`\\x00-\\x20]+",I0="'[^']*'",F0='"[^"]*"',$0="(?:"+D0+"|"+I0+"|"+F0+")",M0="(?:\\s+"+A0+"(?:\\s*=\\s*"+$0+")?)",Jr="<[A-Za-z][A-Za-z0-9\\-]*"+M0+"*\\s*\\/?>",Qr="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",P0="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",B0="<[?][\\s\\S]*?[?]>",R0="<![A-Za-z][^>]*>",L0="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",N0=new RegExp("^(?:"+Jr+"|"+Qr+"|"+P0+"|"+B0+"|"+R0+"|"+L0+")"),O0=new RegExp("^(?:"+Jr+"|"+Qr+")"),bu=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+E0.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(O0.source+"\\s*$"),/^$/,!1]];function z0(e,t,u,n){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(r)!==60)return!1;let i=e.src.slice(r,o),s=0;for(;s<bu.length&&!bu[s][0].test(i);s++);if(s===bu.length)return!1;if(n)return bu[s][2];let a=t+1;if(!bu[s][1].test(i)){for(;a<u&&!(e.sCount[a]<e.blkIndent);a++)if(r=e.bMarks[a]+e.tShift[a],o=e.eMarks[a],i=e.src.slice(r,o),bu[s][1].test(i)){i.length!==0&&a++;break}}e.line=a;const d=e.push("html_block","",0);return d.map=[t,a],d.content=e.getLines(t,a,e.blkIndent,!0),!0}function q0(e,t,u,n){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.src.charCodeAt(r);if(i!==35||r>=o)return!1;let s=1;for(i=e.src.charCodeAt(++r);i===35&&r<o&&s<=6;)s++,i=e.src.charCodeAt(++r);if(s>6||r<o&&!Ne(i))return!1;if(n)return!0;o=e.skipSpacesBack(o,r);const a=e.skipCharsBack(o,35,r);a>r&&Ne(e.src.charCodeAt(a-1))&&(o=a),e.line=t+1;const d=e.push("heading_open","h"+String(s),1);d.markup="########".slice(0,s),d.map=[t,e.line];const c=e.push("inline","",0);c.content=e.src.slice(r,o).trim(),c.map=[t,e.line],c.children=[];const f=e.push("heading_close","h"+String(s),-1);return f.markup="########".slice(0,s),!0}function U0(e,t,u){const n=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const r=e.parentType;e.parentType="paragraph";let o=0,i,s=t+1;for(;s<u&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]>=e.blkIndent){let k=e.bMarks[s]+e.tShift[s];const g=e.eMarks[s];if(k<g&&(i=e.src.charCodeAt(k),(i===45||i===61)&&(k=e.skipChars(k,i),k=e.skipSpaces(k),k>=g))){o=i===61?1:2;break}}if(e.sCount[s]<0)continue;let m=!1;for(let k=0,g=n.length;k<g;k++)if(n[k](e,s,u,!0)){m=!0;break}if(m)break}if(!o)return!1;const a=e.getLines(t,s,e.blkIndent,!1).trim();e.line=s+1;const d=e.push("heading_open","h"+String(o),1);d.markup=String.fromCharCode(i),d.map=[t,e.line];const c=e.push("inline","",0);c.content=a,c.map=[t,e.line-1],c.children=[];const f=e.push("heading_close","h"+String(o),-1);return f.markup=String.fromCharCode(i),e.parentType=r,!0}function j0(e,t,u){const n=e.md.block.ruler.getRules("paragraph"),r=e.parentType;let o=t+1;for(e.parentType="paragraph";o<u&&!e.isEmpty(o);o++){if(e.sCount[o]-e.blkIndent>3||e.sCount[o]<0)continue;let d=!1;for(let c=0,f=n.length;c<f;c++)if(n[c](e,o,u,!0)){d=!0;break}if(d)break}const i=e.getLines(t,o,e.blkIndent,!1).trim();e.line=o;const s=e.push("paragraph_open","p",1);s.map=[t,e.line];const a=e.push("inline","",0);return a.content=i,a.map=[t,e.line],a.children=[],e.push("paragraph_close","p",-1),e.parentType=r,!0}const un=[["table",x0,["paragraph","reference"]],["code",y0],["fence",k0,["paragraph","reference","blockquote","list"]],["blockquote",_0,["paragraph","reference","blockquote","list"]],["hr",w0,["paragraph","reference","blockquote","list"]],["list",C0,["paragraph","reference","blockquote"]],["reference",T0],["html_block",z0,["paragraph","reference","blockquote"]],["heading",q0,["paragraph","reference","blockquote"]],["lheading",U0],["paragraph",j0]];function An(){this.ruler=new yt;for(let e=0;e<un.length;e++)this.ruler.push(un[e][0],un[e][1],{alt:(un[e][2]||[]).slice()})}An.prototype.tokenize=function(e,t,u){const n=this.ruler.getRules(""),r=n.length,o=e.md.options.maxNesting;let i=t,s=!1;for(;i<u&&(e.line=i=e.skipEmptyLines(i),!(i>=u||e.sCount[i]<e.blkIndent));){if(e.level>=o){e.line=u;break}const a=e.line;let d=!1;for(let c=0;c<r;c++)if(d=n[c](e,i,u,!1),d){if(a>=e.line)throw new Error("block rule didn't increment state.line");break}if(!d)throw new Error("none of the block rules matched");e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),i=e.line,i<u&&e.isEmpty(i)&&(s=!0,i++,e.line=i)}};An.prototype.parse=function(e,t,u,n){if(!e)return;const r=new this.State(e,t,u,n);this.tokenize(r,r.line,r.lineMax)};An.prototype.State=Ot;function ju(e,t,u,n){this.src=e,this.env=u,this.md=t,this.tokens=n,this.tokens_meta=Array(n.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}ju.prototype.pushPending=function(){const e=new $t("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e};ju.prototype.push=function(e,t,u){this.pending&&this.pushPending();const n=new $t(e,t,u);let r=null;return u<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),n.level=this.level,u>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(r),n};ju.prototype.scanDelims=function(e,t){const u=this.posMax,n=this.src.charCodeAt(e),r=e>0?this.src.charCodeAt(e-1):32;let o=e;for(;o<u&&this.src.charCodeAt(o)===n;)o++;const i=o-e,s=o<u?this.src.charCodeAt(o):32,a=zu(r)||Ou(String.fromCharCode(r)),d=zu(s)||Ou(String.fromCharCode(s)),c=Nu(r),f=Nu(s),m=!f&&(!d||c||a),k=!c&&(!a||f||d);return{can_open:m&&(t||!k||a),can_close:k&&(t||!m||d),length:i}};ju.prototype.Token=$t;function V0(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function H0(e,t){let u=e.pos;for(;u<e.posMax&&!V0(e.src.charCodeAt(u));)u++;return u===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,u)),e.pos=u,!0)}const W0=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function K0(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const u=e.pos,n=e.posMax;if(u+3>n||e.src.charCodeAt(u)!==58||e.src.charCodeAt(u+1)!==47||e.src.charCodeAt(u+2)!==47)return!1;const r=e.pending.match(W0);if(!r)return!1;const o=r[1],i=e.md.linkify.matchAtStart(e.src.slice(u-o.length));if(!i)return!1;let s=i.url;if(s.length<=o.length)return!1;let a=s.length;for(;a>0&&s.charCodeAt(a-1)===42;)a--;a!==s.length&&(s=s.slice(0,a));const d=e.md.normalizeLink(s);if(!e.md.validateLink(d))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const c=e.push("link_open","a",1);c.attrs=[["href",d]],c.markup="linkify",c.info="auto";const f=e.push("text","",0);f.content=e.md.normalizeLinkText(s);const m=e.push("link_close","a",-1);m.markup="linkify",m.info="auto"}return e.pos+=s.length-o.length,!0}function G0(e,t){let u=e.pos;if(e.src.charCodeAt(u)!==10)return!1;const n=e.pending.length-1,r=e.posMax;if(!t)if(n>=0&&e.pending.charCodeAt(n)===32)if(n>=1&&e.pending.charCodeAt(n-1)===32){let o=n-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(u++;u<r&&Ne(e.src.charCodeAt(u));)u++;return e.pos=u,!0}const wo=[];for(let e=0;e<256;e++)wo.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){wo[e.charCodeAt(0)]=1});function Z0(e,t){let u=e.pos;const n=e.posMax;if(e.src.charCodeAt(u)!==92||(u++,u>=n))return!1;let r=e.src.charCodeAt(u);if(r===10){for(t||e.push("hardbreak","br",0),u++;u<n&&(r=e.src.charCodeAt(u),!!Ne(r));)u++;return e.pos=u,!0}let o=e.src[u];if(r>=55296&&r<=56319&&u+1<n){const s=e.src.charCodeAt(u+1);s>=56320&&s<=57343&&(o+=e.src[u+1],u++)}const i="\\"+o;if(!t){const s=e.push("text_special","",0);r<256&&wo[r]!==0?s.content=o:s.content=i,s.markup=i,s.info="escape"}return e.pos=u+1,!0}function X0(e,t){let u=e.pos;if(e.src.charCodeAt(u)!==96)return!1;const r=u;u++;const o=e.posMax;for(;u<o&&e.src.charCodeAt(u)===96;)u++;const i=e.src.slice(r,u),s=i.length;if(e.backticksScanned&&(e.backticks[s]||0)<=r)return t||(e.pending+=i),e.pos+=s,!0;let a=u,d;for(;(d=e.src.indexOf("`",a))!==-1;){for(a=d+1;a<o&&e.src.charCodeAt(a)===96;)a++;const c=a-d;if(c===s){if(!t){const f=e.push("code_inline","code",0);f.markup=i,f.content=e.src.slice(u,d).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=a,!0}e.backticks[c]=d}return e.backticksScanned=!0,t||(e.pending+=i),e.pos+=s,!0}function Y0(e,t){const u=e.pos,n=e.src.charCodeAt(u);if(t||n!==126)return!1;const r=e.scanDelims(e.pos,!0);let o=r.length;const i=String.fromCharCode(n);if(o<2)return!1;let s;o%2&&(s=e.push("text","",0),s.content=i,o--);for(let a=0;a<o;a+=2)s=e.push("text","",0),s.content=i+i,e.delimiters.push({marker:n,length:0,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return e.pos+=r.length,!0}function er(e,t){let u;const n=[],r=t.length;for(let o=0;o<r;o++){const i=t[o];if(i.marker!==126||i.end===-1)continue;const s=t[i.end];u=e.tokens[i.token],u.type="s_open",u.tag="s",u.nesting=1,u.markup="~~",u.content="",u=e.tokens[s.token],u.type="s_close",u.tag="s",u.nesting=-1,u.markup="~~",u.content="",e.tokens[s.token-1].type==="text"&&e.tokens[s.token-1].content==="~"&&n.push(s.token-1)}for(;n.length;){const o=n.pop();let i=o+1;for(;i<e.tokens.length&&e.tokens[i].type==="s_close";)i++;i--,o!==i&&(u=e.tokens[i],e.tokens[i]=e.tokens[o],e.tokens[o]=u)}}function J0(e){const t=e.tokens_meta,u=e.tokens_meta.length;er(e,e.delimiters);for(let n=0;n<u;n++)t[n]&&t[n].delimiters&&er(e,t[n].delimiters)}const ei={tokenize:Y0,postProcess:J0};function Q0(e,t){const u=e.pos,n=e.src.charCodeAt(u);if(t||n!==95&&n!==42)return!1;const r=e.scanDelims(e.pos,n===42);for(let o=0;o<r.length;o++){const i=e.push("text","",0);i.content=String.fromCharCode(n),e.delimiters.push({marker:n,length:r.length,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close})}return e.pos+=r.length,!0}function tr(e,t){const u=t.length;for(let n=u-1;n>=0;n--){const r=t[n];if(r.marker!==95&&r.marker!==42||r.end===-1)continue;const o=t[r.end],i=n>0&&t[n-1].end===r.end+1&&t[n-1].marker===r.marker&&t[n-1].token===r.token-1&&t[r.end+1].token===o.token+1,s=String.fromCharCode(r.marker),a=e.tokens[r.token];a.type=i?"strong_open":"em_open",a.tag=i?"strong":"em",a.nesting=1,a.markup=i?s+s:s,a.content="";const d=e.tokens[o.token];d.type=i?"strong_close":"em_close",d.tag=i?"strong":"em",d.nesting=-1,d.markup=i?s+s:s,d.content="",i&&(e.tokens[t[n-1].token].content="",e.tokens[t[r.end+1].token].content="",n--)}}function ed(e){const t=e.tokens_meta,u=e.tokens_meta.length;tr(e,e.delimiters);for(let n=0;n<u;n++)t[n]&&t[n].delimiters&&tr(e,t[n].delimiters)}const ti={tokenize:Q0,postProcess:ed};function td(e,t){let u,n,r,o,i="",s="",a=e.pos,d=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const c=e.pos,f=e.posMax,m=e.pos+1,k=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(k<0)return!1;let g=k+1;if(g<f&&e.src.charCodeAt(g)===40){for(d=!1,g++;g<f&&(u=e.src.charCodeAt(g),!(!Ne(u)&&u!==10));g++);if(g>=f)return!1;if(a=g,r=e.md.helpers.parseLinkDestination(e.src,g,e.posMax),r.ok){for(i=e.md.normalizeLink(r.str),e.md.validateLink(i)?g=r.pos:i="",a=g;g<f&&(u=e.src.charCodeAt(g),!(!Ne(u)&&u!==10));g++);if(r=e.md.helpers.parseLinkTitle(e.src,g,e.posMax),g<f&&a!==g&&r.ok)for(s=r.str,g=r.pos;g<f&&(u=e.src.charCodeAt(g),!(!Ne(u)&&u!==10));g++);}(g>=f||e.src.charCodeAt(g)!==41)&&(d=!0),g++}if(d){if(typeof e.env.references>"u")return!1;if(g<f&&e.src.charCodeAt(g)===91?(a=g+1,g=e.md.helpers.parseLinkLabel(e,g),g>=0?n=e.src.slice(a,g++):g=k+1):g=k+1,n||(n=e.src.slice(m,k)),o=e.env.references[En(n)],!o)return e.pos=c,!1;i=o.href,s=o.title}if(!t){e.pos=m,e.posMax=k;const F=e.push("link_open","a",1),B=[["href",i]];F.attrs=B,s&&B.push(["title",s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=g,e.posMax=f,!0}function ud(e,t){let u,n,r,o,i,s,a,d,c="";const f=e.pos,m=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const k=e.pos+2,g=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(g<0)return!1;if(o=g+1,o<m&&e.src.charCodeAt(o)===40){for(o++;o<m&&(u=e.src.charCodeAt(o),!(!Ne(u)&&u!==10));o++);if(o>=m)return!1;for(d=o,s=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),s.ok&&(c=e.md.normalizeLink(s.str),e.md.validateLink(c)?o=s.pos:c=""),d=o;o<m&&(u=e.src.charCodeAt(o),!(!Ne(u)&&u!==10));o++);if(s=e.md.helpers.parseLinkTitle(e.src,o,e.posMax),o<m&&d!==o&&s.ok)for(a=s.str,o=s.pos;o<m&&(u=e.src.charCodeAt(o),!(!Ne(u)&&u!==10));o++);else a="";if(o>=m||e.src.charCodeAt(o)!==41)return e.pos=f,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o<m&&e.src.charCodeAt(o)===91?(d=o+1,o=e.md.helpers.parseLinkLabel(e,o),o>=0?r=e.src.slice(d,o++):o=g+1):o=g+1,r||(r=e.src.slice(k,g)),i=e.env.references[En(r)],!i)return e.pos=f,!1;c=i.href,a=i.title}if(!t){n=e.src.slice(k,g);const F=[];e.md.inline.parse(n,e.md,e.env,F);const B=e.push("image","img",0),x=[["src",c],["alt",""]];B.attrs=x,B.children=F,B.content=n,a&&x.push(["title",a])}return e.pos=o,e.posMax=m,!0}const nd=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,od=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function rd(e,t){let u=e.pos;if(e.src.charCodeAt(u)!==60)return!1;const n=e.pos,r=e.posMax;for(;;){if(++u>=r)return!1;const i=e.src.charCodeAt(u);if(i===60)return!1;if(i===62)break}const o=e.src.slice(n+1,u);if(od.test(o)){const i=e.md.normalizeLink(o);if(!e.md.validateLink(i))return!1;if(!t){const s=e.push("link_open","a",1);s.attrs=[["href",i]],s.markup="autolink",s.info="auto";const a=e.push("text","",0);a.content=e.md.normalizeLinkText(o);const d=e.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return e.pos+=o.length+2,!0}if(nd.test(o)){const i=e.md.normalizeLink("mailto:"+o);if(!e.md.validateLink(i))return!1;if(!t){const s=e.push("link_open","a",1);s.attrs=[["href",i]],s.markup="autolink",s.info="auto";const a=e.push("text","",0);a.content=e.md.normalizeLinkText(o);const d=e.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return e.pos+=o.length+2,!0}return!1}function id(e){return/^<a[>\s]/i.test(e)}function sd(e){return/^<\/a\s*>/i.test(e)}function ad(e){const t=e|32;return t>=97&&t<=122}function ld(e,t){if(!e.md.options.html)return!1;const u=e.posMax,n=e.pos;if(e.src.charCodeAt(n)!==60||n+2>=u)return!1;const r=e.src.charCodeAt(n+1);if(r!==33&&r!==63&&r!==47&&!ad(r))return!1;const o=e.src.slice(n).match(N0);if(!o)return!1;if(!t){const i=e.push("html_inline","",0);i.content=o[0],id(i.content)&&e.linkLevel++,sd(i.content)&&e.linkLevel--}return e.pos+=o[0].length,!0}const cd=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,dd=/^&([a-z][a-z0-9]{1,31});/i;function fd(e,t){const u=e.pos,n=e.posMax;if(e.src.charCodeAt(u)!==38||u+1>=n)return!1;if(e.src.charCodeAt(u+1)===35){const o=e.src.slice(u).match(cd);if(o){if(!t){const i=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),s=e.push("text_special","",0);s.content=ko(i)?xn(i):xn(65533),s.markup=o[0],s.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(u).match(dd);if(o){const i=Kr(o[0]);if(i!==o[0]){if(!t){const s=e.push("text_special","",0);s.content=i,s.markup=o[0],s.info="entity"}return e.pos+=o[0].length,!0}}}return!1}function ur(e){const t={},u=e.length;if(!u)return;let n=0,r=-2;const o=[];for(let i=0;i<u;i++){const s=e[i];if(o.push(0),(e[n].marker!==s.marker||r!==s.token-1)&&(n=i),r=s.token,s.length=s.length||0,!s.close)continue;t.hasOwnProperty(s.marker)||(t[s.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[s.marker][(s.open?3:0)+s.length%3];let d=n-o[n]-1,c=d;for(;d>a;d-=o[d]+1){const f=e[d];if(f.marker===s.marker&&f.open&&f.end<0){let m=!1;if((f.close||s.open)&&(f.length+s.length)%3===0&&(f.length%3!==0||s.length%3!==0)&&(m=!0),!m){const k=d>0&&!e[d-1].open?o[d-1]+1:0;o[i]=i-d+k,o[d]=k,s.open=!1,f.end=i,f.close=!1,c=-1,r=-2;break}}}c!==-1&&(t[s.marker][(s.open?3:0)+(s.length||0)%3]=c)}}function pd(e){const t=e.tokens_meta,u=e.tokens_meta.length;ur(e.delimiters);for(let n=0;n<u;n++)t[n]&&t[n].delimiters&&ur(t[n].delimiters)}function hd(e){let t,u,n=0;const r=e.tokens,o=e.tokens.length;for(t=u=0;t<o;t++)r[t].nesting<0&&n--,r[t].level=n,r[t].nesting>0&&n++,r[t].type==="text"&&t+1<o&&r[t+1].type==="text"?r[t+1].content=r[t].content+r[t+1].content:(t!==u&&(r[u]=r[t]),u++);t!==u&&(r.length=u)}const Vn=[["text",H0],["linkify",K0],["newline",G0],["escape",Z0],["backticks",X0],["strikethrough",ei.tokenize],["emphasis",ti.tokenize],["link",td],["image",ud],["autolink",rd],["html_inline",ld],["entity",fd]],Hn=[["balance_pairs",pd],["strikethrough",ei.postProcess],["emphasis",ti.postProcess],["fragments_join",hd]];function Vu(){this.ruler=new yt;for(let e=0;e<Vn.length;e++)this.ruler.push(Vn[e][0],Vn[e][1]);this.ruler2=new yt;for(let e=0;e<Hn.length;e++)this.ruler2.push(Hn[e][0],Hn[e][1])}Vu.prototype.skipToken=function(e){const t=e.pos,u=this.ruler.getRules(""),n=u.length,r=e.md.options.maxNesting,o=e.cache;if(typeof o[t]<"u"){e.pos=o[t];return}let i=!1;if(e.level<r){for(let s=0;s<n;s++)if(e.level++,i=u[s](e,!0),e.level--,i){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;i||e.pos++,o[t]=e.pos};Vu.prototype.tokenize=function(e){const t=this.ruler.getRules(""),u=t.length,n=e.posMax,r=e.md.options.maxNesting;for(;e.pos<n;){const o=e.pos;let i=!1;if(e.level<r){for(let s=0;s<u;s++)if(i=t[s](e,!1),i){if(o>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(i){if(e.pos>=n)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};Vu.prototype.parse=function(e,t,u,n){const r=new this.State(e,t,u,n);this.tokenize(r);const o=this.ruler2.getRules(""),i=o.length;for(let s=0;s<i;s++)o[s](r)};Vu.prototype.State=ju;function md(e){const t={};e=e||{},t.src_Any=Ur.source,t.src_Cc=jr.source,t.src_Z=Hr.source,t.src_P=xo.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const u="[><|]";return t.src_pseudo_letter="(?:(?!"+u+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+u+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+u+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+u+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function ro(e){return Array.prototype.slice.call(arguments,1).forEach(function(u){u&&Object.keys(u).forEach(function(n){e[n]=u[n]})}),e}function Dn(e){return Object.prototype.toString.call(e)}function gd(e){return Dn(e)==="[object String]"}function bd(e){return Dn(e)==="[object Object]"}function vd(e){return Dn(e)==="[object RegExp]"}function nr(e){return Dn(e)==="[object Function]"}function xd(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const ui={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function yd(e){return Object.keys(e||{}).reduce(function(t,u){return t||ui.hasOwnProperty(u)},!1)}const kd={"http:":{validate:function(e,t,u){const n=e.slice(t);return u.re.http||(u.re.http=new RegExp("^\\/\\/"+u.re.src_auth+u.re.src_host_port_strict+u.re.src_path,"i")),u.re.http.test(n)?n.match(u.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,u){const n=e.slice(t);return u.re.no_http||(u.re.no_http=new RegExp("^"+u.re.src_auth+"(?:localhost|(?:(?:"+u.re.src_domain+")\\.)+"+u.re.src_domain_root+")"+u.re.src_port+u.re.src_host_terminator+u.re.src_path,"i")),u.re.no_http.test(n)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:n.match(u.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,u){const n=e.slice(t);return u.re.mailto||(u.re.mailto=new RegExp("^"+u.re.src_email_name+"@"+u.re.src_host_strict,"i")),u.re.mailto.test(n)?n.match(u.re.mailto)[0].length:0}}},_d="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",wd="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Sd(e){e.__index__=-1,e.__text_cache__=""}function Cd(e){return function(t,u){const n=t.slice(u);return e.test(n)?n.match(e)[0].length:0}}function or(){return function(e,t){t.normalize(e)}}function yn(e){const t=e.re=md(e.__opts__),u=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||u.push(_d),u.push(t.src_xn),t.src_tlds=u.join("|");function n(s){return s.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(n(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(n(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(n(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(n(t.tpl_host_fuzzy_test),"i");const r=[];e.__compiled__={};function o(s,a){throw new Error('(LinkifyIt) Invalid schema "'+s+'": '+a)}Object.keys(e.__schemas__).forEach(function(s){const a=e.__schemas__[s];if(a===null)return;const d={validate:null,link:null};if(e.__compiled__[s]=d,bd(a)){vd(a.validate)?d.validate=Cd(a.validate):nr(a.validate)?d.validate=a.validate:o(s,a),nr(a.normalize)?d.normalize=a.normalize:a.normalize?o(s,a):d.normalize=or();return}if(gd(a)){r.push(s);return}o(s,a)}),r.forEach(function(s){e.__compiled__[e.__schemas__[s]]&&(e.__compiled__[s].validate=e.__compiled__[e.__schemas__[s]].validate,e.__compiled__[s].normalize=e.__compiled__[e.__schemas__[s]].normalize)}),e.__compiled__[""]={validate:null,normalize:or()};const i=Object.keys(e.__compiled__).filter(function(s){return s.length>0&&e.__compiled__[s]}).map(xd).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+i+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+i+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),Sd(e)}function Td(e,t){const u=e.__index__,n=e.__last_index__,r=e.__text_cache__.slice(u,n);this.schema=e.__schema__.toLowerCase(),this.index=u+t,this.lastIndex=n+t,this.raw=r,this.text=r,this.url=r}function io(e,t){const u=new Td(e,t);return e.__compiled__[u.schema].normalize(u,e),u}function Ct(e,t){if(!(this instanceof Ct))return new Ct(e,t);t||yd(e)&&(t=e,e={}),this.__opts__=ro({},ui,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=ro({},kd,e),this.__compiled__={},this.__tlds__=wd,this.__tlds_replaced__=!1,this.re={},yn(this)}Ct.prototype.add=function(t,u){return this.__schemas__[t]=u,yn(this),this};Ct.prototype.set=function(t){return this.__opts__=ro(this.__opts__,t),this};Ct.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let u,n,r,o,i,s,a,d,c;if(this.re.schema_test.test(t)){for(a=this.re.schema_search,a.lastIndex=0;(u=a.exec(t))!==null;)if(o=this.testSchemaAt(t,u[2],a.lastIndex),o){this.__schema__=u[2],this.__index__=u.index+u[1].length,this.__last_index__=u.index+u[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(d=t.search(this.re.host_fuzzy_test),d>=0&&(this.__index__<0||d<this.__index__)&&(n=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(i=n.index+n[1].length,(this.__index__<0||i<this.__index__)&&(this.__schema__="",this.__index__=i,this.__last_index__=n.index+n[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(c=t.indexOf("@"),c>=0&&(r=t.match(this.re.email_fuzzy))!==null&&(i=r.index+r[1].length,s=r.index+r[0].length,(this.__index__<0||i<this.__index__||i===this.__index__&&s>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=i,this.__last_index__=s))),this.__index__>=0};Ct.prototype.pretest=function(t){return this.re.pretest.test(t)};Ct.prototype.testSchemaAt=function(t,u,n){return this.__compiled__[u.toLowerCase()]?this.__compiled__[u.toLowerCase()].validate(t,n,this):0};Ct.prototype.match=function(t){const u=[];let n=0;this.__index__>=0&&this.__text_cache__===t&&(u.push(io(this,n)),n=this.__last_index__);let r=n?t.slice(n):t;for(;this.test(r);)u.push(io(this,n)),r=r.slice(this.__last_index__),n+=this.__last_index__;return u.length?u:null};Ct.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const u=this.re.schema_at_start.exec(t);if(!u)return null;const n=this.testSchemaAt(t,u[2],u[0].length);return n?(this.__schema__=u[2],this.__index__=u.index+u[1].length,this.__last_index__=u.index+u[0].length+n,io(this,0)):null};Ct.prototype.tlds=function(t,u){return t=Array.isArray(t)?t:[t],u?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(n,r,o){return n!==o[r-1]}).reverse(),yn(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,yn(this),this)};Ct.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};Ct.prototype.onCompile=function(){};const xu=2147483647,Bt=36,So=1,qu=26,Ed=38,Ad=700,ni=72,oi=128,ri="-",Dd=/^xn--/,Id=/[^\0-\x7F]/,Fd=/[\x2E\u3002\uFF0E\uFF61]/g,$d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Wn=Bt-So,Rt=Math.floor,Kn=String.fromCharCode;function Xt(e){throw new RangeError($d[e])}function Md(e,t){const u=[];let n=e.length;for(;n--;)u[n]=t(e[n]);return u}function ii(e,t){const u=e.split("@");let n="";u.length>1&&(n=u[0]+"@",e=u[1]),e=e.replace(Fd,".");const r=e.split("."),o=Md(r,t).join(".");return n+o}function si(e){const t=[];let u=0;const n=e.length;for(;u<n;){const r=e.charCodeAt(u++);if(r>=55296&&r<=56319&&u<n){const o=e.charCodeAt(u++);(o&64512)==56320?t.push(((r&1023)<<10)+(o&1023)+65536):(t.push(r),u--)}else t.push(r)}return t}const Pd=e=>String.fromCodePoint(...e),Bd=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Bt},rr=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},ai=function(e,t,u){let n=0;for(e=u?Rt(e/Ad):e>>1,e+=Rt(e/t);e>Wn*qu>>1;n+=Bt)e=Rt(e/Wn);return Rt(n+(Wn+1)*e/(e+Ed))},li=function(e){const t=[],u=e.length;let n=0,r=oi,o=ni,i=e.lastIndexOf(ri);i<0&&(i=0);for(let s=0;s<i;++s)e.charCodeAt(s)>=128&&Xt("not-basic"),t.push(e.charCodeAt(s));for(let s=i>0?i+1:0;s<u;){const a=n;for(let c=1,f=Bt;;f+=Bt){s>=u&&Xt("invalid-input");const m=Bd(e.charCodeAt(s++));m>=Bt&&Xt("invalid-input"),m>Rt((xu-n)/c)&&Xt("overflow"),n+=m*c;const k=f<=o?So:f>=o+qu?qu:f-o;if(m<k)break;const g=Bt-k;c>Rt(xu/g)&&Xt("overflow"),c*=g}const d=t.length+1;o=ai(n-a,d,a==0),Rt(n/d)>xu-r&&Xt("overflow"),r+=Rt(n/d),n%=d,t.splice(n++,0,r)}return String.fromCodePoint(...t)},ci=function(e){const t=[];e=si(e);const u=e.length;let n=oi,r=0,o=ni;for(const a of e)a<128&&t.push(Kn(a));const i=t.length;let s=i;for(i&&t.push(ri);s<u;){let a=xu;for(const c of e)c>=n&&c<a&&(a=c);const d=s+1;a-n>Rt((xu-r)/d)&&Xt("overflow"),r+=(a-n)*d,n=a;for(const c of e)if(c<n&&++r>xu&&Xt("overflow"),c===n){let f=r;for(let m=Bt;;m+=Bt){const k=m<=o?So:m>=o+qu?qu:m-o;if(f<k)break;const g=f-k,F=Bt-k;t.push(Kn(rr(k+g%F,0))),f=Rt(g/F)}t.push(Kn(rr(f,0))),o=ai(r,d,s===i),r=0,++s}++r,++n}return t.join("")},Rd=function(e){return ii(e,function(t){return Dd.test(t)?li(t.slice(4).toLowerCase()):t})},Ld=function(e){return ii(e,function(t){return Id.test(t)?"xn--"+ci(t):t})},di={version:"2.3.1",ucs2:{decode:si,encode:Pd},decode:li,encode:ci,toASCII:Ld,toUnicode:Rd},Nd={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},Od={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},zd={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},qd={default:Nd,zero:Od,commonmark:zd},Ud=/^(vbscript|javascript|file|data):/,jd=/^data:image\/(gif|png|jpeg|webp);/;function Vd(e){const t=e.trim().toLowerCase();return Ud.test(t)?jd.test(t):!0}const fi=["http:","https:","mailto:"];function Hd(e){const t=vo(e,!0);if(t.hostname&&(!t.protocol||fi.indexOf(t.protocol)>=0))try{t.hostname=di.toASCII(t.hostname)}catch{}return Uu(bo(t))}function Wd(e){const t=vo(e,!0);if(t.hostname&&(!t.protocol||fi.indexOf(t.protocol)>=0))try{t.hostname=di.toUnicode(t.hostname)}catch{}return ku(bo(t),ku.defaultChars+"%")}function It(e,t){if(!(this instanceof It))return new It(e,t);t||yo(e)||(t=e||{},e="default"),this.inline=new Vu,this.block=new An,this.core=new _o,this.renderer=new Su,this.linkify=new Ct,this.validateLink=Vd,this.normalizeLink=Hd,this.normalizeLinkText=Wd,this.utils=Gc,this.helpers=Tn({},Jc),this.options={},this.configure(e),t&&this.set(t)}It.prototype.set=function(e){return Tn(this.options,e),this};It.prototype.configure=function(e){const t=this;if(yo(e)){const u=e;if(e=qd[u],!e)throw new Error('Wrong `markdown-it` preset "'+u+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(u){e.components[u].rules&&t[u].ruler.enableOnly(e.components[u].rules),e.components[u].rules2&&t[u].ruler2.enableOnly(e.components[u].rules2)}),this};It.prototype.enable=function(e,t){let u=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){u=u.concat(this[r].ruler.enable(e,!0))},this),u=u.concat(this.inline.ruler2.enable(e,!0));const n=e.filter(function(r){return u.indexOf(r)<0});if(n.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this};It.prototype.disable=function(e,t){let u=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){u=u.concat(this[r].ruler.disable(e,!0))},this),u=u.concat(this.inline.ruler2.disable(e,!0));const n=e.filter(function(r){return u.indexOf(r)<0});if(n.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this};It.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};It.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const u=new this.core.State(e,this,t);return this.core.process(u),u.tokens};It.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};It.prototype.parseInline=function(e,t){const u=new this.core.State(e,this,t);return u.inlineMode=!0,this.core.process(u),u.tokens};It.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const fu=new It({html:!1,breaks:!0,linkify:!0,typographer:!1}),ir=fu.renderer.rules.link_open,sr=fu.renderer.rules.table_open,ar=fu.renderer.rules.table_close;fu.renderer.rules.link_open=(e,t,u,n,r)=>{const o=e[t];return o.attrSet("target","_blank"),o.attrSet("rel","noreferrer noopener"),typeof ir=="function"?ir(e,t,u,n,r):r.renderToken(e,t,u)};fu.renderer.rules.table_open=(e,t,u,n,r)=>`<div class="codex-table-wrap">${typeof sr=="function"?sr(e,t,u,n,r):r.renderToken(e,t,u)}`;fu.renderer.rules.table_close=(e,t,u,n,r)=>`${typeof ar=="function"?ar(e,t,u,n,r):r.renderToken(e,t,u)}</div>`;function lr(e=""){const t=String(e||"").trim();return t?fu.render(t):""}const Kd={class:"panel relative flex h-full min-h-0 flex-col overflow-hidden"},Gd={class:"workbench-panel-header theme-divider theme-muted-panel border-b p-3"},Zd={class:"flex flex-col gap-3"},Xd={class:"flex flex-wrap items-center gap-2"},Yd={class:"min-w-0 shrink-0"},Jd={class:"theme-heading flex items-center gap-2 text-sm font-medium"},Qd={key:0,class:"theme-muted-text mt-1 text-xs"},ef={class:"ml-auto flex items-center gap-2"},tf=["disabled"],uf=["disabled"],nf={class:"flex flex-col gap-2 sm:flex-row sm:items-center"},of={class:"min-w-0 flex-1"},rf={key:0,class:"theme-danger-text inline-flex items-center gap-2 text-sm"},sf={class:"min-h-0 flex-1"},af={key:0,class:"theme-empty-state px-4 py-6 text-sm"},lf={class:"flex justify-end"},cf={class:"transcript-card transcript-card--prompt min-w-0 w-full max-w-[92%] rounded-sm border border-dashed border-[var(--theme-promptBorder)] bg-[var(--theme-promptBg)] px-4 py-3 text-sm text-[var(--theme-promptText)]"},df={class:"flex items-center justify-between gap-3 text-xs opacity-75"},ff={class:"flex items-center gap-2"},pf=["onClick"],hf={class:"relative mt-2"},mf={key:0,class:"whitespace-pre-wrap break-all font-sans leading-7"},gf={key:1,class:"transcript-card__media overflow-hidden rounded-sm border border-dashed border-[var(--theme-promptBorder)]/70 bg-white/40"},bf={class:"flex items-center gap-2 border-b border-dashed border-[var(--theme-promptBorder)]/60 px-3 py-2 text-xs opacity-80"},vf={class:"px-3 py-3"},xf=["onClick"],yf=["src","alt"],kf={key:2,class:"pointer-events-none absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-[var(--theme-promptBg)] via-[var(--theme-promptBg)] to-transparent"},_f={class:"flex justify-start"},wf={class:"flex items-center justify-between gap-3 text-xs"},Sf={class:"flex items-center gap-2"},Cf=["disabled","onClick"],Tf={key:0,class:"transcript-card__subtle mt-3 rounded-sm border border-dashed border-current/15 bg-white/10 px-3 py-2 text-xs text-current/70"},Ef={key:1,class:"mt-3 space-y-3"},Af={class:"text-sm font-medium leading-6"},Df={key:0,class:"mt-1 whitespace-pre-wrap break-all font-mono text-[11px] leading-5 opacity-85"},If={key:2,class:"transcript-card__subtle mt-3 rounded-sm border border-dashed border-current/15 bg-white/10 px-3 py-2 text-xs text-current/70"},Ff={key:3,class:"mt-3 text-xs text-current/80"},$f={key:4,class:"transcript-card__subtle mt-3 rounded-sm border border-dashed border-current/15 bg-white/15 px-3 py-2 text-xs text-current/80"},Mf={class:"flex items-start justify-between gap-3"},Pf={class:"min-w-0 flex-1"},Bf={key:0,class:"leading-5"},Rf={key:1,class:"mt-1 break-all leading-5 opacity-75"},Lf={key:2,class:"mt-2 flex flex-wrap gap-2"},Nf={class:"opacity-75"},Of={class:"font-medium"},zf=["onClick"],qf={key:0,class:"flex justify-start"},Uf={class:"flex items-center justify-between gap-3 text-xs text-current/80"},jf=["onClick"],Vf={class:"relative mt-2"},Hf=["innerHTML"],Wf={class:"pointer-events-none absolute bottom-1 right-1 z-10 flex flex-col items-end gap-1.5 sm:bottom-3 sm:right-3"},Kf=["disabled"],Gf={key:2,class:"task-loading-dots","aria-hidden":"true"},nn="max-h-40 overflow-hidden",Zf={__name:"CodexSessionPanel",props:{prompt:{type:String,default:""},buildPrompt:{type:Function,default:null},buildPromptBlocks:{type:Function,default:null},beforeSend:{type:Function,default:null},afterSend:{type:Function,default:null},taskSlug:{type:String,default:""},selectedSessionId:{type:String,default:""},active:{type:Boolean,default:!1},sessionSelectionLocked:{type:Boolean,default:!1},sessionSelectionLockReason:{type:String,default:""},diffSupported:{type:Boolean,default:!1},taskRunning:{type:Boolean,default:!1}},emits:["project-created","selected-session-change","sending-change","open-diff"],setup(e,{expose:t,emit:u}){const n=Yn(()=>Jn(()=>import("./CodexSessionManagerDialog-4PTYEnnh.js"),__vite__mapDeps([0,1,2,3]))),r=u,o=e,{closeManager:i,formatTurnTime:s,getProcessCardClass:a,getProcessStatus:d,getTurnAgentLabel:c,getDisplayTurnSummaryItems:f,getTurnSummaryDetail:m,getTurnSummaryStatus:k,handleCreateSession:g,handleDeleteSession:F,handleSelectSession:B,handleSend:x,handleTranscriptScroll:v,handleTranscriptTouchEnd:D,handleTranscriptTouchMove:L,handleTranscriptTouchStart:$,handleUpdateSession:te,helperText:C,loadTurnEvents:Q,loading:J,managerBusy:N,openManager:z,refreshSessionsForSelection:ue,selectedSessionId:ae,sending:ge,stopping:de,hasTurnSummary:ke,hasNewerMessages:U,sessionError:K,shouldShowResponse:S,showManager:X,sortedSessions:fe,stopSending:q,transcriptRef:H,turns:Y,workspaces:be,sessions:se,loadSessions:Ae,scrollToBottom:_e}=uc(o,r),Be=new Map,De=V(""),{t:re}=kt(),{canCollapsePrompt:Ke,canCollapseResponse:Xe,getTurnEventCount:He,hasTurnEventHistory:lt,isPromptCollapsed:Ye,isResponseCollapsed:Ge,isTurnEventsCollapsed:ct,togglePrompt:mt,toggleResponse:ot,toggleTurnEvents:Ve}=sc({turns:Y,loadTurnEvents:Q});function gt(Ce){return String((Ce==null?void 0:Ce.runId)||(Ce==null?void 0:Ce.id)||"").trim()}function bt(Ce){Ce!=null&&Ce.runId&&r("open-diff",{scope:"run",runId:Ce.runId})}function _t(){r("open-diff",{scope:"workspace",runId:""})}function Qe(Ce){if(Ce!=null&&Ce.errorMessage)return"";const me=String((Ce==null?void 0:Ce.responseMessage)||""),y=gt(Ce);if(!y)return lr(me);const ve=Be.get(y);if((ve==null?void 0:ve.source)===me)return ve.html;const Re=lr(me);return Be.set(y,{source:me,html:Re}),Re}function it(Ce){De.value=String(Ce||"").trim()}const Oe=ce(()=>Y.value.flatMap(Ce=>(Array.isArray(Ce==null?void 0:Ce.promptBlocks)?Ce.promptBlocks:[]).filter(me=>(me==null?void 0:me.type)==="image").map(me=>me.content)));return Ee(Y,Ce=>{const me=new Set((Ce||[]).map(y=>gt(y)).filter(Boolean));for(const y of Be.keys())me.has(y)||Be.delete(y)},{immediate:!0,deep:!0}),t({send:x,scrollToBottom:_e,stop:q}),(Ce,me)=>(T(),O("section",Kd,[l(X)?(T(),Se(l(n),{key:0,open:l(X),sessions:l(se),workspaces:l(be),"selected-session-id":l(ae),"selection-locked":e.sessionSelectionLocked,"selection-lock-reason":e.sessionSelectionLockReason,loading:l(J),sending:l(ge),"on-refresh":l(Ae),"on-create":l(g),"on-update":l(te),"on-delete":l(F),onClose:l(i),onProjectCreated:me[0]||(me[0]=y=>r("project-created",y)),onSelectSession:l(B)},null,8,["open","sessions","workspaces","selected-session-id","selection-locked","selection-lock-reason","loading","sending","on-refresh","on-create","on-update","on-delete","onClose","onSelectSession"])):xe("",!0),p("div",Gd,[p("div",Zd,[p("div",Xd,[p("div",Yd,[p("div",Jd,[oe(l(Ai),{class:"h-4 w-4"}),p("span",null,E(l(re)("sessionPanel.project")),1)]),l(C)?(T(),O("p",Qd,E(l(C)),1)):xe("",!0)]),p("div",ef,[e.diffSupported?(T(),O("button",{key:0,type:"button",class:"tool-button tool-button-info-subtle inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:!e.taskSlug,onClick:_t},[oe(l(Fo),{class:"h-4 w-4"}),p("span",null,E(l(re)("sessionPanel.diff")),1)],8,tf)):xe("",!0),p("button",{type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:l(N),onClick:me[1]||(me[1]=(...y)=>l(z)&&l(z)(...y))},[oe(l(Bu),{class:"h-4 w-4"}),p("span",null,E(l(re)("sessionPanel.manageProjects")),1)],8,uf)])]),p("div",nf,[p("div",of,[oe(xl,{modelValue:l(ae),"onUpdate:modelValue":me[2]||(me[2]=y=>mi(ae)?ae.value=y:null),sessions:l(fe),loading:l(J),disabled:l(ge)||l(N)||e.sessionSelectionLocked,onRefreshIntent:l(ue)},null,8,["modelValue","sessions","loading","disabled","onRefreshIntent"])])]),l(K)?(T(),O("p",rf,[oe(l(vr),{class:"h-4 w-4"}),p("span",null,E(l(K)),1)])):xe("",!0)])]),p("div",sf,[p("div",{ref_key:"transcriptRef",ref:H,class:"h-full space-y-4 overflow-y-auto px-4 py-4",onScroll:me[3]||(me[3]=(...y)=>l(v)&&l(v)(...y)),onTouchstartPassive:me[4]||(me[4]=(...y)=>l($)&&l($)(...y)),onTouchmovePassive:me[5]||(me[5]=(...y)=>l(L)&&l(L)(...y)),onTouchendPassive:me[6]||(me[6]=(...y)=>l(D)&&l(D)(...y)),onTouchcancelPassive:me[7]||(me[7]=(...y)=>l(D)&&l(D)(...y))},[l(Y).length?xe("",!0):(T(),O("div",af,E(l(re)("sessionPanel.empty")),1)),(T(!0),O(ht,null,Dt(l(Y),y=>(T(),O("div",{key:y.id,class:"space-y-3"},[p("div",lf,[p("div",cf,[p("div",df,[p("span",null,E(l(re)("sessionPanel.promptTitle")),1),p("div",ff,[l(Ke)(y)?(T(),O("button",{key:0,type:"button",class:"transcript-card__toggle inline-flex items-center gap-1 rounded-sm border border-dashed border-current/30 px-2 py-1 text-[11px] transition hover:bg-white/15",onClick:ve=>l(mt)(y)},[l(Ye)(y)?(T(),Se(l(Mu),{key:0,class:"h-3 w-3"})):(T(),Se(l(Pn),{key:1,class:"h-3 w-3"})),p("span",null,E(l(Ye)(y)?l(re)("sessionPanel.expand"):l(re)("sessionPanel.collapse")),1)],8,pf)):xe("",!0),p("span",null,E(l(s)(y.startedAt)),1)])]),p("div",hf,[Array.isArray(y.promptBlocks)&&y.promptBlocks.length?(T(),O("div",{key:0,class:we(["space-y-3",l(Ke)(y)&&l(Ye)(y)?nn:""])},[(T(!0),O(ht,null,Dt(y.promptBlocks,(ve,Re)=>(T(),O(ht,{key:`${y.id}-prompt-${Re}`},[ve.type==="text"||ve.type==="imported_text"?(T(),O("pre",mf,E(ve.content),1)):(T(),O("div",gf,[p("div",bf,[oe(l(co),{class:"h-3.5 w-3.5"}),p("span",null,E(l(re)("sessionPanel.promptImage")),1)]),p("div",vf,[p("button",{type:"button",class:"inline-flex cursor-zoom-in justify-center",onClick:st=>it(ve.content)},[p("img",{src:ve.content,alt:l(re)("sessionPanel.promptImageAlt"),class:"max-h-52 w-auto max-w-full rounded-sm object-contain"},null,8,yf)],8,xf)])]))],64))),128))],2)):(T(),O("pre",{key:1,class:we(["whitespace-pre-wrap break-all font-sans leading-7",l(Ke)(y)&&l(Ye)(y)?nn:""])},E(y.prompt),3)),l(Ke)(y)&&l(Ye)(y)?(T(),O("div",kf)):xe("",!0)])])]),p("div",_f,[p("div",{class:we(["transcript-card transcript-card--process min-w-0 w-full max-w-[94%] rounded-sm border border-dashed px-4 py-3",l(a)(y)])},[p("div",wf,[p("span",null,E(l(re)("sessionPanel.processTitle")),1),p("div",Sf,[l(lt)(y)?(T(),O("button",{key:0,type:"button",class:"transcript-card__toggle inline-flex items-center gap-1 rounded-sm border border-dashed border-current/30 px-2 py-1 text-[11px] transition hover:bg-white/15",disabled:y.eventsLoading,onClick:ve=>l(Ve)(y)},[y.eventsLoading?(T(),Se(l(Lt),{key:0,class:"h-3 w-3 animate-spin"})):l(ct)(y)?(T(),Se(l(Mu),{key:1,class:"h-3 w-3"})):(T(),Se(l(Pn),{key:2,class:"h-3 w-3"})),p("span",null,E(y.eventsLoading?l(re)("sessionPanel.loading"):l(ct)(y)?`${l(re)("sessionPanel.expand")} (${l(He)(y)})`:l(re)("sessionPanel.collapse")),1)],8,Cf)):xe("",!0),p("span",null,E(l(d)(y)),1)])]),y.eventsLoading&&!y.events.length?(T(),O("div",Tf,E(l(re)("sessionPanel.loadingEvents")),1)):y.events.length&&!l(ct)(y)?(T(),O("div",Ef,[(T(!0),O(ht,null,Dt(y.events,ve=>(T(),O("div",{key:ve.id,class:we(["transcript-event-card rounded-sm border border-dashed px-3 py-2",{"border-[var(--theme-borderMuted)] bg-[var(--theme-appPanelStrong)]":ve.kind==="info"||ve.kind==="command","theme-status-warning":ve.kind==="todo","theme-status-success":ve.kind==="result","theme-status-danger":ve.kind==="error"}])},[p("div",Af,E(ve.title),1),ve.detail?(T(),O("pre",Df,E(ve.detail),1)):xe("",!0)],2))),128))])):l(lt)(y)?(T(),O("div",If,E(y.eventsLoaded?l(re)("sessionPanel.hiddenEventsLoaded",{count:l(He)(y)}):l(re)("sessionPanel.hiddenEventsLoadLater",{count:l(He)(y)})),1)):(T(),O("p",Ff,E(["queued","starting","running","stopping"].includes(y.status)?l(re)("sessionPanel.waitingEvents",{agent:l(c)(y)}):l(re)("sessionPanel.noEvents")),1)),l(ke)(y)?(T(),O("div",$f,[p("div",Mf,[p("div",Pf,[l(k)(y)?(T(),O("div",Bf,E(l(k)(y)),1)):xe("",!0),l(m)(y)?(T(),O("div",Rf,E(l(m)(y)),1)):xe("",!0),l(f)(y).length?(T(),O("div",Lf,[(T(!0),O(ht,null,Dt(l(f)(y),ve=>(T(),O("span",{key:ve.key,class:"transcript-card__pill inline-flex items-center gap-1 rounded-sm border border-dashed border-current/30 px-2 py-1"},[p("span",Nf,E(ve.label),1),p("span",Of,E(ve.value),1)]))),128))])):xe("",!0)]),e.diffSupported&&y.runId?(T(),O("button",{key:0,type:"button",class:"transcript-card__toggle shrink-0 inline-flex items-center gap-1 rounded-sm border border-dashed border-current/30 px-2 py-1 text-[11px] transition hover:bg-white/15",onClick:ve=>bt(y)},[oe(l(Fo),{class:"h-3 w-3"}),p("span",null,E(l(re)("sessionPanel.view")),1)],8,zf)):xe("",!0)])])):xe("",!0)],2)]),l(S)(y)?(T(),O("div",qf,[p("div",{class:we(["transcript-card transcript-card--response min-w-0 w-full max-w-[92%] rounded-sm border border-dashed px-4 py-3 text-sm leading-7",y.errorMessage?"border-[var(--theme-danger)] bg-[var(--theme-dangerSoft)] text-[var(--theme-dangerText)]":"border-[var(--theme-responseBorder)] bg-[var(--theme-responseBg)] text-[var(--theme-responseText)]"])},[p("div",Uf,[p("span",null,E(y.errorMessage?l(re)("sessionPanel.errorSuffix",{agent:l(c)(y)}):l(re)("sessionPanel.responseSuffix",{agent:l(c)(y)})),1),l(Xe)(y)?(T(),O("button",{key:0,type:"button",class:"transcript-card__toggle inline-flex items-center gap-1 rounded-sm border border-dashed border-current/30 px-2 py-1 text-[11px] transition hover:bg-white/15",onClick:ve=>l(ot)(y)},[l(Ge)(y)?(T(),Se(l(Mu),{key:0,class:"h-3 w-3"})):(T(),Se(l(Pn),{key:1,class:"h-3 w-3"})),p("span",null,E(l(Ge)(y)?l(re)("sessionPanel.expand"):l(re)("sessionPanel.collapse")),1)],8,jf)):xe("",!0)]),p("div",Vf,[y.errorMessage?(T(),O("div",{key:0,class:we([l(Xe)(y)&&l(Ge)(y)?nn:"","whitespace-pre-wrap break-all"])},E(y.errorMessage),3)):(T(),O("div",{key:1,class:we(["prose-like codex-markdown",l(Xe)(y)&&l(Ge)(y)?nn:""]),innerHTML:Qe(y)},null,10,Hf)),l(Xe)(y)&&l(Ge)(y)?(T(),O("div",{key:2,class:we(["pointer-events-none absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t",y.errorMessage?"from-[var(--theme-dangerSoft)] via-[var(--theme-dangerSoft)] to-transparent":"from-[var(--theme-responseBg)] via-[var(--theme-responseBg)] to-transparent"])},null,2)):xe("",!0)])],2)])):xe("",!0)]))),128))],544),p("div",Wf,[l(U)?(T(),O("button",{key:0,type:"button",class:"tool-button pointer-events-auto inline-flex items-center gap-1.5 border-[var(--theme-borderStrong)] bg-[var(--theme-appOverlay)] px-2.5 py-1.5 text-[11px] shadow-sm backdrop-blur",onClick:me[8]||(me[8]=(...y)=>l(_e)&&l(_e)(...y))},[oe(l(Si),{class:"h-3.5 w-3.5"}),p("span",null,E(l(re)("sessionPanel.jumpToLatest")),1)])):xe("",!0),l(ge)?(T(),O("button",{key:1,type:"button",class:"tool-button tool-button-warning-subtle pointer-events-auto inline-flex items-center gap-1.5 border-[var(--theme-borderStrong)] bg-[var(--theme-appOverlay)] px-2.5 py-1.5 text-[11px] shadow-sm backdrop-blur",disabled:l(de),onClick:me[9]||(me[9]=(...y)=>l(q)&&l(q)(...y))},[l(de)?(T(),Se(l(Lt),{key:0,class:"h-3.5 w-3.5 animate-spin"})):(T(),Se(l($i),{key:1,class:"h-3.5 w-3.5"})),p("span",null,E(l(de)?l(re)("sessionPanel.stopping"):l(re)("sessionPanel.stop")),1),l(de)?xe("",!0):(T(),O("span",Gf,[...me[11]||(me[11]=[p("span",{class:"task-loading-dots__dot"},null,-1),p("span",{class:"task-loading-dots__dot"},null,-1),p("span",{class:"task-loading-dots__dot"},null,-1)])]))],8,Kf)):xe("",!0)])]),oe(Ar,{modelValue:De.value,"onUpdate:modelValue":me[10]||(me[10]=y=>De.value=y),images:Oe.value},null,8,["modelValue","images"])]))}},Xf={key:0,class:"h-full min-h-0"},Yf={key:1,class:"panel theme-muted-text flex h-full items-center px-5 py-4 text-sm"},cr={__name:"WorkbenchActivityPanel",props:{taskSlug:{type:String,default:""},buildPrompt:{type:Function,default:null},buildPromptBlocks:{type:Function,default:null},selectedSessionId:{type:String,default:""},sessionSelectionLocked:{type:Boolean,default:!1},sessionSelectionLockReason:{type:String,default:""},diffSupported:{type:Boolean,default:!1},taskRunning:{type:Boolean,default:!1},emptyMessage:{type:String,default:""}},emits:["sending-change","project-created","selected-session-change","open-diff"],setup(e,{expose:t,emit:u}){const n=u,r=V(null);function o(){var a,d;return(d=(a=r.value)==null?void 0:a.send)==null?void 0:d.call(a)}function i(){var a,d;(d=(a=r.value)==null?void 0:a.stop)==null||d.call(a)}function s(){var a,d;(d=(a=r.value)==null?void 0:a.scrollToBottom)==null||d.call(a)}return t({send:o,stop:i,scrollToBottom:s}),(a,d)=>e.taskSlug?(T(),O("div",Xf,[oe(Zf,{ref_key:"panelRef",ref:r,active:!!e.taskSlug,"task-slug":e.taskSlug,"build-prompt":e.buildPrompt||(()=>""),"build-prompt-blocks":e.buildPromptBlocks||(()=>[]),"selected-session-id":e.selectedSessionId,"session-selection-locked":e.sessionSelectionLocked,"session-selection-lock-reason":e.sessionSelectionLockReason,"diff-supported":e.diffSupported,"task-running":e.taskRunning,onProjectCreated:d[0]||(d[0]=c=>n("project-created",c)),onSendingChange:d[1]||(d[1]=c=>n("sending-change",c)),onSelectedSessionChange:d[2]||(d[2]=c=>n("selected-session-change",c)),onOpenDiff:d[3]||(d[3]=c=>n("open-diff",c))},null,8,["active","task-slug","build-prompt","build-prompt-blocks","selected-session-id","session-selection-locked","session-selection-lock-reason","diff-supported","task-running"])])):e.emptyMessage?(T(),O("section",Yf,E(e.emptyMessage),1)):xe("",!0)}};function Jf(e){const{activeIndex:t,blocks:u,isTextLikeBlock:n,placeCursor:r,resizeAllTextareas:o,selectionMap:i,sessionId:s,setBlocks:a,textareas:d}=e,c=V(k()),f=V(null),m=V(null);function k(){return{open:!1,blockIndex:-1,start:0,end:0,query:"",trigger:"mention"}}function g(N,z){const ue=d.value[N];if(!ue||typeof document>"u")return null;const ae=window.getComputedStyle(ue),ge=document.createElement("div"),de=document.createElement("span"),ke=["boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize"];ge.style.position="fixed",ge.style.left="-9999px",ge.style.top="0",ge.style.visibility="hidden",ge.style.whiteSpace="pre-wrap",ge.style.wordWrap="break-word",ke.forEach(Y=>{ge.style[Y]=ae[Y]});const U=ue.value.slice(0,z),K=ue.value.slice(z,z+1)||" ",S=ue.value.slice(z+1);ge.textContent=U,de.textContent=K,ge.appendChild(de),S&&ge.appendChild(document.createTextNode(S)),document.body.appendChild(ge);const X=ue.getBoundingClientRect(),fe=Number.parseFloat(ae.lineHeight)||Number.parseFloat(ae.fontSize)*1.4||20,q=X.left+de.offsetLeft-ue.scrollLeft,H=X.top+de.offsetTop-ue.scrollTop;return document.body.removeChild(ge),{left:q,top:H,right:q,bottom:H+fe,width:0,height:fe}}function F(N,z){return!N&&!z?!1:!N||!z?!0:Math.abs((N.left||0)-(z.left||0))>=1||Math.abs((N.top||0)-(z.top||0))>=1||Math.abs((N.bottom||0)-(z.bottom||0))>=1}function B(){const N=c.value;if(!N.open||N.blockIndex<0){f.value=null;return}const z=g(N.blockIndex,N.start);F(z,f.value)&&(f.value=z)}function x(N){const z=Number(N==null?void 0:N.blockIndex);if(z<0)return;const ue=u.value[z];if(!ue||!n(ue))return;const ae=Math.max(0,Number(N.start)||0),ge=Math.max(ae,Number(N.end)||ae),de=`${ue.content.slice(0,ae)}${ue.content.slice(ge)}`,ke=[...u.value];ke.splice(z,1,{...ue,content:de}),a(ke),t.value=z,i.value[z]={start:ae,end:ae},Ie(()=>r(z,ae))}function v(N={}){const{suppressCurrent:z=!1,cleanupShortcut:ue=!1}=N,ae=c.value;z&&ae.open&&(m.value={blockIndex:ae.blockIndex,start:ae.start,end:ae.end,query:ae.query,trigger:ae.trigger}),c.value=k(),f.value=null,ue&&ae.trigger==="shortcut"&&x(ae)}function D(){v({suppressCurrent:!0,cleanupShortcut:c.value.trigger==="shortcut"})}function L(N,z){const ue=z||d.value[N],ae=u.value[N];if(!ue||!ae||!n(ae)){c.value.blockIndex===N&&v();return}const ge=ue.selectionStart??0,de=ue.selectionEnd??0;if(ge!==de){c.value.blockIndex===N&&v();return}const U=String(ae.content||"").slice(0,de),K=U.lastIndexOf("@");if(K<0){c.value.blockIndex===N&&v();return}const S=U.slice(K+1);if(/\s/.test(S)){c.value.blockIndex===N&&v();return}const X=K,fe=m.value;if(fe&&fe.blockIndex===N&&fe.start===X&&fe.end===de&&fe.query===S)return;m.value=null;const q=!c.value.open||c.value.blockIndex!==N||c.value.start!==X,H=g(N,X),Y=c.value.open&&c.value.blockIndex===N&&c.value.start===X&&c.value.trigger||"mention";c.value={open:!0,blockIndex:N,start:X,end:de,query:S,trigger:Y},(q||F(H,f.value))&&(f.value=H)}function $(N,z){i.value[N]={start:z.target.selectionStart??0,end:z.target.selectionEnd??0},L(N,z.target)}function te(N){t.value=N;const z=d.value[N];i.value[N]={start:(z==null?void 0:z.selectionStart)??0,end:(z==null?void 0:z.selectionEnd)??0},L(N,z)}function C(){var X,fe;const N=Math.min(t.value??0,Math.max(u.value.length-1,0)),z=u.value[N];if(!z||!n(z))return!1;const ue=d.value[N],ae=z.content.length,ge={start:(ue==null?void 0:ue.selectionStart)??((X=i.value[N])==null?void 0:X.start)??ae,end:(ue==null?void 0:ue.selectionEnd)??((fe=i.value[N])==null?void 0:fe.end)??ae},de=Math.max(0,ge.start??0),ke=Math.max(de,ge.end??de),U=`${z.content.slice(0,de)}@${z.content.slice(ke)}`,K=de+1,S=[...u.value];return S.splice(N,1,{...z,content:U}),a(S),t.value=N,i.value[N]={start:K,end:K},m.value=null,Ie(()=>{r(N,K),c.value={open:!0,blockIndex:N,start:de,end:K,query:"",trigger:"shortcut"},f.value=g(N,de)}),!0}function Q(N){const z=String((N==null?void 0:N.path)||"").trim(),ue=c.value;if(!z||ue.blockIndex<0)return v(),!1;const ae=u.value[ue.blockIndex];if(!ae||!n(ae))return v(),!1;const ge=ue.trigger==="shortcut"?`${z} `:`@${z} `,de=`${ae.content.slice(0,ue.start)}${ge}${ae.content.slice(ue.end)}`,ke=ue.start+ge.length,U=[...u.value];return U.splice(ue.blockIndex,1,{...ae,content:de}),a(U),t.value=ue.blockIndex,i.value[ue.blockIndex]={start:ke,end:ke},m.value=null,v(),Ie(()=>r(ue.blockIndex,ke)),!0}function J(){c.value.open&&B()}return Ee(()=>(s==null?void 0:s.value)??s,()=>{v()}),Ee(()=>c.value.open,N=>{N||Ie(()=>{o==null||o()})}),du(()=>{window.addEventListener("resize",J),window.addEventListener("scroll",J)}),at(()=>{window.removeEventListener("resize",J),window.removeEventListener("scroll",J)}),{mentionState:c,mentionAnchorRect:f,applyMentionSelection:Q,closeMentionPicker:v,dismissMentionPicker:D,handleTextFocus:te,openPathPickerFromShortcut:C,recordSelection:$,syncMentionState:L,updateMentionAnchor:B}}const pi=20;function on(e,t){if(!e||!t)return 0;const u=e.getBoundingClientRect(),n=t.getBoundingClientRect();return u.top-n.top+t.scrollTop}function Qf({containerScrollTop:e=0,containerClientHeight:t=0,targetTop:u=0,targetHeight:n=0,align:r="nearest",padding:o=pi}={}){const i=Math.max(0,Number(o)||0),s=Math.max(0,Number(e)||0),a=Math.max(0,Number(t)||0),d=Math.max(0,Number(u)||0),c=Math.max(0,Number(n)||0),f=d+c;if(!a)return s;if(r==="end")return Math.max(0,f-a+i);const m=s+i,k=s+a-i;return d<m?Math.max(0,d-i):f>k?Math.max(0,f-a+i):s}function e1({containerScrollTop:e=0,containerClientHeight:t=0,targetTop:u=0,targetHeight:n=0,padding:r=pi}={}){const o=Math.max(0,Number(r)||0),i=Math.max(0,Number(e)||0),s=Math.max(0,Number(t)||0),a=Math.max(0,Number(u)||0),d=Math.max(0,Number(n)||0),c=a+d;if(!s)return!0;const f=i+o,m=i+s-o;return d>=Math.max(0,m-f)?c>f&&a<m:a>=f&&c<=m}function t1(e){const{props:t,panelRef:u,onClose:n}=e,r=V({left:"12px",top:"12px",width:"560px",maxHeight:"420px"}),o=V(!1),i=V("bottom");function s(){n==null||n()}function a(k=!1){const g=window.innerWidth,F=window.innerHeight,B=12,x=8,v=320,D=560,L=420,$=180,te=Math.min(D,Math.max(v,g-B*2)),C=Math.min(te,g-B*2),Q=t.anchorRect||{left:(g-C)/2,top:F/2,bottom:F/2};let J=Q.left;J+C>g-B&&(J=g-B-C),J<B&&(J=B);const N=Math.max(0,F-B-(Q.bottom+x)),z=Math.max(0,Q.top-x-B);k?i.value=N>=z?"bottom":"top":i.value==="bottom"&&N<$&&z>N+24?i.value="top":i.value==="top"&&z<$&&N>z+24&&(i.value="bottom");const ue=i.value,ae=ue==="bottom"?N:z,ge=Math.max(140,F-B*2),de=Math.min(ge,Math.max(Math.min(L,ae||L),$)),ke={left:`${Math.round(J)}px`,width:`${Math.round(C)}px`,maxHeight:`${Math.round(de)}px`,top:"auto",bottom:"auto"};return ue==="bottom"?ke.top=`${Math.round(Math.max(B,Q.bottom+x))}px`:ke.bottom=`${Math.round(Math.max(B,F-Q.top+x))}px`,ke}function d(k=!1){const g=a(k);r.value={...r.value,left:g.left,top:g.top,bottom:g.bottom,width:g.width,maxHeight:g.maxHeight}}function c(){return!t.open||!t.anchorRect?!1:(i.value="bottom",d(!0),o.value=!0,!0)}function f(){o.value=!1}function m(k){!t.open||!u.value||u.value.contains(k.target)||s()}return du(()=>{document.addEventListener("pointerdown",m)}),at(()=>{document.removeEventListener("pointerdown",m)}),{closePicker:s,initializePanel:c,panelReady:o,panelStyle:r,resetPanel:f,updatePanelPosition:d}}const Gn="promptx:codex-recent-paths",u1=12;function n1(e){const{props:t,onSelect:u}=e,n=V([]),r=V(!1),o=V(""),i=V([]),s=V(!1),a=V(""),d=V([]),c=V([]),f=V("tree"),m=V(""),k=new Map;let g=null,F=0,B=0;const x=ce(()=>String(t.query||"").trim()),v=ce(()=>!!x.value),D=ce(()=>S(n.value)),L=ce(()=>String(t.sessionId||"").trim()),$=ce(()=>L.value?`promptx:codex-tree-expanded:${L.value}`:""),te=ce(()=>{if(!x.value)return d.value;const R=new Set(i.value.map(j=>j.path));return d.value.filter(j=>R.has(j.path))}),C=ce(()=>{const R=new Set(te.value.map(j=>j.path));return i.value.filter(j=>!R.has(j.path))}),Q=ce(()=>x.value?[...te.value,...C.value]:d.value),J=ce(()=>f.value==="search"?Q.value:D.value),N=ce(()=>f.value==="search"?s.value:r.value),z=ce(()=>f.value==="search"?a.value:o.value),ue=ce(()=>f.value==="search"&&!!t.sessionId&&!x.value&&!d.value.length),ae=ce(()=>f.value==="search"&&!!t.sessionId&&!!x.value&&!s.value&&!a.value&&!Q.value.length),ge=ce(()=>f.value==="tree"&&!!t.sessionId&&!r.value&&!o.value&&!D.value.length);function de(R,j){if(!R||typeof window>"u")return j;try{const ie=window.localStorage.getItem(R);return ie?JSON.parse(ie):j}catch{return j}}function ke(R,j){if(!(!R||typeof window>"u"))try{window.localStorage.setItem(R,JSON.stringify(j))}catch{}}function U(R=[]){return[...R].sort((j,ie)=>{const he=+(j.type!=="directory")-+(ie.type!=="directory");return he||String(j.path||j.name||"").localeCompare(String(ie.path||ie.name||""),"zh-CN")})}function K(R){return{...R,children:[],expanded:!1,loaded:!1,loading:!1}}function S(R=[],j=0,ie=[]){return R.forEach(he=>{ie.push({...he,depth:j}),he.type==="directory"&&he.expanded&&he.children.length&&S(he.children,j+1,ie)}),ie}function X(R,j=n.value){for(const ie of j){if(ie.path===R)return ie;if(ie.children.length){const he=X(R,ie.children);if(he)return he}}return null}function fe(){n.value=[...n.value]}function q(R=n.value,j=[]){return R.forEach(ie=>{ie.type==="directory"&&ie.expanded&&(j.push(ie.path),ie.children.length&&q(ie.children,j))}),j}function H(){if(!$.value)return;const R=[...new Set(q())];c.value=R,ke($.value,R)}function Y(){c.value=$.value?de($.value,[]).filter(Boolean):[]}function be(){const R=de(Gn,[]);if(!Array.isArray(R)||!L.value){d.value=[];return}d.value=R.filter(j=>j&&j.sessionId===L.value&&j.path).sort((j,ie)=>Number(ie.usedAt||0)-Number(j.usedAt||0)).slice(0,u1)}function se(R){return R.name||R.path||"."}function Ae(R){return R.path||"."}function _e(R){if(!L.value||!(R!=null&&R.path))return;const j={sessionId:L.value,path:R.path,name:R.name||se(R),type:R.type||"file",usedAt:Date.now()},ie=de(Gn,[]),he=[j];Array.isArray(ie)&&ie.forEach(Te=>{!(Te!=null&&Te.path)||!(Te!=null&&Te.sessionId)||Te.sessionId===j.sessionId&&Te.path===j.path||he.push(Te)}),ke(Gn,he.slice(0,40)),be()}function Be(R=""){const j=String(R||"").trim();return!j||!j.includes("/")?"":j.slice(0,j.lastIndexOf("/"))}function De(){const R=J.value;if(!R.length)return-1;const j=R.findIndex(ie=>ie.path===m.value);return j>=0?j:0}function re(){const R=J.value,j=De();return j<0||!R.length?null:R[j]||null}function Ke(){const R=J.value;if(!R.length){m.value="";return}R.some(j=>j.path===m.value)||(m.value=R[0].path)}function Xe(R,j){if(j){k.set(R,j);return}k.delete(R)}function He(){var j;const R=k.get(m.value);(j=R==null?void 0:R.scrollIntoView)==null||j.call(R,{block:"nearest"})}function lt(R=""){return String(R||"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Ye(R="",j=""){const ie=String(R||""),he=String(j||"").trim().toLowerCase();if(!ie||!he)return null;const Te=ie.toLowerCase(),Tt=Te.indexOf(he);if(Tt>=0)return{start:Tt,end:Tt+he.length};const tu=he.split(/[\\/\s_.-]+/).filter(Boolean).sort((Ft,Et)=>Et.length-Ft.length);for(const Ft of tu){if(Ft.length<2)continue;const Et=Te.indexOf(Ft);if(Et>=0)return{start:Et,end:Et+Ft.length}}return null}function Ge(R="",j=""){const ie=String(R||""),he=Ye(ie,j);return he?`${lt(ie.slice(0,he.start))}<mark class="theme-search-highlight">${lt(ie.slice(he.start,he.end))}</mark>${lt(ie.slice(he.end))}`:lt(ie)}function ct(R){return Ge(se(R),x.value)}function mt(R){return Ge(Ae(R),x.value)}async function ot(R="",j={}){if(!t.sessionId){n.value=[],o.value="",r.value=!1;return}const ie=!R,he=ie?null:X(R);if(!(!ie&&!he)&&!(!j.force&&(ie&&n.value.length||!ie&&he.loaded))){ie?(r.value=!0,o.value=""):(he.loading=!0,o.value="",fe());try{const Te=await Ms(t.sessionId,{path:R,refreshToken:j.refreshToken||""}),Tt=U(Te.items||[]).map(K);if(ie){n.value=Tt;return}he.children=Tt,he.loaded=!0}catch(Te){o.value=Te.message}finally{ie?r.value=!1:(he.loading=!1,fe())}}}async function Ve(R=n.value,j=new Set,ie={}){for(const he of R)he.type!=="directory"||!j.has(he.path)||(he.expanded=!0,fe(),await ot(he.path,ie),he.children.length&&await Ve(he.children,j,ie))}async function gt(R={}){await ot("",R);const j=new Set(c.value),ie=j.size>0;for(const Te of n.value)Te.type!=="directory"||!Te.hasChildren||(Te.expanded=ie?j.has(Te.path):!0);if(fe(),ie){await Ve(n.value,j,R);return}const he=n.value.filter(Te=>Te.type==="directory"&&Te.expanded&&Te.hasChildren);await Promise.all(he.map(Te=>ot(Te.path,R))),H()}async function bt(R){if(f.value!=="tree")return;const j=X(R);if(!(!j||j.type!=="directory")){if(!j.loaded&&!j.loading){j.expanded=!0,fe(),await ot(j.path),H();return}j.expanded=!j.expanded,fe(),H()}}function _t(R){return R!=null&&R.path?(_e(R),u==null||u(R),!0):!1}async function Qe(R={}){const j=x.value;F+=1;const ie=F,he=R.refreshToken||"";if(!t.open||!t.sessionId||!j){s.value=!1,a.value="",j||(i.value=[]);return}try{const Te=await Ps(t.sessionId,j,{limit:80,refreshToken:he});if(ie!==F)return;i.value=Te.items||[]}catch(Te){if(ie!==F)return;a.value=Te.message,i.value=[]}finally{ie===F&&(s.value=!1)}}function it(R={}){if(g&&(window.clearTimeout(g),g=null),!t.open||!t.sessionId||!x.value){s.value=!1,a.value="",x.value||(i.value=[]);return}s.value=!0,a.value="",g=window.setTimeout(()=>{Qe(R)},120)}function Oe(){if(!t.sessionId){n.value=[],o.value="",r.value=!1,i.value=[],a.value="",s.value=!1;return}B=Date.now(),n.value=[],o.value="",i.value=[],a.value="",gt({force:!0,refreshToken:B}),it({refreshToken:B})}function Ce(){be(),Y(),y(v.value?"search":"tree"),Oe()}function me(){g&&(window.clearTimeout(g),g=null),i.value=[],a.value="",s.value=!1}function y(R){f.value=R,R==="tree"&&t.sessionId&&!r.value&&!n.value.length&&gt({force:!0}),Ie(()=>{Ke(),He()})}function ve(R){const j=J.value;if(!j.length)return!1;const ie=De(),he=ie<0?0:(ie+R+j.length)%j.length;return m.value=j[he].path,!0}async function Re(){if(f.value!=="tree")return!1;const R=re();if(!R||R.type!=="directory")return!1;if(!R.expanded)return await bt(R.path),m.value=R.path,!0;const j=J.value,ie=De(),he=j[ie+1];return he&&Be(he.path)===R.path?(m.value=he.path,!0):!1}function st(){if(f.value!=="tree")return!1;const R=re();if(!R)return!1;if(R.type==="directory"&&R.expanded){const ie=X(R.path);return ie&&(ie.expanded=!1,fe(),H()),m.value=R.path,!0}const j=Be(R.path);return j?(m.value=j,!0):!1}function Mt(){const R=J.value;return R.length?_t(R[De()]):!1}function Wt(R=1){const j=["search","tree"],ie=j.indexOf(f.value),he=ie<0?0:(ie+R+j.length)%j.length;return y(j[he]),!0}function vt(){n.value=[],o.value="",r.value=!1,i.value=[],a.value="",s.value=!1,be(),Y(),t.sessionId&&t.open&&(gt({force:!0}),it())}function Pt(){y(v.value?"search":"tree"),it()}function rt(){Ke(),Ie(He)}return at(()=>{g&&window.clearTimeout(g)}),{activeKey:m,activeTab:f,collapseActiveDirectory:st,confirmActive:Mt,currentError:z,currentLoading:N,emitSelect:_t,expandActiveDirectory:Re,getDisplayName:se,getHighlightedName:ct,getHighlightedPath:mt,handleQueryChange:Pt,handleSessionChange:vt,handleVisibleItemsChange:rt,initializeData:Ce,moveActive:ve,normalSearchItems:C,normalizedQuery:x,recentSearchItems:te,resetData:me,setActiveTab:y,setItemRef:Xe,showSearchEmptyState:ae,showSearchPromptState:ue,showTreeEmptyState:ge,switchTab:Wt,toggleDirectory:bt,treeItems:D,visibleItems:J}}function o1(e){const{props:t,panelRef:u,onClose:n,onSelect:r}=e,{closePicker:o,initializePanel:i,panelReady:s,panelStyle:a,resetPanel:d,updatePanelPosition:c}=t1({props:t,panelRef:u,onClose:n}),f=n1({props:t,onSelect:r});return Ee(()=>t.open,m=>{if(!m){f.resetData(),d();return}d(),t.anchorRect&&i()&&f.initializeData()},{flush:"sync"}),Ee(()=>t.anchorRect,m=>{if(!(!t.open||!m)){if(!s.value){i()&&f.initializeData();return}c(!1)}},{flush:"sync"}),Ee(()=>t.sessionId,()=>{f.handleSessionChange()},{flush:"sync",immediate:!0}),Ee(()=>t.query,()=>{f.handleQueryChange()},{immediate:!0}),Ee(f.visibleItems,()=>{f.handleVisibleItemsChange()},{immediate:!0}),Ee(()=>f.activeKey.value,()=>{f.handleVisibleItemsChange()}),{...f,closePicker:o,panelReady:s,panelStyle:a}}const r1={class:"theme-divider flex items-center justify-between gap-2 border-b border-dashed px-2.5 py-2"},i1={class:"flex items-center gap-1.5"},s1={class:"flex shrink-0 items-center gap-2"},a1={class:"min-h-0 flex-1 overflow-y-auto p-2"},l1={key:0,class:"theme-empty-state px-3 py-4 text-xs"},c1={key:1,class:"theme-status-danger rounded-sm border border-dashed px-3 py-3 text-xs"},d1={key:2,class:"theme-empty-state px-3 py-4 text-xs"},f1={key:3,class:"theme-empty-state px-3 py-4 text-xs"},p1={key:4,class:"theme-empty-state px-3 py-4 text-xs"},h1={key:5,class:"theme-empty-state px-3 py-4 text-xs"},m1={key:6,class:"space-y-1"},g1={key:0,class:"theme-muted-text px-1 py-0.5 text-[10px] uppercase tracking-[0.12em]"},b1=["onMouseenter","onClick"],v1={class:"min-w-0 flex-1"},x1=["innerHTML"],y1=["innerHTML"],k1={key:1,class:"theme-muted-text px-1 py-0.5 text-[10px] uppercase tracking-[0.12em]"},_1=["onMouseenter","onClick"],w1={class:"min-w-0 flex-1"},S1=["innerHTML"],C1=["innerHTML"],T1={key:7,class:"space-y-1"},E1=["onMouseenter"],A1={class:"flex items-start gap-1.5"},D1=["onClick"],I1={key:1,class:"block h-5 w-5 shrink-0"},F1=["onClick"],$1={class:"min-w-0 flex-1"},M1={class:"flex items-center gap-1.5"},P1={__name:"PathMentionPicker",props:{open:{type:Boolean,default:!1},sessionId:{type:String,default:""},query:{type:String,default:""},anchorRect:{type:Object,default:null}},emits:["close","select"],setup(e,{expose:t,emit:u}){const n=e,r=u,o=V(null),{t:i}=kt(),{activeKey:s,activeTab:a,closePicker:d,collapseActiveDirectory:c,confirmActive:f,currentError:m,currentLoading:k,emitSelect:g,expandActiveDirectory:F,getDisplayName:B,getHighlightedName:x,getHighlightedPath:v,moveActive:D,normalSearchItems:L,normalizedQuery:$,panelReady:te,panelStyle:C,recentSearchItems:Q,setActiveTab:J,setItemRef:N,showSearchEmptyState:z,showSearchPromptState:ue,showTreeEmptyState:ae,switchTab:ge,toggleDirectory:de,treeItems:ke,visibleItems:U}=o1({props:n,panelRef:o,onClose:()=>r("close"),onSelect:K=>r("select",K)});return t({collapseActiveDirectory:c,moveActive:D,confirmActive:f,expandActiveDirectory:F,switchTab:ge}),(K,S)=>(T(),Se(cu,{to:"body"},[e.open&&l(te)?(T(),O("div",{key:0,ref_key:"panelRef",ref:o,class:"theme-popover fixed z-40 flex flex-col overflow-hidden rounded-sm border shadow-lg",style:mn(l(C))},[p("div",r1,[p("div",i1,[p("button",{type:"button",class:we(["inline-flex h-7 items-center gap-1 rounded-sm border px-2 text-[11px] transition",l(a)==="search"?"tool-button-accent-subtle":"theme-filter-idle border-dashed"]),onClick:S[0]||(S[0]=X=>l(J)("search"))},[oe(l(Bi),{class:"h-3.5 w-3.5"}),p("span",null,E(l(i)("pathPicker.searchTab")),1)],2),p("button",{type:"button",class:we(["inline-flex h-7 items-center gap-1 rounded-sm border px-2 text-[11px] transition",l(a)==="tree"?"tool-button-accent-subtle":"theme-filter-idle border-dashed"]),onClick:S[1]||(S[1]=X=>l(J)("tree"))},[oe(l(Qu),{class:"h-3.5 w-3.5"}),p("span",null,E(l(i)("pathPicker.treeTab")),1)],2)]),p("div",s1,[p("div",{class:we(["theme-muted-text inline-flex h-7 w-7 items-center justify-center",l(k)?"opacity-100":"opacity-0"])},[oe(l(Lt),{class:"h-3.5 w-3.5 animate-spin"})],2),p("button",{type:"button",class:"tool-button inline-flex h-7 w-7 items-center justify-center",onClick:S[2]||(S[2]=(...X)=>l(d)&&l(d)(...X))},[oe(l(Cn),{class:"h-4 w-4"})])])]),p("div",a1,[e.sessionId?l(m)?(T(),O("div",c1,E(l(m)),1)):l(ue)?(T(),O("div",d1,E(l(i)("pathPicker.searchPrompt")),1)):l(z)?(T(),O("div",f1,E(l(i)("pathPicker.noResults")),1)):l(ae)?(T(),O("div",p1,E(l(i)("pathPicker.emptyDirectory")),1)):l(k)&&!l(U).length?(T(),O("div",h1,E(l(i)("pathPicker.loading")),1)):l(a)==="search"?(T(),O("div",m1,[l(Q).length?(T(),O("div",g1,E(l(i)("pathPicker.recent")),1)):xe("",!0),(T(!0),O(ht,null,Dt(l(Q),X=>(T(),O("button",{key:X.path,ref_for:!0,ref:fe=>l(N)(X.path,fe),type:"button",class:we(["flex w-full items-start gap-2 rounded-sm border border-transparent px-2.5 py-1.5 text-left transition",l(s)===X.path?"theme-list-item-active":"theme-list-item-hover"]),onMouseenter:fe=>s.value=X.path,onClick:fe=>l(g)(X)},[(T(),Se(sn(X.type==="directory"?l(Qu):l(Bn)),{class:"theme-muted-text mt-0.5 h-4 w-4 shrink-0"})),p("div",v1,[p("div",null,[p("span",{class:"truncate text-[13px] text-[var(--theme-textPrimary)]",innerHTML:l(x)(X)},null,8,x1)]),p("div",{class:"theme-muted-text truncate font-mono text-[10px]",innerHTML:l(v)(X)},null,8,y1)])],42,b1))),128)),l($)&&l(L).length?(T(),O("div",k1,E(l(i)("pathPicker.results")),1)):xe("",!0),(T(!0),O(ht,null,Dt(l(L),X=>(T(),O("button",{key:X.path,ref_for:!0,ref:fe=>l(N)(X.path,fe),type:"button",class:we(["flex w-full items-start gap-2 rounded-sm border border-transparent px-2.5 py-1.5 text-left transition",l(s)===X.path?"theme-list-item-active":"theme-list-item-hover"]),onMouseenter:fe=>s.value=X.path,onClick:fe=>l(g)(X)},[(T(),Se(sn(X.type==="directory"?l(Qu):l(Bn)),{class:"theme-muted-text mt-0.5 h-4 w-4 shrink-0"})),p("div",w1,[p("div",null,[p("span",{class:"truncate text-[13px] text-[var(--theme-textPrimary)]",innerHTML:l(x)(X)},null,8,S1)]),p("div",{class:"theme-muted-text truncate font-mono text-[10px]",innerHTML:l(v)(X)},null,8,C1)])],42,_1))),128))])):(T(),O("div",T1,[(T(!0),O(ht,null,Dt(l(ke),X=>(T(),O("div",{key:X.path,ref_for:!0,ref:fe=>l(N)(X.path,fe),class:we(["rounded-sm border border-transparent px-1.5 py-1 transition",l(s)===X.path?"theme-list-item-active":X.type==="directory"&&X.expanded?"theme-list-item-expanded":"theme-list-item-hover"]),style:mn({paddingLeft:`${X.depth*16+6}px`}),onMouseenter:fe=>s.value=X.path},[p("div",A1,[X.type==="directory"?(T(),O("button",{key:0,type:"button",class:"theme-icon-button h-5 w-5 shrink-0",onClick:Ue(fe=>l(de)(X.path),["stop"])},[X.loading?(T(),Se(l(Lt),{key:0,class:"h-3.5 w-3.5 animate-spin"})):(T(),Se(l(Ii),{key:1,class:we(["h-3.5 w-3.5 transition",X.expanded?"rotate-90 text-[var(--theme-textPrimary)]":""])},null,8,["class"]))],8,D1)):(T(),O("span",I1)),p("button",{type:"button",class:"flex min-w-0 flex-1 items-start gap-1.5 rounded-sm px-0.5 py-0.5 text-left",onClick:fe=>l(g)(X)},[(T(),Se(sn(X.type==="directory"?l(Qu):l(Bn)),{class:we(["h-4 w-4 shrink-0",X.type==="directory"&&X.expanded?"text-[var(--theme-textPrimary)]":"text-[var(--theme-textMuted)]"])},null,8,["class"])),p("div",$1,[p("div",M1,[p("span",{class:we(["truncate text-[13px]",X.type==="directory"?"font-medium text-[var(--theme-textPrimary)]":"text-[var(--theme-textPrimary)]"])},E(l(B)(X)),3)])])],8,F1)])],46,E1))),128))])):(T(),O("div",l1,E(l(i)("pathPicker.selectProjectFirst")),1))])],4)):xe("",!0)]))}},B1={class:"theme-divider theme-secondary-text border-b px-5 py-4 text-sm"},R1={class:"flex flex-wrap items-center justify-between gap-3"},L1={class:"theme-heading inline-flex items-center gap-2 font-medium"},N1={class:"grid w-full grid-cols-3 gap-2 sm:flex sm:w-auto sm:flex-wrap sm:items-center sm:justify-end"},O1={key:0,class:"group relative"},z1=["value","placeholder","onFocus","onBlur","onInput","onCompositionstart","onCompositionupdate","onCompositionend","onKeydown","onClick","onKeyup","onSelect"],q1=["onClick"],U1={key:1,class:"group relative dashed-panel overflow-hidden"},j1={class:"theme-divider theme-secondary-text flex items-start justify-between gap-3 border-b border-dashed px-4 py-3 text-xs"},V1={class:"min-w-0 pr-24"},H1={class:"theme-heading font-medium"},W1={class:"mt-1 truncate font-mono"},K1={class:"mt-1"},G1={class:"absolute right-3 top-3 flex flex-wrap gap-2 opacity-0 transition group-hover:opacity-100 focus-within:opacity-100"},Z1=["onClick"],X1=["onClick"],Y1=["onClick"],J1={key:0,class:"theme-secondary-text px-4 py-3 text-sm leading-7"},Q1={key:0},ep=["value","placeholder","onFocus","onBlur","onInput","onCompositionstart","onCompositionupdate","onCompositionend","onKeydown","onClick","onKeyup","onSelect"],tp={key:2,class:"group relative"},up=["onClick"],np=["onClick"],op={class:"theme-divider theme-muted-text flex items-center gap-2 border-b px-4 py-3 text-xs"},rp={class:"mx-auto flex w-full max-w-[720px] justify-center px-4 py-4"},ip=["onClick"],sp=["src","alt"],ap=1500,lp={__name:"BlockEditor",props:{modelValue:{type:Array,required:!0},codexSessionId:{type:String,default:""},uploading:{type:Boolean,default:!1}},emits:["update:modelValue","upload-files","import-text-files","import-pdf-files","clear-request"],setup(e,{expose:t,emit:u}){const n=e,r=u,{t:o}=kt(),i=ce(()=>n.modelValue),s=ce(()=>n.codexSessionId),a=V(0),d=V([]),c=V(-1),f=V(-1),m=V(null),k=V(null),g=V(null),F=V(null),B=V(null),x=V({}),v=V(""),D=V(0),L=V(-1),$=V("nearest"),te=V("visible"),C=V(null);let Q=null,J=null,N=0,z=0;const{mentionState:ue,mentionAnchorRect:ae,applyMentionSelection:ge,closeMentionPicker:de,dismissMentionPicker:ke,handleTextFocus:U,openPathPickerFromShortcut:K,recordSelection:S,syncMentionState:X,updateMentionAnchor:fe}=Jf({activeIndex:a,blocks:i,isTextLikeBlock:Y,placeCursor:y,resizeAllTextareas:He,selectionMap:x,sessionId:s,setBlocks:re,textareas:d}),q=ce(()=>i.value.filter(h=>(h==null?void 0:h.type)===Me.IMAGE&&String(h.content||"").trim()).map(h=>String(h.content||"").trim()));function H(h){return(h==null?void 0:h.type)===Me.TEXT}function Y(h){return(h==null?void 0:h.type)===Me.TEXT||(h==null?void 0:h.type)===Me.IMPORTED_TEXT}function be(h){return h&&h.type!==Me.TEXT}function se(){var h,b;return((b=(h=globalThis.crypto)==null?void 0:h.randomUUID)==null?void 0:b.call(h))||`block-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function Ae(h={}){return{...h,clientId:String((h==null?void 0:h.clientId)||(h==null?void 0:h.id)||se()),meta:h!=null&&h.meta?{...h.meta}:{}}}function _e(h=""){return Ae({type:Me.TEXT,content:h,meta:{}})}function Be(h=[]){const b=Array.isArray(h)?h.filter(Boolean):[];if(!b.length)return[_e("")];const w=[];return b.forEach((M,ee)=>{const pe=Ae(M),I=w[w.length-1];!I&&be(pe)&&w.push(_e("")),I&&be(I)&&be(pe)&&w.push(_e("")),w.push(pe),ee===b.length-1&&be(pe)&&w.push(_e(""))}),w}function De(h=[],b=[]){return h===b?!0:!Array.isArray(h)||!Array.isArray(b)||h.length!==b.length?!1:h.every((w,M)=>{var pe,I,Z,G;const ee=b[M];return!ee||(w==null?void 0:w.type)!==ee.type||(w==null?void 0:w.content)!==ee.content?!1:(((pe=w==null?void 0:w.meta)==null?void 0:pe.fileName)||"")===(((I=ee.meta)==null?void 0:I.fileName)||"")&&!!((Z=w==null?void 0:w.meta)!=null&&Z.collapsed)==!!((G=ee.meta)!=null&&G.collapsed)})}function re(h){r("update:modelValue",Be(h))}function Ke(h,b){if(h){if(d.value[b]===h)return;d.value[b]=h,Xe(h);return}d.value[b]=null}function Xe(h,b={}){if(!h)return;const{allowShrink:w=!0,preserveViewport:M=!0,preserveSelection:ee=!0}=b,pe=window.scrollX,I=window.scrollY,Z=h.selectionStart,G=h.selectionEnd,ze=document.activeElement===h,qe=Number.parseFloat(h.style.height)||h.offsetHeight||40;w?(h.style.height="auto",h.style.height=`${Math.max(h.scrollHeight,40)}px`):h.style.height=`${Math.max(qe,h.scrollHeight,40)}px`,ee&&ze&&Z!==null&&G!==null&&h.setSelectionRange(Z,G),M&&(window.scrollX!==pe||window.scrollY!==I)&&window.scrollTo(pe,I)}function He(){d.value.forEach(h=>Xe(h))}function lt(){if(Date.now()<=z)return;const h=L.value;h<0||Ve(h)||Ge()}function Ye(){Q&&(window.clearTimeout(Q),Q=null)}function Ge(){var h;L.value=-1,$.value="nearest",te.value="visible",C.value=null,Ye(),N&&((h=window.cancelAnimationFrame)==null||h.call(window,N),N=0)}function ct(h=8e3){Ye();const b=Math.max(0,Number(h)||0);b&&(Q=window.setTimeout(()=>{Ge()},b))}function mt(){J&&(J.disconnect(),J=null)}function ot(h){const b=k.value;if(!b)return;const w=Math.max(0,Number(h)||0);Math.abs(b.scrollTop-w)<1||(z=Date.now()+120,b.scrollTop=w)}function Ve(h,b={}){const w=k.value,M=d.value[h];return!w||!M?!1:e1({containerScrollTop:w.scrollTop,containerClientHeight:w.clientHeight,targetTop:on(M,w),targetHeight:M.offsetHeight,padding:b.padding})}function gt(){const h=k.value;return h?Math.max(120,Math.round(h.clientHeight*.2)):120}function bt(h){const b=k.value,w=d.value[h];return!b||!w?null:on(w,b)-b.scrollTop}function _t(h){const b=bt(h);return b===null?null:{mode:"preserve",anchorOffset:b}}function Qe(){const h=L.value;if(h<0)return;const b=k.value,w=d.value[h];if(!(!b||!w)){if(te.value==="preserve"&&C.value!==null){const M=on(w,b),ee=M-b.scrollTop,pe=Number(C.value)||0;if(Math.abs(ee-pe)<=gt()){ot(M-pe);return}}me(h,{align:$.value||"nearest"})}}function it(){L.value<0||Ie(()=>{var h,b;Qe(),N&&((h=window.cancelAnimationFrame)==null||h.call(window,N)),N=((b=window.requestAnimationFrame)==null?void 0:b.call(window,()=>{N=0,Qe()}))||0})}function Oe(h,b={}){const w=Math.max(-1,Number(h)||-1);if(w<0){Ge();return}L.value=w,$.value=b.align==="end"?"end":"nearest",te.value=b.mode==="preserve"?"preserve":"visible",C.value=typeof b.anchorOffset=="number"?b.anchorOffset:null,ct(b.duration),it()}function Ce(h){mt(),!(!h||typeof window>"u"||typeof window.ResizeObserver>"u")&&(J=new window.ResizeObserver(()=>{L.value>=0&&it()}),J.observe(h))}function me(h,b={}){const w=d.value[h];if(!w)return;const{align:M="nearest"}=b,ee=k.value;if(!ee){w.scrollIntoView({block:M==="end"?"end":"nearest",inline:"nearest"});return}const pe=Qf({containerScrollTop:ee.scrollTop,containerClientHeight:ee.clientHeight,targetTop:on(w,ee),targetHeight:w.offsetHeight,align:M});pe!==ee.scrollTop&&ot(pe)}function y(h,b=null,w={}){const M=d.value[h];if(!M)return;const ee=b??M.value.length;try{M.focus({preventScroll:!0})}catch{M.focus()}M.setSelectionRange(ee,ee),me(h,w),w.follow!==!1&&Oe(h,{align:w.align,mode:w.followMode,anchorOffset:w.followAnchorOffset,duration:w.followDuration}),x.value[h]={start:ee,end:ee}}function ve(h,b){D.value=Date.now();const w=i.value.map((M,ee)=>ee===h?{...M,content:b}:M);re(w)}function Re(h,b=""){const w=i.value[h];if(!Y(w))return!1;const M=String(b??"");if(M===w.content)return!1;const ee=[...i.value];return ee.splice(h,1,{...w,content:M}),re(ee),!0}function st(){let h=!1;return d.value.forEach((b,w)=>{b&&(h=Re(w,b.value)||h)}),h}function Mt(h=null){return typeof h=="number"?c.value===h:c.value>=0}function Wt(h){const b=i.value.map((w,M)=>{var ee;return M===h?{...w,meta:{...w.meta,collapsed:!((ee=w.meta)!=null&&ee.collapsed)}}:w});re(b)}function vt(h){const b=i.value[h];if(!b||b.type!==Me.IMPORTED_TEXT)return;const w=i.value.map((M,ee)=>ee===h?{type:Me.TEXT,content:M.content,meta:{}}:M);re(w),a.value=h,Ie(()=>y(h,0))}function Pt(h){const b=i.value[h];if((b==null?void 0:b.type)===Me.TEXT&&i.value.length===1){re([{...b,content:""}]),Ie(()=>y(0,0));return}const w=i.value.filter((M,ee)=>ee!==h);re(w),Ie(()=>{var ee;const M=Math.max(0,Math.min(h,w.length-1));((ee=i.value[M])==null?void 0:ee.type)===Me.TEXT&&y(M,0)})}function rt(){re([_e("")]),a.value=0,x.value={0:{start:0,end:0}},Ie(()=>y(0,0))}function R(h="",b=180){return String(h).replace(/\s+/g," ").trim().slice(0,b)}function j(h=""){const b=String(h),w=b?b.split(`
235
+ `).length:0,M=b.length;return o("blockEditor.stats",{lines:w,chars:M})}function ie(h,b,w={}){const{focusAfterInserted:M=!1}=w,ee=M?_t(h):null,pe=[...i.value],I=pe[h],Z=x.value[h]||{start:I.content.length,end:I.content.length},G=Math.max(0,Z.start??0),ze=Math.max(G,Z.end??G),qe=I.content.slice(0,G),xt=I.content.slice(ze),et=[];qe&&et.push({...I,content:qe}),et.push(...b),xt&&et.push(_e(xt)),pe.splice(h,1,...et),re(pe),Ie(()=>{const nu=M?h+et.length-(xt?1:0):h,Gt=i.value.findIndex((Yu,mu)=>mu>=nu&&Yu.type===Me.TEXT);Gt>=0&&(a.value=Gt,y(Gt,0,{align:"nearest",followMode:ee==null?void 0:ee.mode,followAnchorOffset:ee==null?void 0:ee.anchorOffset}))})}function he(h,b={}){const{focusAfterInserted:w=!1}=b;if(!h.length)return;const M=Math.min(a.value??0,Math.max(i.value.length-1,0)),ee=i.value[M],pe=w?_t(M):null;if(!ee||ee.type===Me.IMPORTED_TEXT){const I=[...i.value],Z=M+1;I.splice(Z,0,...h),re(I),w&&Ie(()=>{const G=i.value.findIndex((ze,qe)=>qe>=Z+h.length&&ze.type===Me.TEXT);G>=0&&(a.value=G,y(G,0,{align:"nearest",followMode:pe==null?void 0:pe.mode,followAnchorOffset:pe==null?void 0:pe.anchorOffset}))});return}if(!H(ee)){const I=[...i.value],Z=I.length?M+1:0;I.splice(Z,0,...h),re(I),w&&Ie(()=>{const G=i.value.findIndex((ze,qe)=>qe>=Z+h.length&&ze.type===Me.TEXT);G>=0&&(a.value=G,y(G,0,{align:"nearest",followMode:pe==null?void 0:pe.mode,followAnchorOffset:pe==null?void 0:pe.anchorOffset}))});return}ie(M,h,{focusAfterInserted:w})}function Te(h){const b=String(h||"");if(!b)return;const w=Math.min(a.value??0,Math.max(i.value.length-1,0)),M=i.value[w];if(!M||!Y(M)){he([_e(b)]);return}const ee=x.value[w]||{start:M.content.length,end:M.content.length},pe=Math.max(0,ee.start??0),I=Math.max(pe,ee.end??pe),Z=`${M.content.slice(0,pe)}${b}${M.content.slice(I)}`,G=[...i.value];G.splice(w,1,{...M,content:Z}),re(G),Ie(()=>y(w,pe+b.length))}function Tt(h){he(h,{focusAfterInserted:!0})}function tu(h){he(h,{focusAfterInserted:!0})}function Ft(h){he(h,{focusAfterInserted:!0})}function Et(h,b){const w=i.value[h],M=i.value[b];if(!Y(w)||!Y(M))return;const ee=b<h?`${M.content}${w.content}`:`${w.content}${M.content}`,pe=[...i.value],I=Math.min(h,b),Z=Math.max(h,b);pe.splice(I,1,{...pe[I],content:ee}),pe.splice(Z,1),re(pe);const G=b<h?M.content.length:w.content.length;a.value=I,Ie(()=>y(I,G))}function _(h,b,w=0){const M=i.value.filter((pe,I)=>I!==b);re(M);const ee=b<h?h-1:h;a.value=ee,Ie(()=>y(ee,w))}function A(h){const b=i.value.findIndex((w,M)=>M>h&&w.type===Me.TEXT);b>=0&&(a.value=b,Ie(()=>y(b,0)))}function W(h){const b=String(h||"").trim();b&&(v.value=b)}function ne(h){const b=[...h].filter(w=>w&&w.type.startsWith("image/"));b.length&&r("upload-files",b)}function le(h){if(!h)return!1;const b=String(h.name||"").toLowerCase(),w=String(h.type||"").toLowerCase();return b.endsWith(".md")||b.endsWith(".markdown")||b.endsWith(".txt")||w.startsWith("text/")}function ye(h){if(!h)return!1;const b=String(h.name||"").toLowerCase(),w=String(h.type||"").toLowerCase();return b.endsWith(".pdf")||w==="application/pdf"}function Ze(h){const b=[...h].filter(Boolean);return{imageFiles:b.filter(w=>w.type.startsWith("image/")),textFiles:b.filter(w=>le(w)),pdfFiles:b.filter(w=>ye(w))}}function Fe(h){const b=[...h.clipboardData.items].filter(w=>w.kind==="file").map(w=>w.getAsFile()).filter(Boolean);b.length&&(h.preventDefault(),ne(b))}function zt(h){h.preventDefault();const{imageFiles:b,textFiles:w,pdfFiles:M}=Ze(h.dataTransfer.files);w.length&&r("import-text-files",w),M.length&&r("import-pdf-files",M),b.length&&ne(b)}function uu(h){const{imageFiles:b,textFiles:w,pdfFiles:M}=Ze(h.target.files);w.length&&r("import-text-files",w),M.length&&r("import-pdf-files",M),b.length&&ne(b),h.target.value=""}function qt(){var h;(h=F.value)==null||h.click()}function Kt(h){var b;return!!((b=h==null?void 0:h.closest)!=null&&b.call(h,'textarea,button,input,select,option,label,a,[contenteditable="true"]'))}function dt(h=0){const b=d.value.map((M,ee)=>({element:M,index:ee})).filter(M=>M.element);if(!b.length)return-1;const w=b.reduce((M,ee)=>{const pe=ee.element.getBoundingClientRect(),I=pe.top+pe.height/2,Z=Math.abs(h-I);return!M||Z<M.distance?{index:ee.index,distance:Z}:M},null);return(w==null?void 0:w.index)??-1}function pu(){if(!Array.isArray(i.value)||!i.value.length)return-1;const h=Math.max(0,Math.min(a.value??0,i.value.length-1));if(d.value[h])return h;let b=-1,w=Number.POSITIVE_INFINITY;return d.value.forEach((M,ee)=>{if(!M)return;const pe=Math.abs(ee-h);(pe<w||pe===w&&ee>h)&&(b=ee,w=pe)}),b}function In(h=0,b={}){const{preferActive:w=!1}=b,M=w?pu():dt(h);M<0||(de(),a.value=M,Ie(()=>{var I,Z;const ee=d.value[M],pe=h<=(((I=ee==null?void 0:ee.getBoundingClientRect)==null?void 0:I.call(ee).top)??0)?0:((Z=ee==null?void 0:ee.value)==null?void 0:Z.length)||0;y(M,pe)}))}function Fn(h){var b,w;Kt(h.target)||(w=(b=m.value)==null?void 0:b.contains)!=null&&w.call(b,h.target)&&In(h.clientY||0,{preferActive:!0})}function Ut(h,b){D.value=Date.now();const w=ue.value.open&&ue.value.blockIndex===h;Xe(b.target,w?{allowShrink:!1,preserveViewport:!1,preserveSelection:!1}:void 0),X(h,b.target),Oe(h,{align:h===i.value.length-1?"end":"nearest"})}function Hu(h){c.value=h,f.value=h,D.value=Date.now()}function Wu(h,b){D.value=Date.now(),Re(h,b.target.value),Ut(h,b)}function hu(h,b){D.value=Date.now(),Re(h,b.target.value),c.value=-1,Ut(h,b)}function Ku(h){f.value=h,Ve(h,{padding:0})||me(h,{align:"nearest"})}function Gu(h){f.value===h&&(f.value=-1),!Mt(h)&&L.value===h&&Ge()}async function Zu(h,b){var I,Z,G,ze,qe,xt,et,nu,Gt,Yu,mu,Co;const w=i.value[h],M=b.target;if((b.metaKey||b.ctrlKey)&&b.shiftKey&&b.key==="Backspace"){b.preventDefault(),r("clear-request");return}if(!Y(w))return;if((b.metaKey||b.ctrlKey)&&!b.shiftKey&&!b.altKey&&b.key.toLowerCase()==="k"&&K()){b.preventDefault();return}if(ue.value.open&&ue.value.blockIndex===h){if(b.key==="Escape"){b.preventDefault(),ke();return}if(b.key==="ArrowDown"&&(Z=(I=B.value)==null?void 0:I.moveActive)!=null&&Z.call(I,1)){b.preventDefault();return}if(b.key==="ArrowUp"&&(ze=(G=B.value)==null?void 0:G.moveActive)!=null&&ze.call(G,-1)){b.preventDefault();return}if(b.key==="ArrowRight"&&await((xt=(qe=B.value)==null?void 0:qe.expandActiveDirectory)==null?void 0:xt.call(qe))){b.preventDefault();return}if(b.key==="ArrowLeft"&&(nu=(et=B.value)==null?void 0:et.collapseActiveDirectory)!=null&&nu.call(et)){b.preventDefault();return}if(!b.altKey&&!b.metaKey&&!b.ctrlKey&&b.key==="Tab"&&(Yu=(Gt=B.value)==null?void 0:Gt.switchTab)!=null&&Yu.call(Gt,b.shiftKey?-1:1)){b.preventDefault();return}if(!b.shiftKey&&!b.altKey&&!b.metaKey&&!b.ctrlKey&&b.key==="Enter"&&(Co=(mu=B.value)==null?void 0:mu.confirmActive)!=null&&Co.call(mu)){b.preventDefault();return}}const ee=M.selectionStart??0,pe=M.selectionEnd??0;if(b.key==="Backspace"&&ee===0&&pe===0){const Tu=i.value[h-1];if(!Tu)return;if(b.preventDefault(),Y(Tu)){Et(h,h-1);return}_(h,h-1,0);return}if(b.key==="Delete"&&ee===w.content.length&&pe===w.content.length){const Tu=i.value[h+1];if(!Tu)return;if(b.preventDefault(),Y(Tu)){Et(h,h+1);return}_(h,h+1,w.content.length)}}function Xu(){const h=i.value.findIndex(b=>b.type===Me.TEXT);h<0||(a.value=h,Ie(()=>{var M;const b=d.value[h],w=(b==null?void 0:b.selectionStart)??((M=b==null?void 0:b.value)==null?void 0:M.length)??0;y(h,w)}))}function $n(){return c.value>=0||f.value>=0?!0:Date.now()-D.value<ap}const Cu=ce(()=>i.value.map((h,b)=>{var w;return`${b}:${h.type}:${(w=h.meta)!=null&&w.collapsed?"1":"0"}`}).join("|")),Mn=ce(()=>i.value.map((h,b)=>Y(h)?`${b}:${h.type}:${h.content||""}`:`${b}:${h.type}`).join("|"));return Ee(Cu,()=>{Ie(()=>{He()})},{immediate:!0}),Ee(()=>n.modelValue,h=>{const b=Be(h);De(b,h)||r("update:modelValue",b),c.value>=b.length&&(c.value=-1)},{immediate:!0,deep:!0}),Ee(Mn,()=>{Ie(()=>{He()})},{immediate:!0}),Ee(Cu,()=>{ue.value.open&&Ie(fe)}),Ee(g,h=>{Ce(h)},{immediate:!0}),at(()=>{Ge(),mt()}),t({clearContent:rt,flushPendingInput:st,focusEditor:Xu,insertBlocks:tu,insertImportedBlocks:Ft,insertTextAtSelection:Te,insertUploadedBlocks:Tt,isComposing:Mt,isEditing:$n,isImportedBlockActive:()=>{var h;return((h=i.value[a.value])==null?void 0:h.type)===Me.IMPORTED_TEXT},openFilePicker:qt}),(h,b)=>(T(),O("section",{ref_key:"surfaceRef",ref:m,class:"panel relative flex h-full min-h-0 flex-col overflow-hidden",onClick:Fn,onDrop:zt,onDragover:b[1]||(b[1]=Ue(()=>{},["prevent"])),onPaste:Fe},[p("div",B1,[p("div",R1,[p("p",L1,[oe(l(Pi),{class:"h-4 w-4"}),p("span",null,E(l(o)("blockEditor.title")),1)]),p("div",N1,[Iu(h.$slots,"header-actions")])]),p("input",{ref_key:"fileInputRef",ref:F,class:"hidden",type:"file",accept:"image/*,.md,.markdown,.txt,.pdf,text/plain,text/markdown,application/pdf",multiple:"",onChange:uu},null,544)]),p("div",{ref_key:"contentRef",ref:k,class:"flex-1 overflow-y-auto px-5 py-5",onScroll:lt},[p("div",{ref_key:"contentBodyRef",ref:g,class:"flex flex-col gap-5"},[(T(!0),O(ht,null,Dt(i.value,(w,M)=>{var ee,pe,I,Z;return T(),O(ht,{key:String(w.id||w.clientId||`${w.type}-${M}`)},[w.type===l(Me).TEXT?(T(),O("div",O1,[p("textarea",{ref_for:!0,ref:G=>Ke(G,M),rows:"1",value:w.content,class:"w-full resize-none overflow-hidden border-0 bg-transparent p-0 pr-12 text-[15px] leading-8 text-[var(--theme-textPrimary)] outline-none placeholder:text-[var(--theme-textMuted)]",placeholder:M===0?l(o)("blockEditor.placeholderFirst"):l(o)("blockEditor.placeholderNext"),onFocus:G=>{l(U)(M),Ku(M)},onBlur:G=>Gu(M),onInput:G=>{ve(M,G.target.value),Ut(M,G)},onCompositionstart:G=>Hu(M),onCompositionupdate:G=>Wu(M,G),onCompositionend:G=>hu(M,G),onKeydown:G=>Zu(M,G),onClick:G=>l(S)(M,G),onKeyup:G=>l(S)(M,G),onSelect:G=>l(S)(M,G)},null,40,z1),p("button",{type:"button",class:"tool-button tool-button-danger-subtle absolute right-0 top-1 inline-flex items-center gap-1.5 px-2 py-1 text-xs opacity-0 transition group-hover:opacity-100 focus:opacity-100",onClick:G=>Pt(M)},[oe(l(Pu),{class:"h-3.5 w-3.5"}),p("span",null,E(l(o)("blockEditor.delete")),1)],8,q1)])):w.type===l(Me).IMPORTED_TEXT?(T(),O("div",U1,[p("div",j1,[p("div",V1,[p("p",H1,E(l(o)("blockEditor.importedFile")),1),p("p",W1,E(((ee=w.meta)==null?void 0:ee.fileName)||l(o)("blockEditor.unnamedFile")),1),p("p",K1,E(j(w.content)),1)]),p("div",G1,[p("button",{type:"button",class:"tool-button inline-flex items-center gap-1.5 px-2 py-1 text-xs",onClick:G=>Wt(M)},[oe(l(Mu),{class:we(["h-3.5 w-3.5",(pe=w.meta)!=null&&pe.collapsed?"rotate-180":""])},null,8,["class"]),p("span",null,E((I=w.meta)!=null&&I.collapsed?l(o)("blockEditor.expand"):l(o)("blockEditor.collapse")),1)],8,Z1),p("button",{type:"button",class:"tool-button inline-flex items-center gap-1.5 px-2 py-1 text-xs",onClick:G=>vt(M)},[oe(l(Qn),{class:"h-3.5 w-3.5"}),p("span",null,E(l(o)("blockEditor.convertToText")),1)],8,X1),p("button",{type:"button",class:"tool-button tool-button-danger-subtle inline-flex items-center gap-1.5 px-2 py-1 text-xs",onClick:G=>Pt(M)},[oe(l(Pu),{class:"h-3.5 w-3.5"}),p("span",null,E(l(o)("blockEditor.delete")),1)],8,Y1)])]),(Z=w.meta)!=null&&Z.collapsed?(T(),O("div",J1,[Fu(E(R(w.content)||l(o)("blockEditor.emptyContent")),1),w.content.length>180?(T(),O("span",Q1,"...")):xe("",!0)])):(T(),O("textarea",{key:1,ref_for:!0,ref:G=>Ke(G,M),rows:"1",value:w.content,class:"w-full resize-none overflow-hidden border-0 bg-transparent px-4 py-4 text-[15px] leading-8 text-[var(--theme-textPrimary)] outline-none placeholder:text-[var(--theme-textMuted)]",placeholder:l(o)("blockEditor.emptyImportPlaceholder"),onFocus:G=>{l(U)(M),Ku(M)},onBlur:G=>Gu(M),onInput:G=>{ve(M,G.target.value),Ut(M,G)},onCompositionstart:G=>Hu(M),onCompositionupdate:G=>Wu(M,G),onCompositionend:G=>hu(M,G),onKeydown:G=>Zu(M,G),onClick:G=>l(S)(M,G),onKeyup:G=>l(S)(M,G),onSelect:G=>l(S)(M,G)},null,40,ep))])):(T(),O("figure",tp,[p("button",{type:"button",class:"tool-button tool-button-danger-subtle absolute right-3 top-3 z-10 inline-flex items-center gap-1.5 px-2 py-1 text-xs opacity-0 transition group-hover:opacity-100 focus:opacity-100",onClick:G=>Pt(M)},[oe(l(Pu),{class:"h-3.5 w-3.5"}),p("span",null,E(l(o)("blockEditor.delete")),1)],8,up),p("div",{class:"theme-inline-panel overflow-hidden rounded-sm border",onClick:G=>A(M)},[p("div",op,[oe(l(co),{class:"h-4 w-4"}),p("span",null,E(l(o)("blockEditor.insertedImage")),1)]),p("div",rp,[p("button",{type:"button",class:"inline-flex cursor-zoom-in justify-center",onClick:Ue(G=>W(w.content),["stop"])},[p("img",{src:w.content,alt:l(o)("blockEditor.insertedImageAlt"),class:"max-h-[380px] w-auto max-w-full object-contain"},null,8,sp)],8,ip)])],8,np)]))],64)}),128))],512)],544),oe(Ar,{modelValue:v.value,"onUpdate:modelValue":b[0]||(b[0]=w=>v.value=w),images:q.value},null,8,["modelValue","images"]),oe(P1,{ref_key:"mentionPickerRef",ref:B,open:l(ue).open&&!!l(ae),"session-id":e.codexSessionId,query:l(ue).query,"anchor-rect":l(ae),onClose:l(ke),onSelect:l(ge)},null,8,["open","session-id","query","anchor-rect","onClose","onSelect"])],544))}},cp=["disabled"],dp=["disabled"],fp=["disabled"],pp={__name:"WorkbenchEditorActions",props:{canAddTodo:{type:Boolean,default:!1},uploading:{type:Boolean,default:!1},isCurrentTaskSending:{type:Boolean,default:!1},sendState:{type:String,default:"idle"},todoCount:{type:Number,default:0}},emits:["add-todo","open-file-picker","clear-request","copy-request","manage-todo","send-request"],setup(e,{emit:t}){const u=e,n=t,{t:r}=kt(),o=ce(()=>u.sendState==="sending"||u.sendState==="running");return(i,s)=>(T(),O(ht,null,[p("button",{type:"button",class:"tool-button inline-flex w-full items-center justify-center gap-1.5 px-2 py-2 text-xs sm:w-auto sm:gap-2 sm:px-3",disabled:e.uploading,onMousedown:s[0]||(s[0]=Ue(()=>{},["prevent"])),onClick:s[1]||(s[1]=a=>n("open-file-picker"))},[e.uploading?(T(),Se(l(Lt),{key:0,class:"h-4 w-4 animate-spin"})):(T(),Se(l(Oi),{key:1,class:"h-4 w-4"})),p("span",null,E(l(r)("editor.chooseFiles")),1)],40,cp),p("button",{type:"button",class:"tool-button inline-flex w-full items-center justify-center gap-1.5 px-2 py-2 text-xs sm:w-auto sm:gap-2 sm:px-3",onMousedown:s[2]||(s[2]=Ue(()=>{},["prevent"])),onClick:s[3]||(s[3]=a=>n("clear-request"))},[oe(l(zi),{class:"h-4 w-4"}),p("span",null,E(l(r)("editor.clear")),1)],32),p("button",{type:"button",class:"tool-button inline-flex w-full items-center justify-center gap-1.5 px-2 py-2 text-xs sm:w-auto sm:gap-2 sm:px-3",disabled:!e.canAddTodo,onMousedown:s[4]||(s[4]=Ue(()=>{},["prevent"])),onClick:s[5]||(s[5]=a=>n("add-todo"))},[oe(l(yr),{class:"h-4 w-4"}),p("span",null,E(l(r)("editor.todo")),1)],40,dp),p("button",{type:"button",class:"tool-button inline-flex w-full items-center justify-center gap-1.5 px-2 py-2 text-xs sm:w-auto sm:gap-2 sm:px-3",onMousedown:s[6]||(s[6]=Ue(()=>{},["prevent"])),onClick:s[7]||(s[7]=a=>n("manage-todo"))},[oe(l(xr),{class:"h-4 w-4"}),p("span",null,E(e.todoCount>0?l(r)("editor.todoWithCount",{count:e.todoCount}):l(r)("editor.todo")),1)],32),p("button",{type:"button",class:"tool-button inline-flex w-full items-center justify-center gap-1.5 px-2 py-2 text-xs sm:w-auto sm:gap-2 sm:px-3",disabled:e.isCurrentTaskSending,onMousedown:s[8]||(s[8]=Ue(()=>{},["prevent"])),onClick:s[9]||(s[9]=a=>n("send-request"))},[o.value?(T(),Se(l(Lt),{key:0,class:"h-4 w-4 animate-spin"})):(T(),Se(l(Ri),{key:1,class:"h-4 w-4"})),p("span",null,E(l(r)("editor.send")),1)],40,fp)],64))}},hp={key:0,class:"panel theme-muted-text flex h-full items-center px-5 py-4 text-sm"},dr={__name:"WorkbenchInputPanel",props:{canAddTodo:{type:Boolean,default:!1},codexSessionId:{type:String,default:""},isCurrentTaskSending:{type:Boolean,default:!1},sendState:{type:String,default:"idle"},modelValue:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1},todoCount:{type:Number,default:0},uploading:{type:Boolean,default:!1}},emits:["add-todo","update:modelValue","upload-files","import-text-files","import-pdf-files","clear-request","copy-request","manage-todo","send-request"],setup(e,{expose:t,emit:u}){const n=e,r=u,o=V(null),{t:i}=kt(),s=ce({get:()=>n.modelValue,set:x=>r("update:modelValue",x)});function a(){var x,v;(v=(x=o.value)==null?void 0:x.openFilePicker)==null||v.call(x)}function d(){var x,v;(v=(x=o.value)==null?void 0:x.focusEditor)==null||v.call(x)}function c(){var x,v;return((v=(x=o.value)==null?void 0:x.flushPendingInput)==null?void 0:v.call(x))||!1}function f(x){var v,D;(D=(v=o.value)==null?void 0:v.insertBlocks)==null||D.call(v,x)}function m(x){var v,D;(D=(v=o.value)==null?void 0:v.insertImportedBlocks)==null||D.call(v,x)}function k(x){var v,D;(D=(v=o.value)==null?void 0:v.insertUploadedBlocks)==null||D.call(v,x)}function g(){var x,v;return((v=(x=o.value)==null?void 0:x.isImportedBlockActive)==null?void 0:v.call(x))||!1}function F(){var x,v;return((v=(x=o.value)==null?void 0:x.isComposing)==null?void 0:v.call(x))||!1}function B(){var x,v;return((v=(x=o.value)==null?void 0:x.isEditing)==null?void 0:v.call(x))||!1}return t({focusEditor:d,flushPendingInput:c,insertBlocks:f,insertImportedBlocks:m,insertUploadedBlocks:k,isComposing:F,isEditing:B,isImportedBlockActive:g,openFilePicker:a}),(x,v)=>e.loading&&!e.modelValue.length?(T(),O("section",hp,E(l(i)("workbench.loadingTaskContent")),1)):(T(),Se(lp,{key:1,ref_key:"blockEditorRef",ref:o,modelValue:s.value,"onUpdate:modelValue":v[5]||(v[5]=D=>s.value=D),"codex-session-id":e.codexSessionId,uploading:e.uploading,onUploadFiles:v[6]||(v[6]=D=>r("upload-files",D)),onImportTextFiles:v[7]||(v[7]=D=>r("import-text-files",D)),onImportPdfFiles:v[8]||(v[8]=D=>r("import-pdf-files",D)),onClearRequest:v[9]||(v[9]=D=>r("clear-request"))},{"header-actions":St(()=>[oe(pp,{"can-add-todo":e.canAddTodo,"is-current-task-sending":e.isCurrentTaskSending,"send-state":e.sendState,"todo-count":e.todoCount,uploading:e.uploading,onAddTodo:v[0]||(v[0]=D=>r("add-todo")),onOpenFilePicker:a,onClearRequest:v[1]||(v[1]=D=>r("clear-request")),onCopyRequest:v[2]||(v[2]=D=>r("copy-request")),onManageTodo:v[3]||(v[3]=D=>r("manage-todo")),onSendRequest:v[4]||(v[4]=D=>r("send-request"))},null,8,["can-add-todo","is-current-task-sending","send-state","todo-count","uploading"])]),_:1},8,["modelValue","codex-session-id","uploading"]))}},mp={class:"panel workbench-mobile-header-panel shrink-0 overflow-hidden"},gp={class:"workbench-panel-header workbench-mobile-header theme-divider border-b px-4 py-3"},bp={class:"flex items-center gap-3"},vp={class:"min-w-0 flex-1"},xp=["value","placeholder"],yp=["disabled"],kp={class:"truncate"},_p={__name:"WorkbenchMobileDetailHeader",props:{currentTaskSlug:{type:String,default:""},editingTaskTitleSlug:{type:String,default:""},title:{type:String,default:""},titleInputValue:{type:String,default:""},currentTaskAutoTitle:{type:String,default:""}},emits:["back","begin-edit","title-blur","cancel-title-edit","update:titleInputValue"],setup(e,{emit:t}){const u=t,{t:n}=kt();return(r,o)=>(T(),O("section",mp,[p("div",gp,[p("div",bp,[p("button",{type:"button",class:"tool-button inline-flex shrink-0 items-center gap-1.5 px-3 py-2 text-xs",onClick:o[0]||(o[0]=i=>u("back"))},[oe(l(Ci),{class:"h-4 w-4"}),p("span",null,E(l(n)("workbench.tasks")),1)]),p("div",vp,[e.currentTaskSlug&&e.editingTaskTitleSlug===e.currentTaskSlug?(T(),O("input",{key:0,value:e.titleInputValue,type:"text",maxlength:"140","data-task-title-input":"current",class:"block w-full appearance-none border-0 bg-transparent p-0 text-left text-sm font-semibold leading-6 outline-none placeholder:text-[var(--theme-textMuted)]",placeholder:e.currentTaskAutoTitle||l(n)("workbench.untitledTask"),onInput:o[1]||(o[1]=i=>u("update:titleInputValue",i.target.value)),onKeydown:[o[2]||(o[2]=au(Ue(i=>i.target.blur(),["prevent"]),["enter"])),o[3]||(o[3]=au(Ue(i=>u("cancel-title-edit"),["prevent"]),["esc"]))],onBlur:o[4]||(o[4]=i=>u("title-blur"))},null,40,xp)):(T(),O("button",{key:1,type:"button",class:"inline-flex w-full items-center gap-2 truncate bg-transparent p-0 text-left text-sm font-semibold leading-6",disabled:!e.currentTaskSlug,onClick:o[5]||(o[5]=i=>u("begin-edit"))},[p("span",kp,E(e.title||l(n)("workbench.untitledTask")),1),oe(l(Bu),{class:"h-3.5 w-3.5 shrink-0 opacity-50"})],8,yp))])])])]))}},wp={class:"panel flex h-full min-h-0 flex-col overflow-hidden"},Sp={class:"flex items-center justify-between gap-3"},Cp={class:"flex min-h-8 items-center"},Tp={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},Ep=["title"],Ap=["disabled","title"],Dp={class:"whitespace-nowrap"},Ip={class:"min-h-0 flex-1 overflow-y-auto px-3 py-3"},Fp={key:0,class:"theme-empty-state px-3 py-4 text-sm"},$p=["onClick"],Mp={key:0,class:"theme-selection-indicator absolute inset-y-2 left-0 w-1 rounded-full"},Pp={class:"flex items-start justify-between gap-3"},Bp={class:"min-w-0 h-5 flex-1 overflow-hidden"},Rp=["value","placeholder"],Lp=["title","onClick"],Np={class:"min-w-0 truncate"},Op={class:"flex shrink-0 items-center gap-1.5 text-[10px] uppercase tracking-[0.18em] opacity-80"},zp={class:"theme-divider border-t px-3 py-3"},qp={key:0,class:"theme-danger-text mb-3 inline-flex min-w-0 items-start gap-2 text-xs"},Up={class:"min-w-0 break-words"},jp={class:"grid grid-cols-2 gap-2"},Vp=["disabled","title"],Hp={class:"whitespace-nowrap"},Wp=["disabled","title"],Kp={class:"whitespace-nowrap"},fr={__name:"WorkbenchTaskListPanel",props:{loadingTasks:{type:Boolean,default:!1},tasks:{type:Array,default:()=>[]},currentTaskSlug:{type:String,default:""},editingTaskTitleSlug:{type:String,default:""},draftTitle:{type:String,default:""},currentTaskAutoTitle:{type:String,default:""},creatingTask:{type:Boolean,default:!1},loadingTask:{type:Boolean,default:!1},uploading:{type:Boolean,default:!1},error:{type:String,default:""},removingTask:{type:Boolean,default:!1},isCurrentTaskSending:{type:Boolean,default:!1},mobile:{type:Boolean,default:!1}},emits:["open-settings","create-task","select-task","title-click","title-blur","cancel-title-edit","update:draftTitle","edit-task","delete-task"],setup(e,{emit:t}){const u=e,n=t,{t:r}=kt();function o(c){return c.slug===u.currentTaskSlug?"workbench-task-card--active theme-card-selected":c.sending?"workbench-task-card--running theme-card-warning":"theme-card-idle-muted"}function i(){return"theme-status-warning"}function s(c){const f=new Date(c.updatedAt);return Number.isNaN(f.getTime())?"":u.mobile?gi(f.toISOString()):br(f.toISOString(),{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function a(c){var f,m;return!((f=c==null?void 0:c.workspaceDiffSummary)!=null&&f.supported)||!((m=c==null?void 0:c.workspaceDiffSummary)!=null&&m.fileCount)?!1:u.mobile?c.slug===u.currentTaskSlug||!!c.sending:!0}function d(c){return c.slug===u.currentTaskSlug?"theme-badge-strong":"theme-badge-muted"}return(c,f)=>(T(),O("aside",wp,[p("div",{class:we(["workbench-panel-header theme-divider border-b px-4 py-4",e.mobile?"workbench-mobile-header px-3 py-3":""])},[p("div",Sp,[p("div",Cp,[p("div",Tp,[oe(l(Ei),{class:"h-4 w-4"}),p("span",null,E(l(r)("workbench.title")),1)])]),p("button",{type:"button",class:"tool-button inline-flex items-center gap-2 whitespace-nowrap px-3 py-2 text-xs",title:l(r)("workbench.settings"),onClick:f[0]||(f[0]=m=>n("open-settings"))},[oe(l(Li),{class:"h-4 w-4"}),p("span",{class:we(e.mobile?"whitespace-nowrap":"hidden whitespace-nowrap sm:inline")},E(l(r)("workbench.settings")),3)],8,Ep)]),p("button",{type:"button",class:"tool-button tool-button-primary mt-4 inline-flex w-full items-center justify-center gap-2 whitespace-nowrap px-3 py-2 text-sm",disabled:e.creatingTask||e.uploading,title:e.creatingTask?l(r)("workbench.creatingTask"):l(r)("workbench.createTask"),onClick:f[1]||(f[1]=m=>n("create-task"))},[oe(l(yr),{class:"h-4 w-4"}),p("span",Dp,E(e.creatingTask?l(r)("workbench.creatingTask"):l(r)("workbench.createTask")),1)],8,Ap)],2),p("div",Ip,[e.loadingTasks&&!e.tasks.length?(T(),O("div",Fp,E(l(r)("workbench.loadingTasks")),1)):(T(),O("div",{key:1,class:we(["space-y-2",e.mobile?"space-y-1.5":""])},[(T(!0),O(ht,null,Dt(e.tasks,m=>{var k,g;return T(),O("article",{key:m.slug,class:we(["workbench-task-card group relative cursor-default rounded-sm border px-3 py-3 transition",[o(m),e.mobile?"workbench-task-card--mobile px-3 py-2.5":""]]),onClick:F=>n("select-task",m.slug)},[m.slug===e.currentTaskSlug?(T(),O("span",Mp)):xe("",!0),p("div",Pp,[p("div",Bp,[m.slug===e.currentTaskSlug&&e.editingTaskTitleSlug===m.slug?(T(),O("input",{key:0,value:e.draftTitle,type:"text",maxlength:"140","data-task-title-input":"current",class:"block h-5 min-h-0 w-full appearance-none border-0 bg-transparent p-0 text-left text-sm font-semibold leading-5 outline-none placeholder:text-[var(--theme-textMuted)]",placeholder:e.currentTaskAutoTitle||l(r)("workbench.untitledTask"),onClick:f[2]||(f[2]=Ue(()=>{},["stop"])),onInput:f[3]||(f[3]=F=>n("update:draftTitle",F.target.value)),onKeydown:[f[4]||(f[4]=au(Ue(F=>F.target.blur(),["prevent"]),["enter"])),f[5]||(f[5]=au(Ue(F=>n("cancel-title-edit"),["prevent"]),["esc"]))],onBlur:f[6]||(f[6]=F=>n("title-blur"))},null,40,Rp)):(T(),O("button",{key:1,type:"button",class:we(["inline-flex h-5 w-full items-center gap-1.5 truncate bg-transparent p-0 text-left text-sm leading-5",m.slug===e.currentTaskSlug?"font-semibold":"font-medium"]),title:m.displayTitle,onClick:Ue(F=>n("title-click",m.slug),["stop"])},[(k=m.automation)!=null&&k.enabled?(T(),Se(l(gn),{key:0,class:"h-3.5 w-3.5 shrink-0 opacity-70"})):xe("",!0),p("span",Np,E(m.displayTitle),1)],10,Lp))]),p("div",Op,[m.sending?(T(),O("span",{key:0,class:we(["inline-flex items-center gap-1.5 rounded-sm border border-dashed px-1.5 py-0.5",[i(),e.mobile?"text-[9px] tracking-[0.14em]":""]])},[f[9]||(f[9]=p("span",{class:"task-loading-dots","aria-hidden":"true"},[p("span",{class:"task-loading-dots__dot"}),p("span",{class:"task-loading-dots__dot"}),p("span",{class:"task-loading-dots__dot"})],-1)),p("span",null,E(l(r)("workbench.running")),1)],2)):xe("",!0)])]),p("div",{class:we(["workbench-task-card__preview mt-2 truncate text-xs opacity-80",e.mobile?"mt-1.5 text-[11px]":""])},E(m.lastPromptPreview||l(r)("workbench.noMessagesYet")),3),p("div",{class:we(["mt-2 flex items-center justify-between gap-3",e.mobile?"mt-1.5":""])},[p("div",{class:we(["min-w-0 text-[11px] opacity-70",e.mobile?"text-[10px] opacity-60":""])},E(s(m)),3),p("div",{class:we(["flex shrink-0 items-center gap-1.5 text-[10px] uppercase tracking-[0.18em] opacity-80",e.mobile?"tracking-[0.12em]":""])},[a(m)?(T(),O("span",{key:0,class:we(["inline-flex items-center gap-1 rounded-sm border border-dashed px-1.5 py-0.5",[d(m),e.mobile?"text-[9px]":""]])},[p("span",null,E(l(r)("workbench.filesCount",{count:((g=m.workspaceDiffSummary)==null?void 0:g.fileCount)||0})),1)],2)):xe("",!0)],2)],2)],10,$p)}),128))],2))]),p("div",zp,[e.error?(T(),O("div",qp,[oe(l(vr),{class:"mt-0.5 h-4 w-4 shrink-0"}),p("span",Up,E(e.error),1)])):xe("",!0),p("div",jp,[p("button",{type:"button",class:"tool-button inline-flex w-full items-center justify-center gap-2 whitespace-nowrap px-3 py-2 text-sm",disabled:!e.currentTaskSlug||e.removingTask||e.creatingTask,title:l(r)("workbench.editTask"),onClick:f[7]||(f[7]=m=>n("edit-task"))},[oe(l(Bu),{class:"h-4 w-4"}),p("span",Hp,E(l(r)("workbench.editTask")),1)],8,Vp),p("button",{type:"button",class:"tool-button tool-button-danger-subtle inline-flex w-full items-center justify-center gap-2 whitespace-nowrap px-3 py-2 text-sm",disabled:!e.currentTaskSlug||e.removingTask||e.creatingTask||e.isCurrentTaskSending,title:e.removingTask?l(r)("workbench.deletingTask"):l(r)("workbench.deleteTask"),onClick:f[8]||(f[8]=m=>n("delete-task"))},[oe(l(Pu),{class:"h-4 w-4"}),p("span",Kp,E(e.removingTask?l(r)("workbench.deletingTask"):l(r)("workbench.deleteTask")),1)],8,Wp)])])]))}},Gp={class:"panel flex h-full w-full max-w-3xl flex-col overflow-hidden sm:h-[40rem] sm:max-h-[86vh]"},Zp={class:"theme-divider flex items-start justify-between gap-4 border-b px-5 py-4"},Xp={class:"min-w-0"},Yp={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},Jp={class:"theme-muted-text mt-1 text-xs leading-5"},Qp={class:"theme-divider flex items-center justify-between gap-3 border-b border-dashed px-5 py-3 text-xs"},eh={class:"theme-muted-text"},th={class:"theme-status-neutral inline-flex items-center rounded-sm border border-dashed px-2 py-1"},uh={key:0,class:"min-h-0 flex-1 overflow-y-auto px-5 py-4"},nh={class:"space-y-3"},oh={class:"flex flex-wrap items-start justify-between gap-3"},rh={class:"min-w-0 flex-1"},ih={class:"theme-heading flex flex-wrap items-center gap-2 text-sm font-medium"},sh={class:"theme-status-neutral inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-0.5 text-[11px]"},ah={class:"mt-2 whitespace-pre-wrap break-words text-sm leading-6"},lh={class:"theme-muted-text mt-3 flex flex-wrap items-center gap-2 text-[11px]"},ch={class:"rounded-sm border border-dashed px-2 py-1"},dh={key:0,class:"inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1"},fh={key:1,class:"inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1"},ph={key:2,class:"inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1"},hh={class:"flex shrink-0 items-center gap-2"},mh=["onClick"],gh=["onClick"],bh={key:1,class:"theme-empty-state flex min-h-0 flex-1 items-center justify-center px-6 py-10 text-sm"},vh={__name:"WorkbenchTodoDialog",props:{items:{type:Array,default:()=>[]},open:{type:Boolean,default:!1}},emits:["close","delete","use"],setup(e,{emit:t}){const u=e,n=t,{t:r}=kt(),o=ce(()=>(u.items||[]).map(a=>{var F;const d=Array.isArray(a==null?void 0:a.blocks)?a.blocks:[],c=((F=d.find(B=>["text","imported_text"].includes(String((B==null?void 0:B.type)||""))&&String((B==null?void 0:B.content)||"").trim()))==null?void 0:F.content)||"",f=String(c||"").replace(/\s+/g," ").trim().slice(0,120),m=d.filter(B=>String((B==null?void 0:B.type)||"")==="image").length,k=d.filter(B=>String((B==null?void 0:B.type)||"")==="imported_text").length,g=d.filter(B=>String((B==null?void 0:B.type)||"")==="text"&&String((B==null?void 0:B.content)||"").trim()).length;return{...a,blockCount:d.length,imageCount:m,importedCount:k,preview:f||(m?r("todoDialog.imagePreview",{count:m}):r("todoDialog.noPreview")),textCount:g,timeLabel:i(a==null?void 0:a.createdAt)}}));function i(a=""){const d=Date.parse(String(a||""));if(!d)return r("todoDialog.justAdded");try{return new Intl.DateTimeFormat(void 0,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(d))}catch{return String(a||"")}}function s(a){u.open&&a.key==="Escape"&&n("close")}return Ee(()=>u.open,a=>{if(document.body.classList.toggle("overflow-hidden",a),a){window.addEventListener("keydown",s);return}window.removeEventListener("keydown",s)},{immediate:!0}),at(()=>{document.body.classList.remove("overflow-hidden"),window.removeEventListener("keydown",s)}),(a,d)=>(T(),Se(cu,{to:"body"},[e.open?(T(),O("div",{key:0,class:"theme-modal-backdrop fixed inset-0 z-[70] flex items-center justify-center px-4 py-6",onClick:d[1]||(d[1]=Ue(c=>n("close"),["self"]))},[p("section",Gp,[p("div",Zp,[p("div",Xp,[p("div",Yp,[oe(l(xr),{class:"h-4 w-4"}),p("span",null,E(l(r)("todoDialog.title")),1)]),p("p",Jp,E(l(r)("todoDialog.intro")),1)]),p("button",{type:"button",class:"theme-icon-button h-8 w-8 shrink-0",onClick:d[0]||(d[0]=c=>n("close"))},[oe(l(Cn),{class:"h-4 w-4"})])]),p("div",Qp,[p("span",eh,E(l(r)("todoDialog.summary",{count:o.value.length})),1),p("span",th,E(l(r)("todoDialog.summaryHint")),1)]),o.value.length?(T(),O("div",uh,[p("div",nh,[(T(!0),O(ht,null,Dt(o.value,c=>(T(),O("article",{key:c.id,class:"theme-card-idle-muted rounded-sm border border-dashed p-4"},[p("div",oh,[p("div",rh,[p("div",ih,[p("span",null,E(l(r)("todoDialog.itemTitle")),1),p("span",sh,[oe(l(gn),{class:"h-3.5 w-3.5"}),Fu(" "+E(c.timeLabel),1)])]),p("p",ah,E(c.preview),1),p("div",lh,[p("span",ch,E(l(r)("todoDialog.blockCount",{count:c.blockCount})),1),c.textCount?(T(),O("span",dh,[oe(l(Qn),{class:"h-3.5 w-3.5"}),Fu(" "+E(l(r)("todoDialog.textCount",{count:c.textCount})),1)])):xe("",!0),c.importedCount?(T(),O("span",fh,[oe(l(Qn),{class:"h-3.5 w-3.5"}),Fu(" "+E(l(r)("todoDialog.importedCount",{count:c.importedCount})),1)])):xe("",!0),c.imageCount?(T(),O("span",ph,[oe(l(co),{class:"h-3.5 w-3.5"}),Fu(" "+E(l(r)("todoDialog.imageCount",{count:c.imageCount})),1)])):xe("",!0)])]),p("div",hh,[p("button",{type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",onClick:f=>n("use",c.id)},[oe(l(Ti),{class:"h-4 w-4"}),p("span",null,E(l(r)("todoDialog.use")),1)],8,mh),p("button",{type:"button",class:"tool-button tool-button-danger-subtle inline-flex items-center gap-2 px-3 py-2 text-xs",onClick:f=>n("delete",c.id)},[oe(l(Pu),{class:"h-4 w-4"}),p("span",null,E(l(r)("todoDialog.delete")),1)],8,gh)])])]))),128))])])):(T(),O("div",bh,E(l(r)("todoDialog.empty")),1))])])):xe("",!0)]))}},xh={class:"pointer-events-none fixed inset-x-0 top-4 z-40 flex justify-center px-4"},yh={key:0,class:"app-top-toast theme-status-success flex max-w-md items-center gap-2 rounded-sm border px-4 py-2 text-sm shadow-[var(--theme-shadowPanel)] backdrop-blur"},kh={__name:"TopToast",props:{message:{type:String,default:""}},setup(e){return(t,u)=>(T(),Se(cu,{to:"body"},[p("div",xh,[oe(bi,{"enter-active-class":"transform transition duration-200 ease-out","enter-from-class":"-translate-y-3 opacity-0","enter-to-class":"translate-y-0 opacity-100","leave-active-class":"transform transition duration-150 ease-in","leave-from-class":"translate-y-0 opacity-100","leave-to-class":"-translate-y-2 opacity-0"},{default:St(()=>[e.message?(T(),O("div",yh,[oe(l(Fi),{class:"h-4 w-4 shrink-0"}),p("span",null,E(e.message),1)])):xe("",!0)]),_:1})])]))}};function _h(e,t=!1){const u=V(!!t);let n=null,r=()=>{};function o(i){u.value=!!i}return du(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;n=window.matchMedia(e),o(n.matches);const i=s=>{o(s.matches)};if(typeof n.addEventListener=="function"){n.addEventListener("change",i),r=()=>n==null?void 0:n.removeEventListener("change",i);return}typeof n.addListener=="function"&&(n.addListener(i),r=()=>n==null?void 0:n.removeListener(i))}),at(()=>{r()}),{matches:u}}const wh="(max-width: 1023px)",hn="promptxWorkbenchMobileView";function Zn(e){return(e==null?void 0:e[hn])==="detail"}function Sh({currentTaskSlug:e}){const{matches:t}=_h(wh),u=V("tasks"),n=V("activity");function r(f="tasks"){if(typeof window>"u")return;const m={...window.history.state||{}};f==="detail"?m[hn]="detail":delete m[hn],window.history.replaceState(m,"")}function o(){if(typeof window>"u")return;const f={...window.history.state||{},[hn]:"detail"};window.history.pushState(f,"")}function i(f=null){if(!t.value){u.value="detail";return}if(!e.value){u.value="tasks",r("tasks");return}u.value=Zn(f)?"detail":"tasks"}function s(f){t.value=!!f,i(typeof window>"u"?null:window.history.state)}function a(f={}){const{pushHistory:m=!0}=f;if(u.value="detail",!!t.value){if(m){o();return}r("detail")}}function d(f={}){const{useHistory:m=!0}=f;if(!t.value){u.value="tasks";return}if(m&&typeof window<"u"&&Zn(window.history.state)){window.history.back();return}u.value="tasks",r("tasks")}function c(f){t.value&&(u.value=Zn(f.state)&&e.value?"detail":"tasks")}return du(()=>{typeof window>"u"||window.addEventListener("popstate",c)}),at(()=>{typeof window<"u"&&window.removeEventListener("popstate",c)}),Ee(t,f=>{s(f)},{immediate:!0}),Ee(e,()=>{typeof window>"u"||i(window.history.state)},{flush:"post"}),{enterMobileDetail:a,isMobileLayout:t,leaveMobileDetail:d,mobileDetailTab:n,mobileView:u}}const so="PromptX";function Ch(e=""){const t=String(l(e)||"").trim();return t?`${so} (${t})`:so}function Th(e=""){vi(()=>{typeof document>"u"||(document.title=Ch(e))}),at(()=>{typeof document>"u"||(document.title=so)})}function Eh(e=2200){const t=V("");let u=null;function n(){u&&(window.clearTimeout(u),u=null),t.value=""}function r(o,i=e){t.value=o,u&&window.clearTimeout(u),u=window.setTimeout(()=>{t.value="",u=null},i)}return at(()=>{u&&window.clearTimeout(u)}),{toastMessage:t,flashToast:r,clearToast:n}}function Ah(e="",t=""){const u=String(e||"").trim();if(!u)return"";if(/^https?:\/\//i.test(u))return u;try{return new URL(u,t).toString()}catch{return u}}function Dh(e,t){const u=[];for(const[n,r]of((e==null?void 0:e.blocks)||[]).entries()){if(r.type===Me.TEXT||r.type===Me.IMPORTED_TEXT){const o=String(r.content||"").trim();o&&u.push(o,"");continue}if(r.type===Me.IMAGE){const o=Ah(r.content,t);o&&u.push(o,"")}}return u.join(`
236
+ `).trim()}function Ih(e,t){return Dh(e,t)}const ao="promptx:active-task-slug",Fh=150;function kn(e=null){return!e||typeof e!="object"?null:{supported:!!e.supported,fileCount:Math.max(0,Number(e.fileCount)||0),additions:Math.max(0,Number(e.additions)||0),deletions:Math.max(0,Number(e.deletions)||0),statsComplete:!!e.statsComplete}}function Qt(e=[]){return(e||[]).map(t=>{var u,n;return{...t,clientId:String((t==null?void 0:t.clientId)||(t==null?void 0:t.id)||((n=(u=globalThis.crypto)==null?void 0:u.randomUUID)==null?void 0:n.call(u))||`block-${Date.now()}-${Math.random().toString(36).slice(2,8)}`),meta:t!=null&&t.meta?{...t.meta}:{}}})}function ft(e=[]){return(e||[]).map(t=>({id:String((t==null?void 0:t.id)||"").trim(),createdAt:String((t==null?void 0:t.createdAt)||""),blocks:Qt((t==null?void 0:t.blocks)||[])}))}function pr(e={}){return{title:String(e.title||""),autoTitle:String(e.autoTitle||""),lastPromptPreview:String(e.lastPromptPreview||""),codexSessionId:String(e.codexSessionId||""),blocks:Qt(e.blocks||[]),todoItems:ft(e.todoItems||[])}}function hi(e=[]){return Qt(e).filter(t=>(t==null?void 0:t.type)===Me.IMAGE?!!String(t.content||"").trim():!!String((t==null?void 0:t.content)||"").trim())}function $h(e=[]){return hi(e).length>0}function Mh(){var t,u;const e=(u=(t=globalThis.crypto)==null?void 0:t.randomUUID)==null?void 0:u.call(t);return e?`todo-${e}`:`todo-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function hr(){return Qt([{type:Me.TEXT,content:"",meta:{}}])}function lo(e=[],t=16){return is(e,t)||""}function Ph(e=[],t=120){const u=e.find(n=>((n==null?void 0:n.type)==="text"||(n==null?void 0:n.type)==="imported_text")&&String(n.content||"").trim());return String((u==null?void 0:u.content)||"").replace(/\s+/g," ").trim().slice(0,t)}function mr(e={},t=[]){const u=String((e==null?void 0:e.title)||"").trim();if(u)return u;const n=String((e==null?void 0:e.autoTitle)||"").trim();if(n)return n;const r=lo(t);if(r)return r;const o=String((e==null?void 0:e.preview)||"").trim();return o?o.slice(0,16):Pe("workbench.untitledTask")}function _n(e={}){return!!(e!=null&&e.running)}function Bh(e={},t=!1){return t&&!_n(e)?"sending":_n(e)?"running":"idle"}function Rh(e=""){return["queued","starting","running","stopping"].includes(String(e||"").trim())}function gr(e="",t=72){return String(e||"").replace(/\s+/g," ").trim().slice(0,t)}function Lh(e=[],t=[]){const u=new Map((e||[]).map(s=>{const a=String((s==null?void 0:s.slug)||"").trim();return a?[a,s]:null}).filter(Boolean)),n=(t||[]).map(s=>{const a=String((s==null?void 0:s.slug)||"").trim(),d=String((s==null?void 0:s.codexSessionId)||"").trim();if(!a)return s;if(Object.prototype.hasOwnProperty.call(s,"workspaceDiffSummary"))return{...s,workspaceDiffSummary:kn(s.workspaceDiffSummary)};if(!d)return{...s,workspaceDiffSummary:null};const c=u.get(a),f=String((c==null?void 0:c.codexSessionId)||"").trim();return f&&f===d?{...s,workspaceDiffSummary:kn(c.workspaceDiffSummary)}:{...s,workspaceDiffSummary:null}}),r=new Map(n.map(s=>{const a=String((s==null?void 0:s.slug)||"").trim();return a?[a,s]:null}).filter(Boolean)),o=(e||[]).map(s=>{const a=String((s==null?void 0:s.slug)||"").trim();return a&&r.get(a)||null}).filter(Boolean);return[...n.filter(s=>{const a=String((s==null?void 0:s.slug)||"").trim();return a&&!u.has(a)}),...o]}function rn(e){if(typeof window>"u")return;const t=String(e||"").trim();if(t){window.localStorage.setItem(ao,t);return}window.localStorage.removeItem(ao)}function Nh(){return typeof window>"u"?"":String(window.localStorage.getItem(ao)||"").trim()}function Oh(){if(typeof window>"u")return"";try{const e=new URL(window.location.href);return String(e.searchParams.get("task")||"").trim()}catch{return""}}function zh(){if(!(typeof window>"u"))try{const e=new URL(window.location.href);if(!e.searchParams.has("task"))return;e.searchParams.delete("task");const t=`${e.pathname}${e.search}${e.hash}`;window.history.replaceState({},"",t||"/")}catch{}}function Du(e){const t={slug:e.slug,title:String(e.title||""),autoTitle:String(e.autoTitle||""),lastPromptPreview:String(e.lastPromptPreview||""),codexSessionId:String(e.codexSessionId||""),codexRunCount:Math.max(0,Number(e.codexRunCount)||0),todoCount:Math.max(0,Number(e.todoCount)||0),running:!!e.running,preview:String(e.lastPromptPreview||""),updatedAt:e.updatedAt||e.createdAt||new Date().toISOString(),createdAt:e.createdAt||e.updatedAt||new Date().toISOString(),automation:e!=null&&e.automation?{enabled:!!e.automation.enabled,cron:String(e.automation.cron||""),nextTriggerAt:String(e.automation.nextTriggerAt||"")}:void 0,notification:e!=null&&e.notification?{enabled:!!e.notification.enabled,channelType:String(e.notification.channelType||""),triggerOn:String(e.notification.triggerOn||""),lastStatus:String(e.notification.lastStatus||""),lastSentAt:String(e.notification.lastSentAt||"")}:void 0};return Object.prototype.hasOwnProperty.call(e,"workspaceDiffSummary")&&(t.workspaceDiffSummary=kn(e.workspaceDiffSummary)),t}function qh(e={}){const{clearToast:t=()=>{},flashToast:u=()=>{},scrollCurrentPanelToBottom:n=()=>{}}=e,r=ho(),o=Br(),i=V(null),s=V([]),a=V({}),d=V({}),c=V({}),f=V(""),m=V({title:"",autoTitle:"",lastPromptPreview:"",codexSessionId:"",blocks:[],todoItems:[]}),k=V(!0),g=V(!1),F=V(!1),B=V(!1),x=V(!1),v=V(!1),D=V(""),L=V(!1),$=V("");let te=null,C=null,Q=0,J=null,N=0,z=null;const ue=ce(()=>lo(m.value.blocks)),ae=ce(()=>mr({title:m.value.title,autoTitle:m.value.autoTitle,preview:Ph(m.value.blocks)},m.value.blocks)),ge=ce(()=>d.value[f.value]||""),de=ce(()=>Bh(Ae(f.value),c.value[f.value])),ke=ce(()=>de.value!=="idle"),U=ce(()=>s.value.some(_=>_n(_))||Object.values(c.value).some(Boolean)),K=ce(()=>$h(m.value.blocks)),S=ce(()=>ft(m.value.todoItems)),X=ce(()=>ae.value||Pe("workbench.untitledTask")),fe=ce(()=>s.value.map(_=>Be(_)));function q(_=""){return!_||!_.startsWith(r)?_:_.slice(r.length)}function H(_=[]){return _.map(A=>({id:Number.isInteger(Number(A==null?void 0:A.id))?Number(A.id):null,type:A==null?void 0:A.type,content:(A==null?void 0:A.type)==="image"?q(A.content):A.content,meta:A!=null&&A.meta?{...A.meta}:{}}))}function Y(_=m.value.title,A=m.value.autoTitle,W=m.value.lastPromptPreview,ne=m.value.todoItems,le=m.value.codexSessionId,ye=m.value.blocks){return JSON.stringify({title:String(_||""),autoTitle:String(A||""),lastPromptPreview:String(W||""),todoItems:ft(ne),codexSessionId:String(le||""),blocks:H(ye)})}function be(){return Y()!==$.value}function se(){var _,A;return!!((A=(_=i.value)==null?void 0:_.isEditing)!=null&&A.call(_))}function Ae(_){return s.value.find(A=>A.slug===_)||null}function _e(_){return _&&a.value[_]||null}function Be(_){const A=_e(_.slug),W=_.slug===f.value?m.value.blocks:(A==null?void 0:A.blocks)||[],ne=_.slug===f.value?m.value.title:(A==null?void 0:A.title)??_.title,le=_.slug===f.value?m.value.autoTitle:(A==null?void 0:A.autoTitle)??_.autoTitle,ye=_.slug===f.value?ft(m.value.todoItems).length:ft((A==null?void 0:A.todoItems)||[]).length||Number(_.todoCount||0),Ze=_.slug===f.value?m.value.lastPromptPreview||_.lastPromptPreview||"":(A==null?void 0:A.lastPromptPreview)||_.lastPromptPreview||"",Fe=_.slug===f.value?d.value[_.slug]||m.value.codexSessionId||_.codexSessionId||"":(A==null?void 0:A.codexSessionId)||_.codexSessionId||"";return{..._,title:ne,autoTitle:le,todoCount:ye,preview:Ze,codexSessionId:Fe,sessionSelectionLocked:!!(Fe&&Number(_.codexRunCount||0)>0),sessionSelectionLockReason:Fe&&Number(_.codexRunCount||0)>0?Pe("taskActions.sessionLocked"):"",displayTitle:mr({title:ne,autoTitle:le,preview:Ze},W),sending:_n(_)}}function De(_,A={}){const{insertAtStart:W=!1}=A;if(!(_!=null&&_.slug))return;const ne=[...s.value],le=ne.findIndex(ye=>ye.slug===_.slug);if(le>=0){ne.splice(le,1,{...ne[le],..._}),s.value=ne;return}W?ne.unshift(_):ne.push(_),s.value=ne}function re(_,A){_&&(a.value={...a.value,[_]:pr(A)})}function Ke(_){return _?`${r}/api/tasks/${_}/raw`:`${r}/api/tasks/`}function Xe(_=""){const A=String(_||"").trim();if(!A)return;const W=Ae(A),ne=o.getTaskRunChange(A);if(!W||!(ne!=null&&ne.status))return;const le=Rh(ne.status);!!W.running!==le&&De({...W,running:le})}function He(_,A){c.value={...c.value,[_]:!!A}}function lt(_=s.value){const A={};(_||[]).forEach(W=>{W!=null&&W.slug&&(A[W.slug]=!!W.running)}),c.value=A}function Ye(_,A){_&&(d.value={...d.value,[_]:String(A||"").trim()})}async function Ge(_,A){const W=String(_||"").trim();if(!W)return;const ne=String(A||"").trim(),le=Ae(W),ye=d.value[W]||(le==null?void 0:le.codexSessionId)||"";if(!!(ye&&Number((le==null?void 0:le.codexRunCount)||0)>0)&&ne!==ye){D.value=Pe("taskActions.sessionLocked");return}Ye(W,ne);const Fe=_e(W);Fe&&re(W,{...Fe,codexSessionId:ne}),le&&De({...le,codexSessionId:ne,workspaceDiffSummary:ne&&ne===ye?le.workspaceDiffSummary:null}),W===f.value&&(m.value={...m.value,codexSessionId:ne});try{await Bs(W,ne)}catch(zt){Ye(W,ye),Fe&&re(W,{...Fe,codexSessionId:ye}),le&&De({...le,codexSessionId:ye}),W===f.value&&(m.value={...m.value,codexSessionId:ye}),D.value=zt.message}}function ct(){te&&(window.clearTimeout(te),te=null)}function mt(){J&&(window.clearTimeout(J),J=null)}function ot(){ct(),!(g.value||!f.value)&&(te=window.setTimeout(()=>{y({auto:!0,silent:!0})},1500))}function Ve(){if(!f.value)return;const _=Ae(f.value)||{slug:f.value,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};De({..._,title:String(m.value.title||""),autoTitle:String(m.value.autoTitle||""),lastPromptPreview:String(m.value.lastPromptPreview||""),todoCount:ft(m.value.todoItems).length,codexSessionId:String(d.value[f.value]||m.value.codexSessionId||""),preview:String(m.value.lastPromptPreview||"")})}function gt(_={}){const A=String((_==null?void 0:_.slug)||"").trim();if(!A)return;const W=Du(_);De(W),A===f.value&&(Object.prototype.hasOwnProperty.call(_,"title")&&(m.value.title=String(_.title||"")),Object.prototype.hasOwnProperty.call(_,"autoTitle")&&(m.value.autoTitle=String(_.autoTitle||"")),re(A,{...m.value}))}function bt(_=[]){const A=new Map((_||[]).map(W=>{const ne=String((W==null?void 0:W.slug)||"").trim();return ne?[ne,kn(W.workspaceDiffSummary)]:null}).filter(Boolean));A.size&&(s.value=s.value.map(W=>A.has(W.slug)?{...W,workspaceDiffSummary:A.get(W.slug)}:W))}async function _t(_=s.value){const A=Array.isArray(_)?_:[],W=A.filter(le=>String((le==null?void 0:le.codexSessionId)||"").trim()),ne=++N;if(!W.length){s.value=A.map(le=>Object.prototype.hasOwnProperty.call(le,"workspaceDiffSummary")?le:{...le,workspaceDiffSummary:null});return}try{const le=await ws(A.length||30);if(ne!==N)return;bt(le.items||[])}catch{}}async function Qe(_={}){const{silent:A=!1}=_;A||(k.value=!0,D.value="");try{const W=await _s(),ne=Lh(s.value,(W.items||[]).map(Du));s.value=ne,lt(ne),_t(ne)}catch(W){A||(D.value=W.message)}finally{A||(k.value=!1)}}async function it(_=""){const A=String(f.value||"").trim();if(!A)return;if(!s.value.some(ne=>ne.slug===A)){if(s.value.length){await me(s.value[0].slug,{force:!0,skipIfDirtyOnApply:!0});return}f.value="",rn(""),m.value={title:"",autoTitle:"",lastPromptPreview:"",codexSessionId:"",blocks:[],todoItems:[]},$.value=Y("","","",[],"",[]),L.value=!1;return}_&&_!==A||se()||be()||L.value||x.value||v.value||g.value||await me(A,{force:!0,skipIfDirtyOnApply:!0,skipIfEditingOnApply:!0})}function Oe(_=""){const A=String(_||"").trim();z===null?z=A:z!==A&&(z=""),!J&&(J=window.setTimeout(async()=>{const W=z;z=null,J=null,await Qe({silent:!0}),await it(W||"")},Fh))}async function Ce(_){const A=await Cr(_),W=(A.blocks||[]).map(le=>({...le,content:le.type==="image"?ln(le.content):le.content}));return{state:{title:String(A.title||""),autoTitle:String(A.autoTitle||""),lastPromptPreview:String(A.lastPromptPreview||""),codexSessionId:String(A.codexSessionId||""),blocks:W,todoItems:ft(A.todoItems||[])},summary:Du({...A,blocks:W})}}async function me(_,A={}){const{focusEditor:W=!1,force:ne=!1,skipIfDirtyOnApply:le=!1,skipIfEditingOnApply:ye=!1,scrollPanelToBottom:Ze=!1}=A,Fe=String(_||"").trim();if(!Fe)return!1;const zt=++Q;g.value=!0,D.value="",t();try{const uu=String(f.value||"").trim();let qt=ne?null:_e(Fe),Kt=null;if(!qt){const dt=await Ce(Fe);qt=(dt==null?void 0:dt.state)||null,Kt=(dt==null?void 0:dt.summary)||null}return zt!==Q||le&&Fe===f.value&&(be()||L.value)||ye&&Fe===f.value&&se()?!1:(f.value=Fe,rn(Fe),m.value=pr(qt),re(Fe,qt),Kt&&De(Kt),Ye(Fe,qt.codexSessionId),$.value=Y(m.value.title,m.value.autoTitle,m.value.lastPromptPreview,m.value.todoItems,m.value.codexSessionId,m.value.blocks),L.value=!1,W&&Ie(()=>{var dt,pu;return(pu=(dt=i.value)==null?void 0:dt.focusEditor)==null?void 0:pu.call(dt)}),(Ze||Fe!==uu)&&n(),!0)}catch(uu){return zt===Q&&(D.value=uu.message),!1}finally{zt===Q&&(g.value=!1)}}async function y(_={}){const{auto:A=!1,silent:W=!1}=_;return f.value?Y()===$.value?!0:C||(ct(),x.value=!0,D.value="",C=(async()=>{try{const le=await Tr(f.value,{title:String(m.value.title||""),autoTitle:String(m.value.autoTitle||""),lastPromptPreview:String(m.value.lastPromptPreview||""),todoItems:ft(m.value.todoItems),codexSessionId:String(d.value[f.value]||m.value.codexSessionId||""),expiry:"none",visibility:"private",blocks:H(m.value.blocks)}),ye={title:String(le.title||""),autoTitle:String(le.autoTitle||""),lastPromptPreview:String(le.lastPromptPreview||""),todoItems:ft(le.todoItems||m.value.todoItems||[]),codexSessionId:String(d.value[f.value]||le.codexSessionId||""),blocks:Qt(m.value.blocks)};return re(f.value,ye),$.value=Y(ye.title,ye.autoTitle,ye.lastPromptPreview,ye.todoItems,ye.codexSessionId,ye.blocks),L.value=!1,De(Du(le)),!A&&!W&&u(Pe("taskActions.taskSaved")),!0}catch(le){return D.value=le.message,!1}finally{x.value=!1,C=null,Y()!==$.value&&(L.value=!0,ot())}})(),C):!1}async function ve(){return v.value?(D.value=Pe("taskActions.fileProcessing"),!1):C||(L.value?y({auto:!1,silent:!0}):!0)}async function Re(){if(!await ve()&&f.value)return!1;F.value=!0,D.value="";try{const _=await Ss({title:"",expiry:"none",visibility:"private"}),A={title:String(_.title||""),autoTitle:String(_.autoTitle||""),lastPromptPreview:String(_.lastPromptPreview||""),codexSessionId:String(_.codexSessionId||""),blocks:Qt(_.blocks||[]),todoItems:ft(_.todoItems||[])};return re(_.slug,A),De(Du(_),{insertAtStart:!0}),await me(_.slug,{focusEditor:!0}),u(Pe("taskActions.taskCreated")),!0}catch(_){return D.value=_.message,!1}finally{F.value=!1}}async function st(_){const A=String(_||"").trim();!A||A===f.value||!await ve()||await me(A)}async function Mt(){if(f.value){B.value=!0,D.value="";try{const _=f.value;await Cs(_),s.value=s.value.filter(le=>le.slug!==_);const A={...a.value};delete A[_],a.value=A;const W={...d.value};delete W[_],d.value=W;const ne={...c.value};delete ne[_],c.value=ne,s.value.length?await me(s.value[0].slug,{focusEditor:!0}):(f.value="",rn(""),m.value={title:"",autoTitle:"",lastPromptPreview:"",codexSessionId:"",blocks:[],todoItems:[]},$.value=Y("","","",[],"",[]),L.value=!1,await Re())}catch(_){D.value=_.message}finally{B.value=!1}}}function Wt(_={}){const{silent:A=!1}=_;f.value&&(m.value={...m.value,blocks:hr()},re(f.value,m.value),Ve(),L.value=!0,Ie(()=>{var W,ne;(ne=(W=i.value)==null?void 0:W.focusEditor)==null||ne.call(W)}),A||u(Pe("taskActions.taskCleared")))}function vt(){if(!f.value)return!1;const _=hi(m.value.blocks);return _.length?(m.value={...m.value,blocks:hr(),todoItems:[{id:Mh(),createdAt:new Date().toISOString(),blocks:_},...ft(m.value.todoItems)]},re(f.value,m.value),Ve(),L.value=!0,Ie(()=>{var A,W;(W=(A=i.value)==null?void 0:A.focusEditor)==null||W.call(A)}),u(Pe("taskActions.todoAdded")),!0):!1}function Pt(_=""){const A=String(_||"").trim();if(!f.value||!A)return!1;const W=ft(m.value.todoItems).filter(ne=>ne.id!==A);return W.length===ft(m.value.todoItems).length?!1:(m.value={...m.value,todoItems:W},re(f.value,m.value),Ve(),L.value=!0,!0)}function rt(_=""){const A=String(_||"").trim();if(!f.value||!A)return null;const W=ft(m.value.todoItems).find(ne=>ne.id===A);return W?(m.value={...m.value,blocks:Qt(W.blocks),todoItems:ft(m.value.todoItems).filter(ne=>ne.id!==A)},re(f.value,m.value),Ve(),L.value=!0,Ie(()=>{var ne,le;(le=(ne=i.value)==null?void 0:ne.focusEditor)==null||le.call(ne)}),W):null}async function R(){var le;if(await Qe(),!s.value.length){await Re();return}const _=Oh();if(_){const ye=await me(_,{focusEditor:!0,force:!0});if(zh(),ye)return}const A=((le=s.value.find(ye=>!!(ye!=null&&ye.running)))==null?void 0:le.slug)||"",W=Nh(),ne=A||(s.value.some(ye=>ye.slug===W)?W:s.value[0].slug);await me(ne,{focusEditor:!0,force:!0})}async function j(_){var A,W,ne;v.value=!0,D.value="";try{const le=((W=(A=i.value)==null?void 0:A.isImportedBlockActive)==null?void 0:W.call(A))||!1,ye=[];for(const Ze of _){const Fe=await Ts(Ze);ye.push({type:"image",content:ln(Fe.url),meta:{}})}(ne=i.value)==null||ne.insertUploadedBlocks(ye),u(Pe("taskActions.imageInserted",{count:ye.length,appended:le}))}catch(le){D.value=le.message}finally{v.value=!1}}async function ie(_){var A,W,ne;D.value="";try{const le=((W=(A=i.value)==null?void 0:A.isImportedBlockActive)==null?void 0:W.call(A))||!1,ye=[];for(const Ze of _){const Fe=await Ze.text();Fe.trim()&&ye.push({type:"imported_text",content:Fe,meta:{fileName:Ze.name||Pe("workbench.untitledTask"),collapsed:!0}})}if(!ye.length){u(Pe("taskActions.noTextImported"));return}(ne=i.value)==null||ne.insertImportedBlocks(ye),u(Pe("taskActions.importedBlocksInserted",{count:ye.length,appended:le}))}catch{D.value=Pe("taskActions.textImportFailed")}}async function he(_){var A;v.value=!0,D.value="";try{let W=0,ne=0;for(const le of _){const ye=await Es(le),Ze=(ye.blocks||[]).map(Fe=>({...Fe,content:Fe.type==="image"?ln(Fe.content):Fe.content}));Ze.length&&((A=i.value)==null||A.insertBlocks(Ze),W+=Ze.length,ne+=Number(ye.pageCount||0))}if(!W){u(Pe("taskActions.noPdfContent"));return}u(Pe("taskActions.pdfBlocksInserted",{blockCount:W,pageCount:ne}))}catch(W){D.value=W.message||Pe("taskActions.pdfImportFailed")}finally{v.value=!1}}function Te(_){const A=_===f.value?m.value:_e(_);return A?Ih({title:String(A.title||""),blocks:H(A.blocks||[])},Ke(_)):""}function Tt(_){const A=_===f.value?m.value:_e(_);return A?Qt(H(A.blocks||[])):[]}async function tu(_){return v.value?(D.value=Pe("taskActions.fileProcessingBeforeSend"),!1):_!==f.value?!0:x.value&&C?C:L.value?y({auto:!1,silent:!0}):!0}async function Ft(_){return await tu(_)?Te(_):""}function Et(_,A){const W=gr(A);!W||_!==f.value||(m.value.lastPromptPreview=W,re(f.value,m.value),Ve())}return Ee(m,()=>{if(g.value||!f.value)return;const _=lo(m.value.blocks);!String(m.value.title||"").trim()&&_&&_!==m.value.autoTitle&&(m.value.autoTitle=_),re(f.value,m.value),L.value=Y()!==$.value,Ve(),L.value&&!x.value&&ot()},{deep:!0}),Ee(f,_=>{_&&rn(_)}),at(()=>{ct(),mt()}),Ee(()=>o.listSyncVersion.value,()=>{Xe(o.listSyncTaskSlug.value),Oe(o.listSyncTaskSlug.value)}),{addCurrentDraftToTodo:vt,applyTaskSettingsUpdate:gt,buildPromptForTask:Te,getPromptBlocksForTask:Tt,buildPromptPreview:gr,clearCurrentTaskContent:Wt,createTaskAndSelect:Re,currentSelectedSessionId:ge,currentTaskSendState:de,currentTaskAutoTitle:ue,currentTaskDisplayTitle:ae,currentTaskSlug:f,draft:m,editorRef:i,error:D,handleImportPdfFiles:he,handleImportTextFiles:ie,handleTaskSendingChange:He,handleTaskSessionChange:Ge,handleUpload:j,hasCurrentDraftContent:K,hasAnyTaskSending:U,hasUnsavedChanges:L,initializeWorkbench:R,isCurrentTaskSending:ke,loadingTask:g,loadingTasks:k,pageTitle:X,prepareCodexPromptForTask:Ft,currentTodoItems:S,removeTodoItem:Pt,removeCurrentTask:Mt,removingTask:B,renderedTasks:fe,refreshTaskList:Qe,saveTask:y,saving:x,selectTask:st,selectedSessionMap:d,sendingTaskMap:c,taskDraftMap:a,tasks:s,useTodoItem:rt,updateLastPromptPreview:Et,uploading:v,creatingTask:F}}const Uh={class:"flex h-full min-h-0 flex-col overflow-hidden"},jh={key:3,class:"grid min-h-0 flex-1 gap-4 lg:grid-cols-[260px_minmax(0,1fr)] lg:grid-rows-1"},Vh={class:"grid min-h-0 gap-4 overflow-hidden lg:grid-cols-2 lg:grid-rows-1"},Hh={class:"min-h-0 min-w-0 overflow-hidden"},Wh={class:"min-h-0 min-w-0 overflow-hidden"},Kh={key:4,class:"min-h-0 flex-1 overflow-hidden"},Gh={key:1,class:"flex h-full min-h-0 flex-col gap-1.5 overflow-hidden"},Zh={class:"workbench-mobile-tabs-panel shrink-0"},Xh={class:"workbench-mobile-tabs grid grid-cols-2 gap-2"},Yh={class:"min-h-0 flex-1 overflow-hidden"},Jh={class:"h-full min-h-0"},Qh={class:"h-full min-h-0"},em={__name:"WorkbenchView",setup(e){const t=V(!1),u=V(!1),n=V(!1),r=V(!1),o=V(!1),i=V(!1),s=V(!1),a=V(!1),d=V(""),c=V(""),f=V(""),m=V(0),k=V("workspace"),g=V(""),{t:F}=kt(),{toastMessage:B,flashToast:x,clearToast:v}=Eh(),D=Yn(()=>Jn(()=>import("./TaskDiffReviewDialog-DJeBWA9i.js"),__vite__mapDeps([4,1,2]))),L=Yn(()=>Jn(()=>import("./WorkbenchSettingsDialog-D_Lykg61.js"),__vite__mapDeps([5,1,2,3]))),$=V(null);function te(I){return I?$.value:null}function C(){Ie(()=>{var I,Z;(Z=(I=te(S.value))==null?void 0:I.scrollToBottom)==null||Z.call(I)})}const{addCurrentDraftToTodo:Q,applyTaskSettingsUpdate:J,buildPromptForTask:N,getPromptBlocksForTask:z,clearCurrentTaskContent:ue,createTaskAndSelect:ae,creatingTask:ge,currentSelectedSessionId:de,currentTaskSendState:ke,currentTaskAutoTitle:U,currentTaskDisplayTitle:K,currentTaskSlug:S,draft:X,editorRef:fe,error:q,handleImportPdfFiles:H,handleImportTextFiles:Y,handleTaskSendingChange:be,handleTaskSessionChange:se,handleUpload:Ae,hasCurrentDraftContent:_e,hasUnsavedChanges:Be,initializeWorkbench:De,isCurrentTaskSending:re,loadingTask:Ke,loadingTasks:Xe,pageTitle:He,prepareCodexPromptForTask:lt,currentTodoItems:Ye,removeTodoItem:Ge,removeCurrentTask:ct,removingTask:mt,renderedTasks:ot,saveTask:Ve,saving:gt,selectTask:bt,updateLastPromptPreview:_t,useTodoItem:Qe,uploading:it}=qh({clearToast:v,flashToast:x,scrollCurrentPanelToBottom:C}),Oe=ce(()=>ot.value.find(I=>I.slug===S.value)||null),Ce=ce(()=>{var I,Z;return!!((Z=(I=Oe.value)==null?void 0:I.workspaceDiffSummary)!=null&&Z.supported)}),me=ce(()=>{const I=Oe.value;return I?()=>lt(I.slug):null}),y=ce(()=>{const I=Oe.value;return I?()=>z(I.slug):null}),ve=ce(()=>({creatingTask:ge.value,currentTaskAutoTitle:X.value.autoTitle||U.value,currentTaskSlug:S.value,draftTitle:X.value.title,editingTaskTitleSlug:f.value,error:q.value,isCurrentTaskSending:re.value,loadingTask:Ke.value,loadingTasks:Xe.value,removingTask:mt.value,tasks:ot.value,uploading:it.value})),Re=ce(()=>{var I,Z,G,ze,qe;return{buildPromptBlocks:y.value,buildPrompt:me.value,diffSupported:Ce.value,selectedSessionId:((I=Oe.value)==null?void 0:I.codexSessionId)||"",sessionSelectionLockReason:((Z=Oe.value)==null?void 0:Z.sessionSelectionLockReason)||"",sessionSelectionLocked:!!((G=Oe.value)!=null&&G.sessionSelectionLocked),taskSlug:((ze=Oe.value)==null?void 0:ze.slug)||"",taskRunning:!!((qe=Oe.value)!=null&&qe.running)}}),st=ce(()=>({canAddTodo:_e.value,codexSessionId:de.value,isCurrentTaskSending:re.value,sendState:ke.value,loading:Ke.value,todoCount:Ye.value.length,uploading:it.value})),Mt=ce(()=>({currentTaskAutoTitle:X.value.autoTitle||U.value,currentTaskSlug:S.value,editingTaskTitleSlug:f.value,title:K.value,titleInputValue:X.value.title})),{enterMobileDetail:Wt,isMobileLayout:vt,leaveMobileDetail:Pt,mobileDetailTab:rt,mobileView:R}=Sh({currentTaskSlug:S});function j(I){return I!=null&&I.sending||Number((I==null?void 0:I.codexRunCount)||0)>0?"activity":"input"}Th(He);function ie(I="workspace",Z=""){k.value=I==="run"?"run":I==="task"?"task":"workspace",g.value=k.value==="run"?String(Z||""):"",n.value=!0,m.value+=1}function he(){n.value=!1}function Te(){r.value=!0}function Tt(){r.value=!1}function tu(){S.value&&(o.value=!0)}function Ft(){o.value=!1}function Et(){i.value=!0}function _(){i.value=!1,A(),W()}function A(){s.value=!1,d.value=""}function W(){a.value=!1,c.value=""}function ne(I){J(I)}function le(I){X.value.title=I}async function ye(){f.value="",Be.value&&await Ve({auto:!1,silent:!0})}function Ze(I){I===S.value&&(f.value=I,Ie(()=>{var G,ze;const Z=document.querySelector('[data-task-title-input="current"]');(G=Z==null?void 0:Z.focus)==null||G.call(Z),(ze=Z==null?void 0:Z.select)==null||ze.call(Z)}))}async function Fe(I){if(vt.value){await hu(I);return}if(I!==S.value){await hu(I);return}Ze(I)}function zt(){u.value=!0}function uu(){mt.value||(u.value=!1)}async function qt(){await ct(),u.value=!1,vt.value&&Pt({useHistory:!1})}function Kt(){t.value=!0}function dt(){t.value=!1}function pu(){t.value=!1,ue()}function In(I){const Z=Oe.value;Z&&be(Z.slug,I)}function Fn(I){const Z=Oe.value;Z&&se(Z.slug,I)}async function Ut(){var I,Z,G,ze,qe,xt,et,nu;typeof document<"u"&&((Z=(I=fe.value)==null?void 0:I.isComposing)!=null&&Z.call(I))&&((ze=(G=document.activeElement)==null?void 0:G.blur)==null||ze.call(G)),(xt=(qe=fe.value)==null?void 0:qe.flushPendingInput)==null||xt.call(qe),await Ie(),(nu=(et=fe.value)==null?void 0:et.flushPendingInput)==null||nu.call(et),await Ie()}async function Hu(){await Ut(),await navigator.clipboard.writeText(N(S.value)),x(F("workbench.promptCopied"))}async function Wu(){await ae()&&vt.value&&(rt.value="input",Wt())}async function hu(I){const Z=String(I||"").trim();Z&&(Z!==S.value&&await bt(Z),vt.value&&S.value===Z&&(rt.value=j(Oe.value),Wt()))}async function Ku(){await Ut(),Q()}function Gu(I){d.value=String(I||"").trim(),s.value=!!d.value}function Zu(){d.value&&(Ge(d.value),A())}async function Xu(I=c.value){const Z=String(I||"").trim();return!Z||!Qe(Z)?!1:(W(),_(),!0)}async function $n(I){await Ut();const Z=String(I||"").trim();if(Z){if(!_e.value){await Xu(Z);return}c.value=Z,a.value=!0}}async function Cu(){var ze,qe,xt,et;const I=S.value;if(!I)return;const Z=!!((qe=(ze=Oe.value)==null?void 0:ze.automation)!=null&&qe.enabled);await Ut(),_t(I,N(I)),!(!await((et=(xt=te(I))==null?void 0:xt.send)==null?void 0:et.call(xt))||I!==S.value)&&(vt.value&&(rt.value="activity"),Z||ue({silent:!0}),await Ve({auto:!1,silent:!0}))}function Mn(){!vt.value||R.value!=="detail"||rt.value!=="input"||!S.value||Ie(()=>{var I,Z;(Z=(I=fe.value)==null?void 0:I.focusEditor)==null||Z.call(I)})}function h(I){!Be.value&&!it.value&&!gt.value||(I.preventDefault(),I.returnValue="")}function b(I){if(!I.metaKey&&!I.ctrlKey&&I.shiftKey&&I.key==="Enter"){I.preventDefault(),Cu();return}if(I.metaKey||I.ctrlKey){if(I.key.toLowerCase()==="s"){I.preventDefault(),Ve({auto:!1});return}I.shiftKey&&I.key==="Backspace"&&(I.preventDefault(),Kt())}}du(()=>{De(),window.addEventListener("beforeunload",h),window.addEventListener("keydown",b)}),at(()=>{window.removeEventListener("beforeunload",h),window.removeEventListener("keydown",b)}),Ee([vt,R,rt,S],([I,Z,G,ze])=>{!I||Z!=="detail"||G!=="input"||!ze||Mn()});const w={"update:draftTitle":le,"cancel-title-edit":()=>{f.value=""},"create-task":Wu,"edit-task":tu,"delete-task":zt,"open-settings":Te,"select-task":hu,"title-blur":ye,"title-click":Fe},M={"open-diff":({scope:I,runId:Z})=>ie(I,Z),"project-created":()=>x(F("workbench.projectCreated")),"selected-session-change":Fn,"sending-change":In},ee={"add-todo":Ku,"clear-request":Kt,"copy-request":Hu,"import-pdf-files":H,"import-text-files":Y,"manage-todo":Et,"send-request":Cu,"upload-files":Ae},pe={"begin-edit":()=>Ze(S.value),back:Pt,"cancel-title-edit":()=>{f.value=""},"title-blur":ye,"update:titleInputValue":le};return(I,Z)=>(T(),O("div",Uh,[oe(kh,{message:l(B)},null,8,["message"]),oe(en,{open:t.value,title:l(F)("workbench.confirmClearTitle"),description:l(F)("workbench.confirmClearDescription"),"confirm-text":l(F)("workbench.confirmClearAction"),"cancel-text":l(F)("workbench.continueEditing"),onCancel:dt,onConfirm:pu},null,8,["open","title","description","confirm-text","cancel-text"]),oe(en,{open:u.value,title:l(F)("workbench.confirmDeleteTitle"),description:l(F)("workbench.confirmDeleteDescription",{title:l(K)}),"confirm-text":l(F)("workbench.confirmDeleteAction"),"cancel-text":l(F)("workbench.keepForNow"),loading:l(mt),danger:"",onCancel:uu,onConfirm:qt},null,8,["open","title","description","confirm-text","cancel-text","loading"]),oe(en,{open:s.value,title:l(F)("workbench.confirmDeleteTodoTitle"),description:l(F)("workbench.confirmDeleteTodoDescription"),"confirm-text":l(F)("workbench.confirmDeleteAction"),"cancel-text":l(F)("workbench.keepForNow"),danger:"",onCancel:A,onConfirm:Zu},null,8,["open","title","description","confirm-text","cancel-text"]),oe(en,{open:a.value,title:l(F)("workbench.replaceEditorTitle"),description:l(F)("workbench.replaceEditorDescription"),"confirm-text":l(F)("workbench.confirmReplaceAction"),"cancel-text":l(F)("workbench.dontReplaceYet"),onCancel:W,onConfirm:Z[0]||(Z[0]=G=>Xu())},null,8,["open","title","description","confirm-text","cancel-text"]),oe(vh,{open:i.value,items:l(Ye),onClose:_,onDelete:Gu,onUse:$n},null,8,["open","items"]),n.value?(T(),Se(l(D),{key:0,open:n.value,"task-slug":l(S),"task-title":l(K),"preferred-scope":k.value,"preferred-run-id":g.value,"focus-token":m.value,onClose:he},null,8,["open","task-slug","task-title","preferred-scope","preferred-run-id","focus-token"])):xe("",!0),r.value?(T(),Se(l(L),{key:1,open:r.value,onClose:Tt},null,8,["open"])):xe("",!0),o.value?(T(),Se(ol,{key:2,open:o.value,"task-slug":l(S),"task-title":l(K),onClose:Ft,onSaved:ne},null,8,["open","task-slug","task-title"])):xe("",!0),l(vt)?(T(),O("div",Kh,[l(R)==="tasks"?(T(),Se(fr,ou({key:0},ve.value,{mobile:""},ru(w)),null,16)):(T(),O("div",Gh,[oe(_p,ou(Mt.value,ru(pe)),null,16),p("section",Zh,[p("div",Xh,[p("button",{type:"button",class:we(["tool-button px-3 py-1.5 text-sm",l(rt)==="activity"?"tool-button-accent-subtle":""]),onClick:Z[2]||(Z[2]=G=>rt.value="activity")},E(l(F)("workbench.activity")),3),p("button",{type:"button",class:we(["tool-button px-3 py-1.5 text-sm",l(rt)==="input"?"tool-button-accent-subtle":""]),onClick:Z[3]||(Z[3]=G=>rt.value="input")},E(l(F)("workbench.input")),3)])]),p("div",Yh,[Zt(p("div",Jh,[oe(cr,ou({ref_key:"codexPanelRef",ref:$},Re.value,{"empty-message":l(F)("workbench.selectTask")},ru(M)),null,16,["empty-message"])],512),[[Eo,l(rt)==="activity"]]),Zt(p("div",Qh,[oe(dr,ou({ref_key:"editorRef",ref:fe,modelValue:l(X).blocks,"onUpdate:modelValue":Z[4]||(Z[4]=G=>l(X).blocks=G)},st.value,ru(ee)),null,16,["modelValue"])],512),[[Eo,l(rt)==="input"]])])]))])):(T(),O("div",jh,[oe(fr,ou(ve.value,ru(w)),null,16),p("div",Vh,[p("div",Hh,[Oe.value?(T(),Se(cr,ou({key:0,ref_key:"codexPanelRef",ref:$},Re.value,ru(M)),null,16)):xe("",!0)]),p("div",Wh,[oe(dr,ou({ref_key:"editorRef",ref:fe,modelValue:l(X).blocks,"onUpdate:modelValue":Z[1]||(Z[1]=G=>l(X).blocks=G)},st.value,ru(ee)),null,16,["modelValue"])])])]))]))}},im=Object.freeze(Object.defineProperty({__proto__:null,default:em},Symbol.toStringTag,{value:"Module"}));export{_r as A,Ai as B,Pn as C,Fo as F,Lt as L,yr as P,Bi as S,Pu as T,im as W,Cn as X,Ht as _,Mu as a,_h as b,$e as c,Di as d,vr as e,Qu as f,rm as g,Li as h,ps as i,um as j,We as k,Rs as l,Ii as m,wr as n,nm as o,en as p,Bu as q,je as r,om as s,Ci as t,Br as u};