@inkeep/open-knowledge 0.5.0-beta.32 → 0.5.0-beta.34

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 (57) hide show
  1. package/dist/assets/skills/open-knowledge/SKILL.md +3 -3
  2. package/dist/cli.mjs +34 -36
  3. package/dist/constants-WWN6oJ4h.mjs +2 -0
  4. package/dist/dist-DfGdFarN.mjs +1 -0
  5. package/dist/{dist-B6MS3WBH.mjs → dist-glNrnHP0.mjs} +14 -189
  6. package/dist/index.mjs +1 -1
  7. package/dist/{init-BhlJM4rl.mjs → init-BpIc-g0N.mjs} +8 -8
  8. package/dist/init-CnbFuJA7.mjs +1 -0
  9. package/dist/{loader-B1jCcMYd.mjs → loader-CtFvlinY.mjs} +3 -3
  10. package/dist/loader-DHfDN1M1.mjs +1 -0
  11. package/dist/preview-B1X8auY3.mjs +1 -0
  12. package/dist/{preview-BMvIW8jV.mjs → preview-FVZNAI7h.mjs} +2 -2
  13. package/dist/public/assets/{ActivityModeContent-Ujcca9iS.js → ActivityModeContent-DaTVFKNP.js} +1 -1
  14. package/dist/public/assets/{ConsentDialogBody-DddrxgSk.js → ConsentDialogBody-DmBVz-Q3.js} +1 -1
  15. package/dist/public/assets/DocumentContext-DIryeJDZ.js +52 -0
  16. package/dist/public/assets/{GraphPanel-DjjMb8Jx.js → GraphPanel-DfJ5QIY-.js} +2 -2
  17. package/dist/public/assets/{McpConsentDialogBody-D6COAaWG.js → McpConsentDialogBody-nfOIAtwG.js} +1 -1
  18. package/dist/public/assets/SettingsDialog-D_QZNx5I.js +11 -0
  19. package/dist/public/assets/SourceEditor-C6qXNflf.js +2 -0
  20. package/dist/public/assets/{agent-presence-C9zIlaSm.js → agent-presence-LoQiwUUV.js} +1 -1
  21. package/dist/public/assets/{button-jHkzz0kg.js → button-BigAOfY9.js} +1 -1
  22. package/dist/public/assets/config-validation-events-DrekQdtM.js +10 -0
  23. package/dist/public/assets/{dialog-aTGC_OHs.js → dialog-CbHo1eZD.js} +3 -3
  24. package/dist/public/assets/{dist-BpKSkQFf.js → dist-DbPwRkgP.js} +1 -1
  25. package/dist/public/assets/{dist-CcCHwIMj.js → dist-Qx1N2jU5.js} +1 -1
  26. package/dist/public/assets/{doc-hash-ek4HbIsU.js → doc-hash-BZGAbwgw.js} +51 -51
  27. package/dist/public/assets/index-Bj0NfTt2.css +1 -0
  28. package/dist/public/assets/index-C30DOh_U.js +1918 -0
  29. package/dist/public/assets/{input-_NgekzP6.js → input-BHythLXk.js} +1 -1
  30. package/dist/public/assets/{label-D3fsVWmW.js → label-Cv_LZFf-.js} +1 -1
  31. package/dist/public/assets/{mcp-consent-store-Cf5AdDXf.js → mcp-consent-store-BlzZxan6.js} +1 -1
  32. package/dist/public/assets/{panel-DfWmoeYO.js → panel-CG6xouXb.js} +1 -1
  33. package/dist/public/assets/{target-navigation-intent-BfcE2s63.js → target-navigation-intent-DHgrhl0F.js} +1 -1
  34. package/dist/public/assets/{textarea-BSSBCXzx.js → textarea-Cw3uXUVc.js} +1 -1
  35. package/dist/public/assets/toggle-group-DaO2tdZq.js +1 -0
  36. package/dist/public/assets/{tooltip-DFekRukm.js → tooltip-DS7NYbjB.js} +1 -1
  37. package/dist/public/assets/{typing-burst-detector-C-JtGXH8.js → typing-burst-detector-DY26wxc3.js} +1 -1
  38. package/dist/public/index.html +19 -19
  39. package/dist/{repair-launch-json-Dw-0FgfH.mjs → repair-launch-json-Dy3tOf1L.mjs} +2 -2
  40. package/dist/{repair-mcp-configs-D86xNDK0.mjs → repair-mcp-configs-BwCwMD-K.mjs} +2 -2
  41. package/dist/{src-B_TnT2KV.mjs → src-CY_xim1u.mjs} +2 -2
  42. package/dist/{start-BuIA95gx.mjs → start-Biv7po6h.mjs} +2 -2
  43. package/dist/start-D7KRPRx3.mjs +1 -0
  44. package/package.json +1 -1
  45. package/dist/constants-C43VVdXn.mjs +0 -2
  46. package/dist/dist-_ap0w9P-.mjs +0 -1
  47. package/dist/init-XiA4tbUC.mjs +0 -1
  48. package/dist/loader-j0RyR9NU.mjs +0 -1
  49. package/dist/preview-CkUzBitq.mjs +0 -1
  50. package/dist/public/assets/DocumentContext-DOG9Tazn.js +0 -52
  51. package/dist/public/assets/SettingsDialog-CgJgbQqe.js +0 -11
  52. package/dist/public/assets/SourceEditor-XX2CbbTM.js +0 -2
  53. package/dist/public/assets/config-validation-events-Ct5ZFdjf.js +0 -10
  54. package/dist/public/assets/index-BKegc_3x.js +0 -1917
  55. package/dist/public/assets/index-jjg4I_Nd.css +0 -1
  56. package/dist/public/assets/toggle-group-COSNGuCO.js +0 -1
  57. package/dist/start-pfpKloex.mjs +0 -1
@@ -0,0 +1,1918 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./telemetry-impl-IWNN1g1D.js","./chunk-CFjPhJqf.js","./preload-helper-2ej06EnG.js","./trace-api-CiCjX4Sz.js","./propagation-api-3kmMXRwS.js","./ConsentDialogBody-DmBVz-Q3.js","./button-BigAOfY9.js","./compiler-runtime-CVnuRdak.js","./dialog-CbHo1eZD.js","./input-BHythLXk.js","./textarea-Cw3uXUVc.js","./project-paths-hiY0fNWB.js","./McpConsentDialogBody-nfOIAtwG.js","./mcp-consent-store-BlzZxan6.js","./dist-DbPwRkgP.js","./dist-Qx1N2jU5.js","./label-Cv_LZFf-.js","./ActivityPanelDiffView-EaCFURAu.js","./ActivityPanelDiffView-legcy4jI.css","./GraphPanel-DfJ5QIY-.js","./doc-hash-BZGAbwgw.js","./w3c-keyname-B5t0fahT.js","./toggle-group-DaO2tdZq.js","./tooltip-DS7NYbjB.js","./panel-CG6xouXb.js","./min-VayDM1tY.js","./src-BYmEUJ3I.js","./colors-BbIH8S-B.js","./ordinal-C6wHcby9.js","./init-gbiKrEzm.js","./isObjectLike-BNNgtFA6.js","./now--RAZR_wd.js","./isSymbol-CiN6ou2H.js","./target-navigation-intent-DHgrhl0F.js","./ActivityModeContent-DaTVFKNP.js","./DocumentContext-DIryeJDZ.js","./dist-Cp-iTcML.js","./dist-D2RGH7XO.js","./dist-BiYnsAMa.js","./dist-B3L7cm0M.js","./dist-CATLRngz.js","./stex-J8UMaf7u.js","./agent-presence-LoQiwUUV.js","./SourceEditor-C6qXNflf.js","./typing-burst-detector-DY26wxc3.js","./SettingsDialog-D_QZNx5I.js","./config-validation-events-DrekQdtM.js"])))=>i.map(i=>d[i]);
2
+ import{o as e,r as t,t as n}from"./chunk-CFjPhJqf.js";import{t as r}from"./preload-helper-2ej06EnG.js";import{n as i,r as a,t as o}from"./compiler-runtime-CVnuRdak.js";import{$ as s,An as c,At as l,B as u,Bn as d,Bt as f,C as p,Cn as m,Ct as h,Dn as g,Dt as _,E as v,En as y,Et as b,F as x,Fn as S,Ft as C,G as w,Gn as T,Gt as E,H as D,Hn as O,Ht as k,I as A,In as j,It as M,Jn as N,Jt as P,K as F,Kn as I,Kt as L,L as R,Ln as z,Lt as B,M as V,Mn as H,Mt as U,N as W,Nn as G,Nt as K,On as ee,Ot as q,P as te,Pn as ne,Pt as re,Q as ie,Qt as ae,R as oe,Rn as se,Rt as ce,S as le,Sn as ue,St as de,T as fe,Tn as pe,Tt as me,U as he,Ut as ge,V as _e,Vn as ve,Vt as ye,W as be,Wn as xe,Wt as Se,X as Ce,Xn as we,Xt as Te,Y as Ee,Yn as De,Yt as Oe,Z as ke,_ as Ae,_n as je,_t as Me,a as Ne,at as Pe,bn as Fe,bt as Ie,c as Le,ct as Re,d as ze,dn as Be,dt as Ve,et as He,f as Ue,fn as We,ft as Ge,g as Ke,gn as qe,gt as Je,h as Ye,hn as Xe,ht as Ze,i as Qe,it as $e,j 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,n as lt,nt as ut,o as dt,ot as ft,p as pt,pn as mt,q as ht,qn as gt,qt as _t,r as vt,rt as yt,s as bt,st as xt,t as St,tt as Ct,u as wt,un as Tt,ut as Et,vn as Dt,vt as Ot,w as kt,wn as At,wt as jt,x as Mt,xn as Nt,xt as Pt,yn as Ft,yt as It,z as Lt,zn as Rt,zt}from"./DocumentContext-DIryeJDZ.js";import{A as Bt,C as Vt,D as Ht,E as Ut,O as Wt,S as Gt,T as Kt,_ as qt,a as Jt,b as Yt,c as Xt,d as Zt,f as Qt,g as $t,h as en,i as tn,k as nn,l as rn,m as an,n as on,p as sn,r as cn,s as ln,t as un,u as dn,v as fn,w as pn,x as mn,y as hn}from"./panel-CG6xouXb.js";import{An as gn,B as _n,Br as vn,C as yn,Cn as bn,Dr as xn,En as Sn,Er as Cn,F as wn,Fn as Tn,G as En,Gt as Dn,Hr as On,I as kn,It as An,Jt as jn,K as Mn,Kt as Nn,L as Pn,M as Fn,Mn as In,Mr as Ln,N as Rn,On as zn,Or as Bn,P as Vn,Pn as Hn,Pr as Un,R as Wn,Rr as Gn,Rt as Kn,S as qn,Sn as Jn,St as Yn,T as Xn,Ut as Zn,V as Qn,Vr as $n,Vt as er,Wn as tr,Wt as nr,Z as rr,_n as ir,_r as ar,_t as or,a as sr,ai as cr,an as lr,ar as ur,b as dr,bn as fr,bt as pr,c as mr,cn as hr,cr as gr,ct as _r,dt as vr,en as yr,er as br,f as xr,ft as Sr,g as Cr,gn as wr,gr as Tr,gt as Er,hn as Dr,ht as Or,i as kr,ii as Ar,ir as jr,j as Mr,jr as Nr,kt as Pr,l as Fr,lr as Ir,m as Lr,mn as Rr,mr as zr,n as Br,o as Vr,oi as Hr,on as Ur,pn as Wr,q as Gr,qn as Kr,r as qr,ri as Jr,rn as Yr,s as Xr,sn as Zr,sr as Qr,t as $r,u as ei,ur as ti,vr as ni,w as ri,x as ii,xn as ai,xt as oi,yr as si,yt as ci,z as li}from"./doc-hash-BZGAbwgw.js";import{C as ui,S as di,a as fi,b as pi,c as mi,f as hi,h as gi,n as _i,p as vi,s as yi,t as J,u as bi,x as Y,y as xi}from"./button-BigAOfY9.js";import{a as Si,c as Ci,d as wi,f as Ti,i as Ei,l as Di,m as Oi,n as ki,o as Ai,p as ji,r as Mi,s as Ni,t as Pi,u as Fi}from"./agent-presence-LoQiwUUV.js";import{$ as Ii,A as Li,At as Ri,B as zi,C as Bi,Ct as Vi,D as Hi,Dt as Ui,E as Wi,Et as Gi,F as Ki,G as qi,H as Ji,I as Yi,J as Xi,K as Zi,L as Qi,M as $i,N as ea,O as ta,Ot as na,P as ra,Q as ia,R as aa,S as oa,St as sa,T as ca,Tt as la,U as ua,V as da,W as fa,X as pa,Y as ma,Z as ha,_ as ga,_t as _a,a as va,at as ya,b as ba,bt as xa,ct as Sa,dt as Ca,et as wa,ft as Ta,g as Ea,gt as Da,h as Oa,ht as ka,it as Aa,j as ja,jt as Ma,k as Na,kt as Pa,lt as Fa,m as Ia,mt as La,nt as Ra,o as za,ot as Ba,p as Va,pt as Ha,q as Ua,r as Wa,rt as Ga,st as Ka,t as qa,tt as Ja,u as Ya,ut as Xa,v as Za,vt as Qa,w as $a,wt as eo,x as to,xt as no,y as ro,yt as io,z as ao}from"./config-validation-events-DrekQdtM.js";import{n as oo,r as so,t as co}from"./target-navigation-intent-DHgrhl0F.js";import{n as lo,t as uo}from"./dist-DbPwRkgP.js";import{S as fo,a as po,b as mo,c as ho,f as go,h as _o,i as vo,l as yo,m as bo,n as xo,o as So,p as Co,s as wo,t as To,u as Eo,x as X}from"./dialog-CbHo1eZD.js";import{t as Do}from"./dist-Qx1N2jU5.js";import{n as Oo,r as ko,t as Ao}from"./mcp-consent-store-BlzZxan6.js";import{a as jo,i as Mo,n as No,o as Po,r as Fo,t as Io}from"./toggle-group-DaO2tdZq.js";import{t as Lo}from"./label-Cv_LZFf-.js";import{i as Ro,n as zo,r as Bo,t as Vo}from"./tooltip-DS7NYbjB.js";import{t as Ho}from"./input-BHythLXk.js";import{i as Uo,n as Wo,r as Go}from"./project-paths-hiY0fNWB.js";import{$ as Ko,At as qo,Ct as Jo,Dt as Yo,Ft as Xo,I as Zo,It as Qo,J as $o,Mt as es,Ot as ts,Pt as ns,Q as rs,Tt as is,X as as,Z as os,at as ss,bt as cs,jt as ls,k as us,w as ds}from"./dist-D2RGH7XO.js";import{n as fs,o as ps,r as ms,t as hs}from"./typing-burst-detector-DY26wxc3.js";import{t as gs}from"./textarea-Cw3uXUVc.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 _s(){({BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1})?.VITE_OTEL_ENABLED===`true`&&r(()=>import(`./telemetry-impl-IWNN1g1D.js`).then(e=>e.install()),__vite__mapDeps([0,1,2,3,4]),import.meta.url)}function vs(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=>{$t(e,()=>t.signal,()=>n=!0)},u=hn(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?fn:qt;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?bs:ys,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:ys(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 ys(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 bs(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var xs=class extends Qt{#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||Ss(),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=sn({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),en.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ss(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Cs=class extends Bt{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 xs({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=ws(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=ws(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=ws(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=ws(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){en.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=>Vt(t,e))}findAll(e={}){return this.getAll().filter(t=>Vt(e,t))}notify(e){en.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return en.batch(()=>Promise.all(e.map(e=>e.continue().catch(Kt))))}};function ws(e){return e.options.scope?.id}var Ts=class extends Bt{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Gt(r,t),a=this.get(i);return a||(a=new Zt({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(){en.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=>pn(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>pn(e,t)):t}notify(e){en.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){en.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){en.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Es=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Ts,this.#t=e.mutationCache||new Cs,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=nn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=an.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(Ht(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=Yt(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return en.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;en.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return en.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=en.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Kt).catch(Kt)}invalidateQueries(e,t={}){return en.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=en.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(Kt)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Kt)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Ht(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Kt).catch(Kt)}fetchInfiniteQuery(e){return e.behavior=vs(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Kt).catch(Kt)}ensureInfiniteQueryData(e){return e.behavior=vs(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return an.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(mn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Ut(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(mn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Ut(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||=Gt(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===Wt&&(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()}},Ds=n((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}}}})),Os=n(((e,t)=>{t.exports=Ds()})),ks=n((e=>{var t=Os(),n=i(),r=ui();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=r.__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 K(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 ee(){B(H),B(U),B(W)}function q(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 te(e){U.current===e&&(B(H),B(U)),G.current===e&&(B(G),Qf._currentValue=I)}var ne,re;function ie(e){if(ne===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ne=t&&t[1]||``,re=-1<e.stack.indexOf(`
3
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
+ `+ne+e+re}var ae=!1;function oe(e,t){if(!e||ae)return``;ae=!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{ae=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ie(n):``}function se(e,t){switch(e.tag){case 26:case 27:case 5:return ie(e.type);case 16:return ie(`Lazy`);case 13:return e.child!==t&&t!==null?ie(`Suspense Fallback`):ie(`Suspense`);case 19:return ie(`SuspenseList`);case 0:case 15:return oe(e.type,!1);case 11:return oe(e.type.render,!1);case 1:return oe(e.type,!0);case 31:return ie(`Activity`);default:return``}}function ce(e){try{var t=``,n=null;do t+=se(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
+ Error generating stack: `+e.message+`
9
+ `+e.stack}}var le=Object.prototype.hasOwnProperty,ue=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 Ie(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 Le(){var e=Me;return Me<<=1,!(Me&62914560)&&(Me=4194304),e}function Re(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ze(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Be(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&&Ve(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ve(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 He(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 Ue(e,t){var n=t&-t;return n=n&42?1:We(n),(n&(e.suspendedLanes|t))===0?n:0}function We(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 Ge(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Ke(){var e=F.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function qe(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var Je=Math.random().toString(36).slice(2),Ye=`__reactFiber$`+Je,Xe=`__reactProps$`+Je,Ze=`__reactContainer$`+Je,Qe=`__reactEvents$`+Je,$e=`__reactListeners$`+Je,et=`__reactHandles$`+Je,tt=`__reactResources$`+Je,nt=`__reactMarker$`+Je;function rt(e){delete e[Ye],delete e[Xe],delete e[Qe],delete e[$e],delete e[et]}function it(e){var t=e[Ye];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ze]||n[Ye]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[Ye])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function at(e){if(e=e[Ye]||e[Ze]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ot(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function st(e){var t=e[tt];return t||=e[tt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function ct(e){e[nt]=!0}var lt=new Set,ut={};function dt(e,t){ft(e,t),ft(e+`Capture`,t)}function ft(e,t){for(ut[e]=t,e=0;e<t.length;e++)lt.add(t[e])}var pt=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]*$`),mt={},ht={};function gt(e){return le.call(ht,e)?!0:le.call(mt,e)?!1:pt.test(e)?ht[e]=!0:(mt[e]=!0,!1)}function _t(e,t,n){if(gt(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 vt(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 yt(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 bt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function xt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function St(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 Ct(e){if(!e._valueTracker){var t=xt(e)?`checked`:`value`;e._valueTracker=St(e,t,``+e[t])}}function wt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=xt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Tt(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 Et=/[\n"\\]/g;function Dt(e){return e.replace(Et,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ot(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=``+bt(t)):e.value!==``+bt(t)&&(e.value=``+bt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):At(e,o,bt(n)):At(e,o,bt(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=``+bt(s):e.removeAttribute(`name`)}function kt(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)){Ct(e);return}n=n==null?``:``+bt(n),t=t==null?n:``+bt(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),Ct(e)}function At(e,t,n){t===`number`&&Tt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function jt(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=``+bt(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 Mt(e,t,n){if(t!=null&&(t=``+bt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+bt(n)}function Nt(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=bt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ct(e)}function Pt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ft=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 It(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||Ft.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Lt(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&&It(e,i,r)}else for(var o in t)t.hasOwnProperty(o)&&It(e,o,t[o])}function Rt(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 zt=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`]]),Bt=/^[\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 Vt(e){return Bt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Ht(){}var Ut=null;function Wt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Gt=null,Kt=null;function qt(e){var t=at(e);if(t&&(e=t.stateNode)){var n=e[Xe]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ot(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="`+Dt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[Xe]||null;if(!i)throw Error(a(90));Ot(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&&wt(r)}break a;case`textarea`:Mt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&jt(e,!!n.multiple,t,!1)}}}var Jt=!1;function Yt(e,t,n){if(Jt)return e(t,n);Jt=!0;try{return e(t)}finally{if(Jt=!1,(Gt!==null||Kt!==null)&&(_u(),Gt&&(t=Gt,e=Kt,Kt=Gt=null,qt(t),e)))for(t=0;t<e.length;t++)qt(e[t])}}function Xt(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Xe]||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 Zt=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),Qt=!1;if(Zt)try{var $t={};Object.defineProperty($t,`passive`,{get:function(){Qt=!0}}),window.addEventListener(`test`,$t,$t),window.removeEventListener(`test`,$t,$t)}catch{Qt=!1}var en=null,tn=null,nn=null;function rn(){if(nn)return nn;var e,t=tn,n=t.length,r,i=`value`in en?en.value:en.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 nn=i.slice(e,1<r?1-r:void 0)}function an(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 on(){return!0}function sn(){return!1}function cn(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)?on:sn,this.isPropagationStopped=sn,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=on)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=on)},persist:function(){},isPersistent:on}),t}var ln={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},un=cn(ln),dn=p({},ln,{view:0,detail:0}),fn=cn(dn),pn,mn,hn,gn=p({},dn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dn,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!==hn&&(hn&&e.type===`mousemove`?(pn=e.screenX-hn.screenX,mn=e.screenY-hn.screenY):mn=pn=0,hn=e),pn)},movementY:function(e){return`movementY`in e?e.movementY:mn}}),_n=cn(gn),vn=cn(p({},gn,{dataTransfer:0})),yn=cn(p({},dn,{relatedTarget:0})),bn=cn(p({},ln,{animationName:0,elapsedTime:0,pseudoElement:0})),xn=cn(p({},ln,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Sn=cn(p({},ln,{data:0})),Cn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},wn={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`},Tn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function En(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Tn[e])?!!t[e]:!1}function Dn(){return En}var On=cn(p({},dn,{key:function(e){if(e.key){var t=Cn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=an(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?wn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dn,charCode:function(e){return e.type===`keypress`?an(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?an(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),kn=cn(p({},gn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),An=cn(p({},dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dn})),jn=cn(p({},ln,{propertyName:0,elapsedTime:0,pseudoElement:0})),Mn=cn(p({},gn,{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})),Nn=cn(p({},ln,{newState:0,oldState:0})),Pn=[9,13,27,32],Fn=Zt&&`CompositionEvent`in window,In=null;Zt&&`documentMode`in document&&(In=document.documentMode);var Ln=Zt&&`TextEvent`in window&&!In,Rn=Zt&&(!Fn||In&&8<In&&11>=In),zn=` `,Bn=!1;function Vn(e,t){switch(e){case`keyup`:return Pn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Hn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Un=!1;function Wn(e,t){switch(e){case`compositionend`:return Hn(t);case`keypress`:return t.which===32?(Bn=!0,zn):null;case`textInput`:return e=t.data,e===zn&&Bn?null:e;default:return null}}function Gn(e,t){if(Un)return e===`compositionend`||!Fn&&Vn(e,t)?(e=rn(),nn=tn=en=null,Un=!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 Rn&&t.locale!==`ko`?null:t.data;default:return null}}var Kn={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 qn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Kn[e.type]:t===`textarea`}function Jn(e,t,n,r){Gt?Kt?Kt.push(r):Kt=[r]:Gt=r,t=Td(t,`onChange`),0<t.length&&(n=new un(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Yn=null,Xn=null;function Zn(e){_d(e,0)}function Qn(e){if(wt(ot(e)))return e}function $n(e,t){if(e===`change`)return t}var er=!1;if(Zt){var tr;if(Zt){var nr=`oninput`in document;if(!nr){var rr=document.createElement(`div`);rr.setAttribute(`oninput`,`return;`),nr=typeof rr.oninput==`function`}tr=nr}else tr=!1;er=tr&&(!document.documentMode||9<document.documentMode)}function ir(){Yn&&(Yn.detachEvent(`onpropertychange`,ar),Xn=Yn=null)}function ar(e){if(e.propertyName===`value`&&Qn(Xn)){var t=[];Jn(t,Xn,e,Wt(e)),Yt(Zn,t)}}function or(e,t,n){e===`focusin`?(ir(),Yn=t,Xn=n,Yn.attachEvent(`onpropertychange`,ar)):e===`focusout`&&ir()}function sr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Qn(Xn)}function cr(e,t){if(e===`click`)return Qn(t)}function lr(e,t){if(e===`input`||e===`change`)return Qn(t)}function ur(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var dr=typeof Object.is==`function`?Object.is:ur;function fr(e,t){if(dr(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(!le.call(t,i)||!dr(e[i],t[i]))return!1}return!0}function pr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mr(e,t){var n=pr(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=pr(n)}}function hr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function gr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Tt(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=Tt(e.document)}return t}function _r(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 vr=Zt&&`documentMode`in document&&11>=document.documentMode,yr=null,br=null,xr=null,Sr=!1;function Cr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Sr||yr==null||yr!==Tt(r)||(r=yr,`selectionStart`in r&&_r(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}),xr&&fr(xr,r)||(xr=r,r=Td(br,`onSelect`),0<r.length&&(t=new un(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=yr)))}function wr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Tr={animationend:wr(`Animation`,`AnimationEnd`),animationiteration:wr(`Animation`,`AnimationIteration`),animationstart:wr(`Animation`,`AnimationStart`),transitionrun:wr(`Transition`,`TransitionRun`),transitionstart:wr(`Transition`,`TransitionStart`),transitioncancel:wr(`Transition`,`TransitionCancel`),transitionend:wr(`Transition`,`TransitionEnd`)},Er={},Dr={};Zt&&(Dr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Tr.animationend.animation,delete Tr.animationiteration.animation,delete Tr.animationstart.animation),`TransitionEvent`in window||delete Tr.transitionend.transition);function Or(e){if(Er[e])return Er[e];if(!Tr[e])return e;var t=Tr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Dr)return Er[e]=t[n];return e}var kr=Or(`animationend`),Ar=Or(`animationiteration`),jr=Or(`animationstart`),Mr=Or(`transitionrun`),Nr=Or(`transitionstart`),Pr=Or(`transitioncancel`),Fr=Or(`transitionend`),Ir=new Map,Lr=`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(` `);Lr.push(`scrollEnd`);function Rr(e,t){Ir.set(e,t),dt(t,[e])}var zr=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)},Br=[],Vr=0,Hr=0;function Ur(){for(var e=Vr,t=Hr=Vr=0;t<e;){var n=Br[t];Br[t++]=null;var r=Br[t];Br[t++]=null;var i=Br[t];Br[t++]=null;var a=Br[t];if(Br[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&&qr(n,i,a)}}function Wr(e,t,n,r){Br[Vr++]=e,Br[Vr++]=t,Br[Vr++]=n,Br[Vr++]=r,Hr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Gr(e,t,n,r){return Wr(e,t,n,r),Jr(e)}function Kr(e,t){return Wr(e,null,null,t),Jr(e)}function qr(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 Jr(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 Yr={};function Xr(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 Zr(e,t,n,r){return new Xr(e,t,n,r)}function Qr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $r(e,t){var n=e.alternate;return n===null?(n=Zr(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 ei(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 ti(e,t,n,r,i,o){var s=0;if(r=e,typeof e==`function`)Qr(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=Zr(31,n,t,i),e.elementType=D,e.lanes=o,e;case _:return ni(n.children,i,o,t);case v:s=8,i|=24;break;case y:return e=Zr(12,n,t,i|2),e.elementType=y,e.lanes=o,e;case C:return e=Zr(13,n,t,i),e.elementType=C,e.lanes=o,e;case w:return e=Zr(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=Zr(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function ni(e,t,n,r){return e=Zr(7,e,r,t),e.lanes=n,e}function ri(e,t,n){return e=Zr(6,e,null,t),e.lanes=n,e}function ii(e){var t=Zr(18,null,null,0);return t.stateNode=e,t}function ai(e,t,n){return t=Zr(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var oi=new WeakMap;function si(e,t){if(typeof e==`object`&&e){var n=oi.get(e);return n===void 0?(t={value:e,source:t,stack:ce(t)},oi.set(e,t),t):n}return{value:e,source:t,stack:ce(t)}}var ci=[],li=0,di=null,fi=0,pi=[],mi=0,hi=null,gi=1,_i=``;function vi(e,t){ci[li++]=fi,ci[li++]=di,di=e,fi=t}function yi(e,t,n){pi[mi++]=gi,pi[mi++]=_i,pi[mi++]=hi,hi=e;var r=gi;e=_i;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,gi=1<<32-Ee(t)+i|n<<i|r,_i=a+e}else gi=1<<a|n<<i|r,_i=e}function J(e){e.return!==null&&(vi(e,1),yi(e,1,0))}function bi(e){for(;e===di;)di=ci[--li],ci[li]=null,fi=ci[--li],ci[li]=null;for(;e===hi;)hi=pi[--mi],pi[mi]=null,_i=pi[--mi],pi[mi]=null,gi=pi[--mi],pi[mi]=null}function Y(e,t){pi[mi++]=gi,pi[mi++]=_i,pi[mi++]=hi,gi=t.id,_i=t.overflow,hi=e}var xi=null,Si=null,Ci=!1,wi=null,Ti=!1,Ei=Error(a(519));function Di(e){throw Ni(si(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[Ye]=e,t[Xe]=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),kt(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),Nt(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=Ht),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 Li(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;dr(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(!dr(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(Ht,Ht),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(Ht,Ht);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=$r(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=ri(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=ti(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=ai(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=ni(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=ri(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case h:return n=ti(t.type,t.key,t.props,null,e.mode,n),wa(n,t),n.return=e,n;case g:return t=ai(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=ni(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&&vi(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&&vi(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&&vi(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&&vi(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&&vi(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&&vi(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=ni(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ti(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=ai(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=ri(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=Zr(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=Jr(e),qr(e,null,n),t}return Wr(e,r,t,n),Jr(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,He(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(!dr(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?Ms:Ns,so=!1,a=n(r,i),so=!1,oo&&(a=_o(t,n,r,i)),go(e),a}function go(e){P.H=js;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||qs||(e=e.dependencies,e!==null&&Hi(e)&&(qs=!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=Ps,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?Ms:Ns),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 X(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 Do(e,t){return typeof t==`function`?t(e):t}function Oo(e){return ko(Co(),ro,e)}function ko(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,!dr(o,e.memoizedState)&&(qs=!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 Ao(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);dr(o,t.memoizedState)||(qs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function jo(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=!dr((ro||i).memoizedState,n);if(s&&(i.memoizedState=n,qs=!0),i=i.queue,ns(Po.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},No.bind(null,r,i,n,t),null),Ml===null)throw Error(a(349));o||to&127||Mo(r,t,n)}return n}function Mo(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 No(e,t,n,r){t.value=n,t.getSnapshot=r,Fo(t)&&Io(e)}function Po(e,t,n){return n(function(){Fo(t)&&Io(e)})}function Fo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!dr(e,n)}catch{return!0}}function Io(e){var t=Kr(e,2);t!==null&&fu(t,e,2)}function Lo(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:Do,lastRenderedState:e},t}function Ro(e,t,n,r){return e.baseState=n,ko(e,ro,typeof r==`function`?r:Do)}function zo(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,Bo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Bo(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),Vo(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),Vo(e,t,a)}catch(n){Uo(e,t,n)}}function Vo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ho(e,t,n)},function(n){return Uo(e,t,n)}):Ho(e,t,n)}function Ho(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,Bo(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=Lo(!1),a=Es.bind(null,no,!1,r.queue),r=So(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=zo.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=ko(e,t,Go)[0],e=Oo(Do)[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 dr(n,t)?n:Va.current===null?!(to&42)||to&1073741824&&!(Pl&261930)?(qs=!0,e.memoizedState=n):(e=du(),no.lanes|=e,Hl|=e,t):(e=fs(e,n,r),dr(e,t)||(qs=!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:Do,lastRenderedState:I},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Do,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)?ks(t,n):(n=Gr(e,t,n,r),n!==null&&(fu(n,e,r),As(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))ks(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,dr(s,o))return Wr(e,t,i,0),Ml===null&&Ur(),!1}catch{}if(n=Gr(e,t,i,r),n!==null)return fu(n,e,r),As(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=Gr(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 ks(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 As(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,He(e,n)}}var js={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};js.useEffectEvent=po;var Ms={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=Lo(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=Lo(!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||Mo(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,ts(Po.bind(null,r,o,e),[e]),r.flags|=2048,Zo(9,{destroy:void 0},No.bind(null,r,o,n,t),null),n},useId:function(){var e=So(),t=Ml.identifierPrefix;if(Ci){var n=_i,r=gi;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:X,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)}}},Ns={readContext:Wi,use:Eo,useCallback:us,useContext:Wi,useEffect:ns,useImperativeHandle:cs,useInsertionEffect:as,useLayoutEffect:os,useMemo:ds,useReducer:Oo,useRef:Qo,useState:function(){return Oo(Do)},useDebugValue:ls,useDeferredValue:function(e,t){return ps(Co(),ro.memoizedState,e,t)},useTransition:function(){var e=Oo(Do)[0],t=Co().memoizedState;return[typeof e==`boolean`?e:To(e),t]},useSyncExternalStore:jo,useId:bs,useHostTransitionStatus:ys,useFormState:qo,useActionState:qo,useOptimistic:function(e,t){return Ro(Co(),ro,e,t)},useMemoCache:X,useCacheRefresh:xs};Ns.useEffectEvent=is;var Ps={readContext:Wi,use:Eo,useCallback:us,useContext:Wi,useEffect:ns,useImperativeHandle:cs,useInsertionEffect:as,useLayoutEffect:os,useMemo:ds,useReducer:Ao,useRef:Qo,useState:function(){return Ao(Do)},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=Ao(Do)[0],t=Co().memoizedState;return[typeof e==`boolean`?e:To(e),t]},useSyncExternalStore:jo,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]):Ro(n,ro,e,t)},useMemoCache:X,useCacheRefresh:xs};Ps.useEffectEvent=is;function Z(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 Q={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 Fs(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?!fr(n,r)||!fr(i,a):!0}function Is(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&&Q.enqueueReplaceState(t,t.state,null)}function $(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 Ls(e){zr(e)}function Rs(e){console.error(e)}function zs(e){zr(e)}function Bs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Vs(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 Hs(e,t,n){return n=Ma(n),n.tag=3,n.payload={element:null},n.callback=function(){Bs(e,t)},n}function Us(e){return e=Ma(e),e.tag=3,e}function Ws(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(){Vs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Vs(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 Gs(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(si(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=si(r,n),i=Hs(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(si(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=si(o,n),ql===null?ql=[o]:ql.push(o),Vl!==4&&(Vl=2),t===null)return!0;r=si(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Hs(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=Us(i),Ws(i,e,n,r),Fa(n,i),!1}n=n.return}while(n!==null);return!1}var Ks=Error(a(461)),qs=!1;function Js(e,t,n,r){t.child=e===null?Oa(t,null,n,r):Da(t,e.child,n,r)}function Ys(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&&!qs?(bo(e,t,i),yc(e,t,i)):(Ci&&s&&J(t),t.flags|=1,Js(e,t,r,i),t.child)}function Xs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Qr(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Zs(e,t,a,r,i)):(e=ti(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?fr:n,n(o,r)&&e.ref===t.ref)return yc(e,t,i)}return t.flags|=1,e=$r(a,r),e.ref=t.ref,e.return=t,t.child=e}function Zs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(fr(a,r)&&e.ref===t.ref)if(qs=!1,t.pendingProps=r=a,bc(e,i))e.flags&131072&&(qs=!0);else return t.lanes=e.lanes,yc(e,t,i)}return ac(e,t,n,r,i)}function Qs(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 Js(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:hi===null?null:{id:gi,overflow:_i},retryLane:536870912,hydrationErrors:null},n=ii(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(qs||Vi(e,t,n,!1),i=(n&e.childLanes)!==0,qs||i){if(r=Ml,r!==null&&(s=Ue(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Kr(e,s),fu(r,e,s),Ks;wu(),t=nc(e,t,n)}else e=o.treeContext,Si=cf(s.nextSibling),xi=t,Ci=!0,wi=null,Ti=!1,e!==null&&Y(t,e),t=tc(t,r),t.flags|=4096;return t}return e=$r(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&&!qs?(bo(e,t,i),yc(e,t,i)):(Ci&&r&&J(t),t.flags|=1,Js(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&&!qs?(bo(e,t,a),yc(e,t,a)):(Ci&&r&&J(t),t.flags|=1,Js(e,t,n,a),t.child)}function sc(e,t,n,r,i){if(Ui(t),t.stateNode===null){var a=Yr,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=Q,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):Yr,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Z(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&&Q.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=$(n,s);a.props=c;var l=a.context,u=n.contextType;o=Yr,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)&&Is(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`&&(Z(t,n,d,r),l=t.memoizedState),(c=ka||Fs(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=$(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Yr,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)&&Is(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`&&(Z(t,n,s,r),p=t.memoizedState),(u=ka||Fs(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)):Js(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,Js(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:hi===null?null:{id:gi,overflow:_i},retryLane:536870912,hydrationErrors:null},n=ii(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=ni(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=ni(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(qs||Vi(e,t,n,!1),s=(n&e.childLanes)!==0,qs||s){if(s=Ml,s!==null&&(r=Ue(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Kr(e,r),fu(s,e,r),Ks;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&&Y(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=$r(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ni(c,i,n,null),c.flags|=2):c=$r(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=$r(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=Zr(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),Js(e,t,r,n),r=Ci?fi: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=$r(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=$r(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:K(t,t.stateNode.containerInfo),Li(t,Xi,e.memoizedState.cache),ji();break;case 27:case 5:q(t);break;case 4:K(t,t.stateNode.containerInfo);break;case 10:Li(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,Qs(e,t,n,t.pendingProps);case 24:Li(t,Xi,e.memoizedState.cache)}return yc(e,t,n)}function Sc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)qs=!0;else{if(!bc(e,n)&&!(t.flags&128))return qs=!1,xc(e,t,n);qs=!!(e.flags&131072)}else qs=!1,Ci&&t.flags&1048576&&yi(t,fi,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`)Qr(e)?(r=$(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=Ys(null,t,e,r,n);break a}else if(i===T){t.tag=14,t=Xs(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=$(r,t.pendingProps),sc(e,t,r,i,n);case 3:a:{if(K(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,Li(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=si(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}Js(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[Ye]=t,r[Xe]=e,Pd(r,n,e),ct(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return q(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),Js(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)),q(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),Js(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 K(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Da(t,null,r,n):Js(e,t,r,n),t.child;case 11:return Ys(e,t,t.type,t.pendingProps,n);case 7:return Js(e,t,t.pendingProps,n),t.child;case 8:return Js(e,t,t.pendingProps.children,n),t.child;case 12:return Js(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Li(t,t.type,r.value),Js(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,Js(e,t,r,n),t.child;case 14:return Xs(e,t,t.type,t.pendingProps,n);case 15:return Zs(e,t,t.type,t.pendingProps,n);case 19:return vc(e,t,n);case 31:return rc(e,t,n);case 22:return Qs(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),Li(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,Li(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),Li(t,Xi,r))),Js(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:Le(),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(bi(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),ee(),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(te(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(te(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[Ye]=t,o[Xe]=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[Ye]=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[Ye]=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[Ye]=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[Ye]=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 ee(),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;)ei(n,e),n=n.sibling;return V($a,$a.current&1|2),Ci&&vi(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&&vi(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(bi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ri(Xi),ee(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return te(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 ee(),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(bi(t),t.tag){case 3:Ri(Xi),ee();break;case 26:case 27:case 5:te(t);break;case 4:ee();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=$(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[Xe]=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=Ht));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[Ye]=e,t[Xe]=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=gr(e),_r(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=$(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=$(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&&rt(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[nt]||o[Ye]||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[Ye]=e,ct(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[Ye]=e,ct(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{Pt(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&&(Pt(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?Ke():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)),ze(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:Ht},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(!dr(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&&Ve(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=$r(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,Ur(),n}function bu(e,t){no=null,P.H=js,t===da||t===pa?(t=ya(),Fl=3):t===fa?(t=ya(),Fl=4):Fl=t===Ks?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Il=t,Nl===null&&(Vl=1,Bs(e,si(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=js,e===null?js: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,Ur()),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,Ur(),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=ei(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(Gs(e,i,t,n,Pl)){Vl=1,Bs(e,si(n,e.current)),Nl=null;return}}catch(t){if(i!==null)throw Nl=i,t;Vl=1,Bs(e,si(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|=Hr,Be(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=gr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&hr(s.ownerDocument.documentElement,s)){if(c!==null&&_r(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 _=mr(s,h),v=mr(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),Ge(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=Ge(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=si(n,t),t=Hs(e.stateNode,t,2),e=Na(e,t,2),e!==null&&(ze(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=si(n,e),n=Us(2),r=Na(t,n,2),r!==null&&(Ws(n,r,t,e),ze(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=Le()),e=Kr(e,t),e!==null&&(ze(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 ue(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]=Ie(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),Ge(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=ue(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?ue(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:Vt(``+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[Xe]||null).action),o=r.submitter;o&&(t=(t=o[Xe]||null)?ud(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new un(`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<Lr.length;pd++){var md=Lr[pd];Rr(md.toLowerCase(),`on`+(md[0].toUpperCase()+md.slice(1)))}Rr(kr,`onAnimationEnd`),Rr(Ar,`onAnimationIteration`),Rr(jr,`onAnimationStart`),Rr(`dblclick`,`onDoubleClick`),Rr(`focusin`,`onFocus`),Rr(`focusout`,`onBlur`),Rr(Mr,`onTransitionRun`),Rr(Nr,`onTransitionStart`),Rr(Pr,`onTransitionCancel`),Rr(Fr,`onTransitionEnd`),ft(`onMouseEnter`,[`mouseout`,`mouseover`]),ft(`onMouseLeave`,[`mouseout`,`mouseover`]),ft(`onPointerEnter`,[`pointerout`,`pointerover`]),ft(`onPointerLeave`,[`pointerout`,`pointerover`]),dt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),dt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),dt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),dt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),dt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),dt(`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){zr(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){zr(e)}i.currentTarget=null,a=c}}}}function vd(e,t){var n=t[Qe];n===void 0&&(n=t[Qe]=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,lt.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,!Qt||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=it(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}Yt(function(){var r=a,i=Wt(n),o=[];a:{var c=Ir.get(e);if(c!==void 0){var l=un,u=e;switch(e){case`keypress`:if(an(n)===0)break a;case`keydown`:case`keyup`:l=On;break;case`focusin`:u=`focus`,l=yn;break;case`focusout`:u=`blur`,l=yn;break;case`beforeblur`:case`afterblur`:l=yn;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=_n;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=vn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=An;break;case kr:case Ar:case jr:l=bn;break;case Fr:l=jn;break;case`scroll`:case`scrollend`:l=fn;break;case`wheel`:l=Mn;break;case`copy`:case`cut`:case`paste`:l=xn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=kn;break;case`toggle`:case`beforetoggle`:l=Nn}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=Xt(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!==Ut&&(u=n.relatedTarget||n.fromElement)&&(it(u)||u[Ze]))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?it(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=_n,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=kn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:ot(l),h=u==null?c:ot(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,it(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?ot(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=$n;else if(qn(c))if(er)v=lr;else{v=sr;var y=or}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Rt(r.elementType)&&(v=$n):v=cr;if(v&&=v(e,r)){Jn(o,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&At(c,`number`,c.value)}switch(y=r?ot(r):window,e){case`focusin`:(qn(y)||y.contentEditable===`true`)&&(yr=y,br=r,xr=null);break;case`focusout`:xr=br=yr=null;break;case`mousedown`:Sr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Sr=!1,Cr(o,n,i);break;case`selectionchange`:if(vr)break;case`keydown`:case`keyup`:Cr(o,n,i)}var b;if(Fn)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 Un?Vn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Rn&&n.locale!==`ko`&&(Un||x!==`onCompositionStart`?x===`onCompositionEnd`&&Un&&(b=rn()):(en=i,tn=`value`in en?en.value:en.textContent,Un=!0)),y=Td(r,x),0<y.length&&(x=new Sn(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=Hn(n),b!==null&&(x.data=b)))),(b=Ln?Wn(e,n):Gn(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new Sn(`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=Xt(e,n),i!=null&&r.unshift(wd(e,i,a)),i=Xt(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=Xt(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=Xt(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===``||Pt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Pt(e,``+r);break;case`className`:vt(e,`class`,r);break;case`tabIndex`:vt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:vt(e,n,r);break;case`style`:Lt(e,r,o);break;case`data`:if(t!==`object`){vt(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=Vt(``+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=Vt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Ht);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=Vt(``+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),_t(e,`popover`,r);break;case`xlinkActuate`:yt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:yt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:yt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:yt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:yt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:yt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:_t(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=zt.get(n)||n,_t(e,n,r))}}function Nd(e,t,n,r,i,o){switch(n){case`style`:Lt(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`?Pt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Pt(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=Ht);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!ut.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[Xe]||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,``):_t(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)}}kt(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&&jt(e,!!r,n,!0):jt(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)}Nt(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(Rt(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)}}Ot(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?jt(e,!!n,n?[]:``,!1):jt(e,!!n,t,!0)):jt(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)}Mt(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(Rt(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[nt]||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),rt(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[nt])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]);rt(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=at(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=Dt(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),ct(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="`+Dt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Dt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Dt(n.imageSizes)+`"]`)):i+=`[href="`+Dt(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),ct(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="`+Dt(r)+`"][href="`+Dt(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),ct(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=st(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`);ct(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=st(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`),ct(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=st(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`),ct(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=st(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=st(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=st(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="`+Dt(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),ct(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Dt(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~="`+Dt(n.href)+`"]`);if(r)return t.instance=r,ct(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`),ct(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,ct(o),o;r=Mf(n),(i=mf.get(i))&&Rf(r,i),o=(e.ownerDocument||e).createElement(`link`),ct(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,ct(i),i):(r=n,(i=mf.get(o))&&(r=p({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),ct(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[nt]||a[Ye]||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,ct(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),ct(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=Re(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Re(0),this.hiddenUpdates=Re(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=Zr(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=Yr,e):Yr}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=Kr(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=We(t);var n=Kr(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=at(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=Kr(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=Wt(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=it(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=at(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=it(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,qe(e.priority,function(){op(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,qe(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);Ut=r,n.target.dispatchEvent(r),Ut=null}else return t=at(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=at(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[Xe]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Xe]||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[Ze]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ke();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=Ls,s=Rs,c=zs;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[Ze]=t.current,xd(e),new Fp(t)}})),As=n(((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=ks()})),js=di(`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`}]]),Ms=di(`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`}]]),Ns=di(`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`}]]),Ps=di(`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=a(),Q=e(i(),1),Fs=e(ui(),1),Is=As(),$=o(),Ls=[[`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`}]];di(`bot`,Ls);var Rs=di(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),zs=di(`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`}]]),Bs=di(`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`}]]),Vs=di(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Hs=di(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),Us=di(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Ws=di(`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`}]]),Gs=di(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),Ks=di(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),qs=di(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),Js=di(`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`}]]),Ys=di(`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`}]]),Xs=di(`contrast`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 18a6 6 0 0 0 0-12v12z`,key:`j4l70d`}]]),Zs=di(`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`}]]),Qs=di(`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`}]]),$s=di(`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`}]]),ec=di(`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`}]]),tc=di(`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`}]]),nc=di(`file-text`,[[`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:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),rc=di(`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`}]]),ic=di(`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`}]]),ac=di(`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`}]]),oc=di(`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`}]]),sc=di(`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`}]]),cc=di(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),lc=di(`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`}]]),uc=di(`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`}]]),dc=di(`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`}]]),fc=di(`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`}]]),pc=di(`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`}]]),mc=di(`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`}]]),hc=[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]],gc=di(`link-2`,hc),_c=di(`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`}]]),vc=di(`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`}]]),yc=di(`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`}]]),bc=di(`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`}]]),xc=di(`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`}]]),Sc=di(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),Cc=di(`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`}]]),wc=di(`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`}]]),Tc=di(`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`}]]),Ec=di(`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`}]]),Dc=di(`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`}]]),Oc=di(`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`}]]),kc=di(`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`}]]),Ac=di(`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`}]]),jc=di(`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`}]]),Mc=di(`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`}]]),Nc=di(`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`}]]),Pc=di(`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`}]]),Fc=di(`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`}]]),Ic=di(`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`}]]),Lc=di(`rows-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}]]),Rc=di(`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`}]]),zc=di(`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`}]]),Bc=di(`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`}]]),Vc=di(`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`}]]),Hc=di(`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`}]]),Uc=di(`square-check`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Wc=di(`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`}]]),Gc=di(`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`}]]),Kc=di(`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`}]]),qc=di(`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`}]]),Jc=di(`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`}]]),Yc=di(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Xc=di(`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`}]]),Zc=di(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Qc=di(`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`}]]),$c=di(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),el=di(`underline`,[[`path`,{d:`M6 4v6a6 6 0 0 0 12 0V4`,key:`9kb039`}],[`line`,{x1:`4`,x2:`20`,y1:`20`,y2:`20`,key:`nun2al`}]]),tl=di(`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`}]]),nl=di(`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`}]]),rl=di(`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`}]]),il=di(`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 al(){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(ol),()=>{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 ol(e){console.warn(`[use-update-channel] bridge.state.query() failed`,e)}function sl(e,t){return e instanceof Error&&e.message?e.message:t}async function cl(e,t,n,r=`action`){try{n(null),await e()}catch(e){console.error(`[${r}] action failed:`,e),n(sl(e,t))}}async function ll(e,t,n=X,r=`action`){await cl(e,t,e=>{e!==null&&n.error(e)},r)}function ul(e){let t=/\/([^/]+?)(?:\.git)?\/?$/.exec(e);return t?t[1]:`repo`}function dl(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=ul(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 fl(e){try{let t=await e.json(),n=An.safeParse(t);if(n.success)return n.data.title}catch{}}async function pl(e,t){return fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t??{})})}function ml(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 hl(){return{async status(e){let t=e?.host??`github.com`,n=await pl(`/api/local-op/auth/status`,e);if(!n.ok)return{authenticated:!1,host:t,error:await fl(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 pl(`/api/local-op/auth/repos`,e);if(!n.ok)return{ok:!1,error:await fl(n)??`Failed to fetch repositories`};let r=ml(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 gl(e){return{status:t=>e.localOp.authStatus(t),repos:t=>e.localOp.authRepos(t)}}async function _l(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 vl(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 yl(){return{start(){return vl((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=An.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 _l(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 bl(e){return{start(){return e.localOp.auth.start()}}}function xl(){return{start(e){return vl((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=An.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 Sl(e){return{start(t){return e.localOp.clone.start(t)}}}var Cl=`ContextMenu`,[wl,Tl]=hi(Cl,[eo]),El=eo(),[Dl,Ol]=wl(Cl),kl=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:a=!0}=e,[o,s]=Q.useState(!1),c=El(t),l=fi(r),u=Q.useCallback(e=>{s(e),l(e)},[l]);return(0,Z.jsx)(Dl,{scope:t,open:o,onOpenChange:u,modal:a,children:(0,Z.jsx)(io,{...c,dir:i,open:o,onOpenChange:u,modal:a,children:n})})};kl.displayName=Cl;var Al=`ContextMenuTrigger`,jl=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,disabled:r=!1,...i}=e,a=Ol(Al,n),o=El(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)(Sa,{...o,virtualRef:c}),(0,Z.jsx)(vi.span,{"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,...i,ref:t,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:r?e.onContextMenu:bi(e.onContextMenu,e=>{u(),d(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:bi(e.onPointerDown,ou(e=>{u(),l.current=window.setTimeout(()=>d(e),700)})),onPointerMove:r?e.onPointerMove:bi(e.onPointerMove,ou(u)),onPointerCancel:r?e.onPointerCancel:bi(e.onPointerCancel,ou(u)),onPointerUp:r?e.onPointerUp:bi(e.onPointerUp,ou(u))})]})});jl.displayName=Al;var Ml=`ContextMenuPortal`,Nl=e=>{let{__scopeContextMenu:t,...n}=e,r=El(t);return(0,Z.jsx)(Da,{...r,...n})};Nl.displayName=Ml;var Pl=`ContextMenuContent`,Fl=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Ol(Pl,n),a=El(n),o=Q.useRef(!1);return(0,Z.jsx)(Ca,{...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)`}})});Fl.displayName=Pl;var Il=`ContextMenuGroup`,Ll=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=El(n);return(0,Z.jsx)(Ta,{...i,...r,ref:t})});Ll.displayName=Il;var Rl=`ContextMenuLabel`,zl=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=El(n);return(0,Z.jsx)(ka,{...i,...r,ref:t})});zl.displayName=Rl;var Bl=`ContextMenuItem`,Vl=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=El(n);return(0,Z.jsx)(Ha,{...i,...r,ref:t})});Vl.displayName=Bl;var Hl=`ContextMenuCheckboxItem`,Ul=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=El(n);return(0,Z.jsx)(Xa,{...i,...r,ref:t})});Ul.displayName=Hl;var Wl=`ContextMenuRadioGroup`,Gl=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=El(n);return(0,Z.jsx)(_a,{...i,...r,ref:t})});Gl.displayName=Wl;var Kl=`ContextMenuRadioItem`,ql=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=El(n);return(0,Z.jsx)(Qa,{...i,...r,ref:t})});ql.displayName=Kl;var Jl=`ContextMenuItemIndicator`,Yl=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=El(n);return(0,Z.jsx)(La,{...i,...r,ref:t})});Yl.displayName=Jl;var Xl=`ContextMenuSeparator`,Zl=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=El(n);return(0,Z.jsx)(xa,{...i,...r,ref:t})});Zl.displayName=Xl;var Ql=`ContextMenuArrow`,$l=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=El(n);return(0,Z.jsx)(Fa,{...i,...r,ref:t})});$l.displayName=Ql;var eu=`ContextMenuSub`,tu=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:a}=e,o=El(t),[s,c]=mi({prop:i,defaultProp:a??!1,onChange:r,caller:eu});return(0,Z.jsx)(no,{...o,open:s,onOpenChange:c,children:n})};tu.displayName=eu;var nu=`ContextMenuSubTrigger`,ru=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=El(n);return(0,Z.jsx)(Vi,{...i,...r,ref:t})});ru.displayName=nu;var iu=`ContextMenuSubContent`,au=Q.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=El(n);return(0,Z.jsx)(sa,{...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)`}})});au.displayName=iu;function ou(e){return t=>t.pointerType===`mouse`?void 0:e(t)}var su=kl,cu=jl,lu=Nl,uu=Fl,du=Vl,fu=Ul,pu=Yl,mu=Zl,hu=tu,gu=ru,_u=au,vu=`Radio`,[yu,bu]=hi(vu),[xu,Su]=yu(vu),Cu=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=xi(t,e=>f(e)),m=Q.useRef(!1),h=d?l||!!d.closest(`form`):!0;return(0,Z.jsxs)(xu,{scope:n,checked:i,disabled:o,children:[(0,Z.jsx)(vi.button,{type:`button`,role:`radio`,"aria-checked":i,"data-state":Ou(i),"data-disabled":o?``:void 0,disabled:o,value:s,...u,ref:p,onClick:bi(e.onClick,e=>{i||c?.(),h&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})}),h&&(0,Z.jsx)(Du,{control:d,bubbles:!m.current,name:r,value:s,checked:i,required:a,disabled:o,form:l,style:{transform:`translateX(-100%)`}})]})});Cu.displayName=vu;var wu=`RadioIndicator`,Tu=Q.forwardRef((e,t)=>{let{__scopeRadio:n,forceMount:r,...i}=e,a=Su(wu,n);return(0,Z.jsx)(yi,{present:r||a.checked,children:(0,Z.jsx)(vi.span,{"data-state":Ou(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})})});Tu.displayName=wu;var Eu=`RadioBubbleInput`,Du=Q.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=Q.useRef(null),s=xi(o,a),c=uo(n),l=Do(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)(vi.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}})});Du.displayName=Eu;function Ou(e){return e?`checked`:`unchecked`}var ku=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Au=`RadioGroup`,[ju,Mu]=hi(Au,[Po,bu]),Nu=Po(),Pu=bu(),[Fu,Iu]=ju(Au),Lu=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=Nu(n),m=Qn(l),[h,g]=mi({prop:a,defaultProp:i??null,onChange:d,caller:Au});return(0,Z.jsx)(Fu,{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)(vi.div,{role:`radiogroup`,"aria-required":o,"aria-orientation":c,"data-disabled":s?``:void 0,dir:m,...f,ref:t})})})});Lu.displayName=Au;var Ru=`RadioGroupItem`,zu=Q.forwardRef((e,t)=>{let{__scopeRadioGroup:n,disabled:r,...i}=e,a=Iu(Ru,n),o=a.disabled||r,s=Nu(n),c=Pu(n),l=Q.useRef(null),u=xi(t,l),d=a.value===i.value,f=Q.useRef(!1);return Q.useEffect(()=>{let e=e=>{ku.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)(Mo,{asChild:!0,...s,focusable:!o,active:d,children:(0,Z.jsx)(Cu,{disabled:o,required:a.required,checked:d,...c,...i,name:a.name,ref:u,onCheck:()=>a.onValueChange(i.value),onKeyDown:bi(e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:bi(i.onFocus,()=>{f.current&&l.current?.click()})})})});zu.displayName=Ru;var Bu=`RadioGroupIndicator`,Vu=Q.forwardRef((e,t)=>{let{__scopeRadioGroup:n,...r}=e;return(0,Z.jsx)(Tu,{...Pu(n),...r,ref:t})});Vu.displayName=Bu;var Hu=Lu,Uu=zu,Wu=Vu;async function Gu(e){try{await navigator.clipboard.writeText(e)}catch{}}var Ku=120*1e3;function qu(e){let t=(0,$.c)(26),{onSuccess:n,onCancel:r,transport:i}=e,[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(`https://github.com/login/device`),[l,u]=(0,Q.useState)(!1),[d,f]=(0,Q.useState)(null),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(Ku),_=(0,Q.useRef)(null),v=(0,Q.useRef)(null),y;t[0]!==n||t[1]!==i?(y=async function(){f(null),m(!0);try{let e=i.start();_.current=e.cancel;let t=e.events[Symbol.asyncIterator](),r=!1,a=await t.next();for(;!a.done;){let e=a.value;if(e.type===`verification`)o(e.user_code),c(e.verification_uri),g(e.expires_in*1e3),Gu(e.user_code).then(()=>{u(!0),setTimeout(()=>u(!1),2e3)});else if(e.type===`complete`){r=!0,m(!1),n({login:e.login,name:e.name,email:e.email,avatarUrl:e.avatarUrl});break}else if(e.type===`error`){r=!0,f(e.message),m(!1);break}a=await t.next()}r||(f(`Sign-in stream ended without confirmation — please try again`),m(!1))}catch(e){let t=e;t instanceof Error&&t.name!==`AbortError`&&f(`Connection error — try again`),m(!1)}},t[0]=n,t[1]=i,t[2]=y):y=t[2];let b=y,x;t[3]===b?x=t[4]:(x=()=>{let e=!1;return queueMicrotask(()=>{e||b()}),()=>{e=!0,_.current?.(),_.current=null,v.current&&clearInterval(v.current)}},t[3]=b,t[4]=x);let S;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(S=[],t[5]=S):S=t[5],(0,Q.useEffect)(x,S);let C,w;t[6]===a?(C=t[7],w=t[8]):(C=()=>{if(!a)return;let e=Date.now();return v.current=setInterval(()=>{let t=Ku-(Date.now()-e);t<=0?(g(0),v.current&&clearInterval(v.current),f(`Code expired — please try again`)):g(t)},1e3),()=>{v.current&&clearInterval(v.current)}},w=[a],t[6]=a,t[7]=C,t[8]=w),(0,Q.useEffect)(C,w);let T=Math.floor(h/6e4),E=Math.floor(h%6e4/1e3),D;t[9]===E?D=t[10]:(D=E.toString().padStart(2,`0`),t[9]=E,t[10]=D);let O=`${T}:${D}`,k;t[11]!==l||t[12]!==d||t[13]!==O||t[14]!==a||t[15]!==s?(k=a?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Open`,` `,(0,Z.jsx)(`a`,{href:s,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>la(e,s),onAuxClick:e=>la(e,s),className:`underline underline-offset-2`,children:s}),` `,`and enter this code:`]}),(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:a}),(0,Z.jsx)(J,{variant:`outline`,size:`sm`,onClick:()=>void Gu(a).then(()=>{u(!0),setTimeout(()=>u(!1),2e3)}),children:l?`Copied!`:`Copy`})]}),(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`}),`Waiting for authorization`]}),(0,Z.jsxs)(`span`,{children:[`Expires in `,O]})]})]}):(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-6 text-sm text-muted-foreground`,children:d?null:`Starting sign-in flow`}),t[11]=l,t[12]=d,t[13]=O,t[14]=a,t[15]=s,t[16]=k):k=t[16];let A;t[17]===d?A=t[18]:(A=d&&(0,Z.jsx)(`p`,{className:`text-sm text-destructive`,children:d}),t[17]=d,t[18]=A);let j;t[19]!==r||t[20]!==p?(j=p&&(0,Z.jsx)(J,{variant:`ghost`,size:`sm`,onClick:r,children:`Cancel`}),t[19]=r,t[20]=p,t[21]=j):j=t[21];let M;return t[22]!==k||t[23]!==A||t[24]!==j?(M=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[k,A,j]}),t[22]=k,t[23]=A,t[24]=j,t[25]=M):M=t[25],M}function Ju(e){let t=(0,$.c)(32),{onSuccess:n,onCancel:r}=e,[i,a]=(0,Q.useState)(``),[o,s]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(null),u=(0,Q.useRef)(null),d,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>()=>{u.current?.abort()},f=[],t[0]=d,t[1]=f):(d=t[0],f=t[1]),(0,Q.useEffect)(d,f);let p;t[2]!==n||t[3]!==i?(p=async function(){if(!i.trim()){l(`Paste a personal access token`);return}u.current?.abort();let e=new AbortController;u.current=e,s(!0),l(null);try{let t=await fetch(`/api/local-op/auth/pat`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({pat:i.trim()}),signal:e.signal});if(!t.ok){let e=`Invalid token — check that it has repo scope`;try{let n=await t.json(),r=An.safeParse(n);r.success&&(e=r.data.title)}catch{}l(e),s(!1);return}if(!t.body){l(`Invalid token — check that it has repo scope`),s(!1);return}await _l(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}),s(!1),`terminal`):`continue`})||l(`No response — try again`)}catch(e){let t=e;t instanceof Error&&t.name!==`AbortError`&&l(`Connection error — try again`)}s(!1)},t[2]=n,t[3]=i,t[4]=p):p=t[4];let m=p,h;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(`a`,{href:`https://github.com/settings/tokens`,target:`_blank`,rel:`noopener noreferrer`,onClick:Xu,onAuxClick:Yu,className:`underline underline-offset-2`,children:`github.com/settings/tokens`}),t[5]=h):h=t[5];let g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Create a token at`,` `,h,` `,`with `,(0,Z.jsx)(`code`,{className:`text-xs bg-muted px-1 rounded`,children:`repo`}),` scope.`]}),t[6]=g):g=t[6];let _;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>a(e.target.value),t[7]=_):_=t[7];let v;t[8]===m?v=t[9]:(v=e=>{e.key===`Enter`&&m()},t[8]=m,t[9]=v);let y;t[10]!==o||t[11]!==i||t[12]!==v?(y=(0,Z.jsx)(Ho,{type:`password`,"aria-label":`Personal access token`,placeholder:`ghp_…`,value:i,onChange:_,disabled:o,onKeyDown:v}),t[10]=o,t[11]=i,t[12]=v,t[13]=y):y=t[13];let b;t[14]===c?b=t[15]:(b=c&&(0,Z.jsx)(`p`,{className:`text-sm text-destructive`,children:c}),t[14]=c,t[15]=b);let x;t[16]===m?x=t[17]:(x=()=>void m(),t[16]=m,t[17]=x);let S=o?`Validating`:`Add token`,C;t[18]!==o||t[19]!==x||t[20]!==S?(C=(0,Z.jsx)(J,{className:`flex-1`,onClick:x,disabled:o,children:S}),t[18]=o,t[19]=x,t[20]=S,t[21]=C):C=t[21];let w;t[22]!==o||t[23]!==r?(w=(0,Z.jsx)(J,{variant:`ghost`,onClick:r,disabled:o,children:`Cancel`}),t[22]=o,t[23]=r,t[24]=w):w=t[24];let T;t[25]!==C||t[26]!==w?(T=(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[C,w]}),t[25]=C,t[26]=w,t[27]=T):T=t[27];let E;return t[28]!==T||t[29]!==y||t[30]!==b?(E=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[g,y,b,T]}),t[28]=T,t[29]=y,t[30]=b,t[31]=E):E=t[31],E}function Yu(e){return la(e,`https://github.com/settings/tokens`)}function Xu(e){return la(e,`https://github.com/settings/tokens`)}function Zu(e){let t=(0,$.c)(27),{login:n,onSave:r,onSkip:i}=e,[a,o]=(0,Q.useState)(``),[s,c]=(0,Q.useState)(``),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Before syncing, set your identity for git commits:`}),t[0]=l):l=t[0];let u=`Name (e.g. ${n})`,d;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>o(e.target.value),t[1]=d):d=t[1];let f;t[2]!==a||t[3]!==u?(f=(0,Z.jsx)(Ho,{"aria-label":`Name`,placeholder:u,value:a,onChange:d}),t[2]=a,t[3]=u,t[4]=f):f=t[4];let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>c(e.target.value),t[5]=p):p=t[5];let m;t[6]===s?m=t[7]:(m=(0,Z.jsx)(Ho,{type:`email`,"aria-label":`Email`,placeholder:`Email`,value:s,onChange:p}),t[6]=s,t[7]=m);let h;t[8]!==s||t[9]!==a||t[10]!==r?(h=()=>r(a.trim(),s.trim()),t[8]=s,t[9]=a,t[10]=r,t[11]=h):h=t[11];let g;t[12]!==s||t[13]!==a?(g=!a.trim()||!s.trim(),t[12]=s,t[13]=a,t[14]=g):g=t[14];let _;t[15]!==h||t[16]!==g?(_=(0,Z.jsx)(J,{className:`flex-1`,onClick:h,disabled:g,children:`Save`}),t[15]=h,t[16]=g,t[17]=_):_=t[17];let v;t[18]===i?v=t[19]:(v=(0,Z.jsx)(J,{variant:`ghost`,onClick:i,children:`Skip`}),t[18]=i,t[19]=v);let y;t[20]!==v||t[21]!==_?(y=(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[_,v]}),t[20]=v,t[21]=_,t[22]=y):y=t[22];let b;return t[23]!==y||t[24]!==f||t[25]!==m?(b=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[l,f,m,y]}),t[23]=y,t[24]=f,t[25]=m,t[26]=b):b=t[26],b}function Qu(e){let t=(0,$.c)(42),{open:n,onOpenChange:r,onSuccess:i,identityPrompt:a,reauth:o,transport:s}=e,c;t[0]===s?c=t[1]:(c=s??yl(),t[0]=s,t[1]=c);let l=c,[u,d]=(0,Q.useState)(`device`),[f,p]=(0,Q.useState)(`auth`),[m,h]=(0,Q.useState)(null),g,_;t[2]===n?(g=t[3],_=t[4]):(g=()=>{n&&(d(`device`),p(`auth`),h(null))},_=[n],t[2]=n,t[3]=g,t[4]=_),(0,Q.useEffect)(g,_);let v;t[5]!==a||t[6]!==r||t[7]!==i?(v=function(e){h(e),a&&(!e.name||!e.email)?p(`identity`):(p(`done`),i?.(e),r(!1),X.success(`Signed in as @${e.login}`))},t[5]=a,t[6]=r,t[7]=i,t[8]=v):v=t[8];let y=v,b;t[9]!==m||t[10]!==r||t[11]!==i?(b=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($u);let n={...m??{login:``},name:e,email:t};p(`done`),i?.(n),r(!1),X.success(`Signed in as @${n.login}`)},t[9]=m,t[10]=r,t[11]=i,t[12]=b):b=t[12];let x=b,S;t[13]!==m||t[14]!==r||t[15]!==i?(S=function(){m&&(p(`done`),i?.(m),r(!1),X.success(`Signed in as @${m.login}`))},t[13]=m,t[14]=r,t[15]=i,t[16]=S):S=t[16];let C=S,w;t[17]===r?w=t[18]:(w=function(){r(!1)},t[17]=r,t[18]=w);let T=w,E=o?`Re-authenticate with GitHub`:`Sign in to GitHub`,D;t[19]===E?D=t[20]:(D=(0,Z.jsx)(wo,{children:(0,Z.jsx)(ho,{children:E})}),t[19]=E,t[20]=D);let O;t[21]!==y||t[22]!==T||t[23]!==l||t[24]!==f||t[25]!==u?(O=f===`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)(J,{variant:u===`device`?`secondary`:`ghost`,size:`sm`,onClick:()=>d(`device`),children:`GitHub App`}),(0,Z.jsx)(J,{variant:u===`pat`?`secondary`:`ghost`,size:`sm`,onClick:()=>d(`pat`),children:`Token`})]}),u===`device`?(0,Z.jsx)(qu,{onSuccess:y,onCancel:T,transport:l}):(0,Z.jsx)(Ju,{onSuccess:y,onCancel:T})]}),t[21]=y,t[22]=T,t[23]=l,t[24]=f,t[25]=u,t[26]=O):O=t[26];let k;t[27]!==m||t[28]!==x||t[29]!==C||t[30]!==f?(k=f===`identity`&&m&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`text-sm font-medium`,children:[`Signed in as @`,m.login]}),(0,Z.jsx)(Zu,{login:m.login,onSave:x,onSkip:C})]}),t[27]=m,t[28]=x,t[29]=C,t[30]=f,t[31]=k):k=t[31];let A;t[32]!==k||t[33]!==O?(A=(0,Z.jsxs)(xo,{children:[O,k]}),t[32]=k,t[33]=O,t[34]=A):A=t[34];let j;t[35]!==A||t[36]!==D?(j=(0,Z.jsxs)(vo,{className:`sm:max-w-md`,children:[D,A]}),t[35]=A,t[36]=D,t[37]=j):j=t[37];let M;return t[38]!==r||t[39]!==n||t[40]!==j?(M=(0,Z.jsx)(To,{open:n,onOpenChange:r,children:j}),t[38]=r,t[39]=n,t[40]=j,t[41]=M):M=t[41],M}function $u(){}function ed(e){let t=(0,$.c)(2),{className:n}=e,{channel:r}=al();if(r!==`beta`)return null;let i;return t[0]===n?i=t[1]:(i=(0,Z.jsx)(je,{variant:`secondary`,"aria-label":`Beta channel`,"data-testid":`beta-badge`,className:n,children:`BETA`}),t[0]=n,t[1]=i),i}function td(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 nd(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 rd(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??xl(),t[0]=o,t[1]=u);let d=u,f;t[2]===s?f=t[3]:(f=s??hl(),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=nd(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=nd(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=nd(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(`${td(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 K=G,ee,q,te,ne,re,ie,ae,oe,se,ce;if(t[37]!==D||t[38]!==K||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()));te=To,se=n,ce=K,q=vo,ae=`sm:max-w-lg`,t[57]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,Z.jsx)(wo,{children:(0,Z.jsx)(ho,{children:`Clone from GitHub`})}),t[57]=oe):oe=t[57],ee=xo,ne=`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?(re=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[r,(0,Z.jsx)(Ho,{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]=re):re=t[64],ie=T&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Z.jsx)(`label`,{htmlFor:`repo-filter`,className:`text-sm font-medium`,children:`Your repositories`}),(0,Z.jsx)(Ho,{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)(Ka,{className:`h-4 w-2/3`}),(0,Z.jsx)(Ka,{className:`h-4 w-1/2`}),(0,Z.jsx)(Ka,{className:`h-4 w-3/4`}),(0,Z.jsx)(Ka,{className:`h-4 w-2/5`}),(0,Z.jsx)(Ka,{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]=K,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]=ee,t[48]=q,t[49]=te,t[50]=ne,t[51]=re,t[52]=ie,t[53]=ae,t[54]=oe,t[55]=se,t[56]=ce}else ee=t[47],q=t[48],te=t[49],ne=t[50],re=t[51],ie=t[52],ae=t[53],oe=t[54],se=t[55],ce=t[56];let le;t[65]!==D||t[66]!==T||t[67]!==i?(le=!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)(J,{variant:`link`,size:`sm`,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]=le):le=t[68];let ue;t[69]!==D||t[70]!==_||t[71]!==m?(ue=!m&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Z.jsx)(`label`,{htmlFor:`clone-path`,className:`text-sm font-medium`,children:`Local path`}),(0,Z.jsx)(Ho,{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]=ue):ue=t[72];let de;t[73]!==ne||t[74]!==re||t[75]!==ie||t[76]!==le||t[77]!==ue?(de=(0,Z.jsxs)(`div`,{className:ne,children:[re,ie,le,ue]}),t[73]=ne,t[74]=re,t[75]=ie,t[76]=le,t[77]=ue,t[78]=de):de=t[78];let fe;t[79]!==ee||t[80]!==de?(fe=(0,Z.jsx)(ee,{children:de}),t[79]=ee,t[80]=de,t[81]=fe):fe=t[81];let pe;t[82]!==D||t[83]!==H||t[84]!==K||t[85]!==h||t[86]!==m?(pe=(0,Z.jsx)(So,{children:D?(0,Z.jsx)(J,{variant:`outline`,className:`font-mono uppercase`,onClick:W,children:`Cancel`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(J,{variant:`outline`,className:`font-mono uppercase`,onClick:()=>K(!1),children:`Cancel`}),(0,Z.jsx)(J,{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]=K,t[85]=h,t[86]=m,t[87]=pe):pe=t[87];let me;t[88]!==q||t[89]!==ae||t[90]!==oe||t[91]!==fe||t[92]!==pe?(me=(0,Z.jsxs)(q,{className:ae,children:[oe,fe,pe]}),t[88]=q,t[89]=ae,t[90]=oe,t[91]=fe,t[92]=pe,t[93]=me):me=t[93];let he;return t[94]!==te||t[95]!==se||t[96]!==ce||t[97]!==me?(he=(0,Z.jsx)(te,{open:se,onOpenChange:ce,children:me}),t[94]=te,t[95]=se,t[96]=ce,t[97]=me,t[98]=he):he=t[98],he}var id=(0,Q.lazy)(()=>r(()=>import(`./ConsentDialogBody-DmBVz-Q3.js`),__vite__mapDeps([5,1,6,7,8,9,10,11]),import.meta.url));function ad(){let e=(0,$.c)(1);if(!(0,Q.useSyncExternalStore)(Go.subscribe,sd,od))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)(id,{})}),e[0]=t):t=e[0],t}function od(){return!1}function sd(){return Go.getSnapshot()!==null}var cd=180,ld=5e3;function ud(e,t){if(e===``||t===``)return``;let n=e.includes(`\\`)&&!e.includes(`/`)?`\\`:`/`;return`${e.replace(/[/\\]+$/,``)}${n}${t}`}function dd(e){if(e===``)return``;let t=e.split(/[/\\]/).filter(Boolean);return t.length>0?t[t.length-1]??e:e}function fd(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 pd(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 md(e){let t=e instanceof Error?e.message:String(e);for(let e of _r)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 hd(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 gd(e){let t=(0,$.c)(125),{open:n,onOpenChange:r,bridge:i}=e,[a,o]=(0,Q.useState)(``),[s,c]=(0,Q.useState)(``),[l,u]=(0,Q.useState)(Cd),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d={kind:`idle`},t[0]=d):d=t[0];let[f,p]=(0,Q.useState)(d),[m,h]=(0,Q.useState)(`idle`),[g,_]=(0,Q.useState)(!1),[v,y]=(0,Q.useState)(null),b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(b={kind:`idle`},t[1]=b):b=t[1];let[x,S]=(0,Q.useState)(b),[C,w]=(0,Q.useState)(0),T;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(T=new Set,t[2]=T):T=t[2];let E=(0,Q.useRef)(T),D=(0,Q.useRef)(null),O=(0,Q.useRef)(null),k=(0,Q.useRef)(null),A=(0,Q.useRef)(0),j,M;t[3]!==i||t[4]!==n?(j=()=>{if(!n)return;E.current.clear(),y(null),p({kind:`idle`}),h(`idle`),_(!1),o(``),u(new Set(Gr)),S({kind:`idle`}),A.current+=1;let e=!1;c(``),i.fs.defaultProjectsRoot().then(t=>{e||c(t)}).catch(Sd);let t=requestAnimationFrame(()=>{k.current?.focus()});return()=>{e=!0,cancelAnimationFrame(t)}},M=[n,i],t[3]=i,t[4]=n,t[5]=j,t[6]=M):(j=t[5],M=t[6]),(0,Q.useEffect)(j,M);let N;t[7]!==i||t[8]!==n||t[9]!==a?(N=()=>{if(!n)return;if(O.current!==null&&clearTimeout(O.current),D.current!==null&&D.current.abort(),a===``){p({kind:`idle`}),h(`idle`);return}let e=fd(a),t=Qr(dd(a));if(e===``||t===``){p({kind:`idle`}),h(`idle`);return}let r=ud(e,t);h(`in-flight`);let o=new AbortController;return D.current=o,O.current=setTimeout(()=>{Promise.all([i.fs.findEnclosingProjectRoot(e),i.fs.findEnclosingGitRoot(e),i.fs.folderState(r)]).then(n=>{let[r,i,a]=n;o.signal.aborted||(h(`idle`),p(pd({parent:e,sanitizedName:t,enclosingProject:r,enclosingGit:i,targetState:a})))}).catch(e=>{o.signal.aborted||(console.warn(`[CreateProjectDialog] cascade probe failed:`,e),h(`idle`),p({kind:`free`}))})},cd),()=>{O.current!==null&&clearTimeout(O.current),o.abort()}},t[7]=i,t[8]=n,t[9]=a,t[10]=N):N=t[10];let P;t[11]!==i||t[12]!==n||t[13]!==a||t[14]!==C?(P=[n,a,i,C],t[11]=i,t[12]=n,t[13]=a,t[14]=C,t[15]=P):P=t[15],(0,Q.useEffect)(N,P);let F,I;t[16]===n?(F=t[17],I=t[18]):(F=()=>{if(!n)return;let e=()=>w(xd);return window.addEventListener(`focus`,e),()=>window.removeEventListener(`focus`,e)},I=[n],t[16]=n,t[17]=F,t[18]=I),(0,Q.useEffect)(F,I);let L=(0,Q.useRef)(`idle`),R,z;t[19]===m?(R=t[20],z=t[21]):(R=()=>{L.current=m},z=[m],t[19]=m,t[20]=R,t[21]=z),(0,Q.useEffect)(R,z);let B,V;t[22]!==f.kind||t[23]!==n?(B=()=>{if(!n||f.kind!==`confirm-git`)return;let e=setInterval(()=>{L.current!==`in-flight`&&w(bd)},ld);return()=>clearInterval(e)},V=[n,f.kind],t[22]=f.kind,t[23]=n,t[24]=B,t[25]=V):(B=t[24],V=t[25]),(0,Q.useEffect)(B,V);let H;t[26]!==f.gitRoot||t[27]!==f.kind||t[28]!==x.gitRoot||t[29]!==x.kind?(H=()=>{if(f.kind!==`confirm-git`){x.kind!==`idle`&&(A.current+=1,S({kind:`idle`}));return}x.kind===`confirming`&&x.gitRoot!==f.gitRoot&&S({kind:`idle`}),x.kind===`pending`&&x.gitRoot!==f.gitRoot&&(A.current+=1,S({kind:`idle`}))},t[26]=f.gitRoot,t[27]=f.kind,t[28]=x.gitRoot,t[29]=x.kind,t[30]=H):H=t[30];let U;t[31]!==f||t[32]!==x?(U=[f,x],t[31]=f,t[32]=x,t[33]=U):U=t[33],(0,Q.useEffect)(H,U);let W;t[34]!==i||t[35]!==f.kind||t[36]!==n?(W=()=>{if(!n)return;let e=null;f.kind===`block-nested`?e=`nested`:f.kind===`block-nonempty`?e=`nonempty`:f.kind===`confirm-git`&&(e=`git-confirm`),e!==null&&(E.current.has(e)||(E.current.add(e),i.project.recordCreateNewBannerShown(e).catch(yd)))},t[34]=i,t[35]=f.kind,t[36]=n,t[37]=W):W=t[37];let G;t[38]!==i||t[39]!==f||t[40]!==n?(G=[n,f,i],t[38]=i,t[39]=f,t[40]=n,t[41]=G):G=t[41],(0,Q.useEffect)(W,G);let K,ee;t[42]===a?(K=t[43],ee=t[44]):(K=a===``?``:dd(a),ee=a===``?``:Qr(K),t[42]=a,t[43]=K,t[44]=ee);let q=ee,te=a!==``&&q!==K&&q!==``,ne=a!==``&&K!==``&&q===``,re=a,ie=!g&&a!==``&&q!==``&&m===`idle`&&(f.kind===`free`||f.kind===`confirm-git`),ae;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(ae=function(e){u(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[45]=ae):ae=t[45];let oe=ae,se;t[46]!==i||t[47]!==s?(se=async function(){try{let e=await i.dialog.openFolder(s===``?void 0:{defaultPath:s});if(e===null)return;o(e),w(vd),y(null)}catch(e){console.warn(`[CreateProjectDialog] dialog.openFolder failed:`,e)}},t[46]=i,t[47]=s,t[48]=se):se=t[48];let ce=se,le;t[49]!==i||t[50]!==ie||t[51]!==l||t[52]!==r||t[53]!==a||t[54]!==q?(le=async function(e){if(e.preventDefault(),ie){_(!0),y(null);try{await i.project.createNew({parent:fd(a),name:q,editors:Array.from(l)}),r(!1)}catch(e){y(md(e)),_(!1)}}},t[49]=i,t[50]=ie,t[51]=l,t[52]=r,t[53]=a,t[54]=q,t[55]=le):le=t[55];let ue=le,de;t[56]!==g||t[57]!==r?(de=function(e){g||r(e)},t[56]=g,t[57]=r,t[58]=de):de=t[58];let fe=de,pe;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(pe=async function(e){S({kind:`confirming`,gitRoot:e})},t[59]=pe):pe=t[59];let me=pe,he;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(he=async function(){S({kind:`idle`})},t[60]=he):he=t[60];let ge=he,_e;t[61]===i?_e=t[62]:(_e=async function(e){let t=A.current+1;A.current=t,S({kind:`pending`,gitRoot:e});try{if(await i.fs.removeGitFolder(e),A.current!==t)return;w(_d),S({kind:`idle`})}catch(e){let n=e;if(A.current!==t)return;let r=n instanceof Error?n.message:String(n);console.error(`[CreateProjectDialog] bridge.fs.removeGitFolder failed:`,n),S({kind:`error`,message:r})}},t[61]=i,t[62]=_e);let ve=_e,ye;t[63]!==i||t[64]!==r?(ye=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[63]=i,t[64]=r,t[65]=ye):ye=t[65];let be=ye,xe;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,Z.jsxs)(wo,{children:[(0,Z.jsx)(ho,{children:`Create new project`}),(0,Z.jsx)(po,{children:`Make a new folder for a brand-new Open Knowledge project.`})]}),t[66]=xe):xe=t[66];let Se;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,Z.jsx)(Lo,{htmlFor:`create-location`,className:`block`,children:`Location`}),t[67]=Se):Se=t[67];let Ce;t[68]===ce?Ce=t[69]:(Ce=()=>void ce(),t[68]=ce,t[69]=Ce);let we;t[70]!==g||t[71]!==Ce?(we=(0,Z.jsx)(`div`,{className:`flex items-stretch gap-2`,children:(0,Z.jsx)(J,{id:`create-location`,ref:k,type:`button`,variant:`outline`,disabled:g,onClick:Ce,"aria-describedby":`create-target-caption`,"data-testid":`create-browse`,children:`Browse`})}),t[70]=g,t[71]=Ce,t[72]=we):we=t[72];let Te=re===``?`Click Browse to pick or create a project folder.`:re,Ee;t[73]===Te?Ee=t[74]:(Ee=(0,Z.jsx)(`p`,{id:`create-target-caption`,className:`text-xs text-muted-foreground`,"aria-live":`polite`,"data-testid":`create-target-caption`,children:Te}),t[73]=Te,t[74]=Ee);let De;t[75]!==we||t[76]!==Ee?(De=(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[Se,we,Ee]}),t[75]=we,t[76]=Ee,t[77]=De):De=t[77];let Oe;t[78]!==K||t[79]!==te||t[80]!==q?(Oe=te?(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:[`The folder name `,(0,Z.jsx)(`code`,{className:`font-mono break-all`,children:K}),` contains characters that aren't safe for the project's on-disk identifier. The project will be created as `,(0,Z.jsx)(`code`,{className:`font-mono break-all`,children:q}),`. Click Browse again to pick a folder with a safer name.`]}):null,t[78]=K,t[79]=te,t[80]=q,t[81]=Oe):Oe=t[81];let ke;t[82]!==K||t[83]!==ne?(ke=ne?(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:K}),` 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[82]=K,t[83]=ne,t[84]=ke):ke=t[84];let Ae;t[85]!==f||t[86]!==ve||t[87]!==be||t[88]!==x?(Ae=(0,Z.jsx)(wd,{cascade:f,onOpenNested:be,removeGitState:x,onRequestRemoveGit:me,onCancelRemoveGit:ge,onConfirmRemoveGit:ve}),t[85]=f,t[86]=ve,t[87]=be,t[88]=x,t[89]=Ae):Ae=t[89];let je,Me;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(je=(0,Z.jsx)(`legend`,{className:`text-sm font-medium`,children:`Connect AI editors`}),Me=(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`All editors are checked by default — uncheck the ones you don't use.`}),t[90]=je,t[91]=Me):(je=t[90],Me=t[91]);let Ne;t[92]!==g||t[93]!==l?(Ne=Gr.map(e=>{let t=`create-editor-${e}`;return(0,Z.jsxs)(Lo,{htmlFor:t,className:`text-sm font-normal`,children:[(0,Z.jsx)(ko,{id:t,checked:l.has(e),onCheckedChange:()=>oe(e),disabled:g,"data-testid":`create-editor-${e}`}),(0,Z.jsx)(`span`,{children:or[e]})]},e)}),t[92]=g,t[93]=l,t[94]=Ne):Ne=t[94];let Pe;t[95]===Ne?Pe=t[96]:(Pe=(0,Z.jsxs)(`fieldset`,{className:`space-y-2 pb-2`,children:[je,Me,Ne]}),t[95]=Ne,t[96]=Pe);let Fe;t[97]===v?Fe=t[98]:(Fe=v===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:hd(v)}),t[97]=v,t[98]=Fe);let Ie;t[99]!==De||t[100]!==Oe||t[101]!==ke||t[102]!==Ae||t[103]!==Pe||t[104]!==Fe?(Ie=(0,Z.jsxs)(xo,{className:`space-y-4`,children:[De,Oe,ke,Ae,Pe,Fe]}),t[99]=De,t[100]=Oe,t[101]=ke,t[102]=Ae,t[103]=Pe,t[104]=Fe,t[105]=Ie):Ie=t[105];let Le;t[106]===r?Le=t[107]:(Le=()=>r(!1),t[106]=r,t[107]=Le);let Re;t[108]!==g||t[109]!==Le?(Re=(0,Z.jsx)(J,{type:`button`,variant:`outline`,className:`font-mono uppercase`,onClick:Le,disabled:g,"data-testid":`create-cancel`,children:`Cancel`}),t[108]=g,t[109]=Le,t[110]=Re):Re=t[110];let ze=!ie,Be=g?`Creating`:`Create`,Ve;t[111]!==ze||t[112]!==Be?(Ve=(0,Z.jsx)(J,{type:`submit`,disabled:ze,"data-testid":`create-submit`,children:Be}),t[111]=ze,t[112]=Be,t[113]=Ve):Ve=t[113];let He;t[114]!==Re||t[115]!==Ve?(He=(0,Z.jsxs)(So,{children:[Re,Ve]}),t[114]=Re,t[115]=Ve,t[116]=He):He=t[116];let Ue;t[117]!==ue||t[118]!==Ie||t[119]!==He?(Ue=(0,Z.jsxs)(vo,{className:`sm:max-w-lg motion-reduce:duration-0 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none`,"data-testid":`create-project-dialog`,children:[xe,(0,Z.jsxs)(`form`,{onSubmit:ue,"data-testid":`create-project-form`,className:`flex min-h-0 flex-1 flex-col`,children:[Ie,He]})]}),t[117]=ue,t[118]=Ie,t[119]=He,t[120]=Ue):Ue=t[120];let We;return t[121]!==fe||t[122]!==n||t[123]!==Ue?(We=(0,Z.jsx)(To,{open:n,onOpenChange:fe,children:Ue}),t[121]=fe,t[122]=n,t[123]=Ue,t[124]=We):We=t[124],We}function _d(e){return e+1}function vd(e){return e+1}function yd(){}function bd(e){return e+1}function xd(e){return e+1}function Sd(e){console.warn(`[CreateProjectDialog] defaultProjectsRoot probe failed:`,e)}function Cd(){return new Set(Gr)}function wd(e){let t=(0,$.c)(33),{cascade:n,onOpenNested:r,removeGitState:i,onRequestRemoveGit:a,onCancelRemoveGit:o,onConfirmRemoveGit:s}=e;if(n.kind===`idle`||n.kind===`free`)return null;if(n.kind===`block-nested`){let e;t[0]===n.rootPath?e=t[1]:(e=dd(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)(J,{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)(J,{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:[`This will permanently delete`,` `,(0,Z.jsx)(`code`,{className:`font-mono break-all`,children:c}),`. All git history in that folder is lost; the working files stay in place. Only confirm if the parent git repository is unintended. If the parent is intentionally a git repository (you cloned it on purpose), cancel and pick a location outside it instead.`]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Z.jsx)(J,{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)(J,{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}let c;return t[32]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(`div`,{role:`alert`,className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,"data-testid":`create-banner-nonempty`,children:(0,Z.jsx)(`p`,{children:`A non-empty folder already exists at this path. Use "Open folder on disk" instead.`})}),t[32]=c):c=t[32],c}function Td(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 Ed(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 Dd=(0,Q.lazy)(()=>r(()=>import(`./McpConsentDialogBody-nfOIAtwG.js`),__vite__mapDeps([12,1,6,7,13,14,15,8,16]),import.meta.url));function Od(){let e=(0,$.c)(1);if(!(0,Q.useSyncExternalStore)(Oo.subscribe,Ad,kd))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 kd(){return!1}function Ad(){return Oo.getSnapshot()!==null}function jd(e){return`https://github.com/${e.owner}/${e.repo}.git`}function Md(e){let t=e.toLowerCase().trim();return t.endsWith(`/`)&&(t=t.slice(0,-1)),t.endsWith(`.git`)&&(t=t.slice(0,-4)),t}function Nd(e,t){let n=Md(jd(t));for(let t of e)if(t.missing!==!0&&t.gitRemoteUrl&&Md(t.gitRemoteUrl)===n)return t;return null}function Pd(e){return`https://github.com/${e.owner}/${e.repo}.git`}function Fd(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 Id(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 Ld(e){return e.kind===`ok`?{owner:e.owner,repo:e.repo,branch:e.branch,path:e.path,blobUrl:e.blobUrl}:null}function Rd(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 zd(){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 Bd=zd();function Vd(e){return Bd.install(e)}function Hd(e){let t=(0,$.c)(96),{bridge:n,cloneController:r,store:i}=e,a=i===void 0?Bd:i,o=(0,Q.useSyncExternalStore)(a.subscribe,a.getSnapshot,Ud),[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=Id(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 Wd(o,n).then(t=>{if(!e){if(t.kind===`hit`){console.log(Rd({q1_hit:!0})),a.dismiss();return}console.log(Rd({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?Ld(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(Rd({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=Pd(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(Rd({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(Rd({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=Fd(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)(ho,{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)(wo,{children:[z,(0,Z.jsxs)(po,{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 K;t[55]!==D.owner||t[56]!==D.repo?(K=(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]=K):K=t[57];let ee;t[58]!==H||t[59]!==U||t[60]!==W||t[61]!==G||t[62]!==K?(ee=(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,K]}),t[58]=H,t[59]=U,t[60]=W,t[61]=G,t[62]=K,t[63]=ee):ee=t[63];let q;t[64]===F?q=t[65]:(q=()=>{F()},t[64]=F,t[65]=q);let te=l||h,ne,re;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Z.jsx)(`span`,{className:`text-sm font-semibold`,children:`I already have it locally →`}),re=(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Pick the folder where you've cloned it.`}),t[66]=ne,t[67]=re):(ne=t[66],re=t[67]);let ie;t[68]!==q||t[69]!==te?(ie=(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:q,disabled:te,children:[ne,re]}),t[68]=q,t[69]=te,t[70]=ie):ie=t[70];let ae;t[71]!==ee||t[72]!==ie?(ae=(0,Z.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[ee,ie]}),t[71]=ee,t[72]=ie,t[73]=ae):ae=t[73];let oe;t[74]!==p||t[75]!==d||t[76]!==r||t[77]!==N?(oe=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]=oe):oe=t[78];let se;t[79]===k?se=t[80]:(se=jd(k),t[79]=k,t[80]=se);let ce;t[81]===se?ce=t[82]:(ce=(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:se}),`.`]}),t[81]=se,t[82]=ce);let le;t[83]!==ae||t[84]!==oe||t[85]!==ce?(le=(0,Z.jsxs)(xo,{children:[ae,oe,ce]}),t[83]=ae,t[84]=oe,t[85]=ce,t[86]=le):le=t[86];let ue;t[87]===a?ue=t[88]:(ue=(0,Z.jsx)(So,{children:(0,Z.jsx)(J,{variant:`ghost`,onClick:()=>a.dismiss(),children:`Cancel`})}),t[87]=a,t[88]=ue);let de;t[89]!==V||t[90]!==le||t[91]!==ue?(de=(0,Z.jsxs)(vo,{className:`sm:max-w-xl`,"data-testid":`share-receive-dialog`,children:[V,le,ue]}),t[89]=V,t[90]=le,t[91]=ue,t[92]=de):de=t[92];let fe;return t[93]!==R||t[94]!==de?(fe=(0,Z.jsx)(To,{open:!0,onOpenChange:R,children:de}),t[93]=R,t[94]=de,t[95]=fe):fe=t[95],fe}function Ud(){return null}async function Wd(e,t){let n;try{n=Nd(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 Gd=(e,t,n)=>cl(e,t,n,`NavigatorApp`);function Kd(e,t){return e.filter(e=>e.path!==t)}function qd(e){let t=(0,$.c)(87),{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,b]=(0,Q.useState)(null),x=typeof window<`u`&&window.okDesktop!=null,[C,w]=(0,Q.useState)(`auth`),{channel:T}=al(),{theme:E}=Hr();Gi(n,E??`system`);let D;t[1]===n.project?D=t[2]:(D=()=>{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]=D);let O;t[3]===n?O=t[4]:(O=[n],t[3]=n,t[4]=O),(0,Q.useEffect)(D,O);let k;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(k=(e,t)=>Gd(e,t,l),t[5]=k):k=t[5];let A=k,j;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>d(!0),t[6]=j):j=t[6];let M=j,N;t[7]===n?N=t[8]:(N=()=>A(async()=>{let e=await n.dialog.openFolder();e&&await Xd(n,e,`pick-existing`)},`Failed to open folder.`),t[7]=n,t[8]=N);let P=N,F;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>p(!0),t[9]=F):F=t[9];let I=F,L;t[10]===n?L=t[11]:(L=e=>A(async()=>{await Xd(n,e,`recents`)},`Failed to open project.`),t[10]=n,t[11]=L);let R=L,z;t[12]===n.project?z=t[13]:(z=e=>A(async()=>{await n.project.removeRecent(e),a(t=>Kd(t,e))},`Failed to remove project.`),t[12]=n.project,t[13]=z);let B=z,V;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-0 z-10 h-9 ${x?`[-webkit-app-region:drag]`:``}`,"data-testid":`nav-chrome-row`}),t[14]=V):V=t[14];let H;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Z.jsx)(Ed,{className:`size-12 shrink-0`}),t[15]=H):H=t[15];let U;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(U=(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)(ed,{})]}),t[16]=U):U=t[16];let W;t[17]===n.appVersion?W=t[18]:(W=(0,Z.jsxs)(`p`,{className:`text-muted-foreground text-xs font-mono`,children:[`v`,n.appVersion]}),t[17]=n.appVersion,t[18]=W);let G;t[19]===T?G=t[20]:(G=T!==null&&(0,Z.jsx)(je,{variant:`gray`,className:`text-2xs font-mono`,children:T===`beta`?`Beta`:`Stable`}),t[19]=T,t[20]=G);let K;t[21]!==W||t[22]!==G?(K=(0,Z.jsxs)(`header`,{className:`shrink-0 flex-wrap flex items-center gap-2.5`,children:[H,(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[U,(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[W,G]})]})]}),t[21]=W,t[22]=G,t[23]=K):K=t[23];let ee;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Z.jsx)(Jd,{title:`Clone from GitHub`,description:`Bring a remote repository onto this machine.`,onClick:M,dataTestId:`nav-clone`,Icon:Td}),t[24]=ee):ee=t[24];let q;t[25]===P?q=t[26]:(q=(0,Z.jsx)(Jd,{title:`Open folder on disk`,description:`Use a folder you already have.`,onClick:P,dataTestId:`nav-open`,Icon:S}),t[25]=P,t[26]=q);let te;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Z.jsx)(Jd,{title:`Create new project`,description:`Make a new folder for a brand-new project.`,onClick:I,dataTestId:`nav-create-new`,Icon:Ui}),t[27]=te):te=t[27];let ne;t[28]===q?ne=t[29]:(ne=(0,Z.jsxs)(`section`,{className:`grid shrink-0 sm:grid-cols-3 gap-3`,children:[ee,q,te]}),t[28]=q,t[29]=ne);let re;t[30]===c?re=t[31]:(re=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)(`button`,{type:`button`,onClick:()=>l(null),className:`text-red-700 text-xs underline hover:no-underline dark:text-red-300`,"data-testid":`nav-error-dismiss`,children:`Dismiss`})]}),t[30]=c,t[31]=re);let ie;t[32]!==o||t[33]!==R||t[34]!==B||t[35]!==i?(ie=o?(0,Z.jsx)(`section`,{className:`flex shrink-0 flex-col items-center`,children:(0,Z.jsx)(y,{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 overflow-y-auto space-y-0.5 -mx-4`,"data-testid":`nav-recent-list`,children:i.map(e=>(0,Z.jsx)(Yd,{project:e,onOpen:()=>R(e.path),onRemove:()=>B(e.path)},e.path))})]}):null,t[32]=o,t[33]=R,t[34]=B,t[35]=i,t[36]=ie):ie=t[36];let ae;t[37]!==K||t[38]!==ne||t[39]!==re||t[40]!==ie?(ae=(0,Z.jsx)(`div`,{className:`mx-auto flex h-full w-full max-w-5xl flex-col overflow-hidden px-12 py-6`,children:(0,Z.jsxs)(`div`,{className:`my-auto flex min-h-0 flex-col space-y-10`,children:[K,ne,re,ie]})}),t[37]=K,t[38]=ne,t[39]=re,t[40]=ie,t[41]=ae):ae=t[41];let oe,se;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,Z.jsx)(Od,{}),se=(0,Z.jsx)(ad,{}),t[42]=oe,t[43]=se):(oe=t[42],se=t[43]);let ce;t[44]!==n||t[45]!==f?(ce=(0,Z.jsx)(gd,{open:f,onOpenChange:p,bridge:n}),t[44]=n,t[45]=f,t[46]=ce):ce=t[46];let le;t[47]===v?le=t[48]:(le=e=>{h(e),e||(_(!1),v&&(v(null),b(null)))},t[47]=v,t[48]=le);let ue;t[49]===n?ue=t[50]:(ue=bl(n),t[49]=n,t[50]=ue);let de=C===`identity`,fe;t[51]!==g||t[52]!==v?(fe=e=>{h(!1),g&&(_(!1),d(!0)),v&&(v({authenticated:!0,host:`github.com`,login:e.login}),b(null))},t[51]=g,t[52]=v,t[53]=fe):fe=t[53];let pe;t[54]!==m||t[55]!==le||t[56]!==ue||t[57]!==de||t[58]!==fe?(pe=(0,Z.jsx)(Qu,{open:m,onOpenChange:le,transport:ue,identityPrompt:de,onSuccess:fe}),t[54]=m,t[55]=le,t[56]=ue,t[57]=de,t[58]=fe,t[59]=pe):pe=t[59];let me;t[60]===n?me=t[61]:(me=Sl(n),t[60]=n,t[61]=me);let he;t[62]===n?he=t[63]:(he=gl(n),t[62]=n,t[63]=he);let ge;t[64]===n.dialog?ge=t[65]:(ge=()=>n.dialog.openFolder(),t[64]=n.dialog,t[65]=ge);let _e;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(_e=()=>{d(!1),w(`auth`),_(!0),h(!0)},t[66]=_e):_e=t[66];let ve;t[67]===n?ve=t[68]:(ve=e=>{let{dir:t}=e;A(()=>Xd(n,t,`pick-existing`),`Failed to open cloned project.`)},t[67]=n,t[68]=ve);let ye;t[69]!==u||t[70]!==me||t[71]!==he||t[72]!==ge||t[73]!==ve?(ye=(0,Z.jsx)(rd,{open:u,onOpenChange:d,transport:me,authQueryTransport:he,pickParentFolder:ge,onSignIn:_e,onCloneComplete:ve}),t[69]=u,t[70]=me,t[71]=he,t[72]=ge,t[73]=ve,t[74]=ye):ye=t[74];let be;if(t[75]!==n){let e;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(e=()=>new Promise(e=>{b(()=>e),h(!0)}),t[77]=e):e=t[77],be=dl({bridge:n,authQueryTransport:gl(n),cloneTransport:Sl(n),openSignIn:e}),t[75]=n,t[76]=be}else be=t[76];let xe;t[78]!==n||t[79]!==be?(xe=(0,Z.jsx)(Hd,{bridge:n,cloneController:be}),t[78]=n,t[79]=be,t[80]=xe):xe=t[80];let Se;return t[81]!==ae||t[82]!==ce||t[83]!==pe||t[84]!==ye||t[85]!==xe?(Se=(0,Z.jsxs)(`div`,{className:`relative flex h-screen w-screen flex-col overflow-hidden bg-primary-foreground dark:bg-background text-foreground`,children:[V,ae,oe,se,ce,pe,ye,xe]}),t[81]=ae,t[82]=ce,t[83]=pe,t[84]=ye,t[85]=xe,t[86]=Se):Se=t[86],Se}function Jd(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)(`button`,{type:`button`,onClick:i,"data-testid":a,className:`flex flex-col items-start gap-1.5 rounded-lg border border-border bg-card py-3.5 px-4 text-left transition-colors hover:bg-accent`,children:[l,u]}),t[9]=a,t[10]=i,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function Yd(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=Y(`flex min-w-0 flex-1 items-center justify-between gap-2 rounded-md py-3.5 pl-4 pr-2 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed`,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)(je,{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)(`button`,{type:`button`,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)(fo,{"aria-hidden":`true`}),t[17]=h):h=t[17];let g;t[18]!==i||t[19]!==m||t[20]!==p?(g=(0,Z.jsx)(J,{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 Xd(e,t,n){await e.project.open({path:t,target:`new-window`,entryPoint:n})}var Zd=e=>{let t=(0,$.c)(8),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let{theme:r}=Hr(),i=r===void 0?`system`:r,a,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a={success:(0,Z.jsx)(Ar,{className:`size-4`}),info:(0,Z.jsx)(c,{className:`size-4`}),warning:(0,Z.jsx)(Jr,{className:`size-4`}),error:(0,Z.jsx)(wc,{className:`size-4`}),loading:(0,Z.jsx)(y,{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 l;return t[5]!==n||t[6]!==i?(l=(0,Z.jsx)(mo,{theme:i,className:`toaster group`,icons:a,style:o,toastOptions:s,...n}),t[5]=n,t[6]=i,t[7]=l):l=t[7],l};function Qd(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($d(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 $d(e,t){return e.startsWith(`/api/`)?t+e:e}function ef(e){return`#/${encodeURIComponent(e)}`}function tf(e){let t=e.bridge;if(!t)return;let n=e.setHash??(e=>{window.location.hash=e});return t.onDeepLink(e=>{n(ef(e.doc))})}var nf=4e3,rf=1440*60*1e3;function af(e){let t=e.bridge;if(t&&t.onboarding)return t.onboarding.onToast(e=>{if(e.kind===`ancestor-promote`){X.success(`Opened existing OK project at ${e.ancestorPath}`,{duration:nf});return}if(e.kind===`mcp-repaired`){let t=e.editors.map(e=>or[e]??e).join(`, `);X.success(`Repaired ${t} MCP integration. Restart ${t} if already open.`,{duration:rf});return}if(e.kind===`mcp-repair-failed`){X.error(`MCP auto-repair failed — open Settings → AI Tool Integration to fix.`,{duration:rf});return}let t=Wo(e.gitRoot,e.pickedPath)??e.pickedPath;X.success(`Initialized OK at ${e.gitRoot} — opened parent of ${t} because it contains a .git folder`,{duration:nf})})}var of=!1;function sf(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{Xe(n,{durationMs:Math.round(e*1e3)/1e3,threw:!o,...i},{startTime:t,duration:e})}catch{}}}}function cf(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 lf=0,uf=0,df=0,ff=0,pf=null,mf=[`linkResolutionDecoration$`],hf=new WeakSet,gf=new WeakSet;function _f(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function vf(){return!1}function yf(){return!vf()}function bf(e,t){if(yf())return t;let n=`ok/cold/nodeview-factory-${_f(e)}`;return function(...r){let i=performance.now();try{return t(...r)}finally{let t=performance.now()-i;Xe(n,{nodeType:e,durationMs:Math.round(t*1e3)/1e3},{startTime:i,duration:t})}}}function xf(e){if(yf())return;let t=e.state.plugins;for(let e of t){if(gf.has(e))continue;let t=e.spec?.key?.key;if(!t||!mf.some(e=>t.startsWith(e)))continue;let n=e.props,r=n.decorations;if(typeof r!=`function`){gf.add(e);continue}let i=`ok/cold/decoration-${_f(t.replace(/\$\d*$/,``))}`;n.decorations=function(...e){let n=performance.now();try{return r.apply(this,e)}finally{let e=performance.now()-n;Xe(i,{pluginKey:t,durationMs:Math.round(e*1e3)/1e3},{startTime:n,duration:e})}},gf.add(e)}}function Sf(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=bf(e,n);r.__okWrapped=!0,t[e]=r}}function Cf(e){return yf()?e:e.map(e=>{let t=e.name??`unknown`,n=_f(t);return e.extend({onBeforeCreate(){let e=performance.now();try{this.parent?.()}finally{let r=performance.now()-e;Xe(`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;Xe(`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;Xe(`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;Xe(`ok/cold/ext-${n}-on-destroy`,{ext:t,hook:`onDestroy`,durationMs:Math.round(r*1e3)/1e3},{startTime:e,duration:r})}}})})}function wf(){if(!of){of=!0,sf(ni.prototype,`mount`,`ok/cold/editor-mount`,(e,t,n,r)=>{let i=e;return yf()||(pf=performance.now()),{elementDefault:i.options?.element?.nodeName??null,docSize:cf(i.editorState),durationMs:r}}),sf(ni.prototype,`createView`,`ok/cold/editor-create-view`,e=>{let t=e;return!yf()&&!hf.has(e)&&t.view&&(xf(t.view),Sf(t.view),hf.add(e)),{docSize:cf(t.editorState)}}),sf(ni.prototype,`createNodeViews`,`ok/cold/create-node-views`,(e,t,n,r)=>{ff+=1;let i=e;return!yf()&&i.view&&Sf(i.view),{docSize:cf(i.view),seq:ff,durationMs:r}}),sf(Gn.prototype,`updateState`,`ok/cold/pm-update-state`,(e,t,n,r)=>(uf+=1,{seq:uf,docSize:cf(e.state),durationMs:r})),sf(Gn.prototype,`setProps`,`ok/cold/pm-set-props`,(e,t,n,r)=>(df+=1,{seq:df,docSize:cf(e.state),durationMs:r})),sf(P.prototype,`_forceRerender`,`ok/cold/force-rerender`,(e,t,n,r)=>{lf+=1;let i=e,a=(()=>{try{return i.type?.toArray?i.type.toArray().length:null}catch{return null}})();return{seq:lf,topLevelYElements:a,durationMs:r}}),sf(Be.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`)&&(Xe(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`&&pf!==null)){let e=pf,n=Math.max(0,t.startTime-e);Xe(`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}),pf=null}}}).observe({type:`paint`,buffered:!0})}catch{}globalThis.__okColdMountInstrumented=!0}}var Tf=`Relaunch`,Ef=`Release notes`,Df=`Updates paused`,Of=`Download`,kf=`Reset to defaults`,Af=`Relaunch failed — please restart manually`,jf=`Recovery action failed — please try again`;function Mf(e,t){let n=t instanceof Error&&t.message?t.message:``;return n?`${e}: ${n}`:e}function Nf(e){return`Version ${e} ready to install`}function Pf(e){return`Updated to Version ${e}`}function Ff(e){return`Your settings and recent projects were saved by a newer build than this one (v${e}). Reset to defaults to continue.`}var If=0,Lf=0,Rf=1,zf=2,Bf=3;function Vf(e,t,n=()=>{}){let r=[];return r.push(e.onUpdateDownloaded(({version:r})=>{let i=`update-downloaded`;t({id:i,body:Nf(r),priority:zf,action:{label:Tf,onClick:()=>{e.update.relaunchNow().then(()=>{n(i)},e=>{t({id:`relaunch-error-${r}`,body:Mf(Af,e),variant:`error`,priority:Rf})})}}})})),r.push(e.onWhatsNew(({version:n,releaseUrl:r})=>{t({id:`whats-new-${n}`,body:Pf(n),priority:Bf,action:{label:Ef,onClick:()=>{e.shell.openExternal(r)}}})})),r.push(e.onUpdateStuckHint(({downloadUrl:n})=>{t({id:`update-stuck-hint`,body:Df,priority:Lf,action:{label:Of,onClick:()=>{e.shell.openExternal(n)}}})})),()=>{for(let e of r)e()}}function Hf(e,t,n,r=()=>{}){let i=`schema-incompatibility-${t.persistedSchemaVersion}`,a=`schema-incompatibility-error-${t.persistedSchemaVersion}`,o=e=>{r(i),n({id:a,body:Mf(jf,e),variant:`error`,priority:If})};n({id:i,body:Ff(t.currentBuild),priority:If,action:{label:kf,onClick:()=>{e.state.resetIncompatible().then(()=>{r(i)},o)}}})}var Uf=[],Wf=new Set,Gf=!1;function Kf(){for(let e of Wf)e()}function qf(e){let t=Uf.findIndex(t=>t.id===e.id);if(t===-1)Uf=[...Uf,e];else{let n=Uf.slice();n[t]=e,Uf=n}Kf()}function Jf(e){let t=Uf.filter(t=>t.id!==e);t.length!==Uf.length&&(Uf=t,Kf())}function Yf(){return Uf}function Xf(e){return Wf.add(e),()=>{Wf.delete(e)}}function Zf(){if(Gf||typeof window>`u`)return;let e=window.okDesktop;e&&(Gf=!0,Vf(e,qf,Jf),e.state.query().then(t=>{t.schemaIncompatibility&&Hf(e,t.schemaIncompatibility,qf,Jf)},e=>{console.warn(`[update-notices-store] bridge.state.query() failed`,e)}))}var Qf=`ok-omnibar-recents-v1`,$f=10;function ep(e){return typeof e==`object`&&!!e&&(e.kind===`file`||e.kind===`folder`)&&typeof e.path==`string`&&typeof e.lastOpenedAt==`string`}function tp(e){if(e)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function np(e,t){return`${e}:${t}`}function rp(e){let t=tp(e);if(!t)return[];try{let e=t.getItem(Qf);if(!e)return[];let n=JSON.parse(e);return Array.isArray(n)?n.filter(ep).slice(0,$f):[]}catch{return[]}}function ip(e,t){let n=tp(t);if(n)try{n.setItem(Qf,JSON.stringify(e.slice(0,$f)))}catch(e){console.warn(`[omnibar] Failed to save recent entries:`,e)}}function ap(e,t){return[t,...e.filter(e=>e.kind!==t.kind||e.path!==t.path)].slice(0,$f)}function op(e,t){return e.filter(e=>t.has(np(e.kind,e.path)))}var sp=50,cp=30,lp=``,up=null;function dp(e){return e.trim().toLowerCase()}function fp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function pp(e){let t=e.trim();return t?[...new Set(t.split(/\s+/).filter(Boolean))].sort((e,t)=>t.length-e.length):[]}function mp(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:zr(t),...a?{title:a}:{},...e?{modifiedTs:Date.parse(e)}:{}})}for(let e of t)i.push({kind:`folder`,path:e,name:zr(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 hp(e){return ai({kind:e.kind===`file`?`page`:`folder`,path:e.path,title:e.title??e.name,modifiedTs:e.modifiedTs??0})}function gp(e){return{entries:e,byId:new Map(e.map(e=>[`${e.kind===`file`?`page`:`folder`}:${e.path}`,e])),corpus:fr(e.map(hp))}}function _p(e){return e.map(e=>`${e.kind}\u0000${e.path}\u0000${e.title??``}\u0000${e.modifiedTs??0}`).join(``)}function vp(e){let t=_p(e);return up&&lp===t?up:(lp=t,up=gp(e),up)}function yp(e,t,n=sp){return bp(vp(e),t,n)}function bp(e,t,n=sp){let r=dp(t);return r?gr(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 xp(e,t){let n=pp(t);if(n.length===0||e.length===0)return[{text:e,match:!1,start:0}];let r=RegExp(`(${n.map(fp).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 Sp(e){if(e.kind!==`page`&&e.kind!==`folder`||typeof e.path!=`string`)return null;let t=zr(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 Cp(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??cp}),signal:t.signal});if(!r.ok){let e=await r.json().catch(()=>null);throw Error(Xn(e)??`Search failed with status ${r.status}`)}return((await r.json()).results??[]).map(Sp).filter(e=>!!e)}function wp(e,t,n=[]){let r=dp(t);return r?dp([e,...n].join(` `)).includes(r):!0}var Tp=`tag:`;function Ep(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 Dp(e,t){return L(e,t)}var Op=E;async function kp(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 Ap=`open-knowledge:doc-panel-tab`,jp=null;function Mp(){let e=jp;return jp=null,e}function Np(e,t=typeof window>`u`?new EventTarget:window){jp=e,t.dispatchEvent(new CustomEvent(Ap,{detail:{tab:e}}))}function Pp(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(Ap,n),()=>t.removeEventListener(Ap,n)}var Fp=[`.md`,`.mdx`];function Ip(e){let t=e.toLowerCase();for(let e of Fp)if(t.endsWith(e))return e;return null}function Lp(e){let t=Ip(e);return t?e.slice(0,-t.length):e}var Rp=`__blank__`,zp={local:0,inherited:1};function Bp(e){return[...e].sort((e,t)=>{let n=zp[e.scope]-zp[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 Vp(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 Hp(e){let t=e.fileName.trim(),n=Ip(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 Up(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 Wp(e){let t=e.value.lastIndexOf(`.`);t>0?e.setSelectionRange(0,t):e.select()}function Gp(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}=Xr(),f=Ba(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)(Rp),[S,C]=(0,Q.useState)(null),[w,T]=(0,Q.useState)(!1),[E,D]=(0,Q.useState)(null),O=(0,Q.useId)(),k=(0,Q.useId)(),A=(0,Q.useId)(),j=(0,Q.useId)(),M=(0,Q.useId)(),[N,P]=(0,Q.useState)(!1),F=(0,Q.useRef)(null),I=(0,Q.useRef)(null),L,R;t[0]!==s||t[1]!==i||t[2]!==n||t[3]!==o?(L=()=>{if(n){C(null),D(null),T(!1),_(``),x(i===`file`&&s?s:Rp),P(!1);let e=i===`file`?o??`untitled`:`index`,t=Ip(e);y(t??`.md`),h(t?Lp(e):e)}},R=[n,i,o,s],t[0]=s,t[1]=i,t[2]=n,t[3]=o,t[4]=L,t[5]=R):(L=t[4],R=t[5]),(0,Q.useEffect)(L,R);let z;t[6]!==p.state.data||t[7]!==p.state.status?(z=p.state.status===`ready`?Bp(p.state.data.folder.templates_available??[]):[],t[6]=p.state.data,t[7]=p.state.status,t[8]=z):z=t[8];let B=z,V;t[9]!==p.state.data||t[10]!==p.state.status||t[11]!==n||t[12]!==b?(V=()=>{n&&b!==Rp&&p.state.status===`ready`&&((p.state.data.folder.templates_available??[]).some(e=>e.name===b)||x(Rp))},t[9]=p.state.data,t[10]=p.state.status,t[11]=n,t[12]=b,t[13]=V):V=t[13];let H;t[14]!==p.state||t[15]!==n||t[16]!==b?(H=[n,b,p.state],t[14]=p.state,t[15]=n,t[16]=b,t[17]=H):H=t[17],(0,Q.useEffect)(V,H);let W=i===`file`,G=p.state.status===`loading`||p.state.status===`idle`,K=p.state.status===`error`?p.state.message:null,ee;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(ee=function(e){let t=Ip(e);t?(y(t),h(Lp(e))):h(e),C(null)},t[18]=ee):ee=t[18];let q=ee,te;t[19]!==v||t[20]!==m||t[21]!==g||t[22]!==a||t[23]!==i?(te=function(){return Hp({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]=te):te=t[24];let ne=te,re;t[25]!==m||t[26]!==g||t[27]!==i?(re=function(){if(i===`folder`){let e=Vp(g.trim());if(e)return{message:`Folder name: ${e}`,field:`folder`}}let e=Vp(m.trim());return e?{message:e,field:`file`}:null},t[25]=m,t[26]=g,t[27]=i,t[28]=re):re=t[28];let ie=re,ae;t[29]!==w||t[30]!==m||t[31]!==g||t[32]!==i?(ae=w||!m.trim()||i===`folder`&&!g.trim(),t[29]=w,t[30]=m,t[31]=g,t[32]=i,t[33]=ae):ae=t[33];let oe=ae,se;t[34]!==d||t[35]!==ne||t[36]!==ie||t[37]!==i||t[38]!==l||t[39]!==r||t[40]!==b?(se=async function(){let e=ie();if(e){C(e.message),D(e.field);return}T(!0),C(null),D(null);let t=ne(),n=i===`file`&&b!==Rp?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 U(e,`Server error (HTTP ${e.status})`);if(!t.ok){T(!1),C(t.title),D(`form`);return}let n=Sr.safeParse(t.body);if(T(!1),!n.success){C(`Failed to create ${i}`),D(`form`);return}let o=n.data.docName;r(!1),window.location.hash=`#/${o}`,d(o),Lr([`files`,`backlinks`,`graph`]),l?.(o)}catch(e){console.warn(`[NewItemDialog] create failed:`,e),T(!1),C(`Network error — please try again`),D(`form`)}},t[34]=d,t[35]=ne,t[36]=ie,t[37]=i,t[38]=l,t[39]=r,t[40]=b,t[41]=se):se=t[41];let ce=se,le=a||`(root)`,ue=i===`file`?`New file`:`New folder`,de;t[42]===ue?de=t[43]:(de=(0,Z.jsx)(ho,{children:ue}),t[42]=ue,t[43]=de);let fe;t[44]!==c||t[45]!==le?(fe=c??(0,Z.jsxs)(Z.Fragment,{children:[`Create in `,(0,Z.jsx)(`span`,{className:`font-medium text-foreground`,children:le})]}),t[44]=c,t[45]=le,t[46]=fe):fe=t[46];let pe;t[47]===fe?pe=t[48]:(pe=(0,Z.jsx)(po,{children:fe}),t[47]=fe,t[48]=pe);let me;t[49]!==de||t[50]!==pe?(me=(0,Z.jsxs)(wo,{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]!==j||t[55]!==N||t[56]!==M||t[57]!==B||t[58]!==K||t[59]!==G?(he=W&&(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`span`,{id:j,className:`mb-1.5 block text-sm font-medium`,children:`Start from`}),K?(0,Z.jsxs)(`p`,{role:`alert`,className:`mb-1.5 text-xs text-destructive`,children:[`Could not load templates: `,K,`. You can still create a blank note.`]}):null,(0,Z.jsx)(Jp,{triggerId:M,labelledById:j,open:N,onOpenChange:P,value:b,onValueChange:x,templates:B,loading:G}),!G&&!K&&B.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]=j,t[55]=N,t[56]=M,t[57]=B,t[58]=K,t[59]=G,t[60]=he):he=t[60];let ge;t[61]!==S||t[62]!==E||t[63]!==O||t[64]!==k||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:k,children:`Folder name`}),(0,Z.jsx)(Ho,{ref:I,id:k,value:g,onChange:e=>{_(e.target.value),C(null)},placeholder:`folder-name`,autoFocus:!0,"aria-describedby":S&&(E===`folder`||E===`form`)?O:void 0,"aria-invalid":S&&(E===`folder`||E===`form`)?!0:void 0,onKeyDown:e=>{if(e.key===`Enter`){e.preventDefault();let t=Vp(g.trim());if(t){C(`Folder name: ${t}`),D(`folder`);return}F.current?.focus()}}})]}),t[61]=S,t[62]=E,t[63]=O,t[64]=k,t[65]=g,t[66]=i,t[67]=ge):ge=t[67];let _e=i===`folder`?`First file name`:`File name`,ve;t[68]!==A||t[69]!==_e?(ve=(0,Z.jsx)(`label`,{className:`mb-1.5 block text-sm font-medium`,htmlFor:A,children:_e}),t[68]=A,t[69]=_e,t[70]=ve):ve=t[70];let ye;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(ye=e=>q(e.target.value),t[71]=ye):ye=t[71];let be=i===`file`,xe=S&&(E===`file`||E===`form`)?O:void 0,Se=S&&(E===`file`||E===`form`)?!0:void 0,Ce;t[72]!==ce||t[73]!==oe?(Ce=e=>{e.key===`Enter`&&!oe&&ce()},t[72]=ce,t[73]=oe,t[74]=Ce):Ce=t[74];let we;t[75]!==A||t[76]!==m||t[77]!==be||t[78]!==xe||t[79]!==Se||t[80]!==Ce?(we=(0,Z.jsx)(Ho,{ref:F,id:A,value:m,onChange:ye,placeholder:`my-note`,autoFocus:be,"aria-describedby":xe,"aria-invalid":Se,onFocus:qp,onKeyDown:Ce,className:`flex-1`}),t[75]=A,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=Fp.map(Kp),t[83]=Ee):Ee=t[83];let De;t[84]===v?De=t[85]:(De=(0,Z.jsx)(Io,{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]!==O?(ke=S&&(0,Z.jsx)(`p`,{id:O,role:`alert`,className:`text-xs text-red-600 dark:text-red-400`,children:S}),t[89]=S,t[90]=O,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)(xo,{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)(J,{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]!==ce||t[106]!==oe||t[107]!==Pe?(Fe=(0,Z.jsx)(J,{onClick:ce,disabled:oe,children:Pe}),t[105]=ce,t[106]=oe,t[107]=Pe,t[108]=Fe):Fe=t[108];let Ie;t[109]!==Ne||t[110]!==Fe?(Ie=(0,Z.jsxs)(So,{children:[Ne,Fe]}),t[109]=Ne,t[110]=Fe,t[111]=Ie):Ie=t[111];let Le;t[112]!==me||t[113]!==je||t[114]!==Ie?(Le=(0,Z.jsxs)(vo,{className:`sm:max-w-md`,"data-ok-layer-spawned":``,children:[me,je,Ie]}),t[112]=me,t[113]=je,t[114]=Ie,t[115]=Le):Le=t[115];let Re;return t[116]!==r||t[117]!==n||t[118]!==Le?(Re=(0,Z.jsx)(To,{open:n,onOpenChange:r,children:Le}),t[116]=r,t[117]=n,t[118]=Le,t[119]=Re):Re=t[119],Re}function Kp(e){return(0,Z.jsx)(No,{value:e,"aria-label":`Use ${e} extension`,children:e},e)}function qp(e){return Wp(e.currentTarget)}function Jp(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,p=o===Rp,m=i?u:void 0,h=`${r} ${n}`,g=l?`Loading templates`:p?`Blank note`:f?.title??f?.name??o,_;t[5]===g?_=t[6]:(_=(0,Z.jsx)(`span`,{className:`truncate`,children:g}),t[5]=g,t[6]=_);let v;t[7]!==p||t[8]!==l||t[9]!==f?(v=!l&&!p&&f?(0,Z.jsx)(Qp,{entry:f}):null,t[7]=p,t[8]=l,t[9]=f,t[10]=v):v=t[10];let y;t[11]!==_||t[12]!==v?(y=(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[_,v]}),t[11]=_,t[12]=v,t[13]=y):y=t[13];let b;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Z.jsx)(Hs,{className:`ml-2 size-4 shrink-0 opacity-50`,"aria-hidden":`true`}),t[14]=b):b=t[14];let x;t[15]!==l||t[16]!==i||t[17]!==m||t[18]!==h||t[19]!==y||t[20]!==n?(x=(0,Z.jsx)(M,{asChild:!0,children:(0,Z.jsxs)(J,{id:n,type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":i,"aria-haspopup":`listbox`,"aria-controls":m,"aria-labelledby":h,disabled:l,className:`w-full justify-between font-normal`,children:[y,b]})}),t[15]=l,t[16]=i,t[17]=m,t[18]=h,t[19]=y,t[20]=n,t[21]=x):x=t[21];let S;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(ye,{placeholder:`Search templates`}),t[22]=S):S=t[22];let w;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(zt,{children:`No templates found.`}),t[23]=w):w=t[23];let T;t[24]!==a||t[25]!==s?(T=()=>{s(Rp),a(!1)},t[24]=a,t[25]=s,t[26]=T):T=t[26];let E=o===Rp?`opacity-100`:`opacity-0`,D;t[27]===E?D=t[28]:(D=Y(`mt-1 size-4 shrink-0`,E),t[27]=E,t[28]=D);let O;t[29]===D?O=t[30]:(O=(0,Z.jsx)(lo,{className:D,"aria-hidden":`true`}),t[29]=D,t[30]=O);let A;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(A=(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]=A):A=t[31];let j;t[32]!==T||t[33]!==O?(j=(0,Z.jsxs)(k,{value:`Blank note empty`,onSelect:T,className:`items-start gap-3`,children:[O,A]}),t[32]=T,t[33]=O,t[34]=j):j=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)(k,{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)(lo,{className:Y(`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)(Qp,{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]!==j||t[46]!==N?(P=(0,Z.jsx)(C,{className:`w-[var(--radix-popover-trigger-width)] p-0`,align:`start`,onOpenAutoFocus:Zp,onWheel:Xp,onTouchMove:Yp,children:(0,Z.jsxs)(B,{children:[S,(0,Z.jsxs)(ge,{id:u,className:`subtle-scrollbar`,children:[w,j,N]})]})}),t[44]=u,t[45]=j,t[46]=N,t[47]=P):P=t[47];let F;return t[48]!==a||t[49]!==i||t[50]!==P||t[51]!==x?(F=(0,Z.jsxs)(re,{open:i,onOpenChange:a,children:[x,P]}),t[48]=a,t[49]=i,t[50]=P,t[51]=x,t[52]=F):F=t[52],F}function Yp(e){e.stopPropagation()}function Xp(e){e.stopPropagation()}function Zp(e){e.preventDefault(),e.currentTarget.querySelector(`[cmdk-input]`)?.focus()}function Qp(e){let t=(0,$.c)(5),{entry:n,className:r}=e;if(n.scope===`inherited`){let e;t[0]===r?e=t[1]:(e=Y(`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)(je,{variant:`gray`,className:e,children:i}),t[2]=e,t[3]=i,t[4]=a):a=t[4],a}return null}function $p(e){return e.split(`/`).pop()??e}function em(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($p(e.path))??``})),i=e.created.filter(e=>e.kind===`file`).map(e=>({kind:`file`,name:e.path,description:$p(e.path)===`log.md`?`Append-only timeline`:``}));return[...r,...i]}function tm(e){let t=(0,$.c)(20),{plan:n,selectedPack:r}=e,i,a,o,s,l,u;if(t[0]!==n||t[1]!==r){let e=[...em(n,r)].sort(im),d=new Set(e.map(rm));l=`space-y-2`,t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(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]=u):u=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(`/`);d.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},nm),a?(0,Z.jsx)(sc,{"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)(Vo,{children:[(0,Z.jsx)(Ro,{"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)(c,{"aria-hidden":`true`,className:`size-3 text-muted-foreground/60`,strokeWidth:1.5})}),(0,Z.jsx)(zo,{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]=l,t[7]=u}else i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7];let d;t[9]!==i||t[10]!==a||t[11]!==o?(d=(0,Z.jsx)(`ul`,{"aria-label":i,className:a,children:o}),t[9]=i,t[10]=a,t[11]=o,t[12]=d):d=t[12];let f;t[13]!==s||t[14]!==d?(f=(0,Z.jsx)(`div`,{className:s,children:d}),t[13]=s,t[14]=d,t[15]=f):f=t[15];let p;return t[16]!==l||t[17]!==u||t[18]!==f?(p=(0,Z.jsxs)(`section`,{className:l,children:[u,f]}),t[16]=l,t[17]=u,t[18]=f,t[19]=p):p=t[19],p}function nm(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 rm(e){return e.name.replace(/\/$/,``)}function im(e,t){return e.name.localeCompare(t.name)}async function am(e){let t=await e.json().catch(()=>null),n=An.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 om(){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 am(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 am(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 sm={"knowledge-base":mc,"software-lifecycle":cc,"plain-notes":qc,worldbuilding:Ys,"writing-pipeline":kc,gbrain:Cc};function cm(e){return sm[e]??mc}function lm(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 om().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=Y(`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=Y(`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},dm).map(um),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=Y(`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=Y(`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)(fm,{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 um(e){return(0,Z.jsx)(mm,{},`skeleton-${e}`)}function dm(e,t){return t}function fm(e){let t=(0,$.c)(23),{pack:n,onSelect:r}=e,i;t[0]===n.id?i=t[1]:(i=cm(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=pm({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 pm({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 mm(){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)(y,{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 hm(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=Y(`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)(Hu,{"data-slot":`radio-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function gm(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=Y(`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)(Wu,{"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)(Uu,{"data-slot":`radio-group-item`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}var _m=`knowledge-base`;function vm(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??_m),[p,m]=(0,Q.useState)(`project-root`),[h,g]=(0,Q.useState)(``),[_,v]=(0,Q.useState)(a===void 0?`pick`:`configure`),b=(0,Q.useRef)(!0),x;t[1]!==l||t[2]!==d?(x=l?.find(e=>e.id===d),t[1]=l,t[2]=d,t[3]=x):x=t[3];let S=x,C,w;t[4]!==n||t[5]!==l?(C=()=>{if(!n||l!==null)return;let e=!1;return(async()=>{try{let t=await om().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}},w=[n,l],t[4]=n,t[5]=l,t[6]=C,t[7]=w):(C=t[6],w=t[7]),(0,Q.useEffect)(C,w);let T,E;t[8]!==a||t[9]!==n?(T=()=>{n&&(f(a??_m),m(`project-root`),g(``),v(a===void 0?`pick`:`configure`),c({kind:`loading`}),b.current=!0)},E=[n,a],t[8]=a,t[9]=n,t[10]=T,t[11]=E):(T=t[10],E=t[11]),(0,Q.useEffect)(T,E);let D,O;t[12]===S?(D=t[13],O=t[14]):(D=()=>{S&&g(S.defaultSubfolder??``)},O=[S],t[12]=S,t[13]=D,t[14]=O),(0,Q.useEffect)(D,O);let k;t[15]===h?k=t[16]:(k=h.trim(),t[15]=h,t[16]=k);let A=k,j=p===`subfolder`&&A===``,M,N;t[17]!==n||t[18]!==l||t[19]!==p||t[20]!==d||t[21]!==_||t[22]!==j||t[23]!==A?(M=()=>{if(!n||_!==`configure`||l===null)return;if(j){c({kind:`error`,message:`Enter a folder name (e.g. brain).`});return}let e=p===`project-root`?void 0:A,t=b.current?0:200;b.current=!1;let r=!1,i=setTimeout(()=>{r||(c(ym),om().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)}},N=[n,_,l,d,p,A,j],t[17]=n,t[18]=l,t[19]=p,t[20]=d,t[21]=_,t[22]=j,t[23]=A,t[24]=M,t[25]=N):(M=t[24],N=t[25]),(0,Q.useEffect)(M,N);let P;t[26]!==r||t[27]!==i||t[28]!==s.kind||t[29]!==s.plan||t[30]!==S?.name||t[31]!==d?(P=async function(){if(s.kind!==`plan`)return;let e=s.plan;c({kind:`applying`,plan:e});let t;try{t=await om().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=S?.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]=S?.name,t[31]=d,t[32]=P):P=t[32];let F=P,I=a!==void 0,L=_===`configure`&&S?`Initialize ${S.name}`:`Initialize a starter pack`,R=_===`configure`&&S?S.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.`,z;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(z=function(e){f(e),v(`configure`),b.current=!0},t[33]=z):z=t[33];let B=z,V;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(V=function(){v(`pick`),c({kind:`loading`}),b.current=!0},t[34]=V):V=t[34];let H=V,U;t[35]===L?U=t[36]:(U=(0,Z.jsx)(ho,{children:L}),t[35]=L,t[36]=U);let W;t[37]===R?W=t[38]:(W=(0,Z.jsx)(po,{children:R}),t[37]=R,t[38]=W);let G;t[39]!==U||t[40]!==W?(G=(0,Z.jsxs)(wo,{children:[U,W]}),t[39]=U,t[40]=W,t[41]=G):G=t[41];let K;t[42]!==l||t[43]!==s||t[44]!==p||t[45]!==S||t[46]!==_||t[47]!==h?(K=_===`pick`?(0,Z.jsx)(xo,{children:(0,Z.jsx)(lm,{packs:l,onPackSelect:B})}):(0,Z.jsxs)(xo,{className:`space-y-6`,children:[(0,Z.jsx)(bm,{choice:p,subfolder:h,placeholder:S?.defaultSubfolder??`subfolder`,onChoiceChange:m,onSubfolderChange:g}),(0,Z.jsx)(xm,{phase:s,selectedPack:S})]}),t[42]=l,t[43]=s,t[44]=p,t[45]=S,t[46]=_,t[47]=h,t[48]=K):K=t[48];let ee;t[49]!==I||t[50]!==_?(ee=_===`configure`&&!I?(0,Z.jsxs)(J,{className:`mr-auto uppercase font-mono`,variant:`ghost`,onClick:H,children:[(0,Z.jsx)(Oi,{"aria-hidden":`true`,className:`h-4 w-4`}),`Back`]}):null,t[49]=I,t[50]=_,t[51]=ee):ee=t[51];let q;t[52]===r?q=t[53]:(q=()=>r(!1),t[52]=r,t[53]=q);let te=s.kind===`already-seeded`||s.kind===`error`?`Close`:`Cancel`,ne;t[54]!==q||t[55]!==te?(ne=(0,Z.jsx)(J,{className:`uppercase font-mono`,variant:`ghost`,onClick:q,children:te}),t[54]=q,t[55]=te,t[56]=ne):ne=t[56];let re;t[57]!==F||t[58]!==s.kind||t[59]!==_||t[60]!==j?(re=_===`configure`&&s.kind===`plan`?(0,Z.jsx)(J,{onClick:F,disabled:j,children:`Initialize`}):_===`configure`&&s.kind===`applying`?(0,Z.jsxs)(J,{disabled:!0,children:[(0,Z.jsx)(y,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin`}),`Setting up`]}):null,t[57]=F,t[58]=s.kind,t[59]=_,t[60]=j,t[61]=re):re=t[61];let ie;t[62]!==ee||t[63]!==ne||t[64]!==re?(ie=(0,Z.jsxs)(So,{children:[ee,ne,re]}),t[62]=ee,t[63]=ne,t[64]=re,t[65]=ie):ie=t[65];let ae;t[66]!==G||t[67]!==K||t[68]!==ie?(ae=(0,Z.jsxs)(vo,{className:`sm:max-w-3xl`,"data-ok-layer-spawned":``,children:[G,K,ie]}),t[66]=G,t[67]=K,t[68]=ie,t[69]=ae):ae=t[69];let oe;return t[70]!==r||t[71]!==n||t[72]!==ae?(oe=(0,Z.jsx)(To,{open:n,onOpenChange:r,children:ae}),t[70]=r,t[71]=n,t[72]=ae,t[73]=oe):oe=t[73],oe}function ym(e){return e.kind===`plan`||e.kind===`already-seeded`?e:{kind:`loading`}}function bm(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)(Ga,{htmlFor:`seed-root-project-root`,children:(0,Z.jsxs)(wa,{orientation:`horizontal`,children:[(0,Z.jsxs)(Ja,{children:[(0,Z.jsx)(Aa,{children:`Project root`}),(0,Z.jsx)(Ra,{className:`text-1sm`,children:`Scaffold directly under this project.`})]}),(0,Z.jsx)(gm,{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)(Aa,{children:`In a subfolder`}),d=(0,Z.jsx)(Ra,{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)(Ho,{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)(gm,{value:`subfolder`,id:`seed-root-subfolder`}),t[13]=m):m=t[13];let h;t[14]===p?h=t[15]:(h=(0,Z.jsx)(Ga,{htmlFor:`seed-root-subfolder`,children:(0,Z.jsxs)(wa,{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)(hm,{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 xm(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)(y,{"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)(tm,{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(Sm)}):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 Sm(e){return(0,Z.jsx)(`p`,{children:e},e)}var Cm=[{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.`}],wm=Cm.filter(e=>e.id!==`claude-cowork`),Tm=`#settings`;function Em(e){let t=e.target;return t?.tagName===`INPUT`||t?.tagName===`TEXTAREA`||t?.isContentEditable?!1:!!((e.metaKey||e.ctrlKey)&&!e.altKey&&e.key===`,`)}function Dm(e){return e.replace(/^#/,``)===`settings`}function Om(){return typeof window>`u`?``:window.location.hash}function km(){let e=(0,$.c)(4),[t,n]=(0,Q.useState)(jm),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=()=>{n(Dm(Om()))};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=Am,o;return e[2]===t?o=e[3]:(o={open:t,close:a},e[2]=t,e[3]=o),o}function Am(){typeof window>`u`||Dm(Om())&&window.history.back()}function jm(){return Dm(Om())}function Mm(){let e=(0,$.c)(3),[t,n]=(0,Q.useState)(Fm),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(Pm);if(!e||!t.ok)return;let i=yr.safeParse(r);i.success&&n({contentDir:i.data.contentDir,pathSeparator:i.data.pathSeparator})}).catch(Nm),()=>{e=!1}},i=[t],e[0]=t,e[1]=r,e[2]=i),(0,Q.useEffect)(r,i),t}function Nm(e){console.warn(`[useWorkspace] /api/workspace fetch failed:`,e)}function Pm(){return null}function Fm(){return Im()}function Im(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 Lm(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 Rm(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=Xn(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 zm(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?Lm(e):Rm()}var Bm=`ok:skill:cowork:installed`,Vm=`1`,Hm=250,Um=`/api/skill/install-state`;function Wm(e){return`${Bm}:v${e}`}var Gm=new Map;async function Km(e={},t={}){let n=t.force?`__force__`:`__default__`,r=Gm.get(n);if(r)return r;let i=qm(e,t);return Gm.set(n,i),i.finally(()=>{Gm.get(n)===i&&Gm.delete(n)}),i}async function qm(e,t){let n=e.installer===void 0?zm():e.installer,r=Jm(e.storage),i=e.fetchSnapshot??Xm,a=e.serverTimeoutMs??Hm,o=null;if(!t.force){try{o=await Zm(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=Wm(o?.currentVersion??e.fallbackSkillVersion??Ym());if(!t.force&&r?.getItem(s)===Vm)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,Vm)}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 Jm(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function Ym(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function Xm(){let e;try{e=await fetch(Um,{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 Zm(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function Qm(e){return Km({},e)}function $m(){return Km({},{force:!0})}async function eh(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 th(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return eh({target:`claude-cowork`,url:Ur({mode:`cowork`},e)},n);case`claude-code`:return eh({target:`claude-code`,url:Ur({mode:`code`},e)},n);case`codex`:return eh({target:`codex`,url:Zr(e)},n);case`cursor`:return eh({target:`cursor`,url:hr(e),workspacePath:e.projectDir},n);default:{let t=e.target;return{ok:!1,reason:`invalid-payload`,detail:`unknown target: ${String(t)}`}}}}async function nh(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:rh(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:rh(e)}}}function rh(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 ih(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 ah(e,t,n){let r=n===`\\`?t.replaceAll(`/`,`\\`):t;return`${e.endsWith(n)?e.slice(0,-1):e}${n}${r}`}function oh(e){return`${e}.md`}function sh(e){if(!e.docName||!e.workspace)return null;let t=oh(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:{relativePath:t},projectDir:n,docPath:ah(n,t,r)}}function ch(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function lh(e){return!e.workspace?.contentDir||!e.folderAbsPath||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.folderAbsPath,docPath:``}}function uh(e){return nh(e.installUrl).then(()=>void 0)}function dh(e){return`Opened in ${e}.`}function fh(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 ph(e){return e>=3?null:e===2?`Try one more time`:`Retry`}function mh(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 hh(e){return e.docContext===null?e.folderRelativePath?wr(e.folderRelativePath):Rr():Dr(e.docContext.relativePath)}async function gh(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:hh(t)},a=await n.dispatchHandoff(i),o=mh(e,a,n.isElectronHost()?`electron`:`web`,n.now().toISOString());await n.recordHandoff(o);let s=n.getDisplayName(e);if(a.ok)n.toast.success(dh(s));else{let i=ph(r),a=fh(s,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{gh(e,t,n,r+1)}}})}return a}function _h(e){return Cm.find(t=>t.id===e)?.displayName??e}function vh(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function yh(){return{dispatchHandoff:th,recordHandoff:ih,toast:{success:e=>{X.success(e)},error:(e,t)=>{X.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>vh(),getDisplayName:_h,ensureCoworkSkillInstalled:Qm}}function bh(){return{dispatch:(e,t)=>gh(e,t,yh()),reinstallCoworkSkill:$m}}var xh=[...new Set(Cm.flatMap(e=>e.schemes))];function Sh(e,t){let n=t.now?.()??Date.now(),r={};for(let t of Cm){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 Ch(e){return Sh({},e)}async function wh(e){let t=e.schemes??xh,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 Th=Object.fromEntries(xh.map(e=>[e,{installed:!1}]));async function Eh(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 Th}if(!t.ok)return Th;let n;try{n=await t.json()}catch{return Th}if(typeof n!=`object`||!n||Array.isArray(n))return Th;let r=n,i={};for(let e of xh)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function Dh(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 Oh(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Ch({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=Sh(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=!Dh(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 kh(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Ah(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>wh({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>Eh({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function jh(){let e=(0,$.c)(5),[t,n]=(0,Q.useState)(Mh),r=(0,Q.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Oh(Ah());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 Mh(){return Ch({isElectronHost:kh(),now:Date.now})}var Nh=3e3,Ph=(e,t,n)=>ll(e,t,n,`CommandPalette`);function Fh(e){window.location.assign(kr(e))}function Ih(e,t){return e?.kind===`folder`||e?.kind===`folder-index`?e.folderPath:dr(t)}function Lh(e){let t=(0,$.c)(23),{entry:n,query:r,onSelect:i}=e,a=r===void 0?``:r,o=n.kind===`folder`?S:nc,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)(Rh,{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)(Rh,{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)(Rh,{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)(k,{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 Rh(e){let t=(0,$.c)(5),{text:n,query:r}=e,i;t[0]!==r||t[1]!==n?(i=xp(n,r).map(zh),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 zh(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 Bh({searchResults:e,fallbackSearchResults:t,searchStatus:n}){return e.length>0?e:n===`success`?[]:t}function Vh(e){let t=(0,$.c)(113),{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,p]=(0,Q.useState)(u),[m,h]=(0,Q.useState)(`idle`),g;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(g=[],t[1]=g):g=t[1];let[_,v]=(0,Q.useState)(g),y;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(y=[],t[2]=y):y=t[2];let[b,x]=(0,Q.useState)(y),[C,w]=(0,Q.useState)(null),[T,E]=(0,Q.useState)(!1),D;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(D=[],t[3]=D):D=t[3];let[O,A]=(0,Q.useState)(D),[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}=lt(),{pages:W,pageTitles:G,pageMeta:K,folderPaths:ee}=Xr(),q=Mm(),{states:te,refresh:re}=jh(),{dispatch:ie}=bh(),ae=sh({docName:H,workspace:q}),oe=mp(W,ee,G,K),se=op(b,new Set(oe.map(Wh))),le=a?.config.projectPath??null,ue=a?_.filter(e=>e.path!==le):[],de;t[5]!==H||t[6]!==U?(de=Ih(U,H),t[5]=H,t[6]=U,t[7]=de):de=t[7];let fe=de,pe=l===``?[]:yp(oe,l,8),me,he;t[8]!==i||t[9]!==r?(me=()=>{let e=function(e){e.key===`k`&&(Nr()?e.metaKey:e.ctrlKey)&&(e.preventDefault(),i(!r))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},he=[i,r],t[8]=i,t[9]=r,t[10]=me,t[11]=he):(me=t[10],he=t[11]),(0,Q.useEffect)(me,he);let _e,ve;t[12]!==a||t[13]!==r||t[14]!==re?(_e=()=>{if(r){if(x(rp()),re(),a){let e=!1;return Ph(async()=>{let t=await a.project.listRecent();e||v(t)},`Failed to load recent projects.`),()=>{e=!0}}return}s(``),A([]),M(`idle`),R.current=!1,F([]),L(`idle`)},ve=[r,a,re],t[12]=a,t[13]=r,t[14]=re,t[15]=_e,t[16]=ve):(_e=t[15],ve=t[16]),(0,Q.useEffect)(_e,ve);let be;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(be=()=>{B.current&&(B.current.scrollTop=0)},t[17]=be):be=t[17];let xe;t[18]===o?xe=t[19]:(xe=[o],t[18]=o,t[19]=xe),(0,Q.useEffect)(be,xe);let Ce=Ep(c,new Set(O.map(Uh))),we=Ce.kind!==`normal`,Te,Ee;t[20]!==we||t[21]!==r?(Te=()=>{if(!r||!we||R.current)return;R.current=!0,M(`loading`);let e=!1;return Op().then(t=>{e||(A(t),M(`success`))}).catch(t=>{e||(console.error(`[command-palette-tag] fetch tags failed`,t),A([]),M(`error`))}),()=>{e=!0}},Ee=[r,we],t[20]=we,t[21]=r,t[22]=Te,t[23]=Ee):(Te=t[22],Ee=t[23]),(0,Q.useEffect)(Te,Ee);let De=Ce.kind===`tag-docs`?Ce.tagName:null;(0,Q.useEffect)(()=>{if(!r||De===null){F([]),L(`idle`);return}L(`loading`),F([]);let e=!1;return kp(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||we){p([]),h(`idle`);return}let e=new AbortController;h(`loading`);let t=!1,n=window.setTimeout(()=>{t=!0,e.abort(),p([]),h(`error`)},Nh);return Cp(l,{signal:e.signal}).then(e=>{window.clearTimeout(n),p(e),h(`success`)}).catch(e=>{window.clearTimeout(n),!(e instanceof Error&&e.name===`AbortError`&&!t)&&(p([]),h(`error`))}),()=>{window.clearTimeout(n),e.abort()}},[r,l,we]);let Oe;t[24]===i?Oe=t[25]:(Oe=(e,t)=>{let n=t===void 0?`Command failed.`:t;i(!1),Ph(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=ap(rp(),t);ip(n),x(n)},t[26]=Ae):Ae=t[26];let je=Ae,Me;t[27]===i?Me=t[28]:(Me=function(e){i(!1),je(e),Fh(e.path)},t[27]=i,t[28]=Me);let Ne=Me,Pe=!we&&l===``&&se.length>0,Fe=Bh({searchResults:d,fallbackSearchResults:pe,searchStatus:m}),Ie=!we&&Fe.length>0,Le=!we&&l!==``&&m===`loading`&&!Ie,Re;t[29]!==c||t[30]!==we?(Re=!we&&wp(`New file`,c,[`create file`]),t[29]=c,t[30]=we,t[31]=Re):Re=t[31];let ze=Re,Be;t[32]!==c||t[33]!==we?(Be=!we&&wp(`New folder`,c,[`create folder`]),t[32]=c,t[33]=we,t[34]=Be):Be=t[34];let Ve=Be,He;t[35]!==H||t[36]!==c||t[37]!==we?(He=!we&&H!==null&&wp(`Open graph`,c,[`graph panel network`]),t[35]=H,t[36]=c,t[37]=we,t[38]=He):He=t[38];let Ue=He,We;t[39]!==c||t[40]!==we?(We=!we&&wp(`Initialize starter pack`,c,[`scaffold`,`seed`,`pack`,`starter`]),t[39]=c,t[40]=we,t[41]=We):We=t[41];let Ge=We,Ke=!we&&a!==null&&wp(`Open folder on disk`,c,[`project`]),qe=!we&&a!==null&&wp(`Switch Project`,c,[`switch project navigator projects`]),Je=!we&&wp(`Settings`,c,[`preferences config`]),Ye=!we&&wp(`Install for Claude Chat & Cowork (Desktop App)`,c,[`claude desktop install cowork`]),Xe=!we&&a!==null&&ue.length>0&&(l===``||ue.some(e=>wp(`${e.name} ${e.path}`,c,[`recent project`]))),Ze=!we&&ae!==null&&(l===``||wm.some(e=>wp(`Open with AI ${e.displayName}`,c,[e.id,`agent handoff`,`open in`]))),Qe=Ce.kind===`tag-list`?Dp(O,Ce.query):[],$e=Ce.kind===`tag-list`&&j!==`loading`&&Qe.length===0,et=Ce.kind===`tag-docs`&&I===`success`&&P.length===0,tt=we||Pe||Ie||Le||ze||Ve||Ue||Ge||Ke||qe||Je||Ye||Xe||Ze,nt;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(nt=function(e){s(`${Tp}${e}`)},t[42]=nt):nt=t[42];let rt=nt,it=ce,at;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(at={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[43]=at):at=t[43];let ot;t[44]===o?ot=t[45]:(ot=(0,Z.jsx)(ye,{ref:V,value:o,onValueChange:s,placeholder:`Search files, folders, or commands`}),t[44]=o,t[45]=ot);let st;t[46]===we?st=t[47]:(st=()=>{s(we?``:Tp),V.current?.focus()},t[46]=we,t[47]=st);let ct=we?`border-primary/30 bg-primary/10 text-primary`:`border-border bg-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground`,ut;t[48]===ct?ut=t[49]:(ut=Y(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs font-medium transition-colors`,ct),t[48]=ct,t[49]=ut);let dt,ft;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(dt=(0,Z.jsx)(ne,{className:`size-3.5`}),ft=(0,Z.jsx)(`span`,{children:`By tag`}),t[50]=dt,t[51]=ft):(dt=t[50],ft=t[51]);let pt;t[52]!==we||t[53]!==st||t[54]!==ut?(pt=(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:st,"data-testid":`command-palette-filter-tag`,"data-active":we,"aria-pressed":we,className:ut,children:[dt,ft]})}),t[52]=we,t[53]=st,t[54]=ut,t[55]=pt):pt=t[55];let mt=ge,ht;t[56]!==Ie||t[57]!==Le?(ht=Le&&!Ie?(0,Z.jsx)(zt,{children:`Searching`}):null,t[56]=Ie,t[57]=Le,t[58]=ht):ht=t[58];let _t=tt?null:(0,Z.jsx)(zt,{children:m===`error`?`Search failed.`:`No matching commands.`}),vt=Ce.kind===`tag-list`?(0,Z.jsxs)(f,{heading:Ce.query?`Tags matching "${Ce.query}"`:`All tags`,children:[j===`loading`?(0,Z.jsx)(zt,{children:`Loading tags`}):null,j===`error`?(0,Z.jsx)(zt,{children:`Failed to load tags. Press Escape and re-open to retry.`}):null,$e?(0,Z.jsx)(zt,{children:Ce.query?`No tags match "${Ce.query}".`:"No tags yet — author `#tagname` in any doc to populate the index."}):null,Qe.map(e=>(0,Z.jsxs)(k,{value:`tag ${e.name}`,onSelect:()=>rt(e.name),"data-testid":`command-palette-tag-${e.name}`,children:[(0,Z.jsx)(ne,{}),(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,yt;t[59]!==i||t[60]!==Ce||t[61]!==et||t[62]!==P||t[63]!==I?(yt=Ce.kind===`tag-docs`?(0,Z.jsxs)(f,{heading:`Docs tagged #${Ce.tagName}`,children:[I===`loading`?(0,Z.jsx)(zt,{children:`Loading docs`}):null,I===`error`?(0,Z.jsx)(zt,{children:`Failed to load docs. Press Escape and re-open to retry.`}):null,et?(0,Z.jsx)(zt,{children:`No docs registered under #${Ce.tagName}.`}):null,P.map(e=>{let t=e.title||e.docName.split(`/`).pop()||e.docName;return(0,Z.jsxs)(k,{value:`tag-doc ${e.docName}`,onSelect:()=>{i(!1),Fh(e.docName)},"data-testid":`command-palette-tag-doc-${e.docName}`,className:`items-start`,children:[(0,Z.jsx)(nc,{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!==Ce.tagName)?(0,Z.jsxs)(`span`,{className:`truncate text-muted-foreground text-[11px]`,children:[`via`,` `,e.matchingTags.filter(e=>e!==Ce.tagName).map(Hh).join(`, `)]}):null]})]},`tag-doc:${e.docName}`)})]}):null,t[59]=i,t[60]=Ce,t[61]=et,t[62]=P,t[63]=I,t[64]=yt):yt=t[64];let bt=Pe?(0,Z.jsx)(f,{heading:`Recently opened`,children:se.map(e=>(0,Z.jsx)(Lh,{entry:e,onSelect:()=>Ne(e)},np(e.kind,e.path)))}):null,xt;t[65]!==H||t[66]!==i||t[67]!==w||t[68]!==E||t[69]!==ze||t[70]!==Ve||t[71]!==Ue||t[72]!==Ge?(xt=ze||Ve||Ue||Ge?(0,Z.jsxs)(f,{heading:`Commands`,children:[ze?(0,Z.jsxs)(k,{value:`new file create file`,onSelect:()=>{i(!1),w(`file`)},"data-testid":`command-palette-new-file`,children:[(0,Z.jsx)(z,{}),(0,Z.jsx)(`span`,{children:`New file`})]}):null,Ve?(0,Z.jsxs)(k,{value:`new folder create folder`,onSelect:()=>{i(!1),w(`folder`)},"data-testid":`command-palette-new-folder`,children:[(0,Z.jsx)(oc,{}),(0,Z.jsx)(`span`,{children:`New folder`})]}):null,Ue?(0,Z.jsxs)(k,{value:`open graph graph panel network`,onSelect:()=>{H&&(i(!1),Np(`graph`))},"data-testid":`command-palette-open-graph`,children:[(0,Z.jsx)(Cc,{}),(0,Z.jsx)(`span`,{children:`Open graph`})]}):null,Ge?(0,Z.jsxs)(k,{value:`initialize starter pack scaffold seed`,onSelect:()=>{i(!1),E(!0)},"data-testid":`command-palette-initialize-starter-pack`,children:[(0,Z.jsx)(Tc,{}),(0,Z.jsx)(`span`,{children:`Initialize starter pack`})]}):null]}):null,t[65]=H,t[66]=i,t[67]=w,t[68]=E,t[69]=ze,t[70]=Ve,t[71]=Ue,t[72]=Ge,t[73]=xt):xt=t[73];let St=Ze?(0,Z.jsx)(f,{heading:`Open with AI`,children:wm.filter(e=>wp(`Open with AI ${e.displayName}`,c,[e.id,`agent handoff`,`open in`])).map(e=>{let t=te[e.id],n=t.installed===!0&&ae!==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)(k,{value:`send to ai ${e.displayName} ${e.id} agent open in`,disabled:!n,onSelect:()=>{!n||!ae||(i(!1),ie(e.id,ae))},"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,Ct=Ke||qe||Je||Ye||Xe?(0,Z.jsxs)(f,{heading:`Project`,children:[Ke&&a?(0,Z.jsxs)(k,{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)(S,{}),(0,Z.jsx)(`span`,{children:`Open folder on disk`}),(0,Z.jsx)(Se,{children:`⌘O`})]}):null,qe&&a?(0,Z.jsxs)(k,{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)(pc,{}),(0,Z.jsx)(`span`,{children:`Switch Project`}),(0,Z.jsx)(Se,{children:`⌘⇧N`})]}):null,Je?(0,Z.jsxs)(k,{value:`settings preferences config`,onSelect:()=>{i(!1),window.location.hash!==`#settings`&&(window.location.hash=Tm)},"data-testid":`command-palette-settings`,children:[(0,Z.jsx)(zc,{}),(0,Z.jsx)(`span`,{children:`Settings`}),(0,Z.jsx)(Se,{children:`⌘,`})]}):null,Ye?(0,Z.jsxs)(k,{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)(Ri,{}),(0,Z.jsx)(`span`,{children:`Install for Claude Chat & Cowork (Desktop App)`})]}):null,Xe&&a?ue.filter(e=>wp(`${e.name} ${e.path}`,c,[`recent project`])).slice(0,10).map(e=>(0,Z.jsxs)(k,{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)(gt,{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]}):null,wt=Ie?(0,Z.jsx)(f,{heading:`Search`,children:Fe.map(e=>(0,Z.jsx)(Lh,{entry:e,query:l,onSelect:()=>Ne(e)},np(e.kind,e.path)))}):null,Tt;t[74]!==mt||t[75]!==ht||t[76]!==_t||t[77]!==vt||t[78]!==yt||t[79]!==bt||t[80]!==xt||t[81]!==St||t[82]!==Ct||t[83]!==wt?(Tt=(0,Z.jsxs)(mt,{ref:B,className:`subtle-scrollbar`,children:[ht,_t,vt,yt,bt,xt,St,Ct,wt]}),t[74]=mt,t[75]=ht,t[76]=_t,t[77]=vt,t[78]=yt,t[79]=bt,t[80]=xt,t[81]=St,t[82]=Ct,t[83]=wt,t[84]=Tt):Tt=t[84];let Et;t[85]!==it||t[86]!==i||t[87]!==r||t[88]!==at||t[89]!==ot||t[90]!==pt||t[91]!==Tt?(Et=(0,Z.jsxs)(it,{open:r,onOpenChange:i,title:`Workspace Command Palette`,description:`Search files, folders, and commands for the current workspace.`,className:`sm:max-w-2xl`,commandProps:at,children:[ot,pt,Tt]}),t[85]=it,t[86]=i,t[87]=r,t[88]=at,t[89]=ot,t[90]=pt,t[91]=Tt,t[92]=Et):Et=t[92];let Dt=C===`file`,Ot;t[93]===w?Ot=t[94]:(Ot=e=>{e||w(null)},t[93]=w,t[94]=Ot);let kt;t[95]!==fe||t[96]!==Dt||t[97]!==Ot?(kt=(0,Z.jsx)(Gp,{open:Dt,onOpenChange:Ot,kind:`file`,initialDir:fe}),t[95]=fe,t[96]=Dt,t[97]=Ot,t[98]=kt):kt=t[98];let At=C===`folder`,jt;t[99]===w?jt=t[100]:(jt=e=>{e||w(null)},t[99]=w,t[100]=jt);let Mt;t[101]!==fe||t[102]!==At||t[103]!==jt?(Mt=(0,Z.jsx)(Gp,{open:At,onOpenChange:jt,kind:`folder`,initialDir:fe}),t[101]=fe,t[102]=At,t[103]=jt,t[104]=Mt):Mt=t[104];let Nt;t[105]!==T||t[106]!==E?(Nt=(0,Z.jsx)(vm,{open:T,onOpenChange:E}),t[105]=T,t[106]=E,t[107]=Nt):Nt=t[107];let Pt;return t[108]!==Et||t[109]!==kt||t[110]!==Mt||t[111]!==Nt?(Pt=(0,Z.jsxs)(Z.Fragment,{children:[Et,kt,Mt,Nt]}),t[108]=Et,t[109]=kt,t[110]=Mt,t[111]=Nt,t[112]=Pt):Pt=t[112],Pt}function Hh(e){return`#${e}`}function Uh(e){return e.name}function Wh(e){return np(e.kind,e.path)}var Gh=500;function Kh(e,t,n){return t?`terminal`:e===null&&n?`retrying`:`hidden`}function qh(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 Jh(){let e=(0,$.c)(16),{collabUrl:t,collabTerminal:n,collabLastError:r,retryCollab:i}=lt(),[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),Gh);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=Kh(t,n,a);if(l===`hidden`)return null;if(l===`terminal`){let t;e[4]===r?t=e[5]:(t=qh(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 Yh(e){let t=await fetch(`/api/tags/${encodeURIComponent(e)}`);if(!t.ok){let e=await t.json().catch(()=>null);throw Error(Xn(e)??`Server error: ${t.status} ${t.statusText}`)}return(await t.json()).docs??[]}function Xh(){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`}),Yh(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)(wo,{children:(0,Z.jsxs)(ho,{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)(xo,{children:(0,Z.jsx)(Zh,{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)(vo,{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)(To,{open:t,onOpenChange:n,children:_}),e[12]=t,e[13]=_,e[14]=v):v=e[14],v}function Zh(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(Qh)}):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 Qh(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 $h=`raw-mdx-nav`,eg=`ok-editor-mode-v1`,tg=[`wysiwyg`,`source`],ng=`wysiwyg`;function rg(e){return tg.includes(e)}function ig(e=localStorage){try{let t=e.getItem(eg);if(t===null)return ng;if(rg(t))return t;console.warn(`[editor-mode] invalid persisted value, falling back to default`,{raw:t})}catch{}return ng}function ag(e=window,t=localStorage){let n=e.__OK_EDITOR_MODE__;return rg(n)?n:ig(t)}function og(e,t=localStorage){try{return t.setItem(eg,e),!0}catch(e){return console.warn(`[editor-mode] persist failed`,e),!1}}function sg(){let e=(0,$.c)(3),[t,n]=(0,Q.useState)(ag),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=function(e){n(e),og(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 cg(e){let t=(0,$.c)(21),{open:n,onResolved:r}=e,i=Ua(),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)(wo,{children:(0,Z.jsx)(Xi,{})}),t[3]=s):s=t[3];let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(xo,{children:(0,Z.jsx)(ma,{})}),t[4]=c):c=t[4];let l;t[5]===o?l=t[6]:(l=()=>o(!1),t[5]=o,t[6]=l);let u=i===null,d;t[7]!==l||t[8]!==u?(d=(0,Z.jsx)(J,{variant:`ghost`,className:`uppercase font-mono`,onClick:l,disabled:u,children:`Keep disabled`}),t[7]=l,t[8]=u,t[9]=d):d=t[9];let f;t[10]===o?f=t[11]:(f=()=>o(!0),t[10]=o,t[11]=f);let p=i===null,m;t[12]!==f||t[13]!==p?(m=(0,Z.jsx)(J,{onClick:f,disabled:p,children:`Enable auto-sync`}),t[12]=f,t[13]=p,t[14]=m):m=t[14];let h;t[15]!==d||t[16]!==m?(h=(0,Z.jsxs)(vo,{className:`sm:max-w-lg`,showCloseButton:!1,children:[s,c,(0,Z.jsxs)(So,{children:[d,m]})]}),t[15]=d,t[16]=m,t[17]=h):h=t[17];let g;return t[18]!==n||t[19]!==h?(g=(0,Z.jsx)(To,{open:n,onOpenChange:lg,children:h}),t[18]=n,t[19]=h,t[20]=g):g=t[20],g}function lg(){}function ug(e){let t=(0,$.c)(9),{onOpenResolver:n}=e,r=ia();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)(Jr,{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)(J,{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 dg=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 fg(e,t,n,r,i,a){if(e==r)return[];let o=Sg(e,t,n,r,i,a),s=Cg(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 dg(t,n,i,a)];if(c>l){let o=e.slice(t,n).indexOf(r.slice(i,a));if(o>-1)return[new dg(t,t+o,i,i),new dg(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 dg(t,t,i,i+o),new dg(n,n,i+o+c,a)]}if(c==1||l==1)return[new dg(t,n,i,a)];let u=Tg(e,t,n,r,i,a);if(u){let[o,s,c]=u;return fg(e,t,o,r,i,s).concat(fg(e,o+c,n,r,s+c,a))}return gg(e,t,n,r,i,a)}var pg=1e9,mg=0,hg=!1;function gg(e,t,n,r,i,a){let o=n-t,s=a-i;if(pg<1e9&&Math.min(o,s)>pg*16||mg>0&&Date.now()>mg)return Math.min(o,s)>pg*64?[new dg(t,n,i,a)]:Eg(e,t,n,r,i,a);let c=Math.ceil((o+s)/2);vg.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:vg;for(let p=0;p<c;p++){if(p>pg||mg>0&&!(p&63)&&Date.now()>mg)return Eg(e,t,n,r,i,a);let m=vg.advance(p,o,s,c,d,!1,l)||yg.advance(p,o,s,c,f,!0,u);if(m)return bg(e,t,n,t+m[0],r,i,a,i+m[1])}return[new dg(t,n,i,a)]}var _g=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}},vg=new _g,yg=new _g;function bg(e,t,n,r,i,a,o,s){let c=!1;return!Vg(e,r)&&++r==n&&(c=!0),!Vg(i,s)&&++s==o&&(c=!0),c?[new dg(t,n,a,o)]:fg(e,t,r,i,a,s).concat(fg(e,r,n,i,s,o))}function xg(e,t){let n=1,r=Math.min(e,t);for(;n<r;)n<<=1;return n}function Sg(e,t,n,r,i,a){if(t==n||t==a||e.charCodeAt(t)!=r.charCodeAt(i))return 0;let o=xg(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-+!Vg(e,s);o>>=1}else if(i==n||l==a)return i-t;else s=i,c=l}}function Cg(e,t,n,r,i,a){if(t==n||i==a||e.charCodeAt(n-1)!=r.charCodeAt(a-1))return 0;let o=xg(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-+!Vg(e,s);o>>=1}else if(a==t||l==i)return n-a;else s=a,c=l}}function wg(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;;){Vg(e,s)||s++;let u=s+o;if(Vg(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=Sg(e,u,n,r,i+f+d.length,a),c=Cg(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 Tg(e,t,n,r,i,a){let o=n-t,s=a-i;if(o<s){let o=Tg(r,i,a,e,t,n);return o&&[o[1],o[0],o[2]]}return o<4||s*2<o?null:wg(e,t,n,r,i,a,Math.floor(o/4),-1)}function Eg(e,t,n,r,i,a){hg=!0;let o=n-t,s=a-i,c;if(o<s){let s=wg(r,i,a,e,t,n,Math.floor(o/6),50);c=s&&[s[1],s[0],s[2]]}else c=wg(e,t,n,r,i,a,Math.floor(s/6),50);if(!c)return[new dg(t,n,i,a)];let[l,u,d]=c;return fg(e,t,l,r,i,u).concat(fg(e,l+d,n,r,u+d,a))}function Dg(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 dg(r.fromA,i.toA,r.fromB,i.toB),e.splice(n--,1))}}function Og(e,t,n){for(;;){Dg(n,1);let r=!1;for(let i=0;i<n.length;i++){let a=n[i],o,s;(o=Sg(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[i]=new dg(a.fromA+o,a.toA,a.fromB+o,a.toB)),(s=Cg(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[i]=new dg(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 dg(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 dg(a.fromA+d,a.toA+d,a.fromB+d,a.toB+d),r=!0)}if(!r)break}return n}function kg(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=Ig(t,a.fromA,l),f=Fg(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 dg(d,d+o,a.fromB-p,a.toB-p),d=a.fromA,f=Fg(t,a.toA,c-a.toA)):l>m&&t.slice(a.toA,f)==u.slice(h,h+m)&&(a=e[i]=new dg(f-o,f,a.fromB+m,a.toB+m),f=a.toA,d=Ig(t,a.fromA,a.fromA-r)),p=a.fromA-d,m=f-a.toA}if(p||m)a=e[i]=new dg(a.fromA-p,a.toA+m,a.fromB-p,a.toB+m);else if(!o){let t=Rg(n,a.fromB,a.toB),r,o=t<0?-1:Lg(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=Rg(t,a.fromA,a.toA),r,o=n<0?-1:Lg(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 Dg(e,3),e}var Ag;try{Ag=RegExp(`[\\p{Alphabetic}\\p{Number}]`,`u`)}catch{}function jg(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function Mg(e,t){if(t==e.length)return 0;let n=e.charCodeAt(t);return n<192?+!!jg(n):Ag?!zg(n)||t==e.length-1?+!!Ag.test(String.fromCharCode(n)):Ag.test(e.slice(t,t+2))?2:0:0}function Ng(e,t){if(!t)return 0;let n=e.charCodeAt(t-1);return n<192?+!!jg(n):Ag?!Bg(n)||t==1?+!!Ag.test(String.fromCharCode(n)):Ag.test(e.slice(t-2,t))?2:0:0}var Pg=8;function Fg(e,t,n){if(t==e.length||!Ng(e,t))return t;for(let r=t,i=t+n,a=0;a<Pg;a++){let t=Mg(e,r);if(!t||r+t>i)return r;r+=t}return t}function Ig(e,t,n){if(!t||!Mg(e,t))return t;for(let r=t,i=t-n,a=0;a<Pg;a++){let t=Ng(e,r);if(!t||r-t<i)return r;r-=t}return t}function Lg(e,t,n){for(;t!=n;t--)if(e.charCodeAt(t-1)==10)return t;return-1}function Rg(e,t,n){for(;t!=n;t++)if(e.charCodeAt(t)==10)return t;return-1}var zg=e=>e>=55296&&e<=56319,Bg=e=>e>=56320&&e<=57343;function Vg(e,t){return!t||t==e.length||!zg(e.charCodeAt(t-1))||!Bg(e.charCodeAt(t))}function Hg(e,t,n){let r=n?.override;return r?r(e,t):(pg=(n?.scanLimit??1e9)>>1,mg=n?.timeout?Date.now()+n.timeout:0,hg=!1,Og(e,t,fg(e,0,e.length,t,0,t.length)))}function Ug(){return!hg}function Wg(e,t,n){return kg(Hg(e,t,n),e,t)}var Gg=ts.define({combine:e=>e[0]}),Kg=ns.define(),qg=ts.define(),Jg=Xo.define({create(e){return null},update(e,t){for(let n of t.effects)n.is(Kg)&&(e=n.value);for(let n of t.state.facet(qg))e=n(e,t);return e}});function Yg(e){let t=e.field(Jg,!1);if(!t)return null;let n=e.facet(Gg);return{chunks:t,side:n?n.side:null}}var Xg=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 $g(Wg(e.toString(),t.toString(),n),e,t,0,0,Ug())}static updateA(e,t,n,r,i){return r_(n_(e,r,!0,n.length),e,t,n,i)}static updateB(e,t,n,r,i){return r_(n_(e,r,!1,t.length),e,t,n,i)}};function Zg(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 Qg(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 $g(e,t,n,r,i,a){let o=[];for(let s=0;s<e.length;s++){let c=e[s],[l,u]=Zg(c.fromA+r,c.fromB+i,t,n),[d,f]=Qg(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]=Zg(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]=Qg(a.toA+r,a.toB+i,t,n),s++}o.push(new Xg(p,l,Math.max(l,d),u,Math.max(u,f),a))}return o}var e_=1e3;function t_(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 n_(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>e_&&([l,d]=t_(e,a-e_,n,!0)),o<t.length-e_&&([u,f]=t_(e,o+e_,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 r_(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=Wg(n.sliceString(d,p),r.sliceString(f,m),i);for(let e of $g(h,n,r,d,f,Ug()))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 i_={scanLimit:500},a_=rs.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=h_(e))}update(e){(e.docChanged||e.viewportChanged||s_(e.startState,e.state)||c_(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=h_(e.view))}},{decorations:e=>e.deco}),o_=qo.low(ss({class:`cm-changeGutter`,markers:e=>e.plugin(a_)?.gutter||ls.empty}));function s_(e,t){return e.field(Jg,!1)!=t.field(Jg,!1)}function c_(e,t){return e.facet(Gg)!=t.facet(Gg)}var l_=$o.line({class:`cm-changedLine`}),u_=$o.mark({class:`cm-changedText`}),d_=$o.mark({tagName:`ins`,class:`cm-insertedLine`}),f_=$o.mark({tagName:`del`,class:`cm-deletedLine`}),p_=new class extends os{constructor(){super(...arguments),this.elementClass=`cm-changedLineGutter`}};function m_(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,l_),i.add(o,s,n?f_:d_),a&&a.add(o,o,p_);for(let l=t.iterRange(o,s-1),u=o;!l.next().done;){if(l.lineBreak){u++,i.add(u,u,l_),a&&a.add(u,u,p_);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,u_),s<t)c++;else break}u=t}}}function h_(e){let t=e.state.field(Jg),{side:n,highlightChanges:r,markGutter:i,overrideChunk:a}=e.state.facet(Gg),o=n==`a`,s=new es,c=i?new es: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))&&m_(n,e.state.doc,o,r,s,c)}return{deco:s.finish(),gutter:c&&c.finish()}}var g_=class extends Ko{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}},__=ns.define({map:(e,t)=>e.map(t)}),v_=Xo.define({create:()=>$o.none,update:(e,t)=>{for(let e of t.effects)if(e.is(__))return e.value;return e.map(t.changes)},provide:e=>as.decorations.from(e)}),y_=.01;function b_(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 x_(e,t,n){let r=new es,i=new es,a=e.state.field(v_).iter(),o=t.state.field(v_).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,$o.widget({widget:new g_(-n),block:!0,side:-1}))):n>y_&&(u+=n,i.add(c,c,$o.widget({widget:new g_(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,$o.widget({widget:new g_(-p),block:!0,side:1})):p>y_&&i.add(t.state.doc.length,t.state.doc.length,$o.widget({widget:new g_(p),block:!0,side:1}));let m=r.finish(),h=i.finish();b_(m,e.state.field(v_))||e.dispatch({effects:__.of(m)}),b_(h,t.state.field(v_))||t.dispatch({effects:__.of(h)})}var S_=ns.define({map:(e,t)=>t.mapPos(e)}),C_=class extends Ko{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:S_.of(n)});let{side:r,sibling:i}=e.state.facet(Gg);i&&i().dispatch({effects:S_.of(w_(n,e.state.field(Jg),r==`a`))})}),t}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return`collapsed-unchanged-code`}};function w_(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 T_=Xo.define({create(e){return $o.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)n.is(S_)&&(e=e.update({filter:e=>e!=n.value}));return e},provide:e=>as.decorations.from(e)});function E_({margin:e=3,minSize:t=4}){return T_.init(n=>D_(n,e,t))}function D_(e,t,n){let r=new es,i=e.facet(Gg).side==`a`,a=e.field(Jg),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,$o.replace({widget:new C_(d),block:!0})),!c)break;o=e.doc.lineAt(Math.min(e.doc.length,i?c.toA:c.toB)).number}return r.finish()}var O_=as.styleModule.of(new cs({".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`}})),k_=as.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`}}),A_=new is,j_=new is,M_=class{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||i_;let t=[qo.low(a_),k_,O_,v_,as.updateListener.of(e=>{this.measuring<0&&(e.heightChanged||e.viewportChanged)&&!e.transactions.some(e=>e.effects.some(e=>e.is(__)))&&this.measure()})],n=[Gg.of({side:`a`,sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&n.push(o_);let r=Yo.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],as.editorAttributes.of({class:`cm-merge-a`}),j_.of(n),t]}),i=[Gg.of({side:`b`,sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&i.push(o_);let a=Yo.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],as.editorAttributes.of({class:`cm-merge-b`}),j_.of(i),t]});this.chunks=Xg.build(r.doc,a.doc,this.diffConf);let o=[Jg.init(()=>this.chunks),A_.of(e.collapseUnchanged?E_(e.collapseUnchanged):[])];r=r.update({effects:ns.appendConfig.of(o)}).state,a=a.update({effects:ns.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 as({state:r,parent:c,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.a)}),this.b=new as({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),Jo.empty(e[0].startState.doc.length));this.chunks=t==this.a?Xg.updateA(this.chunks,n.newDoc,this.b.state.doc,r,this.diffConf):Xg.updateB(this.chunks,this.a.state.doc,n.newDoc,r,this.diffConf),t.update([...e,n.state.update({effects:Kg.of(this.chunks)})]);let i=t==this.a?this.b:this.a;i.update([i.state.update({effects:Kg.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(Gg),o=n?e.gutter!==!1:r.markGutter,s=t?e.highlightChanges!==!1:r.highlightChanges;i.push(j_.reconfigure([Gg.of({side:`a`,sibling:()=>this.b,highlightChanges:s,markGutter:o}),o?o_:[]])),a.push(j_.reconfigure([Gg.of({side:`b`,sibling:()=>this.a,highlightChanges:s,markGutter:o}),o?o_:[]]))}if(r){let t=A_.reconfigure(e.collapseUnchanged?E_(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(){x_(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=N_(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=N_(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 N_(e){let t=e.nextSibling;return e.remove(),t}var P_=new class extends os{constructor(){super(...arguments),this.elementClass=`cm-deletedLineGutter`}},F_=qo.low(ss({class:`cm-changeGutter`,markers:e=>e.plugin(a_)?.gutter||ls.empty,widgetMarker:(e,t)=>t instanceof B_?P_:null}));function I_(e){let t=typeof e.original==`string`?Qo.of(e.original.split(/\r?\n/)):e.original,n=e.diffConfig||i_;return[qo.low(a_),G_,k_,as.editorAttributes.of({class:`cm-merge-b`}),qg.of((e,t)=>{let r=t.effects.find(e=>e.is(L_));return r&&(e=Xg.updateA(e,r.value.doc,t.startState.doc,r.value.changes,n)),t.docChanged&&(e=Xg.updateB(e,t.state.field(R_),t.newDoc,t.changes,n)),e}),Gg.of({highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1,syntaxHighlightDeletions:e.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:e.mergeControls??!0,overrideChunk:e.allowInlineDiffs?Z_:void 0,side:`b`}),R_.init(()=>t),e.gutter===!1?[]:F_,e.collapseUnchanged?E_(e.collapseUnchanged):[],Jg.init(e=>Xg.build(t,e.doc,n))]}var L_=ns.define(),R_=Xo.define({create:()=>Qo.empty,update(e,t){for(let n of t.effects)n.is(L_)&&(e=n.value.doc);return e}}),z_=new WeakMap,B_=class extends Ko{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=z_.get(t.changes);if(r)return r;let i=$o.widget({block:!0,side:-1,widget:new B_(r=>{let{highlightChanges:i,syntaxHighlightDeletions:a,syntaxHighlightDeletionsMaxLength:o,mergeControls:s}=e.facet(Gg),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(),H_(r,r.posAtDOM(c))},i=e=>{e.preventDefault(),U_(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(R_).sliceString(t.fromA,t.endA),u=a&&e.facet(us),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)==`
14
+ `){d.firstChild||d.appendChild(document.createElement(`br`)),d=h(),r++;continue}let e=t,a=n+(m?` cm-deletedText`:``),o=!1,s=l.indexOf(`
15
+ `,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;Zo(t,{style:t=>ds(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 z_.set(t.changes,i),i}function H_(e,t){let{state:n}=e,r=t??n.selection.main.head,i=e.state.field(Jg).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(R_);i.fromB!=i.toB&&i.toA<=o.length&&(a+=e.state.lineBreak);let s=Jo.of({from:i.fromA,to:Math.min(o.length,i.toA),insert:a},o.length);return e.dispatch({effects:L_.of({doc:s.apply(o),changes:s}),userEvent:`accept`}),!0}function U_(e,t){let{state:n}=e,r=t??n.selection.main.head,i=n.field(Jg).find(e=>e.fromB<=r&&e.endB>=r);if(!i)return!1;let a=n.field(R_).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 W_(e){let t=new es;for(let n of e.field(Jg)){let r=e.facet(Gg).overrideChunk&&q_(e,n);t.add(n.fromB,n.fromB,V_(e,n,!!r))}return t.finish()}var G_=Xo.define({create:e=>W_(e),update(e,t){return t.state.field(Jg,!1)==t.startState.field(Jg,!1)?e:W_(t.state)},provide:e=>as.decorations.from(e)}),K_=new WeakMap;function q_(e,t){let n=K_.get(t);if(n!==void 0)return n;n=null;let r=e.field(R_),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($o.widget({widget:new J_(t),side:-1}).range(s+n.fromB))}n.fromB<n.toB&&e.push(u_.range(s+n.fromB,s+n.toB))}i<t.endA-t.fromA-a*2&&(n=e)}return K_.set(t,n),n}var J_=class extends Ko{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}},Y_=new class extends os{constructor(){super(...arguments),this.elementClass=`cm-inlineChangedLineGutter`}},X_=$o.line({class:`cm-inlineChangedLine`});function Z_(e,t,n,r){let i=q_(e,t),a=0;if(!i)return!1;for(let o=e.doc.lineAt(t.fromB);;){for(r&&r.add(o.from,o.from,Y_),n.add(o.from,o.from,X_);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 Q_=le({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),$_=Mt({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}});function ev(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}=Hr(),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,_;t[3]!==a||t[4]!==i||t[5]!==r||t[6]!==n||t[7]!==u?(g=()=>{if(!c.current)return;let e=u===`dark`?Q_:$_,t=[as.editable.of(!1),Yo.readOnly.of(!0)],o=[ms,v(),...t,e,as.lineWrapping];if(l.current&&=(l.current.destroy(),null),a){let t=new as({doc:r,extensions:[ms,v(),as.editable.of(!1),e,as.lineWrapping,I_({original:n,highlightChanges:!0,gutter:!0,mergeControls:!0,collapseUnchanged:{margin:3,minSize:4}}),as.updateListener.of(e=>{let t=Yg(e.state);m(t?t.chunks.length:0)})],parent:c.current});l.current=t;let i=Yg(t.state);m(i?i.chunks.length:0)}else i===`split`?l.current=new M_({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 as({doc:r,extensions:[...o,I_({original:n,highlightChanges:!0,gutter:!0,mergeControls:!1,collapseUnchanged:{margin:3,minSize:4}})],parent:c.current});return()=>{l.current&&=(l.current.destroy(),null)}},_=[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]=_):(g=t[8],_=t[9]),(0,Q.useEffect)(g,_);let y;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=function(){let e=l.current;!e||!(e instanceof as)||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)(J,{variant:`ghost`,size:`sm`,onClick:s,children:`Exit merge`}),o&&(0,Z.jsx)(J,{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 tv(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)(bo,{"data-slot":`sheet`,...n}),t[2]=n,t[3]=r),r}function nv(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)(Co,{"data-slot":`sheet-portal`,...n}),t[2]=n,t[3]=r),r}function rv(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=Y(`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`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(go,{"data-slot":`sheet-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function iv(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)(rv,{}),t[6]=l):l=t[6];let u;t[7]===r?u=t[8]:(u=Y(`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`,r),t[7]=r,t[8]=u);let d;t[9]===c?d=t[10]:(d=c&&(0,Z.jsx)(yo,{"data-slot":`sheet-close`,asChild:!0,children:(0,Z.jsxs)(J,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,Z.jsx)(fo,{}),(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)(nv,{children:[l,(0,Z.jsxs)(Eo,{"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 av(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=Y(`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 ov(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=Y(`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)(_o,{"data-slot":`sheet-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}async function sv(){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 cv(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 lv(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 uv=`w-[98vw] !max-w-[98vw] h-[96vh] flex flex-col gap-0 sm:!max-w-[98vw]`;function dv(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 cv(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)(wo,{className:`shrink-0`,children:(0,Z.jsxs)(ho,{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)(vo,{className:uv,children:[r,a]}),t[8]=r,t[9]=o);let s;return t[10]!==e||t[11]!==o?(s=(0,Z.jsx)(To,{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)(ho,{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)(wo,{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)(ev,{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)(vo,{className:`${uv} 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)(To,{open:!0,onOpenChange:l,children:m}),t[28]=l,t[29]=m,t[30]=h):h=t[30],h}function fv(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(){sv().then(e=>{let{conflicts:t,error:n}=e;c(n??null),o(t),d(e=>{let n=new Set(t.map(pv));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=()=>Cr(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 lv(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)(ov,{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)(av,{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)(J,{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)(J,{variant:`outline`,size:`xs`,disabled:n,onClick:()=>void E(e.file,`mine`),children:`Keep my version`}),(0,Z.jsx)(J,{variant:`outline`,size:`xs`,disabled:n,onClick:()=>void E(e.file,`theirs`),children:`Keep team's version`}),(0,Z.jsx)(J,{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)(J,{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)(iv,{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)(tv,{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)(dv,{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 pv(e){return e.file}var mv=5;async function hv(e){let t=await fetch(`/api/backlinks?docName=${encodeURIComponent(e)}`),n=await t.json().catch(()=>null);if(!t.ok){let e=An.safeParse(n);throw e.success?Error(e.data.title):new ut(`Failed to parse backlinks error response (HTTP ${t.status})`,{status:t.status})}let r=rr.safeParse(n);if(!r.success)throw new ut(`Backlinks response did not match expected shape.`,{status:t.status});return r.data.backlinks}async function gv(e){let t=await fetch(`/api/forward-links?docName=${encodeURIComponent(e)}`),n=await t.json().catch(()=>null);if(!t.ok){let e=An.safeParse(n);throw e.success?Error(e.data.title):new ut(`Failed to parse forward-links error response (HTTP ${t.status})`,{status:t.status})}let r=oi.safeParse(n);if(!r.success)throw new ut(`Forward-links response did not match expected shape.`,{status:t.status});return r.data.forwardLinks}function _v(e){let t=e.split(`/`);return t.length<=2?e:`…/${t.slice(-2).join(`/`)}`}function vv(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)(I,{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)(ln,{children:n})]}),t[1]=n,t[2]=o);let s;t[3]!==r||t[4]!==i?(s=!i&&(0,Z.jsx)(cn,{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)(Lt,{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 bv(e){let t=(0,$.c)(7),{total:n,expanded:r,onToggle:i}=e;if(n<=mv)return null;let a=n-mv,o;t[0]===r?o=t[1]:(o=r?(0,Z.jsx)(I,{className:`size-3`}):(0,Z.jsx)(T,{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 xv(e){let t=(0,$.c)(38),{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,hoverAction:h}=e,g=o!==void 0&&o!==a,_=r??`text-muted-foreground`,v;t[0]===_?v=t[1]:(v=Y(`mt-0.5 shrink-0`,_),t[0]=_,t[1]=v);let y;t[2]!==n||t[3]!==v?(y=(0,Z.jsx)(`span`,{className:v,children:n}),t[2]=n,t[3]=v,t[4]=y):y=t[4];let b=y,x;t[5]!==u||t[6]!==p||t[7]!==f||t[8]!==d||t[9]!==m||t[10]!==a||t[11]!==l?(x=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:Y(`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]=x):x=t[12];let S=x,C;t[13]===b?C=t[14]:(C=(0,Z.jsx)(`div`,{className:`mt-px flex items-center`,children:b}),t[13]=b,t[14]=C);let w;t[15]!==s||t[16]!==o||t[17]!==g?(w=g?(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]=g,t[18]=w):w=t[18];let T;t[19]===c?T=t[20]:(T=c?(0,Z.jsx)(`p`,{className:`line-clamp-2 text-muted-foreground`,children:c}):null,t[19]=c,t[20]=T);let E;t[21]!==S||t[22]!==w||t[23]!==T?(E=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5 text-1sm`,children:[S,w,T]}),t[21]=S,t[22]=w,t[23]=T,t[24]=E):E=t[24];let D;t[25]===h?D=t[26]:(D=h?(0,Z.jsxs)(Vo,{children:[(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsx)(`button`,{type:`button`,"aria-label":h.tooltip,disabled:h.disabled,className:`relative z-10 shrink-0 cursor-pointer rounded-md p-1 text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:bg-transparent disabled:hover:text-muted-foreground group-hover:opacity-100`,onClick:h.onClick,children:h.icon})}),(0,Z.jsx)(zo,{side:`top`,children:h.tooltip})]}):null,t[25]=h,t[26]=D);let O;t[27]!==C||t[28]!==E||t[29]!==D?(O=(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:[C,E,D]}),t[27]=C,t[28]=E,t[29]=D,t[30]=O):O=t[30];let k=O;if(i){let e;t[31]===k?e=t[32]:(e=(0,Z.jsx)(Ro,{asChild:!0,children:k}),t[31]=k,t[32]=e);let n;t[33]===i?n=t[34]:(n=(0,Z.jsx)(zo,{side:`top`,children:i}),t[33]=i,t[34]=n);let r;return t[35]!==e||t[36]!==n?(r=(0,Z.jsxs)(Vo,{children:[e,n]}),t[35]=e,t[36]=n,t[37]=r):r=t[37],r}return k}function Sv(e){let t=(0,$.c)(33),{docName:n}=e,{folderPaths:r,pages:i,loading:a}=Xr(),o,s;t[0]===n?(o=t[1],s=t[2]):(o=[`backlinks`,n],s=()=>hv(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}=Xt(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,mv),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)(Jt,{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)(tn,{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=co(e.source,{pages:i,folderPaths:r});return(0,Z.jsx)(xv,{icon:(0,Z.jsx)(j,{className:`size-3.5`}),title:e.title,path:_v(e.source),titleHover:e.source,anchor:e.anchor,snippet:e.snippet,href:kr(n.hashDocName,e.anchor)},`${e.source}-${t}`)})}),(0,Z.jsx)(bv,{total:m.length,expanded:h,onToggle:()=>g(Cv)})]}),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)(oe,{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)(R,{defaultOpen:!0,children:[x,C]}),t[30]=C,t[31]=x,t[32]=w):w=t[32],w}function Cv(e){return!e}function wv(e){let t=(0,$.c)(42),{docName:n}=e,{addPage:r,folderPaths:i,pages:a,pagesBySlug:o,loading:s}=Xr(),c,l;t[0]===n?(c=t[1],l=t[2]):(c=[`forward-links`,n],l=()=>gv(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}=Xt(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,mv),t[13]=y,t[14]=g,t[15]=C):C=t[15];let T=C,E;t[16]!==r||t[17]!==_?(E=async function(e,t){if(!_){v(t);try{await he(e,{addPage:r,onCreated:vv}),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]=E):E=t[18];let D=E,O;t[19]!==_||t[20]!==i||t[21]!==D||t[22]!==a||t[23]!==o||t[24]!==s?(O=function(e){if(e.kind===`external`){let t=e.title===e.url;return(0,Z.jsx)(xv,{icon:(0,Z.jsx)(so,{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=w(e.docName,{pages:a,folderPaths:i,pagesBySlug:o}),n=!s&&t.kind===`create`,r=!s&&t.kind===`navigate`&&t.displayState===`folder`,c=_v(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)(xv,{icon:(0,Z.jsx)(Jr,{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 D(n,u)},u)}if(r&&t.kind===`navigate`){let n=be(t);return(0,Z.jsx)(xv,{icon:(0,Z.jsx)(sc,{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,hoverAction:{icon:(0,Z.jsx)(Ui,{className:`size-3.5`}),tooltip:_===u?`Creating index note`:`Create index note`,disabled:_!==null||n===null,onClick:()=>{n&&D(n,u)}}},u)}return(0,Z.jsx)(xv,{icon:(0,Z.jsx)(j,{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]=D,t[22]=a,t[23]=o,t[24]=s,t[25]=O):O=t[25];let k=O,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 M;t[29]!==m||t[30]!==y||t[31]!==p||t[32]!==g.length||t[33]!==k||t[34]!==T?(M=m?(0,Z.jsx)(`div`,{className:`px-3`,children:(0,Z.jsx)(Jt,{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)(tn,{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:T.map(k)}),(0,Z.jsx)(bv,{total:g.length,expanded:y,onToggle:()=>b(Tv)})]}),t[29]=m,t[30]=y,t[31]=p,t[32]=g.length,t[33]=k,t[34]=T,t[35]=M):M=t[35];let N;t[36]!==p||t[37]!==M?(N=(0,Z.jsx)(oe,{children:(0,Z.jsx)(`div`,{className:`px-2 pb-3`,"aria-busy":p,children:M})}),t[36]=p,t[37]=M,t[38]=N):N=t[38];let P;return t[39]!==A||t[40]!==N?(P=(0,Z.jsxs)(R,{defaultOpen:!0,children:[A,N]}),t[39]=A,t[40]=N,t[41]=P):P=t[41],P}function Tv(e){return!e}function Ev(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)(wv,{docName:n}),t[0]=n,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(ya,{}),t[2]=o):o=t[2];let s;t[3]===n?s=t[4]:(s=(0,Z.jsx)(Sv,{docName:n}),t[3]=n,t[4]=s);let c;t[5]!==a||t[6]!==s?(c=(0,Z.jsxs)(on,{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)(un,{className:i,children:c}),t[8]=i,t[9]=c,t[10]=l):l=t[10],l}var Dv=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 Dv{};function Ov(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 kv(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 Av(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 jv(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 Mv(e,t){return Av(e,t,``)}function Nv(e,t){return jv(e,t,``)}function Pv(e,t){return t.slice(0,Fv(e,t))}function Fv(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 Iv(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 Lv(e,t){if(t)return zv(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function Rv(e,t){if(t)return zv(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function zv(e,t){if(!t)return[Rv(e),Lv(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=Iv(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var Bv=`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}`,Vv=RegExp(`[${Bv}]+|\\s+|[^${Bv}]`,`ug`);new class extends Dv{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=Iv(e,r)}else n=e.match(Vv)||[];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)&&Hv(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&Hv(n,i,r,null,t.intlSegmenter),e}};function Hv(e,t,n,r,i){if(t&&n){let[a,o]=zv(t.value,i),[s,c]=zv(n.value,i);if(e){let r=Ov(a,s);e.value=jv(e.value,s,r),t.value=Mv(t.value,r),n.value=Mv(n.value,r)}if(r){let e=kv(o,c);r.value=Av(r.value,c,e),t.value=Nv(t.value,e),n.value=Nv(n.value,e)}}else if(n){if(e){let e=Rv(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=Rv(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=Rv(r.value,i),[a,o]=zv(t.value,i),s=Ov(n,a);t.value=Mv(t.value,s);let c=kv(Mv(n,s),o);t.value=Nv(t.value,c),r.value=Av(r.value,n,c),e.value=jv(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=Rv(r.value,i),n=Pv(Lv(t.value,i),e);t.value=Nv(t.value,n)}else if(e){let n=Pv(Lv(e.value,i),Rv(t.value,i));t.value=Mv(t.value,n)}}new class extends Dv{tokenize(e){let t=RegExp(`(\\r?\\n)|[${Bv}]+|[^\\S\\n\\r]+|[^${Bv}]`,`ug`);return e.match(t)||[]}};var Uv=new class extends Dv{constructor(){super(...arguments),this.tokenize=Gv}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
16
+ `))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
17
+ `))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
18
+ `)&&(e=e.slice(0,-1)),t.endsWith(`
19
+ `)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function Wv(e,t,n){return Uv.diff(e,t,n)}function Gv(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
20
+ `));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 Kv(e){return e==`.`||e==`!`||e==`?`}new class extends Dv{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(Kv(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 Dv{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends Dv{constructor(){super(...arguments),this.tokenize=Gv}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(qv(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 qv(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]=qv(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]=qv(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends Dv{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};var Jv={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function Yv(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;Wv(n,r,Object.assign(Object.assign({},s),{callback:t=>{e(l(t))}}))}else return l(Wv(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||$v(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(`
21
+ `)?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 Xv(e,t){if(t||=Jv,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=>Xv(e,t)).join(`
22
+ `)}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(`
23
+ `)+`
24
+ `}function Zv(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;Yv(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?Xv(e,o.headerOptions):void 0)}}))}else{let s=Yv(e,t,n,r,i,a,o);return s?Xv(s,o?.headerOptions):void 0}}function Qv(e,t,n,r,i,a){return Zv(e,e,t,n,r,i,a)}function $v(e){let t=e.endsWith(`
25
+ `),n=e.split(`
26
+ `).map(e=>e+`
27
+ `);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function ey(e,t){return`${e}\u0000${t}`}function ty(e,t,n){let r=ti(e).body,i=ti(t).body;return r===i?``:Qv(n,r,i,``,``,{context:3})}function ny(e,t,n){let r=(0,$.c)(8),{activeProvider:i}=lt(),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=ey(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=ty(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 ry=(0,Q.lazy)(async()=>({default:(await r(()=>import(`./ActivityPanelDiffView-EaCFURAu.js`),__vite__mapDeps([17,1,7,18]),import.meta.url)).ActivityPanelDiffView}));function iy(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 ay(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function oy(e){return e.slice(0,7)}function sy(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 cy(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)(wi,{...r}),t[3]=r,t[4]=e),e}if(n===`cursor`){let e;return t[5]===r?e=t[6]:(e=(0,Z.jsx)(Ai,{...r}),t[5]=r,t[6]=e),e}if(n===`windsurf`){let e;return t[7]===r?e=t[8]:(e=(0,Z.jsx)(Si,{...r}),t[7]=r,t[8]=e),e}if(n===`openai`){let e;return t[9]===r?e=t[10]:(e=(0,Z.jsx)(Di,{...r}),t[9]=r,t[10]=e),e}if(n===`cline`){let e;return t[11]===r?e=t[12]:(e=(0,Z.jsx)(Fi,{...r}),t[11]=r,t[12]=e),e}if(n===`github`){let e;return t[13]===r?e=t[14]:(e=(0,Z.jsx)(Ni,{...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 ly(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)(cc,{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=Tn(i),t[1]=i,t[2]=a);let o=a,s=r?Mn[o]??En[o]:En[o],c;t[3]!==s||t[4]!==i?(c=s??Wr(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)(cy,{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)(uc,{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)(js,{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)(rl,{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)(js,{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)(rl,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[16]=i):i=t[16],i}function uy(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(dy),t[0]=p):p=t[0];let m;t[1]===d?m=t[2]:(m=d?(0,Z.jsx)(I,{className:`size-3`}):(0,Z.jsx)(T,{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)(Ty,{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 dy(e){return!e}function fy(e){return e.checkpoint?e.checkpoint.kind:`save`}function py(e){let t=fy(e);if(t===`save`)return`Save Version`;let n=e.checkpoint?.size??null,r=n!=null&&n>0?` (${my(n)})`:``;return t===`bridge-merge-loss`?`Auto-saved before a concurrent edit${r}`:`Recovered from an external change${r}`}function my(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/102.4)/10} KB`:`${Math.round(e/104857.6)/10} MB`}function hy(e){return e.type===`checkpoint`?fy(e)===`save`?`version`:`auto-save`:`wip`}var gy={version:`Restore this version`,"auto-save":`Restore this auto-save`,wip:`Restore to this point`},_y={version:`Restore this version?`,"auto-save":`Restore this auto-save?`,wip:`Restore to this point?`};function vy(e){return gy[hy(e)]}function yy(e){return _y[hy(e)]}function by(e){let t=[];for(let n of e.contributors)if(n.summaries)for(let e of n.summaries)t.push(e);return t}function xy(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(Cy),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(Sy)},children:[r?(0,Z.jsx)(I,{className:`size-3`}):(0,Z.jsx)(T,{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 Sy(e){return!e}function Cy(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 wy(e){let t=(0,$.c)(13),{sha:n,docName:r,cache:i,diffLayout:a,panelId:o}=e,s=ny(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)(y,{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)(y,{className:`size-3 animate-spin`}),`Loading diff renderer`]}),children:(0,Z.jsx)(ry,{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 Ty(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=iy(n.timestamp),t[0]=n.timestamp,t[1]=f);let p=f,m;t[2]===n?m=t[3]:(m=sy(n),t[2]=n,t[3]=m);let h=m,g=n.contributors.flatMap(Ey),_;t[4]===n?_=t[5]:(_=by(n),t[4]=n,t[5]=_);let v=_,[b,x]=(0,Q.useState)(!1),[S,C]=(0,Q.useState)(!1),w=(0,Q.useRef)(null),T=(0,Q.useId)(),E,D;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=()=>()=>w.current?.abort(),D=[],t[6]=E,t[7]=D):(E=t[6],D=t[7]),(0,Q.useEffect)(E,D);let O;t[8]!==n.sha||t[9]!==l?(O=()=>l(n.sha),t[8]=n.sha,t[9]=l,t[10]=O):O=t[10];let k=O,A;t[11]===x?A=t[12]:(A=function(){w.current?.abort(),w.current=null,C(!1),x(!1)},t[11]=x,t[12]=A);let j=A,M;t[13]!==s||t[14]!==n.sha||t[15]!==u||t[16]!==x?(M=async function(){C(!0);let e=new AbortController;w.current=e;let t=function(){e.signal.aborted||C(!1),w.current===e&&(w.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)x(!1),u();else{let e=`HTTP ${r.status}`;try{let t=An.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]=x,t[17]=M):M=t[17];let N=M,P;t[18]!==n||t[19]!==i||t[20]!==d?(P=d?(()=>{let e=fy(n);return e===`bridge-merge-loss`?(0,Z.jsx)(Jr,{className:`size-3.5 shrink-0 text-amber-600 dark:text-amber-400`,"aria-hidden":`true`}):e===`external-change-rescue`?(0,Z.jsx)(ec,{className:`size-3.5 shrink-0 text-sky-600 dark:text-sky-400`,"aria-hidden":`true`}):(0,Z.jsx)(Qs,{className:`size-3.5 shrink-0 text-muted-foreground`})})():(0,Z.jsx)(ly,{entry:n,isDark:i}),t[18]=n,t[19]=i,t[20]=d,t[21]=P):P=t[21];let F=P,I=c?T:void 0,L=c?`bg-muted`:`hover:bg-muted/80`,R;t[22]===L?R=t[23]:(R=[`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`,L],t[22]=L,t[23]=R);let z=R.join(` `),B;t[24]===k?B=t[25]:(B=e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),k())},t[24]=k,t[25]=B);let V;t[26]===F?V=t[27]:(V=(0,Z.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:F}),t[26]=F,t[27]=V);let H;t[28]!==h||t[29]!==n||t[30]!==d?(H=d?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`text-xs text-foreground truncate`,children:py(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]=H):H=t[31];let U;t[32]!==n.timestamp||t[33]!==p?(U=(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]=U):U=t[34];let W;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`h-3 w-px shrink-0 bg-border`}),t[35]=W):W=t[35];let G;t[36]===n?G=t[37]:(G=vy(n),t[36]=n,t[37]=G);let K;t[38]===x?K=t[39]:(K=e=>{e.stopPropagation(),x(!0)},t[38]=x,t[39]=K);let ee;t[40]===S?ee=t[41]:(ee=S?(0,Z.jsx)(y,{className:`size-3 animate-spin`}):(0,Z.jsx)(Ti,{className:`size-3`}),t[40]=S,t[41]=ee);let q;t[42]!==S||t[43]!==G||t[44]!==K||t[45]!==ee?(q=(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsx)(J,{variant:`ghost`,size:`icon`,className:`size-5 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`timeline-entry-restore`,"aria-label":G,disabled:S,onClick:K,children:ee})}),t[42]=S,t[43]=G,t[44]=K,t[45]=ee,t[46]=q):q=t[46];let te;t[47]===n?te=t[48]:(te=vy(n),t[47]=n,t[48]=te);let ne;t[49]===te?ne=t[50]:(ne=(0,Z.jsx)(zo,{side:`top`,children:te}),t[49]=te,t[50]=ne);let re;t[51]!==q||t[52]!==ne?(re=(0,Z.jsxs)(Vo,{children:[q,ne]}),t[51]=q,t[52]=ne,t[53]=re):re=t[53];let ie;t[54]!==H||t[55]!==U||t[56]!==re?(ie=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[H,U,W,re]}),t[54]=H,t[55]=U,t[56]=re,t[57]=ie):ie=t[57];let ae;t[58]===v?ae=t[59]:(ae=v.length>0&&(0,Z.jsx)(xy,{summaries:v}),t[58]=v,t[59]=ae);let oe=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}),se;t[60]!==ie||t[61]!==ae||t[62]!==oe?(se=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[ie,ae,oe]}),t[60]=ie,t[61]=ae,t[62]=oe,t[63]=se):se=t[63];let ce;t[64]!==c||t[65]!==k||t[66]!==I||t[67]!==z||t[68]!==B||t[69]!==V||t[70]!==se?(ce=(0,Z.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-expanded":c,"aria-controls":I,"data-testid":`timeline-entry-expand`,className:z,onClick:k,onKeyDown:B,children:[V,se]}),t[64]=c,t[65]=k,t[66]=I,t[67]=z,t[68]=B,t[69]=V,t[70]=se,t[71]=ce):ce=t[71];let le;t[72]!==o||t[73]!==a||t[74]!==T||t[75]!==s||t[76]!==n.sha||t[77]!==c?(le=c&&(0,Z.jsx)(wy,{sha:n.sha,docName:s,cache:o,diffLayout:a,panelId:T}),t[72]=o,t[73]=a,t[74]=T,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 de;t[82]!==j||t[83]!==x?(de=e=>{e?x(!0):j()},t[82]=j,t[83]=x,t[84]=de):de=t[84];let fe;t[85]===n?fe=t[86]:(fe=yy(n),t[85]=n,t[86]=fe);let pe;t[87]===fe?pe=t[88]:(pe=(0,Z.jsx)(ho,{children:fe}),t[87]=fe,t[88]=pe);let me;t[89]===n.timestamp?me=t[90]:(me=ay(n.timestamp),t[89]=n.timestamp,t[90]=me);let he;t[91]===n.sha?he=t[92]:(he=oy(n.sha),t[91]=n.sha,t[92]=he);let ge;t[93]!==p||t[94]!==me||t[95]!==he?(ge=(0,Z.jsxs)(`span`,{className:`font-medium text-foreground`,children:[p,` (`,me,`, `,he,`)`]}),t[93]=p,t[94]=me,t[95]=he,t[96]=ge):ge=t[96];let _e;t[97]===h?_e=t[98]:(_e=(0,Z.jsx)(`span`,{className:`font-medium text-foreground`,children:h}),t[97]=h,t[98]=_e);let ve;t[99]!==ge||t[100]!==_e?(ve=(0,Z.jsxs)(po,{children:[`This will replace the current document content with the version from`,` `,ge,` `,`by `,_e,`. Your current content is already saved in the timeline — you can restore it anytime.`]}),t[99]=ge,t[100]=_e,t[101]=ve):ve=t[101];let ye;t[102]!==pe||t[103]!==ve?(ye=(0,Z.jsxs)(wo,{children:[pe,ve]}),t[102]=pe,t[103]=ve,t[104]=ye):ye=t[104];let be;t[105]===j?be=t[106]:(be=(0,Z.jsx)(J,{variant:`outline`,"data-testid":`timeline-entry-restore-cancel`,onClick:j,children:`Cancel`}),t[105]=j,t[106]=be);let xe;t[107]===N?xe=t[108]:(xe=()=>N(),t[107]=N,t[108]=xe);let Se;t[109]===S?Se=t[110]:(Se=S?(0,Z.jsx)(y,{className:`mr-2 size-4 animate-spin`}):null,t[109]=S,t[110]=Se);let Ce;t[111]!==S||t[112]!==xe||t[113]!==Se?(Ce=(0,Z.jsxs)(J,{variant:`destructive`,"data-testid":`timeline-entry-restore-confirm`,disabled:S,onClick:xe,children:[Se,`Restore`]}),t[111]=S,t[112]=xe,t[113]=Se,t[114]=Ce):Ce=t[114];let we;t[115]!==be||t[116]!==Ce?(we=(0,Z.jsxs)(So,{children:[be,Ce]}),t[115]=be,t[116]=Ce,t[117]=we):we=t[117];let Te;t[118]!==ye||t[119]!==we?(Te=(0,Z.jsxs)(vo,{children:[ye,we]}),t[118]=ye,t[119]=we,t[120]=Te):Te=t[120];let Ee;t[121]!==b||t[122]!==de||t[123]!==Te?(Ee=(0,Z.jsx)(To,{open:b,onOpenChange:de,children:Te}),t[121]=b,t[122]=de,t[123]=Te,t[124]=Ee):Ee=t[124];let De;return t[125]!==ue||t[126]!==Ee?(De=(0,Z.jsxs)(Z.Fragment,{children:[ue,Ee]}),t[125]=ue,t[126]=Ee,t[127]=De):De=t[127],De}function Ey(e){return e.docs}function Dy(e){let t=(0,$.c)(63),{docName:n,diffLayout:r,onDiffLayoutChange:i}=e,{resolvedTheme:a}=Hr(),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)(jy),[g,_]=(0,Q.useState)(Ay),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(ky),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)(Vo,{children:[(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsxs)(Io,{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)(No,{value:`unified`,"aria-label":`Unified diff`,className:`size-6 px-0`,children:(0,Z.jsx)(Lc,{className:`size-3.5`})}),(0,Z.jsx)(No,{value:`split`,"aria-label":`Split diff`,className:`size-6 px-0`,children:(0,Z.jsx)(qs,{className:`size-3.5`})})]})}),(0,Z.jsx)(zo,{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(Oy)}),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)(Ty,{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)(Ty,{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)(uy,{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 Oy(e){return(0,Z.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-lg px-3 py-2.5`,children:[(0,Z.jsx)(Ka,{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)(Ka,{className:`h-3 w-28`}),(0,Z.jsx)(Ka,{className:`h-3 w-40`})]})]},e)}function ky(e){return e.type===`checkpoint`}function Ay(){return new Set}function jy(){return new Ei(32)}var My=[{id:`outline`,label:`Outline`,icon:bc},{id:`links`,label:`Links`,icon:gc},{id:`graph`,label:`Graph`,icon:Cc},{id:`timeline`,label:`Timeline`,icon:Us}];function Ny(){return r(()=>import(`./GraphPanel-DfJ5QIY-.js`),__vite__mapDeps([19,1,20,3,6,7,15,21,22,23,24,25,26,27,28,29,30,31,32,33]),import.meta.url)}var Py=(0,Q.lazy)(async()=>({default:(await Ny()).GraphPanel})),Fy=(0,Q.lazy)(async()=>({default:(await r(()=>import(`./ActivityModeContent-DaTVFKNP.js`),__vite__mapDeps([34,1,2,35,36,37,21,38,39,40,41,20,3,6,7,15,4,8,14,9,23,42]),import.meta.url)).ActivityModeContent}));function Iy(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)(Io,{type:`single`,variant:`outline`,value:i,onValueChange:e=>{e&&a(e)},"aria-label":`Document panels`,children:My.map(Ly)})}):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)(fs,{docName:n,isSourceMode:r}),i===`links`&&(0,Z.jsx)(Ev,{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)(Py,{activeDocName:n})}),i===`timeline`&&(0,Z.jsx)(Dy,{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)(Fy,{})})}),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 Ly(e){let{id:t,label:n,icon:r}=e;return(0,Z.jsxs)(Vo,{children:[(0,Z.jsx)(No,{value:t,role:`tab`,id:`tab-${t}`,"aria-controls":`panel-${t}`,"aria-label":n,asChild:!0,children:(0,Z.jsx)(Ro,{children:(0,Z.jsx)(r,{})})}),(0,Z.jsx)(zo,{side:`bottom`,children:n})]},t)}function Ry(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function zy(e,t){let n=getComputedStyle(e.ownerDocument.body);return t*parseFloat(n.fontSize)}function By(e){return e/100*window.innerHeight}function Vy(e){return e/100*window.innerWidth}function Hy(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 Uy({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=Hy(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=zy(t,i);break;case`em`:r=Ry(t,i);break;case`vh`:r=By(i);break;case`vw`:r=Vy(i);break}return r}function Wy(e){return parseFloat(e.toFixed(3))}function Gy({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 Ky(e){let{panels:t}=e,n=Gy({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=Wy(Uy({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=Wy(Uy({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=Wy(Uy({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=Wy(Uy({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 qy(e,t=`Assertion error`){if(!e)throw Error(t)}function Jy(e,t){return Array.from(t).sort(e===`horizontal`?Yy:Xy)}function Yy(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function Xy(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function Zy(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function Qy(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 $y({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}=Qy(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return qy(i,`No rect found`),i}var eb;function tb(){return eb===void 0&&(eb=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),eb}function nb(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=Jy(n,Array.from(t.children).filter(Zy).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,$y({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=tb()?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:Gy({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 rb=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)}}},ib=new Map,ab=new rb;function ob(e){ib=new Map(ib),ib.delete(e)}function sb(e,t){for(let[t]of ib)if(t.id===e)return t}function cb(e,t){for(let[t,n]of ib)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function lb(){return ib}function ub(e,t){return ab.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function db(e,t){let n=ib.get(e);ib=new Map(ib),ib.set(e,t),ab.emit(`groupChange`,{group:e,prev:n,next:t})}function fb(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=Qy(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 pb(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function mb(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:bb(e),b:bb(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();qy(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:yb(vb(n.a)),b:yb(vb(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 hb=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function gb(e){let t=getComputedStyle(xb(e)??e).display;return t===`flex`||t===`inline-flex`}function _b(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||gb(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`||hb.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function vb(e){let t=e.length;for(;t--;){let n=e[t];if(qy(n,`Missing node`),_b(n))return n}return null}function yb(e){return e&&Number(getComputedStyle(e).zIndex)||0}function bb(e){let t=[];for(;e;)t.push(e),e=xb(e);return t}function xb(e){let{parentNode:t}=e;return pb(t)?t.host:t}function Sb(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 Cb({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!Zy(n)||n.contains(e)||e.contains(n))return!0;if(mb(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(Sb(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function wb(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=nb(r),a=fb(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&Cb({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function Tb(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 Eb(e,t,n=0){return Math.abs(Wy(e)-Wy(t))<=n}function Db(e,t){return Eb(e,t)?0:e>t?1:-1}function Ob({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(Db(r,c)<0)if(a){let e=(i+c)/2;r=Db(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=Wy(r),r}function kb({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(Eb(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;qy(u!=null,`Invalid first pivot index`),qy(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];qy(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(qy(n!=null,`Previous layout not found for panel index ${t}`),Eb(n,i)){let t=o-n;Db(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];qy(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(qy(n!=null,`Previous layout not found for panel index ${t}`),Eb(n,o)){let t=n-i;Db(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];qy(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&Db(i,c)<0)if(e>0){let t=c-o,n=t/2;Db(i+e,c)<0&&(e=Db(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;Db(i-e,c)<0&&(e=Db(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];qy(e!=null,`Previous layout not found for panel index ${r}`);let a=Ob({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];qy(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=Ob({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!Eb(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(Tb(c,l))return i;{let t=e<0?d:u,r=s[t];qy(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=Ob({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!Eb(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];qy(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=Ob({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(Eb(i,s)||(t-=s-i,l[r]=s),Eb(t,0))break;e>0?r--:r++}}}if(!Eb(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 Ab(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||Db(e[n],t[n])!==0)return!1;return!0}function jb({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(!Eb(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];qy(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];qy(i!=null,`No layout data found for index ${e}`);let o=r[e];qy(o!=null,`No layout data found for index ${e}`);let s=Ob({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!Eb(a,0))for(let e=0;e<t.length;e++){let n=r[e];qy(n!=null,`No layout data found for index ${e}`);let i=n+a,o=Ob({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,Eb(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function Mb({groupId:e,panelId:t}){let n=()=>{let t=lb();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=jb({layout:kb({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});Ab(l,p)||db(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&&Eb(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=Gy({group:t});o(Wy(Uy({groupSize:a,panelElement:r,styleProp:e})/a*100))}}}function Nb(e){e.defaultPrevented||wb(e,lb()).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=Mb({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function Pb(e){let t=lb();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 Fb({groupId:e}){let t=()=>{let t=lb();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=jb({layout:e,panelConstraints:r});return n?o:(Ab(o,c)||db(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function Ib(e,t){let n=Pb(e),r=cb(n.id,!0),i=n.separators.find(t=>t.element===e);qy(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);qy(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=Fb({groupId:n.id}).getLayout(),c=jb({layout:kb({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});Ab(s,c)||db(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels})}function Lb(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=Pb(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&Ib(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&Ib(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&Ib(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&Ib(t,-5);break;case`End`:e.preventDefault(),Ib(t,100);break;case`Enter`:{e.preventDefault();let n=Pb(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=cb(n.id,!0),o=n.separators.find(e=>e.element===t);qy(o,`Matching separator not found`);let s=a.get(o);qy(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(qy(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];Ib(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=Pb(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);qy(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(),Ib(t,-100);break}}var Rb={cursorFlags:0,state:`inactive`},zb=new rb;function Bb(){return Rb}function Vb(e){return zb.addListener(`change`,e)}function Hb(e){let t=Rb,n={...Rb};n.cursorFlags=e,Rb=n,zb.emit(`change`,{prev:t,next:n})}function Ub(e){let t=Rb;Rb=e,zb.emit(`change`,{prev:t,next:e})}function Wb(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=lb(),n=wb(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)}),Ub({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}var Gb=e=>e,Kb=()=>{},qb=1,Jb=2,Yb=4,Xb=8,Zb=3,Qb=12,$b;function ex(){return $b===void 0&&($b=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&($b=!0)),$b}function tx({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&&ex()){let t=(e&qb)!==0,n=(e&Jb)!==0,r=(e&Yb)!==0,i=(e&Xb)!==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 ex()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var nx=new WeakMap;function rx(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=nx.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));let r=Bb();switch(r.state){case`active`:case`hover`:{let e=tx({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}nx.set(e,{prevStyle:t,styleSheet:n})}function ix({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=kb({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(Ab(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?qb:Jb;break;case`vertical`:s|=d<0?Yb:Xb;break}}else db(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&Zb:c|=s&Zb,t.movementY===0?c|=o&Qb:c|=s&Qb,Hb(c),rx(e)}function ax(e){let t=lb(),n=Bb();switch(n.state){case`active`:ix({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function ox(e){if(e.defaultPrevented)return;let t=Bb(),n=lb();switch(t.state){case`active`:if(e.buttons===0){Ub({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{let t=cb(e.group.id,!0);db(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)}ix({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=wb(e,n);r.length===0?t.state!==`inactive`&&Ub({cursorFlags:0,state:`inactive`}):Ub({cursorFlags:0,hitRegions:r,state:`hover`}),rx(e.currentTarget);break}}}function sx(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(Bb().state){case`hover`:Ub({cursorFlags:0,state:`inactive`})}}function cx(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=Bb();switch(t.state){case`active`:Ub({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(rx(e.currentTarget),t.hitRegions.forEach(e=>{let t=cb(e.group.id,!0);db(e.group,t)}),e.preventDefault())}}function lx(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=Wy(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=Wy((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function ux(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=Gy({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:Wy(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function dx(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 fx({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=Wy(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]=Wy((r[e]??0)/a*l);else{let e=Wy(l/c.length);for(let t of c)u[t]=e}return u}function px(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 mx=new Map;function hx(e){let t=!0;qy(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=Gy({group:e});if(t===0)return;let n=cb(e.id);if(!n)return;let r=Ky(e),i=n.defaultLayoutDeferred?lx(r):n.layout,a=jb({layout:fx({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&Ab(n.layout,a)&&dx(n.derivedPanelConstraints,r)&&n.groupSize===t)return;db(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else ux(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{qy(!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=Gy({group:e}),s=Ky(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(px(e.panels,l)||(l=void 0));let u=jb({layout:e.mutableState.layouts[c]??l??lx(s),panelConstraints:s}),d=e.element.ownerDocument;mx.set(d,(mx.get(d)??0)+1);let f=new Map;return nb(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),db(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{qy(!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`,Lb)}),mx.get(d)===1&&(d.addEventListener(`dblclick`,Nb,!0),d.addEventListener(`pointerdown`,Wb,!0),d.addEventListener(`pointerleave`,ax),d.addEventListener(`pointermove`,ox),d.addEventListener(`pointerout`,sx),d.addEventListener(`pointerup`,cx,!0)),function(){t=!1,mx.set(d,Math.max(0,(mx.get(d)??0)-1)),ob(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,Lb)}),mx.get(d)||(d.removeEventListener(`dblclick`,Nb,!0),d.removeEventListener(`pointerdown`,Wb,!0),d.removeEventListener(`pointerleave`,ax),d.removeEventListener(`pointermove`,ox),d.removeEventListener(`pointerout`,sx),d.removeEventListener(`pointerup`,cx,!0)),a.disconnect()}}function gx(){let[e,t]=(0,Q.useState)({});return[e,(0,Q.useCallback)(()=>t({}),[])]}function _x(e){let t=(0,Q.useId)();return`${e??t}`}var vx=typeof window<`u`?Q.useLayoutEffect:Q.useEffect;function yx(e){let t=(0,Q.useRef)(e);return vx(()=>{t.current=e},[e]),(0,Q.useCallback)((...e)=>t.current?.(...e),[t])}function bx(...e){return yx(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function xx(e){let t=(0,Q.useRef)({...e});return vx(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var Sx=(0,Q.createContext)(null);function Cx(e,t){let n=(0,Q.useRef)({getLayout:()=>({}),setLayout:Gb});(0,Q.useImperativeHandle)(t,()=>n.current,[]),vx(()=>{Object.assign(n.current,Fb({groupId:e}))})}function wx({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=>{Ab(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=yx(e=>{Ab(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e))}),_=_x(s),v=(0,Q.useRef)(null),[y,b]=gx(),x=(0,Q.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),S=bx(v,a);Cx(_,o);let C=yx((e,t)=>{let r=Bb(),i=sb(e),a=cb(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=xx({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=Jy(u,[...t.panels,e]),b(),()=>{t.panels=t.panels.filter(t=>t!==e),b()}},registerSeparator:e=>{let t=x.current;return t.separators=Jy(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=sb(_),i=cb(_);r&&i&&db(r,{...i,derivedPanelConstraints:Ky(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 vx(()=>{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=hx(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=cb(r.id,!0);!o&&s.length>0&&(h(c),g(c));let l=ub(_,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=Eb(t.collapsedSize,i[t.panelId]),a=Eb(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=Bb().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)(Sx.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})})}wx.displayName=`Group`;function Tx(){let e=(0,Q.useContext)(Sx);return qy(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function Ex(e,t){let{id:n}=Tx(),r=(0,Q.useRef)({collapse:Kb,expand:Kb,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Kb});(0,Q.useImperativeHandle)(t,()=>r.current,[]),vx(()=>{Object.assign(r.current,Mb({groupId:n,panelId:e}))})}function Dx({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=_x(c),_=xx({disabled:a}),v=(0,Q.useRef)(null),y=bx(v,o),{getPanelStyles:b,id:x,orientation:S,registerPanel:C,updatePanelProps:w}=Tx(),T=d!==null,E=yx((e,t,n)=>{d?.(e,c,n)});vx(()=>{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]),Ex(g,f);let D=()=>{let e=b(x,g);if(e)return JSON.stringify(e)},O=(0,Q.useSyncExternalStore)(e=>ub(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:{...Ox,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})})}Dx.displayName=`Panel`;var Ox={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function kx(){return(0,Q.useRef)(null)}function Ax({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=jb({layout:kb({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=jb({layout:kb({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function jx({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=_x(a),l=xx({disabled:n,disableDoubleClick:r}),[u,d]=(0,Q.useState)({}),[f,p]=(0,Q.useState)(`inactive`),m=(0,Q.useRef)(null),h=bx(m,i),{disableCursor:g,id:_,orientation:v,registerSeparator:y,updateSeparatorProps:b}=Tx(),x=v===`horizontal`?`vertical`:`horizontal`;vx(()=>{let e=m.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=y(t),r=Vb(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=ub(_,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(Ax({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})}jx.displayName=`Separator`;function Mx(e){return`/api/asset?path=${encodeURIComponent(e)}`}function Nx(e){let t=(0,$.c)(14),{assetPath:n,mediaKind:r}=e,i;t[0]===n?i=t[1]:(i=Mx(n),t[0]=n,t[1]=i);let a=i,o;t[2]===n?o=t[3]:(o=n.split(`/`).pop()??n,t[2]=n,t[3]=o);let s=o,c;t[4]===s?c=t[5]:(c=s.includes(`.`)?s.split(`.`).pop()?.toUpperCase()??`FILE`:`FILE`,t[4]=s,t[5]=c);let l=c,u;t[6]!==l||t[7]!==s||t[8]!==r||t[9]!==a?(u=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto p-4`,children:r===`image`?(0,Z.jsx)(`img`,{src:a,alt:s,className:`max-h-full max-w-full object-contain`,draggable:!1}):r===`video`?(0,Z.jsx)(`video`,{src:a,controls:!0,className:`max-h-full max-w-full`}):(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:l}),(0,Z.jsx)(`div`,{className:`max-w-full break-words font-medium text-sm`,children:s}),(0,Z.jsx)(`a`,{href:a,className:`rounded-md border px-3 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground`,children:`Open file`})]})}),t[6]=l,t[7]=s,t[8]=r,t[9]=a,t[10]=u):u=t[10];let d;return t[11]!==s||t[12]!==u?(d=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":s,children:u}),t[11]=s,t[12]=u,t[13]=d):d=t[13],d}function Px(){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)(Ka,{className:`h-9 w-2/5 mt-6 mb-5`}),(0,Z.jsx)(Ka,{className:`h-4 w-full`}),(0,Z.jsx)(Ka,{className:`h-4 w-3/4`})]})}),e[0]=t):t=e[0],t}var Fx={"claude-cowork":`claude`,"claude-code":`claude`,codex:`openai`,cursor:`cursor`};function Ix(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}=Hr(),s=Fx[r],c=s?(o===`dark`?Mn[s]:void 0)??En[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=Y(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)(wi,{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)(Ci,{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)(Ai,{style:u,className:p,...i}),t[19]=p,t[20]=u,t[21]=i,t[22]=e):e=t[22],e}return null}function Lx(e){let{installState:t}=e;return t.installed===null?`Detecting`:t.installed===!1?`Not installed`:null}function Rx(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 zx(e){return lr(e)}function Bx(e){return`Opened ${e} in your browser.`}var Vx=`claude.ai`;async function Hx(e,t=nh){(await t(lr(e))).ok?X.success(Bx(Vx)):X.error(`Couldn't open ${Vx} in your browser.`)}function Ux(e){let t=(0,$.c)(73),{target:n,installState:r,isElectronHost:i,prompt:a,onSelect:o}=e,s=e.openExternal??nh,c=e.onWebFallbackSuccess??Gx,l=e.onWebFallbackError??Wx,u;t[0]!==r||t[1]!==i||t[2]!==n?(u=Rx({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=Lx({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(zx(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)(Ix,{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)(Qi,{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)(Ix,{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)(Qi,{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)(Ix,{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)(fa,{"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)(aa,{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)(da,{}),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)(Qi,{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)(Qi,{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)(ua,{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)(Ji,{children:[C,M]}),t[70]=M,t[71]=C,t[72]=N):N=t[72],N}function Wx(){}function Gx(){}function Kx(e){let t=(0,$.c)(12),{className:n}=e,{states:r,refresh:i}=jh(),{dispatch:a}=bh(),o=Mm(),s,c;if(t[0]!==n||t[1]!==a||t[2]!==i||t[3]!==r||t[4]!==o){let e=ch({workspace:o});t[7]===n?s=t[8]:(s=Y(`grid w-full max-w-5xl gap-4 sm:grid-cols-3`,n),t[7]=n,t[8]=s),c=wm.map(t=>{let n=r[t.id]?.installed,o=n===!0?`installed`:n===!1?`missing`:`pending`;return(0,Z.jsx)(qx,{target:t,status:o,onOpen:o===`installed`&&e!==null?()=>{a(t.id,e)}:void 0,onInstall:()=>{uh(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 qx(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)(Ix,{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)(so,{"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 Jx=3100,Yx=3;function Xx(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??Yx;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var Zx={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}},Qx=[`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 $x(e,t={}){let n=t.rng??Math.random,r=t.colors??Qx,i=Zx[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 eS=1.8,tS=90,nS=16,rS=380,iS=.025,aS=.1,oS=.18,sS=400,cS=9.2736,lS=18.1799,uS=14.5244,dS={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function fS(e,t){let{halfWidth:n,apexLift:r}=dS[t];return`M${e-n} ${uS+.3} Q${e} ${uS-r}, ${e+n} ${uS+.3}`}function pS(e){let t=1.5,n=.3;return`M${e-t} ${uS-n} Q${e} ${uS+1.4}, ${e+t} ${uS-n}`}var mS=15,hS=15;function gS(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 _S(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=Xx(g,t);_(n),y(xS),S($x(n)),clearTimeout(w.current),w.current=setTimeout(()=>{_(0),S([])},Jx)},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(bS),S($x(3)),clearTimeout(w.current),w.current=setTimeout(()=>{_(0),S([])},Jx))},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/rS)),C=Math.max(-1,Math.min(1,b/rS)),w=S*nS,T=-C*nS,E=0,D=0;if(x>=1){let e=Math.min(x/tS,1)*eS;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)*aS,i+=(w-i)*aS,u.style.transform=`perspective(${sS}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(E-a)*oS,o+=(D-o)*oS;let k=i*iS,A=-r*iS,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=Y(`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=Y(`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=Y(`ok-blob-eye`,W),t[22]=W,t[23]=G);let K;t[24]===G?K=t[25]:(K=(0,Z.jsx)(`ellipse`,{cx:cS,cy:uS,rx:1.2722,ry:1.9083,className:G}),t[24]=G,t[25]=K);let ee=(F||T)&&`ok-blob-eye-hidden`,q;t[26]===ee?q=t[27]:(q=Y(`ok-blob-eye ok-blob-eye-right`,ee),t[26]=ee,t[27]=q);let te;t[28]===q?te=t[29]:(te=(0,Z.jsx)(`ellipse`,{cx:lS,cy:uS,rx:1.2722,ry:1.9083,className:q}),t[28]=q,t[29]=te);let ne;t[30]===I?ne=t[31]:(ne=fS(cS,I),t[30]=I,t[31]=ne);let re=(!F||T)&&`ok-blob-eye-hidden`,ie;t[32]===re?ie=t[33]:(ie=Y(`ok-blob-happy-eye`,re),t[32]=re,t[33]=ie);let ae;t[34]!==ne||t[35]!==ie?(ae=(0,Z.jsx)(`path`,{d:ne,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:ie}),t[34]=ne,t[35]=ie,t[36]=ae):ae=t[36];let oe;t[37]===I?oe=t[38]:(oe=fS(lS,I),t[37]=I,t[38]=oe);let se=(!F||T)&&`ok-blob-eye-hidden`,ce;t[39]===se?ce=t[40]:(ce=Y(`ok-blob-happy-eye`,se),t[39]=se,t[40]=ce);let le;t[41]!==oe||t[42]!==ce?(le=(0,Z.jsx)(`path`,{d:oe,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:ce}),t[41]=oe,t[42]=ce,t[43]=le):le=t[43];let ue;t[44]===T?ue=t[45]:(ue=T?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`path`,{d:pS(cS),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,Z.jsx)(`path`,{d:pS(lS),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[44]=T,t[45]=ue);let de;t[46]!==K||t[47]!==te||t[48]!==ae||t[49]!==le||t[50]!==ue?(de=(0,Z.jsxs)(`g`,{ref:p,children:[K,te,ae,le,ue]}),t[46]=K,t[47]=te,t[48]=ae,t[49]=le,t[50]=ue,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(vS)},`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:yS,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 vS(e){return(0,Z.jsx)(`circle`,{cx:mS+e.originDx,cy:hS+e.originDy,r:e.size,className:`ok-blob-firework`,style:gS(e)},e.id)}function yS(e){return e.preventDefault()}function bS(e){return e+1}function xS(e){return e+1}function SS(e){let t=(0,$.c)(12),{title:n,subtitle:r,celebrateSignal:i}=e,a;t[0]===i?a=t[1]:(a=(0,Z.jsx)(_S,{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 CS(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=Y(`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 wS(){let e=(0,$.c)(2),t=Nr()?`⌘ K`:`Ctrl K`,n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(CS,{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 TS=`open-knowledge:create-top-level-file`;function ES(){window.dispatchEvent(new CustomEvent(TS))}function DS(e){let t=()=>e();return window.addEventListener(TS,t),()=>window.removeEventListener(TS,t)}function OS(){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(MS);if(e)return;let r=t.ok?Er.safeParse(n):null;r?.success?(o(NS(r.data.documents)),l.current=!0):l.current||=(o(1),!0)}catch{!e&&!l.current&&(o(1),l.current=!0)}};t();let n=Cr(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(jS),500),fetch(`/api/documents`).then(async e=>{let t=await e.json().catch(AS);if(!e.ok)return;let n=Er.safeParse(t);n.success&&o(NS(n.data.documents))}).catch(kS)},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)(PS,{celebrateSignal:s,onPackSelect:e=>{i(e),n(!0)}}):(0,Z.jsx)(FS,{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)(vm,{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 kS(){}function AS(){return null}function jS(e){return e+1}function MS(){return null}function NS(e){return ii(e).filter(e=>e.kind===`document`||e.kind===`folder`).length}function PS(e){let t=(0,$.c)(10),{celebrateSignal:n,onPackSelect:r}=e,i;t[0]===n?i=t[1]:(i=(0,Z.jsx)(SS,{title:`Let's set up your project.`,subtitle:`Pick a starter pack to scaffold folders, templates, and AI-readable rules.`,celebrateSignal:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,Z.jsx)(lm,{onPackSelect:r}),t[2]=r,t[3]=a);let o;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsxs)(J,{variant:`link`,className:`text-muted-foreground font-normal justify-end`,size:`sm`,onClick:ES,children:[`or start from scratch `,(0,Z.jsx)(Ma,{"aria-hidden":`true`,className:`size-3`})]}),t[4]=o):o=t[4];let s;t[5]===a?s=t[6]:(s=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-3`,children:[a,o]}),t[5]=a,t[6]=s);let c;return t[7]!==i||t[8]!==s?(c=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-10 py-12 max-w-5xl my-auto`,children:[i,s]}),t[7]=i,t[8]=s,t[9]=c):c=t[9],c}function FS(e){let t=(0,$.c)(12),{celebrateSignal:n,onAddStarterPack:r}=e,i;t[0]===n?i=t[1]:(i=(0,Z.jsx)(SS,{title:`Open in your favorite AI editor.`,subtitle:`Select a file from the sidebar, or pick where to edit alongside your agent.`,celebrateSignal:n}),t[0]=n,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(Kx,{}),t[2]=a):a=t[2];let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(Ui,{"aria-hidden":`true`,className:`size-3`}),t[3]=o):o=t[3];let s;t[4]===r?s=t[5]:(s=(0,Z.jsxs)(J,{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:[o,`Add a starter pack`]}),t[4]=r,t[5]=s);let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(wS,{}),t[6]=c):c=t[6];let l;t[7]===s?l=t[8]:(l=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-4`,children:[a,(0,Z.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-4`,children:[s,c]})]}),t[7]=s,t[8]=l);let u;return t[9]!==i||t[10]!==l?(u=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-10 py-12 max-w-5xl my-auto`,children:[i,l]}),t[9]=i,t[10]=l,t[11]=u):u=t[11],u}var IS=365.2425,LS=6048e5,RS=864e5,zS=6e4,BS=36e5,VS=1e3,HS=3600*24;HS*7,HS*IS/12*3;var US=Symbol.for(`constructDateFrom`);function WS(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&US in e?e[US](t):e instanceof Date?new e.constructor(t):new Date(t)}function GS(e,t){return WS(t||e,e)}function KS(e,t,n){let r=GS(e,n?.in);return isNaN(t)?WS(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function qS(e,t,n){let r=GS(e,n?.in);if(isNaN(t))return WS(n?.in||e,NaN);if(!t)return r;let i=r.getDate(),a=WS(n?.in||e,r.getTime());return a.setMonth(r.getMonth()+t+1,0),i>=a.getDate()?a:(r.setFullYear(a.getFullYear(),a.getMonth(),i),r)}var JS={};function YS(){return JS}function XS(e,t){let n=YS(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=GS(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function ZS(e,t){return XS(e,{...t,weekStartsOn:1})}function QS(e,t){let n=GS(e,t?.in),r=n.getFullYear(),i=WS(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=ZS(i),o=WS(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=ZS(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function $S(e){let t=GS(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function eC(e,...t){let n=WS.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function tC(e,t){let n=GS(e,t?.in);return n.setHours(0,0,0,0),n}function nC(e,t,n){let[r,i]=eC(n?.in,e,t),a=tC(r),o=tC(i),s=+a-$S(a),c=+o-$S(o);return Math.round((s-c)/RS)}function rC(e,t){let n=QS(e,t),r=WS(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),ZS(r)}function iC(e,t,n){return KS(e,t*7,n)}function aC(e,t,n){return qS(e,t*12,n)}function oC(e,t){let n,r=t?.in;return e.forEach(e=>{!r&&typeof e==`object`&&(r=WS.bind(null,e));let t=GS(e,r);(!n||n<t||isNaN(+t))&&(n=t)}),WS(r,n||NaN)}function sC(e,t){let n,r=t?.in;return e.forEach(e=>{!r&&typeof e==`object`&&(r=WS.bind(null,e));let t=GS(e,r);(!n||n>t||isNaN(+t))&&(n=t)}),WS(r,n||NaN)}function cC(e,t,n){let[r,i]=eC(n?.in,e,t);return+tC(r)==+tC(i)}function lC(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function uC(e){return!(!lC(e)&&typeof e!=`number`||isNaN(+GS(e)))}function dC(e,t,n){let[r,i]=eC(n?.in,e,t),a=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return a*12+o}function fC(e,t){let n=GS(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function pC(e,t){let[n,r]=eC(e,t.start,t.end);return{start:n,end:r}}function mC(e,t){let{start:n,end:r}=pC(t?.in,e),i=+n>+r,a=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0),o.setDate(1);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,i=!i);let c=[];for(;+o<=a;)c.push(WS(n,o)),o.setMonth(o.getMonth()+s);return i?c.reverse():c}function hC(e,t){let n=GS(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function gC(e,t){let n=GS(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function _C(e,t){let n=GS(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function vC(e,t){let{start:n,end:r}=pC(t?.in,e),i=+n>+r,a=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0),o.setMonth(0,1);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,i=!i);let c=[];for(;+o<=a;)c.push(WS(n,o)),o.setFullYear(o.getFullYear()+s);return i?c.reverse():c}function yC(e,t){let n=YS(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=GS(e,t?.in),a=i.getDay(),o=(a<r?-7:0)+6-(a-r);return i.setDate(i.getDate()+o),i.setHours(23,59,59,999),i}function bC(e,t){return yC(e,{...t,weekStartsOn:1})}var xC={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},SC=(e,t,n)=>{let r,i=xC[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function CC(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var wC={date:CC({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:CC({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:CC({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},TC={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},EC=(e,t,n,r)=>TC[e];function DC(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var OC={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:DC({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:DC({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:DC({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:DC({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:DC({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function kC(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?jC(s,e=>e.test(o)):AC(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function AC(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function jC(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function MC(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var NC={code:`en-US`,formatDistance:SC,formatLong:wC,formatRelative:EC,localize:OC,match:{ordinalNumber:MC({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:kC({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:kC({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:kC({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:kC({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:kC({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function PC(e,t){let n=GS(e,t?.in);return nC(n,_C(n))+1}function FC(e,t){let n=GS(e,t?.in),r=ZS(n)-+rC(n);return Math.round(r/LS)+1}function IC(e,t){let n=GS(e,t?.in),r=n.getFullYear(),i=YS(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=WS(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=XS(o,t),c=WS(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=XS(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function LC(e,t){let n=YS(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=IC(e,t),a=WS(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),XS(a,t)}function RC(e,t){let n=GS(e,t?.in),r=XS(n,t)-+LC(n,t);return Math.round(r/LS)+1}function zC(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var BC={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return zC(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):zC(n+1,2)},d(e,t){return zC(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return zC(e.getHours()%12||12,t.length)},H(e,t){return zC(e.getHours(),t.length)},m(e,t){return zC(e.getMinutes(),t.length)},s(e,t){return zC(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return zC(Math.trunc(r*10**(n-3)),t.length)}},VC={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},HC={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return BC.y(e,t)},Y:function(e,t,n,r){let i=IC(e,r),a=i>0?i:1-i;return t===`YY`?zC(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):zC(a,t.length)},R:function(e,t){return zC(QS(e),t.length)},u:function(e,t){return zC(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return zC(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return zC(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return BC.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return zC(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=RC(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):zC(i,t.length)},I:function(e,t,n){let r=FC(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):zC(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):BC.d(e,t)},D:function(e,t,n){let r=PC(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):zC(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return zC(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return zC(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return zC(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?VC.noon:r===0?VC.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?VC.evening:r>=12?VC.afternoon:r>=4?VC.morning:VC.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return BC.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):BC.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):zC(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):zC(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):BC.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):BC.s(e,t)},S:function(e,t){return BC.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return WC(r);case`XXXX`:case`XX`:return GC(r);default:return GC(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return WC(r);case`xxxx`:case`xx`:return GC(r);default:return GC(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+UC(r,`:`);default:return`GMT`+GC(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+UC(r,`:`);default:return`GMT`+GC(r,`:`)}},t:function(e,t,n){return zC(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return zC(+e,t.length)}};function UC(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+zC(a,2)}function WC(e,t){return e%60==0?(e>0?`-`:`+`)+zC(Math.abs(e)/60,2):GC(e,t)}function GC(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=zC(Math.trunc(r/60),2),a=zC(r%60,2);return n+i+t+a}var KC=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},qC=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},JC={p:qC,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return KC(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,KC(r,t)).replace(`{{time}}`,qC(i,t))}},YC=/^D+$/,XC=/^Y+$/,ZC=[`D`,`DD`,`YY`,`YYYY`];function QC(e){return YC.test(e)}function $C(e){return XC.test(e)}function ew(e,t,n){let r=tw(e,t,n);if(console.warn(r),ZC.includes(e))throw RangeError(r)}function tw(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var nw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,iw=/^'([^]*?)'?$/,aw=/''/g,ow=/[a-zA-Z]/;function sw(e,t,n){let r=YS(),i=n?.locale??r.locale??NC,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=GS(e,n?.in);if(!uC(s))throw RangeError(`Invalid time value`);let c=t.match(rw).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=JC[t];return n(e,i.formatLong)}return e}).join(``).match(nw).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:cw(e)};if(HC[t])return{isToken:!0,value:e};if(t.match(ow))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&$C(a)||!n?.useAdditionalDayOfYearTokens&&QC(a))&&ew(a,t,String(e));let o=HC[a[0]];return o(s,a,i.localize,l)}).join(``)}function cw(e){let t=e.match(iw);return t?t[1].replace(aw,`'`):e}function lw(e,t){let n=GS(e,t?.in),r=n.getFullYear(),i=n.getMonth(),a=WS(n,0);return a.setFullYear(r,i+1,0),a.setHours(0,0,0,0),a.getDate()}function uw(){return Object.assign({},YS())}function dw(e,t){let n=GS(e,t?.in).getDay();return n===0?7:n}function fw(e,t){return GS(e,t?.in).getMonth()}function pw(e,t){return GS(e,t?.in).getFullYear()}function mw(e,t){return+GS(e)>+GS(t)}function hw(e,t){return+GS(e)<+GS(t)}function gw(e,t){let n=_w(t)?new t(0):WS(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function _w(e){return typeof e==`function`&&e.prototype?.constructor===e}var vw=10,yw=class{subPriority=0;validate(e,t){return!0}},bw=class extends yw{constructor(e,t,n,r,i){super(),this.value=e,this.validateValue=t,this.setValue=n,this.priority=r,i&&(this.subPriority=i)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,n){return this.setValue(e,t,this.value,n)}},xw=class extends yw{priority=vw;subPriority=-1;constructor(e,t){super(),this.context=e||(e=>WS(t,e))}set(e,t){return t.timestampIsSet?e:WS(e,gw(e,this.context))}},Sw=class{run(e,t,n,r){let i=this.parse(e,t,n,r);return i?{setter:new bw(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(e,t,n){return!0}},Cw=class extends Sw{priority=140;parse(e,t,n){switch(t){case`G`:case`GG`:case`GGG`:return n.era(e,{width:`abbreviated`})||n.era(e,{width:`narrow`});case`GGGGG`:return n.era(e,{width:`narrow`});default:return n.era(e,{width:`wide`})||n.era(e,{width:`abbreviated`})||n.era(e,{width:`narrow`})}}set(e,t,n){return t.era=n,e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`R`,`u`,`t`,`T`]},ww={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Tw={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Ew(e,t){return e&&{value:t(e.value),rest:e.rest}}function Dw(e,t){let n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function Ow(e,t){let n=t.match(e);if(!n)return null;if(n[0]===`Z`)return{value:0,rest:t.slice(1)};let r=n[1]===`+`?1:-1,i=n[2]?parseInt(n[2],10):0,a=n[3]?parseInt(n[3],10):0,o=n[5]?parseInt(n[5],10):0;return{value:r*(i*BS+a*zS+o*VS),rest:t.slice(n[0].length)}}function kw(e){return Dw(ww.anyDigitsSigned,e)}function Aw(e,t){switch(e){case 1:return Dw(ww.singleDigit,t);case 2:return Dw(ww.twoDigits,t);case 3:return Dw(ww.threeDigits,t);case 4:return Dw(ww.fourDigits,t);default:return Dw(RegExp(`^\\d{1,`+e+`}`),t)}}function jw(e,t){switch(e){case 1:return Dw(ww.singleDigitSigned,t);case 2:return Dw(ww.twoDigitsSigned,t);case 3:return Dw(ww.threeDigitsSigned,t);case 4:return Dw(ww.fourDigitsSigned,t);default:return Dw(RegExp(`^-?\\d{1,`+e+`}`),t)}}function Mw(e){switch(e){case`morning`:return 4;case`evening`:return 17;case`pm`:case`noon`:case`afternoon`:return 12;default:return 0}}function Nw(e,t){let n=t>0,r=n?t:1-t,i;if(r<=50)i=e||100;else{let t=r+50,n=Math.trunc(t/100)*100,a=e>=t%100;i=e+n-(a?100:0)}return n?i:1-i}function Pw(e){return e%400==0||e%4==0&&e%100!=0}var Fw=class extends Sw{priority=130;incompatibleTokens=[`Y`,`R`,`u`,`w`,`I`,`i`,`e`,`c`,`t`,`T`];parse(e,t,n){let r=e=>({year:e,isTwoDigitYear:t===`yy`});switch(t){case`y`:return Ew(Aw(4,e),r);case`yo`:return Ew(n.ordinalNumber(e,{unit:`year`}),r);default:return Ew(Aw(t.length,e),r)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n){let r=e.getFullYear();if(n.isTwoDigitYear){let t=Nw(n.year,r);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}let i=!(`era`in t)||t.era===1?n.year:1-n.year;return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}},Iw=class extends Sw{priority=130;parse(e,t,n){let r=e=>({year:e,isTwoDigitYear:t===`YY`});switch(t){case`Y`:return Ew(Aw(4,e),r);case`Yo`:return Ew(n.ordinalNumber(e,{unit:`year`}),r);default:return Ew(Aw(t.length,e),r)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n,r){let i=IC(e,r);if(n.isTwoDigitYear){let t=Nw(n.year,i);return e.setFullYear(t,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),XS(e,r)}let a=!(`era`in t)||t.era===1?n.year:1-n.year;return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),XS(e,r)}incompatibleTokens=[`y`,`R`,`u`,`Q`,`q`,`M`,`L`,`I`,`d`,`D`,`i`,`t`,`T`]},Lw=class extends Sw{priority=130;parse(e,t){return jw(t===`R`?4:t.length,e)}set(e,t,n){let r=WS(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),ZS(r)}incompatibleTokens=[`G`,`y`,`Y`,`u`,`Q`,`q`,`M`,`L`,`w`,`d`,`D`,`e`,`c`,`t`,`T`]},Rw=class extends Sw{priority=130;parse(e,t){return jw(t===`u`?4:t.length,e)}set(e,t,n){return e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`G`,`y`,`Y`,`R`,`w`,`I`,`i`,`e`,`c`,`t`,`T`]},zw=class extends Sw{priority=120;parse(e,t,n){switch(t){case`Q`:case`QQ`:return Aw(t.length,e);case`Qo`:return n.ordinalNumber(e,{unit:`quarter`});case`QQQ`:return n.quarter(e,{width:`abbreviated`,context:`formatting`})||n.quarter(e,{width:`narrow`,context:`formatting`});case`QQQQQ`:return n.quarter(e,{width:`narrow`,context:`formatting`});default:return n.quarter(e,{width:`wide`,context:`formatting`})||n.quarter(e,{width:`abbreviated`,context:`formatting`})||n.quarter(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`M`,`L`,`w`,`I`,`d`,`D`,`i`,`e`,`c`,`t`,`T`]},Bw=class extends Sw{priority=120;parse(e,t,n){switch(t){case`q`:case`qq`:return Aw(t.length,e);case`qo`:return n.ordinalNumber(e,{unit:`quarter`});case`qqq`:return n.quarter(e,{width:`abbreviated`,context:`standalone`})||n.quarter(e,{width:`narrow`,context:`standalone`});case`qqqqq`:return n.quarter(e,{width:`narrow`,context:`standalone`});default:return n.quarter(e,{width:`wide`,context:`standalone`})||n.quarter(e,{width:`abbreviated`,context:`standalone`})||n.quarter(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`Q`,`M`,`L`,`w`,`I`,`d`,`D`,`i`,`e`,`c`,`t`,`T`]},Vw=class extends Sw{incompatibleTokens=[`Y`,`R`,`q`,`Q`,`L`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`];priority=110;parse(e,t,n){let r=e=>e-1;switch(t){case`M`:return Ew(Dw(ww.month,e),r);case`MM`:return Ew(Aw(2,e),r);case`Mo`:return Ew(n.ordinalNumber(e,{unit:`month`}),r);case`MMM`:return n.month(e,{width:`abbreviated`,context:`formatting`})||n.month(e,{width:`narrow`,context:`formatting`});case`MMMMM`:return n.month(e,{width:`narrow`,context:`formatting`});default:return n.month(e,{width:`wide`,context:`formatting`})||n.month(e,{width:`abbreviated`,context:`formatting`})||n.month(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}},Hw=class extends Sw{priority=110;parse(e,t,n){let r=e=>e-1;switch(t){case`L`:return Ew(Dw(ww.month,e),r);case`LL`:return Ew(Aw(2,e),r);case`Lo`:return Ew(n.ordinalNumber(e,{unit:`month`}),r);case`LLL`:return n.month(e,{width:`abbreviated`,context:`standalone`})||n.month(e,{width:`narrow`,context:`standalone`});case`LLLLL`:return n.month(e,{width:`narrow`,context:`standalone`});default:return n.month(e,{width:`wide`,context:`standalone`})||n.month(e,{width:`abbreviated`,context:`standalone`})||n.month(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`M`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`]};function Uw(e,t,n){let r=GS(e,n?.in),i=RC(r,n)-t;return r.setDate(r.getDate()-i*7),GS(r,n?.in)}var Ww=class extends Sw{priority=100;parse(e,t,n){switch(t){case`w`:return Dw(ww.week,e);case`wo`:return n.ordinalNumber(e,{unit:`week`});default:return Aw(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n,r){return XS(Uw(e,n,r),r)}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`i`,`t`,`T`]};function Gw(e,t,n){let r=GS(e,n?.in),i=FC(r,n)-t;return r.setDate(r.getDate()-i*7),r}var Kw=class extends Sw{priority=100;parse(e,t,n){switch(t){case`I`:return Dw(ww.week,e);case`Io`:return n.ordinalNumber(e,{unit:`week`});default:return Aw(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n){return ZS(Gw(e,n))}incompatibleTokens=[`y`,`Y`,`u`,`q`,`Q`,`M`,`L`,`w`,`d`,`D`,`e`,`c`,`t`,`T`]},qw=[31,28,31,30,31,30,31,31,30,31,30,31],Jw=[31,29,31,30,31,30,31,31,30,31,30,31],Yw=class extends Sw{priority=90;subPriority=1;parse(e,t,n){switch(t){case`d`:return Dw(ww.date,e);case`do`:return n.ordinalNumber(e,{unit:`date`});default:return Aw(t.length,e)}}validate(e,t){let n=Pw(e.getFullYear()),r=e.getMonth();return n?t>=1&&t<=Jw[r]:t>=1&&t<=qw[r]}set(e,t,n){return e.setDate(n),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`]},Xw=class extends Sw{priority=90;subpriority=1;parse(e,t,n){switch(t){case`D`:case`DD`:return Dw(ww.dayOfYear,e);case`Do`:return n.ordinalNumber(e,{unit:`date`});default:return Aw(t.length,e)}}validate(e,t){return Pw(e.getFullYear())?t>=1&&t<=366:t>=1&&t<=365}set(e,t,n){return e.setMonth(0,n),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`M`,`L`,`w`,`I`,`d`,`E`,`i`,`e`,`c`,`t`,`T`]};function Zw(e,t,n){let r=YS(),i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=GS(e,n?.in),o=a.getDay(),s=(t%7+7)%7,c=7-i;return KS(a,t<0||t>6?t-(o+c)%7:(s+c)%7-(o+c)%7,n)}var Qw=class extends Sw{priority=90;parse(e,t,n){switch(t){case`E`:case`EE`:case`EEE`:return n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});case`EEEEE`:return n.day(e,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});default:return n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=Zw(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`D`,`i`,`e`,`c`,`t`,`T`]},$w=class extends Sw{priority=90;parse(e,t,n,r){let i=e=>{let t=Math.floor((e-1)/7)*7;return(e+r.weekStartsOn+6)%7+t};switch(t){case`e`:case`ee`:return Ew(Aw(t.length,e),i);case`eo`:return Ew(n.ordinalNumber(e,{unit:`day`}),i);case`eee`:return n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});case`eeeee`:return n.day(e,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});default:return n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=Zw(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`E`,`i`,`c`,`t`,`T`]},eT=class extends Sw{priority=90;parse(e,t,n,r){let i=e=>{let t=Math.floor((e-1)/7)*7;return(e+r.weekStartsOn+6)%7+t};switch(t){case`c`:case`cc`:return Ew(Aw(t.length,e),i);case`co`:return Ew(n.ordinalNumber(e,{unit:`day`}),i);case`ccc`:return n.day(e,{width:`abbreviated`,context:`standalone`})||n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`});case`ccccc`:return n.day(e,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`});default:return n.day(e,{width:`wide`,context:`standalone`})||n.day(e,{width:`abbreviated`,context:`standalone`})||n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=Zw(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`E`,`i`,`e`,`t`,`T`]};function tT(e,t,n){let r=GS(e,n?.in);return KS(r,t-dw(r,n),n)}var nT=class extends Sw{priority=90;parse(e,t,n){let r=e=>e===0?7:e;switch(t){case`i`:case`ii`:return Aw(t.length,e);case`io`:return n.ordinalNumber(e,{unit:`day`});case`iii`:return Ew(n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r);case`iiiii`:return Ew(n.day(e,{width:`narrow`,context:`formatting`}),r);case`iiiiii`:return Ew(n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r);default:return Ew(n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r)}}validate(e,t){return t>=1&&t<=7}set(e,t,n){return e=tT(e,n),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`Y`,`u`,`q`,`Q`,`M`,`L`,`w`,`d`,`D`,`E`,`e`,`c`,`t`,`T`]},rT=class extends Sw{priority=80;parse(e,t,n){switch(t){case`a`:case`aa`:case`aaa`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`aaaaa`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(Mw(n),0,0,0),e}incompatibleTokens=[`b`,`B`,`H`,`k`,`t`,`T`]},iT=class extends Sw{priority=80;parse(e,t,n){switch(t){case`b`:case`bb`:case`bbb`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`bbbbb`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(Mw(n),0,0,0),e}incompatibleTokens=[`a`,`B`,`H`,`k`,`t`,`T`]},aT=class extends Sw{priority=80;parse(e,t,n){switch(t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`BBBBB`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(Mw(n),0,0,0),e}incompatibleTokens=[`a`,`b`,`t`,`T`]},oT=class extends Sw{priority=70;parse(e,t,n){switch(t){case`h`:return Dw(ww.hour12h,e);case`ho`:return n.ordinalNumber(e,{unit:`hour`});default:return Aw(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,n){let r=e.getHours()>=12;return r&&n<12?e.setHours(n+12,0,0,0):!r&&n===12?e.setHours(0,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=[`H`,`K`,`k`,`t`,`T`]},sT=class extends Sw{priority=70;parse(e,t,n){switch(t){case`H`:return Dw(ww.hour23h,e);case`Ho`:return n.ordinalNumber(e,{unit:`hour`});default:return Aw(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,n){return e.setHours(n,0,0,0),e}incompatibleTokens=[`a`,`b`,`h`,`K`,`k`,`t`,`T`]},cT=class extends Sw{priority=70;parse(e,t,n){switch(t){case`K`:return Dw(ww.hour11h,e);case`Ko`:return n.ordinalNumber(e,{unit:`hour`});default:return Aw(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.getHours()>=12&&n<12?e.setHours(n+12,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=[`h`,`H`,`k`,`t`,`T`]},lT=class extends Sw{priority=70;parse(e,t,n){switch(t){case`k`:return Dw(ww.hour24h,e);case`ko`:return n.ordinalNumber(e,{unit:`hour`});default:return Aw(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,n){let r=n<=24?n%24:n;return e.setHours(r,0,0,0),e}incompatibleTokens=[`a`,`b`,`h`,`H`,`K`,`t`,`T`]},uT=class extends Sw{priority=60;parse(e,t,n){switch(t){case`m`:return Dw(ww.minute,e);case`mo`:return n.ordinalNumber(e,{unit:`minute`});default:return Aw(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setMinutes(n,0,0),e}incompatibleTokens=[`t`,`T`]},dT=class extends Sw{priority=50;parse(e,t,n){switch(t){case`s`:return Dw(ww.second,e);case`so`:return n.ordinalNumber(e,{unit:`second`});default:return Aw(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setSeconds(n,0),e}incompatibleTokens=[`t`,`T`]},fT=class extends Sw{priority=30;parse(e,t){return Ew(Aw(t.length,e),e=>Math.trunc(e*10**(-t.length+3)))}set(e,t,n){return e.setMilliseconds(n),e}incompatibleTokens=[`t`,`T`]},pT=class extends Sw{priority=10;parse(e,t){switch(t){case`X`:return Ow(Tw.basicOptionalMinutes,e);case`XX`:return Ow(Tw.basic,e);case`XXXX`:return Ow(Tw.basicOptionalSeconds,e);case`XXXXX`:return Ow(Tw.extendedOptionalSeconds,e);default:return Ow(Tw.extended,e)}}set(e,t,n){return t.timestampIsSet?e:WS(e,e.getTime()-$S(e)-n)}incompatibleTokens=[`t`,`T`,`x`]},mT=class extends Sw{priority=10;parse(e,t){switch(t){case`x`:return Ow(Tw.basicOptionalMinutes,e);case`xx`:return Ow(Tw.basic,e);case`xxxx`:return Ow(Tw.basicOptionalSeconds,e);case`xxxxx`:return Ow(Tw.extendedOptionalSeconds,e);default:return Ow(Tw.extended,e)}}set(e,t,n){return t.timestampIsSet?e:WS(e,e.getTime()-$S(e)-n)}incompatibleTokens=[`t`,`T`,`X`]},hT=class extends Sw{priority=40;parse(e){return kw(e)}set(e,t,n){return[WS(e,n*1e3),{timestampIsSet:!0}]}incompatibleTokens=`*`},gT=class extends Sw{priority=20;parse(e){return kw(e)}set(e,t,n){return[WS(e,n),{timestampIsSet:!0}]}incompatibleTokens=`*`},_T={G:new Cw,y:new Fw,Y:new Iw,R:new Lw,u:new Rw,Q:new zw,q:new Bw,M:new Vw,L:new Hw,w:new Ww,I:new Kw,d:new Yw,D:new Xw,E:new Qw,e:new $w,c:new eT,i:new nT,a:new rT,b:new iT,B:new aT,h:new oT,H:new sT,K:new cT,k:new lT,m:new uT,s:new dT,S:new fT,X:new pT,x:new mT,t:new hT,T:new gT},vT=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,yT=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,bT=/^'([^]*?)'?$/,xT=/''/g,ST=/\S/,CT=/[a-zA-Z]/;function wT(e,t,n,r){let i=()=>WS(r?.in||n,NaN),a=uw(),o=r?.locale??a.locale??NC,s=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,c=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(!t)return e?i():GS(n,r?.in);let l={firstWeekContainsDate:s,weekStartsOn:c,locale:o},u=[new xw(r?.in,n)],d=t.match(yT).map(e=>{let t=e[0];if(t in JC){let n=JC[t];return n(e,o.formatLong)}return e}).join(``).match(vT),f=[];for(let n of d){!r?.useAdditionalWeekYearTokens&&$C(n)&&ew(n,t,e),!r?.useAdditionalDayOfYearTokens&&QC(n)&&ew(n,t,e);let a=n[0],s=_T[a];if(s){let{incompatibleTokens:t}=s;if(Array.isArray(t)){let e=f.find(e=>t.includes(e.token)||e.token===a);if(e)throw RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${n}\` at the same time`)}else if(s.incompatibleTokens===`*`&&f.length>0)throw RangeError(`The format string mustn't contain \`${n}\` and any other token at the same time`);f.push({token:a,fullToken:n});let r=s.run(e,n,o.match,l);if(!r)return i();u.push(r.setter),e=r.rest}else{if(a.match(CT))throw RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");if(n===`''`?n=`'`:a===`'`&&(n=TT(n)),e.indexOf(n)===0)e=e.slice(n.length);else return i()}}if(e.length>0&&ST.test(e))return i();let p=u.map(e=>e.priority).sort((e,t)=>t-e).filter((e,t,n)=>n.indexOf(e)===t).map(e=>u.filter(t=>t.priority===e).sort((e,t)=>t.subPriority-e.subPriority)).map(e=>e[0]),m=GS(n,r?.in);if(isNaN(+m))return i();let h={};for(let e of p){if(!e.validate(m,l))return i();let t=e.set(m,h,l);Array.isArray(t)?(m=t[0],Object.assign(h,t[1])):m=t}return m}function TT(e){return e.match(bT)[1].replace(xT,`'`)}function ET(e,t,n){let[r,i]=eC(n?.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function DT(e,t,n){let[r,i]=eC(n?.in,e,t);return r.getFullYear()===i.getFullYear()}function OT(e,t){let n=()=>WS(t?.in,NaN),r=t?.additionalDigits??2,i=NT(e),a;if(i.date){let e=PT(i.date,r);a=FT(e.restDateString,e.year)}if(!a||isNaN(+a))return n();let o=+a,s=0,c;if(i.time&&(s=LT(i.time),isNaN(s)))return n();if(i.timezone){if(c=zT(i.timezone),isNaN(c))return n()}else{let e=new Date(o+s),n=GS(0,t?.in);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}return GS(o+s+c,t?.in)}var kT={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},AT=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,jT=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,MT=/^([+-])(\d{2})(?::?(\d{2}))?$/;function NT(e){let t={},n=e.split(kT.dateTimeDelimiter),r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],kT.timeZoneDelimiter.test(t.date)&&(t.date=e.split(kT.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){let e=kT.timezone.exec(r);e?(t.time=r.replace(e[1],``),t.timezone=e[1]):t.time=r}return t}function PT(e,t){let n=RegExp(`^(?:(\\d{4}|[+-]\\d{`+(4+t)+`})|(\\d{2}|[+-]\\d{`+(2+t)+`})$)`),r=e.match(n);if(!r)return{year:NaN,restDateString:``};let i=r[1]?parseInt(r[1]):null,a=r[2]?parseInt(r[2]):null;return{year:a===null?i:a*100,restDateString:e.slice((r[1]||r[2]).length)}}function FT(e,t){if(t===null)return new Date(NaN);let n=e.match(AT);if(!n)return new Date(NaN);let r=!!n[4],i=IT(n[1]),a=IT(n[2])-1,o=IT(n[3]),s=IT(n[4]),c=IT(n[5])-1;if(r)return GT(t,s,c)?BT(t,s,c):new Date(NaN);{let e=new Date(0);return!UT(t,a,o)||!WT(t,i)?new Date(NaN):(e.setUTCFullYear(t,a,Math.max(i,o)),e)}}function IT(e){return e?parseInt(e):1}function LT(e){let t=e.match(jT);if(!t)return NaN;let n=RT(t[1]),r=RT(t[2]),i=RT(t[3]);return KT(n,r,i)?n*BS+r*zS+i*1e3:NaN}function RT(e){return e&&parseFloat(e.replace(`,`,`.`))||0}function zT(e){if(e===`Z`)return 0;let t=e.match(MT);if(!t)return 0;let n=t[1]===`+`?-1:1,r=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return qT(r,i)?n*(r*BS+i*zS):NaN}function BT(e,t,n){let r=new Date(0);r.setUTCFullYear(e,0,4);let i=r.getUTCDay()||7,a=(t-1)*7+n+1-i;return r.setUTCDate(r.getUTCDate()+a),r}var VT=[31,null,31,30,31,30,31,31,30,31,30,31];function HT(e){return e%400==0||e%4==0&&e%100!=0}function UT(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(VT[t]||(HT(e)?29:28))}function WT(e,t){return t>=1&&t<=(HT(e)?366:365)}function GT(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function KT(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function qT(e,t){return t>=0&&t<=59}function JT(e,t,n){let r=GS(e,n?.in),i=r.getFullYear(),a=r.getDate(),o=WS(n?.in||e,0);o.setFullYear(i,t,15),o.setHours(0,0,0,0);let s=lw(o);return r.setMonth(t,Math.min(a,s)),r}function YT(e,t,n){let r=GS(e,n?.in);return isNaN(+r)?WS(n?.in||e,NaN):(r.setFullYear(t),r)}function XT(e,t,n=`long`){return new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(` `)}var ZT={},QT={};function $T(e,t){try{let n=(ZT[e]||=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).format)(t).split(`GMT`)[1];return n in QT?QT[n]:tE(n,n.split(`:`))}catch{if(e in QT)return QT[e];let t=e?.match(eE);return t?tE(e,t.slice(1)):NaN}}var eE=/([+-]\d\d):?(\d\d)?/;function tE(e,t){let n=+(t[0]||0),r=+(t[1]||0),i=(t[2]||0)/60;return QT[e]=n*60+r>0?n*60+r+i:n*60-r-i}var nE=class e extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]==`string`&&(this.timeZone=e.pop()),this.internal=new Date,isNaN($T(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]==`number`&&(e.length===1||e.length===2&&typeof e[1]!=`number`)?this.setTime(e[0]):typeof e[0]==`string`?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),oE(this,NaN),iE(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){let e=-$T(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),iE(this),+this}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}},rE=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!rE.test(e))return;let t=e.replace(rE,`$1UTC`);nE.prototype[t]&&(e.startsWith(`get`)?nE.prototype[e]=function(){return this.internal[t]()}:(nE.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),aE(this),+this},nE.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),iE(this),+this}))});function iE(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-$T(e.timeZone,e)*60))}function aE(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),oE(e)}function oE(e){let t=$T(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);let i=-new Date(+e).getTimezoneOffset(),a=i- -new Date(+r).getTimezoneOffset(),o=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&o&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);let s=i-n;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);let c=new Date(+e);c.setUTCSeconds(0);let l=i>0?c.getSeconds():(c.getSeconds()-60)%60,u=Math.round(-($T(e.timeZone,e)*60))%60;(u||l)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+u),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+u+l));let d=$T(e.timeZone,e),f=d>0?Math.floor(d):Math.ceil(d),p=-new Date(+e).getTimezoneOffset()-f,m=f!==n,h=p-s;if(m&&h){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+h);let t=$T(e.timeZone,e),n=f-(t>0?Math.floor(t):Math.ceil(t));n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}var sE=class e extends nE{static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}toISOString(){let[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[e,t,n,r]=this.internal.toUTCString().split(` `);return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){let e=this.internal.toUTCString().split(` `)[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${XT(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){let e=this.getTimezoneOffset();return[e>0?`-`:`+`,String(Math.floor(Math.abs(e)/60)).padStart(2,`0`),String(Math.abs(e)%60).padStart(2,`0`)]}withTimeZone(t){return new e(+this,t)}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}},cE=5,lE=4;function uE(e,t){let n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,i=t.addDays(e,-r+1),a=t.addDays(i,cE*7-1);return t.getMonth(e)===t.getMonth(a)?cE:lE}function dE(e,t){let n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-6):t.addDays(n,-1*(r-1))}function fE(e,t){let n=dE(e,t),r=uE(e,t);return t.addDays(n,r*7-1)}var pE={...NC,labels:{labelDayButton:(e,t,n,r)=>{let i;i=r&&typeof r.format==`function`?r.format.bind(r):(e,t)=>sw(e,t,{locale:NC,...n});let a=i(e,`PPPP`);return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a},labelMonthDropdown:`Choose the Month`,labelNext:`Go to the Next Month`,labelPrevious:`Go to the Previous Month`,labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:`Choose the Year`,labelGrid:(e,t,n)=>{let r;return r=n&&typeof n.format==`function`?n.format.bind(n):(e,n)=>sw(e,n,{locale:NC,...t}),r(e,`LLLL yyyy`)},labelGridcell:(e,t,n,r)=>{let i;i=r&&typeof r.format==`function`?r.format.bind(r):(e,t)=>sw(e,t,{locale:NC,...n});let a=i(e,`PPPP`);return t?.today&&(a=`Today, ${a}`),a},labelNav:`Navigation bar`,labelWeekNumberHeader:`Week Number`,labelWeekday:(e,t,n)=>{let r;return r=n&&typeof n.format==`function`?n.format.bind(n):(e,n)=>sw(e,n,{locale:NC,...t}),r(e,`cccc`)}}},mE=class e{constructor(e,t){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?sE.tz(this.options.timeZone):new this.Date,this.newDate=(e,t,n)=>this.overrides?.newDate?this.overrides.newDate(e,t,n):this.options.timeZone?new sE(e,t,n,this.options.timeZone):new Date(e,t,n),this.addDays=(e,t)=>this.overrides?.addDays?this.overrides.addDays(e,t):KS(e,t),this.addMonths=(e,t)=>this.overrides?.addMonths?this.overrides.addMonths(e,t):qS(e,t),this.addWeeks=(e,t)=>this.overrides?.addWeeks?this.overrides.addWeeks(e,t):iC(e,t),this.addYears=(e,t)=>this.overrides?.addYears?this.overrides.addYears(e,t):aC(e,t),this.differenceInCalendarDays=(e,t)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(e,t):nC(e,t),this.differenceInCalendarMonths=(e,t)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(e,t):dC(e,t),this.eachMonthOfInterval=e=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(e):mC(e),this.eachYearOfInterval=e=>{let t=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(e):vC(e),n=new Set(t.map(e=>this.getYear(e)));if(n.size===t.length)return t;let r=[];return n.forEach(e=>{r.push(new Date(e,0,1))}),r},this.endOfBroadcastWeek=e=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(e):fE(e,this),this.endOfISOWeek=e=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(e):bC(e),this.endOfMonth=e=>this.overrides?.endOfMonth?this.overrides.endOfMonth(e):fC(e),this.endOfWeek=(e,t)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(e,t):yC(e,this.options),this.endOfYear=e=>this.overrides?.endOfYear?this.overrides.endOfYear(e):gC(e),this.format=(e,t,n)=>{let r=this.overrides?.format?this.overrides.format(e,t,this.options):sw(e,t,this.options);return this.options.numerals&&this.options.numerals!==`latn`?this.replaceDigits(r):r},this.getISOWeek=e=>this.overrides?.getISOWeek?this.overrides.getISOWeek(e):FC(e),this.getMonth=(e,t)=>this.overrides?.getMonth?this.overrides.getMonth(e,this.options):fw(e,this.options),this.getYear=(e,t)=>this.overrides?.getYear?this.overrides.getYear(e,this.options):pw(e,this.options),this.getWeek=(e,t)=>this.overrides?.getWeek?this.overrides.getWeek(e,this.options):RC(e,this.options),this.isAfter=(e,t)=>this.overrides?.isAfter?this.overrides.isAfter(e,t):mw(e,t),this.isBefore=(e,t)=>this.overrides?.isBefore?this.overrides.isBefore(e,t):hw(e,t),this.isDate=e=>this.overrides?.isDate?this.overrides.isDate(e):lC(e),this.isSameDay=(e,t)=>this.overrides?.isSameDay?this.overrides.isSameDay(e,t):cC(e,t),this.isSameMonth=(e,t)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(e,t):ET(e,t),this.isSameYear=(e,t)=>this.overrides?.isSameYear?this.overrides.isSameYear(e,t):DT(e,t),this.max=e=>this.overrides?.max?this.overrides.max(e):oC(e),this.min=e=>this.overrides?.min?this.overrides.min(e):sC(e),this.setMonth=(e,t)=>this.overrides?.setMonth?this.overrides.setMonth(e,t):JT(e,t),this.setYear=(e,t)=>this.overrides?.setYear?this.overrides.setYear(e,t):YT(e,t),this.startOfBroadcastWeek=(e,t)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(e,this):dE(e,this),this.startOfDay=e=>this.overrides?.startOfDay?this.overrides.startOfDay(e):tC(e),this.startOfISOWeek=e=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(e):ZS(e),this.startOfMonth=e=>this.overrides?.startOfMonth?this.overrides.startOfMonth(e):hC(e),this.startOfWeek=(e,t)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(e,this.options):XS(e,this.options),this.startOfYear=e=>this.overrides?.startOfYear?this.overrides.startOfYear(e):_C(e),this.options={locale:pE,...e},this.overrides=t}getDigitMap(){let{numerals:e=`latn`}=this.options,t=new Intl.NumberFormat(`en-US`,{numberingSystem:e}),n={};for(let e=0;e<10;e++)n[e.toString()]=t.format(e);return n}replaceDigits(e){let t=this.getDigitMap();return e.replace(/\d/g,e=>t[e]||e)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){let t=this.options.locale?.code;return t&&e.yearFirstLocales.has(t)?`year-first`:`month-first`}formatMonthYear(t){let{locale:n,timeZone:r,numerals:i}=this.options,a=n?.code;if(a&&e.yearFirstLocales.has(a))try{return new Intl.DateTimeFormat(a,{month:`long`,year:`numeric`,timeZone:r,numberingSystem:i}).format(t)}catch{}let o=this.getMonthYearOrder()===`year-first`?`y LLLL`:`LLLL y`;return this.format(t,o)}};mE.yearFirstLocales=new Set([`eu`,`hu`,`ja`,`ja-Hira`,`ja-JP`,`ko`,`ko-KR`,`lt`,`lt-LT`,`lv`,`lv-LV`,`mn`,`mn-MN`,`zh`,`zh-CN`,`zh-HK`,`zh-TW`]);var hE=new mE,gE=class{constructor(e,t,n=hE){this.date=e,this.displayMonth=t,this.outside=!!(t&&!n.isSameMonth(e,t)),this.dateLib=n,this.isoDate=n.format(e,`yyyy-MM-dd`),this.displayMonthId=n.format(t,`yyyy-MM`),this.dateMonthId=n.format(e,`yyyy-MM`)}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}},_E=class{constructor(e,t){this.date=e,this.weeks=t}},vE=class{constructor(e,t){this.days=t,this.weekNumber=e}};function yE(e){return Q.createElement(`button`,{...e})}function bE(e){return Q.createElement(`span`,{...e})}function xE(e){let{size:t=24,orientation:n=`left`,className:r}=e;return Q.createElement(`svg`,{className:r,width:t,height:t,viewBox:`0 0 24 24`},n===`up`&&Q.createElement(`polygon`,{points:`6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28`}),n===`down`&&Q.createElement(`polygon`,{points:`6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72`}),n===`left`&&Q.createElement(`polygon`,{points:`16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20`}),n===`right`&&Q.createElement(`polygon`,{points:`8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20`}))}function SE(e){let{day:t,modifiers:n,...r}=e;return Q.createElement(`td`,{...r})}function CE(e){let{day:t,modifiers:n,...r}=e,i=Q.useRef(null);return Q.useEffect(()=>{n.focused&&i.current?.focus()},[n.focused]),Q.createElement(`button`,{ref:i,...r})}var wE;(function(e){e.Root=`root`,e.Chevron=`chevron`,e.Day=`day`,e.DayButton=`day_button`,e.CaptionLabel=`caption_label`,e.Dropdowns=`dropdowns`,e.Dropdown=`dropdown`,e.DropdownRoot=`dropdown_root`,e.Footer=`footer`,e.MonthGrid=`month_grid`,e.MonthCaption=`month_caption`,e.MonthsDropdown=`months_dropdown`,e.Month=`month`,e.Months=`months`,e.Nav=`nav`,e.NextMonthButton=`button_next`,e.PreviousMonthButton=`button_previous`,e.Week=`week`,e.Weeks=`weeks`,e.Weekday=`weekday`,e.Weekdays=`weekdays`,e.WeekNumber=`week_number`,e.WeekNumberHeader=`week_number_header`,e.YearsDropdown=`years_dropdown`})(wE||={});var TE;(function(e){e.disabled=`disabled`,e.hidden=`hidden`,e.outside=`outside`,e.focused=`focused`,e.today=`today`})(TE||={});var EE;(function(e){e.range_end=`range_end`,e.range_middle=`range_middle`,e.range_start=`range_start`,e.selected=`selected`})(EE||={});var DE;(function(e){e.weeks_before_enter=`weeks_before_enter`,e.weeks_before_exit=`weeks_before_exit`,e.weeks_after_enter=`weeks_after_enter`,e.weeks_after_exit=`weeks_after_exit`,e.caption_after_enter=`caption_after_enter`,e.caption_after_exit=`caption_after_exit`,e.caption_before_enter=`caption_before_enter`,e.caption_before_exit=`caption_before_exit`})(DE||={});function OE(e){let{options:t,className:n,components:r,classNames:i,...a}=e,o=[i[wE.Dropdown],n].join(` `),s=t?.find(({value:e})=>e===a.value);return Q.createElement(`span`,{"data-disabled":a.disabled,className:i[wE.DropdownRoot]},Q.createElement(r.Select,{className:o,...a},t?.map(({value:e,label:t,disabled:n})=>Q.createElement(r.Option,{key:e,value:e,disabled:n},t))),Q.createElement(`span`,{className:i[wE.CaptionLabel],"aria-hidden":!0},s?.label,Q.createElement(r.Chevron,{orientation:`down`,size:18,className:i[wE.Chevron]})))}function kE(e){return Q.createElement(`div`,{...e})}function AE(e){return Q.createElement(`div`,{...e})}function jE(e){let{calendarMonth:t,displayIndex:n,...r}=e;return Q.createElement(`div`,{...r},e.children)}function ME(e){let{calendarMonth:t,displayIndex:n,...r}=e;return Q.createElement(`div`,{...r})}function NE(e){return Q.createElement(`table`,{...e})}function PE(e){return Q.createElement(`div`,{...e})}var FE=(0,Q.createContext)(void 0);function IE(){let e=(0,Q.useContext)(FE);if(e===void 0)throw Error(`useDayPicker() must be used within a custom component.`);return e}function LE(e){let{components:t}=IE();return Q.createElement(t.Dropdown,{...e})}function RE(e){let{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:i,...a}=e,{components:o,classNames:s,labels:{labelPrevious:c,labelNext:l}}=IE(),u=(0,Q.useCallback)(e=>{i&&n?.(e)},[i,n]),d=(0,Q.useCallback)(e=>{r&&t?.(e)},[r,t]);return Q.createElement(`nav`,{...a},Q.createElement(o.PreviousMonthButton,{type:`button`,className:s[wE.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:d},Q.createElement(o.Chevron,{disabled:r?void 0:!0,className:s[wE.Chevron],orientation:`left`})),Q.createElement(o.NextMonthButton,{type:`button`,className:s[wE.NextMonthButton],tabIndex:i?void 0:-1,"aria-disabled":i?void 0:!0,"aria-label":l(i),onClick:u},Q.createElement(o.Chevron,{disabled:i?void 0:!0,orientation:`right`,className:s[wE.Chevron]})))}function zE(e){let{components:t}=IE();return Q.createElement(t.Button,{...e})}function BE(e){return Q.createElement(`option`,{...e})}function VE(e){let{components:t}=IE();return Q.createElement(t.Button,{...e})}function HE(e){let{rootRef:t,...n}=e;return Q.createElement(`div`,{...n,ref:t})}function UE(e){return Q.createElement(`select`,{...e})}function WE(e){let{week:t,...n}=e;return Q.createElement(`tr`,{...n})}function GE(e){return Q.createElement(`th`,{...e})}function KE(e){return Q.createElement(`thead`,{"aria-hidden":!0},Q.createElement(`tr`,{...e}))}function qE(e){let{week:t,...n}=e;return Q.createElement(`th`,{...n})}function JE(e){return Q.createElement(`th`,{...e})}function YE(e){return Q.createElement(`tbody`,{...e})}function XE(e){let{components:t}=IE();return Q.createElement(t.Dropdown,{...e})}var ZE=t({Button:()=>yE,CaptionLabel:()=>bE,Chevron:()=>xE,Day:()=>SE,DayButton:()=>CE,Dropdown:()=>OE,DropdownNav:()=>kE,Footer:()=>AE,Month:()=>jE,MonthCaption:()=>ME,MonthGrid:()=>NE,Months:()=>PE,MonthsDropdown:()=>LE,Nav:()=>RE,NextMonthButton:()=>zE,Option:()=>BE,PreviousMonthButton:()=>VE,Root:()=>HE,Select:()=>UE,Week:()=>WE,WeekNumber:()=>qE,WeekNumberHeader:()=>JE,Weekday:()=>GE,Weekdays:()=>KE,Weeks:()=>YE,YearsDropdown:()=>XE});function QE(e,t,n=!1,r=hE){let{from:i,to:a}=e,{differenceInCalendarDays:o,isSameDay:s}=r;return i&&a?(o(a,i)<0&&([i,a]=[a,i]),o(t,i)>=+!!n&&o(a,t)>=+!!n):!n&&a?s(a,t):!n&&i?s(i,t):!1}function $E(e){return!!(e&&typeof e==`object`&&`before`in e&&`after`in e)}function eD(e){return!!(e&&typeof e==`object`&&`from`in e)}function tD(e){return!!(e&&typeof e==`object`&&`after`in e)}function nD(e){return!!(e&&typeof e==`object`&&`before`in e)}function rD(e){return!!(e&&typeof e==`object`&&`dayOfWeek`in e)}function iD(e,t){return Array.isArray(e)&&e.every(t.isDate)}function aD(e,t,n=hE){let r=Array.isArray(t)?t:[t],{isSameDay:i,differenceInCalendarDays:a,isAfter:o}=n;return r.some(t=>{if(typeof t==`boolean`)return t;if(n.isDate(t))return i(e,t);if(iD(t,n))return t.some(t=>i(e,t));if(eD(t))return QE(t,e,!1,n);if(rD(t))return Array.isArray(t.dayOfWeek)?t.dayOfWeek.includes(e.getDay()):t.dayOfWeek===e.getDay();if($E(t)){let n=a(t.before,e),r=a(t.after,e),i=n>0,s=r<0;return o(t.before,t.after)?s&&i:i||s}return tD(t)?a(e,t.after)>0:nD(t)?a(t.before,e)>0:typeof t==`function`?t(e):!1})}function oD(e,t,n,r,i){let{disabled:a,hidden:o,modifiers:s,showOutsideDays:c,broadcastCalendar:l,today:u=i.today()}=t,{isSameDay:d,isSameMonth:f,startOfMonth:p,isBefore:m,endOfMonth:h,isAfter:g}=i,_=n&&p(n),v=r&&h(r),y={[TE.focused]:[],[TE.outside]:[],[TE.disabled]:[],[TE.hidden]:[],[TE.today]:[]},b={};for(let t of e){let{date:e,displayMonth:n}=t,r=!!(n&&!f(e,n)),p=!!(_&&m(e,_)),h=!!(v&&g(e,v)),x=!!(a&&aD(e,a,i)),S=!!(o&&aD(e,o,i))||p||h||!l&&!c&&r||l&&c===!1&&r,C=d(e,u);r&&y.outside.push(t),x&&y.disabled.push(t),S&&y.hidden.push(t),C&&y.today.push(t),s&&Object.keys(s).forEach(n=>{let r=s?.[n];r&&aD(e,r,i)&&(b[n]?b[n].push(t):b[n]=[t])})}return e=>{let t={[TE.focused]:!1,[TE.disabled]:!1,[TE.hidden]:!1,[TE.outside]:!1,[TE.today]:!1},n={};for(let n in y)t[n]=y[n].some(t=>t===e);for(let t in b)n[t]=b[t].some(t=>t===e);return{...t,...n}}}function sD(e,t,n={}){return Object.entries(e).filter(([,e])=>e===!0).reduce((e,[r])=>(n[r]?e.push(n[r]):t[TE[r]]?e.push(t[TE[r]]):t[EE[r]]&&e.push(t[EE[r]]),e),[t[wE.Day]])}function cD(e){return{...ZE,...e}}function lD(e){let t={"data-mode":e.mode??void 0,"data-required":`required`in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([e,n])=>{e.startsWith(`data-`)&&(t[e]=n)}),t}function uD(){let e={};for(let t in wE)e[wE[t]]=`rdp-${wE[t]}`;for(let t in TE)e[TE[t]]=`rdp-${TE[t]}`;for(let t in EE)e[EE[t]]=`rdp-${EE[t]}`;for(let t in DE)e[DE[t]]=`rdp-${DE[t]}`;return e}function dD(e,t,n){return(n??new mE(t)).formatMonthYear(e)}var fD=dD;function pD(e,t,n){return(n??new mE(t)).format(e,`d`)}function mD(e,t=hE){return t.format(e,`LLLL`)}function hD(e,t,n){return(n??new mE(t)).format(e,`cccccc`)}function gD(e,t=hE){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function _D(){return``}function vD(e,t=hE){return t.format(e,`yyyy`)}var yD=vD,bD=t({formatCaption:()=>dD,formatDay:()=>pD,formatMonthCaption:()=>fD,formatMonthDropdown:()=>mD,formatWeekNumber:()=>gD,formatWeekNumberHeader:()=>_D,formatWeekdayName:()=>hD,formatYearCaption:()=>yD,formatYearDropdown:()=>vD});function xD(e){return e?.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e?.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...bD,...e}}function SD(e,t,n,r){let i=(r??new mE(n)).format(e,`PPPP`);return t.today&&(i=`Today, ${i}`),t.selected&&(i=`${i}, selected`),i}var CD=SD;function wD(e,t,n){return(n??new mE(t)).formatMonthYear(e)}var TD=wD;function ED(e,t,n,r){let i=(r??new mE(n)).format(e,`PPPP`);return t?.today&&(i=`Today, ${i}`),i}function DD(e){return`Choose the Month`}function OD(){return``}var kD=`Go to the Next Month`;function AD(e,t){return kD}function jD(e){return`Go to the Previous Month`}function MD(e,t,n){return(n??new mE(t)).format(e,`cccc`)}function ND(e,t){return`Week ${e}`}function PD(e){return`Week Number`}function FD(e){return`Choose the Year`}var ID=t({labelCaption:()=>TD,labelDay:()=>CD,labelDayButton:()=>SD,labelGrid:()=>wD,labelGridcell:()=>ED,labelMonthDropdown:()=>DD,labelNav:()=>OD,labelNext:()=>AD,labelPrevious:()=>jD,labelWeekNumber:()=>ND,labelWeekNumberHeader:()=>PD,labelWeekday:()=>MD,labelYearDropdown:()=>FD}),LD=(e,t,n)=>t||(n?typeof n==`function`?n:(...e)=>n:e);function RD(e,t){let n=t.locale?.labels??{};return{...ID,...e??{},labelDayButton:LD(SD,e?.labelDayButton,n.labelDayButton),labelMonthDropdown:LD(DD,e?.labelMonthDropdown,n.labelMonthDropdown),labelNext:LD(AD,e?.labelNext,n.labelNext),labelPrevious:LD(jD,e?.labelPrevious,n.labelPrevious),labelWeekNumber:LD(ND,e?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:LD(FD,e?.labelYearDropdown,n.labelYearDropdown),labelGrid:LD(wD,e?.labelGrid,n.labelGrid),labelGridcell:LD(ED,e?.labelGridcell,n.labelGridcell),labelNav:LD(OD,e?.labelNav,n.labelNav),labelWeekNumberHeader:LD(PD,e?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:LD(MD,e?.labelWeekday,n.labelWeekday)}}function zD(e,t,n,r,i){let{startOfMonth:a,startOfYear:o,endOfYear:s,eachMonthOfInterval:c,getMonth:l}=i;return c({start:o(e),end:s(e)}).map(e=>{let o=r.formatMonthDropdown(e,i);return{value:l(e),label:o,disabled:t&&e<a(t)||n&&e>a(n)||!1}})}function BD(e,t={},n={}){let r={...t?.[wE.Day]};return Object.entries(e).filter(([,e])=>e===!0).forEach(([e])=>{r={...r,...n?.[e]}}),r}function VD(e,t,n,r){let i=r??e.today(),a=n?e.startOfBroadcastWeek(i,e):t?e.startOfISOWeek(i):e.startOfWeek(i),o=[];for(let t=0;t<7;t++){let n=e.addDays(a,t);o.push(n)}return o}function HD(e,t,n,r,i=!1){if(!e||!t)return;let{startOfYear:a,endOfYear:o,eachYearOfInterval:s,getYear:c}=r,l=s({start:a(e),end:o(t)});return i&&l.reverse(),l.map(e=>{let t=n.formatYearDropdown(e,r);return{value:c(e),label:t,disabled:!1}})}function UD(e,t={}){let{weekStartsOn:n,locale:r}=t,i=n??r?.options?.weekStartsOn??0,a=t=>{let n=typeof t==`number`||typeof t==`string`?new Date(t):t;return new sE(n.getFullYear(),n.getMonth(),n.getDate(),12,0,0,e)},o=e=>{let t=a(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)};return{today:()=>a(sE.tz(e)),newDate:(t,n,r)=>new sE(t,n,r,12,0,0,e),startOfDay:e=>a(e),startOfWeek:(e,t)=>{let n=a(e),r=t?.weekStartsOn??i,o=(n.getDay()-r+7)%7;return n.setDate(n.getDate()-o),n},startOfISOWeek:e=>{let t=a(e),n=(t.getDay()-1+7)%7;return t.setDate(t.getDate()-n),t},startOfMonth:e=>{let t=a(e);return t.setDate(1),t},startOfYear:e=>{let t=a(e);return t.setMonth(0,1),t},endOfWeek:(e,t)=>{let n=a(e),r=(((t?.weekStartsOn??i)+6)%7-n.getDay()+7)%7;return n.setDate(n.getDate()+r),n},endOfISOWeek:e=>{let t=a(e),n=(7-t.getDay())%7;return t.setDate(t.getDate()+n),t},endOfMonth:e=>{let t=a(e);return t.setMonth(t.getMonth()+1,0),t},endOfYear:e=>{let t=a(e);return t.setMonth(11,31),t},eachMonthOfInterval:t=>{let n=a(t.start),r=a(t.end),i=[],o=new sE(n.getFullYear(),n.getMonth(),1,12,0,0,e),s=r.getFullYear()*12+r.getMonth();for(;o.getFullYear()*12+o.getMonth()<=s;)i.push(new sE(o,e)),o.setMonth(o.getMonth()+1,1);return i},addDays:(e,t)=>{let n=a(e);return n.setDate(n.getDate()+t),n},addWeeks:(e,t)=>{let n=a(e);return n.setDate(n.getDate()+t*7),n},addMonths:(e,t)=>{let n=a(e);return n.setMonth(n.getMonth()+t),n},addYears:(e,t)=>{let n=a(e);return n.setFullYear(n.getFullYear()+t),n},eachYearOfInterval:t=>{let n=a(t.start),r=a(t.end),i=[],o=new sE(n.getFullYear(),0,1,12,0,0,e);for(;o.getFullYear()<=r.getFullYear();)i.push(new sE(o,e)),o.setFullYear(o.getFullYear()+1,0,1);return i},getWeek:(e,t)=>RC(o(e),{weekStartsOn:t?.weekStartsOn??i,firstWeekContainsDate:t?.firstWeekContainsDate??r?.options?.firstWeekContainsDate??1}),getISOWeek:e=>FC(o(e)),differenceInCalendarDays:(e,t)=>nC(o(e),o(t)),differenceInCalendarMonths:(e,t)=>dC(o(e),o(t))}}var WD=e=>e instanceof HTMLElement?e:null,GD=e=>[...e.querySelectorAll(`[data-animated-month]`)??[]],KD=e=>WD(e.querySelector(`[data-animated-month]`)),qD=e=>WD(e.querySelector(`[data-animated-caption]`)),JD=e=>WD(e.querySelector(`[data-animated-weeks]`)),YD=e=>WD(e.querySelector(`[data-animated-nav]`)),XD=e=>WD(e.querySelector(`[data-animated-weekdays]`));function ZD(e,t,{classNames:n,months:r,focused:i,dateLib:a}){let o=(0,Q.useRef)(null),s=(0,Q.useRef)(r),c=(0,Q.useRef)(!1);(0,Q.useLayoutEffect)(()=>{let l=s.current;if(s.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||l.length===0||r.length!==l.length)return;let u=a.isSameMonth(r[0].date,l[0].date),d=a.isAfter(r[0].date,l[0].date),f=d?n[DE.caption_after_enter]:n[DE.caption_before_enter],p=d?n[DE.weeks_after_enter]:n[DE.weeks_before_enter],m=o.current,h=e.current.cloneNode(!0);if(h instanceof HTMLElement?(GD(h).forEach(e=>{if(!(e instanceof HTMLElement))return;let t=KD(e);t&&e.contains(t)&&e.removeChild(t);let n=qD(e);n&&n.classList.remove(f);let r=JD(e);r&&r.classList.remove(p)}),o.current=h):o.current=null,c.current||u||i)return;let g=m instanceof HTMLElement?GD(m):[],_=GD(e.current);if(_?.every(e=>e instanceof HTMLElement)&&g&&g.every(e=>e instanceof HTMLElement)){c.current=!0;let t=[];e.current.style.isolation=`isolate`;let r=YD(e.current);r&&(r.style.zIndex=`1`),_.forEach((i,a)=>{let o=g[a];if(!o)return;i.style.position=`relative`,i.style.overflow=`hidden`;let s=qD(i);s&&s.classList.add(f);let l=JD(i);l&&l.classList.add(p);let u=()=>{c.current=!1,e.current&&(e.current.style.isolation=``),r&&(r.style.zIndex=``),s&&s.classList.remove(f),l&&l.classList.remove(p),i.style.position=``,i.style.overflow=``,i.contains(o)&&i.removeChild(o)};t.push(u),o.style.pointerEvents=`none`,o.style.position=`absolute`,o.style.overflow=`hidden`,o.setAttribute(`aria-hidden`,`true`);let m=XD(o);m&&(m.style.opacity=`0`);let h=qD(o);h&&(h.classList.add(d?n[DE.caption_before_exit]:n[DE.caption_after_exit]),h.addEventListener(`animationend`,u));let _=JD(o);_&&_.classList.add(d?n[DE.weeks_before_exit]:n[DE.weeks_after_exit]),i.insertBefore(o,i.firstChild)})}})}function QD(e,t,n,r){let i=e[0],a=e[e.length-1],{ISOWeek:o,fixedWeeks:s,broadcastCalendar:c}=n??{},{addDays:l,differenceInCalendarDays:u,differenceInCalendarMonths:d,endOfBroadcastWeek:f,endOfISOWeek:p,endOfMonth:m,endOfWeek:h,isAfter:g,startOfBroadcastWeek:_,startOfISOWeek:v,startOfWeek:y}=r,b=c?_(i,r):o?v(i):y(i),x=c?f(a):o?p(m(a)):h(m(a)),S=t&&(c?f(t):o?p(t):h(t)),C=u(S&&g(x,S)?S:x,b),w=d(a,i)+1,T=[];for(let e=0;e<=C;e++){let t=l(b,e);T.push(t)}let E=(c?35:42)*w;if(s&&T.length<E){let e=E-T.length;for(let t=0;t<e;t++){let e=l(T[T.length-1],1);T.push(e)}}return T}function $D(e){let t=[];return e.reduce((e,n)=>{let r=n.weeks.reduce((e,t)=>e.concat(t.days.slice()),t.slice());return e.concat(r.slice())},t.slice())}function eO(e,t,n,r){let{numberOfMonths:i=1}=n,a=[];for(let n=0;n<i;n++){let i=r.addMonths(e,n);if(t&&i>t)break;a.push(i)}return a}function tO(e,t,n,r){let{month:i,defaultMonth:a,today:o=r.today(),numberOfMonths:s=1}=e,c=i||a||o,{differenceInCalendarMonths:l,addMonths:u,startOfMonth:d}=r;return n&&l(n,c)<s-1&&(c=u(n,-1*(s-1))),t&&l(c,t)<0&&(c=t),d(c)}function nO(e,t,n,r){let{addDays:i,endOfBroadcastWeek:a,endOfISOWeek:o,endOfMonth:s,endOfWeek:c,getISOWeek:l,getWeek:u,startOfBroadcastWeek:d,startOfISOWeek:f,startOfWeek:p}=r,m=e.reduce((e,m)=>{let h=n.broadcastCalendar?d(m,r):n.ISOWeek?f(m):p(m),g=n.broadcastCalendar?a(m):n.ISOWeek?o(s(m)):c(s(m)),_=t.filter(e=>e>=h&&e<=g),v=n.broadcastCalendar?35:42;if(n.fixedWeeks&&_.length<v){let e=t.filter(e=>{let t=v-_.length;return e>g&&e<=i(g,t)});_.push(...e)}let y=new _E(m,_.reduce((e,t)=>{let i=n.ISOWeek?l(t):u(t),a=e.find(e=>e.weekNumber===i),o=new gE(t,m,r);return a?a.days.push(o):e.push(new vE(i,[o])),e},[]));return e.push(y),e},[]);return n.reverseMonths?m.reverse():m}function rO(e,t){let{startMonth:n,endMonth:r}=e,{startOfYear:i,startOfDay:a,startOfMonth:o,endOfMonth:s,addYears:c,endOfYear:l,newDate:u,today:d}=t,{fromYear:f,toYear:p,fromMonth:m,toMonth:h}=e;!n&&m&&(n=m),!n&&f&&(n=t.newDate(f,0,1)),!r&&h&&(r=h),!r&&p&&(r=u(p,11,31));let g=e.captionLayout===`dropdown`||e.captionLayout===`dropdown-years`;return n?n=o(n):f?n=u(f,0,1):!n&&g&&(n=i(c(e.today??d(),-100))),r?r=s(r):p?r=u(p,11,31):!r&&g&&(r=l(e.today??d())),[n&&a(n),r&&a(r)]}function iO(e,t,n,r){if(n.disableNavigation)return;let{pagedNavigation:i,numberOfMonths:a=1}=n,{startOfMonth:o,addMonths:s,differenceInCalendarMonths:c}=r,l=i?a:1,u=o(e);if(!t||!(c(t,e)<a))return s(u,l)}function aO(e,t,n,r){if(n.disableNavigation)return;let{pagedNavigation:i,numberOfMonths:a}=n,{startOfMonth:o,addMonths:s,differenceInCalendarMonths:c}=r,l=i?a??1:1,u=o(e);if(!t||!(c(u,t)<=0))return s(u,-l)}function oO(e){return e.reduce((e,t)=>e.concat(t.weeks.slice()),[].slice())}function sO(e,t){let[n,r]=(0,Q.useState)(e);return[t===void 0?n:t,r]}function cO(e,t){let[n,r]=rO(e,t),{startOfMonth:i,endOfMonth:a}=t,o=tO(e,n,r,t),[s,c]=sO(o,e.month?o:void 0);(0,Q.useEffect)(()=>{c(tO(e,n,r,t))},[e.timeZone]);let{months:l,weeks:u,days:d,previousMonth:f,nextMonth:p}=(0,Q.useMemo)(()=>{let i=eO(s,r,{numberOfMonths:e.numberOfMonths},t),o=nO(i,QD(i,e.endMonth?a(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t);return{months:o,weeks:oO(o),days:$D(o),previousMonth:aO(s,n,e,t),nextMonth:iO(s,r,e,t)}},[t,s.getTime(),r?.getTime(),n?.getTime(),e.disableNavigation,e.broadcastCalendar,e.endMonth?.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:m,onMonthChange:h}=e,g=e=>u.some(t=>t.days.some(t=>t.isEqualTo(e))),_=e=>{if(m)return;let t=i(e);n&&t<i(n)&&(t=i(n)),r&&t>i(r)&&(t=i(r)),c(t),h?.(t)};return{months:l,weeks:u,days:d,navStart:n,navEnd:r,previousMonth:f,nextMonth:p,goToMonth:_,goToDay:e=>{g(e)||_(e.date)}}}var lO;(function(e){e[e.Today=0]=`Today`,e[e.Selected=1]=`Selected`,e[e.LastFocused=2]=`LastFocused`,e[e.FocusedModifier=3]=`FocusedModifier`})(lO||={});function uO(e){return!e[TE.disabled]&&!e[TE.hidden]&&!e[TE.outside]}function dO(e,t,n,r){let i,a=-1;for(let o of e){let e=t(o);uO(e)&&(e[TE.focused]&&a<lO.FocusedModifier?(i=o,a=lO.FocusedModifier):r?.isEqualTo(o)&&a<lO.LastFocused?(i=o,a=lO.LastFocused):n(o.date)&&a<lO.Selected?(i=o,a=lO.Selected):e[TE.today]&&a<lO.Today&&(i=o,a=lO.Today))}return i||=e.find(e=>uO(t(e))),i}function fO(e,t,n,r,i,a,o){let{ISOWeek:s,broadcastCalendar:c}=a,{addDays:l,addMonths:u,addWeeks:d,addYears:f,endOfBroadcastWeek:p,endOfISOWeek:m,endOfWeek:h,max:g,min:_,startOfBroadcastWeek:v,startOfISOWeek:y,startOfWeek:b}=o,x={day:l,week:d,month:u,year:f,startOfWeek:e=>c?v(e,o):s?y(e):b(e),endOfWeek:e=>c?p(e):s?m(e):h(e)}[e](n,t===`after`?1:-1);return t===`before`&&r?x=g([r,x]):t===`after`&&i&&(x=_([i,x])),x}function pO(e,t,n,r,i,a,o,s=0){if(s>365)return;let c=fO(e,t,n.date,r,i,a,o),l=!!(a.disabled&&aD(c,a.disabled,o)),u=!!(a.hidden&&aD(c,a.hidden,o)),d=new gE(c,c,o);return!l&&!u?d:pO(e,t,d,r,i,a,o,s+1)}function mO(e,t,n,r,i){let{autoFocus:a}=e,[o,s]=(0,Q.useState)(),c=dO(t.days,n,r||(()=>!1),o),[l,u]=(0,Q.useState)(a?c:void 0);return{isFocusTarget:e=>!!c?.isEqualTo(e),setFocused:u,focused:l,blur:()=>{s(l),u(void 0)},moveFocus:(n,r)=>{if(!l)return;let a=pO(n,r,l,t.navStart,t.navEnd,e,i);a&&(e.disableNavigation&&!t.days.some(e=>e.isEqualTo(a))||(t.goToDay(a),u(a)))}}}function hO(e,t){let{selected:n,required:r,onSelect:i}=e,[a,o]=sO(n,i?n:void 0),s=i?n:a,{isSameDay:c}=t,l=e=>s?.some(t=>c(t,e))??!1,{min:u,max:d}=e;return{selected:s,select:(e,t,n)=>{let a=[...s??[]];if(l(e)){if(s?.length===u||r&&s?.length===1)return;a=s?.filter(t=>!c(t,e))}else a=s?.length===d?[e]:[...a,e];return i||o(a),i?.(a,e,t,n),a},isSelected:l}}function gO(e,t,n=0,r=0,i=!1,a=hE){let{from:o,to:s}=t||{},{isSameDay:c,isAfter:l,isBefore:u}=a,d;if(!o&&!s)d={from:e,to:n>0?void 0:e};else if(o&&!s)d=c(o,e)?n===0?{from:o,to:e}:i?{from:o,to:void 0}:void 0:u(e,o)?{from:e,to:o}:{from:o,to:e};else if(o&&s)if(c(o,e)&&c(s,e))d=i?{from:o,to:s}:void 0;else if(c(o,e))d={from:o,to:n>0?void 0:e};else if(c(s,e))d={from:e,to:n>0?void 0:e};else if(u(e,o))d={from:e,to:s};else if(l(e,o))d={from:o,to:e};else if(l(e,s))d={from:o,to:e};else throw Error(`Invalid range`);if(d?.from&&d?.to){let t=a.differenceInCalendarDays(d.to,d.from);(r>0&&t>r||n>1&&t<n)&&(d={from:e,to:void 0})}return d}function _O(e,t,n=hE){let r=Array.isArray(t)?t:[t],i=e.from,a=n.differenceInCalendarDays(e.to,e.from),o=Math.min(a,6);for(let e=0;e<=o;e++){if(r.includes(i.getDay()))return!0;i=n.addDays(i,1)}return!1}function vO(e,t,n=hE){return QE(e,t.from,!1,n)||QE(e,t.to,!1,n)||QE(t,e.from,!1,n)||QE(t,e.to,!1,n)}function yO(e,t,n=hE){let r=Array.isArray(t)?t:[t];if(r.filter(e=>typeof e!=`function`).some(t=>typeof t==`boolean`?t:n.isDate(t)?QE(e,t,!1,n):iD(t,n)?t.some(t=>QE(e,t,!1,n)):eD(t)?t.from&&t.to?vO(e,{from:t.from,to:t.to},n):!1:rD(t)?_O(e,t.dayOfWeek,n):$E(t)?n.isAfter(t.before,t.after)?vO(e,{from:n.addDays(t.after,1),to:n.addDays(t.before,-1)},n):aD(e.from,t,n)||aD(e.to,t,n):tD(t)||nD(t)?aD(e.from,t,n)||aD(e.to,t,n):!1))return!0;let i=r.filter(e=>typeof e==`function`);if(i.length){let t=e.from,r=n.differenceInCalendarDays(e.to,e.from);for(let e=0;e<=r;e++){if(i.some(e=>e(t)))return!0;t=n.addDays(t,1)}}return!1}function bO(e,t){let{disabled:n,excludeDisabled:r,resetOnSelect:i,selected:a,required:o,onSelect:s}=e,[c,l]=sO(a,s?a:void 0),u=s?a:c;return{selected:u,select:(a,c,d)=>{let{min:f,max:p}=e,m;if(a){let e=u?.from,n=u?.to,r=!!e&&!!n,s=!!e&&!!n&&t.isSameDay(e,n)&&t.isSameDay(a,e);m=i&&(r||!u?.from)?!o&&s?void 0:{from:a,to:void 0}:gO(a,u,f,p,o,t)}return r&&n&&m?.from&&m.to&&yO({from:m.from,to:m.to},n,t)&&(m.from=a,m.to=void 0),s||l(m),s?.(m,a,c,d),m},isSelected:e=>u&&QE(u,e,!1,t)}}function xO(e,t){let{selected:n,required:r,onSelect:i}=e,[a,o]=sO(n,i?n:void 0),s=i?n:a,{isSameDay:c}=t;return{selected:s,select:(e,t,n)=>{let a=e;return!r&&s&&s&&c(e,s)&&(a=void 0),i||o(a),i?.(a,e,t,n),a},isSelected:e=>s?c(s,e):!1}}function SO(e,t){let n=xO(e,t),r=hO(e,t),i=bO(e,t);switch(e.mode){case`single`:return n;case`multiple`:return r;case`range`:return i;default:return}}function CO(e,t){return e instanceof sE&&e.timeZone===t?e:new sE(e,t)}function wO(e,t,n){if(!n)return CO(e,t);let r=CO(e,t),i=new sE(r.getFullYear(),r.getMonth(),r.getDate(),12,0,0,t);return new Date(i.getTime())}function TO(e,t,n){return typeof e==`boolean`||typeof e==`function`?e:e instanceof Date?wO(e,t,n):Array.isArray(e)?e.map(e=>e instanceof Date?wO(e,t,n):e):eD(e)?{...e,from:e.from?CO(e.from,t):e.from,to:e.to?CO(e.to,t):e.to}:$E(e)?{before:wO(e.before,t,n),after:wO(e.after,t,n)}:tD(e)?{after:wO(e.after,t,n)}:nD(e)?{before:wO(e.before,t,n)}:e}function EO(e,t,n){return e&&(Array.isArray(e)?e.map(e=>TO(e,t,n)):TO(e,t,n))}function DO(e){let t=e,n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&=CO(t.today,n),t.month&&=CO(t.month,n),t.defaultMonth&&=CO(t.defaultMonth,n),t.startMonth&&=CO(t.startMonth,n),t.endMonth&&=CO(t.endMonth,n),t.mode===`single`&&t.selected?t.selected=CO(t.selected,n):t.mode===`multiple`&&t.selected?t.selected=t.selected?.map(e=>CO(e,n)):t.mode===`range`&&t.selected&&(t.selected={from:t.selected.from?CO(t.selected.from,n):t.selected.from,to:t.selected.to?CO(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=EO(t.disabled,n)),t.hidden!==void 0&&(t.hidden=EO(t.hidden,n)),t.modifiers)){let e={};Object.keys(t.modifiers).forEach(r=>{e[r]=EO(t.modifiers?.[r],n)}),t.modifiers=e}let{components:r,formatters:i,labels:a,dateLib:o,locale:s,classNames:c}=(0,Q.useMemo)(()=>{let e={...pE,...t.locale},n=t.broadcastCalendar?1:t.weekStartsOn,r=t.noonSafe&&t.timeZone?UD(t.timeZone,{weekStartsOn:n,locale:e}):void 0,i=t.dateLib&&r?{...r,...t.dateLib}:t.dateLib??r,a=new mE({locale:e,weekStartsOn:n,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},i);return{dateLib:a,components:cD(t.components),formatters:xD(t.formatters),labels:RD(t.labels,a.options),locale:e,classNames:{...uD(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:o.today()});let{captionLayout:l,mode:u,navLayout:d,numberOfMonths:f=1,onDayBlur:p,onDayClick:m,onDayFocus:h,onDayKeyDown:g,onDayMouseEnter:_,onDayMouseLeave:v,onNextClick:y,onPrevClick:b,showWeekNumber:x,styles:S}=t,{formatCaption:C,formatDay:w,formatMonthDropdown:T,formatWeekNumber:E,formatWeekNumberHeader:D,formatWeekdayName:O,formatYearDropdown:k}=i,A=cO(t,o),{days:j,months:M,navStart:N,navEnd:P,previousMonth:F,nextMonth:I,goToMonth:L}=A,R=oD(j,t,N,P,o),{isSelected:z,select:B,selected:V}=SO(t,o)??{},{blur:H,focused:U,isFocusTarget:W,moveFocus:G,setFocused:K}=mO(t,A,R,z??(()=>!1),o),{labelDayButton:ee,labelGridcell:q,labelGrid:te,labelMonthDropdown:ne,labelNav:re,labelPrevious:ie,labelNext:ae,labelWeekday:oe,labelWeekNumber:se,labelWeekNumberHeader:ce,labelYearDropdown:le}=a,ue=(0,Q.useMemo)(()=>VD(o,t.ISOWeek,t.broadcastCalendar,t.today),[o,t.ISOWeek,t.broadcastCalendar,t.today]),de=u!==void 0||m!==void 0,fe=(0,Q.useCallback)(()=>{F&&(L(F),b?.(F))},[F,L,b]),pe=(0,Q.useCallback)(()=>{I&&(L(I),y?.(I))},[L,I,y]),me=(0,Q.useCallback)((e,t)=>n=>{n.preventDefault(),n.stopPropagation(),K(e),!t.disabled&&(B?.(e.date,t,n),m?.(e.date,t,n))},[B,m,K]),he=(0,Q.useCallback)((e,t)=>n=>{K(e),h?.(e.date,t,n)},[h,K]),ge=(0,Q.useCallback)((e,t)=>n=>{H(),p?.(e.date,t,n)},[H,p]),_e=(0,Q.useCallback)((e,n)=>r=>{let i={ArrowLeft:[r.shiftKey?`month`:`day`,t.dir===`rtl`?`after`:`before`],ArrowRight:[r.shiftKey?`month`:`day`,t.dir===`rtl`?`before`:`after`],ArrowDown:[r.shiftKey?`year`:`week`,`after`],ArrowUp:[r.shiftKey?`year`:`week`,`before`],PageUp:[r.shiftKey?`year`:`month`,`before`],PageDown:[r.shiftKey?`year`:`month`,`after`],Home:[`startOfWeek`,`before`],End:[`endOfWeek`,`after`]};if(i[r.key]){r.preventDefault(),r.stopPropagation();let[e,t]=i[r.key];G(e,t)}g?.(e.date,n,r)},[G,g,t.dir]),ve=(0,Q.useCallback)((e,t)=>n=>{_?.(e.date,t,n)},[_]),ye=(0,Q.useCallback)((e,t)=>n=>{v?.(e.date,t,n)},[v]),be=(0,Q.useCallback)(e=>t=>{let n=Number(t.target.value);L(o.setMonth(o.startOfMonth(e),n))},[o,L]),xe=(0,Q.useCallback)(e=>t=>{let n=Number(t.target.value);L(o.setYear(o.startOfMonth(e),n))},[o,L]),{className:Se,style:Ce}=(0,Q.useMemo)(()=>({className:[c[wE.Root],t.className].filter(Boolean).join(` `),style:{...S?.[wE.Root],...t.style}}),[c,t.className,t.style,S]),we=lD(t),Te=(0,Q.useRef)(null);ZD(Te,!!t.animate,{classNames:c,months:M,focused:U,dateLib:o});let Ee={dayPickerProps:t,selected:V,select:B,isSelected:z,months:M,nextMonth:I,previousMonth:F,goToMonth:L,getModifiers:R,components:r,classNames:c,styles:S,labels:a,formatters:i};return Q.createElement(FE.Provider,{value:Ee},Q.createElement(r.Root,{rootRef:t.animate?Te:void 0,className:Se,style:Ce,dir:t.dir,id:t.id,lang:t.lang??s.code,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t[`aria-label`],"aria-labelledby":t[`aria-labelledby`],...we},Q.createElement(r.Months,{className:c[wE.Months],style:S?.[wE.Months]},!t.hideNavigation&&!d&&Q.createElement(r.Nav,{"data-animated-nav":t.animate?`true`:void 0,className:c[wE.Nav],style:S?.[wE.Nav],"aria-label":re(),onPreviousClick:fe,onNextClick:pe,previousMonth:F,nextMonth:I}),M.map((e,n)=>Q.createElement(r.Month,{"data-animated-month":t.animate?`true`:void 0,className:c[wE.Month],style:S?.[wE.Month],key:n,displayIndex:n,calendarMonth:e},d===`around`&&!t.hideNavigation&&n===0&&Q.createElement(r.PreviousMonthButton,{type:`button`,className:c[wE.PreviousMonthButton],tabIndex:F?void 0:-1,"aria-disabled":F?void 0:!0,"aria-label":ie(F),onClick:fe,"data-animated-button":t.animate?`true`:void 0},Q.createElement(r.Chevron,{disabled:F?void 0:!0,className:c[wE.Chevron],orientation:t.dir===`rtl`?`right`:`left`})),Q.createElement(r.MonthCaption,{"data-animated-caption":t.animate?`true`:void 0,className:c[wE.MonthCaption],style:S?.[wE.MonthCaption],calendarMonth:e,displayIndex:n},l?.startsWith(`dropdown`)?Q.createElement(r.DropdownNav,{className:c[wE.Dropdowns],style:S?.[wE.Dropdowns]},(()=>{let n=l===`dropdown`||l===`dropdown-months`?Q.createElement(r.MonthsDropdown,{key:`month`,className:c[wE.MonthsDropdown],"aria-label":ne(),classNames:c,components:r,disabled:!!t.disableNavigation,onChange:be(e.date),options:zD(e.date,N,P,i,o),style:S?.[wE.Dropdown],value:o.getMonth(e.date)}):Q.createElement(`span`,{key:`month`},T(e.date,o)),a=l===`dropdown`||l===`dropdown-years`?Q.createElement(r.YearsDropdown,{key:`year`,className:c[wE.YearsDropdown],"aria-label":le(o.options),classNames:c,components:r,disabled:!!t.disableNavigation,onChange:xe(e.date),options:HD(N,P,i,o,!!t.reverseYears),style:S?.[wE.Dropdown],value:o.getYear(e.date)}):Q.createElement(`span`,{key:`year`},k(e.date,o));return o.getMonthYearOrder()===`year-first`?[a,n]:[n,a]})(),Q.createElement(`span`,{role:`status`,"aria-live":`polite`,style:{border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`,wordWrap:`normal`}},C(e.date,o.options,o))):Q.createElement(r.CaptionLabel,{className:c[wE.CaptionLabel],role:`status`,"aria-live":`polite`},C(e.date,o.options,o))),d===`around`&&!t.hideNavigation&&n===f-1&&Q.createElement(r.NextMonthButton,{type:`button`,className:c[wE.NextMonthButton],tabIndex:I?void 0:-1,"aria-disabled":I?void 0:!0,"aria-label":ae(I),onClick:pe,"data-animated-button":t.animate?`true`:void 0},Q.createElement(r.Chevron,{disabled:I?void 0:!0,className:c[wE.Chevron],orientation:t.dir===`rtl`?`left`:`right`})),n===f-1&&d===`after`&&!t.hideNavigation&&Q.createElement(r.Nav,{"data-animated-nav":t.animate?`true`:void 0,className:c[wE.Nav],style:S?.[wE.Nav],"aria-label":re(),onPreviousClick:fe,onNextClick:pe,previousMonth:F,nextMonth:I}),Q.createElement(r.MonthGrid,{role:`grid`,"aria-multiselectable":u===`multiple`||u===`range`,"aria-label":te(e.date,o.options,o)||void 0,className:c[wE.MonthGrid],style:S?.[wE.MonthGrid]},!t.hideWeekdays&&Q.createElement(r.Weekdays,{"data-animated-weekdays":t.animate?`true`:void 0,className:c[wE.Weekdays],style:S?.[wE.Weekdays]},x&&Q.createElement(r.WeekNumberHeader,{"aria-label":ce(o.options),className:c[wE.WeekNumberHeader],style:S?.[wE.WeekNumberHeader],scope:`col`},D()),ue.map(e=>Q.createElement(r.Weekday,{"aria-label":oe(e,o.options,o),className:c[wE.Weekday],key:String(e),style:S?.[wE.Weekday],scope:`col`},O(e,o.options,o)))),Q.createElement(r.Weeks,{"data-animated-weeks":t.animate?`true`:void 0,className:c[wE.Weeks],style:S?.[wE.Weeks]},e.weeks.map(e=>Q.createElement(r.Week,{className:c[wE.Week],key:e.weekNumber,style:S?.[wE.Week],week:e},x&&Q.createElement(r.WeekNumber,{week:e,style:S?.[wE.WeekNumber],"aria-label":se(e.weekNumber,{locale:s}),className:c[wE.WeekNumber],scope:`row`,role:`rowheader`},E(e.weekNumber,o)),e.days.map(e=>{let{date:n}=e,i=R(e);if(i[TE.focused]=!i.hidden&&!!U?.isEqualTo(e),i[EE.selected]=z?.(n)||i.selected,eD(V)){let{from:e,to:t}=V;i[EE.range_start]=!!(e&&t&&o.isSameDay(n,e)),i[EE.range_end]=!!(e&&t&&o.isSameDay(n,t)),i[EE.range_middle]=QE(V,n,!0,o)}let a=BD(i,S,t.modifiersStyles),s=sD(i,c,t.modifiersClassNames),l=!de&&!i.hidden?q(n,i,o.options,o):void 0;return Q.createElement(r.Day,{key:`${e.isoDate}_${e.displayMonthId}`,day:e,modifiers:i,className:s.join(` `),style:a,role:`gridcell`,"aria-selected":i.selected||void 0,"aria-label":l,"data-day":e.isoDate,"data-month":e.outside?e.dateMonthId:void 0,"data-selected":i.selected||void 0,"data-disabled":i.disabled||void 0,"data-hidden":i.hidden||void 0,"data-outside":e.outside||void 0,"data-focused":i.focused||void 0,"data-today":i.today||void 0},!i.hidden&&de?Q.createElement(r.DayButton,{className:c[wE.DayButton],style:S?.[wE.DayButton],type:`button`,day:e,modifiers:i,disabled:!i.focused&&i.disabled||void 0,"aria-disabled":i.focused&&i.disabled||void 0,tabIndex:W(e)?0:-1,"aria-label":ee(n,i,o.options,o),onClick:me(e,i),onBlur:ge(e,i),onFocus:he(e,i),onKeyDown:_e(e,i),onMouseEnter:ve(e,i),onMouseLeave:ye(e,i)},w(n,o.options,o)):!i.hidden&&w(e.date,o.options,o))})))))))),t.footer&&Q.createElement(r.Footer,{className:c[wE.Footer],style:S?.[wE.Footer],role:`status`,"aria-live":`polite`},t.footer)))}function OO(e){let t=(0,$.c)(97),n,r,i,a,o,s,c,l,u;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],u=t[9]):({className:n,classNames:r,showOutsideDays:c,captionLayout:l,buttonVariant:u,locale:o,formatters:a,components:i,...s}=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,t[9]=u);let d=c===void 0?!0:c,f=l===void 0?`label`:l,p=u===void 0?`ghost`:u,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U,W;if(t[10]!==p||t[11]!==f||t[12]!==n||t[13]!==a||t[14]!==o||t[15]!==s.showWeekNumber||t[16]!==d){let e=uD();m=DO,P=d,t[48]===n?F=t[49]:(F=Y(`group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent`,`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,n),t[48]=n,t[49]=F),I=f,L=o;let r;t[50]===o?.code?r=t[51]:(r=e=>e.toLocaleString(o?.code,{month:`short`}),t[50]=o?.code,t[51]=r),t[52]!==a||t[53]!==r?(R={formatMonthDropdown:r,...a},t[52]=a,t[53]=r,t[54]=R):R=t[54],z=Y(`w-fit`,e.root),B=Y(`relative flex flex-col gap-4 md:flex-row`,e.months),V=Y(`flex w-full flex-col gap-4`,e.month),H=Y(`absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1`,e.nav),U=Y(_i({variant:p}),`size-(--cell-size) p-0 select-none aria-disabled:opacity-50`,e.button_previous),W=Y(_i({variant:p}),`size-(--cell-size) p-0 select-none aria-disabled:opacity-50`,e.button_next),h=Y(`flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)`,e.month_caption),g=Y(`flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium`,e.dropdowns),_=Y(`relative rounded-(--cell-radius)`,e.dropdown_root),v=Y(`absolute inset-0 bg-popover opacity-0`,e.dropdown),y=Y(`font-medium select-none`,f===`label`?`text-sm`:`flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground`,e.caption_label),b=`w-full border-collapse`,x=Y(`flex`,e.weekdays),S=Y(`flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none`,e.weekday),C=Y(`mt-2 flex w-full`,e.week),w=Y(`w-(--cell-size) select-none`,e.week_number_header),T=Y(`text-[0.8rem] text-muted-foreground select-none`,e.week_number),E=Y(`group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)`,s.showWeekNumber?`[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)`:`[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)`,e.day),D=Y(`relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted`,e.range_start),O=Y(`rounded-none`,e.range_middle),k=Y(`relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted`,e.range_end),A=Y(`rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none`,e.today),j=Y(`text-muted-foreground aria-selected:text-muted-foreground`,e.outside),M=Y(`text-muted-foreground opacity-50`,e.disabled),N=Y(`invisible`,e.hidden),t[10]=p,t[11]=f,t[12]=n,t[13]=a,t[14]=o,t[15]=s.showWeekNumber,t[16]=d,t[17]=m,t[18]=h,t[19]=g,t[20]=_,t[21]=v,t[22]=y,t[23]=b,t[24]=x,t[25]=S,t[26]=C,t[27]=w,t[28]=T,t[29]=E,t[30]=D,t[31]=O,t[32]=k,t[33]=A,t[34]=j,t[35]=M,t[36]=N,t[37]=P,t[38]=F,t[39]=I,t[40]=L,t[41]=R,t[42]=z,t[43]=B,t[44]=V,t[45]=H,t[46]=U,t[47]=W}else m=t[17],h=t[18],g=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=t[30],O=t[31],k=t[32],A=t[33],j=t[34],M=t[35],N=t[36],P=t[37],F=t[38],I=t[39],L=t[40],R=t[41],z=t[42],B=t[43],V=t[44],H=t[45],U=t[46],W=t[47];let G;t[55]!==r||t[56]!==h||t[57]!==g||t[58]!==_||t[59]!==v||t[60]!==y||t[61]!==b||t[62]!==x||t[63]!==S||t[64]!==C||t[65]!==w||t[66]!==T||t[67]!==E||t[68]!==D||t[69]!==O||t[70]!==k||t[71]!==A||t[72]!==j||t[73]!==M||t[74]!==N||t[75]!==z||t[76]!==B||t[77]!==V||t[78]!==H||t[79]!==U||t[80]!==W?(G={root:z,months:B,month:V,nav:H,button_previous:U,button_next:W,month_caption:h,dropdowns:g,dropdown_root:_,dropdown:v,caption_label:y,table:b,weekdays:x,weekday:S,week:C,week_number_header:w,week_number:T,day:E,range_start:D,range_middle:O,range_end:k,today:A,outside:j,disabled:M,hidden:N,...r},t[55]=r,t[56]=h,t[57]=g,t[58]=_,t[59]=v,t[60]=y,t[61]=b,t[62]=x,t[63]=S,t[64]=C,t[65]=w,t[66]=T,t[67]=E,t[68]=D,t[69]=O,t[70]=k,t[71]=A,t[72]=j,t[73]=M,t[74]=N,t[75]=z,t[76]=B,t[77]=V,t[78]=H,t[79]=U,t[80]=W,t[81]=G):G=t[81];let K;t[82]===o?K=t[83]:(K=e=>{let{...t}=e;return(0,Z.jsx)(MO,{locale:o,...t})},t[82]=o,t[83]=K);let ee;t[84]!==i||t[85]!==K?(ee={Root:jO,Chevron:AO,DayButton:K,WeekNumber:kO,...i},t[84]=i,t[85]=K,t[86]=ee):ee=t[86];let q;return t[87]!==m||t[88]!==s||t[89]!==P||t[90]!==F||t[91]!==I||t[92]!==L||t[93]!==R||t[94]!==G||t[95]!==ee?(q=(0,Z.jsx)(m,{showOutsideDays:P,className:F,captionLayout:I,locale:L,formatters:R,classNames:G,components:ee,...s}),t[87]=m,t[88]=s,t[89]=P,t[90]=F,t[91]=I,t[92]=L,t[93]=R,t[94]=G,t[95]=ee,t[96]=q):q=t[96],q}function kO(e){let{children:t,...n}=e;return(0,Z.jsx)(`td`,{...n,children:(0,Z.jsx)(`div`,{className:`flex size-(--cell-size) items-center justify-center text-center`,children:t})})}function AO(e){let{className:t,orientation:n,...r}=e;return n===`left`?(0,Z.jsx)(Vs,{className:Y(`size-4`,t),...r}):n===`right`?(0,Z.jsx)(T,{className:Y(`size-4`,t),...r}):(0,Z.jsx)(I,{className:Y(`size-4`,t),...r})}function jO(e){let{className:t,rootRef:n,...r}=e;return(0,Z.jsx)(`div`,{"data-slot":`calendar`,ref:n,className:Y(t),...r})}function MO(e){let t=(0,$.c)(21),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,day:r,modifiers:a,locale:i,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=uD(),c=Q.useRef(null),l,u;t[6]===a.focused?(l=t[7],u=t[8]):(l=()=>{a.focused&&c.current?.focus()},u=[a.focused],t[6]=a.focused,t[7]=l,t[8]=u),Q.useEffect(l,u);let d=J,f;t[9]!==r.date||t[10]!==i?.code?(f=r.date.toLocaleDateString(i?.code),t[9]=r.date,t[10]=i?.code,t[11]=f):f=t[11];let p=a.selected&&!a.range_start&&!a.range_end&&!a.range_middle,m=a.range_start,h=a.range_end,g=a.range_middle,_=Y(`relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70`,s.day,n),v;return t[12]!==d||t[13]!==a.range_end||t[14]!==a.range_middle||t[15]!==a.range_start||t[16]!==o||t[17]!==_||t[18]!==f||t[19]!==p?(v=(0,Z.jsx)(d,{ref:c,variant:`ghost`,size:`icon`,"data-day":f,"data-selected-single":p,"data-range-start":m,"data-range-end":h,"data-range-middle":g,className:_,...o}),t[12]=d,t[13]=a.range_end,t[14]=a.range_middle,t[15]=a.range_start,t[16]=o,t[17]=_,t[18]=f,t[19]=p,t[20]=v):v=t[20],v}function NO(e){let t=(0,$.c)(16),{keyName:n,value:r,onCommit:i}=e,[a,o]=(0,Q.useState)(r),s=(0,Q.useRef)(!1),c=(0,Q.useRef)(!1),l,u;t[0]===r?(l=t[1],u=t[2]):(l=()=>{s.current||o(r)},u=[r],t[0]=r,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u);let d=`${n} value`,f,p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>o(e.target.value),p=()=>{s.current=!0},t[3]=f,t[4]=p):(f=t[3],p=t[4]);let m,h;t[5]!==a||t[6]!==i||t[7]!==r?(m=()=>{if(s.current=!1,c.current){c.current=!1;return}a!==r&&i(a)},h=e=>{e.key===`Enter`&&!e.shiftKey&&!e.metaKey&&!e.ctrlKey?(e.preventDefault(),a!==r&&i(a),e.currentTarget.blur()):e.key===`Escape`&&(e.preventDefault(),c.current=!0,o(r),e.currentTarget.blur())},t[5]=a,t[6]=i,t[7]=r,t[8]=m,t[9]=h):(m=t[8],h=t[9]);let g;return t[10]!==a||t[11]!==n||t[12]!==d||t[13]!==m||t[14]!==h?(g=(0,Z.jsx)(`textarea`,{"data-testid":`text-widget`,"data-key":n,rows:1,value:a,placeholder:`Empty`,"aria-label":d,onChange:f,onFocus:p,onBlur:m,onKeyDown:h,className:`block w-full min-h-7 resize-none field-sizing-content border-transparent bg-transparent px-2 py-1 text-sm leading-tight shadow-none placeholder:text-muted-foreground/60 focus-visible:border-transparent focus-visible:bg-muted focus-visible:outline-none focus-visible:ring-0 rounded-sm dark:bg-transparent dark:focus-visible:bg-muted`}),t[10]=a,t[11]=n,t[12]=d,t[13]=m,t[14]=h,t[15]=g):g=t[15],g}function PO(e){let t=(0,$.c)(17),{keyName:n,value:r,onCommit:i}=e,[a,o]=(0,Q.useState)(String(r)),s=(0,Q.useRef)(!1),c=(0,Q.useRef)(!1),l,u;t[0]===r?(l=t[1],u=t[2]):(l=()=>{s.current||o(String(r))},u=[r],t[0]=r,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u);let d=`${n} value`,f,p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>o(e.target.value),p=()=>{s.current=!0},t[3]=f,t[4]=p):(f=t[3],p=t[4]);let m;t[5]!==a||t[6]!==i||t[7]!==r?(m=()=>{if(s.current=!1,c.current){c.current=!1,o(String(r));return}let e=Number.parseFloat(a),t=Number.isFinite(e)?e:0;t===r?o(String(r)):i(t)},t[5]=a,t[6]=i,t[7]=r,t[8]=m):m=t[8];let h;t[9]===r?h=t[10]:(h=e=>{e.key===`Enter`?(e.preventDefault(),e.currentTarget.blur()):e.key===`Escape`&&(e.preventDefault(),c.current=!0,o(String(r)),e.currentTarget.blur())},t[9]=r,t[10]=h);let g;return t[11]!==a||t[12]!==n||t[13]!==d||t[14]!==m||t[15]!==h?(g=(0,Z.jsx)(Ho,{"data-testid":`number-widget`,"data-key":n,type:`number`,value:a,"aria-label":d,onChange:f,onFocus:p,onBlur:m,onKeyDown:h,className:`h-7 border-transparent bg-transparent dark:bg-transparent px-2 text-sm shadow-none focus-visible:border-transparent focus-visible:bg-muted focus-visible:ring-0 rounded-sm dark:focus-visible:bg-muted`}),t[11]=a,t[12]=n,t[13]=d,t[14]=m,t[15]=h,t[16]=g):g=t[16],g}function FO(e){let t=(0,$.c)(7),{keyName:n,value:r,onCommit:i}=e,a;t[0]===i?a=t[1]:(a=e=>i(e===!0),t[0]=i,t[1]=a);let o=`${n} value`,s;return t[2]!==n||t[3]!==a||t[4]!==o||t[5]!==r?(s=(0,Z.jsx)(`div`,{className:`flex h-7 items-center px-2`,children:(0,Z.jsx)(ko,{"data-testid":`boolean-widget`,"data-key":n,checked:r,onCheckedChange:a,"aria-label":o,className:`size-5 rounded-full`})}),t[2]=n,t[3]=a,t[4]=o,t[5]=r,t[6]=s):s=t[6],s}function IO(e){let t=(0,$.c)(42),{keyName:n,value:r,onCommit:i}=e,a,o,s;t[0]===r?(a=t[1],o=t[2],s=t[3]):(a=RO(r),o=Q.useState,s=zO(a),t[0]=r,t[1]=a,t[2]=o,t[3]=s);let[c,l]=o(s),[u,d]=(0,Q.useState)(a),[f,p]=(0,Q.useState)(!1),m=(0,Q.useRef)(!1),h=(0,Q.useRef)(!1),g,_;t[4]===r?(g=t[5],_=t[6]):(g=()=>{if(!m.current){let e=RO(r);l(zO(e)),d(e)}},_=[r],t[4]=r,t[5]=g,t[6]=_),(0,Q.useEffect)(g,_);let v;t[7]!==a||t[8]!==c||t[9]!==i||t[10]!==r?(v=function(){let e=VO(c);if(e){let t=sw(e,`yyyy-MM-dd`);t!==r&&i(t),l(zO(e)),d(e)}else l(zO(a)),d(a)},t[7]=a,t[8]=c,t[9]=i,t[10]=r,t[11]=v):v=t[11];let y=v,b;t[12]!==i||t[13]!==r?(b=function(e){if(!e)return;let t=sw(e,`yyyy-MM-dd`);t!==r&&i(t),l(zO(e)),d(e),p(!1)},t[12]=i,t[13]=r,t[14]=b):b=t[14];let x=b,S=`${n} value`,w,T;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{l(e.target.value);let t=VO(e.target.value);t&&d(t)},T=()=>{m.current=!0},t[15]=w,t[16]=T):(w=t[15],T=t[16]);let E;t[17]===y?E=t[18]:(E=()=>{if(m.current=!1,h.current){h.current=!1;return}y()},t[17]=y,t[18]=E);let D;t[19]!==y||t[20]!==a?(D=e=>{e.key===`Enter`?(e.preventDefault(),y(),e.currentTarget.blur()):e.key===`Escape`?(e.preventDefault(),h.current=!0,l(zO(a)),e.currentTarget.blur()):e.key===`ArrowDown`&&(e.preventDefault(),p(!0))},t[19]=y,t[20]=a,t[21]=D):D=t[21];let O;t[22]!==c||t[23]!==E||t[24]!==D||t[25]!==S?(O=(0,Z.jsx)(Ho,{type:`text`,value:c,placeholder:`Empty`,"aria-label":S,onChange:w,onFocus:T,onBlur:E,onKeyDown:D,className:`h-7 border-transparent bg-transparent dark:bg-transparent pr-7 pl-2 text-sm shadow-none placeholder:text-muted-foreground/60 focus-visible:border-transparent focus-visible:bg-muted focus-visible:ring-0 rounded-sm dark:focus-visible:bg-muted`}),t[22]=c,t[23]=E,t[24]=D,t[25]=S,t[26]=O):O=t[26];let k=`Open date picker for ${n}`,A;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsx)(Rs,{className:`size-3.5`}),t[27]=A):A=t[27];let j;t[28]===k?j=t[29]:(j=(0,Z.jsx)(M,{asChild:!0,children:(0,Z.jsx)(J,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":k,className:`absolute right-0 size-6 p-0 text-muted-foreground hover:bg-muted hover:text-foreground`,children:A})}),t[28]=k,t[29]=j);let N;t[30]!==a||t[31]!==x||t[32]!==u?(N=(0,Z.jsx)(C,{className:`w-auto overflow-hidden p-0`,align:`end`,children:(0,Z.jsx)(OO,{mode:`single`,selected:a,month:u,onMonthChange:d,onSelect:x,captionLayout:`dropdown`})}),t[30]=a,t[31]=x,t[32]=u,t[33]=N):N=t[33];let P;t[34]!==f||t[35]!==j||t[36]!==N?(P=(0,Z.jsxs)(re,{open:f,onOpenChange:p,children:[j,N]}),t[34]=f,t[35]=j,t[36]=N,t[37]=P):P=t[37];let F;return t[38]!==n||t[39]!==O||t[40]!==P?(F=(0,Z.jsxs)(`div`,{"data-testid":`date-widget`,"data-key":n,className:`relative flex h-7 items-center`,children:[O,P]}),t[38]=n,t[39]=O,t[40]=P,t[41]=F):F=t[41],F}var LO=`MMM d, yyyy`;function RO(e){if(!e)return;let t=OT(e);return Number.isNaN(t.getTime())?void 0:t}function zO(e){return e?sw(e,LO):``}var BO=[`MMM d, yyyy`,`MMMM d, yyyy`,`yyyy-MM-dd`,`M/d/yyyy`,`MM/dd/yyyy`];function VO(e){let t=e.trim();if(!t)return;let n=new Date;for(let e of BO){let r=wT(t,e,n);if(!Number.isNaN(r.getTime()))return r}}function HO(e){let t=(0,$.c)(32),{keyName:n,value:r,onCommit:i}=e,[a,o]=(0,Q.useState)(``),s;t[0]!==i||t[1]!==r?(s=function(e){let t=e.trim();t&&(i([...r,t]),o(``))},t[0]=i,t[1]=r,t[2]=s):s=t[2];let c=s,l;t[3]!==i||t[4]!==r?(l=function(e){let t=r.slice();t.splice(e,1),i(t)},t[3]=i,t[4]=r,t[5]=l):l=t[5];let u=l,d=n===`tags`,f;if(t[6]!==d||t[7]!==u||t[8]!==r){let e;t[10]!==d||t[11]!==u?(e=(e,t)=>{let n=d&&pr.test(e);return(0,Z.jsxs)(`span`,{"data-testid":`list-chip`,"data-index":t,className:Y(`inline-flex items-center text-1sm gap-0.5 rounded-full py-0.5 pl-2 pr-1.5 transition-colors`,n?`bg-primary/10 font-medium text-primary has-[button[data-tag]:hover]:bg-primary/20 has-[button[data-tag]:active]:bg-primary/25`:`bg-muted `),children:[n?(0,Z.jsxs)(`button`,{type:`button`,"data-tag":e,"aria-label":`Open documents tagged #${e}`,onClick:()=>Ye(e),className:`cursor-pointer rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[`#`,e]}):(0,Z.jsx)(`span`,{children:e}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e}`,onClick:()=>u(t),className:Y(`inline-flex items-center justify-center rounded-sm p-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,n?`text-primary opacity-70 hover:text-primary hover:opacity-100`:`text-muted-foreground hover:text-foreground`),children:(0,Z.jsx)(fo,{className:`size-3`,"aria-hidden":`true`})})]},`${t}-${e}`)},t[10]=d,t[11]=u,t[12]=e):e=t[12],f=r.map(e),t[6]=d,t[7]=u,t[8]=r,t[9]=f}else f=t[9];let p=r.length===0?`Empty`:``,m=`${n} value`,h;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>o(e.target.value),t[13]=h):h=t[13];let g;t[14]!==c||t[15]!==a||t[16]!==u||t[17]!==r.length?(g=e=>{e.key===`Enter`?(e.preventDefault(),c(a)):e.key===`Backspace`&&a===``&&r.length>0?(e.preventDefault(),u(r.length-1)):e.key===`Escape`&&(e.preventDefault(),o(``),e.currentTarget.blur())},t[14]=c,t[15]=a,t[16]=u,t[17]=r.length,t[18]=g):g=t[18];let _;t[19]!==c||t[20]!==a?(_=()=>{a&&c(a)},t[19]=c,t[20]=a,t[21]=_):_=t[21];let v;t[22]!==a||t[23]!==p||t[24]!==m||t[25]!==g||t[26]!==_?(v=(0,Z.jsx)(`input`,{"data-testid":`list-chip-input`,type:`text`,value:a,placeholder:p,"aria-label":m,onChange:h,onKeyDown:g,onBlur:_,className:`min-w-16 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60`}),t[22]=a,t[23]=p,t[24]=m,t[25]=g,t[26]=_,t[27]=v):v=t[27];let y;return t[28]!==n||t[29]!==f||t[30]!==v?(y=(0,Z.jsxs)(`div`,{"data-testid":`list-widget`,"data-key":n,className:`flex min-h-7 w-full min-w-0 flex-wrap items-center gap-1 rounded-md px-2 py-1 focus-within:bg-background`,children:[f,v]}),t[28]=n,t[29]=f,t[30]=v,t[31]=y):y=t[31],y}var UO={text:$c,number:ne,boolean:Uc,date:Rs,list:g},WO={text:`Text`,number:`Number`,boolean:`Checkbox`,date:`Date`,list:`List`},GO={text:``,number:0,boolean:!1,date:``,list:[]};function KO(e){let t=(0,$.c)(30),{keyName:n,type:r,onChangeType:i,disabled:a,onCloseAutoFocus:o}=e,s=a===void 0?!1:a,c=UO[r];if(s){let e=`${n} type: ${WO[r]} (inherited from folder defaults; not editable here)`,i;t[0]===c?i=t[1]:(i=(0,Z.jsx)(c,{className:`size-3.5`}),t[0]=c,t[1]=i);let a;t[2]!==n||t[3]!==e||t[4]!==i||t[5]!==r?(a=(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsx)(`span`,{tabIndex:0,className:`inline-flex`,children:(0,Z.jsx)(`button`,{type:`button`,disabled:!0,"data-testid":`type-icon-button`,"data-key":n,"data-type":r,"aria-label":e,className:`flex size-7 shrink-0 items-center justify-center rounded text-muted-foreground disabled:cursor-default`,children:i})})}),t[2]=n,t[3]=e,t[4]=i,t[5]=r,t[6]=a):a=t[6];let o;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(zo,{children:`Inherited — set a value to override.`}),t[7]=o):o=t[7];let s;return t[8]===a?s=t[9]:(s=(0,Z.jsxs)(Vo,{children:[a,o]}),t[8]=a,t[9]=s),s}let l=`${n} type: ${WO[r]}. Click to change.`,u;t[10]===c?u=t[11]:(u=(0,Z.jsx)(c,{className:`size-3.5`}),t[10]=c,t[11]=u);let d;t[12]!==n||t[13]!==l||t[14]!==u||t[15]!==r?(d=(0,Z.jsx)(qi,{"data-testid":`type-icon-button`,"data-key":n,"data-type":r,"aria-label":l,className:`flex size-7 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:u}),t[12]=n,t[13]=l,t[14]=u,t[15]=r,t[16]=d):d=t[16];let f;t[17]===i?f=t[18]:(f=e=>i(e),t[17]=i,t[18]=f);let p;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(p=Object.keys(UO),t[19]=p):p=t[19];let m;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(m=p.map(qO),t[20]=m):m=t[20];let h;t[21]!==f||t[22]!==r?(h=(0,Z.jsx)(ao,{value:r,onValueChange:f,children:m}),t[21]=f,t[22]=r,t[23]=h):h=t[23];let g;t[24]!==o||t[25]!==h?(g=(0,Z.jsx)(Yi,{align:`start`,"data-testid":`type-picker-menu`,onCloseAutoFocus:o,children:h}),t[24]=o,t[25]=h,t[26]=g):g=t[26];let _;return t[27]!==d||t[28]!==g?(_=(0,Z.jsxs)(ra,{children:[d,g]}),t[27]=d,t[28]=g,t[29]=_):_=t[29],_}function qO(e){let t=UO[e];return(0,Z.jsxs)(zi,{value:e,"data-testid":`type-picker-item`,"data-type":e,children:[(0,Z.jsx)(t,{className:`size-3.5 text-muted-foreground`}),(0,Z.jsx)(`span`,{children:WO[e]})]},e)}function JO(e,t){switch(t){case`text`:return Array.isArray(e)?e.join(`, `):String(e);case`number`:{if(typeof e==`number`)return e;let t=Array.isArray(e)?e[0]:String(e),n=Number.parseFloat(t??``);return Number.isFinite(n)?n:0}case`boolean`:return typeof e==`boolean`?e:typeof e==`number`?e!==0:((Array.isArray(e)?e[0]:String(e))??``).toLowerCase()===`true`;case`date`:return typeof e==`string`&&/^\d{4}-\d{2}-\d{2}$/.test(e)?e:new Date().toISOString().slice(0,10);case`list`:{if(Array.isArray(e))return e;let t=String(e);return t?[t]:[]}}}function YO(e,t){return Array.isArray(e)?`list`:typeof e==`boolean`?`boolean`:typeof e==`number`?`number`:t===`list`?`text`:t}function XO(e){let t=(0,$.c)(21),{keyName:n,value:r,declared:i,error:a,resetCounter:o,sortableId:s,rename:c,isDuplicate:l,badge:u,isInherited:d,onCommit:f,onChangeType:p,onRemove:m}=e,h=o===void 0?0:o,g=l===void 0?!1:l,_=d===void 0?!1:d,v;t[0]!==u||t[1]!==i||t[2]!==a||t[3]!==g||t[4]!==_||t[5]!==n||t[6]!==p||t[7]!==f||t[8]!==m||t[9]!==c||t[10]!==h||t[11]!==r?(v=e=>(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-1`,children:[e,(0,Z.jsxs)(`div`,{className:`flex items-center gap-1${_?` opacity-60`:``}`,"data-testid":`property-row-identity`,children:[(0,Z.jsx)(KO,{keyName:n,type:i,onChangeType:p,disabled:_}),(0,Z.jsx)(`div`,{className:`w-32 shrink-0`,children:c?.state?(0,Z.jsx)($O,{keyName:n,draft:c.state.draft,error:c.state.error,onChangeDraft:c.onChangeDraft,onCommit:c.onCommit,onCancel:c.onCancel}):(0,Z.jsx)(ek,{keyName:n,onBegin:c?.onBegin,disabled:!c,isInherited:_})})]}),g?(0,Z.jsx)(`span`,{"data-testid":`property-duplicate-marker`,"data-key":n,title:`Duplicate name "${n}"`,className:`flex size-4 items-center justify-center text-amber-600`,children:(0,Z.jsx)(Jr,{className:`size-3.5`})}):null,(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:_&&i===`list`?(0,Z.jsx)(ik,{keyName:n,value:Array.isArray(r)?r:[]}):(0,Z.jsx)(nk,{keyName:n,value:r,widgetType:i,onCommit:f},`widget-${h}`)}),u?(0,Z.jsx)(`div`,{className:`shrink-0 min-h-7 flex items-center`,children:u}):null,m?(0,Z.jsx)(J,{type:`button`,"data-testid":`property-remove-button`,"data-key":n,"aria-label":`Remove ${n}`,onClick:m,variant:`ghost`,size:`icon-sm`,className:`flex shrink-0 items-center justify-center rounded text-muted-foreground/0 hover:bg-muted hover:text-foreground focus-visible:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring group-hover:text-muted-foreground`,children:(0,Z.jsx)(Dt,{className:`size-3.5`})}):null]}),a?(0,Z.jsx)(`div`,{role:`alert`,"data-testid":`property-error`,"data-key":n,className:`pl-9 text-[10px] text-destructive`,children:a}):null]}),t[0]=u,t[1]=i,t[2]=a,t[3]=g,t[4]=_,t[5]=n,t[6]=p,t[7]=f,t[8]=m,t[9]=c,t[10]=h,t[11]=r,t[12]=v):v=t[12];let y;return t[13]!==i||t[14]!==a||t[15]!==g||t[16]!==_||t[17]!==n||t[18]!==s||t[19]!==v?(y=(0,Z.jsx)(ZO,{sortableId:s,keyName:n,declared:i,error:a,isDuplicate:g,isInherited:_,children:v}),t[13]=i,t[14]=a,t[15]=g,t[16]=_,t[17]=n,t[18]=s,t[19]=v,t[20]=y):y=t[20],y}function ZO(e){let t=(0,$.c)(19),{sortableId:n,keyName:r,declared:i,error:a,isDuplicate:o,isInherited:s,children:c}=e;if(n){let e;return t[0]!==c||t[1]!==i||t[2]!==a||t[3]!==o||t[4]!==r||t[5]!==n?(e=(0,Z.jsx)(QO,{sortableId:n,keyName:r,declared:i,error:a,isDuplicate:o,children:c}),t[0]=c,t[1]=i,t[2]=a,t[3]=o,t[4]=r,t[5]=n,t[6]=e):e=t[6],e}let l;t[7]===s?l=t[8]:(l=s?(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`h-7 w-4 shrink-0`}):null,t[7]=s,t[8]=l);let u=l,d=a??void 0,f=o||void 0,p=s||void 0,m;t[9]!==c||t[10]!==u?(m=c(u),t[9]=c,t[10]=u,t[11]=m):m=t[11];let h;return t[12]!==i||t[13]!==r||t[14]!==d||t[15]!==f||t[16]!==p||t[17]!==m?(h=(0,Z.jsx)(`div`,{className:`group py-0.5`,"data-testid":`property-row`,"data-key":r,"data-widget-type":i,"data-error":d,"data-duplicate":f,"data-inherited":p,children:m}),t[12]=i,t[13]=r,t[14]=d,t[15]=f,t[16]=p,t[17]=m,t[18]=h):h=t[18],h}function QO(e){let t=(0,$.c)(27),{sortableId:n,keyName:r,declared:i,error:a,isDuplicate:o,children:s}=e,c;t[0]===n?c=t[1]:(c={id:n},t[0]=n,t[1]=c);let{attributes:l,listeners:u,setNodeRef:d,transform:f,transition:p,isDragging:m}=ca(c),h;t[2]===f?h=t[3]:(h=ea.Transform.toString(f),t[2]=f,t[3]=h);let g=m?.5:void 0,_=m?1:void 0,v;t[4]!==h||t[5]!==g||t[6]!==_||t[7]!==p?(v={transform:h,transition:p,opacity:g,zIndex:_},t[4]=h,t[5]=g,t[6]=_,t[7]=p,t[8]=v):v=t[8];let y=v,b=`Drag ${r} to reorder`,x;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(na,{className:`size-3.5`}),t[9]=x):x=t[9];let S;t[10]!==l||t[11]!==r||t[12]!==u||t[13]!==b?(S=(0,Z.jsx)(J,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-testid":`property-drag-handle`,"data-key":r,"aria-label":b,...l,...u,className:`h-7 w-4 shrink-0 cursor-grab touch-none px-0 text-muted-foreground/0 hover:text-foreground focus-visible:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring active:cursor-grabbing group-hover:text-muted-foreground/60`,children:x}),t[10]=l,t[11]=r,t[12]=u,t[13]=b,t[14]=S):S=t[14];let C=S,w=a??void 0,T=o||void 0,E=m||void 0,D;t[15]!==s||t[16]!==C?(D=s(C),t[15]=s,t[16]=C,t[17]=D):D=t[17];let O;return t[18]!==i||t[19]!==r||t[20]!==d||t[21]!==y||t[22]!==T||t[23]!==E||t[24]!==D||t[25]!==w?(O=(0,Z.jsx)(`div`,{ref:d,style:y,className:`group py-0.5`,"data-testid":`property-row`,"data-key":r,"data-widget-type":i,"data-error":w,"data-duplicate":T,"data-dragging":E,children:D}),t[18]=i,t[19]=r,t[20]=d,t[21]=y,t[22]=T,t[23]=E,t[24]=D,t[25]=w,t[26]=O):O=t[26],O}function $O(e){let t=(0,$.c)(20),{keyName:n,draft:r,error:i,onChangeDraft:a,onCommit:o,onCancel:s}=e,c=i?`property-rename-error-${n}`:void 0,l=`Rename ${n}`,u=i?!0:void 0,d;t[0]===a?d=t[1]:(d=e=>a(e.target.value),t[0]=a,t[1]=d);let f;t[2]!==s||t[3]!==o?(f=e=>{e.key===`Enter`?(e.preventDefault(),o()):e.key===`Escape`&&(e.preventDefault(),s())},t[2]=s,t[3]=o,t[4]=f):f=t[4];let p;t[5]!==r||t[6]!==c||t[7]!==n||t[8]!==o||t[9]!==l||t[10]!==u||t[11]!==d||t[12]!==f?(p=(0,Z.jsx)(Ho,{"data-testid":`property-name-rename-input`,"data-key":n,type:`text`,value:r,autoFocus:!0,"aria-label":l,"aria-invalid":u,"aria-describedby":c,onChange:d,onBlur:o,onKeyDown:f,className:`h-7 border-transparent bg-transparent dark:bg-transparent px-2 text-sm shadow-none focus-visible:border-transparent focus-visible:bg-muted focus-visible:ring-0 rounded-sm dark:focus-visible:bg-muted`}),t[5]=r,t[6]=c,t[7]=n,t[8]=o,t[9]=l,t[10]=u,t[11]=d,t[12]=f,t[13]=p):p=t[13];let m;t[14]!==i||t[15]!==c?(m=i?(0,Z.jsx)(`div`,{id:c,"data-testid":`property-name-rename-error`,className:`text-[10px] text-destructive`,children:i}):null,t[14]=i,t[15]=c,t[16]=m):m=t[16];let h;return t[17]!==p||t[18]!==m?(h=(0,Z.jsxs)(`div`,{children:[p,m]}),t[17]=p,t[18]=m,t[19]=h):h=t[19],h}function ek(e){let t=(0,$.c)(9),{keyName:n,onBegin:r,disabled:i,isInherited:a}=e,o;t[0]!==i||t[1]!==n||t[2]!==r?(o=(0,Z.jsx)(J,{type:`button`,variant:`ghost`,"data-testid":`property-name-button`,"data-key":n,onClick:r,disabled:i,className:`block h-7 w-full truncate px-2 py-0.5 text-left text-sm rounded-sm font-normal text-muted-foreground hover:bg-transparent hover:text-foreground disabled:opacity-100 disabled:cursor-default`,children:n}),t[0]=i,t[1]=n,t[2]=r,t[3]=o):o=t[3];let s=o;if(!a)return s;let c;t[4]===s?c=t[5]:(c=(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsx)(`span`,{tabIndex:0,className:`block w-full`,children:s})}),t[4]=s,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(zo,{children:`Inherited — set a value to override.`}),t[6]=l):l=t[6];let u;return t[7]===c?u=t[8]:(u=(0,Z.jsxs)(Vo,{children:[c,l]}),t[7]=c,t[8]=u),u}function tk(e){let t=(0,$.c)(36),{draft:n,onChangeName:r,onChangeType:i,onChangeValue:a,onCommit:o,onCancel:s}=e,c=n.error?`add-property-error-id`:void 0,l=(0,Q.useRef)(null),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>{e.preventDefault(),l.current?.focus()},t[0]=u):u=t[0];let d;t[1]!==n.type||t[2]!==i?(d=(0,Z.jsx)(KO,{keyName:`__add__`,type:n.type,onChangeType:i,onCloseAutoFocus:u}),t[1]=n.type,t[2]=i,t[3]=d):d=t[3];let f=n.error?!0:void 0,p;t[4]===r?p=t[5]:(p=e=>r(e.target.value),t[4]=r,t[5]=p);let m;t[6]!==s||t[7]!==o?(m=e=>{e.key===`Enter`?(e.preventDefault(),o()):e.key===`Escape`&&(e.preventDefault(),s())},t[6]=s,t[7]=o,t[8]=m):m=t[8];let h;t[9]!==n.name||t[10]!==c||t[11]!==f||t[12]!==p||t[13]!==m?(h=(0,Z.jsx)(Ho,{ref:l,"data-testid":`add-property-name-input`,type:`text`,value:n.name,autoFocus:!0,placeholder:`Property name`,"aria-label":`New property name`,"aria-invalid":f,"aria-describedby":c,onChange:p,onKeyDown:m,className:`h-7 w-32 border-transparent bg-transparent px-2 text-sm shadow-none placeholder:text-muted-foreground/60 focus-visible:border-transparent focus-visible:bg-muted focus-visible:ring-0 rounded-sm`}),t[9]=n.name,t[10]=c,t[11]=f,t[12]=p,t[13]=m,t[14]=h):h=t[14];let g;t[15]!==n.type||t[16]!==n.value||t[17]!==a?(g=(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,Z.jsx)(nk,{keyName:`__add__`,value:n.value,widgetType:n.type,onCommit:a})}),t[15]=n.type,t[16]=n.value,t[17]=a,t[18]=g):g=t[18];let _;t[19]===o?_=t[20]:(_=(0,Z.jsx)(J,{type:`button`,"data-testid":`add-property-commit`,onClick:o,size:`sm`,className:`rounded bg-primary text-xs text-primary-foreground hover:bg-primary/90`,children:`Add`}),t[19]=o,t[20]=_);let v;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(fo,{className:`size-3.5`}),t[21]=v):v=t[21];let y;t[22]===s?y=t[23]:(y=(0,Z.jsx)(J,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-testid":`add-property-cancel`,onClick:s,"aria-label":`Cancel`,className:`rounded px-1 py-0.5 text-xs text-muted-foreground hover:text-foreground`,children:v}),t[22]=s,t[23]=y);let b;t[24]!==y||t[25]!==d||t[26]!==h||t[27]!==g||t[28]!==_?(b=(0,Z.jsxs)(`div`,{className:`flex items-start gap-1`,children:[d,h,g,_,y]}),t[24]=y,t[25]=d,t[26]=h,t[27]=g,t[28]=_,t[29]=b):b=t[29];let x;t[30]!==n.error||t[31]!==c?(x=n.error?(0,Z.jsx)(`div`,{id:c,role:`alert`,"data-testid":`add-property-error`,className:`mt-0.5 pl-7 text-[10px] text-destructive`,children:n.error}):null,t[30]=n.error,t[31]=c,t[32]=x):x=t[32];let S;return t[33]!==b||t[34]!==x?(S=(0,Z.jsxs)(`div`,{className:`mt-1 rounded border border-dashed bg-background/40 p-1`,"data-testid":`add-property-row`,children:[b,x]}),t[33]=b,t[34]=x,t[35]=S):S=t[35],S}function nk(e){let t=(0,$.c)(24),{keyName:n,value:r,widgetType:i,onCommit:a}=e;if(i===`list`){let e;t[0]===r?e=t[1]:(e=Array.isArray(r)?r:[],t[0]=r,t[1]=e);let i=e,o;return t[2]!==i||t[3]!==n||t[4]!==a?(o=(0,Z.jsx)(HO,{keyName:n,value:i,onCommit:a}),t[2]=i,t[3]=n,t[4]=a,t[5]=o):o=t[5],o}if(i===`boolean`){let e=typeof r==`boolean`?r:!1,i;return t[6]!==e||t[7]!==n||t[8]!==a?(i=(0,Z.jsx)(FO,{keyName:n,value:e,onCommit:a}),t[6]=e,t[7]=n,t[8]=a,t[9]=i):i=t[9],i}if(i===`number`){let e=typeof r==`number`?r:0,i;return t[10]!==n||t[11]!==e||t[12]!==a?(i=(0,Z.jsx)(PO,{keyName:n,value:e,onCommit:a}),t[10]=n,t[11]=e,t[12]=a,t[13]=i):i=t[13],i}if(i===`date`){let e=typeof r==`string`?r:``,i;return t[14]!==n||t[15]!==a||t[16]!==e?(i=(0,Z.jsx)(IO,{keyName:n,value:e,onCommit:a}),t[14]=n,t[15]=a,t[16]=e,t[17]=i):i=t[17],i}let o;t[18]===r?o=t[19]:(o=typeof r==`string`?r:Array.isArray(r)?r.join(`, `):String(r),t[18]=r,t[19]=o);let s=o,c;return t[20]!==n||t[21]!==a||t[22]!==s?(c=(0,Z.jsx)(NO,{keyName:n,value:s,onCommit:a}),t[20]=n,t[21]=a,t[22]=s,t[23]=c):c=t[23],c}function rk(e){let t=(0,$.c)(2),{source:n}=e,r=`Inherited from ${n===``?`.ok/frontmatter.yml`:`${n}/.ok/frontmatter.yml`}`,i;return t[0]===r?i=t[1]:(i=(0,Z.jsx)(je,{variant:`gray`,"data-testid":`property-inherited-badge`,title:r,className:`text-2xs`,children:`inherited`}),t[0]=r,t[1]=i),i}function ik(e){let t=(0,$.c)(5),{keyName:n,value:r}=e,i;t[0]===r?i=t[1]:(i=r.length===0?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground/60`,children:`Empty`}):r.map(ak),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,Z.jsx)(`div`,{"data-testid":`list-widget-readonly`,"data-key":n,className:`flex min-h-7 w-full min-w-0 flex-wrap items-center gap-1 rounded-md px-2`,children:i}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function ak(e,t){return(0,Z.jsx)(`span`,{"data-testid":`list-chip-readonly`,"data-index":t,className:`inline-flex items-center text-1sm rounded-full bg-muted py-0.5 px-2`,children:String(e)},`${t}-${String(e)}`)}function ok(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)(ck,{}),(0,Z.jsx)(Ka,{className:`h-7 w-full`}),(0,Z.jsx)(Ka,{className:`h-7 w-full`}),(0,Z.jsx)(Ka,{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=Za(r.data.folder.path),t[7]=r.data.folder.path,t[8]=g);let _=g,v,y,b,x,S,C,w,E,D,O,k,A,j;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 ba(n,{[e]:t});if(!r.ok){X.error(`Save failed: ${r.error}`);return}i()},d=async function(e){let t=await ba(n,{[e]:null});if(!t.ok){X.error(`Remove failed: ${t.error}`);return}i()},p=function(e,t){let n=f[e];r(e,JO(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 M;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(M=function(e){c(t=>{if(!t)return t;let n=e===`date`?new Date().toISOString().slice(0,10):GO[e];return{...t,type:e,value:n,error:null}})},t[32]=M):M=t[32],S=M;let N;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(N=function(e){c(t=>t&&{...t,value:e})},t[33]=N):N=t[33],C=N;let P;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(P=function(e){c(t=>t&&{...t,name:e,error:null})},t[34]=P):P=t[34],x=P;let F;t[35]!==s||t[36]!==n||t[37]!==f||t[38]!==i?(F=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 ba(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]=F):F=t[39],w=F;let I=function(e){u({key:e,draft:e,error:null})},L=function(e){u(t=>t&&{...t,draft:e,error:null})},z=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 ba(n,{[l.key]:null,[e]:t});if(!r.ok){u({...l,error:r.error});return}u(null),i()},B=function(){u(null)};j=`rounded-lg border bg-card`,y=R,O=!a,t[40]===Symbol.for(`react.memo_cache_sentinel`)?(k=e=>o(!e),t[40]=k):k=t[40];let V=`size-3 transition-transform ${a?``:`rotate-90`}`,H;t[41]===V?H=t[42]:(H=(0,Z.jsx)(T,{className:V,"aria-hidden":!0}),t[41]=V,t[42]=H);let U;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(`span`,{children:`Folder defaults`}),t[43]=U):U=t[43];let W;t[44]===H?W=t[45]:(W=(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:[H,U]}),t[44]=H,t[45]=W);let G;t[46]===_?G=t[47]:(G=(0,Z.jsx)(`code`,{className:`text-xs text-muted-foreground font-mono cursor-text select-text`,onClick:sk,children:_}),t[46]=_,t[47]=G),t[48]!==W||t[49]!==G?(A=(0,Z.jsxs)(Lt,{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:[W,G]}),t[48]=W,t[49]=G,t[50]=A):A=t[50],v=oe,E=`px-2 py-2`,D=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)(XO,{keyName:e,value:t,declared:YO(t,Kr(t)),rename:n?{state:l?.key===e?l:null,onBegin:()=>I(e),onChangeDraft:L,onCommit:z,onCancel:B}:void 0,badge:n?null:(0,Z.jsx)(rk,{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]=E,t[26]=D,t[27]=O,t[28]=k,t[29]=A,t[30]=j}else v=t[18],y=t[19],b=t[20],x=t[21],S=t[22],C=t[23],w=t[24],E=t[25],D=t[26],O=t[27],k=t[28],A=t[29],j=t[30];let M;t[51]!==s||t[52]!==b||t[53]!==x||t[54]!==S||t[55]!==C||t[56]!==w?(M=s?(0,Z.jsx)(tk,{draft:s,onChangeName:x,onChangeType:S,onChangeValue:C,onCommit:()=>void w(),onCancel:()=>c(null)}):(0,Z.jsxs)(J,{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)(Ui,{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]=M):M=t[57];let N;t[58]!==M||t[59]!==E||t[60]!==D?(N=(0,Z.jsxs)(`div`,{className:E,children:[D,M]}),t[58]=M,t[59]=E,t[60]=D,t[61]=N):N=t[61];let P;t[62]!==v||t[63]!==N?(P=(0,Z.jsx)(v,{children:N}),t[62]=v,t[63]=N,t[64]=P):P=t[64];let F;t[65]!==y||t[66]!==P||t[67]!==O||t[68]!==k||t[69]!==A?(F=(0,Z.jsxs)(y,{open:O,onOpenChange:k,children:[A,P]}),t[65]=y,t[66]=P,t[67]=O,t[68]=k,t[69]=A,t[70]=F):F=t[70];let I;return t[71]!==F||t[72]!==j?(I=(0,Z.jsx)(`section`,{className:j,children:F}),t[71]=F,t[72]=j,t[73]=I):I=t[73],I}function sk(e){return e.stopPropagation()}function ck(){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)(ac,{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 lk(e){let t=e.split(`/`).pop();return t?`${e}/${t}`:null}function uk(e,t){let n=t.get(`${e}/index`);if(n)return n;let r=lk(e);if(r){let e=t.get(r);if(e)return e}return e.split(`/`).pop()??e}function dk(e,t,n){let r=n.get(e);return r&&r!==e?r:t}function fk(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:uk(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:dk(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:uk(e,t.pageTitles),children:a}}function pk(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 ro(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)(Ka,{className:`h-12 w-full`}),(0,Z.jsx)(Ka,{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)(je,{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)(J,{variant:`ghost`,className:`font-mono uppercase`,size:`sm`,onClick:()=>h(!0),children:[(0,Z.jsx)(Ui,{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)(hk,{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)(Oa,{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)(ga,{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`?`
28
+
29
+ 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)(To,{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(mk)),t[33]=y,t[34]=M);let N;t[35]!==n||t[36]!==m||t[37]!==i||t[38]!==M?(N=(0,Z.jsx)(Ea,{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)(Gp,{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 mk(e){return e.name}function hk(e){let t=(0,$.c)(40),{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.scope?u=t[6]:(u=n.scope===`inherited`?(0,Z.jsx)(je,{variant:`gray`,className:`ml-auto shrink-0 text-2xs`,children:`inherited`}):null,t[5]=n.scope,t[6]=u);let d;t[7]!==c||t[8]!==l||t[9]!==u?(d=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[c,l,u]}),t[7]=c,t[8]=l,t[9]=u,t[10]=d):d=t[10];let f;t[11]===n.description?f=t[12]:(f=n.description?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground truncate mt-0.5`,children:n.description}):null,t[11]=n.description,t[12]=f);let p;t[13]!==i||t[14]!==d||t[15]!==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[13]=i,t[14]=d,t[15]=f,t[16]=p):p=t[16];let m=`Create note from ${s}`,h;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(tc,{className:`size-3.5`,"aria-hidden":!0}),t[17]=h):h=t[17];let g;t[18]!==r||t[19]!==m?(g=(0,Z.jsxs)(J,{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[18]=r,t[19]=m,t[20]=g):g=t[20];let _=`Actions for ${s}`,v;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(Pa,{className:`size-4`,"aria-hidden":!0}),t[21]=v):v=t[21];let y;t[22]===_?y=t[23]:(y=(0,Z.jsx)(qi,{asChild:!0,children:(0,Z.jsx)(J,{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[22]=_,t[23]=y);let b;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Z.jsx)(At,{"aria-hidden":!0}),t[24]=b):b=t[24];let x;t[25]===i?x=t[26]:(x=(0,Z.jsxs)(Qi,{onSelect:i,children:[b,`Edit`]}),t[25]=i,t[26]=x);let S;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(Dt,{"aria-hidden":!0}),t[27]=S):S=t[27];let C;t[28]===a?C=t[29]:(C=(0,Z.jsxs)(Qi,{variant:`destructive`,onSelect:a,children:[S,`Delete`]}),t[28]=a,t[29]=C);let w;t[30]!==x||t[31]!==C?(w=(0,Z.jsxs)(Yi,{align:`end`,children:[x,C]}),t[30]=x,t[31]=C,t[32]=w):w=t[32];let T;t[33]!==y||t[34]!==w?(T=(0,Z.jsxs)(ra,{children:[y,w]}),t[33]=y,t[34]=w,t[35]=T):T=t[35];let E;return t[36]!==T||t[37]!==p||t[38]!==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[36]=T,t[37]=p,t[38]=g,t[39]=E):E=t[39],E}function gk(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=Y(`relative w-full overflow-x-auto subtle-scrollbar`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=Y(`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 _k(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=Y(`[&_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 vk(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=Y(`[&_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 yk(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=Y(`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 bk(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=Y(`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 xk(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=Y(`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 Sk(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 Ck(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 wk(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)(De,{className:`ml-1 size-3`}):(0,Z.jsx)(we,{className:`ml-1 size-3`}):(0,Z.jsx)(Ms,{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)(J,{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 Tk(e){let t=(0,$.c)(81),{folderPath:n}=e,{folderPaths:r,loading:i,pages:a,pageTitles:o,pageMeta:s}=Xr(),c=Ba(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)(Ka,{className:`size-5 rounded`}),(0,Z.jsx)(Ka,{className:`h-7 w-48`})]}),(0,Z.jsx)(Ka,{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)(Ka,{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)(Ka,{className:`h-4 w-20`})})]}),[`a`,`b`,`c`,`d`].map(Ok)]})]})}),t[2]=r):r=t[2],r}let _,v,y,b,x,C,w,T,E,D;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=fk(n,{pages:a,pageTitles:o,pageMeta:s,folderPaths:r}),i=Ck(e.children,p,h),d;t[23]===p?d=t[24]:(d=function(e){e===p?g(Dk):(m(e),g(`asc`))},t[23]=p,t[24]=d);let O=d;D=`flex min-h-0 flex-1 items-start overflow-y-auto subtle-scrollbar`,C=`mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-8`;let k;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Z.jsx)(S,{className:`size-5 text-muted-foreground`}),t[25]=k):k=t[25];let A=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[k,(0,Z.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:e.title})]}),j;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Z.jsxs)(J,{onClick:()=>f(!0),children:[(0,Z.jsx)(Ui,{className:`size-4`}),`New`]}),t[26]=j):j=t[26],t[27]===A?w=t[28]:(w=(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:[A,j]})}),t[27]=A,t[28]=w),t[29]!==l||t[30]!==n||t[31]!==u?(T=(0,Z.jsx)(ok,{folderPath:n,state:l,onChange:u}),t[29]=l,t[30]=n,t[31]=u,t[32]=T):T=t[32],t[33]!==l||t[34]!==c||t[35]!==n||t[36]!==u?(E=(0,Z.jsx)(pk,{folderPath:n,state:l,onChange:u,folderConfigHandle:c}),t[33]=l,t[34]=c,t[35]=n,t[36]=u,t[37]=E):E=t[37],x=`rounded-lg border`,v=gk;let M=p===`name`?h===`asc`?`ascending`:`descending`:`none`,N;t[38]!==O||t[39]!==h||t[40]!==p?(N=(0,Z.jsx)(wk,{label:`Name`,sortKey:`name`,activeKey:p,activeDir:h,onSort:O}),t[38]=O,t[39]=h,t[40]=p,t[41]=N):N=t[41];let P;t[42]!==M||t[43]!==N?(P=(0,Z.jsx)(bk,{"aria-sort":M,children:N}),t[42]=M,t[43]=N,t[44]=P):P=t[44];let F=p===`modified`?h===`asc`?`ascending`:`descending`:`none`,I;t[45]!==O||t[46]!==h||t[47]!==p?(I=(0,Z.jsx)(wk,{label:`Modified`,sortKey:`modified`,activeKey:p,activeDir:h,onSort:O}),t[45]=O,t[46]=h,t[47]=p,t[48]=I):I=t[48];let L;t[49]!==F||t[50]!==I?(L=(0,Z.jsx)(bk,{className:`w-32`,"aria-sort":F,children:I}),t[49]=F,t[50]=I,t[51]=L):L=t[51],t[52]!==P||t[53]!==L?(b=(0,Z.jsx)(_k,{children:(0,Z.jsxs)(yk,{children:[P,L]})}),t[52]=P,t[53]=L,t[54]=b):b=t[54],_=vk,y=i.length?i.map(Ek):(0,Z.jsx)(yk,{children:(0,Z.jsx)(xk,{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]=C,t[19]=w,t[20]=T,t[21]=E,t[22]=D}else _=t[13],v=t[14],y=t[15],b=t[16],x=t[17],C=t[18],w=t[19],T=t[20],E=t[21],D=t[22];let O;t[55]!==_||t[56]!==y?(O=(0,Z.jsx)(_,{children:y}),t[55]=_,t[56]=y,t[57]=O):O=t[57];let k;t[58]!==v||t[59]!==b||t[60]!==O?(k=(0,Z.jsxs)(v,{children:[b,O]}),t[58]=v,t[59]=b,t[60]=O,t[61]=k):k=t[61];let A;t[62]!==k||t[63]!==x?(A=(0,Z.jsx)(`div`,{className:x,children:k}),t[62]=k,t[63]=x,t[64]=A):A=t[64];let j;t[65]!==A||t[66]!==C||t[67]!==w||t[68]!==T||t[69]!==E?(j=(0,Z.jsxs)(`div`,{className:C,children:[w,T,E,A]}),t[65]=A,t[66]=C,t[67]=w,t[68]=T,t[69]=E,t[70]=j):j=t[70];let M;t[71]!==j||t[72]!==D?(M=(0,Z.jsx)(`div`,{className:D,children:j}),t[71]=j,t[72]=D,t[73]=M):M=t[73];let N;t[74]!==d||t[75]!==c||t[76]!==n?(N=(0,Z.jsx)(Gp,{open:d,onOpenChange:f,kind:`file`,initialDir:n,folderConfig:c,suggestedName:`index`}),t[74]=d,t[75]=c,t[76]=n,t[77]=N):N=t[77];let P;return t[78]!==M||t[79]!==N?(P=(0,Z.jsxs)(Z.Fragment,{children:[M,N]}),t[78]=M,t[79]=N,t[80]=P):P=t[80],P}function Ek(e){return(0,Z.jsxs)(yk,{children:[(0,Z.jsx)(xk,{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)(sc,{className:`size-4 shrink-0 text-muted-foreground`}):(0,Z.jsx)(j,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.title})]})}),(0,Z.jsx)(xk,{className:`text-muted-foreground`,children:e.kind===`file`?Sk(e.modified):`—`})]},e.path)}function Dk(e){return e===`asc`?`desc`:`asc`}function Ok(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)(Ka,{className:`size-4 rounded`}),(0,Z.jsx)(Ka,{className:`h-4 w-40`}),(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(Ka,{className:`h-4 w-16`})})]},e)}function kk(e){let t=(0,$.c)(7),{docName:n}=e,[r,i]=(0,Q.useState)(Ak),a,o;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>Pt(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(){Ot(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)(J,{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 Ak(){return new Set}var jk=(0,Q.createContext)(null);function Mk(e){let t=(0,$.c)(7),{children:n}=e,[r,i]=(0,Q.useState)(Nk),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)(jk,{value:u,children:n}),t[4]=n,t[5]=u,t[6]=d):d=t[6],d}function Nk(){return new Map}function Pk(){let e=(0,Q.use)(jk);if(e===null)throw Error(`useProperties must be used within <PropertyProvider />`);return e}function Fk(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=Y(`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)(wx,{"data-slot":`resizable-panel-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ik(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)(Dx,{"data-slot":`resizable-panel`,...n}),t[2]=n,t[3]=r),r}function Lk(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=Y(`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)(jx,{"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 Rk(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=Y(`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 zk=pi(`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 Bk(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=Y(zk({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:Vk,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function Vk(e){e.target.closest(`button`)||(e.preventDefault(),e.currentTarget.parentElement?.querySelector(`input`)?.focus())}pi(`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 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=Y(`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 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=Y(`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)(Ho,{"data-slot":`input-group-control`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Wk(e){let t=(0,$.c)(88),{findInputRef:n,query:r,replacement:i,replaceOpen:a,caseSensitive:o,wholeWord:s,current:c,total:l,onQueryChange:u,onReplacementChange:d,onReplaceOpenChange:f,onCaseSensitiveChange:p,onWholeWordChange:m,onNext:h,onPrevious:g,onReplaceCurrent:_,onReplaceAll:v,onClose:y}=e,b=r.length>0,x=l>0,S=b?x?`${c} / ${l}`:`No results`:``,C;t[0]!==y||t[1]!==h||t[2]!==g?(C=function(e){e.key===`Enter`?(e.preventDefault(),e.shiftKey?g():h()):e.key===`Escape`&&(e.preventDefault(),y())},t[0]=y,t[1]=h,t[2]=g,t[3]=C):C=t[3];let w=C,T;t[4]!==y||t[5]!==_?(T=function(e){e.key===`Enter`?(e.preventDefault(),_()):e.key===`Escape`&&(e.preventDefault(),y())},t[4]=y,t[5]=_,t[6]=T):T=t[6];let E=T,D;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(`label`,{className:`sr-only`,htmlFor:`ok-find-input`,children:`Find`}),t[7]=D):D=t[7];let O;t[8]===u?O=t[9]:(O=e=>u(e.target.value),t[8]=u,t[9]=O);let k;t[10]!==n||t[11]!==w||t[12]!==r||t[13]!==O?(k=(0,Z.jsx)(Uk,{ref:n,id:`ok-find-input`,value:r,onChange:O,onKeyDown:w,placeholder:`Find`,autoComplete:`off`,spellCheck:!1,className:`h-7 px-2 text-sm`}),t[10]=n,t[11]=w,t[12]=r,t[13]=O,t[14]=k):k=t[14];let A;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsx)(zs,{"aria-hidden":`true`}),t[15]=A):A=t[15];let j;t[16]!==o||t[17]!==p?(j=(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsx)(Fo,{type:`button`,variant:`segmented`,size:`sm`,"aria-label":`Match case`,pressed:o,onPressedChange:p,className:`size-6 min-w-6 px-0`,children:A})}),t[16]=o,t[17]=p,t[18]=j):j=t[18];let M;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Z.jsx)(zo,{side:`bottom`,children:`Match case`}),t[19]=M):M=t[19];let N;t[20]===j?N=t[21]:(N=(0,Z.jsxs)(Vo,{children:[j,M]}),t[20]=j,t[21]=N);let P;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Z.jsx)(il,{"aria-hidden":`true`}),t[22]=P):P=t[22];let F;t[23]!==m||t[24]!==s?(F=(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsx)(Fo,{type:`button`,variant:`segmented`,size:`sm`,"aria-label":`Whole word`,pressed:s,onPressedChange:m,className:`size-6 min-w-6 px-0`,children:P})}),t[23]=m,t[24]=s,t[25]=F):F=t[25];let L;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(zo,{side:`bottom`,children:`Whole word`}),t[26]=L):L=t[26];let R;t[27]===F?R=t[28]:(R=(0,Z.jsxs)(Vo,{children:[F,L]}),t[27]=F,t[28]=R);let z;t[29]!==R||t[30]!==N?(z=(0,Z.jsxs)(Bk,{align:`inline-end`,className:`gap-0.5`,children:[N,R]}),t[29]=R,t[30]=N,t[31]=z):z=t[31];let B;t[32]!==z||t[33]!==k?(B=(0,Z.jsxs)(Rk,{className:`h-7 w-56 rounded-[min(var(--radius-md),12px)]`,children:[k,z]}),t[32]=z,t[33]=k,t[34]=B):B=t[34];let V;t[35]===S?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:S}),t[35]=S,t[36]=V);let H=!x,U;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(xe,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[37]=U):U=t[37];let W;t[38]!==g||t[39]!==H?(W=(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsx)(J,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Previous match`,disabled:H,onClick:g,children:U})}),t[38]=g,t[39]=H,t[40]=W):W=t[40];let G;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Z.jsx)(zo,{side:`bottom`,children:`Previous match`}),t[41]=G):G=t[41];let K;t[42]===W?K=t[43]:(K=(0,Z.jsxs)(Vo,{children:[W,G]}),t[42]=W,t[43]=K);let ee=!x,q;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,Z.jsx)(I,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[44]=q):q=t[44];let te;t[45]!==h||t[46]!==ee?(te=(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsx)(J,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Next match`,disabled:ee,onClick:h,children:q})}),t[45]=h,t[46]=ee,t[47]=te):te=t[47];let ne;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Z.jsx)(zo,{side:`bottom`,children:`Next match`}),t[48]=ne):ne=t[48];let re;t[49]===te?re=t[50]:(re=(0,Z.jsxs)(Vo,{children:[te,ne]}),t[49]=te,t[50]=re);let ie=a?`secondary`:`ghost`,ae=a?`Hide replace`:`Show replace`,oe=a?`ok-replace-input`:void 0,se;t[51]!==f||t[52]!==a?(se=()=>f(!a),t[51]=f,t[52]=a,t[53]=se):se=t[53];let ce;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,Z.jsx)(Ic,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[54]=ce):ce=t[54];let le;t[55]!==a||t[56]!==ie||t[57]!==ae||t[58]!==oe||t[59]!==se?(le=(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsx)(J,{type:`button`,variant:ie,size:`icon-sm`,"aria-label":ae,"aria-expanded":a,"aria-controls":oe,onClick:se,children:ce})}),t[55]=a,t[56]=ie,t[57]=ae,t[58]=oe,t[59]=se,t[60]=le):le=t[60];let ue=a?`Hide replace`:`Show replace`,de;t[61]===ue?de=t[62]:(de=(0,Z.jsx)(zo,{side:`bottom`,children:ue}),t[61]=ue,t[62]=de);let fe;t[63]!==le||t[64]!==de?(fe=(0,Z.jsxs)(Vo,{children:[le,de]}),t[63]=le,t[64]=de,t[65]=fe):fe=t[65];let pe;t[66]!==E||t[67]!==x||t[68]!==v||t[69]!==_||t[70]!==d||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)(Ho,{id:`ok-replace-input`,value:i,onChange:e=>d(e.target.value),onKeyDown:E,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)(Vo,{children:[(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsx)(J,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Replace current match`,disabled:!x,onClick:_,children:(0,Z.jsx)(Ic,{"data-icon":`inline-start`,"aria-hidden":`true`})})}),(0,Z.jsx)(zo,{side:`bottom`,children:`Replace current match`})]}),(0,Z.jsxs)(Vo,{children:[(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsx)(J,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Replace all matches`,disabled:!x,onClick:v,children:(0,Z.jsx)(Fc,{"data-icon":`inline-start`,"aria-hidden":`true`})})}),(0,Z.jsx)(zo,{side:`bottom`,children:`Replace all matches`})]})]}):null,t[66]=E,t[67]=x,t[68]=v,t[69]=_,t[70]=d,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)(fo,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[74]=me):me=t[74];let he;t[75]===y?he=t[76]:(he=(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsx)(J,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close find`,onClick:y,children:me})}),t[75]=y,t[76]=he);let ge;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,Z.jsx)(zo,{side:`bottom`,children:`Close`}),t[77]=ge):ge=t[77];let _e;t[78]===he?_e=t[79]:(_e=(0,Z.jsxs)(Vo,{children:[he,ge]}),t[78]=he,t[79]=_e);let ve;return t[80]!==B||t[81]!==V||t[82]!==K||t[83]!==re||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:[D,B,V,K,re,fe,pe,_e]}),t[80]=B,t[81]=V,t[82]=K,t[83]=re,t[84]=fe,t[85]=pe,t[86]=_e,t[87]=ve):ve=t[87],ve}var Gk={current:0,total:0},Kk=120,qk=100;function Jk(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=()=>e?me(e):null,t[0]=e,t[1]=n),(0,Q.useSyncExternalStore)(_,n,Yk)}function Yk(){return null}function Xk(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,`
30
+ `,`
31
+ `).trim();return i.length===0||i.length>Kk||i.includes(`
32
+ `)?null:i}function Zk(e,t){return(Nr()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey)&&!e.altKey&&e.key.toLocaleLowerCase()===t}function Qk(e){let t=e.key.toLocaleLowerCase();return Nr()?e.metaKey&&e.altKey&&!e.ctrlKey&&t===`f`:e.ctrlKey&&!e.metaKey&&!e.altKey&&t===`h`}function $k(e){let t=$e(e.state);return{current:t.matches.length===0?0:t.activeIndex+1,total:t.matches.length}}function eA(e,t){return e.current===t.current&&e.total===t.total}function tA(e,t,n){e&&!e.isDestroyed&&(e.commands.clearFindMatches(),e.commands.focus()),t(e=>({...e,open:!1,activeIndex:0})),n(Gk)}function nA(e){!e||e.isDestroyed||typeof window>`u`||window.requestAnimationFrame(()=>{if(e.isDestroyed)return;let t=kt(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 rA(e){let t=(0,$.c)(81),{activeDocName:n,isSourceMode:r}=e,i=Jk(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)(Gk),m,h;t[1]===n?(m=t[2],h=t[3]):(m=()=>{s.current!==n&&(s.current=n,d(aA))},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(iA)},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(Gk);return}if(!u.open||r){i.commands.clearFindMatches(),p(Gk);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=$k(i);p(t=>eA(t,e)?t:e)},qk);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=$e(i.state),t=$k(i);p(e=>eA(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=Xk(i);d(n=>({...n,open:!0,replaceOpen:e,query:t??n.query,activeIndex:0}))},t=function(t){if(!(!n||r||t.defaultPrevented)){if(Zk(t,`f`)){t.preventDefault(),u.open?tA(i,d,p):e(!1);return}if(Qk(t)){t.preventDefault(),e(!0);return}if(Zk(t,`g`)&&u.open){t.preventDefault(),(t.shiftKey?i?.commands.selectPreviousFindMatch():i?.commands.selectNextFindMatch())&&nA(i);return}t.key===`Escape`&&u.open&&(t.preventDefault(),tA(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=$e(i.state),t=$k(i);p(e=>eA(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(){tA(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()&&nA(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()&&nA(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)&&nA(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)&&nA(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,K,ee,q;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(W=e=>d(t=>({...t,query:e,activeIndex:0})),G=e=>d(t=>({...t,replacement:e})),K=e=>d(t=>({...t,replaceOpen:e})),ee=e=>d(t=>({...t,caseSensitive:e})),q=e=>d(t=>({...t,wholeWord:e})),t[63]=W,t[64]=G,t[65]=K,t[66]=ee,t[67]=q):(W=t[63],G=t[64],K=t[65],ee=t[66],q=t[67]);let te;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?(te=(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)(Wk,{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:K,onCaseSensitiveChange:ee,onWholeWordChange:q,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]=te):te=t[80],te}function iA(e){return{...e,open:!1,activeIndex:0}}function aA(e){return{...e,activeIndex:0}}var oA=960,sA=1024;function cA(){let e=(0,$.c)(5),[t,n]=(0,Q.useState)(uA),[r,i]=(0,Q.useState)(lA),a,o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{let e=window.matchMedia(`(max-width: ${oA-1}px)`),t=window.matchMedia(`(max-width: ${sA-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 lA(){return window.innerWidth>=oA&&window.innerWidth<sA}function uA(){return window.innerWidth<oA?`sheet`:`panel`}var dA={words:0,chars:0,tokens:0},fA=/[ -〿぀-ゟ゠-ヿ㐀-䶿一-鿿豈-﫿＀-￯฀-๿ក-៿]/,pA=/[\p{L}\p{N}]/u,mA=new Set([`text`,`inlineCode`,`code`,`tag`]),hA=new Set([`html`,`definition`,`footnoteDefinition`,`yaml`,`toml`,`image`,`imageReference`,`mdxFlowExpression`,`mdxTextExpression`,`mdxjsEsm`,`rawMdxFallback`,`rawMdxFallbackMdast`]),gA=new Set([`paragraph`,`heading`,`blockquote`,`list`,`listItem`,`thematicBreak`,`table`,`tableRow`,`tableCell`,`mdxJsxFlowElement`,`commentBlock`]);function _A(e,t){if(!e)return;let n=e.type;if(!hA.has(n)){if(mA.has(n)){e.value&&(t.push(e.value),n===`code`&&t.push(`
33
+ `));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)_A(n,t);if(gA.has(n)&&t.length>0){let e=t[t.length-1];e&&!e.endsWith(`
34
+ `)&&t.push(`
35
+ `)}}}}function vA(e){try{let t=p().parseToMdast(e),n=[];return _A(t,n),n.join(``).trim()}catch(t){return console.warn(`[document-stats] mdast parse failed, falling back to raw text`,t),e.trim()}}function yA(e){if(!e)return 0;let t=0;for(let n of e.split(/\s+/))pA.test(n)&&t++;return t}function bA(e){let t=globalThis.Intl.Segmenter;if(!t)return yA(e);let n=new t(void 0,{granularity:`word`}),r=0;for(let t of n.segment(e))t.isWordLike&&r++;return r}function xA(e){let t=fA.test(e)?1.5:4;return Math.ceil(e.length/t)}function SA(e){if(!e)return{words:0,chars:0,tokens:0};let{body:t}=ti(e);if(!t.trim())return{words:0,chars:0,tokens:0};let n=vA(t);return n?{words:fA.test(n)?bA(n):yA(n),chars:n.length,tokens:xA(n)}:{words:0,chars:0,tokens:0}}var CA=300;function wA(e,t){let n=(0,$.c)(4),[r,i]=(0,Q.useState)(dA),a,o;return n[0]!==t||n[1]!==e?(a=()=>{if(!e||!t){i(dA);return}let n=e.document.getText(`source`),r=!1,a=null,o=function(){r||i(SA(n.toString()))};o();let s=function(){a&&clearTimeout(a),a=setTimeout(o,CA)};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 TA(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`?EA: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 EA(e){return e===`synced`?`synced`:`connected`}var DA=Tr;function OA(e,t={}){let n=s(e.componentName);return n.name===`*`?t.unregisteredSuffix?`${e.componentName} (unregistered)`:e.componentName:n.displayName??n.name}var kA=200,AA=`Outside any block`;function jA(e){let t=(0,$.c)(5),{editor:n}=e,r=Ae(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?MA(n,r):o.current?AA:``,a.current=window.setTimeout(()=>{i.current&&(i.current.textContent=``,i.current.textContent=t),o.current=e,a.current=null},kA),()=>{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 MA(e,t){if(!t||t.ancestorChain.length===0)return``;let n=t.ancestorChain,r=n[n.length-1],i=OA(r,{unregisteredSuffix:!0});if(n.length===1)return`Selected: ${i}`;let a=n[n.length-2],o=OA(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 NA(){let[e]=(0,Q.useState)(gn);return e}function PA({principal:e,identity:t}){return e&&e.source===`git-config`?{type:`human`,name:zn(e.display_name),color:Wr(e.id,Yn),coeditor:t.coeditor,tabId:t.tabId,principalId:e.id}:e&&e.source===`synthesized`?{type:`human`,name:t.name,color:Wr(e.id,Yn),coeditor:t.coeditor,tabId:t.tabId}:{type:`human`,name:t.name,color:t.color,coeditor:t.coeditor,tabId:t.tabId}}function FA(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 IA=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&&Ln(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(wn(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(li(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(Wn(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(Mr(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(_n(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(Fn(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(kn(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(Pn(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 vn){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 ar){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():FA(o.getBoundingClientRect(),s.getBoundingClientRect());r={getBoundingClientRect:()=>c,getClientRects:()=>[c]}}return r}updatePosition(){if(!this.isVisible)return;let e=this.virtualElement;e&&Vn(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()}},LA=e=>new $n({key:typeof e.pluginKey==`string`?new On(e.pluginKey):e.pluginKey,view:t=>new IA({view:t,...e})});si.create({name:`bubbleMenu`,addOptions(){return{element:null,pluginKey:`bubbleMenu`,updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[LA({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 RA=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 xn(e,{textSerializers:Bn(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(wn(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(li(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(Wn(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(Mr(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(_n(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(Fn(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(kn(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(Pn(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);Vn({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()}},zA=e=>new $n({key:typeof e.pluginKey==`string`?new On(e.pluginKey):e.pluginKey,view:t=>new RA({view:t,...e})});si.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?[zA({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 BA(e,t){return e??new On(t)}var VA=typeof window<`u`?Q.useLayoutEffect:Q.useEffect,HA=new Set([`left`,`opacity`,`position`,`top`,`visibility`,`width`]),UA=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(`.`)),WA=new Set([`children`,`className`,`style`]),GA=new Set([`tabIndex`]),KA=new Set([`accessKey`,`autoCapitalize`,`contentEditable`,`contextMenu`,`dir`,`draggable`,`enterKeyHint`,`hidden`,`id`,`lang`,`nonce`,`role`,`slot`,`spellCheck`,`tabIndex`,`title`,`translate`]),qA={Blur:`focusout`,DoubleClick:`dblclick`,Focus:`focusin`,MouseEnter:`mouseenter`,MouseLeave:`mouseleave`};function JA(e,t){return/^on[A-Z]/.test(e)&&typeof t==`function`}function YA(e){return e.startsWith(`aria-`)||e.startsWith(`data-`),e}function XA(e){return e.startsWith(`aria-`)||e.startsWith(`data-`)||KA.has(e)}function ZA(e){return e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function QA(e){let t=e.endsWith(`Capture`),n=(t?e.slice(0,-7):e).slice(2);return{eventName:qA[n]??n.toLowerCase(),options:t?{capture:!0}:void 0}}function $A(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 ej(e){return GA.has(e)}function tj(e,t,n){if(t===`tabIndex`){e.tabIndex=Number(n);return}e[t]=n}function nj(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 rj(e,t){return typeof t!=`number`||t===0||e.startsWith(`--`)||UA.has(e)?String(t):`${t}px`}function ij(e,t){HA.has(t)||e.style.removeProperty(ZA(t))}function aj(e,t,n){HA.has(t)||e.style.setProperty(ZA(t),rj(t,n))}function oj(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(r=>{if(WA.has(r)||!XA(r)||JA(r,t[r])||JA(r,n[r]))return;let i=t[r],a=n[r];if(i===a)return;let o=YA(r);if(a==null||a===!1){ej(r)&&nj(e,r),e.removeAttribute(o);return}if(a===!0){ej(r)&&tj(e,r,!0),e.setAttribute(o,``);return}if(ej(r)){tj(e,r,a);return}e.setAttribute(o,String(a))})}function sj(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute(`class`)}}function cj(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){ij(e,t);return}aj(e,t,a)}})}function lj(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(!JA(t,n))return;let{eventName:i,options:a}=QA(t),o=t=>{n($A(e,t))};e.addEventListener(i,o,a),r.push({eventName:i,listener:o,options:a})}),r}function uj(e,t){let n=(0,Q.useRef)({}),r=(0,Q.useRef)([]);VA(()=>{let i=n.current;return sj(e,i.className,t.className),cj(e,i.style,t.style),oj(e,i,t),r.current=lj(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 dj=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)(BA(e,`bubbleMenu`)).current;uj(d.current,l),typeof u==`function`?u(d.current):u&&(u.current=d.current);let{editor:p}=We(),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=LA({...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,Fs.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)(BA(e,`floatingMenu`)).current;uj(u.current,c),typeof l==`function`?l(u.current):l&&(l.current=u.current);let{editor:f}=We(),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=zA({...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,Fs.createPortal)(s,u.current)});var fj=[{name:`paragraph`,label:`Text`,icon:Ac,isActive:e=>e.isActive(`paragraph`)&&!e.isActive(`list`),command:e=>e.chain().focus().setParagraph().run()},{name:`heading1`,label:`Heading 1`,icon:G,isActive:e=>e.isActive(`heading`,{level:1}),command:e=>e.chain().focus().toggleHeading({level:1}).run()},{name:`heading2`,label:`Heading 2`,icon:H,isActive:e=>e.isActive(`heading`,{level:2}),command:e=>e.chain().focus().toggleHeading({level:2}).run()},{name:`heading3`,label:`Heading 3`,icon:tt,isActive:e=>e.isActive(`heading`,{level:3}),command:e=>e.chain().focus().toggleHeading({level:3}).run()},{name:`bulletList`,label:`Bullet List`,icon:g,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:rt,isActive:e=>e.isActive(`list`,{ordered:!0}),command:e=>e.chain().focus().toggleOrderedList().run()},{name:`taskList`,label:`Task List`,icon:ee,isActive:e=>e.isActive(`listItem`,{checked:!0})||e.isActive(`listItem`,{checked:!1}),command:e=>e.chain().focus().toggleTaskList().run()},{name:`blockquote`,label:`Quote`,icon:m,isActive:e=>e.isActive(`blockquote`),command:e=>e.chain().focus().toggleBlockquote().run()},{name:`codeBlock`,label:`Code Block`,icon:Wc,isActive:e=>e.isActive(`codeBlock`),command:e=>e.chain().focus().toggleCodeBlock().run()}];function pj(e){let t=(0,$.c)(18),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:mj},t[0]=n,t[1]=r);let{current:i,activeStates:a}=mt(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)(I,{className:`size-3 opacity-50`}),t[6]=l):l=t[6];let u;t[7]!==s||t[8]!==c?(u=(0,Z.jsx)(qi,{asChild:!0,children:(0,Z.jsxs)(J,{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=fj.map(e=>{let t=e.icon,r=a[e.name];return(0,Z.jsxs)(Qi,{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)(Yi,{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)(ra,{children:[u,f]}),t[15]=u,t[16]=f,t[17]=p):p=t[17],p}function mj(e){let t=Object.fromEntries(fj.map(t=>[t.name,t.isActive(e.editor)]));return{current:fj.find(e=>t[e.name])??fj[0],activeStates:t}}function hj(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 gj(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:He(typeof n.src==`string`?n.src:``)}function _j(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 vj(e){let t=(0,$.c)(10),{editor:n}=e,r;if(t[0]===n?r=t[1]:(r={editor:n,selector:yj},t[0]=n,t[1]=r),mt(r)===null)return null;let i;t[2]===n?i=t[3]:(i=e=>{e.preventDefault();let t=hj(n);t&&_j(t,gj(n))},t[2]=n,t[3]=i);let a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(Ri,{className:`size-3.5`}),t[4]=a):a=t[4];let o;t[5]===i?o=t[6]:(o=(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsx)(J,{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)(zo,{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)(Vo,{children:[o,s]})}),t[8]=o,t[9]=c),c}function yj(e){return hj(e.editor)}function bj(e){return hj(e)!==null}var xj=[{value:`left`,label:`Align left`,icon:Ft},{value:`center`,label:`Align center`,icon:Nt},{value:`right`,label:`Align right`,icon:Fe}];function Sj(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 Cj(e){let t=(0,$.c)(7),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:wj},t[0]=n,t[1]=r);let i=mt(r);if(i===null)return null;let a;t[2]!==i||t[3]!==n?(a=xj.map(e=>{let{value:t,label:r,icon:a}=e,o=i===t;return(0,Z.jsxs)(Vo,{children:[(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsx)(J,{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(vn.create(u.doc,s)),Ke(n.view.nodeDOM(s),()=>{n.view.dispatch(u)})},children:(0,Z.jsx)(a,{className:`size-3.5`})})}),(0,Z.jsx)(zo,{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 wj(e){return Sj(e.editor)}function Tj(e){return Sj(e)!==null}var Ej=[{name:`bold`,icon:Ps,command:e=>e.chain().focus().toggleBold().run(),isActive:e=>e.isActive(`strong`),shortcut:`⌘ B`},{name:`italic`,icon:fc,command:e=>e.chain().focus().toggleItalic().run(),isActive:e=>e.isActive(`emphasis`),shortcut:`⌘ I`},{name:`underline`,icon:el,command:e=>e.chain().focus().toggleUnderline().run(),isActive:e=>e.isActive(`underline`),shortcut:`⌘ U`},{name:`strikethrough`,icon:Jc,command:e=>e.chain().focus().toggleStrike().run(),isActive:e=>e.isActive(`strike`),shortcut:`⌘ ⇧ X`},{name:`code`,icon:Ks,command:e=>e.chain().focus().toggleCode().run(),isActive:e=>e.isActive(`code`),shortcut:`⌘ E`},{name:`highlight`,icon:dc,command:e=>e.chain().focus().toggleHighlight().run(),isActive:e=>e.isActive(`highlight`),shortcut:`⌘ ⇧ H`}];function Dj(e){let t=(0,$.c)(7),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:Oj},t[0]=n,t[1]=r);let i=mt(r),a;t[2]!==i||t[3]!==n?(a=Ej.map(e=>{let t=e.icon,r=i[e.name];return(0,Z.jsxs)(Vo,{children:[(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsx)(J,{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)(zo,{side:`bottom`,sideOffset:8,children:[(0,Z.jsx)(`span`,{className:`capitalize`,children:e.name}),(0,Z.jsx)(CS,{children:Nr()?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 Oj(e){return Object.fromEntries(Ej.map(t=>[t.name,t.isActive(e.editor)]))}function kj(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)(Zs,{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)(J,{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)(Vo,{children:[(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsx)(J,{variant:`ghost`,size:`icon-xs`,"aria-label":`Open link in new tab`,onMouseDown:e=>{e.preventDefault(),F(d)},children:(0,Z.jsx)(so,{className:`size-3.5`})})}),(0,Z.jsx)(zo,{side:`bottom`,sideOffset:8,children:`Open link in new tab`})]}),(0,Z.jsxs)(Vo,{children:[(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsx)(J,{variant:`ghost`,size:`icon-xs`,"aria-label":`Remove link`,onMouseDown:e=>{e.preventDefault(),y()},children:(0,Z.jsx)(Dt,{className:`size-3.5`})})}),(0,Z.jsx)(zo,{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)(_c,{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)(Ro,{asChild:!0,children:(0,Z.jsx)(J,{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)(zo,{side:`bottom`,sideOffset:8,children:[`Link`,(0,Z.jsx)(CS,{children:Nr()?`⌘ K`:`Ctrl K`})]}),t[43]=E):E=t[43];let D;return t[44]===T?D=t[45]:(D=(0,Z.jsxs)(Vo,{children:[T,E]}),t[44]=T,t[45]=D),D}function Aj({editor:e}){if($e(e.state).query||e.isActive(`codeBlock`))return!1;if(Tj(e)||bj(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 jj(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:Ij},t[0]=n,t[1]=s);let c=mt(s),l;t[2]===n?l=t[3]:(l={editor:n,selector:Fj},t[2]=n,t[3]=l);let u=mt(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=Rn(e,t,()=>{Vn(e,t,{placement:`top`,strategy:`fixed`,middleware:[Wn(8),wn(),li({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(Pj)}))},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(Nj)},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)(Cj,{editor:n},`${i}-img-align`):u?(0,Z.jsx)(vj,{editor:n},`${i}-file`):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(pj,{editor:n}),(0,Z.jsx)(ya,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),(0,Z.jsx)(Dj,{editor:n},i),(0,Z.jsx)(ya,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),(0,Z.jsx)(kj,{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)(dj,{ref:r,editor:n,"data-testid":`bubble-menu-bar`,appendTo:Mj,shouldShow:Aj,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 Mj(){return document.body}function Nj(e){return e+1}function Pj(){}function Fj(e){return bj(e.editor)}function Ij(e){return Tj(e.editor)}var Lj=[{name:`addRowBefore`,icon:De,label:`Add row above`,command:e=>e.chain().focus().addRowBefore().run()},{name:`addRowAfter`,icon:we,label:`Add row below`,command:e=>e.chain().focus().addRowAfter().run()},{name:`deleteRow`,icon:Dt,label:`Delete row`,command:e=>e.chain().focus().deleteRow().run()}],Rj=[{name:`addColumnBefore`,icon:Oi,label:`Add column left`,command:e=>e.chain().focus().addColumnBefore().run()},{name:`addColumnAfter`,icon:Ma,label:`Add column right`,command:e=>e.chain().focus().addColumnAfter().run()},{name:`deleteColumn`,icon:Dt,label:`Delete column`,command:e=>e.chain().focus().deleteColumn().run()}],zj=[{name:`toggleHeaderRow`,icon:Xc,label:`Toggle header row`,command:e=>e.chain().focus().toggleHeaderRow().run()},{name:`toggleHeaderColumn`,icon:Js,label:`Toggle header column`,command:e=>e.chain().focus().toggleHeaderColumn().run()},{name:`deleteTable`,icon:lc,label:`Delete table`,command:e=>e.chain().focus().deleteTable().run()}];function Bj({editor:e}){return $e(e.state).query?!1:e.isActive(`table`)}function Vj(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)(Ro,{asChild:!0,children:(0,Z.jsx)(J,{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)(zo,{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)(Vo,{children:[s,c]}),t[11]=s,t[12]=c,t[13]=l):l=t[13],l}function Hj(e){let t=(0,$.c)(13),{editor:n}=e,r;t[0]===n?r=t[1]:(r=Lj.map(e=>(0,Z.jsx)(Vj,{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)(ya,{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=Rj.map(e=>(0,Z.jsx)(Vj,{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)(ya,{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=zj.map(e=>(0,Z.jsx)(Vj,{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)(dj,{editor:n,"data-testid":`table-controls-menu`,shouldShow:Bj,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 Uj=new WeakMap;function Wj(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=Jn(e.color),n.textContent=e.name,t.append(n),t}var Gj={state:`idle`,count:0,lastFiredAt:null,position:`append`,lastAgentId:null};function Kj(){let e=new Pr({extensions:Ir});return{mdManager:e,text:Ce({mdManager:e}),html:Ee({mdManager:e}),paste:ie({mdManager:e}),drop:ke({mdManager:e})}}function qj(e){let{provider:t,placeholder:n,prebuiltMapping:r}=e;return[...pt.map(e=>e.name===`link`||e.name===`wikiLink`?e.configure({docName:t.configuration.name??``}):e),DA.configure({placeholder:n??`Type '/' for commands`,showOnlyCurrent:!0}),ht.configure({document:t.document,...r?{ySyncOptions:{mapping:r}}:{}}),si.create({name:`imageUploadDecoration`,addProseMirrorPlugins(){return[Ct]}}),si.create({name:`collaborationCursor`,addProseMirrorPlugins(){let e=t.awareness;if(!e)throw Error(`[TiptapEditor] HocuspocusProvider has no awareness instance — cursor plugin cannot initialize`);return[Te(e,{cursorBuilder:Wj})]}})]}function Jj(e){let{provider:t,clipboard:n,ctorStart:r}=e;return{onBeforeCreate:({editor:e})=>{Uj.set(e,r)},onCreate:({editor:e})=>{n.html.setView(e.view);let r=Uj.get(e);if(Uj.delete(e),r==null)return;let i=performance.now();Xe(`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:Cf(qj(e))}}function Yj(e){let{provider:t,placeholder:n,clipboard:r,ctorStart:i}=e,a=Cn(qj({provider:t,placeholder:n,clipboard:r,ctorStart:i})),{doc:o,mapping:s}=Oe(t.document.getXmlFragment(`default`),a);return{...Jj({provider:t,placeholder:n,clipboard:r,ctorStart:i,prebuiltMapping:s}),content:o.toJSON(),element:null}}var Xj=e=>{let t=(0,$.c)(21),{provider:n,placeholder:r,isSourceMode:i,portalTarget:a}=e,o=(0,Q.useRef)(null),s=(0,Q.useRef)(Gj),c=NA(),{principal:l,activeDocName:u}=lt(),d=n.configuration.name??``,[f]=(0,Q.useState)(Kj),p;t[0]!==f||t[1]!==r||t[2]!==n?(p=()=>()=>({editor:new ni(Yj({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),g,_;if(t[4]!==m||t[5]!==d||t[6]!==n.document){let e={viewCount:0,bytes:n.document.getText(`source`).length},r=h(d)??crypto.randomUUID();g=Q.use,_=Ie({docName:d,mountId:r,construct:m,sizeStats:e}),t[4]=m,t[5]=d,t[6]=n.document,t[7]=g,t[8]=_}else g=t[7],_=t[8];let v=g(_),y=v.editor,b,x;t[9]===v?(b=t[10],x=t[11]):(b=()=>()=>{Ze(v)},x=[v],t[9]=v,t[10]=b,t[11]=x),(0,Q.useEffect)(b,x);let S;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?(S=(0,Z.jsx)(Zj,{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]=S):S=t[20],S},Zj=e=>{let t=(0,$.c)(78),{provider:n,isSourceMode:r,docName:i,activeDocName:a,identity:o,principal:s,editor:c,wrapperRef:l,flashStateRef:u,portalTarget:d}=e,f=(0,Q.useRef)(null),p,m;t[0]===d?(p=t[1],m=t[2]):(p=()=>{let e=f.current;if(e)return e.appendChild(d),()=>{d.parentNode===e&&e.removeChild(d)}},m=[d],t[0]=d,t[1]=p,t[2]=m),(0,Q.useLayoutEffect)(p,m);let h;t[3]!==c||t[4]!==n.configuration.name?(h=()=>(yt(c,n.configuration.name??null),()=>{yt(c,null)}),t[3]=c,t[4]=n.configuration.name,t[5]=h):h=t[5];let g;t[6]!==c||t[7]!==n?(g=[c,n],t[6]=c,t[7]=n,t[8]=g):g=t[8],(0,Q.useEffect)(h,g);let _;t[9]!==c||t[10]!==n.configuration.name?(_=()=>{let e=n.configuration.name;if(e)return b(e,c),()=>q(e,c)},t[9]=c,t[10]=n.configuration.name,t[11]=_):_=t[11];let v;t[12]!==c||t[13]!==n?(v=[c,n],t[12]=c,t[13]=n,t[14]=v):v=t[14],(0,Q.useEffect)(_,v);let y;t[15]!==c||t[16]!==n.configuration.name?(y=()=>{},t[15]=c,t[16]=n.configuration.name,t[17]=y):y=t[17];let x;t[18]!==c||t[19]!==n?(x=[c,n],t[18]=c,t[19]=n,t[20]=x):x=t[20],(0,Q.useEffect)(y,x);let S,C;t[21]===c?(S=t[22],C=t[23]):(C=()=>{let e=Qj,t=null,n=()=>{if(t||c.isDestroyed)return;let n=kt(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 kt(c)?n():c.on(`create`,n),()=>{c.off(`create`,n),r()}},S=[c],t[21]=c,t[22]=S,t[23]=C),(0,Q.useEffect)(C,S);let w,T;t[24]!==u||t[25]!==n.document||t[26]!==l?(w=()=>{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)},ci)};c(Gj);let f=()=>{if(bn(e),!In(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`?In(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)}},T=[n.document,u,l],t[24]=u,t[25]=n.document,t[26]=l,t[27]=w,t[28]=T):(w=t[27],T=t[28]),(0,Q.useEffect)(w,T);let E,O;t[29]===n?(E=t[30],O=t[31]):(E=()=>{let e=window.location.hash,t=e.indexOf(`?`),r=t>=0?new URLSearchParams(e.slice(t+1)).get(`anchor`):null;if(!r)return;let i=r,a=0,o,s=!1;function c(){if(s)return;let e=document.getElementById(i);e?(e.scrollIntoView({behavior:`smooth`,block:`start`}),s=!0,n.off(`synced`,c)):a<20&&(a+=1,o=window.setTimeout(c,100))}return c(),n.on(`synced`,c),()=>{o!==void 0&&clearTimeout(o),n.off(`synced`,c)}},O=[n],t[29]=n,t[30]=E,t[31]=O),(0,Q.useEffect)(E,O);let k,A;t[32]===c?(k=t[33],A=t[34]):(k=()=>{let e=function(e){let t=e.detail;if(!t||t.mode!==`wysiwyg`||c.isDestroyed)return;let n=kt(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(hs,e),()=>window.removeEventListener(hs,e)},A=[c],t[32]=c,t[33]=k,t[34]=A),(0,Q.useEffect)(k,A);let j;t[35]!==a||t[36]!==i||t[37]!==o||t[38]!==r||t[39]!==s||t[40]!==n.awareness?(j=()=>{let e=n.awareness;if(e){if(i!==a){e.setLocalState(null);return}e.setLocalState({user:PA({principal:s,identity:o}),mode:r?`source`:`wysiwyg`})}},t[35]=a,t[36]=i,t[37]=o,t[38]=r,t[39]=s,t[40]=n.awareness,t[41]=j):j=t[41];let M;t[42]!==a||t[43]!==i||t[44]!==o||t[45]!==r||t[46]!==s||t[47]!==n?(M=[n,i,a,o,s,r],t[42]=a,t[43]=i,t[44]=o,t[45]=r,t[46]=s,t[47]=n,t[48]=M):M=t[48],(0,Q.useEffect)(j,M);let N,P;t[49]!==c||t[50]!==r?(N=()=>(_t(c,r),()=>{_t(c,!1)}),P=[c,r],t[49]=c,t[50]=r,t[51]=N,t[52]=P):(N=t[51],P=t[52]),(0,Q.useEffect)(N,P);let F;t[53]!==c||t[54]!==r?(F=!r&&(0,Z.jsx)(jj,{editor:c}),t[53]=c,t[54]=r,t[55]=F):F=t[55];let I;t[56]!==c||t[57]!==r?(I=!r&&(0,Z.jsx)(Hj,{editor:c}),t[56]=c,t[57]=r,t[58]=I):I=t[58];let L;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(`div`,{ref:f,style:{display:`contents`}}),t[59]=L):L=t[59];let R;t[60]===c?R=t[61]:(R=(0,Z.jsx)(Tt,{editor:c,className:`tiptap-editor-portal-content h-full`}),t[60]=c,t[61]=R);let z;t[62]!==d||t[63]!==R?(z=(0,Fs.createPortal)(R,d),t[62]=d,t[63]=R,t[64]=z):z=t[64];let B;t[65]===c?B=t[66]:(B=(0,Z.jsx)(jA,{editor:c}),t[65]=c,t[66]=B);let V;t[67]===c?V=t[68]:(V=_e(c),t[67]=c,t[68]=V);let H;t[69]===V.store?H=t[70]:(H=(0,Z.jsx)(D,{store:V.store}),t[69]=V.store,t[70]=H);let U;return t[71]!==F||t[72]!==I||t[73]!==z||t[74]!==B||t[75]!==H||t[76]!==l?(U=(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:[F,I,L,z,B,H]}),t[71]=F,t[72]=I,t[73]=z,t[74]=B,t[75]=H,t[76]=l,t[77]=U):U=t[77],U};function Qj(){return fe()}function $j(e){let t=(0,$.c)(2),{docName:n,provider:r,children:i}=e;(0,Q.use)(wt(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 eM=`__back-nav__`;function tM(e){return e instanceof Le||e instanceof dt||e instanceof Ne||e instanceof Qe||e instanceof bt||e instanceof Me?e.docName:null}function nM(e){return e instanceof Le?{title:`Couldn't load document`,summary:`"${e.docName}" took too long. Check your connection.`}:e instanceof dt?{title:`Connection dropped`,summary:`Lost connection to "${e.docName}".`}:e instanceof Ne?{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 bt?{title:`Server can't open documents`,summary:`This project's running server doesn't support live editing. Restart Open Knowledge to fix.`}:e instanceof Me?{title:`Cancelled`,summary:`You cancelled loading "${e.docName}".`}:{title:`Unknown error`,summary:e instanceof Error&&e.message?e.message:`An unexpected error occurred.`}}function rM(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=nM(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)(_S,{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)(J,{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)(J,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>{!a||!o||(at(tM(n)??i),o(a),r(eM))},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 iM(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)(rM,{...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]===eM){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 d;t[9]===n?d=t[10]:(d=e=>{console.error(`[DocumentErrorBoundary] rendered fallback for ${n}: ${nM(e).title}`,e)},t[9]=n,t[10]=d);let f;return t[11]!==o||t[12]!==s||t[13]!==c||t[14]!==l||t[15]!==d?(f=(0,Z.jsx)(u,{fallbackRender:s,resetKeys:c,onReset:l,onError:d,children:o}),t[11]=o,t[12]=s,t[13]=c,t[14]=l,t[15]=d,t[16]=f):f=t[16],f}function aM(e){let t=e.document.getText(`source`).toString(),{map:n,parseError:r}=ur(t);return{map:n,keys:jr(t),parseError:r}}function oM(e){let t=(0,$.c)(169),{provider:n}=e,[r,i]=(0,Q.useState)(null),a;t[0]===n?a=t[1]:(a=()=>aM(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=Yr(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),E;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(E={},t[7]=E):E=t[7];let[D,O]=(0,Q.useState)(E),k=n.configuration.name??``,A;t[8]===k?A=t[9]:(A=cM(k),t[8]=k,t[9]=A);let j=Ba(A),M;t[10]!==j.state.data||t[11]!==j.state.status?(M=j.state.status===`ready`?j.state.data.folder.frontmatter_defaults??{}:{},t[10]=j.state.data,t[11]=j.state.status,t[12]=M):M=t[12];let N=M,P;t[13]!==j.state.data||t[14]!==j.state.status?(P=j.state.status===`ready`?j.state.data.frontmatterSources:{},t[13]=j.state.data,t[14]=j.state.status,t[15]=P):P=t[15];let F=P,I;t[16]===r?I=t[17]:(I=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=Sn(t.error);return{ok:!1,error:t.error.issues[0]?.message??`Invalid patch payload`,fieldErrors:Object.keys(n).length>0?n:void 0}},t[16]=r,t[17]=I);let L=I,z;t[18]===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[18]=z):z=t[18];let B=z,V;t[19]===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}),O(e=>{let n={...e};for(let e of t)n[e]=(n[e]??0)+1;return n})},t[19]=V):V=t[19];let H=V,U;t[20]===L?U=t[21]:(U=function(e,t){B(e),H(L({[e]:t}),[e])},t[20]=L,t[21]=U);let W=U,G;t[22]===L?G=t[23]:(G=function(e){B(e),H(L({[e]:null}),[e])},t[22]=L,t[23]=G);let K=G,ee;t[24]===r?ee=t[25]:(ee=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=Sn(n.error);return{ok:!1,error:n.error.issues[0]?.message??`Failed to rename`,fieldErrors:Object.keys(i).length>0?i:void 0}},t[24]=r,t[25]=ee);let q=ee,te;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(te=function(e,t){return`${e} ${t}`},t[26]=te):te=t[26];let ne=te,re;t[27]!==r||t[28]!==d?(re=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)=>ne(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[27]=r,t[28]=d,t[29]=re):re=t[29];let ie=re,ae;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(ae={activationConstraint:{distance:4}},t[30]=ae):ae=t[30];let se;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(se={coordinateGetter:$a},t[31]=se):se=t[31];let ce=$i(ja(Na,ae),ja(ta,se)),le;t[32]!==N||t[33]!==W||t[34]!==u?(le=function(e,t){let n=u[e]??lM(N[e]);if(n===void 0)return;_(n=>({...n,[e]:t}));let r=JO(n,t);(!Object.hasOwn(u,e)||!sM(n,r))&&W(e,r)},t[32]=N,t[33]=W,t[34]=u,t[35]=le):le=t[35];let ue=le,de;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(de=function(){y({name:``,type:`text`,value:``,error:null}),m(!1)},t[36]=de):de=t[36];let fe=de,{addPropertySignal:pe,clearAddProperty:me}=Pk(),he;t[37]!==pe||t[38]!==k?(he=pe.get(k)??0,t[37]=pe,t[38]=k,t[39]=he):he=t[39];let ge=he,_e,ve;t[40]===ge?(_e=t[41],ve=t[42]):(_e=()=>{ge>0&&(y({name:``,type:`text`,value:``,error:null}),m(!1))},ve=[ge],t[40]=ge,t[41]=_e,t[42]=ve),(0,Q.useEffect)(_e,ve);let ye,be;t[43]!==me||t[44]!==k?(ye=()=>()=>me(k),be=[k,me],t[43]=me,t[44]=k,t[45]=ye,t[46]=be):(ye=t[45],be=t[46]),(0,Q.useEffect)(ye,be);let xe;t[47]===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):GO[e];return{...t,type:e,value:n,error:null}})},t[47]=xe):xe=t[47];let Se=xe,Ce;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=function(e){y(t=>t&&{...t,value:e})},t[48]=Ce):Ce=t[48];let we=Ce,Te;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(Te=function(e){y(t=>t&&{...t,name:e,error:null})},t[49]=Te):Te=t[49];let Ee=Te,De;t[50]!==v||t[51]!==L||t[52]!==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=L({[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[50]=v,t[51]=L,t[52]=u,t[53]=De):De=t[53];let Oe=De,ke;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(ke=function(){y(null)},t[54]=ke):ke=t[54];let Ae=ke,je;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(je=function(e){x({key:e,draft:e,error:null})},t[55]=je):je=t[55];let Me=je,Ne;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=function(e){x(t=>t&&{...t,draft:e,error:null})},t[56]=Ne):Ne=t[56];let Pe=Ne,Fe;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=function(){x(null)},t[57]=Fe):Fe=t[57];let Ie=Fe,Le;t[58]!==u||t[59]!==q||t[60]!==b?(Le=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=q(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[58]=u,t[59]=q,t[60]=b,t[61]=Le):Le=t[61];let Re=Le,ze;t[62]!==u||t[63]!==d?(ze=d.length>0?d:Object.keys(u),t[62]=u,t[63]=d,t[64]=ze):ze=t[64];let Be=ze,Ve;if(t[65]!==Be){Ve=new Map;for(let e of Be)Ve.set(e,(Ve.get(e)??0)+1);t[65]=Be,t[66]=Ve}else Ve=t[66];let He,Ue,We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e;if(t[67]!==v||t[68]!==N||t[69]!==F||t[70]!==p||t[71]!==W||t[72]!==Re||t[73]!==Ve||t[74]!==C||t[75]!==ie||t[76]!==u||t[77]!==g||t[78]!==f||t[79]!==K||t[80]!==b||t[81]!==Be||t[82]!==D||t[83]!==ce||t[84]!==ue){$e=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Object.keys(N).filter(e=>!Object.hasOwn(u,e)).sort();if(Be.length===0&&e.length===0&&!v&&!f){$e=null;break bb0}Ze=`property-panel editor-content-aligned pt-4 pb-4 text-sm`,Qe=`property-panel`,Ue=R,Je=!p,t[97]===Symbol.for(`react.memo_cache_sentinel`)?(Ye=e=>m(!e),t[97]=Ye):Ye=t[97];let n=!p,r;t[98]===n?r=t[99]:(r=(0,Z.jsx)(T,{"data-expanded":n,className:`size-3.5 shrink-0 text-muted-foreground transition-transform duration-150 ease-out data-[expanded=true]:rotate-90`}),t[98]=n,t[99]=r);let i;t[100]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`span`,{children:`Properties`}),t[100]=i):i=t[100],t[101]===r?Xe=t[102]:(Xe=(0,Z.jsx)(Lt,{asChild:!0,children:(0,Z.jsxs)(J,{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[101]=r,t[102]=Xe),He=oe,We=`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in]`,t[103]===f?Ge=t[104]:(Ge=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)(Jr,{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[103]=f,t[104]=Ge);let a;if(t[105]!==Be){let e;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(e=(e,t)=>ne(e,t),t[107]=e):e=t[107],a=Be.map(e),t[105]=Be,t[106]=a}else a=t[106];let o;if(t[108]!==N||t[109]!==F||t[110]!==W||t[111]!==Re||t[112]!==Ve||t[113]!==C||t[114]!==u||t[115]!==g||t[116]!==K||t[117]!==b||t[118]!==Be||t[119]!==D||t[120]!==ue){let e;t[122]!==N||t[123]!==F||t[124]!==W||t[125]!==Re||t[126]!==Ve||t[127]!==C||t[128]!==u||t[129]!==g||t[130]!==K||t[131]!==b||t[132]!==D||t[133]!==ue?(e=(e,t)=>{let n=u[e];if(n===void 0)return null;let r=g[e]??Kr(n),i=b?.key===e?b:null,a=(Ve.get(e)??0)>1,o=Object.hasOwn(N,e)?(0,Z.jsx)(uM,{source:F[e]??``}):void 0;return(0,Z.jsx)(XO,{sortableId:ne(e,t),keyName:e,value:n,declared:r,error:C[e]??null,resetCounter:D[e]??0,isDuplicate:a,badge:o,rename:{state:i,onBegin:()=>Me(e),onChangeDraft:Pe,onCommit:Re,onCancel:Ie},onCommit:t=>W(e,t),onChangeType:t=>ue(e,t),onRemove:()=>K(e)},`${e}-${t}`)},t[122]=N,t[123]=F,t[124]=W,t[125]=Re,t[126]=Ve,t[127]=C,t[128]=u,t[129]=g,t[130]=K,t[131]=b,t[132]=D,t[133]=ue,t[134]=e):e=t[134],o=Be.map(e),t[108]=N,t[109]=F,t[110]=W,t[111]=Re,t[112]=Ve,t[113]=C,t[114]=u,t[115]=g,t[116]=K,t[117]=b,t[118]=Be,t[119]=D,t[120]=ue,t[121]=o}else o=t[121];let s;t[135]!==a||t[136]!==o?(s=(0,Z.jsx)(to,{items:a,strategy:Wi,children:o}),t[135]=a,t[136]=o,t[137]=s):s=t[137],t[138]!==ie||t[139]!==ce||t[140]!==s?(Ke=(0,Z.jsx)(Hi,{sensors:ce,collisionDetection:Li,onDragEnd:ie,children:s}),t[138]=ie,t[139]=ce,t[140]=s,t[141]=Ke):Ke=t[141];let c;t[142]!==N||t[143]!==F||t[144]!==W||t[145]!==C||t[146]!==D||t[147]!==ue?(c=e=>{let t=N[e],n=lM(t),r=Kr(n),i=F[e]??``;return(0,Z.jsx)(XO,{keyName:e,value:n,declared:r,error:C[e]??null,resetCounter:D[e]??0,isInherited:!0,badge:(0,Z.jsx)(rk,{source:i}),onCommit:t=>W(e,t),onChangeType:t=>ue(e,t)},`inherited-${e}`)},t[142]=N,t[143]=F,t[144]=W,t[145]=C,t[146]=D,t[147]=ue,t[148]=c):c=t[148],qe=e.map(c)}t[67]=v,t[68]=N,t[69]=F,t[70]=p,t[71]=W,t[72]=Re,t[73]=Ve,t[74]=C,t[75]=ie,t[76]=u,t[77]=g,t[78]=f,t[79]=K,t[80]=b,t[81]=Be,t[82]=D,t[83]=ce,t[84]=ue,t[85]=He,t[86]=Ue,t[87]=We,t[88]=Ge,t[89]=Ke,t[90]=qe,t[91]=Je,t[92]=Ye,t[93]=Xe,t[94]=Ze,t[95]=Qe,t[96]=$e}else He=t[85],Ue=t[86],We=t[87],Ge=t[88],Ke=t[89],qe=t[90],Je=t[91],Ye=t[92],Xe=t[93],Ze=t[94],Qe=t[95],$e=t[96];if($e!==Symbol.for(`react.early_return_sentinel`))return $e;let et;t[149]!==v||t[150]!==Oe?(et=v?(0,Z.jsx)(tk,{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)(J,{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)(Ui,{className:`size-3.5`}),(0,Z.jsx)(`span`,{children:`Add`})]})]}),t[149]=v,t[150]=Oe,t[151]=et):et=t[151];let tt;t[152]!==He||t[153]!==We||t[154]!==Ge||t[155]!==Ke||t[156]!==qe||t[157]!==et?(tt=(0,Z.jsxs)(He,{className:We,children:[Ge,Ke,qe,et]}),t[152]=He,t[153]=We,t[154]=Ge,t[155]=Ke,t[156]=qe,t[157]=et,t[158]=tt):tt=t[158];let nt;t[159]!==Ue||t[160]!==Je||t[161]!==Ye||t[162]!==Xe||t[163]!==tt?(nt=(0,Z.jsxs)(Ue,{open:Je,onOpenChange:Ye,children:[Xe,tt]}),t[159]=Ue,t[160]=Je,t[161]=Ye,t[162]=Xe,t[163]=tt,t[164]=nt):nt=t[164];let rt;return t[165]!==Ze||t[166]!==Qe||t[167]!==nt?(rt=(0,Z.jsx)(`div`,{className:Ze,"data-testid":Qe,children:nt}),t[165]=Ze,t[166]=Qe,t[167]=nt,t[168]=rt):rt=t[168],rt}function sM(e,t){return Array.isArray(e)&&Array.isArray(t)?e.length===t.length?e.every((e,n)=>e===t[n]):!1:e===t}function cM(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function lM(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)}function uM(e){let t=(0,$.c)(2),{source:n}=e,r=`Overrides default from ${n===``?`.ok/frontmatter.yml`:`${n}/.ok/frontmatter.yml`}. Remove to revert.`,i;return t[0]===r?i=t[1]:(i=(0,Z.jsx)(je,{variant:`primary`,"data-testid":`property-override-badge`,title:r,className:`text-2xs`,children:`overrides`}),t[0]=r,t[1]=i),i}var dM=qe(`LARGE_DOC_CHAR_THRESHOLD`,5e5);function fM(e){let t=e.threshold??dM;return e.ytextLength>t?{renderSource:e.isSourceMode||e.visitedSource,renderVisual:!e.isSourceMode||e.visitedVisual,isLarge:!0}:{renderSource:!0,renderVisual:!0,isLarge:!1}}function pM(e){return e.hasEmittedFirstToggle||!e.isLarge?!1:e.renderSource&&e.renderVisual}var mM=qe(`ACTIVITY_MOUNT_LIMIT`,3);function hM(){return r(()=>import(`./SourceEditor-C6qXNflf.js`),__vite__mapDeps([43,1,35,2,36,37,21,38,39,40,41,20,3,6,7,15,4,8,14,9,44,24]),import.meta.url)}var gM=(0,Q.lazy)(async()=>({default:(await hM()).SourceEditor}));function _M(e,t,n){if(n<=0)return[];let r=e.filter(e=>!Ue(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 vM(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 yM(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(ct,{name:`activity-pool`,children:(0,Z.jsx)(bM,{...e})}),t[0]=e,t[1]=n),n}function bM(e){let t=(0,$.c)(15),{activeDocName:n,isSourceMode:r,editorPlaceholder:i,previousDocName:a,onNavigateBack:o,onRecycle:s}=e,{poolEntries:c,serverRestartRecovery:l}=lt(),{pages:u,loading:d}=Xr(),f=_M(c,n,mM),p=(0,Q.useRef)(``),m=f.map(xM).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)de(e);for(let e of i){let t=h.current.find(t=>t.docName===e)?.poolEventId;jt(e,t&&t.length>0?t:crypto.randomUUID())}Xe(`ok/activity/mount-list-change`,{active:n,mounted:t,evicted:r}),p.current=m,Je(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)(EM,{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 y=f.map(v),b;return t[13]===y?b=t[14]:(b=(0,Z.jsx)(Z.Fragment,{children:y}),t[13]=y,t[14]=b),b}function xM(e){return e.docName}function SM(e){let t=(0,$.c)(8),{isActive:n,children:r}=e,i=(0,Q.useRef)(null),a=(0,Q.useRef)(0),o,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{let e=i.current;if(!e)return;let t=()=>{e.scrollTop>0&&(a.current=e.scrollTop)};return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},s=[],t[0]=o,t[1]=s):(o=t[0],s=t[1]),(0,Q.useEffect)(o,s);let c,l;t[2]===n?(c=t[3],l=t[4]):(c=()=>{if(!n)return;let e=i.current;if(!e)return;let t=a.current;if(t===0||(e.scrollTop=t,e.scrollTop===t))return;let r=!1,o=()=>{r||(r=!0,s.disconnect(),clearTimeout(c))},s=new ResizeObserver(()=>{r||!e||e.scrollHeight>t&&(e.scrollTop=t,e.scrollTop===t&&o())});s.observe(e);let c=setTimeout(o,500);return o},l=[n],t[2]=n,t[3]=c,t[4]=l),(0,Q.useLayoutEffect)(c,l);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u={overflowAnchor:`auto`},t[5]=u):u=t[5];let d;return t[6]===r?d=t[7]:(d=(0,Z.jsx)(`div`,{ref:i,"data-testid":`editor-scroll-container`,className:`subtle-scrollbar h-full overflow-y-auto pt-14 scroll-pt-14`,style:u,children:r}),t[6]=r,t[7]=d),d}function CM(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)(Px,{}),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)(gM,{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 wM(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)(Pc,{className:`size-5`,"aria-hidden":`true`}):(0,Z.jsx)(y,{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)(J,{type:`button`,onClick:TM,children:[(0,Z.jsx)(Pc,{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 TM(){return window.location.reload()}function EM(e){let t=(0,$.c)(48),{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=vM(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),g=n.provider.document.getText(`source`).length,[_,v]=(0,Q.useState)(i),[y,b]=(0,Q.useState)(!i),x,S;t[5]!==i||t[6]!==_||t[7]!==y?(x=()=>{i&&!_?v(!0):!i&&!y&&b(!0)},S=[i,_,y],t[5]=i,t[6]=_,t[7]=y,t[8]=x,t[9]=S):(x=t[8],S=t[9]),(0,Q.useEffect)(x,S);let C=fM({ytextLength:g,isSourceMode:i,visitedSource:_,visitedVisual:y}),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]!==g?(E=()=>{w.current!==T&&(w.current=T,C.isLarge&&Xe(`ok/activity/defer-mount`,{docName:n.docName,ytextLength:g,isSourceMode:i,renderSource:C.renderSource,renderVisual:C.renderVisual}))},D=[T,C.isLarge,C.renderSource,C.renderVisual,n.docName,g,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]=g,t[17]=E,t[18]=D):(E=t[17],D=t[18]),(0,Q.useEffect)(E,D);let[O,k]=(0,Q.useState)(!1),A,j;t[19]!==n.docName||t[20]!==C.isLarge||t[21]!==C.renderSource||t[22]!==C.renderVisual||t[23]!==O||t[24]!==i||t[25]!==g?(A=()=>{pM({isLarge:C.isLarge,renderSource:C.renderSource,renderVisual:C.renderVisual,hasEmittedFirstToggle:O})&&(Xe(`ok/cold/first-toggle`,{docName:n.docName,mountId:h(n.docName),ytextLength:g,modeEnteredFirst:i?`source`:`visual`}),k(!0))},j=[O,C.isLarge,C.renderSource,C.renderVisual,n.docName,g,i],t[19]=n.docName,t[20]=C.isLarge,t[21]=C.renderSource,t[22]=C.renderVisual,t[23]=O,t[24]=i,t[25]=g,t[26]=A,t[27]=j):(A=t[26],j=t[27]),(0,Q.useEffect)(A,j);let M=r?`visible`:`hidden`,N=`editor:${n.docName}`,P;t[28]!==a||t[29]!==n||t[30]!==C.renderSource||t[31]!==C.renderVisual||t[32]!==r||t[33]!==o||t[34]!==i||t[35]!==c||t[36]!==l||t[37]!==m||t[38]!==s||t[39]!==f?(P=f?(0,Z.jsx)(wM,{view:f}):(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsx)(iM,{activeDocName:n.docName,previousDocName:s,onNavigateBack:c,onRecycle:l,children:(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(Px,{}),children:(0,Z.jsx)($j,{docName:n.docName,provider:n.provider,children:(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[!i&&(0,Z.jsx)(oM,{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)(CM,{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)(Xj,{provider:n.provider,placeholder:a,isSourceMode:i,portalTarget:m},`${n.docName}-${String(o)}`)}):null]})]})})})})}),t[28]=a,t[29]=n,t[30]=C.renderSource,t[31]=C.renderVisual,t[32]=r,t[33]=o,t[34]=i,t[35]=c,t[36]=l,t[37]=m,t[38]=s,t[39]=f,t[40]=P):P=t[40];let F;t[41]!==r||t[42]!==P?(F=(0,Z.jsx)(SM,{isActive:r,children:P}),t[41]=r,t[42]=P,t[43]=F):F=t[43];let I;return t[44]!==N||t[45]!==F||t[46]!==M?(I=(0,Z.jsx)(Q.Activity,{mode:M,name:N,children:F}),t[44]=N,t[45]=F,t[46]=M,t[47]=I):I=t[47],I}function DM(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 OM(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=Y(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 kM(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=Y(`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 AM(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=Y(`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 jM(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=Y(`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 MM(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=Y(`[&>svg]:size-3.5`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=n??(0,Z.jsx)(T,{}),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 NM(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}=Ge(n,``);if(!e){l=null;break bb0}let u=e.replace(/\/$/,``).split(`/`).filter(Boolean);if(u.length===0){l=null;break bb0}a=OM,t[8]===r?c=t[9]:(c=Y(`flex min-w-0 items-center`,r),t[8]=r,t[9]=c),i=kM,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)(MM,{className:`text-muted-foreground/70 [&>svg]:size-3`}),(0,Z.jsx)(AM,{className:`min-w-0`,children:(0,Z.jsx)(jM,{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 PM={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`},FM=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`,...PM,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},IM=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)(FM,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i},LM=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)(FM,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i};function RM(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)(NM,{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)(Vo,{children:[(0,Z.jsx)(No,{value:`wysiwyg`,"aria-label":`Visual editor`,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,asChild:!0,children:(0,Z.jsx)(Ro,{children:(0,Z.jsx)(LM,{className:`size-4`})})}),(0,Z.jsx)(zo,{side:`bottom`,children:`Visual`})]}),t[4]=p):p=t[4];let m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(IM,{className:`size-4`}),t[5]=m):m=t[5];let h;t[6]===i?h=t[7]:(h=(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsx)(`div`,{children:(0,Z.jsx)(No,{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)(zo,{side:`bottom`,children:g}),t[8]=g,t[9]=_);let v;t[10]!==h||t[11]!==_?(v=(0,Z.jsxs)(Vo,{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)(Io,{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)(Vo,{children:[(0,Z.jsx)(J,{variant:`ghost`,size:`icon`,"aria-label":`Add properties`,onClick:s,"data-testid":`add-properties-button`,asChild:!0,children:(0,Z.jsx)(Ro,{children:(0,Z.jsx)(yc,{})})}),(0,Z.jsx)(zo,{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)(Ro,{children:c?(0,Z.jsx)(Oc,{}):(0,Z.jsx)(Dc,{})}),t[20]=c,t[21]=C);let w;t[22]!==l||t[23]!==x||t[24]!==S||t[25]!==C?(w=(0,Z.jsx)(J,{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)(zo,{side:`bottom`,children:T}),t[27]=T,t[28]=E);let D;t[29]!==w||t[30]!==E?(D=(0,Z.jsxs)(Vo,{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 zM(e){let{activeDocName:t,deferredActiveDocName:n,mountResolved:r,syncResolved:i}=e;return t===null||t===n?!1:!(r&&i)}var BM=(0,Q.lazy)(()=>r(()=>import(`./SettingsDialog-D_QZNx5I.js`).then(e=>({default:e.SettingsDialog})),__vite__mapDeps([45,1,35,2,36,37,21,38,39,40,41,20,3,6,7,15,4,8,14,9,46,16,22,10,23]),import.meta.url)),VM=(0,Q.lazy)(async()=>({default:(await r(()=>import(`./ActivityModeContent-DaTVFKNP.js`),__vite__mapDeps([34,1,2,35,36,37,21,38,39,40,41,20,3,6,7,15,4,8,14,9,23,42]),import.meta.url)).ActivityModeContent}));function HM(e){let t=(0,$.c)(5),n;t[0]===e?n=t[1]:(n=(0,Z.jsx)(WM,{...e}),t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(UM,{}),t[2]=r):r=t[2];let i;return t[3]===n?i=t[4]:(i=(0,Z.jsx)(ct,{name:`editor-area`,children:(0,Z.jsxs)(Mk,{children:[n,r]})}),t[3]=n,t[4]=i),i}function UM(){let e=(0,$.c)(8),t=km(),[n,r]=(0,Q.useState)(!1),i,a;if(e[0]===t.open?(i=e[1],a=e[2]):(i=()=>{t.open&&r(!0)},a=[t.open],e[0]=t.open,e[1]=i,e[2]=a),(0,Q.useEffect)(i,a),!n)return null;let o;e[3]===t?o=e[4]:(o=e=>{e||t.close()},e[3]=t,e[4]=o);let s;return e[5]!==t.open||e[6]!==o?(s=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(BM,{open:t.open,onOpenChange:o})}),e[5]=t.open,e[6]=o,e[7]=s):s=e[7],s}function WM(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}=lt(),{openDocumentTransition:p}=vt(),{requestAddProperty:m}=Pk(),h=wA(s,o),g=TA(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=kx(),[C,w]=(0,Q.useState)(!1),{layout:T,autoCollapse:E}=cA(),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=Mp();return t&&e(t),Pp(t=>{Mp(),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)(Tk,{folderPath:c.folderPath}),t[18]=c.folderPath,t[19]=e),e}let e;t[20]===c.folderPath?e=t[21]:(e=(0,Z.jsx)(Ik,{minSize:`30%`,defaultSize:`75%`,children:(0,Z.jsx)(Tk,{folderPath:c.folderPath})}),t[20]=c.folderPath,t[21]=e);let n;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(Lk,{withHandle:!0}),t[22]=n):n=t[22];let r;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(Ik,{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)(VM,{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)(Fk,{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)(Nx,{assetPath:c.assetPath,mediaKind:c.mediaKind}),t[26]=c.assetPath,t[27]=c.mediaKind,t[28]=e):e=t[28],e}if(!s||!o){if((typeof window<`u`?Br(window.location.hash):null)!==null){let e;return t[29]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Px,{}),t[29]=e):e=t[29],e}let e;return t[30]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(OS,{}),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 K=G,ee;t[34]!==C||t[35]!==D||t[36]!==S?(ee=function(){D?k(GM):C?(A.current=!1,S.current?.expand()):(A.current=!0,S.current?.collapse())},t[34]=C,t[35]=D,t[36]=S,t[37]=ee):ee=t[37];let q=ee,te=v??o,ne=R??void 0,re;t[38]===p?re=t[39]:(re=e=>{let t=kr(e);window.location.hash===t?p(e):window.location.hash=t},t[38]=p,t[39]=re);let ie;t[40]!==x||t[41]!==H||t[42]!==l||t[43]!==te||t[44]!==ne||t[45]!==re?(ie=(0,Z.jsx)(yM,{activeDocName:te,isSourceMode:H,editorPlaceholder:x,previousDocName:ne,onNavigateBack:re,onRecycle:l}),t[40]=x,t[41]=H,t[42]=l,t[43]=te,t[44]=ne,t[45]=re,t[46]=ie):ie=t[46];let ae;t[47]!==o||t[48]!==H?(ae=(0,Z.jsx)(rA,{activeDocName:o,isSourceMode:H}),t[47]=o,t[48]=H,t[49]=ae):ae=t[49];let oe;t[50]!==o||t[51]!==v?(oe=zM({activeDocName:o,deferredActiveDocName:v,mountResolved:o!==null&&It(o),syncResolved:o!==null&&ze(o)})?(0,Z.jsxs)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:[(0,Z.jsx)(Px,{}),o===null?null:(0,Z.jsx)(kk,{docName:o})]}):null,t[50]=o,t[51]=v,t[52]=oe):oe=t[52];let se;t[53]!==ie||t[54]!==ae||t[55]!==oe?(se=(0,Z.jsxs)(`div`,{className:`relative h-full`,children:[ie,ae,oe]}),t[53]=ie,t[54]=ae,t[55]=oe,t[56]=se):se=t[56];let ce=!H,le;t[57]!==o||t[58]!==W||t[59]!==H||t[60]!==r||t[61]!==K||t[62]!==U||t[63]!==ce||t[64]!==q?(le=(0,Z.jsx)(RM,{activeDocName:o,isSourceMode:H,sourceDisabled:U,onModeChange:r,showAddPropertyButton:ce,onAddProperty:K,isPanelCollapsed:W,onTogglePanel:q}),t[57]=o,t[58]=W,t[59]=H,t[60]=r,t[61]=K,t[62]=U,t[63]=ce,t[64]=q,t[65]=le):le=t[65];let ue;t[66]!==se||t[67]!==le?(ue=(0,Z.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[se,le]}),t[66]=se,t[67]=le,t[68]=ue):ue=t[68];let de;t[69]!==b||t[70]!==h?(de=b&&(0,Z.jsx)(DM,{stats:h}),t[69]=b,t[70]=h,t[71]=de):de=t[71];let fe;t[72]!==ue||t[73]!==de?(fe=(0,Z.jsxs)(`div`,{className:`relative flex h-full flex-col`,children:[ue,de]}),t[72]=ue,t[73]=de,t[74]=fe):fe=t[74];let pe=fe,me=D?`100%`:`30%`,he=D?`100%`:`75%`,ge;t[75]!==pe||t[76]!==me||t[77]!==he?(ge=(0,Z.jsx)(Ik,{minSize:me,defaultSize:he,children:pe}),t[75]=pe,t[76]=me,t[77]=he,t[78]=ge):ge=t[78];let _e;t[79]===D?_e=t[80]:(_e=D?null:(0,Z.jsx)(Lk,{withHandle:!0}),t[79]=D,t[80]=_e);let ve;t[81]!==o||t[82]!==i||t[83]!==u||t[84]!==D||t[85]!==H||t[86]!==a||t[87]!==S?(ve=D?null:(0,Z.jsx)(Ik,{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)(Iy,{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]=ve):ve=t[88];let ye;t[89]!==ge||t[90]!==_e||t[91]!==ve?(ye=(0,Z.jsxs)(Fk,{orientation:`horizontal`,children:[ge,_e,ve]}),t[89]=ge,t[90]=_e,t[91]=ve,t[92]=ye):ye=t[92];let be;t[93]!==o||t[94]!==i||t[95]!==u||t[96]!==D||t[97]!==H||t[98]!==a||t[99]!==O?(be=D?(0,Z.jsx)(tv,{open:O,onOpenChange:k,children:(0,Z.jsxs)(iv,{side:`right`,className:`flex w-80 sm:w-96 flex-col gap-0 p-0`,children:[(0,Z.jsx)(av,{className:`sr-only`,children:(0,Z.jsx)(ov,{children:`Document panel`})}),(0,Z.jsx)(Iy,{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]=be):be=t[100];let xe;return t[101]!==ye||t[102]!==be?(xe=(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[ye,be]}),t[101]=ye,t[102]=be,t[103]=xe):xe=t[103],xe}function GM(e){return!e}function KM(){let e=(0,$.c)(2),[t,n]=(0,Q.useState)(qM),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.matchMedia(`(max-width: 767px)`),t=()=>{n(window.innerWidth<768)};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 qM(){return window.innerWidth<768}function JM(e){let t=e.endsWith(`rem`)?`rem`:`px`;return{value:Number.parseFloat(e),unit:t}}function YM(e){let{value:t,unit:n}=JM(e);return n===`rem`?t*16:t}function XM(e,t){return`${t===`rem`?e.toFixed(1):Math.round(e)}${t}`}var ZM=3600*24*7;function QM(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?$M:m,O=g===void 0?ZM: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,K;t[3]===y?(G=t[4],K=t[5]):(G=()=>{H.current=y},K=[y],t[3]=y,t[4]=G,t[5]=K),(0,Q.useEffect)(G,K);let ee=YM(b),q;t[6]===x?q=t[7]:(q=YM(x),t[6]=x,t[7]=q);let te=q,ne;t[8]!==E||t[9]!==k?(ne=function(e){P.current=!0,E&&(j.current=H.current?0:YM(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]=ne):ne=t[10];let re=ne,ie,ae;t[11]!==w||t[12]!==v||t[13]!==C||t[14]!==S||t[15]!==T||t[16]!==k||t[17]!==te||t[18]!==ee||t[19]!==i||t[20]!==a||t[21]!==D||t[22]!==O||t[23]!==h?(ie=()=>{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}=JM(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<=ee*w;else if(e<=ee){let n=ee*(w-1);t=ee-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>ee*T){a();let t=n(r,M.current,j.current,s),c=Math.max(ee,Math.min(te,t)),u=XM(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(ee,Math.min(te,u)),f=XM(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)}},ae=[i,a,D,ee,te,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]=te,t[18]=ee,t[19]=i,t[20]=a,t[21]=D,t[22]=O,t[23]=h,t[24]=ie,t[25]=ae):(ie=t[24],ae=t[25]),(0,Q.useEffect)(ie,ae);let oe;return t[26]===re?oe=t[27]:(oe={dragRef:A,isDragging:N,handleMouseDown:re},t[26]=re,t[27]=oe),oe}function $M(){}var eN=`sidebar_state`,tN=3600*24*7,nN=`18rem`,rN=`3rem`,iN=`\\`,aN=`app-file-sidebar`,oN=`14.625rem`,sN=`22rem`,cN=`sidebar_width`,lN=/^\d+(?:\.\d+)?(?:rem|px)$/,uN=Q.createContext(null);function dN(e){if(typeof document>`u`)return e;let t=document.cookie.split(`; `).find(e=>e.startsWith(`${cN}=`))?.split(`=`)[1];if(!t)return e;let n;try{n=decodeURIComponent(t)}catch{return e}return lN.test(n)?n:e}function fN(){let e=Q.use(uN);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function pN(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?nN:l,f=KM(),p;t[9]===d?p=t[10]:(p=()=>dN(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=`${eN}=${t}; path=/; max-age=${tN}`},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<768?_(hN):D(mN)},t[14]=D,t[15]=O);let k=O,A;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(A=function(){window.innerWidth>=768||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===iN&&(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":rN,...s},t[40]=s,t[41]=m,t[42]=H):H=t[42];let U=H,W;t[43]===r?W=t[44]:(W=Y(`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 K;return t[50]!==V||t[51]!==G?(K=(0,Z.jsx)(uN.Provider,{value:V,children:G}),t[50]=V,t[51]=G,t[52]=K):K=t[52],K}function mN(e){return!e}function hN(e){return!e}function gN(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}=fN();if(u===`none`){let e;t[7]===r?e=t[8]:(e=Y(`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=Y(`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:aN,"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]:(_=Y(`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=Y(`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:aN,"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 _N(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}=fN(),s=o===`expanded`,c=o===`expanded`?`Hide Files`:`Show Files`,l;t[4]===n?l=t[5]:(l=Y(n),t[4]=n,t[5]=l);let u;t[6]!==r||t[7]!==a?(u=e=>{r?.(e),a()},t[6]=r,t[7]=a,t[8]=u):u=t[8];let d;t[9]===o?d=t[10]:(d=o===`expanded`?(0,Z.jsx)(pe,{}):(0,Z.jsx)(Ec,{}),t[9]=o,t[10]=d);let f;return t[11]!==i||t[12]!==s||t[13]!==c||t[14]!==l||t[15]!==u||t[16]!==d?(f=(0,Z.jsx)(J,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,"aria-expanded":s,"aria-controls":aN,"aria-label":c,className:l,onClick:u,...i,children:d}),t[11]=i,t[12]=s,t[13]=c,t[14]=l,t[15]=u,t[16]=d,t[17]=f):f=t[17],f}function vN(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}=fN(),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:oN,maxResizeWidth:sN,setIsDraggingRail:p,widthCookieName:cN,widthCookieMaxAge:tN},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:_}=QM(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=Y(`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 yN(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}=fN(),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=Y(`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 bN(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=Y(`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 xN(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=Y(`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 SN(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=Y(`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 CN(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=Y(`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 wN(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=Y(`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 TN=pi(`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 EN(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?gi:`button`,{isMobile:m,state:h}=fN(),g;t[8]!==n||t[9]!==f||t[10]!==d?(g=Y(TN({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)(Ro,{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)(zo,{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)(Vo,{children:[y,x]}),t[25]=y,t[26]=x,t[27]=S):S=t[27],S}function DN(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 ON(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 kN=1e3,AN=!1;function jN(e){return!!(e.localPrincipalId&&e.entryPrincipalId===e.localPrincipalId||!e.localPrincipalId&&e.entryClientId===e.localClientId)}function MN(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:Pi(i)?a=i:(a=void 0,AN||(AN=!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`&&(jN({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=ON(i),{current:c,crossDoc:l}=a?ki(a,n,Date.now()):{current:[],crossDoc:[]},u=NN,d=c.map(u),f=l.map(u),p=[...s,...d],m=f;o(e=>DN(e.current,p)&&DN(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,kN);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 NN(e){let{agentId:t,entry:n}=e;return{kind:`agent`,agentId:t,presence:n}}var PN=`sync-status`;function FN(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:PN,duration:1/0})):i.current&&e===`synced`&&(i.current=!1,X.success(`Reconnected`,{id:PN,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 IN=4,LN=3,RN={Bird:Ns,Cat:Bs,Dog:$s,Fish:rc,Mouse:Nc,Rabbit:Mc,Shrimp:Vc,Snail:Hc,Squirrel:Kc,Turtle:Qc};Object.freeze([...Object.keys(RN)]);function zN(e){if(typeof e.principalId==`string`&&e.principalId.length>0)return{kind:`initials`};let t=e.name.split(` `)[1];return t&&Object.hasOwn(RN,t)?{kind:`animal`,animal:t}:{kind:`initials`}}var BN={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`,bot:`Agent`};function VN(e){let t=(0,$.c)(20),{user:n,mode:r,tabCount:i}=e,a=zN(n),o=a.kind===`animal`?RN[a.animal]:void 0,s;t[0]===n.name?s=t[1]:(s=ir(n.name),t[0]=n.name,t[1]=s);let c=s,l;t[2]===n.color?l=t[3]:(l=Jn(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)(Ro,{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)(zo,{children:d}),t[15]=d,t[16]=g);let _;return t[17]!==h||t[18]!==g?(_=(0,Z.jsxs)(Vo,{children:[h,g]}),t[17]=h,t[18]=g,t[19]=_):_=t[19],_}function HN(e){let t=BN[e.icon];return e.displayName||t||`Agent`}function UN(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 WN(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=HN(o),t[0]=o,t[1]=c);let l=c,u=UN(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)(Mi,{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)(Ro,{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)(zo,{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)(Vo,{children:[D,A]}),t[33]=D,t[34]=A,t[35]=j):j=t[35],j}function GN(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)(M,{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)(VN,{user:e.user,mode:e.mode,tabCount:e.tabCount},e.clientId):(0,Z.jsx)(WN,{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)(C,{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)(re,{children:[l,d]}),t[15]=l,t[16]=d,t[17]=f):f=t[17],f}function KN(e,t,n,r){return e.kind===`human`?(0,Z.jsx)(VN,{user:e.user,mode:e.mode,tabCount:e.tabCount},e.clientId):(0,Z.jsx)(WN,{participant:e,crossDoc:n,scoped:r===e.agentId,onClickAgent:t},e.agentId)}function qN(){let e=(0,$.c)(20),{activeProvider:t,activeDocName:n,systemProvider:r,openActivityPanel:i,docPanelMode:a,docPanelAgentId:o}=lt(),{current:s,crossDoc:c}=MN(t,r,n);FN(TA(t),n);let l;if(e[0]!==c||e[1]!==s||e[2]!==o||e[3]!==a||e[4]!==i){let t=s.slice(0,IN),n;e[6]===s?n=e[7]:(n=s.slice(IN),e[6]=s,e[7]=n);let r=n,u=c.slice(0,LN),d;e[8]===c?d=e[9]:(d=c.slice(LN),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=>KN(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)(GN,{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=>KN(e,p,!0,m)),f.length>0?(0,Z.jsx)(GN,{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}function JN(e,t){return t.trim()}function YN(e){return![``,`.`,`..`].includes(e)&&!e.includes(`/`)&&!e.includes(`\\`)&&!e.includes(`\0`)}function XN(e,t){let n=JN(e.kind,t),r=e.path.split(`/`);return r[r.length-1]=n,r.join(`/`)}function ZN(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=>yn(e)?{...e,docName:r.get(e.docName)??e.docName}:ri(e)||qn(e)?{...e,path:tP(e.path,n)}:e)}function QN(e,t,n){if(t.length===0&&!n)return e;let r=new Set(t);return e.filter(e=>yn(e)?!r.has(e.docName)&&!nP(e.docName,n):ri(e)||qn(e)?!nP(e.path,n):!0)}function $N(e,t){return e?t.find(t=>t.fromDocName===e)?.toDocName??e:null}function eP(e,t){return e.flatMap(e=>t===e.toDocName?[e.fromDocName]:[e.fromDocName,e.toDocName])}function tP(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 nP(e,t){return!!t&&(e===t||e.startsWith(`${t}/`))}function rP(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)(su,{"data-slot":`context-menu`,...n}),t[2]=n,t[3]=r),r}function iP(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=Y(`select-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(cu,{"data-slot":`context-menu-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function aP(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)(hu,{"data-slot":`context-menu-sub`,...n}),t[2]=n,t[3]=r),r}function oP(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=Y(`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`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(lu,{children:(0,Z.jsx)(uu,{"data-slot":`context-menu-content`,className:i,...r})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function sP(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=Y(`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)(du,{"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 cP(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=Y(`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)(T,{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)(gu,{"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 lP(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=Y(`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`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(_u,{"data-slot":`context-menu-sub-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function uP(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=Y(`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)(pu,{children:(0,Z.jsx)(lo,{})})}),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)(fu,{"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 dP(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=Y(`-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)(mu,{"data-slot":`context-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var fP=[`.md`,`.mdx`],pP=`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`,mP=`z-10 rounded-t-lg rounded-b-none border-border border-b-0 bg-background text-foreground`,hP=Y(mP,`bg-transparent hover:bg-muted focus-visible:bg-muted border-transparent hover:border-border focus-visible:border-border`),gP=`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`,_P=`mr-2 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 vP(e){return Y(_P,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 yP(e){return e.replace(/[^A-Za-z0-9_-]/g,`-`)}function bP(e){let t=kr(e);window.location.hash!==t&&(window.location.hash=t)}function xP(e){Math.abs(e.deltaX)>=Math.abs(e.deltaY)||e.currentTarget.scrollWidth<=e.currentTarget.clientWidth||(e.preventDefault(),e.currentTarget.scrollLeft+=e.deltaY)}function SP(e,t){let n=[t,...fP].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 CP(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}=ca(s),m;t[9]===d?m=t[10]:(m=ea.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 wP(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=xt(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?(_=xt(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)(iP,{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)(sP,{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)(sP,{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)(sP,{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)(dP,{}),(0,Z.jsx)(sP,{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)(oP,{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)(rP,{children:[b,A]}),t[45]=A,t[46]=b,t[47]=j):j=t[47],j}function TP(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)(jc,{"aria-hidden":`true`}),t[3]=i):i=t[3];let s;return t[4]!==e||t[5]!==r?(s=(0,Z.jsx)(J,{variant:`ghost`,size:`icon-xs`,type:`button`,"aria-label":e,className:`mr-2 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)(fo,{"aria-hidden":`true`}),t[10]=l):l=t[10];let u;return t[11]!==s||t[12]!==c?(u=(0,Z.jsx)(J,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":s,className:`mr-2`,onClick:c,children:l}),t[11]=s,t[12]=c,t[13]=u):u=t[13],u}function EP(){let e=(0,$.c)(62),{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}=lt(),{pageMeta:S}=Xr(),C=(0,Q.useRef)(null),[w,T]=(0,Q.useState)(null),[E,D]=(0,Q.useState)(``),[O,k]=(0,Q.useState)(null),[A,j]=(0,Q.useState)(!1),M=(0,Q.useRef)(null),N=(0,Q.useRef)(!1),P=(0,Q.useRef)(!1),F=(0,Q.useRef)(null),I=(0,Q.useRef)(t),L;e[0]!==n||e[1]!==t||e[2]!==i?(L=n??(i?Ve(i):t?ft(t):null),e[0]=n,e[1]=t,e[2]=i,e[3]=L):L=e[3];let R=L,z;e[4]!==r||e[5]!==R||e[6]!==f||e[7]!==p||e[8]!==h?(z=f?`${r??`__new-tab__`}\u0000${h.join(`\0`)}\u0000${p.join(`\0`)}`:R?`${R}\u0000${h.join(`\0`)}`:``,e[4]=r,e[5]=R,e[6]=f,e[7]=p,e[8]=h,e[9]=z):z=e[9];let B=z,V,H;e[10]===t?(V=e[11],H=e[12]):(V=()=>{I.current=t},H=[t],e[10]=t,e[11]=V,e[12]=H),(0,Q.useEffect)(V,H);let W,G;e[13]===B?(W=e[14],G=e[15]):(W=()=>{B&&(C.current?.querySelector(`[data-active-tab="true"]`))?.scrollIntoView({block:`nearest`,inline:`nearest`})},G=[B],e[13]=B,e[14]=W,e[15]=G),(0,Q.useEffect)(W,G);let ee,q;e[16]===w?(ee=e[17],q=e[18]):(ee=()=>{w&&(M.current?.focus(),M.current?.select())},q=[w],e[16]=w,e[17]=ee,e[18]=q),(0,Q.useEffect)(ee,q);let te,ne;e[19]!==h||e[20]!==w?(te=()=>{!w||h.includes(w.tabId)||(P.current=!0,F.current=null,T(null),D(``),k(null),j(!1))},ne=[h,w],e[19]=h,e[20]=w,e[21]=te,e[22]=ne):(te=e[21],ne=e[22]),(0,Q.useEffect)(te,ne);let re=function(e,t){let n=t.split(`/`);P.current=!1,F.current=null,T({docName:t,tabId:e}),D(n[n.length-1]),k(null)},ie=function(){P.current=!0,F.current=null,T(null),D(``),k(null),j(!1)},ae=async function(){if(P.current){P.current=!1;return}if(N.current)return;let e=w?.docName;if(!e){ie();return}let t=JN(`file`,SP(E,S.get(e)?.docExt??`.md`)),n=e.split(`/`),r=n[n.length-1];if(t===r){ie();return}if(t===F.current){M.current?.focus();return}if(!YN(t)){k(`Name can’t be empty, ".", "..", or contain / or \\`),M.current?.focus();return}let i=XN({kind:`file`,path:e,name:r},t);N.current=!0,j(!0),k(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(P.current){j(!1),N.current=!1;return}let r=await U(n,`Server error (HTTP ${n.status})`);if(!r.ok){k(r.title),j(!1),N.current=!1,F.current=t,M.current?.focus();return}let a=K(Kn,r.body,`rename-path:tab`,{renamed:[]}).renamed,o=I.current,c=$N(o,a),l=!0;try{let e=eP(a,d());await Promise.all(e.map(e=>s(e))),v(a),Lr([`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`)}P.current=!0,T(null),D(``),k(null),j(!1),N.current=!1,F.current=null,l&&c&&c!==o&&bP(c)}catch(n){console.warn(`[EditorTabs] rename failed`,{err:n,docName:e,newDocName:i,normalized:t}),k(`Network error — please try again`),j(!1),N.current=!1,F.current=t,M.current?.focus()}},oe=typeof window<`u`&&window.okDesktop!=null,se;e[23]===p?se=e[24]:(se=new Set(p),e[23]=p,e[24]=se);let ce=se,le;e[25]!==c||e[26]!==u||e[27]!==ce?(le=function(e){let t=[],n=[];for(let r of e)ce.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]=ce,e[28]=le):le=e[28];let ue=le,de;e[29]===Symbol.for(`react.memo_cache_sentinel`)?(de={activationConstraint:{distance:8}},e[29]=de):de=e[29];let fe;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(fe={coordinateGetter:$a},e[30]=fe):fe=e[30];let pe=$i(ja(Na,de),ja(ta,fe)),me;e[31]!==y||e[32]!==x?(me=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(oa([...x],r,i),t)},e[31]=y,e[32]=x,e[33]=me):me=e[33];let he=me,ge;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(ge=Y(`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]`,oe&&`[-webkit-app-region:drag]`),e[34]=ge):ge=e[34];let _e=xP,ve=Hi,ye=Li,be;e[35]===Symbol.for(`react.memo_cache_sentinel`)?(be={container:typeof document<`u`?document.body:void 0},e[35]=be):be=e[35];let xe=to,Se;e[36]===x?Se=e[37]:(Se=[...x],e[36]=x,e[37]=Se);let Ce=Bi,we=x.map(e=>{if(ce.has(e)){let t=e===r;return(0,Z.jsx)(wP,{tabId:e,canPin:!1,openTabs:x,closeTab:c,closeTabs:ue,pinTab:g,pinnedTabIds:_,unpinTab:b,children:(0,Z.jsxs)(CP,{tabId:e,"aria-current":t?`page`:void 0,"data-active-tab":t?`true`:void 0,className:Y(pP,t?mP:hP,oe&&`[-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:gP,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:vP(t),onClick:t=>{t.stopPropagation(),c(e)},children:(0,Z.jsx)(fo,{"aria-hidden":`true`,className:`size-3.5`})})]})},e)}let t=ot(e),n=e===R,i=_.includes(e);if(t.kind===`folder`){let{baseName:r,label:o,prefix:s}=Ge(t.folderPath,`/`),c=`${s}${o}`;return(0,Z.jsx)(wP,{tabId:e,openTabs:x,closeTab:l,closeTabs:ue,pinTab:g,pinnedTabIds:_,unpinTab:b,children:(0,Z.jsxs)(CP,{tabId:e,"aria-current":n?`page`:void 0,"data-active-tab":n?`true`:void 0,className:Y(pP,n?mP:hP,oe&&`[-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:gP,onClick:()=>{a(e)},children:[s&&(0,Z.jsx)(`span`,{className:Y(`min-w-0 flex-1 truncate`,n&&`text-muted-foreground`),children:s}),(0,Z.jsxs)(`span`,{className:Y(`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)(TP,{accessibleLabel:c,closeTab:l,isPinned:i,tabId:e,unpinTab:b})]})},e)}if(t.kind===`asset`){let{baseName:r,label:o,prefix:s}=Ge(t.assetPath,``),c=`${s}${o}`;return(0,Z.jsx)(wP,{tabId:e,openTabs:x,closeTab:l,closeTabs:ue,pinTab:g,pinnedTabIds:_,unpinTab:b,children:(0,Z.jsxs)(CP,{tabId:e,"aria-current":n?`page`:void 0,"data-active-tab":n?`true`:void 0,className:Y(pP,n?mP:hP,oe&&`[-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:gP,onClick:()=>{a(e)},children:[s?(0,Z.jsx)(`span`,{className:Y(`min-w-0 flex-1 truncate text-muted-foreground/60`,n&&`text-muted-foreground`),children:s}):null,(0,Z.jsx)(`span`,{className:Y(`min-w-0 truncate`,s?`max-w-[70%] shrink-0`:`flex-1`),children:r})]}),(0,Z.jsx)(TP,{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}=Ge(s,u),h=`${m}${p}`,v=u===`.md`||u===`.mdx`,y=w?.tabId===e,C=`editor-tab-rename-error-${yP(s)}`;return(0,Z.jsx)(wP,{disabled:y,tabId:e,openTabs:x,closeTab:l,closeTabs:ue,pinTab:g,pinnedTabIds:_,unpinTab:b,children:(0,Z.jsx)(CP,{tabId:e,disabled:y,"aria-current":n?`page`:void 0,"data-active-tab":n?`true`:void 0,className:Y(pP,n?mP:hP,y&&O&&`border-destructive`,oe&&`[-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)(Rk,{className:`h-full min-w-0 flex-1 rounded-none border-0 bg-transparent dark:bg-transparent`,children:[(0,Z.jsx)(Uk,{ref:M,value:E,disabled:A,"aria-label":`Rename ${p}`,"aria-invalid":O?!0:void 0,"aria-describedby":O?C:void 0,"aria-busy":A||void 0,title:O??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=>{D(SP(e.target.value,u)),k(null),F.current=null},onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),ae()):e.key===`Escape`&&(e.preventDefault(),ie())},onBlur:ae}),(0,Z.jsx)(Bk,{align:`inline-end`,"aria-hidden":`true`,className:`pr-2 text-xs`,children:(0,Z.jsx)(Hk,{className:`text-muted-foreground/60 text-xs`,children:u})})]}),O?(0,Z.jsx)(`span`,{id:C,role:`alert`,className:`sr-only`,children:O}):null]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`button`,{type:`button`,"aria-label":h,title:h,className:gP,onClick:()=>{a(e)},onDoubleClick:t=>{t.preventDefault(),t.stopPropagation(),re(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)(TP,{accessibleLabel:h,closeTab:l,isPinned:i,tabId:e,unpinTab:b})]})})},e)}),Te;e[38]!==xe||e[39]!==Se||e[40]!==Ce||e[41]!==we?(Te=(0,Z.jsx)(xe,{items:Se,strategy:Ce,children:we}),e[38]=xe,e[39]=Se,e[40]=Ce,e[41]=we,e[42]=Te):Te=e[42];let Ee;e[43]!==ve||e[44]!==he||e[45]!==pe||e[46]!==ye||e[47]!==be||e[48]!==Te?(Ee=(0,Z.jsx)(ve,{sensors:pe,collisionDetection:ye,onDragEnd:he,accessibility:be,children:Te}),e[43]=ve,e[44]=he,e[45]=pe,e[46]=ye,e[47]=be,e[48]=Te,e[49]=Ee):Ee=e[49];let De;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(De=Y(`first:mb-3 mb-1.5`,oe&&`[-webkit-app-region:no-drag]`),e[50]=De):De=e[50];let Oe;e[51]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,Z.jsx)(Ui,{"aria-hidden":`true`}),e[51]=Oe):Oe=e[51];let ke;e[52]===m?ke=e[53]:(ke=(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsx)(J,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":`New tab`,className:De,onClick:m,children:Oe})}),e[52]=m,e[53]=ke);let Ae;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,Z.jsx)(zo,{children:`New tab`}),e[54]=Ae):Ae=e[54];let je;e[55]===ke?je=e[56]:(je=(0,Z.jsxs)(Vo,{children:[ke,Ae]}),e[55]=ke,e[56]=je);let Me;return e[57]!==ge||e[58]!==_e||e[59]!==Ee||e[60]!==je?(Me=(0,Z.jsxs)(`div`,{ref:C,className:ge,onWheel:_e,children:[Ee,je]}),e[57]=ge,e[58]=_e,e[59]=Ee,e[60]=je,e[61]=Me):Me=e[61],Me}function DP(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 OP(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 kP=[{label:`Documentation`,href:`https://openknowledge.ai/docs`,icon:N},{label:`GitHub`,href:`https://github.com/inkeep/open-knowledge`,icon:Td},{label:`Website`,href:`https://openknowledge.ai/`,icon:oo},{label:`Discord`,href:`https://go.inkeep.com/ok-discord`,icon:DP},{label:`Twitter`,href:`https://x.com/inkeep`,icon:OP}],AP=()=>{let e=(0,$.c)(5),[t,n]=(0,Q.useState)(!1),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsxs)(Vo,{children:[(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsx)(M,{asChild:!0,children:(0,Z.jsxs)(J,{variant:`ghost`,size:`icon`,className:`size-7 hover:bg-accent text-muted-foreground`,children:[(0,Z.jsx)(O,{className:`size-4`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Resources`})]})})}),(0,Z.jsx)(zo,{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)(C,{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:kP.map(jP)})})]}),e[2]=a):a=e[2];let o;return e[3]===t?o=e[4]:(o=(0,Z.jsxs)(re,{open:t,onOpenChange:n,children:[r,a]}),e[3]=t,e[4]=o),o};function jP(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=>la(e,n),onAuxClick:e=>la(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 MP(e){let t=(0,$.c)(60),{input:n}=e,{states:r,refresh:i}=jh(),{dispatch:a}=bh(),[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?Dr(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=wm.filter(e);v=r[`claude-code`]?.installed===!0;let a;t[28]!==n||t[29]!==p?(a=()=>{n!==null&&Hx(p)},t[28]=n,t[29]=p,t[30]=a):a=t[30],y=a,_=ra,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)(Ro,{asChild:!0,children:(0,Z.jsx)(qi,{asChild:!0,children:(0,Z.jsx)(J,{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)(zo,{children:`Open with AI`}),t[34]=f):f=t[34],t[35]===l?x=t[36]:(x=(0,Z.jsxs)(Vo,{children:[l,f]}),t[35]=l,t[36]=x),g=Yi,S=`end`,C=`min-w-[220px]`,w=`open-in-agent-menu`,t[37]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsx)(aa,{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)(Ux,{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)(Qi,{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)(Rt,{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 NP=`/api/share/publish/owners`,PP=`/api/share/publish/name-check`,FP=`/api/share/publish`,IP=/[A-Za-z0-9._-]/g;function LP(e){return(e.match(IP)?.join(``)??``).replace(/[-.]{2,}/g,e=>e[0]??`-`).replace(/^[-.]+/,``).replace(/[-.]+$/,``)}function RP(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 zP(e){return`https://github.com/orgs/${encodeURIComponent(e)}/policies/applications`}function BP(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:zP(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 VP(e=fetch){let t=await e(NP,{method:`GET`});if(!t.ok)throw Error(`owners transport ${t.status}`);let n=await t.json(),r=Dn.safeParse(n);if(!r.success)throw Error(`owners response shape mismatch`);return r.data}async function HP(e,t,n=fetch){let r=await n(`${PP}?owner=${encodeURIComponent(e)}&name=${encodeURIComponent(t)}`,{method:`GET`});if(!r.ok)throw Error(`name-check transport ${r.status}`);let i=await r.json(),a=nr.safeParse(i);if(!a.success)throw Error(`name-check response shape mismatch`);return a.data}async function UP(e,t=fetch){let n=await t(FP,{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=Nn.safeParse(r);if(!i.success)throw Error(`publish response shape mismatch`);return i.data}function WP(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 GP(e){return e.submitting||e.owner===null||e.sanitizedName.length===0?!1:e.nameCheck.kind===`available`}async function KP(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 qP=`/api/share/construct-url`,JP=`Could not construct share URL.`,YP=`Link ready but could not copy to clipboard.`;async function XP(e,t=fetch){let n=await t(qP,{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=Zn.safeParse(r);if(!i.success)throw Error(`construct-url response shape mismatch`);return i.data}function ZP(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 QP(e,t){if(!e.hasRemote)return e.onClickWhenNoRemote(),{kind:`opened-wizard`};let n=xr(e.docName),r;try{r=await XP(n,t.fetchFn)}catch{return t.toastError(JP),{kind:`transport-error`}}if(r.ok){try{await t.clipboardWrite(r.shareUrl)}catch{return t.toastError(YP),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(ZP(r.error,i)),{kind:`business-error`,error:r.error,branch:i}}var $P=500;function eF(e){let t=(0,$.c)(94),{open:n,onOpenChange:r}=e,i=Mm(),{activeDocName:a}=lt(),[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,b]=(0,Q.useState)(``),S;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(S={kind:`idle`},t[0]=S):S=t[0];let[C,w]=(0,Q.useState)(S),[T,E]=(0,Q.useState)(!1),[D,O]=(0,Q.useState)(null),[k,j]=(0,Q.useState)(!1),M=(0,Q.useRef)(null),N=(0,Q.useRef)(null),P=(0,Q.useRef)(null),F;t[1]===m?F=t[2]:(F=LP(m),t[1]=m,t[2]=F);let I=F,L=o?.find(e=>e.login===f)??null,R;t[3]===f?R=t[4]:(R=async function(){l(!0),d(null);try{let e=await VP();if(!e.ok){e.error===`auth-required`?(j(!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]=R);let z=R,B;t[5]!==z||t[6]!==n||t[7]!==o||t[8]!==f||t[9]!==i?.contentDir?(B=()=>{n&&(w({kind:`idle`}),O(null),E(!1),d(null),h(LP(RP(i?.contentDir??``))),_(`private`),b(``),o===null?z():f===``&&o.length>0&&p(o[0]?.login??``))},t[5]=z,t[6]=n,t[7]=o,t[8]=f,t[9]=i?.contentDir,t[10]=B):B=t[10];let H;t[11]===n?H=t[12]:(H=[n],t[11]=n,t[12]=H),(0,Q.useEffect)(B,H);let U,G;t[13]!==n||t[14]!==I||t[15]!==f?(U=()=>{if(n){if(M.current!==null&&clearTimeout(M.current),f===``||I===``){w({kind:`idle`});return}return w({kind:`pending`}),M.current=setTimeout(async()=>{let e=f,t=I;N.current=`${e}|${t}`,w({kind:`checking`});try{let n=await HP(e,t);if(N.current!==`${e}|${t}`)return;w(WP(n,e,t))}catch{if(N.current!==`${e}|${t}`)return;w({kind:`error`,banner:`Couldn't reach GitHub. Try again?`})}},$P),()=>{M.current!==null&&(clearTimeout(M.current),M.current=null)}}},G=[n,f,I],t[13]=n,t[14]=I,t[15]=f,t[16]=U,t[17]=G):(U=t[16],G=t[17]),(0,Q.useEffect)(U,G);let K;t[18]===z?K=t[19]:(K=function(){j(!1),d(null),z()},t[18]=z,t[19]=K);let ee=K,q=async function(){if(GP({owner:L,sanitizedName:I,nameCheck:C,submitting:T})){E(!0),O(null);try{let e=await UP({owner:f,name:I,visibility:g,description:v.trim().length>0?v.trim():void 0});if(e.ok){r(!1),a?await KP(a,{runShareAction:QP,clipboardWrite:aF,toastSuccess:iF,toastError:rF,logEvent:nF}):X.success(`Published to ${e.ownerLogin}/${e.repoName}.`),E(!1);return}let t=BP(e.error,f,I);O({message:t.banner,next:t.next}),t.next.kind===`edit-name`?(P.current?.focus(),P.current?.select()):t.next.kind===`reauth`&&j(!0)}catch{O({message:`Couldn't reach GitHub. Try again?`,next:{kind:`edit-form`}})}E(!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,ae=!GP({owner:L,sanitizedName:I,nameCheck:C,submitting:T}),oe;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,Z.jsxs)(wo,{children:[(0,Z.jsx)(ho,{children:`Publish to GitHub`}),(0,Z.jsx)(po,{children:`Sharing a doc needs a GitHub repository. Create one for this project.`})]}),t[23]=oe):oe=t[23];let se;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(se=(0,Z.jsx)(Lo,{htmlFor:`publish-owner`,children:`Owner`}),t[24]=se):se=t[24];let ce;t[25]!==z||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:[se,c&&o===null?(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,Z.jsx)(y,{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)(J,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>z(),children:`Retry`})]}):(0,Z.jsxs)(V,{value:f,onValueChange:p,children:[(0,Z.jsx)(x,{id:`publish-owner`,"data-testid":`publish-owner-trigger`,"aria-label":`Owner`,children:(0,Z.jsx)(A,{placeholder:`Pick an owner`})}),(0,Z.jsx)(W,{children:(o??[]).map(tF)})]})]}),t[25]=z,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)(Lo,{htmlFor:`publish-name`,children:`Repository name`}),t[31]=le):le=t[31];let ue,de;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(ue=e=>h(e.target.value),de=()=>{N.current=null},t[32]=ue,t[33]=de):(ue=t[32],de=t[33]);let fe;t[34]===m?fe=t[35]:(fe=(0,Z.jsx)(Ho,{id:`publish-name`,ref:P,"data-testid":`publish-name`,value:m,onChange:ue,onBlur:de,placeholder:`my-knowledge-base`,autoComplete:`off`,spellCheck:!1}),t[34]=m,t[35]=fe);let pe;t[36]===I?pe=t[37]:(pe=I?(0,Z.jsxs)(Z.Fragment,{children:[`Will be created as `,(0,Z.jsx)(`code`,{className:`font-mono`,children:I})]}):`Pick a name`,t[36]=I,t[37]=pe);let me;t[38]===pe?me=t[39]:(me=(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:pe}),t[38]=pe,t[39]=me);let he;t[40]===C?he=t[41]:(he=(0,Z.jsx)(sF,{status:C}),t[40]=C,t[41]=he);let ge;t[42]!==me||t[43]!==he?(ge=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-3 text-xs`,"aria-live":`polite`,children:[me,he]}),t[42]=me,t[43]=he,t[44]=ge):ge=t[44];let _e;t[45]!==fe||t[46]!==ge?(_e=(0,Z.jsxs)(`fieldset`,{className:`flex flex-col gap-1.5`,children:[le,fe,ge]}),t[45]=fe,t[46]=ge,t[47]=_e):_e=t[47];let ve;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,Z.jsx)(Lo,{children:`Visibility`}),t[48]=ve):ve=t[48];let ye;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(ye=e=>_(e===`public`?`public`:`private`),t[49]=ye):ye=t[49];let be;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,Z.jsx)(gm,{value:`private`,id:`publish-visibility-private`,"data-testid":`publish-visibility-private`}),t[50]=be):be=t[50];let xe;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,Z.jsxs)(Lo,{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:[be,(0,Z.jsxs)(`span`,{children:[`Private`,(0,Z.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:`Only collaborators`})]})]}),t[51]=xe):xe=t[51];let Se;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,Z.jsx)(gm,{value:`public`,id:`publish-visibility-public`,"data-testid":`publish-visibility-public`}),t[52]=Se):Se=t[52];let Ce;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,Z.jsxs)(Lo,{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:[Se,(0,Z.jsxs)(`span`,{children:[`Public`,(0,Z.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:`Anyone can see`})]})]}),t[53]=Ce):Ce=t[53];let we;t[54]===g?we=t[55]:(we=(0,Z.jsxs)(`fieldset`,{className:`flex flex-col gap-1.5`,children:[ve,(0,Z.jsxs)(hm,{value:g,onValueChange:ye,className:`grid-cols-2`,"aria-label":`Visibility`,children:[xe,Ce]})]}),t[54]=g,t[55]=we);let Te;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,Z.jsx)(Lo,{htmlFor:`publish-description`,children:`Description (optional)`}),t[56]=Te):Te=t[56];let Ee;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=e=>b(e.target.value),t[57]=Ee):Ee=t[57];let De;t[58]===v?De=t[59]:(De=(0,Z.jsxs)(`fieldset`,{className:`flex flex-col gap-1.5`,children:[Te,(0,Z.jsx)(gs,{id:`publish-description`,"data-testid":`publish-description`,rows:2,value:v,onChange:Ee,placeholder:`What is this knowledge base for?`})]}),t[58]=v,t[59]=De);let Oe;t[60]!==D||t[61]!==ne||t[62]!==q?(Oe=D&&(0,Z.jsx)(oF,{banner:D,onAuthorize:ne,onRetryPush:q}),t[60]=D,t[61]=ne,t[62]=q,t[63]=Oe):Oe=t[63];let ke;t[64]!==ce||t[65]!==_e||t[66]!==we||t[67]!==De||t[68]!==Oe?(ke=(0,Z.jsxs)(xo,{className:`flex flex-col gap-4`,children:[ce,_e,we,De,Oe]}),t[64]=ce,t[65]=_e,t[66]=we,t[67]=De,t[68]=Oe,t[69]=ke):ke=t[69];let Ae;t[70]===ie?Ae=t[71]:(Ae=(0,Z.jsx)(J,{type:`button`,variant:`ghost`,onClick:ie,children:`Cancel`}),t[70]=ie,t[71]=Ae);let je;t[72]===T?je=t[73]:(je=T?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(y,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),` Publishing...`]}):`Publish & copy link`,t[72]=T,t[73]=je);let Me;t[74]!==q||t[75]!==ae||t[76]!==je?(Me=(0,Z.jsx)(J,{type:`button`,onClick:q,disabled:ae,"data-testid":`publish-submit`,children:je}),t[74]=q,t[75]=ae,t[76]=je,t[77]=Me):Me=t[77];let Ne;t[78]!==Ae||t[79]!==Me?(Ne=(0,Z.jsxs)(So,{children:[Ae,Me]}),t[78]=Ae,t[79]=Me,t[80]=Ne):Ne=t[80];let Pe;t[81]!==ke||t[82]!==Ne?(Pe=(0,Z.jsxs)(vo,{className:`sm:max-w-lg`,showCloseButton:!1,children:[oe,ke,Ne]}),t[81]=ke,t[82]=Ne,t[83]=Pe):Pe=t[83];let Fe;t[84]!==r||t[85]!==n||t[86]!==Pe?(Fe=(0,Z.jsx)(To,{open:n,onOpenChange:r,children:Pe}),t[84]=r,t[85]=n,t[86]=Pe,t[87]=Fe):Fe=t[87];let Ie;t[88]!==k||t[89]!==ee?(Ie=(0,Z.jsx)(Qu,{open:k,onOpenChange:j,onSuccess:ee}),t[88]=k,t[89]=ee,t[90]=Ie):Ie=t[90];let Le;return t[91]!==Fe||t[92]!==Ie?(Le=(0,Z.jsxs)(Z.Fragment,{children:[Fe,Ie]}),t[91]=Fe,t[92]=Ie,t[93]=Le):Le=t[93],Le}function tF(e){return(0,Z.jsx)(te,{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 nF(e){return console.log(e)}function rF(e){return X.error(e)}function iF(e){return X.success(e)}function aF(e){return navigator.clipboard.writeText(e)}function oF(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)(J,{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)(Rt,{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)(J,{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 sF(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)(Ar,{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)(ve,{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)(y,{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 cF=()=>{let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsxs)(Vo,{children:[(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsxs)(J,{variant:`ghost`,size:`icon`,className:`size-7 hover:bg-accent text-muted-foreground`,"data-testid":`header-settings-button`,onClick:lF,children:[(0,Z.jsx)(zc,{className:`size-4`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Settings`})]})}),(0,Z.jsx)(zo,{children:`Settings`})]}),e[0]=t):t=e[0],t};function lF(){window.location.hash!==`#settings`&&(window.location.hash=Tm)}function uF(e){let t=(0,$.c)(12),{onClickWhenNoRemote:n}=e,{activeDocName:r}=lt(),{status:i}=Ii(),[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 QP({docName:r,hasRemote:s,onClickWhenNoRemote:n},{clipboardWrite:mF,toastSuccess:pF,toastError:fF,logEvent:dF})}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)(Bc,{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)(Ro,{asChild:!0,children:(0,Z.jsxs)(J,{variant:`ghost`,size:`sm`,"aria-label":`Share doc`,onClick:l,disabled:a,className:`gap-1.5 text-muted-foreground`,"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)(zo,{children:`Share`}),t[9]=f):f=t[9];let p;return t[10]===d?p=t[11]:(p=(0,Z.jsxs)(Vo,{children:[d,f]}),t[10]=d,t[11]=p),p}function dF(e){return console.log(e)}function fF(e){return X.error(e)}function pF(e){return X.success(e)}function mF(e){return navigator.clipboard.writeText(e)}function hF(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 gF(e){await fetch(`/api/sync/trigger`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({op:e})})}function _F(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)(Gs,{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)(Pc,{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)(Gs,{className:`size-3.5 text-emerald-500`}),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)(Pc,{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)(Jr,{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)(Ws,{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)(xc,{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)(Jr,{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)(Gs,{className:`size-3.5 text-muted-foreground`}),t[8]=e):e=t[8],e}}}function vF(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 yF(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 bF(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 xF(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`}`:yF(e.state):`Sync off`}function SF(e){let t=(0,$.c)(76),{status:n,onSignIn:r,onOpenConflictResolver:i,onSetIdentity:a}=e,{projectLocalConfig:o,projectLocalSynced:s}=ha(),c=o?.autoSync?.enabled??!1,{confirmOpen:l,setConfirmOpen:u,onToggleRequest:d,onConfirm:f}=Zi(Ua()),p;t[0]===n?p=t[1]:(p=(0,Z.jsx)(_F,{status:n}),t[0]=n,t[1]=p);let m;t[2]===n.state?m=t[3]:(m=yF(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)(et,{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 b;t[14]!==g||t[15]!==y?(b=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[g,y]}),t[14]=g,t[15]=y,t[16]=b):b=t[16];let x;t[17]!==l||t[18]!==f||t[19]!==u?(x=(0,Z.jsx)(Ia,{open:l,onOpenChange:u,onConfirm:f}),t[17]=l,t[18]=f,t[19]=u,t[20]=x):x=t[20];let S;t[21]===n.error?S=t[22]:(S=n.error&&(0,Z.jsx)(`p`,{className:`text-xs text-destructive`,children:n.error}),t[21]=n.error,t[22]=S);let C;t[23]===n.pausedReason?C=t[24]:(C=n.pausedReason&&(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:bF(n.pausedReason)}),t[23]=n.pausedReason,t[24]=C);let w;t[25]===n.state?w=t[26]:(w=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]=w);let T;t[27]!==c||t[28]!==n.lastSyncUtc||t[29]!==n.state?(T=c&&n.state!==`dormant`&&(0,Z.jsxs)(`div`,{children:[`Last synced: `,hF(n.lastSyncUtc)]}),t[27]=c,t[28]=n.lastSyncUtc,t[29]=n.state,t[30]=T):T=t[30];let E;t[31]===n.ahead?E=t[32]:(E=n.ahead>0&&(0,Z.jsxs)(`div`,{children:[n.ahead,` commit`,n.ahead===1?``:`s`,` ahead`]}),t[31]=n.ahead,t[32]=E);let D;t[33]===n.behind?D=t[34]:(D=n.behind>0&&(0,Z.jsxs)(`div`,{children:[n.behind,` commit`,n.behind===1?``:`s`,` behind`]}),t[33]=n.behind,t[34]=D);let O;t[35]===n.conflictCount?O=t[36]:(O=n.conflictCount>0&&(0,Z.jsxs)(`div`,{children:[n.conflictCount,` file`,n.conflictCount===1?``:`s`,` conflicted`]}),t[35]=n.conflictCount,t[36]=O);let k;t[37]===c?k=t[38]:(k=!c&&(0,Z.jsx)(`div`,{children:`Sync is off — your edits will not sync to the remote repository.`}),t[37]=c,t[38]=k);let A;t[39]!==T||t[40]!==E||t[41]!==D||t[42]!==O||t[43]!==k?(A=(0,Z.jsxs)(`div`,{className:`text-xs text-muted-foreground space-y-0.5`,children:[T,E,D,O,k]}),t[39]=T,t[40]=E,t[41]=D,t[42]=O,t[43]=k,t[44]=A):A=t[44];let j;t[45]!==a||t[46]!==n.identityUnresolved?(j=n.identityUnresolved&&a&&(0,Z.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed p-2`,children:[(0,Z.jsx)(nl,{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)(J,{variant:`outline`,size:`xs`,className:`self-start`,onClick:a,children:`Set identity`})]})]}),t[45]=a,t[46]=n.identityUnresolved,t[47]=j):j=t[47];let M;t[48]!==c||t[49]!==n.state?(M=c&&n.state!==`dormant`&&n.state!==`disabled`&&n.state!==`auth-error`&&n.state!==`conflict`&&(0,Z.jsx)(J,{variant:`outline`,size:`xs`,onClick:wF,children:`Sync now`}),t[48]=c,t[49]=n.state,t[50]=M):M=t[50];let N;t[51]!==c||t[52]!==r||t[53]!==n.state?(N=c&&n.state===`auth-error`&&(0,Z.jsx)(J,{variant:`outline`,size:`xs`,onClick:r,children:`Sign in`}),t[51]=c,t[52]=r,t[53]=n.state,t[54]=N):N=t[54];let P;t[55]!==c||t[56]!==n.state?(P=c&&n.state===`offline`&&(0,Z.jsx)(J,{variant:`outline`,size:`xs`,onClick:CF,children:`Retry`}),t[55]=c,t[56]=n.state,t[57]=P):P=t[57];let F;t[58]!==c||t[59]!==i||t[60]!==n.state?(F=c&&n.state===`conflict`&&i&&(0,Z.jsx)(J,{variant:`outline`,size:`xs`,onClick:i,children:`Review conflicts`}),t[58]=c,t[59]=i,t[60]=n.state,t[61]=F):F=t[61];let I;t[62]!==M||t[63]!==N||t[64]!==P||t[65]!==F?(I=(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-1 pt-1`,children:[M,N,P,F]}),t[62]=M,t[63]=N,t[64]=P,t[65]=F,t[66]=I):I=t[66];let L;return t[67]!==S||t[68]!==C||t[69]!==w||t[70]!==A||t[71]!==j||t[72]!==I||t[73]!==b||t[74]!==x?(L=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[b,x,S,C,w,A,j,I]}),t[67]=S,t[68]=C,t[69]=w,t[70]=A,t[71]=j,t[72]=I,t[73]=b,t[74]=x,t[75]=L):L=t[75],L}function CF(){gF(`sync`)}function wF(){gF(`sync`)}function TF(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}=Ii();if(!o){if(s){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsx)(J,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground`,"aria-label":`Sync status unavailable`,disabled:!0,children:(0,Z.jsx)(Ws,{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)(Vo,{children:[e,(0,Z.jsx)(zo,{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=vF(o),t[5]=o,t[6]=c);let l=c,u=!!o.identityUnresolved,d;t[7]===o.state?d=t[8]:(d=yF(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)(_F,{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)(Ro,{asChild:!0,children:(0,Z.jsx)(M,{asChild:!0,children:(0,Z.jsxs)(J,{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]:(_=xF(o),t[21]=o,t[22]=_);let v;t[23]===_?v=t[24]:(v=(0,Z.jsx)(zo,{children:_}),t[23]=_,t[24]=v);let y;t[25]!==v||t[26]!==g?(y=(0,Z.jsxs)(Vo,{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)(C,{align:`end`,className:`w-64 p-3`,children:(0,Z.jsx)(SF,{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)(re,{children:[y,b]}),t[33]=y,t[34]=b,t[35]=x):x=t[35],x}var EF=[{value:`light`,label:`Light`,icon:Yc},{value:`dark`,label:`Dark`,icon:Sc},{value:`system`,label:`System`,icon:Xs}],DF=()=>{let e=(0,$.c)(16),{theme:t}=Hr(),{merged:n,userBinding:r}=ha(),i=n?.appearance?.theme??t??`system`,a;e[0]===r?a=e[1]:(a=e=>{if(e!==`light`&&e!==`dark`&&e!==`system`||!r)return;let t=r.patch({appearance:{theme:e}});t.ok||X.error(Hn(t.error))},e[0]=r,e[1]=a);let o=a,s=i===`system`?Xs:i===`dark`?Sc:Yc,c;e[2]===s?c=e[3]:(c=(0,Z.jsx)(s,{}),e[2]=s,e[3]=c);let l;e[4]===i?l=e[5]:(l=(0,Z.jsxs)(`span`,{className:`sr-only`,children:[`Toggle theme (current: `,i,`)`]}),e[4]=i,e[5]=l);let u;e[6]!==c||e[7]!==l?(u=(0,Z.jsx)(qi,{asChild:!0,children:(0,Z.jsxs)(J,{variant:`ghost`,size:`icon`,className:`size-7 hover:bg-accent text-muted-foreground`,children:[c,l]})}),e[6]=c,e[7]=l,e[8]=u):u=e[8];let d;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=EF.map(OF),e[9]=d):d=e[9];let f;e[10]!==i||e[11]!==o?(f=(0,Z.jsx)(Yi,{align:`end`,children:(0,Z.jsx)(ao,{value:i,onValueChange:o,children:d})}),e[10]=i,e[11]=o,e[12]=f):f=e[12];let p;return e[13]!==u||e[14]!==f?(p=(0,Z.jsxs)(ra,{children:[u,f]}),e[13]=u,e[14]=f,e[15]=p):p=e[15],p};function OF(e){let{value:t,label:n,icon:r}=e;return(0,Z.jsxs)(zi,{value:t,className:`capitalize`,children:[(0,Z.jsx)(r,{className:`text-muted-foreground`}),n]},t)}function kF(e){let t=(0,$.c)(46),{onSaveVersion:n,saving:r,onSignIn:i,onSetIdentity:a,onOpenConflictResolver:o}=e,{activeDocName:s,activeTarget:c}=lt(),{state:l}=fN(),u=Mm(),[d,f]=(0,Q.useState)(!1),p;bb0:{if(c===null){let e;t[0]===u?e=t[1]:(e=ch({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=lh({folderAbsPath:ah(u.contentDir,c.folderPath,u.pathSeparator),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=sh({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]:(_=Y(`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)(Ro,{asChild:!0,children:(0,Z.jsx)(_N,{className:Y(`-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)(Vo,{children:[v,(0,Z.jsx)(zo,{children:y})]}),t[11]=y,t[12]=b);let x,S;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(ya,{orientation:`vertical`,className:`mr-1 h-4 shrink-0 data-vertical:self-center`}),S=(0,Z.jsx)(EP,{}),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=Y(`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)(Vo,{children:[(0,Z.jsx)(Ro,{asChild:!0,children:(0,Z.jsx)(J,{variant:`ghost`,size:`icon-sm`,"aria-label":`Checkpoint version`,onClick:n,disabled:r,className:`text-muted-foreground`,children:(0,Z.jsx)(Rc,{className:`size-3.5`})})}),(0,Z.jsx)(zo,{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)(MP,{input:m}),t[22]=m,t[23]=E);let D;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(uF,{onClickWhenNoRemote:()=>f(!0)}),t[24]=D):D=t[24];let O;t[25]===d?O=t[26]:(O=(0,Z.jsx)(eF,{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)(TF,{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,F;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsx)(qN,{}),j=(0,Z.jsx)(ya,{orientation:`vertical`,className:`h-4 shrink-0 data-vertical:self-center`}),M=(0,Z.jsx)(ed,{}),N=(0,Z.jsx)(cF,{}),P=(0,Z.jsx)(AP,{}),F=(0,Z.jsx)(DF,{}),t[31]=A,t[32]=j,t[33]=M,t[34]=N,t[35]=P,t[36]=F):(A=t[31],j=t[32],M=t[33],N=t[34],P=t[35],F=t[36]);let I;t[37]!==T||t[38]!==E||t[39]!==O||t[40]!==k?(I=(0,Z.jsxs)(`div`,{className:w,children:[T,E,D,O,k,A,j,M,N,P,F]}),t[37]=T,t[38]=E,t[39]=O,t[40]=k,t[41]=I):I=t[41];let L;return t[42]!==I||t[43]!==_||t[44]!==C?(L=(0,Z.jsxs)(`header`,{className:_,children:[C,I]}),t[42]=I,t[43]=_,t[44]=C,t[45]=L):L=t[45],L}function AF(){let e=(0,$.c)(32),[t,n]=sg(),[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)(My[0].id),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(!1),_=ia(),{projectLocalConfig:v,projectLocalSynced:y}=ha(),{activeDocName:b}=lt(),x=!h&&_?.hasRemote===!0&&y===!0&&v!==null&&v.autoSync?.enabled===null,S,C;e[0]===b?(S=e[1],C=e[2]):(S=()=>{let e=function(e){let t=e.detail;t&&b&&ps(b,{kind:`raw-mdx`,detail:t}),i(`source`)};return window.addEventListener($h,e),()=>window.removeEventListener($h,e)},C=[b],e[0]=b,e[1]=S,e[2]=C),(0,Q.useEffect)(S,C);let w;e[3]===n?w=e[4]:(w=function(e){i(e),n(e)},e[3]=n,e[4]=w);let T=w,E;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(E=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]=E):E=e[5];let D=E,O;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsx)(ug,{onOpenResolver:()=>o(!0)}),e[6]=O):O=e[6];let k,A,j;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>{u(`auth`),c(!0)},A=()=>{u(`identity`),c(!0)},j=()=>o(!0),e[7]=k,e[8]=A,e[9]=j):(k=e[7],A=e[8],j=e[9]);let M;e[10]===p?M=e[11]:(M=(0,Z.jsx)(kF,{onSaveVersion:D,saving:p,onSignIn:k,onSetIdentity:A,onOpenConflictResolver:j}),e[10]=p,e[11]=M);let N;e[12]!==d||e[13]!==r||e[14]!==T?(N=(0,Z.jsx)(HM,{editorMode:r,onModeChange:T,activeTab:d,onActiveTabChange:f}),e[12]=d,e[13]=r,e[14]=T,e[15]=N):N=e[15];let P;e[16]===a?P=e[17]:(P=(0,Z.jsx)(fv,{open:a,onOpenChange:o}),e[16]=a,e[17]=P);let F=l===`identity`,I;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>{c(!1)},e[18]=I):I=e[18];let L;e[19]!==s||e[20]!==F?(L=(0,Z.jsx)(Qu,{open:s,onOpenChange:c,identityPrompt:F,onSuccess:I}),e[19]=s,e[20]=F,e[21]=L):L=e[21];let R;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>g(!0),e[22]=R):R=e[22];let z;e[23]===x?z=e[24]:(z=(0,Z.jsx)(cg,{open:x,onResolved:R}),e[23]=x,e[24]=z);let B;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Z.jsx)(Xh,{}),e[25]=B):B=e[25];let V;return e[26]!==P||e[27]!==L||e[28]!==z||e[29]!==M||e[30]!==N?(V=(0,Z.jsxs)(Z.Fragment,{children:[O,M,N,P,L,z,B]}),e[26]=P,e[27]=L,e[28]=z,e[29]=M,e[30]=N,e[31]=V):V=e[31],V}var jF=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
36
+ <symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
37
+ <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"/>
38
+ </symbol>
39
+ <symbol id="file-tree-icon-dot" viewBox="0 0 6 6">
40
+ <circle cx="3" cy="3" r="3" />
41
+ </symbol>
42
+ <symbol id="file-tree-icon-file" viewBox="0 0 16 16">
43
+ <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"/>
44
+ <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"/>
45
+ </symbol>
46
+ <symbol id="file-tree-icon-lock" viewBox="0 0 16 16">
47
+ <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" />
48
+ </symbol>
49
+ <symbol id="file-tree-icon-ellipsis" viewBox="0 0 16 16">
50
+ <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" />
51
+ </symbol>
52
+ </svg>`,MF=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
53
+ <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"/>
54
+ <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"/>
55
+ </symbol>`,NF=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
56
+ <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"/>
57
+ </symbol>`,PF=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
58
+ <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"/>
59
+ <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"/>
60
+ </symbol>`,FF=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
61
+ <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"/>
62
+ </symbol>`,IF=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
63
+ <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"/>
64
+ <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"/>
65
+ </symbol>`,LF=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
66
+ <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"/>
67
+ <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"/>
68
+ <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"/>
69
+ </symbol>`,RF=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
70
+ <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"/>
71
+ </symbol>`,zF=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
72
+ <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"/>
73
+ </symbol>`,BF=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
74
+ <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"/>
75
+ <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"/>
76
+ </symbol>`,VF=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
77
+ <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"/>
78
+ <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"/>
79
+ <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"/>
80
+ </symbol>`,HF=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
81
+ <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"/>
82
+ <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"/>
83
+ </symbol>`,UF=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
84
+ <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"/>
85
+ <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"/>
86
+ </symbol>`,WF=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
87
+ <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"/>
88
+ <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"/>
89
+ </symbol>`,GF=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
90
+ <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"/>
91
+ </symbol>`,KF=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
92
+ <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"/>
93
+ </symbol>`,qF=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
94
+ <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"/>
95
+ </symbol>`,JF=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
96
+ <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"/>
97
+ </symbol>`,YF=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
98
+ <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"/>
99
+ <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"/>
100
+ </symbol>`,XF=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
101
+ <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"/>
102
+ <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"/>
103
+ </symbol>`,ZF=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
104
+ <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"/>
105
+ <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"/>
106
+ </symbol>`,QF=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
107
+ <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"/>
108
+ </symbol>`,$F=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
109
+ <path fill="currentColor" d="M1 12V4h2l2 2.5L7 4h2v8H7V7.5l-2 2-2-2V12zm9-3 3 3.5L16 9h-2V4h-2v5z"/>
110
+ </symbol>`,eI=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
111
+ <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"/>
112
+ <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"/>
113
+ </symbol>`,tI=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
114
+ <defs>
115
+ <linearGradient id="a" x1="4.522" x2="14" y1="3.943" y2="16" gradientUnits="userSpaceOnUse">
116
+ <stop stop-color="currentColor"/>
117
+ <stop offset="1" stop-color="currentColor" stop-opacity="0"/>
118
+ </linearGradient>
119
+ </defs>
120
+ <path fill="currentColor" d="M3 2h1.522v9.09H3z"/>
121
+ <path fill="url(#a)" d="M4.903 2 15 15.075q-.565.5-1.195.925L4.522 3.943z"/>
122
+ <path fill="currentColor" d="M12.172 2h-1.508v9.094h1.508z"/>
123
+ </symbol>`,nI=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
124
+ <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"/>
125
+ <path fill="currentColor" d="M10.5 13H13V3H3v10h5V5.5h2.5z"/>
126
+ </symbol>`,rI=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
127
+ <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"/>
128
+ </symbol>`,iI=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
129
+ <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"/>
130
+ </symbol>`,aI=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
131
+ <path fill="currentColor" d="M6 12v1H4.93v-1zm1-2v1H2v-1zm6-4v1h-3V6zm-1-4v1H9V2z"/>
132
+ <path fill="currentColor" d="M11.5 10v1H8v-1zM5 6v1H2V6zm5-2v1H9V4z" opacity=".8"/>
133
+ <path fill="currentColor" d="M6 14v1H2v-1zm-.5-6v1H2V8zM13 4v1h-3V4zM4.93 2v1H2V2z" opacity=".6"/>
134
+ <path fill="currentColor" d="M4.93 12v1H2v-1zM13 8v1H9V8zM5.5 4v1H2V4zM9 2v1H4.93V2z" opacity=".4"/>
135
+ </symbol>`,oI=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
136
+ <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"/>
137
+ <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"/>
138
+ </symbol>`,sI=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
139
+ <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"/>
140
+ <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"/>
141
+ </symbol>`,cI=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
142
+ <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"/>
143
+ </symbol>`,lI=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
144
+ <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"/>
145
+ </symbol>`,uI=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
146
+ <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"/>
147
+ </symbol>`,dI=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
148
+ <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"/>
149
+ <path fill="currentColor" d="M6.5 2.5V4l-2 1.5v-4zm5 3L9.5 4V2.5l2-1zM9 4H7V2.5h2z"/>
150
+ </symbol>`,fI=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
151
+ <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"/>
152
+ </symbol>`,pI=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
153
+ <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"/>
154
+ <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"/>
155
+ </symbol>`,mI=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
156
+ <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"/>
157
+ <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"/>
158
+ </symbol>`,hI=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
159
+ <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"/>
160
+ </symbol>`,gI=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
161
+ <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"/>
162
+ <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"/>
163
+ </symbol>`,_I=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
164
+ <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"/>
165
+ </symbol>`,vI=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
166
+ <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"/>
167
+ </symbol>`,yI=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
168
+ <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"/>
169
+ <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"/>
170
+ </symbol>`,bI=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
171
+ <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"/>
172
+ <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"/>
173
+ </symbol>`,xI=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
174
+ <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"/>
175
+ </symbol>`,SI=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
176
+ <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"/>
177
+ <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"/>
178
+ <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"/>
179
+ </symbol>`,CI=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
180
+ <path fill="currentColor" d="M9.62 2.25 8 5.02 6.38 2.25H1l7 12 7-12z" opacity=".5"/>
181
+ <path fill="currentColor" d="M9.54 2.25 8 4.95l-1.54-2.7H4l4 7 4-7z"/>
182
+ </symbol>`,wI=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
183
+ <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"/>
184
+ <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"/>
185
+ <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"/>
186
+ </symbol>`,TI=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
187
+ <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"/>
188
+ <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"/>
189
+ </symbol>`,EI=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
190
+ <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"/>
191
+ </symbol>`,DI=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
192
+ <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"/>
193
+ <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"/>
194
+ </symbol>`,OI=[PF,BF,VF,HF,GF,KF,qF,YF,XF,ZF,QF,$F,eI,oI,cI,lI,hI,gI,yI,bI,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
195
+ <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"/>
196
+ <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"/>
197
+ </symbol>`],kI=[MF,NF,FF,IF,LF,RF,zF,UF,WF,JF,tI,nI,rI,iI,aI,sI,uI,dI,fI,pI,mI,_I,vI,xI,SI,CI,wI,TI,EI,DI];function AI(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
198
+ `)}\n</svg>`)}var jI=AI(jF,OI),MI={minimal:jF,standard:jI,complete:AI(jI,kI)},NI={".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`},PI={"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`},FI={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},II=new Set([`bash`,`css`,`database`,`default`,`font`,`git`,`go`,`html`,`image`,`javascript`,`json`,`markdown`,`mcp`,`python`,`ruby`,`rust`,`swift`,`table`,`text`,`typescript`,`zip`]),LI=new Set([`complete`]);function RI(e){return MI[e===`none`?`minimal`:e]}function zI(e){return`file-tree-builtin-${e}`}function BI(e){return e!==`none`&&LI.has(e)}function VI(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=NI[t.toLowerCase()];if(i!=null&&(r||II.has(i)))return i;for(let e of n){if(r){let t=FI[e];if(t!=null)return t}let t=PI[e];if(t!=null&&(r||II.has(t)))return t}return`default`}var HI=`file-tree-container`,UI=`data-file-tree-style`,WI=`data-file-tree-unsafe-css`,GI=`data-file-tree-scrollbar-measure`,KI=`data-file-tree-scrollbar-gutter-measured`,qI=`--trees-scrollbar-gutter-measured`,JI=`header`,YI=`context-menu`,XI=`context-menu-trigger`;function ZI(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function QI(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(ZI(e)?`none`:`complete`),colored:e.colored??!0}}var $I=e=>e.trim().toLowerCase(),eL=e=>e.split(`/`).at(-1)??e,tL=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 nL(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function rL(e){let t=QI(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($I(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=eL(o),s=n.toLowerCase(),c=r.get(s);if(c!=null)return nL(c,e);for(let[t,n]of a)if(s.includes(t))return nL(n,e);let l=tL(n);for(let t of l){let n=i.get(t);if(n!=null)return nL(n,e)}let u=VI(t.set,n,l);if(u!=null&&t.set!==`none`)return{name:zI(u),remappedFrom:e,token:u}}let s=n?.[e];return s==null?{name:e}:nL(s,e)}}}var iL=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,aL=/^0(?:\.0+)?%?$/;function oL(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 sL(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||iL.test(t))return!0;let n=oL(t);return n!=null&&aL.test(n)}function cL(e){return sL(e)?void 0:e}function lL(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=cL(t[`list.focusOutline`])??cL(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 uL=5,dL=1<<uL,fL=dL*4;function pL(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function mL(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function hL(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 gL(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 _L(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function vL(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 yL(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,CL(e,t)}function bL(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=gL(e).get(t);if(i===void 0)return;let a=i>>uL;e.childVisibleChunkSums[a]+=r}function xL(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=wL(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=dL}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 SL(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>uL;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<uL}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 CL(e,t){if(t.childIds.length<fL){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/dL),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>>uL]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function wL(e,t,n,r){let i=Math.min(t.childIds.length,n+dL),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 TL=7,EL=3,DL=1<<EL,OL=4;function kL(e,t,n=0){return e<<OL|n<<EL|t}function AL(e){return e.depthAndFlags>>>OL}function jL(e){return(e.depthAndFlags&DL)>>EL}function ML(e){return(e.depthAndFlags&DL)!==0}function NL(e){return e.depthAndFlags&TL}function PL(e,t){return(NL(e)&t)!==0}function FL(e,t){e.depthAndFlags|=t}function IL(e,t){e.depthAndFlags=kL(t,NL(e),jL(e))}var LL=Symbol(`benchmarkInstrumentation`);function RL(e,t){return t==null||Object.defineProperty(e,LL,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function zL(e){return e==null?null:e[LL]??null}function BL(e,t,n){return e==null?n():e.measurePhase(t,n)}function VL(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function HL(e){return e>=48&&e<=57}function UL(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!HL(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&&HL(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 WL(e){let t=e.toLowerCase();return{lowerValue:t,tokens:UL(t)}}function GL(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 KL(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=GL(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function qL(e,t,n){let r=KL(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function JL(e,t){return qL(e,t,WL)}function YL(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function XL(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=YL(e,r);return a===YL(t,r)?JL(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 ZL(e,t){return XL(e,t)}function QL(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=WL(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=YL(e,n);return o===YL(t,n)?qL(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 $L(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=WL(r);return e.sortKeyById[t]=i,i}function eR(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function tR(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 nR(e){let{hasTrailingSlash:t,segments:n}=tR(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function rR(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=tR(e);return{requiresDirectory:t,segments:n}}var iR=``;function aR(){let e=new Map;return e.set(iR,0),{idByValue:e,valueById:[iR],sortKeyById:[WL(iR)]}}function oR(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 sR(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var cR=Symbol(`pathStorePreparedInputKind`);function lR(e,t){return e[cR]=t,e}function uR(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function dR(e,t,n){return n===`default`?ZL(e,t):n(uR(e),uR(t))}function fR(){return{depthAndFlags:kL(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function pR(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 mR(e){return e.isDirectory?e.segments.length:e.segments.length-1}function hR(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 gR(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function _R(e,t={}){return CR(e,t).map(e=>e.path)}function vR(e,t={}){let n=CR(e,t);return lR({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function yR(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 lR({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function bR(e){let t=e,n=t.preparedPaths;if(t[cR]===`prepared`&&n!=null)return n;if(!hR(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function xR(e){let t=e;return t[cR]===`presorted`&&t.presortedPaths!=null||gR(t.presortedPaths)?t.presortedPaths:null}function SR(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function CR(e,t={}){let n=eR(t),r=zL(t);VL(r,`workload.inputFiles`,e.length);let i=BL(r,`store.preparePathEntries.parse`,()=>e.map(e=>nR(e)));return BL(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>dR(e,t,n.sort))),i}var wR=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[fR()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=aR();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=zL(e),this.options=eR(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,pL())}appendPaths(e){return BL(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>nR(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,BL(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return BL(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:kL(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:kL(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:kL(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=nR(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:kL(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:kL(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=nR(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(BL(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||BL(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`?QL(this.lastPreparedPath,e,this.segmentSortKeyCache):dR(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=mR(e),i=n==null?0:mR(n),a=n==null?0:pR(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=oR(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:kL(AL(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),_L(i,s),s}createFileChildUnchecked(e,t){let n=oR(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:kL(AL(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),_L(r,a),a}getOrCreateDirectoryChild(e,t){let n=oR(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&&!ML(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:kL(AL(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),_L(r,a),this.directories.set(a,pL()),a}createDirectoryChild(e,t){let n=oR(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:kL(AL(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),_L(r,a),this.directories.set(a,pL()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!ML(n))throw Error(`Path is not a directory: "${t}"`);if(PL(n,1))throw Error(`Duplicate path: "${t}"`);FL(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,mL());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(ML(a)){let t=mL();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;ML(n)&&this.directories.set(t,pL());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),_L(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!ML(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 yL(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function TR(e,t=`closed`,n=null){let r=DR(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 ER(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function DR(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 OR(e,t){return PL(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion===`closed`?!1:AL(t)<=e.defaultExpansion}function kR(e,t,n=e.snapshot.nodes[t]){return n==null||!ML(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:OR(e,n)}function AR(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!ML(r))return;let i=OR(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 jR(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 MR(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function NR(e,t){let n=jR(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 PR(e,t){let n=jR(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function FR(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 IR(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function LR(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 RR(e,t){e.directoryLoadInfoById.delete(t)}function zR(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 BR(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function VR(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function HR(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function UR(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function WR(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function GR(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function KR(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 qR(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 JR(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 YR(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 XR(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 ZR(e,t,n){return{...n,visibleCountDelta:cz(e)-t}}function QR(e,t){let n=cz(e),r=ER();e.transactionStack.push(r);try{t()}catch(t){throw tz(e,r,!1),t}tz(e,r,!0,cz(e)-n)}function $R(e,t){let n=e.instrumentation;if(n==null){ez(e,t);return}BL(n,`store.events.record`,()=>ez(e,t))}function ez(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){oz(e,t);return}n.events.push(t),az(n,t)}function tz(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?iz(i,t):BL(n,`store.events.batch.merge`,()=>iz(i,t));return}let a=nz(t,r),o=e.instrumentation;if(o==null){oz(e,a);return}BL(o,`store.events.batch.commit`,()=>oz(e,a))}function nz(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 rz(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function iz(e,t){for(let n of t.events)e.events.push(n);rz(e,t)}function az(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function oz(e,t){let n=e.instrumentation;if(n==null){sz(e,t);return}BL(n,`store.events.emit`,()=>sz(e,t))}function sz(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function cz(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function lz(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!ML(n)||PL(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||!ML(a)?null:i}function uz(e,t){let n=t;for(;;){let t=lz(e,n);if(t==null)return n;n=t}}function dz(e,t){let n=[t],r=t;for(;;){let t=lz(e,r);if(t==null)return n;n.push(t),r=t}}function fz(e,t){let n=t==null?e.snapshot.rootId:Sz(e,t);return n==null?[]:Ez(e,n)}function pz(e,t){let n=nR(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=Vz(e,Bz(e,r)),{createdNodeIds:a,directoryId:o}=Dz(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=Tz(e,o);if(PL(n,1))throw Error(`Path already exists: "${t}"`);FL(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=kz(e,o,n.basename),s.add(c);yz(e,o);let l=Vz(e,o);return BR({affectedAncestorIds:xz(e,c),affectedNodeIds:[...s],path:t,projectionChanged:Hz(i,l)})}function mz(e,t,n){let r=Sz(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=Tz(e,r);if(PL(i,2))throw Error(`The root node cannot be removed`);if(ML(i)&&wz(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=Vz(e,a),s=Rz(e,r);Mz(e,a,r,i.nameId),zz(e,a),yz(e,a);let c=Vz(e,a);return VR({affectedAncestorIds:xz(e,a),affectedNodeIds:s,path:t,projectionChanged:Hz(o,c),recursive:n.recursive===!0})}function hz(e,t,n,r){let i=Sz(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=Tz(e,i);if(PL(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=Iz(e,i,n),c=Vz(e,a.parentId),l=Vz(e,s.parentId),u=sR(e.snapshot.segmentTable,a.nameId),d=oR(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(ML(a)&&Kz(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=hL(e.snapshot.nodes,wz(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&Lz(e,p,o,jL(a))===`skip`)return null;let m=a.parentId;Mz(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),Gz(e,i),jz(e,s.parentId,i),zz(e,m),e.pathCacheVersion++,yz(e,m),s.parentId!==m&&yz(e,s.parentId);let h=Vz(e,m),g=Vz(e,s.parentId);return HR({affectedAncestorIds:[...new Set([...xz(e,m),...xz(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:Uz([c,l],[h,g]),to:vz(e,i)})}function gz(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function _z(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function vz(e,t){let n=Tz(e,t),r=gz(e,t);if(r!=null)return r;if(PL(n,2))return _z(e,t,``);let i=vz(e,n.parentId),a=sR(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return _z(e,t,ML(n)?`${o}/`:o)}function yz(e,t){let n=e.instrumentation;if(n==null){Jz(e,t);return}BL(n,`store.recomputeCountsUpwardFrom`,()=>Jz(e,t))}function bz(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||!ML(o)){qz(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){qz(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function xz(e,t){let n=[],r=t;for(;r!=null;){let t=Tz(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function Sz(e,t){if(t.length===0)return e.snapshot.rootId;let n=rR(t);return Cz(e,n.segments,n.requiresDirectory)}function Cz(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=wz(e,r),a=hL(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=Tz(e,r);return n&&!ML(i)?null:r}function wz(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 Tz(e,t){let n=e.snapshot.nodes[t];if(n===void 0||PL(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function Ez(e,t){let n=e.snapshot.nodes[t];if(n===void 0||PL(n,4))return[];if(!ML(n))return[vz(e,t)];if(wz(e,t).childIds.length===0)return PL(n,1)&&!PL(n,2)?[vz(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||PL(n,4)){i.pop();continue}if(!ML(n)){r.push(vz(e,t.nodeId)),i.pop();continue}let a=wz(e,t.nodeId);if(a.childIds.length===0){PL(n,1)&&!PL(n,2)&&r.push(vz(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 Dz(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=oR(e.snapshot.segmentTable,i),a=wz(e,r),o=hL(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!ML(Tz(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=Oz(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function Oz(e,t,n){let r=Tz(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:kL(AL(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,pL()),jz(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function kz(e,t,n){let r=oR(e.snapshot.segmentTable,n),i=wz(e,t);if(hL(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${Xz(e,t,n)}"`);let a=Tz(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:kL(AL(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),jz(e,t,o),e.activeNodeCount++,o}function Az(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}Nz(e,n,o)<0?i=a:r=a+1}return r}function jz(e,t,n){let r=wz(e,t),i=Tz(e,n);hL(e.snapshot.nodes,r).set(i.nameId,n),bL(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=Az(e,r,n);r.childIds.splice(a,0,n),vL(r,a),CL(e.snapshot.nodes,r)}function Mz(e,t,n,r){let i=wz(e,t),a=gL(i),o=a.get(n)??-1;hL(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&bL(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),vL(i,o),CL(e.snapshot.nodes,i))}function Nz(e,t,n){let r=e.snapshot.options.sort;return r===`default`?Pz(e,t,n):r(Fz(e,t),Fz(e,n))}function Pz(e,t,n){let r=Tz(e,t),i=Tz(e,n),a=ML(r);if(a!==ML(i))return a?-1:1;let o=KL($L(e.snapshot.segmentTable,r.nameId),$L(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=sR(e.snapshot.segmentTable,r.nameId),c=sR(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function Fz(e,t){let n=Tz(e,t),r=vz(e,t),i=ML(n),a=i?r.slice(0,-1):r;return{basename:sR(e.snapshot.segmentTable,n.nameId),depth:AL(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function Iz(e,t,n){let r=Tz(e,t),i=Sz(e,n);if(i!=null){let t=Tz(e,i);if(ML(t))return{basename:sR(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=rR(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=rR(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:Cz(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function Lz(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${vz(e,t)}"`);let i=Tz(e,t);if(jL(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(ML(i)&&wz(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return Rz(e,t),Mz(e,a,t,o),zz(e,a),yz(e,a),`handled`}function Rz(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=Tz(e,t.nodeId);if(t.visitedChildren||!ML(i)){ML(i)&&e.snapshot.directories.delete(t.nodeId),FL(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),RR(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=wz(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 zz(e,t){let n=t;for(;n!=null;){let t=Tz(e,n);if(!ML(t)||PL(t,2)||wz(e,n).childIds.length>0)return;FL(t,1),n=t.parentId===n?null:t.parentId}}function Bz(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=hL(e.snapshot.nodes,wz(e,n)).get(t);if(i==null||!ML(Tz(e,i)))break;n=i}return n}function Vz(e,t){let n=Wz(e,t);if(n==null)return null;let r=uz(e,n),i=Tz(e,r),a=n===r?null:dz(e,n).map(t=>vz(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:wz(e,r).childIds.length>0,path:vz(e,r),terminalKind:jL(i)})}function Hz(e,t){return Uz([e],[t])}function Uz(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 Wz(e,t){let n=t;for(;n!=null;){let t=Tz(e,n);if(!ML(t)||PL(t,2))return null;if(!kR(e,n,t))return n;n=t.parentId}return null}function Gz(e,t){let n=Tz(e,t);if(IL(n,(t===e.snapshot.rootId?-1:AL(Tz(e,n.parentId)))+1),!ML(n))return;let r=wz(e,t);for(let t of r.childIds)Gz(e,t)}function Kz(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=Tz(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function qz(e,t,n=Tz(e,t),r=!1){let i=e.instrumentation;if(i==null){Yz(e,t,n,r);return}BL(i,`store.recomputeNodeCounts`,()=>Yz(e,t,n,r))}function Jz(e,t){let n=t;for(;n!=null;){let t=Tz(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(qz(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&bL(wz(e,s),n,a,o),n=s}}function Yz(e,t,n,r){if(!ML(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=wz(e,t);if(r){let t=e.instrumentation;t==null?yL(e.snapshot.nodes,i):BL(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>yL(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,PL(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=lz(e,t)==null?kR(e,t,n)?1+o:1:o}function Xz(e,t,n){let r=vz(e,t);return r.length===0?n:`${r}${n}`}function Zz(e){return e!=null&&!PL(e,4)}function Qz(e,t){let n=e.snapshot.nodes[t];return!Zz(n)||!ML(n)||PL(n,2)?null:n}function $z(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&Zz(e.snapshot.nodes[n])&&(t+=1);return t}function eB(e){return Math.max(0,e.valueById.length-1)}function tB(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:$z(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:eB(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function nB(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 rB(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)Qz(e,n)!=null&&t.push(vz(e,n));for(let t of e.expandedDirectoryIds)Qz(e,t)!=null&&n.push(vz(e,t));return{collapsedPaths:t,expandedPaths:n}}function iB(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)Qz(e,n)==null||MR(e,n)===`loaded`||t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:vz(e,n)});return t}function aB(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=Sz(e,n);t!=null&&AR(e,t,!0,Tz(e,t))}for(let n of t.collapsedPaths){let t=Sz(e,n);t!=null&&AR(e,t,!1,Tz(e,t))}}function oB(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=Sz(e,n.path);t!=null&&Qz(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function sB(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function cB(e){let t=e.snapshot.segmentTable,n=aR();for(let r of e.snapshot.nodes)if(Zz(r)){if(PL(r,2)){r.nameId=0;continue}r.nameId=oR(n,sR(t,r.nameId))}e.snapshot.segmentTable=n}function lB(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!Zz(r)||!ML(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return Zz(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[Tz(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),yL(e.snapshot.nodes,n)}}function uB(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(Zz(n))break;--t}e.snapshot.nodes.length=t+1}function dB(e){let t=rB(e),n=iB(e);BL(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>sB(e)),BL(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>cB(e)),BL(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>lB(e)),BL(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>uB(e)),BL(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>aB(e,t)),BL(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>oB(e,n)),BL(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>bz(e,e.snapshot.rootId))}function fB(e){let t=rB(e),n=iB(e),r=BL(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>fz(e)),i=RL({...e.snapshot.options},e.instrumentation),a=BL(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new wR(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,BL(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>aB(e,t)),BL(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>oB(e,n)),BL(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>bz(e,e.snapshot.rootId))}function pB(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function mB(e,t){let n=tB(e);t===`stable`?BL(e.instrumentation,`store.cleanup.stable`,()=>dB(e)):BL(e.instrumentation,`store.cleanup.aggressive`,()=>fB(e));let r=tB(e);return nB(t,t===`stable`,n,r)}var hB=64;function gB(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 _B(e){return Tz(e,e.snapshot.rootId).visibleSubtreeCount}function vB(e,t,n,r){let i=Tz(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function yB(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:RB(e,t.cursor),setSize:t.setSize,subtreeEndIndex:vB(e,t.cursor,t.index,n)}}function bB(e,t,n,r,i,a){let o=wz(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=xL(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return xB(e,u,l,r+c,i+1,s,o.childIds.length,a)}function xB(e,t,n,r,i,a,o,s){if(!ML(Tz(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=MB(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=Tz(e,c.terminalNodeId);if(!ML(l)||!kR(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return bB(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function SB(e,t){let n=_B(e);if(t<0||t>=n)return null;let r=bB(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>vz(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=yB(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:RB(e,r.cursor),setSize:r.setSize,subtreeEndIndex:vB(e,r.cursor,r.index,n)}}function CB(e,t,n){let r=e.instrumentation,i=_B(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 LB(e,o+1);let t=[],n=kB(e,a);for(let r=a;r<=o&&n!=null;r++){let r=RB(e,n);t.push(r),n=PB(e,n)}return t}let s=[],c=0,l=0,u=BL(r,`store.getVisibleSlice.selectFirstRow`,()=>kB(e,a));for(let t=a;t<=o&&u!=null;t++){let t=BL(r,`store.getVisibleSlice.materializeRow`,()=>RB(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=BL(r,`store.getVisibleSlice.advanceCursor`,()=>PB(e,u))}return VL(r,`workload.visibleRowsRead`,s.length),VL(r,`workload.flattenedRowsRead`,c),VL(r,`workload.flattenedSegmentsRead`,l),s}function wB(e,t=_B(e)){let n=e.instrumentation;return n==null?IB(e,t):BL(n,`store.getVisibleTreeProjection`,()=>IB(e,t))}function TB(e){return FB(wB(e))}function EB(e,t){let n=Sz(e,t);if(n==null||n===e.snapshot.rootId||ML(Tz(e,n))&&uz(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=Tz(e,i).parentId,n=wz(e,t),s=gL(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=SL(a,n,s),t!==o){let n=Tz(e,t),a=lz(e,t);if(!kR(e,t,n)&&a!==i)return null;uz(e,t)===t&&(r+=1)}i=t}return r}function DB(e,t){let n=Sz(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=Tz(e,n);if(!ML(r))throw Error(`Path is not a directory: "${t}"`);return kR(e,n,r)?null:(AR(e,n,!0,r),yz(e,n),UR({affectedAncestorIds:xz(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function OB(e,t){let n=Sz(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=Tz(e,n);if(!ML(r))throw Error(`Path is not a directory: "${t}"`);return kR(e,n,r)?(AR(e,n,!1,r),yz(e,n),WR({affectedAncestorIds:xz(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function kB(e,t){return t<0||t>=_B(e)?null:AB(e,e.snapshot.rootId,t,-1)}function AB(e,t,n,r){let i=wz(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?xL(e.snapshot.nodes,i,n):BL(a,`store.getVisibleSlice.selectChildIndex`,()=>xL(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return jB(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function jB(e,t,n,r){if(!ML(Tz(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=MB(e,t,r);if(n===0)return i;let a=Tz(e,i.terminalNodeId);if(!ML(a)||!kR(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return AB(e,i.terminalNodeId,n-1,i.visibleDepth)}function MB(e,t,n){return ML(Tz(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:uz(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:BL(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>uz(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function NB(e,t){let n=Tz(e,t);if(!ML(n))return!0;let r=n.parentId;return r===e.snapshot.rootId?!0:lz(e,r)!==t}function PB(e,t){let n=Tz(e,t.terminalNodeId);if(ML(n)){let r=wz(e,t.terminalNodeId);if(kR(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:jB(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=Tz(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=wz(e,n),o=gL(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 jB(e,s,0,i);NB(e,r)&&i--,r=n}}function FB(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 IB(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(hB);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=gB(o,y);let x,S=_;if(ML(v))S=f?uz(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:vz(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&&ML(C)&&kR(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 LB(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(!ML(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:vz(e,f)};continue}let h=l?uz(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=RB(e,g);let _=i[h];_!=null&&ML(_)&&kR(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function RB(e,t){let n=Tz(e,t.terminalNodeId),r=ML(n)?zB(e,t):null,i=vz(e,t.terminalNodeId),a=sR(e.snapshot.segmentTable,n.nameId),o=ML(n)&&wz(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?dz(e,t.headNodeId).map(n=>{let r=Tz(e,n);return{isTerminal:n===t.terminalNodeId,name:sR(e.snapshot.segmentTable,r.nameId),nodeId:n,path:vz(e,n)}}):BL(c,`store.getVisibleSlice.flatten.collectSegments`,()=>dz(e,t.headNodeId).map(n=>{let r=Tz(e,n);return{isTerminal:n===t.terminalNodeId,name:sR(e.snapshot.segmentTable,r.nameId),nodeId:n,path:vz(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:ML(n)&&kR(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:ML(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function zB(e,t){if(t.headNodeId===t.terminalNodeId)return MR(e,t.terminalNodeId);let n=dz(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=MR(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}function BB(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||!ML(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&&CL(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&ML(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,CL(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function VB(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var HB=class e{#e;constructor(e={}){let t=zL(e),n=BL(t,`store.builder.create`,()=>new wR(e));if(e.preparedInput!=null){let t=xR(e.preparedInput);t==null?n.appendPreparedPaths(bR(e.preparedInput),!1):n.appendPresortedPaths(t,SR(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(BL(t,`store.preparePathEntries`,()=>CR(r,e)))}let r=BL(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=BL(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=BL(t,`store.state.create`,()=>TR(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:BL(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||VB(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&BL(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?BL(t,`store.state.initializeOpenVisibleCounts`,()=>BB(this.#e)):BL(t,`store.state.recomputeCounts`,()=>bz(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return _R(e,t)}static prepareInput(e,t={}){return vR(e,t)}static preparePresortedInput(e){return yR(e)}list(e){return BL(this.#e.instrumentation,`store.list`,()=>fz(this.#e,e))}add(e){BL(this.#e.instrumentation,`store.add`,()=>{let t=_B(this.#e);$R(this.#e,ZR(this.#e,t,pz(this.#e,e)))})}remove(e,t={}){BL(this.#e.instrumentation,`store.remove`,()=>{let n=_B(this.#e);$R(this.#e,ZR(this.#e,n,mz(this.#e,e,t)))})}move(e,t,n={}){BL(this.#e.instrumentation,`store.move`,()=>{let r=_B(this.#e),i=hz(this.#e,e,t,n);i!=null&&$R(this.#e,ZR(this.#e,r,i))})}batch(e){QR(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 BL(this.#e.instrumentation,`store.getVisibleCount`,()=>_B(this.#e))}getVisibleSlice(e,t){return BL(this.#e.instrumentation,`store.getVisibleSlice`,()=>CB(this.#e,e,t))}getVisibleRowContext(e){return BL(this.#e.instrumentation,`store.getVisibleRowContext`,()=>SB(this.#e,e))}getVisibleTreeProjection(){return TB(this.#e)}getVisibleTreeProjectionData(e){return wB(this.#e,e)}getVisibleIndex(e){return BL(this.#e.instrumentation,`store.getVisibleIndex`,()=>EB(this.#e,e))}getPathInfo(e){return BL(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=Sz(this.#e,e);if(t==null)return null;let n=Tz(this.#e,t);return{depth:AL(n),kind:ML(n)?`directory`:`file`,path:vz(this.#e,t)}})}isExpanded(e){return BL(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=Tz(this.#e,t);return kR(this.#e,t,n)})}expand(e){BL(this.#e.instrumentation,`store.expand`,()=>{let t=_B(this.#e),n=DB(this.#e,e);n!=null&&$R(this.#e,ZR(this.#e,t,n))})}collapse(e){BL(this.#e.instrumentation,`store.collapse`,()=>{let t=_B(this.#e),n=OB(this.#e,e);n!=null&&$R(this.#e,ZR(this.#e,t,n))})}on(e,t){return zR(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return MR(this.#e,t)}markDirectoryUnloaded(e){BL(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(wz(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=_B(this.#e);PR(this.#e,t),$R(this.#e,ZR(this.#e,n,GR({affectedAncestorIds:xz(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return BL(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=_B(this.#e),r=NR(this.#e,t);return $R(this.#e,ZR(this.#e,n,KR({affectedAncestorIds:xz(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return BL(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||MR(this.#e,n)!==`loading`||!IR(this.#e,n,e.attemptId))return!1;let r=vz(this.#e,n);this.validateChildPatch(r,t);let i=_B(this.#e),a=[];for(let e of t.operations){UB(r,e);let t=_B(this.#e);switch(e.type){case`add`:a.push(ZR(this.#e,t,pz(this.#e,e.path)));break;case`remove`:a.push(ZR(this.#e,t,mz(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=hz(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(ZR(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return $R(this.#e,ZR(this.#e,i,qR({affectedAncestorIds:xz(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:vz(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return BL(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=_B(this.#e),r=FR(this.#e,t,e.attemptId);return $R(this.#e,ZR(this.#e,n,JR({affectedAncestorIds:xz(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:vz(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return BL(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=_B(this.#e),i=LR(this.#e,n,e.attemptId,t);return $R(this.#e,ZR(this.#e,r,YR({affectedAncestorIds:xz(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:vz(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return BL(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(pB(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=_B(this.#e),n=mB(this.#e,e.mode??`stable`);return $R(this.#e,ZR(this.#e,t,XR({...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=wz(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??WL(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=KL($L(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(!ML(Tz(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=Tz(this.#e,n);kR(this.#e,n,i)||(AR(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=Tz(this.#e,e);if(!kR(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=Sz(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!ML(Tz(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!ML(Tz(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=Tz(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=Tz(this.#e,e),r=lz(this.#e,e);if(!kR(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 UB(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 WB={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function GB(e,t){if(typeof e==`number`)return{itemHeight:t??WB.default.itemHeight,factor:e};let n=WB[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var KB=WB.default.itemHeight,qB=`@layer base, theme, unsafe;
199
+
200
+ @layer base {
201
+ :host {
202
+ /*
203
+ CSS variables use a fallback stack to ensure user and theme colors slot
204
+ in with ease. User colors take precedence over theme colors, which take
205
+ precedence over defaults.
206
+
207
+ Fallback order:
208
+
209
+ 1. --trees-*-override (explicit)
210
+ 2. --trees-theme-* (e.g. Shiki/VS Code tokens)
211
+ 3. defaults
212
+
213
+ Theme variable names mirror Shiki/VS Code theme file JSON tokens.
214
+
215
+ // Available CSS Color Overrides
216
+ --trees-fg-override
217
+ --trees-fg-muted-override
218
+ --trees-bg-override
219
+ --trees-bg-muted-override
220
+ --trees-accent-override
221
+ --trees-border-color-override
222
+
223
+ --trees-focus-ring-color-override
224
+ --trees-focus-ring-width-override
225
+ --trees-focus-ring-offset-override
226
+
227
+ --trees-search-fg-override
228
+ --trees-search-font-weight-override
229
+ --trees-search-bg-override
230
+
231
+ --trees-selected-fg-override
232
+ --trees-selected-bg-override
233
+ --trees-selected-focused-border-color-override
234
+
235
+ // Git Status Color Overrides
236
+ --trees-status-added-override
237
+ --trees-status-ignored-override
238
+ --trees-status-modified-override
239
+ --trees-status-renamed-override
240
+ --trees-status-untracked-override
241
+ --trees-status-deleted-override
242
+ --trees-git-added-color-override
243
+ --trees-git-ignored-color-override
244
+ --trees-git-modified-color-override
245
+ --trees-git-renamed-color-override
246
+ --trees-git-untracked-color-override
247
+ --trees-git-deleted-color-override
248
+
249
+ // Built-in File Icon Color Overrides
250
+ --trees-file-icon-color
251
+ --trees-file-icon-color-astro
252
+ --trees-file-icon-color-babel
253
+ --trees-file-icon-color-bash
254
+ --trees-file-icon-color-biome
255
+ --trees-file-icon-color-bootstrap
256
+ --trees-file-icon-color-browserslist
257
+ --trees-file-icon-color-bun
258
+ --trees-file-icon-color-claude
259
+ --trees-file-icon-color-css
260
+ --trees-file-icon-color-database
261
+ --trees-file-icon-color-default
262
+ --trees-file-icon-color-docker
263
+ --trees-file-icon-color-eslint
264
+ --trees-file-icon-color-git
265
+ --trees-file-icon-color-go
266
+ --trees-file-icon-color-graphql
267
+ --trees-file-icon-color-html
268
+ --trees-file-icon-color-image
269
+ --trees-file-icon-color-javascript
270
+ --trees-file-icon-color-json
271
+ --trees-file-icon-color-markdown
272
+ --trees-file-icon-color-mcp
273
+ --trees-file-icon-color-npm
274
+ --trees-file-icon-color-oxc
275
+ --trees-file-icon-color-postcss
276
+ --trees-file-icon-color-prettier
277
+ --trees-file-icon-color-python
278
+ --trees-file-icon-color-react
279
+ --trees-file-icon-color-ruby
280
+ --trees-file-icon-color-rust
281
+ --trees-file-icon-color-sass
282
+ --trees-file-icon-color-svg
283
+ --trees-file-icon-color-svelte
284
+ --trees-file-icon-color-svgo
285
+ --trees-file-icon-color-swift
286
+ --trees-file-icon-color-table
287
+ --trees-file-icon-color-text
288
+ --trees-file-icon-color-tailwind
289
+ --trees-file-icon-color-terraform
290
+ --trees-file-icon-color-typescript
291
+ --trees-file-icon-color-vite
292
+ --trees-file-icon-color-vscode
293
+ --trees-file-icon-color-vue
294
+ --trees-file-icon-color-wasm
295
+ --trees-file-icon-color-webpack
296
+ --trees-file-icon-color-yml
297
+ --trees-file-icon-color-zig
298
+ --trees-file-icon-color-zip
299
+
300
+ // Density
301
+ //
302
+ // A unitless scale factor for padding, gaps, and indentation. Usually
303
+ // set via \`density\` on useFileTree. Individual overrides take precedence.
304
+ //
305
+ // Compact: 0.8
306
+ // Default: 1
307
+ // Relaxed: 1.2
308
+ //
309
+ --trees-density-override
310
+
311
+ // Available CSS Layout Overrides
312
+ --trees-gap-override
313
+ --trees-border-radius-override
314
+ --trees-font-family-override
315
+ --trees-font-size-override
316
+ --trees-font-weight-regular-override
317
+ --trees-font-weight-semibold-override
318
+ --trees-level-gap-override
319
+ --trees-item-padding-x-override
320
+ --trees-item-margin-x-override
321
+ --trees-item-row-gap-override
322
+ --trees-icon-width-override
323
+ --trees-icon-nudge-override
324
+ --trees-scrollbar-gutter-override
325
+ --trees-padding-inline-override
326
+ */
327
+
328
+ --trees-accent: var(--trees-accent-override, #009fff);
329
+ --trees-fg: var(
330
+ --trees-fg-override,
331
+ var(--trees-theme-sidebar-fg, light-dark(#6c6c71, #adadb1))
332
+ );
333
+ --trees-fg-muted: var(
334
+ --trees-fg-muted-override,
335
+ var(--trees-theme-sidebar-header-fg, light-dark(#84848a, #84848a))
336
+ );
337
+ --trees-bg: var(
338
+ --trees-bg-override,
339
+ var(--trees-theme-sidebar-bg, light-dark(#f8f8f8, #141415))
340
+ );
341
+ /* var(--trees-theme-list-hover-bg, light-dark(#dfebff59, #19283c59)) */
342
+ --trees-bg-muted: var(
343
+ --trees-bg-muted-override,
344
+ var(
345
+ --trees-theme-list-hover-bg,
346
+ light-dark(
347
+ color-mix(
348
+ in lab,
349
+ var(--trees-accent) var(--trees-bg-alpha-light, 8%),
350
+ var(--trees-bg)
351
+ ),
352
+ color-mix(
353
+ in lab,
354
+ var(--trees-accent) var(--trees-bg-alpha-dark, 10%),
355
+ var(--trees-bg)
356
+ )
357
+ )
358
+ )
359
+ );
360
+ --trees-input-bg: var(
361
+ --trees-input-bg-override,
362
+ light-dark(#f8f8f8, #070707)
363
+ );
364
+
365
+ --trees-added-light: #16a994;
366
+ --trees-added-dark: #00cab1;
367
+ --trees-ignored-light: #adadb1;
368
+ --trees-ignored-dark: #4a4a4e;
369
+ --trees-modified-light: #1ca1c7;
370
+ --trees-modified-dark: #08c0ef;
371
+ --trees-renamed-light: #d5a910;
372
+ --trees-renamed-dark: #ffd452;
373
+ --trees-untracked-light: #16a994;
374
+ --trees-untracked-dark: #00cab1;
375
+ --trees-deleted-light: #ff2e3f;
376
+ --trees-deleted-dark: #ff6762;
377
+
378
+ --trees-border-color: var(
379
+ --trees-border-color-override,
380
+ var(--trees-theme-sidebar-border, light-dark(#eeeeef, #070707))
381
+ );
382
+ --trees-indent-guide-bg: var(
383
+ --trees-indent-guide-bg-override,
384
+ color-mix(in lab, var(--trees-fg-muted) 25%, transparent)
385
+ );
386
+ --trees-density: var(--trees-density-override, 1);
387
+ --trees-border-radius: var(
388
+ --trees-border-radius-override,
389
+ calc(6px * var(--trees-density))
390
+ );
391
+
392
+ --trees-font-family: var(--trees-font-family-override, system-ui);
393
+ --trees-font-size: var(--trees-font-size-override, 13px);
394
+ --trees-font-weight-regular: var(--trees-font-weight-regular-override, 400);
395
+ --trees-font-weight-semibold: var(
396
+ --trees-font-weight-semibold-override,
397
+ 600
398
+ );
399
+
400
+ --trees-focus-ring-color: var(
401
+ --trees-focus-ring-color-override,
402
+ var(--trees-theme-focus-ring, var(--trees-accent))
403
+ );
404
+ --trees-focus-ring-width: var(--trees-focus-ring-width-override, 1px);
405
+ --trees-focus-ring-offset: var(--trees-focus-ring-offset-override, -1px);
406
+
407
+ --trees-search-fg: var(
408
+ --trees-search-fg-override,
409
+ var(--trees-theme-input-fg, var(--trees-fg))
410
+ );
411
+ --trees-search-font-weight: var(--trees-search-font-weight-override, 600);
412
+ --trees-search-bg: var(
413
+ --trees-search-bg-override,
414
+ var(--trees-theme-input-bg, var(--trees-input-bg))
415
+ );
416
+
417
+ --trees-scrollbar-thumb: var(
418
+ --trees-scrollbar-thumb-override,
419
+ var(
420
+ --trees-theme-scrollbar-thumb,
421
+ color-mix(in lab, var(--trees-fg) 25%, var(--trees-bg))
422
+ )
423
+ );
424
+
425
+ --trees-selected-fg: var(
426
+ --trees-selected-fg-override,
427
+ var(--trees-theme-list-active-selection-fg, var(--trees-fg))
428
+ );
429
+ --trees-selected-bg: var(
430
+ --trees-selected-bg-override,
431
+ var(
432
+ --trees-theme-list-active-selection-bg,
433
+ light-dark(
434
+ color-mix(in lab, var(--trees-accent) 12%, var(--trees-bg)),
435
+ color-mix(in lab, var(--trees-accent) 15%, var(--trees-bg))
436
+ )
437
+ )
438
+ );
439
+ --trees-selected-focused-border-color: var(
440
+ --trees-selected-focused-border-color-override,
441
+ var(--trees-theme-focus-ring, var(--trees-accent))
442
+ );
443
+
444
+ /* Git status (e.g. from Shiki theme gitDecoration.*) */
445
+ --trees-status-added: var(
446
+ --trees-status-added-override,
447
+ var(
448
+ --trees-theme-git-added-fg,
449
+ light-dark(var(--trees-added-light), var(--trees-added-dark))
450
+ )
451
+ );
452
+ --trees-status-ignored: var(
453
+ --trees-status-ignored-override,
454
+ var(
455
+ --trees-theme-git-ignored-fg,
456
+ light-dark(var(--trees-ignored-light), var(--trees-ignored-dark))
457
+ )
458
+ );
459
+ --trees-status-modified: var(
460
+ --trees-status-modified-override,
461
+ var(
462
+ --trees-theme-git-modified-fg,
463
+ light-dark(var(--trees-modified-light), var(--trees-modified-dark))
464
+ )
465
+ );
466
+ --trees-status-renamed: var(
467
+ --trees-status-renamed-override,
468
+ var(
469
+ --trees-theme-git-renamed-fg,
470
+ light-dark(var(--trees-renamed-light), var(--trees-renamed-dark))
471
+ )
472
+ );
473
+ --trees-status-untracked: var(
474
+ --trees-status-untracked-override,
475
+ var(
476
+ --trees-theme-git-untracked-fg,
477
+ light-dark(var(--trees-untracked-light), var(--trees-untracked-dark))
478
+ )
479
+ );
480
+ --trees-status-deleted: var(
481
+ --trees-status-deleted-override,
482
+ var(
483
+ --trees-theme-git-deleted-fg,
484
+ light-dark(var(--trees-deleted-light), var(--trees-deleted-dark))
485
+ )
486
+ );
487
+ --trees-git-modified-color: var(
488
+ --trees-git-modified-color-override,
489
+ var(--trees-status-modified)
490
+ );
491
+ --trees-git-added-color: var(
492
+ --trees-git-added-color-override,
493
+ var(--trees-status-added)
494
+ );
495
+ --trees-git-ignored-color: var(
496
+ --trees-git-ignored-color-override,
497
+ var(--trees-status-ignored)
498
+ );
499
+ --trees-git-deleted-color: var(
500
+ --trees-git-deleted-color-override,
501
+ var(--trees-status-deleted)
502
+ );
503
+ --trees-git-renamed-color: var(
504
+ --trees-git-renamed-color-override,
505
+ var(--trees-status-renamed)
506
+ );
507
+ --trees-git-untracked-color: var(
508
+ --trees-git-untracked-color-override,
509
+ var(--trees-status-untracked)
510
+ );
511
+
512
+ --trees-icon-gray: light-dark(#84848a, #adadb1);
513
+ --trees-icon-red: light-dark(#d52c36, #ff6762);
514
+ --trees-icon-vermilion: light-dark(#ff8c5b, #d5512f);
515
+ --trees-icon-orange: light-dark(#d47628, #ffa359);
516
+ --trees-icon-yellow: light-dark(#d5a910, #ffd452);
517
+ --trees-icon-green: light-dark(#199f43, #5ecc71);
518
+ --trees-icon-teal: light-dark(#17a5af, #64d1db);
519
+ --trees-icon-cyan: light-dark(#1ca1c7, #68cdf2);
520
+ --trees-icon-blue: light-dark(#1a85d4, #69b1ff);
521
+ --trees-icon-indigo: light-dark(#693acf, #9d6afb);
522
+ --trees-icon-purple: light-dark(#a631be, #d568ea);
523
+ --trees-icon-pink: light-dark(#d32a61, #ff678d);
524
+ --trees-icon-mauve: light-dark(#594c5b, #79697b);
525
+
526
+ --trees-file-icon-color-default: var(
527
+ --trees-file-icon-color,
528
+ var(--trees-icon-gray)
529
+ );
530
+ --trees-file-icon-color-astro: var(
531
+ --trees-file-icon-color,
532
+ var(--trees-icon-purple)
533
+ );
534
+ --trees-file-icon-color-babel: var(
535
+ --trees-file-icon-color,
536
+ var(--trees-icon-yellow)
537
+ );
538
+ --trees-file-icon-color-bash: var(
539
+ --trees-file-icon-color,
540
+ var(--trees-icon-green)
541
+ );
542
+ --trees-file-icon-color-biome: var(
543
+ --trees-file-icon-color,
544
+ var(--trees-icon-blue)
545
+ );
546
+ --trees-file-icon-color-bootstrap: var(
547
+ --trees-file-icon-color,
548
+ var(--trees-icon-indigo)
549
+ );
550
+ --trees-file-icon-color-browserslist: var(
551
+ --trees-file-icon-color,
552
+ var(--trees-icon-yellow)
553
+ );
554
+ --trees-file-icon-color-bun: var(
555
+ --trees-file-icon-color,
556
+ var(--trees-icon-mauve)
557
+ );
558
+ --trees-file-icon-color-claude: var(
559
+ --trees-file-icon-color,
560
+ var(--trees-icon-orange)
561
+ );
562
+ --trees-file-icon-color-css: var(
563
+ --trees-file-icon-color,
564
+ var(--trees-icon-indigo)
565
+ );
566
+ --trees-file-icon-color-database: var(
567
+ --trees-file-icon-color,
568
+ var(--trees-icon-purple)
569
+ );
570
+ --trees-file-icon-color-docker: var(
571
+ --trees-file-icon-color,
572
+ var(--trees-icon-blue)
573
+ );
574
+ --trees-file-icon-color-eslint: var(
575
+ --trees-file-icon-color,
576
+ var(--trees-icon-indigo)
577
+ );
578
+ --trees-file-icon-color-git: var(
579
+ --trees-file-icon-vermilion,
580
+ var(--trees-icon-vermilion)
581
+ );
582
+ --trees-file-icon-color-go: var(
583
+ --trees-file-icon-color,
584
+ var(--trees-icon-cyan)
585
+ );
586
+ --trees-file-icon-color-graphql: var(
587
+ --trees-file-icon-color,
588
+ var(--trees-icon-pink)
589
+ );
590
+ --trees-file-icon-color-html: var(
591
+ --trees-file-icon-color,
592
+ var(--trees-icon-orange)
593
+ );
594
+ --trees-file-icon-color-image: var(
595
+ --trees-file-icon-color,
596
+ var(--trees-icon-pink)
597
+ );
598
+ --trees-file-icon-color-javascript: var(
599
+ --trees-file-icon-color,
600
+ var(--trees-icon-yellow)
601
+ );
602
+ --trees-file-icon-color-json: var(
603
+ --trees-file-icon-color,
604
+ var(--trees-icon-orange)
605
+ );
606
+ --trees-file-icon-color-markdown: var(
607
+ --trees-file-icon-color,
608
+ var(--trees-icon-green)
609
+ );
610
+ --trees-file-icon-color-mcp: var(
611
+ --trees-file-icon-color,
612
+ var(--trees-icon-teal)
613
+ );
614
+ --trees-file-icon-color-npm: var(
615
+ --trees-file-icon-color,
616
+ var(--trees-icon-red)
617
+ );
618
+ --trees-file-icon-color-oxc: var(
619
+ --trees-file-icon-cyan,
620
+ var(--trees-icon-cyan)
621
+ );
622
+ --trees-file-icon-color-postcss: var(
623
+ --trees-file-icon-color,
624
+ var(--trees-icon-red)
625
+ );
626
+ --trees-file-icon-color-prettier: var(
627
+ --trees-file-icon-color,
628
+ var(--trees-icon-teal)
629
+ );
630
+ --trees-file-icon-color-python: var(
631
+ --trees-file-icon-color,
632
+ var(--trees-icon-blue)
633
+ );
634
+ --trees-file-icon-color-react: var(
635
+ --trees-file-icon-color,
636
+ var(--trees-icon-cyan)
637
+ );
638
+ --trees-file-icon-color-ruby: var(
639
+ --trees-file-icon-color,
640
+ var(--trees-icon-red)
641
+ );
642
+ --trees-file-icon-color-rust: var(
643
+ --trees-file-icon-color,
644
+ var(--trees-icon-orange)
645
+ );
646
+ --trees-file-icon-color-sass: var(
647
+ --trees-file-icon-color,
648
+ var(--trees-icon-pink)
649
+ );
650
+ --trees-file-icon-color-svg: var(
651
+ --trees-file-icon-color,
652
+ var(--trees-icon-orange)
653
+ );
654
+ --trees-file-icon-color-svelte: var(
655
+ --trees-file-icon-color,
656
+ var(--trees-icon-red)
657
+ );
658
+ --trees-file-icon-color-svgo: var(
659
+ --trees-file-icon-color,
660
+ var(--trees-icon-green)
661
+ );
662
+ --trees-file-icon-color-swift: var(
663
+ --trees-file-icon-color,
664
+ var(--trees-icon-orange)
665
+ );
666
+ --trees-file-icon-color-table: var(
667
+ --trees-file-icon-color,
668
+ var(--trees-icon-teal)
669
+ );
670
+ --trees-file-icon-color-text: var(
671
+ --trees-file-icon-color,
672
+ var(--trees-icon-gray)
673
+ );
674
+ --trees-file-icon-color-tailwind: var(
675
+ --trees-file-icon-color,
676
+ var(--trees-icon-cyan)
677
+ );
678
+ --trees-file-icon-color-terraform: var(
679
+ --trees-file-icon-color,
680
+ var(--trees-icon-indigo)
681
+ );
682
+ --trees-file-icon-color-typescript: var(
683
+ --trees-file-icon-color,
684
+ var(--trees-icon-blue)
685
+ );
686
+ --trees-file-icon-color-vite: var(
687
+ --trees-file-icon-color,
688
+ var(--trees-icon-purple)
689
+ );
690
+ --trees-file-icon-color-vscode: var(
691
+ --trees-file-icon-color,
692
+ var(--trees-icon-blue)
693
+ );
694
+ --trees-file-icon-color-vue: var(
695
+ --trees-file-icon-color,
696
+ var(--trees-icon-green)
697
+ );
698
+ --trees-file-icon-color-wasm: var(
699
+ --trees-file-icon-color,
700
+ var(--trees-icon-indigo)
701
+ );
702
+ --trees-file-icon-color-webpack: var(
703
+ --trees-file-icon-color,
704
+ var(--trees-icon-blue)
705
+ );
706
+ --trees-file-icon-color-yml: var(
707
+ --trees-file-icon-color,
708
+ var(--trees-icon-red)
709
+ );
710
+ --trees-file-icon-color-zig: var(
711
+ --trees-file-icon-color,
712
+ var(--trees-icon-orange)
713
+ );
714
+ --trees-file-icon-color-zip: var(
715
+ --trees-file-icon-color,
716
+ var(--trees-icon-orange)
717
+ );
718
+
719
+ --trees-level-gap: var(
720
+ --trees-level-gap-override,
721
+ calc(8px * var(--trees-density))
722
+ );
723
+ --trees-item-padding-x: var(
724
+ --trees-item-padding-x-override,
725
+ calc(8px * var(--trees-density))
726
+ );
727
+ --trees-item-margin-x: var(
728
+ --trees-item-margin-x-override,
729
+ calc(2px * var(--trees-density))
730
+ );
731
+ --trees-item-row-gap: var(
732
+ --trees-item-row-gap-override,
733
+ calc(6px * var(--trees-density))
734
+ );
735
+ --trees-icon-width: var(--trees-icon-width-override, 16px);
736
+ --trees-icon-nudge: var(
737
+ --trees-icon-nudge-override,
738
+ calc(1px * var(--trees-density))
739
+ );
740
+ --trees-row-height: var(--trees-item-height, 30px);
741
+ --trees-git-lane-width: var(--trees-git-lane-width-override, 12px);
742
+ --trees-action-lane-width: var(
743
+ --trees-action-lane-width-override,
744
+ calc(var(--trees-icon-width) + 2px)
745
+ );
746
+ /* Keep the floating trigger aligned with the row's action lane. Going in
747
+ from the root's right edge: the scroll container reserves
748
+ \`--trees-padding-inline\` of effective inset on each side (its asymmetric
749
+ padding formula cancels the scrollbar gutter on the right), the row
750
+ sits inside that inset, and its trailing \`--trees-item-padding-x\` is the
751
+ action lane itself. The trigger's own focus-ring margin then trims one
752
+ pixel back so the button's visible right edge lines up with the lane. */
753
+ --trees-context-menu-trigger-inline-offset: calc(
754
+ var(--trees-padding-inline) + var(--trees-item-padding-x) -
755
+ var(--trees-focus-ring-width)
756
+ );
757
+
758
+ --trees-scrollbar-gutter: var(--trees-scrollbar-gutter-override, 6px);
759
+ --trees-padding-inline: var(--trees-padding-inline-override, 16px);
760
+
761
+ color-scheme: light dark;
762
+ display: flex;
763
+ flex-direction: column;
764
+ font-size: var(--trees-font-size);
765
+ color: var(--trees-fg);
766
+ background-color: var(--trees-bg);
767
+ --truncate-marker-background-color: var(--trees-bg);
768
+ --truncate-marker-background-overlay-color: transparent;
769
+ font-family: var(--trees-font-family);
770
+ font-weight: var(--trees-font-weight-regular);
771
+ }
772
+
773
+ :host([data-file-tree-virtualized='true']) {
774
+ height: 100%;
775
+ overflow: hidden;
776
+ }
777
+
778
+ [data-file-tree-virtualized-wrapper='true'] {
779
+ height: 100%;
780
+ overflow: hidden;
781
+ display: flex;
782
+ flex-direction: column;
783
+ }
784
+
785
+ [data-file-tree-virtualized-root='true'] {
786
+ height: 100%;
787
+ display: flex;
788
+ flex-direction: column;
789
+ overflow: hidden;
790
+ }
791
+
792
+ [data-file-tree-virtualized-scroll='true'],
793
+ [data-file-tree-scrollbar-measure='true'] {
794
+ overflow-y: auto;
795
+ scrollbar-gutter: stable;
796
+
797
+ &::-webkit-scrollbar {
798
+ width: var(--trees-scrollbar-gutter);
799
+ height: var(--trees-scrollbar-gutter);
800
+ }
801
+
802
+ &::-webkit-scrollbar-track {
803
+ background: transparent;
804
+ }
805
+
806
+ &::-webkit-scrollbar-thumb {
807
+ background-color: var(--trees-scrollbar-thumb);
808
+ border: 1px solid transparent;
809
+ background-clip: content-box;
810
+ border-radius: calc(var(--trees-scrollbar-gutter) / 2);
811
+ }
812
+
813
+ &::-webkit-scrollbar-corner {
814
+ background-color: transparent;
815
+ }
816
+ }
817
+
818
+ /* These are styles for a temporarily generated element to measure the size
819
+ * of the scrollbar. It's intended to be somewhat similar in scrollbar style
820
+ * scope to the scrollable tree so \`--trees-scrollbar-gutter-measured\` is an
821
+ * accurate reflection of the size the scrollbar gutter takes up. */
822
+ [data-file-tree-scrollbar-measure='true'] {
823
+ position: absolute;
824
+ top: 0;
825
+ left: 0;
826
+ visibility: hidden;
827
+ pointer-events: none;
828
+ width: 100px;
829
+ height: 100px;
830
+ }
831
+
832
+ @supports (-moz-appearance: none) {
833
+ [data-file-tree-virtualized-scroll='true'],
834
+ [data-file-tree-scrollbar-measure='true'] {
835
+ scrollbar-width: thin;
836
+ scrollbar-color: var(--trees-scrollbar-thumb) transparent;
837
+ }
838
+ }
839
+
840
+ [data-file-tree-virtualized-scroll='true'] {
841
+ position: relative;
842
+ overflow-y: auto;
843
+ flex: 1 1 0;
844
+ min-height: 0;
845
+ padding-inline: max(
846
+ calc(var(--trees-padding-inline) - var(--trees-item-margin-x)),
847
+ 0px
848
+ )
849
+ /* NOTE(amadeus): We can assume that all Webkit based browser gutters
850
+ * will align to the value of '--trees-scrollbar-gutter', however if not, then
851
+ * \`--trees-scrollbar-gutter-measured\` should correct it. Mostly we are
852
+ * hoping to avoid SSR alignment jumps if possible. In non-SSR'd environments
853
+ * \`--trees-scrollbar-gutter-measured\` should always be immediately available.
854
+ */
855
+ max(
856
+ calc(
857
+ var(--trees-padding-inline) - var(--trees-item-margin-x) -
858
+ var(
859
+ --trees-scrollbar-gutter-measured,
860
+ var(--trees-scrollbar-gutter)
861
+ )
862
+ ),
863
+ 0px
864
+ );
865
+ }
866
+
867
+ @supports (-moz-appearance: none) {
868
+ [data-file-tree-virtualized-scroll='true'] {
869
+ padding-inline: max(
870
+ calc(var(--trees-padding-inline) - var(--trees-item-margin-x)),
871
+ 0px
872
+ )
873
+ /* NOTE(amadeus): However on Firefox it can vary a little bit, but most
874
+ * likely the majority of cases will default to a 0px width scrollbar lets
875
+ * inherit that first to avoid SSR jumps. In non-SSR'd environments
876
+ * \`--trees-scrollbar-gutter-measured\` should always be immediately available.
877
+ */
878
+ max(
879
+ calc(
880
+ var(--trees-padding-inline) - var(--trees-item-margin-x) -
881
+ var(--trees-scrollbar-gutter-measured, 0px)
882
+ ),
883
+ 0px
884
+ );
885
+ }
886
+ }
887
+
888
+ [data-file-tree-sticky-overlay='true'] {
889
+ position: sticky;
890
+ top: 0;
891
+ height: 0;
892
+ z-index: 4;
893
+ overflow: visible;
894
+ pointer-events: none;
895
+ }
896
+
897
+ /* The overlay DOM is kept populated even at scrollTop=0 so the browser has
898
+ * the rendered rows on hand the moment scrolling begins — otherwise the
899
+ * compositor paints a scrolled frame before React can mount the overlay,
900
+ * and the topmost sticky folder jumps up by a couple of pixels before it
901
+ * "snaps" into its pinned position. We hide it via CSS whenever the scroll
902
+ * is at the top and no scroll is in progress, so the preview doesn't leak
903
+ * through at rest. \`data-overlay-reveal\` is stamped on the root only when
904
+ * the user initiates a scroll while already at the top — exactly the case
905
+ * where we need the pre-mounted overlay to be visible through the first
906
+ * compositor frame. It is deliberately distinct from the general
907
+ * \`data-is-scrolling\` flag so a scroll that ends at the top (e.g. ArrowUp
908
+ * navigation) re-hides the overlay the instant the scroll lands, rather
909
+ * than waiting for the hover-suppression timer to elapse. */
910
+ [data-file-tree-virtualized-root='true'][data-scroll-at-top='true']:not(
911
+ [data-overlay-reveal]
912
+ )
913
+ [data-file-tree-sticky-overlay='true'] {
914
+ visibility: hidden;
915
+ }
916
+
917
+ [data-file-tree-sticky-overlay-content='true'] {
918
+ background-color: var(--trees-bg);
919
+ position: relative;
920
+ pointer-events: none;
921
+ }
922
+
923
+ [data-file-tree-virtualized-list='true'] {
924
+ background-color: var(--trees-bg);
925
+ position: relative;
926
+ min-height: 100%;
927
+ width: 100%;
928
+ overflow-anchor: none;
929
+
930
+ &[data-is-scrolling] {
931
+ pointer-events: none;
932
+ }
933
+ }
934
+
935
+ [data-file-tree-virtualized-sticky-offset='true'] {
936
+ contain: layout size;
937
+ }
938
+
939
+ [data-file-tree-virtualized-sticky='true'] {
940
+ position: sticky;
941
+ top: 0;
942
+ width: 100%;
943
+ display: flex;
944
+ flex-direction: column;
945
+ isolation: isolate;
946
+ /* Promote to its own compositor layer so text inside the window is
947
+ * rasterized once and GPU-translated during scroll. Without this, the
948
+ * browser re-paints the window (and its text) at every scroll frame,
949
+ * which produces visible 1px shake / character tearing. */
950
+ will-change: transform;
951
+ }
952
+
953
+ [data-file-tree-search-container] {
954
+ display: flex;
955
+ padding: 0;
956
+ padding-inline: var(--trees-padding-inline);
957
+ margin-bottom: var(--trees-item-row-gap);
958
+ }
959
+
960
+ [data-file-tree-search-input] {
961
+ --trees-focus-ring-width: 2px;
962
+ font-family: var(--trees-font-family);
963
+ font-size: var(--trees-font-size);
964
+ flex: 1;
965
+ height: var(--trees-row-height);
966
+ /* 1px breathing room so the focus-visible outline isn't clipped when the
967
+ * input sits flush against the top of the scroll container. */
968
+ margin-block: 1px;
969
+ padding-inline: var(--trees-item-padding-x);
970
+ line-height: var(--trees-row-height);
971
+ color: var(--trees-search-fg);
972
+ background-color: var(--trees-search-bg);
973
+ border: 1px solid var(--trees-border-color);
974
+ border-radius: var(--trees-border-radius);
975
+ outline: none;
976
+
977
+ &::placeholder {
978
+ color: color-mix(
979
+ in lab,
980
+ var(--trees-search-fg) 65%,
981
+ var(--trees-search-bg)
982
+ );
983
+ }
984
+
985
+ &:focus-visible,
986
+ &[data-file-tree-search-input-fake-focus='true'] {
987
+ outline: var(--trees-focus-ring-width) solid var(--trees-focus-ring-color);
988
+ outline-offset: var(--trees-focus-ring-offset);
989
+ }
990
+ }
991
+
992
+ /* The wrapper for the tree items */
993
+ [role='tree'] {
994
+ position: relative;
995
+ display: flex;
996
+ flex-direction: column;
997
+ gap: var(--trees-gap-override, 0);
998
+ }
999
+
1000
+ /* LIST ITEM */
1001
+ [data-type='item'] {
1002
+ color: inherit;
1003
+ font-family: var(--trees-font-family);
1004
+ font-size: var(--trees-font-size);
1005
+ text-align: start;
1006
+ outline: none;
1007
+ background-color: var(--trees-bg);
1008
+ border: none;
1009
+ position: relative;
1010
+
1011
+ padding: 0 var(--trees-item-padding-x);
1012
+ margin: 0 var(--trees-item-margin-x);
1013
+ cursor: pointer;
1014
+ -webkit-user-select: none;
1015
+ user-select: none;
1016
+ -webkit-touch-callout: none;
1017
+ touch-action: manipulation;
1018
+ display: flex;
1019
+ flex: 0 0 var(--trees-row-height);
1020
+ align-items: center;
1021
+ height: var(--trees-row-height);
1022
+ line-height: var(--trees-row-height);
1023
+ gap: var(--trees-item-row-gap);
1024
+ border-radius: var(--trees-border-radius);
1025
+ /* Row states may be translucent, so markers paint the tree background first
1026
+ * and then the state color on top to avoid compositing the same alpha twice. */
1027
+ --truncate-marker-background-color: var(--trees-bg);
1028
+ --truncate-marker-background-overlay-color: transparent;
1029
+ --truncate-marker-block-inset: 0px;
1030
+
1031
+ &:hover,
1032
+ &[data-item-context-hover='true'] {
1033
+ background-color: var(--trees-bg-muted);
1034
+ --truncate-marker-background-overlay-color: var(--trees-bg-muted);
1035
+ }
1036
+
1037
+ &[data-item-focused='true'],
1038
+ &:focus-visible {
1039
+ z-index: 2;
1040
+
1041
+ /* Flattened segment markers sit high enough to cover the row outline unless
1042
+ * their painted background is inset by the focus ring width. */
1043
+ [data-item-flattened-subitems] {
1044
+ --truncate-marker-block-inset: var(--trees-focus-ring-width);
1045
+ }
1046
+
1047
+ &::before {
1048
+ position: absolute;
1049
+ inset: 0;
1050
+ content: '';
1051
+ display: block;
1052
+ border-radius: var(--trees-border-radius);
1053
+ outline: var(--trees-focus-ring-width) solid
1054
+ var(--trees-focus-ring-color);
1055
+ outline-offset: var(--trees-focus-ring-offset);
1056
+ pointer-events: none;
1057
+ }
1058
+
1059
+ &[data-item-selected='true']::before {
1060
+ outline-color: var(--trees-selected-focused-border-color);
1061
+ }
1062
+ }
1063
+
1064
+ &[data-item-selected='true'] {
1065
+ color: var(--trees-selected-fg);
1066
+ background-color: var(--trees-selected-bg);
1067
+ --truncate-marker-background-overlay-color: var(--trees-selected-bg);
1068
+ z-index: 3;
1069
+
1070
+ [data-item-section='icon'] {
1071
+ color: var(--trees-selected-fg);
1072
+ }
1073
+ }
1074
+
1075
+ &[data-item-search-match='true'] {
1076
+ font-weight: var(--trees-search-font-weight);
1077
+ }
1078
+ }
1079
+
1080
+ [data-type='item'][data-file-tree-sticky-row='true'] {
1081
+ pointer-events: auto;
1082
+ }
1083
+
1084
+ /* Sticky rows opt back into pointer events because the overlay wrapper is
1085
+ * inert. During scroll, put them back under the same hover suppression as
1086
+ * the virtualized list so translucent hover states and menu triggers do not
1087
+ * paint over rows moving beneath the sticky stack. */
1088
+ [data-file-tree-virtualized-root='true'][data-is-scrolling]
1089
+ [data-type='item'][data-file-tree-sticky-row='true'] {
1090
+ pointer-events: none;
1091
+ }
1092
+
1093
+ [data-file-tree-virtualized-root='true'][data-is-scrolling]
1094
+ [data-type='item'][data-file-tree-sticky-row='true']:hover:not(
1095
+ [data-item-selected='true']
1096
+ ),
1097
+ [data-file-tree-virtualized-root='true'][data-is-scrolling]
1098
+ [data-type='item'][data-file-tree-sticky-row='true'][data-item-context-hover='true']:not(
1099
+ [data-item-selected='true']
1100
+ ) {
1101
+ background-color: var(--trees-bg);
1102
+ --truncate-marker-background-overlay-color: transparent;
1103
+ }
1104
+
1105
+ [data-item-selected='true']:has(+ [data-item-selected='true']) {
1106
+ border-bottom-left-radius: 0;
1107
+ border-bottom-right-radius: 0;
1108
+ }
1109
+
1110
+ [data-item-selected='true'] + [data-item-selected='true'] {
1111
+ border-top-left-radius: 0;
1112
+ border-top-right-radius: 0;
1113
+ }
1114
+
1115
+ /* Flattened Directory Parts */
1116
+ [data-item-flattened-subitems] {
1117
+ display: inline-flex;
1118
+ align-items: center;
1119
+ gap: 2px;
1120
+ }
1121
+ [data-item-flattened-subitem]:hover,
1122
+ [data-item-flattened-subitem-drag-target='true'] {
1123
+ text-decoration: underline;
1124
+ }
1125
+
1126
+ /* Icon for each item */
1127
+ [data-item-section='icon'] {
1128
+ flex-shrink: 0;
1129
+ display: flex;
1130
+ align-items: center;
1131
+ justify-content: center;
1132
+ color: var(--trees-fg-muted);
1133
+ fill: currentColor;
1134
+ width: var(--trees-icon-width);
1135
+ }
1136
+
1137
+ :where([data-item-section='icon'] > [data-icon-token]) {
1138
+ color: var(--trees-fg-muted);
1139
+ }
1140
+
1141
+ [data-file-tree-colored-icons='true'] {
1142
+ [data-icon-token='astro'] {
1143
+ color: var(--trees-file-icon-color-astro);
1144
+ }
1145
+ [data-icon-token='babel'] {
1146
+ color: var(--trees-file-icon-color-babel);
1147
+ }
1148
+ [data-icon-token='bash'] {
1149
+ color: var(--trees-file-icon-color-bash);
1150
+ }
1151
+ [data-icon-token='biome'] {
1152
+ color: var(--trees-file-icon-color-biome);
1153
+ }
1154
+ [data-icon-token='bootstrap'] {
1155
+ color: var(--trees-file-icon-color-bootstrap);
1156
+ }
1157
+ [data-icon-token='browserslist'] {
1158
+ color: var(--trees-file-icon-color-browserslist);
1159
+ }
1160
+ [data-icon-token='bun'] {
1161
+ color: var(--trees-file-icon-color-bun);
1162
+ }
1163
+ [data-icon-token='claude'] {
1164
+ color: var(--trees-file-icon-color-claude);
1165
+ }
1166
+ [data-icon-token='css'] {
1167
+ color: var(--trees-file-icon-color-css);
1168
+ }
1169
+ [data-icon-token='database'] {
1170
+ color: var(--trees-file-icon-color-database);
1171
+ }
1172
+ [data-icon-token='default'] {
1173
+ color: var(--trees-file-icon-color-default);
1174
+ }
1175
+ [data-icon-token='docker'] {
1176
+ color: var(--trees-file-icon-color-docker);
1177
+ }
1178
+ [data-icon-token='eslint'] {
1179
+ color: var(--trees-file-icon-color-eslint);
1180
+ }
1181
+ [data-icon-token='git'] {
1182
+ color: var(--trees-file-icon-color-git);
1183
+ }
1184
+ [data-icon-token='go'] {
1185
+ color: var(--trees-file-icon-color-go);
1186
+ }
1187
+ [data-icon-token='graphql'] {
1188
+ color: var(--trees-file-icon-color-graphql);
1189
+ }
1190
+ [data-icon-token='html'] {
1191
+ color: var(--trees-file-icon-color-html);
1192
+ }
1193
+ [data-icon-token='image'] {
1194
+ color: var(--trees-file-icon-color-image);
1195
+ }
1196
+ [data-icon-token='javascript'] {
1197
+ color: var(--trees-file-icon-color-javascript);
1198
+ }
1199
+ [data-icon-token='json'] {
1200
+ color: var(--trees-file-icon-color-json);
1201
+ }
1202
+ [data-icon-token='markdown'] {
1203
+ color: var(--trees-file-icon-color-markdown);
1204
+ }
1205
+ [data-icon-token='mcp'] {
1206
+ color: var(--trees-file-icon-color-mcp);
1207
+ }
1208
+ [data-icon-token='npm'] {
1209
+ color: var(--trees-file-icon-color-npm);
1210
+ }
1211
+ [data-icon-token='oxc'] {
1212
+ color: var(--trees-file-icon-color-oxc);
1213
+ }
1214
+ [data-icon-token='postcss'] {
1215
+ color: var(--trees-file-icon-color-postcss);
1216
+ }
1217
+ [data-icon-token='prettier'] {
1218
+ color: var(--trees-file-icon-color-prettier);
1219
+ }
1220
+ [data-icon-token='python'] {
1221
+ color: var(--trees-file-icon-color-python);
1222
+ }
1223
+ [data-icon-token='react'] {
1224
+ color: var(--trees-file-icon-color-react);
1225
+ }
1226
+ [data-icon-token='ruby'] {
1227
+ color: var(--trees-file-icon-color-ruby);
1228
+ }
1229
+ [data-icon-token='rust'] {
1230
+ color: var(--trees-file-icon-color-rust);
1231
+ }
1232
+ [data-icon-token='sass'] {
1233
+ color: var(--trees-file-icon-color-sass);
1234
+ }
1235
+ [data-icon-token='svg'] {
1236
+ color: var(--trees-file-icon-color-svg);
1237
+ }
1238
+ [data-icon-token='svelte'] {
1239
+ color: var(--trees-file-icon-color-svelte);
1240
+ }
1241
+ [data-icon-token='svgo'] {
1242
+ color: var(--trees-file-icon-color-svgo);
1243
+ }
1244
+ [data-icon-token='swift'] {
1245
+ color: var(--trees-file-icon-color-swift);
1246
+ }
1247
+ [data-icon-token='table'] {
1248
+ color: var(--trees-file-icon-color-table);
1249
+ }
1250
+ [data-icon-token='text'] {
1251
+ color: var(--trees-file-icon-color-text);
1252
+ }
1253
+ [data-icon-token='tailwind'] {
1254
+ color: var(--trees-file-icon-color-tailwind);
1255
+ }
1256
+ [data-icon-token='terraform'] {
1257
+ color: var(--trees-file-icon-color-terraform);
1258
+ }
1259
+ [data-icon-token='typescript'] {
1260
+ color: var(--trees-file-icon-color-typescript);
1261
+ }
1262
+ [data-icon-token='vite'] {
1263
+ color: var(--trees-file-icon-color-vite);
1264
+ }
1265
+ [data-icon-token='vscode'] {
1266
+ color: var(--trees-file-icon-color-vscode);
1267
+ }
1268
+ [data-icon-token='vue'] {
1269
+ color: var(--trees-file-icon-color-vue);
1270
+ }
1271
+ [data-icon-token='wasm'] {
1272
+ color: var(--trees-file-icon-color-wasm);
1273
+ }
1274
+ [data-icon-token='webpack'] {
1275
+ color: var(--trees-file-icon-color-webpack);
1276
+ }
1277
+ [data-icon-token='yml'] {
1278
+ color: var(--trees-file-icon-color-yml);
1279
+ }
1280
+ [data-icon-token='zig'] {
1281
+ color: var(--trees-file-icon-color-zig);
1282
+ }
1283
+ [data-icon-token='zip'] {
1284
+ color: var(--trees-file-icon-color-zip);
1285
+ }
1286
+ }
1287
+
1288
+ /* Chevron rotation and visual alignment */
1289
+ /* Chevron pointing down */
1290
+ [data-icon-name='file-tree-icon-chevron'] {
1291
+ &[data-align-capitals='false'] {
1292
+ transform: translate(0, var(--trees-icon-nudge));
1293
+ }
1294
+ &[data-align-capitals='true'] {
1295
+ transform: translate(0, 0);
1296
+ }
1297
+ }
1298
+
1299
+ [data-item-section='content'] {
1300
+ flex: 0 1 auto;
1301
+ text-align: start;
1302
+ min-width: 0;
1303
+ max-width: 100%;
1304
+ overflow: hidden;
1305
+ text-overflow: ellipsis;
1306
+ /* Breaks middle truncate component to also set this */
1307
+ /* white-space: nowrap; */
1308
+ }
1309
+
1310
+ [data-item-section='decoration'] {
1311
+ flex: 1 1 0;
1312
+ min-width: 0;
1313
+ display: flex;
1314
+ justify-content: flex-end;
1315
+ text-align: end;
1316
+ overflow: hidden;
1317
+ color: var(--trees-fg-muted);
1318
+ }
1319
+
1320
+ [data-item-section='decoration'] > span {
1321
+ min-width: 0;
1322
+ max-width: 100%;
1323
+ display: inline-flex;
1324
+ align-items: center;
1325
+ justify-content: flex-end;
1326
+ overflow: hidden;
1327
+ text-overflow: ellipsis;
1328
+ white-space: nowrap;
1329
+ }
1330
+
1331
+ [data-item-section='git'],
1332
+ [data-item-section='action'] {
1333
+ flex: 0 0 auto;
1334
+ display: flex;
1335
+ align-items: center;
1336
+ justify-content: center;
1337
+ }
1338
+
1339
+ [data-item-section='git'] {
1340
+ width: var(--trees-git-lane-width);
1341
+ }
1342
+
1343
+ [data-item-section='action'] {
1344
+ width: var(--trees-action-lane-width);
1345
+ color: var(--trees-fg-muted);
1346
+ fill: currentColor;
1347
+ pointer-events: none;
1348
+ }
1349
+
1350
+ [data-item-section='git'] > span,
1351
+ [data-item-section='action'] > span {
1352
+ width: 100%;
1353
+ display: inline-flex;
1354
+ align-items: center;
1355
+ justify-content: center;
1356
+ }
1357
+
1358
+ [data-item-action-affordance='decorative'] {
1359
+ opacity: 0.85;
1360
+ }
1361
+
1362
+ [data-item-rename-input] {
1363
+ appearance: none;
1364
+ width: 100%;
1365
+ min-width: 0;
1366
+ height: calc(var(--trees-row-height) - 4px);
1367
+ font-family: inherit;
1368
+ font-size: inherit;
1369
+ /* line-height: calc(var(--trees-row-height) - 8px); */
1370
+ color: inherit;
1371
+ background-color: transparent;
1372
+ border: 0;
1373
+ padding-inline: 6px;
1374
+ outline: none;
1375
+ box-sizing: border-box;
1376
+ }
1377
+
1378
+ [data-item-section='content']:has([data-item-rename-input])
1379
+ ~ [data-item-section='action'],
1380
+ [data-item-section='content']:has([data-item-rename-input])
1381
+ ~ [data-item-section='decoration'] {
1382
+ display: none;
1383
+ }
1384
+
1385
+ /* Chevron pointing right */
1386
+ [aria-expanded='false'][data-item-type='folder']
1387
+ > [data-item-section='icon']
1388
+ > [data-icon-name='file-tree-icon-chevron'] {
1389
+ &[data-align-capitals='true'] {
1390
+ transform: rotate(-90deg)
1391
+ translate(
1392
+ calc(var(--trees-icon-nudge) / 2),
1393
+ calc(var(--trees-icon-nudge) / 2)
1394
+ );
1395
+ }
1396
+ &[data-align-capitals='false'] {
1397
+ transform: rotate(-90deg)
1398
+ translate(
1399
+ calc(var(--trees-icon-nudge) / 2 * -1),
1400
+ calc(var(--trees-icon-nudge) / 2)
1401
+ );
1402
+ }
1403
+ }
1404
+
1405
+ /* LIST IDENTATION */
1406
+ /* Spacing container */
1407
+ [data-item-section='spacing'] {
1408
+ display: flex;
1409
+ flex-direction: row;
1410
+ align-items: center;
1411
+ justify-content: center;
1412
+ height: var(--trees-row-height);
1413
+ padding-left: calc(calc(var(--trees-icon-width) / 2) - 0.5px);
1414
+
1415
+ &:empty {
1416
+ padding-left: 0;
1417
+ }
1418
+ }
1419
+
1420
+ /* Spacing per level */
1421
+ [data-item-section='spacing-item'] {
1422
+ transform: translateX(-0.25px);
1423
+ display: inline-block;
1424
+ border-left: 1px solid var(--trees-indent-guide-bg);
1425
+ height: 100%;
1426
+ margin-right: calc(var(--trees-level-gap) - 1px);
1427
+ opacity: 0;
1428
+ transition: opacity 150ms ease;
1429
+
1430
+ & + & {
1431
+ margin-left: calc(
1432
+ var(--trees-item-row-gap) + calc(var(--trees-icon-width) / 2) - 0.5px
1433
+ );
1434
+ }
1435
+ }
1436
+
1437
+ :host(:hover) [data-item-section='spacing-item'] {
1438
+ opacity: 0.75;
1439
+ }
1440
+
1441
+ /* Git status indicator */
1442
+
1443
+ /* This is a folder that contains a git change */
1444
+ [data-item-contains-git-change='true'] > [data-item-section='git'] {
1445
+ color: var(--trees-git-modified-color);
1446
+ opacity: 0.5;
1447
+ fill: currentColor;
1448
+ }
1449
+
1450
+ /* These are files that have a git change */
1451
+ [data-item-git-status] {
1452
+ &
1453
+ > :where([data-item-section='icon'])
1454
+ > :where(:not([data-icon-name='file-tree-icon-chevron'])) {
1455
+ color: var(--trees-item-git-status-color);
1456
+ }
1457
+ & > [data-item-section='content'] {
1458
+ color: var(--trees-item-git-status-color);
1459
+ }
1460
+ & > [data-item-section='git'] {
1461
+ color: var(--trees-item-git-status-color);
1462
+ font-weight: var(--trees-font-weight-semibold);
1463
+ }
1464
+ }
1465
+
1466
+ [data-item-git-status='added'] {
1467
+ --trees-item-git-status-color: var(--trees-git-added-color);
1468
+ }
1469
+
1470
+ [data-item-git-status='deleted'] {
1471
+ --trees-item-git-status-color: var(--trees-git-deleted-color);
1472
+ }
1473
+
1474
+ [data-item-git-status='ignored'] {
1475
+ --trees-item-git-status-color: var(--trees-git-ignored-color);
1476
+
1477
+ & > [data-item-section='icon'] {
1478
+ opacity: 0.5;
1479
+ }
1480
+ }
1481
+
1482
+ [data-item-section='git'] [data-icon-name='file-tree-icon-dot'] {
1483
+ /* this is a nudge to align the dot with the likely lowercase text. it's slightly
1484
+ generalizable, but other fonts are gonna need other nudges i assume */
1485
+ transform: translateY(calc(0.65ex - 50%));
1486
+ }
1487
+
1488
+ [data-item-git-status='modified'] {
1489
+ --trees-item-git-status-color: var(--trees-git-modified-color);
1490
+ }
1491
+
1492
+ [data-item-git-status='renamed'] {
1493
+ --trees-item-git-status-color: var(--trees-git-renamed-color);
1494
+ }
1495
+
1496
+ [data-item-git-status='untracked'] {
1497
+ --trees-item-git-status-color: var(--trees-git-untracked-color);
1498
+ }
1499
+
1500
+ /* Drag and drop */
1501
+ [data-item-drag-target='true'] {
1502
+ background-color: var(--trees-selected-bg);
1503
+ }
1504
+
1505
+ [data-item-dragging='true'] {
1506
+ opacity: 0.5;
1507
+ }
1508
+
1509
+ /* Lock icon for locked paths (sibling of content) */
1510
+ [data-item-section='lock'] {
1511
+ flex: 0 0 auto;
1512
+ margin-left: auto;
1513
+ display: flex;
1514
+ align-items: center;
1515
+ color: var(--trees-fg-muted);
1516
+ }
1517
+ [data-item-section='lock'] svg {
1518
+ display: block;
1519
+ }
1520
+
1521
+ [data-type='header-slot'] {
1522
+ display: block;
1523
+ flex: 0 0 auto;
1524
+ }
1525
+
1526
+ [data-type='context-menu-wash'] {
1527
+ position: absolute;
1528
+ inset: 0;
1529
+ z-index: 3;
1530
+ background-color: transparent;
1531
+ touch-action: none;
1532
+ }
1533
+
1534
+ [data-type='context-menu-anchor'] {
1535
+ position: absolute;
1536
+ top: 0;
1537
+ right: var(--trees-context-menu-trigger-inline-offset);
1538
+ z-index: 4;
1539
+ display: none;
1540
+ align-items: center;
1541
+
1542
+ &[data-visible='true'] {
1543
+ display: flex;
1544
+ }
1545
+ }
1546
+
1547
+ /* Hide the floating trigger while the scroll container is actively moving.
1548
+ * The anchor is positioned against the root, not the scroll content, so its
1549
+ * \`top\` follows the row via a React state update — one frame behind the
1550
+ * compositor. That delay is visible as the trigger hovering over the wrong
1551
+ * row during the first frame of a scroll. The \`data-is-scrolling\` flag on
1552
+ * the root is flipped synchronously on \`wheel\`/\`touchmove\`/\`keydown\` before
1553
+ * the compositor commits the next paint, so this selector hides the anchor
1554
+ * in the same frame the scroll begins. */
1555
+ [data-file-tree-virtualized-root='true'][data-is-scrolling]
1556
+ [data-type='context-menu-anchor'] {
1557
+ display: none;
1558
+ }
1559
+
1560
+ [data-type='context-menu-anchor'] > slot[name='context-menu'] {
1561
+ display: block;
1562
+ width: 0;
1563
+ min-width: 0;
1564
+ flex: 0 0 0;
1565
+ overflow: visible;
1566
+ }
1567
+
1568
+ /* Single floating context menu trigger */
1569
+ [data-type='context-menu-trigger'] {
1570
+ all: unset;
1571
+ align-items: center;
1572
+ justify-content: center;
1573
+ width: var(--trees-action-lane-width);
1574
+ color: var(--trees-fg-muted);
1575
+ fill: currentColor;
1576
+ cursor: pointer;
1577
+ font-family: var(--trees-font-family);
1578
+ font-size: var(--trees-font-size);
1579
+ border-top-right-radius: var(--trees-border-radius);
1580
+ border-bottom-right-radius: var(--trees-border-radius);
1581
+ margin: var(--trees-focus-ring-width);
1582
+ height: calc(var(--trees-row-height) - var(--trees-focus-ring-width) * 2);
1583
+ border-width: 0;
1584
+ transition: color 120ms ease;
1585
+
1586
+ display: flex;
1587
+ }
1588
+
1589
+ [data-type='context-menu-trigger']:hover,
1590
+ [data-type='context-menu-trigger'][aria-expanded='true'] {
1591
+ color: var(--trees-fg);
1592
+ }
1593
+
1594
+ /** @pierre/truncate css here, manually copy pasted for now */
1595
+ [data-truncate-container] {
1596
+ /* CUSTOM TO TREES, TO SUPPORT THE OUTLINE */
1597
+ margin-top: -1px;
1598
+ margin-bottom: -1px;
1599
+
1600
+ /* Width of the fade from default marker to text */
1601
+ --truncate-internal-marker-fade-width: var(
1602
+ --truncate-marker-fade-width,
1603
+ 2px
1604
+ );
1605
+ /* Width of the solid color between the fade from the default marker to the text */
1606
+ --truncate-internal-marker-gap: var(--truncate-marker-gap, 0px);
1607
+ /* Opacity of the marker 'color' property, not of the element itself */
1608
+ --truncate-internal-marker-opacity: var(--truncate-marker-opacity, 50%);
1609
+ /* Opacity of the marker 'color' property specifically for the middle truncate, not opacity of the element itself */
1610
+ --truncate-internal-middle-marker-opacity: var(
1611
+ --truncate-middle-marker-opacity,
1612
+ 80%
1613
+ );
1614
+ /* Background color of the default marker */
1615
+ --truncate-internal-marker-background-color: var(
1616
+ --truncate-marker-background-color,
1617
+ light-dark(white, black)
1618
+ );
1619
+ --truncate-internal-marker-background-overlay-color: var(
1620
+ --truncate-marker-background-overlay-color,
1621
+ transparent
1622
+ );
1623
+ --truncate-internal-marker-block-inset: var(
1624
+ --truncate-marker-block-inset,
1625
+ 0px
1626
+ );
1627
+ /* Duration of the fade out animation for the marker */
1628
+ --truncate-internal-marker-fade-out-duration: var(
1629
+ --truncate-marker-fade-out-duration,
1630
+ 0ms
1631
+ );
1632
+ /* Duration of the fade in animation for the marker */
1633
+ --truncate-internal-marker-fade-in-duration: var(
1634
+ --truncate-marker-fade-in-duration,
1635
+ 100ms
1636
+ );
1637
+
1638
+ /* FADE Variant specifics */
1639
+ --truncate-internal-fade-marker-color: var(
1640
+ --truncate-fade-marker-color,
1641
+ #000
1642
+ );
1643
+ --truncate-internal-fade-marker-width: var(
1644
+ --truncate-fade-marker-width,
1645
+ 0.2lh
1646
+ );
1647
+
1648
+ /*
1649
+ In some special cases people might be adding spacing in other ways
1650
+ that would benefit from being able to override this, however the container
1651
+ query below can't use this and would need to be redeclared with the overridden
1652
+ value. It's a bad time, but better than nothing.
1653
+ */
1654
+ --truncate-internal-single-line-height: 1lh;
1655
+
1656
+ height: var(--truncate-internal-single-line-height);
1657
+ min-width: 0;
1658
+ overflow: hidden;
1659
+ }
1660
+
1661
+ [data-truncate-marker] {
1662
+ display: flex;
1663
+ position: absolute;
1664
+ height: var(--truncate-internal-single-line-height);
1665
+ padding-block: var(--truncate-internal-marker-block-inset);
1666
+ box-sizing: border-box;
1667
+ align-items: center;
1668
+ background-clip: content-box;
1669
+ z-index: 2;
1670
+ color: color-mix(
1671
+ in srgb,
1672
+ currentColor var(--truncate-internal-marker-opacity),
1673
+ transparent
1674
+ );
1675
+
1676
+ /* Core trick for hiding the marker until overflow occurs */
1677
+ opacity: 0;
1678
+ transition: opacity var(--truncate-internal-marker-fade-out-duration)
1679
+ ease-in-out;
1680
+ }
1681
+
1682
+ @container measure (height > 1lh) {
1683
+ [data-truncate-marker] {
1684
+ opacity: 1;
1685
+ transition: opacity var(--truncate-internal-marker-fade-in-duration)
1686
+ ease-in-out;
1687
+ }
1688
+ }
1689
+
1690
+ [data-truncate-grid] {
1691
+ display: grid;
1692
+ position: relative;
1693
+ }
1694
+
1695
+ [data-truncate-content='visible'] {
1696
+ white-space: nowrap;
1697
+ }
1698
+
1699
+ [data-truncate-content='overflow'] {
1700
+ opacity: 0;
1701
+ pointer-events: none;
1702
+ -webkit-user-select: none;
1703
+ user-select: none;
1704
+ word-break: break-all;
1705
+ margin-top: calc(-1 * var(--truncate-internal-single-line-height));
1706
+ }
1707
+
1708
+ [data-truncate-marker-cell] {
1709
+ container: measure / size;
1710
+ overflow: visible;
1711
+ -webkit-user-select: none;
1712
+ user-select: none;
1713
+ pointer-events: none;
1714
+ }
1715
+
1716
+ [data-truncate-container='truncate'] {
1717
+ & [data-truncate-grid] {
1718
+ grid-template-columns: minmax(0, max-content) 0;
1719
+ }
1720
+ & [data-truncate-marker] {
1721
+ right: 0;
1722
+ }
1723
+ & [data-truncate-fade] {
1724
+ margin-right: calc(-2 * var(--truncate-internal-fade-marker-width));
1725
+ }
1726
+ }
1727
+
1728
+ [data-truncate-container='fruncate'] {
1729
+ & [data-truncate-grid] {
1730
+ grid-template-columns: 0 minmax(0, max-content) auto;
1731
+ }
1732
+ & [data-truncate-content] {
1733
+ direction: rtl;
1734
+ }
1735
+ & [data-truncate-content] > span {
1736
+ unicode-bidi: plaintext;
1737
+ }
1738
+ & [data-truncate-fade] {
1739
+ margin-left: calc(-2 * var(--truncate-internal-fade-marker-width));
1740
+ }
1741
+ }
1742
+
1743
+ [data-truncate-variant='default'] {
1744
+ & [data-truncate-marker] {
1745
+ background-color: var(--truncate-internal-marker-background-color);
1746
+ background-image: linear-gradient(
1747
+ var(--truncate-internal-marker-background-overlay-color),
1748
+ var(--truncate-internal-marker-background-overlay-color)
1749
+ );
1750
+ }
1751
+ & [data-truncate-marker]::after,
1752
+ & [data-truncate-marker]::before {
1753
+ content: '';
1754
+ position: absolute;
1755
+ width: calc(
1756
+ var(--truncate-internal-marker-fade-width) +
1757
+ var(--truncate-internal-marker-gap)
1758
+ );
1759
+ inset-block-start: var(--truncate-internal-marker-block-inset);
1760
+ height: max(
1761
+ 0px,
1762
+ calc(
1763
+ var(--truncate-internal-single-line-height) -
1764
+ var(--truncate-internal-marker-block-inset) * 2
1765
+ )
1766
+ );
1767
+ background-color: var(--truncate-internal-marker-background-color);
1768
+ background-image: linear-gradient(
1769
+ var(--truncate-internal-marker-background-overlay-color),
1770
+ var(--truncate-internal-marker-background-overlay-color)
1771
+ );
1772
+ mask-image: linear-gradient(
1773
+ var(--truncate-internal-fade-dir),
1774
+ #000 0%,
1775
+ #000 var(--truncate-internal-marker-gap),
1776
+ transparent 100%
1777
+ );
1778
+ }
1779
+ & [data-truncate-marker]::after {
1780
+ --truncate-internal-fade-dir: to right;
1781
+ right: calc(
1782
+ -1 *
1783
+ (
1784
+ var(--truncate-internal-marker-fade-width) +
1785
+ var(--truncate-internal-marker-gap)
1786
+ )
1787
+ );
1788
+ }
1789
+ & [data-truncate-marker]::before {
1790
+ --truncate-internal-fade-dir: to left;
1791
+ left: calc(
1792
+ -1 *
1793
+ (
1794
+ var(--truncate-internal-marker-fade-width) +
1795
+ var(--truncate-internal-marker-gap)
1796
+ )
1797
+ );
1798
+ }
1799
+ }
1800
+
1801
+ [data-truncate-variant='fade'] {
1802
+ & [data-truncate-marker] {
1803
+ background: transparent;
1804
+ }
1805
+ }
1806
+
1807
+ [data-truncate-fade] {
1808
+ box-shadow:
1809
+ 0 0 calc(var(--truncate-internal-fade-marker-width) / 2)
1810
+ var(--truncate-internal-fade-marker-color),
1811
+ 0 0 var(--truncate-internal-fade-marker-width)
1812
+ var(--truncate-internal-fade-marker-color);
1813
+ width: calc(var(--truncate-internal-fade-marker-width) * 2);
1814
+ height: calc(
1815
+ var(--truncate-internal-single-line-height) -
1816
+ (var(--truncate-internal-fade-marker-width) * 2)
1817
+ );
1818
+ margin: var(--truncate-internal-fade-marker-width) 0;
1819
+ }
1820
+
1821
+ [data-truncate-group-container='middle'] {
1822
+ & [data-truncate-container] {
1823
+ --truncate-marker-opacity: var(--truncate-internal-middle-marker-opacity);
1824
+ }
1825
+
1826
+ display: flex;
1827
+ min-width: 0;
1828
+
1829
+ & > div {
1830
+ min-width: 0;
1831
+ }
1832
+
1833
+ & > div[data-truncate-segment-priority='1'] {
1834
+ flex: 0 1 max-content;
1835
+ }
1836
+ & > div[data-truncate-segment-priority='2'] {
1837
+ flex: 0 999999 max-content;
1838
+ }
1839
+ }
1840
+ }
1841
+ `,JB=`@layer base, unsafe;`;function YB(e){return`${JB}
1842
+ @layer base {
1843
+ ${e}
1844
+ }`}function XB(e){return`${JB}
1845
+ @layer unsafe {
1846
+ ${e}
1847
+ }`}var ZB=new WeakMap;function QB(e){let t=ZB.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(GI,`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(),ZB.set(e,i),i}function $B(e,t){if(!e.isConnected)return;let n=QB(t);if(n==null)return;let r=t.querySelector(`style[${KI}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(KI,``),t.appendChild(i)),i.textContent=`:host { ${qI}: ${n}px; }`}var eV;function tV(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){eV??(eV=new CSSStyleSheet,eV.replaceSync(YB(qB)));let t=!1;try{e.adoptedStyleSheets=[eV],t=!0}catch{}if(t){e.querySelector(`style[${UI}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(UI,``),t.textContent=YB(qB),e.prepend(t)}}function nV(e,t){rV(e,t),tV(t),$B(e,t)}function rV(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`});nV(this,e)}}if(customElements.define(HI,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(HI)))e instanceof HTMLElement&&nV(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var iV=e=>e.startsWith(`f::`)?e.slice(3):e;function aV(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function oV(e,t){return e===``?t:`${e}/${t}`}function sV({files:e,path:t,isFolder:n,nextBasename:r}){let i=iV(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}=aV(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=oV(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 cV(e){return e.endsWith(`/`)}function lV(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 uV(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 dV(e,t){return t.includes(e)?uV(t):[e]}function fV(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 pV(e,t){return{draggedPaths:e,target:t}}function mV(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(cV(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function hV(e,t){return t.kind===`root`||t.directoryPath==null?lV(e):t.directoryPath}function gV(e,t){let n=e.map(e=>{let n=hV(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 _V=Symbol(`FILE_TREE_RENAME_VIEW`);function vV(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}var yV=512,bV=512;function xV(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function SV(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 CV(e){return SV(e).at(-1)??null}function wV(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}var TV=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},EV=e=>e.toLowerCase();function DV(e){return e.endsWith(`/`)}function OV(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function kV(e){return e.endsWith(`/`)?e.slice(0,-1):e}function AV(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}function jV(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 MV(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function NV(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 MV(e,t.path)?n?e:null:e;case`move`:return jV(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=NV(r,e,n),r==null)return null;return r}}}function PV(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function FV(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 IV(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(!FV(HB.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 LV(e){switch(e.operation){case`add`:return{...PV(e),operation:`add`,path:e.path};case`remove`:return{...PV(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...PV(e),from:e.from,operation:`move`,to:e.to}}}function RV(e){return{...PV(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>LV(e)),operation:`batch`}}function zV(e){switch(e.operation){case`add`:case`remove`:case`move`:return LV(e);case`batch`:return RV(e);default:return null}}function BV(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=SV(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 VV(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:BV(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var HV=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=IV({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=CV(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<=bV){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=dV(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=pV(t.draggedPaths,n);(mV(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}fV(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=pV(e.draggedPaths,t);if(mV(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#we(),!1;let r=gV(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=DV(r),a=kV(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of SV(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=OV(r),this.#D=t.removeIfCanceled??!1,this.#we(),!0}[_V](){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,DV(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,DV(e)?{recursive:!0}:void 0);return}let t=DV(e),n=sV({files:this.#B.list(),isFolder:t,nextBasename:this.#E,path:kV(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(AV(n.sourcePath,t),AV(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=IV({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=!xV(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=CV(e),n=wV(e,t),r=null,i=null;for(let e of this.#ve()){if(CV(e)!==t)continue;let a=wV(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=SV(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=!xV(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 HB({...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 SV(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#ue(){return this.#g??=this.#ce().map(EV),this.#g}#de(){return this.#f??=this.#le().filter(e=>e.endsWith(`/`)),this.#f}#fe(){return this.#p??=this.#de().map(EV),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 SV(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:TV(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 SV(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 SV(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=VV(this.#B.getVisibleTreeProjectionData(t?void 0:Math.min(n,yV)),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=NV(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=NV(this.#c,e,!0),r=[...this.#R].map(t=>NV(t,e)).filter(e=>e!=null).map(e=>this.#B.getPathInfo(e)?.path??null).filter(e=>e!=null),i=NV(this.#L,e),a=i==null?null:this.#B.getPathInfo(i)?.path??null,o=[...new Set(r)];return xV(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&&vV(e)&&(this.#i=null);let t=vV(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=zV(e);i!=null&&this.#Te(i)})}#Ie(e){if(this.#B.isExpanded(e)){this.#ne(e);return}this.#Ee(e)}},UV=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 WV(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 GV(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 KV(e,t){return t?`${e}/`:e}function qV(e,t=null){let n=UV(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=WV(t.path);if(e==null)continue;let n=KV(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 GV(e.path))i.add(t)}return{directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}var JV,YV,XV,ZV,QV,$V,eH,tH,nH,rH,iH={},aH=[],oH=Array.isArray,sH=aH.slice,cH=Object.assign;function lH(e){e&&e.parentNode&&e.remove()}function uH(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?sH.call(arguments,2):n),dH(e,o,r,i,null)}function dH(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??++YV,__i:-1,__u:0};return i==null&&JV.vnode!=null&&JV.vnode(a),a}function fH(e){return e.children}function pH(e,t){this.props=e,this.context=t,this.__g=0}function mH(e,t){if(t==null)return e.__?mH(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`?mH(e):null}function hH(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 hH(e)}}function gH(e){(8&e.__g||!(e.__g|=8)||!XV.push(e)||QV++)&&ZV==JV.debounceRendering||((ZV=JV.debounceRendering)||queueMicrotask)(_H)}function _H(){for(var e,t,n,r,i,a,o,s,c=1;XV.length;)XV.length>c&&XV.sort($V),e=XV.shift(),c=XV.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=cH({},r)).__v=r.__v+1,JV.vnode&&JV.vnode(n),TH(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??mH(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,DH(a,n,o),n.__e!=i&&hH(n)));QV=0}function vH(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||aH,b=t.length;for(c=yH(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?iH:y[m.__i]||iH,m.__i=f,_=TH(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&AH(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=bH(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function yH(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?dH(null,o,null,null,null):oH(o)?dH(fH,{children:o},null,null,null):o.constructor==null&&o.__b>0?dH(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=xH(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=mH(s)),jH(s,s));return r}function bH(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=bH(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=mH(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function xH(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 SH(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function CH(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||SH(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||SH(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(eH,`$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=tH,e.addEventListener(t,a?rH:nH,a)):e.removeEventListener(t,a?rH:nH,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 wH(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=tH++;else if(t.u<n.l)return;return n(JV.event?JV.event(t):t)}}}function TH(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=JV.__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 pH(v,x),f.constructor=M,f.render=MH),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=cH({},f.__s)),cH(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=JV.__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=cH({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===fH&&d.key==null&&(E=OH(d.props.children)),s=vH(e,oH(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--;)lH(a[j]);EH(t)}else t.__e=n.__e,t.__k=n.__k,e.then||EH(t);JV.__e(e,t,n)}else s=t.__e=kH(n.__e,t,n,r,i,a,o,c,l,u);return(d=JV.diffed)&&d(t),128&t.__u?void 0:s}function EH(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(EH)}function DH(e,t,n){for(var r=0;r<n.length;r++)AH(n[r],n[++r],n[++r]);JV.__c&&JV.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){JV.__e(e,t.__v)}})}function OH(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:oH(e)?e.map(OH):cH({},e)}function kH(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&&=(JV.__m&&JV.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=sH.call(e.childNodes),v=n.props||iH,!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;CH(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&&!_||CH(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=``),vH(b==`template`?e.content:e,oH(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&mH(n,0),s,c,l),a!=null)for(u=a.length;u--;)lH(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||CH(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&CH(e,u,g,v[u],i))}return e}function AH(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){JV.__e(e,n)}}function jH(e,t,n){var r,i;if(JV.unmount&&JV.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||AH(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){JV.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&jH(r[i],t,n||typeof e.type!=`function`);n||lH(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function MH(e,t,n){return this.constructor(e,n)}function NH(e,t){var n,r,i,a;t==document&&(t=document.documentElement),JV.__&&JV.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=uH(fH,null,[e]),i=[],a=[],TH(t,e,r||iH,iH,t.namespaceURI,r?null:t.firstChild?sH.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),DH(i,e,a)}function PH(e,t){e.__u|=32,NH(e,t)}JV={__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 QV=0,e}},YV=0,pH.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=cH({},this.state);typeof e==`function`&&(e=e(cH({},n),this.props)),e&&cH(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),gH(this))},pH.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),gH(this))},pH.prototype.render=fH,XV=[],QV=0,$V=function(e,t){return e.__v.__b-t.__v.__b},eH=/(PointerCapture)$|Capture$/i,tH=0,nH=wH(!1),rH=wH(!0);var FH=0;Array.isArray;function IH(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:--FH,__i:-1,__u:0,__source:i,__self:a};return JV.vnode&&JV.vnode(l),l}var LH=16,RH=16,zH={};function BH({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}=zH[e]??{width:LH,height:RH},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return IH(`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:IH(`use`,{href:c})})}var VH=e=>{if(e.length<2)return[e,``];let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]},HH=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)]},UH=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)]},WH=(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)]},GH=(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)]},KH=(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 qH({children:e,marker:t,variant:n=`default`}){"use no memo";return IH(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:IH(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?IH(`span`,{"data-truncate-fade":!0}):t})})}function JH(e){"use no memo";let{mode:t,children:n}=e;return IH(`div`,{children:[IH(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?IH(`span`,{children:n}):n}),IH(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?IH(`span`,{children:n}):n})]})}function YH({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=IH(JH,{mode:t,children:e},`content`),o=IH(qH,{marker:n,mode:t,variant:r},`marker`),s=IH(`div`,{"data-truncate-fill":!0},`fill`);return IH(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:IH(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function XH({children:e,...t}){"use no memo";return IH(YH,{mode:`truncate`,...t,children:e})}function ZH({children:e,...t}){"use no memo";return IH(YH,{mode:`fruncate`,...t,children:e})}function QH({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=IH(XH,{...s,children:t[0]}),l=IH(ZH,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return IH(`div`,{className:a,style:o});if(e.length<i)return IH(n===`end`?ZH:XH,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=VH:r===`extension`?t=HH:r===`leaf-path`&&(t=UH);else if(typeof r==`number`)t=WH,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=GH:e===`first`&&(t=KH)}else typeof r==`function`&&(t=r);t??=VH;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=IH(XH,{...s,..._,children:f}),l=IH(ZH,{...s,...v,children:p})}return IH(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[IH(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),IH(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var $H={endIndex:-1,startIndex:-1};function eU(e,t,n){return Math.min(Math.max(e,t),n)}function tU(e,t){return e<0||t<e?$H:{endIndex:t,startIndex:e}}function nU(e){return e.startIndex<0||e.endIndex<e.startIndex}function rU(e,t){return nU(e)?0:(e.endIndex-e.startIndex+1)*t}function iU(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function aU(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function oU(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 sU(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 cU(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 lU(e,t,n){if(e.length===0||t<=0)return[];let r=cU(e),i=oU(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=sU(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 uU(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=eU(t.scrollTop,0,o),c=t.stickyRows??lU(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=iU(s,n,t.itemHeight),m=iU(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?$H:tU(m,aU(u+d,n,t.itemHeight)),y=g+1,b=nU(v)?$H:tU(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=rU(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:nU(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var dU={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},fU={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},pU=`Contains git status items`;function mU(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function hU(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 gU(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 _U(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 vU(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 yU,bU,xU,SU,CU=Object.is,wU=0,TU=[],EU=JV,DU=EU.__b,OU=EU.__r,kU=EU.diffed,AU=EU.__c,jU=EU.unmount,MU=EU.__;function NU(e,t){EU.__h&&EU.__h(bU,e,wU||t),wU=0;var n=bU.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function PU(e){return wU=1,FU(qU,e)}function FU(e,t,n){var r=NU(yU++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):qU(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);CU(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=bU,!bU.__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,CU(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};bU.__f=!0;var a=bU.shouldComponentUpdate,o=bU.componentWillUpdate;bU.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)},bU.shouldComponentUpdate=i}return r.__N||r.__}function IU(e,t){var n=NU(yU++,3);!EU.__s&&KU(n.__H,t)&&(n.__=e,n.u=t,bU.__H.__h.push(n))}function LU(e,t){var n=NU(yU++,4);!EU.__s&&KU(n.__H,t)&&(n.__=e,n.u=t,bU.__h.push(n))}function RU(e){return wU=5,zU(function(){return{current:e}},[])}function zU(e,t){var n=NU(yU++,7);return KU(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function BU(e,t){return wU=8,zU(function(){return e},t)}function VU(){for(var e;e=TU.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(WU),e.__H.__h.forEach(GU),e.__H.__h=[]}catch(t){e.__H.__h=[],EU.__e(t,e.__v)}}EU.__b=function(e){bU=null,DU&&DU(e)},EU.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),MU&&MU(e,t)},EU.__r=function(e){OU&&OU(e),yU=0;var t=(bU=e.__c).__H;t&&(xU===bU?(t.__h=[],bU.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(WU),t.__h.forEach(GU),t.__h=[],yU=0)),xU=bU},EU.diffed=function(e){kU&&kU(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(TU.push(t)!==1&&SU===EU.requestAnimationFrame||((SU=EU.requestAnimationFrame)||UU)(VU)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),xU=bU=null},EU.__c=function(e,t){t.some(function(e){try{e.__h.forEach(WU),e.__h=e.__h.filter(function(e){return!e.__||GU(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],EU.__e(n,e.__v)}}),AU&&AU(e,t)},EU.unmount=function(e){jU&&jU(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{WU(e)}catch(e){t=e}}),n.__H=void 0,t&&EU.__e(t,n.__v))};var HU=typeof requestAnimationFrame==`function`;function UU(e){var t,n=function(){clearTimeout(r),HU&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);HU&&(t=requestAnimationFrame(n))}function WU(e){var t=bU,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),bU=t}function GU(e){var t=bU;e.__c=e.__(),bU=t}function KU(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!CU(t,e[n])})}function qU(e,t){return typeof t==`function`?t(e):t}function JU(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 YU(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 XU({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return IH(`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 ZU(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:IH(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return IH(fH,{children:[IH(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:IH(XH,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function QU(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function $U(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function eW(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 tW({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=uU(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:eW(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?eW(u,1,t,o):i&&r<=0&&c.length>0?lU(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 nW=400,rW=10,iW=40,aW=18;function oW(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))?sW(e,t,n):a instanceof HTMLElement?a:null}function sW(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 cW(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 lW(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 uW(){return navigator.vendor!==`Apple Computer, Inc.`}function dW(e,t){let n=e-t.top;if(n<iW)return-Math.ceil((iW-Math.max(0,n))/iW*aW);let r=t.bottom-e;return r<iW?Math.ceil((iW-Math.max(0,r))/iW*aW):0}function fW(e,t){if(e!=null){let t=dU[e];return t==null?null:{text:t,title:fU[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:pU}:null}function pW(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 mW(e){return e!=null&&`toggle`in e}function hW(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function gW(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function _W(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function vW(e,t){return e!=null&&e>0?e:t}function yW(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 bW(e,t,n,r,i=0){let a=_U({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a==null?!1:(e.scrollTop=a,!0)}function xW(e,t,n,r,i,a){let o=vU({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o==null?!1:(e.scrollTop=o,!0)}function SW(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function CW(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function wW(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function TW(e,t){return t&&wW(e)||(e.ctrlKey||e.metaKey)&&hW(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var EW=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function DW(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 OW(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 kW(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function AW(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function jW(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function MW(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 NW(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 PW(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 FW(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=PW(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 IW(e,t){return{kind:e.kind,name:$U(e),path:t}}function LW(e){return e==null?void 0:`${e}__tree`}function RW(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function zW(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function BW(e,t){if(e==null)return null;if(`text`in e)return IH(`span`,{title:e.title,children:e.text});let n=typeof e.icon==`string`?zW(e.icon)?t(e.icon):{name:e.icon}:zW(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return IH(`span`,{title:e.title,children:IH(BH,{...n})})}function VW(e){e!=null&&JU(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function HW(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=QU(e);return IH(fH,{children:[e.depth>0?IH(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>IH(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,IH(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?IH(BH,{...t(`file-tree-icon-chevron`)}):IH(BH,{...t(`file-tree-icon-file`,u)})}),IH(`div`,{"data-item-section":`content`,children:e.isFlattened?ZU(e,c,a):c??IH(QH,{minimumLength:5,split:`extension`,children:e.name})}),i?IH(`div`,{"data-item-section":`decoration`,children:r==null?null:BW(r,t)}):null,s?IH(`div`,{"data-item-section":`git`,children:BW(o,t)}):null,n?IH(`div`,{"data-item-section":`action`,children:l?IH(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:IH(BH,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function UW(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=QU(t),{isParked:F=!1,mode:I=`flow`,style:L}=r,R=I===`sticky`,z=_?.get(P)??null??pW(t.ancestorPaths,v,y),B=t.kind===`directory`&&(b?.has(P)??!1),V=A(t,P),H=fW(z,B),U=S&&w,W=V!=null||x||U,G=U&&T===`always`,K=a.getPath()===P,ee=K?a.getValue():``,q=R||!K?null:IH(XU,{ref:D,ariaLabel:`Rename ${$U(t)}`,isFlattened:t.isFlattened,value:ee,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),te=HW(t,k,{actionLaneEnabled:U,customDecoration:V,decorationLaneEnabled:W,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:H,gitLaneActive:x,renameInput:q,showDecorativeActionAffordance:G}),ne={...hU({ariaLabel:$U(t),domId:t.isFocused?RW(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:kW(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&&K?IH(`div`,{...ne,children:te}):IH(`button`,{...ne,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:te})}function WW(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(QU(e))).map((n,r)=>UW(e,n,t.start+r))}function GW({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=KB,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 _=RU(null),v=RU(null),y=RU(!1),b=RU(null),x=RU(null),S=RU(null),C=RU(null),w=RU(null),T=RU(new Map),E=RU(new Map),D=RU(()=>{}),O=RU(null),k=RU(!1),A=RU(null),j=RU(null),M=RU(!1),N=RU(null),P=RU(null),F=RU(null),I=RU(null),L=RU(null),R=RU(null),z=RU(null),B=RU(null),V=RU(!1),H=RU(null),U=RU(null),W=RU(null),G=RU(null),K=zU(()=>new Map,[]),[,ee]=PU(0),[q,te]=PU(null),[ne,re]=PU(null),[ie,ae]=PU(null),[oe,se]=PU(null),[ce,le]=PU(0),[ue,de]=PU(null),fe=RU(ue);fe.current=ue;let pe=RU(null),me=RU(null),he=RU(null),ge=RU(null),_e=RU(null),ve=RU(!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=RU(d===`retain`&&t.isSearchOpen()),[Ce,we]=PU(p);IU(()=>{p||we(!1)},[p]);let Te=RU(!1),Ee=BU(()=>{Te.current=!0,we(e=>e&&!1)},[]),[De,Oe]=PU(()=>tW({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[ke,Ae]=PU(!1);IU(()=>{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`;LU(()=>{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,re(t),se(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 Ie=BU((e,t)=>{jW(T.current,e,t)},[]),Le=BU((e,t)=>{jW(E.current,e,t)},[]),Re=BU(e=>{x.current=e},[]),ze=BU(e=>MW(e,E.current,T.current),[]),Be=n!=null||r!=null||i!=null,{resolveIcon:Ve}=zU(()=>rL(a),[a]),He=t[_V](),Ue=He.getPath(),We=Ue!=null,Ge=t.isSearchOpen(),Ke=t.getSearchValue(),qe=t.getFocusedPath(),Je=t.getFocusedIndex(),Ye=t.isDragAndDropEnabled(),Xe=t.getDragSession(),Ze=zU(()=>Xe==null?null:new Set(Xe.draggedPaths),[Xe]),Qe=Xe?.target??null,$e=Xe?.primaryPath??null,et=LW(o),{overlayHeight:tt,overlayRows:nt,snapshot:rt,visibleRows:it}=De,at=rt.physical.viewportHeight,ot=zU(()=>({end:rt.window.endIndex,start:rt.window.startIndex}),[rt.window.endIndex,rt.window.startIndex]),st=nt,ct=rt.sticky.rows,lt=rt.physical.totalHeight,ut=rt.sticky.height,dt=zU(()=>new Set(ct.map(e=>QU(e.row))),[ct]),ft=Je>=0&&Je>=ot.start&&Je<=ot.end,pt=BU((e,t)=>u?.({item:IW(e,t),row:e})??null,[u]),mt=BU(e=>JU(e==null?null:T.current.get(e)??null)?!0:JU(S.current),[]),ht=BU(e=>{mt(t.focusNearestPath(e))},[t,mt]),gt=RU(ht);gt.current=ht;let _t=RU(!0),vt=RU(()=>{}),yt=BU((t=!0)=>{let n=fe.current;n!=null&&(_t.current=_t.current&&t,de(null),e?.contextMenu?.onClose?.(),_t.current&&ht(n.path))},[e?.contextMenu,ht]);vt.current=yt;let bt=BU(e=>{let t=e==null?null:AW(S.current,e);ae(e=>e===t?e:t)},[]),xt=BU((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=ze(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;be(n,e?.scrollTop??null),k.current=!0,te(e=>e===n?e:n)}i.focus(),bt(a),_t.current=!0,de({anchorRect:r?.anchorRect??null,item:IW(e,n),path:n,source:r?.source??`keyboard`})},[t,ze,bt]),St=BU(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=_W(e,at);N.current=Je<0||e==null?null:Math.max(0,Math.min(Je*s-e.scrollTop,Math.max(0,t-s))),M.current=!0}t.startRenaming(e)!==!1&&(se(`focus`),ee(e=>e+1))}},[t,Je,s,l,at]),Ct=BU((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=_W(i,at),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:tW({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return k.current=!0,xW(i,a,s,l,u,d),D.current(),pe.current=n?e:null,!0},[t,s,c,at,h]),wt=()=>y.current===!0||G.current!=null||V.current===!0,Tt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Et=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Dt=()=>{I.current!=null&&(clearTimeout(I.current),I.current=null),F.current=null},Ot=()=>{R.current?.remove(),R.current=null},kt=()=>{Et(P.current),P.current=null,L.current=null},At=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},jt=()=>{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),Ot(),Dt(),kt(),z.current=null},Mt=(e,n)=>{let r=S.current?.getRootNode(),i=cW(oW(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Nt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Dt();return}let r=t.getItem(e.directoryPath),i=mW(r)?r:null;if(i==null||i.isExpanded()){Dt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;F.current!==a&&(Dt(),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))},Pt=()=>{P.current=null;let e=L.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=dW(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()),Nt(Mt(e.clientX,e.clientY)),P.current=Tt(Pt)},Ft=(e,t)=>{L.current={clientX:e,clientY:t},P.current??=Tt(Pt)},It=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(jt(),Ot(),Dt(),kt(),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),uW())){let t=lW(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),At(t),R.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Lt=()=>{Ot(),Dt(),kt(),z.current=null,t.cancelDrag()},Rt=(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<=rW*rW||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=lW(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`}),At(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)`),Nt(Mt(t.clientX,t.clientY)),Ft(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Mt(n.clientX,n.clientY),t.completeDrag(),jt()},u=()=>{t.cancelDrag(),jt()};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)},nW)},zt=e=>{if(ue!=null){if(e.key===`Escape`){yt(),e.preventDefault(),e.stopPropagation();return}EW.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(He.isActive()){if(e.key===`Escape`)He.cancel();else if(e.key===`Enter`)He.commit();else return;se(`focus`),ee(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){St(qe??void 0),e.preventDefault(),e.stopPropagation();return}if(Ge){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=_W(n,at);N.current=Je<0||n==null?null:Math.max(0,Math.min(Je*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;se(`focus`),ee(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&gW(e)){t.openSearch(e.key),ee(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=je&&wW(e),r=TW(e,je),i=r&&S.current!=null?YU(S.current):null,a=r?new Set(NW(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==qe&&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=mW(p)?p:null,h=u!=null&&(dt.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=MW(u,E.current,T.current);e==null||n==null?y=!1:xt(e,u)}else if((e.ctrlKey||e.metaKey)&&hW(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;se(`focus`);let b=t.getFocusedPath(),x=b!=null&&(dt.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,te(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(xe(b,FW(S.current,v,i,u,s,ut,at)),k.current=!0,te(e=>e===b?e:b)):ye()}ee(e=>e+1),e.preventDefault(),e.stopPropagation()};LU(()=>{if(!(!f||!Ge)){if(Se.current){Se.current=!1;return}JU(w.current)}},[Ge,f]),LU(()=>{let e=x.current;switch(mU({hasRenderedInput:e!=null,previousRenamingPath:j.current,renamingPath:Ue})){case`reset`:j.current=null;return;case`reveal-canonical`:Ue!=null&&Ct(Ue,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(pe.current=null,j.current=Ue,JU(e),e.select());return}},[ot.end,ot.start,Ue,Ct,dt]),LU(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=YU(e)?.dataset.itemPath??null;te(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,YU(e)!=null){r();return}k.current=!1,te(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),k.current=!1,te(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;te(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),LU(()=>{let e=S.current;e!=null&&(rt.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[rt.physical.scrollTop]),LU(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=_W(n,g);let a=()=>{let e=t.getVisibleCount(),r=vW(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Oe(tW({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?ee(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,le(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&&vt.current(),ve.current===!0){y.current=!1;return}re(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:yW(e[0]))??_W(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]),LU(()=>{je||ue==null||yt(!1)},[yt,je,ue]);let Bt=zU(()=>ue==null?null:`${ue.path}::${ue.source}`,[ue]);LU(()=>{if(Bt==null){m?.clearSlotContent(YI);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??OW(n.getBoundingClientRect()),close:e=>{vt.current(e?.restoreFocus??!0)},restoreFocus:()=>{_t.current&&gt.current(fe.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(YI,i),e?.contextMenu?.onOpen?.(t.item,r),VW(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&VW(i)}),()=>{m?.clearSlotContent(YI)}},[Bt,e?.contextMenu,m]),LU(()=>{ue!=null&&t.getItem(ue.path)==null&&yt()},[yt,ue,t]),LU(()=>{if(ue==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(DW(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&yt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),yt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[yt,ue]),LU(()=>{let e=C.current,t=S.current;if(e==null||t==null){A.current=qe;return}let n=qe==null?null:T.current.get(qe)??null,r=YU(t),i=r?.dataset.itemPath??null,a=We&&x.current===r,o=f&&w.current===r,c=M.current&&!Ge,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!==qe,v=d!=null&&d===qe&&qe!=null,y=c&&xW(e,Je,s,at,lt,l),b=u!=null&&u===qe&&xW(e,Je,s,at,lt,ut),E=p!=null&&p.path===qe&&xW(e,Je,s,at,lt,p.viewportOffset),O=m!=null&&m.path===qe&&e.scrollTop!==m.scrollTop;if(O&&(e.scrollTop=m.scrollTop),(O||b||E||y||g&&_&&u!==qe&&!v&&bW(e,Je,s,at,ut))&&D.current(),!g){A.current=qe;return}if(a){A.current=qe;return}if(o&&!c){A.current=qe;return}if(n==null){c&&Je>=0&&(xW(e,Je,s,at,lt,l),D.current()),A.current=qe;return}(_||c||u===qe||d===qe||p?.path===qe||m?.path===qe||i==null||i!==qe)&&(JU(n),u===qe&&(pe.current=null),d===qe&&(me.current=null),p?.path===qe&&(he.current=null),m?.path===qe&&(ge.current=null),M.current=!1,N.current=null),A.current=qe},[t,Je,qe,ft,s,We,Ge,ot,at,f,ut,lt,it]);let Vt=Je>=0&&Je>=rt.visible.startIndex&&Je<=rt.visible.endIndex,Ht=qe!=null&&st.some(e=>QU(e.row)===qe),Ut=Vt||Ht,Wt=Ne&&k.current===!0&&Ut?qe:null,Gt=oe===`pointer`?ne:null,Kt=ue?.path??_e.current??Gt??Wt??ne,qt=ue?.source===`right-click`;LU(()=>{y.current&&ue==null||bt(ze(Kt))},[ue,ze,ot,at,ce,st,Kt,bt,it]);let Jt=BU(e=>{if(y.current||DW(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&&se(e=>e===`pointer`?e:`pointer`),re(e=>e===i?e:i)},[]),Yt=BU(()=>{re(null)},[]);LU(()=>{if(!Ye)return;let e=()=>{jt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),jt(),t.cancelDrag()}},[t,Ye]);let Xt=e=>{if(!Ye||t.getDragSession()==null||V.current)return;let n=cW(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Nt(t.getDragSession()?.target??null),Ft(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},Zt=e=>{if(!Ye||t.getDragSession()==null||V.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Dt(),kt(),t.setDragTarget(null))},Qt=e=>{!Ye||t.getDragSession()==null||V.current||(e.preventDefault(),Mt(e.clientX,e.clientY),t.completeDrag(),Ot(),Dt(),kt(),z.current=null)},$t=rt.window.height,en=rt.window.offsetTop,tn=Math.min(0,at-$t-ut),nn=q===qe||M.current,rn=qe!=null&&nn&&!ft&&Je>=0?it[Je]??t.getVisibleRows(Je,Je)[0]??null:null,an=rn==null?null:SW(Je,s,ot,$t),on=z.current,sn=$e!=null&&on!=null&&on.path===$e&&on.index>=ot.start&&on.index<=ot.end,cn=$e!=null&&on!=null&&on.path===$e&&!sn&&on.path!==rn?.path?on:null,ln=cn==null?null:SW(cn.index,s,ot,$t),un=CW((Je>=0?it[Je]??t.getVisibleRows(Je,Je)[0]??null:null)?.ancestorPaths.at(-1)??null),dn=Ge&&qe!=null?RW(o,qe,!ft):void 0,fn=ue?.path??(Ge?qe:q),pn=ue?.path??ne,mn=ze(Kt),hn=je&&Ne&&!qt&&!We&&mn!=null&&ie!=null&&Kt!=null,gn=je&&(hn||ue!=null),_n=ue?.anchorRect,vn=_n==null&&mn!=null&&ie!=null&&(ue!=null||hn)?ie:null,yn=_n==null?vn==null?void 0:{top:`${vn}px`}:{left:`${_n.left}px`,position:`fixed`,right:`auto`,top:`${_n.top}px`},bn=qt?{opacity:`0`}:void 0,xn=BU((e,n,r,i)=>{let a=t.getItem(r),o=gU({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>=rt.visible.startIndex&&n.index<=rt.visible.endIndex,l=i===`flow`&&c&&s!=null&&s.dataset.itemParked!==`true`;a?.focus(),l&&(k.current=!0,te(e=>e===r?e:r),se(`focus`)),o.toggleDirectory&&mW(a)&&a.toggle(),o.closeSearch&&t.closeSearch(),o.revealCanonical&&Ct(r,{targetOffset:`sticky-parents`})},[t,rt.visible.endIndex,rt.visible.startIndex,Ct]),Sn=()=>{if(y.current||!Ne||Kt==null||mn==null)return;let e=t.getItem(Kt);e!=null&&(bt(mn),_t.current=!0,de({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:mn.getAttribute(`aria-label`)??Kt,path:e.getPath()},path:e.getPath(),source:`button`}))},Cn={contextHoverPath:pn,contextMenuButtonTriggerEnabled:Ne,contextMenuButtonVisibility:Pe,contextMenuEnabled:je,contextMenuRightClickEnabled:Fe,contextMenuTriggerMode:Me,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:Ye,draggedPathSet:Ze,dragTarget:Qe,gitLaneActive:Be,gitStatusByPath:n,handleRowDragEnd:Lt,handleRowDragStart:It,handleRowTouchStart:Rt,ignoredGitDirectories:r,ignoredInheritanceCache:K,instanceId:o,itemHeight:s,onKeyDown:zt,onRowClick:xn,openContextMenuForRow:xt,registerButton:Ie,registerRenameInput:Re,renameView:He,renderDecorationForRow:pt,resolveIcon:Ve,shouldSuppressContextMenu:wt,visualFocusPath:fn},wn={...Cn,registerButton:Le};return IH(`div`,{ref:S,id:et,"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":Be?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:Ye?Zt:void 0,onDragOver:Ye?Xt:void 0,onDrop:Ye?Qt:void 0,onKeyDown:zt,onPointerLeave:je?Yt:void 0,onPointerOver:je?Jt:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[IH(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:un}}),IH(`slot`,{name:JI,"data-type":`header-slot`}),f?IH(`div`,{"data-file-tree-search-container":!0,"data-open":Ge?`true`:`false`,children:IH(`input`,{ref:w,"aria-activedescendant":dn,"aria-controls":et,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ce?`true`:void 0,value:Ke,onBlur:()=>{d===`retain`&&!Te.current||t.closeSearch()},onFocus:Ee,onPointerDown:Ee,onInput:e=>{Ee();let n=e.currentTarget;t.setSearch(n.value)}})}):null,IH(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&ke&&st.length>0?IH(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:IH(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${tt}px`},children:st.map((e,t)=>UW(wn,e.row,`sticky:${QU(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${st.length-t}`}}))})}):null,IH(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${lt}px`},children:[IH(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${en}px`}}),IH(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${$t}px`,top:`${tn}px`,bottom:`${tn}px`},children:[WW(Cn,ot,dt),rn!=null&&an!=null?UW(Cn,rn,`parked:${rn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:$e===rn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${an}px`}}):null,cn!=null&&ln!=null?UW(Cn,cn,`parked-drag:${cn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${ln}px`}}):null]})]})]}),je?IH(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":gn?`true`:`false`,style:yn,children:[IH(`button`,{ref:v,type:`button`,"data-type":XI,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":ue==null?`false`:`true`,"data-visible":hn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),ue!=null){yt();return}Sn()},tabIndex:-1,style:bn,children:IH(BH,{...Ve(`file-tree-icon-ellipsis`)})}),ue==null?null:IH(`slot`,{name:YI})]}):null,ue==null?null:IH(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),yt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),yt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var KW={hydrateRoot:(e,t)=>{PH(uH(GW,t),e)},renderRoot:(e,t)=>{NH(uH(GW,t),e)},unmountRoot:e=>{NH(null,e)}};function qW(e,t){KW.renderRoot(e,t)}function JW(e,t){KW.hydrateRoot(e,t)}function YW(e){KW.unmountRoot(e)}var XW=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)}}},ZW=`__c`,QW=`__k`,$W=`__d`,eG=`__s`,tG=/[\s\n\\/='"\0<>]/,nG=/^(xlink|xmlns|xml)([A-Z])/,rG=/^(?: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])/,iG=/^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/,aG=new Set([`draggable`,`spellcheck`]);function oG(e){e.__g===void 0?e[$W]=!0:e.__g|=8}function sG(e){e.__g===void 0?e[$W]=!1:e.__g&=-9}function cG(e){return e.__g===void 0?!0===e[$W]:!!(8&e.__g)}var lG=/["&<]/;function uG(e){if(e.length===0||!1===lG.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 dG={},fG=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(`.`)),pG=/[A-Z]/g;function mG(e){var t=``;for(var n in e){var r=e[n];if(r!=null&&r!==``){var i=n[0]==`-`?n:dG[n]||(dG[n]=n.replace(pG,`-$&`).toLowerCase()),a=`;`;typeof r!=`number`||i.startsWith(`--`)||fG.has(i)||(a=`px;`),t=t+i+`:`+r+a}}return t||void 0}function hG(){this.__d=!0}function gG(e,t){return{__v:e,context:t,props:e.props,setState:hG,forceUpdate:hG,__d:!0,__h:[]}}function _G(e,t,n){if(!e.s){if(n instanceof vG){if(!n.s)return void(n.o=_G.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(_G.bind(null,e,t),_G.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var vG=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{_G(r,1,a(this.v))}catch(e){_G(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?_G(r,1,t?t(i):i):n?_G(r,1,n(i)):_G(r,2,i)}catch(e){_G(r,2,e)}},r},e}(),yG,bG,xG,SG,CG={},wG=Array.isArray,TG=Object.assign,EG=``,DG=`<!--$s-->`,OG=`<!--/$s-->`;function kG(e,t){var n,r=e.type,i=!0;return e[ZW]?(i=!1,(n=e[ZW]).state=n[eG]):n=new r(e.props,t),e[ZW]=n,n.__v=e,n.props=e.props,n.context=t,oG(n),n.state??=CG,n[eG]??(n[eG]=n.state),r.getDerivedStateFromProps?n.state=TG({},n.state,r.getDerivedStateFromProps(n.props,n.state)):i&&n.componentWillMount?(n.componentWillMount(),n.state=n[eG]===n.state?n.state:n[eG]):!i&&n.componentWillUpdate&&n.componentWillUpdate(),xG&&xG(e),n.render(n.props,n.state,t)}function AG(e,t,n,r,i,a,o){if(e==null||!0===e||!1===e||e===EG)return EG;var s=typeof e;if(s!=`object`)return s==`function`?EG:s==`string`?uG(e):e+EG;if(wG(e)){var c,l=EG;i[QW]=e;for(var u=e.length,d=0;d<u;d++){var f=e[d];if(f!=null&&typeof f!=`boolean`){var p,m=AG(f,t,n,r,i,a,o);typeof m==`string`?l+=m:(c||=Array(u),l&&c.push(l),l=EG,wG(m)?(p=c).push.apply(p,m):c.push(m))}}return c?(l&&c.push(l),c):l}if(e.constructor!==void 0)return EG;e.__=i,yG&&yG(e);var h=e.type,g=e.props;if(typeof h==`function`){var _,v,y,b=t;if(h===fH){if(`tpl`in g){for(var x=EG,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&&!wG(C)?x+=C:x+=AG(C,t,n,r,e,a,o)}return x}if(`UNSTABLE_comment`in g)return`<!--`+uG(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=kG(e,b),y=e[ZW];else{e[ZW]=y=gG(e,b);for(var E=0;cG(y)&&E++<25;){sG(y),xG&&xG(e);try{v=h.call(y,g,b)}catch(t){throw a&&t&&typeof t.then==`function`&&(e._suspended=!0),t}}oG(y)}if(y.getChildContext!=null&&(t=TG({},t,y.getChildContext())),T&&JV.errorBoundaries&&(h.getDerivedStateFromError||y.componentDidCatch)){v=v!=null&&v.type===fH&&v.key==null&&v.props.tpl==null?v.props.children:v;try{return AG(v,t,n,r,e,a,!1)}catch(i){return h.getDerivedStateFromError&&(y[eG]=h.getDerivedStateFromError(i)),y.componentDidCatch&&y.componentDidCatch(i,CG),cG(y)?(v=kG(e,t),(y=e[ZW]).getChildContext!=null&&(t=TG({},t,y.getChildContext())),AG(v=v!=null&&v.type===fH&&v.key==null&&v.props.tpl==null?v.props.children:v,t,n,r,e,a,o)):EG}finally{bG&&bG(e),SG&&SG(e)}}}v=v!=null&&v.type===fH&&v.key==null&&v.props.tpl==null?v.props.children:v;try{var D=AG(v,t,n,r,e,a,o);return bG&&bG(e),JV.unmount&&JV.unmount(e),e._suspended?typeof D==`string`?DG+D+OG:wG(D)?(D.unshift(DG),D.push(OG),D):D.then(function(e){return DG+e+OG}):D}catch(i){if(!a&&o&&o.onError){var O=function i(s){return o.onError(s,e,function(e,s){try{return AG(e,t,n,r,s,a,o)}catch(e){return i(e)}})}(i);if(O!==void 0)return O;var k=JV.__e;return k&&k(i,e),EG}if(!a||!i||typeof i.then!=`function`)throw i;return i.then(function i(){try{var s=AG(v,t,n,r,e,a,o);return e._suspended?DG+s+OG:s}catch(e){if(!e||typeof e.then!=`function`)throw e;return e.then(i)}})}}var A,j=`<`+h,M=EG;for(var N in g){var P=g[N];if(typeof(P=MG(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=mG(P));break;case`acceptCharset`:N=`accept-charset`;break;case`httpEquiv`:N=`http-equiv`;break;default:if(nG.test(N))N=N.replace(nG,`$1:$2`).toLowerCase();else{if(tG.test(N))continue;N[4]!==`-`&&!aG.has(N)||P==null?n?iG.test(N)&&(N=N===`panose1`?`panose-1`:N.replace(/([A-Z])/g,`-$1`).toLowerCase()):rG.test(N)&&(N=N.toLowerCase()):P+=EG}}P!=null&&!1!==P&&(j=!0===P||P===EG?j+` `+N:j+` `+N+`="`+(typeof P==`string`?uG(P):P+EG)+`"`)}}if(tG.test(h))throw Error(h+` is not a valid HTML tag name in `+j+`>`);if(M||(typeof A==`string`?M=uG(A):A!=null&&!1!==A&&!0!==A&&(M=AG(A,t,h===`svg`||h!==`foreignObject`&&n,r,e,a,o))),bG&&bG(e),SG&&SG(e),!M&&jG.has(h))return j+`/>`;var F=`</`+h+`>`,I=j+`>`;return wG(M)?[I].concat(M,[F]):typeof M==`string`?I+M+F:[I,M,F]}var jG=new Set([`area`,`base`,`br`,`col`,`command`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function MG(e){return typeof e==`object`&&!!e&&typeof e.peek==`function`&&`value`in e}var NG=0;function PG(e){return e!=null&&e.length>0?e:(NG+=1,`pst_ft_${NG}`)}function FG({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??KB)}function IG(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 LG(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 RG(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var zG=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new XW;#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=PG(a),this.#p=qV(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=GB(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new HV({...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&&(YW(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(),qW(t.wrapper,this.#w()))}setGitStatus(e){this.#p=qV(e,this.#p);let t=this.#T();t!=null&&qW(t.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),qW(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),JW(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),qW(r,this.#w())}#C(){return{initialViewportHeight:FG({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(JI,e());return}this.#l.setSlotHtml(JI,this.#e?.header?.html??null)}#k(e){let t=RG(e).find(e=>LG(e)),n=IG(RI(QI(this.#m).set));n!=null&&(t!=null&&t.outerHTML===n.outerHTML||(t==null?e.prepend(n):t.replaceWith(n)))}#A(e){let t=RG(e),n=t.find(e=>LG(e)),r=t.filter(e=>e!==n),i=QI(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=IG(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=QI(this.#m);t.colored&&BI(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${WI}]`);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(WI,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=XB(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 nV(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)}},BG=typeof window>`u`?Q.useEffect:Q.useLayoutEffect;function VG(e,t,n){let r=e==null?null:(0,Z.jsx)(`div`,{slot:JI,children:e}),i=t!=null&&n!=null?(0,Z.jsx)(`div`,{slot:YI,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,Z.jsxs)(Z.Fragment,{children:[r,i]})}function HG(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 UG(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 WG(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 GG({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)(()=>WG(h,e,f,p,m),[h,p,m,f,e]),_=(0,Q.useCallback)(e=>{l(e)},[]);(0,Q.useEffect)(()=>{f||s(null)},[f]),BG(()=>{n.setComposition(g)},[g,n]),BG(()=>{if(c!=null)return r!=null&&UG(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(h)}},[h,c,n,r]);let v=HG(VG(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)(HI,{...a,id:y,ref:_,style:b,suppressHydrationWarning:r!=null,children:v})}function KG(e){let t=(0,Q.useRef)(null);return t.current??=new zG(e),(0,Q.useEffect)(()=>{let e=t.current;return()=>{e?.cleanUp(),t.current=null}},[]),{model:t.current}}var qG=`.md`,JG=/\.(md|mdx)$/i;function YG(e,t=qG){return`${e}${t}`}function XG(e){return mK(e).replace(JG,``)}function ZG(e){return ri(e)?eK(e.path):qn(e)?e.path:YG(e.docName,e.docExt)}function QG(e){let t=mK(e).match(JG);return t?`.${t[1].toLowerCase()}`:void 0}function $G(e){return mK(e)}function eK(e){let t=mK(e.trim());return t?`${t}/`:``}function tK(e){return e.endsWith(`/`)?$G(e):XG(e)}function nK(e){return e.map(ZG)}function rK(e){return[...e].sort().join(`\0`)}function iK(e){return rK(nK(e))}function aK(e){let t=new Set;for(let n of e){if(ri(n)){let e=eK(n.path);e&&t.add(e)}let e=(ri(n)||qn(n)?n.path:n.docName).split(`/`).filter(Boolean),r=ri(n)?e.length:e.length-1;for(let n=1;n<=r;n++)t.add(`${e.slice(0,n).join(`/`)}/`)}return[...t].sort()}function oK(e){if(!e)return[];let t=mK(e.replace(JG,``)).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 sK(e){let t=e.kind===`directory`,n=t?$G(e.path):XG(e.path),r=t?void 0:QG(e.path);return{kind:t?`folder`:`file`,name:mK(pK(e.path)).replace(JG,``),path:n,treePath:lK(e.path,t),docExt:r}}function cK(e){return e.kind===`directory`?$G(e.path):e.path}function lK(e,t){return t?eK(e):JG.test(e)?e:`${e}${qG}`}function uK(e,t,n){let r=eK(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}${qG}`;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 dK(e,t){return e===`file`?lK(t,!1):`${$G(t)}/index${qG}`}function fK(e,t){return t.kind===`root`||t.directoryPath==null?pK(e):`${t.directoryPath}${pK(e)}`}function pK(e){let t=mK(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function mK(e){return e.endsWith(`/`)?e.slice(0,-1):e}function hK(e){let t=e.lastIndexOf(`/`),n=t<0?e:e.slice(t+1),r=n.lastIndexOf(`.`);return r<=0?``:n.slice(r)}function gK(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 _K(e,t,n){if(n)return{kind:`allow`,destinationPath:t};let r=hK(e);if(r===``)return{kind:`allow`,destinationPath:t};let i=hK(t);return i&&i.toLowerCase()!==r.toLowerCase()?{kind:`block`}:{kind:`allow`,destinationPath:gK(t,r)}}var vK=`data-ok-ext-badge`,yK=`
1848
+ [data-item-selected='true'] [data-icon-token='markdown'] {
1849
+ color: var(--trees-selected-fg);
1850
+ }
1851
+ [data-type='item'][data-item-path*='.']:not([data-item-path$='/']) [data-truncate-segment-priority]:last-child {
1852
+ display: none;
1853
+ }
1854
+ [${vK}] {
1855
+ display: inline-block;
1856
+ margin-left: 0.375rem;
1857
+ margin-right: 0.25rem;
1858
+ align-self: center;
1859
+ color: color-mix(in oklab, var(--muted-foreground) 60%, transparent);
1860
+ font-size: 0.75rem;
1861
+ text-transform: uppercase;
1862
+ flex-shrink: 0;
1863
+ pointer-events: none;
1864
+ user-select: none;
1865
+ }
1866
+ `;function bK(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(`/`)){xK(e);continue}let n=hK(t);if(!n){xK(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(SK(a),n.toLowerCase()===`.md`){xK(e);continue}CK(e,n.slice(1).toUpperCase())}}}function xK(e){let t=e.querySelector(`[${vK}]`);t&&t.remove()}function SK(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 CK(e,t){let n=e.querySelector(`[${vK}]`);if(!n){n=e.ownerDocument.createElement(`span`),n.setAttribute(vK,``),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 wK(e){return e.replace(/\\/g,`\\\\`).replace(/\[/g,`\\[`).replace(/\]/g,`\\]`).replace(/\*/g,`\\*`)}function TK(e){let t=wK(e.path);return e.kind===`folder`?`/${t}/`:`/${t}${e.docExt??`.md`}`}var EK=`data-ok-rename-extension-chip`,DK=`data-ok-renaming`,OK=`data-ok-rename-stripped`,kK=null,AK=null,jK=5e3,MK=`
1867
+ [data-item-section="content"]:has([data-item-rename-input]) {
1868
+ position: relative;
1869
+ }
1870
+ [data-item-section="content"]:has([${EK}]) [data-item-rename-input] {
1871
+ padding-inline-end: 36px;
1872
+ }
1873
+ [${EK}] {
1874
+ position: absolute;
1875
+ top: 50%;
1876
+ right: 6px;
1877
+ transform: translateY(-50%);
1878
+ font-size: 0.6875rem;
1879
+ line-height: 1;
1880
+ letter-spacing: 0.02em;
1881
+ color: color-mix(in oklab, var(--muted-foreground) 60%, transparent);
1882
+ background: transparent;
1883
+ padding: 2px 4px;
1884
+ border-radius: 3px;
1885
+ pointer-events: none;
1886
+ user-select: none;
1887
+ }
1888
+ /* Pierre's icon decoration keys off the row's data-item-path. The chip's
1889
+ value-strip plus Pierre's optimistic commit make the path temporarily
1890
+ extensionless, so Pierre swaps the row's [data-icon-token] from
1891
+ 'markdown' to 'default' until the disk-truth refresh restores .md.
1892
+ Cover the wrong icon with a CSS-rendered markdown glyph for the duration.
1893
+ applyRenameChip sets the marker on the row when the rename input mounts;
1894
+ the sweep in applyRenameChip clears it when the path next includes the
1895
+ saved extension (settle / cancel / row recycle to a settled file). */
1896
+ [${DK}] [data-item-section="icon"] {
1897
+ position: relative;
1898
+ }
1899
+ [${DK}] [data-item-section="icon"] [data-icon-token]:not([data-icon-token='markdown']) {
1900
+ visibility: hidden;
1901
+ }
1902
+ [${DK}='.md'] [data-item-section="icon"]::before,
1903
+ [${DK}='.mdx'] [data-item-section="icon"]::before {
1904
+ content: '';
1905
+ display: block;
1906
+ position: absolute;
1907
+ inset: 0;
1908
+ margin: auto;
1909
+ width: 16px;
1910
+ height: 16px;
1911
+ background-color: currentColor;
1912
+ 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;
1913
+ pointer-events: none;
1914
+ }
1915
+ `;function NK(e){IK(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=hK(i);a&&(LK(n,a),r.getAttribute(`data-ok-renaming`)!==a&&r.setAttribute(DK,a),PK(a),!t.hasAttribute(OK)&&(RK(t,a),t.setAttribute(OK,``)))}function PK(e){kK=e,AK!==null&&clearTimeout(AK),AK=setTimeout(FK,jK)}function FK(){kK=null,AK!==null&&(clearTimeout(AK),AK=null)}function IK(e){let t=e.querySelectorAll(`[${DK}]`);for(let e of t){if(e.querySelector(`[data-item-rename-input]`))continue;let t=e.getAttribute(DK);if(!t){e.removeAttribute(DK);continue}let n=e.dataset.itemPath??``;if(n.toLowerCase().endsWith(t.toLowerCase())){e.removeAttribute(DK);continue}let r=hK(n);r&&r.toLowerCase()!==t.toLowerCase()&&e.removeAttribute(DK)}if(kK===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(`/`)||hK(t)||(r=!0,e.getAttribute(`data-item-selected`)===`true`&&e.getAttribute(`data-ok-renaming`)!==kK&&e.setAttribute(DK,kK))}let i=!!e.querySelector(`[data-item-rename-input]`);!r&&!i&&FK()}function LK(e,t){let n=e.querySelector(`[${EK}]`);n||(n=e.ownerDocument.createElement(`span`),n.setAttribute(EK,``),n.setAttribute(`aria-hidden`,`true`),e.appendChild(n)),n.textContent!==t&&(n.textContent=t)}function RK(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 zK(e){return{selectedFilePath:e,selectedFolderPath:null,navigationPath:e}}function BK(e,t,n={}){if(!e)return zK(t);let r=mr(e);if(t&&r!==t)return zK(t);switch(e.kind){case`doc`:return zK(t??e.docName);case`folder`:case`folder-index`:return{selectedFilePath:null,selectedFolderPath:e.folderPath,navigationPath:e.folderPath};case`missing`:return t&&n.isKnownDocument?.(t)?zK(t):{selectedFilePath:null,selectedFolderPath:null,navigationPath:null};case`asset`:return{selectedFilePath:null,selectedFolderPath:null,navigationPath:null}}}function VK(e,t){if(!e)return{kind:`none`};let n=t.find(t=>ZG(t)===e);if(n&&qn(n))return{kind:`asset`,path:n.path,hash:qr(n.path),mediaKind:n.mediaKind};let r=tK(e);return e.endsWith(`/`)?t.some(e=>ri(e)?e.path===r||e.path.startsWith(`${r}/`):(qn(e)?e.path:e.docName).startsWith(`${r}/`))?{kind:`folder`,path:r}:{kind:`none`}:t.some(e=>yn(e)&&e.docName===r)?{kind:`document`,path:r}:{kind:`none`}}var HK=`You can restore this file from the Trash.`;function UK(e){let t=HK,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 WK(e,t){return e===`web`?null:UK(t)}function GK(e){return e.kind===`folder`?`${e.name}/`:e.docExt?`${e.name}${e.docExt}`:e.name}var KK=[`not-found`,`permission-denied`,`system-error`,`path-escape`];function qK(e){return typeof e==`string`&&KK.includes(e)?e:`system-error`}var JK={"not-found":`File not found`,"permission-denied":`Permission denied`,"system-error":`System error`,"path-escape":`Path resolves outside project`};function YK(e){let t=JK[e.reason];return e.detail?`Reason: ${t} (${e.detail})`:`Reason: ${t}`}function XK(e){return e.kind===`folder`?`${e.name}/`:e.name}function ZK(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 "${XK(c)}" to the Trash. Do you want to permanently delete instead?\n${YK(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)(ho,{children:`Couldn't move to Trash`}),t[4]=d):d=t[4];let f;t[5]===u?f=t[6]:(f=(0,Z.jsxs)(wo,{children:[d,(0,Z.jsx)(po,{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)(xo,{children:(0,Z.jsx)(`ul`,{className:`flex flex-col gap-2 text-xs`,children:n.map(QK)})}):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)(J,{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)(y,{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)(J,{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)(y,{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)(J,{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 b;t[25]!==m||t[26]!==g||t[27]!==v?(b=(0,Z.jsxs)(So,{children:[m,g,v]}),t[25]=m,t[26]=g,t[27]=v,t[28]=b):b=t[28];let x;return t[29]!==b||t[30]!==f||t[31]!==p?(x=(0,Z.jsxs)(vo,{className:`sm:max-w-md`,children:[f,p,b]}),t[29]=b,t[30]=f,t[31]=p,t[32]=x):x=t[32],x}function QK(e){return(0,Z.jsxs)(`li`,{"data-testid":`trash-failure-modal-target`,children:[(0,Z.jsx)(`div`,{className:`font-mono text-foreground`,children:XK(e)}),(0,Z.jsx)(`div`,{className:`text-muted-foreground`,children:YK(e)})]},e.path)}function $K(e){return e?.isDirectory()?e:null}function eq(e,t){let n=t.getPath();for(let t of e.getSelectedPaths())t!==n&&e.getItem(t)?.deselect();t.isSelected()||t.select()}function tq(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=$K(e.getItem(t));n&&!n.isExpanded()&&n.expand()}let o=e.getItem(t);if(!o){i();return}eq(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 nq={"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 rq(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:nq[`ipc-error`]});return}n.ok||(console.warn(`[shell] openInTerminal failed`,{reason:n.reason,dirAbsPath:t}),X.error(`Could not open Terminal`,{description:nq[n.reason]}))}var iq=`open-knowledge:file-tree-menu-action-delete`,aq=`open-knowledge:file-tree-menu-action-rename`;function oq(e){window.dispatchEvent(new CustomEvent(iq,{detail:{target:e}}))}function sq(e){let t=t=>{let n=t.detail;n?.target&&e(n.target)};return window.addEventListener(iq,t),()=>window.removeEventListener(iq,t)}function cq(e){window.dispatchEvent(new CustomEvent(aq,{detail:{target:e}}))}function lq(e){let t=t=>{let n=t.detail;n?.target&&e(n.target)};return window.addEventListener(aq,t),()=>window.removeEventListener(aq,t)}function uq(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 dq(e){return e?`No workspace`:null}function fq(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=dq(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=wm.filter(e);f=r[`claude-code`]?.installed===!0;let o;t[15]===n?o=t[16]:(o=n!==null&&n.docContext!==null?Dr(n.docContext.relativePath):``,t[15]=n,t[16]=o);let c=o,g;t[17]!==n||t[18]!==c?(g=()=>{n!==null&&Hx(c)},t[17]=n,t[18]=c,t[19]=g):g=t[19],p=g,d=Ji,t[20]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsxs)(fa,{children:[(0,Z.jsx)(ji,{"aria-hidden":`true`}),`Open with AI`]}),t[20]=h):h=t[20],u=ua;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)(Qi,{disabled:!t,onSelect:()=>{n&&i(e.id,n)},"data-testid":`file-tree-open-in-${e.id}`,"aria-label":r,children:[(0,Z.jsx)(Ix,{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)(Qi,{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)(Rt,{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 pq=qe(`HOVER_INTENT_MS`,80),mq=3,hq=20,gq=new Map,_q=new Set,vq=[],yq=new Map;function bq(e){for(yq.delete(e),yq.set(e,!0);yq.size>hq;){let e=yq.keys().next().value;if(e===void 0)break;yq.delete(e)}}function xq(e){_q.delete(e),Cq()}function Sq(e,t){let n=Date.now();Xe(`ok/sidebar/prewarm-success`,{docName:e,t:n,poolEventId:t}),nt(e,t,n)}function Cq(){for(;_q.size<mq&&vq.length>0;){let e=vq.shift();if(!e)break;if(!yq.has(e.docName)){_q.add(e.docName),bq(e.docName);try{let t=e.prewarm(e.docName);t&&Sq(e.docName,t)}catch(t){Xe(`ok/sidebar/prewarm-failed`,{docName:e.docName,message:t instanceof Error?t.message:String(t)})}finally{xq(e.docName)}}}}function wq(e,t){if(Ue(e)||yq.has(e))return;let n=gq.get(e);n&&clearTimeout(n.timer);let r=setTimeout(()=>{if(gq.delete(e),_q.size>=mq){vq.push({docName:e,prewarm:t});return}bq(e),_q.add(e);try{let n=t(e);n&&Sq(e,n)}catch(t){Xe(`ok/sidebar/prewarm-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})}finally{xq(e)}},pq);gq.set(e,{timer:r,prewarm:t})}function Tq(e){let t=gq.get(e);t&&(clearTimeout(t.timer),gq.delete(e))}var Eq=/\.(md|mdx)$/i;function Dq(e){if(window.location.hash===e)return;let{pathname:t,search:n}=window.location;window.history.replaceState(null,``,`${t}${n}${e}`)}function Oq(e){let t=e.match(/^"(.+)" already exists\.$/);return t?t[1]:null}function kq(e){let t=e.match(Eq);return t?t[0]:null}async function Aq(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 jq=new Set([`agents`,`agent`,`claude`,`skill`]),Mq=`ok-file-tree-link-decoration`,Nq=`ok-file-tree-agent-decoration`;function Pq(e){return e.map(([e,{key:t,...n}])=>`<${e} ${Object.entries(n).map(([e,t])=>`${e}="${t}"`).join(` `)} />`).join(``)}function Fq(e,t){return`<symbol id="${e}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${Pq(t)}</symbol>`}var Iq=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
1916
+ ${Fq(Mq,hc)}
1917
+ ${Fq(Nq,Ls)}
1918
+ </svg>`,Lq=`${yK}\n${MK}`;function Rq(e){return{...lL({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-fg-muted":`light-dark(var(--color-gray-400), var(--color-gray-500))`}}function zq(e){let t=e.split(`/`).pop()?.replace(/\.md$/i,``).toLowerCase();return!!t&&jq.has(t)}function Bq(e){return e===`darwin`?`Reveal in Finder`:e===`win32`?`Reveal in File Explorer`:`Open Containing Folder`}function Vq(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=Bq(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=ah(r.contentDir,cK(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)(S,{"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)(Qi,{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 Hq(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(),rq(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)(Zc,{"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)(Qi,{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 Uq(e){return sK({kind:e.endsWith(`/`)?`directory`:`file`,name:e,path:e})}function Wq(e,t){return e!==t&&e.startsWith(t)}function Gq(e,t){let n=[...new Set(e)].filter(e=>!t(e)),r=n.filter(e=>e.endsWith(`/`));return n.filter(e=>!r.some(t=>Wq(e,t))).map(Uq)}function Kq(e,t){return e===t||e.startsWith(`${t}/`)}function qq(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 Jq(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)yn(e)&&e.docName.startsWith(`${a.path}/`)&&r.add(e.docName);for(let e of n){let t=$G(e);Kq(t,a.path)&&i.add(t)}}return{docNames:r,folderPaths:i}}function Yq(e,t){return e.kind===`file`?t.kind===`file`&&e.path===t.createdPath:Kq(t.createdPath,e.path)}function Xq(e){let t=(0,$.c)(75),{item:n,context:r,anyActionBusy:i,workspace:a,handoff:o,model:s,okignoreBinding:c,projectLocalBinding:l,mergedConfig:u,onStartCreating:f,onStartCreatingFromTemplate: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=sK(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)?Gq(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,N,P;if(t[19]!==v||t[20]!==C||t[21]!==n||t[22]!==a){M=C&&a?ah(a.contentDir,cK(n),a.pathSeparator):null;let e;if(t[26]!==C||t[27]!==n||t[28]!==a){bb0:{if(!a||C){e=null;break bb0}let t=cK(n),r=t.lastIndexOf(`/`);if(r===-1){e=a.contentDir;break bb0}e=ah(a.contentDir,t.slice(0,r),a.pathSeparator)}t[26]=C,t[27]=n,t[28]=a,t[29]=e}else e=t[29];N=e,P=v?null:C?lh({folderAbsPath:M??``,folderRelativePath:cK(n),workspace:a}):sh({docName:XG(n.path),workspace:a}),t[19]=v,t[20]=C,t[21]=n,t[22]=a,t[23]=M,t[24]=N,t[25]=P}else M=t[23],N=t[24],P=t[25];let F=P,I;t[30]===r?I=t[31]:(I=()=>r.close({restoreFocus:!1}),t[30]=r,t[31]=I);let L=I,R;t[32]===r?R=t[33]:(R=()=>r.close(),t[32]=r,t[33]=R);let z=R,B;t[34]===l?B=t[35]:(B=e=>{if(l===null)return;let t=l.patch({appearance:{sidebar:{showHiddenFiles:e}}});t.ok||(console.warn(`[FileTree] showHiddenFiles toggle rejected:`,Hn(t.error)),X.error(`Could not update sidebar settings`,{description:Hn(t.error)}))},t[34]=l,t[35]=B);let V=B,H;t[36]===l?H=t[37]:(H=e=>{if(l===null)return;let t=l.patch({appearance:{sidebar:{showAllFiles:e}}});t.ok||(console.warn(`[FileTree] showAllFiles toggle rejected:`,Hn(t.error)),X.error(`Could not update sidebar settings`,{description:Hn(t.error)}))},t[36]=l,t[37]=H);let U=H,W=0,G=0;if(C){let e=eK(n.path);for(let t of _)(t===e||t.startsWith(e))&&(W++,$K(s.getItem(t))?.isExpanded()&&G++)}let K=C&&G<W,ee=C&&G>0,q;t[38]===z?q=t[39]:(q=e=>{e||z()},t[38]=z,t[39]=q);let te;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Z.jsx)(qi,{asChild:!0,children:(0,Z.jsx)(`span`,{"aria-hidden":`true`,"data-file-tree-context-menu-root":`true`,className:`block size-px`})}),t[40]=te):te=t[40];let ne;t[41]!==i||t[42]!==b||t[43]!==x||t[44]!==z||t[45]!==L||t[46]!==j||t[47]!==A||t[48]!==M||t[49]!==U||t[50]!==V||t[51]!==o||t[52]!==F||t[53]!==S||t[54]!==v||t[55]!==C||t[56]!==n||t[57]!==s||t[58]!==c||t[59]!==g||t[60]!==m||t[61]!==h||t[62]!==f||t[63]!==p||t[64]!==N||t[65]!==w||t[66]!==T||t[67]!==ee||t[68]!==K||t[69]!==D||t[70]!==a?(ne=(0,Z.jsx)(Yi,{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)(Qi,{disabled:i,onSelect:()=>{L(),f(`file`,$G(n.path))},children:[(0,Z.jsx)(Gc,{"aria-hidden":`true`}),`New File`]}),(0,Z.jsxs)(Qi,{disabled:i,onSelect:()=>{L(),p($G(n.path))},children:[(0,Z.jsx)(tc,{"aria-hidden":`true`}),`New from template`]}),(0,Z.jsxs)(Qi,{disabled:i,onSelect:()=>{L(),f(`folder`,$G(n.path))},children:[(0,Z.jsx)(oc,{"aria-hidden":`true`}),`New Folder`]}),(0,Z.jsx)(da,{}),(0,Z.jsx)(Vq,{item:n,workspace:a,onClose:z}),(0,Z.jsx)(fq,{input:F,installStates:o.installStates,isElectronHost:o.isElectronHost,dispatch:o.dispatch,webFallbackVisible:!1}),(0,Z.jsx)(Hq,{dirAbsPath:M,onClose:z}),(0,Z.jsxs)(Ji,{children:[(0,Z.jsxs)(fa,{children:[(0,Z.jsx)(d,{"aria-hidden":`true`}),`Copy Path`]}),(0,Z.jsxs)(ua,{children:[(0,Z.jsx)(Qi,{disabled:!a,onSelect:()=>{a&&(z(),Aq(ah(a.contentDir,cK(n),a.pathSeparator),`full path`))},children:`Full Path`}),(0,Z.jsx)(Qi,{onSelect:()=>{z(),Aq(cK(n),`relative path`)},children:`Relative Path`})]})]}),(0,Z.jsx)(da,{}),(0,Z.jsx)(Ki,{checked:T,onCheckedChange:V,disabled:!x,"data-testid":`file-tree-menu-show-hidden-files`,children:`Show Hidden Files`}),(0,Z.jsx)(Ki,{checked:w,onCheckedChange:U,disabled:!x,"data-testid":`file-tree-menu-show-all-files`,children:`Show all files`}),K||ee?(0,Z.jsx)(da,{}):null,K?(0,Z.jsxs)(Qi,{onSelect:()=>{z(),h(n.path)},children:[(0,Z.jsx)(tl,{"aria-hidden":`true`}),`Expand All`]}):null,ee?(0,Z.jsxs)(Qi,{onSelect:()=>{z(),g(n.path)},children:[(0,Z.jsx)(ic,{"aria-hidden":`true`}),`Collapse All`]}):null,(0,Z.jsx)(da,{}),(0,Z.jsxs)(Qi,{disabled:i,onSelect:()=>{L(),s.startRenaming(n.path)},children:[(0,Z.jsx)(At,{"aria-hidden":`true`}),`Rename`]}),(0,Z.jsxs)(Qi,{"data-testid":`file-tree-menu-hide`,disabled:!b,onSelect:()=>{if(!c)return;z();let e=TK(D),t=Ya(c.current()),n=za(t,e);if(n===t)return;c.patch(Va(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)(se,{"aria-hidden":`true`}),S]}),(0,Z.jsxs)(Qi,{variant:`destructive`,disabled:i,onSelect:()=>{z(),m(A)},children:[(0,Z.jsx)(Dt,{"aria-hidden":`true`}),j]})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Vq,{item:n,workspace:a,onClose:z}),!v&&(0,Z.jsx)(fq,{input:F,installStates:o.installStates,isElectronHost:o.isElectronHost,dispatch:o.dispatch,webFallbackVisible:!0}),(0,Z.jsx)(Hq,{dirAbsPath:N,onClose:z}),(0,Z.jsxs)(Ji,{children:[(0,Z.jsxs)(fa,{children:[(0,Z.jsx)(d,{"aria-hidden":`true`}),`Copy Path`]}),(0,Z.jsxs)(ua,{children:[(0,Z.jsx)(Qi,{disabled:!a,onSelect:()=>{a&&(z(),Aq(ah(a.contentDir,cK(n),a.pathSeparator),`full path`))},children:`Full Path`}),(0,Z.jsx)(Qi,{onSelect:()=>{z(),Aq(cK(n),`relative path`)},children:`Relative Path`})]})]}),v?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(da,{}),(0,Z.jsxs)(Qi,{disabled:i,onSelect:()=>{L(),s.startRenaming(n.path)},children:[(0,Z.jsx)(At,{"aria-hidden":`true`}),`Rename`]}),(0,Z.jsxs)(Qi,{"data-testid":`file-tree-menu-hide`,disabled:!b,onSelect:()=>{if(!c)return;z();let e=TK(D),t=Ya(c.current()),n=za(t,e);if(n===t)return;c.patch(Va(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)(se,{"aria-hidden":`true`}),S]}),(0,Z.jsxs)(Qi,{variant:`destructive`,disabled:i,onSelect:()=>{z(),m(A)},children:[(0,Z.jsx)(Dt,{"aria-hidden":`true`}),j]})]})]})}),t[41]=i,t[42]=b,t[43]=x,t[44]=z,t[45]=L,t[46]=j,t[47]=A,t[48]=M,t[49]=U,t[50]=V,t[51]=o,t[52]=F,t[53]=S,t[54]=v,t[55]=C,t[56]=n,t[57]=s,t[58]=c,t[59]=g,t[60]=m,t[61]=h,t[62]=f,t[63]=p,t[64]=N,t[65]=w,t[66]=T,t[67]=ee,t[68]=K,t[69]=D,t[70]=a,t[71]=ne):ne=t[71];let re;return t[72]!==ne||t[73]!==q?(re=(0,Z.jsxs)(ra,{open:!0,modal:!1,onOpenChange:q,children:[te,ne]}),t[72]=ne,t[73]=q,t[74]=re):re=t[74],re}function Zq(e){let t=(0,$.c)(226),{ref:n}=e,{activeDocName:r,activeTarget:i,closeTabs:a,closeDocument:o,closeAndClearForRename:s,getPoolActiveDocName:c,isNewTabActive:l,openTarget:u,prewarm:d,remapTabsForRename:f}=lt(),{notifySidebarFileSelected:p}=fN(),{resolvedTheme:m}=Hr(),{addPage:h}=Xr(),g;t[0]!==p||t[1]!==u?(g=function(e){u({kind:`doc`,target:e,docName:e},{tabBehavior:`replace-active`}),Dq(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=sr(e);u({kind:`folder`,target:e,folderPath:e},{tabBehavior:`replace-active`}),Dq(t),p()},t[3]=p,t[4]=u,t[5]=v):v=t[5];let y=v,b;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],t[6]=b):b=t[6];let[x,S]=(0,Q.useState)(b),[C,w]=(0,Q.useState)(!0),[T,E]=(0,Q.useState)(null),[D,O]=(0,Q.useState)(null),[k,A]=(0,Q.useState)(null),[j,M]=(0,Q.useState)(null),[N,P]=(0,Q.useState)(null),[F,I]=(0,Q.useState)(null),L=(0,Q.useRef)(x),R;t[7]!==x||t[8]!==y||t[9]!==_||t[10]!==p||t[11]!==u?(R=function(e,t){let n=VK(e,t===void 0?x:t);if(n.kind===`none`){console.debug(`[FileTree] Dropped selection for unknown docName:`,tK(e));return}if(n.kind===`asset`){u({kind:`asset`,target:n.path,assetPath:n.path,mediaKind:n.mediaKind},{tabBehavior:`replace-active`}),Dq(n.hash),p();return}if(n.kind===`folder`){y(n.path);return}_(n.path)},t[7]=x,t[8]=y,t[9]=_,t[10]=p,t[11]=u,t[12]=R):R=t[12];let z=R,B=(0,Q.useRef)(r),V;t[13]===x?V=t[14]:(V=new Set(x.filter(qn).map(_J)),t[13]=x,t[14]=V);let H=V,W=(0,Q.useRef)(H),G;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(G=[],t[15]=G):G=t[15];let ee=(0,Q.useRef)(G),q=(0,Q.useRef)(null),te=(0,Q.useRef)(gJ),ne=(0,Q.useRef)(null),re=(0,Q.useRef)(null),ie=(0,Q.useRef)(!1),ae=(0,Q.useRef)(null),oe=(0,Q.useRef)(!1),se=(0,Q.useRef)(!1),ce=(0,Q.useRef)(null),le=(0,Q.useRef)(null),ue=(0,Q.useRef)(hJ),de=(0,Q.useRef)(mJ),fe=(0,Q.useRef)(pJ),pe=(0,Q.useRef)(fJ),me=(0,Q.useRef)(i),{selectedFilePath:he,selectedFolderPath:ge,navigationPath:_e}=BK(i,l?null:r),ve=he?YG(he,x.find(e=>yn(e)&&e.docName===he)?.docExt):ge?eK(ge):i?.kind===`asset`?i.assetPath:null,ye=jh().states,{dispatch:be}=bh(),xe;t[16]!==be||t[17]!==ye?(xe={installStates:ye,isElectronHost:typeof window<`u`&&window.okDesktop!=null,dispatch:be},t[16]=be,t[17]=ye,t[18]=xe):xe=t[18];let Se=xe,{okignoreBinding:Ce,projectLocalBinding:we,merged:Te}=ha(),Ee=Te?.appearance?.sidebar?.showHiddenFiles??!1,De=Te?.appearance?.sidebar?.showAllFiles??!1,Oe;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=()=>ae.current===null,t[19]=Oe):Oe=t[19];let ke=Oe,Ae;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=[],t[20]=Ae):Ae=t[20];let je;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(je={set:`complete`,spriteSheet:Iq},t[21]=je):je=t[21];let Me;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(Me={contextMenu:{enabled:!0,triggerMode:`both`,buttonVisibility:`when-needed`}},t[22]=Me):Me=t[22];let Ne;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(Ne={canDrag:ke,canDrop:ke,onDropComplete:e=>pe.current(e),onDropError:dJ},t[23]=Ne):Ne=t[23];let Pe;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(Pe={paths:Ae,flattenEmptyDirectories:!1,initialExpansion:`closed`,fileTreeSearchMode:`hide-non-matches`,initialVisibleRowCount:18,stickyFolders:!0,icons:je,unsafeCSS:Lq,composition:Me,dragAndDrop:Ne,renaming:{canRename:ke,onRename:e=>de.current(e),onError:e=>fe.current(e)},onSelectionChange:e=>ue.current(e),renderRowDecoration:e=>{let{item:t}=e;if(t.kind!==`file`)return null;let n=L.current.find(e=>yn(e)&&YG(e.docName,e.docExt)===t.path);return n?.isSymlink?{icon:Mq,title:n.targetPath?`Symlink to ${n.targetPath}`:`Symlink`}:zq(t.path)?{icon:Nq,title:`Agent configuration file`}:null}},t[24]=Pe):Pe=t[24];let{model:Fe}=KG(Pe),Ie;t[25]===Fe?Ie=t[26]:(Ie=function(e){let t=Fe.getItem(e)??Fe.getItem(eK(e));return t?.isDirectory()?eK($G(t.getPath())):e},t[25]=Fe,t[26]=Ie);let Le=Ie,ze,Be;t[27]===x?(ze=t[28],Be=t[29]):(Be=nK(x),ze=rK(Be),t[27]=x,t[28]=ze,t[29]=Be);let Ve=ze,He=(0,Q.useRef)(Be),Ue;t[30]===x?Ue=t[31]:(Ue=aK(x),t[30]=x,t[31]=Ue);let We=Ue,Ge=(0,Q.useRef)(We),Ke=ge?oK(eK(ge)).slice(0,-1):oK(ve??_e),qe=Ke.join(`\0`),Je;if(t[32]!==Fe){let e=()=>{let e=new Set;for(let t of Ge.current)$K(Fe.getItem(t))?.isExpanded()&&e.add(t);return e};Je=t=>{let n=new Set(aK(t??L.current)),r=e();for(let e of ee.current)r.add(e);return[...r].filter(e=>n.has(e))},t[32]=Fe,t[33]=Je}else Je=t[33];let Ye=Je,Xe;t[34]!==Ye||t[35]!==Fe?(Xe=e=>{let t=nK(e??L.current);Fe.resetPaths(t,{initialExpandedPaths:Ye(e)})},t[34]=Ye,t[35]=Fe,t[36]=Xe):Xe=t[36];let Ze=Xe,Qe;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=e=>{ne.current=iK(e)},t[37]=Qe):Qe=t[37];let $e=Qe,et;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(et=e=>W.current.has(e),t[38]=et):et=t[38];let tt=et,nt=function(e){let t=Oq(e);if(!t||kq(t))return!1;let n=Fe.getFocusedPath()??Fe.getSelectedPaths()[0]??null;if(!n||n.endsWith(`/`)||tt(n))return!1;let r=kq(n);if(!r)return!1;let i=eK(t);if(!Ge.current.includes(i))return!1;let a=`${t}${r}`;return He.current.includes(a)?!1:(kt({sourcePath:n,destinationPath:a,isFolder:!1}),Fe.move(n,a),!0)},rt;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(rt=e=>{let t=e??q.current;!t||q.current!==t||(t.disposeCommitListener(),q.current=null)},t[39]=rt):rt=t[39];let it=rt,at;t[40]!==it||t[41]!==o||t[42]!==a||t[43]!==Ze?(at=async function(e,t){let n=t===void 0?{}:t,r=n.updateUi??!0,i=n.restoreLocation??r;it(e),r&&O(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 U(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&&(O(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&&(O(null),Ze());return}r&&(e.kind===`file`?o(e.createdPath):a([Re(e.createdPath)],{force:!0})),r&&S(t=>{let n=QN(t,e.kind===`file`?[e.createdPath]:[],e.kind===`folder`?e.createdPath:void 0);return $e(n),n}),Lr([`files`,`backlinks`,`graph`]),i&&(window.location.hash=e.previousHash),r&&O(null)},t[40]=it,t[41]=o,t[42]=a,t[43]=Ze,t[44]=at):at=t[44];let ot=at,st,ct;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(st=()=>()=>{let e=q.current;e&&te.current(e,{restoreLocation:!1,updateUi:!1}).catch(uJ)},ct=[],t[45]=st,t[46]=ct):(st=t[45],ct=t[46]),(0,Q.useEffect)(st,ct);let ut,dt;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(ut=()=>{let e=!0,t=uq(async function(){try{let t=se.current,n=await U(await fetch(t?`/api/documents?showAll=true`:`/api/documents`),`Failed to load documents`);if(!e)return;if(!n.ok)E(n.title);else{let e=Er.safeParse(n.body);if(!e.success)E(`Documents response did not match expected shape.`);else{let n=oe.current||t;S(ii(e.data.documents,n)),E(null)}}}catch(t){let n=t;e&&E(`Could not reach server`),console.warn(`[FileTree] fetch failed:`,n)}e&&w(!1)});ce.current=()=>t.request(),t.request();let n=()=>{document.visibilityState===`visible`&&t.request()};window.addEventListener(`focus`,n),window.addEventListener(`visibilitychange`,n);let r=Cr(e=>{e.includes(`files`)&&t.request()});return()=>{e=!1,ce.current=null,t.dispose(),window.removeEventListener(`focus`,n),window.removeEventListener(`visibilitychange`,n),r()}},dt=[],t[47]=ut,t[48]=dt):(ut=t[47],dt=t[48]),(0,Q.useEffect)(ut,dt);let ft=(0,Q.useRef)(!0),pt;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(pt=()=>{if(ft.current){ft.current=!1;return}ce.current?.()},t[49]=pt):pt=t[49];let mt;t[50]===Ee?mt=t[51]:(mt=[Ee],t[50]=Ee,t[51]=mt),(0,Q.useEffect)(pt,mt);let ht=(0,Q.useRef)(!0),gt;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(gt=()=>{if(ht.current){ht.current=!1;return}ce.current?.()},t[52]=gt):gt=t[52];let _t;t[53]===De?_t=t[54]:(_t=[De],t[53]=De,t[54]=_t),(0,Q.useEffect)(gt,_t);let vt,yt;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(vt=()=>{let e=!0;return fetch(`/api/workspace`).then(async t=>{let n=await t.json();if(!e||!t.ok)return;let r=K(yr,n,`workspace`,null);r&&I({contentDir:r.contentDir,pathSeparator:r.pathSeparator})}).catch(lJ),()=>{e=!1}},yt=[],t[55]=vt,t[56]=yt):(vt=t[55],yt=t[56]),(0,Q.useEffect)(vt,yt);let bt;t[57]!==Ye||t[58]!==Fe||t[59]!==Ve?(bt=()=>{if(ne.current===Ve){ne.current=null;return}Fe.resetPaths(He.current,{initialExpandedPaths:Ye()})},t[57]=Ye,t[58]=Fe,t[59]=Ve,t[60]=bt):bt=t[60];let xt;t[61]!==Fe||t[62]!==Ve?(xt=[Fe,Ve],t[61]=Fe,t[62]=Ve,t[63]=xt):xt=t[63],(0,Q.useEffect)(bt,xt),tq(Fe,ve,qe,ie);let St,Ct;t[64]===Fe?(St=t[65],Ct=t[66]):(St=()=>Fe.subscribe(()=>{if(!Fe.isSearchOpen())for(let e of ee.current){let t=$K(Fe.getItem(e));t&&!t.isExpanded()&&t.expand()}}),Ct=[Fe],t[64]=Fe,t[65]=St,t[66]=Ct),(0,Q.useEffect)(St,Ct);let wt,Tt;t[67]===Fe?(wt=t[68],Tt=t[69]):(wt=()=>Fe.onMutation(`remove`,e=>{let t=q.current;!t||e.path!==t.renamePath||te.current(t)}),Tt=[Fe],t[67]=Fe,t[68]=wt,t[69]=Tt),(0,Q.useEffect)(wt,Tt);let Dt;t[70]!==h||t[71]!==s||t[72]!==c||t[73]!==y||t[74]!==f?(Dt=async(e,t,n)=>{let r=t===void 0?[]:t,i=n?.docName??B.current,a=$N(i,e),o=n?.folderPath??(me.current?.kind===`folder`?me.current.folderPath:null),l=o?Et(o,r):null,u=eP(e,c());await Promise.all(u.map(e=>s(e)));for(let t of e)h(t.toDocName);f(e,r),S(t=>{let n=ZN(t,e,r);return $e(n),n}),o&&l&&l!==o?y(l):a&&a!==i&&(window.location.hash=kr(a)),Lr([`files`,`backlinks`,`graph`])},t[70]=h,t[71]=s,t[72]=c,t[73]=y,t[74]=f,t[75]=Dt):Dt=t[75];let Ot=Dt;async function kt(e){let t=lK(e.sourcePath,e.isFolder);O(t),E(null);try{if(!e.isFolder&&tt(t)){X.error(`Assets cannot be renamed from the sidebar`),queueMicrotask(()=>{Ze()}),it(),O(null);return}let n=_K(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()}),it(),O(null);return}let r=lK(n.destinationPath,e.isFolder),i=e.isFolder?{kind:`folder`,fromPath:$G(t),toPath:$G(r)}:{kind:`file`,fromPath:XG(t),toPath:XG(r)},a={docName:B.current,folderPath:me.current?.kind===`folder`?me.current.folderPath:null},o=await U(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),E(o.title),Ze();let e=q.current;e&&e.renamePath===t?await ot(e):it(),O(null);return}let s=K(Kn,o.body,`rename-path`,{renamed:[]});try{await Ot(s.renamed,e.isFolder?[{fromPath:$G(t),toPath:$G(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`)}it(),O(null)}catch(e){console.warn(`[FileTree] rename failed:`,e),X.error(`Network error — please try again`),E(`Network error — please try again`),Ze();let n=q.current;n&&n.renamePath===t?await ot(n):it(),O(null)}}let At;t[76]!==Ot||t[77]!==Ze?(At=async function(e){let t=e.draggedPaths.map(t=>{let n=fK(t,e.target);return t===n?null:{sourcePath:t,destinationTreePath:n}}).filter(cJ);if(t.length!==0){if(t.some(e=>tt(e.sourcePath))){X.error(`Assets cannot be moved from the sidebar`),Ze();return}O(t[0]?.sourcePath??null),E(null);try{let e=[],n=[],r={docName:B.current,folderPath:me.current?.kind===`folder`?me.current.folderPath:null};for(let r of t){let t=r.sourcePath.endsWith(`/`),i=t?{kind:`folder`,fromPath:$G(r.sourcePath),toPath:$G(r.destinationTreePath)}:{kind:`file`,fromPath:XG(r.sourcePath),toPath:XG(r.destinationTreePath)},a=await U(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),E(a.title),Ze(),O(null);return}let o=K(Kn,a.body,`rename-path:drop`,{renamed:[]});e=e.concat(o.renamed),t&&n.push({fromPath:$G(r.sourcePath),toPath:$G(r.destinationTreePath)})}try{await Ot(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`)}O(null)}catch(e){console.warn(`[FileTree] move failed:`,e),X.error(`Network error — please try again`),Ze(),O(null)}}},t[76]=Ot,t[77]=Ze,t[78]=At):At=t[78];let jt=At,Mt;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(Mt=function(e){P({parentDir:e})},t[79]=Mt):Mt=t[79];let Nt=Mt,Pt;t[80]!==ot||t[81]!==it||t[82]!==Fe||t[83]!==y||t[84]!==_||t[85]!==Ze||t[86]!==Be?(Pt=async function(e,t){if(ae.current)return;let n=q.current;n&&it(n);try{let n=uK(e,t,[...Be,...Ge.current]);O(n.renamePath),ae.current=n.renamePath;let r=window.location.hash,i;if(e===`file`){let e=dK(`file`,n.addPath),t=await U(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),E(t.title),O(null),ae.current=null;return}let r=XG(e),a=K(Sr,t.body,`create-page`,{docName:r}).docName;i=a;let o=e.toLowerCase().endsWith(`.mdx`)?`.mdx`:`.md`;S(e=>{if(e.some(e=>yn(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}),Lr([`files`,`backlinks`,`graph`]),_(a)}else{let e=$G(n.addPath),t=await U(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),E(t.title),O(null),ae.current=null;return}i=K(vr,t.body,`create-folder`,{path:e}).path,S(e=>{if(e.some(e=>ri(e)&&e.path===i))return e;let t=[...e,{kind:`folder`,path:i,modified:new Date().toISOString(),size:0}];return $e(t),t}),Lr([`files`]),y(i)}let a=!1,o=e=>{if(e.key!==`Enter`)return;let t=q.current;!t||t.renamePath!==n.renamePath||queueMicrotask(()=>it(t))};document.addEventListener(`keydown`,o,!0),q.current={kind:e,renamePath:n.renamePath,createdPath:i,previousHash:r,disposeCommitListener:()=>{a||(a=!0,document.removeEventListener(`keydown`,o,!0))}},O(null),ae.current=null,Fe.add(n.addPath),Fe.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=q.current;t?await ot(t):it(),O(null),ae.current=null,Ze()}},t[80]=ot,t[81]=it,t[82]=Fe,t[83]=y,t[84]=_,t[85]=Ze,t[86]=Be,t[87]=Pt):Pt=t[87];let Ft=Pt,It;t[88]===Fe?It=t[89]:(It=function(e){let t=eK(e);(0,Q.startTransition)(()=>{for(let e of Ge.current)if(e===t||e.startsWith(t)){let t=$K(Fe.getItem(e));t&&t.expand()}})},t[88]=Fe,t[89]=It);let Lt=It,Rt;t[90]===Fe?Rt=t[91]:(Rt=function(e){let t=eK(e),n=new Set(ee.current);(0,Q.startTransition)(()=>{for(let e of[...Ge.current].reverse())if((e===t||e.startsWith(t))&&!n.has(e)){let t=$K(Fe.getItem(e));t&&t.collapse()}})},t[90]=Fe,t[91]=Rt);let zt=Rt,Bt;t[92]!==z||t[93]!==Ke||t[94]!==r||t[95]!==i||t[96]!==H||t[97]!==D||t[98]!==ot||t[99]!==x||t[100]!==We||t[101]!==jt||t[102]!==kt||t[103]!==Le||t[104]!==nt||t[105]!==De||t[106]!==Ee||t[107]!==Be?(Bt=()=>{L.current=x,B.current=r,me.current=i,W.current=H,ae.current=D,oe.current=Ee,se.current=De,He.current=Be,Ge.current=We,ee.current=Ke,te.current=ot,ue.current=e=>{if(ie.current||e.length!==1)return;let t=e[0];t&&z(Le(t),x)},fe.current=e=>{nt(e)||X.error(e)},de.current=kt,pe.current=jt},t[92]=z,t[93]=Ke,t[94]=r,t[95]=i,t[96]=H,t[97]=D,t[98]=ot,t[99]=x,t[100]=We,t[101]=jt,t[102]=kt,t[103]=Le,t[104]=nt,t[105]=De,t[106]=Ee,t[107]=Be,t[108]=Bt):Bt=t[108],(0,Q.useLayoutEffect)(Bt);let Vt,Ht;t[109]===Fe?(Vt=t[110],Ht=t[111]):(Vt=()=>{let e=e=>{if(!(e.metaKey||e.ctrlKey)||e.altKey||e.key.toLowerCase()!==`a`||qq(e.target))return;let t=le.current,n=e.target,r=document.activeElement,i=n instanceof Node&&t?.contains(n),a=r instanceof Node&&t?.contains(r);if(!i&&!a)return;let o=new Set([...Ge.current,...He.current]);ie.current=!0;for(let e of o)!e||W.current.has(e)||Fe.getItem(e)?.select();queueMicrotask(()=>{ie.current=!1}),e.preventDefault(),e.stopPropagation()};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},Ht=[Fe],t[109]=Fe,t[110]=Vt,t[111]=Ht),(0,Q.useEffect)(Vt,Ht);let Ut,Wt;t[112]!==x.length||t[113]!==C?(Ut=()=>{if(C||x.length===0)return;let e=le.current?.querySelector(HI)?.shadowRoot;if(!e)return;let t=sJ,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()},Wt=[C,x.length],t[112]=x.length,t[113]=C,t[114]=Ut,t[115]=Wt):(Ut=t[114],Wt=t[115]),(0,Q.useEffect)(Ut,Wt);let Gt,Kt;t[116]!==x.length||t[117]!==C?(Gt=()=>{if(C||x.length===0)return;let e=le.current?.querySelector(HI)?.shadowRoot;if(!e)return;let t=()=>bK(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()},Kt=[C,x.length],t[116]=x.length,t[117]=C,t[118]=Gt,t[119]=Kt):(Gt=t[118],Kt=t[119]),(0,Q.useEffect)(Gt,Kt);let qt,Jt;t[120]!==x.length||t[121]!==C?(qt=()=>{if(C||x.length===0)return;let e=le.current?.querySelector(HI)?.shadowRoot;if(!e)return;let t=()=>NK(e);t();let n=new MutationObserver(t);return n.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-item-path`]}),()=>n.disconnect()},Jt=[C,x.length],t[120]=x.length,t[121]=C,t[122]=qt,t[123]=Jt):(qt=t[122],Jt=t[123]),(0,Q.useEffect)(qt,Jt);let Yt;t[124]===Symbol.for(`react.memo_cache_sentinel`)?(Yt={folderCount:0,expandedCount:0},t[124]=Yt):Yt=t[124];let Xt=(0,Q.useRef)(Yt),Zt=(0,Q.useRef)(Ft),Qt=(0,Q.useRef)(Nt),$t;t[125]===Ft?$t=t[126]:($t=()=>{Zt.current=Ft,Qt.current=Nt},t[125]=Ft,t[126]=$t),(0,Q.useEffect)($t);let en,tn;t[127]===Fe?(en=t[128],tn=t[129]):(en=()=>({startCreating(e,t){Zt.current(e,t)},startCreatingFromTemplate(e){Qt.current(e)},expandAll(){(0,Q.startTransition)(()=>{for(let e of Ge.current){let t=$K(Fe.getItem(e));t&&t.expand()}})},collapseAll(){let e=new Set(ee.current);(0,Q.startTransition)(()=>{for(let t of[...Ge.current].reverse()){if(e.has(t))continue;let n=$K(Fe.getItem(t));n&&n.collapse()}})},getFolderState(){let e=Ge.current,t=0;for(let n of e)$K(Fe.getItem(n))?.isExpanded()&&t++;let n=e.length,r=Xt.current;if(r.folderCount===n&&r.expandedCount===t)return r;let i={folderCount:n,expandedCount:t};return Xt.current=i,i},subscribe(e){return Fe.subscribe(e)}}),tn=[Fe],t[127]=Fe,t[128]=en,t[129]=tn),(0,Q.useImperativeHandle)(n,en,tn);let nn;t[130]!==it||t[131]!==s||t[132]!==a||t[133]!==Fe?(nn=async function(e,t,n){let r=Jq(e,L.current,Ge.current),i=q.current;i&&e.some(e=>Yq(e,i))&&(i.kind===`file`?r.docNames.add(i.createdPath):r.folderPaths.add(i.createdPath),it(i));let o=new Set([...r.docNames,...t]),c=new Set([...r.folderPaths,...n]);a([...[...o].map(oJ),...[...c].map(aJ)],{force:!0}),await Promise.all([...o].map(e=>s(e)));for(let t of e){let e=t.kind===`folder`?eK(t.path):YG(t.path,t.docExt);Fe.getItem(e)&&Fe.remove(e,t.kind===`folder`?{recursive:!0}:void 0)}S(e=>{let t=QN(e,[...o]);for(let e of c)t=QN(t,[],e);return $e(t),t}),Lr([`files`,`backlinks`,`graph`])},t[130]=it,t[131]=s,t[132]=a,t[133]=Fe,t[134]=nn):nn=t[134];let rn=nn,an;t[135]===rn?an=t[136]:(an=async function(e){let t=[],n=[],r=[];for(let i of e){O(i.path);let e=await U(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 rn(r,t,n),X.error(e.title),!1;let a=K(Or,e.body,`delete-path`,{deletedDocNames:[]});t.push(...a.deletedDocNames),i.kind===`folder`&&n.push(i.path),r.push(i)}return await rn(r,t,n),!0},t[135]=rn,t[136]=an);let on=an,sn;t[137]===Symbol.for(`react.memo_cache_sentinel`)?(sn=async function(e,t,n){let r=[],i=[];for(let a of e){O(a.path);let e=ah(n.contentDir,a.path,n.pathSeparator),o=await t.shell.trashItem(e);o.ok?r.push(a):i.push({kind:a.kind,path:a.path,name:a.name,reason:qK(o.reason),detail:o.detail})}return{trashed:r,failed:i}},t[137]=sn):sn=t[137];let cn=sn,ln;t[138]===Symbol.for(`react.memo_cache_sentinel`)?(ln=async function(e){let t=[],n=[],r=[];for(let i of e)try{let e=await U(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=K(jn,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[138]=ln):ln=t[138];let un=ln,dn;t[139]!==rn||t[140]!==on||t[141]!==Ze||t[142]!==F?(dn=async function(e){let t=e[0];if(!t)return;O(t.path),A(null);let n=typeof window<`u`?window.okDesktop:void 0;try{if(n&&F){let{trashed:t,failed:r}=await cn(e,n,F);if(t.length>0){let e=await un(t);e?await rn(t,e.deletedDocNames,e.deletedFolderPaths):await rn(t,t.filter(iJ).map(rJ),t.filter(nJ).map(tJ))}r.length>0&&M({failed:r,originalTargets:[...e]}),O(null)}else{let t=await on(e);O(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}),O(null),Ze()}},t[139]=rn,t[140]=on,t[141]=Ze,t[142]=F,t[143]=dn):dn=t[143];let fn=dn,pn;t[144]!==on||t[145]!==Ze||t[146]!==j?(pn=async function(){if(!j)return;let e=new Set(j.failed.map(eJ)),t=j.originalTargets.filter(t=>e.has(`${t.kind}:${t.path}`));if(M(null),t.length!==0){O(t[0]?.path??null);try{let e=await on(t);O(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}),O(null),Ze()}}},t[144]=on,t[145]=Ze,t[146]=j,t[147]=pn):pn=t[147];let mn=pn,hn;t[148]!==fn||t[149]!==j?(hn=async function(){if(!j)return;let e=new Set(j.failed.map($q)),t=j.originalTargets.filter(t=>e.has(`${t.kind}:${t.path}`));M(null),await fn(t)},t[148]=fn,t[149]=j,t[150]=hn):hn=t[150];let gn=hn,_n=(0,Q.useRef)(fn),vn;t[151]===fn?vn=t[152]:(vn=()=>{_n.current=fn},t[151]=fn,t[152]=vn),(0,Q.useEffect)(vn);let bn,xn;t[153]===Symbol.for(`react.memo_cache_sentinel`)?(bn=()=>sq(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=L.current.find(e=>yn(e)&&e.docName===t);_n.current([{kind:`file`,path:t,name:t.split(`/`).pop()??t,docExt:n?.docExt}]);return}if(e.kind===`folder`){_n.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}))}),xn=[],t[153]=bn,t[154]=xn):(bn=t[153],xn=t[154]),(0,Q.useEffect)(bn,xn);let Sn,Cn;t[155]===Fe?(Sn=t[156],Cn=t[157]):(Sn=()=>lq(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=YG(t,L.current.find(e=>yn(e)&&e.docName===t)?.docExt);Fe.startRenaming(n);return}if(e.kind===`folder`){Fe.startRenaming(e.folderPath);return}console.warn(JSON.stringify({event:`file-tree-menu-action-rename-unsupported-kind`,kind:e.kind}))}),Cn=[Fe],t[155]=Fe,t[156]=Sn,t[157]=Cn),(0,Q.useEffect)(Sn,Cn);let wn;t[158]===Symbol.for(`react.memo_cache_sentinel`)?(wn=function(){let e=re.current;e&&Tq(e),re.current=null},t[158]=wn):wn=t[158];let Tn=wn,En;t[159]===d?En=t[160]:(En=function(e){let t=vJ(e.nativeEvent);if(!t||t.endsWith(`/`)){Tn();return}let n=XG(t),r=L.current.find(e=>ZG(e)===t);if(r&&qn(r)){Tn();return}re.current!==n&&(Tn(),re.current=n,wq(n,e=>d(e)))},t[159]=d,t[160]=En);let Dn=En,On;t[161]!==z||t[162]!==Fe||t[163]!==y?(On=function(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=yJ(e.nativeEvent);if(!t||t.getAttribute(`aria-selected`)!==`true`)return;let n=t.dataset.itemPath;if(!n)return;let r=t.dataset.itemType===`folder`?eK(n):n;if(Fe.getSelectedPaths().length!==1)return;if(t.dataset.itemType===`folder`){let e=$G(r);if(window.location.hash===sr(e))return;queueMicrotask(()=>y(e));return}let i=XG(r);window.location.hash!==kr(i)&&queueMicrotask(()=>z(r))},t[161]=z,t[162]=Fe,t[163]=y,t[164]=On):On=t[164];let kn=On;if(C){let e;return t[165]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(xJ,{}),t[165]=e):e=t[165],e}if(x.length===0){if(T){let e;return t[166]===T?e=t[167]:(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:T})}),t[166]=T,t[167]=e),e}let e;t[168]===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[168]=e):e=t[168];let n;return t[169]===Ft?n=t[170]:(n=(0,Z.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 py-8`,children:[e,(0,Z.jsx)(J,{variant:`link`,size:`sm`,className:`font-mono uppercase`,onClick:()=>Ft(`file`,``),children:`Create your first file`})]}),t[169]=Ft,t[170]=n),n}let An=D!==null,Mn=k?.targets[0]??null,Nn;t[171]===T?Nn=t[172]:(Nn=T&&(0,Z.jsx)(`span`,{role:`alert`,className:`px-3 pb-1 text-destructive text-xs`,children:T}),t[171]=T,t[172]=Nn);let Pn;t[173]===m?Pn=t[174]:(Pn=Rq(m),t[173]=m,t[174]=Pn);let Fn;t[175]!==An||t[176]!==H||t[177]!==zt||t[178]!==Lt||t[179]!==We||t[180]!==Se||t[181]!==Te||t[182]!==Fe||t[183]!==Ce||t[184]!==we||t[185]!==Ft||t[186]!==F?(Fn=(e,t)=>(0,Z.jsx)(Xq,{item:e,context:t,anyActionBusy:An,workspace:F,handoff:Se,model:Fe,okignoreBinding:Ce,projectLocalBinding:we,mergedConfig:Te,onStartCreating:Ft,onStartCreatingFromTemplate:Nt,onDelete:e=>A({targets:e}),onExpandSubtree:Lt,onCollapseSubtree:zt,folderTreePaths:We,isAsset:H.has(e.path),isAssetTreePath:tt}),t[175]=An,t[176]=H,t[177]=zt,t[178]=Lt,t[179]=We,t[180]=Se,t[181]=Te,t[182]=Fe,t[183]=Ce,t[184]=we,t[185]=Ft,t[186]=F,t[187]=Fn):Fn=t[187];let In;t[188]!==kn||t[189]!==Dn||t[190]!==Fe||t[191]!==Nn||t[192]!==Pn||t[193]!==Fn?(In=(0,Z.jsx)(`div`,{ref:le,className:`flex min-h-0 flex-1 flex-col`,children:(0,Z.jsx)(GG,{header:Nn,model:Fe,style:Pn,onClickCapture:kn,onMouseMove:Dn,onMouseLeave:Tn,renderContextMenu:Fn})}),t[188]=kn,t[189]=Dn,t[190]=Fe,t[191]=Nn,t[192]=Pn,t[193]=Fn,t[194]=In):In=t[194];let Ln=!!k,Rn;t[195]===D?Rn=t[196]:(Rn=e=>{!e&&!D&&A(null)},t[195]=D,t[196]=Rn);let zn;t[197]!==D||t[198]!==k||t[199]!==fn||t[200]!==Mn?(zn=k&&Mn&&(0,Z.jsx)(ga,{...(()=>{let e=WK(typeof window<`u`&&window.okDesktop!=null?`electron`:`web`,k.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(Qq)}):null}:{itemName:k.targets.length===1?`${Mn.name}${Mn.kind===`file`?Mn.docExt??`.md`:`/`}`:void 0,customTitle:k.targets.length>1?`Delete selected items`:void 0,customDescription:k.targets.length>1?`Are you sure you want to delete ${k.targets.length} selected items? Folders and all files inside them will be deleted. This action cannot be undone.`:Mn.kind===`folder`?`Are you sure you want to delete ${Mn.name}/ and all files inside? This action cannot be undone.`:void 0}})(),isSubmitting:D!==null,onDelete:()=>fn(k.targets)}),t[197]=D,t[198]=k,t[199]=fn,t[200]=Mn,t[201]=zn):zn=t[201];let Bn;t[202]!==Ln||t[203]!==Rn||t[204]!==zn?(Bn=(0,Z.jsx)(To,{open:Ln,onOpenChange:Rn,children:zn}),t[202]=Ln,t[203]=Rn,t[204]=zn,t[205]=Bn):Bn=t[205];let Vn=!!j,Hn;t[206]===D?Hn=t[207]:(Hn=e=>{!e&&!D&&M(null)},t[206]=D,t[207]=Hn);let Un;t[208]!==D||t[209]!==mn||t[210]!==gn||t[211]!==j?(Un=j&&(0,Z.jsx)(ZK,{failedTargets:j.failed,isSubmitting:D!==null,onDeletePermanently:mn,onRetry:gn,onCancel:()=>M(null)}),t[208]=D,t[209]=mn,t[210]=gn,t[211]=j,t[212]=Un):Un=t[212];let Wn;t[213]!==Vn||t[214]!==Hn||t[215]!==Un?(Wn=(0,Z.jsx)(To,{open:Vn,onOpenChange:Hn,children:Un}),t[213]=Vn,t[214]=Hn,t[215]=Un,t[216]=Wn):Wn=t[216];let Gn=N!==null,Jn;t[217]===Symbol.for(`react.memo_cache_sentinel`)?(Jn=e=>{e||P(null)},t[217]=Jn):Jn=t[217];let Yn=N?.parentDir??``,Xn;t[218]!==Gn||t[219]!==Yn?(Xn=(0,Z.jsx)(Gp,{open:Gn,onOpenChange:Jn,kind:`file`,initialDir:Yn}),t[218]=Gn,t[219]=Yn,t[220]=Xn):Xn=t[220];let Zn;return t[221]!==In||t[222]!==Bn||t[223]!==Wn||t[224]!==Xn?(Zn=(0,Z.jsxs)(Z.Fragment,{children:[In,Bn,Wn,Xn]}),t[221]=In,t[222]=Bn,t[223]=Wn,t[224]=Xn,t[225]=Zn):Zn=t[225],Zn}function Qq(e){return(0,Z.jsx)(`li`,{"data-testid":`delete-target-row`,children:GK(e)},`${e.kind}:${e.path}`)}function $q(e){return`${e.kind}:${e.path}`}function eJ(e){return`${e.kind}:${e.path}`}function tJ(e){return e.path}function nJ(e){return e.kind===`folder`}function rJ(e){return e.path}function iJ(e){return e.kind===`file`}function aJ(e){return Re(e)}function oJ(e){return ft(e)}function sJ(e){return e.endsWith(`/`)?e.slice(0,-1):e}function cJ(e){return!!e}function lJ(e){console.warn(`[FileTree] /api/workspace fetch failed:`,e)}function uJ(e){console.warn(`[FileTree] unmount cleanup failed:`,e)}function dJ(e){X.error(e)}function fJ(){}function pJ(e){return X.error(e)}function mJ(){}function hJ(){}async function gJ(){}function _J(e){return ZG(e)}function vJ(e){return yJ(e)?.dataset.itemPath??null}function yJ(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.dataset.itemPath)return t;return null}var bJ=[`w-3/4`,`w-2/3`,`w-4/5`,`w-1/2`,`w-3/5`,`w-2/3`];function xJ(){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:bJ.map(SJ)}),e[0]=t):t=e[0],t}function SJ(e,t){return(0,Z.jsxs)(`div`,{className:`flex h-6 items-center gap-2`,children:[(0,Z.jsx)(Ka,{className:`h-3 w-3 shrink-0 rounded-sm`}),(0,Z.jsx)(Ka,{className:`h-3 ${e}`})]},t)}function CJ(e){return e?`No workspace`:null}function wJ(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=CJ(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=wm.filter(e);f=r[`claude-code`]?.installed===!0;let c;t[17]===n?c=t[18]:(c=n!==null&&n.docContext!==null?Dr(n.docContext.relativePath):``,t[17]=n,t[18]=c);let _=c,v;t[19]!==n||t[20]!==_?(v=()=>{n!==null&&Hx(_)},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=aP,t[22]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsxs)(cP,{children:[(0,Z.jsx)(ji,{"aria-hidden":`true`}),`Open with AI`]}),t[22]=h):h=t[22],u=lP;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)(sP,{disabled:!t,onSelect:()=>{n&&i(e.id,n)},"data-testid":`empty-space-open-in-${e.id}`,"aria-label":r,children:[(0,Z.jsx)(Ix,{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)(sP,{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)(Rt,{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 TJ=(e,t,n)=>ll(e,t,n,`ProjectSwitcher`);function EJ(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 TJ(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),TJ(()=>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),TJ(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),TJ(()=>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=ra,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)(Hs,{"aria-hidden":`true`,className:`opacity-60`}),t[34]=c):c=t[34],t[35]===a?w=t[36]:(w=(0,Z.jsx)(qi,{asChild:!0,children:(0,Z.jsxs)(EN,{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),_=Yi,T=`start`,E=`top`,D=`min-w-[260px]`,y=`project-switcher-menu`,t[37]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Z.jsx)(aa,{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)(aa,{className:`font-normal text-muted-foreground text-xs`,children:`No other recent projects.`}):r.slice(0,10).map(e=>(0,Z.jsxs)(Qi,{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)(da,{}),t[38]=O):O=t[38];let k;t[39]===p?k=t[40]:(k=(0,Z.jsx)(Qi,{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)(Qi,{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 DJ(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})),tr(`sidebarSearchPill`)}function OJ(e){let t=(0,$.c)(8),{onClick:n,className:r}=e,i;t[0]===r?i=t[1]:(i=Y(`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)(ue,{"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)(CS,{className:`text-foreground/70`,children:Nr()?`⌘ K`:`Ctrl K`}),t[4]=s):s=t[4];let c;return t[5]!==n||t[6]!==i?(c=(0,Z.jsxs)(J,{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 kJ(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)(fo,{"aria-hidden":`true`,className:`size-3`}),t[0]=a):a=t[0];let o;t[1]===r?o=t[2]:(o=(0,Z.jsx)(J,{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 AJ(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 jJ(){let e=(0,$.c)(7),t=(0,Q.useSyncExternalStore)(Xf,Yf,Yf),n;e[0]===t?n=e[1]:(n=AJ(t),e[0]=t,e[1]=n);let r=n;if(!r)return null;let i;e[2]===r.id?i=e[3]:(i=()=>{Jf(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)(kJ,{notice:r,onDismiss:i})}),e[4]=r,e[5]=i,e[6]=a):a=e[6],a}function MJ(e,t,n){return e?.kind===`doc`&&t||e?.kind===`folder-index`&&t?ah(n.contentDir,oh(t),n.pathSeparator):e?.kind===`folder`?ah(n.contentDir,e.folderPath,n.pathSeparator):n.contentDir}function NJ(e,t,n){if((e?.kind===`doc`||e?.kind===`folder-index`)&&t){let e=t.lastIndexOf(`/`);return e<0?n.contentDir:ah(n.contentDir,t.slice(0,e),n.pathSeparator)}return e?.kind===`folder`?ah(n.contentDir,e.folderPath,n.pathSeparator):n.contentDir}function PJ(e,t){return(e?.kind===`doc`||e?.kind===`folder-index`)&&t?oh(t):e?.kind===`folder`?e.folderPath:``}function FJ(e,t,n){return e===null?ch({workspace:n}):e.kind===`folder`?n?lh({folderAbsPath:ah(n.contentDir,e.folderPath,n.pathSeparator),folderRelativePath:e.folderPath,workspace:n}):null:e.kind===`doc`||e.kind===`folder-index`?sh({docName:t,workspace:n}):null}var IJ={folderCount:0,expandedCount:0},LJ=`button, [role="button"], [role="menuitem"], input, textarea, select, a[href]`;function RJ(e){return typeof Element>`u`||!(e instanceof Element)?!1:e.closest(LJ)!==null}function zJ(e){let t=(0,$.c)(2),{onOpenSearch:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(ct,{name:`file-sidebar`,children:(0,Z.jsx)(VJ,{onOpenSearch:n})}),t[0]=n,t[1]=r),r}var BJ=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)(Ro,{asChild:!0,children:(0,Z.jsx)(J,{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)(zo,{children:r}),t[10]=r,t[11]=s);let c;return t[12]!==o||t[13]!==s?(c=(0,Z.jsxs)(Vo,{children:[o,s]}),t[12]=o,t[13]=s,t[14]=c):c=t[14],c};function VJ(e){let t=(0,$.c)(164),{onOpenSearch:n}=e,[r,i]=(0,Q.useState)(null),{activeDocName:a,activeTarget:o}=lt(),s;t[0]!==a||t[1]!==o?(s=o?.kind===`folder`||o?.kind===`folder-index`?o.folderPath:dr(a),t[0]=a,t[1]=o,t[2]=s):s=t[2];let c=s,l=typeof window<`u`&&window.okDesktop!=null,{state:f}=fN(),p=f===`expanded`,m=l&&f===`collapsed`,[h,g]=(0,Q.useState)(IJ),_,v;t[3]===r?(_=t[4],v=t[5]):(_=()=>{if(r!==null)return g(r.getFolderState()),r.subscribe(()=>{g(r.getFolderState())})},v=[r],t[3]=r,t[4]=_,t[5]=v),(0,Q.useEffect)(_,v);let y,b;t[6]===r?(y=t[7],b=t[8]):(y=()=>{if(r!==null)return DS(()=>{r.startCreating(`file`,``)})},b=[r],t[6]=r,t[7]=y,t[8]=b),(0,Q.useEffect)(y,b);let x=h.folderCount>0,C=x&&h.expandedCount===h.folderCount,w=h.expandedCount===0,T=Ba(``),E=T.state.status===`ready`?(T.state.data.folder.templates_available?.length??0)>0:!0,D=typeof window<`u`?window.okDesktop:void 0,O=Mm(),k=jh().states,{dispatch:A}=bh(),j;t[9]===O?j=t[10]:(j=ch({workspace:O}),t[9]=O,t[10]=j);let M=j,{projectLocalBinding:N,merged:P}=ha(),F=P?.appearance?.sidebar?.showHiddenFiles??!1,I=P?.appearance?.sidebar?.showAllFiles??!1,L=x&&!C,R=x&&!w,z=L||R,B=GJ,V;t[11]!==r||t[12]!==O?(V=()=>{O&&r?.startCreating(`file`,``)},t[11]=r,t[12]=O,t[13]=V):V=t[13];let H=V,U;t[14]!==r||t[15]!==O?(U=()=>{O&&r?.startCreatingFromTemplate(``)},t[14]=r,t[15]=O,t[16]=U):U=t[16];let W=U,G;t[17]!==r||t[18]!==O?(G=()=>{O&&r?.startCreating(`folder`,``)},t[17]=r,t[18]=O,t[19]=G):G=t[19];let K=G,ee;t[20]===O?ee=t[21]:(ee=()=>{!O||!D||D.shell.showItemInFolder(O.contentDir)},t[20]=O,t[21]=ee);let q=ee,te;t[22]===O?te=t[23]:(te=()=>{!O||!D||rq(D,O.contentDir)},t[22]=O,t[23]=te);let ne=te,re;t[24]===O?re=t[25]:(re=async()=>{if(O)try{await navigator.clipboard.writeText(O.contentDir),X.success(`Copied full path`,{description:O.contentDir})}catch(e){console.warn(`[FileSidebar] clipboard write failed:`,e),X.error(`Could not copy full path`)}},t[24]=O,t[25]=re);let ie=re,ae;t[26]===N?ae=t[27]:(ae=e=>{if(N===null)return;let t=N.patch({appearance:{sidebar:{showHiddenFiles:e}}});t.ok||(console.warn(`[FileSidebar] showHiddenFiles toggle rejected:`,Hn(t.error)),X.error(`Could not update sidebar settings`,{description:Hn(t.error)}))},t[26]=N,t[27]=ae);let oe=ae,se;t[28]===N?se=t[29]:(se=e=>{if(N===null)return;let t=N.patch({appearance:{sidebar:{showAllFiles:e}}});t.ok||(console.warn(`[FileSidebar] showAllFiles toggle rejected:`,Hn(t.error)),X.error(`Could not update sidebar settings`,{description:Hn(t.error)}))},t[28]=N,t[29]=se);let ce=se,le;t[30]===r?le=t[31]:(le=()=>{r?.expandAll()},t[30]=r,t[31]=le);let ue=le,de;t[32]===r?de=t[33]:(de=()=>{r?.collapseAll()},t[32]=r,t[33]=de);let fe=de,pe,me;t[34]!==I||t[35]!==R||t[36]!==L||t[37]!==F?(pe=()=>{D&&D.editor.notifyViewMenuStateChanged({showHiddenFiles:F,showAllFiles:I,canExpandAll:L,canCollapseAll:R})},me=[D,F,I,L,R],t[34]=I,t[35]=R,t[36]=L,t[37]=F,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]!==A||t[43]!==k||t[44]!==c||t[45]!==N||t[46]!==I||t[47]!==F||t[48]!==r||t[49]!==O?(he=()=>{if(D)return D.onMenuAction(e=>{switch(e){case`new-doc`:if(!O||!r)return;r.startCreating(`file`,c);return;case`new-folder`:if(!O||!r)return;r.startCreating(`folder`,c);return;case`new-from-template`:if(!O||!r)return;r.startCreatingFromTemplate(c);return;case`rename`:if(!o)return;cq(o);return;case`move-to-trash`:if(!o)return;oq(o);return;case`reveal-in-finder`:{if(!D||!O)return;let e=MJ(o,a,O);D.shell.showItemInFolder(e);return}case`open-in-terminal`:if(!D||!O)return;rq(D,NJ(o,a,O));return;case`send-to-ai`:{let e=wm.filter(e=>k[e.id]?.installed===!0);if(e.length===0){X.error(`No AI agents installed`);return}let t=FJ(o,a,O);if(!t)return;let[n]=e;if(!n)return;A(n.id,t);return}case`copy-full-path`:{if(!O)return;let e=MJ(o,a,O);navigator.clipboard.writeText(e).then(()=>X.success(`Copied full path`,{description:e})).catch(WJ);return}case`copy-relative-path`:{let e=PJ(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(UJ);return}case`toggle-show-hidden-files`:{if(N===null)return;let e=N.patch({appearance:{sidebar:{showHiddenFiles:!F}}});e.ok||(console.warn(`[FileSidebar] toggle-show-hidden-files rejected:`,Hn(e.error)),X.error(`Could not update sidebar settings`,{description:Hn(e.error)}));return}case`toggle-show-all-files`:{if(N===null)return;let e=N.patch({appearance:{sidebar:{showAllFiles:!I}}});e.ok||(console.warn(`[FileSidebar] toggle-show-all-files rejected:`,Hn(e.error)),X.error(`Could not update sidebar settings`,{description:Hn(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=[D,r,O,o,a,c,N,F,I,k,A],t[40]=a,t[41]=o,t[42]=A,t[43]=k,t[44]=c,t[45]=N,t[46]=I,t[47]=F,t[48]=r,t[49]=O,t[50]=he,t[51]=ge):(he=t[50],ge=t[51]),(0,Q.useEffect)(he,ge);let _e=m&&`opacity-0`,ve;t[52]===_e?ve=t[53]:(ve=Y(`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]=ve);let ye;t[54]===p?ye=t[55]:(ye=p&&!l?(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-sm uppercase tracking-wider text-sidebar-foreground/50`,children:`Files`}):null,t[54]=p,t[55]=ye);let be;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(be=Y(`flex items-center gap-1`,l&&`[&>*]:[-webkit-app-region:no-drag]`),t[56]=be):be=t[56];let xe;t[57]!==C||t[58]!==x||t[59]!==w||t[60]!==r?(xe=x?(0,Z.jsxs)(ra,{children:[(0,Z.jsx)(qi,{asChild:!0,children:(0,Z.jsx)(BJ,{icon:vc,label:`Tree View Options`})}),(0,Z.jsxs)(Yi,{align:`end`,children:[C?null:(0,Z.jsxs)(Qi,{onSelect:()=>r?.expandAll(),children:[(0,Z.jsx)(tl,{"aria-hidden":`true`}),`Expand All`]}),w?null:(0,Z.jsxs)(Qi,{onSelect:()=>r?.collapseAll(),children:[(0,Z.jsx)(ic,{"aria-hidden":`true`}),`Collapse All`]})]})]}):null,t[57]=C,t[58]=x,t[59]=w,t[60]=r,t[61]=xe):xe=t[61];let Se;t[62]!==c||t[63]!==r?(Se=(0,Z.jsx)(BJ,{icon:Gc,label:`New File`,onClick:()=>r?.startCreating(`file`,c)}),t[62]=c,t[63]=r,t[64]=Se):Se=t[64];let Ce;t[65]!==E||t[66]!==c||t[67]!==r?(Ce=E?(0,Z.jsx)(BJ,{icon:tc,label:`New from template`,onClick:()=>r?.startCreatingFromTemplate(c)}):null,t[65]=E,t[66]=c,t[67]=r,t[68]=Ce):Ce=t[68];let we;t[69]!==c||t[70]!==r?(we=(0,Z.jsx)(BJ,{icon:oc,label:`New Folder`,onClick:()=>r?.startCreating(`folder`,c)}),t[69]=c,t[70]=r,t[71]=we):we=t[71];let Te;t[72]!==xe||t[73]!==Se||t[74]!==Ce||t[75]!==we?(Te=(0,Z.jsxs)(`div`,{className:be,children:[xe,Se,Ce,we]}),t[72]=xe,t[73]=Se,t[74]=Ce,t[75]=we,t[76]=Te):Te=t[76];let Ee;t[77]!==ve||t[78]!==ye||t[79]!==Te?(Ee=(0,Z.jsxs)(bN,{className:ve,children:[ye,Te]}),t[77]=ve,t[78]=ye,t[79]=Te,t[80]=Ee):Ee=t[80];let De=m&&`opacity-0`,Oe;t[81]===De?Oe=t[82]:(Oe=Y(`px-2 pb-2`,l&&`[-webkit-app-region:no-drag]`,l&&`motion-safe:transition-opacity motion-safe:duration-100 motion-safe:ease-out`,De),t[81]=De,t[82]=Oe);let ke;t[83]===f?ke=t[84]:(ke=[f],t[83]=f,t[84]=ke);let Ae;t[85]===n?Ae=t[86]:(Ae=(0,Z.jsx)(OJ,{onClick:n}),t[85]=n,t[86]=Ae);let je;t[87]!==ke||t[88]!==Ae?(je=(0,Z.jsx)(u,{fallbackRender:HJ,onError:DJ,resetKeys:ke,children:Ae}),t[87]=ke,t[88]=Ae,t[89]=je):je=t[89];let Me;t[90]!==Oe||t[91]!==je?(Me=(0,Z.jsx)(`div`,{className:Oe,children:je}),t[90]=Oe,t[91]=je,t[92]=Me):Me=t[92];let Ne;t[93]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,Z.jsx)(SN,{children:(0,Z.jsx)(Zq,{ref:i})}),t[93]=Ne):Ne=t[93];let Pe,Fe;t[94]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=(0,Z.jsxs)(xN,{className:`px-0`,children:[typeof window<`u`&&window.okDesktop?(0,Z.jsx)(CN,{children:(0,Z.jsx)(wN,{children:(0,Z.jsx)(EJ,{bridge:window.okDesktop})})}):null,(0,Z.jsx)(jJ,{})]}),Fe=(0,Z.jsx)(vN,{enableToggle:!1}),t[94]=Pe,t[95]=Fe):(Pe=t[94],Fe=t[95]);let Ie;t[96]!==Ee||t[97]!==Me?(Ie=(0,Z.jsx)(iP,{asChild:!0,children:(0,Z.jsxs)(`div`,{className:`contents`,onContextMenu:B,children:[Ee,Me,Ne,Pe,Fe]})}),t[96]=Ee,t[97]=Me,t[98]=Ie):Ie=t[98];let Le=!O,Re;t[99]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(0,Z.jsx)(Gc,{"aria-hidden":`true`}),t[99]=Re):Re=t[99];let ze;t[100]!==H||t[101]!==Le?(ze=(0,Z.jsxs)(sP,{disabled:Le,onSelect:H,"data-testid":`empty-space-menu-new-file`,children:[Re,`New File`]}),t[100]=H,t[101]=Le,t[102]=ze):ze=t[102];let Be=!O||!E,Ve;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=(0,Z.jsx)(tc,{"aria-hidden":`true`}),t[103]=Ve):Ve=t[103];let He;t[104]!==W||t[105]!==Be?(He=(0,Z.jsxs)(sP,{disabled:Be,onSelect:W,"data-testid":`empty-space-menu-new-from-template`,children:[Ve,`New from template`]}),t[104]=W,t[105]=Be,t[106]=He):He=t[106];let Ue=!O,We;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(We=(0,Z.jsx)(oc,{"aria-hidden":`true`}),t[107]=We):We=t[107];let Ge;t[108]!==K||t[109]!==Ue?(Ge=(0,Z.jsxs)(sP,{disabled:Ue,onSelect:K,"data-testid":`empty-space-menu-new-folder`,children:[We,`New Folder`]}),t[108]=K,t[109]=Ue,t[110]=Ge):Ge=t[110];let Ke;t[111]===Symbol.for(`react.memo_cache_sentinel`)?(Ke=(0,Z.jsx)(dP,{}),t[111]=Ke):Ke=t[111];let qe;t[112]!==q||t[113]!==O?(qe=D?(0,Z.jsxs)(sP,{disabled:!O,onSelect:q,"data-testid":`empty-space-menu-reveal-in-finder`,"aria-label":O?`Reveal in Finder`:`Reveal in Finder, No workspace`,children:[(0,Z.jsx)(S,{"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:`Reveal in Finder`}),O?null:(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:`No workspace`})]}):null,t[112]=q,t[113]=O,t[114]=qe):qe=t[114];let Je;t[115]!==A||t[116]!==M||t[117]!==k?(Je=(0,Z.jsx)(wJ,{input:M,installStates:k,dispatch:A,webFallbackVisible:!1}),t[115]=A,t[116]=M,t[117]=k,t[118]=Je):Je=t[118];let Ye;t[119]!==ne||t[120]!==O?(Ye=D?(0,Z.jsxs)(sP,{disabled:!O,onSelect:ne,"data-testid":`empty-space-menu-open-in-terminal`,"aria-label":O?`Open in Terminal`:`Open in Terminal, No workspace`,children:[(0,Z.jsx)(Zc,{"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:`Open in Terminal`}),O?null:(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:`No workspace`})]}):null,t[119]=ne,t[120]=O,t[121]=Ye):Ye=t[121];let Xe=!O,Ze=O?`Copy full path`:`Copy full path, No workspace`,Qe,$e;t[122]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=(0,Z.jsx)(d,{"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]===O?et=t[125]:(et=O?null:(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:`No workspace`}),t[124]=O,t[125]=et);let tt;t[126]!==ie||t[127]!==Xe||t[128]!==Ze||t[129]!==et?(tt=(0,Z.jsxs)(sP,{disabled:Xe,onSelect:ie,"data-testid":`empty-space-menu-copy-full-path`,"aria-label":Ze,children:[Qe,$e,et]}),t[126]=ie,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)(dP,{}),t[131]=nt):nt=t[131];let rt=N===null,it;t[132]!==oe||t[133]!==F||t[134]!==rt?(it=(0,Z.jsx)(uP,{checked:F,onCheckedChange:oe,disabled:rt,"data-testid":`empty-space-menu-show-hidden-files`,children:`Show Hidden Files`}),t[132]=oe,t[133]=F,t[134]=rt,t[135]=it):it=t[135];let at=N===null,ot;t[136]!==ce||t[137]!==I||t[138]!==at?(ot=(0,Z.jsx)(uP,{checked:I,onCheckedChange:ce,disabled:at,"data-testid":`empty-space-menu-show-all-files`,children:`Show all files`}),t[136]=ce,t[137]=I,t[138]=at,t[139]=ot):ot=t[139];let st;t[140]===z?st=t[141]:(st=z?(0,Z.jsx)(dP,{}):null,t[140]=z,t[141]=st);let ct;t[142]!==ue||t[143]!==L?(ct=L?(0,Z.jsxs)(sP,{onSelect:ue,"data-testid":`empty-space-menu-expand-all`,children:[(0,Z.jsx)(tl,{"aria-hidden":`true`}),`Expand all`]}):null,t[142]=ue,t[143]=L,t[144]=ct):ct=t[144];let ut;t[145]!==fe||t[146]!==R?(ut=R?(0,Z.jsxs)(sP,{onSelect:fe,"data-testid":`empty-space-menu-collapse-all`,children:[(0,Z.jsx)(ic,{"aria-hidden":`true`}),`Collapse all`]}):null,t[145]=fe,t[146]=R,t[147]=ut):ut=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]!==ut?(dt=(0,Z.jsxs)(oP,{children:[ze,He,Ge,Ke,qe,Je,Ye,tt,nt,it,ot,st,ct,ut]}),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]=ut,t[160]=dt):dt=t[160];let ft;return t[161]!==Ie||t[162]!==dt?(ft=(0,Z.jsx)(gN,{variant:`inset`,children:(0,Z.jsxs)(rP,{children:[Ie,dt]})}),t[161]=Ie,t[162]=dt,t[163]=ft):ft=t[163],ft}function HJ(){return null}function UJ(e){console.warn(`[FileSidebar] clipboard write failed:`,e),X.error(`Could not copy relative path`)}function WJ(e){console.warn(`[FileSidebar] clipboard write failed:`,e),X.error(`Could not copy full path`)}function GJ(e){RJ(e.target)&&(e.preventDefault(),e.stopPropagation())}function KJ(){let e=(0,$.c)(17),t=dn(),{collabUrl:n,setSystemProvider:r,updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c}=lt(),u;e[0]!==o||e[1]!==s||e[2]!==a||e[3]!==c||e[4]!==i?(u={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]=u):u=e[5];let d=(0,Q.useRef)(u),f;e[6]!==o||e[7]!==s||e[8]!==a||e[9]!==c||e[10]!==i?(f=()=>{d.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]=f):f=e[11],(0,Q.useEffect)(f);let p,m;return e[12]!==n||e[13]!==t||e[14]!==r?(p=()=>{if(n===null)return;let e=new ae,i=new Pe({url:n,name:er,document:e,onStateless:e=>{let{payload:t}=e;it(t,{onServerInfo:e=>{d.current.updateServerInstanceId(e.serverInstanceId),e.currentBranch!==void 0&&d.current.observeBranch(e.currentBranch)},onBranchSwitched:e=>{d.current.onBranchSwitched(e.branch)},onDiskAck:e=>{d.current.observeDiskAck(e.docName,e.sv)},onDerivedView:QJ,onConfigValidationRejected:ZJ,onConfigIgnoreNestedError:XJ,onUnknown:YJ})},onClose:JJ,onDisconnect:qJ}),a=Cr(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=l(()=>{d.current.refreshServerInfo()});i.on(`synced`,()=>{Lr([`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()}},m=[t,n,r],e[12]=n,e[13]=t,e[14]=r,e[15]=p,e[16]=m):(p=e[15],m=e[16]),(0,Q.useEffect)(p,m),null}function qJ(){console.warn(`[CC1] __system__ disconnected - derived views may be stale`)}function JJ(e){let{event:t}=e;console.warn(`[CC1] __system__ connection closed:`,t.code,t.reason)}function YJ(e){console.warn(`[CC1] Unparseable stateless payload, skipping:`,e.slice(0,100))}function XJ(e){Wa(e)}function ZJ(e){qa(e)}function QJ(e){Lr([e.ch])}var $J=`#install-claude-desktop`;function eY(e){return e===`#settings`||e===$J}function tY(e,t,n){return[e,t,n].map(e=>[...e].sort().join(`\0`)).join(``)}function nY(){let e=(0,$.c)(20),{clearTarget:t,syncOpenTabsWithKnownTargets:n,tabSessionLoaded:r}=lt(),{openTargetTransition:i}=vt(),{assetPaths:a,folderPaths:o,loading:s,pages:c}=Xr(),l=(0,Q.useRef)(null),u;e[0]!==a||e[1]!==o||e[2]!==c?(u=tY(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(eY(window.location.hash))return;let e=$r(window.location.hash);if(e){let t=br(e.split(`.`).pop()??``);Xe(`ok/nav/hash-change`,{docName:null,kind:`asset`}),i({kind:`asset`,target:e,assetPath:e,mediaKind:t});return}let n=Br(window.location.hash);if(!n){Xe(`ok/nav/hash-change`,{docName:null,kind:`clear`}),t();return}if(s){Xe(`ok/nav/hash-change`,{docName:n,kind:`deferred-loading`});return}let r=ei(n,{pages:c,folderPaths:o});if(r.kind===`missing`&&/\/+$/.test(n.trim())){Xe(`ok/nav/hash-change`,{docName:n,kind:`deferred-missing-folder`});return}let a=Fr(r);Xe(`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 rY(){let e=(0,$.c)(5),[t,n]=(0,Q.useState)(typeof window<`u`&&window.location.hash===$J),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=function(){window.location.hash===$J&&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===$J){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)(va,{open:t,onOpenChange:o}),e[3]=t,e[4]=s),s}function iY(){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)(aY,t),null}function aY(){let e=function(e){let t=e.target;Em({target:t,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,key:e.key})&&(e.preventDefault(),window.location.hash!==`#settings`&&(window.location.hash=Tm))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)}function oY(){let e=(0,$.c)(4),{activeTarget:t}=lt(),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 sY(){let e=(0,$.c)(8),{activeDocName:t,activeTarget:n}=lt(),[r,i]=(0,Q.useState)(!1),a;e[0]!==t||e[1]!==n?(a=n?.kind===`folder`?n.folderPath:dr(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;Up({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)(Gp,{open:r,onOpenChange:i,kind:`file`,initialDir:o}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function cY(){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?dl({bridge:t,authQueryTransport:hl(),cloneTransport:xl(),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)(Jh,{}),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)(KJ,{}),p=(0,Z.jsx)(nY,{}),m=(0,Z.jsx)(oY,{}),h=(0,Z.jsx)(sY,{}),g=(0,Z.jsx)(iY,{}),_=(0,Z.jsx)(rY,{}),v=(0,Z.jsx)(Od,{}),y=t&&u?(0,Z.jsx)(Hd,{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)(Qu,{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)(Vh,{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`,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)(zJ,{onOpenSearch:()=>i(!0)}),e[16]=C):C=e[16];let w;e[17]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsxs)(pN,{className:`h-screen overflow-hidden`,children:[C,(0,Z.jsx)(yN,{className:`overflow-hidden h-[calc(100vh-var(--layout-inset-offset))]`,children:(0,Z.jsx)(AF,{})})]}),e[17]=w):w=e[17];let T;return e[18]!==b||e[19]!==x?(T=(0,Z.jsx)(ct,{name:`app`,children:(0,Z.jsx)(St,{children:(0,Z.jsxs)(pa,{children:[d,(0,Z.jsxs)(Vr,{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}_s(),typeof window<`u`&&window.okDesktop?.config.apiOrigin&&Qd({apiOrigin:window.okDesktop.config.apiOrigin}),vf()&&wf(),Zf(),typeof window<`u`&&tf({bridge:window.okDesktop}),typeof window<`u`&&Ao({bridge:window.okDesktop}),typeof window<`u`&&Uo({bridge:window.okDesktop}),typeof window<`u`&&af({bridge:window.okDesktop}),typeof window<`u`&&Vd({bridge:window.okDesktop});var lY=new Es({defaultOptions:{queries:{retry:1,staleTime:1e4}}}),uY=document.getElementById(`root`);if(!uY)throw Error(`Root element not found`);var dY=typeof window<`u`&&window.okDesktop?.config.mode===`navigator`;(0,Is.createRoot)(uY).render((0,Z.jsx)(Q.StrictMode,{children:(0,Z.jsx)(rn,{client:lY,children:(0,Z.jsxs)(cr,{attribute:`class`,defaultTheme:`system`,enableSystem:!0,disableTransitionOnChange:!0,storageKey:`ok-theme-v1`,children:[(0,Z.jsx)(Bo,{children:dY&&window.okDesktop?(0,Z.jsx)(qd,{bridge:window.okDesktop}):(0,Z.jsx)(cY,{})}),(0,Z.jsx)(Zd,{richColors:!0,closeButton:!0})]})})}));