cc-viewer 1.5.15 → 1.5.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.
|
@@ -688,7 +688,7 @@ void main() {
|
|
|
688
688
|
\${}
|
|
689
689
|
} else {
|
|
690
690
|
\${}
|
|
691
|
-
}`,{label:"if",detail:"/ else block",type:"keyword"}),Dn('import ${name} "${module}"\n${}',{label:"import",detail:"declaration",type:"keyword"})],eN=new mb,KD=new Set(["SourceFile","Block","FunctionDecl","MethodDecl","FunctionLiteral","ForStatement","SwitchStatement","TypeSwitchStatement","IfStatement"]);function YO(t,e){return(n,r)=>{e:for(let i=n.node.firstChild,s=0,o=null;;){for(;!i;){if(!s)break e;s--,i=o.nextSibling,o=o.parent}e&&i.name==e||i.name=="SpecList"?(s++,o=i,i=i.firstChild):(i.name=="DefName"&&r(i,t),i=i.nextSibling)}return!0}}const BIe={FunctionDecl:YO("function"),VarDecl:YO("var","VarSpec"),ConstDecl:YO("constant","ConstSpec"),TypeDecl:YO("type","TypeSpec"),ImportDecl:YO("constant","ImportSpec"),Parameter:YO("var"),__proto__:null};function JD(t,e){let n=eN.get(e);if(n)return n;let r=[],i=!0;function s(o,a){let l=t.sliceString(o.from,o.to);r.push({label:l,type:a})}return e.cursor(Or.IncludeAnonymous).iterate(o=>{if(i)i=!1;else if(o.name){let a=BIe[o.name];if(a&&a(o,s)||KD.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of JD(t,o.node))r.push(a);return!1}}),eN.set(e,r),r}const tN=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,eZ=["String","LineComment","BlockComment","DefName","LabelName","FieldName",".","?."],UIe=t=>{let e=pr(t.state).resolveInner(t.pos,-1);if(eZ.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&tN.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)KD.has(i.name)&&(r=r.concat(JD(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:tN}},Yx=Ns.define({name:"go",parser:VIe.configure({props:[uo.add({IfStatement:ki({except:/^\s*({|else\b)/}),LabeledStatement:vb,"SwitchBlock SelectBlock":t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n||r?0:t.unit)},Block:kl({closing:"}"}),BlockComment:()=>null,Statement:ki({except:/^{/})}),Vs.add({"Block SwitchBlock SelectBlock LiteralValue InterfaceType StructType SpecList":Zl,BlockComment(t){return{from:t.from+2,to:t.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case\b|default\b|\})$/}});let qIe=t=>({label:t,type:"keyword"});const DIe="interface struct chan map package go return break continue goto fallthrough else defer range true false nil".split(" ").map(qIe);function ZIe(){let t=YIe.concat(DIe);return new oo(Yx,[Yx.data.of({autocomplete:_b(eZ,zg(t))}),Yx.data.of({autocomplete:UIe})])}const GIe="_fileContentView_ryksq_1",FIe="_editorBanner_ryksq_8",HIe="_header_ryksq_18",KIe="_headerLeft_ryksq_28",JIe="_headerRight_ryksq_36",eLe="_backBtn_ryksq_43",tLe="_filePath_ryksq_64",nLe="_fileSize_ryksq_72",rLe="_saveBtn_ryksq_78",iLe="_saveStatus_ryksq_104",sLe="_saveStatusSaved_ryksq_110",oLe="_saveStatusFailed_ryksq_114",aLe="_contentContainer_ryksq_118",lLe="_editorWrapper_ryksq_127",cLe="_lineNumCol_ryksq_135",uLe="_lineNumRow_ryksq_145",dLe="_editorCol_ryksq_155",OLe="_loading_ryksq_175",hLe="_error_ryksq_185",Ni={fileContentView:GIe,editorBanner:FIe,header:HIe,headerLeft:KIe,headerRight:JIe,backBtn:eLe,filePath:tLe,fileSize:nLe,saveBtn:rLe,saveStatus:iLe,saveStatusSaved:sLe,saveStatusFailed:oLe,contentContainer:aLe,editorWrapper:lLe,lineNumCol:cLe,lineNumRow:uLe,editorCol:dLe,loading:OLe,error:hLe},nN={js:Wp,jsx:Wp,ts:Wp,tsx:Wp,py:q6e,java:H6e,c:AO,cpp:AO,cc:AO,cxx:AO,h:AO,hpp:AO,go:ZIe,rs:Wze,php:IMe,html:M0,htm:M0,xml:M0,svg:M0,json:dNe,yml:CM,yaml:CM,md:YM,markdown:YM,css:Ap,scss:Ap,sass:Ap,less:Ap,sql:mIe};function fLe(t){var n;const e=(n=t.split(".").pop())==null?void 0:n.toLowerCase();return nN[e]?[nN[e]()]:[]}function pLe(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}const mLe=Pt.theme({"&":{backgroundColor:"#0d0d0d",color:"#e0e0e0",height:"100%",overflow:"visible"},".cm-gutters:not(.cm-minimap-gutter)":{display:"none"},"& .cm-scroller":{position:"absolute",inset:"0",fontFamily:"'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace",fontSize:"13px",lineHeight:"1.5"},".cm-minimap-gutter":{background:"#0f0f0f",borderLeft:"1px solid #262626"},".cm-minimap-overlay":{border:"1px solid rgba(128, 144, 178, 0.6)",background:"rgba(95, 110, 145, 0.15)",borderRadius:"2px",transition:"opacity 0.2s ease"},".cm-minimap-gutter:hover .cm-minimap-overlay":{border:"1px solid rgba(128, 144, 178, 0.85)",background:"rgba(95, 110, 145, 0.25)"},".cm-activeLine":{backgroundColor:"
|
|
691
|
+
}`,{label:"if",detail:"/ else block",type:"keyword"}),Dn('import ${name} "${module}"\n${}',{label:"import",detail:"declaration",type:"keyword"})],eN=new mb,KD=new Set(["SourceFile","Block","FunctionDecl","MethodDecl","FunctionLiteral","ForStatement","SwitchStatement","TypeSwitchStatement","IfStatement"]);function YO(t,e){return(n,r)=>{e:for(let i=n.node.firstChild,s=0,o=null;;){for(;!i;){if(!s)break e;s--,i=o.nextSibling,o=o.parent}e&&i.name==e||i.name=="SpecList"?(s++,o=i,i=i.firstChild):(i.name=="DefName"&&r(i,t),i=i.nextSibling)}return!0}}const BIe={FunctionDecl:YO("function"),VarDecl:YO("var","VarSpec"),ConstDecl:YO("constant","ConstSpec"),TypeDecl:YO("type","TypeSpec"),ImportDecl:YO("constant","ImportSpec"),Parameter:YO("var"),__proto__:null};function JD(t,e){let n=eN.get(e);if(n)return n;let r=[],i=!0;function s(o,a){let l=t.sliceString(o.from,o.to);r.push({label:l,type:a})}return e.cursor(Or.IncludeAnonymous).iterate(o=>{if(i)i=!1;else if(o.name){let a=BIe[o.name];if(a&&a(o,s)||KD.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of JD(t,o.node))r.push(a);return!1}}),eN.set(e,r),r}const tN=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,eZ=["String","LineComment","BlockComment","DefName","LabelName","FieldName",".","?."],UIe=t=>{let e=pr(t.state).resolveInner(t.pos,-1);if(eZ.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&tN.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)KD.has(i.name)&&(r=r.concat(JD(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:tN}},Yx=Ns.define({name:"go",parser:VIe.configure({props:[uo.add({IfStatement:ki({except:/^\s*({|else\b)/}),LabeledStatement:vb,"SwitchBlock SelectBlock":t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n||r?0:t.unit)},Block:kl({closing:"}"}),BlockComment:()=>null,Statement:ki({except:/^{/})}),Vs.add({"Block SwitchBlock SelectBlock LiteralValue InterfaceType StructType SpecList":Zl,BlockComment(t){return{from:t.from+2,to:t.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case\b|default\b|\})$/}});let qIe=t=>({label:t,type:"keyword"});const DIe="interface struct chan map package go return break continue goto fallthrough else defer range true false nil".split(" ").map(qIe);function ZIe(){let t=YIe.concat(DIe);return new oo(Yx,[Yx.data.of({autocomplete:_b(eZ,zg(t))}),Yx.data.of({autocomplete:UIe})])}const GIe="_fileContentView_ryksq_1",FIe="_editorBanner_ryksq_8",HIe="_header_ryksq_18",KIe="_headerLeft_ryksq_28",JIe="_headerRight_ryksq_36",eLe="_backBtn_ryksq_43",tLe="_filePath_ryksq_64",nLe="_fileSize_ryksq_72",rLe="_saveBtn_ryksq_78",iLe="_saveStatus_ryksq_104",sLe="_saveStatusSaved_ryksq_110",oLe="_saveStatusFailed_ryksq_114",aLe="_contentContainer_ryksq_118",lLe="_editorWrapper_ryksq_127",cLe="_lineNumCol_ryksq_135",uLe="_lineNumRow_ryksq_145",dLe="_editorCol_ryksq_155",OLe="_loading_ryksq_175",hLe="_error_ryksq_185",Ni={fileContentView:GIe,editorBanner:FIe,header:HIe,headerLeft:KIe,headerRight:JIe,backBtn:eLe,filePath:tLe,fileSize:nLe,saveBtn:rLe,saveStatus:iLe,saveStatusSaved:sLe,saveStatusFailed:oLe,contentContainer:aLe,editorWrapper:lLe,lineNumCol:cLe,lineNumRow:uLe,editorCol:dLe,loading:OLe,error:hLe},nN={js:Wp,jsx:Wp,ts:Wp,tsx:Wp,py:q6e,java:H6e,c:AO,cpp:AO,cc:AO,cxx:AO,h:AO,hpp:AO,go:ZIe,rs:Wze,php:IMe,html:M0,htm:M0,xml:M0,svg:M0,json:dNe,yml:CM,yaml:CM,md:YM,markdown:YM,css:Ap,scss:Ap,sass:Ap,less:Ap,sql:mIe};function fLe(t){var n;const e=(n=t.split(".").pop())==null?void 0:n.toLowerCase();return nN[e]?[nN[e]()]:[]}function pLe(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}const mLe=Pt.theme({"&":{backgroundColor:"#0d0d0d",color:"#e0e0e0",height:"100%",overflow:"visible"},".cm-gutters:not(.cm-minimap-gutter)":{display:"none"},"& .cm-scroller":{position:"absolute",inset:"0",fontFamily:"'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace",fontSize:"13px",lineHeight:"1.5"},".cm-minimap-gutter":{background:"#0f0f0f",borderLeft:"1px solid #262626"},".cm-minimap-overlay":{border:"1px solid rgba(128, 144, 178, 0.6)",background:"rgba(95, 110, 145, 0.15)",borderRadius:"2px",transition:"opacity 0.2s ease"},".cm-minimap-gutter:hover .cm-minimap-overlay":{border:"1px solid rgba(128, 144, 178, 0.85)",background:"rgba(95, 110, 145, 0.25)"},".cm-activeLine":{backgroundColor:"rgba(255, 255, 255, 0.06)"},".cm-cursor":{borderLeftColor:"#e0e0e0"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground":{backgroundColor:"#264f78"}},{dark:!0}),gLe=$f.define([{tag:A.keyword,color:"#ff7b72"},{tag:[A.name,A.deleted,A.character,A.propertyName,A.macroName],color:"#ffa657"},{tag:[A.function(A.variableName),A.labelName],color:"#d2a8ff"},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:"#79c0ff"},{tag:[A.definition(A.name),A.separator],color:"#e0e0e0"},{tag:[A.typeName,A.className,A.number,A.changed,A.annotation,A.modifier,A.self,A.namespace],color:"#ffa657"},{tag:[A.operator,A.operatorKeyword,A.url,A.escape,A.regexp,A.link,A.special(A.string)],color:"#79c0ff"},{tag:[A.meta,A.comment],color:"#8b949e",fontStyle:"italic"},{tag:A.strong,fontWeight:"bold"},{tag:A.emphasis,fontStyle:"italic"},{tag:A.strikethrough,textDecoration:"line-through"},{tag:A.link,color:"#79c0ff",textDecoration:"underline"},{tag:A.heading,fontWeight:"bold",color:"#ffa657"},{tag:[A.atom,A.bool,A.special(A.variableName)],color:"#79c0ff"},{tag:[A.processingInstruction,A.string,A.inserted],color:"#a5d6ff"},{tag:A.invalid,color:"#f85149"}]),vLe=tk(gLe);function $Le({filePath:t,onClose:e,editorSession:n}){const[r,i]=f.useState(null),[s,o]=f.useState(null),[a,l]=f.useState(null),[c,u]=f.useState(0),[d,h]=f.useState(!0),[p,g]=f.useState(null),[v,$]=f.useState(0),b=f.useRef(!0),_=f.useRef(null),Q=f.useRef(null),x=f.useRef(null),w=f.useRef(null),C=f.useRef(null),T=r!==null&&s!==null&&r!==s,z=f.useCallback(async()=>{if(T){g("saving");try{const j=await fetch("/api/file-content",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t,content:s,...n?{editorSession:!0}:{}})});if(!j.ok){const V=await j.json().catch(()=>({}));throw new Error(V.error||`HTTP ${j.status}`)}const L=await j.json();b.current&&(i(s),u(L.size),g("saved"),_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{b.current&&g(null)},2e3))}catch{b.current&&(g("failed"),_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{b.current&&g(null)},3e3))}}},[T,t,s]);Q.current=z;const R=f.useMemo(()=>Pt.updateListener.of(j=>{if(j.geometryChanged||j.viewportChanged){const L=j.view.scrollDOM;x.current&&(x.current.scrollTop=L.scrollTop)}}),[]),W=f.useCallback(j=>{w.current=j;const L=j.scrollDOM,V=()=>{x.current&&(x.current.scrollTop=L.scrollTop)};L.addEventListener("scroll",V),V()},[]),I=f.useCallback(()=>{b.current=!0,i(null),o(null),l(null),h(!0),$(0),fetch(`/api/file-content?path=${encodeURIComponent(t)}${n?"&editorSession=true":""}`).then(j=>j.ok?j.json():j.json().then(L=>{throw new Error(L.error||"Failed to load")}).catch(()=>{throw new Error(`HTTP ${j.status}`)})).then(j=>{b.current&&(i(j.content),o(j.content),u(j.size),$(j.content.split(`
|
|
692
692
|
`).length),h(!1))}).catch(j=>{b.current&&(l(`${de("ui.fileLoadError")}: ${j.message}`),h(!1))})},[t,n]);f.useEffect(()=>(I(),()=>{b.current=!1,_.current&&clearTimeout(_.current)}),[I]);const k=f.useMemo(()=>{const j=[...fLe(t),vLe,R,Jd.of([{key:"Mod-s",run:()=>{var L;return(L=Q.current)==null||L.call(Q),!0}}])];return j.push(Ip.compute(["doc"],L=>({create:V=>({dom:document.createElement("div")}),displayText:"characters",showOverlay:"mouse-over"}))),j},[t,R]),X=f.useCallback(j=>{o(j),$(j.split(`
|
|
693
693
|
`).length)},[]),E=p==="saving"?de("ui.saving"):p==="saved"?de("ui.saved"):p==="failed"?de("ui.saveFailed"):null,N=f.useMemo(()=>{if(v<=0)return null;const j=[];for(let L=1;L<=v;L++)j.push(y.jsx("div",{className:Ni.lineNumRow,children:L},L));return j},[v]);return y.jsxs("div",{className:Ni.fileContentView,children:[n&&y.jsx("div",{className:Ni.editorBanner,children:de("ui.editorSession.banner")}),y.jsxs("div",{className:Ni.header,children:[y.jsxs("div",{className:Ni.headerLeft,children:[y.jsx("button",{className:Ni.backBtn,onClick:e,title:de("ui.backToChat"),children:y.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:y.jsx("polyline",{points:"15 18 9 12 15 6"})})}),y.jsx("span",{className:Ni.filePath,children:t})]}),y.jsxs("div",{className:Ni.headerRight,children:[E&&y.jsx("span",{className:`${Ni.saveStatus} ${p==="failed"?Ni.saveStatusFailed:p==="saved"?Ni.saveStatusSaved:""}`,children:E}),y.jsxs("button",{className:Ni.saveBtn,onClick:z,disabled:!T||p==="saving",title:`${de("ui.save")} (Ctrl+S)`,children:[y.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"}),y.jsx("polyline",{points:"17 21 17 13 7 13 7 21"}),y.jsx("polyline",{points:"7 3 7 8 15 8"})]}),de("ui.save")]}),c>0&&y.jsx("span",{className:Ni.fileSize,children:pLe(c)})]})]}),y.jsxs("div",{className:Ni.contentContainer,children:[a&&y.jsx("div",{className:Ni.error,children:a}),d&&!a&&y.jsx("div",{className:Ni.loading,children:de("ui.loading")}),!d&&r!==null&&y.jsxs("div",{className:Ni.editorWrapper,ref:C,children:[y.jsx("div",{className:Ni.lineNumCol,ref:x,children:N}),y.jsx("div",{className:Ni.editorCol,children:y.jsx(mq,{value:r,height:"100%",theme:mLe,extensions:k,onChange:X,onCreateEditor:W,basicSetup:{lineNumbers:!1,foldGutter:!1,highlightActiveLine:!0,highlightSelectionMatches:!0,bracketMatching:!0,autocompletion:!1}})})]})]})]})}const SLe="_gitChanges_1in24_1",bLe="_header_1in24_12",yLe="_headerTitle_1in24_21",_Le="_collapseBtn_1in24_29",QLe="_changesContainer_1in24_48",xLe="_changeItem_1in24_54",wLe="_changeItemSelected_1in24_71",PLe="_dirItem_1in24_75",CLe="_dirArrow_1in24_86",TLe="_dirName_1in24_95",kLe="_status_1in24_100",RLe="_icon_1in24_109",ELe="_fileName_1in24_118",XLe="_loading_1in24_124",zLe="_error_1in24_130",MLe="_empty_1in24_136",ps={gitChanges:SLe,header:bLe,headerTitle:yLe,collapseBtn:_Le,changesContainer:QLe,changeItem:xLe,changeItemSelected:wLe,dirItem:PLe,dirArrow:CLe,dirName:TLe,status:kLe,icon:RLe,fileName:ELe,loading:XLe,error:zLe,empty:MLe},NLe={M:"#e2c08d",A:"#73c991",D:"#f14c4c",R:"#73c991",C:"#73c991",U:"#e2c08d","?":"#73c991"},jLe={js:"#e8d44d",jsx:"#61dafb",ts:"#3178c6",tsx:"#3178c6",json:"#999",md:"#519aba",css:"#a86fd9",scss:"#cd6799",html:"#e34c26",py:"#3572a5",go:"#00add8",rs:"#dea584"};function ILe(t){const e=t.includes(".")?t.split(".").pop().toLowerCase():"",n=jLe[e]||"#888";return y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"1.5",children:[y.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),y.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function LLe(){return y.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"#c09553",stroke:"none",children:y.jsx("path",{d:"M2 6c0-1.1.9-2 2-2h5l2 2h9a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6z"})})}function WLe(t){const e={dirs:{},files:[]};for(const n of t){const r=n.file.split("/");let i=e;for(let s=0;s<r.length-1;s++)i.dirs[r[s]]||(i.dirs[r[s]]={dirs:{},files:[]}),i=i.dirs[r[s]];i.files.push({name:r[r.length-1],status:n.status,fullPath:n.file})}return e}function tZ({name:t,node:e,depth:n,onFileClick:r,selectedFile:i}){const s=Object.keys(e.dirs).sort(),o=[...e.files].sort((a,l)=>a.name.localeCompare(l.name));return y.jsxs(y.Fragment,{children:[t&&y.jsxs("div",{className:ps.dirItem,style:{paddingLeft:8+n*16},children:[y.jsx("span",{className:ps.dirArrow,children:y.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:"rotate(90deg)"},children:y.jsx("polyline",{points:"9 6 15 12 9 18"})})}),y.jsx("span",{className:ps.icon,children:LLe()}),y.jsx("span",{className:ps.dirName,children:t})]}),s.map(a=>y.jsx(tZ,{name:a,node:e.dirs[a],depth:t?n+1:n,onFileClick:r,selectedFile:i},a)),o.map(a=>y.jsxs("div",{className:`${ps.changeItem} ${i===a.fullPath?ps.changeItemSelected:""}`,style:{paddingLeft:8+(t?n+1:n)*16},onClick:()=>r&&r(a.fullPath),children:[y.jsx("span",{className:ps.icon,children:ILe(a.name)}),y.jsx("span",{className:ps.fileName,children:a.name}),y.jsx("span",{className:ps.status,style:{color:NLe[a.status]||"#888"},children:a.status})]},a.fullPath))]})}function ALe({onClose:t,onFileClick:e}){const[n,r]=f.useState(null),[i,s]=f.useState(null),[o,a]=f.useState(!0),[l,c]=f.useState(null),u=f.useRef(!0);return f.useEffect(()=>(u.current=!0,a(!0),fetch(Vn("/api/git-status")).then(d=>d.ok?d.json():Promise.reject()).then(d=>{u.current&&(r(d.changes||[]),a(!1))}).catch(()=>{u.current&&(s("Failed to load git status"),a(!1))}),()=>{u.current=!1}),[]),y.jsxs("div",{className:ps.gitChanges,children:[y.jsxs("div",{className:ps.header,children:[y.jsx("span",{className:ps.headerTitle,children:de("ui.gitChanges")}),y.jsx("button",{className:ps.collapseBtn,onClick:t,title:"Close",children:y.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[y.jsx("polyline",{points:"11 17 6 12 11 7"}),y.jsx("polyline",{points:"18 17 13 12 18 7"})]})})]}),y.jsxs("div",{className:ps.changesContainer,children:[o&&y.jsx("div",{className:ps.loading,children:"Loading..."}),i&&y.jsx("div",{className:ps.error,children:i}),!o&&!i&&n&&n.length===0&&y.jsx("div",{className:ps.empty,children:"No changes"}),!o&&!i&&n&&n.length>0&&y.jsx(tZ,{name:"",node:WLe(n),depth:0,onFileClick:d=>{c(d),e&&e(d)},selectedFile:l})]})]})}var Bx,rN;function VLe(){if(rN)return Bx;rN=1;function t(ce){return ce instanceof Map?ce.clear=ce.delete=ce.set=function(){throw new Error("map is read-only")}:ce instanceof Set&&(ce.add=ce.clear=ce.delete=function(){throw new Error("set is read-only")}),Object.freeze(ce),Object.getOwnPropertyNames(ce).forEach(Ce=>{const Ie=ce[Ce],ut=typeof Ie;(ut==="object"||ut==="function")&&!Object.isFrozen(Ie)&&t(Ie)}),ce}class e{constructor(Ce){Ce.data===void 0&&(Ce.data={}),this.data=Ce.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(ce){return ce.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(ce,...Ce){const Ie=Object.create(null);for(const ut in ce)Ie[ut]=ce[ut];return Ce.forEach(function(ut){for(const zt in ut)Ie[zt]=ut[zt]}),Ie}const i="</span>",s=ce=>!!ce.scope,o=(ce,{prefix:Ce})=>{if(ce.startsWith("language:"))return ce.replace("language:","language-");if(ce.includes(".")){const Ie=ce.split(".");return[`${Ce}${Ie.shift()}`,...Ie.map((ut,zt)=>`${ut}${"_".repeat(zt+1)}`)].join(" ")}return`${Ce}${ce}`};class a{constructor(Ce,Ie){this.buffer="",this.classPrefix=Ie.classPrefix,Ce.walk(this)}addText(Ce){this.buffer+=n(Ce)}openNode(Ce){if(!s(Ce))return;const Ie=o(Ce.scope,{prefix:this.classPrefix});this.span(Ie)}closeNode(Ce){s(Ce)&&(this.buffer+=i)}value(){return this.buffer}span(Ce){this.buffer+=`<span class="${Ce}">`}}const l=(ce={})=>{const Ce={children:[]};return Object.assign(Ce,ce),Ce};class c{constructor(){this.rootNode=l(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(Ce){this.top.children.push(Ce)}openNode(Ce){const Ie=l({scope:Ce});this.add(Ie),this.stack.push(Ie)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(Ce){return this.constructor._walk(Ce,this.rootNode)}static _walk(Ce,Ie){return typeof Ie=="string"?Ce.addText(Ie):Ie.children&&(Ce.openNode(Ie),Ie.children.forEach(ut=>this._walk(Ce,ut)),Ce.closeNode(Ie)),Ce}static _collapse(Ce){typeof Ce!="string"&&Ce.children&&(Ce.children.every(Ie=>typeof Ie=="string")?Ce.children=[Ce.children.join("")]:Ce.children.forEach(Ie=>{c._collapse(Ie)}))}}class u extends c{constructor(Ce){super(),this.options=Ce}addText(Ce){Ce!==""&&this.add(Ce)}startScope(Ce){this.openNode(Ce)}endScope(){this.closeNode()}__addSublanguage(Ce,Ie){const ut=Ce.root;Ie&&(ut.scope=`language:${Ie}`),this.add(ut)}toHTML(){return new a(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function d(ce){return ce?typeof ce=="string"?ce:ce.source:null}function h(ce){return v("(?=",ce,")")}function p(ce){return v("(?:",ce,")*")}function g(ce){return v("(?:",ce,")?")}function v(...ce){return ce.map(Ie=>d(Ie)).join("")}function $(ce){const Ce=ce[ce.length-1];return typeof Ce=="object"&&Ce.constructor===Object?(ce.splice(ce.length-1,1),Ce):{}}function b(...ce){return"("+($(ce).capture?"":"?:")+ce.map(ut=>d(ut)).join("|")+")"}function _(ce){return new RegExp(ce.toString()+"|").exec("").length-1}function Q(ce,Ce){const Ie=ce&&ce.exec(Ce);return Ie&&Ie.index===0}const x=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function w(ce,{joinWith:Ce}){let Ie=0;return ce.map(ut=>{Ie+=1;const zt=Ie;let Ke=d(ut),Ve="";for(;Ke.length>0;){const Le=x.exec(Ke);if(!Le){Ve+=Ke;break}Ve+=Ke.substring(0,Le.index),Ke=Ke.substring(Le.index+Le[0].length),Le[0][0]==="\\"&&Le[1]?Ve+="\\"+String(Number(Le[1])+zt):(Ve+=Le[0],Le[0]==="("&&Ie++)}return Ve}).map(ut=>`(${ut})`).join(Ce)}const C=/\b\B/,T="[a-zA-Z]\\w*",z="[a-zA-Z_]\\w*",R="\\b\\d+(\\.\\d+)?",W="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",I="\\b(0b[01]+)",k="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",X=(ce={})=>{const Ce=/^#![ ]*\//;return ce.binary&&(ce.begin=v(Ce,/.*\b/,ce.binary,/\b.*/)),r({scope:"meta",begin:Ce,end:/$/,relevance:0,"on:begin":(Ie,ut)=>{Ie.index!==0&&ut.ignoreMatch()}},ce)},E={begin:"\\\\[\\s\\S]",relevance:0},N={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[E]},j={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[E]},L={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/},V=function(ce,Ce,Ie={}){const ut=r({scope:"comment",begin:ce,end:Ce,contains:[]},Ie);ut.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 zt=b("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 ut.contains.push({begin:v(/[ ]+/,"(",zt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),ut},B=V("//","$"),q=V("/\\*","\\*/"),U=V("#","$"),D={scope:"number",begin:R,relevance:0},Z={scope:"number",begin:W,relevance:0},H={scope:"number",begin:I,relevance:0},K={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[E,{begin:/\[/,end:/\]/,relevance:0,contains:[E]}]},te={scope:"title",begin:T,relevance:0},le={scope:"title",begin:z,relevance:0},ie={begin:"\\.\\s*"+z,relevance:0};var be=Object.freeze({__proto__:null,APOS_STRING_MODE:N,BACKSLASH_ESCAPE:E,BINARY_NUMBER_MODE:H,BINARY_NUMBER_RE:I,COMMENT:V,C_BLOCK_COMMENT_MODE:q,C_LINE_COMMENT_MODE:B,C_NUMBER_MODE:Z,C_NUMBER_RE:W,END_SAME_AS_BEGIN:function(ce){return Object.assign(ce,{"on:begin":(Ce,Ie)=>{Ie.data._beginMatch=Ce[1]},"on:end":(Ce,Ie)=>{Ie.data._beginMatch!==Ce[1]&&Ie.ignoreMatch()}})},HASH_COMMENT_MODE:U,IDENT_RE:T,MATCH_NOTHING_RE:C,METHOD_GUARD:ie,NUMBER_MODE:D,NUMBER_RE:R,PHRASAL_WORDS_MODE:L,QUOTE_STRING_MODE:j,REGEXP_MODE:K,RE_STARTERS_RE:k,SHEBANG:X,TITLE_MODE:te,UNDERSCORE_IDENT_RE:z,UNDERSCORE_TITLE_MODE:le});function fe(ce,Ce){ce.input[ce.index-1]==="."&&Ce.ignoreMatch()}function ae(ce,Ce){ce.className!==void 0&&(ce.scope=ce.className,delete ce.className)}function me(ce,Ce){Ce&&ce.beginKeywords&&(ce.begin="\\b("+ce.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",ce.__beforeBegin=fe,ce.keywords=ce.keywords||ce.beginKeywords,delete ce.beginKeywords,ce.relevance===void 0&&(ce.relevance=0))}function oe(ce,Ce){Array.isArray(ce.illegal)&&(ce.illegal=b(...ce.illegal))}function Oe(ce,Ce){if(ce.match){if(ce.begin||ce.end)throw new Error("begin & end are not supported with match");ce.begin=ce.match,delete ce.match}}function se(ce,Ce){ce.relevance===void 0&&(ce.relevance=1)}const $e=(ce,Ce)=>{if(!ce.beforeMatch)return;if(ce.starts)throw new Error("beforeMatch cannot be used with starts");const Ie=Object.assign({},ce);Object.keys(ce).forEach(ut=>{delete ce[ut]}),ce.keywords=Ie.keywords,ce.begin=v(Ie.beforeMatch,h(Ie.begin)),ce.starts={relevance:0,contains:[Object.assign(Ie,{endsParent:!0})]},ce.relevance=0,delete Ie.beforeMatch},we=["of","and","for","in","not","or","if","then","parent","list","value"],Xe="keyword";function ze(ce,Ce,Ie=Xe){const ut=Object.create(null);return typeof ce=="string"?zt(Ie,ce.split(" ")):Array.isArray(ce)?zt(Ie,ce):Object.keys(ce).forEach(function(Ke){Object.assign(ut,ze(ce[Ke],Ce,Ke))}),ut;function zt(Ke,Ve){Ce&&(Ve=Ve.map(Le=>Le.toLowerCase())),Ve.forEach(function(Le){const Re=Le.split("|");ut[Re[0]]=[Ke,ge(Re[0],Re[1])]})}}function ge(ce,Ce){return Ce?Number(Ce):Qe(ce)?0:1}function Qe(ce){return we.includes(ce.toLowerCase())}const _e={},xe=ce=>{console.error(ce)},Be=(ce,...Ce)=>{console.log(`WARN: ${ce}`,...Ce)},Ge=(ce,Ce)=>{_e[`${ce}/${Ce}`]||(console.log(`Deprecated as of ${ce}. ${Ce}`),_e[`${ce}/${Ce}`]=!0)},ht=new Error;function lt(ce,Ce,{key:Ie}){let ut=0;const zt=ce[Ie],Ke={},Ve={};for(let Le=1;Le<=Ce.length;Le++)Ve[Le+ut]=zt[Le],Ke[Le+ut]=!0,ut+=_(Ce[Le-1]);ce[Ie]=Ve,ce[Ie]._emit=Ke,ce[Ie]._multi=!0}function nt(ce){if(Array.isArray(ce.begin)){if(ce.skip||ce.excludeBegin||ce.returnBegin)throw xe("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ht;if(typeof ce.beginScope!="object"||ce.beginScope===null)throw xe("beginScope must be object"),ht;lt(ce,ce.begin,{key:"beginScope"}),ce.begin=w(ce.begin,{joinWith:""})}}function ct(ce){if(Array.isArray(ce.end)){if(ce.skip||ce.excludeEnd||ce.returnEnd)throw xe("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ht;if(typeof ce.endScope!="object"||ce.endScope===null)throw xe("endScope must be object"),ht;lt(ce,ce.end,{key:"endScope"}),ce.end=w(ce.end,{joinWith:""})}}function je(ce){ce.scope&&typeof ce.scope=="object"&&ce.scope!==null&&(ce.beginScope=ce.scope,delete ce.scope)}function Ne(ce){je(ce),typeof ce.beginScope=="string"&&(ce.beginScope={_wrap:ce.beginScope}),typeof ce.endScope=="string"&&(ce.endScope={_wrap:ce.endScope}),nt(ce),ct(ce)}function Fe(ce){function Ce(Ve,Le){return new RegExp(d(Ve),"m"+(ce.case_insensitive?"i":"")+(ce.unicodeRegex?"u":"")+(Le?"g":""))}class Ie{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Le,Re){Re.position=this.position++,this.matchIndexes[this.matchAt]=Re,this.regexes.push([Re,Le]),this.matchAt+=_(Le)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Le=this.regexes.map(Re=>Re[1]);this.matcherRe=Ce(w(Le,{joinWith:"|"}),!0),this.lastIndex=0}exec(Le){this.matcherRe.lastIndex=this.lastIndex;const Re=this.matcherRe.exec(Le);if(!Re)return null;const Ae=Re.findIndex((et,wt)=>wt>0&&et!==void 0),Me=this.matchIndexes[Ae];return Re.splice(0,Ae),Object.assign(Re,Me)}}class ut{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Le){if(this.multiRegexes[Le])return this.multiRegexes[Le];const Re=new Ie;return this.rules.slice(Le).forEach(([Ae,Me])=>Re.addRule(Ae,Me)),Re.compile(),this.multiRegexes[Le]=Re,Re}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Le,Re){this.rules.push([Le,Re]),Re.type==="begin"&&this.count++}exec(Le){const Re=this.getMatcher(this.regexIndex);Re.lastIndex=this.lastIndex;let Ae=Re.exec(Le);if(this.resumingScanAtSamePosition()&&!(Ae&&Ae.index===this.lastIndex)){const Me=this.getMatcher(0);Me.lastIndex=this.lastIndex+1,Ae=Me.exec(Le)}return Ae&&(this.regexIndex+=Ae.position+1,this.regexIndex===this.count&&this.considerAll()),Ae}}function zt(Ve){const Le=new ut;return Ve.contains.forEach(Re=>Le.addRule(Re.begin,{rule:Re,type:"begin"})),Ve.terminatorEnd&&Le.addRule(Ve.terminatorEnd,{type:"end"}),Ve.illegal&&Le.addRule(Ve.illegal,{type:"illegal"}),Le}function Ke(Ve,Le){const Re=Ve;if(Ve.isCompiled)return Re;[ae,Oe,Ne,$e].forEach(Me=>Me(Ve,Le)),ce.compilerExtensions.forEach(Me=>Me(Ve,Le)),Ve.__beforeBegin=null,[me,oe,se].forEach(Me=>Me(Ve,Le)),Ve.isCompiled=!0;let Ae=null;return typeof Ve.keywords=="object"&&Ve.keywords.$pattern&&(Ve.keywords=Object.assign({},Ve.keywords),Ae=Ve.keywords.$pattern,delete Ve.keywords.$pattern),Ae=Ae||/\w+/,Ve.keywords&&(Ve.keywords=ze(Ve.keywords,ce.case_insensitive)),Re.keywordPatternRe=Ce(Ae,!0),Le&&(Ve.begin||(Ve.begin=/\B|\b/),Re.beginRe=Ce(Re.begin),!Ve.end&&!Ve.endsWithParent&&(Ve.end=/\B|\b/),Ve.end&&(Re.endRe=Ce(Re.end)),Re.terminatorEnd=d(Re.end)||"",Ve.endsWithParent&&Le.terminatorEnd&&(Re.terminatorEnd+=(Ve.end?"|":"")+Le.terminatorEnd)),Ve.illegal&&(Re.illegalRe=Ce(Ve.illegal)),Ve.contains||(Ve.contains=[]),Ve.contains=[].concat(...Ve.contains.map(function(Me){return rt(Me==="self"?Ve:Me)})),Ve.contains.forEach(function(Me){Ke(Me,Re)}),Ve.starts&&Ke(Ve.starts,Le),Re.matcher=zt(Re),Re}if(ce.compilerExtensions||(ce.compilerExtensions=[]),ce.contains&&ce.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return ce.classNameAliases=r(ce.classNameAliases||{}),Ke(ce)}function qe(ce){return ce?ce.endsWithParent||qe(ce.starts):!1}function rt(ce){return ce.variants&&!ce.cachedVariants&&(ce.cachedVariants=ce.variants.map(function(Ce){return r(ce,{variants:null},Ce)})),ce.cachedVariants?ce.cachedVariants:qe(ce)?r(ce,{starts:ce.starts?r(ce.starts):null}):Object.isFrozen(ce)?r(ce):ce}var Ye="11.11.1";class tt extends Error{constructor(Ce,Ie){super(Ce),this.name="HTMLInjectionError",this.html=Ie}}const ft=n,bt=r,on=Symbol("nomatch"),an=7,Dt=function(ce){const Ce=Object.create(null),Ie=Object.create(null),ut=[];let zt=!0;const Ke="Could not find the language '{}', did you forget to load/include a language module?",Ve={disableAutodetect:!0,name:"Plain text",contains:[]};let Le={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:u};function Re(Pe){return Le.noHighlightRe.test(Pe)}function Ae(Pe){let Ze=Pe.className+" ";Ze+=Pe.parentNode?Pe.parentNode.className:"";const pt=Le.languageDetectRe.exec(Ze);if(pt){const Jt=Je(pt[1]);return Jt||(Be(Ke.replace("{}",pt[1])),Be("Falling back to no-highlight mode for this block.",Pe)),Jt?pt[1]:"no-highlight"}return Ze.split(/\s+/).find(Jt=>Re(Jt)||Je(Jt))}function Me(Pe,Ze,pt){let Jt="",kn="";typeof Ze=="object"?(Jt=Pe,pt=Ze.ignoreIllegals,kn=Ze.language):(Ge("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ge("10.7.0",`Please use highlight(code, options) instead.
|
|
694
694
|
https://github.com/highlightjs/highlight.js/issues/2277`),kn=Pe,Jt=Ze),pt===void 0&&(pt=!0);const jn={code:Jt,language:kn};Kt("before:highlight",jn);const _r=jn.result?jn.result:et(jn.language,jn.code,pt);return _r.code=jn.code,Kt("after:highlight",_r),_r}function et(Pe,Ze,pt,Jt){const kn=Object.create(null);function jn(it,kt){return it.keywords[kt]}function _r(){if(!Zt.keywords){er.addText(_t);return}let it=0;Zt.keywordPatternRe.lastIndex=0;let kt=Zt.keywordPatternRe.exec(_t),en="";for(;kt;){en+=_t.substring(it,kt.index);const vn=mr.case_insensitive?kt[0].toLowerCase():kt[0],sr=jn(Zt,vn);if(sr){const[ti,Ec]=sr;if(er.addText(en),en="",kn[vn]=(kn[vn]||0)+1,kn[vn]<=an&&(gn+=Ec),ti.startsWith("_"))en+=kt[0];else{const Xc=mr.classNameAliases[ti]||ti;cr(kt[0],Xc)}}else en+=kt[0];it=Zt.keywordPatternRe.lastIndex,kt=Zt.keywordPatternRe.exec(_t)}en+=_t.substring(it),er.addText(en)}function Nr(){if(_t==="")return;let it=null;if(typeof Zt.subLanguage=="string"){if(!Ce[Zt.subLanguage]){er.addText(_t);return}it=et(Zt.subLanguage,_t,!0,Zr[Zt.subLanguage]),Zr[Zt.subLanguage]=it._top}else it=Ct(_t,Zt.subLanguage.length?Zt.subLanguage:null);Zt.relevance>0&&(gn+=it.relevance),er.__addSublanguage(it._emitter,it.language)}function lr(){Zt.subLanguage!=null?Nr():_r(),_t=""}function cr(it,kt){it!==""&&(er.startScope(kt),er.addText(it),er.endScope())}function Jr(it,kt){let en=1;const vn=kt.length-1;for(;en<=vn;){if(!it._emit[en]){en++;continue}const sr=mr.classNameAliases[it[en]]||it[en],ti=kt[en];sr?cr(ti,sr):(_t=ti,_r(),_t=""),en++}}function Vr(it,kt){return it.scope&&typeof it.scope=="string"&&er.openNode(mr.classNameAliases[it.scope]||it.scope),it.beginScope&&(it.beginScope._wrap?(cr(_t,mr.classNameAliases[it.beginScope._wrap]||it.beginScope._wrap),_t=""):it.beginScope._multi&&(Jr(it.beginScope,kt),_t="")),Zt=Object.create(it,{parent:{value:Zt}}),Zt}function Xn(it,kt,en){let vn=Q(it.endRe,en);if(vn){if(it["on:end"]){const sr=new e(it);it["on:end"](kt,sr),sr.isMatchIgnored&&(vn=!1)}if(vn){for(;it.endsParent&&it.parent;)it=it.parent;return it}}if(it.endsWithParent)return Xn(it.parent,kt,en)}function It(it){return Zt.matcher.regexIndex===0?(_t+=it[0],1):(gr=!0,0)}function Et(it){const kt=it[0],en=it.rule,vn=new e(en),sr=[en.__beforeBegin,en["on:begin"]];for(const ti of sr)if(ti&&(ti(it,vn),vn.isMatchIgnored))return It(kt);return en.skip?_t+=kt:(en.excludeBegin&&(_t+=kt),lr(),!en.returnBegin&&!en.excludeBegin&&(_t=kt)),Vr(en,it),en.returnBegin?0:kt.length}function zn(it){const kt=it[0],en=Ze.substring(it.index),vn=Xn(Zt,it,en);if(!vn)return on;const sr=Zt;Zt.endScope&&Zt.endScope._wrap?(lr(),cr(kt,Zt.endScope._wrap)):Zt.endScope&&Zt.endScope._multi?(lr(),Jr(Zt.endScope,it)):sr.skip?_t+=kt:(sr.returnEnd||sr.excludeEnd||(_t+=kt),lr(),sr.excludeEnd&&(_t=kt));do Zt.scope&&er.closeNode(),!Zt.skip&&!Zt.subLanguage&&(gn+=Zt.relevance),Zt=Zt.parent;while(Zt!==vn.parent);return vn.starts&&Vr(vn.starts,it),sr.returnEnd?0:kt.length}function Mn(){const it=[];for(let kt=Zt;kt!==mr;kt=kt.parent)kt.scope&&it.unshift(kt.scope);it.forEach(kt=>er.openNode(kt))}let Wn={};function Fn(it,kt){const en=kt&&kt[0];if(_t+=it,en==null)return lr(),0;if(Wn.type==="begin"&&kt.type==="end"&&Wn.index===kt.index&&en===""){if(_t+=Ze.slice(kt.index,kt.index+1),!zt){const vn=new Error(`0 width match regex (${Pe})`);throw vn.languageName=Pe,vn.badRule=Wn.rule,vn}return 1}if(Wn=kt,kt.type==="begin")return Et(kt);if(kt.type==="illegal"&&!pt){const vn=new Error('Illegal lexeme "'+en+'" for mode "'+(Zt.scope||"<unnamed>")+'"');throw vn.mode=Zt,vn}else if(kt.type==="end"){const vn=zn(kt);if(vn!==on)return vn}if(kt.type==="illegal"&&en==="")return _t+=`
|
package/dist/index.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<title>Claude Code Viewer</title>
|
|
7
7
|
<link rel="icon" href="/favicon.ico?v=1">
|
|
8
8
|
<link rel="shortcut icon" href="/favicon.ico?v=1">
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-Bljh1U2F.js"></script>
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/index-DI-cFJZT.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|