@openspecui/web 3.0.0 → 3.0.1

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 (69) hide show
  1. package/dist/assets/CanvasRenderer-RWnD8K4i.js +1 -0
  2. package/dist/assets/WebGLRenderer-_TyUS_Ry.js +1 -0
  3. package/dist/assets/WebGPURenderer-CVu-eBlZ.js +1 -0
  4. package/dist/assets/browserAll-BzVUq93b.js +1 -0
  5. package/dist/assets/{dist-C9etarOp.js → dist-BWap8BUZ.js} +1 -1
  6. package/dist/assets/{dist-Cicv-YLQ.js → dist-Bbr51wYZ.js} +1 -1
  7. package/dist/assets/dist-BfA77DdP.js +1 -0
  8. package/dist/assets/{dist-CkGo_JMi.js → dist-BmjhhzPx.js} +1 -1
  9. package/dist/assets/{dist-61Hj9h5w.js → dist-CuqNcKVW.js} +1 -1
  10. package/dist/assets/{dist-Cf76msW9.js → dist-DB5mu-j6.js} +1 -1
  11. package/dist/assets/{dist-BHAI-bAV.js → dist-DIIU-wsM.js} +1 -1
  12. package/dist/assets/{dist-C_Whfh3c.js → dist-DQ_snCrt.js} +1 -1
  13. package/dist/assets/{dist-D6rHed3i.js → dist-DbIj2uQy.js} +1 -1
  14. package/dist/assets/{dist-JMLEKZpG.js → dist-Dh0ERHRP.js} +1 -1
  15. package/dist/assets/dist-TEmTUzbm.js +1 -0
  16. package/dist/assets/dist-eg4jPA1_.js +1 -0
  17. package/dist/assets/{ghostty-web-Dr2ejTe3.js → ghostty-web-BrWBGUK7.js} +1 -1
  18. package/dist/assets/index-CuBLKe7j.css +1 -0
  19. package/dist/assets/{index-Y3BYniDx.js → index-Dxz35yDn.js} +125 -123
  20. package/dist/assets/{init-DRV9-5sZ.js → init-EzX3YHle.js} +1 -1
  21. package/dist/assets/trpc-CuRVr2ze.js +1 -0
  22. package/dist/assets/webworkerAll-BHuIm7eN.js +1 -0
  23. package/dist/index.html +2 -2
  24. package/dist-ssg/client/.vite/ssr-manifest.json +15 -15
  25. package/dist-ssg/client/assets/CanvasRenderer-DfVz9CSz.js +1 -0
  26. package/dist-ssg/client/assets/WebGLRenderer-DVK96Dop.js +1 -0
  27. package/dist-ssg/client/assets/WebGPURenderer-BYG_ICu9.js +1 -0
  28. package/dist-ssg/client/assets/browserAll-CDjVpdx6.js +1 -0
  29. package/dist-ssg/client/assets/{dist-BuC62uCX.js → dist-BKDi1Kni.js} +1 -1
  30. package/dist-ssg/client/assets/{dist-DkDWFWp_.js → dist-BVyK6lB7.js} +1 -1
  31. package/dist-ssg/client/assets/{dist-CGXgRYaV.js → dist-C6Saw614.js} +1 -1
  32. package/dist-ssg/client/assets/dist-ChU3_-xm.js +1 -0
  33. package/dist-ssg/client/assets/{dist-BnyqJBh5.js → dist-Chnwmoeu.js} +1 -1
  34. package/dist-ssg/client/assets/{dist-om9Y_fPQ.js → dist-CvWPf8Kt.js} +1 -1
  35. package/dist-ssg/client/assets/{dist-BwrSUFdo.js → dist-DTs2RD81.js} +1 -1
  36. package/dist-ssg/client/assets/dist-DXI2Tp9R.js +1 -0
  37. package/dist-ssg/client/assets/{dist-CIsUmA-3.js → dist-DwzmuYUo.js} +1 -1
  38. package/dist-ssg/client/assets/dist-OfFe6OoM.js +1 -0
  39. package/dist-ssg/client/assets/{dist-gAWuPgK4.js → dist-ZQqxlnHI.js} +1 -1
  40. package/dist-ssg/client/assets/{dist-ByPvaULS.js → dist-oGrBvbG8.js} +1 -1
  41. package/dist-ssg/client/assets/{ghostty-web-v0ideTPB.js → ghostty-web-BVO2n--o.js} +1 -1
  42. package/dist-ssg/client/assets/index-CVQW5ffN.css +2 -0
  43. package/dist-ssg/client/assets/{index.ssg-BHy6c5EY.js → index.ssg-C-J3MDrU.js} +9 -9
  44. package/dist-ssg/client/assets/{init-TkJkDsGL.js → init-DdhjNhOt.js} +1 -1
  45. package/dist-ssg/client/assets/trpc-Uk6u7BJ8.js +1 -0
  46. package/dist-ssg/client/assets/webworkerAll-CRDyRj3u.js +1 -0
  47. package/dist-ssg/client/index.ssg.html +2 -2
  48. package/dist-ssg/server/entry-server.js +12 -7
  49. package/package.json +1 -1
  50. package/dist/assets/CanvasRenderer-BvJ57saF.js +0 -1
  51. package/dist/assets/WebGLRenderer-VXF8vzh6.js +0 -1
  52. package/dist/assets/WebGPURenderer-DszKNDvC.js +0 -1
  53. package/dist/assets/browserAll-BomnP5JZ.js +0 -1
  54. package/dist/assets/dist-B-rilAHT.js +0 -1
  55. package/dist/assets/dist-BUDl0WqY.js +0 -1
  56. package/dist/assets/dist-CCZS5muB.js +0 -1
  57. package/dist/assets/index-0-iaoO9x.css +0 -1
  58. package/dist/assets/trpc-_eOfTj_j.js +0 -1
  59. package/dist/assets/webworkerAll-Cjx0ddJr.js +0 -1
  60. package/dist-ssg/client/assets/CanvasRenderer-CzWj-jTd.js +0 -1
  61. package/dist-ssg/client/assets/WebGLRenderer-BtSY66Gv.js +0 -1
  62. package/dist-ssg/client/assets/WebGPURenderer-CuFr8c2N.js +0 -1
  63. package/dist-ssg/client/assets/browserAll-BA_Fhu-2.js +0 -1
  64. package/dist-ssg/client/assets/dist-BkDkNU9b.js +0 -1
  65. package/dist-ssg/client/assets/dist-CEKX9a9U.js +0 -1
  66. package/dist-ssg/client/assets/dist-DV_IQhBV.js +0 -1
  67. package/dist-ssg/client/assets/index-BYFn1MsR.css +0 -2
  68. package/dist-ssg/client/assets/trpc-BNNXrVzL.js +0 -1
  69. package/dist-ssg/client/assets/webworkerAll-CPbxFeiO.js +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-BngumzOu.js","assets/chunk-DECur_0Z.js","assets/html-UgL0pUTh.js","assets/css-MgOOddo9.js","assets/javascript-DweALdcl.js","assets/angular-ts-C6vKMqNQ.js","assets/scss-CPtRJnQJ.js","assets/apl-CanOX78I.js","assets/json-BsydYQ7o.js","assets/xml-DY6OW6fx.js","assets/java-CJzioqY5.js","assets/astro-D3RhqyEX.js","assets/postcss-BtHn3WbL.js","assets/tsx-D6BgBzWj.js","assets/typescript-C5zt0SwC.js","assets/blade-DL2UFKF3.js","assets/html-derivative-CWqzWmfe.js","assets/sql-C-Fa9hzb.js","assets/bsl-baasCE8P.js","assets/sdbl-lyJ_q2qY.js","assets/c-BOqe9lRQ.js","assets/cairo-BkvliMUx.js","assets/python-B0QK5ArY.js","assets/cobol-Bh6VT3qK.js","assets/coffee-B0QZgCFK.js","assets/cpp-K7si_9PA.js","assets/glsl-COhnwF2O.js","assets/regexp-ClEH90rn.js","assets/crystal-CkrKPPPJ.js","assets/shellscript-BO8cBTbG.js","assets/edge-QC_gsDDT.js","assets/elixir-CLr7lZvD.js","assets/elm-C7vdad3p.js","assets/erb-CpyGfXUh.js","assets/ruby-D8NfXwCK.js","assets/graphql-DKIR2AFZ.js","assets/jsx-DfCzNrFp.js","assets/haml-BwSG8gbZ.js","assets/lua-Cl7HpIv3.js","assets/yaml-hSl-jO2_.js","assets/erlang-vfCdWglx.js","assets/markdown-jQZFZ3m0.js","assets/fortran-fixed-form-eRZkDVxE.js","assets/fortran-free-form-dGWJP-PE.js","assets/fsharp-lKBUVRnt.js","assets/gdresource-C_R0x-CQ.js","assets/gdscript-CW6S_vBb.js","assets/gdshader-BqnlaYeo.js","assets/git-commit-SMAxcXsl.js","assets/diff-Eg5NxGYi.js","assets/git-rebase-3yOGJ52K.js","assets/glimmer-js-B4B76dDY.js","assets/glimmer-ts-DQpCtGkl.js","assets/hack-483kQD0h.js","assets/handlebars-BTt4M9z6.js","assets/http-XCrN_CGn.js","assets/hurl-CfAoEXjj.js","assets/csv-DkOKkcud.js","assets/hxml-BNnDhNNK.js","assets/haxe-BPFrQPtj.js","assets/jinja-CAumwAh3.js","assets/jison-DXiwFEpC.js","assets/julia-D_rxuOJz.js","assets/r-Bxdh_Vt4.js","assets/latex-D0WE8LAX.js","assets/tex-BJpc6dbv.js","assets/liquid-CBi5ZjV2.js","assets/marko-Wx-5ycuy.js","assets/less-BZZ-PLfd.js","assets/mdc-Cnw__bfS.js","assets/nginx-CSLtRIGs.js","assets/nim-Bl94tPNK.js","assets/perl-AQuNRAmj.js","assets/php-Bm5VHYVk.js","assets/pug-Qd0aeXah.js","assets/qml-DdPnfnAH.js","assets/razor-BIPGoiD9.js","assets/csharp-_SaU5MOa.js","assets/rst-C5Xv_6wF.js","assets/cmake-BHzgnx8G.js","assets/sas-DTaGstnC.js","assets/shaderlab-DhaYSNG2.js","assets/hlsl-g9gCsmqR.js","assets/shellsession-mh7kK8rm.js","assets/soy-Y4jbujLe.js","assets/sparql-CbwLv0Nv.js","assets/turtle-CrO-XU5O.js","assets/stata-DGls8UgY.js","assets/svelte-gQr6WDsc.js","assets/templ-CAmLeg1s.js","assets/go-qASC_aC8.js","assets/ts-tags-CTBvtuWV.js","assets/twig-BC4BZrit.js","assets/vue-CWweBK92.js","assets/vue-html-B29OwJ5K.js","assets/vue-vine-Caa--IjA.js","assets/stylus-DBx-JbUM.js","assets/xsl-CAbj-pad.js","assets/dist-DVFW0GyF.js","assets/dist-BGaHY1kO.js","assets/dist-QUHuPJsA.js","assets/dist-DltQmFDE.js","assets/dist-BkDkNU9b.js","assets/dist-CLKxKEQH.js","assets/dist-CGXgRYaV.js","assets/dist--FTL3P_Y.js","assets/dist-BiexWhMB.js","assets/dist-om9Y_fPQ.js","assets/dist-CEKX9a9U.js","assets/dist-gAWuPgK4.js","assets/dist-DkDWFWp_.js","assets/dist-CIsUmA-3.js","assets/dist-BuC62uCX.js","assets/dist-ExQdmG6u.js","assets/dist-BNF0fuPB.js","assets/dist-BwrSUFdo.js","assets/dist-CRs-U2qz.js","assets/dist-CbIYKZT0.js","assets/dist-DV_IQhBV.js","assets/dockerfile-Ci0-ApQC.js","assets/simple-mode-kdHrpFjq.js","assets/factor-DMvifS-k.js","assets/nsis-BbRIeGvl.js","assets/pug-D1ZtszdL.js","assets/javascript-BcqCeS4O.js","assets/dist-BnyqJBh5.js","assets/dist-ByPvaULS.js","assets/browserAll-BA_Fhu-2.js","assets/Geometry-CNDxiJq_.js","assets/init-TkJkDsGL.js","assets/webworkerAll-CPbxFeiO.js","assets/WebGPURenderer-CuFr8c2N.js","assets/WebGLRenderer-BtSY66Gv.js","assets/CanvasRenderer-CzWj-jTd.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-BngumzOu.js","assets/chunk-DECur_0Z.js","assets/html-UgL0pUTh.js","assets/css-MgOOddo9.js","assets/javascript-DweALdcl.js","assets/angular-ts-C6vKMqNQ.js","assets/scss-CPtRJnQJ.js","assets/apl-CanOX78I.js","assets/json-BsydYQ7o.js","assets/xml-DY6OW6fx.js","assets/java-CJzioqY5.js","assets/astro-D3RhqyEX.js","assets/postcss-BtHn3WbL.js","assets/tsx-D6BgBzWj.js","assets/typescript-C5zt0SwC.js","assets/blade-DL2UFKF3.js","assets/html-derivative-CWqzWmfe.js","assets/sql-C-Fa9hzb.js","assets/bsl-baasCE8P.js","assets/sdbl-lyJ_q2qY.js","assets/c-BOqe9lRQ.js","assets/cairo-BkvliMUx.js","assets/python-B0QK5ArY.js","assets/cobol-Bh6VT3qK.js","assets/coffee-B0QZgCFK.js","assets/cpp-K7si_9PA.js","assets/glsl-COhnwF2O.js","assets/regexp-ClEH90rn.js","assets/crystal-CkrKPPPJ.js","assets/shellscript-BO8cBTbG.js","assets/edge-QC_gsDDT.js","assets/elixir-CLr7lZvD.js","assets/elm-C7vdad3p.js","assets/erb-CpyGfXUh.js","assets/ruby-D8NfXwCK.js","assets/graphql-DKIR2AFZ.js","assets/jsx-DfCzNrFp.js","assets/haml-BwSG8gbZ.js","assets/lua-Cl7HpIv3.js","assets/yaml-hSl-jO2_.js","assets/erlang-vfCdWglx.js","assets/markdown-jQZFZ3m0.js","assets/fortran-fixed-form-eRZkDVxE.js","assets/fortran-free-form-dGWJP-PE.js","assets/fsharp-lKBUVRnt.js","assets/gdresource-C_R0x-CQ.js","assets/gdscript-CW6S_vBb.js","assets/gdshader-BqnlaYeo.js","assets/git-commit-SMAxcXsl.js","assets/diff-Eg5NxGYi.js","assets/git-rebase-3yOGJ52K.js","assets/glimmer-js-B4B76dDY.js","assets/glimmer-ts-DQpCtGkl.js","assets/hack-483kQD0h.js","assets/handlebars-BTt4M9z6.js","assets/http-XCrN_CGn.js","assets/hurl-CfAoEXjj.js","assets/csv-DkOKkcud.js","assets/hxml-BNnDhNNK.js","assets/haxe-BPFrQPtj.js","assets/jinja-CAumwAh3.js","assets/jison-DXiwFEpC.js","assets/julia-D_rxuOJz.js","assets/r-Bxdh_Vt4.js","assets/latex-D0WE8LAX.js","assets/tex-BJpc6dbv.js","assets/liquid-CBi5ZjV2.js","assets/marko-Wx-5ycuy.js","assets/less-BZZ-PLfd.js","assets/mdc-Cnw__bfS.js","assets/nginx-CSLtRIGs.js","assets/nim-Bl94tPNK.js","assets/perl-AQuNRAmj.js","assets/php-Bm5VHYVk.js","assets/pug-Qd0aeXah.js","assets/qml-DdPnfnAH.js","assets/razor-BIPGoiD9.js","assets/csharp-_SaU5MOa.js","assets/rst-C5Xv_6wF.js","assets/cmake-BHzgnx8G.js","assets/sas-DTaGstnC.js","assets/shaderlab-DhaYSNG2.js","assets/hlsl-g9gCsmqR.js","assets/shellsession-mh7kK8rm.js","assets/soy-Y4jbujLe.js","assets/sparql-CbwLv0Nv.js","assets/turtle-CrO-XU5O.js","assets/stata-DGls8UgY.js","assets/svelte-gQr6WDsc.js","assets/templ-CAmLeg1s.js","assets/go-qASC_aC8.js","assets/ts-tags-CTBvtuWV.js","assets/twig-BC4BZrit.js","assets/vue-CWweBK92.js","assets/vue-html-B29OwJ5K.js","assets/vue-vine-Caa--IjA.js","assets/stylus-DBx-JbUM.js","assets/xsl-CAbj-pad.js","assets/dist-DVFW0GyF.js","assets/dist-BGaHY1kO.js","assets/dist-QUHuPJsA.js","assets/dist-DltQmFDE.js","assets/dist-ChU3_-xm.js","assets/dist-CLKxKEQH.js","assets/dist-C6Saw614.js","assets/dist--FTL3P_Y.js","assets/dist-BiexWhMB.js","assets/dist-CvWPf8Kt.js","assets/dist-DXI2Tp9R.js","assets/dist-ZQqxlnHI.js","assets/dist-BVyK6lB7.js","assets/dist-DwzmuYUo.js","assets/dist-BKDi1Kni.js","assets/dist-ExQdmG6u.js","assets/dist-BNF0fuPB.js","assets/dist-DTs2RD81.js","assets/dist-CRs-U2qz.js","assets/dist-CbIYKZT0.js","assets/dist-OfFe6OoM.js","assets/dockerfile-Ci0-ApQC.js","assets/simple-mode-kdHrpFjq.js","assets/factor-DMvifS-k.js","assets/nsis-BbRIeGvl.js","assets/pug-D1ZtszdL.js","assets/javascript-BcqCeS4O.js","assets/dist-Chnwmoeu.js","assets/dist-oGrBvbG8.js","assets/browserAll-CDjVpdx6.js","assets/Geometry-CNDxiJq_.js","assets/init-DdhjNhOt.js","assets/webworkerAll-CRDyRj3u.js","assets/WebGPURenderer-BYG_ICu9.js","assets/WebGLRenderer-DVK96Dop.js","assets/CanvasRenderer-DfVz9CSz.js"])))=>i.map(i=>d[i]);
2
2
  import{n as e,r as t,t as n}from"./chunk-DECur_0Z.js";import{$ as r,A as i,At as a,B as o,C as s,Ct as c,D as l,Dt as u,E as d,Et as f,F as p,Ft as m,G as h,H as g,I as _,It as v,K as y,L as b,Lt as x,M as S,Mt as C,Nt as w,O as T,Ot as E,P as D,Pt as O,Q as k,R as A,S as j,St as M,T as N,Tt as P,U as F,V as I,W as ee,X as L,Y as R,Z as z,_ as te,a as B,at as ne,b as re,bt as V,c as H,ct as ie,d as ae,dt as oe,et as se,f as ce,ft as le,g as ue,gt as de,h as fe,i as pe,it as me,j as he,jt as ge,k as _e,kt as ve,l as U,lt as ye,m as be,mt as xe,n as Se,nt as Ce,o as we,p as Te,pt as Ee,q as De,r as Oe,rt as ke,s as Ae,st as je,t as Me,u as Ne,ut as Pe,v as Fe,vt as Ie,w as Le,wt as Re,x as ze,xt as Be,z as Ve}from"./dist-QUHuPJsA.js";import{a as He,i as Ue,n as We,o as Ge,r as Ke}from"./dist--FTL3P_Y.js";import{i as qe,n as Je,o as Ye,r as Xe,t as Ze}from"./dist-BGaHY1kO.js";import{$ as Qe,A as $e,B as et,C as tt,E as nt,F as rt,G as it,H as at,I as ot,J as st,K as ct,L as lt,N as ut,O as dt,P as ft,Q as pt,R as mt,T as ht,U as gt,W as _t,X as vt,Y as yt,Z as bt,_ as xt,a as St,b as Ct,c as wt,d as Tt,et as Et,f as Dt,g as Ot,h as kt,i as At,it as jt,j as Mt,k as Nt,l as Pt,m as Ft,n as It,nt as Lt,o as Rt,q as zt,r as Bt,rt as W,s as Vt,t as Ht,tt as Ut,u as Wt,v as Gt,w as Kt,x as qt,y as Jt,z as Yt}from"./Geometry-CNDxiJq_.js";import{t as Xt}from"./ImageSource-DsthkIsU.js";import{C as Zt,D as Qt,E as $t,O as en,S as tn,T as nn,_ as rn,a as an,b as on,c as sn,d as cn,f as ln,g as un,h as dn,i as fn,k as pn,l as mn,m as hn,n as gn,o as _n,p as vn,r as yn,s as bn,t as xn,u as Sn,v as Cn,w as wn,x as Tn,y as En}from"./RenderTargetSystem-CLQIFvVz.js";import{t as Dn}from"./getTextureBatchBindGroup-CqvclRGr.js";import{a as On,c as kn,d as An,f as jn,i as Mn,l as Nn,n as Pn,o as Fn,p as In,r as Ln,s as Rn,t as zn,u as Bn}from"./BufferResource-DKNednNt.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)}})();var Vn=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}}}})),Hn=n(((e,t)=>{t.exports=Vn()})),Un=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=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)},ee={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ee,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.0`})),Wn=n(((e,t)=>{t.exports=Un()})),Gn=n((e=>{var t=Wn();function n(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 r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.0`})),Kn=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=Gn()})),qn=n((e=>{var t=Hn(),n=Wn(),r=Kn();function i(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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(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 s(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 c(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 l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),D=Symbol.for(`react.memo_cache_sentinel`),O=Symbol.iterator;function k(e){return typeof e!=`object`||!e?null:(e=O&&e[O]||e[`@@iterator`],typeof e==`function`?e:null)}var A=Symbol.for(`react.client.reference`);function j(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===A?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?j(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return j(e(t))}catch{}}return null}var M=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},I=[],ee=-1;function L(e){return{current:e}}function R(e){0>ee||(e.current=I[ee],I[ee]=null,ee--)}function z(e,t){ee++,I[ee]=e.current,e.current=t}var te=L(null),B=L(null),ne=L(null),re=L(null);function V(e,t){switch(z(ne,t),z(B,e),z(te,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?qd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=qd(t),e=Jd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}R(te),z(te,e)}function H(){R(te),R(B),R(ne)}function ie(e){e.memoizedState!==null&&z(re,e);var t=te.current,n=Jd(t,e.type);t!==n&&(z(B,e),z(te,n))}function ae(e){B.current===e&&(R(te),R(B)),re.current===e&&(R(re),ip._currentValue=F)}var oe,se;function ce(e){if(oe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);oe=t&&t[1]||``,se=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+oe+e+se}var le=!1;function ue(e,t){if(!e||le)return``;le=!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(`
@@ -43,7 +43,7 @@ Error generating stack: `+e.message+`
43
43
  .dark dialog.openspec-dialog::backdrop {
44
44
  background-color: rgba(255, 255, 255, 0.2);
45
45
  }
46
- `,[])),(0,K.jsx)(`dialog`,{ref:f,className:`openspec-dialog m-0 h-dvh w-screen max-w-none border-0 bg-transparent p-0 ${o}`,children:(0,K.jsx)(`div`,{className:`flex h-full w-full items-center justify-center px-4 py-4 ${s}`,children:(0,K.jsxs)(`div`,{ref:p,className:`bg-background text-foreground relative flex h-fit w-[calc(100%-0.5rem)] max-w-2xl flex-col overflow-hidden rounded-[var(--openspec-dialog-radius,0.75rem)] border shadow-xl ${m} ${c}`,style:{maxHeight:u},children:[(0,K.jsxs)(`div`,{className:`border-border flex flex-none shrink-0 items-center justify-between border-b px-4 py-3`,children:[(0,K.jsx)(`div`,{className:`flex items-center gap-2`,children:t}),(0,K.jsx)(`button`,{onClick:n,className:`hover:bg-muted rounded p-1`,"aria-label":`Close dialog`,children:(0,K.jsx)(Sl,{className:`h-4 w-4`})})]}),(0,K.jsx)(`div`,{className:`scrollbar-thin scrollbar-track-transparent min-h-0 flex-1 overflow-auto px-4 py-3 ${l}`,children:i}),a&&(0,K.jsx)(`div`,{className:`border-border flex flex-none shrink-0 items-center justify-end gap-2 border-t px-4 py-3`,children:a})]})})})}var El=/^\/versions\/[^/]+(?:\/|$)/;function Dl(e){let t=e.trim();if(!t)return null;let n;try{n=new URL(t)}catch{return null}n.hash=``,n.search=``;let r=n.pathname.replace(/\/+$/,``);return n.pathname=r.length>0?r:`/`,n.toString().replace(/\/$/,(n.pathname,``))}function Ol(e,t){return new URLSearchParams(e).get(t)?.trim()||null}function kl(e){return El.test(e)}function Al(e){let t=kl(e.pathname);return{hosted:t,apiBaseUrl:Dl(Ol(e.search,`api`)??``),sessionId:t?Ol(e.search,`session`):null}}function jl(e,t){let n=Al(t);return n.hosted&&n.sessionId?`hosted-session:${n.sessionId}:${e}`:e}function Ml(){return typeof window<`u`&&window.location!==void 0}function Nl(){return Ml()?Al(window.location):{hosted:!1,apiBaseUrl:null,sessionId:null}}function Pl(){return Ml()?Nl().apiBaseUrl??``:``}function Fl(e){if(!Ml())return``;let t=Pl();if(t){let n=new URL(t);return`${n.protocol===`https:`?`wss:`:`ws:`}//${n.host}${e}`}return`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}${e}`}function Il(){return Fl(`/trpc`)}function Ll(){return Fl(`/ws/pty`)}function Rl(){let e=Pl();return e?`${e}/trpc`:`/trpc`}function zl(){let e=Pl();return e?`${e}/api/health`:`/api/health`}var Bl=null;typeof window<`u`&&window.__OPENSPEC_STATIC_MODE__===!0&&(Bl=!0,console.log(`[static-mode] Detected static export mode (via flag)`));function Vl(){return Bl===!0}function Hl(e){Bl=e}var Ul=null;function Wl(){return Ul===null?typeof window<`u`&&window.__OPENSPEC_BASE_PATH__||`./`:Ul}function Gl(){return typeof window<`u`&&window.__INITIAL_DATA__?window.__INITIAL_DATA__:null}var Kl=`modulepreload`,ql=function(e){return`/`+e},Jl={},q=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=ql(t,n),t in Jl)return;Jl[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Kl,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Yl=[`/dashboard`,`/config`,`/git`,`/specs`,`/changes`,`/archive`,`/settings`,`/terminal`],Xl=[`/dashboard`,`/config`,`/specs`,`/changes`,`/archive`,`/settings`],Zl=Vl()?[]:[`/git`,`/terminal`],Ql=[`/search`,`/opsx-new`,`/opsx-propose`,`/opsx-verify`,`/opsx-compose`];function $l(){return jl(`nav-layout`,window.location)}function eu(e){return jl(`nav-layout:${encodeURIComponent(e)}`,window.location)}var tu=300;function nu(e){return Yl.includes(e)}function ru(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`&&nu(e)):[]}function iu(e){if(typeof e!=`object`||!e)return null;let t=e;return!Array.isArray(t.mainTabs)||!Array.isArray(t.bottomTabs)?null:{mainTabs:ru(t.mainTabs),bottomTabs:ru(t.bottomTabs),updatedAt:typeof t.updatedAt==`number`?t.updatedAt:0}}function au(e,t){if(typeof e!=`object`||!e)return{__TSR_index:0,key:t,__TSR_key:t};let n=e,r=typeof n.key==`string`?n.key:t,i=typeof n.__TSR_key==`string`?n.__TSR_key:r,a=typeof n.__TSR_index==`number`?n.__TSR_index:0;return{...n,key:r,__TSR_key:i,__TSR_index:a}}function ou(e,t){let n=new URL(e,`http://nav.local`),r=`${n.pathname}${n.search}${n.hash}`,i=Math.random().toString(36).slice(2);return{href:r,pathname:n.pathname||`/`,search:n.search,hash:n.hash,state:au(t,i)}}function su(e){let t=e.trim();if(!t||t===`./`||t===`.`)return`/`;let n=t.startsWith(`/`)?t:`/${t}`;return(n.endsWith(`/`)?n:`${n}/`).replace(/\/+/g,`/`)}function cu(e,t){return t===`/`?e||`/`:e===t.slice(0,-1)?`/`:e.startsWith(t)?e.slice(t.length-1)||`/`:e||`/`}function lu(e,t){if(t===`/`)return e||`/`;let n=e.startsWith(`/`)?e:`/${e}`;return n===`/`?t.slice(0,-1)||`/`:`${t.slice(0,-1)}${n}`}function uu(e){if(typeof window>`u`)return e;let t=new URL(e,window.location.origin),n=su(Wl());return t.pathname=cu(t.pathname,n),`${t.pathname}${t.search}${t.hash}`}function du(e,t){for(let n of[`api`,`session`]){let r=t.searchParams.get(n);r&&!e.searchParams.has(n)&&e.searchParams.set(n,r)}}function fu(e){for(let t of Yl)if(e===t||e.startsWith(t+`/`))return t;return null}function pu(e,t){if(t===`pop`)return null;let n=t===`main`?e.mainLocation:e.bottomLocation,r=t===`main`?e.mainTabs:e.bottomTabs,i=fu(n.pathname);return i&&r.includes(i)?i:null}function mu(e){return Ql.some(t=>e===t||e.startsWith(t+`/`))}function hu(e,t){if(mu(t))return`pop`;let n=fu(t);return n&&e.bottomTabs.includes(n)?`bottom`:`main`}function gu(e){let t=new Set,n=[],r=[];for(let r of e.mainTabs)t.has(r)||(n.push(r),t.add(r));for(let n of e.bottomTabs)t.has(n)||(r.push(n),t.add(n));for(let e of Yl)t.has(e)||(Zl.includes(e)?r.push(e):n.push(e));return{mainTabs:n,bottomTabs:r}}function _u(e,t){if(t.length===0)return ou(`/`);let n=fu(e.pathname);return n&&!t.includes(n)?ou(`/`):e}function vu(e,t){if(t.length===0)return ou(`/`);if(e.pathname===`/`)return ou(`/`,e.state);let n=fu(e.pathname);return!n||!t.includes(n)?ou(`/`):e}function yu(e){return e.pathname===`/`?ou(`/`,e.state):mu(e.pathname)?e:ou(`/`)}function bu(e){let t=gu({mainTabs:e.mainTabs,bottomTabs:e.bottomTabs});return{...e,mainTabs:t.mainTabs,bottomTabs:t.bottomTabs,mainLocation:_u(e.mainLocation,t.mainTabs),bottomLocation:vu(e.bottomLocation,t.bottomTabs),popLocation:yu(e.popLocation)}}function xu(e,t){let n=new URL(e.href),r=su(Wl());n.pathname=cu(n.pathname,r);let i=n.searchParams.get(`_b`),a=n.searchParams.get(`_p`);n.searchParams.delete(`_b`),n.searchParams.delete(`_p`);let o=window.history.state,s=ou(`${n.pathname}${n.search}${n.hash}`,o?.main),c=ou(i??`/`,o?.bottom),l=ou(a??`/`,o?.pop);if(!i&&!a){let e=hu(t,s.pathname);e===`bottom`?(c=s,s=ou(`/`,o?.main)):e===`pop`&&(l=s,s=ou(`/`,o?.main))}return{main:_u(s,t.mainTabs),bottom:vu(c,t.bottomTabs),pop:yu(l)}}function Su(e){let t=new URL(window.location.href),n=new URL(e.mainLocation.href,window.location.origin),r=su(Wl());return n.pathname=lu(n.pathname,r),du(n,t),n.searchParams.delete(`_b`),n.searchParams.delete(`_p`),e.bottomTabs.length>0&&n.searchParams.set(`_b`,e.bottomLocation.href),e.popLocation.pathname!==`/`&&n.searchParams.set(`_p`,e.popLocation.href),`${n.pathname}${n.search}${n.hash}`}function Cu(e,t){return e.length===t.length?e.every((e,n)=>e===t[n]):!1}function wu(){return{mainTabs:[...Xl],bottomTabs:[...Zl],updatedAt:0,mainLocation:ou(`/dashboard`),bottomLocation:ou(`/`),popLocation:ou(`/`)}}function Tu(){try{let e=localStorage.getItem($l());return e?iu(JSON.parse(e)):null}catch{return null}}function Eu(e){try{let t=localStorage.getItem(e);return t?iu(JSON.parse(t)):null}catch{return null}}function Du(e,t=$l()){try{localStorage.setItem(t,JSON.stringify(e))}catch{}}function Ou(e){let t=fu(e.pathname);return!t||e.pathname===t?e:t===`/changes`||t===`/specs`||t===`/archive`?ou(t,e.state):e}var ku=[({prevState:e,nextState:t,event:n})=>{if(n.type!==`MOVE_TAB`)return t;let r=e.bottomTabs.includes(n.tabId)?`bottom`:`main`;if(pu(e,r)!==n.tabId)return t;let i=r===`main`?e.mainLocation:e.bottomLocation,a=ou(i.href,i.state);return n.targetArea===`main`?{...t,mainLocation:a}:{...t,bottomLocation:a}},({nextState:e})=>e.mainTabs.length===0||pu(e,`main`)!=null?e:{...e,mainLocation:ou(e.mainTabs[0])}];function Au(e,t,n){let r=t;for(let t of ku)r=t({prevState:e,nextState:r,event:n});return r}function ju(e,t){switch(t.type){case`NAVIGATE`:{let n=t.sourceArea===`pop`?`pop`:hu(e,t.location.pathname);return{nextState:n===`main`?{...e,mainLocation:t.location}:n===`bottom`?{...e,bottomLocation:t.location}:{...e,popLocation:t.location},changed:!0,urlAction:t.action,notify:n===t.sourceArea?[]:[{area:n,type:t.action}],persist:`none`}}case`POPSTATE`:return{nextState:{...e,mainLocation:t.mainLocation,bottomLocation:t.bottomLocation,popLocation:t.popLocation},changed:!0,notify:[{area:`main`,type:`BACK`},{area:`bottom`,type:`BACK`},{area:`pop`,type:`BACK`}],persist:`none`};case`MOVE_TAB`:{let n=e.bottomTabs.includes(t.tabId)?`bottom`:`main`;if(n===t.targetArea)return{nextState:e,changed:!1,notify:[],persist:`none`};let r=e.mainTabs.filter(e=>e!==t.tabId),i=e.bottomTabs.filter(e=>e!==t.tabId),a=t.targetArea===`main`?[...r,t.tabId]:r,o=t.targetArea===`bottom`?[...i,t.tabId]:i,s=e.mainLocation,c=e.bottomLocation;return fu((n===`main`?e.mainLocation:e.bottomLocation).pathname)===t.tabId&&(n===`main`?s=ou(`/`):c=ou(`/`)),{nextState:{...e,mainTabs:a,bottomTabs:o,mainLocation:s,bottomLocation:c},changed:!0,urlAction:`REPLACE`,notify:[{area:`main`,type:`REPLACE`},{area:`bottom`,type:`REPLACE`}],persist:`local_and_remote`}}case`REORDER`:{let n=t.area===`main`?e.mainTabs:e.bottomTabs,r=new Set(n),i=t.tabIds.filter(e=>r.has(e));for(let e of n)i.includes(e)||i.push(e);return Cu(n,i)?{nextState:e,changed:!1,notify:[],persist:`none`}:{nextState:t.area===`main`?{...e,mainTabs:i}:{...e,bottomTabs:i},changed:!0,notify:[],persist:`local_and_remote`}}case`CLOSE_TAB`:{let n=e.bottomTabs.includes(t.tabId),r=e.mainTabs.includes(t.tabId);return!n&&!r?{nextState:e,changed:!1,notify:[],persist:`none`}:n?fu(e.bottomLocation.pathname)===t.tabId?{nextState:{...e,bottomLocation:ou(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`}:{nextState:e,changed:!1,notify:[],persist:`none`}:fu(e.mainLocation.pathname)===t.tabId?{nextState:{...e,mainLocation:ou(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`}:{nextState:e,changed:!1,notify:[],persist:`none`}}case`ACTIVATE_BOTTOM`:return hu(e,t.location.pathname)===`bottom`?{nextState:{...e,bottomLocation:t.location},changed:!0,urlAction:`PUSH`,notify:[{area:`bottom`,type:`PUSH`}],persist:`none`}:{nextState:e,changed:!1,notify:[],persist:`none`};case`DEACTIVATE_BOTTOM`:return e.bottomLocation.pathname===`/`?{nextState:e,changed:!1,notify:[],persist:`none`}:{nextState:{...e,bottomLocation:ou(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`};case`ACTIVATE_POP`:return hu(e,t.location.pathname)===`pop`?{nextState:{...e,popLocation:t.location},changed:!0,urlAction:`PUSH`,notify:[{area:`pop`,type:`PUSH`}],persist:`none`}:{nextState:e,changed:!1,notify:[],persist:`none`};case`DEACTIVATE_POP`:return e.popLocation.pathname===`/`?{nextState:e,changed:!1,notify:[],persist:`none`}:{nextState:{...e,popLocation:ou(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`};case`APPLY_LAYOUT`:{if(t.layout.updatedAt<=e.updatedAt)return{nextState:e,changed:!1,notify:[],persist:`none`};let n=gu(t.layout);return{nextState:{...e,mainTabs:n.mainTabs,bottomTabs:n.bottomTabs,updatedAt:t.layout.updatedAt},changed:!0,urlAction:`REPLACE`,notify:[{area:`main`,type:`REPLACE`},{area:`bottom`,type:`REPLACE`}],persist:`local_only`}}}}function Mu(e,t,n){return n===`main`?e.mainLocation.href!==t.mainLocation.href:n===`bottom`?e.bottomLocation.href!==t.bottomLocation.href:e.popLocation.href!==t.popLocation.href}function Nu(e,t,n){let r=[...e];for(let e of[`main`,`bottom`,`pop`])Mu(t,n,e)&&(r.some(t=>t.area===e)||r.push({area:e,type:`REPLACE`}));return r}var Pu=new class{mainHistory=null;bottomHistory=null;popHistory=null;state=wu();listeners=new Set;snapshotCache=null;persistTimer=null;kvUnsubscribe=null;initialized=!1;storageKey=typeof window>`u`?`nav-layout`:jl(`nav-layout`,window.location);constructor(){if(typeof window>`u`)return;let e=Vl()?null:Tu();if(e!=null){let t=gu(e);this.state={...this.state,mainTabs:t.mainTabs,bottomTabs:t.bottomTabs,updatedAt:e.updatedAt}}let t=xu(window.location,this.state),n=bu({...this.state,mainLocation:t.main,bottomLocation:t.bottom,popLocation:t.pop});n=bu(Au(n,n,{type:`BOOTSTRAP`})),this.state=n,this.normalizeUrl(),window.addEventListener(`popstate`,this.handlePopState)}setHistoryRef(e,t){e===`main`?this.mainHistory=t:e===`bottom`?this.bottomHistory=t:this.popHistory=t}getLocation(e){return e===`main`?this.state.mainLocation:e===`bottom`?this.state.bottomLocation:this.state.popLocation}push(e,t,n){this.dispatch({type:`NAVIGATE`,sourceArea:e,action:`PUSH`,location:ou(uu(t),n)})}replace(e,t,n){this.dispatch({type:`NAVIGATE`,sourceArea:e,action:`REPLACE`,location:ou(uu(t),n)})}createHref(e,t,n){if(typeof window>`u`)return t;let{nextState:r}=this.computeTransition({type:`NAVIGATE`,sourceArea:e,action:`PUSH`,location:ou(uu(t),n)});return Su(r)}get mainTabs(){return this.state.mainTabs}get bottomTabs(){return this.state.bottomTabs}getAreaForPath(e){return hu(this.state,e)}moveTab(e,t){this.dispatch({type:`MOVE_TAB`,tabId:e,targetArea:t})}reorder(e,t){this.dispatch({type:`REORDER`,area:e,tabIds:t})}closeTab(e){this.dispatch({type:`CLOSE_TAB`,tabId:e})}activateBottom(e){this.dispatch({type:`ACTIVATE_BOTTOM`,location:ou(e)})}deactivateBottom(){this.dispatch({type:`DEACTIVATE_BOTTOM`})}activatePop(e){this.dispatch({type:`ACTIVATE_POP`,location:ou(e)})}deactivatePop(){this.dispatch({type:`DEACTIVATE_POP`})}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}getSnapshot(){if(this.snapshotCache)return this.snapshotCache;let e=fu(this.state.bottomLocation.pathname);return this.snapshotCache={mainTabs:[...this.state.mainTabs],bottomTabs:[...this.state.bottomTabs],mainLocation:this.state.mainLocation,bottomLocation:this.state.bottomLocation,popLocation:this.state.popLocation,bottomActive:e!=null&&this.state.bottomTabs.includes(e),popActive:this.state.popLocation.pathname!==`/`},this.snapshotCache}async init(){if(!(this.initialized||Vl())){this.initialized=!0;try{let e=await this.resolveProjectScopedStorageKey();e&&e!==this.storageKey&&(this.storageKey=e,this.rebindProjectScopedLayout(e));let{trpcClient:t}=await q(async()=>{let{trpcClient:e}=await import(`./trpc-BNNXrVzL.js`);return{trpcClient:e}},[]),n=iu(await t.kv.get.query({key:this.storageKey}));n?n.updatedAt>this.state.updatedAt?this.dispatch({type:`APPLY_LAYOUT`,layout:n}):this.state.updatedAt>n.updatedAt&&t.kv.set.mutate({key:this.storageKey,value:{mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:this.state.updatedAt}}).catch(()=>{}):this.state.updatedAt>0&&t.kv.set.mutate({key:this.storageKey,value:{mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:this.state.updatedAt}}).catch(()=>{});let r=t.kv.subscribe.subscribe({key:this.storageKey},{onData:e=>{let t=iu(e);t&&this.dispatch({type:`APPLY_LAYOUT`,layout:t})}});this.kvUnsubscribe=()=>r.unsubscribe()}catch{}}}destroy(){typeof window<`u`&&window.removeEventListener(`popstate`,this.handlePopState),this.cancelPersistTimer(),this.kvUnsubscribe&&=(this.kvUnsubscribe(),null)}handlePopState=()=>{let e=xu(window.location,this.state);this.dispatch({type:`POPSTATE`,mainLocation:e.main,bottomLocation:e.bottom,popLocation:e.pop})};computeTransition(e){let t=ju(this.state,e);if(!t.changed)return{transition:t,nextState:this.state};let n=Au(this.state,t.nextState,e);return n=bu(n),{transition:t,nextState:n}}dispatch(e){if(typeof window<`u`&&e.type!==`POPSTATE`&&this.mainHistory==null){let e=xu(window.location,this.state);this.state=bu({...this.state,mainLocation:e.main,bottomLocation:e.bottom,popLocation:e.pop})}let t=ju(this.state,e);if(!t.changed)return;let n=this.state,r=Au(n,t.nextState,e);r=bu(r),this.state=r,t.persist===`local_and_remote`?this.persistLayout():t.persist===`local_only`&&(this.cancelPersistTimer(),Du({mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:this.state.updatedAt},this.storageKey));let i=t.urlAction??(Mu(n,this.state,`main`)||Mu(n,this.state,`bottom`)||Mu(n,this.state,`pop`)?`REPLACE`:void 0);i&&this.syncToUrl(i);let a=Nu(t.notify,n,this.state);this.notifyRouters(a),this.notifyListeners()}notifyRouters(e){for(let t of e)(t.area===`main`?this.mainHistory:t.area===`bottom`?this.bottomHistory:this.popHistory)?.notify({type:t.type})}notifyListeners(){this.snapshotCache=null;for(let e of this.listeners)e()}syncToUrl(e){let t=Su(this.state),n=`${window.location.pathname}${window.location.search}${window.location.hash}`;if(e===`REPLACE`&&t===n)return;let r={main:this.state.mainLocation.state,bottom:this.state.bottomLocation.state,pop:this.state.popLocation.state};e===`PUSH`?window.history.pushState(r,``,t):window.history.replaceState(r,``,t)}normalizeUrl(){let e=Su(this.state);if(e===`${window.location.pathname}${window.location.search}${window.location.hash}`)return;let t={main:this.state.mainLocation.state,bottom:this.state.bottomLocation.state,pop:this.state.popLocation.state};window.history.replaceState(t,``,e)}cancelPersistTimer(){this.persistTimer&&=(clearTimeout(this.persistTimer),null)}persistLayout(){let e=Date.now();this.state={...this.state,updatedAt:e},Du({mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:e},this.storageKey),this.cancelPersistTimer(),this.persistTimer=setTimeout(()=>{this.persistTimer=null,q(async()=>{let{trpcClient:e}=await import(`./trpc-BNNXrVzL.js`);return{trpcClient:e}},[]).then(({trpcClient:t})=>t.kv.set.mutate({key:this.storageKey,value:{mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:e}})).catch(()=>{})},tu)}async resolveProjectScopedStorageKey(){try{let e=await fetch(zl());if(!e.ok)return null;let t=await e.json();return typeof t.projectDir!=`string`||t.projectDir.length===0?null:eu(t.projectDir)}catch{return null}}rebindProjectScopedLayout(e){let t=Eu(e);if(t){let e=gu(t);this.state=bu({...this.state,mainTabs:e.mainTabs,bottomTabs:e.bottomTabs,updatedAt:t.updatedAt}),this.normalizeUrl();return}this.state=bu({...this.state,mainLocation:Ou(this.state.mainLocation),bottomLocation:Ou(this.state.bottomLocation),updatedAt:0}),this.normalizeUrl(),this.notifyListeners()}};typeof window<`u`&&!Vl()&&Pu.init();function Fu(){return(0,G.useSyncExternalStore)(e=>Pu.subscribe(e),()=>Pu.getSnapshot(),()=>Pu.getSnapshot())}function Iu(e,t){return t.updatedAt-e.updatedAt||e.id.localeCompare(t.id)}function Lu(e){return[...e].sort(Iu)}function Ru(e,t=10){return Lu(e).slice(0,Math.max(0,Math.trunc(t)))}var zu=`project`,Bu=/^[A-Za-z]:\//;function Vu(e){return e.replace(/\\/g,`/`).replace(/\/+$/g,``)}function Hu(e){return e.startsWith(`/`)||Bu.test(e)}function Uu(e){return e.replace(/^\.?\//,``)}function Wu(e){return Vu(e).split(`/`).filter(Boolean)}function Gu(e){let t=Vu(e),n=/(?:^|\/)node_modules\/(?:\.pnpm\/[^/]+\/node_modules\/)?(@[^/]+\/[^/]+|[^/]+)(\/.*)?/.exec(t),r=n?.[1];return r?`npm:${r}${n[2]??``}`:null}function Ku(e){return`${zu}:${Uu(e)}`}function qu(e,t){let n=Vu(e),r=Vu(t),i=n.toLowerCase(),a=r.toLowerCase();return a===i||a.startsWith(`${i}/`)}function Ju(e,t){let n=Wu(e),r=Wu(t),i=0;for(;i<n.length&&i<r.length&&n[i]?.toLowerCase()===r[i]?.toLowerCase();)i+=1;return r.slice(i).join(`/`)}function Yu(e){let t=Wu(e),n=t.lastIndexOf(`openspec`);return n<0?null:t.slice(n).join(`/`)}function Xu(e,t){let n=Vu(e),r=Gu(n);return(t?.source===`package`||r)&&r?r:Hu(n)?t?.projectDir&&qu(t.projectDir,n)?Ku(Ju(t.projectDir,n)):Ku(Yu(n)||Wu(n).slice(-4).join(`/`)):Ku(n)}var Zu=Symbol.for(`yaml.alias`),Qu=Symbol.for(`yaml.document`),$u=Symbol.for(`yaml.map`),ed=Symbol.for(`yaml.pair`),td=Symbol.for(`yaml.scalar`),nd=Symbol.for(`yaml.seq`),rd=Symbol.for(`yaml.node.type`),id=e=>!!e&&typeof e==`object`&&e[rd]===Zu,ad=e=>!!e&&typeof e==`object`&&e[rd]===Qu,od=e=>!!e&&typeof e==`object`&&e[rd]===$u,sd=e=>!!e&&typeof e==`object`&&e[rd]===ed,cd=e=>!!e&&typeof e==`object`&&e[rd]===td,ld=e=>!!e&&typeof e==`object`&&e[rd]===nd;function ud(e){if(e&&typeof e==`object`)switch(e[rd]){case $u:case nd:return!0}return!1}function dd(e){if(e&&typeof e==`object`)switch(e[rd]){case Zu:case $u:case td:case nd:return!0}return!1}var fd=e=>(cd(e)||ud(e))&&!!e.anchor,pd=Symbol(`break visit`),md=Symbol(`skip children`),hd=Symbol(`remove node`);function gd(e,t){let n=bd(t);ad(e)?_d(null,e.contents,n,Object.freeze([e]))===hd&&(e.contents=null):_d(null,e,n,Object.freeze([]))}gd.BREAK=pd,gd.SKIP=md,gd.REMOVE=hd;function _d(e,t,n,r){let i=xd(e,t,n,r);if(dd(i)||sd(i))return Sd(e,r,i),_d(e,i,n,r);if(typeof i!=`symbol`){if(ud(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=_d(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===pd)return pd;else i===hd&&(t.items.splice(e,1),--e)}}else if(sd(t)){r=Object.freeze(r.concat(t));let e=_d(`key`,t.key,n,r);if(e===pd)return pd;e===hd&&(t.key=null);let i=_d(`value`,t.value,n,r);if(i===pd)return pd;i===hd&&(t.value=null)}}return i}async function vd(e,t){let n=bd(t);ad(e)?await yd(null,e.contents,n,Object.freeze([e]))===hd&&(e.contents=null):await yd(null,e,n,Object.freeze([]))}vd.BREAK=pd,vd.SKIP=md,vd.REMOVE=hd;async function yd(e,t,n,r){let i=await xd(e,t,n,r);if(dd(i)||sd(i))return Sd(e,r,i),yd(e,i,n,r);if(typeof i!=`symbol`){if(ud(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await yd(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===pd)return pd;else i===hd&&(t.items.splice(e,1),--e)}}else if(sd(t)){r=Object.freeze(r.concat(t));let e=await yd(`key`,t.key,n,r);if(e===pd)return pd;e===hd&&(t.key=null);let i=await yd(`value`,t.value,n,r);if(i===pd)return pd;i===hd&&(t.value=null)}}return i}function bd(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function xd(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(od(t))return n.Map?.(e,t,r);if(ld(t))return n.Seq?.(e,t,r);if(sd(t))return n.Pair?.(e,t,r);if(cd(t))return n.Scalar?.(e,t,r);if(id(t))return n.Alias?.(e,t,r)}function Sd(e,t,n){let r=t[t.length-1];if(ud(r))r.items[e]=n;else if(sd(r))e===`key`?r.key=n:r.value=n;else if(ad(r))r.contents=n;else{let e=id(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var Cd={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},wd=e=>e.replace(/[!,[\]{}]/g,e=>Cd[e]),Td=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+wd(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&dd(e.contents)){let t={};gd(e.contents,(e,n)=>{dd(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
46
+ `,[])),(0,K.jsx)(`dialog`,{ref:f,className:`openspec-dialog m-0 h-dvh w-screen max-w-none border-0 bg-transparent p-0 ${o}`,children:(0,K.jsx)(`div`,{className:`flex h-full w-full items-center justify-center px-4 py-4 ${s}`,children:(0,K.jsxs)(`div`,{ref:p,className:`bg-background text-foreground relative flex h-fit w-[calc(100%-0.5rem)] max-w-2xl flex-col overflow-hidden rounded-[var(--openspec-dialog-radius,0.75rem)] border shadow-xl ${m} ${c}`,style:{maxHeight:u},children:[(0,K.jsxs)(`div`,{className:`border-border flex flex-none shrink-0 items-center justify-between border-b px-4 py-3`,children:[(0,K.jsx)(`div`,{className:`flex items-center gap-2`,children:t}),(0,K.jsx)(`button`,{onClick:n,className:`hover:bg-muted rounded p-1`,"aria-label":`Close dialog`,children:(0,K.jsx)(Sl,{className:`h-4 w-4`})})]}),(0,K.jsx)(`div`,{className:`scrollbar-thin scrollbar-track-transparent min-h-0 flex-1 overflow-auto px-4 py-3 ${l}`,children:i}),a&&(0,K.jsx)(`div`,{className:`border-border flex flex-none shrink-0 items-center justify-end gap-2 border-t px-4 py-3`,children:a})]})})})}var El=/^\/versions\/[^/]+(?:\/|$)/;function Dl(e){let t=e.trim();if(!t)return null;let n;try{n=new URL(t)}catch{return null}n.hash=``,n.search=``;let r=n.pathname.replace(/\/+$/,``);return n.pathname=r.length>0?r:`/`,n.toString().replace(/\/$/,(n.pathname,``))}function Ol(e,t){return new URLSearchParams(e).get(t)?.trim()||null}function kl(e){return El.test(e)}function Al(e){let t=kl(e.pathname);return{hosted:t,apiBaseUrl:Dl(Ol(e.search,`api`)??``),sessionId:t?Ol(e.search,`session`):null}}function jl(e,t){let n=Al(t);return n.hosted&&n.sessionId?`hosted-session:${n.sessionId}:${e}`:e}function Ml(){return typeof window<`u`&&window.location!==void 0}function Nl(){return Ml()?Al(window.location):{hosted:!1,apiBaseUrl:null,sessionId:null}}function Pl(){return Ml()?Nl().apiBaseUrl??``:``}function Fl(e){if(!Ml())return``;let t=Pl();if(t){let n=new URL(t);return`${n.protocol===`https:`?`wss:`:`ws:`}//${n.host}${e}`}return`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}${e}`}function Il(){return Fl(`/trpc`)}function Ll(){return Fl(`/ws/pty`)}function Rl(){let e=Pl();return e?`${e}/trpc`:`/trpc`}function zl(){let e=Pl();return e?`${e}/api/health`:`/api/health`}var Bl=null;typeof window<`u`&&window.__OPENSPEC_STATIC_MODE__===!0&&(Bl=!0,console.log(`[static-mode] Detected static export mode (via flag)`));function Vl(){return Bl===!0}function Hl(e){Bl=e}var Ul=null;function Wl(){return Ul===null?typeof window<`u`&&window.__OPENSPEC_BASE_PATH__||`./`:Ul}function Gl(){return typeof window<`u`&&window.__INITIAL_DATA__?window.__INITIAL_DATA__:null}var Kl=`modulepreload`,ql=function(e){return`/`+e},Jl={},q=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=ql(t,n),t in Jl)return;Jl[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Kl,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Yl=[`/dashboard`,`/config`,`/git`,`/specs`,`/changes`,`/archive`,`/settings`,`/terminal`],Xl=[`/dashboard`,`/config`,`/specs`,`/changes`,`/archive`,`/settings`],Zl=Vl()?[]:[`/git`,`/terminal`],Ql=[`/search`,`/opsx-new`,`/opsx-propose`,`/opsx-verify`,`/opsx-compose`];function $l(){return jl(`nav-layout`,window.location)}function eu(e){return jl(`nav-layout:${encodeURIComponent(e)}`,window.location)}var tu=300;function nu(e){return Yl.includes(e)}function ru(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`&&nu(e)):[]}function iu(e){if(typeof e!=`object`||!e)return null;let t=e;return!Array.isArray(t.mainTabs)||!Array.isArray(t.bottomTabs)?null:{mainTabs:ru(t.mainTabs),bottomTabs:ru(t.bottomTabs),updatedAt:typeof t.updatedAt==`number`?t.updatedAt:0}}function au(e,t){if(typeof e!=`object`||!e)return{__TSR_index:0,key:t,__TSR_key:t};let n=e,r=typeof n.key==`string`?n.key:t,i=typeof n.__TSR_key==`string`?n.__TSR_key:r,a=typeof n.__TSR_index==`number`?n.__TSR_index:0;return{...n,key:r,__TSR_key:i,__TSR_index:a}}function ou(e,t){let n=new URL(e,`http://nav.local`),r=`${n.pathname}${n.search}${n.hash}`,i=Math.random().toString(36).slice(2);return{href:r,pathname:n.pathname||`/`,search:n.search,hash:n.hash,state:au(t,i)}}function su(e){let t=e.trim();if(!t||t===`./`||t===`.`)return`/`;let n=t.startsWith(`/`)?t:`/${t}`;return(n.endsWith(`/`)?n:`${n}/`).replace(/\/+/g,`/`)}function cu(e,t){return t===`/`?e||`/`:e===t.slice(0,-1)?`/`:e.startsWith(t)?e.slice(t.length-1)||`/`:e||`/`}function lu(e,t){if(t===`/`)return e||`/`;let n=e.startsWith(`/`)?e:`/${e}`;return n===`/`?t.slice(0,-1)||`/`:`${t.slice(0,-1)}${n}`}function uu(e){if(typeof window>`u`)return e;let t=new URL(e,window.location.origin),n=su(Wl());return t.pathname=cu(t.pathname,n),`${t.pathname}${t.search}${t.hash}`}function du(e,t){for(let n of[`api`,`session`]){let r=t.searchParams.get(n);r&&!e.searchParams.has(n)&&e.searchParams.set(n,r)}}function fu(e){for(let t of Yl)if(e===t||e.startsWith(t+`/`))return t;return null}function pu(e,t){if(t===`pop`)return null;let n=t===`main`?e.mainLocation:e.bottomLocation,r=t===`main`?e.mainTabs:e.bottomTabs,i=fu(n.pathname);return i&&r.includes(i)?i:null}function mu(e){return Ql.some(t=>e===t||e.startsWith(t+`/`))}function hu(e,t){if(mu(t))return`pop`;let n=fu(t);return n&&e.bottomTabs.includes(n)?`bottom`:`main`}function gu(e){let t=new Set,n=[],r=[];for(let r of e.mainTabs)t.has(r)||(n.push(r),t.add(r));for(let n of e.bottomTabs)t.has(n)||(r.push(n),t.add(n));for(let e of Yl)t.has(e)||(Zl.includes(e)?r.push(e):n.push(e));return{mainTabs:n,bottomTabs:r}}function _u(e,t){if(t.length===0)return ou(`/`);let n=fu(e.pathname);return n&&!t.includes(n)?ou(`/`):e}function vu(e,t){if(t.length===0)return ou(`/`);if(e.pathname===`/`)return ou(`/`,e.state);let n=fu(e.pathname);return!n||!t.includes(n)?ou(`/`):e}function yu(e){return e.pathname===`/`?ou(`/`,e.state):mu(e.pathname)?e:ou(`/`)}function bu(e){let t=gu({mainTabs:e.mainTabs,bottomTabs:e.bottomTabs});return{...e,mainTabs:t.mainTabs,bottomTabs:t.bottomTabs,mainLocation:_u(e.mainLocation,t.mainTabs),bottomLocation:vu(e.bottomLocation,t.bottomTabs),popLocation:yu(e.popLocation)}}function xu(e,t){let n=new URL(e.href),r=su(Wl());n.pathname=cu(n.pathname,r);let i=n.searchParams.get(`_b`),a=n.searchParams.get(`_p`);n.searchParams.delete(`_b`),n.searchParams.delete(`_p`);let o=window.history.state,s=ou(`${n.pathname}${n.search}${n.hash}`,o?.main),c=ou(i??`/`,o?.bottom),l=ou(a??`/`,o?.pop);if(!i&&!a){let e=hu(t,s.pathname);e===`bottom`?(c=s,s=ou(`/`,o?.main)):e===`pop`&&(l=s,s=ou(`/`,o?.main))}return{main:_u(s,t.mainTabs),bottom:vu(c,t.bottomTabs),pop:yu(l)}}function Su(e){let t=new URL(window.location.href),n=new URL(e.mainLocation.href,window.location.origin),r=su(Wl());return n.pathname=lu(n.pathname,r),du(n,t),n.searchParams.delete(`_b`),n.searchParams.delete(`_p`),e.bottomTabs.length>0&&n.searchParams.set(`_b`,e.bottomLocation.href),e.popLocation.pathname!==`/`&&n.searchParams.set(`_p`,e.popLocation.href),`${n.pathname}${n.search}${n.hash}`}function Cu(e,t){return e.length===t.length?e.every((e,n)=>e===t[n]):!1}function wu(){return{mainTabs:[...Xl],bottomTabs:[...Zl],updatedAt:0,mainLocation:ou(`/dashboard`),bottomLocation:ou(`/`),popLocation:ou(`/`)}}function Tu(){try{let e=localStorage.getItem($l());return e?iu(JSON.parse(e)):null}catch{return null}}function Eu(e){try{let t=localStorage.getItem(e);return t?iu(JSON.parse(t)):null}catch{return null}}function Du(e,t=$l()){try{localStorage.setItem(t,JSON.stringify(e))}catch{}}function Ou(e){let t=fu(e.pathname);return!t||e.pathname===t?e:t===`/changes`||t===`/specs`||t===`/archive`?ou(t,e.state):e}var ku=[({prevState:e,nextState:t,event:n})=>{if(n.type!==`MOVE_TAB`)return t;let r=e.bottomTabs.includes(n.tabId)?`bottom`:`main`;if(pu(e,r)!==n.tabId)return t;let i=r===`main`?e.mainLocation:e.bottomLocation,a=ou(i.href,i.state);return n.targetArea===`main`?{...t,mainLocation:a}:{...t,bottomLocation:a}},({nextState:e})=>e.mainTabs.length===0||pu(e,`main`)!=null?e:{...e,mainLocation:ou(e.mainTabs[0])}];function Au(e,t,n){let r=t;for(let t of ku)r=t({prevState:e,nextState:r,event:n});return r}function ju(e,t){switch(t.type){case`NAVIGATE`:{let n=t.sourceArea===`pop`?`pop`:hu(e,t.location.pathname);return{nextState:n===`main`?{...e,mainLocation:t.location}:n===`bottom`?{...e,bottomLocation:t.location}:{...e,popLocation:t.location},changed:!0,urlAction:t.action,notify:n===t.sourceArea?[]:[{area:n,type:t.action}],persist:`none`}}case`POPSTATE`:return{nextState:{...e,mainLocation:t.mainLocation,bottomLocation:t.bottomLocation,popLocation:t.popLocation},changed:!0,notify:[{area:`main`,type:`BACK`},{area:`bottom`,type:`BACK`},{area:`pop`,type:`BACK`}],persist:`none`};case`MOVE_TAB`:{let n=e.bottomTabs.includes(t.tabId)?`bottom`:`main`;if(n===t.targetArea)return{nextState:e,changed:!1,notify:[],persist:`none`};let r=e.mainTabs.filter(e=>e!==t.tabId),i=e.bottomTabs.filter(e=>e!==t.tabId),a=t.targetArea===`main`?[...r,t.tabId]:r,o=t.targetArea===`bottom`?[...i,t.tabId]:i,s=e.mainLocation,c=e.bottomLocation;return fu((n===`main`?e.mainLocation:e.bottomLocation).pathname)===t.tabId&&(n===`main`?s=ou(`/`):c=ou(`/`)),{nextState:{...e,mainTabs:a,bottomTabs:o,mainLocation:s,bottomLocation:c},changed:!0,urlAction:`REPLACE`,notify:[{area:`main`,type:`REPLACE`},{area:`bottom`,type:`REPLACE`}],persist:`local_and_remote`}}case`REORDER`:{let n=t.area===`main`?e.mainTabs:e.bottomTabs,r=new Set(n),i=t.tabIds.filter(e=>r.has(e));for(let e of n)i.includes(e)||i.push(e);return Cu(n,i)?{nextState:e,changed:!1,notify:[],persist:`none`}:{nextState:t.area===`main`?{...e,mainTabs:i}:{...e,bottomTabs:i},changed:!0,notify:[],persist:`local_and_remote`}}case`CLOSE_TAB`:{let n=e.bottomTabs.includes(t.tabId),r=e.mainTabs.includes(t.tabId);return!n&&!r?{nextState:e,changed:!1,notify:[],persist:`none`}:n?fu(e.bottomLocation.pathname)===t.tabId?{nextState:{...e,bottomLocation:ou(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`}:{nextState:e,changed:!1,notify:[],persist:`none`}:fu(e.mainLocation.pathname)===t.tabId?{nextState:{...e,mainLocation:ou(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`}:{nextState:e,changed:!1,notify:[],persist:`none`}}case`ACTIVATE_BOTTOM`:return hu(e,t.location.pathname)===`bottom`?{nextState:{...e,bottomLocation:t.location},changed:!0,urlAction:`PUSH`,notify:[{area:`bottom`,type:`PUSH`}],persist:`none`}:{nextState:e,changed:!1,notify:[],persist:`none`};case`DEACTIVATE_BOTTOM`:return e.bottomLocation.pathname===`/`?{nextState:e,changed:!1,notify:[],persist:`none`}:{nextState:{...e,bottomLocation:ou(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`};case`ACTIVATE_POP`:return hu(e,t.location.pathname)===`pop`?{nextState:{...e,popLocation:t.location},changed:!0,urlAction:`PUSH`,notify:[{area:`pop`,type:`PUSH`}],persist:`none`}:{nextState:e,changed:!1,notify:[],persist:`none`};case`DEACTIVATE_POP`:return e.popLocation.pathname===`/`?{nextState:e,changed:!1,notify:[],persist:`none`}:{nextState:{...e,popLocation:ou(`/`)},changed:!0,urlAction:`REPLACE`,notify:[],persist:`none`};case`APPLY_LAYOUT`:{if(t.layout.updatedAt<=e.updatedAt)return{nextState:e,changed:!1,notify:[],persist:`none`};let n=gu(t.layout);return{nextState:{...e,mainTabs:n.mainTabs,bottomTabs:n.bottomTabs,updatedAt:t.layout.updatedAt},changed:!0,urlAction:`REPLACE`,notify:[{area:`main`,type:`REPLACE`},{area:`bottom`,type:`REPLACE`}],persist:`local_only`}}}}function Mu(e,t,n){return n===`main`?e.mainLocation.href!==t.mainLocation.href:n===`bottom`?e.bottomLocation.href!==t.bottomLocation.href:e.popLocation.href!==t.popLocation.href}function Nu(e,t,n){let r=[...e];for(let e of[`main`,`bottom`,`pop`])Mu(t,n,e)&&(r.some(t=>t.area===e)||r.push({area:e,type:`REPLACE`}));return r}var Pu=new class{mainHistory=null;bottomHistory=null;popHistory=null;state=wu();listeners=new Set;snapshotCache=null;persistTimer=null;kvUnsubscribe=null;initialized=!1;storageKey=typeof window>`u`?`nav-layout`:jl(`nav-layout`,window.location);constructor(){if(typeof window>`u`)return;let e=Vl()?null:Tu();if(e!=null){let t=gu(e);this.state={...this.state,mainTabs:t.mainTabs,bottomTabs:t.bottomTabs,updatedAt:e.updatedAt}}let t=xu(window.location,this.state),n=bu({...this.state,mainLocation:t.main,bottomLocation:t.bottom,popLocation:t.pop});n=bu(Au(n,n,{type:`BOOTSTRAP`})),this.state=n,this.normalizeUrl(),window.addEventListener(`popstate`,this.handlePopState)}setHistoryRef(e,t){e===`main`?this.mainHistory=t:e===`bottom`?this.bottomHistory=t:this.popHistory=t}getLocation(e){return e===`main`?this.state.mainLocation:e===`bottom`?this.state.bottomLocation:this.state.popLocation}push(e,t,n){this.dispatch({type:`NAVIGATE`,sourceArea:e,action:`PUSH`,location:ou(uu(t),n)})}replace(e,t,n){this.dispatch({type:`NAVIGATE`,sourceArea:e,action:`REPLACE`,location:ou(uu(t),n)})}createHref(e,t,n){if(typeof window>`u`)return t;let{nextState:r}=this.computeTransition({type:`NAVIGATE`,sourceArea:e,action:`PUSH`,location:ou(uu(t),n)});return Su(r)}get mainTabs(){return this.state.mainTabs}get bottomTabs(){return this.state.bottomTabs}getAreaForPath(e){return hu(this.state,e)}moveTab(e,t){this.dispatch({type:`MOVE_TAB`,tabId:e,targetArea:t})}reorder(e,t){this.dispatch({type:`REORDER`,area:e,tabIds:t})}closeTab(e){this.dispatch({type:`CLOSE_TAB`,tabId:e})}activateBottom(e){this.dispatch({type:`ACTIVATE_BOTTOM`,location:ou(e)})}deactivateBottom(){this.dispatch({type:`DEACTIVATE_BOTTOM`})}activatePop(e){this.dispatch({type:`ACTIVATE_POP`,location:ou(e)})}deactivatePop(){this.dispatch({type:`DEACTIVATE_POP`})}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}getSnapshot(){if(this.snapshotCache)return this.snapshotCache;let e=fu(this.state.bottomLocation.pathname);return this.snapshotCache={mainTabs:[...this.state.mainTabs],bottomTabs:[...this.state.bottomTabs],mainLocation:this.state.mainLocation,bottomLocation:this.state.bottomLocation,popLocation:this.state.popLocation,bottomActive:e!=null&&this.state.bottomTabs.includes(e),popActive:this.state.popLocation.pathname!==`/`},this.snapshotCache}async init(){if(!(this.initialized||Vl())){this.initialized=!0;try{let e=await this.resolveProjectScopedStorageKey();e&&e!==this.storageKey&&(this.storageKey=e,this.rebindProjectScopedLayout(e));let{trpcClient:t}=await q(async()=>{let{trpcClient:e}=await import(`./trpc-Uk6u7BJ8.js`);return{trpcClient:e}},[]),n=iu(await t.kv.get.query({key:this.storageKey}));n?n.updatedAt>this.state.updatedAt?this.dispatch({type:`APPLY_LAYOUT`,layout:n}):this.state.updatedAt>n.updatedAt&&t.kv.set.mutate({key:this.storageKey,value:{mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:this.state.updatedAt}}).catch(()=>{}):this.state.updatedAt>0&&t.kv.set.mutate({key:this.storageKey,value:{mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:this.state.updatedAt}}).catch(()=>{});let r=t.kv.subscribe.subscribe({key:this.storageKey},{onData:e=>{let t=iu(e);t&&this.dispatch({type:`APPLY_LAYOUT`,layout:t})}});this.kvUnsubscribe=()=>r.unsubscribe()}catch{}}}destroy(){typeof window<`u`&&window.removeEventListener(`popstate`,this.handlePopState),this.cancelPersistTimer(),this.kvUnsubscribe&&=(this.kvUnsubscribe(),null)}handlePopState=()=>{let e=xu(window.location,this.state);this.dispatch({type:`POPSTATE`,mainLocation:e.main,bottomLocation:e.bottom,popLocation:e.pop})};computeTransition(e){let t=ju(this.state,e);if(!t.changed)return{transition:t,nextState:this.state};let n=Au(this.state,t.nextState,e);return n=bu(n),{transition:t,nextState:n}}dispatch(e){if(typeof window<`u`&&e.type!==`POPSTATE`&&this.mainHistory==null){let e=xu(window.location,this.state);this.state=bu({...this.state,mainLocation:e.main,bottomLocation:e.bottom,popLocation:e.pop})}let t=ju(this.state,e);if(!t.changed)return;let n=this.state,r=Au(n,t.nextState,e);r=bu(r),this.state=r,t.persist===`local_and_remote`?this.persistLayout():t.persist===`local_only`&&(this.cancelPersistTimer(),Du({mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:this.state.updatedAt},this.storageKey));let i=t.urlAction??(Mu(n,this.state,`main`)||Mu(n,this.state,`bottom`)||Mu(n,this.state,`pop`)?`REPLACE`:void 0);i&&this.syncToUrl(i);let a=Nu(t.notify,n,this.state);this.notifyRouters(a),this.notifyListeners()}notifyRouters(e){for(let t of e)(t.area===`main`?this.mainHistory:t.area===`bottom`?this.bottomHistory:this.popHistory)?.notify({type:t.type})}notifyListeners(){this.snapshotCache=null;for(let e of this.listeners)e()}syncToUrl(e){let t=Su(this.state),n=`${window.location.pathname}${window.location.search}${window.location.hash}`;if(e===`REPLACE`&&t===n)return;let r={main:this.state.mainLocation.state,bottom:this.state.bottomLocation.state,pop:this.state.popLocation.state};e===`PUSH`?window.history.pushState(r,``,t):window.history.replaceState(r,``,t)}normalizeUrl(){let e=Su(this.state);if(e===`${window.location.pathname}${window.location.search}${window.location.hash}`)return;let t={main:this.state.mainLocation.state,bottom:this.state.bottomLocation.state,pop:this.state.popLocation.state};window.history.replaceState(t,``,e)}cancelPersistTimer(){this.persistTimer&&=(clearTimeout(this.persistTimer),null)}persistLayout(){let e=Date.now();this.state={...this.state,updatedAt:e},Du({mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:e},this.storageKey),this.cancelPersistTimer(),this.persistTimer=setTimeout(()=>{this.persistTimer=null,q(async()=>{let{trpcClient:e}=await import(`./trpc-Uk6u7BJ8.js`);return{trpcClient:e}},[]).then(({trpcClient:t})=>t.kv.set.mutate({key:this.storageKey,value:{mainTabs:this.state.mainTabs,bottomTabs:this.state.bottomTabs,updatedAt:e}})).catch(()=>{})},tu)}async resolveProjectScopedStorageKey(){try{let e=await fetch(zl());if(!e.ok)return null;let t=await e.json();return typeof t.projectDir!=`string`||t.projectDir.length===0?null:eu(t.projectDir)}catch{return null}}rebindProjectScopedLayout(e){let t=Eu(e);if(t){let e=gu(t);this.state=bu({...this.state,mainTabs:e.mainTabs,bottomTabs:e.bottomTabs,updatedAt:t.updatedAt}),this.normalizeUrl();return}this.state=bu({...this.state,mainLocation:Ou(this.state.mainLocation),bottomLocation:Ou(this.state.bottomLocation),updatedAt:0}),this.normalizeUrl(),this.notifyListeners()}};typeof window<`u`&&!Vl()&&Pu.init();function Fu(){return(0,G.useSyncExternalStore)(e=>Pu.subscribe(e),()=>Pu.getSnapshot(),()=>Pu.getSnapshot())}function Iu(e,t){return t.updatedAt-e.updatedAt||e.id.localeCompare(t.id)}function Lu(e){return[...e].sort(Iu)}function Ru(e,t=10){return Lu(e).slice(0,Math.max(0,Math.trunc(t)))}var zu=`project`,Bu=/^[A-Za-z]:\//;function Vu(e){return e.replace(/\\/g,`/`).replace(/\/+$/g,``)}function Hu(e){return e.startsWith(`/`)||Bu.test(e)}function Uu(e){return e.replace(/^\.?\//,``)}function Wu(e){return Vu(e).split(`/`).filter(Boolean)}function Gu(e){let t=Vu(e),n=/(?:^|\/)node_modules\/(?:\.pnpm\/[^/]+\/node_modules\/)?(@[^/]+\/[^/]+|[^/]+)(\/.*)?/.exec(t),r=n?.[1];return r?`npm:${r}${n[2]??``}`:null}function Ku(e){return`${zu}:${Uu(e)}`}function qu(e,t){let n=Vu(e),r=Vu(t),i=n.toLowerCase(),a=r.toLowerCase();return a===i||a.startsWith(`${i}/`)}function Ju(e,t){let n=Wu(e),r=Wu(t),i=0;for(;i<n.length&&i<r.length&&n[i]?.toLowerCase()===r[i]?.toLowerCase();)i+=1;return r.slice(i).join(`/`)}function Yu(e){let t=Wu(e),n=t.lastIndexOf(`openspec`);return n<0?null:t.slice(n).join(`/`)}function Xu(e,t){let n=Vu(e),r=Gu(n);return(t?.source===`package`||r)&&r?r:Hu(n)?t?.projectDir&&qu(t.projectDir,n)?Ku(Ju(t.projectDir,n)):Ku(Yu(n)||Wu(n).slice(-4).join(`/`)):Ku(n)}var Zu=Symbol.for(`yaml.alias`),Qu=Symbol.for(`yaml.document`),$u=Symbol.for(`yaml.map`),ed=Symbol.for(`yaml.pair`),td=Symbol.for(`yaml.scalar`),nd=Symbol.for(`yaml.seq`),rd=Symbol.for(`yaml.node.type`),id=e=>!!e&&typeof e==`object`&&e[rd]===Zu,ad=e=>!!e&&typeof e==`object`&&e[rd]===Qu,od=e=>!!e&&typeof e==`object`&&e[rd]===$u,sd=e=>!!e&&typeof e==`object`&&e[rd]===ed,cd=e=>!!e&&typeof e==`object`&&e[rd]===td,ld=e=>!!e&&typeof e==`object`&&e[rd]===nd;function ud(e){if(e&&typeof e==`object`)switch(e[rd]){case $u:case nd:return!0}return!1}function dd(e){if(e&&typeof e==`object`)switch(e[rd]){case Zu:case $u:case td:case nd:return!0}return!1}var fd=e=>(cd(e)||ud(e))&&!!e.anchor,pd=Symbol(`break visit`),md=Symbol(`skip children`),hd=Symbol(`remove node`);function gd(e,t){let n=bd(t);ad(e)?_d(null,e.contents,n,Object.freeze([e]))===hd&&(e.contents=null):_d(null,e,n,Object.freeze([]))}gd.BREAK=pd,gd.SKIP=md,gd.REMOVE=hd;function _d(e,t,n,r){let i=xd(e,t,n,r);if(dd(i)||sd(i))return Sd(e,r,i),_d(e,i,n,r);if(typeof i!=`symbol`){if(ud(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=_d(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===pd)return pd;else i===hd&&(t.items.splice(e,1),--e)}}else if(sd(t)){r=Object.freeze(r.concat(t));let e=_d(`key`,t.key,n,r);if(e===pd)return pd;e===hd&&(t.key=null);let i=_d(`value`,t.value,n,r);if(i===pd)return pd;i===hd&&(t.value=null)}}return i}async function vd(e,t){let n=bd(t);ad(e)?await yd(null,e.contents,n,Object.freeze([e]))===hd&&(e.contents=null):await yd(null,e,n,Object.freeze([]))}vd.BREAK=pd,vd.SKIP=md,vd.REMOVE=hd;async function yd(e,t,n,r){let i=await xd(e,t,n,r);if(dd(i)||sd(i))return Sd(e,r,i),yd(e,i,n,r);if(typeof i!=`symbol`){if(ud(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await yd(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===pd)return pd;else i===hd&&(t.items.splice(e,1),--e)}}else if(sd(t)){r=Object.freeze(r.concat(t));let e=await yd(`key`,t.key,n,r);if(e===pd)return pd;e===hd&&(t.key=null);let i=await yd(`value`,t.value,n,r);if(i===pd)return pd;i===hd&&(t.value=null)}}return i}function bd(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function xd(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(od(t))return n.Map?.(e,t,r);if(ld(t))return n.Seq?.(e,t,r);if(sd(t))return n.Pair?.(e,t,r);if(cd(t))return n.Scalar?.(e,t,r);if(id(t))return n.Alias?.(e,t,r)}function Sd(e,t,n){let r=t[t.length-1];if(ud(r))r.items[e]=n;else if(sd(r))e===`key`?r.key=n:r.value=n;else if(ad(r))r.contents=n;else{let e=id(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var Cd={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},wd=e=>e.replace(/[!,[\]{}]/g,e=>Cd[e]),Td=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+wd(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&dd(e.contents)){let t={};gd(e.contents,(e,n)=>{dd(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
47
47
  `)}};Td.defaultYaml={explicit:!1,version:`1.2`},Td.defaultTags={"!!":`tag:yaml.org,2002:`};function Ed(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function Dd(e){let t=new Set;return gd(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function Od(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function kd(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=Dd(e);let a=Od(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(cd(t.node)||ud(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function Ad(e,t,n,r){if(r&&typeof r==`object`)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=Ad(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=Ad(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=Ad(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=Ad(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function jd(e,t,n){if(Array.isArray(e))return e.map((e,t)=>jd(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!fd(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var Md=class{constructor(e){Object.defineProperty(this,rd,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!ad(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=jd(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?Ad(i,{"":o},``,o):o}},Nd=class extends Md{constructor(e){super(Zu),this.source=e,Object.defineProperty(this,`tag`,{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],gd(e,{Node:(e,t)=>{(id(t)||fd(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}return r}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,a=this.resolve(r,t);if(!a){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let o=n.get(a);if(o||=(jd(a,null,t),n.get(a)),o?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=Pd(r,a,n)),o.count*o.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return o.res}toString(e,t,n){let r=`*${this.source}`;if(e){if(Ed(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function Pd(e,t,n){if(id(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(ud(t)){let r=0;for(let i of t.items){let t=Pd(e,i,n);t>r&&(r=t)}return r}else if(sd(t)){let r=Pd(e,t.key,n),i=Pd(e,t.value,n);return Math.max(r,i)}return 1}var Fd=e=>!e||typeof e!=`function`&&typeof e!=`object`,Id=class extends Md{constructor(e){super(td),this.value=e}toJSON(e,t){return t?.keep?this.value:jd(this.value,e,t)}toString(){return String(this.value)}};Id.BLOCK_FOLDED=`BLOCK_FOLDED`,Id.BLOCK_LITERAL=`BLOCK_LITERAL`,Id.PLAIN=`PLAIN`,Id.QUOTE_DOUBLE=`QUOTE_DOUBLE`,Id.QUOTE_SINGLE=`QUOTE_SINGLE`;var Ld=`tag:yaml.org,2002:`;function Rd(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function zd(e,t,n){if(ad(e)&&(e=e.contents),dd(e))return e;if(sd(e)){let t=n.schema[$u].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??=i(e),new Nd(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=Ld+t.slice(2));let l=Rd(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new Id(e);return c&&(c.node=t),t}l=e instanceof Map?o[$u]:Symbol.iterator in Object(e)?o[nd]:o[$u]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new Id(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function Bd(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return zd(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var Vd=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,Hd=class extends Md{constructor(e,t){super(e),Object.defineProperty(this,`schema`,{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>dd(t)||sd(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Vd(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(ud(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,Bd(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(ud(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&cd(i)?i.value:i:ud(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!sd(t))return!1;let n=t.value;return n==null||e&&cd(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return ud(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(ud(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,Bd(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},Ud=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function Wd(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Gd=(e,t,n)=>e.endsWith(`
48
48
  `)?Wd(n,t):n.includes(`
49
49
  `)?`
@@ -149,7 +149,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
149
149
  `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
150
150
  `,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey)if(!t.sep)if(pm(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=_m(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(pm(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(hm(t.key)&&!pm(t.sep,`newline`)){let e=_m(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):pm(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!pm(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Array.prototype.push.apply(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||pm(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=_m(gm(t));vm(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
151
151
  `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
152
- `,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=_m(gm(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=_m(gm(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function bee(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new yee||null,prettyErrors:t}}function xee(e,t={}){let{lineCounter:n,prettyErrors:r}=bee(t),i=new ym(n?.addNewLine),a=new pee(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new Pp(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(Ip(e,n)),o.warnings.forEach(Ip(e,n))),o}function bm(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=xee(e,n);if(!i)return null;if(i.warnings.forEach(e=>pf(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}var xm=null,Sm=null,Cm=[`specifications`,`requirements`,`activeChanges`,`inProgressChanges`,`completedChanges`,`taskCompletionPercent`],wm=100,Tm=20,Em=1440*60*1e3;function Dm(){let e={};for(let t of Cm)e[t]=[];return e}function Om(){let e={};for(let t of Cm)e[t]=[];return e}function km(e,t){return{specifications:t.hasObjectiveSpecificationTrend?{state:`ok`}:{state:`invalid`,reason:`objective-history-unavailable`},requirements:t.hasObjectiveRequirementTrend?{state:`ok`}:{state:`invalid`,reason:`objective-history-unavailable`},activeChanges:{state:`invalid`,reason:`objective-history-unavailable`},inProgressChanges:{state:`invalid`,reason:`objective-history-unavailable`},completedChanges:t.hasObjectiveCompletedTrend?{state:`ok`}:{state:`invalid`,reason:`objective-history-unavailable`},taskCompletionPercent:{state:`invalid`,reason:e===null?`semantic-uncomputable`:`objective-history-unavailable`}}}function Am(){return{specifications:`monotonic`,requirements:`monotonic`,activeChanges:`bidirectional`,inProgressChanges:`bidirectional`,completedChanges:`monotonic`,taskCompletionPercent:`bidirectional`}}function jm(e,t){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:typeof t==`number`&&Number.isFinite(t)&&t>0?t:null}function See(e){let t=/^(\d{4})-(\d{2})-(\d{2})(?:-|$)/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]);if(!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||r<1||r>12||i<1||i>31)return null;let a=Date.UTC(n,r-1,i);return Number.isFinite(a)?a:null}function Cee(e,t){return e.filter(e=>Number.isFinite(e.ts)&&e.ts>0&&Number.isFinite(e.value)).sort((e,t)=>e.ts-t.ts).slice(-t)}function wee(e,t){if(e.length===0)return null;let n=e[e.length-1].ts,r=typeof t==`number`&&Number.isFinite(t)&&t>0?Math.max(n,t):n,i=e[0].ts,a=Math.max(1,r-i),o=a>=Em?Math.max(Em,Math.ceil(a/Tm/Em)*Em):Math.max(1,Math.ceil(a/Tm)),s=r-o*Tm;return{windowStart:s,bucketMs:o,bucketEnds:Array.from({length:Tm},(e,t)=>s+o*(t+1))}}function Mm(e,t,n,r){let i=Cee(e,t);if(i.length===0)return[];let a=wee(i,r);if(!a)return[];let{windowStart:o,bucketMs:s,bucketEnds:c}=a,l=Array.from({length:c.length},()=>0),u=0;for(let e of i){if(e.ts<=o){n===`sum-cumulative`&&(u+=e.value);continue}let t=e.ts-o,r=Math.max(0,Math.min(c.length-1,Math.ceil(t/s)-1));l[r]+=e.value}let d=u;return c.map((e,t)=>n===`sum-cumulative`?(d+=l[t],{ts:e,value:d}):{ts:e,value:l[t]})}function Tee(e,t,n){let r=Dm(),i=e.specs.flatMap(e=>{let t=jm(e.updatedAt,e.createdAt);return t===null?[]:[{ts:t,value:e.requirements.length}]});return r.specifications=Mm(e.specs.flatMap(e=>{let t=jm(e.createdAt,e.updatedAt);return t===null?[]:[{ts:t,value:1}]}),t,`sum`,n),r.requirements=Mm(i,t,`sum`,n),r.completedChanges=Mm(e.archives.flatMap(e=>{let t=See(e.id)??jm(e.updatedAt,e.createdAt);return t===null?[]:[{ts:t,value:e.parsedTasks.length}]}),t,`sum`,n),r}function Nm(e){return e.includes(`*`)||e.includes(`?`)||e.includes(`[`)}function Pm(e){return e.replace(/\\/g,`/`).replace(/^\.?\//,``)}function Fm(e){return e.replace(/\\/g,`/`)}function Eee(e){return/^(?:[A-Za-z]:\/|\/)/.test(e)}function Dee(e,t){let n=Fm(e).replace(/\/+$/,``).toLowerCase(),r=Fm(t).toLowerCase();return r===n||r.startsWith(`${n}/`)}function Oee(e,t){let n=Fm(e).replace(/\/+$/,``);return Fm(t).slice(n.length+1)}function kee(e,t){let n=Fm(e);if(!Eee(n))return Pm(n);if(t&&Dee(t,n))return Pm(Oee(t,n));let r=n.lastIndexOf(`/templates/`);return r>=0?Pm(n.slice(r+1)):Im(n)}function Im(e){let t=Pm(e),n=t.split(`/`);return n[n.length-1]??t}function Aee(e){return/[\\^$.*+?()[\]{}|]/.test(e)?`\\${e}`:e}function jee(e){let t=Pm(e),n=`^`;for(let e=0;e<t.length;e+=1){let r=t[e];if(r===`*`){t[e+1]===`*`?(e+=1,t[e+1]===`/`?(e+=1,n+=`(?:.*/)?`):n+=`.*`):n+=`[^/]*`;continue}if(r===`?`){n+=`[^/]`;continue}if(r===`[`){let r=t.indexOf(`]`,e+1);if(r>e+1){n+=t.slice(e,r+1),e=r;continue}}n+=Aee(r)}return n+=`$`,new RegExp(n)}function Mee(e,t){return jee(t).test(Pm(e))}function Lm(e){return typeof e==`string`&&e.trim().length>0}function Rm(e){let t={};Lm(e.proposal)&&(t[`proposal.md`]=e.proposal),Lm(e.tasks)&&(t[`tasks.md`]=e.tasks??``),Lm(e.design)&&(t[`design.md`]=e.design??``);for(let n of e.deltas){let e=`specs/${n.capability}/spec.md`;Lm(n.content)&&(t[e]=n.content)}return t}function Nee(e,t){let n=e.opsx?.changeMetadata?.[t];if(n)try{let e=bm(n);if(typeof e?.schema==`string`&&e.schema.length>0)return e.schema}catch{return}}function Pee(e,t,n){let r=e.opsx?.schemaDetails??{};if(n&&r[n])return n;let i=Nee(e,t);return i&&r[i]?i:e.opsx?.schemas?.[0]?.name||Object.keys(r)[0]||(n??`spec-driven`)}function Fee(){return[{id:`proposal`,outputPath:`proposal.md`,requires:[]},{id:`tasks`,outputPath:`tasks.md`,requires:[]},{id:`design`,outputPath:`design.md`,requires:[]},{id:`specs`,outputPath:`specs/**/*.md`,requires:[]}]}function Iee(e,t){return e.opsx?.schemaDetails?.[t]||{name:t,artifacts:Fee(),applyRequires:[]}}function zm(e,t,n){let r=Rm(e),i=Pm(t),a=r[i];if(Lm(a))return a;let o=Im(i);return o===`proposal.md`&&Lm(e.proposal)?e.proposal:o===`tasks.md`&&Lm(e.tasks)?e.tasks??null:o===`design.md`&&Lm(e.design)?e.design??null:n===`proposal`&&Lm(e.proposal)?e.proposal:n===`tasks`&&Lm(e.tasks)?e.tasks??null:n===`design`&&Lm(e.design)?e.design??null:null}function Bm(e,t){let n=Rm(e),r=Pm(t);return Object.entries(n).filter(([e])=>Mee(e,r)).map(([e,t])=>({path:e,type:`file`,content:t}))}function Vm(e,t,n){let r=Pee(e,t.id,n),i=Iee(e,r),a=new Map;for(let e of i.artifacts){let n=Nm(e.outputPath)?Bm(t,e.outputPath).length>0:Lm(zm(t,e.outputPath,e.id));a.set(e.id,n)}let o=i.artifacts.map(e=>{if(a.get(e.id)===!0)return{id:e.id,outputPath:e.outputPath,status:`done`,relativePath:`openspec/changes/${t.id}/${e.outputPath}`};let n=e.requires.filter(e=>a.get(e)!==!0);return{id:e.id,outputPath:e.outputPath,status:n.length>0?`blocked`:`ready`,missingDeps:n.length>0?n:void 0,relativePath:`openspec/changes/${t.id}/${e.outputPath}`}});return{changeName:t.id,schemaName:r,isComplete:o.every(e=>e.status===`done`),applyRequires:i.applyRequires??[],artifacts:o}}function Hm(e){let t=e.git?.defaultBranch||`main`,n=e.git?.repositoryUrl?.trim()||null,r=e.git?.recentCommits??[];if(r.length===0)return{defaultBranch:t,worktrees:[]};let i=r.slice(0,5).map(e=>({type:`commit`,hash:e.hash,title:e.title,committedAt:e.committedAt,relatedChanges:e.relatedChanges,diff:e.diff})),a=i.reduce((e,t)=>(e.files+=t.diff.files,e.insertions+=t.diff.insertions,e.deletions+=t.diff.deletions,e),{files:0,insertions:0,deletions:0});return{defaultBranch:t,worktrees:[{path:n??`Repository URL unavailable`,relativePath:`repo`,pathAvailable:!0,branchName:`(snapshot)`,detached:!1,isCurrent:!0,ahead:0,behind:0,diff:a,entries:i}]}}async function Um(){if(xm)return xm;let e=Gl();return e?(xm=e,e):Sm||(Sm=(async()=>{try{let e=`${Wl()}data.json`.replace(`//`,`/`),t=await fetch(e);if(!t.ok)return console.error(`Failed to load data snapshot:`,t.statusText),null;let n=await t.json();return xm=n,n}catch(e){return console.error(`Error loading static snapshot:`,e),null}})(),Sm)}function Wm(e){return{id:e.id,name:e.name,overview:e.overview,requirements:e.requirements,metadata:{version:`1.0`,format:`openspec`}}}async function Gm(){let e=await Um();return e?e.specs.map(e=>({id:e.id,name:e.name,createdAt:e.createdAt,updatedAt:e.updatedAt})):[]}async function Km(){let e=await Um();if(!e)return{summary:{specifications:0,requirements:0,activeChanges:0,inProgressChanges:0,completedChanges:0,archivedTasksCompleted:0,tasksTotal:0,tasksCompleted:0,taskCompletionPercent:null},trends:Dm(),triColorTrends:Om(),trendKinds:Am(),cardAvailability:km(null,{hasObjectiveSpecificationTrend:!0,hasObjectiveRequirementTrend:!0,hasObjectiveCompletedTrend:!0}),trendMeta:{pointLimit:wm,lastUpdatedAt:Date.now()},specifications:[],activeChanges:[],git:{defaultBranch:`main`,worktrees:[]}};let t=Math.max(20,Math.min(500,Math.trunc(e.config?.dashboard?.trendPointLimit??wm))),n=e.git?.latestCommitTs??null,r=e.specs.map(e=>({id:e.id,name:e.name,requirements:e.requirements.length,updatedAt:e.updatedAt})),i=Ru(r),a=e.changes.map(e=>({id:e.id,name:e.name,progress:e.progress,updatedAt:e.updatedAt})),o=Ru(a),s=r.reduce((e,t)=>e+t.requirements,0),c=a.reduce((e,t)=>e+t.progress.total,0),l=a.reduce((e,t)=>e+t.progress.completed,0),u=e.archives.reduce((e,t)=>e+t.parsedTasks.length,0),d=c>0?Math.round(l/c*100):null,f=a.filter(e=>e.progress.total>0&&e.progress.completed<e.progress.total).length,p=Tee(e,t,n),m=p.specifications.length>0||r.length===0,h=p.requirements.length>0||s===0,g=p.completedChanges.length>0||e.archives.length===0;return{summary:{specifications:r.length,requirements:s,activeChanges:a.length,inProgressChanges:f,completedChanges:e.archives.length,archivedTasksCompleted:u,tasksTotal:c,tasksCompleted:l,taskCompletionPercent:d},trends:p,triColorTrends:Om(),trendKinds:Am(),cardAvailability:km(d,{hasObjectiveSpecificationTrend:m,hasObjectiveRequirementTrend:h,hasObjectiveCompletedTrend:g}),trendMeta:{pointLimit:t,lastUpdatedAt:Date.now()},specifications:i,activeChanges:o,git:Hm(e)}}async function qm(e){let t=await Um();if(!t)return null;let n=t.specs.find(t=>t.id===e);return n?Wm(n):null}async function Jm(){let e=await Um();return e?e.changes.map(e=>({id:e.id,name:e.name,progress:e.progress,createdAt:e.createdAt,updatedAt:e.updatedAt})):[]}async function Ym(e){let t=await Um();if(!t)return[];let n=t.changes.find(t=>t.id===e);if(!n)return[];let r=[],i=t.opsx?.changeMetadata?.[e];return typeof i==`string`&&r.push({path:`.openspec.yaml`,type:`file`,content:i}),r.push({path:`proposal.md`,type:`file`,content:n.proposal}),n.tasks&&r.push({path:`tasks.md`,type:`file`,content:n.tasks}),n.design&&r.push({path:`design.md`,type:`file`,content:n.design}),n.deltas.forEach(e=>{r.push({path:`specs/${e.capability}/spec.md`,type:`file`,content:e.content})}),r}async function Xm(){let e=await Um();return e?e.archives.map(e=>({id:e.id,name:e.name,createdAt:e.createdAt,updatedAt:e.updatedAt})):[]}async function Zm(e){let t=await Um();if(!t)return null;let n=t.archives.find(t=>t.id===e);return n?{id:n.id,name:n.name,why:n.why,whatChanges:n.whatChanges,design:n.design,deltas:[],tasks:n.parsedTasks,progress:{total:0,completed:0}}:null}async function Qm(e){let t=await Um();if(!t)return[];let n=t.archives.find(t=>t.id===e);if(!n)return[];let r=[],i=t.opsx?.changeMetadata?.[e];return typeof i==`string`&&r.push({path:`.openspec.yaml`,type:`file`,content:i}),r.push({path:`proposal.md`,type:`file`,content:n.proposal}),n.tasks&&r.push({path:`tasks.md`,type:`file`,content:n.tasks}),n.design&&r.push({path:`design.md`,type:`file`,content:n.design}),r}async function $m(){let e=await Um(),t={cli:{command:`openspecui`},theme:`system`,codeEditor:{theme:`github`},appBaseUrl:``,dashboard:{trendPointLimit:100},git:{diffEagerLineBudget:1e3},terminal:{fontSize:13,fontFamily:``,cursorBlink:!0,cursorStyle:`block`,scrollback:1e3,rendererEngine:`xterm`}},n=e?.config;return n?{...t,...n,cli:{...t.cli,...n.cli},terminal:{...t.terminal,...n.terminal},codeEditor:{...t.codeEditor,...n.codeEditor},dashboard:{...t.dashboard,...n.dashboard},git:{...t.git,...n.git}}:t}async function eh(){return(await Um())?.opsx?.configYaml??null}async function th(){let e=await Um();return{schemas:e?.opsx?.schemas??[],schemaDetails:e?.opsx?.schemaDetails??{},schemaResolutions:e?.opsx?.schemaResolutions??{}}}async function nh(e){let t=await Um();if(!t?.opsx?.templates)return null;if(!e){let e=Object.keys(t.opsx.templates)[0];if(!e)return null;let n=t.opsx.templates[e];return Object.fromEntries(Object.entries(n).map(([e,n])=>[e,{...n,displayPath:n.displayPath??Xu(n.path,{source:n.source,projectDir:t.meta.projectDir})}]))}let n=t.opsx.templates[e];return n?Object.fromEntries(Object.entries(n).map(([e,n])=>[e,{...n,displayPath:n.displayPath??Xu(n.path,{source:n.source,projectDir:t.meta.projectDir})}])):null}async function rh(e){let t=await Um();if(!t?.opsx)return null;let n=e;if(n||=t.opsx.schemas?.[0]?.name??Object.keys(t.opsx.schemaDetails??{})[0],!n)return null;let r=[],i=new Set,a=t.opsx.schemaResolutions?.[n]?.path,o=t.opsx.schemaYamls?.[n],s=t.opsx.templateContents?.[n]??{},c=e=>{i.has(e.path)||(i.add(e.path),r.push(e))},l=e=>{let t=e.split(`/`);for(let e=1;e<t.length;e++){let n=t.slice(0,e).join(`/`);n&&c({path:n,type:`directory`})}};t.opsx.schemaDetails?.[n]&&c({path:`schema.yaml`,type:`file`,content:o});let u=t.opsx.templates?.[n];return u&&Object.entries(u).forEach(([e,t])=>{let n=kee(t.path,a),r=s[e]?.content??void 0;l(n),c({path:n,type:`file`,content:r})}),r}async function ih(e){let t=await Um();if(!t?.opsx)return null;let n=e??t.opsx.schemas?.[0]?.name??Object.keys(t.opsx.templates??{})[0]??null;if(!n)return null;let r=t.opsx.templates?.[n]??{},i=t.opsx.templateContents?.[n]??{};return Object.fromEntries(Object.entries(r).map(([e,n])=>{let r=i[e];return[e,{content:r?.content??null,path:n.path,displayPath:r?.displayPath??n.displayPath??Xu(n.path,{source:n.source,projectDir:t.meta.projectDir}),source:n.source}]}))}async function ah(e,t){if(!e)return null;let n=await Um();if(!n)return null;let r=n.changes.find(t=>t.id===e);return r?Vm(n,r,t):null}async function oh(){let e=await Um();return e?e.changes.map(t=>Vm(e,t)):[]}async function sh(e,t){if(!e||!t||Nm(t))return null;let n=await Um();if(!n)return null;let r=n.changes.find(t=>t.id===e);return r?zm(r,t):null}async function ch(e,t){if(!e||!t||!Nm(t))return[];let n=await Um();if(!n)return[];let r=n.changes.find(t=>t.id===e);return r?Bm(r,t):[]}async function lh(){let e=await Um();if(!e)return[];let t=[];for(let n of e.specs)t.push({id:`spec:${n.id}`,kind:`spec`,title:n.name,href:`/specs/${encodeURIComponent(n.id)}`,path:`openspec/specs/${n.id}/spec.md`,content:n.content,updatedAt:n.updatedAt});for(let n of e.changes)t.push({id:`change:${n.id}`,kind:`change`,title:n.name,href:`/changes/${encodeURIComponent(n.id)}`,path:`openspec/changes/${n.id}`,content:[n.proposal,n.tasks,n.design,...n.deltas.map(e=>e.content)].map(e=>e?.trim()??``).filter(e=>e.length>0).join(`
152
+ `,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=_m(gm(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=_m(gm(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function bee(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new yee||null,prettyErrors:t}}function xee(e,t={}){let{lineCounter:n,prettyErrors:r}=bee(t),i=new ym(n?.addNewLine),a=new pee(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new Pp(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(Ip(e,n)),o.warnings.forEach(Ip(e,n))),o}function bm(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=xee(e,n);if(!i)return null;if(i.warnings.forEach(e=>pf(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}var xm=null,Sm=null,Cm=[`specifications`,`requirements`,`activeChanges`,`inProgressChanges`,`completedChanges`,`taskCompletionPercent`],wm=100,Tm=20,Em=1440*60*1e3;function Dm(){let e={};for(let t of Cm)e[t]=[];return e}function Om(){let e={};for(let t of Cm)e[t]=[];return e}function km(e,t){return{specifications:t.hasObjectiveSpecificationTrend?{state:`ok`}:{state:`invalid`,reason:`objective-history-unavailable`},requirements:t.hasObjectiveRequirementTrend?{state:`ok`}:{state:`invalid`,reason:`objective-history-unavailable`},activeChanges:{state:`invalid`,reason:`objective-history-unavailable`},inProgressChanges:{state:`invalid`,reason:`objective-history-unavailable`},completedChanges:t.hasObjectiveCompletedTrend?{state:`ok`}:{state:`invalid`,reason:`objective-history-unavailable`},taskCompletionPercent:{state:`invalid`,reason:e===null?`semantic-uncomputable`:`objective-history-unavailable`}}}function Am(){return{specifications:`monotonic`,requirements:`monotonic`,activeChanges:`bidirectional`,inProgressChanges:`bidirectional`,completedChanges:`monotonic`,taskCompletionPercent:`bidirectional`}}function jm(e,t){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:typeof t==`number`&&Number.isFinite(t)&&t>0?t:null}function See(e){let t=/^(\d{4})-(\d{2})-(\d{2})(?:-|$)/.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),i=Number(t[3]);if(!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||r<1||r>12||i<1||i>31)return null;let a=Date.UTC(n,r-1,i);return Number.isFinite(a)?a:null}function Cee(e,t){return e.filter(e=>Number.isFinite(e.ts)&&e.ts>0&&Number.isFinite(e.value)).sort((e,t)=>e.ts-t.ts).slice(-t)}function wee(e,t){if(e.length===0)return null;let n=e[e.length-1].ts,r=typeof t==`number`&&Number.isFinite(t)&&t>0?Math.max(n,t):n,i=e[0].ts,a=Math.max(1,r-i),o=a>=Em?Math.max(Em,Math.ceil(a/Tm/Em)*Em):Math.max(1,Math.ceil(a/Tm)),s=r-o*Tm;return{windowStart:s,bucketMs:o,bucketEnds:Array.from({length:Tm},(e,t)=>s+o*(t+1))}}function Mm(e,t,n,r){let i=Cee(e,t);if(i.length===0)return[];let a=wee(i,r);if(!a)return[];let{windowStart:o,bucketMs:s,bucketEnds:c}=a,l=Array.from({length:c.length},()=>0),u=0;for(let e of i){if(e.ts<=o){n===`sum-cumulative`&&(u+=e.value);continue}let t=e.ts-o,r=Math.max(0,Math.min(c.length-1,Math.ceil(t/s)-1));l[r]+=e.value}let d=u;return c.map((e,t)=>n===`sum-cumulative`?(d+=l[t],{ts:e,value:d}):{ts:e,value:l[t]})}function Tee(e,t,n){let r=Dm(),i=e.specs.flatMap(e=>{let t=jm(e.updatedAt,e.createdAt);return t===null?[]:[{ts:t,value:e.requirements.length}]});return r.specifications=Mm(e.specs.flatMap(e=>{let t=jm(e.createdAt,e.updatedAt);return t===null?[]:[{ts:t,value:1}]}),t,`sum`,n),r.requirements=Mm(i,t,`sum`,n),r.completedChanges=Mm(e.archives.flatMap(e=>{let t=See(e.id)??jm(e.updatedAt,e.createdAt);return t===null?[]:[{ts:t,value:e.parsedTasks.length}]}),t,`sum`,n),r}function Nm(e){return e.includes(`*`)||e.includes(`?`)||e.includes(`[`)}function Pm(e){return e.replace(/\\/g,`/`).replace(/^\.?\//,``)}function Fm(e){return e.replace(/\\/g,`/`)}function Eee(e){return/^(?:[A-Za-z]:\/|\/)/.test(e)}function Dee(e,t){let n=Fm(e).replace(/\/+$/,``).toLowerCase(),r=Fm(t).toLowerCase();return r===n||r.startsWith(`${n}/`)}function Oee(e,t){let n=Fm(e).replace(/\/+$/,``);return Fm(t).slice(n.length+1)}function kee(e,t){let n=Fm(e);if(!Eee(n))return Pm(n);if(t&&Dee(t,n))return Pm(Oee(t,n));let r=n.lastIndexOf(`/templates/`);return r>=0?Pm(n.slice(r+1)):Im(n)}function Im(e){let t=Pm(e),n=t.split(`/`);return n[n.length-1]??t}function Aee(e){return/[\\^$.*+?()[\]{}|]/.test(e)?`\\${e}`:e}function jee(e){let t=Pm(e),n=`^`;for(let e=0;e<t.length;e+=1){let r=t[e];if(r===`*`){t[e+1]===`*`?(e+=1,t[e+1]===`/`?(e+=1,n+=`(?:.*/)?`):n+=`.*`):n+=`[^/]*`;continue}if(r===`?`){n+=`[^/]`;continue}if(r===`[`){let r=t.indexOf(`]`,e+1);if(r>e+1){n+=t.slice(e,r+1),e=r;continue}}n+=Aee(r)}return n+=`$`,new RegExp(n)}function Mee(e,t){return jee(t).test(Pm(e))}function Lm(e){return typeof e==`string`&&e.trim().length>0}function Rm(e){let t={};Lm(e.proposal)&&(t[`proposal.md`]=e.proposal),Lm(e.tasks)&&(t[`tasks.md`]=e.tasks??``),Lm(e.design)&&(t[`design.md`]=e.design??``);for(let n of e.deltas){let e=`specs/${n.capability}/spec.md`;Lm(n.content)&&(t[e]=n.content)}return t}function Nee(e,t){let n=e.opsx?.changeMetadata?.[t];if(n)try{let e=bm(n);if(typeof e?.schema==`string`&&e.schema.length>0)return e.schema}catch{return}}function Pee(e,t,n){let r=e.opsx?.schemaDetails??{};if(n&&r[n])return n;let i=Nee(e,t);return i&&r[i]?i:e.opsx?.schemas?.[0]?.name||Object.keys(r)[0]||(n??`spec-driven`)}function Fee(){return[{id:`proposal`,outputPath:`proposal.md`,requires:[]},{id:`tasks`,outputPath:`tasks.md`,requires:[]},{id:`design`,outputPath:`design.md`,requires:[]},{id:`specs`,outputPath:`specs/**/*.md`,requires:[]}]}function Iee(e,t){return e.opsx?.schemaDetails?.[t]||{name:t,artifacts:Fee(),applyRequires:[]}}function zm(e,t,n){let r=Rm(e),i=Pm(t),a=r[i];if(Lm(a))return a;let o=Im(i);return o===`proposal.md`&&Lm(e.proposal)?e.proposal:o===`tasks.md`&&Lm(e.tasks)?e.tasks??null:o===`design.md`&&Lm(e.design)?e.design??null:n===`proposal`&&Lm(e.proposal)?e.proposal:n===`tasks`&&Lm(e.tasks)?e.tasks??null:n===`design`&&Lm(e.design)?e.design??null:null}function Bm(e,t){let n=Rm(e),r=Pm(t);return Object.entries(n).filter(([e])=>Mee(e,r)).map(([e,t])=>({path:e,type:`file`,content:t}))}function Vm(e,t,n){let r=Pee(e,t.id,n),i=Iee(e,r),a=new Map;for(let e of i.artifacts){let n=Nm(e.outputPath)?Bm(t,e.outputPath).length>0:Lm(zm(t,e.outputPath,e.id));a.set(e.id,n)}let o=i.artifacts.map(e=>{if(a.get(e.id)===!0)return{id:e.id,outputPath:e.outputPath,status:`done`,relativePath:`openspec/changes/${t.id}/${e.outputPath}`};let n=e.requires.filter(e=>a.get(e)!==!0);return{id:e.id,outputPath:e.outputPath,status:n.length>0?`blocked`:`ready`,missingDeps:n.length>0?n:void 0,relativePath:`openspec/changes/${t.id}/${e.outputPath}`}});return{changeName:t.id,schemaName:r,isComplete:o.every(e=>e.status===`done`),applyRequires:i.applyRequires??[],artifacts:o}}function Hm(e){let t=e.git?.defaultBranch||`main`,n=e.git?.repositoryUrl?.trim()||null,r=e.git?.recentCommits??[];if(r.length===0)return{defaultBranch:t,worktrees:[]};let i=r.slice(0,5).map(e=>({type:`commit`,hash:e.hash,title:e.title,committedAt:e.committedAt,relatedChanges:e.relatedChanges,diff:e.diff})),a=i.reduce((e,t)=>(e.files+=t.diff.files,e.insertions+=t.diff.insertions,e.deletions+=t.diff.deletions,e),{files:0,insertions:0,deletions:0});return{defaultBranch:t,worktrees:[{path:n??`Repository URL unavailable`,relativePath:`repo`,pathAvailable:!0,branchName:`(snapshot)`,detached:!1,isCurrent:!0,ahead:0,behind:0,diff:a,entries:i}]}}async function Um(){if(xm)return xm;let e=Gl();return e?(xm=e,e):Sm||(Sm=(async()=>{try{let e=`${Wl()}data.json`.replace(`//`,`/`),t=await fetch(e);if(!t.ok)return console.error(`Failed to load data snapshot:`,t.statusText),null;let n=await t.json();return xm=n,n}catch(e){return console.error(`Error loading static snapshot:`,e),null}})(),Sm)}function Wm(e){return{id:e.id,name:e.name,overview:e.overview,requirements:e.requirements,metadata:{version:`1.0`,format:`openspec`}}}async function Gm(){let e=await Um();return e?e.specs.map(e=>({id:e.id,name:e.name,createdAt:e.createdAt,updatedAt:e.updatedAt})):[]}async function Km(){let e=await Um();if(!e)return{summary:{specifications:0,requirements:0,activeChanges:0,inProgressChanges:0,completedChanges:0,archivedTasksCompleted:0,tasksTotal:0,tasksCompleted:0,taskCompletionPercent:null},trends:Dm(),triColorTrends:Om(),trendKinds:Am(),cardAvailability:km(null,{hasObjectiveSpecificationTrend:!0,hasObjectiveRequirementTrend:!0,hasObjectiveCompletedTrend:!0}),trendMeta:{pointLimit:wm,lastUpdatedAt:Date.now()},specifications:[],activeChanges:[],git:{defaultBranch:`main`,worktrees:[]}};let t=Math.max(20,Math.min(500,Math.trunc(e.config?.dashboard?.trendPointLimit??wm))),n=e.git?.latestCommitTs??null,r=e.specs.map(e=>({id:e.id,name:e.name,requirements:e.requirements.length,updatedAt:e.updatedAt})),i=Ru(r),a=e.changes.map(e=>({id:e.id,name:e.name,progress:e.progress,updatedAt:e.updatedAt})),o=Ru(a),s=r.reduce((e,t)=>e+t.requirements,0),c=a.reduce((e,t)=>e+t.progress.total,0),l=a.reduce((e,t)=>e+t.progress.completed,0),u=e.archives.reduce((e,t)=>e+t.parsedTasks.length,0),d=c>0?Math.round(l/c*100):null,f=a.filter(e=>e.progress.total>0&&e.progress.completed<e.progress.total).length,p=Tee(e,t,n),m=p.specifications.length>0||r.length===0,h=p.requirements.length>0||s===0,g=p.completedChanges.length>0||e.archives.length===0;return{summary:{specifications:r.length,requirements:s,activeChanges:a.length,inProgressChanges:f,completedChanges:e.archives.length,archivedTasksCompleted:u,tasksTotal:c,tasksCompleted:l,taskCompletionPercent:d},trends:p,triColorTrends:Om(),trendKinds:Am(),cardAvailability:km(d,{hasObjectiveSpecificationTrend:m,hasObjectiveRequirementTrend:h,hasObjectiveCompletedTrend:g}),trendMeta:{pointLimit:t,lastUpdatedAt:Date.now()},specifications:i,activeChanges:o,git:Hm(e)}}async function qm(e){let t=await Um();if(!t)return null;let n=t.specs.find(t=>t.id===e);return n?Wm(n):null}async function Jm(){let e=await Um();return e?e.changes.map(e=>({id:e.id,name:e.name,progress:e.progress,createdAt:e.createdAt,updatedAt:e.updatedAt})):[]}async function Ym(e){let t=await Um();if(!t)return[];let n=t.changes.find(t=>t.id===e);if(!n)return[];let r=[],i=t.opsx?.changeMetadata?.[e];return typeof i==`string`&&r.push({path:`.openspec.yaml`,type:`file`,content:i}),r.push({path:`proposal.md`,type:`file`,content:n.proposal}),n.tasks&&r.push({path:`tasks.md`,type:`file`,content:n.tasks}),n.design&&r.push({path:`design.md`,type:`file`,content:n.design}),n.deltas.forEach(e=>{r.push({path:`specs/${e.capability}/spec.md`,type:`file`,content:e.content})}),r}async function Xm(){let e=await Um();return e?e.archives.map(e=>({id:e.id,name:e.name,createdAt:e.createdAt,updatedAt:e.updatedAt})):[]}async function Zm(e){let t=await Um();if(!t)return null;let n=t.archives.find(t=>t.id===e);return n?{id:n.id,name:n.name,why:n.why,whatChanges:n.whatChanges,design:n.design,deltas:[],tasks:n.parsedTasks,progress:{total:0,completed:0}}:null}async function Qm(e){let t=await Um();if(!t)return[];let n=t.archives.find(t=>t.id===e);if(!n)return[];let r=[],i=t.opsx?.changeMetadata?.[e];return typeof i==`string`&&r.push({path:`.openspec.yaml`,type:`file`,content:i}),r.push({path:`proposal.md`,type:`file`,content:n.proposal}),n.tasks&&r.push({path:`tasks.md`,type:`file`,content:n.tasks}),n.design&&r.push({path:`design.md`,type:`file`,content:n.design}),r}async function $m(){let e=await Um(),t={cli:{command:`openspecui`},theme:`system`,codeEditor:{theme:`github`},appBaseUrl:``,opsx:{agentInvocationMode:`compose`},dashboard:{trendPointLimit:100},git:{diffEagerLineBudget:1e3},terminal:{fontSize:13,fontFamily:``,cursorBlink:!0,cursorStyle:`block`,scrollback:1e3,rendererEngine:`xterm`}},n=e?.config;return n?{...t,...n,cli:{...t.cli,...n.cli},terminal:{...t.terminal,...n.terminal},codeEditor:{...t.codeEditor,...n.codeEditor},opsx:{...t.opsx,...n.opsx},dashboard:{...t.dashboard,...n.dashboard},git:{...t.git,...n.git}}:t}async function eh(){return(await Um())?.opsx?.configYaml??null}async function th(){let e=await Um();return{schemas:e?.opsx?.schemas??[],schemaDetails:e?.opsx?.schemaDetails??{},schemaResolutions:e?.opsx?.schemaResolutions??{}}}async function nh(e){let t=await Um();if(!t?.opsx?.templates)return null;if(!e){let e=Object.keys(t.opsx.templates)[0];if(!e)return null;let n=t.opsx.templates[e];return Object.fromEntries(Object.entries(n).map(([e,n])=>[e,{...n,displayPath:n.displayPath??Xu(n.path,{source:n.source,projectDir:t.meta.projectDir})}]))}let n=t.opsx.templates[e];return n?Object.fromEntries(Object.entries(n).map(([e,n])=>[e,{...n,displayPath:n.displayPath??Xu(n.path,{source:n.source,projectDir:t.meta.projectDir})}])):null}async function rh(e){let t=await Um();if(!t?.opsx)return null;let n=e;if(n||=t.opsx.schemas?.[0]?.name??Object.keys(t.opsx.schemaDetails??{})[0],!n)return null;let r=[],i=new Set,a=t.opsx.schemaResolutions?.[n]?.path,o=t.opsx.schemaYamls?.[n],s=t.opsx.templateContents?.[n]??{},c=e=>{i.has(e.path)||(i.add(e.path),r.push(e))},l=e=>{let t=e.split(`/`);for(let e=1;e<t.length;e++){let n=t.slice(0,e).join(`/`);n&&c({path:n,type:`directory`})}};t.opsx.schemaDetails?.[n]&&c({path:`schema.yaml`,type:`file`,content:o});let u=t.opsx.templates?.[n];return u&&Object.entries(u).forEach(([e,t])=>{let n=kee(t.path,a),r=s[e]?.content??void 0;l(n),c({path:n,type:`file`,content:r})}),r}async function ih(e){let t=await Um();if(!t?.opsx)return null;let n=e??t.opsx.schemas?.[0]?.name??Object.keys(t.opsx.templates??{})[0]??null;if(!n)return null;let r=t.opsx.templates?.[n]??{},i=t.opsx.templateContents?.[n]??{};return Object.fromEntries(Object.entries(r).map(([e,n])=>{let r=i[e];return[e,{content:r?.content??null,path:n.path,displayPath:r?.displayPath??n.displayPath??Xu(n.path,{source:n.source,projectDir:t.meta.projectDir}),source:n.source}]}))}async function ah(e,t){if(!e)return null;let n=await Um();if(!n)return null;let r=n.changes.find(t=>t.id===e);return r?Vm(n,r,t):null}async function oh(){let e=await Um();return e?e.changes.map(t=>Vm(e,t)):[]}async function sh(e,t){if(!e||!t||Nm(t))return null;let n=await Um();if(!n)return null;let r=n.changes.find(t=>t.id===e);return r?zm(r,t):null}async function ch(e,t){if(!e||!t||!Nm(t))return[];let n=await Um();if(!n)return[];let r=n.changes.find(t=>t.id===e);return r?Bm(r,t):[]}async function lh(){let e=await Um();if(!e)return[];let t=[];for(let n of e.specs)t.push({id:`spec:${n.id}`,kind:`spec`,title:n.name,href:`/specs/${encodeURIComponent(n.id)}`,path:`openspec/specs/${n.id}/spec.md`,content:n.content,updatedAt:n.updatedAt});for(let n of e.changes)t.push({id:`change:${n.id}`,kind:`change`,title:n.name,href:`/changes/${encodeURIComponent(n.id)}`,path:`openspec/changes/${n.id}`,content:[n.proposal,n.tasks,n.design,...n.deltas.map(e=>e.content)].map(e=>e?.trim()??``).filter(e=>e.length>0).join(`
153
153
 
154
154
  `),updatedAt:n.updatedAt});for(let n of e.archives)t.push({id:`archive:${n.id}`,kind:`archive`,title:n.name,href:`/archive/${encodeURIComponent(n.id)}`,path:`openspec/changes/archive/${n.id}`,content:[n.proposal,n.tasks,n.design].map(e=>e?.trim()??``).filter(e=>e.length>0).join(`
155
155
 
@@ -350,7 +350,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
350
350
  `+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=ZI(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=the;if(t.end=e,e>=this.to)t.text=``;else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,i=this.lineChunkAt(r);t.end=r+i.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+i,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw Error(`Unhandled block context `+Y[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to);break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
351
351
  `?``:t;else{let e=t.indexOf(`
352
352
  `);n=e<0?t:t.slice(0,e)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=iI.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e==`number`&&(e=new v(this.parser.nodeSet.types[e],PI,PI,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(XI(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?OI(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=XI(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(Y.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e==`string`?RI(this.parser.getNodeType(e),t,n,r):new LI(e,t)}get buffer(){return new FI(this.parser.nodeSet)}};function OI(e,t,n,r,i){let a=e[t].to,o=[],s=[],c=n.from+r;function l(n,i){for(;i?n>=a:n>a;){let i=e[t+1].from-a;r+=i,n+=i,t++,a=e[t].to}}for(let u=n.firstChild;u;u=u.nextSibling){l(u.from+r,!0);let n=u.from+r,d,f=i.get(u.tree);f?d=f:u.to+r>a?(d=OI(e,t,u,r,i),l(u.to+r,!1)):d=u.toTree(),o.push(d),s.push(n-c)}return l(n.to+r,!1),new v(n.type,o,s,n.to+r-c,n.tree?n.tree.propValues:void 0)}var kI=class e extends m{constructor(e,t,n,r,i,a,o,s,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=i,this.skipContextMarkup=a,this.inlineParsers=o,this.inlineNames=s,this.wrappers=c,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new nhe(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}configure(t){let n=jI(t);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,a=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),s=this.blockNames.slice(),c=this.inlineParsers.slice(),l=this.inlineNames.slice(),u=this.endLeafBlock.slice(),d=this.wrappers;if(AI(n.defineNodes)){i=Object.assign({},i);let e=r.types.slice(),t;for(let r of n.defineNodes){let{name:n,block:a,composite:o,style:s}=typeof r==`string`?{name:r}:r;if(e.some(e=>e.name==n))continue;o&&(i[e.length]=(e,t,n)=>o(t,n,e.value));let c=e.length,l=o?[`Block`,`BlockContext`]:a?c>=Y.ATXHeading1&&c<=Y.SetextHeading2?[`Block`,`LeafBlock`,`Heading`]:[`Block`,`LeafBlock`]:void 0;e.push(w.define({id:c,name:n,props:l&&[[ge.group,l]]})),s&&(t||={},Array.isArray(s)||s instanceof _?t[n]=s:Object.assign(t,s))}r=new C(e),t&&(r=r.extend(b(t)))}if(AI(n.props)&&(r=r.extend(...n.props)),AI(n.remove))for(let e of n.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(a[t]=o[t]=void 0),n>-1&&(c[n]=void 0)}if(AI(n.parseBlock))for(let e of n.parseBlock){let t=s.indexOf(e.name);if(t>-1)a[t]=e.parse,o[t]=e.leaf;else{let t=e.before?MI(s,e.before):e.after?MI(s,e.after)+1:s.length-1;a.splice(t,0,e.parse),o.splice(t,0,e.leaf),s.splice(t,0,e.name)}e.endLeaf&&u.push(e.endLeaf)}if(AI(n.parseInline))for(let e of n.parseInline){let t=l.indexOf(e.name);if(t>-1)c[t]=e.parse;else{let t=e.before?MI(l,e.before):e.after?MI(l,e.after)+1:l.length-1;c.splice(t,0,e.parse),l.splice(t,0,e.name)}}return n.wrap&&(d=d.concat(n.wrap)),new e(r,a,o,s,u,i,c,l,d)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new YI(this,e,t);outer:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let i=r(n,t,e);if(i>=0){e=i;continue outer}}e++}return n.resolveMarkers(0)}};function AI(e){return e!=null&&e.length>0}function jI(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=jI(e[0]);if(e.length==1)return t;let n=jI(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||PI).concat(t||PI),i=t.wrap,a=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:i?a?(e,t,n,r)=>i(a(e,t,n,r),t,n,r):i:a}}function MI(e,t){let n=e.indexOf(t);if(n<0)throw RangeError(`Position specified relative to unknown parser ${t}`);return n}var NI=[w.none];for(let e=1,t;t=Y[e];e++)NI[e]=w.define({id:e,name:t,props:e>=Y.Escape?[]:[[ge.group,e in oI?[`Block`,`BlockContext`]:[`Block`,`LeafBlock`]]],top:t==`Document`});var PI=[],FI=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+r*4),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return v.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}},II=class{constructor(e,t,n,r=PI){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new FI(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}},LI=class{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return PI}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}};function RI(e,t,n,r){return new II(e,t,n,r)}var zI={resolve:`Emphasis`,mark:`EmphasisMark`},BI={resolve:`Emphasis`,mark:`EmphasisMark`},VI={},HI={},UI=class{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}},rhe=`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`,WI=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{WI=RegExp(`[\\p{S}|\\p{P}]`,`u`)}catch{}var GI={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let r=e.char(n+1);for(let t=0;t<32;t++)if(rhe.charCodeAt(t)==r)return e.append(RI(Y.Escape,n,n+2));return-1},Entity(e,t,n){if(t!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return r?e.append(RI(Y.Entity,n,n+1+r[0].length)):-1},InlineCode(e,t,n){if(t!=96||n&&e.char(n-1)==96)return-1;let r=n+1;for(;r<e.end&&e.char(r)==96;)r++;let i=r-n,a=0;for(;r<e.end;r++)if(e.char(r)==96){if(a++,a==i&&e.char(r+1)!=96)return e.append(RI(Y.InlineCode,n,r+1,[RI(Y.CodeMark,n,n+i),RI(Y.CodeMark,r+1-i,r+1)]))}else a=0;return-1},HTMLTag(e,t,n){if(t!=60||n==e.end-1)return-1;let r=e.slice(n+1,e.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return e.append(RI(Y.Autolink,n,n+1+i[0].length,[RI(Y.LinkMark,n,n+1),RI(Y.URL,n+1,n+i[0].length),RI(Y.LinkMark,n+i[0].length,n+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(a)return e.append(RI(Y.Comment,n,n+1+a[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return e.append(RI(Y.ProcessingInstruction,n,n+1+o[0].length));let s=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return s?e.append(RI(Y.HTMLTag,n,n+1+s[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let r=n+1;for(;e.char(r)==t;)r++;let i=e.slice(n-1,n),a=e.slice(r,r+1),o=WI.test(i),s=WI.test(a),c=/\s|^$/.test(i),l=/\s|^$/.test(a),u=!l&&(!s||c||o),d=!c&&(!o||l||s),f=u&&(t==42||!d||o),p=d&&(t==42||!u||s);return e.append(new UI(t==95?zI:BI,n,r,(f?1:0)|(p?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(RI(Y.HardBreak,n,n+2));if(t==32){let t=n+1;for(;e.char(t)==32;)t++;if(e.char(t)==10&&t>=n+2)return e.append(RI(Y.HardBreak,n,t+1))}return-1},Link(e,t,n){return t==91?e.append(new UI(VI,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new UI(HI,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let t=e.parts.length-1;t>=0;t--){let r=e.parts[t];if(r instanceof UI&&(r.type==VI||r.type==HI)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let i=e.takeContent(t),a=e.parts[t]=ihe(e,i,r.type==VI?Y.Link:Y.Image,r.from,n+1);if(r.type==VI)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof UI&&t.type==VI&&(t.side=0)}return a.to}}return-1}};function ihe(e,t,n,r,i){let{text:a}=e,o=e.char(i),s=i;if(t.unshift(RI(Y.LinkMark,r,r+(n==Y.Image?2:1))),t.push(RI(Y.LinkMark,i-1,i)),o==40){let n=e.skipSpace(i+1),r=KI(a,n-e.offset,e.offset),o;r&&(n=e.skipSpace(r.to),n!=r.to&&(o=qI(a,n-e.offset,e.offset),o&&(n=e.skipSpace(o.to)))),e.char(n)==41&&(t.push(RI(Y.LinkMark,i,i+1)),s=n+1,r&&t.push(r),o&&t.push(o),t.push(RI(Y.LinkMark,n,s)))}else if(o==91){let n=JI(a,i-e.offset,e.offset,!1);n&&(t.push(n),s=n.to)}return RI(n,r,s,t)}function KI(e,t,n){if(e.charCodeAt(t)==60){for(let r=t+1;r<e.length;r++){let i=e.charCodeAt(r);if(i==62)return RI(Y.URL,t+n,r+1+n);if(i==60||i==10)return!1}return null}else{let r=0,i=t;for(let t=!1;i<e.length;i++){let n=e.charCodeAt(i);if(sI(n))break;if(t)t=!1;else if(n==40)r++;else if(n==41){if(!r)break;r--}else n==92&&(t=!0)}return i>t?RI(Y.URL,t+n,i+n):i==e.length?null:!1}}function qI(e,t,n){let r=e.charCodeAt(t);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let r=t+1,a=!1;r<e.length;r++){let o=e.charCodeAt(r);if(a)a=!1;else if(o==i)return RI(Y.LinkTitle,t+n,r+1+n);else o==92&&(a=!0)}return null}function JI(e,t,n,r){for(let i=!1,a=t+1,o=Math.min(e.length,a+999);a<o;a++){let o=e.charCodeAt(a);if(i)i=!1;else if(o==93)return r?!1:RI(Y.LinkLabel,t+n,a+1+n);else{if(r&&!sI(o)&&(r=!1),o==91)return!1;o==92&&(i=!0)}}return null}var YI=class{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,i){return this.append(new UI(e,t,n,(r?1:0)|(i?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof UI&&(t.type==VI||t.type==HI))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof UI&&n.type.resolve&&n.side&2))continue;let r=n.type==zI||n.type==BI,i=n.to-n.from,a,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof UI&&e.side&1&&e.type==n.type&&!(r&&(n.side&1||e.side&2)&&(e.to-e.from+i)%3==0&&((e.to-e.from)%3||i%3))){a=e;break}}if(!a)continue;let s=n.type.resolve,c=[],l=a.from,u=n.to;if(r){let e=Math.min(2,a.to-a.from,i);l=a.to-e,u=n.from+e,s=e==1?`Emphasis`:`StrongEmphasis`}a.type.mark&&c.push(this.elt(a.type.mark,l,a.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof II&&c.push(this.parts[e]),this.parts[e]=null;n.type.mark&&c.push(this.elt(n.type.mark,n.from,u));let d=this.elt(s,l,u,c);this.parts[o]=r&&a.from!=l?new UI(a.type,a.from,l,a.side):null,(this.parts[t]=r&&n.to!=u?new UI(n.type,u,n.to,n.side):null)?this.parts.splice(t,0,d):this.parts[t]=d}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof II&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof UI&&n.type==e&&n.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof UI?t:null}skipSpace(e){return cI(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e==`string`?RI(this.parser.getNodeType(e),t,n,r):new LI(e,t)}};YI.linkStart=VI,YI.imageStart=HI;function XI(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof II&&(n[r]=new II(t.type,t.from,t.to,XI(t.children,[e])))}else n.splice(r++,0,e)}return n}var ahe=[Y.CodeBlock,Y.ListItem,Y.OrderedList,Y.BulletList],ohe=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&this.input.read(e-1,e)!=`
353
- `;)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(ge.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),i=e.absoluteLineStart,a=i,o=e.block.children.length,s=a,c=o;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=ZI(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new v(e.parser.nodeSet.types[Y.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is(`Block`)&&(ahe.indexOf(t.type.id)<0?(a=t.to-n,o=e.block.children.length):(a=s,o=c,s=t.to-n,c=e.block.children.length)),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function ZI(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,a=t[r].from;i<e&&(n-=a-i)}return n}var she=b({"Blockquote/...":A.quote,HorizontalRule:A.contentSeparator,"ATXHeading1/... SetextHeading1/...":A.heading1,"ATXHeading2/... SetextHeading2/...":A.heading2,"ATXHeading3/...":A.heading3,"ATXHeading4/...":A.heading4,"ATXHeading5/...":A.heading5,"ATXHeading6/...":A.heading6,"Comment CommentBlock":A.comment,Escape:A.escape,Entity:A.character,"Emphasis/...":A.emphasis,"StrongEmphasis/...":A.strong,"Link/... Image/...":A.link,"OrderedList/... BulletList/...":A.list,"BlockQuote/...":A.quote,"InlineCode CodeText":A.monospace,"URL Autolink":A.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":A.processingInstruction,"CodeInfo LinkLabel":A.labelName,LinkTitle:A.string,Paragraph:A.content}),che=new kI(new C(NI).extend(she),Object.keys(TI).map(e=>TI[e]),Object.keys(TI).map(e=>DI[e]),Object.keys(TI),ehe,oI,Object.keys(GI).map(e=>GI[e]),Object.keys(GI),[]);function lhe(e,t,n){let r=[];for(let i=e.firstChild,a=t;;i=i.nextSibling){let e=i?i.from:n;if(e>a&&r.push({from:a,to:e}),!i)break;a=i.to}return r}function uhe(e){let{codeParser:t,htmlParser:n}=e;return{wrap:x((e,r)=>{let i=e.type.id;if(t&&(i==Y.CodeBlock||i==Y.FencedCode)){let n=``;if(i==Y.FencedCode){let t=e.node.getChild(Y.CodeInfo);t&&(n=r.read(t.from,t.to))}let a=t(n);if(a)return{parser:a,overlay:e=>e.type.id==Y.CodeText}}else if(n&&(i==Y.HTMLBlock||i==Y.HTMLTag||i==Y.CommentBlock))return{parser:n,overlay:lhe(e.node,e.from,e.to)};return null})}}var dhe={resolve:`Strikethrough`,mark:`StrikethroughMark`},fhe={defineNodes:[{name:`Strikethrough`,style:{"Strikethrough/...":A.strikethrough}},{name:`StrikethroughMark`,style:A.processingInstruction}],parseInline:[{name:`Strikethrough`,parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),a=/\s|^$/.test(r),o=/\s|^$/.test(i),s=WI.test(r),c=WI.test(i);return e.addDelimiter(dhe,n,n+2,!o&&(!c||a||s),!a&&(!s||o||c))},after:`Emphasis`}]};function QI(e,t,n=0,r,i=0){let a=0,o=!0,s=-1,c=-1,l=!1,u=()=>{r.push(e.elt(`TableCell`,i+s,i+c,e.parser.parseInline(t.slice(s,c),i+s)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);n==124&&!l?((!o||s>-1)&&a++,o=!1,r&&(s>-1&&u(),r.push(e.elt(`TableDelimiter`,d+i,d+i+1))),s=c=-1):(l||n!=32&&n!=9)&&(s<0&&(s=d),c=d+1),l=!l&&n==92}return s>-1&&(a++,r&&u()),a}function $I(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(t==124)return!0;t==92&&n++}return!1}var eL=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,tL=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&eL.test(r=t.text.slice(t.pos))){let i=[];QI(e,n.content,0,i,n.start)==QI(e,r,t.pos)&&(this.rows=[e.elt(`TableHeader`,n.start,n.start+n.content.length,i),e.elt(`TableDelimiter`,e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];QI(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt(`TableRow`,e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(`Table`,t.start,t.start+t.content.length,this.rows)),!0):!1}},phe={defineNodes:[{name:`Table`,block:!0},{name:`TableHeader`,style:{"TableHeader/...":A.heading}},`TableRow`,{name:`TableCell`,style:A.content},{name:`TableDelimiter`,style:A.processingInstruction}],parseBlock:[{name:`Table`,leaf(e,t){return $I(t.content,0)?new tL:null},endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof tL)||!$I(t.text,t.basePos))return!1;let r=e.peekLine();return eL.test(r)&&QI(e,t.text,t.basePos)==QI(e,r,t.basePos)},before:`SetextHeading`}]},mhe=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(`Task`,t.start,t.start+t.content.length,[e.elt(`TaskMarker`,t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},hhe={defineNodes:[{name:`Task`,block:!0,style:A.list},{name:`TaskMarker`,style:A.atom}],parseBlock:[{name:`TaskList`,leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name==`ListItem`?new mhe:null},after:`SetextHeading`}]},nL=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,rL=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,ghe=/[\w-]+\.[\w-]+($|\/)/,iL=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,aL=/\/[a-zA-Z\d@.]+/gy;function oL(e,t,n,r){let i=0;for(let a=t;a<n;a++)e[a]==r&&i++;return i}function _he(e,t){rL.lastIndex=t;let n=rL.exec(e);if(!n||ghe.exec(n[0])[0].indexOf(`_`)>-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],i;if(/[?!.,:*_~]/.test(n)||n==`)`&&oL(e,t,r,`)`)>oL(e,t,r,`(`))r--;else if(n==`;`&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function sL(e,t){iL.lastIndex=t;let n=iL.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r==`_`||r==`-`?-1:t+n[0].length-(r==`.`?1:0)}var vhe=[phe,hhe,fhe,{parseInline:[{name:`Autolink`,parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;nL.lastIndex=r;let i=nL.exec(e.text),a=-1;return!i||(i[1]||i[2]?(a=_he(e.text,r+i[0].length),a>-1&&e.hasOpenLink&&(a=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,a))[0].length)):i[3]?a=sL(e.text,r):(a=sL(e.text,r+i[0].length),a>-1&&i[0]==`xmpp:`&&(aL.lastIndex=a,i=aL.exec(e.text),i&&(a=i.index+i[0].length))),a<0)?-1:(e.addElement(e.elt(`URL`,n,a+e.offset)),a+e.offset)}}]}];function cL(e,t,n){return(r,i,a)=>{if(i!=e||r.char(a+1)==e)return-1;let o=[r.elt(n,a,a+1)];for(let i=a+1;i<r.end;i++){let s=r.char(i);if(s==e)return r.addElement(r.elt(t,a,i+1,o.concat(r.elt(n,i,i+1))));if(s==92&&o.push(r.elt(`Escape`,i,i+++2)),sI(s))break}return-1}}var yhe={defineNodes:[{name:`Superscript`,style:A.special(A.content)},{name:`SuperscriptMark`,style:A.processingInstruction}],parseInline:[{name:`Superscript`,parse:cL(94,`Superscript`,`SuperscriptMark`)}]},bhe={defineNodes:[{name:`Subscript`,style:A.special(A.content)},{name:`SubscriptMark`,style:A.processingInstruction}],parseInline:[{name:`Subscript`,parse:cL(126,`Subscript`,`SubscriptMark`)}]},xhe={defineNodes:[{name:`Emoji`,style:A.character}],parseInline:[{name:`Emoji`,parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt(`Emoji`,n,n+1+r[0].length))}}]},She=55,Che=1,whe=56,The=2,Ehe=57,Dhe=3,lL=4,Ohe=5,uL=6,dL=7,fL=8,pL=9,mL=10,khe=11,Ahe=12,jhe=13,hL=58,Mhe=14,Nhe=15,gL=59,_L=21,Phe=23,vL=24,Fhe=25,yL=27,bL=28,Ihe=29,Lhe=32,Rhe=35,zhe=37,Bhe=38,Vhe=0,Hhe=1,Uhe={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Whe={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},xL={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Ghe(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}var SL=null,CL=null,wL=0;function TL(e,t){let n=e.pos+t;if(wL==n&&CL==e)return SL;let r=e.peek(t),i=``;for(;Ghe(r);)i+=String.fromCharCode(r),r=e.peek(++t);return CL=e,wL=n,SL=i?i.toLowerCase():r==Khe||r==qhe?void 0:null}var EL=60,DL=62,OL=47,Khe=63,qhe=33,Jhe=45;function kL(e,t){this.name=e,this.parent=t}var Yhe=[uL,mL,dL,fL,pL],Xhe=new Me({start:null,shift(e,t,n,r){return Yhe.indexOf(t)>-1?new kL(TL(r,1)||``,e):e},reduce(e,t){return t==_L&&e?e.parent:e},reuse(e,t,n,r){let i=t.type.id;return i==uL||i==zhe?new kL(TL(r,1)||``,e):e},strict:!1}),Zhe=new Se((e,t)=>{if(e.next!=EL){e.next<0&&t.context&&e.acceptToken(hL);return}e.advance();let n=e.next==OL;n&&e.advance();let r=TL(e,0);if(r===void 0)return;if(!r)return e.acceptToken(n?Nhe:Mhe);let i=t.context?t.context.name:null;if(n){if(r==i)return e.acceptToken(khe);if(i&&Whe[i])return e.acceptToken(hL,-2);if(t.dialectEnabled(Vhe))return e.acceptToken(Ahe);for(let e=t.context;e;e=e.parent)if(e.name==r)return;e.acceptToken(jhe)}else{if(r==`script`)return e.acceptToken(dL);if(r==`style`)return e.acceptToken(fL);if(r==`textarea`)return e.acceptToken(pL);if(Uhe.hasOwnProperty(r))return e.acceptToken(mL);i&&xL[i]&&xL[i][r]?e.acceptToken(hL,-1):e.acceptToken(uL)}},{contextual:!0}),Qhe=new Se(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(gL);break}if(e.next==Jhe)t++;else if(e.next==DL&&t>=2){n>=3&&e.acceptToken(gL,-2);break}else t=0;e.advance()}});function $he(e){for(;e;e=e.parent)if(e.name==`svg`||e.name==`math`)return!0;return!1}var ege=new Se((e,t)=>{if(e.next==OL&&e.peek(1)==DL){let n=t.dialectEnabled(Hhe)||$he(t.context);e.acceptToken(n?Ohe:lL,2)}else e.next==DL&&e.acceptToken(lL,1)});function AL(e,t,n){let r=2+e.length;return new Se(i=>{for(let a=0,o=0,s=0;;s++){if(i.next<0){s&&i.acceptToken(t);break}if(a==0&&i.next==EL||a==1&&i.next==OL||a>=2&&a<r&&i.next==e.charCodeAt(a-2))a++,o++;else if(a==r&&i.next==DL){s>o?i.acceptToken(t,-o):i.acceptToken(n,-(o-2));break}else if((i.next==10||i.next==13)&&s){i.acceptToken(t,1);break}else a=o=0;i.advance()}})}var tge=AL(`script`,She,Che),nge=AL(`style`,whe,The),rge=AL(`textarea`,Ehe,Dhe),ige=b({"Text RawText IncompleteTag IncompleteCloseTag":A.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":A.angleBracket,TagName:A.tagName,"MismatchedCloseTag/TagName":[A.tagName,A.invalid],AttributeName:A.attributeName,"AttributeValue UnquotedAttributeValue":A.attributeValue,Is:A.definitionOperator,"EntityReference CharacterReference":A.character,Comment:A.blockComment,ProcessingInst:A.processingInstruction,DoctypeDecl:A.documentMeta}),age=Oe.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:`,c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~`,goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:`⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl`,maxTerm:68,context:Xhe,nodeProps:[[`closedBy`,-10,1,2,3,7,8,9,10,11,12,13,`EndTag`,6,`EndTag SelfClosingEndTag`,-4,22,31,34,37,`CloseTag`],[`openedBy`,4,`StartTag StartCloseTag`,5,`StartTag`,-4,30,33,36,38,`OpenTag`],[`group`,-10,14,15,18,19,20,21,40,41,42,43,`Entity`,17,`Entity TextContent`,-3,29,32,35,`TextContent Entity`],[`isolate`,-11,22,30,31,33,34,36,37,38,39,42,43,`ltr`,-3,27,28,40,``]],propSources:[ige],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!b`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!b`!dpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYlWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]`aP!b`!dp!_^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/ebiSlWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0rXiSqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0mS1bP;=`<%l0m[1hP;=`<%l/^!V1vciSaP!b`!dpOq&Xqr1krs&}sv1kvw0mwx(tx!P1k!P!Q&X!Q!^1k!^!_*V!_!a&X!a#s1k#s$f&X$f;'S1k;'S;=`3R<%l?Ah1k?Ah?BY&X?BY?Mn1k?MnO&X!V3UP;=`<%l1k!_3[P;=`<%l-_!Z3hV!ahaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_4WiiSlWd!ROX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst>]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!V<QciSOp7Sqr;{rs7Sst0mtw;{wx7Sx!P;{!P!Q7S!Q!];{!]!^=]!^!a7S!a#s;{#s$f7S$f;'S;{;'S;=`>P<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[tge,nge,rge,ege,Zhe,Qhe,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function jL(e,t){let n=Object.create(null);for(let r of e.getChildren(vL)){let e=r.getChild(Fhe),i=r.getChild(yL)||r.getChild(bL);e&&(n[t.read(e.from,e.to)]=i?i.type.id==yL?t.read(i.from+1,i.to-1):t.read(i.from,i.to):``)}return n}function ML(e,t){let n=e.getChild(Phe);return n?t.read(n.from,n.to):` `}function NL(e,t,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||=jL(e.node.parent.firstChild,t)))return{parser:i.parser};return null}function PL(e=[],t=[]){let n=[],r=[],i=[],a=[];for(let t of e)(t.tag==`script`?n:t.tag==`style`?r:t.tag==`textarea`?i:a).push(t);let o=t.length?Object.create(null):null;for(let e of t)(o[e.name]||(o[e.name]=[])).push(e);return x((e,t)=>{let s=e.type.id;if(s==Ihe)return NL(e,t,n);if(s==Lhe)return NL(e,t,r);if(s==Rhe)return NL(e,t,i);if(s==_L&&a.length){let n=e.node,r=n.firstChild,i=r&&ML(r,t),o;if(i){for(let e of a)if(e.tag==i&&(!e.attrs||e.attrs(o||=jL(r,t)))){let t=n.lastChild,i=t.type.id==Bhe?t.from:n.to;if(i>r.to)return{parser:e.parser,overlay:[{from:r.to,to:i}]}}}}if(o&&s==vL){let n=e.node,r;if(r=n.firstChild){let e=o[t.read(r.from,r.to)];if(e)for(let r of e){if(r.tagName&&r.tagName!=ML(n.parent,t))continue;let e=n.lastChild;if(e.type.id==yL){let t=e.from+1,n=e.lastChild,i=e.to-(n&&n.isError?0:1);if(i>t)return{parser:r.parser,overlay:[{from:t,to:i}]}}else if(e.type.id==bL)return{parser:r.parser,overlay:[{from:e.from,to:e.to}]}}}}return null})}var oge=122,FL=1,sge=123,cge=124,IL=2,lge=125,uge=3,dge=4,LL=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],fge=58,pge=40,RL=95,mge=91,zL=45,hge=46,gge=35,_ge=37,vge=38,yge=92,bge=10,xge=42;function BL(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function VL(e){return e>=48&&e<=57}function HL(e){return VL(e)||e>=97&&e<=102||e>=65&&e<=70}var UL=(e,t,n)=>(r,i)=>{for(let a=!1,o=0,s=0;;s++){let{next:c}=r;if(BL(c)||c==zL||c==RL||a&&VL(c))!a&&(c!=zL||s>0)&&(a=!0),o===s&&c==zL&&o++,r.advance();else if(c==yge&&r.peek(1)!=bge){if(r.advance(),HL(r.next)){do r.advance();while(HL(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();a=!0}else{a&&r.acceptToken(o==2&&i.canShift(IL)?t:c==pge?n:e);break}}},Sge=new Se(UL(sge,IL,cge)),Cge=new Se(UL(lge,uge,dge)),wge=new Se(e=>{if(LL.includes(e.peek(-1))){let{next:t}=e;(BL(t)||t==RL||t==gge||t==hge||t==xge||t==mge||t==fge&&BL(e.peek(1))||t==zL||t==vge)&&e.acceptToken(oge)}}),Tge=new Se(e=>{if(!LL.includes(e.peek(-1))){let{next:t}=e;if(t==_ge&&(e.advance(),e.acceptToken(FL)),BL(t)){do e.advance();while(BL(e.next)||VL(e.next));e.acceptToken(FL)}}}),Ege=b({"AtKeyword import charset namespace keyframes media supports":A.definitionKeyword,"from to selector":A.keyword,NamespaceName:A.namespace,KeyframeName:A.labelName,KeyframeRangeName:A.operatorKeyword,TagName:A.tagName,ClassName:A.className,PseudoClassName:A.constant(A.className),IdName:A.labelName,"FeatureName PropertyName":A.propertyName,AttributeName:A.attributeName,NumberLiteral:A.number,KeywordQuery:A.keyword,UnaryQueryOp:A.operatorKeyword,"CallTag ValueName":A.atom,VariableName:A.variableName,Callee:A.operatorKeyword,Unit:A.unit,"UniversalSelector NestingSelector":A.definitionOperator,"MatchOp CompareOp":A.compareOperator,"ChildOp SiblingOp, LogicOp":A.logicOperator,BinOp:A.arithmeticOperator,Important:A.modifier,Comment:A.blockComment,ColorLiteral:A.color,"ParenthesizedContent StringLiteral":A.string,":":A.punctuation,"PseudoOp #":A.derefOperator,"; ,":A.separator,"( )":A.paren,"[ ]":A.squareBracket,"{ }":A.brace}),Dge={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},Oge={__proto__:null,or:98,and:98,not:106,only:106,layer:170},kge={__proto__:null,selector:112,layer:166},Age={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},jge={__proto__:null,to:207},Mge=Oe.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#CfOOQP'#Ce'#CeO#}QdO'#ChO$nQaO'#CcO$xQdO'#CkO%TQdO'#DpO%YQdO'#DrO%_QdO'#DuO%_QdO'#DxOOQP'#FV'#FVO&eQhO'#EhOOQS'#FU'#FUOOQS'#Ek'#EkQYQdOOO&lQdO'#EOO&PQhO'#EUO&lQdO'#EWO'aQdO'#EYO'lQdO'#E]O'tQhO'#EcO(VQdO'#EeO(bQaO'#CfO)VQ`O'#D{O)[Q`O'#F`O)gQdO'#F`QOQ`OOP)qO&jO'#CaPOOO)C@t)C@tOOQP'#Cj'#CjOOQP,59S,59SO#}QdO,59SO)|QdO,59VO%TQdO,5:[O%YQdO,5:^O%_QdO,5:aO%_QdO,5:cO%_QdO,5:dO%_QdO'#ErO*XQ`O,58}O*aQdO'#DzOOQS,58},58}OOQP'#Cn'#CnOOQO'#Dn'#DnOOQP,59V,59VO*hQ`O,59VO*mQ`O,59VOOQP'#Dq'#DqOOQP,5:[,5:[OOQO'#Ds'#DsO*rQpO,5:^O+]QaO,5:aO+sQaO,5:dOOQW'#DZ'#DZO,ZQhO'#DdO,xQhO'#FaO'tQhO'#DbO-WQ`O'#DhOOQW'#F['#F[O-]Q`O,5;SO-eQ`O'#DeOOQS-E8i-E8iOOQ['#Cs'#CsO-jQdO'#CtO.QQdO'#CzO.hQdO'#C}O/OQ!pO'#DPO1RQ!jO,5:jOOQO'#DU'#DUO*mQ`O'#DTO1cQ!nO'#FXO3`Q`O'#DVO3eQ`O'#DkOOQ['#FX'#FXO-`Q`O,5:pO3jQ!bO,5:rOOQS'#E['#E[O3rQ`O,5:tO3wQdO,5:tOOQO'#E_'#E_O4PQ`O,5:wO4UQhO,5:}O%_QdO'#DgOOQS,5;P,5;PO-eQ`O,5;PO4^QdO,5;PO4fQdO,5:gO4vQdO'#EtO5TQ`O,5;zO5TQ`O,5;zPOOO'#Ej'#EjP5`O&jO,58{POOO,58{,58{OOQP1G.n1G.nOOQP1G.q1G.qO*hQ`O1G.qO*mQ`O1G.qOOQP1G/v1G/vO5kQpO1G/xO5sQaO1G/{O6ZQaO1G/}O6qQaO1G0OO7XQaO,5;^OOQO-E8p-E8pOOQS1G.i1G.iO7cQ`O,5:fO7hQdO'#DoO7oQdO'#CrOOQP1G/x1G/xO&lQdO1G/xO7vQ!jO'#DZO8UQ!bO,59vO8^QhO,5:OOOQO'#F]'#F]O8XQ!bO,59zO'tQhO,59xO8fQhO'#EvO8sQ`O,5;{O9OQhO,59|O9uQhO'#DiOOQW,5:S,5:SOOQS1G0n1G0nOOQW,5:P,5:PO9|Q!fO'#FYOOQS'#FY'#FYOOQS'#Em'#EmO;^QdO,59`OOQ[,59`,59`O;tQdO,59fOOQ[,59f,59fO<[QdO,59iOOQ[,59i,59iOOQ[,59k,59kO&lQdO,59mO<rQhO'#EQOOQW'#EQ'#EQO=WQ`O1G0UO1[QhO1G0UOOQ[,59o,59oO'tQhO'#DXOOQ[,59q,59qO=]Q#tO,5:VOOQS1G0[1G0[OOQS1G0^1G0^OOQS1G0`1G0`O=hQ`O1G0`O=mQdO'#E`OOQS1G0c1G0cOOQS1G0i1G0iO=xQaO,5:RO-`Q`O1G0kOOQS1G0k1G0kO-eQ`O1G0kO>PQ!fO1G0ROOQO1G0R1G0ROOQO,5;`,5;`O>gQdO,5;`OOQO-E8r-E8rO>tQ`O1G1fPOOO-E8h-E8hPOOO1G.g1G.gOOQP7+$]7+$]OOQP7+%d7+%dO&lQdO7+%dOOQS1G0Q1G0QO?PQaO'#F_O?ZQ`O,5:ZO?`Q!fO'#ElO@^QdO'#FWO@hQ`O,59^O@mQ!bO7+%dO&lQdO1G/bO@uQhO1G/fOOQW1G/j1G/jOOQW1G/d1G/dOAWQhO,5;bOOQO-E8t-E8tOAfQhO'#DZOAtQhO'#F^OBPQ`O'#F^OBUQ`O,5:TOOQS-E8k-E8kOOQ[1G.z1G.zOOQ[1G/Q1G/QOOQ[1G/T1G/TOOQ[1G/X1G/XOBZQdO,5:lOOQS7+%p7+%pOB`Q`O7+%pOBeQhO'#DYOBmQ`O,59sO'tQhO,59sOOQ[1G/q1G/qOBuQ`O1G/qOOQS7+%z7+%zOBzQbO'#DPOOQO'#Eb'#EbOCYQ`O'#EaOOQO'#Ea'#EaOCeQ`O'#EwOCmQdO,5:zOOQS,5:z,5:zOOQ[1G/m1G/mOOQS7+&V7+&VO-`Q`O7+&VOCxQ!fO'#EsO&lQdO'#EsOEPQdO7+%mOOQO7+%m7+%mOOQO1G0z1G0zOEdQ!bO<<IOOElQdO'#EqOEvQ`O,5;yOOQP1G/u1G/uOOQS-E8j-E8jOFOQdO'#EpOFYQ`O,5;rOOQ]1G.x1G.xOOQP<<IO<<IOOFbQdO7+$|OOQO'#D]'#D]OFiQ!bO7+%QOFqQhO'#EoOF{Q`O,5;xO&lQdO,5;xOOQW1G/o1G/oOOQO'#ES'#ESOGTQ`O1G0WOOQS<<I[<<I[O&lQdO,59tOGnQhO1G/_OOQ[1G/_1G/_OGuQ`O1G/_OOQW-E8l-E8lOOQ[7+%]7+%]OOQO,5:{,5:{O=pQdO'#ExOCeQ`O,5;cOOQS,5;c,5;cOOQS-E8u-E8uOOQS1G0f1G0fOOQS<<Iq<<IqOG}Q!fO,5;_OOQS-E8q-E8qOOQO<<IX<<IXOOQPAN>jAN>jOIUQaO,5;]OOQO-E8o-E8oOI`QdO,5;[OOQO-E8n-E8nOOQW<<Hh<<HhOOQW<<Hl<<HlOIjQhO<<HlOI{QhO,5;ZOJWQ`O,5;ZOOQO-E8m-E8mOJ]QdO1G1dOBZQdO'#EuOJgQ`O7+%rOOQW7+%r7+%rOJoQ!bO1G/`OOQ[7+$y7+$yOJzQhO7+$yPKRQ`O'#EnOOQO,5;d,5;dOOQO-E8v-E8vOOQS1G0}1G0}OKWQ`OAN>WO&lQdO1G0uOK]Q`O7+'OOOQO,5;a,5;aOOQO-E8s-E8sOOQW<<I^<<I^OOQ[<<He<<HePOQW,5;Y,5;YOOQWG23rG23rOKeQdO7+&a",stateData:"Kx~O#sOS#tQQ~OW[OZ[O]TO`VOaVOi]OjWOmXO!jYO!mZO!saO!ybO!{cO!}dO#QeO#WfO#YgO#oRO~OQiOW[OZ[O]TO`VOaVOi]OjWOmXO!jYO!mZO!saO!ybO!{cO!}dO#QeO#WfO#YgO#ohO~O#m$SP~P!dO#tmO~O#ooO~O]qO`rOarOjsOmtO!juO!mwO#nvO~OpzO!^xO~P$SOc!QO#o|O#p}O~O#o!RO~O#o!TO~OW[OZ[O]TO`VOaVOjWOmXO!jYO!mZO#oRO~OS!]Oe!YO!V![O!Y!`O#q!XOp$TP~Ok$TP~P&POQ!jOe!cOm!dOp!eOr!mOt!mOz!kO!`!lO#o!bO#p!hO#}!fO~Ot!qO!`!lO#o!pO~Ot!sO#o!sO~OS!]Oe!YO!V![O!Y!`O#q!XO~Oe!vOpzO#Z!xO~O]YX`YX`!pXaYXjYXmYXpYX!^YX!jYX!mYX#nYX~O`!zO~Ok!{O#m$SXo$SX~O#m$SXo$SX~P!dO#u#OO#v#OO#w#QO~Oc#UO#o|O#p}O~OpzO!^xO~Oo$SP~P!dOe#`O~Oe#aO~Ol#bO!h#cO~O]qO`rOarOjsOmtO~Op!ia!^!ia!j!ia!m!ia#n!iad!ia~P*zOp!la!^!la!j!la!m!la#n!lad!la~P*zOR#gOS!]Oe!YOr#gOt#gO!V![O!Y!`O#q#dO#}!fO~O!R#iO!^#jOk$TXp$TX~Oe#mO~Ok#oOpzO~Oe!vO~O]#rO`#rOd#uOi#rOj#rOk#rO~P&lO]#rO`#rOi#rOj#rOk#rOl#wO~P&lO]#rO`#rOi#rOj#rOk#rOo#yO~P&lOP#zOSsXesXksXvsX!VsX!YsX!usX!wsX#qsX!TsXQsX]sX`sXdsXisXjsXmsXpsXrsXtsXzsX!`sX#osX#psX#}sXlsXosX!^sX!qsX#msX~Ov#{O!u#|O!w#}Ok$TP~P'tOe#aOS#{Xk#{Xv#{X!V#{X!Y#{X!u#{X!w#{X#q#{XQ#{X]#{X`#{Xd#{Xi#{Xj#{Xm#{Xp#{Xr#{Xt#{Xz#{X!`#{X#o#{X#p#{X#}#{Xl#{Xo#{X!^#{X!q#{X#m#{X~Oe$RO~Oe$TO~Ok$VOv#{O~Ok$WO~Ot$XO!`!lO~Op$YO~OpzO!R#iO~OpzO#Z$`O~O!q$bOk!oa#m!oao!oa~P&lOk#hX#m#hXo#hX~P!dOk!{O#m$Sao$Sa~O#u#OO#v#OO#w$hO~Ol$jO!h$kO~Op!ii!^!ii!j!ii!m!ii#n!iid!ii~P*zOp!ki!^!ki!j!ki!m!ki#n!kid!ki~P*zOp!li!^!li!j!li!m!li#n!lid!li~P*zOp#fa!^#fa~P$SOo$lO~Od$RP~P%_Od#zP~P&lO`!PXd}X!R}X!T!PX~O`$sO!T$tO~Od$uO!R#iO~Ok#jXp#jX!^#jX~P'tO!^#jOk$Tap$Ta~O!R#iOk!Uap!Ua!^!Uad!Ua`!Ua~OS!]Oe!YO!V![O!Y!`O#q$yO~Od$QP~P9dOv#{OQ#|X]#|X`#|Xd#|Xe#|Xi#|Xj#|Xk#|Xm#|Xp#|Xr#|Xt#|Xz#|X!`#|X#o#|X#p#|X#}#|Xl#|Xo#|X~O]#rO`#rOd%OOi#rOj#rOk#rO~P&lO]#rO`#rOi#rOj#rOk#rOl%PO~P&lO]#rO`#rOi#rOj#rOk#rOo%QO~P&lOe%SOS!tXk!tX!V!tX!Y!tX#q!tX~Ok%TO~Od%YOt%ZO!a%ZO~Ok%[O~Oo%cO#o%^O#}%]O~Od%dO~P$SOv#{O!^%hO!q%jOk!oi#m!oio!oi~P&lOk#ha#m#hao#ha~P!dOk!{O#m$Sio$Si~O!^%mOd$RX~P$SOd%oO~Ov#{OQ#`Xd#`Xe#`Xm#`Xp#`Xr#`Xt#`Xz#`X!^#`X!`#`X#o#`X#p#`X#}#`X~O!^%qOd#zX~P&lOd%sO~Ol%tOv#{O~OR#gOr#gOt#gO#q%vO#}!fO~O!R#iOk#jap#ja!^#ja~O`!PXd}X!R}X!^}X~O!R#iO!^%xOd$QX~O`%zO~Od%{O~O#o%|O~Ok&OO~O`&PO!R#iO~Od&ROk&QO~Od&UO~OP#zOpsX!^sXdsX~O#}%]Op#TX!^#TX~OpzO!^&WO~Oo&[O#o%^O#}%]O~Ov#{OQ#gXe#gXk#gXm#gXp#gXr#gXt#gXz#gX!^#gX!`#gX!q#gX#m#gX#o#gX#p#gX#}#gXo#gX~O!^%hO!q&`Ok!oq#m!oqo!oq~P&lOl&aOv#{O~Od#eX!^#eX~P%_O!^%mOd$Ra~Od#dX!^#dX~P&lO!^%qOd#za~Od&fO~P&lOd&gO!T&hO~Od#cX!^#cX~P9dO!^%xOd$Qa~O]&mOd&oO~OS#bae#ba!V#ba!Y#ba#q#ba~Od&qO~PG]Od&qOk&rO~Ov#{OQ#gae#gak#gam#gap#gar#gat#gaz#ga!^#ga!`#ga!q#ga#m#ga#o#ga#p#ga#}#gao#ga~Od#ea!^#ea~P$SOd#da!^#da~P&lOR#gOr#gOt#gO#q%vO#}%]O~O!R#iOd#ca!^#ca~O`&xO~O!^%xOd$Qi~P&lO]&mOd&|O~Ov#{Od|ik|i~Od&}O~PG]Ok'OO~Od'PO~O!^%xOd$Qq~Od#cq!^#cq~P&lO#s!a#t#}]#}v!m~",goto:"2h$UPPPPP$VP$YP$c$uP$cP%X$cPP%_PPP%e%o%oPPPPP%oPP%oP&]P%oP%o'W%oP't'w'}'}(^'}P'}P'}P'}'}P(m'}(yP(|PP)p)v$c)|$c*SP$cP$c$cP*Y*{+YP$YP+aP+dP$YP$YP$YP+j$YP+m+p+s+z$YP$YPP$YP,P,V,f,|-[-b-l-r-x.O.U.`.f.l.rPPPPPPPPPPP.x/R/w/z0|P1U1u2O2R2U2[RnQ_^OP`kz!{$dq[OPYZ`kuvwxz!v!{#`$d%mqSOPYZ`kuvwxz!v!{#`$d%mQpTR#RqQ!OVR#SrQ#S!QS$Q!i!jR$i#U!V!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'Q!U!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QU#g!Y$t&hU%`$Y%b&WR&V%_!V!iac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QR$S!kQ%W$RR&S%Xk!^]bf!Y![!g#i#j#m$P$R%X%xQ#e!YQ${#mQ%w$tQ&j%xR&w&hQ!ygQ#p!`Q$^!xR%f$`R#n!]!U!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QQ!qdR$X!rQ!PVR#TrQ#S!PR$i#TQ!SWR#VsQ!UXR#WtQ{UQ!wgQ#^yQ#o!_Q$U!nQ$[!uQ$_!yQ%e$^Q&Y%aQ&]%fR&v&XSjPzQ!}kQ$c!{R%k$dZiPkz!{$dR$P!gQ%}%SR&z&mR!rdR!teR$Z!tS%a$Y%bR&t&WV%_$Y%b&WQ#PmR$g#PQ`OSkPzU!a`k$dR$d!{Q$p#aY%p$p%u&d&l'QQ%u$sQ&d%qQ&l%zR'Q&xQ#t!cQ#v!dQ#x!eV$}#t#v#xQ%X$RR&T%XQ%y$zS&k%y&yR&y&lQ%r$pR&e%rQ%n$mR&c%nQyUR#]yQ%i$aR&_%iQ!|jS$e!|$fR$f!}Q&n%}R&{&nQ#k!ZR$x#kQ%b$YR&Z%bQ&X%aR&u&X__OP`kz!{$d^UOP`kz!{$dQ!VYQ!WZQ#XuQ#YvQ#ZwQ#[xQ$]!vQ$m#`R&b%mR$q#aQ!gaQ!oc[#q!c!d!e#t#v#xQ$a!zd$o#a$p$s%q%u%z&d&l&x'QQ$r#cQ%R#{S%g$a%iQ%l$kQ&^%hR&p&P]#s!c!d!e#t#v#xW!Z]b!g$PQ!ufQ#f!YQ#l![Q$v#iQ$w#jQ$z#mS%V$R%XR&i%xQ#h!YQ%w$tR&w&hR$|#mR$n#`QlPR#_zQ!_]Q!nbQ$O!gR%U$P",nodeNames:`⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to AtRule Styles`,maxTerm:143,nodeProps:[[`isolate`,-2,5,36,``],[`openedBy`,20,`(`,28,`[`,31,`{`],[`closedBy`,21,`)`,29,`]`,32,`}`]],propSources:[Ege],skippedNodes:[0,5,106],repeatNodeCount:15,tokenData:"JQ~R!YOX$qX^%i^p$qpq%iqr({rs-ust/itu6Wuv$qvw7Qwx7cxy9Qyz9cz{9h{|:R|}>t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$KW%i$KW&FU$q&FU&FV%i&FV;'S$q;'S;=`Iz<%lO$q`$tSOy%Qz;'S%Q;'S;=`%c<%lO%Q`%VS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q`%fP;=`<%l%Q~%nh#s~OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Q~'ah#s~!a`OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Qj)OUOy%Qz#]%Q#]#^)b#^;'S%Q;'S;=`%c<%lO%Qj)gU!a`Oy%Qz#a%Q#a#b)y#b;'S%Q;'S;=`%c<%lO%Qj*OU!a`Oy%Qz#d%Q#d#e*b#e;'S%Q;'S;=`%c<%lO%Qj*gU!a`Oy%Qz#c%Q#c#d*y#d;'S%Q;'S;=`%c<%lO%Qj+OU!a`Oy%Qz#f%Q#f#g+b#g;'S%Q;'S;=`%c<%lO%Qj+gU!a`Oy%Qz#h%Q#h#i+y#i;'S%Q;'S;=`%c<%lO%Qj,OU!a`Oy%Qz#T%Q#T#U,b#U;'S%Q;'S;=`%c<%lO%Qj,gU!a`Oy%Qz#b%Q#b#c,y#c;'S%Q;'S;=`%c<%lO%Qj-OU!a`Oy%Qz#h%Q#h#i-b#i;'S%Q;'S;=`%c<%lO%Qj-iS!qY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q~-xWOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c<%lO-u~.gOt~~.jRO;'S-u;'S;=`.s;=`O-u~.vXOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c;=`<%l-u<%lO-u~/fP;=`<%l-uj/nYjYOy%Qz!Q%Q!Q![0^![!c%Q!c!i0^!i#T%Q#T#Z0^#Z;'S%Q;'S;=`%c<%lO%Qj0cY!a`Oy%Qz!Q%Q!Q![1R![!c%Q!c!i1R!i#T%Q#T#Z1R#Z;'S%Q;'S;=`%c<%lO%Qj1WY!a`Oy%Qz!Q%Q!Q![1v![!c%Q!c!i1v!i#T%Q#T#Z1v#Z;'S%Q;'S;=`%c<%lO%Qj1}YrY!a`Oy%Qz!Q%Q!Q![2m![!c%Q!c!i2m!i#T%Q#T#Z2m#Z;'S%Q;'S;=`%c<%lO%Qj2tYrY!a`Oy%Qz!Q%Q!Q![3d![!c%Q!c!i3d!i#T%Q#T#Z3d#Z;'S%Q;'S;=`%c<%lO%Qj3iY!a`Oy%Qz!Q%Q!Q![4X![!c%Q!c!i4X!i#T%Q#T#Z4X#Z;'S%Q;'S;=`%c<%lO%Qj4`YrY!a`Oy%Qz!Q%Q!Q![5O![!c%Q!c!i5O!i#T%Q#T#Z5O#Z;'S%Q;'S;=`%c<%lO%Qj5TY!a`Oy%Qz!Q%Q!Q![5s![!c%Q!c!i5s!i#T%Q#T#Z5s#Z;'S%Q;'S;=`%c<%lO%Qj5zSrY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qd6ZUOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qd6tS!hS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qb7VSZQOy%Qz;'S%Q;'S;=`%c<%lO%Q~7fWOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z<%lO7c~8RRO;'S7c;'S;=`8[;=`O7c~8_XOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z;=`<%l7c<%lO7c~8}P;=`<%l7cj9VSeYOy%Qz;'S%Q;'S;=`%c<%lO%Q~9hOd~n9oUWQvWOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qj:YWvW!mQOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj:wU!a`Oy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Qj;bY!a`#}YOy%Qz!Q%Q!Q![;Z![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%Qj<VY!a`Oy%Qz{%Q{|<u|}%Q}!O<u!O!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj<zU!a`Oy%Qz!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj=eU!a`#}YOy%Qz!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj>O[!a`#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%Qj>yS!^YOy%Qz;'S%Q;'S;=`%c<%lO%Qj?[WvWOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj?yU]YOy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Q~@bTvWOy%Qz{@q{;'S%Q;'S;=`%c<%lO%Q~@xS!a`#t~Oy%Qz;'S%Q;'S;=`%c<%lO%QjAZ[#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%QjBUU`YOy%Qz![%Q![!]Bh!];'S%Q;'S;=`%c<%lO%QbBoSaQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjCQSkYOy%Qz;'S%Q;'S;=`%c<%lO%QhCcU!TWOy%Qz!_%Q!_!`Cu!`;'S%Q;'S;=`%c<%lO%QhC|S!TW!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QlDaS!TW!hSOy%Qz;'S%Q;'S;=`%c<%lO%QjDtV!jQ!TWOy%Qz!_%Q!_!`Cu!`!aEZ!a;'S%Q;'S;=`%c<%lO%QbEbS!jQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjEqYOy%Qz}%Q}!OFa!O!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjFfW!a`Oy%Qz!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjGV[iY!a`Oy%Qz}%Q}!OGO!O!Q%Q!Q![GO![!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjHQSmYOy%Qz;'S%Q;'S;=`%c<%lO%QnHcSl^Oy%Qz;'S%Q;'S;=`%c<%lO%QjHtSpYOy%Qz;'S%Q;'S;=`%c<%lO%QjIVSoYOy%Qz;'S%Q;'S;=`%c<%lO%QfIhU!mQOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Q`I}P;=`<%l$q",tokenizers:[wge,Tge,Sge,Cge,1,2,3,4,new pe(`m~RRYZ[z{a~~g~aO#v~~dP!P!Qg~lO#w~~`,28,129)],topRules:{StyleSheet:[0,6],Styles:[1,105]},specialized:[{term:124,get:e=>Dge[e]||-1},{term:125,get:e=>Oge[e]||-1},{term:4,get:e=>kge[e]||-1},{term:25,get:e=>Age[e]||-1},{term:123,get:e=>jge[e]||-1}],tokenPrec:1963}),WL=null;function GL(){if(!WL&&typeof document==`object`&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let r in e)r!=`cssText`&&r!=`cssFloat`&&typeof e[r]==`string`&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,e=>`-`+e.toLowerCase())),n.has(r)||(t.push(r),n.add(r)));WL=t.sort().map(e=>({type:`property`,label:e,apply:e+`: `}))}return WL||[]}var KL=`active.after.any-link.autofill.backdrop.before.checked.cue.default.defined.disabled.empty.enabled.file-selector-button.first.first-child.first-letter.first-line.first-of-type.focus.focus-visible.focus-within.fullscreen.has.host.host-context.hover.in-range.indeterminate.invalid.is.lang.last-child.last-of-type.left.link.marker.modal.not.nth-child.nth-last-child.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.part.placeholder.placeholder-shown.read-only.read-write.required.right.root.scope.selection.slotted.target.target-text.valid.visited.where`.split(`.`).map(e=>({type:`class`,label:e})),qL=`above.absolute.activeborder.additive.activecaption.after-white-space.ahead.alias.all.all-scroll.alphabetic.alternate.always.antialiased.appworkspace.asterisks.attr.auto.auto-flow.avoid.avoid-column.avoid-page.avoid-region.axis-pan.background.backwards.baseline.below.bidi-override.blink.block.block-axis.bold.bolder.border.border-box.both.bottom.break.break-all.break-word.bullets.button.button-bevel.buttonface.buttonhighlight.buttonshadow.buttontext.calc.capitalize.caps-lock-indicator.caption.captiontext.caret.cell.center.checkbox.circle.cjk-decimal.clear.clip.close-quote.col-resize.collapse.color.color-burn.color-dodge.column.column-reverse.compact.condensed.contain.content.contents.content-box.context-menu.continuous.copy.counter.counters.cover.crop.cross.crosshair.currentcolor.cursive.cyclic.darken.dashed.decimal.decimal-leading-zero.default.default-button.dense.destination-atop.destination-in.destination-out.destination-over.difference.disc.discard.disclosure-closed.disclosure-open.document.dot-dash.dot-dot-dash.dotted.double.down.e-resize.ease.ease-in.ease-in-out.ease-out.element.ellipse.ellipsis.embed.end.ethiopic-abegede-gez.ethiopic-halehame-aa-er.ethiopic-halehame-gez.ew-resize.exclusion.expanded.extends.extra-condensed.extra-expanded.fantasy.fast.fill.fill-box.fixed.flat.flex.flex-end.flex-start.footnotes.forwards.from.geometricPrecision.graytext.grid.groove.hand.hard-light.help.hidden.hide.higher.highlight.highlighttext.horizontal.hsl.hsla.hue.icon.ignore.inactiveborder.inactivecaption.inactivecaptiontext.infinite.infobackground.infotext.inherit.initial.inline.inline-axis.inline-block.inline-flex.inline-grid.inline-table.inset.inside.intrinsic.invert.italic.justify.keep-all.landscape.large.larger.left.level.lighter.lighten.line-through.linear.linear-gradient.lines.list-item.listbox.listitem.local.logical.loud.lower.lower-hexadecimal.lower-latin.lower-norwegian.lowercase.ltr.luminosity.manipulation.match.matrix.matrix3d.medium.menu.menutext.message-box.middle.min-intrinsic.mix.monospace.move.multiple.multiple_mask_images.multiply.n-resize.narrower.ne-resize.nesw-resize.no-close-quote.no-drop.no-open-quote.no-repeat.none.normal.not-allowed.nowrap.ns-resize.numbers.numeric.nw-resize.nwse-resize.oblique.opacity.open-quote.optimizeLegibility.optimizeSpeed.outset.outside.outside-shape.overlay.overline.padding.padding-box.painted.page.paused.perspective.pinch-zoom.plus-darker.plus-lighter.pointer.polygon.portrait.pre.pre-line.pre-wrap.preserve-3d.progress.push-button.radial-gradient.radio.read-only.read-write.read-write-plaintext-only.rectangle.region.relative.repeat.repeating-linear-gradient.repeating-radial-gradient.repeat-x.repeat-y.reset.reverse.rgb.rgba.ridge.right.rotate.rotate3d.rotateX.rotateY.rotateZ.round.row.row-resize.row-reverse.rtl.run-in.running.s-resize.sans-serif.saturation.scale.scale3d.scaleX.scaleY.scaleZ.screen.scroll.scrollbar.scroll-position.se-resize.self-start.self-end.semi-condensed.semi-expanded.separate.serif.show.single.skew.skewX.skewY.skip-white-space.slide.slider-horizontal.slider-vertical.sliderthumb-horizontal.sliderthumb-vertical.slow.small.small-caps.small-caption.smaller.soft-light.solid.source-atop.source-in.source-out.source-over.space.space-around.space-between.space-evenly.spell-out.square.start.static.status-bar.stretch.stroke.stroke-box.sub.subpixel-antialiased.svg_masks.super.sw-resize.symbolic.symbols.system-ui.table.table-caption.table-cell.table-column.table-column-group.table-footer-group.table-header-group.table-row.table-row-group.text.text-bottom.text-top.textarea.textfield.thick.thin.threeddarkshadow.threedface.threedhighlight.threedlightshadow.threedshadow.to.top.transform.translate.translate3d.translateX.translateY.translateZ.transparent.ultra-condensed.ultra-expanded.underline.unidirectional-pan.unset.up.upper-latin.uppercase.url.var.vertical.vertical-text.view-box.visible.visibleFill.visiblePainted.visibleStroke.visual.w-resize.wait.wave.wider.window.windowframe.windowtext.words.wrap.wrap-reverse.x-large.x-small.xor.xx-large.xx-small`.split(`.`).map(e=>({type:`keyword`,label:e})).concat(`aliceblue.antiquewhite.aqua.aquamarine.azure.beige.bisque.black.blanchedalmond.blue.blueviolet.brown.burlywood.cadetblue.chartreuse.chocolate.coral.cornflowerblue.cornsilk.crimson.cyan.darkblue.darkcyan.darkgoldenrod.darkgray.darkgreen.darkkhaki.darkmagenta.darkolivegreen.darkorange.darkorchid.darkred.darksalmon.darkseagreen.darkslateblue.darkslategray.darkturquoise.darkviolet.deeppink.deepskyblue.dimgray.dodgerblue.firebrick.floralwhite.forestgreen.fuchsia.gainsboro.ghostwhite.gold.goldenrod.gray.grey.green.greenyellow.honeydew.hotpink.indianred.indigo.ivory.khaki.lavender.lavenderblush.lawngreen.lemonchiffon.lightblue.lightcoral.lightcyan.lightgoldenrodyellow.lightgray.lightgreen.lightpink.lightsalmon.lightseagreen.lightskyblue.lightslategray.lightsteelblue.lightyellow.lime.limegreen.linen.magenta.maroon.mediumaquamarine.mediumblue.mediumorchid.mediumpurple.mediumseagreen.mediumslateblue.mediumspringgreen.mediumturquoise.mediumvioletred.midnightblue.mintcream.mistyrose.moccasin.navajowhite.navy.oldlace.olive.olivedrab.orange.orangered.orchid.palegoldenrod.palegreen.paleturquoise.palevioletred.papayawhip.peachpuff.peru.pink.plum.powderblue.purple.rebeccapurple.red.rosybrown.royalblue.saddlebrown.salmon.sandybrown.seagreen.seashell.sienna.silver.skyblue.slateblue.slategray.snow.springgreen.steelblue.tan.teal.thistle.tomato.turquoise.violet.wheat.white.whitesmoke.yellow.yellowgreen`.split(`.`).map(e=>({type:`constant`,label:e}))),Nge=`a.abbr.address.article.aside.b.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.dd.del.details.dfn.dialog.div.dl.dt.em.figcaption.figure.footer.form.header.hgroup.h1.h2.h3.h4.h5.h6.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.main.meter.nav.ol.output.p.pre.ruby.section.select.small.source.span.strong.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.tr.u.ul`.split(`.`).map(e=>({type:`type`,label:e})),Pge=[`@charset`,`@color-profile`,`@container`,`@counter-style`,`@font-face`,`@font-feature-values`,`@font-palette-values`,`@import`,`@keyframes`,`@layer`,`@media`,`@namespace`,`@page`,`@position-try`,`@property`,`@scope`,`@starting-style`,`@supports`,`@view-transition`].map(e=>({type:`keyword`,label:e})),JL=/^(\w[\w-]*|-\w[\w-]*|)$/,Fge=/^-(-[\w-]*)?$/;function Ige(e,t){if((e.name==`(`||e.type.isError)&&(e=e.parent||e),e.name!=`ArgList`)return!1;let n=e.parent?.firstChild;return n?.name==`Callee`?t.sliceString(n.from,n.to)==`var`:!1}var YL=new O,Lge=[`Declaration`];function Rge(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function XL(e,t,n){if(t.to-t.from>4096){let r=YL.get(t);if(r)return r;let i=[],o=new Set,s=t.cursor(a.IncludeAnonymous);if(s.firstChild())do for(let t of XL(e,s.node,n))o.has(t.label)||(o.add(t.label),i.push(t));while(s.nextSibling());return YL.set(t,i),i}else{let r=[],i=new Set;return t.cursor().iterate(t=>{if(n(t)&&t.matchContext(Lge)&&t.node.nextSibling?.name==`:`){let n=e.sliceString(t.from,t.to);i.has(n)||(i.add(n),r.push({label:n,type:`variable`}))}}),r}}var ZL=e=>t=>{let{state:n,pos:r}=t,i=p(n).resolveInner(r,-1),a=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)==`-`;if(i.name==`PropertyName`||(a||i.name==`TagName`)&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:GL(),validFor:JL};if(i.name==`ValueName`)return{from:i.from,options:qL,validFor:JL};if(i.name==`PseudoClassName`)return{from:i.from,options:KL,validFor:JL};if(e(i)||(t.explicit||a)&&Ige(i,n.doc))return{from:e(i)||a?i.from:r,options:XL(n.doc,Rge(i),e),validFor:Fge};if(i.name==`TagName`){for(let{parent:e}=i;e;e=e.parent)if(e.name==`Block`)return{from:i.from,options:GL(),validFor:JL};return{from:i.from,options:Nge,validFor:JL}}if(i.name==`AtKeyword`)return{from:i.from,options:Pge,validFor:JL};if(!t.explicit)return null;let o=i.resolve(r),s=o.childBefore(r);return s&&s.name==`:`&&o.name==`PseudoClassSelector`?{from:r,options:KL,validFor:JL}:s&&s.name==`:`&&o.name==`Declaration`||o.name==`ArgList`?{from:r,options:qL,validFor:JL}:o.name==`Block`||o.name==`Styles`?{from:r,options:GL(),validFor:JL}:null},QL=ZL(e=>e.name==`VariableName`),$L=Ae.define({name:`css`,parser:Mge.configure({props:[l.add({Declaration:fe()}),s.add({"Block KeyframeList":ze})]}),languageData:{commentTokens:{block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*\}$/,wordChars:`-`}});function eR(){return new Ne($L,$L.data.of({autocomplete:QL}))}var tR=[`_blank`,`_self`,`_top`,`_parent`],nR=[`ascii`,`utf-8`,`utf-16`,`latin1`,`latin1`],rR=[`get`,`post`,`put`,`delete`],iR=[`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`],aR=[`true`,`false`],oR={},zge={a:{attrs:{href:null,ping:null,type:null,media:null,target:tR,hreflang:null}},abbr:oR,address:oR,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:[`default`,`rect`,`circle`,`poly`]}},article:oR,aside:oR,audio:{attrs:{src:null,mediagroup:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`none`,`metadata`,`auto`],autoplay:[`autoplay`],loop:[`loop`],controls:[`controls`]}},b:oR,base:{attrs:{href:null,target:tR}},bdi:oR,bdo:oR,blockquote:{attrs:{cite:null}},body:oR,br:oR,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:[`autofocus`],disabled:[`autofocus`],formenctype:iR,formmethod:rR,formnovalidate:[`novalidate`],formtarget:tR,type:[`submit`,`reset`,`button`]}},canvas:{attrs:{width:null,height:null}},caption:oR,center:oR,cite:oR,code:oR,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:[`command`,`checkbox`,`radio`],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:[`disabled`],checked:[`checked`]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:[`disabled`],multiple:[`multiple`]}},datalist:{attrs:{data:null}},dd:oR,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:[`open`]}},dfn:oR,div:oR,dl:oR,dt:oR,em:oR,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:[`disabled`],form:null,name:null}},figcaption:oR,figure:oR,footer:oR,form:{attrs:{action:null,name:null,"accept-charset":nR,autocomplete:[`on`,`off`],enctype:iR,method:rR,novalidate:[`novalidate`],target:tR}},h1:oR,h2:oR,h3:oR,h4:oR,h5:oR,h6:oR,head:{children:[`title`,`base`,`link`,`style`,`meta`,`script`,`noscript`,`command`]},header:oR,hgroup:oR,hr:oR,html:{attrs:{manifest:null}},i:oR,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:[`allow-top-navigation`,`allow-same-origin`,`allow-forms`,`allow-scripts`],seamless:[`seamless`]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:[`audio/*`,`video/*`,`image/*`],autocomplete:[`on`,`off`],autofocus:[`autofocus`],checked:[`checked`],disabled:[`disabled`],formenctype:iR,formmethod:rR,formnovalidate:[`novalidate`],formtarget:tR,multiple:[`multiple`],readonly:[`readonly`],required:[`required`],type:[`hidden`,`text`,`search`,`tel`,`url`,`email`,`password`,`datetime`,`date`,`month`,`week`,`time`,`datetime-local`,`number`,`range`,`color`,`checkbox`,`radio`,`file`,`submit`,`image`,`reset`,`button`]}},ins:{attrs:{cite:null,datetime:null}},kbd:oR,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:[`autofocus`],disabled:[`disabled`],keytype:[`RSA`]}},label:{attrs:{for:null,form:null}},legend:oR,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:[`all`,`16x16`,`16x16 32x32`,`16x16 32x32 64x64`]}},map:{attrs:{name:null}},mark:oR,menu:{attrs:{label:null,type:[`list`,`context`,`toolbar`]}},meta:{attrs:{content:null,charset:nR,name:[`viewport`,`application-name`,`author`,`description`,`generator`,`keywords`],"http-equiv":[`content-language`,`content-type`,`default-style`,`refresh`]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:oR,noscript:oR,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:[`typemustmatch`]}},ol:{attrs:{reversed:[`reversed`],start:null,type:[`1`,`a`,`A`,`i`,`I`]},children:[`li`,`script`,`template`,`ul`,`ol`]},optgroup:{attrs:{disabled:[`disabled`],label:null}},option:{attrs:{disabled:[`disabled`],label:null,selected:[`selected`],value:null}},output:{attrs:{for:null,form:null,name:null}},p:oR,param:{attrs:{name:null,value:null}},pre:oR,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:oR,rt:oR,ruby:oR,samp:oR,script:{attrs:{type:[`text/javascript`],src:null,async:[`async`],defer:[`defer`],charset:nR}},section:oR,select:{attrs:{form:null,name:null,size:null,autofocus:[`autofocus`],disabled:[`disabled`],multiple:[`multiple`]}},slot:{attrs:{name:null}},small:oR,source:{attrs:{src:null,type:null,media:null}},span:oR,strong:oR,style:{attrs:{type:[`text/css`],media:null,scoped:null}},sub:oR,summary:oR,sup:oR,table:oR,tbody:oR,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:oR,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:[`autofocus`],disabled:[`disabled`],readonly:[`readonly`],required:[`required`],wrap:[`soft`,`hard`]}},tfoot:oR,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:[`row`,`col`,`rowgroup`,`colgroup`]}},thead:oR,time:{attrs:{datetime:null}},title:oR,tr:oR,track:{attrs:{src:null,label:null,default:null,kind:[`subtitles`,`captions`,`descriptions`,`chapters`,`metadata`],srclang:null}},ul:{children:[`li`,`script`,`template`,`ul`,`ol`]},var:oR,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`auto`,`metadata`,`none`],autoplay:[`autoplay`],mediagroup:[`movie`],muted:[`muted`],controls:[`controls`]}},wbr:oR},sR={accesskey:null,class:null,contenteditable:aR,contextmenu:null,dir:[`ltr`,`rtl`,`auto`],draggable:[`true`,`false`,`auto`],dropzone:[`copy`,`move`,`link`,`string:`,`file:`],hidden:[`hidden`],id:null,inert:[`inert`],itemid:null,itemprop:null,itemref:null,itemscope:[`itemscope`],itemtype:null,lang:[`ar`,`bn`,`de`,`en-GB`,`en-US`,`es`,`fr`,`hi`,`id`,`ja`,`pa`,`pt`,`ru`,`tr`,`zh`],spellcheck:aR,autocorrect:aR,autocapitalize:aR,style:null,tabindex:null,title:null,translate:[`yes`,`no`],rel:[`stylesheet`,`alternate`,`author`,`bookmark`,`help`,`license`,`next`,`nofollow`,`noreferrer`,`prefetch`,`prev`,`search`,`tag`],role:`alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer`.split(` `),"aria-activedescendant":null,"aria-atomic":aR,"aria-autocomplete":[`inline`,`list`,`both`,`none`],"aria-busy":aR,"aria-checked":[`true`,`false`,`mixed`,`undefined`],"aria-controls":null,"aria-describedby":null,"aria-disabled":aR,"aria-dropeffect":null,"aria-expanded":[`true`,`false`,`undefined`],"aria-flowto":null,"aria-grabbed":[`true`,`false`,`undefined`],"aria-haspopup":aR,"aria-hidden":aR,"aria-invalid":[`true`,`false`,`grammar`,`spelling`],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":[`off`,`polite`,`assertive`],"aria-multiline":aR,"aria-multiselectable":aR,"aria-owns":null,"aria-posinset":null,"aria-pressed":[`true`,`false`,`mixed`,`undefined`],"aria-readonly":aR,"aria-relevant":null,"aria-required":aR,"aria-selected":[`true`,`false`,`undefined`],"aria-setsize":null,"aria-sort":[`ascending`,`descending`,`none`,`other`],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},cR=`beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload`.split(` `).map(e=>`on`+e);for(let e of cR)sR[e]=null;var lR=class{constructor(e,t){this.tags={...zge,...e},this.globalAttrs={...sR,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};lR.default=new lR;function uR(e,t,n=e.length){if(!t)return``;let r=t.firstChild,i=r&&r.getChild(`TagName`);return i?e.sliceString(i.from,Math.min(i.to,n)):``}function dR(e,t=!1){for(;e;e=e.parent)if(e.name==`Element`)if(t)t=!1;else return e;return null}function fR(e,t,n){return n.tags[uR(e,dR(t))]?.children||n.allTags}function pR(e,t){let n=[];for(let r=dR(t);r&&!r.type.isTop;r=dR(r.parent)){let i=uR(e,r);if(i&&r.lastChild.name==`CloseTag`)break;i&&n.indexOf(i)<0&&(t.name==`EndTag`||t.from>=r.firstChild.to)&&n.push(i)}return n}var mR=/^[:\-\.\w\u00b7-\uffff]*$/;function hR(e,t,n,r,i){let a=/\s*>/.test(e.sliceDoc(i,i+5))?``:`>`,o=dR(n,n.name==`StartTag`||n.name==`TagName`);return{from:r,to:i,options:fR(e.doc,o,t).map(e=>({label:e,type:`type`})).concat(pR(e.doc,n).map((e,t)=>({label:`/`+e,apply:`/`+e+a,type:`type`,boost:99-t}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function gR(e,t,n,r){let i=/\s*>/.test(e.sliceDoc(r,r+5))?``:`>`;return{from:n,to:r,options:pR(e.doc,t).map((e,t)=>({label:e,apply:e+i,type:`type`,boost:99-t})),validFor:mR}}function Bge(e,t,n,r){let i=[],a=0;for(let r of fR(e.doc,n,t))i.push({label:`<`+r,type:`type`});for(let t of pR(e.doc,n))i.push({label:`</`+t+`>`,type:`type`,boost:99-a++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Vge(e,t,n,r,i){let a=dR(n),o=a?t.tags[uR(e.doc,a)]:null,s=o&&o.attrs?Object.keys(o.attrs):[];return{from:r,to:i,options:(o&&o.globalAttrs===!1?s:s.length?s.concat(t.globalAttrNames):t.globalAttrNames).map(e=>({label:e,type:`property`})),validFor:mR}}function Hge(e,t,n,r,i){let a=n.parent?.getChild(`AttributeName`),o=[],s;if(a){let c=e.sliceDoc(a.from,a.to),l=t.globalAttrs[c];if(!l){let r=dR(n),i=r?t.tags[uR(e.doc,r)]:null;l=i?.attrs&&i.attrs[c]}if(l){let t=e.sliceDoc(r,i).toLowerCase(),n=`"`,a=`"`;/^['"]/.test(t)?(s=t[0]==`"`?/^[^"]*$/:/^[^']*$/,n=``,a=e.sliceDoc(i,i+1)==t[0]?``:t[0],t=t.slice(1),r++):s=/^[^\s<>='"]*$/;for(let e of l)o.push({label:e,apply:n+e+a,type:`constant`})}}return{from:r,to:i,options:o,validFor:s}}function _R(e,t){let{state:n,pos:r}=t,i=p(n).resolveInner(r,-1),a=i.resolve(r);for(let e=r,t;a==i&&(t=i.childBefore(e));){let n=t.lastChild;if(!n||!n.type.isError||n.from<n.to)break;a=i=t,e=n.from}return i.name==`TagName`?i.parent&&/CloseTag$/.test(i.parent.name)?gR(n,i,i.from,r):hR(n,e,i,i.from,r):i.name==`StartTag`||i.name==`IncompleteTag`?hR(n,e,i,r,r):i.name==`StartCloseTag`||i.name==`IncompleteCloseTag`?gR(n,i,r,r):i.name==`OpenTag`||i.name==`SelfClosingTag`||i.name==`AttributeName`?Vge(n,e,i,i.name==`AttributeName`?i.from:r,r):i.name==`Is`||i.name==`AttributeValue`||i.name==`UnquotedAttributeValue`?Hge(n,e,i,i.name==`Is`?r:i.from,r):t.explicit&&(a.name==`Element`||a.name==`Text`||a.name==`Document`)?Bge(n,e,i,r):null}function vR(e){return _R(lR.default,e)}function yR(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new lR(t,n):lR.default;return e=>_R(r,e)}var Uge=Ke.parser.configure({top:`SingleExpression`}),bR=[{tag:`script`,attrs:e=>e.type==`text/typescript`||e.lang==`ts`,parser:Ge.parser},{tag:`script`,attrs:e=>e.type==`text/babel`||e.type==`text/jsx`,parser:Ue.parser},{tag:`script`,attrs:e=>e.type==`text/typescript-jsx`,parser:He.parser},{tag:`script`,attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Uge},{tag:`script`,attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:Ke.parser},{tag:`style`,attrs(e){return(!e.lang||e.lang==`css`)&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:$L.parser}],xR=[{name:`style`,parser:$L.parser.configure({top:`Styles`})}].concat(cR.map(e=>({name:e,parser:Ke.parser}))),SR=Ae.define({name:`html`,parser:age.configure({props:[l.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,n;for(let n=e.node;;){let e=n.lastChild;if(!e||e.name!=`Element`||e.to!=n.to)break;t=n=e}return t&&!((n=t.lastChild)&&(n.name==`CloseTag`||n.name==`SelfClosingTag`))?e.lineIndent(t.from)+e.unit:null}}),s.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!=`OpenTag`?null:{from:t.to,to:n.name==`CloseTag`?n.from:e.to}}}),be.add({"OpenTag CloseTag":e=>e.getChild(`TagName`)})]}),languageData:{commentTokens:{block:{open:`<!--`,close:`-->`}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:`-_`}}),CR=SR.configure({wrap:PL(bR,xR)});function wR(e={}){let t=``,n;return e.matchClosingTags===!1&&(t=`noMatch`),e.selfClosingTags===!0&&(t=(t?t+` `:``)+`selfClosing`),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=PL((e.nestedLanguages||[]).concat(bR),(e.nestedAttributes||[]).concat(xR))),new Ne(n?SR.configure({wrap:n,dialect:t}):t?CR.configure({dialect:t}):CR,[CR.data.of({autocomplete:yR(e)}),e.autoCloseTags===!1?[]:ER,We().support,eR().support])}var TR=new Set(`area base br col command embed frame hr img input keygen link meta param source track wbr menuitem`.split(` `)),ER=I.inputHandler.of((e,t,n,r,i)=>{if(e.composing||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!CR.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let t=o.doc.sliceString(e.from-1,e.to)==r,{head:n}=e,i=p(o).resolveInner(n,-1),a;if(t&&r==`>`&&i.name==`EndTag`){let t=i.parent;if(t.parent?.lastChild?.name!=`CloseTag`&&(a=uR(o.doc,t.parent,n))&&!TR.has(a))return{range:e,changes:{from:n,to:n+(o.doc.sliceString(n,n+1)===`>`?1:0),insert:`</${a}>`}}}else if(t&&r==`/`&&i.name==`IncompleteCloseTag`){let e=i.parent;if(i.from==n-2&&e.lastChild?.name!=`CloseTag`&&(a=uR(o.doc,e,n))&&!TR.has(a)){let e=n+(o.doc.sliceString(n,n+1)===`>`?1:0),t=`${a}>`;return{range:le.cursor(n+t.length,-1),changes:{from:n,to:e,insert:t}}}}return{range:e}});return s.changes.empty?!1:(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),DR=te({commentTokens:{block:{open:`<!--`,close:`-->`}}}),OR=new ge,kR=che.configure({props:[s.add(e=>!e.is(`Block`)||e.is(`Document`)||AR(e)!=null||Wge(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),OR.add(AR),l.add({Document:()=>null}),he.add({Document:DR})]});function AR(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Wge(e){return e.name==`OrderedList`||e.name==`BulletList`}function Gge(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=AR(e.type))!=null&&r<=t)break;n=e}return n.to}var Kge=Le.of((e,t,n)=>{for(let r=p(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(OR);if(e==null)continue;let t=Gge(r,e);if(t>n)return{from:n,to:t}}return null});function jR(e){return new H(DR,e,[],`markdown`)}var MR=jR(kR),NR=jR(kR.configure([vhe,bhe,yhe,xhe,{props:[s.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));function qge(e,t){return n=>{if(n&&e){let t=null;if(n=/\S*/.exec(n)[0],t=typeof e==`function`?e(n):U.matchLanguageName(e,n,!0),t instanceof U)return t.support?t.support.language.parser:ae.getSkippingParser(t.load());if(t)return t.parser}return t?t.parser:null}}var PR=class{constructor(e,t,n,r,i,a,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let n=this.spaceBefore+(this.node.name==`Blockquote`?`>`:``);if(e!=null){for(;n.length<e;)n+=` `;return n}else{for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=` `;return n+(t?this.spaceAfter:``)}}marker(e,t){let n=this.node.name==`OrderedList`?String(+IR(this.item,e)[2]+t):``;return this.spaceBefore+n+this.type+this.spaceAfter}};function FR(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if(t.name==`FencedCode`)return r;(t.name==`ListItem`||t.name==`Blockquote`)&&n.push(t)}for(let e=n.length-1;e>=0;e--){let i=n[e],a,o=t.lineAt(i.from),s=i.from-o.from;if(i.name==`Blockquote`&&(a=/^ *>( ?)/.exec(o.text.slice(s))))r.push(new PR(i,s,s+a[0].length,``,a[1],`>`,null));else if(i.name==`ListItem`&&i.parent.name==`OrderedList`&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(s)))){let e=a[3],t=a[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new PR(i.parent,s,s+t,a[1],e,a[2],i))}else if(i.name==`ListItem`&&i.parent.name==`BulletList`&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))){let e=a[4],t=a[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=a[2];a[3]&&(n+=a[3].replace(/[xX]/,` `)),r.push(new PR(i.parent,s,s+t,a[1],e,n,i))}}return r}function IR(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function LR(e,t,n,r=0){for(let i=-1,a=e;;){if(a.name==`ListItem`){let e=IR(a,t),o=+e[2];if(i>=0){if(o!=i+1)return;n.push({from:a.from+e[1].length,to:a.from+e[0].length,insert:String(i+2+r)})}i=o}let e=a.nextSibling;if(!e)break;a=e}}function RR(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(i)!=` `)return e;let r=u(e,4,n),a=``;for(let e=r;e>0;)e>=4?(a+=` `,e-=4):(a+=` `,e--);return a+e.slice(n)}var zR=(e={})=>({state:t,dispatch:n})=>{let r=p(t),{doc:i}=t,a=null,o=t.changeByRange(n=>{if(!n.empty||!NR.isActiveAt(t,n.from,-1)&&!NR.isActiveAt(t,n.from,1))return a={range:n};let o=n.from,s=i.lineAt(o),c=FR(r.resolveInner(o,-1),i);for(;c.length&&c[c.length-1].from>o-s.from;)c.pop();if(!c.length)return a={range:n};let l=c[c.length-1];if(l.to-l.spaceAfter.length>o-s.from)return a={range:n};let d=o>=l.to-l.spaceAfter.length&&!/\S/.test(s.text.slice(l.to));if(l.item&&d){let n=l.node.firstChild,r=l.node.getChild(`ListItem`,`ListItem`);if(n.to>=o||r&&r.to<o||s.from>0&&!/[^\s>]/.test(i.lineAt(s.from-1).text)||e.nonTightLists===!1){let e=c.length>1?c[c.length-2]:null,t,n=``;e&&e.item?(t=s.from+e.from,n=e.marker(i,1)):t=s.from+(e?e.to:0);let r=[{from:t,to:o,insert:n}];return l.node.name==`OrderedList`&&LR(l.item,i,r,-2),e&&e.node.name==`OrderedList`&&LR(e.item,i,r),{range:le.cursor(t+n.length),changes:r}}else{let e=HR(c,t,s);return{range:le.cursor(o+e.length+1),changes:{from:s.from,insert:e+t.lineBreak}}}}if(l.node.name==`Blockquote`&&d&&s.from){let e=i.lineAt(s.from-1),r=/>\s*$/.exec(e.text);if(r&&r.index==l.from){let i=t.changes([{from:e.from+r.index,to:e.to},{from:s.from+l.from,to:s.to}]);return{range:n.map(i),changes:i}}}let f=[];l.node.name==`OrderedList`&&LR(l.item,i,f);let p=l.item&&l.item.from<s.from,m=``;if(!p||/^[\s\d.)\-+*>]*/.exec(s.text)[0].length>=l.to)for(let e=0,t=c.length-1;e<=t;e++)m+=e==t&&!p?c[e].marker(i,1):c[e].blank(e<t?u(s.text,4,c[e+1].from)-m.length:null);let h=o;for(;h>s.from&&/\s/.test(s.text.charAt(h-s.from-1));)h--;return m=RR(m,t),Jge(l.node,t.doc)&&(m=HR(c,t,s)+t.lineBreak+m),f.push({from:h,to:o,insert:t.lineBreak+m}),{range:le.cursor(h+m.length+1),changes:f}});return a?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:`input`})),!0)},BR=zR();function VR(e){return e.name==`QuoteMark`||e.name==`ListMark`}function Jge(e,t){if(e.name!=`OrderedList`&&e.name!=`BulletList`)return!1;let n=e.firstChild,r=e.getChild(`ListItem`,`ListItem`);if(!r)return!1;let i=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+(o?0:1)<a.number}function HR(e,t,n){let r=``;for(let t=0,i=e.length-2;t<=i;t++)r+=e[t].blank(t<i?u(n.text,4,e[t+1].from)-r.length:null,t<i);return RR(r,t)}function Yge(e,t){let n=e.resolveInner(t,-1),r=t;VR(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(VR(e))r=e.from;else if(e.name==`OrderedList`||e.name==`BulletList`)n=e.lastChild,r=n.to;else break;return n}var UR=({state:e,dispatch:t})=>{let n=p(e),r=null,i=e.changeByRange(t=>{let i=t.from,{doc:a}=e;if(t.empty&&NR.isActiveAt(e,t.from)){let t=a.lineAt(i),r=FR(Yge(n,i),a);if(r.length){let n=r[r.length-1],a=n.to-n.spaceAfter.length+(n.spaceAfter?1:0);if(i-t.from>a&&!/\S/.test(t.text.slice(a,i-t.from)))return{range:le.cursor(t.from+a),changes:{from:t.from+a,to:i}};if(i-t.from==a&&(!n.item||t.from<=n.item.from||!/\S/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let i=n.blank(u(t.text,4,n.to)-u(t.text,4,n.from));return r==t.from&&(i=RR(i,e)),{range:le.cursor(r+i.length),changes:{from:r,to:t.from+n.to,insert:i}}}if(r<i)return{range:le.cursor(r),changes:{from:r,to:i}}}}}return r={range:t}});return r?!1:(t(e.update(i,{scrollIntoView:!0,userEvent:`delete`})),!0)},WR=[{key:`Enter`,run:BR},{key:`Backspace`,run:UR}],GR=wR({matchClosingTags:!1});function KR(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:i=!0,base:{parser:a}=MR,completeHTMLTags:o=!0,pasteURLAsLink:s=!0,htmlTagLanguage:c=GR}=e;if(!(a instanceof kI))throw RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=e.extensions?[e.extensions]:[],u=[c.support,Kge],d;s&&u.push(XR),n instanceof Ne?(u.push(n.support),d=n.language):n&&(d=n);let f=t||d?qge(t,d):void 0;l.push(uhe({codeParser:f,htmlParser:c.language.parser})),i&&u.push(de.high(r.of(WR)));let p=jR(a.configure(l));return o&&u.push(p.data.of({autocomplete:Xge})),new Ne(p,u)}function Xge(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let i=p(t).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name==`CodeBlock`||i.name==`FencedCode`||i.name==`ProcessingInstructionBlock`||i.name==`CommentBlock`||i.name==`Link`||i.name==`Image`)return null;i=i.parent}return{from:n-r[0].length,to:n,options:JR(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}var qR=null;function JR(){if(qR)return qR;let e=vR(new Ze(Ee.create({extensions:GR}),0,!0));return qR=e?e.options:[]}var YR=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,XR=I.domEventHandlers({paste:(e,t)=>{let{main:n}=t.state.selection;if(n.empty)return!1;let r=e.clipboardData?.getData(`text/plain`);if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r=`https://`+r),!NR.isActiveAt(t.state,n.from,1)))return!1;let i=p(t.state),a=!1;return i.iterate({from:n.from,to:n.to,enter:e=>{(e.from>n.from||YR.test(e.name))&&(a=!0)},leave:e=>{e.to<n.to&&(a=!0)}}),a?!1:(t.dispatch({changes:[{from:n.from,insert:`[`},{from:n.to,insert:`](${r})`}],userEvent:`input.paste`,scrollIntoView:!0}),!0)}}),ZR=63,QR=64,$R=1,ez=2,tz=3,nz=4,rz=5,iz=6,az=7,oz=65,sz=66,cz=8,lz=9,uz=10,dz=11,fz=12,pz=13,mz=19,hz=20,gz=29,_z=33,vz=34,yz=47,bz=0,xz=1,Sz=2,Cz=3,wz=4,Tz=class{constructor(e,t,n){this.parent=e,this.depth=t,this.type=n,this.hash=(e?e.hash+e.hash<<8:0)+t+(t<<4)+n}};Tz.top=new Tz(null,-1,bz);function Ez(e,t){for(let n=0,r=t-e.pos-1;;r--,n++){let t=e.peek(r);if(Oz(t)||t==-1)return n}}function Dz(e){return e==32||e==9}function Oz(e){return e==10||e==13}function kz(e){return Dz(e)||Oz(e)}function Az(e){return e<0||kz(e)}var jz=new Me({start:Tz.top,reduce(e,t){return e.type==Cz&&(t==hz||t==vz)?e.parent:e},shift(e,t,n,r){if(t==tz)return new Tz(e,Ez(r,r.pos),xz);if(t==oz||t==rz)return new Tz(e,Ez(r,r.pos),Sz);if(t==ZR)return e.parent;if(t==mz||t==_z)return new Tz(e,0,Cz);if(t==pz&&e.type==wz)return e.parent;if(t==yz){let t=/[1-9]/.exec(r.read(r.pos,n.pos));if(t)return new Tz(e,e.depth+ +t[0],wz)}return e},hash(e){return e.hash}});function Mz(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&Az(e.peek(n+3))}var Nz=new Se((e,t)=>{if(e.next==-1&&t.canShift(QR))return e.acceptToken(QR);let n=e.peek(-1);if((Oz(n)||n<0)&&t.context.type!=Cz){if(Mz(e,45))if(t.canShift(ZR))e.acceptToken(ZR);else return e.acceptToken($R,3);if(Mz(e,46))if(t.canShift(ZR))e.acceptToken(ZR);else return e.acceptToken(ez,3);let n=0;for(;e.next==32;)n++,e.advance();(n<t.context.depth||n==t.context.depth&&t.context.type==xz&&(e.next!=45||!Az(e.peek(1))))&&e.next!=-1&&!Oz(e.next)&&e.next!=35&&e.acceptToken(ZR,-n)}},{contextual:!0}),Pz=new Se((e,t)=>{if(t.context.type==Cz){e.next==63&&(e.advance(),Az(e.next)&&e.acceptToken(az));return}if(e.next==45)e.advance(),Az(e.next)&&e.acceptToken(t.context.type==xz&&t.context.depth==Ez(e,e.pos-1)?nz:tz);else if(e.next==63)e.advance(),Az(e.next)&&e.acceptToken(t.context.type==Sz&&t.context.depth==Ez(e,e.pos-1)?iz:rz);else{let n=e.pos;for(;;)if(Dz(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)Rz(e);else if(e.next==38)zz(e);else if(e.next==42){zz(e);break}else if(e.next==39||e.next==34){if(Bz(e,!0))break;return}else if(e.next==91||e.next==123){if(!Vz(e))return;break}else{Gz(e,!0,!1,0);break}for(;Dz(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(gz))return;Az(e.peek(1))&&e.acceptTokenTo(t.context.type==Sz&&t.context.depth==Ez(e,n)?sz:oz,n)}}},{contextual:!0});function Fz(e){return e>32&&e<127&&e!=34&&e!=37&&e!=44&&e!=60&&e!=62&&e!=92&&e!=94&&e!=96&&e!=123&&e!=124&&e!=125}function Iz(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function Lz(e,t){return e.next==37?(e.advance(),Iz(e.next)&&e.advance(),Iz(e.next)&&e.advance(),!0):Fz(e.next)||t&&e.next==44?(e.advance(),!0):!1}function Rz(e){if(e.advance(),e.next==60){for(e.advance();;)if(!Lz(e,!0)){e.next==62&&e.advance();break}}else for(;Lz(e,!1););}function zz(e){for(e.advance();!Az(e.next)&&Uz(e.tag)!=`f`;)e.advance()}function Bz(e,t){let n=e.next,r=!1,i=e.pos;for(e.advance();;){let a=e.next;if(a<0)break;if(e.advance(),a==n)if(a==39)if(e.next==39)e.advance();else break;else break;else if(a==92&&n==34)e.next>=0&&e.advance();else if(Oz(a)){if(t)return!1;r=!0}else if(t&&e.pos>=i+1024)return!1}return!r}function Vz(e){for(let t=[],n=e.pos+1024;;)if(e.next==91||e.next==123)t.push(e.next),e.advance();else if(e.next==39||e.next==34){if(!Bz(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else if(e.next<0||e.pos>n||Oz(e.next))return!1;else e.advance()}var Hz=`iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif`;function Uz(e){return e<33?`u`:e>125?`s`:Hz[e-33]}function Wz(e,t){let n=Uz(e);return n!=`u`&&!(t&&n==`f`)}function Gz(e,t,n,r){if(Uz(e.next)==`s`||(e.next==63||e.next==58||e.next==45)&&Wz(e.peek(1),n))e.advance();else return!1;let i=e.pos;for(;;){let a=e.next,o=0,s=r+1;for(;kz(a);){if(Oz(a)){if(t)return!1;s=0}else s++;a=e.peek(++o)}if(!(a>=0&&(a==58?Wz(e.peek(o+1),n):a==35?e.peek(o-1)!=32:Wz(a,n)))||!n&&s<=r||s==0&&!n&&(Mz(e,45,o)||Mz(e,46,o)))break;if(t&&Uz(a)==`f`)return!1;for(let t=o;t>=0;t--)e.advance();if(t&&e.pos>i+1024)return!1}return!0}var Kz=new Se((e,t)=>{if(e.next==33)Rz(e),e.acceptToken(fz);else if(e.next==38||e.next==42){let t=e.next==38?uz:dz;zz(e),e.acceptToken(t)}else e.next==39||e.next==34?(Bz(e,!1),e.acceptToken(lz)):Gz(e,!1,t.context.type==Cz,t.context.depth)&&e.acceptToken(cz)}),qz=new Se((e,t)=>{let n=t.context.type==wz?t.context.depth:-1,r=e.pos;scan:for(;;){let i=0,a=e.next;for(;a==32;)a=e.peek(++i);if(!i&&(Mz(e,45,i)||Mz(e,46,i))||!Oz(a)&&(n<0&&(n=Math.max(t.context.depth+1,i)),i<n))break;for(;;){if(e.next<0)break scan;let t=Oz(e.next);if(e.advance(),t)continue scan;r=e.pos}}e.acceptTokenTo(pz,r)}),Jz=b({DirectiveName:A.keyword,DirectiveContent:A.attributeValue,"DirectiveEnd DocEnd":A.meta,QuotedLiteral:A.string,BlockLiteralHeader:A.special(A.string),BlockLiteralContent:A.content,Literal:A.content,"Key/Literal Key/QuotedLiteral":A.definition(A.propertyName),"Anchor Alias":A.labelName,Tag:A.typeName,Comment:A.lineComment,": , -":A.separator,"?":A.punctuation,"[ ]":A.squareBracket,"{ }":A.brace}),Yz=Oe.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:`⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document`,maxTerm:74,context:jz,nodeProps:[[`isolate`,-3,8,9,14,``],[`openedBy`,18,`[`,32,`{`],[`closedBy`,19,`]`,33,`}`]],propSources:[Jz],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[Nz,Pz,Kz,qz,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),Xz=Oe.deserialize({version:14,states:"!vOQOPOOO]OPO'#C_OhOPO'#C^OOOO'#Cc'#CcOpOPO'#CaQOOOOOO{OPOOOOOO'#Cb'#CbO!WOPO'#C`O!`OPO,58xOOOO-E6a-E6aOOOO-E6`-E6`OOOO'#C_'#C_OOOO1G.d1G.d",stateData:`!h~OXPOYROWTP~OWVXXRXYRX~OYVOXSP~OXROYROWTX~OXROYROWTP~OYVOXSX~OX[O~OXY~`,goto:`vWPPX[beioRUOQQOR]XRXQTTOUQWQRZWSSOURYS`,nodeNames:`⚠ Document Frontmatter DashLine FrontmatterContent Body`,maxTerm:10,skippedNodes:[0],repeatNodeCount:2,tokenData:"$z~RXOYnYZ!^Z]n]^!^^}n}!O!i!O;'Sn;'S;=`!c<%lOn~qXOYnYZ!^Z]n]^!^^;'Sn;'S;=`!c<%l~n~On~~!^~!cOY~~!fP;=`<%ln~!lZOYnYZ!^Z]n]^!^^}n}!O#_!O;'Sn;'S;=`!c<%l~n~On~~!^~#bZOYnYZ!^Z]n]^!^^}n}!O$T!O;'Sn;'S;=`!c<%l~n~On~~!^~$WXOYnYZ$sZ]n]^$s^;'Sn;'S;=`!c<%l~n~On~~$s~$zOX~Y~",tokenizers:[0],topRules:{Document:[0,1]},tokenPrec:67}),Zz=Ae.define({name:`yaml`,parser:Yz.configure({props:[l.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name==`BlockLiteralContent`&&t.from<t.to)return e.baseIndentFor(t);if(t.name==`BlockLiteral`)return e.baseIndentFor(t)+e.unit;if(t.name==`BlockSequence`||t.name==`BlockMapping`)return e.column(t.from,1);if(t.name==`QuotedLiteral`)return null;if(t.name==`Literal`){let n=e.column(t.from,1);if(n==e.lineIndent(t.from,1))return n;if(t.to>e.pos)return null}}return null},FlowMapping:Fe({closing:`}`}),FlowSequence:Fe({closing:`]`})}),s.add({"FlowMapping FlowSequence":ze,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:`#`},indentOnInput:/^\s*[\]\}]$/}});function Qz(){return new Ne(Zz)}Ae.define({name:`yaml-frontmatter`,parser:Xz.configure({props:[b({DashLine:A.meta})]})});function X(e){return new Ne(ce.define(e))}function $z(e){return q(()=>import(`./dist-DVFW0GyF.js`).then(t=>t.sql({dialect:t[e]})),__vite__mapDeps([98,99,100]))}var eB=[U.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return q(()=>import(`./dist-DltQmFDE.js`).then(e=>e.cpp()),__vite__mapDeps([101,100]))}}),U.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return q(()=>import(`./dist-DltQmFDE.js`).then(e=>e.cpp()),__vite__mapDeps([101,100]))}}),U.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return $z(`Cassandra`)}}),U.of({name:`CSS`,extensions:[`css`],load(){return q(()=>import(`./dist-BkDkNU9b.js`).then(e=>e.css()),__vite__mapDeps([102,100]))}}),U.of({name:`Go`,extensions:[`go`],load(){return q(()=>import(`./dist-CLKxKEQH.js`).then(e=>e.go()),__vite__mapDeps([103,99,100]))}}),U.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return q(()=>import(`./dist-CGXgRYaV.js`).then(e=>e.html()),__vite__mapDeps([104,105,1,99,100]))}}),U.of({name:`Java`,extensions:[`java`],load(){return q(()=>import(`./dist-BiexWhMB.js`).then(e=>e.java()),__vite__mapDeps([106,100]))}}),U.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return q(()=>import(`./dist--FTL3P_Y.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([105,1,99,100]))}}),U.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return q(()=>import(`./dist-om9Y_fPQ.js`).then(e=>e.jinja()),__vite__mapDeps([107,105,1,99,100]))}}),U.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return q(()=>import(`./dist-CEKX9a9U.js`).then(e=>e.json()),__vite__mapDeps([108,100]))}}),U.of({name:`JSX`,extensions:[`jsx`],load(){return q(()=>import(`./dist--FTL3P_Y.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([105,1,99,100]))}}),U.of({name:`LESS`,extensions:[`less`],load(){return q(()=>import(`./dist-gAWuPgK4.js`).then(e=>e.less()),__vite__mapDeps([109,100]))}}),U.of({name:`Liquid`,extensions:[`liquid`],load(){return q(()=>import(`./dist-DkDWFWp_.js`).then(e=>e.liquid()),__vite__mapDeps([110,105,1,99,100]))}}),U.of({name:`MariaDB SQL`,load(){return $z(`MariaSQL`)}}),U.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return q(()=>import(`./dist-CIsUmA-3.js`).then(e=>e.markdown()),__vite__mapDeps([111,105,1,99,100]))}}),U.of({name:`MS SQL`,load(){return $z(`MSSQL`)}}),U.of({name:`MySQL`,load(){return $z(`MySQL`)}}),U.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return q(()=>import(`./dist-BuC62uCX.js`).then(e=>e.php()),__vite__mapDeps([112,105,1,99,100]))}}),U.of({name:`PLSQL`,extensions:[`pls`],load(){return $z(`PLSQL`)}}),U.of({name:`PostgreSQL`,load(){return $z(`PostgreSQL`)}}),U.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return q(()=>import(`./dist-ExQdmG6u.js`).then(e=>e.python()),__vite__mapDeps([113,99,100]))}}),U.of({name:`Rust`,extensions:[`rs`],load(){return q(()=>import(`./dist-BNF0fuPB.js`).then(e=>e.rust()),__vite__mapDeps([114,100]))}}),U.of({name:`Sass`,extensions:[`sass`],load(){return q(()=>import(`./dist-BwrSUFdo.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([115,100]))}}),U.of({name:`SCSS`,extensions:[`scss`],load(){return q(()=>import(`./dist-BwrSUFdo.js`).then(e=>e.sass()),__vite__mapDeps([115,100]))}}),U.of({name:`SQL`,extensions:[`sql`],load(){return $z(`StandardSQL`)}}),U.of({name:`SQLite`,load(){return $z(`SQLite`)}}),U.of({name:`TSX`,extensions:[`tsx`],load(){return q(()=>import(`./dist--FTL3P_Y.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([105,1,99,100]))}}),U.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return q(()=>import(`./dist--FTL3P_Y.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([105,1,99,100]))}}),U.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return q(()=>import(`./dist-CRs-U2qz.js`).then(e=>e.wast()),__vite__mapDeps([116,100]))}}),U.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return q(()=>import(`./dist-CbIYKZT0.js`).then(e=>e.xml()),__vite__mapDeps([117,100]))}}),U.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return q(()=>import(`./dist-DV_IQhBV.js`).then(e=>e.yaml()),__vite__mapDeps([118,100]))}}),U.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return q(()=>import(`./apl-CJPt5sW7.js`).then(e=>X(e.apl)),[])}}),U.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return q(()=>import(`./asciiarmor-D0oCypDs.js`).then(e=>X(e.asciiArmor)),[])}}),U.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return q(()=>import(`./asn1-8xgVfRoq.js`).then(e=>X(e.asn1({}))),[])}}),U.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return q(()=>import(`./asterisk-B5kv5AQp.js`).then(e=>X(e.asterisk)),[])}}),U.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return q(()=>import(`./brainfuck-Dh7M1Ucz.js`).then(e=>X(e.brainfuck)),[])}}),U.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return q(()=>import(`./cobol-D3WLbLVy.js`).then(e=>X(e.cobol)),[])}}),U.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return q(()=>import(`./clike-zYz_LEkw.js`).then(e=>X(e.csharp)),[])}}),U.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return q(()=>import(`./clojure-CdWlIeQh.js`).then(e=>X(e.clojure)),[])}}),U.of({name:`ClojureScript`,extensions:[`cljs`],load(){return q(()=>import(`./clojure-CdWlIeQh.js`).then(e=>X(e.clojure)),[])}}),U.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return q(()=>import(`./css-_6KgQwpu.js`).then(e=>X(e.gss)),[])}}),U.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return q(()=>import(`./cmake-wWuF5ifR.js`).then(e=>X(e.cmake)),[])}}),U.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return q(()=>import(`./coffeescript-DRtt-5a2.js`).then(e=>X(e.coffeeScript)),[])}}),U.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return q(()=>import(`./commonlisp-DJV75lsU.js`).then(e=>X(e.commonLisp)),[])}}),U.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return q(()=>import(`./cypher-B3uWx7jm.js`).then(e=>X(e.cypher)),[])}}),U.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return q(()=>import(`./python-2pwcWoy7.js`).then(e=>X(e.cython)),[])}}),U.of({name:`Crystal`,extensions:[`cr`],load(){return q(()=>import(`./crystal-C7mEw92C.js`).then(e=>X(e.crystal)),[])}}),U.of({name:`D`,extensions:[`d`],load(){return q(()=>import(`./d-D3kOh3JF.js`).then(e=>X(e.d)),[])}}),U.of({name:`Dart`,extensions:[`dart`],load(){return q(()=>import(`./clike-zYz_LEkw.js`).then(e=>X(e.dart)),[])}}),U.of({name:`diff`,extensions:[`diff`,`patch`],load(){return q(()=>import(`./diff-CoamybWh.js`).then(e=>X(e.diff)),[])}}),U.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return q(()=>import(`./dockerfile-Ci0-ApQC.js`).then(e=>X(e.dockerFile)),__vite__mapDeps([119,120]))}}),U.of({name:`DTD`,extensions:[`dtd`],load(){return q(()=>import(`./dtd-BjGQwMWL.js`).then(e=>X(e.dtd)),[])}}),U.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return q(()=>import(`./dylan-B9W3X2GI.js`).then(e=>X(e.dylan)),[])}}),U.of({name:`EBNF`,load(){return q(()=>import(`./ebnf-d5D0otVn.js`).then(e=>X(e.ebnf)),[])}}),U.of({name:`ECL`,extensions:[`ecl`],load(){return q(()=>import(`./ecl-C5Q_IBPt.js`).then(e=>X(e.ecl)),[])}}),U.of({name:`edn`,extensions:[`edn`],load(){return q(()=>import(`./clojure-CdWlIeQh.js`).then(e=>X(e.clojure)),[])}}),U.of({name:`Eiffel`,extensions:[`e`],load(){return q(()=>import(`./eiffel-BQA_6I3b.js`).then(e=>X(e.eiffel)),[])}}),U.of({name:`Elm`,extensions:[`elm`],load(){return q(()=>import(`./elm-unPS17vB.js`).then(e=>X(e.elm)),[])}}),U.of({name:`Erlang`,extensions:[`erl`],load(){return q(()=>import(`./erlang-R8nOsUTx.js`).then(e=>X(e.erlang)),[])}}),U.of({name:`Esper`,load(){return q(()=>import(`./sql-CwA10oIk.js`).then(e=>X(e.esper)),[])}}),U.of({name:`Factor`,extensions:[`factor`],load(){return q(()=>import(`./factor-DMvifS-k.js`).then(e=>X(e.factor)),__vite__mapDeps([121,120]))}}),U.of({name:`FCL`,load(){return q(()=>import(`./fcl-CVAfW9wK.js`).then(e=>X(e.fcl)),[])}}),U.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return q(()=>import(`./forth-DHbsK8X8.js`).then(e=>X(e.forth)),[])}}),U.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return q(()=>import(`./fortran-4jMwxW9-.js`).then(e=>X(e.fortran)),[])}}),U.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return q(()=>import(`./mllike-iZXopbca.js`).then(e=>X(e.fSharp)),[])}}),U.of({name:`Gas`,extensions:[`s`],load(){return q(()=>import(`./gas-zC_XGrQT.js`).then(e=>X(e.gas)),[])}}),U.of({name:`Gherkin`,extensions:[`feature`],load(){return q(()=>import(`./gherkin-CPBQou3u.js`).then(e=>X(e.gherkin)),[])}}),U.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return q(()=>import(`./groovy-Cqopym0q.js`).then(e=>X(e.groovy)),[])}}),U.of({name:`Haskell`,extensions:[`hs`],load(){return q(()=>import(`./haskell-imzbNPgF.js`).then(e=>X(e.haskell)),[])}}),U.of({name:`Haxe`,extensions:[`hx`],load(){return q(()=>import(`./haxe-Doh225Ku.js`).then(e=>X(e.haxe)),[])}}),U.of({name:`HXML`,extensions:[`hxml`],load(){return q(()=>import(`./haxe-Doh225Ku.js`).then(e=>X(e.hxml)),[])}}),U.of({name:`HTTP`,load(){return q(()=>import(`./http-j4R5uEso.js`).then(e=>X(e.http)),[])}}),U.of({name:`IDL`,extensions:[`pro`],load(){return q(()=>import(`./idl-l9d1__Hj.js`).then(e=>X(e.idl)),[])}}),U.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return q(()=>import(`./javascript-BcqCeS4O.js`).then(e=>X(e.jsonld)),[])}}),U.of({name:`Julia`,extensions:[`jl`],load(){return q(()=>import(`./julia-BU0qBb1w.js`).then(e=>X(e.julia)),[])}}),U.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return q(()=>import(`./clike-zYz_LEkw.js`).then(e=>X(e.kotlin)),[])}}),U.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return q(()=>import(`./livescript-uk34VDGK.js`).then(e=>X(e.liveScript)),[])}}),U.of({name:`Lua`,extensions:[`lua`],load(){return q(()=>import(`./lua-ClQGOv84.js`).then(e=>X(e.lua)),[])}}),U.of({name:`mIRC`,extensions:[`mrc`],load(){return q(()=>import(`./mirc-DRRKKkcJ.js`).then(e=>X(e.mirc)),[])}}),U.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return q(()=>import(`./mathematica-BDmKpvRN.js`).then(e=>X(e.mathematica)),[])}}),U.of({name:`Modelica`,extensions:[`mo`],load(){return q(()=>import(`./modelica-DP8T2DKM.js`).then(e=>X(e.modelica)),[])}}),U.of({name:`MUMPS`,extensions:[`mps`],load(){return q(()=>import(`./mumps-BKUS05-y.js`).then(e=>X(e.mumps)),[])}}),U.of({name:`Mbox`,extensions:[`mbox`],load(){return q(()=>import(`./mbox-T5kA6jAQ.js`).then(e=>X(e.mbox)),[])}}),U.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return q(()=>import(`./nginx-CzYOtr2G.js`).then(e=>X(e.nginx)),[])}}),U.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return q(()=>import(`./nsis-BbRIeGvl.js`).then(e=>X(e.nsis)),__vite__mapDeps([122,120]))}}),U.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return q(()=>import(`./ntriples-ZgZuaYbW.js`).then(e=>X(e.ntriples)),[])}}),U.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return q(()=>import(`./clike-zYz_LEkw.js`).then(e=>X(e.objectiveC)),[])}}),U.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return q(()=>import(`./clike-zYz_LEkw.js`).then(e=>X(e.objectiveCpp)),[])}}),U.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return q(()=>import(`./mllike-iZXopbca.js`).then(e=>X(e.oCaml)),[])}}),U.of({name:`Octave`,extensions:[`m`],load(){return q(()=>import(`./octave-CnOndUN3.js`).then(e=>X(e.octave)),[])}}),U.of({name:`Oz`,extensions:[`oz`],load(){return q(()=>import(`./oz-DjW322Rn.js`).then(e=>X(e.oz)),[])}}),U.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return q(()=>import(`./pascal-BdeW5uRX.js`).then(e=>X(e.pascal)),[])}}),U.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return q(()=>import(`./perl-_CDvIe1D.js`).then(e=>X(e.perl)),[])}}),U.of({name:`Pig`,extensions:[`pig`],load(){return q(()=>import(`./pig-inWo_B4W.js`).then(e=>X(e.pig)),[])}}),U.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return q(()=>import(`./powershell-CO5KWJsy.js`).then(e=>X(e.powerShell)),[])}}),U.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return q(()=>import(`./properties-CjVp4a6M.js`).then(e=>X(e.properties)),[])}}),U.of({name:`ProtoBuf`,extensions:[`proto`],load(){return q(()=>import(`./protobuf-DybFT2KT.js`).then(e=>X(e.protobuf)),[])}}),U.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return q(()=>import(`./pug-D1ZtszdL.js`).then(e=>X(e.pug)),__vite__mapDeps([123,124]))}}),U.of({name:`Puppet`,extensions:[`pp`],load(){return q(()=>import(`./puppet-Dw_NDgko.js`).then(e=>X(e.puppet)),[])}}),U.of({name:`Q`,extensions:[`q`],load(){return q(()=>import(`./q-C47l8kdS.js`).then(e=>X(e.q)),[])}}),U.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return q(()=>import(`./r-BmcXGVZ5.js`).then(e=>X(e.r)),[])}}),U.of({name:`RPM Changes`,load(){return q(()=>import(`./rpm-Cm0x5xT_.js`).then(e=>X(e.rpmChanges)),[])}}),U.of({name:`RPM Spec`,extensions:[`spec`],load(){return q(()=>import(`./rpm-Cm0x5xT_.js`).then(e=>X(e.rpmSpec)),[])}}),U.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return q(()=>import(`./ruby-Dl-I4pxG.js`).then(e=>X(e.ruby)),[])}}),U.of({name:`SAS`,extensions:[`sas`],load(){return q(()=>import(`./sas-Bxkg4GVX.js`).then(e=>X(e.sas)),[])}}),U.of({name:`Scala`,extensions:[`scala`],load(){return q(()=>import(`./clike-zYz_LEkw.js`).then(e=>X(e.scala)),[])}}),U.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return q(()=>import(`./scheme-CO3zogua.js`).then(e=>X(e.scheme)),[])}}),U.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return q(()=>import(`./shell-gYrTvBTP.js`).then(e=>X(e.shell)),[])}}),U.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return q(()=>import(`./sieve-COX4Kn1X.js`).then(e=>X(e.sieve)),[])}}),U.of({name:`Smalltalk`,extensions:[`st`],load(){return q(()=>import(`./smalltalk-Dma1z5eE.js`).then(e=>X(e.smalltalk)),[])}}),U.of({name:`Solr`,load(){return q(()=>import(`./solr-BvhcdkNH.js`).then(e=>X(e.solr)),[])}}),U.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return q(()=>import(`./mllike-iZXopbca.js`).then(e=>X(e.sml)),[])}}),U.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return q(()=>import(`./sparql-gX7W9xeh.js`).then(e=>X(e.sparql)),[])}}),U.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return q(()=>import(`./spreadsheet-BnlQRxWz.js`).then(e=>X(e.spreadsheet)),[])}}),U.of({name:`Squirrel`,extensions:[`nut`],load(){return q(()=>import(`./clike-zYz_LEkw.js`).then(e=>X(e.squirrel)),[])}}),U.of({name:`Stylus`,extensions:[`styl`],load(){return q(()=>import(`./stylus-9ZGSp3KB.js`).then(e=>X(e.stylus)),[])}}),U.of({name:`Swift`,extensions:[`swift`],load(){return q(()=>import(`./swift-CurfpLXH.js`).then(e=>X(e.swift)),[])}}),U.of({name:`sTeX`,load(){return q(()=>import(`./stex-DhLUylSV.js`).then(e=>X(e.stex)),[])}}),U.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return q(()=>import(`./stex-DhLUylSV.js`).then(e=>X(e.stex)),[])}}),U.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return q(()=>import(`./verilog-BFxB5RAN.js`).then(e=>X(e.verilog)),[])}}),U.of({name:`Tcl`,extensions:[`tcl`],load(){return q(()=>import(`./tcl-BPvzXR-t.js`).then(e=>X(e.tcl)),[])}}),U.of({name:`Textile`,extensions:[`textile`],load(){return q(()=>import(`./textile-BUq3vgBH.js`).then(e=>X(e.textile)),[])}}),U.of({name:`TiddlyWiki`,load(){return q(()=>import(`./tiddlywiki-DRR6E4hS.js`).then(e=>X(e.tiddlyWiki)),[])}}),U.of({name:`Tiki wiki`,load(){return q(()=>import(`./tiki-C1XMixgx.js`).then(e=>X(e.tiki)),[])}}),U.of({name:`TOML`,extensions:[`toml`],load(){return q(()=>import(`./toml-BQjoWSzq.js`).then(e=>X(e.toml)),[])}}),U.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return q(()=>import(`./troff-DbgTp3Cj.js`).then(e=>X(e.troff)),[])}}),U.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return q(()=>import(`./ttcn-1OxchGWH.js`).then(e=>X(e.ttcn)),[])}}),U.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return q(()=>import(`./ttcn-cfg-CC8OhyHu.js`).then(e=>X(e.ttcnCfg)),[])}}),U.of({name:`Turtle`,extensions:[`ttl`],load(){return q(()=>import(`./turtle-D1WjVU4-.js`).then(e=>X(e.turtle)),[])}}),U.of({name:`Web IDL`,extensions:[`webidl`],load(){return q(()=>import(`./webidl-advQMGTP.js`).then(e=>X(e.webIDL)),[])}}),U.of({name:`VB.NET`,extensions:[`vb`],load(){return q(()=>import(`./vb-Bf-XXYNJ.js`).then(e=>X(e.vb)),[])}}),U.of({name:`VBScript`,extensions:[`vbs`],load(){return q(()=>import(`./vbscript-HeSyWuOi.js`).then(e=>X(e.vbScript)),[])}}),U.of({name:`Velocity`,extensions:[`vtl`],load(){return q(()=>import(`./velocity-CUkiDsJQ.js`).then(e=>X(e.velocity)),[])}}),U.of({name:`Verilog`,extensions:[`v`],load(){return q(()=>import(`./verilog-BFxB5RAN.js`).then(e=>X(e.verilog)),[])}}),U.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return q(()=>import(`./vhdl-BJUXQE-6.js`).then(e=>X(e.vhdl)),[])}}),U.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return q(()=>import(`./xquery-CNzoFgd7.js`).then(e=>X(e.xQuery)),[])}}),U.of({name:`Yacas`,extensions:[`ys`],load(){return q(()=>import(`./yacas-BsmlDKac.js`).then(e=>X(e.yacas)),[])}}),U.of({name:`Z80`,extensions:[`z80`],load(){return q(()=>import(`./z80-Bnez4vZ_.js`).then(e=>X(e.z80)),[])}}),U.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return q(()=>import(`./mscgen-DXIRw2qg.js`).then(e=>X(e.mscgen)),[])}}),U.of({name:`Xù`,extensions:[`xu`],load(){return q(()=>import(`./mscgen-DXIRw2qg.js`).then(e=>X(e.xu)),[])}}),U.of({name:`MsGenny`,extensions:[`msgenny`],load(){return q(()=>import(`./mscgen-DXIRw2qg.js`).then(e=>X(e.msgenny)),[])}}),U.of({name:`Vue`,extensions:[`vue`],load(){return q(()=>import(`./dist-BnyqJBh5.js`).then(e=>e.vue()),__vite__mapDeps([125,105,1,99,100]))}}),U.of({name:`Angular Template`,load(){return q(()=>import(`./dist-ByPvaULS.js`).then(e=>e.angular()),__vite__mapDeps([126,105,1,99,100]))}})],tB={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},nB={borderLeftWidth:`2px`},rB={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},iB={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},aB={border:`none`,borderRadius:`4px`,padding:`2px 10px`},oB={borderRadius:`2px`},sB={borderRadius:`2px`},cB={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},lB={width:`12px`,height:`12px`,borderRadius:`6px`},uB={borderRadius:`4px`,padding:`2px 6px`},dB={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},fB=`#0d1117`,pB=`#c9d1d9`,mB=`#264F78`,hB=`#8b949e`,gB=`#ffffff`,_B=`#7ee787`,vB=`#d2a8ff`,yB=`#79c0ff`,bB=`#ff7b72`,xB=`#a5d6ff`,SB=`#2c333a`,CB=`#3c444d`,wB=`#ffab70`,TB=`#161b22`,EB=`#30363d`,DB=`#21262d`,OB=`#f97583`,kB=`#2d333b1a`,AB=`#21262d`,jB=gB,MB=mB,NB=`#3a587a75`,PB=`#4d90fe`,FB=`#d29922`,IB=`#3a587a55`,LB=`#58a6ff`,RB=`#bc8cff`,zB=`#2ea04350`,BB=`#f8514940`,VB=`#7ee787`,HB=`#ff7b72`,UB=[I.theme({"&":{color:pB,backgroundColor:fB,fontSize:tB.fontSize,fontFamily:tB.fontFamily},".cm-content":{caretColor:jB,lineHeight:tB.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:jB,borderLeftWidth:nB.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${jB}99`,color:fB},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:MB},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#3a587a`,outline:`1px solid ${yB}`,color:pB,borderRadius:uB.borderRadius,"& span":{color:pB}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:PB,color:gB,padding:uB.padding,"& span":{color:gB}},".cm-search.cm-panel.cm-textfield":{color:pB,borderRadius:uB.borderRadius,padding:uB.padding},".cm-panels":{backgroundColor:AB,color:pB,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${EB}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${EB}`},".cm-panel button":{backgroundColor:AB,color:pB,border:aB.border,borderRadius:aB.borderRadius,padding:aB.padding},".cm-panel button:hover":{backgroundColor:SB},".cm-activeLine":{backgroundColor:kB,borderRadius:oB.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:TB,color:hB,border:iB.border,borderRight:`1px solid #30363d`,paddingRight:iB.paddingRight},".cm-activeLineGutter":{backgroundColor:DB,color:pB,fontWeight:iB.fontWeight},".cm-lineNumbers":{fontSize:iB.fontSize,lineHeight:iB.lineHeight},".cm-foldGutter":{fontSize:iB.fontSize,lineHeight:iB.lineHeight},".cm-foldGutter .cm-gutterElement":{color:hB,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:pB},".cm-insertedLine":{textDecoration:rB.insertedTextDecoration,backgroundColor:zB,color:VB,padding:rB.insertedLinePadding,borderRadius:rB.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:rB.insertedTextDecoration,backgroundColor:`${zB} !important`,color:VB,padding:rB.insertedLinePadding,borderRadius:rB.borderRadious,border:`1px solid ${VB}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:rB.deletedTextDecoration,backgroundColor:BB,color:HB,padding:rB.insertedLinePadding,borderRadius:rB.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:rB.deletedTextDecoration,backgroundColor:`${BB} !important`,color:HB,padding:rB.insertedLinePadding,borderRadius:rB.borderRadious,border:`1px solid ${HB}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:AB,border:`1px solid ${EB}`,borderRadius:dB.borderRadius,padding:dB.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:AB,border:`none`},"& > ul > li":{padding:dB.padding,lineHeight:dB.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:MB,color:gB,borderRadius:dB.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:hB,paddingRight:dB.paddingRight},"& > ul > li > span.cm-completionDetail":{color:hB,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:AB,borderBottomColor:AB},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${OB}`},"&-warning":{borderLeft:`3px solid ${FB}`},"&-info":{borderLeft:`3px solid ${LB}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${OB}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${FB}`},".cm-matchingBracket":{backgroundColor:NB,outline:`1px solid ${PB}`,borderRadius:sB.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#f9758340`,outline:`1px solid ${OB}`,borderRadius:sB.borderRadius},".cm-selectionMatch":{backgroundColor:IB,outline:`1px solid ${mB}50`,borderRadius:sB.borderRadius},".cm-foldPlaceholder":{backgroundColor:AB,color:hB,border:`1px dotted ${EB}70`,borderRadius:cB.borderRadius,padding:cB.padding,margin:cB.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${fB}, 0 0 0 3px ${LB}40`},"& .cm-scroller::-webkit-scrollbar":{width:lB.width,height:lB.height},"& .cm-scroller::-webkit-scrollbar-track":{background:TB},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:EB,borderRadius:lB.borderRadius,border:`3px solid ${TB}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:CB},".cm-ghostText":{opacity:`0.5`,color:hB}},{dark:!0}),D(B.define([{tag:A.keyword,color:bB,fontWeight:`bold`},{tag:A.controlKeyword,color:bB,fontWeight:`bold`},{tag:A.moduleKeyword,color:bB,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:yB},{tag:[A.variableName],color:yB},{tag:[A.propertyName],color:vB,fontStyle:`normal`},{tag:[A.typeName],color:bB},{tag:[A.className],color:vB,fontStyle:`italic`},{tag:[A.namespace],color:yB,fontStyle:`italic`},{tag:[A.operator,A.operatorKeyword],color:pB},{tag:[A.bracket],color:hB},{tag:[A.brace],color:hB},{tag:[A.punctuation],color:hB},{tag:[A.function(A.variableName),A.labelName],color:_B},{tag:[A.definition(A.variableName)],color:yB},{tag:A.number,color:wB},{tag:A.changed,color:wB},{tag:A.annotation,color:OB,fontStyle:`italic`},{tag:A.modifier,color:wB,fontStyle:`italic`},{tag:A.self,color:wB},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:wB},{tag:[A.atom,A.bool,A.special(A.variableName)],color:wB},{tag:[A.processingInstruction,A.inserted],color:_B},{tag:[A.special(A.string),A.regexp],color:xB},{tag:A.string,color:xB},{tag:A.definition(A.typeName),color:bB,fontWeight:`bold`},{tag:A.meta,color:hB},{tag:A.comment,fontStyle:`italic`,color:hB},{tag:A.docComment,fontStyle:`italic`,color:hB},{tag:[A.tagName],color:_B},{tag:[A.attributeName],color:vB},{tag:[A.heading],fontWeight:`bold`,color:yB},{tag:[A.strong],fontWeight:`bold`,color:yB},{tag:[A.emphasis],fontStyle:`italic`,color:xB},{tag:[A.link],color:RB,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:LB,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:pB,textDecoration:`underline wavy`,borderBottom:`1px wavy ${OB}`},{tag:[A.strikethrough],color:OB,textDecoration:`line-through`},{tag:A.constant(A.name),color:wB},{tag:A.deleted,color:OB},{tag:A.squareBracket,color:hB},{tag:A.angleBracket,color:hB},{tag:A.monospace,color:pB},{tag:[A.contentSeparator],color:yB},{tag:A.quote,color:hB}]))],WB={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},GB={borderLeftWidth:`2px`},KB={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},qB={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},JB={border:`none`,borderRadius:`4px`,padding:`2px 10px`},YB={borderRadius:`2px`},XB={borderRadius:`2px`},ZB={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},QB={width:`12px`,height:`12px`,borderRadius:`6px`},$B={borderRadius:`4px`,padding:`2px 6px`},eV={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},tV=`#ffffff`,nV=`#24292e`,rV=`#BBDFFF`,iV=`#6e7781`,aV=`#f6f8fa`,oV=`#116329`,sV=`#6a737d`,cV=`#6f42c1`,lV=`#005cc5`,uV=`#d73a49`,dV=`#032f62`,fV=`#22863a`,pV=`#e36209`,mV=`#f1f8ff`,hV=`#e1e4e8`,gV=`#f8f9fa`,_V=`#cb2431`,vV=`#BBDFFF20`,yV=gV,bV=nV,xV=rV,SV=`#e8f0fe`,CV=`#0366d6`,wV=`#b08800`,TV=`#79b8ff40`,EV=`#0969da`,DV=`#8250df`,OV=`#e6ffec80`,kV=`#ffebe980`,AV=`#0f6d31`,jV=`#cf222e`,MV=[I.theme({"&":{color:nV,backgroundColor:tV,fontSize:WB.fontSize,fontFamily:WB.fontFamily},".cm-content":{caretColor:bV,lineHeight:WB.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:bV,borderLeftWidth:GB.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${bV}99`,color:tV},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:xV,color:nV},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#daebff`,outline:`1px solid ${lV}`,color:nV,borderRadius:$B.borderRadius,"& span":{color:nV}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#79b8ff`,color:tV,padding:$B.padding,"& span":{color:tV}},".cm-search.cm-panel.cm-textfield":{color:nV,borderRadius:$B.borderRadius,padding:$B.padding},".cm-panels":{backgroundColor:aV,color:iV,borderRadius:`0 0 4px 4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${hV}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${hV}`},".cm-panel button":{backgroundColor:tV,color:nV,border:JB.border,borderRadius:JB.borderRadius,padding:JB.padding},".cm-panel button:hover":{backgroundColor:`#f5f5f5`},".cm-activeLine":{backgroundColor:vV,borderRadius:YB.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:aV,color:iV,border:qB.border,borderRight:`1px solid ${hV}`,paddingRight:qB.paddingRight},".cm-activeLineGutter":{backgroundColor:mV,color:nV,fontWeight:qB.fontWeight},".cm-lineNumbers":{fontSize:qB.fontSize,lineHeight:qB.lineHeight},".cm-foldGutter":{fontSize:qB.fontSize,lineHeight:qB.lineHeight},".cm-foldGutter .cm-gutterElement":{color:iV,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:nV},".cm-insertedLine":{textDecoration:KB.insertedTextDecoration,backgroundColor:OV,color:AV,padding:KB.insertedLinePadding,borderRadius:KB.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:KB.insertedTextDecoration,backgroundColor:`${OV} !important`,color:AV,padding:KB.insertedLinePadding,borderRadius:KB.borderRadious,border:`1px solid ${AV}30`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:KB.deletedTextDecoration,backgroundColor:kV,color:jV,padding:KB.insertedLinePadding,borderRadius:KB.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:KB.deletedTextDecoration,backgroundColor:`${kV} !important`,color:jV,padding:KB.insertedLinePadding,borderRadius:KB.borderRadious,border:`1px solid ${jV}30`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:yV,border:`1px solid ${hV}`,borderRadius:eV.borderRadius,padding:eV.padding,boxShadow:`0 1px 5px rgba(0, 0, 0, 0.1)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:yV,border:`none`},"& > ul > li":{padding:eV.padding,lineHeight:eV.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:`#0366d630`,color:nV,borderRadius:eV.borderRadiusSelected},"& > ul > li:hover":{backgroundColor:`#0366d615`},"& > ul > li > span.cm-completionIcon":{color:iV,paddingRight:eV.paddingRight},"& > ul > li > span.cm-completionDetail":{color:iV,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:yV,borderBottomColor:yV},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${_V}`},"&-warning":{borderLeft:`3px solid ${wV}`},"&-info":{borderLeft:`3px solid ${EV}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${_V}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${wV}`},".cm-matchingBracket":{backgroundColor:SV,outline:`1px solid ${CV}80`,borderRadius:XB.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#ffeef080`,outline:`1px solid ${_V}`,borderRadius:XB.borderRadius},".cm-selectionMatch":{backgroundColor:TV,outline:`1px solid ${rV}50`,borderRadius:XB.borderRadius},".cm-foldPlaceholder":{backgroundColor:TV,color:iV,border:`1px dotted ${hV}70`,borderRadius:ZB.borderRadius,padding:ZB.padding,margin:ZB.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${tV}, 0 0 0 3px ${EV}40`},"& .cm-scroller::-webkit-scrollbar":{width:QB.width,height:QB.height},"& .cm-scroller::-webkit-scrollbar-track":{background:hV},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:nV,borderRadius:QB.borderRadius,border:`3px solid ${hV}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:sV},".cm-ghostText":{opacity:`0.5`,color:`#959da5`}},{dark:!1}),D(B.define([{tag:A.keyword,color:uV,fontWeight:`bold`},{tag:A.controlKeyword,color:uV,fontWeight:`bold`},{tag:A.moduleKeyword,color:uV,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:lV},{tag:[A.variableName],color:lV},{tag:[A.propertyName],color:cV,fontStyle:`normal`},{tag:[A.typeName],color:uV},{tag:[A.className],color:cV,fontStyle:`italic`},{tag:[A.namespace],color:lV,fontStyle:`italic`},{tag:[A.operator,A.operatorKeyword],color:nV},{tag:[A.bracket],color:sV},{tag:[A.brace],color:sV},{tag:[A.punctuation],color:sV},{tag:[A.function(A.variableName),A.labelName],color:fV},{tag:[A.definition(A.variableName)],color:lV},{tag:A.number,color:pV},{tag:A.changed,color:pV},{tag:A.annotation,color:_V,fontStyle:`italic`},{tag:A.modifier,color:pV,fontStyle:`italic`},{tag:A.self,color:pV},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:pV},{tag:[A.atom,A.bool,A.special(A.variableName)],color:pV},{tag:[A.processingInstruction,A.inserted],color:fV},{tag:[A.special(A.string),A.regexp],color:dV},{tag:A.string,color:dV},{tag:A.definition(A.typeName),color:uV,fontWeight:`bold`},{tag:A.meta,color:sV},{tag:A.comment,fontStyle:`italic`,color:sV},{tag:A.docComment,fontStyle:`italic`,color:sV},{tag:[A.tagName],color:oV},{tag:[A.attributeName],color:cV},{tag:[A.heading],fontWeight:`bold`,color:lV},{tag:[A.strong],fontWeight:`bold`,color:lV},{tag:[A.emphasis],fontStyle:`italic`,color:dV},{tag:[A.link],color:DV,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:EV,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:nV,textDecoration:`underline wavy`,borderBottom:`1px wavy ${_V}`},{tag:[A.strikethrough],color:_V,textDecoration:`line-through`},{tag:A.constant(A.name),color:pV},{tag:A.deleted,color:_V},{tag:A.squareBracket,color:sV},{tag:A.angleBracket,color:sV},{tag:A.monospace,color:nV},{tag:[A.contentSeparator],color:lV},{tag:A.quote,color:sV}]))],NV={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},PV={borderLeftWidth:`2px`},FV={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},IV={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},LV={border:`none`,borderRadius:`4px`,padding:`2px 10px`},RV={borderRadius:`2px`},zV={borderRadius:`2px`},BV={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},VV={width:`12px`,height:`12px`,borderRadius:`6px`},HV={borderRadius:`4px`,padding:`2px 6px`},UV={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},WV=`#282828`,GV=`#3c3836`,KV=`#504945`,qV=`#665c54`,JV=`#7c6f64`,YV=`#928374`,XV=`#fbf1c7`,ZV=`#ebdbb2`,QV=`#fb4934`,$V=`#b8bb26`,eH=`#fabd2f`,tH=`#83a598`,nH=`#d3869b`,rH=`#8ec07c`,iH=`#fe8019`,aH=QV,oH=GV,sH=`#3c383660`,cH=WV,lH=GV,uH=KV,dH=`#665c5480`,fH=iH,pH=`#504945cc`,mH=eH,hH=eH,gH=tH,_H=nH,vH=`#32361a80`,yH=`#3c1f1e80`,bH=`#b8bb26`,xH=`#fb4934`,SH=[I.theme({"&":{color:ZV,backgroundColor:cH,fontSize:NV.fontSize,fontFamily:NV.fontFamily},".cm-content":{caretColor:fH,lineHeight:NV.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:fH,borderLeftWidth:PV.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${fH}99`,color:WV},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:uH},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#b57614cc`,outline:`1px solid ${eH}`,color:XV,borderRadius:HV.borderRadius,"& span":{color:XV}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:iH,color:WV,padding:HV.padding,"& span":{color:WV}},".cm-search.cm-panel.cm-textfield":{color:ZV,borderRadius:HV.borderRadius,padding:HV.padding},".cm-panels":{backgroundColor:lH,color:ZV,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${qV}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${qV}`},".cm-panel button":{backgroundColor:lH,color:ZV,border:LV.border,borderRadius:LV.borderRadius,padding:LV.padding},".cm-panel button:hover":{backgroundColor:KV},".cm-activeLine":{backgroundColor:sH,borderRadius:RV.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:GV,color:YV,border:IV.border,borderRight:`1px solid ${KV}`,paddingRight:IV.paddingRight},".cm-activeLineGutter":{backgroundColor:oH,color:ZV,fontWeight:IV.fontWeight},".cm-lineNumbers":{fontSize:IV.fontSize,lineHeight:IV.lineHeight},".cm-foldGutter":{fontSize:IV.fontSize,lineHeight:IV.lineHeight},".cm-foldGutter .cm-gutterElement":{color:YV,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:ZV},".cm-insertedLine":{textDecoration:FV.insertedTextDecoration,backgroundColor:vH,color:bH,padding:FV.insertedLinePadding,borderRadius:FV.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:FV.insertedTextDecoration,backgroundColor:`${vH} !important`,color:bH,padding:FV.insertedLinePadding,borderRadius:FV.borderRadious,border:`1px solid ${bH}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:FV.deletedTextDecoration,backgroundColor:yH,color:xH,padding:FV.insertedLinePadding,borderRadius:FV.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:FV.deletedTextDecoration,backgroundColor:`${yH} !important`,color:xH,padding:FV.insertedLinePadding,borderRadius:FV.borderRadious,border:`1px solid ${xH}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:lH,border:`1px solid ${qV}`,borderRadius:UV.borderRadius,padding:UV.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:lH,border:`none`},"& > ul > li":{padding:UV.padding,lineHeight:UV.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:uH,color:XV,borderRadius:UV.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:YV,paddingRight:UV.paddingRight},"& > ul > li > span.cm-completionDetail":{color:YV,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:lH,borderBottomColor:lH},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${aH}`},"&-warning":{borderLeft:`3px solid ${hH}`},"&-info":{borderLeft:`3px solid ${gH}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${aH}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${hH}`},".cm-matchingBracket":{backgroundColor:pH,outline:`1px solid ${mH}`,borderRadius:zV.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#cc241d55`,outline:`1px solid ${aH}`,borderRadius:zV.borderRadius},".cm-selectionMatch":{backgroundColor:dH,outline:`1px solid ${qV}`,borderRadius:zV.borderRadius},".cm-foldPlaceholder":{backgroundColor:lH,color:YV,border:`1px dotted ${qV}`,borderRadius:BV.borderRadius,padding:BV.padding,margin:BV.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${WV}, 0 0 0 3px ${iH}40`},"& .cm-scroller::-webkit-scrollbar":{width:VV.width,height:VV.height},"& .cm-scroller::-webkit-scrollbar-track":{background:GV},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:qV,borderRadius:VV.borderRadius,border:`3px solid ${GV}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:JV},".cm-ghostText":{opacity:`0.5`,color:YV}},{dark:!0}),D(B.define([{tag:A.keyword,color:QV,fontWeight:`bold`},{tag:A.controlKeyword,color:QV,fontWeight:`bold`},{tag:A.moduleKeyword,color:QV,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:tH},{tag:[A.variableName],color:tH},{tag:[A.propertyName],color:rH,fontStyle:`normal`},{tag:[A.typeName],color:rH},{tag:[A.className],color:eH,fontStyle:`italic`},{tag:[A.namespace],color:tH,fontStyle:`italic`},{tag:[A.operator,A.operatorKeyword],color:ZV},{tag:[A.bracket],color:YV},{tag:[A.brace],color:YV},{tag:[A.punctuation],color:YV},{tag:[A.function(A.variableName),A.labelName],color:eH},{tag:[A.definition(A.variableName)],color:tH},{tag:A.number,color:nH},{tag:A.changed,color:nH},{tag:A.annotation,color:aH,fontStyle:`italic`},{tag:A.modifier,color:nH,fontStyle:`italic`},{tag:A.self,color:nH},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:iH},{tag:[A.atom,A.bool,A.special(A.variableName)],color:iH},{tag:[A.processingInstruction,A.inserted],color:$V},{tag:[A.special(A.string),A.regexp],color:$V},{tag:A.string,color:$V},{tag:A.definition(A.typeName),color:rH,fontWeight:`bold`},{tag:A.meta,color:YV},{tag:A.comment,fontStyle:`italic`,color:YV},{tag:A.docComment,fontStyle:`italic`,color:YV},{tag:[A.tagName],color:QV},{tag:[A.attributeName],color:eH},{tag:[A.heading],fontWeight:`bold`,color:eH},{tag:[A.strong],fontWeight:`bold`,color:eH},{tag:[A.emphasis],fontStyle:`italic`,color:$V},{tag:[A.link],color:_H,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:gH,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:ZV,textDecoration:`underline wavy`,borderBottom:`1px wavy ${aH}`},{tag:[A.strikethrough],color:aH,textDecoration:`line-through`},{tag:A.constant(A.name),color:iH},{tag:A.deleted,color:aH},{tag:A.squareBracket,color:YV},{tag:A.angleBracket,color:YV},{tag:A.monospace,color:ZV},{tag:[A.contentSeparator],color:tH},{tag:A.quote,color:YV}]))],CH={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},wH={borderLeftWidth:`2px`},TH={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},EH={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},DH={border:`none`,borderRadius:`4px`,padding:`2px 10px`},OH={borderRadius:`2px`},kH={borderRadius:`2px`},AH={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},jH={width:`12px`,height:`12px`,borderRadius:`6px`},MH={borderRadius:`4px`,padding:`2px 6px`},NH={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},PH=`#3c3836`,FH=`#504945`,IH=`#665c54`,LH=`#7c6f64`,RH=`#928374`,zH=`#fbf1c7`,BH=`#ebdbb2`,VH=`#d5c4a1`,HH=`#bdae93`,UH=`#a89984`,WH=`#9d0006`,GH=`#79740e`,KH=`#b57614`,qH=`#076678`,JH=`#8f3f71`,YH=`#427b58`,XH=`#af3a03`,ZH=WH,QH=BH,$H=`#ffc42e25`,eU=zH,tU=BH,nU=QH,rU=`#ffc42e40`,iU=XH,aU=`#d5c4a180`,oU=XH,sU=KH,cU=qH,lU=JH,uU=`#d8e5bc80`,dU=`#f7cfcf80`,fU=`#79740e`,pU=`#9d0006`,mU=[I.theme({"&":{color:PH,backgroundColor:eU,fontSize:CH.fontSize,fontFamily:CH.fontFamily},".cm-content":{caretColor:iU,lineHeight:CH.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:iU,borderLeftWidth:wH.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${iU}99`,color:zH},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:nU,color:PH},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#ffc42e80`,outline:`1px solid ${XH}`,color:PH,borderRadius:MH.borderRadius,"& span":{color:PH}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:XH,color:zH,padding:MH.padding,"& span":{color:zH}},".cm-search.cm-panel.cm-textfield":{color:PH,borderRadius:MH.borderRadius,padding:MH.padding},".cm-panels":{backgroundColor:BH,color:FH,borderRadius:`0 0 4px 4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${HH}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${HH}`},".cm-panel button":{backgroundColor:zH,color:PH,border:DH.border,borderRadius:DH.borderRadius,padding:DH.padding},".cm-panel button:hover":{backgroundColor:VH},".cm-activeLine":{backgroundColor:$H,borderRadius:OH.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:BH,color:LH,border:EH.border,borderRight:`1px solid ${HH}`,paddingRight:EH.paddingRight},".cm-activeLineGutter":{backgroundColor:VH,color:PH,fontWeight:EH.fontWeight},".cm-lineNumbers":{fontSize:EH.fontSize,lineHeight:EH.lineHeight},".cm-foldGutter":{fontSize:EH.fontSize,lineHeight:EH.lineHeight},".cm-foldGutter .cm-gutterElement":{color:LH,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:PH},".cm-insertedLine":{textDecoration:TH.insertedTextDecoration,backgroundColor:uU,color:fU,padding:TH.insertedLinePadding,borderRadius:TH.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:TH.insertedTextDecoration,backgroundColor:`${uU} !important`,color:fU,padding:TH.insertedLinePadding,borderRadius:TH.borderRadious,border:`1px solid ${fU}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:TH.deletedTextDecoration,backgroundColor:dU,color:pU,padding:TH.insertedLinePadding,borderRadius:TH.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:TH.deletedTextDecoration,backgroundColor:`${dU} !important`,color:pU,padding:TH.insertedLinePadding,borderRadius:TH.borderRadious,border:`1px solid ${pU}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:tU,border:`1px solid ${HH}`,borderRadius:NH.borderRadius,padding:NH.padding,boxShadow:`0 1px 5px rgba(0, 0, 0, 0.1)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:tU,border:`none`},"& > ul > li":{padding:NH.padding,lineHeight:NH.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:XH+`30`,color:PH,borderRadius:NH.borderRadiusSelected},"& > ul > li:hover":{backgroundColor:XH+`15`},"& > ul > li > span.cm-completionIcon":{color:LH,paddingRight:NH.paddingRight},"& > ul > li > span.cm-completionDetail":{color:LH,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:tU,borderBottomColor:tU},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${ZH}`},"&-warning":{borderLeft:`3px solid ${sU}`},"&-info":{borderLeft:`3px solid ${cU}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${ZH}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${sU}`},".cm-matchingBracket":{backgroundColor:aU,outline:`1px solid ${oU}`,borderRadius:kH.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#fb492740`,outline:`1px solid ${ZH}`,borderRadius:kH.borderRadius},".cm-selectionMatch":{backgroundColor:rU,outline:`1px solid ${HH}`,borderRadius:kH.borderRadius},".cm-foldPlaceholder":{backgroundColor:`transparent`,color:IH,border:`1px dotted ${HH}`,borderRadius:AH.borderRadius,padding:AH.padding,margin:AH.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${zH}, 0 0 0 3px ${XH}40`},"& .cm-scroller::-webkit-scrollbar":{width:jH.width,height:jH.height},"& .cm-scroller::-webkit-scrollbar-track":{background:zH},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:HH,borderRadius:jH.borderRadius,border:`3px solid ${zH}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:UH},".cm-ghostText":{opacity:`0.5`,color:RH}},{dark:!1}),D(B.define([{tag:A.keyword,color:WH,fontWeight:`bold`},{tag:A.controlKeyword,color:WH,fontWeight:`bold`},{tag:A.moduleKeyword,color:WH,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:qH},{tag:[A.variableName],color:qH},{tag:[A.propertyName],color:YH,fontStyle:`normal`},{tag:[A.typeName],color:YH},{tag:[A.className],color:KH,fontStyle:`italic`},{tag:[A.namespace],color:qH,fontStyle:`italic`},{tag:[A.operator,A.operatorKeyword],color:PH},{tag:[A.bracket],color:RH},{tag:[A.brace],color:RH},{tag:[A.punctuation],color:RH},{tag:[A.function(A.variableName),A.labelName],color:KH},{tag:[A.definition(A.variableName)],color:qH},{tag:A.number,color:JH},{tag:A.changed,color:JH},{tag:A.annotation,color:ZH,fontStyle:`italic`},{tag:A.modifier,color:JH,fontStyle:`italic`},{tag:A.self,color:JH},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:XH},{tag:[A.atom,A.bool,A.special(A.variableName)],color:XH},{tag:[A.processingInstruction,A.inserted],color:GH},{tag:[A.special(A.string),A.regexp],color:GH},{tag:A.string,color:GH},{tag:A.definition(A.typeName),color:YH,fontWeight:`bold`},{tag:A.meta,color:RH},{tag:A.comment,fontStyle:`italic`,color:RH},{tag:A.docComment,fontStyle:`italic`,color:RH},{tag:[A.tagName],color:WH},{tag:[A.attributeName],color:KH},{tag:[A.heading],fontWeight:`bold`,color:KH},{tag:[A.strong],fontWeight:`bold`,color:KH},{tag:[A.emphasis],fontStyle:`italic`,color:GH},{tag:[A.link],color:lU,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:cU,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:PH,textDecoration:`underline wavy`,borderBottom:`1px wavy ${ZH}`},{tag:[A.strikethrough],color:ZH,textDecoration:`line-through`},{tag:A.constant(A.name),color:XH},{tag:A.deleted,color:ZH},{tag:A.squareBracket,color:RH},{tag:A.angleBracket,color:RH},{tag:A.monospace,color:PH},{tag:[A.contentSeparator],color:qH},{tag:A.quote,color:RH}]))],hU={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},gU={borderLeftWidth:`2px`},_U={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},vU={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},yU={border:`none`,borderRadius:`4px`,padding:`2px 10px`},bU={borderRadius:`2px`},xU={borderRadius:`2px`},SU={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},CU={width:`12px`,height:`12px`,borderRadius:`6px`},wU={borderRadius:`4px`,padding:`2px 6px`},TU={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},EU=`#212121`,DU=`#505d64`,OU=`#606f7a`,kU=`#707d8b`,AU=`#a0a4ae`,jU=`#bdbdbd`,MU=`#e0e0e0`,NU=`#202325`,PU=`#ff5f52`,FU=`#ff6e40`,IU=`#fa5788`,LU=`#facf4e`,RU=`#ffad42`,zU=`#56c8d8`,BU=`#7186f0`,VU=`#cf6edf`,HU=`#6abf69`,UU=`#99d066`,WU=`#4ebaaa`,GU=PU,KU=NU,qU=`#2d333b30`,JU=EU,YU=DU,XU=`#ffffff1f`,ZU=`#4A707A80`,QU=AU,$U=`#39496650`,eW=zU,tW=RU,nW=zU,rW=VU,iW=`#1e3d2780`,aW=`#4e282880`,oW=`#6abf69`,sW=`#ff5f52`,cW=[I.theme({"&":{color:jU,backgroundColor:JU,fontSize:hU.fontSize,fontFamily:hU.fontFamily},".cm-content":{caretColor:QU,lineHeight:hU.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:QU,borderLeftWidth:gU.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${QU}99`,color:JU},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:XU},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#394966cc`,outline:`1px solid ${zU}`,color:MU,borderRadius:wU.borderRadius,"& span":{color:MU}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:zU,color:JU,padding:wU.padding,"& span":{color:JU}},".cm-search.cm-panel.cm-textfield":{color:jU,borderRadius:wU.borderRadius,padding:wU.padding},".cm-panels":{backgroundColor:EU,color:jU,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${kU}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${kU}`},".cm-panel button":{backgroundColor:YU,color:jU,border:yU.border,borderRadius:yU.borderRadius,padding:yU.padding},".cm-panel button:hover":{backgroundColor:OU},".cm-activeLine":{backgroundColor:qU,borderRadius:bU.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:KU,color:kU,border:vU.border,borderRight:`1px solid ${DU}`,paddingRight:vU.paddingRight},".cm-activeLineGutter":{backgroundColor:`#252a2c`,color:jU,fontWeight:vU.fontWeight},".cm-lineNumbers":{fontSize:vU.fontSize,lineHeight:vU.lineHeight},".cm-foldGutter":{fontSize:vU.fontSize,lineHeight:vU.lineHeight},".cm-foldGutter .cm-gutterElement":{color:kU,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:jU},".cm-insertedLine":{textDecoration:_U.insertedTextDecoration,backgroundColor:iW,color:oW,padding:_U.insertedLinePadding,borderRadius:_U.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:_U.insertedTextDecoration,backgroundColor:`${iW} !important`,color:oW,padding:_U.insertedLinePadding,borderRadius:_U.borderRadious,border:`1px solid ${oW}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:_U.deletedTextDecoration,backgroundColor:aW,color:sW,padding:_U.insertedLinePadding,borderRadius:_U.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:_U.deletedTextDecoration,backgroundColor:`${aW} !important`,color:sW,padding:_U.insertedLinePadding,borderRadius:_U.borderRadious,border:`1px solid ${sW}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:YU,border:`1px solid ${kU}`,borderRadius:TU.borderRadius,padding:TU.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:YU,border:`none`},"& > ul > li":{padding:TU.padding,lineHeight:TU.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:XU,color:MU,borderRadius:TU.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:kU,paddingRight:TU.paddingRight},"& > ul > li > span.cm-completionDetail":{color:kU,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:YU,borderBottomColor:YU},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${GU}`},"&-warning":{borderLeft:`3px solid ${tW}`},"&-info":{borderLeft:`3px solid ${nW}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${GU}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${tW}`},".cm-matchingBracket":{backgroundColor:$U,outline:`1px solid ${eW}`,borderRadius:xU.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#ff5f5240`,outline:`1px solid ${GU}`,borderRadius:xU.borderRadius},".cm-selectionMatch":{backgroundColor:ZU,outline:`1px solid ${OU}50`,borderRadius:xU.borderRadius},".cm-foldPlaceholder":{backgroundColor:YU,color:kU,border:`1px dotted ${kU}70`,borderRadius:SU.borderRadius,padding:SU.padding,margin:SU.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${JU}, 0 0 0 3px ${zU}40`},"& .cm-scroller::-webkit-scrollbar":{width:CU.width,height:CU.height},"& .cm-scroller::-webkit-scrollbar-track":{background:KU},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:OU,borderRadius:CU.borderRadius,border:`3px solid ${KU}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:kU},".cm-ghostText":{opacity:`0.5`,color:kU}},{dark:!0}),D(B.define([{tag:A.keyword,color:PU,fontWeight:`bold`},{tag:A.controlKeyword,color:PU,fontWeight:`bold`},{tag:A.moduleKeyword,color:PU,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:BU},{tag:[A.variableName],color:UU},{tag:[A.propertyName],color:VU,fontStyle:`normal`},{tag:[A.typeName],color:PU},{tag:[A.className],color:LU,fontStyle:`italic`},{tag:[A.namespace],color:BU,fontStyle:`italic`},{tag:[A.operator,A.operatorKeyword],color:jU},{tag:[A.bracket],color:kU},{tag:[A.brace],color:kU},{tag:[A.punctuation],color:kU},{tag:[A.function(A.variableName)],color:zU},{tag:[A.labelName],color:zU,fontStyle:`italic`},{tag:[A.definition(A.function(A.variableName))],color:zU},{tag:[A.definition(A.variableName)],color:BU},{tag:A.number,color:LU},{tag:A.changed,color:LU},{tag:A.annotation,color:GU,fontStyle:`italic`},{tag:A.modifier,color:FU,fontStyle:`italic`},{tag:A.self,color:FU},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:FU},{tag:[A.atom,A.bool,A.special(A.variableName)],color:FU},{tag:[A.processingInstruction,A.inserted],color:HU},{tag:[A.special(A.string),A.regexp],color:IU},{tag:A.string,color:RU},{tag:A.definition(A.typeName),color:PU,fontWeight:`bold`},{tag:A.meta,color:kU},{tag:A.comment,fontStyle:`italic`,color:kU},{tag:A.docComment,fontStyle:`italic`,color:kU},{tag:[A.tagName],color:VU},{tag:[A.attributeName],color:LU},{tag:[A.heading],fontWeight:`bold`,color:WU},{tag:A.heading1,color:LU},{tag:A.heading2,color:RU},{tag:A.heading3,color:zU},{tag:A.heading4,color:BU},{tag:A.heading5,color:VU},{tag:A.heading6,color:PU},{tag:[A.strong],fontWeight:`bold`,color:BU},{tag:[A.emphasis],fontStyle:`italic`,color:RU},{tag:[A.link],color:rW,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:nW,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:jU,textDecoration:`underline wavy`,borderBottom:`1px wavy ${GU}`},{tag:[A.strikethrough],color:GU,textDecoration:`line-through`},{tag:A.constant(A.name),color:FU},{tag:A.deleted,color:GU},{tag:A.squareBracket,color:kU},{tag:A.angleBracket,color:kU},{tag:A.monospace,color:jU},{tag:[A.contentSeparator],color:BU},{tag:A.quote,color:kU}]))],lW={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},uW={borderLeftWidth:`2px`},dW={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},fW={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},pW={border:`none`,borderRadius:`4px`,padding:`2px 10px`},mW={borderRadius:`2px`},hW={borderRadius:`2px`},gW={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},_W={width:`12px`,height:`12px`,borderRadius:`6px`},vW={borderRadius:`4px`,padding:`2px 6px`},yW={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},bW=`#ffffff`,xW=`#f5f5f5`,SW=`#212121`,CW=`#757575`,wW=`#9e9e9e`,TW=`#424242`,EW=`#eeeeee`,DW=`#fafafa`,OW=`#f44336`,kW=`#ff3e00`,AW=`#FF00E9FF`,jW=`#ffc107`,MW=`#ff9800`,NW=`#00acc1`,PW=`#3949ab`,FW=`#8e24aa`,IW=`#43a047`,LW=`#00897b`,RW=`#1e88e5`,zW=OW,BW=`#00000008`,VW=bW,HW=xW,UW=`#DDEEFF`,WW=`#90a4ae26`,GW=wW,KW=`#DDEEFF80`,qW=NW,JW=MW,YW=NW,XW=FW,ZW=`#ECEFF180`,QW=`#e6ffed80`,$W=`#ffebe980`,eG=`#28a745`,tG=`#d73a49`,nG=[I.theme({"&":{color:SW,backgroundColor:VW,fontSize:lW.fontSize,fontFamily:lW.fontFamily},".cm-content":{caretColor:GW,lineHeight:lW.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:GW,borderLeftWidth:uW.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${SW}99`,color:VW},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:UW},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#FFA72680`,outline:`1px solid ${jW}`,color:SW,borderRadius:vW.borderRadius,"& span":{color:SW}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:NW,color:VW,padding:vW.padding,"& span":{color:VW}},".cm-search.cm-panel.cm-textfield":{color:SW,borderRadius:vW.borderRadius,padding:vW.padding},".cm-panels":{backgroundColor:EW,color:SW,borderRadius:`4px`,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${wW}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${wW}`},".cm-panel button":{backgroundColor:HW,color:SW,border:pW.border,borderRadius:pW.borderRadius,padding:pW.padding},".cm-panel button:hover":{backgroundColor:`#CFD8DC`},".cm-activeLine":{backgroundColor:BW,borderRadius:mW.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:DW,color:CW,border:fW.border,borderRight:`1px solid ${wW}`,paddingRight:fW.paddingRight},".cm-activeLineGutter":{backgroundColor:`#E0E0E0`,color:SW,fontWeight:fW.fontWeight},".cm-lineNumbers":{fontSize:fW.fontSize,lineHeight:fW.lineHeight},".cm-foldGutter":{fontSize:fW.fontSize,lineHeight:fW.lineHeight},".cm-foldGutter .cm-gutterElement":{color:CW,cursor:`pointer`,transition:`color 0.15s ease`},".cm-foldGutter .cm-gutterElement:hover":{color:SW},".cm-insertedLine":{textDecoration:dW.insertedTextDecoration,backgroundColor:QW,color:eG,padding:dW.insertedLinePadding,borderRadius:dW.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:dW.insertedTextDecoration,backgroundColor:`${QW} !important`,color:eG,padding:dW.insertedLinePadding,borderRadius:dW.borderRadious,border:`1px solid ${eG}30`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:dW.deletedTextDecoration,backgroundColor:$W,color:tG,padding:dW.insertedLinePadding,borderRadius:dW.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:dW.deletedTextDecoration,backgroundColor:`${$W} !important`,color:tG,padding:dW.insertedLinePadding,borderRadius:dW.borderRadious,border:`1px solid ${tG}30`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:HW,border:`1px solid ${wW}`,borderRadius:yW.borderRadius,padding:yW.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:HW,border:`none`},"& > ul > li":{padding:yW.padding,lineHeight:yW.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:ZW,color:SW,borderRadius:yW.borderRadiusSelected},"& > ul > li:hover":{backgroundColor:ZW},"& > ul > li > span.cm-completionIcon":{color:CW,paddingRight:yW.paddingRight},"& > ul > li > span.cm-completionDetail":{color:CW,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:HW,borderBottomColor:HW},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${zW}`},"&-warning":{borderLeft:`3px solid ${JW}`},"&-info":{borderLeft:`3px solid ${YW}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${zW}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${JW}`},".cm-matchingBracket":{backgroundColor:KW,outline:`1px solid ${qW}`,borderRadius:hW.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${zW}20`,outline:`1px solid ${zW}`,borderRadius:hW.borderRadius},".cm-selectionMatch":{backgroundColor:WW,outline:`1px solid ${CW}30`,borderRadius:hW.borderRadius},".cm-foldPlaceholder":{backgroundColor:xW,color:CW,border:`1px dotted ${CW}70`,borderRadius:gW.borderRadius,padding:gW.padding,margin:gW.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${VW}, 0 0 0 3px ${NW}40`},"& .cm-scroller::-webkit-scrollbar":{width:_W.width,height:_W.height},"& .cm-scroller::-webkit-scrollbar-track":{background:DW},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:CW,borderRadius:_W.borderRadius,border:`3px solid ${DW}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:SW},".cm-ghostText":{opacity:`0.5`,color:CW}},{dark:!1}),D(B.define([{tag:A.keyword,color:NW,fontWeight:`bold`},{tag:A.controlKeyword,color:NW,fontWeight:`bold`},{tag:A.moduleKeyword,color:NW,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:TW},{tag:[A.variableName],color:TW},{tag:[A.propertyName],color:LW,fontStyle:`normal`},{tag:[A.typeName],color:MW},{tag:[A.className],color:MW,fontStyle:`italic`},{tag:[A.namespace],color:PW,fontStyle:`italic`},{tag:[A.operator,A.operatorKeyword],color:PW},{tag:[A.bracket],color:FW},{tag:[A.brace],color:FW},{tag:[A.punctuation],color:CW},{tag:[A.function(A.variableName)],color:kW},{tag:[A.labelName],color:RW,fontStyle:`italic`},{tag:[A.definition(A.function(A.variableName))],color:kW},{tag:[A.definition(A.variableName)],color:AW},{tag:A.number,color:MW},{tag:A.changed,color:MW},{tag:A.annotation,color:zW,fontStyle:`italic`},{tag:A.modifier,color:MW,fontStyle:`italic`},{tag:A.self,color:MW},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:MW},{tag:[A.atom,A.bool],color:FW},{tag:[A.processingInstruction,A.inserted],color:IW},{tag:A.string,color:IW},{tag:[A.special(A.string),A.regexp],color:AW},{tag:A.definition(A.typeName),color:AW,fontWeight:`bold`},{tag:[A.definition(A.name),A.separator],color:AW},{tag:A.meta,color:CW},{tag:A.comment,fontStyle:`italic`,color:CW},{tag:A.docComment,fontStyle:`italic`,color:CW},{tag:[A.tagName],color:kW},{tag:[A.attributeName],color:TW},{tag:[A.heading],fontWeight:`bold`,color:LW},{tag:A.heading1,color:RW},{tag:A.heading2,color:MW},{tag:A.heading3,color:NW},{tag:A.heading4,color:PW},{tag:A.heading5,color:FW},{tag:A.heading6,color:IW},{tag:[A.strong],fontWeight:`bold`,color:PW},{tag:[A.emphasis],fontStyle:`italic`,color:MW},{tag:[A.link],color:XW,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:YW,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:SW,textDecoration:`underline wavy`,borderBottom:`1px dotted ${OW}`},{tag:[A.strikethrough],color:zW,textDecoration:`line-through`},{tag:A.constant(A.name),color:kW},{tag:A.deleted,color:zW},{tag:A.squareBracket,color:OW},{tag:A.angleBracket,color:SW},{tag:A.monospace,color:SW},{tag:[A.contentSeparator],color:NW},{tag:A.quote,color:IW}]))],rG={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},iG={borderLeftWidth:`2px`},aG={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},oG={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},sG={border:`none`,borderRadius:`4px`,padding:`2px 10px`},cG={borderRadius:`2px`},lG={borderRadius:`2px`},uG={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},dG={width:`12px`,height:`12px`,borderRadius:`6px`},fG={borderRadius:`4px`,padding:`2px 6px`},pG={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},mG=`#272822`,hG=`#f8f8f2`,gG=`#88846f`,_G=`#f8f8f0`,vG=`#F92672`,yG=`#FD971F`,bG=`#66D9EF`,xG=`#E6DB74`,SG=`#AE81FF`,CG=`#A6E22E`,wG=`#F44747`,TG=`#414339`,EG=`#3e3d3257`,DG=`#34352f`,OG=`#49483E`,kG=`#75715e70`,AG=_G,jG=`#75715E55`,MG=bG,NG=yG,PG=bG,FG=SG,IG=`#3d4d3880`,LG=`#4d393980`,RG=`#A6E22E`,zG=`#F92672`,BG=[I.theme({"&":{color:hG,backgroundColor:mG,fontSize:rG.fontSize,fontFamily:rG.fontFamily},".cm-content":{caretColor:AG,lineHeight:rG.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:AG,borderLeftWidth:iG.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${AG}99`,color:mG},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:OG},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#49483E99`,outline:`1px solid ${xG}`,color:hG,borderRadius:fG.borderRadius,"& span":{color:hG}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:vG,color:mG,padding:fG.padding,"& span":{color:mG}},".cm-search.cm-panel.cm-textfield":{color:hG,borderRadius:fG.borderRadius,padding:fG.padding},".cm-panels":{backgroundColor:TG,color:hG,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${gG}80`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${gG}80`},".cm-panel button":{backgroundColor:DG,color:hG,border:sG.border,borderRadius:sG.borderRadius,padding:sG.padding},".cm-panel button:hover":{backgroundColor:`#49483E`},".cm-activeLine":{backgroundColor:EG,borderRadius:cG.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:TG,color:gG,border:oG.border,borderRight:`1px solid #3e3d32`,paddingRight:oG.paddingRight},".cm-activeLineGutter":{backgroundColor:`#35352c`,color:hG,fontWeight:oG.fontWeight},".cm-lineNumbers":{fontSize:oG.fontSize,lineHeight:oG.lineHeight},".cm-foldGutter":{fontSize:oG.fontSize,lineHeight:oG.lineHeight},".cm-foldGutter .cm-gutterElement":{color:gG,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:hG},".cm-insertedLine":{textDecoration:aG.insertedTextDecoration,backgroundColor:IG,color:RG,padding:aG.insertedLinePadding,borderRadius:aG.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:aG.insertedTextDecoration,backgroundColor:`${IG} !important`,color:RG,padding:aG.insertedLinePadding,borderRadius:aG.borderRadious,border:`1px solid ${RG}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:aG.deletedTextDecoration,backgroundColor:LG,color:zG,padding:aG.insertedLinePadding,borderRadius:aG.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:aG.deletedTextDecoration,backgroundColor:`${LG} !important`,color:zG,padding:aG.insertedLinePadding,borderRadius:aG.borderRadious,border:`1px solid ${zG}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:DG,border:`1px solid #49483E`,borderRadius:pG.borderRadius,padding:pG.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.4)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:DG,border:`none`},"& > ul > li":{padding:pG.padding,lineHeight:pG.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:OG,color:hG,borderRadius:pG.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:gG,paddingRight:pG.paddingRight},"& > ul > li > span.cm-completionDetail":{color:gG,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:DG,borderBottomColor:DG},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${wG}`},"&-warning":{borderLeft:`3px solid ${NG}`},"&-info":{borderLeft:`3px solid ${PG}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${wG}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${NG}`},".cm-matchingBracket":{backgroundColor:jG,outline:`1px solid ${MG}`,borderRadius:lG.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#f9267240`,outline:`1px solid ${wG}`,borderRadius:lG.borderRadius},".cm-selectionMatch":{backgroundColor:kG,outline:`1px solid ${gG}50`,borderRadius:lG.borderRadius},".cm-foldPlaceholder":{backgroundColor:DG,color:gG,border:`1px dotted ${gG}70`,borderRadius:uG.borderRadius,padding:uG.padding,margin:uG.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${mG}, 0 0 0 3px ${bG}40`},"& .cm-scroller::-webkit-scrollbar":{width:dG.width,height:dG.height},"& .cm-scroller::-webkit-scrollbar-track":{background:TG},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:`#49483E`,borderRadius:dG.borderRadius,border:`3px solid ${TG}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:`#5a594d`},".cm-ghostText":{opacity:`0.5`,color:gG}},{dark:!0}),D(B.define([{tag:A.keyword,color:vG,fontWeight:`bold`},{tag:A.controlKeyword,color:vG,fontWeight:`bold`},{tag:A.moduleKeyword,color:vG,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:yG},{tag:[A.variableName],color:yG},{tag:[A.propertyName],color:CG,fontStyle:`normal`},{tag:[A.typeName],color:bG,fontStyle:`italic`},{tag:[A.className],color:CG,fontStyle:`italic`},{tag:[A.namespace],color:yG,fontStyle:`italic`},{tag:[A.operator,A.operatorKeyword],color:vG},{tag:[A.bracket],color:hG},{tag:[A.brace],color:hG},{tag:[A.punctuation],color:hG},{tag:[A.function(A.variableName),A.labelName],color:bG},{tag:[A.definition(A.function(A.variableName))],color:bG},{tag:[A.definition(A.variableName)],color:yG},{tag:A.number,color:SG},{tag:A.changed,color:SG},{tag:A.annotation,color:wG,fontStyle:`italic`},{tag:A.modifier,color:SG,fontStyle:`italic`},{tag:A.self,color:SG},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:SG},{tag:[A.atom,A.bool,A.special(A.variableName)],color:SG},{tag:[A.processingInstruction,A.inserted],color:CG},{tag:[A.special(A.string),A.regexp],color:xG},{tag:A.string,color:xG},{tag:A.definition(A.typeName),color:bG,fontWeight:`bold`},{tag:A.meta,color:gG},{tag:A.comment,fontStyle:`italic`,color:gG},{tag:A.docComment,fontStyle:`italic`,color:gG},{tag:[A.tagName],color:vG},{tag:[A.attributeName],color:CG},{tag:[A.heading],fontWeight:`bold`,color:CG},{tag:[A.strong],fontWeight:`bold`,color:yG},{tag:[A.emphasis],fontStyle:`italic`,color:yG},{tag:[A.link],color:FG,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:PG,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:hG,textDecoration:`underline wavy`,borderBottom:`1px wavy ${wG}`},{tag:[A.strikethrough],color:wG,textDecoration:`line-through`},{tag:A.constant(A.name),color:SG},{tag:A.deleted,color:wG},{tag:A.squareBracket,color:hG},{tag:A.angleBracket,color:hG},{tag:A.monospace,color:hG},{tag:[A.contentSeparator],color:yG},{tag:A.quote,color:gG}]))],VG={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},HG={borderLeftWidth:`2px`},UG={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},WG={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},GG={border:`none`,borderRadius:`4px`,padding:`2px 10px`},KG={borderRadius:`2px`},qG={borderRadius:`2px`},JG={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},YG={width:`12px`,height:`12px`,borderRadius:`6px`},XG={borderRadius:`4px`,padding:`2px 6px`},ZG={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},QG=`#2e3440`,$G=`#3b4252`,eK=`#434c5e`,tK=`#4c566a`,nK=`#d8dee9`,rK=`#eceff4`,iK=`#8fbcbb`,aK=`#88c0d0`,oK=`#81a1c1`,sK=`#5e81ac`,cK=`#bf616a`,lK=`#d08770`,uK=`#ebcb8b`,dK=`#a3be8c`,fK=`#b48ead`,pK=`#d30102`,mK=`#252a33`,hK=`#3b425277`,gK=QG,_K=$G,vK=eK,yK=`#4c566a80`,bK=nK,xK=`#4c566a55`,SK=aK,CK=uK,wK=oK,TK=fK,EK=`#3b4a3880`,DK=`#4a393a80`,OK=`#a3be8c`,kK=`#bf616a`,AK=[I.theme({"&":{color:nK,backgroundColor:gK,fontSize:VG.fontSize,fontFamily:VG.fontFamily},".cm-content":{caretColor:bK,lineHeight:VG.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:bK,borderLeftWidth:HG.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${bK}99`,color:gK},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:vK},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#5e81ac80`,outline:`1px solid ${iK}`,color:nK,borderRadius:XG.borderRadius,"& span":{color:nK}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:oK,color:rK,padding:XG.padding,"& span":{color:rK}},".cm-search.cm-panel.cm-textfield":{color:nK,borderRadius:XG.borderRadius,padding:XG.padding},".cm-panels":{backgroundColor:mK,color:nK,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${tK}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${tK}`},".cm-panel button":{backgroundColor:_K,color:nK,border:GG.border,borderRadius:GG.borderRadius,padding:GG.padding},".cm-panel button:hover":{backgroundColor:eK},".cm-activeLine":{backgroundColor:hK,borderRadius:KG.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:mK,color:tK,border:WG.border,borderRight:`1px solid ${eK}`,paddingRight:WG.paddingRight},".cm-activeLineGutter":{backgroundColor:$G,color:nK,fontWeight:WG.fontWeight},".cm-lineNumbers":{fontSize:WG.fontSize,lineHeight:WG.lineHeight},".cm-foldGutter":{fontSize:WG.fontSize,lineHeight:WG.lineHeight},".cm-foldGutter .cm-gutterElement":{color:tK,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:nK},".cm-insertedLine":{textDecoration:UG.insertedTextDecoration,backgroundColor:EK,color:OK,padding:UG.insertedLinePadding,borderRadius:UG.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:UG.insertedTextDecoration,backgroundColor:`${EK} !important`,color:OK,padding:UG.insertedLinePadding,borderRadius:UG.borderRadious,border:`1px solid ${OK}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:UG.deletedTextDecoration,backgroundColor:DK,color:kK,padding:UG.insertedLinePadding,borderRadius:UG.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:UG.deletedTextDecoration,backgroundColor:`${DK} !important`,color:kK,padding:UG.insertedLinePadding,borderRadius:UG.borderRadious,border:`1px solid ${kK}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:_K,border:`1px solid ${tK}`,borderRadius:ZG.borderRadius,padding:ZG.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:_K,border:`none`},"& > ul > li":{padding:ZG.padding,lineHeight:ZG.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:eK,color:rK,borderRadius:ZG.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:tK,paddingRight:ZG.paddingRight},"& > ul > li > span.cm-completionDetail":{color:tK,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:_K,borderBottomColor:_K},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${cK}`},"&-warning":{borderLeft:`3px solid ${CK}`},"&-info":{borderLeft:`3px solid ${wK}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${cK}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${CK}`},".cm-matchingBracket":{backgroundColor:xK,outline:`1px solid ${SK}`,borderRadius:qG.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${cK}40`,outline:`1px solid ${pK}`,borderRadius:qG.borderRadius},".cm-selectionMatch":{backgroundColor:yK,outline:`1px solid ${eK}50`,borderRadius:qG.borderRadius},".cm-foldPlaceholder":{backgroundColor:_K,color:tK,border:`1px dotted ${tK}70`,borderRadius:JG.borderRadius,padding:JG.padding,margin:JG.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${gK}, 0 0 0 3px ${aK}40`},"& .cm-scroller::-webkit-scrollbar":{width:YG.width,height:YG.height},"& .cm-scroller::-webkit-scrollbar-track":{background:mK},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:eK,borderRadius:YG.borderRadius,border:`3px solid ${mK}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:tK},".cm-ghostText":{opacity:`0.5`,color:tK}},{dark:!0}),D(B.define([{tag:A.keyword,color:sK,fontWeight:`bold`},{tag:A.controlKeyword,color:sK,fontWeight:`bold`},{tag:A.moduleKeyword,color:sK,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:aK},{tag:[A.variableName],color:nK},{tag:[A.propertyName],color:aK,fontStyle:`normal`},{tag:[A.typeName],color:uK},{tag:[A.className],color:uK,fontStyle:`italic`},{tag:[A.namespace],color:oK,fontStyle:`italic`},{tag:[A.operator,A.operatorKeyword],color:fK},{tag:[A.bracket],color:nK},{tag:[A.brace],color:iK},{tag:[A.punctuation],color:nK},{tag:[A.function(A.variableName),A.labelName],color:iK},{tag:[A.definition(A.function(A.variableName))],color:iK},{tag:[A.definition(A.variableName)],color:lK},{tag:A.number,color:lK},{tag:A.changed,color:fK},{tag:A.annotation,color:cK,fontStyle:`italic`},{tag:A.modifier,color:fK,fontStyle:`italic`},{tag:A.self,color:fK},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:lK},{tag:[A.atom,A.bool,A.special(A.variableName)],color:fK},{tag:[A.processingInstruction,A.inserted],color:iK},{tag:[A.special(A.string),A.regexp],color:fK},{tag:A.string,color:dK},{tag:A.definition(A.typeName),color:uK,fontWeight:`bold`},{tag:[A.definition(A.name),A.separator],color:dK},{tag:A.meta,color:tK},{tag:A.comment,fontStyle:`italic`,color:tK},{tag:A.docComment,fontStyle:`italic`,color:tK},{tag:[A.tagName],color:cK},{tag:[A.attributeName],color:uK},{tag:[A.heading],fontWeight:`bold`,color:oK},{tag:[A.strong],fontWeight:`bold`,color:aK},{tag:[A.emphasis],fontStyle:`italic`,color:uK},{tag:[A.link],color:TK,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:wK,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:nK,textDecoration:`underline wavy`,borderBottom:`1px wavy ${cK}`},{tag:[A.strikethrough],color:cK,textDecoration:`line-through`},{tag:A.constant(A.name),color:lK},{tag:A.deleted,color:cK},{tag:A.squareBracket,color:cK},{tag:A.angleBracket,color:lK},{tag:A.monospace,color:nK,fontStyle:`italic`},{tag:[A.contentSeparator],color:oK},{tag:A.quote,color:fK}]))],jK={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},MK={borderLeftWidth:`2px`},NK={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},PK={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},FK={border:`none`,borderRadius:`4px`,padding:`2px 10px`},IK={borderRadius:`2px`},LK={borderRadius:`2px`},RK={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},zK={width:`12px`,height:`12px`,borderRadius:`6px`},BK={borderRadius:`4px`,padding:`2px 6px`},VK={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},HK=`#e1e2e7`,UK=`#3760bf`,WK=`#99a7df`,GK=`#848cb5`,KK=`#8c91a8`,qK=`#3760bf`,JK=`#e9e9ec`,YK=`#d5d6db`,XK=`#f52a65`,ZK=`#b15c00`,QK=`#8c6c3e`,$K=`#587539`,eq=`#007197`,tq=`#2e7de9`,nq=`#7847bd`,rq=`#9854f1`,iq=XK,aq=YK,oq=`#5F5FAF5A`,sq=HK,cq=JK,lq=`#99a7df40`,Zge=`#99a7df60`,uq=UK,Qge=`#0e639c20`,$ge=eq,dq=ZK,fq=eq,e_e=nq,pq=`#58753920`,mq=`#f52a6520`,hq=`#587539`,gq=`#f52a65`,t_e=[I.theme({"&":{color:qK,backgroundColor:sq,fontSize:jK.fontSize,fontFamily:jK.fontFamily},".cm-content":{caretColor:uq,lineHeight:jK.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:uq,borderLeftWidth:MK.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${uq}99`,color:sq},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:lq},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#0e639c40`,outline:`1px solid ${eq}`,color:qK,borderRadius:BK.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:eq,color:sq,padding:BK.padding,"& span":{color:sq}},".cm-search.cm-panel.cm-textfield":{color:qK,borderRadius:BK.borderRadius,padding:BK.padding},".cm-panels":{backgroundColor:JK,color:qK,borderRadius:`4px`,boxShadow:`0 1px 3px rgba(0, 0, 0, 0.1)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${GK}30`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${GK}30`},".cm-panel button":{backgroundColor:cq,color:qK,border:FK.border,borderRadius:FK.borderRadius,padding:FK.padding},".cm-panel button:hover":{backgroundColor:YK,border:`1px solid ${WK}`},".cm-activeLine":{backgroundColor:oq,borderRadius:IK.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:aq,color:GK,border:PK.border,borderRight:`1px solid ${YK}`,paddingRight:PK.paddingRight},".cm-activeLineGutter":{color:UK,fontWeight:PK.fontWeight},".cm-lineNumbers":{fontSize:PK.fontSize,lineHeight:PK.lineHeight},".cm-foldGutter":{fontSize:PK.fontSize,lineHeight:PK.lineHeight},".cm-foldGutter .cm-gutterElement":{color:GK,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:UK},".cm-insertedLine":{textDecoration:NK.insertedTextDecoration,backgroundColor:pq,color:hq,padding:NK.insertedLinePadding,borderRadius:NK.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:NK.insertedTextDecoration,backgroundColor:`${pq} !important`,color:hq,padding:NK.insertedLinePadding,borderRadius:NK.borderRadious,border:`1px solid ${hq}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:NK.deletedTextDecoration,backgroundColor:mq,color:gq,padding:NK.insertedLinePadding,borderRadius:NK.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:NK.deletedTextDecoration,backgroundColor:`${mq} !important`,color:gq,padding:NK.insertedLinePadding,borderRadius:NK.borderRadious,border:`1px solid ${gq}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:cq,border:`1px solid ${KK}40`,borderRadius:VK.borderRadius,padding:VK.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:cq,border:`none`,maxHeight:`300px`},"& > ul > li":{padding:VK.padding,lineHeight:VK.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:lq,color:UK,borderRadius:VK.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:GK,paddingRight:VK.paddingRight},"& > ul > li > span.cm-completionDetail":{color:GK,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:cq,borderBottomColor:cq},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${iq}`},"&-warning":{borderLeft:`3px solid ${dq}`},"&-info":{borderLeft:`3px solid ${fq}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${iq}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${dq}`},".cm-matchingBracket":{backgroundColor:Qge,outline:`1px solid ${$ge}`,borderRadius:LK.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${XK}20`,outline:`1px solid ${iq}`,borderRadius:LK.borderRadius},".cm-selectionMatch":{backgroundColor:Zge,outline:`1px solid ${WK}50`,borderRadius:LK.borderRadius},".cm-foldPlaceholder":{backgroundColor:cq,color:GK,border:`1px dotted ${GK}70`,borderRadius:RK.borderRadius,padding:RK.padding,margin:RK.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${sq}, 0 0 0 3px ${eq}40`},"& .cm-scroller::-webkit-scrollbar":{width:zK.width,height:zK.height},"& .cm-scroller::-webkit-scrollbar-track":{background:aq},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:GK,borderRadius:zK.borderRadius,border:`3px solid ${aq}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:WK},".cm-ghostText":{opacity:`0.5`,color:GK}},{dark:!1}),D(B.define([{tag:A.keyword,color:eq,fontWeight:`bold`},{tag:A.controlKeyword,color:eq,fontWeight:`bold`},{tag:A.moduleKeyword,color:eq,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:tq},{tag:[A.variableName],color:UK},{tag:[A.propertyName],color:tq,fontStyle:`normal`},{tag:[A.typeName],color:eq},{tag:[A.className],color:QK,fontStyle:`italic`},{tag:[A.namespace],color:nq,fontStyle:`italic`},{tag:[A.operator,A.operatorKeyword],color:nq},{tag:[A.bracket],color:GK},{tag:[A.brace],color:GK},{tag:[A.punctuation],color:GK},{tag:[A.function(A.variableName)],color:eq},{tag:[A.labelName],color:nq,fontStyle:`italic`},{tag:[A.definition(A.function(A.variableName))],color:eq},{tag:[A.definition(A.variableName)],color:tq},{tag:A.number,color:ZK},{tag:A.changed,color:ZK},{tag:A.annotation,color:iq,fontStyle:`italic`},{tag:A.modifier,color:ZK,fontStyle:`italic`},{tag:A.self,color:ZK},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:ZK},{tag:[A.atom,A.bool,A.special(A.variableName)],color:ZK},{tag:[A.processingInstruction,A.inserted],color:$K},{tag:[A.special(A.string),A.regexp],color:rq},{tag:A.string,color:$K},{tag:A.definition(A.typeName),color:eq,fontWeight:`bold`},{tag:[A.definition(A.name),A.separator],color:tq},{tag:A.meta,color:GK},{tag:A.comment,fontStyle:`italic`,color:GK},{tag:A.docComment,fontStyle:`italic`,color:GK},{tag:[A.tagName],color:nq},{tag:[A.attributeName],color:QK},{tag:[A.heading],fontWeight:`bold`,color:ZK},{tag:A.heading1,color:ZK,fontWeight:`bold`},{tag:A.heading2,color:ZK},{tag:A.heading3,color:ZK},{tag:A.heading4,color:eq},{tag:A.heading5,color:eq},{tag:A.heading6,color:eq},{tag:[A.strong],fontWeight:`bold`,color:UK},{tag:[A.emphasis],fontStyle:`italic`,color:$K},{tag:[A.link],color:e_e,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:fq,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:UK,textDecoration:`underline wavy`,borderBottom:`1px wavy ${iq}`},{tag:[A.strikethrough],color:iq,textDecoration:`line-through`},{tag:A.constant(A.name),color:ZK},{tag:A.deleted,color:iq},{tag:A.squareBracket,color:GK},{tag:A.angleBracket,color:GK},{tag:A.monospace,color:UK},{tag:[A.contentSeparator],color:tq},{tag:A.quote,color:GK}]))],_q={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},n_e={borderLeftWidth:`2px`},vq={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},yq={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},bq={border:`none`,borderRadius:`4px`,padding:`2px 10px`},r_e={borderRadius:`2px`},xq={borderRadius:`2px`},Sq={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},Cq={width:`12px`,height:`12px`,borderRadius:`6px`},wq={borderRadius:`4px`,padding:`2px 6px`},Tq={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},i_e=`#24283b`,Eq=`#414868`,Dq=`#565f89`,Oq=`#c0caf5`,kq=`#282e44`,Aq=`#1f2335`,a_e=`#f7768e`,jq=`#ff9e64`,Mq=`#e0af68`,Nq=`#9ece6a`,Pq=`#2ac3de`,Fq=`#7aa2f7`,Iq=`#bb9af7`,Lq=`#f7768e`,Rq=Aq,o_e=`#292e427a`,zq=i_e,Bq=kq,Vq=`#6f7bb630`,s_e=`#6f7bb650`,Hq=Oq,c_e=`#3d59a150`,l_e=Fq,Uq=jq,Wq=Pq,u_e=Iq,Gq=`#3b4a3880`,Kq=`#4a393a80`,qq=`#9ece6a`,Jq=`#f7768e`,d_e=[I.theme({"&":{color:Oq,backgroundColor:zq,fontSize:_q.fontSize,fontFamily:_q.fontFamily},".cm-content":{caretColor:Hq,lineHeight:_q.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:Hq,borderLeftWidth:n_e.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${Hq}99`,color:zq},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Vq},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#7aa2f740`,outline:`1px solid ${Fq}`,color:Oq,borderRadius:wq.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:Fq,color:zq,padding:wq.padding,"& span":{color:zq}},".cm-search.cm-panel.cm-textfield":{color:Oq,borderRadius:wq.borderRadius,padding:wq.padding},".cm-panels":{backgroundColor:kq,color:Oq,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${Dq}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${Dq}`},".cm-panel button":{backgroundColor:Bq,color:Oq,border:bq.border,borderRadius:bq.borderRadius,padding:bq.padding},".cm-panel button:hover":{backgroundColor:Aq},".cm-activeLine":{backgroundColor:o_e,borderRadius:r_e.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:Rq,color:Dq,border:yq.border,borderRight:`1px solid ${Aq}`,paddingRight:yq.paddingRight},".cm-activeLineGutter":{backgroundColor:Aq,color:Oq,fontWeight:yq.fontWeight},".cm-lineNumbers":{fontSize:yq.fontSize,lineHeight:yq.lineHeight},".cm-foldGutter":{fontSize:yq.fontSize,lineHeight:yq.lineHeight},".cm-foldGutter .cm-gutterElement":{color:Dq,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:Oq},".cm-insertedLine":{textDecoration:vq.insertedTextDecoration,backgroundColor:Gq,color:qq,padding:vq.insertedLinePadding,borderRadius:vq.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:vq.insertedTextDecoration,backgroundColor:`${Gq} !important`,color:qq,padding:vq.insertedLinePadding,borderRadius:vq.borderRadious,border:`1px solid ${qq}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:vq.deletedTextDecoration,backgroundColor:Kq,color:Jq,padding:vq.insertedLinePadding,borderRadius:vq.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:vq.deletedTextDecoration,backgroundColor:`${Kq} !important`,color:Jq,padding:vq.insertedLinePadding,borderRadius:vq.borderRadious,border:`1px solid ${Jq}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:Bq,border:`1px solid ${Dq}`,borderRadius:Tq.borderRadius,padding:Tq.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:Bq,border:`none`},"& > ul > li":{padding:Tq.padding,lineHeight:Tq.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:Vq,color:Oq,borderRadius:Tq.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:Dq,paddingRight:Tq.paddingRight},"& > ul > li > span.cm-completionDetail":{color:Dq,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Bq,borderBottomColor:Bq},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${Lq}`},"&-warning":{borderLeft:`3px solid ${Uq}`},"&-info":{borderLeft:`3px solid ${Wq}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${Lq}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${Uq}`},".cm-matchingBracket":{backgroundColor:c_e,outline:`1px solid ${l_e}`,borderRadius:xq.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${a_e}20`,outline:`1px solid ${Lq}`,borderRadius:xq.borderRadius},".cm-selectionMatch":{backgroundColor:s_e,outline:`1px solid ${Eq}50`,borderRadius:xq.borderRadius},".cm-foldPlaceholder":{backgroundColor:Bq,color:Dq,border:`1px dotted ${Dq}70`,borderRadius:Sq.borderRadius,padding:Sq.padding,margin:Sq.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${zq}, 0 0 0 3px ${Fq}40`},"& .cm-scroller::-webkit-scrollbar":{width:Cq.width,height:Cq.height},"& .cm-scroller::-webkit-scrollbar-track":{background:Rq},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:Eq,borderRadius:Cq.borderRadius,border:`3px solid ${Rq}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:Dq},".cm-ghostText":{opacity:`0.5`,color:Dq}},{dark:!0}),D(B.define([{tag:A.keyword,color:Iq,fontWeight:`bold`},{tag:A.controlKeyword,color:Iq,fontWeight:`bold`},{tag:A.moduleKeyword,color:Iq,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:Oq},{tag:[A.variableName],color:Oq},{tag:[A.propertyName],color:Fq,fontStyle:`normal`},{tag:[A.typeName],color:Pq},{tag:[A.className],color:Mq,fontStyle:`italic`},{tag:[A.namespace],color:Fq,fontStyle:`italic`},{tag:[A.operator,A.operatorKeyword],color:Iq},{tag:[A.bracket],color:Dq},{tag:[A.brace],color:Dq},{tag:[A.punctuation],color:Dq},{tag:[A.function(A.variableName)],color:Fq},{tag:[A.labelName],color:Fq,fontStyle:`italic`},{tag:[A.definition(A.function(A.variableName))],color:Fq},{tag:[A.definition(A.variableName)],color:Oq},{tag:A.number,color:jq},{tag:A.changed,color:jq},{tag:A.annotation,color:Lq,fontStyle:`italic`},{tag:A.modifier,color:jq,fontStyle:`italic`},{tag:A.self,color:jq},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:Iq},{tag:[A.atom,A.bool,A.special(A.variableName)],color:jq},{tag:[A.processingInstruction,A.inserted],color:Nq},{tag:[A.special(A.string),A.regexp],color:`#b4f9f8`},{tag:A.string,color:Nq},{tag:A.definition(A.typeName),color:Pq,fontWeight:`bold`},{tag:[A.definition(A.name),A.separator],color:Oq},{tag:A.meta,color:Dq},{tag:A.comment,fontStyle:`italic`,color:Dq},{tag:A.docComment,fontStyle:`italic`,color:Dq},{tag:[A.tagName],color:Iq},{tag:[A.attributeName],color:Mq},{tag:[A.heading],fontWeight:`bold`,color:`#89ddff`},{tag:A.heading1,color:`#89ddff`,fontWeight:`bold`},{tag:A.heading2,color:`#89ddff`},{tag:A.heading3,color:`#89ddff`},{tag:A.heading4,color:`#89ddff`},{tag:A.heading5,color:`#89ddff`},{tag:A.heading6,color:`#89ddff`},{tag:[A.strong],fontWeight:`bold`,color:Oq},{tag:[A.emphasis],fontStyle:`italic`,color:Pq},{tag:[A.link],color:u_e,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:Wq,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:Oq,textDecoration:`underline wavy`,borderBottom:`1px wavy ${Lq}`},{tag:[A.strikethrough],color:Lq,textDecoration:`line-through`},{tag:A.constant(A.name),color:jq},{tag:A.deleted,color:Lq},{tag:A.squareBracket,color:Dq},{tag:A.angleBracket,color:Dq},{tag:A.monospace,color:Oq},{tag:[A.contentSeparator],color:Fq},{tag:A.quote,color:Dq}]))],Yq={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},f_e={borderLeftWidth:`2px`},Xq={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},Zq={paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},Qq={borderRadius:`4px`,padding:`2px 10px`},p_e={borderRadius:`2px`},$q={borderRadius:`2px`},eJ={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},tJ={width:`12px`,height:`12px`,borderRadius:`6px`},nJ={borderRadius:`4px`,padding:`2px 6px`},rJ={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},m_e=`#1e1e1e`,iJ=`#252526`,aJ=`#2d2d30`,oJ=`#838383`,h_e=`#c6c6c6`,sJ=`#d4d4d4`,cJ=`#e9e9e9`,g_e=`#1c1c1c`,lJ=`#569cd6`,__e=`#c586c0`,uJ=`#9cdcfe`,dJ=`#4ec9b0`,fJ=`#dcdcaa`,v_e=`#b5cea8`,pJ=`#ce9178`,mJ=`#f44747`,hJ=`#d7ba7d`,gJ=`#6a9955`,_J=mJ,vJ=`#FFFFFF08`,yJ=m_e,bJ=iJ,y_e=`#264F7899`,b_e=`#72a1ff59`,xJ=h_e,x_e=`#ffffff15`,S_e=lJ,SJ=hJ,CJ=`#3794ff`,C_e=`#c586c0`,wJ=`#1e3f1e80`,TJ=`#4b1c1c80`,EJ=`#6cc26f`,DJ=`#f14c4c`,w_e=[I.theme({"&":{color:sJ,backgroundColor:yJ,fontSize:Yq.fontSize,fontFamily:Yq.fontFamily},".cm-content":{caretColor:xJ,lineHeight:Yq.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:xJ,borderLeftWidth:f_e.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${xJ}99`,color:yJ},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:y_e},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#72a1ff40`,outline:`1px solid ${lJ}90`,color:cJ,borderRadius:nJ.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#3794ff90`,color:cJ,padding:nJ.padding,"& span":{color:cJ}},".cm-search.cm-panel.cm-textfield":{color:sJ,borderRadius:nJ.borderRadius,padding:nJ.padding},".cm-panels":{backgroundColor:iJ,color:sJ,borderRadius:`3px`,boxShadow:`0 2px 6px rgba(0, 0, 0, 0.45)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${aJ}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${aJ}`},".cm-panel button":{backgroundColor:aJ,color:sJ,border:`1px solid ${aJ}`,borderRadius:Qq.borderRadius,padding:Qq.padding},".cm-panel button:hover":{backgroundColor:`#3a3a3a`,border:`1px solid ${oJ}80`},".cm-activeLine":{backgroundColor:vJ,borderRadius:p_e.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:g_e,color:oJ,border:`none`,borderRight:`1px solid ${aJ}`,paddingRight:Zq.paddingRight},".cm-activeLineGutter":{backgroundColor:vJ,color:cJ,fontWeight:Zq.fontWeight},".cm-lineNumbers":{fontSize:Zq.fontSize,lineHeight:Zq.lineHeight},".cm-foldGutter":{fontSize:Zq.fontSize,lineHeight:Zq.lineHeight},".cm-foldGutter .cm-gutterElement":{color:oJ,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:cJ},".cm-insertedLine":{textDecoration:Xq.insertedTextDecoration,backgroundColor:wJ,color:EJ,padding:Xq.insertedLinePadding,borderRadius:Xq.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:Xq.insertedTextDecoration,backgroundColor:`${wJ} !important`,color:EJ,padding:Xq.insertedLinePadding,borderRadius:Xq.borderRadious,border:`1px solid ${EJ}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:Xq.deletedTextDecoration,backgroundColor:TJ,color:DJ,padding:Xq.insertedLinePadding,borderRadius:Xq.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:Xq.deletedTextDecoration,backgroundColor:`${TJ} !important`,color:DJ,padding:Xq.insertedLinePadding,borderRadius:Xq.borderRadious,border:`1px solid ${DJ}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:bJ,border:`1px solid ${aJ}`,borderRadius:rJ.borderRadius,padding:rJ.padding,boxShadow:`0 3px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:bJ,border:`none`,maxHeight:`300px`},"& > ul > li":{padding:rJ.padding,lineHeight:rJ.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:`#04395e`,color:cJ,borderRadius:rJ.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:oJ,paddingRight:rJ.paddingRight},"& > ul > li > span.cm-completionDetail":{color:oJ,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:bJ,borderBottomColor:bJ},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${_J}`},"&-warning":{borderLeft:`3px solid ${SJ}`},"&-info":{borderLeft:`3px solid ${CJ}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${_J}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${SJ}`},".cm-matchingBracket":{backgroundColor:x_e,outline:`1px solid ${S_e}80`,borderRadius:$q.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${mJ}40`,outline:`1px solid ${_J}`,borderRadius:$q.borderRadius},".cm-selectionMatch":{backgroundColor:b_e,outline:`1px solid ${aJ}70`,borderRadius:$q.borderRadius},".cm-foldPlaceholder":{backgroundColor:bJ,color:oJ,border:`1px dotted ${oJ}70`,borderRadius:eJ.borderRadius,padding:eJ.padding,margin:eJ.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 1px ${aJ}`},"& .cm-scroller::-webkit-scrollbar":{width:tJ.width,height:tJ.height},"& .cm-scroller::-webkit-scrollbar-track":{background:yJ},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:`#424242`,borderRadius:tJ.borderRadius,border:`3px solid ${yJ}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:`#525252`},".cm-ghostText":{opacity:`0.5`,color:oJ}},{dark:!0}),D(B.define([{tag:A.keyword,color:lJ,fontWeight:`bold`},{tag:A.controlKeyword,color:__e,fontWeight:`bold`},{tag:A.moduleKeyword,color:lJ,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:sJ},{tag:[A.variableName],color:uJ},{tag:[A.propertyName],color:uJ,fontStyle:`normal`},{tag:[A.typeName],color:dJ},{tag:[A.className],color:dJ,fontStyle:`normal`},{tag:[A.namespace],color:sJ,fontStyle:`normal`},{tag:[A.operator,A.operatorKeyword],color:sJ},{tag:[A.bracket],color:sJ},{tag:[A.brace],color:sJ},{tag:[A.punctuation],color:sJ},{tag:[A.function(A.variableName)],color:fJ},{tag:[A.labelName],color:fJ,fontStyle:`normal`},{tag:[A.definition(A.function(A.variableName))],color:fJ},{tag:[A.definition(A.variableName)],color:uJ},{tag:A.number,color:v_e},{tag:A.changed,color:hJ},{tag:A.annotation,color:hJ,fontStyle:`italic`},{tag:A.modifier,color:lJ,fontStyle:`normal`},{tag:A.self,color:lJ},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:uJ},{tag:[A.atom,A.bool,A.special(A.variableName)],color:lJ},{tag:[A.processingInstruction,A.inserted],color:pJ},{tag:[A.special(A.string),A.regexp],color:`#d16969`},{tag:A.string,color:pJ},{tag:A.definition(A.typeName),color:dJ,fontWeight:`bold`},{tag:[A.definition(A.name),A.separator],color:sJ},{tag:A.meta,color:oJ},{tag:A.comment,fontStyle:`italic`,color:gJ},{tag:A.docComment,fontStyle:`italic`,color:gJ},{tag:[A.tagName],color:lJ},{tag:[A.attributeName],color:uJ},{tag:[A.heading],fontWeight:`bold`,color:lJ},{tag:A.heading1,color:lJ,fontWeight:`bold`},{tag:A.heading2,color:lJ},{tag:A.heading3,color:lJ},{tag:A.heading4,color:lJ},{tag:A.heading5,color:lJ},{tag:A.heading6,color:lJ},{tag:[A.strong],fontWeight:`bold`,color:lJ},{tag:[A.emphasis],fontStyle:`italic`,color:dJ},{tag:[A.link],color:C_e,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:CJ,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:sJ,textDecoration:`underline wavy`,borderBottom:`1px wavy ${_J}`},{tag:[A.strikethrough],color:_J,textDecoration:`line-through`},{tag:A.constant(A.name),color:uJ},{tag:A.deleted,color:_J},{tag:A.squareBracket,color:sJ},{tag:A.angleBracket,color:sJ},{tag:A.monospace,color:sJ},{tag:[A.contentSeparator],color:sJ},{tag:A.quote,color:gJ}]))],OJ={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},T_e={borderLeftWidth:`2px`},kJ={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},AJ={paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},jJ={borderRadius:`4px`,padding:`2px 10px`},E_e={borderRadius:`2px`},MJ={borderRadius:`2px`},NJ={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},PJ={width:`12px`,height:`12px`,borderRadius:`6px`},FJ={borderRadius:`4px`,padding:`2px 6px`},IJ={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},D_e=`#ffffff`,LJ=`#f3f3f3`,RJ=`#d6d6d6`,zJ=`#6b6b6b`,O_e=`#000000`,BJ=`#383a42`,VJ=`#1f1f1f`,k_e=`#f5f5f5`,HJ=`#0064ff`,UJ=`#af00db`,WJ=`#0070c1`,GJ=`#267f99`,KJ=`#795e26`,A_e=`#098658`,qJ=`#a31515`,JJ=`#e51400`,YJ=`#795e26`,XJ=`#008000`,ZJ=JJ,QJ=`#99999926`,$J=D_e,eY=LJ,j_e=`#add6ff`,M_e=`#a8ac9480`,tY=O_e,N_e=`#007acc20`,P_e=`#007acc`,nY=`#bf8803`,rY=`#006ab1`,F_e=`#9e46d0`,iY=`#ddfbe0`,aY=`#ffebec`,oY=`#22863a`,sY=`#e51400`,I_e=[I.theme({"&":{color:BJ,backgroundColor:$J,fontSize:OJ.fontSize,fontFamily:OJ.fontFamily},".cm-content":{caretColor:tY,lineHeight:OJ.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:tY,borderLeftWidth:T_e.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${tY}99`,color:$J},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:j_e},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#bbdefb`,outline:`1px solid ${WJ}90`,color:VJ,borderRadius:FJ.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#90caf9`,color:VJ,padding:FJ.padding,"& span":{color:VJ}},".cm-search.cm-panel.cm-textfield":{color:BJ,borderRadius:FJ.borderRadius,padding:FJ.padding},".cm-panels":{backgroundColor:LJ,color:BJ,borderRadius:`3px`,boxShadow:`0 2px 6px rgba(0, 0, 0, 0.15)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${RJ}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${RJ}`},".cm-panel button":{backgroundColor:$J,color:BJ,border:`1px solid ${RJ}`,borderRadius:jJ.borderRadius,padding:jJ.padding},".cm-panel button:hover":{backgroundColor:`#e8e8e8`,border:`1px solid ${zJ}80`},".cm-activeLine":{backgroundColor:QJ,borderRadius:E_e.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:k_e,color:`#237893`,border:`none`,borderRight:`1px solid ${RJ}`,paddingRight:AJ.paddingRight},".cm-activeLineGutter":{backgroundColor:QJ,color:`#0b216f`,fontWeight:AJ.fontWeight},".cm-lineNumbers":{fontSize:AJ.fontSize,lineHeight:AJ.lineHeight},".cm-foldGutter":{fontSize:AJ.fontSize,lineHeight:AJ.lineHeight},".cm-foldGutter .cm-gutterElement":{color:`#237893`,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:`#0b216f`},".cm-insertedLine":{textDecoration:kJ.insertedTextDecoration,backgroundColor:iY,color:oY,padding:kJ.insertedLinePadding,borderRadius:kJ.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:kJ.insertedTextDecoration,backgroundColor:`${iY} !important`,color:oY,padding:kJ.insertedLinePadding,borderRadius:kJ.borderRadious,border:`1px solid ${oY}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:kJ.deletedTextDecoration,backgroundColor:aY,color:sY,padding:kJ.insertedLinePadding,borderRadius:kJ.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:kJ.deletedTextDecoration,backgroundColor:`${aY} !important`,color:sY,padding:kJ.insertedLinePadding,borderRadius:kJ.borderRadious,border:`1px solid ${sY}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:eY,border:`1px solid ${RJ}`,borderRadius:IJ.borderRadius,padding:IJ.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:eY,border:`none`,maxHeight:`300px`},"& > ul > li":{padding:IJ.padding,lineHeight:IJ.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:`#dcebfc`,color:VJ,borderRadius:IJ.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:zJ,paddingRight:IJ.paddingRight},"& > ul > li > span.cm-completionDetail":{color:zJ,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:eY,borderBottomColor:eY},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${ZJ}`},"&-warning":{borderLeft:`3px solid ${nY}`},"&-info":{borderLeft:`3px solid ${rY}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${ZJ}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${nY}`},".cm-matchingBracket":{backgroundColor:N_e,outline:`1px solid ${P_e}80`,borderRadius:MJ.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${JJ}20`,outline:`1px solid ${ZJ}`,borderRadius:MJ.borderRadius},".cm-selectionMatch":{backgroundColor:M_e,outline:`1px solid ${RJ}70`,borderRadius:MJ.borderRadius},".cm-foldPlaceholder":{backgroundColor:eY,color:zJ,border:`1px dotted ${zJ}70`,borderRadius:NJ.borderRadius,padding:NJ.padding,margin:NJ.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 1px ${RJ}`},"& .cm-scroller::-webkit-scrollbar":{width:PJ.width,height:PJ.height},"& .cm-scroller::-webkit-scrollbar-track":{background:$J},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:`#dadada`,borderRadius:PJ.borderRadius,border:`3px solid ${$J}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:`#cccccc`},".cm-ghostText":{opacity:`0.5`,color:zJ}},{dark:!1}),D(B.define([{tag:A.keyword,color:HJ,fontWeight:`bold`},{tag:A.controlKeyword,color:UJ,fontWeight:`bold`},{tag:A.moduleKeyword,color:HJ,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:BJ},{tag:[A.variableName],color:WJ},{tag:[A.propertyName],color:WJ,fontStyle:`normal`},{tag:[A.typeName],color:GJ},{tag:[A.className],color:GJ,fontStyle:`normal`},{tag:[A.namespace],color:BJ,fontStyle:`normal`},{tag:[A.operator,A.operatorKeyword],color:BJ},{tag:[A.bracket],color:BJ},{tag:[A.brace],color:BJ},{tag:[A.punctuation],color:BJ},{tag:[A.function(A.variableName)],color:KJ},{tag:[A.labelName],color:KJ,fontStyle:`normal`},{tag:[A.definition(A.function(A.variableName))],color:KJ},{tag:[A.definition(A.variableName)],color:WJ},{tag:A.number,color:A_e},{tag:A.changed,color:YJ},{tag:A.annotation,color:YJ,fontStyle:`italic`},{tag:A.modifier,color:HJ,fontStyle:`normal`},{tag:A.self,color:HJ},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:WJ},{tag:[A.atom,A.bool,A.special(A.variableName)],color:HJ},{tag:[A.processingInstruction,A.inserted],color:qJ},{tag:[A.special(A.string),A.regexp],color:UJ},{tag:A.string,color:qJ},{tag:A.definition(A.typeName),color:GJ,fontWeight:`bold`},{tag:[A.definition(A.name),A.separator],color:BJ},{tag:A.meta,color:zJ},{tag:A.comment,fontStyle:`italic`,color:XJ},{tag:A.docComment,fontStyle:`italic`,color:XJ},{tag:[A.tagName],color:HJ},{tag:[A.attributeName],color:WJ},{tag:[A.heading],fontWeight:`bold`,color:HJ},{tag:A.heading1,color:HJ,fontWeight:`bold`},{tag:A.heading2,color:HJ},{tag:A.heading3,color:HJ},{tag:A.heading4,color:HJ},{tag:A.heading5,color:HJ},{tag:A.heading6,color:HJ},{tag:[A.strong],fontWeight:`bold`,color:HJ},{tag:[A.emphasis],fontStyle:`italic`,color:WJ},{tag:[A.link],color:F_e,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:rY,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:BJ,textDecoration:`underline wavy`,borderBottom:`1px wavy ${ZJ}`},{tag:[A.strikethrough],color:ZJ,textDecoration:`line-through`},{tag:A.constant(A.name),color:WJ},{tag:A.deleted,color:ZJ},{tag:A.squareBracket,color:BJ},{tag:A.angleBracket,color:BJ},{tag:A.monospace,color:BJ},{tag:[A.contentSeparator],color:BJ},{tag:A.quote,color:XJ}]))];function cY(){return cY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cY.apply(null,arguments)}function L_e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var lY=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,uY=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(lY(e)):lY,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Re(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=ve(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=P(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n;;e++){let a=r.charCodeAt(e),o=this.match(a,i,this.bufferPos+this.bufferStart);if(e==r.length-1){if(o)return this.value=o,this;break}i==n&&e<t.length&&t.charCodeAt(e)==a&&i++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let i=this.matches[t],a=!1;this.query.charCodeAt(i)==e&&(i==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,a=!0)),a||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}};typeof Symbol<`u`&&(uY.prototype[Symbol.iterator]=function(){return this});var dY={from:-1,to:-1,match:/.*/.exec(``)},fY=`gm`+(/x/.unicode==null?``:`u`),pY=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=dY,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new gY(e,t,n,r,i);this.re=new RegExp(t,fY+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter(),this.curLineStart=e.lineAt(r).from,this.matchPos=_Y(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=_Y(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},mY=new WeakMap,hY=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=mY.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return mY.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),mY.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},gY=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=dY,this.matchPos=_Y(e,r),this.re=new RegExp(t,fY+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=hY.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=_Y(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=hY.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(pY.prototype[Symbol.iterator]=gY.prototype[Symbol.iterator]=function(){return this});function R_e(e){try{return new RegExp(e,fY),!0}catch{return!1}}function _Y(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}function vY(e){let t=je(`input`,{class:`cm-textfield`,name:`line`,value:String(e.state.doc.lineAt(e.state.selection.main.head).number)}),n=je(`form`,{class:`cm-gotoLine`,onkeydown:t=>{t.keyCode==27?(t.preventDefault(),e.dispatch({effects:yY.of(!1)}),e.focus()):t.keyCode==13&&(t.preventDefault(),r())},onsubmit:e=>{e.preventDefault(),r()}},je(`label`,e.state.phrase(`Go to line`),`: `,t),` `,je(`button`,{class:`cm-button`,type:`submit`},e.state.phrase(`go`)),je(`button`,{name:`close`,onclick:()=>{e.dispatch({effects:yY.of(!1)}),e.focus()},"aria-label":e.state.phrase(`close`),type:`button`},[`×`]));function r(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:r}=e,i=r.doc.lineAt(r.selection.main.head),[,a,o,s,c]=n,l=s?+s.slice(1):0,u=o?+o:i.number;if(o&&c){let e=u/100;a&&(e=e*(a==`-`?-1:1)+i.number/r.doc.lines),u=Math.round(r.doc.lines*e)}else o&&a&&(u=u*(a==`-`?-1:1)+i.number);let d=r.doc.line(Math.max(1,Math.min(r.doc.lines,u))),f=le.cursor(d.from+Math.max(0,Math.min(l,d.length)));e.dispatch({effects:[yY.of(!1),I.scrollIntoView(f.from,{y:`center`})],selection:f}),e.focus()}return{dom:n}}var yY=V.define(),bY=Be.define({create(){return!0},update(e,t){for(let n of t.effects)n.is(yY)&&(e=n.value);return e},provide:e=>ne.from(e,e=>e?vY:null)}),z_e=e=>{let t=De(e,vY);if(!t){let n=[yY.of(!0)];e.state.field(bY,!1)??n.push(V.appendConfig.of([bY,B_e])),e.dispatch({effects:n}),t=De(e,vY)}return t&&t.dom.querySelector(`input`).select(),!0},B_e=I.baseTheme({".cm-panel.cm-gotoLine":{padding:`2px 6px 4px`,position:`relative`,"& label":{fontSize:`80%`},"& [name=close]":{position:`absolute`,top:`0`,bottom:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:`0`}}}),V_e={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},xY=xe.define({combine(e){return f(e,V_e,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function H_e(e){let t=[q_e,K_e];return e&&t.push(xY.of(e)),t}var U_e=Ve.mark({class:`cm-selectionMatch`}),W_e=Ve.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function SY(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=oe.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=oe.Word)}function G_e(e,t,n,r){return e(t.sliceDoc(n,n+1))==oe.Word&&e(t.sliceDoc(r-1,r))==oe.Word}var K_e=g.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(xY),{state:n}=e,r=n.selection;if(r.ranges.length>1)return Ve.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return Ve.none;let e=n.wordAt(i.head);if(!e)return Ve.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return Ve.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(SY(o,n,i.from,i.to)&&G_e(o,n,i.from,i.to)))return Ve.none}else if(a=n.sliceDoc(i.from,i.to),!a)return Ve.none}let s=[];for(let r of e.visibleRanges){let e=new uY(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||SY(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(W_e.range(r,a)):(r>=i.to||a<=i.from)&&s.push(U_e.range(r,a)),s.length>t.maxMatches))return Ve.none}}return Ve.set(s)}},{decorations:e=>e.decorations}),q_e=I.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),J_e=({state:e,dispatch:t})=>{let{selection:n}=e,r=le.create(n.ranges.map(t=>e.wordAt(t.head)||le.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function Y_e(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new uY(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new uY(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var X_e=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return J_e({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=Y_e(e,r);return i?(t(e.update({selection:e.selection.addRange(le.range(i.from,i.to),!1),effects:I.scrollIntoView(i.to)})),!0):!1},CY=xe.define({combine(e){return f(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new cve(e),scrollToMatch:e=>I.scrollIntoView(e)})}}),wY=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||R_e(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
353
+ `;)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(ge.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),i=e.absoluteLineStart,a=i,o=e.block.children.length,s=a,c=o;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=ZI(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new v(e.parser.nodeSet.types[Y.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is(`Block`)&&(ahe.indexOf(t.type.id)<0?(a=t.to-n,o=e.block.children.length):(a=s,o=c,s=t.to-n,c=e.block.children.length)),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function ZI(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,a=t[r].from;i<e&&(n-=a-i)}return n}var she=b({"Blockquote/...":A.quote,HorizontalRule:A.contentSeparator,"ATXHeading1/... SetextHeading1/...":A.heading1,"ATXHeading2/... SetextHeading2/...":A.heading2,"ATXHeading3/...":A.heading3,"ATXHeading4/...":A.heading4,"ATXHeading5/...":A.heading5,"ATXHeading6/...":A.heading6,"Comment CommentBlock":A.comment,Escape:A.escape,Entity:A.character,"Emphasis/...":A.emphasis,"StrongEmphasis/...":A.strong,"Link/... Image/...":A.link,"OrderedList/... BulletList/...":A.list,"BlockQuote/...":A.quote,"InlineCode CodeText":A.monospace,"URL Autolink":A.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":A.processingInstruction,"CodeInfo LinkLabel":A.labelName,LinkTitle:A.string,Paragraph:A.content}),che=new kI(new C(NI).extend(she),Object.keys(TI).map(e=>TI[e]),Object.keys(TI).map(e=>DI[e]),Object.keys(TI),ehe,oI,Object.keys(GI).map(e=>GI[e]),Object.keys(GI),[]);function lhe(e,t,n){let r=[];for(let i=e.firstChild,a=t;;i=i.nextSibling){let e=i?i.from:n;if(e>a&&r.push({from:a,to:e}),!i)break;a=i.to}return r}function uhe(e){let{codeParser:t,htmlParser:n}=e;return{wrap:x((e,r)=>{let i=e.type.id;if(t&&(i==Y.CodeBlock||i==Y.FencedCode)){let n=``;if(i==Y.FencedCode){let t=e.node.getChild(Y.CodeInfo);t&&(n=r.read(t.from,t.to))}let a=t(n);if(a)return{parser:a,overlay:e=>e.type.id==Y.CodeText}}else if(n&&(i==Y.HTMLBlock||i==Y.HTMLTag||i==Y.CommentBlock))return{parser:n,overlay:lhe(e.node,e.from,e.to)};return null})}}var dhe={resolve:`Strikethrough`,mark:`StrikethroughMark`},fhe={defineNodes:[{name:`Strikethrough`,style:{"Strikethrough/...":A.strikethrough}},{name:`StrikethroughMark`,style:A.processingInstruction}],parseInline:[{name:`Strikethrough`,parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),a=/\s|^$/.test(r),o=/\s|^$/.test(i),s=WI.test(r),c=WI.test(i);return e.addDelimiter(dhe,n,n+2,!o&&(!c||a||s),!a&&(!s||o||c))},after:`Emphasis`}]};function QI(e,t,n=0,r,i=0){let a=0,o=!0,s=-1,c=-1,l=!1,u=()=>{r.push(e.elt(`TableCell`,i+s,i+c,e.parser.parseInline(t.slice(s,c),i+s)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);n==124&&!l?((!o||s>-1)&&a++,o=!1,r&&(s>-1&&u(),r.push(e.elt(`TableDelimiter`,d+i,d+i+1))),s=c=-1):(l||n!=32&&n!=9)&&(s<0&&(s=d),c=d+1),l=!l&&n==92}return s>-1&&(a++,r&&u()),a}function $I(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(t==124)return!0;t==92&&n++}return!1}var eL=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,tL=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&eL.test(r=t.text.slice(t.pos))){let i=[];QI(e,n.content,0,i,n.start)==QI(e,r,t.pos)&&(this.rows=[e.elt(`TableHeader`,n.start,n.start+n.content.length,i),e.elt(`TableDelimiter`,e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];QI(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt(`TableRow`,e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(`Table`,t.start,t.start+t.content.length,this.rows)),!0):!1}},phe={defineNodes:[{name:`Table`,block:!0},{name:`TableHeader`,style:{"TableHeader/...":A.heading}},`TableRow`,{name:`TableCell`,style:A.content},{name:`TableDelimiter`,style:A.processingInstruction}],parseBlock:[{name:`Table`,leaf(e,t){return $I(t.content,0)?new tL:null},endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof tL)||!$I(t.text,t.basePos))return!1;let r=e.peekLine();return eL.test(r)&&QI(e,t.text,t.basePos)==QI(e,r,t.basePos)},before:`SetextHeading`}]},mhe=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(`Task`,t.start,t.start+t.content.length,[e.elt(`TaskMarker`,t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},hhe={defineNodes:[{name:`Task`,block:!0,style:A.list},{name:`TaskMarker`,style:A.atom}],parseBlock:[{name:`TaskList`,leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name==`ListItem`?new mhe:null},after:`SetextHeading`}]},nL=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,rL=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,ghe=/[\w-]+\.[\w-]+($|\/)/,iL=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,aL=/\/[a-zA-Z\d@.]+/gy;function oL(e,t,n,r){let i=0;for(let a=t;a<n;a++)e[a]==r&&i++;return i}function _he(e,t){rL.lastIndex=t;let n=rL.exec(e);if(!n||ghe.exec(n[0])[0].indexOf(`_`)>-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],i;if(/[?!.,:*_~]/.test(n)||n==`)`&&oL(e,t,r,`)`)>oL(e,t,r,`(`))r--;else if(n==`;`&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function sL(e,t){iL.lastIndex=t;let n=iL.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r==`_`||r==`-`?-1:t+n[0].length-(r==`.`?1:0)}var vhe=[phe,hhe,fhe,{parseInline:[{name:`Autolink`,parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;nL.lastIndex=r;let i=nL.exec(e.text),a=-1;return!i||(i[1]||i[2]?(a=_he(e.text,r+i[0].length),a>-1&&e.hasOpenLink&&(a=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,a))[0].length)):i[3]?a=sL(e.text,r):(a=sL(e.text,r+i[0].length),a>-1&&i[0]==`xmpp:`&&(aL.lastIndex=a,i=aL.exec(e.text),i&&(a=i.index+i[0].length))),a<0)?-1:(e.addElement(e.elt(`URL`,n,a+e.offset)),a+e.offset)}}]}];function cL(e,t,n){return(r,i,a)=>{if(i!=e||r.char(a+1)==e)return-1;let o=[r.elt(n,a,a+1)];for(let i=a+1;i<r.end;i++){let s=r.char(i);if(s==e)return r.addElement(r.elt(t,a,i+1,o.concat(r.elt(n,i,i+1))));if(s==92&&o.push(r.elt(`Escape`,i,i+++2)),sI(s))break}return-1}}var yhe={defineNodes:[{name:`Superscript`,style:A.special(A.content)},{name:`SuperscriptMark`,style:A.processingInstruction}],parseInline:[{name:`Superscript`,parse:cL(94,`Superscript`,`SuperscriptMark`)}]},bhe={defineNodes:[{name:`Subscript`,style:A.special(A.content)},{name:`SubscriptMark`,style:A.processingInstruction}],parseInline:[{name:`Subscript`,parse:cL(126,`Subscript`,`SubscriptMark`)}]},xhe={defineNodes:[{name:`Emoji`,style:A.character}],parseInline:[{name:`Emoji`,parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt(`Emoji`,n,n+1+r[0].length))}}]},She=55,Che=1,whe=56,The=2,Ehe=57,Dhe=3,lL=4,Ohe=5,uL=6,dL=7,fL=8,pL=9,mL=10,khe=11,Ahe=12,jhe=13,hL=58,Mhe=14,Nhe=15,gL=59,_L=21,Phe=23,vL=24,Fhe=25,yL=27,bL=28,Ihe=29,Lhe=32,Rhe=35,zhe=37,Bhe=38,Vhe=0,Hhe=1,Uhe={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},Whe={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},xL={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function Ghe(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}var SL=null,CL=null,wL=0;function TL(e,t){let n=e.pos+t;if(wL==n&&CL==e)return SL;let r=e.peek(t),i=``;for(;Ghe(r);)i+=String.fromCharCode(r),r=e.peek(++t);return CL=e,wL=n,SL=i?i.toLowerCase():r==Khe||r==qhe?void 0:null}var EL=60,DL=62,OL=47,Khe=63,qhe=33,Jhe=45;function kL(e,t){this.name=e,this.parent=t}var Yhe=[uL,mL,dL,fL,pL],Xhe=new Me({start:null,shift(e,t,n,r){return Yhe.indexOf(t)>-1?new kL(TL(r,1)||``,e):e},reduce(e,t){return t==_L&&e?e.parent:e},reuse(e,t,n,r){let i=t.type.id;return i==uL||i==zhe?new kL(TL(r,1)||``,e):e},strict:!1}),Zhe=new Se((e,t)=>{if(e.next!=EL){e.next<0&&t.context&&e.acceptToken(hL);return}e.advance();let n=e.next==OL;n&&e.advance();let r=TL(e,0);if(r===void 0)return;if(!r)return e.acceptToken(n?Nhe:Mhe);let i=t.context?t.context.name:null;if(n){if(r==i)return e.acceptToken(khe);if(i&&Whe[i])return e.acceptToken(hL,-2);if(t.dialectEnabled(Vhe))return e.acceptToken(Ahe);for(let e=t.context;e;e=e.parent)if(e.name==r)return;e.acceptToken(jhe)}else{if(r==`script`)return e.acceptToken(dL);if(r==`style`)return e.acceptToken(fL);if(r==`textarea`)return e.acceptToken(pL);if(Uhe.hasOwnProperty(r))return e.acceptToken(mL);i&&xL[i]&&xL[i][r]?e.acceptToken(hL,-1):e.acceptToken(uL)}},{contextual:!0}),Qhe=new Se(e=>{for(let t=0,n=0;;n++){if(e.next<0){n&&e.acceptToken(gL);break}if(e.next==Jhe)t++;else if(e.next==DL&&t>=2){n>=3&&e.acceptToken(gL,-2);break}else t=0;e.advance()}});function $he(e){for(;e;e=e.parent)if(e.name==`svg`||e.name==`math`)return!0;return!1}var ege=new Se((e,t)=>{if(e.next==OL&&e.peek(1)==DL){let n=t.dialectEnabled(Hhe)||$he(t.context);e.acceptToken(n?Ohe:lL,2)}else e.next==DL&&e.acceptToken(lL,1)});function AL(e,t,n){let r=2+e.length;return new Se(i=>{for(let a=0,o=0,s=0;;s++){if(i.next<0){s&&i.acceptToken(t);break}if(a==0&&i.next==EL||a==1&&i.next==OL||a>=2&&a<r&&i.next==e.charCodeAt(a-2))a++,o++;else if(a==r&&i.next==DL){s>o?i.acceptToken(t,-o):i.acceptToken(n,-(o-2));break}else if((i.next==10||i.next==13)&&s){i.acceptToken(t,1);break}else a=o=0;i.advance()}})}var tge=AL(`script`,She,Che),nge=AL(`style`,whe,The),rge=AL(`textarea`,Ehe,Dhe),ige=b({"Text RawText IncompleteTag IncompleteCloseTag":A.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":A.angleBracket,TagName:A.tagName,"MismatchedCloseTag/TagName":[A.tagName,A.invalid],AttributeName:A.attributeName,"AttributeValue UnquotedAttributeValue":A.attributeValue,Is:A.definitionOperator,"EntityReference CharacterReference":A.character,Comment:A.blockComment,ProcessingInst:A.processingInstruction,DoctypeDecl:A.documentMeta}),age=Oe.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:`,c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~`,goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:`⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl`,maxTerm:68,context:Xhe,nodeProps:[[`closedBy`,-10,1,2,3,7,8,9,10,11,12,13,`EndTag`,6,`EndTag SelfClosingEndTag`,-4,22,31,34,37,`CloseTag`],[`openedBy`,4,`StartTag StartCloseTag`,5,`StartTag`,-4,30,33,36,38,`OpenTag`],[`group`,-10,14,15,18,19,20,21,40,41,42,43,`Entity`,17,`Entity TextContent`,-3,29,32,35,`TextContent Entity`],[`isolate`,-11,22,30,31,33,34,36,37,38,39,42,43,`ltr`,-3,27,28,40,``]],propSources:[ige],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!b`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!b`!dpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYlWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]`aP!b`!dp!_^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/ebiSlWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0rXiSqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0mS1bP;=`<%l0m[1hP;=`<%l/^!V1vciSaP!b`!dpOq&Xqr1krs&}sv1kvw0mwx(tx!P1k!P!Q&X!Q!^1k!^!_*V!_!a&X!a#s1k#s$f&X$f;'S1k;'S;=`3R<%l?Ah1k?Ah?BY&X?BY?Mn1k?MnO&X!V3UP;=`<%l1k!_3[P;=`<%l-_!Z3hV!ahaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_4WiiSlWd!ROX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst>]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!V<QciSOp7Sqr;{rs7Sst0mtw;{wx7Sx!P;{!P!Q7S!Q!];{!]!^=]!^!a7S!a#s;{#s$f7S$f;'S;{;'S;=`>P<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[tge,nge,rge,ege,Zhe,Qhe,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function jL(e,t){let n=Object.create(null);for(let r of e.getChildren(vL)){let e=r.getChild(Fhe),i=r.getChild(yL)||r.getChild(bL);e&&(n[t.read(e.from,e.to)]=i?i.type.id==yL?t.read(i.from+1,i.to-1):t.read(i.from,i.to):``)}return n}function ML(e,t){let n=e.getChild(Phe);return n?t.read(n.from,n.to):` `}function NL(e,t,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||=jL(e.node.parent.firstChild,t)))return{parser:i.parser};return null}function PL(e=[],t=[]){let n=[],r=[],i=[],a=[];for(let t of e)(t.tag==`script`?n:t.tag==`style`?r:t.tag==`textarea`?i:a).push(t);let o=t.length?Object.create(null):null;for(let e of t)(o[e.name]||(o[e.name]=[])).push(e);return x((e,t)=>{let s=e.type.id;if(s==Ihe)return NL(e,t,n);if(s==Lhe)return NL(e,t,r);if(s==Rhe)return NL(e,t,i);if(s==_L&&a.length){let n=e.node,r=n.firstChild,i=r&&ML(r,t),o;if(i){for(let e of a)if(e.tag==i&&(!e.attrs||e.attrs(o||=jL(r,t)))){let t=n.lastChild,i=t.type.id==Bhe?t.from:n.to;if(i>r.to)return{parser:e.parser,overlay:[{from:r.to,to:i}]}}}}if(o&&s==vL){let n=e.node,r;if(r=n.firstChild){let e=o[t.read(r.from,r.to)];if(e)for(let r of e){if(r.tagName&&r.tagName!=ML(n.parent,t))continue;let e=n.lastChild;if(e.type.id==yL){let t=e.from+1,n=e.lastChild,i=e.to-(n&&n.isError?0:1);if(i>t)return{parser:r.parser,overlay:[{from:t,to:i}]}}else if(e.type.id==bL)return{parser:r.parser,overlay:[{from:e.from,to:e.to}]}}}}return null})}var oge=122,FL=1,sge=123,cge=124,IL=2,lge=125,uge=3,dge=4,LL=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],fge=58,pge=40,RL=95,mge=91,zL=45,hge=46,gge=35,_ge=37,vge=38,yge=92,bge=10,xge=42;function BL(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function VL(e){return e>=48&&e<=57}function HL(e){return VL(e)||e>=97&&e<=102||e>=65&&e<=70}var UL=(e,t,n)=>(r,i)=>{for(let a=!1,o=0,s=0;;s++){let{next:c}=r;if(BL(c)||c==zL||c==RL||a&&VL(c))!a&&(c!=zL||s>0)&&(a=!0),o===s&&c==zL&&o++,r.advance();else if(c==yge&&r.peek(1)!=bge){if(r.advance(),HL(r.next)){do r.advance();while(HL(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();a=!0}else{a&&r.acceptToken(o==2&&i.canShift(IL)?t:c==pge?n:e);break}}},Sge=new Se(UL(sge,IL,cge)),Cge=new Se(UL(lge,uge,dge)),wge=new Se(e=>{if(LL.includes(e.peek(-1))){let{next:t}=e;(BL(t)||t==RL||t==gge||t==hge||t==xge||t==mge||t==fge&&BL(e.peek(1))||t==zL||t==vge)&&e.acceptToken(oge)}}),Tge=new Se(e=>{if(!LL.includes(e.peek(-1))){let{next:t}=e;if(t==_ge&&(e.advance(),e.acceptToken(FL)),BL(t)){do e.advance();while(BL(e.next)||VL(e.next));e.acceptToken(FL)}}}),Ege=b({"AtKeyword import charset namespace keyframes media supports":A.definitionKeyword,"from to selector":A.keyword,NamespaceName:A.namespace,KeyframeName:A.labelName,KeyframeRangeName:A.operatorKeyword,TagName:A.tagName,ClassName:A.className,PseudoClassName:A.constant(A.className),IdName:A.labelName,"FeatureName PropertyName":A.propertyName,AttributeName:A.attributeName,NumberLiteral:A.number,KeywordQuery:A.keyword,UnaryQueryOp:A.operatorKeyword,"CallTag ValueName":A.atom,VariableName:A.variableName,Callee:A.operatorKeyword,Unit:A.unit,"UniversalSelector NestingSelector":A.definitionOperator,"MatchOp CompareOp":A.compareOperator,"ChildOp SiblingOp, LogicOp":A.logicOperator,BinOp:A.arithmeticOperator,Important:A.modifier,Comment:A.blockComment,ColorLiteral:A.color,"ParenthesizedContent StringLiteral":A.string,":":A.punctuation,"PseudoOp #":A.derefOperator,"; ,":A.separator,"( )":A.paren,"[ ]":A.squareBracket,"{ }":A.brace}),Dge={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},Oge={__proto__:null,or:98,and:98,not:106,only:106,layer:170},kge={__proto__:null,selector:112,layer:166},Age={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},jge={__proto__:null,to:207},Mge=Oe.deserialize({version:14,states:"EbQYQdOOO#qQdOOP#xO`OOOOQP'#Cf'#CfOOQP'#Ce'#CeO#}QdO'#ChO$nQaO'#CcO$xQdO'#CkO%TQdO'#DpO%YQdO'#DrO%_QdO'#DuO%_QdO'#DxOOQP'#FV'#FVO&eQhO'#EhOOQS'#FU'#FUOOQS'#Ek'#EkQYQdOOO&lQdO'#EOO&PQhO'#EUO&lQdO'#EWO'aQdO'#EYO'lQdO'#E]O'tQhO'#EcO(VQdO'#EeO(bQaO'#CfO)VQ`O'#D{O)[Q`O'#F`O)gQdO'#F`QOQ`OOP)qO&jO'#CaPOOO)C@t)C@tOOQP'#Cj'#CjOOQP,59S,59SO#}QdO,59SO)|QdO,59VO%TQdO,5:[O%YQdO,5:^O%_QdO,5:aO%_QdO,5:cO%_QdO,5:dO%_QdO'#ErO*XQ`O,58}O*aQdO'#DzOOQS,58},58}OOQP'#Cn'#CnOOQO'#Dn'#DnOOQP,59V,59VO*hQ`O,59VO*mQ`O,59VOOQP'#Dq'#DqOOQP,5:[,5:[OOQO'#Ds'#DsO*rQpO,5:^O+]QaO,5:aO+sQaO,5:dOOQW'#DZ'#DZO,ZQhO'#DdO,xQhO'#FaO'tQhO'#DbO-WQ`O'#DhOOQW'#F['#F[O-]Q`O,5;SO-eQ`O'#DeOOQS-E8i-E8iOOQ['#Cs'#CsO-jQdO'#CtO.QQdO'#CzO.hQdO'#C}O/OQ!pO'#DPO1RQ!jO,5:jOOQO'#DU'#DUO*mQ`O'#DTO1cQ!nO'#FXO3`Q`O'#DVO3eQ`O'#DkOOQ['#FX'#FXO-`Q`O,5:pO3jQ!bO,5:rOOQS'#E['#E[O3rQ`O,5:tO3wQdO,5:tOOQO'#E_'#E_O4PQ`O,5:wO4UQhO,5:}O%_QdO'#DgOOQS,5;P,5;PO-eQ`O,5;PO4^QdO,5;PO4fQdO,5:gO4vQdO'#EtO5TQ`O,5;zO5TQ`O,5;zPOOO'#Ej'#EjP5`O&jO,58{POOO,58{,58{OOQP1G.n1G.nOOQP1G.q1G.qO*hQ`O1G.qO*mQ`O1G.qOOQP1G/v1G/vO5kQpO1G/xO5sQaO1G/{O6ZQaO1G/}O6qQaO1G0OO7XQaO,5;^OOQO-E8p-E8pOOQS1G.i1G.iO7cQ`O,5:fO7hQdO'#DoO7oQdO'#CrOOQP1G/x1G/xO&lQdO1G/xO7vQ!jO'#DZO8UQ!bO,59vO8^QhO,5:OOOQO'#F]'#F]O8XQ!bO,59zO'tQhO,59xO8fQhO'#EvO8sQ`O,5;{O9OQhO,59|O9uQhO'#DiOOQW,5:S,5:SOOQS1G0n1G0nOOQW,5:P,5:PO9|Q!fO'#FYOOQS'#FY'#FYOOQS'#Em'#EmO;^QdO,59`OOQ[,59`,59`O;tQdO,59fOOQ[,59f,59fO<[QdO,59iOOQ[,59i,59iOOQ[,59k,59kO&lQdO,59mO<rQhO'#EQOOQW'#EQ'#EQO=WQ`O1G0UO1[QhO1G0UOOQ[,59o,59oO'tQhO'#DXOOQ[,59q,59qO=]Q#tO,5:VOOQS1G0[1G0[OOQS1G0^1G0^OOQS1G0`1G0`O=hQ`O1G0`O=mQdO'#E`OOQS1G0c1G0cOOQS1G0i1G0iO=xQaO,5:RO-`Q`O1G0kOOQS1G0k1G0kO-eQ`O1G0kO>PQ!fO1G0ROOQO1G0R1G0ROOQO,5;`,5;`O>gQdO,5;`OOQO-E8r-E8rO>tQ`O1G1fPOOO-E8h-E8hPOOO1G.g1G.gOOQP7+$]7+$]OOQP7+%d7+%dO&lQdO7+%dOOQS1G0Q1G0QO?PQaO'#F_O?ZQ`O,5:ZO?`Q!fO'#ElO@^QdO'#FWO@hQ`O,59^O@mQ!bO7+%dO&lQdO1G/bO@uQhO1G/fOOQW1G/j1G/jOOQW1G/d1G/dOAWQhO,5;bOOQO-E8t-E8tOAfQhO'#DZOAtQhO'#F^OBPQ`O'#F^OBUQ`O,5:TOOQS-E8k-E8kOOQ[1G.z1G.zOOQ[1G/Q1G/QOOQ[1G/T1G/TOOQ[1G/X1G/XOBZQdO,5:lOOQS7+%p7+%pOB`Q`O7+%pOBeQhO'#DYOBmQ`O,59sO'tQhO,59sOOQ[1G/q1G/qOBuQ`O1G/qOOQS7+%z7+%zOBzQbO'#DPOOQO'#Eb'#EbOCYQ`O'#EaOOQO'#Ea'#EaOCeQ`O'#EwOCmQdO,5:zOOQS,5:z,5:zOOQ[1G/m1G/mOOQS7+&V7+&VO-`Q`O7+&VOCxQ!fO'#EsO&lQdO'#EsOEPQdO7+%mOOQO7+%m7+%mOOQO1G0z1G0zOEdQ!bO<<IOOElQdO'#EqOEvQ`O,5;yOOQP1G/u1G/uOOQS-E8j-E8jOFOQdO'#EpOFYQ`O,5;rOOQ]1G.x1G.xOOQP<<IO<<IOOFbQdO7+$|OOQO'#D]'#D]OFiQ!bO7+%QOFqQhO'#EoOF{Q`O,5;xO&lQdO,5;xOOQW1G/o1G/oOOQO'#ES'#ESOGTQ`O1G0WOOQS<<I[<<I[O&lQdO,59tOGnQhO1G/_OOQ[1G/_1G/_OGuQ`O1G/_OOQW-E8l-E8lOOQ[7+%]7+%]OOQO,5:{,5:{O=pQdO'#ExOCeQ`O,5;cOOQS,5;c,5;cOOQS-E8u-E8uOOQS1G0f1G0fOOQS<<Iq<<IqOG}Q!fO,5;_OOQS-E8q-E8qOOQO<<IX<<IXOOQPAN>jAN>jOIUQaO,5;]OOQO-E8o-E8oOI`QdO,5;[OOQO-E8n-E8nOOQW<<Hh<<HhOOQW<<Hl<<HlOIjQhO<<HlOI{QhO,5;ZOJWQ`O,5;ZOOQO-E8m-E8mOJ]QdO1G1dOBZQdO'#EuOJgQ`O7+%rOOQW7+%r7+%rOJoQ!bO1G/`OOQ[7+$y7+$yOJzQhO7+$yPKRQ`O'#EnOOQO,5;d,5;dOOQO-E8v-E8vOOQS1G0}1G0}OKWQ`OAN>WO&lQdO1G0uOK]Q`O7+'OOOQO,5;a,5;aOOQO-E8s-E8sOOQW<<I^<<I^OOQ[<<He<<HePOQW,5;Y,5;YOOQWG23rG23rOKeQdO7+&a",stateData:"Kx~O#sOS#tQQ~OW[OZ[O]TO`VOaVOi]OjWOmXO!jYO!mZO!saO!ybO!{cO!}dO#QeO#WfO#YgO#oRO~OQiOW[OZ[O]TO`VOaVOi]OjWOmXO!jYO!mZO!saO!ybO!{cO!}dO#QeO#WfO#YgO#ohO~O#m$SP~P!dO#tmO~O#ooO~O]qO`rOarOjsOmtO!juO!mwO#nvO~OpzO!^xO~P$SOc!QO#o|O#p}O~O#o!RO~O#o!TO~OW[OZ[O]TO`VOaVOjWOmXO!jYO!mZO#oRO~OS!]Oe!YO!V![O!Y!`O#q!XOp$TP~Ok$TP~P&POQ!jOe!cOm!dOp!eOr!mOt!mOz!kO!`!lO#o!bO#p!hO#}!fO~Ot!qO!`!lO#o!pO~Ot!sO#o!sO~OS!]Oe!YO!V![O!Y!`O#q!XO~Oe!vOpzO#Z!xO~O]YX`YX`!pXaYXjYXmYXpYX!^YX!jYX!mYX#nYX~O`!zO~Ok!{O#m$SXo$SX~O#m$SXo$SX~P!dO#u#OO#v#OO#w#QO~Oc#UO#o|O#p}O~OpzO!^xO~Oo$SP~P!dOe#`O~Oe#aO~Ol#bO!h#cO~O]qO`rOarOjsOmtO~Op!ia!^!ia!j!ia!m!ia#n!iad!ia~P*zOp!la!^!la!j!la!m!la#n!lad!la~P*zOR#gOS!]Oe!YOr#gOt#gO!V![O!Y!`O#q#dO#}!fO~O!R#iO!^#jOk$TXp$TX~Oe#mO~Ok#oOpzO~Oe!vO~O]#rO`#rOd#uOi#rOj#rOk#rO~P&lO]#rO`#rOi#rOj#rOk#rOl#wO~P&lO]#rO`#rOi#rOj#rOk#rOo#yO~P&lOP#zOSsXesXksXvsX!VsX!YsX!usX!wsX#qsX!TsXQsX]sX`sXdsXisXjsXmsXpsXrsXtsXzsX!`sX#osX#psX#}sXlsXosX!^sX!qsX#msX~Ov#{O!u#|O!w#}Ok$TP~P'tOe#aOS#{Xk#{Xv#{X!V#{X!Y#{X!u#{X!w#{X#q#{XQ#{X]#{X`#{Xd#{Xi#{Xj#{Xm#{Xp#{Xr#{Xt#{Xz#{X!`#{X#o#{X#p#{X#}#{Xl#{Xo#{X!^#{X!q#{X#m#{X~Oe$RO~Oe$TO~Ok$VOv#{O~Ok$WO~Ot$XO!`!lO~Op$YO~OpzO!R#iO~OpzO#Z$`O~O!q$bOk!oa#m!oao!oa~P&lOk#hX#m#hXo#hX~P!dOk!{O#m$Sao$Sa~O#u#OO#v#OO#w$hO~Ol$jO!h$kO~Op!ii!^!ii!j!ii!m!ii#n!iid!ii~P*zOp!ki!^!ki!j!ki!m!ki#n!kid!ki~P*zOp!li!^!li!j!li!m!li#n!lid!li~P*zOp#fa!^#fa~P$SOo$lO~Od$RP~P%_Od#zP~P&lO`!PXd}X!R}X!T!PX~O`$sO!T$tO~Od$uO!R#iO~Ok#jXp#jX!^#jX~P'tO!^#jOk$Tap$Ta~O!R#iOk!Uap!Ua!^!Uad!Ua`!Ua~OS!]Oe!YO!V![O!Y!`O#q$yO~Od$QP~P9dOv#{OQ#|X]#|X`#|Xd#|Xe#|Xi#|Xj#|Xk#|Xm#|Xp#|Xr#|Xt#|Xz#|X!`#|X#o#|X#p#|X#}#|Xl#|Xo#|X~O]#rO`#rOd%OOi#rOj#rOk#rO~P&lO]#rO`#rOi#rOj#rOk#rOl%PO~P&lO]#rO`#rOi#rOj#rOk#rOo%QO~P&lOe%SOS!tXk!tX!V!tX!Y!tX#q!tX~Ok%TO~Od%YOt%ZO!a%ZO~Ok%[O~Oo%cO#o%^O#}%]O~Od%dO~P$SOv#{O!^%hO!q%jOk!oi#m!oio!oi~P&lOk#ha#m#hao#ha~P!dOk!{O#m$Sio$Si~O!^%mOd$RX~P$SOd%oO~Ov#{OQ#`Xd#`Xe#`Xm#`Xp#`Xr#`Xt#`Xz#`X!^#`X!`#`X#o#`X#p#`X#}#`X~O!^%qOd#zX~P&lOd%sO~Ol%tOv#{O~OR#gOr#gOt#gO#q%vO#}!fO~O!R#iOk#jap#ja!^#ja~O`!PXd}X!R}X!^}X~O!R#iO!^%xOd$QX~O`%zO~Od%{O~O#o%|O~Ok&OO~O`&PO!R#iO~Od&ROk&QO~Od&UO~OP#zOpsX!^sXdsX~O#}%]Op#TX!^#TX~OpzO!^&WO~Oo&[O#o%^O#}%]O~Ov#{OQ#gXe#gXk#gXm#gXp#gXr#gXt#gXz#gX!^#gX!`#gX!q#gX#m#gX#o#gX#p#gX#}#gXo#gX~O!^%hO!q&`Ok!oq#m!oqo!oq~P&lOl&aOv#{O~Od#eX!^#eX~P%_O!^%mOd$Ra~Od#dX!^#dX~P&lO!^%qOd#za~Od&fO~P&lOd&gO!T&hO~Od#cX!^#cX~P9dO!^%xOd$Qa~O]&mOd&oO~OS#bae#ba!V#ba!Y#ba#q#ba~Od&qO~PG]Od&qOk&rO~Ov#{OQ#gae#gak#gam#gap#gar#gat#gaz#ga!^#ga!`#ga!q#ga#m#ga#o#ga#p#ga#}#gao#ga~Od#ea!^#ea~P$SOd#da!^#da~P&lOR#gOr#gOt#gO#q%vO#}%]O~O!R#iOd#ca!^#ca~O`&xO~O!^%xOd$Qi~P&lO]&mOd&|O~Ov#{Od|ik|i~Od&}O~PG]Ok'OO~Od'PO~O!^%xOd$Qq~Od#cq!^#cq~P&lO#s!a#t#}]#}v!m~",goto:"2h$UPPPPP$VP$YP$c$uP$cP%X$cPP%_PPP%e%o%oPPPPP%oPP%oP&]P%oP%o'W%oP't'w'}'}(^'}P'}P'}P'}'}P(m'}(yP(|PP)p)v$c)|$c*SP$cP$c$cP*Y*{+YP$YP+aP+dP$YP$YP$YP+j$YP+m+p+s+z$YP$YPP$YP,P,V,f,|-[-b-l-r-x.O.U.`.f.l.rPPPPPPPPPPP.x/R/w/z0|P1U1u2O2R2U2[RnQ_^OP`kz!{$dq[OPYZ`kuvwxz!v!{#`$d%mqSOPYZ`kuvwxz!v!{#`$d%mQpTR#RqQ!OVR#SrQ#S!QS$Q!i!jR$i#U!V!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'Q!U!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QU#g!Y$t&hU%`$Y%b&WR&V%_!V!iac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QR$S!kQ%W$RR&S%Xk!^]bf!Y![!g#i#j#m$P$R%X%xQ#e!YQ${#mQ%w$tQ&j%xR&w&hQ!ygQ#p!`Q$^!xR%f$`R#n!]!U!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QQ!qdR$X!rQ!PVR#TrQ#S!PR$i#TQ!SWR#VsQ!UXR#WtQ{UQ!wgQ#^yQ#o!_Q$U!nQ$[!uQ$_!yQ%e$^Q&Y%aQ&]%fR&v&XSjPzQ!}kQ$c!{R%k$dZiPkz!{$dR$P!gQ%}%SR&z&mR!rdR!teR$Z!tS%a$Y%bR&t&WV%_$Y%b&WQ#PmR$g#PQ`OSkPzU!a`k$dR$d!{Q$p#aY%p$p%u&d&l'QQ%u$sQ&d%qQ&l%zR'Q&xQ#t!cQ#v!dQ#x!eV$}#t#v#xQ%X$RR&T%XQ%y$zS&k%y&yR&y&lQ%r$pR&e%rQ%n$mR&c%nQyUR#]yQ%i$aR&_%iQ!|jS$e!|$fR$f!}Q&n%}R&{&nQ#k!ZR$x#kQ%b$YR&Z%bQ&X%aR&u&X__OP`kz!{$d^UOP`kz!{$dQ!VYQ!WZQ#XuQ#YvQ#ZwQ#[xQ$]!vQ$m#`R&b%mR$q#aQ!gaQ!oc[#q!c!d!e#t#v#xQ$a!zd$o#a$p$s%q%u%z&d&l&x'QQ$r#cQ%R#{S%g$a%iQ%l$kQ&^%hR&p&P]#s!c!d!e#t#v#xW!Z]b!g$PQ!ufQ#f!YQ#l![Q$v#iQ$w#jQ$z#mS%V$R%XR&i%xQ#h!YQ%w$tR&w&hR$|#mR$n#`QlPR#_zQ!_]Q!nbQ$O!gR%U$P",nodeNames:`⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to AtRule Styles`,maxTerm:143,nodeProps:[[`isolate`,-2,5,36,``],[`openedBy`,20,`(`,28,`[`,31,`{`],[`closedBy`,21,`)`,29,`]`,32,`}`]],propSources:[Ege],skippedNodes:[0,5,106],repeatNodeCount:15,tokenData:"JQ~R!YOX$qX^%i^p$qpq%iqr({rs-ust/itu6Wuv$qvw7Qwx7cxy9Qyz9cz{9h{|:R|}>t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$KW%i$KW&FU$q&FU&FV%i&FV;'S$q;'S;=`Iz<%lO$q`$tSOy%Qz;'S%Q;'S;=`%c<%lO%Q`%VS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q`%fP;=`<%l%Q~%nh#s~OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Q~'ah#s~!a`OX%QX^'Y^p%Qpq'Yqy%Qz#y%Q#y#z'Y#z$f%Q$f$g'Y$g#BY%Q#BY#BZ'Y#BZ$IS%Q$IS$I_'Y$I_$I|%Q$I|$JO'Y$JO$JT%Q$JT$JU'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Qj)OUOy%Qz#]%Q#]#^)b#^;'S%Q;'S;=`%c<%lO%Qj)gU!a`Oy%Qz#a%Q#a#b)y#b;'S%Q;'S;=`%c<%lO%Qj*OU!a`Oy%Qz#d%Q#d#e*b#e;'S%Q;'S;=`%c<%lO%Qj*gU!a`Oy%Qz#c%Q#c#d*y#d;'S%Q;'S;=`%c<%lO%Qj+OU!a`Oy%Qz#f%Q#f#g+b#g;'S%Q;'S;=`%c<%lO%Qj+gU!a`Oy%Qz#h%Q#h#i+y#i;'S%Q;'S;=`%c<%lO%Qj,OU!a`Oy%Qz#T%Q#T#U,b#U;'S%Q;'S;=`%c<%lO%Qj,gU!a`Oy%Qz#b%Q#b#c,y#c;'S%Q;'S;=`%c<%lO%Qj-OU!a`Oy%Qz#h%Q#h#i-b#i;'S%Q;'S;=`%c<%lO%Qj-iS!qY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q~-xWOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c<%lO-u~.gOt~~.jRO;'S-u;'S;=`.s;=`O-u~.vXOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c;=`<%l-u<%lO-u~/fP;=`<%l-uj/nYjYOy%Qz!Q%Q!Q![0^![!c%Q!c!i0^!i#T%Q#T#Z0^#Z;'S%Q;'S;=`%c<%lO%Qj0cY!a`Oy%Qz!Q%Q!Q![1R![!c%Q!c!i1R!i#T%Q#T#Z1R#Z;'S%Q;'S;=`%c<%lO%Qj1WY!a`Oy%Qz!Q%Q!Q![1v![!c%Q!c!i1v!i#T%Q#T#Z1v#Z;'S%Q;'S;=`%c<%lO%Qj1}YrY!a`Oy%Qz!Q%Q!Q![2m![!c%Q!c!i2m!i#T%Q#T#Z2m#Z;'S%Q;'S;=`%c<%lO%Qj2tYrY!a`Oy%Qz!Q%Q!Q![3d![!c%Q!c!i3d!i#T%Q#T#Z3d#Z;'S%Q;'S;=`%c<%lO%Qj3iY!a`Oy%Qz!Q%Q!Q![4X![!c%Q!c!i4X!i#T%Q#T#Z4X#Z;'S%Q;'S;=`%c<%lO%Qj4`YrY!a`Oy%Qz!Q%Q!Q![5O![!c%Q!c!i5O!i#T%Q#T#Z5O#Z;'S%Q;'S;=`%c<%lO%Qj5TY!a`Oy%Qz!Q%Q!Q![5s![!c%Q!c!i5s!i#T%Q#T#Z5s#Z;'S%Q;'S;=`%c<%lO%Qj5zSrY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qd6ZUOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qd6tS!hS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qb7VSZQOy%Qz;'S%Q;'S;=`%c<%lO%Q~7fWOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z<%lO7c~8RRO;'S7c;'S;=`8[;=`O7c~8_XOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z;=`<%l7c<%lO7c~8}P;=`<%l7cj9VSeYOy%Qz;'S%Q;'S;=`%c<%lO%Q~9hOd~n9oUWQvWOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qj:YWvW!mQOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj:wU!a`Oy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Qj;bY!a`#}YOy%Qz!Q%Q!Q![;Z![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%Qj<VY!a`Oy%Qz{%Q{|<u|}%Q}!O<u!O!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj<zU!a`Oy%Qz!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj=eU!a`#}YOy%Qz!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj>O[!a`#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%Qj>yS!^YOy%Qz;'S%Q;'S;=`%c<%lO%Qj?[WvWOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj?yU]YOy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Q~@bTvWOy%Qz{@q{;'S%Q;'S;=`%c<%lO%Q~@xS!a`#t~Oy%Qz;'S%Q;'S;=`%c<%lO%QjAZ[#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%QjBUU`YOy%Qz![%Q![!]Bh!];'S%Q;'S;=`%c<%lO%QbBoSaQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjCQSkYOy%Qz;'S%Q;'S;=`%c<%lO%QhCcU!TWOy%Qz!_%Q!_!`Cu!`;'S%Q;'S;=`%c<%lO%QhC|S!TW!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QlDaS!TW!hSOy%Qz;'S%Q;'S;=`%c<%lO%QjDtV!jQ!TWOy%Qz!_%Q!_!`Cu!`!aEZ!a;'S%Q;'S;=`%c<%lO%QbEbS!jQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjEqYOy%Qz}%Q}!OFa!O!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjFfW!a`Oy%Qz!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjGV[iY!a`Oy%Qz}%Q}!OGO!O!Q%Q!Q![GO![!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjHQSmYOy%Qz;'S%Q;'S;=`%c<%lO%QnHcSl^Oy%Qz;'S%Q;'S;=`%c<%lO%QjHtSpYOy%Qz;'S%Q;'S;=`%c<%lO%QjIVSoYOy%Qz;'S%Q;'S;=`%c<%lO%QfIhU!mQOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Q`I}P;=`<%l$q",tokenizers:[wge,Tge,Sge,Cge,1,2,3,4,new pe(`m~RRYZ[z{a~~g~aO#v~~dP!P!Qg~lO#w~~`,28,129)],topRules:{StyleSheet:[0,6],Styles:[1,105]},specialized:[{term:124,get:e=>Dge[e]||-1},{term:125,get:e=>Oge[e]||-1},{term:4,get:e=>kge[e]||-1},{term:25,get:e=>Age[e]||-1},{term:123,get:e=>jge[e]||-1}],tokenPrec:1963}),WL=null;function GL(){if(!WL&&typeof document==`object`&&document.body){let{style:e}=document.body,t=[],n=new Set;for(let r in e)r!=`cssText`&&r!=`cssFloat`&&typeof e[r]==`string`&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,e=>`-`+e.toLowerCase())),n.has(r)||(t.push(r),n.add(r)));WL=t.sort().map(e=>({type:`property`,label:e,apply:e+`: `}))}return WL||[]}var KL=`active.after.any-link.autofill.backdrop.before.checked.cue.default.defined.disabled.empty.enabled.file-selector-button.first.first-child.first-letter.first-line.first-of-type.focus.focus-visible.focus-within.fullscreen.has.host.host-context.hover.in-range.indeterminate.invalid.is.lang.last-child.last-of-type.left.link.marker.modal.not.nth-child.nth-last-child.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.part.placeholder.placeholder-shown.read-only.read-write.required.right.root.scope.selection.slotted.target.target-text.valid.visited.where`.split(`.`).map(e=>({type:`class`,label:e})),qL=`above.absolute.activeborder.additive.activecaption.after-white-space.ahead.alias.all.all-scroll.alphabetic.alternate.always.antialiased.appworkspace.asterisks.attr.auto.auto-flow.avoid.avoid-column.avoid-page.avoid-region.axis-pan.background.backwards.baseline.below.bidi-override.blink.block.block-axis.bold.bolder.border.border-box.both.bottom.break.break-all.break-word.bullets.button.button-bevel.buttonface.buttonhighlight.buttonshadow.buttontext.calc.capitalize.caps-lock-indicator.caption.captiontext.caret.cell.center.checkbox.circle.cjk-decimal.clear.clip.close-quote.col-resize.collapse.color.color-burn.color-dodge.column.column-reverse.compact.condensed.contain.content.contents.content-box.context-menu.continuous.copy.counter.counters.cover.crop.cross.crosshair.currentcolor.cursive.cyclic.darken.dashed.decimal.decimal-leading-zero.default.default-button.dense.destination-atop.destination-in.destination-out.destination-over.difference.disc.discard.disclosure-closed.disclosure-open.document.dot-dash.dot-dot-dash.dotted.double.down.e-resize.ease.ease-in.ease-in-out.ease-out.element.ellipse.ellipsis.embed.end.ethiopic-abegede-gez.ethiopic-halehame-aa-er.ethiopic-halehame-gez.ew-resize.exclusion.expanded.extends.extra-condensed.extra-expanded.fantasy.fast.fill.fill-box.fixed.flat.flex.flex-end.flex-start.footnotes.forwards.from.geometricPrecision.graytext.grid.groove.hand.hard-light.help.hidden.hide.higher.highlight.highlighttext.horizontal.hsl.hsla.hue.icon.ignore.inactiveborder.inactivecaption.inactivecaptiontext.infinite.infobackground.infotext.inherit.initial.inline.inline-axis.inline-block.inline-flex.inline-grid.inline-table.inset.inside.intrinsic.invert.italic.justify.keep-all.landscape.large.larger.left.level.lighter.lighten.line-through.linear.linear-gradient.lines.list-item.listbox.listitem.local.logical.loud.lower.lower-hexadecimal.lower-latin.lower-norwegian.lowercase.ltr.luminosity.manipulation.match.matrix.matrix3d.medium.menu.menutext.message-box.middle.min-intrinsic.mix.monospace.move.multiple.multiple_mask_images.multiply.n-resize.narrower.ne-resize.nesw-resize.no-close-quote.no-drop.no-open-quote.no-repeat.none.normal.not-allowed.nowrap.ns-resize.numbers.numeric.nw-resize.nwse-resize.oblique.opacity.open-quote.optimizeLegibility.optimizeSpeed.outset.outside.outside-shape.overlay.overline.padding.padding-box.painted.page.paused.perspective.pinch-zoom.plus-darker.plus-lighter.pointer.polygon.portrait.pre.pre-line.pre-wrap.preserve-3d.progress.push-button.radial-gradient.radio.read-only.read-write.read-write-plaintext-only.rectangle.region.relative.repeat.repeating-linear-gradient.repeating-radial-gradient.repeat-x.repeat-y.reset.reverse.rgb.rgba.ridge.right.rotate.rotate3d.rotateX.rotateY.rotateZ.round.row.row-resize.row-reverse.rtl.run-in.running.s-resize.sans-serif.saturation.scale.scale3d.scaleX.scaleY.scaleZ.screen.scroll.scrollbar.scroll-position.se-resize.self-start.self-end.semi-condensed.semi-expanded.separate.serif.show.single.skew.skewX.skewY.skip-white-space.slide.slider-horizontal.slider-vertical.sliderthumb-horizontal.sliderthumb-vertical.slow.small.small-caps.small-caption.smaller.soft-light.solid.source-atop.source-in.source-out.source-over.space.space-around.space-between.space-evenly.spell-out.square.start.static.status-bar.stretch.stroke.stroke-box.sub.subpixel-antialiased.svg_masks.super.sw-resize.symbolic.symbols.system-ui.table.table-caption.table-cell.table-column.table-column-group.table-footer-group.table-header-group.table-row.table-row-group.text.text-bottom.text-top.textarea.textfield.thick.thin.threeddarkshadow.threedface.threedhighlight.threedlightshadow.threedshadow.to.top.transform.translate.translate3d.translateX.translateY.translateZ.transparent.ultra-condensed.ultra-expanded.underline.unidirectional-pan.unset.up.upper-latin.uppercase.url.var.vertical.vertical-text.view-box.visible.visibleFill.visiblePainted.visibleStroke.visual.w-resize.wait.wave.wider.window.windowframe.windowtext.words.wrap.wrap-reverse.x-large.x-small.xor.xx-large.xx-small`.split(`.`).map(e=>({type:`keyword`,label:e})).concat(`aliceblue.antiquewhite.aqua.aquamarine.azure.beige.bisque.black.blanchedalmond.blue.blueviolet.brown.burlywood.cadetblue.chartreuse.chocolate.coral.cornflowerblue.cornsilk.crimson.cyan.darkblue.darkcyan.darkgoldenrod.darkgray.darkgreen.darkkhaki.darkmagenta.darkolivegreen.darkorange.darkorchid.darkred.darksalmon.darkseagreen.darkslateblue.darkslategray.darkturquoise.darkviolet.deeppink.deepskyblue.dimgray.dodgerblue.firebrick.floralwhite.forestgreen.fuchsia.gainsboro.ghostwhite.gold.goldenrod.gray.grey.green.greenyellow.honeydew.hotpink.indianred.indigo.ivory.khaki.lavender.lavenderblush.lawngreen.lemonchiffon.lightblue.lightcoral.lightcyan.lightgoldenrodyellow.lightgray.lightgreen.lightpink.lightsalmon.lightseagreen.lightskyblue.lightslategray.lightsteelblue.lightyellow.lime.limegreen.linen.magenta.maroon.mediumaquamarine.mediumblue.mediumorchid.mediumpurple.mediumseagreen.mediumslateblue.mediumspringgreen.mediumturquoise.mediumvioletred.midnightblue.mintcream.mistyrose.moccasin.navajowhite.navy.oldlace.olive.olivedrab.orange.orangered.orchid.palegoldenrod.palegreen.paleturquoise.palevioletred.papayawhip.peachpuff.peru.pink.plum.powderblue.purple.rebeccapurple.red.rosybrown.royalblue.saddlebrown.salmon.sandybrown.seagreen.seashell.sienna.silver.skyblue.slateblue.slategray.snow.springgreen.steelblue.tan.teal.thistle.tomato.turquoise.violet.wheat.white.whitesmoke.yellow.yellowgreen`.split(`.`).map(e=>({type:`constant`,label:e}))),Nge=`a.abbr.address.article.aside.b.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.dd.del.details.dfn.dialog.div.dl.dt.em.figcaption.figure.footer.form.header.hgroup.h1.h2.h3.h4.h5.h6.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.main.meter.nav.ol.output.p.pre.ruby.section.select.small.source.span.strong.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.tr.u.ul`.split(`.`).map(e=>({type:`type`,label:e})),Pge=[`@charset`,`@color-profile`,`@container`,`@counter-style`,`@font-face`,`@font-feature-values`,`@font-palette-values`,`@import`,`@keyframes`,`@layer`,`@media`,`@namespace`,`@page`,`@position-try`,`@property`,`@scope`,`@starting-style`,`@supports`,`@view-transition`].map(e=>({type:`keyword`,label:e})),JL=/^(\w[\w-]*|-\w[\w-]*|)$/,Fge=/^-(-[\w-]*)?$/;function Ige(e,t){if((e.name==`(`||e.type.isError)&&(e=e.parent||e),e.name!=`ArgList`)return!1;let n=e.parent?.firstChild;return n?.name==`Callee`?t.sliceString(n.from,n.to)==`var`:!1}var YL=new O,Lge=[`Declaration`];function Rge(e){for(let t=e;;){if(t.type.isTop)return t;if(!(t=t.parent))return e}}function XL(e,t,n){if(t.to-t.from>4096){let r=YL.get(t);if(r)return r;let i=[],o=new Set,s=t.cursor(a.IncludeAnonymous);if(s.firstChild())do for(let t of XL(e,s.node,n))o.has(t.label)||(o.add(t.label),i.push(t));while(s.nextSibling());return YL.set(t,i),i}else{let r=[],i=new Set;return t.cursor().iterate(t=>{if(n(t)&&t.matchContext(Lge)&&t.node.nextSibling?.name==`:`){let n=e.sliceString(t.from,t.to);i.has(n)||(i.add(n),r.push({label:n,type:`variable`}))}}),r}}var ZL=e=>t=>{let{state:n,pos:r}=t,i=p(n).resolveInner(r,-1),a=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)==`-`;if(i.name==`PropertyName`||(a||i.name==`TagName`)&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:GL(),validFor:JL};if(i.name==`ValueName`)return{from:i.from,options:qL,validFor:JL};if(i.name==`PseudoClassName`)return{from:i.from,options:KL,validFor:JL};if(e(i)||(t.explicit||a)&&Ige(i,n.doc))return{from:e(i)||a?i.from:r,options:XL(n.doc,Rge(i),e),validFor:Fge};if(i.name==`TagName`){for(let{parent:e}=i;e;e=e.parent)if(e.name==`Block`)return{from:i.from,options:GL(),validFor:JL};return{from:i.from,options:Nge,validFor:JL}}if(i.name==`AtKeyword`)return{from:i.from,options:Pge,validFor:JL};if(!t.explicit)return null;let o=i.resolve(r),s=o.childBefore(r);return s&&s.name==`:`&&o.name==`PseudoClassSelector`?{from:r,options:KL,validFor:JL}:s&&s.name==`:`&&o.name==`Declaration`||o.name==`ArgList`?{from:r,options:qL,validFor:JL}:o.name==`Block`||o.name==`Styles`?{from:r,options:GL(),validFor:JL}:null},QL=ZL(e=>e.name==`VariableName`),$L=Ae.define({name:`css`,parser:Mge.configure({props:[l.add({Declaration:fe()}),s.add({"Block KeyframeList":ze})]}),languageData:{commentTokens:{block:{open:`/*`,close:`*/`}},indentOnInput:/^\s*\}$/,wordChars:`-`}});function eR(){return new Ne($L,$L.data.of({autocomplete:QL}))}var tR=[`_blank`,`_self`,`_top`,`_parent`],nR=[`ascii`,`utf-8`,`utf-16`,`latin1`,`latin1`],rR=[`get`,`post`,`put`,`delete`],iR=[`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`],aR=[`true`,`false`],oR={},zge={a:{attrs:{href:null,ping:null,type:null,media:null,target:tR,hreflang:null}},abbr:oR,address:oR,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:[`default`,`rect`,`circle`,`poly`]}},article:oR,aside:oR,audio:{attrs:{src:null,mediagroup:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`none`,`metadata`,`auto`],autoplay:[`autoplay`],loop:[`loop`],controls:[`controls`]}},b:oR,base:{attrs:{href:null,target:tR}},bdi:oR,bdo:oR,blockquote:{attrs:{cite:null}},body:oR,br:oR,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:[`autofocus`],disabled:[`autofocus`],formenctype:iR,formmethod:rR,formnovalidate:[`novalidate`],formtarget:tR,type:[`submit`,`reset`,`button`]}},canvas:{attrs:{width:null,height:null}},caption:oR,center:oR,cite:oR,code:oR,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:[`command`,`checkbox`,`radio`],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:[`disabled`],checked:[`checked`]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:[`disabled`],multiple:[`multiple`]}},datalist:{attrs:{data:null}},dd:oR,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:[`open`]}},dfn:oR,div:oR,dl:oR,dt:oR,em:oR,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:[`disabled`],form:null,name:null}},figcaption:oR,figure:oR,footer:oR,form:{attrs:{action:null,name:null,"accept-charset":nR,autocomplete:[`on`,`off`],enctype:iR,method:rR,novalidate:[`novalidate`],target:tR}},h1:oR,h2:oR,h3:oR,h4:oR,h5:oR,h6:oR,head:{children:[`title`,`base`,`link`,`style`,`meta`,`script`,`noscript`,`command`]},header:oR,hgroup:oR,hr:oR,html:{attrs:{manifest:null}},i:oR,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:[`allow-top-navigation`,`allow-same-origin`,`allow-forms`,`allow-scripts`],seamless:[`seamless`]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:[`audio/*`,`video/*`,`image/*`],autocomplete:[`on`,`off`],autofocus:[`autofocus`],checked:[`checked`],disabled:[`disabled`],formenctype:iR,formmethod:rR,formnovalidate:[`novalidate`],formtarget:tR,multiple:[`multiple`],readonly:[`readonly`],required:[`required`],type:[`hidden`,`text`,`search`,`tel`,`url`,`email`,`password`,`datetime`,`date`,`month`,`week`,`time`,`datetime-local`,`number`,`range`,`color`,`checkbox`,`radio`,`file`,`submit`,`image`,`reset`,`button`]}},ins:{attrs:{cite:null,datetime:null}},kbd:oR,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:[`autofocus`],disabled:[`disabled`],keytype:[`RSA`]}},label:{attrs:{for:null,form:null}},legend:oR,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:[`all`,`16x16`,`16x16 32x32`,`16x16 32x32 64x64`]}},map:{attrs:{name:null}},mark:oR,menu:{attrs:{label:null,type:[`list`,`context`,`toolbar`]}},meta:{attrs:{content:null,charset:nR,name:[`viewport`,`application-name`,`author`,`description`,`generator`,`keywords`],"http-equiv":[`content-language`,`content-type`,`default-style`,`refresh`]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:oR,noscript:oR,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:[`typemustmatch`]}},ol:{attrs:{reversed:[`reversed`],start:null,type:[`1`,`a`,`A`,`i`,`I`]},children:[`li`,`script`,`template`,`ul`,`ol`]},optgroup:{attrs:{disabled:[`disabled`],label:null}},option:{attrs:{disabled:[`disabled`],label:null,selected:[`selected`],value:null}},output:{attrs:{for:null,form:null,name:null}},p:oR,param:{attrs:{name:null,value:null}},pre:oR,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:oR,rt:oR,ruby:oR,samp:oR,script:{attrs:{type:[`text/javascript`],src:null,async:[`async`],defer:[`defer`],charset:nR}},section:oR,select:{attrs:{form:null,name:null,size:null,autofocus:[`autofocus`],disabled:[`disabled`],multiple:[`multiple`]}},slot:{attrs:{name:null}},small:oR,source:{attrs:{src:null,type:null,media:null}},span:oR,strong:oR,style:{attrs:{type:[`text/css`],media:null,scoped:null}},sub:oR,summary:oR,sup:oR,table:oR,tbody:oR,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:oR,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:[`autofocus`],disabled:[`disabled`],readonly:[`readonly`],required:[`required`],wrap:[`soft`,`hard`]}},tfoot:oR,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:[`row`,`col`,`rowgroup`,`colgroup`]}},thead:oR,time:{attrs:{datetime:null}},title:oR,tr:oR,track:{attrs:{src:null,label:null,default:null,kind:[`subtitles`,`captions`,`descriptions`,`chapters`,`metadata`],srclang:null}},ul:{children:[`li`,`script`,`template`,`ul`,`ol`]},var:oR,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:[`anonymous`,`use-credentials`],preload:[`auto`,`metadata`,`none`],autoplay:[`autoplay`],mediagroup:[`movie`],muted:[`muted`],controls:[`controls`]}},wbr:oR},sR={accesskey:null,class:null,contenteditable:aR,contextmenu:null,dir:[`ltr`,`rtl`,`auto`],draggable:[`true`,`false`,`auto`],dropzone:[`copy`,`move`,`link`,`string:`,`file:`],hidden:[`hidden`],id:null,inert:[`inert`],itemid:null,itemprop:null,itemref:null,itemscope:[`itemscope`],itemtype:null,lang:[`ar`,`bn`,`de`,`en-GB`,`en-US`,`es`,`fr`,`hi`,`id`,`ja`,`pa`,`pt`,`ru`,`tr`,`zh`],spellcheck:aR,autocorrect:aR,autocapitalize:aR,style:null,tabindex:null,title:null,translate:[`yes`,`no`],rel:[`stylesheet`,`alternate`,`author`,`bookmark`,`help`,`license`,`next`,`nofollow`,`noreferrer`,`prefetch`,`prev`,`search`,`tag`],role:`alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer`.split(` `),"aria-activedescendant":null,"aria-atomic":aR,"aria-autocomplete":[`inline`,`list`,`both`,`none`],"aria-busy":aR,"aria-checked":[`true`,`false`,`mixed`,`undefined`],"aria-controls":null,"aria-describedby":null,"aria-disabled":aR,"aria-dropeffect":null,"aria-expanded":[`true`,`false`,`undefined`],"aria-flowto":null,"aria-grabbed":[`true`,`false`,`undefined`],"aria-haspopup":aR,"aria-hidden":aR,"aria-invalid":[`true`,`false`,`grammar`,`spelling`],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":[`off`,`polite`,`assertive`],"aria-multiline":aR,"aria-multiselectable":aR,"aria-owns":null,"aria-posinset":null,"aria-pressed":[`true`,`false`,`mixed`,`undefined`],"aria-readonly":aR,"aria-relevant":null,"aria-required":aR,"aria-selected":[`true`,`false`,`undefined`],"aria-setsize":null,"aria-sort":[`ascending`,`descending`,`none`,`other`],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},cR=`beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload`.split(` `).map(e=>`on`+e);for(let e of cR)sR[e]=null;var lR=class{constructor(e,t){this.tags={...zge,...e},this.globalAttrs={...sR,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};lR.default=new lR;function uR(e,t,n=e.length){if(!t)return``;let r=t.firstChild,i=r&&r.getChild(`TagName`);return i?e.sliceString(i.from,Math.min(i.to,n)):``}function dR(e,t=!1){for(;e;e=e.parent)if(e.name==`Element`)if(t)t=!1;else return e;return null}function fR(e,t,n){return n.tags[uR(e,dR(t))]?.children||n.allTags}function pR(e,t){let n=[];for(let r=dR(t);r&&!r.type.isTop;r=dR(r.parent)){let i=uR(e,r);if(i&&r.lastChild.name==`CloseTag`)break;i&&n.indexOf(i)<0&&(t.name==`EndTag`||t.from>=r.firstChild.to)&&n.push(i)}return n}var mR=/^[:\-\.\w\u00b7-\uffff]*$/;function hR(e,t,n,r,i){let a=/\s*>/.test(e.sliceDoc(i,i+5))?``:`>`,o=dR(n,n.name==`StartTag`||n.name==`TagName`);return{from:r,to:i,options:fR(e.doc,o,t).map(e=>({label:e,type:`type`})).concat(pR(e.doc,n).map((e,t)=>({label:`/`+e,apply:`/`+e+a,type:`type`,boost:99-t}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function gR(e,t,n,r){let i=/\s*>/.test(e.sliceDoc(r,r+5))?``:`>`;return{from:n,to:r,options:pR(e.doc,t).map((e,t)=>({label:e,apply:e+i,type:`type`,boost:99-t})),validFor:mR}}function Bge(e,t,n,r){let i=[],a=0;for(let r of fR(e.doc,n,t))i.push({label:`<`+r,type:`type`});for(let t of pR(e.doc,n))i.push({label:`</`+t+`>`,type:`type`,boost:99-a++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Vge(e,t,n,r,i){let a=dR(n),o=a?t.tags[uR(e.doc,a)]:null,s=o&&o.attrs?Object.keys(o.attrs):[];return{from:r,to:i,options:(o&&o.globalAttrs===!1?s:s.length?s.concat(t.globalAttrNames):t.globalAttrNames).map(e=>({label:e,type:`property`})),validFor:mR}}function Hge(e,t,n,r,i){let a=n.parent?.getChild(`AttributeName`),o=[],s;if(a){let c=e.sliceDoc(a.from,a.to),l=t.globalAttrs[c];if(!l){let r=dR(n),i=r?t.tags[uR(e.doc,r)]:null;l=i?.attrs&&i.attrs[c]}if(l){let t=e.sliceDoc(r,i).toLowerCase(),n=`"`,a=`"`;/^['"]/.test(t)?(s=t[0]==`"`?/^[^"]*$/:/^[^']*$/,n=``,a=e.sliceDoc(i,i+1)==t[0]?``:t[0],t=t.slice(1),r++):s=/^[^\s<>='"]*$/;for(let e of l)o.push({label:e,apply:n+e+a,type:`constant`})}}return{from:r,to:i,options:o,validFor:s}}function _R(e,t){let{state:n,pos:r}=t,i=p(n).resolveInner(r,-1),a=i.resolve(r);for(let e=r,t;a==i&&(t=i.childBefore(e));){let n=t.lastChild;if(!n||!n.type.isError||n.from<n.to)break;a=i=t,e=n.from}return i.name==`TagName`?i.parent&&/CloseTag$/.test(i.parent.name)?gR(n,i,i.from,r):hR(n,e,i,i.from,r):i.name==`StartTag`||i.name==`IncompleteTag`?hR(n,e,i,r,r):i.name==`StartCloseTag`||i.name==`IncompleteCloseTag`?gR(n,i,r,r):i.name==`OpenTag`||i.name==`SelfClosingTag`||i.name==`AttributeName`?Vge(n,e,i,i.name==`AttributeName`?i.from:r,r):i.name==`Is`||i.name==`AttributeValue`||i.name==`UnquotedAttributeValue`?Hge(n,e,i,i.name==`Is`?r:i.from,r):t.explicit&&(a.name==`Element`||a.name==`Text`||a.name==`Document`)?Bge(n,e,i,r):null}function vR(e){return _R(lR.default,e)}function yR(e){let{extraTags:t,extraGlobalAttributes:n}=e,r=n||t?new lR(t,n):lR.default;return e=>_R(r,e)}var Uge=Ke.parser.configure({top:`SingleExpression`}),bR=[{tag:`script`,attrs:e=>e.type==`text/typescript`||e.lang==`ts`,parser:Ge.parser},{tag:`script`,attrs:e=>e.type==`text/babel`||e.type==`text/jsx`,parser:Ue.parser},{tag:`script`,attrs:e=>e.type==`text/typescript-jsx`,parser:He.parser},{tag:`script`,attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Uge},{tag:`script`,attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:Ke.parser},{tag:`style`,attrs(e){return(!e.lang||e.lang==`css`)&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:$L.parser}],xR=[{name:`style`,parser:$L.parser.configure({top:`Styles`})}].concat(cR.map(e=>({name:e,parser:Ke.parser}))),SR=Ae.define({name:`html`,parser:age.configure({props:[l.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let t=null,n;for(let n=e.node;;){let e=n.lastChild;if(!e||e.name!=`Element`||e.to!=n.to)break;t=n=e}return t&&!((n=t.lastChild)&&(n.name==`CloseTag`||n.name==`SelfClosingTag`))?e.lineIndent(t.from)+e.unit:null}}),s.add({Element(e){let t=e.firstChild,n=e.lastChild;return!t||t.name!=`OpenTag`?null:{from:t.to,to:n.name==`CloseTag`?n.from:e.to}}}),be.add({"OpenTag CloseTag":e=>e.getChild(`TagName`)})]}),languageData:{commentTokens:{block:{open:`<!--`,close:`-->`}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:`-_`}}),CR=SR.configure({wrap:PL(bR,xR)});function wR(e={}){let t=``,n;return e.matchClosingTags===!1&&(t=`noMatch`),e.selfClosingTags===!0&&(t=(t?t+` `:``)+`selfClosing`),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(n=PL((e.nestedLanguages||[]).concat(bR),(e.nestedAttributes||[]).concat(xR))),new Ne(n?SR.configure({wrap:n,dialect:t}):t?CR.configure({dialect:t}):CR,[CR.data.of({autocomplete:yR(e)}),e.autoCloseTags===!1?[]:ER,We().support,eR().support])}var TR=new Set(`area base br col command embed frame hr img input keygen link meta param source track wbr menuitem`.split(` `)),ER=I.inputHandler.of((e,t,n,r,i)=>{if(e.composing||e.state.readOnly||t!=n||r!=`>`&&r!=`/`||!CR.isActiveAt(e.state,t,-1))return!1;let a=i(),{state:o}=a,s=o.changeByRange(e=>{let t=o.doc.sliceString(e.from-1,e.to)==r,{head:n}=e,i=p(o).resolveInner(n,-1),a;if(t&&r==`>`&&i.name==`EndTag`){let t=i.parent;if(t.parent?.lastChild?.name!=`CloseTag`&&(a=uR(o.doc,t.parent,n))&&!TR.has(a))return{range:e,changes:{from:n,to:n+(o.doc.sliceString(n,n+1)===`>`?1:0),insert:`</${a}>`}}}else if(t&&r==`/`&&i.name==`IncompleteCloseTag`){let e=i.parent;if(i.from==n-2&&e.lastChild?.name!=`CloseTag`&&(a=uR(o.doc,e,n))&&!TR.has(a)){let e=n+(o.doc.sliceString(n,n+1)===`>`?1:0),t=`${a}>`;return{range:le.cursor(n+t.length,-1),changes:{from:n,to:e,insert:t}}}}return{range:e}});return s.changes.empty?!1:(e.dispatch([a,o.update(s,{userEvent:`input.complete`,scrollIntoView:!0})]),!0)}),DR=te({commentTokens:{block:{open:`<!--`,close:`-->`}}}),OR=new ge,kR=che.configure({props:[s.add(e=>!e.is(`Block`)||e.is(`Document`)||AR(e)!=null||Wge(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),OR.add(AR),l.add({Document:()=>null}),he.add({Document:DR})]});function AR(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function Wge(e){return e.name==`OrderedList`||e.name==`BulletList`}function Gge(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=AR(e.type))!=null&&r<=t)break;n=e}return n.to}var Kge=Le.of((e,t,n)=>{for(let r=p(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(OR);if(e==null)continue;let t=Gge(r,e);if(t>n)return{from:n,to:t}}return null});function jR(e){return new H(DR,e,[],`markdown`)}var MR=jR(kR),NR=jR(kR.configure([vhe,bhe,yhe,xhe,{props:[s.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));function qge(e,t){return n=>{if(n&&e){let t=null;if(n=/\S*/.exec(n)[0],t=typeof e==`function`?e(n):U.matchLanguageName(e,n,!0),t instanceof U)return t.support?t.support.language.parser:ae.getSkippingParser(t.load());if(t)return t.parser}return t?t.parser:null}}var PR=class{constructor(e,t,n,r,i,a,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let n=this.spaceBefore+(this.node.name==`Blockquote`?`>`:``);if(e!=null){for(;n.length<e;)n+=` `;return n}else{for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=` `;return n+(t?this.spaceAfter:``)}}marker(e,t){let n=this.node.name==`OrderedList`?String(+IR(this.item,e)[2]+t):``;return this.spaceBefore+n+this.type+this.spaceAfter}};function FR(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if(t.name==`FencedCode`)return r;(t.name==`ListItem`||t.name==`Blockquote`)&&n.push(t)}for(let e=n.length-1;e>=0;e--){let i=n[e],a,o=t.lineAt(i.from),s=i.from-o.from;if(i.name==`Blockquote`&&(a=/^ *>( ?)/.exec(o.text.slice(s))))r.push(new PR(i,s,s+a[0].length,``,a[1],`>`,null));else if(i.name==`ListItem`&&i.parent.name==`OrderedList`&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(s)))){let e=a[3],t=a[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new PR(i.parent,s,s+t,a[1],e,a[2],i))}else if(i.name==`ListItem`&&i.parent.name==`BulletList`&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))){let e=a[4],t=a[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=a[2];a[3]&&(n+=a[3].replace(/[xX]/,` `)),r.push(new PR(i.parent,s,s+t,a[1],e,n,i))}}return r}function IR(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function LR(e,t,n,r=0){for(let i=-1,a=e;;){if(a.name==`ListItem`){let e=IR(a,t),o=+e[2];if(i>=0){if(o!=i+1)return;n.push({from:a.from+e[1].length,to:a.from+e[0].length,insert:String(i+2+r)})}i=o}let e=a.nextSibling;if(!e)break;a=e}}function RR(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(i)!=` `)return e;let r=u(e,4,n),a=``;for(let e=r;e>0;)e>=4?(a+=` `,e-=4):(a+=` `,e--);return a+e.slice(n)}var zR=(e={})=>({state:t,dispatch:n})=>{let r=p(t),{doc:i}=t,a=null,o=t.changeByRange(n=>{if(!n.empty||!NR.isActiveAt(t,n.from,-1)&&!NR.isActiveAt(t,n.from,1))return a={range:n};let o=n.from,s=i.lineAt(o),c=FR(r.resolveInner(o,-1),i);for(;c.length&&c[c.length-1].from>o-s.from;)c.pop();if(!c.length)return a={range:n};let l=c[c.length-1];if(l.to-l.spaceAfter.length>o-s.from)return a={range:n};let d=o>=l.to-l.spaceAfter.length&&!/\S/.test(s.text.slice(l.to));if(l.item&&d){let n=l.node.firstChild,r=l.node.getChild(`ListItem`,`ListItem`);if(n.to>=o||r&&r.to<o||s.from>0&&!/[^\s>]/.test(i.lineAt(s.from-1).text)||e.nonTightLists===!1){let e=c.length>1?c[c.length-2]:null,t,n=``;e&&e.item?(t=s.from+e.from,n=e.marker(i,1)):t=s.from+(e?e.to:0);let r=[{from:t,to:o,insert:n}];return l.node.name==`OrderedList`&&LR(l.item,i,r,-2),e&&e.node.name==`OrderedList`&&LR(e.item,i,r),{range:le.cursor(t+n.length),changes:r}}else{let e=HR(c,t,s);return{range:le.cursor(o+e.length+1),changes:{from:s.from,insert:e+t.lineBreak}}}}if(l.node.name==`Blockquote`&&d&&s.from){let e=i.lineAt(s.from-1),r=/>\s*$/.exec(e.text);if(r&&r.index==l.from){let i=t.changes([{from:e.from+r.index,to:e.to},{from:s.from+l.from,to:s.to}]);return{range:n.map(i),changes:i}}}let f=[];l.node.name==`OrderedList`&&LR(l.item,i,f);let p=l.item&&l.item.from<s.from,m=``;if(!p||/^[\s\d.)\-+*>]*/.exec(s.text)[0].length>=l.to)for(let e=0,t=c.length-1;e<=t;e++)m+=e==t&&!p?c[e].marker(i,1):c[e].blank(e<t?u(s.text,4,c[e+1].from)-m.length:null);let h=o;for(;h>s.from&&/\s/.test(s.text.charAt(h-s.from-1));)h--;return m=RR(m,t),Jge(l.node,t.doc)&&(m=HR(c,t,s)+t.lineBreak+m),f.push({from:h,to:o,insert:t.lineBreak+m}),{range:le.cursor(h+m.length+1),changes:f}});return a?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:`input`})),!0)},BR=zR();function VR(e){return e.name==`QuoteMark`||e.name==`ListMark`}function Jge(e,t){if(e.name!=`OrderedList`&&e.name!=`BulletList`)return!1;let n=e.firstChild,r=e.getChild(`ListItem`,`ListItem`);if(!r)return!1;let i=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+(o?0:1)<a.number}function HR(e,t,n){let r=``;for(let t=0,i=e.length-2;t<=i;t++)r+=e[t].blank(t<i?u(n.text,4,e[t+1].from)-r.length:null,t<i);return RR(r,t)}function Yge(e,t){let n=e.resolveInner(t,-1),r=t;VR(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(VR(e))r=e.from;else if(e.name==`OrderedList`||e.name==`BulletList`)n=e.lastChild,r=n.to;else break;return n}var UR=({state:e,dispatch:t})=>{let n=p(e),r=null,i=e.changeByRange(t=>{let i=t.from,{doc:a}=e;if(t.empty&&NR.isActiveAt(e,t.from)){let t=a.lineAt(i),r=FR(Yge(n,i),a);if(r.length){let n=r[r.length-1],a=n.to-n.spaceAfter.length+(n.spaceAfter?1:0);if(i-t.from>a&&!/\S/.test(t.text.slice(a,i-t.from)))return{range:le.cursor(t.from+a),changes:{from:t.from+a,to:i}};if(i-t.from==a&&(!n.item||t.from<=n.item.from||!/\S/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let i=n.blank(u(t.text,4,n.to)-u(t.text,4,n.from));return r==t.from&&(i=RR(i,e)),{range:le.cursor(r+i.length),changes:{from:r,to:t.from+n.to,insert:i}}}if(r<i)return{range:le.cursor(r),changes:{from:r,to:i}}}}}return r={range:t}});return r?!1:(t(e.update(i,{scrollIntoView:!0,userEvent:`delete`})),!0)},WR=[{key:`Enter`,run:BR},{key:`Backspace`,run:UR}],GR=wR({matchClosingTags:!1});function KR(e={}){let{codeLanguages:t,defaultCodeLanguage:n,addKeymap:i=!0,base:{parser:a}=MR,completeHTMLTags:o=!0,pasteURLAsLink:s=!0,htmlTagLanguage:c=GR}=e;if(!(a instanceof kI))throw RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=e.extensions?[e.extensions]:[],u=[c.support,Kge],d;s&&u.push(XR),n instanceof Ne?(u.push(n.support),d=n.language):n&&(d=n);let f=t||d?qge(t,d):void 0;l.push(uhe({codeParser:f,htmlParser:c.language.parser})),i&&u.push(de.high(r.of(WR)));let p=jR(a.configure(l));return o&&u.push(p.data.of({autocomplete:Xge})),new Ne(p,u)}function Xge(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let i=p(t).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name==`CodeBlock`||i.name==`FencedCode`||i.name==`ProcessingInstructionBlock`||i.name==`CommentBlock`||i.name==`Link`||i.name==`Image`)return null;i=i.parent}return{from:n-r[0].length,to:n,options:JR(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}var qR=null;function JR(){if(qR)return qR;let e=vR(new Ze(Ee.create({extensions:GR}),0,!0));return qR=e?e.options:[]}var YR=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,XR=I.domEventHandlers({paste:(e,t)=>{let{main:n}=t.state.selection;if(n.empty)return!1;let r=e.clipboardData?.getData(`text/plain`);if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r=`https://`+r),!NR.isActiveAt(t.state,n.from,1)))return!1;let i=p(t.state),a=!1;return i.iterate({from:n.from,to:n.to,enter:e=>{(e.from>n.from||YR.test(e.name))&&(a=!0)},leave:e=>{e.to<n.to&&(a=!0)}}),a?!1:(t.dispatch({changes:[{from:n.from,insert:`[`},{from:n.to,insert:`](${r})`}],userEvent:`input.paste`,scrollIntoView:!0}),!0)}}),ZR=63,QR=64,$R=1,ez=2,tz=3,nz=4,rz=5,iz=6,az=7,oz=65,sz=66,cz=8,lz=9,uz=10,dz=11,fz=12,pz=13,mz=19,hz=20,gz=29,_z=33,vz=34,yz=47,bz=0,xz=1,Sz=2,Cz=3,wz=4,Tz=class{constructor(e,t,n){this.parent=e,this.depth=t,this.type=n,this.hash=(e?e.hash+e.hash<<8:0)+t+(t<<4)+n}};Tz.top=new Tz(null,-1,bz);function Ez(e,t){for(let n=0,r=t-e.pos-1;;r--,n++){let t=e.peek(r);if(Oz(t)||t==-1)return n}}function Dz(e){return e==32||e==9}function Oz(e){return e==10||e==13}function kz(e){return Dz(e)||Oz(e)}function Az(e){return e<0||kz(e)}var jz=new Me({start:Tz.top,reduce(e,t){return e.type==Cz&&(t==hz||t==vz)?e.parent:e},shift(e,t,n,r){if(t==tz)return new Tz(e,Ez(r,r.pos),xz);if(t==oz||t==rz)return new Tz(e,Ez(r,r.pos),Sz);if(t==ZR)return e.parent;if(t==mz||t==_z)return new Tz(e,0,Cz);if(t==pz&&e.type==wz)return e.parent;if(t==yz){let t=/[1-9]/.exec(r.read(r.pos,n.pos));if(t)return new Tz(e,e.depth+ +t[0],wz)}return e},hash(e){return e.hash}});function Mz(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&Az(e.peek(n+3))}var Nz=new Se((e,t)=>{if(e.next==-1&&t.canShift(QR))return e.acceptToken(QR);let n=e.peek(-1);if((Oz(n)||n<0)&&t.context.type!=Cz){if(Mz(e,45))if(t.canShift(ZR))e.acceptToken(ZR);else return e.acceptToken($R,3);if(Mz(e,46))if(t.canShift(ZR))e.acceptToken(ZR);else return e.acceptToken(ez,3);let n=0;for(;e.next==32;)n++,e.advance();(n<t.context.depth||n==t.context.depth&&t.context.type==xz&&(e.next!=45||!Az(e.peek(1))))&&e.next!=-1&&!Oz(e.next)&&e.next!=35&&e.acceptToken(ZR,-n)}},{contextual:!0}),Pz=new Se((e,t)=>{if(t.context.type==Cz){e.next==63&&(e.advance(),Az(e.next)&&e.acceptToken(az));return}if(e.next==45)e.advance(),Az(e.next)&&e.acceptToken(t.context.type==xz&&t.context.depth==Ez(e,e.pos-1)?nz:tz);else if(e.next==63)e.advance(),Az(e.next)&&e.acceptToken(t.context.type==Sz&&t.context.depth==Ez(e,e.pos-1)?iz:rz);else{let n=e.pos;for(;;)if(Dz(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)Rz(e);else if(e.next==38)zz(e);else if(e.next==42){zz(e);break}else if(e.next==39||e.next==34){if(Bz(e,!0))break;return}else if(e.next==91||e.next==123){if(!Vz(e))return;break}else{Gz(e,!0,!1,0);break}for(;Dz(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(gz))return;Az(e.peek(1))&&e.acceptTokenTo(t.context.type==Sz&&t.context.depth==Ez(e,n)?sz:oz,n)}}},{contextual:!0});function Fz(e){return e>32&&e<127&&e!=34&&e!=37&&e!=44&&e!=60&&e!=62&&e!=92&&e!=94&&e!=96&&e!=123&&e!=124&&e!=125}function Iz(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function Lz(e,t){return e.next==37?(e.advance(),Iz(e.next)&&e.advance(),Iz(e.next)&&e.advance(),!0):Fz(e.next)||t&&e.next==44?(e.advance(),!0):!1}function Rz(e){if(e.advance(),e.next==60){for(e.advance();;)if(!Lz(e,!0)){e.next==62&&e.advance();break}}else for(;Lz(e,!1););}function zz(e){for(e.advance();!Az(e.next)&&Uz(e.tag)!=`f`;)e.advance()}function Bz(e,t){let n=e.next,r=!1,i=e.pos;for(e.advance();;){let a=e.next;if(a<0)break;if(e.advance(),a==n)if(a==39)if(e.next==39)e.advance();else break;else break;else if(a==92&&n==34)e.next>=0&&e.advance();else if(Oz(a)){if(t)return!1;r=!0}else if(t&&e.pos>=i+1024)return!1}return!r}function Vz(e){for(let t=[],n=e.pos+1024;;)if(e.next==91||e.next==123)t.push(e.next),e.advance();else if(e.next==39||e.next==34){if(!Bz(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else if(e.next<0||e.pos>n||Oz(e.next))return!1;else e.advance()}var Hz=`iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif`;function Uz(e){return e<33?`u`:e>125?`s`:Hz[e-33]}function Wz(e,t){let n=Uz(e);return n!=`u`&&!(t&&n==`f`)}function Gz(e,t,n,r){if(Uz(e.next)==`s`||(e.next==63||e.next==58||e.next==45)&&Wz(e.peek(1),n))e.advance();else return!1;let i=e.pos;for(;;){let a=e.next,o=0,s=r+1;for(;kz(a);){if(Oz(a)){if(t)return!1;s=0}else s++;a=e.peek(++o)}if(!(a>=0&&(a==58?Wz(e.peek(o+1),n):a==35?e.peek(o-1)!=32:Wz(a,n)))||!n&&s<=r||s==0&&!n&&(Mz(e,45,o)||Mz(e,46,o)))break;if(t&&Uz(a)==`f`)return!1;for(let t=o;t>=0;t--)e.advance();if(t&&e.pos>i+1024)return!1}return!0}var Kz=new Se((e,t)=>{if(e.next==33)Rz(e),e.acceptToken(fz);else if(e.next==38||e.next==42){let t=e.next==38?uz:dz;zz(e),e.acceptToken(t)}else e.next==39||e.next==34?(Bz(e,!1),e.acceptToken(lz)):Gz(e,!1,t.context.type==Cz,t.context.depth)&&e.acceptToken(cz)}),qz=new Se((e,t)=>{let n=t.context.type==wz?t.context.depth:-1,r=e.pos;scan:for(;;){let i=0,a=e.next;for(;a==32;)a=e.peek(++i);if(!i&&(Mz(e,45,i)||Mz(e,46,i))||!Oz(a)&&(n<0&&(n=Math.max(t.context.depth+1,i)),i<n))break;for(;;){if(e.next<0)break scan;let t=Oz(e.next);if(e.advance(),t)continue scan;r=e.pos}}e.acceptTokenTo(pz,r)}),Jz=b({DirectiveName:A.keyword,DirectiveContent:A.attributeValue,"DirectiveEnd DocEnd":A.meta,QuotedLiteral:A.string,BlockLiteralHeader:A.special(A.string),BlockLiteralContent:A.content,Literal:A.content,"Key/Literal Key/QuotedLiteral":A.definition(A.propertyName),"Anchor Alias":A.labelName,Tag:A.typeName,Comment:A.lineComment,": , -":A.separator,"?":A.punctuation,"[ ]":A.squareBracket,"{ }":A.brace}),Yz=Oe.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:`⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document`,maxTerm:74,context:jz,nodeProps:[[`isolate`,-3,8,9,14,``],[`openedBy`,18,`[`,32,`{`],[`closedBy`,19,`]`,33,`}`]],propSources:[Jz],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[Nz,Pz,Kz,qz,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),Xz=Oe.deserialize({version:14,states:"!vOQOPOOO]OPO'#C_OhOPO'#C^OOOO'#Cc'#CcOpOPO'#CaQOOOOOO{OPOOOOOO'#Cb'#CbO!WOPO'#C`O!`OPO,58xOOOO-E6a-E6aOOOO-E6`-E6`OOOO'#C_'#C_OOOO1G.d1G.d",stateData:`!h~OXPOYROWTP~OWVXXRXYRX~OYVOXSP~OXROYROWTX~OXROYROWTP~OYVOXSX~OX[O~OXY~`,goto:`vWPPX[beioRUOQQOR]XRXQTTOUQWQRZWSSOURYS`,nodeNames:`⚠ Document Frontmatter DashLine FrontmatterContent Body`,maxTerm:10,skippedNodes:[0],repeatNodeCount:2,tokenData:"$z~RXOYnYZ!^Z]n]^!^^}n}!O!i!O;'Sn;'S;=`!c<%lOn~qXOYnYZ!^Z]n]^!^^;'Sn;'S;=`!c<%l~n~On~~!^~!cOY~~!fP;=`<%ln~!lZOYnYZ!^Z]n]^!^^}n}!O#_!O;'Sn;'S;=`!c<%l~n~On~~!^~#bZOYnYZ!^Z]n]^!^^}n}!O$T!O;'Sn;'S;=`!c<%l~n~On~~!^~$WXOYnYZ$sZ]n]^$s^;'Sn;'S;=`!c<%l~n~On~~$s~$zOX~Y~",tokenizers:[0],topRules:{Document:[0,1]},tokenPrec:67}),Zz=Ae.define({name:`yaml`,parser:Yz.configure({props:[l.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name==`BlockLiteralContent`&&t.from<t.to)return e.baseIndentFor(t);if(t.name==`BlockLiteral`)return e.baseIndentFor(t)+e.unit;if(t.name==`BlockSequence`||t.name==`BlockMapping`)return e.column(t.from,1);if(t.name==`QuotedLiteral`)return null;if(t.name==`Literal`){let n=e.column(t.from,1);if(n==e.lineIndent(t.from,1))return n;if(t.to>e.pos)return null}}return null},FlowMapping:Fe({closing:`}`}),FlowSequence:Fe({closing:`]`})}),s.add({"FlowMapping FlowSequence":ze,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:`#`},indentOnInput:/^\s*[\]\}]$/}});function Qz(){return new Ne(Zz)}Ae.define({name:`yaml-frontmatter`,parser:Xz.configure({props:[b({DashLine:A.meta})]})});function X(e){return new Ne(ce.define(e))}function $z(e){return q(()=>import(`./dist-DVFW0GyF.js`).then(t=>t.sql({dialect:t[e]})),__vite__mapDeps([98,99,100]))}var eB=[U.of({name:`C`,extensions:[`c`,`h`,`ino`],load(){return q(()=>import(`./dist-DltQmFDE.js`).then(e=>e.cpp()),__vite__mapDeps([101,100]))}}),U.of({name:`C++`,alias:[`cpp`],extensions:[`cpp`,`c++`,`cc`,`cxx`,`hpp`,`h++`,`hh`,`hxx`],load(){return q(()=>import(`./dist-DltQmFDE.js`).then(e=>e.cpp()),__vite__mapDeps([101,100]))}}),U.of({name:`CQL`,alias:[`cassandra`],extensions:[`cql`],load(){return $z(`Cassandra`)}}),U.of({name:`CSS`,extensions:[`css`],load(){return q(()=>import(`./dist-ChU3_-xm.js`).then(e=>e.css()),__vite__mapDeps([102,100]))}}),U.of({name:`Go`,extensions:[`go`],load(){return q(()=>import(`./dist-CLKxKEQH.js`).then(e=>e.go()),__vite__mapDeps([103,99,100]))}}),U.of({name:`HTML`,alias:[`xhtml`],extensions:[`html`,`htm`,`handlebars`,`hbs`],load(){return q(()=>import(`./dist-C6Saw614.js`).then(e=>e.html()),__vite__mapDeps([104,105,1,99,100]))}}),U.of({name:`Java`,extensions:[`java`],load(){return q(()=>import(`./dist-BiexWhMB.js`).then(e=>e.java()),__vite__mapDeps([106,100]))}}),U.of({name:`JavaScript`,alias:[`ecmascript`,`js`,`node`],extensions:[`js`,`mjs`,`cjs`],load(){return q(()=>import(`./dist--FTL3P_Y.js`).then(e=>e.t).then(e=>e.javascript()),__vite__mapDeps([105,1,99,100]))}}),U.of({name:`Jinja`,extensions:[`j2`,`jinja`,`jinja2`],load(){return q(()=>import(`./dist-CvWPf8Kt.js`).then(e=>e.jinja()),__vite__mapDeps([107,105,1,99,100]))}}),U.of({name:`JSON`,alias:[`json5`],extensions:[`json`,`map`],load(){return q(()=>import(`./dist-DXI2Tp9R.js`).then(e=>e.json()),__vite__mapDeps([108,100]))}}),U.of({name:`JSX`,extensions:[`jsx`],load(){return q(()=>import(`./dist--FTL3P_Y.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0})),__vite__mapDeps([105,1,99,100]))}}),U.of({name:`LESS`,extensions:[`less`],load(){return q(()=>import(`./dist-ZQqxlnHI.js`).then(e=>e.less()),__vite__mapDeps([109,100]))}}),U.of({name:`Liquid`,extensions:[`liquid`],load(){return q(()=>import(`./dist-BVyK6lB7.js`).then(e=>e.liquid()),__vite__mapDeps([110,105,1,99,100]))}}),U.of({name:`MariaDB SQL`,load(){return $z(`MariaSQL`)}}),U.of({name:`Markdown`,extensions:[`md`,`markdown`,`mkd`],load(){return q(()=>import(`./dist-DwzmuYUo.js`).then(e=>e.markdown()),__vite__mapDeps([111,105,1,99,100]))}}),U.of({name:`MS SQL`,load(){return $z(`MSSQL`)}}),U.of({name:`MySQL`,load(){return $z(`MySQL`)}}),U.of({name:`PHP`,extensions:[`php`,`php3`,`php4`,`php5`,`php7`,`phtml`],load(){return q(()=>import(`./dist-BKDi1Kni.js`).then(e=>e.php()),__vite__mapDeps([112,105,1,99,100]))}}),U.of({name:`PLSQL`,extensions:[`pls`],load(){return $z(`PLSQL`)}}),U.of({name:`PostgreSQL`,load(){return $z(`PostgreSQL`)}}),U.of({name:`Python`,extensions:[`BUILD`,`bzl`,`py`,`pyw`],filename:/^(BUCK|BUILD)$/,load(){return q(()=>import(`./dist-ExQdmG6u.js`).then(e=>e.python()),__vite__mapDeps([113,99,100]))}}),U.of({name:`Rust`,extensions:[`rs`],load(){return q(()=>import(`./dist-BNF0fuPB.js`).then(e=>e.rust()),__vite__mapDeps([114,100]))}}),U.of({name:`Sass`,extensions:[`sass`],load(){return q(()=>import(`./dist-DTs2RD81.js`).then(e=>e.sass({indented:!0})),__vite__mapDeps([115,100]))}}),U.of({name:`SCSS`,extensions:[`scss`],load(){return q(()=>import(`./dist-DTs2RD81.js`).then(e=>e.sass()),__vite__mapDeps([115,100]))}}),U.of({name:`SQL`,extensions:[`sql`],load(){return $z(`StandardSQL`)}}),U.of({name:`SQLite`,load(){return $z(`SQLite`)}}),U.of({name:`TSX`,extensions:[`tsx`],load(){return q(()=>import(`./dist--FTL3P_Y.js`).then(e=>e.t).then(e=>e.javascript({jsx:!0,typescript:!0})),__vite__mapDeps([105,1,99,100]))}}),U.of({name:`TypeScript`,alias:[`ts`],extensions:[`ts`,`mts`,`cts`],load(){return q(()=>import(`./dist--FTL3P_Y.js`).then(e=>e.t).then(e=>e.javascript({typescript:!0})),__vite__mapDeps([105,1,99,100]))}}),U.of({name:`WebAssembly`,extensions:[`wat`,`wast`],load(){return q(()=>import(`./dist-CRs-U2qz.js`).then(e=>e.wast()),__vite__mapDeps([116,100]))}}),U.of({name:`XML`,alias:[`rss`,`wsdl`,`xsd`],extensions:[`xml`,`xsl`,`xsd`,`svg`],load(){return q(()=>import(`./dist-CbIYKZT0.js`).then(e=>e.xml()),__vite__mapDeps([117,100]))}}),U.of({name:`YAML`,alias:[`yml`],extensions:[`yaml`,`yml`],load(){return q(()=>import(`./dist-OfFe6OoM.js`).then(e=>e.yaml()),__vite__mapDeps([118,100]))}}),U.of({name:`APL`,extensions:[`dyalog`,`apl`],load(){return q(()=>import(`./apl-CJPt5sW7.js`).then(e=>X(e.apl)),[])}}),U.of({name:`PGP`,alias:[`asciiarmor`],extensions:[`asc`,`pgp`,`sig`],load(){return q(()=>import(`./asciiarmor-D0oCypDs.js`).then(e=>X(e.asciiArmor)),[])}}),U.of({name:`ASN.1`,extensions:[`asn`,`asn1`],load(){return q(()=>import(`./asn1-8xgVfRoq.js`).then(e=>X(e.asn1({}))),[])}}),U.of({name:`Asterisk`,filename:/^extensions\.conf$/i,load(){return q(()=>import(`./asterisk-B5kv5AQp.js`).then(e=>X(e.asterisk)),[])}}),U.of({name:`Brainfuck`,extensions:[`b`,`bf`],load(){return q(()=>import(`./brainfuck-Dh7M1Ucz.js`).then(e=>X(e.brainfuck)),[])}}),U.of({name:`Cobol`,extensions:[`cob`,`cpy`],load(){return q(()=>import(`./cobol-D3WLbLVy.js`).then(e=>X(e.cobol)),[])}}),U.of({name:`C#`,alias:[`csharp`,`cs`],extensions:[`cs`],load(){return q(()=>import(`./clike-zYz_LEkw.js`).then(e=>X(e.csharp)),[])}}),U.of({name:`Clojure`,extensions:[`clj`,`cljc`,`cljx`],load(){return q(()=>import(`./clojure-CdWlIeQh.js`).then(e=>X(e.clojure)),[])}}),U.of({name:`ClojureScript`,extensions:[`cljs`],load(){return q(()=>import(`./clojure-CdWlIeQh.js`).then(e=>X(e.clojure)),[])}}),U.of({name:`Closure Stylesheets (GSS)`,extensions:[`gss`],load(){return q(()=>import(`./css-_6KgQwpu.js`).then(e=>X(e.gss)),[])}}),U.of({name:`CMake`,extensions:[`cmake`,`cmake.in`],filename:/^CMakeLists\.txt$/,load(){return q(()=>import(`./cmake-wWuF5ifR.js`).then(e=>X(e.cmake)),[])}}),U.of({name:`CoffeeScript`,alias:[`coffee`,`coffee-script`],extensions:[`coffee`],load(){return q(()=>import(`./coffeescript-DRtt-5a2.js`).then(e=>X(e.coffeeScript)),[])}}),U.of({name:`Common Lisp`,alias:[`lisp`],extensions:[`cl`,`lisp`,`el`],load(){return q(()=>import(`./commonlisp-DJV75lsU.js`).then(e=>X(e.commonLisp)),[])}}),U.of({name:`Cypher`,extensions:[`cyp`,`cypher`],load(){return q(()=>import(`./cypher-B3uWx7jm.js`).then(e=>X(e.cypher)),[])}}),U.of({name:`Cython`,extensions:[`pyx`,`pxd`,`pxi`],load(){return q(()=>import(`./python-2pwcWoy7.js`).then(e=>X(e.cython)),[])}}),U.of({name:`Crystal`,extensions:[`cr`],load(){return q(()=>import(`./crystal-C7mEw92C.js`).then(e=>X(e.crystal)),[])}}),U.of({name:`D`,extensions:[`d`],load(){return q(()=>import(`./d-D3kOh3JF.js`).then(e=>X(e.d)),[])}}),U.of({name:`Dart`,extensions:[`dart`],load(){return q(()=>import(`./clike-zYz_LEkw.js`).then(e=>X(e.dart)),[])}}),U.of({name:`diff`,extensions:[`diff`,`patch`],load(){return q(()=>import(`./diff-CoamybWh.js`).then(e=>X(e.diff)),[])}}),U.of({name:`Dockerfile`,filename:/^Dockerfile$/,load(){return q(()=>import(`./dockerfile-Ci0-ApQC.js`).then(e=>X(e.dockerFile)),__vite__mapDeps([119,120]))}}),U.of({name:`DTD`,extensions:[`dtd`],load(){return q(()=>import(`./dtd-BjGQwMWL.js`).then(e=>X(e.dtd)),[])}}),U.of({name:`Dylan`,extensions:[`dylan`,`dyl`,`intr`],load(){return q(()=>import(`./dylan-B9W3X2GI.js`).then(e=>X(e.dylan)),[])}}),U.of({name:`EBNF`,load(){return q(()=>import(`./ebnf-d5D0otVn.js`).then(e=>X(e.ebnf)),[])}}),U.of({name:`ECL`,extensions:[`ecl`],load(){return q(()=>import(`./ecl-C5Q_IBPt.js`).then(e=>X(e.ecl)),[])}}),U.of({name:`edn`,extensions:[`edn`],load(){return q(()=>import(`./clojure-CdWlIeQh.js`).then(e=>X(e.clojure)),[])}}),U.of({name:`Eiffel`,extensions:[`e`],load(){return q(()=>import(`./eiffel-BQA_6I3b.js`).then(e=>X(e.eiffel)),[])}}),U.of({name:`Elm`,extensions:[`elm`],load(){return q(()=>import(`./elm-unPS17vB.js`).then(e=>X(e.elm)),[])}}),U.of({name:`Erlang`,extensions:[`erl`],load(){return q(()=>import(`./erlang-R8nOsUTx.js`).then(e=>X(e.erlang)),[])}}),U.of({name:`Esper`,load(){return q(()=>import(`./sql-CwA10oIk.js`).then(e=>X(e.esper)),[])}}),U.of({name:`Factor`,extensions:[`factor`],load(){return q(()=>import(`./factor-DMvifS-k.js`).then(e=>X(e.factor)),__vite__mapDeps([121,120]))}}),U.of({name:`FCL`,load(){return q(()=>import(`./fcl-CVAfW9wK.js`).then(e=>X(e.fcl)),[])}}),U.of({name:`Forth`,extensions:[`forth`,`fth`,`4th`],load(){return q(()=>import(`./forth-DHbsK8X8.js`).then(e=>X(e.forth)),[])}}),U.of({name:`Fortran`,extensions:[`f`,`for`,`f77`,`f90`,`f95`],load(){return q(()=>import(`./fortran-4jMwxW9-.js`).then(e=>X(e.fortran)),[])}}),U.of({name:`F#`,alias:[`fsharp`],extensions:[`fs`],load(){return q(()=>import(`./mllike-iZXopbca.js`).then(e=>X(e.fSharp)),[])}}),U.of({name:`Gas`,extensions:[`s`],load(){return q(()=>import(`./gas-zC_XGrQT.js`).then(e=>X(e.gas)),[])}}),U.of({name:`Gherkin`,extensions:[`feature`],load(){return q(()=>import(`./gherkin-CPBQou3u.js`).then(e=>X(e.gherkin)),[])}}),U.of({name:`Groovy`,extensions:[`groovy`,`gradle`],filename:/^Jenkinsfile$/,load(){return q(()=>import(`./groovy-Cqopym0q.js`).then(e=>X(e.groovy)),[])}}),U.of({name:`Haskell`,extensions:[`hs`],load(){return q(()=>import(`./haskell-imzbNPgF.js`).then(e=>X(e.haskell)),[])}}),U.of({name:`Haxe`,extensions:[`hx`],load(){return q(()=>import(`./haxe-Doh225Ku.js`).then(e=>X(e.haxe)),[])}}),U.of({name:`HXML`,extensions:[`hxml`],load(){return q(()=>import(`./haxe-Doh225Ku.js`).then(e=>X(e.hxml)),[])}}),U.of({name:`HTTP`,load(){return q(()=>import(`./http-j4R5uEso.js`).then(e=>X(e.http)),[])}}),U.of({name:`IDL`,extensions:[`pro`],load(){return q(()=>import(`./idl-l9d1__Hj.js`).then(e=>X(e.idl)),[])}}),U.of({name:`JSON-LD`,alias:[`jsonld`],extensions:[`jsonld`],load(){return q(()=>import(`./javascript-BcqCeS4O.js`).then(e=>X(e.jsonld)),[])}}),U.of({name:`Julia`,extensions:[`jl`],load(){return q(()=>import(`./julia-BU0qBb1w.js`).then(e=>X(e.julia)),[])}}),U.of({name:`Kotlin`,extensions:[`kt`,`kts`],load(){return q(()=>import(`./clike-zYz_LEkw.js`).then(e=>X(e.kotlin)),[])}}),U.of({name:`LiveScript`,alias:[`ls`],extensions:[`ls`],load(){return q(()=>import(`./livescript-uk34VDGK.js`).then(e=>X(e.liveScript)),[])}}),U.of({name:`Lua`,extensions:[`lua`],load(){return q(()=>import(`./lua-ClQGOv84.js`).then(e=>X(e.lua)),[])}}),U.of({name:`mIRC`,extensions:[`mrc`],load(){return q(()=>import(`./mirc-DRRKKkcJ.js`).then(e=>X(e.mirc)),[])}}),U.of({name:`Mathematica`,extensions:[`m`,`nb`,`wl`,`wls`],load(){return q(()=>import(`./mathematica-BDmKpvRN.js`).then(e=>X(e.mathematica)),[])}}),U.of({name:`Modelica`,extensions:[`mo`],load(){return q(()=>import(`./modelica-DP8T2DKM.js`).then(e=>X(e.modelica)),[])}}),U.of({name:`MUMPS`,extensions:[`mps`],load(){return q(()=>import(`./mumps-BKUS05-y.js`).then(e=>X(e.mumps)),[])}}),U.of({name:`Mbox`,extensions:[`mbox`],load(){return q(()=>import(`./mbox-T5kA6jAQ.js`).then(e=>X(e.mbox)),[])}}),U.of({name:`Nginx`,filename:/nginx.*\.conf$/i,load(){return q(()=>import(`./nginx-CzYOtr2G.js`).then(e=>X(e.nginx)),[])}}),U.of({name:`NSIS`,extensions:[`nsh`,`nsi`],load(){return q(()=>import(`./nsis-BbRIeGvl.js`).then(e=>X(e.nsis)),__vite__mapDeps([122,120]))}}),U.of({name:`NTriples`,extensions:[`nt`,`nq`],load(){return q(()=>import(`./ntriples-ZgZuaYbW.js`).then(e=>X(e.ntriples)),[])}}),U.of({name:`Objective-C`,alias:[`objective-c`,`objc`],extensions:[`m`],load(){return q(()=>import(`./clike-zYz_LEkw.js`).then(e=>X(e.objectiveC)),[])}}),U.of({name:`Objective-C++`,alias:[`objective-c++`,`objc++`],extensions:[`mm`],load(){return q(()=>import(`./clike-zYz_LEkw.js`).then(e=>X(e.objectiveCpp)),[])}}),U.of({name:`OCaml`,extensions:[`ml`,`mli`,`mll`,`mly`],load(){return q(()=>import(`./mllike-iZXopbca.js`).then(e=>X(e.oCaml)),[])}}),U.of({name:`Octave`,extensions:[`m`],load(){return q(()=>import(`./octave-CnOndUN3.js`).then(e=>X(e.octave)),[])}}),U.of({name:`Oz`,extensions:[`oz`],load(){return q(()=>import(`./oz-DjW322Rn.js`).then(e=>X(e.oz)),[])}}),U.of({name:`Pascal`,extensions:[`p`,`pas`],load(){return q(()=>import(`./pascal-BdeW5uRX.js`).then(e=>X(e.pascal)),[])}}),U.of({name:`Perl`,extensions:[`pl`,`pm`],load(){return q(()=>import(`./perl-_CDvIe1D.js`).then(e=>X(e.perl)),[])}}),U.of({name:`Pig`,extensions:[`pig`],load(){return q(()=>import(`./pig-inWo_B4W.js`).then(e=>X(e.pig)),[])}}),U.of({name:`PowerShell`,extensions:[`ps1`,`psd1`,`psm1`],load(){return q(()=>import(`./powershell-CO5KWJsy.js`).then(e=>X(e.powerShell)),[])}}),U.of({name:`Properties files`,alias:[`ini`,`properties`],extensions:[`properties`,`ini`,`in`],load(){return q(()=>import(`./properties-CjVp4a6M.js`).then(e=>X(e.properties)),[])}}),U.of({name:`ProtoBuf`,extensions:[`proto`],load(){return q(()=>import(`./protobuf-DybFT2KT.js`).then(e=>X(e.protobuf)),[])}}),U.of({name:`Pug`,alias:[`jade`],extensions:[`pug`,`jade`],load(){return q(()=>import(`./pug-D1ZtszdL.js`).then(e=>X(e.pug)),__vite__mapDeps([123,124]))}}),U.of({name:`Puppet`,extensions:[`pp`],load(){return q(()=>import(`./puppet-Dw_NDgko.js`).then(e=>X(e.puppet)),[])}}),U.of({name:`Q`,extensions:[`q`],load(){return q(()=>import(`./q-C47l8kdS.js`).then(e=>X(e.q)),[])}}),U.of({name:`R`,alias:[`rscript`],extensions:[`r`,`R`],load(){return q(()=>import(`./r-BmcXGVZ5.js`).then(e=>X(e.r)),[])}}),U.of({name:`RPM Changes`,load(){return q(()=>import(`./rpm-Cm0x5xT_.js`).then(e=>X(e.rpmChanges)),[])}}),U.of({name:`RPM Spec`,extensions:[`spec`],load(){return q(()=>import(`./rpm-Cm0x5xT_.js`).then(e=>X(e.rpmSpec)),[])}}),U.of({name:`Ruby`,alias:[`jruby`,`macruby`,`rake`,`rb`,`rbx`],extensions:[`rb`],filename:/^(Gemfile|Rakefile)$/,load(){return q(()=>import(`./ruby-Dl-I4pxG.js`).then(e=>X(e.ruby)),[])}}),U.of({name:`SAS`,extensions:[`sas`],load(){return q(()=>import(`./sas-Bxkg4GVX.js`).then(e=>X(e.sas)),[])}}),U.of({name:`Scala`,extensions:[`scala`],load(){return q(()=>import(`./clike-zYz_LEkw.js`).then(e=>X(e.scala)),[])}}),U.of({name:`Scheme`,extensions:[`scm`,`ss`],load(){return q(()=>import(`./scheme-CO3zogua.js`).then(e=>X(e.scheme)),[])}}),U.of({name:`Shell`,alias:[`bash`,`sh`,`zsh`],extensions:[`sh`,`ksh`,`bash`],filename:/^PKGBUILD$/,load(){return q(()=>import(`./shell-gYrTvBTP.js`).then(e=>X(e.shell)),[])}}),U.of({name:`Sieve`,extensions:[`siv`,`sieve`],load(){return q(()=>import(`./sieve-COX4Kn1X.js`).then(e=>X(e.sieve)),[])}}),U.of({name:`Smalltalk`,extensions:[`st`],load(){return q(()=>import(`./smalltalk-Dma1z5eE.js`).then(e=>X(e.smalltalk)),[])}}),U.of({name:`Solr`,load(){return q(()=>import(`./solr-BvhcdkNH.js`).then(e=>X(e.solr)),[])}}),U.of({name:`SML`,extensions:[`sml`,`sig`,`fun`,`smackspec`],load(){return q(()=>import(`./mllike-iZXopbca.js`).then(e=>X(e.sml)),[])}}),U.of({name:`SPARQL`,alias:[`sparul`],extensions:[`rq`,`sparql`],load(){return q(()=>import(`./sparql-gX7W9xeh.js`).then(e=>X(e.sparql)),[])}}),U.of({name:`Spreadsheet`,alias:[`excel`,`formula`],load(){return q(()=>import(`./spreadsheet-BnlQRxWz.js`).then(e=>X(e.spreadsheet)),[])}}),U.of({name:`Squirrel`,extensions:[`nut`],load(){return q(()=>import(`./clike-zYz_LEkw.js`).then(e=>X(e.squirrel)),[])}}),U.of({name:`Stylus`,extensions:[`styl`],load(){return q(()=>import(`./stylus-9ZGSp3KB.js`).then(e=>X(e.stylus)),[])}}),U.of({name:`Swift`,extensions:[`swift`],load(){return q(()=>import(`./swift-CurfpLXH.js`).then(e=>X(e.swift)),[])}}),U.of({name:`sTeX`,load(){return q(()=>import(`./stex-DhLUylSV.js`).then(e=>X(e.stex)),[])}}),U.of({name:`LaTeX`,alias:[`tex`],extensions:[`text`,`ltx`,`tex`],load(){return q(()=>import(`./stex-DhLUylSV.js`).then(e=>X(e.stex)),[])}}),U.of({name:`SystemVerilog`,extensions:[`v`,`sv`,`svh`],load(){return q(()=>import(`./verilog-BFxB5RAN.js`).then(e=>X(e.verilog)),[])}}),U.of({name:`Tcl`,extensions:[`tcl`],load(){return q(()=>import(`./tcl-BPvzXR-t.js`).then(e=>X(e.tcl)),[])}}),U.of({name:`Textile`,extensions:[`textile`],load(){return q(()=>import(`./textile-BUq3vgBH.js`).then(e=>X(e.textile)),[])}}),U.of({name:`TiddlyWiki`,load(){return q(()=>import(`./tiddlywiki-DRR6E4hS.js`).then(e=>X(e.tiddlyWiki)),[])}}),U.of({name:`Tiki wiki`,load(){return q(()=>import(`./tiki-C1XMixgx.js`).then(e=>X(e.tiki)),[])}}),U.of({name:`TOML`,extensions:[`toml`],load(){return q(()=>import(`./toml-BQjoWSzq.js`).then(e=>X(e.toml)),[])}}),U.of({name:`Troff`,extensions:[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`],load(){return q(()=>import(`./troff-DbgTp3Cj.js`).then(e=>X(e.troff)),[])}}),U.of({name:`TTCN`,extensions:[`ttcn`,`ttcn3`,`ttcnpp`],load(){return q(()=>import(`./ttcn-1OxchGWH.js`).then(e=>X(e.ttcn)),[])}}),U.of({name:`TTCN_CFG`,extensions:[`cfg`],load(){return q(()=>import(`./ttcn-cfg-CC8OhyHu.js`).then(e=>X(e.ttcnCfg)),[])}}),U.of({name:`Turtle`,extensions:[`ttl`],load(){return q(()=>import(`./turtle-D1WjVU4-.js`).then(e=>X(e.turtle)),[])}}),U.of({name:`Web IDL`,extensions:[`webidl`],load(){return q(()=>import(`./webidl-advQMGTP.js`).then(e=>X(e.webIDL)),[])}}),U.of({name:`VB.NET`,extensions:[`vb`],load(){return q(()=>import(`./vb-Bf-XXYNJ.js`).then(e=>X(e.vb)),[])}}),U.of({name:`VBScript`,extensions:[`vbs`],load(){return q(()=>import(`./vbscript-HeSyWuOi.js`).then(e=>X(e.vbScript)),[])}}),U.of({name:`Velocity`,extensions:[`vtl`],load(){return q(()=>import(`./velocity-CUkiDsJQ.js`).then(e=>X(e.velocity)),[])}}),U.of({name:`Verilog`,extensions:[`v`],load(){return q(()=>import(`./verilog-BFxB5RAN.js`).then(e=>X(e.verilog)),[])}}),U.of({name:`VHDL`,extensions:[`vhd`,`vhdl`],load(){return q(()=>import(`./vhdl-BJUXQE-6.js`).then(e=>X(e.vhdl)),[])}}),U.of({name:`XQuery`,extensions:[`xy`,`xquery`,`xq`,`xqm`,`xqy`],load(){return q(()=>import(`./xquery-CNzoFgd7.js`).then(e=>X(e.xQuery)),[])}}),U.of({name:`Yacas`,extensions:[`ys`],load(){return q(()=>import(`./yacas-BsmlDKac.js`).then(e=>X(e.yacas)),[])}}),U.of({name:`Z80`,extensions:[`z80`],load(){return q(()=>import(`./z80-Bnez4vZ_.js`).then(e=>X(e.z80)),[])}}),U.of({name:`MscGen`,extensions:[`mscgen`,`mscin`,`msc`],load(){return q(()=>import(`./mscgen-DXIRw2qg.js`).then(e=>X(e.mscgen)),[])}}),U.of({name:`Xù`,extensions:[`xu`],load(){return q(()=>import(`./mscgen-DXIRw2qg.js`).then(e=>X(e.xu)),[])}}),U.of({name:`MsGenny`,extensions:[`msgenny`],load(){return q(()=>import(`./mscgen-DXIRw2qg.js`).then(e=>X(e.msgenny)),[])}}),U.of({name:`Vue`,extensions:[`vue`],load(){return q(()=>import(`./dist-Chnwmoeu.js`).then(e=>e.vue()),__vite__mapDeps([125,105,1,99,100]))}}),U.of({name:`Angular Template`,load(){return q(()=>import(`./dist-oGrBvbG8.js`).then(e=>e.angular()),__vite__mapDeps([126,105,1,99,100]))}})],tB={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},nB={borderLeftWidth:`2px`},rB={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},iB={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},aB={border:`none`,borderRadius:`4px`,padding:`2px 10px`},oB={borderRadius:`2px`},sB={borderRadius:`2px`},cB={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},lB={width:`12px`,height:`12px`,borderRadius:`6px`},uB={borderRadius:`4px`,padding:`2px 6px`},dB={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},fB=`#0d1117`,pB=`#c9d1d9`,mB=`#264F78`,hB=`#8b949e`,gB=`#ffffff`,_B=`#7ee787`,vB=`#d2a8ff`,yB=`#79c0ff`,bB=`#ff7b72`,xB=`#a5d6ff`,SB=`#2c333a`,CB=`#3c444d`,wB=`#ffab70`,TB=`#161b22`,EB=`#30363d`,DB=`#21262d`,OB=`#f97583`,kB=`#2d333b1a`,AB=`#21262d`,jB=gB,MB=mB,NB=`#3a587a75`,PB=`#4d90fe`,FB=`#d29922`,IB=`#3a587a55`,LB=`#58a6ff`,RB=`#bc8cff`,zB=`#2ea04350`,BB=`#f8514940`,VB=`#7ee787`,HB=`#ff7b72`,UB=[I.theme({"&":{color:pB,backgroundColor:fB,fontSize:tB.fontSize,fontFamily:tB.fontFamily},".cm-content":{caretColor:jB,lineHeight:tB.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:jB,borderLeftWidth:nB.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${jB}99`,color:fB},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:MB},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#3a587a`,outline:`1px solid ${yB}`,color:pB,borderRadius:uB.borderRadius,"& span":{color:pB}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:PB,color:gB,padding:uB.padding,"& span":{color:gB}},".cm-search.cm-panel.cm-textfield":{color:pB,borderRadius:uB.borderRadius,padding:uB.padding},".cm-panels":{backgroundColor:AB,color:pB,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${EB}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${EB}`},".cm-panel button":{backgroundColor:AB,color:pB,border:aB.border,borderRadius:aB.borderRadius,padding:aB.padding},".cm-panel button:hover":{backgroundColor:SB},".cm-activeLine":{backgroundColor:kB,borderRadius:oB.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:TB,color:hB,border:iB.border,borderRight:`1px solid #30363d`,paddingRight:iB.paddingRight},".cm-activeLineGutter":{backgroundColor:DB,color:pB,fontWeight:iB.fontWeight},".cm-lineNumbers":{fontSize:iB.fontSize,lineHeight:iB.lineHeight},".cm-foldGutter":{fontSize:iB.fontSize,lineHeight:iB.lineHeight},".cm-foldGutter .cm-gutterElement":{color:hB,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:pB},".cm-insertedLine":{textDecoration:rB.insertedTextDecoration,backgroundColor:zB,color:VB,padding:rB.insertedLinePadding,borderRadius:rB.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:rB.insertedTextDecoration,backgroundColor:`${zB} !important`,color:VB,padding:rB.insertedLinePadding,borderRadius:rB.borderRadious,border:`1px solid ${VB}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:rB.deletedTextDecoration,backgroundColor:BB,color:HB,padding:rB.insertedLinePadding,borderRadius:rB.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:rB.deletedTextDecoration,backgroundColor:`${BB} !important`,color:HB,padding:rB.insertedLinePadding,borderRadius:rB.borderRadious,border:`1px solid ${HB}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:AB,border:`1px solid ${EB}`,borderRadius:dB.borderRadius,padding:dB.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:AB,border:`none`},"& > ul > li":{padding:dB.padding,lineHeight:dB.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:MB,color:gB,borderRadius:dB.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:hB,paddingRight:dB.paddingRight},"& > ul > li > span.cm-completionDetail":{color:hB,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:AB,borderBottomColor:AB},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${OB}`},"&-warning":{borderLeft:`3px solid ${FB}`},"&-info":{borderLeft:`3px solid ${LB}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${OB}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${FB}`},".cm-matchingBracket":{backgroundColor:NB,outline:`1px solid ${PB}`,borderRadius:sB.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#f9758340`,outline:`1px solid ${OB}`,borderRadius:sB.borderRadius},".cm-selectionMatch":{backgroundColor:IB,outline:`1px solid ${mB}50`,borderRadius:sB.borderRadius},".cm-foldPlaceholder":{backgroundColor:AB,color:hB,border:`1px dotted ${EB}70`,borderRadius:cB.borderRadius,padding:cB.padding,margin:cB.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${fB}, 0 0 0 3px ${LB}40`},"& .cm-scroller::-webkit-scrollbar":{width:lB.width,height:lB.height},"& .cm-scroller::-webkit-scrollbar-track":{background:TB},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:EB,borderRadius:lB.borderRadius,border:`3px solid ${TB}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:CB},".cm-ghostText":{opacity:`0.5`,color:hB}},{dark:!0}),D(B.define([{tag:A.keyword,color:bB,fontWeight:`bold`},{tag:A.controlKeyword,color:bB,fontWeight:`bold`},{tag:A.moduleKeyword,color:bB,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:yB},{tag:[A.variableName],color:yB},{tag:[A.propertyName],color:vB,fontStyle:`normal`},{tag:[A.typeName],color:bB},{tag:[A.className],color:vB,fontStyle:`italic`},{tag:[A.namespace],color:yB,fontStyle:`italic`},{tag:[A.operator,A.operatorKeyword],color:pB},{tag:[A.bracket],color:hB},{tag:[A.brace],color:hB},{tag:[A.punctuation],color:hB},{tag:[A.function(A.variableName),A.labelName],color:_B},{tag:[A.definition(A.variableName)],color:yB},{tag:A.number,color:wB},{tag:A.changed,color:wB},{tag:A.annotation,color:OB,fontStyle:`italic`},{tag:A.modifier,color:wB,fontStyle:`italic`},{tag:A.self,color:wB},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:wB},{tag:[A.atom,A.bool,A.special(A.variableName)],color:wB},{tag:[A.processingInstruction,A.inserted],color:_B},{tag:[A.special(A.string),A.regexp],color:xB},{tag:A.string,color:xB},{tag:A.definition(A.typeName),color:bB,fontWeight:`bold`},{tag:A.meta,color:hB},{tag:A.comment,fontStyle:`italic`,color:hB},{tag:A.docComment,fontStyle:`italic`,color:hB},{tag:[A.tagName],color:_B},{tag:[A.attributeName],color:vB},{tag:[A.heading],fontWeight:`bold`,color:yB},{tag:[A.strong],fontWeight:`bold`,color:yB},{tag:[A.emphasis],fontStyle:`italic`,color:xB},{tag:[A.link],color:RB,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:LB,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:pB,textDecoration:`underline wavy`,borderBottom:`1px wavy ${OB}`},{tag:[A.strikethrough],color:OB,textDecoration:`line-through`},{tag:A.constant(A.name),color:wB},{tag:A.deleted,color:OB},{tag:A.squareBracket,color:hB},{tag:A.angleBracket,color:hB},{tag:A.monospace,color:pB},{tag:[A.contentSeparator],color:yB},{tag:A.quote,color:hB}]))],WB={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},GB={borderLeftWidth:`2px`},KB={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},qB={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},JB={border:`none`,borderRadius:`4px`,padding:`2px 10px`},YB={borderRadius:`2px`},XB={borderRadius:`2px`},ZB={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},QB={width:`12px`,height:`12px`,borderRadius:`6px`},$B={borderRadius:`4px`,padding:`2px 6px`},eV={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},tV=`#ffffff`,nV=`#24292e`,rV=`#BBDFFF`,iV=`#6e7781`,aV=`#f6f8fa`,oV=`#116329`,sV=`#6a737d`,cV=`#6f42c1`,lV=`#005cc5`,uV=`#d73a49`,dV=`#032f62`,fV=`#22863a`,pV=`#e36209`,mV=`#f1f8ff`,hV=`#e1e4e8`,gV=`#f8f9fa`,_V=`#cb2431`,vV=`#BBDFFF20`,yV=gV,bV=nV,xV=rV,SV=`#e8f0fe`,CV=`#0366d6`,wV=`#b08800`,TV=`#79b8ff40`,EV=`#0969da`,DV=`#8250df`,OV=`#e6ffec80`,kV=`#ffebe980`,AV=`#0f6d31`,jV=`#cf222e`,MV=[I.theme({"&":{color:nV,backgroundColor:tV,fontSize:WB.fontSize,fontFamily:WB.fontFamily},".cm-content":{caretColor:bV,lineHeight:WB.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:bV,borderLeftWidth:GB.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${bV}99`,color:tV},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:xV,color:nV},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#daebff`,outline:`1px solid ${lV}`,color:nV,borderRadius:$B.borderRadius,"& span":{color:nV}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#79b8ff`,color:tV,padding:$B.padding,"& span":{color:tV}},".cm-search.cm-panel.cm-textfield":{color:nV,borderRadius:$B.borderRadius,padding:$B.padding},".cm-panels":{backgroundColor:aV,color:iV,borderRadius:`0 0 4px 4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${hV}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${hV}`},".cm-panel button":{backgroundColor:tV,color:nV,border:JB.border,borderRadius:JB.borderRadius,padding:JB.padding},".cm-panel button:hover":{backgroundColor:`#f5f5f5`},".cm-activeLine":{backgroundColor:vV,borderRadius:YB.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:aV,color:iV,border:qB.border,borderRight:`1px solid ${hV}`,paddingRight:qB.paddingRight},".cm-activeLineGutter":{backgroundColor:mV,color:nV,fontWeight:qB.fontWeight},".cm-lineNumbers":{fontSize:qB.fontSize,lineHeight:qB.lineHeight},".cm-foldGutter":{fontSize:qB.fontSize,lineHeight:qB.lineHeight},".cm-foldGutter .cm-gutterElement":{color:iV,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:nV},".cm-insertedLine":{textDecoration:KB.insertedTextDecoration,backgroundColor:OV,color:AV,padding:KB.insertedLinePadding,borderRadius:KB.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:KB.insertedTextDecoration,backgroundColor:`${OV} !important`,color:AV,padding:KB.insertedLinePadding,borderRadius:KB.borderRadious,border:`1px solid ${AV}30`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:KB.deletedTextDecoration,backgroundColor:kV,color:jV,padding:KB.insertedLinePadding,borderRadius:KB.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:KB.deletedTextDecoration,backgroundColor:`${kV} !important`,color:jV,padding:KB.insertedLinePadding,borderRadius:KB.borderRadious,border:`1px solid ${jV}30`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:yV,border:`1px solid ${hV}`,borderRadius:eV.borderRadius,padding:eV.padding,boxShadow:`0 1px 5px rgba(0, 0, 0, 0.1)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:yV,border:`none`},"& > ul > li":{padding:eV.padding,lineHeight:eV.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:`#0366d630`,color:nV,borderRadius:eV.borderRadiusSelected},"& > ul > li:hover":{backgroundColor:`#0366d615`},"& > ul > li > span.cm-completionIcon":{color:iV,paddingRight:eV.paddingRight},"& > ul > li > span.cm-completionDetail":{color:iV,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:yV,borderBottomColor:yV},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${_V}`},"&-warning":{borderLeft:`3px solid ${wV}`},"&-info":{borderLeft:`3px solid ${EV}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${_V}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${wV}`},".cm-matchingBracket":{backgroundColor:SV,outline:`1px solid ${CV}80`,borderRadius:XB.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#ffeef080`,outline:`1px solid ${_V}`,borderRadius:XB.borderRadius},".cm-selectionMatch":{backgroundColor:TV,outline:`1px solid ${rV}50`,borderRadius:XB.borderRadius},".cm-foldPlaceholder":{backgroundColor:TV,color:iV,border:`1px dotted ${hV}70`,borderRadius:ZB.borderRadius,padding:ZB.padding,margin:ZB.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${tV}, 0 0 0 3px ${EV}40`},"& .cm-scroller::-webkit-scrollbar":{width:QB.width,height:QB.height},"& .cm-scroller::-webkit-scrollbar-track":{background:hV},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:nV,borderRadius:QB.borderRadius,border:`3px solid ${hV}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:sV},".cm-ghostText":{opacity:`0.5`,color:`#959da5`}},{dark:!1}),D(B.define([{tag:A.keyword,color:uV,fontWeight:`bold`},{tag:A.controlKeyword,color:uV,fontWeight:`bold`},{tag:A.moduleKeyword,color:uV,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:lV},{tag:[A.variableName],color:lV},{tag:[A.propertyName],color:cV,fontStyle:`normal`},{tag:[A.typeName],color:uV},{tag:[A.className],color:cV,fontStyle:`italic`},{tag:[A.namespace],color:lV,fontStyle:`italic`},{tag:[A.operator,A.operatorKeyword],color:nV},{tag:[A.bracket],color:sV},{tag:[A.brace],color:sV},{tag:[A.punctuation],color:sV},{tag:[A.function(A.variableName),A.labelName],color:fV},{tag:[A.definition(A.variableName)],color:lV},{tag:A.number,color:pV},{tag:A.changed,color:pV},{tag:A.annotation,color:_V,fontStyle:`italic`},{tag:A.modifier,color:pV,fontStyle:`italic`},{tag:A.self,color:pV},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:pV},{tag:[A.atom,A.bool,A.special(A.variableName)],color:pV},{tag:[A.processingInstruction,A.inserted],color:fV},{tag:[A.special(A.string),A.regexp],color:dV},{tag:A.string,color:dV},{tag:A.definition(A.typeName),color:uV,fontWeight:`bold`},{tag:A.meta,color:sV},{tag:A.comment,fontStyle:`italic`,color:sV},{tag:A.docComment,fontStyle:`italic`,color:sV},{tag:[A.tagName],color:oV},{tag:[A.attributeName],color:cV},{tag:[A.heading],fontWeight:`bold`,color:lV},{tag:[A.strong],fontWeight:`bold`,color:lV},{tag:[A.emphasis],fontStyle:`italic`,color:dV},{tag:[A.link],color:DV,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:EV,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:nV,textDecoration:`underline wavy`,borderBottom:`1px wavy ${_V}`},{tag:[A.strikethrough],color:_V,textDecoration:`line-through`},{tag:A.constant(A.name),color:pV},{tag:A.deleted,color:_V},{tag:A.squareBracket,color:sV},{tag:A.angleBracket,color:sV},{tag:A.monospace,color:nV},{tag:[A.contentSeparator],color:lV},{tag:A.quote,color:sV}]))],NV={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},PV={borderLeftWidth:`2px`},FV={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},IV={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},LV={border:`none`,borderRadius:`4px`,padding:`2px 10px`},RV={borderRadius:`2px`},zV={borderRadius:`2px`},BV={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},VV={width:`12px`,height:`12px`,borderRadius:`6px`},HV={borderRadius:`4px`,padding:`2px 6px`},UV={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},WV=`#282828`,GV=`#3c3836`,KV=`#504945`,qV=`#665c54`,JV=`#7c6f64`,YV=`#928374`,XV=`#fbf1c7`,ZV=`#ebdbb2`,QV=`#fb4934`,$V=`#b8bb26`,eH=`#fabd2f`,tH=`#83a598`,nH=`#d3869b`,rH=`#8ec07c`,iH=`#fe8019`,aH=QV,oH=GV,sH=`#3c383660`,cH=WV,lH=GV,uH=KV,dH=`#665c5480`,fH=iH,pH=`#504945cc`,mH=eH,hH=eH,gH=tH,_H=nH,vH=`#32361a80`,yH=`#3c1f1e80`,bH=`#b8bb26`,xH=`#fb4934`,SH=[I.theme({"&":{color:ZV,backgroundColor:cH,fontSize:NV.fontSize,fontFamily:NV.fontFamily},".cm-content":{caretColor:fH,lineHeight:NV.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:fH,borderLeftWidth:PV.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${fH}99`,color:WV},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:uH},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#b57614cc`,outline:`1px solid ${eH}`,color:XV,borderRadius:HV.borderRadius,"& span":{color:XV}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:iH,color:WV,padding:HV.padding,"& span":{color:WV}},".cm-search.cm-panel.cm-textfield":{color:ZV,borderRadius:HV.borderRadius,padding:HV.padding},".cm-panels":{backgroundColor:lH,color:ZV,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${qV}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${qV}`},".cm-panel button":{backgroundColor:lH,color:ZV,border:LV.border,borderRadius:LV.borderRadius,padding:LV.padding},".cm-panel button:hover":{backgroundColor:KV},".cm-activeLine":{backgroundColor:sH,borderRadius:RV.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:GV,color:YV,border:IV.border,borderRight:`1px solid ${KV}`,paddingRight:IV.paddingRight},".cm-activeLineGutter":{backgroundColor:oH,color:ZV,fontWeight:IV.fontWeight},".cm-lineNumbers":{fontSize:IV.fontSize,lineHeight:IV.lineHeight},".cm-foldGutter":{fontSize:IV.fontSize,lineHeight:IV.lineHeight},".cm-foldGutter .cm-gutterElement":{color:YV,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:ZV},".cm-insertedLine":{textDecoration:FV.insertedTextDecoration,backgroundColor:vH,color:bH,padding:FV.insertedLinePadding,borderRadius:FV.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:FV.insertedTextDecoration,backgroundColor:`${vH} !important`,color:bH,padding:FV.insertedLinePadding,borderRadius:FV.borderRadious,border:`1px solid ${bH}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:FV.deletedTextDecoration,backgroundColor:yH,color:xH,padding:FV.insertedLinePadding,borderRadius:FV.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:FV.deletedTextDecoration,backgroundColor:`${yH} !important`,color:xH,padding:FV.insertedLinePadding,borderRadius:FV.borderRadious,border:`1px solid ${xH}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:lH,border:`1px solid ${qV}`,borderRadius:UV.borderRadius,padding:UV.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:lH,border:`none`},"& > ul > li":{padding:UV.padding,lineHeight:UV.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:uH,color:XV,borderRadius:UV.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:YV,paddingRight:UV.paddingRight},"& > ul > li > span.cm-completionDetail":{color:YV,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:lH,borderBottomColor:lH},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${aH}`},"&-warning":{borderLeft:`3px solid ${hH}`},"&-info":{borderLeft:`3px solid ${gH}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${aH}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${hH}`},".cm-matchingBracket":{backgroundColor:pH,outline:`1px solid ${mH}`,borderRadius:zV.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#cc241d55`,outline:`1px solid ${aH}`,borderRadius:zV.borderRadius},".cm-selectionMatch":{backgroundColor:dH,outline:`1px solid ${qV}`,borderRadius:zV.borderRadius},".cm-foldPlaceholder":{backgroundColor:lH,color:YV,border:`1px dotted ${qV}`,borderRadius:BV.borderRadius,padding:BV.padding,margin:BV.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${WV}, 0 0 0 3px ${iH}40`},"& .cm-scroller::-webkit-scrollbar":{width:VV.width,height:VV.height},"& .cm-scroller::-webkit-scrollbar-track":{background:GV},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:qV,borderRadius:VV.borderRadius,border:`3px solid ${GV}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:JV},".cm-ghostText":{opacity:`0.5`,color:YV}},{dark:!0}),D(B.define([{tag:A.keyword,color:QV,fontWeight:`bold`},{tag:A.controlKeyword,color:QV,fontWeight:`bold`},{tag:A.moduleKeyword,color:QV,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:tH},{tag:[A.variableName],color:tH},{tag:[A.propertyName],color:rH,fontStyle:`normal`},{tag:[A.typeName],color:rH},{tag:[A.className],color:eH,fontStyle:`italic`},{tag:[A.namespace],color:tH,fontStyle:`italic`},{tag:[A.operator,A.operatorKeyword],color:ZV},{tag:[A.bracket],color:YV},{tag:[A.brace],color:YV},{tag:[A.punctuation],color:YV},{tag:[A.function(A.variableName),A.labelName],color:eH},{tag:[A.definition(A.variableName)],color:tH},{tag:A.number,color:nH},{tag:A.changed,color:nH},{tag:A.annotation,color:aH,fontStyle:`italic`},{tag:A.modifier,color:nH,fontStyle:`italic`},{tag:A.self,color:nH},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:iH},{tag:[A.atom,A.bool,A.special(A.variableName)],color:iH},{tag:[A.processingInstruction,A.inserted],color:$V},{tag:[A.special(A.string),A.regexp],color:$V},{tag:A.string,color:$V},{tag:A.definition(A.typeName),color:rH,fontWeight:`bold`},{tag:A.meta,color:YV},{tag:A.comment,fontStyle:`italic`,color:YV},{tag:A.docComment,fontStyle:`italic`,color:YV},{tag:[A.tagName],color:QV},{tag:[A.attributeName],color:eH},{tag:[A.heading],fontWeight:`bold`,color:eH},{tag:[A.strong],fontWeight:`bold`,color:eH},{tag:[A.emphasis],fontStyle:`italic`,color:$V},{tag:[A.link],color:_H,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:gH,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:ZV,textDecoration:`underline wavy`,borderBottom:`1px wavy ${aH}`},{tag:[A.strikethrough],color:aH,textDecoration:`line-through`},{tag:A.constant(A.name),color:iH},{tag:A.deleted,color:aH},{tag:A.squareBracket,color:YV},{tag:A.angleBracket,color:YV},{tag:A.monospace,color:ZV},{tag:[A.contentSeparator],color:tH},{tag:A.quote,color:YV}]))],CH={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},wH={borderLeftWidth:`2px`},TH={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},EH={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},DH={border:`none`,borderRadius:`4px`,padding:`2px 10px`},OH={borderRadius:`2px`},kH={borderRadius:`2px`},AH={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},jH={width:`12px`,height:`12px`,borderRadius:`6px`},MH={borderRadius:`4px`,padding:`2px 6px`},NH={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},PH=`#3c3836`,FH=`#504945`,IH=`#665c54`,LH=`#7c6f64`,RH=`#928374`,zH=`#fbf1c7`,BH=`#ebdbb2`,VH=`#d5c4a1`,HH=`#bdae93`,UH=`#a89984`,WH=`#9d0006`,GH=`#79740e`,KH=`#b57614`,qH=`#076678`,JH=`#8f3f71`,YH=`#427b58`,XH=`#af3a03`,ZH=WH,QH=BH,$H=`#ffc42e25`,eU=zH,tU=BH,nU=QH,rU=`#ffc42e40`,iU=XH,aU=`#d5c4a180`,oU=XH,sU=KH,cU=qH,lU=JH,uU=`#d8e5bc80`,dU=`#f7cfcf80`,fU=`#79740e`,pU=`#9d0006`,mU=[I.theme({"&":{color:PH,backgroundColor:eU,fontSize:CH.fontSize,fontFamily:CH.fontFamily},".cm-content":{caretColor:iU,lineHeight:CH.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:iU,borderLeftWidth:wH.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${iU}99`,color:zH},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:nU,color:PH},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#ffc42e80`,outline:`1px solid ${XH}`,color:PH,borderRadius:MH.borderRadius,"& span":{color:PH}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:XH,color:zH,padding:MH.padding,"& span":{color:zH}},".cm-search.cm-panel.cm-textfield":{color:PH,borderRadius:MH.borderRadius,padding:MH.padding},".cm-panels":{backgroundColor:BH,color:FH,borderRadius:`0 0 4px 4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${HH}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${HH}`},".cm-panel button":{backgroundColor:zH,color:PH,border:DH.border,borderRadius:DH.borderRadius,padding:DH.padding},".cm-panel button:hover":{backgroundColor:VH},".cm-activeLine":{backgroundColor:$H,borderRadius:OH.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:BH,color:LH,border:EH.border,borderRight:`1px solid ${HH}`,paddingRight:EH.paddingRight},".cm-activeLineGutter":{backgroundColor:VH,color:PH,fontWeight:EH.fontWeight},".cm-lineNumbers":{fontSize:EH.fontSize,lineHeight:EH.lineHeight},".cm-foldGutter":{fontSize:EH.fontSize,lineHeight:EH.lineHeight},".cm-foldGutter .cm-gutterElement":{color:LH,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:PH},".cm-insertedLine":{textDecoration:TH.insertedTextDecoration,backgroundColor:uU,color:fU,padding:TH.insertedLinePadding,borderRadius:TH.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:TH.insertedTextDecoration,backgroundColor:`${uU} !important`,color:fU,padding:TH.insertedLinePadding,borderRadius:TH.borderRadious,border:`1px solid ${fU}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:TH.deletedTextDecoration,backgroundColor:dU,color:pU,padding:TH.insertedLinePadding,borderRadius:TH.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:TH.deletedTextDecoration,backgroundColor:`${dU} !important`,color:pU,padding:TH.insertedLinePadding,borderRadius:TH.borderRadious,border:`1px solid ${pU}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:tU,border:`1px solid ${HH}`,borderRadius:NH.borderRadius,padding:NH.padding,boxShadow:`0 1px 5px rgba(0, 0, 0, 0.1)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:tU,border:`none`},"& > ul > li":{padding:NH.padding,lineHeight:NH.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:XH+`30`,color:PH,borderRadius:NH.borderRadiusSelected},"& > ul > li:hover":{backgroundColor:XH+`15`},"& > ul > li > span.cm-completionIcon":{color:LH,paddingRight:NH.paddingRight},"& > ul > li > span.cm-completionDetail":{color:LH,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:tU,borderBottomColor:tU},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${ZH}`},"&-warning":{borderLeft:`3px solid ${sU}`},"&-info":{borderLeft:`3px solid ${cU}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${ZH}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${sU}`},".cm-matchingBracket":{backgroundColor:aU,outline:`1px solid ${oU}`,borderRadius:kH.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#fb492740`,outline:`1px solid ${ZH}`,borderRadius:kH.borderRadius},".cm-selectionMatch":{backgroundColor:rU,outline:`1px solid ${HH}`,borderRadius:kH.borderRadius},".cm-foldPlaceholder":{backgroundColor:`transparent`,color:IH,border:`1px dotted ${HH}`,borderRadius:AH.borderRadius,padding:AH.padding,margin:AH.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${zH}, 0 0 0 3px ${XH}40`},"& .cm-scroller::-webkit-scrollbar":{width:jH.width,height:jH.height},"& .cm-scroller::-webkit-scrollbar-track":{background:zH},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:HH,borderRadius:jH.borderRadius,border:`3px solid ${zH}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:UH},".cm-ghostText":{opacity:`0.5`,color:RH}},{dark:!1}),D(B.define([{tag:A.keyword,color:WH,fontWeight:`bold`},{tag:A.controlKeyword,color:WH,fontWeight:`bold`},{tag:A.moduleKeyword,color:WH,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:qH},{tag:[A.variableName],color:qH},{tag:[A.propertyName],color:YH,fontStyle:`normal`},{tag:[A.typeName],color:YH},{tag:[A.className],color:KH,fontStyle:`italic`},{tag:[A.namespace],color:qH,fontStyle:`italic`},{tag:[A.operator,A.operatorKeyword],color:PH},{tag:[A.bracket],color:RH},{tag:[A.brace],color:RH},{tag:[A.punctuation],color:RH},{tag:[A.function(A.variableName),A.labelName],color:KH},{tag:[A.definition(A.variableName)],color:qH},{tag:A.number,color:JH},{tag:A.changed,color:JH},{tag:A.annotation,color:ZH,fontStyle:`italic`},{tag:A.modifier,color:JH,fontStyle:`italic`},{tag:A.self,color:JH},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:XH},{tag:[A.atom,A.bool,A.special(A.variableName)],color:XH},{tag:[A.processingInstruction,A.inserted],color:GH},{tag:[A.special(A.string),A.regexp],color:GH},{tag:A.string,color:GH},{tag:A.definition(A.typeName),color:YH,fontWeight:`bold`},{tag:A.meta,color:RH},{tag:A.comment,fontStyle:`italic`,color:RH},{tag:A.docComment,fontStyle:`italic`,color:RH},{tag:[A.tagName],color:WH},{tag:[A.attributeName],color:KH},{tag:[A.heading],fontWeight:`bold`,color:KH},{tag:[A.strong],fontWeight:`bold`,color:KH},{tag:[A.emphasis],fontStyle:`italic`,color:GH},{tag:[A.link],color:lU,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:cU,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:PH,textDecoration:`underline wavy`,borderBottom:`1px wavy ${ZH}`},{tag:[A.strikethrough],color:ZH,textDecoration:`line-through`},{tag:A.constant(A.name),color:XH},{tag:A.deleted,color:ZH},{tag:A.squareBracket,color:RH},{tag:A.angleBracket,color:RH},{tag:A.monospace,color:PH},{tag:[A.contentSeparator],color:qH},{tag:A.quote,color:RH}]))],hU={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},gU={borderLeftWidth:`2px`},_U={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},vU={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},yU={border:`none`,borderRadius:`4px`,padding:`2px 10px`},bU={borderRadius:`2px`},xU={borderRadius:`2px`},SU={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},CU={width:`12px`,height:`12px`,borderRadius:`6px`},wU={borderRadius:`4px`,padding:`2px 6px`},TU={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},EU=`#212121`,DU=`#505d64`,OU=`#606f7a`,kU=`#707d8b`,AU=`#a0a4ae`,jU=`#bdbdbd`,MU=`#e0e0e0`,NU=`#202325`,PU=`#ff5f52`,FU=`#ff6e40`,IU=`#fa5788`,LU=`#facf4e`,RU=`#ffad42`,zU=`#56c8d8`,BU=`#7186f0`,VU=`#cf6edf`,HU=`#6abf69`,UU=`#99d066`,WU=`#4ebaaa`,GU=PU,KU=NU,qU=`#2d333b30`,JU=EU,YU=DU,XU=`#ffffff1f`,ZU=`#4A707A80`,QU=AU,$U=`#39496650`,eW=zU,tW=RU,nW=zU,rW=VU,iW=`#1e3d2780`,aW=`#4e282880`,oW=`#6abf69`,sW=`#ff5f52`,cW=[I.theme({"&":{color:jU,backgroundColor:JU,fontSize:hU.fontSize,fontFamily:hU.fontFamily},".cm-content":{caretColor:QU,lineHeight:hU.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:QU,borderLeftWidth:gU.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${QU}99`,color:JU},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:XU},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#394966cc`,outline:`1px solid ${zU}`,color:MU,borderRadius:wU.borderRadius,"& span":{color:MU}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:zU,color:JU,padding:wU.padding,"& span":{color:JU}},".cm-search.cm-panel.cm-textfield":{color:jU,borderRadius:wU.borderRadius,padding:wU.padding},".cm-panels":{backgroundColor:EU,color:jU,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${kU}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${kU}`},".cm-panel button":{backgroundColor:YU,color:jU,border:yU.border,borderRadius:yU.borderRadius,padding:yU.padding},".cm-panel button:hover":{backgroundColor:OU},".cm-activeLine":{backgroundColor:qU,borderRadius:bU.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:KU,color:kU,border:vU.border,borderRight:`1px solid ${DU}`,paddingRight:vU.paddingRight},".cm-activeLineGutter":{backgroundColor:`#252a2c`,color:jU,fontWeight:vU.fontWeight},".cm-lineNumbers":{fontSize:vU.fontSize,lineHeight:vU.lineHeight},".cm-foldGutter":{fontSize:vU.fontSize,lineHeight:vU.lineHeight},".cm-foldGutter .cm-gutterElement":{color:kU,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:jU},".cm-insertedLine":{textDecoration:_U.insertedTextDecoration,backgroundColor:iW,color:oW,padding:_U.insertedLinePadding,borderRadius:_U.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:_U.insertedTextDecoration,backgroundColor:`${iW} !important`,color:oW,padding:_U.insertedLinePadding,borderRadius:_U.borderRadious,border:`1px solid ${oW}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:_U.deletedTextDecoration,backgroundColor:aW,color:sW,padding:_U.insertedLinePadding,borderRadius:_U.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:_U.deletedTextDecoration,backgroundColor:`${aW} !important`,color:sW,padding:_U.insertedLinePadding,borderRadius:_U.borderRadious,border:`1px solid ${sW}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:YU,border:`1px solid ${kU}`,borderRadius:TU.borderRadius,padding:TU.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:YU,border:`none`},"& > ul > li":{padding:TU.padding,lineHeight:TU.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:XU,color:MU,borderRadius:TU.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:kU,paddingRight:TU.paddingRight},"& > ul > li > span.cm-completionDetail":{color:kU,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:YU,borderBottomColor:YU},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${GU}`},"&-warning":{borderLeft:`3px solid ${tW}`},"&-info":{borderLeft:`3px solid ${nW}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${GU}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${tW}`},".cm-matchingBracket":{backgroundColor:$U,outline:`1px solid ${eW}`,borderRadius:xU.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#ff5f5240`,outline:`1px solid ${GU}`,borderRadius:xU.borderRadius},".cm-selectionMatch":{backgroundColor:ZU,outline:`1px solid ${OU}50`,borderRadius:xU.borderRadius},".cm-foldPlaceholder":{backgroundColor:YU,color:kU,border:`1px dotted ${kU}70`,borderRadius:SU.borderRadius,padding:SU.padding,margin:SU.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${JU}, 0 0 0 3px ${zU}40`},"& .cm-scroller::-webkit-scrollbar":{width:CU.width,height:CU.height},"& .cm-scroller::-webkit-scrollbar-track":{background:KU},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:OU,borderRadius:CU.borderRadius,border:`3px solid ${KU}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:kU},".cm-ghostText":{opacity:`0.5`,color:kU}},{dark:!0}),D(B.define([{tag:A.keyword,color:PU,fontWeight:`bold`},{tag:A.controlKeyword,color:PU,fontWeight:`bold`},{tag:A.moduleKeyword,color:PU,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:BU},{tag:[A.variableName],color:UU},{tag:[A.propertyName],color:VU,fontStyle:`normal`},{tag:[A.typeName],color:PU},{tag:[A.className],color:LU,fontStyle:`italic`},{tag:[A.namespace],color:BU,fontStyle:`italic`},{tag:[A.operator,A.operatorKeyword],color:jU},{tag:[A.bracket],color:kU},{tag:[A.brace],color:kU},{tag:[A.punctuation],color:kU},{tag:[A.function(A.variableName)],color:zU},{tag:[A.labelName],color:zU,fontStyle:`italic`},{tag:[A.definition(A.function(A.variableName))],color:zU},{tag:[A.definition(A.variableName)],color:BU},{tag:A.number,color:LU},{tag:A.changed,color:LU},{tag:A.annotation,color:GU,fontStyle:`italic`},{tag:A.modifier,color:FU,fontStyle:`italic`},{tag:A.self,color:FU},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:FU},{tag:[A.atom,A.bool,A.special(A.variableName)],color:FU},{tag:[A.processingInstruction,A.inserted],color:HU},{tag:[A.special(A.string),A.regexp],color:IU},{tag:A.string,color:RU},{tag:A.definition(A.typeName),color:PU,fontWeight:`bold`},{tag:A.meta,color:kU},{tag:A.comment,fontStyle:`italic`,color:kU},{tag:A.docComment,fontStyle:`italic`,color:kU},{tag:[A.tagName],color:VU},{tag:[A.attributeName],color:LU},{tag:[A.heading],fontWeight:`bold`,color:WU},{tag:A.heading1,color:LU},{tag:A.heading2,color:RU},{tag:A.heading3,color:zU},{tag:A.heading4,color:BU},{tag:A.heading5,color:VU},{tag:A.heading6,color:PU},{tag:[A.strong],fontWeight:`bold`,color:BU},{tag:[A.emphasis],fontStyle:`italic`,color:RU},{tag:[A.link],color:rW,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:nW,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:jU,textDecoration:`underline wavy`,borderBottom:`1px wavy ${GU}`},{tag:[A.strikethrough],color:GU,textDecoration:`line-through`},{tag:A.constant(A.name),color:FU},{tag:A.deleted,color:GU},{tag:A.squareBracket,color:kU},{tag:A.angleBracket,color:kU},{tag:A.monospace,color:jU},{tag:[A.contentSeparator],color:BU},{tag:A.quote,color:kU}]))],lW={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},uW={borderLeftWidth:`2px`},dW={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},fW={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},pW={border:`none`,borderRadius:`4px`,padding:`2px 10px`},mW={borderRadius:`2px`},hW={borderRadius:`2px`},gW={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},_W={width:`12px`,height:`12px`,borderRadius:`6px`},vW={borderRadius:`4px`,padding:`2px 6px`},yW={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},bW=`#ffffff`,xW=`#f5f5f5`,SW=`#212121`,CW=`#757575`,wW=`#9e9e9e`,TW=`#424242`,EW=`#eeeeee`,DW=`#fafafa`,OW=`#f44336`,kW=`#ff3e00`,AW=`#FF00E9FF`,jW=`#ffc107`,MW=`#ff9800`,NW=`#00acc1`,PW=`#3949ab`,FW=`#8e24aa`,IW=`#43a047`,LW=`#00897b`,RW=`#1e88e5`,zW=OW,BW=`#00000008`,VW=bW,HW=xW,UW=`#DDEEFF`,WW=`#90a4ae26`,GW=wW,KW=`#DDEEFF80`,qW=NW,JW=MW,YW=NW,XW=FW,ZW=`#ECEFF180`,QW=`#e6ffed80`,$W=`#ffebe980`,eG=`#28a745`,tG=`#d73a49`,nG=[I.theme({"&":{color:SW,backgroundColor:VW,fontSize:lW.fontSize,fontFamily:lW.fontFamily},".cm-content":{caretColor:GW,lineHeight:lW.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:GW,borderLeftWidth:uW.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${SW}99`,color:VW},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:UW},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#FFA72680`,outline:`1px solid ${jW}`,color:SW,borderRadius:vW.borderRadius,"& span":{color:SW}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:NW,color:VW,padding:vW.padding,"& span":{color:VW}},".cm-search.cm-panel.cm-textfield":{color:SW,borderRadius:vW.borderRadius,padding:vW.padding},".cm-panels":{backgroundColor:EW,color:SW,borderRadius:`4px`,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${wW}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${wW}`},".cm-panel button":{backgroundColor:HW,color:SW,border:pW.border,borderRadius:pW.borderRadius,padding:pW.padding},".cm-panel button:hover":{backgroundColor:`#CFD8DC`},".cm-activeLine":{backgroundColor:BW,borderRadius:mW.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:DW,color:CW,border:fW.border,borderRight:`1px solid ${wW}`,paddingRight:fW.paddingRight},".cm-activeLineGutter":{backgroundColor:`#E0E0E0`,color:SW,fontWeight:fW.fontWeight},".cm-lineNumbers":{fontSize:fW.fontSize,lineHeight:fW.lineHeight},".cm-foldGutter":{fontSize:fW.fontSize,lineHeight:fW.lineHeight},".cm-foldGutter .cm-gutterElement":{color:CW,cursor:`pointer`,transition:`color 0.15s ease`},".cm-foldGutter .cm-gutterElement:hover":{color:SW},".cm-insertedLine":{textDecoration:dW.insertedTextDecoration,backgroundColor:QW,color:eG,padding:dW.insertedLinePadding,borderRadius:dW.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:dW.insertedTextDecoration,backgroundColor:`${QW} !important`,color:eG,padding:dW.insertedLinePadding,borderRadius:dW.borderRadious,border:`1px solid ${eG}30`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:dW.deletedTextDecoration,backgroundColor:$W,color:tG,padding:dW.insertedLinePadding,borderRadius:dW.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:dW.deletedTextDecoration,backgroundColor:`${$W} !important`,color:tG,padding:dW.insertedLinePadding,borderRadius:dW.borderRadious,border:`1px solid ${tG}30`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:HW,border:`1px solid ${wW}`,borderRadius:yW.borderRadius,padding:yW.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:HW,border:`none`},"& > ul > li":{padding:yW.padding,lineHeight:yW.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:ZW,color:SW,borderRadius:yW.borderRadiusSelected},"& > ul > li:hover":{backgroundColor:ZW},"& > ul > li > span.cm-completionIcon":{color:CW,paddingRight:yW.paddingRight},"& > ul > li > span.cm-completionDetail":{color:CW,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:HW,borderBottomColor:HW},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${zW}`},"&-warning":{borderLeft:`3px solid ${JW}`},"&-info":{borderLeft:`3px solid ${YW}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${zW}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${JW}`},".cm-matchingBracket":{backgroundColor:KW,outline:`1px solid ${qW}`,borderRadius:hW.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${zW}20`,outline:`1px solid ${zW}`,borderRadius:hW.borderRadius},".cm-selectionMatch":{backgroundColor:WW,outline:`1px solid ${CW}30`,borderRadius:hW.borderRadius},".cm-foldPlaceholder":{backgroundColor:xW,color:CW,border:`1px dotted ${CW}70`,borderRadius:gW.borderRadius,padding:gW.padding,margin:gW.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${VW}, 0 0 0 3px ${NW}40`},"& .cm-scroller::-webkit-scrollbar":{width:_W.width,height:_W.height},"& .cm-scroller::-webkit-scrollbar-track":{background:DW},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:CW,borderRadius:_W.borderRadius,border:`3px solid ${DW}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:SW},".cm-ghostText":{opacity:`0.5`,color:CW}},{dark:!1}),D(B.define([{tag:A.keyword,color:NW,fontWeight:`bold`},{tag:A.controlKeyword,color:NW,fontWeight:`bold`},{tag:A.moduleKeyword,color:NW,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:TW},{tag:[A.variableName],color:TW},{tag:[A.propertyName],color:LW,fontStyle:`normal`},{tag:[A.typeName],color:MW},{tag:[A.className],color:MW,fontStyle:`italic`},{tag:[A.namespace],color:PW,fontStyle:`italic`},{tag:[A.operator,A.operatorKeyword],color:PW},{tag:[A.bracket],color:FW},{tag:[A.brace],color:FW},{tag:[A.punctuation],color:CW},{tag:[A.function(A.variableName)],color:kW},{tag:[A.labelName],color:RW,fontStyle:`italic`},{tag:[A.definition(A.function(A.variableName))],color:kW},{tag:[A.definition(A.variableName)],color:AW},{tag:A.number,color:MW},{tag:A.changed,color:MW},{tag:A.annotation,color:zW,fontStyle:`italic`},{tag:A.modifier,color:MW,fontStyle:`italic`},{tag:A.self,color:MW},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:MW},{tag:[A.atom,A.bool],color:FW},{tag:[A.processingInstruction,A.inserted],color:IW},{tag:A.string,color:IW},{tag:[A.special(A.string),A.regexp],color:AW},{tag:A.definition(A.typeName),color:AW,fontWeight:`bold`},{tag:[A.definition(A.name),A.separator],color:AW},{tag:A.meta,color:CW},{tag:A.comment,fontStyle:`italic`,color:CW},{tag:A.docComment,fontStyle:`italic`,color:CW},{tag:[A.tagName],color:kW},{tag:[A.attributeName],color:TW},{tag:[A.heading],fontWeight:`bold`,color:LW},{tag:A.heading1,color:RW},{tag:A.heading2,color:MW},{tag:A.heading3,color:NW},{tag:A.heading4,color:PW},{tag:A.heading5,color:FW},{tag:A.heading6,color:IW},{tag:[A.strong],fontWeight:`bold`,color:PW},{tag:[A.emphasis],fontStyle:`italic`,color:MW},{tag:[A.link],color:XW,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:YW,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:SW,textDecoration:`underline wavy`,borderBottom:`1px dotted ${OW}`},{tag:[A.strikethrough],color:zW,textDecoration:`line-through`},{tag:A.constant(A.name),color:kW},{tag:A.deleted,color:zW},{tag:A.squareBracket,color:OW},{tag:A.angleBracket,color:SW},{tag:A.monospace,color:SW},{tag:[A.contentSeparator],color:NW},{tag:A.quote,color:IW}]))],rG={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},iG={borderLeftWidth:`2px`},aG={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},oG={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},sG={border:`none`,borderRadius:`4px`,padding:`2px 10px`},cG={borderRadius:`2px`},lG={borderRadius:`2px`},uG={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},dG={width:`12px`,height:`12px`,borderRadius:`6px`},fG={borderRadius:`4px`,padding:`2px 6px`},pG={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},mG=`#272822`,hG=`#f8f8f2`,gG=`#88846f`,_G=`#f8f8f0`,vG=`#F92672`,yG=`#FD971F`,bG=`#66D9EF`,xG=`#E6DB74`,SG=`#AE81FF`,CG=`#A6E22E`,wG=`#F44747`,TG=`#414339`,EG=`#3e3d3257`,DG=`#34352f`,OG=`#49483E`,kG=`#75715e70`,AG=_G,jG=`#75715E55`,MG=bG,NG=yG,PG=bG,FG=SG,IG=`#3d4d3880`,LG=`#4d393980`,RG=`#A6E22E`,zG=`#F92672`,BG=[I.theme({"&":{color:hG,backgroundColor:mG,fontSize:rG.fontSize,fontFamily:rG.fontFamily},".cm-content":{caretColor:AG,lineHeight:rG.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:AG,borderLeftWidth:iG.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${AG}99`,color:mG},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:OG},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#49483E99`,outline:`1px solid ${xG}`,color:hG,borderRadius:fG.borderRadius,"& span":{color:hG}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:vG,color:mG,padding:fG.padding,"& span":{color:mG}},".cm-search.cm-panel.cm-textfield":{color:hG,borderRadius:fG.borderRadius,padding:fG.padding},".cm-panels":{backgroundColor:TG,color:hG,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${gG}80`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${gG}80`},".cm-panel button":{backgroundColor:DG,color:hG,border:sG.border,borderRadius:sG.borderRadius,padding:sG.padding},".cm-panel button:hover":{backgroundColor:`#49483E`},".cm-activeLine":{backgroundColor:EG,borderRadius:cG.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:TG,color:gG,border:oG.border,borderRight:`1px solid #3e3d32`,paddingRight:oG.paddingRight},".cm-activeLineGutter":{backgroundColor:`#35352c`,color:hG,fontWeight:oG.fontWeight},".cm-lineNumbers":{fontSize:oG.fontSize,lineHeight:oG.lineHeight},".cm-foldGutter":{fontSize:oG.fontSize,lineHeight:oG.lineHeight},".cm-foldGutter .cm-gutterElement":{color:gG,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:hG},".cm-insertedLine":{textDecoration:aG.insertedTextDecoration,backgroundColor:IG,color:RG,padding:aG.insertedLinePadding,borderRadius:aG.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:aG.insertedTextDecoration,backgroundColor:`${IG} !important`,color:RG,padding:aG.insertedLinePadding,borderRadius:aG.borderRadious,border:`1px solid ${RG}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:aG.deletedTextDecoration,backgroundColor:LG,color:zG,padding:aG.insertedLinePadding,borderRadius:aG.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:aG.deletedTextDecoration,backgroundColor:`${LG} !important`,color:zG,padding:aG.insertedLinePadding,borderRadius:aG.borderRadious,border:`1px solid ${zG}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:DG,border:`1px solid #49483E`,borderRadius:pG.borderRadius,padding:pG.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.4)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:DG,border:`none`},"& > ul > li":{padding:pG.padding,lineHeight:pG.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:OG,color:hG,borderRadius:pG.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:gG,paddingRight:pG.paddingRight},"& > ul > li > span.cm-completionDetail":{color:gG,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:DG,borderBottomColor:DG},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${wG}`},"&-warning":{borderLeft:`3px solid ${NG}`},"&-info":{borderLeft:`3px solid ${PG}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${wG}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${NG}`},".cm-matchingBracket":{backgroundColor:jG,outline:`1px solid ${MG}`,borderRadius:lG.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`#f9267240`,outline:`1px solid ${wG}`,borderRadius:lG.borderRadius},".cm-selectionMatch":{backgroundColor:kG,outline:`1px solid ${gG}50`,borderRadius:lG.borderRadius},".cm-foldPlaceholder":{backgroundColor:DG,color:gG,border:`1px dotted ${gG}70`,borderRadius:uG.borderRadius,padding:uG.padding,margin:uG.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${mG}, 0 0 0 3px ${bG}40`},"& .cm-scroller::-webkit-scrollbar":{width:dG.width,height:dG.height},"& .cm-scroller::-webkit-scrollbar-track":{background:TG},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:`#49483E`,borderRadius:dG.borderRadius,border:`3px solid ${TG}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:`#5a594d`},".cm-ghostText":{opacity:`0.5`,color:gG}},{dark:!0}),D(B.define([{tag:A.keyword,color:vG,fontWeight:`bold`},{tag:A.controlKeyword,color:vG,fontWeight:`bold`},{tag:A.moduleKeyword,color:vG,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:yG},{tag:[A.variableName],color:yG},{tag:[A.propertyName],color:CG,fontStyle:`normal`},{tag:[A.typeName],color:bG,fontStyle:`italic`},{tag:[A.className],color:CG,fontStyle:`italic`},{tag:[A.namespace],color:yG,fontStyle:`italic`},{tag:[A.operator,A.operatorKeyword],color:vG},{tag:[A.bracket],color:hG},{tag:[A.brace],color:hG},{tag:[A.punctuation],color:hG},{tag:[A.function(A.variableName),A.labelName],color:bG},{tag:[A.definition(A.function(A.variableName))],color:bG},{tag:[A.definition(A.variableName)],color:yG},{tag:A.number,color:SG},{tag:A.changed,color:SG},{tag:A.annotation,color:wG,fontStyle:`italic`},{tag:A.modifier,color:SG,fontStyle:`italic`},{tag:A.self,color:SG},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:SG},{tag:[A.atom,A.bool,A.special(A.variableName)],color:SG},{tag:[A.processingInstruction,A.inserted],color:CG},{tag:[A.special(A.string),A.regexp],color:xG},{tag:A.string,color:xG},{tag:A.definition(A.typeName),color:bG,fontWeight:`bold`},{tag:A.meta,color:gG},{tag:A.comment,fontStyle:`italic`,color:gG},{tag:A.docComment,fontStyle:`italic`,color:gG},{tag:[A.tagName],color:vG},{tag:[A.attributeName],color:CG},{tag:[A.heading],fontWeight:`bold`,color:CG},{tag:[A.strong],fontWeight:`bold`,color:yG},{tag:[A.emphasis],fontStyle:`italic`,color:yG},{tag:[A.link],color:FG,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:PG,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:hG,textDecoration:`underline wavy`,borderBottom:`1px wavy ${wG}`},{tag:[A.strikethrough],color:wG,textDecoration:`line-through`},{tag:A.constant(A.name),color:SG},{tag:A.deleted,color:wG},{tag:A.squareBracket,color:hG},{tag:A.angleBracket,color:hG},{tag:A.monospace,color:hG},{tag:[A.contentSeparator],color:yG},{tag:A.quote,color:gG}]))],VG={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},HG={borderLeftWidth:`2px`},UG={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},WG={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},GG={border:`none`,borderRadius:`4px`,padding:`2px 10px`},KG={borderRadius:`2px`},qG={borderRadius:`2px`},JG={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},YG={width:`12px`,height:`12px`,borderRadius:`6px`},XG={borderRadius:`4px`,padding:`2px 6px`},ZG={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},QG=`#2e3440`,$G=`#3b4252`,eK=`#434c5e`,tK=`#4c566a`,nK=`#d8dee9`,rK=`#eceff4`,iK=`#8fbcbb`,aK=`#88c0d0`,oK=`#81a1c1`,sK=`#5e81ac`,cK=`#bf616a`,lK=`#d08770`,uK=`#ebcb8b`,dK=`#a3be8c`,fK=`#b48ead`,pK=`#d30102`,mK=`#252a33`,hK=`#3b425277`,gK=QG,_K=$G,vK=eK,yK=`#4c566a80`,bK=nK,xK=`#4c566a55`,SK=aK,CK=uK,wK=oK,TK=fK,EK=`#3b4a3880`,DK=`#4a393a80`,OK=`#a3be8c`,kK=`#bf616a`,AK=[I.theme({"&":{color:nK,backgroundColor:gK,fontSize:VG.fontSize,fontFamily:VG.fontFamily},".cm-content":{caretColor:bK,lineHeight:VG.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:bK,borderLeftWidth:HG.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${bK}99`,color:gK},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:vK},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#5e81ac80`,outline:`1px solid ${iK}`,color:nK,borderRadius:XG.borderRadius,"& span":{color:nK}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:oK,color:rK,padding:XG.padding,"& span":{color:rK}},".cm-search.cm-panel.cm-textfield":{color:nK,borderRadius:XG.borderRadius,padding:XG.padding},".cm-panels":{backgroundColor:mK,color:nK,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${tK}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${tK}`},".cm-panel button":{backgroundColor:_K,color:nK,border:GG.border,borderRadius:GG.borderRadius,padding:GG.padding},".cm-panel button:hover":{backgroundColor:eK},".cm-activeLine":{backgroundColor:hK,borderRadius:KG.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:mK,color:tK,border:WG.border,borderRight:`1px solid ${eK}`,paddingRight:WG.paddingRight},".cm-activeLineGutter":{backgroundColor:$G,color:nK,fontWeight:WG.fontWeight},".cm-lineNumbers":{fontSize:WG.fontSize,lineHeight:WG.lineHeight},".cm-foldGutter":{fontSize:WG.fontSize,lineHeight:WG.lineHeight},".cm-foldGutter .cm-gutterElement":{color:tK,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:nK},".cm-insertedLine":{textDecoration:UG.insertedTextDecoration,backgroundColor:EK,color:OK,padding:UG.insertedLinePadding,borderRadius:UG.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:UG.insertedTextDecoration,backgroundColor:`${EK} !important`,color:OK,padding:UG.insertedLinePadding,borderRadius:UG.borderRadious,border:`1px solid ${OK}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:UG.deletedTextDecoration,backgroundColor:DK,color:kK,padding:UG.insertedLinePadding,borderRadius:UG.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:UG.deletedTextDecoration,backgroundColor:`${DK} !important`,color:kK,padding:UG.insertedLinePadding,borderRadius:UG.borderRadious,border:`1px solid ${kK}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:_K,border:`1px solid ${tK}`,borderRadius:ZG.borderRadius,padding:ZG.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:_K,border:`none`},"& > ul > li":{padding:ZG.padding,lineHeight:ZG.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:eK,color:rK,borderRadius:ZG.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:tK,paddingRight:ZG.paddingRight},"& > ul > li > span.cm-completionDetail":{color:tK,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:_K,borderBottomColor:_K},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${cK}`},"&-warning":{borderLeft:`3px solid ${CK}`},"&-info":{borderLeft:`3px solid ${wK}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${cK}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${CK}`},".cm-matchingBracket":{backgroundColor:xK,outline:`1px solid ${SK}`,borderRadius:qG.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${cK}40`,outline:`1px solid ${pK}`,borderRadius:qG.borderRadius},".cm-selectionMatch":{backgroundColor:yK,outline:`1px solid ${eK}50`,borderRadius:qG.borderRadius},".cm-foldPlaceholder":{backgroundColor:_K,color:tK,border:`1px dotted ${tK}70`,borderRadius:JG.borderRadius,padding:JG.padding,margin:JG.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${gK}, 0 0 0 3px ${aK}40`},"& .cm-scroller::-webkit-scrollbar":{width:YG.width,height:YG.height},"& .cm-scroller::-webkit-scrollbar-track":{background:mK},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:eK,borderRadius:YG.borderRadius,border:`3px solid ${mK}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:tK},".cm-ghostText":{opacity:`0.5`,color:tK}},{dark:!0}),D(B.define([{tag:A.keyword,color:sK,fontWeight:`bold`},{tag:A.controlKeyword,color:sK,fontWeight:`bold`},{tag:A.moduleKeyword,color:sK,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:aK},{tag:[A.variableName],color:nK},{tag:[A.propertyName],color:aK,fontStyle:`normal`},{tag:[A.typeName],color:uK},{tag:[A.className],color:uK,fontStyle:`italic`},{tag:[A.namespace],color:oK,fontStyle:`italic`},{tag:[A.operator,A.operatorKeyword],color:fK},{tag:[A.bracket],color:nK},{tag:[A.brace],color:iK},{tag:[A.punctuation],color:nK},{tag:[A.function(A.variableName),A.labelName],color:iK},{tag:[A.definition(A.function(A.variableName))],color:iK},{tag:[A.definition(A.variableName)],color:lK},{tag:A.number,color:lK},{tag:A.changed,color:fK},{tag:A.annotation,color:cK,fontStyle:`italic`},{tag:A.modifier,color:fK,fontStyle:`italic`},{tag:A.self,color:fK},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:lK},{tag:[A.atom,A.bool,A.special(A.variableName)],color:fK},{tag:[A.processingInstruction,A.inserted],color:iK},{tag:[A.special(A.string),A.regexp],color:fK},{tag:A.string,color:dK},{tag:A.definition(A.typeName),color:uK,fontWeight:`bold`},{tag:[A.definition(A.name),A.separator],color:dK},{tag:A.meta,color:tK},{tag:A.comment,fontStyle:`italic`,color:tK},{tag:A.docComment,fontStyle:`italic`,color:tK},{tag:[A.tagName],color:cK},{tag:[A.attributeName],color:uK},{tag:[A.heading],fontWeight:`bold`,color:oK},{tag:[A.strong],fontWeight:`bold`,color:aK},{tag:[A.emphasis],fontStyle:`italic`,color:uK},{tag:[A.link],color:TK,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:wK,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:nK,textDecoration:`underline wavy`,borderBottom:`1px wavy ${cK}`},{tag:[A.strikethrough],color:cK,textDecoration:`line-through`},{tag:A.constant(A.name),color:lK},{tag:A.deleted,color:cK},{tag:A.squareBracket,color:cK},{tag:A.angleBracket,color:lK},{tag:A.monospace,color:nK,fontStyle:`italic`},{tag:[A.contentSeparator],color:oK},{tag:A.quote,color:fK}]))],jK={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},MK={borderLeftWidth:`2px`},NK={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},PK={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},FK={border:`none`,borderRadius:`4px`,padding:`2px 10px`},IK={borderRadius:`2px`},LK={borderRadius:`2px`},RK={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},zK={width:`12px`,height:`12px`,borderRadius:`6px`},BK={borderRadius:`4px`,padding:`2px 6px`},VK={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},HK=`#e1e2e7`,UK=`#3760bf`,WK=`#99a7df`,GK=`#848cb5`,KK=`#8c91a8`,qK=`#3760bf`,JK=`#e9e9ec`,YK=`#d5d6db`,XK=`#f52a65`,ZK=`#b15c00`,QK=`#8c6c3e`,$K=`#587539`,eq=`#007197`,tq=`#2e7de9`,nq=`#7847bd`,rq=`#9854f1`,iq=XK,aq=YK,oq=`#5F5FAF5A`,sq=HK,cq=JK,lq=`#99a7df40`,Zge=`#99a7df60`,uq=UK,Qge=`#0e639c20`,$ge=eq,dq=ZK,fq=eq,e_e=nq,pq=`#58753920`,mq=`#f52a6520`,hq=`#587539`,gq=`#f52a65`,t_e=[I.theme({"&":{color:qK,backgroundColor:sq,fontSize:jK.fontSize,fontFamily:jK.fontFamily},".cm-content":{caretColor:uq,lineHeight:jK.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:uq,borderLeftWidth:MK.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${uq}99`,color:sq},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:lq},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#0e639c40`,outline:`1px solid ${eq}`,color:qK,borderRadius:BK.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:eq,color:sq,padding:BK.padding,"& span":{color:sq}},".cm-search.cm-panel.cm-textfield":{color:qK,borderRadius:BK.borderRadius,padding:BK.padding},".cm-panels":{backgroundColor:JK,color:qK,borderRadius:`4px`,boxShadow:`0 1px 3px rgba(0, 0, 0, 0.1)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${GK}30`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${GK}30`},".cm-panel button":{backgroundColor:cq,color:qK,border:FK.border,borderRadius:FK.borderRadius,padding:FK.padding},".cm-panel button:hover":{backgroundColor:YK,border:`1px solid ${WK}`},".cm-activeLine":{backgroundColor:oq,borderRadius:IK.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:aq,color:GK,border:PK.border,borderRight:`1px solid ${YK}`,paddingRight:PK.paddingRight},".cm-activeLineGutter":{color:UK,fontWeight:PK.fontWeight},".cm-lineNumbers":{fontSize:PK.fontSize,lineHeight:PK.lineHeight},".cm-foldGutter":{fontSize:PK.fontSize,lineHeight:PK.lineHeight},".cm-foldGutter .cm-gutterElement":{color:GK,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:UK},".cm-insertedLine":{textDecoration:NK.insertedTextDecoration,backgroundColor:pq,color:hq,padding:NK.insertedLinePadding,borderRadius:NK.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:NK.insertedTextDecoration,backgroundColor:`${pq} !important`,color:hq,padding:NK.insertedLinePadding,borderRadius:NK.borderRadious,border:`1px solid ${hq}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:NK.deletedTextDecoration,backgroundColor:mq,color:gq,padding:NK.insertedLinePadding,borderRadius:NK.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:NK.deletedTextDecoration,backgroundColor:`${mq} !important`,color:gq,padding:NK.insertedLinePadding,borderRadius:NK.borderRadious,border:`1px solid ${gq}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:cq,border:`1px solid ${KK}40`,borderRadius:VK.borderRadius,padding:VK.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:cq,border:`none`,maxHeight:`300px`},"& > ul > li":{padding:VK.padding,lineHeight:VK.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:lq,color:UK,borderRadius:VK.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:GK,paddingRight:VK.paddingRight},"& > ul > li > span.cm-completionDetail":{color:GK,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:cq,borderBottomColor:cq},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${iq}`},"&-warning":{borderLeft:`3px solid ${dq}`},"&-info":{borderLeft:`3px solid ${fq}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${iq}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${dq}`},".cm-matchingBracket":{backgroundColor:Qge,outline:`1px solid ${$ge}`,borderRadius:LK.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${XK}20`,outline:`1px solid ${iq}`,borderRadius:LK.borderRadius},".cm-selectionMatch":{backgroundColor:Zge,outline:`1px solid ${WK}50`,borderRadius:LK.borderRadius},".cm-foldPlaceholder":{backgroundColor:cq,color:GK,border:`1px dotted ${GK}70`,borderRadius:RK.borderRadius,padding:RK.padding,margin:RK.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${sq}, 0 0 0 3px ${eq}40`},"& .cm-scroller::-webkit-scrollbar":{width:zK.width,height:zK.height},"& .cm-scroller::-webkit-scrollbar-track":{background:aq},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:GK,borderRadius:zK.borderRadius,border:`3px solid ${aq}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:WK},".cm-ghostText":{opacity:`0.5`,color:GK}},{dark:!1}),D(B.define([{tag:A.keyword,color:eq,fontWeight:`bold`},{tag:A.controlKeyword,color:eq,fontWeight:`bold`},{tag:A.moduleKeyword,color:eq,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:tq},{tag:[A.variableName],color:UK},{tag:[A.propertyName],color:tq,fontStyle:`normal`},{tag:[A.typeName],color:eq},{tag:[A.className],color:QK,fontStyle:`italic`},{tag:[A.namespace],color:nq,fontStyle:`italic`},{tag:[A.operator,A.operatorKeyword],color:nq},{tag:[A.bracket],color:GK},{tag:[A.brace],color:GK},{tag:[A.punctuation],color:GK},{tag:[A.function(A.variableName)],color:eq},{tag:[A.labelName],color:nq,fontStyle:`italic`},{tag:[A.definition(A.function(A.variableName))],color:eq},{tag:[A.definition(A.variableName)],color:tq},{tag:A.number,color:ZK},{tag:A.changed,color:ZK},{tag:A.annotation,color:iq,fontStyle:`italic`},{tag:A.modifier,color:ZK,fontStyle:`italic`},{tag:A.self,color:ZK},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:ZK},{tag:[A.atom,A.bool,A.special(A.variableName)],color:ZK},{tag:[A.processingInstruction,A.inserted],color:$K},{tag:[A.special(A.string),A.regexp],color:rq},{tag:A.string,color:$K},{tag:A.definition(A.typeName),color:eq,fontWeight:`bold`},{tag:[A.definition(A.name),A.separator],color:tq},{tag:A.meta,color:GK},{tag:A.comment,fontStyle:`italic`,color:GK},{tag:A.docComment,fontStyle:`italic`,color:GK},{tag:[A.tagName],color:nq},{tag:[A.attributeName],color:QK},{tag:[A.heading],fontWeight:`bold`,color:ZK},{tag:A.heading1,color:ZK,fontWeight:`bold`},{tag:A.heading2,color:ZK},{tag:A.heading3,color:ZK},{tag:A.heading4,color:eq},{tag:A.heading5,color:eq},{tag:A.heading6,color:eq},{tag:[A.strong],fontWeight:`bold`,color:UK},{tag:[A.emphasis],fontStyle:`italic`,color:$K},{tag:[A.link],color:e_e,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:fq,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:UK,textDecoration:`underline wavy`,borderBottom:`1px wavy ${iq}`},{tag:[A.strikethrough],color:iq,textDecoration:`line-through`},{tag:A.constant(A.name),color:ZK},{tag:A.deleted,color:iq},{tag:A.squareBracket,color:GK},{tag:A.angleBracket,color:GK},{tag:A.monospace,color:UK},{tag:[A.contentSeparator],color:tq},{tag:A.quote,color:GK}]))],_q={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},n_e={borderLeftWidth:`2px`},vq={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},yq={border:`none`,paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},bq={border:`none`,borderRadius:`4px`,padding:`2px 10px`},r_e={borderRadius:`2px`},xq={borderRadius:`2px`},Sq={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},Cq={width:`12px`,height:`12px`,borderRadius:`6px`},wq={borderRadius:`4px`,padding:`2px 6px`},Tq={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},i_e=`#24283b`,Eq=`#414868`,Dq=`#565f89`,Oq=`#c0caf5`,kq=`#282e44`,Aq=`#1f2335`,a_e=`#f7768e`,jq=`#ff9e64`,Mq=`#e0af68`,Nq=`#9ece6a`,Pq=`#2ac3de`,Fq=`#7aa2f7`,Iq=`#bb9af7`,Lq=`#f7768e`,Rq=Aq,o_e=`#292e427a`,zq=i_e,Bq=kq,Vq=`#6f7bb630`,s_e=`#6f7bb650`,Hq=Oq,c_e=`#3d59a150`,l_e=Fq,Uq=jq,Wq=Pq,u_e=Iq,Gq=`#3b4a3880`,Kq=`#4a393a80`,qq=`#9ece6a`,Jq=`#f7768e`,d_e=[I.theme({"&":{color:Oq,backgroundColor:zq,fontSize:_q.fontSize,fontFamily:_q.fontFamily},".cm-content":{caretColor:Hq,lineHeight:_q.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:Hq,borderLeftWidth:n_e.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${Hq}99`,color:zq},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Vq},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#7aa2f740`,outline:`1px solid ${Fq}`,color:Oq,borderRadius:wq.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:Fq,color:zq,padding:wq.padding,"& span":{color:zq}},".cm-search.cm-panel.cm-textfield":{color:Oq,borderRadius:wq.borderRadius,padding:wq.padding},".cm-panels":{backgroundColor:kq,color:Oq,borderRadius:`4px`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${Dq}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${Dq}`},".cm-panel button":{backgroundColor:Bq,color:Oq,border:bq.border,borderRadius:bq.borderRadius,padding:bq.padding},".cm-panel button:hover":{backgroundColor:Aq},".cm-activeLine":{backgroundColor:o_e,borderRadius:r_e.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:Rq,color:Dq,border:yq.border,borderRight:`1px solid ${Aq}`,paddingRight:yq.paddingRight},".cm-activeLineGutter":{backgroundColor:Aq,color:Oq,fontWeight:yq.fontWeight},".cm-lineNumbers":{fontSize:yq.fontSize,lineHeight:yq.lineHeight},".cm-foldGutter":{fontSize:yq.fontSize,lineHeight:yq.lineHeight},".cm-foldGutter .cm-gutterElement":{color:Dq,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:Oq},".cm-insertedLine":{textDecoration:vq.insertedTextDecoration,backgroundColor:Gq,color:qq,padding:vq.insertedLinePadding,borderRadius:vq.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:vq.insertedTextDecoration,backgroundColor:`${Gq} !important`,color:qq,padding:vq.insertedLinePadding,borderRadius:vq.borderRadious,border:`1px solid ${qq}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:vq.deletedTextDecoration,backgroundColor:Kq,color:Jq,padding:vq.insertedLinePadding,borderRadius:vq.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:vq.deletedTextDecoration,backgroundColor:`${Kq} !important`,color:Jq,padding:vq.insertedLinePadding,borderRadius:vq.borderRadious,border:`1px solid ${Jq}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:Bq,border:`1px solid ${Dq}`,borderRadius:Tq.borderRadius,padding:Tq.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:Bq,border:`none`},"& > ul > li":{padding:Tq.padding,lineHeight:Tq.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:Vq,color:Oq,borderRadius:Tq.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:Dq,paddingRight:Tq.paddingRight},"& > ul > li > span.cm-completionDetail":{color:Dq,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Bq,borderBottomColor:Bq},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${Lq}`},"&-warning":{borderLeft:`3px solid ${Uq}`},"&-info":{borderLeft:`3px solid ${Wq}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${Lq}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${Uq}`},".cm-matchingBracket":{backgroundColor:c_e,outline:`1px solid ${l_e}`,borderRadius:xq.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${a_e}20`,outline:`1px solid ${Lq}`,borderRadius:xq.borderRadius},".cm-selectionMatch":{backgroundColor:s_e,outline:`1px solid ${Eq}50`,borderRadius:xq.borderRadius},".cm-foldPlaceholder":{backgroundColor:Bq,color:Dq,border:`1px dotted ${Dq}70`,borderRadius:Sq.borderRadius,padding:Sq.padding,margin:Sq.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 2px ${zq}, 0 0 0 3px ${Fq}40`},"& .cm-scroller::-webkit-scrollbar":{width:Cq.width,height:Cq.height},"& .cm-scroller::-webkit-scrollbar-track":{background:Rq},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:Eq,borderRadius:Cq.borderRadius,border:`3px solid ${Rq}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:Dq},".cm-ghostText":{opacity:`0.5`,color:Dq}},{dark:!0}),D(B.define([{tag:A.keyword,color:Iq,fontWeight:`bold`},{tag:A.controlKeyword,color:Iq,fontWeight:`bold`},{tag:A.moduleKeyword,color:Iq,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:Oq},{tag:[A.variableName],color:Oq},{tag:[A.propertyName],color:Fq,fontStyle:`normal`},{tag:[A.typeName],color:Pq},{tag:[A.className],color:Mq,fontStyle:`italic`},{tag:[A.namespace],color:Fq,fontStyle:`italic`},{tag:[A.operator,A.operatorKeyword],color:Iq},{tag:[A.bracket],color:Dq},{tag:[A.brace],color:Dq},{tag:[A.punctuation],color:Dq},{tag:[A.function(A.variableName)],color:Fq},{tag:[A.labelName],color:Fq,fontStyle:`italic`},{tag:[A.definition(A.function(A.variableName))],color:Fq},{tag:[A.definition(A.variableName)],color:Oq},{tag:A.number,color:jq},{tag:A.changed,color:jq},{tag:A.annotation,color:Lq,fontStyle:`italic`},{tag:A.modifier,color:jq,fontStyle:`italic`},{tag:A.self,color:jq},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:Iq},{tag:[A.atom,A.bool,A.special(A.variableName)],color:jq},{tag:[A.processingInstruction,A.inserted],color:Nq},{tag:[A.special(A.string),A.regexp],color:`#b4f9f8`},{tag:A.string,color:Nq},{tag:A.definition(A.typeName),color:Pq,fontWeight:`bold`},{tag:[A.definition(A.name),A.separator],color:Oq},{tag:A.meta,color:Dq},{tag:A.comment,fontStyle:`italic`,color:Dq},{tag:A.docComment,fontStyle:`italic`,color:Dq},{tag:[A.tagName],color:Iq},{tag:[A.attributeName],color:Mq},{tag:[A.heading],fontWeight:`bold`,color:`#89ddff`},{tag:A.heading1,color:`#89ddff`,fontWeight:`bold`},{tag:A.heading2,color:`#89ddff`},{tag:A.heading3,color:`#89ddff`},{tag:A.heading4,color:`#89ddff`},{tag:A.heading5,color:`#89ddff`},{tag:A.heading6,color:`#89ddff`},{tag:[A.strong],fontWeight:`bold`,color:Oq},{tag:[A.emphasis],fontStyle:`italic`,color:Pq},{tag:[A.link],color:u_e,fontWeight:`500`,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:Wq,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:Oq,textDecoration:`underline wavy`,borderBottom:`1px wavy ${Lq}`},{tag:[A.strikethrough],color:Lq,textDecoration:`line-through`},{tag:A.constant(A.name),color:jq},{tag:A.deleted,color:Lq},{tag:A.squareBracket,color:Dq},{tag:A.angleBracket,color:Dq},{tag:A.monospace,color:Oq},{tag:[A.contentSeparator],color:Fq},{tag:A.quote,color:Dq}]))],Yq={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},f_e={borderLeftWidth:`2px`},Xq={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},Zq={paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},Qq={borderRadius:`4px`,padding:`2px 10px`},p_e={borderRadius:`2px`},$q={borderRadius:`2px`},eJ={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},tJ={width:`12px`,height:`12px`,borderRadius:`6px`},nJ={borderRadius:`4px`,padding:`2px 6px`},rJ={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},m_e=`#1e1e1e`,iJ=`#252526`,aJ=`#2d2d30`,oJ=`#838383`,h_e=`#c6c6c6`,sJ=`#d4d4d4`,cJ=`#e9e9e9`,g_e=`#1c1c1c`,lJ=`#569cd6`,__e=`#c586c0`,uJ=`#9cdcfe`,dJ=`#4ec9b0`,fJ=`#dcdcaa`,v_e=`#b5cea8`,pJ=`#ce9178`,mJ=`#f44747`,hJ=`#d7ba7d`,gJ=`#6a9955`,_J=mJ,vJ=`#FFFFFF08`,yJ=m_e,bJ=iJ,y_e=`#264F7899`,b_e=`#72a1ff59`,xJ=h_e,x_e=`#ffffff15`,S_e=lJ,SJ=hJ,CJ=`#3794ff`,C_e=`#c586c0`,wJ=`#1e3f1e80`,TJ=`#4b1c1c80`,EJ=`#6cc26f`,DJ=`#f14c4c`,w_e=[I.theme({"&":{color:sJ,backgroundColor:yJ,fontSize:Yq.fontSize,fontFamily:Yq.fontFamily},".cm-content":{caretColor:xJ,lineHeight:Yq.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:xJ,borderLeftWidth:f_e.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${xJ}99`,color:yJ},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:y_e},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#72a1ff40`,outline:`1px solid ${lJ}90`,color:cJ,borderRadius:nJ.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#3794ff90`,color:cJ,padding:nJ.padding,"& span":{color:cJ}},".cm-search.cm-panel.cm-textfield":{color:sJ,borderRadius:nJ.borderRadius,padding:nJ.padding},".cm-panels":{backgroundColor:iJ,color:sJ,borderRadius:`3px`,boxShadow:`0 2px 6px rgba(0, 0, 0, 0.45)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${aJ}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${aJ}`},".cm-panel button":{backgroundColor:aJ,color:sJ,border:`1px solid ${aJ}`,borderRadius:Qq.borderRadius,padding:Qq.padding},".cm-panel button:hover":{backgroundColor:`#3a3a3a`,border:`1px solid ${oJ}80`},".cm-activeLine":{backgroundColor:vJ,borderRadius:p_e.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:g_e,color:oJ,border:`none`,borderRight:`1px solid ${aJ}`,paddingRight:Zq.paddingRight},".cm-activeLineGutter":{backgroundColor:vJ,color:cJ,fontWeight:Zq.fontWeight},".cm-lineNumbers":{fontSize:Zq.fontSize,lineHeight:Zq.lineHeight},".cm-foldGutter":{fontSize:Zq.fontSize,lineHeight:Zq.lineHeight},".cm-foldGutter .cm-gutterElement":{color:oJ,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:cJ},".cm-insertedLine":{textDecoration:Xq.insertedTextDecoration,backgroundColor:wJ,color:EJ,padding:Xq.insertedLinePadding,borderRadius:Xq.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:Xq.insertedTextDecoration,backgroundColor:`${wJ} !important`,color:EJ,padding:Xq.insertedLinePadding,borderRadius:Xq.borderRadious,border:`1px solid ${EJ}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:Xq.deletedTextDecoration,backgroundColor:TJ,color:DJ,padding:Xq.insertedLinePadding,borderRadius:Xq.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:Xq.deletedTextDecoration,backgroundColor:`${TJ} !important`,color:DJ,padding:Xq.insertedLinePadding,borderRadius:Xq.borderRadious,border:`1px solid ${DJ}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:bJ,border:`1px solid ${aJ}`,borderRadius:rJ.borderRadius,padding:rJ.padding,boxShadow:`0 3px 8px rgba(0, 0, 0, 0.3)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:bJ,border:`none`,maxHeight:`300px`},"& > ul > li":{padding:rJ.padding,lineHeight:rJ.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:`#04395e`,color:cJ,borderRadius:rJ.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:oJ,paddingRight:rJ.paddingRight},"& > ul > li > span.cm-completionDetail":{color:oJ,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:bJ,borderBottomColor:bJ},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${_J}`},"&-warning":{borderLeft:`3px solid ${SJ}`},"&-info":{borderLeft:`3px solid ${CJ}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${_J}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${SJ}`},".cm-matchingBracket":{backgroundColor:x_e,outline:`1px solid ${S_e}80`,borderRadius:$q.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${mJ}40`,outline:`1px solid ${_J}`,borderRadius:$q.borderRadius},".cm-selectionMatch":{backgroundColor:b_e,outline:`1px solid ${aJ}70`,borderRadius:$q.borderRadius},".cm-foldPlaceholder":{backgroundColor:bJ,color:oJ,border:`1px dotted ${oJ}70`,borderRadius:eJ.borderRadius,padding:eJ.padding,margin:eJ.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 1px ${aJ}`},"& .cm-scroller::-webkit-scrollbar":{width:tJ.width,height:tJ.height},"& .cm-scroller::-webkit-scrollbar-track":{background:yJ},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:`#424242`,borderRadius:tJ.borderRadius,border:`3px solid ${yJ}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:`#525252`},".cm-ghostText":{opacity:`0.5`,color:oJ}},{dark:!0}),D(B.define([{tag:A.keyword,color:lJ,fontWeight:`bold`},{tag:A.controlKeyword,color:__e,fontWeight:`bold`},{tag:A.moduleKeyword,color:lJ,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:sJ},{tag:[A.variableName],color:uJ},{tag:[A.propertyName],color:uJ,fontStyle:`normal`},{tag:[A.typeName],color:dJ},{tag:[A.className],color:dJ,fontStyle:`normal`},{tag:[A.namespace],color:sJ,fontStyle:`normal`},{tag:[A.operator,A.operatorKeyword],color:sJ},{tag:[A.bracket],color:sJ},{tag:[A.brace],color:sJ},{tag:[A.punctuation],color:sJ},{tag:[A.function(A.variableName)],color:fJ},{tag:[A.labelName],color:fJ,fontStyle:`normal`},{tag:[A.definition(A.function(A.variableName))],color:fJ},{tag:[A.definition(A.variableName)],color:uJ},{tag:A.number,color:v_e},{tag:A.changed,color:hJ},{tag:A.annotation,color:hJ,fontStyle:`italic`},{tag:A.modifier,color:lJ,fontStyle:`normal`},{tag:A.self,color:lJ},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:uJ},{tag:[A.atom,A.bool,A.special(A.variableName)],color:lJ},{tag:[A.processingInstruction,A.inserted],color:pJ},{tag:[A.special(A.string),A.regexp],color:`#d16969`},{tag:A.string,color:pJ},{tag:A.definition(A.typeName),color:dJ,fontWeight:`bold`},{tag:[A.definition(A.name),A.separator],color:sJ},{tag:A.meta,color:oJ},{tag:A.comment,fontStyle:`italic`,color:gJ},{tag:A.docComment,fontStyle:`italic`,color:gJ},{tag:[A.tagName],color:lJ},{tag:[A.attributeName],color:uJ},{tag:[A.heading],fontWeight:`bold`,color:lJ},{tag:A.heading1,color:lJ,fontWeight:`bold`},{tag:A.heading2,color:lJ},{tag:A.heading3,color:lJ},{tag:A.heading4,color:lJ},{tag:A.heading5,color:lJ},{tag:A.heading6,color:lJ},{tag:[A.strong],fontWeight:`bold`,color:lJ},{tag:[A.emphasis],fontStyle:`italic`,color:dJ},{tag:[A.link],color:C_e,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:CJ,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:sJ,textDecoration:`underline wavy`,borderBottom:`1px wavy ${_J}`},{tag:[A.strikethrough],color:_J,textDecoration:`line-through`},{tag:A.constant(A.name),color:uJ},{tag:A.deleted,color:_J},{tag:A.squareBracket,color:sJ},{tag:A.angleBracket,color:sJ},{tag:A.monospace,color:sJ},{tag:[A.contentSeparator],color:sJ},{tag:A.quote,color:gJ}]))],OJ={fontSize:`14px`,fontFamily:`JetBrains Mono, Consolas, monospace`,lineHeight:`1.6`},T_e={borderLeftWidth:`2px`},kJ={insertedTextDecoration:`none`,deletedTextDecoration:`line-through`,insertedLinePadding:`1px 3px`,borderRadious:`3px`},AJ={paddingRight:`8px`,fontSize:`0.9em`,fontWeight:`500`,lineHeight:`1.78`},jJ={borderRadius:`4px`,padding:`2px 10px`},E_e={borderRadius:`2px`},MJ={borderRadius:`2px`},NJ={borderRadius:`4px`,padding:`0 5px`,margin:`0 2px`},PJ={width:`12px`,height:`12px`,borderRadius:`6px`},FJ={borderRadius:`4px`,padding:`2px 6px`},IJ={borderRadius:`4px`,borderRadiusSelected:`3px`,lineHeight:`1.3`,padding:`4px 8px`,paddingRight:`8px`},D_e=`#ffffff`,LJ=`#f3f3f3`,RJ=`#d6d6d6`,zJ=`#6b6b6b`,O_e=`#000000`,BJ=`#383a42`,VJ=`#1f1f1f`,k_e=`#f5f5f5`,HJ=`#0064ff`,UJ=`#af00db`,WJ=`#0070c1`,GJ=`#267f99`,KJ=`#795e26`,A_e=`#098658`,qJ=`#a31515`,JJ=`#e51400`,YJ=`#795e26`,XJ=`#008000`,ZJ=JJ,QJ=`#99999926`,$J=D_e,eY=LJ,j_e=`#add6ff`,M_e=`#a8ac9480`,tY=O_e,N_e=`#007acc20`,P_e=`#007acc`,nY=`#bf8803`,rY=`#006ab1`,F_e=`#9e46d0`,iY=`#ddfbe0`,aY=`#ffebec`,oY=`#22863a`,sY=`#e51400`,I_e=[I.theme({"&":{color:BJ,backgroundColor:$J,fontSize:OJ.fontSize,fontFamily:OJ.fontFamily},".cm-content":{caretColor:tY,lineHeight:OJ.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:tY,borderLeftWidth:T_e.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${tY}99`,color:$J},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:j_e},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:`#bbdefb`,outline:`1px solid ${WJ}90`,color:VJ,borderRadius:FJ.borderRadius},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#90caf9`,color:VJ,padding:FJ.padding,"& span":{color:VJ}},".cm-search.cm-panel.cm-textfield":{color:BJ,borderRadius:FJ.borderRadius,padding:FJ.padding},".cm-panels":{backgroundColor:LJ,color:BJ,borderRadius:`3px`,boxShadow:`0 2px 6px rgba(0, 0, 0, 0.15)`},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${RJ}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${RJ}`},".cm-panel button":{backgroundColor:$J,color:BJ,border:`1px solid ${RJ}`,borderRadius:jJ.borderRadius,padding:jJ.padding},".cm-panel button:hover":{backgroundColor:`#e8e8e8`,border:`1px solid ${zJ}80`},".cm-activeLine":{backgroundColor:QJ,borderRadius:E_e.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:k_e,color:`#237893`,border:`none`,borderRight:`1px solid ${RJ}`,paddingRight:AJ.paddingRight},".cm-activeLineGutter":{backgroundColor:QJ,color:`#0b216f`,fontWeight:AJ.fontWeight},".cm-lineNumbers":{fontSize:AJ.fontSize,lineHeight:AJ.lineHeight},".cm-foldGutter":{fontSize:AJ.fontSize,lineHeight:AJ.lineHeight},".cm-foldGutter .cm-gutterElement":{color:`#237893`,cursor:`pointer`},".cm-foldGutter .cm-gutterElement:hover":{color:`#0b216f`},".cm-insertedLine":{textDecoration:kJ.insertedTextDecoration,backgroundColor:iY,color:oY,padding:kJ.insertedLinePadding,borderRadius:kJ.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:kJ.insertedTextDecoration,backgroundColor:`${iY} !important`,color:oY,padding:kJ.insertedLinePadding,borderRadius:kJ.borderRadious,border:`1px solid ${oY}40`},"ins.cm-insertedLine .cm-changedText":{background:`transparent !important`},".cm-deletedLine":{textDecoration:kJ.deletedTextDecoration,backgroundColor:aY,color:sY,padding:kJ.insertedLinePadding,borderRadius:kJ.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:kJ.deletedTextDecoration,backgroundColor:`${aY} !important`,color:sY,padding:kJ.insertedLinePadding,borderRadius:kJ.borderRadious,border:`1px solid ${sY}40`},"del .cm-deletedText, del .cm-changedText":{background:`transparent !important`},".cm-tooltip":{backgroundColor:eY,border:`1px solid ${RJ}`,borderRadius:IJ.borderRadius,padding:IJ.padding,boxShadow:`0 2px 8px rgba(0, 0, 0, 0.15)`},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:eY,border:`none`,maxHeight:`300px`},"& > ul > li":{padding:IJ.padding,lineHeight:IJ.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:`#dcebfc`,color:VJ,borderRadius:IJ.borderRadiusSelected},"& > ul > li > span.cm-completionIcon":{color:zJ,paddingRight:IJ.paddingRight},"& > ul > li > span.cm-completionDetail":{color:zJ,fontStyle:`italic`}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:eY,borderBottomColor:eY},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${ZJ}`},"&-warning":{borderLeft:`3px solid ${nY}`},"&-info":{borderLeft:`3px solid ${rY}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${ZJ}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${nY}`},".cm-matchingBracket":{backgroundColor:N_e,outline:`1px solid ${P_e}80`,borderRadius:MJ.borderRadius},".cm-nonmatchingBracket":{backgroundColor:`${JJ}20`,outline:`1px solid ${ZJ}`,borderRadius:MJ.borderRadius},".cm-selectionMatch":{backgroundColor:M_e,outline:`1px solid ${RJ}70`,borderRadius:MJ.borderRadius},".cm-foldPlaceholder":{backgroundColor:eY,color:zJ,border:`1px dotted ${zJ}70`,borderRadius:NJ.borderRadius,padding:NJ.padding,margin:NJ.margin},"&.cm-focused":{outline:`none`,boxShadow:`0 0 0 1px ${RJ}`},"& .cm-scroller::-webkit-scrollbar":{width:PJ.width,height:PJ.height},"& .cm-scroller::-webkit-scrollbar-track":{background:$J},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:`#dadada`,borderRadius:PJ.borderRadius,border:`3px solid ${$J}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:`#cccccc`},".cm-ghostText":{opacity:`0.5`,color:zJ}},{dark:!1}),D(B.define([{tag:A.keyword,color:HJ,fontWeight:`bold`},{tag:A.controlKeyword,color:UJ,fontWeight:`bold`},{tag:A.moduleKeyword,color:HJ,fontWeight:`bold`},{tag:[A.name,A.deleted,A.character,A.macroName],color:BJ},{tag:[A.variableName],color:WJ},{tag:[A.propertyName],color:WJ,fontStyle:`normal`},{tag:[A.typeName],color:GJ},{tag:[A.className],color:GJ,fontStyle:`normal`},{tag:[A.namespace],color:BJ,fontStyle:`normal`},{tag:[A.operator,A.operatorKeyword],color:BJ},{tag:[A.bracket],color:BJ},{tag:[A.brace],color:BJ},{tag:[A.punctuation],color:BJ},{tag:[A.function(A.variableName)],color:KJ},{tag:[A.labelName],color:KJ,fontStyle:`normal`},{tag:[A.definition(A.function(A.variableName))],color:KJ},{tag:[A.definition(A.variableName)],color:WJ},{tag:A.number,color:A_e},{tag:A.changed,color:YJ},{tag:A.annotation,color:YJ,fontStyle:`italic`},{tag:A.modifier,color:HJ,fontStyle:`normal`},{tag:A.self,color:HJ},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:WJ},{tag:[A.atom,A.bool,A.special(A.variableName)],color:HJ},{tag:[A.processingInstruction,A.inserted],color:qJ},{tag:[A.special(A.string),A.regexp],color:UJ},{tag:A.string,color:qJ},{tag:A.definition(A.typeName),color:GJ,fontWeight:`bold`},{tag:[A.definition(A.name),A.separator],color:BJ},{tag:A.meta,color:zJ},{tag:A.comment,fontStyle:`italic`,color:XJ},{tag:A.docComment,fontStyle:`italic`,color:XJ},{tag:[A.tagName],color:HJ},{tag:[A.attributeName],color:WJ},{tag:[A.heading],fontWeight:`bold`,color:HJ},{tag:A.heading1,color:HJ,fontWeight:`bold`},{tag:A.heading2,color:HJ},{tag:A.heading3,color:HJ},{tag:A.heading4,color:HJ},{tag:A.heading5,color:HJ},{tag:A.heading6,color:HJ},{tag:[A.strong],fontWeight:`bold`,color:HJ},{tag:[A.emphasis],fontStyle:`italic`,color:WJ},{tag:[A.link],color:F_e,textDecoration:`underline`,textUnderlinePosition:`under`},{tag:[A.url],color:rY,textDecoration:`underline`,textUnderlineOffset:`2px`},{tag:[A.invalid],color:BJ,textDecoration:`underline wavy`,borderBottom:`1px wavy ${ZJ}`},{tag:[A.strikethrough],color:ZJ,textDecoration:`line-through`},{tag:A.constant(A.name),color:WJ},{tag:A.deleted,color:ZJ},{tag:A.squareBracket,color:BJ},{tag:A.angleBracket,color:BJ},{tag:A.monospace,color:BJ},{tag:[A.contentSeparator],color:BJ},{tag:A.quote,color:XJ}]))];function cY(){return cY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cY.apply(null,arguments)}function L_e(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var lY=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,uY=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(lY(e)):lY,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Re(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=ve(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=P(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n;;e++){let a=r.charCodeAt(e),o=this.match(a,i,this.bufferPos+this.bufferStart);if(e==r.length-1){if(o)return this.value=o,this;break}i==n&&e<t.length&&t.charCodeAt(e)==a&&i++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let i=this.matches[t],a=!1;this.query.charCodeAt(i)==e&&(i==this.query.length-1?r={from:this.matches[t+1],to:n}:(this.matches[t]++,a=!0)),a||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}};typeof Symbol<`u`&&(uY.prototype[Symbol.iterator]=function(){return this});var dY={from:-1,to:-1,match:/.*/.exec(``)},fY=`gm`+(/x/.unicode==null?``:`u`),pY=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=dY,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new gY(e,t,n,r,i);this.re=new RegExp(t,fY+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter(),this.curLineStart=e.lineAt(r).from,this.matchPos=_Y(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=_Y(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},mY=new WeakMap,hY=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=mY.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return mY.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),mY.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},gY=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=dY,this.matchPos=_Y(e,r),this.re=new RegExp(t,fY+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=hY.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=_Y(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=hY.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(pY.prototype[Symbol.iterator]=gY.prototype[Symbol.iterator]=function(){return this});function R_e(e){try{return new RegExp(e,fY),!0}catch{return!1}}function _Y(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}function vY(e){let t=je(`input`,{class:`cm-textfield`,name:`line`,value:String(e.state.doc.lineAt(e.state.selection.main.head).number)}),n=je(`form`,{class:`cm-gotoLine`,onkeydown:t=>{t.keyCode==27?(t.preventDefault(),e.dispatch({effects:yY.of(!1)}),e.focus()):t.keyCode==13&&(t.preventDefault(),r())},onsubmit:e=>{e.preventDefault(),r()}},je(`label`,e.state.phrase(`Go to line`),`: `,t),` `,je(`button`,{class:`cm-button`,type:`submit`},e.state.phrase(`go`)),je(`button`,{name:`close`,onclick:()=>{e.dispatch({effects:yY.of(!1)}),e.focus()},"aria-label":e.state.phrase(`close`),type:`button`},[`×`]));function r(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:r}=e,i=r.doc.lineAt(r.selection.main.head),[,a,o,s,c]=n,l=s?+s.slice(1):0,u=o?+o:i.number;if(o&&c){let e=u/100;a&&(e=e*(a==`-`?-1:1)+i.number/r.doc.lines),u=Math.round(r.doc.lines*e)}else o&&a&&(u=u*(a==`-`?-1:1)+i.number);let d=r.doc.line(Math.max(1,Math.min(r.doc.lines,u))),f=le.cursor(d.from+Math.max(0,Math.min(l,d.length)));e.dispatch({effects:[yY.of(!1),I.scrollIntoView(f.from,{y:`center`})],selection:f}),e.focus()}return{dom:n}}var yY=V.define(),bY=Be.define({create(){return!0},update(e,t){for(let n of t.effects)n.is(yY)&&(e=n.value);return e},provide:e=>ne.from(e,e=>e?vY:null)}),z_e=e=>{let t=De(e,vY);if(!t){let n=[yY.of(!0)];e.state.field(bY,!1)??n.push(V.appendConfig.of([bY,B_e])),e.dispatch({effects:n}),t=De(e,vY)}return t&&t.dom.querySelector(`input`).select(),!0},B_e=I.baseTheme({".cm-panel.cm-gotoLine":{padding:`2px 6px 4px`,position:`relative`,"& label":{fontSize:`80%`},"& [name=close]":{position:`absolute`,top:`0`,bottom:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:`0`}}}),V_e={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},xY=xe.define({combine(e){return f(e,V_e,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function H_e(e){let t=[q_e,K_e];return e&&t.push(xY.of(e)),t}var U_e=Ve.mark({class:`cm-selectionMatch`}),W_e=Ve.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function SY(e,t,n,r){return(n==0||e(t.sliceDoc(n-1,n))!=oe.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=oe.Word)}function G_e(e,t,n,r){return e(t.sliceDoc(n,n+1))==oe.Word&&e(t.sliceDoc(r-1,r))==oe.Word}var K_e=g.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(xY),{state:n}=e,r=n.selection;if(r.ranges.length>1)return Ve.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return Ve.none;let e=n.wordAt(i.head);if(!e)return Ve.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return Ve.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(SY(o,n,i.from,i.to)&&G_e(o,n,i.from,i.to)))return Ve.none}else if(a=n.sliceDoc(i.from,i.to),!a)return Ve.none}let s=[];for(let r of e.visibleRanges){let e=new uY(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||SY(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(W_e.range(r,a)):(r>=i.to||a<=i.from)&&s.push(U_e.range(r,a)),s.length>t.maxMatches))return Ve.none}}return Ve.set(s)}},{decorations:e=>e.decorations}),q_e=I.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),J_e=({state:e,dispatch:t})=>{let{selection:n}=e,r=le.create(n.ranges.map(t=>e.wordAt(t.head)||le.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function Y_e(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new uY(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new uY(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var X_e=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return J_e({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=Y_e(e,r);return i?(t(e.update({selection:e.selection.addRange(le.range(i.from,i.to),!1),effects:I.scrollIntoView(i.to)})),!0):!1},CY=xe.define({combine(e){return f(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new cve(e),scrollToMatch:e=>I.scrollIntoView(e)})}}),wY=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||R_e(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
354
354
  `:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new eve(this):new Q_e(this)}getCursor(e,t=0,n){let r=e.doc?e:Ee.create({doc:e});return n??=r.doc.length,this.regexp?DY(this,r,t,n):EY(this,r,t,n)}},TY=class{constructor(e){this.spec=e}};function EY(e,t,n,r){return new uY(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?Z_e(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function Z_e(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(OY(i,n-a))!=oe.Word||t(kY(i,n-a))!=oe.Word)&&(t(kY(i,r-a))!=oe.Word||t(OY(i,r-a))!=oe.Word))}var Q_e=class extends TY{constructor(e){super(e)}nextMatch(e,t,n){let r=EY(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=EY(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=EY(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=EY(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=EY(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function DY(e,t,n,r){return new pY(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?$_e(t.charCategorizer(t.selection.main.head)):void 0},n,r)}function OY(e,t){return e.slice(E(e,t,!1),t)}function kY(e,t){return e.slice(t,E(e,t))}function $_e(e){return(t,n,r)=>!r[0].length||(e(OY(r.input,r.index))!=oe.Word||e(kY(r.input,r.index))!=oe.Word)&&(e(kY(r.input,r.index+r[0].length))!=oe.Word||e(OY(r.input,r.index+r[0].length))!=oe.Word)}var eve=class extends TY{nextMatch(e,t,n){let r=DY(this.spec,e,n,e.doc.length).next();return r.done&&(r=DY(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=DY(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=DY(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=DY(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},AY=V.define(),jY=V.define(),MY=Be.define({create(e){return new NY(zY(e).create(),null)},update(e,t){for(let n of t.effects)n.is(AY)?e=new NY(n.value.create(),e.panel):n.is(jY)&&(e=new NY(e.query,n.value?RY:null));return e},provide:e=>ne.from(e,e=>e.panel)}),NY=class{constructor(e,t){this.query=e,this.panel=t}},tve=Ve.mark({class:`cm-searchMatch`}),nve=Ve.mark({class:`cm-searchMatch cm-searchMatch-selected`}),rve=g.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(MY))}update(e){let t=e.state.field(MY);(t!=e.startState.field(MY)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Ve.none;let{view:n}=this,r=new Ie;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?nve:tve)})}return r.finish()}},{decorations:e=>e.decorations});function PY(e){return t=>{let n=t.state.field(MY,!1);return n&&n.query.spec.valid?e(t,n):HY(t)}}var FY=PY((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=le.single(r.from,r.to),a=e.state.facet(CY);return e.dispatch({selection:i,effects:[qY(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),VY(e),!0}),IY=PY((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=le.single(i.from,i.to),o=e.state.facet(CY);return e.dispatch({selection:a,effects:[qY(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),VY(e),!0}),ive=PY((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:le.create(n.map(e=>le.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),ave=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new uY(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(le.range(t.value.from,t.value.to))}return t(e.update({selection:le.create(a,o),userEvent:`select.search.matches`})),!0},LY=PY((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,u=[];o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),u.push(I.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`)));let d=e.state.changes(s);return o&&(c=le.single(o.from,o.to).map(d),u.push(qY(e,o)),u.push(n.facet(CY).scrollToMatch(c.main,e))),e.dispatch({changes:d,selection:c,effects:u,userEvent:`input.replace`}),!0}),ove=PY((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}});if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:I.announce.of(r),userEvent:`input.replace.all`}),!0});function RY(e){return e.state.facet(CY).createPanel(e)}function zY(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(CY);return new wY({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function BY(e){let t=De(e,RY);return t&&t.dom.querySelector(`[main-field]`)}function VY(e){let t=BY(e);t&&t==e.root.activeElement&&t.select()}var HY=e=>{let t=e.state.field(MY,!1);if(t&&t.panel){let n=BY(e);if(n&&n!=e.root.activeElement){let r=zY(e.state,t.query.spec);r.valid&&e.dispatch({effects:AY.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[jY.of(!0),t?AY.of(zY(e.state,t.query.spec)):V.appendConfig.of(uve)]});return!0},UY=e=>{let t=e.state.field(MY,!1);if(!t||!t.panel)return!1;let n=De(e,RY);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:jY.of(!1)}),!0},sve=[{key:`Mod-f`,run:HY,scope:`editor search-panel`},{key:`F3`,run:FY,shift:IY,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:FY,shift:IY,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:UY,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:ave},{key:`Mod-Alt-g`,run:z_e},{key:`Mod-d`,run:X_e,preventDefault:!0}],cve=class{constructor(e){this.view=e;let t=this.query=e.state.field(MY).query.spec;this.commit=this.commit.bind(this),this.searchField=je(`input`,{value:t.search,placeholder:WY(e,`Find`),"aria-label":WY(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=je(`input`,{value:t.replace,placeholder:WY(e,`Replace`),"aria-label":WY(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=je(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=je(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=je(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return je(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=je(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>FY(e),[WY(e,`next`)]),n(`prev`,()=>IY(e),[WY(e,`previous`)]),n(`select`,()=>ive(e),[WY(e,`all`)]),je(`label`,null,[this.caseField,WY(e,`match case`)]),je(`label`,null,[this.reField,WY(e,`regexp`)]),je(`label`,null,[this.wordField,WY(e,`by word`)]),...e.state.readOnly?[]:[je(`br`),this.replaceField,n(`replace`,()=>LY(e),[WY(e,`replace`)]),n(`replaceAll`,()=>ove(e),[WY(e,`replace all`)])],je(`button`,{name:`close`,onclick:()=>UY(e),"aria-label":WY(e,`close`),type:`button`},[`×`])])}commit(){let e=new wY({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:AY.of(e)}))}keydown(e){me(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?IY:FY)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),LY(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(AY)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(CY).top}};function WY(e,t){return e.state.phrase(t)}var GY=30,KY=/[\s\.,:;?!]/;function qY(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-GY),o=Math.min(i,n+GY),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<GY;e++)if(!KY.test(s[e+1])&&KY.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-GY;e--)if(!KY.test(s[e-1])&&KY.test(s[e])){s=s.slice(0,e);break}}return I.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var lve=I.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),uve=[MY,de.low(rve),lve],JY=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},YY=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(nX).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new Ie,s=[],c=0,l=r.doc.iter(),u=0,d=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>d)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,d);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==d))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let f=Sve(s);if(i)o.add(n,n,Ve.widget({widget:new vve(f),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,Ve.mark({class:`cm-lintRange cm-lintRange-`+f+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==d)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let f=o.finish();return new e(f,n,XY(f))}};function XY(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new JY(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new JY(r.from,n,r.diagnostic)}),r}function dve(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(nX).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(ZY))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function fve(e,t){return e.field(eX,!1)?t:t.concat(V.appendConfig.of(Cve))}var ZY=V.define(),QY=V.define(),$Y=V.define(),eX=Be.define({create(){return new YY(Ve.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=XY(n,e.selected.diagnostic,i)||XY(n,null,i)}!n.size&&i&&t.state.facet(nX).autoPanel&&(i=null),e=new YY(n,i,r)}for(let n of t.effects)if(n.is(ZY)){let r=t.state.facet(nX).autoPanel?n.value.length?sX.open:null:e.panel;e=YY.init(n.value,r,t.state)}else n.is(QY)?e=new YY(e.diagnostics,n.value?sX.open:null,e.selected):n.is($Y)&&(e=new YY(e.diagnostics,e.panel,n.value));return e},provide:e=>[ne.from(e,e=>e.panel),I.decorations.from(e,e=>e.diagnostics)]}),pve=Ve.mark({class:`cm-lintRange cm-lintRange-active`});function mve(e,t,n){let{diagnostics:r}=e.state.field(eX),i,a=-1,o=-1;r.between(t-(n<0?1:0),t+(n>0?1:0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(nX).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:e.state.doc.lineAt(a).to<o,create(){return{dom:hve(e,i)}}}:null}function hve(e,t){return je(`ul`,{class:`cm-tooltip-lint`},t.map(t=>aX(e,t,!1)))}var gve=e=>{let t=e.state.field(eX,!1);(!t||!t.panel)&&e.dispatch({effects:fve(e.state,[QY.of(!0)])});let n=De(e,sX.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},tX=e=>{let t=e.state.field(eX,!1);return!t||!t.panel?!1:(e.dispatch({effects:QY.of(!1)}),!0)},_ve=[{key:`Mod-Shift-m`,run:gve,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(eX,!1);if(!t)return!1;let n=e.state.selection.main,r=t.diagnostics.iter(n.to+1);return!r.value&&(r=t.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)}}],nX=xe.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...f(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:rX,tooltipFilter:rX,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function rX(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function iX(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function aX(e,t,n){let r=n?iX(t.actions):[];return je(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},je(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=XY(e.state.field(eX).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),je(`u`,s.slice(c,c+1)),s.slice(c+1)];return je(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&je(`div`,{class:`cm-diagnosticSource`},t.source))}var vve=class extends F{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return je(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},oX=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=aX(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},sX=class e{constructor(e){this.view=e,this.items=[];let t=t=>{if(t.keyCode==27)tX(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=iX(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=XY(this.view.state.field(eX).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()},n=e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)};this.list=je(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t,onclick:n}),this.dom=je(`div`,{class:`cm-panel-lint`},this.list,je(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>tX(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(eX).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(eX),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new oX(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new oX(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=XY(this.view.state.field(eX).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:$Y.of(t)})}static open(t){return new e(t)}};function yve(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function cX(e){return yve(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var bve=I.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:cX(`#d11`)},".cm-lintRange-warning":{backgroundImage:cX(`orange`)},".cm-lintRange-info":{backgroundImage:cX(`#999`)},".cm-lintRange-hint":{backgroundImage:cX(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}}});function xve(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function Sve(e){let t=`hint`,n=1;for(let r of e){let e=xve(r.severity);e>n&&(n=e,t=r.severity)}return t}var Cve=[eX,I.decorations.compute([eX],e=>{let{selected:t,panel:n}=e.field(eX);return!t||!n||t.from==t.to?Ve.none:Ve.set([pve.range(t.from,t.to)])}),k(mve,{hideOn:dve}),bve],lX=function(e){e===void 0&&(e={});var{crosshairCursor:t=!1}=e,n=[];e.closeBracketsKeymap!==!1&&(n=n.concat(qe)),e.defaultKeymap!==!1&&(n=n.concat(Kme)),e.searchKeymap!==!1&&(n=n.concat(sve)),e.historyKeymap!==!1&&(n=n.concat(eme)),e.foldKeymap!==!1&&(n=n.concat(j)),e.completionKeymap!==!1&&(n=n.concat(Ye)),e.lintKeymap!==!1&&(n=n.concat(_ve));var a=[];return e.lineNumbers!==!1&&a.push(se()),e.highlightActiveLineGutter!==!1&&a.push(L()),e.highlightSpecialChars!==!1&&a.push(z()),e.history!==!1&&a.push(Gpe()),e.foldGutter!==!1&&a.push(re()),e.drawSelection!==!1&&a.push(h()),e.dropCursor!==!1&&a.push(y()),e.allowMultipleSelections!==!1&&a.push(Ee.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&a.push(T()),e.syntaxHighlighting!==!1&&a.push(D(ue,{fallback:!0})),e.bracketMatching!==!1&&a.push(Te()),e.closeBrackets!==!1&&a.push(Xe()),e.autocompletion!==!1&&a.push(Je()),e.rectangularSelection!==!1&&a.push(ke()),t!==!1&&a.push(ee()),e.highlightActiveLine!==!1&&a.push(R()),e.highlightSelectionMatches!==!1&&a.push(H_e()),e.tabSize&&typeof e.tabSize==`number`&&a.push(i.of(` `.repeat(e.tabSize))),a.concat([r.of(n.flat())]).filter(Boolean)},wve=`#e5c07b`,uX=`#e06c75`,Tve=`#56b6c2`,Eve=`#ffffff`,dX=`#abb2bf`,fX=`#7d8799`,Dve=`#61afef`,Ove=`#98c379`,pX=`#d19a66`,kve=`#c678dd`,Ave=`#21252b`,mX=`#2c313a`,hX=`#282c34`,gX=`#353a42`,jve=`#3E4451`,_X=`#528bff`,Mve=[I.theme({"&":{color:dX,backgroundColor:hX},".cm-content":{caretColor:_X},".cm-cursor, .cm-dropCursor":{borderLeftColor:_X},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:jve},".cm-panels":{backgroundColor:Ave,color:dX},".cm-panels.cm-panels-top":{borderBottom:`2px solid black`},".cm-panels.cm-panels-bottom":{borderTop:`2px solid black`},".cm-searchMatch":{backgroundColor:`#72a1ff59`,outline:`1px solid #457dff`},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:`#6199ff2f`},".cm-activeLine":{backgroundColor:`#6699ff0b`},".cm-selectionMatch":{backgroundColor:`#aafe661a`},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:`#bad0f847`},".cm-gutters":{backgroundColor:hX,color:fX,border:`none`},".cm-activeLineGutter":{backgroundColor:mX},".cm-foldPlaceholder":{backgroundColor:`transparent`,border:`none`,color:`#ddd`},".cm-tooltip":{border:`none`,backgroundColor:gX},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:`transparent`,borderBottomColor:`transparent`},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:gX,borderBottomColor:gX},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:mX,color:dX}}},{dark:!0}),D(B.define([{tag:A.keyword,color:kve},{tag:[A.name,A.deleted,A.character,A.propertyName,A.macroName],color:uX},{tag:[A.function(A.variableName),A.labelName],color:Dve},{tag:[A.color,A.constant(A.name),A.standard(A.name)],color:pX},{tag:[A.definition(A.name),A.separator],color:dX},{tag:[A.typeName,A.className,A.number,A.changed,A.annotation,A.modifier,A.self,A.namespace],color:wve},{tag:[A.operator,A.operatorKeyword,A.url,A.escape,A.regexp,A.link,A.special(A.string)],color:Tve},{tag:[A.meta,A.comment],color:fX},{tag:A.strong,fontWeight:`bold`},{tag:A.emphasis,fontStyle:`italic`},{tag:A.strikethrough,textDecoration:`line-through`},{tag:A.link,color:fX,textDecoration:`underline`},{tag:A.heading,fontWeight:`bold`,color:uX},{tag:[A.atom,A.bool,A.special(A.variableName)],color:pX},{tag:[A.processingInstruction,A.string,A.inserted],color:Ove},{tag:A.invalid,color:Eve}]))],Nve=I.theme({"&":{backgroundColor:`#fff`}},{dark:!1}),Pve=function(e){e===void 0&&(e={});var{indentWithTab:t=!0,editable:n=!0,readOnly:i=!1,theme:a=`light`,placeholder:o=``,basicSetup:s=!0}=e,c=[];switch(t&&c.unshift(r.of([qme])),s&&(typeof s==`boolean`?c.unshift(lX()):c.unshift(lX(s))),o&&c.unshift(Ce(o)),a){case`light`:c.push(Nve);break;case`dark`:c.push(Mve);break;case`none`:break;default:c.push(a);break}return n===!1&&c.push(I.editable.of(!1)),i&&c.push(Ee.readOnly.of(!0)),[...c]},Fve=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)}),Ive=class{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(e=>{try{e()}catch(e){console.error(`TimeoutLatch callback error:`,e)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}},vX=class{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}},yX=null,Lve=()=>typeof window>`u`?new vX:(yX||=new vX,yX),bX=ie.define(),Rve=200,zve=[];function Bve(e){var{value:t,selection:n,onChange:r,onStatistics:i,onCreateEditor:a,onUpdate:o,extensions:s=zve,autoFocus:c,theme:l=`light`,height:u=null,minHeight:d=null,maxHeight:f=null,width:p=null,minWidth:m=null,maxWidth:h=null,placeholder:g=``,editable:_=!0,readOnly:v=!1,indentWithTab:y=!0,basicSetup:b=!0,root:x,initialState:S}=e,[C,w]=(0,G.useState)(),[T,E]=(0,G.useState)(),[D,O]=(0,G.useState)(),k=(0,G.useState)(()=>({current:null}))[0],A=(0,G.useState)(()=>({current:null}))[0],j=I.theme({"&":{height:u,minHeight:d,maxHeight:f,width:p,minWidth:m,maxWidth:h},"& .cm-scroller":{height:`100% !important`}}),M=[I.updateListener.of(e=>{e.docChanged&&typeof r==`function`&&!e.transactions.some(e=>e.annotation(bX))&&(k.current?k.current.reset():(k.current=new Ive(()=>{if(A.current){var e=A.current;A.current=null,e()}k.current=null},Rve),Lve().add(k.current)),r(e.state.doc.toString(),e)),i&&i(Fve(e))}),j,...Pve({theme:l,editable:_,readOnly:v,placeholder:g,indentWithTab:y,basicSetup:b})];return o&&typeof o==`function`&&M.push(I.updateListener.of(o)),M=M.concat(s),(0,G.useLayoutEffect)(()=>{if(C&&!D){var e={doc:t,selection:n,extensions:M},r=S?Ee.fromJSON(S.json,e,S.fields):Ee.create(e);if(O(r),!T){var i=new I({state:r,parent:C,root:x});E(i),a&&a(i,r)}}return()=>{T&&(O(void 0),E(void 0))}},[C,D]),(0,G.useEffect)(()=>{e.container&&w(e.container)},[e.container]),(0,G.useEffect)(()=>()=>{T&&(T.destroy(),E(void 0)),k.current&&=(k.current.cancel(),null)},[T]),(0,G.useEffect)(()=>{c&&T&&T.focus()},[c,T]),(0,G.useEffect)(()=>{T&&T.dispatch({effects:V.reconfigure.of(M)})},[l,s,u,d,f,p,m,h,g,_,v,y,b,r,o]),(0,G.useEffect)(()=>{if(t!==void 0){var e=T?T.state.doc.toString():``;if(T&&t!==e){var n=k.current&&!k.current.isDone,r=()=>{T&&t!==T.state.doc.toString()&&T.dispatch({changes:{from:0,to:T.state.doc.toString().length,insert:t||``},annotations:[bX.of(!0)]})};n?A.current=r:r()}}},[t,T]),{state:D,setState:O,view:T,setView:E,container:C,setContainer:w}}var Vve=[`className`,`value`,`selection`,`extensions`,`onChange`,`onStatistics`,`onCreateEditor`,`onUpdate`,`autoFocus`,`theme`,`height`,`minHeight`,`maxHeight`,`width`,`minWidth`,`maxWidth`,`basicSetup`,`placeholder`,`indentWithTab`,`editable`,`readOnly`,`root`,`initialState`],xX=(0,G.forwardRef)((e,t)=>{var{className:n,value:r=``,selection:i,extensions:a=[],onChange:o,onStatistics:s,onCreateEditor:c,onUpdate:l,autoFocus:u,theme:d=`light`,height:f,minHeight:p,maxHeight:m,width:h,minWidth:g,maxWidth:_,basicSetup:v,placeholder:y,indentWithTab:b,editable:x,readOnly:S,root:C,initialState:w}=e,T=L_e(e,Vve),E=(0,G.useRef)(null),{state:D,view:O,container:k,setContainer:A}=Bve({root:C,value:r,autoFocus:u,theme:d,height:f,minHeight:p,maxHeight:m,width:h,minWidth:g,maxWidth:_,basicSetup:v,placeholder:y,indentWithTab:b,editable:x,readOnly:S,selection:i,onChange:o,onStatistics:s,onCreateEditor:c,onUpdate:l,extensions:a,initialState:w});(0,G.useImperativeHandle)(t,()=>({editor:E.current,state:D,view:O}),[E,k,D,O]);var j=(0,G.useCallback)(e=>{E.current=e,A(e)},[A]);if(typeof r!=`string`)throw Error(`value must be typeof string but got `+typeof r);return(0,K.jsx)(`div`,cY({ref:j,className:(typeof d==`string`?`cm-theme-`+d:`cm-theme`)+(n?` `+n:``)},T))});xX.displayName=`CodeMirror`;function Hve(e){if(!e)return`plain`;let t=e.toLowerCase();return t.endsWith(`.md`)?`markdown`:t.endsWith(`.ts`)||t.endsWith(`.tsx`)?`typescript`:t.endsWith(`.js`)||t.endsWith(`.jsx`)?`javascript`:t.endsWith(`.json`)?`json`:t.endsWith(`.yml`)||t.endsWith(`.yaml`)?`yaml`:`plain`}function Uve(e,t){switch(e){case`markdown`:return[KR({base:NR,codeLanguages:eB}),Fpe()];case`typescript`:return[We({typescript:!0,jsx:t?.endsWith(`.tsx`)})];case`javascript`:return[We({jsx:t?.endsWith(`.jsx`)})];case`json`:return[rI()];case`yaml`:return[Qz()];default:return[]}}function Wve(e,t){switch(e){case`github`:return t?UB:MV;case`material`:return t?cW:nG;case`vscode`:return t?w_e:I_e;case`tokyo`:return t?d_e:t_e;case`gruvbox`:return t?SH:mU;case`monokai`:return BG;case`nord`:return AK;default:return t?UB:MV}}function SX({value:e,onChange:t,readOnly:n=!1,language:i,filename:a,lineNumbers:o=!0,lineWrapping:s=!0,fontSize:c=13,className:l=``,style:u,placeholder:d,editorMinHeight:f=`240px`}){let p=i??Hve(a),m=DT(),{data:h}=zte(),g=h?.codeEditor?.theme??`github`,_=(0,G.useMemo)(()=>{let e=[Ee.readOnly.of(n),...Uve(p,a)];return e.push(Wve(g,m)),e.push(I.theme({".cm-line":{lineHeight:`21px`},"&":{borderRadius:`6px`,border:`1px solid var(--code-editor-border)`,height:`100%`,minHeight:`var(--code-editor-min-height, 240px)`},".cm-content":{fontFamily:`var(--font-mono)`},".cm-gutters":{fontFamily:`var(--font-mono)`},".cm-scroller":{fontFamily:`var(--font-mono)`,overflow:`auto`,scrollbarWidth:`thin`},".cm-md-codeblock":{padding:`0`,borderRadius:0}})),e.push(r.of([{key:`Mod-a`,run:zF}])),s&&e.push(I.lineWrapping),e},[p,a,n,s,g,m]);return(0,K.jsx)(xX,{value:e,onChange:t,placeholder:d,theme:`none`,basicSetup:{lineNumbers:o,foldGutter:!n,highlightActiveLine:!n,highlightActiveLineGutter:!n,autocompletion:!n,closeBrackets:!n,bracketMatching:!n},extensions:_,className:`scrollbar-thin scrollbar-track-transparent overflow-auto ${l}`,style:{fontSize:c,"--code-editor-min-height":f,...u}})}function Gve(e){if(!e)return null;if(e.type===`point`)return{x:e.x,y:e.y};let t=e.element;if(!t)return null;let n=t.getBoundingClientRect();switch(e.placement??`bottom-start`){case`bottom-end`:return{x:n.right,y:n.bottom};case`top-start`:return{x:n.left,y:n.top};case`top-end`:return{x:n.right,y:n.top};default:return{x:n.left,y:n.bottom}}}function Kve(e,t,n){let r=n?.left??0,i=n?.top??0,a=n?.right??window.innerWidth,o=n?.bottom??window.innerHeight,s=r+12,c=i+12,l=Math.max(s,a-t.width-12),u=Math.max(c,o-t.height-12);return{x:Math.max(s,Math.min(e.x,l)),y:Math.max(c,Math.min(e.y,u))}}function qve(e,t){if(!t)return{position:`fixed`,left:e.x,top:e.y};let n=t.getBoundingClientRect();return{position:`absolute`,left:e.x-n.left+t.scrollLeft,top:e.y-n.top+t.scrollTop}}function Jve(e){return e?.type===`target`?e.placement??`bottom-start`:`bottom-start`}function CX({open:e,items:t,anchor:n,wrapperElement:r,boundaryElement:i,position:a,onClose:o}){let s=(0,G.useRef)(null),c=(0,G.useMemo)(()=>a?{type:`point`,x:a.x,y:a.y}:null,[a]),l=n??c,u=r??i??null,d=(0,G.useMemo)(()=>Gve(l),[l]),[f,p]=(0,G.useState)(null),m=(0,G.useId)().replace(/[^a-zA-Z0-9_-]/g,``),h=`--context-menu-anchor-${m}`,g=`context-menu-${m}`,_=Jve(l),v=(0,G.useMemo)(()=>t.filter(e=>e.label.length>0),[t]),y=e&&!!d&&v.length>0;(0,G.useLayoutEffect)(()=>{if(!e||!d){p(null);return}let t=s.current;if(!t){p(d);return}let n=u?.getBoundingClientRect()??null;p(Kve(d,t.getBoundingClientRect(),n))},[d,u,e]),(0,G.useEffect)(()=>{let e=()=>o();return window.addEventListener(`scroll`,e,!0),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e,!0),window.removeEventListener(`resize`,e)}},[e,o]),(0,G.useEffect)(()=>{if(!y)return;let e=e=>{if(e.button===2)return;let t=e.target;t instanceof Node&&(s.current?.contains(t)||l?.type===`target`&&l.element?.contains(t)||o())},t=e=>{e.key===`Escape`&&o()};return window.addEventListener(`pointerdown`,e,!0),window.addEventListener(`keydown`,t),()=>{window.removeEventListener(`pointerdown`,e,!0),window.removeEventListener(`keydown`,t)}},[l,o,y]),(0,G.useEffect)(()=>{if(!e||l?.type!==`target`||!l.element)return;let t=l.element,n=t.style.getPropertyValue(`anchor-name`),r=t.style.getPropertyPriority(`anchor-name`);return t.style.setProperty(`anchor-name`,h),()=>{n?t.style.setProperty(`anchor-name`,n,r):t.style.removeProperty(`anchor-name`)}},[l,h,e]);let b=f??d,x=b===null?{left:0,top:0}:{left:b.x,top:b.y},S=l?.type===`point`&&d?qve(d,u):null;if((0,G.useEffect)(()=>{let e=s.current;e&&(y?e.matches(`:popover-open`)||e.showPopover?.():e.matches(`:popover-open`)&&e.hidePopover?.())},[y]),!y)return null;let C=String.raw;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`style`,{children:C`
355
355
  .context-menu-anchor[data-context-menu-id='${g}'] {
356
356
  width: 1px;
@@ -443,7 +443,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
443
443
  .CodeMirror {
444
444
  line-height: 21px;
445
445
  }
446
- `;function Xve(e,t){let n=e.path.split(`/`),r=t.path.split(`/`),i=Math.min(n.length,r.length);for(let a=0;a<i;a++){let i=a===n.length-1,o=a===r.length-1;if(n[a]!==r[a]){if(i&&o){if(e.type!==t.type)return e.type===`directory`?-1:1}else if(i&&!o)return e.type===`directory`?n[a].localeCompare(r[a]):1;else if(!i&&o)return t.type===`directory`?n[a].localeCompare(r[a]):-1;return n[a].localeCompare(r[a])}}return n.length-r.length}function DX(e){return e.split(`/`).pop()??e}function Zve(e){return e.split(`/`).slice(0,-1).join(`/`)}function Qve(e){let t=(e??``).trim().replace(/\/+$/g,``);if(!t)return[];let n=/^([A-Za-z][A-Za-z0-9+.-]*:)(.*)$/.exec(t);if(!n)return t.split(`/`).filter(Boolean);let r=n[1],i=n[2].replace(/^\/+/g,``),a=[r];return i.length>0&&a.push(...i.split(`/`).filter(Boolean)),a}function $ve({path:e,rootPath:t,entries:n,onNavigate:r}){let i=Qve(t).map((e,t)=>({key:`root-${t}-${e}`,kind:`root`,name:e})),a=e.split(`/`).filter(Boolean),o=e.endsWith(`.md`),s=[];for(let e=0;e<a.length;e++){let t=a.slice(0,e+1).join(`/`),n=e===a.length-1;s.push({key:`path-${t}`,name:a[e],path:t,isFile:n})}let c=[...i,...s],l=i.length;return(0,K.jsx)(`div`,{className:`border-border/50 bg-muted/20 flex items-center gap-1 overflow-x-auto border-b px-3 py-2 text-xs`,children:c.map((e,t)=>{let i=t===c.length-1,a=t<l,u=!a&&!i&&n.some(e=>e.type===`file`&&e.path.startsWith(s[t-l].path+`/`));return(0,K.jsxs)(`span`,{className:`flex items-center gap-1`,children:[t>0&&(0,K.jsx)(Sc,{className:`text-muted-foreground/50 h-3 w-3`}),a?(0,K.jsxs)(`span`,{className:`text-muted-foreground flex items-center gap-1.5`,children:[(0,K.jsx)(Vc,{className:`h-3.5 w-3.5`}),e.name]}):i?(0,K.jsxs)(`span`,{className:`text-foreground flex items-center gap-1.5`,children:[s[t-l].isFile?o?(0,K.jsx)(Fc,{className:`h-3.5 w-3.5`}):(0,K.jsx)(Ic,{className:`h-3.5 w-3.5`}):(0,K.jsx)(Vc,{className:`h-3.5 w-3.5`}),e.name]}):u?(0,K.jsxs)(`button`,{onClick:()=>{let e=n.find(e=>e.type===`file`&&e.path.startsWith(s[t-l].path+`/`));e&&r(e.path)},className:`text-muted-foreground hover:text-foreground flex items-center gap-1.5 transition-colors`,children:[(0,K.jsx)(Vc,{className:`h-3.5 w-3.5`}),s[t-l].name]}):(0,K.jsxs)(`span`,{className:`text-muted-foreground flex items-center gap-1.5`,children:[(0,K.jsx)(Vc,{className:`h-3.5 w-3.5`}),s[t-l].name]})]},e.key)})})}function eye({entries:e,selectedPath:t,onSelect:n,entryActions:r}){let i=(0,G.useRef)(null),[a,o]=(0,G.useState)(null),s=e.filter(e=>e.type===`file`),c=s.find(e=>e.path===t)??s[0]??null,l=c&&r?EX(r(c)):[];return(0,K.jsxs)(wX,{ref:i,className:`border-border bg-muted/30 flex items-stretch overflow-hidden rounded-md border`,children:[(0,K.jsx)(`div`,{className:`scrollbar-thin scrollbar-track-transparent flex min-w-0 flex-1 gap-1 overflow-x-auto px-1 py-1`,children:s.map(e=>{let r=e.path===t,i=e.path.endsWith(`.md`);return(0,K.jsxs)(`button`,{onClick:()=>n(e.path),title:e.path,className:`flex shrink-0 items-center gap-1.5 rounded px-2.5 py-1.5 text-xs transition-colors ${r?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:bg-background/50 hover:text-foreground`}`,children:[i?(0,K.jsx)(Fc,{className:`h-3.5 w-3.5`}):(0,K.jsx)(Ic,{className:`h-3.5 w-3.5`}),(0,K.jsx)(`span`,{className:`max-w-[120px] truncate`,children:DX(e.path)})]},e.path)})}),l.length>0&&(0,K.jsxs)(TX,{className:`text-muted-foreground inline-flex items-center`,children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`bg-border/80 block w-px self-stretch`}),(0,K.jsx)(`button`,{type:`button`,onClick:e=>{o({type:`target`,element:e.currentTarget,placement:`bottom-end`})},className:`text-muted-foreground hover:text-foreground hover:bg-background/80 inline-flex h-7 w-7 shrink-0 items-center justify-center rounded`,"aria-label":`Current file actions`,children:(0,K.jsx)(Mc,{className:`h-4 w-4`})})]}),(0,K.jsx)(CX,{open:a!==null,items:l,anchor:a,wrapperElement:i.current,boundaryElement:i.current,onClose:()=>o(null)})]})}function tye({entries:e,selectedPath:t,onSelect:n,headerLabel:r,headerActions:i,entryActions:a}){let[o,s]=(0,G.useState)(null),c=(0,G.useRef)(null),l=t=>{let n=Zve(t.path);return n?e.some(e=>e.type===`directory`&&e.path===n)?l(e.find(e=>e.path===n))+1:t.path.split(`/`).length-1:0},u=(e,t)=>{let n=EX(t);n.length!==0&&s({anchor:e,items:n})};return(0,K.jsxs)(wX,{ref:c,className:`border-border bg-muted/30 flex h-full flex-col rounded-md border`,children:[(0,K.jsxs)(`div`,{className:`border-border/50 text-muted-foreground flex items-center justify-between border-b px-3 py-2 text-xs font-medium`,children:[(0,K.jsx)(`span`,{className:`min-w-0 truncate`,children:r}),i]}),(0,K.jsx)(`div`,{className:`scrollbar-thin scrollbar-track-transparent flex-1 overflow-y-auto`,children:e.length===0?(0,K.jsx)(`div`,{className:`text-muted-foreground px-3 py-2 text-xs`,children:`No files yet.`}):e.map(e=>{let r=l(e),i=e.path===t,o=e.type===`file`,s=a?a(e):[],c=s.length>0,d=o?e.path.endsWith(`.md`)?(0,K.jsx)(Fc,{className:`h-4 w-4 shrink-0`}):(0,K.jsx)(Ic,{className:`h-4 w-4 shrink-0`}):(0,K.jsx)(Vc,{className:`h-4 w-4 shrink-0`});return(0,K.jsxs)(`div`,{className:`group flex w-full items-center gap-2 px-2 py-1 text-sm transition-colors ${i?`bg-primary/10 text-foreground`:o?`text-muted-foreground hover:bg-muted/50 hover:text-foreground`:`text-muted-foreground`}`,onContextMenu:t=>{c&&(t.preventDefault(),o&&n(e.path),u({type:`point`,x:t.clientX,y:t.clientY},s))},children:[(0,K.jsxs)(`button`,{type:`button`,disabled:!o,onClick:()=>o&&n(e.path),className:`flex flex-1 items-center gap-2 text-left ${o?``:`cursor-default`}`,style:{paddingLeft:4+r*14},children:[d,(0,K.jsx)(`span`,{className:`truncate ${o?``:`text-foreground font-medium`}`,children:DX(e.path)})]}),c&&(0,K.jsx)(TX,{children:(0,K.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),u({type:`target`,element:e.currentTarget,placement:`bottom-end`},s)},className:`hover:bg-muted text-muted-foreground flex h-7 w-7 items-center justify-center rounded-md`,"aria-label":`File actions`,children:(0,K.jsx)(Mc,{className:`h-4 w-4`})})})]},e.path)})}),(0,K.jsx)(CX,{open:!!o,items:o?.items??[],anchor:o?.anchor??null,boundaryElement:c.current,onClose:()=>s(null)})]})}function OX({entries:e,selectedPath:t,onSelect:n,breadcrumbRoot:r,headerLabel:i=`Files`,headerActions:a,entryActions:o,renderEditor:s,emptyState:c}){let l=(0,G.useMemo)(()=>[...e].sort(Xve),[e]),u=(0,G.useMemo)(()=>!l.length||!t?null:l.find(e=>e.path===t&&e.type===`file`)??null,[l,t]);return(0,K.jsxs)(`div`,{className:`@container-[size] h-full`,children:[(0,K.jsx)(`style`,{children:Yve}),(0,K.jsxs)(`div`,{className:`fev-layout`,children:[(0,K.jsx)(`div`,{className:`fev-sidebar-tabs`,children:(0,K.jsx)(eye,{entries:l,selectedPath:t,onSelect:n,entryActions:o})}),(0,K.jsx)(`div`,{className:`fev-sidebar-tree`,children:(0,K.jsx)(tye,{entries:l,selectedPath:t,onSelect:n,headerLabel:i,headerActions:a,entryActions:o})}),(0,K.jsx)(`div`,{className:`fev-editor-wrapper border-border bg-background overflow-hidden rounded-md border shadow-sm`,children:u?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)($ve,{path:u.path,rootPath:r,entries:l,onNavigate:n}),s(u)]}):(0,K.jsx)(`div`,{className:`text-muted-foreground flex h-full items-center justify-center`,children:l.length>0?`Select a file to view`:c??`No files found.`})})]})]})}function kX({file:e,value:t,readOnly:n=!0,onChange:r,lineWrapping:i}){return(0,K.jsx)(SX,{value:t,filename:e.path,readOnly:n,lineWrapping:i,className:`min-h-0 flex-1`,onChange:r},e.path)}function AX({changeId:e,archived:t=!1}){let{data:n,isLoading:r,error:i}=t?Rte(e):Fte(e),[a,o]=(0,G.useState)(null),s=(0,G.useMemo)(()=>n?[...n]:[],[n]);return(0,G.useEffect)(()=>{if(!s.length){o(null);return}s.find(e=>e.path===a&&e.type===`file`)||o(s.find(e=>e.type===`file`)?.path??null)},[s,a]),r?(0,K.jsx)(`div`,{className:`border-border bg-muted/20 flex h-[400px] items-center justify-center rounded-md border`,children:(0,K.jsx)(Qc,{className:`text-muted-foreground h-6 w-6 animate-spin`})}):i?(0,K.jsxs)(`div`,{className:`border-destructive/50 bg-destructive/10 text-destructive rounded-md border p-4 text-sm`,children:[`Failed to load files: `,i.message]}):(0,K.jsx)(OX,{entries:s,selectedPath:a,onSelect:o,emptyState:(0,K.jsx)(`span`,{children:`No files found for this change.`}),renderEditor:e=>e?(0,K.jsx)(kX,{file:e,value:e.content??``,readOnly:!0}):(0,K.jsx)(`div`,{className:`text-muted-foreground flex h-full items-center justify-center`,children:`Select a file to view`})})}function nye(e){let t=new Map;for(let n of e){let e=n.section||`General`,r=t.get(e)||[];r.push(n),t.set(e,r)}return Array.from(t.entries()).map(([e,t])=>({section:e,tasks:t,completed:t.filter(e=>e.completed).length,total:t.length}))}function rye(e){return`section-${e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``)}`}var iye=(0,G.memo)(function({task:e,taskIndex:t,isToggling:n,onToggle:r,readonly:i}){let a=(0,K.jsxs)(K.Fragment,{children:[n?(0,K.jsx)(Qc,{className:`text-primary h-5 w-5 shrink-0 animate-spin`}):e.completed?(0,K.jsx)(wc,{className:`h-5 w-5 shrink-0 text-green-500`}):(0,K.jsx)(Dc,{className:`text-muted-foreground group-hover:text-primary h-5 w-5 shrink-0`}),(0,K.jsx)(`span`,{className:`text-sm ${e.completed?`text-muted-foreground line-through`:``}`,children:e.text})]});return i||!r?(0,K.jsx)(`div`,{className:`flex w-full items-center gap-3 p-3 text-left`,children:a}):(0,K.jsx)(`button`,{onClick:()=>r(t,!e.completed),className:`hover:bg-muted/50 group flex w-full items-center gap-3 p-3 text-left transition-colors`,children:a})},(e,t)=>e.task.id===t.task.id&&e.task.text===t.task.text&&e.task.completed===t.task.completed&&e.isToggling===t.isToggling&&e.readonly===t.readonly);function aye({tasks:e,progress:t,onToggleTask:n,togglingIndex:r=null,tocBaseIndex:i=0,readonly:a=!1}){let o=(0,G.useMemo)(()=>nye(e),[e]),s=t.total>0?Math.round(t.completed/t.total*100):0,c=(e,t)=>{let n=0;for(let t=0;t<e;t++)n+=o[t].tasks.length;return n+t+1};return(0,K.jsxs)(iP,{id:`tasks`,index:i,children:[(0,K.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,K.jsxs)(`h2`,{className:`text-lg font-semibold`,children:[`Tasks (`,t.completed,`/`,t.total,`)`]}),(0,K.jsxs)(`span`,{className:`text-muted-foreground text-sm`,children:[s,`%`]})]}),(0,K.jsx)(`div`,{className:`bg-muted mb-4 h-2 w-full rounded-full`,children:(0,K.jsx)(`div`,{className:`bg-primary h-2 rounded-full transition-all`,style:{width:`${s}%`}})}),(0,K.jsxs)(`div`,{className:`space-y-6`,children:[o.map((e,t)=>{let o=rye(e.section),s=e.total>0?Math.round(e.completed/e.total*100):0;return(0,K.jsxs)(iP,{id:o,index:i+1+t,as:`div`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,K.jsx)(`h3`,{className:`text-foreground font-medium`,children:e.section}),(0,K.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[e.completed,`/`,e.total,` (`,s,`%)`]})]}),(0,K.jsx)(`div`,{className:`border-border divide-border divide-y rounded-lg border`,children:e.tasks.map((e,i)=>{let o=c(t,i);return(0,K.jsx)(iye,{task:e,taskIndex:o,isToggling:r===o,onToggle:n,readonly:a},e.id)})})]},e.section)}),o.length===0&&(0,K.jsx)(`div`,{className:`text-muted-foreground border-border rounded-lg border p-4 text-center`,children:`No tasks defined`})]})]})}var oye=Ls(`/archive/$changeId`);function sye(){let{changeId:e}=oye.useParams(),t=uc(),{data:n}=Lte(e),[r,i]=(0,G.useState)(!0),a=(0,G.useRef)(null),o=(0,G.useMemo)(()=>({family:`archive`,entityId:e}),[e]),s=Z_(t.state);(0,G.useEffect)(()=>{let e=requestAnimationFrame(()=>i(!1));return()=>cancelAnimationFrame(e)},[]);let c=(0,G.useMemo)(()=>{if(!n)return[];let t=[{id:`overview`,label:`Overview`,icon:(0,K.jsx)(Fc,{className:`h-4 w-4`}),content:(0,K.jsx)(hpe,{change:n})}];return n.tasks.length>0&&t.push({id:`tasks`,label:`Tasks (${n.progress.completed}/${n.progress.total})`,icon:(0,K.jsx)(Xc,{className:`h-4 w-4`}),content:(0,K.jsx)(`div`,{className:`border-border scrollbar-thin scrollbar-track-transparent h-full overflow-auto rounded-lg border p-4`,children:(0,K.jsx)(aye,{tasks:n.tasks,progress:n.progress,readonly:!0})})}),t.push({id:`folder`,label:`Folder`,icon:(0,K.jsx)(Bc,{className:`h-4 w-4`}),content:(0,K.jsx)(AX,{changeId:e,archived:!0})}),t},[n,e]),{tabsRef:l,selectedTab:u,onTabChange:d}=BP({queryKey:`archiveTab`,tabs:c,initialTab:c[0]?.id});return r&&!n?s?(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-6 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,K.jsx)(av,{to:`/archive`,vt:{source:a,sharedElements:o},className:`hover:bg-muted rounded-md p-2 transition-colors`,title:`Back to Archive`,children:(0,K.jsx)(_c,{className:`h-5 w-5`})}),(0,K.jsxs)(`div`,{ref:a,...J_(o,`container`),children:[(0,K.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,K.jsx)(gc,{...J_(o,`icon`),className:`h-6 w-6 shrink-0`}),(0,K.jsx)(`span`,{...J_(o,`title`),children:s.title??e})]}),(0,K.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:s.subtitle??e})]})]}),(0,K.jsx)(`div`,{className:`vt-detail-content route-loading animate-pulse rounded-lg border p-4`,children:`Loading archived change...`})]}):(0,K.jsx)(`div`,{className:`route-loading animate-pulse`,children:`Loading archived change...`}):n?(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-6 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,K.jsx)(av,{to:`/archive`,vt:{source:a,sharedElements:o},className:`hover:bg-muted rounded-md p-2 transition-colors`,title:`Back to Archive`,children:(0,K.jsx)(_c,{className:`h-5 w-5`})}),(0,K.jsxs)(`div`,{ref:a,...J_(o,`container`),children:[(0,K.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,K.jsx)(gc,{...J_(o,`icon`),className:`h-6 w-6 shrink-0`}),(0,K.jsx)(`span`,{...J_(o,`title`),children:n.name})]}),(0,K.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:e})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,K.jsx)(wc,{className:`h-4 w-4 text-green-500`}),(0,K.jsxs)(`span`,{className:`text-green-600`,children:[`Completed: `,n.progress.completed,`/`,n.progress.total,` tasks`]})]}),(0,K.jsx)(`div`,{className:`vt-detail-content flex min-h-0 flex-1 flex-col`,children:(0,K.jsx)(gP,{ref:l,tabs:c,selectedTab:u,onTabChange:d,className:`min-h-0 flex-1 gap-6`})})]}):(0,K.jsxs)(`div`,{className:`py-12 text-center`,children:[(0,K.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Archived change not found: `,e]}),(0,K.jsx)(av,{to:`/archive`,className:`text-primary mt-4 inline-block hover:underline`,children:`Back to Archive`})]})}function jX(e){return e.hasStatus?e.isComplete&&e.tasksComplete?{label:`Ready to Archive`,toneClass:`border-emerald-500/40 text-emerald-700 dark:text-emerald-300`}:e.trackedArtifactStatus===`blocked`?{label:`Draft`,toneClass:`border-amber-500/40 text-amber-700 dark:text-amber-300`}:{label:`In Execution`,toneClass:`border-primary/40 text-primary`}:{label:`Unknown`,toneClass:`border-border text-muted-foreground`}}function MX(e){return e.includes(`blocked`)?`blocked`:e.includes(`ready`)?`ready`:e.includes(`done`)?`done`:null}function cye(e){return new Map((e??[]).map(e=>[e.changeName,e]))}function lye(){let{data:e,isLoading:t}=Pte(),{data:n}=O_(),r=cye(n);return t&&!e?(0,K.jsx)(`div`,{className:`route-loading animate-pulse`,children:`Loading changes...`}):(0,K.jsxs)(`div`,{className:`space-y-6 p-4`,children:[(0,K.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,K.jsx)(Hc,{className:`h-6 w-6 shrink-0`}),`Changes`]}),(0,K.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Active OPSX changes. Completed changes are moved to`,` `,(0,K.jsx)(av,{to:`/archive`,className:`text-primary hover:underline`,children:`Archive`}),`.`]}),(0,K.jsxs)(`div`,{className:`border-border divide-border divide-y rounded-lg border`,children:[e?.map(e=>{let t=r.get(e.id),n=t?.artifacts.filter(e=>e.status===`done`).length??0,i=t?.artifacts.length??0,a=jX({hasStatus:!!t,isComplete:t?.isComplete??!1,tasksComplete:e.progress.total===0||e.progress.completed>=e.progress.total,trackedArtifactStatus:MX(t?.artifacts.map(e=>e.status)??[])}),o=e.progress.total>0?Math.round(e.progress.completed/e.progress.total*100):0,s={family:`changes`,entityId:e.id};return(0,K.jsxs)(av,{to:`/changes/$changeId`,params:{changeId:e.id},state:t=>({...t,__vtHandoff:{family:`changes`,entityId:e.id,title:e.name,subtitle:e.id}}),vt:{sharedElements:s},...J_(s,`container`),className:`hover:bg-muted/50 block px-4 py-3`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,K.jsx)(Hc,{...J_(s,`icon`),className:`text-muted-foreground mt-0.5 h-5 w-5 shrink-0`}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`div`,{...J_(s,`title`),className:`truncate font-medium`,children:e.name}),(0,K.jsxs)(`div`,{className:`text-muted-foreground truncate text-sm`,children:[e.id,e.updatedAt>0&&(0,K.jsxs)(K.Fragment,{children:[` · `,zT(e.updatedAt)]})]})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col items-end gap-1 text-right text-sm`,children:[(0,K.jsx)(`span`,{className:`rounded border px-1.5 py-0.5 text-[11px] font-medium ${a.toneClass}`,children:a.label}),(0,K.jsxs)(`div`,{className:`font-medium`,children:[e.progress.completed,`/`,e.progress.total]}),(0,K.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:`tasks`})]}),(0,K.jsx)(Sc,{className:`text-muted-foreground h-4 w-4 shrink-0`})]})]}),(0,K.jsx)(`div`,{className:`bg-muted h-1.5 rounded-full`,children:(0,K.jsx)(`div`,{className:`bg-primary h-full rounded-full transition-all`,style:{width:`${o}%`}})}),(0,K.jsxs)(`div`,{className:`text-muted-foreground mt-2 flex flex-wrap items-center justify-between gap-2 text-xs`,children:[(0,K.jsxs)(`span`,{children:[o,`% task completion`]}),t?(0,K.jsxs)(`span`,{className:`truncate`,children:[n,`/`,i,` artifacts · `,t.schemaName]}):(0,K.jsx)(`span`,{children:`Loading workflow status…`})]})]},e.id)}),e?.length===0&&(0,K.jsxs)(`div`,{className:`text-muted-foreground p-4 text-center`,children:[(0,K.jsx)(`div`,{children:`No active changes.`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs`,children:`Recommended workflow start: /opsx:propose`}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>cv.activatePop(`/opsx-propose`),className:`text-primary mt-2 inline-flex items-center gap-1 hover:underline`,title:`Open quick /opsx:propose input`,children:[(0,K.jsx)(hl,{className:`h-3.5 w-3.5`}),`Start /opsx:propose`]}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>cv.activatePop(`/opsx-new`),className:`text-primary mt-2 inline-flex items-center gap-1 hover:underline`,title:`Open the advanced /opsx:new form`,children:[(0,K.jsx)(hl,{className:`h-3.5 w-3.5`}),`Open advanced /opsx:new form`]})]})]})]})}function uye(e){return e.includes(`*`)||e.includes(`?`)||e.includes(`[`)}var dye={done:{label:`Done`,className:`text-emerald-500`,icon:Tc},ready:{label:`Ready`,className:`text-sky-500`,icon:Dc},blocked:{label:`Blocked`,className:`text-amber-500`,icon:bl}};function fye({artifact:e}){let t=dye[e.status],n=t.icon;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`border-border bg-card flex flex-wrap items-center justify-between gap-3 rounded-md border px-4 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(Fc,{className:`text-muted-foreground h-4 w-4`}),(0,K.jsx)(`span`,{className:`font-medium`,children:e.id}),(0,K.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.relativePath??e.outputPath})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(n,{className:`h-4 w-4 ${t.className}`}),(0,K.jsx)(`span`,{className:`text-xs font-medium ${t.className}`,children:t.label})]})]}),e.status===`blocked`&&e.missingDeps?.length?(0,K.jsxs)(`div`,{className:`border-border flex items-start gap-2 rounded-md border border-amber-500/50 bg-amber-500/10 px-3 py-2 text-xs text-amber-700`,children:[(0,K.jsx)(bl,{className:`h-4 w-4 shrink-0`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`font-medium`,children:`Blocked by missing dependencies`}),(0,K.jsx)(`div`,{className:`mt-1`,children:e.missingDeps.join(`, `)})]})]}):null]})}function pye({changeId:e,artifact:t}){let{data:n,isLoading:r}=Gte(e,t.outputPath);return r?(0,K.jsx)(`div`,{className:`text-muted-foreground flex h-full items-center justify-center text-sm`,children:`Loading output...`}):n?(0,K.jsx)(uP,{markdown:n}):(0,K.jsxs)(`div`,{className:`text-muted-foreground flex h-full items-center justify-center rounded-md border border-dashed p-6 text-sm`,children:[`Not yet generated. Use `,(0,K.jsx)(`strong`,{className:`mx-2 font-bold`,children:`Continue`}),` to generate this artifact.`]})}function mye({changeId:e,artifact:t}){let{data:n,isLoading:r}=Kte(e,t.outputPath);return r?(0,K.jsx)(`div`,{className:`flex h-[400px] items-center justify-center`,children:(0,K.jsx)(Qc,{className:`text-muted-foreground h-6 w-6 animate-spin`})}):n?.length?(0,K.jsx)(uP,{markdown:({H1:e,Section:t})=>(0,K.jsx)(`div`,{className:`space-y-6`,children:n.map(n=>(0,K.jsxs)(t,{children:[(0,K.jsx)(e,{children:n.path}),(0,K.jsx)(`div`,{className:`border-border bg-muted/30 mt-2 rounded-lg border p-4 [zoom:0.86]`,children:(0,K.jsx)(uP,{markdown:n.content})})]},n.path))})}):(0,K.jsxs)(`div`,{className:`text-muted-foreground flex h-full items-center justify-center rounded-md border border-dashed p-6 text-sm`,children:[`Not yet generated. Use `,(0,K.jsx)(`strong`,{className:`mx-2 font-bold`,children:`Continue`}),` to generate this artifact.`]})}function hye({changeId:e,artifact:t}){let n=uye(t.outputPath);return(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 py-4`,children:[(0,K.jsx)(fye,{artifact:t}),(0,K.jsx)(`div`,{className:`min-h-0 flex-1`,children:n?(0,K.jsx)(mye,{changeId:e,artifact:t}):(0,K.jsx)(pye,{changeId:e,artifact:t})})]})}function gye({status:e,selectedArtifactId:t,onComposeAction:n,onVerify:r,onRefresh:i}){let a=e.artifacts.find(e=>e.status===`ready`),o=new Set(e.artifacts.filter(e=>e.status===`done`).map(e=>e.id)),s=e.applyRequires.filter(e=>!o.has(e));return(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[[{id:`continue`,label:`Continue`,icon:ol,artifactId:t,disabled:!t||e.artifacts.find(e=>e.id===t)?.status===`blocked`,hint:t?void 0:`select an artifact`},{id:`ff`,label:`Fast-forward`,icon:ll,artifactId:a?.id,disabled:!a,hint:a?void 0:`no ready artifacts`},{id:`apply`,label:`Apply`,icon:wc,disabled:s.length>0,hint:s.length>0?`missing: ${s.join(`, `)}`:void 0},{id:`archive`,label:`Archive`,icon:gc,disabled:!e.isComplete,hint:e.isComplete?void 0:`complete artifacts first`}].map(e=>{let t=e.icon;return(0,K.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>n(e.id,e.artifactId),title:e.hint,className:`border-border hover:bg-muted inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs font-medium transition disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,K.jsx)(t,{className:`h-3.5 w-3.5`}),e.label]},e.id)}),(0,K.jsxs)(`button`,{type:`button`,onClick:r,className:`border-border hover:bg-muted inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs font-medium transition`,children:[(0,K.jsx)(pl,{className:`h-3.5 w-3.5`}),`Verify`]}),(0,K.jsxs)(`button`,{type:`button`,onClick:i,className:`border-border hover:bg-muted inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs font-medium transition`,children:[(0,K.jsx)(cl,{className:`h-3.5 w-3.5`}),`Refresh`]})]})}var _ye=`action`,vye=`change`,yye=`artifact`;function bye(e){let t=new URLSearchParams;return t.set(_ye,e.action),t.set(vye,e.changeId),e.artifactId&&t.set(yye,e.artifactId),`/opsx-compose?${t.toString()}`}function xye({status:e}){return e===`done`?(0,K.jsx)(Tc,{className:`h-3.5 w-3.5 text-emerald-500`}):e===`ready`?(0,K.jsx)(Dc,{className:`h-3.5 w-3.5 text-sky-500`}):(0,K.jsx)(bl,{className:`h-3.5 w-3.5 text-amber-500`})}function Sye(){let{changeId:e}=vs({from:`/changes/$changeId`}),t=uc(),[n,r]=(0,G.useState)(0),i=(0,G.useRef)(null),a=(0,G.useMemo)(()=>({family:`changes`,entityId:e}),[e]),o=Z_(t.state),{data:s,isLoading:c,error:l}=Bte({change:e,refreshKey:n}),u=(0,G.useCallback)((t,n)=>{let r=bye({action:t,changeId:e,artifactId:n});cv.activatePop(r)},[e]),d=(0,G.useCallback)(()=>{cv.activatePop(`/opsx-verify?change=${encodeURIComponent(e)}`)},[e]),f=(0,G.useCallback)(()=>{r(e=>e+1)},[]),p=(0,G.useMemo)(()=>s?[...s.artifacts.map(t=>({id:t.id,label:t.id,icon:(0,K.jsx)(xye,{status:t.status}),content:(0,K.jsx)(hye,{changeId:e,artifact:t})})),{id:`folder`,label:`Folder`,icon:(0,K.jsx)(Bc,{className:`h-4 w-4`}),content:(0,K.jsx)(AX,{changeId:e})}]:[],[s,e]),m=(0,G.useMemo)(()=>{if(s)return s.artifacts.find(e=>e.status===`ready`)?.id??s.artifacts[0]?.id},[s]),{tabsRef:h,selectedTab:g,onTabChange:_}=BP({queryKey:`artifact`,tabs:p,initialTab:m??p[0]?.id}),v=s?.artifacts.filter(e=>e.status===`done`).length??0,y=s?.artifacts.length??0,b=l?.message.includes(`Change '${e}' not found`)||l?.message.includes(`Change "${e}" not found`);return c&&!s?o?(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,K.jsx)(av,{to:`/changes`,vt:{source:i,sharedElements:a},className:`hover:bg-muted rounded-md p-2`,children:(0,K.jsx)(_c,{className:`h-5 w-5`})}),(0,K.jsxs)(`div`,{ref:i,...J_(a,`container`),className:`flex min-w-0 flex-col gap-1`,children:[(0,K.jsxs)(`h1`,{className:`font-nav flex min-w-0 items-center gap-2 text-2xl font-bold`,children:[(0,K.jsx)(Hc,{...J_(a,`icon`),className:`h-6 w-6 shrink-0`}),(0,K.jsx)(`span`,{...J_(a,`title`),className:`truncate`,children:o.title??e})]}),(0,K.jsxs)(`p`,{className:`text-muted-foreground text-sm`,children:[o.subtitle??e,` · Loading change status…`]})]})]}),(0,K.jsx)(`div`,{className:`vt-detail-content route-loading animate-pulse rounded-lg border p-4`,children:`Loading change status...`})]}):(0,K.jsx)(`div`,{className:`route-loading animate-pulse`,children:`Loading change status...`}):b&&!s?(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,K.jsxs)(`div`,{className:`text-muted-foreground flex items-center gap-2 text-sm`,children:[(0,K.jsx)(Cc,{className:`h-4 w-4`}),`Change not found in the current project.`]}),(0,K.jsx)(`div`,{children:(0,K.jsx)(av,{to:`/changes`,className:`text-primary hover:underline`,children:`Back to Changes`})})]}):l&&!s?(0,K.jsxs)(`div`,{className:`text-destructive flex items-center gap-2`,children:[(0,K.jsx)(Cc,{className:`h-5 w-5`}),`Error loading change: `,l.message]}):s?(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,K.jsx)(av,{to:`/changes`,vt:{source:i,sharedElements:a},className:`hover:bg-muted rounded-md p-2`,children:(0,K.jsx)(_c,{className:`h-5 w-5`})}),(0,K.jsxs)(`div`,{ref:i,...J_(a,`container`),className:`flex min-w-0 flex-col gap-1`,children:[(0,K.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,K.jsx)(Hc,{...J_(a,`icon`),className:`h-6 w-6 shrink-0`}),(0,K.jsx)(`span`,{...J_(a,`title`),children:s.changeName})]}),(0,K.jsxs)(`p`,{className:`text-muted-foreground text-sm`,children:[`Schema: `,s.schemaName,` · `,v,`/`,y,` artifacts`]})]})]}),(0,K.jsx)(gye,{status:s,selectedArtifactId:m,onComposeAction:u,onVerify:d,onRefresh:f})]}),(0,K.jsx)(`div`,{className:`vt-detail-content flex min-h-0 flex-1 flex-col`,children:(0,K.jsx)(gP,{ref:h,tabs:p,selectedTab:g,onTabChange:_,className:`min-h-0 flex-1`})})]}):(0,K.jsxs)(`div`,{className:`text-muted-foreground flex items-center gap-2 text-sm`,children:[(0,K.jsx)(Cc,{className:`h-4 w-4`}),`Change not found.`]})}function NX({value:e,options:t,onChange:n,className:r=``,tone:i=`default`}){return(0,K.jsx)(`div`,{className:`inline-flex overflow-hidden rounded-md border ${i===`terminal`?`border-terminal-foreground/25 bg-terminal/70 text-terminal-foreground`:`border-border bg-card`} ${r}`,children:t.map((t,r)=>{let a=t.value===e,o=a?`bg-primary text-primary-foreground`:i===`terminal`?`text-terminal-foreground/72 hover:bg-terminal-foreground/10 hover:text-terminal-foreground`:`text-muted-foreground hover:bg-muted/60 hover:text-foreground`;return(0,K.jsx)(`button`,{type:`button`,disabled:t.disabled,onClick:()=>n(t.value),"aria-pressed":a,className:`px-3 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${r>0?i===`terminal`?`border-terminal-foreground/20 border-l`:`border-border border-l`:``} ${o}`,children:t.label},t.value)})})}var Cye=(0,G.forwardRef)(function({lines:e,maxHeight:t=`60vh`,scrollRef:n},r){return(0,K.jsxs)(`div`,{ref:n??r,className:`scrollbar-thin scrollbar-track-transparent scrollbar-thumb-zinc-700 overflow-auto bg-zinc-900 p-4 font-mono text-sm text-zinc-100`,style:{maxHeight:t},children:[e.length===0&&(0,K.jsx)(`span`,{className:`text-zinc-500`,children:`Waiting to start…`}),e.map(e=>e.kind===`html`?(0,K.jsx)(`div`,{className:`whitespace-pre-wrap break-all`,children:e.node},e.id):(0,K.jsx)(`div`,{className:`whitespace-pre-wrap break-all`,children:(0,K.jsx)(`span`,{className:e.tone===`success`?`text-green-400`:e.tone===`error`?`text-red-400`:e.tone===`info`?`text-blue-300`:void 0,children:wye(e.text)})},e.id))]})});function wye(e){let t=[],n=0,r=null,i=/\x1b\[(\d+)m/g,a;for(;(a=i.exec(e))!==null;){if(a.index>n){let i=e.slice(n,a.index);t.push(r?(0,K.jsx)(`span`,{className:r,children:i},n):i)}let i=parseInt(a[1],10);i===0?r=null:i===31?r=`text-red-400`:i===32?r=`text-green-400`:i===33?r=`text-yellow-400`:i===34?r=`text-blue-400`:i===35?r=`text-fuchsia-300`:i===36?r=`text-cyan-300`:(i===37||i===90)&&(r=`text-zinc-400`),n=a.index+a[0].length}if(n<e.length){let i=e.slice(n);t.push(r?(0,K.jsx)(`span`,{className:r,children:i},n):i)}return t.length>0?t:e}var PX;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(PX||={});var Tye;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(Tye||={});var FX=PX.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),IX=e=>{switch(typeof e){case`undefined`:return FX.undefined;case`string`:return FX.string;case`number`:return Number.isNaN(e)?FX.nan:FX.number;case`boolean`:return FX.boolean;case`function`:return FX.function;case`bigint`:return FX.bigint;case`symbol`:return FX.symbol;case`object`:return Array.isArray(e)?FX.array:e===null?FX.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?FX.promise:typeof Map<`u`&&e instanceof Map?FX.map:typeof Set<`u`&&e instanceof Set?FX.set:typeof Date<`u`&&e instanceof Date?FX.date:FX.object;default:return FX.unknown}},Z=PX.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),LX=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,PX.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};LX.create=e=>new LX(e);var RX=(e,t)=>{let n;switch(e.code){case Z.invalid_type:n=e.received===FX.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case Z.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,PX.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:n=`Unrecognized key(s) in object: ${PX.joinValues(e.keys,`, `)}`;break;case Z.invalid_union:n=`Invalid input`;break;case Z.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${PX.joinValues(e.options)}`;break;case Z.invalid_enum_value:n=`Invalid enum value. Expected ${PX.joinValues(e.options)}, received '${e.received}'`;break;case Z.invalid_arguments:n=`Invalid function arguments`;break;case Z.invalid_return_type:n=`Invalid function return type`;break;case Z.invalid_date:n=`Invalid date`;break;case Z.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:PX.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case Z.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case Z.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case Z.custom:n=`Invalid input`;break;case Z.invalid_intersection_types:n=`Intersection results could not be merged`;break;case Z.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Z.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,PX.assertNever(e)}return{message:n}},Eye=RX;function zX(){return Eye}var BX=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function Q(e,t){let n=zX(),r=BX({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===RX?void 0:RX].filter(e=>!!e)});e.common.issues.push(r)}var VX=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return HX;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return HX;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},HX=Object.freeze({status:`aborted`}),UX=e=>({status:`dirty`,value:e}),WX=e=>({status:`valid`,value:e}),GX=e=>e.status===`aborted`,KX=e=>e.status===`dirty`,qX=e=>e.status===`valid`,JX=e=>typeof Promise<`u`&&e instanceof Promise,YX;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(YX||={});var XX=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ZX=(e,t)=>{if(qX(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){return this._error||=new LX(e.common.issues),this._error}}};function QX(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var $X=class{get description(){return this._def.description}_getType(e){return IX(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:IX(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new VX,ctx:{common:e.parent.common,data:e.data,parsedType:IX(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(JX(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:IX(e)};return ZX(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:IX(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return qX(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>qX(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:IX(e)},r=this._parse({data:e,path:n.path,parent:n});return ZX(n,await(JX(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:Z.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new jZ({schema:this,typeName:BZ.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return MZ.create(this,this._def)}nullable(){return NZ.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return hZ.create(this)}promise(){return AZ.create(this,this._def)}or(e){return vZ.create([this,e],this._def)}and(e){return xZ.create(this,e,this._def)}transform(e){return new jZ({...QX(this._def),schema:this,typeName:BZ.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new PZ({...QX(this._def),innerType:this,defaultValue:t,typeName:BZ.ZodDefault})}brand(){return new LZ({typeName:BZ.ZodBranded,type:this,...QX(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new FZ({...QX(this._def),innerType:this,catchValue:t,typeName:BZ.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return RZ.create(this,e)}readonly(){return zZ.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Dye=/^c[^\s-]{8,}$/i,Oye=/^[0-9a-z]+$/,kye=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Aye=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,jye=/^[a-z0-9_-]{21}$/i,Mye=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Nye=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Pye=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Fye=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,eZ,Iye=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Lye=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Rye=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,zye=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Bye=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Vye=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,tZ=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,Hye=RegExp(`^${tZ}$`);function nZ(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Uye(e){return RegExp(`^${nZ(e)}$`)}function Wye(e){let t=`${tZ}T${nZ(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Gye(e,t){return!!((t===`v4`||!t)&&Iye.test(e)||(t===`v6`||!t)&&Rye.test(e))}function Kye(e,t){if(!Mye.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function qye(e,t){return!!((t===`v4`||!t)&&Lye.test(e)||(t===`v6`||!t)&&zye.test(e))}var rZ=class e extends $X{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==FX.string){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.string,received:t.parsedType}),HX}let t=new VX,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?Q(n,{code:Z.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&Q(n,{code:Z.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)Pye.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`email`,code:Z.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)eZ||=new RegExp(Fye,`u`),eZ.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`emoji`,code:Z.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)Aye.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`uuid`,code:Z.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)jye.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`nanoid`,code:Z.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)Dye.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`cuid`,code:Z.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)Oye.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`cuid2`,code:Z.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)kye.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`ulid`,code:Z.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),Q(n,{validation:`url`,code:Z.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`regex`,code:Z.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?Wye(r).test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?Hye.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?Uye(r).test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?Nye.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`duration`,code:Z.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?Gye(e.data,r.version)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`ip`,code:Z.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?Kye(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`jwt`,code:Z.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?qye(e.data,r.version)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`cidr`,code:Z.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?Bye.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`base64`,code:Z.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?Vye.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`base64url`,code:Z.invalid_string,message:r.message}),t.dirty()):PX.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:Z.invalid_string,...YX.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...YX.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...YX.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...YX.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...YX.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...YX.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...YX.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...YX.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...YX.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...YX.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...YX.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...YX.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...YX.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...YX.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...YX.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...YX.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...YX.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...YX.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...YX.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...YX.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...YX.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...YX.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...YX.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...YX.errToObj(t)})}nonempty(e){return this.min(1,YX.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};rZ.create=e=>new rZ({checks:[],typeName:BZ.ZodString,coerce:e?.coerce??!1,...QX(e)});function Jye(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var iZ=class e extends $X{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==FX.number){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.number,received:t.parsedType}),HX}let t,n=new VX;for(let r of this._def.checks)r.kind===`int`?PX.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?Jye(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.not_finite,message:r.message}),n.dirty()):PX.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,YX.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,YX.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,YX.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,YX.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:YX.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:YX.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:YX.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:YX.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:YX.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:YX.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:YX.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:YX.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:YX.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:YX.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&PX.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};iZ.create=e=>new iZ({checks:[],typeName:BZ.ZodNumber,coerce:e?.coerce||!1,...QX(e)});var aZ=class e extends $X{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==FX.bigint)return this._getInvalidInput(e);let t,n=new VX;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):PX.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.bigint,received:t.parsedType}),HX}gte(e,t){return this.setLimit(`min`,e,!0,YX.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,YX.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,YX.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,YX.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:YX.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:YX.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:YX.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:YX.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:YX.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:YX.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};aZ.create=e=>new aZ({checks:[],typeName:BZ.ZodBigInt,coerce:e?.coerce??!1,...QX(e)});var oZ=class extends $X{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==FX.boolean){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.boolean,received:t.parsedType}),HX}return WX(e.data)}};oZ.create=e=>new oZ({typeName:BZ.ZodBoolean,coerce:e?.coerce||!1,...QX(e)});var sZ=class e extends $X{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==FX.date){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.date,received:t.parsedType}),HX}if(Number.isNaN(e.data.getTime()))return Q(this._getOrReturnCtx(e),{code:Z.invalid_date}),HX;let t=new VX,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):PX.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:YX.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:YX.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};sZ.create=e=>new sZ({checks:[],coerce:e?.coerce||!1,typeName:BZ.ZodDate,...QX(e)});var cZ=class extends $X{_parse(e){if(this._getType(e)!==FX.symbol){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.symbol,received:t.parsedType}),HX}return WX(e.data)}};cZ.create=e=>new cZ({typeName:BZ.ZodSymbol,...QX(e)});var lZ=class extends $X{_parse(e){if(this._getType(e)!==FX.undefined){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.undefined,received:t.parsedType}),HX}return WX(e.data)}};lZ.create=e=>new lZ({typeName:BZ.ZodUndefined,...QX(e)});var uZ=class extends $X{_parse(e){if(this._getType(e)!==FX.null){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.null,received:t.parsedType}),HX}return WX(e.data)}};uZ.create=e=>new uZ({typeName:BZ.ZodNull,...QX(e)});var dZ=class extends $X{constructor(){super(...arguments),this._any=!0}_parse(e){return WX(e.data)}};dZ.create=e=>new dZ({typeName:BZ.ZodAny,...QX(e)});var fZ=class extends $X{constructor(){super(...arguments),this._unknown=!0}_parse(e){return WX(e.data)}};fZ.create=e=>new fZ({typeName:BZ.ZodUnknown,...QX(e)});var pZ=class extends $X{_parse(e){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.never,received:t.parsedType}),HX}};pZ.create=e=>new pZ({typeName:BZ.ZodNever,...QX(e)});var mZ=class extends $X{_parse(e){if(this._getType(e)!==FX.undefined){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.void,received:t.parsedType}),HX}return WX(e.data)}};mZ.create=e=>new mZ({typeName:BZ.ZodVoid,...QX(e)});var hZ=class e extends $X{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==FX.array)return Q(t,{code:Z.invalid_type,expected:FX.array,received:t.parsedType}),HX;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(Q(t,{code:e?Z.too_big:Z.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(Q(t,{code:Z.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(Q(t,{code:Z.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new XX(t,e,t.path,n)))).then(e=>VX.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new XX(t,e,t.path,n)));return VX.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:YX.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:YX.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:YX.toString(n)}})}nonempty(e){return this.min(1,e)}};hZ.create=(e,t)=>new hZ({type:e,minLength:null,maxLength:null,exactLength:null,typeName:BZ.ZodArray,...QX(t)});function gZ(e){if(e instanceof _Z){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=MZ.create(gZ(r))}return new _Z({...e._def,shape:()=>t})}else if(e instanceof hZ)return new hZ({...e._def,type:gZ(e.element)});else if(e instanceof MZ)return MZ.create(gZ(e.unwrap()));else if(e instanceof NZ)return NZ.create(gZ(e.unwrap()));else if(e instanceof SZ)return SZ.create(e.items.map(e=>gZ(e)));else return e}var _Z=class e extends $X{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape();return this._cached={shape:e,keys:PX.objectKeys(e)},this._cached}_parse(e){if(this._getType(e)!==FX.object){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.object,received:t.parsedType}),HX}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof pZ&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new XX(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof pZ){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(Q(n,{code:Z.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new XX(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>VX.mergeObjectSync(t,e)):VX.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return YX.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:YX.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:BZ.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of PX.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of PX.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return gZ(this)}partial(t){let n={};for(let e of PX.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of PX.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof MZ;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return DZ(PX.objectKeys(this.shape))}};_Z.create=(e,t)=>new _Z({shape:()=>e,unknownKeys:`strip`,catchall:pZ.create(),typeName:BZ.ZodObject,...QX(t)}),_Z.strictCreate=(e,t)=>new _Z({shape:()=>e,unknownKeys:`strict`,catchall:pZ.create(),typeName:BZ.ZodObject,...QX(t)}),_Z.lazycreate=(e,t)=>new _Z({shape:e,unknownKeys:`strip`,catchall:pZ.create(),typeName:BZ.ZodObject,...QX(t)});var vZ=class extends $X{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new LX(e.ctx.common.issues));return Q(t,{code:Z.invalid_union,unionErrors:n}),HX}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new LX(e));return Q(t,{code:Z.invalid_union,unionErrors:i}),HX}}get options(){return this._def.options}};vZ.create=(e,t)=>new vZ({options:e,typeName:BZ.ZodUnion,...QX(t)});var yZ=e=>e instanceof TZ?yZ(e.schema):e instanceof jZ?yZ(e.innerType()):e instanceof EZ?[e.value]:e instanceof OZ?e.options:e instanceof kZ?PX.objectValues(e.enum):e instanceof PZ?yZ(e._def.innerType):e instanceof lZ?[void 0]:e instanceof uZ?[null]:e instanceof MZ?[void 0,...yZ(e.unwrap())]:e instanceof NZ?[null,...yZ(e.unwrap())]:e instanceof LZ||e instanceof zZ?yZ(e.unwrap()):e instanceof FZ?yZ(e._def.innerType):[],Yye=class e extends $X{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==FX.object)return Q(t,{code:Z.invalid_type,expected:FX.object,received:t.parsedType}),HX;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(Q(t,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),HX)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=yZ(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:BZ.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...QX(r)})}};function bZ(e,t){let n=IX(e),r=IX(t);if(e===t)return{valid:!0,data:e};if(n===FX.object&&r===FX.object){let n=PX.objectKeys(t),r=PX.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=bZ(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===FX.array&&r===FX.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=bZ(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===FX.date&&r===FX.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var xZ=class extends $X{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(GX(e)||GX(r))return HX;let i=bZ(e.value,r.value);return i.valid?((KX(e)||KX(r))&&t.dirty(),{status:t.value,value:i.data}):(Q(n,{code:Z.invalid_intersection_types}),HX)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};xZ.create=(e,t,n)=>new xZ({left:e,right:t,typeName:BZ.ZodIntersection,...QX(n)});var SZ=class e extends $X{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==FX.array)return Q(n,{code:Z.invalid_type,expected:FX.array,received:n.parsedType}),HX;if(n.data.length<this._def.items.length)return Q(n,{code:Z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),HX;!this._def.rest&&n.data.length>this._def.items.length&&(Q(n,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new XX(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>VX.mergeArray(t,e)):VX.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};SZ.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new SZ({items:e,typeName:BZ.ZodTuple,rest:null,...QX(t)})};var Xye=class e extends $X{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==FX.object)return Q(n,{code:Z.invalid_type,expected:FX.object,received:n.parsedType}),HX;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new XX(n,e,n.path,e)),value:a._parse(new XX(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?VX.mergeObjectAsync(t,r):VX.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof $X?new e({keyType:t,valueType:n,typeName:BZ.ZodRecord,...QX(r)}):new e({keyType:rZ.create(),valueType:t,typeName:BZ.ZodRecord,...QX(n)})}},CZ=class extends $X{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==FX.map)return Q(n,{code:Z.invalid_type,expected:FX.map,received:n.parsedType}),HX;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new XX(n,e,n.path,[a,`key`])),value:i._parse(new XX(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return HX;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return HX;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};CZ.create=(e,t,n)=>new CZ({valueType:t,keyType:e,typeName:BZ.ZodMap,...QX(n)});var wZ=class e extends $X{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==FX.set)return Q(n,{code:Z.invalid_type,expected:FX.set,received:n.parsedType}),HX;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(Q(n,{code:Z.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(Q(n,{code:Z.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return HX;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new XX(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:YX.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:YX.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};wZ.create=(e,t)=>new wZ({valueType:e,minSize:null,maxSize:null,typeName:BZ.ZodSet,...QX(t)});var Zye=class e extends $X{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==FX.function)return Q(t,{code:Z.invalid_type,expected:FX.function,received:t.parsedType}),HX;function n(e,n){return BX({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,zX(),RX].filter(e=>!!e),issueData:{code:Z.invalid_arguments,argumentsError:n}})}function r(e,n){return BX({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,zX(),RX].filter(e=>!!e),issueData:{code:Z.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof AZ){let e=this;return WX(async function(...t){let o=new LX([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return WX(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new LX([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new LX([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:SZ.create(t).rest(fZ.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||SZ.create([]).rest(fZ.create()),returns:n||fZ.create(),typeName:BZ.ZodFunction,...QX(r)})}},TZ=class extends $X{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};TZ.create=(e,t)=>new TZ({getter:e,typeName:BZ.ZodLazy,...QX(t)});var EZ=class extends $X{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Q(t,{received:t.data,code:Z.invalid_literal,expected:this._def.value}),HX}return{status:`valid`,value:e.data}}get value(){return this._def.value}};EZ.create=(e,t)=>new EZ({value:e,typeName:BZ.ZodLiteral,...QX(t)});function DZ(e,t){return new OZ({values:e,typeName:BZ.ZodEnum,...QX(t)})}var OZ=class e extends $X{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return Q(t,{expected:PX.joinValues(n),received:t.parsedType,code:Z.invalid_type}),HX}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return Q(t,{received:t.data,code:Z.invalid_enum_value,options:n}),HX}return WX(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};OZ.create=DZ;var kZ=class extends $X{_parse(e){let t=PX.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==FX.string&&n.parsedType!==FX.number){let e=PX.objectValues(t);return Q(n,{expected:PX.joinValues(e),received:n.parsedType,code:Z.invalid_type}),HX}if(this._cache||=new Set(PX.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=PX.objectValues(t);return Q(n,{received:n.data,code:Z.invalid_enum_value,options:e}),HX}return WX(e.data)}get enum(){return this._def.values}};kZ.create=(e,t)=>new kZ({values:e,typeName:BZ.ZodNativeEnum,...QX(t)});var AZ=class extends $X{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==FX.promise&&t.common.async===!1?(Q(t,{code:Z.invalid_type,expected:FX.promise,received:t.parsedType}),HX):WX((t.parsedType===FX.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};AZ.create=(e,t)=>new AZ({type:e,typeName:BZ.ZodPromise,...QX(t)});var jZ=class extends $X{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===BZ.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{Q(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return HX;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?HX:r.status===`dirty`||t.value===`dirty`?UX(r.value):r});{if(t.value===`aborted`)return HX;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?HX:r.status===`dirty`||t.value===`dirty`?UX(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?HX:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?HX:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!qX(e))return HX;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>qX(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):HX);PX.assertNever(r)}};jZ.create=(e,t,n)=>new jZ({schema:e,typeName:BZ.ZodEffects,effect:t,...QX(n)}),jZ.createWithPreprocess=(e,t,n)=>new jZ({schema:t,effect:{type:`preprocess`,transform:e},typeName:BZ.ZodEffects,...QX(n)});var MZ=class extends $X{_parse(e){return this._getType(e)===FX.undefined?WX(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};MZ.create=(e,t)=>new MZ({innerType:e,typeName:BZ.ZodOptional,...QX(t)});var NZ=class extends $X{_parse(e){return this._getType(e)===FX.null?WX(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};NZ.create=(e,t)=>new NZ({innerType:e,typeName:BZ.ZodNullable,...QX(t)});var PZ=class extends $X{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===FX.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};PZ.create=(e,t)=>new PZ({innerType:e,typeName:BZ.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...QX(t)});var FZ=class extends $X{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return JX(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new LX(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new LX(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};FZ.create=(e,t)=>new FZ({innerType:e,typeName:BZ.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...QX(t)});var IZ=class extends $X{_parse(e){if(this._getType(e)!==FX.nan){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.nan,received:t.parsedType}),HX}return{status:`valid`,value:e.data}}};IZ.create=e=>new IZ({typeName:BZ.ZodNaN,...QX(e)});var LZ=class extends $X{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},RZ=class e extends $X{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?HX:e.status===`dirty`?(t.dirty(),UX(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?HX:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:BZ.ZodPipeline})}},zZ=class extends $X{_parse(e){let t=this._def.innerType._parse(e),n=e=>(qX(e)&&(e.value=Object.freeze(e.value)),e);return JX(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};zZ.create=(e,t)=>new zZ({innerType:e,typeName:BZ.ZodReadonly,...QX(t)}),_Z.lazycreate;var BZ;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(BZ||={});var VZ=rZ.create,HZ=iZ.create;IZ.create,aZ.create;var Qye=oZ.create;sZ.create,cZ.create,lZ.create,uZ.create,dZ.create,fZ.create,pZ.create,mZ.create;var UZ=hZ.create,WZ=_Z.create;_Z.strictCreate;var $ye=vZ.create,GZ=Yye.create;xZ.create,SZ.create;var ebe=Xye.create;CZ.create,wZ.create,Zye.create,TZ.create;var KZ=EZ.create,qZ=OZ.create;kZ.create,AZ.create,jZ.create,MZ.create,NZ.create,jZ.createWithPreprocess,RZ.create;var JZ=HZ().int().positive(),YZ=qZ([`windows`,`macos`,`common`]),XZ=$ye([VZ(),ebe(VZ())]),tbe=WZ({id:VZ().min(1),title:VZ(),command:VZ(),args:UZ(VZ()),platform:YZ,isExited:Qye(),exitCode:HZ().int().nullable(),closeTip:VZ().optional(),closeCallbackUrl:XZ.optional()});GZ(`type`,[WZ({type:KZ(`create`),requestId:VZ().min(1),cols:JZ.optional(),rows:JZ.optional(),command:VZ().min(1).optional(),args:UZ(VZ()).optional(),closeTip:VZ().optional(),closeCallbackUrl:XZ.optional()}),WZ({type:KZ(`input`),sessionId:VZ().min(1),data:VZ()}),WZ({type:KZ(`resize`),sessionId:VZ().min(1),cols:JZ,rows:JZ}),WZ({type:KZ(`close`),sessionId:VZ().min(1)}),WZ({type:KZ(`attach`),sessionId:VZ().min(1),cols:JZ.optional(),rows:JZ.optional()}),WZ({type:KZ(`list`)})]);var nbe=WZ({type:KZ(`created`),requestId:VZ().min(1),sessionId:VZ().min(1),platform:YZ}),rbe=WZ({type:KZ(`output`),sessionId:VZ().min(1),data:VZ()}),ibe=WZ({type:KZ(`exit`),sessionId:VZ().min(1),exitCode:HZ().int()}),abe=WZ({type:KZ(`title`),sessionId:VZ().min(1),title:VZ()}),obe=WZ({type:KZ(`buffer`),sessionId:VZ().min(1),data:VZ()}),sbe=WZ({type:KZ(`list`),sessions:UZ(tbe)}),cbe=qZ([`INVALID_JSON`,`INVALID_MESSAGE`,`SESSION_NOT_FOUND`,`PTY_CREATE_FAILED`]),lbe=GZ(`type`,[nbe,rbe,ibe,abe,obe,sbe,WZ({type:KZ(`error`),code:cbe,message:VZ().min(1),sessionId:VZ().min(1).optional()})]),ube=2,dbe=1;function fbe(e){return e?.ownerDocument?.defaultView?e.ownerDocument.defaultView:window}function ZZ(e){return fbe(e).getComputedStyle(e,null)}var pbe=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows)||(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&this._terminal.resize(e.cols,e.rows)}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal.dimensions;if(!e||e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollbar?.showScrollbar??!0,n=this._terminal.options.scrollback===0||!t?0:this._terminal.options.scrollbar?.width??14,r=ZZ(this._terminal.element.parentElement),i=parseInt(r.getPropertyValue(`height`)),a=Math.max(0,parseInt(r.getPropertyValue(`width`))),o=ZZ(this._terminal.element),s={top:parseInt(o.getPropertyValue(`padding-top`)),bottom:parseInt(o.getPropertyValue(`padding-bottom`)),right:parseInt(o.getPropertyValue(`padding-right`)),left:parseInt(o.getPropertyValue(`padding-left`))},c=s.top+s.bottom,l=s.right+s.left,u=i-c,d=a-l-n;return{cols:Math.max(ube,Math.floor(d/e.css.cell.width)),rows:Math.max(dbe,Math.floor(u/e.css.cell.height))}}},mbe=class{constructor(e,t,n,r={}){this._terminal=e,this._regex=t,this._handler=n,this._options=r}provideLinks(e,t){let n=gbe.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map(e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){let{range:r}=e;this._options.hover(t,n,r)}},e))}};function hbe(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var gbe=class e{static computeLink(t,n,r,i){let a=new RegExp(n.source,(n.flags||``)+`g`),[o,s]=e._getWindowedLineStrings(t-1,r),c=o.join(``),l,u=[];for(;l=a.exec(c);){let t=l[0];if(!hbe(t))continue;let[n,a]=e._mapStrIdx(r,s,0,l.index),[o,c]=e._mapStrIdx(r,n,a,t.length);if(n===-1||a===-1||o===-1||c===-1)continue;let d={start:{x:a+1,y:n+1},end:{x:c,y:o+1}};u.push({range:d,text:t,activate:i})}return u}static _getWindowedLineStrings(e,t){let n,r=e,i=e,a=0,o=``,s=[];if(n=t.buffer.active.getLine(e)){let e=n.translateToString(!0);if(n.isWrapped&&e[0]!==` `){for(a=0;(n=t.buffer.active.getLine(--r))&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),!(!n.isWrapped||o.indexOf(` `)!==-1)););s.reverse()}for(s.push(e),a=0;(n=t.buffer.active.getLine(++i))&&n.isWrapped&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),o.indexOf(` `)===-1););}return[s,r]}static _mapStrIdx(e,t,n,r){let i=e.buffer.active,a=i.getNullCell(),o=n;for(;r;){let e=i.getLine(t);if(!e)return[-1,-1];for(let n=o;n<e.length;++n){e.getCell(n,a);let o=a.getChars();if(a.getWidth()&&(r-=o.length||1,n===e.length-1&&o===``)){let e=i.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,a),a.getWidth()===2&&(r+=1))}if(r<0)return[t,n]}t++,o=0}return[t,o]}},_be=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function vbe(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}var ybe=class{constructor(e=vbe,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,n=t.urlRegex??_be;this._linkProvider=this._terminal.registerLinkProvider(new mbe(this._terminal,n,this._handler,t))}dispose(){this._linkProvider?.dispose()}},QZ=Object.defineProperty,bbe=Object.getOwnPropertyDescriptor,xbe=(e,t)=>{for(var n in t)QZ(e,n,{get:t[n],enumerable:!0})},$Z=(e,t,n,r)=>{for(var i=r>1?void 0:r?bbe(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&QZ(t,n,i),i},$=(e,t)=>(n,r)=>t(n,r,e),eQ=`Terminal input`,tQ={get:()=>eQ,set:e=>eQ=e},nQ=`Too much output to announce, navigate to rows manually to read`,rQ={get:()=>nQ,set:e=>nQ=e};function Sbe(e){return e.replace(/\r?\n/g,`\r`)}function Cbe(e,t){return t?`\x1B[200~${e.replace(/\x1b/g,`␛`)}\x1B[201~`:e}function wbe(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function Tbe(e,t,n,r){e.stopPropagation(),e.clipboardData&&iQ(e.clipboardData.getData(`text/plain`),t,n,r)}function iQ(e,t,n,r){e=Sbe(e),e=Cbe(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function aQ(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function oQ(e,t,n,r,i){aQ(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function sQ(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function cQ(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var Ebe=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},Dbe=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}else this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},lQ=class e{constructor(){this.fg=0,this.bg=0,this.extended=new uQ}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return(this.fg&50331648)==0}isBgDefault(){return(this.bg&50331648)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},uQ=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},dQ=class e extends lQ{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new uQ,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?sQ(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}attributesEquals(e){if(this.getFgColorMode()!==e.getFgColorMode()||this.getFgColor()!==e.getFgColor()||this.getBgColorMode()!==e.getBgColorMode()||this.getBgColor()!==e.getBgColor()||this.isInverse()!==e.isInverse()||this.isBold()!==e.isBold()||this.isUnderline()!==e.isUnderline())return!1;if(this.isUnderline()){if(this.getUnderlineStyle()!==e.getUnderlineStyle())return!1;let t=this.isUnderlineColorDefault(),n=e.isUnderlineColorDefault();if(!(t&&n)&&(t!==n||this.getUnderlineColor()!==e.getUnderlineColor()||this.getUnderlineColorMode()!==e.getUnderlineColorMode()))return!1}return!(this.isOverline()!==e.isOverline()||this.isBlink()!==e.isBlink()||this.isInvisible()!==e.isInvisible()||this.isItalic()!==e.isItalic()||this.isDim()!==e.isDim()||this.isStrikethrough()!==e.isStrikethrough())}},fQ=`di$target`,pQ=`di$dependencies`,mQ=new Map;function Obe(e){return e[pQ]||[]}function hQ(e){if(mQ.has(e))return mQ.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);kbe(t,e,r)};return t._id=e,mQ.set(e,t),t}function kbe(e,t,n){t[fQ]===t?t[pQ].push({id:e,index:n}):(t[pQ]=[{id:e,index:n}],t[fQ]=t)}var gQ=hQ(`BufferService`),_Q=hQ(`CoreMouseService`),vQ=hQ(`CoreService`),Abe=hQ(`CharsetService`),yQ=hQ(`InstantiationService`),bQ=hQ(`LogService`),xQ=hQ(`OptionsService`),SQ=hQ(`OscLinkService`),jbe=hQ(`UnicodeService`),CQ=hQ(`DecorationService`),wQ=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n,this._workCell=new dQ}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=this._workCell,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(!(c===-1&&!n.hasContent(t))){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId)if(c===-1){c=t,s=a.extended.urlId;continue}else l=a.extended.urlId!==s;else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+(!l&&t===o-1?1:0),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):Mbe(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};wQ=$Z([$(0,gQ),$(1,xQ),$(2,SQ)],wQ);function Mbe(e,t){if(confirm(`Do you want to navigate to ${t}?
446
+ `;function Xve(e,t){let n=e.path.split(`/`),r=t.path.split(`/`),i=Math.min(n.length,r.length);for(let a=0;a<i;a++){let i=a===n.length-1,o=a===r.length-1;if(n[a]!==r[a]){if(i&&o){if(e.type!==t.type)return e.type===`directory`?-1:1}else if(i&&!o)return e.type===`directory`?n[a].localeCompare(r[a]):1;else if(!i&&o)return t.type===`directory`?n[a].localeCompare(r[a]):-1;return n[a].localeCompare(r[a])}}return n.length-r.length}function DX(e){return e.split(`/`).pop()??e}function Zve(e){return e.split(`/`).slice(0,-1).join(`/`)}function Qve(e){let t=(e??``).trim().replace(/\/+$/g,``);if(!t)return[];let n=/^([A-Za-z][A-Za-z0-9+.-]*:)(.*)$/.exec(t);if(!n)return t.split(`/`).filter(Boolean);let r=n[1],i=n[2].replace(/^\/+/g,``),a=[r];return i.length>0&&a.push(...i.split(`/`).filter(Boolean)),a}function $ve({path:e,rootPath:t,entries:n,onNavigate:r}){let i=Qve(t).map((e,t)=>({key:`root-${t}-${e}`,kind:`root`,name:e})),a=e.split(`/`).filter(Boolean),o=e.endsWith(`.md`),s=[];for(let e=0;e<a.length;e++){let t=a.slice(0,e+1).join(`/`),n=e===a.length-1;s.push({key:`path-${t}`,name:a[e],path:t,isFile:n})}let c=[...i,...s],l=i.length;return(0,K.jsx)(`div`,{className:`border-border/50 bg-muted/20 flex items-center gap-1 overflow-x-auto border-b px-3 py-2 text-xs`,children:c.map((e,t)=>{let i=t===c.length-1,a=t<l,u=!a&&!i&&n.some(e=>e.type===`file`&&e.path.startsWith(s[t-l].path+`/`));return(0,K.jsxs)(`span`,{className:`flex items-center gap-1`,children:[t>0&&(0,K.jsx)(Sc,{className:`text-muted-foreground/50 h-3 w-3`}),a?(0,K.jsxs)(`span`,{className:`text-muted-foreground flex items-center gap-1.5`,children:[(0,K.jsx)(Vc,{className:`h-3.5 w-3.5`}),e.name]}):i?(0,K.jsxs)(`span`,{className:`text-foreground flex items-center gap-1.5`,children:[s[t-l].isFile?o?(0,K.jsx)(Fc,{className:`h-3.5 w-3.5`}):(0,K.jsx)(Ic,{className:`h-3.5 w-3.5`}):(0,K.jsx)(Vc,{className:`h-3.5 w-3.5`}),e.name]}):u?(0,K.jsxs)(`button`,{onClick:()=>{let e=n.find(e=>e.type===`file`&&e.path.startsWith(s[t-l].path+`/`));e&&r(e.path)},className:`text-muted-foreground hover:text-foreground flex items-center gap-1.5 transition-colors`,children:[(0,K.jsx)(Vc,{className:`h-3.5 w-3.5`}),s[t-l].name]}):(0,K.jsxs)(`span`,{className:`text-muted-foreground flex items-center gap-1.5`,children:[(0,K.jsx)(Vc,{className:`h-3.5 w-3.5`}),s[t-l].name]})]},e.key)})})}function eye({entries:e,selectedPath:t,onSelect:n,entryActions:r}){let i=(0,G.useRef)(null),[a,o]=(0,G.useState)(null),s=e.filter(e=>e.type===`file`),c=s.find(e=>e.path===t)??s[0]??null,l=c&&r?EX(r(c)):[];return(0,K.jsxs)(wX,{ref:i,className:`border-border bg-muted/30 flex items-stretch overflow-hidden rounded-md border`,children:[(0,K.jsx)(`div`,{className:`scrollbar-thin scrollbar-track-transparent flex min-w-0 flex-1 gap-1 overflow-x-auto px-1 py-1`,children:s.map(e=>{let r=e.path===t,i=e.path.endsWith(`.md`);return(0,K.jsxs)(`button`,{onClick:()=>n(e.path),title:e.path,className:`flex shrink-0 items-center gap-1.5 rounded px-2.5 py-1.5 text-xs transition-colors ${r?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:bg-background/50 hover:text-foreground`}`,children:[i?(0,K.jsx)(Fc,{className:`h-3.5 w-3.5`}):(0,K.jsx)(Ic,{className:`h-3.5 w-3.5`}),(0,K.jsx)(`span`,{className:`max-w-[120px] truncate`,children:DX(e.path)})]},e.path)})}),l.length>0&&(0,K.jsxs)(TX,{className:`text-muted-foreground inline-flex items-center`,children:[(0,K.jsx)(`span`,{"aria-hidden":`true`,className:`bg-border/80 block w-px self-stretch`}),(0,K.jsx)(`button`,{type:`button`,onClick:e=>{o({type:`target`,element:e.currentTarget,placement:`bottom-end`})},className:`text-muted-foreground hover:text-foreground hover:bg-background/80 inline-flex h-7 w-7 shrink-0 items-center justify-center rounded`,"aria-label":`Current file actions`,children:(0,K.jsx)(Mc,{className:`h-4 w-4`})})]}),(0,K.jsx)(CX,{open:a!==null,items:l,anchor:a,wrapperElement:i.current,boundaryElement:i.current,onClose:()=>o(null)})]})}function tye({entries:e,selectedPath:t,onSelect:n,headerLabel:r,headerActions:i,entryActions:a}){let[o,s]=(0,G.useState)(null),c=(0,G.useRef)(null),l=t=>{let n=Zve(t.path);return n?e.some(e=>e.type===`directory`&&e.path===n)?l(e.find(e=>e.path===n))+1:t.path.split(`/`).length-1:0},u=(e,t)=>{let n=EX(t);n.length!==0&&s({anchor:e,items:n})};return(0,K.jsxs)(wX,{ref:c,className:`border-border bg-muted/30 flex h-full flex-col rounded-md border`,children:[(0,K.jsxs)(`div`,{className:`border-border/50 text-muted-foreground flex items-center justify-between border-b px-3 py-2 text-xs font-medium`,children:[(0,K.jsx)(`span`,{className:`min-w-0 truncate`,children:r}),i]}),(0,K.jsx)(`div`,{className:`scrollbar-thin scrollbar-track-transparent flex-1 overflow-y-auto`,children:e.length===0?(0,K.jsx)(`div`,{className:`text-muted-foreground px-3 py-2 text-xs`,children:`No files yet.`}):e.map(e=>{let r=l(e),i=e.path===t,o=e.type===`file`,s=a?a(e):[],c=s.length>0,d=o?e.path.endsWith(`.md`)?(0,K.jsx)(Fc,{className:`h-4 w-4 shrink-0`}):(0,K.jsx)(Ic,{className:`h-4 w-4 shrink-0`}):(0,K.jsx)(Vc,{className:`h-4 w-4 shrink-0`});return(0,K.jsxs)(`div`,{className:`group flex w-full items-center gap-2 px-2 py-1 text-sm transition-colors ${i?`bg-primary/10 text-foreground`:o?`text-muted-foreground hover:bg-muted/50 hover:text-foreground`:`text-muted-foreground`}`,onContextMenu:t=>{c&&(t.preventDefault(),o&&n(e.path),u({type:`point`,x:t.clientX,y:t.clientY},s))},children:[(0,K.jsxs)(`button`,{type:`button`,disabled:!o,onClick:()=>o&&n(e.path),className:`flex flex-1 items-center gap-2 text-left ${o?``:`cursor-default`}`,style:{paddingLeft:4+r*14},children:[d,(0,K.jsx)(`span`,{className:`truncate ${o?``:`text-foreground font-medium`}`,children:DX(e.path)})]}),c&&(0,K.jsx)(TX,{children:(0,K.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),u({type:`target`,element:e.currentTarget,placement:`bottom-end`},s)},className:`hover:bg-muted text-muted-foreground flex h-7 w-7 items-center justify-center rounded-md`,"aria-label":`File actions`,children:(0,K.jsx)(Mc,{className:`h-4 w-4`})})})]},e.path)})}),(0,K.jsx)(CX,{open:!!o,items:o?.items??[],anchor:o?.anchor??null,boundaryElement:c.current,onClose:()=>s(null)})]})}function OX({entries:e,selectedPath:t,onSelect:n,breadcrumbRoot:r,headerLabel:i=`Files`,headerActions:a,entryActions:o,renderEditor:s,emptyState:c}){let l=(0,G.useMemo)(()=>[...e].sort(Xve),[e]),u=(0,G.useMemo)(()=>!l.length||!t?null:l.find(e=>e.path===t&&e.type===`file`)??null,[l,t]);return(0,K.jsxs)(`div`,{className:`@container-[size] h-full`,children:[(0,K.jsx)(`style`,{children:Yve}),(0,K.jsxs)(`div`,{className:`fev-layout`,children:[(0,K.jsx)(`div`,{className:`fev-sidebar-tabs`,children:(0,K.jsx)(eye,{entries:l,selectedPath:t,onSelect:n,entryActions:o})}),(0,K.jsx)(`div`,{className:`fev-sidebar-tree`,children:(0,K.jsx)(tye,{entries:l,selectedPath:t,onSelect:n,headerLabel:i,headerActions:a,entryActions:o})}),(0,K.jsx)(`div`,{className:`fev-editor-wrapper border-border bg-background overflow-hidden rounded-md border shadow-sm`,children:u?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)($ve,{path:u.path,rootPath:r,entries:l,onNavigate:n}),s(u)]}):(0,K.jsx)(`div`,{className:`text-muted-foreground flex h-full items-center justify-center`,children:l.length>0?`Select a file to view`:c??`No files found.`})})]})]})}function kX({file:e,value:t,readOnly:n=!0,onChange:r,lineWrapping:i}){return(0,K.jsx)(SX,{value:t,filename:e.path,readOnly:n,lineWrapping:i,className:`min-h-0 flex-1`,onChange:r},e.path)}function AX({changeId:e,archived:t=!1}){let{data:n,isLoading:r,error:i}=t?Rte(e):Fte(e),[a,o]=(0,G.useState)(null),s=(0,G.useMemo)(()=>n?[...n]:[],[n]);return(0,G.useEffect)(()=>{if(!s.length){o(null);return}s.find(e=>e.path===a&&e.type===`file`)||o(s.find(e=>e.type===`file`)?.path??null)},[s,a]),r?(0,K.jsx)(`div`,{className:`border-border bg-muted/20 flex h-[400px] items-center justify-center rounded-md border`,children:(0,K.jsx)(Qc,{className:`text-muted-foreground h-6 w-6 animate-spin`})}):i?(0,K.jsxs)(`div`,{className:`border-destructive/50 bg-destructive/10 text-destructive rounded-md border p-4 text-sm`,children:[`Failed to load files: `,i.message]}):(0,K.jsx)(OX,{entries:s,selectedPath:a,onSelect:o,emptyState:(0,K.jsx)(`span`,{children:`No files found for this change.`}),renderEditor:e=>e?(0,K.jsx)(kX,{file:e,value:e.content??``,readOnly:!0}):(0,K.jsx)(`div`,{className:`text-muted-foreground flex h-full items-center justify-center`,children:`Select a file to view`})})}function nye(e){let t=new Map;for(let n of e){let e=n.section||`General`,r=t.get(e)||[];r.push(n),t.set(e,r)}return Array.from(t.entries()).map(([e,t])=>({section:e,tasks:t,completed:t.filter(e=>e.completed).length,total:t.length}))}function rye(e){return`section-${e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``)}`}var iye=(0,G.memo)(function({task:e,taskIndex:t,isToggling:n,onToggle:r,readonly:i}){let a=(0,K.jsxs)(K.Fragment,{children:[n?(0,K.jsx)(Qc,{className:`text-primary h-5 w-5 shrink-0 animate-spin`}):e.completed?(0,K.jsx)(wc,{className:`h-5 w-5 shrink-0 text-green-500`}):(0,K.jsx)(Dc,{className:`text-muted-foreground group-hover:text-primary h-5 w-5 shrink-0`}),(0,K.jsx)(`span`,{className:`text-sm ${e.completed?`text-muted-foreground line-through`:``}`,children:e.text})]});return i||!r?(0,K.jsx)(`div`,{className:`flex w-full items-center gap-3 p-3 text-left`,children:a}):(0,K.jsx)(`button`,{onClick:()=>r(t,!e.completed),className:`hover:bg-muted/50 group flex w-full items-center gap-3 p-3 text-left transition-colors`,children:a})},(e,t)=>e.task.id===t.task.id&&e.task.text===t.task.text&&e.task.completed===t.task.completed&&e.isToggling===t.isToggling&&e.readonly===t.readonly);function aye({tasks:e,progress:t,onToggleTask:n,togglingIndex:r=null,tocBaseIndex:i=0,readonly:a=!1}){let o=(0,G.useMemo)(()=>nye(e),[e]),s=t.total>0?Math.round(t.completed/t.total*100):0,c=(e,t)=>{let n=0;for(let t=0;t<e;t++)n+=o[t].tasks.length;return n+t+1};return(0,K.jsxs)(iP,{id:`tasks`,index:i,children:[(0,K.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,K.jsxs)(`h2`,{className:`text-lg font-semibold`,children:[`Tasks (`,t.completed,`/`,t.total,`)`]}),(0,K.jsxs)(`span`,{className:`text-muted-foreground text-sm`,children:[s,`%`]})]}),(0,K.jsx)(`div`,{className:`bg-muted mb-4 h-2 w-full rounded-full`,children:(0,K.jsx)(`div`,{className:`bg-primary h-2 rounded-full transition-all`,style:{width:`${s}%`}})}),(0,K.jsxs)(`div`,{className:`space-y-6`,children:[o.map((e,t)=>{let o=rye(e.section),s=e.total>0?Math.round(e.completed/e.total*100):0;return(0,K.jsxs)(iP,{id:o,index:i+1+t,as:`div`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-center justify-between`,children:[(0,K.jsx)(`h3`,{className:`text-foreground font-medium`,children:e.section}),(0,K.jsxs)(`span`,{className:`text-muted-foreground text-xs`,children:[e.completed,`/`,e.total,` (`,s,`%)`]})]}),(0,K.jsx)(`div`,{className:`border-border divide-border divide-y rounded-lg border`,children:e.tasks.map((e,i)=>{let o=c(t,i);return(0,K.jsx)(iye,{task:e,taskIndex:o,isToggling:r===o,onToggle:n,readonly:a},e.id)})})]},e.section)}),o.length===0&&(0,K.jsx)(`div`,{className:`text-muted-foreground border-border rounded-lg border p-4 text-center`,children:`No tasks defined`})]})]})}var oye=Ls(`/archive/$changeId`);function sye(){let{changeId:e}=oye.useParams(),t=uc(),{data:n}=Lte(e),[r,i]=(0,G.useState)(!0),a=(0,G.useRef)(null),o=(0,G.useMemo)(()=>({family:`archive`,entityId:e}),[e]),s=Z_(t.state);(0,G.useEffect)(()=>{let e=requestAnimationFrame(()=>i(!1));return()=>cancelAnimationFrame(e)},[]);let c=(0,G.useMemo)(()=>{if(!n)return[];let t=[{id:`overview`,label:`Overview`,icon:(0,K.jsx)(Fc,{className:`h-4 w-4`}),content:(0,K.jsx)(hpe,{change:n})}];return n.tasks.length>0&&t.push({id:`tasks`,label:`Tasks (${n.progress.completed}/${n.progress.total})`,icon:(0,K.jsx)(Xc,{className:`h-4 w-4`}),content:(0,K.jsx)(`div`,{className:`border-border scrollbar-thin scrollbar-track-transparent h-full overflow-auto rounded-lg border p-4`,children:(0,K.jsx)(aye,{tasks:n.tasks,progress:n.progress,readonly:!0})})}),t.push({id:`folder`,label:`Folder`,icon:(0,K.jsx)(Bc,{className:`h-4 w-4`}),content:(0,K.jsx)(AX,{changeId:e,archived:!0})}),t},[n,e]),{tabsRef:l,selectedTab:u,onTabChange:d}=BP({queryKey:`archiveTab`,tabs:c,initialTab:c[0]?.id});return r&&!n?s?(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-6 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,K.jsx)(av,{to:`/archive`,vt:{source:a,sharedElements:o},className:`hover:bg-muted rounded-md p-2 transition-colors`,title:`Back to Archive`,children:(0,K.jsx)(_c,{className:`h-5 w-5`})}),(0,K.jsxs)(`div`,{ref:a,...J_(o,`container`),children:[(0,K.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,K.jsx)(gc,{...J_(o,`icon`),className:`h-6 w-6 shrink-0`}),(0,K.jsx)(`span`,{...J_(o,`title`),children:s.title??e})]}),(0,K.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:s.subtitle??e})]})]}),(0,K.jsx)(`div`,{className:`vt-detail-content route-loading animate-pulse rounded-lg border p-4`,children:`Loading archived change...`})]}):(0,K.jsx)(`div`,{className:`route-loading animate-pulse`,children:`Loading archived change...`}):n?(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-6 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,K.jsx)(av,{to:`/archive`,vt:{source:a,sharedElements:o},className:`hover:bg-muted rounded-md p-2 transition-colors`,title:`Back to Archive`,children:(0,K.jsx)(_c,{className:`h-5 w-5`})}),(0,K.jsxs)(`div`,{ref:a,...J_(o,`container`),children:[(0,K.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,K.jsx)(gc,{...J_(o,`icon`),className:`h-6 w-6 shrink-0`}),(0,K.jsx)(`span`,{...J_(o,`title`),children:n.name})]}),(0,K.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:e})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,K.jsx)(wc,{className:`h-4 w-4 text-green-500`}),(0,K.jsxs)(`span`,{className:`text-green-600`,children:[`Completed: `,n.progress.completed,`/`,n.progress.total,` tasks`]})]}),(0,K.jsx)(`div`,{className:`vt-detail-content flex min-h-0 flex-1 flex-col`,children:(0,K.jsx)(gP,{ref:l,tabs:c,selectedTab:u,onTabChange:d,className:`min-h-0 flex-1 gap-6`})})]}):(0,K.jsxs)(`div`,{className:`py-12 text-center`,children:[(0,K.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Archived change not found: `,e]}),(0,K.jsx)(av,{to:`/archive`,className:`text-primary mt-4 inline-block hover:underline`,children:`Back to Archive`})]})}function jX(e){return e.hasStatus?e.isComplete&&e.tasksComplete?{label:`Ready to Archive`,toneClass:`border-emerald-500/40 text-emerald-700 dark:text-emerald-300`}:e.trackedArtifactStatus===`blocked`?{label:`Draft`,toneClass:`border-amber-500/40 text-amber-700 dark:text-amber-300`}:{label:`In Execution`,toneClass:`border-primary/40 text-primary`}:{label:`Unknown`,toneClass:`border-border text-muted-foreground`}}function MX(e){return e.includes(`blocked`)?`blocked`:e.includes(`ready`)?`ready`:e.includes(`done`)?`done`:null}function cye(e){return new Map((e??[]).map(e=>[e.changeName,e]))}function lye(){let{data:e,isLoading:t}=Pte(),{data:n}=O_(),r=cye(n);return t&&!e?(0,K.jsx)(`div`,{className:`route-loading animate-pulse`,children:`Loading changes...`}):(0,K.jsxs)(`div`,{className:`space-y-6 p-4`,children:[(0,K.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,K.jsx)(Hc,{className:`h-6 w-6 shrink-0`}),`Changes`]}),(0,K.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Active OPSX changes. Completed changes are moved to`,` `,(0,K.jsx)(av,{to:`/archive`,className:`text-primary hover:underline`,children:`Archive`}),`.`]}),(0,K.jsxs)(`div`,{className:`border-border divide-border divide-y rounded-lg border`,children:[e?.map(e=>{let t=r.get(e.id),n=t?.artifacts.filter(e=>e.status===`done`).length??0,i=t?.artifacts.length??0,a=jX({hasStatus:!!t,isComplete:t?.isComplete??!1,tasksComplete:e.progress.total===0||e.progress.completed>=e.progress.total,trackedArtifactStatus:MX(t?.artifacts.map(e=>e.status)??[])}),o=e.progress.total>0?Math.round(e.progress.completed/e.progress.total*100):0,s={family:`changes`,entityId:e.id};return(0,K.jsxs)(av,{to:`/changes/$changeId`,params:{changeId:e.id},state:t=>({...t,__vtHandoff:{family:`changes`,entityId:e.id,title:e.name,subtitle:e.id}}),vt:{sharedElements:s},...J_(s,`container`),className:`hover:bg-muted/50 block px-4 py-3`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex min-w-0 items-start gap-3`,children:[(0,K.jsx)(Hc,{...J_(s,`icon`),className:`text-muted-foreground mt-0.5 h-5 w-5 shrink-0`}),(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`div`,{...J_(s,`title`),className:`truncate font-medium`,children:e.name}),(0,K.jsxs)(`div`,{className:`text-muted-foreground truncate text-sm`,children:[e.id,e.updatedAt>0&&(0,K.jsxs)(K.Fragment,{children:[` · `,zT(e.updatedAt)]})]})]})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex flex-col items-end gap-1 text-right text-sm`,children:[(0,K.jsx)(`span`,{className:`rounded border px-1.5 py-0.5 text-[11px] font-medium ${a.toneClass}`,children:a.label}),(0,K.jsxs)(`div`,{className:`font-medium`,children:[e.progress.completed,`/`,e.progress.total]}),(0,K.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:`tasks`})]}),(0,K.jsx)(Sc,{className:`text-muted-foreground h-4 w-4 shrink-0`})]})]}),(0,K.jsx)(`div`,{className:`bg-muted h-1.5 rounded-full`,children:(0,K.jsx)(`div`,{className:`bg-primary h-full rounded-full transition-all`,style:{width:`${o}%`}})}),(0,K.jsxs)(`div`,{className:`text-muted-foreground mt-2 flex flex-wrap items-center justify-between gap-2 text-xs`,children:[(0,K.jsxs)(`span`,{children:[o,`% task completion`]}),t?(0,K.jsxs)(`span`,{className:`truncate`,children:[n,`/`,i,` artifacts · `,t.schemaName]}):(0,K.jsx)(`span`,{children:`Loading workflow status…`})]})]},e.id)}),e?.length===0&&(0,K.jsxs)(`div`,{className:`text-muted-foreground p-4 text-center`,children:[(0,K.jsx)(`div`,{children:`No active changes.`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs`,children:`Recommended workflow start: Quick Propose`}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>cv.activatePop(`/opsx-propose`),className:`text-primary mt-2 inline-flex items-center gap-1 hover:underline`,title:`Open Quick Propose`,children:[(0,K.jsx)(hl,{className:`h-3.5 w-3.5`}),`Start Propose`]}),(0,K.jsxs)(`button`,{type:`button`,onClick:()=>cv.activatePop(`/opsx-new`),className:`text-primary mt-2 inline-flex items-center gap-1 hover:underline`,title:`Open the advanced /opsx:new form`,children:[(0,K.jsx)(hl,{className:`h-3.5 w-3.5`}),`Open advanced /opsx:new form`]})]})]})]})}function uye(e){return e.includes(`*`)||e.includes(`?`)||e.includes(`[`)}var dye={done:{label:`Done`,className:`text-emerald-500`,icon:Tc},ready:{label:`Ready`,className:`text-sky-500`,icon:Dc},blocked:{label:`Blocked`,className:`text-amber-500`,icon:bl}};function fye({artifact:e}){let t=dye[e.status],n=t.icon;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`border-border bg-card flex flex-wrap items-center justify-between gap-3 rounded-md border px-4 py-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(Fc,{className:`text-muted-foreground h-4 w-4`}),(0,K.jsx)(`span`,{className:`font-medium`,children:e.id}),(0,K.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.relativePath??e.outputPath})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(n,{className:`h-4 w-4 ${t.className}`}),(0,K.jsx)(`span`,{className:`text-xs font-medium ${t.className}`,children:t.label})]})]}),e.status===`blocked`&&e.missingDeps?.length?(0,K.jsxs)(`div`,{className:`border-border flex items-start gap-2 rounded-md border border-amber-500/50 bg-amber-500/10 px-3 py-2 text-xs text-amber-700`,children:[(0,K.jsx)(bl,{className:`h-4 w-4 shrink-0`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`font-medium`,children:`Blocked by missing dependencies`}),(0,K.jsx)(`div`,{className:`mt-1`,children:e.missingDeps.join(`, `)})]})]}):null]})}function pye({changeId:e,artifact:t}){let{data:n,isLoading:r}=Gte(e,t.outputPath);return r?(0,K.jsx)(`div`,{className:`text-muted-foreground flex h-full items-center justify-center text-sm`,children:`Loading output...`}):n?(0,K.jsx)(uP,{markdown:n}):(0,K.jsxs)(`div`,{className:`text-muted-foreground flex h-full items-center justify-center rounded-md border border-dashed p-6 text-sm`,children:[`Not yet generated. Use `,(0,K.jsx)(`strong`,{className:`mx-2 font-bold`,children:`Continue`}),` to generate this artifact.`]})}function mye({changeId:e,artifact:t}){let{data:n,isLoading:r}=Kte(e,t.outputPath);return r?(0,K.jsx)(`div`,{className:`flex h-[400px] items-center justify-center`,children:(0,K.jsx)(Qc,{className:`text-muted-foreground h-6 w-6 animate-spin`})}):n?.length?(0,K.jsx)(uP,{markdown:({H1:e,Section:t})=>(0,K.jsx)(`div`,{className:`space-y-6`,children:n.map(n=>(0,K.jsxs)(t,{children:[(0,K.jsx)(e,{children:n.path}),(0,K.jsx)(`div`,{className:`border-border bg-muted/30 mt-2 rounded-lg border p-4 [zoom:0.86]`,children:(0,K.jsx)(uP,{markdown:n.content})})]},n.path))})}):(0,K.jsxs)(`div`,{className:`text-muted-foreground flex h-full items-center justify-center rounded-md border border-dashed p-6 text-sm`,children:[`Not yet generated. Use `,(0,K.jsx)(`strong`,{className:`mx-2 font-bold`,children:`Continue`}),` to generate this artifact.`]})}function hye({changeId:e,artifact:t}){let n=uye(t.outputPath);return(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 py-4`,children:[(0,K.jsx)(fye,{artifact:t}),(0,K.jsx)(`div`,{className:`min-h-0 flex-1`,children:n?(0,K.jsx)(mye,{changeId:e,artifact:t}):(0,K.jsx)(pye,{changeId:e,artifact:t})})]})}function gye({status:e,selectedArtifactId:t,onComposeAction:n,onVerify:r,onRefresh:i}){let a=e.artifacts.find(e=>e.status===`ready`),o=new Set(e.artifacts.filter(e=>e.status===`done`).map(e=>e.id)),s=e.applyRequires.filter(e=>!o.has(e));return(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[[{id:`continue`,label:`Continue`,icon:ol,artifactId:t,disabled:!t||e.artifacts.find(e=>e.id===t)?.status===`blocked`,hint:t?void 0:`select an artifact`},{id:`ff`,label:`Fast-forward`,icon:ll,artifactId:a?.id,disabled:!a,hint:a?void 0:`no ready artifacts`},{id:`apply`,label:`Apply`,icon:wc,disabled:s.length>0,hint:s.length>0?`missing: ${s.join(`, `)}`:void 0},{id:`archive`,label:`Archive`,icon:gc,disabled:!e.isComplete,hint:e.isComplete?void 0:`complete artifacts first`}].map(e=>{let t=e.icon;return(0,K.jsxs)(`button`,{type:`button`,disabled:e.disabled,onClick:()=>n(e.id,e.artifactId),title:e.hint,className:`border-border hover:bg-muted inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs font-medium transition disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,K.jsx)(t,{className:`h-3.5 w-3.5`}),e.label]},e.id)}),(0,K.jsxs)(`button`,{type:`button`,onClick:r,className:`border-border hover:bg-muted inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs font-medium transition`,children:[(0,K.jsx)(pl,{className:`h-3.5 w-3.5`}),`Verify`]}),(0,K.jsxs)(`button`,{type:`button`,onClick:i,className:`border-border hover:bg-muted inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs font-medium transition`,children:[(0,K.jsx)(cl,{className:`h-3.5 w-3.5`}),`Refresh`]})]})}var _ye=`action`,vye=`change`,yye=`artifact`;function bye(e){let t=new URLSearchParams;return t.set(_ye,e.action),t.set(vye,e.changeId),e.artifactId&&t.set(yye,e.artifactId),`/opsx-compose?${t.toString()}`}function xye({status:e}){return e===`done`?(0,K.jsx)(Tc,{className:`h-3.5 w-3.5 text-emerald-500`}):e===`ready`?(0,K.jsx)(Dc,{className:`h-3.5 w-3.5 text-sky-500`}):(0,K.jsx)(bl,{className:`h-3.5 w-3.5 text-amber-500`})}function Sye(){let{changeId:e}=vs({from:`/changes/$changeId`}),t=uc(),[n,r]=(0,G.useState)(0),i=(0,G.useRef)(null),a=(0,G.useMemo)(()=>({family:`changes`,entityId:e}),[e]),o=Z_(t.state),{data:s,isLoading:c,error:l}=Bte({change:e,refreshKey:n}),u=(0,G.useCallback)((t,n)=>{let r=bye({action:t,changeId:e,artifactId:n});cv.activatePop(r)},[e]),d=(0,G.useCallback)(()=>{cv.activatePop(`/opsx-verify?change=${encodeURIComponent(e)}`)},[e]),f=(0,G.useCallback)(()=>{r(e=>e+1)},[]),p=(0,G.useMemo)(()=>s?[...s.artifacts.map(t=>({id:t.id,label:t.id,icon:(0,K.jsx)(xye,{status:t.status}),content:(0,K.jsx)(hye,{changeId:e,artifact:t})})),{id:`folder`,label:`Folder`,icon:(0,K.jsx)(Bc,{className:`h-4 w-4`}),content:(0,K.jsx)(AX,{changeId:e})}]:[],[s,e]),m=(0,G.useMemo)(()=>{if(s)return s.artifacts.find(e=>e.status===`ready`)?.id??s.artifacts[0]?.id},[s]),{tabsRef:h,selectedTab:g,onTabChange:_}=BP({queryKey:`artifact`,tabs:p,initialTab:m??p[0]?.id}),v=s?.artifacts.filter(e=>e.status===`done`).length??0,y=s?.artifacts.length??0,b=l?.message.includes(`Change '${e}' not found`)||l?.message.includes(`Change "${e}" not found`);return c&&!s?o?(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,K.jsx)(av,{to:`/changes`,vt:{source:i,sharedElements:a},className:`hover:bg-muted rounded-md p-2`,children:(0,K.jsx)(_c,{className:`h-5 w-5`})}),(0,K.jsxs)(`div`,{ref:i,...J_(a,`container`),className:`flex min-w-0 flex-col gap-1`,children:[(0,K.jsxs)(`h1`,{className:`font-nav flex min-w-0 items-center gap-2 text-2xl font-bold`,children:[(0,K.jsx)(Hc,{...J_(a,`icon`),className:`h-6 w-6 shrink-0`}),(0,K.jsx)(`span`,{...J_(a,`title`),className:`truncate`,children:o.title??e})]}),(0,K.jsxs)(`p`,{className:`text-muted-foreground text-sm`,children:[o.subtitle??e,` · Loading change status…`]})]})]}),(0,K.jsx)(`div`,{className:`vt-detail-content route-loading animate-pulse rounded-lg border p-4`,children:`Loading change status...`})]}):(0,K.jsx)(`div`,{className:`route-loading animate-pulse`,children:`Loading change status...`}):b&&!s?(0,K.jsxs)(`div`,{className:`flex flex-col gap-3 p-4`,children:[(0,K.jsxs)(`div`,{className:`text-muted-foreground flex items-center gap-2 text-sm`,children:[(0,K.jsx)(Cc,{className:`h-4 w-4`}),`Change not found in the current project.`]}),(0,K.jsx)(`div`,{children:(0,K.jsx)(av,{to:`/changes`,className:`text-primary hover:underline`,children:`Back to Changes`})})]}):l&&!s?(0,K.jsxs)(`div`,{className:`text-destructive flex items-center gap-2`,children:[(0,K.jsx)(Cc,{className:`h-5 w-5`}),`Error loading change: `,l.message]}):s?(0,K.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-4 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,K.jsx)(av,{to:`/changes`,vt:{source:i,sharedElements:a},className:`hover:bg-muted rounded-md p-2`,children:(0,K.jsx)(_c,{className:`h-5 w-5`})}),(0,K.jsxs)(`div`,{ref:i,...J_(a,`container`),className:`flex min-w-0 flex-col gap-1`,children:[(0,K.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,K.jsx)(Hc,{...J_(a,`icon`),className:`h-6 w-6 shrink-0`}),(0,K.jsx)(`span`,{...J_(a,`title`),children:s.changeName})]}),(0,K.jsxs)(`p`,{className:`text-muted-foreground text-sm`,children:[`Schema: `,s.schemaName,` · `,v,`/`,y,` artifacts`]})]})]}),(0,K.jsx)(gye,{status:s,selectedArtifactId:m,onComposeAction:u,onVerify:d,onRefresh:f})]}),(0,K.jsx)(`div`,{className:`vt-detail-content flex min-h-0 flex-1 flex-col`,children:(0,K.jsx)(gP,{ref:h,tabs:p,selectedTab:g,onTabChange:_,className:`min-h-0 flex-1`})})]}):(0,K.jsxs)(`div`,{className:`text-muted-foreground flex items-center gap-2 text-sm`,children:[(0,K.jsx)(Cc,{className:`h-4 w-4`}),`Change not found.`]})}function NX({value:e,options:t,onChange:n,className:r=``,tone:i=`default`}){return(0,K.jsx)(`div`,{className:`inline-flex w-fit max-w-full self-start overflow-hidden rounded-md border ${i===`terminal`?`border-terminal-foreground/25 bg-terminal/70 text-terminal-foreground`:`border-border bg-card`} ${r}`,children:t.map((t,r)=>{let a=t.value===e,o=a?`bg-primary text-primary-foreground`:i===`terminal`?`text-terminal-foreground/72 hover:bg-terminal-foreground/10 hover:text-terminal-foreground`:`text-muted-foreground hover:bg-muted/60 hover:text-foreground`;return(0,K.jsx)(`button`,{type:`button`,disabled:t.disabled,onClick:()=>n(t.value),"aria-pressed":a,className:`px-3 py-1.5 text-xs font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${r>0?i===`terminal`?`border-terminal-foreground/20 border-l`:`border-border border-l`:``} ${o}`,children:t.label},t.value)})})}var Cye=(0,G.forwardRef)(function({lines:e,maxHeight:t=`60vh`,scrollRef:n},r){return(0,K.jsxs)(`div`,{ref:n??r,className:`scrollbar-thin scrollbar-track-transparent scrollbar-thumb-zinc-700 overflow-auto bg-zinc-900 p-4 font-mono text-sm text-zinc-100`,style:{maxHeight:t},children:[e.length===0&&(0,K.jsx)(`span`,{className:`text-zinc-500`,children:`Waiting to start…`}),e.map(e=>e.kind===`html`?(0,K.jsx)(`div`,{className:`whitespace-pre-wrap break-all`,children:e.node},e.id):(0,K.jsx)(`div`,{className:`whitespace-pre-wrap break-all`,children:(0,K.jsx)(`span`,{className:e.tone===`success`?`text-green-400`:e.tone===`error`?`text-red-400`:e.tone===`info`?`text-blue-300`:void 0,children:wye(e.text)})},e.id))]})});function wye(e){let t=[],n=0,r=null,i=/\x1b\[(\d+)m/g,a;for(;(a=i.exec(e))!==null;){if(a.index>n){let i=e.slice(n,a.index);t.push(r?(0,K.jsx)(`span`,{className:r,children:i},n):i)}let i=parseInt(a[1],10);i===0?r=null:i===31?r=`text-red-400`:i===32?r=`text-green-400`:i===33?r=`text-yellow-400`:i===34?r=`text-blue-400`:i===35?r=`text-fuchsia-300`:i===36?r=`text-cyan-300`:(i===37||i===90)&&(r=`text-zinc-400`),n=a.index+a[0].length}if(n<e.length){let i=e.slice(n);t.push(r?(0,K.jsx)(`span`,{className:r,children:i},n):i)}return t.length>0?t:e}var PX;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(PX||={});var Tye;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(Tye||={});var FX=PX.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),IX=e=>{switch(typeof e){case`undefined`:return FX.undefined;case`string`:return FX.string;case`number`:return Number.isNaN(e)?FX.nan:FX.number;case`boolean`:return FX.boolean;case`function`:return FX.function;case`bigint`:return FX.bigint;case`symbol`:return FX.symbol;case`object`:return Array.isArray(e)?FX.array:e===null?FX.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?FX.promise:typeof Map<`u`&&e instanceof Map?FX.map:typeof Set<`u`&&e instanceof Set?FX.set:typeof Date<`u`&&e instanceof Date?FX.date:FX.object;default:return FX.unknown}},Z=PX.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),LX=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,PX.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};LX.create=e=>new LX(e);var RX=(e,t)=>{let n;switch(e.code){case Z.invalid_type:n=e.received===FX.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case Z.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,PX.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:n=`Unrecognized key(s) in object: ${PX.joinValues(e.keys,`, `)}`;break;case Z.invalid_union:n=`Invalid input`;break;case Z.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${PX.joinValues(e.options)}`;break;case Z.invalid_enum_value:n=`Invalid enum value. Expected ${PX.joinValues(e.options)}, received '${e.received}'`;break;case Z.invalid_arguments:n=`Invalid function arguments`;break;case Z.invalid_return_type:n=`Invalid function return type`;break;case Z.invalid_date:n=`Invalid date`;break;case Z.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:PX.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case Z.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case Z.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case Z.custom:n=`Invalid input`;break;case Z.invalid_intersection_types:n=`Intersection results could not be merged`;break;case Z.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Z.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,PX.assertNever(e)}return{message:n}},Eye=RX;function zX(){return Eye}var BX=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function Q(e,t){let n=zX(),r=BX({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===RX?void 0:RX].filter(e=>!!e)});e.common.issues.push(r)}var VX=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return HX;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return HX;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},HX=Object.freeze({status:`aborted`}),UX=e=>({status:`dirty`,value:e}),WX=e=>({status:`valid`,value:e}),GX=e=>e.status===`aborted`,KX=e=>e.status===`dirty`,qX=e=>e.status===`valid`,JX=e=>typeof Promise<`u`&&e instanceof Promise,YX;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(YX||={});var XX=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ZX=(e,t)=>{if(qX(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){return this._error||=new LX(e.common.issues),this._error}}};function QX(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var $X=class{get description(){return this._def.description}_getType(e){return IX(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:IX(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new VX,ctx:{common:e.parent.common,data:e.data,parsedType:IX(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(JX(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:IX(e)};return ZX(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:IX(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return qX(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>qX(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:IX(e)},r=this._parse({data:e,path:n.path,parent:n});return ZX(n,await(JX(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:Z.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new jZ({schema:this,typeName:BZ.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return MZ.create(this,this._def)}nullable(){return NZ.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return hZ.create(this)}promise(){return AZ.create(this,this._def)}or(e){return vZ.create([this,e],this._def)}and(e){return xZ.create(this,e,this._def)}transform(e){return new jZ({...QX(this._def),schema:this,typeName:BZ.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new PZ({...QX(this._def),innerType:this,defaultValue:t,typeName:BZ.ZodDefault})}brand(){return new LZ({typeName:BZ.ZodBranded,type:this,...QX(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new FZ({...QX(this._def),innerType:this,catchValue:t,typeName:BZ.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return RZ.create(this,e)}readonly(){return zZ.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Dye=/^c[^\s-]{8,}$/i,Oye=/^[0-9a-z]+$/,kye=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Aye=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,jye=/^[a-z0-9_-]{21}$/i,Mye=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Nye=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Pye=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Fye=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,eZ,Iye=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Lye=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Rye=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,zye=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Bye=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Vye=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,tZ=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,Hye=RegExp(`^${tZ}$`);function nZ(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Uye(e){return RegExp(`^${nZ(e)}$`)}function Wye(e){let t=`${tZ}T${nZ(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Gye(e,t){return!!((t===`v4`||!t)&&Iye.test(e)||(t===`v6`||!t)&&Rye.test(e))}function Kye(e,t){if(!Mye.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function qye(e,t){return!!((t===`v4`||!t)&&Lye.test(e)||(t===`v6`||!t)&&zye.test(e))}var rZ=class e extends $X{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==FX.string){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.string,received:t.parsedType}),HX}let t=new VX,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?Q(n,{code:Z.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&Q(n,{code:Z.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)Pye.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`email`,code:Z.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)eZ||=new RegExp(Fye,`u`),eZ.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`emoji`,code:Z.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)Aye.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`uuid`,code:Z.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)jye.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`nanoid`,code:Z.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)Dye.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`cuid`,code:Z.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)Oye.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`cuid2`,code:Z.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)kye.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`ulid`,code:Z.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),Q(n,{validation:`url`,code:Z.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`regex`,code:Z.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?Wye(r).test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?Hye.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?Uye(r).test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?Nye.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`duration`,code:Z.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?Gye(e.data,r.version)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`ip`,code:Z.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?Kye(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`jwt`,code:Z.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?qye(e.data,r.version)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`cidr`,code:Z.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?Bye.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`base64`,code:Z.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?Vye.test(e.data)||(n=this._getOrReturnCtx(e,n),Q(n,{validation:`base64url`,code:Z.invalid_string,message:r.message}),t.dirty()):PX.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:Z.invalid_string,...YX.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...YX.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...YX.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...YX.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...YX.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...YX.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...YX.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...YX.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...YX.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...YX.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...YX.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...YX.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...YX.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...YX.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...YX.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...YX.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...YX.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...YX.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...YX.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...YX.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...YX.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...YX.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...YX.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...YX.errToObj(t)})}nonempty(e){return this.min(1,YX.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};rZ.create=e=>new rZ({checks:[],typeName:BZ.ZodString,coerce:e?.coerce??!1,...QX(e)});function Jye(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var iZ=class e extends $X{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==FX.number){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.number,received:t.parsedType}),HX}let t,n=new VX;for(let r of this._def.checks)r.kind===`int`?PX.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?Jye(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.not_finite,message:r.message}),n.dirty()):PX.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,YX.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,YX.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,YX.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,YX.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:YX.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:YX.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:YX.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:YX.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:YX.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:YX.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:YX.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:YX.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:YX.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:YX.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&PX.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};iZ.create=e=>new iZ({checks:[],typeName:BZ.ZodNumber,coerce:e?.coerce||!1,...QX(e)});var aZ=class e extends $X{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==FX.bigint)return this._getInvalidInput(e);let t,n=new VX;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),Q(t,{code:Z.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):PX.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.bigint,received:t.parsedType}),HX}gte(e,t){return this.setLimit(`min`,e,!0,YX.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,YX.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,YX.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,YX.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:YX.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:YX.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:YX.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:YX.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:YX.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:YX.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};aZ.create=e=>new aZ({checks:[],typeName:BZ.ZodBigInt,coerce:e?.coerce??!1,...QX(e)});var oZ=class extends $X{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==FX.boolean){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.boolean,received:t.parsedType}),HX}return WX(e.data)}};oZ.create=e=>new oZ({typeName:BZ.ZodBoolean,coerce:e?.coerce||!1,...QX(e)});var sZ=class e extends $X{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==FX.date){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.date,received:t.parsedType}),HX}if(Number.isNaN(e.data.getTime()))return Q(this._getOrReturnCtx(e),{code:Z.invalid_date}),HX;let t=new VX,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),Q(n,{code:Z.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):PX.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:YX.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:YX.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};sZ.create=e=>new sZ({checks:[],coerce:e?.coerce||!1,typeName:BZ.ZodDate,...QX(e)});var cZ=class extends $X{_parse(e){if(this._getType(e)!==FX.symbol){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.symbol,received:t.parsedType}),HX}return WX(e.data)}};cZ.create=e=>new cZ({typeName:BZ.ZodSymbol,...QX(e)});var lZ=class extends $X{_parse(e){if(this._getType(e)!==FX.undefined){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.undefined,received:t.parsedType}),HX}return WX(e.data)}};lZ.create=e=>new lZ({typeName:BZ.ZodUndefined,...QX(e)});var uZ=class extends $X{_parse(e){if(this._getType(e)!==FX.null){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.null,received:t.parsedType}),HX}return WX(e.data)}};uZ.create=e=>new uZ({typeName:BZ.ZodNull,...QX(e)});var dZ=class extends $X{constructor(){super(...arguments),this._any=!0}_parse(e){return WX(e.data)}};dZ.create=e=>new dZ({typeName:BZ.ZodAny,...QX(e)});var fZ=class extends $X{constructor(){super(...arguments),this._unknown=!0}_parse(e){return WX(e.data)}};fZ.create=e=>new fZ({typeName:BZ.ZodUnknown,...QX(e)});var pZ=class extends $X{_parse(e){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.never,received:t.parsedType}),HX}};pZ.create=e=>new pZ({typeName:BZ.ZodNever,...QX(e)});var mZ=class extends $X{_parse(e){if(this._getType(e)!==FX.undefined){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.void,received:t.parsedType}),HX}return WX(e.data)}};mZ.create=e=>new mZ({typeName:BZ.ZodVoid,...QX(e)});var hZ=class e extends $X{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==FX.array)return Q(t,{code:Z.invalid_type,expected:FX.array,received:t.parsedType}),HX;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(Q(t,{code:e?Z.too_big:Z.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(Q(t,{code:Z.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(Q(t,{code:Z.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new XX(t,e,t.path,n)))).then(e=>VX.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new XX(t,e,t.path,n)));return VX.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:YX.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:YX.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:YX.toString(n)}})}nonempty(e){return this.min(1,e)}};hZ.create=(e,t)=>new hZ({type:e,minLength:null,maxLength:null,exactLength:null,typeName:BZ.ZodArray,...QX(t)});function gZ(e){if(e instanceof _Z){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=MZ.create(gZ(r))}return new _Z({...e._def,shape:()=>t})}else if(e instanceof hZ)return new hZ({...e._def,type:gZ(e.element)});else if(e instanceof MZ)return MZ.create(gZ(e.unwrap()));else if(e instanceof NZ)return NZ.create(gZ(e.unwrap()));else if(e instanceof SZ)return SZ.create(e.items.map(e=>gZ(e)));else return e}var _Z=class e extends $X{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape();return this._cached={shape:e,keys:PX.objectKeys(e)},this._cached}_parse(e){if(this._getType(e)!==FX.object){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.object,received:t.parsedType}),HX}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof pZ&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new XX(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof pZ){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(Q(n,{code:Z.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new XX(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>VX.mergeObjectSync(t,e)):VX.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return YX.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:YX.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:BZ.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of PX.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of PX.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return gZ(this)}partial(t){let n={};for(let e of PX.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of PX.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof MZ;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return DZ(PX.objectKeys(this.shape))}};_Z.create=(e,t)=>new _Z({shape:()=>e,unknownKeys:`strip`,catchall:pZ.create(),typeName:BZ.ZodObject,...QX(t)}),_Z.strictCreate=(e,t)=>new _Z({shape:()=>e,unknownKeys:`strict`,catchall:pZ.create(),typeName:BZ.ZodObject,...QX(t)}),_Z.lazycreate=(e,t)=>new _Z({shape:e,unknownKeys:`strip`,catchall:pZ.create(),typeName:BZ.ZodObject,...QX(t)});var vZ=class extends $X{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new LX(e.ctx.common.issues));return Q(t,{code:Z.invalid_union,unionErrors:n}),HX}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new LX(e));return Q(t,{code:Z.invalid_union,unionErrors:i}),HX}}get options(){return this._def.options}};vZ.create=(e,t)=>new vZ({options:e,typeName:BZ.ZodUnion,...QX(t)});var yZ=e=>e instanceof TZ?yZ(e.schema):e instanceof jZ?yZ(e.innerType()):e instanceof EZ?[e.value]:e instanceof OZ?e.options:e instanceof kZ?PX.objectValues(e.enum):e instanceof PZ?yZ(e._def.innerType):e instanceof lZ?[void 0]:e instanceof uZ?[null]:e instanceof MZ?[void 0,...yZ(e.unwrap())]:e instanceof NZ?[null,...yZ(e.unwrap())]:e instanceof LZ||e instanceof zZ?yZ(e.unwrap()):e instanceof FZ?yZ(e._def.innerType):[],Yye=class e extends $X{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==FX.object)return Q(t,{code:Z.invalid_type,expected:FX.object,received:t.parsedType}),HX;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(Q(t,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),HX)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=yZ(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:BZ.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...QX(r)})}};function bZ(e,t){let n=IX(e),r=IX(t);if(e===t)return{valid:!0,data:e};if(n===FX.object&&r===FX.object){let n=PX.objectKeys(t),r=PX.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=bZ(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===FX.array&&r===FX.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=bZ(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===FX.date&&r===FX.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var xZ=class extends $X{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(GX(e)||GX(r))return HX;let i=bZ(e.value,r.value);return i.valid?((KX(e)||KX(r))&&t.dirty(),{status:t.value,value:i.data}):(Q(n,{code:Z.invalid_intersection_types}),HX)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};xZ.create=(e,t,n)=>new xZ({left:e,right:t,typeName:BZ.ZodIntersection,...QX(n)});var SZ=class e extends $X{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==FX.array)return Q(n,{code:Z.invalid_type,expected:FX.array,received:n.parsedType}),HX;if(n.data.length<this._def.items.length)return Q(n,{code:Z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),HX;!this._def.rest&&n.data.length>this._def.items.length&&(Q(n,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new XX(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>VX.mergeArray(t,e)):VX.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};SZ.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new SZ({items:e,typeName:BZ.ZodTuple,rest:null,...QX(t)})};var Xye=class e extends $X{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==FX.object)return Q(n,{code:Z.invalid_type,expected:FX.object,received:n.parsedType}),HX;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new XX(n,e,n.path,e)),value:a._parse(new XX(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?VX.mergeObjectAsync(t,r):VX.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof $X?new e({keyType:t,valueType:n,typeName:BZ.ZodRecord,...QX(r)}):new e({keyType:rZ.create(),valueType:t,typeName:BZ.ZodRecord,...QX(n)})}},CZ=class extends $X{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==FX.map)return Q(n,{code:Z.invalid_type,expected:FX.map,received:n.parsedType}),HX;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new XX(n,e,n.path,[a,`key`])),value:i._parse(new XX(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return HX;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return HX;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};CZ.create=(e,t,n)=>new CZ({valueType:t,keyType:e,typeName:BZ.ZodMap,...QX(n)});var wZ=class e extends $X{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==FX.set)return Q(n,{code:Z.invalid_type,expected:FX.set,received:n.parsedType}),HX;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(Q(n,{code:Z.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(Q(n,{code:Z.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return HX;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new XX(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:YX.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:YX.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};wZ.create=(e,t)=>new wZ({valueType:e,minSize:null,maxSize:null,typeName:BZ.ZodSet,...QX(t)});var Zye=class e extends $X{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==FX.function)return Q(t,{code:Z.invalid_type,expected:FX.function,received:t.parsedType}),HX;function n(e,n){return BX({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,zX(),RX].filter(e=>!!e),issueData:{code:Z.invalid_arguments,argumentsError:n}})}function r(e,n){return BX({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,zX(),RX].filter(e=>!!e),issueData:{code:Z.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof AZ){let e=this;return WX(async function(...t){let o=new LX([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return WX(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new LX([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new LX([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:SZ.create(t).rest(fZ.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||SZ.create([]).rest(fZ.create()),returns:n||fZ.create(),typeName:BZ.ZodFunction,...QX(r)})}},TZ=class extends $X{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};TZ.create=(e,t)=>new TZ({getter:e,typeName:BZ.ZodLazy,...QX(t)});var EZ=class extends $X{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Q(t,{received:t.data,code:Z.invalid_literal,expected:this._def.value}),HX}return{status:`valid`,value:e.data}}get value(){return this._def.value}};EZ.create=(e,t)=>new EZ({value:e,typeName:BZ.ZodLiteral,...QX(t)});function DZ(e,t){return new OZ({values:e,typeName:BZ.ZodEnum,...QX(t)})}var OZ=class e extends $X{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return Q(t,{expected:PX.joinValues(n),received:t.parsedType,code:Z.invalid_type}),HX}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return Q(t,{received:t.data,code:Z.invalid_enum_value,options:n}),HX}return WX(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};OZ.create=DZ;var kZ=class extends $X{_parse(e){let t=PX.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==FX.string&&n.parsedType!==FX.number){let e=PX.objectValues(t);return Q(n,{expected:PX.joinValues(e),received:n.parsedType,code:Z.invalid_type}),HX}if(this._cache||=new Set(PX.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=PX.objectValues(t);return Q(n,{received:n.data,code:Z.invalid_enum_value,options:e}),HX}return WX(e.data)}get enum(){return this._def.values}};kZ.create=(e,t)=>new kZ({values:e,typeName:BZ.ZodNativeEnum,...QX(t)});var AZ=class extends $X{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==FX.promise&&t.common.async===!1?(Q(t,{code:Z.invalid_type,expected:FX.promise,received:t.parsedType}),HX):WX((t.parsedType===FX.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};AZ.create=(e,t)=>new AZ({type:e,typeName:BZ.ZodPromise,...QX(t)});var jZ=class extends $X{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===BZ.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{Q(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return HX;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?HX:r.status===`dirty`||t.value===`dirty`?UX(r.value):r});{if(t.value===`aborted`)return HX;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?HX:r.status===`dirty`||t.value===`dirty`?UX(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?HX:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?HX:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!qX(e))return HX;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>qX(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):HX);PX.assertNever(r)}};jZ.create=(e,t,n)=>new jZ({schema:e,typeName:BZ.ZodEffects,effect:t,...QX(n)}),jZ.createWithPreprocess=(e,t,n)=>new jZ({schema:t,effect:{type:`preprocess`,transform:e},typeName:BZ.ZodEffects,...QX(n)});var MZ=class extends $X{_parse(e){return this._getType(e)===FX.undefined?WX(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};MZ.create=(e,t)=>new MZ({innerType:e,typeName:BZ.ZodOptional,...QX(t)});var NZ=class extends $X{_parse(e){return this._getType(e)===FX.null?WX(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};NZ.create=(e,t)=>new NZ({innerType:e,typeName:BZ.ZodNullable,...QX(t)});var PZ=class extends $X{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===FX.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};PZ.create=(e,t)=>new PZ({innerType:e,typeName:BZ.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...QX(t)});var FZ=class extends $X{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return JX(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new LX(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new LX(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};FZ.create=(e,t)=>new FZ({innerType:e,typeName:BZ.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...QX(t)});var IZ=class extends $X{_parse(e){if(this._getType(e)!==FX.nan){let t=this._getOrReturnCtx(e);return Q(t,{code:Z.invalid_type,expected:FX.nan,received:t.parsedType}),HX}return{status:`valid`,value:e.data}}};IZ.create=e=>new IZ({typeName:BZ.ZodNaN,...QX(e)});var LZ=class extends $X{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},RZ=class e extends $X{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?HX:e.status===`dirty`?(t.dirty(),UX(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?HX:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:BZ.ZodPipeline})}},zZ=class extends $X{_parse(e){let t=this._def.innerType._parse(e),n=e=>(qX(e)&&(e.value=Object.freeze(e.value)),e);return JX(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};zZ.create=(e,t)=>new zZ({innerType:e,typeName:BZ.ZodReadonly,...QX(t)}),_Z.lazycreate;var BZ;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(BZ||={});var VZ=rZ.create,HZ=iZ.create;IZ.create,aZ.create;var Qye=oZ.create;sZ.create,cZ.create,lZ.create,uZ.create,dZ.create,fZ.create,pZ.create,mZ.create;var UZ=hZ.create,WZ=_Z.create;_Z.strictCreate;var $ye=vZ.create,GZ=Yye.create;xZ.create,SZ.create;var ebe=Xye.create;CZ.create,wZ.create,Zye.create,TZ.create;var KZ=EZ.create,qZ=OZ.create;kZ.create,AZ.create,jZ.create,MZ.create,NZ.create,jZ.createWithPreprocess,RZ.create;var JZ=HZ().int().positive(),YZ=qZ([`windows`,`macos`,`common`]),XZ=$ye([VZ(),ebe(VZ())]),tbe=WZ({id:VZ().min(1),title:VZ(),command:VZ(),args:UZ(VZ()),platform:YZ,isExited:Qye(),exitCode:HZ().int().nullable(),closeTip:VZ().optional(),closeCallbackUrl:XZ.optional()});GZ(`type`,[WZ({type:KZ(`create`),requestId:VZ().min(1),cols:JZ.optional(),rows:JZ.optional(),command:VZ().min(1).optional(),args:UZ(VZ()).optional(),closeTip:VZ().optional(),closeCallbackUrl:XZ.optional()}),WZ({type:KZ(`input`),sessionId:VZ().min(1),data:VZ()}),WZ({type:KZ(`resize`),sessionId:VZ().min(1),cols:JZ,rows:JZ}),WZ({type:KZ(`close`),sessionId:VZ().min(1)}),WZ({type:KZ(`attach`),sessionId:VZ().min(1),cols:JZ.optional(),rows:JZ.optional()}),WZ({type:KZ(`list`)})]);var nbe=WZ({type:KZ(`created`),requestId:VZ().min(1),sessionId:VZ().min(1),platform:YZ}),rbe=WZ({type:KZ(`output`),sessionId:VZ().min(1),data:VZ()}),ibe=WZ({type:KZ(`exit`),sessionId:VZ().min(1),exitCode:HZ().int()}),abe=WZ({type:KZ(`title`),sessionId:VZ().min(1),title:VZ()}),obe=WZ({type:KZ(`buffer`),sessionId:VZ().min(1),data:VZ()}),sbe=WZ({type:KZ(`list`),sessions:UZ(tbe)}),cbe=qZ([`INVALID_JSON`,`INVALID_MESSAGE`,`SESSION_NOT_FOUND`,`PTY_CREATE_FAILED`]),lbe=GZ(`type`,[nbe,rbe,ibe,abe,obe,sbe,WZ({type:KZ(`error`),code:cbe,message:VZ().min(1),sessionId:VZ().min(1).optional()})]),ube=2,dbe=1;function fbe(e){return e?.ownerDocument?.defaultView?e.ownerDocument.defaultView:window}function ZZ(e){return fbe(e).getComputedStyle(e,null)}var pbe=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows)||(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&this._terminal.resize(e.cols,e.rows)}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal.dimensions;if(!e||e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollbar?.showScrollbar??!0,n=this._terminal.options.scrollback===0||!t?0:this._terminal.options.scrollbar?.width??14,r=ZZ(this._terminal.element.parentElement),i=parseInt(r.getPropertyValue(`height`)),a=Math.max(0,parseInt(r.getPropertyValue(`width`))),o=ZZ(this._terminal.element),s={top:parseInt(o.getPropertyValue(`padding-top`)),bottom:parseInt(o.getPropertyValue(`padding-bottom`)),right:parseInt(o.getPropertyValue(`padding-right`)),left:parseInt(o.getPropertyValue(`padding-left`))},c=s.top+s.bottom,l=s.right+s.left,u=i-c,d=a-l-n;return{cols:Math.max(ube,Math.floor(d/e.css.cell.width)),rows:Math.max(dbe,Math.floor(u/e.css.cell.height))}}},mbe=class{constructor(e,t,n,r={}){this._terminal=e,this._regex=t,this._handler=n,this._options=r}provideLinks(e,t){let n=gbe.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map(e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){let{range:r}=e;this._options.hover(t,n,r)}},e))}};function hbe(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var gbe=class e{static computeLink(t,n,r,i){let a=new RegExp(n.source,(n.flags||``)+`g`),[o,s]=e._getWindowedLineStrings(t-1,r),c=o.join(``),l,u=[];for(;l=a.exec(c);){let t=l[0];if(!hbe(t))continue;let[n,a]=e._mapStrIdx(r,s,0,l.index),[o,c]=e._mapStrIdx(r,n,a,t.length);if(n===-1||a===-1||o===-1||c===-1)continue;let d={start:{x:a+1,y:n+1},end:{x:c,y:o+1}};u.push({range:d,text:t,activate:i})}return u}static _getWindowedLineStrings(e,t){let n,r=e,i=e,a=0,o=``,s=[];if(n=t.buffer.active.getLine(e)){let e=n.translateToString(!0);if(n.isWrapped&&e[0]!==` `){for(a=0;(n=t.buffer.active.getLine(--r))&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),!(!n.isWrapped||o.indexOf(` `)!==-1)););s.reverse()}for(s.push(e),a=0;(n=t.buffer.active.getLine(++i))&&n.isWrapped&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),o.indexOf(` `)===-1););}return[s,r]}static _mapStrIdx(e,t,n,r){let i=e.buffer.active,a=i.getNullCell(),o=n;for(;r;){let e=i.getLine(t);if(!e)return[-1,-1];for(let n=o;n<e.length;++n){e.getCell(n,a);let o=a.getChars();if(a.getWidth()&&(r-=o.length||1,n===e.length-1&&o===``)){let e=i.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,a),a.getWidth()===2&&(r+=1))}if(r<0)return[t,n]}t++,o=0}return[t,o]}},_be=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function vbe(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}var ybe=class{constructor(e=vbe,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,n=t.urlRegex??_be;this._linkProvider=this._terminal.registerLinkProvider(new mbe(this._terminal,n,this._handler,t))}dispose(){this._linkProvider?.dispose()}},QZ=Object.defineProperty,bbe=Object.getOwnPropertyDescriptor,xbe=(e,t)=>{for(var n in t)QZ(e,n,{get:t[n],enumerable:!0})},$Z=(e,t,n,r)=>{for(var i=r>1?void 0:r?bbe(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&QZ(t,n,i),i},$=(e,t)=>(n,r)=>t(n,r,e),eQ=`Terminal input`,tQ={get:()=>eQ,set:e=>eQ=e},nQ=`Too much output to announce, navigate to rows manually to read`,rQ={get:()=>nQ,set:e=>nQ=e};function Sbe(e){return e.replace(/\r?\n/g,`\r`)}function Cbe(e,t){return t?`\x1B[200~${e.replace(/\x1b/g,`␛`)}\x1B[201~`:e}function wbe(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function Tbe(e,t,n,r){e.stopPropagation(),e.clipboardData&&iQ(e.clipboardData.getData(`text/plain`),t,n,r)}function iQ(e,t,n,r){e=Sbe(e),e=Cbe(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function aQ(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function oQ(e,t,n,r,i){aQ(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function sQ(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function cQ(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var Ebe=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},Dbe=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}else this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},lQ=class e{constructor(){this.fg=0,this.bg=0,this.extended=new uQ}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return(this.fg&50331648)==0}isBgDefault(){return(this.bg&50331648)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},uQ=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},dQ=class e extends lQ{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new uQ,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?sQ(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}attributesEquals(e){if(this.getFgColorMode()!==e.getFgColorMode()||this.getFgColor()!==e.getFgColor()||this.getBgColorMode()!==e.getBgColorMode()||this.getBgColor()!==e.getBgColor()||this.isInverse()!==e.isInverse()||this.isBold()!==e.isBold()||this.isUnderline()!==e.isUnderline())return!1;if(this.isUnderline()){if(this.getUnderlineStyle()!==e.getUnderlineStyle())return!1;let t=this.isUnderlineColorDefault(),n=e.isUnderlineColorDefault();if(!(t&&n)&&(t!==n||this.getUnderlineColor()!==e.getUnderlineColor()||this.getUnderlineColorMode()!==e.getUnderlineColorMode()))return!1}return!(this.isOverline()!==e.isOverline()||this.isBlink()!==e.isBlink()||this.isInvisible()!==e.isInvisible()||this.isItalic()!==e.isItalic()||this.isDim()!==e.isDim()||this.isStrikethrough()!==e.isStrikethrough())}},fQ=`di$target`,pQ=`di$dependencies`,mQ=new Map;function Obe(e){return e[pQ]||[]}function hQ(e){if(mQ.has(e))return mQ.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);kbe(t,e,r)};return t._id=e,mQ.set(e,t),t}function kbe(e,t,n){t[fQ]===t?t[pQ].push({id:e,index:n}):(t[pQ]=[{id:e,index:n}],t[fQ]=t)}var gQ=hQ(`BufferService`),_Q=hQ(`CoreMouseService`),vQ=hQ(`CoreService`),Abe=hQ(`CharsetService`),yQ=hQ(`InstantiationService`),bQ=hQ(`LogService`),xQ=hQ(`OptionsService`),SQ=hQ(`OscLinkService`),jbe=hQ(`UnicodeService`),CQ=hQ(`DecorationService`),wQ=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n,this._workCell=new dQ}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=this._workCell,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(!(c===-1&&!n.hasContent(t))){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId)if(c===-1){c=t,s=a.extended.urlId;continue}else l=a.extended.urlId!==s;else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+(!l&&t===o-1?1:0),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):Mbe(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};wQ=$Z([$(0,gQ),$(1,xQ),$(2,SQ)],wQ);function Mbe(e,t){if(confirm(`Do you want to navigate to ${t}?
447
447
 
448
448
  WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var TQ=hQ(`CharSizeService`),EQ=hQ(`CoreBrowserService`),DQ=hQ(`MouseService`),OQ=hQ(`RenderService`),Nbe=hQ(`SelectionService`),kQ=hQ(`CharacterJoinerService`),AQ=hQ(`ThemeService`),jQ=hQ(`LinkProviderService`),Pbe=hQ(`KeyboardService`);function MQ(e){return{dispose:e}}function NQ(e){if(!e)return e;if(Array.isArray(e)){for(let t of e)t.dispose();return[]}return e.dispose(),e}var PQ=class{constructor(){this._disposables=new Set,this._isDisposed=!1}get isDisposed(){return this._isDisposed}add(e){return this._isDisposed?e.dispose():this._disposables.add(e),e}dispose(){if(!this._isDisposed){this._isDisposed=!0;for(let e of this._disposables)e.dispose();this._disposables.clear()}}clear(){for(let e of this._disposables)e.dispose();this._disposables.clear()}},FQ=class{constructor(){this._store=new PQ}dispose(){this._store.dispose()}_register(e){return this._store.add(e)}};FQ.None=Object.freeze({dispose(){}});var IQ=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},LQ=class{constructor(){this._token=-1,this._isDisposed=!1}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw Error(`Calling cancelAndSet on a disposed TimeoutTimer`);this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw Error(`Calling setIfNotSet on a disposed TimeoutTimer`);this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},Fbe=class{constructor(){this._isDisposed=!1}cancel(){this._disposable?.dispose(),this._disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this._isDisposed)throw Error(`Calling cancelAndSet on a disposed IntervalTimer`);this.cancel();let r=n.setInterval(()=>{e()},t);this._disposable={dispose:()=>{n.clearInterval(r),this._disposable=void 0}}}dispose(){this.cancel(),this._isDisposed=!0}};function RQ(e){let t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView;let n=e;return n?.view?n.view:window}var Ibe=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r,e.addEventListener(t,n,r)}dispose(){!this._node||!this._handler||(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function zQ(e,t,n,r){return new Ibe(e,t,n,r)}function BQ(e,t,n,r){return zQ(e,t,n,r)}var VQ={CLICK:`click`,MOUSE_DOWN:`mousedown`,MOUSE_OVER:`mouseover`,MOUSE_LEAVE:`mouseleave`,KEY_DOWN:`keydown`,KEY_UP:`keyup`,INPUT:`input`,BLUR:`blur`,FOCUS:`focus`,CHANGE:`change`,POINTER_DOWN:`pointerdown`,POINTER_MOVE:`pointermove`,POINTER_UP:`pointerup`,MOUSE_WHEEL:`wheel`,WHEEL:`wheel`};function Lbe(e){let t=e.getBoundingClientRect(),n=RQ(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}var HQ=class{constructor(e,t){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){console.error(e)}}static sort(e,t){return t.priority-e.priority}},UQ=new Map;function WQ(e){let t=UQ.get(e);return t||(t={next:[],current:[],animFrameRequested:!1,inAnimationFrameRunner:!1},UQ.set(e,t)),t}function Rbe(e){let t=WQ(e);for(t.animFrameRequested=!1,t.current=t.next,t.next=[],t.inAnimationFrameRunner=!0;t.current.length>0;)t.current.sort(HQ.sort),t.current.shift().execute();t.inAnimationFrameRunner=!1}function GQ(e,t,n=0){let r=WQ(e),i=new HQ(t,n);return r.next.push(i),r.animFrameRequested||(r.animFrameRequested=!0,e.requestAnimationFrame(()=>Rbe(e))),i}var zbe=class extends Fbe{constructor(e){super(),this._defaultTarget=e?RQ(e):void 0}cancelAndSet(e,t,n){super.cancelAndSet(e,t,n??this._defaultTarget??window)}},KQ=class{constructor(e){this.domNode=e,this._width=``,this._height=``,this._top=``,this._left=``,this._bottom=``,this._right=``,this._className=``,this._position=``,this._layerHint=!1,this._contain=`none`}setWidth(e){let t=qQ(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=qQ(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=qQ(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=qQ(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=qQ(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=qQ(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,e?this.domNode.style.transform=`translate3d(0px, 0px, 0px)`:this.domNode.style.transform=``)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}};function qQ(e){return typeof e==`number`?`${e}px`:e}var JQ={};xbe(JQ,{getSafariVersion:()=>Vbe,getZoomFactor:()=>t$,isChrome:()=>$Q,isChromeOS:()=>a$,isFirefox:()=>QQ,isLegacyEdge:()=>Bbe,isLinux:()=>i$,isMac:()=>n$,isNode:()=>YQ,isSafari:()=>e$,isWindows:()=>r$});var YQ=!!(typeof process<`u`&&`title`in process&&(typeof navigator>`u`||navigator.userAgent.startsWith(`Node.js/`))),XQ=YQ?`node`:navigator.userAgent,ZQ=YQ?`node`:navigator.platform,QQ=XQ.includes(`Firefox`),$Q=XQ.includes(`Chrome`),Bbe=XQ.includes(`Edge`),e$=/^((?!chrome|android).)*safari/i.test(XQ);function t$(e){return 1}function Vbe(){if(!e$)return 0;let e=XQ.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var n$=[`Macintosh`,`MacIntel`,`MacPPC`,`Mac68K`].includes(ZQ),r$=[`Windows`,`Win16`,`Win32`,`WinCE`].includes(ZQ),i$=ZQ.indexOf(`Linux`)>=0,a$=/\bCrOS\b/.test(XQ),o$=new WeakMap;function Hbe(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,n=e.parent.location;if(t.origin!==`null`&&n.origin!==`null`&&t.origin!==n.origin)return null}catch{return null}return e.parent}var Ube=class{static _getSameOriginWindowChain(e){let t=o$.get(e);if(!t){t=[],o$.set(e,t);let n=e,r;do r=Hbe(n),r?t.push({window:new WeakRef(n),iframeElement:n.frameElement??null}):t.push({window:new WeakRef(n),iframeElement:null}),n=r;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,r=0,i=this._getSameOriginWindowChain(e);for(let e of i){let i=e.window.deref();if(n+=i?.scrollY??0,r+=i?.scrollX??0,i===t||!e.iframeElement)break;let a=e.iframeElement.getBoundingClientRect();n+=a.top,r+=a.left}return{top:n,left:r}}},s$=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail??1,t.type===`dblclick`&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX==`number`?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=Ube.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},c$=class{constructor(e,t=0,n=0){this.browserEvent=e??null,this.target=e?e.target??e.targetNode??e.srcElement??null:null,this.deltaY=n,this.deltaX=t;let r=!1;if($Q){let e=navigator.userAgent.match(/Chrome\/(\d+)/);r=(e?parseInt(e[1]):123)<=122}if(e){let t=e,n=e,i=e.view?.devicePixelRatio??1;if(typeof t.wheelDeltaY<`u`)r?this.deltaY=t.wheelDeltaY/(120*i):this.deltaY=t.wheelDeltaY/120;else if(typeof n.VERTICAL_AXIS<`u`&&n.axis===n.VERTICAL_AXIS)this.deltaY=-n.detail/3;else if(e.type===`wheel`){let t=e;t.deltaMode===t.DOM_DELTA_LINE?QQ&&!n$?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof t.wheelDeltaX<`u`)e$&&r$?this.deltaX=-(t.wheelDeltaX/120):r?this.deltaX=t.wheelDeltaX/(120*i):this.deltaX=t.wheelDeltaX/120;else if(typeof n.HORIZONTAL_AXIS<`u`&&n.axis===n.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type===`wheel`){let t=e;t.deltaMode===t.DOM_DELTA_LINE?QQ&&!n$?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(r?this.deltaY=e.wheelDelta/(120*i):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},l$=class{constructor(){this._hooks=new PQ,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let t=this._onStopCallback;this._onStopCallback=null,e&&t&&t()}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,i){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=i;let a=e;try{e.setPointerCapture(t),this._hooks.add(MQ(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{a=RQ(e)}this._hooks.add(zQ(a,VQ.POINTER_MOVE,e=>{if(e.buttons!==n){this.stopMonitoring(!0);return}e.preventDefault(),this._pointerMoveCallback(e)})),this._hooks.add(zQ(a,VQ.POINTER_UP,e=>this.stopMonitoring(!0)))}},u$=class extends FQ{_onclick(e,t){this._register(zQ(e,VQ.CLICK,n=>t(new s$(RQ(e),n))))}_onmouseover(e,t){this._register(zQ(e,VQ.MOUSE_OVER,n=>t(new s$(RQ(e),n))))}_onmouseleave(e,t){this._register(zQ(e,VQ.MOUSE_LEAVE,n=>t(new s$(RQ(e),n))))}},Wbe=class extends u${constructor(e){super(),this._handleActivate=e.handleActivate,this.bgDomNode=document.createElement(`div`),this.bgDomNode.className=`xterm-arrow-background`,this.bgDomNode.style.position=`absolute`,this.bgDomNode.style.width=e.bgWidth+`px`,this.bgDomNode.style.height=e.bgHeight+`px`,typeof e.top<`u`&&(this.bgDomNode.style.top=`0px`),typeof e.left<`u`&&(this.bgDomNode.style.left=`0px`),typeof e.bottom<`u`&&(this.bgDomNode.style.bottom=`0px`),typeof e.right<`u`&&(this.bgDomNode.style.right=`0px`),this.domNode=document.createElement(`div`),this.domNode.className=e.className,this.domNode.style.position=`absolute`;let t=Math.min(e.bgWidth,e.bgHeight);this.domNode.style.width=t+`px`,this.domNode.style.height=t+`px`,typeof e.top<`u`&&(this.domNode.style.top=e.top+`px`),typeof e.left<`u`&&(this.domNode.style.left=e.left+`px`),typeof e.bottom<`u`&&(this.domNode.style.bottom=e.bottom+`px`),typeof e.right<`u`&&(this.domNode.style.right=e.right+`px`),this._pointerMoveMonitor=this._register(new l$),this._register(BQ(this.bgDomNode,VQ.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(BQ(this.domNode,VQ.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new zbe),this._pointerdownScheduleRepeatTimer=this._register(new LQ)}_arrowPointerDown(e){!e.target||!(e.target instanceof Element)||(this._handleActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._handleActivate(),1e3/24,RQ(e))},200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault())}},d$=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||=(e,t,n)=>{if(this._disposed)return MQ(()=>{});let r={fn:e,thisArgs:t};this._listeners.push(r);let i=MQ(()=>{let e=this._listeners.indexOf(r);e!==-1&&this._listeners.splice(e,1)});return n&&(Array.isArray(n)?n.push(i):n.add(i)),i},this._event}fire(e){if(!this._disposed)switch(this._listeners.length){case 0:return;case 1:{let{fn:t,thisArgs:n}=this._listeners[0];t.call(n,e);return}default:{let t=this._listeners.slice();for(let{fn:n,thisArgs:r}of t)n.call(r,e)}}}dispose(){this._disposed||(this._disposed=!0,this._listeners.length=0)}},f$;(e=>{function t(e,t){return e(e=>t.fire(e))}e.forward=t;function n(e,t){return(n,r,i)=>e(e=>n.call(r,t(e)),void 0,i)}e.map=n;function r(...e){return(t,n,r)=>{let i=new PQ;for(let r of e)i.add(r(e=>t.call(n,e)));return r&&(Array.isArray(r)?r.push(i):r.add(i)),i}}e.any=r;function i(e,t,n){return t(n),e(e=>t(e))}e.runAndSubscribe=i})(f$||={});var Gbe=class e{constructor(e,t,n,r,i,a,o){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,n|=0,r|=0,i|=0,a|=0,o|=0),this.rawScrollLeft=r,this.rawScrollTop=o,t<0&&(t=0),r+t>n&&(r=n-t),r<0&&(r=0),i<0&&(i=0),o+i>a&&(o=a-i),o<0&&(o=0),this.width=t,this.scrollWidth=n,this.scrollLeft=r,this.height=i,this.scrollHeight=a,this.scrollTop=o}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(t,n){return new e(this._forceIntegerValues,typeof t.width<`u`?t.width:this.width,typeof t.scrollWidth<`u`?t.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof t.height<`u`?t.height:this.height,typeof t.scrollHeight<`u`?t.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new e(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<`u`?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<`u`?t.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){let n=this.width!==e.width,r=this.scrollWidth!==e.scrollWidth,i=this.scrollLeft!==e.scrollLeft,a=this.height!==e.height,o=this.scrollHeight!==e.scrollHeight,s=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:r,scrollLeftChanged:i,heightChanged:a,scrollHeightChanged:o,scrollTopChanged:s}}},p$=class extends FQ{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new d$),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new Gbe(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0){this.setScrollPositionNow(e);return}if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>`u`?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>`u`?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;r=t?new g$(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):g$.start(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let t=this._state.withScrollPosition(e);this._smoothScrolling=g$.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},m$=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function h$(e,t){let n=t-e;return function(t){return e+n*Jbe(t)}}function Kbe(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var g$=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.duration=r,this.startTime=n,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this._scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this._scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,n){if(Math.abs(e-t)>2.5*n){let r,i;return e<t?(r=e+.75*n,i=t-.75*n):(r=e-.75*n,i=t+.75*n),Kbe(h$(e,r),h$(i,t),.33)}return h$(e,t)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){let t=(e-this.startTime)/this.duration;return t<1?new m$(this._scrollLeft(t),this._scrollTop(t),!1):new m$(this.to.scrollLeft,this.to.scrollTop,!0)}static start(t,n,r){return r+=10,new e(t,n,Date.now()-10,r)}};function qbe(e){return e**3}function Jbe(e){return 1-qbe(1-e)}var Ybe=class extends FQ{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new LQ)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?` xterm-fade`:``)))}},Xbe=140,_$=class extends u${constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new Ybe(e.visibility,`xterm-visible xterm-scrollbar `+e.extraScrollbarClassName,`xterm-invisible xterm-scrollbar `+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new l$),this._shouldRender=!0,this.domNode=new KQ(document.createElement(`div`)),this.domNode.setAttribute(`role`,`presentation`),this.domNode.setAttribute(`aria-hidden`,`true`),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition(`absolute`),this._register(zQ(this.domNode.domNode,VQ.POINTER_DOWN,e=>this._domNodePointerDown(e)))}_createArrow(e){let t=this._register(new Wbe(e));return this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode),t}_createSlider(e,t,n,r){this.slider=new KQ(document.createElement(`div`)),this.slider.setClassName(`xterm-slider`),this.slider.setPosition(`absolute`),this.slider.setTop(e),this.slider.setLeft(t),typeof n==`number`&&this.slider.setWidth(n),typeof r==`number`&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain(`strict`),this.domNode.domNode.appendChild(this.slider.domNode),this._register(zQ(this.slider.domNode,VQ.POINTER_DOWN,e=>{e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))})),this._onclick(this.slider.domNode,e=>{e.leftButton&&e.stopPropagation()})}_handleElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_handleElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_handleElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._handlePointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),i=this._sliderPointerPosition(e);n<=i&&i<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._handlePointerDown(e)}_handlePointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX==`number`&&typeof e.offsetY==`number`)t=e.offsetX,n=e.offsetY;else{let r=Lbe(this.domNode.domNode);t=e.pageX-r.left,n=e.pageY-r.top}let r=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName(`xterm-active`,!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{let i=this._sliderOrthogonalPointerPosition(e),a=Math.abs(i-n);if(r$&&a>Xbe){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let o=this._sliderPointerPosition(e)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(o))},()=>{this.slider.toggleClassName(`xterm-active`,!1),this._host.handleDragEnd()}),this._host.handleDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},v$=class e{constructor(e,t,n,r,i,a){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=r,this._scrollSize=i,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new e(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let t=Math.round(e);return this._visibleSize===t?!1:(this._visibleSize=t,this._refreshComputedValues(),!0)}setScrollSize(e){let t=Math.round(e);return this._scrollSize===t?!1:(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){let t=Math.round(e);return this._scrollPosition===t?!1:(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setArrowSize(e){let t=Math.round(e);this._arrowSize!==t&&(this._arrowSize=t,this._refreshComputedValues())}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,n,r,i){let a=Math.max(0,n-e),o=Math.max(0,a-2*t),s=r>0&&r>n;if(!s)return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(o),computedSliderRatio:0,computedSliderPosition:0};let c=Math.round(Math.max(20,Math.floor(n*o/r))),l=(o-c)/(r-n),u=i*l;return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(c),computedSliderRatio:l,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){let t=e._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize,n=this._scrollPosition;return t<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;let t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}},Zbe=class extends _${constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new v$(t.horizontalHasArrows?t.horizontalScrollbarSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,i.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:`xterm-horizontal`,scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw Error(`horizontalHasArrows is not supported in xterm.js`);this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}handleScroll(e){return this._shouldRender=this._handleElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._handleElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._handleElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},Qbe=class extends _${constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition(),a=t.verticalHasArrows;super({lazyRender:t.lazyRender,host:n,scrollbarState:new v$(a?t.verticalScrollbarSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,i.scrollTop),visibility:t.vertical,extraScrollbarClassName:`xterm-vertical`,scrollable:e,scrollByPage:t.scrollByPage}),this._arrowScrollDelta=0,this._setArrows(a,t.verticalScrollbarSize),this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}handleScroll(e){return this._shouldRender=this._handleElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._handleElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._handleElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}_arrowScroll(e){let t=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollTop:t.scrollTop+e})}_setArrows(e,t){if(this._arrowScrollDelta=t,(!this._arrowUp||!this._arrowDown)&&(this._arrowUp=this._createArrow({className:`xterm-scra xterm-arrow-up`,top:0,left:0,bgWidth:t,bgHeight:t,handleActivate:()=>this._arrowScroll(-this._arrowScrollDelta)}),this._arrowDown=this._createArrow({className:`xterm-scra xterm-arrow-down`,bottom:0,left:0,bgWidth:t,bgHeight:t,handleActivate:()=>this._arrowScroll(this._arrowScrollDelta)})),this._updateArrowSize(this._arrowUp,t),this._updateArrowSize(this._arrowDown,t),!this._arrowUp||!this._arrowDown)return;let n=e?``:`none`;this._arrowUp.bgDomNode.style.display=n,this._arrowUp.domNode.style.display=n,this._arrowDown.bgDomNode.style.display=n,this._arrowDown.domNode.style.display=n}_updateArrowSize(e,t){e&&(e.bgDomNode.style.width=`${t}px`,e.bgDomNode.style.height=`${t}px`,e.domNode.style.width=`${t}px`,e.domNode.style.height=`${t}px`)}updateOptions(e){let t=e.verticalHasArrows?e.verticalScrollbarSize:0;this._scrollbarState.setArrowSize(t),this._setArrows(e.verticalHasArrows,e.verticalScrollbarSize),this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},$be=500,y$=50,exe=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},b$=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,t=0,n=1,r=this._rear;for(;r!==-1;){let i=r===this._front?e:2**-n;if(e-=i,t+=this._memory[r].score*i,r===this._front)break;r=(this._capacity+r-1)%this._capacity,n++}return t<=.5}acceptStandardWheelEvent(e){if($Q){let t=t$(RQ(e.browserEvent));this.accept(Date.now(),e.deltaX*t,e.deltaY*t)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,n){let r=null,i=new exe(e,t,n);this._front===-1&&this._rear===-1?(this._memory[0]=i,this._front=0,this._rear=0):(r=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=i),i.score=this._computeScore(i,r)}_computeScore(e,t){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(n+=.25),t){let r=Math.abs(e.deltaX),i=Math.abs(e.deltaY),a=Math.abs(t.deltaX),o=Math.abs(t.deltaY),s=Math.max(Math.min(r,a),1),c=Math.max(Math.min(i,o),1),l=Math.max(r,a),u=Math.max(i,o);l%s===0&&u%c===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};b$.INSTANCE=new b$;var txe=b$,nxe=class extends u${constructor(e,t,n){super(),this._onScroll=this._register(new d$),this.onScroll=this._onScroll.event,t??={};let r,i=!n;n?r=n:(t.mouseWheelSmoothScroll=!1,r=new p$({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:t=>GQ(RQ(e),t)})),this._options=rxe(t),this._scrollable=r,this._register(this._scrollable.onScroll(e=>{this._handleScroll(e),this._onScroll.fire(e)})),i&&this._register(this._scrollable);let a={handleMouseWheel:e=>this._handleMouseWheel(e),handleDragStart:()=>this._handleDragStart(),handleDragEnd:()=>this._handleDragEnd()};this._verticalScrollbar=this._register(new Qbe(this._scrollable,this._options,a)),this._horizontalScrollbar=this._register(new Zbe(this._scrollable,this._options,a)),this._domNode=document.createElement(`div`),this._domNode.className=`xterm-scrollable-element `+this._options.className,this._domNode.setAttribute(`role`,`presentation`),this._domNode.style.position=`relative`,this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=new KQ(document.createElement(`div`)),this._leftShadowDomNode.setClassName(`xterm-shadow`),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=new KQ(document.createElement(`div`)),this._topShadowDomNode.setClassName(`xterm-shadow`),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=new KQ(document.createElement(`div`)),this._topLeftShadowDomNode.setClassName(`xterm-shadow`),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode??this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this._onmouseover(this._listenOnDomNode,e=>this._handleMouseOver(e)),this._onmouseleave(this._listenOnDomNode,e=>this._handleMouseLeave(e)),this._hideTimeout=this._register(new LQ),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=NQ(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}updateClassName(e){this._options.className=e,n$&&(this._options.className+=` xterm-mac`),this._domNode.className=`xterm-scrollable-element `+this._options.className}updateOptions(e){typeof e.handleMouseWheel<`u`&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<`u`&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<`u`&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<`u`&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<`u`&&(this._options.horizontal=e.horizontal),typeof e.vertical<`u`&&(this._options.vertical=e.vertical),typeof e.horizontalHasArrows<`u`&&(this._options.horizontalHasArrows=e.horizontalHasArrows),typeof e.verticalHasArrows<`u`&&(this._options.verticalHasArrows=e.verticalHasArrows),typeof e.horizontalScrollbarSize<`u`&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<`u`&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<`u`&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._handleMouseWheel(new c$(e))}_setListeningToMouseWheel(e){this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=NQ(this._mouseWheelToDispose),e)&&this._mouseWheelToDispose.push(zQ(this._listenOnDomNode,VQ.MOUSE_WHEEL,e=>{this._handleMouseWheel(new c$(e))},{passive:!1}))}_handleMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=txe.INSTANCE;t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,i=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&i+r===0?i=r=0:Math.abs(r)>=Math.abs(i)?i=0:r=0),this._options.flipAxes&&([r,i]=[i,r]);let a=!n$&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!i&&(i=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(i*=this._options.fastScrollSensitivity,r*=this._options.fastScrollSensitivity);let o=this._scrollable.getFutureScrollPosition(),s={};if(r){let e=y$*r,t=o.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(s,t)}if(i){let e=y$*i,t=o.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(s,t)}s=this._scrollable.validateScrollPosition(s),(o.scrollLeft!==s.scrollLeft||o.scrollTop!==s.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(s):this._scrollable.setScrollPositionNow(s),n=!0)}let r=n;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(e.preventDefault(),e.stopPropagation())}_handleScroll(e){this._shouldRender=this._horizontalScrollbar.handleScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.handleScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?` xterm-shadow-left`:``,i=t?` xterm-shadow-top`:``,a=n||t?` xterm-shadow-top-left-corner`:``;this._leftShadowDomNode.setClassName(`xterm-shadow${r}`),this._topShadowDomNode.setClassName(`xterm-shadow${i}`),this._topLeftShadowDomNode.setClassName(`xterm-shadow${a}${i}${r}`)}}_handleDragStart(){this._isDragging=!0,this._reveal()}_handleDragEnd(){this._isDragging=!1,this._hide()}_handleMouseLeave(e){this._mouseIsOver=!1,this._hide()}_handleMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),$be)}};function rxe(e){let t={lazyRender:typeof e.lazyRender<`u`?e.lazyRender:!1,className:typeof e.className<`u`?e.className:``,useShadows:typeof e.useShadows<`u`?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<`u`?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<`u`?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<`u`?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<`u`?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<`u`?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<`u`?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<`u`?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<`u`?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<`u`?e.mouseWheelSmoothScroll:!0,listenOnDomNode:typeof e.listenOnDomNode<`u`?e.listenOnDomNode:null,horizontal:typeof e.horizontal<`u`?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<`u`?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<`u`?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<`u`?e.horizontalHasArrows:!1,vertical:typeof e.vertical<`u`?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<`u`?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<`u`?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<`u`?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<`u`?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<`u`?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<`u`?e.verticalSliderSize:t.verticalScrollbarSize,n$&&(t.className+=` xterm-mac`),t}var x$=typeof window==`object`?window:globalThis;function S$(e,t=0){return e[e.length-(1+t)]}function ixe(e,t,n){let r=null,i=null;if(typeof n.value==`function`?(r=`value`,i=n.value,i.length!==0&&console.warn(`Memoize should only be used in functions with zero parameters`)):typeof n.get==`function`&&(r=`get`,i=n.get),!i||!r)throw Error(`not supported`);let a=`$memoize$${t}`,o=n;o[r]=function(...e){return this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:i.apply(this,e)}),this[a]}}var C$=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}};C$.Undefined=new C$(void 0);var w$=C$,T$=class{constructor(){this._first=w$.Undefined,this._last=w$.Undefined}push(e){return this._insert(e,!0)}_insert(e,t){let n=new w$(e);if(this._first===w$.Undefined)this._first=n,this._last=n;else if(t){let e=this._last;this._last=n,n.prev=e,e.next=n}else{let e=this._first;this._first=n,n.next=e,e.prev=n}let r=!1;return()=>{r||(r=!0,this._remove(n))}}_remove(e){if(e.prev!==w$.Undefined&&e.next!==w$.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===w$.Undefined&&e.next===w$.Undefined?(this._first=w$.Undefined,this._last=w$.Undefined):e.next===w$.Undefined?(this._last=this._last.prev,this._last.next=w$.Undefined):e.prev===w$.Undefined&&(this._first=this._first.next,this._first.prev=w$.Undefined)}*[Symbol.iterator](){let e=this._first;for(;e!==w$.Undefined;)yield e.element,e=e.next}},E$;(e=>(e.TAP=`-xterm-gesturetap`,e.CHANGE=`-xterm-gesturechange`,e.START=`-xterm-gesturestart`,e.END=`-xterm-gesturesend`,e.CONTEXT_MENU=`-xterm-gesturecontextmenu`))(E$||={});var D$=class e extends FQ{constructor(){super(),this._dispatched=!1,this._targets=new T$,this._ignoreTargets=new T$,this._activeTouches={},this._handle=null,this._lastSetTapCountTime=0;let e=x$;this._register(zQ(e.document,`touchstart`,e=>this._handleTouchStart(e),{passive:!1})),this._register(zQ(e.document,`touchend`,t=>this._handleTouchEnd(e,t))),this._register(zQ(e.document,`touchmove`,e=>this._handleTouchMove(e),{passive:!1}))}static addTarget(t){return e.isTouchDevice()?(e._instance||=new e,MQ(e._instance._targets.push(t))):FQ.None}static ignoreTarget(t){return e.isTouchDevice()?(e._instance||=new e,MQ(e._instance._ignoreTargets.push(t))):FQ.None}static isTouchDevice(){return`ontouchstart`in x$||navigator.maxTouchPoints>0}dispose(){this._handle&&=(this._handle.dispose(),null),super.dispose()}_handleTouchStart(e){let t=Date.now();this._handle&&=(this._handle.dispose(),null);for(let n=0,r=e.targetTouches.length;n<r;n++){let r=e.targetTouches.item(n);this._activeTouches[r.identifier]={id:r.identifier,initialTarget:r.target,initialTimeStamp:t,initialPageX:r.pageX,initialPageY:r.pageY,rollingTimestamps:[t],rollingPageX:[r.pageX],rollingPageY:[r.pageY]};let i=this._newGestureEvent(E$.START,r.target);i.pageX=r.pageX,i.pageY=r.pageY,this._dispatchEvent(i)}this._dispatched&&=(e.preventDefault(),e.stopPropagation(),!1)}_handleTouchEnd(t,n){let r=Date.now(),i=Object.keys(this._activeTouches).length;for(let a=0,o=n.changedTouches.length;a<o;a++){let o=n.changedTouches.item(a);if(!this._activeTouches.hasOwnProperty(String(o.identifier))){console.warn(`move of an UNKNOWN touch`,o);continue}let s=this._activeTouches[o.identifier],c=Date.now()-s.initialTimeStamp;if(c<e._holdDelay&&Math.abs(s.initialPageX-S$(s.rollingPageX))<30&&Math.abs(s.initialPageY-S$(s.rollingPageY))<30){let e=this._newGestureEvent(E$.TAP,s.initialTarget);e.pageX=S$(s.rollingPageX),e.pageY=S$(s.rollingPageY),this._dispatchEvent(e)}else if(c>=e._holdDelay&&Math.abs(s.initialPageX-S$(s.rollingPageX))<30&&Math.abs(s.initialPageY-S$(s.rollingPageY))<30){let e=this._newGestureEvent(E$.CONTEXT_MENU,s.initialTarget);e.pageX=S$(s.rollingPageX),e.pageY=S$(s.rollingPageY),this._dispatchEvent(e)}else if(i===1){let e=S$(s.rollingPageX),n=S$(s.rollingPageY),i=S$(s.rollingTimestamps)-s.rollingTimestamps[0],a=e-s.rollingPageX[0],o=n-s.rollingPageY[0],c=[...this._targets].filter(e=>s.initialTarget instanceof Node&&e.contains(s.initialTarget));this._inertia(t,c,r,Math.abs(a)/i,a>0?1:-1,e,Math.abs(o)/i,o>0?1:-1,n)}this._dispatchEvent(this._newGestureEvent(E$.END,s.initialTarget)),delete this._activeTouches[o.identifier]}this._dispatched&&=(n.preventDefault(),n.stopPropagation(),!1)}_newGestureEvent(e,t){let n=document.createEvent(`CustomEvent`);return n.initEvent(e,!1,!0),n.initialTarget=t,n.tapCount=0,n}_dispatchEvent(t){if(t.type===E$.TAP){let n=new Date().getTime(),r=0;r=n-this._lastSetTapCountTime>e._clearTapCountTime?1:2,this._lastSetTapCountTime=n,t.tapCount=r}else (t.type===E$.CHANGE||t.type===E$.CONTEXT_MENU)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let e of this._ignoreTargets)if(e.contains(t.initialTarget))return;let e=[];for(let n of this._targets)if(n.contains(t.initialTarget)){let r=0,i=t.initialTarget;for(;i&&i!==n;)r++,i=i.parentElement;e.push([r,n])}e.sort((e,t)=>e[0]-t[0]);for(let[,n]of e)n.dispatchEvent(t),this._dispatched=!0}}_inertia(t,n,r,i,a,o,s,c,l){this._handle=GQ(t,()=>{let u=Date.now(),d=u-r,f=0,p=0,m=!0;i+=e._scrollFriction*d,s+=e._scrollFriction*d,i>0&&(m=!1,f=a*i*d),s>0&&(m=!1,p=c*s*d);let h=this._newGestureEvent(E$.CHANGE);h.translationX=f,h.translationY=p,n.forEach(e=>e.dispatchEvent(h)),m||this._inertia(t,n,u,i,a,o+f,s,c,l+p)})}_handleTouchMove(e){let t=Date.now();for(let n=0,r=e.changedTouches.length;n<r;n++){let r=e.changedTouches.item(n);if(!this._activeTouches.hasOwnProperty(String(r.identifier))){console.warn(`end of an UNKNOWN touch`,r);continue}let i=this._activeTouches[r.identifier],a=this._newGestureEvent(E$.CHANGE,i.initialTarget);a.translationX=r.pageX-S$(i.rollingPageX),a.translationY=r.pageY-S$(i.rollingPageY),a.pageX=r.pageX,a.pageY=r.pageY,this._dispatchEvent(a),i.rollingPageX.length>3&&(i.rollingPageX.shift(),i.rollingPageY.shift(),i.rollingTimestamps.shift()),i.rollingPageX.push(r.pageX),i.rollingPageY.push(r.pageY),i.rollingTimestamps.push(t)}this._dispatched&&=(e.preventDefault(),e.stopPropagation(),!1)}};D$._scrollFriction=-.005,D$._holdDelay=700,D$._clearTapCountTime=400,$Z([ixe],D$,`isTouchDevice`,1);var axe=D$,O$=class extends FQ{constructor(e,t,n,r,i,a,o,s){super(),this._bufferService=n,this._optionsService=o,this._renderService=s,this._onRequestScrollLines=this._register(new d$),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let c=this._register(new p$({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:e=>GQ(r.window,e)}));this._register(this._optionsService.onSpecificOptionChange(`smoothScrollDuration`,()=>{c.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new nxe(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,verticalHasArrows:this._optionsService.rawOptions.scrollbar?.showArrows??!1,...this._getChangeOptions()},c)),this._register(this._optionsService.onMultipleOptionChange([`scrollSensitivity`,`fastScrollSensitivity`,`scrollbar`],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(i.onProtocolChange(e=>{this._scrollableElement.updateOptions({handleMouseWheel:!(e&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(f$.runAndSubscribe(a.onChangeColors,()=>{e.style.backgroundColor=a.colors.background.css,this._scrollableElement.getDomNode().style.backgroundColor=a.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(MQ(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement(`style`),t.appendChild(this._styleElement),this._register(MQ(()=>this._styleElement.remove())),this._register(f$.runAndSubscribe(a.onChangeColors,()=>{this._styleElement.textContent=[`.xterm .xterm-scrollable-element > .xterm-scrollbar > .xterm-slider {`,` background: ${a.colors.scrollbarSliderBackground.css};`,`}`,`.xterm .xterm-scrollable-element > .xterm-scrollbar > .xterm-slider:hover {`,` background: ${a.colors.scrollbarSliderHoverBackground.css};`,`}`,`.xterm .xterm-scrollable-element > .xterm-scrollbar > .xterm-slider.xterm-active {`,` background: ${a.colors.scrollbarSliderActiveBackground.css};`,`}`].join(`
449
449
  `)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(e=>this._handleScroll(e))),this._register(axe.addTarget(t)),this._register(zQ(t,E$.CHANGE,e=>this._handleGestureChange(e)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){let e=this._optionsService.rawOptions.scrollbar?.showScrollbar??!0,t=this._optionsService.rawOptions.scrollbar?.showArrows??!1,n=e?this._optionsService.rawOptions.scrollbar?.width??14:0;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,vertical:e?1:2,verticalScrollbarSize:n,verticalHasArrows:t}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}_handleGestureChange(e){e.preventDefault(),e.stopPropagation();let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({scrollTop:t.scrollTop-e.translationY})}};O$=$Z([$(2,gQ),$(3,EQ),$(4,_Q),$(5,AQ),$(6,xQ),$(7,OQ)],O$);var k$=class extends FQ{constructor(e,t,n,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement(`div`),this._container.classList.add(`xterm-decoration-container`),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(e=>this._removeDecoration(e))),this._register(MQ(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement(`div`);t.classList.add(`xterm-decoration`),t.classList.toggle(`xterm-decoration-top-layer`,e?.options?.layer===`top`),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display=`none`),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display=`none`,e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?`none`:`block`,this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||`left`)===`right`?t.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:``:t.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:``}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};k$=$Z([$(1,gQ),$(2,EQ),$(3,CQ),$(4,OQ)],k$);var oxe=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||`full`]&&t<=e.endBufferLine+this._linePadding[n||`full`]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},A$={full:0,left:0,center:0,right:0},j$={full:0,left:0,center:0,right:0},M$={full:0,left:0,center:0,right:0},N$=class extends FQ{constructor(e,t,n,r,i,a,o,s){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=i,this._optionsService=a,this._themeService=o,this._coreBrowserService=s,this._colorZoneStore=new oxe,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-decoration-overview-ruler`),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(MQ(()=>this._canvas?.remove()));let c=this._canvas.getContext(`2d`);if(c)this._ctx=c;else throw Error(`Ctx cannot be null`);this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?`none`:`block`})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onDimensionsChange(()=>this._queueRefresh(!0))),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange(`scrollbar`,()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){let e=this._optionsService.rawOptions.scrollbar;return e?.showScrollbar??!0?e?.width??0:0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);j$.full=this._canvas.width,j$.left=e,j$.center=t,j$.right=e,this._refreshDrawHeightConstants(),M$.full=1,M$.left=1,M$.center=1+j$.left,M$.right=1+j$.left+j$.center}_refreshDrawHeightConstants(){A$.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);A$.left=t,A$.center=t,A$.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*A$.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*A$.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*A$.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*A$.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){let e=this._renderService.dimensions.css.canvas.height,t=this._renderService.dimensions.device.canvas.height;this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${e}px`,this._canvas.height=t,this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!==`full`&&this._renderColorZone(t);for(let t of e)t.position===`full`&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.scrollbar?.overviewRuler?.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.scrollbar?.overviewRuler?.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(M$[e.position||`full`],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-A$[e.position||`full`]/2),j$[e.position||`full`],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+A$[e.position||`full`]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};N$=$Z([$(2,gQ),$(3,CQ),$(4,OQ),$(5,xQ),$(6,AQ),$(7,EQ)],N$);var P$=class{constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=``}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent=``,this._dataAlreadySent=``,this._compositionView.classList.add(`active`)}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove(`active`),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let t;e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,this._compositionPosition.start):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){if(this._textareaChangeTimer)return;let e=this._textarea.value;this._textareaChangeTimer=window.setTimeout(()=>{if(this._textareaChangeTimer=void 0,!this._isComposing){let t=this._textarea.value,n=t.replace(e,``);this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(``,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+`px`,this._compositionView.style.top=n+`px`,this._compositionView.style.height=t+`px`,this._compositionView.style.lineHeight=t+`px`,this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+`px`;let i=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+`px`,this._textarea.style.top=n+`px`,this._textarea.style.width=Math.max(i.width,1)+`px`,this._textarea.style.height=Math.max(i.height,1)+`px`,this._textarea.style.lineHeight=i.height+`px`}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};P$=$Z([$(2,gQ),$(3,xQ),$(4,vQ),$(5,OQ)],P$);var F$=0,I$=0,L$=0,R$=0,z$={css:`#00000000`,rgba:0},B$;(e=>{function t(e,t,n,r){return r===void 0?`#${G$(e)}${G$(t)}${G$(n)}`:`#${G$(e)}${G$(t)}${G$(n)}${G$(r)}`}e.toCss=t;function n(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}e.toRgba=n;function r(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}e.toColor=r})(B$||={});var V$;(e=>{function t(e,t){if(R$=(t.rgba&255)/255,R$===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,i=t.rgba>>8&255,a=e.rgba>>24&255,o=e.rgba>>16&255,s=e.rgba>>8&255;return F$=a+Math.round((n-a)*R$),I$=o+Math.round((r-o)*R$),L$=s+Math.round((i-s)*R$),{css:B$.toCss(F$,I$,L$),rgba:B$.toRgba(F$,I$,L$)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=W$.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return B$.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[F$,I$,L$]=W$.toChannels(t),{css:B$.toCss(F$,I$,L$),rgba:t}}e.opaque=i;function a(e,t){return R$=Math.round(t*255),[F$,I$,L$]=W$.toChannels(e.rgba),{css:B$.toCss(F$,I$,L$,R$),rgba:B$.toRgba(F$,I$,L$,R$)}}e.opacity=a;function o(e,t){return R$=e.rgba&255,a(e,R$*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}e.toColorRGB=s})(V$||={});var H$;(e=>{let t,n;try{let e=document.createElement(`canvas`);e.width=1,e.height=1;let r=e.getContext(`2d`,{willReadFrequently:!0});r&&(t=r,t.globalCompositeOperation=`copy`,n=t.createLinearGradient(0,0,1,1))}catch{}function r(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return F$=parseInt(e.slice(1,2).repeat(2),16),I$=parseInt(e.slice(2,3).repeat(2),16),L$=parseInt(e.slice(3,4).repeat(2),16),B$.toColor(F$,I$,L$);case 5:return F$=parseInt(e.slice(1,2).repeat(2),16),I$=parseInt(e.slice(2,3).repeat(2),16),L$=parseInt(e.slice(3,4).repeat(2),16),R$=parseInt(e.slice(4,5).repeat(2),16),B$.toColor(F$,I$,L$,R$);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}let r=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(r)return F$=parseInt(r[1]),I$=parseInt(r[2]),L$=parseInt(r[3]),R$=Math.round((r[5]===void 0?1:parseFloat(r[5]))*255),B$.toColor(F$,I$,L$,R$);if(e===`transparent`)return{css:`transparent`,rgba:0};if(!t||!n||(t.fillStyle=n,t.fillStyle=e,typeof t.fillStyle!=`string`)||(t.fillRect(0,0,1,1),[F$,I$,L$,R$]=t.getImageData(0,0,1,1).data,R$!==255))throw Error(`css.toColor: Unsupported css format`);return{rgba:B$.toRgba(F$,I$,L$,R$),css:e}}e.toColor=r})(H$||={});var U$;(e=>{function t(e){return n(e>>16&255,e>>8&255,e&255)}e.relativeLuminance=t;function n(e,t,n){let r=e/255,i=t/255,a=n/255,o=r<=.03928?r/12.92:((r+.055)/1.055)**2.4,s=i<=.03928?i/12.92:((i+.055)/1.055)**2.4,c=a<=.03928?a/12.92:((a+.055)/1.055)**2.4;return o*.2126+s*.7152+c*.0722}e.relativeLuminance2=n})(U$||={});var W$;(e=>{function t(e,t){if(R$=(t&255)/255,R$===1)return t;let n=t>>24&255,r=t>>16&255,i=t>>8&255,a=e>>24&255,o=e>>16&255,s=e>>8&255;return F$=a+Math.round((n-a)*R$),I$=o+Math.round((r-o)*R$),L$=s+Math.round((i-s)*R$),B$.toRgba(F$,I$,L$)}e.blend=t;function n(e,t,n){let a=U$.relativeLuminance(e>>8),o=U$.relativeLuminance(t>>8);if(K$(a,o)<n){if(o<a){let o=r(e,t,n),s=K$(a,U$.relativeLuminance(o>>8));if(s<n){let r=i(e,t,n);return s>K$(a,U$.relativeLuminance(r>>8))?o:r}return o}let s=i(e,t,n),c=K$(a,U$.relativeLuminance(s>>8));if(c<n){let i=r(e,t,n);return c>K$(a,U$.relativeLuminance(i>>8))?s:i}return s}}e.ensureContrastRatio=n;function r(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=K$(U$.relativeLuminance2(o,s,c),U$.relativeLuminance2(r,i,a));for(;l<n&&(o>0||s>0||c>0);)o-=Math.max(0,Math.ceil(o*.1)),s-=Math.max(0,Math.ceil(s*.1)),c-=Math.max(0,Math.ceil(c*.1)),l=K$(U$.relativeLuminance2(o,s,c),U$.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.reduceLuminance=r;function i(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=K$(U$.relativeLuminance2(o,s,c),U$.relativeLuminance2(r,i,a));for(;l<n&&(o<255||s<255||c<255);)o=Math.min(255,o+Math.ceil((255-o)*.1)),s=Math.min(255,s+Math.ceil((255-s)*.1)),c=Math.min(255,c+Math.ceil((255-c)*.1)),l=K$(U$.relativeLuminance2(o,s,c),U$.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.increaseLuminance=i;function a(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]}e.toChannels=a})(W$||={});function G$(e){let t=e.toString(16);return t.length<2?`0`+t:t}function K$(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var sxe=class extends lQ{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},q$=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new dQ}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],r=t.translateToString(!0),i=0,a=0,o=0,s=t.getFg(0),c=t.getBg(0);for(let e=0;e<t.getTrimmedLength();e++)if(t.loadCell(e,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==s||this._workCell.bg!==c){if(e-i>1){let e=this._getJoinedRanges(r,o,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}i=e,o=a,s=this._workCell.fg,c=this._workCell.bg}a+=this._workCell.getChars().length||1}if(this._bufferService.cols-i>1){let e=this._getJoinedRanges(r,o,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}return n}_getJoinedRanges(e,t,n,r,i){let a=e.substring(t,n),o=[];try{o=this._characterJoiners[0].handler(a)}catch(e){console.error(e)}for(let e=1;e<this._characterJoiners.length;e++)try{let t=this._characterJoiners[e].handler(a);for(let e=0;e<t.length;e++)q$._mergeRanges(o,t[e])}catch(e){console.error(e)}return this._stringRangesToCellRanges(o,r,i),o}_stringRangesToCellRanges(e,t,n){let r=0,i=!1,a=0,o=e[r];if(o){for(let s=n;s<this._bufferService.cols;s++){let n=t.getWidth(s),c=t.getString(s).length||1;if(n!==0){if(!i&&o[0]<=a&&(o[0]=s,i=!0),o[1]<=a){if(o[1]=s,o=e[++r],!o)break;o[0]<=a?(o[0]=s,i=!0):i=!1}a+=c}}o&&(o[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(n){if(t[1]<=i[0])return e[r-1][1]=t[1],e;if(t[1]<=i[1])return e[r-1][1]=Math.max(t[1],i[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=i[0])return e.splice(r,0,t),e;if(t[1]<=i[1])return i[0]=Math.min(t[0],i[0]),e;t[0]<i[1]&&(i[0]=Math.min(t[0],i[0]),n=!0);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};q$=$Z([$(0,gQ)],q$);function J$(e){if(!e)throw Error(`value must not be falsy`);return e}function cxe(e){return 57508<=e&&e<=57558}function lxe(e){return 9472<=e&&e<=9631}function uxe(e){return cxe(e)||lxe(e)}function dxe(){return{css:{canvas:Y$(),cell:Y$()},device:{canvas:Y$(),cell:Y$(),char:{width:0,height:0,left:0,top:0}}}}function Y$(){return{width:0,height:0}}var X$=class{constructor(e,t,n,r,i,a,o){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._themeService=o,this._workCell=new dQ,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,i,a,o,s,c,l,u,d,f){let p=[];f&&(f.hasBlinkingCells=!1);let m=this._characterJoinerService.getJoinedCharacters(t),h=this._themeService.colors,g=e.getNoBgTrimmedLength();n&&g<a+1&&(g=a+1);let _,v=0,y=``,b=0,x=0,S=0,C=0,w=!1,T=0,E=!1,D=0,O=0,k=[],A=u!==-1&&d!==-1;for(let j=0;j<g;j++){e.loadCell(j,this._workCell);let g=this._workCell.getWidth();if(g===0)continue;let M=!1,N=j>=O,P=j,F=this._workCell;if(m.length>0&&j===m[0][0]&&N){let r=m.shift(),i=this._isCellInSelection(r[0],t);for(b=r[0]+1;b<r[1];b++)N&&=i===this._isCellInSelection(b,t);N&&=!n||a<r[0]||a>=r[1],N?(M=!0,F=new sxe(this._workCell,e.translateToString(!0,r[0],r[1]),r[1]-r[0]),P=r[1]-1,g=F.getWidth()):O=r[1]}let I=this._isCellInSelection(j,t),ee=n&&j===a,L=A&&j>=u&&j<=d;f&&F.isBlink()&&(f.hasBlinkingCells=!0),!s&&F.isBlink()&&k.push(`xterm-blink-hidden`);let R=!1;this._decorationService.forEachDecorationAtCell(j,t,void 0,e=>{R=!0});let z=F.getChars()||` `;if(z===` `&&(F.isUnderline()||F.isOverline())&&(z=`\xA0`),D=g*c-l.get(z,F.isBold(),F.isItalic()),!_)_=this._document.createElement(`span`);else if(v&&(I&&E||!I&&!E&&F.bg===x)&&(I&&E&&h.selectionForeground||F.fg===S)&&F.extended.ext===C&&L===w&&D===T&&!ee&&!M&&!R&&N){F.isInvisible()?y+=` `:y+=z,v++;continue}else v&&(_.textContent=y),_=this._document.createElement(`span`),v=0,y=``;if(x=F.bg,S=F.fg,C=F.extended.ext,w=L,T=D,E=I,M&&a>=j&&a<=P&&(a=j),!this._coreService.isCursorHidden&&ee&&this._coreService.isCursorInitialized){if(k.push(`xterm-cursor`),this._coreBrowserService.isFocused)o&&k.push(`xterm-cursor-blink`),k.push(r===`bar`?`xterm-cursor-bar`:r===`underline`?`xterm-cursor-underline`:`xterm-cursor-block`);else if(i)switch(i){case`outline`:k.push(`xterm-cursor-outline`);break;case`block`:k.push(`xterm-cursor-block`);break;case`bar`:k.push(`xterm-cursor-bar`);break;case`underline`:k.push(`xterm-cursor-underline`);break;default:break}}if(F.isBold()&&k.push(`xterm-bold`),F.isItalic()&&k.push(`xterm-italic`),F.isDim()&&k.push(`xterm-dim`),y=F.isInvisible()?` `:F.getChars()||` `,F.isUnderline()&&(k.push(`xterm-underline-${F.extended.underlineStyle}`),y===` `&&(y=`\xA0`),!F.isUnderlineColorDefault()))if(F.isUnderlineColorRGB())_.style.textDecorationColor=`rgb(${lQ.toColorRGB(F.getUnderlineColor()).join(`,`)})`;else{let e=F.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&F.isBold()&&e<8&&(e+=8),_.style.textDecorationColor=h.ansi[e].css}F.isOverline()&&(k.push(`xterm-overline`),y===` `&&(y=`\xA0`)),F.isStrikethrough()&&k.push(`xterm-strikethrough`),L&&(_.style.textDecoration=`underline`);let te=F.getFgColor(),B=F.getFgColorMode(),ne=F.getBgColor(),re=F.getBgColorMode(),V=!!F.isInverse();if(V){let e=te;te=ne,ne=e;let t=B;B=re,re=t}let H,ie,ae=!1;this._decorationService.forEachDecorationAtCell(j,t,void 0,e=>{e.options.layer!==`top`&&ae||(e.backgroundColorRGB&&(re=50331648,ne=e.backgroundColorRGB.rgba>>8&16777215,H=e.backgroundColorRGB),e.foregroundColorRGB&&(B=50331648,te=e.foregroundColorRGB.rgba>>8&16777215,ie=e.foregroundColorRGB),ae=e.options.layer===`top`)}),!ae&&I&&(H=this._coreBrowserService.isFocused?h.selectionBackgroundOpaque:h.selectionInactiveBackgroundOpaque,ne=H.rgba>>8&16777215,re=50331648,ae=!0,h.selectionForeground&&(B=50331648,te=h.selectionForeground.rgba>>8&16777215,ie=h.selectionForeground)),ae&&k.push(`xterm-decoration-top`);let oe;switch(re){case 16777216:case 33554432:oe=h.ansi[ne],k.push(`xterm-bg-${ne}`);break;case 50331648:oe=B$.toColor(ne>>16,ne>>8&255,ne&255),this._addStyle(_,`background-color:#${(ne>>>0).toString(16).padStart(6,`0`)}`);break;default:V?(oe=h.foreground,k.push(`xterm-bg-257`)):oe=h.background}switch(H||F.isDim()&&(H=V$.multiplyOpacity(oe,.5)),B){case 16777216:case 33554432:F.isBold()&&te<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(te+=8),this._applyMinimumContrast(_,oe,h.ansi[te],F,H,void 0)||k.push(`xterm-fg-${te}`);break;case 50331648:let e=B$.toColor(te>>16&255,te>>8&255,te&255);this._applyMinimumContrast(_,oe,e,F,H,ie)||this._addStyle(_,`color:#${te.toString(16).padStart(6,`0`)}`);break;default:this._applyMinimumContrast(_,oe,h.foreground,F,H,ie)||V&&k.push(`xterm-fg-257`)}k.length&&=(_.className=k.join(` `),0),!ee&&!M&&!R&&N?v++:_.textContent=y,D!==this.defaultSpacing&&(_.style.letterSpacing=`${D}px`),p.push(_),j=P}return _&&v&&(_.textContent=y),p}_applyMinimumContrast(e,t,n,r,i,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||uxe(r.getCode()))return!1;let o=this._getContrastCache(r),s;if(!i&&!a&&(s=o.getColor(t.rgba,n.rgba)),s===void 0){let e=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);s=V$.ensureContrastRatio(i??t,a??n,e),o.setColor((i??t).rgba,(a??n).rgba,s??null)}return s?(this._addStyle(e,`color:${s.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute(`style`,`${e.getAttribute(`style`)||``}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!n||!r?!1:this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e<r[0]&&t<=r[1]:e<n[0]&&t>=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t<r[1]||n[1]===r[1]&&t===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&t===r[1]&&e<r[0]||n[1]<r[1]&&t===n[1]&&e>=n[0]}};X$=$Z([$(1,kQ),$(2,xQ),$(3,EQ),$(4,vQ),$(5,CQ),$(6,AQ)],X$);var fxe=class{constructor(e=()=>new pxe){this._flat=new Float32Array(256),this._font=``,this._fontSize=0,this._weight=`normal`,this._weightBold=`bold`,this._canvasElements=[],this._canvasElements=[e(),e(),e(),e()],this.clear()}dispose(){this._canvasElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,n,r){e===this._font&&t===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=r,this._canvasElements[0].setFont(e,t,n,!1),this._canvasElements[1].setFont(e,t,r,!1),this._canvasElements[2].setFont(e,t,n,!0),this._canvasElements[3].setFont(e,t,r,!0),this.clear())}get(e,t,n){let r=0;if(!t&&!n&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let t=this._measure(e,0);return t>0&&(this._flat[r]=t),t}let i=e;t&&(i+=`B`),n&&(i+=`I`);let a=this._holey.get(i);if(a===void 0){let r=0;t&&(r|=1),n&&(r|=2),a=this._measure(e,r),a>0&&this._holey.set(i,a)}return a}_measure(e,t){return this._canvasElements[t].measure(e)}},pxe=class{constructor(){typeof OffscreenCanvas<`u`?(this._canvas=new OffscreenCanvas(1,1),this._ctx=J$(this._canvas.getContext(`2d`))):(this._canvas=document.createElement(`canvas`),this._canvas.width=1,this._canvas.height=1,this._ctx=J$(this._canvas.getContext(`2d`)))}setFont(e,t,n,r){let i=r?`italic`:``;this._ctx.font=`${i} ${n} ${t}px ${e}`.trim()}measure(e){return this._ctx.measureText(e).width}},mxe=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let i=e.buffers.active.ydisp,a=t[1]-i,o=n[1]-i,s=Math.max(a,0),c=Math.min(o,e.rows-1);if(s>=e.rows||c<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=a,this.viewportEndRow=o,this.viewportCappedStartRow=s,this.viewportCappedEndRow=c,this.startCol=t[0],this.endCol=n[0]}isCellSelected(e,t,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol):!1}};function hxe(){return new mxe}var gxe=class extends FQ{constructor(e,t,n){super(),this._renderCallback=e,this._coreBrowserService=t,this._optionsService=n,this._intervalDuration=0,this._blinkOn=!0,this._needsBlinkInViewport=!1,this._isViewportVisible=!0,this._register(this._optionsService.onSpecificOptionChange(`blinkIntervalDuration`,e=>{this.setIntervalDuration(e)})),this.setIntervalDuration(this._optionsService.rawOptions.blinkIntervalDuration),this._register(MQ(()=>this._clearInterval()))}get isBlinkOn(){return this._blinkOn}get isEnabled(){return this._intervalDuration>0}setNeedsBlinkInViewport(e){this._needsBlinkInViewport!==e&&(this._needsBlinkInViewport=e,this._updateIntervalState())}setViewportVisible(e){this._isViewportVisible!==e&&(this._isViewportVisible=e,this._updateIntervalState())}setIntervalDuration(e){e!==this._intervalDuration&&(this._intervalDuration=e,this._clearInterval(),this._updateIntervalState())}_updateIntervalState(){if(this._intervalDuration>0&&this._needsBlinkInViewport&&this._isViewportVisible){if(this._interval!==void 0)return;let e=this._blinkOn;this._blinkOn=!0,this._interval=this._coreBrowserService.window.setInterval(()=>{this._blinkOn=!this._blinkOn,this._renderCallback()},this._intervalDuration),e||this._renderCallback();return}this._clearInterval(),this._blinkOn||(this._blinkOn=!0,this._renderCallback())}_clearInterval(){this._interval!==void 0&&(this._coreBrowserService.window.clearInterval(this._interval),this._interval=void 0)}},Z$=`xterm-dom-renderer-owner-`,Q$=`xterm-rows`,$$=`xterm-fg-`,e1=`xterm-bg-`,t1=`xterm-focus`,n1=`xterm-selection`,r1=`xterm-cursor-blink-idle`,_xe=1,i1=class extends FQ{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=i,this._helperContainer=a,this._linkifier2=o,this._charSizeService=c,this._optionsService=l,this._bufferService=u,this._coreService=d,this._coreBrowserService=f,this._themeService=p,this._terminalClass=_xe++,this._rowElements=[],this._selectionRenderModel=hxe(),this._rowHasBlinkingCells=[],this._rowHasBlinkingCellsCount=0,this._onRequestRedraw=this._register(new d$),this.onRequestRedraw=this._onRequestRedraw.event,this._rowContainer=this._document.createElement(`div`),this._rowContainer.classList.add(Q$),this._rowContainer.style.lineHeight=`normal`,this._rowContainer.setAttribute(`aria-hidden`,`true`),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement(`div`),this._selectionContainer.classList.add(n1),this._selectionContainer.setAttribute(`aria-hidden`,`true`),this.dimensions=dxe(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(e=>this._injectCss(e))),this._injectCss(this._themeService.colors),this._rowFactory=s.createInstance(X$,document),this._element.classList.add(Z$+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(e=>this._handleLinkHover(e))),this._register(this._linkifier2.onHideLinkUnderline(e=>this._handleLinkLeave(e))),this._cursorBlinkStateManager=new vxe(this._rowContainer,this._coreBrowserService),this._register(zQ(this._document,`mousedown`,()=>this._cursorBlinkStateManager.restartBlinkAnimation())),this._register(MQ(()=>this._cursorBlinkStateManager.dispose())),this._textBlinkStateManager=this._register(new gxe(()=>this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1}),this._coreBrowserService,this._optionsService)),this._register(MQ(()=>{this._element.classList.remove(Z$+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new fxe,this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let e of this._rowElements)e.style.width=`${this.dimensions.css.canvas.width}px`,e.style.height=`${this.dimensions.css.cell.height}px`,e.style.lineHeight=`${this.dimensions.css.cell.height}px`,e.style.overflow=`hidden`;this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${Q$} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${Q$} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${Q$} .xterm-dim { color: ${V$.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}${this._terminalSelector} span.xterm-blink-hidden { visibility: hidden;}`;let n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,i=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${i} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Q$}.${t1} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Q$}.${t1} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Q$}.${t1} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${Q$}.${r1} .xterm-cursor.xterm-cursor-blink { animation: none !important;}${this._terminalSelector} .${Q$} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Q$} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Q$} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Q$} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Q$} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${n1} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${n1} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${n1} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,r]of e.ansi.entries())t+=`${this._terminalSelector} .${$$}${n} { color: ${r.css}; }${this._terminalSelector} .${$$}${n}.xterm-dim { color: ${V$.multiplyOpacity(r,.5).css}; }${this._terminalSelector} .${e1}${n} { background-color: ${r.css}; }`;t+=`${this._terminalSelector} .${$$}257 { color: ${V$.opaque(e.background).css}; }${this._terminalSelector} .${$$}257.xterm-dim { color: ${V$.multiplyOpacity(V$.opaque(e.background),.5).css}; }${this._terminalSelector} .${e1}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get(`W`,!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let e=this._rowElements.length;e<=t;e++){let e=this._document.createElement(`div`);this._rowContainer.appendChild(e),this._rowElements.push(e),this._rowHasBlinkingCells.push(!1)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop()),this._rowHasBlinkingCells.pop()&&this._rowHasBlinkingCellsCount--}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(t1),this._cursorBlinkStateManager.pause(),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(t1),this._cursorBlinkStateManager.resume(),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleViewportVisibilityChange(e){this._textBlinkStateManager.setViewportVisible(e)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,n),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,i=this._selectionRenderModel.viewportEndRow,a=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow,s=this._document.createDocumentFragment();if(n){let n=e[0]>t[0];s.appendChild(this._createSelectionElement(a,n?t[0]:e[0],n?e[0]:t[0],o-a+1))}else{let n=r===a?e[0]:0,c=a===i?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(a,n,c));let l=o-a-1;if(s.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,l)),a!==o){let e=i===o?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(o,0,e))}}this._selectionContainer.appendChild(s)}_createSelectionElement(e,t,n,r=1){let i=this._document.createElement(`div`),a=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(n-t);return a+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-a),i.style.height=`${r*this.dimensions.css.cell.height}px`,i.style.top=`${e*this.dimensions.css.cell.height}px`,i.style.left=`${a}px`,i.style.width=`${o}px`,i}handleCursorMove(){this._cursorBlinkStateManager.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren();this._rowHasBlinkingCellsCount>0&&(this._rowHasBlinkingCells.fill(!1),this._rowHasBlinkingCellsCount=0,this._textBlinkStateManager.setNeedsBlinkInViewport(!1))}renderRows(e,t){let n=this._bufferService.buffer,r=n.ybase+n.y,i=Math.min(n.x,this._bufferService.cols-1),a=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,o=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,s=this._optionsService.rawOptions.cursorInactiveStyle,c={hasBlinkingCells:!1};for(let l=e;l<=t;l++){let e=l+n.ydisp,t=this._rowElements[l],u=n.lines.get(e);if(!t||!u)break;t.replaceChildren(...this._rowFactory.createRow(u,e,e===r,o,s,i,a,this._textBlinkStateManager.isBlinkOn,this.dimensions.css.cell.width,this._widthCache,-1,-1,c)),this._setRowBlinkState(l,c.hasBlinkingCells)}this._updateTextBlinkState()}get _terminalSelector(){return`.${Z$}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,r,i,a){n<0&&(e=0),r<0&&(t=0);let o=this._bufferService.rows-1;n=Math.max(Math.min(n,o),0),r=Math.max(Math.min(r,o),0),i=Math.min(i,this._bufferService.cols);let s=this._bufferService.buffer,c=s.ybase+s.y,l=Math.min(s.x,i-1),u=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle,p={hasBlinkingCells:!1};for(let o=n;o<=r;++o){let m=o+s.ydisp,h=this._rowElements[o],g=s.lines.get(m);if(!h||!g)break;h.replaceChildren(...this._rowFactory.createRow(g,m,m===c,d,f,l,u,this._textBlinkStateManager.isBlinkOn,this.dimensions.css.cell.width,this._widthCache,a?o===n?e:0:-1,a?(o===r?t:i)-1:-1,p)),this._setRowBlinkState(o,p.hasBlinkingCells)}this._updateTextBlinkState()}_setRowBlinkState(e,t){this._rowHasBlinkingCells[e]!==t&&(this._rowHasBlinkingCells[e]=t,this._rowHasBlinkingCellsCount+=t?1:-1)}_updateTextBlinkState(){this._textBlinkStateManager.setNeedsBlinkInViewport(this._rowHasBlinkingCellsCount>0)}};i1=$Z([$(7,yQ),$(8,TQ),$(9,xQ),$(10,gQ),$(11,vQ),$(12,EQ),$(13,AQ)],i1);var vxe=class{constructor(e,t){this._rowContainer=e,this._coreBrowserService=t,this._isIdlePaused=!1,this._coreBrowserService.isFocused&&this._resetIdleTimer()}dispose(){this._clearIdleTimer()}restartBlinkAnimation(){this._isIdlePaused&&this._rowContainer.classList.remove(r1),this._resetIdleTimer()}pause(){this._isIdlePaused=!1,this._clearIdleTimer()}resume(){this._isIdlePaused=!1,this._rowContainer.classList.remove(r1),this._resetIdleTimer()}_resetIdleTimer(){this._isIdlePaused=!1,this._clearIdleTimer(),this._idleTimeout=this._coreBrowserService.window.setTimeout(()=>{this._stopBlinkingDueToIdle()},3e5)}_clearIdleTimer(){this._idleTimeout&&=(this._coreBrowserService.window.clearTimeout(this._idleTimeout),void 0)}_stopBlinkingDueToIdle(){this._rowContainer.classList.add(r1),this._isIdlePaused=!0,this._idleTimeout=void 0}},a1=class extends FQ{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new d$),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new bxe(this._optionsService))}catch{this._measureStrategy=this._register(new yxe(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange([`fontFamily`,`fontSize`],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};a1=$Z([$(2,xQ)],a1);var o1=class extends FQ{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},yxe=class extends o1{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,this._measureElement=this._document.createElement(`span`),this._measureElement.classList.add(`xterm-char-measure-element`),this._measureElement.textContent=`W`.repeat(32),this._measureElement.setAttribute(`aria-hidden`,`true`),this._measureElement.style.whiteSpace=`pre`,this._measureElement.style.fontKerning=`none`,this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},bxe=class extends o1{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext(`2d`);let t=this._ctx.measureText(`W`);if(!(`width`in t&&`fontBoundingBoxAscent`in t&&`fontBoundingBoxDescent`in t))throw Error(`Required font metrics not supported`)}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText(`W`);return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},xxe=class extends FQ{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._onDprChange=this._register(new d$),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new d$),this.onWindowChange=this._onWindowChange.event,this._screenDprMonitor=this._register(new Sxe(this._window)),this._register(this.onWindowChange(e=>this._screenDprMonitor.setWindow(e))),this._register(f$.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(zQ(this._textarea,`focus`,()=>this._isFocused=!0)),this._register(zQ(this._textarea,`blur`,()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},Sxe=class extends FQ{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new IQ),this._onDprChange=this._register(new d$),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(MQ(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=zQ(this._parentWindow,`resize`,()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},Cxe=class extends FQ{constructor(){super(),this.linkProviders=[],this._register(MQ(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function s1(e,t,n){let r=n.getBoundingClientRect(),i=e.getComputedStyle(n),a=parseInt(i.getPropertyValue(`padding-left`)),o=parseInt(i.getPropertyValue(`padding-top`));return[t.clientX-r.left-a,t.clientY-r.top-o]}function wxe(e,t,n,r,i,a,o,s,c){if(!a)return;let l=s1(e,t,n);if(l)return l[0]=Math.ceil((l[0]+(c?o/2:0))/o),l[1]=Math.ceil(l[1]/s),l[0]=Math.min(Math.max(l[0],1),r+(c?1:0)),l[1]=Math.min(Math.max(l[1],1),i),l}var c1=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,i){return wxe(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(e,t){let n=s1(RQ(t),e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};c1=$Z([$(0,OQ),$(1,TQ)],c1);var Txe=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&=(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()),this._animationFrame}refresh(e,t,n){this._rowCount=n,e??=0,t??=this._rowCount-1,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t),!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},l1=class{constructor(e){this._tasks=[],this._i=0,this._logService=e}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&=(this._cancelCallback(this._idleCallback),void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||=this._requestCallback(this._process.bind(this))}_process(e){this._idleCallback=void 0;let t=0,n=0,r=e.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),n=Math.max(t,n),i=e.timeRemaining(),n*1.5>i){r-t<-20&&this._logService.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=i}this.clear()}},Exe=class extends l1{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},Dxe=class extends l1{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},u1=!YQ&&`requestIdleCallback`in window?Dxe:Exe,Oxe=class{constructor(e){this._queue=new u1(e)}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},d1=class extends FQ{constructor(e,t,n,r,i,a,o,s,c,l){super(),this._rowCount=e,this._optionsService=n,this._logService=r,this._charSizeService=i,this._coreService=a,this._coreBrowserService=c,this._renderer=this._register(new IQ),this._observerDisposable=this._register(new IQ),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new d$),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new d$),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new d$),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new d$),this.onRefreshRequest=this._onRefreshRequest.event,this._pausedResizeTask=new Oxe(this._logService),this._renderDebouncer=new Txe((e,t)=>this._renderRows(e,t),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new kxe(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(MQ(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(s.onResize(()=>this._fullRefresh())),this._register(s.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(o.onDecorationRegistered(()=>this._fullRefresh())),this._register(o.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange([`drawBoldTextInBrightColors`,`letterSpacing`,`lineHeight`,`fontFamily`,`fontSize`,`fontWeight`,`fontWeightBold`,`minimumContrastRatio`,`rescaleOverlappingGlyphs`],()=>{this.clear(),this.handleResize(s.cols,s.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange([`cursorBlink`,`cursorStyle`],()=>this.refreshRows(s.buffer.y,s.buffer.y,void 0,!0))),this._register(l.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(e=>this._registerIntersectionObserver(e,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if(`IntersectionObserver`in e){let n=new e.IntersectionObserver(e=>this._handleIntersectionChange(e[e.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=MQ(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,this._renderer.value?.handleViewportVisibilityChange?.(!this._isPaused),!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,n=!1,r=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let i=this._syncOutputHandler.flush();i&&(e=Math.min(e,i.start),t=Math.max(t,i.end)),r||(this._isNextRenderRedrawOnly=!1),n?this._renderRows(e,t):this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&=(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(e=>this.refreshRows(e.start,e.end,e.sync,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,n){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,this._renderer.value?.handleSelectionChanged(e,t,n)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};d1=$Z([$(2,xQ),$(3,bQ),$(4,TQ),$(5,vQ),$(6,CQ),$(7,gQ),$(8,EQ),$(9,AQ)],d1);var kxe=class{constructor(e,t,n){this._coreBrowserService=e,this._coreService=t,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout??=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3)}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function Axe(e,t,n,r){let i=n.buffer.x,a=n.buffer.y;if(!n.buffer.hasScrollback)return Nxe(i,a,e,t,n,r)+f1(a,t,n,r)+Pxe(i,a,e,t,n,r);let o;if(a===t)return o=i>e?`D`:`C`,_1(Math.abs(i-e),g1(o,r));o=a>t?`D`:`C`;let s=Math.abs(a-t);return _1(Mxe(a>t?e:i,n)+(s-1)*n.cols+1+jxe(a>t?i:e,n),g1(o,r))}function jxe(e,t){return e-1}function Mxe(e,t){return t.cols-e}function Nxe(e,t,n,r,i,a){return f1(t,r,i,a).length===0?``:_1(h1(e,t,e,t-p1(t,i),!1,i).length,g1(`D`,a))}function f1(e,t,n,r){let i=e-p1(e,n),a=t-p1(t,n);return _1(Math.abs(i-a)-Fxe(e,t,n),g1(m1(e,t),r))}function Pxe(e,t,n,r,i,a){let o;o=f1(t,r,i,a).length>0?r-p1(r,i):t;let s=r,c=Ixe(e,t,n,r,i,a);return _1(h1(e,o,n,s,c===`C`,i).length,g1(c,a))}function Fxe(e,t,n){let r=0,i=e-p1(e,n),a=t-p1(t,n);for(let o=0;o<Math.abs(i-a);o++){let a=m1(e,t)===`A`?-1:1;n.buffer.lines.get(i+a*o)?.isWrapped&&r++}return r}function p1(e,t){let n=0,r=t.buffer.lines.get(e),i=r?.isWrapped;for(;i&&e>=0&&e<t.rows;)n++,r=t.buffer.lines.get(--e),i=r?.isWrapped;return n}function Ixe(e,t,n,r,i,a){let o;return o=f1(n,r,i,a).length>0?r-p1(r,i):t,e<n&&o<=r||e>=n&&o<r?`C`:`D`}function m1(e,t){return e>t?`A`:`B`}function h1(e,t,n,r,i,a){let o=e,s=t,c=``;for(;(o!==n||s!==r)&&s>=0&&s<a.buffer.lines.length;)o+=i?1:-1,i&&o>a.cols-1?(c+=a.buffer.translateBufferLineToString(s,!1,e,o),o=0,e=0,s++):!i&&o<0&&(c+=a.buffer.translateBufferLineToString(s,!1,0,e+1),o=a.cols-1,e=o,s--);return c+a.buffer.translateBufferLineToString(s,!1,e,o)}function g1(e,t){return`\x1B`+(t?`O`:`[`)+e}function _1(e,t){e=Math.floor(e);let n=``;for(let r=0;r<e;r++)n+=t;return n}var Lxe=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function v1(e,t){if(e.start.y>e.end.y)throw Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var y1=50,Rxe=15,zxe=50,Bxe=500,Vxe=RegExp(`\xA0`,`g`),b1=class extends FQ{constructor(e,t,n,r,i,a,o,s,c){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=i,this._mouseService=a,this._optionsService=o,this._renderService=s,this._coreBrowserService=c,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new dQ,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new d$),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new d$),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new d$),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new d$),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=e=>this._handleMouseMove(e),this._mouseUpListener=e=>this._handleMouseUp(e),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(e=>this._handleTrim(e)),this._register(this._bufferService.buffers.onBufferActivate(e=>this._handleBufferActivate(e))),this.enable(),this._model=new Lxe(this._bufferService),this._activeSelectionMode=0,this._register(MQ(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(e=>{e.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return``;let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return``;let i=e[0]<t[0]?e[0]:t[0],a=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){let e=n.translateBufferLineToString(o,!0,i,a);r.push(e)}}else{let i=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],i));for(let i=e[1]+1;i<=t[1]-1;i++){let e=n.lines.get(i),t=n.translateBufferLineToString(i,!0);e?.isWrapped?r[r.length-1]+=t:r.push(t)}if(e[1]!==t[1]){let e=n.lines.get(t[1]),i=n.translateBufferLineToString(t[1],!0,0,t[0]);e&&e.isWrapped?r[r.length-1]+=i:r.push(i)}}return r.map(e=>e.replace(Vxe,` `)).join(r$?`\r
@@ -947,7 +947,7 @@ WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){t
947
947
  @pointerdown=${e=>this._onResizeStart(e,`br`)}
948
948
  ></div>
949
949
  ${e}
950
- </dialog>`:e}};customElements.define(`input-panel`,jCe);var MCe={extension:{type:W.Environment,name:`browser`,priority:-1},test:()=>!0,load:async()=>{await q(()=>import(`./browserAll-BA_Fhu-2.js`),__vite__mapDeps([127,128,1,129]))}},NCe={extension:{type:W.Environment,name:`webworker`,priority:0},test:()=>typeof self<`u`&&self.WorkerGlobalScope!==void 0,load:async()=>{await q(()=>import(`./webworkerAll-CPbxFeiO.js`),__vite__mapDeps([130,128,1,129]))}},PCe=new mt;function Q2(e,t,n){let r=PCe;e.measurable=!0,Nt(e,n,r),t.addBoundsMask(r),e.measurable=!1}function $2(e,t,n){let r=$e.get();e.measurable=!0;let i=Mt.get().identity();ht(e,r,e4(e,n,i)),e.measurable=!1,t.addBoundsMask(r),Mt.return(i),$e.return(r)}function e4(e,t,n){return e?(e!==t&&(e4(e.parent,t,n),e.updateLocalTransform(),n.append(e.localTransform)),n):(ot(`Mask bounds, renderable is not inside the root container`),n)}var t4=class{constructor(e){this.priority=0,this.inverse=!1,this.pipe=`alphaMask`,e?.mask&&this.init(e.mask)}init(e){this.mask=e,this.renderMaskToTexture=!(e instanceof Jt),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask=null)}addBounds(e,t){this.inverse||Q2(this.mask,e,t)}addLocalBounds(e,t){$2(this.mask,e,t)}containsPoint(e,t){let n=this.mask;return t(n,e)}destroy(){this.reset()}static test(e){return e instanceof Jt}};t4.extension=W.MaskEffect;var n4=class{constructor(e){this.priority=0,this.pipe=`colorMask`,e?.mask&&this.init(e.mask)}init(e){this.mask=e}destroy(){}static test(e){return typeof e==`number`}};n4.extension=W.MaskEffect;var r4=class{constructor(e){this.priority=0,this.pipe=`stencilMask`,e?.mask&&this.init(e.mask)}init(e){this.mask=e,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(e,t){Q2(this.mask,e,t)}addLocalBounds(e,t){$2(this.mask,e,t)}containsPoint(e,t){let n=this.mask;return t(n,e)}destroy(){this.reset()}static test(e){return e instanceof qt}};r4.extension=W.MaskEffect;var i4;async function FCe(){return i4??=(async()=>{let e=Gt.get().createCanvas(1,1).getContext(`webgl`);if(!e)return`premultiply-alpha-on-upload`;let t=await new Promise(e=>{let t=document.createElement(`video`);t.onloadeddata=()=>e(t),t.onerror=()=>e(null),t.autoplay=!1,t.crossOrigin=`anonymous`,t.preload=`auto`,t.src=`data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=`,t.load()});if(!t)return`premultiply-alpha-on-upload`;let n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);let r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t);let i=new Uint8Array(4);return e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,i),e.deleteFramebuffer(r),e.deleteTexture(n),e.getExtension(`WEBGL_lose_context`)?.loseContext(),i[0]<=i[3]?`premultiplied-alpha`:`premultiply-alpha-on-upload`})(),i4}var a4=class e extends gt{constructor(t){super(t),this.isReady=!1,this.uploadMethodId=`video`,t={...e.defaultOptions,...t},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this.alphaMode=t.alphaMode??`premultiply-alpha-on-upload`,this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),t.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){let e=kt.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;let e=this.resource,t=this.options;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener(`play`,this._onPlayStart),e.addEventListener(`pause`,this._onPlayStop),e.addEventListener(`seeked`,this._onSeeked),this._isSourceReady()?this._mediaReady():(t.preload||e.addEventListener(`canplay`,this._onCanPlay),e.addEventListener(`canplaythrough`,this._onCanPlayThrough),e.addEventListener(`error`,this._onError,!0)),this.alphaMode=await FCe(),this._load=new Promise((n,r)=>{this.isValid?n(this):(this._resolve=n,this._reject=r,t.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${t.preloadTimeoutMs}ms`))})),e.load())}),this._load}_onError(e){this.resource.removeEventListener(`error`,this._onError,!0),this.emit(`error`,e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){let e=this.resource;return!e.paused&&!e.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onCanPlay(){this.resource.removeEventListener(`canplay`,this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener(`canplaythrough`,this._onCanPlay),this._preloadTimeout&&=(clearTimeout(this._preloadTimeout),void 0),this._mediaReady()}_mediaReady(){let e=this.resource;this.isValid&&(this.isReady=!0,this.resize(e.videoWidth,e.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();let e=this.resource;e&&(e.removeEventListener(`play`,this._onPlayStart),e.removeEventListener(`pause`,this._onPlayStop),e.removeEventListener(`seeked`,this._onSeeked),e.removeEventListener(`canplay`,this._onCanPlay),e.removeEventListener(`canplaythrough`,this._onCanPlayThrough),e.removeEventListener(`error`,this._onError,!0),e.pause(),e.src=``,e.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(kt.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(kt.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(kt.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement}};a4.extension=W.TextureSource,a4.defaultOptions={...gt.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1},a4.MIME_TYPES={ogv:`video/ogg`,mov:`video/quicktime`,m4v:`video/mp4`};var ICe=a4,o4=(e,t,n=!1)=>(Array.isArray(e)||(e=[e]),t?e.map(e=>typeof e==`string`||n?t(e):e):e),s4=new class{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(e){return this._cache.has(e)}get(e){let t=this._cache.get(e);return t||ot(`[Assets] Asset id ${e} was not found in the Cache`),t}set(e,t){let n=o4(e),r;for(let e=0;e<this.parsers.length;e++){let i=this.parsers[e];if(i.test(t)){r=i.getCacheableAssets(n,t);break}}let i=new Map(Object.entries(r||{}));r||n.forEach(e=>{i.set(e,t)});let a=[...i.keys()],o={cacheKeys:a,keys:n};n.forEach(e=>{this._cacheMap.set(e,o)}),a.forEach(e=>{let n=r?r[e]:t;this._cache.has(e)&&this._cache.get(e)!==n&&ot(`[Cache] already has key:`,e),this._cache.set(e,i.get(e))})}remove(e){if(!this._cacheMap.has(e)){ot(`[Assets] Asset id ${e} was not found in the Cache`);return}let t=this._cacheMap.get(e);t.cacheKeys.forEach(e=>{this._cache.delete(e)}),t.keys.forEach(e=>{this._cacheMap.delete(e)})}get parsers(){return this._parsers}},c4=[];jt.handleByList(W.TextureSource,c4);function l4(e={}){let t=e&&e.resource,n=t?e.resource:e,r=t?e:{resource:e};for(let e=0;e<c4.length;e++){let t=c4[e];if(t.test(n))return new t(r)}throw Error(`Could not find a source type for resource: ${r.resource}`)}function LCe(e={},t=!1){let n=e&&e.resource,r=n?e.resource:e,i=n?e:{resource:e};if(!t&&s4.has(r))return s4.get(r);let a=new et({source:l4(i)});return a.on(`destroy`,()=>{s4.has(r)&&s4.remove(r)}),t||s4.set(r,a),a}function RCe(e,t=!1){return typeof e==`string`?s4.get(e):e instanceof gt?new et({source:e}):LCe(e,t)}et.from=RCe,gt.from=l4,jt.add(t4,n4,r4,ICe,Xt,xt,at);var u4=(e=>(e[e.Low=0]=`Low`,e[e.Normal=1]=`Normal`,e[e.High=2]=`High`,e))(u4||{});function d4(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received ${JSON.stringify(e)}`)}function f4(e){return e.split(`?`)[0].split(`#`)[0]}function zCe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function BCe(e,t,n){return e.replace(new RegExp(zCe(t),`g`),n)}function VCe(e,t){let n=``,r=0,i=-1,a=0,o=-1;for(let s=0;s<=e.length;++s){if(s<e.length)o=e.charCodeAt(s);else if(o===47)break;else o=47;if(o===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){let e=n.lastIndexOf(`/`);if(e!==n.length-1){e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}}else if(n.length===2||n.length===1){n=``,r=0,i=s,a=0;continue}}t&&(n.length>0?n+=`/..`:n=`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===46&&a!==-1?++a:a=-1}return n}var p4={toPosix(e){return BCe(e,`\\`,`/`)},isUrl(e){return/^https?:/.test(this.toPosix(e))},isDataUrl(e){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(e)},isBlobUrl(e){return e.startsWith(`blob:`)},hasProtocol(e){return/^[^/:]+:/.test(this.toPosix(e))},getProtocol(e){d4(e),e=this.toPosix(e);let t=/^file:\/\/\//.exec(e);if(t)return t[0];let n=/^[^/:]+:\/{0,2}/.exec(e);return n?n[0]:``},toAbsolute(e,t,n){if(d4(e),this.isDataUrl(e)||this.isBlobUrl(e))return e;let r=f4(this.toPosix(t??Gt.get().getBaseUrl())),i=f4(this.toPosix(n??this.rootname(r)));return e=this.toPosix(e),e.startsWith(`/`)?p4.join(i,e.slice(1)):this.isAbsolute(e)?e:this.join(r,e)},normalize(e){if(d4(e),e.length===0)return`.`;if(this.isDataUrl(e)||this.isBlobUrl(e))return e;e=this.toPosix(e);let t=``,n=e.startsWith(`/`);this.hasProtocol(e)&&(t=this.rootname(e),e=e.slice(t.length));let r=e.endsWith(`/`);return e=VCe(e,!1),e.length>0&&r&&(e+=`/`),n?`/${e}`:t+e},isAbsolute(e){return d4(e),e=this.toPosix(e),this.hasProtocol(e)?!0:e.startsWith(`/`)},join(...e){if(e.length===0)return`.`;let t;for(let n=0;n<e.length;++n){let r=e[n];if(d4(r),r.length>0)if(t===void 0)t=r;else{let i=e[n-1]??``;this.joinExtensions.includes(this.extname(i).toLowerCase())?t+=`/../${r}`:t+=`/${r}`}}return t===void 0?`.`:this.normalize(t)},dirname(e){if(d4(e),e.length===0)return`.`;e=this.toPosix(e);let t=e.charCodeAt(0),n=t===47,r=-1,i=!0,a=this.getProtocol(e),o=e;e=e.slice(a.length);for(let n=e.length-1;n>=1;--n)if(t=e.charCodeAt(n),t===47){if(!i){r=n;break}}else i=!1;return r===-1?n?`/`:this.isUrl(o)?a+e:a:n&&r===1?`//`:a+e.slice(0,r)},rootname(e){d4(e),e=this.toPosix(e);let t=``;if(t=e.startsWith(`/`)?`/`:this.getProtocol(e),this.isUrl(e)){let n=e.indexOf(`/`,t.length);t=n===-1?e:e.slice(0,n),t.endsWith(`/`)||(t+=`/`)}return t},basename(e,t){d4(e),t&&d4(t),e=f4(this.toPosix(e));let n=0,r=-1,i=!0,a;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return``;let o=t.length-1,s=-1;for(a=e.length-1;a>=0;--a){let c=e.charCodeAt(a);if(c===47){if(!i){n=a+1;break}}else s===-1&&(i=!1,s=a+1),o>=0&&(c===t.charCodeAt(o)?--o===-1&&(r=a):(o=-1,r=s))}return n===r?r=s:r===-1&&(r=e.length),e.slice(n,r)}for(a=e.length-1;a>=0;--a)if(e.charCodeAt(a)===47){if(!i){n=a+1;break}}else r===-1&&(i=!1,r=a+1);return r===-1?``:e.slice(n,r)},extname(e){d4(e),e=f4(this.toPosix(e));let t=-1,n=0,r=-1,i=!0,a=0;for(let o=e.length-1;o>=0;--o){let s=e.charCodeAt(o);if(s===47){if(!i){n=o+1;break}continue}r===-1&&(i=!1,r=o+1),s===46?t===-1?t=o:a!==1&&(a=1):t!==-1&&(a=-1)}return t===-1||r===-1||a===0||a===1&&t===r-1&&t===n+1?``:e.slice(t,r)},parse(e){d4(e);let t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;e=f4(this.toPosix(e));let n=e.charCodeAt(0),r=this.isAbsolute(e),i;t.root=this.rootname(e),i=r||this.hasProtocol(e)?1:0;let a=-1,o=0,s=-1,c=!0,l=e.length-1,u=0;for(;l>=i;--l){if(n=e.charCodeAt(l),n===47){if(!c){o=l+1;break}continue}s===-1&&(c=!1,s=l+1),n===46?a===-1?a=l:u!==1&&(u=1):a!==-1&&(u=-1)}return a===-1||s===-1||u===0||u===1&&a===s-1&&a===o+1?s!==-1&&(o===0&&r?t.base=t.name=e.slice(1,s):t.base=t.name=e.slice(o,s)):(o===0&&r?(t.name=e.slice(1,a),t.base=e.slice(1,s)):(t.name=e.slice(o,a),t.base=e.slice(o,s)),t.ext=e.slice(a,s)),t.dir=this.dirname(e),t},sep:`/`,delimiter:`:`,joinExtensions:[`.html`]};function m4(e,t,n,r,i){let a=t[n];for(let o=0;o<a.length;o++){let s=a[o];n<t.length-1?m4(e.replace(r[n],s),t,n+1,r,i):i.push(e.replace(r[n],s))}}function HCe(e){let t=e.match(/\{(.*?)\}/g),n=[];if(t){let r=[];t.forEach(e=>{let t=e.substring(1,e.length-1).split(`,`);r.push(t)}),m4(e,r,0,t,n)}else n.push(e);return n}var h4=e=>!Array.isArray(e),g4=class{constructor(){this._defaultBundleIdentifierOptions={connector:`-`,createBundleAssetId:(e,t)=>`${e}${this._bundleIdConnector}${t}`,extractAssetIdFromBundle:(e,t)=>t.replace(`${e}${this._bundleIdConnector}`,``)},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle(`foo`,this._createBundleAssetId(`foo`,`bar`))!==`bar`)throw Error(`[Resolver] GenerateBundleAssetId are not working correctly`)}prefer(...e){e.forEach(e=>{this._preferredOrder.push(e),e.priority||=Object.keys(e.params)}),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(e){if(typeof e==`string`)this._defaultSearchParams=e;else{let t=e;this._defaultSearchParams=Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join(`&`)}}getAlias(e){let{alias:t,src:n}=e;return o4(t||n,e=>typeof e==`string`?e:Array.isArray(e)?e.map(e=>e?.src??e):e?.src?e.src:e,!0)}addManifest(e){this._manifest&&ot(`[Resolver] Manifest already exists, this will be overwritten`),this._manifest=e,e.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(e,t){let n=[],r=t;Array.isArray(t)||(r=Object.entries(t).map(([e,t])=>typeof t==`string`||Array.isArray(t)?{alias:e,src:t}:{alias:e,...t})),r.forEach(t=>{let r=t.src,i=t.alias,a;if(typeof i==`string`){let t=this._createBundleAssetId(e,i);n.push(t),a=[i,t]}else{let t=i.map(t=>this._createBundleAssetId(e,t));n.push(...t),a=[...i,...t]}this.add({...t,alias:a,src:r})}),this._bundles[e]=n}add(e){let t=[];Array.isArray(e)?t.push(...e):t.push(e);let n=e=>{this.hasKey(e)&&ot(`[Resolver] already has key: ${e} overwriting`)};o4(t).forEach(e=>{let{src:t}=e,{data:r,format:i,loadParser:a,parser:o}=e,s=o4(t).map(e=>typeof e==`string`?HCe(e):Array.isArray(e)?e:[e]),c=this.getAlias(e);Array.isArray(c)?c.forEach(n):n(c);let l=[],u=e=>({src:e,...this._parsers.find(t=>t.test(e))?.parse(e)});s.forEach(t=>{t.forEach(t=>{let n={};if(typeof t==`object`?(r=t.data??r,i=t.format??i,(t.loadParser||t.parser)&&(a=t.loadParser??a,o=t.parser??o),n={...u(t.src),...t}):n=u(t),!c)throw Error(`[Resolver] alias is undefined for this asset: ${n.src}`);n=this._buildResolvedAsset(n,{aliases:c,data:r,format:i,loadParser:a,parser:o,progressSize:e.progressSize}),l.push(n)})}),c.forEach(e=>{this._assetMap[e]=l})})}resolveBundle(e){let t=h4(e);e=o4(e);let n={};return e.forEach(e=>{let t=this._bundles[e];if(t){let r=this.resolve(t),i={};for(let t in r){let n=r[t];i[this._extractAssetIdFromBundle(e,t)]=n}n[e]=i}}),t?n[e[0]]:n}resolveUrl(e){let t=this.resolve(e);if(typeof e!=`string`){let e={};for(let n in t)e[n]=t[n].src;return e}return t.src}resolve(e){let t=h4(e);e=o4(e);let n={};return e.forEach(e=>{if(!this._resolverHash[e])if(this._assetMap[e]){let t=this._assetMap[e],n=this._getPreferredOrder(t);n?.priority.forEach(e=>{n.params[e].forEach(n=>{let r=t.filter(t=>t[e]?t[e]===n:!1);r.length&&(t=r)})}),this._resolverHash[e]=t[0]}else this._resolverHash[e]=this._buildResolvedAsset({alias:[e],src:e},{});n[e]=this._resolverHash[e]}),t?n[e[0]]:n}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let t=0;t<e.length;t++){let n=e[t],r=this._preferredOrder.find(e=>e.params.format.includes(n.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(e){return this._defaultSearchParams?`${e}${/\?/.test(e)?`&`:`?`}${this._defaultSearchParams}`:e}_buildResolvedAsset(e,t){let{aliases:n,data:r,loadParser:i,parser:a,format:o,progressSize:s}=t;return(this._basePath||this._rootPath)&&(e.src=p4.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=n??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...r||{},...e.data},e.loadParser=i??e.loadParser,e.parser=a??e.parser,e.format=o??e.format??UCe(e.src),s!==void 0&&(e.progressSize=s),e}};g4.RETINA_PREFIX=/@([0-9\.]+)x/;function UCe(e){return e.split(`.`).pop().split(`?`).shift().split(`#`).shift()}var _4=(e,t)=>{let n=t.split(`?`)[1];return n&&(e+=`?${n}`),e},v4=class e{constructor(e,t){this.linkedSheets=[];let n=e;e?.source instanceof gt&&(n={texture:e,data:t});let{texture:r,data:i,cachePrefix:a=``}=n;this.cachePrefix=a,this._texture=r instanceof et?r:null,this.textureSource=r.source,this.textures={},this.animations={},this.data=i;let o=parseFloat(i.meta.scale);o?(this.resolution=o,r.source.resolution=this.resolution):this.resolution=r.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=e.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(t,n=!1){let r=t,i=n?1/0:e.BATCH_SIZE;for(;r-t<i&&r<this._frameKeys.length;){let e=this._frameKeys[r],t=this._frames[e],n=t.frame;if(n){let r=null,i=null,a=t.trimmed!==!1&&t.sourceSize?t.sourceSize:t.frame,o=new bt(0,0,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution);r=t.rotated?new bt(Math.floor(n.x)/this.resolution,Math.floor(n.y)/this.resolution,Math.floor(n.h)/this.resolution,Math.floor(n.w)/this.resolution):new bt(Math.floor(n.x)/this.resolution,Math.floor(n.y)/this.resolution,Math.floor(n.w)/this.resolution,Math.floor(n.h)/this.resolution),t.trimmed!==!1&&t.spriteSourceSize&&(i=new bt(Math.floor(t.spriteSourceSize.x)/this.resolution,Math.floor(t.spriteSourceSize.y)/this.resolution,Math.floor(n.w)/this.resolution,Math.floor(n.h)/this.resolution)),this.textures[e]=new et({source:this.textureSource,frame:r,orig:o,trim:i,rotate:t.rotated?2:0,defaultAnchor:t.anchor,defaultBorders:t.borders,label:e.toString()})}r++}}_processAnimations(){let e=this.data.animations||{};for(let t in e){this.animations[t]=[];for(let n=0;n<e[t].length;n++){let r=e[t][n];this.animations[t].push(this.textures[r])}}}_parseComplete(){let e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*e.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*e.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(e=!1){for(let e in this.textures)this.textures[e].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&(this._texture?.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};v4.BATCH_SIZE=1e3;var y4=v4,WCe=[`jpg`,`png`,`jpeg`,`avif`,`webp`,`basis`,`etc2`,`bc7`,`bc6h`,`bc5`,`bc4`,`bc3`,`bc2`,`bc1`,`eac`,`astc`];function b4(e,t,n){let r={};if(e.forEach(e=>{r[e]=t}),Object.keys(t.textures).forEach(e=>{r[`${t.cachePrefix}${e}`]=t.textures[e]}),!n){let n=p4.dirname(e[0]);t.linkedSheets.forEach((e,i)=>{let a=b4([`${n}/${t.data.meta.related_multi_packs[i]}`],e,!0);Object.assign(r,a)})}return r}var GCe={extension:W.Asset,cache:{test:e=>e instanceof y4,getCacheableAssets:(e,t)=>b4(e,t,!1)},resolver:{extension:{type:W.ResolveParser,name:`resolveSpritesheet`},test:e=>{let t=e.split(`?`)[0].split(`.`),n=t.pop(),r=t.pop();return n===`json`&&WCe.includes(r)},parse:e=>{let t=e.split(`.`);return{resolution:parseFloat(g4.RETINA_PREFIX.exec(e)?.[1]??`1`),format:t[t.length-2],src:e}}},loader:{name:`spritesheetLoader`,id:`spritesheet`,extension:{type:W.LoadParser,priority:u4.Normal,name:`spritesheetLoader`},async testParse(e,t){return p4.extname(t.src).toLowerCase()===`.json`&&!!e.frames},async parse(e,t,n){let{texture:r,imageFilename:i,textureOptions:a,cachePrefix:o}=t?.data??{},s=p4.dirname(t.src);s&&s.lastIndexOf(`/`)!==s.length-1&&(s+=`/`);let c;if(r instanceof et)c=r;else{let r=_4(s+(i??e.meta.image),t.src);c=(await n.load([{src:r,data:a}]))[r]}let l=new y4({texture:c.source,data:e,cachePrefix:o});await l.parse();let u=e?.meta?.related_multi_packs;if(Array.isArray(u)){let e=[];for(let r of u){if(typeof r!=`string`)continue;let i=s+r;t.data?.ignoreMultiPack||(i=_4(i,t.src),e.push(n.load({src:i,data:{textureOptions:a,ignoreMultiPack:!0}})))}let r=await Promise.all(e);l.linkedSheets=r,r.forEach(e=>{e.linkedSheets=[l].concat(l.linkedSheets.filter(t=>t!==e))})}return l},async unload(e,t,n){await n.unload(e.textureSource._sourceOrigin),e.destroy(!1)}}};jt.add(GCe);var KCe=class{constructor(e){this._lastTransform=``,this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{if(!this._canvas)return;let e=this._canvas.getBoundingClientRect(),t=this._canvas.width,n=this._canvas.height,r=e.width/t*this._renderer.resolution,i=e.height/n*this._renderer.resolution,a=`translate(${e.left}px, ${e.top}px) scale(${r}, ${i})`;a!==this._lastTransform&&(this._domElement.style.transform=a,this._lastTransform=a)},this._domElement=e.domElement,this._renderer=e.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver())}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())}_attachObserver(){`ResizeObserver`in globalThis?(this._observer&&=(this._observer.disconnect(),null),this._observer=new ResizeObserver(e=>{for(let t of e){if(t.target!==this._canvas)continue;let e=this.canvas.width,n=this.canvas.height,r=t.contentRect.width/e*this._renderer.resolution,i=t.contentRect.height/n*this._renderer.resolution;(this._lastScaleX!==r||this._lastScaleY!==i)&&(this.updateTranslation(),this._lastScaleX=r,this._lastScaleY=i)}}),this._observer.observe(this._canvas)):this._tickerAttached||kt.shared.add(this.updateTranslation,this,Ot.HIGH)}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&kt.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform=``,this._lastScaleX=null,this._lastScaleY=null}},x4=class e{constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=e.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Et,this.page=new Et,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,n){throw Error(`initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.`)}initUIEvent(e,t,n,r,i){throw Error(`initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.`)}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}},S4=/iPhone/i,C4=/iPod/i,w4=/iPad/i,T4=/\biOS-universal(?:.+)Mac\b/i,E4=/\bAndroid(?:.+)Mobile\b/i,D4=/Android/i,O4=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,k4=/Silk/i,A4=/Windows Phone/i,j4=/\bWindows(?:.+)ARM\b/i,M4=/BlackBerry/i,N4=/BB10/i,P4=/Opera Mini/i,F4=/\b(CriOS|Chrome)(?:.+)Mobile/i,I4=/Mobile(?:.+)Firefox\b/i,L4=function(e){return e!==void 0&&e.platform===`MacIntel`&&typeof e.maxTouchPoints==`number`&&e.maxTouchPoints>1&&typeof MSStream>`u`};function qCe(e){return function(t){return t.test(e)}}function R4(e){var t={userAgent:``,platform:``,maxTouchPoints:0};!e&&typeof navigator<`u`?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof e==`string`?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0});var n=t.userAgent,r=n.split(`[FBAN`);r[1]!==void 0&&(n=r[0]),r=n.split(`Twitter`),r[1]!==void 0&&(n=r[0]);var i=qCe(n),a={apple:{phone:i(S4)&&!i(A4),ipod:i(C4),tablet:!i(S4)&&(i(w4)||L4(t))&&!i(A4),universal:i(T4),device:(i(S4)||i(C4)||i(w4)||i(T4)||L4(t))&&!i(A4)},amazon:{phone:i(O4),tablet:!i(O4)&&i(k4),device:i(O4)||i(k4)},android:{phone:!i(A4)&&i(O4)||!i(A4)&&i(E4),tablet:!i(A4)&&!i(O4)&&!i(E4)&&(i(k4)||i(D4)),device:!i(A4)&&(i(O4)||i(k4)||i(E4)||i(D4))||i(/\bokhttp\b/i)},windows:{phone:i(A4),tablet:i(j4),device:i(A4)||i(j4)},other:{blackberry:i(M4),blackberry10:i(N4),opera:i(P4),firefox:i(I4),chrome:i(F4),device:i(M4)||i(N4)||i(P4)||i(I4)||i(F4)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}var JCe=(R4.default??R4)(globalThis.navigator),YCe=9,z4=100,XCe=0,ZCe=0,B4=2,V4=1,QCe=-1e3,$Ce=-1e3,ewe=2,H4=class e{constructor(e,t=JCe){this._mobileInfo=t,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pools={},this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._isRunningTests=!1,this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnMouseMove=this._onMouseMove.bind(this),this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}get div(){return this._div}_createTouchHook(){let e=document.createElement(`button`);e.style.width=`${V4}px`,e.style.height=`${V4}px`,e.style.position=`absolute`,e.style.top=`${QCe}px`,e.style.left=`${$Ce}px`,e.style.zIndex=ewe.toString(),e.style.backgroundColor=`#FF0000`,e.title=`select to enable accessibility for this content`,e.addEventListener(`focus`,()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&=(document.body.removeChild(this._hookDiv),null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement(`div`),this._div.style.position=`absolute`,this._div.style.top=`${XCe}px`,this._div.style.left=`${ZCe}px`,this._div.style.pointerEvents=`none`,this._div.style.zIndex=B4.toString(),this._canvasObserver=new KCe({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&globalThis.addEventListener(`keydown`,this._boundOnKeyDown,!1),this._deactivateOnMouseMove&&globalThis.document.addEventListener(`mousemove`,this._boundOnMouseMove,!0);let e=this._renderer.view.canvas;if(e.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else{let t=new MutationObserver(()=>{e.parentNode&&(t.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())});t.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=!1,globalThis.document.removeEventListener(`mousemove`,this._boundOnMouseMove,!0),this._activateOnTab&&globalThis.addEventListener(`keydown`,this._boundOnKeyDown,!1),this._renderer.runners.postrender.remove(this);for(let e of this._children)e._accessibleDiv?.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=!1;for(let e in this._pools)this._pools[e].forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),delete this._pools[e];this._div?.parentNode&&this._div.parentNode.removeChild(this._div),this._pools={},this._children=[]}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);let t=e.children;if(t)for(let e=0;e<t.length;e++)this._updateAccessibleObjects(t[e])}init(t){let n={accessibilityOptions:{...e.defaultOptions,...t?.accessibilityOptions||{}}};this.debug=n.accessibilityOptions.debug,this._activateOnTab=n.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=n.accessibilityOptions.deactivateOnMouseMove,n.accessibilityOptions.enabledByDefault&&this._activate(),this._renderer.runners.postrender.remove(this)}postrender(){let e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,(!this._renderer.renderingToScreen||!this._renderer.view.canvas)&&!this._isRunningTests))return;let t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(let e of this._children)e._renderId===this._renderId&&t.add(this._children.indexOf(e))}for(let e=this._children.length-1;e>=0;e--){let n=this._children[e];t.has(e)||(n._accessibleDiv&&n._accessibleDiv.parentNode&&(n._accessibleDiv.parentNode.removeChild(n._accessibleDiv),this._getPool(n.accessibleType).push(n._accessibleDiv),n._accessibleDiv=null),n._accessibleActive=!1,ut(this._children,e,1))}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let e=0;e<this._children.length;e++){let t=this._children[e];if(!t._accessibleActive||!t._accessibleDiv)continue;let n=t._accessibleDiv,r=t.hitArea||t.getBounds().rectangle;if(t.hitArea){let e=t.worldTransform;n.style.left=`${e.tx+r.x*e.a}px`,n.style.top=`${e.ty+r.y*e.d}px`,n.style.width=`${r.width*e.a}px`,n.style.height=`${r.height*e.d}px`}else this._capHitArea(r),n.style.left=`${r.x}px`,n.style.top=`${r.y}px`,n.style.width=`${r.width}px`,n.style.height=`${r.height}px`}this._renderId++}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);let{width:t,height:n}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>n&&(e.height=n-e.y)}_addChild(e){let t=this._getPool(e.accessibleType).pop();t?(t.innerHTML=``,t.removeAttribute(`title`),t.removeAttribute(`aria-label`),t.tabIndex=0):(e.accessibleType===`button`?t=document.createElement(`button`):(t=document.createElement(e.accessibleType),t.style.cssText=`
950
+ </dialog>`:e}};customElements.define(`input-panel`,jCe);var MCe={extension:{type:W.Environment,name:`browser`,priority:-1},test:()=>!0,load:async()=>{await q(()=>import(`./browserAll-CDjVpdx6.js`),__vite__mapDeps([127,128,1,129]))}},NCe={extension:{type:W.Environment,name:`webworker`,priority:0},test:()=>typeof self<`u`&&self.WorkerGlobalScope!==void 0,load:async()=>{await q(()=>import(`./webworkerAll-CRDyRj3u.js`),__vite__mapDeps([130,128,1,129]))}},PCe=new mt;function Q2(e,t,n){let r=PCe;e.measurable=!0,Nt(e,n,r),t.addBoundsMask(r),e.measurable=!1}function $2(e,t,n){let r=$e.get();e.measurable=!0;let i=Mt.get().identity();ht(e,r,e4(e,n,i)),e.measurable=!1,t.addBoundsMask(r),Mt.return(i),$e.return(r)}function e4(e,t,n){return e?(e!==t&&(e4(e.parent,t,n),e.updateLocalTransform(),n.append(e.localTransform)),n):(ot(`Mask bounds, renderable is not inside the root container`),n)}var t4=class{constructor(e){this.priority=0,this.inverse=!1,this.pipe=`alphaMask`,e?.mask&&this.init(e.mask)}init(e){this.mask=e,this.renderMaskToTexture=!(e instanceof Jt),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask=null)}addBounds(e,t){this.inverse||Q2(this.mask,e,t)}addLocalBounds(e,t){$2(this.mask,e,t)}containsPoint(e,t){let n=this.mask;return t(n,e)}destroy(){this.reset()}static test(e){return e instanceof Jt}};t4.extension=W.MaskEffect;var n4=class{constructor(e){this.priority=0,this.pipe=`colorMask`,e?.mask&&this.init(e.mask)}init(e){this.mask=e}destroy(){}static test(e){return typeof e==`number`}};n4.extension=W.MaskEffect;var r4=class{constructor(e){this.priority=0,this.pipe=`stencilMask`,e?.mask&&this.init(e.mask)}init(e){this.mask=e,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(e,t){Q2(this.mask,e,t)}addLocalBounds(e,t){$2(this.mask,e,t)}containsPoint(e,t){let n=this.mask;return t(n,e)}destroy(){this.reset()}static test(e){return e instanceof qt}};r4.extension=W.MaskEffect;var i4;async function FCe(){return i4??=(async()=>{let e=Gt.get().createCanvas(1,1).getContext(`webgl`);if(!e)return`premultiply-alpha-on-upload`;let t=await new Promise(e=>{let t=document.createElement(`video`);t.onloadeddata=()=>e(t),t.onerror=()=>e(null),t.autoplay=!1,t.crossOrigin=`anonymous`,t.preload=`auto`,t.src=`data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=`,t.load()});if(!t)return`premultiply-alpha-on-upload`;let n=e.createTexture();e.bindTexture(e.TEXTURE_2D,n);let r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t);let i=new Uint8Array(4);return e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,i),e.deleteFramebuffer(r),e.deleteTexture(n),e.getExtension(`WEBGL_lose_context`)?.loseContext(),i[0]<=i[3]?`premultiplied-alpha`:`premultiply-alpha-on-upload`})(),i4}var a4=class e extends gt{constructor(t){super(t),this.isReady=!1,this.uploadMethodId=`video`,t={...e.defaultOptions,...t},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this.alphaMode=t.alphaMode??`premultiply-alpha-on-upload`,this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),t.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){let e=kt.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;let e=this.resource,t=this.options;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener(`play`,this._onPlayStart),e.addEventListener(`pause`,this._onPlayStop),e.addEventListener(`seeked`,this._onSeeked),this._isSourceReady()?this._mediaReady():(t.preload||e.addEventListener(`canplay`,this._onCanPlay),e.addEventListener(`canplaythrough`,this._onCanPlayThrough),e.addEventListener(`error`,this._onError,!0)),this.alphaMode=await FCe(),this._load=new Promise((n,r)=>{this.isValid?n(this):(this._resolve=n,this._reject=r,t.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${t.preloadTimeoutMs}ms`))})),e.load())}),this._load}_onError(e){this.resource.removeEventListener(`error`,this._onError,!0),this.emit(`error`,e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){let e=this.resource;return!e.paused&&!e.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onCanPlay(){this.resource.removeEventListener(`canplay`,this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener(`canplaythrough`,this._onCanPlay),this._preloadTimeout&&=(clearTimeout(this._preloadTimeout),void 0),this._mediaReady()}_mediaReady(){let e=this.resource;this.isValid&&(this.isReady=!0,this.resize(e.videoWidth,e.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();let e=this.resource;e&&(e.removeEventListener(`play`,this._onPlayStart),e.removeEventListener(`pause`,this._onPlayStop),e.removeEventListener(`seeked`,this._onSeeked),e.removeEventListener(`canplay`,this._onCanPlay),e.removeEventListener(`canplaythrough`,this._onCanPlayThrough),e.removeEventListener(`error`,this._onError,!0),e.pause(),e.src=``,e.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(kt.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(kt.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(kt.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement}};a4.extension=W.TextureSource,a4.defaultOptions={...gt.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1},a4.MIME_TYPES={ogv:`video/ogg`,mov:`video/quicktime`,m4v:`video/mp4`};var ICe=a4,o4=(e,t,n=!1)=>(Array.isArray(e)||(e=[e]),t?e.map(e=>typeof e==`string`||n?t(e):e):e),s4=new class{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(e){return this._cache.has(e)}get(e){let t=this._cache.get(e);return t||ot(`[Assets] Asset id ${e} was not found in the Cache`),t}set(e,t){let n=o4(e),r;for(let e=0;e<this.parsers.length;e++){let i=this.parsers[e];if(i.test(t)){r=i.getCacheableAssets(n,t);break}}let i=new Map(Object.entries(r||{}));r||n.forEach(e=>{i.set(e,t)});let a=[...i.keys()],o={cacheKeys:a,keys:n};n.forEach(e=>{this._cacheMap.set(e,o)}),a.forEach(e=>{let n=r?r[e]:t;this._cache.has(e)&&this._cache.get(e)!==n&&ot(`[Cache] already has key:`,e),this._cache.set(e,i.get(e))})}remove(e){if(!this._cacheMap.has(e)){ot(`[Assets] Asset id ${e} was not found in the Cache`);return}let t=this._cacheMap.get(e);t.cacheKeys.forEach(e=>{this._cache.delete(e)}),t.keys.forEach(e=>{this._cacheMap.delete(e)})}get parsers(){return this._parsers}},c4=[];jt.handleByList(W.TextureSource,c4);function l4(e={}){let t=e&&e.resource,n=t?e.resource:e,r=t?e:{resource:e};for(let e=0;e<c4.length;e++){let t=c4[e];if(t.test(n))return new t(r)}throw Error(`Could not find a source type for resource: ${r.resource}`)}function LCe(e={},t=!1){let n=e&&e.resource,r=n?e.resource:e,i=n?e:{resource:e};if(!t&&s4.has(r))return s4.get(r);let a=new et({source:l4(i)});return a.on(`destroy`,()=>{s4.has(r)&&s4.remove(r)}),t||s4.set(r,a),a}function RCe(e,t=!1){return typeof e==`string`?s4.get(e):e instanceof gt?new et({source:e}):LCe(e,t)}et.from=RCe,gt.from=l4,jt.add(t4,n4,r4,ICe,Xt,xt,at);var u4=(e=>(e[e.Low=0]=`Low`,e[e.Normal=1]=`Normal`,e[e.High=2]=`High`,e))(u4||{});function d4(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received ${JSON.stringify(e)}`)}function f4(e){return e.split(`?`)[0].split(`#`)[0]}function zCe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function BCe(e,t,n){return e.replace(new RegExp(zCe(t),`g`),n)}function VCe(e,t){let n=``,r=0,i=-1,a=0,o=-1;for(let s=0;s<=e.length;++s){if(s<e.length)o=e.charCodeAt(s);else if(o===47)break;else o=47;if(o===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){let e=n.lastIndexOf(`/`);if(e!==n.length-1){e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}}else if(n.length===2||n.length===1){n=``,r=0,i=s,a=0;continue}}t&&(n.length>0?n+=`/..`:n=`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===46&&a!==-1?++a:a=-1}return n}var p4={toPosix(e){return BCe(e,`\\`,`/`)},isUrl(e){return/^https?:/.test(this.toPosix(e))},isDataUrl(e){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(e)},isBlobUrl(e){return e.startsWith(`blob:`)},hasProtocol(e){return/^[^/:]+:/.test(this.toPosix(e))},getProtocol(e){d4(e),e=this.toPosix(e);let t=/^file:\/\/\//.exec(e);if(t)return t[0];let n=/^[^/:]+:\/{0,2}/.exec(e);return n?n[0]:``},toAbsolute(e,t,n){if(d4(e),this.isDataUrl(e)||this.isBlobUrl(e))return e;let r=f4(this.toPosix(t??Gt.get().getBaseUrl())),i=f4(this.toPosix(n??this.rootname(r)));return e=this.toPosix(e),e.startsWith(`/`)?p4.join(i,e.slice(1)):this.isAbsolute(e)?e:this.join(r,e)},normalize(e){if(d4(e),e.length===0)return`.`;if(this.isDataUrl(e)||this.isBlobUrl(e))return e;e=this.toPosix(e);let t=``,n=e.startsWith(`/`);this.hasProtocol(e)&&(t=this.rootname(e),e=e.slice(t.length));let r=e.endsWith(`/`);return e=VCe(e,!1),e.length>0&&r&&(e+=`/`),n?`/${e}`:t+e},isAbsolute(e){return d4(e),e=this.toPosix(e),this.hasProtocol(e)?!0:e.startsWith(`/`)},join(...e){if(e.length===0)return`.`;let t;for(let n=0;n<e.length;++n){let r=e[n];if(d4(r),r.length>0)if(t===void 0)t=r;else{let i=e[n-1]??``;this.joinExtensions.includes(this.extname(i).toLowerCase())?t+=`/../${r}`:t+=`/${r}`}}return t===void 0?`.`:this.normalize(t)},dirname(e){if(d4(e),e.length===0)return`.`;e=this.toPosix(e);let t=e.charCodeAt(0),n=t===47,r=-1,i=!0,a=this.getProtocol(e),o=e;e=e.slice(a.length);for(let n=e.length-1;n>=1;--n)if(t=e.charCodeAt(n),t===47){if(!i){r=n;break}}else i=!1;return r===-1?n?`/`:this.isUrl(o)?a+e:a:n&&r===1?`//`:a+e.slice(0,r)},rootname(e){d4(e),e=this.toPosix(e);let t=``;if(t=e.startsWith(`/`)?`/`:this.getProtocol(e),this.isUrl(e)){let n=e.indexOf(`/`,t.length);t=n===-1?e:e.slice(0,n),t.endsWith(`/`)||(t+=`/`)}return t},basename(e,t){d4(e),t&&d4(t),e=f4(this.toPosix(e));let n=0,r=-1,i=!0,a;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return``;let o=t.length-1,s=-1;for(a=e.length-1;a>=0;--a){let c=e.charCodeAt(a);if(c===47){if(!i){n=a+1;break}}else s===-1&&(i=!1,s=a+1),o>=0&&(c===t.charCodeAt(o)?--o===-1&&(r=a):(o=-1,r=s))}return n===r?r=s:r===-1&&(r=e.length),e.slice(n,r)}for(a=e.length-1;a>=0;--a)if(e.charCodeAt(a)===47){if(!i){n=a+1;break}}else r===-1&&(i=!1,r=a+1);return r===-1?``:e.slice(n,r)},extname(e){d4(e),e=f4(this.toPosix(e));let t=-1,n=0,r=-1,i=!0,a=0;for(let o=e.length-1;o>=0;--o){let s=e.charCodeAt(o);if(s===47){if(!i){n=o+1;break}continue}r===-1&&(i=!1,r=o+1),s===46?t===-1?t=o:a!==1&&(a=1):t!==-1&&(a=-1)}return t===-1||r===-1||a===0||a===1&&t===r-1&&t===n+1?``:e.slice(t,r)},parse(e){d4(e);let t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;e=f4(this.toPosix(e));let n=e.charCodeAt(0),r=this.isAbsolute(e),i;t.root=this.rootname(e),i=r||this.hasProtocol(e)?1:0;let a=-1,o=0,s=-1,c=!0,l=e.length-1,u=0;for(;l>=i;--l){if(n=e.charCodeAt(l),n===47){if(!c){o=l+1;break}continue}s===-1&&(c=!1,s=l+1),n===46?a===-1?a=l:u!==1&&(u=1):a!==-1&&(u=-1)}return a===-1||s===-1||u===0||u===1&&a===s-1&&a===o+1?s!==-1&&(o===0&&r?t.base=t.name=e.slice(1,s):t.base=t.name=e.slice(o,s)):(o===0&&r?(t.name=e.slice(1,a),t.base=e.slice(1,s)):(t.name=e.slice(o,a),t.base=e.slice(o,s)),t.ext=e.slice(a,s)),t.dir=this.dirname(e),t},sep:`/`,delimiter:`:`,joinExtensions:[`.html`]};function m4(e,t,n,r,i){let a=t[n];for(let o=0;o<a.length;o++){let s=a[o];n<t.length-1?m4(e.replace(r[n],s),t,n+1,r,i):i.push(e.replace(r[n],s))}}function HCe(e){let t=e.match(/\{(.*?)\}/g),n=[];if(t){let r=[];t.forEach(e=>{let t=e.substring(1,e.length-1).split(`,`);r.push(t)}),m4(e,r,0,t,n)}else n.push(e);return n}var h4=e=>!Array.isArray(e),g4=class{constructor(){this._defaultBundleIdentifierOptions={connector:`-`,createBundleAssetId:(e,t)=>`${e}${this._bundleIdConnector}${t}`,extractAssetIdFromBundle:(e,t)=>t.replace(`${e}${this._bundleIdConnector}`,``)},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle(`foo`,this._createBundleAssetId(`foo`,`bar`))!==`bar`)throw Error(`[Resolver] GenerateBundleAssetId are not working correctly`)}prefer(...e){e.forEach(e=>{this._preferredOrder.push(e),e.priority||=Object.keys(e.params)}),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(e){if(typeof e==`string`)this._defaultSearchParams=e;else{let t=e;this._defaultSearchParams=Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join(`&`)}}getAlias(e){let{alias:t,src:n}=e;return o4(t||n,e=>typeof e==`string`?e:Array.isArray(e)?e.map(e=>e?.src??e):e?.src?e.src:e,!0)}addManifest(e){this._manifest&&ot(`[Resolver] Manifest already exists, this will be overwritten`),this._manifest=e,e.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(e,t){let n=[],r=t;Array.isArray(t)||(r=Object.entries(t).map(([e,t])=>typeof t==`string`||Array.isArray(t)?{alias:e,src:t}:{alias:e,...t})),r.forEach(t=>{let r=t.src,i=t.alias,a;if(typeof i==`string`){let t=this._createBundleAssetId(e,i);n.push(t),a=[i,t]}else{let t=i.map(t=>this._createBundleAssetId(e,t));n.push(...t),a=[...i,...t]}this.add({...t,alias:a,src:r})}),this._bundles[e]=n}add(e){let t=[];Array.isArray(e)?t.push(...e):t.push(e);let n=e=>{this.hasKey(e)&&ot(`[Resolver] already has key: ${e} overwriting`)};o4(t).forEach(e=>{let{src:t}=e,{data:r,format:i,loadParser:a,parser:o}=e,s=o4(t).map(e=>typeof e==`string`?HCe(e):Array.isArray(e)?e:[e]),c=this.getAlias(e);Array.isArray(c)?c.forEach(n):n(c);let l=[],u=e=>({src:e,...this._parsers.find(t=>t.test(e))?.parse(e)});s.forEach(t=>{t.forEach(t=>{let n={};if(typeof t==`object`?(r=t.data??r,i=t.format??i,(t.loadParser||t.parser)&&(a=t.loadParser??a,o=t.parser??o),n={...u(t.src),...t}):n=u(t),!c)throw Error(`[Resolver] alias is undefined for this asset: ${n.src}`);n=this._buildResolvedAsset(n,{aliases:c,data:r,format:i,loadParser:a,parser:o,progressSize:e.progressSize}),l.push(n)})}),c.forEach(e=>{this._assetMap[e]=l})})}resolveBundle(e){let t=h4(e);e=o4(e);let n={};return e.forEach(e=>{let t=this._bundles[e];if(t){let r=this.resolve(t),i={};for(let t in r){let n=r[t];i[this._extractAssetIdFromBundle(e,t)]=n}n[e]=i}}),t?n[e[0]]:n}resolveUrl(e){let t=this.resolve(e);if(typeof e!=`string`){let e={};for(let n in t)e[n]=t[n].src;return e}return t.src}resolve(e){let t=h4(e);e=o4(e);let n={};return e.forEach(e=>{if(!this._resolverHash[e])if(this._assetMap[e]){let t=this._assetMap[e],n=this._getPreferredOrder(t);n?.priority.forEach(e=>{n.params[e].forEach(n=>{let r=t.filter(t=>t[e]?t[e]===n:!1);r.length&&(t=r)})}),this._resolverHash[e]=t[0]}else this._resolverHash[e]=this._buildResolvedAsset({alias:[e],src:e},{});n[e]=this._resolverHash[e]}),t?n[e[0]]:n}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let t=0;t<e.length;t++){let n=e[t],r=this._preferredOrder.find(e=>e.params.format.includes(n.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(e){return this._defaultSearchParams?`${e}${/\?/.test(e)?`&`:`?`}${this._defaultSearchParams}`:e}_buildResolvedAsset(e,t){let{aliases:n,data:r,loadParser:i,parser:a,format:o,progressSize:s}=t;return(this._basePath||this._rootPath)&&(e.src=p4.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=n??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...r||{},...e.data},e.loadParser=i??e.loadParser,e.parser=a??e.parser,e.format=o??e.format??UCe(e.src),s!==void 0&&(e.progressSize=s),e}};g4.RETINA_PREFIX=/@([0-9\.]+)x/;function UCe(e){return e.split(`.`).pop().split(`?`).shift().split(`#`).shift()}var _4=(e,t)=>{let n=t.split(`?`)[1];return n&&(e+=`?${n}`),e},v4=class e{constructor(e,t){this.linkedSheets=[];let n=e;e?.source instanceof gt&&(n={texture:e,data:t});let{texture:r,data:i,cachePrefix:a=``}=n;this.cachePrefix=a,this._texture=r instanceof et?r:null,this.textureSource=r.source,this.textures={},this.animations={},this.data=i;let o=parseFloat(i.meta.scale);o?(this.resolution=o,r.source.resolution=this.resolution):this.resolution=r.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=e.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(t,n=!1){let r=t,i=n?1/0:e.BATCH_SIZE;for(;r-t<i&&r<this._frameKeys.length;){let e=this._frameKeys[r],t=this._frames[e],n=t.frame;if(n){let r=null,i=null,a=t.trimmed!==!1&&t.sourceSize?t.sourceSize:t.frame,o=new bt(0,0,Math.floor(a.w)/this.resolution,Math.floor(a.h)/this.resolution);r=t.rotated?new bt(Math.floor(n.x)/this.resolution,Math.floor(n.y)/this.resolution,Math.floor(n.h)/this.resolution,Math.floor(n.w)/this.resolution):new bt(Math.floor(n.x)/this.resolution,Math.floor(n.y)/this.resolution,Math.floor(n.w)/this.resolution,Math.floor(n.h)/this.resolution),t.trimmed!==!1&&t.spriteSourceSize&&(i=new bt(Math.floor(t.spriteSourceSize.x)/this.resolution,Math.floor(t.spriteSourceSize.y)/this.resolution,Math.floor(n.w)/this.resolution,Math.floor(n.h)/this.resolution)),this.textures[e]=new et({source:this.textureSource,frame:r,orig:o,trim:i,rotate:t.rotated?2:0,defaultAnchor:t.anchor,defaultBorders:t.borders,label:e.toString()})}r++}}_processAnimations(){let e=this.data.animations||{};for(let t in e){this.animations[t]=[];for(let n=0;n<e[t].length;n++){let r=e[t][n];this.animations[t].push(this.textures[r])}}}_parseComplete(){let e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*e.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*e.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(e=!1){for(let e in this.textures)this.textures[e].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&(this._texture?.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};v4.BATCH_SIZE=1e3;var y4=v4,WCe=[`jpg`,`png`,`jpeg`,`avif`,`webp`,`basis`,`etc2`,`bc7`,`bc6h`,`bc5`,`bc4`,`bc3`,`bc2`,`bc1`,`eac`,`astc`];function b4(e,t,n){let r={};if(e.forEach(e=>{r[e]=t}),Object.keys(t.textures).forEach(e=>{r[`${t.cachePrefix}${e}`]=t.textures[e]}),!n){let n=p4.dirname(e[0]);t.linkedSheets.forEach((e,i)=>{let a=b4([`${n}/${t.data.meta.related_multi_packs[i]}`],e,!0);Object.assign(r,a)})}return r}var GCe={extension:W.Asset,cache:{test:e=>e instanceof y4,getCacheableAssets:(e,t)=>b4(e,t,!1)},resolver:{extension:{type:W.ResolveParser,name:`resolveSpritesheet`},test:e=>{let t=e.split(`?`)[0].split(`.`),n=t.pop(),r=t.pop();return n===`json`&&WCe.includes(r)},parse:e=>{let t=e.split(`.`);return{resolution:parseFloat(g4.RETINA_PREFIX.exec(e)?.[1]??`1`),format:t[t.length-2],src:e}}},loader:{name:`spritesheetLoader`,id:`spritesheet`,extension:{type:W.LoadParser,priority:u4.Normal,name:`spritesheetLoader`},async testParse(e,t){return p4.extname(t.src).toLowerCase()===`.json`&&!!e.frames},async parse(e,t,n){let{texture:r,imageFilename:i,textureOptions:a,cachePrefix:o}=t?.data??{},s=p4.dirname(t.src);s&&s.lastIndexOf(`/`)!==s.length-1&&(s+=`/`);let c;if(r instanceof et)c=r;else{let r=_4(s+(i??e.meta.image),t.src);c=(await n.load([{src:r,data:a}]))[r]}let l=new y4({texture:c.source,data:e,cachePrefix:o});await l.parse();let u=e?.meta?.related_multi_packs;if(Array.isArray(u)){let e=[];for(let r of u){if(typeof r!=`string`)continue;let i=s+r;t.data?.ignoreMultiPack||(i=_4(i,t.src),e.push(n.load({src:i,data:{textureOptions:a,ignoreMultiPack:!0}})))}let r=await Promise.all(e);l.linkedSheets=r,r.forEach(e=>{e.linkedSheets=[l].concat(l.linkedSheets.filter(t=>t!==e))})}return l},async unload(e,t,n){await n.unload(e.textureSource._sourceOrigin),e.destroy(!1)}}};jt.add(GCe);var KCe=class{constructor(e){this._lastTransform=``,this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{if(!this._canvas)return;let e=this._canvas.getBoundingClientRect(),t=this._canvas.width,n=this._canvas.height,r=e.width/t*this._renderer.resolution,i=e.height/n*this._renderer.resolution,a=`translate(${e.left}px, ${e.top}px) scale(${r}, ${i})`;a!==this._lastTransform&&(this._domElement.style.transform=a,this._lastTransform=a)},this._domElement=e.domElement,this._renderer=e.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver())}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())}_attachObserver(){`ResizeObserver`in globalThis?(this._observer&&=(this._observer.disconnect(),null),this._observer=new ResizeObserver(e=>{for(let t of e){if(t.target!==this._canvas)continue;let e=this.canvas.width,n=this.canvas.height,r=t.contentRect.width/e*this._renderer.resolution,i=t.contentRect.height/n*this._renderer.resolution;(this._lastScaleX!==r||this._lastScaleY!==i)&&(this.updateTranslation(),this._lastScaleX=r,this._lastScaleY=i)}}),this._observer.observe(this._canvas)):this._tickerAttached||kt.shared.add(this.updateTranslation,this,Ot.HIGH)}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&kt.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform=``,this._lastScaleX=null,this._lastScaleY=null}},x4=class e{constructor(t){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=e.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Et,this.page=new Et,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,n){throw Error(`initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.`)}initUIEvent(e,t,n,r,i){throw Error(`initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.`)}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}},S4=/iPhone/i,C4=/iPod/i,w4=/iPad/i,T4=/\biOS-universal(?:.+)Mac\b/i,E4=/\bAndroid(?:.+)Mobile\b/i,D4=/Android/i,O4=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,k4=/Silk/i,A4=/Windows Phone/i,j4=/\bWindows(?:.+)ARM\b/i,M4=/BlackBerry/i,N4=/BB10/i,P4=/Opera Mini/i,F4=/\b(CriOS|Chrome)(?:.+)Mobile/i,I4=/Mobile(?:.+)Firefox\b/i,L4=function(e){return e!==void 0&&e.platform===`MacIntel`&&typeof e.maxTouchPoints==`number`&&e.maxTouchPoints>1&&typeof MSStream>`u`};function qCe(e){return function(t){return t.test(e)}}function R4(e){var t={userAgent:``,platform:``,maxTouchPoints:0};!e&&typeof navigator<`u`?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof e==`string`?t.userAgent=e:e&&e.userAgent&&(t={userAgent:e.userAgent,platform:e.platform,maxTouchPoints:e.maxTouchPoints||0});var n=t.userAgent,r=n.split(`[FBAN`);r[1]!==void 0&&(n=r[0]),r=n.split(`Twitter`),r[1]!==void 0&&(n=r[0]);var i=qCe(n),a={apple:{phone:i(S4)&&!i(A4),ipod:i(C4),tablet:!i(S4)&&(i(w4)||L4(t))&&!i(A4),universal:i(T4),device:(i(S4)||i(C4)||i(w4)||i(T4)||L4(t))&&!i(A4)},amazon:{phone:i(O4),tablet:!i(O4)&&i(k4),device:i(O4)||i(k4)},android:{phone:!i(A4)&&i(O4)||!i(A4)&&i(E4),tablet:!i(A4)&&!i(O4)&&!i(E4)&&(i(k4)||i(D4)),device:!i(A4)&&(i(O4)||i(k4)||i(E4)||i(D4))||i(/\bokhttp\b/i)},windows:{phone:i(A4),tablet:i(j4),device:i(A4)||i(j4)},other:{blackberry:i(M4),blackberry10:i(N4),opera:i(P4),firefox:i(I4),chrome:i(F4),device:i(M4)||i(N4)||i(P4)||i(I4)||i(F4)},any:!1,phone:!1,tablet:!1};return a.any=a.apple.device||a.android.device||a.windows.device||a.other.device,a.phone=a.apple.phone||a.android.phone||a.windows.phone,a.tablet=a.apple.tablet||a.android.tablet||a.windows.tablet,a}var JCe=(R4.default??R4)(globalThis.navigator),YCe=9,z4=100,XCe=0,ZCe=0,B4=2,V4=1,QCe=-1e3,$Ce=-1e3,ewe=2,H4=class e{constructor(e,t=JCe){this._mobileInfo=t,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pools={},this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._isRunningTests=!1,this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnMouseMove=this._onMouseMove.bind(this),this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}get div(){return this._div}_createTouchHook(){let e=document.createElement(`button`);e.style.width=`${V4}px`,e.style.height=`${V4}px`,e.style.position=`absolute`,e.style.top=`${QCe}px`,e.style.left=`${$Ce}px`,e.style.zIndex=ewe.toString(),e.style.backgroundColor=`#FF0000`,e.title=`select to enable accessibility for this content`,e.addEventListener(`focus`,()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&=(document.body.removeChild(this._hookDiv),null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement(`div`),this._div.style.position=`absolute`,this._div.style.top=`${XCe}px`,this._div.style.left=`${ZCe}px`,this._div.style.pointerEvents=`none`,this._div.style.zIndex=B4.toString(),this._canvasObserver=new KCe({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&globalThis.addEventListener(`keydown`,this._boundOnKeyDown,!1),this._deactivateOnMouseMove&&globalThis.document.addEventListener(`mousemove`,this._boundOnMouseMove,!0);let e=this._renderer.view.canvas;if(e.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else{let t=new MutationObserver(()=>{e.parentNode&&(t.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())});t.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=!1,globalThis.document.removeEventListener(`mousemove`,this._boundOnMouseMove,!0),this._activateOnTab&&globalThis.addEventListener(`keydown`,this._boundOnKeyDown,!1),this._renderer.runners.postrender.remove(this);for(let e of this._children)e._accessibleDiv?.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=!1;for(let e in this._pools)this._pools[e].forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),delete this._pools[e];this._div?.parentNode&&this._div.parentNode.removeChild(this._div),this._pools={},this._children=[]}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);let t=e.children;if(t)for(let e=0;e<t.length;e++)this._updateAccessibleObjects(t[e])}init(t){let n={accessibilityOptions:{...e.defaultOptions,...t?.accessibilityOptions||{}}};this.debug=n.accessibilityOptions.debug,this._activateOnTab=n.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=n.accessibilityOptions.deactivateOnMouseMove,n.accessibilityOptions.enabledByDefault&&this._activate(),this._renderer.runners.postrender.remove(this)}postrender(){let e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,(!this._renderer.renderingToScreen||!this._renderer.view.canvas)&&!this._isRunningTests))return;let t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(let e of this._children)e._renderId===this._renderId&&t.add(this._children.indexOf(e))}for(let e=this._children.length-1;e>=0;e--){let n=this._children[e];t.has(e)||(n._accessibleDiv&&n._accessibleDiv.parentNode&&(n._accessibleDiv.parentNode.removeChild(n._accessibleDiv),this._getPool(n.accessibleType).push(n._accessibleDiv),n._accessibleDiv=null),n._accessibleActive=!1,ut(this._children,e,1))}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let e=0;e<this._children.length;e++){let t=this._children[e];if(!t._accessibleActive||!t._accessibleDiv)continue;let n=t._accessibleDiv,r=t.hitArea||t.getBounds().rectangle;if(t.hitArea){let e=t.worldTransform;n.style.left=`${e.tx+r.x*e.a}px`,n.style.top=`${e.ty+r.y*e.d}px`,n.style.width=`${r.width*e.a}px`,n.style.height=`${r.height*e.d}px`}else this._capHitArea(r),n.style.left=`${r.x}px`,n.style.top=`${r.y}px`,n.style.width=`${r.width}px`,n.style.height=`${r.height}px`}this._renderId++}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);let{width:t,height:n}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>n&&(e.height=n-e.y)}_addChild(e){let t=this._getPool(e.accessibleType).pop();t?(t.innerHTML=``,t.removeAttribute(`title`),t.removeAttribute(`aria-label`),t.tabIndex=0):(e.accessibleType===`button`?t=document.createElement(`button`):(t=document.createElement(e.accessibleType),t.style.cssText=`
951
951
  color: transparent;
952
952
  pointer-events: none;
953
953
  padding: 0;
@@ -960,7 +960,7 @@ WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){t
960
960
  -webkit-user-select: none;
961
961
  -moz-user-select: none;
962
962
  -ms-user-select: none;
963
- `,e.accessibleText&&(t.innerText=e.accessibleText)),t.style.width=`${z4}px`,t.style.height=`${z4}px`,t.style.backgroundColor=this.debug?`rgba(255,255,255,0.5)`:`transparent`,t.style.position=`absolute`,t.style.zIndex=B4.toString(),t.style.borderStyle=`none`,navigator.userAgent.toLowerCase().includes(`chrome`)?t.setAttribute(`aria-live`,`off`):t.setAttribute(`aria-live`,`polite`),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute(`aria-relevant`,`additions`):t.setAttribute(`aria-relevant`,`text`),t.addEventListener(`click`,this._onClick.bind(this)),t.addEventListener(`focus`,this._onFocus.bind(this)),t.addEventListener(`focusout`,this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`container ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute(`aria-label`,e.accessibleHint),e.interactive?t.tabIndex=e.tabIndex:t.tabIndex=0,this.debug&&this._updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv)}_dispatchEvent(e,t){let{container:n}=e.target,r=this._renderer.events.rootBoundary,i=Object.assign(new x4(r),{target:n});r.rootTarget=this._renderer.lastObjectRendered,t.forEach(e=>r.dispatchEvent(i,e))}_onClick(e){this._dispatchEvent(e,[`click`,`pointertap`,`tap`])}_onFocus(e){e.target.getAttribute(`aria-live`)||e.target.setAttribute(`aria-live`,`assertive`),this._dispatchEvent(e,[`mouseover`])}_onFocusOut(e){e.target.getAttribute(`aria-live`)||e.target.setAttribute(`aria-live`,`polite`),this._dispatchEvent(e,[`mouseout`])}_onKeyDown(e){e.keyCode!==YCe||!this._activateOnTab||this._activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this._deactivate()}destroy(){this._deactivate(),this._destroyTouchHook(),this._canvasObserver?.destroy(),this._canvasObserver=null,this._div=null,this._pools=null,this._children=null,this._renderer=null,this._hookDiv=null,globalThis.removeEventListener(`keydown`,this._boundOnKeyDown),this._boundOnKeyDown=null,globalThis.document.removeEventListener(`mousemove`,this._boundOnMouseMove,!0),this._boundOnMouseMove=null}setAccessibilityEnabled(e){e?this._activate():this._deactivate()}_getPool(e){return this._pools[e]||(this._pools[e]=[]),this._pools[e]}};H4.extension={type:[W.WebGLSystem,W.WebGPUSystem],name:`accessibility`},H4.defaultOptions={enabledByDefault:!1,debug:!1,activateOnTab:!0,deactivateOnMouseMove:!0};var twe=H4,nwe={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,accessibleType:`button`,accessibleText:null,accessiblePointerEvents:`auto`,accessibleChildren:!0,_accessibleActive:!1,_accessibleDiv:null,_renderId:-1},U4;function rwe(e){return U4===void 0&&(U4=(()=>{let t={stencil:!0,failIfMajorPerformanceCaveat:e??Qt.defaultOptions.failIfMajorPerformanceCaveat};try{if(!Gt.get().getWebGLRenderingContext())return!1;let e=Gt.get().createCanvas().getContext(`webgl`,t),n=!!e?.getContextAttributes()?.stencil;if(e){let t=e.getExtension(`WEBGL_lose_context`);t&&t.loseContext()}return e=null,n}catch{return!1}})()),U4}var W4;async function iwe(e={}){return W4===void 0&&(W4=await(async()=>{let t=Gt.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(e)).requestDevice(),!0}catch{return!1}})()),W4}var G4=[`webgl`,`webgpu`,`canvas`];async function awe(e){let t=[];e.preference?(t.push(e.preference),G4.forEach(n=>{n!==e.preference&&t.push(n)})):t=G4.slice();let n,r={};for(let i=0;i<t.length;i++){let a=t[i];if(a===`webgpu`&&await iwe()){let{WebGPURenderer:t}=await q(async()=>{let{WebGPURenderer:e}=await import(`./WebGPURenderer-CuFr8c2N.js`);return{WebGPURenderer:e}},__vite__mapDeps([131,128,1]));n=t,r={...e,...e.webgpu};break}else if(a===`webgl`&&rwe(e.failIfMajorPerformanceCaveat??Qt.defaultOptions.failIfMajorPerformanceCaveat)){let{WebGLRenderer:t}=await q(async()=>{let{WebGLRenderer:e}=await import(`./WebGLRenderer-BtSY66Gv.js`);return{WebGLRenderer:e}},__vite__mapDeps([132,128,1]));n=t,r={...e,...e.webgl};break}else if(a===`canvas`){let{CanvasRenderer:t}=await q(async()=>{let{CanvasRenderer:e}=await import(`./CanvasRenderer-CzWj-jTd.js`);return{CanvasRenderer:e}},__vite__mapDeps([133,128,1]));n=t,r={...e,...e.canvasOptions};break}}if(delete r.webgpu,delete r.webgl,delete r.canvasOptions,!n)throw Error(`No available renderer for the current environment`);let i=new n;return await i.init(r),i}var K4=class{static init(e){Object.defineProperty(this,`resizeTo`,{configurable:!0,set(e){globalThis.removeEventListener(`resize`,this.queueResize),this._resizeTo=e,e&&(globalThis.addEventListener(`resize`,this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&=(cancelAnimationFrame(this._resizeId),null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let e,t;if(this._resizeTo===globalThis.window)e=globalThis.innerWidth,t=globalThis.innerHeight;else{let{clientWidth:n,clientHeight:r}=this._resizeTo;e=n,t=r}this.renderer.resize(e,t),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener(`resize`,this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}};K4.extension=W.Application;var q4=class{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,`ticker`,{configurable:!0,set(e){this._ticker&&this._ticker.remove(this.render,this),this._ticker=e,e&&e.add(this.render,this,Ot.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?kt.shared:new kt,e.autoStart&&this.start()}static destroy(){if(this._ticker){let e=this._ticker;this.ticker=null,e.destroy()}}};q4.extension=W.Application,jt.add(K4),jt.add(q4);var J4=class e{constructor(...e){this.stage=new qt,e[0]!==void 0&&zt(st,`Application constructor options are deprecated, please use Application.init() instead.`)}async init(t){t={...t},this.stage||=new qt,this.renderer=await awe(t),e._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return zt(st,`Application.view is deprecated, please use Application.canvas instead.`),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(t=!1,n=!1){let r=e._plugins.slice(0);r.reverse(),r.forEach(e=>{e.destroy.call(this)}),this.stage.destroy(n),this.stage=null,this.renderer.destroy(t),this.renderer=null}};J4._plugins=[];var Y4=J4;jt.handleByList(W.Application,Y4._plugins),jt.add($t);var owe=t(n(((e,t)=>{t.exports=i;var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},r=/([astvzqmhlc])([^astvzqmhlc]*)/gi;function i(e){var t=[];return e.replace(r,function(e,r,i){var a=r.toLowerCase();for(i=o(i),a==`m`&&i.length>2&&(t.push([r].concat(i.splice(0,2))),a=`l`,r=r==`m`?`l`:`L`);;){if(i.length==n[a])return i.unshift(r),t.push(i);if(i.length<n[a])throw Error(`malformed path data`);t.push([r].concat(i.splice(0,n[a])))}}),t}var a=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function o(e){var t=e.match(a);return t?t.map(Number):[]}}))(),1);function swe(e,t){let n=(0,owe.default)(e),r=[],i=null,a=0,o=0;for(let e=0;e<n.length;e++){let s=n[e],c=s[0],l=s;switch(c){case`M`:a=l[1],o=l[2],t.moveTo(a,o);break;case`m`:a+=l[1],o+=l[2],t.moveTo(a,o);break;case`H`:a=l[1],t.lineTo(a,o);break;case`h`:a+=l[1],t.lineTo(a,o);break;case`V`:o=l[1],t.lineTo(a,o);break;case`v`:o+=l[1],t.lineTo(a,o);break;case`L`:a=l[1],o=l[2],t.lineTo(a,o);break;case`l`:a+=l[1],o+=l[2],t.lineTo(a,o);break;case`C`:a=l[5],o=l[6],t.bezierCurveTo(l[1],l[2],l[3],l[4],a,o);break;case`c`:t.bezierCurveTo(a+l[1],o+l[2],a+l[3],o+l[4],a+l[5],o+l[6]),a+=l[5],o+=l[6];break;case`S`:a=l[3],o=l[4],t.bezierCurveToShort(l[1],l[2],a,o);break;case`s`:t.bezierCurveToShort(a+l[1],o+l[2],a+l[3],o+l[4]),a+=l[3],o+=l[4];break;case`Q`:a=l[3],o=l[4],t.quadraticCurveTo(l[1],l[2],a,o);break;case`q`:t.quadraticCurveTo(a+l[1],o+l[2],a+l[3],o+l[4]),a+=l[3],o+=l[4];break;case`T`:a=l[1],o=l[2],t.quadraticCurveToShort(a,o);break;case`t`:a+=l[1],o+=l[2],t.quadraticCurveToShort(a,o);break;case`A`:a=l[6],o=l[7],t.arcToSvg(l[1],l[2],l[3],l[4],l[5],a,o);break;case`a`:a+=l[6],o+=l[7],t.arcToSvg(l[1],l[2],l[3],l[4],l[5],a,o);break;case`Z`:case`z`:t.closePath(),r.length>0&&(i=r.pop(),i?(a=i.startX,o=i.startY):(a=0,o=0)),i=null;break;default:ot(`Unknown SVG path command: ${c}`)}c!==`Z`&&c!==`z`&&i===null&&(i={startX:a,startY:o},r.push(i))}return t}var cwe=class e{constructor(e=0,t=0,n=0){this.type=`circle`,this.x=e,this.y=t,this.radius=n}clone(){return new e(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return!1;let n=this.radius*this.radius,r=this.x-e,i=this.y-t;return r*=r,i*=i,r+i<=n}strokeContains(e,t,n,r=.5){if(this.radius===0)return!1;let i=this.x-e,a=this.y-t,o=this.radius,s=(1-r)*n,c=Math.sqrt(i*i+a*a);return c<=o+s&&c>o-(n-s)}getBounds(e){return e||=new bt,e.x=this.x-this.radius,e.y=this.y-this.radius,e.width=this.radius*2,e.height=this.radius*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}},lwe=class e{constructor(e=0,t=0,n=0,r=0){this.type=`ellipse`,this.x=e,this.y=t,this.halfWidth=n,this.halfHeight=r}clone(){return new e(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,t){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let n=(e-this.x)/this.halfWidth,r=(t-this.y)/this.halfHeight;return n*=n,r*=r,n+r<=1}strokeContains(e,t,n,r=.5){let{halfWidth:i,halfHeight:a}=this;if(i<=0||a<=0)return!1;let o=n*(1-r),s=n-o,c=i-s,l=a-s,u=i+o,d=a+o,f=e-this.x,p=t-this.y,m=f*f/(c*c)+p*p/(l*l),h=f*f/(u*u)+p*p/(d*d);return m>1&&h<=1}getBounds(e){return e||=new bt,e.x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=this.halfWidth*2,e.height=this.halfHeight*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}};function uwe(e,t,n,r,i,a){let o=e-n,s=t-r,c=i-n,l=a-r,u=o*c+s*l,d=c*c+l*l,f=-1;d!==0&&(f=u/d);let p,m;f<0?(p=n,m=r):f>1?(p=i,m=a):(p=n+f*c,m=r+f*l);let h=e-p,g=t-m;return h*h+g*g}var dwe,fwe,X4=class e{constructor(...e){this.type=`polygon`;let t=Array.isArray(e[0])?e[0]:e;if(typeof t[0]!=`number`){let e=[];for(let n=0,r=t.length;n<r;n++)e.push(t[n].x,t[n].y);t=e}this.points=t,this.closePath=!0}isClockwise(){let e=0,t=this.points,n=t.length;for(let r=0;r<n;r+=2){let i=t[r],a=t[r+1],o=t[(r+2)%n],s=t[(r+3)%n];e+=(o-i)*(s+a)}return e<0}containsPolygon(e){let t=this.getBounds(dwe),n=e.getBounds(fwe);if(!t.containsRect(n))return!1;let r=e.points;for(let e=0;e<r.length;e+=2){let t=r[e],n=r[e+1];if(!this.contains(t,n))return!1}return!0}clone(){let t=new e(this.points.slice());return t.closePath=this.closePath,t}contains(e,t){let n=!1,r=this.points.length/2;for(let i=0,a=r-1;i<r;a=i++){let r=this.points[i*2],o=this.points[i*2+1],s=this.points[a*2],c=this.points[a*2+1];o>t!=c>t&&e<(s-r)*((t-o)/(c-o))+r&&(n=!n)}return n}strokeContains(e,t,n,r=.5){let i=n*n,a=i*(1-r),o=i-a,{points:s}=this,c=s.length-(this.closePath?0:2);for(let n=0;n<c;n+=2){let r=s[n],i=s[n+1],c=s[(n+2)%s.length],l=s[(n+3)%s.length];if(uwe(e,t,r,i,c,l)<=(Math.sign((c-r)*(t-i)-(l-i)*(e-r))<0?o:a))return!0}return!1}getBounds(e){e||=new bt;let t=this.points,n=1/0,r=-1/0,i=1/0,a=-1/0;for(let e=0,o=t.length;e<o;e+=2){let o=t[e],s=t[e+1];n=o<n?o:n,r=o>r?o:r,i=s<i?s:i,a=s>a?s:a}return e.x=n,e.width=r-n,e.y=i,e.height=a-i,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e,t)=>`${e}, ${t}`,``)}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return zt(`8.11.0`,`Polygon.lastX is deprecated, please use Polygon.lastX instead.`),this.points[this.points.length-2]}get y(){return zt(`8.11.0`,`Polygon.y is deprecated, please use Polygon.lastY instead.`),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}},Z4=(e,t,n,r,i,a,o)=>{let s=e-n,c=t-r,l=Math.sqrt(s*s+c*c);return l>=i-a&&l<=i+o},pwe=class e{constructor(e=0,t=0,n=0,r=0,i=20){this.type=`roundedRectangle`,this.x=e,this.y=t,this.width=n,this.height=r,this.radius=i}getBounds(e){return e||=new bt,e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new e(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){let n=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+n&&t<=this.y+this.height-n||e>=this.x+n&&e<=this.x+this.width-n)return!0;let r=e-(this.x+n),i=t-(this.y+n),a=n*n;if(r*r+i*i<=a||(r=e-(this.x+this.width-n),r*r+i*i<=a)||(i=t-(this.y+this.height-n),r*r+i*i<=a)||(r=e-(this.x+n),r*r+i*i<=a))return!0}return!1}strokeContains(e,t,n,r=.5){let{x:i,y:a,width:o,height:s,radius:c}=this,l=n*(1-r),u=n-l,d=i+c,f=a+c,p=o-c*2,m=s-c*2,h=i+o,g=a+s;return(e>=i-l&&e<=i+u||e>=h-u&&e<=h+l)&&t>=f&&t<=f+m||(t>=a-l&&t<=a+u||t>=g-u&&t<=g+l)&&e>=d&&e<=d+p?!0:e<d&&t<f&&Z4(e,t,d,f,c,u,l)||e>h-c&&t<f&&Z4(e,t,h-c,f,c,u,l)||e>h-c&&t>g-c&&Z4(e,t,h-c,g-c,c,u,l)||e<d&&t>g-c&&Z4(e,t,d,g-c,c,u,l)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}};function mwe(e,t,n,r,i,a,o,s=null){let c=0;n*=t,i*=a;let l=s.a,u=s.b,d=s.c,f=s.d,p=s.tx,m=s.ty;for(;c<o;){let o=e[n],s=e[n+1];r[i]=l*o+d*s+p,r[i+1]=u*o+f*s+m,i+=a,n+=t,c++}}function hwe(e,t,n,r){let i=0;for(t*=n;i<r;)e[t]=0,e[t+1]=0,t+=n,i++}function Q4(e,t,n,r,i){let a=t.a,o=t.b,s=t.c,c=t.d,l=t.tx,u=t.ty;n||=0,r||=2,i||=e.length/r-n;let d=n*r;for(let t=0;t<i;t++){let t=e[d],n=e[d+1];e[d]=a*t+s*n+l,e[d+1]=o*t+c*n+u,d+=r}}var gwe=new Qe,$4=class{constructor(){this.packAsQuad=!1,this.batcherName=`default`,this.topology=`triangle-list`,this.applyTransform=!0,this.roundPixels=0,this._batcher=null,this._batch=null}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:`normal`}get color(){let e=this.baseColor,t=e>>16|e&65280|(e&255)<<16,n=this.renderable;return n?dt(t,n.groupColor)+(this.alpha*n.groupAlpha*255<<24):t+(this.alpha*255<<24)}get transform(){return this.renderable?.groupTransform||gwe}copyTo(e){e.indexOffset=this.indexOffset,e.indexSize=this.indexSize,e.attributeOffset=this.attributeOffset,e.attributeSize=this.attributeSize,e.baseColor=this.baseColor,e.alpha=this.alpha,e.texture=this.texture,e.geometryData=this.geometryData,e.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology=`triangle-list`}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher=null,this._batch=null}},e3={extension:{type:W.ShapeBuilder,name:`circle`},build(e,t){let n,r,i,a,o,s;if(e.type===`circle`){let t=e;if(o=s=t.radius,o<=0)return!1;n=t.x,r=t.y,i=a=0}else if(e.type===`ellipse`){let t=e;if(o=t.halfWidth,s=t.halfHeight,o<=0||s<=0)return!1;n=t.x,r=t.y,i=a=0}else{let t=e,c=t.width/2,l=t.height/2;n=t.x+c,r=t.y+l,o=s=Math.max(0,Math.min(t.radius,Math.min(c,l))),i=c-o,a=l-s}if(i<0||a<0)return!1;let c=Math.ceil(2.3*Math.sqrt(o+s)),l=c*8+(i?4:0)+(a?4:0);if(l===0)return!1;if(c===0)return t[0]=t[6]=n+i,t[1]=t[3]=r+a,t[2]=t[4]=n-i,t[5]=t[7]=r-a,!0;let u=0,d=c*4+(i?2:0)+2,f=d,p=l,m=i+o,h=a,g=n+m,_=n-m,v=r+h;if(t[u++]=g,t[u++]=v,t[--d]=v,t[--d]=_,a){let e=r-h;t[f++]=_,t[f++]=e,t[--p]=e,t[--p]=g}for(let e=1;e<c;e++){let l=Math.PI/2*(e/c),m=i+Math.cos(l)*o,h=a+Math.sin(l)*s,g=n+m,_=n-m,v=r+h,y=r-h;t[u++]=g,t[u++]=v,t[--d]=v,t[--d]=_,t[f++]=_,t[f++]=y,t[--p]=y,t[--p]=g}m=i,h=a+s,g=n+m,_=n-m,v=r+h;let y=r-h;return t[u++]=g,t[u++]=v,t[--p]=y,t[--p]=g,i&&(t[u++]=_,t[u++]=v,t[--p]=y,t[--p]=_),!0},triangulate(e,t,n,r,i,a){if(e.length===0)return;let o=0,s=0;for(let t=0;t<e.length;t+=2)o+=e[t],s+=e[t+1];o/=e.length/2,s/=e.length/2;let c=r;t[c*n]=o,t[c*n+1]=s;let l=c++;for(let r=0;r<e.length;r+=2)t[c*n]=e[r],t[c*n+1]=e[r+1],r>0&&(i[a++]=c,i[a++]=l,i[a++]=c-1),c++;i[a++]=l+1,i[a++]=l,i[a++]=c-1}},_we={...e3,extension:{...e3.extension,name:`ellipse`}},vwe={...e3,extension:{...e3.extension,name:`roundedRectangle`}},t3=1e-4,n3=1e-4;function ywe(e){let t=e.length;if(t<6)return 1;let n=0;for(let r=0,i=e[t-2],a=e[t-1];r<t;r+=2){let t=e[r],o=e[r+1];n+=(t-i)*(o+a),i=t,a=o}return n<0?-1:1}function r3(e,t,n,r,i,a,o,s){let c=e-n*i,l=t-r*i,u=e+n*a,d=t+r*a,f,p;o?(f=r,p=-n):(f=-r,p=n);let m=c+f,h=l+p,g=u+f,_=d+p;return s.push(m,h),s.push(g,_),2}function i3(e,t,n,r,i,a,o,s){let c=n-e,l=r-t,u=Math.atan2(c,l),d=Math.atan2(i-e,a-t);s&&u<d?u+=Math.PI*2:!s&&u>d&&(d+=Math.PI*2);let f=u,p=d-u,m=Math.abs(p),h=Math.sqrt(c*c+l*l),g=(15*m*Math.sqrt(h)/Math.PI>>0)+1,_=p/g;if(f+=_,s){o.push(e,t),o.push(n,r);for(let n=1,r=f;n<g;n++,r+=_)o.push(e,t),o.push(e+Math.sin(r)*h,t+Math.cos(r)*h);o.push(e,t),o.push(i,a)}else{o.push(n,r),o.push(e,t);for(let n=1,r=f;n<g;n++,r+=_)o.push(e+Math.sin(r)*h,t+Math.cos(r)*h),o.push(e,t);o.push(i,a),o.push(e,t)}return g*2}function a3(e,t,n,r,i,a){let o=t3;if(e.length===0)return;let s=t,c=s.alignment;if(t.alignment!==.5){let t=ywe(e);n&&(t*=-1),c=(c-.5)*t+.5}let l=new Et(e[0],e[1]),u=new Et(e[e.length-2],e[e.length-1]),d=r,f=Math.abs(l.x-u.x)<o&&Math.abs(l.y-u.y)<o;if(d){e=e.slice(),f&&(e.pop(),e.pop(),u.set(e[e.length-2],e[e.length-1]));let t=(l.x+u.x)*.5,n=(u.y+l.y)*.5;e.unshift(t,n),e.push(t,n)}let p=i,m=e.length/2,h=e.length,g=p.length/2,_=s.width/2,v=_*_,y=s.miterLimit*s.miterLimit,b=e[0],x=e[1],S=e[2],C=e[3],w=0,T=0,E=-(x-C),D=b-S,O=0,k=0,A=Math.sqrt(E*E+D*D);E/=A,D/=A,E*=_,D*=_;let j=c,M=(1-j)*2,N=j*2;d||(s.cap===`round`?h+=i3(b-E*(M-N)*.5,x-D*(M-N)*.5,b-E*M,x-D*M,b+E*N,x+D*N,p,!0)+2:s.cap===`square`&&(h+=r3(b,x,E,D,M,N,!0,p))),p.push(b-E*M,x-D*M),p.push(b+E*N,x+D*N);for(let t=1;t<m-1;++t){b=e[(t-1)*2],x=e[(t-1)*2+1],S=e[t*2],C=e[t*2+1],w=e[(t+1)*2],T=e[(t+1)*2+1],E=-(x-C),D=b-S,A=Math.sqrt(E*E+D*D),E/=A,D/=A,E*=_,D*=_,O=-(C-T),k=S-w,A=Math.sqrt(O*O+k*k),O/=A,k/=A,O*=_,k*=_;let n=S-b,r=x-C,i=S-w,a=T-C,o=n*i+r*a,c=r*i-a*n,l=c<0;if(Math.abs(c)<.001*Math.abs(o)){p.push(S-E*M,C-D*M),p.push(S+E*N,C+D*N),o>=0&&(s.join===`round`?h+=i3(S,C,S-E*M,C-D*M,S-O*M,C-k*M,p,!1)+4:h+=2,p.push(S-O*N,C-k*N),p.push(S+O*M,C+k*M));continue}let u=(-E+b)*(-D+C)-(-E+S)*(-D+x),d=(-O+w)*(-k+C)-(-O+S)*(-k+T),f=(n*d-i*u)/c,m=(a*u-r*d)/c,g=(f-S)*(f-S)+(m-C)*(m-C),j=S+(f-S)*M,P=C+(m-C)*M,F=S-(f-S)*N,I=C-(m-C)*N,ee=Math.min(n*n+r*r,i*i+a*a),L=l?M:N;g<=ee+L*L*v?s.join===`bevel`||g/v>y?(l?(p.push(j,P),p.push(S+E*N,C+D*N),p.push(j,P),p.push(S+O*N,C+k*N)):(p.push(S-E*M,C-D*M),p.push(F,I),p.push(S-O*M,C-k*M),p.push(F,I)),h+=2):s.join===`round`?l?(p.push(j,P),p.push(S+E*N,C+D*N),h+=i3(S,C,S+E*N,C+D*N,S+O*N,C+k*N,p,!0)+4,p.push(j,P),p.push(S+O*N,C+k*N)):(p.push(S-E*M,C-D*M),p.push(F,I),h+=i3(S,C,S-E*M,C-D*M,S-O*M,C-k*M,p,!1)+4,p.push(S-O*M,C-k*M),p.push(F,I)):(p.push(j,P),p.push(F,I)):(p.push(S-E*M,C-D*M),p.push(S+E*N,C+D*N),s.join===`round`?l?h+=i3(S,C,S+E*N,C+D*N,S+O*N,C+k*N,p,!0)+2:h+=i3(S,C,S-E*M,C-D*M,S-O*M,C-k*M,p,!1)+2:s.join===`miter`&&g/v<=y&&(l?(p.push(F,I),p.push(F,I)):(p.push(j,P),p.push(j,P)),h+=2),p.push(S-O*M,C-k*M),p.push(S+O*N,C+k*N),h+=2)}b=e[(m-2)*2],x=e[(m-2)*2+1],S=e[(m-1)*2],C=e[(m-1)*2+1],E=-(x-C),D=b-S,A=Math.sqrt(E*E+D*D),E/=A,D/=A,E*=_,D*=_,p.push(S-E*M,C-D*M),p.push(S+E*N,C+D*N),d||(s.cap===`round`?h+=i3(S-E*(M-N)*.5,C-D*(M-N)*.5,S-E*M,C-D*M,S+E*N,C+D*N,p,!1)+2:s.cap===`square`&&(h+=r3(S,C,E,D,M,N,!1,p)));let P=n3*n3;for(let e=g;e<h+g-2;++e)b=p[e*2],x=p[e*2+1],S=p[(e+1)*2],C=p[(e+1)*2+1],w=p[(e+2)*2],T=p[(e+2)*2+1],!(Math.abs(b*(C-T)+S*(T-x)+w*(x-C))<P)&&a.push(e,e+1,e+2)}function bwe(e,t,n,r){let i=t3;if(e.length===0)return;let a=e[0],o=e[1],s=e[e.length-2],c=e[e.length-1],l=t||Math.abs(a-s)<i&&Math.abs(o-c)<i,u=n,d=e.length/2,f=u.length/2;for(let t=0;t<d;t++)u.push(e[t*2]),u.push(e[t*2+1]);for(let e=0;e<d-1;e++)r.push(f+e,f+e+1);l&&r.push(f+d-1,f)}function o3(e,t,n,r,i,a,o){let s=pn(e,t,2);if(!s)return;for(let e=0;e<s.length;e+=3)a[o++]=s[e]+i,a[o++]=s[e+1]+i,a[o++]=s[e+2]+i;let c=i*r;for(let t=0;t<e.length;t+=2)n[c]=e[t],n[c+1]=e[t+1],c+=r}var xwe=[],Swe={extension:{type:W.ShapeBuilder,name:`polygon`},build(e,t){for(let n=0;n<e.points.length;n++)t[n]=e.points[n];return!0},triangulate(e,t,n,r,i,a){o3(e,xwe,t,n,r,i,a)}},Cwe={extension:{type:W.ShapeBuilder,name:`rectangle`},build(e,t){let n=e,r=n.x,i=n.y,a=n.width,o=n.height;return a>0&&o>0?(t[0]=r,t[1]=i,t[2]=r+a,t[3]=i,t[4]=r+a,t[5]=i+o,t[6]=r,t[7]=i+o,!0):!1},triangulate(e,t,n,r,i,a){let o=0;r*=n,t[r+o]=e[0],t[r+o+1]=e[1],o+=n,t[r+o]=e[2],t[r+o+1]=e[3],o+=n,t[r+o]=e[6],t[r+o+1]=e[7],o+=n,t[r+o]=e[4],t[r+o+1]=e[5],o+=n;let s=r/n;i[a++]=s,i[a++]=s+1,i[a++]=s+2,i[a++]=s+1,i[a++]=s+3,i[a++]=s+2}},wwe={extension:{type:W.ShapeBuilder,name:`triangle`},build(e,t){return t[0]=e.x,t[1]=e.y,t[2]=e.x2,t[3]=e.y2,t[4]=e.x3,t[5]=e.y3,!0},triangulate(e,t,n,r,i,a){let o=0;r*=n,t[r+o]=e[0],t[r+o+1]=e[1],o+=n,t[r+o]=e[2],t[r+o+1]=e[3],o+=n,t[r+o]=e[4],t[r+o+1]=e[5];let s=r/n;i[a++]=s,i[a++]=s+1,i[a++]=s+2}},s3=[{offset:0,color:`white`},{offset:1,color:`black`}],c3=class e{constructor(...t){this.uid=vt(`fillGradient`),this._tick=0,this.type=`linear`,this.colorStops=[];let n=Twe(t);n={...n.type===`radial`?e.defaultRadialOptions:e.defaultLinearOptions,...it(n)},this._textureSize=n.textureSize,this._wrapMode=n.wrapMode,n.type===`radial`?(this.center=n.center,this.outerCenter=n.outerCenter??this.center,this.innerRadius=n.innerRadius,this.outerRadius=n.outerRadius,this.scale=n.scale,this.rotation=n.rotation):(this.start=n.start,this.end=n.end),this.textureSpace=n.textureSpace,this.type=n.type,n.colorStops.forEach(e=>{this.addColorStop(e.offset,e.color)})}addColorStop(e,t){return this.colorStops.push({offset:e,color:lt.shared.setValue(t).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:e,y:t}=this.start,{x:n,y:r}=this.end,i=n-e,a=r-t,o=i<0||a<0;if(this._wrapMode===`clamp-to-edge`){if(i<0){let t=e;e=n,n=t,i*=-1}if(a<0){let e=t;t=r,r=e,a*=-1}}let s=this.colorStops.length?this.colorStops:s3,c=this._textureSize,{canvas:l,context:u}=d3(c,1),d=o?u.createLinearGradient(this._textureSize,0,0,0):u.createLinearGradient(0,0,this._textureSize,0);u3(d,s),u.fillStyle=d,u.fillRect(0,0,c,1),this.texture=new et({source:new Xt({resource:l,addressMode:this._wrapMode})});let f=Math.sqrt(i*i+a*a),p=Math.atan2(a,i),m=new Qe;m.scale(f/c,1),m.rotate(p),m.translate(e,t),this.textureSpace===`local`&&m.scale(c,c),this.transform=m}buildGradient(){this.texture||this._tick++,this.type===`linear`?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;let e=this.colorStops.length?this.colorStops:s3,t=this._textureSize,{canvas:n,context:r}=d3(t,t),{x:i,y:a}=this.center,{x:o,y:s}=this.outerCenter,c=this.innerRadius,l=this.outerRadius,u=o-l,d=s-l,f=t/(l*2),p=(i-u)*f,m=(a-d)*f,h=r.createRadialGradient(p,m,c*f,(o-u)*f,(s-d)*f,l*f);u3(h,e),r.fillStyle=e[e.length-1].color,r.fillRect(0,0,t,t),r.fillStyle=h,r.translate(p,m),r.rotate(this.rotation),r.scale(1,this.scale),r.translate(-p,-m),r.fillRect(0,0,t,t),this.texture=new et({source:new Xt({resource:n,addressMode:this._wrapMode})});let g=new Qe;g.scale(1/f,1/f),g.translate(u,d),this.textureSpace===`local`&&g.scale(t,t),this.transform=g}destroy(){this.texture?.destroy(!0),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null}get styleKey(){return`fill-gradient-${this.uid}-${this._tick}`}};c3.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:`local`,type:`linear`,textureSize:256,wrapMode:`clamp-to-edge`},c3.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:`local`,type:`radial`,textureSize:256,wrapMode:`clamp-to-edge`};var l3=c3;function u3(e,t){for(let n=0;n<t.length;n++){let r=t[n];e.addColorStop(r.offset,r.color)}}function d3(e,t){let n=Gt.get().createCanvas(e,t);return{canvas:n,context:n.getContext(`2d`)}}function Twe(e){let t=e[0]??{};return(typeof t==`number`||e[1])&&(zt(`8.5.2`,`use options object instead`),t={type:`linear`,start:{x:e[0],y:e[1]},end:{x:e[2],y:e[3]},textureSpace:e[4],textureSize:e[5]??l3.defaultLinearOptions.textureSize}),t}var Ewe=new Qe,Dwe=new bt;function f3(e,t,n,r){let i=t.matrix?e.copyFrom(t.matrix).invert():e.identity();if(t.textureSpace===`local`){let e=n.getBounds(Dwe);t.width&&e.pad(t.width);let{x:r,y:a}=e,o=1/e.width,s=1/e.height,c=-r*o,l=-a*s,u=i.a,d=i.b,f=i.c,p=i.d;i.a*=o,i.b*=o,i.c*=s,i.d*=s,i.tx=c*u+l*f+i.tx,i.ty=c*d+l*p+i.ty}else i.translate(t.texture.frame.x,t.texture.frame.y),i.scale(1/t.texture.source.width,1/t.texture.source.height);let a=t.texture.source.style;return!(t.fill instanceof l3)&&a.addressMode===`clamp-to-edge`&&(a.addressMode=`repeat`,a.update()),r&&i.append(Ewe.copyFrom(r).invert()),i}var p3={};jt.handleByMap(W.ShapeBuilder,p3),jt.add(Cwe,Swe,wwe,e3,_we,vwe);var Owe=new bt,kwe=new Qe;function Awe(e,t){let{geometryData:n,batches:r}=t;r.length=0,n.indices.length=0,n.vertices.length=0,n.uvs.length=0;for(let t=0;t<e.instructions.length;t++){let i=e.instructions[t];if(i.action===`texture`)jwe(i.data,r,n);else if(i.action===`fill`||i.action===`stroke`){let e=i.action===`stroke`,t=i.data.path.shapePath,a=i.data.style,o=i.data.hole;e&&o&&m3(o.shapePath,a,!0,r,n),o&&(t.shapePrimitives[t.shapePrimitives.length-1].holes=o.shapePath.shapePrimitives),m3(t,a,e,r,n)}}}function jwe(e,t,n){let r=[],i=p3.rectangle,a=Owe;a.x=e.dx,a.y=e.dy,a.width=e.dw,a.height=e.dh;let o=e.transform;if(!i.build(a,r))return;let{vertices:s,uvs:c,indices:l}=n,u=l.length,d=s.length/2;o&&Q4(r,o),i.triangulate(r,s,2,d,l,u);let f=e.image,p=f.uvs;c.push(p.x0,p.y0,p.x1,p.y1,p.x3,p.y3,p.x2,p.y2);let m=ft.get($4);m.indexOffset=u,m.indexSize=l.length-u,m.attributeOffset=d,m.attributeSize=s.length/2-d,m.baseColor=e.style,m.alpha=e.alpha,m.texture=f,m.geometryData=n,t.push(m)}function m3(e,t,n,r,i){let{vertices:a,uvs:o,indices:s}=i;e.shapePrimitives.forEach(({shape:e,transform:c,holes:l})=>{let u=[],d=p3[e.type];if(!d.build(e,u))return;let f=s.length,p=a.length/2,m=`triangle-list`;if(c&&Q4(u,c),n){let n=e.closePath??!0,r=t;r.pixelLine?(bwe(u,n,a,s),m=`line-list`):a3(u,r,!1,n,a,s)}else if(l){let e=[],t=u.slice();Mwe(l).forEach(n=>{e.push(t.length/2),t.push(...n)}),o3(t,e,a,2,p,s,f)}else d.triangulate(u,a,2,p,s,f);let h=o.length/2,g=t.texture;if(g!==et.WHITE){let n=f3(kwe,t,e,c);mwe(a,2,p,o,h,2,a.length/2-p,n)}else hwe(o,h,2,a.length/2-p);let _=ft.get($4);_.indexOffset=f,_.indexSize=s.length-f,_.attributeOffset=p,_.attributeSize=a.length/2-p,_.baseColor=t.color,_.alpha=t.alpha,_.texture=g,_.geometryData=i,_.topology=m,r.push(_)})}function Mwe(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n].shape,i=[];p3[r.type].build(r,i)&&t.push(i)}return t}var Nwe=class{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){this.batches&&this.batches.forEach(e=>{ft.return(e)}),this.graphicsData&&ft.return(this.graphicsData),this.isBatchable=!1,this.context=null,this.batches.length=0,this.geometryData.indices.length=0,this.geometryData.vertices.length=0,this.geometryData.uvs.length=0,this.graphicsData=null}destroy(){this.reset(),this.batches=null,this.geometryData=null}},Pwe=class{constructor(){this.instructions=new Kt}init(e){let t=e.maxTextures;this.batcher?this.batcher._updateMaxTextures(t):this.batcher=new vn({maxTextures:t}),this.instructions.reset()}get geometry(){return zt(yt,`GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead.`),this.batcher.geometry}destroy(){this.batcher.destroy(),this.instructions.destroy(),this.batcher=null,this.instructions=null}},h3=class e{constructor(e){this._renderer=e,this._managedContexts=new ln({renderer:e,type:`resource`,name:`graphicsContext`})}init(t){e.defaultOptions.bezierSmoothness=t?.bezierSmoothness??e.defaultOptions.bezierSmoothness}getContextRenderData(e){return e._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(e)}updateGpuContext(e){let t=!!e._gpuData[this._renderer.uid],n=e._gpuData[this._renderer.uid]||this._initContext(e);if(e.dirty||!t){t&&n.reset(),Awe(e,n);let r=e.batchMode;e.customShader||r===`no-batch`?n.isBatchable=!1:r===`auto`?n.isBatchable=n.geometryData.vertices.length<400:n.isBatchable=!0,e.dirty=!1}return n}getGpuContext(e){return e._gpuData[this._renderer.uid]||this._initContext(e)}_initContextRenderData(e){let t=ft.get(Pwe,{maxTextures:this._renderer.limits.maxBatchableTextures}),n=e._gpuData[this._renderer.uid],{batches:r,geometryData:i}=n;n.graphicsData=t;let a=i.vertices.length,o=i.indices.length;for(let e=0;e<r.length;e++)r[e].applyTransform=!1;let s=t.batcher;s.ensureAttributeBuffer(a),s.ensureIndexBuffer(o),s.begin();for(let e=0;e<r.length;e++){let t=r[e];s.add(t)}s.finish(t.instructions);let c=s.geometry;c.indexBuffer.setDataWithSize(s.indexBuffer,s.indexSize,!0),c.buffers[0].setDataWithSize(s.attributeBuffer.float32View,s.attributeSize,!0);let l=s.batches;for(let e=0;e<l.length;e++){let t=l[e];t.bindGroup=Dn(t.textures.textures,t.textures.count,this._renderer.limits.maxBatchableTextures)}return t}_initContext(e){let t=new Nwe;return t.context=e,e._gpuData[this._renderer.uid]=t,this._managedContexts.add(e),t}destroy(){this._managedContexts.destroy(),this._renderer=null}};h3.extension={type:[W.WebGLSystem,W.WebGPUSystem],name:`graphicsContext`},h3.defaultOptions={bezierSmoothness:.5};var g3=h3,Fwe=8,_3=1.1920929e-7,Iwe=1,v3=.01,y3=0,b3=0;function x3(e,t,n,r,i,a,o,s,c,l){let u=(Iwe-Math.min(.99,Math.max(0,l??g3.defaultOptions.bezierSmoothness)))/1;return u*=u,Lwe(t,n,r,i,a,o,s,c,e,u),e}function Lwe(e,t,n,r,i,a,o,s,c,l){S3(e,t,n,r,i,a,o,s,c,l,0),c.push(o,s)}function S3(e,t,n,r,i,a,o,s,c,l,u){if(u>Fwe)return;let d=Math.PI,f=(e+n)/2,p=(t+r)/2,m=(n+i)/2,h=(r+a)/2,g=(i+o)/2,_=(a+s)/2,v=(f+m)/2,y=(p+h)/2,b=(m+g)/2,x=(h+_)/2,S=(v+b)/2,C=(y+x)/2;if(u>0){let u=o-e,f=s-t,p=Math.abs((n-o)*f-(r-s)*u),m=Math.abs((i-o)*f-(a-s)*u),h,g;if(p>_3&&m>_3){if((p+m)*(p+m)<=l*(u*u+f*f)){if(y3<v3){c.push(S,C);return}let l=Math.atan2(a-r,i-n);if(h=Math.abs(l-Math.atan2(r-t,n-e)),g=Math.abs(Math.atan2(s-a,o-i)-l),h>=d&&(h=2*d-h),g>=d&&(g=2*d-g),h+g<y3){c.push(S,C);return}if(b3!==0){if(h>b3){c.push(n,r);return}if(g>b3){c.push(i,a);return}}}}else if(p>_3){if(p*p<=l*(u*u+f*f)){if(y3<v3){c.push(S,C);return}if(h=Math.abs(Math.atan2(a-r,i-n)-Math.atan2(r-t,n-e)),h>=d&&(h=2*d-h),h<y3){c.push(n,r),c.push(i,a);return}if(b3!==0&&h>b3){c.push(n,r);return}}}else if(m>_3){if(m*m<=l*(u*u+f*f)){if(y3<v3){c.push(S,C);return}if(h=Math.abs(Math.atan2(s-a,o-i)-Math.atan2(a-r,i-n)),h>=d&&(h=2*d-h),h<y3){c.push(n,r),c.push(i,a);return}if(b3!==0&&h>b3){c.push(i,a);return}}}else if(u=S-(e+o)/2,f=C-(t+s)/2,u*u+f*f<=l){c.push(S,C);return}}S3(e,t,f,p,v,y,S,C,c,l,u+1),S3(S,C,b,x,g,_,o,s,c,l,u+1)}var Rwe=8,zwe=1.1920929e-7,Bwe=1,Vwe=.01,C3=0;function Hwe(e,t,n,r,i,a,o,s){let c=(Bwe-Math.min(.99,Math.max(0,s??g3.defaultOptions.bezierSmoothness)))/1;return c*=c,Uwe(t,n,r,i,a,o,e,c),e}function Uwe(e,t,n,r,i,a,o,s){w3(o,e,t,n,r,i,a,s,0),o.push(i,a)}function w3(e,t,n,r,i,a,o,s,c){if(c>Rwe)return;let l=Math.PI,u=(t+r)/2,d=(n+i)/2,f=(r+a)/2,p=(i+o)/2,m=(u+f)/2,h=(d+p)/2,g=a-t,_=o-n,v=Math.abs((r-a)*_-(i-o)*g);if(v>zwe){if(v*v<=s*(g*g+_*_)){if(C3<Vwe){e.push(m,h);return}let s=Math.abs(Math.atan2(o-i,a-r)-Math.atan2(i-n,r-t));if(s>=l&&(s=2*l-s),s<C3){e.push(m,h);return}}}else if(g=m-(t+a)/2,_=h-(n+o)/2,g*g+_*_<=s){e.push(m,h);return}w3(e,t,n,u,d,m,h,s,c+1),w3(e,m,h,f,p,a,o,s,c+1)}function T3(e,t,n,r,i,a,o,s){let c=Math.abs(i-a);(!o&&i>a||o&&a>i)&&(c=2*Math.PI-c),s||=Math.max(6,Math.floor(6*r**(1/3)*(c/Math.PI))),s=Math.max(s,3);let l=c/s,u=i;l*=o?-1:1;for(let i=0;i<s+1;i++){let i=Math.cos(u),a=Math.sin(u),o=t+i*r,s=n+a*r;e.push(o,s),u+=l}}function Wwe(e,t,n,r,i,a){let o=e[e.length-2],s=e[e.length-1]-n,c=o-t,l=i-n,u=r-t,d=Math.abs(s*u-c*l);if(d<1e-8||a===0){(e[e.length-2]!==t||e[e.length-1]!==n)&&e.push(t,n);return}let f=s*s+c*c,p=l*l+u*u,m=s*l+c*u,h=a*Math.sqrt(f)/d,g=a*Math.sqrt(p)/d,_=h*m/f,v=g*m/p,y=h*u+g*c,b=h*l+g*s,x=c*(g+_),S=s*(g+_),C=u*(h+v),w=l*(h+v),T=Math.atan2(S-b,x-y),E=Math.atan2(w-b,C-y);T3(e,y+t,b+n,a,T,E,c*l>u*s)}var E3=Math.PI*2,D3={centerX:0,centerY:0,ang1:0,ang2:0},O3=({x:e,y:t},n,r,i,a,o,s,c)=>{e*=n,t*=r;let l=i*e-a*t,u=a*e+i*t;return c.x=l+o,c.y=u+s,c};function Gwe(e,t){let n=t===-1.5707963267948966?-.551915024494:4/3*Math.tan(t/4),r=t===1.5707963267948966?.551915024494:n,i=Math.cos(e),a=Math.sin(e),o=Math.cos(e+t),s=Math.sin(e+t);return[{x:i-a*r,y:a+i*r},{x:o+s*r,y:s-o*r},{x:o,y:s}]}var k3=(e,t,n,r)=>{let i=e*r-t*n<0?-1:1,a=e*n+t*r;return a>1&&(a=1),a<-1&&(a=-1),i*Math.acos(a)},Kwe=(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{let p=i**2,m=a**2,h=u**2,g=d**2,_=p*m-p*g-m*h;_<0&&(_=0),_/=p*g+m*h,_=Math.sqrt(_)*(o===s?-1:1);let v=_*i/a*d,y=_*-a/i*u,b=l*v-c*y+(e+n)/2,x=c*v+l*y+(t+r)/2,S=(u-v)/i,C=(d-y)/a,w=(-u-v)/i,T=(-d-y)/a,E=k3(1,0,S,C),D=k3(S,C,w,T);s===0&&D>0&&(D-=E3),s===1&&D<0&&(D+=E3),f.centerX=b,f.centerY=x,f.ang1=E,f.ang2=D};function qwe(e,t,n,r,i,a,o,s=0,c=0,l=0){if(a===0||o===0)return;let u=Math.sin(s*E3/360),d=Math.cos(s*E3/360),f=d*(t-r)/2+u*(n-i)/2,p=-u*(t-r)/2+d*(n-i)/2;if(f===0&&p===0)return;a=Math.abs(a),o=Math.abs(o);let m=f**2/a**2+p**2/o**2;m>1&&(a*=Math.sqrt(m),o*=Math.sqrt(m)),Kwe(t,n,r,i,a,o,c,l,u,d,f,p,D3);let{ang1:h,ang2:g}=D3,{centerX:_,centerY:v}=D3,y=Math.abs(g)/(E3/4);Math.abs(1-y)<1e-7&&(y=1);let b=Math.max(Math.ceil(y),1);g/=b;let x=e[e.length-2],S=e[e.length-1],C={x:0,y:0};for(let t=0;t<b;t++){let t=Gwe(h,g),{x:n,y:r}=O3(t[0],a,o,d,u,_,v,C),{x:i,y:s}=O3(t[1],a,o,d,u,_,v,C),{x:c,y:l}=O3(t[2],a,o,d,u,_,v,C);x3(e,x,S,n,r,i,s,c,l),x=c,S=l,h+=g}}function Jwe(e,t,n){let r=(e,t)=>{let n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);return{len:i,nx:n/i,ny:r/i}},i=(t,n)=>{t===0?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y)},a=t[t.length-1];for(let o=0;o<t.length;o++){let s=t[o%t.length],c=s.radius??n;if(c<=0){i(o,s),a=s;continue}let l=t[(o+1)%t.length],u=r(s,a),d=r(s,l);if(u.len<1e-4||d.len<1e-4){i(o,s),a=s;continue}let f=Math.asin(u.nx*d.ny-u.ny*d.nx),p=1,m=!1;u.nx*d.nx-u.ny*-d.ny<0?f<0?f=Math.PI+f:(f=Math.PI-f,p=-1,m=!0):f>0&&(p=-1,m=!0);let h=f/2,g,_=Math.abs(Math.cos(h)*c/Math.sin(h));_>Math.min(u.len/2,d.len/2)?(_=Math.min(u.len/2,d.len/2),g=Math.abs(_*Math.sin(h)/Math.cos(h))):g=c;let v=s.x+d.nx*_+-d.ny*g*p,y=s.y+d.ny*_+d.nx*g*p,b=Math.atan2(u.ny,u.nx)+Math.PI/2*p,x=Math.atan2(d.ny,d.nx)-Math.PI/2*p;o===0&&e.moveTo(v+Math.cos(b)*g,y+Math.sin(b)*g),e.arc(v,y,g,b,x,m),a=s}}function Ywe(e,t,n,r){let i=(e,t)=>Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2),a=(e,t,n)=>({x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}),o=t.length;for(let s=0;s<o;s++){let c=t[(s+1)%o],l=c.radius??n;if(l<=0){s===0?e.moveTo(c.x,c.y):e.lineTo(c.x,c.y);continue}let u=t[s],d=t[(s+2)%o],f=i(u,c),p;p=f<1e-4?c:a(c,u,Math.min(f/2,l)/f);let m=i(d,c),h;h=m<1e-4?c:a(c,d,Math.min(m/2,l)/m),s===0?e.moveTo(p.x,p.y):e.lineTo(p.x,p.y),e.quadraticCurveTo(c.x,c.y,h.x,h.y,r)}}var Xwe=new bt,Zwe=class{constructor(e){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new mt,this._graphicsPath2D=e,this.signed=e.checkForHoles}moveTo(e,t){return this.startPoly(e,t),this}lineTo(e,t){this._ensurePoly();let n=this._currentPoly.points,r=n[n.length-2],i=n[n.length-1];return(r!==e||i!==t)&&n.push(e,t),this}arc(e,t,n,r,i,a){this._ensurePoly(!1);let o=this._currentPoly.points;return T3(o,e,t,n,r,i,a),this}arcTo(e,t,n,r,i){this._ensurePoly();let a=this._currentPoly.points;return Wwe(a,e,t,n,r,i),this}arcToSvg(e,t,n,r,i,a,o){let s=this._currentPoly.points;return qwe(s,this._currentPoly.lastX,this._currentPoly.lastY,a,o,e,t,n,r,i),this}bezierCurveTo(e,t,n,r,i,a,o){this._ensurePoly();let s=this._currentPoly;return x3(this._currentPoly.points,s.lastX,s.lastY,e,t,n,r,i,a,o),this}quadraticCurveTo(e,t,n,r,i){this._ensurePoly();let a=this._currentPoly;return Hwe(this._currentPoly.points,a.lastX,a.lastY,e,t,n,r,i),this}closePath(){return this.endPoly(!0),this}addPath(e,t){this.endPoly(),t&&!t.isIdentity()&&(e=e.clone(!0),e.transform(t));let n=this.shapePrimitives,r=n.length;for(let t=0;t<e.instructions.length;t++){let n=e.instructions[t];this[n.action](...n.data)}if(e.checkForHoles&&n.length-r>1){let e=null;for(let t=r;t<n.length;t++){let r=n[t];if(r.shape.type===`polygon`){let i=r.shape,a=e?.shape;a&&a.containsPolygon(i)?(e.holes||=[],e.holes.push(r),n.copyWithin(t,t+1),n.length--,t--):e=r}}}return this}finish(e=!1){this.endPoly(e)}rect(e,t,n,r,i){return this.drawShape(new bt(e,t,n,r),i),this}circle(e,t,n,r){return this.drawShape(new cwe(e,t,n),r),this}poly(e,t,n){let r=new X4(e);return r.closePath=t,this.drawShape(r,n),this}regularPoly(e,t,n,r,i=0,a){r=Math.max(r|0,3);let o=-1*Math.PI/2+i,s=Math.PI*2/r,c=[];for(let i=0;i<r;i++){let r=o-i*s;c.push(e+n*Math.cos(r),t+n*Math.sin(r))}return this.poly(c,!0,a),this}roundPoly(e,t,n,r,i,a=0,o){if(r=Math.max(r|0,3),i<=0)return this.regularPoly(e,t,n,r,a);let s=n*Math.sin(Math.PI/r)-.001;i=Math.min(i,s);let c=-1*Math.PI/2+a,l=Math.PI*2/r,u=(r-2)*Math.PI/r/2;for(let a=0;a<r;a++){let r=a*l+c,s=e+n*Math.cos(r),d=t+n*Math.sin(r),f=r+Math.PI+u,p=r-Math.PI-u,m=s+i*Math.cos(f),h=d+i*Math.sin(f),g=s+i*Math.cos(p),_=d+i*Math.sin(p);a===0?this.moveTo(m,h):this.lineTo(m,h),this.quadraticCurveTo(s,d,g,_,o)}return this.closePath()}roundShape(e,t,n=!1,r){return e.length<3?this:(n?Ywe(this,e,t,r):Jwe(this,e,t),this.closePath())}filletRect(e,t,n,r,i){if(i===0)return this.rect(e,t,n,r);let a=Math.min(n,r)/2,o=Math.min(a,Math.max(-a,i)),s=e+n,c=t+r,l=o<0?-o:0,u=Math.abs(o);return this.moveTo(e,t+u).arcTo(e+l,t+l,e+u,t,u).lineTo(s-u,t).arcTo(s-l,t+l,s,t+u,u).lineTo(s,c-u).arcTo(s-l,c-l,e+n-u,c,u).lineTo(e+u,c).arcTo(e+l,c-l,e,c-u,u).closePath()}chamferRect(e,t,n,r,i,a){if(i<=0)return this.rect(e,t,n,r);let o=Math.min(i,Math.min(n,r)/2),s=e+n,c=t+r,l=[e+o,t,s-o,t,s,t+o,s,c-o,s-o,c,e+o,c,e,c-o,e,t+o];for(let e=l.length-1;e>=2;e-=2)l[e]===l[e-2]&&l[e-1]===l[e-3]&&l.splice(e-1,2);return this.poly(l,!0,a)}ellipse(e,t,n,r,i){return this.drawShape(new lwe(e,t,n,r),i),this}roundRect(e,t,n,r,i,a){return this.drawShape(new pwe(e,t,n,r,i),a),this}drawShape(e,t){return this.endPoly(),this.shapePrimitives.push({shape:e,transform:t}),this}startPoly(e,t){let n=this._currentPoly;return n&&this.endPoly(),n=new X4,n.points.push(e,t),this._currentPoly=n,this}endPoly(e=!1){let t=this._currentPoly;return t&&t.points.length>2&&(t.closePath=e,this.shapePrimitives.push({shape:t})),this._currentPoly=null,this}_ensurePoly(e=!0){if(!this._currentPoly&&(this._currentPoly=new X4,e)){let e=this.shapePrimitives[this.shapePrimitives.length-1];if(e){let t=e.shape.x,n=e.shape.y;if(e.transform&&!e.transform.isIdentity()){let r=e.transform,i=t;t=r.a*t+r.c*n+r.tx,n=r.b*i+r.d*n+r.ty}this._currentPoly.points.push(t,n)}else this._currentPoly.points.push(0,0)}}buildPath(){let e=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let t=0;t<e.instructions.length;t++){let n=e.instructions[t];this[n.action](...n.data)}this.finish()}get bounds(){let e=this._bounds;e.clear();let t=this.shapePrimitives;for(let n=0;n<t.length;n++){let r=t[n],i=r.shape.getBounds(Xwe);r.transform?e.addRect(i,r.transform):e.addRect(i)}return e}},A3=class e{constructor(e,t=!1){this.instructions=[],this.uid=vt(`graphicsPath`),this._dirty=!0,this.checkForHoles=t,typeof e==`string`?swe(e,this):this.instructions=e?.slice()??[]}get shapePath(){return this._shapePath||=new Zwe(this),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(e,t){return e=e.clone(),this.instructions.push({action:`addPath`,data:[e,t]}),this._dirty=!0,this}arc(...e){return this.instructions.push({action:`arc`,data:e}),this._dirty=!0,this}arcTo(...e){return this.instructions.push({action:`arcTo`,data:e}),this._dirty=!0,this}arcToSvg(...e){return this.instructions.push({action:`arcToSvg`,data:e}),this._dirty=!0,this}bezierCurveTo(...e){return this.instructions.push({action:`bezierCurveTo`,data:e}),this._dirty=!0,this}bezierCurveToShort(e,t,n,r,i){let a=this.instructions[this.instructions.length-1],o=this.getLastPoint(Et.shared),s=0,c=0;if(!a||a.action!==`bezierCurveTo`)s=o.x,c=o.y;else{s=a.data[2],c=a.data[3];let e=o.x,t=o.y;s=e+(e-s),c=t+(t-c)}return this.instructions.push({action:`bezierCurveTo`,data:[s,c,e,t,n,r,i]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:`closePath`,data:[]}),this._dirty=!0,this}ellipse(...e){return this.instructions.push({action:`ellipse`,data:e}),this._dirty=!0,this}lineTo(...e){return this.instructions.push({action:`lineTo`,data:e}),this._dirty=!0,this}moveTo(...e){return this.instructions.push({action:`moveTo`,data:e}),this}quadraticCurveTo(...e){return this.instructions.push({action:`quadraticCurveTo`,data:e}),this._dirty=!0,this}quadraticCurveToShort(e,t,n){let r=this.instructions[this.instructions.length-1],i=this.getLastPoint(Et.shared),a=0,o=0;if(!r||r.action!==`quadraticCurveTo`)a=i.x,o=i.y;else{a=r.data[0],o=r.data[1];let e=i.x,t=i.y;a=e+(e-a),o=t+(t-o)}return this.instructions.push({action:`quadraticCurveTo`,data:[a,o,e,t,n]}),this._dirty=!0,this}rect(e,t,n,r,i){return this.instructions.push({action:`rect`,data:[e,t,n,r,i]}),this._dirty=!0,this}circle(e,t,n,r){return this.instructions.push({action:`circle`,data:[e,t,n,r]}),this._dirty=!0,this}roundRect(...e){return this.instructions.push({action:`roundRect`,data:e}),this._dirty=!0,this}poly(...e){return this.instructions.push({action:`poly`,data:e}),this._dirty=!0,this}regularPoly(...e){return this.instructions.push({action:`regularPoly`,data:e}),this._dirty=!0,this}roundPoly(...e){return this.instructions.push({action:`roundPoly`,data:e}),this._dirty=!0,this}roundShape(...e){return this.instructions.push({action:`roundShape`,data:e}),this._dirty=!0,this}filletRect(...e){return this.instructions.push({action:`filletRect`,data:e}),this._dirty=!0,this}chamferRect(...e){return this.instructions.push({action:`chamferRect`,data:e}),this._dirty=!0,this}star(e,t,n,r,i,a,o){i||=r/2;let s=-1*Math.PI/2+a,c=n*2,l=Math.PI*2/c,u=[];for(let n=0;n<c;n++){let a=n%2?i:r,o=n*l+s;u.push(e+a*Math.cos(o),t+a*Math.sin(o))}return this.poly(u,!0,o),this}clone(t=!1){let n=new e;if(n.checkForHoles=this.checkForHoles,!t)n.instructions=this.instructions.slice();else for(let e=0;e<this.instructions.length;e++){let t=this.instructions[e];n.instructions.push({action:t.action,data:t.data.slice()})}return n}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(e){if(e.isIdentity())return this;let t=e.a,n=e.b,r=e.c,i=e.d,a=e.tx,o=e.ty,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0;for(let h=0;h<this.instructions.length;h++){let g=this.instructions[h],_=g.data;switch(g.action){case`moveTo`:case`lineTo`:s=_[0],c=_[1],_[0]=t*s+r*c+a,_[1]=n*s+i*c+o;break;case`bezierCurveTo`:l=_[0],u=_[1],d=_[2],f=_[3],s=_[4],c=_[5],_[0]=t*l+r*u+a,_[1]=n*l+i*u+o,_[2]=t*d+r*f+a,_[3]=n*d+i*f+o,_[4]=t*s+r*c+a,_[5]=n*s+i*c+o;break;case`quadraticCurveTo`:l=_[0],u=_[1],s=_[2],c=_[3],_[0]=t*l+r*u+a,_[1]=n*l+i*u+o,_[2]=t*s+r*c+a,_[3]=n*s+i*c+o;break;case`arcToSvg`:s=_[5],c=_[6],p=_[0],m=_[1],_[0]=t*p+r*m,_[1]=n*p+i*m,_[5]=t*s+r*c+a,_[6]=n*s+i*c+o;break;case`circle`:_[4]=j3(_[3],e);break;case`rect`:_[4]=j3(_[4],e);break;case`ellipse`:_[8]=j3(_[8],e);break;case`roundRect`:_[5]=j3(_[5],e);break;case`addPath`:_[0].transform(e);break;case`poly`:_[2]=j3(_[2],e);break;default:ot(`unknown transform action`,g.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(e){let t=this.instructions.length-1,n=this.instructions[t];if(!n)return e.x=0,e.y=0,e;for(;n.action===`closePath`;){if(t--,t<0)return e.x=0,e.y=0,e;n=this.instructions[t]}switch(n.action){case`moveTo`:case`lineTo`:e.x=n.data[0],e.y=n.data[1];break;case`quadraticCurveTo`:e.x=n.data[2],e.y=n.data[3];break;case`bezierCurveTo`:e.x=n.data[4],e.y=n.data[5];break;case`arc`:case`arcToSvg`:e.x=n.data[5],e.y=n.data[6];break;case`addPath`:n.data[0].getLastPoint(e);break}return e}};function j3(e,t){return e?e.prepend(t):t.clone()}function M3(e,t,n){let r=e.getAttribute(t);return r?Number(r):n}function Qwe(e,t){let n=e.querySelectorAll(`defs`);for(let e=0;e<n.length;e++){let r=n[e];for(let e=0;e<r.children.length;e++){let n=r.children[e];switch(n.nodeName.toLowerCase()){case`lineargradient`:t.defs[n.id]=$we(n);break;case`radialgradient`:t.defs[n.id]=eTe(n);break;default:break}}}}function $we(e){let t=new l3(M3(e,`x1`,0),M3(e,`y1`,0),M3(e,`x2`,1),M3(e,`y2`,0),(e.getAttribute(`gradientUnits`)||`objectBoundingBox`)===`objectBoundingBox`?`local`:`global`);for(let n=0;n<e.children.length;n++){let r=e.children[n],i=M3(r,`offset`,0),a=lt.shared.setValue(r.getAttribute(`stop-color`)).toNumber();t.addColorStop(i,a)}return t}function eTe(e){return ot(`[SVG Parser] Radial gradients are not yet supported`),new l3(0,0,1,0)}function N3(e){let t=e.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return t?t[1]:``}var P3={fill:{type:`paint`,default:0},"fill-opacity":{type:`number`,default:1},stroke:{type:`paint`,default:0},"stroke-width":{type:`number`,default:1},"stroke-opacity":{type:`number`,default:1},"stroke-linecap":{type:`string`,default:`butt`},"stroke-linejoin":{type:`string`,default:`miter`},"stroke-miterlimit":{type:`number`,default:10},"stroke-dasharray":{type:`string`,default:`none`},"stroke-dashoffset":{type:`number`,default:0},opacity:{type:`number`,default:1}};function F3(e,t){let n=e.getAttribute(`style`),r={},i={},a={strokeStyle:r,fillStyle:i,useFill:!1,useStroke:!1};for(let n in P3){let r=e.getAttribute(n);r&&I3(t,a,n,r.trim())}if(n){let e=n.split(`;`);for(let n=0;n<e.length;n++){let[r,i]=e[n].trim().split(`:`);P3[r]&&I3(t,a,r,i.trim())}}return{strokeStyle:a.useStroke?r:null,fillStyle:a.useFill?i:null,useFill:a.useFill,useStroke:a.useStroke}}function I3(e,t,n,r){switch(n){case`stroke`:if(r!==`none`){if(r.startsWith(`url(`)){let n=N3(r);t.strokeStyle.fill=e.defs[n]}else t.strokeStyle.color=lt.shared.setValue(r).toNumber();t.useStroke=!0}break;case`stroke-width`:t.strokeStyle.width=Number(r);break;case`fill`:if(r!==`none`){if(r.startsWith(`url(`)){let n=N3(r);t.fillStyle.fill=e.defs[n]}else t.fillStyle.color=lt.shared.setValue(r).toNumber();t.useFill=!0}break;case`fill-opacity`:t.fillStyle.alpha=Number(r);break;case`stroke-opacity`:t.strokeStyle.alpha=Number(r);break;case`opacity`:t.fillStyle.alpha=Number(r),t.strokeStyle.alpha=Number(r);break}}function tTe(e){if(e.length<=2)return!0;let t=e.map(e=>e.area).sort((e,t)=>t-e),[n,r]=t,i=t[t.length-1],a=n/r,o=r/i;return!(a>3&&o<2)}function nTe(e){return e.split(/(?=[Mm])/).filter(e=>e.trim().length>0)}function rTe(e){let t=e.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!t||t.length<4)return 0;let n=t.map(Number),r=[],i=[];for(let e=0;e<n.length;e+=2)e+1<n.length&&(r.push(n[e]),i.push(n[e+1]));if(r.length===0||i.length===0)return 0;let a=Math.min(...r),o=Math.max(...r),s=Math.min(...i),c=Math.max(...i);return(o-a)*(c-s)}function L3(e,t){let n=new A3(e,!1);for(let e of n.instructions)t.instructions.push(e)}function iTe(e,t){if(typeof e==`string`){let t=document.createElement(`div`);t.innerHTML=e.trim(),e=t.querySelector(`svg`)}let n={context:t,defs:{},path:new A3};Qwe(e,n);let r=e.children,{fillStyle:i,strokeStyle:a}=F3(e,n);for(let e=0;e<r.length;e++){let t=r[e];t.nodeName.toLowerCase()!==`defs`&&R3(t,n,i,a)}return t}function R3(e,t,n,r){let i=e.children,{fillStyle:a,strokeStyle:o}=F3(e,t);a&&n?n={...n,...a}:a&&(n=a),o&&r?r={...r,...o}:o&&(r=o);let s=!n&&!r;s&&(n={color:0});let c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w;switch(e.nodeName.toLowerCase()){case`path`:{x=e.getAttribute(`d`);let i=e.getAttribute(`fill-rule`),a=nTe(x),o=i===`evenodd`,s=a.length>1;if(o&&s){let e=a.map(e=>({path:e,area:rTe(e)}));if(e.sort((e,t)=>t.area-e.area),a.length>3||!tTe(e))for(let i=0;i<e.length;i++){let a=e[i],o=i===0;t.context.beginPath();let s=new A3(void 0,!0);L3(a.path,s),t.context.path(s),o?(n&&t.context.fill(n),r&&t.context.stroke(r)):t.context.cut()}else for(let i=0;i<e.length;i++){let a=e[i],o=i%2==1;t.context.beginPath();let s=new A3(void 0,!0);L3(a.path,s),t.context.path(s),o?t.context.cut():(n&&t.context.fill(n),r&&t.context.stroke(r))}}else S=new A3(x,i?i===`evenodd`:!0),t.context.path(S),n&&t.context.fill(n),r&&t.context.stroke(r);break}case`circle`:m=M3(e,`cx`,0),h=M3(e,`cy`,0),g=M3(e,`r`,0),t.context.ellipse(m,h,g,g),n&&t.context.fill(n),r&&t.context.stroke(r);break;case`rect`:c=M3(e,`x`,0),l=M3(e,`y`,0),C=M3(e,`width`,0),w=M3(e,`height`,0),_=M3(e,`rx`,0),v=M3(e,`ry`,0),_||v?t.context.roundRect(c,l,C,w,_||v):t.context.rect(c,l,C,w),n&&t.context.fill(n),r&&t.context.stroke(r);break;case`ellipse`:m=M3(e,`cx`,0),h=M3(e,`cy`,0),_=M3(e,`rx`,0),v=M3(e,`ry`,0),t.context.beginPath(),t.context.ellipse(m,h,_,v),n&&t.context.fill(n),r&&t.context.stroke(r);break;case`line`:u=M3(e,`x1`,0),d=M3(e,`y1`,0),f=M3(e,`x2`,0),p=M3(e,`y2`,0),t.context.beginPath(),t.context.moveTo(u,d),t.context.lineTo(f,p),r&&t.context.stroke(r);break;case`polygon`:b=e.getAttribute(`points`),y=b.match(/-?\d+/g).map(e=>parseInt(e,10)),t.context.poly(y,!0),n&&t.context.fill(n),r&&t.context.stroke(r);break;case`polyline`:b=e.getAttribute(`points`),y=b.match(/-?\d+/g).map(e=>parseInt(e,10)),t.context.poly(y,!1),r&&t.context.stroke(r);break;case`g`:case`svg`:break;default:ot(`[SVG parser] <${e.nodeName}> elements unsupported`);break}s&&(n=null);for(let e=0;e<i.length;e++)R3(i[e],t,n,r)}var z3={repeat:{addressModeU:`repeat`,addressModeV:`repeat`},"repeat-x":{addressModeU:`repeat`,addressModeV:`clamp-to-edge`},"repeat-y":{addressModeU:`clamp-to-edge`,addressModeV:`repeat`},"no-repeat":{addressModeU:`clamp-to-edge`,addressModeV:`clamp-to-edge`}},B3=class{constructor(e,t){this.uid=vt(`fillPattern`),this._tick=0,this.transform=new Qe,this.texture=e,this.transform.scale(1/e.frame.width,1/e.frame.height),t&&(e.source.style.addressModeU=z3[t].addressModeU,e.source.style.addressModeV=z3[t].addressModeV)}setTransform(e){let t=this.texture;this.transform.copyFrom(e),this.transform.invert(),this.transform.scale(1/t.frame.width,1/t.frame.height),this._tick++}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture=e,this._tick++)}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}};function aTe(e){return lt.isColorLike(e)}function V3(e){return e instanceof B3}function H3(e){return e instanceof l3}function oTe(e){return e instanceof et}function sTe(e,t,n){let r=lt.shared.setValue(t??0);return e.color=r.toNumber(),e.alpha=r.alpha===1?n.alpha:r.alpha,e.texture=et.WHITE,{...n,...e}}function cTe(e,t,n){return e.texture=t,{...n,...e}}function U3(e,t,n){return e.fill=t,e.color=16777215,e.texture=t.texture,e.matrix=t.transform,{...n,...e}}function W3(e,t,n){return t.buildGradient(),e.fill=t,e.color=16777215,e.texture=t.texture,e.matrix=t.transform,e.textureSpace=t.textureSpace,{...n,...e}}function lTe(e,t){let n={...t,...e},r=lt.shared.setValue(n.color);return n.alpha*=r.alpha,n.color=r.toNumber(),n}function G3(e,t){if(e==null)return null;let n={},r=e;return aTe(e)?sTe(n,e,t):oTe(e)?cTe(n,e,t):V3(e)?U3(n,e,t):H3(e)?W3(n,e,t):r.fill&&V3(r.fill)?U3(r,r.fill,t):r.fill&&H3(r.fill)?W3(r,r.fill,t):lTe(r,t)}function K3(e,t){let{width:n,alignment:r,miterLimit:i,cap:a,join:o,pixelLine:s,...c}=t,l=G3(e,c);return l?{width:n,alignment:r,miterLimit:i,cap:a,join:o,pixelLine:s,...l}:null}var uTe=new Et,q3=new Qe,J3=class e extends Ut{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=vt(`graphicsContext`),this.dirty=!0,this.batchMode=`auto`,this.instructions=[],this.destroyed=!1,this._activePath=new A3,this._transform=new Qe,this._fillStyle={...e.defaultFillStyle},this._strokeStyle={...e.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new mt,this._boundsDirty=!0}clone(){let t=new e;return t.batchMode=this.batchMode,t.instructions=this.instructions.slice(),t._activePath=this._activePath.clone(),t._transform=this._transform.clone(),t._fillStyle={...this._fillStyle},t._strokeStyle={...this._strokeStyle},t._stateStack=this._stateStack.slice(),t._bounds=this._bounds.clone(),t._boundsDirty=!0,t}get fillStyle(){return this._fillStyle}set fillStyle(t){this._fillStyle=G3(t,e.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(t){this._strokeStyle=K3(t,e.defaultStrokeStyle)}setFillStyle(t){return this._fillStyle=G3(t,e.defaultFillStyle),this}setStrokeStyle(t){return this._strokeStyle=G3(t,e.defaultStrokeStyle),this}texture(e,t,n,r,i,a){return this.instructions.push({action:`texture`,data:{image:e,dx:n||0,dy:r||0,dw:i||e.frame.width,dh:a||e.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:t||t===0?lt.shared.setValue(t).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new A3,this}fill(t,n){let r,i=this.instructions[this.instructions.length-1];return r=this._tick===0&&i?.action===`stroke`?i.data.path:this._activePath.clone(),r?(t!=null&&(n!==void 0&&typeof t==`number`&&(zt(st,`GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead`),t={color:t,alpha:n}),this._fillStyle=G3(t,e.defaultFillStyle)),this.instructions.push({action:`fill`,data:{style:this.fillStyle,path:r}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){let{x:e,y:t}=this._activePath.getLastPoint(Et.shared);this._activePath.clear(),this._activePath.moveTo(e,t)}stroke(t){let n,r=this.instructions[this.instructions.length-1];return n=this._tick===0&&r?.action===`fill`?r.data.path:this._activePath.clone(),n?(t!=null&&(this._strokeStyle=K3(t,e.defaultStrokeStyle)),this.instructions.push({action:`stroke`,data:{style:this.strokeStyle,path:n}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let e=0;e<2;e++){let t=this.instructions[this.instructions.length-1-e],n=this._activePath.clone();if(t&&(t.action===`stroke`||t.action===`fill`))if(t.data.hole)t.data.hole.addPath(n);else{t.data.hole=n;break}}return this._initNextPathLocation(),this}arc(e,t,n,r,i,a){this._tick++;let o=this._transform;return this._activePath.arc(o.a*e+o.c*t+o.tx,o.b*e+o.d*t+o.ty,n,r,i,a),this}arcTo(e,t,n,r,i){this._tick++;let a=this._transform;return this._activePath.arcTo(a.a*e+a.c*t+a.tx,a.b*e+a.d*t+a.ty,a.a*n+a.c*r+a.tx,a.b*n+a.d*r+a.ty,i),this}arcToSvg(e,t,n,r,i,a,o){this._tick++;let s=this._transform;return this._activePath.arcToSvg(e,t,n,r,i,s.a*a+s.c*o+s.tx,s.b*a+s.d*o+s.ty),this}bezierCurveTo(e,t,n,r,i,a,o){this._tick++;let s=this._transform;return this._activePath.bezierCurveTo(s.a*e+s.c*t+s.tx,s.b*e+s.d*t+s.ty,s.a*n+s.c*r+s.tx,s.b*n+s.d*r+s.ty,s.a*i+s.c*a+s.tx,s.b*i+s.d*a+s.ty,o),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(e,t,n,r){return this._tick++,this._activePath.ellipse(e,t,n,r,this._transform.clone()),this}circle(e,t,n){return this._tick++,this._activePath.circle(e,t,n,this._transform.clone()),this}path(e){return this._tick++,this._activePath.addPath(e,this._transform.clone()),this}lineTo(e,t){this._tick++;let n=this._transform;return this._activePath.lineTo(n.a*e+n.c*t+n.tx,n.b*e+n.d*t+n.ty),this}moveTo(e,t){this._tick++;let n=this._transform,r=this._activePath.instructions,i=n.a*e+n.c*t+n.tx,a=n.b*e+n.d*t+n.ty;return r.length===1&&r[0].action===`moveTo`?(r[0].data[0]=i,r[0].data[1]=a,this):(this._activePath.moveTo(i,a),this)}quadraticCurveTo(e,t,n,r,i){this._tick++;let a=this._transform;return this._activePath.quadraticCurveTo(a.a*e+a.c*t+a.tx,a.b*e+a.d*t+a.ty,a.a*n+a.c*r+a.tx,a.b*n+a.d*r+a.ty,i),this}rect(e,t,n,r){return this._tick++,this._activePath.rect(e,t,n,r,this._transform.clone()),this}roundRect(e,t,n,r,i){return this._tick++,this._activePath.roundRect(e,t,n,r,i,this._transform.clone()),this}poly(e,t){return this._tick++,this._activePath.poly(e,t,this._transform.clone()),this}regularPoly(e,t,n,r,i=0,a){return this._tick++,this._activePath.regularPoly(e,t,n,r,i,a),this}roundPoly(e,t,n,r,i,a){return this._tick++,this._activePath.roundPoly(e,t,n,r,i,a),this}roundShape(e,t,n,r){return this._tick++,this._activePath.roundShape(e,t,n,r),this}filletRect(e,t,n,r,i){return this._tick++,this._activePath.filletRect(e,t,n,r,i),this}chamferRect(e,t,n,r,i,a){return this._tick++,this._activePath.chamferRect(e,t,n,r,i,a),this}star(e,t,n,r,i=0,a=0){return this._tick++,this._activePath.star(e,t,n,r,i,a,this._transform.clone()),this}svg(e){return this._tick++,iTe(e,this),this}restore(){let e=this._stateStack.pop();return e&&(this._transform=e.transform,this._fillStyle=e.fillStyle,this._strokeStyle=e.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(e){return this._transform.rotate(e),this}scale(e,t=e){return this._transform.scale(e,t),this}setTransform(e,t,n,r,i,a){return e instanceof Qe?(this._transform.set(e.a,e.b,e.c,e.d,e.tx,e.ty),this):(this._transform.set(e,t,n,r,i,a),this)}transform(e,t,n,r,i,a){return e instanceof Qe?(this._transform.append(e),this):(q3.set(e,t,n,r,i,a),this._transform.append(q3),this)}translate(e,t=e){return this._transform.translate(e,t),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this._boundsDirty=!0,!this.dirty&&(this.emit(`update`,this,16),this.dirty=!0)}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=!1;let e=this._bounds;e.clear();for(let t=0;t<this.instructions.length;t++){let n=this.instructions[t],r=n.action;if(r===`fill`){let t=n.data;e.addBounds(t.path.bounds)}else if(r===`texture`){let t=n.data;e.addFrame(t.dx,t.dy,t.dx+t.dw,t.dy+t.dh,t.transform)}if(r===`stroke`){let t=n.data,r=t.style.alignment,i=t.style.width*(1-r),a=t.path.bounds;e.addFrame(a.minX-i,a.minY-i,a.maxX+i,a.maxY+i)}}return e}containsPoint(e){if(!this.bounds.containsPoint(e.x,e.y))return!1;let t=this.instructions,n=!1;for(let r=0;r<t.length;r++){let i=t[r],a=i.data,o=a.path;if(!i.action||!o)continue;let s=a.style,c=o.shapePath.shapePrimitives;for(let t=0;t<c.length;t++){let r=c[t].shape;if(!s||!r)continue;let o=c[t].transform,l=o?o.applyInverse(e,uTe):e;if(i.action===`fill`)n=r.contains(l.x,l.y);else{let e=s;n=r.strokeContains(l.x,l.y,e.width,e.alignment)}let u=a.hole;if(u){let e=u.shapePath?.shapePrimitives;if(e)for(let t=0;t<e.length;t++)e[t].shape.contains(l.x,l.y)&&(n=!1)}if(n)return!0}}return n}unload(){this.emit(`unload`,this);for(let e in this._gpuData)this._gpuData[e]?.destroy();this._gpuData=Object.create(null)}destroy(e=!1){if(!this.destroyed){if(this.destroyed=!0,this._stateStack.length=0,this._transform=null,this.unload(),this.emit(`destroy`,this),this.removeAllListeners(),typeof e==`boolean`?e:e?.texture){let t=typeof e==`boolean`?e:e?.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&`uid`in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(t)),this._strokeStyle.texture&&(this._strokeStyle.fill&&`uid`in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(t))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}}};J3.defaultFillStyle={color:16777215,alpha:1,texture:et.WHITE,matrix:null,fill:null,textureSpace:`local`},J3.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:`butt`,join:`miter`,texture:et.WHITE,matrix:null,fill:null,textureSpace:`local`,pixelLine:!1};var Y3=J3,X3=new class{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e}addTickerListener(){this._tickerAdded||!this.domElement||(kt.system.add(this._tickerUpdate,this,Ot.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&=(kt.system.remove(this._tickerUpdate,this),!1)}pointerMoved(){this._didMove=!0}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}let e=this.events._rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType===`touch`||globalThis.document.dispatchEvent(this.events.supportsPointerEvents?new PointerEvent(`pointermove`,{clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,pointerId:e.pointerId}):new MouseEvent(`mousemove`,{clientX:e.clientX,clientY:e.clientY}))}_tickerUpdate(e){this._deltaTime+=e.deltaTime,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this._update())}destroy(){this.removeTickerListener(),this.events=null,this.domElement=null,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}},Z3=class extends x4{constructor(){super(...arguments),this.client=new Et,this.movement=new Et,this.offset=new Et,this.global=new Et,this.screen=new Et}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(e,t,n){return e.worldTransform.applyInverse(n||this.global,t)}getModifierState(e){return`getModifierState`in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){throw Error(`Method not implemented.`)}},Q3=class extends Z3{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return this.type===`pointermove`||this.type===`mousemove`||this.type===`touchmove`?[this]:[]}getPredictedEvents(){throw Error(`getPredictedEvents is not supported!`)}},$3=class extends Z3{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}};$3.DOM_DELTA_PIXEL=0,$3.DOM_DELTA_LINE=1,$3.DOM_DELTA_PAGE=2;var dTe=2048,fTe=new Et,e6=new Et,pTe=class{constructor(e){this.dispatch=new Ut,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=e,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping(`pointerdown`,this.mapPointerDown),this.addEventMapping(`pointermove`,this.mapPointerMove),this.addEventMapping(`pointerout`,this.mapPointerOut),this.addEventMapping(`pointerleave`,this.mapPointerOut),this.addEventMapping(`pointerover`,this.mapPointerOver),this.addEventMapping(`pointerup`,this.mapPointerUp),this.addEventMapping(`pointerupoutside`,this.mapPointerUpOutside),this.addEventMapping(`wheel`,this.mapWheel)}addEventMapping(e,t){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:t,priority:0}),this.mappingTable[e].sort((e,t)=>e.priority-t.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;let t=this.mappingTable[e.type];if(t)for(let n=0,r=t.length;n<r;n++)t[n].fn(e);else ot(`[EventBoundary]: Event mapping not defined for ${e.type}`)}hitTest(e,t){X3.pauseUpdate=!0;let n=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?`hitTestMoveRecursive`:`hitTestRecursive`,r=this[n](this.rootTarget,this.rootTarget.eventMode,fTe.set(e,t),this.hitTestFn,this.hitPruneFn);return r&&r[0]}propagate(e,t){if(!e.target)return;let n=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(let r=0,i=n.length-1;r<i;r++)if(e.currentTarget=n[r],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,t),!(e.propagationStopped||e.propagationImmediatelyStopped)){e.eventPhase=e.BUBBLING_PHASE;for(let r=n.length-2;r>=0;r--)if(e.currentTarget=n[r],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,n=this._allInteractiveElements){if(n.length===0)return;e.eventPhase=e.BUBBLING_PHASE;let r=Array.isArray(t)?t:[t];for(let t=n.length-1;t>=0;t--)r.forEach(r=>{e.currentTarget=n[t],this.notifyTarget(e,r)})}propagationPath(e){let t=[e];for(let n=0;n<dTe&&e!==this.rootTarget&&e.parent;n++){if(!e.parent)throw Error(`Cannot find propagation path to disconnected target`);t.push(e.parent),e=e.parent}return t.reverse(),t}hitTestMoveRecursive(e,t,n,r,i,a=!1){let o=!1;if(this._interactivePrune(e))return null;if((e.eventMode===`dynamic`||t===`dynamic`)&&(X3.pauseUpdate=!1),e.interactiveChildren&&e.children){let s=e.children;for(let c=s.length-1;c>=0;c--){let l=s[c],u=this.hitTestMoveRecursive(l,this._isInteractive(t)?t:l.eventMode,n,r,i,a||i(e,n));if(u){if(u.length>0&&!u[u.length-1].parent)continue;let t=e.isInteractive();(u.length>0||t)&&(t&&this._allInteractiveElements.push(e),u.push(e)),this._hitElements.length===0&&(this._hitElements=u),o=!0}}}let s=this._isInteractive(t),c=e.isInteractive();return c&&c&&this._allInteractiveElements.push(e),a||this._hitElements.length>0?null:o?this._hitElements:s&&!i(e,n)&&r(e,n)?c?[e]:[]:null}hitTestRecursive(e,t,n,r,i){if(this._interactivePrune(e)||i(e,n))return null;if((e.eventMode===`dynamic`||t===`dynamic`)&&(X3.pauseUpdate=!1),e.interactiveChildren&&e.children){let a=e.children,o=n;for(let n=a.length-1;n>=0;n--){let s=a[n],c=this.hitTestRecursive(s,this._isInteractive(t)?t:s.eventMode,o,r,i);if(c){if(c.length>0&&!c[c.length-1].parent)continue;let t=e.isInteractive();return(c.length>0||t)&&c.push(e),c}}}let a=this._isInteractive(t),o=e.isInteractive();return a&&r(e,n)?o?[e]:[]:null}_isInteractive(e){return e===`static`||e===`dynamic`}_interactivePrune(e){return!e||!e.visible||!e.renderable||!e.measurable||e.eventMode===`none`||e.eventMode===`passive`&&!e.interactiveChildren}hitPruneFn(e,t){if(e.hitArea&&(e.worldTransform.applyInverse(t,e6),!e.hitArea.contains(e6.x,e6.y)))return!0;if(e.effects&&e.effects.length)for(let n=0;n<e.effects.length;n++){let r=e.effects[n];if(r.containsPoint&&!r.containsPoint(t,this.hitTestFn))return!0}return!1}hitTestFn(e,t){return e.hitArea?!0:e?.containsPoint?(e.worldTransform.applyInverse(t,e6),e.containsPoint(e6)):!1}notifyTarget(e,t){if(!e.currentTarget.isInteractive())return;t??=e.type;let n=`on${t}`;e.currentTarget[n]?.(e);let r=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${t}capture`:t;this._notifyListeners(e,r),e.eventPhase===e.AT_TARGET&&this._notifyListeners(e,t)}mapPointerDown(e){if(!(e instanceof Q3)){ot(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=this.createPointerEvent(e);if(this.dispatchEvent(t,`pointerdown`),t.pointerType===`touch`)this.dispatchEvent(t,`touchstart`);else if(t.pointerType===`mouse`||t.pointerType===`pen`){let e=t.button===2;this.dispatchEvent(t,e?`rightdown`:`mousedown`)}let n=this.trackingData(e.pointerId);n.pressTargetsByButton[e.button]=t.composedPath(),this.freeEvent(t)}mapPointerMove(e){if(!(e instanceof Q3)){ot(`EventBoundary cannot map a non-pointer event as a pointer event`);return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;let t=this.createPointerEvent(e);this._isPointerMoveEvent=!1;let n=t.pointerType===`mouse`||t.pointerType===`pen`,r=this.trackingData(e.pointerId),i=this.findMountedTarget(r.overTargets);if(r.overTargets?.length>0&&i!==t.target){let r=e.type===`mousemove`?`mouseout`:`pointerout`,a=this.createPointerEvent(e,r,i);if(this.dispatchEvent(a,`pointerout`),n&&this.dispatchEvent(a,`mouseout`),!t.composedPath().includes(i)){let r=this.createPointerEvent(e,`pointerleave`,i);for(r.eventPhase=r.AT_TARGET;r.target&&!t.composedPath().includes(r.target);)r.currentTarget=r.target,this.notifyTarget(r),n&&this.notifyTarget(r,`mouseleave`),r.target=r.target.parent;this.freeEvent(r)}this.freeEvent(a)}if(i!==t.target){let r=e.type===`mousemove`?`mouseover`:`pointerover`,a=this.clonePointerEvent(t,r);this.dispatchEvent(a,`pointerover`),n&&this.dispatchEvent(a,`mouseover`);let o=i?.parent;for(;o&&o!==this.rootTarget.parent&&o!==t.target;)o=o.parent;if(!o||o===this.rootTarget.parent){let e=this.clonePointerEvent(t,`pointerenter`);for(e.eventPhase=e.AT_TARGET;e.target&&e.target!==i&&e.target!==this.rootTarget.parent;)e.currentTarget=e.target,this.notifyTarget(e),n&&this.notifyTarget(e,`mouseenter`),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(a)}let a=[],o=this.enableGlobalMoveEvents??!0;this.moveOnAll?a.push(`pointermove`):this.dispatchEvent(t,`pointermove`),o&&a.push(`globalpointermove`),t.pointerType===`touch`&&(this.moveOnAll?a.splice(1,0,`touchmove`):this.dispatchEvent(t,`touchmove`),o&&a.push(`globaltouchmove`)),n&&(this.moveOnAll?a.splice(1,0,`mousemove`):this.dispatchEvent(t,`mousemove`),o&&a.push(`globalmousemove`),this.cursor=t.target?.cursor),a.length>0&&this.all(t,a),this._allInteractiveElements.length=0,this._hitElements.length=0,r.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){if(!(e instanceof Q3)){ot(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=this.trackingData(e.pointerId),n=this.createPointerEvent(e),r=n.pointerType===`mouse`||n.pointerType===`pen`;this.dispatchEvent(n,`pointerover`),r&&this.dispatchEvent(n,`mouseover`),n.pointerType===`mouse`&&(this.cursor=n.target?.cursor);let i=this.clonePointerEvent(n,`pointerenter`);for(i.eventPhase=i.AT_TARGET;i.target&&i.target!==this.rootTarget.parent;)i.currentTarget=i.target,this.notifyTarget(i),r&&this.notifyTarget(i,`mouseenter`),i.target=i.target.parent;t.overTargets=n.composedPath(),this.freeEvent(n),this.freeEvent(i)}mapPointerOut(e){if(!(e instanceof Q3)){ot(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=this.trackingData(e.pointerId);if(t.overTargets){let n=e.pointerType===`mouse`||e.pointerType===`pen`,r=this.findMountedTarget(t.overTargets),i=this.createPointerEvent(e,`pointerout`,r);this.dispatchEvent(i),n&&this.dispatchEvent(i,`mouseout`);let a=this.createPointerEvent(e,`pointerleave`,r);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==this.rootTarget.parent;)a.currentTarget=a.target,this.notifyTarget(a),n&&this.notifyTarget(a,`mouseleave`),a.target=a.target.parent;t.overTargets=null,this.freeEvent(i),this.freeEvent(a)}this.cursor=null}mapPointerUp(e){if(!(e instanceof Q3)){ot(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=performance.now(),n=this.createPointerEvent(e);if(this.dispatchEvent(n,`pointerup`),n.pointerType===`touch`)this.dispatchEvent(n,`touchend`);else if(n.pointerType===`mouse`||n.pointerType===`pen`){let e=n.button===2;this.dispatchEvent(n,e?`rightup`:`mouseup`)}let r=this.trackingData(e.pointerId),i=this.findMountedTarget(r.pressTargetsByButton[e.button]),a=i;if(i&&!n.composedPath().includes(i)){let t=i;for(;t&&!n.composedPath().includes(t);){if(n.currentTarget=t,this.notifyTarget(n,`pointerupoutside`),n.pointerType===`touch`)this.notifyTarget(n,`touchendoutside`);else if(n.pointerType===`mouse`||n.pointerType===`pen`){let e=n.button===2;this.notifyTarget(n,e?`rightupoutside`:`mouseupoutside`)}t=t.parent}delete r.pressTargetsByButton[e.button],a=t}if(a){let i=this.clonePointerEvent(n,`click`);i.target=a,i.path=null,r.clicksByButton[e.button]||(r.clicksByButton[e.button]={clickCount:0,target:i.target,timeStamp:t});let o=r.clicksByButton[e.button];if(o.target===i.target&&t-o.timeStamp<200?++o.clickCount:o.clickCount=1,o.target=i.target,o.timeStamp=t,i.detail=o.clickCount,i.pointerType===`mouse`){let e=i.button===2;this.dispatchEvent(i,e?`rightclick`:`click`)}else i.pointerType===`touch`&&this.dispatchEvent(i,`tap`);this.dispatchEvent(i,`pointertap`),this.freeEvent(i)}this.freeEvent(n)}mapPointerUpOutside(e){if(!(e instanceof Q3)){ot(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=this.trackingData(e.pointerId),n=this.findMountedTarget(t.pressTargetsByButton[e.button]),r=this.createPointerEvent(e);if(n){let i=n;for(;i;)r.currentTarget=i,this.notifyTarget(r,`pointerupoutside`),r.pointerType===`touch`?this.notifyTarget(r,`touchendoutside`):(r.pointerType===`mouse`||r.pointerType===`pen`)&&this.notifyTarget(r,r.button===2?`rightupoutside`:`mouseupoutside`),i=i.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(r)}mapWheel(e){if(!(e instanceof $3)){ot(`EventBoundary cannot map a non-wheel event as a wheel event`);return}let t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let n=1;n<e.length&&e[n].parent===t;n++)t=e[n];return t}createPointerEvent(e,t,n){let r=this.allocateEvent(Q3);return this.copyPointerData(e,r),this.copyMouseData(e,r),this.copyData(e,r),r.nativeEvent=e.nativeEvent,r.originalEvent=e,r.target=n??this.hitTest(r.global.x,r.global.y)??this._hitElements[0],typeof t==`string`&&(r.type=t),r}createWheelEvent(e){let t=this.allocateEvent($3);return this.copyWheelData(e,t),this.copyMouseData(e,t),this.copyData(e,t),t.nativeEvent=e.nativeEvent,t.originalEvent=e,t.target=this.hitTest(t.global.x,t.global.y),t}clonePointerEvent(e,t){let n=this.allocateEvent(Q3);return n.nativeEvent=e.nativeEvent,n.originalEvent=e.originalEvent,this.copyPointerData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.target=e.target,n.path=e.composedPath().slice(),n.type=t??n.type,n}copyWheelData(e,t){t.deltaMode=e.deltaMode,t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ}copyPointerData(e,t){e instanceof Q3&&t instanceof Q3&&(t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist)}copyMouseData(e,t){e instanceof Z3&&t instanceof Z3&&(t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.copyFrom(e.client),t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.copyFrom(e.movement),t.screen.copyFrom(e.screen),t.shiftKey=e.shiftKey,t.global.copyFrom(e.global))}copyData(e,t){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.detail=e.detail,t.view=e.view,t.which=e.which,t.layer.copyFrom(e.layer),t.page.copyFrom(e.page)}trackingData(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]}allocateEvent(e){this.eventPool.has(e)||this.eventPool.set(e,[]);let t=this.eventPool.get(e).pop()||new e(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.defaultPrevented=!1,t.path=null,t.target=null,t}freeEvent(e){if(e.manager!==this)throw Error(`It is illegal to free an event not managed by this EventBoundary!`);let t=e.constructor;this.eventPool.has(t)||this.eventPool.set(t,[]),this.eventPool.get(t).push(e)}_notifyListeners(e,t){let n=e.currentTarget._events[t];if(n)if(`fn`in n)n.once&&e.currentTarget.removeListener(t,n.fn,void 0,!0),n.fn.call(n.context,e);else for(let r=0,i=n.length;r<i&&!e.propagationImmediatelyStopped;r++)n[r].once&&e.currentTarget.removeListener(t,n[r].fn,void 0,!0),n[r].fn.call(n[r].context,e)}},mTe=1,hTe={touchstart:`pointerdown`,touchend:`pointerup`,touchendoutside:`pointerupoutside`,touchmove:`pointermove`,touchcancel:`pointercancel`},t6=class e{constructor(t){this.supportsTouchEvents=`ontouchstart`in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=t,this.rootBoundary=new pTe(null),X3.init(this),this.autoPreventDefault=!0,this._eventsAdded=!1,this._rootPointerEvent=new Q3(null),this._rootWheelEvent=new $3(null),this.cursorStyles={default:`inherit`,pointer:`pointer`},this.features=new Proxy({...e.defaultEventFeatures},{set:(e,t,n)=>(t===`globalMove`&&(this.rootBoundary.enableGlobalMoveEvents=n),e[t]=n,!0)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(t){let{canvas:n,resolution:r}=this.renderer;this.setTargetElement(n),this.resolution=r,e._defaultEventMode=t.eventMode??`passive`,Object.assign(this.features,t.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){X3.destroy(),this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(e){e||=`default`;let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this._currentCursor===e)return;this._currentCursor=e;let n=this.cursorStyles[e];if(n)switch(typeof n){case`string`:t&&(this.domElement.style.cursor=n);break;case`function`:n(e);break;case`object`:t&&Object.assign(this.domElement.style,n);break}else t&&typeof e==`string`&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this._rootPointerEvent}_onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=this._normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!(`cancelable`in e))&&e.preventDefault();for(let e=0,n=t.length;e<n;e++){let n=t[e],r=this._bootstrapEvent(this._rootPointerEvent,n);this.rootBoundary.mapEvent(r)}this.setCursor(this.rootBoundary.cursor)}_onPointerMove(e){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,X3.pointerMoved();let t=this._normalizeToPointerData(e);for(let e=0,n=t.length;e<n;e++){let n=this._bootstrapEvent(this._rootPointerEvent,t[e]);this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}_onPointerUp(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=e.target;e.composedPath&&e.composedPath().length>0&&(t=e.composedPath()[0]);let n=t===this.domElement?``:`outside`,r=this._normalizeToPointerData(e);for(let e=0,t=r.length;e<t;e++){let t=this._bootstrapEvent(this._rootPointerEvent,r[e]);t.type+=n,this.rootBoundary.mapEvent(t)}this.setCursor(this.rootBoundary.cursor)}_onPointerOverOut(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=this._normalizeToPointerData(e);for(let e=0,n=t.length;e<n;e++){let n=this._bootstrapEvent(this._rootPointerEvent,t[e]);this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}onWheel(e){if(!this.features.wheel)return;let t=this.normalizeWheelEvent(e);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(t)}setTargetElement(e){this._removeEvents(),this.domElement=e,X3.domElement=e,this._addEvents()}_addEvents(){if(this._eventsAdded||!this.domElement)return;X3.addTickerListener();let e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming=`none`,e.msTouchAction=`none`):this.supportsPointerEvents&&(e.touchAction=`none`)),this.supportsPointerEvents?(globalThis.document.addEventListener(`pointermove`,this._onPointerMove,!0),this.domElement.addEventListener(`pointerdown`,this._onPointerDown,!0),this.domElement.addEventListener(`pointerleave`,this._onPointerOverOut,!0),this.domElement.addEventListener(`pointerover`,this._onPointerOverOut,!0),globalThis.addEventListener(`pointerup`,this._onPointerUp,!0)):(globalThis.document.addEventListener(`mousemove`,this._onPointerMove,!0),this.domElement.addEventListener(`mousedown`,this._onPointerDown,!0),this.domElement.addEventListener(`mouseout`,this._onPointerOverOut,!0),this.domElement.addEventListener(`mouseover`,this._onPointerOverOut,!0),globalThis.addEventListener(`mouseup`,this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener(`touchstart`,this._onPointerDown,!0),this.domElement.addEventListener(`touchend`,this._onPointerUp,!0),this.domElement.addEventListener(`touchmove`,this._onPointerMove,!0))),this.domElement.addEventListener(`wheel`,this.onWheel,{passive:!0,capture:!0}),this._eventsAdded=!0}_removeEvents(){if(!this._eventsAdded||!this.domElement)return;X3.removeTickerListener();let e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming=``,e.msTouchAction=``):this.supportsPointerEvents&&(e.touchAction=``)),this.supportsPointerEvents?(globalThis.document.removeEventListener(`pointermove`,this._onPointerMove,!0),this.domElement.removeEventListener(`pointerdown`,this._onPointerDown,!0),this.domElement.removeEventListener(`pointerleave`,this._onPointerOverOut,!0),this.domElement.removeEventListener(`pointerover`,this._onPointerOverOut,!0),globalThis.removeEventListener(`pointerup`,this._onPointerUp,!0)):(globalThis.document.removeEventListener(`mousemove`,this._onPointerMove,!0),this.domElement.removeEventListener(`mousedown`,this._onPointerDown,!0),this.domElement.removeEventListener(`mouseout`,this._onPointerOverOut,!0),this.domElement.removeEventListener(`mouseover`,this._onPointerOverOut,!0),globalThis.removeEventListener(`mouseup`,this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener(`touchstart`,this._onPointerDown,!0),this.domElement.removeEventListener(`touchend`,this._onPointerUp,!0),this.domElement.removeEventListener(`touchmove`,this._onPointerMove,!0))),this.domElement.removeEventListener(`wheel`,this.onWheel,!0),this.domElement=null,this._eventsAdded=!1}mapPositionToPoint(e,t,n){let r=this.domElement.isConnected?this.domElement.getBoundingClientRect():{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0},i=1/this.resolution;e.x=(t-r.left)*(this.domElement.width/r.width)*i,e.y=(n-r.top)*(this.domElement.height/r.height)*i}_normalizeToPointerData(e){let t=[];if(this.supportsTouchEvents&&e instanceof TouchEvent)for(let n=0,r=e.changedTouches.length;n<r;n++){let r=e.changedTouches[n];r.button===void 0&&(r.button=0),r.buttons===void 0&&(r.buttons=1),r.isPrimary===void 0&&(r.isPrimary=e.touches.length===1&&e.type===`touchstart`),r.width===void 0&&(r.width=r.radiusX||1),r.height===void 0&&(r.height=r.radiusY||1),r.tiltX===void 0&&(r.tiltX=0),r.tiltY===void 0&&(r.tiltY=0),r.pointerType===void 0&&(r.pointerType=`touch`),r.pointerId===void 0&&(r.pointerId=r.identifier||0),r.pressure===void 0&&(r.pressure=r.force||.5),r.twist===void 0&&(r.twist=0),r.tangentialPressure===void 0&&(r.tangentialPressure=0),r.layerX===void 0&&(r.layerX=r.offsetX=r.clientX),r.layerY===void 0&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=e.type,t.push(r)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){let n=e;n.isPrimary===void 0&&(n.isPrimary=!0),n.width===void 0&&(n.width=1),n.height===void 0&&(n.height=1),n.tiltX===void 0&&(n.tiltX=0),n.tiltY===void 0&&(n.tiltY=0),n.pointerType===void 0&&(n.pointerType=`mouse`),n.pointerId===void 0&&(n.pointerId=mTe),n.pressure===void 0&&(n.pressure=.5),n.twist===void 0&&(n.twist=0),n.tangentialPressure===void 0&&(n.tangentialPressure=0),n.isNormalized=!0,t.push(n)}else t.push(e);return t}normalizeWheelEvent(e){let t=this._rootWheelEvent;return this._transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}_bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this._transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type===`pointerleave`&&(e.type=`pointerout`),e.type.startsWith(`mouse`)&&(e.type=e.type.replace(`mouse`,`pointer`)),e.type.startsWith(`touch`)&&(e.type=hTe[e.type]||e.type),e}_transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};t6.extension={name:`events`,type:[W.WebGLSystem,W.CanvasSystem,W.WebGPUSystem],priority:-1},t6.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};var n6=t6,gTe={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return this.eventMode===`dynamic`||this.eventMode===`static`},set interactive(e){this.eventMode=e?`static`:`passive`},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??n6.defaultEventMode},set eventMode(e){this._internalEventMode=e},isInteractive(){return this.eventMode===`static`||this.eventMode===`dynamic`},interactiveChildren:!0,hitArea:null,addEventListener(e,t,n){let r=typeof n==`boolean`&&n||typeof n==`object`&&n.capture,i=typeof n==`object`?n.signal:void 0,a=typeof n==`object`?n.once===!0:!1,o=typeof t==`function`?void 0:t;e=r?`${e}capture`:e;let s=typeof t==`function`?t:t.handleEvent,c=this;i&&i.addEventListener(`abort`,()=>{c.off(e,s,o)}),a?c.once(e,s,o):c.on(e,s,o)},removeEventListener(e,t,n){let r=typeof n==`boolean`&&n||typeof n==`object`&&n.capture,i=typeof t==`function`?void 0:t;e=r?`${e}capture`:e,t=typeof t==`function`?t:t.handleEvent,this.off(e,t,i)},dispatchEvent(e){if(!(e instanceof x4))throw Error(`Container cannot propagate events outside of the Federated Events API`);return e.defaultPrevented=!1,e.path=null,e.target=this,e.manager.dispatchEvent(e),!e.defaultPrevented}},_Te=`in vec2 aPosition;
963
+ `,e.accessibleText&&(t.innerText=e.accessibleText)),t.style.width=`${z4}px`,t.style.height=`${z4}px`,t.style.backgroundColor=this.debug?`rgba(255,255,255,0.5)`:`transparent`,t.style.position=`absolute`,t.style.zIndex=B4.toString(),t.style.borderStyle=`none`,navigator.userAgent.toLowerCase().includes(`chrome`)?t.setAttribute(`aria-live`,`off`):t.setAttribute(`aria-live`,`polite`),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute(`aria-relevant`,`additions`):t.setAttribute(`aria-relevant`,`text`),t.addEventListener(`click`,this._onClick.bind(this)),t.addEventListener(`focus`,this._onFocus.bind(this)),t.addEventListener(`focusout`,this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`container ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute(`aria-label`,e.accessibleHint),e.interactive?t.tabIndex=e.tabIndex:t.tabIndex=0,this.debug&&this._updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv)}_dispatchEvent(e,t){let{container:n}=e.target,r=this._renderer.events.rootBoundary,i=Object.assign(new x4(r),{target:n});r.rootTarget=this._renderer.lastObjectRendered,t.forEach(e=>r.dispatchEvent(i,e))}_onClick(e){this._dispatchEvent(e,[`click`,`pointertap`,`tap`])}_onFocus(e){e.target.getAttribute(`aria-live`)||e.target.setAttribute(`aria-live`,`assertive`),this._dispatchEvent(e,[`mouseover`])}_onFocusOut(e){e.target.getAttribute(`aria-live`)||e.target.setAttribute(`aria-live`,`polite`),this._dispatchEvent(e,[`mouseout`])}_onKeyDown(e){e.keyCode!==YCe||!this._activateOnTab||this._activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this._deactivate()}destroy(){this._deactivate(),this._destroyTouchHook(),this._canvasObserver?.destroy(),this._canvasObserver=null,this._div=null,this._pools=null,this._children=null,this._renderer=null,this._hookDiv=null,globalThis.removeEventListener(`keydown`,this._boundOnKeyDown),this._boundOnKeyDown=null,globalThis.document.removeEventListener(`mousemove`,this._boundOnMouseMove,!0),this._boundOnMouseMove=null}setAccessibilityEnabled(e){e?this._activate():this._deactivate()}_getPool(e){return this._pools[e]||(this._pools[e]=[]),this._pools[e]}};H4.extension={type:[W.WebGLSystem,W.WebGPUSystem],name:`accessibility`},H4.defaultOptions={enabledByDefault:!1,debug:!1,activateOnTab:!0,deactivateOnMouseMove:!0};var twe=H4,nwe={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,accessibleType:`button`,accessibleText:null,accessiblePointerEvents:`auto`,accessibleChildren:!0,_accessibleActive:!1,_accessibleDiv:null,_renderId:-1},U4;function rwe(e){return U4===void 0&&(U4=(()=>{let t={stencil:!0,failIfMajorPerformanceCaveat:e??Qt.defaultOptions.failIfMajorPerformanceCaveat};try{if(!Gt.get().getWebGLRenderingContext())return!1;let e=Gt.get().createCanvas().getContext(`webgl`,t),n=!!e?.getContextAttributes()?.stencil;if(e){let t=e.getExtension(`WEBGL_lose_context`);t&&t.loseContext()}return e=null,n}catch{return!1}})()),U4}var W4;async function iwe(e={}){return W4===void 0&&(W4=await(async()=>{let t=Gt.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(e)).requestDevice(),!0}catch{return!1}})()),W4}var G4=[`webgl`,`webgpu`,`canvas`];async function awe(e){let t=[];e.preference?(t.push(e.preference),G4.forEach(n=>{n!==e.preference&&t.push(n)})):t=G4.slice();let n,r={};for(let i=0;i<t.length;i++){let a=t[i];if(a===`webgpu`&&await iwe()){let{WebGPURenderer:t}=await q(async()=>{let{WebGPURenderer:e}=await import(`./WebGPURenderer-BYG_ICu9.js`);return{WebGPURenderer:e}},__vite__mapDeps([131,128,1]));n=t,r={...e,...e.webgpu};break}else if(a===`webgl`&&rwe(e.failIfMajorPerformanceCaveat??Qt.defaultOptions.failIfMajorPerformanceCaveat)){let{WebGLRenderer:t}=await q(async()=>{let{WebGLRenderer:e}=await import(`./WebGLRenderer-DVK96Dop.js`);return{WebGLRenderer:e}},__vite__mapDeps([132,128,1]));n=t,r={...e,...e.webgl};break}else if(a===`canvas`){let{CanvasRenderer:t}=await q(async()=>{let{CanvasRenderer:e}=await import(`./CanvasRenderer-DfVz9CSz.js`);return{CanvasRenderer:e}},__vite__mapDeps([133,128,1]));n=t,r={...e,...e.canvasOptions};break}}if(delete r.webgpu,delete r.webgl,delete r.canvasOptions,!n)throw Error(`No available renderer for the current environment`);let i=new n;return await i.init(r),i}var K4=class{static init(e){Object.defineProperty(this,`resizeTo`,{configurable:!0,set(e){globalThis.removeEventListener(`resize`,this.queueResize),this._resizeTo=e,e&&(globalThis.addEventListener(`resize`,this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&=(cancelAnimationFrame(this._resizeId),null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let e,t;if(this._resizeTo===globalThis.window)e=globalThis.innerWidth,t=globalThis.innerHeight;else{let{clientWidth:n,clientHeight:r}=this._resizeTo;e=n,t=r}this.renderer.resize(e,t),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener(`resize`,this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}};K4.extension=W.Application;var q4=class{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,`ticker`,{configurable:!0,set(e){this._ticker&&this._ticker.remove(this.render,this),this._ticker=e,e&&e.add(this.render,this,Ot.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?kt.shared:new kt,e.autoStart&&this.start()}static destroy(){if(this._ticker){let e=this._ticker;this.ticker=null,e.destroy()}}};q4.extension=W.Application,jt.add(K4),jt.add(q4);var J4=class e{constructor(...e){this.stage=new qt,e[0]!==void 0&&zt(st,`Application constructor options are deprecated, please use Application.init() instead.`)}async init(t){t={...t},this.stage||=new qt,this.renderer=await awe(t),e._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return zt(st,`Application.view is deprecated, please use Application.canvas instead.`),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(t=!1,n=!1){let r=e._plugins.slice(0);r.reverse(),r.forEach(e=>{e.destroy.call(this)}),this.stage.destroy(n),this.stage=null,this.renderer.destroy(t),this.renderer=null}};J4._plugins=[];var Y4=J4;jt.handleByList(W.Application,Y4._plugins),jt.add($t);var owe=t(n(((e,t)=>{t.exports=i;var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},r=/([astvzqmhlc])([^astvzqmhlc]*)/gi;function i(e){var t=[];return e.replace(r,function(e,r,i){var a=r.toLowerCase();for(i=o(i),a==`m`&&i.length>2&&(t.push([r].concat(i.splice(0,2))),a=`l`,r=r==`m`?`l`:`L`);;){if(i.length==n[a])return i.unshift(r),t.push(i);if(i.length<n[a])throw Error(`malformed path data`);t.push([r].concat(i.splice(0,n[a])))}}),t}var a=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function o(e){var t=e.match(a);return t?t.map(Number):[]}}))(),1);function swe(e,t){let n=(0,owe.default)(e),r=[],i=null,a=0,o=0;for(let e=0;e<n.length;e++){let s=n[e],c=s[0],l=s;switch(c){case`M`:a=l[1],o=l[2],t.moveTo(a,o);break;case`m`:a+=l[1],o+=l[2],t.moveTo(a,o);break;case`H`:a=l[1],t.lineTo(a,o);break;case`h`:a+=l[1],t.lineTo(a,o);break;case`V`:o=l[1],t.lineTo(a,o);break;case`v`:o+=l[1],t.lineTo(a,o);break;case`L`:a=l[1],o=l[2],t.lineTo(a,o);break;case`l`:a+=l[1],o+=l[2],t.lineTo(a,o);break;case`C`:a=l[5],o=l[6],t.bezierCurveTo(l[1],l[2],l[3],l[4],a,o);break;case`c`:t.bezierCurveTo(a+l[1],o+l[2],a+l[3],o+l[4],a+l[5],o+l[6]),a+=l[5],o+=l[6];break;case`S`:a=l[3],o=l[4],t.bezierCurveToShort(l[1],l[2],a,o);break;case`s`:t.bezierCurveToShort(a+l[1],o+l[2],a+l[3],o+l[4]),a+=l[3],o+=l[4];break;case`Q`:a=l[3],o=l[4],t.quadraticCurveTo(l[1],l[2],a,o);break;case`q`:t.quadraticCurveTo(a+l[1],o+l[2],a+l[3],o+l[4]),a+=l[3],o+=l[4];break;case`T`:a=l[1],o=l[2],t.quadraticCurveToShort(a,o);break;case`t`:a+=l[1],o+=l[2],t.quadraticCurveToShort(a,o);break;case`A`:a=l[6],o=l[7],t.arcToSvg(l[1],l[2],l[3],l[4],l[5],a,o);break;case`a`:a+=l[6],o+=l[7],t.arcToSvg(l[1],l[2],l[3],l[4],l[5],a,o);break;case`Z`:case`z`:t.closePath(),r.length>0&&(i=r.pop(),i?(a=i.startX,o=i.startY):(a=0,o=0)),i=null;break;default:ot(`Unknown SVG path command: ${c}`)}c!==`Z`&&c!==`z`&&i===null&&(i={startX:a,startY:o},r.push(i))}return t}var cwe=class e{constructor(e=0,t=0,n=0){this.type=`circle`,this.x=e,this.y=t,this.radius=n}clone(){return new e(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return!1;let n=this.radius*this.radius,r=this.x-e,i=this.y-t;return r*=r,i*=i,r+i<=n}strokeContains(e,t,n,r=.5){if(this.radius===0)return!1;let i=this.x-e,a=this.y-t,o=this.radius,s=(1-r)*n,c=Math.sqrt(i*i+a*a);return c<=o+s&&c>o-(n-s)}getBounds(e){return e||=new bt,e.x=this.x-this.radius,e.y=this.y-this.radius,e.width=this.radius*2,e.height=this.radius*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}},lwe=class e{constructor(e=0,t=0,n=0,r=0){this.type=`ellipse`,this.x=e,this.y=t,this.halfWidth=n,this.halfHeight=r}clone(){return new e(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,t){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let n=(e-this.x)/this.halfWidth,r=(t-this.y)/this.halfHeight;return n*=n,r*=r,n+r<=1}strokeContains(e,t,n,r=.5){let{halfWidth:i,halfHeight:a}=this;if(i<=0||a<=0)return!1;let o=n*(1-r),s=n-o,c=i-s,l=a-s,u=i+o,d=a+o,f=e-this.x,p=t-this.y,m=f*f/(c*c)+p*p/(l*l),h=f*f/(u*u)+p*p/(d*d);return m>1&&h<=1}getBounds(e){return e||=new bt,e.x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=this.halfWidth*2,e.height=this.halfHeight*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}};function uwe(e,t,n,r,i,a){let o=e-n,s=t-r,c=i-n,l=a-r,u=o*c+s*l,d=c*c+l*l,f=-1;d!==0&&(f=u/d);let p,m;f<0?(p=n,m=r):f>1?(p=i,m=a):(p=n+f*c,m=r+f*l);let h=e-p,g=t-m;return h*h+g*g}var dwe,fwe,X4=class e{constructor(...e){this.type=`polygon`;let t=Array.isArray(e[0])?e[0]:e;if(typeof t[0]!=`number`){let e=[];for(let n=0,r=t.length;n<r;n++)e.push(t[n].x,t[n].y);t=e}this.points=t,this.closePath=!0}isClockwise(){let e=0,t=this.points,n=t.length;for(let r=0;r<n;r+=2){let i=t[r],a=t[r+1],o=t[(r+2)%n],s=t[(r+3)%n];e+=(o-i)*(s+a)}return e<0}containsPolygon(e){let t=this.getBounds(dwe),n=e.getBounds(fwe);if(!t.containsRect(n))return!1;let r=e.points;for(let e=0;e<r.length;e+=2){let t=r[e],n=r[e+1];if(!this.contains(t,n))return!1}return!0}clone(){let t=new e(this.points.slice());return t.closePath=this.closePath,t}contains(e,t){let n=!1,r=this.points.length/2;for(let i=0,a=r-1;i<r;a=i++){let r=this.points[i*2],o=this.points[i*2+1],s=this.points[a*2],c=this.points[a*2+1];o>t!=c>t&&e<(s-r)*((t-o)/(c-o))+r&&(n=!n)}return n}strokeContains(e,t,n,r=.5){let i=n*n,a=i*(1-r),o=i-a,{points:s}=this,c=s.length-(this.closePath?0:2);for(let n=0;n<c;n+=2){let r=s[n],i=s[n+1],c=s[(n+2)%s.length],l=s[(n+3)%s.length];if(uwe(e,t,r,i,c,l)<=(Math.sign((c-r)*(t-i)-(l-i)*(e-r))<0?o:a))return!0}return!1}getBounds(e){e||=new bt;let t=this.points,n=1/0,r=-1/0,i=1/0,a=-1/0;for(let e=0,o=t.length;e<o;e+=2){let o=t[e],s=t[e+1];n=o<n?o:n,r=o>r?o:r,i=s<i?s:i,a=s>a?s:a}return e.x=n,e.width=r-n,e.y=i,e.height=a-i,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e,t)=>`${e}, ${t}`,``)}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return zt(`8.11.0`,`Polygon.lastX is deprecated, please use Polygon.lastX instead.`),this.points[this.points.length-2]}get y(){return zt(`8.11.0`,`Polygon.y is deprecated, please use Polygon.lastY instead.`),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}},Z4=(e,t,n,r,i,a,o)=>{let s=e-n,c=t-r,l=Math.sqrt(s*s+c*c);return l>=i-a&&l<=i+o},pwe=class e{constructor(e=0,t=0,n=0,r=0,i=20){this.type=`roundedRectangle`,this.x=e,this.y=t,this.width=n,this.height=r,this.radius=i}getBounds(e){return e||=new bt,e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new e(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){let n=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+n&&t<=this.y+this.height-n||e>=this.x+n&&e<=this.x+this.width-n)return!0;let r=e-(this.x+n),i=t-(this.y+n),a=n*n;if(r*r+i*i<=a||(r=e-(this.x+this.width-n),r*r+i*i<=a)||(i=t-(this.y+this.height-n),r*r+i*i<=a)||(r=e-(this.x+n),r*r+i*i<=a))return!0}return!1}strokeContains(e,t,n,r=.5){let{x:i,y:a,width:o,height:s,radius:c}=this,l=n*(1-r),u=n-l,d=i+c,f=a+c,p=o-c*2,m=s-c*2,h=i+o,g=a+s;return(e>=i-l&&e<=i+u||e>=h-u&&e<=h+l)&&t>=f&&t<=f+m||(t>=a-l&&t<=a+u||t>=g-u&&t<=g+l)&&e>=d&&e<=d+p?!0:e<d&&t<f&&Z4(e,t,d,f,c,u,l)||e>h-c&&t<f&&Z4(e,t,h-c,f,c,u,l)||e>h-c&&t>g-c&&Z4(e,t,h-c,g-c,c,u,l)||e<d&&t>g-c&&Z4(e,t,d,g-c,c,u,l)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}};function mwe(e,t,n,r,i,a,o,s=null){let c=0;n*=t,i*=a;let l=s.a,u=s.b,d=s.c,f=s.d,p=s.tx,m=s.ty;for(;c<o;){let o=e[n],s=e[n+1];r[i]=l*o+d*s+p,r[i+1]=u*o+f*s+m,i+=a,n+=t,c++}}function hwe(e,t,n,r){let i=0;for(t*=n;i<r;)e[t]=0,e[t+1]=0,t+=n,i++}function Q4(e,t,n,r,i){let a=t.a,o=t.b,s=t.c,c=t.d,l=t.tx,u=t.ty;n||=0,r||=2,i||=e.length/r-n;let d=n*r;for(let t=0;t<i;t++){let t=e[d],n=e[d+1];e[d]=a*t+s*n+l,e[d+1]=o*t+c*n+u,d+=r}}var gwe=new Qe,$4=class{constructor(){this.packAsQuad=!1,this.batcherName=`default`,this.topology=`triangle-list`,this.applyTransform=!0,this.roundPixels=0,this._batcher=null,this._batch=null}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:`normal`}get color(){let e=this.baseColor,t=e>>16|e&65280|(e&255)<<16,n=this.renderable;return n?dt(t,n.groupColor)+(this.alpha*n.groupAlpha*255<<24):t+(this.alpha*255<<24)}get transform(){return this.renderable?.groupTransform||gwe}copyTo(e){e.indexOffset=this.indexOffset,e.indexSize=this.indexSize,e.attributeOffset=this.attributeOffset,e.attributeSize=this.attributeSize,e.baseColor=this.baseColor,e.alpha=this.alpha,e.texture=this.texture,e.geometryData=this.geometryData,e.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology=`triangle-list`}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher=null,this._batch=null}},e3={extension:{type:W.ShapeBuilder,name:`circle`},build(e,t){let n,r,i,a,o,s;if(e.type===`circle`){let t=e;if(o=s=t.radius,o<=0)return!1;n=t.x,r=t.y,i=a=0}else if(e.type===`ellipse`){let t=e;if(o=t.halfWidth,s=t.halfHeight,o<=0||s<=0)return!1;n=t.x,r=t.y,i=a=0}else{let t=e,c=t.width/2,l=t.height/2;n=t.x+c,r=t.y+l,o=s=Math.max(0,Math.min(t.radius,Math.min(c,l))),i=c-o,a=l-s}if(i<0||a<0)return!1;let c=Math.ceil(2.3*Math.sqrt(o+s)),l=c*8+(i?4:0)+(a?4:0);if(l===0)return!1;if(c===0)return t[0]=t[6]=n+i,t[1]=t[3]=r+a,t[2]=t[4]=n-i,t[5]=t[7]=r-a,!0;let u=0,d=c*4+(i?2:0)+2,f=d,p=l,m=i+o,h=a,g=n+m,_=n-m,v=r+h;if(t[u++]=g,t[u++]=v,t[--d]=v,t[--d]=_,a){let e=r-h;t[f++]=_,t[f++]=e,t[--p]=e,t[--p]=g}for(let e=1;e<c;e++){let l=Math.PI/2*(e/c),m=i+Math.cos(l)*o,h=a+Math.sin(l)*s,g=n+m,_=n-m,v=r+h,y=r-h;t[u++]=g,t[u++]=v,t[--d]=v,t[--d]=_,t[f++]=_,t[f++]=y,t[--p]=y,t[--p]=g}m=i,h=a+s,g=n+m,_=n-m,v=r+h;let y=r-h;return t[u++]=g,t[u++]=v,t[--p]=y,t[--p]=g,i&&(t[u++]=_,t[u++]=v,t[--p]=y,t[--p]=_),!0},triangulate(e,t,n,r,i,a){if(e.length===0)return;let o=0,s=0;for(let t=0;t<e.length;t+=2)o+=e[t],s+=e[t+1];o/=e.length/2,s/=e.length/2;let c=r;t[c*n]=o,t[c*n+1]=s;let l=c++;for(let r=0;r<e.length;r+=2)t[c*n]=e[r],t[c*n+1]=e[r+1],r>0&&(i[a++]=c,i[a++]=l,i[a++]=c-1),c++;i[a++]=l+1,i[a++]=l,i[a++]=c-1}},_we={...e3,extension:{...e3.extension,name:`ellipse`}},vwe={...e3,extension:{...e3.extension,name:`roundedRectangle`}},t3=1e-4,n3=1e-4;function ywe(e){let t=e.length;if(t<6)return 1;let n=0;for(let r=0,i=e[t-2],a=e[t-1];r<t;r+=2){let t=e[r],o=e[r+1];n+=(t-i)*(o+a),i=t,a=o}return n<0?-1:1}function r3(e,t,n,r,i,a,o,s){let c=e-n*i,l=t-r*i,u=e+n*a,d=t+r*a,f,p;o?(f=r,p=-n):(f=-r,p=n);let m=c+f,h=l+p,g=u+f,_=d+p;return s.push(m,h),s.push(g,_),2}function i3(e,t,n,r,i,a,o,s){let c=n-e,l=r-t,u=Math.atan2(c,l),d=Math.atan2(i-e,a-t);s&&u<d?u+=Math.PI*2:!s&&u>d&&(d+=Math.PI*2);let f=u,p=d-u,m=Math.abs(p),h=Math.sqrt(c*c+l*l),g=(15*m*Math.sqrt(h)/Math.PI>>0)+1,_=p/g;if(f+=_,s){o.push(e,t),o.push(n,r);for(let n=1,r=f;n<g;n++,r+=_)o.push(e,t),o.push(e+Math.sin(r)*h,t+Math.cos(r)*h);o.push(e,t),o.push(i,a)}else{o.push(n,r),o.push(e,t);for(let n=1,r=f;n<g;n++,r+=_)o.push(e+Math.sin(r)*h,t+Math.cos(r)*h),o.push(e,t);o.push(i,a),o.push(e,t)}return g*2}function a3(e,t,n,r,i,a){let o=t3;if(e.length===0)return;let s=t,c=s.alignment;if(t.alignment!==.5){let t=ywe(e);n&&(t*=-1),c=(c-.5)*t+.5}let l=new Et(e[0],e[1]),u=new Et(e[e.length-2],e[e.length-1]),d=r,f=Math.abs(l.x-u.x)<o&&Math.abs(l.y-u.y)<o;if(d){e=e.slice(),f&&(e.pop(),e.pop(),u.set(e[e.length-2],e[e.length-1]));let t=(l.x+u.x)*.5,n=(u.y+l.y)*.5;e.unshift(t,n),e.push(t,n)}let p=i,m=e.length/2,h=e.length,g=p.length/2,_=s.width/2,v=_*_,y=s.miterLimit*s.miterLimit,b=e[0],x=e[1],S=e[2],C=e[3],w=0,T=0,E=-(x-C),D=b-S,O=0,k=0,A=Math.sqrt(E*E+D*D);E/=A,D/=A,E*=_,D*=_;let j=c,M=(1-j)*2,N=j*2;d||(s.cap===`round`?h+=i3(b-E*(M-N)*.5,x-D*(M-N)*.5,b-E*M,x-D*M,b+E*N,x+D*N,p,!0)+2:s.cap===`square`&&(h+=r3(b,x,E,D,M,N,!0,p))),p.push(b-E*M,x-D*M),p.push(b+E*N,x+D*N);for(let t=1;t<m-1;++t){b=e[(t-1)*2],x=e[(t-1)*2+1],S=e[t*2],C=e[t*2+1],w=e[(t+1)*2],T=e[(t+1)*2+1],E=-(x-C),D=b-S,A=Math.sqrt(E*E+D*D),E/=A,D/=A,E*=_,D*=_,O=-(C-T),k=S-w,A=Math.sqrt(O*O+k*k),O/=A,k/=A,O*=_,k*=_;let n=S-b,r=x-C,i=S-w,a=T-C,o=n*i+r*a,c=r*i-a*n,l=c<0;if(Math.abs(c)<.001*Math.abs(o)){p.push(S-E*M,C-D*M),p.push(S+E*N,C+D*N),o>=0&&(s.join===`round`?h+=i3(S,C,S-E*M,C-D*M,S-O*M,C-k*M,p,!1)+4:h+=2,p.push(S-O*N,C-k*N),p.push(S+O*M,C+k*M));continue}let u=(-E+b)*(-D+C)-(-E+S)*(-D+x),d=(-O+w)*(-k+C)-(-O+S)*(-k+T),f=(n*d-i*u)/c,m=(a*u-r*d)/c,g=(f-S)*(f-S)+(m-C)*(m-C),j=S+(f-S)*M,P=C+(m-C)*M,F=S-(f-S)*N,I=C-(m-C)*N,ee=Math.min(n*n+r*r,i*i+a*a),L=l?M:N;g<=ee+L*L*v?s.join===`bevel`||g/v>y?(l?(p.push(j,P),p.push(S+E*N,C+D*N),p.push(j,P),p.push(S+O*N,C+k*N)):(p.push(S-E*M,C-D*M),p.push(F,I),p.push(S-O*M,C-k*M),p.push(F,I)),h+=2):s.join===`round`?l?(p.push(j,P),p.push(S+E*N,C+D*N),h+=i3(S,C,S+E*N,C+D*N,S+O*N,C+k*N,p,!0)+4,p.push(j,P),p.push(S+O*N,C+k*N)):(p.push(S-E*M,C-D*M),p.push(F,I),h+=i3(S,C,S-E*M,C-D*M,S-O*M,C-k*M,p,!1)+4,p.push(S-O*M,C-k*M),p.push(F,I)):(p.push(j,P),p.push(F,I)):(p.push(S-E*M,C-D*M),p.push(S+E*N,C+D*N),s.join===`round`?l?h+=i3(S,C,S+E*N,C+D*N,S+O*N,C+k*N,p,!0)+2:h+=i3(S,C,S-E*M,C-D*M,S-O*M,C-k*M,p,!1)+2:s.join===`miter`&&g/v<=y&&(l?(p.push(F,I),p.push(F,I)):(p.push(j,P),p.push(j,P)),h+=2),p.push(S-O*M,C-k*M),p.push(S+O*N,C+k*N),h+=2)}b=e[(m-2)*2],x=e[(m-2)*2+1],S=e[(m-1)*2],C=e[(m-1)*2+1],E=-(x-C),D=b-S,A=Math.sqrt(E*E+D*D),E/=A,D/=A,E*=_,D*=_,p.push(S-E*M,C-D*M),p.push(S+E*N,C+D*N),d||(s.cap===`round`?h+=i3(S-E*(M-N)*.5,C-D*(M-N)*.5,S-E*M,C-D*M,S+E*N,C+D*N,p,!1)+2:s.cap===`square`&&(h+=r3(S,C,E,D,M,N,!1,p)));let P=n3*n3;for(let e=g;e<h+g-2;++e)b=p[e*2],x=p[e*2+1],S=p[(e+1)*2],C=p[(e+1)*2+1],w=p[(e+2)*2],T=p[(e+2)*2+1],!(Math.abs(b*(C-T)+S*(T-x)+w*(x-C))<P)&&a.push(e,e+1,e+2)}function bwe(e,t,n,r){let i=t3;if(e.length===0)return;let a=e[0],o=e[1],s=e[e.length-2],c=e[e.length-1],l=t||Math.abs(a-s)<i&&Math.abs(o-c)<i,u=n,d=e.length/2,f=u.length/2;for(let t=0;t<d;t++)u.push(e[t*2]),u.push(e[t*2+1]);for(let e=0;e<d-1;e++)r.push(f+e,f+e+1);l&&r.push(f+d-1,f)}function o3(e,t,n,r,i,a,o){let s=pn(e,t,2);if(!s)return;for(let e=0;e<s.length;e+=3)a[o++]=s[e]+i,a[o++]=s[e+1]+i,a[o++]=s[e+2]+i;let c=i*r;for(let t=0;t<e.length;t+=2)n[c]=e[t],n[c+1]=e[t+1],c+=r}var xwe=[],Swe={extension:{type:W.ShapeBuilder,name:`polygon`},build(e,t){for(let n=0;n<e.points.length;n++)t[n]=e.points[n];return!0},triangulate(e,t,n,r,i,a){o3(e,xwe,t,n,r,i,a)}},Cwe={extension:{type:W.ShapeBuilder,name:`rectangle`},build(e,t){let n=e,r=n.x,i=n.y,a=n.width,o=n.height;return a>0&&o>0?(t[0]=r,t[1]=i,t[2]=r+a,t[3]=i,t[4]=r+a,t[5]=i+o,t[6]=r,t[7]=i+o,!0):!1},triangulate(e,t,n,r,i,a){let o=0;r*=n,t[r+o]=e[0],t[r+o+1]=e[1],o+=n,t[r+o]=e[2],t[r+o+1]=e[3],o+=n,t[r+o]=e[6],t[r+o+1]=e[7],o+=n,t[r+o]=e[4],t[r+o+1]=e[5],o+=n;let s=r/n;i[a++]=s,i[a++]=s+1,i[a++]=s+2,i[a++]=s+1,i[a++]=s+3,i[a++]=s+2}},wwe={extension:{type:W.ShapeBuilder,name:`triangle`},build(e,t){return t[0]=e.x,t[1]=e.y,t[2]=e.x2,t[3]=e.y2,t[4]=e.x3,t[5]=e.y3,!0},triangulate(e,t,n,r,i,a){let o=0;r*=n,t[r+o]=e[0],t[r+o+1]=e[1],o+=n,t[r+o]=e[2],t[r+o+1]=e[3],o+=n,t[r+o]=e[4],t[r+o+1]=e[5];let s=r/n;i[a++]=s,i[a++]=s+1,i[a++]=s+2}},s3=[{offset:0,color:`white`},{offset:1,color:`black`}],c3=class e{constructor(...t){this.uid=vt(`fillGradient`),this._tick=0,this.type=`linear`,this.colorStops=[];let n=Twe(t);n={...n.type===`radial`?e.defaultRadialOptions:e.defaultLinearOptions,...it(n)},this._textureSize=n.textureSize,this._wrapMode=n.wrapMode,n.type===`radial`?(this.center=n.center,this.outerCenter=n.outerCenter??this.center,this.innerRadius=n.innerRadius,this.outerRadius=n.outerRadius,this.scale=n.scale,this.rotation=n.rotation):(this.start=n.start,this.end=n.end),this.textureSpace=n.textureSpace,this.type=n.type,n.colorStops.forEach(e=>{this.addColorStop(e.offset,e.color)})}addColorStop(e,t){return this.colorStops.push({offset:e,color:lt.shared.setValue(t).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:e,y:t}=this.start,{x:n,y:r}=this.end,i=n-e,a=r-t,o=i<0||a<0;if(this._wrapMode===`clamp-to-edge`){if(i<0){let t=e;e=n,n=t,i*=-1}if(a<0){let e=t;t=r,r=e,a*=-1}}let s=this.colorStops.length?this.colorStops:s3,c=this._textureSize,{canvas:l,context:u}=d3(c,1),d=o?u.createLinearGradient(this._textureSize,0,0,0):u.createLinearGradient(0,0,this._textureSize,0);u3(d,s),u.fillStyle=d,u.fillRect(0,0,c,1),this.texture=new et({source:new Xt({resource:l,addressMode:this._wrapMode})});let f=Math.sqrt(i*i+a*a),p=Math.atan2(a,i),m=new Qe;m.scale(f/c,1),m.rotate(p),m.translate(e,t),this.textureSpace===`local`&&m.scale(c,c),this.transform=m}buildGradient(){this.texture||this._tick++,this.type===`linear`?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;let e=this.colorStops.length?this.colorStops:s3,t=this._textureSize,{canvas:n,context:r}=d3(t,t),{x:i,y:a}=this.center,{x:o,y:s}=this.outerCenter,c=this.innerRadius,l=this.outerRadius,u=o-l,d=s-l,f=t/(l*2),p=(i-u)*f,m=(a-d)*f,h=r.createRadialGradient(p,m,c*f,(o-u)*f,(s-d)*f,l*f);u3(h,e),r.fillStyle=e[e.length-1].color,r.fillRect(0,0,t,t),r.fillStyle=h,r.translate(p,m),r.rotate(this.rotation),r.scale(1,this.scale),r.translate(-p,-m),r.fillRect(0,0,t,t),this.texture=new et({source:new Xt({resource:n,addressMode:this._wrapMode})});let g=new Qe;g.scale(1/f,1/f),g.translate(u,d),this.textureSpace===`local`&&g.scale(t,t),this.transform=g}destroy(){this.texture?.destroy(!0),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null}get styleKey(){return`fill-gradient-${this.uid}-${this._tick}`}};c3.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:`local`,type:`linear`,textureSize:256,wrapMode:`clamp-to-edge`},c3.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:`local`,type:`radial`,textureSize:256,wrapMode:`clamp-to-edge`};var l3=c3;function u3(e,t){for(let n=0;n<t.length;n++){let r=t[n];e.addColorStop(r.offset,r.color)}}function d3(e,t){let n=Gt.get().createCanvas(e,t);return{canvas:n,context:n.getContext(`2d`)}}function Twe(e){let t=e[0]??{};return(typeof t==`number`||e[1])&&(zt(`8.5.2`,`use options object instead`),t={type:`linear`,start:{x:e[0],y:e[1]},end:{x:e[2],y:e[3]},textureSpace:e[4],textureSize:e[5]??l3.defaultLinearOptions.textureSize}),t}var Ewe=new Qe,Dwe=new bt;function f3(e,t,n,r){let i=t.matrix?e.copyFrom(t.matrix).invert():e.identity();if(t.textureSpace===`local`){let e=n.getBounds(Dwe);t.width&&e.pad(t.width);let{x:r,y:a}=e,o=1/e.width,s=1/e.height,c=-r*o,l=-a*s,u=i.a,d=i.b,f=i.c,p=i.d;i.a*=o,i.b*=o,i.c*=s,i.d*=s,i.tx=c*u+l*f+i.tx,i.ty=c*d+l*p+i.ty}else i.translate(t.texture.frame.x,t.texture.frame.y),i.scale(1/t.texture.source.width,1/t.texture.source.height);let a=t.texture.source.style;return!(t.fill instanceof l3)&&a.addressMode===`clamp-to-edge`&&(a.addressMode=`repeat`,a.update()),r&&i.append(Ewe.copyFrom(r).invert()),i}var p3={};jt.handleByMap(W.ShapeBuilder,p3),jt.add(Cwe,Swe,wwe,e3,_we,vwe);var Owe=new bt,kwe=new Qe;function Awe(e,t){let{geometryData:n,batches:r}=t;r.length=0,n.indices.length=0,n.vertices.length=0,n.uvs.length=0;for(let t=0;t<e.instructions.length;t++){let i=e.instructions[t];if(i.action===`texture`)jwe(i.data,r,n);else if(i.action===`fill`||i.action===`stroke`){let e=i.action===`stroke`,t=i.data.path.shapePath,a=i.data.style,o=i.data.hole;e&&o&&m3(o.shapePath,a,!0,r,n),o&&(t.shapePrimitives[t.shapePrimitives.length-1].holes=o.shapePath.shapePrimitives),m3(t,a,e,r,n)}}}function jwe(e,t,n){let r=[],i=p3.rectangle,a=Owe;a.x=e.dx,a.y=e.dy,a.width=e.dw,a.height=e.dh;let o=e.transform;if(!i.build(a,r))return;let{vertices:s,uvs:c,indices:l}=n,u=l.length,d=s.length/2;o&&Q4(r,o),i.triangulate(r,s,2,d,l,u);let f=e.image,p=f.uvs;c.push(p.x0,p.y0,p.x1,p.y1,p.x3,p.y3,p.x2,p.y2);let m=ft.get($4);m.indexOffset=u,m.indexSize=l.length-u,m.attributeOffset=d,m.attributeSize=s.length/2-d,m.baseColor=e.style,m.alpha=e.alpha,m.texture=f,m.geometryData=n,t.push(m)}function m3(e,t,n,r,i){let{vertices:a,uvs:o,indices:s}=i;e.shapePrimitives.forEach(({shape:e,transform:c,holes:l})=>{let u=[],d=p3[e.type];if(!d.build(e,u))return;let f=s.length,p=a.length/2,m=`triangle-list`;if(c&&Q4(u,c),n){let n=e.closePath??!0,r=t;r.pixelLine?(bwe(u,n,a,s),m=`line-list`):a3(u,r,!1,n,a,s)}else if(l){let e=[],t=u.slice();Mwe(l).forEach(n=>{e.push(t.length/2),t.push(...n)}),o3(t,e,a,2,p,s,f)}else d.triangulate(u,a,2,p,s,f);let h=o.length/2,g=t.texture;if(g!==et.WHITE){let n=f3(kwe,t,e,c);mwe(a,2,p,o,h,2,a.length/2-p,n)}else hwe(o,h,2,a.length/2-p);let _=ft.get($4);_.indexOffset=f,_.indexSize=s.length-f,_.attributeOffset=p,_.attributeSize=a.length/2-p,_.baseColor=t.color,_.alpha=t.alpha,_.texture=g,_.geometryData=i,_.topology=m,r.push(_)})}function Mwe(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n].shape,i=[];p3[r.type].build(r,i)&&t.push(i)}return t}var Nwe=class{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){this.batches&&this.batches.forEach(e=>{ft.return(e)}),this.graphicsData&&ft.return(this.graphicsData),this.isBatchable=!1,this.context=null,this.batches.length=0,this.geometryData.indices.length=0,this.geometryData.vertices.length=0,this.geometryData.uvs.length=0,this.graphicsData=null}destroy(){this.reset(),this.batches=null,this.geometryData=null}},Pwe=class{constructor(){this.instructions=new Kt}init(e){let t=e.maxTextures;this.batcher?this.batcher._updateMaxTextures(t):this.batcher=new vn({maxTextures:t}),this.instructions.reset()}get geometry(){return zt(yt,`GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead.`),this.batcher.geometry}destroy(){this.batcher.destroy(),this.instructions.destroy(),this.batcher=null,this.instructions=null}},h3=class e{constructor(e){this._renderer=e,this._managedContexts=new ln({renderer:e,type:`resource`,name:`graphicsContext`})}init(t){e.defaultOptions.bezierSmoothness=t?.bezierSmoothness??e.defaultOptions.bezierSmoothness}getContextRenderData(e){return e._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(e)}updateGpuContext(e){let t=!!e._gpuData[this._renderer.uid],n=e._gpuData[this._renderer.uid]||this._initContext(e);if(e.dirty||!t){t&&n.reset(),Awe(e,n);let r=e.batchMode;e.customShader||r===`no-batch`?n.isBatchable=!1:r===`auto`?n.isBatchable=n.geometryData.vertices.length<400:n.isBatchable=!0,e.dirty=!1}return n}getGpuContext(e){return e._gpuData[this._renderer.uid]||this._initContext(e)}_initContextRenderData(e){let t=ft.get(Pwe,{maxTextures:this._renderer.limits.maxBatchableTextures}),n=e._gpuData[this._renderer.uid],{batches:r,geometryData:i}=n;n.graphicsData=t;let a=i.vertices.length,o=i.indices.length;for(let e=0;e<r.length;e++)r[e].applyTransform=!1;let s=t.batcher;s.ensureAttributeBuffer(a),s.ensureIndexBuffer(o),s.begin();for(let e=0;e<r.length;e++){let t=r[e];s.add(t)}s.finish(t.instructions);let c=s.geometry;c.indexBuffer.setDataWithSize(s.indexBuffer,s.indexSize,!0),c.buffers[0].setDataWithSize(s.attributeBuffer.float32View,s.attributeSize,!0);let l=s.batches;for(let e=0;e<l.length;e++){let t=l[e];t.bindGroup=Dn(t.textures.textures,t.textures.count,this._renderer.limits.maxBatchableTextures)}return t}_initContext(e){let t=new Nwe;return t.context=e,e._gpuData[this._renderer.uid]=t,this._managedContexts.add(e),t}destroy(){this._managedContexts.destroy(),this._renderer=null}};h3.extension={type:[W.WebGLSystem,W.WebGPUSystem],name:`graphicsContext`},h3.defaultOptions={bezierSmoothness:.5};var g3=h3,Fwe=8,_3=1.1920929e-7,Iwe=1,v3=.01,y3=0,b3=0;function x3(e,t,n,r,i,a,o,s,c,l){let u=(Iwe-Math.min(.99,Math.max(0,l??g3.defaultOptions.bezierSmoothness)))/1;return u*=u,Lwe(t,n,r,i,a,o,s,c,e,u),e}function Lwe(e,t,n,r,i,a,o,s,c,l){S3(e,t,n,r,i,a,o,s,c,l,0),c.push(o,s)}function S3(e,t,n,r,i,a,o,s,c,l,u){if(u>Fwe)return;let d=Math.PI,f=(e+n)/2,p=(t+r)/2,m=(n+i)/2,h=(r+a)/2,g=(i+o)/2,_=(a+s)/2,v=(f+m)/2,y=(p+h)/2,b=(m+g)/2,x=(h+_)/2,S=(v+b)/2,C=(y+x)/2;if(u>0){let u=o-e,f=s-t,p=Math.abs((n-o)*f-(r-s)*u),m=Math.abs((i-o)*f-(a-s)*u),h,g;if(p>_3&&m>_3){if((p+m)*(p+m)<=l*(u*u+f*f)){if(y3<v3){c.push(S,C);return}let l=Math.atan2(a-r,i-n);if(h=Math.abs(l-Math.atan2(r-t,n-e)),g=Math.abs(Math.atan2(s-a,o-i)-l),h>=d&&(h=2*d-h),g>=d&&(g=2*d-g),h+g<y3){c.push(S,C);return}if(b3!==0){if(h>b3){c.push(n,r);return}if(g>b3){c.push(i,a);return}}}}else if(p>_3){if(p*p<=l*(u*u+f*f)){if(y3<v3){c.push(S,C);return}if(h=Math.abs(Math.atan2(a-r,i-n)-Math.atan2(r-t,n-e)),h>=d&&(h=2*d-h),h<y3){c.push(n,r),c.push(i,a);return}if(b3!==0&&h>b3){c.push(n,r);return}}}else if(m>_3){if(m*m<=l*(u*u+f*f)){if(y3<v3){c.push(S,C);return}if(h=Math.abs(Math.atan2(s-a,o-i)-Math.atan2(a-r,i-n)),h>=d&&(h=2*d-h),h<y3){c.push(n,r),c.push(i,a);return}if(b3!==0&&h>b3){c.push(i,a);return}}}else if(u=S-(e+o)/2,f=C-(t+s)/2,u*u+f*f<=l){c.push(S,C);return}}S3(e,t,f,p,v,y,S,C,c,l,u+1),S3(S,C,b,x,g,_,o,s,c,l,u+1)}var Rwe=8,zwe=1.1920929e-7,Bwe=1,Vwe=.01,C3=0;function Hwe(e,t,n,r,i,a,o,s){let c=(Bwe-Math.min(.99,Math.max(0,s??g3.defaultOptions.bezierSmoothness)))/1;return c*=c,Uwe(t,n,r,i,a,o,e,c),e}function Uwe(e,t,n,r,i,a,o,s){w3(o,e,t,n,r,i,a,s,0),o.push(i,a)}function w3(e,t,n,r,i,a,o,s,c){if(c>Rwe)return;let l=Math.PI,u=(t+r)/2,d=(n+i)/2,f=(r+a)/2,p=(i+o)/2,m=(u+f)/2,h=(d+p)/2,g=a-t,_=o-n,v=Math.abs((r-a)*_-(i-o)*g);if(v>zwe){if(v*v<=s*(g*g+_*_)){if(C3<Vwe){e.push(m,h);return}let s=Math.abs(Math.atan2(o-i,a-r)-Math.atan2(i-n,r-t));if(s>=l&&(s=2*l-s),s<C3){e.push(m,h);return}}}else if(g=m-(t+a)/2,_=h-(n+o)/2,g*g+_*_<=s){e.push(m,h);return}w3(e,t,n,u,d,m,h,s,c+1),w3(e,m,h,f,p,a,o,s,c+1)}function T3(e,t,n,r,i,a,o,s){let c=Math.abs(i-a);(!o&&i>a||o&&a>i)&&(c=2*Math.PI-c),s||=Math.max(6,Math.floor(6*r**(1/3)*(c/Math.PI))),s=Math.max(s,3);let l=c/s,u=i;l*=o?-1:1;for(let i=0;i<s+1;i++){let i=Math.cos(u),a=Math.sin(u),o=t+i*r,s=n+a*r;e.push(o,s),u+=l}}function Wwe(e,t,n,r,i,a){let o=e[e.length-2],s=e[e.length-1]-n,c=o-t,l=i-n,u=r-t,d=Math.abs(s*u-c*l);if(d<1e-8||a===0){(e[e.length-2]!==t||e[e.length-1]!==n)&&e.push(t,n);return}let f=s*s+c*c,p=l*l+u*u,m=s*l+c*u,h=a*Math.sqrt(f)/d,g=a*Math.sqrt(p)/d,_=h*m/f,v=g*m/p,y=h*u+g*c,b=h*l+g*s,x=c*(g+_),S=s*(g+_),C=u*(h+v),w=l*(h+v),T=Math.atan2(S-b,x-y),E=Math.atan2(w-b,C-y);T3(e,y+t,b+n,a,T,E,c*l>u*s)}var E3=Math.PI*2,D3={centerX:0,centerY:0,ang1:0,ang2:0},O3=({x:e,y:t},n,r,i,a,o,s,c)=>{e*=n,t*=r;let l=i*e-a*t,u=a*e+i*t;return c.x=l+o,c.y=u+s,c};function Gwe(e,t){let n=t===-1.5707963267948966?-.551915024494:4/3*Math.tan(t/4),r=t===1.5707963267948966?.551915024494:n,i=Math.cos(e),a=Math.sin(e),o=Math.cos(e+t),s=Math.sin(e+t);return[{x:i-a*r,y:a+i*r},{x:o+s*r,y:s-o*r},{x:o,y:s}]}var k3=(e,t,n,r)=>{let i=e*r-t*n<0?-1:1,a=e*n+t*r;return a>1&&(a=1),a<-1&&(a=-1),i*Math.acos(a)},Kwe=(e,t,n,r,i,a,o,s,c,l,u,d,f)=>{let p=i**2,m=a**2,h=u**2,g=d**2,_=p*m-p*g-m*h;_<0&&(_=0),_/=p*g+m*h,_=Math.sqrt(_)*(o===s?-1:1);let v=_*i/a*d,y=_*-a/i*u,b=l*v-c*y+(e+n)/2,x=c*v+l*y+(t+r)/2,S=(u-v)/i,C=(d-y)/a,w=(-u-v)/i,T=(-d-y)/a,E=k3(1,0,S,C),D=k3(S,C,w,T);s===0&&D>0&&(D-=E3),s===1&&D<0&&(D+=E3),f.centerX=b,f.centerY=x,f.ang1=E,f.ang2=D};function qwe(e,t,n,r,i,a,o,s=0,c=0,l=0){if(a===0||o===0)return;let u=Math.sin(s*E3/360),d=Math.cos(s*E3/360),f=d*(t-r)/2+u*(n-i)/2,p=-u*(t-r)/2+d*(n-i)/2;if(f===0&&p===0)return;a=Math.abs(a),o=Math.abs(o);let m=f**2/a**2+p**2/o**2;m>1&&(a*=Math.sqrt(m),o*=Math.sqrt(m)),Kwe(t,n,r,i,a,o,c,l,u,d,f,p,D3);let{ang1:h,ang2:g}=D3,{centerX:_,centerY:v}=D3,y=Math.abs(g)/(E3/4);Math.abs(1-y)<1e-7&&(y=1);let b=Math.max(Math.ceil(y),1);g/=b;let x=e[e.length-2],S=e[e.length-1],C={x:0,y:0};for(let t=0;t<b;t++){let t=Gwe(h,g),{x:n,y:r}=O3(t[0],a,o,d,u,_,v,C),{x:i,y:s}=O3(t[1],a,o,d,u,_,v,C),{x:c,y:l}=O3(t[2],a,o,d,u,_,v,C);x3(e,x,S,n,r,i,s,c,l),x=c,S=l,h+=g}}function Jwe(e,t,n){let r=(e,t)=>{let n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);return{len:i,nx:n/i,ny:r/i}},i=(t,n)=>{t===0?e.moveTo(n.x,n.y):e.lineTo(n.x,n.y)},a=t[t.length-1];for(let o=0;o<t.length;o++){let s=t[o%t.length],c=s.radius??n;if(c<=0){i(o,s),a=s;continue}let l=t[(o+1)%t.length],u=r(s,a),d=r(s,l);if(u.len<1e-4||d.len<1e-4){i(o,s),a=s;continue}let f=Math.asin(u.nx*d.ny-u.ny*d.nx),p=1,m=!1;u.nx*d.nx-u.ny*-d.ny<0?f<0?f=Math.PI+f:(f=Math.PI-f,p=-1,m=!0):f>0&&(p=-1,m=!0);let h=f/2,g,_=Math.abs(Math.cos(h)*c/Math.sin(h));_>Math.min(u.len/2,d.len/2)?(_=Math.min(u.len/2,d.len/2),g=Math.abs(_*Math.sin(h)/Math.cos(h))):g=c;let v=s.x+d.nx*_+-d.ny*g*p,y=s.y+d.ny*_+d.nx*g*p,b=Math.atan2(u.ny,u.nx)+Math.PI/2*p,x=Math.atan2(d.ny,d.nx)-Math.PI/2*p;o===0&&e.moveTo(v+Math.cos(b)*g,y+Math.sin(b)*g),e.arc(v,y,g,b,x,m),a=s}}function Ywe(e,t,n,r){let i=(e,t)=>Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2),a=(e,t,n)=>({x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}),o=t.length;for(let s=0;s<o;s++){let c=t[(s+1)%o],l=c.radius??n;if(l<=0){s===0?e.moveTo(c.x,c.y):e.lineTo(c.x,c.y);continue}let u=t[s],d=t[(s+2)%o],f=i(u,c),p;p=f<1e-4?c:a(c,u,Math.min(f/2,l)/f);let m=i(d,c),h;h=m<1e-4?c:a(c,d,Math.min(m/2,l)/m),s===0?e.moveTo(p.x,p.y):e.lineTo(p.x,p.y),e.quadraticCurveTo(c.x,c.y,h.x,h.y,r)}}var Xwe=new bt,Zwe=class{constructor(e){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new mt,this._graphicsPath2D=e,this.signed=e.checkForHoles}moveTo(e,t){return this.startPoly(e,t),this}lineTo(e,t){this._ensurePoly();let n=this._currentPoly.points,r=n[n.length-2],i=n[n.length-1];return(r!==e||i!==t)&&n.push(e,t),this}arc(e,t,n,r,i,a){this._ensurePoly(!1);let o=this._currentPoly.points;return T3(o,e,t,n,r,i,a),this}arcTo(e,t,n,r,i){this._ensurePoly();let a=this._currentPoly.points;return Wwe(a,e,t,n,r,i),this}arcToSvg(e,t,n,r,i,a,o){let s=this._currentPoly.points;return qwe(s,this._currentPoly.lastX,this._currentPoly.lastY,a,o,e,t,n,r,i),this}bezierCurveTo(e,t,n,r,i,a,o){this._ensurePoly();let s=this._currentPoly;return x3(this._currentPoly.points,s.lastX,s.lastY,e,t,n,r,i,a,o),this}quadraticCurveTo(e,t,n,r,i){this._ensurePoly();let a=this._currentPoly;return Hwe(this._currentPoly.points,a.lastX,a.lastY,e,t,n,r,i),this}closePath(){return this.endPoly(!0),this}addPath(e,t){this.endPoly(),t&&!t.isIdentity()&&(e=e.clone(!0),e.transform(t));let n=this.shapePrimitives,r=n.length;for(let t=0;t<e.instructions.length;t++){let n=e.instructions[t];this[n.action](...n.data)}if(e.checkForHoles&&n.length-r>1){let e=null;for(let t=r;t<n.length;t++){let r=n[t];if(r.shape.type===`polygon`){let i=r.shape,a=e?.shape;a&&a.containsPolygon(i)?(e.holes||=[],e.holes.push(r),n.copyWithin(t,t+1),n.length--,t--):e=r}}}return this}finish(e=!1){this.endPoly(e)}rect(e,t,n,r,i){return this.drawShape(new bt(e,t,n,r),i),this}circle(e,t,n,r){return this.drawShape(new cwe(e,t,n),r),this}poly(e,t,n){let r=new X4(e);return r.closePath=t,this.drawShape(r,n),this}regularPoly(e,t,n,r,i=0,a){r=Math.max(r|0,3);let o=-1*Math.PI/2+i,s=Math.PI*2/r,c=[];for(let i=0;i<r;i++){let r=o-i*s;c.push(e+n*Math.cos(r),t+n*Math.sin(r))}return this.poly(c,!0,a),this}roundPoly(e,t,n,r,i,a=0,o){if(r=Math.max(r|0,3),i<=0)return this.regularPoly(e,t,n,r,a);let s=n*Math.sin(Math.PI/r)-.001;i=Math.min(i,s);let c=-1*Math.PI/2+a,l=Math.PI*2/r,u=(r-2)*Math.PI/r/2;for(let a=0;a<r;a++){let r=a*l+c,s=e+n*Math.cos(r),d=t+n*Math.sin(r),f=r+Math.PI+u,p=r-Math.PI-u,m=s+i*Math.cos(f),h=d+i*Math.sin(f),g=s+i*Math.cos(p),_=d+i*Math.sin(p);a===0?this.moveTo(m,h):this.lineTo(m,h),this.quadraticCurveTo(s,d,g,_,o)}return this.closePath()}roundShape(e,t,n=!1,r){return e.length<3?this:(n?Ywe(this,e,t,r):Jwe(this,e,t),this.closePath())}filletRect(e,t,n,r,i){if(i===0)return this.rect(e,t,n,r);let a=Math.min(n,r)/2,o=Math.min(a,Math.max(-a,i)),s=e+n,c=t+r,l=o<0?-o:0,u=Math.abs(o);return this.moveTo(e,t+u).arcTo(e+l,t+l,e+u,t,u).lineTo(s-u,t).arcTo(s-l,t+l,s,t+u,u).lineTo(s,c-u).arcTo(s-l,c-l,e+n-u,c,u).lineTo(e+u,c).arcTo(e+l,c-l,e,c-u,u).closePath()}chamferRect(e,t,n,r,i,a){if(i<=0)return this.rect(e,t,n,r);let o=Math.min(i,Math.min(n,r)/2),s=e+n,c=t+r,l=[e+o,t,s-o,t,s,t+o,s,c-o,s-o,c,e+o,c,e,c-o,e,t+o];for(let e=l.length-1;e>=2;e-=2)l[e]===l[e-2]&&l[e-1]===l[e-3]&&l.splice(e-1,2);return this.poly(l,!0,a)}ellipse(e,t,n,r,i){return this.drawShape(new lwe(e,t,n,r),i),this}roundRect(e,t,n,r,i,a){return this.drawShape(new pwe(e,t,n,r,i),a),this}drawShape(e,t){return this.endPoly(),this.shapePrimitives.push({shape:e,transform:t}),this}startPoly(e,t){let n=this._currentPoly;return n&&this.endPoly(),n=new X4,n.points.push(e,t),this._currentPoly=n,this}endPoly(e=!1){let t=this._currentPoly;return t&&t.points.length>2&&(t.closePath=e,this.shapePrimitives.push({shape:t})),this._currentPoly=null,this}_ensurePoly(e=!0){if(!this._currentPoly&&(this._currentPoly=new X4,e)){let e=this.shapePrimitives[this.shapePrimitives.length-1];if(e){let t=e.shape.x,n=e.shape.y;if(e.transform&&!e.transform.isIdentity()){let r=e.transform,i=t;t=r.a*t+r.c*n+r.tx,n=r.b*i+r.d*n+r.ty}this._currentPoly.points.push(t,n)}else this._currentPoly.points.push(0,0)}}buildPath(){let e=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let t=0;t<e.instructions.length;t++){let n=e.instructions[t];this[n.action](...n.data)}this.finish()}get bounds(){let e=this._bounds;e.clear();let t=this.shapePrimitives;for(let n=0;n<t.length;n++){let r=t[n],i=r.shape.getBounds(Xwe);r.transform?e.addRect(i,r.transform):e.addRect(i)}return e}},A3=class e{constructor(e,t=!1){this.instructions=[],this.uid=vt(`graphicsPath`),this._dirty=!0,this.checkForHoles=t,typeof e==`string`?swe(e,this):this.instructions=e?.slice()??[]}get shapePath(){return this._shapePath||=new Zwe(this),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(e,t){return e=e.clone(),this.instructions.push({action:`addPath`,data:[e,t]}),this._dirty=!0,this}arc(...e){return this.instructions.push({action:`arc`,data:e}),this._dirty=!0,this}arcTo(...e){return this.instructions.push({action:`arcTo`,data:e}),this._dirty=!0,this}arcToSvg(...e){return this.instructions.push({action:`arcToSvg`,data:e}),this._dirty=!0,this}bezierCurveTo(...e){return this.instructions.push({action:`bezierCurveTo`,data:e}),this._dirty=!0,this}bezierCurveToShort(e,t,n,r,i){let a=this.instructions[this.instructions.length-1],o=this.getLastPoint(Et.shared),s=0,c=0;if(!a||a.action!==`bezierCurveTo`)s=o.x,c=o.y;else{s=a.data[2],c=a.data[3];let e=o.x,t=o.y;s=e+(e-s),c=t+(t-c)}return this.instructions.push({action:`bezierCurveTo`,data:[s,c,e,t,n,r,i]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:`closePath`,data:[]}),this._dirty=!0,this}ellipse(...e){return this.instructions.push({action:`ellipse`,data:e}),this._dirty=!0,this}lineTo(...e){return this.instructions.push({action:`lineTo`,data:e}),this._dirty=!0,this}moveTo(...e){return this.instructions.push({action:`moveTo`,data:e}),this}quadraticCurveTo(...e){return this.instructions.push({action:`quadraticCurveTo`,data:e}),this._dirty=!0,this}quadraticCurveToShort(e,t,n){let r=this.instructions[this.instructions.length-1],i=this.getLastPoint(Et.shared),a=0,o=0;if(!r||r.action!==`quadraticCurveTo`)a=i.x,o=i.y;else{a=r.data[0],o=r.data[1];let e=i.x,t=i.y;a=e+(e-a),o=t+(t-o)}return this.instructions.push({action:`quadraticCurveTo`,data:[a,o,e,t,n]}),this._dirty=!0,this}rect(e,t,n,r,i){return this.instructions.push({action:`rect`,data:[e,t,n,r,i]}),this._dirty=!0,this}circle(e,t,n,r){return this.instructions.push({action:`circle`,data:[e,t,n,r]}),this._dirty=!0,this}roundRect(...e){return this.instructions.push({action:`roundRect`,data:e}),this._dirty=!0,this}poly(...e){return this.instructions.push({action:`poly`,data:e}),this._dirty=!0,this}regularPoly(...e){return this.instructions.push({action:`regularPoly`,data:e}),this._dirty=!0,this}roundPoly(...e){return this.instructions.push({action:`roundPoly`,data:e}),this._dirty=!0,this}roundShape(...e){return this.instructions.push({action:`roundShape`,data:e}),this._dirty=!0,this}filletRect(...e){return this.instructions.push({action:`filletRect`,data:e}),this._dirty=!0,this}chamferRect(...e){return this.instructions.push({action:`chamferRect`,data:e}),this._dirty=!0,this}star(e,t,n,r,i,a,o){i||=r/2;let s=-1*Math.PI/2+a,c=n*2,l=Math.PI*2/c,u=[];for(let n=0;n<c;n++){let a=n%2?i:r,o=n*l+s;u.push(e+a*Math.cos(o),t+a*Math.sin(o))}return this.poly(u,!0,o),this}clone(t=!1){let n=new e;if(n.checkForHoles=this.checkForHoles,!t)n.instructions=this.instructions.slice();else for(let e=0;e<this.instructions.length;e++){let t=this.instructions[e];n.instructions.push({action:t.action,data:t.data.slice()})}return n}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(e){if(e.isIdentity())return this;let t=e.a,n=e.b,r=e.c,i=e.d,a=e.tx,o=e.ty,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0;for(let h=0;h<this.instructions.length;h++){let g=this.instructions[h],_=g.data;switch(g.action){case`moveTo`:case`lineTo`:s=_[0],c=_[1],_[0]=t*s+r*c+a,_[1]=n*s+i*c+o;break;case`bezierCurveTo`:l=_[0],u=_[1],d=_[2],f=_[3],s=_[4],c=_[5],_[0]=t*l+r*u+a,_[1]=n*l+i*u+o,_[2]=t*d+r*f+a,_[3]=n*d+i*f+o,_[4]=t*s+r*c+a,_[5]=n*s+i*c+o;break;case`quadraticCurveTo`:l=_[0],u=_[1],s=_[2],c=_[3],_[0]=t*l+r*u+a,_[1]=n*l+i*u+o,_[2]=t*s+r*c+a,_[3]=n*s+i*c+o;break;case`arcToSvg`:s=_[5],c=_[6],p=_[0],m=_[1],_[0]=t*p+r*m,_[1]=n*p+i*m,_[5]=t*s+r*c+a,_[6]=n*s+i*c+o;break;case`circle`:_[4]=j3(_[3],e);break;case`rect`:_[4]=j3(_[4],e);break;case`ellipse`:_[8]=j3(_[8],e);break;case`roundRect`:_[5]=j3(_[5],e);break;case`addPath`:_[0].transform(e);break;case`poly`:_[2]=j3(_[2],e);break;default:ot(`unknown transform action`,g.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(e){let t=this.instructions.length-1,n=this.instructions[t];if(!n)return e.x=0,e.y=0,e;for(;n.action===`closePath`;){if(t--,t<0)return e.x=0,e.y=0,e;n=this.instructions[t]}switch(n.action){case`moveTo`:case`lineTo`:e.x=n.data[0],e.y=n.data[1];break;case`quadraticCurveTo`:e.x=n.data[2],e.y=n.data[3];break;case`bezierCurveTo`:e.x=n.data[4],e.y=n.data[5];break;case`arc`:case`arcToSvg`:e.x=n.data[5],e.y=n.data[6];break;case`addPath`:n.data[0].getLastPoint(e);break}return e}};function j3(e,t){return e?e.prepend(t):t.clone()}function M3(e,t,n){let r=e.getAttribute(t);return r?Number(r):n}function Qwe(e,t){let n=e.querySelectorAll(`defs`);for(let e=0;e<n.length;e++){let r=n[e];for(let e=0;e<r.children.length;e++){let n=r.children[e];switch(n.nodeName.toLowerCase()){case`lineargradient`:t.defs[n.id]=$we(n);break;case`radialgradient`:t.defs[n.id]=eTe(n);break;default:break}}}}function $we(e){let t=new l3(M3(e,`x1`,0),M3(e,`y1`,0),M3(e,`x2`,1),M3(e,`y2`,0),(e.getAttribute(`gradientUnits`)||`objectBoundingBox`)===`objectBoundingBox`?`local`:`global`);for(let n=0;n<e.children.length;n++){let r=e.children[n],i=M3(r,`offset`,0),a=lt.shared.setValue(r.getAttribute(`stop-color`)).toNumber();t.addColorStop(i,a)}return t}function eTe(e){return ot(`[SVG Parser] Radial gradients are not yet supported`),new l3(0,0,1,0)}function N3(e){let t=e.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return t?t[1]:``}var P3={fill:{type:`paint`,default:0},"fill-opacity":{type:`number`,default:1},stroke:{type:`paint`,default:0},"stroke-width":{type:`number`,default:1},"stroke-opacity":{type:`number`,default:1},"stroke-linecap":{type:`string`,default:`butt`},"stroke-linejoin":{type:`string`,default:`miter`},"stroke-miterlimit":{type:`number`,default:10},"stroke-dasharray":{type:`string`,default:`none`},"stroke-dashoffset":{type:`number`,default:0},opacity:{type:`number`,default:1}};function F3(e,t){let n=e.getAttribute(`style`),r={},i={},a={strokeStyle:r,fillStyle:i,useFill:!1,useStroke:!1};for(let n in P3){let r=e.getAttribute(n);r&&I3(t,a,n,r.trim())}if(n){let e=n.split(`;`);for(let n=0;n<e.length;n++){let[r,i]=e[n].trim().split(`:`);P3[r]&&I3(t,a,r,i.trim())}}return{strokeStyle:a.useStroke?r:null,fillStyle:a.useFill?i:null,useFill:a.useFill,useStroke:a.useStroke}}function I3(e,t,n,r){switch(n){case`stroke`:if(r!==`none`){if(r.startsWith(`url(`)){let n=N3(r);t.strokeStyle.fill=e.defs[n]}else t.strokeStyle.color=lt.shared.setValue(r).toNumber();t.useStroke=!0}break;case`stroke-width`:t.strokeStyle.width=Number(r);break;case`fill`:if(r!==`none`){if(r.startsWith(`url(`)){let n=N3(r);t.fillStyle.fill=e.defs[n]}else t.fillStyle.color=lt.shared.setValue(r).toNumber();t.useFill=!0}break;case`fill-opacity`:t.fillStyle.alpha=Number(r);break;case`stroke-opacity`:t.strokeStyle.alpha=Number(r);break;case`opacity`:t.fillStyle.alpha=Number(r),t.strokeStyle.alpha=Number(r);break}}function tTe(e){if(e.length<=2)return!0;let t=e.map(e=>e.area).sort((e,t)=>t-e),[n,r]=t,i=t[t.length-1],a=n/r,o=r/i;return!(a>3&&o<2)}function nTe(e){return e.split(/(?=[Mm])/).filter(e=>e.trim().length>0)}function rTe(e){let t=e.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!t||t.length<4)return 0;let n=t.map(Number),r=[],i=[];for(let e=0;e<n.length;e+=2)e+1<n.length&&(r.push(n[e]),i.push(n[e+1]));if(r.length===0||i.length===0)return 0;let a=Math.min(...r),o=Math.max(...r),s=Math.min(...i),c=Math.max(...i);return(o-a)*(c-s)}function L3(e,t){let n=new A3(e,!1);for(let e of n.instructions)t.instructions.push(e)}function iTe(e,t){if(typeof e==`string`){let t=document.createElement(`div`);t.innerHTML=e.trim(),e=t.querySelector(`svg`)}let n={context:t,defs:{},path:new A3};Qwe(e,n);let r=e.children,{fillStyle:i,strokeStyle:a}=F3(e,n);for(let e=0;e<r.length;e++){let t=r[e];t.nodeName.toLowerCase()!==`defs`&&R3(t,n,i,a)}return t}function R3(e,t,n,r){let i=e.children,{fillStyle:a,strokeStyle:o}=F3(e,t);a&&n?n={...n,...a}:a&&(n=a),o&&r?r={...r,...o}:o&&(r=o);let s=!n&&!r;s&&(n={color:0});let c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w;switch(e.nodeName.toLowerCase()){case`path`:{x=e.getAttribute(`d`);let i=e.getAttribute(`fill-rule`),a=nTe(x),o=i===`evenodd`,s=a.length>1;if(o&&s){let e=a.map(e=>({path:e,area:rTe(e)}));if(e.sort((e,t)=>t.area-e.area),a.length>3||!tTe(e))for(let i=0;i<e.length;i++){let a=e[i],o=i===0;t.context.beginPath();let s=new A3(void 0,!0);L3(a.path,s),t.context.path(s),o?(n&&t.context.fill(n),r&&t.context.stroke(r)):t.context.cut()}else for(let i=0;i<e.length;i++){let a=e[i],o=i%2==1;t.context.beginPath();let s=new A3(void 0,!0);L3(a.path,s),t.context.path(s),o?t.context.cut():(n&&t.context.fill(n),r&&t.context.stroke(r))}}else S=new A3(x,i?i===`evenodd`:!0),t.context.path(S),n&&t.context.fill(n),r&&t.context.stroke(r);break}case`circle`:m=M3(e,`cx`,0),h=M3(e,`cy`,0),g=M3(e,`r`,0),t.context.ellipse(m,h,g,g),n&&t.context.fill(n),r&&t.context.stroke(r);break;case`rect`:c=M3(e,`x`,0),l=M3(e,`y`,0),C=M3(e,`width`,0),w=M3(e,`height`,0),_=M3(e,`rx`,0),v=M3(e,`ry`,0),_||v?t.context.roundRect(c,l,C,w,_||v):t.context.rect(c,l,C,w),n&&t.context.fill(n),r&&t.context.stroke(r);break;case`ellipse`:m=M3(e,`cx`,0),h=M3(e,`cy`,0),_=M3(e,`rx`,0),v=M3(e,`ry`,0),t.context.beginPath(),t.context.ellipse(m,h,_,v),n&&t.context.fill(n),r&&t.context.stroke(r);break;case`line`:u=M3(e,`x1`,0),d=M3(e,`y1`,0),f=M3(e,`x2`,0),p=M3(e,`y2`,0),t.context.beginPath(),t.context.moveTo(u,d),t.context.lineTo(f,p),r&&t.context.stroke(r);break;case`polygon`:b=e.getAttribute(`points`),y=b.match(/-?\d+/g).map(e=>parseInt(e,10)),t.context.poly(y,!0),n&&t.context.fill(n),r&&t.context.stroke(r);break;case`polyline`:b=e.getAttribute(`points`),y=b.match(/-?\d+/g).map(e=>parseInt(e,10)),t.context.poly(y,!1),r&&t.context.stroke(r);break;case`g`:case`svg`:break;default:ot(`[SVG parser] <${e.nodeName}> elements unsupported`);break}s&&(n=null);for(let e=0;e<i.length;e++)R3(i[e],t,n,r)}var z3={repeat:{addressModeU:`repeat`,addressModeV:`repeat`},"repeat-x":{addressModeU:`repeat`,addressModeV:`clamp-to-edge`},"repeat-y":{addressModeU:`clamp-to-edge`,addressModeV:`repeat`},"no-repeat":{addressModeU:`clamp-to-edge`,addressModeV:`clamp-to-edge`}},B3=class{constructor(e,t){this.uid=vt(`fillPattern`),this._tick=0,this.transform=new Qe,this.texture=e,this.transform.scale(1/e.frame.width,1/e.frame.height),t&&(e.source.style.addressModeU=z3[t].addressModeU,e.source.style.addressModeV=z3[t].addressModeV)}setTransform(e){let t=this.texture;this.transform.copyFrom(e),this.transform.invert(),this.transform.scale(1/t.frame.width,1/t.frame.height),this._tick++}get texture(){return this._texture}set texture(e){this._texture!==e&&(this._texture=e,this._tick++)}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}};function aTe(e){return lt.isColorLike(e)}function V3(e){return e instanceof B3}function H3(e){return e instanceof l3}function oTe(e){return e instanceof et}function sTe(e,t,n){let r=lt.shared.setValue(t??0);return e.color=r.toNumber(),e.alpha=r.alpha===1?n.alpha:r.alpha,e.texture=et.WHITE,{...n,...e}}function cTe(e,t,n){return e.texture=t,{...n,...e}}function U3(e,t,n){return e.fill=t,e.color=16777215,e.texture=t.texture,e.matrix=t.transform,{...n,...e}}function W3(e,t,n){return t.buildGradient(),e.fill=t,e.color=16777215,e.texture=t.texture,e.matrix=t.transform,e.textureSpace=t.textureSpace,{...n,...e}}function lTe(e,t){let n={...t,...e},r=lt.shared.setValue(n.color);return n.alpha*=r.alpha,n.color=r.toNumber(),n}function G3(e,t){if(e==null)return null;let n={},r=e;return aTe(e)?sTe(n,e,t):oTe(e)?cTe(n,e,t):V3(e)?U3(n,e,t):H3(e)?W3(n,e,t):r.fill&&V3(r.fill)?U3(r,r.fill,t):r.fill&&H3(r.fill)?W3(r,r.fill,t):lTe(r,t)}function K3(e,t){let{width:n,alignment:r,miterLimit:i,cap:a,join:o,pixelLine:s,...c}=t,l=G3(e,c);return l?{width:n,alignment:r,miterLimit:i,cap:a,join:o,pixelLine:s,...l}:null}var uTe=new Et,q3=new Qe,J3=class e extends Ut{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=vt(`graphicsContext`),this.dirty=!0,this.batchMode=`auto`,this.instructions=[],this.destroyed=!1,this._activePath=new A3,this._transform=new Qe,this._fillStyle={...e.defaultFillStyle},this._strokeStyle={...e.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new mt,this._boundsDirty=!0}clone(){let t=new e;return t.batchMode=this.batchMode,t.instructions=this.instructions.slice(),t._activePath=this._activePath.clone(),t._transform=this._transform.clone(),t._fillStyle={...this._fillStyle},t._strokeStyle={...this._strokeStyle},t._stateStack=this._stateStack.slice(),t._bounds=this._bounds.clone(),t._boundsDirty=!0,t}get fillStyle(){return this._fillStyle}set fillStyle(t){this._fillStyle=G3(t,e.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(t){this._strokeStyle=K3(t,e.defaultStrokeStyle)}setFillStyle(t){return this._fillStyle=G3(t,e.defaultFillStyle),this}setStrokeStyle(t){return this._strokeStyle=G3(t,e.defaultStrokeStyle),this}texture(e,t,n,r,i,a){return this.instructions.push({action:`texture`,data:{image:e,dx:n||0,dy:r||0,dw:i||e.frame.width,dh:a||e.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:t||t===0?lt.shared.setValue(t).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new A3,this}fill(t,n){let r,i=this.instructions[this.instructions.length-1];return r=this._tick===0&&i?.action===`stroke`?i.data.path:this._activePath.clone(),r?(t!=null&&(n!==void 0&&typeof t==`number`&&(zt(st,`GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead`),t={color:t,alpha:n}),this._fillStyle=G3(t,e.defaultFillStyle)),this.instructions.push({action:`fill`,data:{style:this.fillStyle,path:r}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){let{x:e,y:t}=this._activePath.getLastPoint(Et.shared);this._activePath.clear(),this._activePath.moveTo(e,t)}stroke(t){let n,r=this.instructions[this.instructions.length-1];return n=this._tick===0&&r?.action===`fill`?r.data.path:this._activePath.clone(),n?(t!=null&&(this._strokeStyle=K3(t,e.defaultStrokeStyle)),this.instructions.push({action:`stroke`,data:{style:this.strokeStyle,path:n}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let e=0;e<2;e++){let t=this.instructions[this.instructions.length-1-e],n=this._activePath.clone();if(t&&(t.action===`stroke`||t.action===`fill`))if(t.data.hole)t.data.hole.addPath(n);else{t.data.hole=n;break}}return this._initNextPathLocation(),this}arc(e,t,n,r,i,a){this._tick++;let o=this._transform;return this._activePath.arc(o.a*e+o.c*t+o.tx,o.b*e+o.d*t+o.ty,n,r,i,a),this}arcTo(e,t,n,r,i){this._tick++;let a=this._transform;return this._activePath.arcTo(a.a*e+a.c*t+a.tx,a.b*e+a.d*t+a.ty,a.a*n+a.c*r+a.tx,a.b*n+a.d*r+a.ty,i),this}arcToSvg(e,t,n,r,i,a,o){this._tick++;let s=this._transform;return this._activePath.arcToSvg(e,t,n,r,i,s.a*a+s.c*o+s.tx,s.b*a+s.d*o+s.ty),this}bezierCurveTo(e,t,n,r,i,a,o){this._tick++;let s=this._transform;return this._activePath.bezierCurveTo(s.a*e+s.c*t+s.tx,s.b*e+s.d*t+s.ty,s.a*n+s.c*r+s.tx,s.b*n+s.d*r+s.ty,s.a*i+s.c*a+s.tx,s.b*i+s.d*a+s.ty,o),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(e,t,n,r){return this._tick++,this._activePath.ellipse(e,t,n,r,this._transform.clone()),this}circle(e,t,n){return this._tick++,this._activePath.circle(e,t,n,this._transform.clone()),this}path(e){return this._tick++,this._activePath.addPath(e,this._transform.clone()),this}lineTo(e,t){this._tick++;let n=this._transform;return this._activePath.lineTo(n.a*e+n.c*t+n.tx,n.b*e+n.d*t+n.ty),this}moveTo(e,t){this._tick++;let n=this._transform,r=this._activePath.instructions,i=n.a*e+n.c*t+n.tx,a=n.b*e+n.d*t+n.ty;return r.length===1&&r[0].action===`moveTo`?(r[0].data[0]=i,r[0].data[1]=a,this):(this._activePath.moveTo(i,a),this)}quadraticCurveTo(e,t,n,r,i){this._tick++;let a=this._transform;return this._activePath.quadraticCurveTo(a.a*e+a.c*t+a.tx,a.b*e+a.d*t+a.ty,a.a*n+a.c*r+a.tx,a.b*n+a.d*r+a.ty,i),this}rect(e,t,n,r){return this._tick++,this._activePath.rect(e,t,n,r,this._transform.clone()),this}roundRect(e,t,n,r,i){return this._tick++,this._activePath.roundRect(e,t,n,r,i,this._transform.clone()),this}poly(e,t){return this._tick++,this._activePath.poly(e,t,this._transform.clone()),this}regularPoly(e,t,n,r,i=0,a){return this._tick++,this._activePath.regularPoly(e,t,n,r,i,a),this}roundPoly(e,t,n,r,i,a){return this._tick++,this._activePath.roundPoly(e,t,n,r,i,a),this}roundShape(e,t,n,r){return this._tick++,this._activePath.roundShape(e,t,n,r),this}filletRect(e,t,n,r,i){return this._tick++,this._activePath.filletRect(e,t,n,r,i),this}chamferRect(e,t,n,r,i,a){return this._tick++,this._activePath.chamferRect(e,t,n,r,i,a),this}star(e,t,n,r,i=0,a=0){return this._tick++,this._activePath.star(e,t,n,r,i,a,this._transform.clone()),this}svg(e){return this._tick++,iTe(e,this),this}restore(){let e=this._stateStack.pop();return e&&(this._transform=e.transform,this._fillStyle=e.fillStyle,this._strokeStyle=e.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(e){return this._transform.rotate(e),this}scale(e,t=e){return this._transform.scale(e,t),this}setTransform(e,t,n,r,i,a){return e instanceof Qe?(this._transform.set(e.a,e.b,e.c,e.d,e.tx,e.ty),this):(this._transform.set(e,t,n,r,i,a),this)}transform(e,t,n,r,i,a){return e instanceof Qe?(this._transform.append(e),this):(q3.set(e,t,n,r,i,a),this._transform.append(q3),this)}translate(e,t=e){return this._transform.translate(e,t),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this._boundsDirty=!0,!this.dirty&&(this.emit(`update`,this,16),this.dirty=!0)}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=!1;let e=this._bounds;e.clear();for(let t=0;t<this.instructions.length;t++){let n=this.instructions[t],r=n.action;if(r===`fill`){let t=n.data;e.addBounds(t.path.bounds)}else if(r===`texture`){let t=n.data;e.addFrame(t.dx,t.dy,t.dx+t.dw,t.dy+t.dh,t.transform)}if(r===`stroke`){let t=n.data,r=t.style.alignment,i=t.style.width*(1-r),a=t.path.bounds;e.addFrame(a.minX-i,a.minY-i,a.maxX+i,a.maxY+i)}}return e}containsPoint(e){if(!this.bounds.containsPoint(e.x,e.y))return!1;let t=this.instructions,n=!1;for(let r=0;r<t.length;r++){let i=t[r],a=i.data,o=a.path;if(!i.action||!o)continue;let s=a.style,c=o.shapePath.shapePrimitives;for(let t=0;t<c.length;t++){let r=c[t].shape;if(!s||!r)continue;let o=c[t].transform,l=o?o.applyInverse(e,uTe):e;if(i.action===`fill`)n=r.contains(l.x,l.y);else{let e=s;n=r.strokeContains(l.x,l.y,e.width,e.alignment)}let u=a.hole;if(u){let e=u.shapePath?.shapePrimitives;if(e)for(let t=0;t<e.length;t++)e[t].shape.contains(l.x,l.y)&&(n=!1)}if(n)return!0}}return n}unload(){this.emit(`unload`,this);for(let e in this._gpuData)this._gpuData[e]?.destroy();this._gpuData=Object.create(null)}destroy(e=!1){if(!this.destroyed){if(this.destroyed=!0,this._stateStack.length=0,this._transform=null,this.unload(),this.emit(`destroy`,this),this.removeAllListeners(),typeof e==`boolean`?e:e?.texture){let t=typeof e==`boolean`?e:e?.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&`uid`in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(t)),this._strokeStyle.texture&&(this._strokeStyle.fill&&`uid`in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(t))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}}};J3.defaultFillStyle={color:16777215,alpha:1,texture:et.WHITE,matrix:null,fill:null,textureSpace:`local`},J3.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:`butt`,join:`miter`,texture:et.WHITE,matrix:null,fill:null,textureSpace:`local`,pixelLine:!1};var Y3=J3,X3=new class{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e}addTickerListener(){this._tickerAdded||!this.domElement||(kt.system.add(this._tickerUpdate,this,Ot.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&=(kt.system.remove(this._tickerUpdate,this),!1)}pointerMoved(){this._didMove=!0}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}let e=this.events._rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType===`touch`||globalThis.document.dispatchEvent(this.events.supportsPointerEvents?new PointerEvent(`pointermove`,{clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,pointerId:e.pointerId}):new MouseEvent(`mousemove`,{clientX:e.clientX,clientY:e.clientY}))}_tickerUpdate(e){this._deltaTime+=e.deltaTime,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this._update())}destroy(){this.removeTickerListener(),this.events=null,this.domElement=null,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}},Z3=class extends x4{constructor(){super(...arguments),this.client=new Et,this.movement=new Et,this.offset=new Et,this.global=new Et,this.screen=new Et}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(e,t,n){return e.worldTransform.applyInverse(n||this.global,t)}getModifierState(e){return`getModifierState`in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m){throw Error(`Method not implemented.`)}},Q3=class extends Z3{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return this.type===`pointermove`||this.type===`mousemove`||this.type===`touchmove`?[this]:[]}getPredictedEvents(){throw Error(`getPredictedEvents is not supported!`)}},$3=class extends Z3{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}};$3.DOM_DELTA_PIXEL=0,$3.DOM_DELTA_LINE=1,$3.DOM_DELTA_PAGE=2;var dTe=2048,fTe=new Et,e6=new Et,pTe=class{constructor(e){this.dispatch=new Ut,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=e,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping(`pointerdown`,this.mapPointerDown),this.addEventMapping(`pointermove`,this.mapPointerMove),this.addEventMapping(`pointerout`,this.mapPointerOut),this.addEventMapping(`pointerleave`,this.mapPointerOut),this.addEventMapping(`pointerover`,this.mapPointerOver),this.addEventMapping(`pointerup`,this.mapPointerUp),this.addEventMapping(`pointerupoutside`,this.mapPointerUpOutside),this.addEventMapping(`wheel`,this.mapWheel)}addEventMapping(e,t){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:t,priority:0}),this.mappingTable[e].sort((e,t)=>e.priority-t.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;let t=this.mappingTable[e.type];if(t)for(let n=0,r=t.length;n<r;n++)t[n].fn(e);else ot(`[EventBoundary]: Event mapping not defined for ${e.type}`)}hitTest(e,t){X3.pauseUpdate=!0;let n=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?`hitTestMoveRecursive`:`hitTestRecursive`,r=this[n](this.rootTarget,this.rootTarget.eventMode,fTe.set(e,t),this.hitTestFn,this.hitPruneFn);return r&&r[0]}propagate(e,t){if(!e.target)return;let n=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(let r=0,i=n.length-1;r<i;r++)if(e.currentTarget=n[r],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,t),!(e.propagationStopped||e.propagationImmediatelyStopped)){e.eventPhase=e.BUBBLING_PHASE;for(let r=n.length-2;r>=0;r--)if(e.currentTarget=n[r],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,n=this._allInteractiveElements){if(n.length===0)return;e.eventPhase=e.BUBBLING_PHASE;let r=Array.isArray(t)?t:[t];for(let t=n.length-1;t>=0;t--)r.forEach(r=>{e.currentTarget=n[t],this.notifyTarget(e,r)})}propagationPath(e){let t=[e];for(let n=0;n<dTe&&e!==this.rootTarget&&e.parent;n++){if(!e.parent)throw Error(`Cannot find propagation path to disconnected target`);t.push(e.parent),e=e.parent}return t.reverse(),t}hitTestMoveRecursive(e,t,n,r,i,a=!1){let o=!1;if(this._interactivePrune(e))return null;if((e.eventMode===`dynamic`||t===`dynamic`)&&(X3.pauseUpdate=!1),e.interactiveChildren&&e.children){let s=e.children;for(let c=s.length-1;c>=0;c--){let l=s[c],u=this.hitTestMoveRecursive(l,this._isInteractive(t)?t:l.eventMode,n,r,i,a||i(e,n));if(u){if(u.length>0&&!u[u.length-1].parent)continue;let t=e.isInteractive();(u.length>0||t)&&(t&&this._allInteractiveElements.push(e),u.push(e)),this._hitElements.length===0&&(this._hitElements=u),o=!0}}}let s=this._isInteractive(t),c=e.isInteractive();return c&&c&&this._allInteractiveElements.push(e),a||this._hitElements.length>0?null:o?this._hitElements:s&&!i(e,n)&&r(e,n)?c?[e]:[]:null}hitTestRecursive(e,t,n,r,i){if(this._interactivePrune(e)||i(e,n))return null;if((e.eventMode===`dynamic`||t===`dynamic`)&&(X3.pauseUpdate=!1),e.interactiveChildren&&e.children){let a=e.children,o=n;for(let n=a.length-1;n>=0;n--){let s=a[n],c=this.hitTestRecursive(s,this._isInteractive(t)?t:s.eventMode,o,r,i);if(c){if(c.length>0&&!c[c.length-1].parent)continue;let t=e.isInteractive();return(c.length>0||t)&&c.push(e),c}}}let a=this._isInteractive(t),o=e.isInteractive();return a&&r(e,n)?o?[e]:[]:null}_isInteractive(e){return e===`static`||e===`dynamic`}_interactivePrune(e){return!e||!e.visible||!e.renderable||!e.measurable||e.eventMode===`none`||e.eventMode===`passive`&&!e.interactiveChildren}hitPruneFn(e,t){if(e.hitArea&&(e.worldTransform.applyInverse(t,e6),!e.hitArea.contains(e6.x,e6.y)))return!0;if(e.effects&&e.effects.length)for(let n=0;n<e.effects.length;n++){let r=e.effects[n];if(r.containsPoint&&!r.containsPoint(t,this.hitTestFn))return!0}return!1}hitTestFn(e,t){return e.hitArea?!0:e?.containsPoint?(e.worldTransform.applyInverse(t,e6),e.containsPoint(e6)):!1}notifyTarget(e,t){if(!e.currentTarget.isInteractive())return;t??=e.type;let n=`on${t}`;e.currentTarget[n]?.(e);let r=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${t}capture`:t;this._notifyListeners(e,r),e.eventPhase===e.AT_TARGET&&this._notifyListeners(e,t)}mapPointerDown(e){if(!(e instanceof Q3)){ot(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=this.createPointerEvent(e);if(this.dispatchEvent(t,`pointerdown`),t.pointerType===`touch`)this.dispatchEvent(t,`touchstart`);else if(t.pointerType===`mouse`||t.pointerType===`pen`){let e=t.button===2;this.dispatchEvent(t,e?`rightdown`:`mousedown`)}let n=this.trackingData(e.pointerId);n.pressTargetsByButton[e.button]=t.composedPath(),this.freeEvent(t)}mapPointerMove(e){if(!(e instanceof Q3)){ot(`EventBoundary cannot map a non-pointer event as a pointer event`);return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;let t=this.createPointerEvent(e);this._isPointerMoveEvent=!1;let n=t.pointerType===`mouse`||t.pointerType===`pen`,r=this.trackingData(e.pointerId),i=this.findMountedTarget(r.overTargets);if(r.overTargets?.length>0&&i!==t.target){let r=e.type===`mousemove`?`mouseout`:`pointerout`,a=this.createPointerEvent(e,r,i);if(this.dispatchEvent(a,`pointerout`),n&&this.dispatchEvent(a,`mouseout`),!t.composedPath().includes(i)){let r=this.createPointerEvent(e,`pointerleave`,i);for(r.eventPhase=r.AT_TARGET;r.target&&!t.composedPath().includes(r.target);)r.currentTarget=r.target,this.notifyTarget(r),n&&this.notifyTarget(r,`mouseleave`),r.target=r.target.parent;this.freeEvent(r)}this.freeEvent(a)}if(i!==t.target){let r=e.type===`mousemove`?`mouseover`:`pointerover`,a=this.clonePointerEvent(t,r);this.dispatchEvent(a,`pointerover`),n&&this.dispatchEvent(a,`mouseover`);let o=i?.parent;for(;o&&o!==this.rootTarget.parent&&o!==t.target;)o=o.parent;if(!o||o===this.rootTarget.parent){let e=this.clonePointerEvent(t,`pointerenter`);for(e.eventPhase=e.AT_TARGET;e.target&&e.target!==i&&e.target!==this.rootTarget.parent;)e.currentTarget=e.target,this.notifyTarget(e),n&&this.notifyTarget(e,`mouseenter`),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(a)}let a=[],o=this.enableGlobalMoveEvents??!0;this.moveOnAll?a.push(`pointermove`):this.dispatchEvent(t,`pointermove`),o&&a.push(`globalpointermove`),t.pointerType===`touch`&&(this.moveOnAll?a.splice(1,0,`touchmove`):this.dispatchEvent(t,`touchmove`),o&&a.push(`globaltouchmove`)),n&&(this.moveOnAll?a.splice(1,0,`mousemove`):this.dispatchEvent(t,`mousemove`),o&&a.push(`globalmousemove`),this.cursor=t.target?.cursor),a.length>0&&this.all(t,a),this._allInteractiveElements.length=0,this._hitElements.length=0,r.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){if(!(e instanceof Q3)){ot(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=this.trackingData(e.pointerId),n=this.createPointerEvent(e),r=n.pointerType===`mouse`||n.pointerType===`pen`;this.dispatchEvent(n,`pointerover`),r&&this.dispatchEvent(n,`mouseover`),n.pointerType===`mouse`&&(this.cursor=n.target?.cursor);let i=this.clonePointerEvent(n,`pointerenter`);for(i.eventPhase=i.AT_TARGET;i.target&&i.target!==this.rootTarget.parent;)i.currentTarget=i.target,this.notifyTarget(i),r&&this.notifyTarget(i,`mouseenter`),i.target=i.target.parent;t.overTargets=n.composedPath(),this.freeEvent(n),this.freeEvent(i)}mapPointerOut(e){if(!(e instanceof Q3)){ot(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=this.trackingData(e.pointerId);if(t.overTargets){let n=e.pointerType===`mouse`||e.pointerType===`pen`,r=this.findMountedTarget(t.overTargets),i=this.createPointerEvent(e,`pointerout`,r);this.dispatchEvent(i),n&&this.dispatchEvent(i,`mouseout`);let a=this.createPointerEvent(e,`pointerleave`,r);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==this.rootTarget.parent;)a.currentTarget=a.target,this.notifyTarget(a),n&&this.notifyTarget(a,`mouseleave`),a.target=a.target.parent;t.overTargets=null,this.freeEvent(i),this.freeEvent(a)}this.cursor=null}mapPointerUp(e){if(!(e instanceof Q3)){ot(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=performance.now(),n=this.createPointerEvent(e);if(this.dispatchEvent(n,`pointerup`),n.pointerType===`touch`)this.dispatchEvent(n,`touchend`);else if(n.pointerType===`mouse`||n.pointerType===`pen`){let e=n.button===2;this.dispatchEvent(n,e?`rightup`:`mouseup`)}let r=this.trackingData(e.pointerId),i=this.findMountedTarget(r.pressTargetsByButton[e.button]),a=i;if(i&&!n.composedPath().includes(i)){let t=i;for(;t&&!n.composedPath().includes(t);){if(n.currentTarget=t,this.notifyTarget(n,`pointerupoutside`),n.pointerType===`touch`)this.notifyTarget(n,`touchendoutside`);else if(n.pointerType===`mouse`||n.pointerType===`pen`){let e=n.button===2;this.notifyTarget(n,e?`rightupoutside`:`mouseupoutside`)}t=t.parent}delete r.pressTargetsByButton[e.button],a=t}if(a){let i=this.clonePointerEvent(n,`click`);i.target=a,i.path=null,r.clicksByButton[e.button]||(r.clicksByButton[e.button]={clickCount:0,target:i.target,timeStamp:t});let o=r.clicksByButton[e.button];if(o.target===i.target&&t-o.timeStamp<200?++o.clickCount:o.clickCount=1,o.target=i.target,o.timeStamp=t,i.detail=o.clickCount,i.pointerType===`mouse`){let e=i.button===2;this.dispatchEvent(i,e?`rightclick`:`click`)}else i.pointerType===`touch`&&this.dispatchEvent(i,`tap`);this.dispatchEvent(i,`pointertap`),this.freeEvent(i)}this.freeEvent(n)}mapPointerUpOutside(e){if(!(e instanceof Q3)){ot(`EventBoundary cannot map a non-pointer event as a pointer event`);return}let t=this.trackingData(e.pointerId),n=this.findMountedTarget(t.pressTargetsByButton[e.button]),r=this.createPointerEvent(e);if(n){let i=n;for(;i;)r.currentTarget=i,this.notifyTarget(r,`pointerupoutside`),r.pointerType===`touch`?this.notifyTarget(r,`touchendoutside`):(r.pointerType===`mouse`||r.pointerType===`pen`)&&this.notifyTarget(r,r.button===2?`rightupoutside`:`mouseupoutside`),i=i.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(r)}mapWheel(e){if(!(e instanceof $3)){ot(`EventBoundary cannot map a non-wheel event as a wheel event`);return}let t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let n=1;n<e.length&&e[n].parent===t;n++)t=e[n];return t}createPointerEvent(e,t,n){let r=this.allocateEvent(Q3);return this.copyPointerData(e,r),this.copyMouseData(e,r),this.copyData(e,r),r.nativeEvent=e.nativeEvent,r.originalEvent=e,r.target=n??this.hitTest(r.global.x,r.global.y)??this._hitElements[0],typeof t==`string`&&(r.type=t),r}createWheelEvent(e){let t=this.allocateEvent($3);return this.copyWheelData(e,t),this.copyMouseData(e,t),this.copyData(e,t),t.nativeEvent=e.nativeEvent,t.originalEvent=e,t.target=this.hitTest(t.global.x,t.global.y),t}clonePointerEvent(e,t){let n=this.allocateEvent(Q3);return n.nativeEvent=e.nativeEvent,n.originalEvent=e.originalEvent,this.copyPointerData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.target=e.target,n.path=e.composedPath().slice(),n.type=t??n.type,n}copyWheelData(e,t){t.deltaMode=e.deltaMode,t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ}copyPointerData(e,t){e instanceof Q3&&t instanceof Q3&&(t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist)}copyMouseData(e,t){e instanceof Z3&&t instanceof Z3&&(t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.copyFrom(e.client),t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.copyFrom(e.movement),t.screen.copyFrom(e.screen),t.shiftKey=e.shiftKey,t.global.copyFrom(e.global))}copyData(e,t){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.detail=e.detail,t.view=e.view,t.which=e.which,t.layer.copyFrom(e.layer),t.page.copyFrom(e.page)}trackingData(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]}allocateEvent(e){this.eventPool.has(e)||this.eventPool.set(e,[]);let t=this.eventPool.get(e).pop()||new e(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.defaultPrevented=!1,t.path=null,t.target=null,t}freeEvent(e){if(e.manager!==this)throw Error(`It is illegal to free an event not managed by this EventBoundary!`);let t=e.constructor;this.eventPool.has(t)||this.eventPool.set(t,[]),this.eventPool.get(t).push(e)}_notifyListeners(e,t){let n=e.currentTarget._events[t];if(n)if(`fn`in n)n.once&&e.currentTarget.removeListener(t,n.fn,void 0,!0),n.fn.call(n.context,e);else for(let r=0,i=n.length;r<i&&!e.propagationImmediatelyStopped;r++)n[r].once&&e.currentTarget.removeListener(t,n[r].fn,void 0,!0),n[r].fn.call(n[r].context,e)}},mTe=1,hTe={touchstart:`pointerdown`,touchend:`pointerup`,touchendoutside:`pointerupoutside`,touchmove:`pointermove`,touchcancel:`pointercancel`},t6=class e{constructor(t){this.supportsTouchEvents=`ontouchstart`in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=t,this.rootBoundary=new pTe(null),X3.init(this),this.autoPreventDefault=!0,this._eventsAdded=!1,this._rootPointerEvent=new Q3(null),this._rootWheelEvent=new $3(null),this.cursorStyles={default:`inherit`,pointer:`pointer`},this.features=new Proxy({...e.defaultEventFeatures},{set:(e,t,n)=>(t===`globalMove`&&(this.rootBoundary.enableGlobalMoveEvents=n),e[t]=n,!0)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(t){let{canvas:n,resolution:r}=this.renderer;this.setTargetElement(n),this.resolution=r,e._defaultEventMode=t.eventMode??`passive`,Object.assign(this.features,t.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){X3.destroy(),this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(e){e||=`default`;let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this._currentCursor===e)return;this._currentCursor=e;let n=this.cursorStyles[e];if(n)switch(typeof n){case`string`:t&&(this.domElement.style.cursor=n);break;case`function`:n(e);break;case`object`:t&&Object.assign(this.domElement.style,n);break}else t&&typeof e==`string`&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this._rootPointerEvent}_onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=this._normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!(`cancelable`in e))&&e.preventDefault();for(let e=0,n=t.length;e<n;e++){let n=t[e],r=this._bootstrapEvent(this._rootPointerEvent,n);this.rootBoundary.mapEvent(r)}this.setCursor(this.rootBoundary.cursor)}_onPointerMove(e){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,X3.pointerMoved();let t=this._normalizeToPointerData(e);for(let e=0,n=t.length;e<n;e++){let n=this._bootstrapEvent(this._rootPointerEvent,t[e]);this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}_onPointerUp(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=e.target;e.composedPath&&e.composedPath().length>0&&(t=e.composedPath()[0]);let n=t===this.domElement?``:`outside`,r=this._normalizeToPointerData(e);for(let e=0,t=r.length;e<t;e++){let t=this._bootstrapEvent(this._rootPointerEvent,r[e]);t.type+=n,this.rootBoundary.mapEvent(t)}this.setCursor(this.rootBoundary.cursor)}_onPointerOverOut(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=this._normalizeToPointerData(e);for(let e=0,n=t.length;e<n;e++){let n=this._bootstrapEvent(this._rootPointerEvent,t[e]);this.rootBoundary.mapEvent(n)}this.setCursor(this.rootBoundary.cursor)}onWheel(e){if(!this.features.wheel)return;let t=this.normalizeWheelEvent(e);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(t)}setTargetElement(e){this._removeEvents(),this.domElement=e,X3.domElement=e,this._addEvents()}_addEvents(){if(this._eventsAdded||!this.domElement)return;X3.addTickerListener();let e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming=`none`,e.msTouchAction=`none`):this.supportsPointerEvents&&(e.touchAction=`none`)),this.supportsPointerEvents?(globalThis.document.addEventListener(`pointermove`,this._onPointerMove,!0),this.domElement.addEventListener(`pointerdown`,this._onPointerDown,!0),this.domElement.addEventListener(`pointerleave`,this._onPointerOverOut,!0),this.domElement.addEventListener(`pointerover`,this._onPointerOverOut,!0),globalThis.addEventListener(`pointerup`,this._onPointerUp,!0)):(globalThis.document.addEventListener(`mousemove`,this._onPointerMove,!0),this.domElement.addEventListener(`mousedown`,this._onPointerDown,!0),this.domElement.addEventListener(`mouseout`,this._onPointerOverOut,!0),this.domElement.addEventListener(`mouseover`,this._onPointerOverOut,!0),globalThis.addEventListener(`mouseup`,this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener(`touchstart`,this._onPointerDown,!0),this.domElement.addEventListener(`touchend`,this._onPointerUp,!0),this.domElement.addEventListener(`touchmove`,this._onPointerMove,!0))),this.domElement.addEventListener(`wheel`,this.onWheel,{passive:!0,capture:!0}),this._eventsAdded=!0}_removeEvents(){if(!this._eventsAdded||!this.domElement)return;X3.removeTickerListener();let e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming=``,e.msTouchAction=``):this.supportsPointerEvents&&(e.touchAction=``)),this.supportsPointerEvents?(globalThis.document.removeEventListener(`pointermove`,this._onPointerMove,!0),this.domElement.removeEventListener(`pointerdown`,this._onPointerDown,!0),this.domElement.removeEventListener(`pointerleave`,this._onPointerOverOut,!0),this.domElement.removeEventListener(`pointerover`,this._onPointerOverOut,!0),globalThis.removeEventListener(`pointerup`,this._onPointerUp,!0)):(globalThis.document.removeEventListener(`mousemove`,this._onPointerMove,!0),this.domElement.removeEventListener(`mousedown`,this._onPointerDown,!0),this.domElement.removeEventListener(`mouseout`,this._onPointerOverOut,!0),this.domElement.removeEventListener(`mouseover`,this._onPointerOverOut,!0),globalThis.removeEventListener(`mouseup`,this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener(`touchstart`,this._onPointerDown,!0),this.domElement.removeEventListener(`touchend`,this._onPointerUp,!0),this.domElement.removeEventListener(`touchmove`,this._onPointerMove,!0))),this.domElement.removeEventListener(`wheel`,this.onWheel,!0),this.domElement=null,this._eventsAdded=!1}mapPositionToPoint(e,t,n){let r=this.domElement.isConnected?this.domElement.getBoundingClientRect():{x:0,y:0,width:this.domElement.width,height:this.domElement.height,left:0,top:0},i=1/this.resolution;e.x=(t-r.left)*(this.domElement.width/r.width)*i,e.y=(n-r.top)*(this.domElement.height/r.height)*i}_normalizeToPointerData(e){let t=[];if(this.supportsTouchEvents&&e instanceof TouchEvent)for(let n=0,r=e.changedTouches.length;n<r;n++){let r=e.changedTouches[n];r.button===void 0&&(r.button=0),r.buttons===void 0&&(r.buttons=1),r.isPrimary===void 0&&(r.isPrimary=e.touches.length===1&&e.type===`touchstart`),r.width===void 0&&(r.width=r.radiusX||1),r.height===void 0&&(r.height=r.radiusY||1),r.tiltX===void 0&&(r.tiltX=0),r.tiltY===void 0&&(r.tiltY=0),r.pointerType===void 0&&(r.pointerType=`touch`),r.pointerId===void 0&&(r.pointerId=r.identifier||0),r.pressure===void 0&&(r.pressure=r.force||.5),r.twist===void 0&&(r.twist=0),r.tangentialPressure===void 0&&(r.tangentialPressure=0),r.layerX===void 0&&(r.layerX=r.offsetX=r.clientX),r.layerY===void 0&&(r.layerY=r.offsetY=r.clientY),r.isNormalized=!0,r.type=e.type,t.push(r)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){let n=e;n.isPrimary===void 0&&(n.isPrimary=!0),n.width===void 0&&(n.width=1),n.height===void 0&&(n.height=1),n.tiltX===void 0&&(n.tiltX=0),n.tiltY===void 0&&(n.tiltY=0),n.pointerType===void 0&&(n.pointerType=`mouse`),n.pointerId===void 0&&(n.pointerId=mTe),n.pressure===void 0&&(n.pressure=.5),n.twist===void 0&&(n.twist=0),n.tangentialPressure===void 0&&(n.tangentialPressure=0),n.isNormalized=!0,t.push(n)}else t.push(e);return t}normalizeWheelEvent(e){let t=this._rootWheelEvent;return this._transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}_bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this._transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type===`pointerleave`&&(e.type=`pointerout`),e.type.startsWith(`mouse`)&&(e.type=e.type.replace(`mouse`,`pointer`)),e.type.startsWith(`touch`)&&(e.type=hTe[e.type]||e.type),e}_transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};t6.extension={name:`events`,type:[W.WebGLSystem,W.CanvasSystem,W.WebGPUSystem],priority:-1},t6.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};var n6=t6,gTe={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return this.eventMode===`dynamic`||this.eventMode===`static`},set interactive(e){this.eventMode=e?`static`:`passive`},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??n6.defaultEventMode},set eventMode(e){this._internalEventMode=e},isInteractive(){return this.eventMode===`static`||this.eventMode===`dynamic`},interactiveChildren:!0,hitArea:null,addEventListener(e,t,n){let r=typeof n==`boolean`&&n||typeof n==`object`&&n.capture,i=typeof n==`object`?n.signal:void 0,a=typeof n==`object`?n.once===!0:!1,o=typeof t==`function`?void 0:t;e=r?`${e}capture`:e;let s=typeof t==`function`?t:t.handleEvent,c=this;i&&i.addEventListener(`abort`,()=>{c.off(e,s,o)}),a?c.once(e,s,o):c.on(e,s,o)},removeEventListener(e,t,n){let r=typeof n==`boolean`&&n||typeof n==`object`&&n.capture,i=typeof t==`function`?void 0:t;e=r?`${e}capture`:e,t=typeof t==`function`?t:t.handleEvent,this.off(e,t,i)},dispatchEvent(e){if(!(e instanceof x4))throw Error(`Container cannot propagate events outside of the Federated Events API`);return e.defaultPrevented=!1,e.path=null,e.target=this,e.manager.dispatchEvent(e),!e.defaultPrevented}},_Te=`in vec2 aPosition;
964
964
  out vec2 vTextureCoord;
965
965
 
966
966
  uniform vec4 uInputSize;
@@ -1395,7 +1395,7 @@ fn mainFragment(
1395
1395
  <div class="pixi-host">
1396
1396
  <div class="edge-glow"></div>
1397
1397
  </div>
1398
- `}};customElements.define(`virtual-trackpad-tab`,xOe);var SOe=/^\/versions\/[^/]+(?:\/|$)/;function COe(e){return SOe.test(e.pathname)&&new URLSearchParams(e.search).get(`session`)?.trim()||null}function X5(e,t=window.location){let n=COe(t);return n?`hosted-session:${n}:${e}`:e}var Z5=1.5,Q5=30,wOe=50,$5=15;function e7(){return`ontouchstart`in window||navigator.maxTouchPoints>0}function t7(e){return e===`input`||e===`keys`||e===`shortcuts`||e===`trackpad`||e===`settings`}function n7(e){return typeof e==`object`&&!!e}function r7(){try{let e=localStorage.getItem(X5(`xtermInputPanelState`));if(!e)return{};let t=JSON.parse(e);return n7(t)?t:{}}catch{return{}}}function TOe(e){try{localStorage.setItem(X5(`xtermInputPanelState`),JSON.stringify(e))}catch{}}function EOe(e){let t=r7().sessions;if(!t)return null;let n=t[e];if(!n7(n))return null;let r={activeTab:`input`,inputDraft:``};return t7(n.activeTab)&&(r.activeTab=n.activeTab),typeof n.inputDraft==`string`&&(r.inputDraft=n.inputDraft),r}function i7(){let e=r7();return t7(e.lastActiveTab)?e.lastActiveTab:`input`}var a7=class e{static _lastActiveTab=`input`;static _active=null;static _lastFocused=null;static _instances=new Set;static _onActiveChangeFn=null;static _mountTarget=null;static get activeInstance(){return e._active}static set onActiveChange(t){e._onActiveChangeFn=t}static set mountTarget(t){e._mountTarget=t,e._fabEl&&t&&t.appendChild(e._fabEl)}static get mountTarget(){return e._mountTarget}static _fabEl=null;static _fabSubscriberCount=0;static _ensureFab(t){if(e._fabEl){e._fabEl.parentElement!==t&&t.appendChild(e._fabEl);return}let n=document.createElement(`button`);n.type=`button`,n.title=`Open InputPanel`,n.replaceChildren(W2(24)),Object.assign(n.style,{position:`fixed`,zIndex:`50`,width:`56px`,height:`56px`,borderRadius:`50%`,border:`2px solid currentColor`,display:`flex`,alignItems:`center`,justifyContent:`center`,touchAction:`none`,userSelect:`none`,webkitUserSelect:`none`,webkitTouchCallout:`none`,cursor:`pointer`,boxShadow:`0 4px 12px rgba(0,0,0,0.3)`,background:`var(--primary, #e04a2f)`,color:`var(--primary-foreground, #fff)`,padding:`0`,margin:`0`,outline:`none`});let r=window.innerWidth-72,i=window.innerHeight-140;try{let e=localStorage.getItem(`input-panel-fab-pos`);if(e){let t=JSON.parse(e);r=t.x??r,i=t.y??i}}catch{}r=Math.max(0,Math.min(window.innerWidth-56,r)),i=Math.max(0,Math.min(window.innerHeight-56,i)),n.style.left=`${r}px`,n.style.top=`${i}px`;let a=!1,o=!1,s=0,c=0,l=0,u=0,d=()=>{let t=e._lastFocused,n=(t&&e._instances.has(t)?t:null)??[...e._instances].find(e=>e._terminal!=null)??null;n&&(e._lastFocused=n,n.open())};n.addEventListener(`pointerdown`,e=>{a=!0,o=!1,s=e.clientX,c=e.clientY,l=parseInt(n.style.left)||0,u=parseInt(n.style.top)||0,n.setPointerCapture(e.pointerId),e.preventDefault()}),n.addEventListener(`pointermove`,e=>{if(!a)return;let t=e.clientX-s,r=e.clientY-c;(Math.abs(t)>4||Math.abs(r)>4)&&(o=!0);let i=Math.max(0,Math.min(window.innerWidth-56,l+t)),d=Math.max(0,Math.min(window.innerHeight-56,u+r));n.style.left=`${i}px`,n.style.top=`${d}px`}),n.addEventListener(`pointerup`,()=>{if(a){a=!1;try{localStorage.setItem(`input-panel-fab-pos`,JSON.stringify({x:parseInt(n.style.left),y:parseInt(n.style.top)}))}catch{}o||d()}}),n.addEventListener(`pointercancel`,()=>{a=!1});let f=!1;n.addEventListener(`pointerdown`,()=>{f=!0},{capture:!0}),n.addEventListener(`click`,()=>{if(f){f=!1;return}d()}),n.addEventListener(`contextmenu`,e=>{e.preventDefault(),e.stopPropagation()}),n.addEventListener(`dragstart`,e=>{e.preventDefault()}),window.addEventListener(`resize`,()=>{let e=Math.min(parseInt(n.style.left)||0,window.innerWidth-56),t=Math.min(parseInt(n.style.top)||0,window.innerHeight-56);n.style.left=`${Math.max(0,e)}px`,n.style.top=`${Math.max(0,t)}px`}),t.appendChild(n),e._fabEl=n}static _setFabVisible(t){e._fabEl&&(e._fabEl.style.display=t&&e._fabSubscriberCount>0?`flex`:`none`)}_terminal=null;_panel=null;_cursorEl=null;_cursorPos={x:0,y:0};_isDragging=!1;_isOpen=!1;_edgeScrollTimer=null;_cleanups=[];_persistentCleanups=[];_listenersAttached=!1;_onInput;_onOpenCb;_onCloseCb;_getHistory;_addHistory;_subscribeHistory;_onSettingsChange;_platform;_defaultLayout;_showFab;_fabSubscribed;_panelSessionState;_stateKey;_hasOwnPersistedState;constructor(t){this._onInput=t?.onInput??(()=>{}),this._onOpenCb=t?.onOpen??null,this._onCloseCb=t?.onClose??null,this._getHistory=t?.getHistory??null,this._addHistory=t?.addHistory??null,this._subscribeHistory=t?.subscribeHistory??null,this._onSettingsChange=t?.onSettingsChange??null,this._platform=t?.platform??`common`,this._defaultLayout=t?.defaultLayout??`floating`,this._showFab=t?.showFab??!0,this._fabSubscribed=!1,this._stateKey=t?.stateKey?.trim()?t.stateKey:`default`,this._hasOwnPersistedState=!1,this._panelSessionState={activeTab:`input`,inputDraft:``};let n=EOe(this._stateKey);n?(this._panelSessionState=n,this._hasOwnPersistedState=!0):this._panelSessionState.activeTab=e._lastActiveTab||i7()}get isOpen(){return this._isOpen}set onOpen(e){this._onOpenCb=e}set onClose(e){this._onCloseCb=e}set onInput(e){this._onInput=e}setPlatform(e){this._platform=e,this._applyPlatformToPanel()}setDefaultLayout(e){this._defaultLayout=e}_persistPanelState(){e._lastActiveTab=this._panelSessionState.activeTab;let t=r7(),n={...t.sessions,[this._stateKey]:{activeTab:this._panelSessionState.activeTab,inputDraft:this._panelSessionState.inputDraft}};TOe({...t,lastActiveTab:this._panelSessionState.activeTab,sessions:n})}_getMountTarget(){return e._mountTarget??this._getTerminalHostElement()??document.body}_getTerminalHostElement(){let e=this._terminal?.element;return e instanceof HTMLElement?e.classList.contains(`xterm`)&&e.parentElement instanceof HTMLElement?e.parentElement:e:null}_detectTerminalEngine(){let e=this._terminal?.element;return e instanceof HTMLElement&&e.classList.contains(`xterm`)?`xterm`:`non-xterm`}activate(t){this._terminal=t,e._instances.add(this)}dispose(){this.close();for(let e of this._persistentCleanups)e();this._persistentCleanups=[],this._listenersAttached=!1,this._fabSubscribed&&(e._fabSubscriberCount=Math.max(0,e._fabSubscriberCount-1),this._fabSubscribed=!1,e._setFabVisible(e._active===null)),e._instances.delete(this),e._lastFocused===this&&(e._lastFocused=null),this._terminal=null}attachListeners(){if(this._listenersAttached||!this._terminal)return;let t=this._terminal.textarea;if(!t)return;this._listenersAttached=!0,this._showFab?(e._ensureFab(this._getMountTarget()),this._fabSubscribed||=(e._fabSubscriberCount+=1,!0),e._setFabVisible(!0)):e._fabSubscriberCount===0&&e._setFabVisible(!1),e._lastFocused||=this;let n=()=>{e._lastFocused=this,e7()&&!this._isOpen&&this.open()};t.addEventListener(`focus`,n),this._persistentCleanups.push(()=>t.removeEventListener(`focus`,n)),e7()&&t.setAttribute(`inputmode`,`none`)}open(){if(!this._terminal)return;if(this._isOpen){if(this._panel?.isConnected)return;this.close()}if(e._active&&e._active!==this&&e._active.close(),this._isOpen=!0,e._active=this,e._lastFocused=this,this._showFab&&e._setFabVisible(!1),this._suppressKeyboard(),!this._hasOwnPersistedState){let t=i7();this._panelSessionState.activeTab=t,e._lastActiveTab=t}let t=document.createElement(`input-panel`);t.setAttribute(`layout`,this._defaultLayout),this._applyPanelThemeBindings(t),t.activeTab=this._panelSessionState.activeTab;let n=document.createElement(`input-method-tab`);n.setAttribute(`slot`,`input`),n.value=this._panelSessionState.inputDraft,t.appendChild(n);let r=document.createElement(`virtual-keyboard-tab`);r.setAttribute(`slot`,`keys`),r.setAttribute(`floating`,``),r.setAttribute(`platform`,this._platform),t.appendChild(r);let i=document.createElement(`shortcut-tab`);i.setAttribute(`slot`,`shortcuts`),i.setAttribute(`platform`,this._platform),t.appendChild(i);let a=document.createElement(`virtual-trackpad-tab`);a.setAttribute(`slot`,`trackpad`),a.setAttribute(`floating`,``),t.appendChild(a),this._panel=t;let o=e=>{this._renderHistory(n,e)};if(this._getHistory&&this._getHistory().then(e=>o(e)).catch(()=>{}),this._subscribeHistory)try{let e=this._subscribeHistory(e=>{o(e)});this._cleanups.push(e)}catch{}this._on(t,`input-panel:close`,()=>this.close()),this._on(t,`input-panel:send`,e=>{let t=e.detail?.data;if(t&&this._onInput(t),e.composedPath()[0]===n&&this._addHistory&&t){let e=this._normalizeHistoryText(t);e&&Promise.resolve(this._addHistory(e)).then(()=>this._getHistory?.()).then(e=>{e&&o(e)}).catch(()=>{})}}),this._on(n,`input-panel:input-change`,e=>{let t=e.detail?.value;typeof t==`string`&&(this._panelSessionState.inputDraft=t,this._hasOwnPersistedState=!0,this._persistPanelState())}),this._on(t,`input-panel:tab-change`,e=>{let t=e.detail?.tab;t7(t)&&(this._panelSessionState.activeTab=t,this._hasOwnPersistedState=!0,this._persistPanelState()),t===`trackpad`?this._showCursor():this._hideCursor()}),this._on(t,`input-panel:settings-change`,e=>{if(!this._onSettingsChange)return;let t=e.detail;if(typeof t!=`object`||!t)return;let n=t;typeof n.fixedHeight!=`number`||typeof n.floatingWidth!=`number`||typeof n.floatingHeight!=`number`||typeof n.vibrationIntensity!=`number`||typeof n.historyLimit!=`number`||this._onSettingsChange({fixedHeight:n.fixedHeight,floatingWidth:n.floatingWidth,floatingHeight:n.floatingHeight,vibrationIntensity:n.vibrationIntensity,historyLimit:n.historyLimit})}),this._on(t,`trackpad:move`,e=>{let{dx:t,dy:n}=e.detail;this._moveCursor(t,n)}),this._on(t,`trackpad:tap`,()=>this._dispatchClick(1)),this._on(t,`trackpad:double-tap`,()=>this._dispatchDblClick()),this._on(t,`trackpad:long-press`,()=>this._dispatchRightClick()),this._on(t,`trackpad:two-finger-tap`,()=>this._dispatchRightClick()),this._on(t,`trackpad:drag-start`,()=>{this._isDragging=!0,this._dispatchMouse(`mousedown`,{detail:1})}),this._on(t,`trackpad:drag-move`,e=>{let{dx:t,dy:n}=e.detail;this._moveCursor(t,n),this._dispatchMouse(`mousemove`,{buttons:1}),this._updateEdgeScroll()}),this._on(t,`trackpad:drag-end`,()=>{this._isDragging=!1,this._stopEdgeScroll(),this._dispatchMouse(`mouseup`,{detail:1})}),this._on(t,`trackpad:scroll`,e=>{let{deltaY:t}=e.detail;this._dispatchWheel(t)}),this._getMountTarget().appendChild(t),this._createCursor(),this._focusTerminal(),this._onOpenCb?.(),e._onActiveChangeFn?.(this)}_applyPlatformToPanel(){if(!this._panel)return;let e=this._panel.querySelector(`virtual-keyboard-tab`),t=this._panel.querySelector(`shortcut-tab`);e?.setAttribute(`platform`,this._platform),t?.setAttribute(`platform`,this._platform)}_readThemeVar(e,t,n){for(let n of t){let t=e.getPropertyValue(n).trim();if(t)return t}return n}_applyPanelThemeBindings(e){let t=this._getTerminalHostElement()??this._getMountTarget(),n=getComputedStyle(t),r=this._readThemeVar(n,[`--input-panel-background`,`--terminal`,`--background`],`#1a1a1a`),i=this._readThemeVar(n,[`--input-panel-foreground`,`--terminal-foreground`,`--foreground`],`#ffffff`),a=this._readThemeVar(n,[`--input-panel-primary`,`--primary`],`#e04a2f`),o=this._readThemeVar(n,[`--input-panel-primary-foreground`,`--primary-foreground`],`#ffffff`),s=this._readThemeVar(n,[`--input-panel-border`,`--border`],`color-mix(in srgb, ${i} 24%, transparent)`),c=this._readThemeVar(n,[`--input-panel-muted`,`--muted`],`color-mix(in srgb, ${r} 86%, ${i} 14%)`),l=this._readThemeVar(n,[`--input-panel-muted-foreground`,`--muted-foreground`],`color-mix(in srgb, ${i} 62%, transparent)`);e.style.setProperty(`--input-panel-background`,r),e.style.setProperty(`--input-panel-foreground`,i),e.style.setProperty(`--input-panel-primary`,a),e.style.setProperty(`--input-panel-primary-foreground`,o),e.style.setProperty(`--input-panel-border`,s),e.style.setProperty(`--input-panel-muted`,c),e.style.setProperty(`--input-panel-muted-foreground`,l)}close(){if(this._isOpen){this._isOpen=!1,e._active===this&&(e._active=null),this._stopEdgeScroll();for(let e of this._cleanups)e();this._cleanups=[],this._panel?.remove(),this._panel=null,this._cursorEl?.remove(),this._cursorEl=null,e7()||this._restoreKeyboard(),this._showFab&&e._setFabVisible(!0),this._onCloseCb?.(),e._onActiveChangeFn?.(null)}}toggle(){if(this._isOpen){this.close();return}this.open()}syncFocusLifecycle(){if(e._lastFocused=this,this._isOpen&&!this._panel?.isConnected){this.open();return}if(e._active&&e._active!==this){this.open();return}this._isOpen&&this._focusTerminal()}_focusTerminal(){let e=this._terminal?.textarea;e&&(e7()&&e.setAttribute(`inputmode`,`none`),e.focus())}_createCursor(){let e=this._getTerminalHostElement();if(!e)return;let t=document.createElement(`div`);t.setAttribute(`data-input-panel-cursor`,`virtual-mouse`),t.setAttribute(`data-terminal-engine`,this._detectTerminalEngine()),t.setAttribute(`aria-hidden`,`true`),t.style.cssText=`position:absolute;z-index:10;pointer-events:none;opacity:0;transition:opacity 0.15s;color:#fff;`;let n=CCe(20);n.style.filter=`drop-shadow(0 0 1px rgba(0,0,0,0.9))`,t.replaceChildren(n),e.appendChild(t),this._cursorEl=t;let r=e.getBoundingClientRect();this._cursorPos={x:r.width/2,y:r.height/2},this._positionCursor()}_positionCursor(){this._cursorEl&&(this._cursorEl.style.left=`${this._cursorPos.x-4}px`,this._cursorEl.style.top=`${this._cursorPos.y-2}px`)}_showCursor(){if(this._cursorEl||this._createCursor(),this._cursorEl){let e=this._getTerminalHostElement();if(e){let t=e.getBoundingClientRect();this._cursorPos={x:t.width/2,y:t.height/2},this._positionCursor()}this._cursorEl.style.opacity=`1`}}_hideCursor(){this._cursorEl&&(this._cursorEl.style.opacity=`0.3`)}_moveCursor(e,t){let n=this._getTerminalHostElement();if(!n)return;let r=n.getBoundingClientRect();this._cursorPos.x=Math.max(0,Math.min(r.width,this._cursorPos.x+e*Z5)),this._cursorPos.y=Math.max(0,Math.min(r.height,this._cursorPos.y+t*Z5)),this._positionCursor()}_getClientCoords(){let e=this._getTerminalHostElement();if(!e)return null;let t=e.getBoundingClientRect();return{clientX:t.left+this._cursorPos.x,clientY:t.top+this._cursorPos.y}}_resolveTarget(e,t){let n=this._getTerminalHostElement();if(!n)return document.body;let r=document.elementFromPoint(e,t);return r&&n.contains(r)?r:n.querySelector(`.xterm-screen`)??n}_dispatchMouse(e,t={}){let n=this._getClientCoords();if(!n)return;let r=t.button??0,i=t.detail??1,a=t.buttons??(e===`mousedown`?r===0?1:r===2?2:4:0);this._resolveTarget(n.clientX,n.clientY).dispatchEvent(new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,detail:i,clientX:n.clientX,clientY:n.clientY,button:r,buttons:a}))}_dispatchClick(e){this._dispatchMouse(`mousedown`,{detail:e}),this._dispatchMouse(`mouseup`,{detail:e}),this._dispatchMouse(`click`,{detail:e})}_dispatchDblClick(){this._dispatchMouse(`mousedown`,{detail:2}),this._dispatchMouse(`mouseup`,{detail:2}),this._dispatchMouse(`click`,{detail:2}),this._dispatchMouse(`dblclick`,{detail:2})}_dispatchRightClick(){this._dispatchMouse(`mousedown`,{button:2}),this._dispatchMouse(`mouseup`,{button:2}),this._dispatchMouse(`contextmenu`,{button:2})}_dispatchWheel(e){let t=this._getClientCoords();t&&this._resolveTarget(t.clientX,t.clientY).dispatchEvent(new WheelEvent(`wheel`,{bubbles:!0,cancelable:!0,view:window,clientX:t.clientX,clientY:t.clientY,deltaY:e,deltaMode:WheelEvent.DOM_DELTA_PIXEL}))}_updateEdgeScroll(){let e=this._getTerminalHostElement();if(!e||!this._isDragging){this._stopEdgeScroll();return}let t=e.getBoundingClientRect(),n=this._cursorPos.y<Q5,r=this._cursorPos.y>t.height-Q5;if(!n&&!r){this._stopEdgeScroll();return}this._stopEdgeScroll(),this._edgeScrollTimer=setInterval(()=>{let e=this._getTerminalHostElement();if(!e||!this._isDragging){this._stopEdgeScroll();return}let t=e.getBoundingClientRect(),n=t.left+this._cursorPos.x,r=this._cursorPos.y<Q5?t.top-$5:t.bottom+$5;this._resolveTarget(t.left+this._cursorPos.x,t.top+this._cursorPos.y).dispatchEvent(new MouseEvent(`mousemove`,{bubbles:!0,cancelable:!0,view:window,clientX:n,clientY:r,button:0,buttons:1}))},wOe)}_stopEdgeScroll(){this._edgeScrollTimer&&=(clearInterval(this._edgeScrollTimer),null)}_suppressKeyboard(){if(!e7())return;let e=this._terminal?.textarea;e&&e.setAttribute(`inputmode`,`none`)}_restoreKeyboard(){let e=this._terminal?.textarea;e&&e.removeAttribute(`inputmode`)}_on(e,t,n){e.addEventListener(t,n),this._cleanups.push(()=>e.removeEventListener(t,n))}_normalizeHistoryText(e){return e.replace(/[\r\n]+$/u,``).trim()||null}_renderHistory(e,t){if(e.querySelectorAll(`[data-input-history-root="true"]`).forEach(e=>e.remove()),t.length===0)return;let n=document.createElement(`div`);n.dataset.inputHistoryRoot=`true`,n.setAttribute(`slot`,`history`),n.style.display=`flex`,n.style.flexDirection=`column`,n.style.gap=`4px`,n.style.padding=`4px 0`;for(let e of t){let t=document.createElement(`button`);t.type=`button`,t.title=e.text,t.style.display=`flex`,t.style.alignItems=`center`,t.style.gap=`8px`,t.style.width=`100%`,t.style.padding=`4px 6px`,t.style.border=`1px solid transparent`,t.style.borderRadius=`4px`,t.style.background=`transparent`,t.style.color=`var(--foreground, #fff)`,t.style.fontFamily=`inherit`,t.style.fontSize=`12px`,t.style.textAlign=`left`;let r=document.createElement(`span`);r.textContent=new Date(e.time).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),r.style.opacity=`0.65`,r.style.fontSize=`10px`,r.style.flexShrink=`0`;let i=document.createElement(`span`);i.textContent=e.text,i.style.overflow=`hidden`,i.style.textOverflow=`ellipsis`,i.style.whiteSpace=`nowrap`,t.appendChild(r),t.appendChild(i),t.addEventListener(`click`,()=>{this._onInput(`${e.text}\n`)}),n.appendChild(t)}e.appendChild(n)}},o7=`xtermInputPanelSettings`,DOe=50,OOe=1e3,kOe=1,AOe=1,s7=`terminal-meta`;function c7(){return jl(`terminal-input-history`,window.location)}function jOe(){return jl(`openspecui-terminal`,window.location)}function l7(){return jl(`input-history`,window.location)}function u7(){return jl(`terminal-input-history-fallback`,window.location)}function d7(e){return Math.max(kOe,Math.min(OOe,Math.round(e)))}function f7(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(typeof n!=`object`||!n)continue;let e=n;if(typeof e.text!=`string`||typeof e.time!=`number`||!Number.isFinite(e.time))continue;let r=e.text.trim();r&&t.push({text:r,time:e.time})}return t}function p7(e,t){let n=new Map;for(let t of e){let e=`${t.time}::${t.text}`;n.has(e)||n.set(e,t)}return[...n.values()].sort((e,t)=>t.time-e.time).slice(0,d7(t))}function m7(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]?.text!==t[n]?.text||e[n]?.time!==t[n]?.time)return!1;return!0}function h7(){try{let e=localStorage.getItem(o7);if(!e)return{};let t=JSON.parse(e);return typeof t!=`object`||!t?{}:t}catch{return{}}}function MOe(e){let t=h7();try{localStorage.setItem(o7,JSON.stringify({...t,...e}))}catch{}}async function g7(){return typeof window>`u`||!(`indexedDB`in window)?null:await new Promise(e=>{let t=window.indexedDB.open(jOe(),AOe);t.onupgradeneeded=()=>{let e=t.result;e.objectStoreNames.contains(s7)||e.createObjectStore(s7)},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null)})}async function NOe(){let e=await g7();return e?await new Promise(t=>{let n=e.transaction(s7,`readonly`),r=n.objectStore(s7).get(l7());r.onsuccess=()=>{t(f7(r.result))},r.onerror=()=>t([]),n.oncomplete=()=>e.close(),n.onerror=()=>e.close(),n.onabort=()=>e.close()}):null}async function POe(e){let t=await g7();return t?await new Promise(n=>{let r=t.transaction(s7,`readwrite`);r.objectStore(s7).put(e,l7()),r.oncomplete=()=>{t.close(),n(!0)},r.onerror=()=>{t.close(),n(!1)},r.onabort=()=>{t.close(),n(!1)}}):!1}function FOe(){try{let e=localStorage.getItem(u7());return e?f7(JSON.parse(e)):[]}catch{return[]}}function IOe(e){try{localStorage.setItem(u7(),JSON.stringify(e))}catch{}}async function LOe(){return await NOe()||FOe()}async function _7(e){await POe(e)||IOe(e)}var ROe=class{records=[];listeners=new Set;kvUnsubscribe=null;initPromise=null;subscribe(e){return this.listeners.add(e),this.ensureInitialized(),e(this.records),()=>{this.listeners.delete(e)}}async list(){return await this.ensureInitialized(),[...this.records]}getLimit(){let e=h7().historyLimit;return typeof e==`number`&&Number.isFinite(e)?d7(e):DOe}async setLimit(e){let t=d7(e);MOe({historyLimit:t}),await this.ensureInitialized();let n=p7(this.records,t);await this.commit(n,{persistRemote:!0})}async add(e){let t=e.trim();if(!t)return;await this.ensureInitialized();let n=p7([{text:t,time:Date.now()},...this.records],this.getLimit());await this.commit(n,{persistRemote:!0})}destroy(){this.kvUnsubscribe&&=(this.kvUnsubscribe(),null)}async ensureInitialized(){if(this.initPromise){await this.initPromise;return}this.initPromise=this.initialize(),await this.initPromise}async initialize(){if(this.records=p7(await LOe(),this.getLimit()),this.emit(),!Vl())try{let e=f7(await y_.kv.get.query({key:c7()})),t=p7([...this.records,...e],this.getLimit());m7(this.records,t)||(this.records=t,await _7(this.records),this.emit()),m7(e,this.records)||this.persistRemote(this.records);let n=y_.kv.subscribe.subscribe({key:c7()},{onData:e=>{this.onRemoteData(e)}});this.kvUnsubscribe=()=>n.unsubscribe()}catch{}}async onRemoteData(e){let t=f7(e),n=p7([...this.records,...t],this.getLimit());await this.commit(n,{persistRemote:!1})}async commit(e,t){m7(this.records,e)||(this.records=e,await _7(this.records),this.emit(),t.persistRemote&&!Vl()&&this.persistRemote(this.records))}async persistRemote(e){try{await y_.kv.set.mutate({key:c7(),value:e})}catch{}}emit(){for(let e of this.listeners)e(this.records)}},v7=`ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace`,zOe={fontSize:13,fontFamily:``,cursorBlink:!0,cursorStyle:`block`,scrollback:1e3,rendererEngine:`xterm`},y7=1500,b7=1e3,BOe=1e4,x7=`common`,VOe=512*1024,HOe=8,UOe=32,S7=13,WOe=800,GOe=[`JetBrains Mono`,`Fira Code`,`Source Code Pro`,`IBM Plex Mono`,`Inconsolata`,`Roboto Mono`,`Ubuntu Mono`,`Space Mono`],C7=new Set;function w7(e){try{return(new URL(e).pathname.split(`/`).pop()??``).replace(/\.[^.]+$/,``).replace(/[-_]/g,` `)||`CustomFont`}catch{return`CustomFont`}}async function KOe(e){let t=e.trim();if(!t)return``;if(!/^https?:\/\//i.test(t))return t;if(C7.has(t))return w7(t);try{let e=(await fetch(t,{method:`HEAD`})).headers.get(`content-type`)??``;if(e.includes(`text/css`)){let e=document.createElement(`link`);return e.rel=`stylesheet`,e.href=t,e.dataset.fontSrc=t,document.head.appendChild(e),C7.add(t),``}if(e.startsWith(`font/`)){let e=w7(t),n=document.createElement(`style`);return n.dataset.fontSrc=t,n.textContent=`@font-face { font-family: '${e}'; src: url('${t}'); }`,document.head.appendChild(n),C7.add(t),e}}catch{}return t}function qOe(e){let t=`google:${e}`;if(C7.has(t))return;let n=navigator.language??``,r=/^zh\b/i.test(n)?`https://fonts.googleapis.cn`:`https://fonts.googleapis.com`,i=document.createElement(`link`);i.rel=`stylesheet`,i.href=`${r}/css2?family=${e.replace(/ /g,`+`)}&display=swap`,i.dataset.fontSrc=t,document.head.appendChild(i),C7.add(t)}var JOe=class{instances=new Map;listeners=new Set;idCounter=0;config={...zOe};snapshotCache=null;inputHistoryStore=new ROe;ghosttyModule=null;ghosttyInitPromise=null;ws=null;wsConnected=!1;reconnectTimer=null;reconnectDelay=b7;pendingCreates=[];pendingCloseSessionIds=new Set;serverToLocalSessionId=new Map;hasDiscoveredSessions=!1;inputPanelDefaultLayout=`floating`;createSession(e){let t=`term-${++this.idCounter}`,n=e?.label??`Shell ${this.idCounter}`,r=this.createTerminalInstance(t,{label:n,command:e?.command,args:e?.args,isDedicated:e?.isDedicated??!1,closeTip:e?.closeTip,closeCallbackUrl:e?.closeCallbackUrl,restored:!1,serverSessionId:null,platform:x7});return this.instances.set(t,r),this._applyFonts(),this.bindTerminalInput(r),this.wsConnected&&this.ws?this.wsSend({type:`create`,requestId:t,cols:r.terminal.cols||80,rows:r.terminal.rows||24,command:e?.command,args:e?.args,closeTip:e?.closeTip,closeCallbackUrl:e?.closeCallbackUrl}):(this.pendingCreates.push({requestId:t,command:e?.command,args:e?.args,closeTip:e?.closeTip,closeCallbackUrl:e?.closeCallbackUrl,cols:r.terminal.cols||80,rows:r.terminal.rows||24}),this.ensureWsConnected()),this.notify(),t}createTerminalInstance(e,t){let{terminal:n,fitAddon:r,afterOpenHook:i,engine:a}=this.createRendererTerminal(),o=this.createInputPanelAddon(e,t.platform);return n.loadAddon(o),this.attachTerminalShortcuts(n,a),{id:e,serverSessionId:t.serverSessionId,terminal:n,fitAddon:r,inputPanelAddon:o,isConnected:!1,label:t.label,customTitle:null,processTitle:null,isDedicated:t.isDedicated,isExited:!1,exitCode:null,command:t.command,args:t.args,closeTip:t.closeTip,closeCallbackUrl:t.closeCallbackUrl,mountedContainer:null,resizeObserver:null,hasOpened:!1,afterOpenHook:i,pendingOutput:[],pendingOutputBytes:0,lastOutputTime:0,outputIdleTimer:null,restored:t.restored,platform:t.platform,rendererEngine:a}}getTerminalOptions(){return{cursorBlink:this.config.cursorBlink,cursorStyle:this.config.cursorStyle,fontSize:this.config.fontSize,fontFamily:v7,theme:{background:`transparent`},allowTransparency:!0,convertEol:!0,macOptionIsMeta:!0,macOptionClickForcesSelection:!0,scrollback:this.config.scrollback}}createRendererTerminal(){let e=this.getTerminalOptions();if(this.config.rendererEngine===`xterm`){let t=new zSe(e),n=new pbe;return t.loadAddon(n),t.loadAddon(new ybe),{terminal:t,fitAddon:n,afterOpenHook:null,engine:`xterm`}}let t=this.ghosttyModule;if(!t)throw Error(`ghostty-web is not initialized. Open Settings and switch engine again.`);let n=new t.Terminal(e),r=new t.FitAddon;return n.loadAddon(r),{terminal:n,fitAddon:r,afterOpenHook:()=>{let e=n;e.registerLinkProvider&&e.registerLinkProvider(new t.UrlRegexProvider(n))},engine:`ghostty`}}createInputPanelAddon(e,t){return new a7({onInput:t=>this.writeToSession(e,t),getHistory:async()=>this.inputHistoryStore.list(),addHistory:async e=>this.inputHistoryStore.add(e),subscribeHistory:e=>this.inputHistoryStore.subscribe(e),platform:t,defaultLayout:this.inputPanelDefaultLayout,showFab:!1,stateKey:e,onSettingsChange:async e=>{await this.inputHistoryStore.setLimit(e.historyLimit)}})}applyGhosttyBackground(e,t){if(e.rendererEngine!==`ghostty`)return;let n=this.resolveNearestOpaqueBackground(t),r=e.terminal.options.theme??{};e.terminal.options.allowTransparency=!1,e.terminal.options.theme={...r,background:n}}isTransparentColor(e){let t=e.trim().toLowerCase();return t.length===0||t===`transparent`||t===`rgba(0, 0, 0, 0)`||t===`rgba(0,0,0,0)`}resolveNearestOpaqueBackground(e){let t=e;for(;t;){let e=window.getComputedStyle(t).backgroundColor;if(!this.isTransparentColor(e))return e;t=t.parentElement}return`rgb(26, 26, 26)`}attachTerminalShortcuts(e,t){e.attachCustomKeyEventHandler(e=>{let n=e.metaKey||e.ctrlKey;if(e.type!==`keydown`||!n)return t===`xterm`;let r=!1;return(e.key===`=`||e.key===`+`)&&n&&(this.zoomFont(1),r=!0),e.key===`-`&&n&&!r&&(this.zoomFont(-1),r=!0),e.key===`0`&&n&&!r&&(this.resetFontSize(),r=!0),t===`xterm`?!r:r})}bindTerminalInput(e){e.terminal.onData(t=>{if(e.isExited){this.closeSession(e.id);return}let n=this.resolveServerSessionId(e.id);n&&this.wsSend({type:`input`,sessionId:n,data:t})})}isTerminalNotOpenedError(e){if(!(e instanceof Error))return!1;let t=e.message;return t.includes(`Terminal must be opened before use`)||t.includes(`Call terminal.open(parent) first`)}enqueuePendingOutput(e,t){if(t)for(e.pendingOutput.push(t),e.pendingOutputBytes+=t.length;e.pendingOutputBytes>VOe&&e.pendingOutput.length;){let t=e.pendingOutput.shift();if(!t)break;e.pendingOutputBytes-=t.length}}writeTerminalOutput(e,t){if(t){if(!e.hasOpened){this.enqueuePendingOutput(e,t);return}try{e.terminal.write(t)}catch(n){if(this.isTerminalNotOpenedError(n)){this.enqueuePendingOutput(e,t);return}console.error(`[terminal] failed to write output:`,n)}}}flushPendingOutput(e){if(!e.hasOpened||e.pendingOutput.length===0)return;let t=e.pendingOutput.join(``);e.pendingOutput=[],e.pendingOutputBytes=0,this.writeTerminalOutput(e,t)}replaceInstanceRenderer(e){let t=e.mountedContainer,n=e.serverSessionId;e.mountedContainer&&this.unmount(e.id),e.terminal.dispose();let{terminal:r,fitAddon:i,afterOpenHook:a,engine:o}=this.createRendererTerminal(),s=this.createInputPanelAddon(e.id,e.platform);r.loadAddon(s),this.attachTerminalShortcuts(r,o),e.terminal=r,e.fitAddon=i,e.inputPanelAddon=s,e.hasOpened=!1,e.afterOpenHook=a,e.mountedContainer=null,e.resizeObserver=null,e.rendererEngine=o,this.bindTerminalInput(e),t&&this.mount(e.id,t),n&&this.wsSend({type:`attach`,sessionId:n,cols:e.terminal.cols||80,rows:e.terminal.rows||24})}async ensureGhosttyModule(){return this.ghosttyModule?this.ghosttyModule:(this.ghosttyInitPromise||=q(()=>import(`./ghostty-web-v0ideTPB.js`).then(async e=>(await e.init(),this.ghosttyModule=e,e)),[]).finally(()=>{this.ghosttyInitPromise=null}),this.ghosttyInitPromise)}async setRendererEngine(e){if(e!==this.config.rendererEngine){e===`ghostty`&&await this.ensureGhosttyModule(),this.config.rendererEngine=e;for(let e of this.instances.values())this.replaceInstanceRenderer(e);this._applyFonts(),this.notify()}}closeSession(e,t){let n=this.instances.get(e);if(!n)return;let r=t?.triggerCloseCallback!==!1;if(n.mountedContainer&&this.unmount(e),n.outputIdleTimer&&=(clearTimeout(n.outputIdleTimer),null),this.pendingCreates=this.pendingCreates.filter(t=>t.requestId!==e),n.serverSessionId){let e=n.serverSessionId;this.serverToLocalSessionId.delete(e),this.wsConnected&&this.ws?.readyState===WebSocket.OPEN?this.wsSend({type:`close`,sessionId:e}):this.pendingCloseSessionIds.add(e)}n.terminal.dispose(),r&&this.runCloseCallback(n),this.instances.delete(e),this.notify()}closeAll(){for(let e of this.instances.keys())this.closeSession(e,{triggerCloseCallback:!1})}mount(e,t){let n=this.instances.get(e);if(!n)return;if(n.mountedContainer===t){requestAnimationFrame(()=>{try{n.fitAddon.fit()}catch{}});return}if(n.mountedContainer&&this.unmount(e),!n.hasOpened)this.applyGhosttyBackground(n,t),n.terminal.open(t),n.hasOpened=!0,n.afterOpenHook?.(),n.afterOpenHook=null,this.flushPendingOutput(n),n.inputPanelAddon.attachListeners();else{let e=n.terminal.element;e&&!e.contains(t)&&e.parentNode!==t&&t.appendChild(e),this.flushPendingOutput(n),this.applyGhosttyBackground(n,t)}n.mountedContainer=t,requestAnimationFrame(()=>{try{n.fitAddon.fit()}catch{}});let r=new ResizeObserver(()=>{try{if(n.fitAddon.fit(),n.terminal.cols&&n.terminal.rows){let t=this.resolveServerSessionId(e);if(!t)return;this.wsSend({type:`resize`,sessionId:t,cols:n.terminal.cols,rows:n.terminal.rows})}}catch{}});r.observe(t),n.resizeObserver=r,requestAnimationFrame(()=>{this.focusSession(e)})}unmount(e){let t=this.instances.get(e);!t||!t.mountedContainer||(t.resizeObserver&&=(t.resizeObserver.disconnect(),null),t.mountedContainer=null)}focusSession(e){let t=this.instances.get(e);if(!t||!t.hasOpened)return;let n=!1;try{t.terminal.focus?.(),n=!0}catch{}if(!n){let e=t.terminal.element;if(e instanceof HTMLElement)try{e.focus()}catch{}}t.inputPanelAddon.syncFocusLifecycle()}setCustomTitle(e,t){let n=this.instances.get(e);n&&(n.customTitle=t,this.notify())}getDisplayTitle(e){let t=this.instances.get(e);return t?t.customTitle??t.processTitle??t.label:``}getConfig(){return{...this.config}}applyConfig(e){let{rendererEngine:t,...n}=e;Object.assign(this.config,n);for(let e of this.instances.values()){let t=e.terminal;t.options.fontSize=this.config.fontSize,t.options.cursorBlink=this.config.cursorBlink,t.options.cursorStyle=this.config.cursorStyle,t.options.scrollback=this.config.scrollback}this._applyFonts(),t&&t!==this.config.rendererEngine&&this.setRendererEngine(t).catch(e=>{console.error(`[terminal] failed to switch renderer engine:`,e)}),this.notify()}async _applyFonts(){let e=this.config.fontFamily;if(!e){this._setFontFamily(v7);return}let t=e.split(/[,]+/).map(e=>e.trim()).filter(Boolean),n=[];for(let e of t)if(GOe.includes(e))qOe(e),n.push(e);else{let t=await KOe(e);t&&n.push(t)}n.push(v7),this._setFontFamily(n.join(`, `))}_setFontFamily(e){for(let t of this.instances.values())if(t.terminal.options.fontFamily=e,t.mountedContainer)try{t.fitAddon.fit()}catch{}}configPersistTimer=null;persistFontSize(){this.configPersistTimer&&clearTimeout(this.configPersistTimer),this.configPersistTimer=setTimeout(()=>{this.configPersistTimer=null,q(async()=>{let{trpcClient:e}=await import(`./trpc-BNNXrVzL.js`);return{trpcClient:e}},[]).then(({trpcClient:e})=>{e.config.update.mutate({terminal:{fontSize:this.config.fontSize}})}).catch(()=>{})},WOe)}zoomFont(e){let t=Math.min(UOe,Math.max(HOe,this.config.fontSize+e));t!==this.config.fontSize&&(this.applyConfig({fontSize:t}),this.persistFontSize())}resetFontSize(){this.config.fontSize!==S7&&(this.applyConfig({fontSize:S7}),this.persistFontSize())}writeToSession(e,t){let n=this.resolveServerSessionId(e);return n?this.wsSend({type:`input`,sessionId:n,data:t}):!1}openInputPanel(e){let t=[e?this.instances.get(e):void 0,...this.instances.values()],n=t.find(e=>e&&e.mountedContainer)?.id??t.find(e=>e)?.id;if(!n)return!1;this.focusSession(n);let r=this.instances.get(n);return r?(r.inputPanelAddon.open(),!0):!1}async addInputHistory(e){await this.inputHistoryStore.add(e)}resolveServerSessionId(e){let t=this.instances.get(e);return t?t.serverSessionId:null}getInstanceByServerSessionId(e){let t=this.serverToLocalSessionId.get(e)??e;return this.instances.get(t)}getLocalSessionIdByServerSessionId(e){return this.serverToLocalSessionId.get(e)??e}handleCreatedResponse(e){let t=this.instances.get(e.requestId);if(!t){this.wsSend({type:`close`,sessionId:e.sessionId});return}t.serverSessionId=e.sessionId,t.platform=e.platform,t.inputPanelAddon.setPlatform(e.platform),t.isConnected=!0,this.serverToLocalSessionId.set(e.sessionId,e.requestId),this.notify()}handleOutputResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);t&&(this.writeTerminalOutput(t,e.data),t.lastOutputTime=Date.now(),this.notify(),t.outputIdleTimer&&clearTimeout(t.outputIdleTimer),t.outputIdleTimer=setTimeout(()=>{t.outputIdleTimer=null,this.notify()},y7))}handleExitResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);if(t){if(t.isExited=!0,t.exitCode=e.exitCode,t.closeTip||t.isDedicated){let n=t.closeTip??`Press any key to close (equivalent to close action).`;this.writeTerminalOutput(t,`\r\n\x1b[90m[Process exited with code ${e.exitCode}. ${n}]\x1b[0m`)}this.notify()}}handleTitleResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);t&&(t.processTitle=e.title,this.notify())}handleBufferResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);!t||!e.data||this.writeTerminalOutput(t,e.data)}handleErrorResponse(e){if(e.code===`PTY_CREATE_FAILED`&&e.sessionId){let t=this.instances.get(e.sessionId);t&&!t.serverSessionId&&(t.isExited=!0,t.exitCode=-1,this.writeTerminalOutput(t,`\r\n\x1b[31m[Failed to start PTY: ${e.message}]\x1b[0m`),this.notify())}console.warn(`[pty] ${e.code}: ${e.message}`,e)}setInputPanelMountTarget(e){a7.mountTarget=e}setInputPanelDefaultLayout(e){this.inputPanelDefaultLayout=e;for(let t of this.instances.values())t.inputPanelAddon.setDefaultLayout(e)}getTerminalDimensions(e){let t=this.instances.get(e);return t?{cols:t.terminal.cols||80,rows:t.terminal.rows||24}:null}subscribe(e){return this.listeners.add(e),this.ensureWsConnected(),()=>{this.listeners.delete(e)}}getSnapshot(){if(this.snapshotCache)return this.snapshotCache;let e=[];for(let t of this.instances.values())e.push({id:t.id,label:t.label,customTitle:t.customTitle,processTitle:t.processTitle,displayTitle:t.customTitle??t.processTitle??t.label,isDedicated:t.isDedicated,isExited:t.isExited,exitCode:t.exitCode,outputActive:t.lastOutputTime>0&&Date.now()-t.lastOutputTime<y7,command:t.command,args:t.args,closeTip:t.closeTip,closeCallbackUrl:t.closeCallbackUrl,platform:t.platform});return this.snapshotCache={sessions:e},this.snapshotCache}notify(){this.snapshotCache=null;for(let e of this.listeners)e()}ensureWsConnected(){this.ws&&(this.ws.readyState===WebSocket.CONNECTING||this.ws.readyState===WebSocket.OPEN)||this.connectSharedWebSocket()}connectSharedWebSocket(){this.reconnectTimer&&=(clearTimeout(this.reconnectTimer),null);let e=new WebSocket(Ll());this.ws=e,e.onopen=()=>{this.wsConnected=!0,this.reconnectDelay=b7;for(let e of this.pendingCloseSessionIds)this.wsSend({type:`close`,sessionId:e});this.pendingCloseSessionIds.clear(),this.wsSend({type:`list`});for(let e of this.pendingCreates)this.wsSend({type:`create`,requestId:e.requestId,cols:e.cols,rows:e.rows,command:e.command,args:e.args,closeTip:e.closeTip,closeCallbackUrl:e.closeCallbackUrl});this.pendingCreates=[];for(let e of this.instances.values())if(!e.restored)continue;this.notify()},e.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}let n=lbe.safeParse(t);n.success&&this.handleServerMessage(n.data)},e.onclose=()=>{this.wsConnected=!1,this.ws=null,this.notify(),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,(this.listeners.size>0||this.instances.size>0)&&this.connectSharedWebSocket()},this.reconnectDelay),this.reconnectDelay=Math.min(this.reconnectDelay*1.5,BOe)},e.onerror=()=>{}}handleServerMessage(e){switch(e.type){case`list`:this.handleListResponse(e);break;case`created`:this.handleCreatedResponse(e);break;case`buffer`:this.handleBufferResponse(e);break;case`output`:this.handleOutputResponse(e);break;case`exit`:this.handleExitResponse(e);break;case`title`:this.handleTitleResponse(e);break;case`error`:this.handleErrorResponse(e);break}}handleListResponse(e){let t=new Set(e.sessions.map(e=>e.id));for(let t of e.sessions){let e=this.getLocalSessionIdByServerSessionId(t.id),n=this.instances.get(e);if(n)n.serverSessionId||=t.id;else{let e=t.title||`${t.command} ${t.args.join(` `)}`.trim();n=this.createTerminalInstance(t.id,{label:e.length>40?`${e.slice(0,37)}...`:e,command:t.command,args:t.args,isDedicated:!1,closeTip:t.closeTip,closeCallbackUrl:t.closeCallbackUrl,restored:!0,serverSessionId:t.id,platform:t.platform??x7}),t.isExited&&(n.isExited=!0,n.exitCode=t.exitCode),this.bindTerminalInput(n),this.instances.set(n.id,n),this._applyFonts()}n.closeTip=t.closeTip,n.closeCallbackUrl=t.closeCallbackUrl,n.platform=t.platform??x7,n.inputPanelAddon.setPlatform(n.platform),this.serverToLocalSessionId.set(t.id,n.id),this.wsSend({type:`attach`,sessionId:t.id,cols:n.terminal.cols||80,rows:n.terminal.rows||24})}for(let e of this.instances.values())e.restored&&e.serverSessionId&&!t.has(e.serverSessionId)&&!e.isExited&&(e.isExited=!0,e.exitCode=-1);this.hasDiscoveredSessions=!0,this.notify()}get discoveredSessions(){return this.hasDiscoveredSessions}runCloseCallback(e){if(!e.isExited)return;let t=YOe(e.closeCallbackUrl,e.exitCode);t&&XOe(t)}wsSend(e){return this.ws?.readyState===WebSocket.OPEN?(this.ws.send(JSON.stringify(e)),!0):!1}};function YOe(e,t){if(!e)return null;if(typeof e==`string`){let t=e.trim();return t.length>0?t:null}let n=e[t==null?`null`:String(t)];if(typeof n==`string`&&n.trim().length>0)return n.trim();let r=e[`*`];return typeof r==`string`&&r.trim().length>0?r.trim():null}function XOe(e){let t;try{t=new URL(e,window.location.origin)}catch{return}if(t.origin===window.location.origin){let e=`${t.pathname}${t.search}${t.hash}`,n=Pu.getAreaForPath(t.pathname);Pu.push(n,e,null);return}window.open(t.toString(),`_blank`,`noopener,noreferrer`)}new JOe;var ZOe=(0,G.createContext)(null);function QOe(){let e=(0,G.useContext)(ZOe);if(!e)throw Error(`useTerminalContext must be used within a TerminalProvider`);return e}function T7(){return typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2)}function E7(e,t){return`${e}${t.length>0?` ${t.join(` `)}`:``}`}function $Oe(e){return e.some(e=>e.status===`loading`||e.status===`running`)?`running`:e.some(e=>e.status===`error`)?`error`:e.length>0&&e.every(e=>e.status===`success`)?`success`:`idle`}function eke(e={}){let[t,n]=(0,G.useState)([]),[r,i]=(0,G.useState)([]),[a,o]=(0,G.useState)(null),s=(0,G.useRef)(null),c=(0,G.useRef)(null),l=(0,G.useRef)([]),u=(0,G.useRef)(e);(0,G.useEffect)(()=>{u.current=e},[e]);let d=(0,G.useCallback)(e=>{let t=e(l.current);l.current=t,n(t)},[]);(0,G.useEffect)(()=>{l.current=t},[t]);let f=(0,G.useCallback)(()=>{s.current?.unsubscribe?.(),s.current=null,c.current=null,l.current=[],n([]),i([]),o(null)},[]),p=(0,G.useCallback)(()=>{s.current?.unsubscribe?.(),s.current=null;let e=c.current;e&&(d(t=>t.map(t=>t.id===e?{...t,status:`error`,exitCode:null}:t)),i(t=>[...t,{id:T7(),commandId:e,kind:`meta`,text:`Process cancelled by user`,tone:`error`}])),c.current=null},[d]),m=(0,G.useCallback)((e,t=[],n=-1)=>{let r=T7();return d(i=>{let a=[...i],o={id:r,command:e,args:t,status:`idle`,exitCode:null};return n>=0&&n<a.length?a.splice(n,0,o):a.push(o),a}),r},[]),h=(0,G.useCallback)(e=>{d(t=>t.filter(t=>t.id!==e)),i(t=>t.filter(t=>t.commandId!==e)),c.current===e&&p()},[p,d]),g=(0,G.useCallback)(e=>{s.current?.unsubscribe?.(),s.current=null,c.current=null,i([]),o(null),d(()=>e.map(e=>({id:T7(),command:e.command,args:e.args??[],status:`idle`,exitCode:null})))},[d]),_=(0,G.useCallback)(()=>[...l.current],[]),v=(0,G.useCallback)(e=>{i(t=>[...t,e])},[]),y=(0,G.useCallback)(async e=>{if(Vl())return console.warn(`CLI runner is disabled in static mode`),null;let t=e??l.current.find(e=>e.status===`idle`)?.id,n=l.current.find(e=>e.id===t);if(!n)return null;s.current?.unsubscribe?.(),c.current=n.id,d(e=>e.map(e=>e.id===n.id?{...e,status:`loading`,exitCode:null}:e));let r=()=>{},i=new Promise(e=>{r=e}),a={data:new Set,error:new Set,close:new Set,exit:new Set},f=(e,t)=>{a[e].forEach(e=>e(t))},m={id:n.id,command:n.command,args:n.args,status:`loading`,exitCode:null,done:i,on:(e,t)=>(a[e].add(t),()=>a[e].delete(t)),cancel:()=>{p()}};u.current.onCreateProcess?.(m);let h=y_.cli.runCommandStream.subscribe({command:n.command,args:n.args},{onData:e=>{if(e.type===`command`){d(e=>e.map(e=>e.id===n.id?{...e,status:`running`}:e)),m.status=`running`,f(`data`,e.data??``);return}if(e.type===`stdout`&&e.data){v({id:T7(),commandId:n.id,kind:`stdout`,text:e.data}),f(`data`,e.data);return}if(e.type===`stderr`&&e.data){v({id:T7(),commandId:n.id,kind:`stderr`,text:e.data,tone:`error`}),f(`error`,e.data);return}if(e.type===`exit`){let t=e.exitCode??null;o(t);let i=t===0?`success`:`error`;d(e=>e.map(e=>e.id===n.id?{...e,status:i,exitCode:t}:e)),m.status=i,m.exitCode=t,v({id:T7(),commandId:n.id,kind:`meta`,text:`Process exited with code ${t??`unknown`}`,tone:t===0?`success`:`error`}),f(`close`,t),f(`exit`,t),r(t),s.current?.unsubscribe?.(),s.current=null,c.current=null}},onError:e=>{let t=e instanceof Error?e.message:String(e);d(e=>e.map(e=>e.id===n.id?{...e,status:`error`,exitCode:null}:e)),m.status=`error`,v({id:T7(),commandId:n.id,kind:`meta`,text:`Error: ${t}`,tone:`error`}),f(`error`,t),r(null),s.current?.unsubscribe?.(),s.current=null,c.current=null}});return m.status=`running`,s.current=h,m},[v,p,d]),b=(0,G.useCallback)(async()=>{let e=l.current.find(e=>e.status===`idle`);for(;e;){let t=await y(e.id);if(!t||await t.done!==0)break;e=l.current.find(e=>e.status===`idle`)}},[y]);return(0,G.useEffect)(()=>()=>{p()},[p]),{lines:(0,G.useMemo)(()=>t.flatMap(e=>{let t=e.status===`loading`?(0,K.jsx)(Qc,{className:`h-3 w-3 animate-spin text-sky-300`}):e.status===`running`?(0,K.jsxs)(`div`,{className:`flex items-center gap-1 text-amber-200`,children:[(0,K.jsx)(hl,{className:`h-3 w-3 animate-pulse`}),(0,K.jsx)(Qc,{className:`h-3 w-3 animate-spin`})]}):e.status===`success`?(0,K.jsx)(bc,{className:`h-3 w-3 text-green-400`}):e.status===`error`?(0,K.jsx)(Ec,{className:`h-3 w-3 text-red-400`}):null,n=e.status===`idle`?`# ${E7(e.command,e.args)}`:`$ ${E7(e.command,e.args)}`,i=[{id:`cmd-${e.id}`,kind:`html`,node:(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:e.status===`running`?`terminal-shimmer`:e.status===`loading`?`animate-pulse text-blue-200`:e.status===`success`?`text-green-300`:e.status===`error`?`text-red-300`:`text-zinc-200`,children:n}),t]})}],a=r.filter(t=>t.commandId===e.id).map(e=>({id:e.id,kind:`ascii`,text:e.text,tone:e.tone}));return[...i,...a]}),[t,r]),status:(0,G.useMemo)(()=>$Oe(t),[t]),exitCode:a,hasStarted:(0,G.useMemo)(()=>t.some(e=>e.status!==`idle`),[t]),commands:(0,G.useMemo)(()=>({add:m,remove:h,list:_,replaceAll:g,run:y,runAll:b}),[m,_,h,g,y,b]),reset:f,cancel:p}}var tke=`schema: spec-driven
1398
+ `}};customElements.define(`virtual-trackpad-tab`,xOe);var SOe=/^\/versions\/[^/]+(?:\/|$)/;function COe(e){return SOe.test(e.pathname)&&new URLSearchParams(e.search).get(`session`)?.trim()||null}function X5(e,t=window.location){let n=COe(t);return n?`hosted-session:${n}:${e}`:e}var Z5=1.5,Q5=30,wOe=50,$5=15;function e7(){return`ontouchstart`in window||navigator.maxTouchPoints>0}function t7(e){return e===`input`||e===`keys`||e===`shortcuts`||e===`trackpad`||e===`settings`}function n7(e){return typeof e==`object`&&!!e}function r7(){try{let e=localStorage.getItem(X5(`xtermInputPanelState`));if(!e)return{};let t=JSON.parse(e);return n7(t)?t:{}}catch{return{}}}function TOe(e){try{localStorage.setItem(X5(`xtermInputPanelState`),JSON.stringify(e))}catch{}}function EOe(e){let t=r7().sessions;if(!t)return null;let n=t[e];if(!n7(n))return null;let r={activeTab:`input`,inputDraft:``};return t7(n.activeTab)&&(r.activeTab=n.activeTab),typeof n.inputDraft==`string`&&(r.inputDraft=n.inputDraft),r}function i7(){let e=r7();return t7(e.lastActiveTab)?e.lastActiveTab:`input`}var a7=class e{static _lastActiveTab=`input`;static _active=null;static _lastFocused=null;static _instances=new Set;static _onActiveChangeFn=null;static _mountTarget=null;static get activeInstance(){return e._active}static set onActiveChange(t){e._onActiveChangeFn=t}static set mountTarget(t){e._mountTarget=t,e._fabEl&&t&&t.appendChild(e._fabEl)}static get mountTarget(){return e._mountTarget}static _fabEl=null;static _fabSubscriberCount=0;static _ensureFab(t){if(e._fabEl){e._fabEl.parentElement!==t&&t.appendChild(e._fabEl);return}let n=document.createElement(`button`);n.type=`button`,n.title=`Open InputPanel`,n.replaceChildren(W2(24)),Object.assign(n.style,{position:`fixed`,zIndex:`50`,width:`56px`,height:`56px`,borderRadius:`50%`,border:`2px solid currentColor`,display:`flex`,alignItems:`center`,justifyContent:`center`,touchAction:`none`,userSelect:`none`,webkitUserSelect:`none`,webkitTouchCallout:`none`,cursor:`pointer`,boxShadow:`0 4px 12px rgba(0,0,0,0.3)`,background:`var(--primary, #e04a2f)`,color:`var(--primary-foreground, #fff)`,padding:`0`,margin:`0`,outline:`none`});let r=window.innerWidth-72,i=window.innerHeight-140;try{let e=localStorage.getItem(`input-panel-fab-pos`);if(e){let t=JSON.parse(e);r=t.x??r,i=t.y??i}}catch{}r=Math.max(0,Math.min(window.innerWidth-56,r)),i=Math.max(0,Math.min(window.innerHeight-56,i)),n.style.left=`${r}px`,n.style.top=`${i}px`;let a=!1,o=!1,s=0,c=0,l=0,u=0,d=()=>{let t=e._lastFocused,n=(t&&e._instances.has(t)?t:null)??[...e._instances].find(e=>e._terminal!=null)??null;n&&(e._lastFocused=n,n.open())};n.addEventListener(`pointerdown`,e=>{a=!0,o=!1,s=e.clientX,c=e.clientY,l=parseInt(n.style.left)||0,u=parseInt(n.style.top)||0,n.setPointerCapture(e.pointerId),e.preventDefault()}),n.addEventListener(`pointermove`,e=>{if(!a)return;let t=e.clientX-s,r=e.clientY-c;(Math.abs(t)>4||Math.abs(r)>4)&&(o=!0);let i=Math.max(0,Math.min(window.innerWidth-56,l+t)),d=Math.max(0,Math.min(window.innerHeight-56,u+r));n.style.left=`${i}px`,n.style.top=`${d}px`}),n.addEventListener(`pointerup`,()=>{if(a){a=!1;try{localStorage.setItem(`input-panel-fab-pos`,JSON.stringify({x:parseInt(n.style.left),y:parseInt(n.style.top)}))}catch{}o||d()}}),n.addEventListener(`pointercancel`,()=>{a=!1});let f=!1;n.addEventListener(`pointerdown`,()=>{f=!0},{capture:!0}),n.addEventListener(`click`,()=>{if(f){f=!1;return}d()}),n.addEventListener(`contextmenu`,e=>{e.preventDefault(),e.stopPropagation()}),n.addEventListener(`dragstart`,e=>{e.preventDefault()}),window.addEventListener(`resize`,()=>{let e=Math.min(parseInt(n.style.left)||0,window.innerWidth-56),t=Math.min(parseInt(n.style.top)||0,window.innerHeight-56);n.style.left=`${Math.max(0,e)}px`,n.style.top=`${Math.max(0,t)}px`}),t.appendChild(n),e._fabEl=n}static _setFabVisible(t){e._fabEl&&(e._fabEl.style.display=t&&e._fabSubscriberCount>0?`flex`:`none`)}_terminal=null;_panel=null;_cursorEl=null;_cursorPos={x:0,y:0};_isDragging=!1;_isOpen=!1;_edgeScrollTimer=null;_cleanups=[];_persistentCleanups=[];_listenersAttached=!1;_onInput;_onOpenCb;_onCloseCb;_getHistory;_addHistory;_subscribeHistory;_onSettingsChange;_platform;_defaultLayout;_showFab;_fabSubscribed;_panelSessionState;_stateKey;_hasOwnPersistedState;constructor(t){this._onInput=t?.onInput??(()=>{}),this._onOpenCb=t?.onOpen??null,this._onCloseCb=t?.onClose??null,this._getHistory=t?.getHistory??null,this._addHistory=t?.addHistory??null,this._subscribeHistory=t?.subscribeHistory??null,this._onSettingsChange=t?.onSettingsChange??null,this._platform=t?.platform??`common`,this._defaultLayout=t?.defaultLayout??`floating`,this._showFab=t?.showFab??!0,this._fabSubscribed=!1,this._stateKey=t?.stateKey?.trim()?t.stateKey:`default`,this._hasOwnPersistedState=!1,this._panelSessionState={activeTab:`input`,inputDraft:``};let n=EOe(this._stateKey);n?(this._panelSessionState=n,this._hasOwnPersistedState=!0):this._panelSessionState.activeTab=e._lastActiveTab||i7()}get isOpen(){return this._isOpen}set onOpen(e){this._onOpenCb=e}set onClose(e){this._onCloseCb=e}set onInput(e){this._onInput=e}setPlatform(e){this._platform=e,this._applyPlatformToPanel()}setDefaultLayout(e){this._defaultLayout=e}_persistPanelState(){e._lastActiveTab=this._panelSessionState.activeTab;let t=r7(),n={...t.sessions,[this._stateKey]:{activeTab:this._panelSessionState.activeTab,inputDraft:this._panelSessionState.inputDraft}};TOe({...t,lastActiveTab:this._panelSessionState.activeTab,sessions:n})}_getMountTarget(){return e._mountTarget??this._getTerminalHostElement()??document.body}_getTerminalHostElement(){let e=this._terminal?.element;return e instanceof HTMLElement?e.classList.contains(`xterm`)&&e.parentElement instanceof HTMLElement?e.parentElement:e:null}_detectTerminalEngine(){let e=this._terminal?.element;return e instanceof HTMLElement&&e.classList.contains(`xterm`)?`xterm`:`non-xterm`}activate(t){this._terminal=t,e._instances.add(this)}dispose(){this.close();for(let e of this._persistentCleanups)e();this._persistentCleanups=[],this._listenersAttached=!1,this._fabSubscribed&&(e._fabSubscriberCount=Math.max(0,e._fabSubscriberCount-1),this._fabSubscribed=!1,e._setFabVisible(e._active===null)),e._instances.delete(this),e._lastFocused===this&&(e._lastFocused=null),this._terminal=null}attachListeners(){if(this._listenersAttached||!this._terminal)return;let t=this._terminal.textarea;if(!t)return;this._listenersAttached=!0,this._showFab?(e._ensureFab(this._getMountTarget()),this._fabSubscribed||=(e._fabSubscriberCount+=1,!0),e._setFabVisible(!0)):e._fabSubscriberCount===0&&e._setFabVisible(!1),e._lastFocused||=this;let n=()=>{e._lastFocused=this,e7()&&!this._isOpen&&this.open()};t.addEventListener(`focus`,n),this._persistentCleanups.push(()=>t.removeEventListener(`focus`,n)),e7()&&t.setAttribute(`inputmode`,`none`)}open(){if(!this._terminal)return;if(this._isOpen){if(this._panel?.isConnected)return;this.close()}if(e._active&&e._active!==this&&e._active.close(),this._isOpen=!0,e._active=this,e._lastFocused=this,this._showFab&&e._setFabVisible(!1),this._suppressKeyboard(),!this._hasOwnPersistedState){let t=i7();this._panelSessionState.activeTab=t,e._lastActiveTab=t}let t=document.createElement(`input-panel`);t.setAttribute(`layout`,this._defaultLayout),this._applyPanelThemeBindings(t),t.activeTab=this._panelSessionState.activeTab;let n=document.createElement(`input-method-tab`);n.setAttribute(`slot`,`input`),n.value=this._panelSessionState.inputDraft,t.appendChild(n);let r=document.createElement(`virtual-keyboard-tab`);r.setAttribute(`slot`,`keys`),r.setAttribute(`floating`,``),r.setAttribute(`platform`,this._platform),t.appendChild(r);let i=document.createElement(`shortcut-tab`);i.setAttribute(`slot`,`shortcuts`),i.setAttribute(`platform`,this._platform),t.appendChild(i);let a=document.createElement(`virtual-trackpad-tab`);a.setAttribute(`slot`,`trackpad`),a.setAttribute(`floating`,``),t.appendChild(a),this._panel=t;let o=e=>{this._renderHistory(n,e)};if(this._getHistory&&this._getHistory().then(e=>o(e)).catch(()=>{}),this._subscribeHistory)try{let e=this._subscribeHistory(e=>{o(e)});this._cleanups.push(e)}catch{}this._on(t,`input-panel:close`,()=>this.close()),this._on(t,`input-panel:send`,e=>{let t=e.detail?.data;if(t&&this._onInput(t),e.composedPath()[0]===n&&this._addHistory&&t){let e=this._normalizeHistoryText(t);e&&Promise.resolve(this._addHistory(e)).then(()=>this._getHistory?.()).then(e=>{e&&o(e)}).catch(()=>{})}}),this._on(n,`input-panel:input-change`,e=>{let t=e.detail?.value;typeof t==`string`&&(this._panelSessionState.inputDraft=t,this._hasOwnPersistedState=!0,this._persistPanelState())}),this._on(t,`input-panel:tab-change`,e=>{let t=e.detail?.tab;t7(t)&&(this._panelSessionState.activeTab=t,this._hasOwnPersistedState=!0,this._persistPanelState()),t===`trackpad`?this._showCursor():this._hideCursor()}),this._on(t,`input-panel:settings-change`,e=>{if(!this._onSettingsChange)return;let t=e.detail;if(typeof t!=`object`||!t)return;let n=t;typeof n.fixedHeight!=`number`||typeof n.floatingWidth!=`number`||typeof n.floatingHeight!=`number`||typeof n.vibrationIntensity!=`number`||typeof n.historyLimit!=`number`||this._onSettingsChange({fixedHeight:n.fixedHeight,floatingWidth:n.floatingWidth,floatingHeight:n.floatingHeight,vibrationIntensity:n.vibrationIntensity,historyLimit:n.historyLimit})}),this._on(t,`trackpad:move`,e=>{let{dx:t,dy:n}=e.detail;this._moveCursor(t,n)}),this._on(t,`trackpad:tap`,()=>this._dispatchClick(1)),this._on(t,`trackpad:double-tap`,()=>this._dispatchDblClick()),this._on(t,`trackpad:long-press`,()=>this._dispatchRightClick()),this._on(t,`trackpad:two-finger-tap`,()=>this._dispatchRightClick()),this._on(t,`trackpad:drag-start`,()=>{this._isDragging=!0,this._dispatchMouse(`mousedown`,{detail:1})}),this._on(t,`trackpad:drag-move`,e=>{let{dx:t,dy:n}=e.detail;this._moveCursor(t,n),this._dispatchMouse(`mousemove`,{buttons:1}),this._updateEdgeScroll()}),this._on(t,`trackpad:drag-end`,()=>{this._isDragging=!1,this._stopEdgeScroll(),this._dispatchMouse(`mouseup`,{detail:1})}),this._on(t,`trackpad:scroll`,e=>{let{deltaY:t}=e.detail;this._dispatchWheel(t)}),this._getMountTarget().appendChild(t),this._createCursor(),this._focusTerminal(),this._onOpenCb?.(),e._onActiveChangeFn?.(this)}_applyPlatformToPanel(){if(!this._panel)return;let e=this._panel.querySelector(`virtual-keyboard-tab`),t=this._panel.querySelector(`shortcut-tab`);e?.setAttribute(`platform`,this._platform),t?.setAttribute(`platform`,this._platform)}_readThemeVar(e,t,n){for(let n of t){let t=e.getPropertyValue(n).trim();if(t)return t}return n}_applyPanelThemeBindings(e){let t=this._getTerminalHostElement()??this._getMountTarget(),n=getComputedStyle(t),r=this._readThemeVar(n,[`--input-panel-background`,`--terminal`,`--background`],`#1a1a1a`),i=this._readThemeVar(n,[`--input-panel-foreground`,`--terminal-foreground`,`--foreground`],`#ffffff`),a=this._readThemeVar(n,[`--input-panel-primary`,`--primary`],`#e04a2f`),o=this._readThemeVar(n,[`--input-panel-primary-foreground`,`--primary-foreground`],`#ffffff`),s=this._readThemeVar(n,[`--input-panel-border`,`--border`],`color-mix(in srgb, ${i} 24%, transparent)`),c=this._readThemeVar(n,[`--input-panel-muted`,`--muted`],`color-mix(in srgb, ${r} 86%, ${i} 14%)`),l=this._readThemeVar(n,[`--input-panel-muted-foreground`,`--muted-foreground`],`color-mix(in srgb, ${i} 62%, transparent)`);e.style.setProperty(`--input-panel-background`,r),e.style.setProperty(`--input-panel-foreground`,i),e.style.setProperty(`--input-panel-primary`,a),e.style.setProperty(`--input-panel-primary-foreground`,o),e.style.setProperty(`--input-panel-border`,s),e.style.setProperty(`--input-panel-muted`,c),e.style.setProperty(`--input-panel-muted-foreground`,l)}close(){if(this._isOpen){this._isOpen=!1,e._active===this&&(e._active=null),this._stopEdgeScroll();for(let e of this._cleanups)e();this._cleanups=[],this._panel?.remove(),this._panel=null,this._cursorEl?.remove(),this._cursorEl=null,e7()||this._restoreKeyboard(),this._showFab&&e._setFabVisible(!0),this._onCloseCb?.(),e._onActiveChangeFn?.(null)}}toggle(){if(this._isOpen){this.close();return}this.open()}syncFocusLifecycle(){if(e._lastFocused=this,this._isOpen&&!this._panel?.isConnected){this.open();return}if(e._active&&e._active!==this){this.open();return}this._isOpen&&this._focusTerminal()}_focusTerminal(){let e=this._terminal?.textarea;e&&(e7()&&e.setAttribute(`inputmode`,`none`),e.focus())}_createCursor(){let e=this._getTerminalHostElement();if(!e)return;let t=document.createElement(`div`);t.setAttribute(`data-input-panel-cursor`,`virtual-mouse`),t.setAttribute(`data-terminal-engine`,this._detectTerminalEngine()),t.setAttribute(`aria-hidden`,`true`),t.style.cssText=`position:absolute;z-index:10;pointer-events:none;opacity:0;transition:opacity 0.15s;color:#fff;`;let n=CCe(20);n.style.filter=`drop-shadow(0 0 1px rgba(0,0,0,0.9))`,t.replaceChildren(n),e.appendChild(t),this._cursorEl=t;let r=e.getBoundingClientRect();this._cursorPos={x:r.width/2,y:r.height/2},this._positionCursor()}_positionCursor(){this._cursorEl&&(this._cursorEl.style.left=`${this._cursorPos.x-4}px`,this._cursorEl.style.top=`${this._cursorPos.y-2}px`)}_showCursor(){if(this._cursorEl||this._createCursor(),this._cursorEl){let e=this._getTerminalHostElement();if(e){let t=e.getBoundingClientRect();this._cursorPos={x:t.width/2,y:t.height/2},this._positionCursor()}this._cursorEl.style.opacity=`1`}}_hideCursor(){this._cursorEl&&(this._cursorEl.style.opacity=`0.3`)}_moveCursor(e,t){let n=this._getTerminalHostElement();if(!n)return;let r=n.getBoundingClientRect();this._cursorPos.x=Math.max(0,Math.min(r.width,this._cursorPos.x+e*Z5)),this._cursorPos.y=Math.max(0,Math.min(r.height,this._cursorPos.y+t*Z5)),this._positionCursor()}_getClientCoords(){let e=this._getTerminalHostElement();if(!e)return null;let t=e.getBoundingClientRect();return{clientX:t.left+this._cursorPos.x,clientY:t.top+this._cursorPos.y}}_resolveTarget(e,t){let n=this._getTerminalHostElement();if(!n)return document.body;let r=document.elementFromPoint(e,t);return r&&n.contains(r)?r:n.querySelector(`.xterm-screen`)??n}_dispatchMouse(e,t={}){let n=this._getClientCoords();if(!n)return;let r=t.button??0,i=t.detail??1,a=t.buttons??(e===`mousedown`?r===0?1:r===2?2:4:0);this._resolveTarget(n.clientX,n.clientY).dispatchEvent(new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,detail:i,clientX:n.clientX,clientY:n.clientY,button:r,buttons:a}))}_dispatchClick(e){this._dispatchMouse(`mousedown`,{detail:e}),this._dispatchMouse(`mouseup`,{detail:e}),this._dispatchMouse(`click`,{detail:e})}_dispatchDblClick(){this._dispatchMouse(`mousedown`,{detail:2}),this._dispatchMouse(`mouseup`,{detail:2}),this._dispatchMouse(`click`,{detail:2}),this._dispatchMouse(`dblclick`,{detail:2})}_dispatchRightClick(){this._dispatchMouse(`mousedown`,{button:2}),this._dispatchMouse(`mouseup`,{button:2}),this._dispatchMouse(`contextmenu`,{button:2})}_dispatchWheel(e){let t=this._getClientCoords();t&&this._resolveTarget(t.clientX,t.clientY).dispatchEvent(new WheelEvent(`wheel`,{bubbles:!0,cancelable:!0,view:window,clientX:t.clientX,clientY:t.clientY,deltaY:e,deltaMode:WheelEvent.DOM_DELTA_PIXEL}))}_updateEdgeScroll(){let e=this._getTerminalHostElement();if(!e||!this._isDragging){this._stopEdgeScroll();return}let t=e.getBoundingClientRect(),n=this._cursorPos.y<Q5,r=this._cursorPos.y>t.height-Q5;if(!n&&!r){this._stopEdgeScroll();return}this._stopEdgeScroll(),this._edgeScrollTimer=setInterval(()=>{let e=this._getTerminalHostElement();if(!e||!this._isDragging){this._stopEdgeScroll();return}let t=e.getBoundingClientRect(),n=t.left+this._cursorPos.x,r=this._cursorPos.y<Q5?t.top-$5:t.bottom+$5;this._resolveTarget(t.left+this._cursorPos.x,t.top+this._cursorPos.y).dispatchEvent(new MouseEvent(`mousemove`,{bubbles:!0,cancelable:!0,view:window,clientX:n,clientY:r,button:0,buttons:1}))},wOe)}_stopEdgeScroll(){this._edgeScrollTimer&&=(clearInterval(this._edgeScrollTimer),null)}_suppressKeyboard(){if(!e7())return;let e=this._terminal?.textarea;e&&e.setAttribute(`inputmode`,`none`)}_restoreKeyboard(){let e=this._terminal?.textarea;e&&e.removeAttribute(`inputmode`)}_on(e,t,n){e.addEventListener(t,n),this._cleanups.push(()=>e.removeEventListener(t,n))}_normalizeHistoryText(e){return e.replace(/[\r\n]+$/u,``).trim()||null}_renderHistory(e,t){if(e.querySelectorAll(`[data-input-history-root="true"]`).forEach(e=>e.remove()),t.length===0)return;let n=document.createElement(`div`);n.dataset.inputHistoryRoot=`true`,n.setAttribute(`slot`,`history`),n.style.display=`flex`,n.style.flexDirection=`column`,n.style.gap=`4px`,n.style.padding=`4px 0`;for(let e of t){let t=document.createElement(`button`);t.type=`button`,t.title=e.text,t.style.display=`flex`,t.style.alignItems=`center`,t.style.gap=`8px`,t.style.width=`100%`,t.style.padding=`4px 6px`,t.style.border=`1px solid transparent`,t.style.borderRadius=`4px`,t.style.background=`transparent`,t.style.color=`var(--foreground, #fff)`,t.style.fontFamily=`inherit`,t.style.fontSize=`12px`,t.style.textAlign=`left`;let r=document.createElement(`span`);r.textContent=new Date(e.time).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),r.style.opacity=`0.65`,r.style.fontSize=`10px`,r.style.flexShrink=`0`;let i=document.createElement(`span`);i.textContent=e.text,i.style.overflow=`hidden`,i.style.textOverflow=`ellipsis`,i.style.whiteSpace=`nowrap`,t.appendChild(r),t.appendChild(i),t.addEventListener(`click`,()=>{this._onInput(`${e.text}\n`)}),n.appendChild(t)}e.appendChild(n)}},o7=`xtermInputPanelSettings`,DOe=50,OOe=1e3,kOe=1,AOe=1,s7=`terminal-meta`;function c7(){return jl(`terminal-input-history`,window.location)}function jOe(){return jl(`openspecui-terminal`,window.location)}function l7(){return jl(`input-history`,window.location)}function u7(){return jl(`terminal-input-history-fallback`,window.location)}function d7(e){return Math.max(kOe,Math.min(OOe,Math.round(e)))}function f7(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(typeof n!=`object`||!n)continue;let e=n;if(typeof e.text!=`string`||typeof e.time!=`number`||!Number.isFinite(e.time))continue;let r=e.text.trim();r&&t.push({text:r,time:e.time})}return t}function p7(e,t){let n=new Map;for(let t of e){let e=`${t.time}::${t.text}`;n.has(e)||n.set(e,t)}return[...n.values()].sort((e,t)=>t.time-e.time).slice(0,d7(t))}function m7(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]?.text!==t[n]?.text||e[n]?.time!==t[n]?.time)return!1;return!0}function h7(){try{let e=localStorage.getItem(o7);if(!e)return{};let t=JSON.parse(e);return typeof t!=`object`||!t?{}:t}catch{return{}}}function MOe(e){let t=h7();try{localStorage.setItem(o7,JSON.stringify({...t,...e}))}catch{}}async function g7(){return typeof window>`u`||!(`indexedDB`in window)?null:await new Promise(e=>{let t=window.indexedDB.open(jOe(),AOe);t.onupgradeneeded=()=>{let e=t.result;e.objectStoreNames.contains(s7)||e.createObjectStore(s7)},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null)})}async function NOe(){let e=await g7();return e?await new Promise(t=>{let n=e.transaction(s7,`readonly`),r=n.objectStore(s7).get(l7());r.onsuccess=()=>{t(f7(r.result))},r.onerror=()=>t([]),n.oncomplete=()=>e.close(),n.onerror=()=>e.close(),n.onabort=()=>e.close()}):null}async function POe(e){let t=await g7();return t?await new Promise(n=>{let r=t.transaction(s7,`readwrite`);r.objectStore(s7).put(e,l7()),r.oncomplete=()=>{t.close(),n(!0)},r.onerror=()=>{t.close(),n(!1)},r.onabort=()=>{t.close(),n(!1)}}):!1}function FOe(){try{let e=localStorage.getItem(u7());return e?f7(JSON.parse(e)):[]}catch{return[]}}function IOe(e){try{localStorage.setItem(u7(),JSON.stringify(e))}catch{}}async function LOe(){return await NOe()||FOe()}async function _7(e){await POe(e)||IOe(e)}var ROe=class{records=[];listeners=new Set;kvUnsubscribe=null;initPromise=null;subscribe(e){return this.listeners.add(e),this.ensureInitialized(),e(this.records),()=>{this.listeners.delete(e)}}async list(){return await this.ensureInitialized(),[...this.records]}getLimit(){let e=h7().historyLimit;return typeof e==`number`&&Number.isFinite(e)?d7(e):DOe}async setLimit(e){let t=d7(e);MOe({historyLimit:t}),await this.ensureInitialized();let n=p7(this.records,t);await this.commit(n,{persistRemote:!0})}async add(e){let t=e.trim();if(!t)return;await this.ensureInitialized();let n=p7([{text:t,time:Date.now()},...this.records],this.getLimit());await this.commit(n,{persistRemote:!0})}destroy(){this.kvUnsubscribe&&=(this.kvUnsubscribe(),null)}async ensureInitialized(){if(this.initPromise){await this.initPromise;return}this.initPromise=this.initialize(),await this.initPromise}async initialize(){if(this.records=p7(await LOe(),this.getLimit()),this.emit(),!Vl())try{let e=f7(await y_.kv.get.query({key:c7()})),t=p7([...this.records,...e],this.getLimit());m7(this.records,t)||(this.records=t,await _7(this.records),this.emit()),m7(e,this.records)||this.persistRemote(this.records);let n=y_.kv.subscribe.subscribe({key:c7()},{onData:e=>{this.onRemoteData(e)}});this.kvUnsubscribe=()=>n.unsubscribe()}catch{}}async onRemoteData(e){let t=f7(e),n=p7([...this.records,...t],this.getLimit());await this.commit(n,{persistRemote:!1})}async commit(e,t){m7(this.records,e)||(this.records=e,await _7(this.records),this.emit(),t.persistRemote&&!Vl()&&this.persistRemote(this.records))}async persistRemote(e){try{await y_.kv.set.mutate({key:c7(),value:e})}catch{}}emit(){for(let e of this.listeners)e(this.records)}},v7=`ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace`,zOe={fontSize:13,fontFamily:``,cursorBlink:!0,cursorStyle:`block`,scrollback:1e3,rendererEngine:`xterm`},y7=1500,b7=1e3,BOe=1e4,x7=`common`,VOe=512*1024,HOe=8,UOe=32,S7=13,WOe=800,GOe=[`JetBrains Mono`,`Fira Code`,`Source Code Pro`,`IBM Plex Mono`,`Inconsolata`,`Roboto Mono`,`Ubuntu Mono`,`Space Mono`],C7=new Set;function w7(e){try{return(new URL(e).pathname.split(`/`).pop()??``).replace(/\.[^.]+$/,``).replace(/[-_]/g,` `)||`CustomFont`}catch{return`CustomFont`}}async function KOe(e){let t=e.trim();if(!t)return``;if(!/^https?:\/\//i.test(t))return t;if(C7.has(t))return w7(t);try{let e=(await fetch(t,{method:`HEAD`})).headers.get(`content-type`)??``;if(e.includes(`text/css`)){let e=document.createElement(`link`);return e.rel=`stylesheet`,e.href=t,e.dataset.fontSrc=t,document.head.appendChild(e),C7.add(t),``}if(e.startsWith(`font/`)){let e=w7(t),n=document.createElement(`style`);return n.dataset.fontSrc=t,n.textContent=`@font-face { font-family: '${e}'; src: url('${t}'); }`,document.head.appendChild(n),C7.add(t),e}}catch{}return t}function qOe(e){let t=`google:${e}`;if(C7.has(t))return;let n=navigator.language??``,r=/^zh\b/i.test(n)?`https://fonts.googleapis.cn`:`https://fonts.googleapis.com`,i=document.createElement(`link`);i.rel=`stylesheet`,i.href=`${r}/css2?family=${e.replace(/ /g,`+`)}&display=swap`,i.dataset.fontSrc=t,document.head.appendChild(i),C7.add(t)}var JOe=class{instances=new Map;listeners=new Set;idCounter=0;config={...zOe};snapshotCache=null;inputHistoryStore=new ROe;ghosttyModule=null;ghosttyInitPromise=null;ws=null;wsConnected=!1;reconnectTimer=null;reconnectDelay=b7;pendingCreates=[];pendingCloseSessionIds=new Set;serverToLocalSessionId=new Map;hasDiscoveredSessions=!1;inputPanelDefaultLayout=`floating`;createSession(e){let t=`term-${++this.idCounter}`,n=e?.label??`Shell ${this.idCounter}`,r=this.createTerminalInstance(t,{label:n,command:e?.command,args:e?.args,isDedicated:e?.isDedicated??!1,closeTip:e?.closeTip,closeCallbackUrl:e?.closeCallbackUrl,restored:!1,serverSessionId:null,platform:x7});return this.instances.set(t,r),this._applyFonts(),this.bindTerminalInput(r),this.wsConnected&&this.ws?this.wsSend({type:`create`,requestId:t,cols:r.terminal.cols||80,rows:r.terminal.rows||24,command:e?.command,args:e?.args,closeTip:e?.closeTip,closeCallbackUrl:e?.closeCallbackUrl}):(this.pendingCreates.push({requestId:t,command:e?.command,args:e?.args,closeTip:e?.closeTip,closeCallbackUrl:e?.closeCallbackUrl,cols:r.terminal.cols||80,rows:r.terminal.rows||24}),this.ensureWsConnected()),this.notify(),t}createTerminalInstance(e,t){let{terminal:n,fitAddon:r,afterOpenHook:i,engine:a}=this.createRendererTerminal(),o=this.createInputPanelAddon(e,t.platform);return n.loadAddon(o),this.attachTerminalShortcuts(n,a),{id:e,serverSessionId:t.serverSessionId,terminal:n,fitAddon:r,inputPanelAddon:o,isConnected:!1,label:t.label,customTitle:null,processTitle:null,isDedicated:t.isDedicated,isExited:!1,exitCode:null,command:t.command,args:t.args,closeTip:t.closeTip,closeCallbackUrl:t.closeCallbackUrl,mountedContainer:null,resizeObserver:null,hasOpened:!1,afterOpenHook:i,pendingOutput:[],pendingOutputBytes:0,lastOutputTime:0,outputIdleTimer:null,restored:t.restored,platform:t.platform,rendererEngine:a}}getTerminalOptions(){return{cursorBlink:this.config.cursorBlink,cursorStyle:this.config.cursorStyle,fontSize:this.config.fontSize,fontFamily:v7,theme:{background:`transparent`},allowTransparency:!0,convertEol:!0,macOptionIsMeta:!0,macOptionClickForcesSelection:!0,scrollback:this.config.scrollback}}createRendererTerminal(){let e=this.getTerminalOptions();if(this.config.rendererEngine===`xterm`){let t=new zSe(e),n=new pbe;return t.loadAddon(n),t.loadAddon(new ybe),{terminal:t,fitAddon:n,afterOpenHook:null,engine:`xterm`}}let t=this.ghosttyModule;if(!t)throw Error(`ghostty-web is not initialized. Open Settings and switch engine again.`);let n=new t.Terminal(e),r=new t.FitAddon;return n.loadAddon(r),{terminal:n,fitAddon:r,afterOpenHook:()=>{let e=n;e.registerLinkProvider&&e.registerLinkProvider(new t.UrlRegexProvider(n))},engine:`ghostty`}}createInputPanelAddon(e,t){return new a7({onInput:t=>this.writeToSession(e,t),getHistory:async()=>this.inputHistoryStore.list(),addHistory:async e=>this.inputHistoryStore.add(e),subscribeHistory:e=>this.inputHistoryStore.subscribe(e),platform:t,defaultLayout:this.inputPanelDefaultLayout,showFab:!1,stateKey:e,onSettingsChange:async e=>{await this.inputHistoryStore.setLimit(e.historyLimit)}})}applyGhosttyBackground(e,t){if(e.rendererEngine!==`ghostty`)return;let n=this.resolveNearestOpaqueBackground(t),r=e.terminal.options.theme??{};e.terminal.options.allowTransparency=!1,e.terminal.options.theme={...r,background:n}}isTransparentColor(e){let t=e.trim().toLowerCase();return t.length===0||t===`transparent`||t===`rgba(0, 0, 0, 0)`||t===`rgba(0,0,0,0)`}resolveNearestOpaqueBackground(e){let t=e;for(;t;){let e=window.getComputedStyle(t).backgroundColor;if(!this.isTransparentColor(e))return e;t=t.parentElement}return`rgb(26, 26, 26)`}attachTerminalShortcuts(e,t){e.attachCustomKeyEventHandler(e=>{let n=e.metaKey||e.ctrlKey;if(e.type!==`keydown`||!n)return t===`xterm`;let r=!1;return(e.key===`=`||e.key===`+`)&&n&&(this.zoomFont(1),r=!0),e.key===`-`&&n&&!r&&(this.zoomFont(-1),r=!0),e.key===`0`&&n&&!r&&(this.resetFontSize(),r=!0),t===`xterm`?!r:r})}bindTerminalInput(e){e.terminal.onData(t=>{if(e.isExited){this.closeSession(e.id);return}let n=this.resolveServerSessionId(e.id);n&&this.wsSend({type:`input`,sessionId:n,data:t})})}isTerminalNotOpenedError(e){if(!(e instanceof Error))return!1;let t=e.message;return t.includes(`Terminal must be opened before use`)||t.includes(`Call terminal.open(parent) first`)}enqueuePendingOutput(e,t){if(t)for(e.pendingOutput.push(t),e.pendingOutputBytes+=t.length;e.pendingOutputBytes>VOe&&e.pendingOutput.length;){let t=e.pendingOutput.shift();if(!t)break;e.pendingOutputBytes-=t.length}}writeTerminalOutput(e,t){if(t){if(!e.hasOpened){this.enqueuePendingOutput(e,t);return}try{e.terminal.write(t)}catch(n){if(this.isTerminalNotOpenedError(n)){this.enqueuePendingOutput(e,t);return}console.error(`[terminal] failed to write output:`,n)}}}flushPendingOutput(e){if(!e.hasOpened||e.pendingOutput.length===0)return;let t=e.pendingOutput.join(``);e.pendingOutput=[],e.pendingOutputBytes=0,this.writeTerminalOutput(e,t)}replaceInstanceRenderer(e){let t=e.mountedContainer,n=e.serverSessionId;e.mountedContainer&&this.unmount(e.id),e.terminal.dispose();let{terminal:r,fitAddon:i,afterOpenHook:a,engine:o}=this.createRendererTerminal(),s=this.createInputPanelAddon(e.id,e.platform);r.loadAddon(s),this.attachTerminalShortcuts(r,o),e.terminal=r,e.fitAddon=i,e.inputPanelAddon=s,e.hasOpened=!1,e.afterOpenHook=a,e.mountedContainer=null,e.resizeObserver=null,e.rendererEngine=o,this.bindTerminalInput(e),t&&this.mount(e.id,t),n&&this.wsSend({type:`attach`,sessionId:n,cols:e.terminal.cols||80,rows:e.terminal.rows||24})}async ensureGhosttyModule(){return this.ghosttyModule?this.ghosttyModule:(this.ghosttyInitPromise||=q(()=>import(`./ghostty-web-BVO2n--o.js`).then(async e=>(await e.init(),this.ghosttyModule=e,e)),[]).finally(()=>{this.ghosttyInitPromise=null}),this.ghosttyInitPromise)}async setRendererEngine(e){if(e!==this.config.rendererEngine){e===`ghostty`&&await this.ensureGhosttyModule(),this.config.rendererEngine=e;for(let e of this.instances.values())this.replaceInstanceRenderer(e);this._applyFonts(),this.notify()}}closeSession(e,t){let n=this.instances.get(e);if(!n)return;let r=t?.triggerCloseCallback!==!1;if(n.mountedContainer&&this.unmount(e),n.outputIdleTimer&&=(clearTimeout(n.outputIdleTimer),null),this.pendingCreates=this.pendingCreates.filter(t=>t.requestId!==e),n.serverSessionId){let e=n.serverSessionId;this.serverToLocalSessionId.delete(e),this.wsConnected&&this.ws?.readyState===WebSocket.OPEN?this.wsSend({type:`close`,sessionId:e}):this.pendingCloseSessionIds.add(e)}n.terminal.dispose(),r&&this.runCloseCallback(n),this.instances.delete(e),this.notify()}closeAll(){for(let e of this.instances.keys())this.closeSession(e,{triggerCloseCallback:!1})}mount(e,t){let n=this.instances.get(e);if(!n)return;if(n.mountedContainer===t){requestAnimationFrame(()=>{try{n.fitAddon.fit()}catch{}});return}if(n.mountedContainer&&this.unmount(e),!n.hasOpened)this.applyGhosttyBackground(n,t),n.terminal.open(t),n.hasOpened=!0,n.afterOpenHook?.(),n.afterOpenHook=null,this.flushPendingOutput(n),n.inputPanelAddon.attachListeners();else{let e=n.terminal.element;e&&!e.contains(t)&&e.parentNode!==t&&t.appendChild(e),this.flushPendingOutput(n),this.applyGhosttyBackground(n,t)}n.mountedContainer=t,requestAnimationFrame(()=>{try{n.fitAddon.fit()}catch{}});let r=new ResizeObserver(()=>{try{if(n.fitAddon.fit(),n.terminal.cols&&n.terminal.rows){let t=this.resolveServerSessionId(e);if(!t)return;this.wsSend({type:`resize`,sessionId:t,cols:n.terminal.cols,rows:n.terminal.rows})}}catch{}});r.observe(t),n.resizeObserver=r,requestAnimationFrame(()=>{this.focusSession(e)})}unmount(e){let t=this.instances.get(e);!t||!t.mountedContainer||(t.resizeObserver&&=(t.resizeObserver.disconnect(),null),t.mountedContainer=null)}focusSession(e){let t=this.instances.get(e);if(!t||!t.hasOpened)return;let n=!1;try{t.terminal.focus?.(),n=!0}catch{}if(!n){let e=t.terminal.element;if(e instanceof HTMLElement)try{e.focus()}catch{}}t.inputPanelAddon.syncFocusLifecycle()}setCustomTitle(e,t){let n=this.instances.get(e);n&&(n.customTitle=t,this.notify())}getDisplayTitle(e){let t=this.instances.get(e);return t?t.customTitle??t.processTitle??t.label:``}getConfig(){return{...this.config}}applyConfig(e){let{rendererEngine:t,...n}=e;Object.assign(this.config,n);for(let e of this.instances.values()){let t=e.terminal;t.options.fontSize=this.config.fontSize,t.options.cursorBlink=this.config.cursorBlink,t.options.cursorStyle=this.config.cursorStyle,t.options.scrollback=this.config.scrollback}this._applyFonts(),t&&t!==this.config.rendererEngine&&this.setRendererEngine(t).catch(e=>{console.error(`[terminal] failed to switch renderer engine:`,e)}),this.notify()}async _applyFonts(){let e=this.config.fontFamily;if(!e){this._setFontFamily(v7);return}let t=e.split(/[,]+/).map(e=>e.trim()).filter(Boolean),n=[];for(let e of t)if(GOe.includes(e))qOe(e),n.push(e);else{let t=await KOe(e);t&&n.push(t)}n.push(v7),this._setFontFamily(n.join(`, `))}_setFontFamily(e){for(let t of this.instances.values())if(t.terminal.options.fontFamily=e,t.mountedContainer)try{t.fitAddon.fit()}catch{}}configPersistTimer=null;persistFontSize(){this.configPersistTimer&&clearTimeout(this.configPersistTimer),this.configPersistTimer=setTimeout(()=>{this.configPersistTimer=null,q(async()=>{let{trpcClient:e}=await import(`./trpc-Uk6u7BJ8.js`);return{trpcClient:e}},[]).then(({trpcClient:e})=>{e.config.update.mutate({terminal:{fontSize:this.config.fontSize}})}).catch(()=>{})},WOe)}zoomFont(e){let t=Math.min(UOe,Math.max(HOe,this.config.fontSize+e));t!==this.config.fontSize&&(this.applyConfig({fontSize:t}),this.persistFontSize())}resetFontSize(){this.config.fontSize!==S7&&(this.applyConfig({fontSize:S7}),this.persistFontSize())}writeToSession(e,t){let n=this.resolveServerSessionId(e);return n?this.wsSend({type:`input`,sessionId:n,data:t}):!1}openInputPanel(e){let t=[e?this.instances.get(e):void 0,...this.instances.values()],n=t.find(e=>e&&e.mountedContainer)?.id??t.find(e=>e)?.id;if(!n)return!1;this.focusSession(n);let r=this.instances.get(n);return r?(r.inputPanelAddon.open(),!0):!1}async addInputHistory(e){await this.inputHistoryStore.add(e)}resolveServerSessionId(e){let t=this.instances.get(e);return t?t.serverSessionId:null}getInstanceByServerSessionId(e){let t=this.serverToLocalSessionId.get(e)??e;return this.instances.get(t)}getLocalSessionIdByServerSessionId(e){return this.serverToLocalSessionId.get(e)??e}handleCreatedResponse(e){let t=this.instances.get(e.requestId);if(!t){this.wsSend({type:`close`,sessionId:e.sessionId});return}t.serverSessionId=e.sessionId,t.platform=e.platform,t.inputPanelAddon.setPlatform(e.platform),t.isConnected=!0,this.serverToLocalSessionId.set(e.sessionId,e.requestId),this.notify()}handleOutputResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);t&&(this.writeTerminalOutput(t,e.data),t.lastOutputTime=Date.now(),this.notify(),t.outputIdleTimer&&clearTimeout(t.outputIdleTimer),t.outputIdleTimer=setTimeout(()=>{t.outputIdleTimer=null,this.notify()},y7))}handleExitResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);if(t){if(t.isExited=!0,t.exitCode=e.exitCode,t.closeTip||t.isDedicated){let n=t.closeTip??`Press any key to close (equivalent to close action).`;this.writeTerminalOutput(t,`\r\n\x1b[90m[Process exited with code ${e.exitCode}. ${n}]\x1b[0m`)}this.notify()}}handleTitleResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);t&&(t.processTitle=e.title,this.notify())}handleBufferResponse(e){let t=this.getInstanceByServerSessionId(e.sessionId);!t||!e.data||this.writeTerminalOutput(t,e.data)}handleErrorResponse(e){if(e.code===`PTY_CREATE_FAILED`&&e.sessionId){let t=this.instances.get(e.sessionId);t&&!t.serverSessionId&&(t.isExited=!0,t.exitCode=-1,this.writeTerminalOutput(t,`\r\n\x1b[31m[Failed to start PTY: ${e.message}]\x1b[0m`),this.notify())}console.warn(`[pty] ${e.code}: ${e.message}`,e)}setInputPanelMountTarget(e){a7.mountTarget=e}setInputPanelDefaultLayout(e){this.inputPanelDefaultLayout=e;for(let t of this.instances.values())t.inputPanelAddon.setDefaultLayout(e)}getTerminalDimensions(e){let t=this.instances.get(e);return t?{cols:t.terminal.cols||80,rows:t.terminal.rows||24}:null}subscribe(e){return this.listeners.add(e),this.ensureWsConnected(),()=>{this.listeners.delete(e)}}getSnapshot(){if(this.snapshotCache)return this.snapshotCache;let e=[];for(let t of this.instances.values())e.push({id:t.id,label:t.label,customTitle:t.customTitle,processTitle:t.processTitle,displayTitle:t.customTitle??t.processTitle??t.label,isDedicated:t.isDedicated,isExited:t.isExited,exitCode:t.exitCode,outputActive:t.lastOutputTime>0&&Date.now()-t.lastOutputTime<y7,command:t.command,args:t.args,closeTip:t.closeTip,closeCallbackUrl:t.closeCallbackUrl,platform:t.platform});return this.snapshotCache={sessions:e},this.snapshotCache}notify(){this.snapshotCache=null;for(let e of this.listeners)e()}ensureWsConnected(){this.ws&&(this.ws.readyState===WebSocket.CONNECTING||this.ws.readyState===WebSocket.OPEN)||this.connectSharedWebSocket()}connectSharedWebSocket(){this.reconnectTimer&&=(clearTimeout(this.reconnectTimer),null);let e=new WebSocket(Ll());this.ws=e,e.onopen=()=>{this.wsConnected=!0,this.reconnectDelay=b7;for(let e of this.pendingCloseSessionIds)this.wsSend({type:`close`,sessionId:e});this.pendingCloseSessionIds.clear(),this.wsSend({type:`list`});for(let e of this.pendingCreates)this.wsSend({type:`create`,requestId:e.requestId,cols:e.cols,rows:e.rows,command:e.command,args:e.args,closeTip:e.closeTip,closeCallbackUrl:e.closeCallbackUrl});this.pendingCreates=[];for(let e of this.instances.values())if(!e.restored)continue;this.notify()},e.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch{return}let n=lbe.safeParse(t);n.success&&this.handleServerMessage(n.data)},e.onclose=()=>{this.wsConnected=!1,this.ws=null,this.notify(),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,(this.listeners.size>0||this.instances.size>0)&&this.connectSharedWebSocket()},this.reconnectDelay),this.reconnectDelay=Math.min(this.reconnectDelay*1.5,BOe)},e.onerror=()=>{}}handleServerMessage(e){switch(e.type){case`list`:this.handleListResponse(e);break;case`created`:this.handleCreatedResponse(e);break;case`buffer`:this.handleBufferResponse(e);break;case`output`:this.handleOutputResponse(e);break;case`exit`:this.handleExitResponse(e);break;case`title`:this.handleTitleResponse(e);break;case`error`:this.handleErrorResponse(e);break}}handleListResponse(e){let t=new Set(e.sessions.map(e=>e.id));for(let t of e.sessions){let e=this.getLocalSessionIdByServerSessionId(t.id),n=this.instances.get(e);if(n)n.serverSessionId||=t.id;else{let e=t.title||`${t.command} ${t.args.join(` `)}`.trim();n=this.createTerminalInstance(t.id,{label:e.length>40?`${e.slice(0,37)}...`:e,command:t.command,args:t.args,isDedicated:!1,closeTip:t.closeTip,closeCallbackUrl:t.closeCallbackUrl,restored:!0,serverSessionId:t.id,platform:t.platform??x7}),t.isExited&&(n.isExited=!0,n.exitCode=t.exitCode),this.bindTerminalInput(n),this.instances.set(n.id,n),this._applyFonts()}n.closeTip=t.closeTip,n.closeCallbackUrl=t.closeCallbackUrl,n.platform=t.platform??x7,n.inputPanelAddon.setPlatform(n.platform),this.serverToLocalSessionId.set(t.id,n.id),this.wsSend({type:`attach`,sessionId:t.id,cols:n.terminal.cols||80,rows:n.terminal.rows||24})}for(let e of this.instances.values())e.restored&&e.serverSessionId&&!t.has(e.serverSessionId)&&!e.isExited&&(e.isExited=!0,e.exitCode=-1);this.hasDiscoveredSessions=!0,this.notify()}get discoveredSessions(){return this.hasDiscoveredSessions}runCloseCallback(e){if(!e.isExited)return;let t=YOe(e.closeCallbackUrl,e.exitCode);t&&XOe(t)}wsSend(e){return this.ws?.readyState===WebSocket.OPEN?(this.ws.send(JSON.stringify(e)),!0):!1}};function YOe(e,t){if(!e)return null;if(typeof e==`string`){let t=e.trim();return t.length>0?t:null}let n=e[t==null?`null`:String(t)];if(typeof n==`string`&&n.trim().length>0)return n.trim();let r=e[`*`];return typeof r==`string`&&r.trim().length>0?r.trim():null}function XOe(e){let t;try{t=new URL(e,window.location.origin)}catch{return}if(t.origin===window.location.origin){let e=`${t.pathname}${t.search}${t.hash}`,n=Pu.getAreaForPath(t.pathname);Pu.push(n,e,null);return}window.open(t.toString(),`_blank`,`noopener,noreferrer`)}new JOe;var ZOe=(0,G.createContext)(null);function QOe(){let e=(0,G.useContext)(ZOe);if(!e)throw Error(`useTerminalContext must be used within a TerminalProvider`);return e}function T7(){return typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2)}function E7(e,t){return`${e}${t.length>0?` ${t.join(` `)}`:``}`}function $Oe(e){return e.some(e=>e.status===`loading`||e.status===`running`)?`running`:e.some(e=>e.status===`error`)?`error`:e.length>0&&e.every(e=>e.status===`success`)?`success`:`idle`}function eke(e={}){let[t,n]=(0,G.useState)([]),[r,i]=(0,G.useState)([]),[a,o]=(0,G.useState)(null),s=(0,G.useRef)(null),c=(0,G.useRef)(null),l=(0,G.useRef)([]),u=(0,G.useRef)(e);(0,G.useEffect)(()=>{u.current=e},[e]);let d=(0,G.useCallback)(e=>{let t=e(l.current);l.current=t,n(t)},[]);(0,G.useEffect)(()=>{l.current=t},[t]);let f=(0,G.useCallback)(()=>{s.current?.unsubscribe?.(),s.current=null,c.current=null,l.current=[],n([]),i([]),o(null)},[]),p=(0,G.useCallback)(()=>{s.current?.unsubscribe?.(),s.current=null;let e=c.current;e&&(d(t=>t.map(t=>t.id===e?{...t,status:`error`,exitCode:null}:t)),i(t=>[...t,{id:T7(),commandId:e,kind:`meta`,text:`Process cancelled by user`,tone:`error`}])),c.current=null},[d]),m=(0,G.useCallback)((e,t=[],n=-1)=>{let r=T7();return d(i=>{let a=[...i],o={id:r,command:e,args:t,status:`idle`,exitCode:null};return n>=0&&n<a.length?a.splice(n,0,o):a.push(o),a}),r},[]),h=(0,G.useCallback)(e=>{d(t=>t.filter(t=>t.id!==e)),i(t=>t.filter(t=>t.commandId!==e)),c.current===e&&p()},[p,d]),g=(0,G.useCallback)(e=>{s.current?.unsubscribe?.(),s.current=null,c.current=null,i([]),o(null),d(()=>e.map(e=>({id:T7(),command:e.command,args:e.args??[],status:`idle`,exitCode:null})))},[d]),_=(0,G.useCallback)(()=>[...l.current],[]),v=(0,G.useCallback)(e=>{i(t=>[...t,e])},[]),y=(0,G.useCallback)(async e=>{if(Vl())return console.warn(`CLI runner is disabled in static mode`),null;let t=e??l.current.find(e=>e.status===`idle`)?.id,n=l.current.find(e=>e.id===t);if(!n)return null;s.current?.unsubscribe?.(),c.current=n.id,d(e=>e.map(e=>e.id===n.id?{...e,status:`loading`,exitCode:null}:e));let r=()=>{},i=new Promise(e=>{r=e}),a={data:new Set,error:new Set,close:new Set,exit:new Set},f=(e,t)=>{a[e].forEach(e=>e(t))},m={id:n.id,command:n.command,args:n.args,status:`loading`,exitCode:null,done:i,on:(e,t)=>(a[e].add(t),()=>a[e].delete(t)),cancel:()=>{p()}};u.current.onCreateProcess?.(m);let h=y_.cli.runCommandStream.subscribe({command:n.command,args:n.args},{onData:e=>{if(e.type===`command`){d(e=>e.map(e=>e.id===n.id?{...e,status:`running`}:e)),m.status=`running`,f(`data`,e.data??``);return}if(e.type===`stdout`&&e.data){v({id:T7(),commandId:n.id,kind:`stdout`,text:e.data}),f(`data`,e.data);return}if(e.type===`stderr`&&e.data){v({id:T7(),commandId:n.id,kind:`stderr`,text:e.data,tone:`error`}),f(`error`,e.data);return}if(e.type===`exit`){let t=e.exitCode??null;o(t);let i=t===0?`success`:`error`;d(e=>e.map(e=>e.id===n.id?{...e,status:i,exitCode:t}:e)),m.status=i,m.exitCode=t,v({id:T7(),commandId:n.id,kind:`meta`,text:`Process exited with code ${t??`unknown`}`,tone:t===0?`success`:`error`}),f(`close`,t),f(`exit`,t),r(t),s.current?.unsubscribe?.(),s.current=null,c.current=null}},onError:e=>{let t=e instanceof Error?e.message:String(e);d(e=>e.map(e=>e.id===n.id?{...e,status:`error`,exitCode:null}:e)),m.status=`error`,v({id:T7(),commandId:n.id,kind:`meta`,text:`Error: ${t}`,tone:`error`}),f(`error`,t),r(null),s.current?.unsubscribe?.(),s.current=null,c.current=null}});return m.status=`running`,s.current=h,m},[v,p,d]),b=(0,G.useCallback)(async()=>{let e=l.current.find(e=>e.status===`idle`);for(;e;){let t=await y(e.id);if(!t||await t.done!==0)break;e=l.current.find(e=>e.status===`idle`)}},[y]);return(0,G.useEffect)(()=>()=>{p()},[p]),{lines:(0,G.useMemo)(()=>t.flatMap(e=>{let t=e.status===`loading`?(0,K.jsx)(Qc,{className:`h-3 w-3 animate-spin text-sky-300`}):e.status===`running`?(0,K.jsxs)(`div`,{className:`flex items-center gap-1 text-amber-200`,children:[(0,K.jsx)(hl,{className:`h-3 w-3 animate-pulse`}),(0,K.jsx)(Qc,{className:`h-3 w-3 animate-spin`})]}):e.status===`success`?(0,K.jsx)(bc,{className:`h-3 w-3 text-green-400`}):e.status===`error`?(0,K.jsx)(Ec,{className:`h-3 w-3 text-red-400`}):null,n=e.status===`idle`?`# ${E7(e.command,e.args)}`:`$ ${E7(e.command,e.args)}`,i=[{id:`cmd-${e.id}`,kind:`html`,node:(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:e.status===`running`?`terminal-shimmer`:e.status===`loading`?`animate-pulse text-blue-200`:e.status===`success`?`text-green-300`:e.status===`error`?`text-red-300`:`text-zinc-200`,children:n}),t]})}],a=r.filter(t=>t.commandId===e.id).map(e=>({id:e.id,kind:`ascii`,text:e.text,tone:e.tone}));return[...i,...a]}),[t,r]),status:(0,G.useMemo)(()=>$Oe(t),[t]),exitCode:a,hasStarted:(0,G.useMemo)(()=>t.some(e=>e.status!==`idle`),[t]),commands:(0,G.useMemo)(()=>({add:m,remove:h,list:_,replaceAll:g,run:y,runAll:b}),[m,_,h,g,y,b]),reset:f,cancel:p}}var tke=`schema: spec-driven
1399
1399
 
1400
1400
  context: |
1401
1401
 
@@ -1416,7 +1416,7 @@ rules:
1416
1416
  ${e.right}px ${e.top}px,
1417
1417
  ${e.left}px ${e.top}px
1418
1418
  )`}return(0,K.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function w9(e,t){e&&Object.assign(e.style,t)}var T9={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},SAe={position:`fixed`},CAe=G.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=iS,..._}=e,{store:v,listRef:y,labelsRef:b,alignItemWithTriggerActiveRef:x,selectedItemTextRef:S,valuesRef:C,initialValueRef:w,popupRef:T,setValue:E}=Q7(),D=$7(),O=Hw(v,d9.open),k=Hw(v,d9.mounted),A=Hw(v,d9.modal),j=Hw(v,d9.value),M=Hw(v,d9.openMethod),N=Hw(v,d9.positionerElement),P=Hw(v,d9.triggerElement),F=Hw(v,d9.isItemEqualToValue),I=Hw(v,d9.transitionStatus),ee=G.useRef(null),L=G.useRef(null),[R,z]=G.useState(h),te=k&&R&&M!==`touch`;!k&&R!==h&&z(h),fy(()=>{k||(d9.scrollUpArrowVisible(v.state)&&v.set(`scrollUpArrowVisible`,!1),d9.scrollDownArrowVisible(v.state)&&v.set(`scrollDownArrowVisible`,!1))},[v,k]),G.useImperativeHandle(x,()=>te),hAe((te||A)&&O&&M!==`touch`,P);let B=CT({anchor:n,floatingRootContext:D,positionMethod:r,mounted:k,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??te,collisionAvoidance:g,keepMounted:!0}),ne=te?`none`:B.side,re=te?SAe:B.positionerStyles,V=G.useMemo(()=>{let e={};return O||(e.pointerEvents=`none`),{role:`presentation`,hidden:!k,style:{...re,...e}}},[O,k,re]),H={open:O,side:ne,align:B.align,anchorHidden:B.anchorHidden},ie=kC(`div`,e,{ref:[t,NS(e=>{v.set(`positionerElement`,e)})],state:H,stateAttributesMapping:gT,props:[V,TT(I),_]}),ae=G.useRef(0),oe=NS(e=>{if(e.size===0&&ae.current===0||C.current.length===0)return;let t=ae.current;if(ae.current=e.size,e.size===t)return;let n=bS(sS);if(t!==0&&!v.state.multiple&&j!==null&&o9(C.current,j,F)===-1){let e=w.current,t=e!=null&&o9(C.current,e,F)!==-1?e:null;E(t,n),t===null&&(v.set(`selectedIndex`,null),S.current=null)}if(t!==0&&v.state.multiple&&Array.isArray(j)){let e=e=>o9(C.current,e,F)!==-1,t=j.filter(t=>e(t));(t.length!==j.length||t.some(e=>!zke(j,e,F)))&&(E(t,n),t.length===0&&(v.set(`selectedIndex`,null),S.current=null))}if(O&&te){v.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};w9(N,e),w9(T.current,e)}}),se=G.useMemo(()=>({...B,side:ne,alignItemWithTriggerActive:te,setControlledAlignItemWithTrigger:z,scrollUpArrowRef:ee,scrollDownArrowRef:L}),[B,ne,te,z]);return(0,K.jsx)(_Ae,{elementsRef:y,labelsRef:b,onMapChange:oe,children:(0,K.jsxs)(S9.Provider,{value:se,children:[k&&A&&(0,K.jsx)(xAe,{inert:yae(!O),cutout:P}),ie]})})});function E9(e){let t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}var D9=`base-ui-disable-scrollbar`,O9={className:D9,getElement(e){return(0,K.jsx)(`style`,{nonce:e,href:D9,precedence:`base-ui:low`,children:`.${D9}{scrollbar-width:none}.${D9}::-webkit-scrollbar{display:none}`})}},wAe=G.createContext(void 0);function TAe(e){let t=G.useContext(wAe);if(t===void 0&&!e)throw Error(py(69));return t}var k9=`ArrowUp`,A9=`ArrowDown`,j9=`ArrowLeft`,M9=`ArrowRight`,N9=`Home`,EAe=new Set([j9,M9]),DAe=new Set([k9,A9]),OAe=new Set([...EAe,...DAe]);new Set([...OAe,N9,`End`]);var kAe=new Set([k9,A9,j9,M9,N9,`End`]);function P9(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}var AAe=G.createContext(void 0),jAe={disableStyleElements:!1};function MAe(){return G.useContext(AAe)??jAe}var F9=1,NAe={...gT,...Jw},PAe=G.forwardRef(function(e,t){let{render:n,className:r,finalFocus:i,...a}=e,{store:o,popupRef:s,onOpenChangeComplete:c,setOpen:l,valueRef:u,selectedItemTextRef:d,keyboardActiveRef:f,multiple:p,handleScrollArrowVisibility:m,scrollHandlerRef:h,highlightItemOnHover:g}=Q7(),{side:_,align:v,alignItemWithTriggerActive:y,setControlledAlignItemWithTrigger:b,scrollDownArrowRef:x,scrollUpArrowRef:S}=C9(),C=TAe(!0)!=null,w=$7(),{nonce:T,disableStyleElements:E}=MAe(),D=yy(),O=Hw(o,d9.id),k=Hw(o,d9.open),A=Hw(o,d9.mounted),j=Hw(o,d9.popupProps),M=Hw(o,d9.transitionStatus),N=Hw(o,d9.triggerElement),P=Hw(o,d9.positionerElement),F=Hw(o,d9.listElement),I=G.useRef(0),ee=G.useRef(!1),L=G.useRef(0),R=G.useRef(!1),z=G.useRef({}),te=zS(),B=NS(e=>{if(!P||!s.current||!R.current)return;if(ee.current||!y){m();return}let t=P.style.top===`0px`,n=P.style.bottom===`0px`,r=P.getBoundingClientRect().height,i=Hx(P),a=getComputedStyle(P),o=parseFloat(a.marginTop),c=parseFloat(a.marginBottom),l=I9(getComputedStyle(s.current)),u=Math.min(i.documentElement.clientHeight-o-c,l),d=e.scrollTop,f=L9(e),p=0,h=null,g=!1,_=!1,v=e=>{P.style.height=`${e}px`},b=(t,n)=>{let i=P9(t,0,u-r);i>0&&v(r+i),e.scrollTop=n,u-(r+i)<=F9&&(ee.current=!0),m()};if(t){let e=f-d,t=r+e,n=Math.min(t,u);if(p=n,e<=F9){b(e,f);return}u-n>F9?_=!0:g=!0}else if(n){let e=d,t=r+e,n=Math.min(t,u),i=t-u;if(p=n,e<=F9){b(e,0);return}u-n>F9?h=0:(g=!0,d<f&&(h=d-(e-i)))}if(p=Math.ceil(p),p!==0&&v(p),_||h!=null){let t=L9(e),n=_?t:P9(h,0,t);Math.abs(e.scrollTop-n)>F9&&(e.scrollTop=n)}(g||p>=u-F9)&&(ee.current=!0),m()});G.useImperativeHandle(h,()=>B,[B]),Yw({open:k,ref:s,onComplete(){k&&c?.(!0)}});let ne={open:k,transitionStatus:M,side:_,align:v};fy(()=>{!P||!s.current||Object.keys(z.current).length||(z.current={top:P.style.top||`0`,left:P.style.left||`0`,right:P.style.right,height:P.style.height,bottom:P.style.bottom,minHeight:P.style.minHeight,maxHeight:P.style.maxHeight,marginTop:P.style.marginTop,marginBottom:P.style.marginBottom})},[s,P]),fy(()=>{k||y||(R.current=!1,ee.current=!1,I.current=0,L.current=0,w9(P,z.current))},[k,y,P,s]),fy(()=>{let e=s.current;if(!(!k||!N||!P||!e||o.state.transitionStatus===`ending`)){if(!y){R.current=!0,te.request(m),e.style.removeProperty(`--transform-origin`);return}queueMicrotask(()=>{let t=IAe(e);e.style.removeProperty(`--transform-origin`);try{let t=getComputedStyle(P),n=getComputedStyle(e),r=Hx(N),i=Sy(P),a=FAe(N),o=R9(N.getBoundingClientRect(),a),s=R9(P.getBoundingClientRect(),a),c=o.left,l=o.height,f=F||e,p=f.scrollHeight,h=parseFloat(n.borderBottomWidth),g=parseFloat(t.marginTop)||10,_=parseFloat(t.marginBottom)||10,v=parseFloat(t.minHeight)||100,y=I9(n),x=r.documentElement.clientHeight-g-_,S=r.documentElement.clientWidth,C=x-o.bottom+l,w=d.current,T=u.current,E,D=0,O=0;if(w&&T){let e=R9(T.getBoundingClientRect(),a);E=R9(w.getBoundingClientRect(),a);let t=e.left-c,n=E.left-s.left,r=e.top-o.top+e.height/2,i=E.top-s.top+E.height/2;D=t-n,O=i-r}let k=C+O+_+h,A=Math.min(x,k),j=x-g-_,M=k-A,L=Math.max(5,c+D),te=S-5,B=Math.max(0,L+s.width-te);P.style.left=`${L-B}px`,P.style.height=`${A}px`,P.style.maxHeight=`auto`,P.style.marginTop=`${g}px`,P.style.marginBottom=`${_}px`,e.style.height=`100%`;let ne=L9(f),re=M>=ne-F9;re&&(A=Math.min(x,s.height)-(M-ne));let V=o.top<20||o.bottom>x-20||Math.ceil(A)+F9<Math.min(p,v),H=(i.visualViewport?.scale??1)!==1&&Jy;if(V||H){R.current=!0,w9(P,z.current),Ts.flushSync(()=>b(!1));return}if(re){let e=Math.max(0,x-k);P.style.top=s.height>=j?`0`:`${e}px`,P.style.height=`${A}px`,f.scrollTop=L9(f),I.current=Math.max(v,A)}else P.style.bottom=`0`,I.current=Math.max(v,A),f.scrollTop=M;if(E){let t=s.top,n=s.height,r=E.top+E.height/2,i=P9(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(`--transform-origin`,`50% ${i}%`)}(I.current===x||A>=y)&&(ee.current=!0),m(),setTimeout(()=>{R.current=!0})}finally{t()}})}},[o,k,P,N,u,d,s,m,y,b,te,x,S,F]),G.useEffect(()=>{if(!y||!P||!k)return;let e=Sy(P);function t(e){l(!1,bS(yS,e))}return e.addEventListener(`resize`,t),()=>{e.removeEventListener(`resize`,t)}},[l,y,P,k]);let re={...F?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":p||void 0,id:`${O}-list`},onKeyDown(e){f.current=!0,C&&kAe.has(e.key)&&e.stopPropagation()},onMouseMove(){f.current=!1},onPointerLeave(e){if(!g||E9(e)||e.pointerType===`touch`)return;let t=e.currentTarget;D.start(0,()=>{o.set(`activeIndex`,null),t.focus({preventScroll:!0})})},onScroll(e){F||B(e.currentTarget)},...y&&{style:F?{height:`100%`}:T9}},V=kC(`div`,e,{ref:[t,s],state:ne,stateAttributesMapping:NAe,props:[j,re,TT(M),{className:!F&&y?O9.className:void 0},a]});return(0,K.jsxs)(G.Fragment,{children:[!E&&O9.getElement(T),(0,K.jsx)(ew,{context:w,modal:!1,disabled:!A,returnFocus:i,restoreFocus:!0,children:V})]})});function I9(e){let t=e.maxHeight||``;return t.endsWith(`px`)&&parseFloat(t)||1/0}function L9(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function FAe(e){return Ew.getScale(e)}function R9(e,t){return ex({x:e.x/t.x,y:e.y/t.y,width:e.width/t.x,height:e.height/t.y})}var z9=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function IAe(e){let{style:t}=e,n={};for(let[e,r]of z9)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of z9){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var LAe=G.forwardRef(function(e,t){let{className:n,render:r,...i}=e,{store:a,scrollHandlerRef:o}=Q7(),{alignItemWithTriggerActive:s}=C9(),c=Hw(a,d9.hasScrollArrows),l=Hw(a,d9.openMethod),u=Hw(a,d9.multiple),d={id:`${Hw(a,d9.id)}-list`,role:`listbox`,"aria-multiselectable":u||void 0,onScroll(e){o.current?.(e.currentTarget)},...s&&{style:T9},className:c&&l!==`touch`?O9.className:void 0};return kC(`div`,e,{ref:[t,NS(e=>{a.set(`listElement`,e)})],props:[d,i]})}),B9=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function RAe(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=gAe(),f=G.useRef(-1),[p,m]=G.useState(a??(i===B9.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),h=G.useRef(null),g=G.useCallback(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){let n=t!==void 0;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,l,u,t,r]);return fy(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),fy(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&m(t)})},[a,c,m]),G.useMemo(()=>({ref:g,index:p}),[p,g])}var V9=G.createContext(void 0);function H9(){let e=G.useContext(V9);if(!e)throw Error(py(57));return e}var zAe=G.memo(G.forwardRef(function(e,t){let{render:n,className:r,value:i=null,label:a,disabled:o=!1,nativeButton:s=!1,...c}=e,l=G.useRef(null),u=RAe({label:a,textRef:l,indexGuessBehavior:B9.GuessFromOrder}),{store:d,getItemProps:f,setOpen:p,setValue:m,selectionRef:h,typingRef:g,valuesRef:_,keyboardActiveRef:v,multiple:y,highlightItemOnHover:b}=Q7(),x=yy(),S=Hw(d,d9.isActive,u.index),C=Hw(d,d9.isSelected,u.index,i),w=Hw(d,d9.isSelectedByFocus,u.index),T=Hw(d,d9.isItemEqualToValue),E=u.index,D=E!==-1,O=G.useRef(null),k=kS(E);fy(()=>{if(!D)return;let e=_.current;return e[E]=i,()=>{delete e[E]}},[D,E,i,_]),fy(()=>{if(!D)return;let e=d.state.value,t=e;y&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),t!==void 0&&a9(i,t,T)&&d.set(`selectedIndex`,E)},[D,E,y,T,d,i]);let A={disabled:o,selected:C,highlighted:S},j=f({active:S,selected:C});j.onFocus=void 0,j.id=void 0;let M=G.useRef(null),N=G.useRef(`mouse`),P=G.useRef(!1),{getButtonProps:F,buttonRef:I}=m9({disabled:o,focusableWhenDisabled:!0,native:s,composite:!0});function ee(e){let t=d.state.value;if(y){let n=Array.isArray(t)?t:[];m(C?Bke(n,i,T):[...n,i],bS(fS,e))}else m(i,bS(fS,e)),p(!1,bS(fS,e))}let L={role:`option`,"aria-selected":C,tabIndex:S?0:-1,onFocus(){d.set(`activeIndex`,E)},onMouseEnter(){!v.current&&d.state.selectedIndex===null&&b&&d.set(`activeIndex`,E)},onMouseMove(){b&&d.set(`activeIndex`,E)},onMouseLeave(e){!b||v.current||E9(e)||x.start(0,()=>{d.state.activeIndex===E&&d.set(`activeIndex`,null)})},onTouchStart(){h.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(e){M.current=e.key,d.set(`activeIndex`,E),e.key===` `&&g.current&&e.preventDefault()},onClick(e){P.current=!1,!(e.type===`keydown`&&M.current===null)&&(o||e.type===`keydown`&&M.current===` `&&g.current||N.current!==`touch`&&!S||(M.current=null,ee(e.nativeEvent)))},onPointerEnter(e){N.current=e.pointerType},onPointerDown(e){N.current=e.pointerType,P.current=!0},onMouseUp(){if(o)return;if(P.current){P.current=!1;return}let e=!h.current.allowSelectedMouseUp&&C,t=!h.current.allowUnselectedMouseUp&&!C;e||t||N.current!==`touch`&&!S||O.current?.click()}},R=kC(`div`,e,{ref:[I,t,u.ref,O],state:A,props:[j,L,c,F]}),z=G.useMemo(()=>({selected:C,indexRef:k,textRef:l,selectedByFocus:w,hasRegistered:D}),[C,k,l,w,D]);return(0,K.jsx)(V9.Provider,{value:z,children:R})})),BAe=G.forwardRef(function(e,t){let n=e.keepMounted??!1,{selected:r}=H9();return n||r?(0,K.jsx)(VAe,{...e,ref:t}):null}),VAe=G.memo(G.forwardRef((e,t)=>{let{render:n,className:r,keepMounted:i,...a}=e,{selected:o}=H9(),s=G.useRef(null),{transitionStatus:c,setMounted:l}=Kw(o),u=kC(`span`,e,{ref:[t,s],state:{selected:o,transitionStatus:c},props:[{"aria-hidden":!0,children:`✔️`},a],stateAttributesMapping:Jw});return Yw({open:o,ref:s,onComplete(){o||l(!1)}}),u})),HAe=G.memo(G.forwardRef(function(e,t){let{indexRef:n,textRef:r,selectedByFocus:i,hasRegistered:a}=H9(),{selectedItemTextRef:o}=Q7(),{className:s,render:c,...l}=e;return kC(`div`,e,{ref:[G.useCallback(e=>{if(!e||!a)return;let t=o.current===null||!o.current.isConnected;(i||t&&n.current===0)&&(o.current=e)},[o,n,i,a]),t,r],props:l})}));function UAe({value:e,options:t,onValueChange:n,ariaLabel:r,placeholder:i=`Select…`,renderTrigger:a,className:o,popupClassName:s,listClassName:c,itemClassName:l,positionerClassName:u,sideOffset:d=8,modal:f=!1}){let p=t.find(t=>t.value===e);return(0,K.jsxs)(Yke,{value:e,modal:f,onValueChange:e=>{e!==null&&n(e)},children:[(0,K.jsx)(iAe,{"aria-label":r,className:e=>ay(`text-foreground inline-flex min-w-0 items-center gap-1.5 text-xs outline-none transition-colors`,`focus-visible:ring-ring/60 focus-visible:ring-2`,e.open?`bg-muted/40`:``,o),children:a?a({selectedOption:p}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(oAe,{placeholder:i,className:`truncate`,children:()=>p?.label??i}),(0,K.jsx)(sAe,{className:`text-muted-foreground flex shrink-0`,children:(0,K.jsx)(xc,{className:`h-3.5 w-3.5`})})]})}),(0,K.jsx)(lAe,{children:(0,K.jsx)(CAe,{sideOffset:d,className:ay(`z-50 select-none outline-none`,u),children:(0,K.jsx)(PAe,{className:ay(`bg-card text-foreground border-border w-max min-w-28 rounded-md border p-1 shadow-lg`,`origin-(--transform-origin) transition-[transform,opacity] duration-150`,`data-[ending-style]:translate-y-0.5 data-[ending-style]:opacity-0`,`data-[starting-style]:translate-y-0.5 data-[starting-style]:opacity-0`,s),children:(0,K.jsx)(LAe,{className:ay(`max-h-64 overflow-y-auto py-0.5`,c),children:t.map(e=>(0,K.jsxs)(zAe,{value:e.value,disabled:e.disabled,label:typeof e.label==`string`?e.label:void 0,className:e=>ay(`grid cursor-default grid-cols-[0.8rem_minmax(0,1fr)] items-center gap-1.5 rounded-sm px-2 py-1.5 text-xs outline-none`,e.highlighted&&`bg-muted text-foreground`,e.selected&&`text-foreground`,e.disabled&&`opacity-50`,l),children:[(0,K.jsx)(BAe,{className:`text-primary flex h-3.5 w-3.5 items-center justify-center`,children:(0,K.jsx)(bc,{className:`h-3.5 w-3.5`})}),(0,K.jsx)(HAe,{className:`whitespace-nowrap`,children:e.label})]},e.value))})})})})]})}function WAe(e){return e.type===`commit`?{type:`commit`,hash:e.hash}:{type:`uncommitted`}}function GAe(e){return e.type===`commit`?`/git/commit/${e.hash}`:`/git/uncommitted`}function KAe(e){return GAe(WAe(e))}function qAe(){return T_((0,G.useCallback)(e=>y_.dashboard.subscribe.subscribe(void 0,{onData:e.onData,onError:e.onError}),[]),Km,[],`dashboard.subscribe`)}function JAe(){return{running:!1,inFlight:0,lastStartedAt:null,lastFinishedAt:null,lastReason:null,lastError:null}}function YAe(){return T_((0,G.useCallback)(e=>y_.dashboard.subscribeGitTaskStatus.subscribe(void 0,{onData:e.onData,onError:e.onError}),[]),async()=>JAe(),[],`dashboard.subscribeGitTaskStatus`)}async function XAe(e){Vl()||await y_.dashboard.refreshGitSnapshot.mutate({reason:e})}async function ZAe(e){Vl()||await y_.dashboard.removeDetachedWorktree.mutate({path:e})}var QAe=[`proposal`,`design`,`specs`,`tasks`],$Ae=[{value:`30s`,label:`30s`},{value:`5min`,label:`5min`},{value:`30min`,label:`30min`},{value:`none`,label:`none`}];function eje(e){return e===`manual-button`||e?.startsWith(`auto-refresh:`)===!0}function tje(e){return{specifications:{state:`ok`},requirements:{state:`ok`},activeChanges:{state:`invalid`,reason:`objective-history-unavailable`},inProgressChanges:{state:`invalid`,reason:`objective-history-unavailable`},completedChanges:{state:`ok`},taskCompletionPercent:{state:`invalid`,reason:e===null?`semantic-uncomputable`:`objective-history-unavailable`}}}function nje(){return{specifications:`monotonic`,requirements:`monotonic`,activeChanges:`bidirectional`,inProgressChanges:`bidirectional`,completedChanges:`monotonic`,taskCompletionPercent:`bidirectional`}}function rje(e){return e?e.split(/[-_]/g).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `):`Unknown`}function ije(e,t){if(e!==`spec-driven`)return t;let n=new Map;for(let[e,t]of QAe.entries())n.set(t,e);return[...t].sort((e,t)=>{let r=n.get(e),i=n.get(t);return r!==void 0&&i!==void 0?r-i:r===void 0?i===void 0?e.localeCompare(t):1:-1})}function aje(e,t,n){let r=new Map;for(let t of e){let e=t.schemaName||`unknown`,n=r.get(e);n?n.push(t):r.set(e,[t])}let i=new Map;for(let e of t)i.set(e.schemaName,e.artifactIds);return[...new Set([...t.map(e=>e.schemaName),...r.keys()])].map(e=>{let t=r.get(e)??[],a=[...i.get(e)??[]],o=new Set;for(let e of a)o.add(e);for(let e of t)for(let t of e.artifacts)o.has(t.id)||(o.add(t.id),a.push(t.id));let s=ije(e,a).map(e=>{let n=0,r=0,i=0;for(let a of t){let t=a.artifacts.find(t=>t.id===e);t&&(t.status===`done`&&(n+=1),t.status===`ready`&&(r+=1),t.status===`blocked`&&(i+=1))}return{id:e,label:rje(e),draft:n,ready:r,blocked:i}});return{schemaName:e,readyToArchive:t.filter(e=>e.isComplete&&n.has(e.changeName)).length,steps:s}}).sort((e,t)=>e.schemaName===`spec-driven`?-1:t.schemaName===`spec-driven`?1:e.schemaName.localeCompare(t.schemaName))}function oje(e){let t=0;for(let n of e)t=t*31+n.charCodeAt(0)|0;return Math.abs(t)%360}function sje(e){let t=oje(e),n=`oklch(0.97 0.016 ${t})`,r=`oklch(0.44 0.1 ${t})`;return{border:`oklch(0.84 0.06 ${t})`,background:n,text:r,arrow:`color-mix(in oklab, ${n} 90%, ${r})`}}function cje(){let e=Vl(),{data:t,isLoading:n,error:r}=qAe(),{data:i}=YAe(),{data:a}=O_(),{data:o}=D_(),[s,c]=(0,G.useState)(()=>yke()),[l,u]=(0,G.useState)(null),[d,f]=(0,G.useState)(()=>Date.now()),[p,m]=(0,G.useState)(()=>typeof document>`u`?!0:document.visibilityState===`visible`),[h,g]=(0,G.useState)(null),_=(0,G.useCallback)(()=>{cv.activatePop(`/opsx-propose`)},[]),v=(0,G.useCallback)(()=>{cv.activatePop(`/opsx-new`)},[]),y=(0,G.useCallback)(async e=>XAe(e),[]),b=(0,G.useRef)(0),[x,S]=(0,G.useState)(null),C=(0,G.useRef)(null),w=(0,G.useRef)(i),T=(0,G.useRef)(h),E=h?.reason??null,D=(0,G.useCallback)(()=>{C.current!==null&&(window.clearTimeout(C.current),C.current=null)},[]),O=(0,G.useCallback)(e=>{let t=Date.now();g({reason:e,requestedAt:t}),y(e).then(()=>{w.current?.running||g(n=>n?.reason===e&&n.requestedAt===t?null:n)}).catch(n=>{console.error(`[Dashboard] Failed to refresh git snapshot:`,n),g(n=>n?.reason===e&&n.requestedAt===t?null:n)})},[y]),k=(0,G.useCallback)(()=>{D();let t=z7(s),n=s===`none`?null:xke(s);if(e||t===null||n===null||h!==null||!p){u(null);return}let r=Date.now();u(r),f(r),C.current=window.setTimeout(()=>{C.current=null,u(null),f(Date.now()),O(n)},t)},[D,s,h,p,O,e]),A=(0,G.useCallback)(()=>{D(),u(null),f(Date.now()),O(`manual-button`)},[D,O]),j=(0,G.useCallback)(async e=>{if(!(Vl()||e.isCurrent||!e.detached||U7(e.path))&&window.confirm([`Remove detached worktree?`,``,e.path,``,`This runs git worktree remove --force.`].join(`
1419
- `))){S(e.path);try{await ZAe(e.path)}catch(e){console.error(`[Dashboard] Failed to remove detached worktree:`,e),window.alert(e instanceof Error?e.message:`Failed to remove detached worktree.`)}finally{S(t=>t===e.path?null:t)}}},[]);(0,G.useEffect)(()=>{T.current=h},[h]),(0,G.useEffect)(()=>{if(e)return;let t=e=>{if(T.current!==null)return;let t=Date.now();t-b.current<700||(b.current=t,D(),u(null),f(Date.now()),O(e))},n=()=>{t(`window-focus`)},r=()=>{let e=document.visibilityState===`visible`;m(e),e&&t(`document-visible`)};return window.addEventListener(`focus`,n),document.addEventListener(`visibilitychange`,r),t(`dashboard-mount`),()=>{window.removeEventListener(`focus`,n),document.removeEventListener(`visibilitychange`,r)}},[D,O,e]),(0,G.useEffect)(()=>{w.current=i},[i]),(0,G.useEffect)(()=>{!h||!i||i.running===!1&&(i.lastFinishedAt??0)>=h.requestedAt&&g(e=>e?.reason===h.reason&&e.requestedAt===h.requestedAt?null:e)},[h,i]),(0,G.useEffect)(()=>{e||bke(s)},[s,e]),(0,G.useEffect)(()=>{if(!e)return k(),()=>{D()}},[D,k,e]),(0,G.useEffect)(()=>{let t=z7(s);if(e||t===null||l===null)return;let n=()=>{f(Date.now())};n();let r=window.setInterval(n,250);return()=>{window.clearInterval(r)}},[l,s,e]);let M=t?.activeChanges??[],N=(0,G.useMemo)(()=>new Set(M.map(e=>e.id)),[M]),P=(0,G.useMemo)(()=>(a??[]).filter(e=>N.has(e.changeName)),[a,N]),F=(0,G.useMemo)(()=>{let e=o?.schemas??[],t=o?.schemaDetails??{};return e.map(e=>{let n=t[e.name]?.artifacts.map(e=>e.id)??[],r=n.length>0?n:e.artifacts;return{schemaName:e.name,artifactIds:r}})},[o]),I=(0,G.useMemo)(()=>new Set(M.filter(e=>e.progress.total===0||e.progress.completed>=e.progress.total).map(e=>e.id)),[M]),ee=(0,G.useMemo)(()=>aje(P,F,I),[P,I,F]),L=(0,G.useMemo)(()=>{let e=o?.schemaDetails??{},t=new Map;for(let[n,r]of Object.entries(e)){if(!r?.applyTracks)continue;let e=r.artifacts.find(e=>e.outputPath===r.applyTracks);e?.id&&t.set(n,e.id)}return t},[o]);if(n&&!t)return(0,K.jsx)(`div`,{className:`route-loading animate-pulse`,children:`Loading dashboard...`});if(r)return(0,K.jsxs)(`div`,{className:`text-destructive flex items-center gap-2`,children:[(0,K.jsx)(Cc,{className:`h-5 w-5`}),`Error loading dashboard: `,r.message]});let R=t?.summary??{specifications:0,requirements:0,activeChanges:0,inProgressChanges:0,completedChanges:0,archivedTasksCompleted:0,tasksTotal:0,tasksCompleted:0,taskCompletionPercent:null},z=t?.cardAvailability??tje(R.taskCompletionPercent),te=t?.trendKinds??nje(),B=t?.git??{defaultBranch:`main`,worktrees:[]},ne=!e||B.worktrees.some(e=>e.entries.length>0),re=M.length>0,V=B.worktrees.find(e=>e.isCurrent)??null,H=B.worktrees.filter(e=>!e.isCurrent),ie=z7(s),ae=h===null?Cke(l,ie,d):0,oe=ie!==null&&h===null,se=h!==null&&eje(E),ce=h!==null;return(0,K.jsxs)(`div`,{className:`min-w-0 space-y-6 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,K.jsx)(Jc,{className:`h-6 w-6 shrink-0`}),`Dashboard`]}),(0,K.jsxs)(`button`,{type:`button`,onClick:_,className:`bg-primary text-primary-foreground inline-flex items-center gap-2 rounded-md px-4 py-2 text-sm hover:opacity-90`,title:`Recommended workflow start is /opsx:propose.`,children:[(0,K.jsx)(hl,{className:`h-4 w-4`}),`Start (/opsx:propose)`]})]}),(0,K.jsxs)(`section`,{className:`space-y-2`,children:[(0,K.jsx)(`h2`,{className:`text-sm font-medium`,children:`Historical Trends`}),(0,K.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[(0,K.jsx)(L7,{label:`Specifications / Requirements`,value:`${R.specifications} / ${R.requirements}`,icon:Fc,availability:z.specifications,trendKind:te.specifications,points:t?.trends.specifications??[],triColorPoints:[],className:`min-h-44 sm:min-h-48 lg:min-h-52 xl:min-h-56`}),(0,K.jsx)(L7,{label:`Archived Changes / Completed Tasks`,value:`${R.completedChanges} / ${R.archivedTasksCompleted}`,icon:gc,availability:z.completedChanges,trendKind:te.completedChanges,points:t?.trends.completedChanges??[],triColorPoints:[],className:`min-h-44 sm:min-h-48 lg:min-h-52 xl:min-h-56`})]})]}),(0,K.jsxs)(`div`,{className:`grid min-w-0 gap-3 ${ne?`xl:grid-cols-2`:`xl:grid-cols-1`}`,children:[(0,K.jsxs)(`section`,{className:`@container min-w-0 space-y-2`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{className:`font-medium`,children:`Workflow Progress`}),(0,K.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Status coverage: `,P.length,`/`,M.length,` active changes have workflow status snapshots.`]})]}),ee.length===0?(0,K.jsx)(`div`,{className:`text-muted-foreground rounded-md border border-dashed px-3 py-4 text-sm`,children:`No workflow status available.`}):(0,K.jsx)(`div`,{className:`grid min-w-0 grid-cols-[repeat(auto-fit,minmax(min(100%,18rem),1fr))] gap-2`,children:ee.map(e=>(0,K.jsxs)(`section`,{className:`border-border/70 bg-card min-w-0 rounded-md border p-2`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,K.jsx)(`div`,{className:`min-w-0`,children:(0,K.jsx)(`h3`,{className:`text-xs font-semibold`,children:e.schemaName})}),e.readyToArchive>0?(0,K.jsxs)(`span`,{className:`text-muted-foreground rounded border px-1 py-0.5 text-[10px]`,children:[`archive-ready `,e.readyToArchive]}):null]}),(0,K.jsx)(`div`,{className:`grid min-w-0 grid-cols-[repeat(auto-fit,minmax(min(100%,8rem),1fr))] gap-2`,children:e.steps.length===0?(0,K.jsx)(`div`,{className:`text-muted-foreground border-border/70 rounded-md border border-dashed px-2 py-1.5 text-[11px]`,children:`No artifacts in schema.`}):e.steps.map(t=>{let n=sje(t.id);return(0,K.jsxs)(`article`,{className:`relative min-w-0 overflow-hidden rounded-md border px-1.5 py-1`,style:{borderColor:n.border,backgroundColor:n.background,color:n.text},children:[(0,K.jsx)(vc,{className:`pointer-events-none absolute right-[10%] top-1/2 h-12 w-12 -translate-y-1/2`,style:{color:n.arrow}}),(0,K.jsx)(`div`,{className:`relative mb-0.5 pr-6 text-xs font-semibold`,children:t.label}),(0,K.jsxs)(`div`,{className:`relative space-y-0 text-[10px]`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`span`,{className:`text-current/75`,children:`Draft`}),(0,K.jsx)(`span`,{className:`font-mono`,children:t.draft})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`span`,{className:`text-current/75`,children:`Ready`}),(0,K.jsx)(`span`,{className:`font-mono`,children:t.ready})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`span`,{className:`text-current/75`,children:`Blocked`}),(0,K.jsx)(`span`,{className:`font-mono`,children:t.blocked})]})]})]},`${e.schemaName}:${t.id}`)})})]},e.schemaName))})]}),ne?(0,K.jsxs)(`section`,{className:`min-w-0 space-y-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`h2`,{className:`font-medium`,children:`Git Snapshot`}),(0,K.jsxs)(`p`,{className:`text-muted-foreground truncate text-xs`,children:[`Default branch: `,B.defaultBranch]})]}),e?null:(0,K.jsxs)(`div`,{className:`border-border bg-card inline-flex overflow-hidden rounded-md border`,children:[(0,K.jsx)(UAe,{value:s,options:$Ae,onValueChange:c,ariaLabel:`Git auto refresh`,className:`text-foreground/75 hover:text-foreground border-r-current/10 bg-muted/20 relative isolate h-7 w-9 shrink-0 justify-center rounded-none border-0 border-r px-0`,positionerClassName:`z-50`,popupClassName:`min-w-[7rem]`,renderTrigger:({selectedOption:e})=>(0,K.jsxs)(`span`,{className:`relative inline-flex h-full w-full items-center justify-center overflow-hidden`,children:[(0,K.jsx)(`span`,{className:`bg-muted/20 pointer-events-none absolute inset-0`}),oe?(0,K.jsx)(`span`,{className:`bg-primary/30 dark:bg-primary/35 pointer-events-none absolute inset-y-0 left-0 transition-[width]`,style:{width:`${ae*100}%`}}):null,(0,K.jsx)(`span`,{className:`relative z-10 inline-flex items-center justify-center`,children:(0,K.jsx)(kke,{preset:e?.value??s})})]})}),(0,K.jsxs)(`button`,{type:`button`,onClick:A,disabled:ce,className:`inline-flex h-7 items-center gap-1 px-2 py-1 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-70 ${se?`text-primary bg-primary/10`:`text-foreground/75 hover:text-foreground`}`,children:[(0,K.jsx)(cl,{className:`h-3.5 w-3.5 ${se?`animate-spin`:``}`}),`Refresh`]})]})]}),(0,K.jsxs)(`div`,{className:`border-border/80 bg-card min-w-0 rounded-lg border p-3`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-center gap-1.5`,children:[(0,K.jsx)(Hc,{className:`text-muted-foreground h-4 w-4 shrink-0`}),(0,K.jsxs)(`span`,{className:`text-muted-foreground truncate text-xs`,children:[`Default branch: `,B.defaultBranch]})]}),V?(0,K.jsxs)(`div`,{className:`space-y-0`,children:[(0,K.jsx)(K7,{worktree:V,emphasize:!0,removing:x===V.path,onRemoveDetachedWorktree:j}),(0,K.jsx)(`div`,{className:`-mt-px space-y-1 border-l pl-3 pt-2 ${Eke}`,children:Ske(V.entries).map(t=>(0,K.jsx)(jke,{entry:t,onSelect:e?void 0:(e,t)=>{cv.push(`bottom`,KAe(e),X_(void 0,Ake(e)),{source:t,sharedElements:G7(e)})}},t.type===`commit`?t.hash:`${t.type}:${t.updatedAt??`none`}`))})]}):(0,K.jsx)(`div`,{className:`text-muted-foreground rounded-md border border-dashed px-2.5 py-2 text-xs`,children:`No worktree snapshot available.`}),H.length>0&&(0,K.jsxs)(`div`,{className:`border-border/70 mt-3 space-y-1 border-t pt-2`,children:[(0,K.jsx)(`div`,{className:`text-muted-foreground text-xs uppercase tracking-wide`,children:`Other Worktrees`}),H.map(e=>(0,K.jsx)(K7,{worktree:e,emphasize:!1,removing:x===e.path,onRemoveDetachedWorktree:j},e.path))]})]})]}):null]}),(0,K.jsxs)(`div`,{className:`grid gap-3 xl:grid-cols-2`,children:[(0,K.jsxs)(`section`,{className:`border-border flex min-w-0 flex-col rounded-t-lg border`,children:[(0,K.jsxs)(`div`,{className:`border-border flex min-w-0 flex-wrap items-center justify-between gap-1.5 border-b px-4 py-3`,children:[(0,K.jsx)(`h2`,{className:`font-medium`,children:`Active Changes`}),(0,K.jsxs)(`span`,{className:`text-muted-foreground text-xs sm:text-sm`,children:[R.activeChanges,` active`]})]}),(0,K.jsxs)(`div`,{className:`bg-card divide-border flex min-w-0 flex-1 flex-col divide-y`,children:[M.map(e=>{let t=e.progress,n=t.total>0?Math.round(t.completed/t.total*100):0,r=P.find(t=>t.changeName===e.id),i=r?.artifacts.filter(e=>e.status===`done`).length??0,a=r?.artifacts.length??0,o=r?L.get(r.schemaName):void 0,s=o&&r?r.artifacts.find(e=>e.id===o)?.status??MX(r.artifacts.map(e=>e.status)):MX(r?.artifacts.map(e=>e.status)??[]),c=jX({hasStatus:!!r,isComplete:r?.isComplete??!1,tasksComplete:t.total===0||t.completed>=t.total,trackedArtifactStatus:s});return(0,K.jsxs)(av,{to:`/changes/$changeId`,params:{changeId:e.id},state:t=>({...t,__vtHandoff:{family:`changes`,entityId:e.id,title:e.name,subtitle:e.id}}),vt:{sharedElements:{family:`changes`,entityId:e.id}},...J_({family:`changes`,entityId:e.id},`container`),className:`hover:bg-muted/50 block min-w-0 px-4 py-3`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex min-w-0 flex-wrap items-start justify-between gap-3 sm:flex-nowrap sm:items-center`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{...J_({family:`changes`,entityId:e.id},`title`),className:`truncate font-medium`,children:e.name}),(0,K.jsxs)(`div`,{className:`text-muted-foreground truncate text-xs`,children:[e.updatedAt>0&&(0,K.jsxs)(K.Fragment,{children:[zT(e.updatedAt),` · `]}),e.id]})]}),(0,K.jsxs)(`div`,{className:`shrink-0 text-right text-sm`,children:[(0,K.jsx)(`span`,{className:`rounded border px-1.5 py-0.5 text-[11px] font-medium ${c.toneClass}`,children:c.label}),(0,K.jsxs)(`div`,{className:`font-medium`,children:[t.completed,`/`,t.total]}),(0,K.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:`tasks`})]})]}),(0,K.jsx)(`div`,{className:`bg-muted h-1.5 rounded-full`,children:(0,K.jsx)(`div`,{className:`bg-primary h-full rounded-full transition-all`,style:{width:`${n}%`}})}),(0,K.jsxs)(`div`,{className:`text-muted-foreground mt-2 flex min-w-0 flex-wrap items-center justify-between gap-2 text-xs`,children:[(0,K.jsxs)(`span`,{className:`shrink-0`,children:[n,`% task completion`]}),r?(0,K.jsxs)(`span`,{className:`min-w-0 truncate text-right`,children:[i,`/`,a,` artifacts · `,r.schemaName]}):(0,K.jsx)(`span`,{children:`Artifacts status unavailable`})]})]},e.id)}),!re&&(0,K.jsxs)(`div`,{className:`text-muted-foreground px-4 py-6 text-center text-sm`,children:[(0,K.jsx)(`div`,{children:`No active changes.`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs`,children:`Recommended workflow start: /opsx:propose`}),(0,K.jsxs)(`button`,{type:`button`,onClick:v,className:`text-primary mt-2 inline-flex items-center gap-1 hover:underline`,title:`Open the advanced /opsx:new form`,children:[(0,K.jsx)(hl,{className:`h-3.5 w-3.5`}),`Open /opsx:new form`]})]})]})]}),(0,K.jsxs)(`section`,{className:`border-border min-w-0 rounded-t-lg border`,children:[(0,K.jsxs)(`div`,{className:`border-border flex min-w-0 flex-wrap items-center justify-between gap-1.5 border-b px-4 py-3`,children:[(0,K.jsx)(`h2`,{className:`shrink-0 font-medium`,children:`Specifications`}),(0,K.jsxs)(`span`,{className:`text-muted-foreground text-xs sm:text-sm`,children:[R.specifications,` specs · `,R.requirements,` requirements`]})]}),(0,K.jsxs)(`div`,{className:`bg-card divide-border min-w-0 divide-y`,children:[t?.specifications.map(e=>{let t={family:`specs`,entityId:e.id};return(0,K.jsx)(av,{to:`/specs/$specId`,params:{specId:e.id},state:t=>({...t,__vtHandoff:{family:`specs`,entityId:e.id,title:e.name,subtitle:e.id}}),vt:{sharedElements:t},...J_(t,`container`),className:`hover:bg-muted/50 block min-w-0 px-4 py-3`,children:(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-3 sm:flex-nowrap`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{...J_(t,`title`),className:`truncate font-medium`,children:e.name}),(0,K.jsxs)(`div`,{className:`text-muted-foreground truncate text-xs`,children:[e.updatedAt>0&&(0,K.jsxs)(K.Fragment,{children:[zT(e.updatedAt),` · `]}),e.id]})]}),(0,K.jsxs)(`div`,{className:`shrink-0 text-right text-sm`,children:[(0,K.jsx)(`div`,{className:`font-medium`,children:e.requirements}),(0,K.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:`requirements`})]})]})},e.id)}),t?.specifications.length===0&&(0,K.jsx)(`div`,{className:`text-muted-foreground px-4 py-6 text-center text-sm`,children:`No specifications found.`})]})]})]})]})}var U9=qZ([`spec`,`change`,`archive`]),W9=WZ({id:VZ(),kind:U9,title:VZ(),href:VZ(),path:VZ(),content:VZ(),updatedAt:HZ()}),lje=WZ({query:VZ(),limit:HZ().int().positive().optional()}),G9=WZ({documentId:VZ(),kind:U9,title:VZ(),href:VZ(),path:VZ(),score:HZ(),snippet:VZ(),updatedAt:HZ()});GZ(`type`,[WZ({id:VZ(),type:KZ(`init`),docs:UZ(W9)}),WZ({id:VZ(),type:KZ(`replaceAll`),docs:UZ(W9)}),WZ({id:VZ(),type:KZ(`search`),query:lje}),WZ({id:VZ(),type:KZ(`dispose`)})]);var uje=GZ(`type`,[WZ({id:VZ(),type:KZ(`ok`)}),WZ({id:VZ(),type:KZ(`results`),hits:UZ(G9)}),WZ({id:VZ(),type:KZ(`error`),message:VZ()})]),dje=String.raw`
1419
+ `))){S(e.path);try{await ZAe(e.path)}catch(e){console.error(`[Dashboard] Failed to remove detached worktree:`,e),window.alert(e instanceof Error?e.message:`Failed to remove detached worktree.`)}finally{S(t=>t===e.path?null:t)}}},[]);(0,G.useEffect)(()=>{T.current=h},[h]),(0,G.useEffect)(()=>{if(e)return;let t=e=>{if(T.current!==null)return;let t=Date.now();t-b.current<700||(b.current=t,D(),u(null),f(Date.now()),O(e))},n=()=>{t(`window-focus`)},r=()=>{let e=document.visibilityState===`visible`;m(e),e&&t(`document-visible`)};return window.addEventListener(`focus`,n),document.addEventListener(`visibilitychange`,r),t(`dashboard-mount`),()=>{window.removeEventListener(`focus`,n),document.removeEventListener(`visibilitychange`,r)}},[D,O,e]),(0,G.useEffect)(()=>{w.current=i},[i]),(0,G.useEffect)(()=>{!h||!i||i.running===!1&&(i.lastFinishedAt??0)>=h.requestedAt&&g(e=>e?.reason===h.reason&&e.requestedAt===h.requestedAt?null:e)},[h,i]),(0,G.useEffect)(()=>{e||bke(s)},[s,e]),(0,G.useEffect)(()=>{if(!e)return k(),()=>{D()}},[D,k,e]),(0,G.useEffect)(()=>{let t=z7(s);if(e||t===null||l===null)return;let n=()=>{f(Date.now())};n();let r=window.setInterval(n,250);return()=>{window.clearInterval(r)}},[l,s,e]);let M=t?.activeChanges??[],N=(0,G.useMemo)(()=>new Set(M.map(e=>e.id)),[M]),P=(0,G.useMemo)(()=>(a??[]).filter(e=>N.has(e.changeName)),[a,N]),F=(0,G.useMemo)(()=>{let e=o?.schemas??[],t=o?.schemaDetails??{};return e.map(e=>{let n=t[e.name]?.artifacts.map(e=>e.id)??[],r=n.length>0?n:e.artifacts;return{schemaName:e.name,artifactIds:r}})},[o]),I=(0,G.useMemo)(()=>new Set(M.filter(e=>e.progress.total===0||e.progress.completed>=e.progress.total).map(e=>e.id)),[M]),ee=(0,G.useMemo)(()=>aje(P,F,I),[P,I,F]),L=(0,G.useMemo)(()=>{let e=o?.schemaDetails??{},t=new Map;for(let[n,r]of Object.entries(e)){if(!r?.applyTracks)continue;let e=r.artifacts.find(e=>e.outputPath===r.applyTracks);e?.id&&t.set(n,e.id)}return t},[o]);if(n&&!t)return(0,K.jsx)(`div`,{className:`route-loading animate-pulse`,children:`Loading dashboard...`});if(r)return(0,K.jsxs)(`div`,{className:`text-destructive flex items-center gap-2`,children:[(0,K.jsx)(Cc,{className:`h-5 w-5`}),`Error loading dashboard: `,r.message]});let R=t?.summary??{specifications:0,requirements:0,activeChanges:0,inProgressChanges:0,completedChanges:0,archivedTasksCompleted:0,tasksTotal:0,tasksCompleted:0,taskCompletionPercent:null},z=t?.cardAvailability??tje(R.taskCompletionPercent),te=t?.trendKinds??nje(),B=t?.git??{defaultBranch:`main`,worktrees:[]},ne=!e||B.worktrees.some(e=>e.entries.length>0),re=M.length>0,V=B.worktrees.find(e=>e.isCurrent)??null,H=B.worktrees.filter(e=>!e.isCurrent),ie=z7(s),ae=h===null?Cke(l,ie,d):0,oe=ie!==null&&h===null,se=h!==null&&eje(E),ce=h!==null;return(0,K.jsxs)(`div`,{className:`min-w-0 space-y-6 p-4`,children:[(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,K.jsxs)(`h1`,{className:`font-nav flex items-center gap-2 text-2xl font-bold`,children:[(0,K.jsx)(Jc,{className:`h-6 w-6 shrink-0`}),`Dashboard`]}),(0,K.jsxs)(`button`,{type:`button`,onClick:_,className:`bg-primary text-primary-foreground inline-flex items-center gap-2 rounded-md px-4 py-2 text-sm hover:opacity-90`,title:`Open Quick Propose.`,children:[(0,K.jsx)(hl,{className:`h-4 w-4`}),`Start Propose`]})]}),(0,K.jsxs)(`section`,{className:`space-y-2`,children:[(0,K.jsx)(`h2`,{className:`text-sm font-medium`,children:`Historical Trends`}),(0,K.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2`,children:[(0,K.jsx)(L7,{label:`Specifications / Requirements`,value:`${R.specifications} / ${R.requirements}`,icon:Fc,availability:z.specifications,trendKind:te.specifications,points:t?.trends.specifications??[],triColorPoints:[],className:`min-h-44 sm:min-h-48 lg:min-h-52 xl:min-h-56`}),(0,K.jsx)(L7,{label:`Archived Changes / Completed Tasks`,value:`${R.completedChanges} / ${R.archivedTasksCompleted}`,icon:gc,availability:z.completedChanges,trendKind:te.completedChanges,points:t?.trends.completedChanges??[],triColorPoints:[],className:`min-h-44 sm:min-h-48 lg:min-h-52 xl:min-h-56`})]})]}),(0,K.jsxs)(`div`,{className:`grid min-w-0 gap-3 ${ne?`xl:grid-cols-2`:`xl:grid-cols-1`}`,children:[(0,K.jsxs)(`section`,{className:`@container min-w-0 space-y-2`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h2`,{className:`font-medium`,children:`Workflow Progress`}),(0,K.jsxs)(`p`,{className:`text-muted-foreground text-xs`,children:[`Status coverage: `,P.length,`/`,M.length,` active changes have workflow status snapshots.`]})]}),ee.length===0?(0,K.jsx)(`div`,{className:`text-muted-foreground rounded-md border border-dashed px-3 py-4 text-sm`,children:`No workflow status available.`}):(0,K.jsx)(`div`,{className:`grid min-w-0 grid-cols-[repeat(auto-fit,minmax(min(100%,18rem),1fr))] gap-2`,children:ee.map(e=>(0,K.jsxs)(`section`,{className:`border-border/70 bg-card min-w-0 rounded-md border p-2`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,K.jsx)(`div`,{className:`min-w-0`,children:(0,K.jsx)(`h3`,{className:`text-xs font-semibold`,children:e.schemaName})}),e.readyToArchive>0?(0,K.jsxs)(`span`,{className:`text-muted-foreground rounded border px-1 py-0.5 text-[10px]`,children:[`archive-ready `,e.readyToArchive]}):null]}),(0,K.jsx)(`div`,{className:`grid min-w-0 grid-cols-[repeat(auto-fit,minmax(min(100%,8rem),1fr))] gap-2`,children:e.steps.length===0?(0,K.jsx)(`div`,{className:`text-muted-foreground border-border/70 rounded-md border border-dashed px-2 py-1.5 text-[11px]`,children:`No artifacts in schema.`}):e.steps.map(t=>{let n=sje(t.id);return(0,K.jsxs)(`article`,{className:`relative min-w-0 overflow-hidden rounded-md border px-1.5 py-1`,style:{borderColor:n.border,backgroundColor:n.background,color:n.text},children:[(0,K.jsx)(vc,{className:`pointer-events-none absolute right-[10%] top-1/2 h-12 w-12 -translate-y-1/2`,style:{color:n.arrow}}),(0,K.jsx)(`div`,{className:`relative mb-0.5 pr-6 text-xs font-semibold`,children:t.label}),(0,K.jsxs)(`div`,{className:`relative space-y-0 text-[10px]`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`span`,{className:`text-current/75`,children:`Draft`}),(0,K.jsx)(`span`,{className:`font-mono`,children:t.draft})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`span`,{className:`text-current/75`,children:`Ready`}),(0,K.jsx)(`span`,{className:`font-mono`,children:t.ready})]}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`span`,{className:`text-current/75`,children:`Blocked`}),(0,K.jsx)(`span`,{className:`font-mono`,children:t.blocked})]})]})]},`${e.schemaName}:${t.id}`)})})]},e.schemaName))})]}),ne?(0,K.jsxs)(`section`,{className:`min-w-0 space-y-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsxs)(`div`,{className:`min-w-0`,children:[(0,K.jsx)(`h2`,{className:`font-medium`,children:`Git Snapshot`}),(0,K.jsxs)(`p`,{className:`text-muted-foreground truncate text-xs`,children:[`Default branch: `,B.defaultBranch]})]}),e?null:(0,K.jsxs)(`div`,{className:`border-border bg-card inline-flex overflow-hidden rounded-md border`,children:[(0,K.jsx)(UAe,{value:s,options:$Ae,onValueChange:c,ariaLabel:`Git auto refresh`,className:`text-foreground/75 hover:text-foreground border-r-current/10 bg-muted/20 relative isolate h-7 w-9 shrink-0 justify-center rounded-none border-0 border-r px-0`,positionerClassName:`z-50`,popupClassName:`min-w-[7rem]`,renderTrigger:({selectedOption:e})=>(0,K.jsxs)(`span`,{className:`relative inline-flex h-full w-full items-center justify-center overflow-hidden`,children:[(0,K.jsx)(`span`,{className:`bg-muted/20 pointer-events-none absolute inset-0`}),oe?(0,K.jsx)(`span`,{className:`bg-primary/30 dark:bg-primary/35 pointer-events-none absolute inset-y-0 left-0 transition-[width]`,style:{width:`${ae*100}%`}}):null,(0,K.jsx)(`span`,{className:`relative z-10 inline-flex items-center justify-center`,children:(0,K.jsx)(kke,{preset:e?.value??s})})]})}),(0,K.jsxs)(`button`,{type:`button`,onClick:A,disabled:ce,className:`inline-flex h-7 items-center gap-1 px-2 py-1 text-xs transition-colors disabled:cursor-not-allowed disabled:opacity-70 ${se?`text-primary bg-primary/10`:`text-foreground/75 hover:text-foreground`}`,children:[(0,K.jsx)(cl,{className:`h-3.5 w-3.5 ${se?`animate-spin`:``}`}),`Refresh`]})]})]}),(0,K.jsxs)(`div`,{className:`border-border/80 bg-card min-w-0 rounded-lg border p-3`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex items-center gap-1.5`,children:[(0,K.jsx)(Hc,{className:`text-muted-foreground h-4 w-4 shrink-0`}),(0,K.jsxs)(`span`,{className:`text-muted-foreground truncate text-xs`,children:[`Default branch: `,B.defaultBranch]})]}),V?(0,K.jsxs)(`div`,{className:`space-y-0`,children:[(0,K.jsx)(K7,{worktree:V,emphasize:!0,removing:x===V.path,onRemoveDetachedWorktree:j}),(0,K.jsx)(`div`,{className:`-mt-px space-y-1 border-l pl-3 pt-2 ${Eke}`,children:Ske(V.entries).map(t=>(0,K.jsx)(jke,{entry:t,onSelect:e?void 0:(e,t)=>{cv.push(`bottom`,KAe(e),X_(void 0,Ake(e)),{source:t,sharedElements:G7(e)})}},t.type===`commit`?t.hash:`${t.type}:${t.updatedAt??`none`}`))})]}):(0,K.jsx)(`div`,{className:`text-muted-foreground rounded-md border border-dashed px-2.5 py-2 text-xs`,children:`No worktree snapshot available.`}),H.length>0&&(0,K.jsxs)(`div`,{className:`border-border/70 mt-3 space-y-1 border-t pt-2`,children:[(0,K.jsx)(`div`,{className:`text-muted-foreground text-xs uppercase tracking-wide`,children:`Other Worktrees`}),H.map(e=>(0,K.jsx)(K7,{worktree:e,emphasize:!1,removing:x===e.path,onRemoveDetachedWorktree:j},e.path))]})]})]}):null]}),(0,K.jsxs)(`div`,{className:`grid gap-3 xl:grid-cols-2`,children:[(0,K.jsxs)(`section`,{className:`border-border flex min-w-0 flex-col rounded-t-lg border`,children:[(0,K.jsxs)(`div`,{className:`border-border flex min-w-0 flex-wrap items-center justify-between gap-1.5 border-b px-4 py-3`,children:[(0,K.jsx)(`h2`,{className:`font-medium`,children:`Active Changes`}),(0,K.jsxs)(`span`,{className:`text-muted-foreground text-xs sm:text-sm`,children:[R.activeChanges,` active`]})]}),(0,K.jsxs)(`div`,{className:`bg-card divide-border flex min-w-0 flex-1 flex-col divide-y`,children:[M.map(e=>{let t=e.progress,n=t.total>0?Math.round(t.completed/t.total*100):0,r=P.find(t=>t.changeName===e.id),i=r?.artifacts.filter(e=>e.status===`done`).length??0,a=r?.artifacts.length??0,o=r?L.get(r.schemaName):void 0,s=o&&r?r.artifacts.find(e=>e.id===o)?.status??MX(r.artifacts.map(e=>e.status)):MX(r?.artifacts.map(e=>e.status)??[]),c=jX({hasStatus:!!r,isComplete:r?.isComplete??!1,tasksComplete:t.total===0||t.completed>=t.total,trackedArtifactStatus:s});return(0,K.jsxs)(av,{to:`/changes/$changeId`,params:{changeId:e.id},state:t=>({...t,__vtHandoff:{family:`changes`,entityId:e.id,title:e.name,subtitle:e.id}}),vt:{sharedElements:{family:`changes`,entityId:e.id}},...J_({family:`changes`,entityId:e.id},`container`),className:`hover:bg-muted/50 block min-w-0 px-4 py-3`,children:[(0,K.jsxs)(`div`,{className:`mb-2 flex min-w-0 flex-wrap items-start justify-between gap-3 sm:flex-nowrap sm:items-center`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{...J_({family:`changes`,entityId:e.id},`title`),className:`truncate font-medium`,children:e.name}),(0,K.jsxs)(`div`,{className:`text-muted-foreground truncate text-xs`,children:[e.updatedAt>0&&(0,K.jsxs)(K.Fragment,{children:[zT(e.updatedAt),` · `]}),e.id]})]}),(0,K.jsxs)(`div`,{className:`shrink-0 text-right text-sm`,children:[(0,K.jsx)(`span`,{className:`rounded border px-1.5 py-0.5 text-[11px] font-medium ${c.toneClass}`,children:c.label}),(0,K.jsxs)(`div`,{className:`font-medium`,children:[t.completed,`/`,t.total]}),(0,K.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:`tasks`})]})]}),(0,K.jsx)(`div`,{className:`bg-muted h-1.5 rounded-full`,children:(0,K.jsx)(`div`,{className:`bg-primary h-full rounded-full transition-all`,style:{width:`${n}%`}})}),(0,K.jsxs)(`div`,{className:`text-muted-foreground mt-2 flex min-w-0 flex-wrap items-center justify-between gap-2 text-xs`,children:[(0,K.jsxs)(`span`,{className:`shrink-0`,children:[n,`% task completion`]}),r?(0,K.jsxs)(`span`,{className:`min-w-0 truncate text-right`,children:[i,`/`,a,` artifacts · `,r.schemaName]}):(0,K.jsx)(`span`,{children:`Artifacts status unavailable`})]})]},e.id)}),!re&&(0,K.jsxs)(`div`,{className:`text-muted-foreground px-4 py-6 text-center text-sm`,children:[(0,K.jsx)(`div`,{children:`No active changes.`}),(0,K.jsx)(`div`,{className:`mt-1 text-xs`,children:`Recommended workflow start: Quick Propose`}),(0,K.jsxs)(`button`,{type:`button`,onClick:v,className:`text-primary mt-2 inline-flex items-center gap-1 hover:underline`,title:`Open the advanced /opsx:new form`,children:[(0,K.jsx)(hl,{className:`h-3.5 w-3.5`}),`Open /opsx:new form`]})]})]})]}),(0,K.jsxs)(`section`,{className:`border-border min-w-0 rounded-t-lg border`,children:[(0,K.jsxs)(`div`,{className:`border-border flex min-w-0 flex-wrap items-center justify-between gap-1.5 border-b px-4 py-3`,children:[(0,K.jsx)(`h2`,{className:`shrink-0 font-medium`,children:`Specifications`}),(0,K.jsxs)(`span`,{className:`text-muted-foreground text-xs sm:text-sm`,children:[R.specifications,` specs · `,R.requirements,` requirements`]})]}),(0,K.jsxs)(`div`,{className:`bg-card divide-border min-w-0 divide-y`,children:[t?.specifications.map(e=>{let t={family:`specs`,entityId:e.id};return(0,K.jsx)(av,{to:`/specs/$specId`,params:{specId:e.id},state:t=>({...t,__vtHandoff:{family:`specs`,entityId:e.id,title:e.name,subtitle:e.id}}),vt:{sharedElements:t},...J_(t,`container`),className:`hover:bg-muted/50 block min-w-0 px-4 py-3`,children:(0,K.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center justify-between gap-3 sm:flex-nowrap`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsx)(`div`,{...J_(t,`title`),className:`truncate font-medium`,children:e.name}),(0,K.jsxs)(`div`,{className:`text-muted-foreground truncate text-xs`,children:[e.updatedAt>0&&(0,K.jsxs)(K.Fragment,{children:[zT(e.updatedAt),` · `]}),e.id]})]}),(0,K.jsxs)(`div`,{className:`shrink-0 text-right text-sm`,children:[(0,K.jsx)(`div`,{className:`font-medium`,children:e.requirements}),(0,K.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:`requirements`})]})]})},e.id)}),t?.specifications.length===0&&(0,K.jsx)(`div`,{className:`text-muted-foreground px-4 py-6 text-center text-sm`,children:`No specifications found.`})]})]})]})]})}var U9=qZ([`spec`,`change`,`archive`]),W9=WZ({id:VZ(),kind:U9,title:VZ(),href:VZ(),path:VZ(),content:VZ(),updatedAt:HZ()}),lje=WZ({query:VZ(),limit:HZ().int().positive().optional()}),G9=WZ({documentId:VZ(),kind:U9,title:VZ(),href:VZ(),path:VZ(),score:HZ(),snippet:VZ(),updatedAt:HZ()});GZ(`type`,[WZ({id:VZ(),type:KZ(`init`),docs:UZ(W9)}),WZ({id:VZ(),type:KZ(`replaceAll`),docs:UZ(W9)}),WZ({id:VZ(),type:KZ(`search`),query:lje}),WZ({id:VZ(),type:KZ(`dispose`)})]);var uje=GZ(`type`,[WZ({id:VZ(),type:KZ(`ok`)}),WZ({id:VZ(),type:KZ(`results`),hits:UZ(G9)}),WZ({id:VZ(),type:KZ(`error`),message:VZ()})]),dje=String.raw`
1420
1420
  const DEFAULT_LIMIT = 50;
1421
1421
  const MAX_LIMIT = 200;
1422
1422
  const SNIPPET_SIZE = 180;