fourth-spark 0.11.8 → 0.11.9
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/drizzle/meta/0007_snapshot.json +1 -1
- package/drizzle/meta/_journal.json +2 -2
- package/package.json +1 -1
- package/public/assets/{index-BJ7zcO9i.js → index-CGMcafOU.js} +2 -2
- package/public/assets/{web-wAoVnzPB.js → web-BV4h1AI4.js} +1 -1
- package/public/index.html +1 -1
- /package/drizzle/{0007_classy_steve_rogers.sql → 0007_aromatic_gateway.sql} +0 -0
package/package.json
CHANGED
|
@@ -492,7 +492,7 @@ Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}
|
|
|
492
492
|
*
|
|
493
493
|
* This source code is licensed under the ISC license.
|
|
494
494
|
* See the LICENSE file in the root directory of this source tree.
|
|
495
|
-
*/const Nz=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],nc=Re("zap",Nz);function tI(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=tI(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function re(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=tI(e))&&(r&&(r+=" "),r+=t);return r}const Pw=e=>{let t;const n=new Set,r=(f,m)=>{const p=typeof f=="function"?f(t):f;if(!Object.is(p,t)){const b=t;t=m??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(x=>x(t,b))}},a=()=>t,u={setState:r,getState:a,getInitialState:()=>d,subscribe:f=>(n.add(f),()=>n.delete(f))},d=t=e(r,a,u);return u},_z=(e=>e?Pw(e):Pw),Tz=e=>e;function Sz(e,t=Tz){const n=Md.useSyncExternalStore(e.subscribe,Md.useCallback(()=>t(e.getState()),[e,t]),Md.useCallback(()=>t(e.getInitialState()),[e,t]));return Md.useDebugValue(n),n}const Bw=e=>{const t=_z(e),n=r=>Sz(t,r);return Object.assign(n,t),n},ei=(e=>e?Bw(e):Bw),Ix="fs-theme";function nI(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Uw(e){return e==="system"?nI():e}function zw(e){e==="system"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}const Wy=ei((e,t)=>({preference:localStorage.getItem(Ix)??"system",resolved:Uw(localStorage.getItem(Ix)??"system"),cycle(){const n=["system","light","dark"],r=n[(n.indexOf(t().preference)+1)%n.length],a=Uw(r);localStorage.setItem(Ix,r),zw(r),e({preference:r,resolved:a})},init(){zw(t().preference);const n=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{const{preference:a}=t();if(a==="system"){const s=nI();e({resolved:s})}};return n.addEventListener("change",r),()=>n.removeEventListener("change",r)}})),ap="fourth-spark-server-url";function wz(){if(typeof window>"u")return!1;const t=window.Capacitor;return typeof(t==null?void 0:t.isNativePlatform)=="function"&&t.isNativePlatform()}function A1(){return localStorage.getItem(ap)??""}function Az(e){const t=e.replace(/\/+$/,"");t?localStorage.setItem(ap,t):localStorage.removeItem(ap)}function Xy(){return localStorage.getItem(ap)??""}class ns extends Error{constructor(n,r){super(n);un(this,"status");this.name="ApiError",this.status=r}}async function Ae(e,t){let n;try{n=await fetch(A1()+e,{...t,headers:{Accept:"application/json",...t!=null&&t.body?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers}})}catch(a){throw new ns(a instanceof Error?a.message:"Network request failed",0)}if(!n.ok){const a=await n.text().catch(()=>"");throw new ns(a.trim()||`${n.status} ${n.statusText}`,n.status)}if(n.status===204)return;const r=await n.text();if(r)return JSON.parse(r)}function Zr(e,...t){if(Array.isArray(e))return e;if(e&&typeof e=="object"){const n=e;for(const r of[...t,"data","items"])if(Array.isArray(n[r]))return n[r]}return[]}async function Cz(){return Zr(await Ae("/api/repos"),"repos")}async function kz(e,t,n,r){return Ae("/api/repos",{method:"POST",body:JSON.stringify({name:e,gitUrl:t,localPath:n,runtimeType:r})})}async function Oz(e){return Ae("/api/repos/resolve",{method:"POST",body:JSON.stringify({localPath:e})})}async function Iz(e){await Ae(`/api/repos/${encodeURIComponent(e)}`,{method:"DELETE"})}async function Rz(e){await Ae(`/api/repos/${encodeURIComponent(e)}/start`,{method:"POST"})}async function Mz(e){await Ae(`/api/repos/${encodeURIComponent(e)}/stop`,{method:"POST"})}async function jz(e){return Ae(`/api/repos/${encodeURIComponent(e)}/branches`)}async function Dz(e,t){return Ae(`/api/repos/${encodeURIComponent(e)}/checkout`,{method:"POST",body:JSON.stringify({branch:t})})}async function Lz(e){return Ae(`/api/repos/${encodeURIComponent(e)}/pull`,{method:"POST"})}function et(e){return`/api/repos/${encodeURIComponent(e)}`}async function Pz(e){return Zr(await Ae(`${et(e)}/workspaces`),"workspaces")}async function Bz(e,t){await Ae(`${et(e)}/workspaces/${encodeURIComponent(t)}`,{method:"DELETE"})}async function Uz(e){return Ae(`${et(e)}/workspaces/cleanup`,{method:"POST"})}async function zz(e,t){await Ae(`/api/repos/${e}/worktree`,{method:"PATCH",body:JSON.stringify({enabled:t})})}async function Fz(e,t){await Ae(`/api/repos/${e}/runtime`,{method:"PATCH",body:JSON.stringify({runtimeType:t})})}async function Hz(e){return Zr(await Ae(`${et(e)}/sessions`),"sessions")}async function $z(e,t,n,r,a,s,l,u){return Ae(`${et(e)}/sessions`,{method:"POST",body:JSON.stringify({message:t,agent:n,model:r,variant:a,issueId:s,customAgentId:l,files:u})})}async function Yz(e,t){await Ae(`${et(e)}/sessions/${encodeURIComponent(t)}`,{method:"DELETE"})}async function qz(e,t,n,r,a,s,l){await Ae(`${et(e)}/sessions/${encodeURIComponent(t)}/prompt`,{method:"POST",body:JSON.stringify({content:n,agent:r,model:a,variant:s,files:l})})}async function Gz(e,t){await Ae(`${et(e)}/sessions/${encodeURIComponent(t)}/abort`,{method:"POST"})}async function Kz(e,t,n){await Ae(`${et(e)}/sessions/${encodeURIComponent(t)}/questions/reply`,{method:"POST",body:JSON.stringify({answers:n})})}async function Vz(e,t){await Ae(`${et(e)}/sessions/${encodeURIComponent(t)}/questions/reject`,{method:"POST"})}async function Wz(e,t,n){return Ae(`${et(e)}/sessions/${encodeURIComponent(t)}/revert`,{method:"POST",body:JSON.stringify({messageID:n})})}function Fw(e){const t=e,n=t.info;if(n&&typeof n.id=="string"){const r=Array.isArray(t.parts)?t.parts:void 0;return{...n,...r?{parts:r}:{}}}return t}async function Hw(e,t,n){const r=new URLSearchParams;n!=null&&n.limit&&r.set("limit",String(n.limit)),n!=null&&n.before&&r.set("before",n.before);const a=r.toString(),s=`${et(e)}/sessions/${encodeURIComponent(t)}/messages${a?`?${a}`:""}`,l=await Ae(s);if(Array.isArray(l)){const f=l.map(Fw);return{messages:f,total:f.length,hasMore:!1}}const u=l,d=Array.isArray(u.messages)?u.messages:[];return{messages:d.map(Fw),total:u.total??d.length,hasMore:u.hasMore??!1}}async function Xz(e,t){return Ae(`${et(e)}/sessions/${encodeURIComponent(t)}/status`)}async function Qz(e,t){return Ae(`${et(e)}/sessions/${encodeURIComponent(t)}/links`)}async function Zz(e,t){return Ae(`${et(e)}/sessions/snapshot/${encodeURIComponent(t)}`)}async function rI(e){return Ae(`${et(e)}/sessions/all-links`)}async function Jz(e,t,n,r){await Ae(`${et(e)}/sessions/${encodeURIComponent(t)}/links`,{method:"POST",body:JSON.stringify({type:n,targetId:r})})}async function eF(e,t,n,r){await Ae(`${et(e)}/sessions/${encodeURIComponent(t)}/links`,{method:"DELETE",body:JSON.stringify({type:n,targetId:r})})}async function aI(){return Zr(await Ae("/api/custom-agents"))}async function tF(e){return Ae("/api/custom-agents",{method:"POST",body:JSON.stringify(e)})}async function nF(e,t){return Ae(`/api/custom-agents/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function iI(e){await Ae(`/api/custom-agents/${encodeURIComponent(e)}`,{method:"DELETE"})}async function $w(e){return Ae(`/api/custom-agents/${encodeURIComponent(e)}/export`)}async function rF(e){return Ae("/api/custom-agents/import",{method:"POST",body:JSON.stringify(e)})}async function sI(e,t){const n=new URLSearchParams;t!=null&&t.category&&n.set("category",t.category),t!=null&&t.includeSuperseded&&n.set("includeSuperseded","true");const r=n.toString();return Ae(`/api/custom-agents/${encodeURIComponent(e)}/memories${r?`?${r}`:""}`)}async function aF(e,t,n){return Ae(`/api/custom-agents/${encodeURIComponent(e)}/memories/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(n)})}async function iF(e,t){await Ae(`/api/custom-agents/${encodeURIComponent(e)}/memories/${encodeURIComponent(t)}`,{method:"DELETE"})}async function sF(e,t){return Ae(`/api/custom-agents/${encodeURIComponent(e)}/memories/extract`,{method:"POST",body:JSON.stringify({sessionIds:t})})}async function Yw(e){return Ae(`/api/custom-agents/${encodeURIComponent(e)}/memories/stats`)}async function lF(e){return Ae(`/api/custom-agents/${encodeURIComponent(e)}/memories/consolidate`,{method:"POST"})}async function C1(e){return Ae(`/api/custom-agents/${encodeURIComponent(e)}/sessions`)}async function lI(e){return Zr(await Ae(`${et(e)}/custom-agents`))}async function oF(e,t){return Ae(`${et(e)}/custom-agents`,{method:"POST",body:JSON.stringify(t)})}async function wf(e){return Zr(await Ae(`${et(e)}/models`))}async function oI(){return Zr(await Ae("/api/prompt-fragments"))}async function uF(e){return Ae("/api/prompt-fragments",{method:"POST",body:JSON.stringify(e)})}async function cF(e,t){return Ae(`/api/prompt-fragments/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function dF(e){await Ae(`/api/prompt-fragments/${encodeURIComponent(e)}`,{method:"DELETE"})}async function qw(e){return Zr(await Ae(`${et(e)}/tags`))}async function Gw(e,t){return Zr(await Ae(`${et(e)}/milestones`))}async function Kw(e,t="open"){return Zr(await Ae(`${et(e)}/issues?state=${encodeURIComponent(t)}`),"issues")}async function fF(e,t="all"){return Ae(`${et(e)}/issues/sync`,{method:"POST",body:JSON.stringify({state:t})})}async function hF(e,t,n){return Ae(`${et(e)}/issues`,{method:"POST",body:JSON.stringify({title:t,body:n})})}async function mF(e,t,n){await Ae(`${et(e)}/issues/${t}/children`,{method:"POST",body:JSON.stringify({childNumber:n})})}async function uI(e,t,n){return Ae(`${et(e)}/issues/${t}`,{method:"PATCH",body:JSON.stringify(n)})}async function pF(e,t){return Zr(await Ae(`${et(e)}/issues/${t}/pulls`))}async function Vw(e,t="open"){return Zr(await Ae(`${et(e)}/pulls?state=${encodeURIComponent(t)}`))}async function gF(e,t="all"){return Ae(`${et(e)}/pulls/sync`,{method:"POST",body:JSON.stringify({state:t})})}async function bF(e,t){return Ae(`${et(e)}/pulls/${t}`)}async function xF(e,t){await Ae(`${et(e)}/pulls/${t}/merge`,{method:"POST"})}async function k1(e,t){return Zr(await Ae(`${et(e)}/pulls/${t}/issues`))}async function yF(e,t,n){await Ae(`${et(e)}/pulls/${t}/issues`,{method:"POST",body:JSON.stringify({issueNumber:n})})}async function vF(e,t,n){await Ae(`${et(e)}/pulls/${t}/issues/${n}`,{method:"DELETE"})}async function EF(e,t){return Ae(`${et(e)}/pulls/${t}/comments`)}async function NF(e,t){return Ae(`${et(e)}/issues/${t}/comments`)}async function Ww(e,t,n){return Ae(`${et(e)}/issues/${t}/comments`,{method:"POST",body:JSON.stringify({body:n})})}async function _F(e,t,n){return Ae(`${et(e)}/issues/${t}/polish`,{method:"POST",body:JSON.stringify({draft:n})})}async function Xw(e,t){return Ae(`${et(e)}/issues/${t}/draft`)}async function TF(e,t,n){return Ae(`${et(e)}/issues/polish-create`,{method:"POST",body:JSON.stringify({title:t,body:n})})}async function Qw(e){return Ae(`${et(e)}/issues/draft-create`)}async function SF(e){await Ae(`${et(e)}/issues/draft-create`,{method:"DELETE"})}async function wF(e,t,n){await Ae(`${et(e)}/sessions/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({title:n})})}async function AF(e,t,n){await Ae(`${et(e)}/sessions/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({completedAt:n})})}async function CF(){return Ae("/api/agents-md")}async function kF(e){await Ae("/api/agents-md",{method:"PUT",body:JSON.stringify({content:e})})}async function OF(e){return Ae(`/api/repos/${encodeURIComponent(e)}/agents-md`)}async function IF(e,t){await Ae(`/api/repos/${encodeURIComponent(e)}/agents-md`,{method:"PUT",body:JSON.stringify({content:t})})}function RF(e){return`${A1()}${et(e)}/events`}async function MF(e){return Ae(`${et(e)}/sessions/status`)}async function uo(){return Ae("/api/settings")}async function ip(e,t){await Ae(`/api/settings/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({value:t})})}async function Qy(){return Ae("/api/cloud/status")}async function jF(){return Ae("/api/cloud/reload",{method:"POST"})}async function DF(e){try{return(await Ae("/api/cloud/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})})).connected}catch{return!1}}async function O1(){return Zr(await Ae("/api/git-hosts"),"gitHosts")}async function LF(e,t,n,r="gitea"){return Ae("/api/git-hosts",{method:"POST",body:JSON.stringify({host:e,name:t,token:n,platform:r})})}async function PF(e){await Ae(`/api/git-hosts/${encodeURIComponent(e)}`,{method:"DELETE"})}async function cI(){return Ae("/api/usage")}async function dI(e){return Ae("/api/usage/switch",{method:"POST",body:JSON.stringify({accountId:e})})}async function BF(){return Ae("/api/usage/authorize",{method:"POST"})}async function UF(e,t){return Ae("/api/usage/exchange",{method:"POST",body:JSON.stringify({pendingId:e,code:t})})}async function zF(e,t){return Ae(`${et(e)}/sessions/${encodeURIComponent(t)}/files`)}function FF(e,t,n){return`${A1()}${et(e)}/sessions/${encodeURIComponent(t)}/files/${n}`}async function Rx(e,t,n,r){const a=new URLSearchParams({from:String(e),to:String(t),groupBy:n});return Ae(`/api/analytics/summary?${a}`)}const Ws="fs-active-repo",Fe=ei((e,t)=>({repos:[],activeRepoId:localStorage.getItem(Ws),loading:!0,loadError:null,loadRepos:async()=>{e({loading:!0,loadError:null});try{const n=await Cz(),r=t().activeRepoId,a=r&&n.some(l=>l.id===r);e({repos:n,loading:!1,activeRepoId:a?r:n.length>0?n[0].id:null});const s=t().activeRepoId;s?localStorage.setItem(Ws,s):localStorage.removeItem(Ws)}catch(n){e({loading:!1,loadError:n instanceof Error?n.message:"Failed to load repos"})}},setActiveRepo:n=>{e({activeRepoId:n}),n?localStorage.setItem(Ws,n):localStorage.removeItem(Ws)},addRepo:async(n,r,a,s)=>{try{const l=await kz(n,r,a,s);return e(u=>({repos:[...u.repos,l],activeRepoId:l.id})),localStorage.setItem(Ws,l.id),l}catch(l){return e({loadError:l instanceof Error?l.message:"Failed to add repo"}),null}},removeRepo:async n=>{try{await Iz(n)}catch{}e(r=>{const a=r.repos.filter(l=>l.id!==n),s=r.activeRepoId===n?a.length>0?a[0].id:null:r.activeRepoId;return s?localStorage.setItem(Ws,s):localStorage.removeItem(Ws),{repos:a,activeRepoId:s}})},updateRepoBranch:(n,r)=>{e(a=>({repos:a.repos.map(s=>s.id===n?{...s,branch:r}:s)}))}})),Jr=e=>{var t;return((t=e.repos.find(n=>n.id===e.activeRepoId))==null?void 0:t.name)??null},Zw="fs-nav-collapsed",Jw="fs-session-panel-collapsed",sp=ei(e=>({navCollapsed:localStorage.getItem(Zw)==="true",sessionPanelCollapsed:localStorage.getItem(Jw)==="true",toggleNav(){e(t=>{const n=!t.navCollapsed;return localStorage.setItem(Zw,String(n)),{navCollapsed:n}})},toggleSessionPanel(){e(t=>{const n=!t.sessionPanelCollapsed;return localStorage.setItem(Jw,String(n)),{sessionPanelCollapsed:n}})}})),fI=[{segment:"run",icon:w1,label:"运行面板",global:!1},{segment:"dev/issues",icon:KU,label:"研发",global:!1,matchPrefix:"dev"},{segment:"agents",icon:TU,label:"Agents",global:!1}];function hI(e,t,n){return t?`/${e}`:n?`/${encodeURIComponent(n)}/${e}`:`/${e}`}function mI(e,t,n){if(!e.matchPrefix)return!1;const r=e.global?`/${e.matchPrefix}`:n?`/${encodeURIComponent(n)}/${e.matchPrefix}`:null;return r?t===r||t.startsWith(`${r}/`):!1}function HF(e){const t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function $F({repos:e,activeRepoId:t,onRepoChange:n}){const r=Vn(),[a,s]=v.useState(!1),l=v.useRef(null),u=e.find(f=>f.id===t),d=v.useCallback(()=>s(!1),[]);return v.useEffect(()=>{if(!a)return;const f=m=>{l.current&&!l.current.contains(m.target)&&d()};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[a,d]),c.jsxs("div",{ref:l,className:"relative",children:[c.jsxs("button",{type:"button",onClick:()=>s(f=>!f),className:"flex max-w-[140px] items-center gap-1 rounded-md border border-line bg-base px-2 py-1 text-xs text-fg-2 transition-colors hover:border-blue-500 sm:max-w-[200px]",children:[c.jsx(q5,{className:"h-3 w-3 shrink-0 text-fg-4"}),c.jsxs("span",{className:"truncate",children:[c.jsx("span",{className:"sm:hidden",children:u?HF(u.name):""}),c.jsx("span",{className:"hidden sm:inline",children:(u==null?void 0:u.name)??""})]}),c.jsx(Ir,{className:re("h-3 w-3 shrink-0 text-fg-4 transition-transform",a&&"rotate-180")})]}),a&&c.jsxs("div",{className:"absolute left-0 top-full z-50 mt-1 w-64 overflow-hidden rounded-lg border border-line bg-surface shadow-lg",children:[c.jsx("div",{className:"max-h-64 overflow-y-auto py-1",children:e.map(f=>c.jsxs("button",{type:"button",onClick:()=>{n(f.id),d()},className:re("flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors",f.id===t?"font-medium text-blue-600":"text-fg-2 hover:bg-elevated"),children:[f.id===t?c.jsx(ur,{className:"h-3 w-3 shrink-0"}):c.jsx("span",{className:"h-3 w-3 shrink-0"}),c.jsx("span",{className:"truncate",children:f.name})]},f.id))}),c.jsx("div",{className:"border-t border-line",children:c.jsxs("button",{type:"button",onClick:()=>{r("/repos"),d()},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:[c.jsx(g0,{className:"h-3 w-3 shrink-0"}),c.jsx("span",{children:"管理仓库"})]})})]})]})}function YF({repoId:e,currentBranch:t}){const n=Fe(T=>T.updateRepoBranch),[r,a]=v.useState(!1),[s,l]=v.useState(null),[u,d]=v.useState(!1),[f,m]=v.useState(null),[p,b]=v.useState(null),x=v.useRef(null),E=v.useCallback(()=>{a(!1),b(null)},[]);v.useEffect(()=>{if(!r)return;const T=C=>{x.current&&!x.current.contains(C.target)&&E()};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[r,E]);const N=async()=>{if(r){E();return}a(!0),d(!0),b(null);try{l(await jz(e))}catch{b("加载分支失败")}finally{d(!1)}},w=async T=>{if(!(T===t||f)){m(T),b(null);try{const C=await Dz(e,T);n(e,C.branch),E()}catch(C){b(C instanceof Error?C.message:"切换失败")}finally{m(null)}}};return t?c.jsxs("div",{ref:x,className:"relative",children:[c.jsxs("button",{type:"button",onClick:N,className:"flex items-center gap-1 rounded-md bg-elevated px-2 py-1 text-xs text-fg-3 transition-colors hover:bg-blue-500/10 hover:text-blue-600",children:[c.jsx(Tf,{className:"h-3 w-3"}),t,c.jsx(Ir,{className:re("h-3 w-3 transition-transform",r&&"rotate-180")})]}),r&&c.jsxs("div",{className:"absolute right-0 top-full z-50 mt-1 w-56 overflow-hidden rounded-lg border border-line bg-surface shadow-lg",children:[u?c.jsx("div",{className:"flex items-center justify-center py-4",children:c.jsx(cn,{className:"h-4 w-4 animate-spin text-fg-4"})}):s?c.jsxs("div",{className:"max-h-64 overflow-y-auto py-1",children:[s.local.map(T=>c.jsxs("button",{type:"button",disabled:f!==null,onClick:()=>w(T),className:re("flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors",T===t?"font-medium text-blue-600":"text-fg-2 hover:bg-elevated"),children:[T===t?c.jsx(ur,{className:"h-3 w-3 shrink-0"}):f===T?c.jsx(cn,{className:"h-3 w-3 shrink-0 animate-spin"}):c.jsx("span",{className:"h-3 w-3 shrink-0"}),c.jsx("span",{className:"truncate",children:T})]},T)),s.remote.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"mx-3 my-1 border-t border-line"}),c.jsx("div",{className:"px-3 py-1 text-[10px] font-medium uppercase tracking-wider text-fg-4",children:"Remote"}),s.remote.map(T=>c.jsxs("button",{type:"button",disabled:f!==null,onClick:()=>w(T),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs text-fg-2 transition-colors hover:bg-elevated",children:[f===T?c.jsx(cn,{className:"h-3 w-3 shrink-0 animate-spin"}):c.jsx("span",{className:"h-3 w-3 shrink-0"}),c.jsx("span",{className:"truncate",children:T})]},`remote-${T}`))]})]}):null,p&&c.jsx("div",{className:"border-t border-line px-3 py-2 text-xs text-red-500",children:p})]})]}):null}function qF(){const[e,t]=v.useState(null);return v.useEffect(()=>{const n=()=>fetch("/api/health").then(s=>s.json()).then(s=>{s.latestVersion&&s.latestVersion!=="0.11.8"&&t(s.latestVersion)}).catch(()=>{});n();const r=setInterval(n,30*6e4),a=()=>n();return window.addEventListener("focus",a),()=>{clearInterval(r),window.removeEventListener("focus",a)}},[]),e}function GF({navigate:e,cycle:t,themeLabel:n,ThemeIcon:r}){const[a,s]=v.useState(!1),l=v.useRef(null);return v.useEffect(()=>{if(!a)return;const u=d=>{l.current&&!l.current.contains(d.target)&&s(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[a]),c.jsxs("div",{ref:l,className:"relative md:hidden",children:[c.jsx("button",{type:"button",onClick:()=>s(u=>!u),"aria-label":"更多",className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:c.jsx(t7,{className:"h-4 w-4"})}),a&&c.jsxs("div",{className:"absolute right-0 top-full z-50 mt-1 w-40 overflow-hidden rounded-lg border border-line bg-surface shadow-lg",children:[c.jsxs("button",{type:"button",onClick:()=>{e("/analytics"),s(!1)},className:"flex w-full items-center gap-2.5 px-3 py-2 text-left text-xs text-fg-2 transition-colors hover:bg-elevated",children:[c.jsx(_f,{className:"h-3.5 w-3.5 text-fg-4"}),"统计"]}),c.jsxs("button",{type:"button",onClick:()=>{e("/settings"),s(!1)},className:"flex w-full items-center gap-2.5 px-3 py-2 text-left text-xs text-fg-2 transition-colors hover:bg-elevated",children:[c.jsx(g0,{className:"h-3.5 w-3.5 text-fg-4"}),"设置"]}),c.jsxs("button",{type:"button",onClick:()=>{t(),s(!1)},className:"flex w-full items-center gap-2.5 px-3 py-2 text-left text-xs text-fg-2 transition-colors hover:bg-elevated",children:[c.jsx(r,{className:"h-3.5 w-3.5 text-fg-4"}),n]}),c.jsxs("a",{href:"https://github.com/kinminghao/fourth-spark",target:"_blank",rel:"noopener noreferrer",onClick:()=>s(!1),className:"flex w-full items-center gap-2.5 px-3 py-2 text-left text-xs text-fg-2 transition-colors hover:bg-elevated",children:[c.jsx("svg",{className:"h-3.5 w-3.5 text-fg-4",viewBox:"0 0 24 24",fill:"currentColor",children:c.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})}),"GitHub"]})]})]})}function KF(){const e=Vn(),t=cr(),n=Fe(p=>p.repos),r=Fe(p=>p.activeRepoId),a=Fe(p=>p.setActiveRepo),s=Wy(p=>p.preference),l=Wy(p=>p.cycle),u=s==="light"?fz:s==="dark"?G7:Y7,d=n.find(p=>p.id===r),f=qF(),m=p=>{var N;if(!p)return;a(p);const b=n.find(w=>w.id===p);if(!b)return;const x=t.pathname.match(/\/dev\/(issues|pulls)/);if(x){e(`/${encodeURIComponent(b.name)}/dev/${x[1]}`);return}const E=((N=t.pathname.match(/\/(run|agents|issues|pulls)/))==null?void 0:N[1])??"run";e(`/${encodeURIComponent(b.name)}/${E}`)};return c.jsxs("header",{className:"shrink-0 border-b border-line bg-surface pt-[var(--safe-top)]",children:[c.jsxs("div",{className:"flex h-12 items-center justify-between px-4",children:[c.jsxs("div",{className:"flex items-center gap-2.5",children:[c.jsx(nc,{className:"h-5 w-5 text-blue-500"}),c.jsx("span",{className:"hidden text-sm font-bold tracking-tight text-fg sm:inline",children:"Fourth Spark"}),c.jsxs("span",{className:"hidden rounded bg-elevated px-1.5 py-0.5 text-[10px] font-medium tabular-nums text-fg-4 sm:inline",children:["v","0.11.8"]}),f&&c.jsxs("span",{className:"hidden text-[10px] text-amber-500 sm:inline",children:["→ v",f," 可用,运行 ",c.jsx("code",{className:"rounded bg-amber-500/10 px-1 font-mono",children:"fourth-spark upgrade"})," 更新"]})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[n.length>0&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx($F,{repos:n,activeRepoId:r,onRepoChange:m}),d&&r&&c.jsx(YF,{repoId:r,currentBranch:d.branch})]}),c.jsxs("div",{className:"hidden items-center gap-1 md:flex",children:[c.jsx("button",{type:"button",onClick:()=>e("/analytics"),"aria-label":"统计",className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:c.jsx(_f,{className:"h-4 w-4"})}),c.jsx("button",{type:"button",onClick:()=>e("/settings"),"aria-label":"设置",className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:c.jsx(g0,{className:"h-4 w-4"})}),c.jsx("a",{href:"https://github.com/kinminghao/fourth-spark",target:"_blank",rel:"noopener noreferrer","aria-label":"GitHub",className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:c.jsx("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:c.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})})}),c.jsx("button",{type:"button",onClick:l,"aria-label":`主题: ${s}`,className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:c.jsx(u,{className:"h-4 w-4"})})]}),c.jsx(GF,{navigate:e,cycle:l,themeLabel:`主题: ${s}`,ThemeIcon:u})]})]}),f&&c.jsx("div",{className:"border-t border-line px-4 py-1.5 sm:hidden",children:c.jsxs("span",{className:"text-[10px] text-amber-500",children:["→ v",f," 可用,运行 ",c.jsx("code",{className:"rounded bg-amber-500/10 px-1 font-mono",children:"fourth-spark upgrade"})," 更新"]})})]})}function VF(){const e=Fe(Jr),t=sp(a=>a.navCollapsed),n=sp(a=>a.toggleNav),r=cr();return c.jsxs("nav",{className:re("hidden shrink-0 flex-col border-r border-line bg-surface py-2 transition-[width] duration-200 ease-in-out md:flex",t?"w-14":"w-48"),children:[c.jsx("div",{className:"flex flex-1 flex-col",children:fI.map(a=>{const s=mI(a,r.pathname,e);return c.jsxs(np,{to:hI(a.segment,a.global,e),title:t?a.label:void 0,className:({isActive:l})=>re("mx-2 flex items-center rounded-md py-2 text-sm transition-colors",t?"justify-center px-2":"gap-2.5 px-3",l||s?"bg-blue-500/10 font-medium text-blue-600":"text-fg-3 hover:bg-elevated hover:text-fg"),children:[c.jsx(a.icon,{className:"h-4 w-4 shrink-0"}),c.jsx("span",{className:re("truncate transition-[opacity,max-width] duration-200 ease-in-out",t?"max-w-0 opacity-0":"max-w-[8rem] opacity-100"),children:a.label})]},a.segment)})}),c.jsxs(np,{to:"/settings",title:t?"设置":void 0,className:({isActive:a})=>re("mx-2 flex items-center rounded-md py-2 text-sm transition-colors",t?"justify-center px-2":"gap-2.5 px-3",a?"bg-blue-500/10 font-medium text-blue-600":"text-fg-4 hover:bg-elevated hover:text-fg-2"),children:[c.jsx(g0,{className:"h-4 w-4 shrink-0"}),c.jsx("span",{className:re("truncate transition-[opacity,max-width] duration-200 ease-in-out",t?"max-w-0 opacity-0":"max-w-[8rem] opacity-100"),children:"设置"})]}),c.jsx("button",{type:"button",onClick:n,title:t?"展开导航":"收起导航",className:"mx-2 flex items-center justify-center rounded-md py-2 text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:t?c.jsx(LU,{className:"h-4 w-4"}):c.jsx(jU,{className:"h-4 w-4"})})]})}function WF(){const e=Fe(Jr),t=cr();return c.jsx("nav",{className:"fixed bottom-0 left-0 right-0 z-30 border-t border-line bg-surface pb-[var(--safe-bottom)] md:hidden",children:c.jsx("div",{className:"flex h-14 items-center justify-around",children:fI.map(n=>{const r=mI(n,t.pathname,e);return c.jsx(np,{to:hI(n.segment,n.global,e),"aria-label":n.label,className:({isActive:a})=>re("flex h-10 w-10 items-center justify-center rounded-md transition-colors",a||r?"bg-blue-500/10 text-blue-600":"text-fg-3 hover:bg-elevated hover:text-fg"),children:c.jsx(n.icon,{className:"h-5 w-5 shrink-0"})},n.segment)})})})}function XF(){return c.jsxs("div",{className:"flex h-full flex-col overflow-hidden bg-base text-fg",children:[c.jsx(KF,{}),c.jsxs("div",{className:"flex min-h-0 flex-1",children:[c.jsx(VF,{}),c.jsx("main",{className:"flex min-w-0 flex-1 flex-col overflow-hidden pb-[calc(3.5rem_+_var(--safe-bottom))] md:pb-0",children:c.jsx(w9,{})})]}),c.jsx(WF,{})]})}let QF=0;const bn=ei(e=>({toasts:[],addToast:(t,n="info",r,a)=>{const s=(a==null?void 0:a.id)??`toast-${++QF}-${Date.now()}`;e(l=>l.toasts.some(u=>u.id===s)?l:{toasts:[...l.toasts,{id:s,message:t,variant:n,sessionId:r,persistent:a==null?void 0:a.persistent}]}),a!=null&&a.persistent||setTimeout(()=>{e(l=>({toasts:l.toasts.filter(u=>u.id!==s)}))},4e3)},removeToast:t=>{e(n=>({toasts:n.toasts.filter(r=>r.id!==t)}))}})),ZF=/^[\w.-]+@([\w.-]+):([\w.-]+)\/([\w.-]+?)(?:\.git)?$/,JF=/^https?:\/\/([\w.-]+)\/([\w.-]+)\/([\w.-]+?)(?:\.git)?(?:\/)?$/,eH=/^ssh:\/\/[\w.-]+@([\w.-]+)\/([\w.-]+)\/([\w.-]+?)(?:\.git)?$/;function pI(e){for(const t of[ZF,JF,eH]){const n=e.match(t);if(n)return n[1]}return null}function tH({onClose:e}){const t=Vn(),[n,r]=v.useState(""),[a,s]=v.useState(""),[l,u]=v.useState(""),[d,f]=v.useState("opencode"),[m,p]=v.useState(!1),[b,x]=v.useState(""),[E,N]=v.useState(null),w=Fe(R=>R.addRepo),T=a.trim()!==""&&l.trim()!==""&&n.trim()!==""&&!m,C=async R=>{const O=R.trim();if(O){p(!0),x("");try{const j=await Oz(O);j.name&&!a.trim()&&s(j.name),j.gitUrl&&!l.trim()&&u(j.gitUrl)}catch(j){const F=j instanceof Error?j.message:"无法解析路径";try{const D=JSON.parse(F);x(D.error??F)}catch{x(F)}}p(!1)}},A=v.useRef(C);A.current=C,v.useEffect(()=>{const R=n.trim();if(!R)return;const O=setTimeout(()=>{A.current(R)},500);return()=>clearTimeout(O)},[n]),v.useEffect(()=>{const R=l.trim();if(!R){N(null);return}const O=pI(R);if(!O){N(null);return}let j=!1;const F=setTimeout(()=>{O1().then(D=>{if(j)return;const M=D.some(q=>q.host.toLowerCase()===O.toLowerCase());N(M?null:O)}).catch(()=>{j||N(null)})},300);return()=>{j=!0,clearTimeout(F)}},[l]);const k=async()=>{if(!T)return;x(""),await w(a.trim(),l.trim(),n.trim(),d)&&e()};return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:e,children:c.jsxs("div",{className:"w-full max-w-md rounded-xl border border-line bg-surface p-6 shadow-2xl",onClick:R=>R.stopPropagation(),children:[c.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[c.jsx("h2",{className:"text-base font-semibold text-fg",children:"添加仓库"}),c.jsx("button",{type:"button",onClick:e,className:"rounded-md p-1 text-fg-4 hover:bg-elevated hover:text-fg-2",children:c.jsx(gt,{className:"h-4 w-4"})})]}),c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex flex-col gap-1.5",children:[c.jsx("label",{htmlFor:"m-path",className:"text-xs font-medium text-fg-3",children:"本地路径"}),c.jsx("input",{id:"m-path",value:n,onChange:R=>r(R.target.value),onBlur:R=>void C(R.target.value),placeholder:"/Users/you/code/repo",autoFocus:!0,className:"w-full rounded-lg border border-line bg-base px-3 py-2 font-mono text-sm text-fg placeholder:text-fg-5 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"}),c.jsx("span",{className:"text-[11px] text-fg-5",children:m?"正在读取 Git 信息…":"输入路径后自动读取仓库信息"})]}),c.jsxs("div",{className:"flex flex-col gap-1.5",children:[c.jsx("label",{htmlFor:"m-name",className:"text-xs font-medium text-fg-3",children:"名称"}),c.jsx("input",{id:"m-name",value:a,onChange:R=>s(R.target.value),placeholder:"my-project",className:"w-full rounded-lg border border-line bg-base px-3 py-2 text-sm text-fg placeholder:text-fg-5 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"})]}),c.jsxs("div",{className:"flex flex-col gap-1.5",children:[c.jsx("label",{htmlFor:"m-git",className:"text-xs font-medium text-fg-3",children:"Git 远程地址"}),c.jsx("input",{id:"m-git",value:l,onChange:R=>u(R.target.value),placeholder:"https://github.com/org/repo.git",className:"w-full rounded-lg border border-line bg-base px-3 py-2 font-mono text-xs text-fg placeholder:text-fg-5 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"}),E&&c.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-amber-500/10 px-3 py-2 text-xs text-amber-600",children:[c.jsx(Tn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),c.jsxs("span",{children:["源站 ",c.jsx("strong",{children:E})," 尚未配置访问凭证,Issue/PR 同步将不可用。",c.jsx("button",{type:"button",onClick:()=>{e(),t("/settings")},className:"ml-1 font-medium underline hover:text-amber-700",children:"去配置"})]})]})]}),c.jsxs("div",{className:"flex flex-col gap-1.5",children:[c.jsx("label",{className:"text-xs font-medium text-fg-3",children:"运行时"}),c.jsx("div",{className:"flex gap-2",children:[{value:"opencode",label:"OpenCode"},{value:"claude-code",label:"Claude Code"}].map(R=>c.jsx("button",{type:"button",onClick:()=>f(R.value),className:`flex-1 rounded-lg border px-3 py-2 text-sm font-medium transition-colors ${d===R.value?"border-blue-500 bg-blue-500/10 text-blue-600":"border-line bg-base text-fg-4 hover:bg-elevated hover:text-fg-2"}`,children:R.label},R.value))}),c.jsx("span",{className:"text-[11px] text-fg-5",children:d==="claude-code"?"需要本地安装 Claude Code CLI":"需要本地安装 OpenCode CLI"})]}),b&&c.jsx("p",{className:"rounded-md bg-red-500/10 px-3 py-2 text-xs text-red-500",children:b}),c.jsxs("div",{className:"mt-1 flex items-center justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:e,className:"rounded-lg border border-line px-4 py-2 text-sm text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:"取消"}),c.jsx("button",{type:"button",onClick:k,disabled:!T,className:"rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-500 disabled:cursor-not-allowed disabled:bg-fg-6 disabled:text-fg-4",children:"添加仓库"})]})]})]})})}function nH({repoId:e,repoName:t,onClose:n}){const[r,a]=v.useState(""),[s,l]=v.useState(""),[u,d]=v.useState(!0),[f,m]=v.useState(!1),[p,b]=v.useState(null);v.useEffect(()=>{OF(e).then(N=>{a(N.content),l(N.content),d(!1)}).catch(N=>{b(N instanceof Error?N.message:String(N)),d(!1)})},[e]);const x=async()=>{m(!0),b(null);try{await IF(e,r),l(r)}catch(N){b(N instanceof Error?N.message:String(N))}m(!1)},E=r!==s;return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:n,children:c.jsxs("div",{className:"flex w-full max-w-2xl flex-col rounded-xl border border-line bg-surface p-6 shadow-2xl",onClick:N=>N.stopPropagation(),children:[c.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("h2",{className:"text-base font-semibold text-fg",children:[t," — AGENTS.md"]}),c.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"仅对此仓库生效,修改后 opencode 热加载即时生效。"})]}),c.jsx("button",{type:"button",onClick:n,className:"shrink-0 rounded-md p-1 text-fg-4 hover:bg-elevated hover:text-fg-2",children:c.jsx(gt,{className:"h-4 w-4"})})]}),p&&c.jsxs("div",{className:"mb-3 flex items-start gap-2 rounded-lg bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[c.jsx(Tn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),c.jsx("span",{className:"min-w-0 break-words",children:p})]}),u?c.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-16 text-fg-5",children:[c.jsx(cn,{className:"h-5 w-5 fs-spin"}),c.jsx("p",{className:"text-xs",children:"加载中…"})]}):c.jsx("textarea",{value:r,onChange:N=>a(N.target.value),spellCheck:!1,className:"h-96 w-full resize-y rounded-lg border border-line bg-base px-4 py-3 font-mono text-sm leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20",placeholder:`# AGENTS.md
|
|
495
|
+
*/const Nz=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],nc=Re("zap",Nz);function tI(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=tI(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function re(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=tI(e))&&(r&&(r+=" "),r+=t);return r}const Pw=e=>{let t;const n=new Set,r=(f,m)=>{const p=typeof f=="function"?f(t):f;if(!Object.is(p,t)){const b=t;t=m??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(x=>x(t,b))}},a=()=>t,u={setState:r,getState:a,getInitialState:()=>d,subscribe:f=>(n.add(f),()=>n.delete(f))},d=t=e(r,a,u);return u},_z=(e=>e?Pw(e):Pw),Tz=e=>e;function Sz(e,t=Tz){const n=Md.useSyncExternalStore(e.subscribe,Md.useCallback(()=>t(e.getState()),[e,t]),Md.useCallback(()=>t(e.getInitialState()),[e,t]));return Md.useDebugValue(n),n}const Bw=e=>{const t=_z(e),n=r=>Sz(t,r);return Object.assign(n,t),n},ei=(e=>e?Bw(e):Bw),Ix="fs-theme";function nI(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Uw(e){return e==="system"?nI():e}function zw(e){e==="system"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}const Wy=ei((e,t)=>({preference:localStorage.getItem(Ix)??"system",resolved:Uw(localStorage.getItem(Ix)??"system"),cycle(){const n=["system","light","dark"],r=n[(n.indexOf(t().preference)+1)%n.length],a=Uw(r);localStorage.setItem(Ix,r),zw(r),e({preference:r,resolved:a})},init(){zw(t().preference);const n=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{const{preference:a}=t();if(a==="system"){const s=nI();e({resolved:s})}};return n.addEventListener("change",r),()=>n.removeEventListener("change",r)}})),ap="fourth-spark-server-url";function wz(){if(typeof window>"u")return!1;const t=window.Capacitor;return typeof(t==null?void 0:t.isNativePlatform)=="function"&&t.isNativePlatform()}function A1(){return localStorage.getItem(ap)??""}function Az(e){const t=e.replace(/\/+$/,"");t?localStorage.setItem(ap,t):localStorage.removeItem(ap)}function Xy(){return localStorage.getItem(ap)??""}class ns extends Error{constructor(n,r){super(n);un(this,"status");this.name="ApiError",this.status=r}}async function Ae(e,t){let n;try{n=await fetch(A1()+e,{...t,headers:{Accept:"application/json",...t!=null&&t.body?{"Content-Type":"application/json"}:{},...t==null?void 0:t.headers}})}catch(a){throw new ns(a instanceof Error?a.message:"Network request failed",0)}if(!n.ok){const a=await n.text().catch(()=>"");throw new ns(a.trim()||`${n.status} ${n.statusText}`,n.status)}if(n.status===204)return;const r=await n.text();if(r)return JSON.parse(r)}function Zr(e,...t){if(Array.isArray(e))return e;if(e&&typeof e=="object"){const n=e;for(const r of[...t,"data","items"])if(Array.isArray(n[r]))return n[r]}return[]}async function Cz(){return Zr(await Ae("/api/repos"),"repos")}async function kz(e,t,n,r){return Ae("/api/repos",{method:"POST",body:JSON.stringify({name:e,gitUrl:t,localPath:n,runtimeType:r})})}async function Oz(e){return Ae("/api/repos/resolve",{method:"POST",body:JSON.stringify({localPath:e})})}async function Iz(e){await Ae(`/api/repos/${encodeURIComponent(e)}`,{method:"DELETE"})}async function Rz(e){await Ae(`/api/repos/${encodeURIComponent(e)}/start`,{method:"POST"})}async function Mz(e){await Ae(`/api/repos/${encodeURIComponent(e)}/stop`,{method:"POST"})}async function jz(e){return Ae(`/api/repos/${encodeURIComponent(e)}/branches`)}async function Dz(e,t){return Ae(`/api/repos/${encodeURIComponent(e)}/checkout`,{method:"POST",body:JSON.stringify({branch:t})})}async function Lz(e){return Ae(`/api/repos/${encodeURIComponent(e)}/pull`,{method:"POST"})}function et(e){return`/api/repos/${encodeURIComponent(e)}`}async function Pz(e){return Zr(await Ae(`${et(e)}/workspaces`),"workspaces")}async function Bz(e,t){await Ae(`${et(e)}/workspaces/${encodeURIComponent(t)}`,{method:"DELETE"})}async function Uz(e){return Ae(`${et(e)}/workspaces/cleanup`,{method:"POST"})}async function zz(e,t){await Ae(`/api/repos/${e}/worktree`,{method:"PATCH",body:JSON.stringify({enabled:t})})}async function Fz(e,t){await Ae(`/api/repos/${e}/runtime`,{method:"PATCH",body:JSON.stringify({runtimeType:t})})}async function Hz(e){return Zr(await Ae(`${et(e)}/sessions`),"sessions")}async function $z(e,t,n,r,a,s,l,u){return Ae(`${et(e)}/sessions`,{method:"POST",body:JSON.stringify({message:t,agent:n,model:r,variant:a,issueId:s,customAgentId:l,files:u})})}async function Yz(e,t){await Ae(`${et(e)}/sessions/${encodeURIComponent(t)}`,{method:"DELETE"})}async function qz(e,t,n,r,a,s,l){await Ae(`${et(e)}/sessions/${encodeURIComponent(t)}/prompt`,{method:"POST",body:JSON.stringify({content:n,agent:r,model:a,variant:s,files:l})})}async function Gz(e,t){await Ae(`${et(e)}/sessions/${encodeURIComponent(t)}/abort`,{method:"POST"})}async function Kz(e,t,n){await Ae(`${et(e)}/sessions/${encodeURIComponent(t)}/questions/reply`,{method:"POST",body:JSON.stringify({answers:n})})}async function Vz(e,t){await Ae(`${et(e)}/sessions/${encodeURIComponent(t)}/questions/reject`,{method:"POST"})}async function Wz(e,t,n){return Ae(`${et(e)}/sessions/${encodeURIComponent(t)}/revert`,{method:"POST",body:JSON.stringify({messageID:n})})}function Fw(e){const t=e,n=t.info;if(n&&typeof n.id=="string"){const r=Array.isArray(t.parts)?t.parts:void 0;return{...n,...r?{parts:r}:{}}}return t}async function Hw(e,t,n){const r=new URLSearchParams;n!=null&&n.limit&&r.set("limit",String(n.limit)),n!=null&&n.before&&r.set("before",n.before);const a=r.toString(),s=`${et(e)}/sessions/${encodeURIComponent(t)}/messages${a?`?${a}`:""}`,l=await Ae(s);if(Array.isArray(l)){const f=l.map(Fw);return{messages:f,total:f.length,hasMore:!1}}const u=l,d=Array.isArray(u.messages)?u.messages:[];return{messages:d.map(Fw),total:u.total??d.length,hasMore:u.hasMore??!1}}async function Xz(e,t){return Ae(`${et(e)}/sessions/${encodeURIComponent(t)}/status`)}async function Qz(e,t){return Ae(`${et(e)}/sessions/${encodeURIComponent(t)}/links`)}async function Zz(e,t){return Ae(`${et(e)}/sessions/snapshot/${encodeURIComponent(t)}`)}async function rI(e){return Ae(`${et(e)}/sessions/all-links`)}async function Jz(e,t,n,r){await Ae(`${et(e)}/sessions/${encodeURIComponent(t)}/links`,{method:"POST",body:JSON.stringify({type:n,targetId:r})})}async function eF(e,t,n,r){await Ae(`${et(e)}/sessions/${encodeURIComponent(t)}/links`,{method:"DELETE",body:JSON.stringify({type:n,targetId:r})})}async function aI(){return Zr(await Ae("/api/custom-agents"))}async function tF(e){return Ae("/api/custom-agents",{method:"POST",body:JSON.stringify(e)})}async function nF(e,t){return Ae(`/api/custom-agents/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function iI(e){await Ae(`/api/custom-agents/${encodeURIComponent(e)}`,{method:"DELETE"})}async function $w(e){return Ae(`/api/custom-agents/${encodeURIComponent(e)}/export`)}async function rF(e){return Ae("/api/custom-agents/import",{method:"POST",body:JSON.stringify(e)})}async function sI(e,t){const n=new URLSearchParams;t!=null&&t.category&&n.set("category",t.category),t!=null&&t.includeSuperseded&&n.set("includeSuperseded","true");const r=n.toString();return Ae(`/api/custom-agents/${encodeURIComponent(e)}/memories${r?`?${r}`:""}`)}async function aF(e,t,n){return Ae(`/api/custom-agents/${encodeURIComponent(e)}/memories/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify(n)})}async function iF(e,t){await Ae(`/api/custom-agents/${encodeURIComponent(e)}/memories/${encodeURIComponent(t)}`,{method:"DELETE"})}async function sF(e,t){return Ae(`/api/custom-agents/${encodeURIComponent(e)}/memories/extract`,{method:"POST",body:JSON.stringify({sessionIds:t})})}async function Yw(e){return Ae(`/api/custom-agents/${encodeURIComponent(e)}/memories/stats`)}async function lF(e){return Ae(`/api/custom-agents/${encodeURIComponent(e)}/memories/consolidate`,{method:"POST"})}async function C1(e){return Ae(`/api/custom-agents/${encodeURIComponent(e)}/sessions`)}async function lI(e){return Zr(await Ae(`${et(e)}/custom-agents`))}async function oF(e,t){return Ae(`${et(e)}/custom-agents`,{method:"POST",body:JSON.stringify(t)})}async function wf(e){return Zr(await Ae(`${et(e)}/models`))}async function oI(){return Zr(await Ae("/api/prompt-fragments"))}async function uF(e){return Ae("/api/prompt-fragments",{method:"POST",body:JSON.stringify(e)})}async function cF(e,t){return Ae(`/api/prompt-fragments/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)})}async function dF(e){await Ae(`/api/prompt-fragments/${encodeURIComponent(e)}`,{method:"DELETE"})}async function qw(e){return Zr(await Ae(`${et(e)}/tags`))}async function Gw(e,t){return Zr(await Ae(`${et(e)}/milestones`))}async function Kw(e,t="open"){return Zr(await Ae(`${et(e)}/issues?state=${encodeURIComponent(t)}`),"issues")}async function fF(e,t="all"){return Ae(`${et(e)}/issues/sync`,{method:"POST",body:JSON.stringify({state:t})})}async function hF(e,t,n){return Ae(`${et(e)}/issues`,{method:"POST",body:JSON.stringify({title:t,body:n})})}async function mF(e,t,n){await Ae(`${et(e)}/issues/${t}/children`,{method:"POST",body:JSON.stringify({childNumber:n})})}async function uI(e,t,n){return Ae(`${et(e)}/issues/${t}`,{method:"PATCH",body:JSON.stringify(n)})}async function pF(e,t){return Zr(await Ae(`${et(e)}/issues/${t}/pulls`))}async function Vw(e,t="open"){return Zr(await Ae(`${et(e)}/pulls?state=${encodeURIComponent(t)}`))}async function gF(e,t="all"){return Ae(`${et(e)}/pulls/sync`,{method:"POST",body:JSON.stringify({state:t})})}async function bF(e,t){return Ae(`${et(e)}/pulls/${t}`)}async function xF(e,t){await Ae(`${et(e)}/pulls/${t}/merge`,{method:"POST"})}async function k1(e,t){return Zr(await Ae(`${et(e)}/pulls/${t}/issues`))}async function yF(e,t,n){await Ae(`${et(e)}/pulls/${t}/issues`,{method:"POST",body:JSON.stringify({issueNumber:n})})}async function vF(e,t,n){await Ae(`${et(e)}/pulls/${t}/issues/${n}`,{method:"DELETE"})}async function EF(e,t){return Ae(`${et(e)}/pulls/${t}/comments`)}async function NF(e,t){return Ae(`${et(e)}/issues/${t}/comments`)}async function Ww(e,t,n){return Ae(`${et(e)}/issues/${t}/comments`,{method:"POST",body:JSON.stringify({body:n})})}async function _F(e,t,n){return Ae(`${et(e)}/issues/${t}/polish`,{method:"POST",body:JSON.stringify({draft:n})})}async function Xw(e,t){return Ae(`${et(e)}/issues/${t}/draft`)}async function TF(e,t,n){return Ae(`${et(e)}/issues/polish-create`,{method:"POST",body:JSON.stringify({title:t,body:n})})}async function Qw(e){return Ae(`${et(e)}/issues/draft-create`)}async function SF(e){await Ae(`${et(e)}/issues/draft-create`,{method:"DELETE"})}async function wF(e,t,n){await Ae(`${et(e)}/sessions/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({title:n})})}async function AF(e,t,n){await Ae(`${et(e)}/sessions/${encodeURIComponent(t)}`,{method:"PATCH",body:JSON.stringify({completedAt:n})})}async function CF(){return Ae("/api/agents-md")}async function kF(e){await Ae("/api/agents-md",{method:"PUT",body:JSON.stringify({content:e})})}async function OF(e){return Ae(`/api/repos/${encodeURIComponent(e)}/agents-md`)}async function IF(e,t){await Ae(`/api/repos/${encodeURIComponent(e)}/agents-md`,{method:"PUT",body:JSON.stringify({content:t})})}function RF(e){return`${A1()}${et(e)}/events`}async function MF(e){return Ae(`${et(e)}/sessions/status`)}async function uo(){return Ae("/api/settings")}async function ip(e,t){await Ae(`/api/settings/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({value:t})})}async function Qy(){return Ae("/api/cloud/status")}async function jF(){return Ae("/api/cloud/reload",{method:"POST"})}async function DF(e){try{return(await Ae("/api/cloud/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})})).connected}catch{return!1}}async function O1(){return Zr(await Ae("/api/git-hosts"),"gitHosts")}async function LF(e,t,n,r="gitea"){return Ae("/api/git-hosts",{method:"POST",body:JSON.stringify({host:e,name:t,token:n,platform:r})})}async function PF(e){await Ae(`/api/git-hosts/${encodeURIComponent(e)}`,{method:"DELETE"})}async function cI(){return Ae("/api/usage")}async function dI(e){return Ae("/api/usage/switch",{method:"POST",body:JSON.stringify({accountId:e})})}async function BF(){return Ae("/api/usage/authorize",{method:"POST"})}async function UF(e,t){return Ae("/api/usage/exchange",{method:"POST",body:JSON.stringify({pendingId:e,code:t})})}async function zF(e,t){return Ae(`${et(e)}/sessions/${encodeURIComponent(t)}/files`)}function FF(e,t,n){return`${A1()}${et(e)}/sessions/${encodeURIComponent(t)}/files/${n}`}async function Rx(e,t,n,r){const a=new URLSearchParams({from:String(e),to:String(t),groupBy:n});return Ae(`/api/analytics/summary?${a}`)}const Ws="fs-active-repo",Fe=ei((e,t)=>({repos:[],activeRepoId:localStorage.getItem(Ws),loading:!0,loadError:null,loadRepos:async()=>{e({loading:!0,loadError:null});try{const n=await Cz(),r=t().activeRepoId,a=r&&n.some(l=>l.id===r);e({repos:n,loading:!1,activeRepoId:a?r:n.length>0?n[0].id:null});const s=t().activeRepoId;s?localStorage.setItem(Ws,s):localStorage.removeItem(Ws)}catch(n){e({loading:!1,loadError:n instanceof Error?n.message:"Failed to load repos"})}},setActiveRepo:n=>{e({activeRepoId:n}),n?localStorage.setItem(Ws,n):localStorage.removeItem(Ws)},addRepo:async(n,r,a,s)=>{try{const l=await kz(n,r,a,s);return e(u=>({repos:[...u.repos,l],activeRepoId:l.id})),localStorage.setItem(Ws,l.id),l}catch(l){return e({loadError:l instanceof Error?l.message:"Failed to add repo"}),null}},removeRepo:async n=>{try{await Iz(n)}catch{}e(r=>{const a=r.repos.filter(l=>l.id!==n),s=r.activeRepoId===n?a.length>0?a[0].id:null:r.activeRepoId;return s?localStorage.setItem(Ws,s):localStorage.removeItem(Ws),{repos:a,activeRepoId:s}})},updateRepoBranch:(n,r)=>{e(a=>({repos:a.repos.map(s=>s.id===n?{...s,branch:r}:s)}))}})),Jr=e=>{var t;return((t=e.repos.find(n=>n.id===e.activeRepoId))==null?void 0:t.name)??null},Zw="fs-nav-collapsed",Jw="fs-session-panel-collapsed",sp=ei(e=>({navCollapsed:localStorage.getItem(Zw)==="true",sessionPanelCollapsed:localStorage.getItem(Jw)==="true",toggleNav(){e(t=>{const n=!t.navCollapsed;return localStorage.setItem(Zw,String(n)),{navCollapsed:n}})},toggleSessionPanel(){e(t=>{const n=!t.sessionPanelCollapsed;return localStorage.setItem(Jw,String(n)),{sessionPanelCollapsed:n}})}})),fI=[{segment:"run",icon:w1,label:"运行面板",global:!1},{segment:"dev/issues",icon:KU,label:"研发",global:!1,matchPrefix:"dev"},{segment:"agents",icon:TU,label:"Agents",global:!1}];function hI(e,t,n){return t?`/${e}`:n?`/${encodeURIComponent(n)}/${e}`:`/${e}`}function mI(e,t,n){if(!e.matchPrefix)return!1;const r=e.global?`/${e.matchPrefix}`:n?`/${encodeURIComponent(n)}/${e.matchPrefix}`:null;return r?t===r||t.startsWith(`${r}/`):!1}function HF(e){const t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function $F({repos:e,activeRepoId:t,onRepoChange:n}){const r=Vn(),[a,s]=v.useState(!1),l=v.useRef(null),u=e.find(f=>f.id===t),d=v.useCallback(()=>s(!1),[]);return v.useEffect(()=>{if(!a)return;const f=m=>{l.current&&!l.current.contains(m.target)&&d()};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[a,d]),c.jsxs("div",{ref:l,className:"relative",children:[c.jsxs("button",{type:"button",onClick:()=>s(f=>!f),className:"flex max-w-[140px] items-center gap-1 rounded-md border border-line bg-base px-2 py-1 text-xs text-fg-2 transition-colors hover:border-blue-500 sm:max-w-[200px]",children:[c.jsx(q5,{className:"h-3 w-3 shrink-0 text-fg-4"}),c.jsxs("span",{className:"truncate",children:[c.jsx("span",{className:"sm:hidden",children:u?HF(u.name):""}),c.jsx("span",{className:"hidden sm:inline",children:(u==null?void 0:u.name)??""})]}),c.jsx(Ir,{className:re("h-3 w-3 shrink-0 text-fg-4 transition-transform",a&&"rotate-180")})]}),a&&c.jsxs("div",{className:"absolute left-0 top-full z-50 mt-1 w-64 overflow-hidden rounded-lg border border-line bg-surface shadow-lg",children:[c.jsx("div",{className:"max-h-64 overflow-y-auto py-1",children:e.map(f=>c.jsxs("button",{type:"button",onClick:()=>{n(f.id),d()},className:re("flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors",f.id===t?"font-medium text-blue-600":"text-fg-2 hover:bg-elevated"),children:[f.id===t?c.jsx(ur,{className:"h-3 w-3 shrink-0"}):c.jsx("span",{className:"h-3 w-3 shrink-0"}),c.jsx("span",{className:"truncate",children:f.name})]},f.id))}),c.jsx("div",{className:"border-t border-line",children:c.jsxs("button",{type:"button",onClick:()=>{r("/repos"),d()},className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:[c.jsx(g0,{className:"h-3 w-3 shrink-0"}),c.jsx("span",{children:"管理仓库"})]})})]})]})}function YF({repoId:e,currentBranch:t}){const n=Fe(T=>T.updateRepoBranch),[r,a]=v.useState(!1),[s,l]=v.useState(null),[u,d]=v.useState(!1),[f,m]=v.useState(null),[p,b]=v.useState(null),x=v.useRef(null),E=v.useCallback(()=>{a(!1),b(null)},[]);v.useEffect(()=>{if(!r)return;const T=C=>{x.current&&!x.current.contains(C.target)&&E()};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[r,E]);const N=async()=>{if(r){E();return}a(!0),d(!0),b(null);try{l(await jz(e))}catch{b("加载分支失败")}finally{d(!1)}},w=async T=>{if(!(T===t||f)){m(T),b(null);try{const C=await Dz(e,T);n(e,C.branch),E()}catch(C){b(C instanceof Error?C.message:"切换失败")}finally{m(null)}}};return t?c.jsxs("div",{ref:x,className:"relative",children:[c.jsxs("button",{type:"button",onClick:N,className:"flex items-center gap-1 rounded-md bg-elevated px-2 py-1 text-xs text-fg-3 transition-colors hover:bg-blue-500/10 hover:text-blue-600",children:[c.jsx(Tf,{className:"h-3 w-3"}),t,c.jsx(Ir,{className:re("h-3 w-3 transition-transform",r&&"rotate-180")})]}),r&&c.jsxs("div",{className:"absolute right-0 top-full z-50 mt-1 w-56 overflow-hidden rounded-lg border border-line bg-surface shadow-lg",children:[u?c.jsx("div",{className:"flex items-center justify-center py-4",children:c.jsx(cn,{className:"h-4 w-4 animate-spin text-fg-4"})}):s?c.jsxs("div",{className:"max-h-64 overflow-y-auto py-1",children:[s.local.map(T=>c.jsxs("button",{type:"button",disabled:f!==null,onClick:()=>w(T),className:re("flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs transition-colors",T===t?"font-medium text-blue-600":"text-fg-2 hover:bg-elevated"),children:[T===t?c.jsx(ur,{className:"h-3 w-3 shrink-0"}):f===T?c.jsx(cn,{className:"h-3 w-3 shrink-0 animate-spin"}):c.jsx("span",{className:"h-3 w-3 shrink-0"}),c.jsx("span",{className:"truncate",children:T})]},T)),s.remote.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"mx-3 my-1 border-t border-line"}),c.jsx("div",{className:"px-3 py-1 text-[10px] font-medium uppercase tracking-wider text-fg-4",children:"Remote"}),s.remote.map(T=>c.jsxs("button",{type:"button",disabled:f!==null,onClick:()=>w(T),className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs text-fg-2 transition-colors hover:bg-elevated",children:[f===T?c.jsx(cn,{className:"h-3 w-3 shrink-0 animate-spin"}):c.jsx("span",{className:"h-3 w-3 shrink-0"}),c.jsx("span",{className:"truncate",children:T})]},`remote-${T}`))]})]}):null,p&&c.jsx("div",{className:"border-t border-line px-3 py-2 text-xs text-red-500",children:p})]})]}):null}function qF(){const[e,t]=v.useState(null);return v.useEffect(()=>{const n=()=>fetch("/api/health").then(s=>s.json()).then(s=>{s.latestVersion&&s.latestVersion!=="0.11.9"&&t(s.latestVersion)}).catch(()=>{});n();const r=setInterval(n,30*6e4),a=()=>n();return window.addEventListener("focus",a),()=>{clearInterval(r),window.removeEventListener("focus",a)}},[]),e}function GF({navigate:e,cycle:t,themeLabel:n,ThemeIcon:r}){const[a,s]=v.useState(!1),l=v.useRef(null);return v.useEffect(()=>{if(!a)return;const u=d=>{l.current&&!l.current.contains(d.target)&&s(!1)};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[a]),c.jsxs("div",{ref:l,className:"relative md:hidden",children:[c.jsx("button",{type:"button",onClick:()=>s(u=>!u),"aria-label":"更多",className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:c.jsx(t7,{className:"h-4 w-4"})}),a&&c.jsxs("div",{className:"absolute right-0 top-full z-50 mt-1 w-40 overflow-hidden rounded-lg border border-line bg-surface shadow-lg",children:[c.jsxs("button",{type:"button",onClick:()=>{e("/analytics"),s(!1)},className:"flex w-full items-center gap-2.5 px-3 py-2 text-left text-xs text-fg-2 transition-colors hover:bg-elevated",children:[c.jsx(_f,{className:"h-3.5 w-3.5 text-fg-4"}),"统计"]}),c.jsxs("button",{type:"button",onClick:()=>{e("/settings"),s(!1)},className:"flex w-full items-center gap-2.5 px-3 py-2 text-left text-xs text-fg-2 transition-colors hover:bg-elevated",children:[c.jsx(g0,{className:"h-3.5 w-3.5 text-fg-4"}),"设置"]}),c.jsxs("button",{type:"button",onClick:()=>{t(),s(!1)},className:"flex w-full items-center gap-2.5 px-3 py-2 text-left text-xs text-fg-2 transition-colors hover:bg-elevated",children:[c.jsx(r,{className:"h-3.5 w-3.5 text-fg-4"}),n]}),c.jsxs("a",{href:"https://github.com/kinminghao/fourth-spark",target:"_blank",rel:"noopener noreferrer",onClick:()=>s(!1),className:"flex w-full items-center gap-2.5 px-3 py-2 text-left text-xs text-fg-2 transition-colors hover:bg-elevated",children:[c.jsx("svg",{className:"h-3.5 w-3.5 text-fg-4",viewBox:"0 0 24 24",fill:"currentColor",children:c.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})}),"GitHub"]})]})]})}function KF(){const e=Vn(),t=cr(),n=Fe(p=>p.repos),r=Fe(p=>p.activeRepoId),a=Fe(p=>p.setActiveRepo),s=Wy(p=>p.preference),l=Wy(p=>p.cycle),u=s==="light"?fz:s==="dark"?G7:Y7,d=n.find(p=>p.id===r),f=qF(),m=p=>{var N;if(!p)return;a(p);const b=n.find(w=>w.id===p);if(!b)return;const x=t.pathname.match(/\/dev\/(issues|pulls)/);if(x){e(`/${encodeURIComponent(b.name)}/dev/${x[1]}`);return}const E=((N=t.pathname.match(/\/(run|agents|issues|pulls)/))==null?void 0:N[1])??"run";e(`/${encodeURIComponent(b.name)}/${E}`)};return c.jsxs("header",{className:"shrink-0 border-b border-line bg-surface pt-[var(--safe-top)]",children:[c.jsxs("div",{className:"flex h-12 items-center justify-between px-4",children:[c.jsxs("div",{className:"flex items-center gap-2.5",children:[c.jsx(nc,{className:"h-5 w-5 text-blue-500"}),c.jsx("span",{className:"hidden text-sm font-bold tracking-tight text-fg sm:inline",children:"Fourth Spark"}),c.jsxs("span",{className:"hidden rounded bg-elevated px-1.5 py-0.5 text-[10px] font-medium tabular-nums text-fg-4 sm:inline",children:["v","0.11.9"]}),f&&c.jsxs("span",{className:"hidden text-[10px] text-amber-500 sm:inline",children:["→ v",f," 可用,运行 ",c.jsx("code",{className:"rounded bg-amber-500/10 px-1 font-mono",children:"fourth-spark upgrade"})," 更新"]})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[n.length>0&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx($F,{repos:n,activeRepoId:r,onRepoChange:m}),d&&r&&c.jsx(YF,{repoId:r,currentBranch:d.branch})]}),c.jsxs("div",{className:"hidden items-center gap-1 md:flex",children:[c.jsx("button",{type:"button",onClick:()=>e("/analytics"),"aria-label":"统计",className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:c.jsx(_f,{className:"h-4 w-4"})}),c.jsx("button",{type:"button",onClick:()=>e("/settings"),"aria-label":"设置",className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:c.jsx(g0,{className:"h-4 w-4"})}),c.jsx("a",{href:"https://github.com/kinminghao/fourth-spark",target:"_blank",rel:"noopener noreferrer","aria-label":"GitHub",className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:c.jsx("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:c.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})})}),c.jsx("button",{type:"button",onClick:l,"aria-label":`主题: ${s}`,className:"flex h-8 w-8 items-center justify-center rounded-md text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:c.jsx(u,{className:"h-4 w-4"})})]}),c.jsx(GF,{navigate:e,cycle:l,themeLabel:`主题: ${s}`,ThemeIcon:u})]})]}),f&&c.jsx("div",{className:"border-t border-line px-4 py-1.5 sm:hidden",children:c.jsxs("span",{className:"text-[10px] text-amber-500",children:["→ v",f," 可用,运行 ",c.jsx("code",{className:"rounded bg-amber-500/10 px-1 font-mono",children:"fourth-spark upgrade"})," 更新"]})})]})}function VF(){const e=Fe(Jr),t=sp(a=>a.navCollapsed),n=sp(a=>a.toggleNav),r=cr();return c.jsxs("nav",{className:re("hidden shrink-0 flex-col border-r border-line bg-surface py-2 transition-[width] duration-200 ease-in-out md:flex",t?"w-14":"w-48"),children:[c.jsx("div",{className:"flex flex-1 flex-col",children:fI.map(a=>{const s=mI(a,r.pathname,e);return c.jsxs(np,{to:hI(a.segment,a.global,e),title:t?a.label:void 0,className:({isActive:l})=>re("mx-2 flex items-center rounded-md py-2 text-sm transition-colors",t?"justify-center px-2":"gap-2.5 px-3",l||s?"bg-blue-500/10 font-medium text-blue-600":"text-fg-3 hover:bg-elevated hover:text-fg"),children:[c.jsx(a.icon,{className:"h-4 w-4 shrink-0"}),c.jsx("span",{className:re("truncate transition-[opacity,max-width] duration-200 ease-in-out",t?"max-w-0 opacity-0":"max-w-[8rem] opacity-100"),children:a.label})]},a.segment)})}),c.jsxs(np,{to:"/settings",title:t?"设置":void 0,className:({isActive:a})=>re("mx-2 flex items-center rounded-md py-2 text-sm transition-colors",t?"justify-center px-2":"gap-2.5 px-3",a?"bg-blue-500/10 font-medium text-blue-600":"text-fg-4 hover:bg-elevated hover:text-fg-2"),children:[c.jsx(g0,{className:"h-4 w-4 shrink-0"}),c.jsx("span",{className:re("truncate transition-[opacity,max-width] duration-200 ease-in-out",t?"max-w-0 opacity-0":"max-w-[8rem] opacity-100"),children:"设置"})]}),c.jsx("button",{type:"button",onClick:n,title:t?"展开导航":"收起导航",className:"mx-2 flex items-center justify-center rounded-md py-2 text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:t?c.jsx(LU,{className:"h-4 w-4"}):c.jsx(jU,{className:"h-4 w-4"})})]})}function WF(){const e=Fe(Jr),t=cr();return c.jsx("nav",{className:"fixed bottom-0 left-0 right-0 z-30 border-t border-line bg-surface pb-[var(--safe-bottom)] md:hidden",children:c.jsx("div",{className:"flex h-14 items-center justify-around",children:fI.map(n=>{const r=mI(n,t.pathname,e);return c.jsx(np,{to:hI(n.segment,n.global,e),"aria-label":n.label,className:({isActive:a})=>re("flex h-10 w-10 items-center justify-center rounded-md transition-colors",a||r?"bg-blue-500/10 text-blue-600":"text-fg-3 hover:bg-elevated hover:text-fg"),children:c.jsx(n.icon,{className:"h-5 w-5 shrink-0"})},n.segment)})})})}function XF(){return c.jsxs("div",{className:"flex h-full flex-col overflow-hidden bg-base text-fg",children:[c.jsx(KF,{}),c.jsxs("div",{className:"flex min-h-0 flex-1",children:[c.jsx(VF,{}),c.jsx("main",{className:"flex min-w-0 flex-1 flex-col overflow-hidden pb-[calc(3.5rem_+_var(--safe-bottom))] md:pb-0",children:c.jsx(w9,{})})]}),c.jsx(WF,{})]})}let QF=0;const bn=ei(e=>({toasts:[],addToast:(t,n="info",r,a)=>{const s=(a==null?void 0:a.id)??`toast-${++QF}-${Date.now()}`;e(l=>l.toasts.some(u=>u.id===s)?l:{toasts:[...l.toasts,{id:s,message:t,variant:n,sessionId:r,persistent:a==null?void 0:a.persistent}]}),a!=null&&a.persistent||setTimeout(()=>{e(l=>({toasts:l.toasts.filter(u=>u.id!==s)}))},4e3)},removeToast:t=>{e(n=>({toasts:n.toasts.filter(r=>r.id!==t)}))}})),ZF=/^[\w.-]+@([\w.-]+):([\w.-]+)\/([\w.-]+?)(?:\.git)?$/,JF=/^https?:\/\/([\w.-]+)\/([\w.-]+)\/([\w.-]+?)(?:\.git)?(?:\/)?$/,eH=/^ssh:\/\/[\w.-]+@([\w.-]+)\/([\w.-]+)\/([\w.-]+?)(?:\.git)?$/;function pI(e){for(const t of[ZF,JF,eH]){const n=e.match(t);if(n)return n[1]}return null}function tH({onClose:e}){const t=Vn(),[n,r]=v.useState(""),[a,s]=v.useState(""),[l,u]=v.useState(""),[d,f]=v.useState("opencode"),[m,p]=v.useState(!1),[b,x]=v.useState(""),[E,N]=v.useState(null),w=Fe(R=>R.addRepo),T=a.trim()!==""&&l.trim()!==""&&n.trim()!==""&&!m,C=async R=>{const O=R.trim();if(O){p(!0),x("");try{const j=await Oz(O);j.name&&!a.trim()&&s(j.name),j.gitUrl&&!l.trim()&&u(j.gitUrl)}catch(j){const F=j instanceof Error?j.message:"无法解析路径";try{const D=JSON.parse(F);x(D.error??F)}catch{x(F)}}p(!1)}},A=v.useRef(C);A.current=C,v.useEffect(()=>{const R=n.trim();if(!R)return;const O=setTimeout(()=>{A.current(R)},500);return()=>clearTimeout(O)},[n]),v.useEffect(()=>{const R=l.trim();if(!R){N(null);return}const O=pI(R);if(!O){N(null);return}let j=!1;const F=setTimeout(()=>{O1().then(D=>{if(j)return;const M=D.some(q=>q.host.toLowerCase()===O.toLowerCase());N(M?null:O)}).catch(()=>{j||N(null)})},300);return()=>{j=!0,clearTimeout(F)}},[l]);const k=async()=>{if(!T)return;x(""),await w(a.trim(),l.trim(),n.trim(),d)&&e()};return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:e,children:c.jsxs("div",{className:"w-full max-w-md rounded-xl border border-line bg-surface p-6 shadow-2xl",onClick:R=>R.stopPropagation(),children:[c.jsxs("div",{className:"mb-5 flex items-center justify-between",children:[c.jsx("h2",{className:"text-base font-semibold text-fg",children:"添加仓库"}),c.jsx("button",{type:"button",onClick:e,className:"rounded-md p-1 text-fg-4 hover:bg-elevated hover:text-fg-2",children:c.jsx(gt,{className:"h-4 w-4"})})]}),c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex flex-col gap-1.5",children:[c.jsx("label",{htmlFor:"m-path",className:"text-xs font-medium text-fg-3",children:"本地路径"}),c.jsx("input",{id:"m-path",value:n,onChange:R=>r(R.target.value),onBlur:R=>void C(R.target.value),placeholder:"/Users/you/code/repo",autoFocus:!0,className:"w-full rounded-lg border border-line bg-base px-3 py-2 font-mono text-sm text-fg placeholder:text-fg-5 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"}),c.jsx("span",{className:"text-[11px] text-fg-5",children:m?"正在读取 Git 信息…":"输入路径后自动读取仓库信息"})]}),c.jsxs("div",{className:"flex flex-col gap-1.5",children:[c.jsx("label",{htmlFor:"m-name",className:"text-xs font-medium text-fg-3",children:"名称"}),c.jsx("input",{id:"m-name",value:a,onChange:R=>s(R.target.value),placeholder:"my-project",className:"w-full rounded-lg border border-line bg-base px-3 py-2 text-sm text-fg placeholder:text-fg-5 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"})]}),c.jsxs("div",{className:"flex flex-col gap-1.5",children:[c.jsx("label",{htmlFor:"m-git",className:"text-xs font-medium text-fg-3",children:"Git 远程地址"}),c.jsx("input",{id:"m-git",value:l,onChange:R=>u(R.target.value),placeholder:"https://github.com/org/repo.git",className:"w-full rounded-lg border border-line bg-base px-3 py-2 font-mono text-xs text-fg placeholder:text-fg-5 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"}),E&&c.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-amber-500/10 px-3 py-2 text-xs text-amber-600",children:[c.jsx(Tn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),c.jsxs("span",{children:["源站 ",c.jsx("strong",{children:E})," 尚未配置访问凭证,Issue/PR 同步将不可用。",c.jsx("button",{type:"button",onClick:()=>{e(),t("/settings")},className:"ml-1 font-medium underline hover:text-amber-700",children:"去配置"})]})]})]}),c.jsxs("div",{className:"flex flex-col gap-1.5",children:[c.jsx("label",{className:"text-xs font-medium text-fg-3",children:"运行时"}),c.jsx("div",{className:"flex gap-2",children:[{value:"opencode",label:"OpenCode"},{value:"claude-code",label:"Claude Code"}].map(R=>c.jsx("button",{type:"button",onClick:()=>f(R.value),className:`flex-1 rounded-lg border px-3 py-2 text-sm font-medium transition-colors ${d===R.value?"border-blue-500 bg-blue-500/10 text-blue-600":"border-line bg-base text-fg-4 hover:bg-elevated hover:text-fg-2"}`,children:R.label},R.value))}),c.jsx("span",{className:"text-[11px] text-fg-5",children:d==="claude-code"?"需要本地安装 Claude Code CLI":"需要本地安装 OpenCode CLI"})]}),b&&c.jsx("p",{className:"rounded-md bg-red-500/10 px-3 py-2 text-xs text-red-500",children:b}),c.jsxs("div",{className:"mt-1 flex items-center justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:e,className:"rounded-lg border border-line px-4 py-2 text-sm text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:"取消"}),c.jsx("button",{type:"button",onClick:k,disabled:!T,className:"rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-500 disabled:cursor-not-allowed disabled:bg-fg-6 disabled:text-fg-4",children:"添加仓库"})]})]})]})})}function nH({repoId:e,repoName:t,onClose:n}){const[r,a]=v.useState(""),[s,l]=v.useState(""),[u,d]=v.useState(!0),[f,m]=v.useState(!1),[p,b]=v.useState(null);v.useEffect(()=>{OF(e).then(N=>{a(N.content),l(N.content),d(!1)}).catch(N=>{b(N instanceof Error?N.message:String(N)),d(!1)})},[e]);const x=async()=>{m(!0),b(null);try{await IF(e,r),l(r)}catch(N){b(N instanceof Error?N.message:String(N))}m(!1)},E=r!==s;return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:n,children:c.jsxs("div",{className:"flex w-full max-w-2xl flex-col rounded-xl border border-line bg-surface p-6 shadow-2xl",onClick:N=>N.stopPropagation(),children:[c.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("h2",{className:"text-base font-semibold text-fg",children:[t," — AGENTS.md"]}),c.jsx("p",{className:"mt-0.5 text-xs text-fg-4",children:"仅对此仓库生效,修改后 opencode 热加载即时生效。"})]}),c.jsx("button",{type:"button",onClick:n,className:"shrink-0 rounded-md p-1 text-fg-4 hover:bg-elevated hover:text-fg-2",children:c.jsx(gt,{className:"h-4 w-4"})})]}),p&&c.jsxs("div",{className:"mb-3 flex items-start gap-2 rounded-lg bg-red-500/10 px-3 py-2 text-xs text-red-400",children:[c.jsx(Tn,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),c.jsx("span",{className:"min-w-0 break-words",children:p})]}),u?c.jsxs("div",{className:"flex flex-col items-center gap-2.5 py-16 text-fg-5",children:[c.jsx(cn,{className:"h-5 w-5 fs-spin"}),c.jsx("p",{className:"text-xs",children:"加载中…"})]}):c.jsx("textarea",{value:r,onChange:N=>a(N.target.value),spellCheck:!1,className:"h-96 w-full resize-y rounded-lg border border-line bg-base px-4 py-3 font-mono text-sm leading-relaxed text-fg placeholder:text-fg-6 focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20",placeholder:`# AGENTS.md
|
|
496
496
|
|
|
497
497
|
在此编写该仓库的 Agent 指令…`}),c.jsxs("div",{className:"mt-4 flex items-center justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:n,className:"rounded-lg border border-line px-4 py-2 text-sm text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:"关闭"}),c.jsxs("button",{type:"button",onClick:()=>void x(),disabled:f||!E,className:"flex items-center gap-1.5 rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-500 disabled:opacity-40",children:[c.jsx(Sf,{className:"h-3.5 w-3.5"}),f?"保存中…":"保存"]})]})]})})}const Zy=1024,Jy=Zy*1024,e2=Jy*1024;function t2(e){return!e||e<=0?"0 B":e<Zy?`${e} B`:e<Jy?`${(e/Zy).toFixed(1)} KB`:e<e2?`${(e/Jy).toFixed(1)} MB`:`${(e/e2).toFixed(2)} GB`}const Mx="ws/";function rH({repoId:e}){const[t,n]=v.useState(!1),[r,a]=v.useState(null),[s,l]=v.useState(!1),[u,d]=v.useState(null),[f,m]=v.useState(null),[p,b]=v.useState(!1),x=async()=>{l(!0),d(null);try{const C=await Pz(e);a(C)}catch(C){d(C instanceof ns?C.message:"加载失败")}l(!1)};v.useEffect(()=>{t&&r===null&&x()},[t]);const E=async C=>{m(C);try{await Bz(e,C),await x()}catch(A){d(A instanceof ns?A.message:"删除失败")}m(null)},N=async()=>{b(!0);try{await Uz(e),await x()}catch(C){d(C instanceof ns?C.message:"清理失败")}b(!1)},w=(r==null?void 0:r.length)??0,T=(r==null?void 0:r.reduce((C,A)=>C+(A.diskUsage||0),0))??0;return c.jsxs("div",{className:"mt-3 border-t border-line pt-3",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("button",{type:"button",onClick:()=>n(C=>!C),className:"flex min-w-0 flex-1 items-center gap-1.5 text-left text-xs font-medium text-fg-3 transition-colors hover:text-fg-2",children:[t?c.jsx(v1,{className:"h-3 w-3 shrink-0"}):c.jsx(Ir,{className:"h-3 w-3 shrink-0"}),c.jsx(Tf,{className:"h-3 w-3 shrink-0 text-fg-5"}),c.jsx("span",{children:"工作空间"}),r!==null&&c.jsxs("span",{className:"text-fg-5",children:["(",w,") · ",t2(T)]})]}),t&&w>0&&c.jsxs("button",{type:"button",onClick:()=>void N(),disabled:p,className:"flex h-6 shrink-0 items-center gap-1 rounded border border-line px-2 text-xs text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2 disabled:opacity-50",children:[p?c.jsx("span",{className:"inline-block h-2.5 w-2.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):null,"清理已合并"]})]}),t&&c.jsxs("div",{className:"mt-2",children:[u&&c.jsxs("div",{className:"mb-2 flex items-center justify-between gap-2 rounded border border-red-500/30 bg-red-500/5 px-2 py-1 text-xs text-red-600",children:[c.jsx("span",{className:"truncate",children:u}),c.jsx("button",{type:"button",onClick:()=>d(null),className:"shrink-0 rounded p-0.5 transition-colors hover:bg-red-500/10",children:c.jsx(gt,{className:"h-3 w-3"})})]}),s&&r===null?c.jsx("div",{className:"flex justify-center py-3",children:c.jsx("span",{className:"inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-fg-5 border-t-transparent"})}):w===0?c.jsx("p",{className:"py-2 text-center text-xs text-fg-5",children:"暂无工作空间"}):c.jsx("ul",{className:"space-y-1",children:r==null?void 0:r.map(C=>{const A=C.branch.startsWith(Mx),k=A?C.branch.slice(Mx.length):C.branch,R=C.status==="active"?"bg-emerald-500/10 text-emerald-600":C.status==="idle"?"bg-amber-500/10 text-amber-600":"bg-fg-6/30 text-fg-4",O=C.status==="active"?"活跃":C.status==="idle"?"空闲":C.status==="merged"?"已合并":C.status==="stale"?"陈旧":C.status,j=C.status!=="active";return c.jsxs("li",{className:"flex items-center gap-2 rounded-md border border-line bg-elevated/40 px-2 py-1.5 text-xs",children:[c.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[C.running&&C.port&&c.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-emerald-500",title:`运行中 :${C.port}`}),c.jsxs("span",{className:"min-w-0 truncate font-mono",children:[A&&c.jsx("span",{className:"text-fg-5",children:Mx}),c.jsx("span",{className:"text-fg-2",children:k})]})]}),c.jsx("span",{className:re("shrink-0 rounded-full px-1.5 py-0.5 text-[10px] font-medium",R),children:O}),c.jsxs("span",{className:"flex shrink-0 items-center gap-0.5 text-fg-5",children:[c.jsx(v7,{className:"h-2.5 w-2.5"}),t2(C.diskUsage)]}),c.jsx("button",{type:"button",onClick:()=>void E(C.id),disabled:!j||f===C.id,title:j?"删除工作空间":"活跃工作空间无法删除",className:"flex h-5 w-5 shrink-0 items-center justify-center rounded text-fg-5 transition-colors hover:bg-red-500/10 hover:text-red-500 disabled:cursor-not-allowed disabled:opacity-30 disabled:hover:bg-transparent disabled:hover:text-fg-5",children:f===C.id?c.jsx("span",{className:"inline-block h-2.5 w-2.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):c.jsx(Ni,{className:"h-3 w-3"})})]},C.id)})})]})]})}function gI(){const e=Vn(),t=Fe(D=>D.repos),n=Fe(D=>D.activeRepoId),r=Fe(D=>D.setActiveRepo),a=Fe(D=>D.removeRepo),s=Fe(D=>D.loadRepos),[l,u]=v.useState(!1),[d,f]=v.useState(null),[m,p]=v.useState(null),[b,x]=v.useState(null),E=bn(D=>D.addToast),[N,w]=v.useState(null),[T,C]=v.useState(null),A=v.useRef(null),[k,R]=v.useState(null);v.useEffect(()=>{O1().then(D=>R(new Set(D.map(M=>M.host.toLowerCase())))).catch(()=>{})},[]);const O=v.useMemo(()=>{if(!k)return new Set;const D=new Set;for(const M of t){const q=pI(M.gitUrl);q&&!k.has(q.toLowerCase())&&D.add(M.id)}return D},[t,k]);v.useEffect(()=>{if(!T)return;const D=M=>{A.current&&!A.current.contains(M.target)&&C(null)};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[T]);const j=async(D,M)=>{p(D);try{M?await Mz(D):await Rz(D),await s()}catch{}p(null)},F=async D=>{x(D);try{const M=await Lz(D);await s();const q=M.alreadyUpToDate?"info":"success";E(M.summary,q,void 0,{persistent:!0})}catch(M){let q="拉取失败";if(M instanceof ns)try{q=JSON.parse(M.message).error??M.message}catch{q=M.message}E(q,"error",void 0,{persistent:!0})}x(null)};return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"mb-6 flex items-center justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("h1",{className:"text-lg font-semibold text-fg",children:"仓库管理"}),c.jsx("p",{className:"mt-0.5 text-sm text-fg-4",children:"管理代码仓库,每个仓库对应一个独立的 Agent 运行环境"})]}),c.jsxs("button",{type:"button",onClick:()=>u(!0),className:"flex shrink-0 items-center gap-1.5 rounded-lg bg-blue-600 px-3 py-2 text-sm font-medium text-white transition-colors hover:bg-blue-500 md:px-4",children:[c.jsx(Qr,{className:"h-4 w-4"}),c.jsx("span",{className:"hidden md:inline",children:"添加仓库"})]})]}),t.length===0?c.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-xl border border-dashed border-line-hard py-16 text-center",children:[c.jsx("div",{className:"rounded-full bg-elevated p-3",children:c.jsx(Qr,{className:"h-6 w-6 text-fg-4"})}),c.jsx("p",{className:"text-sm font-medium text-fg-3",children:"暂无代码仓库"}),c.jsx("p",{className:"text-xs text-fg-5",children:"添加一个本地仓库开始使用"}),c.jsx("button",{type:"button",onClick:()=>u(!0),className:"mt-2 rounded-lg border border-line px-4 py-2 text-sm text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:"添加仓库"})]}):c.jsx(c.Fragment,{children:c.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:t.map(D=>{const M=D.id===n;return c.jsxs("div",{className:re("rounded-xl border p-4 transition-colors",M?"border-blue-500/40 bg-blue-500/5":"border-line"),children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("button",{type:"button",onClick:()=>r(D.id),className:"flex min-w-0 items-center gap-2 text-left",children:[M?c.jsx(No,{className:"h-4 w-4 shrink-0 text-blue-500"}):c.jsx(FU,{className:"h-4 w-4 shrink-0 text-fg-5"}),c.jsx("span",{className:re("truncate font-medium",M?"text-fg":"text-fg-2"),children:D.name})]}),c.jsxs("span",{className:re("inline-flex shrink-0 items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium",D.running?"bg-emerald-500/10 text-emerald-600":"bg-fg-6/30 text-fg-4"),children:[c.jsx("span",{className:re("h-1.5 w-1.5 rounded-full",D.running?"bg-emerald-500":"bg-fg-5")}),D.running?"运行中":"已停止"]})]}),c.jsxs("dl",{className:"mt-3 space-y-1 font-mono text-xs text-fg-4",children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsx("dt",{className:"shrink-0 text-fg-5",children:"Git"}),c.jsx("dd",{className:"min-w-0 truncate",children:D.gitUrl})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("dt",{className:"shrink-0 text-fg-5",children:"路径"}),c.jsxs("dd",{className:"flex min-w-0 items-center gap-1.5",children:[c.jsx("span",{className:"truncate",children:D.localPath}),c.jsx("button",{type:"button",onClick:()=>void navigator.clipboard.writeText(D.localPath),title:"复制路径",className:"shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:text-fg-3",children:c.jsx(rp,{className:"h-3 w-3"})})]})]}),D.running&&D.port&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("dt",{className:"shrink-0 text-fg-5",children:"直连"}),c.jsxs("dd",{className:"flex min-w-0 items-center gap-1.5",children:[c.jsxs("a",{href:`http://127.0.0.1:${D.port}`,target:"_blank",rel:"noopener noreferrer",className:"truncate text-blue-500 hover:underline",children:["127.0.0.1:",D.port]}),c.jsx("button",{type:"button",onClick:()=>void navigator.clipboard.writeText(`http://127.0.0.1:${D.port}`),title:"复制链接",className:"shrink-0 rounded p-0.5 text-fg-5 transition-colors hover:text-fg-3",children:c.jsx(rp,{className:"h-3 w-3"})})]})]})]}),O.has(D.id)&&c.jsxs("button",{type:"button",onClick:()=>e("/settings"),className:"mt-2 flex w-full items-center gap-1.5 rounded-md bg-amber-500/10 px-2.5 py-1.5 text-left text-xs text-amber-600 transition-colors hover:bg-amber-500/15",children:[c.jsx(Tn,{className:"h-3.5 w-3.5 shrink-0"}),c.jsx("span",{children:"缺少 Git 源站凭证,Issue/PR 同步不可用"})]}),c.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[c.jsx("button",{type:"button",onClick:()=>void F(D.id),disabled:b===D.id,className:"flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-md border border-blue-500/30 px-2.5 text-xs font-medium text-blue-600 transition-colors hover:bg-blue-500/10 disabled:opacity-50",children:b===D.id?c.jsx("span",{className:"inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):c.jsxs(c.Fragment,{children:[c.jsx(gU,{className:"h-3 w-3"}),"拉取"]})}),c.jsx("button",{type:"button",onClick:()=>void j(D.id,D.running),disabled:m===D.id,className:re("flex h-8 flex-1 items-center justify-center gap-1.5 rounded-md border text-xs font-medium transition-colors disabled:opacity-50",D.running?"border-amber-500/30 text-amber-600 hover:bg-amber-500/10":"border-emerald-500/30 text-emerald-600 hover:bg-emerald-500/10"),children:m===D.id?c.jsx("span",{className:"inline-block h-3.5 w-3.5 animate-spin rounded-full border-2 border-current border-t-transparent"}):D.running?c.jsxs(c.Fragment,{children:[c.jsx(Vy,{className:"h-3 w-3 fill-current"}),"停止"]}):c.jsxs(c.Fragment,{children:[c.jsx(w1,{className:"h-3 w-3 fill-current"}),"启动"]})}),c.jsxs("div",{className:"relative",ref:T===D.id?A:void 0,children:[c.jsx("button",{type:"button",onClick:()=>C(T===D.id?null:D.id),className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-line text-fg-4 transition-colors hover:bg-elevated hover:text-fg-2",children:c.jsx(E1,{className:"h-4 w-4"})}),T===D.id&&c.jsxs("div",{className:"absolute right-0 top-full z-20 mt-1 min-w-[160px] overflow-hidden rounded-lg border border-line bg-elevated shadow-lg",children:[c.jsx("button",{type:"button",className:re("flex w-full items-center gap-2 px-3 py-2 text-left text-xs transition-colors hover:bg-base/60",D.runtimeType==="claude-code"?"text-orange-500":"text-sky-500"),onClick:async()=>{C(null);const q=D.runtimeType==="claude-code"?"opencode":"claude-code";await Fz(D.id,q),s()},children:D.runtimeType==="claude-code"?"Claude → OpenCode":"OpenCode → Claude"}),c.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-fg-3 transition-colors hover:bg-base/60",onClick:async()=>{C(null),await zz(D.id,!D.worktreeEnabled),s()},children:[c.jsx(Tf,{className:"h-3 w-3"}),c.jsx("span",{children:"Worktree"}),c.jsx("span",{className:re("ml-auto text-[10px]",D.worktreeEnabled?"text-violet-500":"text-fg-5"),children:D.worktreeEnabled?"已开启":"已关闭"})]}),c.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-fg-3 transition-colors hover:bg-base/60",onClick:()=>{C(null),w({id:D.id,name:D.name})},children:[c.jsx(ol,{className:"h-3 w-3"}),"配置"]}),c.jsx("div",{className:"my-0.5 border-t border-line"}),c.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-red-500 transition-colors hover:bg-red-500/10",onClick:()=>{C(null),f(D.id)},children:[c.jsx(Ni,{className:"h-3 w-3"}),"删除仓库"]})]})]})]}),d===D.id&&c.jsxs("div",{className:"mt-2 flex items-center justify-between rounded-md border border-red-500/20 bg-red-500/5 px-3 py-2",children:[c.jsx("span",{className:"text-xs text-red-500",children:"确认删除此仓库?"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("button",{type:"button",onClick:()=>{a(D.id),f(null)},className:"flex h-6 items-center gap-1 rounded border border-red-500/30 px-2 text-xs text-red-500 transition-colors hover:bg-red-500/10",children:[c.jsx(ur,{className:"h-3 w-3"}),"确认"]}),c.jsx("button",{type:"button",onClick:()=>f(null),className:"flex h-6 items-center gap-1 rounded border border-line px-2 text-xs text-fg-4 transition-colors hover:bg-elevated",children:"取消"})]})]}),D.worktreeEnabled&&c.jsx(rH,{repoId:D.id})]},D.id)})})}),c.jsxs("p",{className:"mt-3 text-xs text-fg-5",children:[t.length," 个仓库"]}),l&&c.jsx(tH,{onClose:()=>u(!1)}),N&&c.jsx(nH,{repoId:N.id,repoName:N.name,onClose:()=>w(null)})]})}function aH(){return c.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:c.jsx("div",{className:"mx-auto max-w-4xl",children:c.jsx(gI,{})})})}function n2(e){const t=[],n=String(e||"");let r=n.indexOf(","),a=0,s=!1;for(;!s;){r===-1&&(r=n.length,s=!0);const l=n.slice(a,r).trim();(l||!s)&&t.push(l),a=r+1,r=n.indexOf(",",a)}return t}function bI(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const iH=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,sH=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,lH={};function r2(e,t){return(lH.jsx?sH:iH).test(e)}const oH=/[ \t\n\f\r]/g;function uH(e){return typeof e=="object"?e.type==="text"?a2(e.value):!1:a2(e)}function a2(e){return e.replace(oH,"")===""}class Af{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Af.prototype.normal={};Af.prototype.property={};Af.prototype.space=void 0;function xI(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new Af(n,r,t)}function ef(e){return e.toLowerCase()}class ea{constructor(t,n){this.attribute=n,this.property=t}}ea.prototype.attribute="";ea.prototype.booleanish=!1;ea.prototype.boolean=!1;ea.prototype.commaOrSpaceSeparated=!1;ea.prototype.commaSeparated=!1;ea.prototype.defined=!1;ea.prototype.mustUseProperty=!1;ea.prototype.number=!1;ea.prototype.overloadedBoolean=!1;ea.prototype.property="";ea.prototype.spaceSeparated=!1;ea.prototype.space=void 0;let cH=0;const it=_o(),In=_o(),ev=_o(),Ce=_o(),Yt=_o(),no=_o(),fa=_o();function _o(){return 2**++cH}const tv=Object.freeze(Object.defineProperty({__proto__:null,boolean:it,booleanish:In,commaOrSpaceSeparated:fa,commaSeparated:no,number:Ce,overloadedBoolean:ev,spaceSeparated:Yt},Symbol.toStringTag,{value:"Module"})),jx=Object.keys(tv);class I1 extends ea{constructor(t,n,r,a){let s=-1;if(super(t,n),i2(this,"space",a),typeof r=="number")for(;++s<jx.length;){const l=jx[s];i2(this,jx[s],(r&tv[l])===tv[l])}}}I1.prototype.defined=!0;function i2(e,t,n){n&&(e[t]=n)}function rc(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const s=new I1(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[ef(r)]=r,n[ef(s.attribute)]=r}return new Af(t,n,e.space)}const yI=rc({properties:{ariaActiveDescendant:null,ariaAtomic:In,ariaAutoComplete:null,ariaBusy:In,ariaChecked:In,ariaColCount:Ce,ariaColIndex:Ce,ariaColSpan:Ce,ariaControls:Yt,ariaCurrent:null,ariaDescribedBy:Yt,ariaDetails:null,ariaDisabled:In,ariaDropEffect:Yt,ariaErrorMessage:null,ariaExpanded:In,ariaFlowTo:Yt,ariaGrabbed:In,ariaHasPopup:null,ariaHidden:In,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Yt,ariaLevel:Ce,ariaLive:null,ariaModal:In,ariaMultiLine:In,ariaMultiSelectable:In,ariaOrientation:null,ariaOwns:Yt,ariaPlaceholder:null,ariaPosInSet:Ce,ariaPressed:In,ariaReadOnly:In,ariaRelevant:null,ariaRequired:In,ariaRoleDescription:Yt,ariaRowCount:Ce,ariaRowIndex:Ce,ariaRowSpan:Ce,ariaSelected:In,ariaSetSize:Ce,ariaSort:null,ariaValueMax:Ce,ariaValueMin:Ce,ariaValueNow:Ce,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function vI(e,t){return t in e?e[t]:t}function EI(e,t){return vI(e,t.toLowerCase())}const dH=rc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:no,acceptCharset:Yt,accessKey:Yt,action:null,allow:null,allowFullScreen:it,allowPaymentRequest:it,allowUserMedia:it,alpha:it,alt:null,as:null,async:it,autoCapitalize:null,autoComplete:Yt,autoFocus:it,autoPlay:it,blocking:Yt,capture:null,charSet:null,checked:it,cite:null,className:Yt,closedBy:null,colorSpace:null,cols:Ce,colSpan:Ce,command:null,commandFor:null,content:null,contentEditable:In,controls:it,controlsList:Yt,coords:Ce|no,crossOrigin:null,data:null,dateTime:null,decoding:null,default:it,defer:it,dir:null,dirName:null,disabled:it,download:ev,draggable:In,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:it,formTarget:null,headers:Yt,height:Ce,hidden:ev,high:Ce,href:null,hrefLang:null,htmlFor:Yt,httpEquiv:Yt,id:null,imageSizes:null,imageSrcSet:null,inert:it,inputMode:null,integrity:null,is:null,isMap:it,itemId:null,itemProp:Yt,itemRef:Yt,itemScope:it,itemType:Yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:it,low:Ce,manifest:null,max:null,maxLength:Ce,media:null,method:null,min:null,minLength:Ce,multiple:it,muted:it,name:null,nonce:null,noModule:it,noValidate:it,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:it,optimum:Ce,pattern:null,ping:Yt,placeholder:null,playsInline:it,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:it,referrerPolicy:null,rel:Yt,required:it,reversed:it,rows:Ce,rowSpan:Ce,sandbox:Yt,scope:null,scoped:it,seamless:it,selected:it,shadowRootClonable:it,shadowRootCustomElementRegistry:it,shadowRootDelegatesFocus:it,shadowRootMode:null,shadowRootSerializable:it,shape:null,size:Ce,sizes:null,slot:null,span:Ce,spellCheck:In,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ce,step:null,style:null,tabIndex:Ce,target:null,title:null,translate:null,type:null,typeMustMatch:it,useMap:null,value:In,width:Ce,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Yt,axis:null,background:null,bgColor:null,border:Ce,borderColor:null,bottomMargin:Ce,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:it,declare:it,event:null,face:null,frame:null,frameBorder:null,hSpace:Ce,leftMargin:Ce,link:null,longDesc:null,lowSrc:null,marginHeight:Ce,marginWidth:Ce,noResize:it,noHref:it,noShade:it,noWrap:it,object:null,profile:null,prompt:null,rev:null,rightMargin:Ce,rules:null,scheme:null,scrolling:In,standby:null,summary:null,text:null,topMargin:Ce,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ce,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:it,disablePictureInPicture:it,disableRemotePlayback:it,exportParts:no,part:Yt,prefix:null,property:null,results:Ce,security:null,unselectable:null},space:"html",transform:EI}),fH=rc({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:fa,accentHeight:Ce,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ce,amplitude:Ce,arabicForm:null,ascent:Ce,attributeName:null,attributeType:null,azimuth:Ce,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ce,by:null,calcMode:null,capHeight:Ce,className:Yt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ce,diffuseConstant:Ce,direction:null,display:null,dur:null,divisor:Ce,dominantBaseline:null,download:it,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ce,enableBackground:null,end:null,event:null,exponent:Ce,externalResourcesRequired:null,fill:null,fillOpacity:Ce,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:no,g2:no,glyphName:no,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ce,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ce,horizOriginX:Ce,horizOriginY:Ce,id:null,ideographic:Ce,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ce,k:Ce,k1:Ce,k2:Ce,k3:Ce,k4:Ce,kernelMatrix:fa,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ce,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ce,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ce,overlineThickness:Ce,paintOrder:null,panose1:null,path:null,pathLength:Ce,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ce,pointsAtY:Ce,pointsAtZ:Ce,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:fa,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:fa,rev:fa,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:fa,requiredFeatures:fa,requiredFonts:fa,requiredFormats:fa,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ce,specularExponent:Ce,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ce,strikethroughThickness:Ce,string:null,stroke:null,strokeDashArray:fa,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ce,strokeOpacity:Ce,strokeWidth:null,style:null,surfaceScale:Ce,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:fa,tabIndex:Ce,tableValues:null,target:null,targetX:Ce,targetY:Ce,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:fa,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ce,underlineThickness:Ce,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ce,values:null,vAlphabetic:Ce,vMathematical:Ce,vectorEffect:null,vHanging:Ce,vIdeographic:Ce,version:null,vertAdvY:Ce,vertOriginX:Ce,vertOriginY:Ce,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ce,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:vI}),NI=rc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),_I=rc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:EI}),TI=rc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),hH={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},mH=/[A-Z]/g,s2=/-[a-z]/g,pH=/^data[-\w.:]+$/i;function b0(e,t){const n=ef(t);let r=t,a=ea;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&pH.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(s2,bH);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!s2.test(s)){let l=s.replace(mH,gH);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}a=I1}return new a(r,t)}function gH(e){return"-"+e.toLowerCase()}function bH(e){return e.charAt(1).toUpperCase()}const Cf=xI([yI,dH,NI,_I,TI],"html"),cl=xI([yI,fH,NI,_I,TI],"svg");function l2(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function SI(e){return e.join(" ").trim()}var gu={},Dx,o2;function xH(){if(o2)return Dx;o2=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,u=/^\s+|\s+$/g,d=`
|
|
498
498
|
`,f="/",m="*",p="",b="comment",x="declaration";function E(w,T){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];T=T||{};var C=1,A=1;function k(Q){var W=Q.match(t);W&&(C+=W.length);var K=Q.lastIndexOf(d);A=~K?Q.length-K:A+Q.length}function R(){var Q={line:C,column:A};return function(W){return W.position=new O(Q),D(),W}}function O(Q){this.start=Q,this.end={line:C,column:A},this.source=T.source}O.prototype.content=w;function j(Q){var W=new Error(T.source+":"+C+":"+A+": "+Q);if(W.reason=Q,W.filename=T.source,W.line=C,W.column=A,W.source=w,!T.silent)throw W}function F(Q){var W=Q.exec(w);if(W){var K=W[0];return k(K),w=w.slice(K.length),W}}function D(){F(n)}function M(Q){var W;for(Q=Q||[];W=q();)W!==!1&&Q.push(W);return Q}function q(){var Q=R();if(!(f!=w.charAt(0)||m!=w.charAt(1))){for(var W=2;p!=w.charAt(W)&&(m!=w.charAt(W)||f!=w.charAt(W+1));)++W;if(W+=2,p===w.charAt(W-1))return j("End of comment missing");var K=w.slice(2,W-2);return A+=2,k(K),w=w.slice(W),A+=2,Q({type:b,comment:K})}}function G(){var Q=R(),W=F(r);if(W){if(q(),!F(a))return j("property missing ':'");var K=F(s),H=Q({type:x,property:N(W[0].replace(e,p)),value:K?N(K[0].replace(e,p)):p});return F(l),H}}function ae(){var Q=[];M(Q);for(var W;W=G();)W!==!1&&(Q.push(W),M(Q));return Q}return D(),ae()}function N(w){return w?w.replace(u,p):p}return Dx=E,Dx}var u2;function yH(){if(u2)return gu;u2=1;var e=gu&&gu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(gu,"__esModule",{value:!0}),gu.default=n;const t=e(xH());function n(r,a){let s=null;if(!r||typeof r!="string")return s;const l=(0,t.default)(r),u=typeof a=="function";return l.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:m}=d;u?a(f,m,d):m&&(s=s||{},s[f]=m)}),s}return gu}var gd={},c2;function vH(){if(c2)return gd;c2=1,Object.defineProperty(gd,"__esModule",{value:!0}),gd.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,s=function(f){return!f||n.test(f)||e.test(f)},l=function(f,m){return m.toUpperCase()},u=function(f,m){return"".concat(m,"-")},d=function(f,m){return m===void 0&&(m={}),s(f)?f:(f=f.toLowerCase(),m.reactCompat?f=f.replace(a,u):f=f.replace(r,u),f.replace(t,l))};return gd.camelCase=d,gd}var bd,d2;function EH(){if(d2)return bd;d2=1;var e=bd&&bd.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(yH()),n=vH();function r(a,s){var l={};return!a||typeof a!="string"||(0,t.default)(a,function(u,d){u&&d&&(l[(0,n.camelCase)(u,s)]=d)}),l}return r.default=r,bd=r,bd}var NH=EH();const _H=vf(NH),x0=wI("end"),Ci=wI("start");function wI(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function TH(e){const t=Ci(e),n=x0(e);if(t&&n)return{start:t,end:n}}function Bd(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?f2(e.position):"start"in e||"end"in e?f2(e):"line"in e||"column"in e?nv(e):""}function nv(e){return h2(e&&e.line)+":"+h2(e&&e.column)}function f2(e){return nv(e&&e.start)+"-"+nv(e&&e.end)}function h2(e){return e&&typeof e=="number"?e:1}class Er extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",s={},l=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?a=t:!s.cause&&t&&(l=!0,a=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?s.ruleId=r:(s.source=r.slice(0,d),s.ruleId=r.slice(d+1))}if(!s.place&&s.ancestors&&s.ancestors){const d=s.ancestors[s.ancestors.length-1];d&&(s.place=d.position)}const u=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=u?u.line:void 0,this.name=Bd(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=l&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Er.prototype.file="";Er.prototype.name="";Er.prototype.reason="";Er.prototype.message="";Er.prototype.stack="";Er.prototype.column=void 0;Er.prototype.line=void 0;Er.prototype.ancestors=void 0;Er.prototype.cause=void 0;Er.prototype.fatal=void 0;Er.prototype.place=void 0;Er.prototype.ruleId=void 0;Er.prototype.source=void 0;const R1={}.hasOwnProperty,SH=new Map,wH=/[A-Z]/g,AH=new Set(["table","tbody","thead","tfoot","tr"]),CH=new Set(["td","th"]),AI="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function kH(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=PH(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=LH(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?cl:Cf,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=CI(a,e,void 0);return s&&typeof s!="string"?s:a.create(e,a.Fragment,{children:s||void 0},void 0)}function CI(e,t,n){if(t.type==="element")return OH(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return IH(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return MH(e,t,n);if(t.type==="mdxjsEsm")return RH(e,t);if(t.type==="root")return jH(e,t,n);if(t.type==="text")return DH(e,t)}function OH(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=cl,e.schema=a),e.ancestors.push(t);const s=OI(e,t.tagName,!1),l=BH(e,t);let u=j1(e,t);return AH.has(t.tagName)&&(u=u.filter(function(d){return typeof d=="string"?!uH(d):!0})),kI(e,l,s,t),M1(l,u),e.ancestors.pop(),e.schema=r,e.create(t,s,l,n)}function IH(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}tf(e,t.position)}function RH(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);tf(e,t.position)}function MH(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=cl,e.schema=a),e.ancestors.push(t);const s=t.name===null?e.Fragment:OI(e,t.name,!0),l=UH(e,t),u=j1(e,t);return kI(e,l,s,t),M1(l,u),e.ancestors.pop(),e.schema=r,e.create(t,s,l,n)}function jH(e,t,n){const r={};return M1(r,j1(e,t)),e.create(t,e.Fragment,r,n)}function DH(e,t){return t.value}function kI(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function M1(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function LH(e,t,n){return r;function r(a,s,l,u){const f=Array.isArray(l.children)?n:t;return u?f(s,l,u):f(s,l)}}function PH(e,t){return n;function n(r,a,s,l){const u=Array.isArray(s.children),d=Ci(r);return t(a,s,l,u,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function BH(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&R1.call(t.properties,a)){const s=zH(e,a,t.properties[a]);if(s){const[l,u]=s;e.tableCellAlignToStyle&&l==="align"&&typeof u=="string"&&CH.has(t.tagName)?r=u:n[l]=u}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function UH(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const l=s.expression;l.type;const u=l.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else tf(e,t.position);else{const a=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,s=e.evaluater.evaluateExpression(u.expression)}else tf(e,t.position);else s=r.value===null?!0:r.value;n[a]=s}return n}function j1(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:SH;for(;++r<t.children.length;){const s=t.children[r];let l;if(e.passKeys){const d=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(d){const f=a.get(d)||0;l=d+"-"+f,a.set(d,f+1)}}const u=CI(e,s,l);u!==void 0&&n.push(u)}return n}function zH(e,t,n){const r=b0(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?bI(n):SI(n)),r.property==="style"){let a=typeof n=="object"?n:FH(e,String(n));return e.stylePropertyNameCase==="css"&&(a=HH(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?hH[r.property]||r.property:r.attribute,n]}}function FH(e,t){try{return _H(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new Er("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=AI+"#cannot-parse-style-attribute",a}}function OI(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let s=-1,l;for(;++s<a.length;){const u=r2(a[s])?{type:"Identifier",name:a[s]}:{type:"Literal",value:a[s]};l=l?{type:"MemberExpression",object:l,property:u,computed:!!(s&&u.type==="Literal"),optional:!1}:u}r=l}else r=r2(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return R1.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);tf(e)}function tf(e,t){const n=new Er("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=AI+"#cannot-handle-mdx-estrees-without-createevaluater",n}function HH(e){const t={};let n;for(n in e)R1.call(e,n)&&(t[$H(n)]=e[n]);return t}function $H(e){let t=e.replace(wH,YH);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function YH(e){return"-"+e.toLowerCase()}const Lx={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},qH={};function D1(e,t){const n=qH,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return II(e,r,a)}function II(e,t,n){if(GH(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return m2(e.children,t,n)}return Array.isArray(e)?m2(e,t,n):""}function m2(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=II(e[a],t,n);return r.join("")}function GH(e){return!!(e&&typeof e=="object")}const p2=document.createElement("i");function L1(e){const t="&"+e+";";p2.innerHTML=t;const n=p2.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function pa(e,t,n,r){const a=e.length;let s=0,l;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);s<r.length;)l=r.slice(s,s+1e4),l.unshift(t,0),e.splice(...l),s+=1e4,t+=1e4}function Oa(e,t){return e.length>0?(pa(e,e.length,0,t),e):t}const g2={}.hasOwnProperty;function RI(e){const t={};let n=-1;for(;++n<e.length;)KH(t,e[n]);return t}function KH(e,t){let n;for(n in t){const a=(g2.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let l;if(s)for(l in s){g2.call(a,l)||(a[l]=[]);const u=s[l];VH(a[l],Array.isArray(u)?u:u?[u]:[])}}}function VH(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);pa(e,0,0,r)}function MI(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Qa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Rr=dl(/[A-Za-z]/),yr=dl(/[\dA-Za-z]/),WH=dl(/[#-'*+\--9=?A-Z^-~]/);function lp(e){return e!==null&&(e<32||e===127)}const rv=dl(/\d/),XH=dl(/[\dA-Fa-f]/),QH=dl(/[!-/:-@[-`{-~]/);function Xe(e){return e!==null&&e<-2}function Gt(e){return e!==null&&(e<0||e===32)}function pt(e){return e===-2||e===-1||e===32}const y0=dl(new RegExp("\\p{P}|\\p{S}","u")),co=dl(/\s/);function dl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ac(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const s=e.charCodeAt(n);let l="";if(s===37&&yr(e.charCodeAt(n+1))&&yr(e.charCodeAt(n+2)))a=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(l=String.fromCharCode(s));else if(s>55295&&s<57344){const u=e.charCodeAt(n+1);s<56320&&u>56319&&u<57344?(l=String.fromCharCode(s,u),a=1):l="�"}else l=String.fromCharCode(s);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+a+1,l=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function Tt(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let s=0;return l;function l(d){return pt(d)?(e.enter(n),u(d)):t(d)}function u(d){return pt(d)&&s++<a?(e.consume(d),u):(e.exit(n),t(d))}}const ZH={tokenize:JH};function JH(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Tt(e,t,"linePrefix")}function a(u){return e.enter("paragraph"),s(u)}function s(u){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,l(u)}function l(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return Xe(u)?(e.consume(u),e.exit("chunkText"),s):(e.consume(u),l)}}const e$={tokenize:t$},b2={tokenize:n$};function t$(e){const t=this,n=[];let r=0,a,s,l;return u;function u(A){if(r<n.length){const k=n[r];return t.containerState=k[1],e.attempt(k[0].continuation,d,f)(A)}return f(A)}function d(A){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&C();const k=t.events.length;let R=k,O;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){O=t.events[R][1].end;break}T(r);let j=k;for(;j<t.events.length;)t.events[j][1].end={...O},j++;return pa(t.events,R+1,0,t.events.slice(k)),t.events.length=j,f(A)}return u(A)}function f(A){if(r===n.length){if(!a)return b(A);if(a.currentConstruct&&a.currentConstruct.concrete)return E(A);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(b2,m,p)(A)}function m(A){return a&&C(),T(r),b(A)}function p(A){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,E(A)}function b(A){return t.containerState={},e.attempt(b2,x,E)(A)}function x(A){return r++,n.push([t.currentConstruct,t.containerState]),b(A)}function E(A){if(A===null){a&&C(),T(0),e.consume(A);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:s}),N(A)}function N(A){if(A===null){w(e.exit("chunkFlow"),!0),T(0),e.consume(A);return}return Xe(A)?(e.consume(A),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(A),N)}function w(A,k){const R=t.sliceStream(A);if(k&&R.push(null),A.previous=s,s&&(s.next=A),s=A,a.defineSkip(A.start),a.write(R),t.parser.lazy[A.start.line]){let O=a.events.length;for(;O--;)if(a.events[O][1].start.offset<l&&(!a.events[O][1].end||a.events[O][1].end.offset>l))return;const j=t.events.length;let F=j,D,M;for(;F--;)if(t.events[F][0]==="exit"&&t.events[F][1].type==="chunkFlow"){if(D){M=t.events[F][1].end;break}D=!0}for(T(r),O=j;O<t.events.length;)t.events[O][1].end={...M},O++;pa(t.events,F+1,0,t.events.slice(j)),t.events.length=O}}function T(A){let k=n.length;for(;k-- >A;){const R=n[k];t.containerState=R[1],R[0].exit.call(t,e)}n.length=A}function C(){a.write([null]),s=void 0,a=void 0,t.containerState._closeFlow=void 0}}function n$(e,t,n){return Tt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Pu(e){if(e===null||Gt(e)||co(e))return 1;if(y0(e))return 2}function v0(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const s=e[a].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const av={name:"attention",resolveAll:r$,tokenize:a$};function r$(e,t){let n=-1,r,a,s,l,u,d,f,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},b={...e[n][1].start};x2(p,-d),x2(b,d),l={type:d>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},u={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},s={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:d>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},e[r][1].end={...l.start},e[n][1].start={...u.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Oa(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Oa(f,[["enter",a,t],["enter",l,t],["exit",l,t],["enter",s,t]]),f=Oa(f,v0(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Oa(f,[["exit",s,t],["enter",u,t],["exit",u,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,f=Oa(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,pa(e,r-1,n-r+3,f),n=r+f.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function a$(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=Pu(r);let s;return l;function l(d){return s=d,e.enter("attentionSequence"),u(d)}function u(d){if(d===s)return e.consume(d),u;const f=e.exit("attentionSequence"),m=Pu(d),p=!m||m===2&&a||n.includes(d),b=!a||a===2&&m||n.includes(r);return f._open=!!(s===42?p:p&&(a||!b)),f._close=!!(s===42?b:b&&(m||!p)),t(d)}}function x2(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const i$={name:"autolink",tokenize:s$};function s$(e,t,n){let r=0;return a;function a(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(x){return Rr(x)?(e.consume(x),l):x===64?n(x):f(x)}function l(x){return x===43||x===45||x===46||yr(x)?(r=1,u(x)):f(x)}function u(x){return x===58?(e.consume(x),r=0,d):(x===43||x===45||x===46||yr(x))&&r++<32?(e.consume(x),u):(r=0,f(x))}function d(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):x===null||x===32||x===60||lp(x)?n(x):(e.consume(x),d)}function f(x){return x===64?(e.consume(x),m):WH(x)?(e.consume(x),f):n(x)}function m(x){return yr(x)?p(x):n(x)}function p(x){return x===46?(e.consume(x),r=0,m):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):b(x)}function b(x){if((x===45||yr(x))&&r++<63){const E=x===45?b:p;return e.consume(x),E}return n(x)}}const kf={partial:!0,tokenize:l$};function l$(e,t,n){return r;function r(s){return pt(s)?Tt(e,a,"linePrefix")(s):a(s)}function a(s){return s===null||Xe(s)?t(s):n(s)}}const jI={continuation:{tokenize:u$},exit:c$,name:"blockQuote",tokenize:o$};function o$(e,t,n){const r=this;return a;function a(l){if(l===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),s}return n(l)}function s(l){return pt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function u$(e,t,n){const r=this;return a;function a(l){return pt(l)?Tt(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):s(l)}function s(l){return e.attempt(jI,t,n)(l)}}function c$(e){e.exit("blockQuote")}const DI={name:"characterEscape",tokenize:d$};function d$(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),a}function a(s){return QH(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const LI={name:"characterReference",tokenize:f$};function f$(e,t,n){const r=this;let a=0,s,l;return u;function u(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),d}function d(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),s=31,l=yr,m(p))}function f(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,l=XH,m):(e.enter("characterReferenceValue"),s=7,l=rv,m(p))}function m(p){if(p===59&&a){const b=e.exit("characterReferenceValue");return l===yr&&!L1(r.sliceSerialize(b))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(p)&&a++<s?(e.consume(p),m):n(p)}}const y2={partial:!0,tokenize:m$},v2={concrete:!0,name:"codeFenced",tokenize:h$};function h$(e,t,n){const r=this,a={partial:!0,tokenize:R};let s=0,l=0,u;return d;function d(O){return f(O)}function f(O){const j=r.events[r.events.length-1];return s=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,u=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(O)}function m(O){return O===u?(l++,e.consume(O),m):l<3?n(O):(e.exit("codeFencedFenceSequence"),pt(O)?Tt(e,p,"whitespace")(O):p(O))}function p(O){return O===null||Xe(O)?(e.exit("codeFencedFence"),r.interrupt?t(O):e.check(y2,N,k)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(O))}function b(O){return O===null||Xe(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(O)):pt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Tt(e,x,"whitespace")(O)):O===96&&O===u?n(O):(e.consume(O),b)}function x(O){return O===null||Xe(O)?p(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),E(O))}function E(O){return O===null||Xe(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(O)):O===96&&O===u?n(O):(e.consume(O),E)}function N(O){return e.attempt(a,k,w)(O)}function w(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),T}function T(O){return s>0&&pt(O)?Tt(e,C,"linePrefix",s+1)(O):C(O)}function C(O){return O===null||Xe(O)?e.check(y2,N,k)(O):(e.enter("codeFlowValue"),A(O))}function A(O){return O===null||Xe(O)?(e.exit("codeFlowValue"),C(O)):(e.consume(O),A)}function k(O){return e.exit("codeFenced"),t(O)}function R(O,j,F){let D=0;return M;function M(W){return O.enter("lineEnding"),O.consume(W),O.exit("lineEnding"),q}function q(W){return O.enter("codeFencedFence"),pt(W)?Tt(O,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):G(W)}function G(W){return W===u?(O.enter("codeFencedFenceSequence"),ae(W)):F(W)}function ae(W){return W===u?(D++,O.consume(W),ae):D>=l?(O.exit("codeFencedFenceSequence"),pt(W)?Tt(O,Q,"whitespace")(W):Q(W)):F(W)}function Q(W){return W===null||Xe(W)?(O.exit("codeFencedFence"),j(W)):F(W)}}}function m$(e,t,n){const r=this;return a;function a(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s)}function s(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Px={name:"codeIndented",tokenize:g$},p$={partial:!0,tokenize:b$};function g$(e,t,n){const r=this;return a;function a(f){return e.enter("codeIndented"),Tt(e,s,"linePrefix",5)(f)}function s(f){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(f):n(f)}function l(f){return f===null?d(f):Xe(f)?e.attempt(p$,l,d)(f):(e.enter("codeFlowValue"),u(f))}function u(f){return f===null||Xe(f)?(e.exit("codeFlowValue"),l(f)):(e.consume(f),u)}function d(f){return e.exit("codeIndented"),t(f)}}function b$(e,t,n){const r=this;return a;function a(l){return r.parser.lazy[r.now().line]?n(l):Xe(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):Tt(e,s,"linePrefix",5)(l)}function s(l){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):Xe(l)?a(l):n(l)}}const x$={name:"codeText",previous:v$,resolve:y$,tokenize:E$};function y$(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function v$(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function E$(e,t,n){let r=0,a,s;return l;function l(p){return e.enter("codeText"),e.enter("codeTextSequence"),u(p)}function u(p){return p===96?(e.consume(p),r++,u):(e.exit("codeTextSequence"),d(p))}function d(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),d):p===96?(s=e.enter("codeTextSequence"),a=0,m(p)):Xe(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(p))}function f(p){return p===null||p===32||p===96||Xe(p)?(e.exit("codeTextData"),d(p)):(e.consume(p),f)}function m(p){return p===96?(e.consume(p),a++,m):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(s.type="codeTextData",f(p))}}class N${constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&xd(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),xd(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),xd(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);xd(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);xd(this.left,n.reverse())}}}function xd(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function PI(e){const t={};let n=-1,r,a,s,l,u,d,f;const m=new N$(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,s=0,s<d.length&&d[s][1].type==="lineEndingBlank"&&(s+=2),s<d.length&&d[s][1].type==="content"))for(;++s<d.length&&d[s][1].type!=="content";)d[s][1].type==="chunkText"&&(d[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,_$(m,n)),n=t[n],f=!0);else if(r[1]._container){for(s=n,a=void 0;s--;)if(l=m.get(s),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(a&&(m.get(a)[1].type="lineEndingBlank"),l[1].type="lineEnding",a=s);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;a&&(r[1].end={...m.get(a)[1].start},u=m.slice(a,n),u.unshift(r),m.splice(a,n-a+1,u))}}return pa(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!f}function _$(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const s=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const u=l.events,d=[],f={};let m,p,b=-1,x=n,E=0,N=0;const w=[N];for(;x;){for(;e.get(++a)[1]!==x;);s.push(a),x._tokenizer||(m=r.sliceStream(x),x.next||m.push(null),p&&l.defineSkip(x.start),x._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),x._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),p=x,x=x.next}for(x=n;++b<u.length;)u[b][0]==="exit"&&u[b-1][0]==="enter"&&u[b][1].type===u[b-1][1].type&&u[b][1].start.line!==u[b][1].end.line&&(N=b+1,w.push(N),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(l.events=[],x?(x._tokenizer=void 0,x.previous=void 0):w.pop(),b=w.length;b--;){const T=u.slice(w[b],w[b+1]),C=s.pop();d.push([C,C+T.length-1]),e.splice(C,2,T)}for(d.reverse(),b=-1;++b<d.length;)f[E+d[b][0]]=E+d[b][1],E+=d[b][1]-d[b][0]-1;return f}const T$={resolve:w$,tokenize:A$},S$={partial:!0,tokenize:C$};function w$(e){return PI(e),e}function A$(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(u)}function a(u){return u===null?s(u):Xe(u)?e.check(S$,l,s)(u):(e.consume(u),a)}function s(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function l(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function C$(e,t,n){const r=this;return a;function a(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Tt(e,s,"linePrefix")}function s(l){if(l===null||Xe(l))return n(l);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function BI(e,t,n,r,a,s,l,u,d){const f=d||Number.POSITIVE_INFINITY;let m=0;return p;function p(T){return T===60?(e.enter(r),e.enter(a),e.enter(s),e.consume(T),e.exit(s),b):T===null||T===32||T===41||lp(T)?n(T):(e.enter(r),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),N(T))}function b(T){return T===62?(e.enter(s),e.consume(T),e.exit(s),e.exit(a),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),x(T))}function x(T){return T===62?(e.exit("chunkString"),e.exit(u),b(T)):T===null||T===60||Xe(T)?n(T):(e.consume(T),T===92?E:x)}function E(T){return T===60||T===62||T===92?(e.consume(T),x):x(T)}function N(T){return!m&&(T===null||T===41||Gt(T))?(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(r),t(T)):m<f&&T===40?(e.consume(T),m++,N):T===41?(e.consume(T),m--,N):T===null||T===32||T===40||lp(T)?n(T):(e.consume(T),T===92?w:N)}function w(T){return T===40||T===41||T===92?(e.consume(T),N):N(T)}}function UI(e,t,n,r,a,s){const l=this;let u=0,d;return f;function f(x){return e.enter(r),e.enter(a),e.consume(x),e.exit(a),e.enter(s),m}function m(x){return u>999||x===null||x===91||x===93&&!d||x===94&&!u&&"_hiddenFootnoteSupport"in l.parser.constructs?n(x):x===93?(e.exit(s),e.enter(a),e.consume(x),e.exit(a),e.exit(r),t):Xe(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===null||x===91||x===93||Xe(x)||u++>999?(e.exit("chunkString"),m(x)):(e.consume(x),d||(d=!pt(x)),x===92?b:p)}function b(x){return x===91||x===92||x===93?(e.consume(x),u++,p):p(x)}}function zI(e,t,n,r,a,s){let l;return u;function u(b){return b===34||b===39||b===40?(e.enter(r),e.enter(a),e.consume(b),e.exit(a),l=b===40?41:b,d):n(b)}function d(b){return b===l?(e.enter(a),e.consume(b),e.exit(a),e.exit(r),t):(e.enter(s),f(b))}function f(b){return b===l?(e.exit(s),d(l)):b===null?n(b):Xe(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),Tt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===l||b===null||Xe(b)?(e.exit("chunkString"),f(b)):(e.consume(b),b===92?p:m)}function p(b){return b===l||b===92?(e.consume(b),m):m(b)}}function Ud(e,t){let n;return r;function r(a){return Xe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):pt(a)?Tt(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const k$={name:"definition",tokenize:I$},O$={partial:!0,tokenize:R$};function I$(e,t,n){const r=this;let a;return s;function s(x){return e.enter("definition"),l(x)}function l(x){return UI.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function u(x){return a=Qa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),d):n(x)}function d(x){return Gt(x)?Ud(e,f)(x):f(x)}function f(x){return BI(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function m(x){return e.attempt(O$,p,p)(x)}function p(x){return pt(x)?Tt(e,b,"whitespace")(x):b(x)}function b(x){return x===null||Xe(x)?(e.exit("definition"),r.parser.defined.push(a),t(x)):n(x)}}function R$(e,t,n){return r;function r(u){return Gt(u)?Ud(e,a)(u):n(u)}function a(u){return zI(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function s(u){return pt(u)?Tt(e,l,"whitespace")(u):l(u)}function l(u){return u===null||Xe(u)?t(u):n(u)}}const M$={name:"hardBreakEscape",tokenize:j$};function j$(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),a}function a(s){return Xe(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const D$={name:"headingAtx",resolve:L$,tokenize:P$};function L$(e,t){let n=e.length-2,r=3,a,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},pa(e,r,n-r+1,[["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t]])),e}function P$(e,t,n){let r=0;return a;function a(m){return e.enter("atxHeading"),s(m)}function s(m){return e.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(e.consume(m),l):m===null||Gt(m)?(e.exit("atxHeadingSequence"),u(m)):n(m)}function u(m){return m===35?(e.enter("atxHeadingSequence"),d(m)):m===null||Xe(m)?(e.exit("atxHeading"),t(m)):pt(m)?Tt(e,u,"whitespace")(m):(e.enter("atxHeadingText"),f(m))}function d(m){return m===35?(e.consume(m),d):(e.exit("atxHeadingSequence"),u(m))}function f(m){return m===null||m===35||Gt(m)?(e.exit("atxHeadingText"),u(m)):(e.consume(m),f)}}const B$=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],E2=["pre","script","style","textarea"],U$={concrete:!0,name:"htmlFlow",resolveTo:H$,tokenize:$$},z$={partial:!0,tokenize:q$},F$={partial:!0,tokenize:Y$};function H$(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function $$(e,t,n){const r=this;let a,s,l,u,d;return f;function f(B){return m(B)}function m(B){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(B),p}function p(B){return B===33?(e.consume(B),b):B===47?(e.consume(B),s=!0,N):B===63?(e.consume(B),a=3,r.interrupt?t:L):Rr(B)?(e.consume(B),l=String.fromCharCode(B),w):n(B)}function b(B){return B===45?(e.consume(B),a=2,x):B===91?(e.consume(B),a=5,u=0,E):Rr(B)?(e.consume(B),a=4,r.interrupt?t:L):n(B)}function x(B){return B===45?(e.consume(B),r.interrupt?t:L):n(B)}function E(B){const me="CDATA[";return B===me.charCodeAt(u++)?(e.consume(B),u===me.length?r.interrupt?t:G:E):n(B)}function N(B){return Rr(B)?(e.consume(B),l=String.fromCharCode(B),w):n(B)}function w(B){if(B===null||B===47||B===62||Gt(B)){const me=B===47,le=l.toLowerCase();return!me&&!s&&E2.includes(le)?(a=1,r.interrupt?t(B):G(B)):B$.includes(l.toLowerCase())?(a=6,me?(e.consume(B),T):r.interrupt?t(B):G(B)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(B):s?C(B):A(B))}return B===45||yr(B)?(e.consume(B),l+=String.fromCharCode(B),w):n(B)}function T(B){return B===62?(e.consume(B),r.interrupt?t:G):n(B)}function C(B){return pt(B)?(e.consume(B),C):M(B)}function A(B){return B===47?(e.consume(B),M):B===58||B===95||Rr(B)?(e.consume(B),k):pt(B)?(e.consume(B),A):M(B)}function k(B){return B===45||B===46||B===58||B===95||yr(B)?(e.consume(B),k):R(B)}function R(B){return B===61?(e.consume(B),O):pt(B)?(e.consume(B),R):A(B)}function O(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(e.consume(B),d=B,j):pt(B)?(e.consume(B),O):F(B)}function j(B){return B===d?(e.consume(B),d=null,D):B===null||Xe(B)?n(B):(e.consume(B),j)}function F(B){return B===null||B===34||B===39||B===47||B===60||B===61||B===62||B===96||Gt(B)?R(B):(e.consume(B),F)}function D(B){return B===47||B===62||pt(B)?A(B):n(B)}function M(B){return B===62?(e.consume(B),q):n(B)}function q(B){return B===null||Xe(B)?G(B):pt(B)?(e.consume(B),q):n(B)}function G(B){return B===45&&a===2?(e.consume(B),K):B===60&&a===1?(e.consume(B),H):B===62&&a===4?(e.consume(B),P):B===63&&a===3?(e.consume(B),L):B===93&&a===5?(e.consume(B),V):Xe(B)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(z$,ee,ae)(B)):B===null||Xe(B)?(e.exit("htmlFlowData"),ae(B)):(e.consume(B),G)}function ae(B){return e.check(F$,Q,ee)(B)}function Q(B){return e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),W}function W(B){return B===null||Xe(B)?ae(B):(e.enter("htmlFlowData"),G(B))}function K(B){return B===45?(e.consume(B),L):G(B)}function H(B){return B===47?(e.consume(B),l="",$):G(B)}function $(B){if(B===62){const me=l.toLowerCase();return E2.includes(me)?(e.consume(B),P):G(B)}return Rr(B)&&l.length<8?(e.consume(B),l+=String.fromCharCode(B),$):G(B)}function V(B){return B===93?(e.consume(B),L):G(B)}function L(B){return B===62?(e.consume(B),P):B===45&&a===2?(e.consume(B),L):G(B)}function P(B){return B===null||Xe(B)?(e.exit("htmlFlowData"),ee(B)):(e.consume(B),P)}function ee(B){return e.exit("htmlFlow"),t(B)}}function Y$(e,t,n){const r=this;return a;function a(l){return Xe(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):n(l)}function s(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function q$(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(kf,t,n)}}const G$={name:"htmlText",tokenize:K$};function K$(e,t,n){const r=this;let a,s,l;return u;function u(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),d}function d(L){return L===33?(e.consume(L),f):L===47?(e.consume(L),R):L===63?(e.consume(L),A):Rr(L)?(e.consume(L),F):n(L)}function f(L){return L===45?(e.consume(L),m):L===91?(e.consume(L),s=0,E):Rr(L)?(e.consume(L),C):n(L)}function m(L){return L===45?(e.consume(L),x):n(L)}function p(L){return L===null?n(L):L===45?(e.consume(L),b):Xe(L)?(l=p,H(L)):(e.consume(L),p)}function b(L){return L===45?(e.consume(L),x):p(L)}function x(L){return L===62?K(L):L===45?b(L):p(L)}function E(L){const P="CDATA[";return L===P.charCodeAt(s++)?(e.consume(L),s===P.length?N:E):n(L)}function N(L){return L===null?n(L):L===93?(e.consume(L),w):Xe(L)?(l=N,H(L)):(e.consume(L),N)}function w(L){return L===93?(e.consume(L),T):N(L)}function T(L){return L===62?K(L):L===93?(e.consume(L),T):N(L)}function C(L){return L===null||L===62?K(L):Xe(L)?(l=C,H(L)):(e.consume(L),C)}function A(L){return L===null?n(L):L===63?(e.consume(L),k):Xe(L)?(l=A,H(L)):(e.consume(L),A)}function k(L){return L===62?K(L):A(L)}function R(L){return Rr(L)?(e.consume(L),O):n(L)}function O(L){return L===45||yr(L)?(e.consume(L),O):j(L)}function j(L){return Xe(L)?(l=j,H(L)):pt(L)?(e.consume(L),j):K(L)}function F(L){return L===45||yr(L)?(e.consume(L),F):L===47||L===62||Gt(L)?D(L):n(L)}function D(L){return L===47?(e.consume(L),K):L===58||L===95||Rr(L)?(e.consume(L),M):Xe(L)?(l=D,H(L)):pt(L)?(e.consume(L),D):K(L)}function M(L){return L===45||L===46||L===58||L===95||yr(L)?(e.consume(L),M):q(L)}function q(L){return L===61?(e.consume(L),G):Xe(L)?(l=q,H(L)):pt(L)?(e.consume(L),q):D(L)}function G(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),a=L,ae):Xe(L)?(l=G,H(L)):pt(L)?(e.consume(L),G):(e.consume(L),Q)}function ae(L){return L===a?(e.consume(L),a=void 0,W):L===null?n(L):Xe(L)?(l=ae,H(L)):(e.consume(L),ae)}function Q(L){return L===null||L===34||L===39||L===60||L===61||L===96?n(L):L===47||L===62||Gt(L)?D(L):(e.consume(L),Q)}function W(L){return L===47||L===62||Gt(L)?D(L):n(L)}function K(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),t):n(L)}function H(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),$}function $(L){return pt(L)?Tt(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):V(L)}function V(L){return e.enter("htmlTextData"),l(L)}}const P1={name:"labelEnd",resolveAll:Q$,resolveTo:Z$,tokenize:J$},V$={tokenize:eY},W$={tokenize:tY},X$={tokenize:nY};function Q$(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&pa(e,0,e.length,n),e}function Z$(e,t){let n=e.length,r=0,a,s,l,u;for(;n--;)if(a=e[n][1],s){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(s=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(l=n);const d={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[s][1].start},end:{...e[l][1].end}},m={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[l-2][1].start}};return u=[["enter",d,t],["enter",f,t]],u=Oa(u,e.slice(s+1,s+r+3)),u=Oa(u,[["enter",m,t]]),u=Oa(u,v0(t.parser.constructs.insideSpan.null,e.slice(s+r+4,l-3),t)),u=Oa(u,[["exit",m,t],e[l-2],e[l-1],["exit",f,t]]),u=Oa(u,e.slice(l+1)),u=Oa(u,[["exit",d,t]]),pa(e,s,e.length,u),e}function J$(e,t,n){const r=this;let a=r.events.length,s,l;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){s=r.events[a][1];break}return u;function u(b){return s?s._inactive?p(b):(l=r.parser.defined.includes(Qa(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),d):n(b)}function d(b){return b===40?e.attempt(V$,m,l?m:p)(b):b===91?e.attempt(W$,m,l?f:p)(b):l?m(b):p(b)}function f(b){return e.attempt(X$,m,p)(b)}function m(b){return t(b)}function p(b){return s._balanced=!0,n(b)}}function eY(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),a}function a(p){return Gt(p)?Ud(e,s)(p):s(p)}function s(p){return p===41?m(p):BI(e,l,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function l(p){return Gt(p)?Ud(e,d)(p):m(p)}function u(p){return n(p)}function d(p){return p===34||p===39||p===40?zI(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function f(p){return Gt(p)?Ud(e,m)(p):m(p)}function m(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function tY(e,t,n){const r=this;return a;function a(u){return UI.call(r,e,s,l,"reference","referenceMarker","referenceString")(u)}function s(u){return r.parser.defined.includes(Qa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function l(u){return n(u)}}function nY(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),a}function a(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const rY={name:"labelStartImage",resolveAll:P1.resolveAll,tokenize:aY};function aY(e,t,n){const r=this;return a;function a(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),s}function s(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),l):n(u)}function l(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const iY={name:"labelStartLink",resolveAll:P1.resolveAll,tokenize:sY};function sY(e,t,n){const r=this;return a;function a(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),s}function s(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Bx={name:"lineEnding",tokenize:lY};function lY(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Tt(e,t,"linePrefix")}}const qm={name:"thematicBreak",tokenize:oY};function oY(e,t,n){let r=0,a;return s;function s(f){return e.enter("thematicBreak"),l(f)}function l(f){return a=f,u(f)}function u(f){return f===a?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||Xe(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===a?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),pt(f)?Tt(e,u,"whitespace")(f):u(f))}}const Gr={continuation:{tokenize:fY},exit:mY,name:"list",tokenize:dY},uY={partial:!0,tokenize:pY},cY={partial:!0,tokenize:hY};function dY(e,t,n){const r=this,a=r.events[r.events.length-1];let s=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,l=0;return u;function u(x){const E=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(E==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:rv(x)){if(r.containerState.type||(r.containerState.type=E,e.enter(E,{_container:!0})),E==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(qm,n,f)(x):f(x);if(!r.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(x)}return n(x)}function d(x){return rv(x)&&++l<10?(e.consume(x),d):(!r.interrupt||l<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),f(x)):n(x)}function f(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,e.check(kf,r.interrupt?n:m,e.attempt(uY,b,p))}function m(x){return r.containerState.initialBlankLine=!0,s++,b(x)}function p(x){return pt(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),b):n(x)}function b(x){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function fY(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(kf,a,s);function a(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Tt(e,t,"listItemIndent",r.containerState.size+1)(u)}function s(u){return r.containerState.furtherBlankLines||!pt(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(cY,t,l)(u))}function l(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,Tt(e,e.attempt(Gr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function hY(e,t,n){const r=this;return Tt(e,a,"listItemIndent",r.containerState.size+1);function a(s){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(s):n(s)}}function mY(e){e.exit(this.containerState.type)}function pY(e,t,n){const r=this;return Tt(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(s){const l=r.events[r.events.length-1];return!pt(s)&&l&&l[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const N2={name:"setextUnderline",resolveTo:gY,tokenize:bY};function gY(e,t){let n=e.length,r,a,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",s?(e.splice(a,0,["enter",l,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function bY(e,t,n){const r=this;let a;return s;function s(f){let m=r.events.length,p;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){p=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),a=f,l(f)):n(f)}function l(f){return e.enter("setextHeadingLineSequence"),u(f)}function u(f){return f===a?(e.consume(f),u):(e.exit("setextHeadingLineSequence"),pt(f)?Tt(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||Xe(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const xY={tokenize:yY};function yY(e){const t=this,n=e.attempt(kf,r,e.attempt(this.parser.constructs.flowInitial,a,Tt(e,e.attempt(this.parser.constructs.flow,a,e.attempt(T$,a)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const vY={resolveAll:HI()},EY=FI("string"),NY=FI("text");function FI(e){return{resolveAll:HI(e==="text"?_Y:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],s=n.attempt(a,l,u);return l;function l(m){return f(m)?s(m):u(m)}function u(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),d}function d(m){return f(m)?(n.exit("data"),s(m)):(n.consume(m),d)}function f(m){if(m===null)return!0;const p=a[m];let b=-1;if(p)for(;++b<p.length;){const x=p[b];if(!x.previous||x.previous.call(r,r.previous))return!0}return!1}}}function HI(e){return t;function t(n,r){let a=-1,s;for(;++a<=n.length;)s===void 0?n[a]&&n[a][1].type==="data"&&(s=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==s+2&&(n[s][1].end=n[a-1][1].end,n.splice(s+2,a-s-2),a=s+2),s=void 0);return e?e(n,r):n}}function _Y(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let s=a.length,l=-1,u=0,d;for(;s--;){const f=a[s];if(typeof f=="string"){for(l=f.length;f.charCodeAt(l-1)===32;)u++,l--;if(l)break;l=-1}else if(f===-2)d=!0,u++;else if(f!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const f={type:n===e.length||d||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?l:r.start._bufferIndex+l,_index:r.start._index+s,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const TY={42:Gr,43:Gr,45:Gr,48:Gr,49:Gr,50:Gr,51:Gr,52:Gr,53:Gr,54:Gr,55:Gr,56:Gr,57:Gr,62:jI},SY={91:k$},wY={[-2]:Px,[-1]:Px,32:Px},AY={35:D$,42:qm,45:[N2,qm],60:U$,61:N2,95:qm,96:v2,126:v2},CY={38:LI,92:DI},kY={[-5]:Bx,[-4]:Bx,[-3]:Bx,33:rY,38:LI,42:av,60:[i$,G$],91:iY,92:[M$,DI],93:P1,95:av,96:x$},OY={null:[av,vY]},IY={null:[42,95]},RY={null:[]},MY=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:IY,contentInitial:SY,disable:RY,document:TY,flow:AY,flowInitial:wY,insideSpan:OY,string:CY,text:kY},Symbol.toStringTag,{value:"Module"}));function jY(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},s=[];let l=[],u=[];const d={attempt:j(R),check:j(O),consume:C,enter:A,exit:k,interrupt:j(O,{interrupt:!0})},f={code:null,containerState:{},defineSkip:N,events:[],now:E,parser:e,previous:null,sliceSerialize:b,sliceStream:x,write:p};let m=t.tokenize.call(f,d);return t.resolveAll&&s.push(t),f;function p(q){return l=Oa(l,q),w(),l[l.length-1]!==null?[]:(F(t,0),f.events=v0(s,f.events,f),f.events)}function b(q,G){return LY(x(q),G)}function x(q){return DY(l,q)}function E(){const{_bufferIndex:q,_index:G,line:ae,column:Q,offset:W}=r;return{_bufferIndex:q,_index:G,line:ae,column:Q,offset:W}}function N(q){a[q.line]=q.column,M()}function w(){let q;for(;r._index<l.length;){const G=l[r._index];if(typeof G=="string")for(q=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===q&&r._bufferIndex<G.length;)T(G.charCodeAt(r._bufferIndex));else T(G)}}function T(q){m=m(q)}function C(q){Xe(q)?(r.line++,r.column=1,r.offset+=q===-3?2:1,M()):q!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=q}function A(q,G){const ae=G||{};return ae.type=q,ae.start=E(),f.events.push(["enter",ae,f]),u.push(ae),ae}function k(q){const G=u.pop();return G.end=E(),f.events.push(["exit",G,f]),G}function R(q,G){F(q,G.from)}function O(q,G){G.restore()}function j(q,G){return ae;function ae(Q,W,K){let H,$,V,L;return Array.isArray(Q)?ee(Q):"tokenize"in Q?ee([Q]):P(Q);function P(z){return fe;function fe(Oe){const pe=Oe!==null&&z[Oe],Me=Oe!==null&&z.null,De=[...Array.isArray(pe)?pe:pe?[pe]:[],...Array.isArray(Me)?Me:Me?[Me]:[]];return ee(De)(Oe)}}function ee(z){return H=z,$=0,z.length===0?K:B(z[$])}function B(z){return fe;function fe(Oe){return L=D(),V=z,z.partial||(f.currentConstruct=z),z.name&&f.parser.constructs.disable.null.includes(z.name)?le():z.tokenize.call(G?Object.assign(Object.create(f),G):f,d,me,le)(Oe)}}function me(z){return q(V,L),W}function le(z){return L.restore(),++$<H.length?B(H[$]):K}}}function F(q,G){q.resolveAll&&!s.includes(q)&&s.push(q),q.resolve&&pa(f.events,G,f.events.length-G,q.resolve(f.events.slice(G),f)),q.resolveTo&&(f.events=q.resolveTo(f.events,f))}function D(){const q=E(),G=f.previous,ae=f.currentConstruct,Q=f.events.length,W=Array.from(u);return{from:Q,restore:K};function K(){r=q,f.previous=G,f.currentConstruct=ae,f.events.length=Q,u=W,M()}}function M(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function DY(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,s=t.end._bufferIndex;let l;if(n===a)l=[e[n].slice(r,s)];else{if(l=e.slice(n,a),r>-1){const u=l[0];typeof u=="string"?l[0]=u.slice(r):l.shift()}s>0&&l.push(e[a].slice(0,s))}return l}function LY(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const s=e[n];let l;if(typeof s=="string")l=s;else switch(s){case-5:{l="\r";break}case-4:{l=`
|
|
@@ -525,7 +525,7 @@ Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}
|
|
|
525
525
|
`))}function d(x,E,N,w){const T=N.enter("tableCell"),C=N.enter("phrasing"),A=N.containerPhrasing(x,{...w,before:s,after:s});return C(),T(),A}function f(x,E){return QG(x,{align:E,alignDelimiters:r,padding:n,stringLength:a})}function m(x,E,N){const w=x.children;let T=-1;const C=[],A=E.enter("table");for(;++T<w.length;)C[T]=p(w[T],E,N);return A(),C}function p(x,E,N){const w=x.children;let T=-1;const C=[],A=E.enter("tableRow");for(;++T<w.length;)C[T]=d(w[T],x,E,N);return A(),C}function b(x,E,N){let w=pR.inlineCode(x,E,N);return N.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function BK(){return{exit:{taskListCheckValueChecked:G2,taskListCheckValueUnchecked:G2,paragraph:zK}}}function UK(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:FK}}}function G2(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function zK(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const a=t.children;let s=-1,l;for(;++s<a.length;){const u=a[s];if(u.type==="paragraph"){l=u;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function FK(e,t,n,r){const a=e.children[0],s=typeof e.checked=="boolean"&&a&&a.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);s&&u.move(l);let d=pR.listItem(e,t,n,{...r,...u.current()});return s&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),d;function f(m){return m+l}}function HK(){return[vG(),FG(),qG(),IK(),BK()]}function $K(e){return{extensions:[EG(),HG(e),GG(),PK(e),UK()]}}const YK={tokenize:XK,partial:!0},gR={tokenize:QK,partial:!0},bR={tokenize:ZK,partial:!0},xR={tokenize:JK,partial:!0},qK={tokenize:eV,partial:!0},yR={name:"wwwAutolink",tokenize:VK,previous:ER},vR={name:"protocolAutolink",tokenize:WK,previous:NR},hs={name:"emailAutolink",tokenize:KK,previous:_R},ki={};function GK(){return{text:ki}}let Ll=48;for(;Ll<123;)ki[Ll]=hs,Ll++,Ll===58?Ll=65:Ll===91&&(Ll=97);ki[43]=hs;ki[45]=hs;ki[46]=hs;ki[95]=hs;ki[72]=[hs,vR];ki[104]=[hs,vR];ki[87]=[hs,yR];ki[119]=[hs,yR];function KK(e,t,n){const r=this;let a,s;return l;function l(p){return!uv(p)||!_R.call(r,r.previous)||q1(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(p))}function u(p){return uv(p)?(e.consume(p),u):p===64?(e.consume(p),d):n(p)}function d(p){return p===46?e.check(qK,m,f)(p):p===45||p===95||yr(p)?(s=!0,e.consume(p),d):m(p)}function f(p){return e.consume(p),a=!0,d}function m(p){return s&&a&&Rr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function VK(e,t,n){const r=this;return a;function a(l){return l!==87&&l!==119||!ER.call(r,r.previous)||q1(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(YK,e.attempt(gR,e.attempt(bR,s),n),n)(l))}function s(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function WK(e,t,n){const r=this;let a="",s=!1;return l;function l(p){return(p===72||p===104)&&NR.call(r,r.previous)&&!q1(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(p),e.consume(p),u):n(p)}function u(p){if(Rr(p)&&a.length<5)return a+=String.fromCodePoint(p),e.consume(p),u;if(p===58){const b=a.toLowerCase();if(b==="http"||b==="https")return e.consume(p),d}return n(p)}function d(p){return p===47?(e.consume(p),s?f:(s=!0,d)):n(p)}function f(p){return p===null||lp(p)||Gt(p)||co(p)||y0(p)?n(p):e.attempt(gR,e.attempt(bR,m),n)(p)}function m(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function XK(e,t,n){let r=0;return a;function a(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),a):l===46&&r===3?(e.consume(l),s):n(l)}function s(l){return l===null?n(l):t(l)}}function QK(e,t,n){let r,a,s;return l;function l(f){return f===46||f===95?e.check(xR,d,u)(f):f===null||Gt(f)||co(f)||f!==45&&y0(f)?d(f):(s=!0,e.consume(f),l)}function u(f){return f===95?r=!0:(a=r,r=void 0),e.consume(f),l}function d(f){return a||r||!s?n(f):t(f)}}function ZK(e,t){let n=0,r=0;return a;function a(l){return l===40?(n++,e.consume(l),a):l===41&&r<n?s(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(xR,t,s)(l):l===null||Gt(l)||co(l)?t(l):(e.consume(l),a)}function s(l){return l===41&&r++,e.consume(l),a}}function JK(e,t,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),r):u===38?(e.consume(u),s):u===93?(e.consume(u),a):u===60||u===null||Gt(u)||co(u)?t(u):n(u)}function a(u){return u===null||u===40||u===91||Gt(u)||co(u)?t(u):r(u)}function s(u){return Rr(u)?l(u):n(u)}function l(u){return u===59?(e.consume(u),r):Rr(u)?(e.consume(u),l):n(u)}}function eV(e,t,n){return r;function r(s){return e.consume(s),a}function a(s){return yr(s)?n(s):t(s)}}function ER(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Gt(e)}function NR(e){return!Rr(e)}function _R(e){return!(e===47||uv(e))}function uv(e){return e===43||e===45||e===46||e===95||yr(e)}function q1(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const tV={tokenize:uV,partial:!0};function nV(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:sV,continuation:{tokenize:lV},exit:oV}},text:{91:{name:"gfmFootnoteCall",tokenize:iV},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:rV,resolveTo:aV}}}}function rV(e,t,n){const r=this;let a=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;a--;){const d=r.events[a][1];if(d.type==="labelImage"){l=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return u;function u(d){if(!l||!l._balanced)return n(d);const f=Qa(r.sliceSerialize({start:l.end,end:r.now()}));return f.codePointAt(0)!==94||!s.includes(f.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function aV(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",s,t],["enter",l,t],["exit",l,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function iV(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,l;return u;function u(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),d}function d(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(p){if(s>999||p===93&&!l||p===null||p===91||Gt(p))return n(p);if(p===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return a.includes(Qa(r.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return Gt(p)||(l=!0),s++,e.consume(p),p===92?m:f}function m(p){return p===91||p===92||p===93?(e.consume(p),s++,f):f(p)}}function sV(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,l=0,u;return d;function d(E){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(E){return E===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(E)}function m(E){if(l>999||E===93&&!u||E===null||E===91||Gt(E))return n(E);if(E===93){e.exit("chunkString");const N=e.exit("gfmFootnoteDefinitionLabelString");return s=Qa(r.sliceSerialize(N)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return Gt(E)||(u=!0),l++,e.consume(E),E===92?p:m}function p(E){return E===91||E===92||E===93?(e.consume(E),l++,m):m(E)}function b(E){return E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),a.includes(s)||a.push(s),Tt(e,x,"gfmFootnoteDefinitionWhitespace")):n(E)}function x(E){return t(E)}}function lV(e,t,n){return e.check(kf,t,e.attempt(tV,t,n))}function oV(e){e.exit("gfmFootnoteDefinition")}function uV(e,t,n){const r=this;return Tt(e,a,"gfmFootnoteDefinitionIndent",5);function a(s){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(s):n(s)}}function cV(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(l,u){let d=-1;for(;++d<l.length;)if(l[d][0]==="enter"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._close){let f=d;for(;f--;)if(l[f][0]==="exit"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._open&&l[d][1].end.offset-l[d][1].start.offset===l[f][1].end.offset-l[f][1].start.offset){l[d][1].type="strikethroughSequence",l[f][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[f][1].start),end:Object.assign({},l[d][1].end)},p={type:"strikethroughText",start:Object.assign({},l[f][1].end),end:Object.assign({},l[d][1].start)},b=[["enter",m,u],["enter",l[f][1],u],["exit",l[f][1],u],["enter",p,u]],x=u.parser.constructs.insideSpan.null;x&&pa(b,b.length,0,v0(x,l.slice(f+1,d),u)),pa(b,b.length,0,[["exit",p,u],["enter",l[d][1],u],["exit",l[d][1],u],["exit",m,u]]),pa(l,f-1,d-f+3,b),d=f+b.length-2;break}}for(d=-1;++d<l.length;)l[d][1].type==="strikethroughSequenceTemporary"&&(l[d][1].type="data");return l}function s(l,u,d){const f=this.previous,m=this.events;let p=0;return b;function b(E){return f===126&&m[m.length-1][1].type!=="characterEscape"?d(E):(l.enter("strikethroughSequenceTemporary"),x(E))}function x(E){const N=Pu(f);if(E===126)return p>1?d(E):(l.consume(E),p++,x);if(p<2&&!n)return d(E);const w=l.exit("strikethroughSequenceTemporary"),T=Pu(E);return w._open=!T||T===2&&!!N,w._close=!N||N===2&&!!T,u(E)}}}class dV{constructor(){this.map=[]}add(t,n,r){fV(this,t,n,r)}consume(t){if(this.map.sort(function(s,l){return s[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(const s of a)t.push(s);a=r.pop()}this.map.length=0}}function fV(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function hV(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function mV(){return{flow:{null:{name:"table",tokenize:pV,resolveAll:gV}}}}function pV(e,t,n){const r=this;let a=0,s=0,l;return u;function u(M){let q=r.events.length-1;for(;q>-1;){const Q=r.events[q][1].type;if(Q==="lineEnding"||Q==="linePrefix")q--;else break}const G=q>-1?r.events[q][1].type:null,ae=G==="tableHead"||G==="tableRow"?O:d;return ae===O&&r.parser.lazy[r.now().line]?n(M):ae(M)}function d(M){return e.enter("tableHead"),e.enter("tableRow"),f(M)}function f(M){return M===124||(l=!0,s+=1),m(M)}function m(M){return M===null?n(M):Xe(M)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),x):n(M):pt(M)?Tt(e,m,"whitespace")(M):(s+=1,l&&(l=!1,a+=1),M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),l=!0,m):(e.enter("data"),p(M)))}function p(M){return M===null||M===124||Gt(M)?(e.exit("data"),m(M)):(e.consume(M),M===92?b:p)}function b(M){return M===92||M===124?(e.consume(M),p):p(M)}function x(M){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(M):(e.enter("tableDelimiterRow"),l=!1,pt(M)?Tt(e,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):E(M))}function E(M){return M===45||M===58?w(M):M===124?(l=!0,e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),N):R(M)}function N(M){return pt(M)?Tt(e,w,"whitespace")(M):w(M)}function w(M){return M===58?(s+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),T):M===45?(s+=1,T(M)):M===null||Xe(M)?k(M):R(M)}function T(M){return M===45?(e.enter("tableDelimiterFiller"),C(M)):R(M)}function C(M){return M===45?(e.consume(M),C):M===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),A):(e.exit("tableDelimiterFiller"),A(M))}function A(M){return pt(M)?Tt(e,k,"whitespace")(M):k(M)}function k(M){return M===124?E(M):M===null||Xe(M)?!l||a!==s?R(M):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(M)):R(M)}function R(M){return n(M)}function O(M){return e.enter("tableRow"),j(M)}function j(M){return M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),j):M===null||Xe(M)?(e.exit("tableRow"),t(M)):pt(M)?Tt(e,j,"whitespace")(M):(e.enter("data"),F(M))}function F(M){return M===null||M===124||Gt(M)?(e.exit("data"),j(M)):(e.consume(M),M===92?D:F)}function D(M){return M===92||M===124?(e.consume(M),F):F(M)}}function gV(e,t){let n=-1,r=!0,a=0,s=[0,0,0,0],l=[0,0,0,0],u=!1,d=0,f,m,p;const b=new dV;for(;++n<e.length;){const x=e[n],E=x[1];x[0]==="enter"?E.type==="tableHead"?(u=!1,d!==0&&(K2(b,t,d,f,m),m=void 0,d=0),f={type:"table",start:Object.assign({},E.start),end:Object.assign({},E.end)},b.add(n,0,[["enter",f,t]])):E.type==="tableRow"||E.type==="tableDelimiterRow"?(r=!0,p=void 0,s=[0,0,0,0],l=[0,n+1,0,0],u&&(u=!1,m={type:"tableBody",start:Object.assign({},E.start),end:Object.assign({},E.end)},b.add(n,0,[["enter",m,t]])),a=E.type==="tableDelimiterRow"?2:m?3:1):a&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(s[1]!==0&&(l[0]=l[1],p=xm(b,t,s,a,void 0,p),s=[0,0,0,0]),l[2]=n)):E.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(l[0]=l[1],p=xm(b,t,s,a,void 0,p)),s=l,l=[s[1],n,0,0])):E.type==="tableHead"?(u=!0,d=n):E.type==="tableRow"||E.type==="tableDelimiterRow"?(d=n,s[1]!==0?(l[0]=l[1],p=xm(b,t,s,a,n,p)):l[1]!==0&&(p=xm(b,t,l,a,n,p)),a=0):a&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")&&(l[3]=n)}for(d!==0&&K2(b,t,d,f,m),b.consume(t.events),n=-1;++n<t.events.length;){const x=t.events[n];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=hV(t.events,n))}return e}function xm(e,t,n,r,a,s){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(s.end=Object.assign({},Su(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const d=Su(t.events,n[1]);if(s={type:l,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const f=Su(t.events,n[2]),m=Su(t.events,n[3]),p={type:u,start:Object.assign({},f),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",p,t]]),r!==2){const b=t.events[n[2]],x=t.events[n[3]];if(b[1].end=Object.assign({},x[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const E=n[2]+1,N=n[3]-n[2]-1;e.add(E,N,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return a!==void 0&&(s.end=Object.assign({},Su(t.events,a)),e.add(a,0,[["exit",s,t]]),s=void 0),s}function K2(e,t,n,r,a){const s=[],l=Su(t.events,n);a&&(a.end=Object.assign({},l),s.push(["exit",a,t])),r.end=Object.assign({},l),s.push(["exit",r,t]),e.add(n+1,0,s)}function Su(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const bV={name:"tasklistCheck",tokenize:yV};function xV(){return{text:{91:bV}}}function yV(e,t,n){const r=this;return a;function a(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),s)}function s(d){return Gt(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),l):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),l):n(d)}function l(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(d)}function u(d){return Xe(d)?t(d):pt(d)?e.check({tokenize:vV},t,n)(d):n(d)}}function vV(e,t,n){return Tt(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function EV(e){return RI([GK(),nV(),cV(e),mV(),xV()])}const NV={};function ho(e){const t=this,n=e||NV,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(EV(n)),s.push(HK()),l.push($K(n))}const _V=new Set(["tool","tool-use","tool_use","tool-call","tool_call","tool-result","tool_result"]),TV=new Set(["thinking","reasoning","reason"]),SV=new Set(["text","output_text","message"]),wV=new Set(["file","image"]);function cp(e){var n;const t=((n=e.type)==null?void 0:n.toLowerCase())??"";return _V.has(t)||e.toolName!=null||e.tool!=null?"tool":wV.has(t)?"file":TV.has(t)?"thinking":SV.has(t)||e.content!=null||e.text!=null?"text":"other"}function dp(e){return e.content??e.text??""}function TR(e){return e.toolName??e.tool??"tool"}function _0(e){var t;return e.input??((t=e.state)==null?void 0:t.input)}function G1(e){var t;return e.output??((t=e.state)==null?void 0:t.output)}function K1(e){var n,r,a;const t=(r=(n=e.state)==null?void 0:n.status)==null?void 0:r.toLowerCase();return t==="completed"||t==="done"||t==="success"?"completed":t==="error"||t==="failed"||((a=e.state)==null?void 0:a.error)!=null?"error":t==="pending"||t==="queued"?"pending":t==="running"||t==="in_progress"?"running":G1(e)!=null?"completed":"running"}function V2(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function mo(e){const t=e==null?void 0:e.toLowerCase();return t==="in_progress"||t==="in-progress"||t==="active"?"in_progress":t==="completed"||t==="done"||t==="complete"?"completed":t==="cancelled"||t==="canceled"?"cancelled":"pending"}function SR(e){return e.filter(t=>mo(t.status)==="completed").length}function rf(e){const t=TR(e).toLowerCase();return t==="question"||t==="mcp_question"}function AV(e){const t=_0(e);if(!t||typeof t!="object")return null;const n=t;return Array.isArray(n.questions)?n.questions:null}function fp(e){if(!rf(e))return!1;const t=K1(e);return t==="pending"||t==="running"}const CV=/\bses_[a-zA-Z0-9]+/;function kV(e){var a;const t=_0(e);if(t&&typeof t=="object"){const s=t;if(typeof s.task_id=="string"&&s.task_id.startsWith("ses_"))return s.task_id}const n=(a=e.state)==null?void 0:a.metadata;if(n){const s=n.session_id??n.sessionId;if(typeof s=="string"&&s.startsWith("ses_"))return s}const r=G1(e);if(typeof r=="string"){const s=CV.exec(r);if(s)return s[0]}if(r&&typeof r=="object"){const s=r,l=s.session_id??s.sessionId??s.task_id;if(typeof l=="string"&&l.startsWith("ses_"))return l}return null}const OV=ei(()=>({agents:[],loaded:!1}));function wR(e){return`question-${e}`}function Qx(e,t){const n=t.find(a=>a.id===e),r=(n==null?void 0:n.title)||e.slice(-8);bn.getState().addToast(`${r} — 等待回复`,"warning",e,{id:wR(e),persistent:!0})}function IV(e){var t;for(const n of e)if((t=n.parts)!=null&&t.some(r=>rf(r)&&fp(r)))return!0;return!1}const af=[],sf=[],W2=[],Pl={};function X2(e){return e.id??e.callID}function pr(){return Fe.getState().activeRepoId}async function Q2(e,t){const n=pr();if(n)try{const[r,a]=await Promise.all([Qz(n,e),rI(n).catch(()=>null)]);t(s=>{const l={sessionLinks:{...s.sessionLinks,[e]:r}};return a&&(l.allSessionLinks=a),l})}catch{}}const Z2=20,Le=ei((e,t)=>({sessions:[],activeSessionId:null,messages:{},messagesMeta:{},todos:{},sessionStatuses:{},errorReasons:{},queuedMessageIds:{},sessionLinks:{},allSessionLinks:{},sessionFilter:"active",loadingSessions:!1,loadError:null,sendError:null,setSessionFilter:n=>e({sessionFilter:n}),toggleSessionComplete:async n=>{const r=pr();if(!r)return;const a=t().sessions.find(l=>l.id===n);if(!a)return;const s=a.completedAt?null:Date.now();e(l=>({sessions:l.sessions.map(u=>u.id===n?{...u,completedAt:s??void 0}:u)}));try{await AF(r,n,s)}catch{await t().loadSessions()}},loadSessions:async()=>{const n=pr();if(!n){e({sessions:[],loadingSessions:!1});return}e({loadingSessions:!0,loadError:null});try{const[r,a]=await Promise.all([Hz(n),rI(n).catch(()=>null)]),s={sessions:r,loadingSessions:!1};a&&(s.allSessionLinks=a),e(s)}catch(r){e({loadingSessions:!1,loadError:r instanceof Error?r.message:"Failed to load sessions"})}},createSession:async(n,r,a,s,l,u,d)=>{const f=pr();if(!f)return null;e({sendError:null});try{const m=await $z(f,n,r,a,s,l,u,d);return e(p=>({sessions:[m,...p.sessions.filter(b=>b.id!==m.id)],activeSessionId:m.id,messages:{...p.messages,[m.id]:[]}})),t().setSessionStatus(m.id,"busy"),l&&bn.getState().addToast("已自动分配为处理人","success"),m}catch(m){return e({sendError:m instanceof Error?m.message:"Failed to create session"}),null}},setActiveSession:async n=>{pr()&&(e({activeSessionId:n,sendError:null}),await t().refreshSessionData(n))},refreshSessionData:async n=>{var m,p;const r=pr();if(!r)return;const s=!t().messages[n]||t().messages[n].length===0?{limit:Z2}:void 0,[l,u]=await Promise.allSettled([Zz(r,n),Hw(r,n,s)]),d=l.status==="fulfilled"?l.value:null,f=(p=(m=d==null?void 0:d.session)==null?void 0:m.revert)==null?void 0:p.messageID;e(b=>{const x={};if(d&&(d.status&&(x.sessionStatuses={...b.sessionStatuses,[n]:d.status.type}),d.todos&&(x.todos={...b.todos,[n]:d.todos}),d.links&&(x.sessionLinks={...b.sessionLinks,[n]:d.links}),d.session&&(x.sessions=b.sessions.map(E=>E.id===n?{...E,...d.session}:E))),u.status==="fulfilled"){let E=u.value.messages;if(f){const w=E.findIndex(T=>T.id===f);w>=0&&(E=E.slice(0,w+1))}const N=b.messages[n]??[];E.length>=N.length&&(x.messages={...b.messages,[n]:E}),x.messagesMeta={...b.messagesMeta,[n]:{total:Math.max(u.value.total,N.length),hasMore:u.value.hasMore,loading:!1}}}return x}),u.status==="fulfilled"&&IV(u.value.messages)&&Qx(n,t().sessions)},loadMoreMessages:async n=>{var u;const r=pr();if(!r)return;const a=t().messagesMeta[n];if(!(a!=null&&a.hasMore)||a.loading)return;const l=(u=(t().messages[n]??[])[0])==null?void 0:u.id;e(d=>({messagesMeta:{...d.messagesMeta,[n]:{...a,loading:!0}}}));try{const d=await Hw(r,n,{limit:Z2,before:l});e(f=>{const m=f.messages[n]??[];return{messages:{...f.messages,[n]:[...d.messages,...m]},messagesMeta:{...f.messagesMeta,[n]:{total:d.total,hasMore:d.hasMore,loading:!1}}}})}catch{e(d=>({messagesMeta:{...d.messagesMeta,[n]:{...a,loading:!1}}}))}},addLink:async(n,r,a)=>{const s=pr();if(!s)return!1;try{return await Jz(s,n,r,a),await Q2(n,e),!0}catch{return!1}},removeLink:async(n,r,a)=>{const s=pr();if(!s)return!1;try{return await eF(s,n,r,a),await Q2(n,e),!0}catch{return!1}},deleteSession:async n=>{const r=pr();if(r)try{await Yz(r,n)}catch{}delete Pl[n],e(a=>{const{[n]:s,...l}=a.messages,{[n]:u,...d}=a.messagesMeta,{[n]:f,...m}=a.todos,{[n]:p,...b}=a.sessionStatuses,{[n]:x,...E}=a.errorReasons,{[n]:N,...w}=a.queuedMessageIds,{[n]:T,...C}=a.sessionLinks,{[n]:A,...k}=a.allSessionLinks;return{sessions:a.sessions.filter(R=>R.id!==n),messages:l,messagesMeta:d,todos:m,sessionStatuses:b,errorReasons:E,queuedMessageIds:w,sessionLinks:C,allSessionLinks:k,activeSessionId:a.activeSessionId===n?null:a.activeSessionId}})},sendMessage:async(n,r,a,s)=>{const l=pr(),u=t().activeSessionId;if(!l||!u)return!1;const d=t().sessions.find(m=>m.id===u),f=t().sessionStatuses[u]==="busy";e({sendError:null}),d!=null&&d.completedAt&&e(m=>({sessions:m.sessions.map(p=>p.id===u?{...p,completedAt:void 0}:p)})),f||t().setSessionStatus(u,"busy");try{const m=OV.getState(),p=d!=null&&d.agent&&m.loaded&&m.agents.some(b=>b.name===d.agent||b.id===d.agent)?d.agent:void 0;return await qz(l,u,n,p,r,a,s),f&&(Pl[u]=(Pl[u]||0)+1),!0}catch(m){return e({sendError:m instanceof Error?m.message:"Failed to send message"}),f||t().setSessionStatus(u,"idle"),!1}},replyQuestion:async n=>{const r=pr(),a=t().activeSessionId;if(!(!r||!a))try{await Kz(r,a,n)}catch(s){e({sendError:s instanceof Error?s.message:"Failed to reply to question"})}},rejectQuestion:async()=>{const n=pr(),r=t().activeSessionId;if(!(!n||!r))try{await Vz(n,r)}catch{}},abortSession:async()=>{const n=pr(),r=t().activeSessionId;if(!(!n||!r)){try{await Gz(n,r)}catch{}t().setSessionStatus(r,"idle")}},clearSessions:()=>{for(const n of Object.keys(Pl))delete Pl[n];e({sessions:[],activeSessionId:null,messages:{},messagesMeta:{},todos:{},sessionStatuses:{},errorReasons:{},queuedMessageIds:{},sessionLinks:{},allSessionLinks:{},loadError:null,sendError:null})},updateMessage:(n,r)=>{var a;e(s=>{const l=s.messages[n]??[],u=l.findIndex(p=>p.id===r.id);let d,f=s.queuedMessageIds,m=s.messagesMeta;if(u>=0){const p={...l[u],...r};(!r.parts||r.parts.length===0)&&l[u].parts&&(p.parts=l[u].parts),d=[...l],d[u]=p}else{d=[...l,r];const p=m[n];p&&(m={...m,[n]:{...p,total:p.total+1}});const b=Pl[n]||0;if(r.role==="user"&&b>0){const x=[...f[n]??[]];x.push(r.id),f={...f,[n]:x},Pl[n]=b-1}else if(r.role==="assistant"){const x=f[n];x&&x.length>0&&(f={...f,[n]:x.slice(1)})}}return{messages:{...s.messages,[n]:d},messagesMeta:m,queuedMessageIds:f}}),(a=r.parts)!=null&&a.some(s=>rf(s)&&fp(s))&&Qx(n,t().sessions)},updateMessagePart:(n,r,a)=>{e(s=>{const l=s.messages[n]??[],u=l.findIndex(E=>E.id===r),d=u>=0?l[u]:{id:r,role:"assistant"},f=d.parts?[...d.parts]:[],m=X2(a),p=m!=null?f.findIndex(E=>X2(E)===m):-1;p>=0?f[p]={...f[p],...a}:f.push(a);const b={...d,parts:f},x=u>=0?[...l]:[...l,b];return u>=0&&(x[u]=b),{messages:{...s.messages,[n]:x}}}),rf(a)&&fp(a)&&Qx(n,t().sessions)},appendMessagePartDelta:(n,r,a,s)=>{e(l=>{const u=l.messages[n]??[],d=u.findIndex(E=>E.id===r),f=d>=0?u[d]:{id:r,role:"assistant"},m=f.parts?[...f.parts]:[],p=m.findIndex(E=>E.id===a);if(p>=0){const E=m[p],N=dp(E)+s;m[p]=E.content!=null?{...E,content:N}:{...E,text:N}}else m.push({id:a,type:"text",text:s});const b={...f,parts:m},x=d>=0?[...u]:[...u,b];return d>=0&&(x[d]=b),{messages:{...l.messages,[n]:x}}})},updateTodos:(n,r)=>{e(a=>({todos:{...a.todos,[n]:r}}))},updateSessionInfo:n=>{e(r=>r.sessions.some(s=>s.id===n.id)?{sessions:r.sessions.map(s=>s.id===n.id?{...s,...n}:s)}:{sessions:[n,...r.sessions]})},setSessionStatus:(n,r,a)=>{const s=t().sessionStatuses[n];if(s!==r){const l=t().sessions.find(d=>d.id===n),u=(l==null?void 0:l.title)||n.slice(-8);if(r==="idle"&&s!==void 0&&s!=="idle")bn.getState().removeToast(wR(n)),bn.getState().addToast(`${u} — 完成`,"success",n);else if(r==="busy"&&(s===void 0||s==="idle"))bn.getState().addToast(`${u} — 开始运行`,"info",n);else if(r==="retry")bn.getState().addToast(`${u} — 进入重试`,"warning",n);else if(r==="error"){const d=a?`${u} — 错误: ${a}`:`${u} — 发生错误`;bn.getState().addToast(d,"error",n)}}e(l=>{const u=a?{...l.errorReasons,[n]:a}:r!=="error"?(()=>{const{[n]:d,...f}=l.errorReasons;return f})():l.errorReasons;return{sessionStatuses:{...l.sessionStatuses,[n]:r},errorReasons:u}})},bulkSetStatuses:n=>{e({sessionStatuses:{...t().sessionStatuses,...n}})},renameSession:async(n,r)=>{const a=pr();if(a){e(s=>({sessions:s.sessions.map(l=>l.id===n?{...l,title:r}:l)}));try{await wF(a,n,r)}catch{await t().loadSessions()}}},revertToMessage:async(n,r)=>{const a=pr();if(!a)return!1;try{return await Wz(a,n,r),await t().refreshSessionData(n),!0}catch{return!1}}})),at=ei((e,t)=>({issues:[],tags:[],tagFilterMode:new Map,milestones:[],selectedMilestoneId:null,loaded:!1,syncing:!1,selectedIssueId:null,viewingIssueId:null,viewingTreeRootId:null,matchingParentId:null,matchingCandidateId:null,clearIssues:()=>e({issues:[],tags:[],tagFilterMode:new Map,milestones:[],selectedMilestoneId:null,loaded:!1,selectedIssueId:null,viewingIssueId:null,viewingTreeRootId:null,matchingParentId:null,matchingCandidateId:null}),setSelectedIssue:n=>e({selectedIssueId:n}),setViewingIssue:(n,r)=>e({viewingIssueId:n,viewingTreeRootId:r??null}),enterMatchMode:n=>e({matchingParentId:n,matchingCandidateId:null}),exitMatchMode:()=>{e({matchingParentId:null,matchingCandidateId:null})},linkChild:async(n,r)=>{var s;const a=Fe.getState().activeRepoId;if(!a)return!1;try{await mF(a,n,r);const l=(s=t().issues.find(u=>u.number===n))==null?void 0:s.id;return l&&e(u=>({issues:u.issues.map(d=>d.number===r?{...d,parentId:l}:d),matchingCandidateId:null})),!0}catch{return!1}},updateIssueState:async(n,r)=>{const a=Fe.getState().activeRepoId;if(!a)return!1;try{const s=await uI(a,n,{state:r});return e(l=>({issues:l.issues.map(u=>u.number===n?{...u,state:s.state}:u)})),!0}catch{return!1}},loadIssues:async()=>{const n=Fe.getState().activeRepoId;if(!n){e({issues:[],loaded:!0});return}try{const r=await Kw(n,"all");e({issues:r,loaded:!0})}catch{e({loaded:!0})}},syncIssues:async()=>{const n=Fe.getState().activeRepoId;if(n){e({syncing:!0});try{await fF(n,"open");const[r,a,s]=await Promise.all([Kw(n,"all"),qw(n),Gw(n)]);e({issues:r,tags:a,milestones:s,syncing:!1})}catch(r){e({syncing:!1});let a="同步 Issue 失败";if(r instanceof ns)try{const s=JSON.parse(r.message);s.error&&(a=s.error)}catch{r.message&&(a=r.message)}bn.getState().addToast(a,"error")}}},createIssue:async(n,r)=>{const a=Fe.getState().activeRepoId;if(!a)return null;try{const s=await hF(a,n,r);return e(l=>({issues:[s,...l.issues]})),s}catch{return null}},loadTags:async()=>{const n=Fe.getState().activeRepoId;if(!n){e({tags:[]});return}try{const r=await qw(n);e({tags:r})}catch{}},cycleTagFilter:n=>{e(r=>{const a=new Map(r.tagFilterMode),s=a.get(n);return s?s==="include"?a.set(n,"exclude"):a.delete(n):a.set(n,"include"),{tagFilterMode:a}})},clearTagFilter:()=>e({tagFilterMode:new Map}),loadMilestones:async()=>{const n=Fe.getState().activeRepoId;if(!n){e({milestones:[]});return}try{const r=await Gw(n);e({milestones:r})}catch{}},setMilestoneFilter:n=>e({selectedMilestoneId:n})})),Gm=ei(e=>({drafts:{},setDraft:(t,n)=>e(r=>{if(!n.trim()){const{[t]:a,...s}=r.drafts;return{drafts:s}}return{drafts:{...r.drafts,[t]:n}}}),clearDraft:t=>e(n=>{const{[t]:r,...a}=n.drafts;return{drafts:a}})})),RV=5*1024*1024,J2=10,AR=["image/png","image/jpeg","image/gif","image/webp"],MV=5,jV=500;let eA=0;function CR(e){return e.split(`
|
|
526
526
|
`).length>MV||e.length>jV}function DV(e){return e<1024?`${e}B`:e<1024*1024?`${(e/1024).toFixed(1)}KB`:`${(e/(1024*1024)).toFixed(1)}MB`}function LV(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>t(String(r.result)),r.onerror=()=>n(r.error),r.readAsDataURL(e)})}function PV({url:e,label:t,onClose:n}){return v.useEffect(()=>{const r=a=>{a.key==="Escape"&&(a.preventDefault(),n())};return window.addEventListener("keydown",r,!0),()=>window.removeEventListener("keydown",r,!0)},[n]),c.jsx("div",{role:"dialog","aria-modal":"true","aria-label":t,onClick:n,className:"fixed inset-0 z-50 flex cursor-zoom-out items-center justify-center bg-black/80 p-8 backdrop-blur-sm",children:c.jsx("img",{src:e,alt:t,className:"max-h-full max-w-full object-contain"})})}function V1({url:e,label:t,className:n}){const[r,a]=v.useState(!1);return c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",onClick:()=>a(!0),"aria-label":`预览 ${t}`,className:"block cursor-zoom-in rounded-md transition-opacity duration-150 hover:opacity-80",children:c.jsx("img",{src:e,alt:t,className:re("rounded-md border border-line",n)})}),r&&c.jsx(PV,{url:e,label:t,onClose:()=>a(!1)})]})}function kR(e=!0){const[t,n]=v.useState([]),[r,a]=v.useState([]),[s,l]=v.useState(null);v.useEffect(()=>{l(null),e||n([])},[e]);const u=async N=>{const w=[],T=[],C=t.length;let A=J2-C;for(const k of N){if(A<=0){T.push(`最多 ${J2} 张图片`);break}if(!AR.includes(k.type)){T.push(`${k.name||"文件"}:格式不支持`);continue}if(k.size>RV){T.push(`${k.name}:超过 5MB`);continue}w.push({_id:`att-${++eA}`,mime:k.type,url:await LV(k),filename:k.name}),A--}w.length>0&&n(k=>[...k,...w]),l(T.length>0?T.join(";"):null)},d=N=>{const w=Array.from(N.clipboardData.files);if(w.length!==0){if(N.preventDefault(),!e){l("当前模型不支持图片");return}u(w)}},f=N=>{const w=++eA,T=N.split(`
|
|
527
527
|
`).length,C=new TextEncoder().encode(N).byteLength,A=`[粘贴文本 #${w} · ${T}行]`,k={_id:`fold-${w}`,text:N,lineCount:T,byteSize:C,placeholder:A};return a(R=>[...R,k]),k},m=N=>{let w=N;for(const T of r)w=w.replace(T.placeholder,T.text);return w},p=N=>n(w=>w.filter(T=>T._id!==N)),b=N=>a(w=>w.filter(T=>T._id!==N)),x=v.useCallback(()=>{n([]),a([]),l(null)},[]),E=t.map(({mime:N,url:w,filename:T})=>({mime:N,url:w,filename:T}));return{attachments:t,foldedTexts:r,promptFiles:E,error:s,setError:l,addFiles:u,onPaste:d,addFoldedText:f,expandFoldedTexts:m,remove:p,removeFoldedText:b,clear:x}}function BV({text:e,label:t,onClose:n}){v.useEffect(()=>{const s=l=>{l.key==="Escape"&&(l.preventDefault(),n())};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[n]);const r=e.split(`
|
|
528
|
-
`),a=String(r.length).length;return c.jsx("div",{role:"dialog","aria-modal":"true","aria-label":t,onClick:n,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-4 backdrop-blur-sm md:p-8",children:c.jsxs("div",{onClick:s=>s.stopPropagation(),className:"flex max-h-full w-full max-w-4xl flex-col overflow-hidden rounded-lg border border-line bg-term",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-line px-4 py-2",children:[c.jsx("span",{className:"font-mono text-xs text-fg-3",children:t}),c.jsx("button",{type:"button",onClick:n,className:"text-fg-5 hover:text-fg-2",children:c.jsx(gt,{className:"h-4 w-4"})})]}),c.jsx("pre",{className:"overflow-auto p-4 font-mono text-xs leading-relaxed text-fg-2",children:r.map((s,l)=>c.jsxs("div",{children:[c.jsx("span",{className:"mr-3 inline-block select-none text-right text-fg-6",style:{width:`${a}ch`},children:l+1}),s]},l))})]})})}function UV({fold:e,index:t,onRemove:n}){const[r,a]=v.useState(!1),s=`粘贴文本 #${t} · ${e.lineCount}行 · ${DV(e.byteSize)}`;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"group relative flex items-center gap-1.5 rounded-md border border-line bg-elevated/50 px-2.5 py-1.5",children:[c.jsxs("button",{type:"button",onClick:()=>a(!0),className:"flex items-center gap-1.5 font-mono text-xs text-fg-3 transition-colors hover:text-fg",children:[c.jsx(ol,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),c.jsx("span",{children:s})]}),c.jsx("button",{type:"button",onClick:n,"aria-label":"移除粘贴文本",className:"flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-fg-5 transition-colors hover:text-fg-2",children:c.jsx(gt,{className:"h-2.5 w-2.5",strokeWidth:2.5})})]}),r&&c.jsx(BV,{text:e.text,label:s,onClose:()=>a(!1)})]})}function OR({onFiles:e,disabled:t,allowed:n}){const r=v.useRef(null);return c.jsxs(c.Fragment,{children:[c.jsx("input",{ref:r,type:"file",accept:AR.join(","),multiple:!0,hidden:!0,onChange:a=>{e(Array.from(a.target.files??[])),a.target.value=""}}),c.jsx("button",{type:"button",onClick:()=>{var a;return(a=r.current)==null?void 0:a.click()},disabled:t||!n,"aria-label":"Attach image",title:n?"附加图片":"当前模型不支持图片",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-fg-5 transition-colors duration-150 hover:text-fg-3 disabled:cursor-not-allowed disabled:text-fg-6/40",children:c.jsx(N7,{className:"h-4 w-4"})})]})}function IR({attachments:e,foldedTexts:t,error:n,onRemove:r,onRemoveFoldedText:a,className:s}){const l=e.length>0||(t??[]).length>0;return!l&&!n?null:c.jsxs("div",{className:s,children:[l&&c.jsxs("div",{className:"mb-2 flex flex-wrap gap-2",children:[e.map(u=>c.jsxs("div",{className:"group relative",children:[c.jsx(V1,{url:u.url,label:u.filename??"attachment",className:"h-16 w-16 object-cover"}),c.jsx("button",{type:"button",onClick:()=>r(u._id),"aria-label":"Remove attachment",className:"absolute -right-1.5 -top-1.5 flex h-4 w-4 items-center justify-center rounded-full border border-line bg-term text-fg-4 opacity-0 transition-opacity duration-150 hover:text-fg-2 group-hover:opacity-100",children:c.jsx(gt,{className:"h-2.5 w-2.5",strokeWidth:2.5})})]},u._id)),(t??[]).map((u,d)=>c.jsx(UV,{fold:u,index:d+1,onRemove:()=>a==null?void 0:a(u._id)},u._id))]}),n&&c.jsx("div",{className:"mb-2 font-mono text-[11px] text-red-400",children:n})]})}function RR({isListening:e,disabled:t,onStart:n,onStop:r}){const a=v.useRef(!1),s=u=>{if(t)return;u.preventDefault(),a.current=!0,n();const d=()=>{document.removeEventListener("touchend",d),document.removeEventListener("touchcancel",d),a.current=!1,r()};document.addEventListener("touchend",d,{once:!0}),document.addEventListener("touchcancel",d,{once:!0})},l=()=>{if(t||a.current)return;n();const u=()=>{document.removeEventListener("mouseup",u),r()};document.addEventListener("mouseup",u,{once:!0})};return c.jsx("button",{type:"button",disabled:t,onTouchStart:s,onMouseDown:l,onContextMenu:u=>u.preventDefault(),"aria-label":"按住说话",title:"按住说话",style:{WebkitTouchCallout:"none"},className:re("flex shrink-0 select-none touch-none items-center justify-center transition-colors duration-150 disabled:cursor-not-allowed disabled:text-fg-6/40","order-first self-stretch w-12 rounded-xl sm:order-none sm:self-auto sm:h-7 sm:w-7 sm:rounded-md",e?"bg-red-500/15 text-red-400 hover:bg-red-500/25":"text-fg-5 hover:text-fg-3"),children:c.jsx(B7,{className:re("h-6 w-6 sm:h-4 sm:w-4",e&&"animate-pulse")})})}const zV=[.85,1.25,.65,1.4,.75,1.15,.95],Zx=4,tA=24;function FV(e){const t=Math.floor(e/60).toString().padStart(2,"0"),n=Math.floor(e%60).toString().padStart(2,"0");return`${t}:${n}`}function HV({volumeLevel:e}){const t=Math.min(Math.max(e,0),1);return c.jsx("div",{className:"flex h-6 items-center gap-1","aria-hidden":"true",children:zV.map((n,r)=>{const a=Zx+t*n*(tA-Zx),s=Math.max(Zx,Math.min(tA,a));return c.jsx("span",{className:"w-1 rounded-full bg-red-400 transition-[height] duration-150 ease-out",style:{height:`${s}px`}},r)})})}function MR({phase:e,transcript:t,interimTranscript:n,editText:r,onEditTextChange:a,onTextareaKeyDown:s,textareaRef:l,wrapperClassName:u}){if(e==="idle")return null;const d=t.length>0||n.length>0;return c.jsx("div",{className:u,children:c.jsxs("div",{className:"max-h-[40vh] overflow-y-auto px-4 py-4",children:[e==="recording"&&c.jsx("div",{className:"text-xl leading-relaxed",children:d?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-fg",children:t}),n&&c.jsx("span",{className:"text-fg-4",children:n})]}):c.jsx("span",{className:"italic text-fg-5",children:"正在聆听…"})}),e==="recognizing"&&c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(cn,{className:"h-5 w-5 shrink-0 text-emerald-400 fs-spin"}),c.jsx("span",{className:"font-mono text-sm text-emerald-400",children:"识别中…"}),n&&c.jsx("span",{className:"truncate text-base text-fg-4",children:n})]}),e==="done"&&c.jsx("textarea",{ref:l,value:r,onChange:f=>a(f.target.value),onKeyDown:s,rows:2,placeholder:"识别结果(可编辑)",className:"w-full resize-none bg-transparent text-xl leading-relaxed text-fg placeholder:text-fg-5 focus:outline-none"})]})})}function jR({phase:e,volumeLevel:t,elapsed:n,editText:r,error:a,onCancel:s,onConfirm:l,idleHint:u,className:d}){return e==="idle"?c.jsx("div",{className:d,children:a?c.jsx("span",{className:"font-mono text-[10px] text-red-400",children:a}):u?c.jsx("span",{className:"font-mono text-[10px] text-fg-6",children:u}):null}):e==="done"?c.jsxs("div",{className:d,children:[c.jsx("span",{className:"hidden font-mono text-[10px] text-fg-6 sm:inline",children:"⌘/Ctrl+⏎ 发送 · Esc 取消"}),c.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[c.jsx("button",{type:"button",onClick:s,className:"rounded-md border border-line px-3 py-1 text-xs text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:"取消"}),c.jsxs("button",{type:"button",onClick:l,disabled:r.trim().length===0,"aria-label":"发送",className:"flex items-center gap-1.5 rounded-md bg-emerald-600 px-3 py-1 text-xs font-medium text-white transition-colors hover:bg-emerald-500 disabled:cursor-not-allowed disabled:bg-fg-6/30 disabled:text-fg-5",children:[c.jsx(Jd,{className:"h-3.5 w-3.5",strokeWidth:2.5}),c.jsx("span",{children:"发送"})]})]})]}):c.jsx("div",{className:d,children:e==="recording"?c.jsxs(c.Fragment,{children:[c.jsx(HV,{volumeLevel:t}),c.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-[11px] font-medium text-red-400",children:[c.jsx("span",{className:"h-1.5 w-1.5 shrink-0 animate-pulse rounded-full bg-red-400"}),"录音中"]}),c.jsx("span",{className:"font-mono text-[11px] tabular-nums text-fg-4",children:FV(n)})]}):c.jsxs(c.Fragment,{children:[c.jsx(cn,{className:"h-4 w-4 shrink-0 text-emerald-400 fs-spin"}),c.jsx("span",{className:"font-mono text-[11px] text-emerald-400",children:"识别中…"})]})})}/*! Capacitor: https://capacitorjs.com/ - MIT License */var Uu;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(Uu||(Uu={}));class Jx extends Error{constructor(t,n,r){super(t),this.message=t,this.code=n,this.data=r}}const $V=e=>{var t,n;return e!=null&&e.androidBridge?"android":!((n=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||n===void 0)&&n.bridge?"ios":"web"},YV=e=>{const t=e.CapacitorCustomPlatform||null,n=e.Capacitor||{},r=n.Plugins=n.Plugins||{},a=()=>t!==null?t.name:$V(e),s=()=>a()!=="web",l=p=>{const b=f.get(p);return!!(b!=null&&b.platforms.has(a())||u(p))},u=p=>{var b;return(b=n.PluginHeaders)===null||b===void 0?void 0:b.find(x=>x.name===p)},d=p=>e.console.error(p),f=new Map,m=(p,b={})=>{const x=f.get(p);if(x)return console.warn(`Capacitor plugin "${p}" already registered. Cannot register plugins twice.`),x.proxy;const E=a(),N=u(p);let w;const T=async()=>(!w&&E in b?w=typeof b[E]=="function"?w=await b[E]():w=b[E]:t!==null&&!w&&"web"in b&&(w=typeof b.web=="function"?w=await b.web():w=b.web),w),C=(F,D)=>{var M,q;if(N){const G=N==null?void 0:N.methods.find(ae=>D===ae.name);if(G)return G.rtype==="promise"?ae=>n.nativePromise(p,D.toString(),ae):(ae,Q)=>n.nativeCallback(p,D.toString(),ae,Q);if(F)return(M=F[D])===null||M===void 0?void 0:M.bind(F)}else{if(F)return(q=F[D])===null||q===void 0?void 0:q.bind(F);throw new Jx(`"${p}" plugin is not implemented on ${E}`,Uu.Unimplemented)}},A=F=>{let D;const M=(...q)=>{const G=T().then(ae=>{const Q=C(ae,F);if(Q){const W=Q(...q);return D=W==null?void 0:W.remove,W}else throw new Jx(`"${p}.${F}()" is not implemented on ${E}`,Uu.Unimplemented)});return F==="addListener"&&(G.remove=async()=>D()),G};return M.toString=()=>`${F.toString()}() { [capacitor code] }`,Object.defineProperty(M,"name",{value:F,writable:!1,configurable:!1}),M},k=A("addListener"),R=A("removeListener"),O=(F,D)=>{const M=k({eventName:F},D),q=async()=>{const ae=await M;R({eventName:F,callbackId:ae},D)},G=new Promise(ae=>M.then(()=>ae({remove:q})));return G.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await q()},G},j=new Proxy({},{get(F,D){switch(D){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return N?O:k;case"removeListener":return R;default:return A(D)}}});return r[p]=j,f.set(p,{name:p,proxy:j,platforms:new Set([...Object.keys(b),...N?[E]:[]])}),j};return n.convertFileSrc||(n.convertFileSrc=p=>p),n.getPlatform=a,n.handleError=d,n.isNativePlatform=s,n.isPluginAvailable=l,n.registerPlugin=m,n.Exception=Jx,n.DEBUG=!!n.DEBUG,n.isLoggingEnabled=!!n.isLoggingEnabled,n},qV=e=>e.Capacitor=YV(e),hp=qV(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),T0=hp.registerPlugin;class W1{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(t,n){let r=!1;this.listeners[t]||(this.listeners[t]=[],r=!0),this.listeners[t].push(n);const s=this.windowListeners[t];s&&!s.registered&&this.addWindowListener(s),r&&this.sendRetainedArgumentsForEvent(t);const l=async()=>this.removeListener(t,n);return Promise.resolve({remove:l})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,n,r){const a=this.listeners[t];if(!a){if(r){let s=this.retainedEventArguments[t];s||(s=[]),s.push(n),this.retainedEventArguments[t]=s}return}a.forEach(s=>s(n))}hasListeners(t){var n;return!!(!((n=this.listeners[t])===null||n===void 0)&&n.length)}registerWindowListener(t,n){this.windowListeners[n]={registered:!1,windowEventName:t,pluginEventName:n,handler:r=>{this.notifyListeners(n,r)}}}unimplemented(t="not implemented"){return new hp.Exception(t,Uu.Unimplemented)}unavailable(t="not available"){return new hp.Exception(t,Uu.Unavailable)}async removeListener(t,n){const r=this.listeners[t];if(!r)return;const a=r.indexOf(n);this.listeners[t].splice(a,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const n=this.retainedEventArguments[t];n&&(delete this.retainedEventArguments[t],n.forEach(r=>{this.notifyListeners(t,r)}))}}const nA=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),rA=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class GV extends W1{async getCookies(){const t=document.cookie,n={};return t.split(";").forEach(r=>{if(r.length<=0)return;let[a,s]=r.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");a=rA(a).trim(),s=rA(s).trim(),n[a]=s}),n}async setCookie(t){try{const n=nA(t.key),r=nA(t.value),a=t.expires?`; expires=${t.expires.replace("expires=","")}`:"",s=(t.path||"/").replace("path=",""),l=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${n}=${r||""}${a}; path=${s}; ${l};`}catch(n){return Promise.reject(n)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const n of t)document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}T0("CapacitorCookies",{web:()=>new GV});const KV=async e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const a=r.result;t(a.indexOf(",")>=0?a.split(",")[1]:a)},r.onerror=a=>n(a),r.readAsDataURL(e)}),VV=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(a=>a.toLocaleLowerCase()).reduce((a,s,l)=>(a[s]=e[t[l]],a),{})},WV=(e,t=!0)=>e?Object.entries(e).reduce((r,a)=>{const[s,l]=a;let u,d;return Array.isArray(l)?(d="",l.forEach(f=>{u=t?encodeURIComponent(f):f,d+=`${s}=${u}&`}),d.slice(0,-1)):(u=t?encodeURIComponent(l):l,d=`${s}=${u}`),`${r}&${d}`},"").substr(1):null,XV=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),a=VV(e.headers)["content-type"]||"";if(typeof e.data=="string")n.body=e.data;else if(a.includes("application/x-www-form-urlencoded")){const s=new URLSearchParams;for(const[l,u]of Object.entries(e.data||{}))s.set(l,u);n.body=s.toString()}else if(a.includes("multipart/form-data")||e.data instanceof FormData){const s=new FormData;if(e.data instanceof FormData)e.data.forEach((u,d)=>{s.append(d,u)});else for(const u of Object.keys(e.data))s.append(u,e.data[u]);n.body=s;const l=new Headers(n.headers);l.delete("content-type"),n.headers=l}else(a.includes("application/json")||typeof e.data=="object")&&(n.body=JSON.stringify(e.data));return n};class QV extends W1{async request(t){const n=XV(t,t.webFetchExtra),r=WV(t.params,t.shouldEncodeUrlParams),a=r?`${t.url}?${r}`:t.url,s=await fetch(a,n),l=s.headers.get("content-type")||"";let{responseType:u="text"}=s.ok?t:{};l.includes("application/json")&&(u="json");let d,f;switch(u){case"arraybuffer":case"blob":f=await s.blob(),d=await KV(f);break;case"json":d=await s.json();break;case"document":case"text":default:d=await s.text()}const m={};return s.headers.forEach((p,b)=>{m[b]=p}),{data:d,headers:m,status:s.status,url:s.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}T0("CapacitorHttp",{web:()=>new QV});var aA;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(aA||(aA={}));var iA;(function(e){e.StatusBar="StatusBar",e.NavigationBar="NavigationBar"})(iA||(iA={}));class ZV extends W1{async setStyle(){this.unavailable("not available for web")}async setAnimation(){this.unavailable("not available for web")}async show(){this.unavailable("not available for web")}async hide(){this.unavailable("not available for web")}}T0("SystemBars",{web:()=>new ZV});const JV="modulepreload",eW=function(e){return"/"+e},sA={},tW=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let l=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),d=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));a=l(n.map(f=>{if(f=eW(f),f in sA)return;sA[f]=!0;const m=f.endsWith(".css"),p=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${p}`))return;const b=document.createElement("link");if(b.rel=m?"stylesheet":JV,m||(b.as="script"),b.crossOrigin="",b.href=f,d&&b.setAttribute("nonce",d),document.head.appendChild(b),m)return new Promise((x,E)=>{b.addEventListener("load",x),b.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return a.then(l=>{for(const u of l||[])u.status==="rejected"&&s(u.reason);return t().catch(s)})},bu=T0("SpeechRecognition",{web:()=>tW(()=>import("./web-wAoVnzPB.js"),[]).then(e=>new e.SpeechRecognitionWeb)});function nW(e,t){const n=e.length,r=new ArrayBuffer(44+n*2),a=new DataView(r),s=(l,u)=>{for(let d=0;d<u.length;d++)a.setUint8(l+d,u.charCodeAt(d))};s(0,"RIFF"),a.setUint32(4,36+n*2,!0),s(8,"WAVE"),s(12,"fmt "),a.setUint32(16,16,!0),a.setUint16(20,1,!0),a.setUint16(22,1,!0),a.setUint32(24,t,!0),a.setUint32(28,t*2,!0),a.setUint16(32,2,!0),a.setUint16(34,16,!0),s(36,"data"),a.setUint32(40,n*2,!0);for(let l=0;l<n;l++){const u=Math.max(-1,Math.min(1,e[l]));a.setInt16(44+l*2,u<0?u*32768:u*32767,!0)}return new Blob([r],{type:"audio/wav"})}const cv=hp.isNativePlatform(),ey=!cv&&typeof window<"u"?window.SpeechRecognition??window.webkitSpeechRecognition:void 0,ty=16e3;function rW(e="zh-CN"){const[t,n]=v.useState(!1),[r,a]=v.useState(""),[s,l]=v.useState(""),[u,d]=v.useState(null),[f,m]=v.useState(0),[p,b]=v.useState("idle"),x=v.useRef(null),E=v.useRef(!1),N=v.useRef([]),w=v.useRef(!1),T=v.useRef(null),C=v.useRef(!1),A=v.useRef(""),k=v.useRef(null),R=v.useRef(null),O=v.useRef(null),j=v.useRef([]),F=v.useRef(!1),D=!0,M=v.useCallback(async()=>{var B,me,le;(B=O.current)==null||B.disconnect(),(me=R.current)==null||me.getTracks().forEach(z=>z.stop()),await((le=k.current)==null?void 0:le.close().catch(()=>{}));const H=j.current;if(j.current=[],O.current=null,R.current=null,k.current=null,H.length===0||F.current){n(!1),b("idle");return}l("识别中…"),b("recognizing");const $=H.reduce((z,fe)=>z+fe.length,0),V=new Float32Array($);let L=0;for(const z of H)V.set(z,L),L+=z.length;const P=nW(V,ty),ee=new FormData;ee.append("audio",P,"recording.wav");try{const z=await fetch("/api/transcribe",{method:"POST",body:ee});if(F.current)return;if(z.ok){const{text:fe}=await z.json();fe?(a(fe),b("done")):b("idle")}else{const fe=await z.json().catch(()=>({error:`HTTP ${z.status}`}));d(fe.error??`HTTP ${z.status}`),b("idle")}}catch(z){d(`语音识别失败:${z instanceof Error?z.message:String(z)}`),b("idle")}finally{l(""),n(!1)}},[]),q=v.useCallback(async()=>{if(E.current=!0,T.current&&(clearTimeout(T.current),T.current=null),cv){await bu.stop().catch(()=>{});for(const H of N.current)await H.remove().catch(()=>{});N.current=[],n(!1),l("")}else x.current?x.current.stop():k.current?await M():(n(!1),b("idle"))},[M]),G=v.useCallback(async()=>{var L;F.current=!1,a(""),l(""),d(null),b("idle");const{available:H}=await bu.available();if(!H){d("当前设备不支持语音识别");return}if((await bu.requestPermissions()).speechRecognition!=="granted"){d("请允许语音识别权限");return}const V=[];V.push(await bu.addListener("partialResults",P=>{l(P.matches[0]??"")})),V.push(await bu.addListener("listeningState",P=>{const ee=P.status==="started";n(ee),ee&&b("recording"),ee||l("")})),N.current=V;try{const P=await bu.start({language:e,partialResults:!0,maxResults:1});(L=P.matches)!=null&&L.length&&a(ee=>ee+P.matches.join(""))}catch(P){d(`语音识别错误:${P instanceof Error?P.message:String(P)}`);for(const ee of V)await ee.remove().catch(()=>{});N.current=[]}},[e]),ae=v.useCallback(()=>{if(!ey)return!1;F.current=!1,a(""),l(""),A.current="",d(null),b("idle"),E.current=!1;const H=new ey;H.lang=e,H.continuous=!0,H.interimResults=!0,H.maxAlternatives=1,H.onstart=()=>{n(!0),b("recording"),w.current=!1,T.current=setTimeout(()=>{!w.current&&!E.current&&(C.current=!0,E.current=!0,H.stop(),d("语音识别服务不可用(Chrome/Edge 需连接 Google 服务器),下次将使用服务端识别"))},5e3)},H.onresult=$=>{w.current=!0,T.current&&(clearTimeout(T.current),T.current=null);let V="",L="";for(let P=$.resultIndex;P<$.results.length;P++){const ee=$.results[P][0].transcript;$.results[P].isFinal?V+=ee:L+=ee}V&&a(P=>P+V),l(L),A.current=L},H.onerror=$=>{switch($.error!=="no-speech"&&$.error!=="aborted"&&(E.current=!0),$.error){case"not-allowed":d("请允许麦克风权限");break;case"network":d("网络错误,请检查连接");break;case"no-speech":case"aborted":return;default:d(`语音识别错误:${$.error}`)}},H.onend=()=>{if(E.current&&A.current&&a($=>$+A.current),l(""),A.current="",!E.current)try{H.start();return}catch{}n(!1),x.current=null},x.current=H;try{return H.start(),!0}catch{return!1}},[e]),Q=v.useCallback(async()=>{F.current=!1,a(""),l(""),d(null),b("idle");try{const P=await fetch("/api/transcribe/status"),{available:ee}=await P.json();if(!ee){d("语音识别服务未就绪,请稍后重试");return}}catch{d("无法连接语音识别服务");return}let H;try{H=await navigator.mediaDevices.getUserMedia({audio:{sampleRate:ty,channelCount:1}})}catch{d("请允许麦克风权限");return}const $=new AudioContext({sampleRate:ty}),V=$.createMediaStreamSource(H),L=$.createScriptProcessor(4096,1,1);j.current=[],L.onaudioprocess=P=>{j.current.push(new Float32Array(P.inputBuffer.getChannelData(0)))},V.connect(L),L.connect($.destination),k.current=$,R.current=H,O.current=L,n(!0),b("recording")},[]),W=v.useCallback(()=>{cv?G():ey&&!C.current&&ae()||Q()},[G,ae,Q]);v.useEffect(()=>{if(!t){m(0);return}if(x.current)return;let H=!1,$=null,V=null,L=0;return(async()=>{try{if($=await navigator.mediaDevices.getUserMedia({audio:!0}),H){$.getTracks().forEach(z=>z.stop());return}V=new AudioContext;const P=V.createMediaStreamSource($),ee=V.createAnalyser();ee.fftSize=256,P.connect(ee);const B=new Uint8Array(ee.frequencyBinCount);let me=0;const le=()=>{if(H)return;ee.getByteFrequencyData(B);const z=performance.now();if(z-me>80){let fe=0;for(let Oe=0;Oe<B.length;Oe++)fe+=B[Oe];m(fe/(B.length*255)),me=z}L=requestAnimationFrame(le)};L=requestAnimationFrame(le)}catch{}})(),()=>{H=!0,cancelAnimationFrame(L),$==null||$.getTracks().forEach(P=>P.stop()),V==null||V.close().catch(()=>{}),m(0)}},[t]),v.useEffect(()=>{!t&&p==="recording"&&b(r?"done":"idle")},[t,p,r]),v.useEffect(()=>()=>{var H,$,V,L;E.current=!0,(H=x.current)==null||H.stop(),($=O.current)==null||$.disconnect(),(V=R.current)==null||V.getTracks().forEach(P=>P.stop()),(L=k.current)==null||L.close().catch(()=>{});for(const P of N.current)P.remove().catch(()=>{})},[]);const K=v.useCallback(()=>{F.current=!0,a(""),l(""),A.current="",b("idle")},[]);return{isSupported:D,isListening:t,phase:p,transcript:r,interimTranscript:s,error:u,volumeLevel:f,start:W,stop:q,resetTranscript:K}}const aW=240,iW=1e3;function DR(e){const t=rW(),[n,r]=v.useState(""),[a,s]=v.useState(0),l=v.useRef(null),u=v.useRef(null),d=v.useRef(0);v.useEffect(()=>(t.phase==="recording"?(d.current=Date.now(),s(0),u.current=setInterval(()=>{s(Math.floor((Date.now()-d.current)/1e3))},iW)):u.current&&(clearInterval(u.current),u.current=null),()=>{u.current&&(clearInterval(u.current),u.current=null)}),[t.phase]),v.useEffect(()=>{t.phase==="done"&&(r(t.transcript),requestAnimationFrame(()=>{const b=l.current;b&&(b.focus(),b.setSelectionRange(b.value.length,b.value.length))}))},[t.phase,t.transcript]),v.useLayoutEffect(()=>{if(t.phase!=="done")return;const b=l.current;b&&(b.style.height="auto",b.style.height=`${Math.min(b.scrollHeight,aW)}px`)},[t.phase,n]);const f=v.useCallback(()=>{t.stop(),t.resetTranscript(),r("")},[t]),m=v.useCallback(async()=>{const b=n.trim();if(!b){f();return}await e(b)!==!1&&(t.resetTranscript(),r(""))},[n,e,f,t]);v.useEffect(()=>{if(t.phase==="idle")return;const b=x=>{if(x.key==="Escape"&&t.phase!=="recognizing"){x.preventDefault(),f();return}if(t.phase==="done"&&x.key==="Enter"&&(x.metaKey||x.ctrlKey)){if(x.isComposing)return;x.preventDefault(),m()}};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[t.phase,f,m]);const p=v.useCallback(b=>{b.nativeEvent.isComposing||b.keyCode===229||b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),m())},[m]);return{stt:t,editText:n,setEditText:r,elapsed:a,textareaRef:l,cancel:f,confirm:m,handleTextareaKeyDown:p}}const il=ei(e=>({agents:[],loaded:!1,loadAgents:async()=>{const t=Fe.getState().activeRepoId;try{const n=t?await lI(t):await aI();e({agents:n,loaded:!0})}catch{e({loaded:!0})}}}));function sW(e){if(typeof e!="string")return e;const t=e.trim();if(t)try{return JSON.parse(t)}catch{return t}}function Gn(e){return e&&typeof e=="object"?e:null}function To(e){const t=Gn(e);return t&&"properties"in t?t.properties:e}function lW(e){const t=Gn(e);return typeof(t==null?void 0:t.type)=="string"?t.type:void 0}function oW(e){const t=Gn(To(e));if(!t)return null;const n=Gn(t.info);if(n&&typeof n.id=="string"){const a=Array.isArray(t.parts)?t.parts:void 0;return{...n,...a?{parts:a}:{}}}if(typeof t.id=="string"&&typeof t.role=="string")return t;const r=Gn(t.message);return r&&typeof r.id=="string"?r:null}function uW(e){const t=Gn(To(e));if(!t)return{};const n=Gn(t.part)??t;return typeof n.type!="string"?{}:{messageId:typeof n.messageID=="string"&&n.messageID||typeof n.messageId=="string"&&n.messageId||typeof t.messageID=="string"&&t.messageID||typeof t.messageId=="string"&&t.messageId||void 0,part:n}}function cW(e){const t=Gn(To(e));if(!t||t.field!=="text")return null;const n=typeof t.messageID=="string"?t.messageID:null,r=typeof t.partID=="string"?t.partID:null,a=typeof t.delta=="string"?t.delta:null;return!n||!r||a===null?null:{messageId:n,partId:r,delta:a}}function dW(e){const t=To(e);if(Array.isArray(t))return t;const n=Gn(t);return n&&Array.isArray(n.todos)?n.todos:[]}function ci(e){return typeof e=="number"?e:0}function fW(e){const t=Gn(To(e));if(!t||typeof t.id!="string")return null;const n={id:t.id};typeof t.title=="string"&&(n.title=t.title),typeof t.agent=="string"&&(n.agent=t.agent),typeof t.cost=="number"&&(n.cost=t.cost);const r=typeof t.parentID=="string"?t.parentID:typeof t.parent_id=="string"?t.parent_id:void 0;r&&(n.parentID=r);const a=Gn(t.tokens),s=typeof t.tokens_input=="number"||typeof t.tokens_output=="number";if(a||s){const u=a?Gn(a.cache):null;n.tokens={input:ci(a==null?void 0:a.input)||ci(t.tokens_input),output:ci(a==null?void 0:a.output)||ci(t.tokens_output),reasoning:ci(a==null?void 0:a.reasoning)||ci(t.tokens_reasoning),cache:{read:ci(u==null?void 0:u.read)||ci(t.tokens_cache_read),write:ci(u==null?void 0:u.write)||ci(t.tokens_cache_write)}}}const l=Gn(t.model);return l&&(n.model={providerID:typeof l.providerID=="string"?l.providerID:void 0,modelID:typeof l.modelID=="string"?l.modelID:void 0,variant:typeof l.variant=="string"?l.variant:void 0}),n}function hW(e){const t=Gn(To(e));if(!t)return null;if(typeof t.message=="string")return t.message;const n=Gn(t.error);if(n){const r=Gn(n.data);if(typeof(r==null?void 0:r.message)=="string")return`${n.name??"Error"}: ${r.message}`;if(typeof n.message=="string")return`${n.name??"Error"}: ${n.message}`;if(typeof n.name=="string")return String(n.name)}return typeof t.reason=="string"?t.reason:null}function mW(e){const t=To(e);if(typeof t=="string")return t;const n=Gn(t);if(typeof(n==null?void 0:n.status)=="string")return n.status;const r=Gn(n==null?void 0:n.status);return typeof(r==null?void 0:r.type)=="string"?r.type:typeof(n==null?void 0:n.type)=="string"?n.type:null}function pW(e,t,n,r){switch(e==="message"||e===""?lW(t)??e:e){case"message.updated":{const s=oW(t);s&&r.updateMessage(n,s);break}case"session.updated":{const s=fW(t);s&&r.updateSessionInfo(s);break}case"message.part.updated":{const{messageId:s,part:l}=uW(t);l&&s&&r.updateMessagePart(n,s,l);break}case"message.part.delta":{const s=cW(t);s&&r.appendMessagePartDelta(n,s.messageId,s.partId,s.delta);break}case"todo.updated":{r.updateTodos(n,dW(t));break}case"session.status":{const s=mW(t);s&&r.setSessionStatus(n,s);break}case"session.idle":{r.setSessionStatus(n,"idle");break}case"session.error":{const s=hW(t);r.setSessionStatus(n,"error",s??void 0);break}}}const gW=600*1e3;class bW{constructor(t,n){un(this,"sessionId");un(this,"idleTimer",null);un(this,"active",!1);un(this,"alive",!0);un(this,"callbacks");this.sessionId=t,this.callbacks=n,this.resetIdleTimer()}dispatch(t,n){if(!this.alive)return;this.resetIdleTimer();const r=Le.getState();pW(t,n,this.sessionId,r)}activate(){this.active=!0,this.clearIdleTimer()}deactivate(){this.active=!1,this.resetIdleTimer()}refreshOnIdle(){Le.getState().refreshSessionData(this.sessionId)}stop(){this.alive=!1,this.clearIdleTimer()}resetIdleTimer(){this.clearIdleTimer(),!this.active&&(this.idleTimer=setTimeout(()=>{this.callbacks.onWorkerIdle(this.sessionId)},gW))}clearIdleTimer(){this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null)}}const xW=1e3,yW=3e4;class vW{constructor(t,n){un(this,"source",null);un(this,"reconnectTimer",null);un(this,"attempts",0);un(this,"disposed",!1);un(this,"repoId");un(this,"onEvent");this.repoId=t,this.onEvent=n}start(){this.connect()}stop(){var t;this.disposed=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(t=this.source)==null||t.close(),this.source=null}connect(){if(this.disposed)return;const t=RF(this.repoId),n=new EventSource(t);this.source=n,n.onopen=()=>{this.attempts=0},n.onmessage=a=>{this.handleRaw("message",a)};const r=["message.updated","message.part.updated","message.part.delta","message.removed","todo.updated","session.status","session.idle","session.error","session.updated"];for(const a of r)n.addEventListener(a,s=>{this.handleRaw(a,s)});n.onerror=()=>{if(!(this.disposed||!this.source)&&this.source.readyState===EventSource.CLOSED){this.source.close(),this.source=null;const a=Math.min(xW*2**this.attempts,yW);this.attempts++,this.reconnectTimer=setTimeout(()=>this.connect(),a)}}}handleRaw(t,n){if(!(n instanceof MessageEvent))return;const r=sW(n.data);if(r===void 0)return;const a=this.extractSessionId(r);if(!a)return;let s=t;if(t==="message"||t===""){const l=r&&typeof r=="object"?r:null;typeof(l==null?void 0:l.type)=="string"&&(s=l.type)}this.onEvent(a,s,r)}extractSessionId(t){if(!t||typeof t!="object")return null;const n=t;if(n.properties&&typeof n.properties=="object"){const r=n.properties;if(typeof r.sessionID=="string")return r.sessionID;if(typeof r.id=="string")return r.id}return typeof n.sessionID=="string"?n.sessionID:typeof n.sessionId=="string"?n.sessionId:null}}const EW=6e4;class NW{constructor(t){un(this,"timer",null);un(this,"paused",!1);un(this,"callbacks");this.callbacks=t}start(){this.tick(),this.timer=setInterval(()=>{this.paused||this.tick()},EW)}stop(){this.timer&&(clearInterval(this.timer),this.timer=null)}pause(){this.paused=!0}resume(){this.paused=!1,this.tick()}tick(){const t=Fe.getState().activeRepoId;t&&(Le.getState().loadSessions(),MF(t).then(n=>{const r={};for(const[a,s]of Object.entries(n))r[a]=s.type??"idle";Le.getState().bulkSetStatuses(r);for(const[a,s]of Object.entries(r))(s==="busy"||s==="retry")&&this.callbacks.ensureWorker(a)}).catch(()=>{}))}}class _W{constructor(){un(this,"workers",new Map);un(this,"dispatcher",null);un(this,"supervisor",null);un(this,"visibilityHandler",null)}start(t){this.stop();const n={onWorkerIdle:r=>this.removeWorker(r)};this.dispatcher=new vW(t,(r,a,s)=>{const l=this.ensureWorker(r,n);if(a==="session.idle"||a==="session.status"){const u=Le.getState().sessionStatuses[r];l.dispatch(a,s);const d=Le.getState().sessionStatuses[r];u&&u!=="idle"&&d==="idle"&&l.refreshOnIdle()}else l.dispatch(a,s)}),this.dispatcher.start(),this.supervisor=new NW({ensureWorker:r=>this.ensureWorker(r,n)}),this.supervisor.start(),this.visibilityHandler=()=>{var r,a;document.hidden?(r=this.supervisor)==null||r.pause():(a=this.supervisor)==null||a.resume()},document.addEventListener("visibilitychange",this.visibilityHandler)}stop(){var t,n;(t=this.dispatcher)==null||t.stop(),this.dispatcher=null,(n=this.supervisor)==null||n.stop(),this.supervisor=null;for(const r of this.workers.values())r.stop();this.workers.clear(),this.visibilityHandler&&(document.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=null)}activateSession(t){for(const a of this.workers.values())a.sessionId!==t&&a.deactivate();if(!t)return;const n={onWorkerIdle:a=>this.removeWorker(a)};this.ensureWorker(t,n).activate(),Le.getState().refreshSessionData(t)}deactivateSession(t){var n;(n=this.workers.get(t))==null||n.deactivate()}ensureWorker(t,n){let r=this.workers.get(t);return r||(r=new bW(t,n),this.workers.set(t,r)),r}removeWorker(t){const n=Le.getState().activeSessionId;if(t===n)return;const r=this.workers.get(t);r&&(r.stop(),this.workers.delete(t))}}const mp=new _W,lA=(function(e,t,n){const r=Of(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),So=(function(e){if(e==null)return wW;if(typeof e=="string")return SW(e);if(typeof e=="object")return TW(e);if(typeof e=="function")return X1(e);throw new Error("Expected function, string, or array as `test`")});function TW(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=So(e[n]);return X1(r);function r(...a){let s=-1;for(;++s<t.length;)if(t[s].apply(this,a))return!0;return!1}}function SW(e){return X1(t);function t(n){return n.tagName===e}}function X1(e){return t;function t(n,r,a){return!!(AW(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function wW(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function AW(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const oA=/\n/g,uA=/[\t ]+/g,dv=So("br"),cA=So(DW),CW=So("p"),dA=So("tr"),kW=So(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",jW,LW]),LR=So(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function OW(e,t){const n=t||{},r="children"in e?e.children:[],a=LR(e),s=UR(e,{whitespace:n.whitespace||"normal"}),l=[];(e.type==="text"||e.type==="comment")&&l.push(...BR(e,{breakBefore:!0,breakAfter:!0}));let u=-1;for(;++u<r.length;)l.push(...PR(r[u],e,{whitespace:s,breakBefore:u?void 0:a,breakAfter:u<r.length-1?dv(r[u+1]):a}));const d=[];let f;for(u=-1;++u<l.length;){const m=l[u];typeof m=="number"?f!==void 0&&m>f&&(f=m):m&&(f!==void 0&&f>-1&&d.push(`
|
|
528
|
+
`),a=String(r.length).length;return c.jsx("div",{role:"dialog","aria-modal":"true","aria-label":t,onClick:n,className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-4 backdrop-blur-sm md:p-8",children:c.jsxs("div",{onClick:s=>s.stopPropagation(),className:"flex max-h-full w-full max-w-4xl flex-col overflow-hidden rounded-lg border border-line bg-term",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-line px-4 py-2",children:[c.jsx("span",{className:"font-mono text-xs text-fg-3",children:t}),c.jsx("button",{type:"button",onClick:n,className:"text-fg-5 hover:text-fg-2",children:c.jsx(gt,{className:"h-4 w-4"})})]}),c.jsx("pre",{className:"overflow-auto p-4 font-mono text-xs leading-relaxed text-fg-2",children:r.map((s,l)=>c.jsxs("div",{children:[c.jsx("span",{className:"mr-3 inline-block select-none text-right text-fg-6",style:{width:`${a}ch`},children:l+1}),s]},l))})]})})}function UV({fold:e,index:t,onRemove:n}){const[r,a]=v.useState(!1),s=`粘贴文本 #${t} · ${e.lineCount}行 · ${DV(e.byteSize)}`;return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"group relative flex items-center gap-1.5 rounded-md border border-line bg-elevated/50 px-2.5 py-1.5",children:[c.jsxs("button",{type:"button",onClick:()=>a(!0),className:"flex items-center gap-1.5 font-mono text-xs text-fg-3 transition-colors hover:text-fg",children:[c.jsx(ol,{className:"h-3.5 w-3.5 shrink-0 text-fg-5"}),c.jsx("span",{children:s})]}),c.jsx("button",{type:"button",onClick:n,"aria-label":"移除粘贴文本",className:"flex h-4 w-4 shrink-0 items-center justify-center rounded-full text-fg-5 transition-colors hover:text-fg-2",children:c.jsx(gt,{className:"h-2.5 w-2.5",strokeWidth:2.5})})]}),r&&c.jsx(BV,{text:e.text,label:s,onClose:()=>a(!1)})]})}function OR({onFiles:e,disabled:t,allowed:n}){const r=v.useRef(null);return c.jsxs(c.Fragment,{children:[c.jsx("input",{ref:r,type:"file",accept:AR.join(","),multiple:!0,hidden:!0,onChange:a=>{e(Array.from(a.target.files??[])),a.target.value=""}}),c.jsx("button",{type:"button",onClick:()=>{var a;return(a=r.current)==null?void 0:a.click()},disabled:t||!n,"aria-label":"Attach image",title:n?"附加图片":"当前模型不支持图片",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-fg-5 transition-colors duration-150 hover:text-fg-3 disabled:cursor-not-allowed disabled:text-fg-6/40",children:c.jsx(N7,{className:"h-4 w-4"})})]})}function IR({attachments:e,foldedTexts:t,error:n,onRemove:r,onRemoveFoldedText:a,className:s}){const l=e.length>0||(t??[]).length>0;return!l&&!n?null:c.jsxs("div",{className:s,children:[l&&c.jsxs("div",{className:"mb-2 flex flex-wrap gap-2",children:[e.map(u=>c.jsxs("div",{className:"group relative",children:[c.jsx(V1,{url:u.url,label:u.filename??"attachment",className:"h-16 w-16 object-cover"}),c.jsx("button",{type:"button",onClick:()=>r(u._id),"aria-label":"Remove attachment",className:"absolute -right-1.5 -top-1.5 flex h-4 w-4 items-center justify-center rounded-full border border-line bg-term text-fg-4 opacity-0 transition-opacity duration-150 hover:text-fg-2 group-hover:opacity-100",children:c.jsx(gt,{className:"h-2.5 w-2.5",strokeWidth:2.5})})]},u._id)),(t??[]).map((u,d)=>c.jsx(UV,{fold:u,index:d+1,onRemove:()=>a==null?void 0:a(u._id)},u._id))]}),n&&c.jsx("div",{className:"mb-2 font-mono text-[11px] text-red-400",children:n})]})}function RR({isListening:e,disabled:t,onStart:n,onStop:r}){const a=v.useRef(!1),s=u=>{if(t)return;u.preventDefault(),a.current=!0,n();const d=()=>{document.removeEventListener("touchend",d),document.removeEventListener("touchcancel",d),a.current=!1,r()};document.addEventListener("touchend",d,{once:!0}),document.addEventListener("touchcancel",d,{once:!0})},l=()=>{if(t||a.current)return;n();const u=()=>{document.removeEventListener("mouseup",u),r()};document.addEventListener("mouseup",u,{once:!0})};return c.jsx("button",{type:"button",disabled:t,onTouchStart:s,onMouseDown:l,onContextMenu:u=>u.preventDefault(),"aria-label":"按住说话",title:"按住说话",style:{WebkitTouchCallout:"none"},className:re("flex shrink-0 select-none touch-none items-center justify-center transition-colors duration-150 disabled:cursor-not-allowed disabled:text-fg-6/40","order-first self-stretch w-12 rounded-xl sm:order-none sm:self-auto sm:h-7 sm:w-7 sm:rounded-md",e?"bg-red-500/15 text-red-400 hover:bg-red-500/25":"text-fg-5 hover:text-fg-3"),children:c.jsx(B7,{className:re("h-6 w-6 sm:h-4 sm:w-4",e&&"animate-pulse")})})}const zV=[.85,1.25,.65,1.4,.75,1.15,.95],Zx=4,tA=24;function FV(e){const t=Math.floor(e/60).toString().padStart(2,"0"),n=Math.floor(e%60).toString().padStart(2,"0");return`${t}:${n}`}function HV({volumeLevel:e}){const t=Math.min(Math.max(e,0),1);return c.jsx("div",{className:"flex h-6 items-center gap-1","aria-hidden":"true",children:zV.map((n,r)=>{const a=Zx+t*n*(tA-Zx),s=Math.max(Zx,Math.min(tA,a));return c.jsx("span",{className:"w-1 rounded-full bg-red-400 transition-[height] duration-150 ease-out",style:{height:`${s}px`}},r)})})}function MR({phase:e,transcript:t,interimTranscript:n,editText:r,onEditTextChange:a,onTextareaKeyDown:s,textareaRef:l,wrapperClassName:u}){if(e==="idle")return null;const d=t.length>0||n.length>0;return c.jsx("div",{className:u,children:c.jsxs("div",{className:"max-h-[40vh] overflow-y-auto px-4 py-4",children:[e==="recording"&&c.jsx("div",{className:"text-xl leading-relaxed",children:d?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-fg",children:t}),n&&c.jsx("span",{className:"text-fg-4",children:n})]}):c.jsx("span",{className:"italic text-fg-5",children:"正在聆听…"})}),e==="recognizing"&&c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(cn,{className:"h-5 w-5 shrink-0 text-emerald-400 fs-spin"}),c.jsx("span",{className:"font-mono text-sm text-emerald-400",children:"识别中…"}),n&&c.jsx("span",{className:"truncate text-base text-fg-4",children:n})]}),e==="done"&&c.jsx("textarea",{ref:l,value:r,onChange:f=>a(f.target.value),onKeyDown:s,rows:2,placeholder:"识别结果(可编辑)",className:"w-full resize-none bg-transparent text-xl leading-relaxed text-fg placeholder:text-fg-5 focus:outline-none"})]})})}function jR({phase:e,volumeLevel:t,elapsed:n,editText:r,error:a,onCancel:s,onConfirm:l,idleHint:u,className:d}){return e==="idle"?c.jsx("div",{className:d,children:a?c.jsx("span",{className:"font-mono text-[10px] text-red-400",children:a}):u?c.jsx("span",{className:"font-mono text-[10px] text-fg-6",children:u}):null}):e==="done"?c.jsxs("div",{className:d,children:[c.jsx("span",{className:"hidden font-mono text-[10px] text-fg-6 sm:inline",children:"⌘/Ctrl+⏎ 发送 · Esc 取消"}),c.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[c.jsx("button",{type:"button",onClick:s,className:"rounded-md border border-line px-3 py-1 text-xs text-fg-3 transition-colors hover:bg-elevated hover:text-fg",children:"取消"}),c.jsxs("button",{type:"button",onClick:l,disabled:r.trim().length===0,"aria-label":"发送",className:"flex items-center gap-1.5 rounded-md bg-emerald-600 px-3 py-1 text-xs font-medium text-white transition-colors hover:bg-emerald-500 disabled:cursor-not-allowed disabled:bg-fg-6/30 disabled:text-fg-5",children:[c.jsx(Jd,{className:"h-3.5 w-3.5",strokeWidth:2.5}),c.jsx("span",{children:"发送"})]})]})]}):c.jsx("div",{className:d,children:e==="recording"?c.jsxs(c.Fragment,{children:[c.jsx(HV,{volumeLevel:t}),c.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-[11px] font-medium text-red-400",children:[c.jsx("span",{className:"h-1.5 w-1.5 shrink-0 animate-pulse rounded-full bg-red-400"}),"录音中"]}),c.jsx("span",{className:"font-mono text-[11px] tabular-nums text-fg-4",children:FV(n)})]}):c.jsxs(c.Fragment,{children:[c.jsx(cn,{className:"h-4 w-4 shrink-0 text-emerald-400 fs-spin"}),c.jsx("span",{className:"font-mono text-[11px] text-emerald-400",children:"识别中…"})]})})}/*! Capacitor: https://capacitorjs.com/ - MIT License */var Uu;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(Uu||(Uu={}));class Jx extends Error{constructor(t,n,r){super(t),this.message=t,this.code=n,this.data=r}}const $V=e=>{var t,n;return e!=null&&e.androidBridge?"android":!((n=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||n===void 0)&&n.bridge?"ios":"web"},YV=e=>{const t=e.CapacitorCustomPlatform||null,n=e.Capacitor||{},r=n.Plugins=n.Plugins||{},a=()=>t!==null?t.name:$V(e),s=()=>a()!=="web",l=p=>{const b=f.get(p);return!!(b!=null&&b.platforms.has(a())||u(p))},u=p=>{var b;return(b=n.PluginHeaders)===null||b===void 0?void 0:b.find(x=>x.name===p)},d=p=>e.console.error(p),f=new Map,m=(p,b={})=>{const x=f.get(p);if(x)return console.warn(`Capacitor plugin "${p}" already registered. Cannot register plugins twice.`),x.proxy;const E=a(),N=u(p);let w;const T=async()=>(!w&&E in b?w=typeof b[E]=="function"?w=await b[E]():w=b[E]:t!==null&&!w&&"web"in b&&(w=typeof b.web=="function"?w=await b.web():w=b.web),w),C=(F,D)=>{var M,q;if(N){const G=N==null?void 0:N.methods.find(ae=>D===ae.name);if(G)return G.rtype==="promise"?ae=>n.nativePromise(p,D.toString(),ae):(ae,Q)=>n.nativeCallback(p,D.toString(),ae,Q);if(F)return(M=F[D])===null||M===void 0?void 0:M.bind(F)}else{if(F)return(q=F[D])===null||q===void 0?void 0:q.bind(F);throw new Jx(`"${p}" plugin is not implemented on ${E}`,Uu.Unimplemented)}},A=F=>{let D;const M=(...q)=>{const G=T().then(ae=>{const Q=C(ae,F);if(Q){const W=Q(...q);return D=W==null?void 0:W.remove,W}else throw new Jx(`"${p}.${F}()" is not implemented on ${E}`,Uu.Unimplemented)});return F==="addListener"&&(G.remove=async()=>D()),G};return M.toString=()=>`${F.toString()}() { [capacitor code] }`,Object.defineProperty(M,"name",{value:F,writable:!1,configurable:!1}),M},k=A("addListener"),R=A("removeListener"),O=(F,D)=>{const M=k({eventName:F},D),q=async()=>{const ae=await M;R({eventName:F,callbackId:ae},D)},G=new Promise(ae=>M.then(()=>ae({remove:q})));return G.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await q()},G},j=new Proxy({},{get(F,D){switch(D){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return N?O:k;case"removeListener":return R;default:return A(D)}}});return r[p]=j,f.set(p,{name:p,proxy:j,platforms:new Set([...Object.keys(b),...N?[E]:[]])}),j};return n.convertFileSrc||(n.convertFileSrc=p=>p),n.getPlatform=a,n.handleError=d,n.isNativePlatform=s,n.isPluginAvailable=l,n.registerPlugin=m,n.Exception=Jx,n.DEBUG=!!n.DEBUG,n.isLoggingEnabled=!!n.isLoggingEnabled,n},qV=e=>e.Capacitor=YV(e),hp=qV(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),T0=hp.registerPlugin;class W1{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(t,n){let r=!1;this.listeners[t]||(this.listeners[t]=[],r=!0),this.listeners[t].push(n);const s=this.windowListeners[t];s&&!s.registered&&this.addWindowListener(s),r&&this.sendRetainedArgumentsForEvent(t);const l=async()=>this.removeListener(t,n);return Promise.resolve({remove:l})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,n,r){const a=this.listeners[t];if(!a){if(r){let s=this.retainedEventArguments[t];s||(s=[]),s.push(n),this.retainedEventArguments[t]=s}return}a.forEach(s=>s(n))}hasListeners(t){var n;return!!(!((n=this.listeners[t])===null||n===void 0)&&n.length)}registerWindowListener(t,n){this.windowListeners[n]={registered:!1,windowEventName:t,pluginEventName:n,handler:r=>{this.notifyListeners(n,r)}}}unimplemented(t="not implemented"){return new hp.Exception(t,Uu.Unimplemented)}unavailable(t="not available"){return new hp.Exception(t,Uu.Unavailable)}async removeListener(t,n){const r=this.listeners[t];if(!r)return;const a=r.indexOf(n);this.listeners[t].splice(a,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const n=this.retainedEventArguments[t];n&&(delete this.retainedEventArguments[t],n.forEach(r=>{this.notifyListeners(t,r)}))}}const nA=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),rA=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class GV extends W1{async getCookies(){const t=document.cookie,n={};return t.split(";").forEach(r=>{if(r.length<=0)return;let[a,s]=r.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");a=rA(a).trim(),s=rA(s).trim(),n[a]=s}),n}async setCookie(t){try{const n=nA(t.key),r=nA(t.value),a=t.expires?`; expires=${t.expires.replace("expires=","")}`:"",s=(t.path||"/").replace("path=",""),l=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${n}=${r||""}${a}; path=${s}; ${l};`}catch(n){return Promise.reject(n)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const n of t)document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}T0("CapacitorCookies",{web:()=>new GV});const KV=async e=>new Promise((t,n)=>{const r=new FileReader;r.onload=()=>{const a=r.result;t(a.indexOf(",")>=0?a.split(",")[1]:a)},r.onerror=a=>n(a),r.readAsDataURL(e)}),VV=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(a=>a.toLocaleLowerCase()).reduce((a,s,l)=>(a[s]=e[t[l]],a),{})},WV=(e,t=!0)=>e?Object.entries(e).reduce((r,a)=>{const[s,l]=a;let u,d;return Array.isArray(l)?(d="",l.forEach(f=>{u=t?encodeURIComponent(f):f,d+=`${s}=${u}&`}),d.slice(0,-1)):(u=t?encodeURIComponent(l):l,d=`${s}=${u}`),`${r}&${d}`},"").substr(1):null,XV=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),a=VV(e.headers)["content-type"]||"";if(typeof e.data=="string")n.body=e.data;else if(a.includes("application/x-www-form-urlencoded")){const s=new URLSearchParams;for(const[l,u]of Object.entries(e.data||{}))s.set(l,u);n.body=s.toString()}else if(a.includes("multipart/form-data")||e.data instanceof FormData){const s=new FormData;if(e.data instanceof FormData)e.data.forEach((u,d)=>{s.append(d,u)});else for(const u of Object.keys(e.data))s.append(u,e.data[u]);n.body=s;const l=new Headers(n.headers);l.delete("content-type"),n.headers=l}else(a.includes("application/json")||typeof e.data=="object")&&(n.body=JSON.stringify(e.data));return n};class QV extends W1{async request(t){const n=XV(t,t.webFetchExtra),r=WV(t.params,t.shouldEncodeUrlParams),a=r?`${t.url}?${r}`:t.url,s=await fetch(a,n),l=s.headers.get("content-type")||"";let{responseType:u="text"}=s.ok?t:{};l.includes("application/json")&&(u="json");let d,f;switch(u){case"arraybuffer":case"blob":f=await s.blob(),d=await KV(f);break;case"json":d=await s.json();break;case"document":case"text":default:d=await s.text()}const m={};return s.headers.forEach((p,b)=>{m[b]=p}),{data:d,headers:m,status:s.status,url:s.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}T0("CapacitorHttp",{web:()=>new QV});var aA;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(aA||(aA={}));var iA;(function(e){e.StatusBar="StatusBar",e.NavigationBar="NavigationBar"})(iA||(iA={}));class ZV extends W1{async setStyle(){this.unavailable("not available for web")}async setAnimation(){this.unavailable("not available for web")}async show(){this.unavailable("not available for web")}async hide(){this.unavailable("not available for web")}}T0("SystemBars",{web:()=>new ZV});const JV="modulepreload",eW=function(e){return"/"+e},sA={},tW=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let l=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),d=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));a=l(n.map(f=>{if(f=eW(f),f in sA)return;sA[f]=!0;const m=f.endsWith(".css"),p=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${p}`))return;const b=document.createElement("link");if(b.rel=m?"stylesheet":JV,m||(b.as="script"),b.crossOrigin="",b.href=f,d&&b.setAttribute("nonce",d),document.head.appendChild(b),m)return new Promise((x,E)=>{b.addEventListener("load",x),b.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return a.then(l=>{for(const u of l||[])u.status==="rejected"&&s(u.reason);return t().catch(s)})},bu=T0("SpeechRecognition",{web:()=>tW(()=>import("./web-BV4h1AI4.js"),[]).then(e=>new e.SpeechRecognitionWeb)});function nW(e,t){const n=e.length,r=new ArrayBuffer(44+n*2),a=new DataView(r),s=(l,u)=>{for(let d=0;d<u.length;d++)a.setUint8(l+d,u.charCodeAt(d))};s(0,"RIFF"),a.setUint32(4,36+n*2,!0),s(8,"WAVE"),s(12,"fmt "),a.setUint32(16,16,!0),a.setUint16(20,1,!0),a.setUint16(22,1,!0),a.setUint32(24,t,!0),a.setUint32(28,t*2,!0),a.setUint16(32,2,!0),a.setUint16(34,16,!0),s(36,"data"),a.setUint32(40,n*2,!0);for(let l=0;l<n;l++){const u=Math.max(-1,Math.min(1,e[l]));a.setInt16(44+l*2,u<0?u*32768:u*32767,!0)}return new Blob([r],{type:"audio/wav"})}const cv=hp.isNativePlatform(),ey=!cv&&typeof window<"u"?window.SpeechRecognition??window.webkitSpeechRecognition:void 0,ty=16e3;function rW(e="zh-CN"){const[t,n]=v.useState(!1),[r,a]=v.useState(""),[s,l]=v.useState(""),[u,d]=v.useState(null),[f,m]=v.useState(0),[p,b]=v.useState("idle"),x=v.useRef(null),E=v.useRef(!1),N=v.useRef([]),w=v.useRef(!1),T=v.useRef(null),C=v.useRef(!1),A=v.useRef(""),k=v.useRef(null),R=v.useRef(null),O=v.useRef(null),j=v.useRef([]),F=v.useRef(!1),D=!0,M=v.useCallback(async()=>{var B,me,le;(B=O.current)==null||B.disconnect(),(me=R.current)==null||me.getTracks().forEach(z=>z.stop()),await((le=k.current)==null?void 0:le.close().catch(()=>{}));const H=j.current;if(j.current=[],O.current=null,R.current=null,k.current=null,H.length===0||F.current){n(!1),b("idle");return}l("识别中…"),b("recognizing");const $=H.reduce((z,fe)=>z+fe.length,0),V=new Float32Array($);let L=0;for(const z of H)V.set(z,L),L+=z.length;const P=nW(V,ty),ee=new FormData;ee.append("audio",P,"recording.wav");try{const z=await fetch("/api/transcribe",{method:"POST",body:ee});if(F.current)return;if(z.ok){const{text:fe}=await z.json();fe?(a(fe),b("done")):b("idle")}else{const fe=await z.json().catch(()=>({error:`HTTP ${z.status}`}));d(fe.error??`HTTP ${z.status}`),b("idle")}}catch(z){d(`语音识别失败:${z instanceof Error?z.message:String(z)}`),b("idle")}finally{l(""),n(!1)}},[]),q=v.useCallback(async()=>{if(E.current=!0,T.current&&(clearTimeout(T.current),T.current=null),cv){await bu.stop().catch(()=>{});for(const H of N.current)await H.remove().catch(()=>{});N.current=[],n(!1),l("")}else x.current?x.current.stop():k.current?await M():(n(!1),b("idle"))},[M]),G=v.useCallback(async()=>{var L;F.current=!1,a(""),l(""),d(null),b("idle");const{available:H}=await bu.available();if(!H){d("当前设备不支持语音识别");return}if((await bu.requestPermissions()).speechRecognition!=="granted"){d("请允许语音识别权限");return}const V=[];V.push(await bu.addListener("partialResults",P=>{l(P.matches[0]??"")})),V.push(await bu.addListener("listeningState",P=>{const ee=P.status==="started";n(ee),ee&&b("recording"),ee||l("")})),N.current=V;try{const P=await bu.start({language:e,partialResults:!0,maxResults:1});(L=P.matches)!=null&&L.length&&a(ee=>ee+P.matches.join(""))}catch(P){d(`语音识别错误:${P instanceof Error?P.message:String(P)}`);for(const ee of V)await ee.remove().catch(()=>{});N.current=[]}},[e]),ae=v.useCallback(()=>{if(!ey)return!1;F.current=!1,a(""),l(""),A.current="",d(null),b("idle"),E.current=!1;const H=new ey;H.lang=e,H.continuous=!0,H.interimResults=!0,H.maxAlternatives=1,H.onstart=()=>{n(!0),b("recording"),w.current=!1,T.current=setTimeout(()=>{!w.current&&!E.current&&(C.current=!0,E.current=!0,H.stop(),d("语音识别服务不可用(Chrome/Edge 需连接 Google 服务器),下次将使用服务端识别"))},5e3)},H.onresult=$=>{w.current=!0,T.current&&(clearTimeout(T.current),T.current=null);let V="",L="";for(let P=$.resultIndex;P<$.results.length;P++){const ee=$.results[P][0].transcript;$.results[P].isFinal?V+=ee:L+=ee}V&&a(P=>P+V),l(L),A.current=L},H.onerror=$=>{switch($.error!=="no-speech"&&$.error!=="aborted"&&(E.current=!0),$.error){case"not-allowed":d("请允许麦克风权限");break;case"network":d("网络错误,请检查连接");break;case"no-speech":case"aborted":return;default:d(`语音识别错误:${$.error}`)}},H.onend=()=>{if(E.current&&A.current&&a($=>$+A.current),l(""),A.current="",!E.current)try{H.start();return}catch{}n(!1),x.current=null},x.current=H;try{return H.start(),!0}catch{return!1}},[e]),Q=v.useCallback(async()=>{F.current=!1,a(""),l(""),d(null),b("idle");try{const P=await fetch("/api/transcribe/status"),{available:ee}=await P.json();if(!ee){d("语音识别服务未就绪,请稍后重试");return}}catch{d("无法连接语音识别服务");return}let H;try{H=await navigator.mediaDevices.getUserMedia({audio:{sampleRate:ty,channelCount:1}})}catch{d("请允许麦克风权限");return}const $=new AudioContext({sampleRate:ty}),V=$.createMediaStreamSource(H),L=$.createScriptProcessor(4096,1,1);j.current=[],L.onaudioprocess=P=>{j.current.push(new Float32Array(P.inputBuffer.getChannelData(0)))},V.connect(L),L.connect($.destination),k.current=$,R.current=H,O.current=L,n(!0),b("recording")},[]),W=v.useCallback(()=>{cv?G():ey&&!C.current&&ae()||Q()},[G,ae,Q]);v.useEffect(()=>{if(!t){m(0);return}if(x.current)return;let H=!1,$=null,V=null,L=0;return(async()=>{try{if($=await navigator.mediaDevices.getUserMedia({audio:!0}),H){$.getTracks().forEach(z=>z.stop());return}V=new AudioContext;const P=V.createMediaStreamSource($),ee=V.createAnalyser();ee.fftSize=256,P.connect(ee);const B=new Uint8Array(ee.frequencyBinCount);let me=0;const le=()=>{if(H)return;ee.getByteFrequencyData(B);const z=performance.now();if(z-me>80){let fe=0;for(let Oe=0;Oe<B.length;Oe++)fe+=B[Oe];m(fe/(B.length*255)),me=z}L=requestAnimationFrame(le)};L=requestAnimationFrame(le)}catch{}})(),()=>{H=!0,cancelAnimationFrame(L),$==null||$.getTracks().forEach(P=>P.stop()),V==null||V.close().catch(()=>{}),m(0)}},[t]),v.useEffect(()=>{!t&&p==="recording"&&b(r?"done":"idle")},[t,p,r]),v.useEffect(()=>()=>{var H,$,V,L;E.current=!0,(H=x.current)==null||H.stop(),($=O.current)==null||$.disconnect(),(V=R.current)==null||V.getTracks().forEach(P=>P.stop()),(L=k.current)==null||L.close().catch(()=>{});for(const P of N.current)P.remove().catch(()=>{})},[]);const K=v.useCallback(()=>{F.current=!0,a(""),l(""),A.current="",b("idle")},[]);return{isSupported:D,isListening:t,phase:p,transcript:r,interimTranscript:s,error:u,volumeLevel:f,start:W,stop:q,resetTranscript:K}}const aW=240,iW=1e3;function DR(e){const t=rW(),[n,r]=v.useState(""),[a,s]=v.useState(0),l=v.useRef(null),u=v.useRef(null),d=v.useRef(0);v.useEffect(()=>(t.phase==="recording"?(d.current=Date.now(),s(0),u.current=setInterval(()=>{s(Math.floor((Date.now()-d.current)/1e3))},iW)):u.current&&(clearInterval(u.current),u.current=null),()=>{u.current&&(clearInterval(u.current),u.current=null)}),[t.phase]),v.useEffect(()=>{t.phase==="done"&&(r(t.transcript),requestAnimationFrame(()=>{const b=l.current;b&&(b.focus(),b.setSelectionRange(b.value.length,b.value.length))}))},[t.phase,t.transcript]),v.useLayoutEffect(()=>{if(t.phase!=="done")return;const b=l.current;b&&(b.style.height="auto",b.style.height=`${Math.min(b.scrollHeight,aW)}px`)},[t.phase,n]);const f=v.useCallback(()=>{t.stop(),t.resetTranscript(),r("")},[t]),m=v.useCallback(async()=>{const b=n.trim();if(!b){f();return}await e(b)!==!1&&(t.resetTranscript(),r(""))},[n,e,f,t]);v.useEffect(()=>{if(t.phase==="idle")return;const b=x=>{if(x.key==="Escape"&&t.phase!=="recognizing"){x.preventDefault(),f();return}if(t.phase==="done"&&x.key==="Enter"&&(x.metaKey||x.ctrlKey)){if(x.isComposing)return;x.preventDefault(),m()}};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[t.phase,f,m]);const p=v.useCallback(b=>{b.nativeEvent.isComposing||b.keyCode===229||b.key==="Enter"&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),m())},[m]);return{stt:t,editText:n,setEditText:r,elapsed:a,textareaRef:l,cancel:f,confirm:m,handleTextareaKeyDown:p}}const il=ei(e=>({agents:[],loaded:!1,loadAgents:async()=>{const t=Fe.getState().activeRepoId;try{const n=t?await lI(t):await aI();e({agents:n,loaded:!0})}catch{e({loaded:!0})}}}));function sW(e){if(typeof e!="string")return e;const t=e.trim();if(t)try{return JSON.parse(t)}catch{return t}}function Gn(e){return e&&typeof e=="object"?e:null}function To(e){const t=Gn(e);return t&&"properties"in t?t.properties:e}function lW(e){const t=Gn(e);return typeof(t==null?void 0:t.type)=="string"?t.type:void 0}function oW(e){const t=Gn(To(e));if(!t)return null;const n=Gn(t.info);if(n&&typeof n.id=="string"){const a=Array.isArray(t.parts)?t.parts:void 0;return{...n,...a?{parts:a}:{}}}if(typeof t.id=="string"&&typeof t.role=="string")return t;const r=Gn(t.message);return r&&typeof r.id=="string"?r:null}function uW(e){const t=Gn(To(e));if(!t)return{};const n=Gn(t.part)??t;return typeof n.type!="string"?{}:{messageId:typeof n.messageID=="string"&&n.messageID||typeof n.messageId=="string"&&n.messageId||typeof t.messageID=="string"&&t.messageID||typeof t.messageId=="string"&&t.messageId||void 0,part:n}}function cW(e){const t=Gn(To(e));if(!t||t.field!=="text")return null;const n=typeof t.messageID=="string"?t.messageID:null,r=typeof t.partID=="string"?t.partID:null,a=typeof t.delta=="string"?t.delta:null;return!n||!r||a===null?null:{messageId:n,partId:r,delta:a}}function dW(e){const t=To(e);if(Array.isArray(t))return t;const n=Gn(t);return n&&Array.isArray(n.todos)?n.todos:[]}function ci(e){return typeof e=="number"?e:0}function fW(e){const t=Gn(To(e));if(!t||typeof t.id!="string")return null;const n={id:t.id};typeof t.title=="string"&&(n.title=t.title),typeof t.agent=="string"&&(n.agent=t.agent),typeof t.cost=="number"&&(n.cost=t.cost);const r=typeof t.parentID=="string"?t.parentID:typeof t.parent_id=="string"?t.parent_id:void 0;r&&(n.parentID=r);const a=Gn(t.tokens),s=typeof t.tokens_input=="number"||typeof t.tokens_output=="number";if(a||s){const u=a?Gn(a.cache):null;n.tokens={input:ci(a==null?void 0:a.input)||ci(t.tokens_input),output:ci(a==null?void 0:a.output)||ci(t.tokens_output),reasoning:ci(a==null?void 0:a.reasoning)||ci(t.tokens_reasoning),cache:{read:ci(u==null?void 0:u.read)||ci(t.tokens_cache_read),write:ci(u==null?void 0:u.write)||ci(t.tokens_cache_write)}}}const l=Gn(t.model);return l&&(n.model={providerID:typeof l.providerID=="string"?l.providerID:void 0,modelID:typeof l.modelID=="string"?l.modelID:void 0,variant:typeof l.variant=="string"?l.variant:void 0}),n}function hW(e){const t=Gn(To(e));if(!t)return null;if(typeof t.message=="string")return t.message;const n=Gn(t.error);if(n){const r=Gn(n.data);if(typeof(r==null?void 0:r.message)=="string")return`${n.name??"Error"}: ${r.message}`;if(typeof n.message=="string")return`${n.name??"Error"}: ${n.message}`;if(typeof n.name=="string")return String(n.name)}return typeof t.reason=="string"?t.reason:null}function mW(e){const t=To(e);if(typeof t=="string")return t;const n=Gn(t);if(typeof(n==null?void 0:n.status)=="string")return n.status;const r=Gn(n==null?void 0:n.status);return typeof(r==null?void 0:r.type)=="string"?r.type:typeof(n==null?void 0:n.type)=="string"?n.type:null}function pW(e,t,n,r){switch(e==="message"||e===""?lW(t)??e:e){case"message.updated":{const s=oW(t);s&&r.updateMessage(n,s);break}case"session.updated":{const s=fW(t);s&&r.updateSessionInfo(s);break}case"message.part.updated":{const{messageId:s,part:l}=uW(t);l&&s&&r.updateMessagePart(n,s,l);break}case"message.part.delta":{const s=cW(t);s&&r.appendMessagePartDelta(n,s.messageId,s.partId,s.delta);break}case"todo.updated":{r.updateTodos(n,dW(t));break}case"session.status":{const s=mW(t);s&&r.setSessionStatus(n,s);break}case"session.idle":{r.setSessionStatus(n,"idle");break}case"session.error":{const s=hW(t);r.setSessionStatus(n,"error",s??void 0);break}}}const gW=600*1e3;class bW{constructor(t,n){un(this,"sessionId");un(this,"idleTimer",null);un(this,"active",!1);un(this,"alive",!0);un(this,"callbacks");this.sessionId=t,this.callbacks=n,this.resetIdleTimer()}dispatch(t,n){if(!this.alive)return;this.resetIdleTimer();const r=Le.getState();pW(t,n,this.sessionId,r)}activate(){this.active=!0,this.clearIdleTimer()}deactivate(){this.active=!1,this.resetIdleTimer()}refreshOnIdle(){Le.getState().refreshSessionData(this.sessionId)}stop(){this.alive=!1,this.clearIdleTimer()}resetIdleTimer(){this.clearIdleTimer(),!this.active&&(this.idleTimer=setTimeout(()=>{this.callbacks.onWorkerIdle(this.sessionId)},gW))}clearIdleTimer(){this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null)}}const xW=1e3,yW=3e4;class vW{constructor(t,n){un(this,"source",null);un(this,"reconnectTimer",null);un(this,"attempts",0);un(this,"disposed",!1);un(this,"repoId");un(this,"onEvent");this.repoId=t,this.onEvent=n}start(){this.connect()}stop(){var t;this.disposed=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(t=this.source)==null||t.close(),this.source=null}connect(){if(this.disposed)return;const t=RF(this.repoId),n=new EventSource(t);this.source=n,n.onopen=()=>{this.attempts=0},n.onmessage=a=>{this.handleRaw("message",a)};const r=["message.updated","message.part.updated","message.part.delta","message.removed","todo.updated","session.status","session.idle","session.error","session.updated"];for(const a of r)n.addEventListener(a,s=>{this.handleRaw(a,s)});n.onerror=()=>{if(!(this.disposed||!this.source)&&this.source.readyState===EventSource.CLOSED){this.source.close(),this.source=null;const a=Math.min(xW*2**this.attempts,yW);this.attempts++,this.reconnectTimer=setTimeout(()=>this.connect(),a)}}}handleRaw(t,n){if(!(n instanceof MessageEvent))return;const r=sW(n.data);if(r===void 0)return;const a=this.extractSessionId(r);if(!a)return;let s=t;if(t==="message"||t===""){const l=r&&typeof r=="object"?r:null;typeof(l==null?void 0:l.type)=="string"&&(s=l.type)}this.onEvent(a,s,r)}extractSessionId(t){if(!t||typeof t!="object")return null;const n=t;if(n.properties&&typeof n.properties=="object"){const r=n.properties;if(typeof r.sessionID=="string")return r.sessionID;if(typeof r.id=="string")return r.id}return typeof n.sessionID=="string"?n.sessionID:typeof n.sessionId=="string"?n.sessionId:null}}const EW=6e4;class NW{constructor(t){un(this,"timer",null);un(this,"paused",!1);un(this,"callbacks");this.callbacks=t}start(){this.tick(),this.timer=setInterval(()=>{this.paused||this.tick()},EW)}stop(){this.timer&&(clearInterval(this.timer),this.timer=null)}pause(){this.paused=!0}resume(){this.paused=!1,this.tick()}tick(){const t=Fe.getState().activeRepoId;t&&(Le.getState().loadSessions(),MF(t).then(n=>{const r={};for(const[a,s]of Object.entries(n))r[a]=s.type??"idle";Le.getState().bulkSetStatuses(r);for(const[a,s]of Object.entries(r))(s==="busy"||s==="retry")&&this.callbacks.ensureWorker(a)}).catch(()=>{}))}}class _W{constructor(){un(this,"workers",new Map);un(this,"dispatcher",null);un(this,"supervisor",null);un(this,"visibilityHandler",null)}start(t){this.stop();const n={onWorkerIdle:r=>this.removeWorker(r)};this.dispatcher=new vW(t,(r,a,s)=>{const l=this.ensureWorker(r,n);if(a==="session.idle"||a==="session.status"){const u=Le.getState().sessionStatuses[r];l.dispatch(a,s);const d=Le.getState().sessionStatuses[r];u&&u!=="idle"&&d==="idle"&&l.refreshOnIdle()}else l.dispatch(a,s)}),this.dispatcher.start(),this.supervisor=new NW({ensureWorker:r=>this.ensureWorker(r,n)}),this.supervisor.start(),this.visibilityHandler=()=>{var r,a;document.hidden?(r=this.supervisor)==null||r.pause():(a=this.supervisor)==null||a.resume()},document.addEventListener("visibilitychange",this.visibilityHandler)}stop(){var t,n;(t=this.dispatcher)==null||t.stop(),this.dispatcher=null,(n=this.supervisor)==null||n.stop(),this.supervisor=null;for(const r of this.workers.values())r.stop();this.workers.clear(),this.visibilityHandler&&(document.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=null)}activateSession(t){for(const a of this.workers.values())a.sessionId!==t&&a.deactivate();if(!t)return;const n={onWorkerIdle:a=>this.removeWorker(a)};this.ensureWorker(t,n).activate(),Le.getState().refreshSessionData(t)}deactivateSession(t){var n;(n=this.workers.get(t))==null||n.deactivate()}ensureWorker(t,n){let r=this.workers.get(t);return r||(r=new bW(t,n),this.workers.set(t,r)),r}removeWorker(t){const n=Le.getState().activeSessionId;if(t===n)return;const r=this.workers.get(t);r&&(r.stop(),this.workers.delete(t))}}const mp=new _W,lA=(function(e,t,n){const r=Of(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),So=(function(e){if(e==null)return wW;if(typeof e=="string")return SW(e);if(typeof e=="object")return TW(e);if(typeof e=="function")return X1(e);throw new Error("Expected function, string, or array as `test`")});function TW(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=So(e[n]);return X1(r);function r(...a){let s=-1;for(;++s<t.length;)if(t[s].apply(this,a))return!0;return!1}}function SW(e){return X1(t);function t(n){return n.tagName===e}}function X1(e){return t;function t(n,r,a){return!!(AW(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function wW(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function AW(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const oA=/\n/g,uA=/[\t ]+/g,dv=So("br"),cA=So(DW),CW=So("p"),dA=So("tr"),kW=So(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",jW,LW]),LR=So(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function OW(e,t){const n=t||{},r="children"in e?e.children:[],a=LR(e),s=UR(e,{whitespace:n.whitespace||"normal"}),l=[];(e.type==="text"||e.type==="comment")&&l.push(...BR(e,{breakBefore:!0,breakAfter:!0}));let u=-1;for(;++u<r.length;)l.push(...PR(r[u],e,{whitespace:s,breakBefore:u?void 0:a,breakAfter:u<r.length-1?dv(r[u+1]):a}));const d=[];let f;for(u=-1;++u<l.length;){const m=l[u];typeof m=="number"?f!==void 0&&m>f&&(f=m):m&&(f!==void 0&&f>-1&&d.push(`
|
|
529
529
|
`.repeat(f)||" "),f=-1,d.push(m))}return d.join("")}function PR(e,t,n){return e.type==="element"?IW(e,t,n):e.type==="text"?n.whitespace==="normal"?BR(e,n):RW(e):[]}function IW(e,t,n){const r=UR(e,n),a=e.children||[];let s=-1,l=[];if(kW(e))return l;let u,d;for(dv(e)||dA(e)&&lA(t,e,dA)?d=`
|
|
530
530
|
`:CW(e)?(u=2,d=2):LR(e)&&(u=1,d=1);++s<a.length;)l=l.concat(PR(a[s],e,{whitespace:r,breakBefore:s?void 0:u,breakAfter:s<a.length-1?dv(a[s+1]):d}));return cA(e)&&lA(t,e,cA)&&l.push(" "),u&&l.unshift(u),d&&l.push(d),l}function BR(e,t){const n=String(e.value),r=[],a=[];let s=0;for(;s<=n.length;){oA.lastIndex=s;const d=oA.exec(n),f=d&&"index"in d?d.index:n.length;r.push(MW(n.slice(s,f).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),s===0?t.breakBefore:!0,f===n.length?t.breakAfter:!0)),s=f+1}let l=-1,u;for(;++l<r.length;)r[l].charCodeAt(r[l].length-1)===8203||l<r.length-1&&r[l+1].charCodeAt(0)===8203?(a.push(r[l]),u=void 0):r[l]?(typeof u=="number"&&a.push(u),a.push(r[l]),u=0):(l===0||l===r.length-1)&&a.push(0);return a}function RW(e){return[String(e.value)]}function MW(e,t,n){const r=[];let a=0,s;for(;a<e.length;){uA.lastIndex=a;const l=uA.exec(e);s=l?l.index:e.length,!a&&!s&&l&&!t&&r.push(""),a!==s&&r.push(e.slice(a,s)),a=l?s+l[0].length:s}return a!==s&&!n&&r.push(""),r.join(" ")}function UR(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function jW(e){return!!(e.properties||{}).hidden}function DW(e){return e.tagName==="td"||e.tagName==="th"}function LW(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function PW(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",l="(?!struct)("+r+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",u={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},f={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},m={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(f,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},b={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},x=t.optional(a)+e.IDENT_RE+"\\s*\\(",E=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],N=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],T=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],k={type:N,keyword:E,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},R={className:"function.dispatch",relevance:0,keywords:{_hint:T},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},O=[R,p,u,n,e.C_BLOCK_COMMENT_MODE,m,f],j={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:k,contains:O.concat([{begin:/\(/,end:/\)/,keywords:k,contains:O.concat(["self"]),relevance:0}]),relevance:0},F={className:"function",begin:"("+l+"[\\*&\\s]+)+"+x,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:k,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:k,relevance:0},{begin:x,returnBegin:!0,contains:[b],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[f,m]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:k,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,f,m,u,{begin:/\(/,end:/\)/,keywords:k,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,f,m,u]}]},u,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:k,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(j,F,R,O,[p,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:k,contains:["self",u]},{begin:e.IDENT_RE+"::",keywords:k},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function BW(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=PW(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function UW(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),l={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},u={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,a]};a.contains.push(u);const d={match:/\\"/},f={className:"string",begin:/'/,end:/'/},m={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},b=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],x=e.SHEBANG({binary:`(${b.join("|")})`,relevance:10}),E={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},N=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],w=["true","false"],T={match:/(\/[a-z._-]+)+/},C=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],A=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],k=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],R=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:N,literal:w,built_in:[...C,...A,"set","shopt",...k,...R]},contains:[x,e.SHEBANG(),E,p,s,l,T,u,d,f,m,n]}}function zW(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",l="("+r+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",u={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},f={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},m={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(f,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},b={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},x=t.optional(a)+e.IDENT_RE+"\\s*\\(",w={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},T=[p,u,n,e.C_BLOCK_COMMENT_MODE,m,f],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:w,contains:T.concat([{begin:/\(/,end:/\)/,keywords:w,contains:T.concat(["self"]),relevance:0}]),relevance:0},A={begin:"("+l+"[\\*&\\s]+)+"+x,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:w,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:w,relevance:0},{begin:x,returnBegin:!0,contains:[e.inherit(b,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,f,m,u,{begin:/\(/,end:/\)/,keywords:w,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,f,m,u]}]},u,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C",aliases:["h"],keywords:w,disableAutodetect:!0,illegal:"</",contains:[].concat(C,A,T,[p,{begin:e.IDENT_RE+"::",keywords:w},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:p,strings:f,keywords:w}}}function FW(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",l="(?!struct)("+r+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",u={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},f={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},m={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(f,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},b={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},x=t.optional(a)+e.IDENT_RE+"\\s*\\(",E=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],N=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],w=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],T=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],k={type:N,keyword:E,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:w},R={className:"function.dispatch",relevance:0,keywords:{_hint:T},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},O=[R,p,u,n,e.C_BLOCK_COMMENT_MODE,m,f],j={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:k,contains:O.concat([{begin:/\(/,end:/\)/,keywords:k,contains:O.concat(["self"]),relevance:0}]),relevance:0},F={className:"function",begin:"("+l+"[\\*&\\s]+)+"+x,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:k,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:k,relevance:0},{begin:x,returnBegin:!0,contains:[b],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[f,m]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:k,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,f,m,u,{begin:/\(/,end:/\)/,keywords:k,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,f,m,u]}]},u,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:k,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(j,F,R,O,[p,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:k,contains:["self",u]},{begin:e.IDENT_RE+"::",keywords:k},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function HW(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],a=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],l={keyword:a.concat(s),built_in:t,literal:r},u=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),d={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},f={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},m={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},p=e.inherit(m,{illegal:/\n/}),b={className:"subst",begin:/\{/,end:/\}/,keywords:l},x=e.inherit(b,{illegal:/\n/}),E={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,x]},N={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},b]},w=e.inherit(N,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},x]});b.contains=[N,E,m,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,e.C_BLOCK_COMMENT_MODE],x.contains=[w,E,p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const T={variants:[f,N,E,m,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},C={begin:"<",end:">",contains:[{beginKeywords:"in out"},u]},A=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",k={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:l,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},T,d,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},u,C,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[u,C,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+A+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:l,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,C],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,relevance:0,contains:[T,d,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},k]}}const $W=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),YW=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],qW=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],GW=[...YW,...qW],KW=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),VW=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),WW=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),XW=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function QW(e){const t=e.regex,n=$W(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},a="and or not only",s=/@-?\w[\w]*(-\w+)*/,l="[a-zA-Z-][a-zA-Z0-9_-]*",u=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+l,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+VW.join("|")+")"},{begin:":(:)?("+WW.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+XW.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...u,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...u,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:KW.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...u,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+GW.join("|")+")\\b"}]}}function ZW(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function JW(e){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:s,illegal:/["']/}]}]}}function eX(e){const t=e.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(n,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function tX(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const a={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},s={className:"literal",begin:/\bon|off|true|false|yes|no\b/},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},u={begin:/\[/,end:/\]/,contains:[r,s,a,l,n,"self"],relevance:0},d=/[A-Za-z0-9_-]+/,f=/"(\\"|[^"])*"/,m=/'[^']*'/,p=t.either(d,f,m),b=t.concat(p,"(\\s*\\.\\s*",p,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:b,className:"attr",starts:{end:/$/,contains:[r,u,s,a,l,n]}}]}}var wu="[0-9](_*[0-9])*",ym=`\\.(${wu})`,vm="[0-9a-fA-F](_*[0-9a-fA-F])*",fA={className:"number",variants:[{begin:`(\\b(${wu})((${ym})|\\.)?|(${ym}))[eE][+-]?(${wu})[fFdD]?\\b`},{begin:`\\b(${wu})((${ym})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${ym})[fFdD]?\\b`},{begin:`\\b(${wu})[fFdD]\\b`},{begin:`\\b0[xX]((${vm})\\.?|(${vm})?\\.(${vm}))[pP][+-]?(${wu})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${vm})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function zR(e,t,n){return n===-1?"":e.replace(t,r=>zR(e,t,n-1))}function nX(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+zR("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),d={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},f={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},m={className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:d,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[m,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:d,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,fA,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},fA,f]}}const hA="[A-Za-z$_][0-9A-Za-z$_]*",rX=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],aX=["true","false","null","undefined","NaN","Infinity"],FR=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],HR=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],$R=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],iX=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],sX=[].concat($R,FR,HR);function lX(e){const t=e.regex,n=($,{after:V})=>{const L="</"+$[0].slice(1);return $.input.indexOf(L,V)!==-1},r=hA,a={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:($,V)=>{const L=$[0].length+$.index,P=$.input[L];if(P==="<"||P===","){V.ignoreMatch();return}P===">"&&(n($,{after:L})||V.ignoreMatch());let ee;const B=$.input.substring(L);if(ee=B.match(/^\s*=/)){V.ignoreMatch();return}if((ee=B.match(/^\s+extends\s+/))&&ee.index===0){V.ignoreMatch();return}}},u={$pattern:hA,keyword:rX,literal:aX,built_in:sX,"variable.language":iX},d="[0-9](_?[0-9])*",f=`\\.(${d})`,m="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${m})((${f})|\\.)?|(${f}))[eE][+-]?(${d})\\b`},{begin:`\\b(${m})\\b((${f})\\b|\\.)?|(${f})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},b={className:"subst",begin:"\\$\\{",end:"\\}",keywords:u,contains:[]},x={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:"xml"}},E={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:"css"}},N={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,b],subLanguage:"graphql"}},w={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,b]},C={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},A=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,E,N,w,{match:/\$\d+/},p];b.contains=A.concat({begin:/\{/,end:/\}/,keywords:u,contains:["self"].concat(A)});const k=[].concat(C,b.contains),R=k.concat([{begin:/(\s*)\(/,end:/\)/,keywords:u,contains:["self"].concat(k)}]),O={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:R},j={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},F={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...FR,...HR]}},D={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},M={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G($){return t.concat("(?!",$.join("|"),")")}const ae={match:t.concat(/\b/,G([...$R,"super","import"].map($=>`${$}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},Q={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},W={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},K="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",H={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(K)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:u,exports:{PARAMS_CONTAINS:R,CLASS_REFERENCE:F},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),D,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,E,N,w,C,{match:/\$\d+/},p,F,{scope:"attr",match:r+t.lookahead(":"),relevance:0},H,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[C,e.REGEXP_MODE,{className:"function",begin:K,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,contains:R}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:s},{begin:l.begin,"on:begin":l.isTrulyOpeningTag,end:l.end}],subLanguage:"xml",contains:[{begin:l.begin,end:l.end,skip:!0,contains:["self"]}]}]},M,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[O,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},Q,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},ae,q,j,W,{match:/\$[(.]/}]}}function oX(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],a={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,a,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Au="[0-9](_*[0-9])*",Em=`\\.(${Au})`,Nm="[0-9a-fA-F](_*[0-9a-fA-F])*",uX={className:"number",variants:[{begin:`(\\b(${Au})((${Em})|\\.)?|(${Em}))[eE][+-]?(${Au})[fFdD]?\\b`},{begin:`\\b(${Au})((${Em})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Em})[fFdD]?\\b`},{begin:`\\b(${Au})[fFdD]\\b`},{begin:`\\b0[xX]((${Nm})\\.?|(${Nm})?\\.(${Nm}))[pP][+-]?(${Au})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Nm})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function cX(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},a={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},l={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,a]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,a]}]};a.contains.push(l);const u={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},d={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(l,{className:"string"}),"self"]}]},f=uX,m=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),p={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},b=p;return b.variants[1].contains=[p],p.variants[1].contains=[b],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,m,n,r,u,d,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[p,e.C_LINE_COMMENT_MODE,m],relevance:0},e.C_LINE_COMMENT_MODE,m,u,d,l,e.C_NUMBER_MODE]},m]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},u,d]},l,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
531
531
|
`},f]}}const dX=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),fX=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],hX=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],mX=[...fX,...hX],pX=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),YR=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),qR=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),gX=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),bX=YR.concat(qR).sort().reverse();function xX(e){const t=dX(e),n=bX,r="and or not only",a="[\\w-]+",s="("+a+"|@\\{"+a+"\\})",l=[],u=[],d=function(A){return{className:"string",begin:"~?"+A+".*?"+A}},f=function(A,k,R){return{className:A,begin:k,relevance:R}},m={$pattern:/[a-z-]+/,keyword:r,attribute:pX.join(" ")},p={begin:"\\(",end:"\\)",contains:u,keywords:m,relevance:0};u.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,d("'"),d('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,p,f("variable","@@?"+a,10),f("variable","@\\{"+a+"\\}"),f("built_in","~?`[^`]*?`"),{className:"attribute",begin:a+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const b=u.concat({begin:/\{/,end:/\}/,contains:l}),x={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(u)},E={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+gX.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:u}}]},N={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:m,returnEnd:!0,contains:u,relevance:0}},w={className:"variable",variants:[{begin:"@"+a+"\\s*:",relevance:15},{begin:"@"+a}],starts:{end:"[;}]",returnEnd:!0,contains:b}},T={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,x,f("keyword","all\\b"),f("variable","@\\{"+a+"\\}"),{begin:"\\b("+mX.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,f("selector-tag",s,0),f("selector-id","#"+s),f("selector-class","\\."+s,0),f("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+YR.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+qR.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:b},{begin:"!important"},t.FUNCTION_DISPATCH]},C={begin:a+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[T]};return l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,N,w,C,E,T,x,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:l}}function yX(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},a=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:a.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:a}].concat(a)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function vX(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,n]},a={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},s={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},l={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,r,a,s,l]}}function EX(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},a={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},l={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},u=/[A-Za-z][A-Za-z0-9+.-]*/,d={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,u,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},f={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},m={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},p=e.inherit(f,{contains:[]}),b=e.inherit(m,{contains:[]});f.contains.push(b),m.contains.push(p);let x=[n,d];return[f,m,p,b].forEach(T=>{T.contains=T.contains.concat(x)}),x=x.concat(f,m),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:x},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:x}]}]},n,s,f,m,{className:"quote",begin:"^>\\s+",contains:x,end:"$"},a,r,d,l,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function NX(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,u={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},d={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:u,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+d.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:d,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function _X(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,a={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:a},l={begin:/->\{/,end:/\}/},u={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},d={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[u]},f={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},m=[e.BACKSLASH_ESCAPE,s,d],p=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],b=(N,w,T="\\1")=>{const C=T==="\\1"?T:t.concat(T,w);return t.concat(t.concat("(?:",N,")"),w,/(?:\\.|[^\\\/])*?/,C,/(?:\\.|[^\\\/])*?/,T,r)},x=(N,w,T)=>t.concat(t.concat("(?:",N,")"),w,/(?:\\.|[^\\\/])*?/,T,r),E=[d,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),l,{className:"string",contains:m,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},f,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:b("s|tr|y",t.either(...p,{capture:!0}))},{begin:b("s|tr|y","\\(","\\)")},{begin:b("s|tr|y","\\[","\\]")},{begin:b("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:x("(?:m|qr)?",/\//,/\//)},{begin:x("m|qr",t.either(...p,{capture:!0}),/\1/)},{begin:x("m|qr",/\(/,/\)/)},{begin:x("m|qr",/\[/,/\]/)},{begin:x("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,u]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,u,f]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=E,l.contains=E,{name:"Perl",aliases:["pl","pm"],keywords:a,contains:E}}function TX(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),a=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=t.concat(/[A-Z]+/,n),l={scope:"variable",match:"\\$+"+r},u={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},d={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},f=e.inherit(e.APOS_STRING_MODE,{illegal:null}),m=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(d)}),p={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(d),"on:begin":(Q,W)=>{W.data._beginMatch=Q[1]||Q[2]},"on:end":(Q,W)=>{W.data._beginMatch!==Q[1]&&W.ignoreMatch()}},b=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),x=`[
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{W as e}from"./index-
|
|
1
|
+
import{W as e}from"./index-CGMcafOU.js";class t extends e{available(){throw this.unimplemented("Method not implemented on web.")}start(o){throw this.unimplemented("Method not implemented on web.")}stop(){throw this.unimplemented("Method not implemented on web.")}getSupportedLanguages(){throw this.unimplemented("Method not implemented on web.")}hasPermission(){throw this.unimplemented("Method not implemented on web.")}isListening(){throw this.unimplemented("Method not implemented on web.")}requestPermission(){throw this.unimplemented("Method not implemented on web.")}checkPermissions(){throw this.unimplemented("Method not implemented on web.")}requestPermissions(){throw this.unimplemented("Method not implemented on web.")}}const m=new t;export{m as SpeechRecognition,t as SpeechRecognitionWeb};
|
package/public/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, viewport-fit=cover" />
|
|
6
6
|
<title>Fourth Spark</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-CGMcafOU.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/assets/index-DG0lx_UT.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
File without changes
|