plan-review 0.1.1 → 1.0.0

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,415 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Plan Review</title>
7
+ <style>:root {
8
+ --bg-primary: #1a1a2e;
9
+ --bg-secondary: #16213e;
10
+ --bg-tertiary: #0f3460;
11
+ --text-primary: #e0e0e0;
12
+ --text-secondary: #a0a0a0;
13
+ --accent: #00adb5;
14
+ --accent-hover: #00ccd3;
15
+ --border: #2a2a4a;
16
+ --danger: #e74c3c;
17
+ --success: #2ecc71;
18
+ }
19
+
20
+ * { margin: 0; padding: 0; box-sizing: border-box; }
21
+
22
+ body {
23
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
24
+ background: var(--bg-primary);
25
+ color: var(--text-primary);
26
+ line-height: 1.6;
27
+ }
28
+
29
+ .app {
30
+ display: flex;
31
+ flex-direction: column;
32
+ height: 100vh;
33
+ }
34
+
35
+ .top-bar {
36
+ display: flex;
37
+ align-items: center;
38
+ gap: 16px;
39
+ padding: 12px 20px;
40
+ background: var(--bg-secondary);
41
+ border-bottom: 1px solid var(--border);
42
+ }
43
+
44
+ .top-bar h1 { font-size: 18px; flex: 1; }
45
+
46
+ .mode-badge {
47
+ padding: 2px 8px;
48
+ border-radius: 4px;
49
+ font-size: 12px;
50
+ background: var(--bg-tertiary);
51
+ color: var(--accent);
52
+ }
53
+
54
+ .comment-count { font-size: 14px; color: var(--text-secondary); }
55
+
56
+ .submit-btn {
57
+ padding: 8px 16px;
58
+ background: var(--accent);
59
+ color: white;
60
+ border: none;
61
+ border-radius: 4px;
62
+ cursor: pointer;
63
+ font-size: 14px;
64
+ }
65
+
66
+ .submit-btn:hover { background: var(--accent-hover); }
67
+ .submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
68
+
69
+ .panels { display: flex; flex: 1; overflow: hidden; }
70
+
71
+ .toc-panel {
72
+ width: 220px;
73
+ padding: 16px;
74
+ background: var(--bg-secondary);
75
+ border-right: 1px solid var(--border);
76
+ overflow-y: auto;
77
+ }
78
+
79
+ .toc-milestone h3 {
80
+ font-size: 13px;
81
+ color: var(--accent);
82
+ margin: 12px 0 4px;
83
+ }
84
+
85
+ .toc-panel ul { list-style: none; }
86
+
87
+ .toc-item {
88
+ display: flex;
89
+ gap: 8px;
90
+ padding: 6px 8px;
91
+ cursor: pointer;
92
+ border-radius: 4px;
93
+ font-size: 13px;
94
+ }
95
+
96
+ .toc-item:hover { background: var(--bg-tertiary); }
97
+ .toc-item.active { background: var(--bg-tertiary); border-left: 2px solid var(--accent); }
98
+ .toc-item.commented .toc-marker { color: var(--success); }
99
+ .toc-id { color: var(--text-secondary); }
100
+
101
+ .content-area { flex: 1; padding: 20px; overflow-y: auto; }
102
+
103
+ .section-view {
104
+ margin-bottom: 24px;
105
+ padding: 16px;
106
+ border: 1px solid var(--border);
107
+ border-radius: 8px;
108
+ }
109
+
110
+ .section-view.active { border-color: var(--accent); }
111
+ .section-view.being-commented {
112
+ border-color: var(--accent);
113
+ background: color-mix(in srgb, var(--accent) 4%, transparent);
114
+ }
115
+ .section-view h2 { font-size: 16px; margin-bottom: 12px; }
116
+
117
+ .section-meta {
118
+ margin-bottom: 12px;
119
+ padding: 8px 12px;
120
+ background: var(--bg-secondary);
121
+ border-radius: 4px;
122
+ font-size: 13px;
123
+ }
124
+
125
+ .section-meta span { display: block; color: var(--text-secondary); }
126
+
127
+ .section-body { font-size: 14px; line-height: 1.7; }
128
+ .section-body h1, .section-body h2, .section-body h3 { margin: 16px 0 8px; }
129
+ .section-body code { background: var(--bg-secondary); padding: 2px 6px; border-radius: 3px; font-size: 13px; }
130
+ .section-body pre { background: var(--bg-secondary); padding: 12px; border-radius: 6px; overflow-x: auto; }
131
+
132
+ .add-comment-btn {
133
+ margin-top: 12px;
134
+ padding: 6px 12px;
135
+ background: transparent;
136
+ color: var(--accent);
137
+ border: 1px solid var(--accent);
138
+ border-radius: 4px;
139
+ cursor: pointer;
140
+ font-size: 13px;
141
+ }
142
+
143
+ .add-comment-btn:hover { background: var(--accent); color: white; }
144
+
145
+ .comment-sidebar {
146
+ width: 300px;
147
+ padding: 16px;
148
+ background: var(--bg-secondary);
149
+ border-left: 1px solid var(--border);
150
+ overflow-y: auto;
151
+ }
152
+
153
+ .comment-sidebar h2 { font-size: 16px; margin-bottom: 12px; }
154
+
155
+ .commenting-for h3,
156
+ .comment-group h3 { font-size: 13px; color: var(--accent); margin: 12px 0 8px; }
157
+
158
+ .comment-card {
159
+ padding: 10px;
160
+ margin-bottom: 8px;
161
+ background: var(--bg-primary);
162
+ border-radius: 6px;
163
+ font-size: 13px;
164
+ }
165
+
166
+ .comment-section { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
167
+ .comment-text { margin: 6px 0; white-space: pre-wrap; }
168
+
169
+ .comment-actions { display: flex; gap: 8px; }
170
+ .comment-actions button {
171
+ background: none;
172
+ border: none;
173
+ color: var(--text-secondary);
174
+ cursor: pointer;
175
+ font-size: 12px;
176
+ padding: 2px 4px;
177
+ }
178
+ .comment-actions button:hover { color: var(--text-primary); }
179
+ .comment-actions button.delete:hover { color: var(--danger); }
180
+
181
+ .comment-input { margin: 8px 0; }
182
+ .comment-input textarea {
183
+ width: 100%;
184
+ min-height: 80px;
185
+ padding: 8px;
186
+ background: var(--bg-primary);
187
+ color: var(--text-primary);
188
+ border: 1px solid var(--border);
189
+ border-radius: 4px;
190
+ font-family: inherit;
191
+ font-size: 13px;
192
+ resize: vertical;
193
+ }
194
+ .comment-input textarea:focus { outline: none; border-color: var(--accent); }
195
+
196
+ .comment-input-actions { display: flex; gap: 8px; margin-top: 8px; }
197
+ .comment-input-actions button {
198
+ padding: 6px 12px;
199
+ border: none;
200
+ border-radius: 4px;
201
+ cursor: pointer;
202
+ font-size: 13px;
203
+ }
204
+ .comment-input-actions .add-btn { background: var(--accent); color: white; }
205
+ .comment-input-actions .add-btn:hover { background: var(--accent-hover); }
206
+ .comment-input-actions .cancel-btn { background: var(--bg-tertiary); color: var(--text-primary); }
207
+
208
+ .no-comments { color: var(--text-secondary); font-size: 13px; font-style: italic; }
209
+
210
+ .loading, .submitted {
211
+ display: flex;
212
+ align-items: center;
213
+ justify-content: center;
214
+ height: 100vh;
215
+ font-size: 18px;
216
+ }
217
+ .loading { color: var(--text-secondary); }
218
+ .submitted { color: var(--success); }
219
+
220
+ /* ── Line block gutter ──────────────────────────────────── */
221
+
222
+ .line-block {
223
+ display: flex;
224
+ align-items: flex-start;
225
+ gap: 6px;
226
+ padding: 2px 0 2px 4px;
227
+ border-left: 2px solid transparent;
228
+ transition: background 0.1s, border-color 0.1s;
229
+ position: relative;
230
+ }
231
+
232
+ .line-block:hover,
233
+ .line-block.hovered {
234
+ background: color-mix(in srgb, var(--accent) 7%, transparent);
235
+ border-left-color: var(--accent);
236
+ }
237
+
238
+ .line-block.in-range {
239
+ background: color-mix(in srgb, var(--accent) 12%, transparent);
240
+ border-left-color: var(--accent);
241
+ }
242
+
243
+ .line-block.has-comment {
244
+ background: color-mix(in srgb, #facc15 8%, transparent);
245
+ border-left-color: #facc15;
246
+ }
247
+
248
+ .line-gutter {
249
+ width: 20px;
250
+ flex-shrink: 0;
251
+ display: flex;
252
+ align-items: flex-start;
253
+ padding-top: 3px;
254
+ justify-content: center;
255
+ font-size: 13px;
256
+ line-height: 1;
257
+ cursor: pointer;
258
+ user-select: none;
259
+ color: var(--border);
260
+ transition: color 0.1s;
261
+ }
262
+
263
+ .line-block:hover .line-gutter,
264
+ .line-block.hovered .line-gutter {
265
+ color: var(--accent);
266
+ font-weight: bold;
267
+ }
268
+
269
+ .line-block.in-range .line-gutter {
270
+ color: var(--accent);
271
+ }
272
+
273
+ .line-block.has-comment .line-gutter {
274
+ color: #facc15;
275
+ }
276
+
277
+ .line-block.pending-comment {
278
+ background: color-mix(in srgb, #fde047 8%, transparent);
279
+ border-left-color: #fde047;
280
+ }
281
+
282
+ .line-block.pending-comment .line-gutter {
283
+ color: #fde047;
284
+ }
285
+
286
+ .line-inner {
287
+ flex: 1;
288
+ min-width: 0;
289
+ font-size: 14px;
290
+ line-height: 1.7;
291
+ }
292
+
293
+ .line-inner p { margin: 0; }
294
+ .line-inner pre { background: var(--bg-secondary); padding: 10px 12px; border-radius: 6px; overflow-x: auto; }
295
+ .line-inner code { background: var(--bg-secondary); padding: 2px 6px; border-radius: 3px; font-size: 13px; }
296
+ .line-inner ul { list-style: disc; }
297
+ .line-inner ol { list-style: decimal; }
298
+ .line-inner blockquote { border-left: 3px solid var(--border); padding-left: 12px; color: var(--text-secondary); margin: 0; }
299
+ .line-inner h3, .line-inner h4 { font-size: 14px; margin: 4px 0; }
300
+
301
+ .add-section-comment-link {
302
+ display: inline-block;
303
+ margin-top: 12px;
304
+ font-size: 12px;
305
+ color: var(--text-secondary);
306
+ cursor: pointer;
307
+ text-decoration: underline;
308
+ text-underline-offset: 2px;
309
+ }
310
+
311
+ .add-section-comment-link:hover { color: var(--accent); }
312
+
313
+ .range-start-hint {
314
+ font-size: 11px;
315
+ color: var(--accent);
316
+ font-style: italic;
317
+ padding: 6px 8px;
318
+ background: color-mix(in srgb, var(--accent) 10%, transparent);
319
+ border-radius: 4px;
320
+ margin-bottom: 8px;
321
+ }
322
+
323
+ .comment-anchor-label {
324
+ font-size: 11px;
325
+ font-weight: 600;
326
+ color: var(--accent);
327
+ text-transform: uppercase;
328
+ letter-spacing: 0.04em;
329
+ margin-bottom: 6px;
330
+ }
331
+
332
+ .comment-anchor-quote {
333
+ border-left: 2px solid var(--border);
334
+ padding: 4px 8px;
335
+ font-size: 12px;
336
+ color: var(--text-secondary);
337
+ font-style: italic;
338
+ margin-bottom: 10px;
339
+ line-height: 1.5;
340
+ }
341
+
342
+ .comment-anchor-quote p { margin: 0; }
343
+
344
+ .comment-section-label {
345
+ font-size: 11px;
346
+ color: var(--text-secondary);
347
+ text-transform: uppercase;
348
+ letter-spacing: 0.03em;
349
+ margin-bottom: 6px;
350
+ }
351
+ </style>
352
+ </head>
353
+ <body>
354
+ <div id="app"></div>
355
+ <script>/* bundled with preact */
356
+ "use strict";(()=>{var ne,v,Ze,Mt,D,Oe,We,Qe,me,X,F,Ve,ve,ke,be,qt,Y={},ee=[],Nt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,re=Array.isArray;function E(t,e){for(var n in e)t[n]=e[n];return t}function we(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function jt(t,e,n){var i,r,s,o={};for(s in e)s=="key"?i=e[s]:s=="ref"?r=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?ne.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return J(t,o,i,r,null)}function J(t,e,n,i,r){var s={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++Ze,__i:-1,__u:0};return r==null&&v.vnode!=null&&v.vnode(s),s}function M(t){return t.children}function K(t,e){this.props=t,this.context=e}function O(t,e){if(e==null)return t.__?O(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?O(t):null}function Ot(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,i=[],r=[],s=E({},e);s.__v=e.__v+1,v.vnode&&v.vnode(s),ye(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,i,n??O(e),!!(32&e.__u),r),s.__v=e.__v,s.__.__k[s.__i]=s,Ye(i,s,r),e.__e=e.__=null,s.__e!=n&&Xe(s)}}function Xe(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),Xe(t)}function Fe(t){(!t.__d&&(t.__d=!0)&&D.push(t)&&!te.__r++||Oe!=v.debounceRendering)&&((Oe=v.debounceRendering)||We)(te)}function te(){try{for(var t,e=1;D.length;)D.length>e&&D.sort(Qe),t=D.shift(),e=D.length,Ot(t)}finally{D.length=te.__r=0}}function Je(t,e,n,i,r,s,o,l,u,a,p){var c,h,d,_,g,w,k,b=i&&i.__k||ee,m=e.length;for(u=Ft(n,e,b,u,m),c=0;c<m;c++)(d=n.__k[c])!=null&&(h=d.__i!=-1&&b[d.__i]||Y,d.__i=c,w=ye(t,d,h,r,s,o,l,u,a,p),_=d.__e,d.ref&&h.ref!=d.ref&&(h.ref&&Te(h.ref,null,d),p.push(d.ref,d.__c||_,d)),g==null&&_!=null&&(g=_),(k=!!(4&d.__u))||h.__k===d.__k?(u=Ke(d,u,t,k),k&&h.__e&&(h.__e=null)):typeof d.type=="function"&&w!==void 0?u=w:_&&(u=_.nextSibling),d.__u&=-7);return n.__e=g,u}function Ft(t,e,n,i,r){var s,o,l,u,a,p=n.length,c=p,h=0;for(t.__k=new Array(r),s=0;s<r;s++)(o=e[s])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=t.__k[s]=J(null,o,null,null,null):re(o)?o=t.__k[s]=J(M,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=t.__k[s]=J(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,u=s+h,o.__=t,o.__b=t.__b+1,l=null,(a=o.__i=Gt(o,n,u,c))!=-1&&(c--,(l=n[a])&&(l.__u|=2)),l==null||l.__v==null?(a==-1&&(r>p?h--:r<p&&h++),typeof o.type!="function"&&(o.__u|=4)):a!=u&&(a==u-1?h--:a==u+1?h++:(a>u?h--:h++,o.__u|=4))):t.__k[s]=null;if(c)for(s=0;s<p;s++)(l=n[s])!=null&&(2&l.__u)==0&&(l.__e==i&&(i=O(l)),tt(l,l));return i}function Ke(t,e,n,i){var r,s;if(typeof t.type=="function"){for(r=t.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=t,e=Ke(r[s],e,n,i));return e}t.__e!=e&&(i&&(e&&t.type&&!e.parentNode&&(e=O(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Gt(t,e,n,i){var r,s,o,l=t.key,u=t.type,a=e[n],p=a!=null&&(2&a.__u)==0;if(a===null&&l==null||p&&l==a.key&&u==a.type)return n;if(i>(p?1:0)){for(r=n-1,s=n+1;r>=0||s<e.length;)if((a=e[o=r>=0?r--:s++])!=null&&(2&a.__u)==0&&l==a.key&&u==a.type)return o}return-1}function Ge(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Nt.test(e)?n:n+"px"}function V(t,e,n,i,r){var s,o;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof i=="string"&&(t.style.cssText=i=""),i)for(e in i)n&&e in n||Ge(t.style,e,"");if(n)for(e in n)i&&n[e]==i[e]||Ge(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(Ve,"$1")),o=e.toLowerCase(),e=o in t||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?i?n[F]=i[F]:(n[F]=ve,t.addEventListener(e,s?be:ke,s)):t.removeEventListener(e,s?be:ke,s);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function Ue(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e[X]==null)e[X]=ve++;else if(e[X]<n[F])return;return n(v.event?v.event(e):e)}}}function ye(t,e,n,i,r,s,o,l,u,a){var p,c,h,d,_,g,w,k,b,m,T,$,R,A,ge,I=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(u=!!(32&n.__u),s=[l=e.__e=n.__e]),(p=v.__b)&&p(e);e:if(typeof I=="function")try{if(k=e.props,b=I.prototype&&I.prototype.render,m=(p=I.contextType)&&i[p.__c],T=p?m?m.props.value:p.__:i,n.__c?w=(c=e.__c=n.__c).__=c.__E:(b?e.__c=c=new I(k,T):(e.__c=c=new K(k,T),c.constructor=I,c.render=Zt),m&&m.sub(c),c.state||(c.state={}),c.__n=i,h=c.__d=!0,c.__h=[],c._sb=[]),b&&c.__s==null&&(c.__s=c.state),b&&I.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=E({},c.__s)),E(c.__s,I.getDerivedStateFromProps(k,c.__s))),d=c.props,_=c.state,c.__v=e,h)b&&I.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),b&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(b&&I.getDerivedStateFromProps==null&&k!==d&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(k,T),e.__v==n.__v||!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(k,c.__s,T)===!1){e.__v!=n.__v&&(c.props=k,c.state=c.__s,c.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(j){j&&(j.__=e)}),ee.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&o.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(k,c.__s,T),b&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(d,_,g)})}if(c.context=T,c.props=k,c.__P=t,c.__e=!1,$=v.__r,R=0,b)c.state=c.__s,c.__d=!1,$&&$(e),p=c.render(c.props,c.state,c.context),ee.push.apply(c.__h,c._sb),c._sb=[];else do c.__d=!1,$&&$(e),p=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++R<25);c.state=c.__s,c.getChildContext!=null&&(i=E(E({},i),c.getChildContext())),b&&!h&&c.getSnapshotBeforeUpdate!=null&&(g=c.getSnapshotBeforeUpdate(d,_)),A=p!=null&&p.type===M&&p.key==null?et(p.props.children):p,l=Je(t,re(A)?A:[A],e,n,i,r,s,o,l,u,a),c.base=e.__e,e.__u&=-161,c.__h.length&&o.push(c),w&&(c.__E=c.__=null)}catch(j){if(e.__v=null,u||s!=null)if(j.then){for(e.__u|=u?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;s[s.indexOf(l)]=null,e.__e=l}else{for(ge=s.length;ge--;)we(s[ge]);xe(e)}else e.__e=n.__e,e.__k=n.__k,j.then||xe(e);v.__e(j,e,n)}else s==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):l=e.__e=Ut(n.__e,e,n,i,r,s,o,u,a);return(p=v.diffed)&&p(e),128&e.__u?void 0:l}function xe(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(xe))}function Ye(t,e,n){for(var i=0;i<n.length;i++)Te(n[i],n[++i],n[++i]);v.__c&&v.__c(e,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(s){s.call(r)})}catch(s){v.__e(s,r.__v)}})}function et(t){return typeof t!="object"||t==null||t.__b>0?t:re(t)?t.map(et):E({},t)}function Ut(t,e,n,i,r,s,o,l,u){var a,p,c,h,d,_,g,w=n.props||Y,k=e.props,b=e.type;if(b=="svg"?r="http://www.w3.org/2000/svg":b=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),s!=null){for(a=0;a<s.length;a++)if((d=s[a])&&"setAttribute"in d==!!b&&(b?d.localName==b:d.nodeType==3)){t=d,s[a]=null;break}}if(t==null){if(b==null)return document.createTextNode(k);t=document.createElementNS(r,b,k.is&&k),l&&(v.__m&&v.__m(e,s),l=!1),s=null}if(b==null)w===k||l&&t.data==k||(t.data=k);else{if(s=s&&ne.call(t.childNodes),!l&&s!=null)for(w={},a=0;a<t.attributes.length;a++)w[(d=t.attributes[a]).name]=d.value;for(a in w)d=w[a],a=="dangerouslySetInnerHTML"?c=d:a=="children"||a in k||a=="value"&&"defaultValue"in k||a=="checked"&&"defaultChecked"in k||V(t,a,null,d,r);for(a in k)d=k[a],a=="children"?h=d:a=="dangerouslySetInnerHTML"?p=d:a=="value"?_=d:a=="checked"?g=d:l&&typeof d!="function"||w[a]===d||V(t,a,d,w[a],r);if(p)l||c&&(p.__html==c.__html||p.__html==t.innerHTML)||(t.innerHTML=p.__html),e.__k=[];else if(c&&(t.innerHTML=""),Je(e.type=="template"?t.content:t,re(h)?h:[h],e,n,i,b=="foreignObject"?"http://www.w3.org/1999/xhtml":r,s,o,s?s[0]:n.__k&&O(n,0),l,u),s!=null)for(a=s.length;a--;)we(s[a]);l||(a="value",b=="progress"&&_==null?t.removeAttribute("value"):_!=null&&(_!==t[a]||b=="progress"&&!_||b=="option"&&_!=w[a])&&V(t,a,_,w[a],r),a="checked",g!=null&&g!=t[a]&&V(t,a,g,w[a],r))}return t}function Te(t,e,n){try{if(typeof t=="function"){var i=typeof t.__u=="function";i&&t.__u(),i&&e==null||(t.__u=t(e))}else t.current=e}catch(r){v.__e(r,n)}}function tt(t,e,n){var i,r;if(v.unmount&&v.unmount(t),(i=t.ref)&&(i.current&&i.current!=t.__e||Te(i,null,e)),(i=t.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(s){v.__e(s,e)}i.base=i.__P=null}if(i=t.__k)for(r=0;r<i.length;r++)i[r]&&tt(i[r],e,n||typeof t.type!="function");n||we(t.__e),t.__c=t.__=t.__e=void 0}function Zt(t,e,n){return this.constructor(t,n)}function nt(t,e,n){var i,r,s,o;e==document&&(e=document.documentElement),v.__&&v.__(t,e),r=(i=typeof n=="function")?null:n&&n.__k||e.__k,s=[],o=[],ye(e,t=(!i&&n||e).__k=jt(M,null,[t]),r||Y,Y,e.namespaceURI,!i&&n?[n]:r?null:e.firstChild?ne.call(e.childNodes):null,s,!i&&n?n:r?r.__e:e.firstChild,i,o),Ye(s,t,o)}ne=ee.slice,v={__e:function(t,e,n,i){for(var r,s,o;e=e.__;)if((r=e.__c)&&!r.__)try{if((s=r.constructor)&&s.getDerivedStateFromError!=null&&(r.setState(s.getDerivedStateFromError(t)),o=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(t,i||{}),o=r.__d),o)return r.__E=r}catch(l){t=l}throw t}},Ze=0,Mt=function(t){return t!=null&&t.constructor===void 0},K.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=E({},this.state),typeof t=="function"&&(t=t(E({},n),this.props)),t&&E(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),Fe(this))},K.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Fe(this))},K.prototype.render=M,D=[],We=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Qe=function(t,e){return t.__v.__b-e.__v.__b},te.__r=0,me=Math.random().toString(8),X="__d"+me,F="__a"+me,Ve=/(PointerCapture)$|Capture$/i,ve=0,ke=Ue(!1),be=Ue(!0),qt=0;var G,S,Se,rt,se=0,pt=[],C=v,it=C.__b,st=C.__r,ot=C.diffed,lt=C.__c,at=C.unmount,ct=C.__;function $e(t,e){C.__h&&C.__h(S,t,se||e),se=0;var n=S.__H||(S.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function P(t){return se=1,Wt(dt,t)}function Wt(t,e,n){var i=$e(G++,2);if(i.t=t,!i.__c&&(i.__=[n?n(e):dt(void 0,e),function(l){var u=i.__N?i.__N[0]:i.__[0],a=i.t(u,l);u!==a&&(i.__N=[a,i.__[1]],i.__c.setState({}))}],i.__c=S,!S.__f)){var r=function(l,u,a){if(!i.__c.__H)return!0;var p=i.__c.__H.__.filter(function(h){return h.__c});if(p.every(function(h){return!h.__N}))return!s||s.call(this,l,u,a);var c=i.__c.props!==l;return p.some(function(h){if(h.__N){var d=h.__[0];h.__=h.__N,h.__N=void 0,d!==h.__[0]&&(c=!0)}}),s&&s.call(this,l,u,a)||c};S.__f=!0;var s=S.shouldComponentUpdate,o=S.componentWillUpdate;S.componentWillUpdate=function(l,u,a){if(this.__e){var p=s;s=void 0,r(l,u,a),s=p}o&&o.call(this,l,u,a)},S.shouldComponentUpdate=r}return i.__N||i.__}function Re(t,e){var n=$e(G++,3);!C.__s&&ft(n.__H,e)&&(n.__=t,n.u=e,S.__H.__h.push(n))}function ht(t){return se=5,Le(function(){return{current:t}},[])}function Le(t,e){var n=$e(G++,7);return ft(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function Qt(){for(var t;t=pt.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(ie),e.__h.some(Ce),e.__h=[]}catch(n){e.__h=[],C.__e(n,t.__v)}}}C.__b=function(t){S=null,it&&it(t)},C.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),ct&&ct(t,e)},C.__r=function(t){st&&st(t),G=0;var e=(S=t.__c).__H;e&&(Se===S?(e.__h=[],S.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(ie),e.__h.some(Ce),e.__h=[],G=0)),Se=S},C.diffed=function(t){ot&&ot(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(pt.push(e)!==1&&rt===C.requestAnimationFrame||((rt=C.requestAnimationFrame)||Vt)(Qt)),e.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Se=S=null},C.__c=function(t,e){e.some(function(n){try{n.__h.some(ie),n.__h=n.__h.filter(function(i){return!i.__||Ce(i)})}catch(i){e.some(function(r){r.__h&&(r.__h=[])}),e=[],C.__e(i,n.__v)}}),lt&&lt(t,e)},C.unmount=function(t){at&&at(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(i){try{ie(i)}catch(r){e=r}}),n.__H=void 0,e&&C.__e(e,n.__v))};var ut=typeof requestAnimationFrame=="function";function Vt(t){var e,n=function(){clearTimeout(i),ut&&cancelAnimationFrame(e),setTimeout(t)},i=setTimeout(n,35);ut&&(e=requestAnimationFrame(n))}function ie(t){var e=S,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),S=e}function Ce(t){var e=S;t.__c=t.__(),S=e}function ft(t,e){return!t||t.length!==e.length||e.some(function(n,i){return n!==t[i]})}function dt(t,e){return typeof e=="function"?e(t):e}var Xt=0;function f(t,e,n,i,r,s){e||(e={});var o,l,u=e;if("ref"in u)for(l in u={},e)l=="ref"?o=e[l]:u[l]=e[l];var a={type:t,props:u,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Xt,__i:-1,__u:0,__source:r,__self:s};if(typeof t=="function"&&(o=t.defaultProps))for(l in o)u[l]===void 0&&(u[l]=o[l]);return v.vnode&&v.vnode(a),a}function _t({doc:t,comments:e,activeSection:n,onNavigate:i}){let r=new Set(e.map(o=>o.sectionId));if(t.mode==="plan"){let o=t.sections.filter(l=>l.level===2);return f("nav",{class:"toc-panel",children:o.map(l=>{let u=t.sections.filter(a=>a.parent===l.id);return f("div",{class:"toc-milestone",children:[f("h3",{children:l.heading}),f("ul",{children:u.map(a=>f("li",{class:`toc-item${n===a.id?" active":""}${r.has(a.id)?" commented":""}`,onClick:()=>i(a.id),children:[f("span",{class:"toc-marker",children:r.has(a.id)?"\u2713":"\xA0"}),f("span",{class:"toc-id",children:a.id}),f("span",{class:"toc-heading",children:a.heading})]},a.id))})]},l.id)})})}let s=t.sections.filter(o=>o.level>=2);return f("nav",{class:"toc-panel",children:f("ul",{children:s.map(o=>f("li",{class:`toc-item${n===o.id?" active":""}${r.has(o.id)?" commented":""}`,onClick:()=>i(o.id),children:[f("span",{class:"toc-marker",children:r.has(o.id)?"\u2713":"\xA0"}),f("span",{class:"toc-heading",children:o.heading})]},o.id))})})}function ze(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var N=ze();function vt(t){N=t}var W={exec:()=>null};function x(t,e=""){let n=typeof t=="string"?t:t.source,i={replace:(r,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(L.caret,"$1"),n=n.replace(r,o),i},getRegex:()=>new RegExp(n,e)};return i}var L={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},Jt=/^(?:[ \t]*(?:\n|$))+/,Kt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Yt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Q=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,en=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ee=/(?:[*+-]|\d{1,9}[.)])/,wt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,yt=x(wt).replace(/bull/g,Ee).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),tn=x(wt).replace(/bull/g,Ee).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Be=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,nn=/^[^\n]+/,He=/(?!\s*\])(?:\\.|[^\[\]\\])+/,rn=x(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",He).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),sn=x(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ee).getRegex(),pe="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",De=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,on=x("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",De).replace("tag",pe).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Tt=x(Be).replace("hr",Q).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pe).getRegex(),ln=x(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Tt).getRegex(),Me={blockquote:ln,code:Kt,def:rn,fences:Yt,heading:en,hr:Q,html:on,lheading:yt,list:sn,newline:Jt,paragraph:Tt,table:W,text:nn},gt=x("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Q).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pe).getRegex(),an={...Me,lheading:tn,table:gt,paragraph:x(Be).replace("hr",Q).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",gt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pe).getRegex()},cn={...Me,html:x(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",De).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:W,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:x(Be).replace("hr",Q).replace("heading",` *#{1,6} *[^
357
+ ]`).replace("lheading",yt).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},un=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,pn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,St=/^( {2,}|\\)\n(?!\s*$)/,hn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,he=/[\p{P}\p{S}]/u,qe=/[\s\p{P}\p{S}]/u,Ct=/[^\s\p{P}\p{S}]/u,fn=x(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,qe).getRegex(),$t=/(?!~)[\p{P}\p{S}]/u,dn=/(?!~)[\s\p{P}\p{S}]/u,_n=/(?:[^\s\p{P}\p{S}]|~)/u,gn=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Rt=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,mn=x(Rt,"u").replace(/punct/g,he).getRegex(),kn=x(Rt,"u").replace(/punct/g,$t).getRegex(),Lt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",bn=x(Lt,"gu").replace(/notPunctSpace/g,Ct).replace(/punctSpace/g,qe).replace(/punct/g,he).getRegex(),xn=x(Lt,"gu").replace(/notPunctSpace/g,_n).replace(/punctSpace/g,dn).replace(/punct/g,$t).getRegex(),vn=x("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ct).replace(/punctSpace/g,qe).replace(/punct/g,he).getRegex(),wn=x(/\\(punct)/,"gu").replace(/punct/g,he).getRegex(),yn=x(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[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])?)+(?![-_])/).getRegex(),Tn=x(De).replace("(?:-->|$)","-->").getRegex(),Sn=x("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Tn).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ae=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Cn=x(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ae).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),At=x(/^!?\[(label)\]\[(ref)\]/).replace("label",ae).replace("ref",He).getRegex(),Pt=x(/^!?\[(ref)\](?:\[\])?/).replace("ref",He).getRegex(),$n=x("reflink|nolink(?!\\()","g").replace("reflink",At).replace("nolink",Pt).getRegex(),Ne={_backpedal:W,anyPunctuation:wn,autolink:yn,blockSkip:gn,br:St,code:pn,del:W,emStrongLDelim:mn,emStrongRDelimAst:bn,emStrongRDelimUnd:vn,escape:un,link:Cn,nolink:Pt,punctuation:fn,reflink:At,reflinkSearch:$n,tag:Sn,text:hn,url:W},Rn={...Ne,link:x(/^!?\[(label)\]\((.*?)\)/).replace("label",ae).getRegex(),reflink:x(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ae).getRegex()},Ae={...Ne,emStrongRDelimAst:xn,emStrongLDelim:kn,url:x(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Ln={...Ae,br:x(St).replace("{2,}","*").getRegex(),text:x(Ae.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},oe={normal:Me,gfm:an,pedantic:cn},U={normal:Ne,gfm:Ae,breaks:Ln,pedantic:Rn},An={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},mt=t=>An[t];function z(t,e){if(e){if(L.escapeTest.test(t))return t.replace(L.escapeReplace,mt)}else if(L.escapeTestNoEncode.test(t))return t.replace(L.escapeReplaceNoEncode,mt);return t}function kt(t){try{t=encodeURI(t).replace(L.percentDecode,"%")}catch{return null}return t}function bt(t,e){let n=t.replace(L.findPipe,(s,o,l)=>{let u=!1,a=o;for(;--a>=0&&l[a]==="\\";)u=!u;return u?"|":" |"}),i=n.split(L.splitPipe),r=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(L.slashPipe,"|");return i}function Z(t,e,n){let i=t.length;if(i===0)return"";let r=0;for(;r<i;){let s=t.charAt(i-r-1);if(s===e&&!n)r++;else if(s!==e&&n)r++;else break}return t.slice(0,i-r)}function Pn(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let i=0;i<t.length;i++)if(t[i]==="\\")i++;else if(t[i]===e[0])n++;else if(t[i]===e[1]&&(n--,n<0))return i;return n>0?-2:-1}function xt(t,e,n,i,r){let s=e.href,o=e.title||null,l=t[1].replace(r.other.outputLinkReplace,"$1");i.state.inLink=!0;let u={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:o,text:l,tokens:i.inlineTokens(l)};return i.state.inLink=!1,u}function In(t,e,n){let i=t.match(n.other.indentCodeCompensation);if(i===null)return e;let r=i[1];return e.split(`
358
+ `).map(s=>{let o=s.match(n.other.beginningSpace);if(o===null)return s;let[l]=o;return l.length>=r.length?s.slice(r.length):s}).join(`
359
+ `)}var ce=class{options;rules;lexer;constructor(t){this.options=t||N}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Z(n,`
360
+ `)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],i=In(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:i}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let i=Z(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Z(e[0],`
361
+ `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=Z(e[0],`
362
+ `).split(`
363
+ `),i="",r="",s=[];for(;n.length>0;){let o=!1,l=[],u;for(u=0;u<n.length;u++)if(this.rules.other.blockquoteStart.test(n[u]))l.push(n[u]),o=!0;else if(!o)l.push(n[u]);else break;n=n.slice(u);let a=l.join(`
364
+ `),p=a.replace(this.rules.other.blockquoteSetextReplace,`
365
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
366
+ ${a}`:a,r=r?`${r}
367
+ ${p}`:p;let c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,s,!0),this.lexer.state.top=c,n.length===0)break;let h=s.at(-1);if(h?.type==="code")break;if(h?.type==="blockquote"){let d=h,_=d.raw+`
368
+ `+n.join(`
369
+ `),g=this.blockquote(_);s[s.length-1]=g,i=i.substring(0,i.length-d.raw.length)+g.raw,r=r.substring(0,r.length-d.text.length)+g.text;break}else if(h?.type==="list"){let d=h,_=d.raw+`
370
+ `+n.join(`
371
+ `),g=this.list(_);s[s.length-1]=g,i=i.substring(0,i.length-h.raw.length)+g.raw,r=r.substring(0,r.length-d.raw.length)+g.raw,n=_.substring(s.at(-1).raw.length).split(`
372
+ `);continue}}return{type:"blockquote",raw:i,tokens:s,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),i=n.length>1,r={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let s=this.rules.other.listItemRegex(n),o=!1;for(;t;){let u=!1,a="",p="";if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;a=e[0],t=t.substring(a.length);let c=e[2].split(`
373
+ `,1)[0].replace(this.rules.other.listReplaceTabs,k=>" ".repeat(3*k.length)),h=t.split(`
374
+ `,1)[0],d=!c.trim(),_=0;if(this.options.pedantic?(_=2,p=c.trimStart()):d?_=e[1].length+1:(_=e[2].search(this.rules.other.nonSpaceChar),_=_>4?1:_,p=c.slice(_),_+=e[1].length),d&&this.rules.other.blankLine.test(h)&&(a+=h+`
375
+ `,t=t.substring(h.length+1),u=!0),!u){let k=this.rules.other.nextBulletRegex(_),b=this.rules.other.hrRegex(_),m=this.rules.other.fencesBeginRegex(_),T=this.rules.other.headingBeginRegex(_),$=this.rules.other.htmlBeginRegex(_);for(;t;){let R=t.split(`
376
+ `,1)[0],A;if(h=R,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),A=h):A=h.replace(this.rules.other.tabCharGlobal," "),m.test(h)||T.test(h)||$.test(h)||k.test(h)||b.test(h))break;if(A.search(this.rules.other.nonSpaceChar)>=_||!h.trim())p+=`
377
+ `+A.slice(_);else{if(d||c.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||m.test(c)||T.test(c)||b.test(c))break;p+=`
378
+ `+h}!d&&!h.trim()&&(d=!0),a+=R+`
379
+ `,t=t.substring(R.length+1),c=A.slice(_)}}r.loose||(o?r.loose=!0:this.rules.other.doubleBlankLine.test(a)&&(o=!0));let g=null,w;this.options.gfm&&(g=this.rules.other.listIsTask.exec(p),g&&(w=g[0]!=="[ ] ",p=p.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:a,task:!!g,checked:w,loose:!1,text:p,tokens:[]}),r.raw+=a}let l=r.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let u=0;u<r.items.length;u++)if(this.lexer.state.top=!1,r.items[u].tokens=this.lexer.blockTokens(r.items[u].text,[]),!r.loose){let a=r.items[u].tokens.filter(c=>c.type==="space"),p=a.length>0&&a.some(c=>this.rules.other.anyLine.test(c.raw));r.loose=p}if(r.loose)for(let u=0;u<r.items.length;u++)r.items[u].loose=!0;return r}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:i,title:r}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=bt(e[1]),i=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
380
+ `):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let o of i)this.rules.other.tableAlignRight.test(o)?s.align.push("right"):this.rules.other.tableAlignCenter.test(o)?s.align.push("center"):this.rules.other.tableAlignLeft.test(o)?s.align.push("left"):s.align.push(null);for(let o=0;o<n.length;o++)s.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:s.align[o]});for(let o of r)s.rows.push(bt(o,s.header.length).map((l,u)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:s.align[u]})));return s}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
381
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=Z(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=Pn(e[2],"()");if(s===-2)return;if(s>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let i=e[2],r="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],r=s[3])}else r=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),xt(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[i.toLowerCase()];if(!r){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return xt(n,r,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let s=[...i[0]].length-1,o,l,u=s,a=0,p=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*t.length+s);(i=p.exec(e))!=null;){if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!o)continue;if(l=[...o].length,i[3]||i[4]){u+=l;continue}else if((i[5]||i[6])&&s%3&&!((s+l)%3)){a+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+a);let c=[...i[0]][0].length,h=t.slice(0,s+i.index+c+l);if(Math.min(s,l)%2){let _=h.slice(1,-1);return{type:"em",raw:h,text:_,tokens:this.lexer.inlineTokens(_)}}let d=h.slice(2,-2);return{type:"strong",raw:h,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,i;return e[2]==="@"?(n=e[1],i="mailto:"+n):(n=e[1],i=n),{type:"link",raw:e[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,i;if(e[2]==="@")n=e[0],i="mailto:"+n;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);n=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},B=class Pe{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||N,this.options.tokenizer=this.options.tokenizer||new ce,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:L,block:oe.normal,inline:U.normal};this.options.pedantic?(n.block=oe.pedantic,n.inline=U.pedantic):this.options.gfm&&(n.block=oe.gfm,this.options.breaks?n.inline=U.breaks:n.inline=U.gfm),this.tokenizer.rules=n}static get rules(){return{block:oe,inline:U}}static lex(e,n){return new Pe(n).lex(e)}static lexInline(e,n){return new Pe(n).inlineTokens(e)}lex(e){e=e.replace(L.carriageReturn,`
382
+ `),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let i=this.inlineQueue[n];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],i=!1){for(this.options.pedantic&&(e=e.replace(L.tabCharGlobal," ").replace(L.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(o=>(r=o.call({lexer:this},e,n))?(e=e.substring(r.raw.length),n.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let o=n.at(-1);r.raw.length===1&&o!==void 0?o.raw+=`
383
+ `:n.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
384
+ `+r.raw,o.text+=`
385
+ `+r.text,this.inlineQueue.at(-1).src=o.text):n.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
386
+ `+r.raw,o.text+=`
387
+ `+r.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),n.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),n.push(r);continue}let s=e;if(this.options.extensions?.startBlock){let o=1/0,l=e.slice(1),u;this.options.extensions.startBlock.forEach(a=>{u=a.call({lexer:this},l),typeof u=="number"&&u>=0&&(o=Math.min(o,u))}),o<1/0&&o>=0&&(s=e.substring(0,o+1))}if(this.state.top&&(r=this.tokenizer.paragraph(s))){let o=n.at(-1);i&&o?.type==="paragraph"?(o.raw+=`
388
+ `+r.raw,o.text+=`
389
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(r),i=s.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let o=n.at(-1);o?.type==="text"?(o.raw+=`
390
+ `+r.raw,o.text+=`
391
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(r);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let i=e,r=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)l.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,r.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,o="";for(;e;){s||(o=""),s=!1;let l;if(this.options.extensions?.inline?.some(a=>(l=a.call({lexer:this},e,n))?(e=e.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let a=n.at(-1);l.type==="text"&&a?.type==="text"?(a.raw+=l.raw,a.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(e,i,o)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.del(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),n.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),n.push(l);continue}let u=e;if(this.options.extensions?.startInline){let a=1/0,p=e.slice(1),c;this.options.extensions.startInline.forEach(h=>{c=h.call({lexer:this},p),typeof c=="number"&&c>=0&&(a=Math.min(a,c))}),a<1/0&&a>=0&&(u=e.substring(0,a+1))}if(l=this.tokenizer.inlineText(u)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(o=l.raw.slice(-1)),s=!0;let a=n.at(-1);a?.type==="text"?(a.raw+=l.raw,a.text+=l.text):n.push(l);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return n}},ue=class{options;parser;constructor(t){this.options=t||N}space(t){return""}code({text:t,lang:e,escaped:n}){let i=(e||"").match(L.notSpaceStart)?.[0],r=t.replace(L.endingNewline,"")+`
392
+ `;return i?'<pre><code class="language-'+z(i)+'">'+(n?r:z(r,!0))+`</code></pre>
393
+ `:"<pre><code>"+(n?r:z(r,!0))+`</code></pre>
394
+ `}blockquote({tokens:t}){return`<blockquote>
395
+ ${this.parser.parse(t)}</blockquote>
396
+ `}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
397
+ `}hr(t){return`<hr>
398
+ `}list(t){let e=t.ordered,n=t.start,i="";for(let o=0;o<t.items.length;o++){let l=t.items[o];i+=this.listitem(l)}let r=e?"ol":"ul",s=e&&n!==1?' start="'+n+'"':"";return"<"+r+s+`>
399
+ `+i+"</"+r+`>
400
+ `}listitem(t){let e="";if(t.task){let n=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=n+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=n+" "+z(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):e+=n+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>
401
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
402
+ `}table(t){let e="",n="";for(let r=0;r<t.header.length;r++)n+=this.tablecell(t.header[r]);e+=this.tablerow({text:n});let i="";for(let r=0;r<t.rows.length;r++){let s=t.rows[r];n="";for(let o=0;o<s.length;o++)n+=this.tablecell(s[o]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
403
+ <thead>
404
+ `+e+`</thead>
405
+ `+i+`</table>
406
+ `}tablerow({text:t}){return`<tr>
407
+ ${t}</tr>
408
+ `}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
409
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${z(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let i=this.parser.parseInline(n),r=kt(t);if(r===null)return i;t=r;let s='<a href="'+t+'"';return e&&(s+=' title="'+z(e)+'"'),s+=">"+i+"</a>",s}image({href:t,title:e,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let r=kt(t);if(r===null)return z(n);t=r;let s=`<img src="${t}" alt="${n}"`;return e&&(s+=` title="${z(e)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:z(t.text)}},je=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},H=class Ie{options;renderer;textRenderer;constructor(e){this.options=e||N,this.options.renderer=this.options.renderer||new ue,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new je}static parse(e,n){return new Ie(n).parse(e)}static parseInline(e,n){return new Ie(n).parseInline(e)}parse(e,n=!0){let i="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let l=s,u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(l.type)){i+=u||"";continue}}let o=s;switch(o.type){case"space":{i+=this.renderer.space(o);continue}case"hr":{i+=this.renderer.hr(o);continue}case"heading":{i+=this.renderer.heading(o);continue}case"code":{i+=this.renderer.code(o);continue}case"table":{i+=this.renderer.table(o);continue}case"blockquote":{i+=this.renderer.blockquote(o);continue}case"list":{i+=this.renderer.list(o);continue}case"html":{i+=this.renderer.html(o);continue}case"paragraph":{i+=this.renderer.paragraph(o);continue}case"text":{let l=o,u=this.renderer.text(l);for(;r+1<e.length&&e[r+1].type==="text";)l=e[++r],u+=`
410
+ `+this.renderer.text(l);n?i+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):i+=u;continue}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}parseInline(e,n=this.renderer){let i="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let l=this.options.extensions.renderers[s.type].call({parser:this},s);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){i+=l||"";continue}}let o=s;switch(o.type){case"escape":{i+=n.text(o);break}case"html":{i+=n.html(o);break}case"link":{i+=n.link(o);break}case"image":{i+=n.image(o);break}case"strong":{i+=n.strong(o);break}case"em":{i+=n.em(o);break}case"codespan":{i+=n.codespan(o);break}case"br":{i+=n.br(o);break}case"del":{i+=n.del(o);break}case"text":{i+=n.text(o);break}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return i}},le=class{options;block;constructor(t){this.options=t||N}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?B.lex:B.lexInline}provideParser(){return this.block?H.parse:H.parseInline}},fe=class{defaults=ze();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=H;Renderer=ue;TextRenderer=je;Lexer=B;Tokenizer=ce;Hooks=le;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let i of t)switch(n=n.concat(e.call(this,i)),i.type){case"table":{let r=i;for(let s of r.header)n=n.concat(this.walkTokens(s.tokens,e));for(let s of r.rows)for(let o of s)n=n.concat(this.walkTokens(o.tokens,e));break}case"list":{let r=i;n=n.concat(this.walkTokens(r.items,e));break}default:{let r=i;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(s=>{let o=r[s].flat(1/0);n=n.concat(this.walkTokens(o,e))}):r.tokens&&(n=n.concat(this.walkTokens(r.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let s=e.renderers[r.name];s?e.renderers[r.name]=function(...o){let l=r.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=e[r.level];s?s.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),i.extensions=e),n.renderer){let r=this.defaults.renderer||new ue(this.defaults);for(let s in n.renderer){if(!(s in r))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,l=n.renderer[o],u=r[o];r[o]=(...a)=>{let p=l.apply(r,a);return p===!1&&(p=u.apply(r,a)),p||""}}i.renderer=r}if(n.tokenizer){let r=this.defaults.tokenizer||new ce(this.defaults);for(let s in n.tokenizer){if(!(s in r))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,l=n.tokenizer[o],u=r[o];r[o]=(...a)=>{let p=l.apply(r,a);return p===!1&&(p=u.apply(r,a)),p}}i.tokenizer=r}if(n.hooks){let r=this.defaults.hooks||new le;for(let s in n.hooks){if(!(s in r))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,l=n.hooks[o],u=r[o];le.passThroughHooks.has(s)?r[o]=a=>{if(this.defaults.async)return Promise.resolve(l.call(r,a)).then(c=>u.call(r,c));let p=l.call(r,a);return u.call(r,p)}:r[o]=(...a)=>{let p=l.apply(r,a);return p===!1&&(p=u.apply(r,a)),p}}i.hooks=r}if(n.walkTokens){let r=this.defaults.walkTokens,s=n.walkTokens;i.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),r&&(l=l.concat(r.call(this,o))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return B.lex(t,e??this.defaults)}parser(t,e){return H.parse(t,e??this.defaults)}parseMarkdown(t){return(n,i)=>{let r={...i},s={...this.defaults,...r},o=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));s.hooks&&(s.hooks.options=s,s.hooks.block=t);let l=s.hooks?s.hooks.provideLexer():t?B.lex:B.lexInline,u=s.hooks?s.hooks.provideParser():t?H.parse:H.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then(a=>l(a,s)).then(a=>s.hooks?s.hooks.processAllTokens(a):a).then(a=>s.walkTokens?Promise.all(this.walkTokens(a,s.walkTokens)).then(()=>a):a).then(a=>u(a,s)).then(a=>s.hooks?s.hooks.postprocess(a):a).catch(o);try{s.hooks&&(n=s.hooks.preprocess(n));let a=l(n,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let p=u(a,s);return s.hooks&&(p=s.hooks.postprocess(p)),p}catch(a){return o(a)}}}onError(t,e){return n=>{if(n.message+=`
411
+ Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+z(n.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(n);throw n}}},q=new fe;function y(t,e){return q.parse(t,e)}y.options=y.setOptions=function(t){return q.setOptions(t),y.defaults=q.defaults,vt(y.defaults),y};y.getDefaults=ze;y.defaults=N;y.use=function(...t){return q.use(...t),y.defaults=q.defaults,vt(y.defaults),y};y.walkTokens=function(t,e){return q.walkTokens(t,e)};y.parseInline=q.parseInline;y.Parser=H;y.parser=H.parse;y.Renderer=ue;y.TextRenderer=je;y.Lexer=B;y.lexer=B.lex;y.Tokenizer=ce;y.Hooks=le;y.parse=y;var Gn=y.options,Un=y.setOptions,Zn=y.use,Wn=y.walkTokens,Qn=y.parseInline;var Vn=H.parse,Xn=B.lex;function de(t){let e=document.createElement("div");return e.innerHTML=t,(e.textContent??"").replace(/\s+/g," ").trim()}var zn=new fe;function It(t){let e=[],n=0,i=new fe;return i.use({renderer:{paragraph(r){let o=`<p>${this.parser.parseInline(r.tokens)}</p>`;return e.push({index:n++,innerHtml:o,text:de(o)}),""},list(r){let s=r.ordered?"ol":"ul",o=r.ordered?"list-style:decimal":"list-style:disc";for(let l of r.items){let a=`<li>${this.parser.parse(l.tokens,!!l.loose).trimEnd()}</li>`,p=`<${s} style="${o};padding-left:1.5em">${a}</${s}>`;e.push({index:n++,innerHtml:p,text:de(a)})}return""},code(r){let s=r.lang??"",o=r.text.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),l=s?`<pre><code class="language-${s}">${o}</code></pre>`:`<pre><code>${o}</code></pre>`;return e.push({index:n++,innerHtml:l,text:r.text.trim()}),""},blockquote(r){let o=`<blockquote>${zn.parser(r.tokens)}</blockquote>`.trimEnd();return e.push({index:n++,innerHtml:o,text:de(o)}),""},heading(r){let s=this.parser.parseInline(r.tokens),o=`<h${r.depth}>${s}</h${r.depth}>`;return e.push({index:n++,innerHtml:o,text:de(o)}),""},table(r){let o=`<thead><tr>${r.header.map(d=>{let _=d.align?` align="${d.align}"`:"",g=this.parser.parseInline(d.tokens);return`<th${_}>${g}</th>`}).join("")}</tr></thead>`,u=`<tbody>${r.rows.map(d=>`<tr>${d.map(g=>{let w=g.align?` align="${g.align}"`:"",k=this.parser.parseInline(g.tokens);return`<td${w}>${k}</td>`}).join("")}</tr>`).join("")}</tbody>`,a=`<table>${o}${u}</table>`,p=r.header.map(d=>d.text).join(" | "),c=r.rows.map(d=>d.map(_=>_.text).join(" | ")),h=[p,...c].join(`
412
+ `);return e.push({index:n++,innerHtml:a,text:h}),""}}}),i.parse(t),e}function En(t,e,n,i){return i&&!t?"\u25C6":e?"\u25B6":n?"\u25C0":t?"\u2014":"+"}function zt({block:t,isInRange:e,isRangeStart:n,isRangeEnd:i,hasComment:r,isPendingComment:s,isHovered:o,onGutterClick:l,onMouseEnter:u,onMouseLeave:a}){let p=["line-block",o&&!e?"hovered":"",e?"in-range":"",r&&!e?"has-comment":"",s&&!e&&!r?"pending-comment":""].filter(Boolean).join(" ");return f("div",{class:p,onMouseEnter:()=>u(t.index),onMouseLeave:()=>a(),children:[f("div",{class:"line-gutter",onClick:c=>l(t.index,c.shiftKey),title:e?void 0:"Click to start selection",children:En(e,n,i,r)}),f("div",{class:"line-inner",dangerouslySetInnerHTML:{__html:t.innerHtml}})]})}function Et({section:t,mode:e,isActive:n,pendingAnchor:i,commentedLines:r,onLineComment:s,onSectionComment:o}){let l=e==="plan"?t.level===3:t.level>=2,u=e==="plan"&&t.level===3&&t.dependencies,a=Le(()=>It(t.body),[t.body]),[p,c]=P(null),[h,d]=P(null),_=(g,w)=>{if(h===null||!w)d(g);else{let k=Math.min(h,g),b=Math.max(h,g),m=a.slice(k,b+1).map(T=>T.text);s(t.id,k,b,m),d(null)}};return f("div",{id:`section-${t.id}`,class:`section-view${n?" active":""}${i===null?" being-commented":""}`,children:[f("h2",{children:t.heading}),u&&f("div",{class:"section-meta",children:[t.dependencies.dependsOn.length>0&&f("span",{children:["Depends on: ",t.dependencies.dependsOn.join(", ")]}),t.dependencies.blocks.length>0&&f("span",{children:["Blocks: ",t.dependencies.blocks.join(", ")]}),t.relatedFiles&&t.relatedFiles.length>0&&f("span",{children:["Files: ",t.relatedFiles.join(", ")]}),t.verification&&f("span",{children:["Verify: ",t.verification]})]}),h!==null&&f("div",{class:"range-start-hint",children:"Shift-click another line to select a range, or shift-click the same line to comment on it alone."}),f("div",{class:"section-body",children:a.map(g=>{let w=h!==null&&p!==null&&g.index>=Math.min(h,p)&&g.index<=Math.max(h,p),k=h!==null&&p!==null&&g.index===Math.min(h,p),b=h!==null&&p!==null&&g.index===Math.max(h,p),m=i!=null&&g.index>=i.startLine&&g.index<=i.endLine;return f(zt,{block:g,isInRange:w,isRangeStart:k,isRangeEnd:b,hasComment:r.has(g.index),isPendingComment:m,isHovered:p===g.index,onGutterClick:_,onMouseEnter:c,onMouseLeave:()=>c(null)},g.index)})}),l&&f("span",{class:"add-section-comment-link",onClick:()=>o(t.id),children:"Add comment to entire section"})]})}function _e({sectionId:t,anchor:e,onSubmit:n,onCancel:i,initialText:r=""}){let[s,o]=P(r),l=()=>{let a=s.trim();a&&(n(t,a,e),o(""))},u=e?e.startLine===e.endLine?`Commenting on line ${e.startLine+1}:`:`Commenting on lines ${e.startLine+1}\u2013${e.endLine+1}:`:"Commenting on entire section:";return f("div",{class:"comment-input",children:[f("div",{class:e?"comment-anchor-label":"comment-section-label",children:u}),e&&f("div",{class:"comment-anchor-quote",children:e.lineTexts.map((a,p)=>f("p",{children:a},p))}),f("textarea",{placeholder:"Add a comment...",value:s,onInput:a=>o(a.target.value)}),f("div",{class:"comment-input-actions",children:[f("button",{class:"add-btn",onClick:l,children:"Add"}),f("button",{class:"cancel-btn",onClick:i,children:"Cancel"})]})]})}function Bt({comment:t,onEdit:e,onDelete:n}){let[i,r]=P(!1);if(i)return f(_e,{sectionId:t.sectionId,anchor:t.anchor,initialText:t.text,onSubmit:(o,l)=>{e(l),r(!1)},onCancel:()=>r(!1)});let s=t.anchor?t.anchor.startLine===t.anchor.endLine?`Line ${t.anchor.startLine+1}`:`Lines ${t.anchor.startLine+1}\u2013${t.anchor.endLine+1}`:null;return f("div",{class:"comment-card",children:[s?f(M,{children:[f("div",{class:"comment-anchor-label",children:s}),f("div",{class:"comment-anchor-quote",children:t.anchor.lineTexts.map((o,l)=>f("p",{children:o},l))})]}):f("div",{class:"comment-section-label",children:"Entire section"}),f("div",{class:"comment-text",children:t.text}),f("div",{class:"comment-actions",children:[f("button",{onClick:()=>r(!0),children:"Edit"}),f("button",{class:"delete",onClick:n,children:"Delete"})]})]})}function Bn(t){return[...t].sort((e,n)=>{let i=e.comment.anchor?.startLine??1/0,r=n.comment.anchor?.startLine??1/0;return i-r})}function Ht({comments:t,sections:e,commentingTarget:n,onAdd:i,onEdit:r,onDelete:s,onCancelComment:o}){let l=a=>e.find(p=>p.id===a)?.heading??a,u=new Map;return t.forEach((a,p)=>{let c=u.get(a.sectionId)??[];c.push({comment:a,index:p}),u.set(a.sectionId,c)}),f("aside",{class:"comment-sidebar",children:[f("h2",{children:["Comments (",t.length,")"]}),n&&f("div",{class:"commenting-for",children:[f("h3",{children:l(n.sectionId)}),f(_e,{sectionId:n.sectionId,anchor:n.anchor,onSubmit:i,onCancel:o})]}),Array.from(u.entries()).map(([a,p])=>f("div",{class:"comment-group",children:[f("h3",{children:l(a)}),Bn(p).map(({comment:c,index:h})=>f(Bt,{comment:c,onEdit:d=>r(h,d),onDelete:()=>s(h)},h))]},a)),t.length===0&&!n&&f("p",{class:"no-comments",children:"No comments yet. Hover a line and click + to start."})]})}function Dt(){let[t,e]=P(null),[n,i]=P([]),[r,s]=P(null),[o,l]=P(null),[u,a]=P(!1),[p,c]=P(null),h=ht(!1);Re(()=>{if(!h.current&&(h.current=n.length>0||t!==null,!h.current))return;let m=setTimeout(()=>{fetch("/api/session",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({comments:n,activeSection:r})}).catch(()=>{})},500);return()=>clearTimeout(m)},[n,r]),Re(()=>{fetch("/api/doc").then(m=>m.json()).then(m=>e(m.document)).catch(m=>c(m.message))},[]);let d=m=>{s(m),document.getElementById(`section-${m}`)?.scrollIntoView({behavior:"smooth"})},_=(m,T,$)=>{i(R=>[...R,{sectionId:m,text:T,timestamp:new Date,anchor:$}]),l(null)},g=(m,T)=>{i($=>$.map((R,A)=>A===m?{...R,text:T}:R))},w=m=>{i(T=>T.filter(($,R)=>R!==m))},k=async()=>{try{(await fetch("/api/review",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({comments:n})})).ok&&a(!0)}catch{c("Failed to submit review")}},b=new Map;for(let m of n)if(m.anchor){let T=b.get(m.sectionId)??new Set;for(let $=m.anchor.startLine;$<=m.anchor.endLine;$++)T.add($);b.set(m.sectionId,T)}return u?f("div",{class:"submitted",children:"Review submitted. You can close this tab."}):p?f("div",{class:"loading",children:["Error: ",p]}):t?f("div",{class:"app",children:[f("header",{class:"top-bar",children:[f("h1",{children:t.title}),f("span",{class:"mode-badge",children:t.mode}),f("span",{class:"comment-count",children:[n.length," comment",n.length!==1?"s":""]}),f("button",{class:"submit-btn",onClick:k,disabled:n.length===0,children:"Submit Review"})]}),f("div",{class:"panels",children:[f(_t,{doc:t,comments:n,activeSection:r,onNavigate:d}),f("main",{class:"content-area",children:t.sections.map(m=>f(Et,{section:m,mode:t.mode,isActive:r===m.id,pendingAnchor:o?.sectionId===m.id?o.anchor??null:void 0,commentedLines:b.get(m.id)??new Set,onLineComment:(T,$,R,A)=>l({sectionId:T,anchor:{type:"lines",startLine:$,endLine:R,lineTexts:A}}),onSectionComment:T=>l({sectionId:T})},m.id))}),f(Ht,{comments:n,sections:t.sections,commentingTarget:o,onAdd:_,onEdit:g,onDelete:w,onCancelComment:()=>l(null)})]})]}):f("div",{class:"loading",children:"Loading..."})}nt(f(Dt,{}),document.getElementById("app"));})();
413
+ </script>
414
+ </body>
415
+ </html>
package/dist/formatter.js CHANGED
@@ -1,3 +1,13 @@
1
+ function escapeMarkdown(text) {
2
+ return text.replace(/([\\*_`~\[\]#>|])/g, '\\$1');
3
+ }
4
+ function sortComments(comments) {
5
+ return [...comments].sort((a, b) => {
6
+ const aLine = a.anchor?.startLine ?? Infinity;
7
+ const bLine = b.anchor?.startLine ?? Infinity;
8
+ return aLine - bLine;
9
+ });
10
+ }
1
11
  export function formatReview(doc) {
2
12
  const commentedSectionIds = new Set(doc.comments.map((c) => c.sectionId));
3
13
  const reviewableSections = doc.sections.filter((s) => doc.mode === 'plan' ? s.level === 3 : s.level >= 2);
@@ -12,7 +22,7 @@ export function formatReview(doc) {
12
22
  parts.push('');
13
23
  parts.push('---');
14
24
  for (const section of commentedSections) {
15
- const sectionComments = doc.comments.filter((c) => c.sectionId === section.id);
25
+ const sectionComments = sortComments(doc.comments.filter((c) => c.sectionId === section.id));
16
26
  parts.push('');
17
27
  parts.push(`## Section ${section.id}: ${section.heading}`);
18
28
  parts.push('');
@@ -26,19 +36,24 @@ export function formatReview(doc) {
26
36
  }
27
37
  parts.push('');
28
38
  }
29
- parts.push('### Original Content');
30
- const blockquoted = section.body
31
- .split('\n')
32
- .map((line) => `> ${line}`)
33
- .join('\n');
34
- parts.push(blockquoted);
35
- parts.push('');
36
39
  for (const comment of sectionComments) {
37
- parts.push('### Reviewer Comment');
38
- parts.push(comment.text);
40
+ if (comment.anchor) {
41
+ parts.push('### Reviewer Comment');
42
+ parts.push('');
43
+ for (const line of comment.anchor.lineTexts) {
44
+ parts.push(`> ${line}`);
45
+ }
46
+ parts.push('');
47
+ parts.push(escapeMarkdown(comment.text));
48
+ }
49
+ else {
50
+ parts.push('### Reviewer Comment (entire section)');
51
+ parts.push('');
52
+ parts.push(escapeMarkdown(comment.text));
53
+ }
39
54
  parts.push('');
55
+ parts.push('---');
40
56
  }
41
- parts.push('---');
42
57
  }
43
58
  return parts.join('\n');
44
59
  }
@@ -1 +1 @@
1
- {"version":3,"file":"formatter.js","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,YAAY,CAAC,GAAiB;IAC5C,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC1E,MAAM,kBAAkB,GAAG,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CACnD,GAAG,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CACnD,CAAC;IACF,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAE1F,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,CAAC,IAAI,CAAC,kBAAkB,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;IAC1C,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAChC,KAAK,CAAC,IAAI,CAAC,4BAA4B,iBAAiB,CAAC,MAAM,IAAI,kBAAkB,CAAC,MAAM,EAAE,CAAC,CAAC;IAChG,KAAK,CAAC,IAAI,CAAC,mBAAmB,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACrD,KAAK,CAAC,IAAI,CACR,kBAAkB,kBAAkB,CAAC,MAAM,GAAG,iBAAiB,CAAC,MAAM,4BAA4B,CACnG,CAAC;IACF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAElB,KAAK,MAAM,OAAO,IAAI,iBAAiB,EAAE,CAAC;QACxC,MAAM,eAAe,GAAG,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,OAAO,CAAC,EAAE,CAAC,CAAC;QAE/E,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,cAAc,OAAO,CAAC,EAAE,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;QAC3D,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAEf,IAAI,GAAG,CAAC,IAAI,KAAK,MAAM,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;YAChD,MAAM,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC;YAClC,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC9B,KAAK,CAAC,IAAI,CAAC,eAAe,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACzD,CAAC;YACD,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC3B,KAAK,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAClD,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACnC,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI;aAC7B,KAAK,CAAC,IAAI,CAAC;aACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC;aAC1B,IAAI,CAAC,IAAI,CAAC,CAAC;QACd,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACxB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAEf,KAAK,MAAM,OAAO,IAAI,eAAe,EAAE,CAAC;YACtC,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;YACnC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACzB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
1
+ {"version":3,"file":"formatter.js","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"AAEA,SAAS,cAAc,CAAC,IAAY;IAClC,OAAO,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,YAAY,CAAC,QAAyB;IAC7C,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACjC,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,EAAE,SAAS,IAAI,QAAQ,CAAC;QAC9C,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,EAAE,SAAS,IAAI,QAAQ,CAAC;QAC9C,OAAO,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,GAAiB;IAC5C,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC1E,MAAM,kBAAkB,GAAG,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CACnD,GAAG,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CACnD,CAAC;IACF,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAE1F,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,CAAC,IAAI,CAAC,kBAAkB,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;IAC1C,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAChC,KAAK,CAAC,IAAI,CAAC,4BAA4B,iBAAiB,CAAC,MAAM,IAAI,kBAAkB,CAAC,MAAM,EAAE,CAAC,CAAC;IAChG,KAAK,CAAC,IAAI,CAAC,mBAAmB,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACrD,KAAK,CAAC,IAAI,CACR,kBAAkB,kBAAkB,CAAC,MAAM,GAAG,iBAAiB,CAAC,MAAM,4BAA4B,CACnG,CAAC;IACF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAElB,KAAK,MAAM,OAAO,IAAI,iBAAiB,EAAE,CAAC;QACxC,MAAM,eAAe,GAAG,YAAY,CAClC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,KAAK,OAAO,CAAC,EAAE,CAAC,CACvD,CAAC;QAEF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,cAAc,OAAO,CAAC,EAAE,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;QAC3D,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAEf,IAAI,GAAG,CAAC,IAAI,KAAK,MAAM,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;YAChD,MAAM,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC;YAClC,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC9B,KAAK,CAAC,IAAI,CAAC,eAAe,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACzD,CAAC;YACD,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC3B,KAAK,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAClD,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QAED,KAAK,MAAM,OAAO,IAAI,eAAe,EAAE,CAAC;YACtC,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;gBACnB,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;gBACnC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACf,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;oBAC5C,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;gBAC1B,CAAC;gBACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACf,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;YAC3C,CAAC;iBAAM,CAAC;gBACN,KAAK,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;gBACpD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACf,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;YAC3C,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACf,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}