cc-viewer 1.6.199 → 1.6.201
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/App-B0Cfe4hA.js +1 -0
- package/dist/assets/{App-fG2r3jFq.css → App-DOYmReD4.css} +1 -1
- package/dist/assets/{AppHeader-pu5K74SB.css → AppHeader-auOOOaQm.css} +2 -2
- package/dist/assets/AppHeader.module-CDgQaFoO.js +2 -0
- package/dist/assets/{Mobile-DnvC6H2O.js → Mobile-CsKFJYE2.js} +1 -1
- package/dist/assets/{_baseUniq-Cnd-_Qe2.js → _baseUniq-C73FOqig.js} +1 -1
- package/dist/assets/{arc-CPVCmYmr.js → arc-DAWkd4Du.js} +1 -1
- package/dist/assets/{architectureDiagram-Q4EWVU46-CTmPWolC.js → architectureDiagram-Q4EWVU46-CXA8GRiC.js} +1 -1
- package/dist/assets/{blockDiagram-DXYQGD6D-BYUa2ljj.js → blockDiagram-DXYQGD6D-BH7SCCtR.js} +1 -1
- package/dist/assets/{c4Diagram-AHTNJAMY-BBfrYhDN.js → c4Diagram-AHTNJAMY-DjidAThD.js} +1 -1
- package/dist/assets/{channel-D1pwh2Yq.js → channel-fMMU54GK.js} +1 -1
- package/dist/assets/{chunk-4BX2VUAB-DYCV-6PI.js → chunk-4BX2VUAB-C7VtouVc.js} +1 -1
- package/dist/assets/{chunk-4TB4RGXK-DZWVouv1.js → chunk-4TB4RGXK-E8ZyU2MN.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-BnetqbRo.js → chunk-55IACEB6-kKpXz88M.js} +1 -1
- package/dist/assets/{chunk-EDXVE4YY-CL4WCxSM.js → chunk-EDXVE4YY-DGxEwZ4m.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-DLmQmJbs.js → chunk-FMBD7UC4-CD8bIwZQ.js} +1 -1
- package/dist/assets/{chunk-OYMX7WX6-B7jkMtrd.js → chunk-OYMX7WX6-gYD4Acaz.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-tscrjv7L.js → chunk-QZHKN3VN-BjwG7rZm.js} +1 -1
- package/dist/assets/{chunk-YZCP3GAM-BreqZYYH.js → chunk-YZCP3GAM-QsYUvoBQ.js} +1 -1
- package/dist/assets/classDiagram-6PBFFD2Q-BIdWZE2B.js +1 -0
- package/dist/assets/classDiagram-v2-HSJHXN6E-BIdWZE2B.js +1 -0
- package/dist/assets/clone-DUPgDT2x.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-BqETFkWe.js → cose-bilkent-S5V4N54A-9ctKMOYC.js} +1 -1
- package/dist/assets/{dagre-KV5264BT-C1fQhqsm.js → dagre-KV5264BT-By2HwLaW.js} +1 -1
- package/dist/assets/{diagram-5BDNPKRD-BQ_AArZ4.js → diagram-5BDNPKRD-BpgOHENA.js} +1 -1
- package/dist/assets/{diagram-G4DWMVQ6-ETR1atoi.js → diagram-G4DWMVQ6-B2x2muJb.js} +1 -1
- package/dist/assets/{diagram-MMDJMWI5-BS5YlnF7.js → diagram-MMDJMWI5-un9PMQTJ.js} +1 -1
- package/dist/assets/{diagram-TYMM5635-DgEDTcSl.js → diagram-TYMM5635-CoSUmrbF.js} +1 -1
- package/dist/assets/{erDiagram-SMLLAGMA-BfJzSJyz.js → erDiagram-SMLLAGMA-D9ycUUrR.js} +1 -1
- package/dist/assets/{flowDiagram-DWJPFMVM-CmZyhVxI.js → flowDiagram-DWJPFMVM-CMwSrS0j.js} +1 -1
- package/dist/assets/{ganttDiagram-T4ZO3ILL-CyCgF8EH.js → ganttDiagram-T4ZO3ILL-dNzPWJ2v.js} +1 -1
- package/dist/assets/{gitGraphDiagram-UUTBAWPF-Ch_lyUYI.js → gitGraphDiagram-UUTBAWPF-5jScxIeV.js} +1 -1
- package/dist/assets/{graph-DONA5GRX.js → graph-CSAV79cR.js} +1 -1
- package/dist/assets/{index-CP_dJQHF.js → index-BnE1kmli.js} +2 -2
- package/dist/assets/{infoDiagram-42DDH7IO-sWbLdJMA.js → infoDiagram-42DDH7IO-BBwe5zCb.js} +1 -1
- package/dist/assets/{ishikawaDiagram-UXIWVN3A-B1-Sul49.js → ishikawaDiagram-UXIWVN3A-DxpzhU4G.js} +1 -1
- package/dist/assets/{journeyDiagram-VCZTEJTY-B2GzVR2v.js → journeyDiagram-VCZTEJTY-BiLOryhx.js} +1 -1
- package/dist/assets/{kanban-definition-6JOO6SKY-BQ369gG9.js → kanban-definition-6JOO6SKY-BwMtkCnE.js} +1 -1
- package/dist/assets/{layout-Dg4txuWO.js → layout-DEZivYZo.js} +1 -1
- package/dist/assets/{linear-CB6_fADN.js → linear-8H25OaNu.js} +1 -1
- package/dist/assets/{mermaid.core-fx56L749.js → mermaid.core-O3WUNQR6.js} +2 -2
- package/dist/assets/{min-Cfm_qmEy.js → min-BDNYdllt.js} +1 -1
- package/dist/assets/{mindmap-definition-QFDTVHPH-CucfYr3R.js → mindmap-definition-QFDTVHPH-DLa1a2PT.js} +1 -1
- package/dist/assets/{pieDiagram-DEJITSTG-B1JuDmET.js → pieDiagram-DEJITSTG-C7a0wkId.js} +1 -1
- package/dist/assets/{quadrantDiagram-34T5L4WZ-D45nu4Jo.js → quadrantDiagram-34T5L4WZ-qaO4n-DR.js} +1 -1
- package/dist/assets/{requirementDiagram-MS252O5E-C4MR71jH.js → requirementDiagram-MS252O5E-B5elAix1.js} +1 -1
- package/dist/assets/{sankeyDiagram-XADWPNL6-BjN93eui.js → sankeyDiagram-XADWPNL6-BxAAO2OT.js} +1 -1
- package/dist/assets/{sequenceDiagram-FGHM5R23-DfNydjTE.js → sequenceDiagram-FGHM5R23-D4epWe89.js} +1 -1
- package/dist/assets/{stateDiagram-FHFEXIEX-Cth1bRU5.js → stateDiagram-FHFEXIEX-DgLET5fE.js} +1 -1
- package/dist/assets/{stateDiagram-v2-QKLJ7IA2-DRKS8TSe.js → stateDiagram-v2-QKLJ7IA2-Ci28Wp9J.js} +1 -1
- package/dist/assets/{timeline-definition-GMOUNBTQ-CGI0k2Go.js → timeline-definition-GMOUNBTQ-8JmSnBLT.js} +1 -1
- package/dist/assets/{vennDiagram-DHZGUBPP-C1-dVDob.js → vennDiagram-DHZGUBPP-DYVoEvAU.js} +1 -1
- package/dist/assets/{wardley-RL74JXVD-Cw6grnZ8.js → wardley-RL74JXVD-DS_huD5U.js} +1 -1
- package/dist/assets/{wardleyDiagram-NUSXRM2D-Dz6uGDTV.js → wardleyDiagram-NUSXRM2D-BldFmHzV.js} +1 -1
- package/dist/assets/{xychartDiagram-5P7HB3ND-B_Pl_Y8E.js → xychartDiagram-5P7HB3ND-DS97a-id.js} +1 -1
- package/dist/index.html +1 -1
- package/interceptor.js +141 -10
- package/package.json +1 -1
- package/proxy.js +8 -0
- package/server.js +20 -7
- package/dist/assets/App-P57OfZoY.js +0 -1
- package/dist/assets/AppHeader.module-BaWqwKOb.js +0 -2
- package/dist/assets/classDiagram-6PBFFD2Q-DNn_1CVl.js +0 -1
- package/dist/assets/classDiagram-v2-HSJHXN6E-DNn_1CVl.js +0 -1
- package/dist/assets/clone-6rNpdByw.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var __defProp=Object.defineProperty,__publicField=(obj,key,value)=>((obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value:value}):obj[key]=value)(obj,"symbol"!=typeof key?key+"":key,value);import{j as jsxRuntimeExports}from"./vendor-codemirror-BiCbU51m.js";import{a as reactExports,I as Icon,b as _extends,R as React,M as Modal,s as staticMethods,B as Badge,d as Button,C as ConfigProvider,e as RefIcon$3,f as RefIcon$4,S as Spin,h as Switch,i as Select,j as RefIcon$5}from"./vendor-antd-CAmbzFZk.js";import{f as fetchAllRepos,a as apiUrl,t,b as buildGitTree,i as isImageFile,I as ImageLightbox,F as FullFileDiffView,c as ImageViewer,d as FileContentView,e as computeTokenStats,g as computeToolUsageStats,h as computeSkillUsageStats,j as computeCacheRebuildStats,k as classifyRequest,s as styles$3,C as ConceptHelp,l as formatTokenCount,A as AppBase,m as isSystemText,n as classifyUserContent,o as isMainAgent,p as styles$4,u as uploadFileAndGetPath,R as RefIcon$1,q as getModelMaxTokens,r as RefIcon$2,v as ChatView,T as TerminalPanel,O as OpenFolderIcon,w as ToolApprovalPanel}from"./AppHeader.module-BaWqwKOb.js";import{i as isIOS,a as isPad,s as setViewMode}from"./index-CP_dJQHF.js";import"./vendor-markdown-Bpu4AByL.js";import"./vendor-xterm-DckPrCx1.js";import"./vendor-highlight-IFTJ9nxW.js";import"./vendor-virtuoso-DfOWZHqr.js";var RollbackOutlined$1={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M793 242H366v-74c0-6.7-7.7-10.4-12.9-6.3l-142 112a8 8 0 000 12.6l142 112c5.2 4.1 12.9.4 12.9-6.3v-74h415v470H175c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h618c35.3 0 64-28.7 64-64V306c0-35.3-28.7-64-64-64z"}}]},name:"rollback",theme:"outlined"},RollbackOutlined=function(props,ref){return reactExports.createElement(Icon,_extends({},props,{ref:ref,icon:RollbackOutlined$1}))},RefIcon=reactExports.forwardRef(RollbackOutlined);const styles$2_container="_container_tjqxo_1",styles$2_fileListSection="_fileListSection_tjqxo_10",styles$2_header="_header_tjqxo_19",styles$2_headerLeft="_headerLeft_tjqxo_28",styles$2_headerTitle="_headerTitle_tjqxo_34",styles$2_fileCount="_fileCount_tjqxo_42",styles$2_closeBtn="_closeBtn_tjqxo_50",styles$2_changesContainer="_changesContainer_tjqxo_66",styles$2_changeItem="_changeItem_tjqxo_73",styles$2_changeItemActive="_changeItemActive_tjqxo_90",styles$2_dirItem="_dirItem_tjqxo_99",styles$2_dirArrow="_dirArrow_tjqxo_110",styles$2_dirName="_dirName_tjqxo_119",styles$2_status="_status_tjqxo_124",styles$2_icon="_icon_tjqxo_133",styles$2_fileName="_fileName_tjqxo_142",styles$2_diffSection="_diffSection_tjqxo_149",styles$2_diffHeader="_diffHeader_tjqxo_157",styles$2_diffFilePath="_diffFilePath_tjqxo_167",styles$2_diffBadge="_diffBadge_tjqxo_177",styles$2_diffContent="_diffContent_tjqxo_189",styles$2_diffPlaceholder="_diffPlaceholder_tjqxo_195",styles$2_statusText="_statusText_tjqxo_206",styles$2_errorText="_errorText_tjqxo_213",styles$2_emptyText="_emptyText_tjqxo_220",styles$2_warningText="_warningText_tjqxo_227",styles$2_fileSizeNote="_fileSizeNote_tjqxo_239",styles$2_statusTextItalic="_statusTextItalic_tjqxo_244",styles$2_imagePreviewWrap="_imagePreviewWrap_tjqxo_248",styles$2_imagePreview="_imagePreview_tjqxo_248",styles$2_rotated90="_rotated90_tjqxo_264",styles$2_repoHeader="_repoHeader_tjqxo_269",styles$2_repoArrow="_repoArrow_tjqxo_288",styles$2_repoArrowExpanded="_repoArrowExpanded_tjqxo_299",styles$2_repoName="_repoName_tjqxo_303",styles$2_repoBadge="_repoBadge_tjqxo_310",STATUS_COLORS={M:"#e2c08d",A:"#73c991",D:"#f14c4c",R:"#73c991",C:"#73c991",U:"#e2c08d","?":"#73c991","??":"#73c991"},STATUS_LABELS={"??":"U"},EXT_COLORS$1={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 getFileIcon$1(name){const ext=name.includes(".")?name.split(".").pop().toLowerCase():"",color=EXT_COLORS$1[ext]||"#888";return jsxRuntimeExports.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:color,strokeWidth:"1.5",children:[jsxRuntimeExports.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntimeExports.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function TreeDir({name:name,node:node,depth:depth,selectedFile:selectedFile,selectedRepo:selectedRepo,repoPath:repoPath,onFileClick:onFileClick}){const dirNames=Object.keys(node.dirs).sort(),files=[...node.files].sort((a,b)=>a.name.localeCompare(b.name));return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[name&&jsxRuntimeExports.jsxs("div",{className:styles$2_dirItem,style:{paddingLeft:8+16*depth},children:[jsxRuntimeExports.jsx("span",{className:styles$2_dirArrow,children:jsxRuntimeExports.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:styles$2_rotated90,children:jsxRuntimeExports.jsx("polyline",{points:"9 6 15 12 9 18"})})}),jsxRuntimeExports.jsx("span",{className:styles$2_icon,children:jsxRuntimeExports.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"#c09553",stroke:"none",children:jsxRuntimeExports.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"})})}),jsxRuntimeExports.jsx("span",{className:styles$2_dirName,children:name})]}),dirNames.map(dir=>jsxRuntimeExports.jsx(TreeDir,{name:dir,node:node.dirs[dir],depth:name?depth+1:depth,selectedFile:selectedFile,selectedRepo:selectedRepo,repoPath:repoPath,onFileClick:onFileClick},dir)),files.map(file=>jsxRuntimeExports.jsxs("div",{className:`${styles$2_changeItem} ${selectedFile===file.fullPath&&selectedRepo===repoPath?styles$2_changeItemActive:""}`,style:{paddingLeft:8+16*(name?depth+1:depth)},onClick:()=>onFileClick&&onFileClick(repoPath,file.fullPath),children:[jsxRuntimeExports.jsx("span",{className:styles$2_icon,children:getFileIcon$1(file.name)}),jsxRuntimeExports.jsx("span",{className:styles$2_fileName,children:file.name}),jsxRuntimeExports.jsx("span",{className:styles$2_status,style:{color:STATUS_COLORS[file.status]||"#888"},children:STATUS_LABELS[file.status]||file.status})]},file.fullPath))]})}function MobileGitDiff({visible:visible,onClose:onClose}){const[repos,setRepos]=reactExports.useState(null),[error,setError]=reactExports.useState(null),[loading,setLoading]=reactExports.useState(!0),[selectedFile,setSelectedFile]=reactExports.useState(null),[selectedRepo,setSelectedRepo]=reactExports.useState(null),[collapsedRepos,setCollapsedRepos]=reactExports.useState(new Set),[diffData,setDiffData]=reactExports.useState(null),[diffError,setDiffError]=reactExports.useState(null),[diffLoading,setDiffLoading]=reactExports.useState(!1),[lightboxOpen,setLightboxOpen]=reactExports.useState(!1),mounted=reactExports.useRef(!0);reactExports.useEffect(()=>{if(mounted.current=!0,visible)return setLoading(!0),setError(null),fetchAllRepos().then(results=>{mounted.current&&(setRepos(results),setLoading(!1))}).catch(()=>{mounted.current&&(setError("Failed to load git status"),setLoading(!1))}),()=>{mounted.current=!1}},[visible]),reactExports.useEffect(()=>{if(!selectedFile||!selectedRepo)return setDiffData(null),void setDiffError(null);setDiffLoading(!0),setDiffData(null),setDiffError(null);const repoParam=selectedRepo&&"."!==selectedRepo?`&repo=${encodeURIComponent(selectedRepo)}`:"";fetch(apiUrl(`/api/git-diff?files=${encodeURIComponent(selectedFile)}${repoParam}`)).then(r=>{if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.json()}).then(data=>{mounted.current&&(data.diffs&&data.diffs[0]?setDiffData(data.diffs[0]):setDiffError("No diff data available"),setDiffLoading(!1))}).catch(err=>{mounted.current&&(setDiffError(`${t("ui.fileLoadError")}: ${err.message}`),setDiffLoading(!1))})},[selectedFile,selectedRepo]);const totalChanges=reactExports.useMemo(()=>repos?repos.reduce((sum,r)=>sum+r.changes.length,0):0,[repos]),isSingleRepo=!repos||repos.length<=1,handleFileClick=(repoPath,filePath)=>{setSelectedFile(filePath),setSelectedRepo(repoPath)},diffDisplayPath=selectedFile&&selectedRepo&&"."!==selectedRepo?`${selectedRepo}/${selectedFile}`:selectedFile;return jsxRuntimeExports.jsxs("div",{className:styles$2_container,children:[jsxRuntimeExports.jsxs("div",{className:styles$2_fileListSection,children:[jsxRuntimeExports.jsxs("div",{className:styles$2_header,children:[jsxRuntimeExports.jsxs("div",{className:styles$2_headerLeft,children:[jsxRuntimeExports.jsx("span",{className:styles$2_headerTitle,children:t("ui.gitChanges")}),jsxRuntimeExports.jsx("span",{className:styles$2_fileCount,children:totalChanges})]}),onClose&&jsxRuntimeExports.jsx("button",{className:styles$2_closeBtn,onClick:onClose,children:jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxRuntimeExports.jsxs("div",{className:styles$2_changesContainer,children:[loading&&jsxRuntimeExports.jsx("div",{className:styles$2_statusText,children:"Loading..."}),error&&jsxRuntimeExports.jsx("div",{className:styles$2_errorText,children:error}),!loading&&!error&&(!repos||0===repos.length)&&jsxRuntimeExports.jsx("div",{className:styles$2_emptyText,children:"No changes"}),!loading&&!error&&repos&&repos.map(repo=>{const collapsed=collapsedRepos.has(repo.path);return isSingleRepo?jsxRuntimeExports.jsx(TreeDir,{name:"",node:buildGitTree(repo.changes),depth:0,selectedFile:selectedFile,selectedRepo:selectedRepo,repoPath:repo.path,onFileClick:handleFileClick},repo.path):jsxRuntimeExports.jsxs(React.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:styles$2_repoHeader,onClick:()=>setCollapsedRepos(prev=>{const next=new Set(prev);return collapsed?next.delete(repo.path):next.add(repo.path),next}),children:[jsxRuntimeExports.jsx("span",{className:`${styles$2_repoArrow} ${collapsed?"":styles$2_repoArrowExpanded}`,children:jsxRuntimeExports.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntimeExports.jsx("polyline",{points:"9 6 15 12 9 18"})})}),jsxRuntimeExports.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-muted)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[jsxRuntimeExports.jsx("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),jsxRuntimeExports.jsx("circle",{cx:"18",cy:"6",r:"3"}),jsxRuntimeExports.jsx("circle",{cx:"6",cy:"18",r:"3"}),jsxRuntimeExports.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),jsxRuntimeExports.jsx("span",{className:styles$2_repoName,children:repo.name}),jsxRuntimeExports.jsx("span",{className:styles$2_repoBadge,children:repo.changes.length})]}),!collapsed&&jsxRuntimeExports.jsx(TreeDir,{name:"",node:buildGitTree(repo.changes),depth:1,selectedFile:selectedFile,selectedRepo:selectedRepo,repoPath:repo.path,onFileClick:handleFileClick})]},repo.path)})]})]}),jsxRuntimeExports.jsx("div",{className:styles$2_diffSection,children:selectedFile?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:styles$2_diffHeader,children:[jsxRuntimeExports.jsx("span",{className:styles$2_diffFilePath,children:diffDisplayPath}),jsxRuntimeExports.jsx("span",{className:styles$2_diffBadge,children:"DIFF"})]}),jsxRuntimeExports.jsxs("div",{className:styles$2_diffContent,children:[diffLoading&&jsxRuntimeExports.jsx("div",{className:styles$2_statusText,children:t("ui.loading")}),diffError&&jsxRuntimeExports.jsx("div",{className:styles$2_errorText,children:diffError}),!diffLoading&&!diffError&&diffData&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:diffData.is_large?jsxRuntimeExports.jsxs("div",{className:styles$2_warningText,children:[jsxRuntimeExports.jsx("p",{children:t("ui.largeFileWarning")}),jsxRuntimeExports.jsxs("p",{className:styles$2_fileSizeNote,children:[t("ui.fileSize"),": ",(diffData.size/1048576).toFixed(2)," MB"]})]}):isImageFile(selectedFile)&&!diffData.is_deleted?jsxRuntimeExports.jsxs("div",{className:styles$2_imagePreviewWrap,children:[jsxRuntimeExports.jsx("img",{className:styles$2_imagePreview,src:apiUrl(`/api/file-raw?path=${encodeURIComponent(diffDisplayPath)}`),alt:selectedFile,onClick:()=>setLightboxOpen(!0)}),lightboxOpen&&jsxRuntimeExports.jsx(ImageLightbox,{src:apiUrl(`/api/file-raw?path=${encodeURIComponent(diffDisplayPath)}`),alt:selectedFile,onClose:()=>setLightboxOpen(!1)})]}):diffData.is_binary?jsxRuntimeExports.jsx("div",{className:`${styles$2_statusText} ${styles$2_statusTextItalic}`,children:t("ui.binaryFileNotice")}):jsxRuntimeExports.jsx(FullFileDiffView,{file_path:selectedFile,old_string:diffData.old_content,new_string:diffData.new_content})})]})]}):jsxRuntimeExports.jsxs("div",{className:styles$2_diffPlaceholder,children:[jsxRuntimeExports.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"#333",strokeWidth:"1.5",children:[jsxRuntimeExports.jsx("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),jsxRuntimeExports.jsx("circle",{cx:"18",cy:"6",r:"3"}),jsxRuntimeExports.jsx("circle",{cx:"6",cy:"18",r:"3"}),jsxRuntimeExports.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),jsxRuntimeExports.jsx("span",{children:t("ui.mobileGitDiffHint")})]})})]})}const styles$1_container="_container_1hzyt_1",styles$1_fileListSection="_fileListSection_1hzyt_10",styles$1_header="_header_1hzyt_19",styles$1_headerLeft="_headerLeft_1hzyt_28",styles$1_headerTitle="_headerTitle_1hzyt_34",styles$1_fileCount="_fileCount_1hzyt_42",styles$1_closeBtn="_closeBtn_1hzyt_50",styles$1_treeContainer="_treeContainer_1hzyt_66",styles$1_treeItem="_treeItem_1hzyt_73",styles$1_treeItemActive="_treeItemActive_1hzyt_90",styles$1_treeItemIgnored="_treeItemIgnored_1hzyt_99",styles$1_arrow="_arrow_1hzyt_103",styles$1_arrowExpanded="_arrowExpanded_1hzyt_113",styles$1_icon="_icon_1hzyt_117",styles$1_fileName="_fileName_1hzyt_126",styles$1_contentSection="_contentSection_1hzyt_133",styles$1_contentPlaceholder="_contentPlaceholder_1hzyt_141",styles$1_statusText="_statusText_1hzyt_152",styles$1_errorText="_errorText_1hzyt_159",styles$1_emptyText="_emptyText_1hzyt_166",EXT_COLORS={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 getFileIcon(name){const ext=name.includes(".")?name.split(".").pop().toLowerCase():"",color=EXT_COLORS[ext]||"#888";return jsxRuntimeExports.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:color,strokeWidth:"1.5",children:[jsxRuntimeExports.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntimeExports.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function MobileTreeNode({item:item,path:path,depth:depth,expandedPaths:expandedPaths,onToggleExpand:onToggleExpand,currentFile:currentFile,onFileClick:onFileClick}){const[children,setChildren]=reactExports.useState(null),[loading,setLoading]=reactExports.useState(!1),childPath=path?`${path}/${item.name}`:item.name,expanded=expandedPaths.has(childPath),isDir="directory"===item.type,isSelected=!isDir&¤tFile===childPath,isGitIgnored=item.gitIgnored||!1;reactExports.useEffect(()=>{isDir&&expanded&&null===children&&!loading&&(setLoading(!0),fetch(apiUrl(`/api/files?path=${encodeURIComponent(childPath)}`)).then(r=>r.ok?r.json():Promise.reject()).then(data=>{setChildren(data),setLoading(!1)}).catch(()=>{setLoading(!1)}))},[expanded]);const handleClick=reactExports.useCallback(()=>{isDir?onToggleExpand(childPath):onFileClick(childPath)},[isDir,childPath,onToggleExpand,onFileClick]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:`${styles$1_treeItem} ${isSelected?styles$1_treeItemActive:""} ${isGitIgnored?styles$1_treeItemIgnored:""}`,style:{paddingLeft:8+16*depth},onClick:handleClick,children:[isDir?jsxRuntimeExports.jsx("span",{className:`${styles$1_arrow} ${expanded?styles$1_arrowExpanded:""}`,children:jsxRuntimeExports.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntimeExports.jsx("polyline",{points:"9 6 15 12 9 18"})})}):jsxRuntimeExports.jsx("span",{style:{width:16,flexShrink:0}}),jsxRuntimeExports.jsx("span",{className:styles$1_icon,children:isDir?jsxRuntimeExports.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"#c09553",stroke:"none",children:jsxRuntimeExports.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"})}):getFileIcon(item.name)}),jsxRuntimeExports.jsx("span",{className:styles$1_fileName,children:item.name}),loading&&jsxRuntimeExports.jsx("span",{style:{fontSize:10,color:"var(--text-disabled)"},children:"..."})]}),isDir&&expanded&&children&&children.map(child=>jsxRuntimeExports.jsx(MobileTreeNode,{item:child,path:childPath,depth:depth+1,expandedPaths:expandedPaths,onToggleExpand:onToggleExpand,currentFile:currentFile,onFileClick:onFileClick},child.name))]})}function MobileFileExplorer({visible:visible,onClose:onClose,targetFile:targetFile}){const[items,setItems]=reactExports.useState(null),[loading,setLoading]=reactExports.useState(!0),[error,setError]=reactExports.useState(null),[expandedPaths,setExpandedPaths]=reactExports.useState(new Set),[currentFile,setCurrentFile]=reactExports.useState(null),mounted=reactExports.useRef(!0),lastTargetRef=reactExports.useRef(null);reactExports.useEffect(()=>(mounted.current=!0,visible?(setLoading(!0),setError(null),fetch(apiUrl("/api/files?path=")).then(r=>r.ok?r.json():Promise.reject()).then(data=>{mounted.current&&(setItems(data),setLoading(!1))}).catch(()=>{mounted.current&&(setError(t("ui.fileLoadError")),setLoading(!1))}),()=>{mounted.current=!1}):(setCurrentFile(null),setExpandedPaths(new Set),void(lastTargetRef.current=null))),[visible]),reactExports.useEffect(()=>{targetFile&&visible&&lastTargetRef.current!==targetFile.file&&(lastTargetRef.current=targetFile.file,setCurrentFile(targetFile.file),targetFile.ancestors&&targetFile.ancestors.length>0&&setExpandedPaths(prev=>{const next=new Set(prev);return targetFile.ancestors.forEach(p=>next.add(p)),next}))},[targetFile,visible]);const handleToggleExpand=reactExports.useCallback(path=>{setExpandedPaths(prev=>{const next=new Set(prev);return next.has(path)?next.delete(path):next.add(path),next})},[]),handleFileClick=reactExports.useCallback(path=>{setCurrentFile(path)},[]),handleFileClose=reactExports.useCallback(()=>{setCurrentFile(null)},[]),itemCount=items?items.length:0;return jsxRuntimeExports.jsxs("div",{className:styles$1_container,children:[jsxRuntimeExports.jsxs("div",{className:styles$1_fileListSection,children:[jsxRuntimeExports.jsxs("div",{className:styles$1_header,children:[jsxRuntimeExports.jsxs("div",{className:styles$1_headerLeft,children:[jsxRuntimeExports.jsx("span",{className:styles$1_headerTitle,children:t("ui.projectFolder")}),jsxRuntimeExports.jsx("span",{className:styles$1_fileCount,children:itemCount})]}),onClose&&jsxRuntimeExports.jsx("button",{className:styles$1_closeBtn,onClick:onClose,children:jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxRuntimeExports.jsxs("div",{className:styles$1_treeContainer,children:[loading&&jsxRuntimeExports.jsx("div",{className:styles$1_statusText,children:t("ui.loading")}),error&&jsxRuntimeExports.jsx("div",{className:styles$1_errorText,children:t("ui.fileLoadError")}),!loading&&!error&&(!items||0===items.length)&&jsxRuntimeExports.jsx("div",{className:styles$1_emptyText,children:t("ui.mobileFileExplorerHint")}),!loading&&!error&&items&&items.map(item=>jsxRuntimeExports.jsx(MobileTreeNode,{item:item,path:"",depth:0,expandedPaths:expandedPaths,onToggleExpand:handleToggleExpand,currentFile:currentFile,onFileClick:handleFileClick},item.name))]})]}),jsxRuntimeExports.jsx("div",{className:styles$1_contentSection,children:currentFile?isImageFile(currentFile)?jsxRuntimeExports.jsx(ImageViewer,{filePath:currentFile,onClose:handleFileClose}):jsxRuntimeExports.jsx(FileContentView,{filePath:currentFile,onClose:handleFileClose}):jsxRuntimeExports.jsxs("div",{className:styles$1_contentPlaceholder,children:[jsxRuntimeExports.jsx("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:jsxRuntimeExports.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"})}),jsxRuntimeExports.jsx("span",{children:t("ui.mobileFileExplorerHint")})]})})]})}const styles_container="_container_1bb9n_1",styles_header="_header_1bb9n_9",styles_headerTitle="_headerTitle_1bb9n_18",styles_closeBtn="_closeBtn_1bb9n_24",styles_content="_content_1bb9n_38",styles_empty="_empty_1bb9n_47",styles_fixedTable="_fixedTable_1bb9n_54",styles_ellipsisCell="_ellipsisCell_1bb9n_58",styles_thLeft="_thLeft_1bb9n_65",styles_colWide="_colWide_1bb9n_69",styles_colNarrow="_colNarrow_1bb9n_73",REASON_KEYS=["ttl","system_change","tools_change","model_change","msg_truncated","msg_modified","key_change"],I18N_MAP={ttl:"cacheLoss.ttl",system_change:"cacheLoss.systemChange",tools_change:"cacheLoss.toolsChange",model_change:"cacheLoss.modelChange",msg_truncated:"cacheLoss.msgTruncated",msg_modified:"cacheLoss.msgModified",key_change:"cacheLoss.keyChange"};function MobileStats({requests:requests=[],visible:visible,onClose:onClose}){const{byModel:byModel,models:models,toolStats:toolStats,skillStats:skillStats,cacheStats:cacheStats,activeReasons:activeReasons,totalCount:totalCount,totalCache:totalCache,hasCacheStats:hasCacheStats,subAgentEntries:subAgentEntries,hasSubAgentStats:hasSubAgentStats,teammateEntries:teammateEntries,hasTeammateStats:hasTeammateStats,isEmpty:isEmpty}=reactExports.useMemo(()=>{const byModel2=computeTokenStats(requests),models2=Object.keys(byModel2),toolStats2=computeToolUsageStats(requests),skillStats2=computeSkillUsageStats(requests),cacheStats2=computeCacheRebuildStats(requests),activeReasons2=REASON_KEYS.filter(k=>cacheStats2[k].count>0),totalCount2=activeReasons2.reduce((sum,k)=>sum+cacheStats2[k].count,0),totalCache2=activeReasons2.reduce((sum,k)=>sum+cacheStats2[k].cacheCreate,0),hasCacheStats2=activeReasons2.length>0,subAgentCounts={},teammateCounts={};for(let i=0;i<requests.length;i++){const cls=classifyRequest(requests[i],requests[i+1]);if("SubAgent"===cls.type){const label=cls.subType||"Other";subAgentCounts[label]=(subAgentCounts[label]||0)+1}else if("Teammate"===cls.type){const label=cls.subType||"Teammate";teammateCounts[label]=(teammateCounts[label]||0)+1}}const subAgentEntries2=Object.entries(subAgentCounts).sort((a,b)=>b[1]-a[1]),hasSubAgentStats2=subAgentEntries2.length>0,teammateEntries2=Object.entries(teammateCounts).sort((a,b)=>b[1]-a[1]),hasTeammateStats2=teammateEntries2.length>0,isEmpty2=0===models2.length&&0===toolStats2.length&&!hasCacheStats2&&!hasSubAgentStats2&&!hasTeammateStats2&&0===skillStats2.length;return{byModel:byModel2,models:models2,toolStats:toolStats2,skillStats:skillStats2,cacheStats:cacheStats2,activeReasons:activeReasons2,totalCount:totalCount2,totalCache:totalCache2,hasCacheStats:hasCacheStats2,subAgentEntries:subAgentEntries2,hasSubAgentStats:hasSubAgentStats2,teammateEntries:teammateEntries2,hasTeammateStats:hasTeammateStats2,isEmpty:isEmpty2}},[requests]);return visible?jsxRuntimeExports.jsxs("div",{className:styles_container,children:[jsxRuntimeExports.jsxs("div",{className:styles_header,children:[jsxRuntimeExports.jsx("span",{className:styles_headerTitle,children:t("ui.tokenStats")}),jsxRuntimeExports.jsx("button",{className:styles_closeBtn,onClick:onClose,children:jsxRuntimeExports.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxRuntimeExports.jsx("div",{className:styles_content,children:isEmpty?jsxRuntimeExports.jsx("div",{className:styles_empty,children:"—"}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[skillStats.length>0&&jsxRuntimeExports.jsxs("div",{className:styles$3.modelCard,children:[jsxRuntimeExports.jsx("div",{className:styles$3.modelName,children:t("ui.skillUsageStats")}),jsxRuntimeExports.jsxs("table",{className:styles$3.statsTable,children:[jsxRuntimeExports.jsx("thead",{children:jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:`${styles$3.th} ${styles_thLeft}`,children:"Skill"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:t("ui.cacheRebuild.count")})]})}),jsxRuntimeExports.jsxs("tbody",{children:[skillStats.map(([name,count])=>jsxRuntimeExports.jsxs("tr",{className:styles$3.rowBorder,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:name}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:count})]},name)),skillStats.length>1&&jsxRuntimeExports.jsxs("tr",{className:styles$3.rebuildTotalRow,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:"Total"}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:skillStats.reduce((s,e)=>s+e[1],0)})]})]})]})]}),hasSubAgentStats&&jsxRuntimeExports.jsxs("div",{className:styles$3.modelCard,children:[jsxRuntimeExports.jsx("div",{className:styles$3.modelName,children:t("ui.subAgentStats")}),jsxRuntimeExports.jsxs("table",{className:styles$3.statsTable,children:[jsxRuntimeExports.jsx("thead",{children:jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:`${styles$3.th} ${styles_thLeft}`,children:"SubAgent"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:t("ui.cacheRebuild.count")})]})}),jsxRuntimeExports.jsxs("tbody",{children:[subAgentEntries.map(([name,count])=>jsxRuntimeExports.jsxs("tr",{className:styles$3.rowBorder,children:[jsxRuntimeExports.jsxs("td",{className:styles$3.label,children:[name," ",jsxRuntimeExports.jsx(ConceptHelp,{doc:`SubAgent-${name}`})]}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:count})]},name)),subAgentEntries.length>1&&jsxRuntimeExports.jsxs("tr",{className:styles$3.rebuildTotalRow,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:"Total"}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:subAgentEntries.reduce((s,e)=>s+e[1],0)})]})]})]})]}),hasTeammateStats&&jsxRuntimeExports.jsxs("div",{className:styles$3.modelCard,children:[jsxRuntimeExports.jsx("div",{className:styles$3.modelName,children:"Teammate"}),jsxRuntimeExports.jsxs("table",{className:styles$3.statsTable,children:[jsxRuntimeExports.jsx("thead",{children:jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:`${styles$3.th} ${styles_thLeft}`,children:"Name"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:t("ui.cacheRebuild.count")})]})}),jsxRuntimeExports.jsxs("tbody",{children:[teammateEntries.map(([name,count])=>jsxRuntimeExports.jsxs("tr",{className:styles$3.rowBorder,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:name}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:count})]},name)),teammateEntries.length>1&&jsxRuntimeExports.jsxs("tr",{className:styles$3.rebuildTotalRow,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:"Total"}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:teammateEntries.reduce((s,e)=>s+e[1],0)})]})]})]})]}),toolStats.length>0&&jsxRuntimeExports.jsxs("div",{className:styles$3.modelCard,children:[jsxRuntimeExports.jsx("div",{className:styles$3.modelName,children:t("ui.toolUsageStats")}),jsxRuntimeExports.jsxs("table",{className:styles$3.statsTable,children:[jsxRuntimeExports.jsx("thead",{children:jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:`${styles$3.th} ${styles_thLeft}`,children:"Tool"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:t("ui.cacheRebuild.count")})]})}),jsxRuntimeExports.jsxs("tbody",{children:[toolStats.map(([name,count])=>jsxRuntimeExports.jsxs("tr",{className:styles$3.rowBorder,children:[jsxRuntimeExports.jsxs("td",{className:styles$3.label,children:[name," ",jsxRuntimeExports.jsx(ConceptHelp,{doc:`Tool-${name}`})]}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:count})]},name)),toolStats.length>1&&jsxRuntimeExports.jsxs("tr",{className:styles$3.rebuildTotalRow,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:"Total"}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:toolStats.reduce((s,e)=>s+e[1],0)})]})]})]})]}),hasCacheStats&&jsxRuntimeExports.jsxs("div",{className:styles$3.modelCard,children:[jsxRuntimeExports.jsxs("div",{className:styles$3.modelName,children:["MainAgent",jsxRuntimeExports.jsx(ConceptHelp,{doc:"MainAgent"})," ",t("ui.cacheRebuildStats"),jsxRuntimeExports.jsx(ConceptHelp,{doc:"CacheRebuild"})]}),jsxRuntimeExports.jsxs("table",{className:`${styles$3.statsTable} ${styles_fixedTable}`,children:[jsxRuntimeExports.jsxs("colgroup",{children:[jsxRuntimeExports.jsx("col",{className:styles_colWide}),jsxRuntimeExports.jsx("col",{className:styles_colNarrow}),jsxRuntimeExports.jsx("col",{className:styles_colNarrow})]}),jsxRuntimeExports.jsx("thead",{children:jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:`${styles$3.th} ${styles_thLeft}`,children:t("ui.cacheRebuild.reason")}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:t("ui.cacheRebuild.count")}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:t("ui.cacheRebuild.cacheCreate")})]})}),jsxRuntimeExports.jsxs("tbody",{children:[activeReasons.map(k=>jsxRuntimeExports.jsxs("tr",{className:styles$3.rowBorder,children:[jsxRuntimeExports.jsx("td",{className:`${styles$3.label} ${styles_ellipsisCell}`,title:t(`ui.${I18N_MAP[k]}`),children:t(`ui.${I18N_MAP[k]}`)}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:cacheStats[k].count}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:formatTokenCount(cacheStats[k].cacheCreate)})]},k)),activeReasons.length>1&&jsxRuntimeExports.jsxs("tr",{className:styles$3.rebuildTotalRow,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:"Total"}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:totalCount}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:formatTokenCount(totalCache)})]})]})]})]}),models.map(model=>{const s=byModel[model],totalInput=s.input+s.cacheCreation+s.cacheRead,cacheHitRate=totalInput>0?(s.cacheRead/totalInput*100).toFixed(1):"0.0";return jsxRuntimeExports.jsxs("div",{className:styles$3.modelCard,children:[jsxRuntimeExports.jsx("div",{className:styles$3.modelName,children:model}),jsxRuntimeExports.jsx("table",{className:styles$3.statsTable,children:jsxRuntimeExports.jsxs("tbody",{children:[jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:"Token"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:"input"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:"output"})]}),jsxRuntimeExports.jsxs("tr",{className:styles$3.rowBorder,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:formatTokenCount(totalInput)}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:formatTokenCount(s.output)})]}),jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:"Cache"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:"create"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:"read"})]}),jsxRuntimeExports.jsxs("tr",{className:styles$3.rowBorder,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:formatTokenCount(s.cacheCreation)}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:formatTokenCount(s.cacheRead)})]}),jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:t("ui.hitRate")}),jsxRuntimeExports.jsxs("td",{colSpan:2,className:styles$3.td,children:[cacheHitRate,"%"]})]})]})})]},model)})]})})]}):null}const _Mobile=class _Mobile extends AppBase{constructor(props){super(props),__publicField(this,"_handleMobileOpenFile",(filePath,ancestors)=>{this.state.localLogFile||this.setState({mobileFileExplorerVisible:!0,mobileFileExplorerTarget:{file:filePath,ancestors:ancestors||[]},mobileGitDiffVisible:!1,mobileTerminalVisible:!1,mobileStatsVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1,mobileChatVisible:!1})}),__publicField(this,"handleExportPromptsTxt",prompts=>{if(!prompts||0===prompts.length)return;const blocks=[];for(const p of prompts){const lines=[],ts=p.timestamp?new Date(p.timestamp).toLocaleString():"";ts&&lines.push(`${ts}:\n`);const textParts=(p.segments||[]).filter(seg=>"text"===seg.type).map(seg=>seg.content);textParts.length>0&&lines.push(textParts.join("\n")),blocks.push(lines.join("\n"))}if(0===blocks.length)return;const blob=new Blob([blocks.join("\n\n\n\n")],{type:"text/plain;charset=utf-8"}),url=URL.createObjectURL(blob),a=document.createElement("a");a.href=url,a.download=`user-prompts-${(new Date).toISOString().slice(0,10)}.txt`,a.click(),URL.revokeObjectURL(url)}),__publicField(this,"handlePendingPermission",data=>{this.setState({globalPermission:data})}),__publicField(this,"handlePendingPlanApproval",data=>{this.setState({globalPlanApproval:data})}),__publicField(this,"handleAutoApproveChange",seconds=>{this.setState({autoApproveSeconds:seconds}),fetch(apiUrl("/api/preferences"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({autoApproveSeconds:seconds})}).catch(()=>{})}),__publicField(this,"_isInternalDrag",e=>e.dataTransfer.types.includes("text/x-preset-reorder")),__publicField(this,"_onDragOver",e=>{if(e.preventDefault(),this._isInternalDrag(e))return;e.target.closest&&e.target.closest("[data-file-explorer]")?this.state.isDragging&&this.setState({isDragging:!1}):this.state.isDragging||this.setState({isDragging:!0})}),__publicField(this,"_onDragLeave",e=>{const layout=this._layoutRef.current;layout&&!layout.contains(e.relatedTarget)&&this.setState({isDragging:!1})}),__publicField(this,"_onDrop",e=>{if(e.preventDefault(),this._isInternalDrag(e))return;this.setState({isDragging:!1});const files=Array.from(e.dataTransfer.files);if(!files.length)return;const toTerminal=this.state.mobileTerminalVisible;Promise.all(files.map(file=>uploadFileAndGetPath(file).then(path=>({name:file.name,path:path})).catch(err=>(staticMethods.error(`${file.name}: ${err.message}`),null)))).then(results=>{const uploaded=results.filter(Boolean);uploaded.length&&(toTerminal?this.setState(prev=>({terminalPendingImages:[...prev.terminalPendingImages,...uploaded.map(r=>({path:r.path,source:"drop"}))]})):this.setState(prev=>({pendingUploadPaths:[...prev.pendingUploadPaths||[],...uploaded.map(r=>`"${r.path}"`)]})))})}),__publicField(this,"handleUploadPathsConsumed",()=>{this.setState({pendingUploadPaths:[]})}),__publicField(this,"_handleTerminalFilePath",path=>{this.setState(prev=>({terminalPendingImages:[...prev.terminalPendingImages,{path:path,source:"terminal"}]}))}),__publicField(this,"_handleRemoveTerminalImage",idx=>{this.setState(prev=>({terminalPendingImages:prev.terminalPendingImages.filter((_,i)=>i!==idx)}))}),__publicField(this,"_handleClearTerminalImages",()=>{this.setState({terminalPendingImages:[]})}),Object.assign(this.state,{mobileMenuVisible:!1,mobileStatsVisible:!1,mobileGitDiffVisible:!1,mobileChatVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1,mobileTerminalVisible:!1,mobileFileExplorerVisible:!1,globalPermission:null,globalPlanApproval:null,autoApproveSeconds:0,hasGit:!0,terminalPendingImages:[]}),this._lastContextPercent=0}componentDidMount(){super.componentDidMount(),fetch(apiUrl("/api/git-repos")).then(r=>r.ok?r.json():Promise.reject()).then(data=>{var _a;(null==(_a=data.repos)?void 0:_a.length)||this.setState({hasGit:!1,mobileGitDiffVisible:!1})}).catch(()=>{fetch(apiUrl("/api/git-status")).then(r=>{r.ok||this.setState({hasGit:!1,mobileGitDiffVisible:!1})}).catch(()=>this.setState({hasGit:!1,mobileGitDiffVisible:!1}))}),isIOS&&!isPad&&window.visualViewport&&(this._onVisualViewportChange=()=>{const el=this._layoutRef.current;if(!el)return;const vv=window.visualViewport;el.style.position="fixed",el.style.top=`${vv.offsetTop}px`,el.style.height=`${vv.height}px`,el.style.width="100%",el.style.left="0"},window.visualViewport.addEventListener("resize",this._onVisualViewportChange),window.visualViewport.addEventListener("scroll",this._onVisualViewportChange),this._onVisualViewportChange()),isPad&&(this._mqlWide=window.matchMedia("(min-width: 1400px)"),this._modeSwitchDialog=null,this._onWideChange=e=>{e.matches?this._modeSwitchDialog=Modal.confirm({title:t("ui.modeSwitchTitle"),content:t("ui.modeSwitchToFullView"),okText:t("ui.ok"),onOk:()=>{this._modeSwitchDialog=null,setViewMode("pc")},onCancel:()=>{this._modeSwitchDialog=null}}):this._modeSwitchDialog&&(this._modeSwitchDialog.destroy(),this._modeSwitchDialog=null)},this._mqlWide.addEventListener("change",this._onWideChange))}componentWillUnmount(){this._onVisualViewportChange&&window.visualViewport&&(window.visualViewport.removeEventListener("resize",this._onVisualViewportChange),window.visualViewport.removeEventListener("scroll",this._onVisualViewportChange)),this._mqlWide&&this._mqlWide.removeEventListener("change",this._onWideChange),this._modeSwitchDialog&&(this._modeSwitchDialog.destroy(),this._modeSwitchDialog=null),super.componentWillUnmount()}static parseSegments(text){const segments=[],regex=/<([a-zA-Z_][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>/g;let match,lastIndex=0;for(;null!==(match=regex.exec(text));){const before=text.slice(lastIndex,match.index).trim();before&&segments.push({type:"text",content:before});const tagName=match[1];if(lastIndex=match.index+match[0].length,_Mobile.COMMAND_TAGS.has(tagName))continue;const innerRegex=new RegExp(`^<${tagName}(?:\\s[^>]*)?>([\\s\\S]*)<\\/${tagName}>$`),innerMatch=match[0].match(innerRegex),content2=innerMatch?innerMatch[1].trim():match[0].trim();segments.push({type:"system",content:content2,label:tagName})}const after=text.slice(lastIndex).trim();return after&&segments.push({type:"text",content:after}),segments}static extractUserTexts(messages){const userMsgs=[],fullTexts=[];let slashCmd=null;for(const msg of messages)if("user"===msg.role)if("string"==typeof msg.content){const text=msg.content.trim();if(!text)continue;if(!isSystemText(text)){if(/Implement the following plan:/i.test(text))continue;userMsgs.push(text),fullTexts.push(text)}}else if(Array.isArray(msg.content)){const{commands:commands,textBlocks:textBlocks}=classifyUserContent(msg.content);commands.length>0&&(slashCmd=commands[commands.length-1]);const userParts=[];for(const b of textBlocks)/Implement the following plan:/i.test((b.text||"").trim())||userParts.push(b.text.trim());const allParts=msg.content.filter(b=>{var _a;return"text"===b.type&&(null==(_a=b.text)?void 0:_a.trim())}).map(b=>b.text.trim());userParts.length>0&&(userMsgs.push(userParts.join("\n")),fullTexts.push(allParts.join("\n")))}return{userMsgs:userMsgs,fullTexts:fullTexts,slashCmd:slashCmd}}extractUserPrompts(requests){var _a;const prompts=[],seen=new Set;let prevSlashCmd=null;const mainAgentRequests=requests.filter(r=>isMainAgent(r));for(let ri=0;ri<mainAgentRequests.length;ri++){const req=mainAgentRequests[ri],messages=(null==(_a=req.body)?void 0:_a.messages)||[],timestamp=req.timestamp||"",{userMsgs:userMsgs,fullTexts:fullTexts,slashCmd:slashCmd}=_Mobile.extractUserTexts(messages);slashCmd&&"/compact"!==slashCmd&&slashCmd!==prevSlashCmd&&prompts.push({type:"prompt",segments:[{type:"text",content:slashCmd}],timestamp:timestamp}),prevSlashCmd=slashCmd;for(let i=0;i<userMsgs.length;i++){const key=userMsgs[i];if(seen.has(key))continue;seen.add(key);const raw=fullTexts[i]||key;prompts.push({type:"prompt",segments:_Mobile.parseSegments(raw),timestamp:timestamp})}}return prompts}renderOriginalPrompt(p){const textSegments=p.segments.filter(seg=>"text"===seg.type);return 0===textSegments.length?null:jsxRuntimeExports.jsx("div",{className:styles$4.mobilePromptCard,children:textSegments.map((seg,j)=>jsxRuntimeExports.jsx("pre",{className:styles$4.mobilePromptPreText,children:seg.content},j))})}render(){var _a;const{filteredRequests:filteredRequests,fileLoading:fileLoading,fileLoadingCount:fileLoadingCount,mainAgentSessions:mainAgentSessions}=this.renderPrepare();if(this.state.workspaceMode)return this.renderWorkspaceMode();const mobileIsLocalLog=!!this._isLocalLog;let mobileModelName=null;for(let i=filteredRequests.length-1;i>=0;i--)if(isMainAgent(filteredRequests[i])&&(null==(_a=filteredRequests[i].body)?void 0:_a.model)){mobileModelName=filteredRequests[i].body.model;break}return jsxRuntimeExports.jsxs("div",{className:styles$4.mobileCLIRoot,ref:this._layoutRef,onDragOver:this._onDragOver,onDragLeave:this._onDragLeave,onDrop:this._onDrop,children:[this.state.isDragging&&jsxRuntimeExports.jsx("div",{className:styles$4.dragOverlay,children:jsxRuntimeExports.jsxs("div",{className:styles$4.dragOverlayContent,children:[jsxRuntimeExports.jsx(RefIcon$1,{className:styles$4.dragIcon}),jsxRuntimeExports.jsx("p",{children:t("ui.dragDropHint")})]})}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileCLIHeader,children:[jsxRuntimeExports.jsxs("div",{className:styles$4.mobileCLIHeaderLeft,children:[jsxRuntimeExports.jsx("button",{className:styles$4.mobileMenuBtn,onClick:()=>this.setState(prev=>({mobileMenuVisible:!prev.mobileMenuVisible})),"aria-label":t("ui.mobileMenu"),children:jsxRuntimeExports.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[jsxRuntimeExports.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),jsxRuntimeExports.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),jsxRuntimeExports.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})}),mobileIsLocalLog?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Badge,{status:"processing",color:"green"}),jsxRuntimeExports.jsx("span",{className:styles$4.mobileCLIStatusLabel,children:t("ui.historyLog",{file:this._localLogFile})})]}):(()=>{var _a2,_b,_c;const contextWindow=this.state.contextWindow;let contextPercent=0;if(null!=(null==contextWindow?void 0:contextWindow.used_percentage))contextPercent=Math.min(100,Math.max(0,Math.round(contextWindow.used_percentage/83.5*100)));else if(filteredRequests.length>0)for(let i=filteredRequests.length-1;i>=0;i--)if(isMainAgent(filteredRequests[i])&&(null==(_b=null==(_a2=filteredRequests[i].response)?void 0:_a2.body)?void 0:_b.usage)){const u=filteredRequests[i].response.body.usage,total=(u.input_tokens||0)+(u.cache_creation_input_tokens||0)+(u.cache_read_input_tokens||0),usable=.835*((null==contextWindow?void 0:contextWindow.context_window_size)||getModelMaxTokens((null==(_c=filteredRequests[i].body)?void 0:_c.model)||this.state.settingsModel));usable>0&&total>0&&(contextPercent=Math.min(100,Math.max(0,Math.round(total/usable*100))));break}0===contextPercent&&this._lastContextPercent>0?contextPercent=this._lastContextPercent:this._lastContextPercent=contextPercent;const ctxColor=contextPercent>=80?"var(--color-error-light)":contextPercent>=60?"var(--color-warning-light)":"var(--color-success)",ctxLabel=`${t("ui.liveMonitoring")}${this.state.projectName?`: ${this.state.projectName}`:""}`;return jsxRuntimeExports.jsxs("span",{className:styles$4.mobileCtxTag,style:{borderColor:ctxColor,color:ctxColor},title:ctxLabel,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileCtxTagFill,style:{width:`${contextPercent}%`,backgroundColor:ctxColor}}),jsxRuntimeExports.jsx("span",{className:styles$4.mobileCtxTagContent,children:ctxLabel})]})})()]}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileCLIHeaderRight,children:[mobileIsLocalLog?jsxRuntimeExports.jsx(Button,{type:"text",size:"small",icon:jsxRuntimeExports.jsx(RefIcon,{}),onClick:()=>history.back(),className:styles$4.mobileNavBtn,children:t("ui.mobileGoBack")}):this.state.hasGit?jsxRuntimeExports.jsx(Button,{type:"text",size:"small",icon:jsxRuntimeExports.jsx(RefIcon$2,{}),onClick:()=>this.setState(prev=>({mobileGitDiffVisible:!prev.mobileGitDiffVisible,mobileChatVisible:!1,mobileTerminalVisible:!1,mobileStatsVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1,mobileFileExplorerVisible:!1})),style:{color:this.state.mobileGitDiffVisible?"var(--color-primary)":"var(--text-tertiary)",fontSize:12},children:this.state.mobileGitDiffVisible?t("ui.mobileGitDiffExit"):t("ui.mobileGitDiffBrowse")}):null,!mobileIsLocalLog&&jsxRuntimeExports.jsx(Button,{type:"text",size:"small",icon:jsxRuntimeExports.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("polyline",{points:"4 17 10 11 4 5"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]}),onClick:()=>this.setState(prev=>({mobileTerminalVisible:!prev.mobileTerminalVisible,mobileGitDiffVisible:!1,mobileStatsVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1,mobileFileExplorerVisible:!1})),style:{color:this.state.mobileTerminalVisible?"var(--color-primary)":"var(--text-tertiary)",fontSize:12},children:this.state.mobileTerminalVisible?t("ui.mobileTerminalExit"):t("ui.mobileTerminalBrowse")})]}),this.state.mobileMenuVisible&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:styles$4.mobileMenuOverlay,onClick:()=>this.setState({mobileMenuVisible:!1})}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileMenuDropdown,children:[jsxRuntimeExports.jsxs("button",{className:styles$4.mobileMenuItem,onClick:()=>{this.setState({mobileMenuVisible:!1,mobileLogMgmtVisible:!0,mobileStatsVisible:!1,mobileGitDiffVisible:!1,mobileChatVisible:!1,mobileTerminalVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1,mobileFileExplorerVisible:!1}),this.handleImportLocalLogs()},children:[jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntimeExports.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntimeExports.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsxRuntimeExports.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]}),t("ui.logManagement")]}),jsxRuntimeExports.jsxs("button",{className:styles$4.mobileMenuItem,onClick:()=>{this.setState({mobileMenuVisible:!1,mobileStatsVisible:!0,mobileGitDiffVisible:!1,mobileChatVisible:!1,mobileTerminalVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1,mobileFileExplorerVisible:!1})},children:[jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("rect",{x:"3",y:"3",width:"7",height:"7"}),jsxRuntimeExports.jsx("rect",{x:"14",y:"3",width:"7",height:"7"}),jsxRuntimeExports.jsx("rect",{x:"3",y:"14",width:"7",height:"7"}),jsxRuntimeExports.jsx("rect",{x:"14",y:"14",width:"7",height:"7"})]}),t("ui.tokenStats")]}),jsxRuntimeExports.jsxs("button",{className:styles$4.mobileMenuItem,onClick:()=>{this.setState({mobileMenuVisible:!1,mobileSettingsVisible:!0,mobileStatsVisible:!1,mobileGitDiffVisible:!1,mobileChatVisible:!1,mobileTerminalVisible:!1,mobileLogMgmtVisible:!1,mobilePromptVisible:!1,mobileFileExplorerVisible:!1})},children:[jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"3"}),jsxRuntimeExports.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),t("ui.settings")]}),!mobileIsLocalLog&&jsxRuntimeExports.jsxs("button",{className:styles$4.mobileMenuItem,onClick:()=>{this.setState({mobileMenuVisible:!1,mobileFileExplorerVisible:!0,mobileStatsVisible:!1,mobileGitDiffVisible:!1,mobileChatVisible:!1,mobileTerminalVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1})},children:[jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntimeExports.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),t("ui.projectFolder")]}),jsxRuntimeExports.jsxs("button",{className:styles$4.mobileMenuItem,onClick:()=>{this.setState({mobileMenuVisible:!1,mobilePromptVisible:!0,mobileStatsVisible:!1,mobileGitDiffVisible:!1,mobileChatVisible:!1,mobileTerminalVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobileFileExplorerVisible:!1})},children:[jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntimeExports.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"12",x2:"9",y2:"15"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"12",x2:"15",y2:"15"})]}),t("ui.userPrompt")]})]})]})]}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileCLIBody,children:[!mobileIsLocalLog&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[fileLoading&&jsxRuntimeExports.jsxs("div",{className:styles$4.mobileLoadingOverlay,children:[jsxRuntimeExports.jsx("div",{className:styles$4.mobileLoadingSpinner}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileLoadingLabel,children:[t("ui.loadingChat"),fileLoadingCount>0?` (${fileLoadingCount})`:""]})]}),jsxRuntimeExports.jsx(ConfigProvider,{theme:this.themeConfig,children:jsxRuntimeExports.jsx("div",{className:styles$4.mobileChatInner,children:jsxRuntimeExports.jsx(ChatView,{requests:filteredRequests,mainAgentSessions:mainAgentSessions,streamingLatest:this.state.streamingLatest,userProfile:this.state.userProfile,collapseToolResults:this.state.collapseToolResults,expandThinking:this.state.expandThinking,showFullToolContent:this.state.showFullToolContent,showThinkingSummaries:this.state.showThinkingSummaries,onViewRequest:null,scrollToTimestamp:null,onScrollTsDone:()=>{},cliMode:this.state.cliMode,sdkMode:this.state.sdkMode,terminalVisible:this.state.mobileTerminalVisible,mobileChatVisible:!0,fileLoading:this.state.fileLoading,isStreaming:this.state.isStreaming,hasMoreHistory:this.state.hasMoreHistory,loadingMore:this.state.loadingMore,onLoadMoreHistory:()=>this.loadMoreHistory(),loadingSessionId:this.state.loadingSessionId,onLoadSession:sid=>this.loadSession(sid),onPendingPermission:this.handlePendingPermission,onPendingPlanApproval:this.handlePendingPlanApproval,pendingUploadPaths:this.state.pendingUploadPaths,onUploadPathsConsumed:this.handleUploadPathsConsumed,onMobileOpenFile:this._handleMobileOpenFile})})})]}),!mobileIsLocalLog&&jsxRuntimeExports.jsx("div",{className:`${styles$4.mobileChatOverlay} ${this.state.mobileTerminalVisible?styles$4.mobileChatOverlayVisible:""}`,children:jsxRuntimeExports.jsx(TerminalPanel,{modelName:mobileModelName,onFilePath:this._handleTerminalFilePath,pendingImages:this.state.terminalPendingImages,onRemovePendingImage:this._handleRemoveTerminalImage,onClearPendingImages:this._handleClearTerminalImages})}),jsxRuntimeExports.jsx("div",{className:`${styles$4.mobileGitDiffOverlay} ${this.state.mobileGitDiffVisible?styles$4.mobileGitDiffOverlayVisible:""}`,children:jsxRuntimeExports.jsx("div",{className:styles$4.mobileGitDiffInner,children:jsxRuntimeExports.jsx(MobileGitDiff,{visible:this.state.mobileGitDiffVisible,onClose:()=>this.setState({mobileGitDiffVisible:!1})})})}),jsxRuntimeExports.jsx("div",{className:`${styles$4.mobileFileExplorerOverlay} ${this.state.mobileFileExplorerVisible?styles$4.mobileFileExplorerOverlayVisible:""}`,children:jsxRuntimeExports.jsx("div",{className:styles$4.mobileFileExplorerInner,children:jsxRuntimeExports.jsx(MobileFileExplorer,{visible:this.state.mobileFileExplorerVisible,onClose:()=>this.setState({mobileFileExplorerVisible:!1,mobileFileExplorerTarget:null}),targetFile:this.state.mobileFileExplorerTarget})})}),jsxRuntimeExports.jsx("div",{className:`${styles$4.mobileStatsOverlay} ${this.state.mobileStatsVisible?styles$4.mobileStatsOverlayVisible:""}`,children:jsxRuntimeExports.jsx("div",{className:styles$4.mobileStatsInner,children:jsxRuntimeExports.jsx(MobileStats,{requests:filteredRequests,visible:this.state.mobileStatsVisible,onClose:()=>this.setState({mobileStatsVisible:!1})})})}),jsxRuntimeExports.jsxs("div",{className:`${styles$4.mobileLogMgmtOverlay} ${this.state.mobileLogMgmtVisible?styles$4.mobileLogMgmtOverlayVisible:""}`,children:[jsxRuntimeExports.jsxs("div",{className:styles$4.mobileLogMgmtHeader,children:[jsxRuntimeExports.jsxs("span",{className:styles$4.mobileLogMgmtTitle,children:[jsxRuntimeExports.jsx(OpenFolderIcon,{apiEndpoint:apiUrl("/api/open-log-dir"),title:t("ui.openLogDir"),size:14}),t("ui.importLocalLogs")]}),jsxRuntimeExports.jsx("button",{className:styles$4.mobileLogMgmtClose,onClick:()=>this.setState({mobileLogMgmtVisible:!1,selectedLogs:new Set}),children:jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileLogMgmtActions,children:[jsxRuntimeExports.jsx(Button,{size:"small",type:this.state.selectedLogs.size>=2?"primary":"default",disabled:this.state.selectedLogs.size<2,onClick:this.handleMergeLogs,style:this.state.selectedLogs.size<2?{color:"var(--text-muted)",borderColor:"var(--border-light)"}:void 0,children:t("ui.mergeLogs")}),jsxRuntimeExports.jsx(Button,{size:"small",icon:jsxRuntimeExports.jsx(RefIcon$3,{}),disabled:0===this.state.selectedLogs.size,onClick:this.handleDeleteLogs,style:0===this.state.selectedLogs.size?{color:"var(--text-muted)",borderColor:"var(--border-light)"}:{color:"var(--color-error-light)",borderColor:"var(--color-error-light)"},children:t("ui.deleteLogs")}),jsxRuntimeExports.jsx(Button,{size:"small",icon:jsxRuntimeExports.jsx(RefIcon$4,{spin:this.state.refreshingStats}),loading:this.state.refreshingStats,onClick:this.handleRefreshStats,children:t("ui.refreshStats")})]}),jsxRuntimeExports.jsx("div",{className:styles$4.mobileLogMgmtBody,children:this.state.localLogsLoading?jsxRuntimeExports.jsx("div",{className:styles$4.spinCenter,children:jsxRuntimeExports.jsx(Spin,{})}):(()=>{const currentLogs=this.state.localLogs[this.state.currentProject];return currentLogs&&0!==currentLogs.length?jsxRuntimeExports.jsx(ConfigProvider,{theme:this.themeConfig,children:jsxRuntimeExports.jsx("div",{className:styles$4.logListContainer,children:this.renderLogTable(currentLogs,!0)})}):jsxRuntimeExports.jsx("div",{className:styles$4.emptyCenter,children:t("ui.noLogs")})})()})]}),jsxRuntimeExports.jsxs("div",{className:`${styles$4.mobileSettingsOverlay} ${this.state.mobileSettingsVisible?styles$4.mobileSettingsOverlayVisible:""}`,children:[jsxRuntimeExports.jsxs("div",{className:styles$4.mobileLogMgmtHeader,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileLogMgmtTitle,children:t("ui.settings")}),jsxRuntimeExports.jsx("button",{className:styles$4.mobileLogMgmtClose,onClick:()=>this.setState({mobileSettingsVisible:!1}),children:jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileSettingsBody,children:[jsxRuntimeExports.jsx("div",{className:styles$4.mobileSettingsSectionTitle,children:t("ui.chatDisplaySwitches")}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileSettingsRow,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileSettingsLabel,children:t("ui.collapseToolResults")}),jsxRuntimeExports.jsx(Switch,{checked:!!this.state.collapseToolResults,onChange:this.handleCollapseToolResultsChange})]}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileSettingsRow,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileSettingsLabel,children:t("ui.expandThinking")}),jsxRuntimeExports.jsx(Switch,{checked:!!this.state.expandThinking,onChange:this.handleExpandThinkingChange})]}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileSettingsRow,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileSettingsLabel,children:t("ui.showFullToolContent")}),jsxRuntimeExports.jsx(Switch,{checked:!!this.state.showFullToolContent,onChange:this.handleShowFullToolContentChange})]}),jsxRuntimeExports.jsx("div",{className:styles$4.mobileSettingsSectionTitle,children:t("ui.themeColor")}),jsxRuntimeExports.jsx("div",{className:styles$4.mobileSettingsRow,children:jsxRuntimeExports.jsx(Select,{size:"small",value:this.state.themeColor||"dark",onChange:this.handleThemeColorChange,options:[{label:t("ui.themeColor.dark"),value:"dark"},{label:t("ui.themeColor.light"),value:"light"}],style:{width:140}})}),jsxRuntimeExports.jsx("div",{className:styles$4.mobileSettingsSectionTitle,children:t("ui.permission.autoApprove.setting")}),jsxRuntimeExports.jsx("div",{className:styles$4.mobileSettingsRow,children:jsxRuntimeExports.jsx(Select,{size:"small",value:this.state.autoApproveSeconds||0,onChange:this.handleAutoApproveChange,options:[{label:t("ui.permission.autoApprove.off"),value:0},{label:"3s",value:3},{label:"5s",value:5},{label:"10s",value:10},{label:"15s",value:15},{label:"20s",value:20},{label:"30s",value:30},{label:"60s",value:60}],style:{width:100}})})]})]}),jsxRuntimeExports.jsxs("div",{className:`${styles$4.mobilePromptOverlay} ${this.state.mobilePromptVisible?styles$4.mobilePromptOverlayVisible:""}`,children:[jsxRuntimeExports.jsxs("div",{className:styles$4.mobileLogMgmtHeader,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileLogMgmtTitle,children:t("ui.userPrompt")}),jsxRuntimeExports.jsx("button",{className:styles$4.mobileLogMgmtClose,onClick:()=>this.setState({mobilePromptVisible:!1}),children:jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxRuntimeExports.jsx("div",{className:styles$4.mobilePromptBody,children:(()=>{const prompts=this.extractUserPrompts(filteredRequests);return 0===prompts.length?jsxRuntimeExports.jsx("div",{className:styles$4.mobilePromptEmpty,children:t("ui.noPrompt")}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:styles$4.mobilePromptHeader,children:[jsxRuntimeExports.jsxs("span",{className:styles$4.mobilePromptCount,children:[prompts.length," ",t("ui.promptCountUnit")]}),jsxRuntimeExports.jsx(Button,{size:"small",icon:jsxRuntimeExports.jsx(RefIcon$5,{}),onClick:()=>this.handleExportPromptsTxt(prompts),children:t("ui.exportPromptsTxt")})]}),jsxRuntimeExports.jsx("div",{className:styles$4.mobilePromptList,children:prompts.map((p,i)=>jsxRuntimeExports.jsxs("div",{className:styles$4.mobilePromptItem,children:[p.timestamp&&jsxRuntimeExports.jsx("div",{className:styles$4.mobilePromptTimestamp,children:new Date(p.timestamp).toLocaleString()}),this.renderOriginalPrompt(p)]},i))})]})})()})]})]}),this.state.globalPermission&&jsxRuntimeExports.jsx(ToolApprovalPanel,{toolName:this.state.globalPermission.permission.toolName,toolInput:this.state.globalPermission.permission.input,requestId:this.state.globalPermission.permission.id,onAllow:this.state.globalPermission.handlers.allow,onAllowSession:this.state.globalPermission.handlers.allowSession,onDeny:this.state.globalPermission.handlers.deny,visible:!0,global:!0,autoApproveSeconds:this.state.autoApproveSeconds,onAutoApproveChange:this.handleAutoApproveChange,modelName:this.state.globalPermission.modelName}),this.state.globalPlanApproval&&jsxRuntimeExports.jsx(ToolApprovalPanel,{toolName:"ExitPlanMode",toolInput:this.state.globalPlanApproval.plan.input,requestId:this.state.globalPlanApproval.plan.id,onAllow:this.state.globalPlanApproval.handlers.approve,onDeny:id=>this.state.globalPlanApproval.handlers.reject(id,""),visible:!0,global:!0})]})}};__publicField(_Mobile,"COMMAND_TAGS",new Set(["command-name","command-message","command-args","local-command-caveat","local-command-stdout"]));let Mobile=_Mobile;export{Mobile as default};
|
|
1
|
+
var __defProp=Object.defineProperty,__publicField=(obj,key,value)=>((obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value:value}):obj[key]=value)(obj,"symbol"!=typeof key?key+"":key,value);import{j as jsxRuntimeExports}from"./vendor-codemirror-BiCbU51m.js";import{a as reactExports,I as Icon,b as _extends,R as React,M as Modal,s as staticMethods,B as Badge,d as Button,C as ConfigProvider,e as RefIcon$3,f as RefIcon$4,S as Spin,h as Switch,i as Select,j as RefIcon$5}from"./vendor-antd-CAmbzFZk.js";import{f as fetchAllRepos,a as apiUrl,t,b as buildGitTree,i as isImageFile,I as ImageLightbox,F as FullFileDiffView,c as ImageViewer,d as FileContentView,e as computeTokenStats,g as computeToolUsageStats,h as computeSkillUsageStats,j as computeCacheRebuildStats,k as classifyRequest,s as styles$3,C as ConceptHelp,l as formatTokenCount,A as AppBase,m as isSystemText,n as classifyUserContent,o as isMainAgent,p as styles$4,u as uploadFileAndGetPath,R as RefIcon$1,q as getModelMaxTokens,r as RefIcon$2,v as ChatView,T as TerminalPanel,O as OpenFolderIcon,w as ToolApprovalPanel}from"./AppHeader.module-CDgQaFoO.js";import{i as isIOS,a as isPad,s as setViewMode}from"./index-BnE1kmli.js";import"./vendor-markdown-Bpu4AByL.js";import"./vendor-xterm-DckPrCx1.js";import"./vendor-highlight-IFTJ9nxW.js";import"./vendor-virtuoso-DfOWZHqr.js";var RollbackOutlined$1={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M793 242H366v-74c0-6.7-7.7-10.4-12.9-6.3l-142 112a8 8 0 000 12.6l142 112c5.2 4.1 12.9.4 12.9-6.3v-74h415v470H175c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h618c35.3 0 64-28.7 64-64V306c0-35.3-28.7-64-64-64z"}}]},name:"rollback",theme:"outlined"},RollbackOutlined=function(props,ref){return reactExports.createElement(Icon,_extends({},props,{ref:ref,icon:RollbackOutlined$1}))},RefIcon=reactExports.forwardRef(RollbackOutlined);const styles$2_container="_container_tjqxo_1",styles$2_fileListSection="_fileListSection_tjqxo_10",styles$2_header="_header_tjqxo_19",styles$2_headerLeft="_headerLeft_tjqxo_28",styles$2_headerTitle="_headerTitle_tjqxo_34",styles$2_fileCount="_fileCount_tjqxo_42",styles$2_closeBtn="_closeBtn_tjqxo_50",styles$2_changesContainer="_changesContainer_tjqxo_66",styles$2_changeItem="_changeItem_tjqxo_73",styles$2_changeItemActive="_changeItemActive_tjqxo_90",styles$2_dirItem="_dirItem_tjqxo_99",styles$2_dirArrow="_dirArrow_tjqxo_110",styles$2_dirName="_dirName_tjqxo_119",styles$2_status="_status_tjqxo_124",styles$2_icon="_icon_tjqxo_133",styles$2_fileName="_fileName_tjqxo_142",styles$2_diffSection="_diffSection_tjqxo_149",styles$2_diffHeader="_diffHeader_tjqxo_157",styles$2_diffFilePath="_diffFilePath_tjqxo_167",styles$2_diffBadge="_diffBadge_tjqxo_177",styles$2_diffContent="_diffContent_tjqxo_189",styles$2_diffPlaceholder="_diffPlaceholder_tjqxo_195",styles$2_statusText="_statusText_tjqxo_206",styles$2_errorText="_errorText_tjqxo_213",styles$2_emptyText="_emptyText_tjqxo_220",styles$2_warningText="_warningText_tjqxo_227",styles$2_fileSizeNote="_fileSizeNote_tjqxo_239",styles$2_statusTextItalic="_statusTextItalic_tjqxo_244",styles$2_imagePreviewWrap="_imagePreviewWrap_tjqxo_248",styles$2_imagePreview="_imagePreview_tjqxo_248",styles$2_rotated90="_rotated90_tjqxo_264",styles$2_repoHeader="_repoHeader_tjqxo_269",styles$2_repoArrow="_repoArrow_tjqxo_288",styles$2_repoArrowExpanded="_repoArrowExpanded_tjqxo_299",styles$2_repoName="_repoName_tjqxo_303",styles$2_repoBadge="_repoBadge_tjqxo_310",STATUS_COLORS={M:"#e2c08d",A:"#73c991",D:"#f14c4c",R:"#73c991",C:"#73c991",U:"#e2c08d","?":"#73c991","??":"#73c991"},STATUS_LABELS={"??":"U"},EXT_COLORS$1={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 getFileIcon$1(name){const ext=name.includes(".")?name.split(".").pop().toLowerCase():"",color=EXT_COLORS$1[ext]||"#888";return jsxRuntimeExports.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:color,strokeWidth:"1.5",children:[jsxRuntimeExports.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntimeExports.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function TreeDir({name:name,node:node,depth:depth,selectedFile:selectedFile,selectedRepo:selectedRepo,repoPath:repoPath,onFileClick:onFileClick}){const dirNames=Object.keys(node.dirs).sort(),files=[...node.files].sort((a,b)=>a.name.localeCompare(b.name));return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[name&&jsxRuntimeExports.jsxs("div",{className:styles$2_dirItem,style:{paddingLeft:8+16*depth},children:[jsxRuntimeExports.jsx("span",{className:styles$2_dirArrow,children:jsxRuntimeExports.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:styles$2_rotated90,children:jsxRuntimeExports.jsx("polyline",{points:"9 6 15 12 9 18"})})}),jsxRuntimeExports.jsx("span",{className:styles$2_icon,children:jsxRuntimeExports.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"#c09553",stroke:"none",children:jsxRuntimeExports.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"})})}),jsxRuntimeExports.jsx("span",{className:styles$2_dirName,children:name})]}),dirNames.map(dir=>jsxRuntimeExports.jsx(TreeDir,{name:dir,node:node.dirs[dir],depth:name?depth+1:depth,selectedFile:selectedFile,selectedRepo:selectedRepo,repoPath:repoPath,onFileClick:onFileClick},dir)),files.map(file=>jsxRuntimeExports.jsxs("div",{className:`${styles$2_changeItem} ${selectedFile===file.fullPath&&selectedRepo===repoPath?styles$2_changeItemActive:""}`,style:{paddingLeft:8+16*(name?depth+1:depth)},onClick:()=>onFileClick&&onFileClick(repoPath,file.fullPath),children:[jsxRuntimeExports.jsx("span",{className:styles$2_icon,children:getFileIcon$1(file.name)}),jsxRuntimeExports.jsx("span",{className:styles$2_fileName,children:file.name}),jsxRuntimeExports.jsx("span",{className:styles$2_status,style:{color:STATUS_COLORS[file.status]||"#888"},children:STATUS_LABELS[file.status]||file.status})]},file.fullPath))]})}function MobileGitDiff({visible:visible,onClose:onClose}){const[repos,setRepos]=reactExports.useState(null),[error,setError]=reactExports.useState(null),[loading,setLoading]=reactExports.useState(!0),[selectedFile,setSelectedFile]=reactExports.useState(null),[selectedRepo,setSelectedRepo]=reactExports.useState(null),[collapsedRepos,setCollapsedRepos]=reactExports.useState(new Set),[diffData,setDiffData]=reactExports.useState(null),[diffError,setDiffError]=reactExports.useState(null),[diffLoading,setDiffLoading]=reactExports.useState(!1),[lightboxOpen,setLightboxOpen]=reactExports.useState(!1),mounted=reactExports.useRef(!0);reactExports.useEffect(()=>{if(mounted.current=!0,visible)return setLoading(!0),setError(null),fetchAllRepos().then(results=>{mounted.current&&(setRepos(results),setLoading(!1))}).catch(()=>{mounted.current&&(setError("Failed to load git status"),setLoading(!1))}),()=>{mounted.current=!1}},[visible]),reactExports.useEffect(()=>{if(!selectedFile||!selectedRepo)return setDiffData(null),void setDiffError(null);setDiffLoading(!0),setDiffData(null),setDiffError(null);const repoParam=selectedRepo&&"."!==selectedRepo?`&repo=${encodeURIComponent(selectedRepo)}`:"";fetch(apiUrl(`/api/git-diff?files=${encodeURIComponent(selectedFile)}${repoParam}`)).then(r=>{if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.json()}).then(data=>{mounted.current&&(data.diffs&&data.diffs[0]?setDiffData(data.diffs[0]):setDiffError("No diff data available"),setDiffLoading(!1))}).catch(err=>{mounted.current&&(setDiffError(`${t("ui.fileLoadError")}: ${err.message}`),setDiffLoading(!1))})},[selectedFile,selectedRepo]);const totalChanges=reactExports.useMemo(()=>repos?repos.reduce((sum,r)=>sum+r.changes.length,0):0,[repos]),isSingleRepo=!repos||repos.length<=1,handleFileClick=(repoPath,filePath)=>{setSelectedFile(filePath),setSelectedRepo(repoPath)},diffDisplayPath=selectedFile&&selectedRepo&&"."!==selectedRepo?`${selectedRepo}/${selectedFile}`:selectedFile;return jsxRuntimeExports.jsxs("div",{className:styles$2_container,children:[jsxRuntimeExports.jsxs("div",{className:styles$2_fileListSection,children:[jsxRuntimeExports.jsxs("div",{className:styles$2_header,children:[jsxRuntimeExports.jsxs("div",{className:styles$2_headerLeft,children:[jsxRuntimeExports.jsx("span",{className:styles$2_headerTitle,children:t("ui.gitChanges")}),jsxRuntimeExports.jsx("span",{className:styles$2_fileCount,children:totalChanges})]}),onClose&&jsxRuntimeExports.jsx("button",{className:styles$2_closeBtn,onClick:onClose,children:jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxRuntimeExports.jsxs("div",{className:styles$2_changesContainer,children:[loading&&jsxRuntimeExports.jsx("div",{className:styles$2_statusText,children:"Loading..."}),error&&jsxRuntimeExports.jsx("div",{className:styles$2_errorText,children:error}),!loading&&!error&&(!repos||0===repos.length)&&jsxRuntimeExports.jsx("div",{className:styles$2_emptyText,children:"No changes"}),!loading&&!error&&repos&&repos.map(repo=>{const collapsed=collapsedRepos.has(repo.path);return isSingleRepo?jsxRuntimeExports.jsx(TreeDir,{name:"",node:buildGitTree(repo.changes),depth:0,selectedFile:selectedFile,selectedRepo:selectedRepo,repoPath:repo.path,onFileClick:handleFileClick},repo.path):jsxRuntimeExports.jsxs(React.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:styles$2_repoHeader,onClick:()=>setCollapsedRepos(prev=>{const next=new Set(prev);return collapsed?next.delete(repo.path):next.add(repo.path),next}),children:[jsxRuntimeExports.jsx("span",{className:`${styles$2_repoArrow} ${collapsed?"":styles$2_repoArrowExpanded}`,children:jsxRuntimeExports.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntimeExports.jsx("polyline",{points:"9 6 15 12 9 18"})})}),jsxRuntimeExports.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-muted)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{flexShrink:0},children:[jsxRuntimeExports.jsx("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),jsxRuntimeExports.jsx("circle",{cx:"18",cy:"6",r:"3"}),jsxRuntimeExports.jsx("circle",{cx:"6",cy:"18",r:"3"}),jsxRuntimeExports.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),jsxRuntimeExports.jsx("span",{className:styles$2_repoName,children:repo.name}),jsxRuntimeExports.jsx("span",{className:styles$2_repoBadge,children:repo.changes.length})]}),!collapsed&&jsxRuntimeExports.jsx(TreeDir,{name:"",node:buildGitTree(repo.changes),depth:1,selectedFile:selectedFile,selectedRepo:selectedRepo,repoPath:repo.path,onFileClick:handleFileClick})]},repo.path)})]})]}),jsxRuntimeExports.jsx("div",{className:styles$2_diffSection,children:selectedFile?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:styles$2_diffHeader,children:[jsxRuntimeExports.jsx("span",{className:styles$2_diffFilePath,children:diffDisplayPath}),jsxRuntimeExports.jsx("span",{className:styles$2_diffBadge,children:"DIFF"})]}),jsxRuntimeExports.jsxs("div",{className:styles$2_diffContent,children:[diffLoading&&jsxRuntimeExports.jsx("div",{className:styles$2_statusText,children:t("ui.loading")}),diffError&&jsxRuntimeExports.jsx("div",{className:styles$2_errorText,children:diffError}),!diffLoading&&!diffError&&diffData&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:diffData.is_large?jsxRuntimeExports.jsxs("div",{className:styles$2_warningText,children:[jsxRuntimeExports.jsx("p",{children:t("ui.largeFileWarning")}),jsxRuntimeExports.jsxs("p",{className:styles$2_fileSizeNote,children:[t("ui.fileSize"),": ",(diffData.size/1048576).toFixed(2)," MB"]})]}):isImageFile(selectedFile)&&!diffData.is_deleted?jsxRuntimeExports.jsxs("div",{className:styles$2_imagePreviewWrap,children:[jsxRuntimeExports.jsx("img",{className:styles$2_imagePreview,src:apiUrl(`/api/file-raw?path=${encodeURIComponent(diffDisplayPath)}`),alt:selectedFile,onClick:()=>setLightboxOpen(!0)}),lightboxOpen&&jsxRuntimeExports.jsx(ImageLightbox,{src:apiUrl(`/api/file-raw?path=${encodeURIComponent(diffDisplayPath)}`),alt:selectedFile,onClose:()=>setLightboxOpen(!1)})]}):diffData.is_binary?jsxRuntimeExports.jsx("div",{className:`${styles$2_statusText} ${styles$2_statusTextItalic}`,children:t("ui.binaryFileNotice")}):jsxRuntimeExports.jsx(FullFileDiffView,{file_path:selectedFile,old_string:diffData.old_content,new_string:diffData.new_content})})]})]}):jsxRuntimeExports.jsxs("div",{className:styles$2_diffPlaceholder,children:[jsxRuntimeExports.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"#333",strokeWidth:"1.5",children:[jsxRuntimeExports.jsx("line",{x1:"6",y1:"3",x2:"6",y2:"15"}),jsxRuntimeExports.jsx("circle",{cx:"18",cy:"6",r:"3"}),jsxRuntimeExports.jsx("circle",{cx:"6",cy:"18",r:"3"}),jsxRuntimeExports.jsx("path",{d:"M18 9a9 9 0 0 1-9 9"})]}),jsxRuntimeExports.jsx("span",{children:t("ui.mobileGitDiffHint")})]})})]})}const styles$1_container="_container_1hzyt_1",styles$1_fileListSection="_fileListSection_1hzyt_10",styles$1_header="_header_1hzyt_19",styles$1_headerLeft="_headerLeft_1hzyt_28",styles$1_headerTitle="_headerTitle_1hzyt_34",styles$1_fileCount="_fileCount_1hzyt_42",styles$1_closeBtn="_closeBtn_1hzyt_50",styles$1_treeContainer="_treeContainer_1hzyt_66",styles$1_treeItem="_treeItem_1hzyt_73",styles$1_treeItemActive="_treeItemActive_1hzyt_90",styles$1_treeItemIgnored="_treeItemIgnored_1hzyt_99",styles$1_arrow="_arrow_1hzyt_103",styles$1_arrowExpanded="_arrowExpanded_1hzyt_113",styles$1_icon="_icon_1hzyt_117",styles$1_fileName="_fileName_1hzyt_126",styles$1_contentSection="_contentSection_1hzyt_133",styles$1_contentPlaceholder="_contentPlaceholder_1hzyt_141",styles$1_statusText="_statusText_1hzyt_152",styles$1_errorText="_errorText_1hzyt_159",styles$1_emptyText="_emptyText_1hzyt_166",EXT_COLORS={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 getFileIcon(name){const ext=name.includes(".")?name.split(".").pop().toLowerCase():"",color=EXT_COLORS[ext]||"#888";return jsxRuntimeExports.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:color,strokeWidth:"1.5",children:[jsxRuntimeExports.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntimeExports.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function MobileTreeNode({item:item,path:path,depth:depth,expandedPaths:expandedPaths,onToggleExpand:onToggleExpand,currentFile:currentFile,onFileClick:onFileClick}){const[children,setChildren]=reactExports.useState(null),[loading,setLoading]=reactExports.useState(!1),childPath=path?`${path}/${item.name}`:item.name,expanded=expandedPaths.has(childPath),isDir="directory"===item.type,isSelected=!isDir&¤tFile===childPath,isGitIgnored=item.gitIgnored||!1;reactExports.useEffect(()=>{isDir&&expanded&&null===children&&!loading&&(setLoading(!0),fetch(apiUrl(`/api/files?path=${encodeURIComponent(childPath)}`)).then(r=>r.ok?r.json():Promise.reject()).then(data=>{setChildren(data),setLoading(!1)}).catch(()=>{setLoading(!1)}))},[expanded]);const handleClick=reactExports.useCallback(()=>{isDir?onToggleExpand(childPath):onFileClick(childPath)},[isDir,childPath,onToggleExpand,onFileClick]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:`${styles$1_treeItem} ${isSelected?styles$1_treeItemActive:""} ${isGitIgnored?styles$1_treeItemIgnored:""}`,style:{paddingLeft:8+16*depth},onClick:handleClick,children:[isDir?jsxRuntimeExports.jsx("span",{className:`${styles$1_arrow} ${expanded?styles$1_arrowExpanded:""}`,children:jsxRuntimeExports.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntimeExports.jsx("polyline",{points:"9 6 15 12 9 18"})})}):jsxRuntimeExports.jsx("span",{style:{width:16,flexShrink:0}}),jsxRuntimeExports.jsx("span",{className:styles$1_icon,children:isDir?jsxRuntimeExports.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"#c09553",stroke:"none",children:jsxRuntimeExports.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"})}):getFileIcon(item.name)}),jsxRuntimeExports.jsx("span",{className:styles$1_fileName,children:item.name}),loading&&jsxRuntimeExports.jsx("span",{style:{fontSize:10,color:"var(--text-disabled)"},children:"..."})]}),isDir&&expanded&&children&&children.map(child=>jsxRuntimeExports.jsx(MobileTreeNode,{item:child,path:childPath,depth:depth+1,expandedPaths:expandedPaths,onToggleExpand:onToggleExpand,currentFile:currentFile,onFileClick:onFileClick},child.name))]})}function MobileFileExplorer({visible:visible,onClose:onClose,targetFile:targetFile}){const[items,setItems]=reactExports.useState(null),[loading,setLoading]=reactExports.useState(!0),[error,setError]=reactExports.useState(null),[expandedPaths,setExpandedPaths]=reactExports.useState(new Set),[currentFile,setCurrentFile]=reactExports.useState(null),mounted=reactExports.useRef(!0),lastTargetRef=reactExports.useRef(null);reactExports.useEffect(()=>(mounted.current=!0,visible?(setLoading(!0),setError(null),fetch(apiUrl("/api/files?path=")).then(r=>r.ok?r.json():Promise.reject()).then(data=>{mounted.current&&(setItems(data),setLoading(!1))}).catch(()=>{mounted.current&&(setError(t("ui.fileLoadError")),setLoading(!1))}),()=>{mounted.current=!1}):(setCurrentFile(null),setExpandedPaths(new Set),void(lastTargetRef.current=null))),[visible]),reactExports.useEffect(()=>{targetFile&&visible&&lastTargetRef.current!==targetFile.file&&(lastTargetRef.current=targetFile.file,setCurrentFile(targetFile.file),targetFile.ancestors&&targetFile.ancestors.length>0&&setExpandedPaths(prev=>{const next=new Set(prev);return targetFile.ancestors.forEach(p=>next.add(p)),next}))},[targetFile,visible]);const handleToggleExpand=reactExports.useCallback(path=>{setExpandedPaths(prev=>{const next=new Set(prev);return next.has(path)?next.delete(path):next.add(path),next})},[]),handleFileClick=reactExports.useCallback(path=>{setCurrentFile(path)},[]),handleFileClose=reactExports.useCallback(()=>{setCurrentFile(null)},[]),itemCount=items?items.length:0;return jsxRuntimeExports.jsxs("div",{className:styles$1_container,children:[jsxRuntimeExports.jsxs("div",{className:styles$1_fileListSection,children:[jsxRuntimeExports.jsxs("div",{className:styles$1_header,children:[jsxRuntimeExports.jsxs("div",{className:styles$1_headerLeft,children:[jsxRuntimeExports.jsx("span",{className:styles$1_headerTitle,children:t("ui.projectFolder")}),jsxRuntimeExports.jsx("span",{className:styles$1_fileCount,children:itemCount})]}),onClose&&jsxRuntimeExports.jsx("button",{className:styles$1_closeBtn,onClick:onClose,children:jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxRuntimeExports.jsxs("div",{className:styles$1_treeContainer,children:[loading&&jsxRuntimeExports.jsx("div",{className:styles$1_statusText,children:t("ui.loading")}),error&&jsxRuntimeExports.jsx("div",{className:styles$1_errorText,children:t("ui.fileLoadError")}),!loading&&!error&&(!items||0===items.length)&&jsxRuntimeExports.jsx("div",{className:styles$1_emptyText,children:t("ui.mobileFileExplorerHint")}),!loading&&!error&&items&&items.map(item=>jsxRuntimeExports.jsx(MobileTreeNode,{item:item,path:"",depth:0,expandedPaths:expandedPaths,onToggleExpand:handleToggleExpand,currentFile:currentFile,onFileClick:handleFileClick},item.name))]})]}),jsxRuntimeExports.jsx("div",{className:styles$1_contentSection,children:currentFile?isImageFile(currentFile)?jsxRuntimeExports.jsx(ImageViewer,{filePath:currentFile,onClose:handleFileClose}):jsxRuntimeExports.jsx(FileContentView,{filePath:currentFile,onClose:handleFileClose}):jsxRuntimeExports.jsxs("div",{className:styles$1_contentPlaceholder,children:[jsxRuntimeExports.jsx("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:jsxRuntimeExports.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"})}),jsxRuntimeExports.jsx("span",{children:t("ui.mobileFileExplorerHint")})]})})]})}const styles_container="_container_1bb9n_1",styles_header="_header_1bb9n_9",styles_headerTitle="_headerTitle_1bb9n_18",styles_closeBtn="_closeBtn_1bb9n_24",styles_content="_content_1bb9n_38",styles_empty="_empty_1bb9n_47",styles_fixedTable="_fixedTable_1bb9n_54",styles_ellipsisCell="_ellipsisCell_1bb9n_58",styles_thLeft="_thLeft_1bb9n_65",styles_colWide="_colWide_1bb9n_69",styles_colNarrow="_colNarrow_1bb9n_73",REASON_KEYS=["ttl","system_change","tools_change","model_change","msg_truncated","msg_modified","key_change"],I18N_MAP={ttl:"cacheLoss.ttl",system_change:"cacheLoss.systemChange",tools_change:"cacheLoss.toolsChange",model_change:"cacheLoss.modelChange",msg_truncated:"cacheLoss.msgTruncated",msg_modified:"cacheLoss.msgModified",key_change:"cacheLoss.keyChange"};function MobileStats({requests:requests=[],visible:visible,onClose:onClose}){const{byModel:byModel,models:models,toolStats:toolStats,skillStats:skillStats,cacheStats:cacheStats,activeReasons:activeReasons,totalCount:totalCount,totalCache:totalCache,hasCacheStats:hasCacheStats,subAgentEntries:subAgentEntries,hasSubAgentStats:hasSubAgentStats,teammateEntries:teammateEntries,hasTeammateStats:hasTeammateStats,isEmpty:isEmpty}=reactExports.useMemo(()=>{const byModel2=computeTokenStats(requests),models2=Object.keys(byModel2),toolStats2=computeToolUsageStats(requests),skillStats2=computeSkillUsageStats(requests),cacheStats2=computeCacheRebuildStats(requests),activeReasons2=REASON_KEYS.filter(k=>cacheStats2[k].count>0),totalCount2=activeReasons2.reduce((sum,k)=>sum+cacheStats2[k].count,0),totalCache2=activeReasons2.reduce((sum,k)=>sum+cacheStats2[k].cacheCreate,0),hasCacheStats2=activeReasons2.length>0,subAgentCounts={},teammateCounts={};for(let i=0;i<requests.length;i++){const cls=classifyRequest(requests[i],requests[i+1]);if("SubAgent"===cls.type){const label=cls.subType||"Other";subAgentCounts[label]=(subAgentCounts[label]||0)+1}else if("Teammate"===cls.type){const label=cls.subType||"Teammate";teammateCounts[label]=(teammateCounts[label]||0)+1}}const subAgentEntries2=Object.entries(subAgentCounts).sort((a,b)=>b[1]-a[1]),hasSubAgentStats2=subAgentEntries2.length>0,teammateEntries2=Object.entries(teammateCounts).sort((a,b)=>b[1]-a[1]),hasTeammateStats2=teammateEntries2.length>0,isEmpty2=0===models2.length&&0===toolStats2.length&&!hasCacheStats2&&!hasSubAgentStats2&&!hasTeammateStats2&&0===skillStats2.length;return{byModel:byModel2,models:models2,toolStats:toolStats2,skillStats:skillStats2,cacheStats:cacheStats2,activeReasons:activeReasons2,totalCount:totalCount2,totalCache:totalCache2,hasCacheStats:hasCacheStats2,subAgentEntries:subAgentEntries2,hasSubAgentStats:hasSubAgentStats2,teammateEntries:teammateEntries2,hasTeammateStats:hasTeammateStats2,isEmpty:isEmpty2}},[requests]);return visible?jsxRuntimeExports.jsxs("div",{className:styles_container,children:[jsxRuntimeExports.jsxs("div",{className:styles_header,children:[jsxRuntimeExports.jsx("span",{className:styles_headerTitle,children:t("ui.tokenStats")}),jsxRuntimeExports.jsx("button",{className:styles_closeBtn,onClick:onClose,children:jsxRuntimeExports.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxRuntimeExports.jsx("div",{className:styles_content,children:isEmpty?jsxRuntimeExports.jsx("div",{className:styles_empty,children:"—"}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[skillStats.length>0&&jsxRuntimeExports.jsxs("div",{className:styles$3.modelCard,children:[jsxRuntimeExports.jsx("div",{className:styles$3.modelName,children:t("ui.skillUsageStats")}),jsxRuntimeExports.jsxs("table",{className:styles$3.statsTable,children:[jsxRuntimeExports.jsx("thead",{children:jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:`${styles$3.th} ${styles_thLeft}`,children:"Skill"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:t("ui.cacheRebuild.count")})]})}),jsxRuntimeExports.jsxs("tbody",{children:[skillStats.map(([name,count])=>jsxRuntimeExports.jsxs("tr",{className:styles$3.rowBorder,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:name}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:count})]},name)),skillStats.length>1&&jsxRuntimeExports.jsxs("tr",{className:styles$3.rebuildTotalRow,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:"Total"}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:skillStats.reduce((s,e)=>s+e[1],0)})]})]})]})]}),hasSubAgentStats&&jsxRuntimeExports.jsxs("div",{className:styles$3.modelCard,children:[jsxRuntimeExports.jsx("div",{className:styles$3.modelName,children:t("ui.subAgentStats")}),jsxRuntimeExports.jsxs("table",{className:styles$3.statsTable,children:[jsxRuntimeExports.jsx("thead",{children:jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:`${styles$3.th} ${styles_thLeft}`,children:"SubAgent"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:t("ui.cacheRebuild.count")})]})}),jsxRuntimeExports.jsxs("tbody",{children:[subAgentEntries.map(([name,count])=>jsxRuntimeExports.jsxs("tr",{className:styles$3.rowBorder,children:[jsxRuntimeExports.jsxs("td",{className:styles$3.label,children:[name," ",jsxRuntimeExports.jsx(ConceptHelp,{doc:`SubAgent-${name}`})]}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:count})]},name)),subAgentEntries.length>1&&jsxRuntimeExports.jsxs("tr",{className:styles$3.rebuildTotalRow,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:"Total"}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:subAgentEntries.reduce((s,e)=>s+e[1],0)})]})]})]})]}),hasTeammateStats&&jsxRuntimeExports.jsxs("div",{className:styles$3.modelCard,children:[jsxRuntimeExports.jsx("div",{className:styles$3.modelName,children:"Teammate"}),jsxRuntimeExports.jsxs("table",{className:styles$3.statsTable,children:[jsxRuntimeExports.jsx("thead",{children:jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:`${styles$3.th} ${styles_thLeft}`,children:"Name"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:t("ui.cacheRebuild.count")})]})}),jsxRuntimeExports.jsxs("tbody",{children:[teammateEntries.map(([name,count])=>jsxRuntimeExports.jsxs("tr",{className:styles$3.rowBorder,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:name}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:count})]},name)),teammateEntries.length>1&&jsxRuntimeExports.jsxs("tr",{className:styles$3.rebuildTotalRow,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:"Total"}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:teammateEntries.reduce((s,e)=>s+e[1],0)})]})]})]})]}),toolStats.length>0&&jsxRuntimeExports.jsxs("div",{className:styles$3.modelCard,children:[jsxRuntimeExports.jsx("div",{className:styles$3.modelName,children:t("ui.toolUsageStats")}),jsxRuntimeExports.jsxs("table",{className:styles$3.statsTable,children:[jsxRuntimeExports.jsx("thead",{children:jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:`${styles$3.th} ${styles_thLeft}`,children:"Tool"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:t("ui.cacheRebuild.count")})]})}),jsxRuntimeExports.jsxs("tbody",{children:[toolStats.map(([name,count])=>jsxRuntimeExports.jsxs("tr",{className:styles$3.rowBorder,children:[jsxRuntimeExports.jsxs("td",{className:styles$3.label,children:[name," ",jsxRuntimeExports.jsx(ConceptHelp,{doc:`Tool-${name}`})]}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:count})]},name)),toolStats.length>1&&jsxRuntimeExports.jsxs("tr",{className:styles$3.rebuildTotalRow,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:"Total"}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:toolStats.reduce((s,e)=>s+e[1],0)})]})]})]})]}),hasCacheStats&&jsxRuntimeExports.jsxs("div",{className:styles$3.modelCard,children:[jsxRuntimeExports.jsxs("div",{className:styles$3.modelName,children:["MainAgent",jsxRuntimeExports.jsx(ConceptHelp,{doc:"MainAgent"})," ",t("ui.cacheRebuildStats"),jsxRuntimeExports.jsx(ConceptHelp,{doc:"CacheRebuild"})]}),jsxRuntimeExports.jsxs("table",{className:`${styles$3.statsTable} ${styles_fixedTable}`,children:[jsxRuntimeExports.jsxs("colgroup",{children:[jsxRuntimeExports.jsx("col",{className:styles_colWide}),jsxRuntimeExports.jsx("col",{className:styles_colNarrow}),jsxRuntimeExports.jsx("col",{className:styles_colNarrow})]}),jsxRuntimeExports.jsx("thead",{children:jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:`${styles$3.th} ${styles_thLeft}`,children:t("ui.cacheRebuild.reason")}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:t("ui.cacheRebuild.count")}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:t("ui.cacheRebuild.cacheCreate")})]})}),jsxRuntimeExports.jsxs("tbody",{children:[activeReasons.map(k=>jsxRuntimeExports.jsxs("tr",{className:styles$3.rowBorder,children:[jsxRuntimeExports.jsx("td",{className:`${styles$3.label} ${styles_ellipsisCell}`,title:t(`ui.${I18N_MAP[k]}`),children:t(`ui.${I18N_MAP[k]}`)}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:cacheStats[k].count}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:formatTokenCount(cacheStats[k].cacheCreate)})]},k)),activeReasons.length>1&&jsxRuntimeExports.jsxs("tr",{className:styles$3.rebuildTotalRow,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:"Total"}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:totalCount}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:formatTokenCount(totalCache)})]})]})]})]}),models.map(model=>{const s=byModel[model],totalInput=s.input+s.cacheCreation+s.cacheRead,cacheHitRate=totalInput>0?(s.cacheRead/totalInput*100).toFixed(1):"0.0";return jsxRuntimeExports.jsxs("div",{className:styles$3.modelCard,children:[jsxRuntimeExports.jsx("div",{className:styles$3.modelName,children:model}),jsxRuntimeExports.jsx("table",{className:styles$3.statsTable,children:jsxRuntimeExports.jsxs("tbody",{children:[jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:"Token"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:"input"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:"output"})]}),jsxRuntimeExports.jsxs("tr",{className:styles$3.rowBorder,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:formatTokenCount(totalInput)}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:formatTokenCount(s.output)})]}),jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:"Cache"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:"create"}),jsxRuntimeExports.jsx("td",{className:styles$3.th,children:"read"})]}),jsxRuntimeExports.jsxs("tr",{className:styles$3.rowBorder,children:[jsxRuntimeExports.jsx("td",{className:styles$3.label}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:formatTokenCount(s.cacheCreation)}),jsxRuntimeExports.jsx("td",{className:styles$3.td,children:formatTokenCount(s.cacheRead)})]}),jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("td",{className:styles$3.label,children:t("ui.hitRate")}),jsxRuntimeExports.jsxs("td",{colSpan:2,className:styles$3.td,children:[cacheHitRate,"%"]})]})]})})]},model)})]})})]}):null}const _Mobile=class _Mobile extends AppBase{constructor(props){super(props),__publicField(this,"_handleMobileOpenFile",(filePath,ancestors)=>{this.state.localLogFile||this.setState({mobileFileExplorerVisible:!0,mobileFileExplorerTarget:{file:filePath,ancestors:ancestors||[]},mobileGitDiffVisible:!1,mobileTerminalVisible:!1,mobileStatsVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1,mobileChatVisible:!1})}),__publicField(this,"handleExportPromptsTxt",prompts=>{if(!prompts||0===prompts.length)return;const blocks=[];for(const p of prompts){const lines=[],ts=p.timestamp?new Date(p.timestamp).toLocaleString():"";ts&&lines.push(`${ts}:\n`);const textParts=(p.segments||[]).filter(seg=>"text"===seg.type).map(seg=>seg.content);textParts.length>0&&lines.push(textParts.join("\n")),blocks.push(lines.join("\n"))}if(0===blocks.length)return;const blob=new Blob([blocks.join("\n\n\n\n")],{type:"text/plain;charset=utf-8"}),url=URL.createObjectURL(blob),a=document.createElement("a");a.href=url,a.download=`user-prompts-${(new Date).toISOString().slice(0,10)}.txt`,a.click(),URL.revokeObjectURL(url)}),__publicField(this,"handlePendingPermission",data=>{this.setState({globalPermission:data})}),__publicField(this,"handlePendingPlanApproval",data=>{this.setState({globalPlanApproval:data})}),__publicField(this,"handleAutoApproveChange",seconds=>{this.setState({autoApproveSeconds:seconds}),fetch(apiUrl("/api/preferences"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({autoApproveSeconds:seconds})}).catch(()=>{})}),__publicField(this,"_isInternalDrag",e=>e.dataTransfer.types.includes("text/x-preset-reorder")),__publicField(this,"_onDragOver",e=>{if(e.preventDefault(),this._isInternalDrag(e))return;e.target.closest&&e.target.closest("[data-file-explorer]")?this.state.isDragging&&this.setState({isDragging:!1}):this.state.isDragging||this.setState({isDragging:!0})}),__publicField(this,"_onDragLeave",e=>{const layout=this._layoutRef.current;layout&&!layout.contains(e.relatedTarget)&&this.setState({isDragging:!1})}),__publicField(this,"_onDrop",e=>{if(e.preventDefault(),this._isInternalDrag(e))return;this.setState({isDragging:!1});const files=Array.from(e.dataTransfer.files);if(!files.length)return;const toTerminal=this.state.mobileTerminalVisible;Promise.all(files.map(file=>uploadFileAndGetPath(file).then(path=>({name:file.name,path:path})).catch(err=>(staticMethods.error(`${file.name}: ${err.message}`),null)))).then(results=>{const uploaded=results.filter(Boolean);uploaded.length&&(toTerminal?this.setState(prev=>({terminalPendingImages:[...prev.terminalPendingImages,...uploaded.map(r=>({path:r.path,source:"drop"}))]})):this.setState(prev=>({pendingUploadPaths:[...prev.pendingUploadPaths||[],...uploaded.map(r=>`"${r.path}"`)]})))})}),__publicField(this,"handleUploadPathsConsumed",()=>{this.setState({pendingUploadPaths:[]})}),__publicField(this,"_handleTerminalFilePath",path=>{this.setState(prev=>({terminalPendingImages:[...prev.terminalPendingImages,{path:path,source:"terminal"}]}))}),__publicField(this,"_handleRemoveTerminalImage",idx=>{this.setState(prev=>({terminalPendingImages:prev.terminalPendingImages.filter((_,i)=>i!==idx)}))}),__publicField(this,"_handleClearTerminalImages",()=>{this.setState({terminalPendingImages:[]})}),Object.assign(this.state,{mobileMenuVisible:!1,mobileStatsVisible:!1,mobileGitDiffVisible:!1,mobileChatVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1,mobileTerminalVisible:!1,mobileFileExplorerVisible:!1,globalPermission:null,globalPlanApproval:null,autoApproveSeconds:0,hasGit:!0,terminalPendingImages:[]}),this._lastContextPercent=0}componentDidMount(){super.componentDidMount(),fetch(apiUrl("/api/git-repos")).then(r=>r.ok?r.json():Promise.reject()).then(data=>{var _a;(null==(_a=data.repos)?void 0:_a.length)||this.setState({hasGit:!1,mobileGitDiffVisible:!1})}).catch(()=>{fetch(apiUrl("/api/git-status")).then(r=>{r.ok||this.setState({hasGit:!1,mobileGitDiffVisible:!1})}).catch(()=>this.setState({hasGit:!1,mobileGitDiffVisible:!1}))}),isIOS&&!isPad&&window.visualViewport&&(this._onVisualViewportChange=()=>{const el=this._layoutRef.current;if(!el)return;const vv=window.visualViewport;el.style.position="fixed",el.style.top=`${vv.offsetTop}px`,el.style.height=`${vv.height}px`,el.style.width="100%",el.style.left="0"},window.visualViewport.addEventListener("resize",this._onVisualViewportChange),window.visualViewport.addEventListener("scroll",this._onVisualViewportChange),this._onVisualViewportChange()),isPad&&(this._mqlWide=window.matchMedia("(min-width: 1400px)"),this._modeSwitchDialog=null,this._onWideChange=e=>{e.matches?this._modeSwitchDialog=Modal.confirm({title:t("ui.modeSwitchTitle"),content:t("ui.modeSwitchToFullView"),okText:t("ui.ok"),onOk:()=>{this._modeSwitchDialog=null,setViewMode("pc")},onCancel:()=>{this._modeSwitchDialog=null}}):this._modeSwitchDialog&&(this._modeSwitchDialog.destroy(),this._modeSwitchDialog=null)},this._mqlWide.addEventListener("change",this._onWideChange))}componentWillUnmount(){this._onVisualViewportChange&&window.visualViewport&&(window.visualViewport.removeEventListener("resize",this._onVisualViewportChange),window.visualViewport.removeEventListener("scroll",this._onVisualViewportChange)),this._mqlWide&&this._mqlWide.removeEventListener("change",this._onWideChange),this._modeSwitchDialog&&(this._modeSwitchDialog.destroy(),this._modeSwitchDialog=null),super.componentWillUnmount()}static parseSegments(text){const segments=[],regex=/<([a-zA-Z_][\w-]*)(?:\s[^>]*)?>[\s\S]*?<\/\1>/g;let match,lastIndex=0;for(;null!==(match=regex.exec(text));){const before=text.slice(lastIndex,match.index).trim();before&&segments.push({type:"text",content:before});const tagName=match[1];if(lastIndex=match.index+match[0].length,_Mobile.COMMAND_TAGS.has(tagName))continue;const innerRegex=new RegExp(`^<${tagName}(?:\\s[^>]*)?>([\\s\\S]*)<\\/${tagName}>$`),innerMatch=match[0].match(innerRegex),content2=innerMatch?innerMatch[1].trim():match[0].trim();segments.push({type:"system",content:content2,label:tagName})}const after=text.slice(lastIndex).trim();return after&&segments.push({type:"text",content:after}),segments}static extractUserTexts(messages){const userMsgs=[],fullTexts=[];let slashCmd=null;for(const msg of messages)if("user"===msg.role)if("string"==typeof msg.content){const text=msg.content.trim();if(!text)continue;if(!isSystemText(text)){if(/Implement the following plan:/i.test(text))continue;userMsgs.push(text),fullTexts.push(text)}}else if(Array.isArray(msg.content)){const{commands:commands,textBlocks:textBlocks}=classifyUserContent(msg.content);commands.length>0&&(slashCmd=commands[commands.length-1]);const userParts=[];for(const b of textBlocks)/Implement the following plan:/i.test((b.text||"").trim())||userParts.push(b.text.trim());const allParts=msg.content.filter(b=>{var _a;return"text"===b.type&&(null==(_a=b.text)?void 0:_a.trim())}).map(b=>b.text.trim());userParts.length>0&&(userMsgs.push(userParts.join("\n")),fullTexts.push(allParts.join("\n")))}return{userMsgs:userMsgs,fullTexts:fullTexts,slashCmd:slashCmd}}extractUserPrompts(requests){var _a;const prompts=[],seen=new Set;let prevSlashCmd=null;const mainAgentRequests=requests.filter(r=>isMainAgent(r));for(let ri=0;ri<mainAgentRequests.length;ri++){const req=mainAgentRequests[ri],messages=(null==(_a=req.body)?void 0:_a.messages)||[],timestamp=req.timestamp||"",{userMsgs:userMsgs,fullTexts:fullTexts,slashCmd:slashCmd}=_Mobile.extractUserTexts(messages);slashCmd&&"/compact"!==slashCmd&&slashCmd!==prevSlashCmd&&prompts.push({type:"prompt",segments:[{type:"text",content:slashCmd}],timestamp:timestamp}),prevSlashCmd=slashCmd;for(let i=0;i<userMsgs.length;i++){const key=userMsgs[i];if(seen.has(key))continue;seen.add(key);const raw=fullTexts[i]||key;prompts.push({type:"prompt",segments:_Mobile.parseSegments(raw),timestamp:timestamp})}}return prompts}renderOriginalPrompt(p){const textSegments=p.segments.filter(seg=>"text"===seg.type);return 0===textSegments.length?null:jsxRuntimeExports.jsx("div",{className:styles$4.mobilePromptCard,children:textSegments.map((seg,j)=>jsxRuntimeExports.jsx("pre",{className:styles$4.mobilePromptPreText,children:seg.content},j))})}render(){var _a;const{filteredRequests:filteredRequests,fileLoading:fileLoading,fileLoadingCount:fileLoadingCount,mainAgentSessions:mainAgentSessions}=this.renderPrepare();if(this.state.workspaceMode)return this.renderWorkspaceMode();const mobileIsLocalLog=!!this._isLocalLog;let mobileModelName=null;for(let i=filteredRequests.length-1;i>=0;i--)if(isMainAgent(filteredRequests[i])&&(null==(_a=filteredRequests[i].body)?void 0:_a.model)){mobileModelName=filteredRequests[i].body.model;break}return jsxRuntimeExports.jsxs("div",{className:styles$4.mobileCLIRoot,ref:this._layoutRef,onDragOver:this._onDragOver,onDragLeave:this._onDragLeave,onDrop:this._onDrop,children:[this.state.isDragging&&jsxRuntimeExports.jsx("div",{className:styles$4.dragOverlay,children:jsxRuntimeExports.jsxs("div",{className:styles$4.dragOverlayContent,children:[jsxRuntimeExports.jsx(RefIcon$1,{className:styles$4.dragIcon}),jsxRuntimeExports.jsx("p",{children:t("ui.dragDropHint")})]})}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileCLIHeader,children:[jsxRuntimeExports.jsxs("div",{className:styles$4.mobileCLIHeaderLeft,children:[jsxRuntimeExports.jsx("button",{className:styles$4.mobileMenuBtn,onClick:()=>this.setState(prev=>({mobileMenuVisible:!prev.mobileMenuVisible})),"aria-label":t("ui.mobileMenu"),children:jsxRuntimeExports.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[jsxRuntimeExports.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),jsxRuntimeExports.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),jsxRuntimeExports.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})}),mobileIsLocalLog?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Badge,{status:"processing",color:"green"}),jsxRuntimeExports.jsx("span",{className:styles$4.mobileCLIStatusLabel,children:t("ui.historyLog",{file:this._localLogFile})})]}):(()=>{var _a2,_b,_c;const contextWindow=this.state.contextWindow;let contextPercent=0;if(null!=(null==contextWindow?void 0:contextWindow.used_percentage))contextPercent=Math.min(100,Math.max(0,Math.round(contextWindow.used_percentage/83.5*100)));else if(filteredRequests.length>0)for(let i=filteredRequests.length-1;i>=0;i--)if(isMainAgent(filteredRequests[i])&&(null==(_b=null==(_a2=filteredRequests[i].response)?void 0:_a2.body)?void 0:_b.usage)){const u=filteredRequests[i].response.body.usage,total=(u.input_tokens||0)+(u.cache_creation_input_tokens||0)+(u.cache_read_input_tokens||0),usable=.835*((null==contextWindow?void 0:contextWindow.context_window_size)||getModelMaxTokens((null==(_c=filteredRequests[i].body)?void 0:_c.model)||this.state.settingsModel));usable>0&&total>0&&(contextPercent=Math.min(100,Math.max(0,Math.round(total/usable*100))));break}0===contextPercent&&this._lastContextPercent>0?contextPercent=this._lastContextPercent:this._lastContextPercent=contextPercent;const ctxColor=contextPercent>=80?"var(--color-error-light)":contextPercent>=60?"var(--color-warning-light)":"var(--color-success)",ctxLabel=`${t("ui.liveMonitoring")}${this.state.projectName?`: ${this.state.projectName}`:""}`;return jsxRuntimeExports.jsxs("span",{className:styles$4.mobileCtxTag,style:{borderColor:ctxColor,color:ctxColor},title:ctxLabel,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileCtxTagFill,style:{width:`${contextPercent}%`,backgroundColor:ctxColor}}),jsxRuntimeExports.jsx("span",{className:styles$4.mobileCtxTagContent,children:ctxLabel})]})})()]}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileCLIHeaderRight,children:[mobileIsLocalLog?jsxRuntimeExports.jsx(Button,{type:"text",size:"small",icon:jsxRuntimeExports.jsx(RefIcon,{}),onClick:()=>history.back(),className:styles$4.mobileNavBtn,children:t("ui.mobileGoBack")}):this.state.hasGit?jsxRuntimeExports.jsx(Button,{type:"text",size:"small",icon:jsxRuntimeExports.jsx(RefIcon$2,{}),onClick:()=>this.setState(prev=>({mobileGitDiffVisible:!prev.mobileGitDiffVisible,mobileChatVisible:!1,mobileTerminalVisible:!1,mobileStatsVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1,mobileFileExplorerVisible:!1})),style:{color:this.state.mobileGitDiffVisible?"var(--color-primary)":"var(--text-tertiary)",fontSize:12},children:this.state.mobileGitDiffVisible?t("ui.mobileGitDiffExit"):t("ui.mobileGitDiffBrowse")}):null,!mobileIsLocalLog&&jsxRuntimeExports.jsx(Button,{type:"text",size:"small",icon:jsxRuntimeExports.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("polyline",{points:"4 17 10 11 4 5"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]}),onClick:()=>this.setState(prev=>({mobileTerminalVisible:!prev.mobileTerminalVisible,mobileGitDiffVisible:!1,mobileStatsVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1,mobileFileExplorerVisible:!1})),style:{color:this.state.mobileTerminalVisible?"var(--color-primary)":"var(--text-tertiary)",fontSize:12},children:this.state.mobileTerminalVisible?t("ui.mobileTerminalExit"):t("ui.mobileTerminalBrowse")})]}),this.state.mobileMenuVisible&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:styles$4.mobileMenuOverlay,onClick:()=>this.setState({mobileMenuVisible:!1})}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileMenuDropdown,children:[jsxRuntimeExports.jsxs("button",{className:styles$4.mobileMenuItem,onClick:()=>{this.setState({mobileMenuVisible:!1,mobileLogMgmtVisible:!0,mobileStatsVisible:!1,mobileGitDiffVisible:!1,mobileChatVisible:!1,mobileTerminalVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1,mobileFileExplorerVisible:!1}),this.handleImportLocalLogs()},children:[jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntimeExports.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntimeExports.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),jsxRuntimeExports.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]}),t("ui.logManagement")]}),jsxRuntimeExports.jsxs("button",{className:styles$4.mobileMenuItem,onClick:()=>{this.setState({mobileMenuVisible:!1,mobileStatsVisible:!0,mobileGitDiffVisible:!1,mobileChatVisible:!1,mobileTerminalVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1,mobileFileExplorerVisible:!1})},children:[jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("rect",{x:"3",y:"3",width:"7",height:"7"}),jsxRuntimeExports.jsx("rect",{x:"14",y:"3",width:"7",height:"7"}),jsxRuntimeExports.jsx("rect",{x:"3",y:"14",width:"7",height:"7"}),jsxRuntimeExports.jsx("rect",{x:"14",y:"14",width:"7",height:"7"})]}),t("ui.tokenStats")]}),jsxRuntimeExports.jsxs("button",{className:styles$4.mobileMenuItem,onClick:()=>{this.setState({mobileMenuVisible:!1,mobileSettingsVisible:!0,mobileStatsVisible:!1,mobileGitDiffVisible:!1,mobileChatVisible:!1,mobileTerminalVisible:!1,mobileLogMgmtVisible:!1,mobilePromptVisible:!1,mobileFileExplorerVisible:!1})},children:[jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"3"}),jsxRuntimeExports.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),t("ui.settings")]}),!mobileIsLocalLog&&jsxRuntimeExports.jsxs("button",{className:styles$4.mobileMenuItem,onClick:()=>{this.setState({mobileMenuVisible:!1,mobileFileExplorerVisible:!0,mobileStatsVisible:!1,mobileGitDiffVisible:!1,mobileChatVisible:!1,mobileTerminalVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobilePromptVisible:!1})},children:[jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:jsxRuntimeExports.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}),t("ui.projectFolder")]}),jsxRuntimeExports.jsxs("button",{className:styles$4.mobileMenuItem,onClick:()=>{this.setState({mobileMenuVisible:!1,mobilePromptVisible:!0,mobileStatsVisible:!1,mobileGitDiffVisible:!1,mobileChatVisible:!1,mobileTerminalVisible:!1,mobileLogMgmtVisible:!1,mobileSettingsVisible:!1,mobileFileExplorerVisible:!1})},children:[jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[jsxRuntimeExports.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),jsxRuntimeExports.jsx("polyline",{points:"14 2 14 8 20 8"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"12",x2:"9",y2:"15"}),jsxRuntimeExports.jsx("line",{x1:"12",y1:"12",x2:"15",y2:"15"})]}),t("ui.userPrompt")]})]})]})]}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileCLIBody,children:[!mobileIsLocalLog&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[fileLoading&&jsxRuntimeExports.jsxs("div",{className:styles$4.mobileLoadingOverlay,children:[jsxRuntimeExports.jsx("div",{className:styles$4.mobileLoadingSpinner}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileLoadingLabel,children:[t("ui.loadingChat"),fileLoadingCount>0?` (${fileLoadingCount})`:""]})]}),jsxRuntimeExports.jsx(ConfigProvider,{theme:this.themeConfig,children:jsxRuntimeExports.jsx("div",{className:styles$4.mobileChatInner,children:jsxRuntimeExports.jsx(ChatView,{requests:filteredRequests,mainAgentSessions:mainAgentSessions,streamingLatest:this.state.streamingLatest,userProfile:this.state.userProfile,collapseToolResults:this.state.collapseToolResults,expandThinking:this.state.expandThinking,showFullToolContent:this.state.showFullToolContent,showThinkingSummaries:this.state.showThinkingSummaries,onViewRequest:null,scrollToTimestamp:null,onScrollTsDone:()=>{},cliMode:this.state.cliMode,sdkMode:this.state.sdkMode,terminalVisible:this.state.mobileTerminalVisible,mobileChatVisible:!0,fileLoading:this.state.fileLoading,isStreaming:this.state.isStreaming,hasMoreHistory:this.state.hasMoreHistory,loadingMore:this.state.loadingMore,onLoadMoreHistory:()=>this.loadMoreHistory(),loadingSessionId:this.state.loadingSessionId,onLoadSession:sid=>this.loadSession(sid),onPendingPermission:this.handlePendingPermission,onPendingPlanApproval:this.handlePendingPlanApproval,pendingUploadPaths:this.state.pendingUploadPaths,onUploadPathsConsumed:this.handleUploadPathsConsumed,onMobileOpenFile:this._handleMobileOpenFile})})})]}),!mobileIsLocalLog&&jsxRuntimeExports.jsx("div",{className:`${styles$4.mobileChatOverlay} ${this.state.mobileTerminalVisible?styles$4.mobileChatOverlayVisible:""}`,children:jsxRuntimeExports.jsx(TerminalPanel,{modelName:mobileModelName,onFilePath:this._handleTerminalFilePath,pendingImages:this.state.terminalPendingImages,onRemovePendingImage:this._handleRemoveTerminalImage,onClearPendingImages:this._handleClearTerminalImages})}),jsxRuntimeExports.jsx("div",{className:`${styles$4.mobileGitDiffOverlay} ${this.state.mobileGitDiffVisible?styles$4.mobileGitDiffOverlayVisible:""}`,children:jsxRuntimeExports.jsx("div",{className:styles$4.mobileGitDiffInner,children:jsxRuntimeExports.jsx(MobileGitDiff,{visible:this.state.mobileGitDiffVisible,onClose:()=>this.setState({mobileGitDiffVisible:!1})})})}),jsxRuntimeExports.jsx("div",{className:`${styles$4.mobileFileExplorerOverlay} ${this.state.mobileFileExplorerVisible?styles$4.mobileFileExplorerOverlayVisible:""}`,children:jsxRuntimeExports.jsx("div",{className:styles$4.mobileFileExplorerInner,children:jsxRuntimeExports.jsx(MobileFileExplorer,{visible:this.state.mobileFileExplorerVisible,onClose:()=>this.setState({mobileFileExplorerVisible:!1,mobileFileExplorerTarget:null}),targetFile:this.state.mobileFileExplorerTarget})})}),jsxRuntimeExports.jsx("div",{className:`${styles$4.mobileStatsOverlay} ${this.state.mobileStatsVisible?styles$4.mobileStatsOverlayVisible:""}`,children:jsxRuntimeExports.jsx("div",{className:styles$4.mobileStatsInner,children:jsxRuntimeExports.jsx(MobileStats,{requests:filteredRequests,visible:this.state.mobileStatsVisible,onClose:()=>this.setState({mobileStatsVisible:!1})})})}),jsxRuntimeExports.jsxs("div",{className:`${styles$4.mobileLogMgmtOverlay} ${this.state.mobileLogMgmtVisible?styles$4.mobileLogMgmtOverlayVisible:""}`,children:[jsxRuntimeExports.jsxs("div",{className:styles$4.mobileLogMgmtHeader,children:[jsxRuntimeExports.jsxs("span",{className:styles$4.mobileLogMgmtTitle,children:[jsxRuntimeExports.jsx(OpenFolderIcon,{apiEndpoint:apiUrl("/api/open-log-dir"),title:t("ui.openLogDir"),size:14}),t("ui.importLocalLogs")]}),jsxRuntimeExports.jsx("button",{className:styles$4.mobileLogMgmtClose,onClick:()=>this.setState({mobileLogMgmtVisible:!1,selectedLogs:new Set}),children:jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileLogMgmtActions,children:[jsxRuntimeExports.jsx(Button,{size:"small",type:this.state.selectedLogs.size>=2?"primary":"default",disabled:this.state.selectedLogs.size<2,onClick:this.handleMergeLogs,style:this.state.selectedLogs.size<2?{color:"var(--text-muted)",borderColor:"var(--border-light)"}:void 0,children:t("ui.mergeLogs")}),jsxRuntimeExports.jsx(Button,{size:"small",icon:jsxRuntimeExports.jsx(RefIcon$3,{}),disabled:0===this.state.selectedLogs.size,onClick:this.handleDeleteLogs,style:0===this.state.selectedLogs.size?{color:"var(--text-muted)",borderColor:"var(--border-light)"}:{color:"var(--color-error-light)",borderColor:"var(--color-error-light)"},children:t("ui.deleteLogs")}),jsxRuntimeExports.jsx(Button,{size:"small",icon:jsxRuntimeExports.jsx(RefIcon$4,{spin:this.state.refreshingStats}),loading:this.state.refreshingStats,onClick:this.handleRefreshStats,children:t("ui.refreshStats")})]}),jsxRuntimeExports.jsx("div",{className:styles$4.mobileLogMgmtBody,children:this.state.localLogsLoading?jsxRuntimeExports.jsx("div",{className:styles$4.spinCenter,children:jsxRuntimeExports.jsx(Spin,{})}):(()=>{const currentLogs=this.state.localLogs[this.state.currentProject];return currentLogs&&0!==currentLogs.length?jsxRuntimeExports.jsx(ConfigProvider,{theme:this.themeConfig,children:jsxRuntimeExports.jsx("div",{className:styles$4.logListContainer,children:this.renderLogTable(currentLogs,!0)})}):jsxRuntimeExports.jsx("div",{className:styles$4.emptyCenter,children:t("ui.noLogs")})})()})]}),jsxRuntimeExports.jsxs("div",{className:`${styles$4.mobileSettingsOverlay} ${this.state.mobileSettingsVisible?styles$4.mobileSettingsOverlayVisible:""}`,children:[jsxRuntimeExports.jsxs("div",{className:styles$4.mobileLogMgmtHeader,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileLogMgmtTitle,children:t("ui.settings")}),jsxRuntimeExports.jsx("button",{className:styles$4.mobileLogMgmtClose,onClick:()=>this.setState({mobileSettingsVisible:!1}),children:jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileSettingsBody,children:[jsxRuntimeExports.jsx("div",{className:styles$4.mobileSettingsSectionTitle,children:t("ui.chatDisplaySwitches")}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileSettingsRow,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileSettingsLabel,children:t("ui.collapseToolResults")}),jsxRuntimeExports.jsx(Switch,{checked:!!this.state.collapseToolResults,onChange:this.handleCollapseToolResultsChange})]}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileSettingsRow,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileSettingsLabel,children:t("ui.expandThinking")}),jsxRuntimeExports.jsx(Switch,{checked:!!this.state.expandThinking,onChange:this.handleExpandThinkingChange})]}),jsxRuntimeExports.jsxs("div",{className:styles$4.mobileSettingsRow,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileSettingsLabel,children:t("ui.showFullToolContent")}),jsxRuntimeExports.jsx(Switch,{checked:!!this.state.showFullToolContent,onChange:this.handleShowFullToolContentChange})]}),jsxRuntimeExports.jsx("div",{className:styles$4.mobileSettingsSectionTitle,children:t("ui.themeColor")}),jsxRuntimeExports.jsx("div",{className:styles$4.mobileSettingsRow,children:jsxRuntimeExports.jsx(Select,{size:"small",value:this.state.themeColor||"dark",onChange:this.handleThemeColorChange,options:[{label:t("ui.themeColor.dark"),value:"dark"},{label:t("ui.themeColor.light"),value:"light"}],style:{width:140}})}),jsxRuntimeExports.jsx("div",{className:styles$4.mobileSettingsSectionTitle,children:t("ui.permission.autoApprove.setting")}),jsxRuntimeExports.jsx("div",{className:styles$4.mobileSettingsRow,children:jsxRuntimeExports.jsx(Select,{size:"small",value:this.state.autoApproveSeconds||0,onChange:this.handleAutoApproveChange,options:[{label:t("ui.permission.autoApprove.off"),value:0},{label:"3s",value:3},{label:"5s",value:5},{label:"10s",value:10},{label:"15s",value:15},{label:"20s",value:20},{label:"30s",value:30},{label:"60s",value:60}],style:{width:100}})})]})]}),jsxRuntimeExports.jsxs("div",{className:`${styles$4.mobilePromptOverlay} ${this.state.mobilePromptVisible?styles$4.mobilePromptOverlayVisible:""}`,children:[jsxRuntimeExports.jsxs("div",{className:styles$4.mobileLogMgmtHeader,children:[jsxRuntimeExports.jsx("span",{className:styles$4.mobileLogMgmtTitle,children:t("ui.userPrompt")}),jsxRuntimeExports.jsx("button",{className:styles$4.mobileLogMgmtClose,onClick:()=>this.setState({mobilePromptVisible:!1}),children:jsxRuntimeExports.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[jsxRuntimeExports.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),jsxRuntimeExports.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),jsxRuntimeExports.jsx("div",{className:styles$4.mobilePromptBody,children:(()=>{const prompts=this.extractUserPrompts(filteredRequests);return 0===prompts.length?jsxRuntimeExports.jsx("div",{className:styles$4.mobilePromptEmpty,children:t("ui.noPrompt")}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:styles$4.mobilePromptHeader,children:[jsxRuntimeExports.jsxs("span",{className:styles$4.mobilePromptCount,children:[prompts.length," ",t("ui.promptCountUnit")]}),jsxRuntimeExports.jsx(Button,{size:"small",icon:jsxRuntimeExports.jsx(RefIcon$5,{}),onClick:()=>this.handleExportPromptsTxt(prompts),children:t("ui.exportPromptsTxt")})]}),jsxRuntimeExports.jsx("div",{className:styles$4.mobilePromptList,children:prompts.map((p,i)=>jsxRuntimeExports.jsxs("div",{className:styles$4.mobilePromptItem,children:[p.timestamp&&jsxRuntimeExports.jsx("div",{className:styles$4.mobilePromptTimestamp,children:new Date(p.timestamp).toLocaleString()}),this.renderOriginalPrompt(p)]},i))})]})})()})]})]}),this.state.globalPermission&&jsxRuntimeExports.jsx(ToolApprovalPanel,{toolName:this.state.globalPermission.permission.toolName,toolInput:this.state.globalPermission.permission.input,requestId:this.state.globalPermission.permission.id,onAllow:this.state.globalPermission.handlers.allow,onAllowSession:this.state.globalPermission.handlers.allowSession,onDeny:this.state.globalPermission.handlers.deny,visible:!0,global:!0,autoApproveSeconds:this.state.autoApproveSeconds,onAutoApproveChange:this.handleAutoApproveChange,modelName:this.state.globalPermission.modelName}),this.state.globalPlanApproval&&jsxRuntimeExports.jsx(ToolApprovalPanel,{toolName:"ExitPlanMode",toolInput:this.state.globalPlanApproval.plan.input,requestId:this.state.globalPlanApproval.plan.id,onAllow:this.state.globalPlanApproval.handlers.approve,onDeny:id=>this.state.globalPlanApproval.handlers.reject(id,""),visible:!0,global:!0})]})}};__publicField(_Mobile,"COMMAND_TAGS",new Set(["command-name","command-message","command-args","local-command-caveat","local-command-stdout"]));let Mobile=_Mobile;export{Mobile as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aW as isObjectLike,bj as baseGetTag,aG as isArray,aU as Symbol$1,aF as isArrayLike,bk as arrayLikeKeys,bl as baseKeys,bm as memoize,bn as isArguments,bo as MapCache,bp as eq,bq as Uint8Array,aX as getTag,b0 as isBuffer,b3 as Stack,br as isTypedArray,a_ as isObject,bs as isLength,bt as isIndex,aH as identity,bu as baseFor,bv as Set}from"./mermaid.core-fx56L749.js";function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&"[object Symbol]"==baseGetTag(value)}function arrayMap(array,iteratee){for(var index=-1,length=null==array?0:array.length,result=Array(length);++index<length;)result[index]=iteratee(array[index],index,array);return result}var symbolProto$1=Symbol$1?Symbol$1.prototype:void 0,symbolToString=symbolProto$1?symbolProto$1.toString:void 0;function baseToString(value){if("string"==typeof value)return value;if(isArray(value))return arrayMap(value,baseToString)+"";if(isSymbol(value))return symbolToString?symbolToString.call(value):"";var result=value+"";return"0"==result&&1/value==-1/0?"-0":result}function arrayEach(array,iteratee){for(var index=-1,length=null==array?0:array.length;++index<length&&!1!==iteratee(array[index],index,array););return array}function baseFindIndex(array,predicate,fromIndex,fromRight){for(var length=array.length,index=fromIndex+-1;++index<length;)if(predicate(array[index],index,array))return index;return-1}function baseIsNaN(value){return value!=value}function arrayIncludes(array,value){return!!(null==array?0:array.length)&&function(array,value,fromIndex){return value==value?function(array,value,fromIndex){for(var index=fromIndex-1,length=array.length;++index<length;)if(array[index]===value)return index;return-1}(array,value,fromIndex):baseFindIndex(array,baseIsNaN,fromIndex)}(array,value,0)>-1}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(value,object){if(isArray(value))return!1;var type=typeof value;return!("number"!=type&&"symbol"!=type&&"boolean"!=type&&null!=value&&!isSymbol(value))||(reIsPlainProp.test(value)||!reIsDeepProp.test(value)||null!=object&&value in Object(object))}var func,result,cache,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=(func=function(string){var result=[];return 46===string.charCodeAt(0)&&result.push(""),string.replace(rePropName,function(match,number,quote,subString){result.push(quote?subString.replace(reEscapeChar,"$1"):number||match)}),result},result=memoize(func,function(key){return 500===cache.size&&cache.clear(),key}),cache=result.cache,result);function toString(value){return null==value?"":baseToString(value)}function castPath(value,object){return isArray(value)?value:isKey(value,object)?[value]:stringToPath(toString(value))}function toKey(value){if("string"==typeof value||isSymbol(value))return value;var result=value+"";return"0"==result&&1/value==-1/0?"-0":result}function baseGet(object,path){for(var index=0,length=(path=castPath(path,object)).length;null!=object&&index<length;)object=object[toKey(path[index++])];return index&&index==length?object:void 0}function arrayPush(array,values){for(var index=-1,length=values.length,offset=array.length;++index<length;)array[offset+index]=values[index];return array}var spreadableSymbol=Symbol$1?Symbol$1.isConcatSpreadable:void 0;function isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol])}function baseFlatten(array,depth,predicate,isStrict,result){var index=-1,length=array.length;for(predicate||(predicate=isFlattenable),result||(result=[]);++index<length;){var value=array[index];predicate(value)?arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function arrayReduce(array,iteratee,accumulator,initAccum){var index=-1,length=null==array?0:array.length;for(initAccum&&length&&(accumulator=array[++index]);++index<length;)accumulator=iteratee(accumulator,array[index],index,array);return accumulator}function arrayFilter(array,predicate){for(var index=-1,length=null==array?0:array.length,resIndex=0,result=[];++index<length;){var value=array[index];predicate(value,index,array)&&(result[resIndex++]=value)}return result}function stubArray(){return[]}var propertyIsEnumerable=Object.prototype.propertyIsEnumerable,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols?function(object){return null==object?[]:(object=Object(object),arrayFilter(nativeGetSymbols(object),function(symbol){return propertyIsEnumerable.call(object,symbol)}))}:stubArray;function baseGetAllKeys(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray(object)?result:arrayPush(result,symbolsFunc(object))}function getAllKeys(object){return baseGetAllKeys(object,keys,getSymbols)}function SetCache(values){var index=-1,length=null==values?0:values.length;for(this.__data__=new MapCache;++index<length;)this.add(values[index])}function arraySome(array,predicate){for(var index=-1,length=null==array?0:array.length;++index<length;)if(predicate(array[index],index,array))return!0;return!1}function cacheHas(cache,key){return cache.has(key)}SetCache.prototype.add=SetCache.prototype.push=function(value){return this.__data__.set(value,"__lodash_hash_undefined__"),this},SetCache.prototype.has=function(value){return this.__data__.has(value)};function equalArrays(array,other,bitmask,customizer,equalFunc,stack){var isPartial=1&bitmask,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength))return!1;var arrStacked=stack.get(array),othStacked=stack.get(other);if(arrStacked&&othStacked)return arrStacked==other&&othStacked==array;var index=-1,result=!0,seen=2&bitmask?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index<arrLength;){var arrValue=array[index],othValue=other[index];if(customizer)var compared=isPartial?customizer(othValue,arrValue,index,other,array,stack):customizer(arrValue,othValue,index,array,other,stack);if(void 0!==compared){if(compared)continue;result=!1;break}if(seen){if(!arraySome(other,function(othValue2,othIndex){if(!cacheHas(seen,othIndex)&&(arrValue===othValue2||equalFunc(arrValue,othValue2,bitmask,customizer,stack)))return seen.push(othIndex)})){result=!1;break}}else if(arrValue!==othValue&&!equalFunc(arrValue,othValue,bitmask,customizer,stack)){result=!1;break}}return stack.delete(array),stack.delete(other),result}function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach(function(value,key){result[++index]=[key,value]}),result}function setToArray(set){var index=-1,result=Array(set.size);return set.forEach(function(value){result[++index]=value}),result}var symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;var hasOwnProperty$1=Object.prototype.hasOwnProperty;var objectTag="[object Object]",hasOwnProperty=Object.prototype.hasOwnProperty;function baseIsEqualDeep(object,other,bitmask,customizer,equalFunc,stack){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=objIsArr?"[object Array]":getTag(object),othTag=othIsArr?"[object Array]":getTag(other),objIsObj=(objTag="[object Arguments]"==objTag?objectTag:objTag)==objectTag,othIsObj=(othTag="[object Arguments]"==othTag?objectTag:othTag)==objectTag,isSameTag=objTag==othTag;if(isSameTag&&isBuffer(object)){if(!isBuffer(other))return!1;objIsArr=!0,objIsObj=!1}if(isSameTag&&!objIsObj)return stack||(stack=new Stack),objIsArr||isTypedArray(object)?equalArrays(object,other,bitmask,customizer,equalFunc,stack):function(object,other,tag,bitmask,customizer,equalFunc,stack){switch(tag){case"[object DataView]":if(object.byteLength!=other.byteLength||object.byteOffset!=other.byteOffset)return!1;object=object.buffer,other=other.buffer;case"[object ArrayBuffer]":return!(object.byteLength!=other.byteLength||!equalFunc(new Uint8Array(object),new Uint8Array(other)));case"[object Boolean]":case"[object Date]":case"[object Number]":return eq(+object,+other);case"[object Error]":return object.name==other.name&&object.message==other.message;case"[object RegExp]":case"[object String]":return object==other+"";case"[object Map]":var convert=mapToArray;case"[object Set]":var isPartial=1&bitmask;if(convert||(convert=setToArray),object.size!=other.size&&!isPartial)return!1;var stacked=stack.get(object);if(stacked)return stacked==other;bitmask|=2,stack.set(object,other);var result=equalArrays(convert(object),convert(other),bitmask,customizer,equalFunc,stack);return stack.delete(object),result;case"[object Symbol]":if(symbolValueOf)return symbolValueOf.call(object)==symbolValueOf.call(other)}return!1}(object,other,objTag,bitmask,customizer,equalFunc,stack);if(!(1&bitmask)){var objIsWrapped=objIsObj&&hasOwnProperty.call(object,"__wrapped__"),othIsWrapped=othIsObj&&hasOwnProperty.call(other,"__wrapped__");if(objIsWrapped||othIsWrapped){var objUnwrapped=objIsWrapped?object.value():object,othUnwrapped=othIsWrapped?other.value():other;return stack||(stack=new Stack),equalFunc(objUnwrapped,othUnwrapped,bitmask,customizer,stack)}}return!!isSameTag&&(stack||(stack=new Stack),function(object,other,bitmask,customizer,equalFunc,stack){var isPartial=1&bitmask,objProps=getAllKeys(object),objLength=objProps.length;if(objLength!=getAllKeys(other).length&&!isPartial)return!1;for(var index=objLength;index--;){var key=objProps[index];if(!(isPartial?key in other:hasOwnProperty$1.call(other,key)))return!1}var objStacked=stack.get(object),othStacked=stack.get(other);if(objStacked&&othStacked)return objStacked==other&&othStacked==object;var result=!0;stack.set(object,other),stack.set(other,object);for(var skipCtor=isPartial;++index<objLength;){var objValue=object[key=objProps[index]],othValue=other[key];if(customizer)var compared=isPartial?customizer(othValue,objValue,key,other,object,stack):customizer(objValue,othValue,key,object,other,stack);if(!(void 0===compared?objValue===othValue||equalFunc(objValue,othValue,bitmask,customizer,stack):compared)){result=!1;break}skipCtor||(skipCtor="constructor"==key)}if(result&&!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;objCtor==othCtor||!("constructor"in object)||!("constructor"in other)||"function"==typeof objCtor&&objCtor instanceof objCtor&&"function"==typeof othCtor&&othCtor instanceof othCtor||(result=!1)}return stack.delete(object),stack.delete(other),result}(object,other,bitmask,customizer,equalFunc,stack))}function baseIsEqual(value,other,bitmask,customizer,stack){return value===other||(null==value||null==other||!isObjectLike(value)&&!isObjectLike(other)?value!=value&&other!=other:baseIsEqualDeep(value,other,bitmask,customizer,baseIsEqual,stack))}function isStrictComparable(value){return value==value&&!isObject(value)}function matchesStrictComparable(key,srcValue){return function(object){return null!=object&&(object[key]===srcValue&&(void 0!==srcValue||key in Object(object)))}}function baseMatches(source){var matchData=function(object){for(var result=keys(object),length=result.length;length--;){var key=result[length],value=object[key];result[length]=[key,value,isStrictComparable(value)]}return result}(source);return 1==matchData.length&&matchData[0][2]?matchesStrictComparable(matchData[0][0],matchData[0][1]):function(object){return object===source||function(object,source,matchData,customizer){var index=matchData.length,length=index;if(null==object)return!length;for(object=Object(object);index--;){var data=matchData[index];if(data[2]?data[1]!==object[data[0]]:!(data[0]in object))return!1}for(;++index<length;){var key=(data=matchData[index])[0],objValue=object[key],srcValue=data[1];if(data[2]){if(void 0===objValue&&!(key in object))return!1}else if(!baseIsEqual(srcValue,objValue,3,customizer,new Stack))return!1}return!0}(object,0,matchData)}}function baseHasIn(object,key){return null!=object&&key in Object(object)}function hasPath(object,path,hasFunc){for(var index=-1,length=(path=castPath(path,object)).length,result=!1;++index<length;){var key=toKey(path[index]);if(!(result=null!=object&&hasFunc(object,key)))break;object=object[key]}return result||++index!=length?result:!!(length=null==object?0:object.length)&&isLength(length)&&isIndex(key,length)&&(isArray(object)||isArguments(object))}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function baseMatchesProperty(path,srcValue){return isKey(path)&&isStrictComparable(srcValue)?matchesStrictComparable(toKey(path),srcValue):function(object){var objValue=function(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}(object,path);return void 0===objValue&&objValue===srcValue?hasIn(object,path):baseIsEqual(srcValue,objValue,3)}}function property(path){return isKey(path)?(key=toKey(path),function(object){return null==object?void 0:object[key]}):function(path){return function(object){return baseGet(object,path)}}(path);var key}function baseIteratee(value){return"function"==typeof value?value:null==value?identity:"object"==typeof value?isArray(value)?baseMatchesProperty(value[0],value[1]):baseMatches(value):property(value)}function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}var eachFunc,baseEach=(eachFunc=baseForOwn,function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=-1,iterable=Object(collection);++index<length&&!1!==iteratee(iterable[index],index,iterable););return collection});function castFunction(value){return"function"==typeof value?value:identity}function forEach(collection,iteratee){return(isArray(collection)?arrayEach:baseEach)(collection,castFunction(iteratee))}function baseFilter(collection,predicate){var result=[];return baseEach(collection,function(value,index,collection2){predicate(value,index,collection2)&&result.push(value)}),result}function filter(collection,predicate){return(isArray(collection)?arrayFilter:baseFilter)(collection,baseIteratee(predicate))}function baseReduce(collection,iteratee,accumulator,initAccum,eachFunc){return eachFunc(collection,function(value,index,collection2){accumulator=initAccum?(initAccum=!1,value):iteratee(accumulator,value,index,collection2)}),accumulator}function reduce(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduce:baseReduce,initAccum=arguments.length<3;return func(collection,baseIteratee(iteratee),accumulator,initAccum,baseEach)}var createSet=Set&&1/setToArray(new Set([,-0]))[1]==1/0?function(values){return new Set(values)}:function(){};function baseUniq(array,iteratee,comparator){var index=-1,includes=arrayIncludes,length=array.length,isCommon=!0,result=[],seen=result;if(length>=200){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++index<length;){var value=array[index],computed=iteratee?iteratee(value):value;if(value=0!==value?value:0,isCommon&&computed==computed){for(var seenIndex=seen.length;seenIndex--;)if(seen[seenIndex]===computed)continue outer;iteratee&&seen.push(computed),result.push(value)}else includes(seen,computed,comparator)||(seen!==result&&seen.push(computed),result.push(value))}return result}export{baseEach as a,baseFlatten as b,baseIteratee as c,arrayMap as d,arrayPush as e,baseGetAllKeys as f,getSymbols as g,arrayEach as h,isSymbol as i,getAllKeys as j,keys as k,baseUniq as l,filter as m,forEach as n,baseFindIndex as o,castFunction as p,baseForOwn as q,reduce as r,stubArray as s,hasPath as t,castPath as u,toKey as v,baseGet as w,hasIn as x,toString as y};
|
|
1
|
+
import{aW as isObjectLike,bj as baseGetTag,aG as isArray,aU as Symbol$1,aF as isArrayLike,bk as arrayLikeKeys,bl as baseKeys,bm as memoize,bn as isArguments,bo as MapCache,bp as eq,bq as Uint8Array,aX as getTag,b0 as isBuffer,b3 as Stack,br as isTypedArray,a_ as isObject,bs as isLength,bt as isIndex,aH as identity,bu as baseFor,bv as Set}from"./mermaid.core-O3WUNQR6.js";function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&"[object Symbol]"==baseGetTag(value)}function arrayMap(array,iteratee){for(var index=-1,length=null==array?0:array.length,result=Array(length);++index<length;)result[index]=iteratee(array[index],index,array);return result}var symbolProto$1=Symbol$1?Symbol$1.prototype:void 0,symbolToString=symbolProto$1?symbolProto$1.toString:void 0;function baseToString(value){if("string"==typeof value)return value;if(isArray(value))return arrayMap(value,baseToString)+"";if(isSymbol(value))return symbolToString?symbolToString.call(value):"";var result=value+"";return"0"==result&&1/value==-1/0?"-0":result}function arrayEach(array,iteratee){for(var index=-1,length=null==array?0:array.length;++index<length&&!1!==iteratee(array[index],index,array););return array}function baseFindIndex(array,predicate,fromIndex,fromRight){for(var length=array.length,index=fromIndex+-1;++index<length;)if(predicate(array[index],index,array))return index;return-1}function baseIsNaN(value){return value!=value}function arrayIncludes(array,value){return!!(null==array?0:array.length)&&function(array,value,fromIndex){return value==value?function(array,value,fromIndex){for(var index=fromIndex-1,length=array.length;++index<length;)if(array[index]===value)return index;return-1}(array,value,fromIndex):baseFindIndex(array,baseIsNaN,fromIndex)}(array,value,0)>-1}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(value,object){if(isArray(value))return!1;var type=typeof value;return!("number"!=type&&"symbol"!=type&&"boolean"!=type&&null!=value&&!isSymbol(value))||(reIsPlainProp.test(value)||!reIsDeepProp.test(value)||null!=object&&value in Object(object))}var func,result,cache,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=(func=function(string){var result=[];return 46===string.charCodeAt(0)&&result.push(""),string.replace(rePropName,function(match,number,quote,subString){result.push(quote?subString.replace(reEscapeChar,"$1"):number||match)}),result},result=memoize(func,function(key){return 500===cache.size&&cache.clear(),key}),cache=result.cache,result);function toString(value){return null==value?"":baseToString(value)}function castPath(value,object){return isArray(value)?value:isKey(value,object)?[value]:stringToPath(toString(value))}function toKey(value){if("string"==typeof value||isSymbol(value))return value;var result=value+"";return"0"==result&&1/value==-1/0?"-0":result}function baseGet(object,path){for(var index=0,length=(path=castPath(path,object)).length;null!=object&&index<length;)object=object[toKey(path[index++])];return index&&index==length?object:void 0}function arrayPush(array,values){for(var index=-1,length=values.length,offset=array.length;++index<length;)array[offset+index]=values[index];return array}var spreadableSymbol=Symbol$1?Symbol$1.isConcatSpreadable:void 0;function isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol])}function baseFlatten(array,depth,predicate,isStrict,result){var index=-1,length=array.length;for(predicate||(predicate=isFlattenable),result||(result=[]);++index<length;){var value=array[index];predicate(value)?arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function arrayReduce(array,iteratee,accumulator,initAccum){var index=-1,length=null==array?0:array.length;for(initAccum&&length&&(accumulator=array[++index]);++index<length;)accumulator=iteratee(accumulator,array[index],index,array);return accumulator}function arrayFilter(array,predicate){for(var index=-1,length=null==array?0:array.length,resIndex=0,result=[];++index<length;){var value=array[index];predicate(value,index,array)&&(result[resIndex++]=value)}return result}function stubArray(){return[]}var propertyIsEnumerable=Object.prototype.propertyIsEnumerable,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbols=nativeGetSymbols?function(object){return null==object?[]:(object=Object(object),arrayFilter(nativeGetSymbols(object),function(symbol){return propertyIsEnumerable.call(object,symbol)}))}:stubArray;function baseGetAllKeys(object,keysFunc,symbolsFunc){var result=keysFunc(object);return isArray(object)?result:arrayPush(result,symbolsFunc(object))}function getAllKeys(object){return baseGetAllKeys(object,keys,getSymbols)}function SetCache(values){var index=-1,length=null==values?0:values.length;for(this.__data__=new MapCache;++index<length;)this.add(values[index])}function arraySome(array,predicate){for(var index=-1,length=null==array?0:array.length;++index<length;)if(predicate(array[index],index,array))return!0;return!1}function cacheHas(cache,key){return cache.has(key)}SetCache.prototype.add=SetCache.prototype.push=function(value){return this.__data__.set(value,"__lodash_hash_undefined__"),this},SetCache.prototype.has=function(value){return this.__data__.has(value)};function equalArrays(array,other,bitmask,customizer,equalFunc,stack){var isPartial=1&bitmask,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength))return!1;var arrStacked=stack.get(array),othStacked=stack.get(other);if(arrStacked&&othStacked)return arrStacked==other&&othStacked==array;var index=-1,result=!0,seen=2&bitmask?new SetCache:void 0;for(stack.set(array,other),stack.set(other,array);++index<arrLength;){var arrValue=array[index],othValue=other[index];if(customizer)var compared=isPartial?customizer(othValue,arrValue,index,other,array,stack):customizer(arrValue,othValue,index,array,other,stack);if(void 0!==compared){if(compared)continue;result=!1;break}if(seen){if(!arraySome(other,function(othValue2,othIndex){if(!cacheHas(seen,othIndex)&&(arrValue===othValue2||equalFunc(arrValue,othValue2,bitmask,customizer,stack)))return seen.push(othIndex)})){result=!1;break}}else if(arrValue!==othValue&&!equalFunc(arrValue,othValue,bitmask,customizer,stack)){result=!1;break}}return stack.delete(array),stack.delete(other),result}function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach(function(value,key){result[++index]=[key,value]}),result}function setToArray(set){var index=-1,result=Array(set.size);return set.forEach(function(value){result[++index]=value}),result}var symbolProto=Symbol$1?Symbol$1.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;var hasOwnProperty$1=Object.prototype.hasOwnProperty;var objectTag="[object Object]",hasOwnProperty=Object.prototype.hasOwnProperty;function baseIsEqualDeep(object,other,bitmask,customizer,equalFunc,stack){var objIsArr=isArray(object),othIsArr=isArray(other),objTag=objIsArr?"[object Array]":getTag(object),othTag=othIsArr?"[object Array]":getTag(other),objIsObj=(objTag="[object Arguments]"==objTag?objectTag:objTag)==objectTag,othIsObj=(othTag="[object Arguments]"==othTag?objectTag:othTag)==objectTag,isSameTag=objTag==othTag;if(isSameTag&&isBuffer(object)){if(!isBuffer(other))return!1;objIsArr=!0,objIsObj=!1}if(isSameTag&&!objIsObj)return stack||(stack=new Stack),objIsArr||isTypedArray(object)?equalArrays(object,other,bitmask,customizer,equalFunc,stack):function(object,other,tag,bitmask,customizer,equalFunc,stack){switch(tag){case"[object DataView]":if(object.byteLength!=other.byteLength||object.byteOffset!=other.byteOffset)return!1;object=object.buffer,other=other.buffer;case"[object ArrayBuffer]":return!(object.byteLength!=other.byteLength||!equalFunc(new Uint8Array(object),new Uint8Array(other)));case"[object Boolean]":case"[object Date]":case"[object Number]":return eq(+object,+other);case"[object Error]":return object.name==other.name&&object.message==other.message;case"[object RegExp]":case"[object String]":return object==other+"";case"[object Map]":var convert=mapToArray;case"[object Set]":var isPartial=1&bitmask;if(convert||(convert=setToArray),object.size!=other.size&&!isPartial)return!1;var stacked=stack.get(object);if(stacked)return stacked==other;bitmask|=2,stack.set(object,other);var result=equalArrays(convert(object),convert(other),bitmask,customizer,equalFunc,stack);return stack.delete(object),result;case"[object Symbol]":if(symbolValueOf)return symbolValueOf.call(object)==symbolValueOf.call(other)}return!1}(object,other,objTag,bitmask,customizer,equalFunc,stack);if(!(1&bitmask)){var objIsWrapped=objIsObj&&hasOwnProperty.call(object,"__wrapped__"),othIsWrapped=othIsObj&&hasOwnProperty.call(other,"__wrapped__");if(objIsWrapped||othIsWrapped){var objUnwrapped=objIsWrapped?object.value():object,othUnwrapped=othIsWrapped?other.value():other;return stack||(stack=new Stack),equalFunc(objUnwrapped,othUnwrapped,bitmask,customizer,stack)}}return!!isSameTag&&(stack||(stack=new Stack),function(object,other,bitmask,customizer,equalFunc,stack){var isPartial=1&bitmask,objProps=getAllKeys(object),objLength=objProps.length;if(objLength!=getAllKeys(other).length&&!isPartial)return!1;for(var index=objLength;index--;){var key=objProps[index];if(!(isPartial?key in other:hasOwnProperty$1.call(other,key)))return!1}var objStacked=stack.get(object),othStacked=stack.get(other);if(objStacked&&othStacked)return objStacked==other&&othStacked==object;var result=!0;stack.set(object,other),stack.set(other,object);for(var skipCtor=isPartial;++index<objLength;){var objValue=object[key=objProps[index]],othValue=other[key];if(customizer)var compared=isPartial?customizer(othValue,objValue,key,other,object,stack):customizer(objValue,othValue,key,object,other,stack);if(!(void 0===compared?objValue===othValue||equalFunc(objValue,othValue,bitmask,customizer,stack):compared)){result=!1;break}skipCtor||(skipCtor="constructor"==key)}if(result&&!skipCtor){var objCtor=object.constructor,othCtor=other.constructor;objCtor==othCtor||!("constructor"in object)||!("constructor"in other)||"function"==typeof objCtor&&objCtor instanceof objCtor&&"function"==typeof othCtor&&othCtor instanceof othCtor||(result=!1)}return stack.delete(object),stack.delete(other),result}(object,other,bitmask,customizer,equalFunc,stack))}function baseIsEqual(value,other,bitmask,customizer,stack){return value===other||(null==value||null==other||!isObjectLike(value)&&!isObjectLike(other)?value!=value&&other!=other:baseIsEqualDeep(value,other,bitmask,customizer,baseIsEqual,stack))}function isStrictComparable(value){return value==value&&!isObject(value)}function matchesStrictComparable(key,srcValue){return function(object){return null!=object&&(object[key]===srcValue&&(void 0!==srcValue||key in Object(object)))}}function baseMatches(source){var matchData=function(object){for(var result=keys(object),length=result.length;length--;){var key=result[length],value=object[key];result[length]=[key,value,isStrictComparable(value)]}return result}(source);return 1==matchData.length&&matchData[0][2]?matchesStrictComparable(matchData[0][0],matchData[0][1]):function(object){return object===source||function(object,source,matchData,customizer){var index=matchData.length,length=index;if(null==object)return!length;for(object=Object(object);index--;){var data=matchData[index];if(data[2]?data[1]!==object[data[0]]:!(data[0]in object))return!1}for(;++index<length;){var key=(data=matchData[index])[0],objValue=object[key],srcValue=data[1];if(data[2]){if(void 0===objValue&&!(key in object))return!1}else if(!baseIsEqual(srcValue,objValue,3,customizer,new Stack))return!1}return!0}(object,0,matchData)}}function baseHasIn(object,key){return null!=object&&key in Object(object)}function hasPath(object,path,hasFunc){for(var index=-1,length=(path=castPath(path,object)).length,result=!1;++index<length;){var key=toKey(path[index]);if(!(result=null!=object&&hasFunc(object,key)))break;object=object[key]}return result||++index!=length?result:!!(length=null==object?0:object.length)&&isLength(length)&&isIndex(key,length)&&(isArray(object)||isArguments(object))}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function baseMatchesProperty(path,srcValue){return isKey(path)&&isStrictComparable(srcValue)?matchesStrictComparable(toKey(path),srcValue):function(object){var objValue=function(object,path,defaultValue){var result=null==object?void 0:baseGet(object,path);return void 0===result?defaultValue:result}(object,path);return void 0===objValue&&objValue===srcValue?hasIn(object,path):baseIsEqual(srcValue,objValue,3)}}function property(path){return isKey(path)?(key=toKey(path),function(object){return null==object?void 0:object[key]}):function(path){return function(object){return baseGet(object,path)}}(path);var key}function baseIteratee(value){return"function"==typeof value?value:null==value?identity:"object"==typeof value?isArray(value)?baseMatchesProperty(value[0],value[1]):baseMatches(value):property(value)}function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}var eachFunc,baseEach=(eachFunc=baseForOwn,function(collection,iteratee){if(null==collection)return collection;if(!isArrayLike(collection))return eachFunc(collection,iteratee);for(var length=collection.length,index=-1,iterable=Object(collection);++index<length&&!1!==iteratee(iterable[index],index,iterable););return collection});function castFunction(value){return"function"==typeof value?value:identity}function forEach(collection,iteratee){return(isArray(collection)?arrayEach:baseEach)(collection,castFunction(iteratee))}function baseFilter(collection,predicate){var result=[];return baseEach(collection,function(value,index,collection2){predicate(value,index,collection2)&&result.push(value)}),result}function filter(collection,predicate){return(isArray(collection)?arrayFilter:baseFilter)(collection,baseIteratee(predicate))}function baseReduce(collection,iteratee,accumulator,initAccum,eachFunc){return eachFunc(collection,function(value,index,collection2){accumulator=initAccum?(initAccum=!1,value):iteratee(accumulator,value,index,collection2)}),accumulator}function reduce(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduce:baseReduce,initAccum=arguments.length<3;return func(collection,baseIteratee(iteratee),accumulator,initAccum,baseEach)}var createSet=Set&&1/setToArray(new Set([,-0]))[1]==1/0?function(values){return new Set(values)}:function(){};function baseUniq(array,iteratee,comparator){var index=-1,includes=arrayIncludes,length=array.length,isCommon=!0,result=[],seen=result;if(length>=200){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++index<length;){var value=array[index],computed=iteratee?iteratee(value):value;if(value=0!==value?value:0,isCommon&&computed==computed){for(var seenIndex=seen.length;seenIndex--;)if(seen[seenIndex]===computed)continue outer;iteratee&&seen.push(computed),result.push(value)}else includes(seen,computed,comparator)||(seen!==result&&seen.push(computed),result.push(value))}return result}export{baseEach as a,baseFlatten as b,baseIteratee as c,arrayMap as d,arrayPush as e,baseGetAllKeys as f,getSymbols as g,arrayEach as h,isSymbol as i,getAllKeys as j,keys as k,baseUniq as l,filter as m,forEach as n,baseFindIndex as o,castFunction as p,baseForOwn as q,reduce as r,stubArray as s,hasPath as t,castPath as u,toKey as v,baseGet as w,hasIn as x,toString as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as withPath,a0 as pi,a1 as cos,a2 as sin,a3 as constant,a4 as halfPi,a5 as epsilon,a6 as tau,a7 as sqrt,a8 as min,a9 as abs,aa as atan2,ab as max,ac as asin,ad as acos}from"./mermaid.core-
|
|
1
|
+
import{$ as withPath,a0 as pi,a1 as cos,a2 as sin,a3 as constant,a4 as halfPi,a5 as epsilon,a6 as tau,a7 as sqrt,a8 as min,a9 as abs,aa as atan2,ab as max,ac as asin,ad as acos}from"./mermaid.core-O3WUNQR6.js";function arcInnerRadius(d){return d.innerRadius}function arcOuterRadius(d){return d.outerRadius}function arcStartAngle(d){return d.startAngle}function arcEndAngle(d){return d.endAngle}function arcPadAngle(d){return d&&d.padAngle}function cornerTangents(x0,y0,x1,y1,r1,rc,cw){var x01=x0-x1,y01=y0-y1,lo=(cw?rc:-rc)/sqrt(x01*x01+y01*y01),ox=lo*y01,oy=-lo*x01,x11=x0+ox,y11=y0+oy,x10=x1+ox,y10=y1+oy,x00=(x11+x10)/2,y00=(y11+y10)/2,dx=x10-x11,dy=y10-y11,d2=dx*dx+dy*dy,r=r1-rc,D=x11*y10-x10*y11,d=(dy<0?-1:1)*sqrt(max(0,r*r*d2-D*D)),cx0=(D*dy-dx*d)/d2,cy0=(-D*dx-dy*d)/d2,cx1=(D*dy+dx*d)/d2,cy1=(-D*dx+dy*d)/d2,dx0=cx0-x00,dy0=cy0-y00,dx1=cx1-x00,dy1=cy1-y00;return dx0*dx0+dy0*dy0>dx1*dx1+dy1*dy1&&(cx0=cx1,cy0=cy1),{cx:cx0,cy:cy0,x01:-ox,y01:-oy,x11:cx0*(r1/r-1),y11:cy0*(r1/r-1)}}function d3arc(){var innerRadius=arcInnerRadius,outerRadius=arcOuterRadius,cornerRadius=constant(0),padRadius=null,startAngle=arcStartAngle,endAngle=arcEndAngle,padAngle=arcPadAngle,context=null,path=withPath(arc);function arc(){var buffer,r,r0=+innerRadius.apply(this,arguments),r1=+outerRadius.apply(this,arguments),a0=startAngle.apply(this,arguments)-halfPi,a1=endAngle.apply(this,arguments)-halfPi,da=abs(a1-a0),cw=a1>a0;if(context||(context=buffer=path()),r1<r0&&(r=r1,r1=r0,r0=r),r1>epsilon)if(da>tau-epsilon)context.moveTo(r1*cos(a0),r1*sin(a0)),context.arc(0,0,r1,a0,a1,!cw),r0>epsilon&&(context.moveTo(r0*cos(a1),r0*sin(a1)),context.arc(0,0,r0,a1,a0,cw));else{var t0,t1,a01=a0,a11=a1,a00=a0,a10=a1,da0=da,da1=da,ap=padAngle.apply(this,arguments)/2,rp=ap>epsilon&&(padRadius?+padRadius.apply(this,arguments):sqrt(r0*r0+r1*r1)),rc=min(abs(r1-r0)/2,+cornerRadius.apply(this,arguments)),rc0=rc,rc1=rc;if(rp>epsilon){var p0=asin(rp/r0*sin(ap)),p1=asin(rp/r1*sin(ap));(da0-=2*p0)>epsilon?(a00+=p0*=cw?1:-1,a10-=p0):(da0=0,a00=a10=(a0+a1)/2),(da1-=2*p1)>epsilon?(a01+=p1*=cw?1:-1,a11-=p1):(da1=0,a01=a11=(a0+a1)/2)}var x01=r1*cos(a01),y01=r1*sin(a01),x10=r0*cos(a10),y10=r0*sin(a10);if(rc>epsilon){var oc,x11=r1*cos(a11),y11=r1*sin(a11),x00=r0*cos(a00),y00=r0*sin(a00);if(da<pi)if(oc=function(x0,y0,x1,y1,x2,y2,x3,y3){var x10=x1-x0,y10=y1-y0,x32=x3-x2,y32=y3-y2,t=y32*x10-x32*y10;if(!(t*t<epsilon))return[x0+(t=(x32*(y0-y2)-y32*(x0-x2))/t)*x10,y0+t*y10]}(x01,y01,x00,y00,x11,y11,x10,y10)){var ax=x01-oc[0],ay=y01-oc[1],bx=x11-oc[0],by=y11-oc[1],kc=1/sin(acos((ax*bx+ay*by)/(sqrt(ax*ax+ay*ay)*sqrt(bx*bx+by*by)))/2),lc=sqrt(oc[0]*oc[0]+oc[1]*oc[1]);rc0=min(rc,(r0-lc)/(kc-1)),rc1=min(rc,(r1-lc)/(kc+1))}else rc0=rc1=0}da1>epsilon?rc1>epsilon?(t0=cornerTangents(x00,y00,x01,y01,r1,rc1,cw),t1=cornerTangents(x11,y11,x10,y10,r1,rc1,cw),context.moveTo(t0.cx+t0.x01,t0.cy+t0.y01),rc1<rc?context.arc(t0.cx,t0.cy,rc1,atan2(t0.y01,t0.x01),atan2(t1.y01,t1.x01),!cw):(context.arc(t0.cx,t0.cy,rc1,atan2(t0.y01,t0.x01),atan2(t0.y11,t0.x11),!cw),context.arc(0,0,r1,atan2(t0.cy+t0.y11,t0.cx+t0.x11),atan2(t1.cy+t1.y11,t1.cx+t1.x11),!cw),context.arc(t1.cx,t1.cy,rc1,atan2(t1.y11,t1.x11),atan2(t1.y01,t1.x01),!cw))):(context.moveTo(x01,y01),context.arc(0,0,r1,a01,a11,!cw)):context.moveTo(x01,y01),r0>epsilon&&da0>epsilon?rc0>epsilon?(t0=cornerTangents(x10,y10,x11,y11,r0,-rc0,cw),t1=cornerTangents(x01,y01,x00,y00,r0,-rc0,cw),context.lineTo(t0.cx+t0.x01,t0.cy+t0.y01),rc0<rc?context.arc(t0.cx,t0.cy,rc0,atan2(t0.y01,t0.x01),atan2(t1.y01,t1.x01),!cw):(context.arc(t0.cx,t0.cy,rc0,atan2(t0.y01,t0.x01),atan2(t0.y11,t0.x11),!cw),context.arc(0,0,r0,atan2(t0.cy+t0.y11,t0.cx+t0.x11),atan2(t1.cy+t1.y11,t1.cx+t1.x11),cw),context.arc(t1.cx,t1.cy,rc0,atan2(t1.y11,t1.x11),atan2(t1.y01,t1.x01),!cw))):context.arc(0,0,r0,a10,a00,cw):context.lineTo(x10,y10)}else context.moveTo(0,0);if(context.closePath(),buffer)return context=null,buffer+""||null}return arc.centroid=function(){var r=(+innerRadius.apply(this,arguments)+ +outerRadius.apply(this,arguments))/2,a=(+startAngle.apply(this,arguments)+ +endAngle.apply(this,arguments))/2-pi/2;return[cos(a)*r,sin(a)*r]},arc.innerRadius=function(_){return arguments.length?(innerRadius="function"==typeof _?_:constant(+_),arc):innerRadius},arc.outerRadius=function(_){return arguments.length?(outerRadius="function"==typeof _?_:constant(+_),arc):outerRadius},arc.cornerRadius=function(_){return arguments.length?(cornerRadius="function"==typeof _?_:constant(+_),arc):cornerRadius},arc.padRadius=function(_){return arguments.length?(padRadius=null==_?null:"function"==typeof _?_:constant(+_),arc):padRadius},arc.startAngle=function(_){return arguments.length?(startAngle="function"==typeof _?_:constant(+_),arc):startAngle},arc.endAngle=function(_){return arguments.length?(endAngle="function"==typeof _?_:constant(+_),arc):endAngle},arc.padAngle=function(_){return arguments.length?(padAngle="function"==typeof _?_:constant(+_),arc):padAngle},arc.context=function(_){return arguments.length?(context=null==_?null:_,arc):context},arc}export{d3arc as d};
|