@inkeep/open-knowledge 0.5.1-beta.2 → 0.6.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/THIRD_PARTY_NOTICES.md +5 -0
  2. package/dist/assets/skills/open-knowledge/SKILL.md +1 -1
  3. package/dist/cli.mjs +4 -4
  4. package/dist/constants-JUZqR_Yu.mjs +2 -0
  5. package/dist/{dist-Du77nM-Z.mjs → dist-B_Nlx5d6.mjs} +15 -16
  6. package/dist/{dist-1yEbYw4s.mjs → dist-Bq1Nm7Hl.mjs} +1 -1
  7. package/dist/index.mjs +1 -1
  8. package/dist/init-DD_r2nwd.mjs +1 -0
  9. package/dist/{init-7R0gqPH8.mjs → init-pu_7zCAy.mjs} +4 -4
  10. package/dist/loader-CTWe5z9-.mjs +1 -0
  11. package/dist/{loader-BSh34YZr.mjs → loader-DwgxIIbN.mjs} +2 -2
  12. package/dist/{preview-BHPY2FqF.mjs → preview-Bep4xj-R.mjs} +2 -2
  13. package/dist/preview-DtrIs0gZ.mjs +1 -0
  14. package/dist/public/assets/{ActivityModeContent-CKlljrfV.js → ActivityModeContent-nwB2ciii.js} +1 -1
  15. package/dist/public/assets/DocumentContext-Bc83ypCd.js +52 -0
  16. package/dist/public/assets/{GraphPanel-BmKD3Ny9.js → GraphPanel-DwHnIo6r.js} +1 -1
  17. package/dist/public/assets/SettingsDialogBody-o-ExGcAl.js +11 -0
  18. package/dist/public/assets/{SourceEditor-CRzFUyZA.js → SourceEditor-DF322IKX.js} +1 -1
  19. package/dist/public/assets/{config-validation-events-DmUeQxLg.js → config-validation-events-BCNaZEDf.js} +3 -3
  20. package/dist/public/assets/{doc-hash-DYAtw4Za.js → doc-hash-BrKkCdCz.js} +147 -147
  21. package/dist/public/assets/index-Bzs40SFf.css +1 -0
  22. package/dist/public/assets/index-Izdfgq4i.js +1928 -0
  23. package/dist/public/assets/{target-navigation-intent-DFDZRZTp.js → target-navigation-intent-B5Xuyiwx.js} +1 -1
  24. package/dist/public/assets/{toggle-group-C3h-Kc3T.js → toggle-group-Cimrwku9.js} +1 -1
  25. package/dist/public/assets/{typing-burst-detector-jeT5tzuY.js → typing-burst-detector-ByUXt_f8.js} +1 -1
  26. package/dist/public/index.html +8 -8
  27. package/dist/{repair-launch-json-C_RgYLvE.mjs → repair-launch-json-ByfyoscN.mjs} +2 -2
  28. package/dist/{repair-mcp-configs-pSzTNIcD.mjs → repair-mcp-configs-D6LjdRhL.mjs} +2 -2
  29. package/dist/{src-CVO08UG0.mjs → src-DOCgFp9P.mjs} +2 -2
  30. package/dist/{start-COpYJN2M.mjs → start-CojePtz9.mjs} +2 -2
  31. package/dist/start-PJUtb0rl.mjs +1 -0
  32. package/package.json +1 -1
  33. package/dist/constants-B0k24D6C.mjs +0 -2
  34. package/dist/init-BXPcybnF.mjs +0 -1
  35. package/dist/loader-NzBnBsPS.mjs +0 -1
  36. package/dist/preview-D8Q9n_b7.mjs +0 -1
  37. package/dist/public/assets/DocumentContext-DT1j4EfY.js +0 -52
  38. package/dist/public/assets/SettingsDialogBody-DHtvo0Wh.js +0 -11
  39. package/dist/public/assets/index-BBU-QASR.css +0 -1
  40. package/dist/public/assets/index-BT_NIc6C.js +0 -1928
  41. package/dist/start-ChNxnH8-.mjs +0 -1
@@ -1,1928 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./telemetry-impl-BiWd9bHi.js","./chunk-CFjPhJqf.js","./preload-helper-2ej06EnG.js","./trace-api-3dczfLSc.js","./propagation-api-CobBjsTC.js","./ConsentDialogBody-BncX7dD1.js","./checkbox-CTrUepCv.js","./button-JrGyO3-P.js","./compiler-runtime-CVnuRdak.js","./dialog-bA5Nvc2p.js","./collapsible-DfUFsfqv.js","./textarea-CQGiqhkV.js","./project-paths-DKT5BePl.js","./McpConsentDialogBody-Dw8kQ_BH.js","./label-Bdsqm1CY.js","./mcp-consent-store-BPw6Zd40.js","./ActivityPanelDiffView-d4ec9M69.js","./ActivityPanelDiffView-legcy4jI.css","./GraphPanel-BmKD3Ny9.js","./doc-hash-DYAtw4Za.js","./w3c-keyname-BSTW6KzM.js","./toggle-group-C3h-Kc3T.js","./panel-CxlToFCs.js","./min-CHzARyU6.js","./src-Dz70a8sm.js","./colors-CuFmRbNJ.js","./ordinal-Dk6d5Y-0.js","./init-D-V7N9g_.js","./isObjectLike-HLvQwJYx.js","./now-BN_Nj6nz.js","./isSymbol-BKUBGC2u.js","./target-navigation-intent-DFDZRZTp.js","./ActivityModeContent-CKlljrfV.js","./DocumentContext-DT1j4EfY.js","./dist-DiQSHtaM.js","./dist-DNQ2xKmK.js","./dist-semR8ZB_.js","./dist-C8kKU7Ya.js","./dist-BUk_vKk2.js","./stex-ChE_gMQ6.js","./DocumentContext-B0sQn39F.css","./agent-presence-DUe_PdKt.js","./SettingsDialogBody-DHtvo0Wh.js","./config-validation-events-DmUeQxLg.js","./SourceEditor-CRzFUyZA.js","./typing-burst-detector-jeT5tzuY.js"])))=>i.map(i=>d[i]);
2
- import{o as e,t}from"./chunk-CFjPhJqf.js";import{t as n}from"./preload-helper-2ej06EnG.js";import{n as r,r as i,t as a}from"./compiler-runtime-CVnuRdak.js";import{$ as o,$n as s,$t as c,An as l,At as u,B as d,Bn as f,Bt as p,C as m,Cn as h,Ct as g,D as _,Dn as v,Dt as y,E as b,En as x,Et as S,F as C,Fn as w,Ft as T,Gn as E,Gt as D,H as O,Hn as k,Ht as A,I as j,In as M,It as N,J as P,Jn as F,Jt as I,K as L,Kn as R,Kt as z,L as B,Ln as V,Lt as H,M as U,Mn as W,Mt as G,N as ee,Nn as te,Nt as ne,On as re,Ot as ie,P as ae,Pn as oe,Pt as se,Q as K,Qt as ce,R as le,Rn as ue,Rt as q,S as de,Sn as fe,St as pe,T as me,Tn as he,Tt as ge,U as _e,Un as ve,Ut as ye,V as be,Vn as xe,Vt as Se,W as Ce,Wn as we,Wt as Te,X as Ee,Xn as De,Xt as Oe,Y as ke,Yn as Ae,Yt as je,Z as Me,Zn as Ne,Zt as Pe,_ as Fe,_n as J,_t as Ie,a as Le,at as Re,bn as ze,bt as Be,c as Ve,ct as He,d as Ue,dt as We,er as Ge,et as Ke,f as qe,ft as Je,g as Ye,gn as Xe,hn as Ze,i as Qe,ir as $e,it as et,jn as tt,jt as nt,kn as rt,kt as it,l as at,lt as ot,m as st,mn as ct,mt as lt,n as ut,nr as dt,nt as ft,o as pt,ot as mt,p as ht,pn as gt,pt as _t,q as vt,qn as yt,qt as bt,r as xt,rr as St,rt as Ct,s as wt,st as Tt,t as Et,tn as Dt,tr as Ot,tt as kt,u as At,ut as jt,vn as Mt,vt as Nt,w as Pt,wn as Ft,wt as It,x as Lt,xn as Rt,xt as zt,yn as Bt,yt as Vt,z as Ht,zn as Ut,zt as Wt}from"./DocumentContext-DT1j4EfY.js";import{i as Gt,n as Kt,r as qt,t as Jt}from"./checkbox-CTrUepCv.js";import{A as Yt,C as Xt,D as Zt,E as Qt,O as $t,S as en,T as tn,_ as nn,a as rn,b as an,c as on,d as sn,f as cn,g as ln,h as un,i as dn,k as fn,l as pn,m as mn,n as hn,p as gn,r as _n,s as vn,t as yn,u as bn,v as xn,w as Sn,x as Cn,y as wn}from"./panel-CxlToFCs.js";import{$t as Tn,A as En,B as Dn,Bn as On,Br as kn,C as An,D as jn,Dn as Mn,Dr as Nn,Dt as Pn,E as Fn,En as In,Er as Ln,Et as Rn,Fn as zn,Fr as Bn,G as Vn,H as Hn,Hr as Un,I as Wn,Ir as Gn,Jr as Kn,Jt as qn,K as Jn,Kr as Yn,Kt as Xn,L as Zn,Ln as Qn,Nn as $n,O as er,On as tr,Pr as nr,Pt as rr,Qn as ir,R as ar,S as or,Sn as sr,Sr as cr,St as lr,T as ur,Tn as dr,Tr as fr,U as pr,Ut as mr,V as hr,Vt as gr,W as _r,X as vr,Xr as yr,Xt as br,Y as xr,Yn as Sr,Yr as Cr,Yt as wr,Z as Tr,Zt as Er,_ as Dr,_r as Or,a as kr,an as Ar,bn as jr,bt as Mr,c as Nr,cn as Pr,d as Fr,di as Ir,dn as Lr,fi as Rr,fn as zr,fr as Br,ft as Vr,gr as Hr,gt as Ur,h as Wr,hi as Gr,hr as Kr,ht as qr,i as Jr,jn as Yr,k as Xr,l as Zr,mi as Qr,n as $r,o as ei,or as ti,p as ni,pi as ri,pn as ii,pr as ai,r as oi,s as si,t as ci,tt as li,u as ui,un as di,vn as fi,vr as pi,w as mi,wr as hi,wt as gi,x as _i,xn as vi,xt as yi,yn as bi,yr as xi,yt as Si,z as Ci,zn as wi,zr as Ti}from"./doc-hash-DYAtw4Za.js";import{C as Ei,S as Di,b as Oi,c as ki,d as Ai,g as ji,l as Mi,m as Ni,o as Pi,p as Fi,r as Ii,t as Y,w as Li,x as Ri}from"./button-JrGyO3-P.js";import{a as zi,c as Bi,d as Vi,f as Hi,i as Ui,l as Wi,m as Gi,n as Ki,o as qi,p as Ji,r as Yi,s as Xi,t as Zi,u as Qi}from"./agent-presence-DUe_PdKt.js";import{$ as $i,A as ea,At as ta,B as na,C as ra,Ct as ia,D as aa,Dt as oa,E as sa,Et as ca,F as la,G as ua,H as da,I as fa,J as pa,K as ma,L as ha,M as ga,Mt as _a,N as va,O as ya,Ot as ba,P as xa,Q as Sa,R as Ca,S as wa,St as Ta,T as Ea,Tt as Da,U as Oa,V as ka,W as Aa,X as ja,Y as Ma,Z as Na,_ as Pa,_t as Fa,a as Ia,at as La,b as Ra,bt as za,ct as Ba,dt as Va,et as Ha,ft as Ua,g as Wa,gt as Ga,h as Ka,ht as qa,it as Ja,j as Ya,jt as Xa,k as Za,lt as Qa,m as $a,mt as eo,nt as to,o as no,ot as ro,p as io,pt as ao,q as oo,r as so,rt as co,st as lo,t as uo,tt as fo,u as po,ut as mo,v as ho,vt as go,w as _o,wt as vo,x as yo,xt as bo,y as xo,yt as So,z as Co}from"./config-validation-events-DmUeQxLg.js";import{n as wo,t as To}from"./target-navigation-intent-DFDZRZTp.js";import{C as Eo,S as Do,a as Oo,b as ko,c as Ao,d as jo,f as Mo,h as No,i as Po,l as Fo,m as Io,n as Lo,o as Ro,p as zo,s as Bo,t as Vo,u as Ho,x as X}from"./dialog-bA5Nvc2p.js";import{a as Uo,i as Wo,n as Go,r as Ko,t as qo}from"./collapsible-DfUFsfqv.js";import{a as Jo,i as Yo,n as Xo,o as Zo,r as Qo,t as $o}from"./toggle-group-C3h-Kc3T.js";import{t as es}from"./label-Bdsqm1CY.js";import{i as ts,n as ns,r as rs}from"./project-paths-DKT5BePl.js";import{n as is,t as as}from"./mcp-consent-store-BPw6Zd40.js";import{$ as os,At as ss,Ct as cs,Dt as ls,Ft as us,I as ds,It as fs,J as ps,Mt as ms,Ot as hs,Pt as gs,Q as _s,Tt as vs,X as ys,Z as bs,at as xs,bt as Ss,c as Cs,jt as ws,k as Ts,w as Es}from"./dist-DNQ2xKmK.js";import{n as Ds}from"./dist-semR8ZB_.js";import{n as Os,o as ks,r as As,t as js}from"./typing-burst-detector-jeT5tzuY.js";import{t as Ms}from"./textarea-CQGiqhkV.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function Ns(){({BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1})?.VITE_OTEL_ENABLED===`true`&&n(()=>import(`./telemetry-impl-BiWd9bHi.js`).then(e=>e.install()),__vite__mapDeps([0,1,2,3,4]),import.meta.url)}function Ps(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ln(e,()=>t.signal,()=>n=!0)},u=wn(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?xn:nn;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Is:Fs,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Fs(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Fs(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Is(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Ls=class extends cn{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Rs(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=gn({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),un.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Rs(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var zs=class extends Yt{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Ls({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Bs(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Bs(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Bs(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Bs(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){un.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Xt(t,e))}findAll(e={}){return this.getAll().filter(t=>Xt(e,t))}notify(e){un.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return un.batch(()=>Promise.all(e.map(e=>e.continue().catch(tn))))}};function Bs(e){return e.options.scope?.id}var Vs=class extends Yt{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??en(r,t),a=this.get(i);return a||(a=new sn({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){un.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Sn(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Sn(e,t)):t}notify(e){un.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){un.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){un.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Hs=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Vs,this.#t=e.mutationCache||new zs,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=fn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=mn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Zt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=an(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return un.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;un.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return un.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=un.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(tn).catch(tn)}invalidateQueries(e,t={}){return un.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=un.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(tn)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(tn)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Zt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(tn).catch(tn)}fetchInfiniteQuery(e){return e.behavior=Ps(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(tn).catch(tn)}ensureInfiniteQueryData(e){return e.behavior=Ps(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return mn.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Cn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Qt(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Cn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Qt(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=en(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===$t&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Us=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Ws=t(((e,t)=>{t.exports=Us()})),Gs=t((e=>{var t=Ws(),n=r(),i=Li();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var N=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},L=[],R=-1;function z(e){return{current:e}}function B(e){0>R||(e.current=L[R],L[R]=null,R--)}function V(e,t){R++,L[R]=e.current,e.current=t}var H=z(null),U=z(null),W=z(null),G=z(null);function ee(e,t){switch(V(W,t),V(U,e),V(H,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}B(H),V(H,e)}function te(){B(H),B(U),B(W)}function ne(e){e.memoizedState!==null&&V(G,e);var t=H.current,n=Hd(t,e.type);t!==n&&(V(U,e),V(H,n))}function re(e){U.current===e&&(B(H),B(U)),G.current===e&&(B(G),Qf._currentValue=I)}var ie,ae;function oe(e){if(ie===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ie=t&&t[1]||``,ae=-1<e.stack.indexOf(`
3
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
- `+ie+e+ae}var se=!1;function K(e,t){if(!e||se)return``;se=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5
- `),l=s.split(`
6
- `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
7
- `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{se=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?oe(n):``}function ce(e,t){switch(e.tag){case 26:case 27:case 5:return oe(e.type);case 16:return oe(`Lazy`);case 13:return e.child!==t&&t!==null?oe(`Suspense Fallback`):oe(`Suspense`);case 19:return oe(`SuspenseList`);case 0:case 15:return K(e.type,!1);case 11:return K(e.type.render,!1);case 1:return K(e.type,!0);case 31:return oe(`Activity`);default:return``}}function le(e){try{var t=``,n=null;do t+=ce(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
- Error generating stack: `+e.message+`
9
- `+e.stack}}var ue=Object.prototype.hasOwnProperty,q=t.unstable_scheduleCallback,de=t.unstable_cancelCallback,fe=t.unstable_shouldYield,pe=t.unstable_requestPaint,me=t.unstable_now,he=t.unstable_getCurrentPriorityLevel,ge=t.unstable_ImmediatePriority,_e=t.unstable_UserBlockingPriority,ve=t.unstable_NormalPriority,ye=t.unstable_LowPriority,be=t.unstable_IdlePriority,xe=t.log,Se=t.unstable_setDisableYieldValue,Ce=null,we=null;function Te(e){if(typeof xe==`function`&&Se(e),we&&typeof we.setStrictMode==`function`)try{we.setStrictMode(Ce,e)}catch{}}var Ee=Math.clz32?Math.clz32:ke,De=Math.log,Oe=Math.LN2;function ke(e){return e>>>=0,e===0?32:31-(De(e)/Oe|0)|0}var Ae=256,je=262144,Me=4194304;function Ne(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Pe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ne(n))):i=Ne(o):i=Ne(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ne(n))):i=Ne(o)):i=Ne(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Fe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function J(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ie(){var e=Me;return Me<<=1,!(Me&62914560)&&(Me=4194304),e}function Le(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Re(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ze(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ee(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Be(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Be(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ee(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ve(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ee(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function He(e,t){var n=t&-t;return n=n&42?1:Ue(n),(n&(e.suspendedLanes|t))===0?n:0}function Ue(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function We(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Ge(){var e=F.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function Ke(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var qe=Math.random().toString(36).slice(2),Je=`__reactFiber$`+qe,Ye=`__reactProps$`+qe,Xe=`__reactContainer$`+qe,Ze=`__reactEvents$`+qe,Qe=`__reactListeners$`+qe,$e=`__reactHandles$`+qe,et=`__reactResources$`+qe,tt=`__reactMarker$`+qe;function nt(e){delete e[Je],delete e[Ye],delete e[Ze],delete e[Qe],delete e[$e]}function rt(e){var t=e[Je];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Xe]||n[Je]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[Je])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function it(e){if(e=e[Je]||e[Xe]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function at(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function ot(e){var t=e[et];return t||=e[et]={hoistableStyles:new Map,hoistableScripts:new Map},t}function st(e){e[tt]=!0}var ct=new Set,lt={};function ut(e,t){dt(e,t),dt(e+`Capture`,t)}function dt(e,t){for(lt[e]=t,e=0;e<t.length;e++)ct.add(t[e])}var ft=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),pt={},mt={};function ht(e){return ue.call(mt,e)?!0:ue.call(pt,e)?!1:ft.test(e)?mt[e]=!0:(pt[e]=!0,!1)}function gt(e,t,n){if(ht(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function _t(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function vt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function yt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function bt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function xt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function St(e){if(!e._valueTracker){var t=bt(e)?`checked`:`value`;e._valueTracker=xt(e,t,``+e[t])}}function Ct(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=bt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function wt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Tt=/[\n"\\]/g;function Et(e){return e.replace(Tt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Dt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+yt(t)):e.value!==``+yt(t)&&(e.value=``+yt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):kt(e,o,yt(n)):kt(e,o,yt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+yt(s):e.removeAttribute(`name`)}function Ot(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){St(e);return}n=n==null?``:``+yt(n),t=t==null?n:``+yt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),St(e)}function kt(e,t,n){t===`number`&&wt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function At(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+yt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function jt(e,t,n){if(t!=null&&(t=``+yt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+yt(n)}function Mt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(N(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=yt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),St(e)}function Nt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Pt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Ft(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Pt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function It(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&Ft(e,i,r)}else for(var o in t)t.hasOwnProperty(o)&&Ft(e,o,t[o])}function Lt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Rt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`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`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`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`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`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`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),zt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Bt(e){return zt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Vt(){}var Ht=null;function Ut(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Wt=null,Gt=null;function Kt(e){var t=it(e);if(t&&(e=t.stateNode)){var n=e[Ye]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Dt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Et(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[Ye]||null;if(!i)throw Error(a(90));Dt(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Ct(r)}break a;case`textarea`:jt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&At(e,!!n.multiple,t,!1)}}}var qt=!1;function Jt(e,t,n){if(qt)return e(t,n);qt=!0;try{return e(t)}finally{if(qt=!1,(Wt!==null||Gt!==null)&&(_u(),Wt&&(t=Wt,e=Gt,Gt=Wt=null,Kt(t),e)))for(t=0;t<e.length;t++)Kt(e[t])}}function Yt(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Ye]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(a(231,t,typeof n));return n}var Xt=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),Zt=!1;if(Xt)try{var Qt={};Object.defineProperty(Qt,`passive`,{get:function(){Zt=!0}}),window.addEventListener(`test`,Qt,Qt),window.removeEventListener(`test`,Qt,Qt)}catch{Zt=!1}var $t=null,en=null,tn=null;function nn(){if(tn)return tn;var e,t=en,n=t.length,r,i=`value`in $t?$t.value:$t.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return tn=i.slice(e,1<r?1-r:void 0)}function rn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function an(){return!0}function on(){return!1}function sn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?an:on,this.isPropagationStopped=on,this}return p(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=an)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=an)},persist:function(){},isPersistent:an}),t}var cn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ln=sn(cn),un=p({},cn,{view:0,detail:0}),dn=sn(un),fn,pn,mn,hn=p({},un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:En,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==mn&&(mn&&e.type===`mousemove`?(fn=e.screenX-mn.screenX,pn=e.screenY-mn.screenY):pn=fn=0,mn=e),fn)},movementY:function(e){return`movementY`in e?e.movementY:pn}}),gn=sn(hn),_n=sn(p({},hn,{dataTransfer:0})),vn=sn(p({},un,{relatedTarget:0})),yn=sn(p({},cn,{animationName:0,elapsedTime:0,pseudoElement:0})),bn=sn(p({},cn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),xn=sn(p({},cn,{data:0})),Sn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Cn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},wn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Tn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=wn[e])?!!t[e]:!1}function En(){return Tn}var Dn=sn(p({},un,{key:function(e){if(e.key){var t=Sn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=rn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Cn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:En,charCode:function(e){return e.type===`keypress`?rn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?rn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),On=sn(p({},hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),kn=sn(p({},un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:En})),An=sn(p({},cn,{propertyName:0,elapsedTime:0,pseudoElement:0})),jn=sn(p({},hn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Mn=sn(p({},cn,{newState:0,oldState:0})),Nn=[9,13,27,32],Pn=Xt&&`CompositionEvent`in window,Fn=null;Xt&&`documentMode`in document&&(Fn=document.documentMode);var In=Xt&&`TextEvent`in window&&!Fn,Ln=Xt&&(!Pn||Fn&&8<Fn&&11>=Fn),Rn=` `,zn=!1;function Bn(e,t){switch(e){case`keyup`:return Nn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Vn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Hn=!1;function Un(e,t){switch(e){case`compositionend`:return Vn(t);case`keypress`:return t.which===32?(zn=!0,Rn):null;case`textInput`:return e=t.data,e===Rn&&zn?null:e;default:return null}}function Wn(e,t){if(Hn)return e===`compositionend`||!Pn&&Bn(e,t)?(e=nn(),tn=en=$t=null,Hn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Ln&&t.locale!==`ko`?null:t.data;default:return null}}var Gn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Kn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Gn[e.type]:t===`textarea`}function qn(e,t,n,r){Wt?Gt?Gt.push(r):Gt=[r]:Wt=r,t=Td(t,`onChange`),0<t.length&&(n=new ln(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Jn=null,Yn=null;function Xn(e){_d(e,0)}function Zn(e){if(Ct(at(e)))return e}function Qn(e,t){if(e===`change`)return t}var $n=!1;if(Xt){var er;if(Xt){var tr=`oninput`in document;if(!tr){var nr=document.createElement(`div`);nr.setAttribute(`oninput`,`return;`),tr=typeof nr.oninput==`function`}er=tr}else er=!1;$n=er&&(!document.documentMode||9<document.documentMode)}function rr(){Jn&&(Jn.detachEvent(`onpropertychange`,ir),Yn=Jn=null)}function ir(e){if(e.propertyName===`value`&&Zn(Yn)){var t=[];qn(t,Yn,e,Ut(e)),Jt(Xn,t)}}function ar(e,t,n){e===`focusin`?(rr(),Jn=t,Yn=n,Jn.attachEvent(`onpropertychange`,ir)):e===`focusout`&&rr()}function or(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Zn(Yn)}function sr(e,t){if(e===`click`)return Zn(t)}function cr(e,t){if(e===`input`||e===`change`)return Zn(t)}function lr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var ur=typeof Object.is==`function`?Object.is:lr;function dr(e,t){if(ur(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ue.call(t,i)||!ur(e[i],t[i]))return!1}return!0}function fr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pr(e,t){var n=fr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=fr(n)}}function mr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function hr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=wt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=wt(e.document)}return t}function gr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var _r=Xt&&`documentMode`in document&&11>=document.documentMode,vr=null,yr=null,br=null,xr=!1;function Sr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;xr||vr==null||vr!==wt(r)||(r=vr,`selectionStart`in r&&gr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),br&&dr(br,r)||(br=r,r=Td(yr,`onSelect`),0<r.length&&(t=new ln(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=vr)))}function Cr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var wr={animationend:Cr(`Animation`,`AnimationEnd`),animationiteration:Cr(`Animation`,`AnimationIteration`),animationstart:Cr(`Animation`,`AnimationStart`),transitionrun:Cr(`Transition`,`TransitionRun`),transitionstart:Cr(`Transition`,`TransitionStart`),transitioncancel:Cr(`Transition`,`TransitionCancel`),transitionend:Cr(`Transition`,`TransitionEnd`)},Tr={},Er={};Xt&&(Er=document.createElement(`div`).style,`AnimationEvent`in window||(delete wr.animationend.animation,delete wr.animationiteration.animation,delete wr.animationstart.animation),`TransitionEvent`in window||delete wr.transitionend.transition);function Dr(e){if(Tr[e])return Tr[e];if(!wr[e])return e;var t=wr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Er)return Tr[e]=t[n];return e}var Or=Dr(`animationend`),kr=Dr(`animationiteration`),Ar=Dr(`animationstart`),jr=Dr(`transitionrun`),Mr=Dr(`transitionstart`),Nr=Dr(`transitioncancel`),Pr=Dr(`transitionend`),Fr=new Map,Ir=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Ir.push(`scrollEnd`);function Lr(e,t){Fr.set(e,t),ut(t,[e])}var Rr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},zr=[],Br=0,Vr=0;function Hr(){for(var e=Br,t=Vr=Br=0;t<e;){var n=zr[t];zr[t++]=null;var r=zr[t];zr[t++]=null;var i=zr[t];zr[t++]=null;var a=zr[t];if(zr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Kr(n,i,a)}}function Ur(e,t,n,r){zr[Br++]=e,zr[Br++]=t,zr[Br++]=n,zr[Br++]=r,Vr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Wr(e,t,n,r){return Ur(e,t,n,r),qr(e)}function Gr(e,t){return Ur(e,null,null,t),qr(e)}function Kr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ee(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function qr(e){if(50<cu)throw cu=0,lu=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Jr={};function Yr(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xr(e,t,n,r){return new Yr(e,t,n,r)}function Zr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Qr(e,t){var n=e.alternate;return n===null?(n=Xr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function $r(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ei(e,t,n,r,i,o){var s=0;if(r=e,typeof e==`function`)Zr(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,H.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case D:return e=Xr(31,n,t,i),e.elementType=D,e.lanes=o,e;case _:return ti(n.children,i,o,t);case v:s=8,i|=24;break;case y:return e=Xr(12,n,t,i|2),e.elementType=y,e.lanes=o,e;case C:return e=Xr(13,n,t,i),e.elementType=C,e.lanes=o,e;case w:return e=Xr(19,n,t,i),e.elementType=w,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case x:s=10;break a;case b:s=9;break a;case S:s=11;break a;case T:s=14;break a;case E:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=Xr(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function ti(e,t,n,r){return e=Xr(7,e,r,t),e.lanes=n,e}function ni(e,t,n){return e=Xr(6,e,null,t),e.lanes=n,e}function ri(e){var t=Xr(18,null,null,0);return t.stateNode=e,t}function ii(e,t,n){return t=Xr(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ai=new WeakMap;function oi(e,t){if(typeof e==`object`&&e){var n=ai.get(e);return n===void 0?(t={value:e,source:t,stack:le(t)},ai.set(e,t),t):n}return{value:e,source:t,stack:le(t)}}var si=[],ci=0,li=null,ui=0,di=[],fi=0,pi=null,mi=1,hi=``;function gi(e,t){si[ci++]=ui,si[ci++]=li,li=e,ui=t}function _i(e,t,n){di[fi++]=mi,di[fi++]=hi,di[fi++]=pi,pi=e;var r=mi;e=hi;var i=32-Ee(r)-1;r&=~(1<<i),n+=1;var a=32-Ee(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,mi=1<<32-Ee(t)+i|n<<i|r,hi=a+e}else mi=1<<a|n<<i|r,hi=e}function vi(e){e.return!==null&&(gi(e,1),_i(e,1,0))}function yi(e){for(;e===li;)li=si[--ci],si[ci]=null,ui=si[--ci],si[ci]=null;for(;e===pi;)pi=di[--fi],di[fi]=null,hi=di[--fi],di[fi]=null,mi=di[--fi],di[fi]=null}function bi(e,t){di[fi++]=mi,di[fi++]=hi,di[fi++]=pi,mi=t.id,hi=t.overflow,pi=e}var xi=null,Si=null,Ci=!1,wi=null,Ti=!1,Ei=Error(a(519));function Di(e){throw Ni(oi(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ei}function Oi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Je]=e,t[Ye]=r,n){case`dialog`:vd(`cancel`,t),vd(`close`,t);break;case`iframe`:case`object`:case`embed`:vd(`load`,t);break;case`video`:case`audio`:for(n=0;n<hd.length;n++)vd(hd[n],t);break;case`source`:vd(`error`,t);break;case`img`:case`image`:case`link`:vd(`error`,t),vd(`load`,t);break;case`details`:vd(`toggle`,t);break;case`input`:vd(`invalid`,t),Ot(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:vd(`invalid`,t);break;case`textarea`:vd(`invalid`,t),Mt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||jd(t.textContent,n)?(r.popover!=null&&(vd(`beforetoggle`,t),vd(`toggle`,t)),r.onScroll!=null&&vd(`scroll`,t),r.onScrollEnd!=null&&vd(`scrollend`,t),r.onClick!=null&&(t.onclick=Vt),t=!0):t=!1,t||Di(e,!0)}function ki(e){for(xi=e.return;xi;)switch(xi.tag){case 5:case 31:case 13:Ti=!1;return;case 27:case 3:Ti=!0;return;default:xi=xi.return}}function Ai(e){if(e!==xi)return!1;if(!Ci)return ki(e),Ci=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&Si&&Di(e),ki(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Si=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));Si=uf(e)}else t===27?(t=Si,Zd(e.type)?(e=lf,lf=null,Si=e):Si=t):Si=xi?cf(e.stateNode.nextSibling):null;return!0}function ji(){Si=xi=null,Ci=!1}function Mi(){var e=wi;return e!==null&&(Jl===null?Jl=e:Jl.push.apply(Jl,e),wi=null),e}function Ni(e){wi===null?wi=[e]:wi.push(e)}var Pi=z(null),Fi=null,Ii=null;function Y(e,t,n){V(Pi,t._currentValue),t._currentValue=n}function Ri(e){e._currentValue=Pi.current,B(Pi)}function zi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Bi(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),zi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),zi(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function Vi(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;ur(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===G.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}i=i.return}e!==null&&Bi(t,e,n,r),t.flags|=262144}function Hi(e){for(e=e.firstContext;e!==null;){if(!ur(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ui(e){Fi=e,Ii=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Wi(e){return Ki(Fi,e)}function Gi(e,t){return Fi===null&&Ui(e),Ki(e,t)}function Ki(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ii===null){if(e===null)throw Error(a(308));Ii=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ii=Ii.next=t;return n}var qi=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ji=t.unstable_scheduleCallback,Yi=t.unstable_NormalPriority,Xi={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Zi(){return{controller:new qi,data:new Map,refCount:0}}function Qi(e){e.refCount--,e.refCount===0&&Ji(Yi,function(){e.controller.abort()})}var $i=null,ea=0,ta=0,na=null;function ra(e,t){if($i===null){var n=$i=[];ea=0,ta=ld(),na={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ea++,t.then(ia,ia),t}function ia(){if(--ea===0&&$i!==null){na!==null&&(na.status=`fulfilled`);var e=$i;$i=null,ta=0,na=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function aa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var oa=P.S;P.S=function(e,t){Zl=me(),typeof t==`object`&&t&&typeof t.then==`function`&&ra(e,t),oa!==null&&oa(e,t)};var sa=z(null);function ca(){var e=sa.current;return e===null?Ml.pooledCache:e}function la(e,t){t===null?V(sa,sa.current):V(sa,t.pool)}function ua(){var e=ca();return e===null?null:{parent:Xi._currentValue,pool:e}}var da=Error(a(460)),fa=Error(a(474)),pa=Error(a(542)),ma={then:function(){}};function ha(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ga(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Vt,Vt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ba(e),e;default:if(typeof t.status==`string`)t.then(Vt,Vt);else{if(e=Ml,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ba(e),e}throw va=t,da}}function _a(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(va=e,da):e}}var va=null;function ya(){if(va===null)throw Error(a(459));var e=va;return va=null,e}function ba(e){if(e===da||e===pa)throw Error(a(483))}var xa=null,Sa=0;function Ca(e){var t=Sa;return Sa+=1,xa===null&&(xa=[]),ga(xa,e,t)}function wa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ta(e,t){throw t.$$typeof===m?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ea(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=Qr(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ni(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===_?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===E&&_a(a)===t.type)?(t=i(t,n.props),wa(t,n),t.return=e,t):(t=ei(n.type,n.key,n.props,null,e.mode,r),wa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=ii(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=ti(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ni(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case h:return n=ei(t.type,t.key,t.props,null,e.mode,n),wa(n,t),n.return=e,n;case g:return t=ii(t,e.mode,n),t.return=e,t;case E:return t=_a(t),f(e,t,n)}if(N(t)||A(t))return t=ti(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ca(t),n);if(t.$$typeof===x)return f(e,Gi(e,t),n);Ta(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case h:return n.key===i?l(e,t,n,r):null;case g:return n.key===i?u(e,t,n,r):null;case E:return n=_a(n),p(e,t,n,r)}if(N(n)||A(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ca(n),r);if(n.$$typeof===x)return p(e,t,Gi(e,n),r);Ta(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case h:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case g:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case E:return r=_a(r),m(e,t,n,r,i)}if(N(r)||A(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ca(r),i);if(r.$$typeof===x)return m(e,t,n,Gi(t,r),i);Ta(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Ci&&gi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Ci&&gi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Ci&&gi(i,h),l}function y(i,s,c,l){if(c==null)throw Error(a(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),Ci&&gi(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Ci&&gi(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),Ci&&gi(i,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===_&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case h:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===_){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===E&&_a(l)===r.type){n(e,r.sibling),c=i(r,o.props),wa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===_?(c=ti(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ei(o.type,o.key,o.props,null,e.mode,c),wa(c,o),c.return=e,e=c)}return s(e);case g:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=ii(o,e.mode,c),c.return=e,e=c}return s(e);case E:return o=_a(o),b(e,r,o,c)}if(N(o))return v(e,r,o,c);if(A(o)){if(l=A(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ca(o),c);if(o.$$typeof===x)return b(e,r,Gi(e,o),c);Ta(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=ni(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Sa=0;var i=b(e,t,n,r);return xa=null,i}catch(t){if(t===da||t===pa)throw t;var a=Xr(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Da=Ea(!0),Oa=Ea(!1),ka=!1;function Aa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ja(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ma(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Na(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,jl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=qr(e),Kr(e,null,n),t}return Ur(e,r,t,n),qr(e)}function Pa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ve(e,n)}}function Fa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ia=!1;function La(){if(Ia){var e=na;if(e!==null)throw e}}function Ra(e,t,n,r){Ia=!1;var i=e.updateQueue;ka=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,m=f!==s.lane;if(m?(Pl&f)===f:(r&f)===f){f!==0&&f===ta&&(Ia=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=p({},d,f);break a;case 2:ka=!0}}f=s.callback,f!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Hl|=o,e.lanes=o,e.memoizedState=d}}function za(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function Ba(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)za(n[e],t)}var Va=z(null),Ha=z(0);function Ua(e,t){e=Bl,V(Ha,e),V(Va,t),Bl=e|t.baseLanes}function Wa(){V(Ha,Bl),V(Va,Va.current)}function Ga(){Bl=Ha.current,B(Va),B(Ha)}var Ka=z(null),qa=null;function Ja(e){var t=e.alternate;V($a,$a.current&1),V(Ka,e),qa===null&&(t===null||Va.current!==null||t.memoizedState!==null)&&(qa=e)}function Ya(e){V($a,$a.current),V(Ka,e),qa===null&&(qa=e)}function Xa(e){e.tag===22?(V($a,$a.current),V(Ka,e),qa===null&&(qa=e)):Za(e)}function Za(){V($a,$a.current),V(Ka,Ka.current)}function Qa(e){B(Ka),qa===e&&(qa=null),B($a)}var $a=z(0);function eo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var to=0,no=null,ro=null,io=null,ao=!1,oo=!1,so=!1,co=0,lo=0,uo=null,fo=0;function po(){throw Error(a(321))}function mo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ur(e[n],t[n]))return!1;return!0}function ho(e,t,n,r,i,a){return to=a,no=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?js:Ms,so=!1,a=n(r,i),so=!1,oo&&(a=_o(t,n,r,i)),go(e),a}function go(e){P.H=As;var t=ro!==null&&ro.next!==null;if(to=0,io=ro=no=null,ao=!1,lo=0,uo=null,t)throw Error(a(300));e===null||Xs||(e=e.dependencies,e!==null&&Hi(e)&&(Xs=!0))}function _o(e,t,n,r){no=e;var i=0;do{if(oo&&(uo=null),lo=0,oo=!1,25<=i)throw Error(a(301));if(i+=1,io=ro=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=Ns,o=t(n,r)}while(oo);return o}function vo(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?To(t):t,e=e.useState()[0],(ro===null?null:ro.memoizedState)!==e&&(no.flags|=1024),t}function yo(){var e=co!==0;return co=0,e}function bo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function xo(e){if(ao){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ao=!1}to=0,io=ro=no=null,oo=!1,lo=co=0,uo=null}function So(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return io===null?no.memoizedState=io=e:io=io.next=e,io}function Co(){if(ro===null){var e=no.alternate;e=e===null?null:e.memoizedState}else e=ro.next;var t=io===null?no.memoizedState:io.next;if(t!==null)io=t,ro=e;else{if(e===null)throw no.alternate===null?Error(a(467)):Error(a(310));ro=e,e={memoizedState:ro.memoizedState,baseState:ro.baseState,baseQueue:ro.baseQueue,queue:ro.queue,next:null},io===null?no.memoizedState=io=e:io=io.next=e}return io}function wo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function To(e){var t=lo;return lo+=1,uo===null&&(uo=[]),e=ga(uo,e,t),t=no,(io===null?t.memoizedState:io.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?js:Ms),e}function Eo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return To(e);if(e.$$typeof===x)return Wi(e)}throw Error(a(438,String(e)))}function Do(e){var t=null,n=no.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=no.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=wo(),no.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=O;return t.index++,n}function Oo(e,t){return typeof t==`function`?t(e):t}function ko(e){return Ao(Co(),ro,e)}function Ao(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(to&f)===f:(Pl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ta&&(d=!0);else if((to&p)===p){u=u.next,p===ta&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,no.lanes|=p,Hl|=p;f=u.action,so&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,no.lanes|=f,Hl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!ur(o,e.memoizedState)&&(Xs=!0,d&&(n=na,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function jo(e){var t=Co(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);ur(o,t.memoizedState)||(Xs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Mo(e,t,n){var r=no,i=Co(),o=Ci;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!ur((ro||i).memoizedState,n);if(s&&(i.memoizedState=n,Xs=!0),i=i.queue,ns(Fo.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||io!==null&&io.memoizedState.tag&1){if(r.flags|=2048,Zo(9,{destroy:void 0},Po.bind(null,r,i,n,t),null),Ml===null)throw Error(a(349));o||to&127||No(r,t,n)}return n}function No(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=no.updateQueue,t===null?(t=wo(),no.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Po(e,t,n,r){t.value=n,t.getSnapshot=r,Io(t)&&Lo(e)}function Fo(e,t,n){return n(function(){Io(t)&&Lo(e)})}function Io(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ur(e,n)}catch{return!0}}function Lo(e){var t=Gr(e,2);t!==null&&fu(t,e,2)}function Ro(e){var t=So();if(typeof e==`function`){var n=e;if(e=n(),so){Te(!0);try{n()}finally{Te(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:e},t}function zo(e,t,n,r){return e.baseState=n,Ao(e,ro,typeof r==`function`?r:Oo)}function Bo(e,t,n,r,i){if(Ds(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Vo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Vo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),Ho(e,t,s)}catch(n){Uo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),Ho(e,t,a)}catch(n){Uo(e,t,n)}}function Ho(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){X(e,t,n)},function(n){return Uo(e,t,n)}):X(e,t,n)}function X(e,t,n){t.status=`fulfilled`,t.value=n,Wo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Vo(e,n)))}function Uo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Wo(t),t=t.next;while(t!==r)}e.action=null}function Wo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Go(e,t){return t}function Ko(e,t){if(Ci){var n=Ml.formState;if(n!==null){a:{var r=no;if(Ci){if(Si){b:{for(var i=Si,a=Ti;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Si=cf(i.nextSibling),r=i.data===`F!`;break a}}Di(r)}r=!1}r&&(t=n[0])}}return n=So(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Go,lastRenderedState:t},n.queue=r,n=ws.bind(null,no,r),r.dispatch=n,r=Ro(!1),a=Es.bind(null,no,!1,r.queue),r=So(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Bo.bind(null,no,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function qo(e){return Jo(Co(),ro,e)}function Jo(e,t,n){if(t=Ao(e,t,Go)[0],e=ko(Oo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=To(t)}catch(e){throw e===da?pa:e}else r=t;t=Co();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(no.flags|=2048,Zo(9,{destroy:void 0},Yo.bind(null,i,n),null)),[r,a,e]}function Yo(e,t){e.action=t}function Xo(e){var t=Co(),n=ro;if(n!==null)return Jo(t,n,e);Co(),t=t.memoizedState,n=Co();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Zo(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=no.updateQueue,t===null&&(t=wo(),no.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Qo(){return Co().memoizedState}function $o(e,t,n,r){var i=So();no.flags|=e,i.memoizedState=Zo(1|t,{destroy:void 0},n,r===void 0?null:r)}function es(e,t,n,r){var i=Co();r=r===void 0?null:r;var a=i.memoizedState.inst;ro!==null&&r!==null&&mo(r,ro.memoizedState.deps)?i.memoizedState=Zo(t,a,n,r):(no.flags|=e,i.memoizedState=Zo(1|t,a,n,r))}function ts(e,t){$o(8390656,8,e,t)}function ns(e,t){es(2048,8,e,t)}function rs(e){no.flags|=4;var t=no.updateQueue;if(t===null)t=wo(),no.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function is(e){var t=Co().memoizedState;return rs({ref:t,nextImpl:e}),function(){if(jl&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function as(e,t){return es(4,2,e,t)}function os(e,t){return es(4,4,e,t)}function ss(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function cs(e,t,n){n=n==null?null:n.concat([e]),es(4,4,ss.bind(null,t,e),n)}function ls(){}function us(e,t){var n=Co();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&mo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ds(e,t){var n=Co();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&mo(t,r[1]))return r[0];if(r=e(),so){Te(!0);try{e()}finally{Te(!1)}}return n.memoizedState=[r,t],r}function fs(e,t,n){return n===void 0||to&1073741824&&!(Pl&261930)?e.memoizedState=t:(e.memoizedState=n,e=du(),no.lanes|=e,Hl|=e,n)}function ps(e,t,n,r){return ur(n,t)?n:Va.current===null?!(to&42)||to&1073741824&&!(Pl&261930)?(Xs=!0,e.memoizedState=n):(e=du(),no.lanes|=e,Hl|=e,t):(e=fs(e,n,r),ur(e,t)||(Xs=!0),e)}function ms(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};P.T=s,Es(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ts(e,t,aa(c,r),uu(e)):Ts(e,t,r,uu(e))}catch(n){Ts(e,t,{then:function(){},status:`rejected`,reason:n},uu())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function hs(){}function gs(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=_s(e).queue;ms(e,i,t,I,n===null?hs:function(){return vs(e),n(r)})}function _s(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:I},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function vs(e){var t=_s(e);t.next===null&&(t=e.alternate.memoizedState),Ts(e,t.next.queue,{},uu())}function ys(){return Wi(Qf)}function bs(){return Co().memoizedState}function xs(){return Co().memoizedState}function Ss(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=uu();e=Ma(n);var r=Na(t,e,n);r!==null&&(fu(r,t,n),Pa(r,t,n)),t={cache:Zi()},e.payload=t;return}t=t.return}}function Cs(e,t,n){var r=uu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ds(e)?Os(t,n):(n=Wr(e,t,n,r),n!==null&&(fu(n,e,r),ks(n,t,r)))}function ws(e,t,n){Ts(e,t,n,uu())}function Ts(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ds(e))Os(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,ur(s,o))return Ur(e,t,i,0),Ml===null&&Hr(),!1}catch{}if(n=Wr(e,t,i,r),n!==null)return fu(n,e,r),ks(n,t,r),!0}return!1}function Es(e,t,n,r){if(r={lane:2,revertLane:ld(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ds(e)){if(t)throw Error(a(479))}else t=Wr(e,n,r,2),t!==null&&fu(t,e,2)}function Ds(e){var t=e.alternate;return e===no||t!==null&&t===no}function Os(e,t){oo=ao=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ks(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ve(e,n)}}var As={readContext:Wi,use:Eo,useCallback:po,useContext:po,useEffect:po,useImperativeHandle:po,useLayoutEffect:po,useInsertionEffect:po,useMemo:po,useReducer:po,useRef:po,useState:po,useDebugValue:po,useDeferredValue:po,useTransition:po,useSyncExternalStore:po,useId:po,useHostTransitionStatus:po,useFormState:po,useActionState:po,useOptimistic:po,useMemoCache:po,useCacheRefresh:po};As.useEffectEvent=po;var js={readContext:Wi,use:Eo,useCallback:function(e,t){return So().memoizedState=[e,t===void 0?null:t],e},useContext:Wi,useEffect:ts,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),$o(4194308,4,ss.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $o(4194308,4,e,t)},useInsertionEffect:function(e,t){$o(4,2,e,t)},useMemo:function(e,t){var n=So();t=t===void 0?null:t;var r=e();if(so){Te(!0);try{e()}finally{Te(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=So();if(n!==void 0){var i=n(t);if(so){Te(!0);try{n(t)}finally{Te(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Cs.bind(null,no,e),[r.memoizedState,e]},useRef:function(e){var t=So();return e={current:e},t.memoizedState=e},useState:function(e){e=Ro(e);var t=e.queue,n=ws.bind(null,no,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ls,useDeferredValue:function(e,t){return fs(So(),e,t)},useTransition:function(){var e=Ro(!1);return e=ms.bind(null,no,e.queue,!0,!1),So().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=no,i=So();if(Ci){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),Ml===null)throw Error(a(349));Pl&127||No(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,ts(Fo.bind(null,r,o,e),[e]),r.flags|=2048,Zo(9,{destroy:void 0},Po.bind(null,r,o,n,t),null),n},useId:function(){var e=So(),t=Ml.identifierPrefix;if(Ci){var n=hi,r=mi;n=(r&~(1<<32-Ee(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=co++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=fo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ys,useFormState:Ko,useActionState:Ko,useOptimistic:function(e){var t=So();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Es.bind(null,no,!0,n),n.dispatch=t,[e,t]},useMemoCache:Do,useCacheRefresh:function(){return So().memoizedState=Ss.bind(null,no)},useEffectEvent:function(e){var t=So(),n={impl:e};return t.memoizedState=n,function(){if(jl&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},Ms={readContext:Wi,use:Eo,useCallback:us,useContext:Wi,useEffect:ns,useImperativeHandle:cs,useInsertionEffect:as,useLayoutEffect:os,useMemo:ds,useReducer:ko,useRef:Qo,useState:function(){return ko(Oo)},useDebugValue:ls,useDeferredValue:function(e,t){return ps(Co(),ro.memoizedState,e,t)},useTransition:function(){var e=ko(Oo)[0],t=Co().memoizedState;return[typeof e==`boolean`?e:To(e),t]},useSyncExternalStore:Mo,useId:bs,useHostTransitionStatus:ys,useFormState:qo,useActionState:qo,useOptimistic:function(e,t){return zo(Co(),ro,e,t)},useMemoCache:Do,useCacheRefresh:xs};Ms.useEffectEvent=is;var Ns={readContext:Wi,use:Eo,useCallback:us,useContext:Wi,useEffect:ns,useImperativeHandle:cs,useInsertionEffect:as,useLayoutEffect:os,useMemo:ds,useReducer:jo,useRef:Qo,useState:function(){return jo(Oo)},useDebugValue:ls,useDeferredValue:function(e,t){var n=Co();return ro===null?fs(n,e,t):ps(n,ro.memoizedState,e,t)},useTransition:function(){var e=jo(Oo)[0],t=Co().memoizedState;return[typeof e==`boolean`?e:To(e),t]},useSyncExternalStore:Mo,useId:bs,useHostTransitionStatus:ys,useFormState:Xo,useActionState:Xo,useOptimistic:function(e,t){var n=Co();return ro===null?(n.baseState=e,[e,n.queue.dispatch]):zo(n,ro,e,t)},useMemoCache:Do,useCacheRefresh:xs};Ns.useEffectEvent=is;function Ps(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:p({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Fs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=uu(),i=Ma(r);i.payload=t,n!=null&&(i.callback=n),t=Na(e,i,r),t!==null&&(fu(t,e,r),Pa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=uu(),i=Ma(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Na(e,i,r),t!==null&&(fu(t,e,r),Pa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=uu(),r=Ma(n);r.tag=2,t!=null&&(r.callback=t),t=Na(e,r,n),t!==null&&(fu(t,e,n),Pa(t,e,n))}};function Is(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!dr(n,r)||!dr(i,a):!0}function Ls(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Fs.enqueueReplaceState(t,t.state,null)}function Rs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=p({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function zs(e){Rr(e)}function Bs(e){console.error(e)}function Vs(e){Rr(e)}function Hs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Us(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Gs(e,t,n){return n=Ma(n),n.tag=3,n.payload={element:null},n.callback=function(){Hs(e,t)},n}function Ks(e){return e=Ma(e),e.tag=3,e}function qs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Us(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Us(t,n,r),typeof i!=`function`&&(eu===null?eu=new Set([this]):eu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Js(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Vi(t,n,i,!0),n=Ka.current,n!==null){switch(n.tag){case 31:case 13:return qa===null?wu():n.alternate===null&&Vl===0&&(Vl=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===ma?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Uu(e,r,i)),!1;case 22:return n.flags|=65536,r===ma?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Uu(e,r,i)),!1}throw Error(a(435,n.tag))}return Uu(e,r,i),wu(),!1}if(Ci)return t=Ka.current,t===null?(r!==Ei&&(t=Error(a(423),{cause:r}),Ni(oi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=oi(r,n),i=Gs(e.stateNode,r,i),Fa(e,i),Vl!==4&&(Vl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Ei&&(e=Error(a(422),{cause:r}),Ni(oi(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=oi(o,n),ql===null?ql=[o]:ql.push(o),Vl!==4&&(Vl=2),t===null)return!0;r=oi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Gs(n.stateNode,r,e),Fa(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(eu===null||!eu.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Ks(i),qs(i,e,n,r),Fa(n,i),!1}n=n.return}while(n!==null);return!1}var Ys=Error(a(461)),Xs=!1;function Z(e,t,n,r){t.child=e===null?Oa(t,null,n,r):Da(t,e.child,n,r)}function Q(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ui(t),r=ho(e,t,n,o,a,i),s=yo(),e!==null&&!Xs?(bo(e,t,i),yc(e,t,i)):(Ci&&s&&vi(t),t.flags|=1,Z(e,t,r,i),t.child)}function Zs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Zr(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Qs(e,t,a,r,i)):(e=ei(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!bc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?dr:n,n(o,r)&&e.ref===t.ref)return yc(e,t,i)}return t.flags|=1,e=Qr(a,r),e.ref=t.ref,e.return=t,t.child=e}function Qs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(dr(a,r)&&e.ref===t.ref)if(Xs=!1,t.pendingProps=r=a,bc(e,i))e.flags&131072&&(Xs=!0);else return t.lanes=e.lanes,yc(e,t,i)}return ac(e,t,n,r,i)}function $(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return ec(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&la(t,a===null?null:a.cachePool),a===null?Wa():Ua(t,a),Xa(t);else return r=t.lanes=536870912,ec(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&la(t,null),Wa(),Za(t)):(la(t,a.cachePool),Ua(t,a),Za(t),t.memoizedState=null);return Z(e,t,i,n),t.child}function $s(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ec(e,t,n,r,i){var a=ca();return a=a===null?null:{parent:Xi._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&la(t,null),Wa(),Xa(t),e!==null&&Vi(e,t,r,!0),t.childLanes=i,null}function tc(e,t){return t=mc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function nc(e,t,n){return Da(t,e.child,null,n),e=tc(t,t.pendingProps),e.flags|=2,Qa(t),t.memoizedState=null,e}function rc(e,t,n){var r=t.pendingProps,i=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Ci){if(r.mode===`hidden`)return e=tc(t,r),t.lanes=536870912,$s(null,e);if(Ya(t),(e=Si)?(e=rf(e,Ti),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:pi===null?null:{id:mi,overflow:hi},retryLane:536870912,hydrationErrors:null},n=ri(e),n.return=t,t.child=n,xi=t,Si=null)):e=null,e===null)throw Di(t);return t.lanes=536870912,null}return tc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Ya(t),i)if(t.flags&256)t.flags&=-257,t=nc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558));else if(Xs||Vi(e,t,n,!1),i=(n&e.childLanes)!==0,Xs||i){if(r=Ml,r!==null&&(s=He(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Gr(e,s),fu(r,e,s),Ys;wu(),t=nc(e,t,n)}else e=o.treeContext,Si=cf(s.nextSibling),xi=t,Ci=!0,wi=null,Ti=!1,e!==null&&bi(t,e),t=tc(t,r),t.flags|=4096;return t}return e=Qr(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ic(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function ac(e,t,n,r,i){return Ui(t),n=ho(e,t,n,r,void 0,i),r=yo(),e!==null&&!Xs?(bo(e,t,i),yc(e,t,i)):(Ci&&r&&vi(t),t.flags|=1,Z(e,t,n,i),t.child)}function oc(e,t,n,r,i,a){return Ui(t),t.updateQueue=null,n=_o(t,r,n,i),go(e),r=yo(),e!==null&&!Xs?(bo(e,t,a),yc(e,t,a)):(Ci&&r&&vi(t),t.flags|=1,Z(e,t,n,a),t.child)}function sc(e,t,n,r,i){if(Ui(t),t.stateNode===null){var a=Jr,o=n.contextType;typeof o==`object`&&o&&(a=Wi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Fs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Aa(t),o=n.contextType,a.context=typeof o==`object`&&o?Wi(o):Jr,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ps(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Fs.enqueueReplaceState(a,a.state,null),Ra(t,r,a,i),La(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Rs(n,s);a.props=c;var l=a.context,u=n.contextType;o=Jr,typeof u==`object`&&u&&(o=Wi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Ls(t,a,r,o),ka=!1;var f=t.memoizedState;a.state=f,Ra(t,r,a,i),La(),l=t.memoizedState,s||f!==l||ka?(typeof d==`function`&&(Ps(t,n,d,r),l=t.memoizedState),(c=ka||Is(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,ja(e,t),o=t.memoizedProps,u=Rs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Jr,typeof l==`object`&&l&&(c=Wi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Ls(t,a,r,c),ka=!1,f=t.memoizedState,a.state=f,Ra(t,r,a,i),La();var p=t.memoizedState;o!==d||f!==p||ka||e!==null&&e.dependencies!==null&&Hi(e.dependencies)?(typeof s==`function`&&(Ps(t,n,s,r),p=t.memoizedState),(u=ka||Is(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Hi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,ic(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Da(t,e.child,null,i),t.child=Da(t,null,n,i)):Z(e,t,n,i),t.memoizedState=a.state,e=t.child):e=yc(e,t,i),e}function cc(e,t,n,r){return ji(),t.flags|=256,Z(e,t,n,r),t.child}var lc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function uc(e){return{baseLanes:e,cachePool:ua()}}function dc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Gl),e}function fc(e,t,n){var r=t.pendingProps,i=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:($a.current&2)!=0),s&&(i=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Ci){if(i?Ja(t):Za(t),(e=Si)?(e=rf(e,Ti),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:pi===null?null:{id:mi,overflow:hi},retryLane:536870912,hydrationErrors:null},n=ri(e),n.return=t,t.child=n,xi=t,Si=null)):e=null,e===null)throw Di(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(Za(t),i=t.mode,c=mc({mode:`hidden`,children:c},i),r=ti(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=uc(n),r.childLanes=dc(e,s,n),t.memoizedState=lc,$s(null,r)):(Ja(t),pc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Ja(t),t.flags&=-257,t=hc(e,t,n)):t.memoizedState===null?(Za(t),c=r.fallback,i=t.mode,r=mc({mode:`visible`,children:r.children},i),c=ti(c,i,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Da(t,e.child,null,n),r=t.child,r.memoizedState=uc(n),r.childLanes=dc(e,s,n),t.memoizedState=lc,t=$s(null,r)):(Za(t),t.child=e.child,t.flags|=128,t=null);else if(Ja(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(a(419)),r.stack=``,r.digest=s,Ni({value:r,source:null,stack:null}),t=hc(e,t,n)}else if(Xs||Vi(e,t,n,!1),s=(n&e.childLanes)!==0,Xs||s){if(s=Ml,s!==null&&(r=He(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Gr(e,r),fu(s,e,r),Ys;af(c)||wu(),t=hc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Si=cf(c.nextSibling),xi=t,Ci=!0,wi=null,Ti=!1,e!==null&&bi(t,e),t=pc(t,r.children),t.flags|=4096);return t}return i?(Za(t),c=r.fallback,i=t.mode,l=e.child,u=l.sibling,r=Qr(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ti(c,i,n,null),c.flags|=2):c=Qr(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,$s(null,r),r=t.child,c=e.child.memoizedState,c===null?c=uc(n):(i=c.cachePool,i===null?i=ua():(l=Xi._currentValue,i=i.parent===l?i:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=dc(e,s,n),t.memoizedState=lc,$s(e.child,r)):(Ja(t),n=e.child,e=n.sibling,n=Qr(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function pc(e,t){return t=mc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function mc(e,t){return e=Xr(22,e,null,t),e.lanes=0,e}function hc(e,t,n){return Da(t,e.child,null,n),e=pc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function gc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),zi(e.return,t,n)}function _c(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function vc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=$a.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,V($a,o),Z(e,t,r,n),r=Ci?ui:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&gc(e,n,t);else if(e.tag===19)gc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&eo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),_c(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&eo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}_c(t,!0,n,null,a,r);break;case`together`:_c(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function yc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Hl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Vi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=Qr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Qr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function bc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Hi(e))):!0}function xc(e,t,n){switch(t.tag){case 3:ee(t,t.stateNode.containerInfo),Y(t,Xi,e.memoizedState.cache),ji();break;case 27:case 5:ne(t);break;case 4:ee(t,t.stateNode.containerInfo);break;case 10:Y(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ya(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Ja(t),e=yc(e,t,n),e===null?null:e.sibling):fc(e,t,n):(Ja(t),t.flags|=128,null);Ja(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Vi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return vc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),V($a,$a.current),r)break;return null;case 22:return t.lanes=0,$(e,t,n,t.pendingProps);case 24:Y(t,Xi,e.memoizedState.cache)}return yc(e,t,n)}function Sc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Xs=!0;else{if(!bc(e,n)&&!(t.flags&128))return Xs=!1,xc(e,t,n);Xs=!!(e.flags&131072)}else Xs=!1,Ci&&t.flags&1048576&&_i(t,ui,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=_a(t.elementType),t.type=e,typeof e==`function`)Zr(e)?(r=Rs(e,r),t.tag=1,t=sc(null,t,e,r,n)):(t.tag=0,t=ac(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===S){t.tag=11,t=Q(null,t,e,r,n);break a}else if(i===T){t.tag=14,t=Zs(null,t,e,r,n);break a}}throw t=M(e)||e,Error(a(306,t,``))}}return t;case 0:return ac(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Rs(r,t.pendingProps),sc(e,t,r,i,n);case 3:a:{if(ee(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,ja(e,t),Ra(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Y(t,Xi,r),r!==o.cache&&Bi(t,[Xi],n,!0),La(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=cc(e,t,r,n);break a}else if(r!==i){i=oi(Error(a(424)),t),Ni(i),t=cc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Si=cf(e.firstChild),xi=t,Ci=!0,wi=null,Ti=!0,n=Oa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(ji(),r===i){t=yc(e,t,n);break a}Z(e,t,r,n)}t=t.child}return t;case 26:return ic(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ci||(n=t.type,e=t.pendingProps,r=Bd(W.current).createElement(n),r[Je]=t,r[Ye]=e,Pd(r,n,e),st(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ne(t),e===null&&Ci&&(r=t.stateNode=ff(t.type,t.pendingProps,W.current),xi=t,Ti=!0,i=Si,Zd(t.type)?(lf=i,Si=cf(r.firstChild)):Si=i),Z(e,t,t.pendingProps.children,n),ic(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ci&&((i=r=Si)&&(r=tf(r,t.type,t.pendingProps,Ti),r===null?i=!1:(t.stateNode=r,xi=t,Si=cf(r.firstChild),Ti=!1,i=!0)),i||Di(t)),ne(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(i,o)?r=null:s!==null&&Ud(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=ho(e,t,vo,null,null,n),Qf._currentValue=i),ic(e,t),Z(e,t,r,n),t.child;case 6:return e===null&&Ci&&((e=n=Si)&&(n=nf(n,t.pendingProps,Ti),n===null?e=!1:(t.stateNode=n,xi=t,Si=null,e=!0)),e||Di(t)),null;case 13:return fc(e,t,n);case 4:return ee(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Da(t,null,r,n):Z(e,t,r,n),t.child;case 11:return Q(e,t,t.type,t.pendingProps,n);case 7:return Z(e,t,t.pendingProps,n),t.child;case 8:return Z(e,t,t.pendingProps.children,n),t.child;case 12:return Z(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Y(t,t.type,r.value),Z(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,Ui(t),i=Wi(i),r=r(i),t.flags|=1,Z(e,t,r,n),t.child;case 14:return Zs(e,t,t.type,t.pendingProps,n);case 15:return Qs(e,t,t.type,t.pendingProps,n);case 19:return vc(e,t,n);case 31:return rc(e,t,n);case 22:return $(e,t,n,t.pendingProps);case 24:return Ui(t),r=Wi(Xi),e===null?(i=ca(),i===null&&(i=Ml,o=Zi(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},Aa(t),Y(t,Xi,i)):((e.lanes&n)!==0&&(ja(e,t),Ra(t,null,null,n),La()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,Y(t,Xi,r),r!==i.cache&&Bi(t,[Xi],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Y(t,Xi,r))),Z(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function Cc(e){e.flags|=4}function wc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(xu())e.flags|=8192;else throw va=ma,fa}else e.flags&=-16777217}function Tc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(xu())e.flags|=8192;else throw va=ma,fa}function Ec(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ie(),e.lanes|=t,Kl|=t)}function Dc(e,t){if(!Ci)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Oc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function kc(e,t,n){var r=t.pendingProps;switch(yi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Oc(t),null;case 1:return Oc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ri(Xi),te(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ai(t)?Cc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Mi())),Oc(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(Cc(t),o===null?(Oc(t),wc(t,i,null,r,n)):(Oc(t),Tc(t,o))):o?o===e.memoizedState?(Oc(t),t.flags&=-16777217):(Cc(t),Oc(t),Tc(t,o)):(e=e.memoizedProps,e!==r&&Cc(t),Oc(t),wc(t,i,e,r,n)),null;case 27:if(re(t),n=W.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Cc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Oc(t),null}e=H.current,Ai(t)?Oi(t,e):(e=ff(i,r,n),t.stateNode=e,Cc(t))}return Oc(t),null;case 5:if(re(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Cc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Oc(t),null}if(o=H.current,Ai(t))Oi(t,o);else{var s=Bd(W.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[Je]=t,o[Ye]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Cc(t)}}return Oc(t),wc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Cc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=W.current,Ai(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=xi,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Je]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||Di(t,!0)}else e=Bd(e).createTextNode(r),e[Je]=t,t.stateNode=e}return Oc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ai(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[Je]=t}else ji(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Oc(t),e=!1}else n=Mi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Qa(t),t):(Qa(t),null);if(t.flags&128)throw Error(a(558))}return Oc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Ai(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[Je]=t}else ji(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Oc(t),i=!1}else i=Mi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Qa(t),t):(Qa(t),null)}return Qa(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ec(t,t.updateQueue),Oc(t),null);case 4:return te(),e===null&&xd(t.stateNode.containerInfo),Oc(t),null;case 10:return Ri(t.type),Oc(t),null;case 19:if(B($a),r=t.memoizedState,r===null)return Oc(t),null;if(i=(t.flags&128)!=0,o=r.rendering,o===null)if(i)Dc(r,!1);else{if(Vl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=eo(e),o!==null){for(t.flags|=128,Dc(r,!1),e=o.updateQueue,t.updateQueue=e,Ec(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)$r(n,e),n=n.sibling;return V($a,$a.current&1|2),Ci&&gi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&me()>Ql&&(t.flags|=128,i=!0,Dc(r,!1),t.lanes=4194304)}else{if(!i)if(e=eo(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Ec(t,e),Dc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Ci)return Oc(t),null}else 2*me()-r.renderingStartTime>Ql&&n!==536870912&&(t.flags|=128,i=!0,Dc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Oc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=me(),e.sibling=null,n=$a.current,V($a,i?n&1|2:n&1),Ci&&gi(t,r.treeForkCount),e);case 22:case 23:return Qa(t),Ga(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Oc(t),t.subtreeFlags&6&&(t.flags|=8192)):Oc(t),n=t.updateQueue,n!==null&&Ec(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&B(sa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ri(Xi),Oc(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Ac(e,t){switch(yi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ri(Xi),te(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return re(t),null;case 31:if(t.memoizedState!==null){if(Qa(t),t.alternate===null)throw Error(a(340));ji()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Qa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));ji()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B($a),null;case 4:return te(),null;case 10:return Ri(t.type),null;case 22:case 23:return Qa(t),Ga(),e!==null&&B(sa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ri(Xi),null;case 25:return null;default:return null}}function jc(e,t){switch(yi(t),t.tag){case 3:Ri(Xi),te();break;case 26:case 27:case 5:re(t);break;case 4:te();break;case 31:t.memoizedState!==null&&Qa(t);break;case 13:Qa(t);break;case 19:B($a);break;case 10:Ri(t.type);break;case 22:case 23:Qa(t),Ga(),e!==null&&B(sa);break;case 24:Ri(Xi)}}function Mc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Hu(t,t.return,e)}}function Nc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Hu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Hu(t,t.return,e)}}function Pc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ba(t,n)}catch(t){Hu(e,e.return,t)}}}function Fc(e,t,n){n.props=Rs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Hu(e,t,n)}}function Ic(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Hu(e,t,n)}}function Lc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Hu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Hu(e,t,n)}else n.current=null}function Rc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Hu(e,e.return,t)}}function zc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[Ye]=t}catch(t){Hu(e,e.return,t)}}function Bc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Vc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Bc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Hc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Vt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Hc(e,t,n),e=e.sibling;e!==null;)Hc(e,t,n),e=e.sibling}function Uc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Uc(e,t,n),e=e.sibling;e!==null;)Uc(e,t,n),e=e.sibling}function Wc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[Je]=e,t[Ye]=n}catch(t){Hu(e,e.return,t)}}var Gc=!1,Kc=!1,qc=!1,Jc=typeof WeakSet==`function`?WeakSet:Set,Yc=null;function Xc(e,t){if(e=e.containerInfo,Rd=sp,e=hr(e),gr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,Yc=t;Yc!==null;)if(t=Yc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Yc=e;else for(;Yc!==null;){switch(t=Yc,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Rs(n.type,i);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Hu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(a(163))}if(e=t.sibling,e!==null){e.return=t.return,Yc=e;break}Yc=t.return}}function Zc(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:fl(e,n),r&4&&Mc(5,n);break;case 1:if(fl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Hu(n,n.return,e)}else{var i=Rs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Hu(n,n.return,e)}}r&64&&Pc(n),r&512&&Ic(n,n.return);break;case 3:if(fl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ba(e,t)}catch(e){Hu(n,n.return,e)}}break;case 27:t===null&&r&4&&Wc(n);case 26:case 5:fl(e,n),t===null&&r&4&&Rc(n),r&512&&Ic(n,n.return);break;case 12:fl(e,n);break;case 31:fl(e,n),r&4&&rl(e,n);break;case 13:fl(e,n),r&4&&il(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ku.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||Gc,!r){t=t!==null&&t.memoizedState!==null||Kc,i=Gc;var a=Kc;Gc=r,(Kc=t)&&!a?ml(e,n,(n.subtreeFlags&8772)!=0):fl(e,n),Gc=i,Kc=a}break;case 30:break;default:fl(e,n)}}function Qc(e){var t=e.alternate;t!==null&&(e.alternate=null,Qc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&nt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var $c=null,el=!1;function tl(e,t,n){for(n=n.child;n!==null;)nl(e,t,n),n=n.sibling}function nl(e,t,n){if(we&&typeof we.onCommitFiberUnmount==`function`)try{we.onCommitFiberUnmount(Ce,n)}catch{}switch(n.tag){case 26:Kc||Lc(n,t),tl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Kc||Lc(n,t);var r=$c,i=el;Zd(n.type)&&($c=n.stateNode,el=!1),tl(e,t,n),pf(n.stateNode),$c=r,el=i;break;case 5:Kc||Lc(n,t);case 6:if(r=$c,i=el,$c=null,tl(e,t,n),$c=r,el=i,$c!==null)if(el)try{($c.nodeType===9?$c.body:$c.nodeName===`HTML`?$c.ownerDocument.body:$c).removeChild(n.stateNode)}catch(e){Hu(n,t,e)}else try{$c.removeChild(n.stateNode)}catch(e){Hu(n,t,e)}break;case 18:$c!==null&&(el?(e=$c,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd($c,n.stateNode));break;case 4:r=$c,i=el,$c=n.stateNode.containerInfo,el=!0,tl(e,t,n),$c=r,el=i;break;case 0:case 11:case 14:case 15:Nc(2,n,t),Kc||Nc(4,n,t),tl(e,t,n);break;case 1:Kc||(Lc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Fc(n,t,r)),tl(e,t,n);break;case 21:tl(e,t,n);break;case 22:Kc=(r=Kc)||n.memoizedState!==null,tl(e,t,n),Kc=r;break;default:tl(e,t,n)}}function rl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Hu(t,t.return,e)}}}function il(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Hu(t,t.return,e)}}function al(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Jc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Jc),t;default:throw Error(a(435,e.tag))}}function ol(e,t){var n=al(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=qu.bind(null,e,t);t.then(r,r)}})}function sl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){$c=c.stateNode,el=!1;break a}break;case 5:$c=c.stateNode,el=!1;break a;case 3:case 4:$c=c.stateNode.containerInfo,el=!0;break a}c=c.return}if($c===null)throw Error(a(160));nl(o,s,i),$c=null,el=!1,o=i.alternate,o!==null&&(o.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ll(t,e),t=t.sibling}var cl=null;function ll(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:sl(t,e),ul(e),r&4&&(Nc(3,e,e.return),Mc(3,e),Nc(5,e,e.return));break;case 1:sl(t,e),ul(e),r&512&&(Kc||n===null||Lc(n,n.return)),r&64&&Gc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=cl;if(sl(t,e),ul(e),r&512&&(Kc||n===null||Lc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;b:switch(r){case`title`:o=i.getElementsByTagName(`title`)[0],(!o||o[tt]||o[Je]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=i.createElement(r),i.head.insertBefore(o,i.querySelector(`head > title`))),Pd(o,r,n),o[Je]=e,st(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=i.createElement(r),Pd(o,r,n),i.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,i).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=i.createElement(r),Pd(o,r,n),i.head.appendChild(o);break;default:throw Error(a(468,r))}o[Je]=e,st(o),r=o}e.stateNode=r}else Hf(i,e.type,e.stateNode);else e.stateNode=If(i,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&zc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(i,e.type,e.stateNode):If(i,r,e.memoizedProps))}break;case 27:sl(t,e),ul(e),r&512&&(Kc||n===null||Lc(n,n.return)),n!==null&&r&4&&zc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(sl(t,e),ul(e),r&512&&(Kc||n===null||Lc(n,n.return)),e.flags&32){i=e.stateNode;try{Nt(i,``)}catch(t){Hu(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,zc(e,i,n===null?i:n.memoizedProps)),r&1024&&(qc=!0);break;case 6:if(sl(t,e),ul(e),r&4){if(e.stateNode===null)throw Error(a(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Hu(e,e.return,t)}}break;case 3:if(Bf=null,i=cl,cl=gf(t.containerInfo),sl(t,e),cl=i,ul(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Hu(e,e.return,t)}qc&&(qc=!1,dl(e));break;case 4:r=cl,cl=gf(e.stateNode.containerInfo),sl(t,e),ul(e),cl=r;break;case 12:sl(t,e),ul(e);break;case 31:sl(t,e),ul(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ol(e,r)));break;case 13:sl(t,e),ul(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Xl=me()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ol(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Gc,d=Kc;if(Gc=u||i,Kc=d||l,sl(t,e),Kc=d,Gc=u,ul(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||Gc||Kc||pl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,i)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Hu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?``:l.memoizedProps}catch(e){Hu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?$d(m,!0):$d(l.stateNode,!1)}catch(e){Hu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ol(e,n))));break;case 19:sl(t,e),ul(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ol(e,r)));break;case 30:break;case 21:break;default:sl(t,e),ul(e)}}function ul(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Bc(r)){n=r;break}r=r.return}if(n==null)throw Error(a(160));switch(n.tag){case 27:var i=n.stateNode;Uc(e,Vc(e),i);break;case 5:var o=n.stateNode;n.flags&32&&(Nt(o,``),n.flags&=-33),Uc(e,Vc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Hc(e,Vc(e),s);break;default:throw Error(a(161))}}catch(t){Hu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function dl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;dl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function fl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Zc(e,t.alternate,t),t=t.sibling}function pl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Nc(4,t,t.return),pl(t);break;case 1:Lc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Fc(t,t.return,n),pl(t);break;case 27:pf(t.stateNode);case 26:case 5:Lc(t,t.return),pl(t);break;case 22:t.memoizedState===null&&pl(t);break;case 30:pl(t);break;default:pl(t)}e=e.sibling}}function ml(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:ml(i,a,n),Mc(4,a);break;case 1:if(ml(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Hu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)za(c[i],s)}catch(e){Hu(r,r.return,e)}}n&&o&64&&Pc(a),Ic(a,a.return);break;case 27:Wc(a);case 26:case 5:ml(i,a,n),n&&r===null&&o&4&&Rc(a),Ic(a,a.return);break;case 12:ml(i,a,n);break;case 31:ml(i,a,n),n&&o&4&&rl(i,a);break;case 13:ml(i,a,n),n&&o&4&&il(i,a);break;case 22:a.memoizedState===null&&ml(i,a,n),Ic(a,a.return);break;case 30:break;default:ml(i,a,n)}t=t.sibling}}function hl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Qi(n))}function gl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qi(e))}function _l(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)vl(e,t,n,r),t=t.sibling}function vl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:_l(e,t,n,r),i&2048&&Mc(9,t);break;case 1:_l(e,t,n,r);break;case 3:_l(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qi(e)));break;case 12:if(i&2048){_l(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Hu(t,t.return,e)}}else _l(e,t,n,r);break;case 31:_l(e,t,n,r);break;case 13:_l(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?_l(e,t,n,r):(a._visibility|=2,yl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?_l(e,t,n,r):bl(e,t),i&2048&&hl(o,t);break;case 24:_l(e,t,n,r),i&2048&&gl(t.alternate,t);break;default:_l(e,t,n,r)}}function yl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:yl(a,o,s,c,i),Mc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,yl(a,o,s,c,i)):u._visibility&2?yl(a,o,s,c,i):bl(a,o),i&&l&2048&&hl(o.alternate,o);break;case 24:yl(a,o,s,c,i),i&&l&2048&&gl(o.alternate,o);break;default:yl(a,o,s,c,i)}t=t.sibling}}function bl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:bl(n,r),i&2048&&hl(r.alternate,r);break;case 24:bl(n,r),i&2048&&gl(r.alternate,r);break;default:bl(n,r)}t=t.sibling}}var xl=8192;function Sl(e,t,n){if(e.subtreeFlags&xl)for(e=e.child;e!==null;)Cl(e,t,n),e=e.sibling}function Cl(e,t,n){switch(e.tag){case 26:Sl(e,t,n),e.flags&xl&&e.memoizedState!==null&&Gf(n,cl,e.memoizedState,e.memoizedProps);break;case 5:Sl(e,t,n);break;case 3:case 4:var r=cl;cl=gf(e.stateNode.containerInfo),Sl(e,t,n),cl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=xl,xl=16777216,Sl(e,t,n),xl=r):Sl(e,t,n));break;default:Sl(e,t,n)}}function wl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Tl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Yc=r,Ol(r,e)}wl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)El(e),e=e.sibling}function El(e){switch(e.tag){case 0:case 11:case 15:Tl(e),e.flags&2048&&Nc(9,e,e.return);break;case 3:Tl(e);break;case 12:Tl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Dl(e)):Tl(e);break;default:Tl(e)}}function Dl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Yc=r,Ol(r,e)}wl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Nc(8,t,t.return),Dl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Dl(t));break;default:Dl(t)}e=e.sibling}}function Ol(e,t){for(;Yc!==null;){var n=Yc;switch(n.tag){case 0:case 11:case 15:Nc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Qi(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Yc=r;else a:for(n=e;Yc!==null;){r=Yc;var i=r.sibling,a=r.return;if(Qc(r),r===n){Yc=null;break a}if(i!==null){i.return=a,Yc=i;break a}Yc=a}}}var kl={getCacheForType:function(e){var t=Wi(Xi),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Wi(Xi).controller.signal}},Al=typeof WeakMap==`function`?WeakMap:Map,jl=0,Ml=null,Nl=null,Pl=0,Fl=0,Il=null,Ll=!1,Rl=!1,zl=!1,Bl=0,Vl=0,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=null,Jl=null,Yl=!1,Xl=0,Zl=0,Ql=1/0,$l=null,eu=null,tu=0,nu=null,ru=null,iu=0,au=0,ou=null,su=null,cu=0,lu=null;function uu(){return jl&2&&Pl!==0?Pl&-Pl:P.T===null?Ge():ld()}function du(){if(Gl===0)if(!(Pl&536870912)||Ci){var e=je;je<<=1,!(je&3932160)&&(je=262144),Gl=e}else Gl=536870912;return e=Ka.current,e!==null&&(e.flags|=32),Gl}function fu(e,t,n){(e===Ml&&(Fl===2||Fl===9)||e.cancelPendingCommit!==null)&&(yu(e,0),gu(e,Pl,Gl,!1)),Re(e,n),(!(jl&2)||e!==Ml)&&(e===Ml&&(!(jl&2)&&(Ul|=n),Vl===4&&gu(e,Pl,Gl,!1)),td(e))}function pu(e,t,n){if(jl&6)throw Error(a(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Fe(e,t),i=r?Du(e,t):Tu(e,t,!0),o=r;do{if(i===0){Rl&&!r&&gu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!hu(n)){i=Tu(e,t,!1),o=!1;continue}if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=ql;var l=c.current.memoizedState.isDehydrated;if(l&&(yu(c,s).flags|=256),s=Tu(c,s,!1),s!==2){if(zl&&!l){c.errorRecoveryDisabledLanes|=o,Ul|=o,i=4;break a}o=Jl,Jl=i,o!==null&&(Jl===null?Jl=o:Jl.push.apply(Jl,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){yu(e,0),gu(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:gu(r,t,Gl,!Ll);break a;case 2:Jl=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=Xl+300-me(),10<i)){if(gu(r,t,Gl,!Ll),Pe(r,0,!0)!==0)break a;iu=t,r.timeoutHandle=Kd(mu.bind(null,r,n,Jl,$l,Yl,t,Gl,Ul,Kl,Ll,o,`Throttled`,-0,0),i);break a}mu(r,n,Jl,$l,Yl,t,Gl,Ul,Kl,Ll,o,null,-0,0)}}break}while(1);td(e)}function mu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Vt},Cl(t,a,d);var m=(a&62914560)===a?Xl-me():(a&4194048)===a?Zl-me():0;if(m=qf(d,m),m!==null){iu=a,e.cancelPendingCommit=m(Pu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),gu(e,a,o,!l);return}}Pu(e,t,a,n,r,i,o,s,c)}function hu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!ur(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function gu(e,t,n,r){t&=~Wl,t&=~Ul,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ee(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Be(e,n,t)}function _u(){return jl&6?!0:(nd(0,!1),!1)}function vu(){if(Nl!==null){if(Fl===0)var e=Nl.return;else e=Nl,Ii=Fi=null,xo(e),xa=null,Sa=0,e=Nl;for(;e!==null;)jc(e.alternate,e),e=e.return;Nl=null}}function yu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),iu=0,vu(),Ml=e,Nl=n=Qr(e.current,null),Pl=t,Fl=0,Il=null,Ll=!1,Rl=Fe(e,t),zl=!1,Kl=Gl=Wl=Ul=Hl=Vl=0,Jl=ql=null,Yl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ee(r),a=1<<i;t|=e[i],r&=~a}return Bl=t,Hr(),n}function bu(e,t){no=null,P.H=As,t===da||t===pa?(t=ya(),Fl=3):t===fa?(t=ya(),Fl=4):Fl=t===Ys?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Il=t,Nl===null&&(Vl=1,Hs(e,oi(t,e.current)))}function xu(){var e=Ka.current;return e===null?!0:(Pl&4194048)===Pl?qa===null:(Pl&62914560)===Pl||Pl&536870912?e===qa:!1}function Su(){var e=P.H;return P.H=As,e===null?As:e}function Cu(){var e=P.A;return P.A=kl,e}function wu(){Vl=4,Ll||(Pl&4194048)!==Pl&&Ka.current!==null||(Rl=!0),!(Hl&134217727)&&!(Ul&134217727)||Ml===null||gu(Ml,Pl,Gl,!1)}function Tu(e,t,n){var r=jl;jl|=2;var i=Su(),a=Cu();(Ml!==e||Pl!==t)&&($l=null,yu(e,t)),t=!1;var o=Vl;a:do try{if(Fl!==0&&Nl!==null){var s=Nl,c=Il;switch(Fl){case 8:vu(),o=6;break a;case 3:case 2:case 9:case 6:Ka.current===null&&(t=!0);var l=Fl;if(Fl=0,Il=null,ju(e,s,c,l),n&&Rl){o=0;break a}break;default:l=Fl,Fl=0,Il=null,ju(e,s,c,l)}}Eu(),o=Vl;break}catch(t){bu(e,t)}while(1);return t&&e.shellSuspendCounter++,Ii=Fi=null,jl=r,P.H=i,P.A=a,Nl===null&&(Ml=null,Pl=0,Hr()),o}function Eu(){for(;Nl!==null;)ku(Nl)}function Du(e,t){var n=jl;jl|=2;var r=Su(),i=Cu();Ml!==e||Pl!==t?($l=null,Ql=me()+500,yu(e,t)):Rl=Fe(e,t);a:do try{if(Fl!==0&&Nl!==null){t=Nl;var o=Il;b:switch(Fl){case 1:Fl=0,Il=null,ju(e,t,o,1);break;case 2:case 9:if(ha(o)){Fl=0,Il=null,Au(t);break}t=function(){Fl!==2&&Fl!==9||Ml!==e||(Fl=7),td(e)},o.then(t,t);break a;case 3:Fl=7;break a;case 4:Fl=5;break a;case 7:ha(o)?(Fl=0,Il=null,Au(t)):(Fl=0,Il=null,ju(e,t,o,7));break;case 5:var s=null;switch(Nl.tag){case 26:s=Nl.memoizedState;case 5:case 27:var c=Nl;if(s?Wf(s):c.stateNode.complete){Fl=0,Il=null;var l=c.sibling;if(l!==null)Nl=l;else{var u=c.return;u===null?Nl=null:(Nl=u,Mu(u))}break b}}Fl=0,Il=null,ju(e,t,o,5);break;case 6:Fl=0,Il=null,ju(e,t,o,6);break;case 8:vu(),Vl=6;break a;default:throw Error(a(462))}}Ou();break}catch(t){bu(e,t)}while(1);return Ii=Fi=null,P.H=r,P.A=i,jl=n,Nl===null?(Ml=null,Pl=0,Hr(),Vl):0}function Ou(){for(;Nl!==null&&!fe();)ku(Nl)}function ku(e){var t=Sc(e.alternate,e,Bl);e.memoizedProps=e.pendingProps,t===null?Mu(e):Nl=t}function Au(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=oc(n,t,t.pendingProps,t.type,void 0,Pl);break;case 11:t=oc(n,t,t.pendingProps,t.type.render,t.ref,Pl);break;case 5:xo(t);default:jc(n,t),t=Nl=$r(t,Bl),t=Sc(n,t,Bl)}e.memoizedProps=e.pendingProps,t===null?Mu(e):Nl=t}function ju(e,t,n,r){Ii=Fi=null,xo(t),xa=null,Sa=0;var i=t.return;try{if(Js(e,i,t,n,Pl)){Vl=1,Hs(e,oi(n,e.current)),Nl=null;return}}catch(t){if(i!==null)throw Nl=i,t;Vl=1,Hs(e,oi(n,e.current)),Nl=null;return}t.flags&32768?(Ci||r===1?e=!0:Rl||Pl&536870912?e=!1:(Ll=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ka.current,r!==null&&r.tag===13&&(r.flags|=16384))),Nu(t,e)):Mu(t)}function Mu(e){var t=e;do{if(t.flags&32768){Nu(t,Ll);return}e=t.return;var n=kc(t.alternate,t,Bl);if(n!==null){Nl=n;return}if(t=t.sibling,t!==null){Nl=t;return}Nl=t=e}while(t!==null);Vl===0&&(Vl=5)}function Nu(e,t){do{var n=Ac(e.alternate,e);if(n!==null){n.flags&=32767,Nl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Nl=e;return}Nl=e=n}while(e!==null);Vl=6,Nl=null}function Pu(e,t,n,r,i,o,s,c,l){e.cancelPendingCommit=null;do zu();while(tu!==0);if(jl&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(o=t.lanes|t.childLanes,o|=Vr,ze(e,n,o,s,c,l),e===Ml&&(Nl=Ml=null,Pl=0),ru=t,nu=e,iu=n,au=o,ou=i,su=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Ju(ve,function(){return Bu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=P.T,P.T=null,i=F.p,F.p=2,s=jl,jl|=4;try{Xc(e,t,n)}finally{jl=s,F.p=i,P.T=r}}tu=1,Fu(),Iu(),Lu()}}function Fu(){if(tu===1){tu=0;var e=nu,t=ru,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=jl;jl|=4;try{ll(t,e);var a=zd,o=hr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&mr(s.ownerDocument.documentElement,s)){if(c!==null&&gr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=pr(s,h),v=pr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{jl=i,F.p=r,P.T=n}}e.current=t,tu=2}}function Iu(){if(tu===2){tu=0;var e=nu,t=ru,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=jl;jl|=4;try{Zc(e,t.alternate,t)}finally{jl=i,F.p=r,P.T=n}}tu=3}}function Lu(){if(tu===4||tu===3){tu=0,pe();var e=nu,t=ru,n=iu,r=su;t.subtreeFlags&10256||t.flags&10256?tu=5:(tu=0,ru=nu=null,Ru(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(eu=null),We(n),t=t.stateNode,we&&typeof we.onCommitFiberRoot==`function`)try{we.onCommitFiberRoot(Ce,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=P.T,i=F.p,F.p=2,P.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{P.T=t,F.p=i}}iu&3&&zu(),td(e),i=e.pendingLanes,n&261930&&i&42?e===lu?cu++:(cu=0,lu=e):cu=0,nd(0,!1)}}function Ru(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Qi(t)))}function zu(){return Fu(),Iu(),Lu(),Bu()}function Bu(){if(tu!==5)return!1;var e=nu,t=au;au=0;var n=We(iu),r=P.T,i=F.p;try{F.p=32>n?32:n,P.T=null,n=ou,ou=null;var o=nu,s=iu;if(tu=0,ru=nu=null,iu=0,jl&6)throw Error(a(331));var c=jl;if(jl|=4,El(o.current),vl(o,o.current,s,n),jl=c,nd(0,!1),we&&typeof we.onPostCommitFiberRoot==`function`)try{we.onPostCommitFiberRoot(Ce,o)}catch{}return!0}finally{F.p=i,P.T=r,Ru(e,t)}}function Vu(e,t,n){t=oi(n,t),t=Gs(e.stateNode,t,2),e=Na(e,t,2),e!==null&&(Re(e,2),td(e))}function Hu(e,t,n){if(e.tag===3)Vu(e,e,n);else for(;t!==null;){if(t.tag===3){Vu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(eu===null||!eu.has(r))){e=oi(n,e),n=Ks(2),r=Na(t,n,2),r!==null&&(qs(n,r,t,e),Re(r,2),td(r));break}}t=t.return}}function Uu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Al;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(zl=!0,i.add(n),e=Wu.bind(null,e,t,n),t.then(e,e))}function Wu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ml===e&&(Pl&n)===n&&(Vl===4||Vl===3&&(Pl&62914560)===Pl&&300>me()-Xl?!(jl&2)&&yu(e,0):Wl|=n,Kl===Pl&&(Kl=0)),td(e)}function Gu(e,t){t===0&&(t=Ie()),e=Gr(e,t),e!==null&&(Re(e,t),td(e))}function Ku(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Gu(e,n)}function qu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),Gu(e,n)}function Ju(e,t){return q(e,t)}var Yu=null,Xu=null,Zu=!1,Qu=!1,$u=!1,ed=0;function td(e){e!==Xu&&e.next===null&&(Xu===null?Yu=Xu=e:Xu=Xu.next=e),Qu=!0,Zu||(Zu=!0,cd())}function nd(e,t){if(!$u&&Qu){$u=!0;do for(var n=!1,r=Yu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ee(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,sd(r,a))}else a=Pl,a=Pe(r,r===Ml?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Fe(r,a)||(n=!0,sd(r,a));r=r.next}while(n);$u=!1}}function rd(){id()}function id(){Qu=Zu=!1;var e=0;ed!==0&&Gd()&&(e=ed);for(var t=me(),n=null,r=Yu;r!==null;){var i=r.next,a=ad(r,t);a===0?(r.next=null,n===null?Yu=i:n.next=i,i===null&&(Xu=n)):(n=r,(e!==0||a&3)&&(Qu=!0)),r=i}tu!==0&&tu!==5||nd(e,!1),ed!==0&&(ed=0)}function ad(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ee(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=J(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Ml,n=Pl,n=Pe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Fl===2||Fl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&de(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Fe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&de(r),We(n)){case 2:case 8:n=_e;break;case 32:n=ve;break;case 268435456:n=be;break;default:n=ve}return r=od.bind(null,e),n=q(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&de(r),e.callbackPriority=2,e.callbackNode=null,2}function od(e,t){if(tu!==0&&tu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(zu()&&e.callbackNode!==n)return null;var r=Pl;return r=Pe(e,e===Ml?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(pu(e,r,t),ad(e,me()),e.callbackNode!=null&&e.callbackNode===n?od.bind(null,e):null)}function sd(e,t){if(zu())return null;pu(e,t,!0)}function cd(){Yd(function(){jl&6?q(ge,rd):id()})}function ld(){if(ed===0){var e=ta;e===0&&(e=Ae,Ae<<=1,!(Ae&261888)&&(Ae=256)),ed=e}return ed}function ud(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Bt(``+e)}function dd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function fd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=ud((i[Ye]||null).action),o=r.submitter;o&&(t=(t=o[Ye]||null)?ud(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new ln(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ed!==0){var e=o?dd(i,o):new FormData(i);gs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?dd(i,o):new FormData(i),gs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var pd=0;pd<Ir.length;pd++){var md=Ir[pd];Lr(md.toLowerCase(),`on`+(md[0].toUpperCase()+md.slice(1)))}Lr(Or,`onAnimationEnd`),Lr(kr,`onAnimationIteration`),Lr(Ar,`onAnimationStart`),Lr(`dblclick`,`onDoubleClick`),Lr(`focusin`,`onFocus`),Lr(`focusout`,`onBlur`),Lr(jr,`onTransitionRun`),Lr(Mr,`onTransitionStart`),Lr(Nr,`onTransitionCancel`),Lr(Pr,`onTransitionEnd`),dt(`onMouseEnter`,[`mouseout`,`mouseover`]),dt(`onMouseLeave`,[`mouseout`,`mouseover`]),dt(`onPointerEnter`,[`pointerout`,`pointerover`]),dt(`onPointerLeave`,[`pointerout`,`pointerover`]),ut(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),ut(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),ut(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),ut(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),ut(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),ut(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var hd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),gd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(hd));function _d(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Rr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Rr(e)}i.currentTarget=null,a=c}}}}function vd(e,t){var n=t[Ze];n===void 0&&(n=t[Ze]=new Set);var r=e+`__bubble`;n.has(r)||(Sd(t,e,2,!1),n.add(r))}function yd(e,t,n){var r=0;t&&(r|=4),Sd(n,e,r,t)}var bd=`_reactListening`+Math.random().toString(36).slice(2);function xd(e){if(!e[bd]){e[bd]=!0,ct.forEach(function(t){t!==`selectionchange`&&(gd.has(t)||yd(t,!1,e),yd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bd]||(t[bd]=!0,yd(`selectionchange`,!1,t))}}function Sd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!Zt||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Cd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var c=r.stateNode.containerInfo;if(c===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;c!==null;){if(o=rt(c),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}c=c.parentNode}}r=r.return}Jt(function(){var r=a,i=Ut(n),o=[];a:{var c=Fr.get(e);if(c!==void 0){var l=ln,u=e;switch(e){case`keypress`:if(rn(n)===0)break a;case`keydown`:case`keyup`:l=Dn;break;case`focusin`:u=`focus`,l=vn;break;case`focusout`:u=`blur`,l=vn;break;case`beforeblur`:case`afterblur`:l=vn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=gn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=_n;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=kn;break;case Or:case kr:case Ar:l=yn;break;case Pr:l=An;break;case`scroll`:case`scrollend`:l=dn;break;case`wheel`:l=jn;break;case`copy`:case`cut`:case`paste`:l=bn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=On;break;case`toggle`:case`beforetoggle`:l=Mn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Yt(m,p),g!=null&&d.push(wd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),o.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Ht&&(u=n.relatedTarget||n.fromElement)&&(rt(u)||u[Xe]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?rt(u):null,u!==null&&(f=s(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=gn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=On,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:at(l),h=u==null?c:at(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,rt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ed,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Dd(o,c,l,d,!1),u!==null&&f!==null&&Dd(o,f,u,d,!0)}}a:{if(c=r?at(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=Qn;else if(Kn(c))if($n)v=cr;else{v=or;var y=ar}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Lt(r.elementType)&&(v=Qn):v=sr;if(v&&=v(e,r)){qn(o,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&kt(c,`number`,c.value)}switch(y=r?at(r):window,e){case`focusin`:(Kn(y)||y.contentEditable===`true`)&&(vr=y,yr=r,br=null);break;case`focusout`:br=yr=vr=null;break;case`mousedown`:xr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:xr=!1,Sr(o,n,i);break;case`selectionchange`:if(_r)break;case`keydown`:case`keyup`:Sr(o,n,i)}var b;if(Pn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Hn?Bn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Ln&&n.locale!==`ko`&&(Hn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Hn&&(b=nn()):($t=i,en=`value`in $t?$t.value:$t.textContent,Hn=!0)),y=Td(r,x),0<y.length&&(x=new xn(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=Vn(n),b!==null&&(x.data=b)))),(b=In?Un(e,n):Wn(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new xn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),fd(o,e,r,n,i)}_d(o,t)})}function wd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Td(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Yt(e,n),i!=null&&r.unshift(wd(e,i,a)),i=Yt(e,t),i!=null&&r.push(wd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ed(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Yt(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=Yt(n,a),l!=null&&o.push(wd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Od=/\r\n?/g,kd=/\u0000|\uFFFD/g;function Ad(e){return(typeof e==`string`?e:``+e).replace(Od,`
10
- `).replace(kd,``)}function jd(e,t){return t=Ad(t),Ad(e)===t}function Md(e,t,n,r,i,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Nt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Nt(e,``+r);break;case`className`:_t(e,`class`,r);break;case`tabIndex`:_t(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:_t(e,n,r);break;case`style`:It(e,r,o);break;case`data`:if(t!==`object`){_t(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Bt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Md(e,t,`name`,i.name,i,null),Md(e,t,`formEncType`,i.formEncType,i,null),Md(e,t,`formMethod`,i.formMethod,i,null),Md(e,t,`formTarget`,i.formTarget,i,null)):(Md(e,t,`encType`,i.encType,i,null),Md(e,t,`method`,i.method,i,null),Md(e,t,`target`,i.target,i,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Bt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Vt);break;case`onScroll`:r!=null&&vd(`scroll`,e);break;case`onScrollEnd`:r!=null&&vd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Bt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:vd(`beforetoggle`,e),vd(`toggle`,e),gt(e,`popover`,r);break;case`xlinkActuate`:vt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:vt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:vt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:vt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:vt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:vt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:gt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Rt.get(n)||n,gt(e,n,r))}}function Nd(e,t,n,r,i,o){switch(n){case`style`:It(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Nt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Nt(e,``+r);break;case`onScroll`:r!=null&&vd(`scroll`,e);break;case`onScrollEnd`:r!=null&&vd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Vt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!lt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),o=e[Ye]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,i),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):gt(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:vd(`error`,e),vd(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Md(e,t,o,s,n,null)}}i&&Md(e,t,`srcSet`,n.srcSet,n,null),r&&Md(e,t,`src`,n.src,n,null);return;case`input`:vd(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(a(137,t));break;default:Md(e,t,r,d,n,null)}}Ot(e,o,c,l,u,s,i,!1);return;case`select`:for(i in vd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Md(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&At(e,!!r,n,!0):At(e,!!r,t,!1);return;case`textarea`:for(s in vd(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:Md(e,t,s,c,n,null)}Mt(e,r,i,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Md(e,t,l,r,n,null)}return;case`dialog`:vd(`beforetoggle`,e),vd(`toggle`,e),vd(`cancel`,e),vd(`close`,e);break;case`iframe`:case`object`:vd(`load`,e);break;case`video`:case`audio`:for(r=0;r<hd.length;r++)vd(hd[r],e);break;case`image`:vd(`error`,e),vd(`load`,e);break;case`details`:vd(`toggle`,e);break;case`embed`:case`source`:case`link`:vd(`error`,e),vd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Md(e,t,u,r,n,null)}return;default:if(Lt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Md(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Md(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:i=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&Md(e,t,p,m,r,f)}}Dt(e,s,c,l,u,d,o,i);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Md(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Md(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?At(e,!!n,n?[]:``,!1):At(e,!!n,t,!0)):At(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Md(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&Md(e,t,s,i,r,o)}jt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Md(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Md(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Md(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(a(137,t));break;default:Md(e,t,u,p,r,m)}return;default:if(Lt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Md(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Md(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[tt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),nt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[tt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);nt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=F.d;F.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=_u();return e||t}function yf(e){var t=it(e);t!==null&&t.tag===5&&t.type===`form`?vs(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Et(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),st(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Et(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Et(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Et(n.imageSizes)+`"]`)):i+=`[href="`+Et(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),st(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Et(r)+`"][href="`+Et(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=p({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),st(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=ot(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);st(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=ot(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=p({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),st(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=ot(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),st(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var i=(i=W.current)?gf(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=ot(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=ot(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=ot(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Af(e){return`href="`+Et(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),st(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Et(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Et(n.href)+`"]`);if(r)return t.instance=r,st(r),r;var i=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),st(r),Pd(r,`style`,i),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Af(n.href);var o=e.querySelector(jf(i));if(o)return t.state.loading|=4,t.instance=o,st(o),o;r=Mf(n),(i=mf.get(i))&&Rf(r,i),o=(e.ownerDocument||e).createElement(`link`),st(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(i=e.querySelector(Ff(o)))?(t.instance=i,st(i),i):(r=n,(i=mf.get(o))&&(r=p({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),st(i),Pd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[tt]||a[Je]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,st(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),st(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:x,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Le(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Le(0),this.hiddenUpdates=Le(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Xr(3,null,null,t),e.current=a,a.stateNode=e,t=Zi(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Aa(a),e}function tp(e){return e?(e=Jr,e):Jr}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ma(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Na(e,r,t),n!==null&&(fu(n,e,t),Pa(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=Gr(e,67108864);t!==null&&fu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=uu();t=Ue(t);var n=Gr(e,t);n!==null&&fu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,up(e,t,n,r)}finally{F.p=a,P.T=i}}function lp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,up(e,t,n,r)}finally{F.p=a,P.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Cd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=it(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ne(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ee(o);s.entanglements[1]|=c,o&=~c}td(a),!(jl&6)&&(Ql=me()+500,nd(0,!1))}}break;case 31:case 13:s=Gr(a,2),s!==null&&fu(s,a,2),_u(),ip(a,2)}if(a=dp(r),a===null&&Cd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Cd(e,t,r,null,n)}}function dp(e){return e=Ut(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=rt(e),e!==null){var t=s(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=l(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(he()){case ge:return 2;case _e:return 8;case ve:case ye:return 32;case be:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=it(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=rt(e.target);if(t!==null){var n=s(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,Ke(e.priority,function(){op(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,Ke(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ht=r,n.target.dispatchEvent(r),Ht=null}else return t=it(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=it(n);a!==null&&(e.splice(t,3),t-=3,gs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Ye]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Ye]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;np(n,uu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),_u(),t[Xe]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ge();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.5`)throw Error(a(527,Lp,`19.2.5`));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=d(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Ce=zp.inject(Rp),we=zp}catch{}}e.createRoot=function(e,t){if(!o(e))throw Error(a(299));var n=!1,r=``,i=zs,s=Bs,c=Vs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,i,s,c,Pp),e[Xe]=t.current,xd(e),new Fp(t)}})),Ks=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Gs()})),qs=Ei(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),Js=Ei(`arrow-up-down`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]),Ys=Ei(`bird`,[[`path`,{d:`M16 7h.01`,key:`1kdx03`}],[`path`,{d:`M3.4 18H12a8 8 0 0 0 8-8V7a4 4 0 0 0-7.28-2.3L2 20`,key:`oj1oa8`}],[`path`,{d:`m20 7 2 .5-2 .5`,key:`12nv4d`}],[`path`,{d:`M10 18v3`,key:`1yea0a`}],[`path`,{d:`M14 17.75V21`,key:`1pymcb`}],[`path`,{d:`M7 18a6 6 0 0 0 3.84-10.61`,key:`1npnn0`}]]),Xs=Ei(`bold`,[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]),Z=i(),Q=e(r(),1),Zs=e(Li(),1),Qs=Ks(),$=a(),$s=[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]];Ei(`bot`,$s);var ec=Ei(`case-sensitive`,[[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M22 9v7`,key:`pvm9v3`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}],[`circle`,{cx:`18.5`,cy:`12.5`,r:`3.5`,key:`z97x68`}]]),tc=Ei(`cat`,[[`path`,{d:`M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z`,key:`x6xyqk`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M11.25 16.25h1.5L12 17l-.75-.75Z`,key:`12kq1m`}]]),nc=Ei(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),rc=Ei(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),ic=Ei(`cloud-off`,[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),ac=Ei(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),oc=Ei(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),sc=Ei(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),cc=Ei(`columns-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),lc=Ei(`compass`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]),uc=Ei(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),dc=Ei(`diamond`,[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`,key:`1f1r0c`}]]),fc=Ei(`dog`,[[`path`,{d:`M11.25 16.25h1.5L12 17z`,key:`w7jh35`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309`,key:`u7s9ue`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5`,key:`v8hric`}]]),pc=Ei(`file-archive`,[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]),mc=Ei(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),hc=Ei(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),gc=Ei(`fish`,[[`path`,{d:`M6.5 12c.94-3.46 4.94-6 8.5-6 3.56 0 6.06 2.54 7 6-.94 3.47-3.44 6-7 6s-7.56-2.53-8.5-6Z`,key:`15baut`}],[`path`,{d:`M18 12v.5`,key:`18hhni`}],[`path`,{d:`M16 17.93a9.77 9.77 0 0 1 0-11.86`,key:`16dt7o`}],[`path`,{d:`M7 10.67C7 8 5.58 5.97 2.73 5.5c-1 1.5-1 5 .23 6.5-1.24 1.5-1.24 5-.23 6.5C5.58 18.03 7 16 7 13.33`,key:`l9di03`}],[`path`,{d:`M10.46 7.26C10.2 5.88 9.17 4.24 8 3h5.8a2 2 0 0 1 1.98 1.67l.23 1.4`,key:`1kjonw`}],[`path`,{d:`m16.01 17.93-.23 1.4A2 2 0 0 1 13.8 21H9.5a5.96 5.96 0 0 0 1.49-3.98`,key:`1zlm23`}]]),_c=Ei(`fold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3-3-3 3`,key:`e37ymu`}],[`path`,{d:`m15 5-3 3-3-3`,key:`19d6lf`}]]),vc=Ei(`folder-cog`,[[`path`,{d:`M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.98a2 2 0 0 1 1.69.9l.66 1.2A2 2 0 0 0 12 6h8a2 2 0 0 1 2 2v3.3`,key:`128dxu`}],[`path`,{d:`m14.305 19.53.923-.382`,key:`3m78fa`}],[`path`,{d:`m15.228 16.852-.923-.383`,key:`npixar`}],[`path`,{d:`m16.852 15.228-.383-.923`,key:`5xggr7`}],[`path`,{d:`m16.852 20.772-.383.924`,key:`dpfhf9`}],[`path`,{d:`m19.148 15.228.383-.923`,key:`1reyyz`}],[`path`,{d:`m19.53 21.696-.382-.924`,key:`1goivc`}],[`path`,{d:`m20.772 16.852.924-.383`,key:`htqkph`}],[`path`,{d:`m20.772 19.148.924.383`,key:`9w9pjp`}],[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}]]),yc=Ei(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),bc=Ei(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),xc=Ei(`grid-2x2-x`,[[`path`,{d:`M12 3v17a1 1 0 0 1-1 1H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v6a1 1 0 0 1-1 1H3`,key:`11za1p`}],[`path`,{d:`m16 16 5 5`,key:`8tpb07`}],[`path`,{d:`m16 21 5-5`,key:`193jll`}]]),Sc=Ei(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]),Cc=Ei(`highlighter`,[[`path`,{d:`m9 11-6 6v3h9l3-3`,key:`1a3l36`}],[`path`,{d:`m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`,key:`14a9rk`}]]),wc=Ei(`italic`,[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]),Tc=Ei(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),Ec=Ei(`library`,[[`path`,{d:`m16 6 4 14`,key:`ji33uf`}],[`path`,{d:`M12 6v14`,key:`1n7gus`}],[`path`,{d:`M8 8v12`,key:`1gg7y9`}],[`path`,{d:`M4 4v16`,key:`6qkkli`}]]),Dc=Ei(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),Oc=Ei(`list-collapse`,[[`path`,{d:`M10 5h11`,key:`1hkqpe`}],[`path`,{d:`M10 12h11`,key:`6m4ad9`}],[`path`,{d:`M10 19h11`,key:`14g2nv`}],[`path`,{d:`m3 10 3-3-3-3`,key:`i7pm08`}],[`path`,{d:`m3 20 3-3-3-3`,key:`20gx1n`}]]),kc=Ei(`list-plus`,[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]),Ac=Ei(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),jc=Ei(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),Mc=Ei(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),Nc=Ei(`octagon-x`,[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Pc=Ei(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),Fc=Ei(`panel-left-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),Ic=Ei(`panel-right-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),Lc=Ei(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),Rc=Ei(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),zc=Ei(`pilcrow`,[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]),Bc=Ei(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),Vc=Ei(`rabbit`,[[`path`,{d:`M13 16a3 3 0 0 1 2.24 5`,key:`1epib5`}],[`path`,{d:`M18 12h.01`,key:`yjnet6`}],[`path`,{d:`M18 21h-8a4 4 0 0 1-4-4 7 7 0 0 1 7-7h.2L9.6 6.4a1 1 0 1 1 2.8-2.8L15.8 7h.2c3.3 0 6 2.7 6 6v1a2 2 0 0 1-2 2h-1a3 3 0 0 0-3 3`,key:`ue9ozu`}],[`path`,{d:`M20 8.54V4a2 2 0 1 0-4 0v3`,key:`49iql8`}],[`path`,{d:`M7.612 12.524a3 3 0 1 0-1.6 4.3`,key:`1e33i0`}]]),Hc=Ei(`rat`,[[`path`,{d:`M13 22H4a2 2 0 0 1 0-4h12`,key:`bt3f23`}],[`path`,{d:`M13.236 18a3 3 0 0 0-2.2-5`,key:`1tbvmo`}],[`path`,{d:`M16 9h.01`,key:`1bdo4e`}],[`path`,{d:`M16.82 3.94a3 3 0 1 1 3.237 4.868l1.815 2.587a1.5 1.5 0 0 1-1.5 2.1l-2.872-.453a3 3 0 0 0-3.5 3`,key:`9ch7kn`}],[`path`,{d:`M17 4.988a3 3 0 1 0-5.2 2.052A7 7 0 0 0 4 14.015 4 4 0 0 0 8 18`,key:`3s7e9i`}]]),Uc=Ei(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Wc=Ei(`replace-all`,[[`path`,{d:`M14 14a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1`,key:`zg1ipl`}],[`path`,{d:`M14 4a1 1 0 0 1 1-1`,key:`dhj8ez`}],[`path`,{d:`M15 10a1 1 0 0 1-1-1`,key:`1mnyi5`}],[`path`,{d:`M19 14a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1`,key:`txt6k4`}],[`path`,{d:`M21 4a1 1 0 0 0-1-1`,key:`sfs9ap`}],[`path`,{d:`M21 9a1 1 0 0 1-1 1`,key:`mp6qeo`}],[`path`,{d:`m3 7 3 3 3-3`,key:`x25e72`}],[`path`,{d:`M6 10V5a2 2 0 0 1 2-2h2`,key:`15xut4`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}]]),Gc=Ei(`replace`,[[`path`,{d:`M14 4a1 1 0 0 1 1-1`,key:`dhj8ez`}],[`path`,{d:`M15 10a1 1 0 0 1-1-1`,key:`1mnyi5`}],[`path`,{d:`M21 4a1 1 0 0 0-1-1`,key:`sfs9ap`}],[`path`,{d:`M21 9a1 1 0 0 1-1 1`,key:`mp6qeo`}],[`path`,{d:`m3 7 3 3 3-3`,key:`x25e72`}],[`path`,{d:`M6 10V5a2 2 0 0 1 2-2h2`,key:`15xut4`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}]]),Kc=Ei(`rows-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}]]),qc=Ei(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Jc=Ei(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Yc=Ei(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),Xc=Ei(`shrimp`,[[`path`,{d:`M11 12h.01`,key:`1lr4k6`}],[`path`,{d:`M13 22c.5-.5 1.12-1 2.5-1-1.38 0-2-.5-2.5-1`,key:`fatpdi`}],[`path`,{d:`M14 2a3.28 3.28 0 0 1-3.227 1.798l-6.17-.561A2.387 2.387 0 1 0 4.387 8H15.5a1 1 0 0 1 0 13 1 1 0 0 0 0-5H12a7 7 0 0 1-7-7V8`,key:`kehrqe`}],[`path`,{d:`M14 8a8.5 8.5 0 0 1 0 8`,key:`1imjx2`}],[`path`,{d:`M16 16c2 0 4.5-4 4-6`,key:`z0nejz`}]]),Zc=Ei(`snail`,[[`path`,{d:`M2 13a6 6 0 1 0 12 0 4 4 0 1 0-8 0 2 2 0 0 0 4 0`,key:`hneq2s`}],[`circle`,{cx:`10`,cy:`13`,r:`8`,key:`194lz3`}],[`path`,{d:`M2 21h12c4.4 0 8-3.6 8-8V7a2 2 0 1 0-4 0v6`,key:`ixqyt7`}],[`path`,{d:`M18 3 19.1 5.2`,key:`9tjm43`}],[`path`,{d:`M22 3 20.9 5.2`,key:`j3odrs`}]]),Qc=Ei(`square-code`,[[`path`,{d:`m10 9-3 3 3 3`,key:`1oro0q`}],[`path`,{d:`m14 15 3-3-3-3`,key:`bz13h7`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),$c=Ei(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),el=Ei(`squirrel`,[[`path`,{d:`M15.236 22a3 3 0 0 0-2.2-5`,key:`21bitc`}],[`path`,{d:`M16 20a3 3 0 0 1 3-3h1a2 2 0 0 0 2-2v-2a4 4 0 0 0-4-4V4`,key:`oh0fg0`}],[`path`,{d:`M18 13h.01`,key:`9veqaj`}],[`path`,{d:`M18 6a4 4 0 0 0-4 4 7 7 0 0 0-7 7c0-5 4-5 4-10.5a4.5 4.5 0 1 0-9 0 2.5 2.5 0 0 0 5 0C7 10 3 11 3 17c0 2.8 2.2 5 5 5h10`,key:`980v8a`}]]),tl=Ei(`sticky-note`,[[`path`,{d:`M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z`,key:`1dfntj`}],[`path`,{d:`M15 3v5a1 1 0 0 0 1 1h5`,key:`6s6qgf`}]]),nl=Ei(`strikethrough`,[[`path`,{d:`M16 4H9a3 3 0 0 0-2.83 4`,key:`43sutm`}],[`path`,{d:`M14 12a4 4 0 0 1 0 8H6`,key:`nlfj13`}],[`line`,{x1:`4`,x2:`20`,y1:`12`,y2:`12`,key:`1e0a9i`}]]),rl=Ei(`table-properties`,[[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]),il=Ei(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),al=Ei(`turtle`,[[`path`,{d:`m12 10 2 4v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3a8 8 0 1 0-16 0v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3l2-4h4Z`,key:`1lbbv7`}],[`path`,{d:`M4.82 7.9 8 10`,key:`m9wose`}],[`path`,{d:`M15.18 7.9 12 10`,key:`p8dp2u`}],[`path`,{d:`M16.93 10H20a2 2 0 0 1 0 4H2`,key:`12nsm7`}]]),ol=Ei(`underline`,[[`path`,{d:`M6 4v6a6 6 0 0 0 12 0V4`,key:`9kb039`}],[`line`,{x1:`4`,x2:`20`,y1:`20`,y2:`20`,key:`nun2al`}]]),sl=Ei(`unfold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m15 5-3-3-3 3`,key:`itvq4r`}]]),cl=Ei(`user-cog`,[[`path`,{d:`M10 15H6a4 4 0 0 0-4 4v2`,key:`1nfge6`}],[`path`,{d:`m14.305 16.53.923-.382`,key:`1itpsq`}],[`path`,{d:`m15.228 13.852-.923-.383`,key:`eplpkm`}],[`path`,{d:`m16.852 12.228-.383-.923`,key:`13v3q0`}],[`path`,{d:`m16.852 17.772-.383.924`,key:`1i8mnm`}],[`path`,{d:`m19.148 12.228.383-.923`,key:`1q8j1v`}],[`path`,{d:`m19.53 18.696-.382-.924`,key:`vk1qj3`}],[`path`,{d:`m20.772 13.852.924-.383`,key:`n880s0`}],[`path`,{d:`m20.772 16.148.924.383`,key:`1g6xey`}],[`circle`,{cx:`18`,cy:`15`,r:`3`,key:`gjjjvw`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),ll=Ei(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),ul=Ei(`whole-word`,[[`circle`,{cx:`7`,cy:`12`,r:`3`,key:`12clwm`}],[`path`,{d:`M10 9v6`,key:`17i7lo`}],[`circle`,{cx:`17`,cy:`12`,r:`3`,key:`gl7c2s`}],[`path`,{d:`M14 7v8`,key:`dl84cr`}],[`path`,{d:`M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1`,key:`lt2kga`}]]);function dl(e,t){return e instanceof Error&&e.message?e.message:t}async function fl(e,t,n,r=`action`){try{n(null),await e()}catch(e){console.error(`[${r}] action failed:`,e),n(dl(e,t))}}async function pl(e,t,n=X,r=`action`){await fl(e,t,e=>{e!==null&&n.error(e)},r)}function ml(e){let t=/\/([^/]+?)(?:\.git)?\/?$/.exec(e);return t?t[1]:`repo`}function hl(e){return{async getAuthStatus(){return e.authQueryTransport.status()},async startSignIn(){return e.openSignIn()},async runClone({url:t}){let n=await e.bridge.dialog.openFolder();if(!n)return{kind:`cancelled`};let r=ml(t),i=`${n.replace(/\/$/,``)}/${r}`,a=X.loading(`Cloning ${r}...`,{duration:1/0}),o=e.cloneTransport.start({url:t,dir:i});try{for await(let e of o.events){if(e.type===`progress`){X.loading(`Cloning ${r}...`,{id:a,description:`${e.phase} — ${Math.round(e.pct)}%`,duration:1/0});continue}if(e.type===`complete`)return X.success(`Cloned ${r}.`,{id:a,duration:4e3}),{kind:`ok`,dir:e.dir};if(e.type===`error`)return X.error(`Clone failed: ${e.message}`,{id:a,duration:8e3}),{kind:`error`}}return X.error(`Clone ended unexpectedly.`,{id:a,duration:8e3}),{kind:`error`}}catch(e){let t=e instanceof Error?e.message:`Unknown error`;return X.error(`Clone failed: ${t}`,{id:a,duration:8e3}),{kind:`error`}}}}}async function gl(e){try{let t=await e.json(),n=gr.safeParse(t);if(n.success)return n.data.title}catch{}}async function _l(e,t){return fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t??{})})}function vl(e){let t=e.split(`
11
- `);for(let e=t.length-1;e>=0;e--){let n=t[e]?.trim();if(n)try{let e=JSON.parse(n);if(e&&typeof e==`object`)return e}catch{}}return null}function yl(){return{async status(e){let t=e?.host??`github.com`,n=await _l(`/api/local-op/auth/status`,e);if(!n.ok)return{authenticated:!1,host:t,error:await gl(n)};let r=await n.json(),i=typeof r.host==`string`?r.host:t;if(r.authenticated===!0&&typeof r.login==`string`){let e=r.tier===`A`||r.tier===`B`||r.tier===`C`?r.tier:void 0;return{authenticated:!0,host:i,login:r.login,tier:e,name:typeof r.name==`string`?r.name:void 0,email:typeof r.email==`string`?r.email:void 0}}return{authenticated:!1,host:i,error:typeof r.error==`string`?r.error:void 0}},async repos(e){let t=e?.host??`github.com`,n=await _l(`/api/local-op/auth/repos`,e);if(!n.ok)return{ok:!1,error:await gl(n)??`Failed to fetch repositories`};let r=vl(await n.text());if(r&&r.type===`error`&&r.problem&&typeof r.problem==`object`){let e=r.problem;return{ok:!1,error:e.detail||e.title||`Failed to fetch repositories`}}if(!r||!Array.isArray(r.repos))return{ok:!1,error:`Failed to fetch repositories`};let i=[];for(let e of r.repos){let t=e;typeof t?.full_name==`string`&&typeof t.clone_url==`string`&&i.push({full_name:t.full_name,clone_url:t.clone_url,private:t.private===!0})}return{ok:!0,host:typeof r.host==`string`?r.host:t,repos:i}}}}function bl(e){return{status:t=>e.localOp.authStatus(t),repos:t=>e.localOp.authRepos(t)}}async function xl(e,t){let n=e.getReader(),r=new TextDecoder,i=``;for(;;){let{done:e,value:a}=await n.read();if(e)return i+=r.decode(),!!(i.trim()&&t(i)===`terminal`);i+=r.decode(a,{stream:!0});let o=i.split(`
12
- `);i=o.pop()??``;for(let e of o)if(e.trim()&&t(e)===`terminal`)return!0}}function Sl(e){let t=[],n=[],r=new AbortController,i=!1,a=()=>{for(let e of n.splice(0))e(null)};return e(e=>{i||(n.length>0?n.shift()?.(e):t.push(e),(e.type===`complete`||e.type===`error`)&&(i=!0,r.abort(),a()))},r.signal),{events:{[Symbol.asyncIterator](){return{async next(){if(t.length>0){let e=t.shift();return e===void 0?{value:void 0,done:!0}:{value:e,done:!1}}return i?{value:void 0,done:!0}:new Promise(e=>{n.push(t=>{e(t===null?{value:void 0,done:!0}:{value:t,done:!1})})})}}}},cancel:()=>{i||(i=!0,r.abort(),a())}}}function Cl(){return{start(){return Sl((e,t)=>{(async()=>{try{let n=await fetch(`/api/local-op/auth/login`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({json:!0}),signal:t});if(!n.ok){let t=`Failed to start sign-in — try again`;try{let e=await n.json(),r=gr.safeParse(e);r.success&&(t=r.data.title)}catch{}e({type:`error`,message:t});return}if(!n.body){e({type:`error`,message:`Failed to start sign-in — try again`});return}!await xl(n.body,t=>{let n;try{n=JSON.parse(t)}catch{return console.warn(`[auth-transport] Dropped unparseable NDJSON line:`,t.slice(0,100)),`continue`}if(n&&typeof n==`object`&&n.type===`error`&&`problem`in n){let t=n.problem;return e({type:`error`,message:t?.detail||t?.title||`Unknown error`}),`terminal`}let r=n;return e(r),r.type===`complete`||r.type===`error`?`terminal`:`continue`})&&!t.aborted&&e({type:`error`,message:`Sign-in stream ended without confirmation — please try again`})}catch(t){if(t instanceof Error&&t.name===`AbortError`)return;e({type:`error`,message:`Connection error — try again`})}})()})}}}function wl(e){return{start(){return e.localOp.auth.start()}}}function Tl(){return{start(e){return Sl((t,n)=>{(async()=>{try{let r=await fetch(`/api/local-op/clone`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({url:e.url,dir:e.dir||void 0}),signal:n});if(!r.ok){let e=`Clone failed — check the URL and try again (${r.status})`;try{let t=await r.json(),n=gr.safeParse(t);n.success&&(e=`Clone failed: ${n.data.title}`)}catch{}t({type:`error`,message:e});return}if(!r.body){t({type:`error`,message:`Clone failed — empty response body`});return}let i=r.body.getReader(),a=new TextDecoder,o=``;for(;;){let{done:e,value:r}=await i.read();if(e)break;o+=a.decode(r,{stream:!0});let s=o.split(`
13
- `);o=s.pop()??``;for(let e of s){if(!e.trim())continue;let n;try{n=JSON.parse(e)}catch{console.warn(`[clone-transport] Dropped unparseable NDJSON line:`,e.slice(0,100));continue}if(n&&typeof n==`object`&&n.type===`error`&&`problem`in n){let e=n.problem;t({type:`error`,message:e?.detail||e?.title||`Unknown error`});break}t(n)}if(n.aborted)break}n.aborted||t({type:`error`,message:`Clone stream ended unexpectedly — check if the clone completed`})}catch(e){if(e instanceof Error&&e.name===`AbortError`)return;t({type:`error`,message:`Clone failed — connection error`})}})()})}}}function El(e){return{start(t){return e.localOp.clone.start(t)}}}var Dl=`ContextMenu`,[Ol,kl]=Fi(Dl,[oa]),Al=oa(),[jl,Ml]=Ol(Dl),Nl=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:a=!0}=e,[o,s]=Q.useState(!1),c=Al(t),l=Pi(r),u=Q.useCallback(e=>{s(e),l(e)},[l]);return(0,Z.jsx)(jl,{scope:t,open:o,onOpenChange:u,modal:a,children:(0,Z.jsx)(Ta,{...c,dir:i,open:o,onOpenChange:u,modal:a,children:n})})};Nl.displayName=Dl;var Pl=`ContextMenuTrigger`,Fl=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,disabled:r=!1,...i}=e,a=Ml(Pl,n),o=Al(n),s=Q.useRef({x:0,y:0}),c=Q.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),l=Q.useRef(0),u=Q.useCallback(()=>window.clearTimeout(l.current),[]),d=e=>{s.current={x:e.clientX,y:e.clientY},a.onOpenChange(!0)};return Q.useEffect(()=>u,[u]),Q.useEffect(()=>void(r&&u()),[r,u]),(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Va,{...o,virtualRef:c}),(0,Z.jsx)(Ni.span,{"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,...i,ref:t,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:r?e.onContextMenu:Ai(e.onContextMenu,e=>{u(),d(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:Ai(e.onPointerDown,uu(e=>{u(),l.current=window.setTimeout(()=>d(e),700)})),onPointerMove:r?e.onPointerMove:Ai(e.onPointerMove,uu(u)),onPointerCancel:r?e.onPointerCancel:Ai(e.onPointerCancel,uu(u)),onPointerUp:r?e.onPointerUp:Ai(e.onPointerUp,uu(u))})]})});Fl.displayName=Pl;var Il=`ContextMenuPortal`,Ll=e=>{let{__scopeContextMenu:t,...n}=e,r=Al(t);return(0,Z.jsx)(So,{...r,...n})};Ll.displayName=Il;var Rl=`ContextMenuContent`,zl=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ml(Rl,n),a=Al(n),o=Q.useRef(!1);return(0,Z.jsx)(eo,{...a,...r,ref:t,side:`right`,sideOffset:2,align:`start`,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),!t.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});zl.displayName=Rl;var Bl=`ContextMenuGroup`,Vl=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Al(n);return(0,Z.jsx)(qa,{...i,...r,ref:t})});Vl.displayName=Bl;var Hl=`ContextMenuLabel`,Ul=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Al(n);return(0,Z.jsx)(go,{...i,...r,ref:t})});Ul.displayName=Hl;var Wl=`ContextMenuItem`,Gl=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Al(n);return(0,Z.jsx)(Ga,{...i,...r,ref:t})});Gl.displayName=Wl;var Kl=`ContextMenuCheckboxItem`,ql=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Al(n);return(0,Z.jsx)(ao,{...i,...r,ref:t})});ql.displayName=Kl;var Jl=`ContextMenuRadioGroup`,Yl=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Al(n);return(0,Z.jsx)(za,{...i,...r,ref:t})});Yl.displayName=Jl;var Xl=`ContextMenuRadioItem`,Zl=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Al(n);return(0,Z.jsx)(bo,{...i,...r,ref:t})});Zl.displayName=Xl;var Ql=`ContextMenuItemIndicator`,$l=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Al(n);return(0,Z.jsx)(Fa,{...i,...r,ref:t})});$l.displayName=Ql;var eu=`ContextMenuSeparator`,tu=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Al(n);return(0,Z.jsx)(ia,{...i,...r,ref:t})});tu.displayName=eu;var nu=`ContextMenuArrow`,ru=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Al(n);return(0,Z.jsx)(Ua,{...i,...r,ref:t})});ru.displayName=nu;var iu=`ContextMenuSub`,au=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:a}=e,o=Al(t),[s,c]=Mi({prop:i,defaultProp:a??!1,onChange:r,caller:iu});return(0,Z.jsx)(vo,{...o,open:s,onOpenChange:c,children:n})};au.displayName=iu;var ou=`ContextMenuSubTrigger`,su=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Al(n);return(0,Z.jsx)(ca,{...i,...r,ref:t})});su.displayName=ou;var cu=`ContextMenuSubContent`,lu=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Al(n);return(0,Z.jsx)(Da,{...i,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});lu.displayName=cu;function uu(e){return t=>t.pointerType===`mouse`?void 0:e(t)}var du=Nl,fu=Fl,pu=Ll,mu=zl,hu=Gl,gu=ql,_u=$l,vu=tu,yu=au,bu=su,xu=lu,Su=`Radio`,[Cu,wu]=Fi(Su),[Tu,Eu]=Cu(Su),Du=Q.forwardRef((e,t)=>{let{__scopeRadio:n,name:r,checked:i=!1,required:a,disabled:o,value:s=`on`,onCheck:c,form:l,...u}=e,[d,f]=Q.useState(null),p=Oi(t,e=>f(e)),m=Q.useRef(!1),h=d?l||!!d.closest(`form`):!0;return(0,Z.jsxs)(Tu,{scope:n,checked:i,disabled:o,children:[(0,Z.jsx)(Ni.button,{type:`button`,role:`radio`,"aria-checked":i,"data-state":Mu(i),"data-disabled":o?``:void 0,disabled:o,value:s,...u,ref:p,onClick:Ai(e.onClick,e=>{i||c?.(),h&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})}),h&&(0,Z.jsx)(ju,{control:d,bubbles:!m.current,name:r,value:s,checked:i,required:a,disabled:o,form:l,style:{transform:`translateX(-100%)`}})]})});Du.displayName=Su;var Ou=`RadioIndicator`,ku=Q.forwardRef((e,t)=>{let{__scopeRadio:n,forceMount:r,...i}=e,a=Eu(Ou,n);return(0,Z.jsx)(ki,{present:r||a.checked,children:(0,Z.jsx)(Ni.span,{"data-state":Mu(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})})});ku.displayName=Ou;var Au=`RadioBubbleInput`,ju=Q.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=Q.useRef(null),s=Oi(o,a),c=Fo(n),l=Ii(t);return Q.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,Z.jsx)(Ni.input,{type:`radio`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...l,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});ju.displayName=Au;function Mu(e){return e?`checked`:`unchecked`}var Nu=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Pu=`RadioGroup`,[Fu,Iu]=Fi(Pu,[Zo,wu]),Lu=Zo(),Ru=wu(),[zu,Bu]=Fu(Pu),Vu=Q.forwardRef((e,t)=>{let{__scopeRadioGroup:n,name:r,defaultValue:i,value:a,required:o=!1,disabled:s=!1,orientation:c,dir:l,loop:u=!0,onValueChange:d,...f}=e,p=Lu(n),m=Jn(l),[h,g]=Mi({prop:a,defaultProp:i??null,onChange:d,caller:Pu});return(0,Z.jsx)(zu,{scope:n,name:r,required:o,disabled:s,value:h,onValueChange:g,children:(0,Z.jsx)(Jo,{asChild:!0,...p,orientation:c,dir:m,loop:u,children:(0,Z.jsx)(Ni.div,{role:`radiogroup`,"aria-required":o,"aria-orientation":c,"data-disabled":s?``:void 0,dir:m,...f,ref:t})})})});Vu.displayName=Pu;var Hu=`RadioGroupItem`,Uu=Q.forwardRef((e,t)=>{let{__scopeRadioGroup:n,disabled:r,...i}=e,a=Bu(Hu,n),o=a.disabled||r,s=Lu(n),c=Ru(n),l=Q.useRef(null),u=Oi(t,l),d=a.value===i.value,f=Q.useRef(!1);return Q.useEffect(()=>{let e=e=>{Nu.includes(e.key)&&(f.current=!0)},t=()=>f.current=!1;return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),(0,Z.jsx)(Yo,{asChild:!0,...s,focusable:!o,active:d,children:(0,Z.jsx)(Du,{disabled:o,required:a.required,checked:d,...c,...i,name:a.name,ref:u,onCheck:()=>a.onValueChange(i.value),onKeyDown:Ai(e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:Ai(i.onFocus,()=>{f.current&&l.current?.click()})})})});Uu.displayName=Hu;var Wu=`RadioGroupIndicator`,Gu=Q.forwardRef((e,t)=>{let{__scopeRadioGroup:n,...r}=e;return(0,Z.jsx)(ku,{...Ru(n),...r,ref:t})});Gu.displayName=Wu;var Ku=Vu,qu=Uu,Ju=Gu;async function Yu(e){try{await navigator.clipboard.writeText(e)}catch{}}var Xu=120*1e3;function Zu(e){let t=(0,$.c)(28),{onSuccess:n,onCancel:r,transport:i}=e,{_:a}=Gt(),[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(`https://github.com/login/device`),[u,d]=(0,Q.useState)(!1),[f,p]=(0,Q.useState)(null),[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(Xu),v=(0,Q.useRef)(null),y=(0,Q.useRef)(null),b;t[0]!==a||t[1]!==n||t[2]!==i?(b=async function(){p(null),h(!0);try{let e=i.start();v.current=e.cancel;let t=e.events[Symbol.asyncIterator](),r=!1,o=await t.next();for(;!o.done;){let e=o.value;if(e.type===`verification`)s(e.user_code),l(e.verification_uri),_(e.expires_in*1e3),Yu(e.user_code).then(()=>{d(!0),setTimeout(()=>d(!1),2e3)});else if(e.type===`complete`){r=!0,h(!1),n({login:e.login,name:e.name,email:e.email,avatarUrl:e.avatarUrl});break}else if(e.type===`error`){r=!0,p(e.message),h(!1);break}o=await t.next()}r||(p(a({id:`DskIkK`})),h(!1))}catch(e){let t=e;t instanceof Error&&t.name!==`AbortError`&&p(a({id:`Q5fqMz`})),h(!1)}},t[0]=a,t[1]=n,t[2]=i,t[3]=b):b=t[3];let x=b,S;t[4]===x?S=t[5]:(S=()=>{let e=!1;return queueMicrotask(()=>{e||x()}),()=>{e=!0,v.current?.(),v.current=null,y.current&&clearInterval(y.current)}},t[4]=x,t[5]=S);let C;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(C=[],t[6]=C):C=t[6],(0,Q.useEffect)(S,C);let w,T;t[7]!==a||t[8]!==o?(w=()=>{if(!o)return;let e=Date.now();return y.current=setInterval(()=>{let t=Xu-(Date.now()-e);t<=0?(_(0),y.current&&clearInterval(y.current),p(a({id:`ve8vEM`}))):_(t)},1e3),()=>{y.current&&clearInterval(y.current)}},T=[o,a],t[7]=a,t[8]=o,t[9]=w,t[10]=T):(w=t[9],T=t[10]),(0,Q.useEffect)(w,T);let E=Math.floor(g/6e4),D=Math.floor(g%6e4/1e3),O;t[11]===D?O=t[12]:(O=D.toString().padStart(2,`0`),t[11]=D,t[12]=O);let k=`${E}:${O}`,A;t[13]!==u||t[14]!==f||t[15]!==k||t[16]!==o||t[17]!==c?(A=o?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,Z.jsx)(qt,{id:`AVoO4B`,values:{verificationUri:c},components:{0:(0,Z.jsx)(`a`,{href:c,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>ba(e,c),onAuxClick:e=>ba(e,c),className:`underline underline-offset-2`})}})}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`code`,{className:`flex-1 text-center text-2xl font-mono font-bold tracking-widest border rounded-md py-3 bg-muted`,children:o}),(0,Z.jsx)(Y,{variant:`outline`,size:`sm`,onClick:()=>void Yu(o).then(()=>{d(!0),setTimeout(()=>d(!1),2e3)}),children:u?(0,Z.jsx)(qt,{id:`PiH3UR`}):(0,Z.jsx)(qt,{id:`he3ygx`})})]}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`size-1.5 rounded-full bg-amber-500 animate-pulse`}),(0,Z.jsx)(qt,{id:`5y_9lO`})]}),(0,Z.jsx)(`span`,{children:(0,Z.jsx)(qt,{id:`gYz2ep`,values:{timeLabel:k}})})]})]}):(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-6 text-sm text-muted-foreground`,children:f?null:(0,Z.jsx)(qt,{id:`aWlJai`})}),t[13]=u,t[14]=f,t[15]=k,t[16]=o,t[17]=c,t[18]=A):A=t[18];let j;t[19]===f?j=t[20]:(j=f&&(0,Z.jsx)(`p`,{className:`text-sm text-destructive`,children:f}),t[19]=f,t[20]=j);let M;t[21]!==r||t[22]!==m?(M=m&&(0,Z.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:r,children:(0,Z.jsx)(qt,{id:`dEgA5A`})}),t[21]=r,t[22]=m,t[23]=M):M=t[23];let N;return t[24]!==A||t[25]!==j||t[26]!==M?(N=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[A,j,M]}),t[24]=A,t[25]=j,t[26]=M,t[27]=N):N=t[27],N}function Qu(e){let t=(0,$.c)(38),{onSuccess:n,onCancel:r}=e,{_:i}=Gt(),[a,o]=(0,Q.useState)(``),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(null),d=(0,Q.useRef)(null),f,p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>()=>{d.current?.abort()},p=[],t[0]=f,t[1]=p):(f=t[0],p=t[1]),(0,Q.useEffect)(f,p);let m;t[2]!==i||t[3]!==n||t[4]!==a?(m=async function(){if(!a.trim()){u(i({id:`6nB8LV`}));return}d.current?.abort();let e=new AbortController;d.current=e,c(!0),u(null);try{let t=await fetch(`/api/local-op/auth/pat`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({pat:a.trim()}),signal:e.signal});if(!t.ok){let e=i({id:`TmKshB`});try{let n=await t.json(),r=gr.safeParse(n);r.success&&(e=r.data.title)}catch{}u(e),c(!1);return}if(!t.body){u(i({id:`TmKshB`})),c(!1);return}await xl(t.body,e=>{let t;try{t=JSON.parse(e)}catch{return`continue`}return t.type===`complete`?(n({login:t.login,name:t.name,email:t.email}),c(!1),`terminal`):`continue`})||u(i({id:`muWKMD`}))}catch(e){let t=e;t instanceof Error&&t.name!==`AbortError`&&u(i({id:`Q5fqMz`}))}c(!1)},t[2]=i,t[3]=n,t[4]=a,t[5]=m):m=t[5];let h=m,g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,Z.jsx)(qt,{id:`dGaH3A`,components:{0:(0,Z.jsx)(`a`,{href:`https://github.com/settings/tokens`,target:`_blank`,rel:`noopener noreferrer`,onClick:ed,onAuxClick:$u,className:`underline underline-offset-2`}),1:(0,Z.jsx)(`code`,{className:`text-xs bg-muted px-1 rounded`})}})}),t[6]=g):g=t[6];let _;t[7]===i?_=t[8]:(_=i({id:`p2LEhJ`}),t[7]=i,t[8]=_);let v;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>o(e.target.value),t[9]=v):v=t[9];let y;t[10]===h?y=t[11]:(y=e=>{e.key===`Enter`&&h()},t[10]=h,t[11]=y);let b;t[12]!==s||t[13]!==a||t[14]!==_||t[15]!==y?(b=(0,Z.jsx)(Wo,{type:`password`,"aria-label":_,placeholder:`ghp_…`,value:a,onChange:v,disabled:s,onKeyDown:y}),t[12]=s,t[13]=a,t[14]=_,t[15]=y,t[16]=b):b=t[16];let x;t[17]===l?x=t[18]:(x=l&&(0,Z.jsx)(`p`,{className:`text-sm text-destructive`,children:l}),t[17]=l,t[18]=x);let S;t[19]===h?S=t[20]:(S=()=>void h(),t[19]=h,t[20]=S);let C;t[21]===s?C=t[22]:(C=s?(0,Z.jsx)(qt,{id:`hYFQsG`}):(0,Z.jsx)(qt,{id:`zXZJoN`}),t[21]=s,t[22]=C);let w;t[23]!==s||t[24]!==S||t[25]!==C?(w=(0,Z.jsx)(Y,{className:`flex-1`,onClick:S,disabled:s,children:C}),t[23]=s,t[24]=S,t[25]=C,t[26]=w):w=t[26];let T;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsx)(qt,{id:`dEgA5A`}),t[27]=T):T=t[27];let E;t[28]!==s||t[29]!==r?(E=(0,Z.jsx)(Y,{variant:`ghost`,onClick:r,disabled:s,children:T}),t[28]=s,t[29]=r,t[30]=E):E=t[30];let D;t[31]!==w||t[32]!==E?(D=(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[w,E]}),t[31]=w,t[32]=E,t[33]=D):D=t[33];let O;return t[34]!==D||t[35]!==b||t[36]!==x?(O=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[g,b,x,D]}),t[34]=D,t[35]=b,t[36]=x,t[37]=O):O=t[37],O}function $u(e){return ba(e,`https://github.com/settings/tokens`)}function ed(e){return ba(e,`https://github.com/settings/tokens`)}function td(e){let t=(0,$.c)(41),{login:n,onSave:r,onSkip:i}=e,{_:a}=Gt(),[o,s]=(0,Q.useState)(``),[c,l]=(0,Q.useState)(``),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,Z.jsx)(qt,{id:`gp3I7-`})}),t[0]=u):u=t[0];let d;t[1]===a?d=t[2]:(d=a({id:`6YtxFj`}),t[1]=a,t[2]=d);let f;t[3]!==a||t[4]!==n?(f=a({id:`J2Mv98`,values:{login:n}}),t[3]=a,t[4]=n,t[5]=f):f=t[5];let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>s(e.target.value),t[6]=p):p=t[6];let m;t[7]!==o||t[8]!==d||t[9]!==f?(m=(0,Z.jsx)(Wo,{"aria-label":d,placeholder:f,value:o,onChange:p}),t[7]=o,t[8]=d,t[9]=f,t[10]=m):m=t[10];let h;t[11]===a?h=t[12]:(h=a({id:`O3oNi5`}),t[11]=a,t[12]=h);let g;t[13]===a?g=t[14]:(g=a({id:`O3oNi5`}),t[13]=a,t[14]=g);let _;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>l(e.target.value),t[15]=_):_=t[15];let v;t[16]!==c||t[17]!==h||t[18]!==g?(v=(0,Z.jsx)(Wo,{type:`email`,"aria-label":h,placeholder:g,value:c,onChange:_}),t[16]=c,t[17]=h,t[18]=g,t[19]=v):v=t[19];let y;t[20]!==c||t[21]!==o||t[22]!==r?(y=()=>r(o.trim(),c.trim()),t[20]=c,t[21]=o,t[22]=r,t[23]=y):y=t[23];let b;t[24]!==c||t[25]!==o?(b=!o.trim()||!c.trim(),t[24]=c,t[25]=o,t[26]=b):b=t[26];let x;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(qt,{id:`tfDRzk`}),t[27]=x):x=t[27];let S;t[28]!==y||t[29]!==b?(S=(0,Z.jsx)(Y,{className:`flex-1`,onClick:y,disabled:b,children:x}),t[28]=y,t[29]=b,t[30]=S):S=t[30];let C;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(qt,{id:`6Uau97`}),t[31]=C):C=t[31];let w;t[32]===i?w=t[33]:(w=(0,Z.jsx)(Y,{variant:`ghost`,onClick:i,children:C}),t[32]=i,t[33]=w);let T;t[34]!==S||t[35]!==w?(T=(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[S,w]}),t[34]=S,t[35]=w,t[36]=T):T=t[36];let E;return t[37]!==T||t[38]!==m||t[39]!==v?(E=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[u,m,v,T]}),t[37]=T,t[38]=m,t[39]=v,t[40]=E):E=t[40],E}function nd(e){let t=(0,$.c)(9),{authResult:n,onSave:r,onSkip:i}=e,a=n.login,o;t[0]===a?o=t[1]:(o=(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:(0,Z.jsx)(qt,{id:`KZkHZv`,values:{login:a}})}),t[0]=a,t[1]=o);let s;t[2]!==a||t[3]!==r||t[4]!==i?(s=(0,Z.jsx)(td,{login:a,onSave:r,onSkip:i}),t[2]=a,t[3]=r,t[4]=i,t[5]=s):s=t[5];let c;return t[6]!==o||t[7]!==s?(c=(0,Z.jsxs)(Z.Fragment,{children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8],c}function rd(e){let t=(0,$.c)(45),{open:n,onOpenChange:r,onSuccess:i,identityPrompt:a,reauth:o,transport:s}=e,{_:c}=Gt(),l;t[0]===s?l=t[1]:(l=s??Cl(),t[0]=s,t[1]=l);let u=l,[d,f]=(0,Q.useState)(`device`),[p,m]=(0,Q.useState)(`auth`),[h,g]=(0,Q.useState)(null),_,v;t[2]===n?(_=t[3],v=t[4]):(_=()=>{n&&(f(`device`),m(`auth`),g(null))},v=[n],t[2]=n,t[3]=_,t[4]=v),(0,Q.useEffect)(_,v);let y;t[5]!==c||t[6]!==a||t[7]!==r||t[8]!==i?(y=function(e){if(g(e),a&&(!e.name||!e.email))m(`identity`);else{m(`done`),i?.(e),r(!1);let t=e.login;X.success(c({id:`KZkHZv`,values:{login:t}}))}},t[5]=c,t[6]=a,t[7]=r,t[8]=i,t[9]=y):y=t[9];let b=y,x;t[10]!==c||t[11]!==h||t[12]!==r||t[13]!==i?(x=function(e,t){fetch(`/api/local-op/auth/set-identity`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:e,email:t})}).catch(id);let n={...h??{login:``},name:e,email:t};m(`done`),i?.(n),r(!1);let a=n.login;X.success(c({id:`KZkHZv`,values:{login:a}}))},t[10]=c,t[11]=h,t[12]=r,t[13]=i,t[14]=x):x=t[14];let S=x,C;t[15]!==c||t[16]!==h||t[17]!==r||t[18]!==i?(C=function(){if(!h)return;m(`done`),i?.(h),r(!1);let e=h.login;X.success(c({id:`KZkHZv`,values:{login:e}}))},t[15]=c,t[16]=h,t[17]=r,t[18]=i,t[19]=C):C=t[19];let w=C,T;t[20]===r?T=t[21]:(T=function(){r(!1)},t[20]=r,t[21]=T);let E=T,D;t[22]===o?D=t[23]:(D=(0,Z.jsx)(Bo,{children:(0,Z.jsx)(Ao,{children:o?(0,Z.jsx)(qt,{id:`X8kjQX`}):(0,Z.jsx)(qt,{id:`gtmbUO`})})}),t[22]=o,t[23]=D);let O;t[24]!==b||t[25]!==E||t[26]!==u||t[27]!==p||t[28]!==d?(O=p===`auth`&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex gap-1 border-b pb-2 mb-1`,children:[(0,Z.jsx)(Y,{variant:d===`device`?`secondary`:`ghost`,size:`sm`,onClick:()=>f(`device`),children:(0,Z.jsx)(qt,{id:`pdHb22`})}),(0,Z.jsx)(Y,{variant:d===`pat`?`secondary`:`ghost`,size:`sm`,onClick:()=>f(`pat`),children:(0,Z.jsx)(qt,{id:`TP9_K5`})})]}),d===`device`?(0,Z.jsx)(Zu,{onSuccess:b,onCancel:E,transport:u}):(0,Z.jsx)(Qu,{onSuccess:b,onCancel:E})]}),t[24]=b,t[25]=E,t[26]=u,t[27]=p,t[28]=d,t[29]=O):O=t[29];let k;t[30]!==h||t[31]!==S||t[32]!==w||t[33]!==p?(k=p===`identity`&&h&&(0,Z.jsx)(nd,{authResult:h,onSave:S,onSkip:w}),t[30]=h,t[31]=S,t[32]=w,t[33]=p,t[34]=k):k=t[34];let A;t[35]!==k||t[36]!==O?(A=(0,Z.jsxs)(Lo,{children:[O,k]}),t[35]=k,t[36]=O,t[37]=A):A=t[37];let j;t[38]!==A||t[39]!==D?(j=(0,Z.jsxs)(Po,{className:`sm:max-w-md`,children:[D,A]}),t[38]=A,t[39]=D,t[40]=j):j=t[40];let M;return t[41]!==r||t[42]!==n||t[43]!==j?(M=(0,Z.jsx)(Vo,{open:n,onOpenChange:r,children:j}),t[41]=r,t[42]=n,t[43]=j,t[44]=M):M=t[44],M}function id(){}function ad(){let e=(0,$.c)(4),[t,n]=(0,Q.useState)(null),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.okDesktop;if(!e)return;let t=!1;return e.state.query().then(e=>{t||n(e.channel)}).catch(od),()=>{t=!0}},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,Q.useEffect)(r,i);let a;return e[2]===t?a=e[3]:(a={channel:t},e[2]=t,e[3]=a),a}function od(e){console.warn(`[use-update-channel] bridge.state.query() failed`,e)}function sd(e){let t=(0,$.c)(2),{className:n}=e,{channel:r}=ad();if(r!==`beta`)return null;let i;return t[0]===n?i=t[1]:(i=(0,Z.jsx)(ze,{variant:`secondary`,"aria-label":`Beta channel`,"data-testid":`beta-badge`,className:n,children:`BETA`}),t[0]=n,t[1]=i),i}function cd(e){switch(e){case`receiving`:return`Receiving objects`;case`resolving`:return`Resolving deltas`;case`checking`:return`Checking out files`;case`init`:return`Initializing project`;case`done`:return`Complete`;default:return`Cloning`}}function ld(e){let t=e.trim();if(/^[\w.-]+\/[\w.-]+$/.test(t))return t.split(`/`)[1];try{return new URL(t.replace(/^git@([^:]+):/,`https://$1/`)).pathname.replace(/\.git$/,``).split(`/`).pop()??`repo`}catch{return t.split(`/`).pop()?.replace(/\.git$/,``)??`repo`}}function ud(e){let t=(0,$.c)(99),{open:n,onOpenChange:r,onSignIn:i,onCloneComplete:a,transport:o,authQueryTransport:s,pickParentFolder:c,initialUrl:l}=e,u;t[0]===o?u=t[1]:(u=o??Tl(),t[0]=o,t[1]=u);let d=u,f;t[2]===s?f=t[3]:(f=s??yl(),t[2]=s,t[3]=f);let p=f,m=c!==void 0,[h,g]=(0,Q.useState)(``),[_,v]=(0,Q.useState)(``),[y,b]=(0,Q.useState)(null),[x,S]=(0,Q.useState)(!1),[C,w]=(0,Q.useState)(``),[T,E]=(0,Q.useState)(!1),[D,O]=(0,Q.useState)(!1),k=(0,Q.useRef)(null),A=(0,Q.useRef)(null),j;t[4]!==n||t[5]!==p?(j=()=>{if(!n)return;let e=!1;return p.status().then(t=>{e||E(t.authenticated)}).catch(()=>{e||E(!1)}),()=>{e=!0}},t[4]=n,t[5]=p,t[6]=j):j=t[6];let M;t[7]===n?M=t[8]:(M=[n],t[7]=n,t[8]=M),(0,Q.useEffect)(j,M);let N;t[9]!==T||t[10]!==n||t[11]!==p?(N=()=>{if(!T||!n)return;let e=!1;return S(!0),p.repos().then(t=>{e||(b(t.ok?t.repos:[]),S(!1))}).catch(()=>{e||(b([]),S(!1))}),()=>{e=!0}},t[9]=T,t[10]=n,t[11]=p,t[12]=N):N=t[12];let P;t[13]!==T||t[14]!==n?(P=[T,n],t[13]=T,t[14]=n,t[15]=P):P=t[15],(0,Q.useEffect)(N,P);let F,I;t[16]!==l||t[17]!==n||t[18]!==m?(F=()=>{if(!n||!l||(g(l),m))return;let e=ld(l);e&&v(`~/Documents/${e}`)},I=[n,l,m],t[16]=l,t[17]=n,t[18]=m,t[19]=F,t[20]=I):(F=t[19],I=t[20]),(0,Q.useEffect)(F,I);let L;t[21]===m?L=t[22]:(L=function(e){if(g(e),m)return;let t=ld(e);t&&v(`~/Documents/${t}`)},t[21]=m,t[22]=L);let R=L,z;t[23]===m?z=t[24]:(z=function(e){if(g(e.clone_url),m)return;let t=e.full_name.split(`/`)[1];v(`~/Documents/${t}`)},t[23]=m,t[24]=z);let B=z,V;t[25]!==_||t[26]!==a||t[27]!==r||t[28]!==c||t[29]!==d||t[30]!==h?(V=async function(){let e=h.trim();if(!e){X.error(`Enter a repository URL or owner/repo`);return}let t=_||``;if(c){O(!0);let n=await c();if(!n){O(!1);return}let r=ld(e);t=`${n.replace(/\/$/,``)}/${r}`}else O(!0);let n=X.loading(`Starting clone`,{duration:1/0});A.current=n;let i=d.start({url:e,dir:t});k.current=i.cancel;try{let e=i.events[Symbol.asyncIterator](),t=await e.next();for(;!t.done;){let i=t.value;if(i.type===`progress`)X.loading(`${cd(i.phase)} — ${i.pct}%`,{id:n});else if(i.type===`complete`){X.success(`Clone complete — opening project`,{id:n}),r(!1),O(!1),k.current=null;let e=`port`in i?i.port:void 0;a?a({port:e,dir:i.dir}):e!==void 0&&(window.location.href=`http://localhost:${e}`);return}else if(i.type===`error`){X.error(`Clone failed: ${i.message}`,{id:n}),O(!1),k.current=null;return}t=await e.next()}X.error(`Clone stream ended unexpectedly — check if the clone completed`,{id:n}),O(!1),k.current=null}catch(e){console.error(`[CloneDialog] clone iteration failed:`,e),X.error(`Clone failed — connection error`,{id:n}),O(!1),k.current=null}},t[25]=_,t[26]=a,t[27]=r,t[28]=c,t[29]=d,t[30]=h,t[31]=V):V=t[31];let H=V,U;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(U=function(){k.current?.(),k.current=null,O(!1),X.dismiss(A.current??void 0)},t[32]=U):U=t[32];let W=U,G;t[33]!==D||t[34]!==r||t[35]!==m?(G=function(e){D||(r(e),e||(g(``),m||v(``),w(``)))},t[33]=D,t[34]=r,t[35]=m,t[36]=G):G=t[36];let ee=G,te,ne,re,ie,ae,oe,se,K,ce,le;if(t[37]!==D||t[38]!==ee||t[39]!==B||t[40]!==R||t[41]!==T||t[42]!==x||t[43]!==n||t[44]!==C||t[45]!==y||t[46]!==h){let e=y?.filter(e=>e.full_name.toLowerCase().includes(C.toLowerCase()));re=Vo,ce=n,le=ee,ne=Po,se=`sm:max-w-lg`,t[57]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Z.jsx)(Bo,{children:(0,Z.jsx)(Ao,{children:`Clone from GitHub`})}),t[57]=K):K=t[57],te=Lo,ie=`flex flex-col gap-4`;let r;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(`label`,{htmlFor:`clone-url`,className:`text-sm font-medium`,children:`Repository URL or owner/repo`}),t[58]=r):r=t[58];let i;t[59]===R?i=t[60]:(i=e=>R(e.target.value),t[59]=R,t[60]=i),t[61]!==D||t[62]!==i||t[63]!==h?(ae=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[r,(0,Z.jsx)(Wo,{id:`clone-url`,placeholder:`https://github.com/owner/repo or owner/repo`,value:h,onChange:i,disabled:D})]}),t[61]=D,t[62]=i,t[63]=h,t[64]=ae):ae=t[64],oe=T&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`label`,{htmlFor:`repo-filter`,className:`text-sm font-medium`,children:`Your repositories`}),(0,Z.jsx)(Wo,{id:`repo-filter`,"aria-label":`Filter repositories`,placeholder:`Filter repositories`,value:C,onChange:e=>w(e.target.value),disabled:D||x&&y===null}),(0,Z.jsx)(`div`,{className:`border rounded-md max-h-40 overflow-y-auto subtle-scrollbar`,"aria-busy":x&&y===null,children:x&&y===null?(0,Z.jsxs)(`output`,{className:`flex flex-col gap-1.5 px-3 py-2`,"aria-label":`Loading repositories`,children:[(0,Z.jsx)(mo,{className:`h-4 w-2/3`}),(0,Z.jsx)(mo,{className:`h-4 w-1/2`}),(0,Z.jsx)(mo,{className:`h-4 w-3/4`}),(0,Z.jsx)(mo,{className:`h-4 w-2/5`}),(0,Z.jsx)(mo,{className:`h-4 w-3/5`})]}):e?.length===0?(0,Z.jsx)(`p`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:y?.length===0?`No repositories found.`:`No matches.`}):e?.map(e=>(0,Z.jsxs)(`button`,{type:`button`,className:`w-full text-left px-3 py-1.5 text-sm hover:bg-muted flex items-center gap-2 truncate disabled:opacity-50`,onClick:()=>B(e),disabled:D,children:[e.private&&(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground shrink-0`,children:`🔒`}),e.full_name]},e.full_name))})]}),t[37]=D,t[38]=ee,t[39]=B,t[40]=R,t[41]=T,t[42]=x,t[43]=n,t[44]=C,t[45]=y,t[46]=h,t[47]=te,t[48]=ne,t[49]=re,t[50]=ie,t[51]=ae,t[52]=oe,t[53]=se,t[54]=K,t[55]=ce,t[56]=le}else te=t[47],ne=t[48],re=t[49],ie=t[50],ae=t[51],oe=t[52],se=t[53],K=t[54],ce=t[55],le=t[56];let ue;t[65]!==D||t[66]!==T||t[67]!==i?(ue=!T&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,Z.jsx)(`span`,{children:`Browse your repos:`}),(0,Z.jsx)(Y,{variant:`link`,className:`h-auto p-0`,onClick:()=>i?.(),disabled:D,children:`Sign in to GitHub`})]}),t[65]=D,t[66]=T,t[67]=i,t[68]=ue):ue=t[68];let q;t[69]!==D||t[70]!==_||t[71]!==m?(q=!m&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`label`,{htmlFor:`clone-path`,className:`text-sm font-medium`,children:`Local path`}),(0,Z.jsx)(Wo,{id:`clone-path`,placeholder:`~/Documents/repo-name`,value:_,onChange:e=>v(e.target.value),disabled:D})]}),t[69]=D,t[70]=_,t[71]=m,t[72]=q):q=t[72];let de;t[73]!==ie||t[74]!==ae||t[75]!==oe||t[76]!==ue||t[77]!==q?(de=(0,Z.jsxs)(`div`,{className:ie,children:[ae,oe,ue,q]}),t[73]=ie,t[74]=ae,t[75]=oe,t[76]=ue,t[77]=q,t[78]=de):de=t[78];let fe;t[79]!==te||t[80]!==de?(fe=(0,Z.jsx)(te,{children:de}),t[79]=te,t[80]=de,t[81]=fe):fe=t[81];let pe;t[82]!==D||t[83]!==H||t[84]!==ee||t[85]!==h||t[86]!==m?(pe=(0,Z.jsx)(Ro,{children:D?(0,Z.jsx)(Y,{variant:`outline`,className:`font-mono uppercase`,onClick:W,children:`Cancel`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Y,{variant:`outline`,className:`font-mono uppercase`,onClick:()=>ee(!1),children:`Cancel`}),(0,Z.jsx)(Y,{onClick:()=>void H(),disabled:!h.trim(),"aria-describedby":m?`clone-picker-hint`:void 0,children:`Clone`}),m&&(0,Z.jsx)(`span`,{id:`clone-picker-hint`,className:`sr-only`,children:`Opens a folder picker to choose where to clone the repository.`})]})}),t[82]=D,t[83]=H,t[84]=ee,t[85]=h,t[86]=m,t[87]=pe):pe=t[87];let me;t[88]!==ne||t[89]!==se||t[90]!==K||t[91]!==fe||t[92]!==pe?(me=(0,Z.jsxs)(ne,{className:se,children:[K,fe,pe]}),t[88]=ne,t[89]=se,t[90]=K,t[91]=fe,t[92]=pe,t[93]=me):me=t[93];let he;return t[94]!==re||t[95]!==ce||t[96]!==le||t[97]!==me?(he=(0,Z.jsx)(re,{open:ce,onOpenChange:le,children:me}),t[94]=re,t[95]=ce,t[96]=le,t[97]=me,t[98]=he):he=t[98],he}var dd=(0,Q.lazy)(()=>n(()=>import(`./ConsentDialogBody-BncX7dD1.js`),__vite__mapDeps([5,1,6,7,8,9,10,11,12]),import.meta.url));function fd(){let e=(0,$.c)(1);if(!(0,Q.useSyncExternalStore)(rs.subscribe,md,pd))return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(dd,{})}),e[0]=t):t=e[0],t}function pd(){return!1}function md(){return rs.getSnapshot()!==null}var hd=180,gd=5e3;function _d(e,t){if(e===``||t===``)return``;let n=e.includes(`\\`)&&!e.includes(`/`)?`\\`:`/`;return`${e.replace(/[/\\]+$/,``)}${n}${t}`}function vd(e){if(e===``)return``;let t=e.split(/[/\\]/).filter(Boolean);return t.length>0?t[t.length-1]??e:e}function yd(e){if(e===``)return``;let t=e.replace(/[/\\]+$/,``);if(t===``)return``;let n=t.match(/[/\\][^/\\]+$/);if(n===null)return``;let r=t.length-n[0].length;return r===0?t[0]??``:t.slice(0,r)}function bd(e){let{parent:t,sanitizedName:n,enclosingProject:r,enclosingGit:i,targetState:a}=e;return t===``||n===``?{kind:`idle`}:r===null?i===null?a===`exists-nonempty`?{kind:`block-nonempty`}:{kind:`free`}:{kind:`confirm-git`,gitRoot:i.gitRoot}:{kind:`block-nested`,rootPath:r.rootPath}}function xd(e){let t=e instanceof Error?e.message:String(e);for(let e of Vr)if(t.startsWith(`${e}:`)||t.includes(`${e}: `))return e===`nested-project`||e===`target-not-empty`?{reason:e}:{reason:e,message:t};return{reason:`unknown`,message:t}}function Sd(e){switch(e.reason){case`nested-project`:return`A project already exists at this location. Pick a different parent folder.`;case`target-not-empty`:return`A non-empty folder already exists at this path. Pick a different folder.`;case`invalid-args`:return`Invalid input — pick a different folder.`;case`mkdir-failed`:return`Could not create the project folder. Pick a different folder.`;case`git-init-failed`:return`Project folder created, but git init failed. Try again.`;case`init-failed`:return`Could not write project files. Try a different location.`;case`discovery-failed`:return`Could not finalize project setup. Try again.`;case`unknown`:return`Could not create project. Try again or pick a different location.`}}function Cd(e){let t=(0,$.c)(152),{open:n,onOpenChange:r,bridge:i}=e,a=(0,Q.useId)(),[o,s]=(0,Q.useState)(``),[c,l]=(0,Q.useState)(``),[u,d]=(0,Q.useState)(Ad),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f={kind:`idle`},t[0]=f):f=t[0];let[p,m]=(0,Q.useState)(f),[h,g]=(0,Q.useState)(`idle`),[_,v]=(0,Q.useState)(!1),[y,b]=(0,Q.useState)(null),x;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(x={kind:`idle`},t[1]=x):x=t[1];let[S,C]=(0,Q.useState)(x),[w,T]=(0,Q.useState)(0),[E,D]=(0,Q.useState)(!1),[O,k]=(0,Q.useState)(``),A;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(A=new Set,t[2]=A):A=t[2];let j=(0,Q.useRef)(A),M=(0,Q.useRef)(null),N=(0,Q.useRef)(null),P=(0,Q.useRef)(null),F=(0,Q.useRef)(0),I,L;t[3]!==i||t[4]!==n?(I=()=>{if(!n)return;j.current.clear(),b(null),m({kind:`idle`}),g(`idle`),v(!1),s(``),d(new Set(Tr)),C({kind:`idle`}),D(!1),k(``),F.current+=1;let e=!1;l(``),i.fs.defaultProjectsRoot().then(t=>{e||l(t)}).catch(kd);let t=requestAnimationFrame(()=>{P.current?.focus()});return()=>{e=!0,cancelAnimationFrame(t)}},L=[n,i],t[3]=i,t[4]=n,t[5]=I,t[6]=L):(I=t[5],L=t[6]),(0,Q.useEffect)(I,L);let R;t[7]!==i||t[8]!==E||t[9]!==n||t[10]!==o||t[11]!==O?(R=()=>{if(!n)return;if(N.current!==null&&clearTimeout(N.current),M.current!==null&&M.current.abort(),o===``){m({kind:`idle`}),g(`idle`);return}let e=O.trim(),t=E&&e!==``,r=t?o:yd(o),a=Kr(t?e:vd(o));if(r===``||a===``){m({kind:`idle`}),g(`idle`);return}let s=_d(r,a),c=new AbortController;return M.current=c,N.current=setTimeout(()=>{g(`in-flight`),Promise.all([i.fs.findEnclosingProjectRoot(r),i.fs.findEnclosingGitRoot(r),i.fs.folderState(s)]).then(e=>{let[t,n,i]=e;if(c.signal.aborted)return;g(`idle`);let o=bd({parent:r,sanitizedName:a,enclosingProject:t,enclosingGit:n,targetState:i});m(o),o.kind===`block-nonempty`&&D(!0)}).catch(e=>{c.signal.aborted||(console.warn(`[CreateProjectDialog] cascade probe failed:`,e),g(`idle`),m({kind:`free`}))})},hd),()=>{N.current!==null&&clearTimeout(N.current),c.abort()}},t[7]=i,t[8]=E,t[9]=n,t[10]=o,t[11]=O,t[12]=R):R=t[12];let z;t[13]!==i||t[14]!==E||t[15]!==n||t[16]!==o||t[17]!==w||t[18]!==O?(z=[n,o,i,w,E,O],t[13]=i,t[14]=E,t[15]=n,t[16]=o,t[17]=w,t[18]=O,t[19]=z):z=t[19],(0,Q.useEffect)(R,z);let B,V;t[20]===n?(B=t[21],V=t[22]):(B=()=>{if(!n)return;let e=()=>T(Od);return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},V=[n],t[20]=n,t[21]=B,t[22]=V),(0,Q.useEffect)(B,V);let H=(0,Q.useRef)(`idle`),U,W;t[23]===h?(U=t[24],W=t[25]):(U=()=>{H.current=h},W=[h],t[23]=h,t[24]=U,t[25]=W),(0,Q.useEffect)(U,W);let G,ee;t[26]!==p.kind||t[27]!==n?(G=()=>{if(!n||p.kind!==`confirm-git`)return;let e=setInterval(()=>{H.current!==`in-flight`&&T(Dd)},gd);return()=>clearInterval(e)},ee=[n,p.kind],t[26]=p.kind,t[27]=n,t[28]=G,t[29]=ee):(G=t[28],ee=t[29]),(0,Q.useEffect)(G,ee);let te;t[30]!==p.gitRoot||t[31]!==p.kind||t[32]!==S.gitRoot||t[33]!==S.kind?(te=()=>{if(p.kind!==`confirm-git`){S.kind!==`idle`&&(F.current+=1,C({kind:`idle`}));return}S.kind===`confirming`&&S.gitRoot!==p.gitRoot&&C({kind:`idle`}),S.kind===`pending`&&S.gitRoot!==p.gitRoot&&(F.current+=1,C({kind:`idle`}))},t[30]=p.gitRoot,t[31]=p.kind,t[32]=S.gitRoot,t[33]=S.kind,t[34]=te):te=t[34];let ne;t[35]!==p||t[36]!==S?(ne=[p,S],t[35]=p,t[36]=S,t[37]=ne):ne=t[37],(0,Q.useEffect)(te,ne);let re;t[38]!==i||t[39]!==p.kind||t[40]!==n?(re=()=>{if(!n)return;let e=null;p.kind===`block-nested`?e=`nested`:p.kind===`block-nonempty`?e=`nonempty`:p.kind===`confirm-git`&&(e=`git-confirm`),e!==null&&(j.current.has(e)||(j.current.add(e),i.project.recordCreateNewBannerShown(e).catch(Ed)))},t[38]=i,t[39]=p.kind,t[40]=n,t[41]=re):re=t[41];let ie;t[42]!==i||t[43]!==p||t[44]!==n?(ie=[n,p,i],t[42]=i,t[43]=p,t[44]=n,t[45]=ie):ie=t[45],(0,Q.useEffect)(re,ie);let ae,oe,se,K,ce,le,ue;t[46]!==E||t[47]!==o||t[48]!==O?(le=O.trim(),ce=E&&le!==``,ae=o===``?``:ce?le:vd(o),K=o===``?``:Kr(ae),oe=o!==``&&K!==ae&&K!==``,se=o!==``&&ae!==``&&K===``,ue=ce?_d(o,K):o,t[46]=E,t[47]=o,t[48]=O,t[49]=ae,t[50]=oe,t[51]=se,t[52]=K,t[53]=ce,t[54]=le,t[55]=ue):(ae=t[49],oe=t[50],se=t[51],K=t[52],ce=t[53],le=t[54],ue=t[55]);let q=ue,de=!_&&o!==``&&K!==``&&h===`idle`&&(p.kind===`free`||p.kind===`confirm-git`),fe;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(fe=function(e){d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[56]=fe):fe=t[56];let pe=fe,me;t[57]!==i||t[58]!==c?(me=async function(){try{let e=await i.dialog.openFolder(c===``?void 0:{defaultPath:c});if(e===null)return;s(e),T(Td),b(null),D(!1),k(``)}catch(e){console.warn(`[CreateProjectDialog] dialog.openFolder failed:`,e)}},t[57]=i,t[58]=c,t[59]=me):me=t[59];let he=me,ge;t[60]!==i||t[61]!==de||t[62]!==u||t[63]!==r||t[64]!==o||t[65]!==K||t[66]!==ce?(ge=async function(e){if(e.preventDefault(),de){v(!0),b(null);try{await i.project.createNew({parent:ce?o:yd(o),name:K,editors:Array.from(u)}),r(!1)}catch(e){b(xd(e)),v(!1)}}},t[60]=i,t[61]=de,t[62]=u,t[63]=r,t[64]=o,t[65]=K,t[66]=ce,t[67]=ge):ge=t[67];let _e=ge,ve;t[68]!==_||t[69]!==r?(ve=function(e){_||r(e)},t[68]=_,t[69]=r,t[70]=ve):ve=t[70];let ye=ve,be;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(be=async function(e){C({kind:`confirming`,gitRoot:e})},t[71]=be):be=t[71];let xe=be,Se;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(Se=async function(){C({kind:`idle`})},t[72]=Se):Se=t[72];let Ce=Se,we;t[73]===i?we=t[74]:(we=async function(e){let t=F.current+1;F.current=t,C({kind:`pending`,gitRoot:e});try{if(await i.fs.removeGitFolder(e),F.current!==t)return;T(wd),C({kind:`idle`})}catch(e){let n=e;if(F.current!==t)return;let r=n instanceof Error?n.message:String(n);console.error(`[CreateProjectDialog] bridge.fs.removeGitFolder failed:`,n),C({kind:`error`,message:r})}},t[73]=i,t[74]=we);let Te=we,Ee;t[75]!==i||t[76]!==r?(Ee=async function(e){r(!1);try{await i.project.open({path:e,target:`new-window`,entryPoint:`create-new-nested-redirect`})}catch(e){console.warn(`[CreateProjectDialog] project.open failed:`,e)}},t[75]=i,t[76]=r,t[77]=Ee):Ee=t[77];let De=Ee,Oe;t[78]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,Z.jsxs)(Bo,{children:[(0,Z.jsx)(Ao,{children:`Create new project`}),(0,Z.jsx)(Oo,{children:`Create a new Open Knowledge project in the folder of your choice.`})]}),t[78]=Oe):Oe=t[78];let ke;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,Z.jsx)(es,{htmlFor:`create-location`,children:`Location`}),t[79]=ke):ke=t[79];let Ae;t[80]===he?Ae=t[81]:(Ae=()=>void he(),t[80]=he,t[81]=Ae);let je;t[82]!==_||t[83]!==Ae?(je=(0,Z.jsx)(`div`,{className:`flex items-stretch gap-2`,children:(0,Z.jsx)(Y,{id:`create-location`,ref:P,type:`button`,variant:`outline`,disabled:_,onClick:Ae,"aria-describedby":`create-target-caption`,"data-testid":`create-browse`,children:`Browse`})}),t[82]=_,t[83]=Ae,t[84]=je):je=t[84];let Me=q===``?`Click Browse to pick or create a project folder.`:q,Ne;t[85]===Me?Ne=t[86]:(Ne=(0,Z.jsx)(`p`,{id:`create-target-caption`,className:`text-1sm text-muted-foreground`,"aria-live":`polite`,"data-testid":`create-target-caption`,children:Me}),t[85]=Me,t[86]=Ne);let Pe;t[87]!==je||t[88]!==Ne?(Pe=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[ke,je,Ne]}),t[87]=je,t[88]=Ne,t[89]=Pe):Pe=t[89];let Fe;t[90]!==_||t[91]!==p.kind||t[92]!==E||t[93]!==oe||t[94]!==se||t[95]!==K||t[96]!==ce||t[97]!==O||t[98]!==le?(Fe=E?(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,"data-testid":`create-subfolder-rescue`,children:[(0,Z.jsx)(es,{htmlFor:`create-subfolder-name`,children:`Subfolder name`}),(0,Z.jsx)(Wo,{id:`create-subfolder-name`,value:O,placeholder:`my-project`,onChange:e=>k(e.target.value),disabled:_,autoFocus:!0,"aria-invalid":ce&&(se||p.kind===`block-nonempty`),"data-testid":`create-subfolder-input`}),le===``?(0,Z.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:`text-1sm text-muted-foreground`,"data-testid":`create-subfolder-empty-error`,children:`This folder already has files. Add a name to create a new subfolder inside it.`}):se?(0,Z.jsx)(`p`,{role:`alert`,className:`text-1sm text-destructive`,"data-testid":`create-subfolder-erased-error`,children:`This name has no characters that are safe for a folder identifier. Try a name with at least one letter or number.`}):p.kind===`block-nonempty`?(0,Z.jsxs)(`p`,{role:`alert`,className:`text-1sm text-destructive`,"data-testid":`create-subfolder-taken-error`,children:[`A folder named `,(0,Z.jsx)(`code`,{className:`font-mono break-all`,children:K}),` already has files at this location. Pick a different name.`]}):oe?(0,Z.jsxs)(`p`,{className:`text-1sm text-muted-foreground`,children:[`Will be saved as `,(0,Z.jsx)(`code`,{className:`font-mono break-all`,children:K}),`.`]}):null]}):null,t[90]=_,t[91]=p.kind,t[92]=E,t[93]=oe,t[94]=se,t[95]=K,t[96]=ce,t[97]=O,t[98]=le,t[99]=Fe):Fe=t[99];let J;t[100]!==E||t[101]!==ae||t[102]!==oe||t[103]!==K?(J=!E&&oe?(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,"data-testid":`create-banner-sanitize-diverged`,children:[(0,Z.jsx)(`code`,{className:`font-mono break-all`,children:ae}),` has characters unsafe for the on-disk identifier, so the project will be created as`,` `,(0,Z.jsx)(`code`,{className:`font-mono break-all`,children:K}),`. Click Browse to pick a safer name.`]}):null,t[100]=E,t[101]=ae,t[102]=oe,t[103]=K,t[104]=J):J=t[104];let Ie;t[105]!==E||t[106]!==ae||t[107]!==se?(Ie=!E&&se?(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,"data-testid":`create-banner-sanitize-erased`,children:[`The folder name `,(0,Z.jsx)(`code`,{className:`font-mono break-all`,children:ae}),` can't be used as a project identifier — it has no characters left after sanitization. Click Browse to pick a folder whose name contains at least one alphanumeric character.`]}):null,t[105]=E,t[106]=ae,t[107]=se,t[108]=Ie):Ie=t[108];let Le;t[109]!==p||t[110]!==Te||t[111]!==De||t[112]!==S?(Le=(0,Z.jsx)(jd,{cascade:p,onOpenNested:De,removeGitState:S,onRequestRemoveGit:xe,onCancelRemoveGit:Ce,onConfirmRemoveGit:Te}),t[109]=p,t[110]=Te,t[111]=De,t[112]=S,t[113]=Le):Le=t[113];let Re,ze;t[114]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(0,Z.jsx)(`legend`,{className:`text-sm font-medium`,children:`Connect to AI tools`}),ze=(0,Z.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:`Each selected tool gets an Open Knowledge MCP entry.`}),t[114]=Re,t[115]=ze):(Re=t[114],ze=t[115]);let Be;t[116]!==_||t[117]!==u?(Be=Tr.map(e=>{let t=`create-editor-${e}`;return(0,Z.jsxs)(es,{htmlFor:t,className:`text-sm font-normal`,children:[(0,Z.jsx)(Jt,{id:t,checked:u.has(e),onCheckedChange:()=>pe(e),disabled:_,"data-testid":`create-editor-${e}`}),(0,Z.jsx)(`span`,{children:lr[e]})]},e)}),t[116]=_,t[117]=u,t[118]=Be):Be=t[118];let Ve;t[119]===Be?Ve=t[120]:(Ve=(0,Z.jsxs)(`fieldset`,{className:`flex flex-col space-y-2 pb-2`,children:[Re,ze,Be]}),t[119]=Be,t[120]=Ve);let He;t[121]===y?He=t[122]:(He=y===null?null:(0,Z.jsx)(`div`,{role:`alert`,className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,"data-testid":`create-submit-error`,children:Sd(y)}),t[121]=y,t[122]=He);let Ue;t[123]!==a||t[124]!==_e||t[125]!==Pe||t[126]!==Fe||t[127]!==J||t[128]!==Ie||t[129]!==Le||t[130]!==Ve||t[131]!==He?(Ue=(0,Z.jsx)(Lo,{className:`space-y-4`,children:(0,Z.jsxs)(`form`,{id:a,onSubmit:_e,"data-testid":`create-project-form`,className:`space-y-4`,children:[Pe,Fe,J,Ie,Le,Ve,He]})}),t[123]=a,t[124]=_e,t[125]=Pe,t[126]=Fe,t[127]=J,t[128]=Ie,t[129]=Le,t[130]=Ve,t[131]=He,t[132]=Ue):Ue=t[132];let We;t[133]===r?We=t[134]:(We=()=>r(!1),t[133]=r,t[134]=We);let Ge;t[135]!==_||t[136]!==We?(Ge=(0,Z.jsx)(Y,{type:`button`,variant:`outline`,className:`font-mono uppercase`,onClick:We,disabled:_,"data-testid":`create-cancel`,children:`Cancel`}),t[135]=_,t[136]=We,t[137]=Ge):Ge=t[137];let Ke=!de,qe=_?`Creating`:`Create`,Je;t[138]!==a||t[139]!==Ke||t[140]!==qe?(Je=(0,Z.jsx)(Y,{type:`submit`,form:a,disabled:Ke,"data-testid":`create-submit`,children:qe}),t[138]=a,t[139]=Ke,t[140]=qe,t[141]=Je):Je=t[141];let Ye;t[142]!==Ge||t[143]!==Je?(Ye=(0,Z.jsxs)(Ro,{children:[Ge,Je]}),t[142]=Ge,t[143]=Je,t[144]=Ye):Ye=t[144];let Xe;t[145]!==Ue||t[146]!==Ye?(Xe=(0,Z.jsxs)(Po,{className:`sm:max-w-lg`,"data-testid":`create-project-dialog`,children:[Oe,Ue,Ye]}),t[145]=Ue,t[146]=Ye,t[147]=Xe):Xe=t[147];let Ze;return t[148]!==ye||t[149]!==n||t[150]!==Xe?(Ze=(0,Z.jsx)(Vo,{open:n,onOpenChange:ye,children:Xe}),t[148]=ye,t[149]=n,t[150]=Xe,t[151]=Ze):Ze=t[151],Ze}function wd(e){return e+1}function Td(e){return e+1}function Ed(){}function Dd(e){return e+1}function Od(e){return e+1}function kd(e){console.warn(`[CreateProjectDialog] defaultProjectsRoot probe failed:`,e)}function Ad(){return new Set(Tr)}function jd(e){let t=(0,$.c)(32),{cascade:n,onOpenNested:r,removeGitState:i,onRequestRemoveGit:a,onCancelRemoveGit:o,onConfirmRemoveGit:s}=e;if(n.kind===`idle`||n.kind===`free`||n.kind===`block-nonempty`)return null;if(n.kind===`block-nested`){let e;t[0]===n.rootPath?e=t[1]:(e=vd(n.rootPath),t[0]=n.rootPath,t[1]=e);let i=e,a;t[2]===n.rootPath?a=t[3]:(a=(0,Z.jsxs)(`p`,{className:`mb-2`,children:[`Can't nest projects. An Open Knowledge project already exists at`,` `,(0,Z.jsx)(`code`,{className:`font-mono break-all`,children:n.rootPath}),`. Choose a location outside it, or open that project instead.`]}),t[2]=n.rootPath,t[3]=a);let o;t[4]!==n.rootPath||t[5]!==r?(o=()=>r(n.rootPath),t[4]=n.rootPath,t[5]=r,t[6]=o):o=t[6];let s;t[7]!==i||t[8]!==o?(s=(0,Z.jsxs)(Y,{type:`button`,variant:`outline`,size:`sm`,onClick:o,"data-testid":`create-banner-nested-open`,children:[`Open `,i]}),t[7]=i,t[8]=o,t[9]=s):s=t[9];let c;return t[10]!==a||t[11]!==s?(c=(0,Z.jsxs)(`div`,{role:`alert`,className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive`,"data-testid":`create-banner-nested`,children:[a,s]}),t[10]=a,t[11]=s,t[12]=c):c=t[12],c}if(n.kind===`confirm-git`){let{gitRoot:e}=n,r;if(t[13]!==e){let n;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(n=/\/+$/,t[15]=n):n=t[15],r=e.replace(n,``),t[13]=e,t[14]=r}else r=t[14];let c=`${r}/.git`,l;t[16]===e?l=t[17]:(l=(0,Z.jsx)(`code`,{children:e}),t[16]=e,t[17]=l);let u;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(`code`,{children:`.git`}),t[18]=u):u=t[18];let d;t[19]===l?d=t[20]:(d=(0,Z.jsxs)(`p`,{children:[`Open Knowledge will be initialized at `,l,` — the parent of your new folder, because it contains a `,u,` folder (one project per git repo).`]}),t[19]=l,t[20]=d);let f;t[21]!==e||t[22]!==o||t[23]!==s||t[24]!==a||t[25]!==i.kind||t[26]!==i.message||t[27]!==c?(f=i.kind===`idle`||i.kind===`error`?(0,Z.jsxs)(`div`,{className:`mt-2 flex flex-col gap-1`,children:[(0,Z.jsxs)(Y,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>a(e),"data-testid":`create-banner-git-remove`,children:[`Remove the parent `,(0,Z.jsx)(`code`,{children:`.git`}),` folder`]}),i.kind===`error`?(0,Z.jsxs)(`p`,{role:`alert`,className:`text-xs text-destructive`,"data-testid":`create-banner-git-remove-error`,children:[`Couldn't remove `,(0,Z.jsx)(`code`,{children:c}),`: `,i.message]}):null]}):(0,Z.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2 rounded border border-blue-400/60 bg-white/40 p-2 dark:border-blue-600/60 dark:bg-black/20`,"data-testid":`create-banner-git-remove-confirm`,children:[(0,Z.jsxs)(`p`,{className:`text-xs`,children:[`Permanently deletes `,(0,Z.jsx)(`code`,{className:`font-mono break-all`,children:c}),` and all its git history. Working files stay in place. If the parent git repo is intentional (e.g. you cloned it), cancel and pick a location outside it.`]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Z.jsx)(Y,{type:`button`,variant:`destructive`,size:`sm`,disabled:i.kind===`pending`,onClick:()=>s(e),"data-testid":`create-banner-git-remove-confirm-button`,children:i.kind===`pending`?`Removing…`:`Delete ${c}`}),(0,Z.jsx)(Y,{type:`button`,variant:`outline`,size:`sm`,disabled:i.kind===`pending`,onClick:o,"data-testid":`create-banner-git-remove-cancel`,children:`Cancel`})]})]}),t[21]=e,t[22]=o,t[23]=s,t[24]=a,t[25]=i.kind,t[26]=i.message,t[27]=c,t[28]=f):f=t[28];let p;return t[29]!==d||t[30]!==f?(p=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,className:`rounded-md border border-blue-300 bg-blue-50 px-3 py-2 text-sm text-blue-900 dark:border-blue-700 dark:bg-blue-950 dark:text-blue-200`,"data-testid":`create-banner-git-confirm`,children:[d,f]}),t[29]=d,t[30]=f,t[31]=p):p=t[31],p}return null}function Md(e){let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`GitHub`}),r=(0,Z.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`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(`svg`,{role:`img`,fill:`currentColor`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function Nd(e){let t=(0,$.c)(5),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Open Knowledge icon`}),t[0]=n):n=t[0];let r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsxs)(`g`,{filter:`url(#filter0_d_ok)`,children:[(0,Z.jsx)(`path`,{d:`M66.8902 16.1017C58.2694 3.86669 46.1739 -0.690239 29.9182 2.17749C21.3995 3.67813 13.4602 9.555 8.67934 17.9009C3.93974 26.1701 2.98514 35.6533 6.05714 43.9166C9.31574 52.6868 16.7168 58.4752 24.2299 63.4231C25.7973 64.4562 26.1351 65.7172 26.3551 68.9896C26.5221 71.4625 26.799 75.6011 30.6842 77.7204C31.8176 78.3372 33.0648 78.6515 34.3946 78.6515C37.0796 78.6515 39.4033 77.3649 40.5189 76.7482C47.1049 73.1046 68.8878 59.7147 72.6453 40.4027C74.3444 31.6679 70.9797 21.9019 66.8922 16.1017H66.8902Z`,fill:`white`}),(0,Z.jsx)(`path`,{d:`M37.4214 71.154C28.7888 75.929 36.787 64.0397 27.7458 58.0843C21.6372 54.0616 14.788 49.0568 12.0499 41.6911C6.74463 27.4192 17.5438 10.8473 31.028 8.47262C45.1977 5.97613 54.6946 9.8947 61.6635 19.7844C65.2089 24.8167 67.6013 32.8365 66.3658 39.1828C63.6906 52.9341 49.073 64.7075 37.4214 71.154Z`,fill:`#69A3FF`}),(0,Z.jsx)(`path`,{d:`M52.7244 29.2638C53.4665 28.5217 54.6697 28.5217 55.4119 29.2638V29.2638C56.154 30.0059 56.154 31.2091 55.4119 31.9513L49.2589 38.1042L46.5715 35.4167L52.7244 29.2638Z`,fill:`#D5E5FF`}),(0,Z.jsx)(`path`,{d:`M55.4119 38.8821C56.154 39.6242 56.154 40.8274 55.4119 41.5696V41.5696C54.6698 42.3117 53.4665 42.3117 52.7244 41.5696L46.5715 35.4166L49.259 32.7292L55.4119 38.8821Z`,fill:`#D5E5FF`})]}),t[1]=r):r=t[1];let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`defs`,{children:(0,Z.jsxs)(`filter`,{id:`filter0_d_ok`,x:`-9.53674e-07`,y:`-0.0799994`,width:`77.3817`,height:`85.8743`,filterUnits:`userSpaceOnUse`,colorInterpolationFilters:`sRGB`,children:[(0,Z.jsx)(`feFlood`,{floodOpacity:`0`,result:`BackgroundImageFix`}),(0,Z.jsx)(`feColorMatrix`,{in:`SourceAlpha`,type:`matrix`,values:`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0`,result:`hardAlpha`}),(0,Z.jsx)(`feOffset`,{dy:`2.85714`}),(0,Z.jsx)(`feGaussianBlur`,{stdDeviation:`2.14286`}),(0,Z.jsx)(`feComposite`,{in2:`hardAlpha`,operator:`out`}),(0,Z.jsx)(`feColorMatrix`,{type:`matrix`,values:`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0`}),(0,Z.jsx)(`feBlend`,{mode:`normal`,in2:`BackgroundImageFix`,result:`effect1_dropShadow_ok`}),(0,Z.jsx)(`feBlend`,{mode:`normal`,in:`SourceGraphic`,in2:`effect1_dropShadow_ok`,result:`shape`})]})}),t[2]=i):i=t[2];let a;return t[3]===e?a=t[4]:(a=(0,Z.jsxs)(`svg`,{role:`img`,"aria-label":`Open Knowledge icon`,fill:`none`,height:24,width:24,viewBox:`0 0 78 80`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}var Pd=(0,Q.lazy)(()=>n(()=>import(`./McpConsentDialogBody-Dw8kQ_BH.js`),__vite__mapDeps([13,1,6,7,8,9,14,15]),import.meta.url));function Fd(){let e=(0,$.c)(1);if(!(0,Q.useSyncExternalStore)(is.subscribe,Ld,Id))return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(Pd,{})}),e[0]=t):t=e[0],t}function Id(){return!1}function Ld(){return is.getSnapshot()!==null}function Rd(e){return`https://github.com/${e.owner}/${e.repo}.git`}function zd(e){let t=e.toLowerCase().trim();return t.endsWith(`/`)&&(t=t.slice(0,-1)),t.endsWith(`.git`)&&(t=t.slice(0,-4)),t}function Bd(e,t){let n=zd(Rd(t));for(let t of e)if(t.missing!==!0&&t.gitRemoteUrl&&zd(t.gitRemoteUrl)===n)return t;return null}function Vd(e){return`https://github.com/${e.owner}/${e.repo}.git`}function Hd(e,t){switch(e.kind){case`ok`:return null;case`not-git`:return`This folder doesn't contain a git repository. Pick a different folder?`;case`wrong-repo`:return`This folder is a clone of ${e.actualOwner}/${e.actualRepo}, not ${t.owner}/${t.repo}. Pick a different folder?`;case`no-origin`:case`non-github`:case`symlink-escape`:return`This folder isn't a clone of ${t.owner}/${t.repo}. Pick a different folder?`}}function Ud(e){return e.kind===`unsupported-version`?{kind:`unsupported-version`,message:`Update Open Knowledge to open this share.`}:e.kind===`invalid`?{kind:`invalid`,message:`Invalid share URL.`}:null}function Wd(e){return e.kind===`ok`?{owner:e.owner,repo:e.repo,branch:e.branch,path:e.path,blobUrl:e.blobUrl}:null}function Gd(e){let t=[`[receive]`];return e.q1_hit!==void 0&&t.push(`q1_hit=${e.q1_hit}`),e.q2_path!==void 0&&t.push(`q2_path=${e.q2_path}`),e.folder_validate!==void 0&&t.push(`folder_validate=${e.folder_validate}`),t.join(` `)}function Kd(){let e=null,t=new Set,n=!1,r=null;function i(){for(let e of t)e()}function a(){e!==null&&(e=null,i())}return{install({bridge:t}){if(t)return n?r??void 0:(n=!0,r=t.onShareReceived(t=>{e=t,i()}),()=>{r?.(),r=null,n=!1,a()})},getSnapshot(){return e},subscribe(e){return t.add(e),()=>{t.delete(e)}},dismiss(){a()}}}var qd=Kd();function Jd(e){return qd.install(e)}function Yd(e){let t=(0,$.c)(96),{bridge:n,cloneController:r,store:i}=e,a=i===void 0?qd:i,o=(0,Q.useSyncExternalStore)(a.subscribe,a.getSnapshot,Xd),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(!1),[d,f]=(0,Q.useState)(null),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(!1),_=(0,Q.useRef)(!1),v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>{c(!1),u(!1),f(null),m(!1),g(!1),_.current=!1},t[0]=v):v=t[0];let y;t[1]===o?y=t[2]:(y=[o],t[1]=o,t[2]=y),(0,Q.useEffect)(v,y);let b;t[3]!==d||t[4]!==r||t[5]!==o||t[6]!==s?(b=()=>{r&&(!o||o.kind!==`ok`||s&&d===null&&(_.current||(_.current=!0,m(!0),r.getAuthStatus().then(e=>{f(e)}).catch(()=>{f({authenticated:!1,host:`github.com`})}).finally(()=>{m(!1)}))))},t[3]=d,t[4]=r,t[5]=o,t[6]=s,t[7]=b):b=t[7];let x;t[8]!==d||t[9]!==o||t[10]!==s?(x=[o,s,d],t[8]=d,t[9]=o,t[10]=s,t[11]=x):x=t[11],(0,Q.useEffect)(b,x);let S,C;t[12]!==o||t[13]!==a?(S=()=>{if(!o)return;let e=Ud(o);e&&(X.error(e.message),a.dismiss())},C=[o,a],t[12]=o,t[13]=a,t[14]=S,t[15]=C):(S=t[14],C=t[15]),(0,Q.useEffect)(S,C);let w,T;t[16]!==n||t[17]!==o||t[18]!==s||t[19]!==a?(w=()=>{if(!o||o.kind!==`ok`||s)return;let e=!1;return Zd(o,n).then(t=>{if(!e){if(t.kind===`hit`){console.log(Gd({q1_hit:!0})),a.dismiss();return}console.log(Gd({q1_hit:!1})),c(!0)}}),()=>{e=!0}},T=[o,s,n,a],t[16]=n,t[17]=o,t[18]=s,t[19]=a,t[20]=w,t[21]=T):(w=t[20],T=t[21]),(0,Q.useEffect)(w,T);let E;t[22]===o?E=t[23]:(E=o?Wd(o):null,t[22]=o,t[23]=E);let D=E;if(!D)return null;let O;t[24]!==D.owner||t[25]!==D.repo?(O={owner:D.owner,repo:D.repo},t[24]=D.owner,t[25]=D.repo,t[26]=O):O=t[26];let k=O;if(!s)return null;let A;t[27]!==d?.authenticated||t[28]!==n||t[29]!==r||t[30]!==h||t[31]!==k||t[32]!==D||t[33]!==a?(A=async function(){if(!D)return;if(console.log(Gd({q2_path:`clone`})),!r){X.info(`Clone happens in the Project Navigator. Reclick the share link there.`,{action:{label:`Open Navigator`,onClick:()=>{n.navigator.open()}},duration:8e3});return}if(!d?.authenticated||h)return;g(!0);let e=Vd(k),t;try{t=await r.runClone({url:e})}catch{X.error(`Clone failed. Please try again.`),g(!1);return}if(g(!1),t.kind===`ok`){try{await n.project.open({path:t.dir,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkDoc:D.path})}catch{X.error(`Cloned successfully, but could not open the project.`)}a.dismiss();return}},t[27]=d?.authenticated,t[28]=n,t[29]=r,t[30]=h,t[31]=k,t[32]=D,t[33]=a,t[34]=A):A=t[34];let j=A,M;t[35]!==p||t[36]!==r?(M=async function(){if(!(!r||p)){m(!0);try{let e=await r.startSignIn();m(!1),e!==null&&f(e)}catch{m(!1)}}},t[35]=p,t[36]=r,t[37]=M):M=t[37];let N=M,P;t[38]!==n||t[39]!==k||t[40]!==l||t[41]!==D||t[42]!==a?(P=async function(){if(!(!D||l)){u(!0),console.log(Gd({q2_path:`local`}));try{for(;;){let e=await n.dialog.openFolder();if(!e)break;let t=await n.share.validateLocalFolder({folderPath:e,owner:k.owner,repo:k.repo});if(console.log(Gd({folder_validate:t.kind})),t.kind===`ok`){await n.project.open({path:e,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkDoc:D.path}),a.dismiss();break}let r=Hd(t,k);r&&X.error(r)}}catch{X.error(`Could not validate folder. Please try again.`)}u(!1)}},t[38]=n,t[39]=k,t[40]=l,t[41]=D,t[42]=a,t[43]=P):P=t[43];let F=P,I=r!==void 0&&d?.authenticated===!0&&!h,L=h?`Cloning...`:r&&d?.authenticated===!1?`Sign in to clone`:`Clone to a new folder`,R;t[44]===a?R=t[45]:(R=e=>{e||a.dismiss()},t[44]=a,t[45]=R);let z;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Z.jsx)(Ao,{children:`Open shared document`}),t[46]=z):z=t[46];let B=D.path?` · ${D.path}`:null,V;t[47]!==D.owner||t[48]!==D.repo||t[49]!==B?(V=(0,Z.jsxs)(Bo,{children:[z,(0,Z.jsxs)(Oo,{children:[D.owner,`/`,D.repo,B]})]}),t[47]=D.owner,t[48]=D.repo,t[49]=B,t[50]=V):V=t[50];let H;t[51]===j?H=t[52]:(H=()=>{j()},t[51]=j,t[52]=H);let U=r!==void 0&&!I,W=r!==void 0&&!I,G;t[53]===L?G=t[54]:(G=(0,Z.jsx)(`span`,{className:`text-sm font-semibold`,children:L}),t[53]=L,t[54]=G);let ee;t[55]!==D.owner||t[56]!==D.repo?(ee=(0,Z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`Downloads `,D.owner,`/`,D.repo,` from GitHub.`]}),t[55]=D.owner,t[56]=D.repo,t[57]=ee):ee=t[57];let te;t[58]!==H||t[59]!==U||t[60]!==W||t[61]!==G||t[62]!==ee?(te=(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-clone`,className:`flex flex-col items-start gap-2 rounded-lg border-2 border-primary/40 bg-card p-4 text-left transition hover:border-primary hover:bg-accent focus:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-primary/40 disabled:hover:bg-card`,onClick:H,disabled:U,"aria-disabled":W,children:[G,ee]}),t[58]=H,t[59]=U,t[60]=W,t[61]=G,t[62]=ee,t[63]=te):te=t[63];let ne;t[64]===F?ne=t[65]:(ne=()=>{F()},t[64]=F,t[65]=ne);let re=l||h,ie,ae;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Z.jsx)(`span`,{className:`text-sm font-semibold`,children:`I already have it locally →`}),ae=(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Pick the folder where you've cloned it.`}),t[66]=ie,t[67]=ae):(ie=t[66],ae=t[67]);let oe;t[68]!==ne||t[69]!==re?(oe=(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`share-receive-local`,className:`flex flex-col items-start gap-2 rounded-lg border border-border bg-card p-4 text-left transition hover:border-foreground/50 hover:bg-accent focus:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:ne,disabled:re,children:[ie,ae]}),t[68]=ne,t[69]=re,t[70]=oe):oe=t[70];let se;t[71]!==te||t[72]!==oe?(se=(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[te,oe]}),t[71]=te,t[72]=oe,t[73]=se):se=t[73];let K;t[74]!==p||t[75]!==d||t[76]!==r||t[77]!==N?(K=r?(0,Z.jsx)(`div`,{className:`mt-3 flex items-center justify-between rounded-md border border-border bg-muted/30 px-3 py-2 text-xs`,"data-testid":`share-receive-auth-banner`,children:d===null?(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`Checking GitHub sign-in...`}):d.authenticated?(0,Z.jsxs)(`span`,{className:`text-muted-foreground`,children:[`Signed in as`,` `,(0,Z.jsxs)(`span`,{className:`font-medium text-foreground/90`,children:[`@`,d.login]})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`Not signed in to GitHub.`}),(0,Z.jsx)(`button`,{type:`button`,"data-testid":`share-receive-signin`,className:`font-medium text-primary underline-offset-2 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded`,onClick:()=>{N()},disabled:p,children:p?`Opening...`:`Sign in to GitHub`})]})}):null,t[74]=p,t[75]=d,t[76]=r,t[77]=N,t[78]=K):K=t[78];let ce;t[79]===k?ce=t[80]:(ce=Rd(k),t[79]=k,t[80]=ce);let le;t[81]===ce?le=t[82]:(le=(0,Z.jsxs)(`p`,{className:`mt-3 text-[11px] text-muted-foreground`,children:[`Looking for`,` `,(0,Z.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 text-foreground/80`,children:ce}),`.`]}),t[81]=ce,t[82]=le);let ue;t[83]!==se||t[84]!==K||t[85]!==le?(ue=(0,Z.jsxs)(Lo,{children:[se,K,le]}),t[83]=se,t[84]=K,t[85]=le,t[86]=ue):ue=t[86];let q;t[87]===a?q=t[88]:(q=(0,Z.jsx)(Ro,{children:(0,Z.jsx)(Y,{variant:`ghost`,onClick:()=>a.dismiss(),children:`Cancel`})}),t[87]=a,t[88]=q);let de;t[89]!==V||t[90]!==ue||t[91]!==q?(de=(0,Z.jsxs)(Po,{className:`sm:max-w-xl`,"data-testid":`share-receive-dialog`,children:[V,ue,q]}),t[89]=V,t[90]=ue,t[91]=q,t[92]=de):de=t[92];let fe;return t[93]!==R||t[94]!==de?(fe=(0,Z.jsx)(Vo,{open:!0,onOpenChange:R,children:de}),t[93]=R,t[94]=de,t[95]=fe):fe=t[95],fe}function Xd(){return null}async function Zd(e,t){let n;try{n=Bd(await t.project.listRecent(),{owner:e.owner,repo:e.repo})}catch{return{kind:`miss`}}if(!n)return{kind:`miss`};try{if((await t.share.validateLocalFolder({folderPath:n.path,owner:e.owner,repo:e.repo})).kind!==`ok`)return{kind:`miss`}}catch{return{kind:`miss`}}try{return await t.project.open({path:n.path,target:`new-window`,entryPoint:`share-receive`,pendingDeepLinkDoc:e.path}),{kind:`hit`}}catch{return{kind:`miss`}}}var Qd=(e,t,n)=>fl(e,t,n,`NavigatorApp`);function $d(e,t){return e.filter(e=>e.path!==t)}function ef(e){let t=(0,$.c)(82),{bridge:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],t[0]=r):r=t[0];let[i,a]=(0,Q.useState)(r),[o,s]=(0,Q.useState)(!0),[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(!1),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(!1),[v,y]=(0,Q.useState)(null),b=typeof window<`u`&&window.okDesktop!=null,[x,S]=(0,Q.useState)(`auth`),{theme:C}=Gr();Rt(n,C??`system`);let w;t[1]===n.project?w=t[2]:(w=()=>{let e=!1;return n.project.listRecent().then(t=>{e||a(t)}).catch(t=>{console.error(`[NavigatorApp] listRecent failed:`,t),e||l(t instanceof Error?t.message:`Failed to load recent projects.`)}).finally(()=>{e||s(!1)}),()=>{e=!0}},t[1]=n.project,t[2]=w);let T;t[3]===n?T=t[4]:(T=[n],t[3]=n,t[4]=T),(0,Q.useEffect)(w,T);let E;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(E=(e,t)=>Qd(e,t,l),t[5]=E):E=t[5];let D=E,O;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>d(!0),t[6]=O):O=t[6];let k=O,A;t[7]===n?A=t[8]:(A=()=>D(async()=>{let e=await n.dialog.openFolder();e&&await rf(n,e,`pick-existing`)},`Failed to open folder.`),t[7]=n,t[8]=A);let j=A,M;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(M=()=>p(!0),t[9]=M):M=t[9];let N=M,P;t[10]===n?P=t[11]:(P=e=>D(async()=>{await rf(n,e,`recents`)},`Failed to open project.`),t[10]=n,t[11]=P);let F=P,I;t[12]===n.project?I=t[13]:(I=e=>D(async()=>{await n.project.removeRecent(e),a(t=>$d(t,e))},`Failed to remove project.`),t[12]=n.project,t[13]=I);let L=I,R;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-0 z-10 h-9 ${b?`[-webkit-app-region:drag]`:``}`,"data-electron-drag":b?``:void 0,"data-testid":`nav-chrome-row`}),t[14]=R):R=t[14];let z;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Z.jsx)(Nd,{className:`size-12 shrink-0`}),t[15]=z):z=t[15];let B;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`h1`,{className:`font-medium text-xl tracking-tight`,children:`Open Knowledge`}),(0,Z.jsx)(sd,{})]}),t[16]=B):B=t[16];let V;t[17]===n.appVersion?V=t[18]:(V=(0,Z.jsxs)(`header`,{className:`shrink-0 flex-wrap flex items-center gap-2.5`,children:[z,(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[B,(0,Z.jsxs)(`p`,{className:`text-muted-foreground text-xs font-mono`,children:[`v`,n.appVersion]})]})]}),t[17]=n.appVersion,t[18]=V);let H;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Z.jsx)(tf,{title:`Clone from GitHub`,description:`Bring a remote repository onto this machine.`,onClick:k,dataTestId:`nav-clone`,Icon:Md}),t[19]=H):H=t[19];let U;t[20]===j?U=t[21]:(U=(0,Z.jsx)(tf,{title:`Open folder on disk`,description:`Use a folder you already have.`,onClick:j,dataTestId:`nav-open`,Icon:ve}),t[20]=j,t[21]=U);let W;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Z.jsx)(tf,{title:`Create new project`,description:`Start a new Open Knowledge project.`,onClick:N,dataTestId:`nav-create-new`,Icon:re}),t[22]=W):W=t[22];let G;t[23]===U?G=t[24]:(G=(0,Z.jsxs)(`section`,{className:`grid shrink-0 sm:grid-cols-3 gap-3`,children:[H,U,W]}),t[23]=U,t[24]=G);let ee;t[25]===c?ee=t[26]:(ee=c===null?null:(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 rounded-md border border-red-500/30 bg-red-500/10 px-3 py-2`,"data-testid":`nav-error-banner`,role:`alert`,children:[(0,Z.jsx)(`span`,{className:`text-red-700 text-xs dark:text-red-300`,children:c}),(0,Z.jsx)(Y,{type:`button`,variant:`link`,size:`sm`,onClick:()=>l(null),className:`h-auto p-0 text-red-700 text-xs dark:text-red-300`,"data-testid":`nav-error-dismiss`,children:`Dismiss`})]}),t[25]=c,t[26]=ee);let te;t[27]!==o||t[28]!==F||t[29]!==L||t[30]!==i?(te=o?(0,Z.jsx)(`section`,{className:`flex shrink-0 flex-col items-center`,children:(0,Z.jsx)(tt,{className:`size-4 animate-spin text-muted-foreground/60`})}):i.length>0?(0,Z.jsxs)(`section`,{className:`flex min-h-0 flex-col`,children:[(0,Z.jsx)(`h2`,{className:`mb-2 shrink-0 font-medium text-muted-foreground font-mono text-xs uppercase tracking-wide`,children:`Recent`}),(0,Z.jsx)(`ul`,{className:`min-h-0 max-h-48 subtle-scrollbar scroll-fade-mask overflow-y-auto space-y-0.5 -mx-4`,"data-testid":`nav-recent-list`,children:i.map(e=>(0,Z.jsx)(nf,{project:e,onOpen:()=>F(e.path),onRemove:()=>L(e.path)},e.path))})]}):null,t[27]=o,t[28]=F,t[29]=L,t[30]=i,t[31]=te):te=t[31];let ne;t[32]!==V||t[33]!==G||t[34]!==ee||t[35]!==te?(ne=(0,Z.jsx)(`div`,{className:`mx-auto flex h-full w-full max-w-5xl flex-col overflow-hidden px-12 py-12`,children:(0,Z.jsxs)(`div`,{className:`my-auto flex min-h-0 flex-col space-y-10`,children:[V,G,ee,te]})}),t[32]=V,t[33]=G,t[34]=ee,t[35]=te,t[36]=ne):ne=t[36];let ie,ae;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Z.jsx)(Fd,{}),ae=(0,Z.jsx)(fd,{}),t[37]=ie,t[38]=ae):(ie=t[37],ae=t[38]);let oe;t[39]!==n||t[40]!==f?(oe=(0,Z.jsx)(Cd,{open:f,onOpenChange:p,bridge:n}),t[39]=n,t[40]=f,t[41]=oe):oe=t[41];let se;t[42]===v?se=t[43]:(se=e=>{h(e),e||(_(!1),v&&(v(null),y(null)))},t[42]=v,t[43]=se);let K;t[44]===n?K=t[45]:(K=wl(n),t[44]=n,t[45]=K);let ce=x===`identity`,le;t[46]!==g||t[47]!==v?(le=e=>{h(!1),g&&(_(!1),d(!0)),v&&(v({authenticated:!0,host:`github.com`,login:e.login}),y(null))},t[46]=g,t[47]=v,t[48]=le):le=t[48];let ue;t[49]!==m||t[50]!==se||t[51]!==K||t[52]!==ce||t[53]!==le?(ue=(0,Z.jsx)(rd,{open:m,onOpenChange:se,transport:K,identityPrompt:ce,onSuccess:le}),t[49]=m,t[50]=se,t[51]=K,t[52]=ce,t[53]=le,t[54]=ue):ue=t[54];let q;t[55]===n?q=t[56]:(q=El(n),t[55]=n,t[56]=q);let de;t[57]===n?de=t[58]:(de=bl(n),t[57]=n,t[58]=de);let fe;t[59]===n.dialog?fe=t[60]:(fe=()=>n.dialog.openFolder(),t[59]=n.dialog,t[60]=fe);let pe;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(pe=()=>{d(!1),S(`auth`),_(!0),h(!0)},t[61]=pe):pe=t[61];let me;t[62]===n?me=t[63]:(me=e=>{let{dir:t}=e;D(()=>rf(n,t,`pick-existing`),`Failed to open cloned project.`)},t[62]=n,t[63]=me);let he;t[64]!==u||t[65]!==q||t[66]!==de||t[67]!==fe||t[68]!==me?(he=(0,Z.jsx)(ud,{open:u,onOpenChange:d,transport:q,authQueryTransport:de,pickParentFolder:fe,onSignIn:pe,onCloneComplete:me}),t[64]=u,t[65]=q,t[66]=de,t[67]=fe,t[68]=me,t[69]=he):he=t[69];let ge;if(t[70]!==n){let e;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(e=()=>new Promise(e=>{y(()=>e),h(!0)}),t[72]=e):e=t[72],ge=hl({bridge:n,authQueryTransport:bl(n),cloneTransport:El(n),openSignIn:e}),t[70]=n,t[71]=ge}else ge=t[71];let _e;t[73]!==n||t[74]!==ge?(_e=(0,Z.jsx)(Yd,{bridge:n,cloneController:ge}),t[73]=n,t[74]=ge,t[75]=_e):_e=t[75];let ye;return t[76]!==ne||t[77]!==oe||t[78]!==ue||t[79]!==he||t[80]!==_e?(ye=(0,Z.jsxs)(`div`,{className:`relative flex h-screen w-screen flex-col overflow-hidden bg-primary-foreground dark:bg-background text-foreground`,children:[R,ne,ie,ae,oe,ue,he,_e]}),t[76]=ne,t[77]=oe,t[78]=ue,t[79]=he,t[80]=_e,t[81]=ye):ye=t[81],ye}function tf(e){let t=(0,$.c)(14),{title:n,description:r,onClick:i,dataTestId:a,Icon:o}=e,s;t[0]===o?s=t[1]:(s=o?(0,Z.jsx)(o,{className:`size-4 shrink-0 text-muted-foreground`}):null,t[0]=o,t[1]=s);let c;t[2]===n?c=t[3]:(c=(0,Z.jsx)(`span`,{className:`font-medium text-gray-700 dark:text-foreground text-sm`,children:n}),t[2]=n,t[3]=c);let l;t[4]!==s||t[5]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s,c]}),t[4]=s,t[5]=c,t[6]=l):l=t[6];let u;t[7]===r?u=t[8]:(u=(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs leading-snug`,children:r}),t[7]=r,t[8]=u);let d;return t[9]!==a||t[10]!==i||t[11]!==l||t[12]!==u?(d=(0,Z.jsxs)(Y,{type:`button`,variant:`outline`,onClick:i,"data-testid":a,className:`h-auto flex-col items-start justify-start gap-1.5 whitespace-normal bg-card px-4 py-3.5 text-left`,children:[l,u]}),t[9]=a,t[10]=i,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function nf(e){let t=(0,$.c)(25),{project:n,onOpen:r,onRemove:i}=e,a=n.missing,o=n.missing&&`opacity-50`,s;t[0]===o?s=t[1]:(s=Di(`h-auto min-w-0 flex-1 justify-between gap-2 py-3.5 pl-4 pr-2 text-left hover:bg-transparent`,o),t[0]=o,t[1]=s);let c;t[2]===n.name?c=t[3]:(c=(0,Z.jsx)(`span`,{className:`font-medium text-sm text-gray-700 dark:text-foreground`,children:n.name}),t[2]=n.name,t[3]=c);let l;t[4]===n.path?l=t[5]:(l=(0,Z.jsx)(`span`,{className:`truncate w-full text-muted-foreground text-xs`,children:n.path}),t[4]=n.path,t[5]=l);let u;t[6]!==c||t[7]!==l?(u=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1 truncate`,children:[c,l]}),t[6]=c,t[7]=l,t[8]=u):u=t[8];let d;t[9]===n.missing?d=t[10]:(d=n.missing?(0,Z.jsx)(ze,{className:`text-2xs rounded-sm`,variant:`warning`,children:`Missing`}):null,t[9]=n.missing,t[10]=d);let f;t[11]!==r||t[12]!==n.missing||t[13]!==s||t[14]!==u||t[15]!==d?(f=(0,Z.jsxs)(Y,{type:`button`,variant:`ghost`,onClick:r,disabled:a,className:s,children:[u,d]}),t[11]=r,t[12]=n.missing,t[13]=s,t[14]=u,t[15]=d,t[16]=f):f=t[16];let p=`Remove ${n.name} from recent projects`,m=`nav-recent-remove-${n.path}`,h;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(Do,{"aria-hidden":`true`}),t[17]=h):h=t[17];let g;t[18]!==i||t[19]!==m||t[20]!==p?(g=(0,Z.jsx)(Y,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:i,"aria-label":p,title:`Remove from recent projects`,className:`pointer-events-none mr-2 opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 focus-visible:pointer-events-auto focus-visible:opacity-100`,"data-testid":m,children:h}),t[18]=i,t[19]=m,t[20]=p,t[21]=g):g=t[21];let _;return t[22]!==g||t[23]!==f?(_=(0,Z.jsxs)(`li`,{className:`group flex items-center justify-between rounded-lg hover:bg-accent`,children:[f,g]}),t[22]=g,t[23]=f,t[24]=_):_=t[24],_}async function rf(e,t,n){await e.project.open({path:t,target:`new-window`,entryPoint:n})}var af=e=>{let t=(0,$.c)(8),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let{theme:r}=Gr(),i=r===void 0?`system`:r,a,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a={success:(0,Z.jsx)(ri,{className:`size-4`}),info:(0,Z.jsx)(V,{className:`size-4`}),warning:(0,Z.jsx)(Ir,{className:`size-4`}),error:(0,Z.jsx)(Nc,{className:`size-4`}),loading:(0,Z.jsx)(tt,{className:`size-4 animate-spin`})},o={"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},t[2]=a,t[3]=o):(a=t[2],o=t[3]);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s={classNames:{toast:`cn-toast`}},t[4]=s):s=t[4];let c;return t[5]!==n||t[6]!==i?(c=(0,Z.jsx)(ko,{theme:i,className:`toaster group`,icons:a,style:o,toastOptions:s,...n}),t[5]=n,t[6]=i,t[7]=c):c=t[7],c};function of(e){let{apiOrigin:t}=e;if(!t)return;let n=Symbol.for(`ok.desktop.fetchRewrite`);if(window.fetch[n])return;let r=window.fetch.bind(window),i=((e,n)=>{if(typeof e==`string`)return r(sf(e,t),n);if(e instanceof URL)return e.pathname.startsWith(`/api/`)&&(e.origin===window.location.origin||e.protocol===`file:`)?r(t+(e.pathname+e.search+e.hash),n):r(e,n);try{let i=new URL(e.url,window.location.origin);if(i.pathname.startsWith(`/api/`)){let a=i.pathname+i.search+i.hash;return r(new Request(t+a,e),n)}}catch{}return r(e,n)});i[n]=!0,window.fetch=i}function sf(e,t){return e.startsWith(`/api/`)?t+e:e}var cf=e=>typeof e==`string`,lf=e=>typeof e==`function`,uf=new Map,df=`en`;function ff(e){return[...Array.isArray(e)?e:[e],df]}function pf(e,t,n){let r=ff(e);n||=`default`;let i;if(typeof n==`string`)switch(i={day:`numeric`,month:`short`,year:`numeric`},n){case`full`:i.weekday=`long`;case`long`:i.month=`long`;break;case`short`:i.month=`numeric`;break}else i=n;return _f(()=>vf(`date`,r,n),()=>new Intl.DateTimeFormat(r,i)).format(cf(t)?new Date(t):t)}function mf(e,t,n){let r;if(n||=`default`,typeof n==`string`)switch(r={second:`numeric`,minute:`numeric`,hour:`numeric`},n){case`full`:case`long`:r.timeZoneName=`short`;break;case`short`:delete r.second}else r=n;return pf(e,t,r)}function hf(e,t,n){let r=ff(e);return _f(()=>vf(`number`,r,n),()=>new Intl.NumberFormat(r,n)).format(t)}function gf(e,t,n,{offset:r=0,...i}){let a=ff(e),o=t?_f(()=>vf(`plural-ordinal`,a),()=>new Intl.PluralRules(a,{type:`ordinal`})):_f(()=>vf(`plural-cardinal`,a),()=>new Intl.PluralRules(a,{type:`cardinal`}));return i[n]??i[o.select(n-r)]??i.other}function _f(e,t){let n=e(),r=uf.get(n);return r||(r=t(),uf.set(n,r)),r}function vf(e,t,n){return`${e}-${t.join(`-`)}-${JSON.stringify(n)}`}var yf=/\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/,bf=e=>e.replace(/\\u([a-fA-F0-9]{4})|\\x([a-fA-F0-9]{2})/g,(e,t,n)=>{if(t){let e=parseInt(t,16);return String.fromCharCode(e)}else{let e=parseInt(n,16);return String.fromCharCode(e)}}),xf=`%__lingui_octothorpe__%`,Sf=(e,t,n={})=>{let r=t||e,i=e=>typeof e==`object`?e:n[e],a=(e,t)=>{let a=hf(r,e,Object.keys(n).length?i(`number`):void 0);return t.replace(new RegExp(xf,`g`),a)};return{plural:(e,t)=>{let{offset:n=0}=t,i=gf(r,!1,e,t);return a(e-n,i)},selectordinal:(e,t)=>{let{offset:n=0}=t,i=gf(r,!0,e,t);return a(e-n,i)},select:Cf,number:(e,t)=>hf(r,e,i(t)||{style:t}),date:(e,t)=>pf(r,e,i(t)||t),time:(e,t)=>mf(r,e,i(t)||t)}},Cf=(e,t)=>t[e]??t.other;function wf(e,t,n){return(r={},i)=>{let a=Sf(t,n,i),o=(e,t=!1)=>Array.isArray(e)?e.reduce((e,n)=>{if(n===`#`&&t)return e+xf;if(cf(n))return e+n;let[i,s,c]=n,l={};s===`plural`||s===`selectordinal`||s===`select`?Object.entries(c).forEach(([e,t])=>{l[e]=o(t,s===`plural`||s===`selectordinal`)}):l=c;let u;if(s){let e=a[s];u=e(r[i],l)}else u=r[i];return u==null?e:e+u},``):e,s=o(e);return cf(s)&&yf.test(s)?bf(s):cf(s)?s:s?String(s):``}}var Tf=class{_events={};on(e,t){return this._events[e]??=new Set,this._events[e].add(t),()=>this.removeListener(e,t)}removeListener(e,t){let n=this._events[e];n?.delete(t),n?.size===0&&delete this._events[e]}emit(e,...t){let n=this._events[e];if(n)for(let e of[...n])e.apply(this,t)}},Ef=class extends Tf{_locale=``;_locales;_messages={};_missing;_messageCompiler;constructor(e){super(),e.missing!=null&&(this._missing=e.missing),e.messages!=null&&this.load(e.messages),(typeof e.locale==`string`||e.locales)&&this.activate(e.locale??df,e.locales)}get locale(){return this._locale}get locales(){return this._locales}get messages(){return this._messages[this._locale]??{}}setMessagesCompiler(e){return this._messageCompiler=e,this}_load(e,t){let n=this._messages[e];n?Object.assign(n,t):this._messages[e]=t}load(e,t){typeof e==`string`&&typeof t==`object`?this._load(e,t):Object.entries(e).forEach(([e,t])=>this._load(e,t)),this.emit(`change`)}loadAndActivate({locale:e,locales:t,messages:n}){this._locale=e,this._locales=t||void 0,this._messages[this._locale]=n,this.emit(`change`)}activate(e,t){this._locale=e,this._locales=t,this.emit(`change`)}_(e,t,n){if(!this.locale)throw Error(`Lingui: Attempted to call a translation function without setting a locale.
14
- Make sure to call \`i18n.activate(locale)\` before using Lingui functions.
15
- This issue may also occur due to a race condition in your initialization logic.`);let r=n?.message;e||=``,cf(e)||(t=e.values||t,r=e.message,e=e.id);let i=this.messages[e],a=i===void 0,o=this._missing;if(o&&a)return lf(o)?o(this._locale,e):o;a&&this.emit(`missing`,{id:e,locale:this._locale});let s=i||r||e;return cf(s)&&(this._messageCompiler?s=this._messageCompiler(s):console.warn(`Uncompiled message detected! Message:
16
-
17
- > ${s}
18
-
19
- That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
20
- ICU features such as interpolation and plurals will not work properly for that message.
21
-
22
- Please compile your catalog first.
23
- `)),cf(s)&&yf.test(s)?bf(s):cf(s)?s:wf(s,this._locale,this._locales)(t,n?.formats)}t=this._.bind(this);date(e,t){return pf(this._locales||this._locale,e,t)}number(e,t){return hf(this._locales||this._locale,e,t)}};function Df(e={}){return new Ef(e)}var Of=Df(),kf=JSON.parse(`{"0YEbfk":["Connect to AI tools"],"3zyg_A":["Ignore patterns"],"5wV2qQ":["and more"],"5y_9lO":["Waiting for authorization"],"6Uau97":["Skip"],"6V3Ea3":["Copied"],"6YtxFj":["Name"],"6nB8LV":["Paste a personal access token"],"7qRHf0":["Install for Claude Chat & Cowork"],"8XS8nG":["Open in your favorite AI editor."],"9fvog2":["Preview unavailable: ",["errorDetail"]],"AMyJts":["This path is on an external volume (/Volumes/...). Open Knowledge will lose track of files when the drive ejects."],"AThCb_":["Open Knowledge manages the <0>open-knowledge</0> MCP server name, the <1>open-knowledge-ui</1> launch config, and <2>ok</2> / <3>open-knowledge</3> on PATH (including OK-owned symlinks). Using a custom wrapper? Register it under a different name."],"AVoO4B":["Open <0>",["verificationUri"],"</0> and enter this code:"],"C0NPNd":["Add Open Knowledge to your AI tools"],"COr1Y7":["Pick <0>openknowledge.skill</0> from your <1>Downloads</1> folder. It enables automatically."],"DPfwMq":["Done"],"DiFKSL":["Counting markdown files"],"Dnn2XG":["Automatic"],"DskIkK":["Sign-in stream ended without confirmation — please try again"],"GgQgML":["You picked your home directory. Open Knowledge will index everything in your home tree — large and may surface personal files."],"GjElCU":["Select a file from the sidebar, or pick where to edit alongside your agent."],"HRU-eL":["You picked ~/Documents. Open Knowledge will index every markdown file under it. If you only want to manage a sub-folder, choose a smaller scope."],"IA1wNb":["The Claude Desktop App didn't open the file. Is it installed? (",["msg"],")"],"IajAbS":["Add a starter pack"],"J2Mv98":["Name (e.g. ",["login"],")"],"KDw4GX":["Try again"],"KZkHZv":["Signed in as @",["login"]],"L8fKuc":["Run this in your terminal"],"M3ytY_":["This looks like a drive root (e.g., C:\\\\). Scaffolding here will scan an entire drive."],"MV-Dkb":["Found ",["countDisplay"]," markdown files"],"O2UpM1":["Browse"],"O3oNi5":["Email"],"Oos8fo":["Copy command"],"P-ye9o":["Could not open folder picker"],"PiH3UR":["Copied!"],"Q5fqMz":["Connection error — try again"],"RN62Q8":["We'll build <0>openknowledge.skill</0>, save it to <1>~/Downloads</1>, and open the Claude Desktop App for you."],"TKQ7K-":["Install"],"TP9_K5":["Token"],"TmKshB":["Invalid token — check that it has repo scope"],"U3IvM5":["Full guide"],"U5Spo9":["Content directory must be inside the project"],"UTZ97u":["Selection must be inside the project"],"Uw6ERJ":["Couldn't copy: ",["detail"]],"W8uemY":["Pick a starter pack to scaffold folders, templates, and AI-readable rules."],"Wtw22s":["Installing"],"X8kjQX":["Re-authenticate with GitHub"],"XyNe7f":["Electron bridge unavailable. Refresh and try again."],"YGIi_c":["Reinstall"],"ZWolSV":["You picked the filesystem root (/). Scaffolding here will scan every file on this machine — make sure that's what you want."],"ZmGmNh":["Let's set up your project."],"aE2_XM":["One pattern per line — appended to <0>.okignore</0>."],"aWlJai":["Starting sign-in flow"],"b4itZn":["Working"],"bBE5tC":["Detected on this machine"],"bwil08":["Building <0>openknowledge.skill</0> and opening the Claude Desktop App"],"cIptmH":["In the Claude Desktop App"],"cKjLuT":["(project + user)"],"dEgA5A":["Cancel"],"dGaH3A":["Create a token at <0>github.com/settings/tokens</0> with <1>repo</1> scope."],"eSu2Xn":["Writes a project-MCP config for each selected tool; Claude also gets <0>.claude/launch.json</0>."],"ensWZc":["or start from scratch <0/>"],"fIgqfQ":["Reinstalling"],"fX82Jn":["Open Knowledge will create a <0>.ok/</0> folder here to track this project's metadata."],"gGVP4q":["Click <0>+</0> <1/> <2>Create skill</2> <3/> <4>Upload skill</4>."],"gYz2ep":["Expires in ",["timeLabel"]],"gp3I7-":["Before syncing, set your identity for git commits:"],"gtmbUO":["Sign in to GitHub"],"hA8GQ6":["Will replace existing Open Knowledge entry"],"hSySVc":["Install handoff failed: ",["msg"]],"hYFQsG":["Validating"],"he3ygx":["Copy"],"hynz2K":["Download started"],"kV2YZv":["Don't see <0>Skills</0>? Enable <1>Settings <2/> Capabilities <3/> Code execution and file creation</1> first."],"ll2yNl":["Content directory"],"m16xKo":["Add"],"mGaZwZ":["See the full install guide"],"mKZODc":["Adds the Open Knowledge skill to the <0>Claude Desktop App</0> so it's available in Chat and Cowork sessions."],"mYLRjR":["You picked ~/Desktop. Open Knowledge will index everything on your desktop."],"muWKMD":["No response — try again"],"nNYV3Y":["and ",["remaining"]," more"],"nYKerc":["(user-level only)"],"p2LEhJ":["Personal access token"],"pAlxX6":["Open this folder with Open Knowledge"],"pHYP6v":["Open <0>Customize</0> in the sidebar <1/> <2>Skills</2>."],"pdHb22":["GitHub App"],"qXg5W9":["File saves to <0>~/Downloads/openknowledge.skill</0>."],"r51jLC":["File saved & Claude Desktop App opened"],"snrVQ7":["probe failed"],"tXkhj_":["Start"],"tfDRzk":["Save"],"ve8vEM":["Code expired — please try again"],"wlwXUk":["You picked ~/Downloads. Files there are usually transient — consider a stable folder instead."],"xNyj3h":["Reinstall for Claude Chat & Cowork"],"yu8Pzy":["Not detected"],"yz7wBu":["Close"],"z60Lgn":["Saves the file to <0>~/Downloads/openknowledge.skill</0> and opens the Claude Desktop App. Requires Node.js or Bun on your PATH."],"zXZ0sB":["Open Knowledge initializes at <0>",["projectDir"],"</0> — the parent of <1>",["pickedRelative"],"</1> because it contains a <2>.git</2> folder (one .ok/ per git repo). <3>Content directory</3> defaults to <4>.</4> (the whole repo); type a sub-folder to narrow it."],"zXZJoN":["Add token"]}`),Af=`en`;Of.load(Af,kf),Of.activate(Af);function jf(e){return`#/${encodeURIComponent(e)}`}function Mf(e){let t=e.bridge;if(!t)return;let n=e.setHash??(e=>{window.location.hash=e});return t.onDeepLink(e=>{n(jf(e.doc))})}var Nf=4e3,Pf=1440*60*1e3;function Ff(e){let t=e.bridge;if(t&&t.onboarding)return t.onboarding.onToast(e=>{if(e.kind===`ancestor-promote`){X.success(`Opened existing Open Knowledge project at ${e.ancestorPath}`,{duration:Nf});return}if(e.kind===`startup-reclaim`){let t=[];if(e.mcp.status===`repaired`){let n=e.mcp.editors.map(e=>lr[e]??e).join(`, `);t.push(`repaired ${n} MCP integration`)}else e.mcp.status===`failed`&&t.push(`MCP auto-repair failed`);e.path.status===`installed`&&t.push(e.path.summary),e.path.status===`failed`&&t.push(`PATH install failed: ${e.path.summary}`);let n=t.length>0?t.join(`; `):`Open Knowledge integrations checked.`,r=e.mcp.status===`failed`||e.path.status===`failed`;X[r?`error`:`success`](n,{duration:r?Pf:Nf});return}let t=ns(e.gitRoot,e.pickedPath)??e.pickedPath;X.success(`Initialized Open Knowledge at ${e.gitRoot} — opened parent of ${t} because it contains a .git folder`,{duration:Nf})})}var If=!1;function Lf(e,t,n,r){let i=e[t];if(typeof i!=`function`){console.warn(`[cold-mount-instrumentation] target missing method "${t}"`);return}e[t]=function(...e){let t=performance.now(),a,o=!1;try{return a=i.apply(this,e),o=!0,a}finally{let e=performance.now()-t,i;if(o&&r)try{i=r(this,a,t,e)}catch(e){i={"instrumentation-error":e instanceof Error?e.message:String(e)}}try{Mt(n,{durationMs:Math.round(e*1e3)/1e3,threw:!o,...i},{startTime:t,duration:e})}catch{}}}}function Rf(e){return e?.doc?typeof e.doc.nodeSize==`number`?e.doc.nodeSize:e.doc.content&&typeof e.doc.content.size==`number`?e.doc.content.size:null:null}var zf=0,Bf=0,Vf=0,Hf=0,Uf=null,Wf=[`linkResolutionDecoration$`],Gf=new WeakSet,Kf=new WeakSet;function qf(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function Jf(){return!1}function Yf(){return!Jf()}function Xf(e,t){if(Yf())return t;let n=`ok/cold/nodeview-factory-${qf(e)}`;return function(...r){let i=performance.now();try{return t(...r)}finally{let t=performance.now()-i;Mt(n,{nodeType:e,durationMs:Math.round(t*1e3)/1e3},{startTime:i,duration:t})}}}function Zf(e){if(Yf())return;let t=e.state.plugins;for(let e of t){if(Kf.has(e))continue;let t=e.spec?.key?.key;if(!t||!Wf.some(e=>t.startsWith(e)))continue;let n=e.props,r=n.decorations;if(typeof r!=`function`){Kf.add(e);continue}let i=`ok/cold/decoration-${qf(t.replace(/\$\d*$/,``))}`;n.decorations=function(...e){let n=performance.now();try{return r.apply(this,e)}finally{let e=performance.now()-n;Mt(i,{pluginKey:t,durationMs:Math.round(e*1e3)/1e3},{startTime:n,duration:e})}},Kf.add(e)}}function Qf(e){if(Yf())return;let t=e._props?.nodeViews;if(!(!t||typeof t!=`object`))for(let[e,n]of Object.entries(t)){if(typeof n!=`function`||n.__okWrapped===!0)continue;let r=Xf(e,n);r.__okWrapped=!0,t[e]=r}}function $f(e){return Yf()?e:e.map(e=>{let t=e.name??`unknown`,n=qf(t);return e.extend({onBeforeCreate(){let e=performance.now();try{this.parent?.()}finally{let r=performance.now()-e;Mt(`ok/cold/ext-${n}-on-before-create`,{ext:t,hook:`onBeforeCreate`,durationMs:Math.round(r*1e3)/1e3},{startTime:e,duration:r})}},onCreate(){let e=performance.now();try{this.parent?.()}finally{let r=performance.now()-e;Mt(`ok/cold/ext-${n}-on-create`,{ext:t,hook:`onCreate`,durationMs:Math.round(r*1e3)/1e3},{startTime:e,duration:r})}},onUpdate(){let e=performance.now();try{this.parent?.()}finally{let r=performance.now()-e;Mt(`ok/cold/ext-${n}-on-update`,{ext:t,hook:`onUpdate`,durationMs:Math.round(r*1e3)/1e3},{startTime:e,duration:r})}},onDestroy(){let e=performance.now();try{this.parent?.()}finally{let r=performance.now()-e;Mt(`ok/cold/ext-${n}-on-destroy`,{ext:t,hook:`onDestroy`,durationMs:Math.round(r*1e3)/1e3},{startTime:e,duration:r})}}})})}function ep(){if(!If){If=!0,Lf(Ln.prototype,`mount`,`ok/cold/editor-mount`,(e,t,n,r)=>{let i=e;return Yf()||(Uf=performance.now()),{elementDefault:i.options?.element?.nodeName??null,docSize:Rf(i.editorState),durationMs:r}}),Lf(Ln.prototype,`createView`,`ok/cold/editor-create-view`,e=>{let t=e;return!Yf()&&!Gf.has(e)&&t.view&&(Zf(t.view),Qf(t.view),Gf.add(e)),{docSize:Rf(t.editorState)}}),Lf(Ln.prototype,`createNodeViews`,`ok/cold/create-node-views`,(e,t,n,r)=>{Hf+=1;let i=e;return!Yf()&&i.view&&Qf(i.view),{docSize:Rf(i.view),seq:Hf,durationMs:r}}),Lf(Yn.prototype,`updateState`,`ok/cold/pm-update-state`,(e,t,n,r)=>(Bf+=1,{seq:Bf,docSize:Rf(e.state),durationMs:r})),Lf(Yn.prototype,`setProps`,`ok/cold/pm-set-props`,(e,t,n,r)=>(Vf+=1,{seq:Vf,docSize:Rf(e.state),durationMs:r})),Lf(Pe.prototype,`_forceRerender`,`ok/cold/force-rerender`,(e,t,n,r)=>{zf+=1;let i=e,a=(()=>{try{return i.type?.toArray?i.type.toArray().length:null}catch{return null}})();return{seq:zf,topLevelYElements:a,durationMs:r}}),Lf(ct.prototype,`init`,`ok/cold/ec-init`,e=>({editorPresent:!!e.props?.editor}));try{typeof PerformanceObserver<`u`&&new PerformanceObserver(e=>{for(let t of e.getEntries()){let e=t.name;if((e===`first-paint`||e===`first-contentful-paint`)&&(Mt(e===`first-paint`?`ok/cold/paint-fp`:`ok/cold/paint-fcp`,{entryType:t.entryType,startTime:Math.round(t.startTime*1e3)/1e3},{startTime:t.startTime,duration:0}),!Yf()&&e===`first-paint`&&Uf!==null)){let e=Uf,n=Math.max(0,t.startTime-e);Mt(`ok/cold/append-to-paint`,{paintEntryType:t.entryType,durationMs:Math.round(n*1e3)/1e3,paintAt:Math.round(t.startTime*1e3)/1e3},{startTime:e,duration:n}),Uf=null}}}).observe({type:`paint`,buffered:!0})}catch{}globalThis.__okColdMountInstrumented=!0}}var tp=`Relaunch`,np=`Release notes`,rp=`Updates paused`,ip=`Download`,ap=`Reset to defaults`,op=`Relaunch failed — please restart manually`,sp=`Recovery action failed — please try again`;function cp(e,t){let n=t instanceof Error&&t.message?t.message:``;return n?`${e}: ${n}`:e}function lp(e){return`Version ${e} ready to install`}function up(e){return`Updated to Version ${e}`}function dp(e){return`Your settings and recent projects were saved by a newer build than this one (v${e}). Reset to defaults to continue.`}var fp=0,pp=0,mp=1,hp=2,gp=3;function _p(e,t,n=()=>{}){let r=[];return r.push(e.onUpdateDownloaded(({version:r})=>{let i=`update-downloaded`;t({id:i,body:lp(r),priority:hp,action:{label:tp,onClick:()=>{e.update.relaunchNow().then(()=>{n(i)},e=>{t({id:`relaunch-error-${r}`,body:cp(op,e),variant:`error`,priority:mp})})}}})})),r.push(e.onWhatsNew(({version:n,releaseUrl:r})=>{t({id:`whats-new-${n}`,body:up(n),priority:gp,action:{label:np,onClick:()=>{e.shell.openExternal(r)}}})})),r.push(e.onUpdateStuckHint(({downloadUrl:n})=>{t({id:`update-stuck-hint`,body:rp,priority:pp,action:{label:ip,onClick:()=>{e.shell.openExternal(n)}}})})),()=>{for(let e of r)e()}}function vp(e,t,n,r=()=>{}){let i=`schema-incompatibility-${t.persistedSchemaVersion}`,a=`schema-incompatibility-error-${t.persistedSchemaVersion}`,o=e=>{r(i),n({id:a,body:cp(sp,e),variant:`error`,priority:fp})};n({id:i,body:dp(t.currentBuild),priority:fp,action:{label:ap,onClick:()=>{e.state.resetIncompatible().then(()=>{r(i)},o)}}})}var yp=[],bp=new Set,xp=!1;function Sp(){for(let e of bp)e()}function Cp(e){let t=yp.findIndex(t=>t.id===e.id);if(t===-1)yp=[...yp,e];else{let n=yp.slice();n[t]=e,yp=n}Sp()}function wp(e){let t=yp.filter(t=>t.id!==e);t.length!==yp.length&&(yp=t,Sp())}function Tp(){return yp}function Ep(e){return bp.add(e),()=>{bp.delete(e)}}function Dp(){if(xp||typeof window>`u`)return;let e=window.okDesktop;e&&(xp=!0,_p(e,Cp,wp),e.state.query().then(t=>{t.schemaIncompatibility&&vp(e,t.schemaIncompatibility,Cp,wp)},e=>{console.warn(`[update-notices-store] bridge.state.query() failed`,e)}))}var Op=`ok-omnibar-recents-v1`,kp=10;function Ap(e){return typeof e==`object`&&!!e&&(e.kind===`file`||e.kind===`folder`)&&typeof e.path==`string`&&typeof e.lastOpenedAt==`string`}function jp(e){if(e)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function Mp(e,t){return`${e}:${t}`}function Np(e){let t=jp(e);if(!t)return[];try{let e=t.getItem(Op);if(!e)return[];let n=JSON.parse(e);return Array.isArray(n)?n.filter(Ap).slice(0,kp):[]}catch{return[]}}function Pp(e,t){let n=jp(t);if(n)try{n.setItem(Op,JSON.stringify(e.slice(0,kp)))}catch(e){console.warn(`[omnibar] Failed to save recent entries:`,e)}}function Fp(e,t){return[t,...e.filter(e=>e.kind!==t.kind||e.path!==t.path)].slice(0,kp)}function Ip(e,t){return e.filter(e=>t.has(Mp(e.kind,e.path)))}var Lp=50,Rp=30,zp=``,Bp=null;function Vp(e){return e.trim().toLowerCase()}function Hp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Up(e){let t=e.trim();return t?[...new Set(t.split(/\s+/).filter(Boolean))].sort((e,t)=>t.length-e.length):[]}function Wp(e,t,n=new Map,r=new Map){let i=[];for(let t of e){let e=r.get(t)?.modified,a=n.get(t);i.push({kind:`file`,path:t,name:cr(t),...a?{title:a}:{},...e?{modifiedTs:Date.parse(e)}:{}})}for(let e of t)i.push({kind:`folder`,path:e,name:cr(e)});return i.sort((e,t)=>{let n=e.path.localeCompare(t.path);return n===0?e.kind===t.kind?0:e.kind===`folder`?-1:1:n}),i}function Gp(e){return In({kind:e.kind===`file`?`page`:`folder`,path:e.path,title:e.title??e.name,modifiedTs:e.modifiedTs??0})}function Kp(e){return{entries:e,byId:new Map(e.map(e=>[`${e.kind===`file`?`page`:`folder`}:${e.path}`,e])),corpus:dr(e.map(Gp))}}function qp(e){return e.map(e=>`${e.kind}\u0000${e.path}\u0000${e.title??``}\u0000${e.modifiedTs??0}`).join(``)}function Jp(e){let t=qp(e);return Bp&&zp===t?Bp:(zp=t,Bp=Kp(e),Bp)}function Yp(e,t,n=Lp){return Xp(Jp(e),t,n)}function Xp(e,t,n=Lp){let r=Vp(t);return r?Hr(e.corpus,r,{intent:`omnibar`,limit:n,scopes:[`page`,`folder`]}).map(t=>e.byId.get(t.document.id)).filter(e=>e!==void 0):e.entries.slice(0,20)}function Zp(e,t){let n=Up(t);if(n.length===0||e.length===0)return[{text:e,match:!1,start:0}];let r=RegExp(`(${n.map(Hp).join(`|`)})`,`gi`),i=[],a=0;for(let t of e.matchAll(r)){let n=t.index??0;n>a&&i.push({text:e.slice(a,n),match:!1,start:a}),i.push({text:t[0],match:!0,start:n}),a=n+t[0].length}return a<e.length&&i.push({text:e.slice(a),match:!1,start:a}),i.length>0?i:[{text:e,match:!1,start:0}]}function Qp(e){if(e.kind!==`page`&&e.kind!==`folder`||typeof e.path!=`string`)return null;let t=cr(e.path);return{kind:e.kind===`page`?`file`:`folder`,path:e.path,name:t,...e.title&&{title:e.title},...e.snippet&&{snippet:e.snippet},...typeof e.score==`number`&&{score:e.score}}}async function $p(e,t={}){let n=e.trim();if(!n)return[];let r=await fetch(`/api/search`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({query:n,intent:`full_text`,scopes:[`page`,`folder`,`content`],limit:t.limit??Rp}),signal:t.signal});if(!r.ok){let e=await r.json().catch(()=>null);throw Error(Fn(e)??`Search failed with status ${r.status}`)}return((await r.json()).results??[]).map(Qp).filter(e=>!!e)}function em(e,t,n=[]){let r=Vp(t);return r?Vp([e,...n].join(` `)).includes(r):!0}var tm=`tag:`;function nm(e,t){if(!e.toLowerCase().startsWith(`tag:`))return{kind:`normal`,query:e};let n=e.slice(4).replace(/^\s+/,``).trim();return n&&t.has(n)?{kind:`tag-docs`,tagName:n}:{kind:`tag-list`,query:n}}function rm(e,t){return je(e,t)}var im=I;async function am(e){let t=await fetch(`/api/tags/${encodeURIComponent(e)}`);if(!t.ok)throw Error(`/api/tags/${e} responded with ${t.status}`);let n=await t.json();return Array.isArray(n.docs)?n.docs:[]}var om=`open-knowledge:doc-panel-tab`,sm=null;function cm(){let e=sm;return sm=null,e}function lm(e,t=typeof window>`u`?new EventTarget:window){sm=e,t.dispatchEvent(new CustomEvent(om,{detail:{tab:e}}))}function um(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail?.tab:void 0;n&&e(n)};return t.addEventListener(om,n),()=>t.removeEventListener(om,n)}var dm=[`.md`,`.mdx`];function fm(e){let t=e.toLowerCase();for(let e of dm)if(t.endsWith(e))return e;return null}function pm(e){let t=fm(e);return t?e.slice(0,-t.length):e}var mm=`__blank__`,hm={local:0,inherited:1};function gm(e){return[...e].sort((e,t)=>{let n=hm[e.scope]-hm[t.scope];if(n!==0)return n;let r=(e.title??e.name).toLowerCase(),i=(t.title??t.name).toLowerCase();return r.localeCompare(i)})}function _m(e){return e.trim()?e.includes(`..`)?`Path cannot contain ".."`:e.startsWith(`/`)?`Path cannot start with "/"`:e.includes(`\\`)?`Path cannot contain backslashes`:e.includes(`\0`)?`Path cannot contain null bytes`:null:`Name cannot be empty`}function vm(e){let t=e.fileName.trim(),n=fm(t)?t:`${t}${e.fileExtension??`.md`}`;if(e.kind===`folder`){let t=(e.folderName??``).trim();return`${e.initialDir?`${e.initialDir}/${t}`:t}/${n}`}return e.initialDir?`${e.initialDir}/${n}`:n}function ym(e){let t=e.target;return t?.tagName===`INPUT`||t?.tagName===`TEXTAREA`||t?.isContentEditable?!1:!!((e.metaKey||e.ctrlKey)&&e.altKey&&e.key.toLowerCase()===`n`)}function bm(e){let t=e.value.lastIndexOf(`.`);t>0?e.setSelectionRange(0,t):e.select()}function xm(e){let t=(0,$.c)(120),{open:n,onOpenChange:r,kind:i,initialDir:a,suggestedName:o,initialTemplate:s,description:c,onCreated:l,folderConfig:u}=e,{addPage:d}=Nr(),f=Qa(u?null:a),p=u??f,[m,h]=(0,Q.useState)(``),[g,_]=(0,Q.useState)(``),[v,y]=(0,Q.useState)(`.md`),[b,x]=(0,Q.useState)(mm),[S,C]=(0,Q.useState)(null),[w,E]=(0,Q.useState)(!1),[D,O]=(0,Q.useState)(null),k=(0,Q.useId)(),A=(0,Q.useId)(),j=(0,Q.useId)(),M=(0,Q.useId)(),N=(0,Q.useId)(),[P,F]=(0,Q.useState)(!1),I=(0,Q.useRef)(null),L=(0,Q.useRef)(null),R,z;t[0]!==s||t[1]!==i||t[2]!==n||t[3]!==o?(R=()=>{if(n){C(null),O(null),E(!1),_(``),x(i===`file`&&s?s:mm),F(!1);let e=i===`file`?o??`untitled`:`index`,t=fm(e);y(t??`.md`),h(t?pm(e):e)}},z=[n,i,o,s],t[0]=s,t[1]=i,t[2]=n,t[3]=o,t[4]=R,t[5]=z):(R=t[4],z=t[5]),(0,Q.useEffect)(R,z);let B;t[6]!==p.state.data||t[7]!==p.state.status?(B=p.state.status===`ready`?gm(p.state.data.folder.templates_available??[]):[],t[6]=p.state.data,t[7]=p.state.status,t[8]=B):B=t[8];let V=B,H;t[9]!==p.state.data||t[10]!==p.state.status||t[11]!==n||t[12]!==b?(H=()=>{n&&b!==mm&&p.state.status===`ready`&&((p.state.data.folder.templates_available??[]).some(e=>e.name===b)||x(mm))},t[9]=p.state.data,t[10]=p.state.status,t[11]=n,t[12]=b,t[13]=H):H=t[13];let U;t[14]!==p.state||t[15]!==n||t[16]!==b?(U=[n,b,p.state],t[14]=p.state,t[15]=n,t[16]=b,t[17]=U):U=t[17],(0,Q.useEffect)(H,U);let W=i===`file`,G=p.state.status===`loading`||p.state.status===`idle`,ee=p.state.status===`error`?p.state.message:null,te;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(te=function(e){let t=fm(e);t?(y(t),h(pm(e))):h(e),C(null)},t[18]=te):te=t[18];let ne=te,re;t[19]!==v||t[20]!==m||t[21]!==g||t[22]!==a||t[23]!==i?(re=function(){return vm({kind:i,initialDir:a,fileName:m,fileExtension:v,folderName:g})},t[19]=v,t[20]=m,t[21]=g,t[22]=a,t[23]=i,t[24]=re):re=t[24];let ie=re,ae;t[25]!==m||t[26]!==g||t[27]!==i?(ae=function(){if(i===`folder`){let e=_m(g.trim());if(e)return{message:`Folder name: ${e}`,field:`folder`}}let e=_m(m.trim());return e?{message:e,field:`file`}:null},t[25]=m,t[26]=g,t[27]=i,t[28]=ae):ae=t[28];let oe=ae,se;t[29]!==w||t[30]!==m||t[31]!==g||t[32]!==i?(se=w||!m.trim()||i===`folder`&&!g.trim(),t[29]=w,t[30]=m,t[31]=g,t[32]=i,t[33]=se):se=t[33];let K=se,ce;t[34]!==d||t[35]!==ie||t[36]!==oe||t[37]!==i||t[38]!==l||t[39]!==r||t[40]!==b?(ce=async function(){let e=oe();if(e){C(e.message),O(e.field);return}E(!0),C(null),O(null);let t=ie(),n=i===`file`&&b!==mm?b:void 0,a={path:t};n!==void 0&&(a.template=n);try{let e=await fetch(`/api/create-page`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)}),t=await T(e,`Server error (HTTP ${e.status})`);if(!t.ok){E(!1),C(t.title),O(`form`);return}let n=Ur.safeParse(t.body);if(E(!1),!n.success){C(`Failed to create ${i}`),O(`form`);return}let o=n.data.docName;r(!1),window.location.hash=`#/${o}`,d(o),Wr([`files`,`backlinks`,`graph`]),l?.(o)}catch(e){console.warn(`[NewItemDialog] create failed:`,e),E(!1),C(`Network error — please try again`),O(`form`)}},t[34]=d,t[35]=ie,t[36]=oe,t[37]=i,t[38]=l,t[39]=r,t[40]=b,t[41]=ce):ce=t[41];let le=ce,ue=a||`(root)`,q=i===`file`?`New file`:`New folder`,de;t[42]===q?de=t[43]:(de=(0,Z.jsx)(Ao,{children:q}),t[42]=q,t[43]=de);let fe;t[44]!==c||t[45]!==ue?(fe=c??(0,Z.jsxs)(Z.Fragment,{children:[`Create in `,(0,Z.jsx)(`span`,{className:`font-medium text-foreground`,children:ue})]}),t[44]=c,t[45]=ue,t[46]=fe):fe=t[46];let pe;t[47]===fe?pe=t[48]:(pe=(0,Z.jsx)(Oo,{children:fe}),t[47]=fe,t[48]=pe);let me;t[49]!==de||t[50]!==pe?(me=(0,Z.jsxs)(Bo,{children:[de,pe]}),t[49]=de,t[50]=pe,t[51]=me):me=t[51];let he;t[52]!==b||t[53]!==W||t[54]!==M||t[55]!==P||t[56]!==N||t[57]!==V||t[58]!==ee||t[59]!==G?(he=W&&(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`span`,{id:M,className:`mb-1.5 block text-sm font-medium`,children:`Start from`}),ee?(0,Z.jsxs)(`p`,{role:`alert`,className:`mb-1.5 text-xs text-destructive`,children:[`Could not load templates: `,ee,`. You can still create a blank note.`]}):null,(0,Z.jsx)(wm,{triggerId:N,labelledById:M,open:P,onOpenChange:F,value:b,onValueChange:x,templates:V,loading:G}),!G&&!ee&&V.length===0?(0,Z.jsx)(`p`,{className:`mt-1.5 text-xs text-muted-foreground`,children:`No templates resolve here. Add one in this folder's Templates section, or in Settings → Templates.`}):null]}),t[52]=b,t[53]=W,t[54]=M,t[55]=P,t[56]=N,t[57]=V,t[58]=ee,t[59]=G,t[60]=he):he=t[60];let ge;t[61]!==S||t[62]!==D||t[63]!==k||t[64]!==A||t[65]!==g||t[66]!==i?(ge=i===`folder`&&(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:A,children:`Folder name`}),(0,Z.jsx)(Wo,{ref:L,id:A,value:g,onChange:e=>{_(e.target.value),C(null)},placeholder:`folder-name`,autoFocus:!0,"aria-describedby":S&&(D===`folder`||D===`form`)?k:void 0,"aria-invalid":S&&(D===`folder`||D===`form`)?!0:void 0,onKeyDown:e=>{if(e.key===`Enter`){e.preventDefault();let t=_m(g.trim());if(t){C(`Folder name: ${t}`),O(`folder`);return}I.current?.focus()}}})]}),t[61]=S,t[62]=D,t[63]=k,t[64]=A,t[65]=g,t[66]=i,t[67]=ge):ge=t[67];let _e=i===`folder`?`First file name`:`File name`,ve;t[68]!==j||t[69]!==_e?(ve=(0,Z.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:j,children:_e}),t[68]=j,t[69]=_e,t[70]=ve):ve=t[70];let ye;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(ye=e=>ne(e.target.value),t[71]=ye):ye=t[71];let be=i===`file`,xe=S&&(D===`file`||D===`form`)?k:void 0,Se=S&&(D===`file`||D===`form`)?!0:void 0,Ce;t[72]!==le||t[73]!==K?(Ce=e=>{e.key===`Enter`&&!K&&le()},t[72]=le,t[73]=K,t[74]=Ce):Ce=t[74];let we;t[75]!==j||t[76]!==m||t[77]!==be||t[78]!==xe||t[79]!==Se||t[80]!==Ce?(we=(0,Z.jsx)(Wo,{ref:I,id:j,value:m,onChange:ye,placeholder:`my-note`,autoFocus:be,"aria-describedby":xe,"aria-invalid":Se,onFocus:Cm,onKeyDown:Ce,className:`flex-1`}),t[75]=j,t[76]=m,t[77]=be,t[78]=xe,t[79]=Se,t[80]=Ce,t[81]=we):we=t[81];let Te;t[82]===Symbol.for(`react.memo_cache_sentinel`)?(Te=e=>{(e===`.md`||e===`.mdx`)&&y(e)},t[82]=Te):Te=t[82];let Ee;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=dm.map(Sm),t[83]=Ee):Ee=t[83];let De;t[84]===v?De=t[85]:(De=(0,Z.jsx)($o,{type:`single`,value:v,onValueChange:Te,variant:`outline`,"aria-label":`File extension`,className:`shrink-0`,children:Ee}),t[84]=v,t[85]=De);let Oe;t[86]!==we||t[87]!==De?(Oe=(0,Z.jsxs)(`div`,{className:`flex items-stretch gap-2`,children:[we,De]}),t[86]=we,t[87]=De,t[88]=Oe):Oe=t[88];let ke;t[89]!==S||t[90]!==k?(ke=S&&(0,Z.jsx)(`p`,{id:k,role:`alert`,className:`text-xs text-red-600 dark:text-red-400`,children:S}),t[89]=S,t[90]=k,t[91]=ke):ke=t[91];let Ae;t[92]!==ve||t[93]!==Oe||t[94]!==ke?(Ae=(0,Z.jsxs)(`div`,{children:[ve,Oe,ke]}),t[92]=ve,t[93]=Oe,t[94]=ke,t[95]=Ae):Ae=t[95];let je;t[96]!==he||t[97]!==ge||t[98]!==Ae?(je=(0,Z.jsx)(Lo,{children:(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[he,ge,Ae]})}),t[96]=he,t[97]=ge,t[98]=Ae,t[99]=je):je=t[99];let Me;t[100]===r?Me=t[101]:(Me=()=>r(!1),t[100]=r,t[101]=Me);let Ne;t[102]!==w||t[103]!==Me?(Ne=(0,Z.jsx)(Y,{variant:`outline`,className:`font-mono uppercase`,onClick:Me,disabled:w,children:`Cancel`}),t[102]=w,t[103]=Me,t[104]=Ne):Ne=t[104];let Pe=w?`Creating`:`Create`,Fe;t[105]!==le||t[106]!==K||t[107]!==Pe?(Fe=(0,Z.jsx)(Y,{onClick:le,disabled:K,children:Pe}),t[105]=le,t[106]=K,t[107]=Pe,t[108]=Fe):Fe=t[108];let J;t[109]!==Ne||t[110]!==Fe?(J=(0,Z.jsxs)(Ro,{children:[Ne,Fe]}),t[109]=Ne,t[110]=Fe,t[111]=J):J=t[111];let Ie;t[112]!==me||t[113]!==je||t[114]!==J?(Ie=(0,Z.jsxs)(Po,{className:`sm:max-w-md`,"data-ok-layer-spawned":``,children:[me,je,J]}),t[112]=me,t[113]=je,t[114]=J,t[115]=Ie):Ie=t[115];let Le;return t[116]!==r||t[117]!==n||t[118]!==Ie?(Le=(0,Z.jsx)(Vo,{open:n,onOpenChange:r,children:Ie}),t[116]=r,t[117]=n,t[118]=Ie,t[119]=Le):Le=t[119],Le}function Sm(e){return(0,Z.jsx)(Xo,{value:e,"aria-label":`Use ${e} extension`,children:e},e)}function Cm(e){return bm(e.currentTarget)}function wm(e){let t=(0,$.c)(53),{triggerId:n,labelledById:r,open:i,onOpenChange:a,value:o,onValueChange:s,templates:c,loading:l}=e,u=(0,Q.useId)(),d;if(t[0]!==c||t[1]!==o){let e;t[3]===o?e=t[4]:(e=e=>e.name===o,t[3]=o,t[4]=e),d=c.find(e),t[0]=c,t[1]=o,t[2]=d}else d=t[2];let f=d,m=o===mm,h=i?u:void 0,g=`${r} ${n}`,_=l?`Loading templates`:m?`Blank note`:f?.title??f?.name??o,v;t[5]===_?v=t[6]:(v=(0,Z.jsx)(`span`,{className:`truncate`,children:_}),t[5]=_,t[6]=v);let y;t[7]!==m||t[8]!==l||t[9]!==f?(y=!l&&!m&&f?(0,Z.jsx)(Om,{entry:f}):null,t[7]=m,t[8]=l,t[9]=f,t[10]=y):y=t[10];let b;t[11]!==v||t[12]!==y?(b=(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[v,y]}),t[11]=v,t[12]=y,t[13]=b):b=t[13];let x;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(nc,{className:`ml-2 size-4 shrink-0 opacity-50`,"aria-hidden":`true`}),t[14]=x):x=t[14];let S;t[15]!==l||t[16]!==i||t[17]!==h||t[18]!==g||t[19]!==b||t[20]!==n?(S=(0,Z.jsx)(Wt,{asChild:!0,children:(0,Z.jsxs)(Y,{id:n,type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":i,"aria-haspopup":`listbox`,"aria-controls":h,"aria-labelledby":g,disabled:l,className:`w-full justify-between font-normal`,children:[b,x]})}),t[15]=l,t[16]=i,t[17]=h,t[18]=g,t[19]=b,t[20]=n,t[21]=S):S=t[21];let C;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(Te,{placeholder:`Search templates`}),t[22]=C):C=t[22];let w;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(A,{children:`No templates found.`}),t[23]=w):w=t[23];let T;t[24]!==a||t[25]!==s?(T=()=>{s(mm),a(!1)},t[24]=a,t[25]=s,t[26]=T):T=t[26];let E=o===mm?`opacity-100`:`opacity-0`,O;t[27]===E?O=t[28]:(O=Di(`mt-1 size-4 shrink-0`,E),t[27]=E,t[28]=O);let k;t[29]===O?k=t[30]:(k=(0,Z.jsx)(Eo,{className:O,"aria-hidden":`true`}),t[29]=O,t[30]=k);let j;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsx)(`span`,{className:`text-sm font-medium`,children:`Blank note`}),(0,Z.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-xs text-muted-foreground`,children:`Empty starting content`})]}),t[31]=j):j=t[31];let M;t[32]!==T||t[33]!==k?(M=(0,Z.jsxs)(D,{value:`Blank note empty`,onSelect:T,className:`items-start gap-3`,children:[k,j]}),t[32]=T,t[33]=k,t[34]=M):M=t[34];let N;if(t[35]!==a||t[36]!==s||t[37]!==c||t[38]!==o){let e;t[40]!==a||t[41]!==s||t[42]!==o?(e=e=>{let t=e.title??e.name,n=e.title&&e.title!==e.name?e.name:void 0,r=`${e.scope}:${e.source_folder}:${e.name}`;return(0,Z.jsxs)(D,{value:r,keywords:[t,e.name,e.description??``,e.scope,e.source_folder??``],onSelect:()=>{s(e.name),a(!1)},className:`items-start gap-3`,children:[(0,Z.jsx)(Eo,{className:Di(`mt-1 size-4 shrink-0`,o===e.name?`opacity-100`:`opacity-0`),"aria-hidden":`true`}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`truncate text-sm font-medium`,children:t}),n?(0,Z.jsx)(`code`,{className:`font-mono text-2xs text-muted-foreground shrink-0`,children:n}):null,(0,Z.jsx)(Om,{entry:e,className:`ml-auto`})]}),e.description?(0,Z.jsx)(`p`,{className:`mt-0.5 line-clamp-2 text-xs text-muted-foreground`,children:e.description}):null]})]},r)},t[40]=a,t[41]=s,t[42]=o,t[43]=e):e=t[43],N=c.map(e),t[35]=a,t[36]=s,t[37]=c,t[38]=o,t[39]=N}else N=t[39];let P;t[44]!==u||t[45]!==M||t[46]!==N?(P=(0,Z.jsx)(q,{className:`w-[var(--radix-popover-trigger-width)] p-0`,align:`start`,onOpenAutoFocus:Dm,onWheel:Em,onTouchMove:Tm,children:(0,Z.jsxs)(p,{children:[C,(0,Z.jsxs)(z,{id:u,className:`subtle-scrollbar`,children:[w,M,N]})]})}),t[44]=u,t[45]=M,t[46]=N,t[47]=P):P=t[47];let F;return t[48]!==a||t[49]!==i||t[50]!==P||t[51]!==S?(F=(0,Z.jsxs)(H,{open:i,onOpenChange:a,children:[S,P]}),t[48]=a,t[49]=i,t[50]=P,t[51]=S,t[52]=F):F=t[52],F}function Tm(e){e.stopPropagation()}function Em(e){e.stopPropagation()}function Dm(e){e.preventDefault(),e.currentTarget.querySelector(`[cmdk-input]`)?.focus()}function Om(e){let t=(0,$.c)(5),{entry:n,className:r}=e;if(n.scope===`inherited`){let e;t[0]===r?e=t[1]:(e=Di(`shrink-0 text-2xs`,r),t[0]=r,t[1]=e);let i=n.source_folder||`root`,a;return t[2]!==e||t[3]!==i?(a=(0,Z.jsx)(ze,{variant:`gray`,className:e,children:i}),t[2]=e,t[3]=i,t[4]=a):a=t[4],a}return null}function km(e){return e.split(`/`).pop()??e}function Am(e,t){let n=new Map;for(let e of t?.folders??[])n.set(e.path,e.summary);let r=e.created.filter(e=>e.kind===`folder`).map(e=>({kind:`folder`,name:`${e.path}/`,description:n.get(km(e.path))??``})),i=e.created.filter(e=>e.kind===`file`).map(e=>({kind:`file`,name:e.path,description:km(e.path)===`log.md`?`Append-only timeline`:``}));return[...r,...i]}function jm(e){let t=(0,$.c)(20),{plan:n,selectedPack:r}=e,i,a,o,s,c,l;if(t[0]!==n||t[1]!==r){let e=[...Am(n,r)].sort(Pm),u=new Set(e.map(Nm));c=`space-y-2`,t[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-xs font-semibold uppercase font-mono tracking-wider text-primary`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`flex items-center justify-center`,children:`◇`}),`What gets created`]}),t[8]=l):l=t[8],s=`overflow-hidden rounded-md border border-border/60 bg-muted/20`,i=`Items to be created`,a=`py-1.5`,o=e.map(e=>{let t=e.name.replace(/\/$/,``).split(`/`),n=0,r=0;for(let e=1;e<t.length;e++){let i=t.slice(0,e).join(`/`);u.has(i)&&(n++,r=e)}let i=t.slice(r).join(`/`)+(e.kind===`folder`?`/`:``),a=e.kind===`folder`;return(0,Z.jsxs)(`li`,{className:`relative flex min-w-0 items-center gap-1.5 py-1 pr-3`,style:{paddingLeft:`${12+n*16}px`},children:[Array.from({length:n},Mm),a?(0,Z.jsx)(bc,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`,strokeWidth:1.5}):(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Z.jsx)(`code`,{className:`font-mono text-1sm shrink-0 text-foreground/80`,children:i}),a&&e.description?(0,Z.jsxs)(jn,{children:[(0,Z.jsx)(En,{"aria-label":`Show description`,className:`flex shrink-0 cursor-help rounded outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,children:(0,Z.jsx)(V,{"aria-hidden":`true`,className:`size-3 text-muted-foreground/60`,strokeWidth:1.5})}),(0,Z.jsx)(er,{children:e.description})]}):null]},e.name)}),t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l}else i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7];let u;t[9]!==i||t[10]!==a||t[11]!==o?(u=(0,Z.jsx)(`ul`,{"aria-label":i,className:a,children:o}),t[9]=i,t[10]=a,t[11]=o,t[12]=u):u=t[12];let d;t[13]!==s||t[14]!==u?(d=(0,Z.jsx)(`div`,{className:s,children:u}),t[13]=s,t[14]=u,t[15]=d):d=t[15];let f;return t[16]!==c||t[17]!==l||t[18]!==d?(f=(0,Z.jsxs)(`section`,{className:c,children:[l,d]}),t[16]=c,t[17]=l,t[18]=d,t[19]=f):f=t[19],f}function Mm(e,t){return(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-0 bottom-0 w-px bg-border/50`,style:{left:`${12+t*16+8}px`}},`guide:${t}`)}function Nm(e){return e.name.replace(/\/$/,``)}function Pm(e,t){return e.name.localeCompare(t.name)}async function Fm(e){let t=await e.json().catch(()=>null),n=gr.safeParse(t);if(!n.success)return{kind:`internal`,message:`HTTP ${e.status}`};let r=n.data.detail??n.data.title,i=n.data.type;return i===`urn:ok:error:seed-prerequisite-missing`?{kind:`prerequisite-missing`,message:r}:i===`urn:ok:error:seed-invalid-root`?{kind:`invalid-root`,message:r}:i===`urn:ok:error:no-project-dir`?{kind:`no-project`,message:r}:{kind:`internal`,message:r}}function Im(){let e=typeof window<`u`?window.okDesktop:void 0;return e?.seed?{plan:e.seed.plan,apply:e.seed.apply,listPacks:e.seed.listPacks}:{plan:async e=>{let t=new URLSearchParams;e?.rootDir&&t.set(`rootDir`,e.rootDir),e?.packId&&t.set(`packId`,e.packId);let n=t.toString(),r=await fetch(`/api/seed/plan${n?`?${n}`:``}`);if(!r.ok)return{ok:!1,error:await Fm(r)};let i=await r.json().catch(()=>null);return i?.plan?{ok:!0,plan:i.plan}:{ok:!1,error:{kind:`internal`,message:`Malformed plan response`}}},apply:async(e,t)=>{let n=await fetch(`/api/seed/apply`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({plan:e,packId:t?.packId})});if(!n.ok)return{ok:!1,error:await Fm(n)};let r=await n.json().catch(()=>null);return r?.result?{ok:!0,result:r.result}:{ok:!1,error:{kind:`internal`,message:`Malformed apply response`}}},listPacks:async()=>{let e=await fetch(`/api/seed/packs`);if(!e.ok)return{ok:!1,error:{kind:`internal`,message:`HTTP ${e.status}`}};let t=await e.json().catch(()=>null);return!t||!Array.isArray(t.packs)?{ok:!1,error:{kind:`internal`,message:`Malformed listPacks response`}}:{ok:!0,packs:t.packs}}}}var Lm={"knowledge-base":Ec,"software-lifecycle":k,"plain-notes":tl,worldbuilding:lc,"writing-pipeline":Rc,gbrain:Mc};function Rm(e){return Lm[e]??Ec}function zm(e){let t=(0,$.c)(28),{onPackSelect:n,className:r,packs:i}=e,[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(null),l=i===void 0,u,d;t[0]===l?(u=t[1],d=t[2]):(u=()=>{if(!l)return;let e=!1;return(async()=>{try{let t=await Im().listPacks();if(e)return;t.ok?o(t.packs):c(t.error.message)}catch(t){let n=t;if(e)return;c(n instanceof Error?n.message:String(n))}})(),()=>{e=!0}},d=[l],t[0]=l,t[1]=u,t[2]=d),(0,Q.useEffect)(u,d);let f=l?a:i;if(s!==null){let e;t[3]===r?e=t[4]:(e=Di(`rounded-md bg-destructive/10 p-4 text-sm text-destructive`,r),t[3]=r,t[4]=e);let n;return t[5]!==s||t[6]!==e?(n=(0,Z.jsxs)(`div`,{role:`alert`,className:e,children:[`Couldn't load starter packs: `,s]}),t[5]=s,t[6]=e,t[7]=n):n=t[7],n}if(f===null){let e;t[8]===r?e=t[9]:(e=Di(`grid w-full max-w-5xl gap-4 sm:grid-cols-2 lg:grid-cols-3`,r),t[8]=r,t[9]=e);let n;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(n=Array.from({length:6},Vm).map(Bm),t[10]=n):n=t[10];let i;return t[11]!==e||t[12]!==n?(i=(0,Z.jsx)(`div`,{role:`status`,className:e,"aria-busy":`true`,"aria-label":`Loading starter packs`,children:n}),t[11]=e,t[12]=n,t[13]=i):i=t[13],i}if(f.length===0){let e;t[14]===r?e=t[15]:(e=Di(`flex w-full max-w-5xl items-center justify-center rounded-2xl border border-dashed border-border/60 bg-muted/20 p-8 text-sm text-muted-foreground`,r),t[14]=r,t[15]=e);let n;return t[16]===e?n=t[17]:(n=(0,Z.jsx)(`div`,{role:`status`,className:e,children:`No starter packs available.`}),t[16]=e,t[17]=n),n}let p;t[18]===r?p=t[19]:(p=Di(`grid w-full max-w-5xl gap-4 sm:grid-cols-2 lg:grid-cols-3`,r),t[18]=r,t[19]=p);let m;if(t[20]!==n||t[21]!==f){let e;t[23]===n?e=t[24]:(e=e=>(0,Z.jsx)(Hm,{pack:e,onSelect:()=>n(e.id)},e.id),t[23]=n,t[24]=e),m=f.map(e),t[20]=n,t[21]=f,t[22]=m}else m=t[22];let h;return t[25]!==p||t[26]!==m?(h=(0,Z.jsx)(`div`,{className:p,children:m}),t[25]=p,t[26]=m,t[27]=h):h=t[27],h}function Bm(e){return(0,Z.jsx)(Wm,{},`skeleton-${e}`)}function Vm(e,t){return t}function Hm(e){let t=(0,$.c)(23),{pack:n,onSelect:r}=e,i;t[0]===n.id?i=t[1]:(i=Rm(n.id),t[0]=n.id,t[1]=i);let a=i,{files:o,folders:s}=n.entryCounts,c;t[2]===a?c=t[3]:(c=(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`flex size-8 items-center justify-center rounded-lg bg-primary/5 text-primary`,children:(0,Z.jsx)(a,{className:`size-4`})}),t[2]=a,t[3]=c);let l;t[4]===n.name?l=t[5]:(l=(0,Z.jsx)(`h3`,{className:`text-sm font-medium leading-tight`,children:n.name}),t[4]=n.name,t[5]=l);let u;t[6]!==c||t[7]!==l?(u=(0,Z.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start sm:items-center gap-2`,children:[c,l]}),t[6]=c,t[7]=l,t[8]=u):u=t[8];let d;t[9]===n.description?d=t[10]:(d=(0,Z.jsx)(`p`,{className:`text-1sm leading-relaxed text-muted-foreground`,children:n.description}),t[9]=n.description,t[10]=d);let f;t[11]!==u||t[12]!==d?(f=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[u,d]}),t[11]=u,t[12]=d,t[13]=f):f=t[13];let p;t[14]!==o||t[15]!==s?(p=Um({files:o,folders:s}),t[14]=o,t[15]=s,t[16]=p):p=t[16];let m;t[17]===p?m=t[18]:(m=(0,Z.jsx)(`p`,{className:`mt-auto pt-2 font-mono text-2xs uppercase tracking-wider text-muted-foreground`,children:p}),t[17]=p,t[18]=m);let h;return t[19]!==r||t[20]!==f||t[21]!==m?(h=(0,Z.jsxs)(`button`,{type:`button`,onClick:r,className:`group flex h-full flex-col items-start gap-4 rounded-2xl border border-border/60 bg-card p-5 text-left transition-[border-color,box-shadow,transform] hover:border-border hover:shadow-sm focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px`,children:[f,m]}),t[19]=r,t[20]=f,t[21]=m,t[22]=h):h=t[22],h}function Um({files:e,folders:t}){let n=e>0?`${e} ${e===1?`file`:`files`}`:null,r=`${t} ${t===1?`folder`:`folders`}`;return n?`${n} · ${r}`:r}function Wm(){let e=(0,$.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`span`,{className:`size-10 animate-pulse rounded-lg bg-muted`,"aria-hidden":`true`,children:(0,Z.jsx)(tt,{className:`size-5 animate-spin text-muted-foreground opacity-0`})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(`div`,{className:`flex h-full min-h-[200px] flex-col items-start gap-4 rounded-xl border border-border/60 bg-card p-6`,children:[t,(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,children:[(0,Z.jsx)(`div`,{className:`h-4 w-1/2 animate-pulse rounded bg-muted`}),(0,Z.jsx)(`div`,{className:`h-3 w-full animate-pulse rounded bg-muted`}),(0,Z.jsx)(`div`,{className:`h-3 w-4/5 animate-pulse rounded bg-muted`})]}),(0,Z.jsx)(`div`,{className:`mt-auto h-3 w-20 animate-pulse rounded bg-muted`})]}),e[1]=n):n=e[1],n}function Gm(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`grid w-full gap-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Ku,{"data-slot":`radio-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Km(e){let t=(0,$.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(Ju,{"data-slot":`radio-group-indicator`,className:`flex size-4 items-center justify-center`,children:(0,Z.jsx)(`span`,{className:`absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground`})}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,Z.jsx)(qu,{"data-slot":`radio-group-item`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}var qm=`knowledge-base`;function Jm(e){let t=(0,$.c)(74),{open:n,onOpenChange:r,onSeedApplied:i,initialPackId:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o={kind:`loading`},t[0]=o):o=t[0];let[s,c]=(0,Q.useState)(o),[l,u]=(0,Q.useState)(null),[d,f]=(0,Q.useState)(a??qm),[p,m]=(0,Q.useState)(`project-root`),[h,g]=(0,Q.useState)(``),[_,v]=(0,Q.useState)(a===void 0?`pick`:`configure`),y=(0,Q.useRef)(!0),b;t[1]!==l||t[2]!==d?(b=l?.find(e=>e.id===d),t[1]=l,t[2]=d,t[3]=b):b=t[3];let x=b,S,C;t[4]!==n||t[5]!==l?(S=()=>{if(!n||l!==null)return;let e=!1;return(async()=>{try{let t=await Im().listPacks();if(e)return;t.ok?u(t.packs):(u([]),c({kind:`error`,message:t.error.message}))}catch(t){let n=t;if(e)return;u([]),c({kind:`error`,message:n instanceof Error?n.message:String(n)})}})(),()=>{e=!0}},C=[n,l],t[4]=n,t[5]=l,t[6]=S,t[7]=C):(S=t[6],C=t[7]),(0,Q.useEffect)(S,C);let w,T;t[8]!==a||t[9]!==n?(w=()=>{n&&(f(a??qm),m(`project-root`),g(``),v(a===void 0?`pick`:`configure`),c({kind:`loading`}),y.current=!0)},T=[n,a],t[8]=a,t[9]=n,t[10]=w,t[11]=T):(w=t[10],T=t[11]),(0,Q.useEffect)(w,T);let E,D;t[12]===x?(E=t[13],D=t[14]):(E=()=>{x&&g(x.defaultSubfolder??``)},D=[x],t[12]=x,t[13]=E,t[14]=D),(0,Q.useEffect)(E,D);let O;t[15]===h?O=t[16]:(O=h.trim(),t[15]=h,t[16]=O);let k=O,A=p===`subfolder`&&k===``,j,M;t[17]!==n||t[18]!==l||t[19]!==p||t[20]!==d||t[21]!==_||t[22]!==A||t[23]!==k?(j=()=>{if(!n||_!==`configure`||l===null)return;if(A){c({kind:`error`,message:`Enter a folder name (e.g. brain).`});return}let e=p===`project-root`?void 0:k,t=y.current?0:200;y.current=!1;let r=!1,i=setTimeout(()=>{r||(c(Ym),Im().plan({rootDir:e,packId:d}).then(e=>{if(!r){if(!e.ok){c({kind:`error`,message:e.error.message});return}c(e.plan.created.length>0?{kind:`plan`,plan:e.plan}:{kind:`already-seeded`,plan:e.plan})}}).catch(e=>{r||c({kind:`error`,message:e instanceof Error?e.message:String(e)})}))},t);return()=>{r=!0,clearTimeout(i)}},M=[n,_,l,d,p,k,A],t[17]=n,t[18]=l,t[19]=p,t[20]=d,t[21]=_,t[22]=A,t[23]=k,t[24]=j,t[25]=M):(j=t[24],M=t[25]),(0,Q.useEffect)(j,M);let N;t[26]!==r||t[27]!==i||t[28]!==s.kind||t[29]!==s.plan||t[30]!==x?.name||t[31]!==d?(N=async function(){if(s.kind!==`plan`)return;let e=s.plan;c({kind:`applying`,plan:e});let t;try{t=await Im().apply(e,{packId:d})}catch(t){let n=t,r=n instanceof Error?n.message:String(n);X.error(`Initialize failed: ${r}`),c({kind:`plan`,plan:e});return}if(t.ok){let e=x?.name??`starter pack`,n=t.result.applied,a=n===0?`${e} was already set up. Nothing to do.`:`${e} initialized (${n} ${n===1?`entry`:`entries`})`;X.success(a),i?.(),r(!1)}else X.error(`Initialize failed: ${t.error.message}`),c({kind:`plan`,plan:e})},t[26]=r,t[27]=i,t[28]=s.kind,t[29]=s.plan,t[30]=x?.name,t[31]=d,t[32]=N):N=t[32];let P=N,F=a!==void 0,I=_===`configure`&&x?`Initialize ${x.name}`:`Initialize a starter pack`,L=_===`configure`&&x?x.description:`Pick a layout that matches what you're building. Each pack ships with folders, templates, and agent-readable descriptions. You can mix and match later.`,R;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(R=function(e){f(e),v(`configure`),y.current=!0},t[33]=R):R=t[33];let z=R,B;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(B=function(){v(`pick`),c({kind:`loading`}),y.current=!0},t[34]=B):B=t[34];let V=B,H;t[35]===I?H=t[36]:(H=(0,Z.jsx)(Ao,{children:I}),t[35]=I,t[36]=H);let U;t[37]===L?U=t[38]:(U=(0,Z.jsx)(Oo,{children:L}),t[37]=L,t[38]=U);let W;t[39]!==H||t[40]!==U?(W=(0,Z.jsxs)(Bo,{children:[H,U]}),t[39]=H,t[40]=U,t[41]=W):W=t[41];let G;t[42]!==l||t[43]!==s||t[44]!==p||t[45]!==x||t[46]!==_||t[47]!==h?(G=_===`pick`?(0,Z.jsx)(Lo,{children:(0,Z.jsx)(zm,{packs:l,onPackSelect:z})}):(0,Z.jsxs)(Lo,{className:`space-y-6`,children:[(0,Z.jsx)(Xm,{choice:p,subfolder:h,placeholder:x?.defaultSubfolder??`subfolder`,onChoiceChange:m,onSubfolderChange:g}),(0,Z.jsx)(Zm,{phase:s,selectedPack:x})]}),t[42]=l,t[43]=s,t[44]=p,t[45]=x,t[46]=_,t[47]=h,t[48]=G):G=t[48];let ee;t[49]!==F||t[50]!==_?(ee=_===`configure`&&!F?(0,Z.jsxs)(Y,{className:`mr-auto uppercase font-mono`,variant:`ghost`,onClick:V,children:[(0,Z.jsx)(Gi,{"aria-hidden":`true`,className:`h-4 w-4`}),`Back`]}):null,t[49]=F,t[50]=_,t[51]=ee):ee=t[51];let te;t[52]===r?te=t[53]:(te=()=>r(!1),t[52]=r,t[53]=te);let ne=s.kind===`already-seeded`||s.kind===`error`?`Close`:`Cancel`,re;t[54]!==te||t[55]!==ne?(re=(0,Z.jsx)(Y,{className:`uppercase font-mono`,variant:`ghost`,onClick:te,children:ne}),t[54]=te,t[55]=ne,t[56]=re):re=t[56];let ie;t[57]!==P||t[58]!==s.kind||t[59]!==_||t[60]!==A?(ie=_===`configure`&&s.kind===`plan`?(0,Z.jsx)(Y,{onClick:P,disabled:A,children:`Initialize`}):_===`configure`&&s.kind===`applying`?(0,Z.jsxs)(Y,{disabled:!0,children:[(0,Z.jsx)(tt,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin`}),`Setting up`]}):null,t[57]=P,t[58]=s.kind,t[59]=_,t[60]=A,t[61]=ie):ie=t[61];let ae;t[62]!==ee||t[63]!==re||t[64]!==ie?(ae=(0,Z.jsxs)(Ro,{children:[ee,re,ie]}),t[62]=ee,t[63]=re,t[64]=ie,t[65]=ae):ae=t[65];let oe;t[66]!==W||t[67]!==G||t[68]!==ae?(oe=(0,Z.jsxs)(Po,{className:`sm:max-w-3xl`,"data-ok-layer-spawned":``,children:[W,G,ae]}),t[66]=W,t[67]=G,t[68]=ae,t[69]=oe):oe=t[69];let se;return t[70]!==r||t[71]!==n||t[72]!==oe?(se=(0,Z.jsx)(Vo,{open:n,onOpenChange:r,children:oe}),t[70]=r,t[71]=n,t[72]=oe,t[73]=se):se=t[73],se}function Ym(e){return e.kind===`plan`||e.kind===`already-seeded`?e:{kind:`loading`}}function Xm(e){let t=(0,$.c)(20),{choice:n,subfolder:r,placeholder:i,onChoiceChange:a,onSubfolderChange:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:`Where should it live?`}),t[0]=s):s=t[0];let c;t[1]===a?c=t[2]:(c=e=>a(e),t[1]=a,t[2]=c);let l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(ro,{htmlFor:`seed-root-project-root`,children:(0,Z.jsxs)(co,{orientation:`horizontal`,children:[(0,Z.jsxs)(Ja,{children:[(0,Z.jsx)(lo,{children:`Project root`}),(0,Z.jsx)(La,{className:`text-1sm`,children:`Scaffold directly under this project.`})]}),(0,Z.jsx)(Km,{value:`project-root`,id:`seed-root-project-root`})]})}),t[3]=l):l=t[3];let u,d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(lo,{children:`In a subfolder`}),d=(0,Z.jsx)(La,{className:`nth-last-2:mt-0 text-1sm`,children:`Created if missing; reused if it exists.`}),t[4]=u,t[5]=d):(u=t[4],d=t[5]);let f;t[6]!==n||t[7]!==o||t[8]!==i||t[9]!==r?(f=n===`subfolder`&&(0,Z.jsx)(Wo,{value:r,onChange:e=>o(e.target.value),placeholder:i,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,className:`mt-1.5 font-mono text-xs bg-background`}),t[6]=n,t[7]=o,t[8]=i,t[9]=r,t[10]=f):f=t[10];let p;t[11]===f?p=t[12]:(p=(0,Z.jsxs)(Ja,{children:[u,d,f]}),t[11]=f,t[12]=p);let m;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(Km,{value:`subfolder`,id:`seed-root-subfolder`}),t[13]=m):m=t[13];let h;t[14]===p?h=t[15]:(h=(0,Z.jsx)(ro,{htmlFor:`seed-root-subfolder`,children:(0,Z.jsxs)(co,{orientation:`horizontal`,children:[p,m]})}),t[14]=p,t[15]=h);let g;return t[16]!==n||t[17]!==c||t[18]!==h?(g=(0,Z.jsxs)(`div`,{className:`space-y-2 py-1`,children:[s,(0,Z.jsxs)(Gm,{className:`sm:flex`,value:n,onValueChange:c,children:[l,h]})]}),t[16]=n,t[17]=c,t[18]=h,t[19]=g):g=t[19],g}function Zm(e){let t=(0,$.c)(12),{phase:n,selectedPack:r}=e;if(n.kind===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 py-4 text-sm text-muted-foreground`,children:[(0,Z.jsx)(tt,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin`}),`Computing scaffold plan`]}),t[0]=e):e=t[0],e}if(n.kind===`error`){let e;return t[1]===n.message?e=t[2]:(e=(0,Z.jsx)(`div`,{className:`rounded-md bg-destructive/10 p-3 text-sm text-destructive`,children:n.message}),t[1]=n.message,t[2]=e),e}if(n.kind===`already-seeded`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`div`,{className:`py-2 text-sm`,children:[(0,Z.jsx)(`p`,{className:`font-medium`,children:`This pack is already set up here.`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`The folders and templates are in place; there's nothing left to scaffold.`})]}),t[3]=e):e=t[3],e}let i;t[4]!==n.plan||t[5]!==r?(i=(0,Z.jsx)(jm,{plan:n.plan,selectedPack:r}),t[4]=n.plan,t[5]=r,t[6]=i):i=t[6];let a;t[7]===n.plan.warnings?a=t[8]:(a=n.plan.warnings.length>0?(0,Z.jsx)(`div`,{className:`rounded-md bg-warning/10 p-3 text-xs text-warning-foreground`,children:n.plan.warnings.map(Qm)}):null,t[7]=n.plan.warnings,t[8]=a);let o;return t[9]!==i||t[10]!==a?(o=(0,Z.jsxs)(`div`,{className:`space-y-6 py-1 text-sm`,children:[i,a]}),t[9]=i,t[10]=a,t[11]=o):o=t[11],o}function Qm(e){return(0,Z.jsx)(`p`,{children:e},e)}var $m=[{id:`claude-cowork`,displayName:`Claude Cowork`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,hasWebFallback:!0,tagline:`Conversational pairing in Claude Desktop's Cowork tab.`},{id:`claude-code`,displayName:`Claude`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,hasWebFallback:!0,tagline:`Agentic coding in Claude Desktop's Code tab.`},{id:`codex`,displayName:`Codex`,appBrandName:`Codex Desktop`,schemes:[`codex:`],installUrl:`https://openai.com/codex`,tagline:`OpenAI's coding agent, terminal-native.`},{id:`cursor`,displayName:`Cursor`,schemes:[`cursor:`],installUrl:`https://cursor.com/`,tagline:`AI-first VS Code fork with multi-file edits.`}],eh=$m.filter(e=>e.id!==`claude-cowork`),th=`#settings`;function nh(e){let t=e.target;return t?.tagName===`INPUT`||t?.tagName===`TEXTAREA`||t?.isContentEditable?!1:!!((e.metaKey||e.ctrlKey)&&!e.altKey&&e.key===`,`)}function rh(e){return e.replace(/^#/,``)===`settings`}function ih(){return typeof window>`u`?``:window.location.hash}function ah(){let e=(0,$.c)(4),[t,n]=(0,Q.useState)(sh),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=()=>{(0,Q.startTransition)(()=>{n(rh(ih()))})};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,Q.useEffect)(r,i);let a=oh,o;return e[2]===t?o=e[3]:(o={open:t,close:a},e[2]=t,e[3]=o),o}function oh(){typeof window>`u`||rh(ih())&&window.history.back()}function sh(){return rh(ih())}function ch(){let e=(0,$.c)(3),[t,n]=(0,Q.useState)(dh),r,i;return e[0]===t?(r=e[1],i=e[2]):(r=()=>{if(t!==null||window.okDesktop)return;let e=!0;return fetch(`/api/workspace`).then(async t=>{let r=await t.json().catch(uh);if(!e||!t.ok)return;let i=Ar.safeParse(r);i.success&&n({contentDir:i.data.contentDir,pathSeparator:i.data.pathSeparator})}).catch(lh),()=>{e=!1}},i=[t],e[0]=t,e[1]=r,e[2]=i),(0,Q.useEffect)(r,i),t}function lh(e){console.warn(`[useWorkspace] /api/workspace fetch failed:`,e)}function uh(){return null}function dh(){return fh()}function fh(e=typeof window>`u`?void 0:window){if(!e)return null;let t=e.okDesktop;return t?{contentDir:t.config.projectPath,pathSeparator:t.platform===`win32`?`\\`:`/`}:null}function ph(e){return{async install(t){let n;try{n=await e.buildAndOpen(t?.force?{force:!0}:void 0)}catch(e){return{ok:!1,reason:`bridge-error`,message:e instanceof Error?e.message:String(e)}}return n.ok?{ok:!0,path:n.path}:{ok:!1,reason:n.reason,message:n.message}}}}function mh(e={}){let t=e.fetch??globalThis.fetch,n=`${e.apiOrigin??``}/api/install-skill`;return{async install(e){let r;try{r=await t(n,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?.force?{force:!0}:{})})}catch(e){return{ok:!1,reason:`network-error`,message:e instanceof Error?e.message:String(e)}}if(!r.ok){let e=`HTTP ${r.status}`;try{let t=Fn(await r.json());t&&(e=t)}catch{}return{ok:!1,reason:`http-error`,message:e}}let i;try{i=await r.json()}catch(e){return{ok:!1,reason:`parse-error`,message:e instanceof Error?e.message:`Invalid server response`}}return!i||typeof i.status!=`string`?{ok:!1,reason:`parse-error`,message:`Invalid server response shape`}:i.status===`failed`?{ok:!1,reason:`build-failed`,message:i.buildError??`unknown build failure`}:{ok:!0,path:i.outputPath,handoffWarning:i.handoffError?.message}}}}function hh(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?ph(e):mh()}var gh=`ok:skill:cowork:installed`,_h=`1`,vh=250,yh=`/api/skill/install-state`;function bh(e){return`${gh}:v${e}`}var xh=new Map;async function Sh(e={},t={}){let n=t.force?`__force__`:`__default__`,r=xh.get(n);if(r)return r;let i=Ch(e,t);return xh.set(n,i),i.finally(()=>{xh.get(n)===i&&xh.delete(n)}),i}async function Ch(e,t){let n=e.installer===void 0?hh():e.installer,r=wh(e.storage),i=e.fetchSnapshot??Eh,a=e.serverTimeoutMs??vh,o=null;if(!t.force){try{o=await Dh(i(),a)}catch(e){console.warn(`[cowork-skill] server install-state check failed; falling through:`,e)}if(o){let e=o.targets[`claude-cowork`]??null;if(e&&e.version===o.currentVersion)return{kind:`already-installed`,source:`server`}}}let s=bh(o?.currentVersion??e.fallbackSkillVersion??Th());if(!t.force&&r?.getItem(s)===_h)return{kind:`already-installed`,source:`local`};if(!n)return{kind:`host-unsupported`};let c=await n.install({force:t.force??!1});if(!c.ok)return{kind:`install-failed`,reason:c.reason,message:c.message};try{r?.setItem(s,_h)}catch(e){console.warn(`[cowork-skill] storage.setItem failed (guard will not persist):`,e)}return{kind:`installed-now`,path:c.path,handoffWarning:c.handoffWarning}}function wh(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function Th(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function Eh(){let e;try{e=await fetch(yh,{method:`GET`,cache:`no-store`})}catch{return null}if(!e.ok)return null;try{let t=await e.json();return typeof t?.currentVersion==`string`?t:null}catch{return null}}async function Dh(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function Oh(e){return Sh({},e)}function kh(){return Sh({},{force:!0})}async function Ah(e,t){let n;try{n=await t(`/api/handoff`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}catch(e){return{ok:!1,reason:`dispatch-error`,detail:e instanceof Error?e.message:String(e)}}return n.status===200?{ok:!0}:n.status===404?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned 404`}:n.status===422?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned ${n.status}`}:{ok:!1,reason:`dispatch-error`,detail:`POST /api/handoff returned ${n.status}`}}async function jh(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return Ah({target:`claude-cowork`,url:Lr({mode:`cowork`},e)},n);case`claude-code`:return Ah({target:`claude-code`,url:Lr({mode:`code`},e)},n);case`codex`:return Ah({target:`codex`,url:zr(e)},n);case`cursor`:return Ah({target:`cursor`,url:ii(e),workspacePath:e.projectDir},n);default:{let t=e.target;return{ok:!1,reason:`invalid-payload`,detail:`unknown target: ${String(t)}`}}}}async function Mh(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.openExternal)try{return await n.shell.openExternal(e),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:Nh(e)}}let r=t.doc??(typeof document<`u`?document:void 0);if(!r)return{ok:!1,reason:`dispatch-error`,detail:`no DOM available`};try{let t=r.createElement(`a`);return t.href=e,t.rel=`noopener noreferrer`,/^https?:/i.test(e)&&(t.target=`_blank`),r.body.appendChild(t),t.click(),t.remove(),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:Nh(e)}}}function Nh(e){if(e instanceof Error)return e.message;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}async function Ph(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.recordHandoff)try{await n.shell.recordHandoff(e)}catch(e){(t.warn??(e=>console.warn(e)))(`[handoff] recordHandoff IPC rejected (telemetry skipped): ${e instanceof Error?e.message:String(e)}`)}}function Fh(e,t,n){let r=n===`\\`?t.replaceAll(`/`,`\\`):t;return`${e.endsWith(n)?e.slice(0,-1):e}${n}${r}`}function Ih(e){return`${e}.md`}function Lh(e){if(!e.docName||!e.workspace)return null;let t=Ih(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:{relativePath:t},projectDir:n,docPath:Fh(n,t,r)}}function Rh(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function zh(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function Bh(e){return Mh(e.installUrl).then(()=>void 0)}function Vh(e){return`Opened in ${e}.`}function Hh(e,t=1){return t>=3?`Couldn't reach ${e} — please try again later.`:t===2?`Still couldn't reach ${e} — try one more time?`:`Couldn't reach ${e} — try again?`}function Uh(e){return e>=3?null:e===2?`Try one more time`:`Retry`}function Wh(e,t,n,r){return t.ok?{target:e,host:n,outcome:`ok`,ts:r}:{target:e,host:n,outcome:`error`,ts:r,reason:t.reason}}function Gh(e){return e.docContext===null?e.folderRelativePath?vi(e.folderRelativePath):bi():jr(e.docContext.relativePath)}async function Kh(e,t,n,r=1){if(e===`claude-cowork`&&r===1){let e;try{e=await n.ensureCoworkSkillInstalled()}catch(e){let t=e instanceof Error?e.message:String(e);return n.toast.error(`Couldn't install Open Knowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-error: ${t}`}}if(e.kind===`installed-now`)return n.toast.success(`Open Knowledge skill saved. Upload it in Claude Desktop, then click Cowork again.`),{ok:!0};if(e.kind===`install-failed`){let t=e.message??e.reason;return n.toast.error(`Couldn't install Open Knowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-failed: ${t}`}}}let i={target:e,projectDir:t.projectDir,docPath:t.docPath,prompt:Gh(t)},a=await n.dispatchHandoff(i),o=Wh(e,a,n.isElectronHost()?`electron`:`web`,n.now().toISOString());await n.recordHandoff(o);let s=n.getDisplayName(e);if(a.ok)n.toast.success(Vh(s));else{let i=Uh(r),a=Hh(s,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{Kh(e,t,n,r+1)}}})}return a}function qh(e){return $m.find(t=>t.id===e)?.displayName??e}function Jh(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Yh(){return{dispatchHandoff:jh,recordHandoff:Ph,toast:{success:e=>{X.success(e)},error:(e,t)=>{X.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>Jh(),getDisplayName:qh,ensureCoworkSkillInstalled:Oh}}function Xh(){return{dispatch:(e,t)=>Kh(e,t,Yh()),reinstallCoworkSkill:kh}}var Zh=[...new Set($m.flatMap(e=>e.schemes))];function Qh(e,t){let n=t.now?.()??Date.now(),r={};for(let t of $m){let i=t.schemes[0],a=i===void 0?void 0:e[i];if(!a){r[t.id]={installed:null};continue}r[t.id]={installed:a.installed,...a.displayName===void 0?{}:{displayName:a.displayName},lastChecked:n}}return r}function $h(e){return Qh({},e)}async function eg(e){let t=e.schemes??Zh,n=await Promise.all(t.map(async t=>{let n=t.replace(/:$/,``);try{return[t,await e.detectProtocol(n)]}catch{return[t,{installed:!1}]}}));return Object.fromEntries(n)}var tg=Object.fromEntries(Zh.map(e=>[e,{installed:!1}]));async function ng(e){let t;try{t=await e.fetch(`/api/installed-agents`,{signal:e.signal,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return tg}if(!t.ok)return tg;let n;try{n=await t.json()}catch{return tg}if(typeof n!=`object`||!n||Array.isArray(n))return tg;let r=n,i={};for(let e of Zh)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function rg(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.installed!==i.installed||n.displayName!==i.displayName)return!1}return!0}function ig(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=$h({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=Qh(a,{isElectronHost:e.isElectronHost(),now:e.now})};return{probe:async()=>{if(n)return;if(i)return i;if(r!==null&&e.now()-r<t)return;let o=(async()=>{try{let t=await e.probe();if(n)return;let i=!rg(a,t);a=t,i&&(l(),c()),r=e.now()}catch{}finally{i=null}})();return i=o,o},getTargetStates:()=>o,subscribe:e=>(s.add(e),()=>{s.delete(e)}),cancel:()=>{n=!0,s.clear()}}}function ag(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function og(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>eg({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>ng({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function sg(){let e=(0,$.c)(5),[t,n]=(0,Q.useState)(cg),r=(0,Q.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=ig(og());r.current=e;let t=e.subscribe(n);e.probe();let i=()=>{e.probe()};return window.addEventListener(`focus`,i),()=>{window.removeEventListener(`focus`,i),t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,Q.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function cg(){return $h({isElectronHost:ag(),now:Date.now})}var lg=3e3,ug=(e,t,n)=>pl(e,t,n,`CommandPalette`);function dg(e){window.location.assign(kr(e))}function fg(e,t){return e?.kind===`folder`||e?.kind===`folder-index`?e.folderPath:_i(t)}function pg(e){let t=(0,$.c)(23),{entry:n,query:r,onSelect:i}=e,a=r===void 0?``:r,o=n.kind===`folder`?ve:E,s;t[0]===n?s=t[1]:(s=`title`in n&&n.title?n.title:n.path.split(`/`).pop()??n.path,t[0]=n,t[1]=s);let c=s,l=`snippet`in n?n.snippet:void 0,u=`${n.kind} ${n.path}`,d=`command-palette-nav-${n.kind}-${n.path}`,f;t[2]===o?f=t[3]:(f=(0,Z.jsx)(o,{className:`mt-0.5`}),t[2]=o,t[3]=f);let p;t[4]!==a||t[5]!==c?(p=(0,Z.jsx)(`span`,{className:`truncate font-medium`,children:(0,Z.jsx)(mg,{query:a,text:c})}),t[4]=a,t[5]=c,t[6]=p):p=t[6];let m;t[7]!==n.path||t[8]!==a?(m=(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,children:(0,Z.jsx)(mg,{query:a,text:n.path})}),t[7]=n.path,t[8]=a,t[9]=m):m=t[9];let h;t[10]!==a||t[11]!==l?(h=l?(0,Z.jsx)(`span`,{className:`max-h-10 overflow-hidden text-muted-foreground text-xs leading-relaxed`,children:(0,Z.jsx)(mg,{query:a,text:l})}):null,t[10]=a,t[11]=l,t[12]=h):h=t[12];let g;t[13]!==p||t[14]!==m||t[15]!==h?(g=(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[p,m,h]}),t[13]=p,t[14]=m,t[15]=h,t[16]=g):g=t[16];let _;return t[17]!==i||t[18]!==u||t[19]!==d||t[20]!==f||t[21]!==g?(_=(0,Z.jsxs)(D,{value:u,onSelect:i,"data-testid":d,className:`items-start`,children:[f,g]}),t[17]=i,t[18]=u,t[19]=d,t[20]=f,t[21]=g,t[22]=_):_=t[22],_}function mg(e){let t=(0,$.c)(5),{text:n,query:r}=e,i;t[0]!==r||t[1]!==n?(i=Zp(n,r).map(hg),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a;return t[3]===i?a=t[4]:(a=(0,Z.jsx)(Z.Fragment,{children:i}),t[3]=i,t[4]=a),a}function hg(e){let t=`${e.start}:${e.match?`match`:`plain`}`;return e.match?(0,Z.jsx)(`mark`,{className:`rounded-sm bg-primary/10 px-0.5 font-semibold text-primary`,children:e.text},t):(0,Z.jsx)(`span`,{children:e.text},t)}function gg({searchResults:e,fallbackSearchResults:t,searchStatus:n}){return e.length>0?e:n===`success`?[]:t}function _g(e){let t=(0,$.c)(136),{bridge:n,open:r,onOpenChange:i}=e,a=n===void 0?null:n,[o,s]=(0,Q.useState)(``),c=(0,Q.useDeferredValue)(o),l=c.trim(),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],t[0]=u):u=t[0];let[d,f]=(0,Q.useState)(u),[p,m]=(0,Q.useState)(`idle`),h;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(h=[],t[1]=h):h=t[1];let[g,_]=(0,Q.useState)(h),v;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(v=[],t[2]=v):v=t[2];let[y,b]=(0,Q.useState)(v),[x,S]=(0,Q.useState)(null),[C,w]=(0,Q.useState)(!1),T;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(T=[],t[3]=T):T=t[3];let[O,k]=(0,Q.useState)(T),[j,M]=(0,Q.useState)(`idle`),N;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(N=[],t[4]=N):N=t[4];let[P,F]=(0,Q.useState)(N),[I,L]=(0,Q.useState)(`idle`),R=(0,Q.useRef)(!1),B=(0,Q.useRef)(null),V=(0,Q.useRef)(null),{activeDocName:H,activeTarget:U}=ut(),{pages:W,pageTitles:G,pageMeta:ee,folderPaths:te}=Nr(),ne=ch(),{states:re,refresh:ie}=sg(),{dispatch:ae}=Xh(),oe=Lh({docName:H,workspace:ne}),se=Wp(W,te,G,ee),K=Ip(y,new Set(se.map(bg))),ce=a?.config.projectPath??null,le=a?g.filter(e=>e.path!==ce):[],ue;t[5]!==H||t[6]!==U?(ue=fg(U,H),t[5]=H,t[6]=U,t[7]=ue):ue=t[7];let q=ue,de=l===``?[]:Yp(se,l,8),fe,pe;t[8]!==i||t[9]!==r?(fe=()=>{let e=function(e){e.key===`k`&&(Ti()?e.metaKey:e.ctrlKey)&&(e.preventDefault(),i(!r))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},pe=[i,r],t[8]=i,t[9]=r,t[10]=fe,t[11]=pe):(fe=t[10],pe=t[11]),(0,Q.useEffect)(fe,pe);let me,he;t[12]!==a||t[13]!==r||t[14]!==ie?(me=()=>{if(r){if(b(Np()),ie(),a){let e=!1;return ug(async()=>{let t=await a.project.listRecent();e||_(t)},`Failed to load recent projects.`),()=>{e=!0}}return}s(``),k([]),M(`idle`),R.current=!1,F([]),L(`idle`)},he=[r,a,ie],t[12]=a,t[13]=r,t[14]=ie,t[15]=me,t[16]=he):(me=t[15],he=t[16]),(0,Q.useEffect)(me,he);let ge;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(ge=()=>{B.current&&(B.current.scrollTop=0)},t[17]=ge):ge=t[17];let _e;t[18]===o?_e=t[19]:(_e=[o],t[18]=o,t[19]=_e),(0,Q.useEffect)(ge,_e);let be=nm(c,new Set(O.map(yg))),Ce=be.kind!==`normal`,we,Ee;t[20]!==Ce||t[21]!==r?(we=()=>{if(!r||!Ce||R.current)return;R.current=!0,M(`loading`);let e=!1;return im().then(t=>{e||(k(t),M(`success`))}).catch(t=>{e||(console.error(`[command-palette-tag] fetch tags failed`,t),k([]),M(`error`))}),()=>{e=!0}},Ee=[r,Ce],t[20]=Ce,t[21]=r,t[22]=we,t[23]=Ee):(we=t[22],Ee=t[23]),(0,Q.useEffect)(we,Ee);let De=be.kind===`tag-docs`?be.tagName:null;(0,Q.useEffect)(()=>{if(!r||De===null){F([]),L(`idle`);return}L(`loading`),F([]);let e=!1;return am(De).then(t=>{e||(F(t),L(`success`))}).catch(t=>{e||(console.error(`[command-palette-tag] fetch tag docs failed`,t),F([]),L(`error`))}),()=>{e=!0}},[r,De]),(0,Q.useEffect)(()=>{if(!r||!l||Ce){f([]),m(`idle`);return}let e=new AbortController;m(`loading`);let t=!1,n=window.setTimeout(()=>{t=!0,e.abort(),f([]),m(`error`)},lg);return $p(l,{signal:e.signal}).then(e=>{window.clearTimeout(n),f(e),m(`success`)}).catch(e=>{window.clearTimeout(n),!(e instanceof Error&&e.name===`AbortError`&&!t)&&(f([]),m(`error`))}),()=>{window.clearTimeout(n),e.abort()}},[r,l,Ce]);let Oe;t[24]===i?Oe=t[25]:(Oe=(e,t)=>{let n=t===void 0?`Command failed.`:t;i(!1),ug(async()=>{await e()},n)},t[24]=i,t[25]=Oe);let ke=Oe,Ae;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=function(e){let t={kind:e.kind,path:e.path,lastOpenedAt:new Date().toISOString()},n=Fp(Np(),t);Pp(n),b(n)},t[26]=Ae):Ae=t[26];let je=Ae,Me;t[27]===i?Me=t[28]:(Me=function(e){i(!1),je(e),dg(e.path)},t[27]=i,t[28]=Me);let Ne=Me,Pe=!Ce&&l===``&&K.length>0,Fe=gg({searchResults:d,fallbackSearchResults:de,searchStatus:p}),J=!Ce&&Fe.length>0,Ie=!Ce&&l!==``&&p===`loading`&&!J,Le;t[29]!==c||t[30]!==Ce?(Le=!Ce&&em(`New file`,c,[`create file`]),t[29]=c,t[30]=Ce,t[31]=Le):Le=t[31];let Re=Le,ze;t[32]!==c||t[33]!==Ce?(ze=!Ce&&em(`New folder`,c,[`create folder`]),t[32]=c,t[33]=Ce,t[34]=ze):ze=t[34];let Be=ze,Ve;t[35]!==H||t[36]!==c||t[37]!==Ce?(Ve=!Ce&&H!==null&&em(`Open graph`,c,[`graph panel network`]),t[35]=H,t[36]=c,t[37]=Ce,t[38]=Ve):Ve=t[38];let He=Ve,Ue;t[39]!==c||t[40]!==Ce?(Ue=!Ce&&em(`Initialize starter pack`,c,[`scaffold`,`seed`,`pack`,`starter`]),t[39]=c,t[40]=Ce,t[41]=Ue):Ue=t[41];let We=Ue,Ge;t[42]!==a||t[43]!==c||t[44]!==Ce?(Ge=!Ce&&a!==null&&em(`Open folder on disk`,c,[`project`]),t[42]=a,t[43]=c,t[44]=Ce,t[45]=Ge):Ge=t[45];let Ke=Ge,qe;t[46]!==a||t[47]!==c||t[48]!==Ce?(qe=!Ce&&a!==null&&em(`Switch Project`,c,[`switch project navigator projects`]),t[46]=a,t[47]=c,t[48]=Ce,t[49]=qe):qe=t[49];let Je=qe,Ye;t[50]!==c||t[51]!==Ce?(Ye=!Ce&&em(`Settings`,c,[`preferences config`]),t[50]=c,t[51]=Ce,t[52]=Ye):Ye=t[52];let Xe=Ye,Ze;t[53]!==c||t[54]!==Ce?(Ze=!Ce&&em(`Install for Claude Chat & Cowork (Desktop App)`,c,[`claude desktop install cowork`]),t[53]=c,t[54]=Ce,t[55]=Ze):Ze=t[55];let Qe=Ze,$e=!Ce&&a!==null&&le.length>0&&(l===``||le.some(e=>em(`${e.name} ${e.path}`,c,[`open recent project`]))),et=!Ce&&oe!==null&&(l===``||eh.some(e=>em(`Open with AI ${e.displayName}`,c,[e.id,`agent handoff`,`open in`]))),tt=be.kind===`tag-list`?rm(O,be.query):[],nt=be.kind===`tag-list`&&j!==`loading`&&tt.length===0,rt=be.kind===`tag-docs`&&I===`success`&&P.length===0,it=Ce||Pe||J||Ie||Re||Be||He||We||Ke||Je||Xe||Qe||$e||et,at;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(at=function(e){s(`${tm}${e}`)},t[56]=at):at=t[56];let ot=at,st=Se,ct;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(ct={shouldFilter:!1,className:`[&_[cmdk-input-wrapper]_svg]:h-4 [&_[cmdk-input-wrapper]_svg]:w-4 [&_[cmdk-item]_svg]:h-4 [&_[cmdk-item]_svg]:w-4`},t[57]=ct):ct=t[57];let lt;t[58]===o?lt=t[59]:(lt=(0,Z.jsx)(Te,{ref:V,value:o,onValueChange:s,placeholder:`Search files, folders, or commands`}),t[58]=o,t[59]=lt);let dt;t[60]===Ce?dt=t[61]:(dt=()=>{s(Ce?``:tm),V.current?.focus()},t[60]=Ce,t[61]=dt);let ft=Ce?`border-primary/30 bg-primary/10 text-primary`:`border-border bg-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground`,pt;t[62]===ft?pt=t[63]:(pt=Di(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs font-medium transition-colors`,ft),t[62]=ft,t[63]=pt);let mt,ht;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(mt=(0,Z.jsx)(xe,{className:`size-3.5`}),ht=(0,Z.jsx)(`span`,{children:`By tag`}),t[64]=mt,t[65]=ht):(mt=t[64],ht=t[65]);let gt;t[66]!==Ce||t[67]!==dt||t[68]!==pt?(gt=(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-1.5 border-b px-3 py-2`,children:(0,Z.jsxs)(`button`,{type:`button`,onClick:dt,"data-testid":`command-palette-filter-tag`,"data-active":Ce,"aria-pressed":Ce,className:pt,children:[mt,ht]})}),t[66]=Ce,t[67]=dt,t[68]=pt,t[69]=gt):gt=t[69];let _t=z,vt;t[70]!==J||t[71]!==Ie?(vt=Ie&&!J?(0,Z.jsx)(A,{children:`Searching`}):null,t[70]=J,t[71]=Ie,t[72]=vt):vt=t[72];let yt=it?null:(0,Z.jsx)(A,{children:p===`error`?`Search failed.`:`No matching commands.`}),xt=be.kind===`tag-list`?(0,Z.jsxs)(ye,{heading:be.query?`Tags matching "${be.query}"`:`All tags`,children:[j===`loading`?(0,Z.jsx)(A,{children:`Loading tags`}):null,j===`error`?(0,Z.jsx)(A,{children:`Failed to load tags. Press Escape and re-open to retry.`}):null,nt?(0,Z.jsx)(A,{children:be.query?`No tags match "${be.query}".`:"No tags yet — author `#tagname` in any doc to populate the index."}):null,tt.map(e=>(0,Z.jsxs)(D,{value:`tag ${e.name}`,onSelect:()=>ot(e.name),"data-testid":`command-palette-tag-${e.name}`,children:[(0,Z.jsx)(xe,{}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:e.name}),(0,Z.jsxs)(`span`,{className:`ml-auto shrink-0 text-[11px] text-muted-foreground tabular-nums`,children:[e.count,` `,e.count===1?`doc`:`docs`]})]},`tag:${e.name}`))]}):null,St;t[73]!==i||t[74]!==be||t[75]!==rt||t[76]!==P||t[77]!==I?(St=be.kind===`tag-docs`?(0,Z.jsxs)(ye,{heading:`Docs tagged #${be.tagName}`,children:[I===`loading`?(0,Z.jsx)(A,{children:`Loading docs`}):null,I===`error`?(0,Z.jsx)(A,{children:`Failed to load docs. Press Escape and re-open to retry.`}):null,rt?(0,Z.jsx)(A,{children:`No docs registered under #${be.tagName}.`}):null,P.map(e=>{let t=e.title||e.docName.split(`/`).pop()||e.docName;return(0,Z.jsxs)(D,{value:`tag-doc ${e.docName}`,onSelect:()=>{i(!1),dg(e.docName)},"data-testid":`command-palette-tag-doc-${e.docName}`,className:`items-start`,children:[(0,Z.jsx)(E,{className:`mt-0.5`}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Z.jsx)(`span`,{className:`truncate font-medium`,children:t}),(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,children:e.docName}),e.matchingTags.length>0&&e.matchingTags.some(e=>e!==be.tagName)?(0,Z.jsxs)(`span`,{className:`truncate text-muted-foreground text-[11px]`,children:[`via`,` `,e.matchingTags.filter(e=>e!==be.tagName).map(vg).join(`, `)]}):null]})]},`tag-doc:${e.docName}`)})]}):null,t[73]=i,t[74]=be,t[75]=rt,t[76]=P,t[77]=I,t[78]=St):St=t[78];let Ct=Pe?(0,Z.jsx)(ye,{heading:`Recently opened`,children:K.map(e=>(0,Z.jsx)(pg,{entry:e,onSelect:()=>Ne(e)},Mp(e.kind,e.path)))}):null,wt;t[79]!==H||t[80]!==i||t[81]!==S||t[82]!==w||t[83]!==Re||t[84]!==Be||t[85]!==He||t[86]!==We?(wt=Re||Be||He||We?(0,Z.jsxs)(ye,{heading:`Commands`,children:[Re?(0,Z.jsxs)(D,{value:`new file create file`,onSelect:()=>{i(!1),S(`file`)},"data-testid":`command-palette-new-file`,children:[(0,Z.jsx)(mc,{}),(0,Z.jsx)(`span`,{children:`New file`})]}):null,Be?(0,Z.jsxs)(D,{value:`new folder create folder`,onSelect:()=>{i(!1),S(`folder`)},"data-testid":`command-palette-new-folder`,children:[(0,Z.jsx)(yc,{}),(0,Z.jsx)(`span`,{children:`New folder`})]}):null,He?(0,Z.jsxs)(D,{value:`open graph graph panel network`,onSelect:()=>{H&&(i(!1),lm(`graph`))},"data-testid":`command-palette-open-graph`,children:[(0,Z.jsx)(Mc,{}),(0,Z.jsx)(`span`,{children:`Open graph`})]}):null,We?(0,Z.jsxs)(D,{value:`initialize starter pack scaffold seed`,onSelect:()=>{i(!1),w(!0)},"data-testid":`command-palette-initialize-starter-pack`,children:[(0,Z.jsx)(Pc,{}),(0,Z.jsx)(`span`,{children:`Initialize starter pack`})]}):null]}):null,t[79]=H,t[80]=i,t[81]=S,t[82]=w,t[83]=Re,t[84]=Be,t[85]=He,t[86]=We,t[87]=wt):wt=t[87];let Tt=et?(0,Z.jsx)(ye,{heading:`Open with AI`,children:eh.filter(e=>em(`Open with AI ${e.displayName}`,c,[e.id,`agent handoff`,`open in`])).map(e=>{let t=re[e.id],n=t.installed===!0&&oe!==null,r=t.installed===null?`Detecting`:t.installed===!1?`Not installed`:null,a=r?`Open with AI ${e.displayName}, ${r}`:`Open with AI ${e.displayName}`;return(0,Z.jsxs)(D,{value:`send to ai ${e.displayName} ${e.id} agent open in`,disabled:!n,onSelect:()=>{!n||!oe||(i(!1),ae(e.id,oe))},"data-testid":`command-palette-open-in-${e.id}`,"aria-label":a,children:[(0,Z.jsxs)(`span`,{className:`flex-1`,children:[`Open with AI `,e.displayName]}),r?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-auto text-muted-foreground text-xs`,children:r}):null]},e.id)})}):null,Et;t[88]!==a||t[89]!==i||t[90]!==ke||t[91]!==Qe||t[92]!==Ke||t[93]!==Je||t[94]!==Xe?(Et=Ke||Je||Xe||Qe?(0,Z.jsxs)(ye,{heading:`Project`,children:[Ke&&a?(0,Z.jsxs)(D,{value:`open folder on disk project`,onSelect:()=>ke(async()=>{let e=await a.dialog.openFolder();e&&await a.project.open({path:e,target:`new-window`,entryPoint:`pick-existing`})}),"data-testid":`command-palette-open-folder`,children:[(0,Z.jsx)(ve,{}),(0,Z.jsx)(`span`,{children:`Open folder on disk`}),(0,Z.jsx)(bt,{children:`⌘O`})]}):null,Je&&a?(0,Z.jsxs)(D,{value:`switch-project navigator projects`,onSelect:()=>ke(()=>a.navigator.open(),`Failed to open Project Navigator.`),"data-testid":`command-palette-switch-project`,children:[(0,Z.jsx)(Tc,{}),(0,Z.jsx)(`span`,{children:`Switch Project`}),(0,Z.jsx)(bt,{children:`⌘⇧N`})]}):null,Xe?(0,Z.jsxs)(D,{value:`settings preferences config`,onSelect:()=>{i(!1),window.location.hash!==`#settings`&&(window.location.hash=th)},"data-testid":`command-palette-settings`,children:[(0,Z.jsx)(Jc,{}),(0,Z.jsx)(`span`,{children:`Settings`}),(0,Z.jsx)(bt,{children:`⌘,`})]}):null,Qe?(0,Z.jsxs)(D,{value:`install claude desktop cowork app`,onSelect:()=>{i(!1),window.location.hash=`#install-claude-desktop`},"data-testid":`command-palette-install-claude-desktop`,children:[(0,Z.jsx)(Xa,{}),(0,Z.jsx)(`span`,{children:`Install for Claude Chat & Cowork (Desktop App)`})]}):null]}):null,t[88]=a,t[89]=i,t[90]=ke,t[91]=Qe,t[92]=Ke,t[93]=Je,t[94]=Xe,t[95]=Et):Et=t[95];let Dt=$e&&a?(0,Z.jsx)(ye,{heading:`Open recent project`,children:le.filter(e=>em(`${e.name} ${e.path}`,c,[`open recent project`])).slice(0,10).map(e=>(0,Z.jsxs)(D,{value:`${e.name} ${e.path} recent project`,disabled:e.missing,onSelect:()=>ke(()=>a.project.open({path:e.path,target:`new-window`,entryPoint:`recents`}),`Failed to open project.`),"data-testid":`command-palette-recent-${e.path}`,className:`items-start`,children:[(0,Z.jsx)(Ot,{className:`mt-0.5`}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,Z.jsx)(`span`,{className:`truncate font-medium`,children:e.name}),(0,Z.jsxs)(`span`,{className:`truncate text-muted-foreground text-xs`,children:[e.path,e.missing?` (missing)`:``]})]})]},e.path))}):null,kt=J?(0,Z.jsx)(ye,{heading:`Search`,children:Fe.map(e=>(0,Z.jsx)(pg,{entry:e,query:l,onSelect:()=>Ne(e)},Mp(e.kind,e.path)))}):null,At;t[96]!==_t||t[97]!==vt||t[98]!==yt||t[99]!==xt||t[100]!==St||t[101]!==Ct||t[102]!==wt||t[103]!==Tt||t[104]!==Et||t[105]!==Dt||t[106]!==kt?(At=(0,Z.jsxs)(_t,{ref:B,className:`subtle-scrollbar`,children:[vt,yt,xt,St,Ct,wt,Tt,Et,Dt,kt]}),t[96]=_t,t[97]=vt,t[98]=yt,t[99]=xt,t[100]=St,t[101]=Ct,t[102]=wt,t[103]=Tt,t[104]=Et,t[105]=Dt,t[106]=kt,t[107]=At):At=t[107];let jt;t[108]!==st||t[109]!==i||t[110]!==r||t[111]!==ct||t[112]!==lt||t[113]!==gt||t[114]!==At?(jt=(0,Z.jsxs)(st,{open:r,onOpenChange:i,title:`Workspace Command Palette`,description:`Search files, folders, and commands for the current workspace.`,className:`sm:max-w-2xl`,commandProps:ct,children:[lt,gt,At]}),t[108]=st,t[109]=i,t[110]=r,t[111]=ct,t[112]=lt,t[113]=gt,t[114]=At,t[115]=jt):jt=t[115];let Mt=x===`file`,Nt;t[116]===S?Nt=t[117]:(Nt=e=>{e||S(null)},t[116]=S,t[117]=Nt);let Pt;t[118]!==q||t[119]!==Mt||t[120]!==Nt?(Pt=(0,Z.jsx)(xm,{open:Mt,onOpenChange:Nt,kind:`file`,initialDir:q}),t[118]=q,t[119]=Mt,t[120]=Nt,t[121]=Pt):Pt=t[121];let Ft=x===`folder`,It;t[122]===S?It=t[123]:(It=e=>{e||S(null)},t[122]=S,t[123]=It);let Lt;t[124]!==q||t[125]!==Ft||t[126]!==It?(Lt=(0,Z.jsx)(xm,{open:Ft,onOpenChange:It,kind:`folder`,initialDir:q}),t[124]=q,t[125]=Ft,t[126]=It,t[127]=Lt):Lt=t[127];let Rt;t[128]!==C||t[129]!==w?(Rt=(0,Z.jsx)(Jm,{open:C,onOpenChange:w}),t[128]=C,t[129]=w,t[130]=Rt):Rt=t[130];let zt;return t[131]!==jt||t[132]!==Pt||t[133]!==Lt||t[134]!==Rt?(zt=(0,Z.jsxs)(Z.Fragment,{children:[jt,Pt,Lt,Rt]}),t[131]=jt,t[132]=Pt,t[133]=Lt,t[134]=Rt,t[135]=zt):zt=t[135],zt}function vg(e){return`#${e}`}function yg(e){return e.name}function bg(e){return Mp(e.kind,e.path)}var xg=500;function Sg(e,t,n){return t?`terminal`:e===null&&n?`retrying`:`hidden`}function Cg(e){return e===null?`no response`:e.kind===`null-collab`?`ok ui responded but server.lock has no port yet`:e.code===`network`?"network error (is `ok ui` running?)":e.code===`invalid-body`?`/api/config returned a malformed body`:`/api/config returned HTTP ${e.code}`}function wg(){let e=(0,$.c)(16),{collabUrl:t,collabTerminal:n,collabLastError:r,retryCollab:i}=ut(),[a,o]=(0,Q.useState)(!1),s,c;e[0]!==n||e[1]!==t?(s=()=>{if(t!==null||n){o(!1);return}let e=setTimeout(()=>o(!0),xg);return()=>clearTimeout(e)},c=[t,n],e[0]=n,e[1]=t,e[2]=s,e[3]=c):(s=e[2],c=e[3]),(0,Q.useEffect)(s,c);let l=Sg(t,n,a);if(l===`hidden`)return null;if(l===`terminal`){let t;e[4]===r?t=e[5]:(t=Cg(r),e[4]=r,e[5]=t);let n;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`code`,{className:`bg-red-100/60 px-1 rounded`,children:`ok status`}),e[6]=n):n=e[6];let a;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(`code`,{className:`bg-red-100/60 px-1 rounded`,children:`.ok/local/last-spawn-error.log`}),e[7]=a):a=e[7];let o;e[8]===t?o=e[9]:(o=(0,Z.jsxs)(`span`,{children:[`Couldn't reach collab server — `,t,`. Try`,` `,n,` or check`,` `,a,`.`]}),e[8]=t,e[9]=o);let s;e[10]===i?s=e[11]:(s=(0,Z.jsx)(`button`,{type:`button`,onClick:i,className:`bg-red-950 text-red-50 px-2 py-0.5 rounded text-xs font-medium hover:bg-red-900`,children:`Retry`}),e[10]=i,e[11]=s);let c;return e[12]!==o||e[13]!==s?(c=(0,Z.jsxs)(`div`,{role:`alert`,"aria-live":`assertive`,className:`fixed top-0 inset-x-0 z-50 bg-red-500/95 text-red-950 text-sm text-center py-2 px-4 pl-[var(--ok-titlebar-reserve-left,1rem)] shadow-md flex items-center justify-center gap-3 flex-wrap`,children:[o,s]}),e[12]=o,e[13]=s,e[14]=c):c=e[14],c}let u;return e[15]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`fixed top-0 inset-x-0 z-50 bg-amber-500/95 text-amber-950 text-sm text-center py-2 px-4 pl-[var(--ok-titlebar-reserve-left,1rem)] shadow-md`,children:`Connecting — waiting for collab server`}),e[15]=u):u=e[15],u}async function Tg(e){let t=await fetch(`/api/tags/${encodeURIComponent(e)}`);if(!t.ok){let e=await t.json().catch(()=>null);throw Error(Fn(e)??`Server error: ${t.status} ${t.statusText}`)}return(await t.json()).docs??[]}function Eg(){let e=(0,$.c)(15),[t,n]=(0,Q.useState)(!1),[r,i]=(0,Q.useState)(null),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={kind:`idle`},e[0]=a):a=e[0];let[o,s]=(0,Q.useState)(a),c=(0,Q.useRef)(0),l,u;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{let e=function(e){let t=e.detail;if(!t||typeof t.value!=`string`)return;let r=c.current+=1;i(t.value),n(!0),s({kind:`loading`}),Tg(t.value).then(e=>{c.current===r&&s({kind:`ready`,docs:e})}).catch(e=>{c.current===r&&s({kind:`error`,message:e instanceof Error?e.message:String(e)})})};return document.addEventListener(st,e),()=>document.removeEventListener(st,e)},u=[],e[1]=l,e[2]=u):(l=e[1],u=e[2]),(0,Q.useEffect)(l,u);let d;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=function(e){n(!1),window.location.assign(kr(e))},e[3]=d):d=e[3];let f=d,p=r??``,m;e[4]===p?m=e[5]:(m=(0,Z.jsx)(Bo,{children:(0,Z.jsxs)(Ao,{children:[`Documents tagged `,(0,Z.jsxs)(`span`,{className:`font-mono`,children:[`#`,p]})]})}),e[4]=p,e[5]=m);let h=r??``,g;e[6]!==o||e[7]!==h?(g=(0,Z.jsx)(Lo,{children:(0,Z.jsx)(Dg,{fetchState:o,tag:h,onSelectDoc:f})}),e[6]=o,e[7]=h,e[8]=g):g=e[8];let _;e[9]!==m||e[10]!==g?(_=(0,Z.jsxs)(Po,{children:[m,g]}),e[9]=m,e[10]=g,e[11]=_):_=e[11];let v;return e[12]!==t||e[13]!==_?(v=(0,Z.jsx)(Vo,{open:t,onOpenChange:n,children:_}),e[12]=t,e[13]=_,e[14]=v):v=e[14],v}function Dg(e){let t=(0,$.c)(12),{fetchState:n,tag:r,onSelectDoc:i}=e;if(n.kind===`idle`||n.kind===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`tag-dialog-loading`,children:`Loading`}),t[0]=e):e=t[0],e}if(n.kind===`error`){let e;return t[1]===n.message?e=t[2]:(e=(0,Z.jsx)(`p`,{className:`text-destructive text-sm`,"data-testid":`tag-dialog-error`,children:n.message}),t[1]=n.message,t[2]=e),e}if(n.docs.length===0){let e;return t[3]===r?e=t[4]:(e=(0,Z.jsxs)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`tag-dialog-empty`,children:[`Only the current document uses `,(0,Z.jsxs)(`span`,{className:`font-mono`,children:[`#`,r]}),`.`]}),t[3]=r,t[4]=e),e}let a;if(t[5]!==n.docs||t[6]!==i){let e;t[8]===i?e=t[9]:(e=e=>{let t=e.matchingTags??[];return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,className:`w-full rounded-md px-2 py-1.5 text-left text-sm hover:bg-muted focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring`,onClick:()=>i(e.docName),"data-testid":`tag-dialog-row`,children:[(0,Z.jsx)(`span`,{className:`block truncate font-medium`,children:e.title}),e.docName===e.title?null:(0,Z.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:e.docName}),t.length>0?(0,Z.jsx)(`span`,{className:`mt-1 flex flex-wrap items-center gap-1`,"data-testid":`tag-dialog-row-matches`,children:t.map(Og)}):null]})},e.docName)},t[8]=i,t[9]=e),a=n.docs.map(e),t[5]=n.docs,t[6]=i,t[7]=a}else a=t[7];let o;return t[10]===a?o=t[11]:(o=(0,Z.jsx)(`ul`,{className:`flex flex-col gap-1`,"data-testid":`tag-dialog-list`,children:a}),t[10]=a,t[11]=o),o}function Og(e){return(0,Z.jsxs)(`span`,{"data-testid":`tag-dialog-row-match`,"data-tag":e,className:`tag pointer-events-none text-xs`,children:[`#`,e]},e)}var kg=`raw-mdx-nav`,Ag=`ok-editor-mode-v1`,jg=[`wysiwyg`,`source`],Mg=`wysiwyg`;function Ng(e){return jg.includes(e)}function Pg(e=localStorage){try{let t=e.getItem(Ag);if(t===null)return Mg;if(Ng(t))return t;console.warn(`[editor-mode] invalid persisted value, falling back to default`,{raw:t})}catch{}return Mg}function Fg(e=window,t=localStorage){let n=e.__OK_EDITOR_MODE__;return Ng(n)?n:Pg(t)}function Ig(e,t=localStorage){try{return t.setItem(Ag,e),!0}catch(e){return console.warn(`[editor-mode] persist failed`,e),!1}}function Lg(){let e=(0,$.c)(3),[t,n]=(0,Q.useState)(Fg),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=function(e){n(e),Ig(e)},e[0]=r):r=e[0];let i=r,a;return e[1]===t?a=e[2]:(a=[t,i],e[1]=t,e[2]=a),a}function Rg(e){let t=(0,$.c)(22),{open:n,onResolved:r}=e,i=Sa(),a;t[0]!==r||t[1]!==i?(a=function(e){if(i===null){X.error(`Sync settings not yet loaded — try again in a moment`);return}let t=i(e);if(!t.ok){X.error(`Could not ${e?`enable sync`:`save sync preference`}: ${t.error}`);return}r()},t[0]=r,t[1]=i,t[2]=a):a=t[2];let o=a,s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(Bo,{children:(0,Z.jsx)($i,{})}),t[3]=s):s=t[3];let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(Ha,{}),t[4]=c):c=t[4];let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsxs)(Lo,{children:[c,(0,Z.jsxs)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:[`You can turn this on later in `,(0,Z.jsx)(`span`,{className:`font-medium`,children:`Settings → Sync`}),`.`]})]}),t[5]=l):l=t[5];let u;t[6]===o?u=t[7]:(u=()=>o(!1),t[6]=o,t[7]=u);let d=i===null,f;t[8]!==u||t[9]!==d?(f=(0,Z.jsx)(Y,{variant:`ghost`,className:`uppercase font-mono`,onClick:u,disabled:d,children:`Keep disabled`}),t[8]=u,t[9]=d,t[10]=f):f=t[10];let p;t[11]===o?p=t[12]:(p=()=>o(!0),t[11]=o,t[12]=p);let m=i===null,h;t[13]!==p||t[14]!==m?(h=(0,Z.jsx)(Y,{onClick:p,disabled:m,children:`Enable auto-sync`}),t[13]=p,t[14]=m,t[15]=h):h=t[15];let g;t[16]!==h||t[17]!==f?(g=(0,Z.jsxs)(Po,{className:`sm:max-w-lg`,showCloseButton:!1,children:[s,l,(0,Z.jsxs)(Ro,{children:[f,h]})]}),t[16]=h,t[17]=f,t[18]=g):g=t[18];let _;return t[19]!==n||t[20]!==g?(_=(0,Z.jsx)(Vo,{open:n,onOpenChange:zg,children:g}),t[19]=n,t[20]=g,t[21]=_):_=t[21],_}function zg(){}function Bg(e){let t=(0,$.c)(9),{onOpenResolver:n}=e,r=fo();if(!r||r.state!==`conflict`)return null;let i=r.conflictCount,a=i>0?`${i} page${i===1?``:`s`}`:`Some pages`,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(Ir,{className:`size-4 shrink-0`}),t[0]=o):o=t[0];let s=i===1?`has`:`have`,c;t[1]!==a||t[2]!==s?(c=(0,Z.jsxs)(`span`,{className:`flex-1`,children:[a,` `,s,` conflicting changes.`]}),t[1]=a,t[2]=s,t[3]=c):c=t[3];let l;t[4]===n?l=t[5]:(l=(0,Z.jsx)(Y,{variant:`outline`,size:`xs`,className:`shrink-0 border-amber-400 dark:border-amber-700 text-amber-800 dark:text-amber-300 hover:bg-amber-100 dark:hover:bg-amber-900/50`,onClick:n,children:`Review and resolve`}),t[4]=n,t[5]=l);let u;return t[6]!==c||t[7]!==l?(u=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-sm border-b bg-amber-50 dark:bg-amber-950/30 text-amber-800 dark:text-amber-300 shrink-0`,children:[o,c,l]}),t[6]=c,t[7]=l,t[8]=u):u=t[8],u}var Vg=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}offset(t,n=t){return new e(this.fromA+t,this.toA+t,this.fromB+n,this.toB+n)}};function Hg(e,t,n,r,i,a){if(e==r)return[];let o=Qg(e,t,n,r,i,a),s=$g(e,t+o,n,r,i+o,a);t+=o,n-=s,i+=o,a-=s;let c=n-t,l=a-i;if(!c||!l)return[new Vg(t,n,i,a)];if(c>l){let o=e.slice(t,n).indexOf(r.slice(i,a));if(o>-1)return[new Vg(t,t+o,i,i),new Vg(t+o+l,n,a,a)]}else if(l>c){let o=r.slice(i,a).indexOf(e.slice(t,n));if(o>-1)return[new Vg(t,t,i,i+o),new Vg(n,n,i+o+c,a)]}if(c==1||l==1)return[new Vg(t,n,i,a)];let u=t_(e,t,n,r,i,a);if(u){let[o,s,c]=u;return Hg(e,t,o,r,i,s).concat(Hg(e,o+c,n,r,s+c,a))}return Kg(e,t,n,r,i,a)}var Ug=1e9,Wg=0,Gg=!1;function Kg(e,t,n,r,i,a){let o=n-t,s=a-i;if(Ug<1e9&&Math.min(o,s)>Ug*16||Wg>0&&Date.now()>Wg)return Math.min(o,s)>Ug*64?[new Vg(t,n,i,a)]:n_(e,t,n,r,i,a);let c=Math.ceil((o+s)/2);Jg.reset(c),Yg.reset(c);let l=(n,a)=>e.charCodeAt(t+n)==r.charCodeAt(i+a),u=(t,i)=>e.charCodeAt(n-t-1)==r.charCodeAt(a-i-1),d=(o-s)%2==0?null:Yg,f=d?null:Jg;for(let p=0;p<c;p++){if(p>Ug||Wg>0&&!(p&63)&&Date.now()>Wg)return n_(e,t,n,r,i,a);let m=Jg.advance(p,o,s,c,d,!1,l)||Yg.advance(p,o,s,c,f,!0,u);if(m)return Xg(e,t,n,t+m[0],r,i,a,i+m[1])}return[new Vg(t,n,i,a)]}var qg=class{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let e=0;e<this.len;e++)this.vec[e]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,t,n,r,i,a,o){for(let s=-e+this.start;s<=e-this.end;s+=2){let c=r+s,l=s==-e||s!=e&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,u=l-s;for(;l<t&&u<n&&o(l,u);)l++,u++;if(this.vec[c]=l,l>t)this.end+=2;else if(u>n)this.start+=2;else if(i){let e=r+(t-n)-s;if(e>=0&&e<this.len&&i.vec[e]!=-1)if(a){let n=i.vec[e];if(n>=t-l)return[n,r+n-e]}else{let n=t-i.vec[e];if(l>=n)return[l,u]}}}return null}},Jg=new qg,Yg=new qg;function Xg(e,t,n,r,i,a,o,s){let c=!1;return!__(e,r)&&++r==n&&(c=!0),!__(i,s)&&++s==o&&(c=!0),c?[new Vg(t,n,a,o)]:Hg(e,t,r,i,a,s).concat(Hg(e,r,n,i,s,o))}function Zg(e,t){let n=1,r=Math.min(e,t);for(;n<r;)n<<=1;return n}function Qg(e,t,n,r,i,a){if(t==n||t==a||e.charCodeAt(t)!=r.charCodeAt(i))return 0;let o=Zg(n-t,a-i);for(let s=t,c=i;;){let i=s+o,l=c+o;if(i>n||l>a||e.slice(s,i)!=r.slice(c,l)){if(o==1)return s-t-+!__(e,s);o>>=1}else if(i==n||l==a)return i-t;else s=i,c=l}}function $g(e,t,n,r,i,a){if(t==n||i==a||e.charCodeAt(n-1)!=r.charCodeAt(a-1))return 0;let o=Zg(n-t,a-i);for(let s=n,c=a;;){let a=s-o,l=c-o;if(a<t||l<i||e.slice(a,s)!=r.slice(l,c)){if(o==1)return n-s-+!__(e,s);o>>=1}else if(a==t||l==i)return n-a;else s=a,c=l}}function e_(e,t,n,r,i,a,o,s){let c=r.slice(i,a),l=null;for(;;){if(l||o<s)return l;for(let s=t+o;;){__(e,s)||s++;let u=s+o;if(__(e,u)||(u+=u==s+1?1:-1),u>=n)break;let d=e.slice(s,u),f=-1;for(;(f=c.indexOf(d,f+1))!=-1;){let o=Qg(e,u,n,r,i+f+d.length,a),c=$g(e,t,s,r,i,i+f),p=d.length+o+c;(!l||l[2]<p)&&(l=[s-c,i+f-c,p])}s=u}if(s<0)return l;o>>=1}}function t_(e,t,n,r,i,a){let o=n-t,s=a-i;if(o<s){let o=t_(r,i,a,e,t,n);return o&&[o[1],o[0],o[2]]}return o<4||s*2<o?null:e_(e,t,n,r,i,a,Math.floor(o/4),-1)}function n_(e,t,n,r,i,a){Gg=!0;let o=n-t,s=a-i,c;if(o<s){let s=e_(r,i,a,e,t,n,Math.floor(o/6),50);c=s&&[s[1],s[0],s[2]]}else c=e_(e,t,n,r,i,a,Math.floor(s/6),50);if(!c)return[new Vg(t,n,i,a)];let[l,u,d]=c;return Hg(e,t,l,r,i,u).concat(Hg(e,l+d,n,r,u+d,a))}function r_(e,t){for(let n=1;n<e.length;n++){let r=e[n-1],i=e[n];r.toA>i.fromA-t&&r.toB>i.fromB-t&&(e[n-1]=new Vg(r.fromA,i.toA,r.fromB,i.toB),e.splice(n--,1))}}function i_(e,t,n){for(;;){r_(n,1);let r=!1;for(let i=0;i<n.length;i++){let a=n[i],o,s;(o=Qg(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[i]=new Vg(a.fromA+o,a.toA,a.fromB+o,a.toB)),(s=$g(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[i]=new Vg(a.fromA,a.toA-s,a.fromB,a.toB-s));let c=a.toA-a.fromA,l=a.toB-a.fromB;if(c&&l)continue;let u=a.fromA-(i?n[i-1].toA:0),d=(i<n.length-1?n[i+1].fromA:e.length)-a.toA;if(!u||!d)continue;let f=c?e.slice(a.fromA,a.toA):t.slice(a.fromB,a.toB);u<=f.length&&e.slice(a.fromA-u,a.fromA)==f.slice(f.length-u)?(n[i]=new Vg(a.fromA-u,a.toA-u,a.fromB-u,a.toB-u),r=!0):d<=f.length&&e.slice(a.toA,a.toA+d)==f.slice(0,d)&&(n[i]=new Vg(a.fromA+d,a.toA+d,a.fromB+d,a.toB+d),r=!0)}if(!r)break}return n}function a_(e,t,n){for(let r=0,i=0;i<e.length;i++){let a=e[i],o=a.toA-a.fromA,s=a.toB-a.fromB;if(o&&s||o>3||s>3){let c=i==e.length-1?t.length:e[i+1].fromA,l=a.fromA-r,u=c-a.toA,d=f_(t,a.fromA,l),f=d_(t,a.toA,u),p=a.fromA-d,m=f-a.toA;if((!o||!s)&&p&&m){let l=Math.max(o,s),[u,h,g]=o?[t,a.fromA,a.toA]:[n,a.fromB,a.toB];l>p&&t.slice(d,a.fromA)==u.slice(g-p,g)?(a=e[i]=new Vg(d,d+o,a.fromB-p,a.toB-p),d=a.fromA,f=d_(t,a.toA,c-a.toA)):l>m&&t.slice(a.toA,f)==u.slice(h,h+m)&&(a=e[i]=new Vg(f-o,f,a.fromB+m,a.toB+m),f=a.toA,d=f_(t,a.fromA,a.fromA-r)),p=a.fromA-d,m=f-a.toA}if(p||m)a=e[i]=new Vg(a.fromA-p,a.toA+m,a.fromB-p,a.toB+m);else if(!o){let t=m_(n,a.fromB,a.toB),r,o=t<0?-1:p_(n,a.toB,a.fromB);t>-1&&(r=t-a.fromB)<=u&&n.slice(a.fromB,t)==n.slice(a.toB,a.toB+r)?a=e[i]=a.offset(r):o>-1&&(r=a.toB-o)<=l&&n.slice(a.fromB-r,a.fromB)==n.slice(o,a.toB)&&(a=e[i]=a.offset(-r))}else if(!s){let n=m_(t,a.fromA,a.toA),r,o=n<0?-1:p_(t,a.toA,a.fromA);n>-1&&(r=n-a.fromA)<=u&&t.slice(a.fromA,n)==t.slice(a.toA,a.toA+r)?a=e[i]=a.offset(r):o>-1&&(r=a.toA-o)<=l&&t.slice(a.fromA-r,a.fromA)==t.slice(o,a.toA)&&(a=e[i]=a.offset(-r))}}r=a.toA}return r_(e,3),e}var o_;try{o_=RegExp(`[\\p{Alphabetic}\\p{Number}]`,`u`)}catch{}function s_(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function c_(e,t){if(t==e.length)return 0;let n=e.charCodeAt(t);return n<192?+!!s_(n):o_?!h_(n)||t==e.length-1?+!!o_.test(String.fromCharCode(n)):o_.test(e.slice(t,t+2))?2:0:0}function l_(e,t){if(!t)return 0;let n=e.charCodeAt(t-1);return n<192?+!!s_(n):o_?!g_(n)||t==1?+!!o_.test(String.fromCharCode(n)):o_.test(e.slice(t-2,t))?2:0:0}var u_=8;function d_(e,t,n){if(t==e.length||!l_(e,t))return t;for(let r=t,i=t+n,a=0;a<u_;a++){let t=c_(e,r);if(!t||r+t>i)return r;r+=t}return t}function f_(e,t,n){if(!t||!c_(e,t))return t;for(let r=t,i=t-n,a=0;a<u_;a++){let t=l_(e,r);if(!t||r-t<i)return r;r-=t}return t}function p_(e,t,n){for(;t!=n;t--)if(e.charCodeAt(t-1)==10)return t;return-1}function m_(e,t,n){for(;t!=n;t++)if(e.charCodeAt(t)==10)return t;return-1}var h_=e=>e>=55296&&e<=56319,g_=e=>e>=56320&&e<=57343;function __(e,t){return!t||t==e.length||!h_(e.charCodeAt(t-1))||!g_(e.charCodeAt(t))}function v_(e,t,n){let r=n?.override;return r?r(e,t):(Ug=(n?.scanLimit??1e9)>>1,Wg=n?.timeout?Date.now()+n.timeout:0,Gg=!1,i_(e,t,Hg(e,0,e.length,t,0,t.length)))}function y_(){return!Gg}function b_(e,t,n){return a_(v_(e,t,n),e,t)}var x_=hs.define({combine:e=>e[0]}),S_=gs.define(),C_=hs.define(),w_=us.define({create(e){return null},update(e,t){for(let n of t.effects)n.is(S_)&&(e=n.value);for(let n of t.state.facet(C_))e=n(e,t);return e}});function T_(e){let t=e.field(w_,!1);if(!t)return null;let n=e.facet(x_);return{chunks:t,side:n?n.side:null}}var E_=class e{constructor(e,t,n,r,i,a=!0){this.changes=e,this.fromA=t,this.toA=n,this.fromB=r,this.toB=i,this.precise=a}offset(t,n){return t||n?new e(this.changes,this.fromA+t,this.toA+t,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,t,n){return k_(b_(e.toString(),t.toString(),n),e,t,0,0,y_())}static updateA(e,t,n,r,i){return N_(M_(e,r,!0,n.length),e,t,n,i)}static updateB(e,t,n,r,i){return N_(M_(e,r,!1,t.length),e,t,n,i)}};function D_(e,t,n,r){let i=n.lineAt(e),a=r.lineAt(t);return i.to==e&&a.to==t&&e<n.length&&t<r.length?[e+1,t+1]:[i.from,a.from]}function O_(e,t,n,r){let i=n.lineAt(e),a=r.lineAt(t);return i.from==e&&a.from==t?[e,t]:[i.to+1,a.to+1]}function k_(e,t,n,r,i,a){let o=[];for(let s=0;s<e.length;s++){let c=e[s],[l,u]=D_(c.fromA+r,c.fromB+i,t,n),[d,f]=O_(c.toA+r,c.toB+i,t,n),p=[c.offset(-l+r,-u+i)];for(;s<e.length-1;){let a=e[s+1],[o,c]=D_(a.fromA+r,a.fromB+i,t,n);if(o>d+1&&c>f+1)break;p.push(a.offset(-l+r,-u+i)),[d,f]=O_(a.toA+r,a.toB+i,t,n),s++}o.push(new E_(p,l,Math.max(l,d),u,Math.max(u,f),a))}return o}var A_=1e3;function j_(e,t,n,r){let i=0,a=e.length;for(;;){if(i==a){let r=0,a=0;i&&({toA:r,toB:a}=e[i-1]);let o=t-(n?r:a);return[r+o,a+o]}let o=i+a>>1,s=e[o],[c,l]=n?[s.fromA,s.toA]:[s.fromB,s.toB];if(c>t)a=o;else if(l<=t)i=o+1;else return r?[s.fromA,s.fromB]:[s.toA,s.toB]}}function M_(e,t,n,r){let i=[];return t.iterChangedRanges((a,o,s,c)=>{let l=0,u=n?t.length:r,d=0,f=n?r:t.length;a>A_&&([l,d]=j_(e,a-A_,n,!0)),o<t.length-A_&&([u,f]=j_(e,o+A_,n,!1));let p=c-s-(o-a),m,[h,g]=n?[p,0]:[0,p];i.length&&(m=i[i.length-1]).toA>=l?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:u,toB:f,diffA:m.diffA+h,diffB:m.diffB+g}:i.push({fromA:l,toA:u,fromB:d,toB:f,diffA:h,diffB:g})}),i}function N_(e,t,n,r,i){if(!e.length)return t;let a=[];for(let o=0,s=0,c=0,l=0;;o++){let u=o==e.length?null:e[o],d=u?u.fromA+s:n.length,f=u?u.fromB+c:r.length;for(;l<t.length;){let e=t[l];if(u&&(e.toA+s>d||e.toB+c>f))break;a.push(e.offset(s,c)),l++}if(!u)break;let p=u.toA+s+u.diffA,m=u.toB+c+u.diffB,h=b_(n.sliceString(d,p),r.sliceString(f,m),i);for(let e of k_(h,n,r,d,f,y_()))a.push(e);for(s+=u.diffA,c+=u.diffB;l<t.length;){let e=t[l];if(e.fromA+s>p&&e.fromB+c>m)break;l++}}return a}var P_={scanLimit:500},F_=_s.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=G_(e))}update(e){(e.docChanged||e.viewportChanged||L_(e.startState,e.state)||R_(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=G_(e.view))}},{decorations:e=>e.deco}),I_=ss.low(xs({class:`cm-changeGutter`,markers:e=>e.plugin(F_)?.gutter||ws.empty}));function L_(e,t){return e.field(w_,!1)!=t.field(w_,!1)}function R_(e,t){return e.facet(x_)!=t.facet(x_)}var z_=ps.line({class:`cm-changedLine`}),B_=ps.mark({class:`cm-changedText`}),V_=ps.mark({tagName:`ins`,class:`cm-insertedLine`}),H_=ps.mark({tagName:`del`,class:`cm-deletedLine`}),U_=new class extends bs{constructor(){super(...arguments),this.elementClass=`cm-changedLineGutter`}};function W_(e,t,n,r,i,a){let o=n?e.fromA:e.fromB,s=n?e.toA:e.toB,c=0;if(o!=s){i.add(o,o,z_),i.add(o,s,n?H_:V_),a&&a.add(o,o,U_);for(let l=t.iterRange(o,s-1),u=o;!l.next().done;){if(l.lineBreak){u++,i.add(u,u,z_),a&&a.add(u,u,U_);continue}let t=u+l.value.length;if(r)for(;c<e.changes.length;){let r=e.changes[c],a=o+(n?r.fromA:r.fromB),s=o+(n?r.toA:r.toB),l=Math.max(u,a),d=Math.min(t,s);if(l<d&&i.add(l,d,B_),s<t)c++;else break}u=t}}}function G_(e){let t=e.state.field(w_),{side:n,highlightChanges:r,markGutter:i,overrideChunk:a}=e.state.facet(x_),o=n==`a`,s=new ms,c=i?new ms:null,{from:l,to:u}=e.viewport;for(let n of t){if((o?n.fromA:n.fromB)>=u)break;(o?n.toA:n.toB)>l&&(!a||!a(e.state,n,s,c))&&W_(n,e.state.doc,o,r,s,c)}return{deco:s.finish(),gutter:c&&c.finish()}}var K_=class extends os{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement(`div`);return e.className=`cm-mergeSpacer`,e.style.height=this.height+`px`,e}updateDOM(e){return e.style.height=this.height+`px`,!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}},q_=gs.define({map:(e,t)=>e.map(t)}),J_=us.define({create:()=>ps.none,update:(e,t)=>{for(let e of t.effects)if(e.is(q_))return e.value;return e.map(t.changes)},provide:e=>ys.decorations.from(e)}),Y_=.01;function X_(e,t){if(e.size!=t.size)return!1;let n=e.iter(),r=t.iter();for(;n.value;){if(n.from!=r.from||Math.abs(n.value.spec.widget.height-r.value.spec.widget.height)>1)return!1;n.next(),r.next()}return!0}function Z_(e,t,n){let r=new ms,i=new ms,a=e.state.field(J_).iter(),o=t.state.field(J_).iter(),s=0,c=0,l=0,u=0,d=e.viewport,f=t.viewport;for(let p=0;;p++){let m=p<n.length?n[p]:null,h=m?m.fromA:e.state.doc.length,g=m?m.fromB:t.state.doc.length;if(s<h){let n=e.lineBlockAt(s).top+l-(t.lineBlockAt(c).top+u);n<-Y_?(l-=n,r.add(s,s,ps.widget({widget:new K_(-n),block:!0,side:-1}))):n>Y_&&(u+=n,i.add(c,c,ps.widget({widget:new K_(n),block:!0,side:-1})))}if(h>s+1e3&&s<d.from&&h>d.from&&c<f.from&&g>f.from){let e=Math.min(d.from-s,f.from-c);s+=e,c+=e,p--}else if(m)s=m.toA,c=m.toB;else break;for(;a.value&&a.from<s;)l-=a.value.spec.widget.height,a.next();for(;o.value&&o.from<c;)u-=o.value.spec.widget.height,o.next()}for(;a.value;)l-=a.value.spec.widget.height,a.next();for(;o.value;)u-=o.value.spec.widget.height,o.next();let p=e.contentHeight+l-(t.contentHeight+u);p<Y_?r.add(e.state.doc.length,e.state.doc.length,ps.widget({widget:new K_(-p),block:!0,side:1})):p>Y_&&i.add(t.state.doc.length,t.state.doc.length,ps.widget({widget:new K_(p),block:!0,side:1}));let m=r.finish(),h=i.finish();X_(m,e.state.field(J_))||e.dispatch({effects:q_.of(m)}),X_(h,t.state.field(J_))||t.dispatch({effects:q_.of(h)})}var Q_=gs.define({map:(e,t)=>t.mapPos(e)}),$_=class extends os{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let t=document.createElement(`div`);return t.className=`cm-collapsedLines`,t.textContent=e.state.phrase(`$ unchanged lines`,this.lines),t.addEventListener(`click`,t=>{let n=e.posAtDOM(t.target);e.dispatch({effects:Q_.of(n)});let{side:r,sibling:i}=e.state.facet(x_);i&&i().dispatch({effects:Q_.of(ev(n,e.state.field(w_),r==`a`))})}),t}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return`collapsed-unchanged-code`}};function ev(e,t,n){let r=0,i=0;for(let a=0;;a++){let o=a<t.length?t[a]:null;if(!o||(n?o.fromA:o.fromB)>=e)return i+(e-r);[r,i]=n?[o.toA,o.toB]:[o.toB,o.toA]}}var tv=us.define({create(e){return ps.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)n.is(Q_)&&(e=e.update({filter:e=>e!=n.value}));return e},provide:e=>ys.decorations.from(e)});function nv({margin:e=3,minSize:t=4}){return tv.init(n=>rv(n,e,t))}function rv(e,t,n){let r=new ms,i=e.facet(x_).side==`a`,a=e.field(w_),o=1;for(let s=0;;s++){let c=s<a.length?a[s]:null,l=s?o+t:1,u=c?e.doc.lineAt(i?c.fromA:c.fromB).number-1-t:e.doc.lines,d=u-l+1;if(d>=n&&r.add(e.doc.line(l).from,e.doc.line(u).to,ps.replace({widget:new $_(d),block:!0})),!c)break;o=e.doc.lineAt(Math.min(e.doc.length,i?c.toA:c.toB)).number}return r.finish()}var iv=ys.styleModule.of(new Ss({".cm-mergeView":{overflowY:`auto`},".cm-mergeViewEditors":{display:`flex`,alignItems:`stretch`},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:`hidden`},".cm-merge-revert":{width:`1.6em`,flexGrow:0,flexShrink:0,position:`relative`},".cm-merge-revert button":{position:`absolute`,display:`block`,width:`100%`,boxSizing:`border-box`,textAlign:`center`,background:`none`,border:`none`,font:`inherit`,cursor:`pointer`}})),av=ys.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:`auto !important`,overflowY:`visible !important`},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:`rgba(160, 128, 100, .08)`},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:`rgba(100, 160, 128, .08)`},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:`linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat`},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:`linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat`},"&light.cm-merge-b .cm-changedText":{background:`linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat`},"&dark.cm-merge-b .cm-changedText":{background:`linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat`},"&.cm-merge-b .cm-deletedText":{background:`#ff000033`},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:`none`},".cm-deletedChunk":{paddingLeft:`6px`,"& .cm-chunkButtons":{position:`absolute`,insetInlineEnd:`5px`},"& button":{border:`none`,cursor:`pointer`,color:`white`,margin:`0 2px`,borderRadius:`3px`,"&[name=accept]":{background:`#2a2`},"&[name=reject]":{background:`#d43`}}},".cm-collapsedLines":{padding:`5px 5px 5px 10px`,cursor:`pointer`,"&:before":{content:`"⦚"`,marginInlineEnd:`7px`},"&:after":{content:`"⦚"`,marginInlineStart:`7px`}},"&light .cm-collapsedLines":{color:`#444`,background:`linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)`},"&dark .cm-collapsedLines":{color:`#ddd`,background:`linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)`},".cm-changeGutter":{width:`3px`,paddingLeft:`1px`},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:`#e43`},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:`#fa9`},"&light.cm-merge-b .cm-changedLineGutter":{background:`#2b2`},"&dark.cm-merge-b .cm-changedLineGutter":{background:`#8f8`},".cm-inlineChangedLineGutter":{background:`#75d`}}),ov=new vs,sv=new vs,cv=class{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||P_;let t=[ss.low(F_),av,iv,J_,ys.updateListener.of(e=>{this.measuring<0&&(e.heightChanged||e.viewportChanged)&&!e.transactions.some(e=>e.effects.some(e=>e.is(q_)))&&this.measure()})],n=[x_.of({side:`a`,sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&n.push(I_);let r=ls.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],ys.editorAttributes.of({class:`cm-merge-a`}),sv.of(n),t]}),i=[x_.of({side:`b`,sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&i.push(I_);let a=ls.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],ys.editorAttributes.of({class:`cm-merge-b`}),sv.of(i),t]});this.chunks=E_.build(r.doc,a.doc,this.diffConf);let o=[w_.init(()=>this.chunks),ov.of(e.collapseUnchanged?nv(e.collapseUnchanged):[])];r=r.update({effects:gs.appendConfig.of(o)}).state,a=a.update({effects:gs.appendConfig.of(o)}).state,this.dom=document.createElement(`div`),this.dom.className=`cm-mergeView`,this.editorDOM=this.dom.appendChild(document.createElement(`div`)),this.editorDOM.className=`cm-mergeViewEditors`;let s=e.orientation||`a-b`,c=document.createElement(`div`);c.className=`cm-mergeViewEditor`;let l=document.createElement(`div`);l.className=`cm-mergeViewEditor`,this.editorDOM.appendChild(s==`a-b`?c:l),this.editorDOM.appendChild(s==`a-b`?l:c),this.a=new ys({state:r,parent:c,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.a)}),this.b=new ys({state:a,parent:l,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls==`b-to-a`,e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,t){if(e.some(e=>e.docChanged)){let n=e[e.length-1],r=e.reduce((e,t)=>e.compose(t.changes),cs.empty(e[0].startState.doc.length));this.chunks=t==this.a?E_.updateA(this.chunks,n.newDoc,this.b.state.doc,r,this.diffConf):E_.updateB(this.chunks,this.a.state.doc,n.newDoc,r,this.diffConf),t.update([...e,n.state.update({effects:S_.of(this.chunks)})]);let i=t==this.a?this.b:this.a;i.update([i.state.update({effects:S_.of(this.chunks)})]),this.scheduleMeasure()}else t.update(e)}reconfigure(e){if(`diffConfig`in e&&(this.diffConf=e.diffConfig),`orientation`in e){let t=e.orientation!=`b-a`;if(t!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let e=this.a.dom.parentNode,n=this.b.dom.parentNode;e.remove(),n.remove(),this.editorDOM.insertBefore(t?e:n,this.editorDOM.firstChild),this.editorDOM.appendChild(t?n:e),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent=``)}}if(`revertControls`in e||`renderRevertControl`in e){let t=!!this.revertDOM,n=this.revertToA,r=this.renderRevert;`revertControls`in e&&(t=!!e.revertControls,n=e.revertControls==`b-to-a`),`renderRevertControl`in e&&(r=e.renderRevertControl),this.setupRevertControls(t,n,r)}let t=`highlightChanges`in e,n=`gutter`in e,r=`collapseUnchanged`in e;if(t||n||r){let i=[],a=[];if(t||n){let r=this.a.state.facet(x_),o=n?e.gutter!==!1:r.markGutter,s=t?e.highlightChanges!==!1:r.highlightChanges;i.push(sv.reconfigure([x_.of({side:`a`,sibling:()=>this.b,highlightChanges:s,markGutter:o}),o?I_:[]])),a.push(sv.reconfigure([x_.of({side:`b`,sibling:()=>this.a,highlightChanges:s,markGutter:o}),o?I_:[]]))}if(r){let t=ov.reconfigure(e.collapseUnchanged?nv(e.collapseUnchanged):[]);i.push(t),a.push(t)}this.a.dispatch({effects:i}),this.b.dispatch({effects:a})}this.scheduleMeasure()}setupRevertControls(e,t,n){this.revertToA=t,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=n,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement(`div`),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener(`mousedown`,e=>this.revertClicked(e)),this.revertDOM.className=`cm-merge-revert`):this.revertDOM&&(this.revertDOM.textContent=``)}scheduleMeasure(){this.measuring<0&&(this.measuring=(this.dom.ownerDocument.defaultView||window).requestAnimationFrame(()=>{this.measuring=-1,this.measure()}))}measure(){Z_(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,t=e.firstChild,n=this.a.viewport,r=this.b.viewport;for(let i=0;i<this.chunks.length;i++){let a=this.chunks[i];if(a.fromA>n.to||a.fromB>r.to)break;if(a.fromA<n.from||a.fromB<r.from)continue;let o=this.a.lineBlockAt(a.fromA).top+`px`;for(;t&&+t.dataset.chunk<i;)t=lv(t);t&&t.dataset.chunk==String(i)?(t.style.top!=o&&(t.style.top=o),t=t.nextSibling):e.insertBefore(this.renderRevertButton(o,i),t)}for(;t;)t=lv(t)}renderRevertButton(e,t){let n;if(this.renderRevert)n=this.renderRevert();else{n=document.createElement(`button`);let e=this.a.state.phrase(`Revert this chunk`);n.setAttribute(`aria-label`,e),n.setAttribute(`title`,e),n.textContent=this.revertToLeft?`⇜`:`⇝`}return n.style.top=e,n.setAttribute(`data-chunk`,String(t)),n}revertClicked(e){let t=e.target,n;for(;t&&t.parentNode!=this.revertDOM;)t=t.parentNode;if(t&&(n=this.chunks[t.dataset.chunk])){let[t,r,i,a,o,s]=this.revertToA?[this.b,this.a,n.fromB,n.toB,n.fromA,n.toA]:[this.a,this.b,n.fromA,n.toA,n.fromB,n.toB],c=t.state.sliceDoc(i,Math.max(i,a-1));i!=a&&s<=r.state.doc.length&&(c+=t.state.lineBreak),r.dispatch({changes:{from:o,to:Math.min(r.state.doc.length,s),insert:c},userEvent:`revert`}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}};function lv(e){let t=e.nextSibling;return e.remove(),t}var uv=new class extends bs{constructor(){super(...arguments),this.elementClass=`cm-deletedLineGutter`}},dv=ss.low(xs({class:`cm-changeGutter`,markers:e=>e.plugin(F_)?.gutter||ws.empty,widgetMarker:(e,t)=>t instanceof gv?uv:null}));function fv(e){let t=typeof e.original==`string`?fs.of(e.original.split(/\r?\n/)):e.original,n=e.diffConfig||P_;return[ss.low(F_),xv,av,ys.editorAttributes.of({class:`cm-merge-b`}),C_.of((e,t)=>{let r=t.effects.find(e=>e.is(pv));return r&&(e=E_.updateA(e,r.value.doc,t.startState.doc,r.value.changes,n)),t.docChanged&&(e=E_.updateB(e,t.state.field(mv),t.newDoc,t.changes,n)),e}),x_.of({highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1,syntaxHighlightDeletions:e.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:e.mergeControls??!0,overrideChunk:e.allowInlineDiffs?Dv:void 0,side:`b`}),mv.init(()=>t),e.gutter===!1?[]:dv,e.collapseUnchanged?nv(e.collapseUnchanged):[],w_.init(e=>E_.build(t,e.doc,n))]}var pv=gs.define(),mv=us.define({create:()=>fs.empty,update(e,t){for(let n of t.effects)n.is(pv)&&(e=n.value.doc);return e}}),hv=new WeakMap,gv=class extends os{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||=this.buildDOM(e)}};function _v(e,t,n){let r=hv.get(t.changes);if(r)return r;let i=ps.widget({block:!0,side:-1,widget:new gv(r=>{let{highlightChanges:i,syntaxHighlightDeletions:a,syntaxHighlightDeletionsMaxLength:o,mergeControls:s}=e.facet(x_),c=document.createElement(`div`);if(c.className=`cm-deletedChunk`,s){let t=c.appendChild(document.createElement(`div`));t.className=`cm-chunkButtons`;let n=e=>{e.preventDefault(),vv(r,r.posAtDOM(c))},i=e=>{e.preventDefault(),yv(r,r.posAtDOM(c))};if(typeof s==`function`)t.appendChild(s(`accept`,n)),t.appendChild(s(`reject`,i));else{let r=t.appendChild(document.createElement(`button`));r.name=`accept`,r.textContent=e.phrase(`Accept`),r.onmousedown=n;let a=t.appendChild(document.createElement(`button`));a.name=`reject`,a.textContent=e.phrase(`Reject`),a.onmousedown=i}}if(n||t.fromA>=t.toA)return c;let l=r.state.field(mv).sliceString(t.fromA,t.endA),u=a&&e.facet(Ts),d=h(),f=t.changes,p=0,m=!1;function h(){let e=c.appendChild(document.createElement(`div`));return e.className=`cm-deletedLine`,e.appendChild(document.createElement(`del`))}function g(e,t,n){for(let r=e;r<t;){if(l.charAt(r)==`
24
- `){d.firstChild||d.appendChild(document.createElement(`br`)),d=h(),r++;continue}let e=t,a=n+(m?` cm-deletedText`:``),o=!1,s=l.indexOf(`
25
- `,r);if(s>-1&&s<t&&(e=s),i&&p<f.length){let t=Math.max(0,m?f[p].toA:f[p].fromA);t<=e&&(e=t,m&&p++,o=!0)}if(e>r){let t=document.createTextNode(l.slice(r,e));if(a){let e=d.appendChild(document.createElement(`span`));e.className=a,e.appendChild(t)}else d.appendChild(t);r=e}o&&(m=!m)}}if(u&&t.toA-t.fromA<=o){let t=u.parser.parse(l),n=0;ds(t,{style:t=>Es(e,t)},(e,t,r)=>{e>n&&g(n,e,``),g(e,t,r),n=t}),g(n,l.length,``)}else g(0,l.length,``);return d.firstChild||d.appendChild(document.createElement(`br`)),c})});return hv.set(t.changes,i),i}function vv(e,t){let{state:n}=e,r=t??n.selection.main.head,i=e.state.field(w_).find(e=>e.fromB<=r&&e.endB>=r);if(!i)return!1;let a=e.state.sliceDoc(i.fromB,Math.max(i.fromB,i.toB-1)),o=e.state.field(mv);i.fromB!=i.toB&&i.toA<=o.length&&(a+=e.state.lineBreak);let s=cs.of({from:i.fromA,to:Math.min(o.length,i.toA),insert:a},o.length);return e.dispatch({effects:pv.of({doc:s.apply(o),changes:s}),userEvent:`accept`}),!0}function yv(e,t){let{state:n}=e,r=t??n.selection.main.head,i=n.field(w_).find(e=>e.fromB<=r&&e.endB>=r);if(!i)return!1;let a=n.field(mv).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));return i.fromA!=i.toA&&i.toB<=n.doc.length&&(a+=n.lineBreak),e.dispatch({changes:{from:i.fromB,to:Math.min(n.doc.length,i.toB),insert:a},userEvent:`revert`}),!0}function bv(e){let t=new ms;for(let n of e.field(w_)){let r=e.facet(x_).overrideChunk&&Cv(e,n);t.add(n.fromB,n.fromB,_v(e,n,!!r))}return t.finish()}var xv=us.define({create:e=>bv(e),update(e,t){return t.state.field(w_,!1)==t.startState.field(w_,!1)?e:bv(t.state)},provide:e=>ys.decorations.from(e)}),Sv=new WeakMap;function Cv(e,t){let n=Sv.get(t);if(n!==void 0)return n;n=null;let r=e.field(mv),i=e.doc,a=r.lineAt(t.endA).number-r.lineAt(t.fromA).number+1,o=i.lineAt(t.endB).number-i.lineAt(t.fromB).number+1;abort:if(a==o&&a<10){let e=[],i=0,o=t.fromA,s=t.fromB;for(let n of t.changes){if(n.fromA<n.toA){i+=n.toA-n.fromA;let t=r.sliceString(o+n.fromA,o+n.toA);if(/\n/.test(t))break abort;e.push(ps.widget({widget:new wv(t),side:-1}).range(s+n.fromB))}n.fromB<n.toB&&e.push(B_.range(s+n.fromB,s+n.toB))}i<t.endA-t.fromA-a*2&&(n=e)}return Sv.set(t,n),n}var wv=class extends os{constructor(e){super(),this.text=e}eq(e){return this.text==e.text}toDOM(e){let t=document.createElement(`del`);return t.className=`cm-deletedText`,t.textContent=this.text,t}},Tv=new class extends bs{constructor(){super(...arguments),this.elementClass=`cm-inlineChangedLineGutter`}},Ev=ps.line({class:`cm-inlineChangedLine`});function Dv(e,t,n,r){let i=Cv(e,t),a=0;if(!i)return!1;for(let o=e.doc.lineAt(t.fromB);;){for(r&&r.add(o.from,o.from,Tv),n.add(o.from,o.from,Ev);a<i.length&&i[a].to<=o.to;){let e=i[a++];n.add(e.from,e.to,e.value)}if(o.to>=t.endB)break;o=e.doc.lineAt(o.to+1)}return!0}var Ov=de({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),kv=Lt({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}});function Av(e){let t=(0,$.c)(20),{oldContent:n,newContent:r,layout:i,conflictMode:a,onResolve:o,onAbort:s}=e,c=(0,Q.useRef)(null),l=(0,Q.useRef)(null),{resolvedTheme:u}=Gr(),d=(0,Q.useRef)(o),f=(0,Q.useRef)(s),[p,m]=(0,Q.useState)(null),h;t[0]!==s||t[1]!==o?(h=()=>{d.current=o,f.current=s},t[0]=s,t[1]=o,t[2]=h):h=t[2],(0,Q.useEffect)(h);let g,v;t[3]!==a||t[4]!==i||t[5]!==r||t[6]!==n||t[7]!==u?(g=()=>{if(!c.current)return;let e=u===`dark`?Ov:kv,t=[ys.editable.of(!1),ls.readOnly.of(!0)],o=[As,_(),...t,e,ys.lineWrapping];if(l.current&&=(l.current.destroy(),null),a){let t=new ys({doc:r,extensions:[As,_(),ys.editable.of(!1),e,ys.lineWrapping,fv({original:n,highlightChanges:!0,gutter:!0,mergeControls:!0,collapseUnchanged:{margin:3,minSize:4}}),ys.updateListener.of(e=>{let t=T_(e.state);m(t?t.chunks.length:0)})],parent:c.current});l.current=t;let i=T_(t.state);m(i?i.chunks.length:0)}else i===`split`?l.current=new cv({a:{doc:n,extensions:o},b:{doc:r,extensions:o},parent:c.current,highlightChanges:!0,gutter:!0,collapseUnchanged:{margin:3,minSize:4}}):l.current=new ys({doc:r,extensions:[...o,fv({original:n,highlightChanges:!0,gutter:!0,mergeControls:!1,collapseUnchanged:{margin:3,minSize:4}})],parent:c.current});return()=>{l.current&&=(l.current.destroy(),null)}},v=[n,r,i,u,a],t[3]=a,t[4]=i,t[5]=r,t[6]=n,t[7]=u,t[8]=g,t[9]=v):(g=t[8],v=t[9]),(0,Q.useEffect)(g,v);let y;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=function(){let e=l.current;!e||!(e instanceof ys)||d.current?.(e.state.doc.toString())},t[10]=y):y=t[10];let b=y,x=p===0,S=p===null?``:p===0?`All hunks resolved`:`${p} unresolved hunk${p===1?``:`s`}`,C;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(`div`,{ref:c,className:`diff-view min-h-0 flex-1 overflow-y-auto subtle-scrollbar`}),t[11]=C):C=t[11];let w;t[12]!==x||t[13]!==a||t[14]!==S||t[15]!==s||t[16]!==o?(w=a&&(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3 py-2 border-t shrink-0`,children:[(0,Z.jsx)(`span`,{className:`text-xs ${x?`text-emerald-600 dark:text-emerald-400`:`text-muted-foreground`}`,children:S}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s&&(0,Z.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:s,children:`Exit merge`}),o&&(0,Z.jsx)(Y,{variant:`default`,size:`sm`,disabled:!x,onClick:b,children:`Save resolution`})]})]}),t[12]=x,t[13]=a,t[14]=S,t[15]=s,t[16]=o,t[17]=w):w=t[17];let T;return t[18]===w?T=t[19]:(T=(0,Z.jsxs)(`div`,{className:`flex flex-col h-full`,children:[C,w]}),t[18]=w,t[19]=T),T}function jv(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(Io,{"data-slot":`sheet`,...n}),t[2]=n,t[3]=r),r}function Mv(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(zo,{"data-slot":`sheet-portal`,...n}),t[2]=n,t[3]=r),r}function Nv(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Mo,{"data-slot":`sheet-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Pv(e){let t=(0,$.c)(17),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,side:a,showCloseButton:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=a===void 0?`right`:a,c=o===void 0?!0:o,l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(Nv,{}),t[6]=l):l=t[6];let u;t[7]===r?u=t[8]:(u=Di(`fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10 motion-reduce:transition-none motion-reduce:duration-0 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none`,r),t[7]=r,t[8]=u);let d;t[9]===c?d=t[10]:(d=c&&(0,Z.jsx)(Ho,{"data-slot":`sheet-close`,asChild:!0,children:(0,Z.jsxs)(Y,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,Z.jsx)(Do,{}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Close`})]})}),t[9]=c,t[10]=d);let f;return t[11]!==n||t[12]!==i||t[13]!==s||t[14]!==u||t[15]!==d?(f=(0,Z.jsxs)(Mv,{children:[l,(0,Z.jsxs)(jo,{"data-slot":`sheet-content`,"data-side":s,className:u,...i,children:[n,d]})]}),t[11]=n,t[12]=i,t[13]=s,t[14]=u,t[15]=d,t[16]=f):f=t[16],f}function Fv(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`flex flex-col gap-0.5 p-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sheet-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Iv(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`font-heading text-base font-medium text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(No,{"data-slot":`sheet-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}async function Lv(){try{let e=await fetch(`/api/sync/conflicts`);return e.ok?{conflicts:(await e.json()).conflicts??[]}:{conflicts:[],error:`server`}}catch{return{conflicts:[],error:`network`}}}async function Rv(e){try{let t=await fetch(`/api/sync/conflict-content?file=${encodeURIComponent(e)}`);if(!t.ok)return{ours:``,theirs:``,base:``};let n=await t.json();return{ours:n.ours??``,theirs:n.theirs??``,base:n.base??``}}catch{return{ours:``,theirs:``,base:``}}}async function zv(e,t,n){try{let r={file:e,strategy:t};return n!==void 0&&(r.content=n),(await fetch(`/api/sync/resolve-conflict`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)})).ok}catch{return!1}}var Bv=`w-[98vw] !max-w-[98vw] h-[96vh] flex flex-col gap-0 sm:!max-w-[98vw]`;function Vv(e){let t=(0,$.c)(31),{file:n,onResolve:r,onAbort:i}=e,[a,o]=(0,Q.useState)(null),s,c;if(t[0]===n?(s=t[1],c=t[2]):(s=()=>{let e=!1;return Rv(n).then(t=>{e||o(t)}),()=>{e=!0}},c=[n],t[0]=n,t[1]=s,t[2]=c),(0,Q.useEffect)(s,c),a===null){let e;t[3]===i?e=t[4]:(e=e=>!e&&i(),t[3]=i,t[4]=e);let r;t[5]===n?r=t[6]:(r=(0,Z.jsx)(Bo,{className:`shrink-0`,children:(0,Z.jsxs)(Ao,{children:[`Resolving: `,n]})}),t[5]=n,t[6]=r);let a;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-sm text-muted-foreground`,children:`Loading`}),t[7]=a):a=t[7];let o;t[8]===r?o=t[9]:(o=(0,Z.jsxs)(Po,{className:Bv,children:[r,a]}),t[8]=r,t[9]=o);let s;return t[10]!==e||t[11]!==o?(s=(0,Z.jsx)(Vo,{open:!0,onOpenChange:e,children:o}),t[10]=e,t[11]=o,t[12]=s):s=t[12],s}let l;t[13]===i?l=t[14]:(l=e=>!e&&i(),t[13]=i,t[14]=l);let u;t[15]===n?u=t[16]:(u=(0,Z.jsxs)(Ao,{className:`text-sm font-medium`,children:[`Resolving: `,n]}),t[15]=n,t[16]=u);let d;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Red = your version (ours). Green = team's version (theirs). Accept each hunk to take theirs, reject to keep yours, then save.`}),t[17]=d):d=t[17];let f;t[18]===u?f=t[19]:(f=(0,Z.jsxs)(Bo,{className:`px-4 pt-4 pb-2 shrink-0`,children:[u,d]}),t[18]=u,t[19]=f);let p;t[20]!==i||t[21]!==r||t[22]!==a.ours||t[23]!==a.theirs?(p=(0,Z.jsx)(`div`,{className:`flex-1 min-h-0 overflow-hidden`,children:(0,Z.jsx)(Av,{oldContent:a.ours,newContent:a.theirs,layout:`unified`,conflictMode:!0,onResolve:r,onAbort:i})}),t[20]=i,t[21]=r,t[22]=a.ours,t[23]=a.theirs,t[24]=p):p=t[24];let m;t[25]!==f||t[26]!==p?(m=(0,Z.jsxs)(Po,{className:`${Bv} p-0`,children:[f,p]}),t[25]=f,t[26]=p,t[27]=m):m=t[27];let h;return t[28]!==l||t[29]!==m?(h=(0,Z.jsx)(Vo,{open:!0,onOpenChange:l,children:m}),t[28]=l,t[29]=m,t[30]=h):h=t[30],h}function Hv(e){let t=(0,$.c)(50),{open:n,onOpenChange:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=[],t[0]=i):i=t[0];let[a,o]=(0,Q.useState)(i),[s,c]=(0,Q.useState)(null),l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(l=new Set,t[1]=l):l=t[1];let[u,d]=(0,Q.useState)(l),f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=new Set,t[2]=f):f=t[2];let[p,m]=(0,Q.useState)(f),[h,g]=(0,Q.useState)(null),_;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=function(){Lv().then(e=>{let{conflicts:t,error:n}=e;c(n??null),o(t),d(e=>{let n=new Set(t.map(Uv));return new Set([...e].filter(e=>!n.has(e)))})})},t[3]=_):_=t[3];let v=_,y,b;t[4]===n?(y=t[5],b=t[6]):(y=()=>{n&&v()},b=[n],t[4]=n,t[5]=y,t[6]=b),(0,Q.useEffect)(y,b);let x,S;t[7]===n?(x=t[8],S=t[9]):(x=()=>Dr(e=>{e.includes(`sync-status`)&&n&&v()}),S=[n],t[7]=n,t[8]=x,t[9]=S),(0,Q.useEffect)(x,S);let C,w;t[10]!==a.length||t[11]!==r||t[12]!==n||t[13]!==u.size?(w=()=>{n&&a.length>0&&u.size>=a.length&&(X.success(`All conflicts resolved — sync resuming`),r(!1),d(new Set))},C=[n,a.length,u.size,r],t[10]=a.length,t[11]=r,t[12]=n,t[13]=u.size,t[14]=C,t[15]=w):(C=t[14],w=t[15]),(0,Q.useEffect)(w,C);let T;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(T=async function(e,t,n){m(t=>new Set([...t,e]));let r=await zv(e,t,n);m(t=>{let n=new Set(t);return n.delete(e),n}),r?d(t=>new Set([...t,e])):X.error(`Failed to resolve ${e}`)},t[16]=T):T=t[16];let E=T,D;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(D=function(e){g(e)},t[17]=D):D=t[17];let O=D,k;t[18]===h?k=t[19]:(k=async function(e){if(!h)return;let t=h;g(null),await E(t,`content`,e)},t[18]=h,t[19]=k);let A=k,j;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(j=function(){g(null)},t[20]=j):j=t[20];let M=j,N;t[21]===r?N=t[22]:(N=async function(){try{(await fetch(`/api/sync/abort-merge`,{method:`POST`})).ok?X.info(`Merge aborted — sync paused`):X.error(`Failed to abort merge`)}catch{X.error(`Failed to abort merge — connection error`)}r(!1),d(new Set)},t[21]=r,t[22]=N);let P=N,F=a.length,I=u.size,L;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(Iv,{className:`text-sm font-medium`,children:`Resolve conflicts`}),t[23]=L):L=t[23];let R;t[24]!==I||t[25]!==F?(R=F>0&&(0,Z.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[I,` of `,F,` resolved`]}),t[24]=I,t[25]=F,t[26]=R):R=t[26];let z;t[27]===R?z=t[28]:(z=(0,Z.jsxs)(Fv,{className:`px-4 py-3 border-b shrink-0`,children:[L,R]}),t[27]=R,t[28]=z);let B;t[29]!==a||t[30]!==s||t[31]!==u||t[32]!==p?(B=(0,Z.jsx)(`div`,{className:`flex-1 overflow-y-auto subtle-scrollbar`,children:s?(0,Z.jsxs)(`div`,{className:`px-4 py-6 text-sm text-center space-y-2`,children:[(0,Z.jsx)(`p`,{className:`text-destructive`,children:s===`network`?`Could not reach the sync server — check your connection.`:`Sync server error — try again in a moment.`}),(0,Z.jsx)(Y,{variant:`outline`,size:`sm`,onClick:v,children:`Retry`})]}):a.length===0?(0,Z.jsx)(`p`,{className:`px-4 py-6 text-sm text-muted-foreground text-center`,children:`No conflicts found.`}):(0,Z.jsx)(`ul`,{className:`divide-y`,children:a.map(e=>{let t=u.has(e.file),n=p.has(e.file),r=e.file.split(`/`).pop()??e.file;return(0,Z.jsxs)(`li`,{className:`px-4 py-3 ${t?`opacity-50`:``}`,children:[(0,Z.jsxs)(`p`,{className:`text-sm font-medium truncate mb-2`,title:e.file,children:[t?`✓ `:``,r]}),!t&&(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,Z.jsx)(Y,{variant:`outline`,size:`xs`,disabled:n,onClick:()=>void E(e.file,`mine`),children:`Keep my version`}),(0,Z.jsx)(Y,{variant:`outline`,size:`xs`,disabled:n,onClick:()=>void E(e.file,`theirs`),children:`Keep team's version`}),(0,Z.jsx)(Y,{variant:`ghost`,size:`xs`,disabled:n,onClick:()=>O(e.file),children:`Resolve manually`})]})]},e.file)})})}),t[29]=a,t[30]=s,t[31]=u,t[32]=p,t[33]=B):B=t[33];let V;t[34]===P?V=t[35]:(V=(0,Z.jsx)(`div`,{className:`px-4 py-3 border-t shrink-0`,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`sm`,className:`w-full`,onClick:P,children:`Exit merge`})}),t[34]=P,t[35]=V);let H;t[36]!==z||t[37]!==B||t[38]!==V?(H=(0,Z.jsxs)(Pv,{side:`right`,className:`w-80 sm:w-96 flex flex-col gap-0 p-0`,children:[z,B,V]}),t[36]=z,t[37]=B,t[38]=V,t[39]=H):H=t[39];let U;t[40]!==r||t[41]!==n||t[42]!==H?(U=(0,Z.jsx)(jv,{open:n,onOpenChange:r,children:H}),t[40]=r,t[41]=n,t[42]=H,t[43]=U):U=t[43];let W;t[44]!==A||t[45]!==h?(W=h&&(0,Z.jsx)(Vv,{file:h,onResolve:e=>void A(e),onAbort:M}),t[44]=A,t[45]=h,t[46]=W):W=t[46];let G;return t[47]!==U||t[48]!==W?(G=(0,Z.jsxs)(Z.Fragment,{children:[U,W]}),t[47]=U,t[48]=W,t[49]=G):G=t[49],G}function Uv(e){return e.file}var Wv=5;async function Gv(e){let t=await fetch(`/api/backlinks?docName=${encodeURIComponent(e)}`),n=await t.json().catch(()=>null);if(!t.ok){let e=gr.safeParse(n);throw e.success?Error(e.data.title):new ft(`Failed to parse backlinks error response (HTTP ${t.status})`,{status:t.status})}let r=li.safeParse(n);if(!r.success)throw new ft(`Backlinks response did not match expected shape.`,{status:t.status});return r.data.backlinks}async function Kv(e){let t=await fetch(`/api/forward-links?docName=${encodeURIComponent(e)}`),n=await t.json().catch(()=>null);if(!t.ok){let e=gr.safeParse(n);throw e.success?Error(e.data.title):new ft(`Failed to parse forward-links error response (HTTP ${t.status})`,{status:t.status})}let r=Rn.safeParse(n);if(!r.success)throw new ft(`Forward-links response did not match expected shape.`,{status:t.status});return r.data.forwardLinks}function qv(e){let t=e.split(`/`);return t.length<=2?e:`…/${t.slice(-2).join(`/`)}`}function Jv(e){window.location.hash=kr(e)}function Yv(e){let t=(0,$.c)(9),{title:n,count:r,isLoading:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(Ge,{className:`size-3.5 text-muted-foreground transition-transform group-data-[state=closed]:-rotate-90`}),t[0]=a):a=t[0];let o;t[1]===n?o=t[2]:(o=(0,Z.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[a,(0,Z.jsx)(vn,{children:n})]}),t[1]=n,t[2]=o);let s;t[3]!==r||t[4]!==i?(s=!i&&(0,Z.jsx)(_n,{children:r}),t[3]=r,t[4]=i,t[5]=s):s=t[5];let c;return t[6]!==o||t[7]!==s?(c=(0,Z.jsxs)(Ko,{className:`group flex w-full cursor-pointer items-center justify-between px-5 py-3 text-left transition-colors hover:bg-muted/40`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8],c}function Xv(e){let t=(0,$.c)(7),{total:n,expanded:r,onToggle:i}=e;if(n<=Wv)return null;let a=n-Wv,o;t[0]===r?o=t[1]:(o=r?(0,Z.jsx)(Ge,{className:`size-3`}):(0,Z.jsx)(Uo,{className:`size-3`}),t[0]=r,t[1]=o);let s=r?`Show fewer`:`Show ${a} more`,c;return t[2]!==r||t[3]!==i||t[4]!==o||t[5]!==s?(c=(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":r,className:`mt-2 inline-flex cursor-pointer items-center gap-1 px-3 text-xs text-muted-foreground transition-colors hover:text-foreground`,onClick:i,children:[o,s]}),t[2]=r,t[3]=i,t[4]=o,t[5]=s,t[6]=c):c=t[6],c}function Zv(e){let t=(0,$.c)(35),{icon:n,iconColorClass:r,rowTooltip:i,title:a,path:o,anchor:s,snippet:c,titleHover:l,ariaLabel:u,href:d,external:f,disabled:p,onClick:m}=e,h=o!==void 0&&o!==a,g=r??`text-muted-foreground`,_;t[0]===g?_=t[1]:(_=Di(`mt-0.5 shrink-0`,g),t[0]=g,t[1]=_);let v;t[2]!==n||t[3]!==_?(v=(0,Z.jsx)(`span`,{className:_,children:n}),t[2]=n,t[3]=_,t[4]=v):v=t[4];let y=v,b;t[5]!==u||t[6]!==p||t[7]!==f||t[8]!==d||t[9]!==m||t[10]!==a||t[11]!==l?(b=d?(0,Z.jsxs)(`a`,{href:d,target:f?`_blank`:void 0,rel:f?`noopener noreferrer`:void 0,"aria-label":u,title:l,onClick:m,className:`block w-full truncate text-left font-medium text-foreground no-underline outline-none after:absolute after:inset-0 after:rounded-md focus-visible:after:ring-2 focus-visible:after:ring-ring`,children:[a,f?(0,Z.jsx)(`span`,{className:`sr-only`,children:` (opens in new tab)`}):null]}):(0,Z.jsx)(`button`,{type:`button`,"aria-label":u,title:l,disabled:p,onClick:m,className:Di(`block w-full truncate text-left font-medium text-foreground no-underline outline-none after:absolute after:inset-0 after:rounded-md focus-visible:after:ring-2 focus-visible:after:ring-ring`,`cursor-pointer bg-transparent p-0 disabled:cursor-not-allowed disabled:opacity-60`),children:a}),t[5]=u,t[6]=p,t[7]=f,t[8]=d,t[9]=m,t[10]=a,t[11]=l,t[12]=b):b=t[12];let x=b,S;t[13]===y?S=t[14]:(S=(0,Z.jsx)(`div`,{className:`mt-px flex items-center`,children:y}),t[13]=y,t[14]=S);let C;t[15]!==s||t[16]!==o||t[17]!==h?(C=h?(0,Z.jsxs)(`div`,{className:`truncate font-mono text-xs text-muted-foreground`,children:[o,s?(0,Z.jsxs)(`span`,{className:`ml-1`,children:[`· #`,s]}):null]}):null,t[15]=s,t[16]=o,t[17]=h,t[18]=C):C=t[18];let w;t[19]===c?w=t[20]:(w=c?(0,Z.jsx)(`p`,{className:`line-clamp-2 text-muted-foreground`,children:c}):null,t[19]=c,t[20]=w);let T;t[21]!==x||t[22]!==C||t[23]!==w?(T=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5 text-1sm`,children:[x,C,w]}),t[21]=x,t[22]=C,t[23]=w,t[24]=T):T=t[24];let E;t[25]!==S||t[26]!==T?(E=(0,Z.jsxs)(`div`,{className:`group relative flex items-start gap-2.5 rounded-md px-3 py-2.5 transition-colors hover:bg-muted/80`,children:[S,T]}),t[25]=S,t[26]=T,t[27]=E):E=t[27];let D=E;if(i){let e;t[28]===D?e=t[29]:(e=(0,Z.jsx)(En,{asChild:!0,children:D}),t[28]=D,t[29]=e);let n;t[30]===i?n=t[31]:(n=(0,Z.jsx)(er,{side:`top`,children:i}),t[30]=i,t[31]=n);let r;return t[32]!==e||t[33]!==n?(r=(0,Z.jsxs)(jn,{children:[e,n]}),t[32]=e,t[33]=n,t[34]=r):r=t[34],r}return D}function Qv(e){let t=(0,$.c)(33),{docName:n}=e,{folderPaths:r,pages:i,loading:a}=Nr(),o,s;t[0]===n?(o=t[1],s=t[2]):(o=[`backlinks`,n],s=()=>Gv(n),t[0]=n,t[1]=o,t[2]=s);let c;t[3]!==n||t[4]!==a||t[5]!==i?(c=!a&&i.has(n),t[3]=n,t[4]=a,t[5]=i,t[6]=c):c=t[6];let l;t[7]!==o||t[8]!==s||t[9]!==c?(l={queryKey:o,queryFn:s,enabled:c},t[7]=o,t[8]=s,t[9]=c,t[10]=l):l=t[10];let{data:u,isLoading:d,error:f}=on(l),p;t[11]===u?p=t[12]:(p=u===void 0?[]:u,t[11]=u,t[12]=p);let m=p,[h,g]=(0,Q.useState)(!1),[_,v]=(0,Q.useState)(n);_!==n&&(v(n),g(!1));let y;t[13]!==m||t[14]!==h?(y=h?m:m.slice(0,Wv),t[13]=m,t[14]=h,t[15]=y):y=t[15];let b=y,x;t[16]!==m.length||t[17]!==d?(x=(0,Z.jsx)(Yv,{title:`Backlinks`,count:m.length,isLoading:d}),t[16]=m.length,t[17]=d,t[18]=x):x=t[18];let S;t[19]!==m.length||t[20]!==f||t[21]!==h||t[22]!==r||t[23]!==d||t[24]!==i||t[25]!==b?(S=f?(0,Z.jsx)(`div`,{className:`px-3`,children:(0,Z.jsx)(rn,{children:f instanceof Error?f.message:`Failed to load backlinks`})}):m.length===0&&!d?(0,Z.jsx)(`div`,{className:`px-3`,children:(0,Z.jsx)(dn,{children:`No pages link here yet.`})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`flex flex-col gap-1`,children:b.map((e,t)=>{let n=To(e.source,{pages:i,folderPaths:r});return(0,Z.jsx)(Zv,{icon:(0,Z.jsx)(we,{className:`size-3.5`}),title:e.title,path:qv(e.source),titleHover:e.source,anchor:e.anchor,snippet:e.snippet,href:kr(n.hashDocName,e.anchor)},`${e.source}-${t}`)})}),(0,Z.jsx)(Xv,{total:m.length,expanded:h,onToggle:()=>g($v)})]}),t[19]=m.length,t[20]=f,t[21]=h,t[22]=r,t[23]=d,t[24]=i,t[25]=b,t[26]=S):S=t[26];let C;t[27]!==d||t[28]!==S?(C=(0,Z.jsx)(Go,{children:(0,Z.jsx)(`div`,{className:`px-2 pb-3`,"aria-busy":d,children:S})}),t[27]=d,t[28]=S,t[29]=C):C=t[29];let w;return t[30]!==C||t[31]!==x?(w=(0,Z.jsxs)(qo,{defaultOpen:!0,children:[x,C]}),t[30]=C,t[31]=x,t[32]=w):w=t[32],w}function $v(e){return!e}function ey(e){let t=(0,$.c)(42),{docName:n}=e,{addPage:r,folderPaths:i,pages:a,pagesBySlug:o,loading:s}=Nr(),c,l;t[0]===n?(c=t[1],l=t[2]):(c=[`forward-links`,n],l=()=>Kv(n),t[0]=n,t[1]=c,t[2]=l);let u;t[3]!==n||t[4]!==a||t[5]!==s?(u=!s&&a.has(n),t[3]=n,t[4]=a,t[5]=s,t[6]=u):u=t[6];let d;t[7]!==c||t[8]!==l||t[9]!==u?(d={queryKey:c,queryFn:l,enabled:u},t[7]=c,t[8]=l,t[9]=u,t[10]=d):d=t[10];let{data:f,isLoading:p,error:m}=on(d),h;t[11]===f?h=t[12]:(h=f===void 0?[]:f,t[11]=f,t[12]=h);let g=h,[_,v]=(0,Q.useState)(null),[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(n);x!==n&&(S(n),b(!1),v(null));let C;t[13]!==y||t[14]!==g?(C=y?g:g.slice(0,Wv),t[13]=y,t[14]=g,t[15]=C):C=t[15];let w=C,T;t[16]!==r||t[17]!==_?(T=async function(e,t){if(!_){v(t);try{await be(e,{addPage:r,onCreated:Jv}),v(null)}catch(e){let t=e;X.error(t instanceof Error?t.message:`Failed to create page`),v(null)}}},t[16]=r,t[17]=_,t[18]=T):T=t[18];let E=T,D;t[19]!==_||t[20]!==i||t[21]!==E||t[22]!==a||t[23]!==o||t[24]!==s?(D=function(e){if(e.kind===`external`){let t=e.title===e.url;return(0,Z.jsx)(Zv,{icon:(0,Z.jsx)(wo,{className:`size-3.5`}),rowTooltip:`Opens in a new tab`,title:e.title,path:t?void 0:e.url,titleHover:e.url,snippet:e.snippet,href:e.url,external:!0},`ext:${e.url}`)}let t=O(e.docName,{pages:a,folderPaths:i,pagesBySlug:o}),n=!s&&t.kind===`create`,r=!s&&t.kind===`navigate`&&t.displayState===`folder`,c=qv(e.docName),l=e.title===e.docName?c:e.title,u=`doc:${e.docName}:${e.anchor??``}`,d=kr(t.kind===`navigate`?t.hashDocName:e.docName,e.anchor);if(n&&t.kind===`create`){let n={initialDir:t.initialDir,suggestedName:t.suggestedName};return(0,Z.jsx)(Zv,{icon:(0,Z.jsx)(Ir,{className:`size-3.5`}),iconColorClass:`text-amber-600 dark:text-amber-400`,rowTooltip:_===u?`Creating page`:`Missing page — click to create`,ariaLabel:_===u?`Creating page: ${e.title}.`:`Missing page: ${e.title}. Click to create.`,title:l,path:c,titleHover:e.docName,anchor:e.anchor,snippet:e.snippet,disabled:_!==null,onClick:()=>void E(n,u)},u)}return r&&t.kind===`navigate`?(0,Z.jsx)(Zv,{icon:(0,Z.jsx)(bc,{className:`size-3.5`}),iconColorClass:`text-sky-600 dark:text-sky-400`,ariaLabel:`Folder target: ${e.title}. Click to open the overview.`,title:l,path:c,titleHover:e.docName,anchor:e.anchor,snippet:e.snippet,href:d},u):(0,Z.jsx)(Zv,{icon:(0,Z.jsx)(we,{className:`size-3.5`}),title:l,path:c,titleHover:e.docName,anchor:e.anchor,snippet:e.snippet,href:d},u)},t[19]=_,t[20]=i,t[21]=E,t[22]=a,t[23]=o,t[24]=s,t[25]=D):D=t[25];let k=D,A;t[26]!==p||t[27]!==g.length?(A=(0,Z.jsx)(Yv,{title:`Outgoing`,count:g.length,isLoading:p}),t[26]=p,t[27]=g.length,t[28]=A):A=t[28];let j;t[29]!==m||t[30]!==y||t[31]!==p||t[32]!==g.length||t[33]!==k||t[34]!==w?(j=m?(0,Z.jsx)(`div`,{className:`px-3`,children:(0,Z.jsx)(rn,{children:m instanceof Error?m.message:`Failed to load outgoing links`})}):g.length===0&&!p?(0,Z.jsx)(`div`,{className:`px-3`,children:(0,Z.jsx)(dn,{children:`This page doesn't link to anything yet.`})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`flex flex-col gap-1`,children:w.map(k)}),(0,Z.jsx)(Xv,{total:g.length,expanded:y,onToggle:()=>b(ty)})]}),t[29]=m,t[30]=y,t[31]=p,t[32]=g.length,t[33]=k,t[34]=w,t[35]=j):j=t[35];let M;t[36]!==p||t[37]!==j?(M=(0,Z.jsx)(Go,{children:(0,Z.jsx)(`div`,{className:`px-2 pb-3`,"aria-busy":p,children:j})}),t[36]=p,t[37]=j,t[38]=M):M=t[38];let N;return t[39]!==A||t[40]!==M?(N=(0,Z.jsxs)(qo,{defaultOpen:!0,children:[A,M]}),t[39]=A,t[40]=M,t[41]=N):N=t[41],N}function ty(e){return!e}function ny(e){let t=(0,$.c)(11),{docName:n,className:r}=e,i=r===void 0?``:r,a;t[0]===n?a=t[1]:(a=(0,Z.jsx)(ey,{docName:n}),t[0]=n,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(Ba,{}),t[2]=o):o=t[2];let s;t[3]===n?s=t[4]:(s=(0,Z.jsx)(Qv,{docName:n}),t[3]=n,t[4]=s);let c;t[5]!==a||t[6]!==s?(c=(0,Z.jsxs)(hn,{className:`px-0 py-0`,children:[a,o,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7];let l;return t[8]!==i||t[9]!==c?(l=(0,Z.jsx)(yn,{className:i,children:c}),t[8]=i,t[9]=c,t[10]=l):l=t[10],l}var ry=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}else return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}};new class extends ry{};function iy(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function ay(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function oy(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function sy(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function cy(e,t){return oy(e,t,``)}function ly(e,t){return sy(e,t,``)}function uy(e,t){return t.slice(0,dy(e,t))}function dy(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function fy(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function py(e,t){if(t)return hy(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function my(e,t){if(t)return hy(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function hy(e,t){if(!t)return[my(e),py(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=fy(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var gy=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,_y=RegExp(`[${gy}]+|\\s+|[^${gy}]`,`ug`);new class extends ry{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=fy(e,r)}else n=e.match(_y)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&vy(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&vy(n,i,r,null,t.intlSegmenter),e}};function vy(e,t,n,r,i){if(t&&n){let[a,o]=hy(t.value,i),[s,c]=hy(n.value,i);if(e){let r=iy(a,s);e.value=sy(e.value,s,r),t.value=cy(t.value,r),n.value=cy(n.value,r)}if(r){let e=ay(o,c);r.value=oy(r.value,c,e),t.value=ly(t.value,e),n.value=ly(n.value,e)}}else if(n){if(e){let e=my(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=my(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=my(r.value,i),[a,o]=hy(t.value,i),s=iy(n,a);t.value=cy(t.value,s);let c=ay(cy(n,s),o);t.value=ly(t.value,c),r.value=oy(r.value,n,c),e.value=sy(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=my(r.value,i),n=uy(py(t.value,i),e);t.value=ly(t.value,n)}else if(e){let n=uy(py(e.value,i),my(t.value,i));t.value=cy(t.value,n)}}new class extends ry{tokenize(e){let t=RegExp(`(\\r?\\n)|[${gy}]+|[^\\S\\n\\r]+|[^${gy}]`,`ug`);return e.match(t)||[]}};var yy=new class extends ry{constructor(){super(...arguments),this.tokenize=xy}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
26
- `))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
27
- `))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
28
- `)&&(e=e.slice(0,-1)),t.endsWith(`
29
- `)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function by(e,t,n){return yy.diff(e,t,n)}function xy(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
30
- `));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function Sy(e){return e==`.`||e==`!`||e==`?`}new class extends ry{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(Sy(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends ry{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends ry{constructor(){super(...arguments),this.tokenize=xy}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(Cy(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function Cy(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=Cy(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=Cy(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends ry{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};var wy={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function Ty(e,t,n,r,i,a,o){let s;s=o?typeof o==`function`?{callback:o}:o:{},s.context===void 0&&(s.context=4);let c=s.context;if(s.newlineIsToken)throw Error(`newlineIsToken may not be used with patch-generation functions, only with diffing functions`);if(s.callback){let{callback:e}=s;by(n,r,Object.assign(Object.assign({},s),{callback:t=>{e(l(t))}}))}else return l(by(n,r,s));function l(n){if(!n)return;n.push({value:``,lines:[]});function r(e){return e.map(function(e){return` `+e})}let o=[],s=0,l=0,u=[],d=1,f=1;for(let e=0;e<n.length;e++){let t=n[e],i=t.lines||ky(t.value);if(t.lines=i,t.added||t.removed){if(!s){let t=n[e-1];s=d,l=f,t&&(u=c>0?r(t.lines.slice(-c)):[],s-=u.length,l-=u.length)}for(let e of i)u.push((t.added?`+`:`-`)+e);t.added?f+=i.length:d+=i.length}else{if(s)if(i.length<=c*2&&e<n.length-2)for(let e of r(i))u.push(e);else{let e=Math.min(i.length,c);for(let t of r(i.slice(0,e)))u.push(t);let t={oldStart:s,oldLines:d-s+e,newStart:l,newLines:f-l+e,lines:u};o.push(t),s=0,l=0,u=[]}d+=i.length,f+=i.length}}for(let e of o)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith(`
31
- `)?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,`\`),t++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:a,hunks:o}}}function Ey(e,t){if(t||=wy,Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders)throw Error(`Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)`);return e.map(e=>Ey(e,t)).join(`
32
- `)}let n=[];t.includeIndex&&e.oldFileName==e.newFileName&&n.push(`Index: `+e.oldFileName),t.includeUnderline&&n.push(`===================================================================`),t.includeFileHeaders&&(n.push(`--- `+e.oldFileName+(e.oldHeader===void 0?``:` `+e.oldHeader)),n.push(`+++ `+e.newFileName+(e.newHeader===void 0?``:` `+e.newHeader)));for(let t=0;t<e.hunks.length;t++){let r=e.hunks[t];r.oldLines===0&&--r.oldStart,r.newLines===0&&--r.newStart,n.push(`@@ -`+r.oldStart+`,`+r.oldLines+` +`+r.newStart+`,`+r.newLines+` @@`);for(let e of r.lines)n.push(e)}return n.join(`
33
- `)+`
34
- `}function Dy(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;Ty(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?Ey(e,o.headerOptions):void 0)}}))}else{let s=Ty(e,t,n,r,i,a,o);return s?Ey(s,o?.headerOptions):void 0}}function Oy(e,t,n,r,i,a){return Dy(e,e,t,n,r,i,a)}function ky(e){let t=e.endsWith(`
35
- `),n=e.split(`
36
- `).map(e=>e+`
37
- `);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function Ay(e,t){return`${e}\u0000${t}`}function jy(e,t,n){let r=pi(e).body,i=pi(t).body;return r===i?``:Oy(n,r,i,``,``,{context:3})}function My(e,t,n){let r=(0,$.c)(8),{activeProvider:i}=ut(),a;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={status:`idle`,diff:null},r[0]=a):a=r[0];let[o,s]=(0,Q.useState)(a),c=(0,Q.useRef)(i),l;r[1]===i?l=r[2]:(l=()=>{c.current=i},r[1]=i,r[2]=l),(0,Q.useEffect)(l);let u,d;return r[3]!==n||r[4]!==t||r[5]!==e?(u=()=>{if(!e){s({status:`idle`,diff:null});return}let r=e,i=!1;return s({status:`loading`,diff:null}),(async function(){try{let e=Ay(t,r),a=n.get(e);if(a===void 0){let o=await fetch(`/api/history/${r}?docName=${encodeURIComponent(t)}`);if(i)return;if(!o.ok){s({status:`error`,diff:null});return}let c=await o.json();if(i)return;a=c.content??``,n.set(e,a)}if(i)return;let o=c.current?.document.getText(`source`).toString()??``,l=jy(a,o,t);if(i)return;s({status:`ready`,diff:l})}catch(e){i||(console.error(`[timeline-diff] failed to load entry diff`,{sha:r,docName:t,err:e}),s({status:`error`,diff:null}))}})(),()=>{i=!0}},d=[e,t,n],r[3]=n,r[4]=t,r[5]=e,r[6]=u,r[7]=d):(u=r[6],d=r[7]),(0,Q.useEffect)(u,d),o}var Ny=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityPanelDiffView-d4ec9M69.js`),__vite__mapDeps([16,1,8,17]),import.meta.url)).ActivityPanelDiffView}));function Py(e){let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3);if(r<60)return`just now`;if(r<3600)return`${Math.floor(r/60)} min ago`;if(r<86400)return`${Math.floor(r/3600)}h ago`;if(r<86400*2)return`yesterday`;let i=Math.floor(r/86400);return i<7?`${i} days ago`:t.toLocaleDateString()}function Fy(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function Iy(e){return e.slice(0,7)}function Ly(e){return e.type===`upstream`?`Upstream sync`:e.contributors.length===1?e.contributors[0].name:e.contributors.length>1?e.contributors.map(e=>e.name).join(`, `):e.author===`openknowledge-server`||e.author===`server`?`Auto-save`:e.author}function Ry(e){let t=(0,$.c)(17),n,r;if(t[0]===e?(n=t[1],r=t[2]):({icon:n,...r}=e,t[0]=e,t[1]=n,t[2]=r),n===`claude`){let e;return t[3]===r?e=t[4]:(e=(0,Z.jsx)(Vi,{...r}),t[3]=r,t[4]=e),e}if(n===`cursor`){let e;return t[5]===r?e=t[6]:(e=(0,Z.jsx)(qi,{...r}),t[5]=r,t[6]=e),e}if(n===`windsurf`){let e;return t[7]===r?e=t[8]:(e=(0,Z.jsx)(zi,{...r}),t[7]=r,t[8]=e),e}if(n===`openai`){let e;return t[9]===r?e=t[10]:(e=(0,Z.jsx)(Wi,{...r}),t[9]=r,t[10]=e),e}if(n===`cline`){let e;return t[11]===r?e=t[12]:(e=(0,Z.jsx)(Qi,{...r}),t[11]=r,t[12]=e),e}if(n===`github`){let e;return t[13]===r?e=t[14]:(e=(0,Z.jsx)(Xi,{...r}),t[13]=r,t[14]=e),e}let i=r,a;return t[15]===i?a=t[16]:(a=(0,Z.jsx)(Ji,{strokeWidth:1.5,...i}),t[15]=i,t[16]=a),a}function zy(e){let t=(0,$.c)(17),{entry:n,isDark:r}=e;if(n.type===`upstream`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(k,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[0]=e):e=t[0],e}if(n.contributors.length>0){let e=n.contributors[0],i=e.colorSeed??e.name,a;t[1]===i?a=t[2]:(a=On(i),t[1]=i,t[2]=a);let o=a,s=r?vr[o]??xr[o]:xr[o],c;t[3]!==s||t[4]!==i?(c=s??fi(i),t[3]=s,t[4]=i,t[5]=c):c=t[5];let l=c;if(o!==`bot`){let e;t[6]===l?e=t[7]:(e={color:l},t[6]=l,t[7]=e);let n;return t[8]!==o||t[9]!==e?(n=(0,Z.jsx)(Ry,{icon:o,width:14,height:14,className:`shrink-0`,style:e}),t[8]=o,t[9]=e,t[10]=n):n=t[10],n}if(e.name===`File System`){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Sc,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[11]=e):e=t[11],e}if(e.name===`Open Knowledge (service)`||e.name===`Git (upstream)`){let e;return t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(qs,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[12]=e):e=t[12],e}let u;return t[13]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(ll,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[13]=u):u=t[13],u}if(n.authorEmail.includes(`agent`)||n.author.includes(`agent`)||n.authorEmail.includes(`cursor`)||n.authorEmail.includes(`claude`)){let e;return t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Ji,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[14]=e):e=t[14],e}if(n.author===`openknowledge-server`||n.author===`server`){let e;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(qs,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[15]=e):e=t[15],e}let i;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(ll,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[16]=i):i=t[16],i}function By(e){let t=(0,$.c)(20),{entries:n,defaultExpanded:r,isDark:i,diffLayout:a,cache:o,docName:s,expandedShas:c,onToggleExpanded:l,onRestoreSuccess:u}=e,[d,f]=(0,Q.useState)(r);if(n.length===0)return null;let p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>f(Vy),t[0]=p):p=t[0];let m;t[1]===d?m=t[2]:(m=d?(0,Z.jsx)(Ge,{className:`size-3`}):(0,Z.jsx)(Uo,{className:`size-3`}),t[1]=d,t[2]=m);let h=d?`Hide ${n.length} auto-save${n.length>1?`s`:``}`:`Show ${n.length} auto-save${n.length>1?`s`:``}`,g;t[3]!==d||t[4]!==m||t[5]!==h?(g=(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":d,className:`flex items-center gap-1.5 rounded-lg px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors text-left`,onClick:p,children:[m,h]}),t[3]=d,t[4]=m,t[5]=h,t[6]=g):g=t[6];let _;t[7]!==o||t[8]!==a||t[9]!==s||t[10]!==n||t[11]!==d||t[12]!==c||t[13]!==i||t[14]!==u||t[15]!==l?(_=d&&n.map(e=>(0,Z.jsx)(tb,{entry:e,isDark:i,diffLayout:a,cache:o,docName:s,expanded:c.has(e.sha),onToggleExpanded:l,onRestoreSuccess:u},e.sha)),t[7]=o,t[8]=a,t[9]=s,t[10]=n,t[11]=d,t[12]=c,t[13]=i,t[14]=u,t[15]=l,t[16]=_):_=t[16];let v;return t[17]!==g||t[18]!==_?(v=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[g,_]}),t[17]=g,t[18]=_,t[19]=v):v=t[19],v}function Vy(e){return!e}function Hy(e){return e.checkpoint?e.checkpoint.kind:`save`}function Uy(e){let t=Hy(e);if(t===`save`)return`Save Version`;let n=e.checkpoint?.size??null,r=n!=null&&n>0?` (${Wy(n)})`:``;return t===`bridge-merge-loss`?`Auto-saved before a concurrent edit${r}`:`Recovered from an external change${r}`}function Wy(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/102.4)/10} KB`:`${Math.round(e/104857.6)/10} MB`}function Gy(e){return e.type===`checkpoint`?Hy(e)===`save`?`version`:`auto-save`:`wip`}var Ky={version:`Restore this version`,"auto-save":`Restore this auto-save`,wip:`Restore to this point`},qy={version:`Restore this version?`,"auto-save":`Restore this auto-save?`,wip:`Restore to this point?`};function Jy(e){return Ky[Gy(e)]}function Yy(e){return qy[Gy(e)]}function Xy(e){let t=[];for(let n of e.contributors)if(n.summaries)for(let e of n.summaries)t.push(e);return t}function Zy(e){let t=(0,$.c)(20),{summaries:n}=e,[r,i]=(0,Q.useState)(!1),a=(0,Q.useId)();if(n.length===0)return null;let o,s;t[0]===n?(o=t[1],s=t[2]):([o,...s]=n,t[0]=n,t[1]=o,t[2]=s);let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`• `}),t[3]=c):c=t[3];let l;t[4]===o?l=t[5]:(l=(0,Z.jsxs)(`li`,{className:`text-xs text-foreground/90`,children:[c,o]}),t[4]=o,t[5]=l);let u;t[6]!==r||t[7]!==s?(u=r&&s.map($y),t[6]=r,t[7]=s,t[8]=u):u=t[8];let d;t[9]!==a||t[10]!==l||t[11]!==u?(d=(0,Z.jsxs)(`ul`,{id:a,className:`list-none`,children:[l,u]}),t[9]=a,t[10]=l,t[11]=u,t[12]=d):d=t[12];let f;t[13]!==r||t[14]!==a||t[15]!==s.length?(f=s.length>0&&(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":r,"aria-controls":a,className:`inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer`,onClick:e=>{e.stopPropagation(),i(Qy)},children:[r?(0,Z.jsx)(Ge,{className:`size-3`}):(0,Z.jsx)(Uo,{className:`size-3`}),r?`Hide`:`Show ${s.length} more`]}),t[13]=r,t[14]=a,t[15]=s.length,t[16]=f):f=t[16];let p;return t[17]!==d||t[18]!==f?(p=(0,Z.jsxs)(`div`,{className:`mt-0.5`,children:[d,f]}),t[17]=d,t[18]=f,t[19]=p):p=t[19],p}function Qy(e){return!e}function $y(e,t){return(0,Z.jsxs)(`li`,{className:`text-xs text-foreground/90`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`• `}),e]},`${t}-${e}`)}function eb(e){let t=(0,$.c)(13),{sha:n,docName:r,cache:i,diffLayout:a,panelId:o}=e,s=My(n,r,i),c;t[0]===s.status?c=t[1]:(c=s.status===`loading`&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-xs text-muted-foreground`,children:[(0,Z.jsx)(tt,{className:`size-3 animate-spin`}),`Loading diff`]}),t[0]=s.status,t[1]=c);let l;t[2]===s.status?l=t[3]:(l=s.status===`error`&&(0,Z.jsx)(`p`,{className:`py-2 text-xs text-destructive`,children:`Diff unavailable`}),t[2]=s.status,t[3]=l);let u;t[4]!==a||t[5]!==s.diff||t[6]!==s.status?(u=s.status===`ready`&&(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-xs text-muted-foreground`,children:[(0,Z.jsx)(tt,{className:`size-3 animate-spin`}),`Loading diff renderer`]}),children:(0,Z.jsx)(Ny,{diff:s.diff,viewType:a})}),t[4]=a,t[5]=s.diff,t[6]=s.status,t[7]=u):u=t[7];let d;return t[8]!==o||t[9]!==c||t[10]!==l||t[11]!==u?(d=(0,Z.jsxs)(`div`,{id:o,className:`px-3 pb-2`,"data-testid":`timeline-entry-diff`,children:[c,l,u]}),t[8]=o,t[9]=c,t[10]=l,t[11]=u,t[12]=d):d=t[12],d}function tb(e){let t=(0,$.c)(128),{entry:n,prominent:r,isDark:i,diffLayout:a,cache:o,docName:s,expanded:c,onToggleExpanded:l,onRestoreSuccess:u}=e,d=r===void 0?!1:r,f;t[0]===n.timestamp?f=t[1]:(f=Py(n.timestamp),t[0]=n.timestamp,t[1]=f);let p=f,m;t[2]===n?m=t[3]:(m=Ly(n),t[2]=n,t[3]=m);let h=m,g=n.contributors.flatMap(nb),_;t[4]===n?_=t[5]:(_=Xy(n),t[4]=n,t[5]=_);let v=_,[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(!1),C=(0,Q.useRef)(null),w=(0,Q.useId)(),T,E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>()=>C.current?.abort(),E=[],t[6]=T,t[7]=E):(T=t[6],E=t[7]),(0,Q.useEffect)(T,E);let D;t[8]!==n.sha||t[9]!==l?(D=()=>l(n.sha),t[8]=n.sha,t[9]=l,t[10]=D):D=t[10];let O=D,k;t[11]===b?k=t[12]:(k=function(){C.current?.abort(),C.current=null,S(!1),b(!1)},t[11]=b,t[12]=k);let A=k,j;t[13]!==s||t[14]!==n.sha||t[15]!==u||t[16]!==b?(j=async function(){S(!0);let e=new AbortController;C.current=e;let t=function(){e.signal.aborted||S(!1),C.current===e&&(C.current=null)},r;try{r=await fetch(`/api/rollback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({docName:s,commitSha:n.sha}),signal:e.signal})}catch(r){let i=r;!e.signal.aborted&&!(i instanceof DOMException&&i.name===`AbortError`)&&(console.error(`[timeline] rollback fetch failed`,{docName:s,sha:n.sha,err:i}),X.error(`Restore failed — document unchanged`,{duration:4e3})),t();return}if(e.signal.aborted){t();return}if(r.ok)b(!1),u();else{let e=`HTTP ${r.status}`;try{let t=gr.safeParse(await r.json());t.success&&(e=t.data.title)}catch{}console.error(`[timeline] rollback failed`,{docName:s,sha:n.sha,status:r.status,detail:e}),X.error(`Restore failed`,{description:e,duration:6e3})}t()},t[13]=s,t[14]=n.sha,t[15]=u,t[16]=b,t[17]=j):j=t[17];let M=j,N;t[18]!==n||t[19]!==i||t[20]!==d?(N=d?(()=>{let e=Hy(n);return e===`bridge-merge-loss`?(0,Z.jsx)(Ir,{className:`size-3.5 shrink-0 text-amber-600 dark:text-amber-400`,"aria-hidden":`true`}):e===`external-change-rescue`?(0,Z.jsx)(pc,{className:`size-3.5 shrink-0 text-sky-600 dark:text-sky-400`,"aria-hidden":`true`}):(0,Z.jsx)(dc,{className:`size-3.5 shrink-0 text-muted-foreground`})})():(0,Z.jsx)(zy,{entry:n,isDark:i}),t[18]=n,t[19]=i,t[20]=d,t[21]=N):N=t[21];let P=N,F=c?w:void 0,I=c?`bg-muted`:`hover:bg-muted/80`,L;t[22]===I?L=t[23]:(L=[`group flex w-full items-start gap-2.5 rounded-lg px-3 py-2.5 text-left transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring`,I],t[22]=I,t[23]=L);let R=L.join(` `),z;t[24]===O?z=t[25]:(z=e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),O())},t[24]=O,t[25]=z);let B;t[26]===P?B=t[27]:(B=(0,Z.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:P}),t[26]=P,t[27]=B);let V;t[28]!==h||t[29]!==n||t[30]!==d?(V=d?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`text-xs text-foreground truncate`,children:Uy(n)}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground/50`,children:`·`}),(0,Z.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:h})]}):(0,Z.jsx)(`span`,{className:`truncate text-xs text-foreground`,children:h}),t[28]=h,t[29]=n,t[30]=d,t[31]=V):V=t[31];let H;t[32]!==n.timestamp||t[33]!==p?(H=(0,Z.jsx)(`time`,{className:`ml-auto shrink-0 text-xs text-muted-foreground/80`,dateTime:n.timestamp,title:n.timestamp,children:p}),t[32]=n.timestamp,t[33]=p,t[34]=H):H=t[34];let U;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`h-3 w-px shrink-0 bg-border`}),t[35]=U):U=t[35];let W;t[36]===n?W=t[37]:(W=Jy(n),t[36]=n,t[37]=W);let G;t[38]===b?G=t[39]:(G=e=>{e.stopPropagation(),b(!0)},t[38]=b,t[39]=G);let ee;t[40]===x?ee=t[41]:(ee=x?(0,Z.jsx)(tt,{className:`size-3 animate-spin`}):(0,Z.jsx)(Hi,{className:`size-3`}),t[40]=x,t[41]=ee);let te;t[42]!==x||t[43]!==W||t[44]!==G||t[45]!==ee?(te=(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon`,className:`size-5 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`timeline-entry-restore`,"aria-label":W,disabled:x,onClick:G,children:ee})}),t[42]=x,t[43]=W,t[44]=G,t[45]=ee,t[46]=te):te=t[46];let ne;t[47]===n?ne=t[48]:(ne=Jy(n),t[47]=n,t[48]=ne);let re;t[49]===ne?re=t[50]:(re=(0,Z.jsx)(er,{side:`top`,children:ne}),t[49]=ne,t[50]=re);let ie;t[51]!==te||t[52]!==re?(ie=(0,Z.jsxs)(jn,{children:[te,re]}),t[51]=te,t[52]=re,t[53]=ie):ie=t[53];let ae;t[54]!==V||t[55]!==H||t[56]!==ie?(ae=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[V,H,U,ie]}),t[54]=V,t[55]=H,t[56]=ie,t[57]=ae):ae=t[57];let oe;t[58]===v?oe=t[59]:(oe=v.length>0&&(0,Z.jsx)(Zy,{summaries:v}),t[58]=v,t[59]=oe);let se=g.length>0?(0,Z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:g.join(`, `),children:g.join(`, `)}):(0,Z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:n.message,children:n.message}),K;t[60]!==ae||t[61]!==oe||t[62]!==se?(K=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[ae,oe,se]}),t[60]=ae,t[61]=oe,t[62]=se,t[63]=K):K=t[63];let ce;t[64]!==c||t[65]!==O||t[66]!==F||t[67]!==R||t[68]!==z||t[69]!==B||t[70]!==K?(ce=(0,Z.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-expanded":c,"aria-controls":F,"data-testid":`timeline-entry-expand`,className:R,onClick:O,onKeyDown:z,children:[B,K]}),t[64]=c,t[65]=O,t[66]=F,t[67]=R,t[68]=z,t[69]=B,t[70]=K,t[71]=ce):ce=t[71];let le;t[72]!==o||t[73]!==a||t[74]!==w||t[75]!==s||t[76]!==n.sha||t[77]!==c?(le=c&&(0,Z.jsx)(eb,{sha:n.sha,docName:s,cache:o,diffLayout:a,panelId:w}),t[72]=o,t[73]=a,t[74]=w,t[75]=s,t[76]=n.sha,t[77]=c,t[78]=le):le=t[78];let ue;t[79]!==ce||t[80]!==le?(ue=(0,Z.jsxs)(`div`,{className:`flex flex-col rounded-lg`,children:[ce,le]}),t[79]=ce,t[80]=le,t[81]=ue):ue=t[81];let q;t[82]!==A||t[83]!==b?(q=e=>{e?b(!0):A()},t[82]=A,t[83]=b,t[84]=q):q=t[84];let de;t[85]===n?de=t[86]:(de=Yy(n),t[85]=n,t[86]=de);let fe;t[87]===de?fe=t[88]:(fe=(0,Z.jsx)(Ao,{children:de}),t[87]=de,t[88]=fe);let pe;t[89]===n.timestamp?pe=t[90]:(pe=Fy(n.timestamp),t[89]=n.timestamp,t[90]=pe);let me;t[91]===n.sha?me=t[92]:(me=Iy(n.sha),t[91]=n.sha,t[92]=me);let he;t[93]!==p||t[94]!==pe||t[95]!==me?(he=(0,Z.jsxs)(`span`,{className:`font-medium text-foreground`,children:[p,` (`,pe,`, `,me,`)`]}),t[93]=p,t[94]=pe,t[95]=me,t[96]=he):he=t[96];let ge;t[97]===h?ge=t[98]:(ge=(0,Z.jsx)(`span`,{className:`font-medium text-foreground`,children:h}),t[97]=h,t[98]=ge);let _e;t[99]!==he||t[100]!==ge?(_e=(0,Z.jsxs)(Oo,{children:[`This will replace the current document content with the version from`,` `,he,` `,`by `,ge,`. Your current content is already saved in the timeline — you can restore it anytime.`]}),t[99]=he,t[100]=ge,t[101]=_e):_e=t[101];let ve;t[102]!==fe||t[103]!==_e?(ve=(0,Z.jsxs)(Bo,{children:[fe,_e]}),t[102]=fe,t[103]=_e,t[104]=ve):ve=t[104];let ye;t[105]===A?ye=t[106]:(ye=(0,Z.jsx)(Y,{variant:`outline`,"data-testid":`timeline-entry-restore-cancel`,onClick:A,children:`Cancel`}),t[105]=A,t[106]=ye);let be;t[107]===M?be=t[108]:(be=()=>M(),t[107]=M,t[108]=be);let xe;t[109]===x?xe=t[110]:(xe=x?(0,Z.jsx)(tt,{className:`mr-2 size-4 animate-spin`}):null,t[109]=x,t[110]=xe);let Se;t[111]!==x||t[112]!==be||t[113]!==xe?(Se=(0,Z.jsxs)(Y,{variant:`destructive`,"data-testid":`timeline-entry-restore-confirm`,disabled:x,onClick:be,children:[xe,`Restore`]}),t[111]=x,t[112]=be,t[113]=xe,t[114]=Se):Se=t[114];let Ce;t[115]!==ye||t[116]!==Se?(Ce=(0,Z.jsxs)(Ro,{children:[ye,Se]}),t[115]=ye,t[116]=Se,t[117]=Ce):Ce=t[117];let we;t[118]!==ve||t[119]!==Ce?(we=(0,Z.jsxs)(Po,{children:[ve,Ce]}),t[118]=ve,t[119]=Ce,t[120]=we):we=t[120];let Te;t[121]!==y||t[122]!==q||t[123]!==we?(Te=(0,Z.jsx)(Vo,{open:y,onOpenChange:q,children:we}),t[121]=y,t[122]=q,t[123]=we,t[124]=Te):Te=t[124];let Ee;return t[125]!==ue||t[126]!==Te?(Ee=(0,Z.jsxs)(Z.Fragment,{children:[ue,Te]}),t[125]=ue,t[126]=Te,t[127]=Ee):Ee=t[127],Ee}function nb(e){return e.docs}function rb(e){let t=(0,$.c)(63),{docName:n,diffLayout:r,onDiffLayoutChange:i}=e,{resolvedTheme:a}=Gr(),o=a===`dark`,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=[],t[0]=s):s=t[0];let[c,l]=(0,Q.useState)(s),[u,d]=(0,Q.useState)(!1),[f,p]=(0,Q.useState)(null),m=(0,Q.useRef)(null),[h]=(0,Q.useState)(sb),[g,_]=(0,Q.useState)(ob),v;t[1]===h?v=t[2]:(v=()=>{_(new Set),h.clear()},t[1]=h,t[2]=v);let y;t[3]===n?y=t[4]:(y=[n],t[3]=n,t[4]=y),(0,Q.useEffect)(v,y);let b;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(b=function(e){_(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[5]=b):b=t[5];let x=b,S;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(S=function(){_(new Set)},t[6]=S):S=t[6];let C=S,w,T;t[7]===n?(w=t[8],T=t[9]):(w=()=>{if(!n){l([]);return}let e=!1,t=async function(){if(n)try{let t=await fetch(`/api/history?docName=${encodeURIComponent(n)}&limit=100`);if(e)return;if(!t.ok){p(`History unavailable`);return}let r=await t.json();if(e)return;l(r.entries??[]),p(null)}catch(t){let n=t;if(e)return;p(`History unavailable`),console.error(`[timeline]`,n)}};return d(!0),t().finally(()=>{e||d(!1)}),m.current=setInterval(t,1e4),()=>{e=!0,m.current&&clearInterval(m.current)}},T=[n],t[7]=n,t[8]=w,t[9]=T),(0,Q.useEffect)(w,T);let E,D,O,k,A,j,M,N;if(t[10]!==h||t[11]!==r||t[12]!==n||t[13]!==c||t[14]!==f||t[15]!==g||t[16]!==o||t[17]!==u||t[18]!==i){let e=[],a=[],s=!1;for(let t of c)t.type===`checkpoint`?(a.length>0&&(e.push({kind:`wip-group`,entries:a,isPreCheckpoint:!s}),a=[]),e.push({kind:`checkpoint`,entry:t}),s=!0):a.push(t);a.length>0&&e.push({kind:`wip-group`,entries:a,isPreCheckpoint:!s});let l;t[27]===c?l=t[28]:(l=c.some(ab),t[27]=c,t[28]=l);let d=!l,p=!u&&!f&&c.length>0;A=`flex h-full flex-col`,t[29]!==r||t[30]!==p||t[31]!==i?(j=p&&(0,Z.jsx)(`div`,{className:`flex items-center justify-end gap-1 px-2 py-1.5`,children:(0,Z.jsxs)(jn,{children:[(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsxs)($o,{type:`single`,value:r,onValueChange:e=>{e&&i(e)},"aria-label":`Diff layout`,variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-md shrink-0`,children:[(0,Z.jsx)(Xo,{value:`unified`,"aria-label":`Unified diff`,className:`size-6 px-0`,children:(0,Z.jsx)(Kc,{className:`size-3.5`})}),(0,Z.jsx)(Xo,{value:`split`,"aria-label":`Split diff`,className:`size-6 px-0`,children:(0,Z.jsx)(sc,{className:`size-3.5`})})]})}),(0,Z.jsx)(er,{children:r===`unified`?`Unified diff`:`Split diff`})]})}),t[29]=r,t[30]=p,t[31]=i,t[32]=j):j=t[32],M=`flex-1 overflow-y-auto subtle-scrollbar scroll-fade-mask`,t[33]===u?N=t[34]:(N=u&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,role:`status`,"aria-busy":`true`,"aria-label":`Loading timeline history`,children:[1,2,3].map(ib)}),t[33]=u,t[34]=N),t[35]!==f||t[36]!==u?(E=!u&&f&&(0,Z.jsx)(`div`,{className:`px-4 py-3`,children:(0,Z.jsx)(`p`,{className:`text-xs text-destructive`,children:f})}),t[35]=f,t[36]=u,t[37]=E):E=t[37],t[38]!==c.length||t[39]!==f||t[40]!==u?(D=!u&&!f&&c.length===0&&(0,Z.jsx)(`div`,{className:`px-4 py-8 text-center`,children:(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No history yet`})}),t[38]=c.length,t[39]=f,t[40]=u,t[41]=D):D=t[41],t[42]!==h||t[43]!==r||t[44]!==n||t[45]!==c||t[46]!==f||t[47]!==g||t[48]!==d||t[49]!==o||t[50]!==u?(O=!u&&!f&&d&&c.length>0&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,children:c.map(e=>(0,Z.jsx)(tb,{entry:e,isDark:o,diffLayout:r,cache:h,docName:n,expanded:g.has(e.sha),onToggleExpanded:x,onRestoreSuccess:C},e.sha))}),t[42]=h,t[43]=r,t[44]=n,t[45]=c,t[46]=f,t[47]=g,t[48]=d,t[49]=o,t[50]=u,t[51]=O):O=t[51],k=!u&&!f&&!d&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,children:e.map((e,t)=>e.kind===`checkpoint`?(0,Z.jsx)(tb,{entry:e.entry,prominent:!0,isDark:o,diffLayout:r,cache:h,docName:n,expanded:g.has(e.entry.sha),onToggleExpanded:x,onRestoreSuccess:C},e.entry.sha):(0,Z.jsx)(By,{entries:e.entries,defaultExpanded:e.isPreCheckpoint,isDark:o,diffLayout:r,cache:h,docName:n,expandedShas:g,onToggleExpanded:x,onRestoreSuccess:C},e.entries[0]?.sha??`wip-${t}`))}),t[10]=h,t[11]=r,t[12]=n,t[13]=c,t[14]=f,t[15]=g,t[16]=o,t[17]=u,t[18]=i,t[19]=E,t[20]=D,t[21]=O,t[22]=k,t[23]=A,t[24]=j,t[25]=M,t[26]=N}else E=t[19],D=t[20],O=t[21],k=t[22],A=t[23],j=t[24],M=t[25],N=t[26];let P;t[52]!==E||t[53]!==D||t[54]!==O||t[55]!==k||t[56]!==M||t[57]!==N?(P=(0,Z.jsxs)(`div`,{className:M,children:[N,E,D,O,k]}),t[52]=E,t[53]=D,t[54]=O,t[55]=k,t[56]=M,t[57]=N,t[58]=P):P=t[58];let F;return t[59]!==A||t[60]!==j||t[61]!==P?(F=(0,Z.jsxs)(`div`,{className:A,children:[j,P]}),t[59]=A,t[60]=j,t[61]=P,t[62]=F):F=t[62],F}function ib(e){return(0,Z.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-lg px-3 py-2.5`,children:[(0,Z.jsx)(mo,{className:`size-3.5 rounded mt-0.5 shrink-0`}),(0,Z.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Z.jsx)(mo,{className:`h-3 w-28`}),(0,Z.jsx)(mo,{className:`h-3 w-40`})]})]},e)}function ab(e){return e.type===`checkpoint`}function ob(){return new Set}function sb(){return new Ui(32)}var cb=[{id:`outline`,label:`Outline`,icon:Ac},{id:`links`,label:`Links`,icon:w},{id:`graph`,label:`Graph`,icon:Mc},{id:`timeline`,label:`Timeline`,icon:rc}];function lb(){return n(()=>import(`./GraphPanel-BmKD3Ny9.js`),__vite__mapDeps([18,1,19,3,7,8,20,21,22,23,24,25,26,27,28,29,30,31]),import.meta.url)}var ub=(0,Q.lazy)(async()=>({default:(await lb()).GraphPanel})),db=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityModeContent-CKlljrfV.js`),__vite__mapDeps([32,1,2,33,34,35,20,36,37,38,39,19,3,7,8,4,10,9,40,41]),import.meta.url)).ActivityModeContent}));function fb(e){let t=(0,$.c)(13),{docName:n,isSourceMode:r,activeTab:i,onActiveTabChange:a,mode:o}=e,[s,c]=(0,Q.useState)(`unified`),l;t[0]!==i||t[1]!==o||t[2]!==a?(l=o===`doc`?(0,Z.jsx)(`div`,{className:`flex flex-row items-center justify-center gap-3 p-2`,children:(0,Z.jsx)($o,{type:`single`,variant:`outline`,value:i,onValueChange:e=>{e&&a(e)},"aria-label":`Document panels`,children:cb.map(pb)})}):null,t[0]=i,t[1]=o,t[2]=a,t[3]=l):l=t[3];let u;t[4]!==i||t[5]!==s||t[6]!==n||t[7]!==r||t[8]!==o?(u=o===`doc`?(0,Z.jsxs)(`div`,{role:`tabpanel`,id:`panel-${i}`,"aria-labelledby":`tab-${i}`,className:`min-h-0 flex-1`,children:[i===`outline`&&(0,Z.jsx)(Os,{docName:n,isSourceMode:r}),i===`links`&&(0,Z.jsx)(ny,{docName:n}),i===`graph`&&(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Loading graph`}),children:(0,Z.jsx)(ub,{activeDocName:n})}),i===`timeline`&&(0,Z.jsx)(rb,{docName:n,diffLayout:s,onDiffLayoutChange:c})]}):(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{role:`status`,"aria-busy":`true`,className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Loading agent activity`}),children:(0,Z.jsx)(db,{})})}),t[4]=i,t[5]=s,t[6]=n,t[7]=r,t[8]=o,t[9]=u):u=t[9];let d;return t[10]!==l||t[11]!==u?(d=(0,Z.jsxs)(Z.Fragment,{children:[l,u]}),t[10]=l,t[11]=u,t[12]=d):d=t[12],d}function pb(e){let{id:t,label:n,icon:r}=e;return(0,Z.jsxs)(jn,{children:[(0,Z.jsx)(Xo,{value:t,role:`tab`,id:`tab-${t}`,"aria-controls":`panel-${t}`,"aria-label":n,asChild:!0,children:(0,Z.jsx)(En,{children:(0,Z.jsx)(r,{})})}),(0,Z.jsx)(er,{side:`bottom`,children:n})]},t)}function mb(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function hb(e,t){let n=getComputedStyle(e.ownerDocument.body);return t*parseFloat(n.fontSize)}function gb(e){return e/100*window.innerHeight}function _b(e){return e/100*window.innerWidth}function vb(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function yb({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=vb(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=hb(t,i);break;case`em`:r=mb(t,i);break;case`vh`:r=gb(i);break;case`vw`:r=_b(i);break}return r}function bb(e){return parseFloat(e.toFixed(3))}function xb({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function Sb(e){let{panels:t}=e,n=xb({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=bb(yb({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=bb(yb({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=bb(yb({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=bb(yb({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function Cb(e,t=`Assertion error`){if(!e)throw Error(t)}function wb(e,t){return Array.from(t).sort(e===`horizontal`?Tb:Eb)}function Tb(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function Eb(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function Db(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function Ob(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function kb({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=Ob(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return Cb(i,`No rect found`),i}var Ab;function jb(){return Ab===void 0&&(Ab=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),Ab}function Mb(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=wb(n,Array.from(t.children).filter(Db).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,kb({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p;break}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=jb()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:xb({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var Nb=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},Pb=new Map,Fb=new Nb;function Ib(e){Pb=new Map(Pb),Pb.delete(e)}function Lb(e,t){for(let[t]of Pb)if(t.id===e)return t}function Rb(e,t){for(let[t,n]of Pb)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function zb(){return Pb}function Bb(e,t){return Fb.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function Vb(e,t){let n=Pb.get(e);Pb=new Map(Pb),Pb.set(e,t),Fb.emit(`groupChange`,{group:e,prev:n,next:t})}function Hb(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=Ob(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}function Ub(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Wb(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:Xb(e),b:Xb(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();Cb(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:Yb(Jb(n.a)),b:Yb(Jb(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var Gb=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Kb(e){let t=getComputedStyle(Zb(e)??e).display;return t===`flex`||t===`inline-flex`}function qb(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||Kb(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||Gb.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function Jb(e){let t=e.length;for(;t--;){let n=e[t];if(Cb(n,`Missing node`),qb(n))return n}return null}function Yb(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Xb(e){let t=[];for(;e;)t.push(e),e=Zb(e);return t}function Zb(e){let{parentNode:t}=e;return Ub(t)?t.host:t}function Qb(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function $b({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!Db(n)||n.contains(e)||e.contains(n))return!0;if(Wb(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(Qb(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function ex(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=Mb(r),a=Hb(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&$b({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function tx(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function nx(e,t,n=0){return Math.abs(bb(e)-bb(t))<=n}function rx(e,t){return nx(e,t)?0:e>t?1:-1}function ix({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(rx(r,c)<0)if(a){let e=(i+c)/2;r=rx(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=bb(r),r}function ax({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(nx(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;Cb(u!=null,`Invalid first pivot index`),Cb(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];Cb(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(Cb(n!=null,`Previous layout not found for panel index ${t}`),nx(n,i)){let t=o-n;rx(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];Cb(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(Cb(n!=null,`Previous layout not found for panel index ${t}`),nx(n,o)){let t=n-i;rx(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];Cb(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&rx(i,c)<0)if(e>0){let t=c-o,n=t/2;rx(i+e,c)<0&&(e=rx(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;rx(i-e,c)<0&&(e=rx(100+e,n)>0?0:-t)}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];Cb(e!=null,`Previous layout not found for panel index ${r}`);let a=ix({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];Cb(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=ix({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!nx(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(tx(c,l))return i;{let t=e<0?d:u,r=s[t];Cb(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=ix({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!nx(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];Cb(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=ix({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(nx(i,s)||(t-=s-i,l[r]=s),nx(t,0))break;e>0?r--:r++}}}if(!nx(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function ox(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||rx(e[n],t[n])!==0)return!1;return!0}function sx({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!nx(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];Cb(t!=null,`No layout data found for index ${e}`),r[e]=100/i*t}let a=0;for(let e=0;e<t.length;e++){let i=n[e];Cb(i!=null,`No layout data found for index ${e}`);let o=r[e];Cb(o!=null,`No layout data found for index ${e}`);let s=ix({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!nx(a,0))for(let e=0;e<t.length;e++){let n=r[e];Cb(n!=null,`No layout data found for index ${e}`);let i=n+a,o=ix({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,nx(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function cx({groupId:e,panelId:t}){let n=()=>{let t=zb();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=e=>{let r=a();if(e===r)return;let{defaultLayoutDeferred:i,derivedPanelConstraints:o,group:s,groupSize:c,layout:l,separatorToPanels:u}=n(),d=s.panels.findIndex(e=>e.id===t),f=d===s.panels.length-1,p=sx({layout:ax({delta:f?r-e:e-r,initialLayout:l,panelConstraints:o,pivotIndices:f?[d-1,d]:[d,d+1],prevLayout:l,trigger:`imperative-api`}),panelConstraints:o});ox(l,p)||Vb(s,{defaultLayoutDeferred:i,derivedPanelConstraints:o,groupSize:c,layout:p,separatorToPanels:u})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),s=a();e&&s!==t&&(n.expandToSize=s,o(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:s}=i(),c=a();if(e&&c===t){let e=s.expandToSize??n;e===0&&(e=1),o(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&nx(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=xb({group:t});o(bb(yb({groupSize:a,panelElement:r,styleProp:e})/a*100))}}}function lx(e){e.defaultPrevented||ex(e,zb()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=cx({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function ux(e){let t=zb();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function dx({groupId:e}){let t=()=>{let t=zb();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=sx({layout:e,panelConstraints:r});return n?o:(ox(o,c)||Vb(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function fx(e,t){let n=ux(e),r=Rb(n.id,!0),i=n.separators.find(t=>t.element===e);Cb(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);Cb(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=dx({groupId:n.id}).getLayout(),c=sx({layout:ax({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});ox(s,c)||Vb(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels})}function px(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=ux(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&fx(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&fx(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&fx(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&fx(t,-5);break;case`End`:e.preventDefault(),fx(t,100);break;case`Enter`:{e.preventDefault();let n=ux(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=Rb(n.id,!0),o=n.separators.find(e=>e.element===t);Cb(o,`Matching separator not found`);let s=a.get(o);Cb(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(Cb(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];fx(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=ux(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);Cb(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),fx(t,-100);break}}var mx={cursorFlags:0,state:`inactive`},hx=new Nb;function gx(){return mx}function _x(e){return hx.addListener(`change`,e)}function vx(e){let t=mx,n={...mx};n.cursorFlags=e,mx=n,hx.emit(`change`,{prev:t,next:n})}function yx(e){let t=mx;mx=e,hx.emit(`change`,{prev:t,next:e})}function bx(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=zb(),n=ex(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),yx({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}var xx=e=>e,Sx=()=>{},Cx=1,wx=2,Tx=4,Ex=8,Dx=3,Ox=12,kx;function Ax(){return kx===void 0&&(kx=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(kx=!0)),kx}function jx({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(!(r===0&&i===0)){switch(n){case`active`:if(e&&Ax()){let t=(e&Cx)!==0,n=(e&wx)!==0,r=(e&Tx)!==0,i=(e&Ex)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}return Ax()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var Mx=new WeakMap;function Nx(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=Mx.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));let r=gx();switch(r.state){case`active`:case`hover`:{let e=jx({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}Mx.set(e,{prevStyle:t,styleSheet:n})}function Px({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=ax({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(ox(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?Cx:wx;break;case`vertical`:s|=d<0?Tx:Ex;break}}else Vb(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&Dx:c|=s&Dx,t.movementY===0?c|=o&Ox:c|=s&Ox,vx(c),Nx(e)}function Fx(e){let t=zb(),n=gx();switch(n.state){case`active`:Px({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function Ix(e){if(e.defaultPrevented)return;let t=gx(),n=zb();switch(t.state){case`active`:if(e.buttons===0){yx({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{let t=Rb(e.group.id,!0);Vb(e.group,t)});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}Px({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=ex(e,n);r.length===0?t.state!==`inactive`&&yx({cursorFlags:0,state:`inactive`}):yx({cursorFlags:0,hitRegions:r,state:`hover`}),Nx(e.currentTarget);break}}}function Lx(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(gx().state){case`hover`:yx({cursorFlags:0,state:`inactive`})}}function Rx(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=gx();switch(t.state){case`active`:yx({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(Nx(e.currentTarget),t.hitRegions.forEach(e=>{let t=Rb(e.group.id,!0);Vb(e.group,t)}),e.preventDefault())}}function zx(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=bb(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=bb((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function Bx(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=xb({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:bb(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function Vx(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Hx({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=bb(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e;break}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=bb((r[e]??0)/a*l);else{let e=bb(l/c.length);for(let t of c)u[t]=e}return u}function Ux(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var Wx=new Map;function Gx(e){let t=!0;Cb(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=xb({group:e});if(t===0)return;let n=Rb(e.id);if(!n)return;let r=Sb(e),i=n.defaultLayoutDeferred?zx(r):n.layout,a=sx({layout:Hx({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&ox(n.layout,a)&&Vx(n.derivedPanelConstraints,r)&&n.groupSize===t)return;Vb(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else Bx(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{Cb(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=xb({group:e}),s=Sb(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(Ux(e.panels,l)||(l=void 0));let u=sx({layout:e.mutableState.layouts[c]??l??zx(s),panelConstraints:s}),d=e.element.ownerDocument;Wx.set(d,(Wx.get(d)??0)+1);let f=new Map;return Mb(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),Vb(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{Cb(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,px)}),Wx.get(d)===1&&(d.addEventListener(`dblclick`,lx,!0),d.addEventListener(`pointerdown`,bx,!0),d.addEventListener(`pointerleave`,Fx),d.addEventListener(`pointermove`,Ix),d.addEventListener(`pointerout`,Lx),d.addEventListener(`pointerup`,Rx,!0)),function(){t=!1,Wx.set(d,Math.max(0,(Wx.get(d)??0)-1)),Ib(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,px)}),Wx.get(d)||(d.removeEventListener(`dblclick`,lx,!0),d.removeEventListener(`pointerdown`,bx,!0),d.removeEventListener(`pointerleave`,Fx),d.removeEventListener(`pointermove`,Ix),d.removeEventListener(`pointerout`,Lx),d.removeEventListener(`pointerup`,Rx,!0)),a.disconnect()}}function Kx(){let[e,t]=(0,Q.useState)({});return[e,(0,Q.useCallback)(()=>t({}),[])]}function qx(e){let t=(0,Q.useId)();return`${e??t}`}var Jx=typeof window<`u`?Q.useLayoutEffect:Q.useEffect;function Yx(e){let t=(0,Q.useRef)(e);return Jx(()=>{t.current=e},[e]),(0,Q.useCallback)((...e)=>t.current?.(...e),[t])}function Xx(...e){return Yx(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function Zx(e){let t=(0,Q.useRef)({...e});return Jx(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var Qx=(0,Q.createContext)(null);function $x(e,t){let n=(0,Q.useRef)({getLayout:()=>({}),setLayout:xx});(0,Q.useImperativeHandle)(t,()=>n.current,[]),Jx(()=>{Object.assign(n.current,dx({groupId:e}))})}function eS({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,Q.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=Yx(e=>{ox(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=Yx(e=>{ox(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e))}),_=qx(s),v=(0,Q.useRef)(null),[y,b]=Kx(),x=(0,Q.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),S=Xx(v,a);$x(_,o);let C=Yx((e,t)=>{let r=gx(),i=Lb(e),a=Rb(e);if(a){let e=!1;switch(r.state){case`active`:e=r.hitRegions.some(e=>e.group===i);break}return{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),w=Zx({defaultLayout:n,disableCursor:r}),T=(0,Q.useMemo)(()=>({get disableCursor(){return!!w.disableCursor},getPanelStyles:C,id:_,orientation:u,registerPanel:e=>{let t=x.current;return t.panels=wb(u,[...t.panels,e]),b(),()=>{t.panels=t.panels.filter(t=>t!==e),b()}},registerSeparator:e=>{let t=x.current;return t.separators=wb(u,[...t.separators,e]),b(),()=>{t.separators=t.separators.filter(t=>t!==e),b()}},updatePanelProps:(e,{disabled:t})=>{let n=x.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=Lb(_),i=Rb(_);r&&i&&Vb(r,{...i,derivedPanelConstraints:Sb(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=x.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[C,_,b,u,w]),E=(0,Q.useRef)(null);return Jx(()=>{let e=v.current;if(e===null)return;let t=x.current,n;if(w.defaultLayout!==void 0&&Object.keys(w.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=w.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!w.disableCursor,expandedPanelSizes:x.current.lastExpandedPanelSizes,layouts:x.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};E.current=r;let a=Gx(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=Rb(r.id,!0);!o&&s.length>0&&(h(c),g(c));let l=Bb(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=nx(t.collapsedSize,i[t.panelId]),a=nx(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=gx().state!==`active`;h(i),o&&g(i)});return()=>{E.current=null,a(),l()}},[i,_,g,h,u,y,w]),(0,Q.useEffect)(()=>{let e=E.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,Z.jsx)(Qx.Provider,{value:T,children:(0,Z.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:S,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}eS.displayName=`Group`;function tS(){let e=(0,Q.useContext)(Qx);return Cb(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function nS(e,t){let{id:n}=tS(),r=(0,Q.useRef)({collapse:Sx,expand:Sx,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Sx});(0,Q.useImperativeHandle)(t,()=>r.current,[]),Jx(()=>{Object.assign(r.current,cx({groupId:n,panelId:e}))})}function rS({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=qx(c),_=Zx({disabled:a}),v=(0,Q.useRef)(null),y=Xx(v,o),{getPanelStyles:b,id:x,orientation:S,registerPanel:C,updatePanelProps:w}=tS(),T=d!==null,E=Yx((e,t,n)=>{d?.(e,c,n)});Jx(()=>{let e=v.current;if(e!==null)return C({element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:T?E:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}})},[s,n,r,i,T,g,h,l,u,E,C,_]),(0,Q.useEffect)(()=>{w(g,{disabled:a})},[a,g,w]),nS(g,f);let D=()=>{let e=b(x,g);if(e)return JSON.stringify(e)},O=(0,Q.useSyncExternalStore)(e=>Bb(x,e),D,D),k;return k=O?JSON.parse(O):i?{flexGrow:void 0,flexShrink:void 0,flexBasis:i}:{flexGrow:1},(0,Z.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:y,style:{...iS,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...k},children:(0,Z.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:S===`horizontal`?`pan-y`:`pan-x`},children:e})})}rS.displayName=`Panel`;var iS={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function aS(){return(0,Q.useRef)(null)}function oS({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=sx({layout:ax({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=sx({layout:ax({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function sS({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=qx(a),l=Zx({disabled:n,disableDoubleClick:r}),[u,d]=(0,Q.useState)({}),[f,p]=(0,Q.useState)(`inactive`),m=(0,Q.useRef)(null),h=Xx(m,i),{disableCursor:g,id:_,orientation:v,registerSeparator:y,updateSeparatorProps:b}=tS(),x=v===`horizontal`?`vertical`:`horizontal`;Jx(()=>{let e=m.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=y(t),r=_x(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=Bb(_,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);d(oS({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[_,c,y,l]),(0,Q.useEffect)(()=>{b(c,{disabled:n,disableDoubleClick:r})},[n,r,c,b]);let S;return n&&!g&&(S=`not-allowed`),(0,Z.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":x,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":n?`disabled`:f,"data-testid":c,id:c,ref:h,role:`separator`,style:{flexBasis:`auto`,cursor:S,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}sS.displayName=`Separator`;var cS={name:`toml`,startState:function(){return{inString:!1,stringType:``,lhs:!0,inArray:0}},token:function(e,t){let n;if(!t.inString&&(n=e.match(/^('''|"""|'|")/))&&(t.stringType=n[0],t.inString=!0),e.sol()&&!t.inString&&t.inArray===0&&(t.lhs=!0),t.inString){for(;t.inString;)if(e.match(t.stringType))t.inString=!1;else if(e.peek()===`\\`)e.next(),e.next();else if(e.eol())break;else e.match(/^.[^\\\"\']*/);return t.lhs?`property`:`string`}else if(t.inArray&&e.peek()===`]`)return e.next(),t.inArray--,`bracket`;else if(t.lhs&&e.peek()===`[`&&e.skipTo(`]`))return e.next(),e.peek()===`]`&&e.next(),`atom`;else if(e.peek()===`#`)return e.skipToEnd(),`comment`;else if(e.eatSpace())return null;else if(t.lhs&&e.eatWhile(function(e){return e!=`=`&&e!=` `}))return`property`;else if(t.lhs&&e.peek()===`=`)return e.next(),t.lhs=!1,null;else if(!t.lhs&&e.match(/^\d\d\d\d[\d\-\:\.T]*Z/))return`atom`;else if(!t.lhs&&(e.match(`true`)||e.match(`false`)))return`atom`;else if(!t.lhs&&e.peek()===`[`)return t.inArray++,e.next(),`bracket`;else if(!t.lhs&&e.match(/^\-?\d+(?:\.\d+)?/))return`number`;else e.eatSpace()||e.next();return null},languageData:{commentTokens:{line:`#`}}},lS=de({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),uS=Lt({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}});function dS(e){switch(e.toLowerCase()){case`json`:return Ds().language;case`toml`:return Cs.define(cS);default:return null}}function fS(e){let t=(0,$.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={status:`loading`},t[0]=n):n=t[0];let[r,i]=(0,Q.useState)(n),a,o;return t[1]===e?(a=t[2],o=t[3]):(a=()=>{let t=!1,n=new AbortController;return i({status:`loading`}),fetch(e,{credentials:`same-origin`,signal:n.signal}).then(pS).then(e=>{t||i({status:`loaded`,content:e})}).catch(e=>{t||e instanceof Error&&e.name===`AbortError`||i({status:`error`,message:e instanceof Error?e.message:`Failed to load file`})}),()=>{t=!0,n.abort()}},o=[e],t[1]=e,t[2]=a,t[3]=o),(0,Q.useEffect)(a,o),r}async function pS(e){if(!e.ok)throw Error(`Failed to load file (HTTP ${e.status})`);return e.text()}function mS(e){let t=(0,$.c)(27),{src:n,fileName:r,extension:i}=e,a=(0,Q.useRef)(null),o=(0,Q.useRef)(null),{resolvedTheme:s}=Gr(),c=fS(n),l=c.status===`loaded`?c.content:null,u,d;if(t[0]!==i||t[1]!==l||t[2]!==s?(u=()=>{if(!a.current||l===null)return;let e=dS(i),t=s===`dark`?lS:uS,n=[As,...e?[e]:[],ys.editable.of(!1),ls.readOnly.of(!0),ys.lineWrapping,t],r=new ys({state:ls.create({doc:l,extensions:n}),parent:a.current});return o.current=r,()=>{r.destroy(),o.current=null}},d=[l,i,s],t[0]=i,t[1]=l,t[2]=s,t[3]=u,t[4]=d):(u=t[3],d=t[4]),(0,Q.useEffect)(u,d),c.status===`loading`){let e;t[5]===r?e=t[6]:(e=(0,Z.jsxs)(`span`,{children:[`Loading `,r]}),t[5]=r,t[6]=e);let n;return t[7]!==i||t[8]!==r||t[9]!==e?(n=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center bg-background text-muted-foreground text-sm`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`loading`,"data-text-viewer-extension":i,children:e}),t[7]=i,t[8]=r,t[9]=e,t[10]=n):n=t[10],n}if(c.status===`error`){let e;t[11]===r?e=t[12]:(e=(0,Z.jsxs)(`div`,{className:`font-medium text-sm`,children:[`Couldn't load `,r]}),t[11]=r,t[12]=e);let a;t[13]===c.message?a=t[14]:(a=(0,Z.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:c.message}),t[13]=c.message,t[14]=a);let o;t[15]===n?o=t[16]:(o=(0,Z.jsx)(`a`,{href:n,className:`mt-2 rounded-md border px-3 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground`,children:`Open file`}),t[15]=n,t[16]=o);let s;return t[17]!==i||t[18]!==r||t[19]!==e||t[20]!==a||t[21]!==o?(s=(0,Z.jsxs)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center gap-2 bg-background p-4 text-center`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`error`,"data-text-viewer-extension":i,children:[e,a,o]}),t[17]=i,t[18]=r,t[19]=e,t[20]=a,t[21]=o,t[22]=s):s=t[22],s}let f;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(`div`,{ref:a,className:`min-h-0 flex-1 overflow-auto`}),t[23]=f):f=t[23];let p;return t[24]!==i||t[25]!==r?(p=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`loaded`,"data-text-viewer-extension":i,children:f}),t[24]=i,t[25]=r,t[26]=p):p=t[26],p}function hS(e){return xi(`/api/asset?path=${encodeURIComponent(e)}`)}function gS(e){return`/api/asset-text?path=${encodeURIComponent(e)}`}function _S(e){let t=(0,$.c)(28),{assetPath:n,mediaKind:r}=e,[i,a]=(0,Q.useState)(!1),s;t[0]===n?s=t[1]:(s=hS(n),t[0]=n,t[1]=s);let c=s,l;t[2]===n?l=t[3]:(l=n.split(`/`).pop()??n,t[2]=n,t[3]=l);let u=l,d,f,p;if(t[4]!==n||t[5]!==u||t[6]!==i||t[7]!==r||t[8]!==c){p=Symbol.for(`react.early_return_sentinel`);bb0:{let e=u.includes(`.`)?u.split(`.`).pop()??``:``;if(f=e.length>0?e.toUpperCase():`FILE`,d=i?`text`:r,d===`pdf`){let e;t[12]!==u||t[13]!==c?(e=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,Z.jsx)(Me,{src:c,title:u,fillContainer:!0})}),t[12]=u,t[13]=c,t[14]=e):e=t[14];let n;t[15]!==u||t[16]!==e?(n=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":u,children:e}),t[15]=u,t[16]=e,t[17]=n):n=t[17],p=n;break bb0}if(d===`text`){let r;t[18]===n?r=t[19]:(r=gS(n),t[18]=n,t[19]=r),p=(0,Z.jsx)(mS,{src:r,fileName:u,extension:e.toLowerCase()},n);break bb0}}t[4]=n,t[5]=u,t[6]=i,t[7]=r,t[8]=c,t[9]=d,t[10]=f,t[11]=p}else d=t[9],f=t[10],p=t[11];if(p!==Symbol.for(`react.early_return_sentinel`))return p;let m;t[20]!==d||t[21]!==f||t[22]!==u||t[23]!==c?(m=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto p-4`,children:d===`image`?(0,Z.jsx)(o,{src:c,alt:u,draggable:!1,slotClassName:`flex h-full w-full items-center justify-center`,className:`max-h-full max-w-full`}):d===`video`?(0,Z.jsx)(`video`,{src:c,controls:!0,className:`max-h-full max-w-full`}):d===`audio`?(0,Z.jsx)(`audio`,{src:c,controls:!0,className:`w-full max-w-md`}):(0,Z.jsxs)(`div`,{className:`flex max-w-sm flex-col items-center gap-3 text-center`,children:[(0,Z.jsx)(`div`,{className:`flex size-16 items-center justify-center rounded-md border bg-muted font-medium text-muted-foreground text-sm`,children:f}),(0,Z.jsx)(`div`,{className:`max-w-full break-words font-medium text-sm`,children:u}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[(0,Z.jsx)(Y,{asChild:!0,variant:`outline`,size:`sm`,children:(0,Z.jsx)(`a`,{href:c,children:`Open file`})}),(0,Z.jsx)(Y,{variant:`outline`,size:`sm`,onClick:()=>a(!0),"data-testid":`asset-preview-open-as-text`,children:`Open with built-in text editor`})]})]})}),t[20]=d,t[21]=f,t[22]=u,t[23]=c,t[24]=m):m=t[24];let h;return t[25]!==u||t[26]!==m?(h=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":u,children:m}),t[25]=u,t[26]=m,t[27]=h):h=t[27],h}function vS(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`div`,{className:`tiptap-editor pt-10`,role:`status`,"aria-busy":`true`,"aria-label":`Loading document`,children:(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(mo,{className:`h-9 w-2/5 mt-6 mb-5`}),(0,Z.jsx)(mo,{className:`h-4 w-full`}),(0,Z.jsx)(mo,{className:`h-4 w-3/4`})]})}),e[0]=t):t=e[0],t}var yS={"claude-cowork":`claude`,"claude-code":`claude`,codex:`openai`,cursor:`cursor`};function bS(e){let t=(0,$.c)(23),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({id:r,style:a,className:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let{resolvedTheme:o}=Gr(),s=yS[r],c=s?(o===`dark`?vr[s]:void 0)??xr[s]:void 0,l;t[5]!==c||t[6]!==a?(l=c?{...a,"--ok-brand-color":c}:a,t[5]=c,t[6]=a,t[7]=l):l=t[7];let u=l,d=c&&`[&_*]:![color:var(--ok-brand-color)]`,f;t[8]!==n||t[9]!==d?(f=Di(d,n),t[8]=n,t[9]=d,t[10]=f):f=t[10];let p=f;if(r===`claude-cowork`||r===`claude-code`){let e;return t[11]!==p||t[12]!==u||t[13]!==i?(e=(0,Z.jsx)(Vi,{style:u,className:p,...i}),t[11]=p,t[12]=u,t[13]=i,t[14]=e):e=t[14],e}if(r===`codex`){let e;return t[15]!==p||t[16]!==u||t[17]!==i?(e=(0,Z.jsx)(Bi,{style:u,className:p,...i}),t[15]=p,t[16]=u,t[17]=i,t[18]=e):e=t[18],e}if(r===`cursor`){let e;return t[19]!==p||t[20]!==u||t[21]!==i?(e=(0,Z.jsx)(qi,{style:u,className:p,...i}),t[19]=p,t[20]=u,t[21]=i,t[22]=e):e=t[22],e}return null}function xS(e){let{installState:t}=e;return t.installed===null?`Detecting`:t.installed===!1?`Not installed`:null}function SS(e){let{target:t,installState:n}=e;if(n.installed===null)return{enabled:!1,tooltip:null};if(n.installed===!1){let e=t.appBrandName??t.displayName;return{enabled:!1,tooltip:{message:`Requires ${e}.`,installAction:{label:`Install ${e} →`,url:t.installUrl},...t.hasWebFallback?{webFallback:{label:`Open in claude.ai →`,url:``}}:{}}}}return{enabled:!0,tooltip:null}}function CS(e){return di(e)}function wS(e){return`Opened ${e} in your browser.`}var TS=`claude.ai`;async function ES(e,t=Mh){(await t(di(e))).ok?X.success(wS(TS)):X.error(`Couldn't open ${TS} in your browser.`)}function DS(e){let t=(0,$.c)(73),{target:n,installState:r,isElectronHost:i,prompt:a,onSelect:o}=e,s=e.openExternal??Mh,c=e.onWebFallbackSuccess??kS,l=e.onWebFallbackError??OS,u;t[0]!==r||t[1]!==i||t[2]!==n?(u=SS({target:n,installState:r,isElectronHost:i}),t[0]=r,t[1]=i,t[2]=n,t[3]=u):u=t[3];let d=u,f;t[4]!==r||t[5]!==i||t[6]!==n?(f=xS({target:n,installState:r,isElectronHost:i}),t[4]=r,t[5]=i,t[6]=n,t[7]=f):f=t[7];let p=f,m;t[8]!==s||t[9]!==d.tooltip?(m=()=>{d.tooltip&&s(d.tooltip.installAction.url)},t[8]=s,t[9]=d.tooltip,t[10]=m):m=t[10];let h=m,g;t[11]!==l||t[12]!==c||t[13]!==s||t[14]!==a||t[15]!==n?(g=()=>{(async()=>{let e=await s(CS(a));e.ok?c(n):l(n,e.detail??e.reason)})()},t[11]=l,t[12]=c,t[13]=s,t[14]=a,t[15]=n,t[16]=g):g=t[16];let _=g;if(d.enabled){let e=`open-in-agent-item-${n.id}`,r=`Open with AI ${n.displayName}`,i;t[17]===n.id?i=t[18]:(i=(0,Z.jsx)(bS,{id:n.id,"aria-hidden":`true`}),t[17]=n.id,t[18]=i);let a;t[19]===n.displayName?a=t[20]:(a=(0,Z.jsx)(`span`,{children:n.displayName}),t[19]=n.displayName,t[20]=a);let s;return t[21]!==o||t[22]!==e||t[23]!==r||t[24]!==i||t[25]!==a?(s=(0,Z.jsxs)(Aa,{onSelect:o,"data-testid":e,"aria-label":r,children:[i,a]}),t[21]=o,t[22]=e,t[23]=r,t[24]=i,t[25]=a,t[26]=s):s=t[26],s}if(!d.tooltip){let e=p?`Open with AI ${n.displayName}, ${p}`:`Open with AI ${n.displayName}`,r=`open-in-agent-item-${n.id}`,i;t[27]===n.id?i=t[28]:(i=(0,Z.jsx)(bS,{id:n.id,"aria-hidden":`true`}),t[27]=n.id,t[28]=i);let a;t[29]===n.displayName?a=t[30]:(a=(0,Z.jsx)(`span`,{className:`flex-1`,children:n.displayName}),t[29]=n.displayName,t[30]=a);let o;t[31]===p?o=t[32]:(o=p?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:p}):null,t[31]=p,t[32]=o);let s;return t[33]!==e||t[34]!==r||t[35]!==i||t[36]!==a||t[37]!==o?(s=(0,Z.jsxs)(Aa,{disabled:!0,"data-testid":r,"aria-label":e,children:[i,a,o]}),t[33]=e,t[34]=r,t[35]=i,t[36]=a,t[37]=o,t[38]=s):s=t[38],s}let v=p?`Open with AI ${n.displayName}, ${p}`:`Open with AI ${n.displayName}`,y=`open-in-agent-item-${n.id}`,b;t[39]===n.id?b=t[40]:(b=(0,Z.jsx)(bS,{id:n.id,"aria-hidden":`true`,className:`mr-2`}),t[39]=n.id,t[40]=b);let x;t[41]===n.displayName?x=t[42]:(x=(0,Z.jsx)(`span`,{className:`flex-1`,children:n.displayName}),t[41]=n.displayName,t[42]=x);let S;t[43]===p?S=t[44]:(S=p?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:p}):null,t[43]=p,t[44]=S);let C;t[45]!==v||t[46]!==y||t[47]!==b||t[48]!==x||t[49]!==S?(C=(0,Z.jsxs)(Ma,{"data-testid":y,"data-row-disabled":``,"aria-label":v,children:[b,x,S]}),t[45]=v,t[46]=y,t[47]=b,t[48]=x,t[49]=S,t[50]=C):C=t[50];let w=`open-in-agent-submenu-${n.id}`,T=`open-in-agent-message-${n.id}`,E;t[51]!==d.tooltip.message||t[52]!==T?(E=(0,Z.jsx)(ua,{className:`font-normal text-muted-foreground text-xs`,"data-testid":T,children:d.tooltip.message}),t[51]=d.tooltip.message,t[52]=T,t[53]=E):E=t[53];let D;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(ma,{}),t[54]=D):D=t[54];let O=`open-in-agent-install-${n.id}`,k;t[55]===d.tooltip.installAction.label?k=t[56]:(k=(0,Z.jsx)(`span`,{children:d.tooltip.installAction.label}),t[55]=d.tooltip.installAction.label,t[56]=k);let A;t[57]!==h||t[58]!==O||t[59]!==k?(A=(0,Z.jsx)(Aa,{onSelect:h,"data-testid":O,children:k}),t[57]=h,t[58]=O,t[59]=k,t[60]=A):A=t[60];let j;t[61]!==_||t[62]!==d.tooltip.webFallback||t[63]!==n.id?(j=d.tooltip.webFallback?(0,Z.jsxs)(Aa,{onSelect:_,"data-testid":`open-in-agent-web-fallback-${n.id}`,"aria-label":`${d.tooltip.webFallback.label}, opens in browser with prompt pre-filled`,children:[(0,Z.jsx)(`span`,{className:`flex-1`,children:d.tooltip.webFallback.label}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:`opens in browser with prompt pre-filled`})]}):null,t[61]=_,t[62]=d.tooltip.webFallback,t[63]=n.id,t[64]=j):j=t[64];let M;t[65]!==E||t[66]!==A||t[67]!==j||t[68]!==w?(M=(0,Z.jsxs)(pa,{className:`min-w-[260px]`,"data-testid":w,children:[E,D,A,j]}),t[65]=E,t[66]=A,t[67]=j,t[68]=w,t[69]=M):M=t[69];let N;return t[70]!==M||t[71]!==C?(N=(0,Z.jsxs)(oo,{children:[C,M]}),t[70]=M,t[71]=C,t[72]=N):N=t[72],N}function OS(){}function kS(){}function AS(e){let t=(0,$.c)(12),{className:n}=e,{states:r,refresh:i}=sg(),{dispatch:a}=Xh(),o=ch(),s,c;if(t[0]!==n||t[1]!==a||t[2]!==i||t[3]!==r||t[4]!==o){let e=Rh({workspace:o});t[7]===n?s=t[8]:(s=Di(`grid w-full max-w-5xl gap-4 sm:grid-cols-3`,n),t[7]=n,t[8]=s),c=eh.map(t=>{let n=r[t.id]?.installed,o=n===!0?`installed`:n===!1?`missing`:`pending`;return(0,Z.jsx)(jS,{target:t,status:o,onOpen:o===`installed`&&e!==null?()=>{a(t.id,e)}:void 0,onInstall:()=>{Bh(t),i()}},t.id)}),t[0]=n,t[1]=a,t[2]=i,t[3]=r,t[4]=o,t[5]=s,t[6]=c}else s=t[5],c=t[6];let l;return t[9]!==s||t[10]!==c?(l=(0,Z.jsx)(`div`,{className:s,children:c}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function jS(e){let t=(0,$.c)(22),{target:n,status:r,onOpen:i,onInstall:a}=e,o=r===`installed`?i:r===`missing`?a:void 0,s=r===`pending`||r===`installed`&&i===void 0,c=r===`installed`?`Open`:r===`missing`?`Install`:`Checking`,l;t[0]===n.id?l=t[1]:(l=(0,Z.jsx)(bS,{id:n.id,"aria-hidden":`true`,className:`size-4`}),t[0]=n.id,t[1]=l);let u;t[2]===n.displayName?u=t[3]:(u=(0,Z.jsx)(`h3`,{className:`text-sm font-medium leading-tight`,children:n.displayName}),t[2]=n.displayName,t[3]=u);let d;t[4]!==l||t[5]!==u?(d=(0,Z.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start sm:items-center gap-2`,children:[l,u]}),t[4]=l,t[5]=u,t[6]=d):d=t[6];let f;t[7]===n.tagline?f=t[8]:(f=n.tagline?(0,Z.jsx)(`p`,{className:`text-1sm leading-relaxed text-muted-foreground`,children:n.tagline}):null,t[7]=n.tagline,t[8]=f);let p;t[9]!==d||t[10]!==f?(p=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[d,f]}),t[9]=d,t[10]=f,t[11]=p):p=t[11];let m;t[12]===r?m=t[13]:(m=r===`missing`?(0,Z.jsx)(wo,{"aria-hidden":`true`,className:`size-3`}):null,t[12]=r,t[13]=m);let h;t[14]!==c||t[15]!==m?(h=(0,Z.jsxs)(`p`,{className:`mt-auto inline-flex items-center gap-1 pt-2 font-mono text-2xs uppercase tracking-wider text-muted-foreground`,children:[c,m]}),t[14]=c,t[15]=m,t[16]=h):h=t[16];let g;return t[17]!==s||t[18]!==o||t[19]!==p||t[20]!==h?(g=(0,Z.jsxs)(`button`,{type:`button`,onClick:o,disabled:s,className:`group flex h-full flex-col items-start gap-4 rounded-2xl border border-border/60 bg-card p-5 text-left transition-[border-color,box-shadow,transform] hover:border-border hover:shadow-sm focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:cursor-not-allowed disabled:opacity-60`,children:[p,h]}),t[17]=s,t[18]=o,t[19]=p,t[20]=h,t[21]=g):g=t[21],g}var MS=3100,NS=3;function PS(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??NS;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var FS={0:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},1:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},2:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},3:{count:16,startRadius:11,baseDistance:7,distanceVariance:3,sizeMin:.45,sizeMax:1.2,maxDelay:500,durationMin:1100,durationMax:2400}},IS=[`var(--color-azure-blue)`,`var(--color-sky-blue)`,`var(--color-violet-300)`,`var(--color-orange-light)`,`var(--color-crystal-blue)`,`var(--color-white-cream)`];function LS(e,t={}){let n=t.rng??Math.random,r=t.colors??IS,i=FS[e];if(i.count===0||r.length===0)return[];let a=[],o=Math.PI*2/i.count;for(let e=0;e<i.count;e++){let t=e*o+(n()-.5)*o*.7,s=i.baseDistance+(n()-.5)*2*i.distanceVariance,c=i.sizeMin+n()*(i.sizeMax-i.sizeMin),l=n()*i.maxDelay,u=i.durationMin+n()*(i.durationMax-i.durationMin),d=Math.floor(n()*r.length),f=Math.cos(t),p=Math.sin(t);a.push({id:e,dx:f*s,dy:p*s,originDx:f*i.startRadius,originDy:p*i.startRadius,size:c,color:r[d]??`currentColor`,delay:l,duration:u})}return a}var RS=1.8,zS=90,BS=16,VS=380,HS=.025,US=.1,WS=.18,GS=400,KS=9.2736,qS=18.1799,JS=14.5244,YS={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function XS(e,t){let{halfWidth:n,apexLift:r}=YS[t];return`M${e-n} ${JS+.3} Q${e} ${JS-r}, ${e+n} ${JS+.3}`}function ZS(e){let t=1.5,n=.3;return`M${e-t} ${JS-n} Q${e} ${JS+1.4}, ${e+t} ${JS-n}`}var QS=15,$S=15;function eC(e){return{fill:e.color,"--fx-tx":`${e.dx}px`,"--fx-ty":`${e.dy}px`,"--fx-delay":`${e.delay}ms`,"--fx-duration":`${e.duration}ms`}}function tC(e){let t=(0,$.c)(71),{size:n,className:r,trackMouse:i,variant:a,celebrateSignal:o}=e,s=n===void 0?48:n,c=i===void 0?!0:i,l=a===void 0?`default`:a,u=o===void 0?0:o,d=(0,Q.useRef)(null),f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m={x:0,y:0},t[0]=m):m=t[0];let h=(0,Q.useRef)(m),[g,_]=(0,Q.useState)(0),[v,y]=(0,Q.useState)(0),b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],t[1]=b):b=t[1];let[x,S]=(0,Q.useState)(b),C=(0,Q.useRef)(0),w=(0,Q.useRef)(void 0),T=l===`sleeping`,E;t[2]!==g||t[3]!==T?(E=function(){if(T)return;let e=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),t=C.current===0?1/0:e-C.current;C.current=e;let n=PS(g,t);_(n),y(aC),S(LS(n)),clearTimeout(w.current),w.current=setTimeout(()=>{_(0),S([])},MS)},t[2]=g,t[3]=T,t[4]=E):E=t[4];let D=E,O,k;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>()=>clearTimeout(w.current),k=[],t[5]=O,t[6]=k):(O=t[5],k=t[6]),(0,Q.useEffect)(O,k);let A,j;t[7]!==u||t[8]!==T?(A=()=>{u===0||T||(_(3),y(iC),S(LS(3)),clearTimeout(w.current),w.current=setTimeout(()=>{_(0),S([])},MS))},j=[u,T],t[7]=u,t[8]=T,t[9]=A,t[10]=j):(A=t[9],j=t[10]),(0,Q.useEffect)(A,j);let M,N;t[11]!==T||t[12]!==c?(M=()=>{if(!c||T||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=0,t=0,n=!1,r=0,i=0,a=0,o=0,s=0,l=function(){s===0&&(s=requestAnimationFrame(m))},u=function(r){e=r.clientX,t=r.clientY,n=!0,l()};function m(){s=0;let c=f.current,u=d.current;if(!c||!u){l();return}let m=n;n=!1;let g=c.getBoundingClientRect(),_=g.left+g.width/2,v=g.top+g.height*.48,y=e-_,b=t-v,x=Math.hypot(y,b),S=Math.max(-1,Math.min(1,y/VS)),C=Math.max(-1,Math.min(1,b/VS)),w=S*BS,T=-C*BS,E=0,D=0;if(x>=1){let e=Math.min(x/zS,1)*RS;E=y/x*e,D=b/x*e}let O=Math.abs(T-r)<.01&&Math.abs(w-i)<.01&&Math.abs(E-a)<.01&&Math.abs(D-o)<.01;if(!m&&O)return;l(),r+=(T-r)*US,i+=(w-i)*US,u.style.transform=`perspective(${GS}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(E-a)*WS,o+=(D-o)*WS;let k=i*HS,A=-r*HS,j=a+k,M=o+A;h.current.x=j,h.current.y=M,p.current?.setAttribute(`transform`,`translate(${j.toFixed(3)} ${M.toFixed(3)})`)}return document.addEventListener(`mousemove`,u,{passive:!0}),l(),()=>{document.removeEventListener(`mousemove`,u),s!==0&&cancelAnimationFrame(s),s=0,d.current&&(d.current.style.transform=``),h.current={x:0,y:0},p.current?.removeAttribute(`transform`)}},N=[c,T],t[11]=T,t[12]=c,t[13]=M,t[14]=N):(M=t[13],N=t[14]),(0,Q.useEffect)(M,N);let P;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>{let e=p.current;if(!e)return;let{x:t,y:n}=h.current;e.setAttribute(`transform`,`translate(${t.toFixed(3)} ${n.toFixed(3)})`)},t[15]=P):P=t[15],(0,Q.useLayoutEffect)(P);let F=g>0,I=F?g:1,L=F?`ok-blob-clicked-${g}`:null,R;t[16]===r?R=t[17]:(R=Di(`ok-blob-3d-wrapper`,r),t[16]=r,t[17]=R);let z=T?`cursor-default`:`cursor-pointer`,B=`body-${v}`,V=T&&`ok-blob-sleeping`,H;t[18]!==L||t[19]!==V?(H=Di(`ok-blob-group`,V,L),t[18]=L,t[19]=V,t[20]=H):H=t[20];let U;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(`path`,{d:`M25.2339 6.78134C25.5199 7.35734 25.8179 8.47234 26.0179 9.07834C26.0189 9.08234 26.0209 9.08634 26.0219 9.09134C26.0229 9.09534 26.0249 9.10034 26.0259 9.10434C26.0539 9.19734 26.0949 9.29533 26.1519 9.41633C26.2919 9.71133 26.5269 10.1173 27.1299 11.1683C27.3259 11.4643 27.5209 11.7693 27.7119 12.0903C29.9739 15.1623 29.3259 20.1913 27.0469 22.9153C26.7779 23.2953 26.4869 23.6043 26.1889 23.8863C26.1519 23.9253 26.1129 23.9643 26.0729 24.0033C25.3159 24.7543 24.2949 25.4673 23.6129 25.8323C22.7469 26.2983 22.1349 26.5483 21.6299 26.7463C20.3649 27.3063 19.0609 27.7733 17.6569 28.0423C15.9649 28.3513 14.1939 28.4433 12.4569 28.1373C11.4779 27.9663 10.5119 27.6663 9.60891 27.2493C8.77491 26.8663 7.99192 26.3853 7.26992 25.8403C6.83592 25.5393 6.43893 25.2343 6.08093 24.9383C5.57893 24.5223 5.15993 24.1263 4.83493 23.7793C4.04993 22.9443 3.31593 21.8893 2.80893 21.0953C2.72593 20.9663 2.64792 20.8433 2.57592 20.7293C2.56192 20.7093 2.54793 20.6893 2.53393 20.6703C2.08593 20.0263 1.71892 19.3293 1.43792 18.5993C1.42892 18.5453 1.42093 18.4903 1.41293 18.4353C1.32093 17.7443 1.08292 16.9423 1.01092 15.6333C0.984921 15.0653 0.998928 14.4013 1.12393 13.6353C1.20693 13.1413 1.31993 12.9023 1.40893 12.7113C1.43593 12.6543 1.46193 12.6023 1.48593 12.5483C1.56793 12.3653 1.59392 12.1563 1.63592 11.9083C1.68992 11.5883 1.76992 11.1943 2.04592 10.7553C2.94392 9.37934 3.36792 8.81934 3.66592 8.33934C3.75592 8.20334 3.84292 8.08134 3.94192 7.96634C4.21592 7.64634 4.67693 7.29534 5.10293 7.05734C5.16693 7.02234 5.23093 6.98834 5.29193 6.95534C5.62993 6.77834 6.22592 6.30135 6.66992 5.92035C6.83692 5.77635 7.08193 5.60735 7.37393 5.40935C7.67393 5.20535 8.02593 4.96934 8.39193 4.70234C9.32093 4.02634 9.84091 3.69134 10.2599 3.42334C10.3799 3.34734 10.4919 3.27734 10.6049 3.20834C10.9609 2.98834 11.4149 2.73034 11.8869 2.48634C12.4519 2.19334 13.0469 1.92133 13.5089 1.72233C14.7399 1.30233 16.0539 1.01333 17.4169 1.00033C18.1169 0.991333 18.7939 1.16534 19.2389 1.43034C19.6869 1.69534 19.8689 2.00335 19.8039 2.23935C19.7379 2.47835 19.4399 2.63634 19.0109 2.74734C18.5789 2.85634 18.0469 2.92035 17.4889 2.96135C16.3639 3.04235 15.2399 3.36435 14.1499 3.80835C12.8199 4.35135 11.5379 5.07133 10.2719 5.84733C9.38691 6.39133 8.51192 6.97334 7.63592 7.56834C7.54492 7.63034 7.45492 7.69135 7.36492 7.75235C6.97392 8.06635 6.58293 8.38134 6.22293 8.66334C5.97893 8.85734 5.76793 9.04834 5.59393 9.21434C5.26893 9.52334 5.02393 9.74334 4.81893 9.93934C4.67793 10.0753 4.55793 10.2013 4.45593 10.3443C4.40093 10.4213 4.32992 10.5273 4.24792 10.6593C3.90492 11.1933 3.44493 12.1693 3.15393 13.1173C3.01893 13.5363 2.87991 14.0343 2.79391 14.5253C2.66591 15.2253 2.65594 15.9053 2.71994 16.2373C2.82794 16.8193 2.95593 17.4833 3.14093 18.0553C3.31293 18.6003 3.52991 19.0583 3.70791 19.2823C3.81591 19.4183 3.90394 19.5473 3.99594 19.6913C4.09394 19.8413 4.19191 20.0073 4.31091 20.2033C4.47891 20.4803 4.68592 20.8163 5.00192 21.2493C5.36492 21.7463 5.61793 22.1043 5.83493 22.4023C6.14493 22.8243 6.38591 23.1343 6.83691 23.5033C7.33891 23.9113 7.86593 24.3113 8.26693 24.6393C8.44893 24.7883 8.66993 24.9443 8.90493 25.0963C9.21593 25.2963 9.55192 25.4893 9.85592 25.6703C10.1059 25.8203 10.3059 25.9633 10.4869 26.0863C10.5429 26.1243 10.5979 26.1603 10.6519 26.1943C10.8699 26.2803 11.0929 26.3593 11.3159 26.4283C11.3539 26.4323 11.3949 26.4353 11.4369 26.4393C11.6509 26.4573 11.9089 26.4733 12.2209 26.5133C12.7169 26.5753 13.1399 26.6603 13.6019 26.7243C13.9589 26.7733 14.3409 26.8083 14.7729 26.7893C15.0729 26.7753 15.4069 26.7353 15.7389 26.6813C16.2349 26.6023 16.7179 26.4943 17.0569 26.4473C17.1499 26.4343 17.2359 26.4343 17.3209 26.4373C17.3489 26.4393 17.3799 26.4413 17.4109 26.4433C17.4119 26.4433 17.4119 26.4433 17.4129 26.4433C17.4199 26.4433 17.4279 26.4443 17.4349 26.4443C18.2329 26.2413 19.0259 25.9433 19.7959 25.5983C19.8609 25.5633 19.9259 25.5273 19.9899 25.4913C20.3059 25.3173 20.6049 25.1383 20.7869 24.9943C20.9829 24.8393 21.5189 24.5373 22.0579 24.1853C22.4109 23.9553 22.7649 23.7053 23.0369 23.4833C23.1949 23.3553 23.3689 23.2693 23.5479 23.1773C23.7129 23.0923 23.8809 23.0013 24.0349 22.8653C24.1109 22.7983 24.1869 22.7173 24.2639 22.6303C24.3309 22.5563 24.4039 22.4723 24.4759 22.3923C24.5459 22.3153 24.7199 22.1723 24.9139 21.9793C25.0079 21.8863 25.1059 21.7783 25.1909 21.6713C25.2199 21.6323 25.2489 21.5943 25.2769 21.5553C25.5919 21.0403 25.8779 20.5003 26.1019 19.9653C26.1299 19.8403 26.1379 19.7293 26.1279 19.6373C26.1199 19.5703 26.1029 19.5113 26.0839 19.4503C26.0599 19.3643 26.0329 19.2773 26.0239 19.1723C26.0169 19.0893 26.0309 19.0043 26.0629 18.9543C26.0779 18.9323 26.0969 18.9143 26.1129 18.8993C26.1329 18.8823 26.1499 18.8673 26.1569 18.8443C26.1609 18.8273 26.1579 18.8073 26.1529 18.7833C26.1459 18.7443 26.1369 18.6943 26.1539 18.6293C26.2189 18.3853 26.2869 18.1103 26.3319 17.8383C26.3829 17.5393 26.4049 17.2433 26.3949 17.0123C26.3849 16.7493 26.3909 16.3823 26.3469 16.0003C26.3179 15.7343 26.2659 15.4663 26.1979 15.2383C26.1319 15.0143 26.0219 14.7913 25.9039 14.5783C25.7629 14.3223 25.6119 14.0783 25.5169 13.8453C25.4969 13.7983 25.4999 13.7263 25.4999 13.6323C25.5009 13.5673 25.4999 13.4913 25.4919 13.4083C25.3239 13.1243 25.1459 12.8423 24.9589 12.5483C24.9479 12.5413 24.9369 12.5333 24.9249 12.5263C24.6689 12.3503 24.3139 12.1173 24.0769 11.5503C24.0179 11.4063 24.0069 11.2983 23.9969 11.1993C23.9859 11.1013 23.9799 11.0183 23.9289 10.9093C23.8709 10.7853 23.7759 10.6583 23.6709 10.4993C23.5849 10.3703 23.4899 10.2133 23.4199 10.0423C23.3819 9.95134 23.3509 9.85734 23.3329 9.75934C23.3299 9.74334 23.3269 9.72534 23.3229 9.70634C23.2899 9.52734 23.2439 9.26534 23.2409 8.98634C23.0209 8.24434 22.8339 7.48833 22.6519 6.77633C22.3429 5.57133 22.0519 4.54234 21.3329 3.95434C20.9839 3.65334 20.5689 3.35433 20.2459 3.05433C19.9259 2.75633 19.7449 2.47534 19.8019 2.23834C19.8639 2.00634 20.1589 1.82934 20.6659 1.80534C21.1699 1.78334 21.8699 1.93235 22.5209 2.39235C23.6159 3.14235 24.2029 4.38334 24.5599 5.35734C24.5829 5.40834 24.6049 5.46034 24.6259 5.51234C24.7849 5.89434 24.9529 6.22834 25.1199 6.55534C25.1579 6.63034 25.1969 6.70834 25.2339 6.78134Z`,className:`ok-blob-body`}),t[21]=U):U=t[21];let W=(F||T)&&`ok-blob-eye-hidden`,G;t[22]===W?G=t[23]:(G=Di(`ok-blob-eye`,W),t[22]=W,t[23]=G);let ee;t[24]===G?ee=t[25]:(ee=(0,Z.jsx)(`ellipse`,{cx:KS,cy:JS,rx:1.2722,ry:1.9083,className:G}),t[24]=G,t[25]=ee);let te=(F||T)&&`ok-blob-eye-hidden`,ne;t[26]===te?ne=t[27]:(ne=Di(`ok-blob-eye ok-blob-eye-right`,te),t[26]=te,t[27]=ne);let re;t[28]===ne?re=t[29]:(re=(0,Z.jsx)(`ellipse`,{cx:qS,cy:JS,rx:1.2722,ry:1.9083,className:ne}),t[28]=ne,t[29]=re);let ie;t[30]===I?ie=t[31]:(ie=XS(KS,I),t[30]=I,t[31]=ie);let ae=(!F||T)&&`ok-blob-eye-hidden`,oe;t[32]===ae?oe=t[33]:(oe=Di(`ok-blob-happy-eye`,ae),t[32]=ae,t[33]=oe);let se;t[34]!==ie||t[35]!==oe?(se=(0,Z.jsx)(`path`,{d:ie,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:oe}),t[34]=ie,t[35]=oe,t[36]=se):se=t[36];let K;t[37]===I?K=t[38]:(K=XS(qS,I),t[37]=I,t[38]=K);let ce=(!F||T)&&`ok-blob-eye-hidden`,le;t[39]===ce?le=t[40]:(le=Di(`ok-blob-happy-eye`,ce),t[39]=ce,t[40]=le);let ue;t[41]!==K||t[42]!==le?(ue=(0,Z.jsx)(`path`,{d:K,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:le}),t[41]=K,t[42]=le,t[43]=ue):ue=t[43];let q;t[44]===T?q=t[45]:(q=T?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`path`,{d:ZS(KS),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,Z.jsx)(`path`,{d:ZS(qS),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[44]=T,t[45]=q);let de;t[46]!==ee||t[47]!==re||t[48]!==se||t[49]!==ue||t[50]!==q?(de=(0,Z.jsxs)(`g`,{ref:p,children:[ee,re,se,ue,q]}),t[46]=ee,t[47]=re,t[48]=se,t[49]=ue,t[50]=q,t[51]=de):de=t[51];let fe;t[52]!==B||t[53]!==H||t[54]!==de?(fe=(0,Z.jsxs)(`g`,{className:H,children:[U,de]},B),t[52]=B,t[53]=H,t[54]=de,t[55]=fe):fe=t[55];let pe;t[56]===T?pe=t[57]:(pe=T?(0,Z.jsxs)(`g`,{children:[(0,Z.jsx)(`text`,{x:21,y:7,className:`ok-blob-z ok-blob-z-1`,children:`z`}),(0,Z.jsx)(`text`,{x:26,y:2,className:`ok-blob-z ok-blob-z-2`,children:`z`})]}):null,t[56]=T,t[57]=pe);let me;t[58]!==v||t[59]!==x?(me=x.length>0&&(0,Z.jsx)(`g`,{children:x.map(nC)},`firework-${v}`),t[58]=v,t[59]=x,t[60]=me):me=t[60];let he;t[61]!==D||t[62]!==s||t[63]!==z||t[64]!==fe||t[65]!==pe||t[66]!==me?(he=(0,Z.jsxs)(`svg`,{ref:f,width:s,height:s,viewBox:`0 0 30 30`,fill:`none`,overflow:`visible`,xmlns:`http://www.w3.org/2000/svg`,className:z,"aria-hidden":`true`,onClick:D,onMouseDown:rC,children:[fe,pe,me]}),t[61]=D,t[62]=s,t[63]=z,t[64]=fe,t[65]=pe,t[66]=me,t[67]=he):he=t[67];let ge;return t[68]!==R||t[69]!==he?(ge=(0,Z.jsx)(`span`,{ref:d,className:R,children:he}),t[68]=R,t[69]=he,t[70]=ge):ge=t[70],ge}function nC(e){return(0,Z.jsx)(`circle`,{cx:QS+e.originDx,cy:$S+e.originDy,r:e.size,className:`ok-blob-firework`,style:eC(e)},e.id)}function rC(e){return e.preventDefault()}function iC(e){return e+1}function aC(e){return e+1}function oC(e){let t=(0,$.c)(12),{title:n,subtitle:r,celebrateSignal:i}=e,a;t[0]===i?a=t[1]:(a=(0,Z.jsx)(tC,{size:64,celebrateSignal:i}),t[0]=i,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,Z.jsx)(`h2`,{className:`text-2xl font-light tracking-tighter text-balance`,children:n}),t[2]=n,t[3]=o);let s;t[4]===r?s=t[5]:(s=r?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r}):null,t[4]=r,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex items-center gap-4`,children:[a,c]}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}function sC(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`kbd`,{"data-slot":`kbd`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function cC(){let e=(0,$.c)(2),t=Ti()?`⌘ K`:`Ctrl K`,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(sC,{children:t}),e[0]=n):n=e[0];let r;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[n,` `,(0,Z.jsx)(`span`,{children:`Search`})]}),e[1]=r):r=e[1],r}var lC=`open-knowledge:create-top-level-file`;function uC(){window.dispatchEvent(new CustomEvent(lC))}function dC(e){let t=()=>e();return window.addEventListener(lC,t),()=>window.removeEventListener(lC,t)}function fC(){let e=(0,$.c)(14),[t,n]=(0,Q.useState)(!1),[r,i]=(0,Q.useState)(void 0),[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(0),l=(0,Q.useRef)(!1),u=(0,Q.useRef)(void 0),d,f;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{let e=!1,t=async function(){try{let t=await fetch(`/api/documents`),n=await t.json().catch(gC);if(e)return;let r=t.ok?Mr.safeParse(n):null;r?.success?(o(_C(r.data.documents)),l.current=!0):l.current||=(o(1),!0)}catch{!e&&!l.current&&(o(1),l.current=!0)}};t();let n=Dr(e=>{e.includes(`files`)&&t()});return()=>{e=!0,n(),clearTimeout(u.current)}},f=[],e[0]=d,e[1]=f):(d=e[0],f=e[1]),(0,Q.useEffect)(d,f);let p;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=function(){clearTimeout(u.current),u.current=setTimeout(()=>c(hC),500),fetch(`/api/documents`).then(async e=>{let t=await e.json().catch(mC);if(!e.ok)return;let n=Mr.safeParse(t);n.success&&o(_C(n.data.documents))}).catch(pC)},e[2]=p):p=e[2];let m=p,h=a!==null,g=a===0,_;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=function(e){n(e),e||i(void 0)},e[3]=_):_=e[3];let v=_,y;e[4]!==s||e[5]!==g||e[6]!==h?(y=h?g?(0,Z.jsx)(vC,{celebrateSignal:s,onPackSelect:e=>{i(e),n(!0)}}):(0,Z.jsx)(yC,{celebrateSignal:s,onAddStarterPack:()=>{n(!0)}}):null,e[4]=s,e[5]=g,e[6]=h,e[7]=y):y=e[7];let b;e[8]!==r||e[9]!==t?(b=(0,Z.jsx)(Jm,{open:t,onOpenChange:v,onSeedApplied:m,initialPackId:r}),e[8]=r,e[9]=t,e[10]=b):b=e[10];let x;return e[11]!==y||e[12]!==b?(x=(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center overflow-y-auto px-6 subtle-scrollbar`,children:[y,b]}),e[11]=y,e[12]=b,e[13]=x):x=e[13],x}function pC(){}function mC(){return null}function hC(e){return e+1}function gC(){return null}function _C(e){return or(e).filter(e=>e.kind===`document`||e.kind===`folder`).length}function vC(e){let t=(0,$.c)(16),{celebrateSignal:n,onPackSelect:r}=e,{_:i}=Gt(),a;t[0]===i?a=t[1]:(a=i({id:`ZmGmNh`}),t[0]=i,t[1]=a);let o;t[2]===i?o=t[3]:(o=i({id:`W8uemY`}),t[2]=i,t[3]=o);let s;t[4]!==n||t[5]!==a||t[6]!==o?(s=(0,Z.jsx)(oC,{title:a,subtitle:o,celebrateSignal:n}),t[4]=n,t[5]=a,t[6]=o,t[7]=s):s=t[7];let c;t[8]===r?c=t[9]:(c=(0,Z.jsx)(zm,{onPackSelect:r}),t[8]=r,t[9]=c);let l;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(Y,{variant:`link`,className:`text-muted-foreground font-normal justify-end`,size:`sm`,onClick:uC,children:(0,Z.jsx)(qt,{id:`ensWZc`,components:{0:(0,Z.jsx)(_a,{"aria-hidden":`true`,className:`size-3`})}})}),t[10]=l):l=t[10];let u;t[11]===c?u=t[12]:(u=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-3`,children:[c,l]}),t[11]=c,t[12]=u);let d;return t[13]!==s||t[14]!==u?(d=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-10 py-12 max-w-5xl my-auto`,children:[s,u]}),t[13]=s,t[14]=u,t[15]=d):d=t[15],d}function yC(e){let t=(0,$.c)(19),{celebrateSignal:n,onAddStarterPack:r}=e,{_:i}=Gt(),a;t[0]===i?a=t[1]:(a=i({id:`8XS8nG`}),t[0]=i,t[1]=a);let o;t[2]===i?o=t[3]:(o=i({id:`GjElCU`}),t[2]=i,t[3]=o);let s;t[4]!==n||t[5]!==a||t[6]!==o?(s=(0,Z.jsx)(oC,{title:a,subtitle:o,celebrateSignal:n}),t[4]=n,t[5]=a,t[6]=o,t[7]=s):s=t[7];let c;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(AS,{}),t[8]=c):c=t[8];let l,u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(re,{"aria-hidden":`true`,className:`size-3`}),u=(0,Z.jsx)(qt,{id:`IajAbS`}),t[9]=l,t[10]=u):(l=t[9],u=t[10]);let d;t[11]===r?d=t[12]:(d=(0,Z.jsxs)(Y,{onClick:r,variant:`link`,size:`xs`,className:`font-mono text-2xs uppercase tracking-wider text-muted-foreground font-normal hover:text-foreground hover:no-underline`,children:[l,u]}),t[11]=r,t[12]=d);let f;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(cC,{}),t[13]=f):f=t[13];let p;t[14]===d?p=t[15]:(p=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-4`,children:[c,(0,Z.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-4`,children:[d,f]})]}),t[14]=d,t[15]=p);let m;return t[16]!==s||t[17]!==p?(m=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-10 py-12 max-w-5xl my-auto`,children:[s,p]}),t[16]=s,t[17]=p,t[18]=m):m=t[18],m}function bC(e){let t=(0,$.c)(74),{folderPath:n,state:r,onChange:i}=e,[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(null),[l,u]=(0,Q.useState)(null);if(r.status===`idle`||r.status===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card p-4 space-y-3`,children:[(0,Z.jsx)(SC,{}),(0,Z.jsx)(mo,{className:`h-7 w-full`}),(0,Z.jsx)(mo,{className:`h-7 w-full`}),(0,Z.jsx)(mo,{className:`h-7 w-full`})]}),t[0]=e):e=t[0],e}if(r.status===`error`){let e;return t[1]===r.message?e=t[2]:(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:[`Failed to load folder defaults: `,r.message]}),t[1]=r.message,t[2]=e),e}let d;t[3]===r.data.folder.frontmatter_defaults?d=t[4]:(d=r.data.folder.frontmatter_defaults??{},t[3]=r.data.folder.frontmatter_defaults,t[4]=d);let f=d,p;t[5]===r.data.frontmatterLocal?p=t[6]:(p=r.data.frontmatterLocal??{},t[5]=r.data.frontmatterLocal,t[6]=p);let m=p,h=r.data.frontmatterSources,g;t[7]===r.data.folder.path?g=t[8]:(g=xo(r.data.folder.path),t[7]=r.data.folder.path,t[8]=g);let _=g,v,y,b,x,S,C,w,T,E,D,O,k,A;if(t[9]!==s||t[10]!==a||t[11]!==_||t[12]!==n||t[13]!==m||t[14]!==f||t[15]!==i||t[16]!==l||t[17]!==h){let e=Object.keys(f),r=async function(e,t){let r=await yo(n,{[e]:t});if(!r.ok){X.error(`Save failed: ${r.error}`);return}i()},d=async function(e){let t=await yo(n,{[e]:null});if(!t.ok){X.error(`Remove failed: ${t.error}`);return}i()},p=function(e,t){let n=f[e];r(e,sa(n,t))},g;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(g=function(){c({name:``,type:`text`,value:``,error:null}),o(!1)},t[31]=g):g=t[31],b=g;let j;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(j=function(e){c(t=>{if(!t)return t;let n=e===`date`?new Date().toISOString().slice(0,10):Ea[e];return{...t,type:e,value:n,error:null}})},t[32]=j):j=t[32],S=j;let M;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(M=function(e){c(t=>t&&{...t,value:e})},t[33]=M):M=t[33],C=M;let N;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(N=function(e){c(t=>t&&{...t,name:e,error:null})},t[34]=N):N=t[34],x=N;let P;t[35]!==s||t[36]!==n||t[37]!==f||t[38]!==i?(P=async function(){if(!s)return;let e=s.name.trim();if(!e){c({...s,error:`Name is required`});return}if(Object.hasOwn(f,e)){c({...s,error:`Key "${e}" already resolves here`});return}let t=await yo(n,{[e]:s.value});if(!t.ok){c({...s,error:t.error});return}c(null),i()},t[35]=s,t[36]=n,t[37]=f,t[38]=i,t[39]=P):P=t[39],w=P;let F=function(e){u({key:e,draft:e,error:null})},I=function(e){u(t=>t&&{...t,draft:e,error:null})},L=async function(){if(!l)return;let e=l.draft.trim();if(!e){u({...l,error:`Name is required`});return}if(e===l.key){u(null);return}if(Object.hasOwn(f,e)){u({...l,error:`Key "${e}" already resolves here`});return}let t=f[l.key],r=await yo(n,{[l.key]:null,[e]:t});if(!r.ok){u({...l,error:r.error});return}u(null),i()},R=function(){u(null)};A=`rounded-lg border bg-card`,y=qo,D=!a,t[40]===Symbol.for(`react.memo_cache_sentinel`)?(O=e=>o(!e),t[40]=O):O=t[40];let z=`size-3 transition-transform ${a?``:`rotate-90`}`,B;t[41]===z?B=t[42]:(B=(0,Z.jsx)(Uo,{className:z,"aria-hidden":!0}),t[41]=z,t[42]=B);let V;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Z.jsx)(`span`,{children:`Folder defaults`}),t[43]=V):V=t[43];let H;t[44]===B?H=t[45]:(H=(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:[B,V]}),t[44]=B,t[45]=H);let U;t[46]===_?U=t[47]:(U=(0,Z.jsx)(`code`,{className:`text-xs text-muted-foreground font-mono cursor-text select-text`,onClick:xC,children:_}),t[46]=_,t[47]=U),t[48]!==H||t[49]!==U?(k=(0,Z.jsxs)(Ko,{className:`flex w-full cursor-pointer items-center justify-between gap-2 px-3 py-2.5 data-[state=open]:border-b border-border`,children:[H,U]}),t[48]=H,t[49]=U,t[50]=k):k=t[50],v=Go,T=`px-2 py-2`,E=e.length===0&&!s?(0,Z.jsx)(`p`,{className:`px-1 py-1 text-sm text-muted-foreground`,children:`No defaults declared. Add a property to set a value every doc in this folder inherits.`}):e.map(e=>{let t=f[e],n=Object.hasOwn(m,e);return(0,Z.jsx)(ra,{keyName:e,value:t,declared:aa(t,ir(t)),rename:n?{state:l?.key===e?l:null,onBegin:()=>F(e),onChangeDraft:I,onCommit:L,onCancel:R}:void 0,badge:n?null:(0,Z.jsx)(_o,{source:h[e]??``}),isInherited:!n,onCommit:t=>void r(e,t),onChangeType:t=>p(e,t),onRemove:n?()=>void d(e):void 0},e)}),t[9]=s,t[10]=a,t[11]=_,t[12]=n,t[13]=m,t[14]=f,t[15]=i,t[16]=l,t[17]=h,t[18]=v,t[19]=y,t[20]=b,t[21]=x,t[22]=S,t[23]=C,t[24]=w,t[25]=T,t[26]=E,t[27]=D,t[28]=O,t[29]=k,t[30]=A}else v=t[18],y=t[19],b=t[20],x=t[21],S=t[22],C=t[23],w=t[24],T=t[25],E=t[26],D=t[27],O=t[28],k=t[29],A=t[30];let j;t[51]!==s||t[52]!==b||t[53]!==x||t[54]!==S||t[55]!==C||t[56]!==w?(j=s?(0,Z.jsx)(wa,{draft:s,onChangeName:x,onChangeType:S,onChangeValue:C,onCommit:()=>void w(),onCancel:()=>c(null)}):(0,Z.jsxs)(Y,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`add-property-trigger`,onClick:b,className:`mt-1 flex items-center gap-1.5 rounded px-2 py-1 font-medium text-sm hover:bg-muted/50 hover:text-foreground`,children:[(0,Z.jsx)(re,{className:`size-3.5`}),(0,Z.jsx)(`span`,{children:`Add property`})]}),t[51]=s,t[52]=b,t[53]=x,t[54]=S,t[55]=C,t[56]=w,t[57]=j):j=t[57];let M;t[58]!==j||t[59]!==T||t[60]!==E?(M=(0,Z.jsxs)(`div`,{className:T,children:[E,j]}),t[58]=j,t[59]=T,t[60]=E,t[61]=M):M=t[61];let N;t[62]!==v||t[63]!==M?(N=(0,Z.jsx)(v,{children:M}),t[62]=v,t[63]=M,t[64]=N):N=t[64];let P;t[65]!==y||t[66]!==N||t[67]!==D||t[68]!==O||t[69]!==k?(P=(0,Z.jsxs)(y,{open:D,onOpenChange:O,children:[k,N]}),t[65]=y,t[66]=N,t[67]=D,t[68]=O,t[69]=k,t[70]=P):P=t[70];let F;return t[71]!==P||t[72]!==A?(F=(0,Z.jsx)(`section`,{className:A,children:P}),t[71]=P,t[72]=A,t[73]=F):F=t[73],F}function xC(e){return e.stopPropagation()}function SC(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(vc,{className:`size-4 text-muted-foreground`,"aria-hidden":!0}),(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:`Folder defaults`})]}),e[0]=t):t=e[0],t}function CC(e){let t=e.split(`/`).pop();return t?`${e}/${t}`:null}function wC(e,t){let n=t.get(`${e}/index`);if(n)return n;let r=CC(e);if(r){let e=t.get(r);if(e)return e}return e.split(`/`).pop()??e}function TC(e,t,n){let r=n.get(e);return r&&r!==e?r:t}function EC(e,t){let n=`${e}/`,r=[...t.folderPaths].filter(e=>e.startsWith(n)).map(e=>({path:e,rel:e.slice(n.length)})).filter(e=>e.rel.length>0&&!e.rel.includes(`/`)).map(({path:e,rel:n})=>({kind:`folder`,path:e,name:n,title:wC(e,t.pageTitles)})),i=[...t.pages].filter(e=>e.startsWith(n)).map(e=>({docName:e,rel:e.slice(n.length)})).filter(e=>e.rel.length>0&&!e.rel.includes(`/`)).map(({docName:e,rel:n})=>{let r=t.pageMeta.get(e);return{kind:`file`,path:e,name:n,title:TC(e,n,t.pageTitles),size:r?.size??0,modified:r?.modified??``}}),a=[...r,...i].sort((e,t)=>e.kind===t.kind?e.title.localeCompare(t.title)||e.name.localeCompare(t.name):e.kind===`folder`?-1:1);return{title:wC(e,t.pageTitles),children:a}}function DC(e){let t=(0,$.c)(52),{folderPath:n,state:r,onChange:i,folderConfigHandle:a}=e,[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(null),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(!1),g;t[0]===i?g=t[1]:(g=async function(e){p(!0);let t=await Ra(e.source_folder,e.name);if(p(!1),!t.ok){X.error(`Delete failed: ${t.error}`);return}X.success(`Template "${e.name}" deleted`),l(null),i()},t[0]=i,t[1]=g);let _=g;if(r.status===`idle`||r.status===`loading`){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card px-3 py-2.5 space-y-3`,children:[(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:`Templates available`})}),(0,Z.jsx)(mo,{className:`h-12 w-full`}),(0,Z.jsx)(mo,{className:`h-12 w-full`})]}),t[2]=e):e=t[2],e}if(r.status===`error`){let e;return t[3]===r.message?e=t[4]:(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:[`Failed to load templates: `,r.message]}),t[3]=r.message,t[4]=e),e}let v;t[5]===r.data.folder.templates_available?v=t[6]:(v=r.data.folder.templates_available??[],t[5]=r.data.folder.templates_available,t[6]=v);let y=v,b;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:`Templates available`}),t[7]=b):b=t[7];let x;t[8]===y.length?x=t[9]:(x=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[b,(0,Z.jsx)(ze,{className:`text-xs`,variant:`secondary`,children:y.length})]}),t[8]=y.length,t[9]=x);let S;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsxs)(Y,{variant:`ghost`,className:`font-mono uppercase`,size:`sm`,onClick:()=>h(!0),children:[(0,Z.jsx)(re,{className:`size-3.5`,"aria-hidden":!0}),`New template`]}),t[10]=S):S=t[10];let C;t[11]===x?C=t[12]:(C=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-1`,children:[x,S]}),t[11]=x,t[12]=C);let w;t[13]===y?w=t[14]:(w=(0,Z.jsx)(`div`,{className:`px-3 py-2.5`,children:y.length===0?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No templates resolve here. Add one to seed new docs in this folder.`}):(0,Z.jsx)(`ul`,{className:`space-y-1`,children:y.map(e=>(0,Z.jsx)(kC,{template:e,onCreate:()=>d(e.name),onEdit:()=>s(e),onDelete:()=>l(e)},e.path))})}),t[13]=y,t[14]=w);let T;t[15]!==C||t[16]!==w?(T=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card`,children:[C,w]}),t[15]=C,t[16]=w,t[17]=T):T=t[17];let E;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>{e||s(null)},t[18]=E):E=t[18];let D;t[19]!==o||t[20]!==n||t[21]!==i?(D=(0,Z.jsx)(Wa,{folderPath:n,template:o,onOpenChange:E,onSaved:i}),t[19]=o,t[20]=n,t[21]=i,t[22]=D):D=t[22];let O=!!c,k;t[23]===f?k=t[24]:(k=e=>{!e&&!f&&l(null)},t[23]=f,t[24]=k);let A;t[25]!==c||t[26]!==f||t[27]!==_?(A=c&&(0,Z.jsx)(ho,{itemName:`template "${c.name}"`,isSubmitting:f,onDelete:()=>_(c),customDescription:`This permanently removes ${c.path}. Agents that reference this template by name will fail until it's recreated or shadowed by an ancestor.${c.scope===`inherited`?`
38
-
39
- This template lives at an ancestor folder — deleting affects every folder under that ancestor that does not shadow it locally.`:``}`}),t[25]=c,t[26]=f,t[27]=_,t[28]=A):A=t[28];let j;t[29]!==O||t[30]!==k||t[31]!==A?(j=(0,Z.jsx)(Vo,{open:O,onOpenChange:k,children:A}),t[29]=O,t[30]=k,t[31]=A,t[32]=j):j=t[32];let M;t[33]===y?M=t[34]:(M=new Set(y.map(OC)),t[33]=y,t[34]=M);let N;t[35]!==n||t[36]!==m||t[37]!==i||t[38]!==M?(N=(0,Z.jsx)(Pa,{folderPath:n,existingNames:M,open:m,onOpenChange:h,onCreated:i}),t[35]=n,t[36]=m,t[37]=i,t[38]=M,t[39]=N):N=t[39];let P=u!==null,F;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(F=e=>{e||d(null)},t[40]=F):F=t[40];let I=u??void 0,L;t[41]!==a||t[42]!==n||t[43]!==P||t[44]!==I?(L=(0,Z.jsx)(xm,{open:P,onOpenChange:F,kind:`file`,initialDir:n,initialTemplate:I,folderConfig:a}),t[41]=a,t[42]=n,t[43]=P,t[44]=I,t[45]=L):L=t[45];let R;return t[46]!==D||t[47]!==j||t[48]!==N||t[49]!==L||t[50]!==T?(R=(0,Z.jsxs)(Z.Fragment,{children:[T,D,j,N,L]}),t[46]=D,t[47]=j,t[48]=N,t[49]=L,t[50]=T,t[51]=R):R=t[51],R}function OC(e){return e.name}function kC(e){let t=(0,$.c)(42),{template:n,onCreate:r,onEdit:i,onDelete:a}=e,o=n.title&&n.title!==n.name,s=n.title??n.name,c;t[0]===s?c=t[1]:(c=(0,Z.jsx)(`span`,{className:`font-medium truncate`,children:s}),t[0]=s,t[1]=c);let l;t[2]!==o||t[3]!==n.name?(l=o?(0,Z.jsx)(`code`,{className:`font-mono text-xs text-muted-foreground shrink-0`,children:n.name}):null,t[2]=o,t[3]=n.name,t[4]=l):l=t[4];let u;t[5]!==n.name||t[6]!==n.scope||t[7]!==n.source_folder?(u=n.scope===`inherited`?(0,Z.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,Z.jsx)(_o,{source:n.source_folder,target:`templates/${n.name}.md`})}):null,t[5]=n.name,t[6]=n.scope,t[7]=n.source_folder,t[8]=u):u=t[8];let d;t[9]!==c||t[10]!==l||t[11]!==u?(d=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[c,l,u]}),t[9]=c,t[10]=l,t[11]=u,t[12]=d):d=t[12];let f;t[13]===n.description?f=t[14]:(f=n.description?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground truncate mt-0.5`,children:n.description}):null,t[13]=n.description,t[14]=f);let p;t[15]!==i||t[16]!==d||t[17]!==f?(p=(0,Z.jsxs)(`button`,{type:`button`,onClick:i,className:`min-w-0 flex-1 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm`,children:[d,f]}),t[15]=i,t[16]=d,t[17]=f,t[18]=p):p=t[18];let m=`Create note from ${s}`,h;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(hc,{className:`size-3.5`,"aria-hidden":!0}),t[19]=h):h=t[19];let g;t[20]!==r||t[21]!==m?(g=(0,Z.jsxs)(Y,{type:`button`,variant:`ghost`,size:`sm`,className:`font-mono uppercase shrink-0 opacity-0 group-hover:opacity-100 focus-visible:opacity-100`,onClick:r,"aria-label":m,children:[h,`Create`]}),t[20]=r,t[21]=m,t[22]=g):g=t[22];let _=`Actions for ${s}`,v;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(ta,{className:`size-4`,"aria-hidden":!0}),t[23]=v):v=t[23];let y;t[24]===_?y=t[25]:(y=(0,Z.jsx)(ja,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0 opacity-0 group-hover:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100`,"aria-label":_,children:v})}),t[24]=_,t[25]=y);let b;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Z.jsx)(rt,{"aria-hidden":!0}),t[26]=b):b=t[26];let x;t[27]===i?x=t[28]:(x=(0,Z.jsxs)(Aa,{onSelect:i,children:[b,`Edit`]}),t[27]=i,t[28]=x);let S;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(fe,{"aria-hidden":!0}),t[29]=S):S=t[29];let C;t[30]===a?C=t[31]:(C=(0,Z.jsxs)(Aa,{variant:`destructive`,onSelect:a,children:[S,`Delete`]}),t[30]=a,t[31]=C);let w;t[32]!==x||t[33]!==C?(w=(0,Z.jsxs)(Oa,{align:`end`,children:[x,C]}),t[32]=x,t[33]=C,t[34]=w):w=t[34];let T;t[35]!==y||t[36]!==w?(T=(0,Z.jsxs)(ka,{children:[y,w]}),t[35]=y,t[36]=w,t[37]=T):T=t[37];let E;return t[38]!==T||t[39]!==p||t[40]!==g?(E=(0,Z.jsxs)(`li`,{className:`group flex items-center gap-2 rounded-md px-2 py-2 hover:bg-muted/50 text-sm`,children:[p,g,T]}),t[38]=T,t[39]=p,t[40]=g,t[41]=E):E=t[41],E}function AC(e){let t=(0,$.c)(14),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,containerClassName:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=Di(`relative w-full overflow-x-auto subtle-scrollbar`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=Di(`w-full caption-bottom text-sm`,n),t[6]=n,t[7]=o);let s;t[8]!==i||t[9]!==o?(s=(0,Z.jsx)(`table`,{"data-slot":`table`,className:o,...i}),t[8]=i,t[9]=o,t[10]=s):s=t[10];let c;return t[11]!==a||t[12]!==s?(c=(0,Z.jsx)(`div`,{"data-slot":`table-container`,className:a,children:s}),t[11]=a,t[12]=s,t[13]=c):c=t[13],c}function jC(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`[&_tr]:border-b`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`thead`,{"data-slot":`table-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function MC(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`[&_tr:last-child]:border-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`tbody`,{"data-slot":`table-body`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function NC(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,noHover:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=(i===void 0?!1:i)&&`hover:bg-transparent`,o;t[4]!==n||t[5]!==a?(o=Di(`hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors`,a,n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==o?(s=(0,Z.jsx)(`tr`,{"data-slot":`table-row`,className:o,...r}),t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function PC(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,scope:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`col`:i,o;t[4]===n?o=t[5]:(o=Di(`font-mono uppercase text-xs text-muted-foreground h-10 px-4 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,Z.jsx)(`th`,{"data-slot":`table-head`,scope:a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function FC(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`py-3 px-4 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`td`,{"data-slot":`table-cell`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function IC(e){if(!e)return`—`;let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/6e4);if(r<1)return`just now`;if(r<60)return`${r}m ago`;let i=Math.floor(r/60);if(i<24)return`${i}h ago`;let a=Math.floor(i/24);return a<30?`${a}d ago`:t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function LC(e,t,n){return[...e].sort((e,r)=>{if(e.kind!==r.kind)return e.kind===`folder`?-1:1;let i=0;switch(t){case`name`:i=e.title.localeCompare(r.title)||e.name.localeCompare(r.name);break;case`modified`:{let t=e.kind===`file`?e.modified:``,n=r.kind===`file`?r.modified:``;i=t.localeCompare(n);break}}return n===`asc`?i:-i})}function RC(e){let t=(0,$.c)(10),{label:n,sortKey:r,activeKey:i,activeDir:a,onSort:o}=e,s=i===r,c;t[0]!==o||t[1]!==r?(c=()=>o(r),t[0]=o,t[1]=r,t[2]=c):c=t[2];let l;t[3]!==a||t[4]!==s?(l=s?a===`asc`?(0,Z.jsx)(St,{className:`ml-1 size-3`}):(0,Z.jsx)($e,{className:`ml-1 size-3`}):(0,Z.jsx)(Js,{className:`ml-1 size-3 text-muted-foreground/50`}),t[3]=a,t[4]=s,t[5]=l):l=t[5];let u;return t[6]!==n||t[7]!==c||t[8]!==l?(u=(0,Z.jsxs)(Y,{variant:`ghost`,size:`sm`,className:`-ml-3 h-8 uppercase font-mono`,onClick:c,children:[n,l]}),t[6]=n,t[7]=c,t[8]=l,t[9]=u):u=t[9],u}function zC(e){let t=(0,$.c)(81),{folderPath:n}=e,{folderPaths:r,loading:i,pages:a,pageTitles:o,pageMeta:s}=Nr(),c=Qa(n),{state:l,refresh:u}=c,[d,f]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(`name`),[h,g]=(0,Q.useState)(`asc`);if(i){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(mo,{className:`size-5 rounded`}),(0,Z.jsx)(mo,{className:`h-7 w-48`})]}),(0,Z.jsx)(mo,{className:`h-9 w-20 rounded-md`})]}),t[0]=e):e=t[0];let n;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(mo,{className:`h-4 w-16`}),t[1]=n):n=t[1];let r;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-start overflow-y-auto subtle-scrollbar`,role:`status`,"aria-busy":`true`,"aria-label":`Loading folder contents`,children:(0,Z.jsxs)(`div`,{className:`mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-8`,children:[e,(0,Z.jsxs)(`div`,{className:`rounded-lg border`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-4 border-b px-4 py-3`,children:[n,(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(mo,{className:`h-4 w-20`})})]}),[`a`,`b`,`c`,`d`].map(HC)]})]})}),t[2]=r):r=t[2],r}let _,v,y,b,x,S,C,w,T,E;if(t[3]!==l||t[4]!==c||t[5]!==n||t[6]!==r||t[7]!==s||t[8]!==o||t[9]!==a||t[10]!==u||t[11]!==h||t[12]!==p){let e=EC(n,{pages:a,pageTitles:o,pageMeta:s,folderPaths:r}),i=LC(e.children,p,h),d;t[23]===p?d=t[24]:(d=function(e){e===p?g(VC):(m(e),g(`asc`))},t[23]=p,t[24]=d);let D=d;E=`flex min-h-0 flex-1 items-start overflow-y-auto subtle-scrollbar`,S=`mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-8`;let O;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsx)(ve,{className:`size-5 text-muted-foreground`}),t[25]=O):O=t[25];let k=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[O,(0,Z.jsx)(`h1`,{className:`text-2xl font-light tracking-tight`,children:e.title})]}),A;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsxs)(Y,{onClick:()=>f(!0),children:[(0,Z.jsx)(re,{className:`size-4`}),`New`]}),t[26]=A):A=t[26],t[27]===k?C=t[28]:(C=(0,Z.jsx)(`div`,{className:`flex flex-col gap-6`,children:(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[k,A]})}),t[27]=k,t[28]=C),t[29]!==l||t[30]!==n||t[31]!==u?(w=(0,Z.jsx)(bC,{folderPath:n,state:l,onChange:u}),t[29]=l,t[30]=n,t[31]=u,t[32]=w):w=t[32],t[33]!==l||t[34]!==c||t[35]!==n||t[36]!==u?(T=(0,Z.jsx)(DC,{folderPath:n,state:l,onChange:u,folderConfigHandle:c}),t[33]=l,t[34]=c,t[35]=n,t[36]=u,t[37]=T):T=t[37],x=`rounded-lg border`,v=AC;let j=p===`name`?h===`asc`?`ascending`:`descending`:`none`,M;t[38]!==D||t[39]!==h||t[40]!==p?(M=(0,Z.jsx)(RC,{label:`Name`,sortKey:`name`,activeKey:p,activeDir:h,onSort:D}),t[38]=D,t[39]=h,t[40]=p,t[41]=M):M=t[41];let N;t[42]!==j||t[43]!==M?(N=(0,Z.jsx)(PC,{"aria-sort":j,children:M}),t[42]=j,t[43]=M,t[44]=N):N=t[44];let P=p===`modified`?h===`asc`?`ascending`:`descending`:`none`,F;t[45]!==D||t[46]!==h||t[47]!==p?(F=(0,Z.jsx)(RC,{label:`Modified`,sortKey:`modified`,activeKey:p,activeDir:h,onSort:D}),t[45]=D,t[46]=h,t[47]=p,t[48]=F):F=t[48];let I;t[49]!==P||t[50]!==F?(I=(0,Z.jsx)(PC,{className:`w-32`,"aria-sort":P,children:F}),t[49]=P,t[50]=F,t[51]=I):I=t[51],t[52]!==N||t[53]!==I?(b=(0,Z.jsx)(jC,{children:(0,Z.jsxs)(NC,{children:[N,I]})}),t[52]=N,t[53]=I,t[54]=b):b=t[54],_=MC,y=i.length?i.map(BC):(0,Z.jsx)(NC,{children:(0,Z.jsx)(FC,{colSpan:2,className:`h-24 text-center text-muted-foreground`,children:`This folder is empty.`})}),t[3]=l,t[4]=c,t[5]=n,t[6]=r,t[7]=s,t[8]=o,t[9]=a,t[10]=u,t[11]=h,t[12]=p,t[13]=_,t[14]=v,t[15]=y,t[16]=b,t[17]=x,t[18]=S,t[19]=C,t[20]=w,t[21]=T,t[22]=E}else _=t[13],v=t[14],y=t[15],b=t[16],x=t[17],S=t[18],C=t[19],w=t[20],T=t[21],E=t[22];let D;t[55]!==_||t[56]!==y?(D=(0,Z.jsx)(_,{children:y}),t[55]=_,t[56]=y,t[57]=D):D=t[57];let O;t[58]!==v||t[59]!==b||t[60]!==D?(O=(0,Z.jsxs)(v,{children:[b,D]}),t[58]=v,t[59]=b,t[60]=D,t[61]=O):O=t[61];let k;t[62]!==O||t[63]!==x?(k=(0,Z.jsx)(`div`,{className:x,children:O}),t[62]=O,t[63]=x,t[64]=k):k=t[64];let A;t[65]!==k||t[66]!==S||t[67]!==C||t[68]!==w||t[69]!==T?(A=(0,Z.jsxs)(`div`,{className:S,children:[C,w,T,k]}),t[65]=k,t[66]=S,t[67]=C,t[68]=w,t[69]=T,t[70]=A):A=t[70];let j;t[71]!==A||t[72]!==E?(j=(0,Z.jsx)(`div`,{className:E,children:A}),t[71]=A,t[72]=E,t[73]=j):j=t[73];let M;t[74]!==d||t[75]!==c||t[76]!==n?(M=(0,Z.jsx)(xm,{open:d,onOpenChange:f,kind:`file`,initialDir:n,folderConfig:c,suggestedName:`index`}),t[74]=d,t[75]=c,t[76]=n,t[77]=M):M=t[77];let N;return t[78]!==j||t[79]!==M?(N=(0,Z.jsxs)(Z.Fragment,{children:[j,M]}),t[78]=j,t[79]=M,t[80]=N):N=t[80],N}function BC(e){return(0,Z.jsxs)(NC,{children:[(0,Z.jsx)(FC,{children:(0,Z.jsxs)(`a`,{href:kr(e.path),className:`flex items-center gap-2 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[e.kind===`folder`?(0,Z.jsx)(bc,{className:`size-4 shrink-0 text-muted-foreground`}):(0,Z.jsx)(we,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.title})]})}),(0,Z.jsx)(FC,{className:`text-muted-foreground`,children:e.kind===`file`?IC(e.modified):`—`})]},e.path)}function VC(e){return e===`asc`?`desc`:`asc`}function HC(e){return(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 border-b px-4 py-3 last:border-b-0`,children:[(0,Z.jsx)(mo,{className:`size-4 rounded`}),(0,Z.jsx)(mo,{className:`h-4 w-40`}),(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(mo,{className:`h-4 w-16`})})]},e)}function UC(e){let t=(0,$.c)(7),{docName:n}=e,[r,i]=(0,Q.useState)(WC),a,o;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>It(e=>{i(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})}),o=[],t[0]=a,t[1]=o):(a=t[0],o=t[1]),(0,Q.useEffect)(a,o),!r.has(n))return null;let s;t[2]===n?s=t[3]:(s=function(){zt(n)?.abort(),i(e=>{if(!e.has(n))return e;let t=new Set(e);return t.delete(n),t})},t[2]=n,t[3]=s);let c=s,l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`span`,{children:`Still loading`}),t[4]=l):l=t[4];let u;return t[5]===c?u=t[6]:(u=(0,Z.jsxs)(`div`,{className:`absolute inset-x-0 bottom-8 z-20 flex justify-center text-xs text-muted-foreground`,children:[l,(0,Z.jsx)(Y,{variant:`link`,size:`sm`,className:`h-auto px-2 py-0 text-xs`,onClick:c,children:`Cancel`})]}),t[5]=c,t[6]=u),u}function WC(){return new Set}var GC=(0,Q.createContext)(null);function KC(e){let t=(0,$.c)(7),{children:n}=e,[r,i]=(0,Q.useState)(qC),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=e=>{i(t=>{let n=new Map(t);return n.set(e,(t.get(e)??0)+1),n})},t[0]=a):a=t[0];let o=a,s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=e=>{i(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},t[1]=s):s=t[1];let c=s,l;t[2]===r?l=t[3]:(l={addPropertySignal:r,requestAddProperty:o,clearAddProperty:c},t[2]=r,t[3]=l);let u=l,d;return t[4]!==n||t[5]!==u?(d=(0,Z.jsx)(GC,{value:u,children:n}),t[4]=n,t[5]=u,t[6]=d):d=t[6],d}function qC(){return new Map}function JC(){let e=(0,Q.use)(GC);if(e===null)throw Error(`useProperties must be used within <PropertyProvider />`);return e}function YC(e){let t=null,n=()=>(t===null&&(t=e(),t.catch(()=>{})),t),r=(0,Q.lazy)(n);return r.preload=n,r}var XC=YC(()=>n(()=>import(`./SettingsDialogBody-DHtvo0Wh.js`).then(e=>({default:e.SettingsDialogBody})),__vite__mapDeps([42,1,33,2,34,35,20,36,37,38,39,19,3,7,8,4,10,9,40,43,6,14,21,11]),import.meta.url));function ZC(e){let t=(0,$.c)(6),{error:n}=e,r=n instanceof Error&&/dynamically imported module|Failed to fetch/i.test(n.message)?`A newer version may have been deployed since this tab opened.`:`Something went wrong loading the settings panel.`,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`h3`,{id:`settings-body-error-title`,className:`font-heading text-base leading-none font-medium`,children:`Settings failed to load`}),t[0]=i):i=t[0];let a;t[1]===r?a=t[2]:(a=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[i,(0,Z.jsx)(`p`,{className:`max-w-xs text-sm text-muted-foreground`,children:r})]}),t[1]=r,t[2]=a);let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(Y,{variant:`default`,onClick:QC,children:`Reload`}),t[3]=o):o=t[3];let s;return t[4]===a?s=t[5]:(s=(0,Z.jsxs)(`div`,{role:`alert`,"aria-labelledby":`settings-body-error-title`,"data-slot":`settings-body-error-boundary`,className:`flex h-full flex-col items-center justify-center gap-5 p-8 text-center`,children:[a,o]}),t[4]=a,t[5]=s),s}function QC(){return window.location.reload()}function $C(e){let t=(0,$.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(le,{fallbackRender:tw,onError:ew,children:n}),t[0]=n,t[1]=r),r}function ew(e,t){console.error(`[SettingsDialogErrorBoundary] rendered fallback for Settings body`,e,t.componentStack)}function tw(e){return(0,Z.jsx)(ZC,{...e})}function nw(e){let t=(0,$.c)(30),{open:n,onOpenChange:r}=e,{collabUrl:i}=ut(),{userBinding:a,userSynced:o,okignoreBinding:s,okignoreSynced:c}=b(),{desktopPresent:l}=Ka(),[u,d]=(0,Q.useState)(`preferences`),f,p;t[0]===n?(f=t[1],p=t[2]):(f=()=>{n&&d(`preferences`)},p=[n],t[0]=n,t[1]=f,t[2]=p),(0,Q.useEffect)(f,p);let m=i!==null,h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(h={id:`user`,label:`User`,enabled:!0,items:[{id:`preferences`,label:`Preferences`}]},t[3]=h):h=t[3];let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=[{id:`sync`,label:`Sync`},{id:`project-templates`,label:`Templates`},{id:`okignore`,label:`Ignore patterns`}],t[4]=g):g=t[4];let _;t[5]===m?_=t[6]:(_={id:`project`,label:`This project`,enabled:m,items:g},t[5]=m,t[6]=_);let v;t[7]===l?v=t[8]:(v={id:`integrations`,label:`Integrations`,enabled:!0,items:l?[{id:`claude-desktop`,label:`Claude Desktop`}]:[]},t[7]=l,t[8]=v);let y;t[9]!==_||t[10]!==v?(y=[h,_,v],t[9]=_,t[10]=v,t[11]=y):y=t[11];let x=y,S,C;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(Ao,{className:`sr-only`,children:`Settings`}),C=(0,Z.jsx)(Oo,{className:`sr-only`,children:`Configure user, project, and integration settings.`}),t[12]=S,t[13]=C):(S=t[12],C=t[13]);let w;t[14]!==u||t[15]!==x?(w=(0,Z.jsx)(rw,{groups:x,activeId:u,onSelect:d}),t[14]=u,t[15]=x,t[16]=w):w=t[16];let T;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsx)(aw,{}),t[17]=T):T=t[17];let E=o?a:null,D;t[18]!==u||t[19]!==s||t[20]!==c||t[21]!==E?(D=(0,Z.jsx)(`div`,{className:`min-h-0 overflow-y-auto overscroll-contain subtle-scrollbar p-6`,children:(0,Z.jsx)($C,{children:(0,Z.jsx)(Q.Suspense,{fallback:T,children:(0,Z.jsx)(XC,{activeId:u,userBinding:E,okignoreBinding:s,okignoreSynced:c})})})}),t[18]=u,t[19]=s,t[20]=c,t[21]=E,t[22]=D):D=t[22];let O;t[23]!==w||t[24]!==D?(O=(0,Z.jsxs)(Po,{className:`grid h-[700px] max-h-[calc(100dvh-4rem)] w-[900px] max-w-[calc(100%-2rem)] grid-cols-[220px_1fr] gap-0 overflow-hidden p-0 sm:max-w-[900px]`,"data-testid":`settings-dialog`,children:[S,C,w,D]}),t[23]=w,t[24]=D,t[25]=O):O=t[25];let k;return t[26]!==r||t[27]!==n||t[28]!==O?(k=(0,Z.jsx)(Vo,{open:n,onOpenChange:r,children:O}),t[26]=r,t[27]=n,t[28]=O,t[29]=k):k=t[29],k}function rw(e){let t=(0,$.c)(9),{groups:n,activeId:r,onSelect:i}=e,a;if(t[0]!==r||t[1]!==n||t[2]!==i){let e;t[4]!==r||t[5]!==i?(e=e=>(0,Z.jsx)(iw,{group:e,activeId:r,onSelect:i},e.id),t[4]=r,t[5]=i,t[6]=e):e=t[6],a=n.map(e),t[0]=r,t[1]=n,t[2]=i,t[3]=a}else a=t[3];let o;return t[7]===a?o=t[8]:(o=(0,Z.jsx)(`nav`,{"aria-label":`Settings sections`,className:`h-full overflow-y-auto overscroll-contain subtle-scrollbar border-r bg-muted/30 px-3 py-4`,children:a}),t[7]=a,t[8]=o),o}function iw(e){let t=(0,$.c)(28),{group:n,activeId:r,onSelect:i}=e;if(n.items.length===0)return null;let a=`settings-group-${n.id}`,o=`${a}-caption`,s=n.enabled?void 0:o,c=n.enabled?`text-muted-foreground/80`:`text-muted-foreground/50`,l;t[0]===c?l=t[1]:(l=Di(`mb-1 px-2 text-xs font-semibold uppercase tracking-wide font-mono`,c),t[0]=c,t[1]=l);let u;t[2]!==n.label||t[3]!==a||t[4]!==s||t[5]!==l?(u=(0,Z.jsx)(`h3`,{id:a,"aria-describedby":s,className:l,children:n.label}),t[2]=n.label,t[3]=a,t[4]=s,t[5]=l,t[6]=u):u=t[6];let d;t[7]!==o||t[8]!==n.enabled?(d=n.enabled?null:(0,Z.jsx)(`p`,{id:o,className:`mb-1 px-2 text-xs italic text-muted-foreground/60`,children:`Open a project to edit.`}),t[7]=o,t[8]=n.enabled,t[9]=d):d=t[9];let f;if(t[10]!==r||t[11]!==o||t[12]!==n.enabled||t[13]!==n.items||t[14]!==i){let e;t[16]!==r||t[17]!==o||t[18]!==n.enabled||t[19]!==i?(e=e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`button`,{type:`button`,"aria-current":r===e.id?`page`:void 0,"aria-disabled":n.enabled?void 0:!0,"aria-describedby":n.enabled?void 0:o,tabIndex:n.enabled?0:-1,disabled:!n.enabled,onClick:()=>n.enabled&&i(e.id),"data-testid":`settings-sidebar-item-${e.id}`,className:Di(`w-full rounded px-2 py-1.5 text-left text-sm transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,r===e.id&&n.enabled?`bg-accent text-accent-foreground`:`hover:bg-accent/50`),children:e.label})},e.id),t[16]=r,t[17]=o,t[18]=n.enabled,t[19]=i,t[20]=e):e=t[20],f=n.items.map(e),t[10]=r,t[11]=o,t[12]=n.enabled,t[13]=n.items,t[14]=i,t[15]=f}else f=t[15];let p;t[21]!==a||t[22]!==f?(p=(0,Z.jsx)(`ul`,{"aria-labelledby":a,className:`space-y-0.5`,children:f}),t[21]=a,t[22]=f,t[23]=p):p=t[23];let m;return t[24]!==u||t[25]!==d||t[26]!==p?(m=(0,Z.jsxs)(`div`,{className:`mb-4`,children:[u,d,p]}),t[24]=u,t[25]=d,t[26]=p,t[27]=m):m=t[27],m}function aw(){let e=(0,$.c)(4),t,n,r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`span`,{className:`sr-only`,children:`Loading settings`}),n=(0,Z.jsx)(mo,{className:`h-5 w-32`}),r=(0,Z.jsx)(mo,{className:`h-4 w-64`}),e[0]=t,e[1]=n,e[2]=r):(t=e[0],n=e[1],r=e[2]);let i;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-3`,"data-testid":`settings-content-skeleton`,children:[t,n,r,(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(mo,{className:`h-9 w-full`}),(0,Z.jsx)(mo,{className:`h-9 w-full`})]})]}),e[3]=i):i=e[3],i}function ow(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`flex h-full w-full aria-[orientation=vertical]:flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(eS,{"data-slot":`resizable-panel-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function sw(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(rS,{"data-slot":`resizable-panel`,...n}),t[2]=n,t[3]=r),r}function cw(e){let t=(0,$.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({withHandle:i,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=Di(`relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,n),t[4]=n,t[5]=a);let o;t[6]===i?o=t[7]:(o=i&&(0,Z.jsx)(`div`,{className:`z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border`}),t[6]=i,t[7]=o);let s;return t[8]!==r||t[9]!==a||t[10]!==o?(s=(0,Z.jsx)(sS,{"data-slot":`resizable-handle`,className:a,...r,children:o}),t[8]=r,t[9]=a,t[10]=o,t[11]=s):s=t[11],s}function lw(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`input-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var uw=Ri(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function dw(e){let t=(0,$.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`inline-start`:i,o;t[4]!==a||t[5]!==n?(o=Di(uw({align:a}),n),t[4]=a,t[5]=n,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,Z.jsx)(`div`,{"data-slot":`input-group-addon`,"data-align":a,className:o,onMouseDown:fw,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function fw(e){e.target.closest(`button`)||(e.preventDefault(),e.currentTarget.parentElement?.querySelector(`input`)?.focus())}Ri(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function pw(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`span`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function mw(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Wo,{"data-slot":`input-group-control`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function hw(e){let t=(0,$.c)(88),{findInputRef:n,query:r,replacement:i,replaceOpen:a,caseSensitive:o,wholeWord:c,current:l,total:u,onQueryChange:d,onReplacementChange:f,onReplaceOpenChange:p,onCaseSensitiveChange:m,onWholeWordChange:h,onNext:g,onPrevious:_,onReplaceCurrent:v,onReplaceAll:y,onClose:b}=e,x=r.length>0,S=u>0,C=x?S?`${l} / ${u}`:`No results`:``,w;t[0]!==b||t[1]!==g||t[2]!==_?(w=function(e){e.key===`Enter`?(e.preventDefault(),e.shiftKey?_():g()):e.key===`Escape`&&(e.preventDefault(),b())},t[0]=b,t[1]=g,t[2]=_,t[3]=w):w=t[3];let T=w,E;t[4]!==b||t[5]!==v?(E=function(e){e.key===`Enter`?(e.preventDefault(),v()):e.key===`Escape`&&(e.preventDefault(),b())},t[4]=b,t[5]=v,t[6]=E):E=t[6];let D=E,O;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsx)(`label`,{className:`sr-only`,htmlFor:`ok-find-input`,children:`Find`}),t[7]=O):O=t[7];let k;t[8]===d?k=t[9]:(k=e=>d(e.target.value),t[8]=d,t[9]=k);let A;t[10]!==n||t[11]!==T||t[12]!==r||t[13]!==k?(A=(0,Z.jsx)(mw,{ref:n,id:`ok-find-input`,value:r,onChange:k,onKeyDown:T,placeholder:`Find`,autoComplete:`off`,spellCheck:!1,className:`h-7 px-2 text-sm`}),t[10]=n,t[11]=T,t[12]=r,t[13]=k,t[14]=A):A=t[14];let j;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Z.jsx)(ec,{"aria-hidden":`true`}),t[15]=j):j=t[15];let M;t[16]!==o||t[17]!==m?(M=(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(Qo,{type:`button`,variant:`segmented`,size:`sm`,"aria-label":`Match case`,pressed:o,onPressedChange:m,className:`size-6 min-w-6 px-0`,children:j})}),t[16]=o,t[17]=m,t[18]=M):M=t[18];let N;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Z.jsx)(er,{side:`bottom`,children:`Match case`}),t[19]=N):N=t[19];let P;t[20]===M?P=t[21]:(P=(0,Z.jsxs)(jn,{children:[M,N]}),t[20]=M,t[21]=P);let F;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsx)(ul,{"aria-hidden":`true`}),t[22]=F):F=t[22];let I;t[23]!==h||t[24]!==c?(I=(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(Qo,{type:`button`,variant:`segmented`,size:`sm`,"aria-label":`Whole word`,pressed:c,onPressedChange:h,className:`size-6 min-w-6 px-0`,children:F})}),t[23]=h,t[24]=c,t[25]=I):I=t[25];let L;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(er,{side:`bottom`,children:`Whole word`}),t[26]=L):L=t[26];let R;t[27]===I?R=t[28]:(R=(0,Z.jsxs)(jn,{children:[I,L]}),t[27]=I,t[28]=R);let z;t[29]!==R||t[30]!==P?(z=(0,Z.jsxs)(dw,{align:`inline-end`,className:`gap-0.5`,children:[P,R]}),t[29]=R,t[30]=P,t[31]=z):z=t[31];let B;t[32]!==z||t[33]!==A?(B=(0,Z.jsxs)(lw,{className:`h-7 w-56 rounded-[min(var(--radius-md),12px)]`,children:[A,z]}),t[32]=z,t[33]=A,t[34]=B):B=t[34];let V;t[35]===C?V=t[36]:(V=(0,Z.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`min-w-14 px-1 text-right text-muted-foreground text-xs tabular-nums shrink-0`,children:C}),t[35]=C,t[36]=V);let H=!S,U;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(s,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[37]=U):U=t[37];let W;t[38]!==_||t[39]!==H?(W=(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(Y,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Previous match`,disabled:H,onClick:_,children:U})}),t[38]=_,t[39]=H,t[40]=W):W=t[40];let G;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Z.jsx)(er,{side:`bottom`,children:`Previous match`}),t[41]=G):G=t[41];let ee;t[42]===W?ee=t[43]:(ee=(0,Z.jsxs)(jn,{children:[W,G]}),t[42]=W,t[43]=ee);let te=!S,ne;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Z.jsx)(Ge,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[44]=ne):ne=t[44];let re;t[45]!==g||t[46]!==te?(re=(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(Y,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Next match`,disabled:te,onClick:g,children:ne})}),t[45]=g,t[46]=te,t[47]=re):re=t[47];let ie;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Z.jsx)(er,{side:`bottom`,children:`Next match`}),t[48]=ie):ie=t[48];let ae;t[49]===re?ae=t[50]:(ae=(0,Z.jsxs)(jn,{children:[re,ie]}),t[49]=re,t[50]=ae);let oe=a?`secondary`:`ghost`,se=a?`Hide replace`:`Show replace`,K=a?`ok-replace-input`:void 0,ce;t[51]!==p||t[52]!==a?(ce=()=>p(!a),t[51]=p,t[52]=a,t[53]=ce):ce=t[53];let le;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,Z.jsx)(Gc,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[54]=le):le=t[54];let ue;t[55]!==a||t[56]!==oe||t[57]!==se||t[58]!==K||t[59]!==ce?(ue=(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(Y,{type:`button`,variant:oe,size:`icon-sm`,"aria-label":se,"aria-expanded":a,"aria-controls":K,onClick:ce,children:le})}),t[55]=a,t[56]=oe,t[57]=se,t[58]=K,t[59]=ce,t[60]=ue):ue=t[60];let q=a?`Hide replace`:`Show replace`,de;t[61]===q?de=t[62]:(de=(0,Z.jsx)(er,{side:`bottom`,children:q}),t[61]=q,t[62]=de);let fe;t[63]!==ue||t[64]!==de?(fe=(0,Z.jsxs)(jn,{children:[ue,de]}),t[63]=ue,t[64]=de,t[65]=fe):fe=t[65];let pe;t[66]!==D||t[67]!==S||t[68]!==y||t[69]!==v||t[70]!==f||t[71]!==a||t[72]!==i?(pe=a?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`label`,{className:`sr-only`,htmlFor:`ok-replace-input`,children:`Replace`}),(0,Z.jsx)(Wo,{id:`ok-replace-input`,value:i,onChange:e=>f(e.target.value),onKeyDown:D,placeholder:`Replace`,autoComplete:`off`,spellCheck:!1,className:`h-7 w-48 rounded-[min(var(--radius-md),12px)] px-2 text-sm shadow-none focus-visible:ring-2`}),(0,Z.jsxs)(jn,{children:[(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(Y,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Replace current match`,disabled:!S,onClick:v,children:(0,Z.jsx)(Gc,{"data-icon":`inline-start`,"aria-hidden":`true`})})}),(0,Z.jsx)(er,{side:`bottom`,children:`Replace current match`})]}),(0,Z.jsxs)(jn,{children:[(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(Y,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Replace all matches`,disabled:!S,onClick:y,children:(0,Z.jsx)(Wc,{"data-icon":`inline-start`,"aria-hidden":`true`})})}),(0,Z.jsx)(er,{side:`bottom`,children:`Replace all matches`})]})]}):null,t[66]=D,t[67]=S,t[68]=y,t[69]=v,t[70]=f,t[71]=a,t[72]=i,t[73]=pe):pe=t[73];let me;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,Z.jsx)(Do,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[74]=me):me=t[74];let he;t[75]===b?he=t[76]:(he=(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(Y,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close find`,onClick:b,children:me})}),t[75]=b,t[76]=he);let ge;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,Z.jsx)(er,{side:`bottom`,children:`Close`}),t[77]=ge):ge=t[77];let _e;t[78]===he?_e=t[79]:(_e=(0,Z.jsxs)(jn,{children:[he,ge]}),t[78]=he,t[79]=_e);let ve;return t[80]!==B||t[81]!==V||t[82]!==ee||t[83]!==ae||t[84]!==fe||t[85]!==pe||t[86]!==_e?(ve=(0,Z.jsxs)(`search`,{"data-testid":`find-replace-bar`,"aria-label":`Find and replace`,className:`pointer-events-auto flex max-w-[min(calc(100vw-1rem),720px)] touch-manipulation items-center gap-1 rounded-[calc(var(--radius)+2px)] border border-input bg-popover/95 p-1 text-popover-foreground shadow-md shadow-black/10 backdrop-blur`,children:[O,B,V,ee,ae,fe,pe,_e]}),t[80]=B,t[81]=V,t[82]=ee,t[83]=ae,t[84]=fe,t[85]=pe,t[86]=_e,t[87]=ve):ve=t[87],ve}var gw={current:0,total:0},_w=120,vw=100;function yw(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=()=>e?ie(e):null,t[0]=e,t[1]=n),(0,Q.useSyncExternalStore)(u,n,bw)}function bw(){return null}function xw(e){if(!e||e.isDestroyed)return null;let{from:t,to:n,empty:r}=e.state.selection;if(r)return null;let i=e.state.doc.textBetween(t,n,`
40
- `,`
41
- `).trim();return i.length===0||i.length>_w||i.includes(`
42
- `)?null:i}function Sw(e,t){return(Ti()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&e.key.toLocaleLowerCase()===t}function Cw(e){let t=e.key.toLocaleLowerCase();return Ti()?e.metaKey&&e.altKey&&!e.ctrlKey&&t===`f`:e.ctrlKey&&!e.metaKey&&!e.altKey&&t===`h`}function ww(e){let t=et(e.state);return{current:t.matches.length===0?0:t.activeIndex+1,total:t.matches.length}}function Tw(e,t){return e.current===t.current&&e.total===t.total}function Ew(e,t,n){e&&!e.isDestroyed&&(e.commands.clearFindMatches(),e.commands.focus()),t(e=>({...e,open:!1,activeIndex:0})),n(gw)}function Dw(e){!e||e.isDestroyed||typeof window>`u`||window.requestAnimationFrame(()=>{if(e.isDestroyed)return;let t=m(e);if(!t)return;let n=t.dom.querySelector(`.ok-find-match-active`);n instanceof HTMLElement&&n.scrollIntoView({block:`center`,inline:`nearest`,behavior:`auto`})})}function Ow(e){let t=(0,$.c)(81),{activeDocName:n,isSourceMode:r}=e,i=yw(n),a=(0,Q.useRef)(null),o=(0,Q.useRef)(null),s=(0,Q.useRef)(n),c=(0,Q.useRef)(0),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l={open:!1,replaceOpen:!1,query:``,replacement:``,caseSensitive:!1,wholeWord:!1,activeIndex:0},t[0]=l):l=t[0];let[u,d]=(0,Q.useState)(l),[f,p]=(0,Q.useState)(gw),m,h;t[1]===n?(m=t[2],h=t[3]):(m=()=>{s.current!==n&&(s.current=n,d(Aw))},h=[n],t[1]=n,t[2]=m,t[3]=h),(0,Q.useEffect)(m,h);let g,_;t[4]===u.activeIndex?(g=t[5],_=t[6]):(g=()=>{c.current=u.activeIndex},_=[u.activeIndex],t[4]=u.activeIndex,t[5]=g,t[6]=_),(0,Q.useEffect)(g,_);let v,y;t[7]===i?(v=t[8],y=t[9]):(v=()=>{let e=o.current;e&&e!==i&&!e.isDestroyed&&e.commands.clearFindMatches(),o.current=i},y=[i],t[7]=i,t[8]=v,t[9]=y),(0,Q.useEffect)(v,y);let b,x;t[10]===u.open?(b=t[11],x=t[12]):(b=()=>{if(!u.open||!a.current)return;let e=requestAnimationFrame(()=>{a.current?.focus(),a.current?.select()});return()=>cancelAnimationFrame(e)},x=[u.open],t[10]=u.open,t[11]=b,t[12]=x),(0,Q.useEffect)(b,x);let S,C;t[13]!==u.open||t[14]!==r?(S=()=>{!u.open||!r||d(kw)},C=[u.open,r],t[13]=u.open,t[14]=r,t[15]=S,t[16]=C):(S=t[15],C=t[16]),(0,Q.useEffect)(S,C);let w,T;t[17]!==i||t[18]!==u.caseSensitive||t[19]!==u.open||t[20]!==u.query||t[21]!==u.wholeWord||t[22]!==r?(w=()=>{if(!i||i.isDestroyed){p(gw);return}if(!u.open||r){i.commands.clearFindMatches(),p(gw);return}let e=window.setTimeout(()=>{if(i.isDestroyed)return;i.commands.setFindQuery(u.query,{options:{caseSensitive:u.caseSensitive,wholeWord:u.wholeWord},activeIndex:c.current});let e=ww(i);p(t=>Tw(t,e)?t:e)},vw);return()=>window.clearTimeout(e)},T=[i,u.open,u.query,u.caseSensitive,u.wholeWord,r],t[17]=i,t[18]=u.caseSensitive,t[19]=u.open,t[20]=u.query,t[21]=u.wholeWord,t[22]=r,t[23]=w,t[24]=T):(w=t[23],T=t[24]),(0,Q.useEffect)(w,T);let E,D;t[25]!==i||t[26]!==u.open||t[27]!==r?(E=()=>{if(!i||i.isDestroyed||!u.open||r)return;let e=()=>{let e=et(i.state),t=ww(i);p(e=>Tw(e,t)?e:t),d(t=>t.activeIndex===e.activeIndex?t:{...t,activeIndex:e.activeIndex})};return i.on(`transaction`,e),()=>{i.off(`transaction`,e)}},D=[i,u.open,r],t[25]=i,t[26]=u.open,t[27]=r,t[28]=E,t[29]=D):(E=t[28],D=t[29]),(0,Q.useEffect)(E,D);let O,k;t[30]!==n||t[31]!==i||t[32]!==u.open||t[33]!==r?(O=()=>{let e=function(e){let t=xw(i);d(n=>({...n,open:!0,replaceOpen:e,query:t??n.query,activeIndex:0}))},t=function(t){if(!(!n||r||t.defaultPrevented)){if(Sw(t,`f`)){t.preventDefault(),u.open?Ew(i,d,p):e(!1);return}if(Cw(t)){t.preventDefault(),e(!0);return}if(Sw(t,`g`)&&u.open){t.preventDefault(),(t.shiftKey?i?.commands.selectPreviousFindMatch():i?.commands.selectNextFindMatch())&&Dw(i);return}t.key===`Escape`&&u.open&&(t.preventDefault(),Ew(i,d,p))}};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},k=[n,i,u.open,r],t[30]=n,t[31]=i,t[32]=u.open,t[33]=r,t[34]=O,t[35]=k):(O=t[34],k=t[35]),(0,Q.useEffect)(O,k);let A;t[36]!==i||t[37]!==u.caseSensitive||t[38]!==u.query||t[39]!==u.wholeWord?(A=function(){return!i||i.isDestroyed?!1:(i.commands.setFindQuery(u.query,{options:{caseSensitive:u.caseSensitive,wholeWord:u.wholeWord},activeIndex:c.current}),!0)},t[36]=i,t[37]=u.caseSensitive,t[38]=u.query,t[39]=u.wholeWord,t[40]=A):A=t[40];let j=A,M;t[41]===i?M=t[42]:(M=function(){if(!i||i.isDestroyed)return;let e=et(i.state),t=ww(i);p(e=>Tw(e,t)?e:t),d(t=>t.activeIndex===e.activeIndex?t:{...t,activeIndex:e.activeIndex})},t[41]=i,t[42]=M);let N=M,P;t[43]===i?P=t[44]:(P=function(){Ew(i,d,p)},t[43]=i,t[44]=P);let F=P,I;t[45]!==j||t[46]!==i||t[47]!==N?(I=function(){!i||i.isDestroyed||(j(),i.commands.selectNextFindMatch()&&Dw(i),N())},t[45]=j,t[46]=i,t[47]=N,t[48]=I):I=t[48];let L=I,R;t[49]!==j||t[50]!==i||t[51]!==N?(R=function(){!i||i.isDestroyed||(j(),i.commands.selectPreviousFindMatch()&&Dw(i),N())},t[49]=j,t[50]=i,t[51]=N,t[52]=R):R=t[52];let z=R,B;t[53]!==j||t[54]!==i||t[55]!==u.replacement||t[56]!==N?(B=function(){!i||i.isDestroyed||(j(),i.commands.replaceCurrentFindMatch(u.replacement)&&Dw(i),N())},t[53]=j,t[54]=i,t[55]=u.replacement,t[56]=N,t[57]=B):B=t[57];let V=B,H;t[58]!==j||t[59]!==i||t[60]!==u.replacement||t[61]!==N?(H=function(){!i||i.isDestroyed||(j(),i.commands.replaceAllFindMatches(u.replacement)&&Dw(i),N())},t[58]=j,t[59]=i,t[60]=u.replacement,t[61]=N,t[62]=H):H=t[62];let U=H;if(!u.open||!n||r)return null;let W,G,ee,te,ne;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(W=e=>d(t=>({...t,query:e,activeIndex:0})),G=e=>d(t=>({...t,replacement:e})),ee=e=>d(t=>({...t,replaceOpen:e})),te=e=>d(t=>({...t,caseSensitive:e})),ne=e=>d(t=>({...t,wholeWord:e})),t[63]=W,t[64]=G,t[65]=ee,t[66]=te,t[67]=ne):(W=t[63],G=t[64],ee=t[65],te=t[66],ne=t[67]);let re;return t[68]!==F||t[69]!==u.caseSensitive||t[70]!==u.query||t[71]!==u.replaceOpen||t[72]!==u.replacement||t[73]!==u.wholeWord||t[74]!==f.current||t[75]!==f.total||t[76]!==U||t[77]!==V||t[78]!==L||t[79]!==z?(re=(0,Z.jsx)(`div`,{className:`editor-content-aligned pointer-events-none absolute inset-x-0 top-2 z-30 px-2`,children:(0,Z.jsx)(`div`,{className:`flex justify-end`,children:(0,Z.jsx)(hw,{findInputRef:a,query:u.query,replacement:u.replacement,replaceOpen:u.replaceOpen,caseSensitive:u.caseSensitive,wholeWord:u.wholeWord,current:f.current,total:f.total,onQueryChange:W,onReplacementChange:G,onReplaceOpenChange:ee,onCaseSensitiveChange:te,onWholeWordChange:ne,onNext:L,onPrevious:z,onReplaceCurrent:V,onReplaceAll:U,onClose:F})})}),t[68]=F,t[69]=u.caseSensitive,t[70]=u.query,t[71]=u.replaceOpen,t[72]=u.replacement,t[73]=u.wholeWord,t[74]=f.current,t[75]=f.total,t[76]=U,t[77]=V,t[78]=L,t[79]=z,t[80]=re):re=t[80],re}function kw(e){return{...e,open:!1,activeIndex:0}}function Aw(e){return{...e,activeIndex:0}}var jw=960,Mw=1024;function Nw(){let e=(0,$.c)(5),[t,n]=(0,Q.useState)(Fw),[r,i]=(0,Q.useState)(Pw),a,o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{let e=window.matchMedia(`(max-width: ${jw-1}px)`),t=window.matchMedia(`(max-width: ${Mw-1}px)`),r=()=>{let r=e.matches;n(r?`sheet`:`panel`),i(!r&&t.matches)};return e.addEventListener(`change`,r),t.addEventListener(`change`,r),()=>{e.removeEventListener(`change`,r),t.removeEventListener(`change`,r)}},o=[],e[0]=a,e[1]=o):(a=e[0],o=e[1]),(0,Q.useEffect)(a,o);let s;return e[2]!==r||e[3]!==t?(s={layout:t,autoCollapse:r},e[2]=r,e[3]=t,e[4]=s):s=e[4],s}function Pw(){return window.innerWidth>=jw&&window.innerWidth<Mw}function Fw(){return window.innerWidth<jw?`sheet`:`panel`}var Iw={words:0,chars:0,tokens:0},Lw=/[ -〿぀-ゟ゠-ヿ㐀-䶿一-鿿豈-﫿＀-￯฀-๿ក-៿]/,Rw=/[\p{L}\p{N}]/u,zw=new Set([`text`,`inlineCode`,`code`,`tag`]),Bw=new Set([`html`,`definition`,`footnoteDefinition`,`yaml`,`toml`,`image`,`imageReference`,`mdxFlowExpression`,`mdxTextExpression`,`mdxjsEsm`,`rawMdxFallback`,`rawMdxFallbackMdast`]),Vw=new Set([`paragraph`,`heading`,`blockquote`,`list`,`listItem`,`thematicBreak`,`table`,`tableRow`,`tableCell`,`mdxJsxFlowElement`,`commentBlock`]);function Hw(e,t){if(!e)return;let n=e.type;if(!Bw.has(n)){if(zw.has(n)){e.value&&(t.push(e.value),n===`code`&&t.push(`
43
- `));return}if(n===`wikiLink`||n===`wikiLinkEmbed`){let n=e.data?.alias??e.value??``;n&&t.push(n);return}if(Array.isArray(e.children)){for(let n of e.children)Hw(n,t);if(Vw.has(n)&&t.length>0){let e=t[t.length-1];e&&!e.endsWith(`
44
- `)&&t.push(`
45
- `)}}}}function Uw(e){try{let t=K().parseToMdast(e),n=[];return Hw(t,n),n.join(``).trim()}catch(t){return console.warn(`[document-stats] mdast parse failed, falling back to raw text`,t),e.trim()}}function Ww(e){if(!e)return 0;let t=0;for(let n of e.split(/\s+/))Rw.test(n)&&t++;return t}function Gw(e){let t=globalThis.Intl.Segmenter;if(!t)return Ww(e);let n=new t(void 0,{granularity:`word`}),r=0;for(let t of n.segment(e))t.isWordLike&&r++;return r}function Kw(e){let t=Lw.test(e)?1.5:4;return Math.ceil(e.length/t)}function qw(e){if(!e)return{words:0,chars:0,tokens:0};let{body:t}=pi(e);if(!t.trim())return{words:0,chars:0,tokens:0};let n=Uw(t);return n?{words:Lw.test(n)?Gw(n):Ww(n),chars:n.length,tokens:Kw(n)}:{words:0,chars:0,tokens:0}}var Jw=300;function Yw(e,t){let n=(0,$.c)(4),[r,i]=(0,Q.useState)(Iw),a,o;return n[0]!==t||n[1]!==e?(a=()=>{if(!e||!t){i(Iw);return}let n=e.document.getText(`source`),r=!1,a=null,o=function(){r||i(qw(n.toString()))};o();let s=function(){a&&clearTimeout(a),a=setTimeout(o,Jw)};return n.observe(s),()=>{r=!0,n.unobserve(s),a&&clearTimeout(a)}},o=[e,t],n[0]=t,n[1]=e,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,Q.useEffect)(a,o),r}function Xw(e){let t=(0,$.c)(3),[n,r]=(0,Q.useState)(`connecting`),i,a;return t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(!e){r(`connecting`);return}let t=e.configuration.websocketProvider.status;e.isSynced?r(`synced`):r(t===`connected`?`connected`:t===`disconnected`?`disconnected`:`connecting`);let n=e=>{let{status:t}=e;r(t===`connected`?Zw:t===`disconnected`?`disconnected`:`connecting`)},i=e=>{let{state:t}=e;r(t?`synced`:`connected`)},a=()=>r(`disconnected`);return e.on(`status`,n),e.on(`synced`,i),e.on(`disconnect`,a),()=>{e.off(`status`,n),e.off(`synced`,i),e.off(`disconnect`,a)}},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,Q.useEffect)(i,a),n}function Zw(e){return e===`synced`?`synced`:`connected`}var Qw=hi;function $w(e,t={}){let n=Ee(e.componentName);return n.name===`*`?t.unregisteredSuffix?`${e.componentName} (unregistered)`:e.componentName:n.displayName??n.name}var eT=200,tT=`Outside any block`;function nT(e){let t=(0,$.c)(5),{editor:n}=e,r=Fe(n),i=(0,Q.useRef)(null),a=(0,Q.useRef)(null),o=(0,Q.useRef)(!1),s,c;t[0]!==r||t[1]!==n?(s=()=>{if(a.current!==null&&(window.clearTimeout(a.current),a.current=null),!n||!i.current)return;let e=r!==null&&r.ancestorChain.length>0,t;return t=e?rT(n,r):o.current?tT:``,a.current=window.setTimeout(()=>{i.current&&(i.current.textContent=``,i.current.textContent=t),o.current=e,a.current=null},eT),()=>{a.current!==null&&(window.clearTimeout(a.current),a.current=null)}},c=[n,r],t[0]=r,t[1]=n,t[2]=s,t[3]=c):(s=t[2],c=t[3]),(0,Q.useEffect)(s,c);let l;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`div`,{ref:i,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`sr-only`}),t[4]=l):l=t[4],l}function rT(e,t){if(!t||t.ancestorChain.length===0)return``;let n=t.ancestorChain,r=n[n.length-1],i=$w(r,{unregisteredSuffix:!0});if(n.length===1)return`Selected: ${i}`;let a=n[n.length-2],o=$w(a);try{let t=e.state.doc.resolve(r.pos),n=t.index(t.depth),a=t.parent.childCount;return`Selected: ${i}, ${n+1} of ${a} in ${o}`}catch{return`Selected: ${i} in ${o}`}}function iT(){let[e]=(0,Q.useState)(zn);return e}function aT({principal:e,identity:t}){return e&&e.source===`git-config`?{type:`human`,name:$n(e.display_name),color:fi(e.id,Pn),coeditor:t.coeditor,tabId:t.tabId,principalId:e.id}:e&&e.source===`synthesized`?{type:`human`,name:t.name,color:fi(e.id,Pn),coeditor:t.coeditor,tabId:t.tabId}:{type:`human`,name:t.name,color:t.color,coeditor:t.coeditor,tabId:t.tabId}}function oT(e,t){let n=Math.min(e.top,t.top),r=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),a=Math.max(e.right,t.right)-i,o=r-n;return new DOMRect(i,n,a,o)}var sT=class{constructor({editor:e,element:t,view:n,pluginKey:r=`bubbleMenu`,updateDelay:i=250,resizeDelay:a=60,shouldShow:o,appendTo:s,getReferencedVirtualElement:c,options:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:`absolute`,placement:`top`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:e,state:t,from:n,to:r})=>{let{doc:i,selection:a}=t,{empty:o}=a,s=!i.textBetween(n,r).length&&kn(t.selection),c=this.element.contains(document.activeElement);return!(!(e.hasFocus()||c)||o||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(e,t)=>{let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);!n&&!r||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=l?.scrollTarget??window,this.getReferencedVirtualElement=c,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,o&&(this.shouldShow=o),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener(`dragstart`,this.dragstartHandler),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(Dn(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(_r(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(pr(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(Wn(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Vn(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(Zn(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(hr(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(Hn(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}get virtualElement(){let{selection:e}=this.editor.state,t=this.getReferencedVirtualElement?.call(this);if(t)return t;if(!this.view?.dom?.parentNode)return;let n=Un(this.view,e.from,e.to),r={getBoundingClientRect:()=>n,getClientRects:()=>[n]};if(e instanceof Kn){let t=this.view.nodeDOM(e.from),n=t.dataset.nodeViewWrapper?t:t.querySelector(`[data-node-view-wrapper]`);n&&(t=n),t&&(r={getBoundingClientRect:()=>t.getBoundingClientRect(),getClientRects:()=>[t.getBoundingClientRect()]})}if(e instanceof fr){let{$anchorCell:t,$headCell:n}=e,i=t?t.pos:n.pos,a=n?n.pos:t.pos,o=this.view.nodeDOM(i),s=this.view.nodeDOM(a);if(!o||!s)return;let c=o===s?o.getBoundingClientRect():oT(o.getBoundingClientRect(),s.getBoundingClientRect());r={getBoundingClientRect:()=>c,getClientRects:()=>[c]}}return r}updatePosition(){if(!this.isVisible)return;let e=this.virtualElement;e&&Ci(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){let{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,t);return}let i=!t?.selection.eq(e.state.selection),a=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,a,t)}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:e,from:i,to:a})||!1}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener(`dragstart`,this.dragstartHandler),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},cT=e=>new Cr({key:typeof e.pluginKey==`string`?new yr(e.pluginKey):e.pluginKey,view:t=>new sT({view:t,...e})});Nn.create({name:`bubbleMenu`,addOptions(){return{element:null,pluginKey:`bubbleMenu`,updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[cT({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var lT=class{constructor({editor:e,element:t,view:n,pluginKey:r=`floatingMenu`,updateDelay:i=250,resizeDelay:a=60,options:o,appendTo:s,shouldShow:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:e,state:t})=>{let{selection:n}=t,{$anchor:r,empty:i}=n,a=r.depth===1,o=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&r.parent.childCount===0&&!this.getTextContent(r.parent);return!(!e.hasFocus()||!i||!a||!o||!this.editor.isEditable)},this.floatingUIOptions={strategy:`absolute`,placement:`right`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=o?.scrollTarget??window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,c&&(this.shouldShow=c),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(e){return Bn(e,{textSerializers:Gn(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(Dn(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(_r(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(pr(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(Wn(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Vn(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(Zn(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(hr(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(Hn(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,view:this.view,state:t,oldState:e,from:i,to:a})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){let{selection:e}=this.editor.state,t=Un(this.view,e.from,e.to);Ci({getBoundingClientRect:()=>t,getClientRects:()=>[t]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,r,t)}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},uT=e=>new Cr({key:typeof e.pluginKey==`string`?new yr(e.pluginKey):e.pluginKey,view:t=>new lT({view:t,...e})});Nn.create({name:`floatingMenu`,addOptions(){return{element:null,options:{},pluginKey:`floatingMenu`,updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,`updatePosition`),!0)}},addProseMirrorPlugins(){return this.options.element?[uT({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function dT(e,t){return e??new yr(t)}var fT=typeof window<`u`?Q.useLayoutEffect:Q.useEffect,pT=new Set([`left`,`opacity`,`position`,`top`,`visibility`,`width`]),mT=new Set(`animationIterationCount.aspectRatio.borderImageOutset.borderImageSlice.borderImageWidth.columnCount.columns.fillOpacity.flex.flexGrow.flexShrink.fontWeight.gridArea.gridColumn.gridColumnEnd.gridColumnStart.gridRow.gridRowEnd.gridRowStart.lineClamp.lineHeight.opacity.order.orphans.scale.stopOpacity.strokeDasharray.strokeDashoffset.strokeMiterlimit.strokeOpacity.strokeWidth.tabSize.widows.zIndex.zoom`.split(`.`)),hT=new Set([`children`,`className`,`style`]),gT=new Set([`tabIndex`]),_T=new Set([`accessKey`,`autoCapitalize`,`contentEditable`,`contextMenu`,`dir`,`draggable`,`enterKeyHint`,`hidden`,`id`,`lang`,`nonce`,`role`,`slot`,`spellCheck`,`tabIndex`,`title`,`translate`]),vT={Blur:`focusout`,DoubleClick:`dblclick`,Focus:`focusin`,MouseEnter:`mouseenter`,MouseLeave:`mouseleave`};function yT(e,t){return/^on[A-Z]/.test(e)&&typeof t==`function`}function bT(e){return e.startsWith(`aria-`)||e.startsWith(`data-`),e}function xT(e){return e.startsWith(`aria-`)||e.startsWith(`data-`)||_T.has(e)}function ST(e){return e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function CT(e){let t=e.endsWith(`Capture`),n=(t?e.slice(0,-7):e).slice(2);return{eventName:vT[n]??n.toLowerCase(),options:t?{capture:!0}:void 0}}function wT(e,t){let n=t.defaultPrevented,r=!1,i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>void 0},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>r},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{r=!0,t.stopPropagation()}}}),i}function TT(e){return gT.has(e)}function ET(e,t,n){if(t===`tabIndex`){e.tabIndex=Number(n);return}e[t]=n}function DT(e,t){if(t===`tabIndex`){e.removeAttribute(`tabindex`);return}let n=e[t];if(typeof n==`boolean`){e[t]=!1;return}if(typeof n==`number`){e[t]=0;return}e[t]=``}function OT(e,t){return typeof t!=`number`||t===0||e.startsWith(`--`)||mT.has(e)?String(t):`${t}px`}function kT(e,t){pT.has(t)||e.style.removeProperty(ST(t))}function AT(e,t,n){pT.has(t)||e.style.setProperty(ST(t),OT(t,n))}function jT(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(r=>{if(hT.has(r)||!xT(r)||yT(r,t[r])||yT(r,n[r]))return;let i=t[r],a=n[r];if(i===a)return;let o=bT(r);if(a==null||a===!1){TT(r)&&DT(e,r),e.removeAttribute(o);return}if(a===!0){TT(r)&&ET(e,r,!0),e.setAttribute(o,``);return}if(TT(r)){ET(e,r,a);return}e.setAttribute(o,String(a))})}function MT(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute(`class`)}}function NT(e,t,n){let r=t??{},i=n??{};new Set([...Object.keys(r),...Object.keys(i)]).forEach(t=>{let n=r[t],a=i[t];if(n!==a){if(a==null){kT(e,t);return}AT(e,t,a)}})}function PT(e,t,n){t.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)});let r=[];return Object.entries(n).forEach(([t,n])=>{if(!yT(t,n))return;let{eventName:i,options:a}=CT(t),o=t=>{n(wT(e,t))};e.addEventListener(i,o,a),r.push({eventName:i,listener:o,options:a})}),r}function FT(e,t){let n=(0,Q.useRef)({}),r=(0,Q.useRef)([]);fT(()=>{let i=n.current;return MT(e,i.className,t.className),NT(e,i.style,t.style),jT(e,i,t),r.current=PT(e,r.current,t),n.current=t,()=>{r.current.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)}),r.current=[]}},[e,t])}var IT=Q.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,getReferencedVirtualElement:o,options:s,children:c,...l},u)=>{let d=(0,Q.useRef)(document.createElement(`div`)),f=(0,Q.useRef)(dT(e,`bubbleMenu`)).current;FT(d.current,l),typeof u==`function`?u(d.current):u&&(u.current=d.current);let{editor:p}=Ze(),m=t||p,h={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:f,shouldShow:a,getReferencedVirtualElement:o,options:s},g=(0,Q.useRef)(h);g.current=h;let[_,v]=(0,Q.useState)(!1),y=(0,Q.useRef)(!0);return(0,Q.useEffect)(()=>{if(m?.isDestroyed)return;if(!m){console.warn(`BubbleMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=d.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=cT({...g.current,editor:m,element:e});m.registerPlugin(t);let n=g.current.pluginKey;return y.current=!0,v(!0),()=>{v(!1),m.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[m]),(0,Q.useEffect)(()=>{if(!(!_||!m||m.isDestroyed)){if(y.current){y.current=!1;return}m.view.dispatch(m.state.tr.setMeta(f,{type:`updateOptions`,options:g.current}))}},[_,m,n,r,a,s,i,o,f]),(0,Zs.createPortal)(c,d.current)});Q.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,options:o,children:s,...c},l)=>{let u=(0,Q.useRef)(document.createElement(`div`)),d=(0,Q.useRef)(dT(e,`floatingMenu`)).current;FT(u.current,c),typeof l==`function`?l(u.current):l&&(l.current=u.current);let{editor:f}=Ze(),p=t||f,m={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:d,shouldShow:a,options:o},h=(0,Q.useRef)(m);h.current=m;let[g,_]=(0,Q.useState)(!1),v=(0,Q.useRef)(!0);return(0,Q.useEffect)(()=>{if(p?.isDestroyed)return;if(!p){console.warn(`FloatingMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=u.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=uT({...h.current,editor:p,element:e});p.registerPlugin(t);let n=h.current.pluginKey;return v.current=!0,_(!0),()=>{_(!1),p.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[p]),(0,Q.useEffect)(()=>{if(!(!g||!p||p.isDestroyed)){if(v.current){v.current=!1;return}p.view.dispatch(p.state.tr.setMeta(d,{type:`updateOptions`,options:h.current}))}},[g,p,n,r,a,o,i,d]),(0,Zs.createPortal)(s,u.current)});var LT=[{name:`paragraph`,label:`Text`,icon:zc,isActive:e=>e.isActive(`paragraph`)&&!e.isActive(`list`),command:e=>e.chain().focus().setParagraph().run()},{name:`heading1`,label:`Heading 1`,icon:f,isActive:e=>e.isActive(`heading`,{level:1}),command:e=>e.chain().focus().toggleHeading({level:1}).run()},{name:`heading2`,label:`Heading 2`,icon:Ut,isActive:e=>e.isActive(`heading`,{level:2}),command:e=>e.chain().focus().toggleHeading({level:2}).run()},{name:`heading3`,label:`Heading 3`,icon:ue,isActive:e=>e.isActive(`heading`,{level:3}),command:e=>e.chain().focus().toggleHeading({level:3}).run()},{name:`bulletList`,label:`Bullet List`,icon:W,isActive:e=>e.isActive(`list`,{ordered:!1})&&!e.isActive(`listItem`,{checked:!0})&&!e.isActive(`listItem`,{checked:!1}),command:e=>e.chain().focus().toggleBulletList().run()},{name:`orderedList`,label:`Ordered List`,icon:oe,isActive:e=>e.isActive(`list`,{ordered:!0}),command:e=>e.chain().focus().toggleOrderedList().run()},{name:`taskList`,label:`Task List`,icon:te,isActive:e=>e.isActive(`listItem`,{checked:!0})||e.isActive(`listItem`,{checked:!1}),command:e=>e.chain().focus().toggleTaskList().run()},{name:`blockquote`,label:`Quote`,icon:v,isActive:e=>e.isActive(`blockquote`),command:e=>e.chain().focus().toggleBlockquote().run()},{name:`codeBlock`,label:`Code Block`,icon:Qc,isActive:e=>e.isActive(`codeBlock`),command:e=>e.chain().focus().toggleCodeBlock().run()}];function RT(e){let t=(0,$.c)(18),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:zT},t[0]=n,t[1]=r);let{current:i,activeStates:a}=Xe(r),o=i.icon,s;t[2]===o?s=t[3]:(s=(0,Z.jsx)(o,{className:`size-3.5`}),t[2]=o,t[3]=s);let c;t[4]===i.label?c=t[5]:(c=(0,Z.jsx)(`span`,{children:i.label}),t[4]=i.label,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(Ge,{className:`size-3 opacity-50`}),t[6]=l):l=t[6];let u;t[7]!==s||t[8]!==c?(u=(0,Z.jsx)(ja,{asChild:!0,children:(0,Z.jsxs)(Y,{variant:`ghost`,size:`sm`,className:`gap-1 px-2 text-sm font-medium text-accent-foreground/80`,children:[s,c,l]})}),t[7]=s,t[8]=c,t[9]=u):u=t[9];let d;t[10]!==a||t[11]!==n?(d=LT.map(e=>{let t=e.icon,r=a[e.name];return(0,Z.jsxs)(Aa,{className:r?`bg-accent text-accent-foreground`:``,onSelect:()=>{e.command(n)},children:[(0,Z.jsx)(t,{className:`size-4`}),(0,Z.jsx)(`span`,{children:e.label})]},e.name)}),t[10]=a,t[11]=n,t[12]=d):d=t[12];let f;t[13]===d?f=t[14]:(f=(0,Z.jsx)(Oa,{align:`start`,sideOffset:8,className:`w-44 max-h-(--radix-dropdown-menu-content-available-height) overflow-y-auto subtle-scrollbar`,children:d}),t[13]=d,t[14]=f);let p;return t[15]!==u||t[16]!==f?(p=(0,Z.jsxs)(ka,{children:[u,f]}),t[15]=u,t[16]=f,t[17]=p):p=t[17],p}function zT(e){let t=Object.fromEntries(LT.map(t=>[t.name,t.isActive(e.editor)]));return{current:LT.find(e=>t[e.name])??LT[0],activeStates:t}}function BT(e){let t=e.state.selection.node;if(!t||t.type.name!==`jsxComponent`)return null;let n=t.attrs.componentName;if(n!==`File`&&n!==`WikiEmbedFile`)return null;let r=(t.attrs.props??{}).src;return typeof r!=`string`||r.length===0?null:r}function VT(e){let t=e.state.selection.node;if(!t)return``;let n=t.attrs.props??{},r=typeof n.alias==`string`?n.alias:``;if(r.length>0)return r;let i=typeof n.name==`string`?n.name:``;return i.length>0?i:Ke(typeof n.src==`string`?n.src:``)}function HT(e,t){let n=document.createElement(`a`);n.href=e,n.download=t,n.rel=`noopener noreferrer`,n.style.display=`none`,document.body.appendChild(n),n.click(),n.remove()}function UT(e){let t=(0,$.c)(10),{editor:n}=e,r;if(t[0]===n?r=t[1]:(r={editor:n,selector:WT},t[0]=n,t[1]=r),Xe(r)===null)return null;let i;t[2]===n?i=t[3]:(i=e=>{e.preventDefault();let t=BT(n);t&&HT(t,VT(n))},t[2]=n,t[3]=i);let a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(Xa,{className:`size-3.5`}),t[4]=a):a=t[4];let o;t[5]===i?o=t[6]:(o=(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-xs`,"aria-label":`Download file`,className:`text-accent-foreground`,onMouseDown:i,children:a})}),t[5]=i,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(er,{side:`bottom`,sideOffset:8,children:`Download file`}),t[7]=s):s=t[7];let c;return t[8]===o?c=t[9]:(c=(0,Z.jsx)(`div`,{className:`flex items-center gap-0.5`,children:(0,Z.jsxs)(jn,{children:[o,s]})}),t[8]=o,t[9]=c),c}function WT(e){return BT(e.editor)}function GT(e){return BT(e)!==null}var KT=[{value:`left`,label:`Align left`,icon:h},{value:`center`,label:`Align center`,icon:he},{value:`right`,label:`Align right`,icon:Ft}];function qT(e){let t=e.state.selection.node;if(!t||t.type.name!==`jsxComponent`)return null;let n=t.attrs.componentName;if(n!==`img`&&n!==`CommonMarkImage`&&n!==`Embed`)return null;let r=(t.attrs.props??{}).align;return r===`left`||r===`right`||r===`center`?r:`center`}function JT(e){let t=(0,$.c)(7),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:YT},t[0]=n,t[1]=r);let i=Xe(r);if(i===null)return null;let a;t[2]!==i||t[3]!==n?(a=KT.map(e=>{let{value:t,label:r,icon:a}=e,o=i===t;return(0,Z.jsxs)(jn,{children:[(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-xs`,"aria-label":r,"aria-pressed":o,className:o?`bg-accent text-primary`:`text-accent-foreground`,onMouseDown:e=>{e.preventDefault();let r=n.state.selection,i=r.node;if(!i||i.type.name!==`jsxComponent`)return;let a=String(i.attrs.componentName??``);if(a!==`img`&&a!==`CommonMarkImage`&&a!==`Embed`||i.attrs.kind!==`element`)return;let o=a===`CommonMarkImage`,s=r.from,c={...i.attrs.props??{},align:t},l=o?{...i.attrs,componentName:`img`,props:c,sourceDirty:!0}:{...i.attrs,props:c,sourceDirty:!0},u=n.state.tr.setNodeMarkup(s,null,l);u.setSelection(Kn.create(u.doc,s)),Ye(n.view.nodeDOM(s),()=>{n.view.dispatch(u)})},children:(0,Z.jsx)(a,{className:`size-3.5`})})}),(0,Z.jsx)(er,{side:`bottom`,sideOffset:8,children:r})]},t)}),t[2]=i,t[3]=n,t[4]=a):a=t[4];let o;return t[5]===a?o=t[6]:(o=(0,Z.jsx)(`div`,{className:`flex items-center gap-0.5`,children:a}),t[5]=a,t[6]=o),o}function YT(e){return qT(e.editor)}function XT(e){return qT(e)!==null}var ZT=[{name:`bold`,icon:Xs,command:e=>e.chain().focus().toggleBold().run(),isActive:e=>e.isActive(`strong`),shortcut:`⌘ B`},{name:`italic`,icon:wc,command:e=>e.chain().focus().toggleItalic().run(),isActive:e=>e.isActive(`emphasis`),shortcut:`⌘ I`},{name:`underline`,icon:ol,command:e=>e.chain().focus().toggleUnderline().run(),isActive:e=>e.isActive(`underline`),shortcut:`⌘ U`},{name:`strikethrough`,icon:nl,command:e=>e.chain().focus().toggleStrike().run(),isActive:e=>e.isActive(`strike`),shortcut:`⌘ ⇧ X`},{name:`code`,icon:oc,command:e=>e.chain().focus().toggleCode().run(),isActive:e=>e.isActive(`code`),shortcut:`⌘ E`},{name:`highlight`,icon:Cc,command:e=>e.chain().focus().toggleHighlight().run(),isActive:e=>e.isActive(`highlight`),shortcut:`⌘ ⇧ H`}];function QT(e){let t=(0,$.c)(7),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:$T},t[0]=n,t[1]=r);let i=Xe(r),a;t[2]!==i||t[3]!==n?(a=ZT.map(e=>{let t=e.icon,r=i[e.name];return(0,Z.jsxs)(jn,{children:[(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-xs`,"aria-label":e.name,className:r?`bg-accent text-primary`:`text-accent-foreground`,onMouseDown:t=>{t.preventDefault(),e.command(n)},children:(0,Z.jsx)(t,{className:`size-3.5`})})}),(0,Z.jsxs)(er,{side:`bottom`,sideOffset:8,children:[(0,Z.jsx)(`span`,{className:`capitalize`,children:e.name}),(0,Z.jsx)(sC,{children:Ti()?e.shortcut:e.shortcut.replace(`⌘`,`Ctrl`)})]})]},e.name)}),t[2]=i,t[3]=n,t[4]=a):a=t[4];let o;return t[5]===a?o=t[6]:(o=(0,Z.jsx)(`div`,{className:`flex items-center gap-0.5`,children:a}),t[5]=a,t[6]=o),o}function $T(e){return Object.fromEntries(ZT.map(t=>[t.name,t.isActive(e.editor)]))}function eE(e){let t=(0,$.c)(46),{editor:n}=e,[r,i]=(0,Q.useState)(!1),[a,o]=(0,Q.useState)(``),s=(0,Q.useRef)(null),c;t[0]===n?c=t[1]:(c=n.isActive(`link`),t[0]=n,t[1]=c);let l=c,u;t[2]===n?u=t[3]:(u=n.getAttributes(`link`).href??``,t[2]=n,t[3]=u);let d=u,f,p;t[4]===n?(f=t[5],p=t[6]):(f=()=>{let e=function(){n.state.selection.empty&&i(!1)};return n.on(`selectionUpdate`,e),()=>{n.off(`selectionUpdate`,e)}},p=[n],t[4]=n,t[5]=f,t[6]=p),(0,Q.useEffect)(f,p);let m,h;t[7]!==d||t[8]!==r?(m=()=>{r&&(o(d),requestAnimationFrame(()=>s.current?.focus()))},h=[r,d],t[7]=d,t[8]=r,t[9]=m,t[10]=h):(m=t[9],h=t[10]),(0,Q.useEffect)(m,h);let g;t[11]!==n||t[12]!==l||t[13]!==a?(g=function(){a.trim()?n.chain().focus().setLink({href:a.trim()}).run():l&&n.chain().focus().unsetLink().run(),i(!1)},t[11]=n,t[12]=l,t[13]=a,t[14]=g):g=t[14];let _=g,v;t[15]===n?v=t[16]:(v=function(){n.chain().focus().unsetLink().run(),i(!1)},t[15]=n,t[16]=v);let y=v,b;t[17]!==_||t[18]!==n?(b=function(e){e.key===`Enter`&&(e.preventDefault(),_()),e.key===`Escape`&&(e.preventDefault(),i(!1),n.chain().focus().run())},t[17]=_,t[18]=n,t[19]=b):b=t[19];let x=b;if(r){let e;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(e=e=>o(e.target.value),t[20]=e):e=t[20];let n;t[21]!==x||t[22]!==a?(n=(0,Z.jsx)(`input`,{ref:s,type:`url`,placeholder:`Paste link`,value:a,onChange:e,onKeyDown:x,"aria-label":`Link URL`,className:`h-5 w-44 bg-transparent text-sm border-none outline-none placeholder:text-muted-foreground`}),t[21]=x,t[22]=a,t[23]=n):n=t[23];let r;t[24]===_?r=t[25]:(r=()=>{_()},t[24]=_,t[25]=r);let i;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(uc,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[26]=i):i=t[26];let c;t[27]===r?c=t[28]:(c=(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-xs`,"aria-label":`Apply link`,onClick:r,children:i}),t[27]=r,t[28]=c);let u;t[29]!==n||t[30]!==c?(u=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-md border bg-background px-2 py-1`,children:[n,c]}),t[29]=n,t[30]=c,t[31]=u):u=t[31];let f;t[32]!==d||t[33]!==l||t[34]!==y?(f=l&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(jn,{children:[(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-xs`,"aria-label":`Open link in new tab`,onMouseDown:e=>{e.preventDefault(),_e(d)},children:(0,Z.jsx)(wo,{className:`size-3.5`})})}),(0,Z.jsx)(er,{side:`bottom`,sideOffset:8,children:`Open link in new tab`})]}),(0,Z.jsxs)(jn,{children:[(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-xs`,"aria-label":`Remove link`,onMouseDown:e=>{e.preventDefault(),y()},children:(0,Z.jsx)(fe,{className:`size-3.5`})})}),(0,Z.jsx)(er,{side:`bottom`,sideOffset:8,children:`Remove link`})]})]}),t[32]=d,t[33]=l,t[34]=y,t[35]=f):f=t[35];let p;return t[36]!==u||t[37]!==f?(p=(0,Z.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[u,f]}),t[36]=u,t[37]=f,t[38]=p):p=t[38],p}let S=l?`bg-accent text-primary`:`text-accent-foreground`,C,w;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>{e.preventDefault(),i(!0)},w=(0,Z.jsx)(Dc,{className:`size-3.5`}),t[39]=C,t[40]=w):(C=t[39],w=t[40]);let T;t[41]===S?T=t[42]:(T=(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-xs`,"aria-label":`Insert link`,className:S,onMouseDown:C,children:w})}),t[41]=S,t[42]=T);let E;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Z.jsxs)(er,{side:`bottom`,sideOffset:8,children:[`Link`,(0,Z.jsx)(sC,{children:Ti()?`⌘ K`:`Ctrl K`})]}),t[43]=E):E=t[43];let D;return t[44]===T?D=t[45]:(D=(0,Z.jsxs)(jn,{children:[T,E]}),t[44]=T,t[45]=D),D}function tE({editor:e}){if(et(e.state).query||e.isActive(`codeBlock`))return!1;if(XT(e)||GT(e))return!0;if(e.state.selection.empty)return!1;let{from:t,to:n}=e.state.selection;return!!e.state.doc.textBetween(t,n,` `).trim()}function nE(e){let t=(0,$.c)(22),{editor:n}=e,r=(0,Q.useRef)(null),[i,a]=(0,Q.useState)(0),o=(0,Q.useRef)(null),s;t[0]===n?s=t[1]:(s={editor:n,selector:sE},t[0]=n,t[1]=s);let c=Xe(s),l;t[2]===n?l=t[3]:(l={editor:n,selector:oE},t[2]=n,t[3]=l);let u=Xe(l),d;t[4]!==n.state||t[5]!==n.view?(d=()=>{try{let{from:e,to:t}=n.state.selection;return Un(n.view,e,t)}catch{return new DOMRect}},t[4]=n.state,t[5]=n.view,t[6]=d):d=t[6];let f;if(t[7]!==n.view.dom||t[8]!==d){let e={getBoundingClientRect:d,contextElement:n.view.dom};f=()=>{let t=r.current;t&&(o.current?.(),o.current=ar(e,t,()=>{Ci(e,t,{placement:`top`,strategy:`fixed`,middleware:[pr(8),Dn(),_r({padding:8})]}).then(e=>{let{x:n,y:r}=e;t.isConnected&&(t.style.position=`fixed`,t.style.left=`${n}px`,t.style.top=`${r}px`)}).catch(aE)}))},t[7]=n.view.dom,t[8]=d,t[9]=f}else f=t[9];let p=f,m;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>{o.current?.(),o.current=null,a(iE)},t[10]=m):m=t[10];let h=m,g;t[11]===p?g=t[12]:(g={onShow:p,onHide:h,strategy:`fixed`},t[11]=p,t[12]=g);let _;t[13]!==n||t[14]!==u||t[15]!==c||t[16]!==i?(_=c?(0,Z.jsx)(JT,{editor:n},`${i}-img-align`):u?(0,Z.jsx)(UT,{editor:n},`${i}-file`):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(RT,{editor:n}),(0,Z.jsx)(Ba,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),(0,Z.jsx)(QT,{editor:n},i),(0,Z.jsx)(Ba,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),(0,Z.jsx)(eE,{editor:n},`${i}-link`)]}),t[13]=n,t[14]=u,t[15]=c,t[16]=i,t[17]=_):_=t[17];let v;return t[18]!==n||t[19]!==g||t[20]!==_?(v=(0,Z.jsx)(IT,{ref:r,editor:n,"data-testid":`bubble-menu-bar`,appendTo:rE,shouldShow:tE,updateDelay:250,options:g,className:`z-50 flex items-center gap-0.5 rounded-lg border bg-background p-1 shadow-md`,children:_}),t[18]=n,t[19]=g,t[20]=_,t[21]=v):v=t[21],v}function rE(){return document.body}function iE(e){return e+1}function aE(){}function oE(e){return GT(e.editor)}function sE(e){return XT(e.editor)}var cE=[{name:`addRowBefore`,icon:St,label:`Add row above`,command:e=>e.chain().focus().addRowBefore().run()},{name:`addRowAfter`,icon:$e,label:`Add row below`,command:e=>e.chain().focus().addRowAfter().run()},{name:`deleteRow`,icon:fe,label:`Delete row`,command:e=>e.chain().focus().deleteRow().run()}],lE=[{name:`addColumnBefore`,icon:Gi,label:`Add column left`,command:e=>e.chain().focus().addColumnBefore().run()},{name:`addColumnAfter`,icon:_a,label:`Add column right`,command:e=>e.chain().focus().addColumnAfter().run()},{name:`deleteColumn`,icon:fe,label:`Delete column`,command:e=>e.chain().focus().deleteColumn().run()}],uE=[{name:`toggleHeaderRow`,icon:rl,label:`Toggle header row`,command:e=>e.chain().focus().toggleHeaderRow().run()},{name:`toggleHeaderColumn`,icon:cc,label:`Toggle header column`,command:e=>e.chain().focus().toggleHeaderColumn().run()},{name:`deleteTable`,icon:xc,label:`Delete table`,command:e=>e.chain().focus().deleteTable().run()}];function dE({editor:e}){return et(e.state).query?!1:e.isActive(`table`)}function fE(e){let t=(0,$.c)(14),{action:n,editor:r}=e,i=n.icon,a;t[0]!==n||t[1]!==r?(a=e=>{e.preventDefault(),n.command(r)},t[0]=n,t[1]=r,t[2]=a):a=t[2];let o;t[3]===i?o=t[4]:(o=(0,Z.jsx)(i,{className:`size-3.5`}),t[3]=i,t[4]=o);let s;t[5]!==n.label||t[6]!==a||t[7]!==o?(s=(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-xs`,"aria-label":n.label,className:`text-muted-foreground`,onMouseDown:a,children:o})}),t[5]=n.label,t[6]=a,t[7]=o,t[8]=s):s=t[8];let c;t[9]===n.label?c=t[10]:(c=(0,Z.jsx)(er,{side:`bottom`,sideOffset:8,children:n.label}),t[9]=n.label,t[10]=c);let l;return t[11]!==s||t[12]!==c?(l=(0,Z.jsxs)(jn,{children:[s,c]}),t[11]=s,t[12]=c,t[13]=l):l=t[13],l}function pE(e){let t=(0,$.c)(13),{editor:n}=e,r;t[0]===n?r=t[1]:(r=cE.map(e=>(0,Z.jsx)(fE,{action:e,editor:n},e.name)),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(Ba,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),t[2]=i):i=t[2];let a;t[3]===n?a=t[4]:(a=lE.map(e=>(0,Z.jsx)(fE,{action:e,editor:n},e.name)),t[3]=n,t[4]=a);let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(Ba,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),t[5]=o):o=t[5];let s;t[6]===n?s=t[7]:(s=uE.map(e=>(0,Z.jsx)(fE,{action:e,editor:n},e.name)),t[6]=n,t[7]=s);let c;return t[8]!==n||t[9]!==r||t[10]!==a||t[11]!==s?(c=(0,Z.jsxs)(IT,{editor:n,"data-testid":`table-controls-menu`,shouldShow:dE,updateDelay:100,className:`flex items-center gap-0.5 rounded-lg border bg-background p-1 shadow-md`,children:[r,i,a,o,s]}),t[8]=n,t[9]=r,t[10]=a,t[11]=s,t[12]=c):c=t[12],c}var mE=new WeakMap;function hE(e){let t=document.createElement(`span`);t.classList.add(`collaboration-cursor__caret`),t.style.borderColor=e.color;let n=document.createElement(`div`);return n.classList.add(`collaboration-cursor__label`),n.style.backgroundColor=e.color,n.style.color=Mn(e.color),n.textContent=e.name,t.append(n),t}var gE={state:`idle`,count:0,lastFiredAt:null,position:`append`,lastAgentId:null},_E=100,vE=100,yE=3,bE=250;function xE(){let e=new rr({extensions:Or});return{mdManager:e,text:vt({mdManager:e}),html:L({mdManager:e}),paste:ke({mdManager:e}),drop:P({mdManager:e})}}function SE(e){let{provider:t,placeholder:n,prebuiltMapping:r}=e;return[...ht.map(e=>e.name===`link`||e.name===`wikiLink`||e.name===`jsxComponent`?e.configure({docName:t.configuration.name??``}):e.name===`toggleHeadings`?e.configure({getDocName:()=>t.configuration.name??null}):e),Qw.configure({placeholder:n??`Type '/' for commands`,showOnlyCurrent:!0}),Ce.configure({document:t.document,...r?{ySyncOptions:{mapping:r}}:{}}),Nn.create({name:`imageUploadDecoration`,addProseMirrorPlugins(){return[kt]}}),Nn.create({name:`collaborationCursor`,addProseMirrorPlugins(){let e=t.awareness;if(!e)throw Error(`[TiptapEditor] HocuspocusProvider has no awareness instance — cursor plugin cannot initialize`);return[c(e,{cursorBuilder:hE})]}})]}function CE(e){let{provider:t,clipboard:n,ctorStart:r}=e;return{onBeforeCreate:({editor:e})=>{mE.set(e,r)},onCreate:({editor:e})=>{n.html.setView(e.view);let r=mE.get(e);if(mE.delete(e),r==null)return;let i=performance.now();Mt(`ok/editor/create-tiptap`,{docName:t.configuration.name??`unknown`,ytextLength:t.document.getText(`source`).length},{startTime:r,duration:Math.max(0,i-r)})},editorProps:{attributes:{class:`pt-4 pb-4 h-full`},clipboardTextParser:(e,t,r,i)=>{let a=n.mdManager.parse(e);return i.state.schema.nodeFromJSON(a).content},clipboardTextSerializer:(e,t)=>n.text(e,t),clipboardSerializer:n.html.serializer,handlePaste:(e,t)=>n.paste(e,t),handleDrop:(e,t)=>n.drop(e,t)},extensions:$f(SE(e))}}function wE(e){let{provider:t,placeholder:n,clipboard:r,ctorStart:i}=e,a=nr(SE({provider:t,placeholder:n,clipboard:r,ctorStart:i})),{doc:o,mapping:s}=ce(t.document.getXmlFragment(`default`),a);return{...CE({provider:t,placeholder:n,clipboard:r,ctorStart:i,prebuiltMapping:s}),content:o.toJSON(),element:null}}var TE=e=>{let t=(0,$.c)(21),{provider:n,placeholder:r,isSourceMode:i,portalTarget:a}=e,o=(0,Q.useRef)(null),s=(0,Q.useRef)(gE),c=iT(),{principal:l,activeDocName:u}=ut(),d=n.configuration.name??``,[f]=(0,Q.useState)(xE),p;t[0]!==f||t[1]!==r||t[2]!==n?(p=()=>()=>({editor:new Ln(wE({provider:n,placeholder:r,clipboard:f,ctorStart:performance.now()})),ydoc:n.document,ytext:n.document.getText(`source`),provider:n}),t[0]=f,t[1]=r,t[2]=n,t[3]=p):p=t[3];let[m]=(0,Q.useState)(p),h,_;if(t[4]!==m||t[5]!==d||t[6]!==n.document){let e={viewCount:0,bytes:n.document.getText(`source`).length},r=S(d)??crypto.randomUUID();h=Q.use,_=g({docName:d,mountId:r,construct:m,sizeStats:e}),t[4]=m,t[5]=d,t[6]=n.document,t[7]=h,t[8]=_}else h=t[7],_=t[8];let v=h(_),y=v.editor,b,x;t[9]===v?(b=t[10],x=t[11]):(b=()=>()=>{Ie(v)},x=[v],t[9]=v,t[10]=b,t[11]=x),(0,Q.useEffect)(b,x);let C;return t[12]!==u||t[13]!==d||t[14]!==y||t[15]!==c||t[16]!==i||t[17]!==a||t[18]!==l||t[19]!==n?(C=(0,Z.jsx)(EE,{provider:n,isSourceMode:i,docName:d,activeDocName:u,identity:c,principal:l,editor:y,wrapperRef:o,flashStateRef:s,portalTarget:a}),t[12]=u,t[13]=d,t[14]=y,t[15]=c,t[16]=i,t[17]=a,t[18]=l,t[19]=n,t[20]=C):C=t[20],C},EE=e=>{let t=(0,$.c)(85),{provider:n,isSourceMode:r,docName:i,activeDocName:a,identity:o,principal:s,editor:c,wrapperRef:l,flashStateRef:u,portalTarget:f}=e,p=(0,Q.useRef)(null),h,g;t[0]===f?(h=t[1],g=t[2]):(h=()=>{let e=p.current;if(e)return e.appendChild(f),()=>{f.parentNode===e&&e.removeChild(f)}},g=[f],t[0]=f,t[1]=h,t[2]=g),(0,Q.useLayoutEffect)(h,g);let _;t[3]!==c||t[4]!==n.configuration.name?(_=()=>(Ct(c,n.configuration.name??null),()=>{Ct(c,null)}),t[3]=c,t[4]=n.configuration.name,t[5]=_):_=t[5];let v;t[6]!==c||t[7]!==n?(v=[c,n],t[6]=c,t[7]=n,t[8]=v):v=t[8],(0,Q.useEffect)(_,v);let y;t[9]!==c||t[10]!==n.configuration.name?(y=()=>{let e=n.configuration.name;if(e)return it(e,c),()=>nt(e,c)},t[9]=c,t[10]=n.configuration.name,t[11]=y):y=t[11];let b;t[12]!==c||t[13]!==n?(b=[c,n],t[12]=c,t[13]=n,t[14]=b):b=t[14],(0,Q.useEffect)(y,b);let x;t[15]!==c||t[16]!==n.configuration.name?(x=()=>{},t[15]=c,t[16]=n.configuration.name,t[17]=x):x=t[17];let S;t[18]!==c||t[19]!==n?(S=[c,n],t[18]=c,t[19]=n,t[20]=S):S=t[20],(0,Q.useEffect)(x,S);let C,w;t[21]===c?(C=t[22],w=t[23]):(w=()=>{let e=DE,t=null,n=()=>{if(t||c.isDestroyed)return;let n=m(c);n&&(t=n.dom,t.addEventListener(`keydown`,e),t.addEventListener(`paste`,e),t.addEventListener(`drop`,e),t.addEventListener(`cut`,e))},r=()=>{t&&=(t.removeEventListener(`keydown`,e),t.removeEventListener(`paste`,e),t.removeEventListener(`drop`,e),t.removeEventListener(`cut`,e),null)};return m(c)?n():c.on(`create`,n),()=>{c.off(`create`,n),r()}},C=[c],t[21]=c,t[22]=C,t[23]=w),(0,Q.useEffect)(w,C);let T,E;t[24]!==i||t[25]!==c?(T=()=>{let e=!1,t=()=>{if(e||c.isDestroyed||!m(c))return;e=!0;let t=Nt(i)?.selection??null;if(t)try{let e=c.state.doc.content.size;if(t.type===`text`){let n=Math.max(0,Math.min(t.anchor,e)),r=Math.max(0,Math.min(t.head,e));c.commands.setTextSelection({from:n,to:r})}else{let n=Math.max(0,Math.min(t.from,e));c.commands.setNodeSelection(n)}}catch(e){let t=e,n=t instanceof Error?t.message:String(t);console.warn(JSON.stringify({event:`ok-editor-selection-restore-failed`,docName:i,message:n})),Mt(`ok/editor/selection-restore-failed`,{docName:i,message:n})}lt(i)};if(m(c)){t();return}return c.on(`create`,t),()=>{c.off(`create`,t)}},E=[c,i],t[24]=i,t[25]=c,t[26]=T,t[27]=E):(T=t[26],E=t[27]),(0,Q.useEffect)(T,E);let D,O;t[28]!==u||t[29]!==n.document||t[30]!==l?(D=()=>{let e=n.document.getMap(`agent-flash`),t=Date.now(),r=0,i=null,a=null,o=null,s=()=>{let t=null;for(let[,n]of e.entries()){let e=n;e.timestamp&&(!t||e.timestamp>t.timestamp)&&(t={agentId:e.agentId??`unknown`,timestamp:e.timestamp,type:e.type??`insert`,description:e.description})}return t},c=e=>{u.current=e;let t=l.current;t&&(t.setAttribute(`data-agent-flash-state`,e.state),t.setAttribute(`data-agent-flash-count`,String(e.count)),t.setAttribute(`data-agent-flash-position`,e.position),t.setAttribute(`data-agent-flash-agent-id`,e.lastAgentId??``))},d=()=>{let e=s(),t=e?.description?.toLowerCase().includes(`prepend`)?`prepend`:`append`,n={state:`editing`,count:(u.current?.count??0)+1,lastFiredAt:Date.now(),position:t,lastAgentId:e?.agentId??null};c(n),document.dispatchEvent(new CustomEvent(`agent-flash`,{detail:n})),a&&clearTimeout(a),o&&clearTimeout(o),a=window.setTimeout(()=>{let e={...n,state:`settled`};c(e),document.dispatchEvent(new CustomEvent(`agent-flash-end`,{detail:e})),o=window.setTimeout(()=>{c({...e,state:`idle`})},300)},gi)};c(gE);let f=()=>{if(tr(e),!Qn(e,t)||document.visibilityState!==`visible`)return;let n=Date.now();if(t=n,n-r<500){if(!i){let e=500-(n-r);i=window.setTimeout(()=>{i=null,r=Date.now(),d()},e)}return}r=n,d()};e.observe(f);let p=()=>{document.visibilityState===`visible`?Qn(e,t)&&(t=Date.now(),r=Date.now(),d()):t=Date.now()};return document.addEventListener(`visibilitychange`,p),()=>{e.unobserve(f),document.removeEventListener(`visibilitychange`,p),i&&clearTimeout(i),a&&clearTimeout(a),o&&clearTimeout(o)}},O=[n.document,u,l],t[28]=u,t[29]=n.document,t[30]=l,t[31]=D,t[32]=O):(D=t[31],O=t[32]),(0,Q.useEffect)(D,O);let k,A;t[33]!==a||t[34]!==i||t[35]!==c||t[36]!==n?(k=()=>{let e=0,t,r=null,o=null,s=null,l=function(){if(e<_E){e+=1,t=window.setTimeout(p,vE);return}r=null,o=null,e=0},u=function(e){let t=m(c);if(!t)return null;let n=CSS.escape(e);return t.dom.querySelector(`#${n}`)??t.dom.querySelector(`[data-mirror-source-id="${n}"]`)},d=function(e){let t=u(e);return t?(t.scrollIntoView({behavior:`smooth`,block:`start`}),!0):!1},f=function(e,n){let r=yE,o=()=>{t=void 0,!(i!==a||window.location.hash!==n)&&(d(e),--r,r>0&&(t=window.setTimeout(o,bE)))};t=window.setTimeout(o,bE)};function p(){if(!r||i!==a)return;let t=r,n=o;if(!n){l();return}d(t)?(s=n,r=null,o=null,e=0,f(t,n)):l()}let h=function(){if(i!==a)return;let n=window.location.hash;if(!r&&s===n)return;let c=ci(n);if(!c){s=n;return}r=c,o=n,e=0,t!==void 0&&(clearTimeout(t),t=void 0),p()},g=function(){if(i===a){if(r){p();return}h()}};return h(),n.on(`synced`,g),c.on(`transaction`,g),window.addEventListener(`hashchange`,h),()=>{t!==void 0&&clearTimeout(t),n.off(`synced`,g),c.off(`transaction`,g),window.removeEventListener(`hashchange`,h)}},A=[n,c,i,a],t[33]=a,t[34]=i,t[35]=c,t[36]=n,t[37]=k,t[38]=A):(k=t[37],A=t[38]),(0,Q.useEffect)(k,A);let j,M;t[39]===c?(j=t[40],M=t[41]):(j=()=>{let e=function(e){let t=e.detail;if(!t||t.mode!==`wysiwyg`||c.isDestroyed)return;let n=m(c);if(!n)return;let r=n.dom.querySelectorAll(`h1, h2, h3, h4, h5, h6`)[t.index];r&&r.scrollIntoView({behavior:`smooth`,block:`start`})};return window.addEventListener(js,e),()=>window.removeEventListener(js,e)},M=[c],t[39]=c,t[40]=j,t[41]=M),(0,Q.useEffect)(j,M);let N;t[42]!==a||t[43]!==i||t[44]!==o||t[45]!==r||t[46]!==s||t[47]!==n.awareness?(N=()=>{let e=n.awareness;if(e){if(i!==a){e.setLocalState(null);return}e.setLocalState({user:aT({principal:s,identity:o}),mode:r?`source`:`wysiwyg`})}},t[42]=a,t[43]=i,t[44]=o,t[45]=r,t[46]=s,t[47]=n.awareness,t[48]=N):N=t[48];let P;t[49]!==a||t[50]!==i||t[51]!==o||t[52]!==r||t[53]!==s||t[54]!==n?(P=[n,i,a,o,s,r],t[49]=a,t[50]=i,t[51]=o,t[52]=r,t[53]=s,t[54]=n,t[55]=P):P=t[55],(0,Q.useEffect)(N,P);let F,I;t[56]!==c||t[57]!==r?(F=()=>(Oe(c,r),()=>{Oe(c,!1)}),I=[c,r],t[56]=c,t[57]=r,t[58]=F,t[59]=I):(F=t[58],I=t[59]),(0,Q.useEffect)(F,I);let L;t[60]!==c||t[61]!==r?(L=!r&&(0,Z.jsx)(nE,{editor:c}),t[60]=c,t[61]=r,t[62]=L):L=t[62];let R;t[63]!==c||t[64]!==r?(R=!r&&(0,Z.jsx)(pE,{editor:c}),t[63]=c,t[64]=r,t[65]=R):R=t[65];let z;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Z.jsx)(`div`,{ref:p,style:{display:`contents`}}),t[66]=z):z=t[66];let B;t[67]===c?B=t[68]:(B=(0,Z.jsx)(gt,{editor:c,className:`tiptap-editor-portal-content h-full`}),t[67]=c,t[68]=B);let V;t[69]!==f||t[70]!==B?(V=(0,Zs.createPortal)(B,f),t[69]=f,t[70]=B,t[71]=V):V=t[71];let H;t[72]===c?H=t[73]:(H=(0,Z.jsx)(nT,{editor:c}),t[72]=c,t[73]=H);let U;t[74]===c?U=t[75]:(U=Ht(c),t[74]=c,t[75]=U);let W;t[76]===U.store?W=t[77]:(W=(0,Z.jsx)(d,{store:U.store}),t[76]=U.store,t[77]=W);let G;return t[78]!==L||t[79]!==R||t[80]!==V||t[81]!==H||t[82]!==W||t[83]!==l?(G=(0,Z.jsxs)(`div`,{ref:l,className:`tiptap-editor h-full`,"data-agent-flash-state":`idle`,"data-agent-flash-count":`0`,"data-agent-flash-position":`append`,"data-agent-flash-agent-id":``,children:[L,R,z,V,H,W]}),t[78]=L,t[79]=R,t[80]=V,t[81]=H,t[82]=W,t[83]=l,t[84]=G):G=t[84],G};function DE(){return Pt()}function OE(e){let t=(0,$.c)(2),{docName:n,provider:r,children:i}=e;(0,Q.use)(At(n,r));let a;return t[0]===i?a=t[1]:(a=(0,Z.jsx)(Z.Fragment,{children:i}),t[0]=i,t[1]=a),a}var kE=`__back-nav__`;function AE(e){return e instanceof Ve||e instanceof pt||e instanceof Le||e instanceof Qe||e instanceof wt||e instanceof Be?e.docName:null}function jE(e){return e instanceof Ve?{title:`Couldn't load document`,summary:`"${e.docName}" took too long. Check your connection.`}:e instanceof pt?{title:`Connection dropped`,summary:`Lost connection to "${e.docName}".`}:e instanceof Le?{title:`Document not found`,summary:`"${e.docName}" doesn't exist.`}:e instanceof Qe?{title:`Couldn't open document`,summary:`Something went wrong opening "${e.docName}".`}:e instanceof wt?{title:`Server can't open documents`,summary:`This project's running server doesn't support live editing. Restart Open Knowledge to fix.`}:e instanceof Be?{title:`Cancelled`,summary:`You cancelled loading "${e.docName}".`}:{title:`Unknown error`,summary:e instanceof Error&&e.message?e.message:`An unexpected error occurred.`}}function ME(e){let t=(0,$.c)(27),{error:n,resetErrorBoundary:r,activeDocName:i,previousDocName:a,onNavigateBack:o}=e,s;t[0]===n?s=t[1]:(s=jE(n),t[0]=n,t[1]=s);let{title:c,summary:l}=s,u=!!a&&!!o,d=(0,Q.useRef)(null),f,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>{d.current?.focus()},p=[],t[2]=f,t[3]=p):(f=t[2],p=t[3]),(0,Q.useEffect)(f,p);let m;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(tC,{size:80,variant:`sleeping`}),t[4]=m):m=t[4];let h;t[5]===c?h=t[6]:(h=(0,Z.jsx)(`h2`,{id:`document-error-title`,className:`text-2xl font-light tracking-tighter text-balance`,children:c}),t[5]=c,t[6]=h);let g;t[7]===l?g=t[8]:(g=(0,Z.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:l}),t[7]=l,t[8]=g);let _;t[9]!==h||t[10]!==g?(_=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[h,g]}),t[9]=h,t[10]=g,t[11]=_):_=t[11];let v;t[12]===r?v=t[13]:(v=(0,Z.jsx)(Y,{ref:d,variant:`default`,onClick:r,children:`Try again`}),t[12]=r,t[13]=v);let y;t[14]!==i||t[15]!==u||t[16]!==n||t[17]!==o||t[18]!==a||t[19]!==r?(y=u?(0,Z.jsx)(Y,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>{!a||!o||(at(AE(n)??i),o(a),r(kE))},children:`Go back`}):null,t[14]=i,t[15]=u,t[16]=n,t[17]=o,t[18]=a,t[19]=r,t[20]=y):y=t[20];let b;t[21]!==v||t[22]!==y?(b=(0,Z.jsxs)(`div`,{className:`mt-1 flex gap-2`,children:[v,y]}),t[21]=v,t[22]=y,t[23]=b):b=t[23];let x;return t[24]!==b||t[25]!==_?(x=(0,Z.jsxs)(`div`,{role:`alert`,"aria-labelledby":`document-error-title`,"data-slot":`document-error-boundary`,className:`flex h-full flex-col items-center justify-center gap-8 p-8 text-center`,children:[m,_,b]}),t[24]=b,t[25]=_,t[26]=x):x=t[26],x}function NE(e){let t=(0,$.c)(17),{activeDocName:n,previousDocName:r,onNavigateBack:i,onRecycle:a,children:o}=e,s;t[0]!==n||t[1]!==i||t[2]!==r?(s=e=>(0,Z.jsx)(ME,{...e,activeDocName:n,previousDocName:r,onNavigateBack:i}),t[0]=n,t[1]=i,t[2]=r,t[3]=s):s=t[3];let c;t[4]===n?c=t[5]:(c=[n],t[4]=n,t[5]=c);let l;t[6]!==n||t[7]!==a?(l=e=>{if(e.reason===`imperative-api`){if(Array.isArray(e.args)&&e.args[0]===kE){console.warn(`[DocumentErrorBoundary] back-nav reset (no recycle)`);return}a(n),console.warn(`[DocumentErrorBoundary] retry recycled ${n}`)}else console.warn(`[DocumentErrorBoundary] reset by key change (${e.prev?.[0]} → ${e.next?.[0]})`)},t[6]=n,t[7]=a,t[8]=l):l=t[8];let u;t[9]===n?u=t[10]:(u=e=>{console.error(`[DocumentErrorBoundary] rendered fallback for ${n}: ${jE(e).title}`,e)},t[9]=n,t[10]=u);let d;return t[11]!==o||t[12]!==s||t[13]!==c||t[14]!==l||t[15]!==u?(d=(0,Z.jsx)(le,{fallbackRender:s,resetKeys:c,onReset:l,onError:u,children:o}),t[11]=o,t[12]=s,t[13]=c,t[14]=l,t[15]=u,t[16]=d):d=t[16],d}function PE(e){let t=e.document.getText(`source`).toString(),{map:n,parseError:r}=ai(t);return{map:n,keys:Br(t),parseError:r}}function FE(e){let t=(0,$.c)(167),{provider:n}=e,[r,i]=(0,Q.useState)(null),a;t[0]===n?a=t[1]:(a=()=>PE(n),t[0]=n,t[1]=a);let[o,s]=(0,Q.useState)(a),c,l;t[2]===n?(c=t[3],l=t[4]):(c=()=>{let e=Pr(n);i(e),s(e.current());let t=e.subscribe(e=>{s(e)});return()=>{t(),e.dispose(),i(t=>t===e?null:t)}},l=[n],t[2]=n,t[3]=c,t[4]=l),(0,Q.useEffect)(c,l);let u=o.map,d=o.keys,f=o.parseError,[p,m]=(0,Q.useState)(!1),h;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(h={},t[5]=h):h=t[5];let[g,_]=(0,Q.useState)(h),[v,y]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(null),S;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(S={},t[6]=S):S=t[6];let[C,w]=(0,Q.useState)(S),T;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(T={},t[7]=T):T=t[7];let[E,D]=(0,Q.useState)(T),O=n.configuration.name??``,k;t[8]===O?k=t[9]:(k=zE(O),t[8]=O,t[9]=k);let A=k,j;t[10]===O?j=t[11]:(j=LE(O),t[10]=O,t[11]=j);let M=Qa(A?null:j),N;t[12]!==M||t[13]!==A?(N=!A&&M.state.status===`ready`?M.state.data.folder.frontmatter_defaults??{}:{},t[12]=M,t[13]=A,t[14]=N):N=t[14];let P=N,F;t[15]!==M||t[16]!==A?(F=!A&&M.state.status===`ready`?M.state.data.frontmatterSources:{},t[15]=M,t[16]=A,t[17]=F):F=t[17];let I=F,L;t[18]===r?L=t[19]:(L=function(e){if(!r)return{ok:!1,error:`Connecting`};let t=r.patch(e);if(t.ok)return{ok:!0};if(t.error.code===`WRITE_ERROR`)return console.warn(`[PropertyPanel] binding write error:`,t.error.detail),{ok:!1,error:t.error.detail};let n=Yr(t.error);return{ok:!1,error:t.error.issues[0]?.message??`Invalid patch payload`,fieldErrors:Object.keys(n).length>0?n:void 0}},t[18]=r,t[19]=L);let R=L,z;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(z=function(e){w(t=>{if(!Object.hasOwn(t,e))return t;let n={...t};return delete n[e],n})},t[20]=z):z=t[20];let B=z,V;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(V=function(e,t){if(e.ok)return;let n=e.error??`Failed to update property`,r=e.fieldErrors??{};w(e=>{let i={...e};for(let e of t)i[e]=r[e]??n;return i}),D(e=>{let n={...e};for(let e of t)n[e]=(n[e]??0)+1;return n})},t[21]=V):V=t[21];let H=V,U;t[22]===R?U=t[23]:(U=function(e,t){B(e),H(R({[e]:t}),[e])},t[22]=R,t[23]=U);let W=U,G;t[24]===R?G=t[25]:(G=function(e){B(e),H(R({[e]:null}),[e])},t[24]=R,t[25]=G);let ee=G,te;t[26]===r?te=t[27]:(te=function(e,t){if(!r)return{ok:!1,error:`Connecting`};if(e===t)return{ok:!0};let n=r.rename(e,t);if(n.ok)return{ok:!0};if(n.error.code===`WRITE_ERROR`)return{ok:!1,error:n.error.detail};let i=Yr(n.error);return{ok:!1,error:n.error.issues[0]?.message??`Failed to rename`,fieldErrors:Object.keys(i).length>0?i:void 0}},t[26]=r,t[27]=te);let ne=te,ie;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(ie=function(e,t){return`${e} ${t}`},t[28]=ie):ie=t[28];let ae=ie,oe;t[29]!==r||t[30]!==d?(oe=function(e){if(!r)return;let t=String(e.active.id),n=e.over?String(e.over.id):null;if(!n||t===n)return;let i=d.map((e,t)=>ae(e,t)),a=i.indexOf(t),o=i.indexOf(n);if(a<0||o<0)return;let s=d.slice(),[c]=s.splice(a,1);if(!c)return;s.splice(o,0,c);let l=r.reorder(s);l.ok||console.warn(`[PropertyPanel] reorder failed:`,l.error)},t[29]=r,t[30]=d,t[31]=oe):oe=t[31];let se=oe,K;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(K={activationConstraint:{distance:4}},t[32]=K):K=t[32];let ce;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ce={coordinateGetter:Ya},t[33]=ce):ce=t[33];let le=Co(Ca(fa,K),Ca(la,ce)),ue;t[34]!==P||t[35]!==W||t[36]!==u?(ue=function(e,t){let n=u[e]??BE(P[e]);if(n===void 0)return;_(n=>({...n,[e]:t}));let r=sa(n,t);(!Object.hasOwn(u,e)||!IE(n,r))&&W(e,r)},t[34]=P,t[35]=W,t[36]=u,t[37]=ue):ue=t[37];let q=ue,de;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(de=function(){y({name:``,type:`text`,value:``,error:null}),m(!1)},t[38]=de):de=t[38];let fe=de,{addPropertySignal:pe,clearAddProperty:me}=JC(),he;t[39]!==pe||t[40]!==O?(he=pe.get(O)??0,t[39]=pe,t[40]=O,t[41]=he):he=t[41];let ge=he,_e,ve;t[42]===ge?(_e=t[43],ve=t[44]):(_e=()=>{ge>0&&(y({name:``,type:`text`,value:``,error:null}),m(!1))},ve=[ge],t[42]=ge,t[43]=_e,t[44]=ve),(0,Q.useEffect)(_e,ve);let ye,be;t[45]!==me||t[46]!==O?(ye=()=>()=>me(O),be=[O,me],t[45]=me,t[46]=O,t[47]=ye,t[48]=be):(ye=t[47],be=t[48]),(0,Q.useEffect)(ye,be);let xe;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(xe=function(e){y(t=>{if(!t)return t;let n=e===`date`?new Date().toISOString().slice(0,10):Ea[e];return{...t,type:e,value:n,error:null}})},t[49]=xe):xe=t[49];let Se=xe,Ce;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=function(e){y(t=>t&&{...t,value:e})},t[50]=Ce):Ce=t[50];let we=Ce,Te;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(Te=function(e){y(t=>t&&{...t,name:e,error:null})},t[51]=Te):Te=t[51];let Ee=Te,De;t[52]!==v||t[53]!==R||t[54]!==u?(De=function(){if(!v)return;let e=v.name.trim();if(!e){y({...v,error:`Name is required`});return}if(e===`frontmatter`){y({...v,error:`"frontmatter" is a reserved property name`});return}if(Object.hasOwn(u,e)){y({...v,error:`Property "${e}" already exists`});return}let t=R({[e]:v.value});if(t.ok){y(null);return}let n=t.fieldErrors?.[e],r=t.error??`Failed to add property`;y({...v,error:n??r})},t[52]=v,t[53]=R,t[54]=u,t[55]=De):De=t[55];let Oe=De,ke;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(ke=function(){y(null)},t[56]=ke):ke=t[56];let Ae=ke,je;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(je=function(e){x({key:e,draft:e,error:null})},t[57]=je):je=t[57];let Me=je,Ne;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=function(e){x(t=>t&&{...t,draft:e,error:null})},t[58]=Ne):Ne=t[58];let Pe=Ne,Fe;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=function(){x(null)},t[59]=Fe):Fe=t[59];let J=Fe,Ie;t[60]!==u||t[61]!==ne||t[62]!==b?(Ie=function(){if(!b)return;let e=b.draft.trim();if(!e){x(null);return}if(e===b.key){x(null);return}if(e===`frontmatter`){x({...b,error:`"frontmatter" is a reserved property name`});return}if(Object.hasOwn(u,e)){x({...b,error:`Property "${e}" already exists`});return}let t=ne(b.key,e);if(t.ok){_(t=>{if(!Object.hasOwn(t,b.key))return t;let n={...t};return n[e]=n[b.key],delete n[b.key],n}),B(b.key),x(null);return}let n=t.fieldErrors?.[e]??t.fieldErrors?.[b.key]??t.error??`Failed to rename property`;x({...b,error:n})},t[60]=u,t[61]=ne,t[62]=b,t[63]=Ie):Ie=t[63];let Le=Ie,Re;t[64]!==u||t[65]!==d?(Re=d.length>0?d:Object.keys(u),t[64]=u,t[65]=d,t[66]=Re):Re=t[66];let ze=Re,Be;if(t[67]!==ze){Be=new Map;for(let e of ze)Be.set(e,(Be.get(e)??0)+1);t[67]=ze,t[68]=Be}else Be=t[68];let Ve,He,Ue,We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe;if(t[69]!==v||t[70]!==P||t[71]!==I||t[72]!==p||t[73]!==W||t[74]!==Le||t[75]!==Be||t[76]!==C||t[77]!==se||t[78]!==u||t[79]!==g||t[80]!==f||t[81]!==ee||t[82]!==b||t[83]!==ze||t[84]!==E||t[85]!==le||t[86]!==q){Qe=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Object.keys(P).filter(e=>!Object.hasOwn(u,e)).sort();if(ze.length===0&&e.length===0&&!v&&!f){Qe=null;break bb0}Xe=`property-panel editor-content-aligned pt-4 pb-4 text-sm`,Ze=`property-panel`,He=qo,qe=!p,t[99]===Symbol.for(`react.memo_cache_sentinel`)?(Je=e=>m(!e),t[99]=Je):Je=t[99];let n=!p,r;t[100]===n?r=t[101]:(r=(0,Z.jsx)(Uo,{"data-expanded":n,className:`size-3.5 shrink-0 text-muted-foreground transition-transform duration-150 ease-out data-[expanded=true]:rotate-90`}),t[100]=n,t[101]=r);let i;t[102]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`span`,{children:`Properties`}),t[102]=i):i=t[102],t[103]===r?Ye=t[104]:(Ye=(0,Z.jsx)(Ko,{asChild:!0,children:(0,Z.jsxs)(Y,{type:`button`,variant:`ghost`,className:`mb-1.5 flex h-auto w-fit bg-transparent! items-center gap-1 px-1 py-0.5 text-base font-medium text-foreground hover:bg-transparent hover:text-foreground`,children:[r,i]})}),t[103]=r,t[104]=Ye),Ve=Go,Ue=`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in]`,t[105]===f?We=t[106]:(We=f?(0,Z.jsxs)(`div`,{role:`alert`,"data-testid":`property-panel-yaml-error`,className:`mb-1 flex items-start gap-1.5 rounded border border-destructive/30 bg-destructive/5 px-2 py-1.5 text-[11px] text-destructive`,children:[(0,Z.jsx)(Ir,{className:`size-3.5 shrink-0 mt-0.5`}),(0,Z.jsxs)(`div`,{children:[`Frontmatter YAML is malformed; fix in source mode to recover.`,(0,Z.jsx)(`span`,{className:`block text-[10px] opacity-80`,children:f})]})]}):null,t[105]=f,t[106]=We);let a;if(t[107]!==ze){let e;t[109]===Symbol.for(`react.memo_cache_sentinel`)?(e=(e,t)=>ae(e,t),t[109]=e):e=t[109],a=ze.map(e),t[107]=ze,t[108]=a}else a=t[108];let o;if(t[110]!==W||t[111]!==Le||t[112]!==Be||t[113]!==C||t[114]!==u||t[115]!==g||t[116]!==ee||t[117]!==b||t[118]!==ze||t[119]!==E||t[120]!==q){let e;t[122]!==W||t[123]!==Le||t[124]!==Be||t[125]!==C||t[126]!==u||t[127]!==g||t[128]!==ee||t[129]!==b||t[130]!==E||t[131]!==q?(e=(e,t)=>{let n=u[e];if(n===void 0)return null;let r=g[e]??ir(n),i=b?.key===e?b:null,a=(Be.get(e)??0)>1;return(0,Z.jsx)(ra,{sortableId:ae(e,t),keyName:e,value:n,declared:r,error:C[e]??null,resetCounter:E[e]??0,isDuplicate:a,rename:{state:i,onBegin:()=>Me(e),onChangeDraft:Pe,onCommit:Le,onCancel:J},onCommit:t=>W(e,t),onChangeType:t=>q(e,t),onRemove:()=>ee(e)},`${e}-${t}`)},t[122]=W,t[123]=Le,t[124]=Be,t[125]=C,t[126]=u,t[127]=g,t[128]=ee,t[129]=b,t[130]=E,t[131]=q,t[132]=e):e=t[132],o=ze.map(e),t[110]=W,t[111]=Le,t[112]=Be,t[113]=C,t[114]=u,t[115]=g,t[116]=ee,t[117]=b,t[118]=ze,t[119]=E,t[120]=q,t[121]=o}else o=t[121];let s;t[133]!==a||t[134]!==o?(s=(0,Z.jsx)(ya,{items:a,strategy:va,children:o}),t[133]=a,t[134]=o,t[135]=s):s=t[135],t[136]!==se||t[137]!==le||t[138]!==s?(Ge=(0,Z.jsx)(xa,{sensors:le,collisionDetection:ha,onDragEnd:se,children:s}),t[136]=se,t[137]=le,t[138]=s,t[139]=Ge):Ge=t[139];let c;t[140]!==P||t[141]!==I||t[142]!==W||t[143]!==C||t[144]!==E||t[145]!==q?(c=e=>{let t=P[e],n=BE(t),r=ir(n),i=I[e]??``;return(0,Z.jsx)(ra,{keyName:e,value:n,declared:r,error:C[e]??null,resetCounter:E[e]??0,isInherited:!0,badge:(0,Z.jsx)(_o,{source:i}),onCommit:t=>W(e,t),onChangeType:t=>q(e,t)},`inherited-${e}`)},t[140]=P,t[141]=I,t[142]=W,t[143]=C,t[144]=E,t[145]=q,t[146]=c):c=t[146],Ke=e.map(c)}t[69]=v,t[70]=P,t[71]=I,t[72]=p,t[73]=W,t[74]=Le,t[75]=Be,t[76]=C,t[77]=se,t[78]=u,t[79]=g,t[80]=f,t[81]=ee,t[82]=b,t[83]=ze,t[84]=E,t[85]=le,t[86]=q,t[87]=Ve,t[88]=He,t[89]=Ue,t[90]=We,t[91]=Ge,t[92]=Ke,t[93]=qe,t[94]=Je,t[95]=Ye,t[96]=Xe,t[97]=Ze,t[98]=Qe}else Ve=t[87],He=t[88],Ue=t[89],We=t[90],Ge=t[91],Ke=t[92],qe=t[93],Je=t[94],Ye=t[95],Xe=t[96],Ze=t[97],Qe=t[98];if(Qe!==Symbol.for(`react.early_return_sentinel`))return Qe;let $e;t[147]!==v||t[148]!==Oe?($e=v?(0,Z.jsx)(wa,{draft:v,onChangeName:Ee,onChangeType:Se,onChangeValue:we,onCommit:Oe,onCancel:Ae}):(0,Z.jsxs)(`div`,{className:`mt-1 flex items-center gap-1`,children:[(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`h-7 w-4 shrink-0`}),(0,Z.jsxs)(Y,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`add-property-trigger`,onClick:fe,"aria-label":`Add property`,className:`flex items-center gap-1.5 rounded px-2 py-1 font-medium text-sm hover:bg-muted/50 hover:text-foreground`,children:[(0,Z.jsx)(re,{className:`size-3.5`}),(0,Z.jsx)(`span`,{children:`Add`})]})]}),t[147]=v,t[148]=Oe,t[149]=$e):$e=t[149];let et;t[150]!==Ve||t[151]!==Ue||t[152]!==We||t[153]!==Ge||t[154]!==Ke||t[155]!==$e?(et=(0,Z.jsxs)(Ve,{className:Ue,children:[We,Ge,Ke,$e]}),t[150]=Ve,t[151]=Ue,t[152]=We,t[153]=Ge,t[154]=Ke,t[155]=$e,t[156]=et):et=t[156];let tt;t[157]!==He||t[158]!==qe||t[159]!==Je||t[160]!==Ye||t[161]!==et?(tt=(0,Z.jsxs)(He,{open:qe,onOpenChange:Je,children:[Ye,et]}),t[157]=He,t[158]=qe,t[159]=Je,t[160]=Ye,t[161]=et,t[162]=tt):tt=t[162];let nt;return t[163]!==Xe||t[164]!==Ze||t[165]!==tt?(nt=(0,Z.jsx)(`div`,{className:Xe,"data-testid":Ze,children:tt}),t[163]=Xe,t[164]=Ze,t[165]=tt,t[166]=nt):nt=t[166],nt}function IE(e,t){return Array.isArray(e)&&Array.isArray(t)?e.length===t.length?e.every((e,n)=>e===t[n]):!1:e===t}function LE(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}var RE=/(^|\/)\.ok\/templates\//;function zE(e){return RE.test(e)}function BE(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`?e:Array.isArray(e)?e.map(e=>typeof e==`string`?e:JSON.stringify(e)):e==null?``:JSON.stringify(e)}var VE=Bt(`LARGE_DOC_CHAR_THRESHOLD`,5e5);function HE(e){let t=e.threshold??VE;return e.ytextLength>t?{renderSource:e.isSourceMode||e.visitedSource,renderVisual:!e.isSourceMode||e.visitedVisual,isLarge:!0}:{renderSource:!0,renderVisual:!0,isLarge:!1}}function UE(e){return e.hasEmittedFirstToggle||!e.isLarge?!1:e.renderSource&&e.renderVisual}var WE=Bt(`ACTIVITY_MOUNT_LIMIT`,3);function GE(){return n(()=>import(`./SourceEditor-CRzFUyZA.js`),__vite__mapDeps([44,1,33,2,34,35,20,36,37,38,39,19,3,7,8,4,10,9,40,45,22]),import.meta.url)}var KE=(0,Q.lazy)(async()=>({default:(await GE()).SourceEditor}));function qE(e,t,n){if(n<=0)return[];let r=e.filter(e=>!qe(e.docName)),i=[...r].sort((e,t)=>t.lastAccessedAt-e.lastAccessedAt).slice(0,n);if(t===null||i.some(e=>e.docName===t))return i;let a=r.find(e=>e.docName===t);return a?[...i.slice(0,n-1),a]:i}function JE(e,t){return t.kind===`idle`?null:t.kind===`failed`&&t.failedDocNames.includes(e)?{kind:`failed`,title:`Couldn't reconnect after server restart`,summary:t.reason===`clear-data-timeout`?`Local collaboration data for "${e}" could not be cleared in time. Reload to retry.`:`Local collaboration data for "${e}" could not be cleared. Reload to retry.`,actionLabel:`Reload`}:t.kind===`recovering`&&t.docNames.includes(e)?{kind:`recovering`,title:`Reconnecting after server restart`,summary:t.phase===`clearing-local-cache`?`Clearing local collaboration data for "${e}" before reconnecting.`:`Reopening "${e}" with a fresh local collaboration cache.`}:null}function YE(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(J,{name:`activity-pool`,children:(0,Z.jsx)(XE,{...e})}),t[0]=e,t[1]=n),n}function XE(e){let t=(0,$.c)(15),{activeDocName:n,isSourceMode:r,editorPlaceholder:i,previousDocName:a,onNavigateBack:o,onRecycle:s}=e,{poolEntries:c,serverRestartRecovery:l}=ut(),{pages:u,loading:d}=Nr(),f=qE(c,n,WE),p=(0,Q.useRef)(``),m=f.map(ZE).join(`,`),h=(0,Q.useRef)(c),g,_;t[0]===c?(g=t[1],_=t[2]):(g=()=>{h.current=c},_=[c],t[0]=c,t[1]=g,t[2]=_),(0,Q.useLayoutEffect)(g,_),(0,Q.useLayoutEffect)(()=>{if(p.current===m)return;let e=p.current?p.current.split(`,`):[],t=m?m.split(`,`):[],r=e.filter(e=>!t.includes(e)),i=t.filter(t=>!e.includes(t));for(let e of r)ge(e);for(let e of i){let t=h.current.find(t=>t.docName===e)?.poolEventId;y(e,t&&t.length>0?t:crypto.randomUUID())}Mt(`ok/activity/mount-list-change`,{active:n,mounted:t,evicted:r}),p.current=m,Vt(t)},[m,n]);let v;t[3]!==n||t[4]!==i||t[5]!==r||t[6]!==d||t[7]!==o||t[8]!==s||t[9]!==u||t[10]!==a||t[11]!==l?(v=e=>(0,Z.jsx)(rD,{entry:e,isActive:e.docName===n,isSourceMode:r,editorPlaceholder:i,isNewDoc:!d&&!u.has(e.docName),previousDocName:a,onNavigateBack:o,onRecycle:s,serverRestartRecovery:l},e.docName),t[3]=n,t[4]=i,t[5]=r,t[6]=d,t[7]=o,t[8]=s,t[9]=u,t[10]=a,t[11]=l,t[12]=v):v=t[12];let b=f.map(v),x;return t[13]===b?x=t[14]:(x=(0,Z.jsx)(Z.Fragment,{children:b}),t[13]=b,t[14]=x),x}function ZE(e){return e.docName}function QE(e){let t=(0,$.c)(8),{isActive:n,initialScrollTop:r,children:i}=e,a=(0,Q.useRef)(null),o=(0,Q.useRef)(r??0),s,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=a.current;if(!e)return;let t=()=>{e.scrollTop>0&&(o.current=e.scrollTop)};return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},c=[],t[0]=s,t[1]=c):(s=t[0],c=t[1]),(0,Q.useEffect)(s,c);let l,u;t[2]===n?(l=t[3],u=t[4]):(l=()=>{if(!n)return;let e=a.current;if(!e)return;let t=o.current;if(t===0)return;e.scrollTop=t;let r=!1,i=0,s=()=>{r||(r=!0,cancelAnimationFrame(i),clearTimeout(u),e.removeEventListener(`wheel`,c),e.removeEventListener(`touchstart`,c))},c=()=>s();e.addEventListener(`wheel`,c,{passive:!0}),e.addEventListener(`touchstart`,c,{passive:!0});let l=()=>{r||(e.scrollTop!==t&&e.scrollHeight>t&&(e.scrollTop=t),i=requestAnimationFrame(l))};i=requestAnimationFrame(l);let u=setTimeout(s,2e3);return s},u=[n],t[2]=n,t[3]=l,t[4]=u),(0,Q.useLayoutEffect)(l,u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d={overflowAnchor:`auto`},t[5]=d):d=t[5];let f;return t[6]===i?f=t[7]:(f=(0,Z.jsx)(`div`,{ref:a,"data-testid":`editor-scroll-container`,className:`subtle-scrollbar h-full overflow-y-auto pt-14 scroll-pt-14`,style:d,children:i}),t[6]=i,t[7]=f),f}function $E(e){let t=(0,$.c)(12),{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a}=e,o=r&&i,[s,c]=(0,Q.useState)(o),l,u;if(t[0]===o?(l=t[1],u=t[2]):(l=()=>{o&&c(!0)},u=[o],t[0]=o,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u),!s&&!o)return null;let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(vS,{}),t[3]=d):d=t[3];let f=n.docName,p;t[4]===n.provider.document?p=t[5]:(p=n.provider.document.getText(`source`),t[4]=n.provider.document,t[5]=p);let m;return t[6]!==a||t[7]!==n.docName||t[8]!==n.provider||t[9]!==o||t[10]!==p?(m=(0,Z.jsx)(Q.Suspense,{fallback:d,children:(0,Z.jsx)(KE,{docName:f,ytext:p,provider:n.provider,placeholder:a,isSourceModeActive:o})}),t[6]=a,t[7]=n.docName,t[8]=n.provider,t[9]=o,t[10]=p,t[11]=m):m=t[11],m}function eD(e){let t=(0,$.c)(18),{view:n}=e,r=n.kind===`failed`,i=r?`alert`:`status`,a=!r,o;t[0]===r?o=t[1]:(o=(0,Z.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-full border bg-muted text-muted-foreground`,children:r?(0,Z.jsx)(Uc,{className:`size-5`,"aria-hidden":`true`}):(0,Z.jsx)(tt,{className:`size-5 animate-spin`,"aria-hidden":`true`})}),t[0]=r,t[1]=o);let s;t[2]===n.title?s=t[3]:(s=(0,Z.jsx)(`h2`,{className:`text-lg font-medium`,children:n.title}),t[2]=n.title,t[3]=s);let c;t[4]===n.summary?c=t[5]:(c=(0,Z.jsx)(`p`,{className:`max-w-md text-sm text-muted-foreground`,children:n.summary}),t[4]=n.summary,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]!==r||t[10]!==n.actionLabel?(u=r?(0,Z.jsxs)(Y,{type:`button`,onClick:tD,children:[(0,Z.jsx)(Uc,{className:`size-4`,"aria-hidden":`true`}),n.actionLabel]}):null,t[9]=r,t[10]=n.actionLabel,t[11]=u):u=t[11];let d;return t[12]!==i||t[13]!==a||t[14]!==o||t[15]!==l||t[16]!==u?(d=(0,Z.jsxs)(`div`,{"data-slot":`server-restart-recovery`,role:i,"aria-busy":a,className:`flex h-full flex-col items-center justify-center gap-6 p-8 text-center`,children:[o,l,u]}),t[12]=i,t[13]=a,t[14]=o,t[15]=l,t[16]=u,t[17]=d):d=t[17],d}function tD(){return window.location.reload()}function nD(e){let t=(0,$.c)(2),{html:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(`div`,{className:`tiptap-editor h-full pointer-events-none`,"aria-hidden":`true`,children:(0,Z.jsx)(`div`,{className:`tiptap ProseMirror tiptap-editor-portal-content`,dangerouslySetInnerHTML:{__html:n}})}),t[0]=n,t[1]=r),r}function rD(e){let t=(0,$.c)(52),{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a,isNewDoc:o,previousDocName:s,onNavigateBack:c,onRecycle:l,serverRestartRecovery:u}=e,d;t[0]!==n.docName||t[1]!==u?(d=JE(n.docName,u),t[0]=n.docName,t[1]=u,t[2]=d):d=t[2];let f=d,p;t[3]===n.docName?p=t[4]:(p=()=>{let e=document.createElement(`div`);return e.setAttribute(`data-ok-editor-portal`,n.docName),e.style.display=`contents`,e},t[3]=n.docName,t[4]=p);let[m]=(0,Q.useState)(p),h=n.provider.document.getText(`source`).length,[g,_]=(0,Q.useState)(i),[v,y]=(0,Q.useState)(!i),b,x;t[5]!==i||t[6]!==g||t[7]!==v?(b=()=>{i&&!g?_(!0):!i&&!v&&y(!0)},x=[i,g,v],t[5]=i,t[6]=g,t[7]=v,t[8]=b,t[9]=x):(b=t[8],x=t[9]),(0,Q.useEffect)(b,x);let C=HE({ytextLength:h,isSourceMode:i,visitedSource:g,visitedVisual:v}),w=(0,Q.useRef)(``),T=`${C.isLarge}-${C.renderSource}-${C.renderVisual}`,E,D;t[10]!==n.docName||t[11]!==C.isLarge||t[12]!==C.renderSource||t[13]!==C.renderVisual||t[14]!==T||t[15]!==i||t[16]!==h?(E=()=>{w.current!==T&&(w.current=T,C.isLarge&&Mt(`ok/activity/defer-mount`,{docName:n.docName,ytextLength:h,isSourceMode:i,renderSource:C.renderSource,renderVisual:C.renderVisual}))},D=[T,C.isLarge,C.renderSource,C.renderVisual,n.docName,h,i],t[10]=n.docName,t[11]=C.isLarge,t[12]=C.renderSource,t[13]=C.renderVisual,t[14]=T,t[15]=i,t[16]=h,t[17]=E,t[18]=D):(E=t[17],D=t[18]),(0,Q.useEffect)(E,D);let O;t[19]===n.docName?O=t[20]:(O=()=>Nt(n.docName),t[19]=n.docName,t[20]=O);let[k]=(0,Q.useState)(O),A=k?.html??null,[j,M]=(0,Q.useState)(!1),N,P;t[21]!==n.docName||t[22]!==C.isLarge||t[23]!==C.renderSource||t[24]!==C.renderVisual||t[25]!==j||t[26]!==i||t[27]!==h?(N=()=>{UE({isLarge:C.isLarge,renderSource:C.renderSource,renderVisual:C.renderVisual,hasEmittedFirstToggle:j})&&(Mt(`ok/cold/first-toggle`,{docName:n.docName,mountId:S(n.docName),ytextLength:h,modeEnteredFirst:i?`source`:`visual`}),M(!0))},P=[j,C.isLarge,C.renderSource,C.renderVisual,n.docName,h,i],t[21]=n.docName,t[22]=C.isLarge,t[23]=C.renderSource,t[24]=C.renderVisual,t[25]=j,t[26]=i,t[27]=h,t[28]=N,t[29]=P):(N=t[28],P=t[29]),(0,Q.useEffect)(N,P);let F=r?`visible`:`hidden`,I=`editor:${n.docName}`,L=k?.scrollTop,R;t[30]!==a||t[31]!==n||t[32]!==C.renderSource||t[33]!==C.renderVisual||t[34]!==r||t[35]!==o||t[36]!==i||t[37]!==c||t[38]!==l||t[39]!==m||t[40]!==s||t[41]!==f||t[42]!==A?(R=f?(0,Z.jsx)(eD,{view:f}):(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsx)(NE,{activeDocName:n.docName,previousDocName:s,onNavigateBack:c,onRecycle:l,children:(0,Z.jsx)(Q.Suspense,{fallback:A?(0,Z.jsx)(nD,{html:A}):(0,Z.jsx)(vS,{}),children:(0,Z.jsx)(OE,{docName:n.docName,provider:n.provider,children:(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[!i&&(0,Z.jsx)(FE,{provider:n.provider}),(0,Z.jsxs)(`div`,{className:`relative flex-1`,children:[C.renderSource?(0,Z.jsx)(`div`,{className:i?`h-full`:`ok-mode-hidden h-full`,children:(0,Z.jsx)($E,{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a})}):null,C.renderVisual?(0,Z.jsx)(`div`,{className:i?`ok-mode-hidden h-full`:`h-full`,children:(0,Z.jsx)(TE,{provider:n.provider,placeholder:a,isSourceMode:i,portalTarget:m},`${n.docName}-${String(o)}`)}):null]})]})})})})}),t[30]=a,t[31]=n,t[32]=C.renderSource,t[33]=C.renderVisual,t[34]=r,t[35]=o,t[36]=i,t[37]=c,t[38]=l,t[39]=m,t[40]=s,t[41]=f,t[42]=A,t[43]=R):R=t[43];let z;t[44]!==r||t[45]!==L||t[46]!==R?(z=(0,Z.jsx)(QE,{isActive:r,initialScrollTop:L,children:R}),t[44]=r,t[45]=L,t[46]=R,t[47]=z):z=t[47];let B;return t[48]!==F||t[49]!==I||t[50]!==z?(B=(0,Z.jsx)(Q.Activity,{mode:F,name:I,children:z}),t[48]=F,t[49]=I,t[50]=z,t[51]=B):B=t[51],B}function iD(e){let t=(0,$.c)(27),{stats:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-0 bottom-full h-2 bg-linear-to-t from-background to-transparent`}),t[0]=r):r=t[0];let i;t[1]===n.words?i=t[2]:(i=n.words.toLocaleString(),t[1]=n.words,t[2]=i);let a;t[3]===i?a=t[4]:(a=(0,Z.jsx)(`span`,{className:`tabular-nums`,children:i}),t[3]=i,t[4]=a);let o=n.words===1?`word`:`words`,s;t[5]!==a||t[6]!==o?(s=(0,Z.jsxs)(`span`,{children:[a,` `,o]}),t[5]=a,t[6]=o,t[7]=s):s=t[7];let c;t[8]===n.chars?c=t[9]:(c=n.chars.toLocaleString(),t[8]=n.chars,t[9]=c);let l;t[10]===c?l=t[11]:(l=(0,Z.jsx)(`span`,{className:`tabular-nums`,children:c}),t[10]=c,t[11]=l);let u=n.chars===1?`char`:`chars`,d;t[12]!==l||t[13]!==u?(d=(0,Z.jsxs)(`span`,{children:[l,` `,u]}),t[12]=l,t[13]=u,t[14]=d):d=t[14];let f=n.tokens>0?`~`:``,p;t[15]===n.tokens?p=t[16]:(p=n.tokens.toLocaleString(),t[15]=n.tokens,t[16]=p);let m;t[17]===p?m=t[18]:(m=(0,Z.jsx)(`span`,{className:`tabular-nums`,children:p}),t[17]=p,t[18]=m);let h=n.tokens===1?`token`:`tokens`,g;t[19]!==f||t[20]!==m||t[21]!==h?(g=(0,Z.jsxs)(`span`,{children:[f,m,` `,h]}),t[19]=f,t[20]=m,t[21]=h,t[22]=g):g=t[22];let _;return t[23]!==g||t[24]!==s||t[25]!==d?(_=(0,Z.jsxs)(`section`,{"aria-label":`Document statistics`,className:`relative flex h-6 shrink-0 items-center justify-end gap-3 bg-background px-3 text-2xs text-muted-foreground`,children:[r,s,d,g]}),t[23]=g,t[24]=s,t[25]=d,t[26]=_):_=t[26],_}function aD(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`nav`,{"aria-label":`breadcrumb`,"data-slot":`breadcrumb`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function oD(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`ol`,{"data-slot":`breadcrumb-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function sD(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`inline-flex items-center gap-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`li`,{"data-slot":`breadcrumb-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function cD(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({current:i,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0||i?`page`:void 0,o;t[4]===n?o=t[5]:(o=Di(`font-normal text-foreground`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,Z.jsx)(`span`,{"data-slot":`breadcrumb-page`,"aria-current":a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function lD(e){let t=(0,$.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,className:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=Di(`[&>svg]:size-3.5`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=n??(0,Z.jsx)(Uo,{}),t[6]=n,t[7]=o);let s;return t[8]!==i||t[9]!==a||t[10]!==o?(s=(0,Z.jsx)(`li`,{"data-slot":`breadcrumb-separator`,role:`presentation`,"aria-hidden":`true`,className:a,...i,children:o}),t[8]=i,t[9]=a,t[10]=o,t[11]=s):s=t[11],s}function uD(e){let t=(0,$.c)(18),{docName:n,className:r}=e;if(!n)return null;let i,a,o,s,c,l;if(t[0]!==r||t[1]!==n){l=Symbol.for(`react.early_return_sentinel`);bb0:{let{prefix:e}=Je(n,``);if(!e){l=null;break bb0}let u=e.replace(/\/$/,``).split(`/`).filter(Boolean);if(u.length===0){l=null;break bb0}a=aD,t[8]===r?c=t[9]:(c=Di(`flex min-w-0 items-center`,r),t[8]=r,t[9]=c),i=oD,o=`flex-nowrap gap-1 text-muted-foreground/70 text-xs`,s=u.map((e,t)=>{let n=u.slice(0,t+1).join(`/`);return(0,Z.jsxs)(Q.Fragment,{children:[t>0&&(0,Z.jsx)(lD,{className:`text-muted-foreground/70 [&>svg]:size-3`}),(0,Z.jsx)(sD,{className:`min-w-0`,children:(0,Z.jsx)(cD,{current:!1,className:`min-w-0 truncate font-normal text-muted-foreground/70`,title:e,children:e})})]},n)})}t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l}else i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7];if(l!==Symbol.for(`react.early_return_sentinel`))return l;let u;t[10]!==i||t[11]!==o||t[12]!==s?(u=(0,Z.jsx)(i,{className:o,children:s}),t[10]=i,t[11]=o,t[12]=s,t[13]=u):u=t[13];let d;return t[14]!==a||t[15]!==c||t[16]!==u?(d=(0,Z.jsx)(a,{className:c,children:u}),t[14]=a,t[15]=c,t[16]=u,t[17]=d):d=t[17],d}var dD={fill:`none`,height:24,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`},fD=e=>{let t=(0,$.c)(15),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({color:a,size:o,strokeWidth:s,absoluteStrokeWidth:n,className:c,children:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=a===void 0?`currentColor`:a,u=o===void 0?24:o,d=s===void 0?2:s,f=c===void 0?``:c,p=n?Number(d)*24/Number(u):d,m;return t[8]!==r||t[9]!==f||t[10]!==l||t[11]!==i||t[12]!==u||t[13]!==p?(m=(0,Z.jsx)(`svg`,{"aria-hidden":`true`,...dD,className:f,height:u,stroke:l,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:p,width:u,...i,children:r}),t[8]=r,t[9]=f,t[10]=l,t[11]=i,t[12]=u,t[13]=p,t[14]=m):m=t[14],m},pD=e=>{let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Markdown`}),r=(0,Z.jsx)(`path`,{d:`M232,48H24A16,16,0,0,0,8,64V192a16,16,0,0,0,16,16H232a16,16,0,0,0,16-16V64A16,16,0,0,0,232,48Zm0,144H24V64H232V192ZM128,104v48a8,8,0,0,1-16,0V123.31L93.66,141.66a8,8,0,0,1-11.32,0L64,123.31V152a8,8,0,0,1-16,0V104a8,8,0,0,1,13.66-5.66L88,124.69l26.34-26.35A8,8,0,0,1,128,104Zm77.66,18.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L168,132.69V104a8,8,0,0,1,16,0v28.69l10.34-10.35A8,8,0,0,1,205.66,122.34Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(fD,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i},mD=e=>{let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Textbox`}),r=(0,Z.jsx)(`path`,{d:`M112,40a8,8,0,0,0-8,8V64H24A16,16,0,0,0,8,80v96a16,16,0,0,0,16,16h80v16a8,8,0,0,0,16,0V48A8,8,0,0,0,112,40ZM24,176V80h80v96ZM248,80v96a16,16,0,0,1-16,16H144a8,8,0,0,1,0-16h88V80H144a8,8,0,0,1,0-16h88A16,16,0,0,1,248,80ZM88,112a8,8,0,0,1-8,8H72v24a8,8,0,0,1-16,0V120H48a8,8,0,0,1,0-16H80A8,8,0,0,1,88,112Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(fD,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i};function hD(e){let t=(0,$.c)(42),{activeDocName:n,isSourceMode:r,sourceDisabled:i,onModeChange:a,showAddPropertyButton:o,onAddProperty:s,isPanelCollapsed:c,onTogglePanel:l}=e,u;t[0]===n?u=t[1]:(u=(0,Z.jsx)(`div`,{className:`pointer-events-auto flex min-w-0 items-end self-end`,children:(0,Z.jsx)(uD,{docName:n})}),t[0]=n,t[1]=u);let d=r?`source`:`wysiwyg`,f;t[2]===a?f=t[3]:(f=e=>{e&&a(e)},t[2]=a,t[3]=f);let p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsxs)(jn,{children:[(0,Z.jsx)(Xo,{value:`wysiwyg`,"aria-label":`Visual editor`,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,asChild:!0,children:(0,Z.jsx)(En,{children:(0,Z.jsx)(mD,{className:`size-4`})})}),(0,Z.jsx)(er,{side:`bottom`,children:`Visual`})]}),t[4]=p):p=t[4];let m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(pD,{className:`size-4`}),t[5]=m):m=t[5];let h;t[6]===i?h=t[7]:(h=(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(`div`,{children:(0,Z.jsx)(Xo,{value:`source`,"aria-label":`Markdown source`,disabled:i,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,children:m})})}),t[6]=i,t[7]=h);let g=i?`Source mode requires a live connection — your edits are saved and will appear when you reconnect.`:`Markdown`,_;t[8]===g?_=t[9]:(_=(0,Z.jsx)(er,{side:`bottom`,children:g}),t[8]=g,t[9]=_);let v;t[10]!==h||t[11]!==_?(v=(0,Z.jsxs)(jn,{children:[h,_]}),t[10]=h,t[11]=_,t[12]=v):v=t[12];let y;t[13]!==d||t[14]!==f||t[15]!==v?(y=(0,Z.jsx)(`div`,{className:`pointer-events-auto flex justify-center`,children:(0,Z.jsxs)($o,{type:`single`,value:d,onValueChange:f,"aria-label":`Editor mode`,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 data-[size=sm]:rounded-[10px] bg-muted p-0.5`,children:[p,v]})}),t[13]=d,t[14]=f,t[15]=v,t[16]=y):y=t[16];let b;t[17]!==s||t[18]!==o?(b=o&&(0,Z.jsxs)(jn,{children:[(0,Z.jsx)(Y,{variant:`ghost`,size:`icon`,"aria-label":`Add properties`,onClick:s,"data-testid":`add-properties-button`,asChild:!0,children:(0,Z.jsx)(En,{children:(0,Z.jsx)(kc,{})})}),(0,Z.jsx)(er,{side:`bottom`,children:`Add properties`})]}),t[17]=s,t[18]=o,t[19]=b):b=t[19];let x=!c,S=c?`Show panel`:`Hide panel`,C;t[20]===c?C=t[21]:(C=(0,Z.jsx)(En,{children:c?(0,Z.jsx)(Lc,{}):(0,Z.jsx)(Ic,{})}),t[20]=c,t[21]=C);let w;t[22]!==l||t[23]!==x||t[24]!==S||t[25]!==C?(w=(0,Z.jsx)(Y,{variant:`ghost`,size:`icon`,onClick:l,"aria-expanded":x,"aria-label":S,asChild:!0,children:C}),t[22]=l,t[23]=x,t[24]=S,t[25]=C,t[26]=w):w=t[26];let T=c?`Show panel`:`Hide panel`,E;t[27]===T?E=t[28]:(E=(0,Z.jsx)(er,{side:`bottom`,children:T}),t[27]=T,t[28]=E);let D;t[29]!==w||t[30]!==E?(D=(0,Z.jsxs)(jn,{children:[w,E]}),t[29]=w,t[30]=E,t[31]=D):D=t[31];let O;t[32]!==b||t[33]!==D?(O=(0,Z.jsxs)(`div`,{className:`pointer-events-auto flex items-center justify-end gap-1`,children:[b,D]}),t[32]=b,t[33]=D,t[34]=O):O=t[34];let k;t[35]!==u||t[36]!==y||t[37]!==O?(k=(0,Z.jsx)(`div`,{className:`editor-content-aligned bg-background py-2`,children:(0,Z.jsxs)(`div`,{className:`grid grid-cols-3 items-center`,children:[u,y,O]})}),t[35]=u,t[36]=y,t[37]=O,t[38]=k):k=t[38];let A;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none h-2 bg-linear-to-b from-background to-transparent`}),t[39]=A):A=t[39];let j;return t[40]===k?j=t[41]:(j=(0,Z.jsxs)(`div`,{"data-testid":`editor-toolbar`,className:`pointer-events-none absolute inset-x-0 top-0 z-10`,children:[k,A]}),t[40]=k,t[41]=j),j}function gD(e){let{activeDocName:t,deferredActiveDocName:n,mountResolved:r,syncResolved:i}=e;return t===null||t===n?!1:!(r&&i)}var _D=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityModeContent-CKlljrfV.js`),__vite__mapDeps([32,1,2,33,34,35,20,36,37,38,39,19,3,7,8,4,10,9,40,41]),import.meta.url)).ActivityModeContent}));function vD(e){let t=(0,$.c)(5),n;t[0]===e?n=t[1]:(n=(0,Z.jsx)(bD,{...e}),t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(yD,{}),t[2]=r):r=t[2];let i;return t[3]===n?i=t[4]:(i=(0,Z.jsx)(J,{name:`editor-area`,children:(0,Z.jsxs)(KC,{children:[n,r]})}),t[3]=n,t[4]=i),i}function yD(){let e=(0,$.c)(5),t=ah(),n;e[0]===t?n=e[1]:(n=e=>{e||t.close()},e[0]=t,e[1]=n);let r;return e[2]!==t.open||e[3]!==n?(r=(0,Z.jsx)(nw,{open:t.open,onOpenChange:n}),e[2]=t.open,e[3]=n,e[4]=r):r=e[4],r}function bD(e){let t=(0,$.c)(104),{editorMode:n,onModeChange:r,activeTab:i,onActiveTabChange:a}=e,{activeDocName:o,activeProvider:s,activeTarget:c,recycleDocument:l,docPanelMode:u,docPanelAgentId:d,docPanelExpandSignal:f}=ut(),{openDocumentTransition:p}=xt(),{requestAddProperty:m}=JC(),h=Yw(s,o),g=Xw(s),_=g===`connected`||g===`synced`,v=(0,Q.useDeferredValue)(o),y=c?.kind===`missing`,b=!!o&&c?.kind!==`folder`,x=y?`Start writing to create this page`:void 0,S=aS(),[C,w]=(0,Q.useState)(!1),{layout:T,autoCollapse:E}=Nw(),D=T===`sheet`,[O,k]=(0,Q.useState)(!1),A=(0,Q.useRef)(!1),j,M;t[0]!==E||t[1]!==T||t[2]!==S?(j=()=>{if(T!==`panel`)return;let e=requestAnimationFrame(()=>{E?(A.current=!1,S.current?.collapse()):A.current||S.current?.expand()});return()=>cancelAnimationFrame(e)},M=[E,T,S],t[0]=E,t[1]=T,t[2]=S,t[3]=j,t[4]=M):(j=t[3],M=t[4]),(0,Q.useEffect)(j,M);let N,P;t[5]!==D||t[6]!==a||t[7]!==S?(N=()=>{let e=e=>{a(e),D?k(!0):(A.current=!1,S.current?.expand())},t=cm();return t&&e(t),um(t=>{cm(),e(t)})},P=[D,a,S],t[5]=D,t[6]=a,t[7]=S,t[8]=N,t[9]=P):(N=t[8],P=t[9]),(0,Q.useEffect)(N,P);let F,I;t[10]!==f||t[11]!==D||t[12]!==S?(F=()=>{f!==0&&(D?k(!0):(A.current=!1,S.current?.expand()))},I=[f,D,S],t[10]=f,t[11]=D,t[12]=S,t[13]=F,t[14]=I):(F=t[13],I=t[14]),(0,Q.useEffect)(F,I);let L=(0,Q.useRef)(null),[R,z]=(0,Q.useState)(null),B,V;if(t[15]===o?(B=t[16],V=t[17]):(B=()=>{if(o&&o!==L.current){let e=L.current;L.current=o,z(e)}},V=[o],t[15]=o,t[16]=B,t[17]=V),(0,Q.useEffect)(B,V),c?.kind===`folder`){if(!(u===`agent`&&d!==null)){let e;return t[18]===c.folderPath?e=t[19]:(e=(0,Z.jsx)(zC,{folderPath:c.folderPath}),t[18]=c.folderPath,t[19]=e),e}let e;t[20]===c.folderPath?e=t[21]:(e=(0,Z.jsx)(sw,{minSize:`30%`,defaultSize:`75%`,children:(0,Z.jsx)(zC,{folderPath:c.folderPath})}),t[20]=c.folderPath,t[21]=e);let n;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(cw,{withHandle:!0}),t[22]=n):n=t[22];let r;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(sw,{defaultSize:`25%`,minSize:`300px`,maxSize:`40%`,className:`flex flex-col bg-muted/20`,children:(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{role:`status`,"aria-busy":`true`,className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Loading agent activity`}),children:(0,Z.jsx)(_D,{showBackButton:!1})})}),t[23]=r):r=t[23];let i;return t[24]===e?i=t[25]:(i=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1`,children:(0,Z.jsxs)(ow,{orientation:`horizontal`,children:[e,n,r]})}),t[24]=e,t[25]=i),i}if(c?.kind===`asset`){let e;return t[26]!==c.assetPath||t[27]!==c.mediaKind?(e=(0,Z.jsx)(_S,{assetPath:c.assetPath,mediaKind:c.mediaKind},c.assetPath),t[26]=c.assetPath,t[27]=c.mediaKind,t[28]=e):e=t[28],e}if(!s||!o){if((typeof window<`u`?oi(window.location.hash):null)!==null){let e;return t[29]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(vS,{}),t[29]=e):e=t[29],e}let e;return t[30]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(fC,{}),t[30]=e):e=t[30],e}let H=n===`source`,U=!_,W=D?!O:C,G;t[31]!==o||t[32]!==m?(G=function(){o&&m(o)},t[31]=o,t[32]=m,t[33]=G):G=t[33];let ee=G,te;t[34]!==C||t[35]!==D||t[36]!==S?(te=function(){D?k(xD):C?(A.current=!1,S.current?.expand()):(A.current=!0,S.current?.collapse())},t[34]=C,t[35]=D,t[36]=S,t[37]=te):te=t[37];let ne=te,re=v??o,ie=R??void 0,ae;t[38]===p?ae=t[39]:(ae=e=>{let t=kr(e);window.location.hash===t?p(e):window.location.hash=t},t[38]=p,t[39]=ae);let oe;t[40]!==x||t[41]!==H||t[42]!==l||t[43]!==re||t[44]!==ie||t[45]!==ae?(oe=(0,Z.jsx)(YE,{activeDocName:re,isSourceMode:H,editorPlaceholder:x,previousDocName:ie,onNavigateBack:ae,onRecycle:l}),t[40]=x,t[41]=H,t[42]=l,t[43]=re,t[44]=ie,t[45]=ae,t[46]=oe):oe=t[46];let se;t[47]!==o||t[48]!==H?(se=(0,Z.jsx)(Ow,{activeDocName:o,isSourceMode:H}),t[47]=o,t[48]=H,t[49]=se):se=t[49];let K;t[50]!==o||t[51]!==v?(K=gD({activeDocName:o,deferredActiveDocName:v,mountResolved:o!==null&&pe(o),syncResolved:o!==null&&Ue(o)})?(0,Z.jsxs)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:[(0,Z.jsx)(vS,{}),o===null?null:(0,Z.jsx)(UC,{docName:o})]}):null,t[50]=o,t[51]=v,t[52]=K):K=t[52];let ce;t[53]!==oe||t[54]!==se||t[55]!==K?(ce=(0,Z.jsxs)(`div`,{className:`relative h-full`,children:[oe,se,K]}),t[53]=oe,t[54]=se,t[55]=K,t[56]=ce):ce=t[56];let le=!H,ue;t[57]!==o||t[58]!==W||t[59]!==H||t[60]!==r||t[61]!==ee||t[62]!==U||t[63]!==le||t[64]!==ne?(ue=(0,Z.jsx)(hD,{activeDocName:o,isSourceMode:H,sourceDisabled:U,onModeChange:r,showAddPropertyButton:le,onAddProperty:ee,isPanelCollapsed:W,onTogglePanel:ne}),t[57]=o,t[58]=W,t[59]=H,t[60]=r,t[61]=ee,t[62]=U,t[63]=le,t[64]=ne,t[65]=ue):ue=t[65];let q;t[66]!==ce||t[67]!==ue?(q=(0,Z.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[ce,ue]}),t[66]=ce,t[67]=ue,t[68]=q):q=t[68];let de;t[69]!==b||t[70]!==h?(de=b&&(0,Z.jsx)(iD,{stats:h}),t[69]=b,t[70]=h,t[71]=de):de=t[71];let fe;t[72]!==q||t[73]!==de?(fe=(0,Z.jsxs)(`div`,{className:`relative flex h-full flex-col`,children:[q,de]}),t[72]=q,t[73]=de,t[74]=fe):fe=t[74];let me=fe,he=D?`100%`:`30%`,ge=D?`100%`:`75%`,_e;t[75]!==me||t[76]!==he||t[77]!==ge?(_e=(0,Z.jsx)(sw,{minSize:he,defaultSize:ge,children:me}),t[75]=me,t[76]=he,t[77]=ge,t[78]=_e):_e=t[78];let ve;t[79]===D?ve=t[80]:(ve=D?null:(0,Z.jsx)(cw,{withHandle:!0}),t[79]=D,t[80]=ve);let ye;t[81]!==o||t[82]!==i||t[83]!==u||t[84]!==D||t[85]!==H||t[86]!==a||t[87]!==S?(ye=D?null:(0,Z.jsx)(sw,{panelRef:S,defaultSize:`25%`,minSize:`300px`,maxSize:`40%`,collapsible:!0,collapsedSize:0,onResize:e=>w(e.asPercentage===0),className:`flex flex-col bg-muted/20`,children:(0,Z.jsx)(fb,{docName:o,isSourceMode:H,activeTab:i,onActiveTabChange:a,mode:u})}),t[81]=o,t[82]=i,t[83]=u,t[84]=D,t[85]=H,t[86]=a,t[87]=S,t[88]=ye):ye=t[88];let be;t[89]!==_e||t[90]!==ve||t[91]!==ye?(be=(0,Z.jsxs)(ow,{orientation:`horizontal`,children:[_e,ve,ye]}),t[89]=_e,t[90]=ve,t[91]=ye,t[92]=be):be=t[92];let xe;t[93]!==o||t[94]!==i||t[95]!==u||t[96]!==D||t[97]!==H||t[98]!==a||t[99]!==O?(xe=D?(0,Z.jsx)(jv,{open:O,onOpenChange:k,children:(0,Z.jsxs)(Pv,{side:`right`,className:`flex w-80 sm:w-96 flex-col gap-0 p-0`,children:[(0,Z.jsx)(Fv,{className:`sr-only`,children:(0,Z.jsx)(Iv,{children:`Document panel`})}),(0,Z.jsx)(fb,{docName:o,isSourceMode:H,activeTab:i,onActiveTabChange:a,mode:u})]})}):null,t[93]=o,t[94]=i,t[95]=u,t[96]=D,t[97]=H,t[98]=a,t[99]=O,t[100]=xe):xe=t[100];let Se;return t[101]!==be||t[102]!==xe?(Se=(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[be,xe]}),t[101]=be,t[102]=xe,t[103]=Se):Se=t[103],Se}function xD(e){return!e}var SD=1280;function CD(){let e=(0,$.c)(2),[t,n]=(0,Q.useState)(wD),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.matchMedia(`(max-width: ${SD-1}px)`),t=()=>{n(window.innerWidth<SD)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,Q.useEffect)(r,i),t}function wD(){return window.innerWidth<SD}function TD(e){let t=e.endsWith(`rem`)?`rem`:`px`;return{value:Number.parseFloat(e),unit:t}}function ED(e){let{value:t,unit:n}=TD(e);return n===`rem`?t*16:t}function DD(e,t){return`${t===`rem`?e.toFixed(1):Math.round(e)}${t}`}var OD=3600*24*7;function kD(e){let t=(0,$.c)(28),{direction:n,currentWidth:r,onResize:i,onToggle:a,isCollapsed:o,minResizeWidth:s,maxResizeWidth:c,enableToggle:l,enableAutoCollapse:u,autoCollapseThreshold:d,expandThreshold:f,enableDrag:p,setIsDraggingRail:m,widthCookieName:h,widthCookieMaxAge:g,isNested:_}=e,v=n===void 0?`right`:n,y=o===void 0?!1:o,b=s===void 0?`14rem`:s,x=c===void 0?`24rem`:c,S=l===void 0?!0:l,C=u===void 0?!0:u,w=d===void 0?1.5:d,T=f===void 0?.2:f,E=p===void 0?!0:p,D=m===void 0?AD:m,O=g===void 0?OD:g,k=_===void 0?!1:_,A=(0,Q.useRef)(null),j=(0,Q.useRef)(0),M=(0,Q.useRef)(0),N=(0,Q.useRef)(!1),P=(0,Q.useRef)(!1),F=(0,Q.useRef)(null),I=(0,Q.useRef)(0),L=(0,Q.useRef)(!1),R=(0,Q.useRef)(0),z=(0,Q.useRef)(0),B=(0,Q.useRef)(null),V=(0,Q.useRef)(r),H=(0,Q.useRef)(y),U,W;t[0]===r?(U=t[1],W=t[2]):(U=()=>{V.current=r},W=[r],t[0]=r,t[1]=U,t[2]=W),(0,Q.useEffect)(U,W);let G,ee;t[3]===y?(G=t[4],ee=t[5]):(G=()=>{H.current=y},ee=[y],t[3]=y,t[4]=G,t[5]=ee),(0,Q.useEffect)(G,ee);let te=ED(b),ne;t[6]===x?ne=t[7]:(ne=ED(x),t[6]=x,t[7]=ne);let re=ne,ie;t[8]!==E||t[9]!==k?(ie=function(e){P.current=!0,E&&(j.current=H.current?0:ED(V.current),M.current=e.clientX,I.current=e.clientX,F.current=null,L.current=!1,R.current=0,z.current=0,B.current=k&&A.current?A.current.getBoundingClientRect():null,e.preventDefault())},t[8]=E,t[9]=k,t[10]=ie):ie=t[10];let ae=ie,oe,se;t[11]!==w||t[12]!==v||t[13]!==C||t[14]!==S||t[15]!==T||t[16]!==k||t[17]!==re||t[18]!==te||t[19]!==i||t[20]!==a||t[21]!==D||t[22]!==O||t[23]!==h?(oe=()=>{let e=function(e){h&&(document.cookie=`${h}=${e}; path=/; max-age=${O}`)},t=function(e,t){return v===`left`?e<t:e>t},n=function(e,t,n,r){if(k&&r){let r=e.clientX-t;return v===`left`?n-r:n+r}return v===`left`?window.innerWidth-e.clientX:e.clientX},r=function(r){if(!P.current)return;let o=Math.abs(r.clientX-M.current);if(!N.current&&o>5&&(N.current=!0,D(!0)),N.current){let{unit:o}=TD(V.current),s=B.current;k&&A.current&&(s=A.current.getBoundingClientRect());let c=t(r.clientX,I.current)?`expand`:`collapse`;F.current!==c&&(F.current=c),z.current=Math.abs(r.clientX-I.current);let l=Date.now();if(L.current&&l-R.current>200&&(L.current=!1),!L.current){if(C&&a&&!H.current){let e=n(r,M.current,j.current,s),t=!1;if(w<=1)t=e<=te*w;else if(e<=te){let n=te*(w-1);t=te-e>=n}if(c===`collapse`&&t){a(),I.current=r.clientX,L.current=!0,R.current=l;return}}if(a&&H.current&&c===`expand`&&z.current>te*T){a();let t=n(r,M.current,j.current,s),c=Math.max(te,Math.min(re,t)),u=DD(o===`rem`?c/16:c,o);i(u),e(u),I.current=r.clientX,L.current=!0,R.current=l;return}}if(H.current)return;let u=n(r,M.current,j.current,s),d=Math.max(te,Math.min(re,u)),f=DD(o===`rem`?d/16:d,o);i(f),e(f)}},o=function(){P.current&&(!N.current&&a&&S&&a(),N.current=!1,P.current=!1,F.current=null,I.current=0,L.current=!1,R.current=0,z.current=0,B.current=null,D(!1))};return document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,o),()=>{document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,o)}},se=[i,a,D,te,re,k,C,w,T,S,h,O,v],t[11]=w,t[12]=v,t[13]=C,t[14]=S,t[15]=T,t[16]=k,t[17]=re,t[18]=te,t[19]=i,t[20]=a,t[21]=D,t[22]=O,t[23]=h,t[24]=oe,t[25]=se):(oe=t[24],se=t[25]),(0,Q.useEffect)(oe,se);let K;return t[26]===ae?K=t[27]:(K={dragRef:A,isDragging:N,handleMouseDown:ae},t[26]=ae,t[27]=K),K}function AD(){}var jD=`sidebar_state`,MD=3600*24*7,ND=`18rem`,PD=`3rem`,FD=`\\`,ID=`app-file-sidebar`,LD=`14.625rem`,RD=`22rem`,zD=`sidebar_width`,BD=/^\d+(?:\.\d+)?(?:rem|px)$/,VD=Q.createContext(null);function HD(e){if(typeof document>`u`)return e;let t=document.cookie.split(`; `).find(e=>e.startsWith(`${zD}=`))?.split(`=`)[1];if(!t)return e;let n;try{n=decodeURIComponent(t)}catch{return e}return BD.test(n)?n:e}function UD(){let e=Q.use(VD);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function WD(e){let t=(0,$.c)(53),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({defaultOpen:c,open:i,onOpenChange:o,className:r,style:s,children:n,defaultWidth:l,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let u=c===void 0?!0:c,d=l===void 0?ND:l,f=CD(),p;t[9]===d?p=t[10]:(p=()=>HD(d),t[9]=d,t[10]=p);let[m,h]=Q.useState(p),[g,_]=Q.useState(!1),v=Q.useRef(g),[y,b]=Q.useState(!1),[x,S]=Q.useState(!1),[C,w]=Q.useState(u),T=i??C,E;t[11]!==T||t[12]!==o?(E=e=>{let t=typeof e==`function`?e(T):e;o?o(t):w(t),document.cookie=`${jD}=${t}; path=/; max-age=${MD}`},t[11]=T,t[12]=o,t[13]=E):E=t[13];let D=E,O;t[14]===D?O=t[15]:(O=function(){return window.innerWidth<1280?_(KD):D(GD)},t[14]=D,t[15]=O);let k=O,A;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(A=function(){window.innerWidth>=1280||v.current&&(window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||S(!0))},t[16]=A):A=t[16];let j=A,M;t[17]===g?M=t[18]:(M=()=>{v.current=g},t[17]=g,t[18]=M),Q.useLayoutEffect(M);let N,P;t[19]===k?(N=t[20],P=t[21]):(N=()=>{let e=e=>{e.key===FD&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),k())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},P=[k],t[19]=k,t[20]=N,t[21]=P),Q.useEffect(N,P);let F,I;t[22]!==f||t[23]!==g?(F=()=>{if(!f||!g)return;let e=e=>{e.key===`Escape`&&(document.querySelector(`[data-state="open"][role="dialog"], [data-state="open"][role="alertdialog"], [data-state="open"][role="menu"], [data-state="open"][role="listbox"], [data-radix-popper-content-wrapper] [data-state="open"]`)||_(!1))};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},I=[f,g],t[22]=f,t[23]=g,t[24]=F,t[25]=I):(F=t[24],I=t[25]),Q.useEffect(F,I);let L=Q.useRef(f),R,z;t[26]!==f||t[27]!==T?(R=()=>{!L.current&&f&&_(T),L.current=f},z=[f,T],t[26]=f,t[27]=T,t[28]=R,t[29]=z):(R=t[28],z=t[29]),Q.useEffect(R,z);let B=f?g?`expanded`:`collapsed`:T?`expanded`:`collapsed`,V;t[30]!==y||t[31]!==f||t[32]!==T||t[33]!==g||t[34]!==D||t[35]!==x||t[36]!==B||t[37]!==k||t[38]!==m?(V={state:B,open:T,setOpen:D,isMobile:f,openMobile:g,setOpenMobile:_,toggleSidebar:k,width:m,setWidth:h,isDraggingRail:y,setIsDraggingRail:b,showPushPulse:x,setShowPushPulse:S,notifySidebarFileSelected:j},t[30]=y,t[31]=f,t[32]=T,t[33]=g,t[34]=D,t[35]=x,t[36]=B,t[37]=k,t[38]=m,t[39]=V):V=t[39];let H;t[40]!==s||t[41]!==m?(H={"--sidebar-width":m,"--sidebar-width-icon":PD,...s},t[40]=s,t[41]=m,t[42]=H):H=t[42];let U=H,W;t[43]===r?W=t[44]:(W=Di(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),t[43]=r,t[44]=W);let G;t[45]!==n||t[46]!==a||t[47]!==U||t[48]!==W?(G=(0,Z.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:U,className:W,...a,children:n}),t[45]=n,t[46]=a,t[47]=U,t[48]=W,t[49]=G):G=t[49];let ee;return t[50]!==V||t[51]!==G?(ee=(0,Z.jsx)(VD.Provider,{value:V,children:G}),t[50]=V,t[51]=G,t[52]=ee):ee=t[52],ee}function GD(e){return!e}function KD(e){return!e}function qD(e){let t=(0,$.c)(51),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({side:a,variant:o,collapsible:s,className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=a===void 0?`left`:a,l=o===void 0?`sidebar`:o,u=s===void 0?`offcanvas`:s,{isMobile:d,state:f,openMobile:p,isDraggingRail:m}=UD();if(u===`none`){let e;t[7]===r?e=t[8]:(e=Di(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),t[7]=r,t[8]=e);let a;return t[9]!==n||t[10]!==i||t[11]!==e||t[12]!==l?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar`,"data-variant":l,className:e,...i,children:n}),t[9]=n,t[10]=i,t[11]=e,t[12]=l,t[13]=a):a=t[13],a}if(d){let e=p?`expanded`:`collapsed`,a=l===`floating`||l===`inset`?`p-2`:``,o;t[14]!==r||t[15]!==a?(o=Di(`fixed inset-y-0 z-30 flex h-svh w-(--sidebar-width)`,`transition-transform duration-200 ease-linear motion-reduce:transition-none`,`data-[side=left]:left-0 data-[side=right]:right-0`,`group-data-[state=collapsed]:data-[side=left]:-translate-x-full`,`group-data-[state=collapsed]:data-[side=right]:translate-x-full`,a,r),t[14]=r,t[15]=a,t[16]=o):o=t[16];let s;t[17]===n?s=t[18]:(s=(0,Z.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:n}),t[17]=n,t[18]=s);let u;t[19]!==i||t[20]!==c||t[21]!==o||t[22]!==s?(u=(0,Z.jsx)(`nav`,{id:ID,"aria-label":`File sidebar`,"data-slot":`sidebar-container`,"data-side":c,className:o,...i,children:s}),t[19]=i,t[20]=c,t[21]=o,t[22]=s,t[23]=u):u=t[23];let d;return t[24]!==e||t[25]!==c||t[26]!==u||t[27]!==l?(d=(0,Z.jsx)(`div`,{className:`group peer text-sidebar-foreground`,"data-state":e,"data-variant":l,"data-side":c,"data-slot":`sidebar`,"data-mobile":`true`,children:u}),t[24]=e,t[25]=c,t[26]=u,t[27]=l,t[28]=d):d=t[28],d}let h=f===`collapsed`?u:``,g=l===`floating`||l===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,_;t[29]===g?_=t[30]:(_=Di(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,g,`group-data-[dragging=true]:duration-0! group-data-[dragging=true]_*:!duration-0`),t[29]=g,t[30]=_);let v;t[31]===_?v=t[32]:(v=(0,Z.jsx)(`div`,{"data-slot":`sidebar-gap`,className:_}),t[31]=_,t[32]=v);let y=l===`floating`||l===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,b;t[33]!==r||t[34]!==y?(b=Di(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex`,y,`group-data-[dragging=true]:duration-0! group-data-[dragging=true]_*:!duration-0`,r),t[33]=r,t[34]=y,t[35]=b):b=t[35];let x;t[36]===n?x=t[37]:(x=(0,Z.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:n}),t[36]=n,t[37]=x);let S;t[38]!==i||t[39]!==c||t[40]!==x||t[41]!==b?(S=(0,Z.jsx)(`nav`,{id:ID,"aria-label":`File sidebar`,"data-slot":`sidebar-container`,"data-side":c,className:b,...i,children:x}),t[38]=i,t[39]=c,t[40]=x,t[41]=b,t[42]=S):S=t[42];let C;return t[43]!==m||t[44]!==c||t[45]!==f||t[46]!==S||t[47]!==h||t[48]!==v||t[49]!==l?(C=(0,Z.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":f,"data-collapsible":h,"data-variant":l,"data-side":c,"data-slot":`sidebar`,"data-dragging":m,children:[v,S]}),t[43]=m,t[44]=c,t[45]=f,t[46]=S,t[47]=h,t[48]=v,t[49]=l,t[50]=C):C=t[50],C}function JD(e){let t=(0,$.c)(18),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,onClick:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{toggleSidebar:a,state:o}=UD(),s=o===`expanded`,c=o===`expanded`?`Hide Files`:`Show Files`,u;t[4]===n?u=t[5]:(u=Di(n),t[4]=n,t[5]=u);let d;t[6]!==r||t[7]!==a?(d=e=>{r?.(e),a()},t[6]=r,t[7]=a,t[8]=d):d=t[8];let f;t[9]===o?f=t[10]:(f=o===`expanded`?(0,Z.jsx)(l,{}):(0,Z.jsx)(Fc,{}),t[9]=o,t[10]=f);let p;return t[11]!==i||t[12]!==s||t[13]!==c||t[14]!==u||t[15]!==d||t[16]!==f?(p=(0,Z.jsx)(Y,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,"aria-expanded":s,"aria-controls":ID,"aria-label":c,className:u,onClick:d,...i,children:f}),t[11]=i,t[12]=s,t[13]=c,t[14]=u,t[15]=d,t[16]=f,t[17]=p):p=t[17],p}function YD(e){let t=(0,$.c)(26),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:n,enableDrag:a,enableToggle:o,onMouseDown:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=a===void 0?!0:a,c=o===void 0?!0:o,{toggleSidebar:l,setWidth:u,state:d,width:f,setIsDraggingRail:p}=UD(),m=d===`collapsed`,h;t[6]!==s||t[7]!==c||t[8]!==p||t[9]!==u||t[10]!==m||t[11]!==l||t[12]!==f?(h={direction:`right`,enableDrag:s,enableToggle:c,onResize:u,onToggle:l,currentWidth:f,isCollapsed:m,minResizeWidth:LD,maxResizeWidth:RD,setIsDraggingRail:p,widthCookieName:zD,widthCookieMaxAge:MD},t[6]=s,t[7]=c,t[8]=p,t[9]=u,t[10]=m,t[11]=l,t[12]=f,t[13]=h):h=t[13];let{dragRef:g,handleMouseDown:_}=kD(h),v=d===`expanded`?`Hide Files`:`Show Files`,y;t[14]!==_||t[15]!==r?(y=e=>{r?.(e),e.defaultPrevented||_(e)},t[14]=_,t[15]=r,t[16]=y):y=t[16];let b=d===`expanded`?`Hide Files`:`Show Files`,x;t[17]===n?x=t[18]:(x=Di(`absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2`,`in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,`md:group-data-[variant=inset]:after:inset-y-5`,n),t[17]=n,t[18]=x);let S;return t[19]!==g||t[20]!==i||t[21]!==v||t[22]!==y||t[23]!==b||t[24]!==x?(S=(0,Z.jsx)(`button`,{ref:g,"data-sidebar":`rail`,"data-slot":`sidebar-rail`,"aria-label":v,tabIndex:-1,onMouseDown:y,title:b,className:x,...i}),t[19]=g,t[20]=i,t[21]=v,t[22]=y,t[23]=b,t[24]=x,t[25]=S):S=t[25],S}function XD(e){let t=(0,$.c)(21),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,onClick:i,onAnimationEnd:r,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let{isMobile:o,openMobile:s,setOpenMobile:c,showPushPulse:l,setShowPushPulse:u}=UD(),d;t[5]!==o||t[6]!==i||t[7]!==s||t[8]!==c?(d=e=>{i?.(e),!e.defaultPrevented&&(!o||!s||e.target?.closest(`[data-sidebar="trigger"]`)||c(!1))},t[5]=o,t[6]=i,t[7]=s,t[8]=c,t[9]=d):d=t[9];let f=d,p;t[10]!==r||t[11]!==u?(p=e=>{r?.(e),e.animationName===`sidebar-push-pulse`&&u(!1)},t[10]=r,t[11]=u,t[12]=p):p=t[12];let m=p,h=l?``:void 0,g;t[13]===n?g=t[14]:(g=Di(`relative flex w-full flex-1 flex-col bg-background peer-data-[variant=inset]:m-2 peer-data-[variant=inset]:ml-0 peer-data-[variant=inset]:rounded-xl peer-data-[variant=inset]:shadow-sm peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,`transition-transform duration-200 ease-linear motion-reduce:transition-none`,`peer-data-[mobile=true]:peer-data-[state=expanded]:translate-x-(--sidebar-width)`,n),t[13]=n,t[14]=g);let _;return t[15]!==m||t[16]!==f||t[17]!==a||t[18]!==h||t[19]!==g?(_=(0,Z.jsx)(`main`,{"data-slot":`sidebar-inset`,"data-push-pulse":h,onClick:f,onAnimationEnd:m,className:g,...a}),t[15]=m,t[16]=f,t[17]=a,t[18]=h,t[19]=g,t[20]=_):_=t[20],_}function ZD(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function QD(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function $D(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function eO(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`flex w-full min-w-0 flex-col gap-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function tO(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`group/menu-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var nO=Ri(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-hover hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-hover active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-hover data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground data-active:hover:bg-sidebar-accent [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-hover hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-hover hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function rO(e){let t=(0,$.c)(28),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({asChild:i,isActive:a,variant:o,size:s,tooltip:c,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=i===void 0?!1:i,u=a===void 0?!1:a,d=o===void 0?`default`:o,f=s===void 0?`default`:s,p=l?ji:`button`,{isMobile:m,state:h}=UD(),g;t[8]!==n||t[9]!==f||t[10]!==d?(g=Di(nO({variant:d,size:f}),n),t[8]=n,t[9]=f,t[10]=d,t[11]=g):g=t[11];let _;t[12]!==p||t[13]!==u||t[14]!==r||t[15]!==f||t[16]!==g?(_=(0,Z.jsx)(p,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":f,"data-active":u,className:g,...r}),t[12]=p,t[13]=u,t[14]=r,t[15]=f,t[16]=g,t[17]=_):_=t[17];let v=_;if(!c)return v;if(typeof c==`string`){let e;t[18]===c?e=t[19]:(e={children:c},t[18]=c,t[19]=e),c=e}let y;t[20]===v?y=t[21]:(y=(0,Z.jsx)(En,{asChild:!0,children:v}),t[20]=v,t[21]=y);let b=h!==`collapsed`||m,x;t[22]!==b||t[23]!==c?(x=(0,Z.jsx)(er,{side:`right`,align:`center`,hidden:b,...c}),t[22]=b,t[23]=c,t[24]=x):x=t[24];let S;return t[25]!==y||t[26]!==x?(S=(0,Z.jsxs)(jn,{children:[y,x]}),t[25]=y,t[26]=x,t[27]=S):S=t[27],S}function iO(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.kind!==i.kind)return!1;if(r.kind===`human`&&i.kind===`human`){if(r.clientId!==i.clientId||r.mode!==i.mode||r.tabCount!==i.tabCount)return!1;let e=r.user,t=i.user;if(e.name!==t.name||e.color!==t.color||e.icon!==t.icon)return!1}else if(r.kind===`agent`&&i.kind===`agent`){if(r.agentId!==i.agentId)return!1;let e=r.presence,t=i.presence;if(e.displayName!==t.displayName||e.icon!==t.icon||e.color!==t.color||e.currentDoc!==t.currentDoc||e.mode!==t.mode)return!1}}return!0}function aO(e){let t=new Map;for(let n of e){let e=n.user.principalId;if(typeof e==`string`&&e.length>0){let r=t.get(e);r?r.push(n):t.set(e,[n])}}let n=new Map;for(let[e,r]of t){let t=r.reduce((e,t)=>Math.min(e,t.clientId),1/0);n.set(e,{repClientId:t,count:r.length})}let r=[];for(let t of e){let e=t.user.principalId;if(typeof e==`string`&&e.length>0){let i=n.get(e);i&&i.repClientId===t.clientId&&r.push({...t,tabCount:i.count})}else r.push({...t,tabCount:1})}return r}var oO=1e3,sO=!1;function cO(e){return!!(e.localPrincipalId&&e.entryPrincipalId===e.localPrincipalId||!e.localPrincipalId&&e.entryClientId===e.localClientId)}function lO(e,t,n){let r=(0,$.c)(9),i;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={current:[],crossDoc:[]},r[0]=i):i=r[0];let[a,o]=(0,Q.useState)(i),s;r[1]!==n||r[2]!==e?.awareness||r[3]!==t?.awareness?(s=()=>{let r=e?.awareness,i=t?.awareness,a;i==null?a=void 0:Zi(i)?a=i:(a=void 0,sO||(sO=!0,console.warn(`[agent-presence] __system__ provider awareness missing getStates() — presence bar will render without agent peers`)));let s=()=>{let e=(r?.getLocalState())?.user?.principalId??null,t=r?.clientID??null,i=[];if(r)for(let[n,a]of r.getStates().entries()){let r=a;if(!r.user||typeof r.user!=`object`)continue;let o=r.user;o.type===`human`&&(cO({entryPrincipalId:o.principalId,entryClientId:n,localPrincipalId:e,localClientId:t})||i.push({kind:`human`,clientId:n,user:o,mode:r.mode??`wysiwyg`,tabCount:1}))}let s=aO(i),{current:c,crossDoc:l}=a?Ki(a,n,Date.now()):{current:[],crossDoc:[]},u=uO,d=c.map(u),f=l.map(u),p=[...s,...d],m=f;o(e=>iO(e.current,p)&&iO(e.crossDoc,m)?e:{current:p,crossDoc:m})};s();let c=()=>s(),l=()=>s();r?.on(`change`,c),t?.awareness?.on(`change`,l);let u=setInterval(s,oO);return()=>{r?.off(`change`,c),t?.awareness?.off(`change`,l),clearInterval(u)}},r[1]=n,r[2]=e?.awareness,r[3]=t?.awareness,r[4]=s):s=r[4];let c;return r[5]!==n||r[6]!==e||r[7]!==t?(c=[e,t,n],r[5]=n,r[6]=e,r[7]=t,r[8]=c):c=r[8],(0,Q.useEffect)(s,c),a}function uO(e){let{agentId:t,entry:n}=e;return{kind:`agent`,agentId:t,presence:n}}var dO=`sync-status`;function fO(e,t){let n=(0,$.c)(4),r=(0,Q.useRef)(!1),i=(0,Q.useRef)(!1),a=(0,Q.useRef)(t),o,s;n[0]!==t||n[1]!==e?(o=()=>{a.current!==t&&(a.current=t,r.current=!1,i.current=!1),t&&(e===`synced`&&(r.current=!0),e===`disconnected`&&r.current?(i.current=!0,X.warning(`Connection lost — keep this tab open, your edits will sync when reconnected`,{id:dO,duration:1/0})):i.current&&e===`synced`&&(i.current=!1,X.success(`Reconnected`,{id:dO,duration:3e3})))},s=[e,t],n[0]=t,n[1]=e,n[2]=o,n[3]=s):(o=n[2],s=n[3]),(0,Q.useEffect)(o,s)}var pO=4,mO=3,hO={Bird:Ys,Cat:tc,Dog:fc,Fish:gc,Mouse:Hc,Rabbit:Vc,Shrimp:Xc,Snail:Zc,Squirrel:el,Turtle:al};Object.freeze(Object.keys(hO));function gO(e){if(typeof e.principalId==`string`&&e.principalId.length>0)return{kind:`initials`};let t=e.name.split(` `)[1];return t&&Object.hasOwn(hO,t)?{kind:`animal`,animal:t}:{kind:`initials`}}var _O={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`,bot:`Agent`};function vO(e){let t=(0,$.c)(20),{user:n,mode:r,tabCount:i}=e,a=gO(n),o=a.kind===`animal`?hO[a.animal]:void 0,s;t[0]===n.name?s=t[1]:(s=sr(n.name),t[0]=n.name,t[1]=s);let c=s,l;t[2]===n.color?l=t[3]:(l=Mn(n.color),t[2]=n.color,t[3]=l);let u=l,d=i>1?`${n.name} · ${i} tabs`:n.name,f=i>1?`${n.name}, ${i} concurrent tabs`:n.name,p;t[4]===n.color?p=t[5]:(p={backgroundColor:n.color},t[4]=n.color,t[5]=p);let m;t[6]!==o||t[7]!==u||t[8]!==c?(m=o?(0,Z.jsx)(o,{size:18,color:u,strokeWidth:1.5}):(0,Z.jsx)(`span`,{className:`font-mono text-2xs font-semibold leading-none`,style:{color:u},children:c}),t[6]=o,t[7]=u,t[8]=c,t[9]=m):m=t[9];let h;t[10]!==f||t[11]!==r||t[12]!==p||t[13]!==m?(h=(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(`div`,{"data-presence-badge":`human`,"data-presence-mode":r,role:`img`,"aria-label":f,className:`inline-flex size-7 shrink-0 cursor-default items-center justify-center rounded-full ring-2 ring-background`,style:p,children:m})}),t[10]=f,t[11]=r,t[12]=p,t[13]=m,t[14]=h):h=t[14];let g;t[15]===d?g=t[16]:(g=(0,Z.jsx)(er,{children:d}),t[15]=d,t[16]=g);let _;return t[17]!==h||t[18]!==g?(_=(0,Z.jsxs)(jn,{children:[h,g]}),t[17]=h,t[18]=g,t[19]=_):_=t[19],_}function yO(e){let t=_O[e.icon];return e.displayName||t||`Agent`}function bO(e){let t=(0,$.c)(3),[n,r]=(0,Q.useState)(e===`writing`),i=(0,Q.useRef)(null),a,o;return t[0]===e?(a=t[1],o=t[2]):(a=()=>{if(e===`writing`){i.current!==null&&(clearTimeout(i.current),i.current=null),r(!0);return}return i.current!==null&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,r(!1)},600),()=>{i.current!==null&&(clearTimeout(i.current),i.current=null)}},o=[e],t[0]=e,t[1]=a,t[2]=o),(0,Q.useEffect)(a,o),n}function xO(e){let t=(0,$.c)(36),{participant:n,crossDoc:r,scoped:i,onClickAgent:a}=e,{presence:o,agentId:s}=n,c;t[0]===o?c=t[1]:(c=yO(o),t[0]=o,t[1]=c);let l=c,u=bO(o.mode),d=!r&&u,f=i?`ring-primary ring-offset-2 ring-offset-background`:`ring-background`,p=d&&!i?`ring-primary/40 animate-pulse`:``,m;t[2]!==f||t[3]!==p?(m=[`inline-flex size-7 shrink-0 items-center justify-center rounded-full ring-2 cursor-pointer`,f,p].filter(Boolean),t[2]=f,t[3]=p,t[4]=m):m=t[4];let h=m.join(` `),g=r?`true`:void 0,_=i?`true`:void 0,v;t[5]!==o.mode||t[6]!==g||t[7]!==_?(v={"data-presence-badge":`agent`,"data-presence-mode":o.mode,"data-presence-crossdoc":g,"data-presence-scoped":_},t[5]=o.mode,t[6]=g,t[7]=_,t[8]=v):v=t[8];let y=v,b=o.currentDoc&&o.currentDoc!==`(connected)`?o.currentDoc:null,x=r&&b?`Open activity panel for ${l}, editing ${b}`:`Open activity panel for ${l}`,S;t[9]===o.color?S=t[10]:(S={backgroundColor:o.color},t[9]=o.color,t[10]=S);let C;t[11]!==s||t[12]!==a?(C=()=>a(s),t[11]=s,t[12]=a,t[13]=C):C=t[13];let w;t[14]===o.icon?w=t[15]:(w=(0,Z.jsx)(Yi,{icon:o.icon,width:16,height:16,className:`text-white`}),t[14]=o.icon,t[15]=w);let T;t[16]!==x||t[17]!==y||t[18]!==h||t[19]!==w||t[20]!==S||t[21]!==C?(T=(0,Z.jsx)(`button`,{type:`button`,...y,"aria-label":x,className:h,style:S,onClick:C,children:w}),t[16]=x,t[17]=y,t[18]=h,t[19]=w,t[20]=S,t[21]=C,t[22]=T):T=t[22];let E=T,D;t[23]===E?D=t[24]:(D=(0,Z.jsx)(En,{asChild:!0,children:E}),t[23]=E,t[24]=D);let O;t[25]===l?O=t[26]:(O=(0,Z.jsx)(`span`,{className:`font-medium`,children:l}),t[25]=l,t[26]=O);let k;t[27]!==r||t[28]!==b?(k=r&&b?(0,Z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`editing [[`,b,`]]`]}):null,t[27]=r,t[28]=b,t[29]=k):k=t[29];let A;t[30]!==O||t[31]!==k?(A=(0,Z.jsxs)(er,{className:`flex flex-col gap-0.5`,children:[O,k]}),t[30]=O,t[31]=k,t[32]=A):A=t[32];let j;return t[33]!==D||t[34]!==A?(j=(0,Z.jsxs)(jn,{children:[D,A]}),t[33]=D,t[34]=A,t[35]=j):j=t[35],j}function SO(e){let t=(0,$.c)(18),{count:n,remainder:r,crossDoc:i,scopedAgentId:a,onClickAgent:o}=e,s=i?`true`:void 0,c=`${n} more ${i?`cross-doc `:``}${n===1?`participant`:`participants`}`,l;t[0]!==n||t[1]!==s||t[2]!==c?(l=(0,Z.jsx)(Wt,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`presence-overflow`,"data-presence-crossdoc":s,className:`inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full bg-muted font-medium text-muted-foreground text-xs ring-2 ring-background hover:bg-muted/80`,"aria-label":c,children:[`+`,n]})}),t[0]=n,t[1]=s,t[2]=c,t[3]=l):l=t[3];let u;if(t[4]!==i||t[5]!==o||t[6]!==r||t[7]!==a){let e;t[9]!==i||t[10]!==o||t[11]!==a?(e=e=>e.kind===`human`?(0,Z.jsx)(vO,{user:e.user,mode:e.mode,tabCount:e.tabCount},e.clientId):(0,Z.jsx)(xO,{participant:e,crossDoc:i,scoped:a===e.agentId,onClickAgent:o},e.agentId),t[9]=i,t[10]=o,t[11]=a,t[12]=e):e=t[12],u=r.map(e),t[4]=i,t[5]=o,t[6]=r,t[7]=a,t[8]=u}else u=t[8];let d;t[13]===u?d=t[14]:(d=(0,Z.jsx)(q,{align:`end`,className:`w-auto max-w-xs p-2`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:u})}),t[13]=u,t[14]=d);let f;return t[15]!==l||t[16]!==d?(f=(0,Z.jsxs)(H,{children:[l,d]}),t[15]=l,t[16]=d,t[17]=f):f=t[17],f}function CO(e,t,n,r){return e.kind===`human`?(0,Z.jsx)(vO,{user:e.user,mode:e.mode,tabCount:e.tabCount},e.clientId):(0,Z.jsx)(xO,{participant:e,crossDoc:n,scoped:r===e.agentId,onClickAgent:t},e.agentId)}function wO(){let e=(0,$.c)(20),{activeProvider:t,activeDocName:n,systemProvider:r,openActivityPanel:i,docPanelMode:a,docPanelAgentId:o}=ut(),{current:s,crossDoc:c}=lO(t,r,n);if(fO(Xw(t),n),s.length===0&&c.length===0)return null;let l;if(e[0]!==c||e[1]!==s||e[2]!==o||e[3]!==a||e[4]!==i){let t=s.slice(0,pO),n;e[6]===s?n=e[7]:(n=s.slice(pO),e[6]=s,e[7]=n);let r=n,u=c.slice(0,mO),d;e[8]===c?d=e[9]:(d=c.slice(mO),e[8]=c,e[9]=d);let f=d,p=i,m=a===`agent`?o:null,h;e[10]!==p||e[11]!==m?(h=e=>CO(e,p,!1,m),e[10]=p,e[11]=m,e[12]=h):h=e[12];let g=t.map(h),_;e[13]!==r||e[14]!==p||e[15]!==m?(_=r.length>0?(0,Z.jsx)(SO,{count:r.length,remainder:r,crossDoc:!1,scopedAgentId:m,onClickAgent:p}):null,e[13]=r,e[14]=p,e[15]=m,e[16]=_):_=e[16];let v;e[17]!==g||e[18]!==_?(v=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,"data-presence-section":`current`,children:[g,_]}),e[17]=g,e[18]=_,e[19]=v):v=e[19],l=(0,Z.jsxs)(`div`,{"data-slot":`presence-bar`,className:`flex items-center px-1 py-1.5`,children:[v,c.length>0?(0,Z.jsxs)(`div`,{className:`ml-1.5 flex items-center gap-1.5`,"data-presence-section":`crossdoc`,children:[u.map(e=>CO(e,p,!0,m)),f.length>0?(0,Z.jsx)(SO,{count:f.length,remainder:f,crossDoc:!0,scopedAgentId:m,onClickAgent:p}):null]}):null]}),e[0]=c,e[1]=s,e[2]=o,e[3]=a,e[4]=i,e[5]=l}else l=e[5];return l}var TO=`.md`,EO=/\.(md|mdx)$/i;function DO(e,t=TO){return`${e}${t}`}function OO(e){return KO(e).replace(EO,``)}function kO(e){return ur(e)?MO(e.path):An(e)?e.path:DO(e.docName,e.docExt)}function AO(e){let t=KO(e).match(EO);return t?`.${t[1].toLowerCase()}`:void 0}function jO(e){return KO(e)}function MO(e){let t=KO(e.trim());return t?`${t}/`:``}function NO(e){return e.endsWith(`/`)?jO(e):OO(e)}function PO(e){return e.map(kO)}function FO(e){return[...e].sort().join(`\0`)}function IO(e){return FO(PO(e))}function LO(e){let t=new Set;for(let n of e){if(ur(n)){let e=MO(n.path);e&&t.add(e)}let e=(ur(n)||An(n)?n.path:n.docName).split(`/`).filter(Boolean),r=ur(n)?e.length:e.length-1;for(let n=1;n<=r;n++)t.add(`${e.slice(0,n).join(`/`)}/`)}return[...t].sort()}function RO(e){if(!e)return[];let t=KO(e.replace(EO,``)).split(`/`).filter(Boolean),n=[],r=e.endsWith(`/`)?t.length:t.length-1;for(let e=1;e<=r;e++)n.push(`${t.slice(0,e).join(`/`)}/`);return n}function zO(e){let t=e.kind===`directory`,n=t?jO(e.path):OO(e.path),r=t?void 0:AO(e.path);return{kind:t?`folder`:`file`,name:KO(GO(e.path)).replace(EO,``),path:n,treePath:VO(e.path,t),docExt:r}}function BO(e){return e.kind===`directory`?jO(e.path):e.path}function VO(e,t){return t?MO(e):EO.test(e)?e:`${e}${TO}`}function HO(e,t,n){let r=MO(t),i=new Set(n);for(let t=0;t<100;t++){let n=t===0?``:` ${t+1}`;if(e===`file`){let e=`${r}Untitled${n}${TO}`;if(!i.has(e))return{addPath:e,renamePath:e};continue}let a=`${r}New Folder${n}/`;if(!i.has(a))return{addPath:a,renamePath:a}}throw Error(`Could not allocate a unique tree placeholder`)}function UO(e,t){return e===`file`?VO(t,!1):`${jO(t)}/index${TO}`}function WO(e,t){return t.kind===`root`||t.directoryPath==null?GO(e):`${t.directoryPath}${GO(e)}`}function GO(e){let t=KO(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function KO(e){return e.endsWith(`/`)?e.slice(0,-1):e}function qO(e,t){return t.trim()}function JO(e){return![``,`.`,`..`].includes(e)&&!e.includes(`/`)&&!e.includes(`\\`)&&!e.includes(`\0`)}function YO(e,t){let n=qO(e.kind,t),r=e.path.split(`/`);return r[r.length-1]=n,r.join(`/`)}function XO(e,t,n=[]){if(t.length===0&&n.length===0)return e;let r=new Map(t.map(e=>[e.fromDocName,e.toDocName]));return e.map(e=>mi(e)?{...e,docName:r.get(e.docName)??e.docName}:ur(e)||An(e)?{...e,path:nk(e.path,n)}:e)}function ZO(e,t,n){if(t.length===0&&!n)return e;let r=new Set(t);return e.filter(e=>mi(e)?!r.has(e.docName)&&!ok(e.docName,n):ur(e)||An(e)?!ok(e.path,n):!0)}function QO(e,t,n,r=new Date().toISOString()){let i=!1,a=[...e],o=e=>{a.some(t=>rk(t,e))||(a.push(e),i=!0)};if(n.kind===`file`){let s=e.find(e=>mi(e)&&e.docName===t.path);return o({kind:`document`,docName:n.path,docExt:s?.docExt??t.docExt,size:s?.size??0,modified:r}),i?a:e}let s=e.find(e=>ur(e)&&e.path===t.path);o({kind:`folder`,path:n.path,size:s?.size??0,modified:r});let c=new Set(n.duplicatedDocNames);for(let i of e){if(mi(i)){let e=ak(i.docName,t.path,n.path);e&&c.has(e)&&o({...i,docName:e,modified:r});continue}if(ur(i)){let e=ik(i.path,t.path,n.path);e&&o({...i,path:e,modified:r})}}return i?a:e}function $O(e,t){return e?t.find(t=>t.fromDocName===e)?.toDocName??e:null}function ek(e,t){return e.flatMap(e=>t===e.toDocName?[e.fromDocName]:[e.fromDocName,e.toDocName])}function tk(e,t){let n=e.kind===`folder`||e.docExt===void 0?e.path:DO(e.path,e.docExt);return Fh(t.contentDir,n,t.pathSeparator)}function nk(e,t){for(let{fromPath:n,toPath:r}of t){if(e===n)return r;if(e.startsWith(`${n}/`))return`${r}${e.slice(n.length)}`}return e}function rk(e,t){return mi(e)&&mi(t)?e.docName===t.docName:ur(e)&&ur(t)||An(e)&&An(t)?e.path===t.path:!1}function ik(e,t,n){return e===t?n:ak(e,t,n)}function ak(e,t,n){return e.startsWith(`${t}/`)?`${n}${e.slice(t.length)}`:null}function ok(e,t){return!!t&&(e===t||e.startsWith(`${t}/`))}function sk(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(du,{"data-slot":`context-menu`,...n}),t[2]=n,t[3]=r),r}function ck(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`select-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(fu,{"data-slot":`context-menu-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function lk(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(yu,{"data-slot":`context-menu-sub`,...n}),t[2]=n,t[3]=r),r}function uk(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(pu,{children:(0,Z.jsx)(mu,{"data-slot":`context-menu-content`,className:i,...r})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function dk(e){let t=(0,$.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===n?s=t[6]:(s=Di(`group/context-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive`,n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==o?(c=(0,Z.jsx)(hu,{"data-slot":`context-menu-item`,"data-inset":r,"data-variant":o,className:s,...i}),t[7]=r,t[8]=i,t[9]=s,t[10]=o,t[11]=c):c=t[11],c}function fk(e){let t=(0,$.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,inset:i,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=Di(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(Uo,{className:`ml-auto`}),t[7]=s):s=t[7];let c;return t[8]!==n||t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,Z.jsxs)(bu,{"data-slot":`context-menu-sub-trigger`,"data-inset":i,className:o,...a,children:[n,s]}),t[8]=n,t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c}function pk(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`z-50 min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(xu,{"data-slot":`context-menu-sub-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function mk(e){let t=(0,$.c)(15),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:i,children:r,checked:n,inset:a,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===i?s=t[7]:(s=Di(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,i),t[6]=i,t[7]=s);let c;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(`span`,{className:`pointer-events-none absolute right-2`,children:(0,Z.jsx)(_u,{children:(0,Z.jsx)(Eo,{})})}),t[8]=c):c=t[8];let l;return t[9]!==n||t[10]!==r||t[11]!==a||t[12]!==o||t[13]!==s?(l=(0,Z.jsxs)(gu,{"data-slot":`context-menu-checkbox-item`,"data-inset":a,className:s,checked:n,...o,children:[c,r]}),t[9]=n,t[10]=r,t[11]=a,t[12]=o,t[13]=s,t[14]=l):l=t[14],l}function hk(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Di(`-mx-1 my-1 h-px bg-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(vu,{"data-slot":`context-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var gk=[`.md`,`.mdx`],_k=`group relative -mb-px flex h-10 min-w-28 max-w-64 shrink-0 cursor-pointer items-center overflow-hidden border border-transparent font-medium transition-colors`,vk=`z-10 rounded-t-lg rounded-b-none border-border border-b-0 bg-background text-foreground`,yk=Di(vk,`bg-transparent hover:bg-muted focus-visible:bg-muted border-transparent hover:border-border focus-visible:border-border`),bk=`flex h-full min-w-0 flex-1 cursor-pointer items-center overflow-hidden px-3 text-left text-[13px] outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,xk=`mr-1.5 flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm text-muted-foreground outline-none transition hover:bg-foreground/10 hover:text-foreground hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:opacity-100`;function Sk(e){return Di(xk,e?`opacity-100`:`pointer-events-none opacity-0 group-focus-within:pointer-events-auto group-focus-within:opacity-100 group-hover:pointer-events-auto group-hover:opacity-100`)}function Ck(e){return e.replace(/[^A-Za-z0-9_-]/g,`-`)}function wk(e){let t=kr(e);window.location.hash!==t&&(window.location.hash=t)}function Tk(e){Math.abs(e.deltaX)>=Math.abs(e.deltaY)||e.currentTarget.scrollWidth<=e.currentTarget.clientWidth||(e.preventDefault(),e.currentTarget.scrollLeft+=e.deltaY)}function Ek(e,t){let n=[t,...gk].filter((e,t,n)=>e&&n.indexOf(e)===t),r=e.toLowerCase(),i=n.find(t=>e.length>t.length&&r.endsWith(t.toLowerCase()));return i?e.slice(0,-i.length):e}function Dk(e){let t=(0,$.c)(26),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({tabId:o,disabled:n,ref:r,style:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]!==n||t[7]!==o?(s={id:o,disabled:n},t[6]=n,t[7]=o,t[8]=s):s=t[8];let{attributes:c,listeners:l,setNodeRef:u,transform:d,transition:f,isDragging:p}=ga(s),m;t[9]===d?m=t[10]:(m=na.Transform.toString(d),t[9]=d,t[10]=m);let h=p?.5:i?.opacity,g=p?1:i?.zIndex,_;t[11]!==i||t[12]!==m||t[13]!==h||t[14]!==g||t[15]!==f?(_={...i,transform:m,transition:f,opacity:h,zIndex:g},t[11]=i,t[12]=m,t[13]=h,t[14]=g,t[15]=f,t[16]=_):_=t[16];let v=_,y;t[17]!==r||t[18]!==u?(y=function(e){u(e),typeof r==`function`?r(e):r&&`current`in r&&(r.current=e)},t[17]=r,t[18]=u,t[19]=y):y=t[19];let b=y,x;return t[20]!==c||t[21]!==b||t[22]!==l||t[23]!==a||t[24]!==v?(x=(0,Z.jsx)(`div`,{ref:b,style:v,...a,...c,...l}),t[20]=c,t[21]=b,t[22]=l,t[23]=a,t[24]=v,t[25]=x):x=t[25],x}function Ok(e){let t=(0,$.c)(48),{children:n,closeTab:r,closeTabs:i,canPin:a,disabled:o,openTabs:s,pinTab:c,pinnedTabIds:l,tabId:u,unpinTab:d}=e,f=a===void 0?!0:a;if(o!==void 0&&o)return n;let p;t[0]!==f||t[1]!==l||t[2]!==u?(p=f&&l.includes(u),t[0]=f,t[1]=l,t[2]=u,t[3]=p):p=t[3];let m=p,h;if(t[4]!==s||t[5]!==l||t[6]!==u){let e;t[8]===u?e=t[9]:(e=e=>e!==u,t[8]=u,t[9]=e),h=Tt(s.filter(e),l),t[4]=s,t[5]=l,t[6]=u,t[7]=h}else h=t[7];let g=h,_;t[10]!==s||t[11]!==l?(_=Tt(s,l),t[10]=s,t[11]=l,t[12]=_):_=t[12];let v=_,y=l.length?`Close all unpinned`:`Close all`,b;t[13]===n?b=t[14]:(b=(0,Z.jsx)(ck,{asChild:!0,children:n}),t[13]=n,t[14]=b);let x;t[15]!==r||t[16]!==u?(x=()=>r(u),t[15]=r,t[16]=u,t[17]=x):x=t[17];let S;t[18]!==m||t[19]!==x?(S=(0,Z.jsx)(dk,{disabled:m,onSelect:x,children:`Close`}),t[18]=m,t[19]=x,t[20]=S):S=t[20];let C=g.length===0,w;t[21]!==i||t[22]!==g?(w=()=>{i(g)},t[21]=i,t[22]=g,t[23]=w):w=t[23];let T;t[24]!==w||t[25]!==C?(T=(0,Z.jsx)(dk,{disabled:C,onSelect:w,children:`Close others`}),t[24]=w,t[25]=C,t[26]=T):T=t[26];let E=v.length===0,D;t[27]!==v||t[28]!==i?(D=()=>{i(v)},t[27]=v,t[28]=i,t[29]=D):D=t[29];let O;t[30]!==y||t[31]!==E||t[32]!==D?(O=(0,Z.jsx)(dk,{disabled:E,onSelect:D,children:y}),t[30]=y,t[31]=E,t[32]=D,t[33]=O):O=t[33];let k;t[34]!==f||t[35]!==m||t[36]!==c||t[37]!==u||t[38]!==d?(k=f&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(hk,{}),(0,Z.jsx)(dk,{onSelect:()=>m?d(u):c(u),children:m?`Unpin tab`:`Pin tab`})]}),t[34]=f,t[35]=m,t[36]=c,t[37]=u,t[38]=d,t[39]=k):k=t[39];let A;t[40]!==T||t[41]!==O||t[42]!==k||t[43]!==S?(A=(0,Z.jsxs)(uk,{className:`min-w-40`,children:[S,T,O,k]}),t[40]=T,t[41]=O,t[42]=k,t[43]=S,t[44]=A):A=t[44];let j;return t[45]!==A||t[46]!==b?(j=(0,Z.jsxs)(sk,{children:[b,A]}),t[45]=A,t[46]=b,t[47]=j):j=t[47],j}function kk(e){let t=(0,$.c)(14),{accessibleLabel:n,closeTab:r,isPinned:i,tabId:a,unpinTab:o}=e;if(i){let e=`Unpin ${n}`,r;t[0]!==a||t[1]!==o?(r=e=>{e.stopPropagation(),o(a)},t[0]=a,t[1]=o,t[2]=r):r=t[2];let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(Bc,{"aria-hidden":`true`}),t[3]=i):i=t[3];let s;return t[4]!==e||t[5]!==r?(s=(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-xs`,type:`button`,"aria-label":e,className:`mr-1.5 text-primary! hover:bg-primary/10!`,onClick:r,children:i}),t[4]=e,t[5]=r,t[6]=s):s=t[6],s}let s=`Close ${n}`,c;t[7]!==r||t[8]!==a?(c=e=>{e.stopPropagation(),r(a)},t[7]=r,t[8]=a,t[9]=c):c=t[9];let l;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(Do,{"aria-hidden":`true`}),t[10]=l):l=t[10];let u;return t[11]!==s||t[12]!==c?(u=(0,Z.jsx)(Y,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":s,className:`mr-1.5`,onClick:c,children:l}),t[11]=s,t[12]=c,t[13]=u):u=t[13],u}function Ak(){let e=(0,$.c)(63),{activeDocName:t,activeTabId:n,activeNewTabId:r,activeTarget:i,activateTab:a,activateNewTab:o,closeAndClearForRename:s,closeNewTab:c,closeTab:l,closeTabs:u,getPoolActiveDocName:d,isNewTabActive:f,newTabIds:p,openNewTab:m,openTabs:h,pinTab:g,pinnedTabIds:_,remapTabsForRename:v,reorderTabs:y,unpinTab:b,visibleTabIds:x}=ut(),{pageMeta:S}=Nr(),C=(0,Q.useRef)(null),[w,E]=(0,Q.useState)(null),[D,O]=(0,Q.useState)(``),[k,A]=(0,Q.useState)(null),[j,M]=(0,Q.useState)(!1),P=(0,Q.useRef)(null),F=(0,Q.useRef)(!1),I=(0,Q.useRef)(!1),L=(0,Q.useRef)(null),R=(0,Q.useRef)(t),z;e[0]!==n||e[1]!==t||e[2]!==i?(z=n??(i?We(i):t?mt(t):null),e[0]=n,e[1]=t,e[2]=i,e[3]=z):z=e[3];let B=z,V;e[4]!==r||e[5]!==B||e[6]!==f||e[7]!==p||e[8]!==h?(V=f?`${r??`__new-tab__`}\u0000${h.join(`\0`)}\u0000${p.join(`\0`)}`:B?`${B}\u0000${h.join(`\0`)}`:``,e[4]=r,e[5]=B,e[6]=f,e[7]=p,e[8]=h,e[9]=V):V=e[9];let H=V,U,W;e[10]===t?(U=e[11],W=e[12]):(U=()=>{R.current=t},W=[t],e[10]=t,e[11]=U,e[12]=W),(0,Q.useEffect)(U,W);let G,ee;e[13]===H?(G=e[14],ee=e[15]):(G=()=>{H&&(C.current?.querySelector(`[data-active-tab="true"]`))?.scrollIntoView({block:`nearest`,inline:`nearest`})},ee=[H],e[13]=H,e[14]=G,e[15]=ee),(0,Q.useEffect)(G,ee);let te,ne;e[16]===w?(te=e[17],ne=e[18]):(te=()=>{w&&(P.current?.focus(),P.current?.select())},ne=[w],e[16]=w,e[17]=te,e[18]=ne),(0,Q.useEffect)(te,ne);let ie,ae;e[19]!==h||e[20]!==w?(ie=()=>{!w||h.includes(w.tabId)||(I.current=!0,L.current=null,E(null),O(``),A(null),M(!1))},ae=[h,w],e[19]=h,e[20]=w,e[21]=ie,e[22]=ae):(ie=e[21],ae=e[22]),(0,Q.useEffect)(ie,ae);let oe=function(e,t){let n=t.split(`/`);I.current=!1,L.current=null,E({docName:t,tabId:e}),O(n[n.length-1]),A(null)},se=function(){I.current=!0,L.current=null,E(null),O(``),A(null),M(!1)},K=async function(){if(I.current){I.current=!1;return}if(F.current)return;let e=w?.docName;if(!e){se();return}let t=qO(`file`,Ek(D,S.get(e)?.docExt??`.md`)),n=e.split(`/`),r=n[n.length-1];if(t===r){se();return}if(t===L.current){P.current?.focus();return}if(!JO(t)){A(`Name can’t be empty, ".", "..", or contain / or \\`),P.current?.focus();return}let i=YO({kind:`file`,path:e,name:r},t);F.current=!0,M(!0),A(null);try{let n=await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:`file`,fromPath:e,toPath:i})});if(I.current){M(!1),F.current=!1;return}let r=await T(n,`Server error (HTTP ${n.status})`);if(!r.ok){A(r.title),M(!1),F.current=!1,L.current=t,P.current?.focus();return}let a=N(mr,r.body,`rename-path:tab`,{renamed:[]}).renamed,o=R.current,c=$O(o,a);_t(a);let l=!0;try{let e=ek(a,d());await Promise.all(e.map(e=>s(e))),v(a),Wr([`files`,`backlinks`,`graph`])}catch(n){let r=n;l=!1,console.warn(`[EditorTabs] post-rename reconciliation failed`,{err:r,docName:e,newDocName:i,normalized:t}),X.error(`Rename succeeded but the tabstrip may be out of date — refresh to resync`)}I.current=!0,E(null),O(``),A(null),M(!1),F.current=!1,L.current=null,l&&c&&c!==o&&wk(c)}catch(n){console.warn(`[EditorTabs] rename failed`,{err:n,docName:e,newDocName:i,normalized:t}),A(`Network error — please try again`),M(!1),F.current=!1,L.current=t,P.current?.focus()}},ce=typeof window<`u`&&window.okDesktop!=null,le;e[23]===p?le=e[24]:(le=new Set(p),e[23]=p,e[24]=le);let ue=le,q;e[25]!==c||e[26]!==u||e[27]!==ue?(q=function(e){let t=[],n=[];for(let r of e)ue.has(r)?n.push(r):t.push(r);t.length>0&&u(t);for(let e of n)c(e)},e[25]=c,e[26]=u,e[27]=ue,e[28]=q):q=e[28];let de=q,fe;e[29]===Symbol.for(`react.memo_cache_sentinel`)?(fe={activationConstraint:{distance:8}},e[29]=fe):fe=e[29];let pe;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(pe={coordinateGetter:Ya},e[30]=pe):pe=e[30];let me=Co(Ca(fa,fe),Ca(la,pe)),he;e[31]!==y||e[32]!==x?(he=function(e){let t=String(e.active.id),n=e.over?String(e.over.id):null;if(!n||t===n)return;let r=x.indexOf(t),i=x.indexOf(n);r<0||i<0||r===i||y(Za([...x],r,i),t)},e[31]=y,e[32]=x,e[33]=he):he=e[33];let ge=he,_e=ce?``:void 0,ve;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(ve=Di(`pl-2 flex h-12 min-w-0 touch-manipulation flex-1 items-end gap-1 overflow-x-auto overflow-y-hidden overscroll-x-contain scroll-fade-mask-x [scrollbar-width:none]`,ce&&`[-webkit-app-region:drag]`),e[34]=ve):ve=e[34];let ye=Tk,be=xa,xe=ha,Se;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(Se={container:typeof document<`u`?document.body:void 0},e[35]=Se):Se=e[35];let Ce=ya,we;e[36]===x?we=e[37]:(we=[...x],e[36]=x,e[37]=we);let Te=ea,Ee=x.map(e=>{if(ue.has(e)){let t=e===r;return(0,Z.jsx)(Ok,{tabId:e,canPin:!1,openTabs:x,closeTab:c,closeTabs:de,pinTab:g,pinnedTabIds:_,unpinTab:b,children:(0,Z.jsxs)(Dk,{tabId:e,"aria-current":t?`page`:void 0,"data-active-tab":t?`true`:void 0,className:Di(_k,t?vk:yk,ce&&`[-webkit-app-region:no-drag]`),onAuxClick:t=>{t.button===1&&(t.preventDefault(),c(e))},onClick:t=>{t.target===t.currentTarget&&o(e)},children:[(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Activate new tab`,className:bk,onClick:()=>o(e),children:(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:`New tab`})}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Close new tab`,className:Sk(t),onClick:t=>{t.stopPropagation(),c(e)},children:(0,Z.jsx)(Do,{"aria-hidden":`true`,className:`size-3.5`})})]})},e)}let t=ot(e),n=e===B,i=_.includes(e);if(t.kind===`folder`){let{baseName:r,label:o,prefix:s}=Je(t.folderPath,`/`),c=`${s}${o}`;return(0,Z.jsx)(Ok,{tabId:e,openTabs:x,closeTab:l,closeTabs:de,pinTab:g,pinnedTabIds:_,unpinTab:b,children:(0,Z.jsxs)(Dk,{tabId:e,"aria-current":n?`page`:void 0,"data-active-tab":n?`true`:void 0,className:Di(_k,n?vk:yk,ce&&`[-webkit-app-region:no-drag]`),onAuxClick:t=>{t.button===1&&(t.preventDefault(),!i&&l(e))},onClick:t=>{t.target===t.currentTarget&&a(e)},children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-label":c,className:bk,onClick:()=>{a(e)},children:[s&&(0,Z.jsx)(`span`,{className:Di(`min-w-0 flex-1 truncate`,n&&`text-muted-foreground`),children:s}),(0,Z.jsxs)(`span`,{className:Di(`flex min-w-0 items-center`,s?`max-w-[70%] shrink-0`:`flex-1`),children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:r}),(0,Z.jsx)(`span`,{className:`shrink-0`,children:`/`})]})]}),(0,Z.jsx)(kk,{accessibleLabel:c,closeTab:l,isPinned:i,tabId:e,unpinTab:b})]})},e)}if(t.kind===`asset`){let{baseName:r,label:o,prefix:s}=Je(t.assetPath,``),c=`${s}${o}`;return(0,Z.jsx)(Ok,{tabId:e,openTabs:x,closeTab:l,closeTabs:de,pinTab:g,pinnedTabIds:_,unpinTab:b,children:(0,Z.jsxs)(Dk,{tabId:e,"aria-current":n?`page`:void 0,"data-active-tab":n?`true`:void 0,className:Di(_k,n?vk:yk,ce&&`[-webkit-app-region:no-drag]`),onAuxClick:t=>{t.button===1&&(t.preventDefault(),!i&&l(e))},onClick:t=>{t.target===t.currentTarget&&a(e)},children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-label":c,className:bk,onClick:()=>{a(e)},children:[s?(0,Z.jsx)(`span`,{className:Di(`min-w-0 flex-1 truncate text-muted-foreground/60`,n&&`text-muted-foreground`),children:s}):null,(0,Z.jsx)(`span`,{className:Di(`min-w-0 truncate`,s?`max-w-[70%] shrink-0`:`flex-1`),children:r})]}),(0,Z.jsx)(kk,{accessibleLabel:c,closeTab:l,isPinned:i,tabId:e,unpinTab:b})]})},e)}let s=t.docName,u=S.get(s)?.docExt??`.md`,{baseName:d,extension:f,label:p,prefix:m}=Je(s,u),h=`${m}${p}`,v=u===`.md`||u===`.mdx`,y=w?.tabId===e,C=`editor-tab-rename-error-${Ck(s)}`;return(0,Z.jsx)(Ok,{disabled:y,tabId:e,openTabs:x,closeTab:l,closeTabs:de,pinTab:g,pinnedTabIds:_,unpinTab:b,children:(0,Z.jsx)(Dk,{tabId:e,disabled:y,"aria-current":n?`page`:void 0,"data-active-tab":n?`true`:void 0,className:Di(_k,n?vk:yk,y&&k&&`border-destructive`,ce&&`[-webkit-app-region:no-drag]`),onAuxClick:t=>{t.button===1&&(t.preventDefault(),!i&&l(e))},onClick:t=>{t.target===t.currentTarget&&a(e)},children:y?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(lw,{className:`h-full min-w-0 flex-1 rounded-none border-0 bg-transparent dark:bg-transparent`,children:[(0,Z.jsx)(mw,{ref:P,value:D,disabled:j,"aria-label":`Rename ${p}`,"aria-invalid":k?!0:void 0,"aria-describedby":k?C:void 0,"aria-busy":j||void 0,title:k??s,className:`h-full min-w-0 px-2 py-0 font-medium text-foreground text-xs selection:bg-primary selection:text-primary-foreground`,onChange:e=>{O(Ek(e.target.value,u)),A(null),L.current=null},onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),K()):e.key===`Escape`&&(e.preventDefault(),se())},onBlur:K}),(0,Z.jsx)(dw,{align:`inline-end`,"aria-hidden":`true`,className:`pr-2 text-xs`,children:(0,Z.jsx)(pw,{className:`text-muted-foreground/60 text-xs`,children:u})})]}),k?(0,Z.jsx)(`span`,{id:C,role:`alert`,className:`sr-only`,children:k}):null]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`button`,{type:`button`,"aria-label":h,title:h,className:bk,onClick:()=>{a(e)},onDoubleClick:t=>{t.preventDefault(),t.stopPropagation(),oe(e,s)},children:(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center`,children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:d}),!v&&(0,Z.jsx)(`span`,{className:`shrink-0`,children:f})]})}),(0,Z.jsx)(kk,{accessibleLabel:h,closeTab:l,isPinned:i,tabId:e,unpinTab:b})]})})},e)}),De;e[38]!==Ce||e[39]!==we||e[40]!==Te||e[41]!==Ee?(De=(0,Z.jsx)(Ce,{items:we,strategy:Te,children:Ee}),e[38]=Ce,e[39]=we,e[40]=Te,e[41]=Ee,e[42]=De):De=e[42];let Oe;e[43]!==be||e[44]!==ge||e[45]!==me||e[46]!==xe||e[47]!==Se||e[48]!==De?(Oe=(0,Z.jsx)(be,{sensors:me,collisionDetection:xe,onDragEnd:ge,accessibility:Se,children:De}),e[43]=be,e[44]=ge,e[45]=me,e[46]=xe,e[47]=Se,e[48]=De,e[49]=Oe):Oe=e[49];let ke;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(ke=Di(`first:mb-3 mb-1.5`,ce&&`[-webkit-app-region:no-drag]`),e[50]=ke):ke=e[50];let Ae;e[51]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,Z.jsx)(re,{"aria-hidden":`true`}),e[51]=Ae):Ae=e[51];let je;e[52]===m?je=e[53]:(je=(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(Y,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":`New tab`,className:ke,onClick:m,children:Ae})}),e[52]=m,e[53]=je);let Me;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(Me=(0,Z.jsx)(er,{children:`New tab`}),e[54]=Me):Me=e[54];let Ne;e[55]===je?Ne=e[56]:(Ne=(0,Z.jsxs)(jn,{children:[je,Me]}),e[55]=je,e[56]=Ne);let Pe;return e[57]!==_e||e[58]!==ve||e[59]!==ye||e[60]!==Oe||e[61]!==Ne?(Pe=(0,Z.jsxs)(`div`,{ref:C,"data-electron-drag":_e,className:ve,onWheel:ye,children:[Oe,Ne]}),e[57]=_e,e[58]=ve,e[59]=ye,e[60]=Oe,e[61]=Ne,e[62]=Pe):Pe=e[62],Pe}function jk(e){let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Discord`}),r=(0,Z.jsx)(`path`,{d:`M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9554 2.4189-2.1568 2.4189Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(`svg`,{role:`img`,fill:`currentColor`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function Mk(e){let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`X (Twitter)`}),r=(0,Z.jsx)(`path`,{d:`M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(`svg`,{role:`img`,fill:`currentColor`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}var Nk=[{label:`Documentation`,href:`https://openknowledge.ai/docs`,icon:dt},{label:`GitHub`,href:`https://github.com/inkeep/open-knowledge`,icon:Md},{label:`Website`,href:`https://openknowledge.ai/`,icon:Rr},{label:`Discord`,href:`https://go.inkeep.com/ok-discord`,icon:jk},{label:`Twitter`,href:`https://x.com/inkeep`,icon:Mk}],Pk=()=>{let e=(0,$.c)(5),[t,n]=(0,Q.useState)(!1),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsxs)(jn,{children:[(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(Wt,{asChild:!0,children:(0,Z.jsxs)(Y,{variant:`ghost`,size:`icon`,className:`size-7 hover:bg-accent text-muted-foreground`,children:[(0,Z.jsx)(Ne,{className:`size-4`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Resources`})]})})}),(0,Z.jsx)(er,{children:`Resources`})]}),e[0]=r):r=e[0];let i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`p`,{className:`font-mono tracking-wide uppercase text-muted-foreground text-xs mb-1`,children:`Resources`}),e[1]=i):i=e[1];let a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsxs)(q,{align:`end`,className:`w-64 p-3`,children:[i,(0,Z.jsx)(`nav`,{"aria-label":`Resources`,children:(0,Z.jsx)(`ul`,{className:`space-y-0.5`,children:Nk.map(Fk)})})]}),e[2]=a):a=e[2];let o;return e[3]===t?o=e[4]:(o=(0,Z.jsxs)(H,{open:t,onOpenChange:n,children:[r,a]}),e[3]=t,e[4]=o),o};function Fk(e){let{label:t,href:n,icon:r}=e;return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>ba(e,n),onAuxClick:e=>ba(e,n),className:`flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-azure-900/5 dark:hover:bg-white/20 hover:text-primary`,children:[(0,Z.jsx)(r,{"aria-hidden":`true`,className:`size-4 shrink-0`}),t]})},n)}function Ik(e){let t=(0,$.c)(60),{input:n}=e,{states:r,refresh:i}=sg(),{dispatch:a}=Xh(),[o,s]=(0,Q.useState)(!1),c=typeof window<`u`&&window.okDesktop!=null,l;t[0]===i?l=t[1]:(l=e=>{s(e),e&&i()},t[0]=i,t[1]=l);let u=l,d=n===null,f;t[2]===n?f=t[3]:(f=n!==null&&n.docContext!==null?jr(n.docContext.relativePath):``,t[2]=n,t[3]=f);let p=f,m;t[4]!==a||t[5]!==n?(m=e=>{n!==null&&a(e.id,n)},t[4]=a,t[5]=n,t[6]=m):m=t[6];let h=m,g,_,v,y,b,x,S,C,w,T,E,D;if(t[7]!==u||t[8]!==h||t[9]!==n||t[10]!==o||t[11]!==p||t[12]!==r||t[13]!==d){let e;t[26]===r?e=t[27]:(e=e=>r[e.id]?.installed===!0,t[26]=r,t[27]=e);let i=eh.filter(e);v=r[`claude-code`]?.installed===!0;let a;t[28]!==n||t[29]!==p?(a=()=>{n!==null&&ES(p)},t[28]=n,t[29]=p,t[30]=a):a=t[30],y=a,_=ka,D=o,b=u;let s;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(Ji,{className:`size-4`}),t[31]=s):s=t[31];let l;t[32]===d?l=t[33]:(l=(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(ja,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open with AI`,disabled:d,className:`text-muted-foreground`,"data-testid":`open-in-agent-trigger`,children:s})})}),t[32]=d,t[33]=l);let f;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(er,{children:`Open with AI`}),t[34]=f):f=t[34],t[35]===l?x=t[36]:(x=(0,Z.jsxs)(jn,{children:[l,f]}),t[35]=l,t[36]=x),g=Oa,S=`end`,C=`min-w-[220px]`,w=`open-in-agent-menu`,t[37]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsx)(ua,{className:`font-mono font-normal tracking-wide uppercase text-muted-foreground text-xs`,children:`Open with AI`}),t[37]=T):T=t[37];let m;t[38]!==h||t[39]!==p||t[40]!==r?(m=e=>{let t=r[e.id];return(0,Z.jsx)(DS,{target:e,installState:t,isElectronHost:c,prompt:p,onSelect:()=>h(e)},e.id)},t[38]=h,t[39]=p,t[40]=r,t[41]=m):m=t[41],E=i.map(m),t[7]=u,t[8]=h,t[9]=n,t[10]=o,t[11]=p,t[12]=r,t[13]=d,t[14]=g,t[15]=_,t[16]=v,t[17]=y,t[18]=b,t[19]=x,t[20]=S,t[21]=C,t[22]=w,t[23]=T,t[24]=E,t[25]=D}else g=t[14],_=t[15],v=t[16],y=t[17],b=t[18],x=t[19],S=t[20],C=t[21],w=t[22],T=t[23],E=t[24],D=t[25];let O;t[42]!==v||t[43]!==y||t[44]!==n?(O=v?null:(0,Z.jsxs)(Aa,{onSelect:y,disabled:n===null,"data-testid":`open-in-agent-claude-web-fallback`,"aria-label":`Open in claude.ai, opens in browser with prompt pre-filled`,children:[(0,Z.jsx)(yt,{className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:`Open in claude.ai →`}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:`opens in browser`})]}),t[42]=v,t[43]=y,t[44]=n,t[45]=O):O=t[45];let k;t[46]!==g||t[47]!==O||t[48]!==S||t[49]!==C||t[50]!==w||t[51]!==T||t[52]!==E?(k=(0,Z.jsxs)(g,{align:S,className:C,"data-testid":w,children:[T,E,O]}),t[46]=g,t[47]=O,t[48]=S,t[49]=C,t[50]=w,t[51]=T,t[52]=E,t[53]=k):k=t[53];let A;return t[54]!==_||t[55]!==b||t[56]!==x||t[57]!==k||t[58]!==D?(A=(0,Z.jsxs)(_,{open:D,onOpenChange:b,children:[x,k]}),t[54]=_,t[55]=b,t[56]=x,t[57]=k,t[58]=D,t[59]=A):A=t[59],A}var Lk=`/api/share/publish/owners`,Rk=`/api/share/publish/name-check`,zk=`/api/share/publish`,Bk=/[A-Za-z0-9._-]/g;function Vk(e){return(e.match(Bk)?.join(``)??``).replace(/[-.]{2,}/g,e=>e[0]??`-`).replace(/^[-.]+/,``).replace(/[-.]+$/,``)}function Hk(e){if(!e)return``;let t=e.replace(/[/\\]+$/g,``),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n<0?t:t.slice(n+1)}function Uk(e){return`https://github.com/orgs/${encodeURIComponent(e)}/policies/applications`}function Wk(e,t,n){switch(e){case`name-conflict`:return{banner:`${t}/${n} already exists. Pick a different name.`,next:{kind:`edit-name`}};case`saml-sso`:return{banner:`GitHub denied the request. You may need to authorize Open Knowledge for ${t} in your browser.`,next:{kind:`authorize-org`,authorizeUrl:Uk(t)}};case`push-failed`:return{banner:`Created ${t}/${n}, push failed.`,next:{kind:`retry-push`}};case`auth-required`:return{banner:`GitHub sign-in expired. Sign in again to continue.`,next:{kind:`reauth`}};case`init-failed`:return{banner:`Couldn't prepare this project for publish.`,next:{kind:`edit-form`}};case`network`:return{banner:`Couldn't reach GitHub. Try again?`,next:{kind:`edit-form`}};case`no-project`:return{banner:`Open a project first.`,next:{kind:`edit-form`}}}}async function Gk(e=fetch){let t=await e(Lk,{method:`GET`});if(!t.ok)throw Error(`owners transport ${t.status}`);let n=await t.json(),r=br.safeParse(n);if(!r.success)throw Error(`owners response shape mismatch`);return r.data}async function Kk(e,t,n=fetch){let r=await n(`${Rk}?owner=${encodeURIComponent(e)}&name=${encodeURIComponent(t)}`,{method:`GET`});if(!r.ok)throw Error(`name-check transport ${r.status}`);let i=await r.json(),a=wr.safeParse(i);if(!a.success)throw Error(`name-check response shape mismatch`);return a.data}async function qk(e,t=fetch){let n=await t(zk,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!n.ok)throw Error(`publish transport ${n.status}`);let r=await n.json(),i=Er.safeParse(r);if(!i.success)throw Error(`publish response shape mismatch`);return i.data}function Jk(e,t,n){return e.ok?e.available?{kind:`available`}:{kind:`taken`,owner:t,name:n}:e.error===`auth-required`?{kind:`error`,banner:`GitHub sign-in expired. Sign in again to continue.`}:{kind:`error`,banner:`Couldn't reach GitHub. Try again?`}}function Yk(e){return e.submitting||e.owner===null||e.sanitizedName.length===0?!1:e.nameCheck.kind===`available`}async function Xk(e,t){await t.runShareAction({docName:e,hasRemote:!0,onClickWhenNoRemote:()=>{}},{clipboardWrite:t.clipboardWrite,toastSuccess:t.toastSuccess,toastError:t.toastError,logEvent:t.logEvent,fetchFn:t.fetchFn})}var Zk=`/api/share/construct-url`,Qk=`Could not construct share URL.`,$k=`Link ready but could not copy to clipboard.`;async function eA(e,t=fetch){let n=await t(Zk,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({docPath:e})});if(!n.ok)throw Error(`construct-url transport ${n.status}`);let r=await n.json(),i=qn.safeParse(r);if(!i.success)throw Error(`construct-url response shape mismatch`);return i.data}function tA(e,t){switch(e){case`detached-head`:return`Switch to a branch to share.`;case`branch-not-on-origin`:return t?`Push ${t} to GitHub before sharing.`:`Push this branch to GitHub before sharing.`;case`non-github-remote`:return`Sharing supports GitHub remotes only.`;case`invalid-path`:return`Can't share this path.`;case`no-remote`:return`This project has no GitHub remote.`}}async function nA(e,t){if(!e.hasRemote)return e.onClickWhenNoRemote(),{kind:`opened-wizard`};let n=ni(e.docName),r;try{r=await eA(n,t.fetchFn)}catch{return t.toastError(Qk),{kind:`transport-error`}}if(r.ok){try{await t.clipboardWrite(r.shareUrl)}catch{return t.toastError($k),t.logEvent(`[share] action=link-construct result=clipboard-failed`),{kind:`clipboard-failed`,shareUrl:r.shareUrl}}return t.toastSuccess(`Link copied.`),t.logEvent(`[share] action=link-construct`),{kind:`copied`,shareUrl:r.shareUrl,branch:r.branch}}if(r.error===`no-remote`)return e.onClickWhenNoRemote(),{kind:`opened-wizard`};let i=r.branch;return t.toastError(tA(r.error,i)),{kind:`business-error`,error:r.error,branch:i}}var rA=500;function iA(e){let t=(0,$.c)(94),{open:n,onOpenChange:r}=e,i=ch(),{activeDocName:a}=ut(),[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(!1),[u,d]=(0,Q.useState)(null),[f,p]=(0,Q.useState)(``),[m,h]=(0,Q.useState)(``),[g,_]=(0,Q.useState)(`private`),[v,y]=(0,Q.useState)(``),b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(b={kind:`idle`},t[0]=b):b=t[0];let[x,S]=(0,Q.useState)(b),[C,w]=(0,Q.useState)(!1),[T,E]=(0,Q.useState)(null),[D,O]=(0,Q.useState)(!1),k=(0,Q.useRef)(null),A=(0,Q.useRef)(null),M=(0,Q.useRef)(null),N;t[1]===m?N=t[2]:(N=Vk(m),t[1]=m,t[2]=N);let P=N,F=o?.find(e=>e.login===f)??null,I;t[3]===f?I=t[4]:(I=async function(){l(!0),d(null);try{let e=await Gk();if(!e.ok){e.error===`auth-required`?(O(!0),d(`Sign in to GitHub to continue.`)):d(`Couldn't reach GitHub. Try again?`),l(!1);return}s(e.owners),e.owners.length>0&&f===``&&p(e.owners[0]?.login??``)}catch{d(`Couldn't reach GitHub. Try again?`)}l(!1)},t[3]=f,t[4]=I);let L=I,R;t[5]!==L||t[6]!==n||t[7]!==o||t[8]!==f||t[9]!==i?.contentDir?(R=()=>{n&&(S({kind:`idle`}),E(null),w(!1),d(null),h(Vk(Hk(i?.contentDir??``))),_(`private`),y(``),o===null?L():f===``&&o.length>0&&p(o[0]?.login??``))},t[5]=L,t[6]=n,t[7]=o,t[8]=f,t[9]=i?.contentDir,t[10]=R):R=t[10];let z;t[11]===n?z=t[12]:(z=[n],t[11]=n,t[12]=z),(0,Q.useEffect)(R,z);let V,H;t[13]!==n||t[14]!==P||t[15]!==f?(V=()=>{if(n){if(k.current!==null&&clearTimeout(k.current),f===``||P===``){S({kind:`idle`});return}return S({kind:`pending`}),k.current=setTimeout(async()=>{let e=f,t=P;A.current=`${e}|${t}`,S({kind:`checking`});try{let n=await Kk(e,t);if(A.current!==`${e}|${t}`)return;S(Jk(n,e,t))}catch{if(A.current!==`${e}|${t}`)return;S({kind:`error`,banner:`Couldn't reach GitHub. Try again?`})}},rA),()=>{k.current!==null&&(clearTimeout(k.current),k.current=null)}}},H=[n,f,P],t[13]=n,t[14]=P,t[15]=f,t[16]=V,t[17]=H):(V=t[16],H=t[17]),(0,Q.useEffect)(V,H);let U;t[18]===L?U=t[19]:(U=function(){O(!1),d(null),L()},t[18]=L,t[19]=U);let W=U,G=async function(){if(Yk({owner:F,sanitizedName:P,nameCheck:x,submitting:C})){w(!0),E(null);try{let e=await qk({owner:f,name:P,visibility:g,description:v.trim().length>0?v.trim():void 0});if(e.ok){r(!1),a?await Xk(a,{runShareAction:nA,clipboardWrite:lA,toastSuccess:cA,toastError:sA,logEvent:oA}):X.success(`Published to ${e.ownerLogin}/${e.repoName}.`),w(!1);return}let t=Wk(e.error,f,P);E({message:t.banner,next:t.next}),t.next.kind===`edit-name`?(M.current?.focus(),M.current?.select()):t.next.kind===`reauth`&&O(!0)}catch{E({message:`Couldn't reach GitHub. Try again?`,next:{kind:`edit-form`}})}w(!1)}},te;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(te=function(e){let t=window.okDesktop?.shell?.openExternal;t?t(e):window.open(e,`_blank`,`noopener`)},t[20]=te):te=t[20];let ne=te,re;t[21]===r?re=t[22]:(re=function(){r(!1)},t[21]=r,t[22]=re);let ie=re,oe=!Yk({owner:F,sanitizedName:P,nameCheck:x,submitting:C}),se;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,Z.jsxs)(Bo,{children:[(0,Z.jsx)(Ao,{children:`Publish to GitHub`}),(0,Z.jsx)(Oo,{children:`Sharing a doc needs a GitHub repository. Create one for this project.`})]}),t[23]=se):se=t[23];let K;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Z.jsx)(es,{htmlFor:`publish-owner`,children:`Owner`}),t[24]=K):K=t[24];let ce;t[25]!==L||t[26]!==o||t[27]!==u||t[28]!==c||t[29]!==f?(ce=(0,Z.jsxs)(`fieldset`,{className:`flex flex-col gap-1.5`,children:[K,c&&o===null?(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,Z.jsx)(tt,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),` Loading...`]}):u?(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-sm text-destructive`,children:u}),(0,Z.jsx)(Y,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>L(),children:`Retry`})]}):(0,Z.jsxs)(ee,{value:f,onValueChange:p,children:[(0,Z.jsx)(j,{id:`publish-owner`,"data-testid":`publish-owner-trigger`,"aria-label":`Owner`,children:(0,Z.jsx)(B,{placeholder:`Pick an owner`})}),(0,Z.jsx)(ae,{children:(o??[]).map(aA)})]})]}),t[25]=L,t[26]=o,t[27]=u,t[28]=c,t[29]=f,t[30]=ce):ce=t[30];let le;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(le=(0,Z.jsx)(es,{htmlFor:`publish-name`,children:`Repository name`}),t[31]=le):le=t[31];let ue,q;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(ue=e=>h(e.target.value),q=()=>{A.current=null},t[32]=ue,t[33]=q):(ue=t[32],q=t[33]);let de;t[34]===m?de=t[35]:(de=(0,Z.jsx)(Wo,{id:`publish-name`,ref:M,"data-testid":`publish-name`,value:m,onChange:ue,onBlur:q,placeholder:`my-knowledge-base`,autoComplete:`off`,spellCheck:!1}),t[34]=m,t[35]=de);let fe;t[36]===P?fe=t[37]:(fe=P?(0,Z.jsxs)(Z.Fragment,{children:[`Will be created as `,(0,Z.jsx)(`code`,{className:`font-mono`,children:P})]}):`Pick a name`,t[36]=P,t[37]=fe);let pe;t[38]===fe?pe=t[39]:(pe=(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:fe}),t[38]=fe,t[39]=pe);let me;t[40]===x?me=t[41]:(me=(0,Z.jsx)(dA,{status:x}),t[40]=x,t[41]=me);let he;t[42]!==pe||t[43]!==me?(he=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs`,"aria-live":`polite`,children:[pe,me]}),t[42]=pe,t[43]=me,t[44]=he):he=t[44];let ge;t[45]!==de||t[46]!==he?(ge=(0,Z.jsxs)(`fieldset`,{className:`flex flex-col gap-1.5`,children:[le,de,he]}),t[45]=de,t[46]=he,t[47]=ge):ge=t[47];let _e;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,Z.jsx)(es,{children:`Visibility`}),t[48]=_e):_e=t[48];let ve;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(ve=e=>_(e===`public`?`public`:`private`),t[49]=ve):ve=t[49];let ye;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,Z.jsx)(Km,{value:`private`,id:`publish-visibility-private`,"data-testid":`publish-visibility-private`}),t[50]=ye):ye=t[50];let be;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,Z.jsxs)(es,{htmlFor:`publish-visibility-private`,className:`flex cursor-pointer items-center gap-2 rounded-md border border-input p-2 text-sm font-normal has-data-checked:border-primary`,children:[ye,(0,Z.jsxs)(`span`,{children:[`Private`,(0,Z.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:`Only collaborators`})]})]}),t[51]=be):be=t[51];let xe;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,Z.jsx)(Km,{value:`public`,id:`publish-visibility-public`,"data-testid":`publish-visibility-public`}),t[52]=xe):xe=t[52];let Se;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,Z.jsxs)(es,{htmlFor:`publish-visibility-public`,className:`flex cursor-pointer items-center gap-2 rounded-md border border-input p-2 text-sm font-normal has-data-checked:border-primary`,children:[xe,(0,Z.jsxs)(`span`,{children:[`Public`,(0,Z.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:`Anyone can see`})]})]}),t[53]=Se):Se=t[53];let Ce;t[54]===g?Ce=t[55]:(Ce=(0,Z.jsxs)(`fieldset`,{className:`flex flex-col gap-1.5`,children:[_e,(0,Z.jsxs)(Gm,{value:g,onValueChange:ve,className:`grid-cols-2`,"aria-label":`Visibility`,children:[be,Se]})]}),t[54]=g,t[55]=Ce);let we;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,Z.jsx)(es,{htmlFor:`publish-description`,children:`Description (optional)`}),t[56]=we):we=t[56];let Te;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(Te=e=>y(e.target.value),t[57]=Te):Te=t[57];let Ee;t[58]===v?Ee=t[59]:(Ee=(0,Z.jsxs)(`fieldset`,{className:`flex flex-col gap-1.5`,children:[we,(0,Z.jsx)(Ms,{id:`publish-description`,"data-testid":`publish-description`,rows:2,value:v,onChange:Te,placeholder:`What is this knowledge base for?`})]}),t[58]=v,t[59]=Ee);let De;t[60]!==T||t[61]!==ne||t[62]!==G?(De=T&&(0,Z.jsx)(uA,{banner:T,onAuthorize:ne,onRetryPush:G}),t[60]=T,t[61]=ne,t[62]=G,t[63]=De):De=t[63];let Oe;t[64]!==ce||t[65]!==ge||t[66]!==Ce||t[67]!==Ee||t[68]!==De?(Oe=(0,Z.jsxs)(Lo,{className:`flex flex-col gap-4`,children:[ce,ge,Ce,Ee,De]}),t[64]=ce,t[65]=ge,t[66]=Ce,t[67]=Ee,t[68]=De,t[69]=Oe):Oe=t[69];let ke;t[70]===ie?ke=t[71]:(ke=(0,Z.jsx)(Y,{type:`button`,variant:`ghost`,onClick:ie,children:`Cancel`}),t[70]=ie,t[71]=ke);let Ae;t[72]===C?Ae=t[73]:(Ae=C?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(tt,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),` Publishing...`]}):`Publish & copy link`,t[72]=C,t[73]=Ae);let je;t[74]!==G||t[75]!==oe||t[76]!==Ae?(je=(0,Z.jsx)(Y,{type:`button`,onClick:G,disabled:oe,"data-testid":`publish-submit`,children:Ae}),t[74]=G,t[75]=oe,t[76]=Ae,t[77]=je):je=t[77];let Me;t[78]!==ke||t[79]!==je?(Me=(0,Z.jsxs)(Ro,{children:[ke,je]}),t[78]=ke,t[79]=je,t[80]=Me):Me=t[80];let Ne;t[81]!==Oe||t[82]!==Me?(Ne=(0,Z.jsxs)(Po,{className:`sm:max-w-lg`,showCloseButton:!1,children:[se,Oe,Me]}),t[81]=Oe,t[82]=Me,t[83]=Ne):Ne=t[83];let Pe;t[84]!==r||t[85]!==n||t[86]!==Ne?(Pe=(0,Z.jsx)(Vo,{open:n,onOpenChange:r,children:Ne}),t[84]=r,t[85]=n,t[86]=Ne,t[87]=Pe):Pe=t[87];let Fe;t[88]!==D||t[89]!==W?(Fe=(0,Z.jsx)(rd,{open:D,onOpenChange:O,onSuccess:W}),t[88]=D,t[89]=W,t[90]=Fe):Fe=t[90];let J;return t[91]!==Pe||t[92]!==Fe?(J=(0,Z.jsxs)(Z.Fragment,{children:[Pe,Fe]}),t[91]=Pe,t[92]=Fe,t[93]=J):J=t[93],J}function aA(e){return(0,Z.jsx)(C,{value:e.login,"data-testid":`publish-owner-option-${e.login}`,children:(0,Z.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.avatarUrl?(0,Z.jsx)(`img`,{src:e.avatarUrl,alt:``,"aria-hidden":!0,className:`size-4 rounded-full`}):null,(0,Z.jsx)(`span`,{children:e.login}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.kind===`user`?`you`:`org`})]})},e.login)}function oA(e){return console.log(e)}function sA(e){return X.error(e)}function cA(e){return X.success(e)}function lA(e){return navigator.clipboard.writeText(e)}function uA(e){let t=(0,$.c)(13),{banner:n,onAuthorize:r,onRetryPush:i}=e,a=n.next,o;t[0]===n.message?o=t[1]:(o=(0,Z.jsx)(`span`,{children:n.message}),t[0]=n.message,t[1]=o);let s;t[2]!==a.authorizeUrl||t[3]!==a.kind||t[4]!==r?(s=a.kind===`authorize-org`&&(0,Z.jsxs)(Y,{type:`button`,variant:`outline`,size:`sm`,className:`self-start`,"data-testid":`publish-authorize-org`,onClick:()=>r(a.authorizeUrl),children:[`Authorize in browser `,(0,Z.jsx)(yt,{className:`ml-1 size-3`,"aria-hidden":!0})]}),t[2]=a.authorizeUrl,t[3]=a.kind,t[4]=r,t[5]=s):s=t[5];let c;t[6]!==a.kind||t[7]!==i?(c=a.kind===`retry-push`&&(0,Z.jsx)(Y,{type:`button`,variant:`outline`,size:`sm`,className:`self-start`,"data-testid":`publish-retry-push`,onClick:i,children:`Retry push`}),t[6]=a.kind,t[7]=i,t[8]=c):c=t[8];let l;return t[9]!==o||t[10]!==s||t[11]!==c?(l=(0,Z.jsxs)(`div`,{role:`alert`,"data-testid":`publish-banner`,className:`flex flex-col gap-2 rounded-md border border-destructive/50 bg-destructive/5 p-3 text-sm`,children:[o,s,c]}),t[9]=o,t[10]=s,t[11]=c,t[12]=l):l=t[12],l}function dA(e){let t=(0,$.c)(10),{status:n}=e;if(n.kind===`available`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`span`,{"data-testid":`publish-name-check`,"data-status":`available`,className:`flex items-center gap-1 text-emerald-600 dark:text-emerald-400`,children:[(0,Z.jsx)(ri,{className:`size-3.5`,"aria-hidden":!0}),` Available`]}),t[0]=e):e=t[0],e}if(n.kind===`taken`){let e;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(De,{className:`size-3.5`,"aria-hidden":!0}),t[1]=e):e=t[1];let r;return t[2]!==n.name||t[3]!==n.owner?(r=(0,Z.jsxs)(`span`,{"data-testid":`publish-name-check`,"data-status":`taken`,className:`flex items-center gap-1 text-destructive`,children:[e,` `,n.owner,`/`,n.name,` already exists`]}),t[2]=n.name,t[3]=n.owner,t[4]=r):r=t[4],r}if(n.kind===`checking`||n.kind===`pending`){let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(tt,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),t[5]=e):e=t[5];let r;return t[6]===n.kind?r=t[7]:(r=(0,Z.jsxs)(`span`,{"data-testid":`publish-name-check`,"data-status":n.kind,className:`flex items-center gap-1 text-muted-foreground`,children:[e,` Checking...`]}),t[6]=n.kind,t[7]=r),r}if(n.kind===`error`){let e;return t[8]===n.banner?e=t[9]:(e=(0,Z.jsx)(`span`,{"data-testid":`publish-name-check`,"data-status":`error`,className:`text-destructive`,children:n.banner}),t[8]=n.banner,t[9]=e),e}return null}var fA=50,pA=()=>{let e=(0,$.c)(5),t=(0,Q.useRef)(null),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=()=>{t.current===null&&(t.current=setTimeout(()=>{t.current=null,XC.preload()},fA))},e[0]=n):n=e[0];let r=n,i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{t.current!==null&&(clearTimeout(t.current),t.current=null)},e[1]=i):i=e[1];let a=i,o,s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>()=>{t.current!==null&&clearTimeout(t.current)},s=[],e[2]=o,e[3]=s):(o=e[2],s=e[3]),(0,Q.useEffect)(o,s);let c;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsxs)(jn,{children:[(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsxs)(Y,{variant:`ghost`,size:`icon`,className:`size-7 hover:bg-accent text-muted-foreground`,"data-testid":`header-settings-button`,onMouseEnter:r,onMouseLeave:a,onFocus:r,onBlur:a,onClick:()=>{a(),window.location.hash!==`#settings`&&(window.location.hash=th)},children:[(0,Z.jsx)(Jc,{className:`size-4`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Settings`})]})}),(0,Z.jsx)(er,{children:`Settings`})]}),e[4]=c):c=e[4],c};function mA(e){let t=(0,$.c)(12),{onClickWhenNoRemote:n}=e,{activeDocName:r}=ut(),{status:i}=to(),[a,o]=(0,Q.useState)(!1);if(!r)return null;let s=i?.hasRemote===!0,c;t[0]!==r||t[1]!==a||t[2]!==s||t[3]!==n?(c=async function(){if(!a&&r){o(!0);try{await nA({docName:r,hasRemote:s,onClickWhenNoRemote:n},{clipboardWrite:vA,toastSuccess:_A,toastError:gA,logEvent:hA})}catch{X.error(`Could not construct share URL.`)}o(!1)}},t[0]=r,t[1]=a,t[2]=s,t[3]=n,t[4]=c):c=t[4];let l=c,u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(Yc,{className:`size-3.5`,"aria-hidden":!0}),t[5]=u):u=t[5];let d;t[6]!==a||t[7]!==l?(d=(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsxs)(Y,{variant:`ghost`,size:`sm`,"aria-label":`Share doc`,onClick:l,disabled:a,className:`gap-1.5 text-muted-foreground px-1.5`,"data-testid":`share-button`,children:[u,`Share`]})}),t[6]=a,t[7]=l,t[8]=d):d=t[8];let f;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(er,{children:`Share`}),t[9]=f):f=t[9];let p;return t[10]===d?p=t[11]:(p=(0,Z.jsxs)(jn,{children:[d,f]}),t[10]=d,t[11]=p),p}function hA(e){return console.log(e)}function gA(e){return X.error(e)}function _A(e){return X.success(e)}function vA(e){return navigator.clipboard.writeText(e)}function yA(e){if(!e)return`never`;let t=Date.now()-new Date(e).getTime();return t<6e4?`just now`:t<36e5?`${Math.floor(t/6e4)} min ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:new Date(e).toLocaleDateString()}async function bA(e){await fetch(`/api/sync/trigger`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({op:e})})}function xA(e){let t=(0,$.c)(9),{status:n}=e;switch(n.state){case`dormant`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(ac,{className:`size-3.5 text-muted-foreground`}),t[0]=e):e=t[0],e}case`idle`:{if(n.ahead>0||n.behind>0){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Uc,{className:`size-3.5 text-muted-foreground`}),t[1]=e):e=t[1],e}let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(ac,{className:`size-3.5 text-muted-foreground`}),t[2]=e):e=t[2],e}case`fetching`:case`pulling`:case`pushing`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Uc,{className:`size-3.5 text-muted-foreground animate-spin`}),t[3]=e):e=t[3],e}case`conflict`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Ir,{className:`size-3.5 text-amber-500`}),t[4]=e):e=t[4],e}case`offline`:{let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(ic,{className:`size-3.5 text-muted-foreground`}),t[5]=e):e=t[5],e}case`auth-error`:{let e;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(jc,{className:`size-3.5 text-destructive`}),t[6]=e):e=t[6],e}case`disabled`:{let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Ir,{className:`size-3.5 text-amber-500`}),t[7]=e):e=t[7],e}default:{let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(ac,{className:`size-3.5 text-muted-foreground`}),t[8]=e):e=t[8],e}}}function SA(e){switch(e.state){case`idle`:return e.ahead>0?`↑${e.ahead}`:e.behind>0?`↓${e.behind}`:``;case`fetching`:case`pulling`:case`pushing`:return``;case`conflict`:return e.conflictCount>0?`${e.conflictCount}`:``;case`offline`:return``;case`auth-error`:return``;default:return``}}function CA(e){switch(e){case`dormant`:return`No git remote`;case`idle`:return`Synced`;case`fetching`:return`Fetching`;case`pulling`:return`Pulling`;case`pushing`:return`Pushing`;case`conflict`:return`Conflict`;case`offline`:return`Offline`;case`auth-error`:return`Sign in required`;case`disabled`:return`Sync disabled`;default:return e}}function wA(e){switch(e){case`external-changes-pending`:return`External changes pending`;case`dirty-tree`:return`Working tree has uncommitted changes`;case`detached-head`:return`Detached HEAD — checkout a branch to resume`;case`auth-error`:return`Sign in required`;case`protected-branch`:return`Protected branch — cannot push`;default:return e}}function TA(e){return e.syncEnabled?e.state===`idle`?e.ahead>0&&e.behind>0?`${e.ahead} ahead, ${e.behind} behind`:e.ahead>0?`${e.ahead} ahead`:e.behind>0?`${e.behind} behind`:`Synced`:e.state===`conflict`&&e.conflictCount>0?`${e.conflictCount} conflict${e.conflictCount===1?``:`s`}`:CA(e.state):`Sync off`}function EA(e){let t=(0,$.c)(76),{status:n,onSignIn:r,onOpenConflictResolver:i,onSetIdentity:a}=e,{projectLocalConfig:o,projectLocalSynced:s}=b(),c=o?.autoSync?.enabled??!1,{confirmOpen:l,setConfirmOpen:u,onToggleRequest:d,onConfirm:f}=Na(Sa()),p;t[0]===n?p=t[1]:(p=(0,Z.jsx)(xA,{status:n}),t[0]=n,t[1]=p);let m;t[2]===n.state?m=t[3]:(m=CA(n.state),t[2]=n.state,t[3]=m);let h;t[4]===m?h=t[5]:(h=(0,Z.jsx)(`span`,{className:`text-sm font-medium truncate`,children:m}),t[4]=m,t[5]=h);let g;t[6]!==p||t[7]!==h?(g=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[p,h]}),t[6]=p,t[7]=h,t[8]=g):g=t[8];let _=!s,v=c?`Disable sync`:`Enable sync`,y;t[9]!==c||t[10]!==d||t[11]!==_||t[12]!==v?(y=(0,Z.jsx)(U,{checked:c,disabled:_,onCheckedChange:d,"aria-label":v}),t[9]=c,t[10]=d,t[11]=_,t[12]=v,t[13]=y):y=t[13];let x;t[14]!==g||t[15]!==y?(x=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[g,y]}),t[14]=g,t[15]=y,t[16]=x):x=t[16];let S;t[17]!==l||t[18]!==f||t[19]!==u?(S=(0,Z.jsx)($a,{open:l,onOpenChange:u,onConfirm:f}),t[17]=l,t[18]=f,t[19]=u,t[20]=S):S=t[20];let C;t[21]===n.error?C=t[22]:(C=n.error&&(0,Z.jsx)(`p`,{className:`text-xs text-destructive`,children:n.error}),t[21]=n.error,t[22]=C);let w;t[23]===n.pausedReason?w=t[24]:(w=n.pausedReason&&(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:wA(n.pausedReason)}),t[23]=n.pausedReason,t[24]=w);let T;t[25]===n.state?T=t[26]:(T=n.state===`conflict`&&(0,Z.jsx)(`p`,{className:`text-xs text-amber-700 dark:text-amber-400`,children:`Sync paused — resolve conflicts to resume.`}),t[25]=n.state,t[26]=T);let E;t[27]!==c||t[28]!==n.lastSyncUtc||t[29]!==n.state?(E=c&&n.state!==`dormant`&&(0,Z.jsxs)(`div`,{children:[`Last synced: `,yA(n.lastSyncUtc)]}),t[27]=c,t[28]=n.lastSyncUtc,t[29]=n.state,t[30]=E):E=t[30];let D;t[31]===n.ahead?D=t[32]:(D=n.ahead>0&&(0,Z.jsxs)(`div`,{children:[n.ahead,` commit`,n.ahead===1?``:`s`,` ahead`]}),t[31]=n.ahead,t[32]=D);let O;t[33]===n.behind?O=t[34]:(O=n.behind>0&&(0,Z.jsxs)(`div`,{children:[n.behind,` commit`,n.behind===1?``:`s`,` behind`]}),t[33]=n.behind,t[34]=O);let k;t[35]===n.conflictCount?k=t[36]:(k=n.conflictCount>0&&(0,Z.jsxs)(`div`,{children:[n.conflictCount,` file`,n.conflictCount===1?``:`s`,` conflicted`]}),t[35]=n.conflictCount,t[36]=k);let A;t[37]===c?A=t[38]:(A=!c&&(0,Z.jsx)(`div`,{children:`Sync is off — your edits will not sync to the remote repository.`}),t[37]=c,t[38]=A);let j;t[39]!==E||t[40]!==D||t[41]!==O||t[42]!==k||t[43]!==A?(j=(0,Z.jsxs)(`div`,{className:`text-xs text-muted-foreground space-y-0.5`,children:[E,D,O,k,A]}),t[39]=E,t[40]=D,t[41]=O,t[42]=k,t[43]=A,t[44]=j):j=t[44];let M;t[45]!==a||t[46]!==n.identityUnresolved?(M=n.identityUnresolved&&a&&(0,Z.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed p-2`,children:[(0,Z.jsx)(cl,{className:`size-3.5 mt-0.5 text-muted-foreground shrink-0`}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5 min-w-0`,children:[(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground leading-snug`,children:`Git identity isn't set — commits use a default author. Set yours so teammates see your name.`}),(0,Z.jsx)(Y,{variant:`outline`,size:`xs`,className:`self-start`,onClick:a,children:`Set identity`})]})]}),t[45]=a,t[46]=n.identityUnresolved,t[47]=M):M=t[47];let N;t[48]!==c||t[49]!==n.state?(N=c&&n.state!==`dormant`&&n.state!==`disabled`&&n.state!==`auth-error`&&n.state!==`conflict`&&(0,Z.jsx)(Y,{variant:`outline`,size:`xs`,onClick:OA,children:`Sync now`}),t[48]=c,t[49]=n.state,t[50]=N):N=t[50];let P;t[51]!==c||t[52]!==r||t[53]!==n.state?(P=c&&n.state===`auth-error`&&(0,Z.jsx)(Y,{variant:`outline`,size:`xs`,onClick:r,children:`Sign in`}),t[51]=c,t[52]=r,t[53]=n.state,t[54]=P):P=t[54];let F;t[55]!==c||t[56]!==n.state?(F=c&&n.state===`offline`&&(0,Z.jsx)(Y,{variant:`outline`,size:`xs`,onClick:DA,children:`Retry`}),t[55]=c,t[56]=n.state,t[57]=F):F=t[57];let I;t[58]!==c||t[59]!==i||t[60]!==n.state?(I=c&&n.state===`conflict`&&i&&(0,Z.jsx)(Y,{variant:`outline`,size:`xs`,onClick:i,children:`Review conflicts`}),t[58]=c,t[59]=i,t[60]=n.state,t[61]=I):I=t[61];let L;t[62]!==N||t[63]!==P||t[64]!==F||t[65]!==I?(L=(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-1 pt-1`,children:[N,P,F,I]}),t[62]=N,t[63]=P,t[64]=F,t[65]=I,t[66]=L):L=t[66];let R;return t[67]!==C||t[68]!==w||t[69]!==T||t[70]!==j||t[71]!==M||t[72]!==L||t[73]!==x||t[74]!==S?(R=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[x,S,C,w,T,j,M,L]}),t[67]=C,t[68]=w,t[69]=T,t[70]=j,t[71]=M,t[72]=L,t[73]=x,t[74]=S,t[75]=R):R=t[75],R}function DA(){bA(`sync`)}function OA(){bA(`sync`)}function kA(e){let t=(0,$.c)(36),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{onSignIn:r,onOpenConflictResolver:i,onSetIdentity:a}=n,{status:o,fetchError:s}=to();if(!o){if(s){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground`,"aria-label":`Sync status unavailable`,disabled:!0,children:(0,Z.jsx)(ic,{className:`size-3.5`})})}),t[2]=e):e=t[2];let n=s===`network`?`Sync status unavailable — server unreachable.`:`Sync status unavailable — server error.`,r;return t[3]===n?r=t[4]:(r=(0,Z.jsxs)(jn,{children:[e,(0,Z.jsx)(er,{children:n})]}),t[3]=n,t[4]=r),r}return null}if(o.state===`dormant`&&!o.hasRemote||o.state===`disabled`&&!o.pausedReason)return null;let c;t[5]===o?c=t[6]:(c=SA(o),t[5]=o,t[6]=c);let l=c,u=!!o.identityUnresolved,d;t[7]===o.state?d=t[8]:(d=CA(o.state),t[7]=o.state,t[8]=d);let f=`Sync status: ${d}${u?` — git identity unset`:``}`,p;t[9]===o?p=t[10]:(p=(0,Z.jsx)(xA,{status:o}),t[9]=o,t[10]=p);let m;t[11]===l?m=t[12]:(m=l&&(0,Z.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 text-[9px] leading-none font-medium bg-background border rounded-full px-0.5`,children:l}),t[11]=l,t[12]=m);let h;t[13]!==l||t[14]!==u?(h=!l&&u&&(0,Z.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 size-1.5 rounded-full bg-amber-500 ring-2 ring-background`,"aria-hidden":!0}),t[13]=l,t[14]=u,t[15]=h):h=t[15];let g;t[16]!==f||t[17]!==p||t[18]!==m||t[19]!==h?(g=(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(Wt,{asChild:!0,children:(0,Z.jsxs)(Y,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground relative`,"aria-label":f,children:[p,m,h]})})}),t[16]=f,t[17]=p,t[18]=m,t[19]=h,t[20]=g):g=t[20];let _;t[21]===o?_=t[22]:(_=TA(o),t[21]=o,t[22]=_);let v;t[23]===_?v=t[24]:(v=(0,Z.jsx)(er,{children:_}),t[23]=_,t[24]=v);let y;t[25]!==v||t[26]!==g?(y=(0,Z.jsxs)(jn,{children:[g,v]}),t[25]=v,t[26]=g,t[27]=y):y=t[27];let b;t[28]!==i||t[29]!==a||t[30]!==r||t[31]!==o?(b=(0,Z.jsx)(q,{align:`end`,className:`w-64 p-3`,children:(0,Z.jsx)(EA,{status:o,onSignIn:r,onOpenConflictResolver:i,onSetIdentity:a})}),t[28]=i,t[29]=a,t[30]=r,t[31]=o,t[32]=b):b=t[32];let x;return t[33]!==y||t[34]!==b?(x=(0,Z.jsxs)(H,{children:[y,b]}),t[33]=y,t[34]=b,t[35]=x):x=t[35],x}function AA(e){let t=(0,$.c)(45),{onSaveVersion:n,saving:r,onSignIn:i,onSetIdentity:a,onOpenConflictResolver:o}=e,{activeDocName:s,activeTarget:c}=ut(),{state:l}=UD(),u=ch(),[d,f]=(0,Q.useState)(!1),p;bb0:{if(c===null){let e;t[0]===u?e=t[1]:(e=Rh({workspace:u}),t[0]=u,t[1]=e),p=e;break bb0}if(c.kind===`folder`){if(!u){p=null;break bb0}let e;t[2]!==c.folderPath||t[3]!==u?(e=zh({folderRelativePath:c.folderPath,workspace:u}),t[2]=c.folderPath,t[3]=u,t[4]=e):e=t[4],p=e;break bb0}let e;t[5]!==s||t[6]!==u?(e=Lh({docName:s,workspace:u}),t[5]=s,t[6]=u,t[7]=e):e=t[7],p=e}let m=p,h=typeof window<`u`&&window.okDesktop!=null,g=h&&l===`collapsed`&&`pl-[78px]`,_;t[8]===g?_=t[9]:(_=Di(`flex h-12 shrink-0 items-center bg-muted/35 shadow-[inset_0_-1px_0_var(--border)]`,h&&`[-webkit-app-region:drag]`,g,h&&`motion-safe:transition-[padding] motion-safe:duration-200 motion-safe:ease-linear`),t[8]=g,t[9]=_);let v;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(JD,{className:Di(`-ml-1 shrink-0 text-muted-foreground`,h&&`[-webkit-app-region:no-drag]`)})}),t[10]=v):v=t[10];let y=l===`expanded`?`Hide Files`:`Show Files`,b;t[11]===y?b=t[12]:(b=(0,Z.jsxs)(jn,{children:[v,(0,Z.jsx)(er,{children:y})]}),t[11]=y,t[12]=b);let x,S;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(Ba,{orientation:`vertical`,className:`mr-1 h-4 shrink-0 data-vertical:self-center`}),S=(0,Z.jsx)(Ak,{}),t[13]=x,t[14]=S):(x=t[13],S=t[14]);let C;t[15]===b?C=t[16]:(C=(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1 px-3`,children:[b,x,S]}),t[15]=b,t[16]=C);let w;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(w=Di(`flex shrink-0 items-center justify-end gap-2 px-3`,h&&`[&>*]:[-webkit-app-region:no-drag]`),t[17]=w):w=t[17];let T;t[18]!==s||t[19]!==n||t[20]!==r?(T=s&&(0,Z.jsxs)(jn,{children:[(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-sm`,"aria-label":`Checkpoint version`,onClick:n,disabled:r,className:`text-muted-foreground`,children:(0,Z.jsx)(qc,{className:`size-3.5`})})}),(0,Z.jsx)(er,{children:r?`Saving`:`Checkpoint version`})]}),t[18]=s,t[19]=n,t[20]=r,t[21]=T):T=t[21];let E;t[22]===m?E=t[23]:(E=(0,Z.jsx)(Ik,{input:m}),t[22]=m,t[23]=E);let D;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(mA,{onClickWhenNoRemote:()=>f(!0)}),t[24]=D):D=t[24];let O;t[25]===d?O=t[26]:(O=(0,Z.jsx)(iA,{open:d,onOpenChange:f}),t[25]=d,t[26]=O);let k;t[27]!==o||t[28]!==a||t[29]!==i?(k=(0,Z.jsx)(kA,{onSignIn:i,onSetIdentity:a,onOpenConflictResolver:o}),t[27]=o,t[28]=a,t[29]=i,t[30]=k):k=t[30];let A,j,M,N,P;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsx)(wO,{}),j=(0,Z.jsx)(Ba,{orientation:`vertical`,className:`h-4 shrink-0 data-vertical:self-center`}),M=(0,Z.jsx)(sd,{}),N=(0,Z.jsx)(pA,{}),P=(0,Z.jsx)(Pk,{}),t[31]=A,t[32]=j,t[33]=M,t[34]=N,t[35]=P):(A=t[31],j=t[32],M=t[33],N=t[34],P=t[35]);let F;t[36]!==T||t[37]!==E||t[38]!==O||t[39]!==k?(F=(0,Z.jsxs)(`div`,{className:w,children:[T,E,D,O,k,A,j,M,N,P]}),t[36]=T,t[37]=E,t[38]=O,t[39]=k,t[40]=F):F=t[40];let I;return t[41]!==F||t[42]!==_||t[43]!==C?(I=(0,Z.jsxs)(`header`,{"data-electron-drag":h?``:void 0,className:_,children:[C,F]}),t[41]=F,t[42]=_,t[43]=C,t[44]=I):I=t[44],I}function jA(){let e=(0,$.c)(32),[t,n]=Lg(),[r,i]=(0,Q.useState)(t),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(`auth`),[d,f]=(0,Q.useState)(cb[0].id),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(!1),_=fo(),{projectLocalConfig:v,projectLocalSynced:y}=b(),{activeDocName:x}=ut(),S=!h&&_?.hasRemote===!0&&y===!0&&v!==null&&v.autoSync?.enabled===null,C,w;e[0]===x?(C=e[1],w=e[2]):(C=()=>{let e=function(e){let t=e.detail;t&&x&&ks(x,{kind:`raw-mdx`,detail:t}),i(`source`)};return window.addEventListener(kg,e),()=>window.removeEventListener(kg,e)},w=[x],e[0]=x,e[1]=C,e[2]=w),(0,Q.useEffect)(C,w);let T;e[3]===n?T=e[4]:(T=function(e){i(e),n(e)},e[3]=n,e[4]=T);let E=T,D;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(D=async function(){m(!0);try{let e=await fetch(`/api/save-version`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})});e.ok?X.success(`Checkpoint saved`):(console.error(`[save-version] failed:`,await e.text()),X.error(`Checkpoint failed — try again`))}catch(e){console.error(`[save-version] failed:`,e),X.error(`Checkpoint failed — try again`)}m(!1)},e[5]=D):D=e[5];let O=D,k;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Z.jsx)(Bg,{onOpenResolver:()=>o(!0)}),e[6]=k):k=e[6];let A,j,M;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(A=()=>{u(`auth`),c(!0)},j=()=>{u(`identity`),c(!0)},M=()=>o(!0),e[7]=A,e[8]=j,e[9]=M):(A=e[7],j=e[8],M=e[9]);let N;e[10]===p?N=e[11]:(N=(0,Z.jsx)(AA,{onSaveVersion:O,saving:p,onSignIn:A,onSetIdentity:j,onOpenConflictResolver:M}),e[10]=p,e[11]=N);let P;e[12]!==d||e[13]!==r||e[14]!==E?(P=(0,Z.jsx)(vD,{editorMode:r,onModeChange:E,activeTab:d,onActiveTabChange:f}),e[12]=d,e[13]=r,e[14]=E,e[15]=P):P=e[15];let F;e[16]===a?F=e[17]:(F=(0,Z.jsx)(Hv,{open:a,onOpenChange:o}),e[16]=a,e[17]=F);let I=l===`identity`,L;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>{c(!1)},e[18]=L):L=e[18];let R;e[19]!==s||e[20]!==I?(R=(0,Z.jsx)(rd,{open:s,onOpenChange:c,identityPrompt:I,onSuccess:L}),e[19]=s,e[20]=I,e[21]=R):R=e[21];let z;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(z=()=>g(!0),e[22]=z):z=e[22];let B;e[23]===S?B=e[24]:(B=(0,Z.jsx)(Rg,{open:S,onResolved:z}),e[23]=S,e[24]=B);let V;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Z.jsx)(Eg,{}),e[25]=V):V=e[25];let H;return e[26]!==F||e[27]!==R||e[28]!==B||e[29]!==N||e[30]!==P?(H=(0,Z.jsxs)(Z.Fragment,{children:[k,N,P,F,R,B,V]}),e[26]=F,e[27]=R,e[28]=B,e[29]=N,e[30]=P,e[31]=H):H=e[31],H}var MA=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
46
- <symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
47
- <path d="M3.47 5.47a.75.75 0 0 1 1.06 0L8 8.94l3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06" fill="currentcolor"/>
48
- </symbol>
49
- <symbol id="file-tree-icon-dot" viewBox="0 0 6 6">
50
- <circle cx="3" cy="3" r="3" />
51
- </symbol>
52
- <symbol id="file-tree-icon-file" viewBox="0 0 16 16">
53
- <path fill="currentColor" d="M8 1v3a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1z" class="bg" opacity=".5"/>
54
- <path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
55
- </symbol>
56
- <symbol id="file-tree-icon-lock" viewBox="0 0 16 16">
57
- <path fill="currentcolor" d="M4 5.336V4a4 4 0 1 1 8 0v1.336c1.586.54 2 1.843 2 4.664v1c0 4.118-.883 5-5 5H7c-4.117 0-5-.883-5-5v-1c0-2.821.414-4.124 2-4.664M5.5 4v1.054Q6.166 4.998 7 5h2q.834-.002 1.5.054V4a2.5 2.5 0 0 0-5 0m-2 6v1c0 .995.055 1.692.167 2.193.107.483.246.686.35.79s.307.243.79.35c.5.112 1.198.167 2.193.167h2c.995 0 1.692-.055 2.193-.166.483-.108.686-.247.79-.35.104-.105.243-.308.35-.791.112-.5.167-1.198.167-2.193v-1c0-.995-.055-1.692-.166-2.193-.108-.483-.247-.686-.35-.79-.105-.104-.308-.243-.791-.35C10.693 6.555 9.995 6.5 9 6.5H7c-.995 0-1.692.055-2.193.167-.483.107-.686.246-.79.35s-.243.307-.35.79C3.555 8.307 3.5 9.005 3.5 10" />
58
- </symbol>
59
- <symbol id="file-tree-icon-ellipsis" viewBox="0 0 16 16">
60
- <path d="M5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M9.5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M14 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0" />
61
- </symbol>
62
- </svg>`,NA=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
63
- <path fill="currentColor" d="M6.08 13.92c-.63-.57-.81-1.79-.55-2.67.45.56 1.08.73 1.73.83 1 .15 1.99.1 2.92-.37l.32-.19q.13.38.08.78a2.1 2.1 0 0 1-.9 1.5q-.3.24-.61.43c-.64.44-.81.95-.57 1.69l.02.08a1.7 1.7 0 0 1-.74-.64 2 2 0 0 1-.3-.98q0-.27-.02-.52-.07-.61-.61-.62a.7.7 0 0 0-.75.6z" class="bg" opacity=".6"/>
64
- <path fill="currentColor" d="M2.5 11.1s1.86-.9 3.72-.9l1.4-4.39c.05-.21.2-.36.38-.36s.33.15.38.36l1.4 4.38c2.2 0 3.72.92 3.72.92l-3.16-8.69q-.13-.4-.45-.42H6.11q-.3.02-.45.42z" class="fg"/>
65
- </symbol>`,PA=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
66
- <path fill="currentColor" fill-rule="evenodd" d="M9.49.5q1.92.05 2.66.54 1.27.6 1.35 1.52v.23a4 4 0 0 1-.53 1.9l-1.38 1.24q-.74.38-.72.63c.77.82 1.33 1.29.85 2.42q-.47 1.1-2.04 2.28c-.5.32-1.88 1.35-2.96 1.86-1.64.77-3.1 1.4-4.65 1.89-.51.16-1.5.16-1.5.16L.5 15A76 76 0 0 0 5.76 3.49q-.1-.08-.1-.2.1 0 .32-.35l-.03-.09q-1.17.39-2.38 1.3l-.13.03q0-.1-.21-.16-.46.31-.82.7l-.13-.19.16-.06-.03-.16-.34.29L2 4.5q.36-.48.72-.54l.04-.1V3.8q.16 0 .15-.06l.13-.06a6 6 0 0 0 1.13-.9v-.03H4.1l-.12.07q0-.1-.1-.1l-.15.07-.04-.1q.93-.52 1.63-1.05Q7.89.65 9.5.5M8.46 7.83l-.32.04c-1.31.54-2.31.82-2.91.88a71 71 0 0 0-2.2 4.54h.07q.58-.04 3.04-1.42.13 0 1.66-1.05L9.18 9.7v.03q.45-.2.81-1.3v-.2q-.5-.46-1.53-.4m.28-5.75c-.5.1-.75.19-.72.38l-1.16 2.6q-.17.1-.34.95-.3.48-.25.77v.1l.22.05A15 15 0 0 1 8.86 6c1.1-.71 2.12-1.38 2.8-2.54q.24-.33.21-.54-.02-.33-.4-.54c-.54 0-1.07-.34-1.63-.28l-.94-.03z" clip-rule="evenodd"/>
67
- </symbol>`,FA=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
68
- <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
69
- <path fill="currentColor" d="M11.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zM7 6.75C7 6.42 6.64 6 6 6s-1 .42-1 .75q-.01.25.22.41.26.21.89.35.74.14 1.28.53c.37.29.61.7.61 1.21 0 .87-.68 1.5-1.5 1.7v.55a.5.5 0 0 1-1 0v-.56c-.82-.18-1.5-.82-1.5-1.69a.5.5 0 0 1 1 0c0 .33.36.75 1 .75s1-.42 1-.75q.01-.25-.22-.41a2 2 0 0 0-.89-.35q-.74-.14-1.28-.53A1.5 1.5 0 0 1 4 6.75c0-.87.68-1.5 1.5-1.7V4.5a.5.5 0 0 1 1 0v.56c.82.18 1.5.82 1.5 1.69a.5.5 0 0 1-1 0" class="fg-stroke"/>
70
- </symbol>`,IA=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
71
- <path fill="currentColor" d="M8 2 4.88 7.35a7 7 0 0 1 3.7-.13l1.04.25-.99 4.16-1.05-.25a2.7 2.7 0 0 0-3.07 1.45l-.98-.47a4 4 0 0 1 1.07-1.31 3.8 3.8 0 0 1 3.23-.71l.5-2.08a6 6 0 0 0-5.07 1.12A5.9 5.9 0 0 0 1 14h14z"/>
72
- </symbol>`,LA=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
73
- <path fill="currentColor" fill-rule="evenodd" d="M11.72 1.5A2.5 2.5 0 0 1 14.2 4q.02 1.08.3 2.09c.22.73.56 1.24 1.08 1.45.22.08.4.27.4.5s-.18.43-.4.51q-.76.34-1.08 1.45c-.2.65-.27 1.32-.3 2a2.5 2.5 0 0 1-2.48 2.5H4.25A2.6 2.6 0 0 1 1.7 12c-.04-.85-.1-1.68-.22-2.04C1.26 9.23.92 8.7.4 8.5.18 8.42 0 8.23 0 8s.18-.42.4-.5q.77-.35 1.09-1.46c.1-.36.17-1.19.2-2.04a2.6 2.6 0 0 1 2.56-2.5z" class="bg" clip-rule="evenodd" opacity=".2"/>
74
- <path fill="currentColor" fill-rule="evenodd" d="M8.47 4.54c1.23 0 2.04.68 2.04 1.73 0 .73-.55 1.39-1.24 1.5v.04c.94.1 1.58.77 1.58 1.7 0 1.2-.9 1.95-2.37 1.95H5.97a.3.3 0 0 1-.2-.08.3.3 0 0 1-.08-.2V4.82a.3.3 0 0 1 .08-.2.3.3 0 0 1 .2-.08zm-1.7 6.04h1.49q1.47-.01 1.49-1.15Q9.74 8.31 8.2 8.3H6.77zm0-5.16v2.06h1.21c.93 0 1.45-.38 1.45-1.06 0-.65-.44-1-1.22-1z" class="fg" clip-rule="evenodd"/>
75
- </symbol>`,RA=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
76
- <path fill="currentColor" d="M8.88 6.96c0 3.82 3.72 4.7 5.7 3.74-.23.9-1.04 1.67-2.35 1.93-.02.4.42 1.28.82 1.63-.9.35-1.94-.12-2.51-.48a5 5 0 0 0-.32 1.87c-.68 0-1.57-1-1.8-1.37-.3.18-.85 1.15-.96 1.72a2.4 2.4 0 0 1-.81-.86 2.4 2.4 0 0 1-.3-1.15c-.38.27-1.48.95-1.99 1.18-.25-.58-.15-1.3 0-2.06-.21.12-1.8.27-2.43.12.32-.36.75-1.19.94-1.57A4.5 4.5 0 0 1 .44 10.6c.48-.22.97-.53 1.49-1.06C1.26 9.17.24 8.64 0 7.7a6 6 0 0 0 1.79-.32C1.28 7.08.44 6.15.6 5.01c.42.21 1.3.37 1.73.3a3.4 3.4 0 0 1-.25-2.75 5 5 0 0 0 1.48 1c-.08-.8.3-2.31.8-2.71.2.46.73 1.21 1.08 1.4.09-.61.87-2.06 1.57-2.25 0 .5.27 1.4.5 1.67.51-.54 2.25-1.44 3.64-1.13-.43.45-.75.61-.86.98 1.05 0 2.78.34 4.27 1.93-2.34-.89-5.69.56-5.69 3.5" class="bg" opacity=".5"/>
77
- <path fill="currentColor" d="M11.21 3.59a4.1 4.1 0 0 0 2.47 2.89c.24-.22.61-.38.95-.19.76.44.2 1.26-.34 1.66l-.07.06a13 13 0 0 1-4.49 1.61l-.3-.43a10.5 10.5 0 0 0 4.13-1.31 1 1 0 0 0 .23-.25.5.5 0 0 0-.21-.69l-.15-.06a4.5 4.5 0 0 1-1.77-1.31 4.5 4.5 0 0 1-.88-1.77q.2-.12.43-.21"/>
78
- <path fill="currentColor" d="M10.36 5.18a.4.4 0 0 0-.03.38c.09.2.3.3.46.23s.24-.3.15-.5l-.01-.02q.23.13.34.39a.83.83 0 0 1-.43 1.08.8.8 0 0 1-1.08-.43.83.83 0 0 1 .6-1.13"/>
79
- </symbol>`,zA=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
80
- <path fill="currentColor" d="M8 14c3.87 0 7-2.46 7-5.49 0-1.88-1.2-3.53-3.04-4.52q-1.1-.61-1.84-1.07C9.2 2.35 8.64 2 8 2s-1.36.45-2.31 1.03A29 29 0 0 1 4.04 4C2.2 4.98 1 6.63 1 8.51 1 11.54 4.13 14 8 14M7.18 3.88q.3-.66.3-1.37c0-.08.11-.1.13-.01.38 1.57-.53 2.35-1.2 2.61-.08.03-.12-.07-.06-.12a3 3 0 0 0 .83-1.12m1.2-.05a3 3 0 0 0-.45-1.3V2.5c-.04-.07.05-.15.1-.1 1.15 1.2.77 2.3.33 2.87-.05.05-.13 0-.11-.08q.21-.67.13-1.37m1.04-.32a3 3 0 0 0-.94-1.02v-.01c-.06-.05-.01-.16.07-.12 1.51.61 1.61 1.8 1.43 2.5l-.03.03a.07.07 0 0 1-.1-.06 3 3 0 0 0-.43-1.32m-2.97.32c-.36.3-.74.43-1.2.56q-.11 0-.1-.1a3.5 3.5 0 0 0 1.76-1.57s.09-.07.1.04c0 .18-.2.76-.56 1.07m2.89 6.36q-.13.52-.55.88a1.3 1.3 0 0 1-.75.35 1.3 1.3 0 0 1-.77-.35 1.7 1.7 0 0 1-.54-.88.13.13 0 0 1 .15-.15h2.31a.14.14 0 0 1 .15.15M6.15 8.95a1.1 1.1 0 0 1-1.39-.14A1.1 1.1 0 0 1 5.12 7a1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1-.17 1.69m4.96 0a1.1 1.1 0 0 1-1.4-.14 1.1 1.1 0 0 1 .37-1.8 1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1 .24 1.2 1 1 0 0 1-.41.5"/>
81
- </symbol>`,BA=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
82
- <path fill="currentColor" d="M3.75 10.31 6.5 8.77l.04-.14-.04-.07h-.14l-.46-.03-1.57-.04-1.38-.07-1.33-.07-.34-.07L1 7.86l.03-.21.28-.18.4.03.89.07 1.33.08.97.06 1.43.16h.22l.03-.1-.07-.05-.06-.06-1.39-.92-1.48-.98-.79-.57-.42-.28-.2-.28-.1-.6.39-.41.52.04.12.03.52.4 1.12.86L6.2 6.04l.2.17.09-.06.01-.04-.1-.15-.76-1.46-.85-1.46-.37-.6-.1-.36a1 1 0 0 1-.06-.42l.42-.59.25-.07.6.08.22.2.36.84.58 1.3.9 1.77.29.53.14.47.04.14h.1v-.07l.07-1 .14-1.22.14-1.57.04-.45.23-.53.42-.28.36.15.28.41-.04.25-.16 1.08-.36 1.7-.21 1.14h.12l.14-.15.58-.76.97-1.2.42-.5.5-.51.32-.25h.6l.44.66-.2.68-.61.79-.52.65-.74 1-.45.8.04.05h.1l1.68-.36.9-.16 1.06-.18.5.23.05.22-.2.48-1.15.28-1.34.28-2 .46-.04.01.03.04.9.09.4.03h.94l1.77.14.46.28.27.37-.04.28-.72.37-.95-.23-2.24-.53-.76-.18h-.11v.06l.64.63L12 10.86l1.48 1.35.07.34-.18.28-.2-.03-1.29-.98-.5-.42-1.12-.95h-.07v.1l.25.38 1.37 2.05.07.63-.1.2-.36.14-.38-.08-.8-1.12-.85-1.26-.66-1.15-.07.05-.4 4.23-.19.21-.42.17-.35-.28-.2-.42.2-.87.23-1.12.18-.9.17-1.1.1-.36v-.03h-.1l-.84 1.16-1.27 1.72-1 1.07-.24.1-.42-.22.04-.39.22-.32 1.4-1.8.84-1.1.57-.64-.02-.07h-.04l-3.7 2.4-.66.09-.28-.28.03-.42.14-.14 1.12-.77z"/>
83
- </symbol>`,VA=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
84
- <path fill="currentColor" d="M8 15c-5.76 0-7-1.24-7-7V2a1 1 0 0 1 1-1h6c5.77 0 7 1.24 7 7s-1.24 7-7 7" class="vector" opacity=".2"/>
85
- <path fill="currentColor" d="M10.1 9.19h.73c.03.49.22.6 1 .6.76 0 .93-.12.93-.68 0-.52-.17-.67-.94-.85-1.38-.3-1.68-.56-1.68-1.47 0-1.05.3-1.29 1.67-1.29 1.29 0 1.57.2 1.6 1.13h-.74c-.01-.34-.17-.42-.85-.42-.77 0-.94.1-.94.58 0 .42.17.55.96.73 1.36.3 1.66.58 1.66 1.59 0 1.14-.31 1.39-1.73 1.39-1.39 0-1.69-.24-1.67-1.31m-3.9 0h.74c.03.49.21.6.99.6.76 0 .93-.12.93-.68 0-.52-.17-.67-.93-.85-1.39-.3-1.69-.56-1.69-1.47 0-1.05.3-1.29 1.67-1.29 1.3 0 1.58.2 1.6 1.13h-.73c-.02-.34-.18-.42-.85-.42-.78 0-.95.1-.95.58 0 .42.17.55.96.73 1.37.3 1.67.58 1.67 1.59 0 1.14-.32 1.39-1.74 1.39-1.38 0-1.68-.24-1.66-1.31m-1.22 0h.75c-.09 1.07-.37 1.31-1.56 1.31-1.37 0-1.68-.45-1.68-2.5 0-1.96.36-2.5 1.68-2.5 1.16 0 1.44.25 1.52 1.35h-.76c-.08-.52-.22-.64-.76-.64-.74 0-.9.33-.9 1.78 0 1.47.16 1.8.9 1.8.58 0 .74-.11.8-.6"/>
86
- </symbol>`,HA=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
87
- <path fill="currentColor" d="M14.953 9.733a12.4 12.4 0 0 1-.244 1.936c-.207.933-.532 1.58-.996 2.044s-1.11.789-2.044.996C10.73 14.918 9.533 15 8 15s-2.73-.082-3.669-.291c-.933-.207-1.58-.532-2.044-.996s-.789-1.11-.996-2.044c-.122-.547-.2-1.182-.244-1.92q.23.364.532.667c.64.639 1.482 1.031 2.533 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265a4 4 0 0 0 .541-.683"/>
88
- <path fill="currentColor" d="M14.93 5.924c-.046.663-.118 1.24-.23 1.743-.207.932-.532 1.579-.995 2.042s-1.11.789-2.042.996c-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997s-.789-1.11-.996-2.042a12 12 0 0 1-.227-1.683l.016-.188a4 4 0 0 0 .5.62c.638.639 1.48 1.031 2.532 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265.192-.192.357-.404.506-.633z"/>
89
- <path fill="currentColor" d="M8 1c1.533 0 2.73.082 3.669.291.933.207 1.58.533 2.044.996.403.404.904.944.91 1.695.004.764-.509 1.318-.918 1.727-.463.463-1.11.789-2.042.996-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997-.406-.406-.915-.953-.915-1.71 0-.758.509-1.305.915-1.712.464-.463 1.11-.789 2.044-.996C5.27 1.082 6.467 1 8 1"/>
90
- </symbol>`,UA=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
91
- <path fill="currentColor" d="M8 1v3a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1z" class="bg" opacity=".4"/>
92
- <path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
93
- </symbol>`,WA=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
94
- <path fill="currentColor" d="M15.85 6.54c-.05-.04-.45-.36-1.31-.36q-.34 0-.68.06a2.7 2.7 0 0 0-1.14-1.79l-.23-.14-.15.23a3 3 0 0 0-.4 1q-.24 1.01.26 1.84c-.4.24-1.03.3-1.17.3H.5a.5.5 0 0 0-.5.52q-.01 1.46.46 2.83.55 1.5 1.6 2.18c.79.5 2.08.79 3.54.79q.96 0 1.94-.18a8 8 0 0 0 2.55-.97 7 7 0 0 0 1.73-1.5 10 10 0 0 0 1.7-3.06h.15a2.4 2.4 0 0 0 1.8-.7 2 2 0 0 0 .47-.74l.06-.2z"/>
95
- <path fill="currentColor" d="M1.48 7.36h1.4a.14.14 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H1.48a.13.13 0 0 0-.13.14v1.32q.02.13.13.13m1.94 0h1.41a.14.14 0 0 0 .13-.13V5.91q-.01-.12-.13-.14h-1.4a.13.13 0 0 0-.13.14v1.32q0 .13.12.13m1.98 0h1.4q.13 0 .14-.13V5.91a.13.13 0 0 0-.14-.14H5.4q-.1.01-.12.14v1.32q0 .13.12.13m1.95 0h1.42q.1 0 .12-.13V5.91q0-.12-.12-.14H7.35q-.1.01-.12.14v1.32q.01.13.12.13M3.42 5.5h1.41c.07 0 .13-.08.13-.15V4.03a.13.13 0 0 0-.13-.14h-1.4q-.12 0-.13.14v1.31q0 .13.12.15m1.98 0h1.4c.08 0 .14-.08.14-.15V4.03q0-.13-.14-.14H5.4q-.1 0-.12.14v1.31q0 .13.12.15m1.95 0h1.42c.06 0 .12-.08.12-.15V4.03q-.01-.13-.12-.14H7.35q-.1 0-.12.14v1.31q.01.13.12.15m0-1.9h1.42q.1-.02.12-.14v-1.3Q8.88 2 8.77 2H7.35q-.1 0-.12.14v1.3q.01.13.12.14m1.97 3.78h1.4a.13.13 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H9.32q-.1.01-.12.14v1.32q.01.13.12.13" opacity=".5"/>
96
- </symbol>`,GA=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
97
- <path fill="currentColor" d="M11.16 6.1 8.12 4.35a.3.3 0 0 0-.24 0L4.84 6.1a.3.3 0 0 0-.12.2v3.5q0 .14.12.22l3.04 1.74q.12.08.24 0l3.04-1.74a.2.2 0 0 0 .13-.22V6.3a.3.3 0 0 0-.13-.2" opacity=".5"/>
98
- <path fill="currentColor" d="m.1 7.69 3.63-6.3A.8.8 0 0 1 4.37 1h7.26c.26 0 .5.17.64.4l3.63 6.27a.8.8 0 0 1 0 .75l-3.63 6.24a.7.7 0 0 1-.64.34H4.37a.7.7 0 0 1-.64-.34L.1 8.41a.7.7 0 0 1 0-.72m3 3.02q.01.15.14.23l4.63 2.66q.13.06.26 0l4.63-2.66a.3.3 0 0 0 .14-.23V5.4a.3.3 0 0 0-.14-.23L8.13 2.52a.3.3 0 0 0-.26 0L3.24 5.17a.3.3 0 0 0-.14.23z"/>
99
- </symbol>`,KA=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
100
- <path fill="currentColor" d="M12.3 13c-1.59 0-2.68-.99-2.68-2.5 0-1.43 1-2.34 2.88-2.35h2.16v-.83c0-1.08-.62-1.68-1.73-1.68-1.05 0-1.66.54-1.73 1.36H9.93c.09-1.43 1.06-2.48 3.05-2.48 1.75 0 3.02.95 3.02 2.68v5.66h-1.29v-1.02h-.04c-.41.66-1.16 1.16-2.37 1.16m.36-1.12c1.14 0 2-.72 2-1.74v-.96H12.6c-1.12 0-1.6.54-1.6 1.28 0 .97.8 1.42 1.66 1.42m-11.24.98H0L3.8 2h1.39l3.8 10.86H7.54l-1.08-3.2H2.5zm3.09-9.25h-.04l-1.6 4.95H6.1z"/>
101
- </symbol>`,qA=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
102
- <path fill="currentColor" d="M14.74 7.38 8.62 1.26a.9.9 0 0 0-1.27 0L6.08 2.53l1.61 1.61a1.07 1.07 0 0 1 1.36 1.37l1.55 1.55a1.07 1.07 0 0 1 1.1 1.77 1.07 1.07 0 0 1-1.74-1.16L8.5 6.22v3.8a1.07 1.07 0 1 1-.89-.02V6.15a1.07 1.07 0 0 1-.58-1.4l-1.58-1.6-4.2 4.2a.9.9 0 0 0 0 1.27l6.12 6.12a.9.9 0 0 0 1.27 0l6.09-6.09a.9.9 0 0 0 0-1.27"/>
103
- </symbol>`,JA=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
104
- <path fill="currentColor" fill-rule="evenodd" d="M4.41 4.57A3.2 3.2 0 0 1 6.87 5q.74.49 1.08 1.29.08.12-.1.16l-1.55.4c-.14.03-.15.04-.27-.1a1 1 0 0 0-.44-.34 1.6 1.6 0 0 0-1.68.14q-.95.61-.94 1.73c0 .73.52 1.33 1.25 1.43q.95.1 1.58-.6l.25-.34h-1.8c-.19 0-.24-.12-.17-.27.12-.28.34-.76.47-1a.3.3 0 0 1 .24-.14h2.98a4 4 0 0 1 .64-1.19 4 4 0 0 1 2.6-1.52 3.5 3.5 0 0 1 2.64.46q1.13.73 1.31 2.04a3.5 3.5 0 0 1-1.06 3.09q-.93.92-2.23 1.17l-.74.08a3.5 3.5 0 0 1-2.27-.8 3 3 0 0 1-.93-1.42 4 4 0 0 1-.39.61 4 4 0 0 1-2.64 1.56 3.3 3.3 0 0 1-2.5-.6 3 3 0 0 1-1.18-2.03 3.5 3.5 0 0 1 .8-2.67 4 4 0 0 1 2.6-1.58M13.1 7.5a1.53 1.53 0 0 0-1.9-1.21q-1.3.3-1.62 1.59a1.5 1.5 0 0 0 .85 1.72q.77.33 1.52-.05a2 2 0 0 0 1.18-1.74q0-.17-.03-.3" clip-rule="evenodd"/>
105
- </symbol>`,YA=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
106
- <path fill="currentColor" fill-rule="evenodd" d="M8 1a1.25 1.25 0 0 1 1.18 1.65l2.8 1.61q.33-.25.77-.26a1.25 1.25 0 0 1 .48 2.4v3.2a1.25 1.25 0 1 1-1.25 2.13l-2.8 1.62A1.25 1.25 0 0 1 8 15a1.25 1.25 0 0 1-1.18-1.65l-2.8-1.62q-.33.26-.77.27a1.25 1.25 0 0 1-.48-2.4V6.4a1.25 1.25 0 1 1 1.25-2.14l2.8-1.61A1.25 1.25 0 0 1 8 1M4.44 11.14l-.06.13 2.75 1.58a1.25 1.25 0 0 1 1.74 0l2.74-1.58-.05-.13zm3.89-7.68a1.3 1.3 0 0 1-.66 0L4.03 9.77q.37.3.45.78h7.04q.08-.48.45-.78zM4.38 4.73a1.24 1.24 0 0 1-1.02 1.76v3.02l.13.01 3.67-6.35-.03-.02zm4.46-1.56 3.67 6.35.13-.01V6.49a1.25 1.25 0 0 1-1.03-1.76L8.87 3.15z" clip-rule="evenodd"/>
107
- </symbol>`,XA=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
108
- <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
109
- <path fill="currentColor" d="M10.48 3.76a.5.5 0 0 1 .4.58L10.6 5.8h1.14a.5.5 0 0 1 0 1h-1.32L10 9.2h1.08a.5.5 0 0 1 0 1H9.8l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H6.4l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H4.25a.5.5 0 0 1 0-1h1.32L6 6.8H4.93a.5.5 0 0 1 0-1H6.2l.3-1.64a.5.5 0 1 1 .98.18L7.2 5.8h2.4l.3-1.64a.5.5 0 0 1 .58-.4M6.58 9.2h2.4l.44-2.4h-2.4z" class="fg"/>
110
- </symbol>`,ZA=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
111
- <path fill="currentColor" d="M12.5 2A2.5 2.5 0 0 1 15 4.5v4.67l-4.05-3.54-4.08 4.08-3-2L1 10.6V4.5A2.5 2.5 0 0 1 3.5 2z" opacity=".3"/>
112
- <path fill="currentColor" d="M15 10.5v1a2.5 2.5 0 0 1-2.5 2.5h-9a2.5 2.5 0 0 1-2.46-2.04L4 9l3 2 4-4zm-7-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"/>
113
- </symbol>`,QA=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
114
- <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
115
- <path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66M3.5 9.5h.98c0 .76.15.92.85.92.77 0 .94-.18.94-1.02V5.1h1v4.34c0 1.54-.35 1.87-1.92 1.87-1.55 0-1.89-.32-1.86-1.8"/>
116
- </symbol>`,$A=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
117
- <path fill="currentColor" d="M13.25 11.5V9.75a.5.5 0 0 1 .36-.48l.55-.15a1.16 1.16 0 0 0 0-2.24l-.55-.15a.5.5 0 0 1-.36-.48V4.5a2.5 2.5 0 0 0-2.5-2.5h-.25a.5.5 0 0 0 0 1h.25a1.5 1.5 0 0 1 1.5 1.5v1.75a1.5 1.5 0 0 0 1.09 1.44l.54.15a.16.16 0 0 1 0 .32l-.54.15a1.5 1.5 0 0 0-1.09 1.44v1.75a1.5 1.5 0 0 1-1.5 1.5h-.25a.5.5 0 0 0 0 1h.25a2.5 2.5 0 0 0 2.5-2.5m-10.5 0V9.75a.5.5 0 0 0-.36-.48l-.55-.15a1.16 1.16 0 0 1 0-2.24l.55-.15a.5.5 0 0 0 .36-.48V4.5A2.5 2.5 0 0 1 5.25 2h.25a.5.5 0 0 1 0 1h-.25a1.5 1.5 0 0 0-1.5 1.5v1.75a1.5 1.5 0 0 1-1.09 1.44l-.54.15a.16.16 0 0 0 0 .32l.54.15a1.5 1.5 0 0 1 1.09 1.45v1.74a1.5 1.5 0 0 0 1.5 1.5h.25a.5.5 0 0 1 0 1h-.25a2.5 2.5 0 0 1-2.5-2.5"/>
118
- </symbol>`,ej=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
119
- <path fill="currentColor" d="M1 12V4h2l2 2.5L7 4h2v8H7V7.5l-2 2-2-2V12zm9-3 3 3.5L16 9h-2V4h-2v5z"/>
120
- </symbol>`,tj=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
121
- <path fill="currentColor" d="M9.26-.04a3 3 0 0 1 2 .82 2.8 2.8 0 0 1 .8 2.35 2.9 2.9 0 0 1 2.41.8l.03.02a2.74 2.74 0 0 1 0 3.94l-5.8 5.69-.04.06-.02.07q0 .04.02.07.01.04.04.06l1.2 1.17a.55.55 0 0 1 0 .79.6.6 0 0 1-.81 0l-1.2-1.17a1.3 1.3 0 0 1 0-1.84L13.7 7.1a1.65 1.65 0 0 0 .37-1.82 2 2 0 0 0-.37-.54l-.03-.03a1.73 1.73 0 0 0-2.4 0L6.47 9.4l-.07.06a.58.58 0 0 1-.92-.18.6.6 0 0 1 .12-.6l4.85-4.76a1.65 1.65 0 0 0 0-2.36 1.73 1.73 0 0 0-2.4 0l-6.43 6.3a.6.6 0 0 1-.8 0 .55.55 0 0 1 0-.8L7.25.79a3 3 0 0 1 2-.82"/>
122
- <path fill="currentColor" d="M9.26 2.19a.6.6 0 0 1 .52.34.6.6 0 0 1 0 .43l-.12.18L4.9 7.79a1.65 1.65 0 0 0 0 2.36 1.73 1.73 0 0 0 2.4 0l4.75-4.66a.58.58 0 0 1 .93.18.6.6 0 0 1-.12.61l-4.75 4.66a2.9 2.9 0 0 1-4.01 0 2.75 2.75 0 0 1-.62-3.04A3 3 0 0 1 4.1 7l4.74-4.65a.6.6 0 0 1 .4-.16"/>
123
- </symbol>`,nj=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
124
- <defs>
125
- <linearGradient id="a" x1="4.522" x2="14" y1="3.943" y2="16" gradientUnits="userSpaceOnUse">
126
- <stop stop-color="currentColor"/>
127
- <stop offset="1" stop-color="currentColor" stop-opacity="0"/>
128
- </linearGradient>
129
- </defs>
130
- <path fill="currentColor" d="M3 2h1.522v9.09H3z"/>
131
- <path fill="url(#a)" d="M4.903 2 15 15.075q-.565.5-1.195.925L4.522 3.943z"/>
132
- <path fill="currentColor" d="M12.172 2h-1.508v9.094h1.508z"/>
133
- </symbol>`,rj=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
134
- <path fill="currentColor" d="M2 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z" class="vector" opacity=".2"/>
135
- <path fill="currentColor" d="M10.5 13H13V3H3v10h5V5.5h2.5z"/>
136
- </symbol>`,ij=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
137
- <path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .5.5V3h3.5a.5.5 0 0 1 .38.83L10.5 7.69v1.44q.41.04.95-.16a4 4 0 0 0 .72-.35l.04-.03h.01a.5.5 0 0 1 .67.1l2 2.5a.5.5 0 0 1 0 .62c-.76.96-3.14 2.69-6.89 2.69s-6.13-1.73-6.89-2.69a.5.5 0 0 1 0-.62l2-2.5a.5.5 0 0 1 .67-.1l.05.03.16.09q.22.13.56.26.54.2.95.16V7.69L2.12 3.83A.5.5 0 0 1 2.5 3H6V1.5a.5.5 0 0 1 .5-.5zM7 3.5a.5.5 0 0 1-.5.5H3.6l2.78 3.17a.5.5 0 0 1 .12.33v2a.5.5 0 0 1-.28.45c-.7.35-1.5.15-2.02-.05a5 5 0 0 1-.58-.26l-1.46 1.84c.82.78 2.8 2.02 5.84 2.02s5.02-1.24 5.84-2.02l-1.46-1.83a5 5 0 0 1-.58.26c-.52.2-1.33.39-2.02.04a.5.5 0 0 1-.28-.45v-2a.5.5 0 0 1 .12-.33L12.4 4H9.5a.5.5 0 0 1-.5-.5V2H7z"/>
138
- </symbol>`,aj=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
139
- <path fill="currentColor" d="M14.5 8a6.5 6.5 0 0 0-5.9-6.47l5.42 8.93A7 7 0 0 0 14.5 8M2.88 12A6.5 6.5 0 0 0 8 14.5c2.08 0 3.93-.98 5.12-2.5zm8.62-1h1.68L11.5 8.24zm-1-.55a4 4 0 0 1-.7.55h.7zM8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M5.5 11h.7a4 4 0 0 1-.7-.55zm-2.68 0H4.5V8.24zm3.76-6.2A4 4 0 0 1 8 4.5q.76 0 1.42.3L8 2.46zM1.5 8q0 1.31.48 2.46L7.4 1.53A6.5 6.5 0 0 0 1.5 8m14 0a7.5 7.5 0 0 1-.99 3.72l-.01.03-.02.03A7.5 7.5 0 0 1 8 15.5a7.5 7.5 0 0 1-6.5-3.75l-.01-.03A7.5 7.5 0 1 1 15.5 8"/>
140
- </symbol>`,oj=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
141
- <path fill="currentColor" d="M6 12v1H4.93v-1zm1-2v1H2v-1zm6-4v1h-3V6zm-1-4v1H9V2z"/>
142
- <path fill="currentColor" d="M11.5 10v1H8v-1zM5 6v1H2V6zm5-2v1H9V4z" opacity=".8"/>
143
- <path fill="currentColor" d="M6 14v1H2v-1zm-.5-6v1H2V8zM13 4v1h-3V4zM4.93 2v1H2V2z" opacity=".6"/>
144
- <path fill="currentColor" d="M4.93 12v1H2v-1zM13 8v1H9V8zM5.5 4v1H2V4zM9 2v1H4.93V2z" opacity=".4"/>
145
- </symbol>`,sj=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
146
- <path fill="currentColor" d="M8.33 8.4H10c1.16 0 1.9-.73 1.9-1.86V5.08q0-.24.25-.24h.74c.75 0 1.33.32 1.66.97q.4.73.41 1.46c.09.9.09 1.78-.24 2.67-.25.73-.75 1.3-1.58 1.46h-4.8c-.08 0-.25 0-.25.08v.4s.17.09.25.09h2.82q.34-.02.33.32v1.06c0 .56-.25.97-.75 1.13-.41.16-.83.33-1.24.4a7 7 0 0 1-2.98-.07 3 3 0 0 1-1.16-.49c-.33-.32-.58-.65-.5-1.14v-2.91c0-1.13.67-1.78 1.82-1.78q.89-.1 1.66-.08m2.32 4.86a.65.65 0 0 0-.66-.65c-.34 0-.67.33-.67.65s.33.57.67.65a.65.65 0 0 0 .66-.65" class="bg" opacity=".8"/>
147
- <path fill="currentColor" d="M7.67 7.6H6c-1.16 0-1.9.73-1.9 1.86v1.46q0 .24-.25.24h-.74c-.75 0-1.33-.32-1.66-.97a3 3 0 0 1-.41-1.46 6 6 0 0 1 .24-2.67c.25-.73.75-1.3 1.58-1.46h4.8c.08 0 .25 0 .25-.08v-.4s-.17-.09-.25-.09H4.85c-.24 0-.33-.08-.33-.32V2.65c0-.56.25-.97.75-1.13.41-.16.83-.33 1.24-.4a7 7 0 0 1 2.98.07c.41.09.83.25 1.16.49.33.32.58.65.5 1.13v2.92c0 1.14-.67 1.78-1.82 1.78-.58.08-1.16.08-1.66.08M5.35 2.73c0 .33.25.65.66.65.33 0 .66-.32.66-.65 0-.32-.33-.56-.66-.64a.65.65 0 0 0-.66.64" class="fg"/>
148
- </symbol>`,cj=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
149
- <path fill="currentColor" d="M8 6.65c.73 0 1.31.6 1.31 1.35S8.73 9.35 8 9.35 6.69 8.75 6.69 8 7.27 6.65 8 6.65"/>
150
- <path fill="currentColor" fill-rule="evenodd" d="M8 2.55c1.3-.99 2.59-1.34 3.5-.8.92.55 1.27 1.87 1.08 3.53C14.06 5.94 15 6.9 15 8s-.94 2.06-2.42 2.72c.19 1.65-.16 2.98-1.08 3.52-.91.55-2.2.2-3.5-.8-1.3 1-2.58 1.35-3.5.8-.91-.54-1.27-1.87-1.08-3.52C1.94 10.06 1 9.1 1 8s.94-2.06 2.42-2.72c-.19-1.66.17-2.98 1.08-3.52s2.2-.2 3.5.8M4.26 11.2c-.08 1.34.28 2.03.68 2.26s1.15.22 2.25-.52l.11-.09a12 12 0 0 1-1.24-1.39 11 11 0 0 1-1.8-.41zm7.47-.15q-.83.27-1.79.41-.6.8-1.24 1.4l.11.08c1.1.74 1.86.76 2.25.52.4-.23.76-.92.68-2.26zm-3.04.54a14 14 0 0 1-1.38 0q.34.38.69.7.35-.32.7-.7M8 5.29q-.76 0-1.47.1A13 13 0 0 0 5.07 8a14 14 0 0 0 1.46 2.62 13 13 0 0 0 2.94 0A13 13 0 0 0 10.93 8a14 14 0 0 0-1.46-2.62A13 13 0 0 0 8 5.3M4.64 9.18q-.15.5-.25.96.44.16.94.27a15 15 0 0 1-.7-1.23m6.73 0a15 15 0 0 1-.7 1.23q.5-.11.95-.27a10 10 0 0 0-.25-.96M3.44 6.26C2.27 6.86 1.87 7.53 1.87 8s.4 1.14 1.57 1.74l.13.07q.18-.88.55-1.81a12 12 0 0 1-.55-1.8q-.07.02-.13.06m8.99-.07A12 12 0 0 1 11.88 8q.36.94.55 1.8l.13-.06c1.17-.6 1.56-1.27 1.56-1.74s-.39-1.14-1.56-1.74zm-7.1-.6q-.5.11-.94.27.1.46.25.96a15 15 0 0 1 .69-1.23m5.34 0a15 15 0 0 1 .7 1.23q.14-.5.24-.96-.44-.15-.94-.27M7.18 3.06c-1.09-.74-1.85-.76-2.24-.52s-.76.92-.69 2.26l.01.15a11 11 0 0 1 1.8-.41q.6-.8 1.24-1.4zm3.88-.52c-.4-.24-1.15-.22-2.25.52l-.12.08q.65.6 1.25 1.4.96.15 1.8.41v-.14c.08-1.35-.28-2.04-.68-2.27M8 3.7a10 10 0 0 0-.7.7 14 14 0 0 1 1.4 0 10 10 0 0 0-.7-.7" clip-rule="evenodd"/>
151
- </symbol>`,lj=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
152
- <path fill="currentColor" fill-rule="evenodd" d="M11.04 2c.48 0 .92.23 1.18.6l2.54 3.65c.37.52.3 1.23-.15 1.69l-5.58 5.64a1.47 1.47 0 0 1-2.06 0L1.39 7.94a1.3 1.3 0 0 1-.15-1.7l2.54-3.63q.2-.3.5-.45.33-.16.68-.16zm.84 2.17a.5.5 0 0 0-.7-.05L8 6.84 4.83 4.12a.5.5 0 0 0-.65.76L6.65 7H3.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1H9.35l2.48-2.12a.5.5 0 0 0 .05-.7" clip-rule="evenodd"/>
153
- </symbol>`,uj=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
154
- <path fill="currentColor" fill-rule="evenodd" d="M8 .8a.2.2 0 0 1 .18.1l.38.6.16.02.5-.53.01-.01a.2.2 0 0 1 .33.08l.25.68.16.05.59-.43h.02a.2.2 0 0 1 .3.14l.12.71.15.08.65-.3a.2.2 0 0 1 .2.02.2.2 0 0 1 .1.18l-.03.72.12.1.71-.16a.2.2 0 0 1 .25.25l-.17.7q.06.06.1.13l.73-.03A.2.2 0 0 1 14 4a.2.2 0 0 1 .02.2l-.3.66.08.14.71.12a.2.2 0 0 1 .14.32l-.43.59.05.16.68.25a.2.2 0 0 1 .07.35l-.53.49.01.16.62.38a.2.2 0 0 1 0 .36l-.62.38-.01.16.53.5a.2.2 0 0 1-.07.34l-.68.25-.05.16.43.59a.2.2 0 0 1-.14.32l-.72.12-.07.15.3.65a.2.2 0 0 1-.02.2.2.2 0 0 1-.18.1l-.72-.03-.1.13.16.7a.2.2 0 0 1-.25.25l-.7-.17-.13.1.03.73a.2.2 0 0 1-.1.18.2.2 0 0 1-.2.02l-.66-.3-.14.08-.12.71a.2.2 0 0 1-.32.14l-.59-.43-.16.05-.25.68a.2.2 0 0 1-.34.07l-.5-.53-.16.01-.38.62a.2.2 0 0 1-.36 0l-.38-.62-.16-.01-.5.53a.2.2 0 0 1-.34-.07l-.25-.68-.16-.05-.59.43a.2.2 0 0 1-.32-.14L5 13.78l-.15-.07-.65.3a.2.2 0 0 1-.2-.02.2.2 0 0 1-.1-.18l.03-.72-.13-.1-.7.16a.2.2 0 0 1-.25-.25l.17-.7-.1-.13-.73.03a.2.2 0 0 1-.2-.3l.3-.66-.08-.14-.71-.12a.2.2 0 0 1-.14-.32l.43-.59-.05-.16-.68-.25A.2.2 0 0 1 1 9.22l.53-.5-.02-.16-.6-.38A.2.2 0 0 1 .8 8a.2.2 0 0 1 .1-.18l.6-.38.02-.16-.53-.5a.2.2 0 0 1 .07-.34l.68-.25.05-.16-.43-.59a.2.2 0 0 1 .14-.32L2.2 5l.08-.15L2 4.2a.2.2 0 0 1 .2-.3l.72.03.1-.13-.16-.7a.2.2 0 0 1 .25-.25l.7.16.13-.1-.03-.72A.2.2 0 0 1 4 2a.2.2 0 0 1 .2-.02l.65.3L5 2.2l.12-.71v-.03a.2.2 0 0 1 .32-.1l.59.41.16-.04.25-.68.01-.02A.2.2 0 0 1 6.8.99l.49.53.16-.02.38-.61.02-.02A.2.2 0 0 1 8 .79M6.8 9.45h1.26l.06.01q.03.01.03.05v1.52q0 .07-.09.06h-4.5A5.4 5.4 0 0 0 8 13.42a5.4 5.4 0 0 0 4.45-2.33h-2.42c-.36 0-.68-.5-.77-.75-.08-.22-.2-.91-.25-1.12-.15-.61-.59-.71-.78-.73H6.8zM8 2.58a5.4 5.4 0 0 0-4.07 1.85h5.74l.17.02c.23.03.6.12.96.35.34.23.83.68.83 1.4 0 .66-.55 1.16-1.08 1.5.42.33.7.53.86 1.44.04.17.34.32.62.29.29-.03.62-.16.62-.75v-.24q0-.1.07-.1h.68A5.43 5.43 0 0 0 8 2.59M2.96 6.03a5.4 5.4 0 0 0-.19 3.37h1.66V6.03zM6.8 7.06h1.66c.35 0 .77-.12.77-.47 0-.42-.55-.53-.65-.53H6.8z" clip-rule="evenodd"/>
155
- </symbol>`,dj=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
156
- <path fill="currentColor" fill-rule="evenodd" d="M8.08 1.44c2.41-.91 4.96-.37 5.35 1.27.39 1.62-.92 3.56-2.6 4.25a5 5 0 0 1-3.26.35c-.58-.2-.92-.62-1-.85-.03-.09-.09-.24 0-.3.05-.03.08-.02.22.15s.7.6 1.75.48c2.78-.34 4.45-2.64 3.92-3.88-.37-.87-2.5-1.26-5.18.16C4.03 4.81 3.85 6.24 3.82 6.8c-.08 1.5 1.73 2.28 2.7 3.4q.04.03.07.08c.3-.12.7-.19 1.35-.2 1.58-.03 2.47 1.08 2.43 2.08-.03.78-.7 1.1-.82 1.13-.1.01-.14.02-.15-.06q-.03-.06.13-.15c.16-.09.42-.3.48-.72.05-.43-.24-1.44-1.76-1.63a3 3 0 0 0-1.33.08c.27.62.32 1.87-.29 2.83-.63 1-1.8 1.61-2.93 1.27-.37-.1-.93-.92-.45-2.05.46-1.07 2.4-2.12 2.66-2.26-.9-.83-3.08-1.95-3.4-3.65-.08-.49.13-1.65 1.46-2.98a12 12 0 0 1 4.11-2.52m-1.88 9.7c-.01.01-.9.47-1.52 1.17-.59.66-.75 1.48-.43 1.69.3.18 1-.04 1.51-.62a3 3 0 0 0 .5-.9q.2-.64.02-1.39z" clip-rule="evenodd"/>
157
- </symbol>`,fj=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
158
- <path fill="currentColor" d="M4 3v3.5l1.5-1L7 15 .5 6l1-1.5L0 3l2.5-2h1zm12 0-1.5 1.5 1 1.5L9 15l1.5-9.5 1.5 1V3l.5-2h1zm-8 8.5a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1"/>
159
- <path fill="currentColor" d="M6.5 2.5V4l-2 1.5v-4zm5 3L9.5 4V2.5l2-1zM9 4H7V2.5h2z"/>
160
- </symbol>`,pj=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
161
- <path fill="currentColor" d="m3.98 3.7 3.36-2.08a4.5 4.5 0 0 1 5.9 1.23 4 4 0 0 1 .7 3.02q-.16.75-.58 1.4c.42.77.56 1.66.4 2.52a3.7 3.7 0 0 1-1.57 2.4l-.17.1-3.36 2.09a4.5 4.5 0 0 1-5.9-1.23 4 4 0 0 1-.66-1.44 4 4 0 0 1-.04-1.58 4 4 0 0 1 .58-1.4 4 4 0 0 1-.4-2.52 3.7 3.7 0 0 1 1.57-2.4zl3.36-2.08zm7.87 0a2.7 2.7 0 0 0-1.26-.95 2.7 2.7 0 0 0-1.6-.07 3 3 0 0 0-.52.2l-.16.09-3.36 2.08a2 2 0 0 0-.69.64 2 2 0 0 0-.36.86 2.3 2.3 0 0 0 .42 1.81A2.7 2.7 0 0 0 7.18 9.4q.28-.06.53-.2l.16-.09 1.28-.79.2-.09a.8.8 0 0 1 .87.31.7.7 0 0 1 .13.55.7.7 0 0 1-.24.4l-.08.05-3.36 2.08-.2.09a1 1 0 0 1-.49-.02 1 1 0 0 1-.38-.3 1 1 0 0 1-.13-.37v-.1l.01-.13-.13-.03a4 4 0 0 1-1.1-.5l-.2-.14-.18-.12-.07.18-.08.3a2.3 2.3 0 0 0 .43 1.82q.45.64 1.19.93.73.28 1.51.14l.16-.04q.27-.07.52-.2l.16-.09 3.36-2.08q.4-.25.69-.64.27-.4.36-.86a2.3 2.3 0 0 0-.42-1.82 2.7 2.7 0 0 0-1.27-.95 2.7 2.7 0 0 0-1.6-.08q-.27.07-.52.2l-.16.1-1.28.79-.2.09a1 1 0 0 1-.49-.03 1 1 0 0 1-.38-.29.7.7 0 0 1-.13-.54.7.7 0 0 1 .24-.4l.08-.06L9.33 4.4l.2-.1a.8.8 0 0 1 .87.32 1 1 0 0 1 .13.38v.22l.11.04q.6.18 1.12.5l.2.14.17.12.06-.19.08-.3a2.3 2.3 0 0 0-.42-1.81z"/>
162
- </symbol>`,mj=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
163
- <path fill="currentColor" d="M5 7a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2z"/>
164
- <path fill="currentColor" d="M6 1a5 5 0 0 1 4.58 3H7a3 3 0 0 0-3 3v3.58A5 5 0 0 1 6 1" opacity=".5"/>
165
- </symbol>`,hj=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
166
- <path fill="currentColor" d="M9.43 4.8A.6.6 0 1 1 9.19 6l-.56.96a1.2 1.2 0 0 1 .32 1.58l.7.53a.89.89 0 1 1-.17.22l-.7-.52a1.2 1.2 0 0 1-1.4.25l-.56.87a.75.75 0 1 1-.57-.2 1 1 0 0 1 .32.05l.56-.87a1.2 1.2 0 0 1-.4-1.24l-1.2-.47a.56.56 0 1 1 .1-.28v.02l1.2.47a1.2 1.2 0 0 1 1.56-.55l.56-.97a.6.6 0 0 1-.15-.64.6.6 0 0 1 .63-.4"/>
167
- <path fill="currentColor" fill-rule="evenodd" d="M9.17 1q.16.63.27 1.26a6 6 0 0 1 1.61.67q.52-.38 1.08-.71l1.65 1.64q-.32.56-.68 1.05.48.78.72 1.67.6.09 1.18.25v2.32q-.55.15-1.11.24a6 6 0 0 1-.7 1.82q.31.44.59.91l-1.65 1.65-.85-.55a6 6 0 0 1-1.9.83q-.08.47-.2.95H6.84q-.12-.46-.2-.93a6 6 0 0 1-1.96-.81q-.39.27-.8.51l-1.65-1.65q.25-.43.53-.84a6 6 0 0 1-.75-1.9L1 9.16V6.83q.54-.14 1.09-.24a6 6 0 0 1 .77-1.74q-.33-.47-.63-.98l1.65-1.65q.54.32 1.03.68a6 6 0 0 1 1.66-.66q.1-.61.26-1.24zM7.96 3.73a4 4 0 0 0-1.74.36 4.5 4.5 0 0 0-2.3 2.3 4.4 4.4 0 0 0-.1 3.29l.03.06a4.4 4.4 0 0 0 2.4 2.47 4.4 4.4 0 0 0 3.48-.02l.03-.02a4.4 4.4 0 0 0 2.3-2.42l.06-.14a4.4 4.4 0 0 0-.2-3.4 4.4 4.4 0 0 0-2.13-2.07L9.47 4a4 4 0 0 0-1.51-.27" clip-rule="evenodd"/>
168
- </symbol>`,gj=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
169
- <path fill="currentColor" d="M9.63 1c6.15 4.35 4.16 9.15 4.16 9.15s1.75 2.05 1.04 3.85c0 0-.72-1.26-1.93-1.26-1.17 0-1.85 1.26-4.2 1.26C3.47 14 1 9.46 1 9.46c4.71 3.22 7.93.94 7.93.94C6.8 9.12 2.29 3 2.29 3c3.93 3.47 5.63 4.39 5.63 4.39-1.01-.87-3.86-5.13-3.86-5.13C6.34 4.66 10.86 8 10.86 8c1.28-3.7-1.23-7-1.23-7"/>
170
- </symbol>`,_j=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
171
- <path fill="currentColor" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" opacity=".4"/>
172
- <path fill="currentColor" d="M11.5 8a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5zM5 12h2.5v-1H5zm3.5 0H11v-1H8.5zM5 10h2.5V9H5zm3.5 0H11V9H8.5zm1-9a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
173
- </symbol>`,vj=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
174
- <path fill="currentColor" fill-rule="evenodd" d="M8 4Q5.2 4 4.5 6.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C8.98 7.23 9.77 8 11.5 8q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C10.52 4.77 9.73 4 8 4M4.5 8Q1.7 8 1 10.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C5.48 11.23 6.26 12 8 12q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C7.02 8.77 6.24 8 4.5 8" clip-rule="evenodd"/>
175
- </symbol>`,yj=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
176
- <path fill="currentColor" d="M1 0v5.05l4.35 2.53V2.53zm9.18 5.34L5.83 2.82v5.05l4.35 2.53zm.47 5.06V5.34L15 2.82v5.05zm-.48 5.6-4.35-2.53V8.42l4.35 2.53z"/>
177
- </symbol>`,bj=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
178
- <path fill="currentColor" fill-rule="evenodd" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" clip-rule="evenodd" opacity=".4"/>
179
- <path fill="currentColor" d="M8.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zm2-2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1zm-1-8a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z"/>
180
- </symbol>`,xj=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
181
- <path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
182
- <path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66m-3 1.57V5.99H3.5v-.9h4.21v.9H6.1v5.22z"/>
183
- </symbol>`,Sj=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
184
- <path fill="currentColor" d="M8.57 14.87c-.18.26-.55.11-.55-.22v-3.18l-.05-.27-.13-.22-.2-.15-.24-.06H4.29c-.26 0-.4-.32-.26-.55L6.08 7c.3-.46 0-1.1-.5-1.1H1.8c-.25 0-.4-.32-.25-.56l2.65-4.2A.3.3 0 0 1 4.46 1h7.9c.26 0 .4.32.26.55l-2.05 3.23c-.29.46 0 1.1.5 1.1h3.12c.26 0 .4.34.24.57z"/>
185
- </symbol>`,Cj=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
186
- <path fill="currentColor" d="m5.11 9.68-2.4 1.84a.6.6 0 0 1-.75-.04l-.77-.7a.6.6 0 0 1 0-.87L3.28 8zm5.52-8.42a.51.51 0 0 1 .87.36V4.8L7.32 8 5.1 6.32z" opacity=".75"/>
187
- <path fill="currentColor" d="M11.1 14.99h.03zM1.96 4.52a.6.6 0 0 1 .75-.04l8.8 6.71v3.19a.51.51 0 0 1-.88.36L1.19 6.1a.6.6 0 0 1 0-.87z" opacity=".65"/>
188
- <path fill="currentColor" d="M11.62 14.91a.9.9 0 0 1-1-.17.51.51 0 0 0 .88-.36V1.62a.51.51 0 0 0-.87-.36.9.9 0 0 1 1-.17l2.87 1.39a.9.9 0 0 1 .5.8v9.44a.9.9 0 0 1-.5.8z"/>
189
- </symbol>`,wj=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
190
- <path fill="currentColor" d="M9.62 2.25 8 5.02 6.38 2.25H1l7 12 7-12z" opacity=".5"/>
191
- <path fill="currentColor" d="M9.54 2.25 8 4.95l-1.54-2.7H4l4 7 4-7z"/>
192
- </symbol>`,Tj=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
193
- <path fill="currentColor" d="M13 1a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h3a2 2 0 1 0 4 0z" class="subtract" opacity=".2"/>
194
- <path fill="currentColor" d="M4.64 11.4h.02l.8-3.4h.91l.73 3.45L7.88 8h.96l-1.25 5h-.97L5.9 9.6 5.1 13h-1L3 8h.98z"/>
195
- <path fill="currentColor" fill-rule="evenodd" d="M13 13h-1.02l-.33-1.11H9.9L9.64 13h-.97l1.26-5h1.54zm-2.49-3.77-.42 1.84h1.32l-.49-1.84z" clip-rule="evenodd"/>
196
- </symbol>`,Ej=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
197
- <path fill="currentColor" d="M14.1 11.79 8.26 15v-2.5l3.64-1.94zm.4-.35V4.73l-2.14 1.2v4.3zm-12.6.35L7.74 15v-2.5L4.1 10.56zm-.4-.35V4.73l2.14 1.2v4.3zm.25-7.15 6-3.29v2.42L3.9 5.47l-.03.01zm12.5 0L8.25 1v2.42l3.85 2.05.03.01z" class="bg" opacity=".4"/>
198
- <path fill="currentColor" d="m7.74 11.93-3.59-1.92v-3.8l3.6 2.02zm.52 0 3.59-1.92v-3.8l-3.6 2.02zM4.4 5.77 8 3.85l3.6 1.93L8 7.8z" class="fg"/>
199
- </symbol>`,Dj=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
200
- <path fill="currentColor" d="M7.5 2A1.5 1.5 0 0 1 9 3.5v3A1.5 1.5 0 0 1 7.5 8h-2v2A1.5 1.5 0 0 0 7 11.5v-1A1.5 1.5 0 0 1 8.5 9h5a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-5A1.5 1.5 0 0 1 7 13.5v-1A2.5 2.5 0 0 1 4.5 10V8h-2A1.5 1.5 0 0 1 1 6.5v-3A1.5 1.5 0 0 1 2.5 2zm1 8a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5zm-6-7a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5z"/>
201
- </symbol>`,Oj=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
202
- <path fill="currentColor" d="m14.73 1.5-7.29 8.82h4.17l-1.73 2.04H5.76L1.27 14.5l7.3-8.91H4.39l1.73-2.05h4.12z"/>
203
- <path fill="currentColor" d="M5.21 3.54 3.56 5.6h-.55v4.73h.83L2.1 12.36H1V3.54zm9.79 0v8.82h-4.3l1.74-2.04h.55V5.68h-.83l1.74-2.14z"/>
204
- </symbol>`,kj=[FA,VA,HA,UA,KA,qA,JA,XA,ZA,QA,$A,ej,tj,sj,lj,uj,gj,_j,bj,xj,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
205
- <path fill="currentColor" d="M4.585 2a2 2 0 0 1 1.028.285l1.788 1.072a1 1 0 0 0 .514.143H12A2 2 0 0 1 13.935 5H0V4a2 2 0 0 1 2-2z" class="bg" opacity=".5"/>
206
- <path fill="currentColor" fill-rule="evenodd" d="M14 12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-1.25h1v-1H0V6h14zM9.9 8.25c-.883 0-1.9.5-1.9.5H7v1h1v1s1.017.5 1.9.5c.884 0 1.6-.672 1.6-1.5s-.716-1.5-1.6-1.5M2 9.75v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1zm-5-1v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1z" class="fg" clip-rule="evenodd"/>
207
- </symbol>`],Aj=[NA,PA,IA,LA,RA,zA,BA,WA,GA,YA,nj,rj,ij,aj,oj,cj,dj,fj,pj,mj,hj,vj,yj,Sj,Cj,wj,Tj,Ej,Dj,Oj];function jj(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
208
- `)}\n</svg>`)}var Mj=jj(MA,kj),Nj={minimal:MA,standard:Mj,complete:jj(Mj,Aj)},Pj={".babelrc":`babel`,".babelrc.json":`babel`,".bash_profile":`bash`,".bashrc":`bash`,".browserslistrc":`browserslist`,".dockerignore":`docker`,".eslintignore":`eslint`,".eslintrc":`eslint`,".eslintrc.cjs":`eslint`,".eslintrc.js":`eslint`,".eslintrc.json":`eslint`,".eslintrc.yaml":`eslint`,".eslintrc.yml":`eslint`,".gitattributes":`git`,".gitignore":`git`,".gitkeep":`git`,".gitmodules":`git`,".oxlintrc.json":`oxc`,".postcssrc":`postcss`,".postcssrc.json":`postcss`,".postcssrc.yaml":`postcss`,".postcssrc.yml":`postcss`,".prettierignore":`prettier`,".prettierrc":`prettier`,".prettierrc.cjs":`prettier`,".prettierrc.js":`prettier`,".prettierrc.json":`prettier`,".prettierrc.mjs":`prettier`,".prettierrc.toml":`prettier`,".prettierrc.yaml":`prettier`,".prettierrc.yml":`prettier`,".stylelintignore":`stylelint`,".stylelintrc":`stylelint`,".stylelintrc.cjs":`stylelint`,".stylelintrc.js":`stylelint`,".stylelintrc.json":`stylelint`,".stylelintrc.mjs":`stylelint`,".stylelintrc.yaml":`stylelint`,".stylelintrc.yml":`stylelint`,".terraform.lock.hcl":`terraform`,".zprofile":`bash`,".zshenv":`bash`,".zshrc":`bash`,"babel.config.cjs":`babel`,"babel.config.js":`babel`,"babel.config.json":`babel`,"babel.config.mjs":`babel`,"biome.json":`biome`,"biome.jsonc":`biome`,"bootstrap.bundle.js":`bootstrap`,"bootstrap.bundle.min.js":`bootstrap`,"bootstrap.css":`bootstrap`,"bootstrap.js":`bootstrap`,"bootstrap.min.css":`bootstrap`,"bootstrap.min.js":`bootstrap`,"bun.lock":`bun`,"bun.lockb":`bun`,"bunfig.toml":`bun`,"claude.md":`claude`,"compose.yaml":`docker`,"compose.yml":`docker`,"docker-compose.override.yml":`docker`,"docker-compose.yaml":`docker`,"docker-compose.yml":`docker`,dockerfile:`docker`,"eslint.config.cjs":`eslint`,"eslint.config.js":`eslint`,"eslint.config.mjs":`eslint`,"eslint.config.mts":`eslint`,"eslint.config.ts":`eslint`,gemfile:`ruby`,"next.config.js":`nextjs`,"next.config.mjs":`nextjs`,"next.config.mts":`nextjs`,"next.config.ts":`nextjs`,"postcss.config.cjs":`postcss`,"postcss.config.js":`postcss`,"postcss.config.mjs":`postcss`,"postcss.config.ts":`postcss`,"prettier.config.cjs":`prettier`,"prettier.config.js":`prettier`,"prettier.config.mjs":`prettier`,rakefile:`ruby`,"readme.md":`markdown`,"stylelint.config.cjs":`stylelint`,"stylelint.config.js":`stylelint`,"stylelint.config.mjs":`stylelint`,"svgo.config.cjs":`svgo`,"svgo.config.js":`svgo`,"svgo.config.mjs":`svgo`,"svgo.config.ts":`svgo`,"tailwind.config.cjs":`tailwind`,"tailwind.config.js":`tailwind`,"tailwind.config.mjs":`tailwind`,"tailwind.config.ts":`tailwind`,"vite.config.js":`vite`,"vite.config.mjs":`vite`,"vite.config.mts":`vite`,"vite.config.ts":`vite`,"webpack.config.babel.js":`webpack`,"webpack.config.cjs":`webpack`,"webpack.config.js":`webpack`,"webpack.config.mjs":`webpack`,"webpack.config.ts":`webpack`},Fj={"7z":`zip`,astro:`astro`,AUTHORS:`text`,avif:`image`,bash:`bash`,bmp:`image`,bz2:`zip`,cfg:`text`,CHANGELOG:`text`,cjs:`javascript`,"code-workspace":`vscode`,conf:`text`,CONTRIBUTORS:`text`,csh:`bash`,css:`css`,csv:`table`,cts:`typescript`,db:`database`,editorconfig:`text`,env:`text`,"env.development":`text`,"env.local":`text`,"env.production":`text`,eot:`font`,erb:`ruby`,fish:`bash`,gemspec:`ruby`,gif:`image`,go:`go`,gql:`graphql`,graphql:`graphql`,gz:`zip`,htm:`html`,html:`html`,icns:`image`,ico:`image`,ini:`text`,jar:`zip`,jpeg:`image`,jpg:`image`,js:`javascript`,json:`json`,json5:`json`,jsonc:`json`,jsonl:`json`,jsx:`javascript`,ksh:`bash`,less:`css`,LICENSE:`text`,log:`text`,markdown:`markdown`,mcp:`mcp`,md:`markdown`,mdx:`markdown`,"mdx.tsx":`markdown`,mjs:`javascript`,mts:`typescript`,ods:`table`,otf:`font`,png:`image`,postcss:`css`,py:`python`,pyi:`python`,pyw:`python`,pyx:`python`,rake:`ruby`,rar:`zip`,rb:`ruby`,rs:`rust`,rst:`text`,rtf:`text`,sass:`css`,scss:`css`,sh:`bash`,sql:`database`,sqlite:`database`,sqlite3:`database`,styl:`css`,svelte:`svelte`,svg:`svg`,swift:`swift`,tar:`zip`,tf:`terraform`,tfstate:`terraform`,tfvars:`terraform`,tgz:`zip`,tif:`image`,tiff:`image`,ts:`typescript`,tsv:`table`,tsx:`typescript`,ttf:`font`,txt:`text`,vue:`vue`,war:`zip`,wasm:`wasm`,wast:`wasm`,wat:`wasm`,webp:`image`,woff:`font`,woff2:`font`,xhtml:`html`,xls:`table`,xlsx:`table`,xz:`zip`,yaml:`yml`,yml:`yml`,zig:`zig`,zip:`zip`,zsh:`bash`},Ij={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},Lj=new Set([`bash`,`css`,`database`,`default`,`font`,`git`,`go`,`html`,`image`,`javascript`,`json`,`markdown`,`mcp`,`python`,`ruby`,`rust`,`swift`,`table`,`text`,`typescript`,`zip`]),Rj=new Set([`complete`]);function zj(e){return Nj[e===`none`?`minimal`:e]}function Bj(e){return`file-tree-builtin-${e}`}function Vj(e){return e!==`none`&&Rj.has(e)}function Hj(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=Pj[t.toLowerCase()];if(i!=null&&(r||Lj.has(i)))return i;for(let e of n){if(r){let t=Ij[e];if(t!=null)return t}let t=Fj[e];if(t!=null&&(r||Lj.has(t)))return t}return`default`}var Uj=`file-tree-container`,Wj=`data-file-tree-style`,Gj=`data-file-tree-unsafe-css`,Kj=`data-file-tree-scrollbar-measure`,qj=`data-file-tree-scrollbar-gutter-measured`,Jj=`--trees-scrollbar-gutter-measured`,Yj=`header`,Xj=`context-menu`,Zj=`context-menu-trigger`;function Qj(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function $j(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(Qj(e)?`none`:`complete`),colored:e.colored??!0}}var eM=e=>e.trim().toLowerCase(),tM=e=>e.split(`/`).at(-1)??e,nM=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function rM(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function iM(e){let t=$j(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set(eM(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let n=tM(o),s=n.toLowerCase(),c=r.get(s);if(c!=null)return rM(c,e);for(let[t,n]of a)if(s.includes(t))return rM(n,e);let l=nM(n);for(let t of l){let n=i.get(t);if(n!=null)return rM(n,e)}let u=Hj(t.set,n,l);if(u!=null&&t.set!==`none`)return{name:Bj(u),remappedFrom:e,token:u}}let s=n?.[e];return s==null?{name:e}:rM(s,e)}}}var aM=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,oM=/^0(?:\.0+)?%?$/;function sM(e){let t=e.indexOf(`(`);if(t<=0||!e.endsWith(`)`))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let r=e.slice(t+1,-1).trim();if(r.length===0)return;let i=r.lastIndexOf(`/`);if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=r.split(`,`);if(e.length===4)return e[3]?.trim()}}function cM(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||aM.test(t))return!0;let n=sM(t);return n!=null&&oM.test(n)}function lM(e){return cM(e)?void 0:e}function uM(e){let t=e.colors??{},n=t[`sideBar.background`]??t[`editor.background`]??e.bg,r=t[`sideBar.foreground`]??t[`editor.foreground`]??e.fg,i=t[`sideBar.border`],a=t[`list.activeSelectionForeground`]??t[`sideBar.foreground`],o=n?.toLowerCase(),s=t[`list.hoverBackground`],c=s?.toLowerCase()===o?void 0:s,l=t[`list.activeSelectionBackground`],u=l?.toLowerCase()===o?t[`list.focusBackground`]??t[`editor.selectionBackground`]:l??t[`editor.selectionBackground`],d=lM(t[`list.focusOutline`])??lM(t.focusBorder),f=t[`input.background`]??n,p=t[`input.border`],m=t[`scrollbarSlider.background`],h=t[`sideBarSectionHeader.foreground`]??r,g=t[`gitDecoration.addedResourceForeground`]??t[`terminal.ansiGreen`]??t[`editorGutter.addedBackground`],_=t[`gitDecoration.modifiedResourceForeground`]??t[`terminal.ansiBlue`]??t[`editorGutter.modifiedBackground`],v=t[`gitDecoration.deletedResourceForeground`]??t[`terminal.ansiRed`]??t[`editorGutter.deletedBackground`],y=e.type===`dark`,b={colorScheme:y?`dark`:`light`,backgroundColor:n??``,color:r??``,borderColor:`var(--trees-theme-sidebar-border, light-dark(oklch(0% 0 0 / 0.15), oklch(100% 0 0 / 0.15)))`,"--trees-theme-sidebar-bg":n??``,"--trees-theme-sidebar-fg":r??``,"--trees-theme-sidebar-header-fg":h??``,"--trees-theme-list-active-selection-fg":a??r??``,"--trees-theme-list-hover-bg":c??(y?`rgba(255,255,255,0.08)`:`rgba(0,0,0,0.06)`),"--trees-theme-list-active-selection-bg":u??`transparent`,"--trees-theme-focus-ring":d??r??``,"--trees-theme-input-bg":f??``};return i!=null&&i!==``&&(b[`--trees-theme-sidebar-border`]=i),p!=null&&p!==``&&(b[`--trees-theme-input-border`]=p),m!=null&&m!==``&&(b[`--trees-theme-scrollbar-thumb`]=m),g!=null&&g!==``&&(b[`--trees-theme-git-added-fg`]=g),_!=null&&_!==``&&(b[`--trees-theme-git-modified-fg`]=_),v!=null&&v!==``&&(b[`--trees-theme-git-deleted-fg`]=v),b}var dM=5,fM=1<<dM,pM=fM*4;function mM(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function hM(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function gM(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function _M(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function vM(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function yM(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function bM(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,wM(e,t)}function xM(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=_M(e).get(t);if(i===void 0)return;let a=i>>dM;e.childVisibleChunkSums[a]+=r}function SM(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=TM(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=fM}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function CM(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>dM;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<dM}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function wM(e,t){if(t.childIds.length<pM){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/fM),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>dM]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function TM(e,t,n,r){let i=Math.min(t.childIds.length,n+fM),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var EM=7,DM=3,OM=1<<DM,kM=4;function AM(e,t,n=0){return e<<kM|n<<DM|t}function jM(e){return e.depthAndFlags>>>kM}function MM(e){return(e.depthAndFlags&OM)>>DM}function NM(e){return(e.depthAndFlags&OM)!==0}function PM(e){return e.depthAndFlags&EM}function FM(e,t){return(PM(e)&t)!==0}function IM(e,t){e.depthAndFlags|=t}function LM(e,t){e.depthAndFlags=AM(t,PM(e),MM(e))}var RM=Symbol(`benchmarkInstrumentation`);function zM(e,t){return t==null||Object.defineProperty(e,RM,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function BM(e){return e==null?null:e[RM]??null}function VM(e,t,n){return e==null?n():e.measurePhase(t,n)}function HM(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function UM(e){return e>=48&&e<=57}function WM(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!UM(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&UM(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function GM(e){let t=e.toLowerCase();return{lowerValue:t,tokens:WM(t)}}function KM(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function qM(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=KM(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function JM(e,t,n){let r=qM(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function YM(e,t){return JM(e,t,GM)}function XM(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function ZM(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=XM(e,r);return a===XM(t,r)?YM(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function QM(e,t){return ZM(e,t)}function $M(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=GM(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=XM(e,n);return o===XM(t,n)?JM(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function eN(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=GM(r);return e.sortKeyById[t]=i,i}function tN(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function nN(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function rN(e){let{hasTrailingSlash:t,segments:n}=nN(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function iN(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=nN(e);return{requiresDirectory:t,segments:n}}var aN=``;function oN(){let e=new Map;return e.set(aN,0),{idByValue:e,valueById:[aN],sortKeyById:[GM(aN)]}}function sN(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function cN(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var lN=Symbol(`pathStorePreparedInputKind`);function uN(e,t){return e[lN]=t,e}function dN(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function fN(e,t,n){return n===`default`?QM(e,t):n(dN(e),dN(t))}function pN(){return{depthAndFlags:AM(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function mN(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function hN(e){return e.isDirectory?e.segments.length:e.segments.length-1}function gN(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function _N(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function vN(e,t={}){return wN(e,t).map(e=>e.path)}function yN(e,t={}){let n=wN(e,t);return uN({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function bN(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return uN({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function xN(e){let t=e,n=t.preparedPaths;if(t[lN]===`prepared`&&n!=null)return n;if(!gN(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function SN(e){let t=e;return t[lN]===`presorted`&&t.presortedPaths!=null||_N(t.presortedPaths)?t.presortedPaths:null}function CN(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function wN(e,t={}){let n=tN(t),r=BM(t);HM(r,`workload.inputFiles`,e.length);let i=VM(r,`store.preparePathEntries.parse`,()=>e.map(e=>rN(e)));return VM(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>fN(e,t,n.sort))),i}var TN=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[pN()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=oN();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=BM(e),this.options=tN(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,mM())}appendPaths(e){return VM(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>rN(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,VM(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return VM(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null)if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:AM(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:AM(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:AM(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=rN(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null)if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:AM(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:AM(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=rN(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(VM(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||VM(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort===`default`?$M(this.lastPreparedPath,e,this.segmentSortKeyCache):fN(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=hN(e),i=n==null?0:hN(n),a=n==null?0:mN(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=sN(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:AM(jM(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),vM(i,s),s}createFileChildUnchecked(e,t){let n=sN(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:AM(jM(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),vM(r,a),a}getOrCreateDirectoryChild(e,t){let n=sN(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!NM(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:AM(jM(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),vM(r,a),this.directories.set(a,mM()),a}createDirectoryChild(e,t){let n=sN(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:AM(jM(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),vM(r,a),this.directories.set(a,mM()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!NM(n))throw Error(`Path is not a directory: "${t}"`);if(FM(n,1))throw Error(`Duplicate path: "${t}"`);IM(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,hM());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(NM(a)){let t=hM();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;NM(n)&&this.directories.set(t,mM());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),vM(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!NM(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return bM(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function EN(e,t=`closed`,n=null){let r=ON(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function DN(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function ON(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function kN(e,t){return FM(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion===`closed`?!1:jM(t)<=e.defaultExpansion}function AN(e,t,n=e.snapshot.nodes[t]){return n==null||!NM(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:kN(e,n)}function jN(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!NM(r))return;let i=kN(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function MN(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function NN(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function PN(e,t){let n=MN(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function FN(e,t){let n=MN(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function IN(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function LN(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function RN(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function zN(e,t){e.directoryLoadInfoById.delete(t)}function BN(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function VN(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function HN(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function UN(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function WN(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function GN(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function KN(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function qN(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function JN(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function YN(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function XN(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function ZN(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function QN(e,t,n){return{...n,visibleCountDelta:lP(e)-t}}function $N(e,t){let n=lP(e),r=DN();e.transactionStack.push(r);try{t()}catch(t){throw nP(e,r,!1),t}nP(e,r,!0,lP(e)-n)}function eP(e,t){let n=e.instrumentation;if(n==null){tP(e,t);return}VM(n,`store.events.record`,()=>tP(e,t))}function tP(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){sP(e,t);return}n.events.push(t),oP(n,t)}function nP(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?aP(i,t):VM(n,`store.events.batch.merge`,()=>aP(i,t));return}let a=rP(t,r),o=e.instrumentation;if(o==null){sP(e,a);return}VM(o,`store.events.batch.commit`,()=>sP(e,a))}function rP(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function iP(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function aP(e,t){for(let n of t.events)e.events.push(n);iP(e,t)}function oP(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function sP(e,t){let n=e.instrumentation;if(n==null){cP(e,t);return}VM(n,`store.events.emit`,()=>cP(e,t))}function cP(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function lP(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function uP(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!NM(n)||FM(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!NM(a)?null:i}function dP(e,t){let n=t;for(;;){let t=uP(e,n);if(t==null)return n;n=t}}function fP(e,t){let n=[t],r=t;for(;;){let t=uP(e,r);if(t==null)return n;n.push(t),r=t}}function pP(e,t){let n=t==null?e.snapshot.rootId:CP(e,t);return n==null?[]:DP(e,n)}function mP(e,t){let n=rN(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=HP(e,VP(e,r)),{createdNodeIds:a,directoryId:o}=OP(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=EP(e,o);if(FM(n,1))throw Error(`Path already exists: "${t}"`);IM(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=AP(e,o,n.basename),s.add(c);bP(e,o);let l=HP(e,o);return VN({affectedAncestorIds:SP(e,c),affectedNodeIds:[...s],path:t,projectionChanged:UP(i,l)})}function hP(e,t,n){let r=CP(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=EP(e,r);if(FM(i,2))throw Error(`The root node cannot be removed`);if(NM(i)&&TP(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=HP(e,a),s=zP(e,r);NP(e,a,r,i.nameId),BP(e,a),bP(e,a);let c=HP(e,a);return HN({affectedAncestorIds:SP(e,a),affectedNodeIds:s,path:t,projectionChanged:UP(o,c),recursive:n.recursive===!0})}function gP(e,t,n,r){let i=CP(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=EP(e,i);if(FM(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=LP(e,i,n),c=HP(e,a.parentId),l=HP(e,s.parentId),u=cN(e.snapshot.segmentTable,a.nameId),d=sN(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(NM(a)&&qP(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=gM(e.snapshot.nodes,TP(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&RP(e,p,o,MM(a))===`skip`)return null;let m=a.parentId;NP(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),KP(e,i),MP(e,s.parentId,i),BP(e,m),e.pathCacheVersion++,bP(e,m),s.parentId!==m&&bP(e,s.parentId);let h=HP(e,m),g=HP(e,s.parentId);return UN({affectedAncestorIds:[...new Set([...SP(e,m),...SP(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:WP([c,l],[h,g]),to:yP(e,i)})}function _P(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function vP(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function yP(e,t){let n=EP(e,t),r=_P(e,t);if(r!=null)return r;if(FM(n,2))return vP(e,t,``);let i=yP(e,n.parentId),a=cN(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return vP(e,t,NM(n)?`${o}/`:o)}function bP(e,t){let n=e.instrumentation;if(n==null){YP(e,t);return}VM(n,`store.recomputeCountsUpwardFrom`,()=>YP(e,t))}function xP(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!NM(o)){JP(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){JP(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function SP(e,t){let n=[],r=t;for(;r!=null;){let t=EP(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function CP(e,t){if(t.length===0)return e.snapshot.rootId;let n=iN(t);return wP(e,n.segments,n.requiresDirectory)}function wP(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=TP(e,r),a=gM(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=EP(e,r);return n&&!NM(i)?null:r}function TP(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function EP(e,t){let n=e.snapshot.nodes[t];if(n===void 0||FM(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function DP(e,t){let n=e.snapshot.nodes[t];if(n===void 0||FM(n,4))return[];if(!NM(n))return[yP(e,t)];if(TP(e,t).childIds.length===0)return FM(n,1)&&!FM(n,2)?[yP(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||FM(n,4)){i.pop();continue}if(!NM(n)){r.push(yP(e,t.nodeId)),i.pop();continue}let a=TP(e,t.nodeId);if(a.childIds.length===0){FM(n,1)&&!FM(n,2)&&r.push(yP(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function OP(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=sN(e.snapshot.segmentTable,i),a=TP(e,r),o=gM(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!NM(EP(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=kP(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function kP(e,t,n){let r=EP(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:AM(jM(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,mM()),MP(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function AP(e,t,n){let r=sN(e.snapshot.segmentTable,n),i=TP(e,t);if(gM(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${ZP(e,t,n)}"`);let a=EP(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:AM(jM(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),MP(e,t,o),e.activeNodeCount++,o}function jP(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}PP(e,n,o)<0?i=a:r=a+1}return r}function MP(e,t,n){let r=TP(e,t),i=EP(e,n);gM(e.snapshot.nodes,r).set(i.nameId,n),xM(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=jP(e,r,n);r.childIds.splice(a,0,n),yM(r,a),wM(e.snapshot.nodes,r)}function NP(e,t,n,r){let i=TP(e,t),a=_M(i),o=a.get(n)??-1;gM(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&xM(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),yM(i,o),wM(e.snapshot.nodes,i))}function PP(e,t,n){let r=e.snapshot.options.sort;return r===`default`?FP(e,t,n):r(IP(e,t),IP(e,n))}function FP(e,t,n){let r=EP(e,t),i=EP(e,n),a=NM(r);if(a!==NM(i))return a?-1:1;let o=qM(eN(e.snapshot.segmentTable,r.nameId),eN(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=cN(e.snapshot.segmentTable,r.nameId),c=cN(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function IP(e,t){let n=EP(e,t),r=yP(e,t),i=NM(n),a=i?r.slice(0,-1):r;return{basename:cN(e.snapshot.segmentTable,n.nameId),depth:jM(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function LP(e,t,n){let r=EP(e,t),i=CP(e,n);if(i!=null){let t=EP(e,i);if(NM(t))return{basename:cN(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=iN(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=iN(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:wP(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function RP(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${yP(e,t)}"`);let i=EP(e,t);if(MM(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(NM(i)&&TP(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return zP(e,t),NP(e,a,t,o),BP(e,a),bP(e,a),`handled`}function zP(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=EP(e,t.nodeId);if(t.visitedChildren||!NM(i)){NM(i)&&e.snapshot.directories.delete(t.nodeId),IM(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),zN(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=TP(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function BP(e,t){let n=t;for(;n!=null;){let t=EP(e,n);if(!NM(t)||FM(t,2)||TP(e,n).childIds.length>0)return;IM(t,1),n=t.parentId===n?null:t.parentId}}function VP(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=gM(e.snapshot.nodes,TP(e,n)).get(t);if(i==null||!NM(EP(e,i)))break;n=i}return n}function HP(e,t){let n=GP(e,t);if(n==null)return null;let r=dP(e,n),i=EP(e,r),a=n===r?null:fP(e,n).map(t=>yP(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:TP(e,r).childIds.length>0,path:yP(e,r),terminalKind:MM(i)})}function UP(e,t){return WP([e],[t])}function WP(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function GP(e,t){let n=t;for(;n!=null;){let t=EP(e,n);if(!NM(t)||FM(t,2))return null;if(!AN(e,n,t))return n;n=t.parentId}return null}function KP(e,t){let n=EP(e,t);if(LM(n,(t===e.snapshot.rootId?-1:jM(EP(e,n.parentId)))+1),!NM(n))return;let r=TP(e,t);for(let t of r.childIds)KP(e,t)}function qP(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=EP(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function JP(e,t,n=EP(e,t),r=!1){let i=e.instrumentation;if(i==null){XP(e,t,n,r);return}VM(i,`store.recomputeNodeCounts`,()=>XP(e,t,n,r))}function YP(e,t){let n=t;for(;n!=null;){let t=EP(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(JP(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&xM(TP(e,s),n,a,o),n=s}}function XP(e,t,n,r){if(!NM(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=TP(e,t);if(r){let t=e.instrumentation;t==null?bM(e.snapshot.nodes,i):VM(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>bM(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,FM(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=uP(e,t)==null?AN(e,t,n)?1+o:1:o}function ZP(e,t,n){let r=yP(e,t);return r.length===0?n:`${r}${n}`}function QP(e){return e!=null&&!FM(e,4)}function $P(e,t){let n=e.snapshot.nodes[t];return!QP(n)||!NM(n)||FM(n,2)?null:n}function eF(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&QP(e.snapshot.nodes[n])&&(t+=1);return t}function tF(e){return Math.max(0,e.valueById.length-1)}function nF(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:eF(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:tF(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function rF(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function iF(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)$P(e,n)!=null&&t.push(yP(e,n));for(let t of e.expandedDirectoryIds)$P(e,t)!=null&&n.push(yP(e,t));return{collapsedPaths:t,expandedPaths:n}}function aF(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)$P(e,n)==null||NN(e,n)===`loaded`||t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:yP(e,n)});return t}function oF(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=CP(e,n);t!=null&&jN(e,t,!0,EP(e,t))}for(let n of t.collapsedPaths){let t=CP(e,n);t!=null&&jN(e,t,!1,EP(e,t))}}function sF(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=CP(e,n.path);t!=null&&$P(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function cF(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function lF(e){let t=e.snapshot.segmentTable,n=oN();for(let r of e.snapshot.nodes)if(QP(r)){if(FM(r,2)){r.nameId=0;continue}r.nameId=sN(n,cN(t,r.nameId))}e.snapshot.segmentTable=n}function uF(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!QP(r)||!NM(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return QP(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[EP(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),bM(e.snapshot.nodes,n)}}function dF(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(QP(n))break;--t}e.snapshot.nodes.length=t+1}function fF(e){let t=iF(e),n=aF(e);VM(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>cF(e)),VM(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>lF(e)),VM(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>uF(e)),VM(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>dF(e)),VM(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>oF(e,t)),VM(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>sF(e,n)),VM(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>xP(e,e.snapshot.rootId))}function pF(e){let t=iF(e),n=aF(e),r=VM(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>pP(e)),i=zM({...e.snapshot.options},e.instrumentation),a=VM(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new TN(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,VM(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>oF(e,t)),VM(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>sF(e,n)),VM(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>xP(e,e.snapshot.rootId))}function mF(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function hF(e,t){let n=nF(e);t===`stable`?VM(e.instrumentation,`store.cleanup.stable`,()=>fF(e)):VM(e.instrumentation,`store.cleanup.aggressive`,()=>pF(e));let r=nF(e);return rF(t,t===`stable`,n,r)}var gF=64;function _F(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function vF(e){return EP(e,e.snapshot.rootId).visibleSubtreeCount}function yF(e,t,n,r){let i=EP(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function bF(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:zF(e,t.cursor),setSize:t.setSize,subtreeEndIndex:yF(e,t.cursor,t.index,n)}}function xF(e,t,n,r,i,a){let o=TP(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=SM(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return SF(e,u,l,r+c,i+1,s,o.childIds.length,a)}function SF(e,t,n,r,i,a,o,s){if(!NM(EP(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=NF(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=EP(e,c.terminalNodeId);if(!NM(l)||!AN(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return xF(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function CF(e,t){let n=vF(e);if(t<0||t>=n)return null;let r=xF(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>yP(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=bF(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:zF(e,r.cursor),setSize:r.setSize,subtreeEndIndex:yF(e,r.cursor,r.index,n)}}function wF(e,t,n){let r=e.instrumentation,i=vF(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return RF(e,o+1);let t=[],n=AF(e,a);for(let r=a;r<=o&&n!=null;r++){let r=zF(e,n);t.push(r),n=FF(e,n)}return t}let s=[],c=0,l=0,u=VM(r,`store.getVisibleSlice.selectFirstRow`,()=>AF(e,a));for(let t=a;t<=o&&u!=null;t++){let t=VM(r,`store.getVisibleSlice.materializeRow`,()=>zF(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=VM(r,`store.getVisibleSlice.advanceCursor`,()=>FF(e,u))}return HM(r,`workload.visibleRowsRead`,s.length),HM(r,`workload.flattenedRowsRead`,c),HM(r,`workload.flattenedSegmentsRead`,l),s}function TF(e,t=vF(e)){let n=e.instrumentation;return n==null?LF(e,t):VM(n,`store.getVisibleTreeProjection`,()=>LF(e,t))}function EF(e){return IF(TF(e))}function DF(e,t){let n=CP(e,t);if(n==null||n===e.snapshot.rootId||NM(EP(e,n))&&dP(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=EP(e,i).parentId,n=TP(e,t),s=_M(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=CM(a,n,s),t!==o){let n=EP(e,t),a=uP(e,t);if(!AN(e,t,n)&&a!==i)return null;dP(e,t)===t&&(r+=1)}i=t}return r}function OF(e,t){let n=CP(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=EP(e,n);if(!NM(r))throw Error(`Path is not a directory: "${t}"`);return AN(e,n,r)?null:(jN(e,n,!0,r),bP(e,n),WN({affectedAncestorIds:SP(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function kF(e,t){let n=CP(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=EP(e,n);if(!NM(r))throw Error(`Path is not a directory: "${t}"`);return AN(e,n,r)?(jN(e,n,!1,r),bP(e,n),GN({affectedAncestorIds:SP(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function AF(e,t){return t<0||t>=vF(e)?null:jF(e,e.snapshot.rootId,t,-1)}function jF(e,t,n,r){let i=TP(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?SM(e.snapshot.nodes,i,n):VM(a,`store.getVisibleSlice.selectChildIndex`,()=>SM(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return MF(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function MF(e,t,n,r){if(!NM(EP(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=NF(e,t,r);if(n===0)return i;let a=EP(e,i.terminalNodeId);if(!NM(a)||!AN(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return jF(e,i.terminalNodeId,n-1,i.visibleDepth)}function NF(e,t,n){return NM(EP(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:dP(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:VM(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>dP(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function PF(e,t){let n=EP(e,t);if(!NM(n))return!0;let r=n.parentId;return r===e.snapshot.rootId?!0:uP(e,r)!==t}function FF(e,t){let n=EP(e,t.terminalNodeId);if(NM(n)){let r=TP(e,t.terminalNodeId);if(AN(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:MF(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=EP(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=TP(e,n),o=_M(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return MF(e,s,0,i);PF(e,r)&&i--,r=n}}function IF(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function LF(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(gF);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=_F(o,y);let x,S=_;if(NM(v))S=f?dP(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:yP(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&NM(C)&&AN(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function RF(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!NM(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:yP(e,f)};continue}let h=l?dP(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=zF(e,g);let _=i[h];_!=null&&NM(_)&&AN(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function zF(e,t){let n=EP(e,t.terminalNodeId),r=NM(n)?BF(e,t):null,i=yP(e,t.terminalNodeId),a=cN(e.snapshot.segmentTable,n.nameId),o=NM(n)&&TP(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?fP(e,t.headNodeId).map(n=>{let r=EP(e,n);return{isTerminal:n===t.terminalNodeId,name:cN(e.snapshot.segmentTable,r.nameId),nodeId:n,path:yP(e,n)}}):VM(c,`store.getVisibleSlice.flatten.collectSegments`,()=>fP(e,t.headNodeId).map(n=>{let r=EP(e,n);return{isTerminal:n===t.terminalNodeId,name:cN(e.snapshot.segmentTable,r.nameId),nodeId:n,path:yP(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:NM(n)&&AN(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:NM(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function BF(e,t){if(t.headNodeId===t.terminalNodeId)return NN(e,t.terminalNodeId);let n=fP(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=NN(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}function VF(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!NM(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&wM(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&NM(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,wM(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function HF(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var UF=class e{#e;constructor(e={}){let t=BM(e),n=VM(t,`store.builder.create`,()=>new TN(e));if(e.preparedInput!=null){let t=SN(e.preparedInput);t==null?n.appendPreparedPaths(xN(e.preparedInput),!1):n.appendPresortedPaths(t,CN(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(VM(t,`store.preparePathEntries`,()=>wN(r,e)))}let r=VM(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=VM(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=VM(t,`store.state.create`,()=>EN(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:VM(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||HF(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&VM(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?VM(t,`store.state.initializeOpenVisibleCounts`,()=>VF(this.#e)):VM(t,`store.state.recomputeCounts`,()=>xP(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return vN(e,t)}static prepareInput(e,t={}){return yN(e,t)}static preparePresortedInput(e){return bN(e)}list(e){return VM(this.#e.instrumentation,`store.list`,()=>pP(this.#e,e))}add(e){VM(this.#e.instrumentation,`store.add`,()=>{let t=vF(this.#e);eP(this.#e,QN(this.#e,t,mP(this.#e,e)))})}remove(e,t={}){VM(this.#e.instrumentation,`store.remove`,()=>{let n=vF(this.#e);eP(this.#e,QN(this.#e,n,hP(this.#e,e,t)))})}move(e,t,n={}){VM(this.#e.instrumentation,`store.move`,()=>{let r=vF(this.#e),i=gP(this.#e,e,t,n);i!=null&&eP(this.#e,QN(this.#e,r,i))})}batch(e){$N(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision});break}})}getVisibleCount(){return VM(this.#e.instrumentation,`store.getVisibleCount`,()=>vF(this.#e))}getVisibleSlice(e,t){return VM(this.#e.instrumentation,`store.getVisibleSlice`,()=>wF(this.#e,e,t))}getVisibleRowContext(e){return VM(this.#e.instrumentation,`store.getVisibleRowContext`,()=>CF(this.#e,e))}getVisibleTreeProjection(){return EF(this.#e)}getVisibleTreeProjectionData(e){return TF(this.#e,e)}getVisibleIndex(e){return VM(this.#e.instrumentation,`store.getVisibleIndex`,()=>DF(this.#e,e))}getPathInfo(e){return VM(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=CP(this.#e,e);if(t==null)return null;let n=EP(this.#e,t);return{depth:jM(n),kind:NM(n)?`directory`:`file`,path:yP(this.#e,t)}})}isExpanded(e){return VM(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=EP(this.#e,t);return AN(this.#e,t,n)})}expand(e){VM(this.#e.instrumentation,`store.expand`,()=>{let t=vF(this.#e),n=OF(this.#e,e);n!=null&&eP(this.#e,QN(this.#e,t,n))})}collapse(e){VM(this.#e.instrumentation,`store.collapse`,()=>{let t=vF(this.#e),n=kF(this.#e,e);n!=null&&eP(this.#e,QN(this.#e,t,n))})}on(e,t){return BN(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return NN(this.#e,t)}markDirectoryUnloaded(e){VM(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(TP(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=vF(this.#e);FN(this.#e,t),eP(this.#e,QN(this.#e,n,KN({affectedAncestorIds:SP(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return VM(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=vF(this.#e),r=PN(this.#e,t);return eP(this.#e,QN(this.#e,n,qN({affectedAncestorIds:SP(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return VM(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||NN(this.#e,n)!==`loading`||!LN(this.#e,n,e.attemptId))return!1;let r=yP(this.#e,n);this.validateChildPatch(r,t);let i=vF(this.#e),a=[];for(let e of t.operations){WF(r,e);let t=vF(this.#e);switch(e.type){case`add`:a.push(QN(this.#e,t,mP(this.#e,e.path)));break;case`remove`:a.push(QN(this.#e,t,hP(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=gP(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(QN(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return eP(this.#e,QN(this.#e,i,JN({affectedAncestorIds:SP(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:yP(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return VM(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=vF(this.#e),r=IN(this.#e,t,e.attemptId);return eP(this.#e,QN(this.#e,n,YN({affectedAncestorIds:SP(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:yP(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return VM(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=vF(this.#e),i=RN(this.#e,n,e.attemptId,t);return eP(this.#e,QN(this.#e,r,XN({affectedAncestorIds:SP(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:yP(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return VM(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(mF(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=vF(this.#e),n=hF(this.#e,e.mode??`stable`);return eP(this.#e,QN(this.#e,t,ZN({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=TP(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??GM(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=qM(eN(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!NM(EP(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=EP(this.#e,n);AN(this.#e,n,i)||(jN(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=EP(this.#e,e);if(!AN(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=CP(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!NM(EP(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!NM(EP(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=EP(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=EP(this.#e,e),r=uP(this.#e,e);if(!AN(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function WF(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`);break}}var GF={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function KF(e,t){if(typeof e==`number`)return{itemHeight:t??GF.default.itemHeight,factor:e};let n=GF[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var qF=GF.default.itemHeight,JF=`@layer base, theme, unsafe;
209
-
210
- @layer base {
211
- :host {
212
- /*
213
- CSS variables use a fallback stack to ensure user and theme colors slot
214
- in with ease. User colors take precedence over theme colors, which take
215
- precedence over defaults.
216
-
217
- Fallback order:
218
-
219
- 1. --trees-*-override (explicit)
220
- 2. --trees-theme-* (e.g. Shiki/VS Code tokens)
221
- 3. defaults
222
-
223
- Theme variable names mirror Shiki/VS Code theme file JSON tokens.
224
-
225
- // Available CSS Color Overrides
226
- --trees-fg-override
227
- --trees-fg-muted-override
228
- --trees-bg-override
229
- --trees-bg-muted-override
230
- --trees-accent-override
231
- --trees-border-color-override
232
-
233
- --trees-focus-ring-color-override
234
- --trees-focus-ring-width-override
235
- --trees-focus-ring-offset-override
236
-
237
- --trees-search-fg-override
238
- --trees-search-font-weight-override
239
- --trees-search-bg-override
240
-
241
- --trees-selected-fg-override
242
- --trees-selected-bg-override
243
- --trees-selected-focused-border-color-override
244
-
245
- // Git Status Color Overrides
246
- --trees-status-added-override
247
- --trees-status-ignored-override
248
- --trees-status-modified-override
249
- --trees-status-renamed-override
250
- --trees-status-untracked-override
251
- --trees-status-deleted-override
252
- --trees-git-added-color-override
253
- --trees-git-ignored-color-override
254
- --trees-git-modified-color-override
255
- --trees-git-renamed-color-override
256
- --trees-git-untracked-color-override
257
- --trees-git-deleted-color-override
258
-
259
- // Built-in File Icon Color Overrides
260
- --trees-file-icon-color
261
- --trees-file-icon-color-astro
262
- --trees-file-icon-color-babel
263
- --trees-file-icon-color-bash
264
- --trees-file-icon-color-biome
265
- --trees-file-icon-color-bootstrap
266
- --trees-file-icon-color-browserslist
267
- --trees-file-icon-color-bun
268
- --trees-file-icon-color-claude
269
- --trees-file-icon-color-css
270
- --trees-file-icon-color-database
271
- --trees-file-icon-color-default
272
- --trees-file-icon-color-docker
273
- --trees-file-icon-color-eslint
274
- --trees-file-icon-color-git
275
- --trees-file-icon-color-go
276
- --trees-file-icon-color-graphql
277
- --trees-file-icon-color-html
278
- --trees-file-icon-color-image
279
- --trees-file-icon-color-javascript
280
- --trees-file-icon-color-json
281
- --trees-file-icon-color-markdown
282
- --trees-file-icon-color-mcp
283
- --trees-file-icon-color-npm
284
- --trees-file-icon-color-oxc
285
- --trees-file-icon-color-postcss
286
- --trees-file-icon-color-prettier
287
- --trees-file-icon-color-python
288
- --trees-file-icon-color-react
289
- --trees-file-icon-color-ruby
290
- --trees-file-icon-color-rust
291
- --trees-file-icon-color-sass
292
- --trees-file-icon-color-svg
293
- --trees-file-icon-color-svelte
294
- --trees-file-icon-color-svgo
295
- --trees-file-icon-color-swift
296
- --trees-file-icon-color-table
297
- --trees-file-icon-color-text
298
- --trees-file-icon-color-tailwind
299
- --trees-file-icon-color-terraform
300
- --trees-file-icon-color-typescript
301
- --trees-file-icon-color-vite
302
- --trees-file-icon-color-vscode
303
- --trees-file-icon-color-vue
304
- --trees-file-icon-color-wasm
305
- --trees-file-icon-color-webpack
306
- --trees-file-icon-color-yml
307
- --trees-file-icon-color-zig
308
- --trees-file-icon-color-zip
309
-
310
- // Density
311
- //
312
- // A unitless scale factor for padding, gaps, and indentation. Usually
313
- // set via \`density\` on useFileTree. Individual overrides take precedence.
314
- //
315
- // Compact: 0.8
316
- // Default: 1
317
- // Relaxed: 1.2
318
- //
319
- --trees-density-override
320
-
321
- // Available CSS Layout Overrides
322
- --trees-gap-override
323
- --trees-border-radius-override
324
- --trees-font-family-override
325
- --trees-font-size-override
326
- --trees-font-weight-regular-override
327
- --trees-font-weight-semibold-override
328
- --trees-level-gap-override
329
- --trees-item-padding-x-override
330
- --trees-item-margin-x-override
331
- --trees-item-row-gap-override
332
- --trees-icon-width-override
333
- --trees-icon-nudge-override
334
- --trees-scrollbar-gutter-override
335
- --trees-padding-inline-override
336
- */
337
-
338
- --trees-accent: var(--trees-accent-override, #009fff);
339
- --trees-fg: var(
340
- --trees-fg-override,
341
- var(--trees-theme-sidebar-fg, light-dark(#6c6c71, #adadb1))
342
- );
343
- --trees-fg-muted: var(
344
- --trees-fg-muted-override,
345
- var(--trees-theme-sidebar-header-fg, light-dark(#84848a, #84848a))
346
- );
347
- --trees-bg: var(
348
- --trees-bg-override,
349
- var(--trees-theme-sidebar-bg, light-dark(#f8f8f8, #141415))
350
- );
351
- /* var(--trees-theme-list-hover-bg, light-dark(#dfebff59, #19283c59)) */
352
- --trees-bg-muted: var(
353
- --trees-bg-muted-override,
354
- var(
355
- --trees-theme-list-hover-bg,
356
- light-dark(
357
- color-mix(
358
- in lab,
359
- var(--trees-accent) var(--trees-bg-alpha-light, 8%),
360
- var(--trees-bg)
361
- ),
362
- color-mix(
363
- in lab,
364
- var(--trees-accent) var(--trees-bg-alpha-dark, 10%),
365
- var(--trees-bg)
366
- )
367
- )
368
- )
369
- );
370
- --trees-input-bg: var(
371
- --trees-input-bg-override,
372
- light-dark(#f8f8f8, #070707)
373
- );
374
-
375
- --trees-added-light: #16a994;
376
- --trees-added-dark: #00cab1;
377
- --trees-ignored-light: #adadb1;
378
- --trees-ignored-dark: #4a4a4e;
379
- --trees-modified-light: #1ca1c7;
380
- --trees-modified-dark: #08c0ef;
381
- --trees-renamed-light: #d5a910;
382
- --trees-renamed-dark: #ffd452;
383
- --trees-untracked-light: #16a994;
384
- --trees-untracked-dark: #00cab1;
385
- --trees-deleted-light: #ff2e3f;
386
- --trees-deleted-dark: #ff6762;
387
-
388
- --trees-border-color: var(
389
- --trees-border-color-override,
390
- var(--trees-theme-sidebar-border, light-dark(#eeeeef, #070707))
391
- );
392
- --trees-indent-guide-bg: var(
393
- --trees-indent-guide-bg-override,
394
- color-mix(in lab, var(--trees-fg-muted) 25%, transparent)
395
- );
396
- --trees-density: var(--trees-density-override, 1);
397
- --trees-border-radius: var(
398
- --trees-border-radius-override,
399
- calc(6px * var(--trees-density))
400
- );
401
-
402
- --trees-font-family: var(--trees-font-family-override, system-ui);
403
- --trees-font-size: var(--trees-font-size-override, 13px);
404
- --trees-font-weight-regular: var(--trees-font-weight-regular-override, 400);
405
- --trees-font-weight-semibold: var(
406
- --trees-font-weight-semibold-override,
407
- 600
408
- );
409
-
410
- --trees-focus-ring-color: var(
411
- --trees-focus-ring-color-override,
412
- var(--trees-theme-focus-ring, var(--trees-accent))
413
- );
414
- --trees-focus-ring-width: var(--trees-focus-ring-width-override, 1px);
415
- --trees-focus-ring-offset: var(--trees-focus-ring-offset-override, -1px);
416
-
417
- --trees-search-fg: var(
418
- --trees-search-fg-override,
419
- var(--trees-theme-input-fg, var(--trees-fg))
420
- );
421
- --trees-search-font-weight: var(--trees-search-font-weight-override, 600);
422
- --trees-search-bg: var(
423
- --trees-search-bg-override,
424
- var(--trees-theme-input-bg, var(--trees-input-bg))
425
- );
426
-
427
- --trees-scrollbar-thumb: var(
428
- --trees-scrollbar-thumb-override,
429
- var(
430
- --trees-theme-scrollbar-thumb,
431
- color-mix(in lab, var(--trees-fg) 25%, var(--trees-bg))
432
- )
433
- );
434
-
435
- --trees-selected-fg: var(
436
- --trees-selected-fg-override,
437
- var(--trees-theme-list-active-selection-fg, var(--trees-fg))
438
- );
439
- --trees-selected-bg: var(
440
- --trees-selected-bg-override,
441
- var(
442
- --trees-theme-list-active-selection-bg,
443
- light-dark(
444
- color-mix(in lab, var(--trees-accent) 12%, var(--trees-bg)),
445
- color-mix(in lab, var(--trees-accent) 15%, var(--trees-bg))
446
- )
447
- )
448
- );
449
- --trees-selected-focused-border-color: var(
450
- --trees-selected-focused-border-color-override,
451
- var(--trees-theme-focus-ring, var(--trees-accent))
452
- );
453
-
454
- /* Git status (e.g. from Shiki theme gitDecoration.*) */
455
- --trees-status-added: var(
456
- --trees-status-added-override,
457
- var(
458
- --trees-theme-git-added-fg,
459
- light-dark(var(--trees-added-light), var(--trees-added-dark))
460
- )
461
- );
462
- --trees-status-ignored: var(
463
- --trees-status-ignored-override,
464
- var(
465
- --trees-theme-git-ignored-fg,
466
- light-dark(var(--trees-ignored-light), var(--trees-ignored-dark))
467
- )
468
- );
469
- --trees-status-modified: var(
470
- --trees-status-modified-override,
471
- var(
472
- --trees-theme-git-modified-fg,
473
- light-dark(var(--trees-modified-light), var(--trees-modified-dark))
474
- )
475
- );
476
- --trees-status-renamed: var(
477
- --trees-status-renamed-override,
478
- var(
479
- --trees-theme-git-renamed-fg,
480
- light-dark(var(--trees-renamed-light), var(--trees-renamed-dark))
481
- )
482
- );
483
- --trees-status-untracked: var(
484
- --trees-status-untracked-override,
485
- var(
486
- --trees-theme-git-untracked-fg,
487
- light-dark(var(--trees-untracked-light), var(--trees-untracked-dark))
488
- )
489
- );
490
- --trees-status-deleted: var(
491
- --trees-status-deleted-override,
492
- var(
493
- --trees-theme-git-deleted-fg,
494
- light-dark(var(--trees-deleted-light), var(--trees-deleted-dark))
495
- )
496
- );
497
- --trees-git-modified-color: var(
498
- --trees-git-modified-color-override,
499
- var(--trees-status-modified)
500
- );
501
- --trees-git-added-color: var(
502
- --trees-git-added-color-override,
503
- var(--trees-status-added)
504
- );
505
- --trees-git-ignored-color: var(
506
- --trees-git-ignored-color-override,
507
- var(--trees-status-ignored)
508
- );
509
- --trees-git-deleted-color: var(
510
- --trees-git-deleted-color-override,
511
- var(--trees-status-deleted)
512
- );
513
- --trees-git-renamed-color: var(
514
- --trees-git-renamed-color-override,
515
- var(--trees-status-renamed)
516
- );
517
- --trees-git-untracked-color: var(
518
- --trees-git-untracked-color-override,
519
- var(--trees-status-untracked)
520
- );
521
-
522
- --trees-icon-gray: light-dark(#84848a, #adadb1);
523
- --trees-icon-red: light-dark(#d52c36, #ff6762);
524
- --trees-icon-vermilion: light-dark(#ff8c5b, #d5512f);
525
- --trees-icon-orange: light-dark(#d47628, #ffa359);
526
- --trees-icon-yellow: light-dark(#d5a910, #ffd452);
527
- --trees-icon-green: light-dark(#199f43, #5ecc71);
528
- --trees-icon-teal: light-dark(#17a5af, #64d1db);
529
- --trees-icon-cyan: light-dark(#1ca1c7, #68cdf2);
530
- --trees-icon-blue: light-dark(#1a85d4, #69b1ff);
531
- --trees-icon-indigo: light-dark(#693acf, #9d6afb);
532
- --trees-icon-purple: light-dark(#a631be, #d568ea);
533
- --trees-icon-pink: light-dark(#d32a61, #ff678d);
534
- --trees-icon-mauve: light-dark(#594c5b, #79697b);
535
-
536
- --trees-file-icon-color-default: var(
537
- --trees-file-icon-color,
538
- var(--trees-icon-gray)
539
- );
540
- --trees-file-icon-color-astro: var(
541
- --trees-file-icon-color,
542
- var(--trees-icon-purple)
543
- );
544
- --trees-file-icon-color-babel: var(
545
- --trees-file-icon-color,
546
- var(--trees-icon-yellow)
547
- );
548
- --trees-file-icon-color-bash: var(
549
- --trees-file-icon-color,
550
- var(--trees-icon-green)
551
- );
552
- --trees-file-icon-color-biome: var(
553
- --trees-file-icon-color,
554
- var(--trees-icon-blue)
555
- );
556
- --trees-file-icon-color-bootstrap: var(
557
- --trees-file-icon-color,
558
- var(--trees-icon-indigo)
559
- );
560
- --trees-file-icon-color-browserslist: var(
561
- --trees-file-icon-color,
562
- var(--trees-icon-yellow)
563
- );
564
- --trees-file-icon-color-bun: var(
565
- --trees-file-icon-color,
566
- var(--trees-icon-mauve)
567
- );
568
- --trees-file-icon-color-claude: var(
569
- --trees-file-icon-color,
570
- var(--trees-icon-orange)
571
- );
572
- --trees-file-icon-color-css: var(
573
- --trees-file-icon-color,
574
- var(--trees-icon-indigo)
575
- );
576
- --trees-file-icon-color-database: var(
577
- --trees-file-icon-color,
578
- var(--trees-icon-purple)
579
- );
580
- --trees-file-icon-color-docker: var(
581
- --trees-file-icon-color,
582
- var(--trees-icon-blue)
583
- );
584
- --trees-file-icon-color-eslint: var(
585
- --trees-file-icon-color,
586
- var(--trees-icon-indigo)
587
- );
588
- --trees-file-icon-color-git: var(
589
- --trees-file-icon-vermilion,
590
- var(--trees-icon-vermilion)
591
- );
592
- --trees-file-icon-color-go: var(
593
- --trees-file-icon-color,
594
- var(--trees-icon-cyan)
595
- );
596
- --trees-file-icon-color-graphql: var(
597
- --trees-file-icon-color,
598
- var(--trees-icon-pink)
599
- );
600
- --trees-file-icon-color-html: var(
601
- --trees-file-icon-color,
602
- var(--trees-icon-orange)
603
- );
604
- --trees-file-icon-color-image: var(
605
- --trees-file-icon-color,
606
- var(--trees-icon-pink)
607
- );
608
- --trees-file-icon-color-javascript: var(
609
- --trees-file-icon-color,
610
- var(--trees-icon-yellow)
611
- );
612
- --trees-file-icon-color-json: var(
613
- --trees-file-icon-color,
614
- var(--trees-icon-orange)
615
- );
616
- --trees-file-icon-color-markdown: var(
617
- --trees-file-icon-color,
618
- var(--trees-icon-green)
619
- );
620
- --trees-file-icon-color-mcp: var(
621
- --trees-file-icon-color,
622
- var(--trees-icon-teal)
623
- );
624
- --trees-file-icon-color-npm: var(
625
- --trees-file-icon-color,
626
- var(--trees-icon-red)
627
- );
628
- --trees-file-icon-color-oxc: var(
629
- --trees-file-icon-cyan,
630
- var(--trees-icon-cyan)
631
- );
632
- --trees-file-icon-color-postcss: var(
633
- --trees-file-icon-color,
634
- var(--trees-icon-red)
635
- );
636
- --trees-file-icon-color-prettier: var(
637
- --trees-file-icon-color,
638
- var(--trees-icon-teal)
639
- );
640
- --trees-file-icon-color-python: var(
641
- --trees-file-icon-color,
642
- var(--trees-icon-blue)
643
- );
644
- --trees-file-icon-color-react: var(
645
- --trees-file-icon-color,
646
- var(--trees-icon-cyan)
647
- );
648
- --trees-file-icon-color-ruby: var(
649
- --trees-file-icon-color,
650
- var(--trees-icon-red)
651
- );
652
- --trees-file-icon-color-rust: var(
653
- --trees-file-icon-color,
654
- var(--trees-icon-orange)
655
- );
656
- --trees-file-icon-color-sass: var(
657
- --trees-file-icon-color,
658
- var(--trees-icon-pink)
659
- );
660
- --trees-file-icon-color-svg: var(
661
- --trees-file-icon-color,
662
- var(--trees-icon-orange)
663
- );
664
- --trees-file-icon-color-svelte: var(
665
- --trees-file-icon-color,
666
- var(--trees-icon-red)
667
- );
668
- --trees-file-icon-color-svgo: var(
669
- --trees-file-icon-color,
670
- var(--trees-icon-green)
671
- );
672
- --trees-file-icon-color-swift: var(
673
- --trees-file-icon-color,
674
- var(--trees-icon-orange)
675
- );
676
- --trees-file-icon-color-table: var(
677
- --trees-file-icon-color,
678
- var(--trees-icon-teal)
679
- );
680
- --trees-file-icon-color-text: var(
681
- --trees-file-icon-color,
682
- var(--trees-icon-gray)
683
- );
684
- --trees-file-icon-color-tailwind: var(
685
- --trees-file-icon-color,
686
- var(--trees-icon-cyan)
687
- );
688
- --trees-file-icon-color-terraform: var(
689
- --trees-file-icon-color,
690
- var(--trees-icon-indigo)
691
- );
692
- --trees-file-icon-color-typescript: var(
693
- --trees-file-icon-color,
694
- var(--trees-icon-blue)
695
- );
696
- --trees-file-icon-color-vite: var(
697
- --trees-file-icon-color,
698
- var(--trees-icon-purple)
699
- );
700
- --trees-file-icon-color-vscode: var(
701
- --trees-file-icon-color,
702
- var(--trees-icon-blue)
703
- );
704
- --trees-file-icon-color-vue: var(
705
- --trees-file-icon-color,
706
- var(--trees-icon-green)
707
- );
708
- --trees-file-icon-color-wasm: var(
709
- --trees-file-icon-color,
710
- var(--trees-icon-indigo)
711
- );
712
- --trees-file-icon-color-webpack: var(
713
- --trees-file-icon-color,
714
- var(--trees-icon-blue)
715
- );
716
- --trees-file-icon-color-yml: var(
717
- --trees-file-icon-color,
718
- var(--trees-icon-red)
719
- );
720
- --trees-file-icon-color-zig: var(
721
- --trees-file-icon-color,
722
- var(--trees-icon-orange)
723
- );
724
- --trees-file-icon-color-zip: var(
725
- --trees-file-icon-color,
726
- var(--trees-icon-orange)
727
- );
728
-
729
- --trees-level-gap: var(
730
- --trees-level-gap-override,
731
- calc(8px * var(--trees-density))
732
- );
733
- --trees-item-padding-x: var(
734
- --trees-item-padding-x-override,
735
- calc(8px * var(--trees-density))
736
- );
737
- --trees-item-margin-x: var(
738
- --trees-item-margin-x-override,
739
- calc(2px * var(--trees-density))
740
- );
741
- --trees-item-row-gap: var(
742
- --trees-item-row-gap-override,
743
- calc(6px * var(--trees-density))
744
- );
745
- --trees-icon-width: var(--trees-icon-width-override, 16px);
746
- --trees-icon-nudge: var(
747
- --trees-icon-nudge-override,
748
- calc(1px * var(--trees-density))
749
- );
750
- --trees-row-height: var(--trees-item-height, 30px);
751
- --trees-git-lane-width: var(--trees-git-lane-width-override, 12px);
752
- --trees-action-lane-width: var(
753
- --trees-action-lane-width-override,
754
- calc(var(--trees-icon-width) + 2px)
755
- );
756
- /* Keep the floating trigger aligned with the row's action lane. Going in
757
- from the root's right edge: the scroll container reserves
758
- \`--trees-padding-inline\` of effective inset on each side (its asymmetric
759
- padding formula cancels the scrollbar gutter on the right), the row
760
- sits inside that inset, and its trailing \`--trees-item-padding-x\` is the
761
- action lane itself. The trigger's own focus-ring margin then trims one
762
- pixel back so the button's visible right edge lines up with the lane. */
763
- --trees-context-menu-trigger-inline-offset: calc(
764
- var(--trees-padding-inline) + var(--trees-item-padding-x) -
765
- var(--trees-focus-ring-width)
766
- );
767
-
768
- --trees-scrollbar-gutter: var(--trees-scrollbar-gutter-override, 6px);
769
- --trees-padding-inline: var(--trees-padding-inline-override, 16px);
770
-
771
- color-scheme: light dark;
772
- display: flex;
773
- flex-direction: column;
774
- font-size: var(--trees-font-size);
775
- color: var(--trees-fg);
776
- background-color: var(--trees-bg);
777
- --truncate-marker-background-color: var(--trees-bg);
778
- --truncate-marker-background-overlay-color: transparent;
779
- font-family: var(--trees-font-family);
780
- font-weight: var(--trees-font-weight-regular);
781
- }
782
-
783
- :host([data-file-tree-virtualized='true']) {
784
- height: 100%;
785
- overflow: hidden;
786
- }
787
-
788
- [data-file-tree-virtualized-wrapper='true'] {
789
- height: 100%;
790
- overflow: hidden;
791
- display: flex;
792
- flex-direction: column;
793
- }
794
-
795
- [data-file-tree-virtualized-root='true'] {
796
- height: 100%;
797
- display: flex;
798
- flex-direction: column;
799
- overflow: hidden;
800
- }
801
-
802
- [data-file-tree-virtualized-scroll='true'],
803
- [data-file-tree-scrollbar-measure='true'] {
804
- overflow-y: auto;
805
- scrollbar-gutter: stable;
806
-
807
- &::-webkit-scrollbar {
808
- width: var(--trees-scrollbar-gutter);
809
- height: var(--trees-scrollbar-gutter);
810
- }
811
-
812
- &::-webkit-scrollbar-track {
813
- background: transparent;
814
- }
815
-
816
- &::-webkit-scrollbar-thumb {
817
- background-color: var(--trees-scrollbar-thumb);
818
- border: 1px solid transparent;
819
- background-clip: content-box;
820
- border-radius: calc(var(--trees-scrollbar-gutter) / 2);
821
- }
822
-
823
- &::-webkit-scrollbar-corner {
824
- background-color: transparent;
825
- }
826
- }
827
-
828
- /* These are styles for a temporarily generated element to measure the size
829
- * of the scrollbar. It's intended to be somewhat similar in scrollbar style
830
- * scope to the scrollable tree so \`--trees-scrollbar-gutter-measured\` is an
831
- * accurate reflection of the size the scrollbar gutter takes up. */
832
- [data-file-tree-scrollbar-measure='true'] {
833
- position: absolute;
834
- top: 0;
835
- left: 0;
836
- visibility: hidden;
837
- pointer-events: none;
838
- width: 100px;
839
- height: 100px;
840
- }
841
-
842
- @supports (-moz-appearance: none) {
843
- [data-file-tree-virtualized-scroll='true'],
844
- [data-file-tree-scrollbar-measure='true'] {
845
- scrollbar-width: thin;
846
- scrollbar-color: var(--trees-scrollbar-thumb) transparent;
847
- }
848
- }
849
-
850
- [data-file-tree-virtualized-scroll='true'] {
851
- position: relative;
852
- overflow-y: auto;
853
- flex: 1 1 0;
854
- min-height: 0;
855
- padding-inline: max(
856
- calc(var(--trees-padding-inline) - var(--trees-item-margin-x)),
857
- 0px
858
- )
859
- /* NOTE(amadeus): We can assume that all Webkit based browser gutters
860
- * will align to the value of '--trees-scrollbar-gutter', however if not, then
861
- * \`--trees-scrollbar-gutter-measured\` should correct it. Mostly we are
862
- * hoping to avoid SSR alignment jumps if possible. In non-SSR'd environments
863
- * \`--trees-scrollbar-gutter-measured\` should always be immediately available.
864
- */
865
- max(
866
- calc(
867
- var(--trees-padding-inline) - var(--trees-item-margin-x) -
868
- var(
869
- --trees-scrollbar-gutter-measured,
870
- var(--trees-scrollbar-gutter)
871
- )
872
- ),
873
- 0px
874
- );
875
- }
876
-
877
- @supports (-moz-appearance: none) {
878
- [data-file-tree-virtualized-scroll='true'] {
879
- padding-inline: max(
880
- calc(var(--trees-padding-inline) - var(--trees-item-margin-x)),
881
- 0px
882
- )
883
- /* NOTE(amadeus): However on Firefox it can vary a little bit, but most
884
- * likely the majority of cases will default to a 0px width scrollbar lets
885
- * inherit that first to avoid SSR jumps. In non-SSR'd environments
886
- * \`--trees-scrollbar-gutter-measured\` should always be immediately available.
887
- */
888
- max(
889
- calc(
890
- var(--trees-padding-inline) - var(--trees-item-margin-x) -
891
- var(--trees-scrollbar-gutter-measured, 0px)
892
- ),
893
- 0px
894
- );
895
- }
896
- }
897
-
898
- [data-file-tree-sticky-overlay='true'] {
899
- position: sticky;
900
- top: 0;
901
- height: 0;
902
- z-index: 4;
903
- overflow: visible;
904
- pointer-events: none;
905
- }
906
-
907
- /* The overlay DOM is kept populated even at scrollTop=0 so the browser has
908
- * the rendered rows on hand the moment scrolling begins — otherwise the
909
- * compositor paints a scrolled frame before React can mount the overlay,
910
- * and the topmost sticky folder jumps up by a couple of pixels before it
911
- * "snaps" into its pinned position. We hide it via CSS whenever the scroll
912
- * is at the top and no scroll is in progress, so the preview doesn't leak
913
- * through at rest. \`data-overlay-reveal\` is stamped on the root only when
914
- * the user initiates a scroll while already at the top — exactly the case
915
- * where we need the pre-mounted overlay to be visible through the first
916
- * compositor frame. It is deliberately distinct from the general
917
- * \`data-is-scrolling\` flag so a scroll that ends at the top (e.g. ArrowUp
918
- * navigation) re-hides the overlay the instant the scroll lands, rather
919
- * than waiting for the hover-suppression timer to elapse. */
920
- [data-file-tree-virtualized-root='true'][data-scroll-at-top='true']:not(
921
- [data-overlay-reveal]
922
- )
923
- [data-file-tree-sticky-overlay='true'] {
924
- visibility: hidden;
925
- }
926
-
927
- [data-file-tree-sticky-overlay-content='true'] {
928
- background-color: var(--trees-bg);
929
- position: relative;
930
- pointer-events: none;
931
- }
932
-
933
- [data-file-tree-virtualized-list='true'] {
934
- background-color: var(--trees-bg);
935
- position: relative;
936
- min-height: 100%;
937
- width: 100%;
938
- overflow-anchor: none;
939
-
940
- &[data-is-scrolling] {
941
- pointer-events: none;
942
- }
943
- }
944
-
945
- [data-file-tree-virtualized-sticky-offset='true'] {
946
- contain: layout size;
947
- }
948
-
949
- [data-file-tree-virtualized-sticky='true'] {
950
- position: sticky;
951
- top: 0;
952
- width: 100%;
953
- display: flex;
954
- flex-direction: column;
955
- isolation: isolate;
956
- /* Promote to its own compositor layer so text inside the window is
957
- * rasterized once and GPU-translated during scroll. Without this, the
958
- * browser re-paints the window (and its text) at every scroll frame,
959
- * which produces visible 1px shake / character tearing. */
960
- will-change: transform;
961
- }
962
-
963
- [data-file-tree-search-container] {
964
- display: flex;
965
- padding: 0;
966
- padding-inline: var(--trees-padding-inline);
967
- margin-bottom: var(--trees-item-row-gap);
968
- }
969
-
970
- [data-file-tree-search-input] {
971
- --trees-focus-ring-width: 2px;
972
- font-family: var(--trees-font-family);
973
- font-size: var(--trees-font-size);
974
- flex: 1;
975
- height: var(--trees-row-height);
976
- /* 1px breathing room so the focus-visible outline isn't clipped when the
977
- * input sits flush against the top of the scroll container. */
978
- margin-block: 1px;
979
- padding-inline: var(--trees-item-padding-x);
980
- line-height: var(--trees-row-height);
981
- color: var(--trees-search-fg);
982
- background-color: var(--trees-search-bg);
983
- border: 1px solid var(--trees-border-color);
984
- border-radius: var(--trees-border-radius);
985
- outline: none;
986
-
987
- &::placeholder {
988
- color: color-mix(
989
- in lab,
990
- var(--trees-search-fg) 65%,
991
- var(--trees-search-bg)
992
- );
993
- }
994
-
995
- &:focus-visible,
996
- &[data-file-tree-search-input-fake-focus='true'] {
997
- outline: var(--trees-focus-ring-width) solid var(--trees-focus-ring-color);
998
- outline-offset: var(--trees-focus-ring-offset);
999
- }
1000
- }
1001
-
1002
- /* The wrapper for the tree items */
1003
- [role='tree'] {
1004
- position: relative;
1005
- display: flex;
1006
- flex-direction: column;
1007
- gap: var(--trees-gap-override, 0);
1008
- }
1009
-
1010
- /* LIST ITEM */
1011
- [data-type='item'] {
1012
- color: inherit;
1013
- font-family: var(--trees-font-family);
1014
- font-size: var(--trees-font-size);
1015
- text-align: start;
1016
- outline: none;
1017
- background-color: var(--trees-bg);
1018
- border: none;
1019
- position: relative;
1020
-
1021
- padding: 0 var(--trees-item-padding-x);
1022
- margin: 0 var(--trees-item-margin-x);
1023
- cursor: pointer;
1024
- -webkit-user-select: none;
1025
- user-select: none;
1026
- -webkit-touch-callout: none;
1027
- touch-action: manipulation;
1028
- display: flex;
1029
- flex: 0 0 var(--trees-row-height);
1030
- align-items: center;
1031
- height: var(--trees-row-height);
1032
- line-height: var(--trees-row-height);
1033
- gap: var(--trees-item-row-gap);
1034
- border-radius: var(--trees-border-radius);
1035
- /* Row states may be translucent, so markers paint the tree background first
1036
- * and then the state color on top to avoid compositing the same alpha twice. */
1037
- --truncate-marker-background-color: var(--trees-bg);
1038
- --truncate-marker-background-overlay-color: transparent;
1039
- --truncate-marker-block-inset: 0px;
1040
-
1041
- &:hover,
1042
- &[data-item-context-hover='true'] {
1043
- background-color: var(--trees-bg-muted);
1044
- --truncate-marker-background-overlay-color: var(--trees-bg-muted);
1045
- }
1046
-
1047
- &[data-item-focused='true'],
1048
- &:focus-visible {
1049
- z-index: 2;
1050
-
1051
- /* Flattened segment markers sit high enough to cover the row outline unless
1052
- * their painted background is inset by the focus ring width. */
1053
- [data-item-flattened-subitems] {
1054
- --truncate-marker-block-inset: var(--trees-focus-ring-width);
1055
- }
1056
-
1057
- &::before {
1058
- position: absolute;
1059
- inset: 0;
1060
- content: '';
1061
- display: block;
1062
- border-radius: var(--trees-border-radius);
1063
- outline: var(--trees-focus-ring-width) solid
1064
- var(--trees-focus-ring-color);
1065
- outline-offset: var(--trees-focus-ring-offset);
1066
- pointer-events: none;
1067
- }
1068
-
1069
- &[data-item-selected='true']::before {
1070
- outline-color: var(--trees-selected-focused-border-color);
1071
- }
1072
- }
1073
-
1074
- &[data-item-selected='true'] {
1075
- color: var(--trees-selected-fg);
1076
- background-color: var(--trees-selected-bg);
1077
- --truncate-marker-background-overlay-color: var(--trees-selected-bg);
1078
- z-index: 3;
1079
-
1080
- [data-item-section='icon'] {
1081
- color: var(--trees-selected-fg);
1082
- }
1083
- }
1084
-
1085
- &[data-item-search-match='true'] {
1086
- font-weight: var(--trees-search-font-weight);
1087
- }
1088
- }
1089
-
1090
- [data-type='item'][data-file-tree-sticky-row='true'] {
1091
- pointer-events: auto;
1092
- }
1093
-
1094
- /* Sticky rows opt back into pointer events because the overlay wrapper is
1095
- * inert. During scroll, put them back under the same hover suppression as
1096
- * the virtualized list so translucent hover states and menu triggers do not
1097
- * paint over rows moving beneath the sticky stack. */
1098
- [data-file-tree-virtualized-root='true'][data-is-scrolling]
1099
- [data-type='item'][data-file-tree-sticky-row='true'] {
1100
- pointer-events: none;
1101
- }
1102
-
1103
- [data-file-tree-virtualized-root='true'][data-is-scrolling]
1104
- [data-type='item'][data-file-tree-sticky-row='true']:hover:not(
1105
- [data-item-selected='true']
1106
- ),
1107
- [data-file-tree-virtualized-root='true'][data-is-scrolling]
1108
- [data-type='item'][data-file-tree-sticky-row='true'][data-item-context-hover='true']:not(
1109
- [data-item-selected='true']
1110
- ) {
1111
- background-color: var(--trees-bg);
1112
- --truncate-marker-background-overlay-color: transparent;
1113
- }
1114
-
1115
- [data-item-selected='true']:has(+ [data-item-selected='true']) {
1116
- border-bottom-left-radius: 0;
1117
- border-bottom-right-radius: 0;
1118
- }
1119
-
1120
- [data-item-selected='true'] + [data-item-selected='true'] {
1121
- border-top-left-radius: 0;
1122
- border-top-right-radius: 0;
1123
- }
1124
-
1125
- /* Flattened Directory Parts */
1126
- [data-item-flattened-subitems] {
1127
- display: inline-flex;
1128
- align-items: center;
1129
- gap: 2px;
1130
- }
1131
- [data-item-flattened-subitem]:hover,
1132
- [data-item-flattened-subitem-drag-target='true'] {
1133
- text-decoration: underline;
1134
- }
1135
-
1136
- /* Icon for each item */
1137
- [data-item-section='icon'] {
1138
- flex-shrink: 0;
1139
- display: flex;
1140
- align-items: center;
1141
- justify-content: center;
1142
- color: var(--trees-fg-muted);
1143
- fill: currentColor;
1144
- width: var(--trees-icon-width);
1145
- }
1146
-
1147
- :where([data-item-section='icon'] > [data-icon-token]) {
1148
- color: var(--trees-fg-muted);
1149
- }
1150
-
1151
- [data-file-tree-colored-icons='true'] {
1152
- [data-icon-token='astro'] {
1153
- color: var(--trees-file-icon-color-astro);
1154
- }
1155
- [data-icon-token='babel'] {
1156
- color: var(--trees-file-icon-color-babel);
1157
- }
1158
- [data-icon-token='bash'] {
1159
- color: var(--trees-file-icon-color-bash);
1160
- }
1161
- [data-icon-token='biome'] {
1162
- color: var(--trees-file-icon-color-biome);
1163
- }
1164
- [data-icon-token='bootstrap'] {
1165
- color: var(--trees-file-icon-color-bootstrap);
1166
- }
1167
- [data-icon-token='browserslist'] {
1168
- color: var(--trees-file-icon-color-browserslist);
1169
- }
1170
- [data-icon-token='bun'] {
1171
- color: var(--trees-file-icon-color-bun);
1172
- }
1173
- [data-icon-token='claude'] {
1174
- color: var(--trees-file-icon-color-claude);
1175
- }
1176
- [data-icon-token='css'] {
1177
- color: var(--trees-file-icon-color-css);
1178
- }
1179
- [data-icon-token='database'] {
1180
- color: var(--trees-file-icon-color-database);
1181
- }
1182
- [data-icon-token='default'] {
1183
- color: var(--trees-file-icon-color-default);
1184
- }
1185
- [data-icon-token='docker'] {
1186
- color: var(--trees-file-icon-color-docker);
1187
- }
1188
- [data-icon-token='eslint'] {
1189
- color: var(--trees-file-icon-color-eslint);
1190
- }
1191
- [data-icon-token='git'] {
1192
- color: var(--trees-file-icon-color-git);
1193
- }
1194
- [data-icon-token='go'] {
1195
- color: var(--trees-file-icon-color-go);
1196
- }
1197
- [data-icon-token='graphql'] {
1198
- color: var(--trees-file-icon-color-graphql);
1199
- }
1200
- [data-icon-token='html'] {
1201
- color: var(--trees-file-icon-color-html);
1202
- }
1203
- [data-icon-token='image'] {
1204
- color: var(--trees-file-icon-color-image);
1205
- }
1206
- [data-icon-token='javascript'] {
1207
- color: var(--trees-file-icon-color-javascript);
1208
- }
1209
- [data-icon-token='json'] {
1210
- color: var(--trees-file-icon-color-json);
1211
- }
1212
- [data-icon-token='markdown'] {
1213
- color: var(--trees-file-icon-color-markdown);
1214
- }
1215
- [data-icon-token='mcp'] {
1216
- color: var(--trees-file-icon-color-mcp);
1217
- }
1218
- [data-icon-token='npm'] {
1219
- color: var(--trees-file-icon-color-npm);
1220
- }
1221
- [data-icon-token='oxc'] {
1222
- color: var(--trees-file-icon-color-oxc);
1223
- }
1224
- [data-icon-token='postcss'] {
1225
- color: var(--trees-file-icon-color-postcss);
1226
- }
1227
- [data-icon-token='prettier'] {
1228
- color: var(--trees-file-icon-color-prettier);
1229
- }
1230
- [data-icon-token='python'] {
1231
- color: var(--trees-file-icon-color-python);
1232
- }
1233
- [data-icon-token='react'] {
1234
- color: var(--trees-file-icon-color-react);
1235
- }
1236
- [data-icon-token='ruby'] {
1237
- color: var(--trees-file-icon-color-ruby);
1238
- }
1239
- [data-icon-token='rust'] {
1240
- color: var(--trees-file-icon-color-rust);
1241
- }
1242
- [data-icon-token='sass'] {
1243
- color: var(--trees-file-icon-color-sass);
1244
- }
1245
- [data-icon-token='svg'] {
1246
- color: var(--trees-file-icon-color-svg);
1247
- }
1248
- [data-icon-token='svelte'] {
1249
- color: var(--trees-file-icon-color-svelte);
1250
- }
1251
- [data-icon-token='svgo'] {
1252
- color: var(--trees-file-icon-color-svgo);
1253
- }
1254
- [data-icon-token='swift'] {
1255
- color: var(--trees-file-icon-color-swift);
1256
- }
1257
- [data-icon-token='table'] {
1258
- color: var(--trees-file-icon-color-table);
1259
- }
1260
- [data-icon-token='text'] {
1261
- color: var(--trees-file-icon-color-text);
1262
- }
1263
- [data-icon-token='tailwind'] {
1264
- color: var(--trees-file-icon-color-tailwind);
1265
- }
1266
- [data-icon-token='terraform'] {
1267
- color: var(--trees-file-icon-color-terraform);
1268
- }
1269
- [data-icon-token='typescript'] {
1270
- color: var(--trees-file-icon-color-typescript);
1271
- }
1272
- [data-icon-token='vite'] {
1273
- color: var(--trees-file-icon-color-vite);
1274
- }
1275
- [data-icon-token='vscode'] {
1276
- color: var(--trees-file-icon-color-vscode);
1277
- }
1278
- [data-icon-token='vue'] {
1279
- color: var(--trees-file-icon-color-vue);
1280
- }
1281
- [data-icon-token='wasm'] {
1282
- color: var(--trees-file-icon-color-wasm);
1283
- }
1284
- [data-icon-token='webpack'] {
1285
- color: var(--trees-file-icon-color-webpack);
1286
- }
1287
- [data-icon-token='yml'] {
1288
- color: var(--trees-file-icon-color-yml);
1289
- }
1290
- [data-icon-token='zig'] {
1291
- color: var(--trees-file-icon-color-zig);
1292
- }
1293
- [data-icon-token='zip'] {
1294
- color: var(--trees-file-icon-color-zip);
1295
- }
1296
- }
1297
-
1298
- /* Chevron rotation and visual alignment */
1299
- /* Chevron pointing down */
1300
- [data-icon-name='file-tree-icon-chevron'] {
1301
- &[data-align-capitals='false'] {
1302
- transform: translate(0, var(--trees-icon-nudge));
1303
- }
1304
- &[data-align-capitals='true'] {
1305
- transform: translate(0, 0);
1306
- }
1307
- }
1308
-
1309
- [data-item-section='content'] {
1310
- flex: 0 1 auto;
1311
- text-align: start;
1312
- min-width: 0;
1313
- max-width: 100%;
1314
- overflow: hidden;
1315
- text-overflow: ellipsis;
1316
- /* Breaks middle truncate component to also set this */
1317
- /* white-space: nowrap; */
1318
- }
1319
-
1320
- [data-item-section='decoration'] {
1321
- flex: 1 1 0;
1322
- min-width: 0;
1323
- display: flex;
1324
- justify-content: flex-end;
1325
- text-align: end;
1326
- overflow: hidden;
1327
- color: var(--trees-fg-muted);
1328
- }
1329
-
1330
- [data-item-section='decoration'] > span {
1331
- min-width: 0;
1332
- max-width: 100%;
1333
- display: inline-flex;
1334
- align-items: center;
1335
- justify-content: flex-end;
1336
- overflow: hidden;
1337
- text-overflow: ellipsis;
1338
- white-space: nowrap;
1339
- }
1340
-
1341
- [data-item-section='git'],
1342
- [data-item-section='action'] {
1343
- flex: 0 0 auto;
1344
- display: flex;
1345
- align-items: center;
1346
- justify-content: center;
1347
- }
1348
-
1349
- [data-item-section='git'] {
1350
- width: var(--trees-git-lane-width);
1351
- }
1352
-
1353
- [data-item-section='action'] {
1354
- width: var(--trees-action-lane-width);
1355
- color: var(--trees-fg-muted);
1356
- fill: currentColor;
1357
- pointer-events: none;
1358
- }
1359
-
1360
- [data-item-section='git'] > span,
1361
- [data-item-section='action'] > span {
1362
- width: 100%;
1363
- display: inline-flex;
1364
- align-items: center;
1365
- justify-content: center;
1366
- }
1367
-
1368
- [data-item-action-affordance='decorative'] {
1369
- opacity: 0.85;
1370
- }
1371
-
1372
- [data-item-rename-input] {
1373
- appearance: none;
1374
- width: 100%;
1375
- min-width: 0;
1376
- height: calc(var(--trees-row-height) - 4px);
1377
- font-family: inherit;
1378
- font-size: inherit;
1379
- /* line-height: calc(var(--trees-row-height) - 8px); */
1380
- color: inherit;
1381
- background-color: transparent;
1382
- border: 0;
1383
- padding-inline: 6px;
1384
- outline: none;
1385
- box-sizing: border-box;
1386
- }
1387
-
1388
- [data-item-section='content']:has([data-item-rename-input])
1389
- ~ [data-item-section='action'],
1390
- [data-item-section='content']:has([data-item-rename-input])
1391
- ~ [data-item-section='decoration'] {
1392
- display: none;
1393
- }
1394
-
1395
- /* Chevron pointing right */
1396
- [aria-expanded='false'][data-item-type='folder']
1397
- > [data-item-section='icon']
1398
- > [data-icon-name='file-tree-icon-chevron'] {
1399
- &[data-align-capitals='true'] {
1400
- transform: rotate(-90deg)
1401
- translate(
1402
- calc(var(--trees-icon-nudge) / 2),
1403
- calc(var(--trees-icon-nudge) / 2)
1404
- );
1405
- }
1406
- &[data-align-capitals='false'] {
1407
- transform: rotate(-90deg)
1408
- translate(
1409
- calc(var(--trees-icon-nudge) / 2 * -1),
1410
- calc(var(--trees-icon-nudge) / 2)
1411
- );
1412
- }
1413
- }
1414
-
1415
- /* LIST IDENTATION */
1416
- /* Spacing container */
1417
- [data-item-section='spacing'] {
1418
- display: flex;
1419
- flex-direction: row;
1420
- align-items: center;
1421
- justify-content: center;
1422
- height: var(--trees-row-height);
1423
- padding-left: calc(calc(var(--trees-icon-width) / 2) - 0.5px);
1424
-
1425
- &:empty {
1426
- padding-left: 0;
1427
- }
1428
- }
1429
-
1430
- /* Spacing per level */
1431
- [data-item-section='spacing-item'] {
1432
- transform: translateX(-0.25px);
1433
- display: inline-block;
1434
- border-left: 1px solid var(--trees-indent-guide-bg);
1435
- height: 100%;
1436
- margin-right: calc(var(--trees-level-gap) - 1px);
1437
- opacity: 0;
1438
- transition: opacity 150ms ease;
1439
-
1440
- & + & {
1441
- margin-left: calc(
1442
- var(--trees-item-row-gap) + calc(var(--trees-icon-width) / 2) - 0.5px
1443
- );
1444
- }
1445
- }
1446
-
1447
- :host(:hover) [data-item-section='spacing-item'] {
1448
- opacity: 0.75;
1449
- }
1450
-
1451
- /* Git status indicator */
1452
-
1453
- /* This is a folder that contains a git change */
1454
- [data-item-contains-git-change='true'] > [data-item-section='git'] {
1455
- color: var(--trees-git-modified-color);
1456
- opacity: 0.5;
1457
- fill: currentColor;
1458
- }
1459
-
1460
- /* These are files that have a git change */
1461
- [data-item-git-status] {
1462
- &
1463
- > :where([data-item-section='icon'])
1464
- > :where(:not([data-icon-name='file-tree-icon-chevron'])) {
1465
- color: var(--trees-item-git-status-color);
1466
- }
1467
- & > [data-item-section='content'] {
1468
- color: var(--trees-item-git-status-color);
1469
- }
1470
- & > [data-item-section='git'] {
1471
- color: var(--trees-item-git-status-color);
1472
- font-weight: var(--trees-font-weight-semibold);
1473
- }
1474
- }
1475
-
1476
- [data-item-git-status='added'] {
1477
- --trees-item-git-status-color: var(--trees-git-added-color);
1478
- }
1479
-
1480
- [data-item-git-status='deleted'] {
1481
- --trees-item-git-status-color: var(--trees-git-deleted-color);
1482
- }
1483
-
1484
- [data-item-git-status='ignored'] {
1485
- --trees-item-git-status-color: var(--trees-git-ignored-color);
1486
-
1487
- & > [data-item-section='icon'] {
1488
- opacity: 0.5;
1489
- }
1490
- }
1491
-
1492
- [data-item-section='git'] [data-icon-name='file-tree-icon-dot'] {
1493
- /* this is a nudge to align the dot with the likely lowercase text. it's slightly
1494
- generalizable, but other fonts are gonna need other nudges i assume */
1495
- transform: translateY(calc(0.65ex - 50%));
1496
- }
1497
-
1498
- [data-item-git-status='modified'] {
1499
- --trees-item-git-status-color: var(--trees-git-modified-color);
1500
- }
1501
-
1502
- [data-item-git-status='renamed'] {
1503
- --trees-item-git-status-color: var(--trees-git-renamed-color);
1504
- }
1505
-
1506
- [data-item-git-status='untracked'] {
1507
- --trees-item-git-status-color: var(--trees-git-untracked-color);
1508
- }
1509
-
1510
- /* Drag and drop */
1511
- [data-item-drag-target='true'] {
1512
- background-color: var(--trees-selected-bg);
1513
- }
1514
-
1515
- [data-item-dragging='true'] {
1516
- opacity: 0.5;
1517
- }
1518
-
1519
- /* Lock icon for locked paths (sibling of content) */
1520
- [data-item-section='lock'] {
1521
- flex: 0 0 auto;
1522
- margin-left: auto;
1523
- display: flex;
1524
- align-items: center;
1525
- color: var(--trees-fg-muted);
1526
- }
1527
- [data-item-section='lock'] svg {
1528
- display: block;
1529
- }
1530
-
1531
- [data-type='header-slot'] {
1532
- display: block;
1533
- flex: 0 0 auto;
1534
- }
1535
-
1536
- [data-type='context-menu-wash'] {
1537
- position: absolute;
1538
- inset: 0;
1539
- z-index: 3;
1540
- background-color: transparent;
1541
- touch-action: none;
1542
- }
1543
-
1544
- [data-type='context-menu-anchor'] {
1545
- position: absolute;
1546
- top: 0;
1547
- right: var(--trees-context-menu-trigger-inline-offset);
1548
- z-index: 4;
1549
- display: none;
1550
- align-items: center;
1551
-
1552
- &[data-visible='true'] {
1553
- display: flex;
1554
- }
1555
- }
1556
-
1557
- /* Hide the floating trigger while the scroll container is actively moving.
1558
- * The anchor is positioned against the root, not the scroll content, so its
1559
- * \`top\` follows the row via a React state update — one frame behind the
1560
- * compositor. That delay is visible as the trigger hovering over the wrong
1561
- * row during the first frame of a scroll. The \`data-is-scrolling\` flag on
1562
- * the root is flipped synchronously on \`wheel\`/\`touchmove\`/\`keydown\` before
1563
- * the compositor commits the next paint, so this selector hides the anchor
1564
- * in the same frame the scroll begins. */
1565
- [data-file-tree-virtualized-root='true'][data-is-scrolling]
1566
- [data-type='context-menu-anchor'] {
1567
- display: none;
1568
- }
1569
-
1570
- [data-type='context-menu-anchor'] > slot[name='context-menu'] {
1571
- display: block;
1572
- width: 0;
1573
- min-width: 0;
1574
- flex: 0 0 0;
1575
- overflow: visible;
1576
- }
1577
-
1578
- /* Single floating context menu trigger */
1579
- [data-type='context-menu-trigger'] {
1580
- all: unset;
1581
- align-items: center;
1582
- justify-content: center;
1583
- width: var(--trees-action-lane-width);
1584
- color: var(--trees-fg-muted);
1585
- fill: currentColor;
1586
- cursor: pointer;
1587
- font-family: var(--trees-font-family);
1588
- font-size: var(--trees-font-size);
1589
- border-top-right-radius: var(--trees-border-radius);
1590
- border-bottom-right-radius: var(--trees-border-radius);
1591
- margin: var(--trees-focus-ring-width);
1592
- height: calc(var(--trees-row-height) - var(--trees-focus-ring-width) * 2);
1593
- border-width: 0;
1594
- transition: color 120ms ease;
1595
-
1596
- display: flex;
1597
- }
1598
-
1599
- [data-type='context-menu-trigger']:hover,
1600
- [data-type='context-menu-trigger'][aria-expanded='true'] {
1601
- color: var(--trees-fg);
1602
- }
1603
-
1604
- /** @pierre/truncate css here, manually copy pasted for now */
1605
- [data-truncate-container] {
1606
- /* CUSTOM TO TREES, TO SUPPORT THE OUTLINE */
1607
- margin-top: -1px;
1608
- margin-bottom: -1px;
1609
-
1610
- /* Width of the fade from default marker to text */
1611
- --truncate-internal-marker-fade-width: var(
1612
- --truncate-marker-fade-width,
1613
- 2px
1614
- );
1615
- /* Width of the solid color between the fade from the default marker to the text */
1616
- --truncate-internal-marker-gap: var(--truncate-marker-gap, 0px);
1617
- /* Opacity of the marker 'color' property, not of the element itself */
1618
- --truncate-internal-marker-opacity: var(--truncate-marker-opacity, 50%);
1619
- /* Opacity of the marker 'color' property specifically for the middle truncate, not opacity of the element itself */
1620
- --truncate-internal-middle-marker-opacity: var(
1621
- --truncate-middle-marker-opacity,
1622
- 80%
1623
- );
1624
- /* Background color of the default marker */
1625
- --truncate-internal-marker-background-color: var(
1626
- --truncate-marker-background-color,
1627
- light-dark(white, black)
1628
- );
1629
- --truncate-internal-marker-background-overlay-color: var(
1630
- --truncate-marker-background-overlay-color,
1631
- transparent
1632
- );
1633
- --truncate-internal-marker-block-inset: var(
1634
- --truncate-marker-block-inset,
1635
- 0px
1636
- );
1637
- /* Duration of the fade out animation for the marker */
1638
- --truncate-internal-marker-fade-out-duration: var(
1639
- --truncate-marker-fade-out-duration,
1640
- 0ms
1641
- );
1642
- /* Duration of the fade in animation for the marker */
1643
- --truncate-internal-marker-fade-in-duration: var(
1644
- --truncate-marker-fade-in-duration,
1645
- 100ms
1646
- );
1647
-
1648
- /* FADE Variant specifics */
1649
- --truncate-internal-fade-marker-color: var(
1650
- --truncate-fade-marker-color,
1651
- #000
1652
- );
1653
- --truncate-internal-fade-marker-width: var(
1654
- --truncate-fade-marker-width,
1655
- 0.2lh
1656
- );
1657
-
1658
- /*
1659
- In some special cases people might be adding spacing in other ways
1660
- that would benefit from being able to override this, however the container
1661
- query below can't use this and would need to be redeclared with the overridden
1662
- value. It's a bad time, but better than nothing.
1663
- */
1664
- --truncate-internal-single-line-height: 1lh;
1665
-
1666
- height: var(--truncate-internal-single-line-height);
1667
- min-width: 0;
1668
- overflow: hidden;
1669
- }
1670
-
1671
- [data-truncate-marker] {
1672
- display: flex;
1673
- position: absolute;
1674
- height: var(--truncate-internal-single-line-height);
1675
- padding-block: var(--truncate-internal-marker-block-inset);
1676
- box-sizing: border-box;
1677
- align-items: center;
1678
- background-clip: content-box;
1679
- z-index: 2;
1680
- color: color-mix(
1681
- in srgb,
1682
- currentColor var(--truncate-internal-marker-opacity),
1683
- transparent
1684
- );
1685
-
1686
- /* Core trick for hiding the marker until overflow occurs */
1687
- opacity: 0;
1688
- transition: opacity var(--truncate-internal-marker-fade-out-duration)
1689
- ease-in-out;
1690
- }
1691
-
1692
- @container measure (height > 1lh) {
1693
- [data-truncate-marker] {
1694
- opacity: 1;
1695
- transition: opacity var(--truncate-internal-marker-fade-in-duration)
1696
- ease-in-out;
1697
- }
1698
- }
1699
-
1700
- [data-truncate-grid] {
1701
- display: grid;
1702
- position: relative;
1703
- }
1704
-
1705
- [data-truncate-content='visible'] {
1706
- white-space: nowrap;
1707
- }
1708
-
1709
- [data-truncate-content='overflow'] {
1710
- opacity: 0;
1711
- pointer-events: none;
1712
- -webkit-user-select: none;
1713
- user-select: none;
1714
- word-break: break-all;
1715
- margin-top: calc(-1 * var(--truncate-internal-single-line-height));
1716
- }
1717
-
1718
- [data-truncate-marker-cell] {
1719
- container: measure / size;
1720
- overflow: visible;
1721
- -webkit-user-select: none;
1722
- user-select: none;
1723
- pointer-events: none;
1724
- }
1725
-
1726
- [data-truncate-container='truncate'] {
1727
- & [data-truncate-grid] {
1728
- grid-template-columns: minmax(0, max-content) 0;
1729
- }
1730
- & [data-truncate-marker] {
1731
- right: 0;
1732
- }
1733
- & [data-truncate-fade] {
1734
- margin-right: calc(-2 * var(--truncate-internal-fade-marker-width));
1735
- }
1736
- }
1737
-
1738
- [data-truncate-container='fruncate'] {
1739
- & [data-truncate-grid] {
1740
- grid-template-columns: 0 minmax(0, max-content) auto;
1741
- }
1742
- & [data-truncate-content] {
1743
- direction: rtl;
1744
- }
1745
- & [data-truncate-content] > span {
1746
- unicode-bidi: plaintext;
1747
- }
1748
- & [data-truncate-fade] {
1749
- margin-left: calc(-2 * var(--truncate-internal-fade-marker-width));
1750
- }
1751
- }
1752
-
1753
- [data-truncate-variant='default'] {
1754
- & [data-truncate-marker] {
1755
- background-color: var(--truncate-internal-marker-background-color);
1756
- background-image: linear-gradient(
1757
- var(--truncate-internal-marker-background-overlay-color),
1758
- var(--truncate-internal-marker-background-overlay-color)
1759
- );
1760
- }
1761
- & [data-truncate-marker]::after,
1762
- & [data-truncate-marker]::before {
1763
- content: '';
1764
- position: absolute;
1765
- width: calc(
1766
- var(--truncate-internal-marker-fade-width) +
1767
- var(--truncate-internal-marker-gap)
1768
- );
1769
- inset-block-start: var(--truncate-internal-marker-block-inset);
1770
- height: max(
1771
- 0px,
1772
- calc(
1773
- var(--truncate-internal-single-line-height) -
1774
- var(--truncate-internal-marker-block-inset) * 2
1775
- )
1776
- );
1777
- background-color: var(--truncate-internal-marker-background-color);
1778
- background-image: linear-gradient(
1779
- var(--truncate-internal-marker-background-overlay-color),
1780
- var(--truncate-internal-marker-background-overlay-color)
1781
- );
1782
- mask-image: linear-gradient(
1783
- var(--truncate-internal-fade-dir),
1784
- #000 0%,
1785
- #000 var(--truncate-internal-marker-gap),
1786
- transparent 100%
1787
- );
1788
- }
1789
- & [data-truncate-marker]::after {
1790
- --truncate-internal-fade-dir: to right;
1791
- right: calc(
1792
- -1 *
1793
- (
1794
- var(--truncate-internal-marker-fade-width) +
1795
- var(--truncate-internal-marker-gap)
1796
- )
1797
- );
1798
- }
1799
- & [data-truncate-marker]::before {
1800
- --truncate-internal-fade-dir: to left;
1801
- left: calc(
1802
- -1 *
1803
- (
1804
- var(--truncate-internal-marker-fade-width) +
1805
- var(--truncate-internal-marker-gap)
1806
- )
1807
- );
1808
- }
1809
- }
1810
-
1811
- [data-truncate-variant='fade'] {
1812
- & [data-truncate-marker] {
1813
- background: transparent;
1814
- }
1815
- }
1816
-
1817
- [data-truncate-fade] {
1818
- box-shadow:
1819
- 0 0 calc(var(--truncate-internal-fade-marker-width) / 2)
1820
- var(--truncate-internal-fade-marker-color),
1821
- 0 0 var(--truncate-internal-fade-marker-width)
1822
- var(--truncate-internal-fade-marker-color);
1823
- width: calc(var(--truncate-internal-fade-marker-width) * 2);
1824
- height: calc(
1825
- var(--truncate-internal-single-line-height) -
1826
- (var(--truncate-internal-fade-marker-width) * 2)
1827
- );
1828
- margin: var(--truncate-internal-fade-marker-width) 0;
1829
- }
1830
-
1831
- [data-truncate-group-container='middle'] {
1832
- & [data-truncate-container] {
1833
- --truncate-marker-opacity: var(--truncate-internal-middle-marker-opacity);
1834
- }
1835
-
1836
- display: flex;
1837
- min-width: 0;
1838
-
1839
- & > div {
1840
- min-width: 0;
1841
- }
1842
-
1843
- & > div[data-truncate-segment-priority='1'] {
1844
- flex: 0 1 max-content;
1845
- }
1846
- & > div[data-truncate-segment-priority='2'] {
1847
- flex: 0 999999 max-content;
1848
- }
1849
- }
1850
- }
1851
- `,YF=`@layer base, unsafe;`;function XF(e){return`${YF}
1852
- @layer base {
1853
- ${e}
1854
- }`}function ZF(e){return`${YF}
1855
- @layer unsafe {
1856
- ${e}
1857
- }`}var QF=new WeakMap;function $F(e){let t=QF.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(Kj,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),QF.set(e,i),i}function eI(e,t){if(!e.isConnected)return;let n=$F(t);if(n==null)return;let r=t.querySelector(`style[${qj}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(qj,``),t.appendChild(i)),i.textContent=`:host { ${Jj}: ${n}px; }`}var tI;function nI(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){tI??(tI=new CSSStyleSheet,tI.replaceSync(XF(JF)));let t=!1;try{e.adoptedStyleSheets=[tI],t=!0}catch{}if(t){e.querySelector(`style[${Wj}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(Wj,``),t.textContent=XF(JF),e.prepend(t)}}function rI(e,t){iI(e,t),nI(t),eI(e,t)}function iI(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});rI(this,e)}}if(customElements.define(Uj,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(Uj)))e instanceof HTMLElement&&rI(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var aI=e=>e.startsWith(`f::`)?e.slice(3):e;function oI(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function sI(e,t){return e===``?t:`${e}/${t}`}function cI({files:e,path:t,isFolder:n,nextBasename:r}){let i=aI(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=oI(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=sI(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function lI(e){return e.endsWith(`/`)}function uI(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function dI(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function fI(e,t){return t.includes(e)?dI(t):[e]}function pI(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function mI(e,t){return{draggedPaths:e,target:t}}function hI(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(lI(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function gI(e,t){return t.kind===`root`||t.directoryPath==null?uI(e):t.directoryPath}function _I(e,t){let n=e.map(e=>{let n=gI(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}var vI=Symbol(`FILE_TREE_RENAME_VIEW`);function yI(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}var bI=512,xI=512;function SI(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function CI(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function wI(e){return CI(e).at(-1)??null}function TI(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}var EI=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},DI=e=>e.toLowerCase();function OI(e){return e.endsWith(`/`)}function kI(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function AI(e){return e.endsWith(`/`)?e.slice(0,-1):e}function jI(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}function MI(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function NI(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function PI(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return NI(e,t.path)?n?e:null:e;case`move`:return MI(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=PI(r,e,n),r==null)return null;return r}}}function FI(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function II(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function LI(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!II(UF.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function RI(e){switch(e.operation){case`add`:return{...FI(e),operation:`add`,path:e.path};case`remove`:return{...FI(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...FI(e),from:e.from,operation:`move`,to:e.to}}}function zI(e){return{...FI(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>RI(e)),operation:`batch`}}function BI(e){switch(e.operation){case`add`:case`remove`:case`move`:return RI(e);case`batch`:return zI(e);default:return null}}function VI(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=CI(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function HI(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:VI(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var UI=class{#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=new Set;#z=0;#B;#V=0;#H=!1;#U=0;#W;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=LI({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#B=this.#se(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ae(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#R=new Set(d),this.#L=f,this.#z=1),this.#Oe(f,!1),r!=null&&this.#Se(r,!1),this.#W=this.#Fe()}destroy(){this.#W?.(),this.#W=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#pe()}focusFirstItem(){this.#ve().length>0&&this.#Me(0)}focusLastItem(){this.#U<=0||(this.#Ne(),this.#Me(this.#U-1))}focusNextItem(){this.#De(1)}focusParentItem(){if(this.#c==null)return;let e=wI(this.#c);if(e==null)return;let t=this.#Y(e);t>=0&&this.#Me(t)}focusPath(e){let t=this.#B.getPathInfo(e)?.path??null;if(t==null)return;this.#Ne();let n=this.#Y(t);n>=0&&this.#Me(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Y(t);return n>=0?(this.#Me(n),this.#ve()[n]??t):null}focusPreviousItem(){this.#De(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#X(this.#c)}getFocusedPath(){return this.#c}resolveNearestVisiblePath(e){let t=this.#ve();if(this.#U===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#B.getPathInfo(e)?.path??e,r=this.#Y(n);return r>=0?t[r]??n:this.#J(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#R]}getSelectionVersion(){return this.#z}getVisibleCount(){return this.#U}getVisibleRows(e,t){if(t<e||this.#U===0)return[];let n=Math.max(0,e),r=Math.min(this.#U-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=xI){let e=[];for(let t=n;t<=r;t+=1){let n=this.#B.getVisibleRowContext(t);if(n==null)break;e.push(this.#Q(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ne(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#ye(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#B.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#ye(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#Z(o,i,a,{ancestorPaths:this.#te(a),path:s})})}return this.#B.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#Z(e,r,r,{ancestorPaths:this.#te(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#U===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#U;r+=1){let i=e+r*t,a=Math.min(this.#U-1,Math.floor(i/t)),o=this.#$(a,r)??(a>0?this.#$(a-1,r):void 0);if(o==null)break;n.push({row:this.#Q(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#B.getPathInfo(e);return t==null?null:this.#X(t.path,t)}selectAllVisiblePaths(){this.#Ne();let e=[...this.#ve()];this.#re(e,this.#c??this.#L)}selectOnlyPath(e){let t=this.#Ae(e);t!=null&&this.#re([t],t)}selectPath(e){let t=this.#Ae(e);t==null||this.#R.has(t)||this.#re([...this.#R,t])}deselectPath(e){let t=this.#Ae(e);t==null||!this.#R.has(t)||this.#re([...this.#R].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ae(e);if(t!=null){if(this.#R.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ae(e);if(t!=null){if(this.#R.has(t)){this.#re([...this.#R].filter(e=>e!==t),t);return}this.#re([...this.#R,t],t)}}selectPathRange(e,t){let n=this.#Ae(e);if(n==null)return;this.#Ne();let r=this.#L,i=r==null?-1:this.#be(r),a=this.#be(n);if(i===-1||a===-1){let e=t?[...this.#R,n]:[n];this.#re(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#ve().slice(o,s+1),l=t?[...this.#R,...c]:c;this.#re(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#U-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ne();let r=this.#ve(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#R);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#re([...o],this.#L??i,!1),this.#Me(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ae(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=fI(t,n);return this.#r.canDrag?.(r)===!1?!1:(n.includes(t)||this.#re([t],t,!1),this.#je(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#we(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=mI(t.draggedPaths,n);(hI(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}pI(t.target,n)||(this.#i={...t,target:n},this.#we())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#we())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#we(),!1;let n=mI(e.draggedPaths,t);if(hI(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#we(),!1;let r=_I(e.draggedPaths,t);if(r==null)return this.#we(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#B.move(e.from,e.to,{collision:e.collision})}else this.#oe(r.operations),this.#B.batch(r.operations)}catch(e){return this.#we(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#B.add(e)}remove(e,t={}){this.#B.remove(e,t)}move(e,t,n={}){this.#B.move(e,t,n)}batch(e){this.#B.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Se(e,!0)}openSearch(e=``){this.#Se(e,!0)}closeSearch(){this.#Se(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#xe(1)}focusPreviousSearchMatch(){this.#xe(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#B.getPathInfo(e);if(n==null)return!1;let r=n.path,i=OI(r),a=AI(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of CI(r))this.#B.isExpanded(e)||this.#B.expand(e);return this.#re([r],r,!1),this.#M!=null&&(this.#Se(null,!1),this.#y?.(this.#M)),this.#je(r),this.#T=r,this.#E=kI(r),this.#D=t.removeIfCanceled??!1,this.#we(),!0}[vI](){return{cancel:()=>{this.#G()},commit:()=>{this.#K()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#q(e)}}}#G(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,OI(e)?{recursive:!0}:void 0);return}this.#je(e),this.#we()}#K(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,OI(e)?{recursive:!0}:void 0);return}let t=OI(e),n=cI({files:this.#B.list(),isFolder:t,nextBasename:this.#E,path:AI(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#je(e),this.#v?.(n.error),this.#we();return}if(n.sourcePath===n.destinationPath){this.#je(e),this.#we();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(jI(n.sourcePath,t),jI(n.destinationPath,t))}#q(e){this.#T==null||this.#E===e||(this.#E=e,this.#we())}resetPaths(e,t={}){let n=this.#B.list().length,r=this.#U,i=LI({paths:e,preparedInput:t.preparedInput},`resetPaths`,this.#e.sort),a=this.#se(i.paths,i.preparedInput,t.initialExpandedPaths),o=this.#c,s=this.#T,c=this.getSelectedPaths(),l=this.#L;this.#W?.(),this.#B=a,this.#d.clear(),this.#pe();let u=c.map(e=>a.getPathInfo(e)?.path??null).filter(e=>e!=null),d=!SI(this.#R,u);this.#R=new Set(u),d&&(this.#z+=1),this.#L=l==null?null:a.getPathInfo(l)?.path??null,this.#T=s==null?null:a.getPathInfo(s)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#Oe(o,o!=null||u.length>0||this.#L!=null),this.#W=this.#Fe(),this.#we(),this.#Te({canonicalChanged:!0,operation:`reset`,pathCountAfter:i.paths.length,pathCountBefore:n,projectionChanged:!0,usedPreparedInput:t.preparedInput!=null,visibleCountDelta:this.#U-r})}#J(e){this.#Ne();let t=wI(e),n=TI(e,t),r=null,i=null;for(let e of this.#ve()){if(wI(e)!==t)continue;let a=TI(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Y(e){let t=this.#be(e);if(t!==-1)return t;let n=CI(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#be(t);if(r!==-1)return r}return this.#ve().length>0?0:-1}#X(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#B.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#ie(r.path):this.#ae(r.path);return this.#d.set(r.path,i),i}#Z(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#R.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#Q(e){return this.#Z(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#$(e,t){let n=this.#B.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ee(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ee(n),n];return this.#a.set(e,r),r}#te(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ee(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ne(e){this.#B.collapse(e)}#re(e,t=this.#L,n=!0){let r=[...new Set(e)],i=!SI(this.#R,r),a=this.#L!==t;!i&&!a||(this.#R=new Set(r),this.#L=t,i&&(this.#z+=1),n&&this.#we())}#ie(e){return{collapse:()=>{this.#ne(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#Ee(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#B.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#R.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#Ie(e)}}}#ae(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#R.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#oe(e){let t=this.#B.list();this.#se(t).batch(e)}#se(e,t,n){return new UF({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ce(){return this.#h??=this.#B.list(),this.#h}#le(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ce()){e.add(t);for(let n of CI(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#ue(){return this.#g??=this.#ce().map(DI),this.#g}#de(){return this.#f??=this.#le().filter(e=>e.endsWith(`/`)),this.#f}#fe(){return this.#p??=this.#de().map(DI),this.#p}#pe(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#me(){return this.#de().filter(e=>this.#B.isExpanded(e))}#he(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#R)for(let n of CI(e))t.add(n);this.#ge(t)}#ge(e){this.#H=!0;try{for(let t of this.#de()){let n=e.has(t),r=this.#B.isExpanded(t);n&&!r?this.#B.expand(t):!n&&r&&this.#B.collapse(t)}}finally{this.#H=!1}}#_e(){let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#M==null||this.#M.length===0||this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#U=this.#V;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#U=n.length}#ve(){return this.#I??this.#b}#ye(e){return this.#F?.[e]??e}#be(e){return this.#P?.get(e)??this.#B.getVisibleIndex(e)??-1}#xe(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Se(e,t){let n=e==null?null:EI(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#me()),this.#M=n,n==null)this.#he(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#Oe(this.#c,!0);else if(n.length===0)this.#he(!1),this.#O.clear(),this.#N=null,this.#Oe(this.#c,!0);else{let e=this.#Ce();this.#Oe(e,!0)}t&&(this.#y?.(this.#M),this.#we())}}#Ce(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ce(),n=this.#ue(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#de(),s=this.#fe();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of CI(e))l.add(t),c?.add(t)}return this.#ge(l),a??this.#c}#we(){for(let e of this.#t)e()}#Te(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#Ee(e){for(let t of CI(e))this.#B.isExpanded(t)||this.#B.expand(t);this.#B.isExpanded(e)||this.#B.expand(e)}#De(e){let t=this.#U;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ne(),this.#Me(r))}#Oe(e,t=!0){let n=this.#B.getVisibleCount();this.#V=n;let r=HI(this.#B.getVisibleTreeProjectionData(t?void 0:Math.min(n,bI)),e,t?e=>this.#B.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#_e(),this.#s=e==null?this.#ve().length>0?0:-1:this.#Y(e),this.#c=this.#s<0?null:this.#ke(this.#s)}#ke(e){return this.#ve()[e]??(this.#F==null?this.#B.getVisibleRowContext(e)?.row.path??null:null)}#Ae(e){return this.#B.getPathInfo(e)?.path??null}#je(e){if(e==null)return;let t=this.#Y(e);t>=0&&this.#Me(t,!1)}#Me(e,t=!0){let n=this.#ke(e);n!=null&&(this.#s===e&&this.#c===n||(this.#s=e,this.#c=n,t&&this.#we()))}#Ne(){this.#l||this.#Oe(this.#c,!0)}#Pe(e){let t=PI(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=PI(this.#c,e,!0),r=[...this.#R].map(t=>PI(t,e)).filter(e=>e!=null).map(e=>this.#B.getPathInfo(e)?.path??null).filter(e=>e!=null),i=PI(this.#L,e),a=i==null?null:this.#B.getPathInfo(i)?.path??null,o=[...new Set(r)];return SI(this.#R,o)||(this.#R=new Set(o),this.#z+=1),this.#L=a,n}#Fe(){return this.#B.on(`*`,e=>{if(this.#H)return;e.canonicalChanged&&(this.#d.clear(),this.#pe()),this.#i!=null&&yI(e)&&(this.#i=null);let t=yI(e)?this.#Pe(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ce():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#Oe(n,r),this.#we();let i=BI(e);i!=null&&this.#Te(i)})}#Ie(e){if(this.#B.isExpanded(e)){this.#ne(e);return}this.#Ee(e)}},WI=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function GI(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(!(e[t]===`/`||t===e.length)){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function KI(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function qI(e,t){return t?`${e}/`:e}function JI(e,t=null){let n=WI(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set;for(let t of e??[]){let e=GI(t.path);if(e==null)continue;let n=qI(e.path,e.isDirectory);r.set(n,t.status),t.status===`ignored`&&e.isDirectory?a.add(n):e.isDirectory&&a.delete(n);for(let t of KI(e.path))i.add(t)}return{directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}var YI,XI,ZI,QI,$I,eL,tL,nL,rL,iL,aL={},oL=[],sL=Array.isArray,cL=oL.slice,lL=Object.assign;function uL(e){e&&e.parentNode&&e.remove()}function dL(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?cL.call(arguments,2):n),fL(e,o,r,i,null)}function fL(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++XI,__i:-1,__u:0};return i==null&&YI.vnode!=null&&YI.vnode(a),a}function pL(e){return e.children}function mL(e,t){this.props=e,this.context=t,this.__g=0}function hL(e,t){if(t==null)return e.__?hL(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?hL(e):null}function gL(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return gL(e)}}function _L(e){(8&e.__g||!(e.__g|=8)||!ZI.push(e)||$I++)&&QI==YI.debounceRendering||((QI=YI.debounceRendering)||queueMicrotask)(vL)}function vL(){for(var e,t,n,r,i,a,o,s,c=1;ZI.length;)ZI.length>c&&ZI.sort(eL),e=ZI.shift(),c=ZI.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=lL({},r)).__v=r.__v+1,YI.vnode&&YI.vnode(n),EL(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??hL(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,OL(a,n,o),n.__e!=i&&gL(n)));$I=0}function yL(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||oL,b=t.length;for(c=bL(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?aL:y[m.__i]||aL,m.__i=f,_=EL(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&jL(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=xL(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function bL(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?fL(null,o,null,null,null):sL(o)?fL(pL,{children:o},null,null,null):o.constructor==null&&o.__b>0?fL(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=SL(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=hL(s)),ML(s,s));return r}function xL(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=xL(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=hL(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function SL(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function CL(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function wL(e,t,n,r,i){var a;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||CL(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||CL(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(tL,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=nL,e.addEventListener(t,a?iL:rL,a)):e.removeEventListener(t,a?iL:rL,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function TL(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=nL++;else if(t.u<n.l)return;return n(YI.event?YI.event(t):t)}}}function EL(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=YI.__b)&&d(t);n:if(typeof M==`function`)try{if(v=t.props,y=`prototype`in M&&M.prototype.render,b=(d=M.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new M(v,x):(t.__c=f=new mL(v,x),f.constructor=M,f.render=NL),b&&b.sub(f),f.props=v,f.state||={},f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=lL({},f.__s)),lL(f.__s,M.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&M.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=YI.__r,w=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),T=0;T<f._sb.length;T++)f.__h.push(f._sb[T]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++w<25);f.state=f.__s,f.getChildContext!=null&&(r=lL({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===pL&&d.key==null&&(E=kL(d.props.children)),s=yL(e,sL(E)?E:[E],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(D=0,O=!1,t.__u|=c?160:128,t.__c.__z=[],k=0;k<a.length;k++)(A=a[k])==null||O||(A.nodeType==8&&A.data==`$s`?(D>0&&t.__c.__z.push(A),D++,a[k]=null):A.nodeType==8&&A.data==`/$s`?(--D>0&&t.__c.__z.push(A),O=D===0,s=a[k],a[k]=null):D>0&&(t.__c.__z.push(A),a[k]=null));if(!O){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(j=a.length;j--;)uL(a[j]);DL(t)}else t.__e=n.__e,t.__k=n.__k,e.then||DL(t);YI.__e(e,t,n)}else s=t.__e=AL(n.__e,t,n,r,i,a,o,c,l,u);return(d=YI.diffed)&&d(t),128&t.__u?void 0:s}function DL(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(DL)}function OL(e,t,n){for(var r=0;r<n.length;r++)jL(n[r],n[++r],n[++r]);YI.__c&&YI.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){YI.__e(e,t.__v)}})}function kL(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:sL(e)?e.map(kL):lL({},e)}function AL(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(YI.__m&&YI.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=cL.call(e.childNodes),v=n.props||aL,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;wL(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||wL(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),yL(b==`template`?e.content:e,sL(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&hL(n,0),s,c,l),a!=null)for(u=a.length;u--;)uL(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||wL(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&wL(e,u,g,v[u],i))}return e}function jL(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){YI.__e(e,n)}}function ML(e,t,n){var r,i;if(YI.unmount&&YI.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||jL(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){YI.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&ML(r[i],t,n||typeof e.type!=`function`);n||uL(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function NL(e,t,n){return this.constructor(e,n)}function PL(e,t){var n,r,i,a;t==document&&(t=document.documentElement),YI.__&&YI.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=dL(pL,null,[e]),i=[],a=[],EL(t,e,r||aL,aL,t.namespaceURI,r?null:t.firstChild?cL.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),OL(i,e,a)}function FL(e,t){e.__u|=32,PL(e,t)}YI={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw $I=0,e}},XI=0,mL.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=lL({},this.state);typeof e==`function`&&(e=e(lL({},n),this.props)),e&&lL(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),_L(this))},mL.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),_L(this))},mL.prototype.render=pL,ZI=[],$I=0,eL=function(e,t){return e.__v.__b-t.__v.__b},tL=/(PointerCapture)$|Capture$/i,nL=0,rL=TL(!1),iL=TL(!0);var IL=0;Array.isArray;function LL(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--IL,__i:-1,__u:0,__source:i,__self:a};return YI.vnode&&YI.vnode(l),l}var RL=16,zL=16,BL={};function VL({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=BL[e]??{width:RL,height:zL},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return LL(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:LL(`use`,{href:c})})}var HL=e=>{if(e.length<2)return[e,``];let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]},UL=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},WL=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},GL=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},KL=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},qL=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function JL({children:e,marker:t,variant:n=`default`}){"use no memo";return LL(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:LL(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?LL(`span`,{"data-truncate-fade":!0}):t})})}function YL(e){"use no memo";let{mode:t,children:n}=e;return LL(`div`,{children:[LL(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?LL(`span`,{children:n}):n}),LL(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?LL(`span`,{children:n}):n})]})}function XL({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=LL(YL,{mode:t,children:e},`content`),o=LL(JL,{marker:n,mode:t,variant:r},`marker`),s=LL(`div`,{"data-truncate-fill":!0},`fill`);return LL(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:LL(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function ZL({children:e,...t}){"use no memo";return LL(XL,{mode:`truncate`,...t,children:e})}function QL({children:e,...t}){"use no memo";return LL(XL,{mode:`fruncate`,...t,children:e})}function $L({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=LL(ZL,{...s,children:t[0]}),l=LL(QL,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return LL(`div`,{className:a,style:o});if(e.length<i)return LL(n===`end`?QL:ZL,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=HL:r===`extension`?t=UL:r===`leaf-path`&&(t=WL);else if(typeof r==`number`)t=GL,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=KL:e===`first`&&(t=qL)}else typeof r==`function`&&(t=r);t??=HL;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=LL(ZL,{...s,..._,children:f}),l=LL(QL,{...s,...v,children:p})}return LL(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[LL(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),LL(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var eR={endIndex:-1,startIndex:-1};function tR(e,t,n){return Math.min(Math.max(e,t),n)}function nR(e,t){return e<0||t<e?eR:{endIndex:t,startIndex:e}}function rR(e){return e.startIndex<0||e.endIndex<e.startIndex}function iR(e,t){return rR(e)?0:(e.endIndex-e.startIndex+1)*t}function aR(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function oR(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function sR(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function cR(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function lR(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function uR(e,t,n){if(e.length===0||t<=0)return[];let r=lR(e),i=sR(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=cR(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function dR(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=tR(t.scrollTop,0,o),c=t.stickyRows??uR(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=aR(s,n,t.itemHeight),m=aR(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?eR:nR(m,oR(u+d,n,t.itemHeight)),y=g+1,b=rR(v)?eR:nR(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=iR(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:rR(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var fR={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},pR={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},mR=`Contains git status items`;function hR(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function gR(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function _R(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}function vR(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function yR(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}var bR,xR,SR,CR,wR=Object.is,TR=0,ER=[],DR=YI,OR=DR.__b,kR=DR.__r,AR=DR.diffed,jR=DR.__c,MR=DR.unmount,NR=DR.__;function PR(e,t){DR.__h&&DR.__h(xR,e,TR||t),TR=0;var n=xR.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function FR(e){return TR=1,IR(JR,e)}function IR(e,t,n){var r=PR(bR++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):JR(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);wR(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=xR,!xR.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,wR(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};xR.__f=!0;var a=xR.shouldComponentUpdate,o=xR.componentWillUpdate;xR.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},xR.shouldComponentUpdate=i}return r.__N||r.__}function LR(e,t){var n=PR(bR++,3);!DR.__s&&qR(n.__H,t)&&(n.__=e,n.u=t,xR.__H.__h.push(n))}function RR(e,t){var n=PR(bR++,4);!DR.__s&&qR(n.__H,t)&&(n.__=e,n.u=t,xR.__h.push(n))}function zR(e){return TR=5,BR(function(){return{current:e}},[])}function BR(e,t){var n=PR(bR++,7);return qR(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function VR(e,t){return TR=8,BR(function(){return e},t)}function HR(){for(var e;e=ER.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(GR),e.__H.__h.forEach(KR),e.__H.__h=[]}catch(t){e.__H.__h=[],DR.__e(t,e.__v)}}DR.__b=function(e){xR=null,OR&&OR(e)},DR.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),NR&&NR(e,t)},DR.__r=function(e){kR&&kR(e),bR=0;var t=(xR=e.__c).__H;t&&(SR===xR?(t.__h=[],xR.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(GR),t.__h.forEach(KR),t.__h=[],bR=0)),SR=xR},DR.diffed=function(e){AR&&AR(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ER.push(t)!==1&&CR===DR.requestAnimationFrame||((CR=DR.requestAnimationFrame)||WR)(HR)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),SR=xR=null},DR.__c=function(e,t){t.some(function(e){try{e.__h.forEach(GR),e.__h=e.__h.filter(function(e){return!e.__||KR(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],DR.__e(n,e.__v)}}),jR&&jR(e,t)},DR.unmount=function(e){MR&&MR(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{GR(e)}catch(e){t=e}}),n.__H=void 0,t&&DR.__e(t,n.__v))};var UR=typeof requestAnimationFrame==`function`;function WR(e){var t,n=function(){clearTimeout(r),UR&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);UR&&(t=requestAnimationFrame(n))}function GR(e){var t=xR,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),xR=t}function KR(e){var t=xR;e.__c=e.__(),xR=t}function qR(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!wR(t,e[n])})}function JR(e,t){return typeof t==`function`?t(e):t}function YR(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function XR(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function ZR({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return LL(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function QR(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:LL(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return LL(pL,{children:[LL(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:LL(ZL,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function $R(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function ez(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function tz(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function nz({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=dR(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:tz(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?tz(u,1,t,o):i&&r<=0&&c.length>0?uR(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var rz=400,iz=10,az=40,oz=18;function sz(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?cz(e,t,n):a instanceof HTMLElement?a:null}function cz(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function lz(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function uz(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function dz(){return navigator.vendor!==`Apple Computer, Inc.`}function fz(e,t){let n=e-t.top;if(n<az)return-Math.ceil((az-Math.max(0,n))/az*oz);let r=t.bottom-e;return r<az?Math.ceil((az-Math.max(0,r))/az*oz):0}function pz(e,t){if(e!=null){let t=fR[e];return t==null?null:{text:t,title:pR[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:mR}:null}function mz(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function hz(e){return e!=null&&`toggle`in e}function gz(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function _z(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function vz(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function yz(e,t){return e!=null&&e>0?e:t}function bz(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function xz(e,t,n,r,i=0){let a=vR({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a==null?!1:(e.scrollTop=a,!0)}function Sz(e,t,n,r,i,a){let o=yR({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o==null?!1:(e.scrollTop=o,!0)}function Cz(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function wz(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function Tz(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function Ez(e,t){return t&&Tz(e)||(e.ctrlKey||e.metaKey)&&gz(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var Dz=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function Oz(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function kz(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function Az(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function jz(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function Mz(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function Nz(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function Pz(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function Fz(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function Iz(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=Fz(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function Lz(e,t){return{kind:e.kind,name:ez(e),path:t}}function Rz(e){return e==null?void 0:`${e}__tree`}function zz(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function Bz(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function Vz(e,t){if(e==null)return null;if(`text`in e)return LL(`span`,{title:e.title,children:e.text});let n=typeof e.icon==`string`?Bz(e.icon)?t(e.icon):{name:e.icon}:Bz(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return LL(`span`,{title:e.title,children:LL(VL,{...n})})}function Hz(e){e!=null&&YR(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function Uz(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=$R(e);return LL(pL,{children:[e.depth>0?LL(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>LL(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,LL(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?LL(VL,{...t(`file-tree-icon-chevron`)}):LL(VL,{...t(`file-tree-icon-file`,u)})}),LL(`div`,{"data-item-section":`content`,children:e.isFlattened?QR(e,c,a):c??LL($L,{minimumLength:5,split:`extension`,children:e.name})}),i?LL(`div`,{"data-item-section":`decoration`,children:r==null?null:Vz(r,t)}):null,s?LL(`div`,{"data-item-section":`git`,children:Vz(o,t)}):null,n?LL(`div`,{"data-item-section":`action`,children:l?LL(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:LL(VL,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function Wz(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:w,contextMenuButtonVisibility:T,contextMenuRightClickEnabled:E,registerRenameInput:D,registerButton:O,resolveIcon:k,renderDecorationForRow:A,openContextMenuForRow:j,onRowClick:M,onKeyDown:N}=e,P=$R(t),{isParked:F=!1,mode:I=`flow`,style:L}=r,R=I===`sticky`,z=_?.get(P)??null??mz(t.ancestorPaths,v,y),B=t.kind===`directory`&&(b?.has(P)??!1),V=A(t,P),H=pz(z,B),U=S&&w,W=V!=null||x||U,G=U&&T===`always`,ee=a.getPath()===P,te=ee?a.getValue():``,ne=R||!ee?null:LL(ZR,{ref:D,ariaLabel:`Rename ${ez(t)}`,isFlattened:t.isFlattened,value:te,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),re=Uz(t,k,{actionLaneEnabled:U,customDecoration:V,decorationLaneEnabled:W,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:H,gitLaneActive:x,renameInput:ne,showDecorativeActionAffordance:G}),ie={...gR({ariaLabel:ez(t),domId:t.isFocused?zz(h,P,F):void 0,extraStyle:L,features:{actionLaneEnabled:U,contextMenuButtonVisibility:U?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:F,itemHeight:g,mode:I,row:t,state:{containsGitChange:B,effectiveGitStatus:z,isContextHovered:s===P,isDragTarget:l?.kind===`directory`&&l.directoryPath===P,isDragging:c?.has(P)===!0,isFocusRinged:t.isFocused&&o===P},targetPath:P}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),E&&(i.focusPath(P),j(t,P,{anchorRect:Az(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:R?void 0:()=>{i.focusPath(P)},onKeyDown:R?void 0:N,ref:e=>{O(P,e)}};return!R&&ee?LL(`div`,{...ie,children:re}):LL(`button`,{...ie,type:`button`,draggable:u&&!F,onDragEnd:u&&!F?p:void 0,onDragStart:u&&!F?e=>{f(e,t,P)}:void 0,onMouseDown:e=>{if(R){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!F?e=>{m(e,t,P)}:void 0,onClick:e=>{M(e,t,P,I)},children:re})}function Gz(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has($R(e))).map((n,r)=>Wz(e,n,t.start+r))}function Kz({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=qF,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=zR(null),v=zR(null),y=zR(!1),b=zR(null),x=zR(null),S=zR(null),C=zR(null),w=zR(null),T=zR(new Map),E=zR(new Map),D=zR(()=>{}),O=zR(null),k=zR(!1),A=zR(null),j=zR(null),M=zR(!1),N=zR(null),P=zR(null),F=zR(null),I=zR(null),L=zR(null),R=zR(null),z=zR(null),B=zR(null),V=zR(!1),H=zR(null),U=zR(null),W=zR(null),G=zR(null),ee=BR(()=>new Map,[]),[,te]=FR(0),[ne,re]=FR(null),[ie,ae]=FR(null),[oe,se]=FR(null),[K,ce]=FR(null),[le,ue]=FR(0),[q,de]=FR(null),fe=zR(q);fe.current=q;let pe=zR(null),me=zR(null),he=zR(null),ge=zR(null),_e=zR(null),ve=zR(!1),ye=()=>{me.current=null,he.current=null,ge.current=null},be=(e,t)=>{me.current=e,he.current=null,ge.current=t==null?null:{path:e,scrollTop:t}},xe=(e,t)=>{me.current=null,he.current={path:e,viewportOffset:t},ge.current=null},Se=zR(d===`retain`&&t.isSearchOpen()),[Ce,we]=FR(p);LR(()=>{p||we(!1)},[p]);let Te=zR(!1),Ee=VR(()=>{Te.current=!0,we(e=>e&&!1)},[]),[De,Oe]=FR(()=>nz({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[ke,Ae]=FR(!1);LR(()=>{Ae(!0)},[]);let je=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Me=e?.contextMenu?.triggerMode??(je?`right-click`:`both`),Ne=Me===`both`||Me===`button`,Pe=e?.contextMenu?.buttonVisibility??`when-needed`,Fe=Me===`both`||Me===`right-click`;RR(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;_e.current=t,ae(t),ce(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(ve.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let J=VR((e,t)=>{Mz(T.current,e,t)},[]),Ie=VR((e,t)=>{Mz(E.current,e,t)},[]),Le=VR(e=>{x.current=e},[]),Re=VR(e=>Nz(e,E.current,T.current),[]),ze=n!=null||r!=null||i!=null,{resolveIcon:Be}=BR(()=>iM(a),[a]),Ve=t[vI](),He=Ve.getPath(),Ue=He!=null,We=t.isSearchOpen(),Ge=t.getSearchValue(),Ke=t.getFocusedPath(),qe=t.getFocusedIndex(),Je=t.isDragAndDropEnabled(),Ye=t.getDragSession(),Xe=BR(()=>Ye==null?null:new Set(Ye.draggedPaths),[Ye]),Ze=Ye?.target??null,Qe=Ye?.primaryPath??null,$e=Rz(o),{overlayHeight:et,overlayRows:tt,snapshot:nt,visibleRows:rt}=De,it=nt.physical.viewportHeight,at=BR(()=>({end:nt.window.endIndex,start:nt.window.startIndex}),[nt.window.endIndex,nt.window.startIndex]),ot=tt,st=nt.sticky.rows,ct=nt.physical.totalHeight,lt=nt.sticky.height,ut=BR(()=>new Set(st.map(e=>$R(e.row))),[st]),dt=qe>=0&&qe>=at.start&&qe<=at.end,ft=VR((e,t)=>u?.({item:Lz(e,t),row:e})??null,[u]),pt=VR(e=>YR(e==null?null:T.current.get(e)??null)?!0:YR(S.current),[]),mt=VR(e=>{pt(t.focusNearestPath(e))},[t,pt]),ht=zR(mt);ht.current=mt;let gt=zR(!0),_t=zR(()=>{}),vt=VR((t=!0)=>{let n=fe.current;n!=null&&(gt.current=gt.current&&t,de(null),e?.contextMenu?.onClose?.(),gt.current&&mt(n.path))},[e?.contextMenu,mt]);_t.current=vt;let yt=VR(e=>{let t=e==null?null:jz(S.current,e);se(e=>e===t?e:t)},[]),bt=VR((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=Re(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;be(n,e?.scrollTop??null),k.current=!0,re(e=>e===n?e:n)}i.focus(),yt(a),gt.current=!0,de({anchorRect:r?.anchorRect??null,item:Lz(e,n),path:n,source:r?.source??`keyboard`})},[t,Re,yt]),xt=VR(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=vz(e,it);N.current=qe<0||e==null?null:Math.max(0,Math.min(qe*s-e.scrollTop,Math.max(0,t-s))),M.current=!0}t.startRenaming(e)!==!1&&(ce(`focus`),te(e=>e+1))}},[t,qe,s,l,it]),St=VR((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=vz(i,it),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:nz({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return k.current=!0,Sz(i,a,s,l,u,d),D.current(),pe.current=n?e:null,!0},[t,s,c,it,h]),Ct=()=>y.current===!0||G.current!=null||V.current===!0,wt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Tt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Et=()=>{I.current!=null&&(clearTimeout(I.current),I.current=null),F.current=null},Dt=()=>{R.current?.remove(),R.current=null},Ot=()=>{Tt(P.current),P.current=null,L.current=null},kt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},At=()=>{B.current?.(),B.current=null,G.current!=null&&(clearTimeout(G.current),G.current=null),V.current=!1,H.current=null,W.current=null,U.current!=null&&(U.current.setAttribute(`draggable`,`true`),U.current.style.removeProperty(`touch-action`),U.current=null),Dt(),Et(),Ot(),z.current=null},jt=(e,n)=>{let r=S.current?.getRootNode(),i=lz(sz(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Mt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Et();return}let r=t.getItem(e.directoryPath),i=hz(r)?r:null;if(i==null||i.isExpanded()){Et();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;F.current!==a&&(Et(),F.current=a,I.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind!==`directory`||n.directoryPath!==e.directoryPath||n.flattenedSegmentPath!==e.flattenedSegmentPath||i.expand()},n))},Nt=()=>{P.current=null;let e=L.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=fz(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,D.current()),Mt(jt(e.clientX,e.clientY)),P.current=wt(Nt)},Pt=(e,t)=>{L.current={clientX:e,clientY:t},P.current??=wt(Nt)},Ft=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(At(),Dt(),Et(),Ot(),t.startDrag(r)===!1){e.preventDefault();return}if(z.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),dz())){let t=uz(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),kt(t),R.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},It=()=>{Dt(),Et(),Ot(),z.current=null,t.cancelDrag()},Lt=(e,n,r)=>{if(G.current!=null||V.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;W.current={clientX:i.clientX,clientY:i.clientY},U.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!V.current;G.current!=null&&(clearTimeout(G.current),G.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),B.current===o&&(B.current=null),t&&(a.setAttribute(`draggable`,`true`),U.current===a&&(U.current=null),W.current=null)},s=e=>{let t=e.touches[0],n=W.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=iz*iz||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),B.current=o,G.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),U.current===a&&(U.current=null),W.current=null;return}V.current=!0,U.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),z.current=n;let e=a.getBoundingClientRect(),s=uz(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),kt(s),R.current=s,H.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=H.current;n!=null&&R.current!=null&&(R.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Mt(jt(t.clientX,t.clientY)),Pt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&jt(n.clientX,n.clientY),t.completeDrag(),At()},u=()=>{t.cancelDrag(),At()};B.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},rz)},Rt=e=>{if(q!=null){if(e.key===`Escape`){vt(),e.preventDefault(),e.stopPropagation();return}Dz.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(Ve.isActive()){if(e.key===`Escape`)Ve.cancel();else if(e.key===`Enter`)Ve.commit();else return;ce(`focus`),te(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){xt(Ke??void 0),e.preventDefault(),e.stopPropagation();return}if(We){if(e.key===`Escape`)M.current=!1,N.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=vz(n,it);N.current=qe<0||n==null?null:Math.max(0,Math.min(qe*s-n.scrollTop,Math.max(0,r-s))),M.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;ce(`focus`),te(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&_z(e)){t.openSearch(e.key),te(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=je&&Tz(e),r=Ez(e,je),i=r&&S.current!=null?XR(S.current):null,a=r?new Set(Pz(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==Ke&&a.has(o)){let e=C.current;be(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=hz(p)?p:null,h=u!=null&&(ut.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=Nz(u,E.current,T.current);e==null||n==null?y=!1:bt(e,u)}else if((e.ctrlKey||e.metaKey)&&gz(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;ce(`focus`);let b=t.getFocusedPath(),x=b!=null&&(ut.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))be(b,v?.scrollTop??null),k.current=!0,re(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(xe(b,Iz(S.current,v,i,u,s,lt,it)),k.current=!0,re(e=>e===b?e:b)):ye()}te(e=>e+1),e.preventDefault(),e.stopPropagation()};RR(()=>{if(!(!f||!We)){if(Se.current){Se.current=!1;return}YR(w.current)}},[We,f]),RR(()=>{let e=x.current;switch(hR({hasRenderedInput:e!=null,previousRenamingPath:j.current,renamingPath:He})){case`reset`:j.current=null;return;case`reveal-canonical`:He!=null&&St(He,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(pe.current=null,j.current=He,YR(e),e.select());return}},[at.end,at.start,He,St,ut]),RR(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=XR(e)?.dataset.itemPath??null;re(e=>e===t?e:t)},i=()=>{n(),k.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,XR(e)!=null){r();return}k.current=!1,re(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),k.current=!1,re(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;re(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),RR(()=>{let e=S.current;e!=null&&(nt.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[nt.physical.scrollTop]),RR(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=vz(n,g);let a=()=>{let e=t.getVisibleCount(),r=yz(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Oe(nz({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};D.current=a;let o=!1,l=t.subscribe(()=>{o?te(e=>e+1):o=!0,a()}),u=()=>{ve.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,ue(e=>e+1),e=null},50))},d=null,f=()=>{i!=null&&delete i.dataset.overlayReveal,d!=null&&(clearTimeout(d),d=null)},p=()=>{i==null||ve.current===!0||n.scrollTop>0||(i.dataset.overlayReveal=`true`,d!=null&&clearTimeout(d),d=setTimeout(()=>{f()},200))},m=()=>{if(a(),n.scrollTop>0&&f(),fe.current!=null&&y.current&&_t.current(),ve.current===!0){y.current=!1;return}ae(e=>e==null?e:null),u()},_=()=>{u(),p()},v=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),x=e=>{v.has(e.key)&&_()};n.addEventListener(`scroll`,m,{passive:!0}),n.addEventListener(`wheel`,_,{passive:!0}),n.addEventListener(`touchmove`,_,{passive:!0}),n.addEventListener(`keydown`,x);let w=typeof ResizeObserver<`u`?new ResizeObserver(e=>{O.current=(e[0]==null?null:bz(e[0]))??vz(n,g),a()}):null;return w?.observe(n),()=>{D.current=()=>{},l(),n.removeEventListener(`scroll`,m),n.removeEventListener(`wheel`,_),n.removeEventListener(`touchmove`,_),n.removeEventListener(`keydown`,x),e!=null&&clearTimeout(e),d!=null&&clearTimeout(d),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,O.current=null,w?.disconnect()}},[t,g,s,c,h]),RR(()=>{je||q==null||vt(!1)},[vt,je,q]);let zt=BR(()=>q==null?null:`${q.path}::${q.source}`,[q]);RR(()=>{if(zt==null){m?.clearSlotContent(Xj);return}let t=fe.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??kz(n.getBoundingClientRect()),close:e=>{_t.current(e?.restoreFocus??!0)},restoreFocus:()=>{gt.current&&ht.current(fe.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(Xj,i),e?.contextMenu?.onOpen?.(t.item,r),Hz(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&Hz(i)}),()=>{m?.clearSlotContent(Xj)}},[zt,e?.contextMenu,m]),RR(()=>{q!=null&&t.getItem(q.path)==null&&vt()},[vt,q,t]),RR(()=>{if(q==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(Oz(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&vt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),vt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[vt,q]),RR(()=>{let e=C.current,t=S.current;if(e==null||t==null){A.current=Ke;return}let n=Ke==null?null:T.current.get(Ke)??null,r=XR(t),i=r?.dataset.itemPath??null,a=Ue&&x.current===r,o=f&&w.current===r,c=M.current&&!We,l=N.current??0,u=pe.current,d=me.current,p=he.current,m=ge.current,h=r!=null,g=k.current||h,_=A.current!==Ke,v=d!=null&&d===Ke&&Ke!=null,y=c&&Sz(e,qe,s,it,ct,l),b=u!=null&&u===Ke&&Sz(e,qe,s,it,ct,lt),E=p!=null&&p.path===Ke&&Sz(e,qe,s,it,ct,p.viewportOffset),O=m!=null&&m.path===Ke&&e.scrollTop!==m.scrollTop;if(O&&(e.scrollTop=m.scrollTop),(O||b||E||y||g&&_&&u!==Ke&&!v&&xz(e,qe,s,it,lt))&&D.current(),!g){A.current=Ke;return}if(a){A.current=Ke;return}if(o&&!c){A.current=Ke;return}if(n==null){c&&qe>=0&&(Sz(e,qe,s,it,ct,l),D.current()),A.current=Ke;return}(_||c||u===Ke||d===Ke||p?.path===Ke||m?.path===Ke||i==null||i!==Ke)&&(YR(n),u===Ke&&(pe.current=null),d===Ke&&(me.current=null),p?.path===Ke&&(he.current=null),m?.path===Ke&&(ge.current=null),M.current=!1,N.current=null),A.current=Ke},[t,qe,Ke,dt,s,Ue,We,at,it,f,lt,ct,rt]);let Bt=qe>=0&&qe>=nt.visible.startIndex&&qe<=nt.visible.endIndex,Vt=Ke!=null&&ot.some(e=>$R(e.row)===Ke),Ht=Bt||Vt,Ut=Ne&&k.current===!0&&Ht?Ke:null,Wt=K===`pointer`?ie:null,Gt=q?.path??_e.current??Wt??Ut??ie,Kt=q?.source===`right-click`;RR(()=>{y.current&&q==null||yt(Re(Gt))},[q,Re,at,it,le,ot,Gt,yt,rt]);let qt=VR(e=>{if(y.current||Oz(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&ce(e=>e===`pointer`?e:`pointer`),ae(e=>e===i?e:i)},[]),Jt=VR(()=>{ae(null)},[]);RR(()=>{if(!Je)return;let e=()=>{At(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),At(),t.cancelDrag()}},[t,Je]);let Yt=e=>{if(!Je||t.getDragSession()==null||V.current)return;let n=lz(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Mt(t.getDragSession()?.target??null),Pt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},Xt=e=>{if(!Je||t.getDragSession()==null||V.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Et(),Ot(),t.setDragTarget(null))},Zt=e=>{!Je||t.getDragSession()==null||V.current||(e.preventDefault(),jt(e.clientX,e.clientY),t.completeDrag(),Dt(),Et(),Ot(),z.current=null)},Qt=nt.window.height,$t=nt.window.offsetTop,en=Math.min(0,it-Qt-lt),tn=ne===Ke||M.current,nn=Ke!=null&&tn&&!dt&&qe>=0?rt[qe]??t.getVisibleRows(qe,qe)[0]??null:null,rn=nn==null?null:Cz(qe,s,at,Qt),an=z.current,on=Qe!=null&&an!=null&&an.path===Qe&&an.index>=at.start&&an.index<=at.end,sn=Qe!=null&&an!=null&&an.path===Qe&&!on&&an.path!==nn?.path?an:null,cn=sn==null?null:Cz(sn.index,s,at,Qt),ln=wz((qe>=0?rt[qe]??t.getVisibleRows(qe,qe)[0]??null:null)?.ancestorPaths.at(-1)??null),un=We&&Ke!=null?zz(o,Ke,!dt):void 0,dn=q?.path??(We?Ke:ne),fn=q?.path??ie,pn=Re(Gt),mn=je&&Ne&&!Kt&&!Ue&&pn!=null&&oe!=null&&Gt!=null,hn=je&&(mn||q!=null),gn=q?.anchorRect,_n=gn==null&&pn!=null&&oe!=null&&(q!=null||mn)?oe:null,vn=gn==null?_n==null?void 0:{top:`${_n}px`}:{left:`${gn.left}px`,position:`fixed`,right:`auto`,top:`${gn.top}px`},yn=Kt?{opacity:`0`}:void 0,bn=VR((e,n,r,i)=>{let a=t.getItem(r),o=_R({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:t.isSearchOpen(),mode:i});switch(o.selection.kind){case`range`:t.selectPathRange(r,o.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(r);break;case`single`:t.selectOnlyPath(r);break}let s=e.currentTarget instanceof HTMLElement?e.currentTarget:null,c=n.index>=nt.visible.startIndex&&n.index<=nt.visible.endIndex,l=i===`flow`&&c&&s!=null&&s.dataset.itemParked!==`true`;a?.focus(),l&&(k.current=!0,re(e=>e===r?e:r),ce(`focus`)),o.toggleDirectory&&hz(a)&&a.toggle(),o.closeSearch&&t.closeSearch(),o.revealCanonical&&St(r,{targetOffset:`sticky-parents`})},[t,nt.visible.endIndex,nt.visible.startIndex,St]),xn=()=>{if(y.current||!Ne||Gt==null||pn==null)return;let e=t.getItem(Gt);e!=null&&(yt(pn),gt.current=!0,de({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:pn.getAttribute(`aria-label`)??Gt,path:e.getPath()},path:e.getPath(),source:`button`}))},Sn={contextHoverPath:fn,contextMenuButtonTriggerEnabled:Ne,contextMenuButtonVisibility:Pe,contextMenuEnabled:je,contextMenuRightClickEnabled:Fe,contextMenuTriggerMode:Me,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:Je,draggedPathSet:Xe,dragTarget:Ze,gitLaneActive:ze,gitStatusByPath:n,handleRowDragEnd:It,handleRowDragStart:Ft,handleRowTouchStart:Lt,ignoredGitDirectories:r,ignoredInheritanceCache:ee,instanceId:o,itemHeight:s,onKeyDown:Rt,onRowClick:bn,openContextMenuForRow:bt,registerButton:J,registerRenameInput:Le,renameView:Ve,renderDecorationForRow:ft,resolveIcon:Be,shouldSuppressContextMenu:Ct,visualFocusPath:dn},Cn={...Sn,registerButton:Ie};return LL(`div`,{ref:S,id:$e,"data-file-tree-context-menu-button-visibility":je&&Ne?Pe:void 0,"data-file-tree-context-menu-trigger-mode":je?Me:void 0,"data-file-tree-has-context-menu-action-lane":je&&Ne?`true`:void 0,"data-file-tree-has-git-lane":ze?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:Je?Xt:void 0,onDragOver:Je?Yt:void 0,onDrop:Je?Zt:void 0,onKeyDown:Rt,onPointerLeave:je?Jt:void 0,onPointerOver:je?qt:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[LL(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:ln}}),LL(`slot`,{name:Yj,"data-type":`header-slot`}),f?LL(`div`,{"data-file-tree-search-container":!0,"data-open":We?`true`:`false`,children:LL(`input`,{ref:w,"aria-activedescendant":un,"aria-controls":$e,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ce?`true`:void 0,value:Ge,onBlur:()=>{d===`retain`&&!Te.current||t.closeSearch()},onFocus:Ee,onPointerDown:Ee,onInput:e=>{Ee();let n=e.currentTarget;t.setSearch(n.value)}})}):null,LL(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&ke&&ot.length>0?LL(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:LL(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${et}px`},children:ot.map((e,t)=>Wz(Cn,e.row,`sticky:${$R(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${ot.length-t}`}}))})}):null,LL(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${ct}px`},children:[LL(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${$t}px`}}),LL(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${Qt}px`,top:`${en}px`,bottom:`${en}px`},children:[Gz(Sn,at,ut),nn!=null&&rn!=null?Wz(Sn,nn,`parked:${nn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:Qe===nn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${rn}px`}}):null,sn!=null&&cn!=null?Wz(Sn,sn,`parked-drag:${sn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${cn}px`}}):null]})]})]}),je?LL(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":hn?`true`:`false`,style:vn,children:[LL(`button`,{ref:v,type:`button`,"data-type":Zj,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":q==null?`false`:`true`,"data-visible":mn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),q!=null){vt();return}xn()},tabIndex:-1,style:yn,children:LL(VL,{...Be(`file-tree-icon-ellipsis`)})}),q==null?null:LL(`slot`,{name:Xj})]}):null,q==null?null:LL(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),vt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),vt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var qz={hydrateRoot:(e,t)=>{FL(dL(Kz,t),e)},renderRoot:(e,t)=>{PL(dL(Kz,t),e)},unmountRoot:e=>{PL(null,e)}};function Jz(e,t){qz.renderRoot(e,t)}function Yz(e,t){qz.hydrateRoot(e,t)}function Xz(e){qz.unmountRoot(e)}var Zz=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}},Qz=`__c`,$z=`__k`,eB=`__d`,tB=`__s`,nB=/[\s\n\\/='"\0<>]/,rB=/^(xlink|xmlns|xml)([A-Z])/,iB=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,aB=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,oB=new Set([`draggable`,`spellcheck`]);function sB(e){e.__g===void 0?e[eB]=!0:e.__g|=8}function cB(e){e.__g===void 0?e[eB]=!1:e.__g&=-9}function lB(e){return e.__g===void 0?!0===e[eB]:!!(8&e.__g)}var uB=/["&<]/;function dB(e){if(e.length===0||!1===uB.test(e))return e;for(var t=0,n=0,r=``,i=``;n<e.length;n++){switch(e.charCodeAt(n)){case 34:i=`&quot;`;break;case 38:i=`&amp;`;break;case 60:i=`&lt;`;break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=i,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var fB={},pB=new Set(`animation-iteration-count.border-image-outset.border-image-slice.border-image-width.box-flex.box-flex-group.box-ordinal-group.column-count.fill-opacity.flex.flex-grow.flex-negative.flex-order.flex-positive.flex-shrink.flood-opacity.font-weight.grid-column.grid-row.line-clamp.line-height.opacity.order.orphans.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.widows.z-index.zoom`.split(`.`)),mB=/[A-Z]/g;function hB(e){var t=``;for(var n in e){var r=e[n];if(r!=null&&r!==``){var i=n[0]==`-`?n:fB[n]||(fB[n]=n.replace(mB,`-$&`).toLowerCase()),a=`;`;typeof r!=`number`||i.startsWith(`--`)||pB.has(i)||(a=`px;`),t=t+i+`:`+r+a}}return t||void 0}function gB(){this.__d=!0}function _B(e,t){return{__v:e,context:t,props:e.props,setState:gB,forceUpdate:gB,__d:!0,__h:[]}}function vB(e,t,n){if(!e.s){if(n instanceof yB){if(!n.s)return void(n.o=vB.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(vB.bind(null,e,t),vB.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var yB=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{vB(r,1,a(this.v))}catch(e){vB(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?vB(r,1,t?t(i):i):n?vB(r,1,n(i)):vB(r,2,i)}catch(e){vB(r,2,e)}},r},e}(),bB,xB,SB,CB,wB={},TB=Array.isArray,EB=Object.assign,DB=``,OB=`<!--$s-->`,kB=`<!--/$s-->`;function AB(e,t){var n,r=e.type,i=!0;return e[Qz]?(i=!1,(n=e[Qz]).state=n[tB]):n=new r(e.props,t),e[Qz]=n,n.__v=e,n.props=e.props,n.context=t,sB(n),n.state??=wB,n[tB]??(n[tB]=n.state),r.getDerivedStateFromProps?n.state=EB({},n.state,r.getDerivedStateFromProps(n.props,n.state)):i&&n.componentWillMount?(n.componentWillMount(),n.state=n[tB]===n.state?n.state:n[tB]):!i&&n.componentWillUpdate&&n.componentWillUpdate(),SB&&SB(e),n.render(n.props,n.state,t)}function jB(e,t,n,r,i,a,o){if(e==null||!0===e||!1===e||e===DB)return DB;var s=typeof e;if(s!=`object`)return s==`function`?DB:s==`string`?dB(e):e+DB;if(TB(e)){var c,l=DB;i[$z]=e;for(var u=e.length,d=0;d<u;d++){var f=e[d];if(f!=null&&typeof f!=`boolean`){var p,m=jB(f,t,n,r,i,a,o);typeof m==`string`?l+=m:(c||=Array(u),l&&c.push(l),l=DB,TB(m)?(p=c).push.apply(p,m):c.push(m))}}return c?(l&&c.push(l),c):l}if(e.constructor!==void 0)return DB;e.__=i,bB&&bB(e);var h=e.type,g=e.props;if(typeof h==`function`){var _,v,y,b=t;if(h===pL){if(`tpl`in g){for(var x=DB,S=0;S<g.tpl.length;S++)if(x+=g.tpl[S],g.exprs&&S<g.exprs.length){var C=g.exprs[S];if(C==null)continue;typeof C!=`object`||C.constructor!==void 0&&!TB(C)?x+=C:x+=jB(C,t,n,r,e,a,o)}return x}if(`UNSTABLE_comment`in g)return`<!--`+dB(g.UNSTABLE_comment)+`-->`;v=g.children}else{if((_=h.contextType)!=null){var w=t[_.__c];b=w?w.props.value:_.__}var T=h.prototype&&typeof h.prototype.render==`function`;if(T)v=AB(e,b),y=e[Qz];else{e[Qz]=y=_B(e,b);for(var E=0;lB(y)&&E++<25;){cB(y),SB&&SB(e);try{v=h.call(y,g,b)}catch(t){throw a&&t&&typeof t.then==`function`&&(e._suspended=!0),t}}sB(y)}if(y.getChildContext!=null&&(t=EB({},t,y.getChildContext())),T&&YI.errorBoundaries&&(h.getDerivedStateFromError||y.componentDidCatch)){v=v!=null&&v.type===pL&&v.key==null&&v.props.tpl==null?v.props.children:v;try{return jB(v,t,n,r,e,a,!1)}catch(i){return h.getDerivedStateFromError&&(y[tB]=h.getDerivedStateFromError(i)),y.componentDidCatch&&y.componentDidCatch(i,wB),lB(y)?(v=AB(e,t),(y=e[Qz]).getChildContext!=null&&(t=EB({},t,y.getChildContext())),jB(v=v!=null&&v.type===pL&&v.key==null&&v.props.tpl==null?v.props.children:v,t,n,r,e,a,o)):DB}finally{xB&&xB(e),CB&&CB(e)}}}v=v!=null&&v.type===pL&&v.key==null&&v.props.tpl==null?v.props.children:v;try{var D=jB(v,t,n,r,e,a,o);return xB&&xB(e),YI.unmount&&YI.unmount(e),e._suspended?typeof D==`string`?OB+D+kB:TB(D)?(D.unshift(OB),D.push(kB),D):D.then(function(e){return OB+e+kB}):D}catch(i){if(!a&&o&&o.onError){var O=function i(s){return o.onError(s,e,function(e,s){try{return jB(e,t,n,r,s,a,o)}catch(e){return i(e)}})}(i);if(O!==void 0)return O;var k=YI.__e;return k&&k(i,e),DB}if(!a||!i||typeof i.then!=`function`)throw i;return i.then(function i(){try{var s=jB(v,t,n,r,e,a,o);return e._suspended?OB+s+kB:s}catch(e){if(!e||typeof e.then!=`function`)throw e;return e.then(i)}})}}var A,j=`<`+h,M=DB;for(var N in g){var P=g[N];if(typeof(P=NB(P)?P.value:P)!=`function`||N===`class`||N===`className`){switch(N){case`children`:A=P;continue;case`key`:case`ref`:case`__self`:case`__source`:continue;case`htmlFor`:if(`for`in g)continue;N=`for`;break;case`className`:if(`class`in g)continue;N=`class`;break;case`defaultChecked`:N=`checked`;break;case`defaultSelected`:N=`selected`;break;case`defaultValue`:case`value`:switch(N=`value`,h){case`textarea`:A=P;continue;case`select`:r=P;continue;case`option`:r!=P||`selected`in g||(j+=` selected`)}break;case`dangerouslySetInnerHTML`:M=P&&P.__html;continue;case`style`:typeof P==`object`&&(P=hB(P));break;case`acceptCharset`:N=`accept-charset`;break;case`httpEquiv`:N=`http-equiv`;break;default:if(rB.test(N))N=N.replace(rB,`$1:$2`).toLowerCase();else{if(nB.test(N))continue;N[4]!==`-`&&!oB.has(N)||P==null?n?aB.test(N)&&(N=N===`panose1`?`panose-1`:N.replace(/([A-Z])/g,`-$1`).toLowerCase()):iB.test(N)&&(N=N.toLowerCase()):P+=DB}}P!=null&&!1!==P&&(j=!0===P||P===DB?j+` `+N:j+` `+N+`="`+(typeof P==`string`?dB(P):P+DB)+`"`)}}if(nB.test(h))throw Error(h+` is not a valid HTML tag name in `+j+`>`);if(M||(typeof A==`string`?M=dB(A):A!=null&&!1!==A&&!0!==A&&(M=jB(A,t,h===`svg`||h!==`foreignObject`&&n,r,e,a,o))),xB&&xB(e),CB&&CB(e),!M&&MB.has(h))return j+`/>`;var F=`</`+h+`>`,I=j+`>`;return TB(M)?[I].concat(M,[F]):typeof M==`string`?I+M+F:[I,M,F]}var MB=new Set([`area`,`base`,`br`,`col`,`command`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function NB(e){return typeof e==`object`&&!!e&&typeof e.peek==`function`&&`value`in e}var PB=0;function FB(e){return e!=null&&e.length>0?e:(PB+=1,`pst_ft_${PB}`)}function IB({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??qF)}function LB(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function RB(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function zB(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var BB=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new Zz;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=FB(a),this.#p=JI(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=KF(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new UI({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(Xz(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){this.#t.resetPaths(e,t)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),Jz(t.wrapper,this.#w()))}setGitStatus(e){this.#p=JI(e,this.#p);let t=this.#T();t!=null&&Jz(t.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),Jz(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),Yz(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),Jz(r,this.#w())}#C(){return{initialViewportHeight:IB({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(Yj,e());return}this.#l.setSlotHtml(Yj,this.#e?.header?.html??null)}#k(e){let t=zB(e).find(e=>RB(e)),n=LB(zj($j(this.#m).set));n!=null&&(t!=null&&t.outerHTML===n.outerHTML||(t==null?e.prepend(n):t.replaceWith(n)))}#A(e){let t=zB(e),n=t.find(e=>RB(e)),r=t.filter(e=>e!==n),i=$j(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=LB(i);if(a==null){for(let e of r)e.remove();return}if(!(r.length===1&&r[0].outerHTML===a.outerHTML)){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=$j(this.#m);t.colored&&Vj(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${Gj}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}this.#g?.parentNode===e&&this.#_===this.#h||(this.#g??=document.createElement(`style`),this.#g.setAttribute(Gj,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=ZF(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return rI(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}},VB=typeof window>`u`?Q.useEffect:Q.useLayoutEffect;function HB(e,t,n){let r=e==null?null:(0,Z.jsx)(`div`,{slot:Yj,children:e}),i=t!=null&&n!=null?(0,Z.jsx)(`div`,{slot:Xj,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,Z.jsxs)(Z.Fragment,{children:[r,i]})}function UB(e,t){return typeof window>`u`&&t!=null?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t.shadowHtml}}),e]}):(0,Z.jsx)(Z.Fragment,{children:e})}function WB(e){let t=e.shadowRoot;return t?.querySelector(`[data-file-tree-id]`)instanceof HTMLElement||t?.querySelector(`[data-file-tree-id]`)instanceof SVGElement?!0:e.querySelector(`template[shadowrootmode="open"]`)instanceof HTMLTemplateElement}function GB(e,t,n,r,i){let a={...e??{}};if(t!=null&&delete a.header,n){let t=e?.contextMenu,n=t?.onClose,o=t?.onOpen;a.contextMenu={...t??{},enabled:!0,onClose:()=>{n?.(),r()},onOpen:(e,t)=>{i(e,t),o?.(e,t)}},delete a.contextMenu.render}return a.header!=null||a.contextMenu!=null?a:void 0}function KB({header:e,id:t,model:n,preloadedData:r,renderContextMenu:i,...a}){let[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(null),u=(0,Q.useRef)(n.getComposition()),d=(0,Q.useRef)(n);d.current!==n&&(d.current=n,u.current=n.getComposition());let f=i!=null,p=(0,Q.useCallback)(()=>{s(null)},[]),m=(0,Q.useCallback)((e,t)=>{s({context:t,item:e})},[]),h=u.current,g=(0,Q.useMemo)(()=>GB(h,e,f,p,m),[h,p,m,f,e]),_=(0,Q.useCallback)(e=>{l(e)},[]);(0,Q.useEffect)(()=>{f||s(null)},[f]),VB(()=>{n.setComposition(g)},[g,n]),VB(()=>{if(c!=null)return r!=null&&WB(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(h)}},[h,c,n,r]);let v=UB(HB(e,i,o),r),y=t??r?.id,b={"--trees-item-height":`${String(n.getItemHeight())}px`,"--trees-density-override":n.getDensityFactor(),...a.style};return(0,Z.jsx)(Uj,{...a,id:y,ref:_,style:b,suppressHydrationWarning:r!=null,children:v})}function qB(e){let t=(0,Q.useRef)(null);return t.current??=new BB(e),(0,Q.useEffect)(()=>{let e=t.current;return()=>{e?.cleanUp(),t.current=null}},[]),{model:t.current}}function JB(e){let t=e.lastIndexOf(`/`),n=t<0?e:e.slice(t+1),r=n.lastIndexOf(`.`);return r<=0?``:n.slice(r)}function YB(e,t){let n=e.lastIndexOf(`/`),r=n<0?``:e.slice(0,n+1),i=n<0?e:e.slice(n+1),a=i.lastIndexOf(`.`);return`${r}${a<=0?i:i.slice(0,a)}${t}`}function XB(e,t,n){if(n)return{kind:`allow`,destinationPath:t};let r=JB(e);if(r===``)return{kind:`allow`,destinationPath:t};let i=JB(t);return i&&i.toLowerCase()!==r.toLowerCase()?{kind:`block`}:{kind:`allow`,destinationPath:YB(t,r)}}var ZB=`data-ok-ext-badge`,QB=`
1858
- [data-item-selected='true'] [data-icon-token='markdown'] {
1859
- color: var(--trees-selected-fg);
1860
- }
1861
- [data-type='item'][data-item-path*='.']:not([data-item-path$='/']) [data-truncate-segment-priority]:last-child {
1862
- display: none;
1863
- }
1864
- [${ZB}] {
1865
- display: inline-block;
1866
- margin-left: 0.375rem;
1867
- margin-right: 0.25rem;
1868
- align-self: center;
1869
- color: color-mix(in oklab, var(--muted-foreground) 60%, transparent);
1870
- font-size: 0.75rem;
1871
- text-transform: uppercase;
1872
- flex-shrink: 0;
1873
- pointer-events: none;
1874
- user-select: none;
1875
- }
1876
- `;function $B(e){let t=e.querySelectorAll(`[data-type="item"][data-item-path]`);for(let e of t){let t=e.dataset.itemPath;if(!t||t.endsWith(`/`)){eV(e);continue}let n=JB(t);if(!n){eV(e);continue}let r=e.querySelector(`[data-truncate-group-container="middle"]`);if(!r)continue;let i=r.querySelectorAll(`[data-truncate-segment-priority]`);if(i.length<2)continue;let a=i[0];if(a){if(tV(a),n.toLowerCase()===`.md`){eV(e);continue}nV(e,n.slice(1).toUpperCase())}}}function eV(e){let t=e.querySelector(`[${ZB}]`);t&&t.remove()}function tV(e){let t=e.querySelectorAll(`[data-truncate-content]`);for(let e of t){let t=e.firstChild;if(!t||t.nodeType!==Node.TEXT_NODE)continue;let n=t.textContent??``;n.endsWith(`.`)&&(t.textContent=n.replace(/\.+$/,``))}}function nV(e,t){let n=e.querySelector(`[${ZB}]`);if(!n){n=e.ownerDocument.createElement(`span`),n.setAttribute(ZB,``),n.setAttribute(`aria-hidden`,`true`);let t=e.querySelector(`[data-item-section="action"]`);t?t.before(n):e.appendChild(n)}n.textContent!==t&&(n.textContent=t)}function rV(e){return e.replace(/\\/g,`\\\\`).replace(/\[/g,`\\[`).replace(/\]/g,`\\]`).replace(/\*/g,`\\*`)}function iV(e){let t=rV(e.path);return e.kind===`folder`?`/${t}/`:`/${t}${e.docExt??`.md`}`}var aV=`data-ok-rename-extension-chip`,oV=`data-ok-renaming`,sV=`data-ok-rename-stripped`,cV=null,lV=null,uV=5e3,dV=`
1877
- [data-item-section="content"]:has([data-item-rename-input]) {
1878
- position: relative;
1879
- }
1880
- [data-item-section="content"]:has([${aV}]) [data-item-rename-input] {
1881
- padding-inline-end: 36px;
1882
- }
1883
- [${aV}] {
1884
- position: absolute;
1885
- top: 50%;
1886
- right: 6px;
1887
- transform: translateY(-50%);
1888
- font-size: 0.6875rem;
1889
- line-height: 1;
1890
- letter-spacing: 0.02em;
1891
- color: color-mix(in oklab, var(--muted-foreground) 60%, transparent);
1892
- background: transparent;
1893
- padding: 2px 4px;
1894
- border-radius: 3px;
1895
- pointer-events: none;
1896
- user-select: none;
1897
- }
1898
- /* Pierre's icon decoration keys off the row's data-item-path. The chip's
1899
- value-strip plus Pierre's optimistic commit make the path temporarily
1900
- extensionless, so Pierre swaps the row's [data-icon-token] from
1901
- 'markdown' to 'default' until the disk-truth refresh restores .md.
1902
- Cover the wrong icon with a CSS-rendered markdown glyph for the duration.
1903
- applyRenameChip sets the marker on the row when the rename input mounts;
1904
- the sweep in applyRenameChip clears it when the path next includes the
1905
- saved extension (settle / cancel / row recycle to a settled file). */
1906
- [${oV}] [data-item-section="icon"] {
1907
- position: relative;
1908
- }
1909
- [${oV}] [data-item-section="icon"] [data-icon-token]:not([data-icon-token='markdown']) {
1910
- visibility: hidden;
1911
- }
1912
- [${oV}='.md'] [data-item-section="icon"]::before,
1913
- [${oV}='.mdx'] [data-item-section="icon"]::before {
1914
- content: '';
1915
- display: block;
1916
- position: absolute;
1917
- inset: 0;
1918
- margin: auto;
1919
- width: 16px;
1920
- height: 16px;
1921
- background-color: currentColor;
1922
- mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M1 12V4h2l2 2.5L7 4h2v8H7V7.5l-2 2-2-2V12zm9-3 3 3.5L16 9h-2V4h-2v5z'/></svg>") center / contain no-repeat;
1923
- pointer-events: none;
1924
- }
1925
- `;function fV(e){hV(e);let t=e.querySelector(`[data-item-rename-input]`);if(!t)return;let n=t.closest(`[data-item-section="content"]`),r=t.closest(`[data-type="item"]`);if(!n||!r)return;let i=r.dataset.itemPath??``;if(i.endsWith(`/`))return;let a=JB(i);a&&(gV(n,a),r.getAttribute(`data-ok-renaming`)!==a&&r.setAttribute(oV,a),pV(a),!t.hasAttribute(sV)&&(_V(t,a),t.setAttribute(sV,``)))}function pV(e){cV=e,lV!==null&&clearTimeout(lV),lV=setTimeout(mV,uV)}function mV(){cV=null,lV!==null&&(clearTimeout(lV),lV=null)}function hV(e){let t=e.querySelectorAll(`[${oV}]`);for(let e of t){if(e.querySelector(`[data-item-rename-input]`))continue;let t=e.getAttribute(oV);if(!t){e.removeAttribute(oV);continue}let n=e.dataset.itemPath??``;if(n.toLowerCase().endsWith(t.toLowerCase())){e.removeAttribute(oV);continue}let r=JB(n);r&&r.toLowerCase()!==t.toLowerCase()&&e.removeAttribute(oV)}if(cV===null)return;let n=e.querySelectorAll(`[data-type="item"][data-item-path]`),r=!1;for(let e of n){let t=e.dataset.itemPath??``;!t||t.endsWith(`/`)||JB(t)||(r=!0,e.getAttribute(`data-item-selected`)===`true`&&e.getAttribute(`data-ok-renaming`)!==cV&&e.setAttribute(oV,cV))}let i=!!e.querySelector(`[data-item-rename-input]`);!r&&!i&&mV()}function gV(e,t){let n=e.querySelector(`[${aV}]`);n||(n=e.ownerDocument.createElement(`span`),n.setAttribute(aV,``),n.setAttribute(`aria-hidden`,`true`),e.appendChild(n)),n.textContent!==t&&(n.textContent=t)}function _V(e,t){let n=e.value;if(!n.toLowerCase().endsWith(t.toLowerCase()))return;let r=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set;if(!r)return;let i=n.slice(0,-t.length);r.call(e,i),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.setSelectionRange(0,i.length)}function vV(e){return{selectedFilePath:e,selectedFolderPath:null,navigationPath:e}}function yV(e,t,n={}){if(!e)return vV(t);let r=Zr(e);if(t&&r!==t)return vV(t);switch(e.kind){case`doc`:return vV(t??e.docName);case`folder`:case`folder-index`:return{selectedFilePath:null,selectedFolderPath:e.folderPath,navigationPath:e.folderPath};case`missing`:return t&&n.isKnownDocument?.(t)?vV(t):{selectedFilePath:null,selectedFolderPath:null,navigationPath:null};case`asset`:return{selectedFilePath:null,selectedFolderPath:null,navigationPath:null}}}function bV(e,t){if(!e)return{kind:`none`};let n=t.find(t=>kO(t)===e);if(n&&An(n))return{kind:`asset`,path:n.path,hash:Jr(n.path),mediaKind:n.mediaKind};let r=NO(e);return e.endsWith(`/`)?t.some(e=>ur(e)?e.path===r||e.path.startsWith(`${r}/`):(An(e)?e.path:e.docName).startsWith(`${r}/`))?{kind:`folder`,path:r}:{kind:`none`}:t.some(e=>mi(e)&&e.docName===r)?{kind:`document`,path:r}:{kind:`none`}}var xV=`You can restore this file from the Trash.`;function SV(e){let t=xV,n=`Move to Trash`,r=`Moving`;if(e.length===0)return{title:`Are you sure you want to delete the selected items?`,detail:t,listedTargets:null,confirmLabel:n,confirmLabelBusy:r};if(e.length===1){let i=e[0];return i?i.kind===`folder`?{title:`Are you sure you want to delete '${i.name}' and its contents?`,detail:t,listedTargets:null,confirmLabel:n,confirmLabelBusy:r}:{title:`Are you sure you want to delete '${i.name}'?`,detail:t,listedTargets:null,confirmLabel:n,confirmLabelBusy:r}:{title:`Are you sure you want to delete the selected item?`,detail:t,listedTargets:null,confirmLabel:n,confirmLabelBusy:r}}let i=e.some(e=>e.kind===`folder`),a=e.some(e=>e.kind===`file`);return i&&a?{title:`Are you sure you want to delete the following ${e.length} files/directories and their contents?`,detail:t,listedTargets:e,confirmLabel:n,confirmLabelBusy:r}:i?{title:`Are you sure you want to delete the following ${e.length} directories and their contents?`,detail:t,listedTargets:e,confirmLabel:n,confirmLabelBusy:r}:{title:`Are you sure you want to delete the following ${e.length} files?`,detail:t,listedTargets:e,confirmLabel:n,confirmLabelBusy:r}}function CV(e,t){return e===`web`?null:SV(t)}function wV(e){return e.kind===`folder`?`${e.name}/`:e.docExt?`${e.name}${e.docExt}`:e.name}var TV=[`not-found`,`permission-denied`,`system-error`,`path-escape`];function EV(e){return typeof e==`string`&&TV.includes(e)?e:`system-error`}var DV={"not-found":`File not found`,"permission-denied":`Permission denied`,"system-error":`System error`,"path-escape":`Path resolves outside project`};function OV(e){let t=DV[e.reason];return e.detail?`Reason: ${t} (${e.detail})`:`Reason: ${t}`}function kV(e){return e.kind===`folder`?`${e.name}/`:e.name}function AV(e){let t=(0,$.c)(33),{failedTargets:n,isSubmitting:r,onDeletePermanently:i,onRetry:a,onCancel:o}=e,s=n.length>1,c=n[0],l;t[0]!==n.length||t[1]!==s||t[2]!==c?(l=s?`${n.length} items could not be moved to the Trash. Do you want to permanently delete instead?`:c?`Could not move "${kV(c)}" to the Trash. Do you want to permanently delete instead?\n${OV(c)}`:`Do you want to permanently delete instead?`,t[0]=n.length,t[1]=s,t[2]=c,t[3]=l):l=t[3];let u=l,d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(Ao,{children:`Couldn't move to Trash`}),t[4]=d):d=t[4];let f;t[5]===u?f=t[6]:(f=(0,Z.jsxs)(Bo,{children:[d,(0,Z.jsx)(Oo,{className:`whitespace-pre-wrap`,children:u})]}),t[5]=u,t[6]=f);let p;t[7]!==n||t[8]!==s?(p=s?(0,Z.jsx)(Lo,{children:(0,Z.jsx)(`ul`,{className:`flex flex-col gap-2 text-xs`,children:n.map(jV)})}):null,t[7]=n,t[8]=s,t[9]=p):p=t[9];let m;t[10]!==r||t[11]!==o?(m=(0,Z.jsx)(Y,{variant:`outline`,className:`font-mono uppercase`,onClick:o,disabled:r,"data-testid":`trash-failure-modal-cancel`,children:`Cancel`}),t[10]=r,t[11]=o,t[12]=m):m=t[12];let h;t[13]===r?h=t[14]:(h=r?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(tt,{className:`size-4 animate-spin`}),` Retrying`]}):`Retry`,t[13]=r,t[14]=h);let g;t[15]!==r||t[16]!==a||t[17]!==h?(g=(0,Z.jsx)(Y,{variant:`outline`,className:`font-mono uppercase`,onClick:a,disabled:r,"data-testid":`trash-failure-modal-retry`,children:h}),t[15]=r,t[16]=a,t[17]=h,t[18]=g):g=t[18];let _;t[19]===r?_=t[20]:(_=r?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(tt,{className:`size-4 animate-spin`}),` Deleting`]}):`Delete Permanently`,t[19]=r,t[20]=_);let v;t[21]!==r||t[22]!==i||t[23]!==_?(v=(0,Z.jsx)(Y,{variant:`destructive`,onClick:i,disabled:r,"data-testid":`trash-failure-modal-delete-permanently`,children:_}),t[21]=r,t[22]=i,t[23]=_,t[24]=v):v=t[24];let y;t[25]!==m||t[26]!==g||t[27]!==v?(y=(0,Z.jsxs)(Ro,{children:[m,g,v]}),t[25]=m,t[26]=g,t[27]=v,t[28]=y):y=t[28];let b;return t[29]!==y||t[30]!==f||t[31]!==p?(b=(0,Z.jsxs)(Po,{className:`sm:max-w-md`,children:[f,p,y]}),t[29]=y,t[30]=f,t[31]=p,t[32]=b):b=t[32],b}function jV(e){return(0,Z.jsxs)(`li`,{"data-testid":`trash-failure-modal-target`,children:[(0,Z.jsx)(`div`,{className:`font-mono text-foreground`,children:kV(e)}),(0,Z.jsx)(`div`,{className:`text-muted-foreground`,children:OV(e)})]},e.path)}function MV(e){return e?.isDirectory()?e:null}function NV(e,t){let n=t.getPath();for(let t of e.getSelectedPaths())t!==n&&e.getItem(t)?.deselect();t.isSelected()||t.select()}function PV(e,t,n,r){let i=(0,$.c)(6),a,o;i[0]!==n||i[1]!==t||i[2]!==e||i[3]!==r?(a=()=>{let i=()=>{queueMicrotask(()=>{r.current=!1})};if(r.current=!0,!t){for(let t of e.getSelectedPaths())e.getItem(t)?.deselect();i();return}let a=n?n.split(`\0`):[];for(let t of a){let n=MV(e.getItem(t));n&&!n.isExpanded()&&n.expand()}let o=e.getItem(t);if(!o){i();return}NV(e,o),o.focus(),i()},o=[n,t,e,r],i[0]=n,i[1]=t,i[2]=e,i[3]=r,i[4]=a,i[5]=o):(a=i[4],o=i[5]),(0,Q.useEffect)(a,o)}var FV={"not-found":`Terminal.app not found`,"spawn-error":`Could not launch Terminal`,timeout:`Terminal took too long to respond`,"path-escape":`Path resolves outside the project`,"ipc-error":`Lost connection to the main process`};async function IV(e,t){let n;try{n=await e.shell.openInTerminal(t)}catch(e){console.warn(`[shell] openInTerminal IPC threw`,{dirAbsPath:t,err:e}),X.error(`Could not open Terminal`,{description:FV[`ipc-error`]});return}n.ok||(console.warn(`[shell] openInTerminal failed`,{reason:n.reason,dirAbsPath:t}),X.error(`Could not open Terminal`,{description:FV[n.reason]}))}var LV=`open-knowledge:file-tree-menu-action-delete`,RV=`open-knowledge:file-tree-menu-action-rename`,zV=`open-knowledge:file-tree-menu-action-duplicate`;function BV(e){window.dispatchEvent(new CustomEvent(LV,{detail:{target:e}}))}function VV(e){let t=t=>{let n=t.detail;n?.target&&e(n.target)};return window.addEventListener(LV,t),()=>window.removeEventListener(LV,t)}function HV(e){window.dispatchEvent(new CustomEvent(RV,{detail:{target:e}}))}function UV(e){let t=t=>{let n=t.detail;n?.target&&e(n.target)};return window.addEventListener(RV,t),()=>window.removeEventListener(RV,t)}function WV(e){window.dispatchEvent(new CustomEvent(zV,{detail:{target:e}}))}function GV(e){let t=t=>{let n=t.detail;n?.target&&e(n.target)};return window.addEventListener(zV,t),()=>window.removeEventListener(zV,t)}function KV(e){let t=!1,n=!1,r=!1;async function i(){if(!r){t=!0;try{await e()}finally{t=!1,r?n=!1:n&&(n=!1,i())}}}return{request(){if(!r){if(t){n=!0;return}i()}},dispose(){r=!0,n=!1}}}function qV(e){return e?`No workspace`:null}function JV(e){let t=(0,$.c)(39),{input:n,installStates:r,dispatch:i,webFallbackVisible:a}=e,o=a===void 0?!0:a,s=n===null,c;t[0]===s?c=t[1]:(c=qV(s),t[0]=s,t[1]=c);let l=c,u,d,f,p,m,h;if(t[2]!==i||t[3]!==l||t[4]!==n||t[5]!==s||t[6]!==r){let e;t[13]===r?e=t[14]:(e=e=>r[e.id]?.installed===!0,t[13]=r,t[14]=e);let a=eh.filter(e);f=r[`claude-code`]?.installed===!0;let o;t[15]===n?o=t[16]:(o=n!==null&&n.docContext!==null?jr(n.docContext.relativePath):``,t[15]=n,t[16]=o);let c=o,g;t[17]!==n||t[18]!==c?(g=()=>{n!==null&&ES(c)},t[17]=n,t[18]=c,t[19]=g):g=t[19],p=g,d=oo,t[20]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsxs)(Ma,{children:[(0,Z.jsx)(Ji,{"aria-hidden":`true`}),`Open with AI`]}),t[20]=h):h=t[20],u=pa;let _;t[21]!==i||t[22]!==l||t[23]!==n||t[24]!==s?(_=e=>{let t=!s,r=l?`Open with AI ${e.displayName}, ${l}`:`Open with AI ${e.displayName}`;return(0,Z.jsxs)(Aa,{disabled:!t,onSelect:()=>{n&&i(e.id,n)},"data-testid":`file-tree-open-in-${e.id}`,"aria-label":r,children:[(0,Z.jsx)(bS,{id:e.id,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:e.displayName}),l?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:l}):null]},e.id)},t[21]=i,t[22]=l,t[23]=n,t[24]=s,t[25]=_):_=t[25],m=a.map(_),t[2]=i,t[3]=l,t[4]=n,t[5]=s,t[6]=r,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m,t[12]=h}else u=t[7],d=t[8],f=t[9],p=t[10],m=t[11],h=t[12];let g;t[26]!==f||t[27]!==p||t[28]!==s||t[29]!==o?(g=o&&!f?(0,Z.jsxs)(Aa,{onSelect:p,disabled:s,"data-testid":`file-tree-open-in-claude-web-fallback`,"aria-label":`Open in claude.ai, opens in browser with prompt pre-filled`,children:[(0,Z.jsx)(yt,{className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:`Open in claude.ai →`}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:`opens in browser`})]}):null,t[26]=f,t[27]=p,t[28]=s,t[29]=o,t[30]=g):g=t[30];let _;t[31]!==u||t[32]!==m||t[33]!==g?(_=(0,Z.jsxs)(u,{children:[m,g]}),t[31]=u,t[32]=m,t[33]=g,t[34]=_):_=t[34];let v;return t[35]!==d||t[36]!==h||t[37]!==_?(v=(0,Z.jsxs)(d,{children:[h,_]}),t[35]=d,t[36]=h,t[37]=_,t[38]=v):v=t[38],v}var YV=Bt(`HOVER_INTENT_MS`,80),XV=3,ZV=20,QV=new Map,$V=new Set,eH=[],tH=new Map;function nH(e){for(tH.delete(e),tH.set(e,!0);tH.size>ZV;){let e=tH.keys().next().value;if(e===void 0)break;tH.delete(e)}}function rH(e){$V.delete(e),aH()}function iH(e,t){let n=Date.now();Mt(`ok/sidebar/prewarm-success`,{docName:e,t:n,poolEventId:t}),se(e,t,n)}function aH(){for(;$V.size<XV&&eH.length>0;){let e=eH.shift();if(!e)break;if(!tH.has(e.docName)){$V.add(e.docName),nH(e.docName);try{let t=e.prewarm(e.docName);t&&iH(e.docName,t)}catch(t){Mt(`ok/sidebar/prewarm-failed`,{docName:e.docName,message:t instanceof Error?t.message:String(t)})}finally{rH(e.docName)}}}}function oH(e,t){if(qe(e)||tH.has(e))return;let n=QV.get(e);n&&clearTimeout(n.timer);let r=setTimeout(()=>{if(QV.delete(e),$V.size>=XV){eH.push({docName:e,prewarm:t});return}nH(e),$V.add(e);try{let n=t(e);n&&iH(e,n)}catch(t){Mt(`ok/sidebar/prewarm-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})}finally{rH(e)}},YV);QV.set(e,{timer:r,prewarm:t})}function sH(e){let t=QV.get(e);t&&(clearTimeout(t.timer),QV.delete(e))}var cH=/\.(md|mdx)$/i;function lH(e){if(window.location.hash===e)return;let{pathname:t,search:n}=window.location;window.history.replaceState(null,``,`${t}${n}${e}`)}function uH(e){let t=e.match(/^"(.+)" already exists\.$/);return t?t[1]:null}function dH(e){let t=e.match(cH);return t?t[0]:null}async function fH(e,t){try{await navigator.clipboard.writeText(e),X.success(`Copied ${t}`,{description:e})}catch(e){console.warn(`[FileTree] clipboard write failed:`,e),X.error(`Could not copy ${t}`)}}var pH=new Set([`agents`,`agent`,`claude`,`skill`]),mH=`ok-file-tree-link-decoration`,hH=`ok-file-tree-agent-decoration`;function gH(e){return e.map(([e,{key:t,...n}])=>`<${e} ${Object.entries(n).map(([e,t])=>`${e}="${t}"`).join(` `)} />`).join(``)}function _H(e,t){return`<symbol id="${e}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${gH(t)}</symbol>`}var vH=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
1926
- ${_H(mH,M)}
1927
- ${_H(hH,$s)}
1928
- </svg>`,yH=`${QB}\n${dV}`;function bH(e){return{...uM({type:e===`dark`?`dark`:`light`,colors:{"sideBar.background":`var(--sidebar)`,"sideBar.foreground":`var(--sidebar-foreground)`,"sideBar.border":`var(--sidebar-border)`,"list.activeSelectionBackground":`var(--sidebar-accent)`,"list.activeSelectionForeground":`var(--sidebar-accent-foreground)`,"list.hoverBackground":`var(--sidebar-hover)`,focusBorder:`var(--color-primary)`,"input.background":`var(--input)`,"input.border":`var(--border)`}}),"--trees-font-family-override":`var(--font-sans)`,"--trees-font-size-override":`0.875rem`,"--trees-item-padding-x-override":`0.5rem`,"--trees-padding-inline-override":`0.5rem`,"--trees-border-radius-override":`0.375rem`,"--trees-selected-fg":`var(--color-primary)`,"--truncate-marker-fade-in-duration":`0s`,"--trees-file-icon-color-markdown":`light-dark(var(--color-gray-400), var(--color-gray-500))`,"--trees-file-icon-color-image":`light-dark(var(--color-gray-400), var(--color-gray-500))`,"--trees-fg-muted":`light-dark(var(--color-gray-400), var(--color-gray-500))`}}function xH(e){let t=e.split(`/`).pop()?.replace(/\.md$/i,``).toLowerCase();return!!t&&pH.has(t)}function SH(e){return e===`darwin`?`Reveal in Finder`:e===`win32`?`Reveal in File Explorer`:`Open Containing Folder`}function CH(e){let t=(0,$.c)(14),{item:n,workspace:r,onClose:i}=e,a=typeof window<`u`?window.okDesktop:void 0;if(!a)return null;let o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=SH(a.platform),t[0]=o):o=t[0];let s=o,c=r?null:`No workspace`,l=!r,u;t[1]!==n||t[2]!==i||t[3]!==r?(u=()=>{if(!r)return;i();let e=Fh(r.contentDir,BO(n),r.pathSeparator);a.shell.showItemInFolder(e)},t[1]=n,t[2]=i,t[3]=r,t[4]=u):u=t[4];let d=c?`${s}, ${c}`:s,f,p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(ve,{"aria-hidden":`true`}),p=(0,Z.jsx)(`span`,{className:`flex-1`,children:s}),t[5]=f,t[6]=p):(f=t[5],p=t[6]);let m;t[7]===c?m=t[8]:(m=c?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:c}):null,t[7]=c,t[8]=m);let h;return t[9]!==l||t[10]!==u||t[11]!==d||t[12]!==m?(h=(0,Z.jsxs)(Aa,{disabled:l,onSelect:u,"aria-label":d,children:[f,p,m]}),t[9]=l,t[10]=u,t[11]=d,t[12]=m,t[13]=h):h=t[13],h}function wH(e){let t=(0,$.c)(12),{dirAbsPath:n,onClose:r}=e,i=typeof window<`u`?window.okDesktop:void 0;if(!i)return null;let a=n===null?`No workspace`:null,o=n===null,s;t[0]!==n||t[1]!==r?(s=()=>{n!==null&&(r(),IV(i,n))},t[0]=n,t[1]=r,t[2]=s):s=t[2];let c=a?`Open in Terminal, ${a}`:`Open in Terminal`,l,u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(il,{"aria-hidden":`true`}),u=(0,Z.jsx)(`span`,{className:`flex-1`,children:`Open in Terminal`}),t[3]=l,t[4]=u):(l=t[3],u=t[4]);let d;t[5]===a?d=t[6]:(d=a?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:a}):null,t[5]=a,t[6]=d);let f;return t[7]!==o||t[8]!==s||t[9]!==c||t[10]!==d?(f=(0,Z.jsxs)(Aa,{disabled:o,onSelect:s,"aria-label":c,children:[l,u,d]}),t[7]=o,t[8]=s,t[9]=c,t[10]=d,t[11]=f):f=t[11],f}function TH(e){return zO({kind:e.endsWith(`/`)?`directory`:`file`,name:e,path:e})}function EH(e,t){return e!==t&&e.startsWith(t)}function DH(e,t){let n=[...new Set(e)].filter(e=>!t(e)),r=n.filter(e=>e.endsWith(`/`));return n.filter(e=>!r.some(t=>EH(e,t))).map(TH)}function OH(e,t){return e===t||e.startsWith(`${t}/`)}function kH(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.isContentEditable||e.closest(`[contenteditable="true"]`)!==null}function AH(e,t,n){let r=new Set,i=new Set;for(let a of e){if(a.kind===`file`){r.add(a.path);continue}i.add(a.path);for(let e of t)mi(e)&&e.docName.startsWith(`${a.path}/`)&&r.add(e.docName);for(let e of n){let t=jO(e);OH(t,a.path)&&i.add(t)}}return{docNames:r,folderPaths:i}}function jH(e,t){return e.kind===`file`?t.kind===`file`&&e.path===t.createdPath:OH(t.createdPath,e.path)}function MH(e){let t=(0,$.c)(78),{item:n,context:r,anyActionBusy:i,workspace:a,handoff:o,model:s,okignoreBinding:c,projectLocalBinding:l,mergedConfig:u,onStartCreating:d,onStartCreatingFromTemplate:f,onDuplicate:p,onDelete:m,onExpandSubtree:h,onCollapseSubtree:g,folderTreePaths:_,isAsset:v,isAssetTreePath:y}=e,b,x,S,C,w,T,E,D;if(t[0]!==v||t[1]!==y||t[2]!==n||t[3]!==u?.appearance?.sidebar?.showAllFiles||t[4]!==u?.appearance?.sidebar?.showHiddenFiles||t[5]!==s||t[6]!==c||t[7]!==l){D=zO(n),C=n.kind===`directory`,b=!v&&c!==null,S=C?`Hide folder`:`Hide this file`,T=u?.appearance?.sidebar?.showHiddenFiles??!1,w=u?.appearance?.sidebar?.showAllFiles??!1,x=l!==null;let e=s.getSelectedPaths();E=e.includes(D.treePath)?DH(e,y):[],t[0]=v,t[1]=y,t[2]=n,t[3]=u?.appearance?.sidebar?.showAllFiles,t[4]=u?.appearance?.sidebar?.showHiddenFiles,t[5]=s,t[6]=c,t[7]=l,t[8]=b,t[9]=x,t[10]=S,t[11]=C,t[12]=w,t[13]=T,t[14]=E,t[15]=D}else b=t[8],x=t[9],S=t[10],C=t[11],w=t[12],T=t[13],E=t[14],D=t[15];let O=E,k;t[16]!==O||t[17]!==D?(k=O.length>1?O:[D],t[16]=O,t[17]=D,t[18]=k):k=t[18];let A=k,j=A.length>1?`Delete ${A.length} Items`:`Delete`,M;t[19]!==C||t[20]!==n||t[21]!==a?(M=C&&a?Fh(a.contentDir,BO(n),a.pathSeparator):null,t[19]=C,t[20]=n,t[21]=a,t[22]=M):M=t[22];let N=M,P;if(t[23]!==C||t[24]!==n||t[25]!==a){bb0:{if(!a||C){P=null;break bb0}let e=BO(n),t=e.lastIndexOf(`/`);if(t===-1){P=a.contentDir;break bb0}P=Fh(a.contentDir,e.slice(0,t),a.pathSeparator)}t[23]=C,t[24]=n,t[25]=a,t[26]=P}else P=t[26];let I=P,L;t[27]!==v||t[28]!==C||t[29]!==n||t[30]!==a?(L=v?null:C?zh({folderRelativePath:BO(n),workspace:a}):Lh({docName:OO(n.path),workspace:a}),t[27]=v,t[28]=C,t[29]=n,t[30]=a,t[31]=L):L=t[31];let z=L,B;t[32]===r?B=t[33]:(B=()=>r.close({restoreFocus:!1}),t[32]=r,t[33]=B);let V=B,H;t[34]===r?H=t[35]:(H=()=>r.close(),t[34]=r,t[35]=H);let U=H,W;t[36]===l?W=t[37]:(W=e=>{if(l===null)return;let t=l.patch({appearance:{sidebar:{showHiddenFiles:e}}});t.ok||(console.warn(`[FileTree] showHiddenFiles toggle rejected:`,wi(t.error)),X.error(`Could not update sidebar settings`,{description:wi(t.error)}))},t[36]=l,t[37]=W);let G=W,ee;t[38]===l?ee=t[39]:(ee=e=>{if(l===null)return;let t=l.patch({appearance:{sidebar:{showAllFiles:e}}});t.ok||(console.warn(`[FileTree] showAllFiles toggle rejected:`,wi(t.error)),X.error(`Could not update sidebar settings`,{description:wi(t.error)}))},t[38]=l,t[39]=ee);let te=ee,ne=0,re=0;if(C){let e=MO(n.path);for(let t of _)(t===e||t.startsWith(e))&&(ne++,MV(s.getItem(t))?.isExpanded()&&re++)}let ie=C&&re<ne,ae=C&&re>0,oe;t[40]===U?oe=t[41]:(oe=e=>{e||U()},t[40]=U,t[41]=oe);let se;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,Z.jsx)(ja,{asChild:!0,children:(0,Z.jsx)(`span`,{"aria-hidden":`true`,"data-file-tree-context-menu-root":`true`,className:`block size-px`})}),t[42]=se):se=t[42];let K;t[43]!==i||t[44]!==b||t[45]!==x||t[46]!==U||t[47]!==V||t[48]!==j||t[49]!==A||t[50]!==N||t[51]!==te||t[52]!==G||t[53]!==o||t[54]!==z||t[55]!==S||t[56]!==v||t[57]!==C||t[58]!==n||t[59]!==s||t[60]!==c||t[61]!==g||t[62]!==m||t[63]!==p||t[64]!==h||t[65]!==d||t[66]!==f||t[67]!==I||t[68]!==w||t[69]!==T||t[70]!==ae||t[71]!==ie||t[72]!==D||t[73]!==a?(K=(0,Z.jsx)(Oa,{sideOffset:0,align:`start`,"data-file-tree-context-menu-root":`true`,className:`min-w-52`,children:C?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Aa,{disabled:i,onSelect:()=>{V(),d(`file`,jO(n.path))},children:[(0,Z.jsx)($c,{"aria-hidden":`true`}),`New File`]}),(0,Z.jsxs)(Aa,{disabled:i,onSelect:()=>{V(),f(jO(n.path))},children:[(0,Z.jsx)(hc,{"aria-hidden":`true`}),`New from template`]}),(0,Z.jsxs)(Aa,{disabled:i,onSelect:()=>{V(),d(`folder`,jO(n.path))},children:[(0,Z.jsx)(yc,{"aria-hidden":`true`}),`New Folder`]}),(0,Z.jsx)(ma,{}),(0,Z.jsx)(CH,{item:n,workspace:a,onClose:U}),(0,Z.jsx)(JV,{input:z,installStates:o.installStates,isElectronHost:o.isElectronHost,dispatch:o.dispatch,webFallbackVisible:!1}),(0,Z.jsx)(wH,{dirAbsPath:N,onClose:U}),(0,Z.jsxs)(oo,{children:[(0,Z.jsxs)(Ma,{children:[(0,Z.jsx)(F,{"aria-hidden":`true`}),`Copy Path`]}),(0,Z.jsxs)(pa,{children:[(0,Z.jsx)(Aa,{disabled:!a,onSelect:()=>{a&&(U(),fH(Fh(a.contentDir,BO(n),a.pathSeparator),`full path`))},children:`Full Path`}),(0,Z.jsx)(Aa,{onSelect:()=>{U(),fH(BO(n),`relative path`)},children:`Relative Path`})]})]}),(0,Z.jsx)(ma,{}),(0,Z.jsx)(da,{checked:T,onCheckedChange:G,disabled:!x,"data-testid":`file-tree-menu-show-hidden-files`,children:`Show Hidden Files`}),(0,Z.jsx)(da,{checked:w,onCheckedChange:te,disabled:!x,"data-testid":`file-tree-menu-show-all-files`,children:`Show all files`}),ie||ae?(0,Z.jsx)(ma,{}):null,ie?(0,Z.jsxs)(Aa,{onSelect:()=>{U(),h(n.path)},children:[(0,Z.jsx)(sl,{"aria-hidden":`true`}),`Expand All`]}):null,ae?(0,Z.jsxs)(Aa,{onSelect:()=>{U(),g(n.path)},children:[(0,Z.jsx)(_c,{"aria-hidden":`true`}),`Collapse All`]}):null,(0,Z.jsx)(ma,{}),(0,Z.jsxs)(Aa,{disabled:i,onSelect:()=>{U(),p(D)},children:[(0,Z.jsx)(Ae,{"aria-hidden":`true`}),`Duplicate`]}),(0,Z.jsxs)(Aa,{disabled:i,onSelect:()=>{V(),s.startRenaming(n.path)},children:[(0,Z.jsx)(rt,{"aria-hidden":`true`}),`Rename`]}),(0,Z.jsxs)(Aa,{"data-testid":`file-tree-menu-hide`,disabled:!b,onSelect:()=>{if(!c)return;U();let e=iV(D),t=po(c.current()),n=no(t,e);if(n===t)return;c.patch(io(n));let r=D.path.split(`/`).pop()||D.path;X.success(`Hidden folder “${r}”`,{description:`Manage hidden files in Settings → Ignore patterns.`,duration:5e3})},children:[(0,Z.jsx)(R,{"aria-hidden":`true`}),S]}),(0,Z.jsxs)(Aa,{variant:`destructive`,disabled:i,onSelect:()=>{U(),m(A)},children:[(0,Z.jsx)(fe,{"aria-hidden":`true`}),j]})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(CH,{item:n,workspace:a,onClose:U}),!v&&(0,Z.jsx)(JV,{input:z,installStates:o.installStates,isElectronHost:o.isElectronHost,dispatch:o.dispatch,webFallbackVisible:!0}),(0,Z.jsx)(wH,{dirAbsPath:I,onClose:U}),(0,Z.jsxs)(oo,{children:[(0,Z.jsxs)(Ma,{children:[(0,Z.jsx)(F,{"aria-hidden":`true`}),`Copy Path`]}),(0,Z.jsxs)(pa,{children:[(0,Z.jsx)(Aa,{disabled:!a,onSelect:()=>{a&&(U(),fH(Fh(a.contentDir,BO(n),a.pathSeparator),`full path`))},children:`Full Path`}),(0,Z.jsx)(Aa,{onSelect:()=>{U(),fH(BO(n),`relative path`)},children:`Relative Path`})]})]}),v?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ma,{}),(0,Z.jsxs)(Aa,{disabled:i,onSelect:()=>{U(),p(D)},children:[(0,Z.jsx)(Ae,{"aria-hidden":`true`}),`Duplicate`]}),(0,Z.jsxs)(Aa,{disabled:i,onSelect:()=>{V(),s.startRenaming(n.path)},children:[(0,Z.jsx)(rt,{"aria-hidden":`true`}),`Rename`]}),(0,Z.jsxs)(Aa,{"data-testid":`file-tree-menu-hide`,disabled:!b,onSelect:()=>{if(!c)return;U();let e=iV(D),t=po(c.current()),n=no(t,e);if(n===t)return;c.patch(io(n));let r=D.path.split(`/`).pop()||D.path;X.success(`Hidden “${r}”`,{description:`Manage hidden files in Settings → Ignore patterns.`,duration:5e3})},children:[(0,Z.jsx)(R,{"aria-hidden":`true`}),S]}),(0,Z.jsxs)(Aa,{variant:`destructive`,disabled:i,onSelect:()=>{U(),m(A)},children:[(0,Z.jsx)(fe,{"aria-hidden":`true`}),j]})]})]})}),t[43]=i,t[44]=b,t[45]=x,t[46]=U,t[47]=V,t[48]=j,t[49]=A,t[50]=N,t[51]=te,t[52]=G,t[53]=o,t[54]=z,t[55]=S,t[56]=v,t[57]=C,t[58]=n,t[59]=s,t[60]=c,t[61]=g,t[62]=m,t[63]=p,t[64]=h,t[65]=d,t[66]=f,t[67]=I,t[68]=w,t[69]=T,t[70]=ae,t[71]=ie,t[72]=D,t[73]=a,t[74]=K):K=t[74];let ce;return t[75]!==oe||t[76]!==K?(ce=(0,Z.jsxs)(ka,{open:!0,modal:!1,onOpenChange:oe,children:[se,K]}),t[75]=oe,t[76]=K,t[77]=ce):ce=t[77],ce}function NH(e){let t=(0,$.c)(236),{ref:n}=e,{activeDocName:r,activeTarget:i,closeTabs:a,closeDocument:o,closeAndClearForRename:s,getPoolActiveDocName:c,isNewTabActive:l,openTarget:u,prewarm:d,remapTabsForRename:f}=ut(),{notifySidebarFileSelected:p}=UD(),{resolvedTheme:m}=Gr(),{addPage:h}=Nr(),g;t[0]!==p||t[1]!==u?(g=function(e){u({kind:`doc`,target:e,docName:e},{tabBehavior:`replace-active`}),lH(kr(e)),p()},t[0]=p,t[1]=u,t[2]=g):g=t[2];let _=g,v;t[3]!==p||t[4]!==u?(v=function(e){let t=ei(e);u({kind:`folder`,target:e,folderPath:e},{tabBehavior:`replace-active`}),lH(t),p()},t[3]=p,t[4]=u,t[5]=v):v=t[5];let y=v,x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=[],t[6]=x):x=t[6];let[S,C]=(0,Q.useState)(x),[w,E]=(0,Q.useState)(!0),[D,O]=(0,Q.useState)(null),[k,A]=(0,Q.useState)(null),[j,M]=(0,Q.useState)(null),[P,F]=(0,Q.useState)(null),[I,L]=(0,Q.useState)(null),[R,z]=(0,Q.useState)(null),B=(0,Q.useRef)(S),V;t[7]!==S||t[8]!==y||t[9]!==_||t[10]!==p||t[11]!==u?(V=function(e,t){let n=bV(e,t===void 0?S:t);if(n.kind===`none`){console.debug(`[FileTree] Dropped selection for unknown docName:`,NO(e));return}if(n.kind===`asset`){u({kind:`asset`,target:n.path,assetPath:n.path,mediaKind:n.mediaKind},{tabBehavior:`replace-active`}),lH(n.hash),p();return}if(n.kind===`folder`){y(n.path);return}_(n.path)},t[7]=S,t[8]=y,t[9]=_,t[10]=p,t[11]=u,t[12]=V):V=t[12];let H=V,U=(0,Q.useRef)(r),W;t[13]===S?W=t[14]:(W=new Set(S.filter(An).map($H)),t[13]=S,t[14]=W);let G=W,ee=(0,Q.useRef)(G),te;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(te=[],t[15]=te):te=t[15];let ne=(0,Q.useRef)(te),re=(0,Q.useRef)(null),ie=(0,Q.useRef)(QH),ae=(0,Q.useRef)(null),oe=(0,Q.useRef)(null),se=(0,Q.useRef)(!1),K=(0,Q.useRef)(null),ce=(0,Q.useRef)(!1),le=(0,Q.useRef)(!1),ue=(0,Q.useRef)(null),q=(0,Q.useRef)(null),de=(0,Q.useRef)(ZH),fe=(0,Q.useRef)(XH),pe=(0,Q.useRef)(YH),me=(0,Q.useRef)(JH),he=(0,Q.useRef)(i),{selectedFilePath:ge,selectedFolderPath:_e,navigationPath:ve}=yV(i,l?null:r),ye=ge?DO(ge,S.find(e=>mi(e)&&e.docName===ge)?.docExt):_e?MO(_e):i?.kind===`asset`?i.assetPath:null,be=sg().states,{dispatch:xe}=Xh(),Se;t[16]!==xe||t[17]!==be?(Se={installStates:be,isElectronHost:typeof window<`u`&&window.okDesktop!=null,dispatch:xe},t[16]=xe,t[17]=be,t[18]=Se):Se=t[18];let Ce=Se,{okignoreBinding:we,projectLocalBinding:Te,merged:Ee}=b(),De=Ee?.appearance?.sidebar?.showHiddenFiles??!1,Oe=Ee?.appearance?.sidebar?.showAllFiles??!1,ke;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(ke=()=>K.current===null,t[19]=ke):ke=t[19];let Ae=ke,je;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(je=[],t[20]=je):je=t[20];let Me;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(Me={set:`complete`,spriteSheet:vH},t[21]=Me):Me=t[21];let Ne;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(Ne={contextMenu:{enabled:!0,triggerMode:`both`,buttonVisibility:`when-needed`}},t[22]=Ne):Ne=t[22];let Pe;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(Pe={canDrag:Ae,canDrop:Ae,onDropComplete:e=>me.current(e),onDropError:qH},t[23]=Pe):Pe=t[23];let Fe;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(Fe={paths:je,flattenEmptyDirectories:!1,initialExpansion:`closed`,fileTreeSearchMode:`hide-non-matches`,initialVisibleRowCount:18,stickyFolders:!0,icons:Me,unsafeCSS:yH,composition:Ne,dragAndDrop:Pe,renaming:{canRename:Ae,onRename:e=>fe.current(e),onError:e=>pe.current(e)},onSelectionChange:e=>de.current(e),renderRowDecoration:e=>{let{item:t}=e;if(t.kind!==`file`)return null;let n=B.current.find(e=>mi(e)&&DO(e.docName,e.docExt)===t.path);return n?.isSymlink?{icon:mH,title:n.targetPath?`Symlink to ${n.targetPath}`:`Symlink`}:xH(t.path)?{icon:hH,title:`Agent configuration file`}:null}},t[24]=Fe):Fe=t[24];let{model:J}=qB(Fe),Ie;t[25]===J?Ie=t[26]:(Ie=function(e){let t=J.getItem(e)??J.getItem(MO(e));return t?.isDirectory()?MO(jO(t.getPath())):e},t[25]=J,t[26]=Ie);let Le=Ie,Re,ze;t[27]===S?(Re=t[28],ze=t[29]):(ze=PO(S),Re=FO(ze),t[27]=S,t[28]=Re,t[29]=ze);let Be=Re,Ve=(0,Q.useRef)(ze),Ue;t[30]===S?Ue=t[31]:(Ue=LO(S),t[30]=S,t[31]=Ue);let We=Ue,Ge=(0,Q.useRef)(We),Ke=_e?RO(MO(_e)).slice(0,-1):RO(ye??ve),qe=Ke.join(`\0`),Je;if(t[32]!==J){let e=()=>{let e=new Set;for(let t of Ge.current)MV(J.getItem(t))?.isExpanded()&&e.add(t);return e};Je=t=>{let n=new Set(LO(t??B.current)),r=e();for(let e of ne.current)r.add(e);return[...r].filter(e=>n.has(e))},t[32]=J,t[33]=Je}else Je=t[33];let Ye=Je,Xe;t[34]!==Ye||t[35]!==J?(Xe=e=>{let t=PO(e??B.current);J.resetPaths(t,{initialExpandedPaths:Ye(e)})},t[34]=Ye,t[35]=J,t[36]=Xe):Xe=t[36];let Ze=Xe,Qe;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=e=>{ae.current=IO(e)},t[37]=Qe):Qe=t[37];let $e=Qe,et;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(et=e=>ee.current.has(e),t[38]=et):et=t[38];let tt=et,nt;t[39]!==h||t[40]!==y||t[41]!==_||t[42]!==Ze?(nt=async function(e){if(K.current!==null)return;let t=()=>{A(null),K.current=null};K.current=e.path,A(e.path),O(null);try{let n=await T(await fetch(`/api/duplicate-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e.kind,path:e.path})}),`Failed to duplicate path`);if(!n.ok){X.error(n.title),O(n.title),Ze(),t();return}let r=N(yi,n.body,`duplicate-path`,null);if(r===null){X.error(`Duplicate succeeded but the sidebar may be out of date — refresh to resync`),O(`Duplicate succeeded but the sidebar may be out of date — refresh to resync`),Wr([`files`,`backlinks`,`graph`]),Ze(),t();return}for(let e of r.duplicatedDocNames)h(e);C(t=>{let n=QO(t,e,r);return Ze(n),$e(n),n}),Wr([`files`,`backlinks`,`graph`]),r.path!==e.path&&(r.kind===`folder`?y(r.path):_(r.path)),X.success(r.kind===`folder`?`Folder duplicated`:`File duplicated`,{description:r.path}),t()}catch(e){let n=e,r=n instanceof Error?n.message:String(n);console.warn(`[FileTree] duplicate failed:`,n),X.error(`Could not duplicate item`,{description:r}),Ze(),t()}},t[39]=h,t[40]=y,t[41]=_,t[42]=Ze,t[43]=nt):nt=t[43];let rt=nt,it=(0,Q.useRef)(rt),at;t[44]===rt?at=t[45]:(at=()=>{it.current=rt},t[44]=rt,t[45]=at),(0,Q.useEffect)(at);let ot=function(e){let t=uH(e);if(!t||dH(t))return!1;let n=J.getFocusedPath()??J.getSelectedPaths()[0]??null;if(!n||n.endsWith(`/`)||tt(n))return!1;let r=dH(n);if(!r)return!1;let i=MO(t);if(!Ge.current.includes(i))return!1;let a=`${t}${r}`;return Ve.current.includes(a)?!1:(Pt({sourcePath:n,destinationPath:a,isFolder:!1}),J.move(n,a),!0)},st;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(st=e=>{let t=e??re.current;!t||re.current!==t||(t.disposeCommitListener(),re.current=null)},t[46]=st):st=t[46];let ct=st,lt;t[47]!==ct||t[48]!==o||t[49]!==a||t[50]!==Ze?(lt=async function(e,t){let n=t===void 0?{}:t,r=n.updateUi??!0,i=n.restoreLocation??r;ct(e),r&&A(e.renamePath);try{let t=await fetch(`/api/delete-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e.kind,path:e.createdPath})});if(!t.ok&&t.status!==404){let n=await T(t,`Failed to clean up pending ${e.kind}`);if(n.ok)return;let i=`${n.title} - ${e.kind} "${e.createdPath}" still exists on disk`;r?X.error(i):console.warn(`[FileTree] cleanup pending create failed: ${i}`),r&&(A(null),Ze());return}}catch(t){console.warn(`[FileTree] cleanup pending create failed:`,t),r&&X.error(`Network error - ${e.kind} "${e.createdPath}" still exists on disk`),r&&(A(null),Ze());return}r&&(e.kind===`file`?o(e.createdPath):a([He(e.createdPath)],{force:!0})),r&&C(t=>{let n=ZO(t,e.kind===`file`?[e.createdPath]:[],e.kind===`folder`?e.createdPath:void 0);return $e(n),n}),Wr([`files`,`backlinks`,`graph`]),i&&(window.location.hash=e.previousHash),r&&A(null)},t[47]=ct,t[48]=o,t[49]=a,t[50]=Ze,t[51]=lt):lt=t[51];let dt=lt,ft,pt;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(ft=()=>()=>{let e=re.current;e&&ie.current(e,{restoreLocation:!1,updateUi:!1}).catch(KH)},pt=[],t[52]=ft,t[53]=pt):(ft=t[52],pt=t[53]),(0,Q.useEffect)(ft,pt);let mt,ht;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(mt=()=>{let e=!0,t=KV(async function(){try{let t=le.current,n=await T(await fetch(t?`/api/documents?showAll=true`:`/api/documents`),`Failed to load documents`);if(!e)return;if(!n.ok)O(n.title);else{let e=Mr.safeParse(n.body);if(!e.success)O(`Documents response did not match expected shape.`);else{let n=ce.current||t;C(or(e.data.documents,n)),O(null)}}}catch(t){let n=t;e&&O(`Could not reach server`),console.warn(`[FileTree] fetch failed:`,n)}e&&E(!1)});ue.current=()=>t.request(),t.request();let n=()=>{document.visibilityState===`visible`&&t.request()};window.addEventListener(`focus`,n),window.addEventListener(`visibilitychange`,n);let r=Dr(e=>{e.includes(`files`)&&t.request()});return()=>{e=!1,ue.current=null,t.dispose(),window.removeEventListener(`focus`,n),window.removeEventListener(`visibilitychange`,n),r()}},ht=[],t[54]=mt,t[55]=ht):(mt=t[54],ht=t[55]),(0,Q.useEffect)(mt,ht);let gt=(0,Q.useRef)(!0),vt;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(vt=()=>{if(gt.current){gt.current=!1;return}ue.current?.()},t[56]=vt):vt=t[56];let yt;t[57]===De?yt=t[58]:(yt=[De],t[57]=De,t[58]=yt),(0,Q.useEffect)(vt,yt);let bt=(0,Q.useRef)(!0),xt;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(xt=()=>{if(bt.current){bt.current=!1;return}ue.current?.()},t[59]=xt):xt=t[59];let St;t[60]===Oe?St=t[61]:(St=[Oe],t[60]=Oe,t[61]=St),(0,Q.useEffect)(xt,St);let Ct,wt;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Ct=()=>{let e=!0;return fetch(`/api/workspace`).then(async t=>{let n=await t.json();if(!e||!t.ok)return;let r=N(Ar,n,`workspace`,null);r&&z({contentDir:r.contentDir,pathSeparator:r.pathSeparator})}).catch(GH),()=>{e=!1}},wt=[],t[62]=Ct,t[63]=wt):(Ct=t[62],wt=t[63]),(0,Q.useEffect)(Ct,wt);let Tt;t[64]!==Ye||t[65]!==J||t[66]!==Be?(Tt=()=>{if(ae.current===Be){ae.current=null;return}J.resetPaths(Ve.current,{initialExpandedPaths:Ye()})},t[64]=Ye,t[65]=J,t[66]=Be,t[67]=Tt):Tt=t[67];let Et;t[68]!==J||t[69]!==Be?(Et=[J,Be],t[68]=J,t[69]=Be,t[70]=Et):Et=t[70],(0,Q.useEffect)(Tt,Et),PV(J,ye,qe,se);let Dt,Ot;t[71]===J?(Dt=t[72],Ot=t[73]):(Dt=()=>J.subscribe(()=>{if(!J.isSearchOpen())for(let e of ne.current){let t=MV(J.getItem(e));t&&!t.isExpanded()&&t.expand()}}),Ot=[J],t[71]=J,t[72]=Dt,t[73]=Ot),(0,Q.useEffect)(Dt,Ot);let kt,At;t[74]===J?(kt=t[75],At=t[76]):(kt=()=>J.onMutation(`remove`,e=>{let t=re.current;!t||e.path!==t.renamePath||ie.current(t)}),At=[J],t[74]=J,t[75]=kt,t[76]=At),(0,Q.useEffect)(kt,At);let Mt;t[77]!==h||t[78]!==s||t[79]!==c||t[80]!==y||t[81]!==f?(Mt=async(e,t,n)=>{let r=t===void 0?[]:t,i=n?.docName??U.current,a=$O(i,e),o=n?.folderPath??(he.current?.kind===`folder`?he.current.folderPath:null),l=o?jt(o,r):null;_t(e);let u=ek(e,c());await Promise.all(u.map(e=>s(e)));for(let t of e)h(t.toDocName);f(e,r),C(t=>{let n=XO(t,e,r);return $e(n),n}),o&&l&&l!==o?y(l):a&&a!==i&&(window.location.hash=kr(a)),Wr([`files`,`backlinks`,`graph`])},t[77]=h,t[78]=s,t[79]=c,t[80]=y,t[81]=f,t[82]=Mt):Mt=t[82];let Nt=Mt;async function Pt(e){let t=VO(e.sourcePath,e.isFolder);A(t),O(null);try{if(!e.isFolder&&tt(t)){X.error(`Assets cannot be renamed from the sidebar`),queueMicrotask(()=>{Ze()}),ct(),A(null);return}let n=XB(e.sourcePath,e.destinationPath,e.isFolder);if(n.kind===`block`){X.error(`File extensions are managed automatically - please rename without changing the extension`),queueMicrotask(()=>{Ze()}),ct(),A(null);return}let r=VO(n.destinationPath,e.isFolder),i=e.isFolder?{kind:`folder`,fromPath:jO(t),toPath:jO(r)}:{kind:`file`,fromPath:OO(t),toPath:OO(r)},a={docName:U.current,folderPath:he.current?.kind===`folder`?he.current.folderPath:null},o=await T(await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(i)}),`Failed to rename path`);if(!o.ok){X.error(o.title),O(o.title),Ze();let e=re.current;e&&e.renamePath===t?await dt(e):ct(),A(null);return}let s=N(mr,o.body,`rename-path`,{renamed:[]});try{await Nt(s.renamed,e.isFolder?[{fromPath:jO(t),toPath:jO(r)}]:[],a)}catch(e){console.warn(`[FileTree] post-rename reconciliation failed`,{err:e,sourceTreePath:t,destinationTreePath:r,renamedCount:s.renamed.length}),X.error(`Rename succeeded but the sidebar may be out of date — refresh to resync`)}ct(),A(null)}catch(e){console.warn(`[FileTree] rename failed:`,e),X.error(`Network error — please try again`),O(`Network error — please try again`),Ze();let n=re.current;n&&n.renamePath===t?await dt(n):ct(),A(null)}}let Ft;t[83]!==Nt||t[84]!==Ze?(Ft=async function(e){let t=e.draggedPaths.map(t=>{let n=WO(t,e.target);return t===n?null:{sourcePath:t,destinationTreePath:n}}).filter(WH);if(t.length!==0){if(t.some(e=>tt(e.sourcePath))){X.error(`Assets cannot be moved from the sidebar`),Ze();return}A(t[0]?.sourcePath??null),O(null);try{let e=[],n=[],r={docName:U.current,folderPath:he.current?.kind===`folder`?he.current.folderPath:null};for(let r of t){let t=r.sourcePath.endsWith(`/`),i=t?{kind:`folder`,fromPath:jO(r.sourcePath),toPath:jO(r.destinationTreePath)}:{kind:`file`,fromPath:OO(r.sourcePath),toPath:OO(r.destinationTreePath)},a=await T(await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(i)}),`Failed to move`);if(!a.ok){X.error(a.title),O(a.title),Ze(),A(null);return}let o=N(mr,a.body,`rename-path:drop`,{renamed:[]});e=e.concat(o.renamed),t&&n.push({fromPath:jO(r.sourcePath),toPath:jO(r.destinationTreePath)})}try{await Nt(e,n,r)}catch(n){console.warn(`[FileTree] post-move reconciliation failed`,{err:n,operationCount:t.length,renamedCount:e.length}),X.error(`Move succeeded but the sidebar may be out of date — refresh to resync`)}A(null)}catch(e){console.warn(`[FileTree] move failed:`,e),X.error(`Network error — please try again`),Ze(),A(null)}}},t[83]=Nt,t[84]=Ze,t[85]=Ft):Ft=t[85];let It=Ft,Lt;t[86]===Symbol.for(`react.memo_cache_sentinel`)?(Lt=function(e){L({parentDir:e})},t[86]=Lt):Lt=t[86];let Rt=Lt,zt;t[87]!==dt||t[88]!==ct||t[89]!==J||t[90]!==y||t[91]!==_||t[92]!==Ze||t[93]!==ze?(zt=async function(e,t){if(K.current)return;let n=re.current;n&&ct(n);try{let n=HO(e,t,[...ze,...Ge.current]);A(n.renamePath),K.current=n.renamePath;let r=window.location.hash,i;if(e===`file`){let e=UO(`file`,n.addPath),t=await T(await fetch(`/api/create-page`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})}),`Failed to create file`);if(!t.ok){X.error(t.title),O(t.title),A(null),K.current=null;return}let r=OO(e),a=N(Ur,t.body,`create-page`,{docName:r}).docName;i=a;let o=e.toLowerCase().endsWith(`.mdx`)?`.mdx`:`.md`;C(e=>{if(e.some(e=>mi(e)&&e.docName===a))return e;let t=[...e,{kind:`document`,docName:a,docExt:o,modified:new Date().toISOString(),size:0}];return $e(t),t}),Wr([`files`,`backlinks`,`graph`]),_(a)}else{let e=jO(n.addPath),t=await T(await fetch(`/api/create-folder`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})}),`Failed to create folder`);if(!t.ok){X.error(t.title),O(t.title),A(null),K.current=null;return}i=N(qr,t.body,`create-folder`,{path:e}).path,C(e=>{if(e.some(e=>ur(e)&&e.path===i))return e;let t=[...e,{kind:`folder`,path:i,modified:new Date().toISOString(),size:0}];return $e(t),t}),Wr([`files`]),y(i)}let a=!1,o=e=>{if(e.key!==`Enter`)return;let t=re.current;!t||t.renamePath!==n.renamePath||queueMicrotask(()=>ct(t))};document.addEventListener(`keydown`,o,!0),re.current={kind:e,renamePath:n.renamePath,createdPath:i,previousHash:r,disposeCommitListener:()=>{a||(a=!0,document.removeEventListener(`keydown`,o,!0))}},A(null),K.current=null,J.add(n.addPath),J.startRenaming(n.renamePath,{removeIfCanceled:!0})}catch(e){console.warn(`[FileTree] create placeholder failed:`,e),X.error(`Could not start creating a new item`);let t=re.current;t?await dt(t):ct(),A(null),K.current=null,Ze()}},t[87]=dt,t[88]=ct,t[89]=J,t[90]=y,t[91]=_,t[92]=Ze,t[93]=ze,t[94]=zt):zt=t[94];let Bt=zt,Vt;t[95]===J?Vt=t[96]:(Vt=function(e){let t=MO(e);(0,Q.startTransition)(()=>{for(let e of Ge.current)if(e===t||e.startsWith(t)){let t=MV(J.getItem(e));t&&t.expand()}})},t[95]=J,t[96]=Vt);let Ht=Vt,Ut;t[97]===J?Ut=t[98]:(Ut=function(e){let t=MO(e),n=new Set(ne.current);(0,Q.startTransition)(()=>{for(let e of[...Ge.current].reverse())if((e===t||e.startsWith(t))&&!n.has(e)){let t=MV(J.getItem(e));t&&t.collapse()}})},t[97]=J,t[98]=Ut);let Wt=Ut,Gt;t[99]!==H||t[100]!==Ke||t[101]!==r||t[102]!==i||t[103]!==G||t[104]!==k||t[105]!==dt||t[106]!==S||t[107]!==We||t[108]!==It||t[109]!==Pt||t[110]!==Le||t[111]!==ot||t[112]!==Oe||t[113]!==De||t[114]!==ze?(Gt=()=>{B.current=S,U.current=r,he.current=i,ee.current=G,K.current=k,ce.current=De,le.current=Oe,Ve.current=ze,Ge.current=We,ne.current=Ke,ie.current=dt,de.current=e=>{if(se.current||e.length!==1)return;let t=e[0];t&&H(Le(t),S)},pe.current=e=>{ot(e)||X.error(e)},fe.current=Pt,me.current=It},t[99]=H,t[100]=Ke,t[101]=r,t[102]=i,t[103]=G,t[104]=k,t[105]=dt,t[106]=S,t[107]=We,t[108]=It,t[109]=Pt,t[110]=Le,t[111]=ot,t[112]=Oe,t[113]=De,t[114]=ze,t[115]=Gt):Gt=t[115],(0,Q.useLayoutEffect)(Gt);let Kt,qt;t[116]===J?(Kt=t[117],qt=t[118]):(Kt=()=>{let e=e=>{let t=(e.metaKey||e.ctrlKey)&&!e.altKey,n=e.key.toLowerCase(),r=t&&n===`a`,i=t&&!e.shiftKey&&n===`d`;if(!r&&!i||kH(e.target))return;let a=q.current,o=e.target,s=document.activeElement,c=o instanceof Node&&a?.contains(o),l=s instanceof Node&&a?.contains(s);if(!c&&!l)return;if(i){let t=J.getFocusedPath()??J.getSelectedPaths()[0]??null;if(!t)return;let n=J.getItem(t)??J.getItem(MO(t)),r=n?.isDirectory()?MO(jO(n.getPath())):t;if(ee.current.has(r))return;it.current(TH(r)),e.preventDefault(),e.stopPropagation();return}let u=new Set([...Ge.current,...Ve.current]);se.current=!0;for(let e of u)!e||ee.current.has(e)||J.getItem(e)?.select();queueMicrotask(()=>{se.current=!1}),e.preventDefault(),e.stopPropagation()};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},qt=[J],t[116]=J,t[117]=Kt,t[118]=qt),(0,Q.useEffect)(Kt,qt);let Jt,Yt;t[119]!==S.length||t[120]!==w?(Jt=()=>{if(w||S.length===0)return;let e=q.current?.querySelector(Uj)?.shadowRoot;if(!e)return;let t=UH,n=()=>{for(let n of e.querySelectorAll(`[data-item-path]`)){let e=n.dataset.itemPath;if(!e)continue;let r=t(e);n.title!==r&&(n.title=r)}let n=e.querySelector(`[data-type="context-menu-anchor"]`);if(n){let r=e.querySelector(`[data-item-context-hover="true"][data-item-path]`)?.dataset.itemPath,i=r?t(r):``;n.title!==i&&(n.title=i)}};n();let r=new MutationObserver(n);return r.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-item-path`,`data-item-context-hover`]}),()=>r.disconnect()},Yt=[w,S.length],t[119]=S.length,t[120]=w,t[121]=Jt,t[122]=Yt):(Jt=t[121],Yt=t[122]),(0,Q.useEffect)(Jt,Yt);let Xt,Zt;t[123]!==S.length||t[124]!==w?(Xt=()=>{if(w||S.length===0)return;let e=q.current?.querySelector(Uj)?.shadowRoot;if(!e)return;let t=()=>$B(e);t();let n=new MutationObserver(t);return n.observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:[`data-item-path`]}),()=>n.disconnect()},Zt=[w,S.length],t[123]=S.length,t[124]=w,t[125]=Xt,t[126]=Zt):(Xt=t[125],Zt=t[126]),(0,Q.useEffect)(Xt,Zt);let Qt,$t;t[127]!==S.length||t[128]!==w?(Qt=()=>{if(w||S.length===0)return;let e=q.current?.querySelector(Uj)?.shadowRoot;if(!e)return;let t=()=>fV(e);t();let n=new MutationObserver(t);return n.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-item-path`]}),()=>n.disconnect()},$t=[w,S.length],t[127]=S.length,t[128]=w,t[129]=Qt,t[130]=$t):(Qt=t[129],$t=t[130]),(0,Q.useEffect)(Qt,$t);let en;t[131]===Symbol.for(`react.memo_cache_sentinel`)?(en={folderCount:0,expandedCount:0},t[131]=en):en=t[131];let tn=(0,Q.useRef)(en),nn=(0,Q.useRef)(Bt),rn=(0,Q.useRef)(Rt),an;t[132]===Bt?an=t[133]:(an=()=>{nn.current=Bt,rn.current=Rt},t[132]=Bt,t[133]=an),(0,Q.useEffect)(an);let on,sn;t[134]===J?(on=t[135],sn=t[136]):(on=()=>({startCreating(e,t){nn.current(e,t)},startCreatingFromTemplate(e){rn.current(e)},expandAll(){(0,Q.startTransition)(()=>{for(let e of Ge.current){let t=MV(J.getItem(e));t&&t.expand()}})},collapseAll(){let e=new Set(ne.current);(0,Q.startTransition)(()=>{for(let t of[...Ge.current].reverse()){if(e.has(t))continue;let n=MV(J.getItem(t));n&&n.collapse()}})},getFolderState(){let e=Ge.current,t=0;for(let n of e)MV(J.getItem(n))?.isExpanded()&&t++;let n=e.length,r=tn.current;if(r.folderCount===n&&r.expandedCount===t)return r;let i={folderCount:n,expandedCount:t};return tn.current=i,i},subscribe(e){return J.subscribe(e)}}),sn=[J],t[134]=J,t[135]=on,t[136]=sn),(0,Q.useImperativeHandle)(n,on,sn);let cn;t[137]!==ct||t[138]!==s||t[139]!==a||t[140]!==J?(cn=async function(e,t,n){let r=AH(e,B.current,Ge.current),i=re.current;i&&e.some(e=>jH(e,i))&&(i.kind===`file`?r.docNames.add(i.createdPath):r.folderPaths.add(i.createdPath),ct(i));let o=new Set([...r.docNames,...t]),c=new Set([...r.folderPaths,...n]);a([...[...o].map(HH),...[...c].map(VH)],{force:!0}),await Promise.all([...o].map(e=>s(e)));for(let t of e){let e=t.kind===`folder`?MO(t.path):DO(t.path,t.docExt);J.getItem(e)&&J.remove(e,t.kind===`folder`?{recursive:!0}:void 0)}C(e=>{let t=ZO(e,[...o]);for(let e of c)t=ZO(t,[],e);return $e(t),t}),Wr([`files`,`backlinks`,`graph`])},t[137]=ct,t[138]=s,t[139]=a,t[140]=J,t[141]=cn):cn=t[141];let ln=cn,un;t[142]===ln?un=t[143]:(un=async function(e){let t=[],n=[],r=[];for(let i of e){A(i.path);let e=await T(await fetch(`/api/delete-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:i.kind,path:i.path})}),`Failed to delete path`);if(!e.ok)return r.length>0&&await ln(r,t,n),X.error(e.title),!1;let a=N(Si,e.body,`delete-path`,{deletedDocNames:[]});t.push(...a.deletedDocNames),i.kind===`folder`&&n.push(i.path),r.push(i)}return await ln(r,t,n),!0},t[142]=ln,t[143]=un);let dn=un,fn;t[144]===Symbol.for(`react.memo_cache_sentinel`)?(fn=async function(e,t,n){let r=[],i=[];for(let a of e){A(a.path);let e=tk(a,n),o=await t.shell.trashItem(e);o.ok?r.push(a):i.push({kind:a.kind,path:a.path,name:a.name,reason:EV(o.reason),detail:o.detail})}return{trashed:r,failed:i}},t[144]=fn):fn=t[144];let pn=fn,mn;t[145]===Symbol.for(`react.memo_cache_sentinel`)?(mn=async function(e){let t=[],n=[],r=[];for(let i of e)try{let e=await T(await fetch(`/api/trash/cleanup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:i.kind,path:i.path})}),`Failed to clean up after trash`);if(!e.ok){console.warn(`[FileTree] trash-cleanup failed`,{target:`${i.kind}:${i.path}`,reason:e.title}),r.push({target:i,reason:e.title});continue}let a=N(Tn,e.body,`trash-cleanup`,{deletedDocNames:[]});t.push(...a.deletedDocNames),i.kind===`folder`&&n.push(i.path)}catch(e){let t=e;console.warn(`[FileTree] trash-cleanup threw`,{target:`${i.kind}:${i.path}`,err:t}),r.push({target:i,reason:`Network error during cleanup`})}if(r.length>0){let e=r.length,t=e===1?`item`:`items`;X.error(`Server-side cleanup failed for ${e} ${t}`,{description:`The file is in your Trash; the file-watcher will reconcile.`})}return r.length===e.length&&e.length>0?null:{deletedDocNames:t,deletedFolderPaths:n}},t[145]=mn):mn=t[145];let hn=mn,gn;t[146]!==ln||t[147]!==dn||t[148]!==Ze||t[149]!==R?(gn=async function(e){let t=e[0];if(!t)return;A(t.path),M(null);let n=typeof window<`u`?window.okDesktop:void 0;try{if(n&&R){let{trashed:t,failed:r}=await pn(e,n,R);if(t.length>0){let e=await hn(t);e?await ln(t,e.deletedDocNames,e.deletedFolderPaths):await ln(t,t.filter(BH).map(zH),t.filter(RH).map(LH))}r.length>0&&F({failed:r,originalTargets:[...e]}),A(null)}else{let t=await dn(e);A(null),t||Ze()}}catch(e){let t=e,n=t instanceof Error?t.message:String(t);console.warn(`[FileTree] delete failed:`,t),X.error(`Could not complete delete`,{description:n}),A(null),Ze()}},t[146]=ln,t[147]=dn,t[148]=Ze,t[149]=R,t[150]=gn):gn=t[150];let _n=gn,vn;t[151]!==dn||t[152]!==Ze||t[153]!==P?(vn=async function(){if(!P)return;let e=new Set(P.failed.map(IH)),t=P.originalTargets.filter(t=>e.has(`${t.kind}:${t.path}`));if(F(null),t.length!==0){A(t[0]?.path??null);try{let e=await dn(t);A(null),e||Ze()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);console.warn(`[FileTree] hard-delete fallback failed:`,t),X.error(`Could not complete delete`,{description:n}),A(null),Ze()}}},t[151]=dn,t[152]=Ze,t[153]=P,t[154]=vn):vn=t[154];let yn=vn,bn;t[155]!==_n||t[156]!==P?(bn=async function(){if(!P)return;let e=new Set(P.failed.map(FH)),t=P.originalTargets.filter(t=>e.has(`${t.kind}:${t.path}`));F(null),await _n(t)},t[155]=_n,t[156]=P,t[157]=bn):bn=t[157];let xn=bn,Sn=(0,Q.useRef)(_n),Cn;t[158]===_n?Cn=t[159]:(Cn=()=>{Sn.current=_n},t[158]=_n,t[159]=Cn),(0,Q.useEffect)(Cn);let wn,En;t[160]===Symbol.for(`react.memo_cache_sentinel`)?(wn=()=>VV(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=B.current.find(e=>mi(e)&&e.docName===t);Sn.current([{kind:`file`,path:t,name:t.split(`/`).pop()??t,docExt:n?.docExt}]);return}if(e.kind===`folder`){Sn.current([{kind:`folder`,path:e.folderPath,name:e.folderPath.split(`/`).pop()??e.folderPath}]);return}console.warn(JSON.stringify({event:`file-tree-menu-action-delete-unsupported-kind`,kind:e.kind}))}),En=[],t[160]=wn,t[161]=En):(wn=t[160],En=t[161]),(0,Q.useEffect)(wn,En);let Dn,On;t[162]===Symbol.for(`react.memo_cache_sentinel`)?(Dn=()=>GV(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=B.current.find(e=>mi(e)&&e.docName===t);it.current({kind:`file`,path:t,name:t.split(`/`).pop()??t,docExt:n?.docExt});return}if(e.kind===`folder`){it.current({kind:`folder`,path:e.folderPath,name:e.folderPath.split(`/`).pop()??e.folderPath});return}console.warn(JSON.stringify({event:`file-tree-menu-action-duplicate-unsupported-kind`,kind:e.kind}))}),On=[],t[162]=Dn,t[163]=On):(Dn=t[162],On=t[163]),(0,Q.useEffect)(Dn,On);let kn,jn;t[164]===J?(kn=t[165],jn=t[166]):(kn=()=>UV(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=DO(t,B.current.find(e=>mi(e)&&e.docName===t)?.docExt);J.startRenaming(n);return}if(e.kind===`folder`){J.startRenaming(e.folderPath);return}console.warn(JSON.stringify({event:`file-tree-menu-action-rename-unsupported-kind`,kind:e.kind}))}),jn=[J],t[164]=J,t[165]=kn,t[166]=jn),(0,Q.useEffect)(kn,jn);let Mn;t[167]===Symbol.for(`react.memo_cache_sentinel`)?(Mn=function(){let e=oe.current;e&&sH(e),oe.current=null},t[167]=Mn):Mn=t[167];let Nn=Mn,Pn;t[168]===d?Pn=t[169]:(Pn=function(e){let t=eU(e.nativeEvent);if(!t||t.endsWith(`/`)){Nn();return}let n=OO(t),r=B.current.find(e=>kO(e)===t);if(r&&An(r)){Nn();return}oe.current!==n&&(Nn(),oe.current=n,oH(n,e=>d(e)))},t[168]=d,t[169]=Pn);let Fn=Pn,In;t[170]!==H||t[171]!==J||t[172]!==y?(In=function(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=tU(e.nativeEvent);if(!t||t.getAttribute(`aria-selected`)!==`true`)return;let n=t.dataset.itemPath;if(!n)return;let r=t.dataset.itemType===`folder`?MO(n):n;if(J.getSelectedPaths().length!==1)return;if(t.dataset.itemType===`folder`){let e=jO(r);if(window.location.hash===ei(e))return;queueMicrotask(()=>y(e));return}let i=OO(r);window.location.hash!==kr(i)&&queueMicrotask(()=>H(r))},t[170]=H,t[171]=J,t[172]=y,t[173]=In):In=t[173];let Ln=In;if(w){let e;return t[174]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(rU,{}),t[174]=e):e=t[174],e}if(S.length===0){if(D){let e;return t[175]===D?e=t[176]:(e=(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center py-8`,children:(0,Z.jsx)(`span`,{className:`select-none text-sidebar-foreground/50 text-sm`,children:D})}),t[175]=D,t[176]=e),e}let e;t[177]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`span`,{className:`select-none text-sidebar-foreground/30 text-sm`,children:`No files yet.`}),t[177]=e):e=t[177];let n;return t[178]===Bt?n=t[179]:(n=(0,Z.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 py-8`,children:[e,(0,Z.jsx)(Y,{variant:`link`,size:`sm`,className:`font-mono uppercase`,onClick:()=>Bt(`file`,``),children:`Create your first file`})]}),t[178]=Bt,t[179]=n),n}let Rn=k!==null,zn=j?.targets[0]??null,Bn;t[180]===D?Bn=t[181]:(Bn=D&&(0,Z.jsx)(`span`,{role:`alert`,className:`px-3 pb-1 text-destructive text-xs`,children:D}),t[180]=D,t[181]=Bn);let Vn;t[182]===m?Vn=t[183]:(Vn=bH(m),t[182]=m,t[183]=Vn);let Hn;t[184]!==Rn||t[185]!==G||t[186]!==Wt||t[187]!==Ht||t[188]!==We||t[189]!==rt||t[190]!==Ce||t[191]!==Ee||t[192]!==J||t[193]!==we||t[194]!==Te||t[195]!==Bt||t[196]!==R?(Hn=(e,t)=>(0,Z.jsx)(MH,{item:e,context:t,anyActionBusy:Rn,workspace:R,handoff:Ce,model:J,okignoreBinding:we,projectLocalBinding:Te,mergedConfig:Ee,onStartCreating:Bt,onStartCreatingFromTemplate:Rt,onDuplicate:rt,onDelete:e=>M({targets:e}),onExpandSubtree:Ht,onCollapseSubtree:Wt,folderTreePaths:We,isAsset:G.has(e.path),isAssetTreePath:tt}),t[184]=Rn,t[185]=G,t[186]=Wt,t[187]=Ht,t[188]=We,t[189]=rt,t[190]=Ce,t[191]=Ee,t[192]=J,t[193]=we,t[194]=Te,t[195]=Bt,t[196]=R,t[197]=Hn):Hn=t[197];let Un;t[198]!==Ln||t[199]!==Fn||t[200]!==J||t[201]!==Bn||t[202]!==Vn||t[203]!==Hn?(Un=(0,Z.jsx)(`div`,{ref:q,className:`flex min-h-0 flex-1 flex-col`,children:(0,Z.jsx)(KB,{header:Bn,model:J,style:Vn,onClickCapture:Ln,onMouseMove:Fn,onMouseLeave:Nn,renderContextMenu:Hn})}),t[198]=Ln,t[199]=Fn,t[200]=J,t[201]=Bn,t[202]=Vn,t[203]=Hn,t[204]=Un):Un=t[204];let Wn=!!j,Gn;t[205]===k?Gn=t[206]:(Gn=e=>{!e&&!k&&M(null)},t[205]=k,t[206]=Gn);let Kn;t[207]!==k||t[208]!==j||t[209]!==_n||t[210]!==zn?(Kn=j&&zn&&(0,Z.jsx)(ho,{...(()=>{let e=CV(typeof window<`u`&&window.okDesktop!=null?`electron`:`web`,j.targets);return e?{customTitle:e.title,customDescription:``,customDetail:e.detail,customConfirmLabel:e.confirmLabel,customConfirmLabelBusy:e.confirmLabelBusy,children:e.listedTargets?(0,Z.jsx)(`ul`,{className:`flex flex-col gap-1 font-mono text-foreground text-xs`,children:e.listedTargets.map(PH)}):null}:{itemName:j.targets.length===1?`${zn.name}${zn.kind===`file`?zn.docExt??`.md`:`/`}`:void 0,customTitle:j.targets.length>1?`Delete selected items`:void 0,customDescription:j.targets.length>1?`Are you sure you want to delete ${j.targets.length} selected items? Folders and all files inside them will be deleted. This action cannot be undone.`:zn.kind===`folder`?`Are you sure you want to delete ${zn.name}/ and all files inside? This action cannot be undone.`:void 0}})(),isSubmitting:k!==null,onDelete:()=>_n(j.targets)}),t[207]=k,t[208]=j,t[209]=_n,t[210]=zn,t[211]=Kn):Kn=t[211];let qn;t[212]!==Wn||t[213]!==Gn||t[214]!==Kn?(qn=(0,Z.jsx)(Vo,{open:Wn,onOpenChange:Gn,children:Kn}),t[212]=Wn,t[213]=Gn,t[214]=Kn,t[215]=qn):qn=t[215];let Jn=!!P,Yn;t[216]===k?Yn=t[217]:(Yn=e=>{!e&&!k&&F(null)},t[216]=k,t[217]=Yn);let Xn;t[218]!==k||t[219]!==yn||t[220]!==xn||t[221]!==P?(Xn=P&&(0,Z.jsx)(AV,{failedTargets:P.failed,isSubmitting:k!==null,onDeletePermanently:yn,onRetry:xn,onCancel:()=>F(null)}),t[218]=k,t[219]=yn,t[220]=xn,t[221]=P,t[222]=Xn):Xn=t[222];let Zn;t[223]!==Jn||t[224]!==Yn||t[225]!==Xn?(Zn=(0,Z.jsx)(Vo,{open:Jn,onOpenChange:Yn,children:Xn}),t[223]=Jn,t[224]=Yn,t[225]=Xn,t[226]=Zn):Zn=t[226];let Qn=I!==null,$n;t[227]===Symbol.for(`react.memo_cache_sentinel`)?($n=e=>{e||L(null)},t[227]=$n):$n=t[227];let er=I?.parentDir??``,tr;t[228]!==Qn||t[229]!==er?(tr=(0,Z.jsx)(xm,{open:Qn,onOpenChange:$n,kind:`file`,initialDir:er}),t[228]=Qn,t[229]=er,t[230]=tr):tr=t[230];let nr;return t[231]!==Un||t[232]!==qn||t[233]!==Zn||t[234]!==tr?(nr=(0,Z.jsxs)(Z.Fragment,{children:[Un,qn,Zn,tr]}),t[231]=Un,t[232]=qn,t[233]=Zn,t[234]=tr,t[235]=nr):nr=t[235],nr}function PH(e){return(0,Z.jsx)(`li`,{"data-testid":`delete-target-row`,children:wV(e)},`${e.kind}:${e.path}`)}function FH(e){return`${e.kind}:${e.path}`}function IH(e){return`${e.kind}:${e.path}`}function LH(e){return e.path}function RH(e){return e.kind===`folder`}function zH(e){return e.path}function BH(e){return e.kind===`file`}function VH(e){return He(e)}function HH(e){return mt(e)}function UH(e){return e.endsWith(`/`)?e.slice(0,-1):e}function WH(e){return!!e}function GH(e){console.warn(`[FileTree] /api/workspace fetch failed:`,e)}function KH(e){console.warn(`[FileTree] unmount cleanup failed:`,e)}function qH(e){X.error(e)}function JH(){}function YH(e){return X.error(e)}function XH(){}function ZH(){}async function QH(){}function $H(e){return kO(e)}function eU(e){return tU(e)?.dataset.itemPath??null}function tU(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.dataset.itemPath)return t;return null}var nU=[`w-3/4`,`w-2/3`,`w-4/5`,`w-1/2`,`w-3/5`,`w-2/3`];function rU(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`div`,{className:`flex flex-1 flex-col gap-1 px-2 py-2`,role:`status`,"aria-busy":`true`,"aria-label":`Loading files`,children:nU.map(iU)}),e[0]=t):t=e[0],t}function iU(e,t){return(0,Z.jsxs)(`div`,{className:`flex h-6 items-center gap-2`,children:[(0,Z.jsx)(mo,{className:`h-3 w-3 shrink-0 rounded-sm`}),(0,Z.jsx)(mo,{className:`h-3 ${e}`})]},t)}function aU(e){return e?`No workspace`:null}function oU(e){let t=(0,$.c)(41),{input:n,installStates:r,dispatch:i,webFallbackVisible:a}=e,o=a===void 0?!0:a,s=n===null,c;t[0]===s?c=t[1]:(c=aU(s),t[0]=s,t[1]=c);let l=c,u,d,f,p,m,h,g;if(t[2]!==i||t[3]!==l||t[4]!==n||t[5]!==s||t[6]!==r||t[7]!==o){g=Symbol.for(`react.early_return_sentinel`);bb0:{let e;t[15]===r?e=t[16]:(e=e=>r[e.id]?.installed===!0,t[15]=r,t[16]=e);let a=eh.filter(e);f=r[`claude-code`]?.installed===!0;let c;t[17]===n?c=t[18]:(c=n!==null&&n.docContext!==null?jr(n.docContext.relativePath):``,t[17]=n,t[18]=c);let _=c,v;t[19]!==n||t[20]!==_?(v=()=>{n!==null&&ES(_)},t[19]=n,t[20]=_,t[21]=v):v=t[21],p=v;let y=o&&!f;if(a.length===0&&!y){g=null;break bb0}d=lk,t[22]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsxs)(fk,{children:[(0,Z.jsx)(Ji,{"aria-hidden":`true`}),`Open with AI`]}),t[22]=h):h=t[22],u=pk;let b;t[23]!==i||t[24]!==l||t[25]!==n||t[26]!==s?(b=e=>{let t=!s,r=l?`Open with AI ${e.displayName}, ${l}`:`Open with AI ${e.displayName}`;return(0,Z.jsxs)(dk,{disabled:!t,onSelect:()=>{n&&i(e.id,n)},"data-testid":`empty-space-open-in-${e.id}`,"aria-label":r,children:[(0,Z.jsx)(bS,{id:e.id,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:e.displayName}),l?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:l}):null]},e.id)},t[23]=i,t[24]=l,t[25]=n,t[26]=s,t[27]=b):b=t[27],m=a.map(b)}t[2]=i,t[3]=l,t[4]=n,t[5]=s,t[6]=r,t[7]=o,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m,t[13]=h,t[14]=g}else u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13],g=t[14];if(g!==Symbol.for(`react.early_return_sentinel`))return g;let _;t[28]!==f||t[29]!==p||t[30]!==s||t[31]!==o?(_=o&&!f?(0,Z.jsxs)(dk,{onSelect:p,disabled:s,"data-testid":`empty-space-open-in-claude-web-fallback`,"aria-label":`Open in claude.ai, opens in browser with prompt pre-filled`,children:[(0,Z.jsx)(yt,{className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:`Open in claude.ai →`}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:`opens in browser`})]}):null,t[28]=f,t[29]=p,t[30]=s,t[31]=o,t[32]=_):_=t[32];let v;t[33]!==u||t[34]!==m||t[35]!==_?(v=(0,Z.jsxs)(u,{children:[m,_]}),t[33]=u,t[34]=m,t[35]=_,t[36]=v):v=t[36];let y;return t[37]!==d||t[38]!==h||t[39]!==v?(y=(0,Z.jsxs)(d,{children:[h,v]}),t[37]=d,t[38]=h,t[39]=v,t[40]=y):y=t[40],y}var sU=(e,t,n)=>pl(e,t,n,`ProjectSwitcher`);function cU(e){let t=(0,$.c)(59),{bridge:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],t[0]=r):r=t[0];let[i,a]=(0,Q.useState)(r),[o,s]=(0,Q.useState)(!1),c;t[1]!==n.project||t[2]!==o?(c=()=>{if(!o)return;let e=!1;return sU(async()=>{let t=await n.project.listRecent();e||a(t)},`Failed to load recent projects.`),()=>{e=!0}},t[1]=n.project,t[2]=o,t[3]=c):c=t[3];let l;t[4]!==n||t[5]!==o?(l=[o,n],t[4]=n,t[5]=o,t[6]=l):l=t[6],(0,Q.useEffect)(c,l);let u;t[7]===n.project?u=t[8]:(u=e=>{s(!1),sU(()=>n.project.open({path:e,target:`new-window`,entryPoint:`recents`}),`Failed to open project.`)},t[7]=n.project,t[8]=u);let d=u,f;t[9]!==n.dialog||t[10]!==n.project?(f=()=>{s(!1),sU(async()=>{let e=await n.dialog.openFolder();e&&await n.project.open({path:e,target:`new-window`,entryPoint:`pick-existing`})},`Failed to open folder.`)},t[9]=n.dialog,t[10]=n.project,t[11]=f):f=t[11];let p=f,m;t[12]===n.navigator?m=t[13]:(m=()=>{s(!1),sU(()=>n.navigator.open(),`Failed to open Project Navigator.`)},t[12]=n.navigator,t[13]=m);let h=m,g=n.config.projectPath,_,v,y,b,x,S,C,w,T,E,D;if(t[14]!==n.config.projectName||t[15]!==g||t[16]!==o||t[17]!==d||t[18]!==i){let e;t[30]===g?e=t[31]:(e=e=>e.path!==g,t[30]=g,t[31]=e);let r=i.filter(e);v=ka,S=o,C=s;let a;t[32]===n.config.projectName?a=t[33]:(a=(0,Z.jsx)(`span`,{className:`truncate`,children:n.config.projectName}),t[32]=n.config.projectName,t[33]=a);let c;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(nc,{"aria-hidden":`true`,className:`opacity-60`}),t[34]=c):c=t[34],t[35]===a?w=t[36]:(w=(0,Z.jsx)(ja,{asChild:!0,children:(0,Z.jsxs)(rO,{className:`justify-between text-sidebar-foreground/70`,"data-testid":`project-switcher-trigger`,title:`Open project menu`,children:[a,c]})}),t[35]=a,t[36]=w),_=Oa,T=`start`,E=`top`,D=`min-w-[260px]`,y=`project-switcher-menu`,t[37]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Z.jsx)(ua,{className:`font-mono font-normal tracking-wide uppercase text-muted-foreground text-xs`,children:`Recent projects`}),t[37]=b):b=t[37],x=r.length===0?(0,Z.jsx)(ua,{className:`font-normal text-muted-foreground text-xs`,children:`No other recent projects.`}):r.slice(0,10).map(e=>(0,Z.jsxs)(Aa,{disabled:e.missing,onSelect:()=>d(e.path),className:`flex flex-col items-start gap-0.5`,"data-testid":`project-switcher-recent-${e.path}`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-sm`,children:e.name}),(0,Z.jsxs)(`span`,{className:`max-w-[240px] truncate text-muted-foreground text-xs`,children:[e.path,e.missing?` (missing)`:``]})]},e.path)),t[14]=n.config.projectName,t[15]=g,t[16]=o,t[17]=d,t[18]=i,t[19]=_,t[20]=v,t[21]=y,t[22]=b,t[23]=x,t[24]=S,t[25]=C,t[26]=w,t[27]=T,t[28]=E,t[29]=D}else _=t[19],v=t[20],y=t[21],b=t[22],x=t[23],S=t[24],C=t[25],w=t[26],T=t[27],E=t[28],D=t[29];let O;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsx)(ma,{}),t[38]=O):O=t[38];let k;t[39]===p?k=t[40]:(k=(0,Z.jsx)(Aa,{onSelect:p,"data-testid":`project-switcher-open-folder`,children:`Open folder`}),t[39]=p,t[40]=k);let A;t[41]===h?A=t[42]:(A=(0,Z.jsx)(Aa,{onSelect:h,"data-testid":`project-switcher-switch-project`,children:`Switch Project`}),t[41]=h,t[42]=A);let j;t[43]!==_||t[44]!==y||t[45]!==b||t[46]!==x||t[47]!==k||t[48]!==A||t[49]!==T||t[50]!==E||t[51]!==D?(j=(0,Z.jsxs)(_,{align:T,side:E,className:D,"data-testid":y,children:[b,x,O,k,A]}),t[43]=_,t[44]=y,t[45]=b,t[46]=x,t[47]=k,t[48]=A,t[49]=T,t[50]=E,t[51]=D,t[52]=j):j=t[52];let M;return t[53]!==v||t[54]!==S||t[55]!==C||t[56]!==w||t[57]!==j?(M=(0,Z.jsxs)(v,{open:S,onOpenChange:C,children:[w,j]}),t[53]=v,t[54]=S,t[55]=C,t[56]=w,t[57]=j,t[58]=M):M=t[58],M}function lU(e,t){let n=e instanceof Error?e:Error(String(e));console.warn(JSON.stringify({event:`jsx-render-failure`,component:`sidebarSearchPill`,rawComponentName:`sidebarSearchPill`,error:String(n),stack:t.componentStack})),Sr(`sidebarSearchPill`)}function uU(e){let t=(0,$.c)(8),{onClick:n,className:r}=e,i;t[0]===r?i=t[1]:(i=Di(`rounded-lg h-9 w-full justify-start gap-2 px-3 font-normal text-muted-foreground`,r),t[0]=r,t[1]=i);let a,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(x,{"aria-hidden":`true`}),o=(0,Z.jsx)(`span`,{className:`flex-1 text-left text-sm`,children:`Search`}),t[2]=a,t[3]=o):(a=t[2],o=t[3]);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(sC,{className:`text-foreground/70`,children:Ti()?`⌘ K`:`Ctrl K`}),t[4]=s):s=t[4];let c;return t[5]!==n||t[6]!==i?(c=(0,Z.jsxs)(Y,{variant:`outline`,onClick:n,"data-telemetry-event":`ok.sidebar.search_pill.click`,className:i,children:[a,o,s]}),t[5]=n,t[6]=i,t[7]=c):c=t[7],c}function dU(e){let t=(0,$.c)(33),{notice:n,onDismiss:r}=e,i=n.variant===`error`?`border-destructive/60`:`border-sidebar-border`,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(Do,{"aria-hidden":`true`,className:`size-3`}),t[0]=a):a=t[0];let o;t[1]===r?o=t[2]:(o=(0,Z.jsx)(Y,{variant:`ghost`,size:`icon`,className:`size-5 shrink-0 text-muted-foreground hover:text-sidebar-foreground`,"aria-label":`Dismiss notice`,onClick:r,children:a}),t[1]=r,t[2]=o);let s=o;if(n.secondaryAction){let e=`update-notice-${n.id}`,r=`flex flex-col gap-2 rounded-md border bg-sidebar-accent/30 px-2 py-2 text-xs text-muted-foreground ${i}`,a;t[3]===n.body?a=t[4]:(a=(0,Z.jsx)(`span`,{className:`flex-1 leading-snug`,children:n.body}),t[3]=n.body,t[4]=a);let o;t[5]!==s||t[6]!==a?(o=(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[a,s]}),t[5]=s,t[6]=a,t[7]=o):o=t[7];let c;t[8]===n.action?c=t[9]:(c=n.action?(0,Z.jsx)(`button`,{type:`button`,className:`shrink-0 text-xs font-medium underline underline-offset-2 decoration-muted-foreground/40 hover:text-sidebar-foreground hover:decoration-sidebar-foreground`,onClick:()=>{n.action?.onClick()},children:n.action.label}):null,t[8]=n.action,t[9]=c);let l;t[10]===n.secondaryAction?l=t[11]:(l=()=>{n.secondaryAction?.onClick()},t[10]=n.secondaryAction,t[11]=l);let u;t[12]!==n.secondaryAction.label||t[13]!==l?(u=(0,Z.jsx)(`button`,{type:`button`,className:`shrink-0 text-xs font-medium underline underline-offset-2 decoration-muted-foreground/40 hover:text-sidebar-foreground hover:decoration-sidebar-foreground`,onClick:l,children:n.secondaryAction.label}),t[12]=n.secondaryAction.label,t[13]=l,t[14]=u):u=t[14];let d;t[15]!==c||t[16]!==u?(d=(0,Z.jsxs)(`div`,{className:`flex gap-3 pl-1`,children:[c,u]}),t[15]=c,t[16]=u,t[17]=d):d=t[17];let f;return t[18]!==d||t[19]!==e||t[20]!==r||t[21]!==o?(f=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"data-testid":e,className:r,children:[o,d]}),t[18]=d,t[19]=e,t[20]=r,t[21]=o,t[22]=f):f=t[22],f}let c=`update-notice-${n.id}`,l=`flex items-center gap-2 rounded-md border bg-sidebar-accent/30 px-2 py-1.5 text-xs text-muted-foreground ${i}`,u;t[23]===n.body?u=t[24]:(u=(0,Z.jsx)(`span`,{className:`flex-1 leading-snug`,children:n.body}),t[23]=n.body,t[24]=u);let d;t[25]===n.action?d=t[26]:(d=n.action?(0,Z.jsx)(`button`,{type:`button`,className:`shrink-0 text-xs font-medium underline underline-offset-2 decoration-muted-foreground/40 hover:text-sidebar-foreground hover:decoration-sidebar-foreground`,onClick:()=>{n.action?.onClick()},children:n.action.label}):null,t[25]=n.action,t[26]=d);let f;return t[27]!==s||t[28]!==c||t[29]!==l||t[30]!==u||t[31]!==d?(f=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"data-testid":c,className:l,children:[u,d,s]}),t[27]=s,t[28]=c,t[29]=l,t[30]=u,t[31]=d,t[32]=f):f=t[32],f}function fU(e){if(e.length===0)return null;let t=e[0];if(!t)return null;for(let n=1;n<e.length;n++){let r=e[n];r&&r.priority<t.priority&&(t=r)}return t}function pU(){let e=(0,$.c)(7),t=(0,Q.useSyncExternalStore)(Ep,Tp,Tp),n;e[0]===t?n=e[1]:(n=fU(t),e[0]=t,e[1]=n);let r=n;if(!r)return null;let i;e[2]===r.id?i=e[3]:(i=()=>{wp(r.id)},e[2]=r.id,e[3]=i);let a;return e[4]!==r||e[5]!==i?(a=(0,Z.jsx)(`div`,{"data-testid":`update-notices-list`,children:(0,Z.jsx)(dU,{notice:r,onDismiss:i})}),e[4]=r,e[5]=i,e[6]=a):a=e[6],a}function mU(e,t,n){return e?.kind===`doc`&&t||e?.kind===`folder-index`&&t?Fh(n.contentDir,Ih(t),n.pathSeparator):e?.kind===`folder`?Fh(n.contentDir,e.folderPath,n.pathSeparator):n.contentDir}function hU(e,t,n){if((e?.kind===`doc`||e?.kind===`folder-index`)&&t){let e=t.lastIndexOf(`/`);return e<0?n.contentDir:Fh(n.contentDir,t.slice(0,e),n.pathSeparator)}return e?.kind===`folder`?Fh(n.contentDir,e.folderPath,n.pathSeparator):n.contentDir}function gU(e,t){return(e?.kind===`doc`||e?.kind===`folder-index`)&&t?Ih(t):e?.kind===`folder`?e.folderPath:``}function _U(e,t,n){return e===null?Rh({workspace:n}):e.kind===`folder`?n?zh({folderRelativePath:e.folderPath,workspace:n}):null:e.kind===`doc`||e.kind===`folder-index`?Lh({docName:t,workspace:n}):null}var vU={folderCount:0,expandedCount:0},yU=`button, [role="button"], [role="menuitem"], input, textarea, select, a[href]`;function bU(e){return typeof Element>`u`||!(e instanceof Element)?!1:e.closest(yU)!==null}function xU(e){let t=(0,$.c)(2),{onOpenSearch:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(J,{name:`file-sidebar`,children:(0,Z.jsx)(CU,{onOpenSearch:n})}),t[0]=n,t[1]=r),r}var SU=e=>{let t=(0,$.c)(15),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({icon:n,label:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=(0,Z.jsx)(n,{"aria-hidden":`true`}),t[4]=n,t[5]=a);let o;t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,Z.jsx)(En,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-sm`,"aria-label":r,...i,children:a})}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9];let s;t[10]===r?s=t[11]:(s=(0,Z.jsx)(er,{children:r}),t[10]=r,t[11]=s);let c;return t[12]!==o||t[13]!==s?(c=(0,Z.jsxs)(jn,{children:[o,s]}),t[12]=o,t[13]=s,t[14]=c):c=t[14],c};function CU(e){let t=(0,$.c)(164),{onOpenSearch:n}=e,[r,i]=(0,Q.useState)(null),{activeDocName:a,activeTarget:o}=ut(),s;t[0]!==a||t[1]!==o?(s=o?.kind===`folder`||o?.kind===`folder-index`?o.folderPath:_i(a),t[0]=a,t[1]=o,t[2]=s):s=t[2];let c=s,l=typeof window<`u`&&window.okDesktop!=null,{state:u}=UD(),d=u===`expanded`,f=l&&u===`collapsed`,[p,m]=(0,Q.useState)(vU),h,g;t[3]===r?(h=t[4],g=t[5]):(h=()=>{if(r!==null)return m(r.getFolderState()),r.subscribe(()=>{m(r.getFolderState())})},g=[r],t[3]=r,t[4]=h,t[5]=g),(0,Q.useEffect)(h,g);let _,v;t[6]===r?(_=t[7],v=t[8]):(_=()=>{if(r!==null)return dC(()=>{r.startCreating(`file`,``)})},v=[r],t[6]=r,t[7]=_,t[8]=v),(0,Q.useEffect)(_,v);let y=p.folderCount>0,x=y&&p.expandedCount===p.folderCount,S=p.expandedCount===0,C=Qa(``),w=C.state.status===`ready`?(C.state.data.folder.templates_available?.length??0)>0:!0,T=typeof window<`u`?window.okDesktop:void 0,E=ch(),D=sg().states,{dispatch:O}=Xh(),k;t[9]===E?k=t[10]:(k=Rh({workspace:E}),t[9]=E,t[10]=k);let A=k,{projectLocalBinding:j,merged:M}=b(),N=M?.appearance?.sidebar?.showHiddenFiles??!1,P=M?.appearance?.sidebar?.showAllFiles??!1,I=y&&!x,L=y&&!S,R=I||L,z=DU,B;t[11]!==r||t[12]!==E?(B=()=>{E&&r?.startCreating(`file`,``)},t[11]=r,t[12]=E,t[13]=B):B=t[13];let V=B,H;t[14]!==r||t[15]!==E?(H=()=>{E&&r?.startCreatingFromTemplate(``)},t[14]=r,t[15]=E,t[16]=H):H=t[16];let U=H,W;t[17]!==r||t[18]!==E?(W=()=>{E&&r?.startCreating(`folder`,``)},t[17]=r,t[18]=E,t[19]=W):W=t[19];let G=W,ee;t[20]===E?ee=t[21]:(ee=()=>{!E||!T||T.shell.showItemInFolder(E.contentDir)},t[20]=E,t[21]=ee);let te=ee,ne;t[22]===E?ne=t[23]:(ne=()=>{!E||!T||IV(T,E.contentDir)},t[22]=E,t[23]=ne);let re=ne,ie;t[24]===E?ie=t[25]:(ie=async()=>{if(E)try{await navigator.clipboard.writeText(E.contentDir),X.success(`Copied full path`,{description:E.contentDir})}catch(e){console.warn(`[FileSidebar] clipboard write failed:`,e),X.error(`Could not copy full path`)}},t[24]=E,t[25]=ie);let ae=ie,oe;t[26]===j?oe=t[27]:(oe=e=>{if(j===null)return;let t=j.patch({appearance:{sidebar:{showHiddenFiles:e}}});t.ok||(console.warn(`[FileSidebar] showHiddenFiles toggle rejected:`,wi(t.error)),X.error(`Could not update sidebar settings`,{description:wi(t.error)}))},t[26]=j,t[27]=oe);let se=oe,K;t[28]===j?K=t[29]:(K=e=>{if(j===null)return;let t=j.patch({appearance:{sidebar:{showAllFiles:e}}});t.ok||(console.warn(`[FileSidebar] showAllFiles toggle rejected:`,wi(t.error)),X.error(`Could not update sidebar settings`,{description:wi(t.error)}))},t[28]=j,t[29]=K);let ce=K,ue;t[30]===r?ue=t[31]:(ue=()=>{r?.expandAll()},t[30]=r,t[31]=ue);let q=ue,de;t[32]===r?de=t[33]:(de=()=>{r?.collapseAll()},t[32]=r,t[33]=de);let fe=de,pe,me;t[34]!==P||t[35]!==L||t[36]!==I||t[37]!==N?(pe=()=>{T&&T.editor.notifyViewMenuStateChanged({showHiddenFiles:N,showAllFiles:P,canExpandAll:I,canCollapseAll:L})},me=[T,N,P,I,L],t[34]=P,t[35]=L,t[36]=I,t[37]=N,t[38]=pe,t[39]=me):(pe=t[38],me=t[39]),(0,Q.useEffect)(pe,me);let he,ge;t[40]!==a||t[41]!==o||t[42]!==O||t[43]!==D||t[44]!==c||t[45]!==j||t[46]!==P||t[47]!==N||t[48]!==r||t[49]!==E?(he=()=>{if(T)return T.onMenuAction(e=>{switch(e){case`new-doc`:if(!E||!r)return;r.startCreating(`file`,c);return;case`new-folder`:if(!E||!r)return;r.startCreating(`folder`,c);return;case`new-from-template`:if(!E||!r)return;r.startCreatingFromTemplate(c);return;case`rename`:if(!o)return;HV(o);return;case`duplicate`:if(!o)return;WV(o);return;case`move-to-trash`:if(!o)return;BV(o);return;case`reveal-in-finder`:{if(!T||!E)return;let e=mU(o,a,E);T.shell.showItemInFolder(e);return}case`open-in-terminal`:if(!T||!E)return;IV(T,hU(o,a,E));return;case`send-to-ai`:{let e=eh.filter(e=>D[e.id]?.installed===!0);if(e.length===0){X.error(`No AI agents installed`);return}let t=_U(o,a,E);if(!t)return;let[n]=e;if(!n)return;O(n.id,t);return}case`copy-full-path`:{if(!E)return;let e=mU(o,a,E);navigator.clipboard.writeText(e).then(()=>X.success(`Copied full path`,{description:e})).catch(EU);return}case`copy-relative-path`:{let e=gU(o,a);if(e===``){X.error(`No file or folder selected`);return}navigator.clipboard.writeText(e).then(()=>X.success(`Copied relative path`,{description:e})).catch(TU);return}case`toggle-show-hidden-files`:{if(j===null)return;let e=j.patch({appearance:{sidebar:{showHiddenFiles:!N}}});e.ok||(console.warn(`[FileSidebar] toggle-show-hidden-files rejected:`,wi(e.error)),X.error(`Could not update sidebar settings`,{description:wi(e.error)}));return}case`toggle-show-all-files`:{if(j===null)return;let e=j.patch({appearance:{sidebar:{showAllFiles:!P}}});e.ok||(console.warn(`[FileSidebar] toggle-show-all-files rejected:`,wi(e.error)),X.error(`Could not update sidebar settings`,{description:wi(e.error)}));return}case`expand-all-tree`:r?.expandAll();return;case`collapse-all-tree`:r?.collapseAll();return;case`delete`:case`toggle-sidebar`:case`toggle-source`:case`save-version`:case`version-history`:case`focus-search`:case`focus-command-palette`:return}})},ge=[T,r,E,o,a,c,j,N,P,D,O],t[40]=a,t[41]=o,t[42]=O,t[43]=D,t[44]=c,t[45]=j,t[46]=P,t[47]=N,t[48]=r,t[49]=E,t[50]=he,t[51]=ge):(he=t[50],ge=t[51]),(0,Q.useEffect)(he,ge);let _e=f&&`opacity-0`,ye;t[52]===_e?ye=t[53]:(ye=Di(`flex-row h-12 items-center py-0 px-3`,l?`justify-end`:`justify-between`,l&&`motion-safe:transition-opacity motion-safe:duration-100 motion-safe:ease-out`,_e,l&&`[-webkit-app-region:drag]`),t[52]=_e,t[53]=ye);let be;t[54]===d?be=t[55]:(be=d&&!l?(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-sm uppercase tracking-wider text-sidebar-foreground/50`,children:`Files`}):null,t[54]=d,t[55]=be);let xe;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(xe=Di(`flex items-center gap-1`,l&&`[&>*]:[-webkit-app-region:no-drag]`),t[56]=xe):xe=t[56];let Se;t[57]!==x||t[58]!==y||t[59]!==S||t[60]!==r?(Se=y?(0,Z.jsxs)(ka,{children:[(0,Z.jsx)(ja,{asChild:!0,children:(0,Z.jsx)(SU,{icon:Oc,label:`Tree View Options`})}),(0,Z.jsxs)(Oa,{align:`end`,children:[x?null:(0,Z.jsxs)(Aa,{onSelect:()=>r?.expandAll(),children:[(0,Z.jsx)(sl,{"aria-hidden":`true`}),`Expand All`]}),S?null:(0,Z.jsxs)(Aa,{onSelect:()=>r?.collapseAll(),children:[(0,Z.jsx)(_c,{"aria-hidden":`true`}),`Collapse All`]})]})]}):null,t[57]=x,t[58]=y,t[59]=S,t[60]=r,t[61]=Se):Se=t[61];let Ce;t[62]!==c||t[63]!==r?(Ce=(0,Z.jsx)(SU,{icon:$c,label:`New File`,onClick:()=>r?.startCreating(`file`,c)}),t[62]=c,t[63]=r,t[64]=Ce):Ce=t[64];let we;t[65]!==w||t[66]!==c||t[67]!==r?(we=w?(0,Z.jsx)(SU,{icon:hc,label:`New from template`,onClick:()=>r?.startCreatingFromTemplate(c)}):null,t[65]=w,t[66]=c,t[67]=r,t[68]=we):we=t[68];let Te;t[69]!==c||t[70]!==r?(Te=(0,Z.jsx)(SU,{icon:yc,label:`New Folder`,onClick:()=>r?.startCreating(`folder`,c)}),t[69]=c,t[70]=r,t[71]=Te):Te=t[71];let Ee;t[72]!==Se||t[73]!==Ce||t[74]!==we||t[75]!==Te?(Ee=(0,Z.jsxs)(`div`,{className:xe,children:[Se,Ce,we,Te]}),t[72]=Se,t[73]=Ce,t[74]=we,t[75]=Te,t[76]=Ee):Ee=t[76];let De;t[77]!==ye||t[78]!==be||t[79]!==Ee?(De=(0,Z.jsxs)(ZD,{"data-electron-drag":l?``:void 0,className:ye,children:[be,Ee]}),t[77]=ye,t[78]=be,t[79]=Ee,t[80]=De):De=t[80];let Oe=f&&`opacity-0`,ke;t[81]===Oe?ke=t[82]:(ke=Di(`px-2 pb-2`,l&&`[-webkit-app-region:no-drag]`,l&&`motion-safe:transition-opacity motion-safe:duration-100 motion-safe:ease-out`,Oe),t[81]=Oe,t[82]=ke);let Ae;t[83]===u?Ae=t[84]:(Ae=[u],t[83]=u,t[84]=Ae);let je;t[85]===n?je=t[86]:(je=(0,Z.jsx)(uU,{onClick:n}),t[85]=n,t[86]=je);let Me;t[87]!==Ae||t[88]!==je?(Me=(0,Z.jsx)(le,{fallbackRender:wU,onError:lU,resetKeys:Ae,children:je}),t[87]=Ae,t[88]=je,t[89]=Me):Me=t[89];let Ne;t[90]!==ke||t[91]!==Me?(Ne=(0,Z.jsx)(`div`,{className:ke,children:Me}),t[90]=ke,t[91]=Me,t[92]=Ne):Ne=t[92];let Pe;t[93]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=(0,Z.jsx)($D,{children:(0,Z.jsx)(NH,{ref:i})}),t[93]=Pe):Pe=t[93];let Fe,J;t[94]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=(0,Z.jsxs)(QD,{className:`px-0`,children:[(0,Z.jsx)(pU,{}),typeof window<`u`&&window.okDesktop?(0,Z.jsx)(eO,{children:(0,Z.jsx)(tO,{children:(0,Z.jsx)(cU,{bridge:window.okDesktop})})}):null]}),J=(0,Z.jsx)(YD,{enableToggle:!1}),t[94]=Fe,t[95]=J):(Fe=t[94],J=t[95]);let Ie;t[96]!==De||t[97]!==Ne?(Ie=(0,Z.jsx)(ck,{asChild:!0,children:(0,Z.jsxs)(`div`,{className:`contents`,onContextMenu:z,children:[De,Ne,Pe,Fe,J]})}),t[96]=De,t[97]=Ne,t[98]=Ie):Ie=t[98];let Le=!E,Re;t[99]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(0,Z.jsx)($c,{"aria-hidden":`true`}),t[99]=Re):Re=t[99];let ze;t[100]!==V||t[101]!==Le?(ze=(0,Z.jsxs)(dk,{disabled:Le,onSelect:V,"data-testid":`empty-space-menu-new-file`,children:[Re,`New File`]}),t[100]=V,t[101]=Le,t[102]=ze):ze=t[102];let Be=!E||!w,Ve;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,Z.jsx)(hc,{"aria-hidden":`true`}),t[103]=Ve):Ve=t[103];let He;t[104]!==U||t[105]!==Be?(He=(0,Z.jsxs)(dk,{disabled:Be,onSelect:U,"data-testid":`empty-space-menu-new-from-template`,children:[Ve,`New from template`]}),t[104]=U,t[105]=Be,t[106]=He):He=t[106];let Ue=!E,We;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(We=(0,Z.jsx)(yc,{"aria-hidden":`true`}),t[107]=We):We=t[107];let Ge;t[108]!==G||t[109]!==Ue?(Ge=(0,Z.jsxs)(dk,{disabled:Ue,onSelect:G,"data-testid":`empty-space-menu-new-folder`,children:[We,`New Folder`]}),t[108]=G,t[109]=Ue,t[110]=Ge):Ge=t[110];let Ke;t[111]===Symbol.for(`react.memo_cache_sentinel`)?(Ke=(0,Z.jsx)(hk,{}),t[111]=Ke):Ke=t[111];let qe;t[112]!==te||t[113]!==E?(qe=T?(0,Z.jsxs)(dk,{disabled:!E,onSelect:te,"data-testid":`empty-space-menu-reveal-in-finder`,"aria-label":E?`Reveal in Finder`:`Reveal in Finder, No workspace`,children:[(0,Z.jsx)(ve,{"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:`Reveal in Finder`}),E?null:(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:`No workspace`})]}):null,t[112]=te,t[113]=E,t[114]=qe):qe=t[114];let Je;t[115]!==O||t[116]!==A||t[117]!==D?(Je=(0,Z.jsx)(oU,{input:A,installStates:D,dispatch:O,webFallbackVisible:!1}),t[115]=O,t[116]=A,t[117]=D,t[118]=Je):Je=t[118];let Ye;t[119]!==re||t[120]!==E?(Ye=T?(0,Z.jsxs)(dk,{disabled:!E,onSelect:re,"data-testid":`empty-space-menu-open-in-terminal`,"aria-label":E?`Open in Terminal`:`Open in Terminal, No workspace`,children:[(0,Z.jsx)(il,{"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:`Open in Terminal`}),E?null:(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:`No workspace`})]}):null,t[119]=re,t[120]=E,t[121]=Ye):Ye=t[121];let Xe=!E,Ze=E?`Copy full path`:`Copy full path, No workspace`,Qe,$e;t[122]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=(0,Z.jsx)(F,{"aria-hidden":`true`}),$e=(0,Z.jsx)(`span`,{className:`flex-1`,children:`Copy full path`}),t[122]=Qe,t[123]=$e):(Qe=t[122],$e=t[123]);let et;t[124]===E?et=t[125]:(et=E?null:(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:`No workspace`}),t[124]=E,t[125]=et);let tt;t[126]!==ae||t[127]!==Xe||t[128]!==Ze||t[129]!==et?(tt=(0,Z.jsxs)(dk,{disabled:Xe,onSelect:ae,"data-testid":`empty-space-menu-copy-full-path`,"aria-label":Ze,children:[Qe,$e,et]}),t[126]=ae,t[127]=Xe,t[128]=Ze,t[129]=et,t[130]=tt):tt=t[130];let nt;t[131]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,Z.jsx)(hk,{}),t[131]=nt):nt=t[131];let rt=j===null,it;t[132]!==se||t[133]!==N||t[134]!==rt?(it=(0,Z.jsx)(mk,{checked:N,onCheckedChange:se,disabled:rt,"data-testid":`empty-space-menu-show-hidden-files`,children:`Show Hidden Files`}),t[132]=se,t[133]=N,t[134]=rt,t[135]=it):it=t[135];let at=j===null,ot;t[136]!==ce||t[137]!==P||t[138]!==at?(ot=(0,Z.jsx)(mk,{checked:P,onCheckedChange:ce,disabled:at,"data-testid":`empty-space-menu-show-all-files`,children:`Show all files`}),t[136]=ce,t[137]=P,t[138]=at,t[139]=ot):ot=t[139];let st;t[140]===R?st=t[141]:(st=R?(0,Z.jsx)(hk,{}):null,t[140]=R,t[141]=st);let ct;t[142]!==q||t[143]!==I?(ct=I?(0,Z.jsxs)(dk,{onSelect:q,"data-testid":`empty-space-menu-expand-all`,children:[(0,Z.jsx)(sl,{"aria-hidden":`true`}),`Expand all`]}):null,t[142]=q,t[143]=I,t[144]=ct):ct=t[144];let lt;t[145]!==fe||t[146]!==L?(lt=L?(0,Z.jsxs)(dk,{onSelect:fe,"data-testid":`empty-space-menu-collapse-all`,children:[(0,Z.jsx)(_c,{"aria-hidden":`true`}),`Collapse all`]}):null,t[145]=fe,t[146]=L,t[147]=lt):lt=t[147];let dt;t[148]!==ze||t[149]!==He||t[150]!==Ge||t[151]!==qe||t[152]!==Je||t[153]!==Ye||t[154]!==tt||t[155]!==it||t[156]!==ot||t[157]!==st||t[158]!==ct||t[159]!==lt?(dt=(0,Z.jsxs)(uk,{children:[ze,He,Ge,Ke,qe,Je,Ye,tt,nt,it,ot,st,ct,lt]}),t[148]=ze,t[149]=He,t[150]=Ge,t[151]=qe,t[152]=Je,t[153]=Ye,t[154]=tt,t[155]=it,t[156]=ot,t[157]=st,t[158]=ct,t[159]=lt,t[160]=dt):dt=t[160];let ft;return t[161]!==Ie||t[162]!==dt?(ft=(0,Z.jsx)(qD,{variant:`inset`,children:(0,Z.jsxs)(sk,{children:[Ie,dt]})}),t[161]=Ie,t[162]=dt,t[163]=ft):ft=t[163],ft}function wU(){return null}function TU(e){console.warn(`[FileSidebar] clipboard write failed:`,e),X.error(`Could not copy relative path`)}function EU(e){console.warn(`[FileSidebar] clipboard write failed:`,e),X.error(`Could not copy full path`)}function DU(e){bU(e.target)&&(e.preventDefault(),e.stopPropagation())}function OU(){let e=(0,$.c)(17),t=bn(),{collabUrl:n,setSystemProvider:r,updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c}=ut(),l;e[0]!==o||e[1]!==s||e[2]!==a||e[3]!==c||e[4]!==i?(l={updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c},e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=i,e[5]=l):l=e[5];let u=(0,Q.useRef)(l),d;e[6]!==o||e[7]!==s||e[8]!==a||e[9]!==c||e[10]!==i?(d=()=>{u.current={updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c}},e[6]=o,e[7]=s,e[8]=a,e[9]=c,e[10]=i,e[11]=d):d=e[11],(0,Q.useEffect)(d);let f,p;return e[12]!==n||e[13]!==t||e[14]!==r?(f=()=>{if(n===null)return;let e=new Dt,i=new Re({url:n,name:Xn,document:e,onStateless:e=>{let{payload:t}=e;G(t,{onServerInfo:e=>{u.current.updateServerInstanceId(e.serverInstanceId),e.currentBranch!==void 0&&u.current.observeBranch(e.currentBranch)},onBranchSwitched:e=>{u.current.onBranchSwitched(e.branch)},onDiskAck:e=>{u.current.observeDiskAck(e.docName,e.sv)},onDerivedView:PU,onConfigValidationRejected:NU,onConfigIgnoreNestedError:MU,onUnknown:jU})},onClose:AU,onDisconnect:kU}),a=Dr(e=>{(e.includes(`files`)||e.includes(`backlinks`))&&(t.invalidateQueries({queryKey:[`backlinks`]}),t.invalidateQueries({queryKey:[`forward-links`]})),(e.includes(`files`)||e.includes(`graph`))&&(t.invalidateQueries({queryKey:[`orphans`]}),t.invalidateQueries({queryKey:[`hubs`]}))}),o=ne(()=>{u.current.refreshServerInfo()});i.on(`synced`,()=>{Wr([`files`,`backlinks`,`graph`]),o()});let s=new Set,c=()=>{if(i.awareness)for(let[e,t]of i.awareness.getStates().entries())s.has(e)||t.user?.type===`agent`&&(s.add(e),console.warn(`[agent-presence] observed stale AwarenessUser.type === 'agent' from clientID ${e} — probably a stale bundled client`))};return i.awareness?.on(`change`,c),r(i),()=>{a(),i.awareness?.off(`change`,c),r(null),i.destroy(),e.destroy()}},p=[t,n,r],e[12]=n,e[13]=t,e[14]=r,e[15]=f,e[16]=p):(f=e[15],p=e[16]),(0,Q.useEffect)(f,p),null}function kU(){console.warn(`[CC1] __system__ disconnected - derived views may be stale`)}function AU(e){let{event:t}=e;console.warn(`[CC1] __system__ connection closed:`,t.code,t.reason)}function jU(e){console.warn(`[CC1] Unparseable stateless payload, skipping:`,e.slice(0,100))}function MU(e){so(e)}function NU(e){uo(e)}function PU(e){Wr([e.ch])}var FU=`#install-claude-desktop`;function IU(e){return e===`#settings`||e===FU}function LU(e,t,n){return[e,t,n].map(e=>[...e].sort().join(`\0`)).join(``)}function RU(){let e=(0,$.c)(20),{clearTarget:t,syncOpenTabsWithKnownTargets:n,tabSessionLoaded:r}=ut(),{openTargetTransition:i}=xt(),{assetPaths:a,folderPaths:o,loading:s,pages:c}=Nr(),l=(0,Q.useRef)(null),u;e[0]!==a||e[1]!==o||e[2]!==c?(u=LU(c,o,a),e[0]=a,e[1]=o,e[2]=c,e[3]=u):u=e[3];let d=u,f,p;e[4]!==a||e[5]!==o||e[6]!==s||e[7]!==c||e[8]!==n||e[9]!==r||e[10]!==d?(f=()=>{s||!r||l.current===d||(l.current=d,n({pages:c,folderPaths:o,assetPaths:a}))},p=[a,o,s,c,n,r,d],e[4]=a,e[5]=o,e[6]=s,e[7]=c,e[8]=n,e[9]=r,e[10]=d,e[11]=f,e[12]=p):(f=e[11],p=e[12]),(0,Q.useEffect)(f,p);let m,h;return e[13]!==t||e[14]!==o||e[15]!==s||e[16]!==i||e[17]!==c?(m=()=>{e();function e(){if(IU(window.location.hash))return;let e=$r(window.location.hash);if(e){let t=ti(e.split(`.`).pop()??``);Mt(`ok/nav/hash-change`,{docName:null,kind:`asset`}),i({kind:`asset`,target:e,assetPath:e,mediaKind:t});return}let n=oi(window.location.hash);if(!n){Mt(`ok/nav/hash-change`,{docName:null,kind:`clear`}),t();return}if(s){Mt(`ok/nav/hash-change`,{docName:n,kind:`deferred-loading`});return}let r=Fr(n,{pages:c,folderPaths:o});if(r.kind===`missing`&&/\/+$/.test(n.trim())){Mt(`ok/nav/hash-change`,{docName:n,kind:`deferred-missing-folder`});return}let a=ui(r);Mt(`ok/nav/hash-change`,{docName:n,kind:a.kind}),i(a)}return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},h=[t,o,s,i,c],e[13]=t,e[14]=o,e[15]=s,e[16]=i,e[17]=c,e[18]=m,e[19]=h):(m=e[18],h=e[19]),(0,Q.useEffect)(m,h),null}function zU(){let e=(0,$.c)(5),[t,n]=(0,Q.useState)(typeof window<`u`&&window.location.hash===FU),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=function(){window.location.hash===FU&&n(!0)};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,Q.useEffect)(r,i);let a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=function(e){if(n(e),!e&&window.location.hash===FU){let{pathname:e,search:t}=window.location;window.history.replaceState(null,``,`${e}${t}`)}},e[2]=a):a=e[2];let o=a,s;return e[3]===t?s=e[4]:(s=(0,Z.jsx)(Ia,{open:t,onOpenChange:o}),e[3]=t,e[4]=s),s}function BU(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],(0,Q.useEffect)(VU,t),null}function VU(){let e=function(e){let t=e.target;nh({target:t,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,key:e.key})&&(e.preventDefault(),window.location.hash!==`#settings`&&(window.location.hash=th))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)}function HU(){let e=(0,$.c)(4),{activeTarget:t}=ut(),n=typeof window<`u`?window.okDesktop??null:null,r=t?.kind===`doc`||t?.kind===`folder`?t.kind:null,i=t?.kind===`doc`?t.docName:t?.kind===`folder`?t.folderPath:null,a,o;return e[0]!==i||e[1]!==r?(a=()=>{if(n){if(r===null){n.editor.notifyActiveTargetChanged({kind:null});return}i!==null&&n.editor.notifyActiveTargetChanged({kind:r,identifier:i})}},o=[n,r,i],e[0]=i,e[1]=r,e[2]=a,e[3]=o):(a=e[2],o=e[3]),(0,Q.useEffect)(a,o),null}function UU(){let e=(0,$.c)(8),{activeDocName:t,activeTarget:n}=ut(),[r,i]=(0,Q.useState)(!1),a;e[0]!==t||e[1]!==n?(a=n?.kind===`folder`?n.folderPath:_i(t),e[0]=t,e[1]=n,e[2]=a):a=e[2];let o=a,s,c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=function(e){let t=e.target;ym({target:t,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,key:e.key})&&(e.preventDefault(),i(!0))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},c=[],e[3]=s,e[4]=c):(s=e[3],c=e[4]),(0,Q.useEffect)(s,c);let l;return e[5]!==r||e[6]!==o?(l=(0,Z.jsx)(xm,{open:r,onOpenChange:i,kind:`file`,initialDir:o}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function WU(){let e=(0,$.c)(21),t=typeof window<`u`?window.okDesktop??null:null,n=typeof window<`u`&&window.okDesktop!=null,[r,i]=(0,Q.useState)(!1),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(null),l;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=t?hl({bridge:t,authQueryTransport:yl(),cloneTransport:Tl(),openSignIn:()=>new Promise(e=>{c(()=>e),o(!0)})}):null,e[0]=l):l=e[0];let u=l,d;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(wg,{}),e[1]=d):d=e[1];let f,p,m,h,g,_,v,y;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(OU,{}),p=(0,Z.jsx)(RU,{}),m=(0,Z.jsx)(HU,{}),h=(0,Z.jsx)(UU,{}),g=(0,Z.jsx)(BU,{}),_=(0,Z.jsx)(zU,{}),v=(0,Z.jsx)(Fd,{}),y=t&&u?(0,Z.jsx)(Yd,{bridge:t,cloneController:u}):null,e[2]=f,e[3]=p,e[4]=m,e[5]=h,e[6]=g,e[7]=_,e[8]=v,e[9]=y):(f=e[2],p=e[3],m=e[4],h=e[5],g=e[6],_=e[7],v=e[8],y=e[9]);let b;e[10]!==a||e[11]!==s?(b=t?(0,Z.jsx)(rd,{open:a,onOpenChange:e=>{e||(o(!1),s?.(null),c(null))},onSuccess:e=>{s?.({authenticated:!0,host:`github.com`,login:e.login}),c(null)}}):null,e[10]=a,e[11]=s,e[12]=b):b=e[12];let x;e[13]===r?x=e[14]:(x=(0,Z.jsx)(_g,{bridge:t,open:r,onOpenChange:i}),e[13]=r,e[14]=x);let S;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(S=n&&(0,Z.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`editor-window-chrome-drag-strip`,"data-electron-drag":``,className:`pointer-events-none fixed inset-x-0 top-0 z-50 h-2 [-webkit-app-region:drag]`}),e[15]=S):S=e[15];let C;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(xU,{onOpenSearch:()=>i(!0)}),e[16]=C):C=e[16];let w;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsxs)(WD,{className:`h-screen overflow-hidden`,children:[C,(0,Z.jsx)(XD,{className:`overflow-hidden h-[calc(100vh-var(--layout-inset-offset))]`,children:(0,Z.jsx)(jA,{})})]}),e[17]=w):w=e[17];let T;return e[18]!==b||e[19]!==x?(T=(0,Z.jsx)(J,{name:`app`,children:(0,Z.jsx)(Et,{children:(0,Z.jsxs)(me,{children:[d,(0,Z.jsxs)(si,{children:[f,p,m,h,g,_,v,y,b,x,S,w]})]})})}),e[18]=b,e[19]=x,e[20]=T):T=e[20],T}Ns(),typeof window<`u`&&window.okDesktop?.config.apiOrigin&&of({apiOrigin:window.okDesktop.config.apiOrigin}),Jf()&&ep(),Dp(),typeof window<`u`&&Mf({bridge:window.okDesktop}),typeof window<`u`&&as({bridge:window.okDesktop}),typeof window<`u`&&ts({bridge:window.okDesktop}),typeof window<`u`&&Ff({bridge:window.okDesktop}),typeof window<`u`&&Jd({bridge:window.okDesktop});var GU=new Hs({defaultOptions:{queries:{retry:1,staleTime:1e4}}}),KU=document.getElementById(`root`);if(!KU)throw Error(`Root element not found`);var qU=typeof window<`u`&&window.okDesktop?.config.mode===`navigator`;(0,Qs.createRoot)(KU).render((0,Z.jsx)(Q.StrictMode,{children:(0,Z.jsx)(Kt,{i18n:Of,children:(0,Z.jsx)(pn,{client:GU,children:(0,Z.jsxs)(Qr,{attribute:`class`,defaultTheme:`system`,enableSystem:!0,disableTransitionOnChange:!0,storageKey:`ok-theme-v1`,children:[(0,Z.jsx)(Xr,{children:qU&&window.okDesktop?(0,Z.jsx)(ef,{bridge:window.okDesktop}):(0,Z.jsx)(WU,{})}),(0,Z.jsx)(af,{richColors:!0,closeButton:!0})]})})})}));