@luutuankiet/gsd-reader 0.2.14 → 0.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{_baseUniq-z-lv8Jvi.js → _baseUniq-4Pvt0API.js} +1 -1
- package/dist/assets/{arc-DKE7XsPC.js → arc-DPk0-NRL.js} +1 -1
- package/dist/assets/{architectureDiagram-VXUJARFQ-CkI7wd1I.js → architectureDiagram-VXUJARFQ-M9ZCPP1A.js} +1 -1
- package/dist/assets/{blockDiagram-VD42YOAC-BvboGzW4.js → blockDiagram-VD42YOAC-Cv_EM5GI.js} +1 -1
- package/dist/assets/{c4Diagram-YG6GDRKO-X4GHTCSv.js → c4Diagram-YG6GDRKO-C7epSB7o.js} +1 -1
- package/dist/assets/channel-FJDK1yzQ.js +1 -0
- package/dist/assets/{chunk-4BX2VUAB-BJ1Xh9d8.js → chunk-4BX2VUAB-CibVKME7.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-BUt0gcrF.js → chunk-55IACEB6-DfYhK00n.js} +1 -1
- package/dist/assets/{chunk-B4BG7PRW-IOOg8jsB.js → chunk-B4BG7PRW-5Y0dXcDS.js} +1 -1
- package/dist/assets/{chunk-DI55MBZ5-iNkRoQkJ.js → chunk-DI55MBZ5-QDRTOEOW.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-CFSTb97I.js → chunk-FMBD7UC4-B6OtSrf_.js} +1 -1
- package/dist/assets/{chunk-QN33PNHL-DowFzA7i.js → chunk-QN33PNHL-BYmK-Nir.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-B5rK0icO.js → chunk-QZHKN3VN-Cg0r42sb.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-4XEXwbwE.js → chunk-TZMSLE5B-DIcmDX25.js} +1 -1
- package/dist/assets/classDiagram-2ON5EDUG-C46B1wBU.js +1 -0
- package/dist/assets/classDiagram-v2-WZHVMYZB-C46B1wBU.js +1 -0
- package/dist/assets/clone-OGpqN13D.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-DHiu2RT1.js → cose-bilkent-S5V4N54A-DIXz3ee6.js} +1 -1
- package/dist/assets/{dagre-6UL2VRFP-BpLIVxtX.js → dagre-6UL2VRFP-DSamXsrZ.js} +1 -1
- package/dist/assets/{diagram-PSM6KHXK-BSAldNVF.js → diagram-PSM6KHXK-BDtlXDCX.js} +1 -1
- package/dist/assets/{diagram-QEK2KX5R-0IkBiHr1.js → diagram-QEK2KX5R-ZMJDiTRd.js} +1 -1
- package/dist/assets/{diagram-S2PKOQOG-CMVFBJQU.js → diagram-S2PKOQOG-CkDDwVk_.js} +1 -1
- package/dist/assets/{erDiagram-Q2GNP2WA-Bf4RkonP.js → erDiagram-Q2GNP2WA-D_WlKFw8.js} +1 -1
- package/dist/assets/{flowDiagram-NV44I4VS-CtzQL5IJ.js → flowDiagram-NV44I4VS-Bd_ZPne7.js} +1 -1
- package/dist/assets/{ganttDiagram-JELNMOA3-CYoY8v3d.js → ganttDiagram-JELNMOA3-BBuM_rrJ.js} +1 -1
- package/dist/assets/{gitGraphDiagram-NY62KEGX-CDH_WgHE.js → gitGraphDiagram-NY62KEGX-JB5noIOX.js} +1 -1
- package/dist/assets/{graph-DCYk3Fsi.js → graph-BFlqRZ1M.js} +1 -1
- package/dist/assets/index-_y76LYpf.js +701 -0
- package/dist/assets/{infoDiagram-WHAUD3N6-BCvYw9nD.js → infoDiagram-WHAUD3N6-DjnOclLu.js} +1 -1
- package/dist/assets/{journeyDiagram-XKPGCS4Q-DX7NwIoK.js → journeyDiagram-XKPGCS4Q-o8-Ruf7r.js} +1 -1
- package/dist/assets/{kanban-definition-3W4ZIXB7-BKFQb1ZM.js → kanban-definition-3W4ZIXB7-DwfqqVOX.js} +1 -1
- package/dist/assets/{layout-CSNJi8po.js → layout-lNDdZhKi.js} +1 -1
- package/dist/assets/{linear-CwDvBhuT.js → linear--Hd-zDnM.js} +1 -1
- package/dist/assets/{mermaid.core-DOBy0knJ.js → mermaid.core-C_YTQh_B.js} +4 -4
- package/dist/assets/{min-BIg7pOvo.js → min-BDE9iVAF.js} +1 -1
- package/dist/assets/{mindmap-definition-VGOIOE7T-D3iF4FRa.js → mindmap-definition-VGOIOE7T-BH6F-v1Y.js} +1 -1
- package/dist/assets/{pieDiagram-ADFJNKIX-ClmDuLVW.js → pieDiagram-ADFJNKIX-C5m_XL7X.js} +1 -1
- package/dist/assets/{quadrantDiagram-AYHSOK5B-D_ZWeTmS.js → quadrantDiagram-AYHSOK5B-Bjv5x_BE.js} +1 -1
- package/dist/assets/{requirementDiagram-UZGBJVZJ-r3NlrIgy.js → requirementDiagram-UZGBJVZJ-DHjsFTal.js} +1 -1
- package/dist/assets/{sankeyDiagram-TZEHDZUN-BU3a_E_C.js → sankeyDiagram-TZEHDZUN-CXbLxrr2.js} +1 -1
- package/dist/assets/{sequenceDiagram-WL72ISMW-DRNY1TEJ.js → sequenceDiagram-WL72ISMW-B46JbTFi.js} +1 -1
- package/dist/assets/{stateDiagram-FKZM4ZOC-DMfZzbKw.js → stateDiagram-FKZM4ZOC-CYCu0MGh.js} +1 -1
- package/dist/assets/stateDiagram-v2-4FDKWEC3-DvrO5mTv.js +1 -0
- package/dist/assets/{timeline-definition-IT6M3QCI-BRo31b7s.js → timeline-definition-IT6M3QCI-AFBJH4ii.js} +1 -1
- package/dist/assets/{treemap-KMMF4GRG-ho7bqjTG.js → treemap-KMMF4GRG-DV0MdM-D.js} +1 -1
- package/dist/assets/{xychartDiagram-PRI3JC2R-cHDHQNcq.js → xychartDiagram-PRI3JC2R-B1C2RoAU.js} +1 -1
- package/dist/index.html +15 -7
- package/package.json +5 -2
- package/dist/assets/channel-lTxsWW36.js +0 -1
- package/dist/assets/classDiagram-2ON5EDUG-auivwpo_.js +0 -1
- package/dist/assets/classDiagram-v2-WZHVMYZB-auivwpo_.js +0 -1
- package/dist/assets/clone-ByahSmeu.js +0 -1
- package/dist/assets/index-C-7pv4NL.js +0 -694
- package/dist/assets/stateDiagram-v2-4FDKWEC3-C3RinOPI.js +0 -1
|
@@ -0,0 +1,701 @@
|
|
|
1
|
+
(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const c of r)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&i(d)}).observe(document,{childList:!0,subtree:!0});function n(r){const c={};return r.integrity&&(c.integrity=r.integrity),r.referrerPolicy&&(c.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?c.credentials="include":r.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function i(r){if(r.ep)return;r.ep=!0;const c=n(r);fetch(r.href,c)}})();const Dn="modulepreload",Pn=function(e){return"/"+e},Bt={},Hn=function(s,n,i){let r=Promise.resolve();if(n&&n.length>0){let d=function(u){return Promise.all(u.map(h=>Promise.resolve(h).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),g=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));r=d(n.map(u=>{if(u=Pn(u),u in Bt)return;Bt[u]=!0;const h=u.endsWith(".css"),x=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${x}`))return;const p=document.createElement("link");if(p.rel=h?"stylesheet":Dn,h||(p.as="script"),p.crossOrigin="",p.href=u,g&&p.setAttribute("nonce",g),document.head.appendChild(p),h)return new Promise((m,A)=>{p.addEventListener("load",m),p.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${u}`)))})}))}function c(d){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=d,window.dispatchEvent(l),!l.defaultPrevented)throw d}return r.then(d=>{for(const l of d||[])l.status==="rejected"&&c(l.reason);return s().catch(c)})},Un=/^### \[LOG-(\d+)\](.*?)$/,zn=/^(#{2,5}) (.+)$/,jn=/~~.+~~/;function Wn(e){const s=performance.now(),n=e.split(`
|
|
2
|
+
`),i=[],r=[];let c="GSD-Lite Worklog";for(let m=0;m<Math.min(10,n.length);m++)if(n[m].startsWith("# ")){c=n[m].slice(2).trim();break}let d=null,l=null,g=[],u=[],h=!1;for(let m=0;m<n.length;m++){const A=n[m],v=m+1,C=A.trim();if(C.startsWith("```")||C.startsWith("~~~")){h=!h,(d||l)&&g.push(A);continue}if(h){(d||l)&&g.push(A);continue}const G=A.match(Un);if(G){d&&(d.content=g.join(`
|
|
3
|
+
`).trimEnd()),l&&(l.content=g.join(`
|
|
4
|
+
`).trimEnd(),l=null);const J=`LOG-${G[1]}`,V=G[2],D=[...V.matchAll(/\[([^\]]+)\]/g)].map(Ee=>Ee[1]).join("+"),pe=V.replace(/\[[^\]]+\]/g,"").replace(/^\s*-\s*/,"").trim(),me=jn.test(pe),re=pe.match(/- Task: ([A-Z0-9-]+)/),P=re?re[1]:void 0,Y=re?pe.replace(/\s*- Task: [A-Z0-9-]+/,"").trim():pe;d={id:J,type:D,title:Y,task:P,superseded:me,lineNumber:v,endLine:0,level:3,content:"",rawText:"",children:[]},i.push(d),g=[],u=[{level:3,node:d}];continue}const Z=A.match(zn);if(Z){const V=Z[1].length,Q=Z[2],D={level:V,title:Q,lineNumber:v,endLine:0,children:[]};if(V===2){d&&(d.content=g.join(`
|
|
5
|
+
`).trimEnd()),l&&(l.content=g.join(`
|
|
6
|
+
`).trimEnd()),r.push(D),u=[{level:2,node:D}],d=null,l=D,g=[];continue}if(V===3&&d===null){l&&(l.content=g.join(`
|
|
7
|
+
`).trimEnd()),r.push(D),u=[{level:3,node:D}],l=D,g=[];continue}if(V===3&&d!==null){d.content=g.join(`
|
|
8
|
+
`).trimEnd(),r.push(D),u=[{level:3,node:D}],d=null,l=D,g=[];continue}if(u.length>0){for(;u.length>0&&u[u.length-1].level>=V;)u.pop();u.length>0&&u[u.length-1].node.children.push(D),u.push({level:V,node:D})}d&&V>=4&&g.push(A);continue}(d||l)&&g.push(A)}d&&(d.content=g.join(`
|
|
9
|
+
`).trimEnd()),l&&(l.content=g.join(`
|
|
10
|
+
`).trimEnd());const x=[...i.map(m=>({lineNumber:m.lineNumber,entry:m,isLog:!0})),...r.filter(m=>m.level<=3).map(m=>({lineNumber:m.lineNumber,entry:m,isLog:!1}))].sort((m,A)=>m.lineNumber-A.lineNumber);for(let m=0;m<x.length;m++){const A=x[m],v=x[m+1];let C;if(v)C=v.lineNumber-1;else for(C=n.length;C>A.lineNumber&&n[C-1].trim()==="";)C--;A.entry.endLine=C;const G=n.slice(A.lineNumber-1,C);A.isLog,A.entry.rawText=G.join(`
|
|
11
|
+
`)}const p=Math.round(performance.now()-s);return{title:c,sections:r,logs:i,metadata:{totalLines:n.length,totalLogs:i.length,parseTime:p}}}const Gn=/^#\s+(.+)$/,Fn=/^##\s+(.+)$/;function Kn(e,s,n,i,r){const c=i.join(`
|
|
12
|
+
`),d=c.trimEnd(),l=i.slice(1).join(`
|
|
13
|
+
`).trimEnd(),g=n+i.length-1;return{key:`${e}-section-${r}`,title:s,lineNumber:n,endLine:g,anchorId:`${e}-line-${n}`,markdown:d,rawText:c,content:l}}function Dt(e,s,n){const i=e.split(`
|
|
14
|
+
`);let r=n;for(let p=0;p<Math.min(i.length,20);p++){const m=i[p].match(Gn);if(m){r=m[1].trim();break}}const c=[];let d=!1,l="",g=1,u=-1,h=0;const x=p=>{if(u<0||!l)return;const m=i.slice(u,p);c.push(Kn(s,l,g,m,h)),h+=1};for(let p=0;p<i.length;p++){const m=i[p],A=m.trim();if((A.startsWith("```")||A.startsWith("~~~"))&&(d=!d),d)continue;const v=m.match(Fn);v&&(x(p),l=v[1].trim(),g=p+1,u=p)}if(x(i.length),c.length===0){const p=e.trimEnd();p&&c.push({key:`${s}-section-0`,title:"Overview",lineNumber:1,endLine:i.length,anchorId:`${s}-line-1`,markdown:`## Overview
|
|
15
|
+
|
|
16
|
+
${p}`,rawText:e,content:p})}return{kind:s,fileName:n,title:r,totalLines:i.length,sections:c}}function Ie(e){let s=e;return s=s.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),s=s.replace(/\*(.+?)\*/g,"<em>$1</em>"),s=s.replace(/`([^`]+)`/g,"<code>$1</code>"),s=s.replace(/~~(.+?)~~/g,"<del>$1</del>"),s=s.replace(/\[(.+?)\]\((.+?)\)/g,'<a href="$2" target="_blank" rel="noopener">$1</a>'),s}function ee(e){const s={"&":"&","<":"<",">":">",'"':""","'":"'"};return e.replace(/[&<>"']/g,n=>s[n])}function Et(e){return`
|
|
17
|
+
<label class="outline-select" title="Select for copy export">
|
|
18
|
+
<input type="checkbox" class="copy-select-input" data-copy-key="${ee(e)}">
|
|
19
|
+
</label>
|
|
20
|
+
`}function zt(e){return`work-section-${e.lineNumber}`}function jt(e){return`work-log-${e.id}`}function qe(e,s=!1){const n=`line-${e.lineNumber}`,i=e.children&&e.children.length>0;if(s){const h=e,x=h.superseded?" superseded":"",p=i?" has-children collapsed":"",m=i?'<span class="toggle-btn">▼</span>':"",A=i?`<ul class="outline-children">${h.children.map(v=>qe(v,!1)).join("")}</ul>`:"";return`
|
|
21
|
+
<li class="outline-item log-item${x}${p}">
|
|
22
|
+
<div class="outline-row">
|
|
23
|
+
${m}
|
|
24
|
+
${Et(jt(h))}
|
|
25
|
+
<a href="#${n}" class="outline-link">
|
|
26
|
+
${h.type.split("+").map(v=>`<span class="badge badge-${v}">${v}</span>`).join("")}
|
|
27
|
+
<span class="log-id">${h.id}</span>
|
|
28
|
+
<span class="log-title">${ee(h.title)}</span>
|
|
29
|
+
</a>
|
|
30
|
+
</div>
|
|
31
|
+
${A}
|
|
32
|
+
</li>
|
|
33
|
+
`}const r=e,c=`indent-${r.level}`,d=i?" has-children collapsed":"",l=i?'<span class="toggle-btn">▼</span>':"",g=i?`<ul class="outline-children">${r.children.map(h=>qe(h,!1)).join("")}</ul>`:"",u=r.level<=3;return`
|
|
34
|
+
<li class="outline-item section-item ${c}${d}">
|
|
35
|
+
<div class="outline-row">
|
|
36
|
+
${l}
|
|
37
|
+
${u?Et(zt(r)):'<span class="outline-select-spacer"></span>'}
|
|
38
|
+
<a href="#${n}" class="outline-link">${ee(r.title)}</a>
|
|
39
|
+
</div>
|
|
40
|
+
${g}
|
|
41
|
+
</li>
|
|
42
|
+
`}function Ve(e,s,n){return`
|
|
43
|
+
<h3 class="outline-section-title">
|
|
44
|
+
<span>${e} (${s})</span>
|
|
45
|
+
<button class="select-group-btn" data-select-group="${n}" title="Select all in ${e}">All</button>
|
|
46
|
+
</h3>
|
|
47
|
+
`}function ot(e,s,n){if(!e.sections.length)return"";const i=e.sections.map(r=>`
|
|
48
|
+
<li class="outline-item section-item indent-2">
|
|
49
|
+
<div class="outline-row">
|
|
50
|
+
${Et(r.key)}
|
|
51
|
+
<a href="#${r.anchorId}" class="outline-link">
|
|
52
|
+
<span class="doc-pill doc-${e.kind}">${n}</span>
|
|
53
|
+
${ee(r.title)}
|
|
54
|
+
</a>
|
|
55
|
+
</div>
|
|
56
|
+
</li>
|
|
57
|
+
`).join("");return`
|
|
58
|
+
${Ve(s,e.sections.length,e.kind)}
|
|
59
|
+
<ul class="outline-list">${i}</ul>
|
|
60
|
+
`}function Yn(e,s,n){const i=e.sections.map(l=>qe(l,!1)).join(""),r=e.logs.map(l=>qe(l,!0)).join(""),c=s?ot(s,"PROJECT.md","P"):"",d=n?ot(n,"ARCHITECTURE.md","A"):"";return`
|
|
61
|
+
<nav class="outline" id="outline">
|
|
62
|
+
<div class="outline-header">
|
|
63
|
+
<span>📋 Outline</span>
|
|
64
|
+
<div class="outline-header-buttons">
|
|
65
|
+
<button class="outline-copy-btn" id="copySelectedBtn" title="Copy selected sections as markdown">📋 Copy</button>
|
|
66
|
+
<button class="expand-all-btn" id="expandAllBtn" title="Expand/Collapse All">⊞</button>
|
|
67
|
+
<button class="outline-close" id="outlineClose">✕</button>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
<div class="outline-content">
|
|
71
|
+
${c}
|
|
72
|
+
${d}
|
|
73
|
+
${Ve("WORK Sections",e.sections.length,"work-sections")}
|
|
74
|
+
<ul class="outline-list">${i}</ul>
|
|
75
|
+
${Ve("WORK Logs",e.logs.length,"work-logs")}
|
|
76
|
+
<ul class="outline-list">${r}</ul>
|
|
77
|
+
</div>
|
|
78
|
+
</nav>
|
|
79
|
+
`}function qn(e,s,n){const i=e.sections.map(l=>qe(l,!1)).join(""),r=e.logs.map(l=>qe(l,!0)).join(""),c=s?ot(s,"PROJECT.md","P"):"",d=n?ot(n,"ARCHITECTURE.md","A"):"";return`
|
|
80
|
+
<div class="sheet-overlay" id="sheetOverlay"></div>
|
|
81
|
+
<!-- Peek handle: always visible at bottom edge when sheet is collapsed -->
|
|
82
|
+
<div class="sheet-peek-handle" id="sheetPeekHandle">
|
|
83
|
+
<div class="peek-bar"></div>
|
|
84
|
+
</div>
|
|
85
|
+
<div class="outline-sheet snap-collapsed" id="outlineSheet">
|
|
86
|
+
<div class="sheet-drag-handle" id="sheetDragHandle">
|
|
87
|
+
<div class="sheet-drag-bar"></div>
|
|
88
|
+
</div>
|
|
89
|
+
<div class="sheet-header">
|
|
90
|
+
<span class="sheet-title">📋 Outline</span>
|
|
91
|
+
<div class="sheet-header-buttons">
|
|
92
|
+
<button class="outline-copy-btn" id="sheetCopySelectedBtn" title="Copy selected sections as markdown">📋 Copy</button>
|
|
93
|
+
<button class="expand-all-btn" id="sheetExpandAllBtn" title="Expand/Collapse All">⊞</button>
|
|
94
|
+
<button class="sheet-close-btn" id="sheetClose">✕</button>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
<div class="sheet-content">
|
|
98
|
+
${c}
|
|
99
|
+
${d}
|
|
100
|
+
${Ve("WORK Sections",e.sections.length,"work-sections")}
|
|
101
|
+
<ul class="outline-list">${i}</ul>
|
|
102
|
+
${Ve("WORK Logs",e.logs.length,"work-logs")}
|
|
103
|
+
<ul class="outline-list">${r}</ul>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
`}function vt(e,s=1,n="line"){const i=e.split(`
|
|
107
|
+
`),r=[];let c=!1,d="",l=[],g=!1,u=!1,h="ul",x=0;for(let p=0;p<i.length;p++){const m=i[p],A=s+p,v=`id="${n}-${A}"`,C=m.trim();if(C.startsWith("```")||C.startsWith("~~~")){if(!c)g&&(r.push("</tbody></table>"),g=!1),u&&(r.push(h==="ul"?"</ul>":"</ol>"),u=!1),c=!0,d=C.slice(3).trim(),l=[];else{c=!1;const P=ee(l.join(`
|
|
108
|
+
`));if(d==="mermaid"){const Y=A-l.length;r.push(`
|
|
109
|
+
<div class="mermaid-wrapper" data-start-line="${Y}">
|
|
110
|
+
<pre class="mermaid-source" style="display:none">${P}</pre>
|
|
111
|
+
</div>
|
|
112
|
+
`)}else{const Y=d?` class="language-${d}"`:"";r.push(`<pre><code${Y}>${P}</code></pre>`)}}continue}if(c){l.push(m);continue}const G=C.match(/^<\/([A-Za-z_][\w:.-]*)\s*>$/),Z=C.match(/^<([A-Za-z_][\w:.-]*)(\s+[^<>]+?)?\/>$/),J=C.match(/^<([A-Za-z_][\w:.-]*)(\s+[^<>]+?)?>([^<]*)<\/\1\s*>$/),V=C.match(/^<([A-Za-z_][\w:.-]*)(\s+[^<>]+?)?>$/);if(!!(G||Z||J||V)&&!C.startsWith("<!--")&&!C.startsWith("<!")&&!C.startsWith("<?")){if(g&&(r.push("</tbody></table>"),g=!1),u&&(r.push(h==="ul"?"</ul>":"</ol>"),u=!1),G){x=Math.max(x-1,0);const P=Math.min(x+1,6);r.push(`<div ${v} class="xml-tag-line xml-close depth-${P}"><span class="xml-tag-pill">${ee(C)}</span></div>`)}else if(Z){const P=Math.min(x+1,6);r.push(`<div ${v} class="xml-tag-line xml-self depth-${P}"><span class="xml-tag-pill">${ee(C)}</span></div>`)}else if(J){const P=Math.min(x+1,6),Y=J[1],Ee=J[2]||"",xe=Ie(ee(J[3]||"")),fe=`<${ee(Y+Ee)}>`,Ne=`</${ee(Y)}>`;r.push(`<div ${v} class="xml-tag-line xml-inline depth-${P}"><span class="xml-tag-pill">${fe}</span><span class="xml-inline-value">${xe}</span><span class="xml-tag-pill">${Ne}</span></div>`)}else if(V){const P=Math.min(x+1,6);r.push(`<div ${v} class="xml-tag-line xml-open depth-${P}"><span class="xml-tag-pill">${ee(C)}</span></div>`),x+=1}continue}const D=m.match(/^(#{1,6})\s*(\S.*)$/);if(D){g&&(r.push("</tbody></table>"),g=!1),u&&(r.push(h==="ul"?"</ul>":"</ol>"),u=!1);const P=D[1].length,Y=D[2],Ee=Ie(ee(Y)),xe=P>=4?` data-section-title="${ee(Y)}"`:"",fe=P>=4?`<span class="header-level-tag level-${P}">H${P}</span>`:"";r.push(`<h${P} ${v}${xe}>${fe}${Ee}</h${P}>`);continue}if(/^---+$/.test(m)){g&&(r.push("</tbody></table>"),g=!1),u&&(r.push(h==="ul"?"</ul>":"</ol>"),u=!1),r.push("<hr>");continue}if(!m.trim()){g&&(r.push("</tbody></table>"),g=!1),u&&(r.push(h==="ul"?"</ul>":"</ol>"),u=!1);continue}if(m.includes("|")&&m.trim().startsWith("|")){const P=m.split("|").slice(1,-1).map(Y=>Y.trim());if(P.every(Y=>/^:?-+:?$/.test(Y)))continue;if(g){const Y=P.map(Ee=>`<td>${Ie(ee(Ee))}</td>`).join("");r.push(`<tr>${Y}</tr>`)}else{u&&(r.push(h==="ul"?"</ul>":"</ol>"),u=!1),r.push("<table><thead><tr>");const Y=P.map(Ee=>`<th>${Ie(ee(Ee))}</th>`).join("");r.push(`${Y}</tr></thead><tbody>`),g=!0}continue}g&&(r.push("</tbody></table>"),g=!1);const pe=m.match(/^(\s*)[-*+] (.+)$/);if(pe){(!u||h!=="ul")&&(u&&r.push("</ol>"),r.push("<ul>"),u=!0,h="ul"),r.push(`<li>${Ie(ee(pe[2]))}</li>`);continue}const me=m.match(/^(\s*)\d+\. (.+)$/);if(me){(!u||h!=="ol")&&(u&&r.push("</ul>"),r.push("<ol>"),u=!0,h="ol"),r.push(`<li>${Ie(ee(me[2]))}</li>`);continue}if(u&&(r.push(h==="ul"?"</ul>":"</ol>"),u=!1),m.startsWith("> ")){r.push(`<blockquote ${v}>${Ie(ee(m.slice(2)))}</blockquote>`);continue}const re=Ie(ee(m));r.push(`<p ${v}>${re}</p>`)}return g&&r.push("</tbody></table>"),u&&r.push(h==="ul"?"</ul>":"</ol>"),r.join(`
|
|
113
|
+
`)}function Xn(e){const s=e.content?vt(e.content,e.lineNumber+1):"";return`
|
|
114
|
+
<section class="worklog-section ${`section-h${e.level}`}" id="line-${e.lineNumber}" data-section-title="${ee(e.title)}">
|
|
115
|
+
<h${e.level} class="section-title">${Ie(ee(e.title))}</h${e.level}>
|
|
116
|
+
<div class="section-content">
|
|
117
|
+
${s}
|
|
118
|
+
</div>
|
|
119
|
+
</section>
|
|
120
|
+
`}function Zn(e){const s=vt(e.content,e.lineNumber+1);return`
|
|
121
|
+
<article class="log-entry${e.superseded?" superseded":""}" id="line-${e.lineNumber}" data-section-title="${ee(e.id+": "+e.title)}">
|
|
122
|
+
<header class="log-header">
|
|
123
|
+
<span class="log-badge">${e.id}</span>
|
|
124
|
+
${e.type.split("+").map(i=>`<span class="log-type badge-${i}">${i}</span>`).join("")}
|
|
125
|
+
${e.task?`<span class="log-task">${e.task}</span>`:""}
|
|
126
|
+
</header>
|
|
127
|
+
<h2 class="log-title">${Ie(ee(e.title))}</h2>
|
|
128
|
+
<div class="log-content">
|
|
129
|
+
${s}
|
|
130
|
+
</div>
|
|
131
|
+
</article>
|
|
132
|
+
`}function Pt(e,s){const n=e.kind==="project"?"PROJECT.md":"ARCHITECTURE.md",i=s.content?vt(s.content,s.lineNumber+1,`${e.kind}-line`):"";return`
|
|
133
|
+
<section class="worklog-section section-h2 context-doc ${e.kind}-doc" id="${s.anchorId}" data-section-title="${ee(n+": "+s.title)}">
|
|
134
|
+
<h2 class="section-title">
|
|
135
|
+
<span class="doc-section-pill">${n}</span>
|
|
136
|
+
${Ie(ee(s.title))}
|
|
137
|
+
</h2>
|
|
138
|
+
<div class="section-content">
|
|
139
|
+
${i}
|
|
140
|
+
</div>
|
|
141
|
+
</section>
|
|
142
|
+
`}function Vn(e,s={}){const{projectDoc:n,architectureDoc:i}=s,r=Yn(e,n,i),c=qn(e,n,i),d=[...e.sections.map(p=>({type:"section",lineNumber:p.lineNumber,item:p})),...e.logs.map(p=>({type:"log",lineNumber:p.lineNumber,item:p}))];d.sort((p,m)=>p.lineNumber-m.lineNumber);const l=d.map(({type:p,item:m})=>p==="section"?Xn(m):Zn(m)).join(""),g=n?n.sections.map(p=>Pt(n,p)).join(""):"",u=i?i.sections.map(p=>Pt(i,p)).join(""):"",h=`${g}${u}${l}`;return`
|
|
143
|
+
<!-- Top Bar -->
|
|
144
|
+
<header class="top-bar">
|
|
145
|
+
<button class="btn-outline-toggle" id="outlineToggle">📋</button>
|
|
146
|
+
<span class="top-bar-title">GSD Reader: PROJECT + ARCHITECTURE + WORK</span>
|
|
147
|
+
<div class="top-bar-actions">
|
|
148
|
+
<button class="btn-copy-selected" id="copySelectedTop">📋 Copy</button>
|
|
149
|
+
<button class="btn-jump-latest" id="jumpLatest" data-line="${e.logs.length>0?e.logs[e.logs.length-1].lineNumber:1}">⬇ Latest</button>
|
|
150
|
+
</div>
|
|
151
|
+
</header>
|
|
152
|
+
|
|
153
|
+
<!-- Sticky Path Bar (shows current hierarchy while scrolling) -->
|
|
154
|
+
<nav class="breadcrumb" id="breadcrumb">
|
|
155
|
+
<div class="breadcrumb-path" id="breadcrumbPath"></div>
|
|
156
|
+
<button class="breadcrumb-expand" id="breadcrumbExpand" title="Show full path">⋯</button>
|
|
157
|
+
<div class="breadcrumb-popover" id="breadcrumbPopover"></div>
|
|
158
|
+
</nav>
|
|
159
|
+
|
|
160
|
+
<!-- Outline Panel (Desktop) -->
|
|
161
|
+
${r}
|
|
162
|
+
|
|
163
|
+
<!-- Outline Resize Handle (Desktop) -->
|
|
164
|
+
<div class="outline-resize-handle" id="outlineResizeHandle"></div>
|
|
165
|
+
|
|
166
|
+
<!-- Bottom Sheet (Mobile) -->
|
|
167
|
+
${c}
|
|
168
|
+
|
|
169
|
+
<!-- Overlay (mobile - for desktop sidebar) -->
|
|
170
|
+
<div class="overlay" id="overlay"></div>
|
|
171
|
+
|
|
172
|
+
<!-- Main Content -->
|
|
173
|
+
<main class="content" id="content">
|
|
174
|
+
${h}
|
|
175
|
+
</main>
|
|
176
|
+
|
|
177
|
+
<!-- Mobile Scroll Thumb -->
|
|
178
|
+
<div class="scroll-thumb" id="scrollThumb">
|
|
179
|
+
<div class="thumb-icon">↕</div>
|
|
180
|
+
</div>
|
|
181
|
+
|
|
182
|
+
<!-- Stats Footer -->
|
|
183
|
+
<div class="stats-footer">
|
|
184
|
+
${(n==null?void 0:n.sections.length)||0} project sections · ${(i==null?void 0:i.sections.length)||0} architecture sections · ${e.metadata.totalLogs} logs · ${e.metadata.totalLines} work lines · ${e.metadata.parseTime}ms
|
|
185
|
+
</div>
|
|
186
|
+
`}function Jn(e,s={}){const n=document.getElementById("outline"),i=document.getElementById("overlay"),r=document.getElementById("content"),c=document.getElementById("breadcrumb"),d=document.getElementById("outlineToggle"),l=document.getElementById("outlineClose"),g=document.getElementById("expandAllBtn"),u=document.getElementById("jumpLatest"),h=document.getElementById("scrollThumb"),x=document.getElementById("copySelectedTop"),p=document.getElementById("copySelectedBtn"),m=document.getElementById("sheetCopySelectedBtn");if(!n||!i||!r)return;let A=!1;const v=[],C=new Map,{projectDoc:G,architectureDoc:Z}=s,J=(o,E,S,L,k,$,K)=>{L.trim()&&(v.push(o),C.set(o,{source:E,title:S,markdown:L.trimEnd(),startLine:k,endLine:$,rawText:K.trimEnd()}))};G&&G.sections.forEach(o=>J(o.key,"PROJECT.md",o.title,o.markdown,o.lineNumber,o.endLine,o.rawText)),Z&&Z.sections.forEach(o=>J(o.key,"ARCHITECTURE.md",o.title,o.markdown,o.lineNumber,o.endLine,o.rawText)),e.sections.filter(o=>o.level<=3).forEach(o=>{const E=zt(o),S=`${"#".repeat(o.level)} ${o.title}`,L=o.content?`${S}
|
|
187
|
+
|
|
188
|
+
${o.content}`:S;J(E,"WORK.md",o.title,L,o.lineNumber,o.endLine,o.rawText||L)}),e.logs.forEach(o=>{const E=jt(o),S=o.task?` - Task: ${o.task}`:"",L=`### [${o.id}] - [${o.type}] - ${o.title}${S}`,k=o.content?`${L}
|
|
189
|
+
|
|
190
|
+
${o.content}`:L;J(E,"WORK.md",`${o.id}: ${o.title}`,k,o.lineNumber,o.endLine,o.rawText)});const V=(o,E)=>{document.querySelectorAll(`.copy-select-input[data-copy-key="${o}"]`).forEach(S=>{const L=S;L.checked=E})},Q=o=>o==="project"?v.filter(E=>E.startsWith("project-section-")):o==="architecture"?v.filter(E=>E.startsWith("architecture-section-")):o==="work-sections"?v.filter(E=>E.startsWith("work-section-")):o==="work-logs"?v.filter(E=>E.startsWith("work-log-")):[],D=(o,E)=>{[x,p,m].forEach(S=>{if(!S)return;const L=S.textContent||"📋 Copy";S.textContent=o,S.classList.toggle("copy-success",E),S.classList.toggle("copy-warning",!E),setTimeout(()=>{S.textContent=L.startsWith("📋")?L:"📋 Copy",S.classList.remove("copy-success","copy-warning")},1400)})},pe=async()=>{const o=new Set;if(document.querySelectorAll(".copy-select-input").forEach(k=>{const $=k;$.checked&&$.dataset.copyKey&&o.add($.dataset.copyKey)}),o.size===0){D("Select items first",!1);return}const E=v.filter(k=>o.has(k)).map(k=>C.get(k)).filter(k=>!!k),L=`<gsd>
|
|
191
|
+
${E.map(k=>`<gsd_doc file="${`gsd-lite/${k.source}`}" start_line="${k.startLine}" end_line="${k.endLine}">
|
|
192
|
+
> Source: ${k.source} / ${k.title}
|
|
193
|
+
|
|
194
|
+
${k.rawText}
|
|
195
|
+
</gsd_doc>`).join(`
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
`)}
|
|
200
|
+
</gsd>`;try{await navigator.clipboard.writeText(L),D(`Copied ${E.length}`,!0)}catch{D("Clipboard blocked",!1)}};document.querySelectorAll(".copy-select-input").forEach(o=>{o.addEventListener("change",()=>{const E=o,S=E.dataset.copyKey;S&&V(S,E.checked)})}),document.querySelectorAll(".select-group-btn").forEach(o=>{o.addEventListener("click",()=>{const E=o.dataset.selectGroup;if(!E)return;const S=Q(E);if(!S.length)return;const L=S.every(k=>{const $=document.querySelector(`.copy-select-input[data-copy-key="${k}"]`);return $==null?void 0:$.checked});S.forEach(k=>V(k,!L))})}),[x,p,m].forEach(o=>{o==null||o.addEventListener("click",()=>{pe()})});function me(){var k;const o=window.innerWidth<768,E=o?document.querySelector("#outlineSheet .sheet-content"):document.querySelector("#outline");if(!E)return;const S=E.querySelector(".outline-link.active");if(!S)return;let L=S.closest(".outline-item");for(;L;){const $=(k=L.parentElement)==null?void 0:k.closest(".outline-item");$&&$.classList.remove("collapsed"),L=$??null}setTimeout(()=>{const $=o?"start":"center";S.scrollIntoView({behavior:"instant",block:$})},50)}function re(){if(window.innerWidth>=768){const o=n.classList.contains("hidden");n.classList.toggle("hidden"),r.classList.toggle("full-width"),c==null||c.classList.toggle("full-width"),o&&setTimeout(()=>me(),350)}}if(l==null||l.addEventListener("click",re),i==null||i.addEventListener("click",re),u==null||u.addEventListener("click",()=>{var E;const o=u.dataset.line;o&&((E=document.getElementById(`line-${o}`))==null||E.scrollIntoView({behavior:"smooth"}))}),g==null||g.addEventListener("click",()=>{const o=document.querySelectorAll(".outline-item.has-children");A?(o.forEach(E=>E.classList.add("collapsed")),g.textContent="⊞",g.title="Expand All"):(o.forEach(E=>E.classList.remove("collapsed")),g.textContent="⊟",g.title="Collapse All"),A=!A}),document.querySelectorAll(".toggle-btn").forEach(o=>{o.addEventListener("click",E=>{E.stopPropagation();const S=o.closest(".outline-item");if(!S)return;S.classList.contains("collapsed")?S.classList.remove("collapsed"):(S.classList.add("collapsed"),S.querySelectorAll(".outline-item.has-children").forEach(k=>{k.classList.add("collapsed")}))}),o.addEventListener("dblclick",E=>{E.stopPropagation();const S=o.closest(".outline-item");S&&(S.classList.remove("collapsed"),S.querySelectorAll(".outline-item.has-children").forEach(L=>{L.classList.remove("collapsed")}))})}),document.querySelectorAll(".outline-link").forEach(o=>{o.addEventListener("click",()=>{window.innerWidth<768&&(n.classList.remove("open"),i.classList.remove("visible"))})}),window.innerWidth>=768){const S=window.innerWidth*.8;let L=300,k=!1;const $=document.getElementById("outlineResizeHandle"),K=()=>{n.style.transition="width 0.3s ease",n.style.width="300px",setTimeout(()=>{n.style.transition="",n.style.width="",n.classList.remove("expanded")},300)};if($){let te=0,ye=0;const Pe=()=>{n.classList.contains("hidden")?$.style.display="none":($.style.display="block",$.style.left=`${n.offsetWidth-3}px`)};Pe(),new ResizeObserver(()=>{k||Pe()}).observe(n),$.addEventListener("mousedown",Re=>{Re.preventDefault(),k=!0,te=Re.clientX,ye=n.offsetWidth,$.classList.add("dragging"),document.body.style.cursor="ew-resize",document.body.style.userSelect="none"}),document.addEventListener("mousemove",Re=>{if(!k)return;const w=Re.clientX-te;let q=ye+w;q=Math.max(200,Math.min(S,q)),n.style.width=`${q}px`,$.style.left=`${q-3}px`,q>300?(L=q,n.classList.add("expanded")):n.classList.remove("expanded")}),document.addEventListener("mouseup",()=>{k&&(k=!1,$.classList.remove("dragging"),document.body.style.cursor="",document.body.style.userSelect="")}),$.addEventListener("mouseenter",()=>{}),$.addEventListener("mouseleave",Re=>{if(k||n.classList.contains("hidden"))return;const w=Re.relatedTarget;w&&n.contains(w)||n.offsetWidth>300&&K()})}n.addEventListener("mouseenter",te=>{n.classList.contains("hidden")||k||n.getBoundingClientRect().right-te.clientX<=12||L>300&&(n.classList.add("expanded"),n.style.transition="width 0.3s ease",n.style.width=`${L}px`,setTimeout(()=>{n.style.transition=""},300))}),n.addEventListener("mouseleave",te=>{if(n.classList.contains("hidden")||k)return;const ye=te.relatedTarget;$&&ye&&$.contains(ye)||n.offsetWidth>300&&K()}),r.addEventListener("click",()=>{if(n.classList.contains("hidden")||k)return;n.offsetWidth>300&&K()})}if(h){let o=function(){if(!h)return;const k=window.scrollY,$=document.documentElement.scrollHeight-window.innerHeight,K=window.innerHeight-120,te=60+k/$*K;h.style.top=`${te}px`},E=!1,S=0,L=0;h.addEventListener("touchstart",k=>{E=!0,S=k.touches[0].clientY,L=window.scrollY,h.style.background="rgba(26, 26, 46, 0.95)"}),document.addEventListener("touchmove",k=>{if(!E)return;const $=k.touches[0].clientY-S,K=document.documentElement.scrollHeight-window.innerHeight,te=window.innerHeight-120,ye=$/te*K;window.scrollTo(0,L+ye)}),document.addEventListener("touchend",()=>{E=!1,h.style.background="rgba(26, 26, 46, 0.8)"}),window.addEventListener("scroll",o),o()}const P=document.getElementById("outlineSheet"),Y=document.getElementById("sheetOverlay"),Ee=document.getElementById("sheetDragHandle"),xe=document.getElementById("sheetClose"),fe=document.getElementById("sheetExpandAllBtn"),Ne=document.getElementById("sheetPeekHandle");if(P&&Y&&Ee){let o=function(K){const te=E==="collapsed";E=K,P.classList.remove("snap-collapsed","snap-half","snap-full"),P.classList.add(`snap-${K}`),Y.classList.toggle("visible",K!=="collapsed"),Ne&&Ne.classList.toggle("hidden",K!=="collapsed"),te&&K!=="collapsed"&&setTimeout(()=>me(),350)},E="collapsed",S=!1;xe==null||xe.addEventListener("click",()=>o("collapsed")),Y.addEventListener("click",()=>o("collapsed")),fe==null||fe.addEventListener("click",()=>{const K=P.querySelectorAll(".outline-item.has-children");S?(K.forEach(te=>te.classList.add("collapsed")),fe.textContent="⊞"):(K.forEach(te=>te.classList.remove("collapsed")),fe.textContent="⊟"),S=!S});let L=0,k=0,$=!1;Ee.addEventListener("touchstart",K=>{$=!0,L=K.touches[0].clientY,k=L,P.style.transition="none"}),Ne&&(Ne.addEventListener("touchstart",K=>{$=!0,L=K.touches[0].clientY,k=L,P.style.transition="none",P.style.transform="translateY(95%)"}),Ne.addEventListener("click",()=>{E==="collapsed"&&o("half")})),document.addEventListener("touchmove",K=>{if(!$)return;k=K.touches[0].clientY;const te=k-L;let ye;switch(E){case"collapsed":ye=100;break;case"half":ye=50;break;case"full":ye=15;break}const Pe=te/window.innerHeight*100,Ae=Math.max(15,Math.min(100,ye+Pe));P.style.transform=`translateY(${Ae}%)`}),document.addEventListener("touchend",()=>{if(!$)return;$=!1,P.style.transition="",P.style.transform="";const K=k-L,te=50;K<-te?E==="collapsed"?o("half"):E==="half"&&o("full"):K>te&&(E==="full"?o("half"):E==="half"&&o("collapsed"))}),d&&d.addEventListener("click",()=>{window.innerWidth<768?o(E==="collapsed"?"half":"collapsed"):re()})}const Le=document.getElementById("breadcrumbPath"),Be=document.getElementById("breadcrumbExpand"),z=document.getElementById("breadcrumbPopover"),ae=document.querySelectorAll("[data-section-title]");if(ae.length>0&&c&&Le&&z){let o=function(){let w=null;for(let oe=0;oe<ae.length;oe++){const ve=ae[oe];if(ve.getBoundingClientRect().top<=S)w=ve;else break}if(!w&&ae.length>0&&(w=ae[0]),!w)return;const q=w.id;if(q===E)return;E=q;const F=ye(w);Pe(F);const j=w.closest(".log-entry");document.querySelectorAll(".outline-link").forEach(oe=>{oe.classList.remove("active")});let H=document.querySelectorAll(`.outline-link[href="#${q}"]`);if(H.length===0){const oe=w.closest(".log-entry, .context-doc, .worklog-section"),ve=(oe==null?void 0:oe.id)||(j==null?void 0:j.id);ve&&(H=document.querySelectorAll(`.outline-link[href="#${ve}"]`))}H.forEach(oe=>{var He;oe.classList.add("active");let ve=oe.closest(".outline-item");for(;ve;){const Fe=(He=ve.parentElement)==null?void 0:He.closest(".outline-item");Fe&&Fe.classList.remove("collapsed"),ve=Fe??null}});const ne=document.querySelector("#outline:not(.hidden)"),he=document.querySelector("#outlineSheet:not(.snap-collapsed) .sheet-content"),Oe=ne||he;if(Oe){const oe=Oe.querySelector(".outline-link.active");if(oe){const ve=oe.getBoundingClientRect(),He=Oe.getBoundingClientRect();(ve.top<He.top||ve.bottom>He.bottom)&&oe.scrollIntoView({behavior:"smooth",block:"center"})}}},E=null;const S=96,L=w=>w.id.startsWith("project-")?"project":w.id.startsWith("architecture-")?"architecture":"work",k=w=>w.replace(/^WORK\.md:\s*/i,"").replace(/^PROJECT\.md:\s*/i,"").replace(/^ARCHITECTURE\.md:\s*/i,"").trim(),$=w=>{const q=w.tagName.match(/^H([1-6])$/);if(q)return parseInt(q[1],10);const F=w.getAttribute("aria-level");if(F){const j=parseInt(F,10);if(!Number.isNaN(j))return j}return 6},K=(w,q)=>{const F=Array.from(w.querySelectorAll("[data-section-title]")),j=[];for(const H of F){if(!H.id||H===w)continue;const ne=$(H);for(;j.length>0&&j[j.length-1].level>=ne;)j.pop();if(j.push({level:ne,node:{label:k(H.dataset.sectionTitle||""),targetId:H.id,kind:"section"}}),H===q)break}return j.map(H=>H.node)},te=w=>{if(w.length<=3)return w;if(window.innerWidth<768){const j=w[0],H=w.find(Oe=>Oe.kind==="card")||w[1],ne=w[w.length-1],he=[j];return H&&H!==j&&H!==ne&&he.push(H),w.length>he.length+1&&he.push({label:"...",targetId:null,kind:"ellipsis"}),ne!==j&&ne!==H&&he.push(ne),he}const F={label:"...",targetId:null,kind:"ellipsis"};return[w[0],w[1],F,w[w.length-2],w[w.length-1]].filter((j,H,ne)=>j?j.kind==="ellipsis"?!0:ne.findIndex(he=>he.targetId===j.targetId&&he.label===j.label)===H:!1)},ye=w=>{const q=L(w),F=[],j=q==="work"?"WORK.md":q==="project"?"PROJECT.md":"ARCHITECTURE.md";F.push({label:j,targetId:null,kind:"doc"});const H=w.closest(".log-entry");if(q==="work"&&H){if(F.push({label:k(H.dataset.sectionTitle||"Log Entry"),targetId:H.id,kind:"card"}),w!==H){const he=H.querySelector(".log-content");he&&K(he,w).forEach(oe=>{oe.targetId!==H.id&&F.push(oe)})}return F}const ne=w.closest(".context-doc, .worklog-section");if(ne){const he=k(ne.dataset.sectionTitle||"Section");if(F.push({label:he,targetId:ne.id,kind:"card"}),w!==ne){const Oe=ne.querySelector(".section-content, .log-content");Oe&&K(Oe,w).forEach(ve=>{ve.targetId!==ne.id&&F.push(ve)})}}return F},Pe=w=>{const q=te(w);Le.innerHTML=q.map((F,j)=>{const H=j>0?'<span class="breadcrumb-sep">›</span>':"";if(F.kind==="ellipsis")return`${H}<button class="breadcrumb-chip breadcrumb-chip-ellipsis" data-path-action="expand" type="button">...</button>`;const ne=F.targetId?` data-target-id="${F.targetId}"`:"",he=`breadcrumb-chip-${F.kind}`;return`${H}<button class="breadcrumb-chip ${he}"${ne} type="button">${ee(F.label)}</button>`}).join(""),z.innerHTML=`
|
|
201
|
+
<div class="breadcrumb-popover-title">Full Context Path</div>
|
|
202
|
+
<div class="breadcrumb-popover-list">
|
|
203
|
+
${w.map((F,j)=>{const H=F.targetId?` data-target-id="${F.targetId}"`:"";return`${j>0?'<span class="breadcrumb-popover-sep">›</span>':""}<button class="breadcrumb-popover-item"${H} type="button">${ee(F.label)}</button>`}).join("")}
|
|
204
|
+
</div>
|
|
205
|
+
`},Ae=()=>z.classList.remove("open");Le.addEventListener("click",w=>{var ne;const q=w.target;if(q.closest('[data-path-action="expand"]')){z.classList.toggle("open");return}const j=q.closest(".breadcrumb-chip, .breadcrumb-popover-item"),H=j==null?void 0:j.dataset.targetId;H&&((ne=document.getElementById(H))==null||ne.scrollIntoView({behavior:"smooth"}),Ae())}),z.addEventListener("click",w=>{var H;const F=w.target.closest(".breadcrumb-popover-item"),j=F==null?void 0:F.dataset.targetId;j&&((H=document.getElementById(j))==null||H.scrollIntoView({behavior:"smooth"}),Ae())}),Be==null||Be.addEventListener("click",()=>{z.classList.toggle("open")}),document.addEventListener("click",w=>{const q=w.target;c.contains(q)||Ae()}),window.addEventListener("resize",()=>{if(E){const w=document.getElementById(E);w&&Pe(ye(w))}Ae()});let Re=!1;window.addEventListener("scroll",()=>{Re||(Re=!0,requestAnimationFrame(()=>{o(),Re=!1}))},{passive:!0}),o()}}const O={isOpen:!1,zoom:1,panX:0,panY:0,isDragging:!1,dragStartX:0,dragStartY:0,lastPanX:0,lastPanY:0},Wt=.25,Gt=4,rt=.25;let Se=null,ge=null,Je=null,yt=null;function Qn(){Se||(Se=document.createElement("div"),Se.id="diagram-overlay",Se.innerHTML=`
|
|
206
|
+
<style>
|
|
207
|
+
#diagram-overlay {
|
|
208
|
+
position: fixed;
|
|
209
|
+
top: 0;
|
|
210
|
+
left: 0;
|
|
211
|
+
right: 0;
|
|
212
|
+
bottom: 0;
|
|
213
|
+
background: rgba(0, 0, 0, 0.9);
|
|
214
|
+
z-index: 3000;
|
|
215
|
+
display: none;
|
|
216
|
+
flex-direction: column;
|
|
217
|
+
opacity: 0;
|
|
218
|
+
transition: opacity 0.2s ease;
|
|
219
|
+
}
|
|
220
|
+
#diagram-overlay.visible {
|
|
221
|
+
display: flex;
|
|
222
|
+
opacity: 1;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/* Header bar */
|
|
226
|
+
.diagram-overlay-header {
|
|
227
|
+
display: flex;
|
|
228
|
+
align-items: center;
|
|
229
|
+
justify-content: space-between;
|
|
230
|
+
padding: 12px 16px;
|
|
231
|
+
background: rgba(0, 0, 0, 0.5);
|
|
232
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
|
233
|
+
}
|
|
234
|
+
.diagram-overlay-title {
|
|
235
|
+
color: white;
|
|
236
|
+
font-size: 14px;
|
|
237
|
+
font-weight: 500;
|
|
238
|
+
display: flex;
|
|
239
|
+
align-items: center;
|
|
240
|
+
gap: 8px;
|
|
241
|
+
}
|
|
242
|
+
.diagram-overlay-controls {
|
|
243
|
+
display: flex;
|
|
244
|
+
align-items: center;
|
|
245
|
+
gap: 8px;
|
|
246
|
+
}
|
|
247
|
+
.diagram-overlay-btn {
|
|
248
|
+
background: rgba(255, 255, 255, 0.1);
|
|
249
|
+
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
250
|
+
color: white;
|
|
251
|
+
padding: 8px 12px;
|
|
252
|
+
border-radius: 6px;
|
|
253
|
+
cursor: pointer;
|
|
254
|
+
font-size: 14px;
|
|
255
|
+
transition: background 0.15s ease;
|
|
256
|
+
display: flex;
|
|
257
|
+
align-items: center;
|
|
258
|
+
gap: 4px;
|
|
259
|
+
}
|
|
260
|
+
.diagram-overlay-btn:hover {
|
|
261
|
+
background: rgba(255, 255, 255, 0.2);
|
|
262
|
+
}
|
|
263
|
+
.diagram-overlay-btn:active {
|
|
264
|
+
background: rgba(255, 255, 255, 0.3);
|
|
265
|
+
}
|
|
266
|
+
.diagram-overlay-btn.close {
|
|
267
|
+
background: rgba(233, 69, 96, 0.3);
|
|
268
|
+
border-color: rgba(233, 69, 96, 0.5);
|
|
269
|
+
}
|
|
270
|
+
.diagram-overlay-btn.close:hover {
|
|
271
|
+
background: rgba(233, 69, 96, 0.5);
|
|
272
|
+
}
|
|
273
|
+
.zoom-display {
|
|
274
|
+
color: rgba(255, 255, 255, 0.7);
|
|
275
|
+
font-size: 12px;
|
|
276
|
+
min-width: 50px;
|
|
277
|
+
text-align: center;
|
|
278
|
+
font-family: monospace;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/* Container */
|
|
282
|
+
.diagram-overlay-container {
|
|
283
|
+
flex: 1;
|
|
284
|
+
overflow: hidden;
|
|
285
|
+
cursor: grab;
|
|
286
|
+
display: flex;
|
|
287
|
+
align-items: center;
|
|
288
|
+
justify-content: center;
|
|
289
|
+
}
|
|
290
|
+
.diagram-overlay-container.dragging {
|
|
291
|
+
cursor: grabbing;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/* SVG Wrapper */
|
|
295
|
+
.diagram-svg-wrapper {
|
|
296
|
+
transform-origin: center center;
|
|
297
|
+
transition: transform 0.1s ease;
|
|
298
|
+
background: white;
|
|
299
|
+
border-radius: 8px;
|
|
300
|
+
padding: 20px;
|
|
301
|
+
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
|
|
302
|
+
}
|
|
303
|
+
.diagram-svg-wrapper svg {
|
|
304
|
+
display: block;
|
|
305
|
+
max-width: none !important;
|
|
306
|
+
max-height: none !important;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/* Help text */
|
|
310
|
+
.diagram-overlay-help {
|
|
311
|
+
position: absolute;
|
|
312
|
+
bottom: 16px;
|
|
313
|
+
left: 50%;
|
|
314
|
+
transform: translateX(-50%);
|
|
315
|
+
color: rgba(255, 255, 255, 0.5);
|
|
316
|
+
font-size: 12px;
|
|
317
|
+
pointer-events: none;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/* Mobile adjustments */
|
|
321
|
+
@media (max-width: 600px) {
|
|
322
|
+
.diagram-overlay-header {
|
|
323
|
+
padding: 8px 12px;
|
|
324
|
+
}
|
|
325
|
+
.diagram-overlay-btn {
|
|
326
|
+
padding: 6px 10px;
|
|
327
|
+
font-size: 12px;
|
|
328
|
+
}
|
|
329
|
+
.diagram-overlay-help {
|
|
330
|
+
font-size: 10px;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
</style>
|
|
334
|
+
|
|
335
|
+
<div class="diagram-overlay-header">
|
|
336
|
+
<div class="diagram-overlay-title">
|
|
337
|
+
📊 Diagram Viewer
|
|
338
|
+
</div>
|
|
339
|
+
<div class="diagram-overlay-controls">
|
|
340
|
+
<button class="diagram-overlay-btn" id="diagram-zoom-out" title="Zoom Out">−</button>
|
|
341
|
+
<span class="zoom-display" id="diagram-zoom-display">100%</span>
|
|
342
|
+
<button class="diagram-overlay-btn" id="diagram-zoom-in" title="Zoom In">+</button>
|
|
343
|
+
<button class="diagram-overlay-btn" id="diagram-reset" title="Reset View">⟲</button>
|
|
344
|
+
<button class="diagram-overlay-btn close" id="diagram-close" title="Close (ESC)">✕</button>
|
|
345
|
+
</div>
|
|
346
|
+
</div>
|
|
347
|
+
|
|
348
|
+
<div class="diagram-overlay-container" id="diagram-container">
|
|
349
|
+
<div class="diagram-svg-wrapper" id="diagram-svg-wrapper"></div>
|
|
350
|
+
</div>
|
|
351
|
+
|
|
352
|
+
<div class="diagram-overlay-help">
|
|
353
|
+
Scroll to zoom · Drag to pan · ESC to close
|
|
354
|
+
</div>
|
|
355
|
+
`,document.body.appendChild(Se),ge=document.getElementById("diagram-container"),Je=document.getElementById("diagram-svg-wrapper"),yt=document.getElementById("diagram-zoom-display"),es())}function es(){var s,n,i,r;if(!Se||!ge)return;(s=document.getElementById("diagram-close"))==null||s.addEventListener("click",ht),(n=document.getElementById("diagram-zoom-in"))==null||n.addEventListener("click",()=>ft(rt)),(i=document.getElementById("diagram-zoom-out"))==null||i.addEventListener("click",()=>ft(-rt)),(r=document.getElementById("diagram-reset"))==null||r.addEventListener("click",is),document.addEventListener("keydown",c=>{c.key==="Escape"&&O.isOpen&&ht()}),Se.addEventListener("click",c=>{c.target===ge&&ht()}),ge.addEventListener("wheel",c=>{c.preventDefault();const d=c.deltaY>0?-rt:rt;ft(d)},{passive:!1}),ge.addEventListener("mousedown",ts),document.addEventListener("mousemove",ns),document.addEventListener("mouseup",ss);let e=0;ge.addEventListener("touchstart",c=>{if(c.touches.length===1){const d=c.touches[0];O.isDragging=!0,O.dragStartX=d.clientX,O.dragStartY=d.clientY,O.lastPanX=O.panX,O.lastPanY=O.panY,ge==null||ge.classList.add("dragging")}else if(c.touches.length===2){const d=c.touches[0].clientX-c.touches[1].clientX,l=c.touches[0].clientY-c.touches[1].clientY;e=Math.sqrt(d*d+l*l),(c.touches[0].clientX+c.touches[1].clientX)/2,(c.touches[0].clientY+c.touches[1].clientY)/2}},{passive:!0}),ge.addEventListener("touchmove",c=>{if(c.touches.length===1&&O.isDragging){const d=c.touches[0],l=d.clientX-O.dragStartX,g=d.clientY-O.dragStartY;O.panX=O.lastPanX+l,O.panY=O.lastPanY+g,Xe()}else if(c.touches.length===2){c.preventDefault();const d=c.touches[0].clientX-c.touches[1].clientX,l=c.touches[0].clientY-c.touches[1].clientY,g=Math.sqrt(d*d+l*l);if(e>0){const u=g/e,h=Math.max(Wt,Math.min(Gt,O.zoom*u));O.zoom=h,Xe()}e=g}},{passive:!1}),ge.addEventListener("touchend",()=>{O.isDragging=!1,e=0,ge==null||ge.classList.remove("dragging")})}function ts(e){e.button===0&&(O.isDragging=!0,O.dragStartX=e.clientX,O.dragStartY=e.clientY,O.lastPanX=O.panX,O.lastPanY=O.panY,ge==null||ge.classList.add("dragging"))}function ns(e){if(!O.isDragging)return;const s=e.clientX-O.dragStartX,n=e.clientY-O.dragStartY;O.panX=O.lastPanX+s,O.panY=O.lastPanY+n,Xe()}function ss(){O.isDragging=!1,ge==null||ge.classList.remove("dragging")}function ft(e){const s=Math.max(Wt,Math.min(Gt,O.zoom+e));O.zoom=s,Xe()}function is(){O.zoom=1,O.panX=0,O.panY=0,Xe()}function Xe(){!Je||!yt||(Je.style.transform=`translate(${O.panX}px, ${O.panY}px) scale(${O.zoom})`,yt.textContent=`${Math.round(O.zoom*100)}%`)}function rs(e){Qn(),!(!Se||!Je)&&(O.zoom=1,O.panX=0,O.panY=0,O.isDragging=!1,Je.innerHTML=e,Xe(),Se.style.display="flex",Se.offsetHeight,Se.classList.add("visible"),O.isOpen=!0,document.body.style.overflow="hidden")}function ht(){Se&&(Se.classList.remove("visible"),O.isOpen=!1,document.body.style.overflow="",setTimeout(()=>{Se&&(Se.style.display="none")},200))}function os(){document.querySelectorAll(".mermaid-container").forEach(s=>{s.style.cursor="zoom-in",s.setAttribute("title","Click to expand"),s.addEventListener("click",()=>{const n=s.querySelector("svg");n&&rs(n.outerHTML)})})}function as(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bt,Ht;function cs(){if(Ht)return bt;Ht=1;function e(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(a=>{const b=t[a],M=typeof b;(M==="object"||M==="function")&&!Object.isFrozen(b)&&e(b)}),t}class s{constructor(a){a.data===void 0&&(a.data={}),this.data=a.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function i(t,...a){const b=Object.create(null);for(const M in t)b[M]=t[M];return a.forEach(function(M){for(const ce in M)b[ce]=M[ce]}),b}const r="</span>",c=t=>!!t.scope,d=(t,{prefix:a})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const b=t.split(".");return[`${a}${b.shift()}`,...b.map((M,ce)=>`${M}${"_".repeat(ce+1)}`)].join(" ")}return`${a}${t}`};class l{constructor(a,b){this.buffer="",this.classPrefix=b.classPrefix,a.walk(this)}addText(a){this.buffer+=n(a)}openNode(a){if(!c(a))return;const b=d(a.scope,{prefix:this.classPrefix});this.span(b)}closeNode(a){c(a)&&(this.buffer+=r)}value(){return this.buffer}span(a){this.buffer+=`<span class="${a}">`}}const g=(t={})=>{const a={children:[]};return Object.assign(a,t),a};class u{constructor(){this.rootNode=g(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(a){this.top.children.push(a)}openNode(a){const b=g({scope:a});this.add(b),this.stack.push(b)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(a){return this.constructor._walk(a,this.rootNode)}static _walk(a,b){return typeof b=="string"?a.addText(b):b.children&&(a.openNode(b),b.children.forEach(M=>this._walk(a,M)),a.closeNode(b)),a}static _collapse(a){typeof a!="string"&&a.children&&(a.children.every(b=>typeof b=="string")?a.children=[a.children.join("")]:a.children.forEach(b=>{u._collapse(b)}))}}class h extends u{constructor(a){super(),this.options=a}addText(a){a!==""&&this.add(a)}startScope(a){this.openNode(a)}endScope(){this.closeNode()}__addSublanguage(a,b){const M=a.root;b&&(M.scope=`language:${b}`),this.add(M)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function x(t){return t?typeof t=="string"?t:t.source:null}function p(t){return v("(?=",t,")")}function m(t){return v("(?:",t,")*")}function A(t){return v("(?:",t,")?")}function v(...t){return t.map(b=>x(b)).join("")}function C(t){const a=t[t.length-1];return typeof a=="object"&&a.constructor===Object?(t.splice(t.length-1,1),a):{}}function G(...t){return"("+(C(t).capture?"":"?:")+t.map(M=>x(M)).join("|")+")"}function Z(t){return new RegExp(t.toString()+"|").exec("").length-1}function J(t,a){const b=t&&t.exec(a);return b&&b.index===0}const V=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Q(t,{joinWith:a}){let b=0;return t.map(M=>{b+=1;const ce=b;let le=x(M),T="";for(;le.length>0;){const _=V.exec(le);if(!_){T+=le;break}T+=le.substring(0,_.index),le=le.substring(_.index+_[0].length),_[0][0]==="\\"&&_[1]?T+="\\"+String(Number(_[1])+ce):(T+=_[0],_[0]==="("&&b++)}return T}).map(M=>`(${M})`).join(a)}const D=/\b\B/,pe="[a-zA-Z]\\w*",me="[a-zA-Z_]\\w*",re="\\b\\d+(\\.\\d+)?",P="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Y="\\b(0b[01]+)",Ee="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",xe=(t={})=>{const a=/^#![ ]*\//;return t.binary&&(t.begin=v(a,/.*\b/,t.binary,/\b.*/)),i({scope:"meta",begin:a,end:/$/,relevance:0,"on:begin":(b,M)=>{b.index!==0&&M.ignoreMatch()}},t)},fe={begin:"\\\\[\\s\\S]",relevance:0},Ne={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[fe]},Le={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[fe]},Be={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},z=function(t,a,b={}){const M=i({scope:"comment",begin:t,end:a,contains:[]},b);M.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const ce=G("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return M.contains.push({begin:v(/[ ]+/,"(",ce,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),M},ae=z("//","$"),o=z("/\\*","\\*/"),E=z("#","$"),S={scope:"number",begin:re,relevance:0},L={scope:"number",begin:P,relevance:0},k={scope:"number",begin:Y,relevance:0},$={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[fe,{begin:/\[/,end:/\]/,relevance:0,contains:[fe]}]},K={scope:"title",begin:pe,relevance:0},te={scope:"title",begin:me,relevance:0},ye={begin:"\\.\\s*"+me,relevance:0};var Ae=Object.freeze({__proto__:null,APOS_STRING_MODE:Ne,BACKSLASH_ESCAPE:fe,BINARY_NUMBER_MODE:k,BINARY_NUMBER_RE:Y,COMMENT:z,C_BLOCK_COMMENT_MODE:o,C_LINE_COMMENT_MODE:ae,C_NUMBER_MODE:L,C_NUMBER_RE:P,END_SAME_AS_BEGIN:function(t){return Object.assign(t,{"on:begin":(a,b)=>{b.data._beginMatch=a[1]},"on:end":(a,b)=>{b.data._beginMatch!==a[1]&&b.ignoreMatch()}})},HASH_COMMENT_MODE:E,IDENT_RE:pe,MATCH_NOTHING_RE:D,METHOD_GUARD:ye,NUMBER_MODE:S,NUMBER_RE:re,PHRASAL_WORDS_MODE:Be,QUOTE_STRING_MODE:Le,REGEXP_MODE:$,RE_STARTERS_RE:Ee,SHEBANG:xe,TITLE_MODE:K,UNDERSCORE_IDENT_RE:me,UNDERSCORE_TITLE_MODE:te});function Re(t,a){t.input[t.index-1]==="."&&a.ignoreMatch()}function w(t,a){t.className!==void 0&&(t.scope=t.className,delete t.className)}function q(t,a){a&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=Re,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function F(t,a){Array.isArray(t.illegal)&&(t.illegal=G(...t.illegal))}function j(t,a){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function H(t,a){t.relevance===void 0&&(t.relevance=1)}const ne=(t,a)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const b=Object.assign({},t);Object.keys(t).forEach(M=>{delete t[M]}),t.keywords=b.keywords,t.begin=v(b.beforeMatch,p(b.begin)),t.starts={relevance:0,contains:[Object.assign(b,{endsParent:!0})]},t.relevance=0,delete b.beforeMatch},he=["of","and","for","in","not","or","if","then","parent","list","value"],Oe="keyword";function oe(t,a,b=Oe){const M=Object.create(null);return typeof t=="string"?ce(b,t.split(" ")):Array.isArray(t)?ce(b,t):Object.keys(t).forEach(function(le){Object.assign(M,oe(t[le],a,le))}),M;function ce(le,T){a&&(T=T.map(_=>_.toLowerCase())),T.forEach(function(_){const I=_.split("|");M[I[0]]=[le,ve(I[0],I[1])]})}}function ve(t,a){return a?Number(a):He(t)?0:1}function He(t){return he.includes(t.toLowerCase())}const Fe={},je=t=>{console.error(t)},wt=(t,...a)=>{console.log(`WARN: ${t}`,...a)},Ke=(t,a)=>{Fe[`${t}/${a}`]||(console.log(`Deprecated as of ${t}. ${a}`),Fe[`${t}/${a}`]=!0)},Qe=new Error;function Tt(t,a,{key:b}){let M=0;const ce=t[b],le={},T={};for(let _=1;_<=a.length;_++)T[_+M]=ce[_],le[_+M]=!0,M+=Z(a[_-1]);t[b]=T,t[b]._emit=le,t[b]._multi=!0}function dn(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw je("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Qe;if(typeof t.beginScope!="object"||t.beginScope===null)throw je("beginScope must be object"),Qe;Tt(t,t.begin,{key:"beginScope"}),t.begin=Q(t.begin,{joinWith:""})}}function un(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw je("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Qe;if(typeof t.endScope!="object"||t.endScope===null)throw je("endScope must be object"),Qe;Tt(t,t.end,{key:"endScope"}),t.end=Q(t.end,{joinWith:""})}}function gn(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function pn(t){gn(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),dn(t),un(t)}function mn(t){function a(T,_){return new RegExp(x(T),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(_?"g":""))}class b{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(_,I){I.position=this.position++,this.matchIndexes[this.matchAt]=I,this.regexes.push([I,_]),this.matchAt+=Z(_)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const _=this.regexes.map(I=>I[1]);this.matcherRe=a(Q(_,{joinWith:"|"}),!0),this.lastIndex=0}exec(_){this.matcherRe.lastIndex=this.lastIndex;const I=this.matcherRe.exec(_);if(!I)return null;const _e=I.findIndex((Ze,lt)=>lt>0&&Ze!==void 0),ue=this.matchIndexes[_e];return I.splice(0,_e),Object.assign(I,ue)}}class M{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(_){if(this.multiRegexes[_])return this.multiRegexes[_];const I=new b;return this.rules.slice(_).forEach(([_e,ue])=>I.addRule(_e,ue)),I.compile(),this.multiRegexes[_]=I,I}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(_,I){this.rules.push([_,I]),I.type==="begin"&&this.count++}exec(_){const I=this.getMatcher(this.regexIndex);I.lastIndex=this.lastIndex;let _e=I.exec(_);if(this.resumingScanAtSamePosition()&&!(_e&&_e.index===this.lastIndex)){const ue=this.getMatcher(0);ue.lastIndex=this.lastIndex+1,_e=ue.exec(_)}return _e&&(this.regexIndex+=_e.position+1,this.regexIndex===this.count&&this.considerAll()),_e}}function ce(T){const _=new M;return T.contains.forEach(I=>_.addRule(I.begin,{rule:I,type:"begin"})),T.terminatorEnd&&_.addRule(T.terminatorEnd,{type:"end"}),T.illegal&&_.addRule(T.illegal,{type:"illegal"}),_}function le(T,_){const I=T;if(T.isCompiled)return I;[w,j,pn,ne].forEach(ue=>ue(T,_)),t.compilerExtensions.forEach(ue=>ue(T,_)),T.__beforeBegin=null,[q,F,H].forEach(ue=>ue(T,_)),T.isCompiled=!0;let _e=null;return typeof T.keywords=="object"&&T.keywords.$pattern&&(T.keywords=Object.assign({},T.keywords),_e=T.keywords.$pattern,delete T.keywords.$pattern),_e=_e||/\w+/,T.keywords&&(T.keywords=oe(T.keywords,t.case_insensitive)),I.keywordPatternRe=a(_e,!0),_&&(T.begin||(T.begin=/\B|\b/),I.beginRe=a(I.begin),!T.end&&!T.endsWithParent&&(T.end=/\B|\b/),T.end&&(I.endRe=a(I.end)),I.terminatorEnd=x(I.end)||"",T.endsWithParent&&_.terminatorEnd&&(I.terminatorEnd+=(T.end?"|":"")+_.terminatorEnd)),T.illegal&&(I.illegalRe=a(T.illegal)),T.contains||(T.contains=[]),T.contains=[].concat(...T.contains.map(function(ue){return fn(ue==="self"?T:ue)})),T.contains.forEach(function(ue){le(ue,I)}),T.starts&&le(T.starts,_),I.matcher=ce(I),I}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=i(t.classNameAliases||{}),le(t)}function St(t){return t?t.endsWithParent||St(t.starts):!1}function fn(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(a){return i(t,{variants:null},a)})),t.cachedVariants?t.cachedVariants:St(t)?i(t,{starts:t.starts?i(t.starts):null}):Object.isFrozen(t)?i(t):t}var hn="11.11.1";class bn extends Error{constructor(a,b){super(a),this.name="HTMLInjectionError",this.html=b}}const ct=n,xt=i,Nt=Symbol("nomatch"),En=7,kt=function(t){const a=Object.create(null),b=Object.create(null),M=[];let ce=!0;const le="Could not find the language '{}', did you forget to load/include a language module?",T={disableAutodetect:!0,name:"Plain text",contains:[]};let _={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:h};function I(f){return _.noHighlightRe.test(f)}function _e(f){let R=f.className+" ";R+=f.parentNode?f.parentNode.className:"";const W=_.languageDetectRe.exec(R);if(W){const se=Ue(W[1]);return se||(wt(le.replace("{}",W[1])),wt("Falling back to no-highlight mode for this block.",f)),se?W[1]:"no-highlight"}return R.split(/\s+/).find(se=>I(se)||Ue(se))}function ue(f,R,W){let se="",be="";typeof R=="object"?(se=f,W=R.ignoreIllegals,be=R.language):(Ke("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ke("10.7.0",`Please use highlight(code, options) instead.
|
|
356
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),be=f,se=R),W===void 0&&(W=!0);const Ce={code:se,language:be};tt("before:highlight",Ce);const ze=Ce.result?Ce.result:Ze(Ce.language,Ce.code,W);return ze.code=Ce.code,tt("after:highlight",ze),ze}function Ze(f,R,W,se){const be=Object.create(null);function Ce(y,N){return y.keywords[N]}function ze(){if(!B.keywords){we.addText(ie);return}let y=0;B.keywordPatternRe.lastIndex=0;let N=B.keywordPatternRe.exec(ie),U="";for(;N;){U+=ie.substring(y,N.index);const X=$e.case_insensitive?N[0].toLowerCase():N[0],Te=Ce(B,X);if(Te){const[De,$n]=Te;if(we.addText(U),U="",be[X]=(be[X]||0)+1,be[X]<=En&&(it+=$n),De.startsWith("_"))U+=N[0];else{const Bn=$e.classNameAliases[De]||De;Me(N[0],Bn)}}else U+=N[0];y=B.keywordPatternRe.lastIndex,N=B.keywordPatternRe.exec(ie)}U+=ie.substring(y),we.addText(U)}function nt(){if(ie==="")return;let y=null;if(typeof B.subLanguage=="string"){if(!a[B.subLanguage]){we.addText(ie);return}y=Ze(B.subLanguage,ie,!0,$t[B.subLanguage]),$t[B.subLanguage]=y._top}else y=dt(ie,B.subLanguage.length?B.subLanguage:null);B.relevance>0&&(it+=y.relevance),we.__addSublanguage(y._emitter,y.language)}function ke(){B.subLanguage!=null?nt():ze(),ie=""}function Me(y,N){y!==""&&(we.startScope(N),we.addText(y),we.endScope())}function Ot(y,N){let U=1;const X=N.length-1;for(;U<=X;){if(!y._emit[U]){U++;continue}const Te=$e.classNameAliases[y[U]]||y[U],De=N[U];Te?Me(De,Te):(ie=De,ze(),ie=""),U++}}function Ct(y,N){return y.scope&&typeof y.scope=="string"&&we.openNode($e.classNameAliases[y.scope]||y.scope),y.beginScope&&(y.beginScope._wrap?(Me(ie,$e.classNameAliases[y.beginScope._wrap]||y.beginScope._wrap),ie=""):y.beginScope._multi&&(Ot(y.beginScope,N),ie="")),B=Object.create(y,{parent:{value:B}}),B}function It(y,N,U){let X=J(y.endRe,U);if(X){if(y["on:end"]){const Te=new s(y);y["on:end"](N,Te),Te.isMatchIgnored&&(X=!1)}if(X){for(;y.endsParent&&y.parent;)y=y.parent;return y}}if(y.endsWithParent)return It(y.parent,N,U)}function Ln(y){return B.matcher.regexIndex===0?(ie+=y[0],1):(mt=!0,0)}function On(y){const N=y[0],U=y.rule,X=new s(U),Te=[U.__beforeBegin,U["on:begin"]];for(const De of Te)if(De&&(De(y,X),X.isMatchIgnored))return Ln(N);return U.skip?ie+=N:(U.excludeBegin&&(ie+=N),ke(),!U.returnBegin&&!U.excludeBegin&&(ie=N)),Ct(U,y),U.returnBegin?0:N.length}function Cn(y){const N=y[0],U=R.substring(y.index),X=It(B,y,U);if(!X)return Nt;const Te=B;B.endScope&&B.endScope._wrap?(ke(),Me(N,B.endScope._wrap)):B.endScope&&B.endScope._multi?(ke(),Ot(B.endScope,y)):Te.skip?ie+=N:(Te.returnEnd||Te.excludeEnd||(ie+=N),ke(),Te.excludeEnd&&(ie=N));do B.scope&&we.closeNode(),!B.skip&&!B.subLanguage&&(it+=B.relevance),B=B.parent;while(B!==X.parent);return X.starts&&Ct(X.starts,y),Te.returnEnd?0:N.length}function In(){const y=[];for(let N=B;N!==$e;N=N.parent)N.scope&&y.unshift(N.scope);y.forEach(N=>we.openNode(N))}let st={};function Mt(y,N){const U=N&&N[0];if(ie+=y,U==null)return ke(),0;if(st.type==="begin"&&N.type==="end"&&st.index===N.index&&U===""){if(ie+=R.slice(N.index,N.index+1),!ce){const X=new Error(`0 width match regex (${f})`);throw X.languageName=f,X.badRule=st.rule,X}return 1}if(st=N,N.type==="begin")return On(N);if(N.type==="illegal"&&!W){const X=new Error('Illegal lexeme "'+U+'" for mode "'+(B.scope||"<unnamed>")+'"');throw X.mode=B,X}else if(N.type==="end"){const X=Cn(N);if(X!==Nt)return X}if(N.type==="illegal"&&U==="")return ie+=`
|
|
357
|
+
`,1;if(pt>1e5&&pt>N.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ie+=U,U.length}const $e=Ue(f);if(!$e)throw je(le.replace("{}",f)),new Error('Unknown language: "'+f+'"');const Mn=mn($e);let gt="",B=se||Mn;const $t={},we=new _.__emitter(_);In();let ie="",it=0,We=0,pt=0,mt=!1;try{if($e.__emitTokens)$e.__emitTokens(R,we);else{for(B.matcher.considerAll();;){pt++,mt?mt=!1:B.matcher.considerAll(),B.matcher.lastIndex=We;const y=B.matcher.exec(R);if(!y)break;const N=R.substring(We,y.index),U=Mt(N,y);We=y.index+U}Mt(R.substring(We))}return we.finalize(),gt=we.toHTML(),{language:f,value:gt,relevance:it,illegal:!1,_emitter:we,_top:B}}catch(y){if(y.message&&y.message.includes("Illegal"))return{language:f,value:ct(R),illegal:!0,relevance:0,_illegalBy:{message:y.message,index:We,context:R.slice(We-100,We+100),mode:y.mode,resultSoFar:gt},_emitter:we};if(ce)return{language:f,value:ct(R),illegal:!1,relevance:0,errorRaised:y,_emitter:we,_top:B};throw y}}function lt(f){const R={value:ct(f),illegal:!1,relevance:0,_top:T,_emitter:new _.__emitter(_)};return R._emitter.addText(f),R}function dt(f,R){R=R||_.languages||Object.keys(a);const W=lt(f),se=R.filter(Ue).filter(Lt).map(ke=>Ze(ke,f,!1));se.unshift(W);const be=se.sort((ke,Me)=>{if(ke.relevance!==Me.relevance)return Me.relevance-ke.relevance;if(ke.language&&Me.language){if(Ue(ke.language).supersetOf===Me.language)return 1;if(Ue(Me.language).supersetOf===ke.language)return-1}return 0}),[Ce,ze]=be,nt=Ce;return nt.secondBest=ze,nt}function yn(f,R,W){const se=R&&b[R]||W;f.classList.add("hljs"),f.classList.add(`language-${se}`)}function ut(f){let R=null;const W=_e(f);if(I(W))return;if(tt("before:highlightElement",{el:f,language:W}),f.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",f);return}if(f.children.length>0&&(_.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(f)),_.throwUnescapedHTML))throw new bn("One of your code blocks includes unescaped HTML.",f.innerHTML);R=f;const se=R.textContent,be=W?ue(se,{language:W,ignoreIllegals:!0}):dt(se);f.innerHTML=be.value,f.dataset.highlighted="yes",yn(f,W,be.language),f.result={language:be.language,re:be.relevance,relevance:be.relevance},be.secondBest&&(f.secondBest={language:be.secondBest.language,relevance:be.secondBest.relevance}),tt("after:highlightElement",{el:f,result:be,text:se})}function _n(f){_=xt(_,f)}const vn=()=>{et(),Ke("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function wn(){et(),Ke("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let At=!1;function et(){function f(){et()}if(document.readyState==="loading"){At||window.addEventListener("DOMContentLoaded",f,!1),At=!0;return}document.querySelectorAll(_.cssSelector).forEach(ut)}function Tn(f,R){let W=null;try{W=R(t)}catch(se){if(je("Language definition for '{}' could not be registered.".replace("{}",f)),ce)je(se);else throw se;W=T}W.name||(W.name=f),a[f]=W,W.rawDefinition=R.bind(null,t),W.aliases&&Rt(W.aliases,{languageName:f})}function Sn(f){delete a[f];for(const R of Object.keys(b))b[R]===f&&delete b[R]}function xn(){return Object.keys(a)}function Ue(f){return f=(f||"").toLowerCase(),a[f]||a[b[f]]}function Rt(f,{languageName:R}){typeof f=="string"&&(f=[f]),f.forEach(W=>{b[W.toLowerCase()]=R})}function Lt(f){const R=Ue(f);return R&&!R.disableAutodetect}function Nn(f){f["before:highlightBlock"]&&!f["before:highlightElement"]&&(f["before:highlightElement"]=R=>{f["before:highlightBlock"](Object.assign({block:R.el},R))}),f["after:highlightBlock"]&&!f["after:highlightElement"]&&(f["after:highlightElement"]=R=>{f["after:highlightBlock"](Object.assign({block:R.el},R))})}function kn(f){Nn(f),M.push(f)}function An(f){const R=M.indexOf(f);R!==-1&&M.splice(R,1)}function tt(f,R){const W=f;M.forEach(function(se){se[W]&&se[W](R)})}function Rn(f){return Ke("10.7.0","highlightBlock will be removed entirely in v12.0"),Ke("10.7.0","Please use highlightElement now."),ut(f)}Object.assign(t,{highlight:ue,highlightAuto:dt,highlightAll:et,highlightElement:ut,highlightBlock:Rn,configure:_n,initHighlighting:vn,initHighlightingOnLoad:wn,registerLanguage:Tn,unregisterLanguage:Sn,listLanguages:xn,getLanguage:Ue,registerAliases:Rt,autoDetection:Lt,inherit:xt,addPlugin:kn,removePlugin:An}),t.debugMode=function(){ce=!1},t.safeMode=function(){ce=!0},t.versionString=hn,t.regex={concat:v,lookahead:p,either:G,optional:A,anyNumberOfTimes:m};for(const f in Ae)typeof Ae[f]=="object"&&e(Ae[f]);return Object.assign(t,Ae),t},Ye=kt({});return Ye.newInstance=()=>kt({}),bt=Ye,Ye.HighlightJS=Ye,Ye.default=Ye,bt}var ls=cs();const de=as(ls),at="[A-Za-z$_][0-9A-Za-z$_]*",Ft=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Kt=["true","false","null","undefined","NaN","Infinity"],Yt=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],qt=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Xt=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Zt=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Vt=[].concat(Xt,Yt,qt);function ds(e){const s=e.regex,n=(z,{after:ae})=>{const o="</"+z[0].slice(1);return z.input.indexOf(o,ae)!==-1},i=at,r={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,d={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(z,ae)=>{const o=z[0].length+z.index,E=z.input[o];if(E==="<"||E===","){ae.ignoreMatch();return}E===">"&&(n(z,{after:o})||ae.ignoreMatch());let S;const L=z.input.substring(o);if(S=L.match(/^\s*=/)){ae.ignoreMatch();return}if((S=L.match(/^\s+extends\s+/))&&S.index===0){ae.ignoreMatch();return}}},l={$pattern:at,keyword:Ft,literal:Kt,built_in:Vt,"variable.language":Zt},g="[0-9](_?[0-9])*",u=`\\.(${g})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",x={className:"number",variants:[{begin:`(\\b(${h})((${u})|\\.)?|(${u}))[eE][+-]?(${g})\\b`},{begin:`\\b(${h})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},A={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},v={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},Z={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},J=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,A,v,C,{match:/\$\d+/},x];p.contains=J.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(J)});const V=[].concat(Z,p.contains),Q=V.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(V)}]),D={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:Q},pe={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,s.concat(i,"(",s.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},me={relevance:0,match:s.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Yt,...qt]}},re={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},P={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[D],illegal:/%/},Y={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Ee(z){return s.concat("(?!",z.join("|"),")")}const xe={match:s.concat(/\b/,Ee([...Xt,"super","import"].map(z=>`${z}\\s*\\(`)),i,s.lookahead(/\s*\(/)),className:"title.function",relevance:0},fe={begin:s.concat(/\./,s.lookahead(s.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Ne={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},D]},Le="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",Be={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,s.lookahead(Le)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[D]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:Q,CLASS_REFERENCE:me},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),re,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,A,v,C,Z,{match:/\$\d+/},x,me,{scope:"attr",match:i+s.lookahead(":"),relevance:0},Be,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[Z,e.REGEXP_MODE,{className:"function",begin:Le,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:Q}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:c},{begin:d.begin,"on:begin":d.isTrulyOpeningTag,end:d.end}],subLanguage:"xml",contains:[{begin:d.begin,end:d.end,skip:!0,contains:["self"]}]}]},P,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[D,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},fe,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[D]},xe,Y,pe,Ne,{match:/\$[(.]/}]}}function Jt(e){const s=e.regex,n=ds(e),i=at,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],c={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},d={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},g=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:at,keyword:Ft.concat(g),literal:Kt,built_in:Vt.concat(r),"variable.language":Zt},h={className:"meta",begin:"@"+i},x=(v,C,G)=>{const Z=v.contains.findIndex(J=>J.label===C);if(Z===-1)throw new Error("can not find mode to replace");v.contains.splice(Z,1,G)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(h);const p=n.contains.find(v=>v.scope==="attr"),m=Object.assign({},p,{match:s.concat(i,s.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,p,m]),n.contains=n.contains.concat([h,c,d,m]),x(n,"shebang",e.SHEBANG()),x(n,"use_strict",l);const A=n.contains.find(v=>v.label==="func.def");return A.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}const Ut="[A-Za-z$_][0-9A-Za-z$_]*",us=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],gs=["true","false","null","undefined","NaN","Infinity"],Qt=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],en=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],tn=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ps=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],ms=[].concat(tn,Qt,en);function nn(e){const s=e.regex,n=(z,{after:ae})=>{const o="</"+z[0].slice(1);return z.input.indexOf(o,ae)!==-1},i=Ut,r={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,d={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(z,ae)=>{const o=z[0].length+z.index,E=z.input[o];if(E==="<"||E===","){ae.ignoreMatch();return}E===">"&&(n(z,{after:o})||ae.ignoreMatch());let S;const L=z.input.substring(o);if(S=L.match(/^\s*=/)){ae.ignoreMatch();return}if((S=L.match(/^\s+extends\s+/))&&S.index===0){ae.ignoreMatch();return}}},l={$pattern:Ut,keyword:us,literal:gs,built_in:ms,"variable.language":ps},g="[0-9](_?[0-9])*",u=`\\.(${g})`,h="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",x={className:"number",variants:[{begin:`(\\b(${h})((${u})|\\.)?|(${u}))[eE][+-]?(${g})\\b`},{begin:`\\b(${h})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},m={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},A={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},v={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},C={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},Z={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},J=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,A,v,C,{match:/\$\d+/},x];p.contains=J.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(J)});const V=[].concat(Z,p.contains),Q=V.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(V)}]),D={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:Q},pe={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,s.concat(i,"(",s.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},me={relevance:0,match:s.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Qt,...en]}},re={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},P={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[D],illegal:/%/},Y={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Ee(z){return s.concat("(?!",z.join("|"),")")}const xe={match:s.concat(/\b/,Ee([...tn,"super","import"].map(z=>`${z}\\s*\\(`)),i,s.lookahead(/\s*\(/)),className:"title.function",relevance:0},fe={begin:s.concat(/\./,s.lookahead(s.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Ne={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},D]},Le="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",Be={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,s.lookahead(Le)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[D]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:Q,CLASS_REFERENCE:me},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),re,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,m,A,v,C,Z,{match:/\$\d+/},x,me,{scope:"attr",match:i+s.lookahead(":"),relevance:0},Be,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[Z,e.REGEXP_MODE,{className:"function",begin:Le,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:Q}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:c},{begin:d.begin,"on:begin":d.isTrulyOpeningTag,end:d.end}],subLanguage:"xml",contains:[{begin:d.begin,end:d.end,skip:!0,contains:["self"]}]}]},P,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[D,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},fe,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[D]},xe,Y,pe,Ne,{match:/\$[(.]/}]}}function sn(e){const s=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},g={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},h={begin:/\{\{/,relevance:0},x={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,g],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,g],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,g,h,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,g,h,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,h,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,h,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},p="[0-9](_?[0-9])*",m=`(\\b(${p}))?\\.(${p})|\\b(${p})\\.`,A=`\\b|${i.join("|")}`,v={className:"number",relevance:0,variants:[{begin:`(\\b(${p})|(${m}))[eE][+-]?(${p})[jJ]?(?=${A})`},{begin:`(${m})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${A})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${A})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${A})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${A})`},{begin:`\\b(${p})[jJ](?=${A})`}]},C={className:"comment",begin:s.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},G={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",g,v,x,e.HASH_COMMENT_MODE]}]};return u.contains=[x,v,g],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[g,v,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},x,C,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[G]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[v,G,x]}]}}function fs(e){const s=e.regex,n=e.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["true","false","unknown"],d=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],g=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],h=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],x=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],p=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],m=h,A=[...u,...g].filter(Q=>!h.includes(Q)),v={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},C={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},G={match:s.concat(/\b/,s.either(...m),/\s*\(/),relevance:0,keywords:{built_in:m}};function Z(Q){return s.concat(/\b/,s.either(...Q.map(D=>D.replace(/\s+/,"\\s+"))),/\b/)}const J={scope:"keyword",match:Z(p),relevance:0};function V(Q,{exceptions:D,when:pe}={}){const me=pe;return D=D||[],Q.map(re=>re.match(/\|\d+$/)||D.includes(re)?re:me(re)?`${re}|0`:re)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:V(A,{when:Q=>Q.length<3}),literal:c,type:l,built_in:x},contains:[{scope:"type",match:Z(d)},J,G,v,i,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,C]}}function hs(e){const s={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],r={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[s,n,e.QUOTE_STRING_MODE,r,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function rn(e){const s="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},c={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},d={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},l=e.inherit(d,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),p={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},m={end:",",endsWithParent:!0,excludeEnd:!0,keywords:s,relevance:0},A={begin:/\{/,end:/\}/,contains:[m],illegal:"\\n",relevance:0},v={begin:"\\[",end:"\\]",contains:[m],illegal:"\\n",relevance:0},C=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:s,keywords:{literal:s}},p,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},A,v,c,d],G=[...C];return G.pop(),G.push(l),m.contains=G,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:C}}function on(e){const s=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:s.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},c=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),d={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(l);const g={match:/\\"/},u={className:"string",begin:/'/,end:/'/},h={match:/\\'/},x={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},p=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],m=e.SHEBANG({binary:`(${p.join("|")})`,relevance:10}),A={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},v=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],C=["true","false"],G={match:/(\/[a-z._-]+)+/},Z=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],J=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],V=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],Q=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:v,literal:C,built_in:[...Z,...J,"set","shopt",...V,...Q]},contains:[m,e.SHEBANG(),A,x,c,d,G,l,g,u,h,n]}}function bs(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function an(e){const s=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},c={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},d={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,g={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:s.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},h={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},x=e.inherit(u,{contains:[]}),p=e.inherit(h,{contains:[]});u.contains.push(p),h.contains.push(x);let m=[n,g];return[u,h,x,p].forEach(G=>{G.contains=G.contains.concat(m)}),m=m.concat(u,h),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:m},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:m}]}]},n,c,u,h,{className:"quote",begin:"^>\\s+",contains:m,end:"$"},r,i,g,d,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function cn(e){const s=e.regex,n=s.concat(/[\p{L}_]/u,s.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},d=e.inherit(c,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),g=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[c,g,l,d,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,d,g,l]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[g]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:s.concat(/</,s.lookahead(s.concat(n,s.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:s.concat(/<\//,s.lookahead(s.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}const Es=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),ys=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],_s=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],vs=[...ys,..._s],ws=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Ts=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Ss=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),xs=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Ns(e){const s=e.regex,n=Es(e),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",c=/@-?\w[\w]*(-\w+)*/,d="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,i,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+d,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Ts.join("|")+")"},{begin:":(:)?("+Ss.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+xs.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:s.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:c},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:ws.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+vs.join("|")+")\\b"}]}}function ks(e){const s=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:s.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:s.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}de.registerLanguage("typescript",Jt);de.registerLanguage("ts",Jt);de.registerLanguage("javascript",nn);de.registerLanguage("js",nn);de.registerLanguage("python",sn);de.registerLanguage("py",sn);de.registerLanguage("sql",fs);de.registerLanguage("json",hs);de.registerLanguage("yaml",rn);de.registerLanguage("yml",rn);de.registerLanguage("bash",on);de.registerLanguage("sh",on);de.registerLanguage("shell",bs);de.registerLanguage("markdown",an);de.registerLanguage("md",an);de.registerLanguage("xml",cn);de.registerLanguage("html",cn);de.registerLanguage("css",Ns);de.registerLanguage("diff",ks);function As(){if(document.getElementById("hljs-styles"))return;const e=document.createElement("style");e.id="hljs-styles",e.textContent=`
|
|
358
|
+
/*
|
|
359
|
+
* Semantic Light Theme - High contrast with distinct token colors
|
|
360
|
+
* Designed for readability across all languages (TS, Python, YAML, SQL, etc.)
|
|
361
|
+
*/
|
|
362
|
+
.hljs {
|
|
363
|
+
background: #fafafa !important;
|
|
364
|
+
color: #383a42 !important;
|
|
365
|
+
padding: 1rem;
|
|
366
|
+
border-radius: 6px;
|
|
367
|
+
border: 1px solid #e1e4e8 !important;
|
|
368
|
+
font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', monospace;
|
|
369
|
+
font-size: 0.875rem;
|
|
370
|
+
line-height: 1.6;
|
|
371
|
+
overflow-x: auto;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/* Comments - muted italic gray */
|
|
375
|
+
.hljs-comment,
|
|
376
|
+
.hljs-quote {
|
|
377
|
+
color: #a0a1a7;
|
|
378
|
+
font-style: italic;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/* Keywords (if, else, return, const, let, from, import) - BOLD PURPLE */
|
|
382
|
+
.hljs-keyword,
|
|
383
|
+
.hljs-selector-tag {
|
|
384
|
+
color: #a626a4;
|
|
385
|
+
font-weight: 600;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/* Types & Built-ins - ORANGE */
|
|
389
|
+
.hljs-type,
|
|
390
|
+
.hljs-built_in,
|
|
391
|
+
.hljs-builtin-name,
|
|
392
|
+
.hljs-class .hljs-title {
|
|
393
|
+
color: #c18401;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/* Strings - GREEN */
|
|
397
|
+
.hljs-string,
|
|
398
|
+
.hljs-doctag,
|
|
399
|
+
.hljs-regexp {
|
|
400
|
+
color: #50a14f;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/* Numbers - DARK ORANGE */
|
|
404
|
+
.hljs-number {
|
|
405
|
+
color: #986801;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/* Booleans (true/false/null) - MAGENTA (distinct!) */
|
|
409
|
+
.hljs-literal {
|
|
410
|
+
color: #e45649;
|
|
411
|
+
font-weight: 600;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/* Variables - RED */
|
|
415
|
+
.hljs-variable,
|
|
416
|
+
.hljs-template-variable {
|
|
417
|
+
color: #e45649;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/* Functions - BLUE */
|
|
421
|
+
.hljs-title,
|
|
422
|
+
.hljs-title.function_,
|
|
423
|
+
.hljs-section {
|
|
424
|
+
color: #4078f2;
|
|
425
|
+
font-weight: 600;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
/* Keys/Attributes (YAML keys, HTML attrs, JSON keys) - DARK BLUE */
|
|
429
|
+
.hljs-attr,
|
|
430
|
+
.hljs-attribute {
|
|
431
|
+
color: #4078f2;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/* Names/Tags (HTML tags, XML) - RED */
|
|
435
|
+
.hljs-name,
|
|
436
|
+
.hljs-tag {
|
|
437
|
+
color: #e45649;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/* Classes/Selectors - ORANGE */
|
|
441
|
+
.hljs-selector-id,
|
|
442
|
+
.hljs-selector-class {
|
|
443
|
+
color: #c18401;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/* Meta (decorators, preprocessor) - PURPLE */
|
|
447
|
+
.hljs-meta,
|
|
448
|
+
.hljs-meta .hljs-keyword {
|
|
449
|
+
color: #a626a4;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/* Symbols/Bullets/Punctuation - TEAL */
|
|
453
|
+
.hljs-symbol,
|
|
454
|
+
.hljs-bullet {
|
|
455
|
+
color: #0184bc;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/* Links - BLUE underlined */
|
|
459
|
+
.hljs-link {
|
|
460
|
+
color: #4078f2;
|
|
461
|
+
text-decoration: underline;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/* Additions (diff) - GREEN bg */
|
|
465
|
+
.hljs-addition {
|
|
466
|
+
color: #50a14f;
|
|
467
|
+
background-color: #e6ffec;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/* Deletions (diff) - RED bg */
|
|
471
|
+
.hljs-deletion {
|
|
472
|
+
color: #e45649;
|
|
473
|
+
background-color: #ffebe9;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
/* Emphasis */
|
|
477
|
+
.hljs-emphasis {
|
|
478
|
+
font-style: italic;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/* Strong */
|
|
482
|
+
.hljs-strong {
|
|
483
|
+
font-weight: bold;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/* Code blocks in log entries - light subtle container */
|
|
487
|
+
.log-content pre {
|
|
488
|
+
margin: 1rem 0;
|
|
489
|
+
border: none !important;
|
|
490
|
+
background: transparent !important;
|
|
491
|
+
box-shadow: 0 1px 3px rgba(0,0,0,0.08);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
.log-content pre code,
|
|
495
|
+
.section-content pre code {
|
|
496
|
+
display: block;
|
|
497
|
+
padding: 0;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/* Language badge */
|
|
501
|
+
.log-content pre {
|
|
502
|
+
position: relative;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.log-content pre[data-language]::before {
|
|
506
|
+
content: attr(data-language);
|
|
507
|
+
position: absolute;
|
|
508
|
+
top: 0;
|
|
509
|
+
right: 0;
|
|
510
|
+
padding: 2px 8px;
|
|
511
|
+
font-size: 0.7rem;
|
|
512
|
+
color: #57606a;
|
|
513
|
+
background: #eaeef2;
|
|
514
|
+
border-bottom-left-radius: 4px;
|
|
515
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
516
|
+
text-transform: uppercase;
|
|
517
|
+
}
|
|
518
|
+
`,document.head.appendChild(e)}function Rs(){As(),document.querySelectorAll("pre code:not(.mermaid-source)").forEach(s=>{const n=s,i=n.parentElement;if(n.classList.contains("hljs"))return;const r=Array.from(n.classList).find(d=>d.startsWith("language-")),c=r?r.replace("language-",""):null;if(c!=="mermaid")try{c&&de.getLanguage(c)?(de.highlightElement(n),i&&i.setAttribute("data-language",c)):(n.classList.add("hljs"),i&&c&&i.setAttribute("data-language",c))}catch(d){console.warn("[Syntax Highlight] Failed to highlight block:",d)}})}const Ls="/_worklog",Os="/_project",Cs="/_architecture";let Ge=[];async function ln(){const e=document.getElementById("app");if(!e)return;Ge=[];const s=window.scrollY;console.log(`[GSD-Lite Reader] Saving scroll position: ${s}px`);try{const n=u=>{const h=atob(u),x=Uint8Array.from(h,p=>p.charCodeAt(0));return new TextDecoder("utf-8").decode(x)};let i="",r="",c="";if(window.__WORKLOG_CONTENT_B64__)i=n(window.__WORKLOG_CONTENT_B64__),r=window.__PROJECT_CONTENT_B64__?n(window.__PROJECT_CONTENT_B64__):"",c=window.__ARCHITECTURE_CONTENT_B64__?n(window.__ARCHITECTURE_CONTENT_B64__):"",console.log("[GSD-Lite Reader] Using embedded content (static mode)");else if(window.__WORKLOG_CONTENT__)i=window.__WORKLOG_CONTENT__,r=window.__PROJECT_CONTENT__||"",c=window.__ARCHITECTURE_CONTENT__||"",console.log("[GSD-Lite Reader] Using embedded content (static mode, legacy)");else{const u=async x=>{const p=await fetch(x);return p.ok?p.text():""},h=await fetch(Ls);if(!h.ok)throw new Error(`Failed to load WORK.md: ${h.status} ${h.statusText}`);[i,r,c]=await Promise.all([h.text(),u(Os),u(Cs)])}const d=Wn(i),l=Dt(r,"project","PROJECT.md"),g=Dt(c,"architecture","ARCHITECTURE.md");e.innerHTML=Vn(d,{projectDoc:l,architectureDoc:g}),Jn(d,{projectDoc:l,architectureDoc:g}),await Bs(),os(),Rs(),Is(),s>0&&requestAnimationFrame(()=>{window.scrollTo(0,s),console.log(`[GSD-Lite Reader] Restored scroll to ${s}px`)}),console.log(`[GSD-Lite Reader] Loaded ${d.metadata.totalLogs} logs in ${d.metadata.parseTime}ms`)}catch(n){e.innerHTML=`
|
|
519
|
+
<div class="loading">
|
|
520
|
+
<div>⚠️ Failed to load worklog</div>
|
|
521
|
+
<div style="font-size: 0.875rem; color: #888;">
|
|
522
|
+
${n instanceof Error?n.message:"Unknown error"}
|
|
523
|
+
</div>
|
|
524
|
+
<div style="font-size: 0.75rem; color: #aaa;">
|
|
525
|
+
Check that WORK.md exists and the dev server is running.
|
|
526
|
+
</div>
|
|
527
|
+
</div>
|
|
528
|
+
`}}function Is(){const e=document.getElementById("mermaid-error-panel");if(e&&e.remove(),Ge.length===0)return;const s=document.createElement("div");s.id="mermaid-error-panel",s.innerHTML=`
|
|
529
|
+
<style>
|
|
530
|
+
#mermaid-error-panel {
|
|
531
|
+
position: fixed;
|
|
532
|
+
top: 50px;
|
|
533
|
+
right: 16px;
|
|
534
|
+
width: 400px;
|
|
535
|
+
max-width: calc(100vw - 32px);
|
|
536
|
+
max-height: 60vh;
|
|
537
|
+
background: #fff5f5;
|
|
538
|
+
border: 2px solid #e94560;
|
|
539
|
+
border-radius: 8px;
|
|
540
|
+
box-shadow: 0 4px 20px rgba(0,0,0,0.15);
|
|
541
|
+
z-index: 2000;
|
|
542
|
+
overflow: hidden;
|
|
543
|
+
display: flex;
|
|
544
|
+
flex-direction: column;
|
|
545
|
+
}
|
|
546
|
+
#mermaid-error-panel.collapsed {
|
|
547
|
+
max-height: none;
|
|
548
|
+
height: auto;
|
|
549
|
+
}
|
|
550
|
+
#mermaid-error-panel.collapsed .error-panel-body {
|
|
551
|
+
display: none;
|
|
552
|
+
}
|
|
553
|
+
.error-panel-header {
|
|
554
|
+
display: flex;
|
|
555
|
+
align-items: center;
|
|
556
|
+
justify-content: space-between;
|
|
557
|
+
padding: 12px 16px;
|
|
558
|
+
background: #e94560;
|
|
559
|
+
color: white;
|
|
560
|
+
font-weight: 600;
|
|
561
|
+
cursor: pointer;
|
|
562
|
+
}
|
|
563
|
+
.error-panel-header:hover {
|
|
564
|
+
background: #d63050;
|
|
565
|
+
}
|
|
566
|
+
.error-panel-title {
|
|
567
|
+
display: flex;
|
|
568
|
+
align-items: center;
|
|
569
|
+
gap: 8px;
|
|
570
|
+
}
|
|
571
|
+
.error-panel-badge {
|
|
572
|
+
background: white;
|
|
573
|
+
color: #e94560;
|
|
574
|
+
padding: 2px 8px;
|
|
575
|
+
border-radius: 12px;
|
|
576
|
+
font-size: 12px;
|
|
577
|
+
}
|
|
578
|
+
.error-panel-actions {
|
|
579
|
+
display: flex;
|
|
580
|
+
gap: 8px;
|
|
581
|
+
}
|
|
582
|
+
.error-panel-btn {
|
|
583
|
+
background: rgba(255,255,255,0.2);
|
|
584
|
+
border: none;
|
|
585
|
+
color: white;
|
|
586
|
+
padding: 6px 12px;
|
|
587
|
+
border-radius: 4px;
|
|
588
|
+
cursor: pointer;
|
|
589
|
+
font-size: 12px;
|
|
590
|
+
display: flex;
|
|
591
|
+
align-items: center;
|
|
592
|
+
gap: 4px;
|
|
593
|
+
}
|
|
594
|
+
.error-panel-btn:hover {
|
|
595
|
+
background: rgba(255,255,255,0.3);
|
|
596
|
+
}
|
|
597
|
+
.error-panel-btn.copied {
|
|
598
|
+
background: #4CAF50;
|
|
599
|
+
}
|
|
600
|
+
.error-panel-body {
|
|
601
|
+
overflow-y: auto;
|
|
602
|
+
padding: 12px;
|
|
603
|
+
flex: 1;
|
|
604
|
+
}
|
|
605
|
+
.error-item {
|
|
606
|
+
background: white;
|
|
607
|
+
border: 1px solid #ffcccc;
|
|
608
|
+
border-radius: 6px;
|
|
609
|
+
padding: 12px;
|
|
610
|
+
margin-bottom: 8px;
|
|
611
|
+
}
|
|
612
|
+
.error-item:last-child {
|
|
613
|
+
margin-bottom: 0;
|
|
614
|
+
}
|
|
615
|
+
.error-item-header {
|
|
616
|
+
display: flex;
|
|
617
|
+
align-items: center;
|
|
618
|
+
justify-content: space-between;
|
|
619
|
+
margin-bottom: 8px;
|
|
620
|
+
}
|
|
621
|
+
.error-item-line {
|
|
622
|
+
font-weight: 600;
|
|
623
|
+
color: #e94560;
|
|
624
|
+
}
|
|
625
|
+
.error-item-jump {
|
|
626
|
+
background: #e94560;
|
|
627
|
+
color: white;
|
|
628
|
+
border: none;
|
|
629
|
+
padding: 4px 8px;
|
|
630
|
+
border-radius: 4px;
|
|
631
|
+
cursor: pointer;
|
|
632
|
+
font-size: 11px;
|
|
633
|
+
}
|
|
634
|
+
.error-item-jump:hover {
|
|
635
|
+
background: #d63050;
|
|
636
|
+
}
|
|
637
|
+
.error-item-msg {
|
|
638
|
+
font-size: 13px;
|
|
639
|
+
color: #333;
|
|
640
|
+
word-break: break-word;
|
|
641
|
+
}
|
|
642
|
+
@media (max-width: 500px) {
|
|
643
|
+
#mermaid-error-panel {
|
|
644
|
+
right: 8px;
|
|
645
|
+
width: calc(100vw - 16px);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
</style>
|
|
649
|
+
<div class="error-panel-header" onclick="toggleErrorPanel()">
|
|
650
|
+
<div class="error-panel-title">
|
|
651
|
+
⚠️ Mermaid Errors
|
|
652
|
+
<span class="error-panel-badge">${Ge.length}</span>
|
|
653
|
+
</div>
|
|
654
|
+
<div class="error-panel-actions">
|
|
655
|
+
<button class="error-panel-btn" onclick="event.stopPropagation(); copyAllErrors();" id="copy-errors-btn">
|
|
656
|
+
📋 Copy All
|
|
657
|
+
</button>
|
|
658
|
+
<span style="font-size: 12px;">▼</span>
|
|
659
|
+
</div>
|
|
660
|
+
</div>
|
|
661
|
+
<div class="error-panel-body">
|
|
662
|
+
${Ge.map((n,i)=>`
|
|
663
|
+
<div class="error-item">
|
|
664
|
+
<div class="error-item-header">
|
|
665
|
+
<span class="error-item-line">📍 Line ~${n.line}</span>
|
|
666
|
+
<button class="error-item-jump" onclick="jumpToLine(${n.line})">Jump</button>
|
|
667
|
+
</div>
|
|
668
|
+
<div class="error-item-msg">${$s(n.error)}</div>
|
|
669
|
+
</div>
|
|
670
|
+
`).join("")}
|
|
671
|
+
</div>
|
|
672
|
+
`,document.body.appendChild(s),window.toggleErrorPanel=()=>{s.classList.toggle("collapsed")},window.copyAllErrors=()=>{const n=Ms();navigator.clipboard.writeText(n).then(()=>{const i=document.getElementById("copy-errors-btn");i&&(i.classList.add("copied"),i.innerHTML="✓ Copied!",setTimeout(()=>{i.classList.remove("copied"),i.innerHTML="📋 Copy All"},2e3))})},window.jumpToLine=n=>{const i=document.querySelector(`[id^="line-${n}"], [data-start-line="${n}"]`);i&&(i.scrollIntoView({behavior:"smooth",block:"center"}),i.style.outline="3px solid #e94560",setTimeout(()=>{i.style.outline=""},2e3))}}function Ms(){const e=`## Mermaid Diagram Errors in WORK.md
|
|
673
|
+
|
|
674
|
+
Found ${Ge.length} broken diagram(s). Please fix:
|
|
675
|
+
`,s=Ge.map((n,i)=>`### Error ${i+1}: Line ~${n.line}
|
|
676
|
+
|
|
677
|
+
**Error:** ${n.error}
|
|
678
|
+
|
|
679
|
+
**Broken code:**
|
|
680
|
+
\`\`\`mermaid
|
|
681
|
+
${n.code}
|
|
682
|
+
\`\`\`
|
|
683
|
+
`).join(`
|
|
684
|
+
---
|
|
685
|
+
|
|
686
|
+
`);return e+`
|
|
687
|
+
`+s}function $s(e){const s=document.createElement("div");return s.textContent=e,s.innerHTML}async function Bs(){const e=document.querySelectorAll(".mermaid-wrapper");if(e.length===0)return;const{default:s}=await Hn(async()=>{const{default:n}=await import("./mermaid.core-C_YTQh_B.js").then(i=>i.bA);return{default:n}},[]);s.initialize({startOnLoad:!1,theme:"default",suppressErrorRendering:!0,themeVariables:{primaryColor:"#e94560",primaryTextColor:"#1a1a2e",primaryBorderColor:"#6f42c1",lineColor:"#6c757d",secondaryColor:"#f8f9fa",tertiaryColor:"#ffffff"},flowchart:{useMaxWidth:!0,htmlLabels:!0},sequence:{useMaxWidth:!0}});for(let n=0;n<e.length;n++){const i=e[n],r=i.querySelector(".mermaid-source");if(!r)continue;const c=r.textContent||"",d=i.dataset.startLine||"?";try{const{svg:l}=await s.render(`mermaid-${n}`,c);i.innerHTML=`<div class="mermaid-container">${l}</div>`}catch(l){const g=l instanceof Error?l.message:"Unknown error";Ge.push({line:d,error:g,code:c}),console.error(`[Mermaid] Error at WORK.md line ~${d}:`,g),i.innerHTML=`
|
|
688
|
+
<div class="mermaid-error">
|
|
689
|
+
<strong>⚠️ Mermaid syntax error</strong>
|
|
690
|
+
<div style="margin-top: 0.25rem; font-size: 0.75rem; color: #666;">
|
|
691
|
+
📍 WORK.md line ~${d}
|
|
692
|
+
</div>
|
|
693
|
+
<div style="margin-top: 0.5rem; font-size: 0.875rem; color: #c62828;">
|
|
694
|
+
${g}
|
|
695
|
+
</div>
|
|
696
|
+
<details style="margin-top: 0.5rem;">
|
|
697
|
+
<summary style="cursor: pointer; font-size: 0.75rem; color: #666;">Show diagram source</summary>
|
|
698
|
+
<pre style="margin-top: 0.5rem; font-size: 0.75rem; background: #f5f5f5; padding: 0.5rem; border-radius: 4px; overflow-x: auto; white-space: pre-wrap;">${c}</pre>
|
|
699
|
+
</details>
|
|
700
|
+
</div>
|
|
701
|
+
`}}}function _t(){const s=`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}`;try{const n=new WebSocket(s);n.onopen=()=>{console.log("[GSD-Lite Reader] WebSocket connected")},n.onmessage=i=>{i.data==="reload"&&(console.log("[GSD-Lite Reader] WORK.md changed (WebSocket), reloading..."),ln())},n.onclose=()=>{console.log("[GSD-Lite Reader] WebSocket disconnected, reconnecting in 2s..."),setTimeout(_t,2e3)},n.onerror=()=>{}}catch{console.warn("[GSD-Lite Reader] WebSocket connection failed, will retry"),setTimeout(_t,2e3)}}const Ds=!!(window.__WORKLOG_CONTENT_B64__||window.__WORKLOG_CONTENT__),Ps=!1;ln();!Ds&&!Ps&&_t();export{Hn as _,as as g};
|