Files
cotizador-wmc/dist/assets/chat-alcqTZG9.js
T
2026-08-29 08:39:57 -04:00

208 lines
511 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-i2ZEVJq0.js","assets/rolldown-runtime-B0Z9INg1.js","assets/html-DhBYQyK4.js","assets/javascript-DWVbOe4X.js","assets/css-DeEW2upM.js","assets/angular-ts-CEQYB7nm.js","assets/scss-DngyzxVC.js","assets/apl-BqqYD0H4.js","assets/xml-CNfvW5JP.js","assets/java-duG_UTKe.js","assets/json-Br_ORbR4.js","assets/astro-Dt1mSA-e.js","assets/typescript-BAz-bF8J.js","assets/postcss-BXeXVLqQ.js","assets/tsx-JMDX3aQ7.js","assets/blade-D83jhYA_.js","assets/html-derivative-C_nRlqME.js","assets/sql-CLgiMrxJ.js","assets/bsl-BkkzgIyY.js","assets/sdbl-bTVj8UrX.js","assets/c-aGSZMVdM.js","assets/cairo-DLTphjLi.js","assets/python-gzcpVVnB.js","assets/cobol-BgCIwGZu.js","assets/coffee-ouOQ86EC.js","assets/cpp-D7oTDj03.js","assets/regexp--aR2_iz7.js","assets/glsl-TOBAB6bO.js","assets/crystal-Dj_CYA08.js","assets/shellscript-DnoJEH0-.js","assets/edge-CCRlTIbg.js","assets/elixir-DkgEFlh9.js","assets/elm-C-6n8iva.js","assets/erb-Cs0Iy0dO.js","assets/ruby-D3BGyoLR.js","assets/haml-BUBfnAPo.js","assets/graphql-ns1EoQQG.js","assets/jsx-fcCEM_-L.js","assets/lua-BIP2dQgW.js","assets/yaml-B9zsrP9R.js","assets/erlang-Cphh6RMH.js","assets/markdown-BYOwaDjH.js","assets/fortran-fixed-form-DEKoE2YW.js","assets/fortran-free-form-CYNrtFtB.js","assets/fsharp-D13ZGOAj.js","assets/gdresource-C0sCabJj.js","assets/gdshader-CBce3t8t.js","assets/gdscript-Cp2uCuqX.js","assets/git-commit-BSykSTBG.js","assets/diff-woXpYk--.js","assets/git-rebase-BnAFTyQc.js","assets/glimmer-js-CFyErDLZ.js","assets/glimmer-ts-Ct4QKAg6.js","assets/hack-DB7M32Gm.js","assets/handlebars-qVnY7qVv.js","assets/http-Da_kjz5m.js","assets/hurl-DKXSMFRR.js","assets/csv-Dx-8-gkx.js","assets/hxml-B0Qn7Nwc.js","assets/haxe-OTjmBuCE.js","assets/jinja-DuNSryF7.js","assets/jison-CHwnC1Pv.js","assets/julia-mj6xfn4X.js","assets/r-B_2zvz1A.js","assets/just-DZo2o5E2.js","assets/perl-C1dZQPV5.js","assets/latex-CSkjTfPS.js","assets/tex-Bjo-GMiN.js","assets/liquid-XCoXGo1k.js","assets/marko-CiosSmec.js","assets/less-DVTAwKKz.js","assets/mdc-C7Lb5uay.js","assets/nextflow-Bbiyy34d.js","assets/nextflow-groovy-Dc_ddanL.js","assets/nginx-BgDTOYqs.js","assets/nim-CUz-jMgf.js","assets/php-Cv1yln_y.js","assets/pug-Ce37auPQ.js","assets/qml-DWs4ParD.js","assets/razor-Ctpaw8Xr.js","assets/csharp-Ct8U2NOr.js","assets/rst-CqRkteH8.js","assets/cmake-Bj61d0ZC.js","assets/sas-BaCscvql.js","assets/shaderlab-TOUzSsQk.js","assets/hlsl-Cvrh5tZx.js","assets/shellsession-DnjHxDMP.js","assets/soy-DmAO5KqQ.js","assets/sparql-D_iOobhT.js","assets/turtle-ByJddavk.js","assets/stata-BiJ8hoIJ.js","assets/surrealql-D9bH0Csw.js","assets/svelte-B3woShZ2.js","assets/templ-B7gtJFlV.js","assets/go-BJwz_mda.js","assets/ts-tags-CSxB5Eny.js","assets/twig-DCsq_S7z.js","assets/vue-BR4XqTj9.js","assets/vue-html-DZGW9MGR.js","assets/vue-vine-B157dWFT.js","assets/stylus-B6D30XZt.js","assets/xsl-zsHjPACe.js","assets/c4Diagram-5PPSVZJV-OczhytfR.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js","assets/src-BY_WSiz7.js","assets/chunk-I66GZJ75-DyIufBk3.js","assets/preload-helper-BGRGm2aY.js","assets/dist-BDCdLWk4.js","assets/chunk-NSK5VX7P-C5rgTOqf.js","assets/chunk-2GRJ4B5K-CjXzWa6S.js","assets/flowDiagram-UKHOOZJN-BUBkadfr.js","assets/chunk-4I5QYGJK-CqcwRbfk.js","assets/chunk-WRU74C26-BTfK14t9.js","assets/chunk-7BUUIJ7U-Bb538aSH.js","assets/chunk-UBXNYLIW-D4IRhP65.js","assets/chunk-XXDRQBXY-DR-hrsFH.js","assets/chunk-KBJHAD2P-jJj-4Ly6.js","assets/chunk-W5SLKNZC-Bwa0Erac.js","assets/chunk-QR6OTTB3-Gf6zEt7G.js","assets/rough.esm-Dy-Kn_BL.js","assets/chunk-7Z6QIM7H-C8-Xmgc1.js","assets/line-C3peQHkb.js","assets/path-fybaL0A-.js","assets/array-BifhSqXX.js","assets/chunk-J7OUQ5F2-B_bnfxd4.js","assets/chunk-ZIRB5QZD-O39ZBUk3.js","assets/chunk-JQJVKLGR-Dqo-DW7E.js","assets/channel-utvaOuUZ.js","assets/chunk-5VM5RSS4-ZNzvKenW.js","assets/swimlanesDiagram-ULZ7WXOC-CrVvBgdm.js","assets/erDiagram-JOGREHBK-DSe3_-3x.js","assets/gitGraphDiagram-DS77QQ5N-CkEDBEZA.js","assets/chunk-JWPE2WC7-DVXcaiue.js","assets/mermaid-parser.core-3r-A_QO0.js","assets/chunk-KEIR6QF5-BICK3FdT.js","assets/chunk-MOZMSUNE-XVucA-n6.js","assets/chunk-OSBZ3O6U-CrKZOUOr.js","assets/chunk-5JV3BV7I-Cy5pj3QY.js","assets/chunk-CYSBUYHQ-C1Rf4art.js","assets/chunk-BIQX33UG-DZEsGuSn.js","assets/chunk-EMLP6XTP-RLD4nXpI.js","assets/chunk-YOTPTUD7-D0vRKqYp.js","assets/chunk-QBLGF6JB-CxAyS2mW.js","assets/chunk-5TONJI2A-DQOY3q1H.js","assets/chunk-5HE753X5-Bw-yg4kO.js","assets/chunk-U6XO7XAA-BFxjP5U3.js","assets/chunk-JG7HCLWE-BYfiSaVt.js","assets/chunk-CQNSW5MT-B8S09OIh.js","assets/chunk-R7FJI6CG-Cnn3gE-Y.js","assets/chunk-5FCAYU7R-Dh5nylU8.js","assets/chunk-2Q5K7J3B-C1jixKkw.js","assets/ganttDiagram-PKOTCBZU-BRE655Yg.js","assets/linear-CmpaHCv3.js","assets/defaultLocale-BFoDCU3G.js","assets/init-C-OQMol4.js","assets/infoDiagram-6WML65LV-DCrOXTRX.js","assets/chunk-3NCLNEKW-CxJ1byyi.js","assets/pieDiagram-7S7Q4E2Y-DymmotfN.js","assets/ordinal-BDEzSJ7C.js","assets/arc-3UKfLtkz.js","assets/quadrantDiagram-CIZ2JOQS-Bdmf940A.js","assets/xychartDiagram-ELKLHX3M-BXEvabM_.js","assets/requirementDiagram-LRYGKXZP-DOQHap5a.js","assets/sequenceDiagram-SI44F4Z6-DZz8CoAK.js","assets/classDiagram-JCYQIIEL-BGtYH_yr.js","assets/chunk-GF5L2VYU-eIwojrcb.js","assets/classDiagram-v2-OCEON4UE-BGtYH_yr.js","assets/stateDiagram-OKZ733FA-Diw1faox.js","assets/graphlib-DS17s2tU.js","assets/dagre-Buvkdvvj.js","assets/map-BaFkSB1l.js","assets/chunk-5RXB4S5H-Bz8imepf.js","assets/stateDiagram-v2-UEYNNEHI-CL8rTg3I.js","assets/journeyDiagram-NVQOT4AX-DjG_Ivem.js","assets/timeline-definition-Z64GVDOM-CeZF9jb3.js","assets/mindmap-definition-FAOFIHXS-B-zxlH-3.js","assets/kanban-definition-27J2QSJJ-DcHXIYS7.js","assets/sankeyDiagram-W5VNT64P-Bw_JjJMs.js","assets/diagram-LBJQPF4R-DX9fn8uM.js","assets/diagram-UB23O5K3-DN2WW8Lf.js","assets/blockDiagram-VBNYF7ZC-DI8mHgDh.js","assets/diagram-7IWD3JNH-CntAMELi.js","assets/architectureDiagram-T3A2C74G-BRtUBpl-.js","assets/cytoscape.esm-B-NFISlW.js","assets/diagram-B4RE2ZJO-CzK0s5lu.js","assets/ishikawaDiagram-WSZJBQD7-Eprw_Axw.js","assets/vennDiagram-T6HMQDX7-Bea6zExh.js","assets/diagram-Q27KOJAE-__XgFhkl.js","assets/wardleyDiagram-T6FBY63Y-fLVlb6T8.js","assets/cynefinDiagram-MW4NZA55-BkWmLTXz.js","assets/railroadDiagram-AXF67PYL-C2_yAAm1.js","assets/chunk-6Q2QTUOP-UdMAlPWh.js","assets/ebnfDiagram-BXEA7PRR-BUzfFfXM.js","assets/abnfDiagram-N423BO3Z-BXLvdit9.js","assets/pegDiagram-VL7TDLO6-CCulIlRS.js"])))=>i.map(i=>d[i]);
import{a as e,i as t,n,r}from"./rolldown-runtime-B0Z9INg1.js";import{i,n as a,r as o}from"./bundle-mjs-fcjm5Rpo.js";import{t as s}from"./react-dom-tvCQ6jCF.js";import{n as c,t as l}from"./utils-C1dPOAK7.js";import{C as u,S as d,T as f,_ as p,b as m,c as h,d as g,f as _,g as v,h as y,i as b,l as x,m as S,n as C,o as w,p as T,r as ee,s as E,u as te,v as ne,w as D,x as re,y as O}from"./theme-Dll-6lIc.js";import{t as k}from"./preload-helper-BGRGm2aY.js";import{t as ie}from"./katex-ukvJUC1e.js";import{n as A}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{h as ae,m as j,p as oe}from"./src-BY_WSiz7.js";import{$ as se,C as ce,E as le,I as ue,L as de,N as fe,P as pe,Q as me,S as he,T as ge,V as _e,W as ve,X as ye,Z as be,_ as xe,b as Se,c as Ce,g as we,l as Te,m as Ee,n as De,p as Oe,q as ke,r as Ae,t as je,u as Me}from"./chunk-I66GZJ75-DyIufBk3.js";import{S as Ne,a as Pe,f as Fe,g as Ie,h as Le,i as Re,o as ze,v as Be,x as Ve,y as He}from"./chunk-NSK5VX7P-C5rgTOqf.js";import{t as Ue}from"./chunk-3NCLNEKW-CxJ1byyi.js";import{r as We}from"./chunk-4I5QYGJK-CqcwRbfk.js";import{r as Ge}from"./chunk-WRU74C26-BTfK14t9.js";import"./chunk-7BUUIJ7U-Bb538aSH.js";import"./chunk-UBXNYLIW-D4IRhP65.js";import"./chunk-W5SLKNZC-Bwa0Erac.js";import"./chunk-QR6OTTB3-Gf6zEt7G.js";import"./chunk-7Z6QIM7H-C8-Xmgc1.js";import{n as Ke}from"./chunk-J7OUQ5F2-B_bnfxd4.js";import{n as qe,t as Je}from"./chunk-ZIRB5QZD-O39ZBUk3.js";import{C as Ye,D as Xe,E as Ze,O as Qe,S as $e,_ as et,b as tt,c as nt,d as rt,f as it,g as at,h as ot,k as st,l as ct,m as lt,o as ut,p as dt,r as ft,s as pt,u as mt,v as ht,w as gt,x as _t,y as vt}from"./chunk-BO2N2NFS-D9GzoDA1.js";import{c as yt,d as bt,i as xt,l as St,n as Ct,o as wt,s as Tt,t as Et,u as Dt}from"./access-control-D86mfb14.js";function Ot(e){let t=e?.constructor;return e===(typeof t==`function`?t.prototype:Object.prototype)}function kt(e){if(e==null)return!0;if(Ve(e))return typeof e.splice!=`function`&&typeof e!=`string`&&!Ne(e)&&!Be(e)&&!He(e)?!1:e.length===0;if(typeof e==`object`||typeof e==`function`){if(e instanceof Map||e instanceof Set)return e.size===0;let t=Object.keys(e);return Ot(e)?t.filter(e=>e!==`constructor`).length===0:t.length===0}return!0}var At=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),jt=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Mt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Nt=e=>{let t=Mt(e);return t.charAt(0).toUpperCase()+t.slice(1)},Pt={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},Ft=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},M=e(i()),It=(0,M.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,M.createElement)(`svg`,{ref:c,...Pt,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:At(`lucide`,i),...!a&&!Ft(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,M.createElement)(e,t)),...Array.isArray(a)?a:[a]])),N=(e,t)=>{let n=(0,M.forwardRef)(({className:n,...r},i)=>(0,M.createElement)(It,{ref:i,iconNode:t,className:At(`lucide-${jt(Nt(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Nt(e),n},Lt=N(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Rt=N(`badge-dollar-sign`,[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]),zt=N(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Bt=N(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Vt=N(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Ht=N(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Ut=N(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Wt=N(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Gt=N(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),Kt=N(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),qt=N(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Jt=N(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Yt=N(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Xt=N(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Zt=N(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Qt=N(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),$t=N(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),en=N(`message-square-text`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]),tn=N(`message-square-warning`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 15h.01`,key:`q59x07`}],[`path`,{d:`M12 7v4`,key:`xawao1`}]]),nn=N(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),rn=N(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),an=N(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),on=N(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),sn=N(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),cn=N(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),ln=N(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),un=N(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),dn=N(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),fn=N(`sparkle`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}]]),pn=N(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),mn=N(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),hn=N(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),gn=N(`trending-up`,[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]),_n=N(`wallet`,[[`path`,{d:`M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1`,key:`18etb6`}],[`path`,{d:`M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4`,key:`xoc0q4`}]]),vn=N(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),yn=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,bn=a,xn=(e,t)=>n=>{if(t?.variants==null)return bn(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=yn(t)||yn(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return bn(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},P=o(),Sn=xn(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground shadow hover:bg-primary/90`,destructive:`bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90`,outline:`border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2`,sm:`h-8 rounded-md px-3 text-xs`,lg:`h-10 rounded-md px-8`,icon:`h-9 w-9`,"icon-sm":`h-8 w-8`}},defaultVariants:{variant:`default`,size:`default`}}),Cn=M.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,P.jsx)(r?re:`button`,{className:l(Sn({variant:t,size:n,className:e})),ref:a,...i}));Cn.displayName=`Button`;var wn={damping:.7,stiffness:.05,mass:1.25},Tn=70,En=1e3/60,Dn=350,On=!1;globalThis.document?.addEventListener(`mousedown`,()=>{On=!0}),globalThis.document?.addEventListener(`mouseup`,()=>{On=!1}),globalThis.document?.addEventListener(`click`,()=>{On=!1});var kn=(e={})=>{let[t,n]=(0,M.useState)(!1),[r,i]=(0,M.useState)(e.initial!==!1),[a,o]=(0,M.useState)(!1),s=(0,M.useRef)(null);s.current=e;let c=(0,M.useCallback)(()=>{if(!On)return!1;let e=window.getSelection();if(!e||!e.rangeCount)return!1;let t=e.getRangeAt(0);return t.commonAncestorContainer.contains(g.current)||g.current?.contains(t.commonAncestorContainer)},[]),l=(0,M.useCallback)(e=>{d.isAtBottom=e,i(e)},[]),u=(0,M.useCallback)(e=>{d.escapedFromLock=e,n(e)},[]),d=(0,M.useMemo)(()=>{let n;return{escapedFromLock:t,isAtBottom:r,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return g.current?.scrollTop??0},set scrollTop(e){if(g.current){let{scrollBehavior:t}=getComputedStyle(g.current);t!==`auto`&&(g.current.style.scrollBehavior=`auto`),g.current.scrollTop=e,d.ignoreScrollToTop=g.current.scrollTop,t!==`auto`&&(g.current.style.scrollBehavior=t)}},get targetScrollTop(){return!g.current||!_.current?0:g.current.scrollHeight-1-g.current.clientHeight},get calculatedTargetScrollTop(){if(!g.current||!_.current)return 0;let{targetScrollTop:t}=this;if(!e.targetScrollTop)return t;if(n?.targetScrollTop===t)return n.calculatedScrollTop;let r=Math.max(Math.min(e.targetScrollTop(t,{scrollElement:g.current,contentElement:_.current}),t),0);return n={targetScrollTop:t,calculatedScrollTop:r},requestAnimationFrame(()=>{n=void 0}),r},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Tn}}},[]),f=(0,M.useCallback)((e={})=>{typeof e==`string`&&(e={animation:e}),e.preserveScrollPosition||l(!0);let t=Date.now()+(Number(e.wait)||0),n=Mn(s.current,e.animation),{ignoreEscapes:r=!1}=e,i,a=d.calculatedTargetScrollTop;e.duration instanceof Promise?e.duration.finally(()=>{i=Date.now()}):i=t+(e.duration??0);let o=async()=>{let e=new Promise(requestAnimationFrame).then(()=>{if(!d.isAtBottom)return d.animation=void 0,!1;let{scrollTop:l}=d,u=performance.now(),p=(u-(d.lastTick??u))/En;if(d.animation||={behavior:n,promise:e,ignoreEscapes:r},d.animation.behavior===n&&(d.lastTick=u),c()||t>Date.now())return o();if(l<Math.min(a,d.calculatedTargetScrollTop)){if(d.animation?.behavior===n){if(n===`instant`)return d.scrollTop=d.calculatedTargetScrollTop,o();d.velocity=(n.damping*d.velocity+n.stiffness*d.scrollDifference)/n.mass,d.accumulated+=d.velocity*p,d.scrollTop+=d.accumulated,d.scrollTop!==l&&(d.accumulated=0)}return o()}return i>Date.now()?(a=d.calculatedTargetScrollTop,o()):(d.animation=void 0,d.scrollTop<d.calculatedTargetScrollTop?f({animation:Mn(s.current,s.current.resize),ignoreEscapes:r,duration:Math.max(0,i-Date.now())||void 0}):d.isAtBottom)});return e.then(e=>(requestAnimationFrame(()=>{d.animation||(d.lastTick=void 0,d.velocity=0)}),e))};return e.wait!==!0&&(d.animation=void 0),d.animation?.behavior===n?d.animation.promise:o()},[l,c,d]),p=(0,M.useCallback)(()=>{u(!0),l(!1)},[u,l]),m=(0,M.useCallback)(({target:e})=>{if(e!==g.current)return;let{scrollTop:t,ignoreScrollToTop:n}=d,{lastScrollTop:r=t}=d;d.lastScrollTop=t,d.ignoreScrollToTop=void 0,n&&n>t&&(r=n),o(d.isNearBottom),setTimeout(()=>{if(d.resizeDifference||t===n)return;if(c()){u(!0),l(!1);return}let e=t>r,i=t<r;if(d.animation?.ignoreEscapes){d.scrollTop=r;return}i&&(u(!0),l(!1)),e&&u(!1),!d.escapedFromLock&&d.isNearBottom&&l(!0)},1)},[u,l,c,d]),h=(0,M.useCallback)(({target:e,deltaY:t})=>{let n=e;for(;![`scroll`,`auto`].includes(getComputedStyle(n).overflow);){if(!n.parentElement)return;n=n.parentElement}n===g.current&&t<0&&g.current.scrollHeight>g.current.clientHeight&&!d.animation?.ignoreEscapes&&(u(!0),l(!1))},[u,l,d]),g=An(e=>{g.current?.removeEventListener(`scroll`,m),g.current?.removeEventListener(`wheel`,h),e?.addEventListener(`scroll`,m,{passive:!0}),e?.addEventListener(`wheel`,h,{passive:!0})},[]),_=An(e=>{if(d.resizeObserver?.disconnect(),d.resizeObserver=void 0,!e)return;let t;d.resizeObserver=new ResizeObserver(([e])=>{let{height:n}=e.contentRect,r=n-(t??n);if(d.resizeDifference=r,d.scrollTop>d.targetScrollTop&&(d.scrollTop=d.targetScrollTop),o(d.isNearBottom),r>=0){let e=Mn(s.current,t?s.current.resize:s.current.initial);f({animation:e,wait:!0,preserveScrollPosition:!0,duration:e===`instant`?void 0:Dn})}else d.isNearBottom&&(u(!1),l(!0));t=n,requestAnimationFrame(()=>{setTimeout(()=>{d.resizeDifference===r&&(d.resizeDifference=0)},1)})}),d.resizeObserver?.observe(e)},[]);return{contentRef:_,scrollRef:g,scrollToBottom:f,stopScroll:p,isAtBottom:r||a,isNearBottom:a,escapedFromLock:t,state:d}};function An(e,t){let n=(0,M.useCallback)(t=>(n.current=t,e(t)),t);return n}var jn=new Map;function Mn(...e){let t={...wn},n=!1;for(let r of e){if(r===`instant`){n=!0;continue}typeof r==`object`&&(n=!1,t.damping=r.damping??t.damping,t.stiffness=r.stiffness??t.stiffness,t.mass=r.mass??t.mass)}let r=JSON.stringify(t);return jn.has(r)||jn.set(r,Object.freeze(t)),n?`instant`:jn.get(r)}var Nn=(0,M.createContext)(null),Pn=typeof window<`u`?M.useLayoutEffect:M.useEffect;function Fn({instance:e,children:t,resize:n,initial:r,mass:i,damping:a,stiffness:o,targetScrollTop:s,contextRef:c,...l}){let u=(0,M.useRef)(null),d=kn({mass:i,damping:a,stiffness:o,resize:n,initial:r,targetScrollTop:M.useCallback((e,t)=>(y?.targetScrollTop??s)?.(e,t)??e,[s])}),{scrollRef:f,contentRef:p,scrollToBottom:m,stopScroll:h,isAtBottom:g,escapedFromLock:_,state:v}=e??d,y=(0,M.useMemo)(()=>({scrollToBottom:m,stopScroll:h,scrollRef:f,isAtBottom:g,escapedFromLock:_,contentRef:p,state:v,get targetScrollTop(){return u.current},set targetScrollTop(e){u.current=e}}),[m,g,p,f,h,_,v]);return(0,M.useImperativeHandle)(c,()=>y,[y]),Pn(()=>{f.current&&getComputedStyle(f.current).overflow===`visible`&&(f.current.style.overflow=`auto`)},[]),M.createElement(Nn.Provider,{value:y},M.createElement(`div`,{...l},typeof t==`function`?t(y):t))}(function(e){function t({children:e,scrollClassName:t,...n}){let r=In();return M.createElement(`div`,{ref:r.scrollRef,style:{height:`100%`,width:`100%`,scrollbarGutter:`stable both-edges`},className:t},M.createElement(`div`,{...n,ref:r.contentRef},typeof e==`function`?e(r):e))}e.Content=t})(Fn||={});function In(){let e=(0,M.useContext)(Nn);if(!e)throw Error(`use-stick-to-bottom component context must be used within a StickToBottom component`);return e}var Ln=({className:e,...t})=>(0,P.jsx)(Fn,{className:l(`relative flex-1 overflow-y-hidden`,e),initial:`smooth`,resize:`smooth`,role:`log`,...t}),Rn=({className:e,...t})=>(0,P.jsx)(Fn.Content,{className:l(`flex flex-col gap-8 p-4`,e),...t}),zn=({className:e,...t})=>{let{isAtBottom:n,scrollToBottom:r}=In(),i=(0,M.useCallback)(()=>{r()},[r]);return!n&&(0,P.jsx)(Cn,{className:l(`absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted`,e),onClick:i,size:`icon`,type:`button`,variant:`outline`,...t,children:(0,P.jsx)(Lt,{className:`size-4`})})},F={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533},Bn={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:`CDATA[`,characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:`content`,contentTypeDocument:`document`,contentTypeFlow:`flow`,contentTypeString:`string`,contentTypeText:`text`,hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4},Vn={data:`data`,whitespace:`whitespace`,lineEnding:`lineEnding`,lineEndingBlank:`lineEndingBlank`,linePrefix:`linePrefix`,lineSuffix:`lineSuffix`,atxHeading:`atxHeading`,atxHeadingSequence:`atxHeadingSequence`,atxHeadingText:`atxHeadingText`,autolink:`autolink`,autolinkEmail:`autolinkEmail`,autolinkMarker:`autolinkMarker`,autolinkProtocol:`autolinkProtocol`,characterEscape:`characterEscape`,characterEscapeValue:`characterEscapeValue`,characterReference:`characterReference`,characterReferenceMarker:`characterReferenceMarker`,characterReferenceMarkerNumeric:`characterReferenceMarkerNumeric`,characterReferenceMarkerHexadecimal:`characterReferenceMarkerHexadecimal`,characterReferenceValue:`characterReferenceValue`,codeFenced:`codeFenced`,codeFencedFence:`codeFencedFence`,codeFencedFenceSequence:`codeFencedFenceSequence`,codeFencedFenceInfo:`codeFencedFenceInfo`,codeFencedFenceMeta:`codeFencedFenceMeta`,codeFlowValue:`codeFlowValue`,codeIndented:`codeIndented`,codeText:`codeText`,codeTextData:`codeTextData`,codeTextPadding:`codeTextPadding`,codeTextSequence:`codeTextSequence`,content:`content`,definition:`definition`,definitionDestination:`definitionDestination`,definitionDestinationLiteral:`definitionDestinationLiteral`,definitionDestinationLiteralMarker:`definitionDestinationLiteralMarker`,definitionDestinationRaw:`definitionDestinationRaw`,definitionDestinationString:`definitionDestinationString`,definitionLabel:`definitionLabel`,definitionLabelMarker:`definitionLabelMarker`,definitionLabelString:`definitionLabelString`,definitionMarker:`definitionMarker`,definitionTitle:`definitionTitle`,definitionTitleMarker:`definitionTitleMarker`,definitionTitleString:`definitionTitleString`,emphasis:`emphasis`,emphasisSequence:`emphasisSequence`,emphasisText:`emphasisText`,escapeMarker:`escapeMarker`,hardBreakEscape:`hardBreakEscape`,hardBreakTrailing:`hardBreakTrailing`,htmlFlow:`htmlFlow`,htmlFlowData:`htmlFlowData`,htmlText:`htmlText`,htmlTextData:`htmlTextData`,image:`image`,label:`label`,labelText:`labelText`,labelLink:`labelLink`,labelImage:`labelImage`,labelMarker:`labelMarker`,labelImageMarker:`labelImageMarker`,labelEnd:`labelEnd`,link:`link`,paragraph:`paragraph`,reference:`reference`,referenceMarker:`referenceMarker`,referenceString:`referenceString`,resource:`resource`,resourceDestination:`resourceDestination`,resourceDestinationLiteral:`resourceDestinationLiteral`,resourceDestinationLiteralMarker:`resourceDestinationLiteralMarker`,resourceDestinationRaw:`resourceDestinationRaw`,resourceDestinationString:`resourceDestinationString`,resourceMarker:`resourceMarker`,resourceTitle:`resourceTitle`,resourceTitleMarker:`resourceTitleMarker`,resourceTitleString:`resourceTitleString`,setextHeading:`setextHeading`,setextHeadingText:`setextHeadingText`,setextHeadingLine:`setextHeadingLine`,setextHeadingLineSequence:`setextHeadingLineSequence`,strong:`strong`,strongSequence:`strongSequence`,strongText:`strongText`,thematicBreak:`thematicBreak`,thematicBreakSequence:`thematicBreakSequence`,blockQuote:`blockQuote`,blockQuotePrefix:`blockQuotePrefix`,blockQuoteMarker:`blockQuoteMarker`,blockQuotePrefixWhitespace:`blockQuotePrefixWhitespace`,listOrdered:`listOrdered`,listUnordered:`listUnordered`,listItemIndent:`listItemIndent`,listItemMarker:`listItemMarker`,listItemPrefix:`listItemPrefix`,listItemPrefixWhitespace:`listItemPrefixWhitespace`,listItemValue:`listItemValue`,chunkDocument:`chunkDocument`,chunkContent:`chunkContent`,chunkFlow:`chunkFlow`,chunkText:`chunkText`,chunkString:`chunkString`},Hn=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Un=[12288,12288,65281,65376,65504,65510],Wn=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Gn=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Kn=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],qn=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},Jn=19968,[Yn,Xn]=Zn(Kn);function Zn(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(Jn>=i&&Jn<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}var Qn=e=>e<161||e>1114109?!1:qn(Hn,e),$n=e=>e<12288||e>65510?!1:qn(Un,e),er=e=>e<8361||e>65518?!1:qn(Wn,e),tr=e=>e<32||e>10630?!1:qn(Gn,e),nr=e=>e>=Yn&&e<=Xn?!0:e<4352||e>262141?!1:qn(Kn,e);function rr(e){return Qn(e)?`ambiguous`:$n(e)?`fullwidth`:er(e)?`halfwidth`:tr(e)?`narrow`:nr(e)?`wide`:`neutral`}function ir(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function ar(e){return ir(e),rr(e)}function or(e){return/^\p{Emoji_Presentation}/u.test(String.fromCodePoint(e))}function sr(e){if(!e||e<4352)return!1;switch(ar(e)){case`fullwidth`:case`halfwidth`:return!0;case`wide`:return!or(e);case`narrow`:return!1;case`ambiguous`:return 917760<=e&&e<=917999&&null;case`neutral`:return/^\p{sc=Hangul}/u.test(String.fromCodePoint(e))}}function cr(e,t){return t!==65025||!e||e<8216?!1:e===8216||e===8217||e===8220||e===8221}function lr(e){return e!==null&&e>=65024&&e<=65038}var ur=fr(/\p{P}|\p{S}/u),dr=fr(/\s/);function fr(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCodePoint(t))}}function I(e){return!!(e&Bn.characterGroupWhitespace)}function pr(e){return(e&yr.cjkPunctuation)===Bn.characterGroupPunctuation}function mr(e){return!!(e&yr.cjk)}function hr(e){return e===yr.ivs}function gr(e){return!!(e&yr.cjkOrIvs)}function _r(e){return e===yr.nonEmojiGeneralUseVS}function vr(e){return!!(e&yr.spaceOrPunctuation)}var yr;(function(e){e.spaceOrPunctuation=3,e.cjk=4096,e.cjkPunctuation=4098,e.ivs=8192,e.cjkOrIvs=12288,e.nonEmojiGeneralUseVS=16384,e.variationSelector=24576,e.ivsToCjkRightShift=1})(yr||={});function br(e){if(e===F.eof||dt(e)||dr(e))return Bn.characterGroupWhitespace;let t=0;if(e>=4352){if(lr(e))return yr.nonEmojiGeneralUseVS;switch(sr(e)){case null:return yr.ivs;case!0:t|=yr.cjk}}return ur(e)&&(t|=Bn.characterGroupPunctuation),t}function xr(e,t,n){if(!_r(e))return e;let r=t(),i=br(r);return!r||I(i)?e:cr(r,n)?yr.cjkPunctuation:Sr(i)}function Sr(e){return e&~yr.ivs}function Cr(e){return!!(e&&e>=55296&&e<=56319)}function wr(e){return!!(e&&e>=56320&&e<=57343)}function Tr(e,t,n){if(t._bufferIndex<2)return e;let r=n({start:{...t,_bufferIndex:t._bufferIndex-2},end:t}).codePointAt(0);return r&&r>=65536?r:e}function Er(e,t,n){let r=e>=65536?2:1;if(t._bufferIndex<1+r)return null;let i=t._bufferIndex-r-2,a=n({start:{...t,_bufferIndex:i>=0?i:0},end:{...t,_bufferIndex:t._bufferIndex-r}}),o=a.charCodeAt(a.length-1);if(Number.isNaN(o))return null;if(a.length<2||o<56320||57343<o)return o;let s=a.codePointAt(0);return s&&s>=65536?s:o}var Dr=class{cachedValue=void 0;constructor(e,t,n){this.previousCode=e,this.nowPoint=t,this.sliceSerialize=n}value(){return this.cachedValue===void 0&&(this.cachedValue=Er(this.previousCode,this.nowPoint,this.sliceSerialize)),this.cachedValue}};function Or(e,t,n){let r=n({start:t,end:{...t,_bufferIndex:t._bufferIndex+2}}).codePointAt(0);return r&&r>=65536?r:e}var kr={name:`attention`,resolveAll:Ar,tokenize:jr};function Ar(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Mr(d,-c),Mr(f,c),o={type:c>1?Vn.strongSequence:Vn.emphasisSequence,start:d,end:{...e[r][1].end}},s={type:c>1?Vn.strongSequence:Vn.emphasisSequence,start:{...e[n][1].start},end:f},a={type:c>1?Vn.strongText:Vn.emphasisText,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?Vn.strong:Vn.emphasis,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=ct(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=ct(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),t.parser.constructs.insideSpan.null,l=ct(l,nt(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=ct(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=ct(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,mt(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function jr(e,t){let n=this.parser.constructs.attentionMarkers.null,{now:r,sliceSerialize:i,previous:a}=this,o=wr(a)?Tr(a,r(),i):a,s=br(o),c=new Dr(o,r(),i),l=xr(s,c.value.bind(c),o),u;return d;function d(t){return t===F.asterisk||F.underscore,u=t,e.enter(`attentionSequence`),f(t)}function f(a){if(a===u)return e.consume(a),f;let s=e.exit(`attentionSequence`),c=br(Cr(a)?Or(a,r(),i):a),d=pr(l),p=d||I(l),m=pr(c),h=m||I(c),g=gr(l),_=!h||m&&(p||g)||n.includes(a),v=!p||d&&(h||mr(c))||n.includes(o);return s._open=!!(u===F.asterisk?_:_&&(vr(l)||!v)),s._close=!!(u===F.asterisk?v:v&&(vr(c)||!_)),t(a)}}function Mr(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}function Nr(){return{text:{[F.asterisk]:kr,[F.underscore]:kr},insideSpan:{null:[kr]}}}function Pr(){let e=this.data();(e.micromarkExtensions||=[]).push(Nr())}var Fr=`;`.codePointAt(0)??F.eof,Ir=`&`.codePointAt(0)??F.eof;function Lr(){return{handlers:{emphasis:Rr,strong:zr,text:Ur}}}Rr.peek=Br,zr.peek=Vr;function Rr(e,t,n,r){return Hr(e,t,n,r,Br(e,t,n),1)}function zr(e,t,n,r){return Hr(e,t,n,r,Vr(e,t,n),2)}function Br(e,t,n){return n.options.emphasis||`*`}function Vr(e,t,n){return n.options.strong||`*`}function Hr(e,t,n,r,i,a){let o=i.repeat(a),s=n.enter(a===1?`emphasis`:`strong`),c=n.createTracker(r),l=c.move(o),u=c.move(n.containerPhrasing(e,{after:i,before:l,...c.current()})),d=Zr(e,t,n,r.before),f=Qr(e,t,n,r.after),p=Wr(d,ui(u),i,`open`);p.inside&&u&&(u=si(u));let m=Wr({current:di(u),previous:li(u)},f,i,`close`);m.inside&&u&&(u=ci(u));let h=c.move(o);s();let g=m.outside&&ri(t,n);return n.attentionEncodeSurroundingInfo={after:m.outside&&!g,before:p.outside},ii(n).cjkFriendlyEncodeAfterSupplementaryText=g,l+u+h}function Ur(e,t,n,r){let i=ii(n);if(!i.cjkFriendlyEncodeAfterSupplementaryText)return n.safe(e.value,r);i.cjkFriendlyEncodeAfterSupplementaryText=!1;let[a=``]=[...e.value],o=e.value.slice(a.length);return`${oi(a.codePointAt(0)??F.eof)}${n.safe(o,{...r,before:`;`})}`}function Wr(e,t,n,r){let i=Xr(e),a=br(t);if(!gr(i)&&!gr(a))return r===`open`?Gr(i,a,n):Gr(a,i,n);let o={inside:!1,outside:!1},s={inside:!0,outside:!1},c={inside:!1,outside:!0},l={inside:!0,outside:!0};for(let i of[o,s,c,l]){let a=r===`open`?i.outside?fi:e:i.inside?fi:e,o=r===`open`?i.inside?pi:t:i.outside?pi:t;if(r===`open`?Kr(n,a,o):qr(n,a,o))return i}return l}function Gr(e,t,n){return Yr(e)?Yr(t)?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:I(t)?{inside:!0,outside:!0}:{inside:!1,outside:!0}:I(e)?Yr(t)?{inside:!1,outside:!1}:I(t)?{inside:!0,outside:!0}:{inside:!1,outside:!1}:I(t)?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function Kr(e,t,n){let r=Xr(t),{close:i,open:a}=Jr(r,br(n));return e===`_`?a&&(vr(r)||!i):a}function qr(e,t,n){let r=br(n),{close:i,open:a}=Jr(Xr(t),r);return e===`_`?i&&(vr(r)||!a):i}function Jr(e,t){let n=pr(e),r=n||I(e),i=pr(t),a=i||I(t);return{open:!a||i&&(r||gr(e)),close:!r||n&&(a||mr(t))}}function Yr(e){return!I(e)&&!pr(e)}function Xr(e){let t=br(e.current);return e.current===null||!_r(t)?t:xr(t,()=>e.previous,e.current)}function Zr(e,t,n,r){let i=di(r),a=li(r);if($r(i)||ti(i,a)){let r=ni(e,t,n,-1);r&&(i=di(r),a=li(r))}return{current:i,previous:a}}function Qr(e,t,n,r){let i=ui(r);if(!ei(i))return i;let a=ni(e,t,n,1);return a?ui(a):i}function $r(e){return e!==null&&56320<=e&&e<=57343}function ei(e){return e!==null&&55296<=e&&e<=56319}function ti(e,t){return _r(br(e))&&(t===null||t===F.eof)}function ni(e,t,n,r){if(!t)return;let i=n.indexStack.at(-1),a=t.children,o=typeof i==`number`?i:a.indexOf(e);if(o<0)return;let s=a[o+r];return ai(s)||void 0}function ri(e,t){if(!e)return!1;let n=t.indexStack.at(-1);if(typeof n!=`number`)return!1;let r=e.children[n+1];return r?.type===`text`&&(ui(r.value)??0)>65535}function ii(e){return e}function ai(e){return!e||typeof e!=`object`?``:`value`in e&&typeof e.value==`string`?e.value:`alt`in e&&typeof e.alt==`string`?e.alt:`children`in e&&Array.isArray(e.children)?e.children.map(ai).join(``):``}function oi(e){return`&#x${(e??0).toString(16).toUpperCase()};`}function si(e){let[t=``]=[...e];return oi(t.codePointAt(0)??F.eof)+e.slice(t.length)}function ci(e){let t=[...e],n=t.pop();return`${t.join(``)}${oi(n?.codePointAt(0)??F.eof)}`}function li(e){let t=[...e];return t.pop(),t.at(-1)?.codePointAt(0)??F.eof}function ui(e){return e.codePointAt(0)??F.eof}function di(e){return[...e].at(-1)?.codePointAt(0)??F.eof}var fi={current:Fr,previous:F.eof},pi=Ir;function mi(){let e=this.data();(e.toMarkdownExtensions||=[]).push(Lr())}function hi(){Pr.call(this),mi.call(this)}var gi=hi;function _i(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{[F.tilde]:n},insideSpan:{null:[n]},attentionMarkers:{null:[F.tilde]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&mt(o,o.length,0,nt(s,e.slice(r+1,n),t)),mt(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),mt(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=Vn.data);return e}function i(e,n,r){let{now:i,sliceSerialize:a,previous:o}=this,s=wr(o)?Tr(o,i(),a):o,c=br(s),l=new Dr(s,i(),a),u=xr(c,l.value.bind(l),s),d=this.events,f=0;return p;function p(t){return F.tilde,s===F.tilde&&d[d.length-1][1].type!==Vn.characterEscape?r(t):(e.enter(`strikethroughSequenceTemporary`),m(t))}function m(o){let c=br(s);if(o===F.tilde)return f>1?r(o):(e.consume(o),f++,m);if(f<2&&!t)return r(o);let l=e.exit(`strikethroughSequenceTemporary`),d=br(Cr(o)?Or(o,i(),a):o),p=pr(u)||I(u),h=pr(d)||I(d),g=mr(u)||hr(c);return l._open=!h||d===Bn.attentionSideAfter&&(p||g),l._close=!p||c===Bn.attentionSideAfter&&(h||mr(d)),n(o)}}}function vi(e){let t=this.data();(t.micromarkExtensions||=[]).push(_i(e))}var yi=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],bi=`;`.codePointAt(0)??F.eof,xi=`&`.codePointAt(0)??F.eof;function Si(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:yi}],handlers:{delete:Ci,text:wi}}}Ci.peek=Ti;function Ci(e,t,n,r){let i=n.enter(`strikethrough`),a=n.createTracker(r),o=a.move(`~~`),s=a.move(n.containerPhrasing(e,{after:`~`,before:o,...a.current()})),c=Ni(e,t,n,r.before),l=Pi(e,t,n,r.after),u=Ei(c,Ki(s),`open`);u.inside&&s&&(s=Ui(s));let d=Ei({current:qi(s),previous:Gi(s)},l,`close`);d.inside&&s&&(s=Wi(s));let f=a.move(`~~`);i();let p=d.outside&&zi(t,n);return n.attentionEncodeSurroundingInfo={after:d.outside&&!p,before:u.outside},Bi(n).cjkFriendlyEncodeAfterSupplementaryText=p,o+s+f}function wi(e,t,n,r){let i=Bi(n);if(!i.cjkFriendlyEncodeAfterSupplementaryText)return n.safe(e.value,r);i.cjkFriendlyEncodeAfterSupplementaryText=!1;let[a=``]=[...e.value],o=e.value.slice(a.length);return`${Hi(a.codePointAt(0)??F.eof)}${n.safe(o,{...r,before:`;`})}`}function Ti(){return`~`}function Ei(e,t,n){let r=Mi(e),i=br(t);if(!gr(r)&&!gr(i))return n===`open`?Di(r,i):Di(i,r);let a={inside:!1,outside:!1},o={inside:!0,outside:!1},s={inside:!1,outside:!0},c={inside:!0,outside:!0};for(let r of[a,o,s,c]){let i=n===`open`?r.outside?Ji:e:r.inside?Ji:e,a=n===`open`?r.inside?Yi:t:r.outside?Yi:t;if(n===`open`?Oi(i,a):ki(i,a))return r}return c}function Di(e,t){return ji(e)?ji(t)?{inside:!1,outside:!1}:I(t)?{inside:!0,outside:!0}:{inside:!1,outside:!0}:I(e)?ji(t)?{inside:!1,outside:!1}:I(t)?{inside:!0,outside:!0}:{inside:!1,outside:!1}:I(t)?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function Oi(e,t){let{open:n}=Ai(Mi(e),br(t));return n}function ki(e,t){let n=br(t),{close:r}=Ai(Mi(e),n);return r}function Ai(e,t){let n=pr(e),r=n||I(e),i=pr(t),a=i||I(t);return{open:!a||i&&(r||gr(e)),close:!r||n&&(a||mr(t))}}function ji(e){return!I(e)&&!pr(e)}function Mi(e){let t=br(e.current);return e.current===null||!_r(t)?t:xr(t,()=>e.previous,e.current)}function Ni(e,t,n,r){let i=qi(r),a=Gi(r);if(Fi(i)||Li(i,a)){let r=Ri(e,t,n,-1);r&&(i=qi(r),a=Gi(r))}return{current:i,previous:a}}function Pi(e,t,n,r){let i=Ki(r);if(!Ii(i))return i;let a=Ri(e,t,n,1);return a?Ki(a):i}function Fi(e){return e!==null&&56320<=e&&e<=57343}function Ii(e){return e!==null&&55296<=e&&e<=56319}function Li(e,t){return _r(br(e))&&(t===null||t===F.eof)}function Ri(e,t,n,r){if(!t)return;let i=n.indexStack.at(-1),a=t.children,o=typeof i==`number`?i:a.indexOf(e);if(o<0)return;let s=a[o+r];return Vi(s)||void 0}function zi(e,t){if(!e)return!1;let n=t.indexStack.at(-1);if(typeof n!=`number`)return!1;let r=e.children[n+1];return r?.type===`text`&&(Ki(r.value)??0)>65535}function Bi(e){return e}function Vi(e){return!e||typeof e!=`object`?``:`value`in e&&typeof e.value==`string`?e.value:`alt`in e&&typeof e.alt==`string`?e.alt:`children`in e&&Array.isArray(e.children)?e.children.map(Vi).join(``):``}function Hi(e){return`&#x${(e??0).toString(16).toUpperCase()};`}function Ui(e){let[t=``]=[...e];return Hi(t.codePointAt(0)??F.eof)+e.slice(t.length)}function Wi(e){let t=[...e],n=t.pop();return`${t.join(``)}${Hi(n?.codePointAt(0)??F.eof)}`}function Gi(e){let t=[...e];return t.pop(),t.at(-1)?.codePointAt(0)??F.eof}function Ki(e){return e.codePointAt(0)??F.eof}function qi(e){return[...e].at(-1)?.codePointAt(0)??F.eof}var Ji={current:bi,previous:F.eof},Yi=xi;function Xi(){let e=this.data();(e.toMarkdownExtensions||=[]).push(Si())}function Zi(e){vi.call(this,e),Xi.call(this)}var Qi=Zi,$i=new Set([``,``,``,``,``,``,``,``,``,``,``,``,``,``,``,``,``,``,``,``]),ea=/^(https?:\/\/|mailto:|www\.)/i,ta=e=>{if(e.children.length!==1)return!1;let t=e.children[0];return t.type===`text`&&t.value===e.url},na=e=>{let t=0;for(let n of e){if($i.has(n))return t;t+=n.length}return null},ra=(e,t)=>({...t,url:e,children:[{type:`text`,value:e}]}),ia=e=>({type:`text`,value:e}),aa=()=>e=>{Ze(e,`link`,(e,t,n)=>{if(!n||typeof t!=`number`||!ta(e)||!ea.test(e.url))return;let r=na(e.url);if(r===null||r===0)return;let i=e.url.slice(0,r),a=e.url.slice(r),o=ra(i,e),s=ia(a);return n.children.splice(t,1,o,s),t+1})};function oa(){let e=[gi],t=[aa,Qi];return{name:`cjk`,type:`cjk`,remarkPluginsBefore:e,remarkPluginsAfter:t,remarkPlugins:[...e,...t]}}var sa=oa(),L=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function ca(e){return la(e)}function la(e){return Array.isArray(e)?ua(e):e instanceof RegExp?e:typeof e==`object`?da(e):e}function ua(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=la(e[n]);return t}function da(e){let t={};for(let n in e)t[n]=la(e[n]);return t}function fa(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function pa(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?pa(e.substring(0,e.length-1)):e.substr(~t+1)}var ma=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,ha=class{static hasCaptures(e){return e!==null&&(ma.lastIndex=0,ma.test(e))}static replaceCaptures(e,t,n){return e.replace(ma,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function ga(e,t){return e<t?-1:+(e>t)}function _a(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=ga(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function va(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function ya(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var ba=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},xa=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Ea(e),t)}static createFromParsedTheme(e,t){return ka(e,t)}_cachedMatchRoot=new ba(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Ca(e.parent,t.parentScopes));return n?new Ta(n.fontStyle,n.foreground,n.background):null}},Sa=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Ca(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!wa(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function wa(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var Ta=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Ea(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&va(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&va(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new Da(l,u,e,o,s,c)}}return n}var Da=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},Oa=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(Oa||{});function ka(e,t){e.sort((e,t)=>{let n=ga(e.scope,t.scope);return n!==0||(n=_a(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new Aa(t),o=new Ta(n,a.getId(r),a.getId(i)),s=new Na(new Ma(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new xa(a,o,s)}var Aa=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},ja=Object.freeze([]),Ma=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||ja,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},Na=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),Ma.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(_a(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Ma(e,t,n,r,i))}},Pa=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=Ia(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function Fa(e){return e}function Ia(e){return e}function La(e,t){let n=[],r=za(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(Ra(i)){let e=[];do e.push(i),i=r.next();while(Ra(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function Ra(e){return!!e&&!!e.match(/[\w\.:]+/)}function za(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function Ba(e){typeof e.dispose==`function`&&e.dispose()}var Va=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Ha=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},Ua=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},Wa=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Va(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new Ua;for(let n of e)Ga(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof Va){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function Ga(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof Va?qa({baseGrammar:a,selfGrammar:i},r):Ka(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new Va(e))}function Ka(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];Ja([r],t,n)}}function qa(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Ja(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Ja(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Ja(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?fa({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Ja(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=eo(i);switch(a.kind){case 0:qa({...t,selfGrammar:t.baseGrammar},n);break;case 1:qa(t,n);break;case 2:Ka(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?Ka(a.ruleName,i,n):qa(i,n)}else a.kind===4?n.add(new Ha(a.scopeName,a.ruleName)):n.add(new Va(a.scopeName))}}}var Ya=class{kind=0},Xa=class{kind=1},Za=class{constructor(e){this.ruleName=e}kind=2},Qa=class{constructor(e){this.scopeName=e}kind=3},$a=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function eo(e){if(e===`$base`)return new Ya;if(e===`$self`)return new Xa;let t=e.indexOf(`#`);return t===-1?new Qa(e):t===0?new Za(e.substring(1)):new $a(e.substring(0,t),e.substring(t+1))}var to=/\\(\d+)/,no=/\\(\d+)/g,ro=-1,io=-2;function ao(e){return e}function oo(e){return e}var so=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=ha.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=ha.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${pa(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:ha.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:ha.replaceCaptures(this._contentName,e,t)}},co=class extends so{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},lo=class extends so{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new ho(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new go,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},uo=class extends so{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new go,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},fo=class extends so{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new ho(i,this.id),this.beginCaptures=a,this._end=new ho(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new go;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},po=class extends so{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new ho(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new ho(o,io),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new go;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new go,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},mo=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new co(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new lo(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=fa({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new uo(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new po(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new fo(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=eo(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof uo||e instanceof fo||e instanceof po)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},ho=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&to.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return no.lastIndex=0,this.source.replace(no,(e,t)=>ya(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=`￿`,t[i+1]=`￿`,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=`￿`,t[i+1]=`G`,n[i+1]=`￿`,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},go=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new _o(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new _o(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},_o=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},vo=class{constructor(e,t){this.languageId=e,this.tokenType=t}},yo=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new vo(e,8),this._embeddedLanguagesMatcher=new bo(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new vo(0,0);_getBasicScopeAttributes=new ba(e=>new vo(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},bo=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>ya(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var xo=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function So(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Co(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new xo(i,!0);f()}return new xo(i,!1);function f(){let o=wo(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===ro){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),ko(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof fo){let r=o;ko(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof po){let r=o;ko(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(ko(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Co(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof po&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=Oo(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==io){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),ko(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function wo(e,t,n,r,i,a){let o=To(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=Eo(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function To(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=Do(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Eo(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=Do(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Do(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Oo(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function ko(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));So(e,p,n&&d.start===0,d.start,f,i,!1,0),Ba(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new Ao(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var Ao=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function jo(e,t,n,r,i,a,o,s){return new Fo(e,t,n,r,i,a,o,s)}function Mo(e,t,n,r,i){let a=La(t,No),o=mo.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function No(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(Po(t[r],e))return n=r+1,!0;return!1})}function Po(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var Fo=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new yo(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Io(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=La(e,No);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)Mo(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&Mo(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(ao(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[oo(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Io(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=mo.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===Ro.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=Pa.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?Lo.createRootAndLookUpScopeName(a,r,this):Lo.createRoot(`unknown`,r),t=new Ro(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
`;let a=this.createOnigString(e),o=a.content.length,s=new Bo(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=So(this,a,i,0,t,s,!0,r);return Ba(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Io(e,t){return e=ca(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Lo=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=Sa.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Sa(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new Sa(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(!0)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),Pa.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},Ro=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?Lo.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:oo(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=Lo.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,ao(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Lo.fromExtension(r,n.contentNameScopesList))}},zo=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):La(e,No).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>La(e,No).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Bo=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=Pa.set(n,0,Fa(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=Pa.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},Vo=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,jo(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},Ho=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Vo(xa.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(xa.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new zo(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new Wa(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},Uo=Ro.NULL,Wo=/["&'<>`]/g,Go=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ko=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,qo=/[|\\{}()[\]^$+*?.]/g,Jo=new WeakMap;function Yo(e,t){if(e=e.replace(t.subset?Xo(t.subset):Wo,r),t.subset||t.escapeOnly)return e;return e.replace(Go,n).replace(Ko,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Xo(e){let t=Jo.get(e);return t||(t=Zo(e),Jo.set(e,t)),t}function Zo(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(qo,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var Qo=/[\dA-Fa-f]/;function $o(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!Qo.test(String.fromCharCode(t))?r:r+`;`}var es=/\d/;function ts(e,t,n){let r=`&#`+String(e);return n&&t&&!es.test(String.fromCharCode(t))?r:r+`;`}var ns=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),rs={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:``,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:``,hellip:``,prime:``,Prime:``,oline:``,frasl:``,weierp:``,image:``,real:``,trade:``,alefsym:``,larr:``,uarr:``,rarr:``,darr:``,harr:``,crarr:``,lArr:``,uArr:``,rArr:``,dArr:``,hArr:``,forall:``,part:``,exist:``,empty:``,nabla:``,isin:``,notin:``,ni:``,prod:``,sum:``,minus:``,lowast:``,radic:``,prop:``,infin:``,ang:``,and:``,or:``,cap:``,cup:``,int:``,there4:``,sim:``,cong:``,asymp:``,ne:``,equiv:``,le:``,ge:``,sub:``,sup:``,nsub:``,sube:``,supe:``,oplus:``,otimes:``,perp:``,sdot:``,lceil:``,rceil:``,lfloor:``,rfloor:``,lang:``,rang:``,loz:``,spades:``,clubs:``,hearts:``,diams:``,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:``,emsp:``,thinsp:``,zwnj:``,zwj:``,lrm:``,rlm:``,ndash:``,mdash:``,lsquo:``,rsquo:``,sbquo:``,ldquo:``,rdquo:``,bdquo:``,dagger:``,Dagger:``,permil:``,lsaquo:``,rsaquo:``,euro:``},is=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],as={}.hasOwnProperty,os={},ss;for(ss in rs)as.call(rs,ss)&&(os[rs[ss]]=ss);var cs=/[^\dA-Za-z]/;function ls(e,t,n,r){let i=String.fromCharCode(e);if(as.call(os,i)){let e=os[i],a=`&`+e;return n&&ns.includes(e)&&!is.includes(e)&&(!r||t&&t!==61&&cs.test(String.fromCharCode(t)))?a:a+`;`}return``}function us(e,t,n){let r=$o(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=ls(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=ts(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function ds(e,t){return Yo(e,Object.assign({format:us},t))}var fs=/^>|^->|<!--|-->|--!>|<!-$/g,ps=[`>`],ms=[`<`,`>`];function hs(e,t,n,r){return r.settings.bogusComments?`<?`+ds(e.value,Object.assign({},r.settings.characterReferences,{subset:ps}))+`>`:`<!--`+e.value.replace(fs,i)+`-->`;function i(e){return ds(e,Object.assign({},r.settings.characterReferences,{subset:ms}))}}function gs(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var R=ys(1),_s=ys(-1),vs=[];function ys(e){return t;function t(t,n,r){let i=t?t.children:vs,a=(n||0)+e,o=i[a];if(!r)for(;o&&ut(o);)a+=e,o=i[a];return o}}var bs={}.hasOwnProperty;function xs(e){return t;function t(t,n,r){return bs.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var Ss=xs({body:Ts,caption:Cs,colgroup:Cs,dd:ks,dt:Os,head:Cs,html:ws,li:Ds,optgroup:js,option:Ms,p:Es,rp:As,rt:As,tbody:Ps,td:Ls,tfoot:Fs,th:Ls,thead:Ns,tr:Is});function Cs(e,t,n){let r=R(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&ut(r.value.charAt(0)))}function ws(e,t,n){let r=R(n,t);return!r||r.type!==`comment`}function Ts(e,t,n){let r=R(n,t);return!r||r.type!==`comment`}function Es(e,t,n){let r=R(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function Ds(e,t,n){let r=R(n,t);return!r||r.type===`element`&&r.tagName===`li`}function Os(e,t,n){let r=R(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function ks(e,t,n){let r=R(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function As(e,t,n){let r=R(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function js(e,t,n){let r=R(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function Ms(e,t,n){let r=R(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function Ns(e,t,n){let r=R(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function Ps(e,t,n){let r=R(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function Fs(e,t,n){return!R(n,t)}function Is(e,t,n){let r=R(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function Ls(e,t,n){let r=R(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var Rs=xs({body:Vs,colgroup:Hs,head:Bs,html:zs,tbody:Us});function zs(e){let t=R(e,-1);return!t||t.type!==`comment`}function Bs(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function Vs(e){let t=R(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&ut(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function Hs(e,t,n){let r=_s(n,t),i=R(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&Ss(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function Us(e,t,n){let r=_s(n,t),i=R(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&Ss(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var Ws={name:[[`
\f\r &/=>`.split(``),`
\f\r "&'/=>\``.split(``)],[`\0
\f\r "&'/<=>`.split(``),`\0
\f\r "&'/<=>\``.split(``)]],unquoted:[[`
\f\r &>`.split(``),`\0
\f\r "&'<=>\``.split(``)],[`\0
\f\r "&'<=>\``.split(``),`\0
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function Gs(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=Ye);let l=Ks(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!Rs(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!Ss(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Ks(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=qs(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function qs(e,t,n){let r=gt(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=ds(r.attribute,Object.assign({},e.settings.characterReferences,{subset:Ws.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?_t:tt)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=ds(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Ws.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&lt(n,o)>lt(n,e.alternative)&&(o=e.alternative),s=o+ds(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?Ws.single:Ws.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var Js=[`<`,`&`];function Ys(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:ds(e.value,Object.assign({},r.settings.characterReferences,{subset:Js}))}function Xs(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Ys(e,t,n,r)}function Zs(e,t,n,r){return r.all(e)}var Qs=at(`type`,{invalid:$s,unknown:ec,handlers:{comment:hs,doctype:gs,element:Gs,raw:Xs,root:Zs,text:Ys}});function $s(e){throw Error("Expected node, not `"+e+"`")}function ec(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var tc={},nc={},rc=[];function ic(e,t){let n=t||tc,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:ac,all:oc,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||ot,characterReferences:n.characterReferences||nc,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?Ye:$e,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function ac(e,t,n){return Qs(e,t,n,this)}function oc(e){let t=[],n=e&&e.children||rc,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}function sc(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function cc(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function lc(e){return Array.isArray(e)?e:[e]}async function uc(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function dc(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function fc(e){return e===`ansi`||dc(e)}function pc(e){return e===`none`}function mc(e){return pc(e)}function hc(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(/\s+/g);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function gc(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(/(\r?\n)/g),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}function _c(e){let t=gc(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t[t.length-1].length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}function vc(e,t,n){let r=new Set;for(let t of e.matchAll(/:?lang=["']([^"']+)["']/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/(?:```|~~~)([\w-]+)/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/\\begin\{([\w-]+)\}/g)){let e=t[1].toLowerCase().trim();e&&r.add(e)}for(let t of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){let e=t[1].toLowerCase().trim(),n=e.includes(`/`)?e.split(`/`).pop():e;n&&r.add(n)}if(!n)return Array.from(r);let i=n.getBundledLanguages();return Array.from(r).filter(e=>e&&i[e])}var yc=`light-dark()`,bc=[`color`,`background-color`];function xc(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function Sc(e,t){let n=Array.from(t instanceof Set?t:new Set(t)).sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=n.filter(t=>e.offset<t&&t<e.offset+e.content.length).map(t=>t-e.offset).sort((e,t)=>e-t);return t.length?xc(e,t):e})):e}function Cc(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>wc(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&bc.includes(a)){if(r===yc&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new L('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function wc(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&Oa.Italic&&(t[`font-style`]=`italic`),e.fontStyle&Oa.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&Oa.Underline&&n.push(`underline`),e.fontStyle&Oa.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function Tc(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}var Ec=new WeakMap;function Dc(e,t){Ec.set(e,t)}function Oc(e){return Ec.get(e)}var kc=class e{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new e(Object.fromEntries(lc(n).map(e=>[e,Uo])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Ac(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Ac(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function jc(e,t){if(!(e instanceof kc))throw new L(`Invalid grammar state`);return e.getInternalStack(t)}function Mc(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=function(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new L(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...r.indexToPos(e),offset:e}}{let t=r.lines[e.line];if(t===void 0)throw new L(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${r.lines.length}`);let n=e.character;if(n<0&&(n=t.length+n),n<0||n>t.length)throw new L(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:n,offset:r.posToIndex(e.line,n)}}},r=_c(t.source),i=(t.options.decorations||[]).map(e=>({...e,start:n(e.start),end:n(e.end)}));Nc(i),e.set(t.meta,{decorations:i,converter:r,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return Sc(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=Array.from(e.children).filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new L(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=Pc(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new L(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new L(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&hc(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function Nc(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new L(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new L(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function Pc(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(Pc).join(``):``}var Fc=[Mc()];function Ic(e){let t=Lc(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Fc]}function Lc(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var Rc=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],zc={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Bc(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function Vc(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function Hc(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r)){if(r===0)t.push({type:`resetAll`});else if(r<=9)zc[r]&&t.push({type:`setDecoration`,value:zc[r]});else if(r<=29){let e=zc[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:Rc[r-30]}});else if(r===38){let n=Vc(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:Rc[r-40]}});else if(r===48){let n=Vc(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:Rc[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:Rc[r-100+8]}})}}return t}function Uc(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Bc(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=Hc(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var Wc={black:`#000000`,red:`#bb0000`,green:`#00bb00`,yellow:`#bbbb00`,blue:`#0000bb`,magenta:`#ff00ff`,cyan:`#00bbbb`,white:`#eeeeee`,brightBlack:`#555555`,brightRed:`#ff5555`,brightGreen:`#00ff00`,brightYellow:`#ffff55`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#55ffff`,brightWhite:`#ffffff`};function Gc(e=Wc){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<Rc.length;e++)r.push(t(Rc[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var Kc={black:`#000000`,red:`#cd3131`,green:`#0DBC79`,yellow:`#E5E510`,blue:`#2472C8`,magenta:`#BC3FBC`,cyan:`#11A8CD`,white:`#E5E5E5`,brightBlack:`#666666`,brightRed:`#F14C4C`,brightGreen:`#23D18B`,brightYellow:`#F5F543`,brightBlue:`#3B8EEA`,brightMagenta:`#D670D6`,brightCyan:`#29B8DB`,brightWhite:`#FFFFFF`};function qc(e,t,n){let r=sc(e,n),i=gc(t),a=Gc(Object.fromEntries(Rc.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Kc[t]]}))),o=Uc();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=cc(i,r),o=cc(o,r),n.decorations.has(`dim`)&&(i=Jc(i));let s=Oa.None;return n.decorations.has(`bold`)&&(s|=Oa.Bold),n.decorations.has(`italic`)&&(s|=Oa.Italic),n.decorations.has(`underline`)&&(s|=Oa.Underline),n.decorations.has(`strikethrough`)&&(s|=Oa.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Jc(e){let t=e.match(/#([0-9a-f]{3,8})/i);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:e}function Yc(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n,i=e.resolveLangAlias(n.lang||`text`);if(dc(i)||pc(r))return gc(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:a,colorMap:o}=e.setTheme(r);if(i===`ansi`)return qc(a,t,n);let s=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==s.name)throw new L(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${s.name}"`);if(!n.grammarState.themes.includes(a.name))throw new L(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${a.name}"`)}return Zc(t,s,a,o,n)}function Xc(...e){if(e.length===2)return Oc(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(dc(i)||pc(a))throw new L(`Plain language does not have grammar state`);if(i===`ansi`)throw new L(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new kc(Qc(n,c,o,s,r).stateStack,c.name,o.name)}function Zc(e,t,n,r,i){let a=Qc(e,t,n,r,i),o=new kc(a.stateStack,t.name,n.name);return Dc(a.tokens,o),a.tokens}function Qc(e,t,n,r,i){let a=sc(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500}=i,c=gc(e),l=i.grammarState?jc(i.grammarState,n.name)??Uo:i.grammarContextCode==null?Uo:Qc(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,u=[],d=[];for(let e=0,f=c.length;e<f;e++){let[f,p]=c[e];if(f===``){u=[],d.push([]);continue}if(o>0&&f.length>=o){u=[],d.push([{content:f,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;i.includeExplanation&&(m=t.tokenizeLine(f,l,s),h=m.tokens,g=0);let _=t.tokenizeLine2(f,l,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:f.length;if(t===o)continue;let s=_.tokens[2*e+1],c=cc(r[Pa.getForeground(s)],a),l=Pa.getFontStyle(s),d={content:f.substring(t,o),offset:p+t,color:c,fontStyle:l};if(i.includeExplanation){let e=[];if(i.includeExplanation!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(/,/).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(/ /))})}d.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=f.substring(t.startIndex,t.endIndex);r+=n.length,d.explanation.push({content:n,scopes:i.includeExplanation===`scopeName`?$c(t.scopes):el(e,t.scopes)}),g+=1}}u.push(d)}d.push(u),u=[],l=_.ruleStack}return{tokens:d,stateStack:l}}function $c(e){return e.map(e=>({scopeName:e}))}function el(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:rl(e,i,t.slice(0,r))}}return n}function tl(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function nl(e,t,n){if(!tl(e[e.length-1],t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)tl(e[r],n[i])&&--r,--i;return r===-1}function rl(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(nl(e,t,n)){r.push(a);break}return r}function il(e,t,n){let r=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),i=r.map(r=>{let i=Yc(e,t,{...n,theme:r.theme});return{tokens:i,state:Oc(i),theme:typeof r.theme==`string`?r.theme:r.theme.name}}),a=al(...i.map(e=>e.tokens)),o=a[0].map((e,t)=>e.map((e,i)=>{let o={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(o.explanation=e.explanation),a.forEach((e,n)=>{let{content:a,explanation:s,offset:c,...l}=e[t][i];o.variants[r[n].color]=l}),o})),s=i[0].state?new kc(Object.fromEntries(i.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),i[0].state.lang):void 0;return s&&Dc(o,s),o}function al(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}function ol(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new L("`themes` option must not be empty");let p=il(e,t,n);if(c=Oc(p),l&&yc!==l&&!f.find(e=>e.color===l))throw new L(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>Cc(e,h,u,l,d))),c&&Dc(a,c);let g=f.map(e=>sc(e.theme,n));i=sl(f,m,g,u,l,`fg`,d),r=sl(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=sc(n.theme,n);a=Yc(e,t,n);let l=e.getTheme(n.theme);r=cc(l.bg,s),i=cc(l.fg,s),o=l.name,c=Oc(a)}else throw new L("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function sl(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=cc(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===yc&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new L('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${cc(t[r][a],n[r])||`inherit`}, ${cc(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}function cl(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>cl(e,t,n),codeToTokens:(t,n)=>ol(e,t,n)}){let i=t;for(let e of Ic(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=ol(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=ul(a):d===`never`&&(a=dl(a)),f&&(a=fl(a));let p={...r,get source(){return i}};for(let e of Ic(n))a=e.tokens?.call(p,a)||a;return ll(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function ll(e,t,n,r=Oc(e)){let i=Ic(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:hc,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
`}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=Tc(a.htmlStyle||wc(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&Dc(m,r),m}function ul(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&Oa.Underline||i.fontStyle&Oa.Strikethrough));o&&i.content.match(/^\s+$/)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function dl(e){return e.map(e=>e.flatMap(e=>{if(e.content.match(/^\s+$/))return e;let t=e.content.match(/^(\s*)(.*?)(\s*)$/);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function fl(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t[t.length-1],r=Tc(e.htmlStyle||wc(e)),i=Tc(n.htmlStyle||wc(n)),a=e.fontStyle&&(e.fontStyle&Oa.Underline||e.fontStyle&Oa.Strikethrough),o=n.fontStyle&&(n.fontStyle&Oa.Underline||n.fontStyle&Oa.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var pl=ic;function ml(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>cl(e,t,n),codeToTokens:(t,n)=>ol(e,t,n)},i=pl(cl(e,t,n,r));for(let e of Ic(n))i=e.postprocess?.call(r,i,n)||i;return i}var hl={light:`#333333`,dark:`#bbbbbb`},gl={light:`#fffffe`,dark:`#1e1e1e`},_l=`__shiki_resolved`;function vl(e){if(e?.[_l])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?hl.light:hl.dark,n||=t.type===`light`?gl.light:gl.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,_l,{enumerable:!1,writable:!1,value:!0}),t}async function yl(e){return Array.from(new Set((await Promise.all(e.filter(e=>!fc(e)).map(async e=>await uc(e).then(e=>Array.isArray(e)?e:[e])))).flat()))}async function bl(e){return(await Promise.all(e.map(async e=>mc(e)?null:vl(await uc(e))))).filter(e=>!!e)}var xl=3;function Sl(e,t=3){xl&&(typeof xl==`number`&&t>xl||console.trace(`[SHIKI DEPRECATE]: ${e}`))}var Cl=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function wl(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new Cl(`Circular alias \`${Array.from(n).join(` -> `)} -> ${e}\``);n.add(e)}}return e}var Tl=class extends Ho{constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=vl(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=xa.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=wl(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=Array.from(this._langGraph.entries()),n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new Cl(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},El=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},Dl=0;function Ol(e){Dl+=1,e.warnings!==!1&&Dl>=10&&Dl%10==0&&console.warn(`[Shiki] ${Dl} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new Cl("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(vl),i=new Tl(new El(e.engine,n),r,n,e.langAlias),a;function o(t){return wl(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new Cl(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new Cl(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await yl(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await bl(e))}function g(){if(t)throw new Cl(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--Dl)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function kl(e){e.engine||Sl("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([bl(e.themes||[]),yl(e.langs||[]),e.engine]);return Ol({...e,themes:t,langs:n,engine:r})}async function Al(e){let t=await kl(e);return{getLastGrammarState:(...e)=>Xc(t,...e),codeToTokensBase:(e,n)=>Yc(t,e,n),codeToTokensWithThemes:(e,n)=>il(t,e,n),codeToTokens:(e,n)=>ol(t,e,n),codeToHast:(e,n)=>cl(t,e,n),codeToHtml:(e,n)=>ml(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function jl(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,fc(n))return[];let r=t[n];if(!r)throw new L(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(mc(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new L(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await Al({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}function Ml(e){let t;async function n(n={}){if(t){let e=await t;return await Promise.all([e.loadTheme(...n.themes||[]),e.loadLanguage(...n.langs||[])]),e}{t=e({...n,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...n.themes||[]),r.loadLanguage(...n.langs||[])]),r}}return n}function Nl(e,t){let n=Ml(e);async function r(e,r){let i=await n({langs:[r.lang],themes:`theme`in r?[r.theme]:Object.values(r.themes)}),a=await t?.guessEmbeddedLanguages?.(e,r.lang,i);return a&&await i.loadLanguage(...a),i}return{getSingletonHighlighter(e){return n(e)},async codeToHtml(e,t){return(await r(e,t)).codeToHtml(e,t)},async codeToHast(e,t){return(await r(e,t)).codeToHast(e,t)},async codeToTokens(e,t){return(await r(e,t)).codeToTokens(e,t)},async codeToTokensBase(e,t){return(await r(e,t)).codeToTokensBase(e,t)},async codeToTokensWithThemes(e,t){return(await r(e,t)).codeToTokensWithThemes(e,t)},async getLastGrammarState(e,t){return(await n({langs:[t.lang],themes:[t.theme]})).getLastGrammarState(e,t)}}}var Pl=[{id:`abap`,name:`ABAP`,import:(()=>k(()=>import(`./abap-CLvhMVsD.js`),[]))},{id:`actionscript-3`,name:`ActionScript`,import:(()=>k(()=>import(`./actionscript-3--17pq3dv.js`),[]))},{id:`ada`,name:`Ada`,import:(()=>k(()=>import(`./ada-C5qYipkI.js`),[]))},{id:`angular-html`,name:`Angular HTML`,import:(()=>k(()=>import(`./angular-html-i2ZEVJq0.js`).then(e=>e.n),__vite__mapDeps([0,1,2,3,4])))},{id:`angular-ts`,name:`Angular TypeScript`,import:(()=>k(()=>import(`./angular-ts-CEQYB7nm.js`),__vite__mapDeps([5,0,1,2,3,4,6])))},{id:`apache`,name:`Apache Conf`,import:(()=>k(()=>import(`./apache-U0d_L8uA.js`),[]))},{id:`apex`,name:`Apex`,import:(()=>k(()=>import(`./apex-CGTLDQj6.js`),[]))},{id:`apl`,name:`APL`,import:(()=>k(()=>import(`./apl-BqqYD0H4.js`),__vite__mapDeps([7,3,1,4,2,8,9,10])))},{id:`applescript`,name:`AppleScript`,import:(()=>k(()=>import(`./applescript-CCn79oCD.js`),[]))},{id:`ara`,name:`Ara`,import:(()=>k(()=>import(`./ara-4CJ0cIlV.js`),[]))},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`],import:(()=>k(()=>import(`./asciidoc-DE70LPWp.js`),[]))},{id:`asm`,name:`Assembly`,import:(()=>k(()=>import(`./asm-Cmm7eHzH.js`),[]))},{id:`astro`,name:`Astro`,import:(()=>k(()=>import(`./astro-Dt1mSA-e.js`),__vite__mapDeps([11,3,1,4,10,12,13,14])))},{id:`awk`,name:`AWK`,import:(()=>k(()=>import(`./awk-BWXHIvNe.js`),[]))},{id:`ballerina`,name:`Ballerina`,import:(()=>k(()=>import(`./ballerina-B7ZEbQpA.js`),[]))},{id:`bat`,name:`Batch File`,aliases:[`batch`],import:(()=>k(()=>import(`./bat-Bo4NYOV-.js`),[]))},{id:`beancount`,name:`Beancount`,import:(()=>k(()=>import(`./beancount-D-usSTwE.js`),[]))},{id:`berry`,name:`Berry`,aliases:[`be`],import:(()=>k(()=>import(`./berry-DKpUyyne.js`),[]))},{id:`bibtex`,name:`BibTeX`,import:(()=>k(()=>import(`./bibtex-Ci_nEsc7.js`),[]))},{id:`bicep`,name:`Bicep`,import:(()=>k(()=>import(`./bicep-CUHmPFLl.js`),[]))},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`],import:(()=>k(()=>import(`./bird2-C2hNVINV.js`),[]))},{id:`blade`,name:`Blade`,import:(()=>k(()=>import(`./blade-D83jhYA_.js`),__vite__mapDeps([15,3,1,4,2,8,9,10,16,17])))},{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`],import:(()=>k(()=>import(`./bsl-BkkzgIyY.js`),__vite__mapDeps([18,19])))},{id:`c`,name:`C`,import:(()=>k(()=>import(`./c-aGSZMVdM.js`).then(e=>e.n),__vite__mapDeps([20,1])))},{id:`c3`,name:`C3`,import:(()=>k(()=>import(`./c3-CnJL0r0V.js`),[]))},{id:`cadence`,name:`Cadence`,aliases:[`cdc`],import:(()=>k(()=>import(`./cadence-CQ2zXKGN.js`),[]))},{id:`cairo`,name:`Cairo`,import:(()=>k(()=>import(`./cairo-DLTphjLi.js`),__vite__mapDeps([21,22])))},{id:`clarity`,name:`Clarity`,import:(()=>k(()=>import(`./clarity-SemFz856.js`),[]))},{id:`clojure`,name:`Clojure`,aliases:[`clj`],import:(()=>k(()=>import(`./clojure-DqKBuwfJ.js`),[]))},{id:`cmake`,name:`CMake`,import:(()=>k(()=>import(`./cmake-Bj61d0ZC.js`),[]))},{id:`cobol`,name:`COBOL`,import:(()=>k(()=>import(`./cobol-BgCIwGZu.js`),__vite__mapDeps([23,2,1,3,4,9])))},{id:`codeowners`,name:`CODEOWNERS`,import:(()=>k(()=>import(`./codeowners-C8r90Shi.js`),[]))},{id:`codeql`,name:`CodeQL`,aliases:[`ql`],import:(()=>k(()=>import(`./codeql-oeQT6MSM.js`),[]))},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`],import:(()=>k(()=>import(`./coffee-ouOQ86EC.js`),__vite__mapDeps([24,3,1])))},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`],import:(()=>k(()=>import(`./common-lisp-Cv5bFMCO.js`),[]))},{id:`coq`,name:`Coq`,import:(()=>k(()=>import(`./coq-BrsZFFmf.js`),[]))},{id:`cpp`,name:`C++`,aliases:[`c++`],import:(()=>k(()=>import(`./cpp-D7oTDj03.js`).then(e=>e.n),__vite__mapDeps([25,1,17,26,27,20])))},{id:`crystal`,name:`Crystal`,import:(()=>k(()=>import(`./crystal-Dj_CYA08.js`),__vite__mapDeps([28,3,1,4,2,17,20,29])))},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`],import:(()=>k(()=>import(`./csharp-Ct8U2NOr.js`),[]))},{id:`css`,name:`CSS`,import:(()=>k(()=>import(`./css-DeEW2upM.js`).then(e=>e.n),__vite__mapDeps([4,1])))},{id:`csv`,name:`CSV`,import:(()=>k(()=>import(`./csv-Dx-8-gkx.js`),[]))},{id:`cue`,name:`CUE`,import:(()=>k(()=>import(`./cue-CE9AQfxI.js`),[]))},{id:`cypher`,name:`Cypher`,aliases:[`cql`],import:(()=>k(()=>import(`./cypher-ClKdZ_lG.js`),[]))},{id:`d`,name:`D`,import:(()=>k(()=>import(`./d-qD-0Kul2.js`),[]))},{id:`dart`,name:`Dart`,import:(()=>k(()=>import(`./dart-DkHntEIa.js`),[]))},{id:`dax`,name:`DAX`,import:(()=>k(()=>import(`./dax-BkyTk9wS.js`),[]))},{id:`desktop`,name:`Desktop`,import:(()=>k(()=>import(`./desktop-Dlh5hvp9.js`),[]))},{id:`diff`,name:`Diff`,import:(()=>k(()=>import(`./diff-woXpYk--.js`),[]))},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`],import:(()=>k(()=>import(`./docker-IyjqRm3v.js`),[]))},{id:`dotenv`,name:`dotEnv`,import:(()=>k(()=>import(`./dotenv-_5a1GRtc.js`),[]))},{id:`dream-maker`,name:`Dream Maker`,import:(()=>k(()=>import(`./dream-maker-DW3nJb8Q.js`),[]))},{id:`edge`,name:`Edge`,import:(()=>k(()=>import(`./edge-CCRlTIbg.js`),__vite__mapDeps([30,2,1,3,4,12,16])))},{id:`elixir`,name:`Elixir`,import:(()=>k(()=>import(`./elixir-DkgEFlh9.js`),__vite__mapDeps([31,2,1,3,4])))},{id:`elm`,name:`Elm`,import:(()=>k(()=>import(`./elm-C-6n8iva.js`),__vite__mapDeps([32,27,1,20])))},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`],import:(()=>k(()=>import(`./emacs-lisp-C9PiwqqW.js`),[]))},{id:`erb`,name:`ERB`,import:(()=>k(()=>import(`./erb-Cs0Iy0dO.js`),__vite__mapDeps([33,2,1,3,4,34,8,9,17,20,25,26,27,29,35,36,12,14,37,38,39])))},{id:`erlang`,name:`Erlang`,aliases:[`erl`],import:(()=>k(()=>import(`./erlang-Cphh6RMH.js`),__vite__mapDeps([40,41])))},{id:`fennel`,name:`Fennel`,import:(()=>k(()=>import(`./fennel-DQxkIbk2.js`),[]))},{id:`fish`,name:`Fish`,import:(()=>k(()=>import(`./fish-BJitypiv.js`),[]))},{id:`fluent`,name:`Fluent`,aliases:[`ftl`],import:(()=>k(()=>import(`./fluent-C03EYrpw.js`),[]))},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`],import:(()=>k(()=>import(`./fortran-fixed-form-DEKoE2YW.js`),__vite__mapDeps([42,43])))},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`],import:(()=>k(()=>import(`./fortran-free-form-CYNrtFtB.js`),[]))},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`],import:(()=>k(()=>import(`./fsharp-D13ZGOAj.js`),__vite__mapDeps([44,41])))},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`],import:(()=>k(()=>import(`./gdresource-C0sCabJj.js`),__vite__mapDeps([45,46,47])))},{id:`gdscript`,name:`GDScript`,aliases:[`gd`],import:(()=>k(()=>import(`./gdscript-Cp2uCuqX.js`),[]))},{id:`gdshader`,name:`GDShader`,import:(()=>k(()=>import(`./gdshader-CBce3t8t.js`),[]))},{id:`genie`,name:`Genie`,import:(()=>k(()=>import(`./genie-CV2tkWYe.js`),[]))},{id:`gherkin`,name:`Gherkin`,import:(()=>k(()=>import(`./gherkin-DExj1W_8.js`),[]))},{id:`git-commit`,name:`Git Commit Message`,import:(()=>k(()=>import(`./git-commit-BSykSTBG.js`),__vite__mapDeps([48,49])))},{id:`git-rebase`,name:`Git Rebase Message`,import:(()=>k(()=>import(`./git-rebase-BnAFTyQc.js`),__vite__mapDeps([50,29,1])))},{id:`gleam`,name:`Gleam`,import:(()=>k(()=>import(`./gleam-CSRkHgEL.js`),[]))},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`],import:(()=>k(()=>import(`./glimmer-js-CFyErDLZ.js`),__vite__mapDeps([51,3,1,4,2,12])))},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`],import:(()=>k(()=>import(`./glimmer-ts-Ct4QKAg6.js`),__vite__mapDeps([52,3,1,4,2,12])))},{id:`glsl`,name:`GLSL`,import:(()=>k(()=>import(`./glsl-TOBAB6bO.js`).then(e=>e.n),__vite__mapDeps([27,1,20])))},{id:`gn`,name:`GN`,import:(()=>k(()=>import(`./gn-ilITqXS6.js`),[]))},{id:`gnuplot`,name:`Gnuplot`,import:(()=>k(()=>import(`./gnuplot-7GGW24-e.js`),[]))},{id:`go`,name:`Go`,import:(()=>k(()=>import(`./go-BJwz_mda.js`),[]))},{id:`graphql`,name:`GraphQL`,aliases:[`gql`],import:(()=>k(()=>import(`./graphql-ns1EoQQG.js`).then(e=>e.n),__vite__mapDeps([36,1,3,12,14,37])))},{id:`groovy`,name:`Groovy`,import:(()=>k(()=>import(`./groovy-CacY0gHj.js`),[]))},{id:`hack`,name:`Hack`,import:(()=>k(()=>import(`./hack-DB7M32Gm.js`),__vite__mapDeps([53,2,1,3,4,17])))},{id:`haml`,name:`Ruby Haml`,import:(()=>k(()=>import(`./haml-BUBfnAPo.js`).then(e=>e.n),__vite__mapDeps([35,1,3,4])))},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`],import:(()=>k(()=>import(`./handlebars-qVnY7qVv.js`),__vite__mapDeps([54,3,1,4,2,39])))},{id:`haskell`,name:`Haskell`,aliases:[`hs`],import:(()=>k(()=>import(`./haskell-D8IpX4py.js`),[]))},{id:`haxe`,name:`Haxe`,import:(()=>k(()=>import(`./haxe-OTjmBuCE.js`),[]))},{id:`hcl`,name:`HashiCorp HCL`,import:(()=>k(()=>import(`./hcl-Dh228itO.js`),[]))},{id:`hjson`,name:`Hjson`,import:(()=>k(()=>import(`./hjson-CxZEssPk.js`),[]))},{id:`hlsl`,name:`HLSL`,import:(()=>k(()=>import(`./hlsl-Cvrh5tZx.js`),[]))},{id:`html`,name:`HTML`,import:(()=>k(()=>import(`./html-DhBYQyK4.js`).then(e=>e.n),__vite__mapDeps([2,1,3,4])))},{id:`html-derivative`,name:`HTML (Derivative)`,import:(()=>k(()=>import(`./html-derivative-C_nRlqME.js`),__vite__mapDeps([16,2,1,3,4])))},{id:`http`,name:`HTTP`,import:(()=>k(()=>import(`./http-Da_kjz5m.js`),__vite__mapDeps([55,8,1,9,10,29,36,3,12,14,37])))},{id:`hurl`,name:`Hurl`,import:(()=>k(()=>import(`./hurl-DKXSMFRR.js`),__vite__mapDeps([56,8,1,9,57,36,3,12,14,37])))},{id:`hxml`,name:`HXML`,import:(()=>k(()=>import(`./hxml-B0Qn7Nwc.js`),__vite__mapDeps([58,59])))},{id:`hy`,name:`Hy`,import:(()=>k(()=>import(`./hy-CZbG8q4J.js`),[]))},{id:`imba`,name:`Imba`,import:(()=>k(()=>import(`./imba-DsUTQ-LC.js`),[]))},{id:`ini`,name:`INI`,aliases:[`properties`],import:(()=>k(()=>import(`./ini-B5eOa1yu.js`),[]))},{id:`java`,name:`Java`,import:(()=>k(()=>import(`./java-duG_UTKe.js`).then(e=>e.n),__vite__mapDeps([9,1])))},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`],import:(()=>k(()=>import(`./javascript-DWVbOe4X.js`).then(e=>e.n),__vite__mapDeps([3,1])))},{id:`jinja`,name:`Jinja`,import:(()=>k(()=>import(`./jinja-DuNSryF7.js`),__vite__mapDeps([60,2,1,3,4])))},{id:`jison`,name:`Jison`,import:(()=>k(()=>import(`./jison-CHwnC1Pv.js`),__vite__mapDeps([61,3,1])))},{id:`json`,name:`JSON`,import:(()=>k(()=>import(`./json-Br_ORbR4.js`).then(e=>e.n),__vite__mapDeps([10,1])))},{id:`json5`,name:`JSON5`,import:(()=>k(()=>import(`./json5-BR5RXkoi.js`),[]))},{id:`jsonc`,name:`JSON with Comments`,import:(()=>k(()=>import(`./jsonc-CYpm1nAK.js`),[]))},{id:`jsonl`,name:`JSON Lines`,import:(()=>k(()=>import(`./jsonl-CmCQp5Yx.js`),[]))},{id:`jsonnet`,name:`Jsonnet`,import:(()=>k(()=>import(`./jsonnet-CJTPZ8u_.js`),[]))},{id:`jssm`,name:`JSSM`,aliases:[`fsl`],import:(()=>k(()=>import(`./jssm-DXw9l8Rf.js`),[]))},{id:`jsx`,name:`JSX`,import:(()=>k(()=>import(`./jsx-fcCEM_-L.js`).then(e=>e.n),__vite__mapDeps([37,1])))},{id:`julia`,name:`Julia`,aliases:[`jl`],import:(()=>k(()=>import(`./julia-mj6xfn4X.js`),__vite__mapDeps([62,3,1,17,22,25,26,27,20,63])))},{id:`just`,name:`Just`,import:(()=>k(()=>import(`./just-DZo2o5E2.js`),__vite__mapDeps([64,3,1,12,22,29,34,4,2,8,9,17,20,25,26,27,35,36,14,37,38,39,65])))},{id:`kdl`,name:`KDL`,import:(()=>k(()=>import(`./kdl-CsD5j6eV.js`),[]))},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`],import:(()=>k(()=>import(`./kotlin-DhhofPvG.js`),[]))},{id:`kusto`,name:`Kusto`,aliases:[`kql`],import:(()=>k(()=>import(`./kusto-BUv0MjJC.js`),[]))},{id:`latex`,name:`LaTeX`,import:(()=>k(()=>import(`./latex-CSkjTfPS.js`),__vite__mapDeps([66,67,63,1])))},{id:`lean`,name:`Lean 4`,aliases:[`lean4`],import:(()=>k(()=>import(`./lean-CewbzKMR.js`),[]))},{id:`less`,name:`Less`,import:(()=>k(()=>import(`./less-DVTAwKKz.js`),[]))},{id:`liquid`,name:`Liquid`,import:(()=>k(()=>import(`./liquid-XCoXGo1k.js`),__vite__mapDeps([68,3,1,4,2,10])))},{id:`llvm`,name:`LLVM IR`,import:(()=>k(()=>import(`./llvm-Cm23YOpf.js`),[]))},{id:`log`,name:`Log file`,import:(()=>k(()=>import(`./log-BNLmms1o.js`),[]))},{id:`logo`,name:`Logo`,import:(()=>k(()=>import(`./logo-Cluzi2Zq.js`),[]))},{id:`lua`,name:`Lua`,import:(()=>k(()=>import(`./lua-BIP2dQgW.js`).then(e=>e.n),__vite__mapDeps([38,1,20])))},{id:`luau`,name:`Luau`,import:(()=>k(()=>import(`./luau-CNKltnaQ.js`),[]))},{id:`make`,name:`Makefile`,aliases:[`makefile`],import:(()=>k(()=>import(`./make-Dixweg8N.js`),[]))},{id:`markdown`,name:`Markdown`,aliases:[`md`],import:(()=>k(()=>import(`./markdown-BYOwaDjH.js`),[]))},{id:`marko`,name:`Marko`,import:(()=>k(()=>import(`./marko-CiosSmec.js`),__vite__mapDeps([69,4,1,6,12,70])))},{id:`matlab`,name:`MATLAB`,import:(()=>k(()=>import(`./matlab-D7qyCx1q.js`),[]))},{id:`mdc`,name:`MDC`,import:(()=>k(()=>import(`./mdc-C7Lb5uay.js`),__vite__mapDeps([71,16,2,1,3,4,39,41])))},{id:`mdx`,name:`MDX`,import:(()=>k(()=>import(`./mdx-DQZ5AkYe.js`),[]))},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`],import:(()=>k(()=>import(`./mermaid-Bk4SNUv9.js`),[]))},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`],import:(()=>k(()=>import(`./mipsasm-BMqwQI7S.js`),[]))},{id:`mojo`,name:`Mojo`,import:(()=>k(()=>import(`./mojo-BgCJLMeH.js`),[]))},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`],import:(()=>k(()=>import(`./moonbit-CaWjb8XO.js`),[]))},{id:`move`,name:`Move`,import:(()=>k(()=>import(`./move-B1IS1UjX.js`),[]))},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`],import:(()=>k(()=>import(`./narrat-_X_XdTYD.js`),[]))},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`],import:(()=>k(()=>import(`./nextflow-Bbiyy34d.js`),__vite__mapDeps([72,73])))},{id:`nextflow-groovy`,name:`nextflow-groovy`,import:(()=>k(()=>import(`./nextflow-groovy-Dc_ddanL.js`),[]))},{id:`nginx`,name:`Nginx`,import:(()=>k(()=>import(`./nginx-BgDTOYqs.js`),__vite__mapDeps([74,38,1,20])))},{id:`nim`,name:`Nim`,import:(()=>k(()=>import(`./nim-CUz-jMgf.js`),__vite__mapDeps([75,3,1,4,2,8,9,20,27,41])))},{id:`nix`,name:`Nix`,import:(()=>k(()=>import(`./nix-IvuFDN5E.js`),[]))},{id:`nushell`,name:`nushell`,aliases:[`nu`],import:(()=>k(()=>import(`./nushell-DcLAeLz5.js`),[]))},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`],import:(()=>k(()=>import(`./objective-c-D1A_Heim.js`),[]))},{id:`objective-cpp`,name:`Objective-C++`,import:(()=>k(()=>import(`./objective-cpp-BsSzOQcm.js`),[]))},{id:`ocaml`,name:`OCaml`,import:(()=>k(()=>import(`./ocaml-O90oeIOV.js`),[]))},{id:`odin`,name:`Odin`,import:(()=>k(()=>import(`./odin-B1RWQWA5.js`),[]))},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`],import:(()=>k(()=>import(`./openscad-BUDT5pXO.js`),[]))},{id:`pascal`,name:`Pascal`,import:(()=>k(()=>import(`./pascal-4ZHwLPI5.js`),[]))},{id:`perl`,name:`Perl`,import:(()=>k(()=>import(`./perl-C1dZQPV5.js`),__vite__mapDeps([65,3,1,4,2,8,9,17])))},{id:`php`,name:`PHP`,import:(()=>k(()=>import(`./php-Cv1yln_y.js`),__vite__mapDeps([76,3,1,4,2,8,9,10,17])))},{id:`pkl`,name:`Pkl`,import:(()=>k(()=>import(`./pkl-ot-7Btpt.js`),[]))},{id:`plsql`,name:`PL/SQL`,import:(()=>k(()=>import(`./plsql-DGHpHOYJ.js`),[]))},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`],import:(()=>k(()=>import(`./po-BiJDBrnU.js`),[]))},{id:`polar`,name:`Polar`,import:(()=>k(()=>import(`./polar-C7UOKdEL.js`),[]))},{id:`postcss`,name:`PostCSS`,import:(()=>k(()=>import(`./postcss-BXeXVLqQ.js`),[]))},{id:`powerquery`,name:`PowerQuery`,import:(()=>k(()=>import(`./powerquery-DNMTfnFr.js`),[]))},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`],import:(()=>k(()=>import(`./powershell-DshXNtvi.js`),[]))},{id:`prisma`,name:`Prisma`,import:(()=>k(()=>import(`./prisma-BsRQq5mF.js`),[]))},{id:`prolog`,name:`Prolog`,import:(()=>k(()=>import(`./prolog-iXnhIJG7.js`),[]))},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`],import:(()=>k(()=>import(`./proto-DB4EqR-F.js`),[]))},{id:`pug`,name:`Pug`,aliases:[`jade`],import:(()=>k(()=>import(`./pug-Ce37auPQ.js`),__vite__mapDeps([77,3,1,4,2])))},{id:`puppet`,name:`Puppet`,import:(()=>k(()=>import(`./puppet-CDv2pdJW.js`),[]))},{id:`purescript`,name:`PureScript`,import:(()=>k(()=>import(`./purescript-9MfHhQsQ.js`),[]))},{id:`python`,name:`Python`,aliases:[`py`],import:(()=>k(()=>import(`./python-gzcpVVnB.js`),[]))},{id:`qml`,name:`QML`,import:(()=>k(()=>import(`./qml-DWs4ParD.js`),__vite__mapDeps([78,3,1])))},{id:`qmldir`,name:`QML Directory`,import:(()=>k(()=>import(`./qmldir-DCQb3MpD.js`),[]))},{id:`qss`,name:`Qt Style Sheets`,import:(()=>k(()=>import(`./qss-Fe1Jh2GI.js`),[]))},{id:`r`,name:`R`,import:(()=>k(()=>import(`./r-B_2zvz1A.js`).then(e=>e.n),__vite__mapDeps([63,1])))},{id:`racket`,name:`Racket`,import:(()=>k(()=>import(`./racket-DcIDlBhZ.js`),[]))},{id:`raku`,name:`Raku`,aliases:[`perl6`],import:(()=>k(()=>import(`./raku-B3gFvitq.js`),[]))},{id:`razor`,name:`ASP.NET Razor`,import:(()=>k(()=>import(`./razor-Ctpaw8Xr.js`),__vite__mapDeps([79,2,1,3,4,80])))},{id:`reg`,name:`Windows Registry Script`,import:(()=>k(()=>import(`./reg-CRGYupPL.js`),[]))},{id:`regexp`,name:`RegExp`,aliases:[`regex`],import:(()=>k(()=>import(`./regexp--aR2_iz7.js`).then(e=>e.n),__vite__mapDeps([26,1])))},{id:`rel`,name:`Rel`,import:(()=>k(()=>import(`./rel-BtDbiS_P.js`),[]))},{id:`riscv`,name:`RISC-V`,import:(()=>k(()=>import(`./riscv-Ckw8ddFX.js`),[]))},{id:`ron`,name:`RON`,import:(()=>k(()=>import(`./ron-VUp2lXgN.js`),[]))},{id:`rosmsg`,name:`ROS Interface`,import:(()=>k(()=>import(`./rosmsg-CAekHB0j.js`),[]))},{id:`rst`,name:`reStructuredText`,import:(()=>k(()=>import(`./rst-CqRkteH8.js`),__vite__mapDeps([81,3,1,16,2,4,22,82,25,17,26,27,20,29,39,34,8,9,35,36,12,14,37,38])))},{id:`ruby`,name:`Ruby`,aliases:[`rb`],import:(()=>k(()=>import(`./ruby-D3BGyoLR.js`),__vite__mapDeps([34,3,1,4,2,8,9,17,20,25,26,27,29,35,36,12,14,37,38,39])))},{id:`rust`,name:`Rust`,aliases:[`rs`],import:(()=>k(()=>import(`./rust-Cfkwpbl8.js`),[]))},{id:`sas`,name:`SAS`,import:(()=>k(()=>import(`./sas-BaCscvql.js`),__vite__mapDeps([83,17,1])))},{id:`sass`,name:`Sass`,import:(()=>k(()=>import(`./sass-DXrisJhu.js`),[]))},{id:`scala`,name:`Scala`,import:(()=>k(()=>import(`./scala-DKOlJaKm.js`),[]))},{id:`scheme`,name:`Scheme`,import:(()=>k(()=>import(`./scheme-DQCgrYNe.js`),[]))},{id:`scss`,name:`SCSS`,import:(()=>k(()=>import(`./scss-DngyzxVC.js`).then(e=>e.n),__vite__mapDeps([6,1,4])))},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`],import:(()=>k(()=>import(`./sdbl-bTVj8UrX.js`),[]))},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`],import:(()=>k(()=>import(`./shaderlab-TOUzSsQk.js`),__vite__mapDeps([84,85])))},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`],import:(()=>k(()=>import(`./shellscript-DnoJEH0-.js`).then(e=>e.n),__vite__mapDeps([29,1])))},{id:`shellsession`,name:`Shell Session`,aliases:[`console`],import:(()=>k(()=>import(`./shellsession-DnjHxDMP.js`),__vite__mapDeps([86,29,1])))},{id:`smalltalk`,name:`Smalltalk`,import:(()=>k(()=>import(`./smalltalk-B16xEiuN.js`),[]))},{id:`solidity`,name:`Solidity`,import:(()=>k(()=>import(`./solidity-CKzVLygQ.js`),[]))},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`],import:(()=>k(()=>import(`./soy-DmAO5KqQ.js`),__vite__mapDeps([87,2,1,3,4])))},{id:`sparql`,name:`SPARQL`,import:(()=>k(()=>import(`./sparql-D_iOobhT.js`),__vite__mapDeps([88,89])))},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`],import:(()=>k(()=>import(`./splunk-BC2Px7Mm.js`),[]))},{id:`sql`,name:`SQL`,import:(()=>k(()=>import(`./sql-CLgiMrxJ.js`).then(e=>e.n),__vite__mapDeps([17,1])))},{id:`ssh-config`,name:`SSH Config`,import:(()=>k(()=>import(`./ssh-config-BgfXC-Er.js`),[]))},{id:`stata`,name:`Stata`,import:(()=>k(()=>import(`./stata-BiJ8hoIJ.js`),__vite__mapDeps([90,17,1])))},{id:`stylus`,name:`Stylus`,aliases:[`styl`],import:(()=>k(()=>import(`./stylus-B6D30XZt.js`),[]))},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`],import:(()=>k(()=>import(`./surrealql-D9bH0Csw.js`),__vite__mapDeps([91,3,1])))},{id:`svelte`,name:`Svelte`,import:(()=>k(()=>import(`./svelte-B3woShZ2.js`),__vite__mapDeps([92,3,1,4,12,13])))},{id:`swift`,name:`Swift`,import:(()=>k(()=>import(`./swift-DonLKvLd.js`),[]))},{id:`system-verilog`,name:`SystemVerilog`,import:(()=>k(()=>import(`./system-verilog-DJ5XKQeo.js`),[]))},{id:`systemd`,name:`Systemd Units`,import:(()=>k(()=>import(`./systemd-BxMlprV5.js`),[]))},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`],import:(()=>k(()=>import(`./talonscript-CohzipZa.js`),[]))},{id:`tasl`,name:`Tasl`,import:(()=>k(()=>import(`./tasl-DMoTqEGO.js`),[]))},{id:`tcl`,name:`Tcl`,import:(()=>k(()=>import(`./tcl-CZd0xW_V.js`),[]))},{id:`templ`,name:`Templ`,import:(()=>k(()=>import(`./templ-B7gtJFlV.js`),__vite__mapDeps([93,3,1,4,94])))},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`],import:(()=>k(()=>import(`./terraform-DswuEJGm.js`),[]))},{id:`tex`,name:`TeX`,import:(()=>k(()=>import(`./tex-Bjo-GMiN.js`),__vite__mapDeps([67,63,1])))},{id:`toml`,name:`TOML`,import:(()=>k(()=>import(`./toml-CcmNWLt0.js`),[]))},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`],import:(()=>k(()=>import(`./ts-tags-CSxB5Eny.js`),__vite__mapDeps([95,3,1,4,2,8,9,12,17,27,20])))},{id:`tsv`,name:`TSV`,import:(()=>k(()=>import(`./tsv-sltzmVWM.js`),[]))},{id:`tsx`,name:`TSX`,import:(()=>k(()=>import(`./tsx-JMDX3aQ7.js`).then(e=>e.n),__vite__mapDeps([14,1])))},{id:`turtle`,name:`Turtle`,import:(()=>k(()=>import(`./turtle-ByJddavk.js`),[]))},{id:`twig`,name:`Twig`,import:(()=>k(()=>import(`./twig-DCsq_S7z.js`),__vite__mapDeps([96,3,1,4,6,22,34,2,8,9,17,20,25,26,27,29,35,36,12,14,37,38,39,76,10])))},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`],import:(()=>k(()=>import(`./typescript-BAz-bF8J.js`).then(e=>e.n),__vite__mapDeps([12,1])))},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`],import:(()=>k(()=>import(`./typespec-B88KGewJ.js`),[]))},{id:`typst`,name:`Typst`,aliases:[`typ`],import:(()=>k(()=>import(`./typst-DI99ib-x.js`),[]))},{id:`v`,name:`V`,import:(()=>k(()=>import(`./v-DETTlOr0.js`),[]))},{id:`vala`,name:`Vala`,import:(()=>k(()=>import(`./vala-zf12oZj6.js`),[]))},{id:`vb`,name:`Visual Basic`,aliases:[`cmd`],import:(()=>k(()=>import(`./vb-Djn5o6TS.js`),[]))},{id:`verilog`,name:`Verilog`,import:(()=>k(()=>import(`./verilog-CiiDBU1e.js`),[]))},{id:`vhdl`,name:`VHDL`,import:(()=>k(()=>import(`./vhdl-BroJfC0k.js`),[]))},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`],import:(()=>k(()=>import(`./viml-DvXPmvsu.js`),[]))},{id:`vue`,name:`Vue`,import:(()=>k(()=>import(`./vue-BR4XqTj9.js`),__vite__mapDeps([97,3,1,4,2,10,12,16])))},{id:`vue-html`,name:`Vue HTML`,import:(()=>k(()=>import(`./vue-html-DZGW9MGR.js`),__vite__mapDeps([98,3,1])))},{id:`vue-vine`,name:`Vue Vine`,import:(()=>k(()=>import(`./vue-vine-B157dWFT.js`),__vite__mapDeps([99,3,1,4,6,13,70,100])))},{id:`vyper`,name:`Vyper`,aliases:[`vy`],import:(()=>k(()=>import(`./vyper-CgoNMtux.js`),[]))},{id:`wasm`,name:`WebAssembly`,import:(()=>k(()=>import(`./wasm-ByWQv1Qj.js`),[]))},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`],import:(()=>k(()=>import(`./wenyan-C8pVoKbM.js`),[]))},{id:`wgsl`,name:`WGSL`,import:(()=>k(()=>import(`./wgsl-BsKzXJz4.js`),[]))},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`],import:(()=>k(()=>import(`./wikitext-ClFFjSW2.js`),[]))},{id:`wit`,name:`WebAssembly Interface Types`,import:(()=>k(()=>import(`./wit-DdvCle-K.js`),[]))},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`],import:(()=>k(()=>import(`./wolfram-DLL8P-h_.js`),[]))},{id:`xml`,name:`XML`,import:(()=>k(()=>import(`./xml-CNfvW5JP.js`).then(e=>e.n),__vite__mapDeps([8,1,9])))},{id:`xsl`,name:`XSL`,import:(()=>k(()=>import(`./xsl-zsHjPACe.js`),__vite__mapDeps([101,8,1,9])))},{id:`yaml`,name:`YAML`,aliases:[`yml`],import:(()=>k(()=>import(`./yaml-B9zsrP9R.js`).then(e=>e.n),__vite__mapDeps([39,1])))},{id:`zenscript`,name:`ZenScript`,import:(()=>k(()=>import(`./zenscript-BnlCZFoB.js`),[]))},{id:`zig`,name:`Zig`,import:(()=>k(()=>import(`./zig-CMLA9XwU.js`),[]))}],Fl=Object.fromEntries(Pl.map(e=>[e.id,e.import])),Il=Object.fromEntries(Pl.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Ll={...Fl,...Il},Rl=Object.fromEntries([{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`,import:(()=>k(()=>import(`./andromeeda-vGVdxbeo.js`),[]))},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`,import:(()=>k(()=>import(`./aurora-x-CDeNXAV0.js`),[]))},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`,import:(()=>k(()=>import(`./ayu-dark-DluEY0Gj.js`),[]))},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`,import:(()=>k(()=>import(`./ayu-light-C3h-C4tm.js`),[]))},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`,import:(()=>k(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]))},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`,import:(()=>k(()=>import(`./catppuccin-frappe-3VR1Za6u.js`),[]))},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`,import:(()=>k(()=>import(`./catppuccin-latte-DwIHMF0Q.js`),[]))},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`,import:(()=>k(()=>import(`./catppuccin-macchiato-DYnBP6_5.js`),[]))},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`,import:(()=>k(()=>import(`./catppuccin-mocha-DYhrFGRu.js`),[]))},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`,import:(()=>k(()=>import(`./dark-plus-Cs2F2srj.js`),[]))},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`,import:(()=>k(()=>import(`./dracula-BHWKrbxM.js`),[]))},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`,import:(()=>k(()=>import(`./dracula-soft-5eyTD99u.js`),[]))},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`,import:(()=>k(()=>import(`./everforest-dark-sB-x3p7T.js`),[]))},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`,import:(()=>k(()=>import(`./everforest-light-Df2xbC6M.js`),[]))},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`,import:(()=>k(()=>import(`./github-dark-C-LZuMrd.js`),[]))},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`,import:(()=>k(()=>import(`./github-dark-default-DXG-b-1a.js`),[]))},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`,import:(()=>k(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]))},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`,import:(()=>k(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]))},{id:`github-light`,displayName:`GitHub Light`,type:`light`,import:(()=>k(()=>import(`./github-light-EUqPIrTm.js`),[]))},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`,import:(()=>k(()=>import(`./github-light-default-BXViO-2h.js`),[]))},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`,import:(()=>k(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]))},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`,import:(()=>k(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]))},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`,import:(()=>k(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]))},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`,import:(()=>k(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]))},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`,import:(()=>k(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]))},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`,import:(()=>k(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]))},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`,import:(()=>k(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]))},{id:`horizon`,displayName:`Horizon`,type:`dark`,import:(()=>k(()=>import(`./horizon-CE9ld1lL.js`),[]))},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`dark`,import:(()=>k(()=>import(`./horizon-bright-Br1oVSNq.js`),[]))},{id:`houston`,displayName:`Houston`,type:`dark`,import:(()=>k(()=>import(`./houston-CsvMBhTu.js`),[]))},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`,import:(()=>k(()=>import(`./kanagawa-dragon-CXtmUGW6.js`),[]))},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`,import:(()=>k(()=>import(`./kanagawa-lotus-BN08jTvb.js`),[]))},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`,import:(()=>k(()=>import(`./kanagawa-wave-CTweb8Dz.js`),[]))},{id:`laserwave`,displayName:`LaserWave`,type:`dark`,import:(()=>k(()=>import(`./laserwave-C_8bwKvT.js`),[]))},{id:`light-plus`,displayName:`Light Plus`,type:`light`,import:(()=>k(()=>import(`./light-plus-DVQuIRkW.js`),[]))},{id:`material-theme`,displayName:`Material Theme`,type:`dark`,import:(()=>k(()=>import(`./material-theme-Bm3Qr25_.js`),[]))},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`,import:(()=>k(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]))},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`,import:(()=>k(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]))},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`,import:(()=>k(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]))},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`,import:(()=>k(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]))},{id:`min-dark`,displayName:`Min Dark`,type:`dark`,import:(()=>k(()=>import(`./min-dark-BSWPekZh.js`),[]))},{id:`min-light`,displayName:`Min Light`,type:`light`,import:(()=>k(()=>import(`./min-light-DDpmG2fV.js`),[]))},{id:`monokai`,displayName:`Monokai`,type:`dark`,import:(()=>k(()=>import(`./monokai-CdkpiU2Y.js`),[]))},{id:`night-owl`,displayName:`Night Owl`,type:`dark`,import:(()=>k(()=>import(`./night-owl-DhmEMT88.js`),[]))},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`,import:(()=>k(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]))},{id:`nord`,displayName:`Nord`,type:`dark`,import:(()=>k(()=>import(`./nord-Cb4Vim4T.js`),[]))},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`,import:(()=>k(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]))},{id:`one-light`,displayName:`One Light`,type:`light`,import:(()=>k(()=>import(`./one-light-D7Lr4KcI.js`),[]))},{id:`plastic`,displayName:`Plastic`,type:`dark`,import:(()=>k(()=>import(`./plastic-DQwYfKfQ.js`),[]))},{id:`poimandres`,displayName:`Poimandres`,type:`dark`,import:(()=>k(()=>import(`./poimandres-DRFjx7u4.js`),[]))},{id:`red`,displayName:`Red`,type:`dark`,import:(()=>k(()=>import(`./red-CJ3rzSJv.js`),[]))},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`,import:(()=>k(()=>import(`./rose-pine-BthvhNj6.js`),[]))},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`,import:(()=>k(()=>import(`./rose-pine-dawn-Dg85fqjY.js`),[]))},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`,import:(()=>k(()=>import(`./rose-pine-moon-hon4tzzS.js`),[]))},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`,import:(()=>k(()=>import(`./slack-dark-DnToyrRv.js`),[]))},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`,import:(()=>k(()=>import(`./slack-ochin-B2OO5cIa.js`),[]))},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`,import:(()=>k(()=>import(`./snazzy-light-4G7pJPwS.js`),[]))},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`,import:(()=>k(()=>import(`./solarized-dark-DV17i1UV.js`),[]))},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`,import:(()=>k(()=>import(`./solarized-light-DSh2HLQt.js`),[]))},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`,import:(()=>k(()=>import(`./synthwave-84-nFMaYfgc.js`),[]))},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`,import:(()=>k(()=>import(`./tokyo-night-oM2G3aXe.js`),[]))},{id:`vesper`,displayName:`Vesper`,type:`dark`,import:(()=>k(()=>import(`./vesper-D5bVUKB1.js`),[]))},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`,import:(()=>k(()=>import(`./vitesse-black-fwtXNY1n.js`),[]))},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`,import:(()=>k(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]))},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`,import:(()=>k(()=>import(`./vitesse-light-VbXTXTou.js`),[]))}].map(e=>[e.id,e.import])),zl=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Bl(){return 2147483648}function Vl(){return typeof performance<`u`?performance.now():Date.now()}var Hl=(e,t)=>e+(t-e%t)%t;async function Ul(e){let t,n,r={};function i(e){n=e,r.HEAPU8=new Uint8Array(e),r.HEAPU32=new Uint32Array(e)}function a(e,t,n){r.HEAPU8.copyWithin(e,t,t+n)}function o(e){try{return t.grow(e-n.byteLength+65535>>>16),i(t.buffer),1}catch{}}function s(e){let t=r.HEAPU8.length;e>>>=0;let n=Bl();if(e>n)return!1;for(let r=1;r<=4;r*=2){let i=t*(1+.2/r);if(i=Math.min(i,e+100663296),o(Math.min(n,Hl(Math.max(e,i),65536))))return!0}return!1}let c=typeof TextDecoder<`u`?new TextDecoder(`utf8`):void 0;function l(e,t,n=1024){let r=t+n,i=t;for(;e[i]&&!(i>=r);)++i;if(i-t>16&&e.buffer&&c)return c.decode(e.subarray(t,i));let a=``;for(;t<i;){let n=e[t++];if(!(n&128)){a+=String.fromCharCode(n);continue}let r=e[t++]&63;if((n&224)==192){a+=String.fromCharCode((n&31)<<6|r);continue}let i=e[t++]&63;if(n=(n&240)==224?(n&15)<<12|r<<6|i:(n&7)<<18|r<<12|i<<6|e[t++]&63,n<65536)a+=String.fromCharCode(n);else{let e=n-65536;a+=String.fromCharCode(55296|e>>10,56320|e&1023)}}return a}function u(e,t){return e?l(r.HEAPU8,e,t):``}let d={emscripten_get_now:Vl,emscripten_memcpy_big:a,emscripten_resize_heap:s,fd_write:()=>0};async function f(){let n=await e({env:d,wasi_snapshot_preview1:d});t=n.memory,i(t.buffer),Object.assign(r,n),r.UTF8ToString=u}return await f(),r}var Wl=Object.defineProperty,Gl=(e,t,n)=>t in e?Wl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,z=(e,t,n)=>Gl(e,typeof t==`symbol`?t:t+``,n),B=null;function Kl(e){throw new zl(e.UTF8ToString(e.getLastOnigError()))}var ql=class e{constructor(t){z(this,`utf16Length`),z(this,`utf8Length`),z(this,`utf16Value`),z(this,`utf8Value`),z(this,`utf16OffsetToUtf8`),z(this,`utf8OffsetToUtf16`);let n=t.length,r=e._utf8ByteLength(t),i=r!==n,a=i?new Uint32Array(n+1):null;i&&(a[n]=r);let o=i?new Uint32Array(r+1):null;i&&(o[r]=n);let s=new Uint8Array(r),c=0;for(let e=0;e<n;e++){let r=t.charCodeAt(e),l=r,u=!1;if(r>=55296&&r<=56319&&e+1<n){let n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(l=(r-55296<<10)+65536|n-56320,u=!0)}i&&(a[e]=c,u&&(a[e+1]=c),l<=127?o[c+0]=e:l<=2047?(o[c+0]=e,o[c+1]=e):l<=65535?(o[c+0]=e,o[c+1]=e,o[c+2]=e):(o[c+0]=e,o[c+1]=e,o[c+2]=e,o[c+3]=e)),l<=127?s[c++]=l:l<=2047?(s[c++]=192|(l&1984)>>>6,s[c++]=128|(l&63)>>>0):l<=65535?(s[c++]=224|(l&61440)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0):(s[c++]=240|(l&1835008)>>>18,s[c++]=128|(l&258048)>>>12,s[c++]=128|(l&4032)>>>6,s[c++]=128|(l&63)>>>0),u&&e++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=s,this.utf16OffsetToUtf8=a,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n<r;n++){let i=e.charCodeAt(n),a=i,o=!1;if(i>=55296&&i<=56319&&n+1<r){let t=e.charCodeAt(n+1);t>=56320&&t<=57343&&(a=(i-55296<<10)+65536|t-56320,o=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,o&&n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}},Jl=class e{constructor(t){if(z(this,`id`,++e.LAST_ID),z(this,`_onigBinding`),z(this,`content`),z(this,`utf16Length`),z(this,`utf8Length`),z(this,`utf16OffsetToUtf8`),z(this,`utf8OffsetToUtf16`),z(this,`ptr`),!B)throw new zl(`Must invoke loadWasm first.`);this._onigBinding=B,this.content=t;let n=new ql(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse?(e._sharedPtr||=B.omalloc(1e4),e._sharedPtrInUse=!0,B.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr):this.ptr=n.createString(B)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===e._sharedPtr?e._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};z(Jl,`LAST_ID`,0),z(Jl,`_sharedPtr`,0),z(Jl,`_sharedPtrInUse`,!1);var Yl=Jl,Xl=class{constructor(e){if(z(this,`_onigBinding`),z(this,`_ptr`),!B)throw new zl(`Must invoke loadWasm first.`);let t=[],n=[];for(let r=0,i=e.length;r<i;r++){let i=new ql(e[r]);t[r]=i.createString(B),n[r]=i.utf8Length}let r=B.omalloc(4*e.length);B.HEAPU32.set(t,r/4);let i=B.omalloc(4*e.length);B.HEAPU32.set(n,i/4);let a=B.createOnigScanner(r,i,e.length);for(let n=0,r=e.length;n<r;n++)B.ofree(t[n]);B.ofree(i),B.ofree(r),a===0&&Kl(B),this._onigBinding=B,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let r=0;if(typeof n==`number`&&(r=n),typeof e==`string`){e=new Yl(e);let n=this._findNextMatchSync(e,t,!1,r);return e.dispose(),n}return this._findNextMatchSync(e,t,!1,r)}_findNextMatchSync(e,t,n,r){let i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),r);if(a===0)return null;let o=i.HEAPU32,s=a/4,c=o[s++],l=o[s++],u=[];for(let t=0;t<l;t++){let n=e.convertUtf8OffsetToUtf16(o[s++]),r=e.convertUtf8OffsetToUtf16(o[s++]);u[t]={start:n,end:r,length:r-n}}return{index:c,captureIndices:u}}};function Zl(e){return typeof e.instantiator==`function`}function Ql(e){return typeof e.default==`function`}function $l(e){return e.data!==void 0}function eu(e){return typeof Response<`u`&&e instanceof Response}function tu(e){return typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<`u`&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer||typeof Uint32Array<`u`&&e instanceof Uint32Array}var nu;function ru(e){if(nu)return nu;async function t(){B=await Ul(async t=>{let n=e;return n=await n,typeof n==`function`&&(n=await n(t)),typeof n==`function`&&(n=await n(t)),Zl(n)?n=await n.instantiator(t):Ql(n)?n=await n.default(t):($l(n)&&(n=n.data),eu(n)?n=typeof WebAssembly.instantiateStreaming==`function`?await au(n)(t):await ou(n)(t):tu(n)||n instanceof WebAssembly.Module?n=await iu(n)(t):`default`in n&&n.default instanceof WebAssembly.Module&&(n=await iu(n.default)(t))),`instance`in n&&(n=n.instance),`exports`in n&&(n=n.exports),n})}return nu=t(),nu}function iu(e){return t=>WebAssembly.instantiate(e,t)}function au(e){return t=>WebAssembly.instantiateStreaming(e,t)}function ou(e){return async t=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}async function su(e){return e&&await ru(e),{createScanner(e){return new Xl(e.map(e=>typeof e==`string`?e:e.source))},createString(e){return new Yl(e)}}}var cu=jl({langs:Ll,themes:Rl,engine:()=>su(k(()=>import(`./wasm-BnjxR4X6.js`),[]))}),{codeToHtml:lu,codeToHast:uu,codeToTokens:du,codeToTokensBase:fu,codeToTokensWithThemes:pu,getSingletonHighlighter:mu,getLastGrammarState:hu}=Nl(cu,{guessEmbeddedLanguages:vc});function gu(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function _u(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var vu=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),V=String.raw;function yu(e,t){if(e==null)throw Error(t??`Value expected`);return e}var bu=V`\[\^?`,xu=`c.? | C(?:-.?)?|${V`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${V`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${V`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${V`o\{[^\}]*\}?`}|${V`\d{1,3}`}`,Su=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Cu=new RegExp(V`
\\ (?:
${xu}
| [gk]<[^>]*>?
| [gk]'[^']*'?
| .
)
| \( (?:
\? (?:
[:=!>({]
| <[=!]
| <[^>]*>
| '[^']*'
| ~\|?
| #(?:[^)\\]|\\.?)*
| [^:)]*[:)]
)?
| \*[^\)]*\)?
)?
| (?:${Su.source})+
| ${bu}
| .
`.replace(/\s+/g,``),`gsu`),wu=new RegExp(V`
\\ (?:
${xu}
| .
)
| \[:(?:\^?\p{Alpha}+|\^):\]
| ${bu}
| &&
| .
`.replace(/\s+/g,``),`gsu`);function Tu(e,t={}){let n={flags:``,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!=`string`)throw Error(`String expected as pattern`);let r=td(n.flags),i=[r.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(e){i.push(e)},replaceCurrentModX(e){i[i.length-1]=e},singleline:n.rules.singleline},o=[],s;for(Cu.lastIndex=0;s=Cu.exec(e);){let t=Eu(a,e,s[0],Cu.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(Cu.lastIndex=t.lastIndex)}let c=[],l=0;o.filter(e=>e.type===`GroupOpen`).forEach(e=>{e.kind===`capturing`?e.number=++l:e.raw===`(`&&c.push(e)}),l||c.forEach((e,t)=>{e.kind=`capturing`,e.number=t+1});let u=l||c.length;return{tokens:o.map(e=>e.type===`EscapedNumber`?rd(e,u):e).flat(),flags:r}}function Eu(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=Du(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:ju(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:Gu(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:Mu(n)}}if(a===`K`)return{token:zu(`keep`,n)};if(a===`N`||a===`R`)return{token:Ru(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:Ru(`any`,n)};if(a===`X`)return{token:Ru(`text_segment`,n)};let e=ku(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:Xu(n)};if(n===`(?{`)throw Error(`Unsupported callout "${n}"`);if(n.startsWith(`(?#`)){if(t[r]!==`)`)throw Error(`Unclosed comment group "(?#"`);return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:Yu(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:Hu(`group`,n)};if(n===`(?>`)return{token:Hu(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:Hu(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:Hu(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:Hu(`absence_repeater`,n)}}throw Error(n===`(?(`?`Unsupported conditional "${n}"`:`Invalid or unsupported group option "${n}"`)}if(n===`)`){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error(`Unmatched ")"`);return{token:Vu(n)}}if(e.getCurrentModX()){if(n===`#`){let e=t.indexOf(`
`,r);return{lastIndex:e===-1?t.length:e}}if(/^\s$/.test(n)){let e=/\s+/y;return e.lastIndex=r,{lastIndex:e.exec(t)?e.lastIndex:r}}}return n===`.`?{token:Ru(`dot`,n)}:n===`^`||n===`$`?{token:ju(e.singleline?{"^":V`\A`,$:V`\Z`}[n]:n,n)}:n===`|`?{token:Au(n)}:Su.test(n)?{tokens:id(n)}:{token:Nu(gu(n),n)}}function Du(e,t,n){let r=[Lu(t[1]===`^`,t)],i=1,a;for(wu.lastIndex=n;a=wu.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(Lu(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(Nu(93,e));else if(i--,r.push(Pu(e)),!i)break}else{let t=Ou(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:wu.lastIndex||e.length}}function Ou(e){if(e[0]===`\\`)return ku(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!vu.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return Ru(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?Fu(e):e===`&&`?Iu(e):Nu(gu(e),e)}function ku(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return Ju(e);if(`dDhHsSwW`.includes(n))return Qu(e);if(e.startsWith(V`\o{`))throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw Error(`Incomplete or invalid Unicode property "${e}"`);return $u(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=>`\\x${e.toString(16)}`).join(``);return Nu(gu(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return Nu(nd(e),e);if(qu.has(n))return Nu(qu.get(n),e);if(/\d/.test(n))return Bu(t,e);if(e===`\\`)throw Error(V`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return Nu(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function Au(e){return{type:`Alternator`,raw:e}}function ju(e,t){return{type:`Assertion`,kind:e,raw:t}}function Mu(e){return{type:`Backreference`,raw:e}}function Nu(e,t){return{type:`Character`,value:e,raw:t}}function Pu(e){return{type:`CharacterClassClose`,raw:e}}function Fu(e){return{type:`CharacterClassHyphen`,raw:e}}function Iu(e){return{type:`CharacterClassIntersector`,raw:e}}function Lu(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function Ru(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function zu(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:yu(n.flags),raw:t}}function Bu(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function Vu(e){return{type:`GroupClose`,raw:e}}function Hu(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function Uu(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function Wu(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function Gu(e){return{type:`Subroutine`,raw:e}}var Ku=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),qu=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function Ju(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return Nu(gu(t.toUpperCase())-64,e)}function Yu(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??=``;let i=(t.getCurrentModX()||n.includes(`x`))&&!r.includes(`x`),a=ed(n),o=ed(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),zu(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,Hu(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function Xu(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw Error(`Invalid named callout "${e}"`);if(r===``)throw Error(`Named callout tag with empty value not allowed "${e}"`);let a=i?i.split(`,`).filter(e=>e!==``).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[o,s,c]=a,l=Ku.has(n)?n.toLowerCase():`custom`;switch(l){case`fail`:case`mismatch`:case`skip`:if(a.length>0)throw Error(`Named callout arguments not allowed "${a}"`);break;case`error`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(typeof o==`string`)throw Error(`Named callout argument must be a number "${o}"`);break;case`max`:if(!a.length||a.length>2)throw Error(`Named callout must have one or two arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(a.length===2&&(typeof s==`number`||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case`count`:case`total_count`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(a.length===1&&(typeof o==`number`||!/^[<>X]$/.test(o)))throw Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case`cmp`:if(a.length!==3)throw Error(`Named callout must have three arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof s==`number`||!/^(?:[<>!=]=|[<>])$/.test(s))throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if(typeof c==`string`&&!/^[A-Za-z_]\w*$/.test(c))throw Error(`Named callout argument three must be a tag or number "${c}"`);break;case`custom`:throw Error(`Undefined callout name "${n}"`);default:throw Error(`Unexpected named callout kind "${l}"`)}return Uu(l,r??null,i?.split(`,`)??null,e)}function Zu(e){let t=null,n,r;if(e[0]===`{`){let{minStr:i,maxStr:a}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||a&&+a>o)throw Error(`Quantifier value unsupported in Oniguruma`);if(n=+i,r=a===void 0?+i:a===``?1/0:+a,n>r&&(t=`possessive`,[n,r]=[r,n]),e.endsWith(`?`)){if(t===`possessive`)throw Error(`Unsupported possessive interval quantifier chain with "?"`);t=`lazy`}else t||=`greedy`}else n=+(e[0]===`+`),r=e[0]===`?`?1:1/0,t=e[1]===`+`?`possessive`:e[1]===`?`?`lazy`:`greedy`;return Wu(t,n,r,e)}function Qu(e){let t=e[1].toLowerCase();return Ru({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function $u(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Ru(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function ed(e){let t={};return e.includes(`i`)&&(t.ignoreCase=!0),e.includes(`m`)&&(t.dotAll=!0),e.includes(`x`)&&(t.extended=!0),Object.keys(t).length?t:null}function td(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){let r=e[n];if(!`imxDPSWy`.includes(r))throw Error(`Invalid flag "${r}"`);if(r===`y`){if(!/^y{[gw]}/.test(e.slice(n)))throw Error(`Invalid or unspecified flag "y" mode`);t.textSegmentMode=e[n+2]===`g`?`grapheme`:`word`,n+=3;continue}t[{i:`ignoreCase`,m:`dotAll`,x:`extended`,D:`digitIsAscii`,P:`posixIsAscii`,S:`spaceIsAscii`,W:`wordIsAscii`}[r]]=!0}return t}function nd(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw Error(`Incomplete or invalid escape "${e}"`);let t=e[2]===`{`?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function rd(e,t){let{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!==`0`&&i.length===1||i[0]!==`0`&&+i<=t))return[Mu(n)];let a=[],o=i.match(/^[0-7]+|\d/g);for(let e=0;e<o.length;e++){let t=o[e],r;if(e===0&&t!==`8`&&t!==`9`){if(r=parseInt(t,8),r>127)throw Error(V`Octal encoded byte above 177 unsupported "${n}"`)}else r=gu(t);a.push(Nu(r,(e===0?`\\`:``)+t))}return a}function id(e){let t=[],n=new RegExp(Su,`gy`),r;for(;r=n.exec(e);){let e=r[0];if(e[0]===`{`){let r=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);if(r){let{min:i,max:a}=r.groups;if(+i>+a&&e.endsWith(`?`)){n.lastIndex--,t.push(Zu(e.slice(0,-1)));continue}}}t.push(Zu(e))}return t}function ad(e,t){if(!Array.isArray(e.body))throw Error(`Expected node with body array`);if(e.body.length!==1)return!1;let n=e.body[0];return!t||Object.keys(t).every(e=>t[e]===n[e])}function od(e){return sd.has(e.type)}var sd=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`]);function cd(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=Tu(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(e,t)=>{let n=r.tokens[a.nextIndex];switch(a.parent=e,a.nextIndex++,n.type){case`Alternator`:return vd();case`Assertion`:return ld(n);case`Backreference`:return ud(n,a);case`Character`:return Sd(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return dd(n,a,t);case`CharacterClassOpen`:return fd(n,a,t);case`CharacterSet`:return pd(n,a);case`Directive`:return Ed(n.kind,{flags:n.flags});case`GroupOpen`:return md(n,a,t);case`NamedCallout`:return Ad(n.kind,n.tag,n.arguments);case`Quantifier`:return hd(n,a);case`Subroutine`:return gd(n,a);default:throw Error(`Unexpected token type "${n.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=Nd(Dd(r.flags)),s=o.body[0];for(;a.nextIndex<r.tokens.length;){let e=i(s,{});e.type===`Alternative`?(o.body.push(e),s=e):s.body.push(e)}let{capturingGroups:c,hasNumberedRef:l,namedGroupsByName:u,subroutines:d}=a;if(l&&u.size&&!n.rules.captureGroup)throw Error(`Numbered backref/subroutine not allowed when using named capture`);for(let{ref:e}of d)if(typeof e==`number`){if(e>c.length)throw Error(`Subroutine uses a group number that's not defined`);e&&(c[e-1].isSubroutined=!0)}else if(u.has(e)){if(u.get(e).length>1)throw Error(V`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(V`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function ld({kind:e}){return yd(yu({"^":`line_start`,$:`line_end`,"\\A":`string_start`,"\\b":`word_boundary`,"\\B":`word_boundary`,"\\G":`search_start`,"\\y":`text_segment_boundary`,"\\Y":`text_segment_boundary`,"\\z":`string_end`,"\\Z":`string_end_newline`}[e],`Unexpected assertion kind "${e}"`),{negate:e===V`\B`||e===V`\Y`})}function ud({raw:e},t){let n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(n,r=!1)=>{let i=t.capturingGroups.length,a=!1;if(n>i){if(t.skipBackrefValidation)a=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`)}return t.hasNumberedRef=!0,bd(r?i+1-n:n,{orphan:a})};if(n){let n=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(n)return i(+n.groups.num,!!n.groups.sign);if(/[-+]/.test(r))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw Error(`Group name not defined to the left "${e}"`);return bd(r)}return i(+r)}function dd(e,t,n){let{tokens:r,walk:i}=t,a=t.parent,o=a.body.at(-1),s=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!==`CharacterClass`&&o.type!==`CharacterClassRange`&&s&&s.type!==`CharacterClassOpen`&&s.type!==`CharacterClassClose`&&s.type!==`CharacterClassIntersector`){let e=i(a,{...n,isCheckingRangeEnd:!0});if(o.type===`Character`&&e.type===`Character`)return a.body.pop(),wd(o,e);throw Error(`Invalid character class range`)}return Sd(gu(`-`))}function fd({negate:e},t,n){let{tokens:r,walk:i}=t,a=[Cd()],o=r[t.nextIndex],s=Wd(o);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)a.push(Cd()),t.nextIndex++;else{let e=a.at(-1);e.body.push(i(e,n))}s=Wd(r[t.nextIndex],o)}let c=Cd({negate:e});return a.length===1?c.body=a[0].body:(c.kind=`intersection`,c.body=a.map(e=>e.body.length===1?e.body[0]:e)),t.nextIndex++,c}function pd({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=Ud(n);if(vu.has(r)&&!o?.has(r))e=`posix`,n=r;else return Fd(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?jd(n,{negate:t}):Td(e,{negate:t})}function md(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=Id(e),l=c.type===`AbsenceFunction`,u=Bd(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&_u(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=Gd(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(vd()),t.nextIndex++;else{let e=c.body.at(-1),t=s(e,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(e.body.push(t),(u||n.isInLookbehind)&&!o){let e=`Lookbehind includes a pattern not allowed by Oniguruma`;if(d||n.isInNegLookbehind){if(zd(t)||t.type===`CapturingGroup`)throw Error(e)}else if(zd(t)||Bd(t)&&t.negate)throw Error(e)}}f=Gd(r[t.nextIndex])}return t.nextIndex++,c}function hd({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!od(a))throw Error(`Quantifier requires a repeatable token`);let o=Md(e,t,n,a);return i.body.pop(),o}function gd({raw:e},t){let{capturingGroups:n,subroutines:r}=t,i=e.slice(3,-1),a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(a){let e=+a.groups.num,r=n.length;if(t.hasNumberedRef=!0,i={"":e,"+":r+e,"-":r+1-e}[a.groups.sign],i<1)throw Error(`Invalid subroutine number`)}else i===`0`&&(i=0);let o=Pd(i);return r.push(o),o}function _d(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:Ld(t?.body)}}function vd(e){return{type:`Alternative`,body:Rd(e?.body)}}function yd(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function bd(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function xd(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!Vd(n.name))throw Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:`CapturingGroup`,number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:Ld(t?.body)}}function Sd(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(n.useLastValid)e=1114111;else throw Error(e>1310719?`Invalid code point out of range "\\x{${t}}"`:`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:`Character`,value:e}}function Cd(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:Rd(e?.body)}}function wd(e,t){if(t.value<e.value)throw Error(`Character class range out of order`);return{type:`CharacterClassRange`,min:e,max:t}}function Td(e,t){let n=!!t?.negate,r={type:`CharacterSet`,kind:e};return(e===`digit`||e===`hex`||e===`newline`||e===`space`||e===`word`)&&(r.negate=n),(e===`text_segment`||e===`newline`&&!n)&&(r.variableLength=!0),r}function Ed(e,t={}){if(e===`keep`)return{type:`Directive`,kind:e};if(e===`flags`)return{type:`Directive`,kind:e,flags:yu(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function Dd(e){return{type:`Flags`,...e}}function Od(e){let t=e?.atomic,n=e?.flags;if(t&&n)throw Error(`Atomic group cannot have flags`);return{type:`Group`,...t&&{atomic:t},...n&&{flags:n},body:Ld(e?.body)}}function kd(e){let t={behind:!1,negate:!1,...e};return{type:`LookaroundAssertion`,kind:t.behind?`lookbehind`:`lookahead`,negate:t.negate,body:Ld(e?.body)}}function Ad(e,t,n){return{type:`NamedCallout`,kind:e,tag:t,arguments:n}}function jd(e,t){let n=!!t?.negate;if(!vu.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:`CharacterSet`,kind:`posix`,value:e,negate:n}}function Md(e,t,n,r){if(t>n)throw Error(`Invalid reversed quantifier range`);return{type:`Quantifier`,kind:e,min:t,max:n,body:r}}function Nd(e,t){return{type:`Regex`,body:Ld(t?.body),flags:e}}function Pd(e){return{type:`Subroutine`,ref:e}}function Fd(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(Ud(e));if(!r){if(n.normalizeUnknownPropertyNames)r=Hd(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(V`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function Id({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return _d(`repeater`);case`atomic`:return Od({atomic:!0});case`capturing`:return xd(i,{name:n});case`group`:return Od({flags:e});case`lookahead`:case`lookbehind`:return kd({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function Ld(e){if(e===void 0)e=[vd()];else if(!Array.isArray(e)||!e.length||!e.every(e=>e.type===`Alternative`))throw Error(`Invalid body; expected array of one or more Alternative nodes`);return e}function Rd(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw Error(`Invalid body; expected array of nodes`);return e}function zd(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function Bd(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function Vd(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function Hd(e){return e.trim().replace(/[- _]+/g,`_`).replace(/[A-Z][a-z]+(?=[A-Z])/g,`$&_`).replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function Ud(e){return e.replace(/[- _]+/g,``).toLowerCase()}function Wd(e,t){let n=t;return yu(e,`Unclosed character class${n?.type===`Character`&&n.value===93&&n.raw===`]`?` (started with "]")`:``}`)}function Gd(e){return yu(e,`Unclosed group`)}function Kd(e,t,n=null){function r(e,t){for(let n=0;n<e.length;n++){let r=i(e[n],t,n,e);n=Math.max(-1,n+r)}}function i(a,o=null,s=null,c=null){let l=0,u=!1,d={node:a,parent:o,key:s,container:c,root:e,remove(){qd(c).splice(Math.max(0,Jd(s)+l),1),l--,u=!0},removeAllNextSiblings(){return qd(c).splice(Jd(s)+1)},removeAllPrevSiblings(){let e=Jd(s)+l;return l-=e,qd(c).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;c?c[Math.max(0,Jd(s)+l)]=e:yu(o,`Can't replace root node`)[s]=e,n&&i(e,o,s,c),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(qd(c).splice(Math.max(0,Jd(s)+l),1,...e),l+=e.length-1,n){let t=0;for(let n=0;n<e.length;n++)t+=i(e[n],o,Jd(s)+n+t,c)}u=!0},skip(){u=!0}},{type:f}=a,p=t[`*`],m=t[f],h=typeof p==`function`?p:p?.enter,g=typeof m==`function`?m:m?.enter;if(h?.(d,n),g?.(d,n),!u)switch(f){case`AbsenceFunction`:case`Alternative`:case`CapturingGroup`:case`CharacterClass`:case`Group`:case`LookaroundAssertion`:r(a.body,a);break;case`Assertion`:case`Backreference`:case`Character`:case`CharacterSet`:case`Directive`:case`Flags`:case`NamedCallout`:case`Subroutine`:break;case`CharacterClassRange`:i(a.min,a,`min`),i(a.max,a,`max`);break;case`Quantifier`:i(a.body,a,`body`);break;case`Regex`:r(a.body,a),i(a.flags,a,`flags`);break;default:throw Error(`Unexpected node type "${f}"`)}return m?.exit?.(d,n),p?.exit?.(d,n),l}return i(e),e}function qd(e){if(!Array.isArray(e))throw Error(`Container expected`);return e}function Jd(e){if(typeof e!=`number`)throw Error(`Numeric key expected`);return e}var Yd=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function Xd(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Zd(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var Qd=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`});function $d(e,t,n,r){let i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,`gsu`),a=[!1],o=0,s=``;for(let t of e.matchAll(i)){let{0:e,groups:{$skip:i}}=t;if(!i&&(!r||r===Qd.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?Qd.CHAR_CLASS:Qd.DEFAULT,negated:a[a.length-1]}):s+=n;continue}e[0]===`[`?(o++,a.push(e[1]===`^`)):e===`]`&&o&&(o--,a.pop()),s+=e}return s}function ef(e,t,n,r){$d(e,t,n,r)}function tf(e,t,n=0,r){if(!new RegExp(t,`su`).test(e))return null;let i=RegExp(`${t}|(?<$skip>\\\\?.)`,`gsu`);i.lastIndex=n;let a=0,o;for(;o=i.exec(e);){let{0:e,groups:{$skip:t}}=o;if(!t&&(!r||r===Qd.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function nf(e,t,n){return!!tf(e,t,0,n)}function rf(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,a=1,o;for(;o=n.exec(e);){let[e]=o;if(e===`[`)i++;else if(i)e===`]`&&i--;else if(e===`(`)a++;else if(e===`)`&&(a--,!a)){r=o.index;break}}return e.slice(t,r)}var af=new RegExp(String.raw`(?<noncapturingStart>${Yd})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,`gsu`);function of(e,t){let n=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};let i=[0],a=[],o=0,s=0,c=NaN,l;do{l=!1;let t=0,u=0,d=!1,f;for(af.lastIndex=Number.isNaN(c)?0:c+7;f=af.exec(e);){let{0:p,index:m,groups:{capturingStart:h,noncapturingStart:g}}=f;if(p===`[`)t++;else if(t)p===`]`&&t--;else if(p===`(?>`&&!d)c=m,d=!0;else if(d&&g)u++;else if(h)d?u++:(o++,i.push(o+s));else if(p===`)`&&d){if(!u){s++;let t=o+s;if(e=`${e.slice(0,c)}(?:(?=(${e.slice(c+3,m)}))<$$${t}>)${e.slice(m+1)}`,l=!0,a.push(t),Xd(n,t),r.size){let e=new Map;r.forEach((n,r)=>{e.set(r>=t?r+1:r,n.map(e=>e>=t?e+1:e))}),r=e}break}u--}}}while(l);return n.push(...a),e=$d(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:n}})=>{if(t){let n=+t;if(n>i.length-1)throw Error(`Backref "${e}" greater than number of captures`);return`\\${i[n]}`}return`\\${n}`},Qd.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var sf=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,cf=new RegExp(String.raw`
\\(?: \d+
| c[A-Za-z]
| [gk]<[^>]+>
| [pPu]\{[^\}]+\}
| u[A-Fa-f\d]{4}
| x[A-Fa-f\d]{2}
)
| \((?: \? (?: [:=!>]
| <(?:[=!]|[^>]+>)
| [A-Za-z\-]+:
| \(DEFINE\)
))?
| (?<qBase>${sf})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
| \\?.
`.replace(/\s+/g,``),`gsu`);function lf(e){if(!RegExp(`${sf}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(cf.lastIndex=0;o=cf.exec(e);){let{0:s,index:c,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s===`[`)a||(r=c),a++;else if(s===`]`)a?a--:r=null;else if(!a){if(u===`+`&&i&&!i.startsWith(`(`)){if(d)throw Error(`Invalid quantifier "${s}"`);let t=-1;if(/^\{\d+\}$/.test(l))e=Zd(e,c+l.length,u,``);else{if(i===`)`||i===`]`){let t=i===`)`?n:r;if(t===null)throw Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,t)}(?>${e.slice(t,c)}${l})${e.slice(c+s.length)}`}else e=`${e.slice(0,c-i.length)}(?>${i}${l})${e.slice(c+s.length)}`;t+=4}cf.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null)}i=s}return{pattern:e}}var uf=String.raw,df=uf`\(\?R=(?<rDepth>[^\)]+)\)|${uf`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,ff=uf`\(\?<(?![=!])(?<captureName>[^>]+)>`,pf=uf`${ff}|(?<unnamed>\()(?!\?)`,mf=new RegExp(uf`${ff}|${df}|\(\?|\\?.`,`gsu`),hf=`Cannot use multiple overlapping recursions`;function gf(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(df,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&nf(e,uf`\(\?\(DEFINE\)`,Qd.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=nf(e,uf`\\[1-9]`,Qd.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(mf.lastIndex=0;f=mf.exec(e);){let{0:t,groups:{captureName:p,rDepth:m,gRNameOrNum:h,gRDepth:g}}=f;if(t===`[`)u++;else if(u)t===`]`&&u--;else{if(m){if(_f(m),l)throw Error(hf);if(o)throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with global recursion`);let t=e.slice(0,f.index),s=e.slice(mf.lastIndex);if(nf(s,df,Qd.DEFAULT))throw Error(hf);let c=m-1;e=vf(t,s,c,!1,n,a,d),i=xf(i,t,c,a.length,0,d);break}if(h){_f(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(hf);break}if(!u)throw Error(uf`Recursive \g cannot be used outside the referenced group "${r===`external`?h:uf`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=rf(e,p);if(o&&nf(m,uf`${ff}|\((?!\?)`,Qd.DEFAULT))throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with recursion of capturing groups`);let _=e.slice(p,f.index),v=m.slice(_.length+t.length),y=a.length,b=g-1,x=vf(_,v,b,!0,n,a,d);i=xf(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,mf.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),mf.lastIndex),s.set(p,mf.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),mf.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function _f(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e)||(e=+e,e<2||e>100))throw Error(t)}function vf(e,t,n,r,i,a,o){let s=new Set;r&&ef(e+t,ff,({groups:{captureName:e}})=>{s.add(e)},Qd.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${yf(`(?:${e}`,`forward`,...c)}(?:)${yf(`${t})`,`backward`,...c)}${t}`}function yf(e,t,n,r,i,a,o){let s=e=>t===`forward`?e+2:n-e+2-1,c=``;for(let t=0;t<n;t++){let n=s(t);c+=$d(e,uf`${pf}|\\k<(?<backref>[^>]+)>`,({0:e,groups:{captureName:t,unnamed:s,backref:c}})=>{if(c&&r&&!r.has(c))return e;let l=`_$${n}`;if(s||t){let n=o+a.length+1;return a.push(n),bf(i,n),s?e:`(?<${t}${l}>`}return uf`\k<${c}${l}>`},Qd.DEFAULT)}return c}function bf(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function xf(e,t,n,r,i,a){if(e.size&&r){let o=0;ef(t,pf,()=>o++,Qd.DEFAULT);let s=a-o+i,c=new Map;return e.forEach((e,t)=>{let i=(r-o*n)/n,a=o*n,l=t>s+o?t+r:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+o+i)u.push(t+r);else if(t<=s+o)for(let e=0;e<=n;e++)u.push(t+o*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);c.set(l,u)}),c}return e}var H=String.fromCodePoint,U=String.raw,Sf={},Cf=globalThis.RegExp;Sf.flagGroups=(()=>{try{new Cf(`(?i:)`)}catch{return!1}return!0})(),Sf.unicodeSets=(()=>{try{new Cf(`[[]]`,`v`)}catch{return!1}return!0})(),Sf.bugFlagVLiteralHyphenIsRange=Sf.unicodeSets?(()=>{try{new Cf(U`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,Sf.bugNestedClassIgnoresNegation=Sf.unicodeSets&&new Cf(`[[^a]]`,`v`).test(`a`);function wf(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function Tf(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Ef(e,t){return Of[e]>=Of[t]}function Df(e,t){if(e==null)throw Error(t??`Value expected`);return e}var Of={ES2025:2025,ES2024:2024,ES2018:2018},kf={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`};function Af(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!kf[e.target])throw Error(`Unexpected target "${e.target}"`);let t={accuracy:`default`,avoidSubclass:!1,flags:``,global:!1,hasIndices:!1,lazyCompileLength:1/0,target:`auto`,verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target===`auto`&&(t.target=Sf.flagGroups?`ES2025`:Sf.unicodeSets?`ES2024`:`ES2018`),t}var jf=`[ -\r ]`,Mf=new Set([H(304),H(305)]),Nf=U`[\p{L}\p{M}\p{N}\p{Pc}]`;function Pf(e){if(Mf.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=Rf.get(n),a=If.get(n),o=Lf.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),a&&t.add(a),[...t]}var Ff=new Map(`C Other
Cc Control cntrl
Cf Format
Cn Unassigned
Co Private_Use
Cs Surrogate
L Letter
LC Cased_Letter
Ll Lowercase_Letter
Lm Modifier_Letter
Lo Other_Letter
Lt Titlecase_Letter
Lu Uppercase_Letter
M Mark Combining_Mark
Mc Spacing_Mark
Me Enclosing_Mark
Mn Nonspacing_Mark
N Number
Nd Decimal_Number digit
Nl Letter_Number
No Other_Number
P Punctuation punct
Pc Connector_Punctuation
Pd Dash_Punctuation
Pe Close_Punctuation
Pf Final_Punctuation
Pi Initial_Punctuation
Po Other_Punctuation
Ps Open_Punctuation
S Symbol
Sc Currency_Symbol
Sk Modifier_Symbol
Sm Math_Symbol
So Other_Symbol
Z Separator
Zl Line_Separator
Zp Paragraph_Separator
Zs Space_Separator
ASCII
ASCII_Hex_Digit AHex
Alphabetic Alpha
Any
Assigned
Bidi_Control Bidi_C
Bidi_Mirrored Bidi_M
Case_Ignorable CI
Cased
Changes_When_Casefolded CWCF
Changes_When_Casemapped CWCM
Changes_When_Lowercased CWL
Changes_When_NFKC_Casefolded CWKCF
Changes_When_Titlecased CWT
Changes_When_Uppercased CWU
Dash
Default_Ignorable_Code_Point DI
Deprecated Dep
Diacritic Dia
Emoji
Emoji_Component EComp
Emoji_Modifier EMod
Emoji_Modifier_Base EBase
Emoji_Presentation EPres
Extended_Pictographic ExtPict
Extender Ext
Grapheme_Base Gr_Base
Grapheme_Extend Gr_Ext
Hex_Digit Hex
IDS_Binary_Operator IDSB
IDS_Trinary_Operator IDST
ID_Continue IDC
ID_Start IDS
Ideographic Ideo
Join_Control Join_C
Logical_Order_Exception LOE
Lowercase Lower
Math
Noncharacter_Code_Point NChar
Pattern_Syntax Pat_Syn
Pattern_White_Space Pat_WS
Quotation_Mark QMark
Radical
Regional_Indicator RI
Sentence_Terminal STerm
Soft_Dotted SD
Terminal_Punctuation Term
Unified_Ideograph UIdeo
Uppercase Upper
Variation_Selector VS
White_Space space
XID_Continue XIDC
XID_Start XIDS`.split(/\s/).map(e=>[Ud(e),e])),If=new Map([[`s`,H(383)],[H(383),`s`]]),Lf=new Map([[H(223),H(7838)],[H(107),H(8490)],[H(229),H(8491)],[H(969),H(8486)]]),Rf=new Map([Vf(453),Vf(456),Vf(459),Vf(498),...Hf(8072,8079),...Hf(8088,8095),...Hf(8104,8111),Vf(8124),Vf(8140),Vf(8188)]),zf=new Map([[`alnum`,U`[\p{Alpha}\p{Nd}]`],[`alpha`,U`\p{Alpha}`],[`ascii`,U`\p{ASCII}`],[`blank`,U`[\p{Zs}\t]`],[`cntrl`,U`\p{Cc}`],[`digit`,U`\p{Nd}`],[`graph`,U`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,U`\p{Lower}`],[`print`,U`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,U`[\p{P}\p{S}]`],[`space`,U`\p{space}`],[`upper`,U`\p{Upper}`],[`word`,U`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,U`\p{AHex}`]]);function Bf(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Vf(e){let t=H(e);return[t.toLowerCase(),t]}function Hf(e,t){return Bf(e,t).map(e=>Vf(e))}var Uf=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function Wf(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};Jf(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Ef(n.bestEffortTarget,`ES2024`),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Kd(e,Gf,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return Kd(e,Kf,a),Kd(e,qf,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var Gf={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=Od();e.body[0].body.push(kd({negate:!0,body:r}),Fd(`Any`));let i=Od();i.body[0].body.push(Md(`greedy`,0,1/0,e)),n(W(i,t),{traverse:!0})}else throw Error(`Unsupported absence function "(?~|"`)},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind===`flags`);for(let e=n+1;e<t.body.length;e++){let n=t.body[e];Tf(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=tp(t.get(e));if(n){let t=Od({flags:n});t.body[0].body=e.body,e.body=[W(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c===`text_segment_boundary`)throw Error(`Unsupported text segment boundary "\\${l?`Y`:`y`}"`);if(c===`line_end`)o(W(kd({body:[vd({body:[yd(`string_end`)]}),vd({body:[Sd(10)]})]}),t));else if(c===`line_start`)o(W(up(U`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c===`search_start`){if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&sp(e))o(W(kd({negate:!0}),t));else if(d)throw Error(U`Uses "\G" in a way that requires a subclass`);else o(fp(yd(`string_start`),t)),s.strategy=`clip_search`}}else if(c!==`string_end`&&c!==`string_start`){if(c===`string_end_newline`)o(W(up(U`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${Nf})(?!${Nf})|(?<!${Nf})(?=${Nf}))`,n=`(?:(?<=${Nf})(?=${Nf})|(?<!${Nf})(?!${Nf}))`;o(W(up(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)}},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!lp(n)&&(n=ep(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!lp(r)&&(r=ep(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind===`intersection`&&n(W(Cd({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c===`digit`||u===`digit`)){n(fp(Td(`digit`,{negate:l}),t));return}if(o&&(c===`space`||u===`space`)){n(W(dp(up(jf),l),t));return}if(s&&(c===`word`||u===`word`)){n(fp(Td(`word`,{negate:l}),t));return}if(c===`any`)n(fp(Fd(`Any`),t));else if(c===`digit`)n(fp(Fd(`Nd`,{negate:l}),t));else if(c!==`dot`){if(c===`text_segment`){if(r===`strict`)throw Error(U`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=U`\p{RI}{2}|${e}(?:\u200D${e})*`;n(W(up(U`(?>\r\n|${i?U`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(fp(Fd(`AHex`,{negate:l}),t));else if(c===`newline`)n(W(up(l?`[^
]`:`(?>\r
?|[
\v\f…\u2028\u2029])`),t));else if(c===`posix`){if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${H(e.codePointAt(0)-1)}${H(e.codePointAt(2)+1)}-\u{10FFFF}`),n(W(up(`[${e}]`),t))}else n(W(dp(up(zf.get(u)),l),t))}else if(c===`property`)Ff.has(Ud(u))||(e.key=`sc`);else if(c===`space`)n(fp(Fd(`space`,{negate:l}),t));else if(c===`word`)n(W(dp(up(Nf),l),t));else throw Error(`Unexpected character set kind "${c}"`)}},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`){if(!c.enable&&!c.disable)r();else{let e=Od({flags:c});e.body[0].body=o(),i(W(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&ad(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(U`Uses "\K" in a way that's unsupported`);let o=kd({behind:!0});o.body[0].body=a(),i(W(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(W(kd({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=Od();t.body[0].body.push(e.body),e.body=W(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=ip(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error(U`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!lp(n)&&(n=ep(n,t),e.ref=n)}},Kf={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=fp(Qf(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&Tf(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=Tf(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=wf(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&(n.type!==`CapturingGroup`||n.name!==a&&n.number!==a););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?Qf(0):Zf(o,r.groupOriginByCopy,null),l=c;if(!s){let e=tp($f(o,e=>e.type===`Group`&&!!e.flags)),t=e?wf(r.globalFlags,e):r.globalFlags;Yf(t,r.currentFlags)||(l=Od({flags:np(t)}),l.body[0].body.push(c))}n(W(l,t),{traverse:!s})}},qf={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>Xf(t,e));i.length?i.length>1?n(W(Od({atomic:!0,body:i.reverse().map(e=>vd({body:[bd(e.number)]}))}),t)):e.ref=i[0].number:n(W(kd({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=xd();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function Jf(e){Kd(e,{"*"({node:e,parent:t}){e.parent=t}})}function Yf(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function Xf(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=rp(n.parent);for(let r of t){if(r===n)break;if(r===e||ap(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function Zf(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=Zf(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function Qf(e){let t=Pd(e);return t.isRecursive=!0,t}function $f(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function ep(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function tp(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function np({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function rp(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function ip(e){let t=e.find(e=>e.kind===`search_start`||cp(e,{negate:!1})||!op(e));if(!t)return null;if(t.kind===`search_start`)return t;if(t.type===`LookaroundAssertion`)return t.body[0].body[0];if(t.type===`CapturingGroup`||t.type===`Group`){let e=[];for(let n of t.body){let t=ip(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function ap(e,t){let n=rp(e)??[];for(let e of n)if(e===t||ap(e,t))return!0;return!1}function op({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function sp(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function cp(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&ad(e.body[0],{type:`Assertion`,kind:`search_start`})}function lp(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function up(e,t){let n=cd(e,{...t,unicodePropertyMap:Ff}).body;return n.length>1||n[0].body.length>1?Od({body:n}):n[0].body[0]}function dp(e,t){return e.negate=t,e}function fp(e,t){return e.parent=t,e}function W(e,t){return Jf(e),e.parent=t,e}function pp(e,t){let n=Af(t),r=Ef(n.target,`ES2024`),i=Ef(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];Kd(e,mp,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||o)&&!s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,Df(hp[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&Tf(f._captureTransfers,e.transferTo,[]).push(t)}),f}var mp={"*":{enter({node:e},t){if(Dp(e)){let n=t.getCurrentModI();t.pushModI(e.flags?wf({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){Dp(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){xp(H(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),Sp(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&Uf.has(e.value)&&t.setHasCasedChar()}},hp={Alternative({body:e},t,n){return e.map(n).join(``)},Assertion({kind:e,negate:t}){if(e===`string_end`)return`$`;if(e===`string_start`)return`^`;if(e===`word_boundary`)return t?U`\B`:U`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=H(e),r=Cp(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&xp(n)){let e=Pf(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);Sf.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(kp)&&(o=[Sd(45),...o.filter(e=>!kp(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||Sf.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=Od(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=vd({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(Sf.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=Cp(n,i),o=Cp(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&wp(Sp(e)).forEach(e=>{s.add(Array.isArray(e)?`${Cp(e[0],i)}-${Cp(e[1],i)}`:Cp(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:U`[^\n]`;if(e===`digit`)return t?U`\D`:U`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&Uf.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?U`\P`:U`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?U`\W`:U`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?`i`:``)+(e.dotAll?`s`:``)+(e.sticky?`y`:``)},Group({atomic:e,body:t,flags:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=wf(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${Tp(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+Ep(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:U`\g<${t}&R=${r}>`}},gp=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),_p=new Set([`-`,`\\`,`]`,`^`,`[`]),vp=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),yp=new Map([[9,U`\t`],[10,U`\n`],[11,U`\v`],[12,U`\f`],[13,U`\r`],[8232,U`\u2028`],[8233,U`\u2029`],[65279,U`\uFEFF`]]),bp=/^\p{Cased}$/u;function xp(e){return bp.test(e)}function Sp(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=H(e);if(!xp(t))continue;let o=Pf(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function Cp(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(yp.has(e))return yp.get(e);if(e<32||e>126&&e<160||e>262143||t&&Op(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?vp:_p:gp,a=H(e);return(i.has(a)?`\\`:``)+a}function wp(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function Tp(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function Ep({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function Dp({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function Op(e){return e>47&&e<58}function kp({type:e,value:t}){return e===`Character`&&t===45}var Ap=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=Mp(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(jp(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=Np(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function jp(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function Mp(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)Tf(n,t,{}).transferTo=e;return n}function Np(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function Pp(e,t){let n=Fp(e,t);return n.options?new Ap(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Fp(e,t){let n=Af(t),r=Wf(cd(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Ff}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=pp(r,n),a=gf(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=of(lf(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}var Ip=4294967295,Lp=class{constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}regexps;findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:Ip,end:Ip,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function Rp(e,t){return Pp(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function zp(e={}){let t=Object.assign({target:`auto`,cache:new Map},e);return t.regexConstructor||=e=>Rp(e,{target:t.target}),{createScanner(e){return new Lp(e,t)},createString(e){return{content:e}}}}var Bp=zp({forgiving:!0}),Vp=Object.fromEntries(Pl.flatMap(e=>(e.aliases??[]).map(t=>[t,e.id]))),Hp=new Set(Object.keys(Ll)),Up=e=>{let t=e.trim().toLowerCase();return Vp[t]||(Hp.has(t),t)},Wp=new Map,Gp=new Map,Kp=new Map,qp=e=>typeof e==`string`?e:e.name??`custom`,Jp=(e,t)=>`${e}-${qp(t[0])}-${qp(t[1])}`,Yp=(e,t,n)=>{let r=e.slice(0,100),i=e.length>100?e.slice(-100):``;return`${t}:${n[0]}:${n[1]}:${e.length}:${r}:${i}`},Xp=(e,t)=>{let n=Jp(e,t);if(Wp.has(n))return Wp.get(n);let r=cu({themes:t,langs:[e],engine:Bp});return Wp.set(n,r),r};function Zp(e={}){let t=e.themes??[`github-light`,`github-dark`];return{name:`shiki`,type:`code-highlighter`,supportsLanguage(e){let t=Up(e);return Hp.has(t)},getSupportedLanguages(){return Array.from(Hp)},getThemes(){return t},highlight({code:e,language:t,themes:n},r){let i=Up(t),a=[qp(n[0]),qp(n[1])],o=Yp(e,i,a);return Gp.has(o)?Gp.get(o):(r&&(Kp.has(o)||Kp.set(o,new Set),Kp.get(o).add(r)),Xp(Hp.has(i)?i:`text`,n).then(t=>{let n=t.getLoadedLanguages().includes(i)?i:`text`,r=t.codeToTokens(e,{lang:n,themes:{light:a[0],dark:a[1]}});Gp.set(o,r);let s=Kp.get(o);if(s){for(let e of s)e(r);Kp.delete(o)}}).catch(e=>{console.error(`[Streamdown Code] Failed to highlight code:`,e),Kp.delete(o)}),null)}}}var Qp=Zp();function $p(e,t){return em(e,t||{})||{type:`root`,children:[]}}function em(e,t){let n=tm(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function tm(e,t){switch(e.nodeType){case 1:return om(e,t);case 3:return im(e);case 8:return am(e);case 9:return nm(e,t);case 10:return rm();case 11:return nm(e,t);default:return}}function nm(e,t){return{type:`root`,children:sm(e,t)}}function rm(){return{type:`doctype`}}function im(e){return{type:`text`,value:e.nodeValue||``}}function am(e){return{type:`comment`,value:e.nodeValue||``}}function om(e,t){let n=e.namespaceURI,r=n===et.svg?vt:ht,i=n===et.html?e.tagName.toLowerCase():e.tagName,a=n===et.html&&i===`template`?e.content:e,o=e.getAttributeNames(),s={},c=-1;for(;++c<o.length;)s[o[c]]=e.getAttribute(o[c])||``;return r(i,s,sm(a,t))}function sm(e,t){let n=e.childNodes,r=[],i=-1;for(;++i<n.length;){let e=em(n[i],t);e!==void 0&&r.push(e)}return r}var cm=new DOMParser;function lm(e,t){return $p(t?.fragment?um(e):cm.parseFromString(e,`text/html`))}function um(e){let t=document.createElement(`template`);return t.innerHTML=e,t.content}var dm=(function(e,t,n){let r=st(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),fm=(function(e){if(e==null)return gm;if(typeof e==`string`)return mm(e);if(typeof e==`object`)return pm(e);if(typeof e==`function`)return hm(e);throw Error("Expected function, string, or array as `test`")});function pm(e){let t=[],n=-1;for(;++n<e.length;)t[n]=fm(e[n]);return hm(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function mm(e){return hm(t);function t(t){return t.tagName===e}}function hm(e){return t;function t(t,n,r){return!!(_m(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function gm(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function _m(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var vm=/\n/g,ym=/[\t ]+/g,bm=fm(`br`),xm=fm(Pm),Sm=fm(`p`),Cm=fm(`tr`),wm=fm([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,Nm,Fm]),Tm=fm(`address.article.aside.blockquote.body.caption.center.dd.dialog.dir.dl.dt.div.figure.figcaption.footer.form,.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.legend.li.listing.main.menu.nav.ol.p.plaintext.pre.section.ul.xmp`.split(`.`));function Em(e,t){let n=t||{},r=`children`in e?e.children:[],i=Tm(e),a=Mm(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...km(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...Dm(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?bm(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
`.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function Dm(e,t,n){return e.type===`element`?Om(e,t,n):e.type===`text`?n.whitespace===`normal`?km(e,n):Am(e):[]}function Om(e,t,n){let r=Mm(e,n),i=e.children||[],a=-1,o=[];if(wm(e))return o;let s,c;for(bm(e)||Cm(e)&&dm(t,e,Cm)?c=`
`:Sm(e)?(s=2,c=2):Tm(e)&&(s=1,c=1);++a<i.length;)o=o.concat(Dm(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?bm(i[a+1]):c}));return xm(e)&&dm(t,e,xm)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function km(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){vm.lastIndex=a;let e=vm.exec(n),i=e&&`index`in e?e.index:n.length;r.push(jm(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a!==0||t.breakBefore,i!==n.length||t.breakAfter)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function Am(e){return[String(e.value)]}function jm(e,t,n){let r=[],i=0,a;for(;i<e.length;){ym.lastIndex=i;let n=ym.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function Mm(e,t){if(e.type===`element`){let n=e.properties||{};switch(e.tagName){case`listing`:case`plaintext`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return n.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return n.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`}}return t.whitespace}function Nm(e){return!!(e.properties||{}).hidden}function Pm(e){return e.tagName===`td`||e.tagName===`th`}function Fm(e){return e.tagName===`dialog`&&!(e.properties||{}).open}var Im={},Lm=[];function Rm(e){let t=e||Im;return function(e,n){Qe(e,`element`,function(e,r){let i=Array.isArray(e.properties.className)?e.properties.className:Lm,a=i.includes(`language-math`),o=i.includes(`math-display`),s=i.includes(`math-inline`),c=o;if(!a&&!o&&!s)return;let l=r[r.length-1],u=e;if(e.tagName===`code`&&a&&l&&l.type===`element`&&l.tagName===`pre`&&(u=l,l=r[r.length-2],c=!0),!l)return;let d=Em(u,{whitespace:`pre`}),f;try{f=ie.renderToString(d,{...t,displayMode:c,throwOnError:!0})}catch(i){let a=i,o=a.name.toLowerCase();n.message(`Could not render math with KaTeX`,{ancestors:[...r,e],cause:a,place:e.position,ruleId:o,source:`rehype-katex`});try{f=ie.renderToString(d,{...t,displayMode:c,strict:`ignore`,throwOnError:!1})}catch{f=[{type:`element`,tagName:`span`,properties:{className:[`katex-error`],style:`color:`+(t.errorColor||`#cc0000`),title:String(i)},children:[{type:`text`,value:d}]}]}}typeof f==`string`&&(f=lm(f,{fragment:!0}).children);let p=l.children.indexOf(u);return l.children.splice(p,1,...f),Xe})}}function zm(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function Bm(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
`,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max(rt(i,`$`)+1,2)),s=n.enter(`mathFlow`),c=a.move(o);if(e.meta){let t=n.enter(`mathFlowMeta`);c+=a.move(n.safe(e.meta,{after:`
`,before:c,encode:[`$`],...a.current()})),t()}return c+=a.move(`
`),i&&(c+=a.move(i+`
`)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}var Vm={tokenize:Um,concrete:!0,name:`mathFlow`},Hm={tokenize:Wm,partial:!0};function Um(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),pt(e,l,`whitespace`)(t))}function l(t){return t===null||it(t)?d(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===null||it(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),d(t)):t===36?n(t):(e.consume(t),u)}function d(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(Hm,f,g)(n)}function f(t){return e.attempt({tokenize:_,partial:!0},g,p)(t)}function p(t){return(a?pt(e,m,`linePrefix`,a+1):m)(t)}function m(t){return t===null?g(t):it(t)?e.attempt(Hm,f,g)(t):(e.enter(`mathFlowValue`),h(t))}function h(t){return t===null||it(t)?(e.exit(`mathFlowValue`),m(t)):(e.consume(t),h)}function g(n){return e.exit(`mathFlow`),t(n)}function _(e,t,n){let i=0;return pt(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===36?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),pt(e,c,`whitespace`)(t))}function c(r){return r===null||it(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function Wm(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Gm(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:Km,previous:qm,name:`mathText`};function n(e,n,r){let i=0,a,o;return s;function s(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),c(t)}function c(n){return n===36?(e.consume(n),i++,c):i<2&&!t?r(n):(e.exit(`mathTextSequence`),l(n))}function l(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,d(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),l):it(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),l):(e.enter(`mathTextData`),u(t))}function u(t){return t===null||t===32||t===36||it(t)?(e.exit(`mathTextData`),l(t)):(e.consume(t),u)}function d(t){return t===36?(e.consume(t),a++,d):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,u(t))}}}function Km(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`mathTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function qm(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function Jm(e){return{flow:{36:Vm},text:{36:Gm(e)}}}var Ym={};function Xm(e){let t=this,n=e||Ym,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Jm(n)),a.push(zm()),o.push(Bm(n))}function Zm(e={}){return{name:`katex`,type:`math`,remarkPlugin:[Xm,{singleDollarTextMath:e.singleDollarTextMath??!1}],rehypePlugin:[Rm,{errorColor:e.errorColor??`var(--color-muted-foreground)`}],getStyles(){return`katex/dist/katex.min.css`}}}var Qm=Zm(),$m=`comm`,eh=`rule`,th=`decl`,nh=`@import`,rh=`@namespace`,ih=`@keyframes`,ah=`@layer`,oh=Math.abs,sh=String.fromCharCode;function ch(e){return e.trim()}function lh(e,t,n){return e.replace(t,n)}function uh(e,t){return e.charCodeAt(t)|0}function dh(e,t,n){return e.slice(t,n)}function fh(e){return e.length}function ph(e){return e.length}function mh(e,t){return t.push(e),e}var hh=1,gh=1,_h=0,vh=0,G=0,yh=``;function bh(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:hh,column:gh,length:o,return:``,siblings:s}}function xh(){return G}function Sh(){return G=vh>0?uh(yh,--vh):0,gh--,G===10&&(gh=1,hh--),G}function Ch(){return G=vh<_h?uh(yh,vh++):0,gh++,G===10&&(gh=1,hh++),G}function wh(){return uh(yh,vh)}function Th(){return vh}function Eh(e,t){return dh(yh,e,t)}function Dh(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Oh(e){return hh=gh=1,_h=fh(yh=e),vh=0,[]}function kh(e){return yh=``,e}function Ah(e){return ch(Eh(vh-1,Nh(e===91?e+2:e===40?e+1:e)))}function jh(e){for(;(G=wh())&&G<33;)Ch();return Dh(e)>2||Dh(G)>3?``:` `}function Mh(e,t){for(;--t&&Ch()&&!(G<48||G>102||G>57&&G<65||G>70&&G<97););return Eh(e,Th()+(t<6&&wh()==32&&Ch()==32))}function Nh(e){for(;Ch();)switch(G){case e:return vh;case 34:case 39:e!==34&&e!==39&&Nh(G);break;case 40:e===41&&Nh(e);break;case 92:Ch();break}return vh}function Ph(e,t){for(;Ch()&&e+G!==57&&(e+G!==84||wh()!==47););return`/*`+Eh(t,vh-1)+`*`+sh(e===47?e:Ch())}function Fh(e){for(;!Dh(wh());)Ch();return Eh(e,vh)}function Ih(e){return kh(Lh(``,null,null,null,[``],e=Oh(e),0,[0],e))}function Lh(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=0,b=``,x=i,S=a,C=r,w=b;g;)switch(m=y,y=Ch()){case 40:m!=108&&uh(w,d-1)==58?(v++,w+=`(`):w+=Ah(y);break;case 41:v--,w+=`)`;break;case 34:case 39:case 91:w+=Ah(y);break;case 9:case 10:case 13:case 32:if(v>0){w+=sh(y);break}w+=jh(m);break;case 92:w+=Mh(Th()-1,7);continue;case 47:switch(wh()){case 42:case 47:mh(zh(Ph(Ch(),Th()),t,n,c),c),(Dh(m||1)==5||Dh(wh()||1)==5)&&fh(w)&&dh(w,-1,void 0)!==` `&&(w+=` `);break;default:w+=`/`}break;case 123*h:s[l++]=fh(w)*_;case 125*h:case 59:case 0:if(v>0&&y){w+=sh(y);break}switch(y){case 0:case 125:g=0;case 59+u:_==-1&&(w=lh(w,/\f/g,``)),p>0&&(fh(w)-d||h===0)&&mh(p>32?Bh(w+`;`,r,n,d-1,c):Bh(lh(w,` `,``)+`;`,r,n,d-2,c),c);break;case 59:w+=`;`;default:if(mh(C=Rh(w,t,n,l,u,i,s,b,x=[],S=[],d,a),a),y===123){if(u===0)Lh(w,t,C,C,x,a,d,s,S);else{switch(f){case 99:if(uh(w,3)===110)break;case 108:if(uh(w,2)===97)break;default:u=0;case 100:case 109:case 115:}u?Lh(e,C,C,r&&mh(Rh(e,C,C,0,0,i,s,b,i,x=[],d,S),S),i,S,d,s,r?x:S):Lh(w,C,C,C,[``],S,0,s,S)}}}l=u=p=0,h=_=1,b=w=``,d=o;break;case 58:d=1+fh(w),p=m;default:if(h<1){if(y==123)--h;else if(y==125&&h++==0&&Sh()==125)continue}switch(w+=sh(y),y*h){case 38:_=u>0?1:(w+=`\f`,-1);break;case 44:if(v>0)break;s[l++]=(fh(w)-1)*_,_=1;break;case 64:wh()===45&&(w+=Ah(Ch())),f=wh(),u=d=fh(b=w+=Fh(Th())),y++;break;case 45:m===45&&fh(w)==2&&(h=0)}}return a}function Rh(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=i-1,p=i===0?a:[``],m=ph(p),h=0,g=0,_=0;h<r;++h)for(var v=0,y=dh(e,f+1,f=oh(g=o[h])),b=e;v<m;++v)(b=ch(g>0?p[v]+` `+y:lh(y,/&\f/g,p[v])))&&(c[_++]=b);return bh(e,t,n,i===0?eh:s,c,l,u,d)}function zh(e,t,n,r){return bh(e,t,n,$m,sh(xh()),dh(e,2,-2),0,r)}function Bh(e,t,n,r,i){return bh(e,t,n,th,dh(e,0,r),dh(e,r+1,-1),r,i)}function Vh(e,t){for(var n=``,r=0;r<e.length;r++)n+=t(e[r],r,e,t)||``;return n}function Hh(e,t,n,r){switch(e.type){case ah:if(e.children.length)break;case nh:case rh:case th:return e.return=e.return||e.value;case $m:return``;case ih:return e.return=e.value+`{`+Vh(e.children,r)+`}`;case eh:if(!fh(e.value=e.props.join(`,`)))return``}return fh(n=Vh(e.children,r))?e.return=e.value+`{`+n+`}`:``}function Uh(e){var t=ph(e);return function(n,r,i,a){for(var o=``,s=0;s<t;s++)o+=e[s](n,r,i,a)||``;return o}}var Wh=`c4`,Gh={id:Wh,detector:A(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./c4Diagram-5PPSVZJV-OczhytfR.js`);return{diagram:e}},__vite__mapDeps([102,103,104,1,105,106,107,108,109]));return{id:Wh,diagram:e}},`loader`)},Kh=`flowchart`,qh={id:Kh,detector:A((e,t)=>t?.flowchart?.defaultRenderer===`dagre-wrapper`||t?.flowchart?.defaultRenderer===`elk`?!1:/^\s*graph/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./flowDiagram-UKHOOZJN-BUBkadfr.js`);return{diagram:e}},__vite__mapDeps([110,104,1,103,105,106,108,107,111,112,113,114,109,115,116,117,118,119,120,121,122,123,124,125,126,127,128]));return{id:Kh,diagram:e}},`loader`)},Jh=`flowchart-v2`,Yh={id:Jh,detector:A((e,t)=>t?.flowchart?.defaultRenderer!==`dagre-d3`&&(t?.flowchart?.defaultRenderer===`elk`&&(t.layout=`elk`),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer===`dagre-wrapper`?!0:/^\s*flowchart/.test(e)),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./flowDiagram-UKHOOZJN-BUBkadfr.js`);return{diagram:e}},__vite__mapDeps([110,104,1,103,105,106,108,107,111,112,113,114,109,115,116,117,118,119,120,121,122,123,124,125,126,127,128]));return{id:Jh,diagram:e}},`loader`)},Xh=`swimlane`,Zh={id:Xh,detector:A(e=>/^\s*swimlane-beta\b/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./swimlanesDiagram-ULZ7WXOC-CrVvBgdm.js`);return{diagram:e}},__vite__mapDeps([129,103,104,1,105,106,108,107,111,112,113,114,109,115,116,117,118,119,120,121,122,123,124,125,126,127,128]));return{id:Xh,diagram:e}},`loader`)},Qh=`er`,$h={id:Qh,detector:A(e=>/^\s*erDiagram/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./erDiagram-JOGREHBK-DSe3_-3x.js`);return{diagram:e}},__vite__mapDeps([130,103,104,1,105,106,127,108,107,111,112,113,114,115,116,117,118,119,120,121,122,123,124]));return{id:Qh,diagram:e}},`loader`)},eg=`gitGraph`,tg={id:eg,detector:A(e=>/^\s*gitGraph/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./gitGraphDiagram-DS77QQ5N-CkEDBEZA.js`);return{diagram:e}},__vite__mapDeps([131,103,104,1,105,106,108,107,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150]));return{id:eg,diagram:e}},`loader`)},ng=`gantt`,rg={id:ng,detector:A(e=>/^\s*gantt/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./ganttDiagram-PKOTCBZU-BRE655Yg.js`);return{diagram:e}},__vite__mapDeps([151,1,103,104,105,106,152,153,154,107,108]));return{id:ng,diagram:e}},`loader`)},ig=`info`,ag={id:ig,detector:A(e=>/^\s*info/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./infoDiagram-6WML65LV-DCrOXTRX.js`);return{diagram:e}},__vite__mapDeps([155,103,104,1,105,106,156,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149]));return{id:ig,diagram:e}},`loader`)},og=`pie`,sg={id:og,detector:A(e=>/^\s*pie/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./pieDiagram-7S7Q4E2Y-DymmotfN.js`);return{diagram:e}},__vite__mapDeps([157,103,104,1,105,106,158,154,122,107,159,123,108,156,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149]));return{id:og,diagram:e}},`loader`)},cg=`quadrantChart`,lg={id:cg,detector:A(e=>/^\s*quadrantChart/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./quadrantDiagram-CIZ2JOQS-Bdmf940A.js`);return{diagram:e}},__vite__mapDeps([160,103,104,1,105,106,152,153,154]));return{id:cg,diagram:e}},`loader`)},ug=`xychart`,dg={id:ug,detector:A(e=>/^\s*xychart(-beta)?/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./xychartDiagram-ELKLHX3M-BXEvabM_.js`);return{diagram:e}},__vite__mapDeps([161,103,104,1,105,106,152,153,154,158,108,107,121,122,123,156,111,112]));return{id:ug,diagram:e}},`loader`)},fg=`requirement`,pg={id:fg,detector:A(e=>/^\s*requirement(Diagram)?/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./requirementDiagram-LRYGKXZP-DOQHap5a.js`);return{diagram:e}},__vite__mapDeps([162,103,104,1,105,106,108,107,111,112,113,114,115,116,117,118,119,120,121,122,123,124]));return{id:fg,diagram:e}},`loader`)},mg=`sequence`,hg={id:mg,detector:A(e=>/^\s*sequenceDiagram/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./sequenceDiagram-SI44F4Z6-DZz8CoAK.js`);return{diagram:e}},__vite__mapDeps([163,103,104,1,105,106,107,108,109,150,125]));return{id:mg,diagram:e}},`loader`)},gg=`class`,_g={id:gg,detector:A((e,t)=>t?.class?.defaultRenderer!==`dagre-wrapper`&&/^\s*classDiagram/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./classDiagram-JCYQIIEL-BGtYH_yr.js`);return{diagram:e}},__vite__mapDeps([164,103,104,1,105,106,108,107,111,112,113,114,109,115,116,117,118,119,120,121,122,123,124,165,128]));return{id:gg,diagram:e}},`loader`)},vg=`classDiagram`,yg={id:vg,detector:A((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer===`dagre-wrapper`?!0:/^\s*classDiagram-v2/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./classDiagram-v2-OCEON4UE-BGtYH_yr.js`);return{diagram:e}},__vite__mapDeps([166,103,104,1,105,106,108,107,111,112,113,114,109,115,116,117,118,119,120,121,122,123,124,165,128]));return{id:vg,diagram:e}},`loader`)},bg=`state`,xg={id:bg,detector:A((e,t)=>t?.state?.defaultRenderer!==`dagre-wrapper`&&/^\s*stateDiagram/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./stateDiagram-OKZ733FA-Diw1faox.js`);return{diagram:e}},__vite__mapDeps([167,103,104,1,105,106,108,107,121,122,123,111,112,113,114,168,169,170,109,115,116,117,118,119,120,124,171]));return{id:bg,diagram:e}},`loader`)},Sg=`stateDiagram`,Cg={id:Sg,detector:A((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer===`dagre-wrapper`),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./stateDiagram-v2-UEYNNEHI-CL8rTg3I.js`);return{diagram:e}},__vite__mapDeps([172,103,104,1,105,106,108,107,111,112,113,114,109,115,116,117,118,119,120,121,122,123,124,171]));return{id:Sg,diagram:e}},`loader`)},wg=`journey`,Tg={id:wg,detector:A(e=>/^\s*journey/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./journeyDiagram-NVQOT4AX-DjG_Ivem.js`);return{diagram:e}},__vite__mapDeps([173,103,104,1,105,106,159,122,107,128,109]));return{id:wg,diagram:e}},`loader`)},Eg={draw:A((e,t,n)=>{j.debug(`rendering svg for syntax error
`);let r=Ue(t),i=r.append(`g`);r.attr(`viewBox`,`0 0 2412 512`),Ce(r,100,512,!0),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z`),i.append(`path`).attr(`class`,`error-icon`).attr(`d`,`m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1440).attr(`y`,250).attr(`font-size`,`150px`).style(`text-anchor`,`middle`).text(`Syntax error in text`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1250).attr(`y`,400).attr(`font-size`,`100px`).style(`text-anchor`,`middle`).text(`mermaid version ${n}`)},`draw`)},Dg=Eg,Og={db:{},renderer:Eg,parser:{parse:A(()=>{},`parse`)}},kg=`flowchart-elk`,Ag={id:kg,detector:A((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer===`elk`?(t.layout=`elk`,!0):!1,`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./flowDiagram-UKHOOZJN-BUBkadfr.js`);return{diagram:e}},__vite__mapDeps([110,104,1,103,105,106,108,107,111,112,113,114,109,115,116,117,118,119,120,121,122,123,124,125,126,127,128]));return{id:kg,diagram:e}},`loader`)},jg=`timeline`,Mg={id:jg,detector:A(e=>/^\s*timeline/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./timeline-definition-Z64GVDOM-CeZF9jb3.js`);return{diagram:e}},__vite__mapDeps([174,103,104,1,105,106,159,122,107,108,156]));return{id:jg,diagram:e}},`loader`)},Ng=`mindmap`,Pg={id:Ng,detector:A(e=>/^\s*mindmap/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./mindmap-definition-FAOFIHXS-B-zxlH-3.js`);return{diagram:e}},__vite__mapDeps([175,103,104,1,105,106,108,107,111,112,113,114,115,116,117,118,119,120,121,122,123,124]));return{id:Ng,diagram:e}},`loader`)},Fg=`kanban`,Ig={id:Fg,detector:A(e=>/^\s*kanban/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./kanban-definition-27J2QSJJ-DcHXIYS7.js`);return{diagram:e}},__vite__mapDeps([176,103,104,1,105,106,108,107,156,111,112,128,114,117,118,119,125]));return{id:Fg,diagram:e}},`loader`)},Lg=`sankey`,Rg={id:Lg,detector:A(e=>/^\s*sankey(-beta)?/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./sankeyDiagram-W5VNT64P-Bw_JjJMs.js`);return{diagram:e}},__vite__mapDeps([177,103,104,1,105,106,158,154]));return{id:Lg,diagram:e}},`loader`)},zg=`packet`,Bg={id:zg,detector:A(e=>/^\s*packet(-beta)?/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./diagram-LBJQPF4R-DX9fn8uM.js`);return{diagram:e}},__vite__mapDeps([178,103,104,1,105,106,108,107,156,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149]));return{id:zg,diagram:e}},`loader`)},Vg=`radar`,Hg={id:Vg,detector:A(e=>/^\s*radar-beta/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./diagram-UB23O5K3-DN2WW8Lf.js`);return{diagram:e}},__vite__mapDeps([179,103,104,1,105,106,108,107,156,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149]));return{id:Vg,diagram:e}},`loader`)},Ug=`block`,Wg={id:Ug,detector:A(e=>/^\s*block(-beta)?/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./blockDiagram-VBNYF7ZC-DI8mHgDh.js`);return{diagram:e}},__vite__mapDeps([180,103,104,1,105,106,127,108,107,121,122,123,111,112,128,113,114,168]));return{id:Ug,diagram:e}},`loader`)},Gg=`treeView`,Kg={id:Gg,detector:A(e=>/^\s*treeView-beta/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./diagram-7IWD3JNH-CntAMELi.js`);return{diagram:e}},__vite__mapDeps([181,103,104,1,105,106,108,107,156,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,111,150]));return{id:Gg,diagram:e}},`loader`)},qg=`architecture`,Jg={id:qg,detector:A(e=>/^\s*architecture/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./architectureDiagram-T3A2C74G-BRtUBpl-.js`);return{diagram:e}},__vite__mapDeps([182,1,103,104,105,106,108,107,156,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,111,112,183]));return{id:qg,diagram:e}},`loader`)},Yg=`eventmodeling`,Xg={id:Yg,detector:A(e=>/^\s*eventmodeling/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./diagram-B4RE2ZJO-CzK0s5lu.js`);return{diagram:e}},__vite__mapDeps([184,134,103,104,1,105,106,108,107,132,133,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149]));return{id:Yg,diagram:e}},`loader`)},Zg=`ishikawa`,Qg={id:Zg,detector:A(e=>/^\s*ishikawa(-beta)?\b/i.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./ishikawaDiagram-WSZJBQD7-Eprw_Axw.js`);return{diagram:e}},__vite__mapDeps([185,103,104,1,105,106,108,107,156,119]));return{id:Zg,diagram:e}},`loader`)},$g=`venn`,e_={id:$g,detector:A(e=>/^\s*venn-beta/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./vennDiagram-T6HMQDX7-Bea6zExh.js`);return{diagram:e}},__vite__mapDeps([186,103,104,1,105,106,108,107,156,119]));return{id:$g,diagram:e}},`loader`)},t_=`treemap`,n_={id:t_,detector:A(e=>/^\s*treemap/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./diagram-Q27KOJAE-__XgFhkl.js`);return{diagram:e}},__vite__mapDeps([187,103,104,1,105,106,158,154,153,108,107,156,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,116,117]));return{id:t_,diagram:e}},`loader`)},r_=`wardley`,i_={id:r_,detector:A(e=>/^\s*wardley-beta/i.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./wardleyDiagram-T6FBY63Y-fLVlb6T8.js`);return{diagram:e}},__vite__mapDeps([188,103,104,1,105,106,108,107,156,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149]));return{id:r_,diagram:e}},`loader`)},a_=`cynefin`,o_={id:a_,detector:A(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./cynefinDiagram-MW4NZA55-BkWmLTXz.js`);return{diagram:e}},__vite__mapDeps([189,103,104,1,105,106,108,107,156,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149]));return{id:a_,diagram:e}},`loader`)},s_=`railroad`,c_={id:s_,detector:A(e=>/^\s*railroad-beta/i.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./railroadDiagram-AXF67PYL-C2_yAAm1.js`);return{diagram:e}},__vite__mapDeps([190,143,134,103,104,1,105,106,156,191,132,133,135,136,137,138,139,140,141,142,144,145,146,147,148,149]));return{id:s_,diagram:e}},`loader`)},l_=`railroadEbnf`,u_={id:l_,detector:A(e=>/^\s*railroad-ebnf-beta/i.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./ebnfDiagram-BXEA7PRR-BUzfFfXM.js`);return{diagram:e}},__vite__mapDeps([192,145,134,103,104,1,105,106,156,191,132,133,135,136,137,138,139,140,141,142,143,144,146,147,148,149]));return{id:l_,diagram:e}},`loader`)},d_=`railroadAbnf`,f_={id:d_,detector:A(e=>/^\s*railroad-abnf-beta/i.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./abnfDiagram-N423BO3Z-BXLvdit9.js`);return{diagram:e}},__vite__mapDeps([193,144,134,103,104,1,105,106,156,191,132,133,135,136,137,138,139,140,141,142,143,145,146,147,148,149]));return{id:d_,diagram:e}},`loader`)},p_=`railroadPeg`,m_={id:p_,detector:A(e=>/^\s*railroad-peg-beta/i.test(e),`detector`),loader:A(async()=>{let{diagram:e}=await k(async()=>{let{diagram:e}=await import(`./pegDiagram-VL7TDLO6-CCulIlRS.js`);return{diagram:e}},__vite__mapDeps([194,146,134,103,104,1,105,106,156,191,132,133,135,136,137,138,139,140,141,142,143,144,145,147,148,149]));return{id:p_,diagram:e}},`loader`)},h_=!1,g_=A(()=>{h_||(h_=!0,fe(`error`,Og,e=>e.toLowerCase().trim()===`error`),fe(`---`,{db:{clear:A(()=>{},`clear`)},styles:{},renderer:{draw:A(()=>{},`draw`)},parser:{parse:A(()=>{throw Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},`parse`)},init:A(()=>null,`init`)},e=>e.toLowerCase().trimStart().startsWith(`---`)),pe(Ag,Pg,Jg),pe(Gh,Ig,yg,_g,$h,rg,ag,sg,pg,hg,Zh,Yh,qh,Mg,tg,Cg,xg,Tg,lg,Rg,Bg,dg,Wg,Xg,Kg,Hg,Qg,n_,c_,u_,f_,m_,e_,i_,o_))},`addDiagrams`),__=A(async()=>{j.debug(`Loading registered diagrams`);let e=(await Promise.allSettled(Object.entries(Ee).map(async([e,{detector:t,loader:n}])=>{if(n)try{he(e)}catch{try{let{diagram:e,id:r}=await n();fe(r,e,t)}catch(t){throw j.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete Ee[e],t}}}))).filter(e=>e.status===`rejected`);if(e.length>0){j.error(`Failed to load ${e.length} external diagrams`);for(let t of e)j.error(t);throw Error(`Failed to load ${e.length} external diagrams`)}},`loadRegisteredDiagrams`),v_=`graphics-document document`;function y_(e,t){e.attr(`role`,v_),t!==``&&e.attr(`aria-roledescription`,t)}A(y_,`setA11yDiagramInfo`);function b_(e,t,n,r){if(e.insert!==void 0){if(n){let t=`chart-desc-${r}`;e.attr(`aria-describedby`,t),e.insert(`desc`,`:first-child`).attr(`id`,t).text(n)}if(t){let n=`chart-title-${r}`;e.attr(`aria-labelledby`,n),e.insert(`title`,`:first-child`).attr(`id`,n).text(t)}}}A(b_,`addSVGa11yTitleDescription`);var x_=class e{constructor(e,t,n,r,i){this.type=e,this.text=t,this.db=n,this.parser=r,this.renderer=i}static{A(this,`Diagram`)}static async fromText(t,n={}){let r=Se(),i=Oe(t,r);t=ze(t)+`
`;try{he(i)}catch{let e=ce(i);if(!e)throw new je(`Diagram ${i} not found.`);let{id:t,diagram:n}=await e();fe(t,n)}let{db:a,parser:o,renderer:s,init:c}=he(i);return o.parser&&(o.parser.yy=a),a.clear?.(),c?.(r),n.title&&a.setDiagramTitle?.(n.title),await o.parse(t),new e(i,t,a,o,s)}async render(e,t){await this.renderer.draw(this.text,e,t,this)}getParser(){return this.parser}getType(){return this.type}},S_=[],C_=A(()=>{S_.forEach(e=>{e()}),S_=[]},`attachFunctions`),w_=A(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,``).trimStart(),`cleanupComments`);function T_(e){let t=e.match(xe);if(!t)return{text:e,metadata:{}};let n=t[1],r=n?t[2].split(`
`).map(e=>e.startsWith(n)?e.slice(n.length):e).join(`
`):t[2],i=qe(r,{schema:Je})??{};i=typeof i==`object`&&!Array.isArray(i)?i:{};let a={};return i.displayMode&&(a.displayMode=i.displayMode.toString()),i.title&&(a.title=i.title.toString()),i.config&&(a.config=i.config),{text:e.slice(t[0].length),metadata:a}}A(T_,`extractFrontMatter`);var E_=A(e=>e.replace(/\r\n?/g,`
`).replace(/<(\w+)([^>]*)>/g,(e,t,n)=>`<`+t+n.replace(/="([^"]*)"/g,`='$1'`)+`>`),`cleanupText`),D_=A(e=>{let{text:t,metadata:n}=T_(e),{displayMode:r,title:i,config:a={}}=n;return r&&(a.gantt||={},a.gantt.displayMode=r),{title:i,config:a,text:t}},`processFrontmatter`),O_=A(e=>{let t=Ie.detectInit(e)??{},n=Ie.detectDirective(e,`wrap`);return Array.isArray(n)?t.wrap=n.some(({type:e})=>e===`wrap`):n?.type===`wrap`&&(t.wrap=!0),{text:Le(e),directive:t}},`processDirectives`);function k_(e){let t=D_(E_(e)),n=O_(t.text),r=Re(t.config,n.directive);return e=w_(n.text),{code:e,title:t.title,config:r}}A(k_,`preprocessDiagram`);function A_(e){let t=new TextEncoder().encode(e),n=Array.from(t,e=>String.fromCodePoint(e)).join(``);return btoa(n)}A(A_,`toBase64`);var j_=5e4,M_=`graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa`,N_=`sandbox`,P_=`loose`,F_=`http://www.w3.org/2000/svg`,I_=`http://www.w3.org/1999/xlink`,L_=`http://www.w3.org/1999/xhtml`,R_=`100%`,z_=`100%`,B_=`border:0;margin:0;`,V_=`margin:0`,H_=`allow-top-navigation-by-user-activation allow-popups`,U_=`The "iframe" tag is not supported by your browser.`,W_=[`foreignobject`],G_=[`dominant-baseline`];function K_(e){let t=k_(e);return ue(),De(t.config??{}),t}A(K_,`processAndSetConfigs`);async function q_(e,t){g_();try{let{code:t,config:n}=K_(e);return{diagramType:(await av(t)).type,config:n}}catch(e){if(t?.suppressErrors)return!1;throw e}}A(q_,`parse`);var J_=A((e,t,n=[])=>`.${e} ${t} ${de(`{ ${n.join(` !important; `)} !important; }`)}`,`cssImportantStyles`),Y_=A((e,t=new Map)=>{let n=new CSSStyleSheet;if(e.fontFamily!==void 0&&n.insertRule(`:root { --mermaid-font-family: ${e.fontFamily}}`,n.cssRules.length),e.altFontFamily!==void 0&&n.insertRule(`:root { --mermaid-alt-font-family: ${e.altFontFamily}}`,n.cssRules.length),t instanceof Map){let r=ge(e)?[`> *`,`span`]:[`rect`,`polygon`,`ellipse`,`circle`,`path`];t.forEach(e=>{kt(e.styles)||r.forEach(t=>{n.insertRule(J_(e.id,t,e.styles),n.cssRules.length)}),kt(e.textStyles)||n.insertRule(J_(e.id,`tspan`,(e?.textStyles||[]).map(e=>e.replace(`color`,`fill`))),n.cssRules.length)})}let r=``;if(e.themeCSS!==void 0){if(typeof n.replaceSync==`function`){let t=new CSSStyleSheet;t.replaceSync(e.themeCSS),r=Te(t)+`
`}else r+=`${e.themeCSS}
`}return r+Te(n)},`createCssStyles`),X_=A((e,t)=>Vh(Ih(`${e}{${t}}`),Uh([A(function(t,n,r,i){if(t.type===`rule`&&Array.isArray(t.props)){if(t.parent&&t.parent.type===`@keyframes`)return;t.props=t.props.map(n=>n===e&&Array.isArray(t.children)&&t.children.every(e=>e.type===`decl`&&new Set([`font-family`,`font-size`,`fill`]).has(e.props))||(n.startsWith(`${e} `)||n.startsWith(`${e}>`))&&!n.startsWith(`${e} ||`)?n:`${e} ${n}`)}else t.type.startsWith(`@`)&&([`@media`,`@supports`,`@layer`,`@scope`,`@container`,`@starting-style`,`@keyframes`].includes(t.type)||(j.warn(`Removing unsupported at-rule ${t.type} from CSS`),t.type=$m))},`addNamespace`),Hh])),`compileCSS`),Z_=A((e,t,n,r)=>{let i=Y_(e,n);return X_(r,ye(t,i,{...e.themeVariables,theme:e.theme,look:e.look},r))},`createUserStyles`),Q_=A((e=``,t,n)=>{let r=e;return!n&&!t&&(r=r.replace(/marker-end="url\([\d+./:=?A-Za-z-]*?#/g,`marker-end="url(#`)),r=Pe(r),r=r.replace(/<br>/g,`<br/>`),r},`cleanUpSvgCode`),$_=A((e=``,t)=>`<iframe style="width:${R_};height:${t?.viewBox?.baseVal?.height?t.viewBox.baseVal.height+`px`:z_};${B_}" src="data:text/html;charset=UTF-8;base64,${A_(`<body style="${V_}">${e}</body>`)}" sandbox="${H_}">
${U_}
</iframe>`,`putIntoIFrame`),ev=A((e,t,n,r,i)=>{let a=e.append(`div`);a.attr(`id`,n),r&&a.attr(`style`,r);let o=a.append(`svg`).attr(`id`,t).attr(`width`,`100%`).attr(`xmlns`,F_);return i&&o.attr(`xmlns:xlink`,i),o.append(`g`),e},`appendDivSvgG`);function tv(e,t){return e.append(`iframe`).attr(`id`,t).attr(`style`,`width: 100%; height: 100%;`).attr(`sandbox`,``)}A(tv,`sandboxedIframe`);var nv=A((e,t,n,r)=>{e.getElementById(t)?.remove(),e.getElementById(n)?.remove(),e.getElementById(r)?.remove()},`removeExistingElements`),rv=A(async function(e,t,n){g_();let r=K_(t);t=r.code;let i=Se();j.debug(i),t.length>(i?.maxTextSize??j_)&&(t=M_);let a=`#${e}`,o=`i`+e,s=`#`+o,c=`d`+e,l=`#`+c,u=A(()=>{let e=oe(f?s:l).node();e&&`remove`in e&&e.remove()},`removeTempElements`),d=oe(document.body),f=i.securityLevel===N_,p=i.securityLevel===P_,m=i.fontFamily;if(n!==void 0){if(n&&(n.innerHTML=``),f){let e=tv(oe(n),o);d=oe(e.nodes()[0].contentDocument.body),d.node().style.margin=`0`}else d=oe(n);ev(d,e,c,`font-family: ${m}`,I_)}else{if(nv(document,e,c,o),f){let e=tv(oe(document.body),o);d=oe(e.nodes()[0].contentDocument.body),d.node().style.margin=`0`}else d=oe(`body`);ev(d,e,c)}let h,g;try{h=await x_.fromText(t,{title:r.title})}catch(e){if(i.suppressErrorRendering)throw u(),e;h=await x_.fromText(`error`),g=e}let _=d.select(l).node(),v=h.type,y=_.firstChild,b=y.firstChild,x=h.renderer.getClasses?.(t,h),S=Z_(i,v,x,a),C=document.createElement(`style`);C.innerHTML=S,y.insertBefore(C,b);try{await h.renderer.draw(t,e,`11.16.1`,h)}catch(n){throw i.suppressErrorRendering?u():Dg.draw(t,e,`11.16.1`),n}let w=d.select(`${l} svg`),T=h.db.getAccTitle?.(),ee=h.db.getAccDescription?.();ov(v,w,T,ee),d.select(`[id="${e}"]`).selectAll(`foreignobject > *`).attr(`xmlns`,L_);let E=d.select(l).node().innerHTML;if(j.debug(`config.arrowMarkerAbsolute`,i.arrowMarkerAbsolute),E=Q_(E,f,we(i.arrowMarkerAbsolute)),f){let e=d.select(l+` svg`).node();E=$_(E,e)}else p||(E=se.sanitize(E,{ADD_TAGS:W_,ADD_ATTR:G_,HTML_INTEGRATION_POINTS:{foreignobject:!0}}));if(C_(),g)throw g;return u(),{diagramType:v,svg:E,bindFunctions:h.db.bindFunctions}},`render`);function iv(e={}){let t=Ae({},e);t?.fontFamily&&!t.themeVariables?.fontFamily&&(t.themeVariables||={},t.themeVariables.fontFamily=t.fontFamily),_e(t),t?.theme&&t.theme in be?t.themeVariables=be[t.theme].getThemeVariables(t.themeVariables):t&&(t.themeVariables=be.default.getThemeVariables(t.themeVariables));let n=typeof t==`object`?ke(t):le();ae(n.logLevel),g_()}A(iv,`initialize`);var av=A((e,t={})=>{let{code:n}=k_(e);return x_.fromText(n,t)},`getDiagramFromText`);function ov(e,t,n,r){y_(t,e),b_(t,n,r,t.attr(`id`))}A(ov,`addA11yInfo`);var sv=Object.freeze({render:rv,parse:q_,getDiagramFromText:av,initialize:iv,getConfig:Se,setConfig:ve,getSiteConfig:le,updateSiteConfig:me,reset:A(()=>{ue()},`reset`),globalReset:A(()=>{ue(Me)},`globalReset`),defaultConfig:Me});ae(Se().logLevel),ue(Se());var cv=A((e,t,n)=>{j.warn(e),Fe(e)?(n&&n(e.str,e.hash),t.push({...e,message:e.str,error:e})):(n&&n(e),e instanceof Error&&t.push({str:e.message,message:e.message,hash:e.name,error:e}))},`handleError`),lv=A(async function(e={querySelector:`.mermaid`}){try{await uv(e)}catch(t){if(Fe(t)&&j.error(t.str),xv.parseError&&xv.parseError(t),!e.suppressErrors)throw j.error(`Use the suppressErrors option to suppress these errors`),t}},`run`),uv=A(async function({postRenderCallback:e,querySelector:t,nodes:n}={querySelector:`.mermaid`}){let r=sv.getConfig();j.debug(`${e?``:`No `}Callback function found`);let i;if(n)i=n;else if(t)i=document.querySelectorAll(t);else throw Error(`Nodes and querySelector are both undefined`);j.debug(`Found ${i.length} diagrams`),r?.startOnLoad!==void 0&&(j.debug(`Start On Load: `+r?.startOnLoad),sv.updateSiteConfig({startOnLoad:r?.startOnLoad}));let a=new Ie.InitIDGenerator(r.deterministicIds,r.deterministicIDSeed),o,s=[];for(let t of Array.from(i)){if(j.info(`Rendering diagram: `+t.id),t.getAttribute(`data-processed`))continue;t.setAttribute(`data-processed`,`true`);let n=`mermaid-${a.next()}`;o=t.innerHTML,o=Ge(Ie.entityDecode(o)).trim().replace(/<br\s*\/?>/gi,`<br/>`);let r=Ie.detectInit(o);r&&j.debug(`Detected early reinit: `,r);try{let{svg:r,bindFunctions:i}=await bv(n,o,t);t.innerHTML=r,e&&await e(n),i&&i(t)}catch(e){cv(e,s,xv.parseError)}}if(s.length>0)throw s[0]},`runThrowsErrors`),dv=A(function(e){sv.initialize(e)},`initialize`),fv=A(async function(e,t,n){j.warn(`mermaid.init is deprecated. Please use run instead.`),e&&dv(e);let r={postRenderCallback:n,querySelector:`.mermaid`};typeof t==`string`?r.querySelector=t:t&&(r.nodes=t instanceof HTMLElement?[t]:t),await lv(r)},`init`),pv=A(async(e,{lazyLoad:t=!0}={})=>{g_(),pe(...e),t===!1&&await __()},`registerExternalDiagrams`),mv=A(function(){if(xv.startOnLoad){let{startOnLoad:e}=sv.getConfig();e&&xv.run().catch(e=>j.error(`Mermaid failed to initialize`,e))}},`contentLoaded`);typeof document<`u`&&window.addEventListener(`load`,mv,!1);var hv=A(function(e){xv.parseError=e},`setParseErrorHandler`),gv=[],_v=!1,vv=A(async()=>{if(!_v){for(_v=!0;gv.length>0;){let e=gv.shift();if(e)try{await e()}catch(e){j.error(`Error executing queue`,e)}}_v=!1}},`executeQueue`),yv=A(async(e,t)=>new Promise((n,r)=>{let i=A(()=>new Promise((i,a)=>{sv.parse(e,t).then(e=>{i(e),n(e)},e=>{j.error(`Error parsing`,e),xv.parseError?.(e),a(e),r(e)})}),`performCall`);gv.push(i),vv().catch(r)}),`parse`),bv=A((e,t,n)=>new Promise((r,i)=>{let a=A(()=>new Promise((a,o)=>{sv.render(e,t,n).then(e=>{a(e),r(e)},e=>{j.error(`Error parsing`,e),xv.parseError?.(e),o(e),i(e)})}),`performCall`);gv.push(a),vv().catch(i)}),`render`),xv={startOnLoad:!0,mermaidAPI:sv,parse:yv,render:bv,init:fv,run:lv,registerExternalDiagrams:pv,registerLayoutLoaders:Ke,initialize:dv,parseError:void 0,contentLoaded:mv,setParseErrorHandler:hv,detectType:Oe,registerIconPacks:We,getRegisteredDiagramsMetadata:A(()=>Object.keys(Ee).map(e=>({id:e})),`getRegisteredDiagramsMetadata`)},Sv=xv,Cv={startOnLoad:!1,theme:`default`,securityLevel:`strict`,fontFamily:`monospace`,suppressErrorRendering:!0};function wv(e={}){let t=!1,n={...Cv,...e.config},r={initialize(r){n={...Cv,...e.config,...r},Sv.initialize(n),t=!0},async render(e,r){return t||=(Sv.initialize(n),!0),await Sv.render(e,r)}};return{name:`mermaid`,type:`diagram`,language:`mermaid`,getMermaid(e){return e&&r.initialize(e),r}}}var Tv=wv(),Ev=e(s(),1),Dv=({className:e,from:t,...n})=>(0,P.jsx)(`div`,{className:l(`group flex w-full max-w-[95%] flex-col gap-2`,t===`user`?`is-user ml-auto justify-end`:`is-assistant`,e),...n}),Ov=({children:e,className:t,...n})=>(0,P.jsx)(`div`,{className:l(`is-user:dark flex w-fit min-w-0 max-w-full flex-col gap-2 overflow-hidden text-sm`,`group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground`,`group-[.is-assistant]:text-foreground`,t),...n,children:e});(0,M.createContext)(null);var kv={cjk:sa,code:Qp,math:Qm,mermaid:Tv};function Av({url:e,isOpen:t,onClose:n,onConfirm:r}){let[i,a]=(0,M.useState)(!1);return(0,M.useEffect)(()=>{t||a(!1)},[t]),!t||typeof document>`u`?null:(0,Ev.createPortal)((0,P.jsx)(`div`,{className:`fixed inset-0 z-[200] flex items-center justify-center bg-black/55 px-4 backdrop-blur-[2px]`,role:`presentation`,onMouseDown:e=>{e.target===e.currentTarget&&n()},children:(0,P.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`wmc-external-link-title`,className:`w-full max-w-xl rounded-3xl border border-border bg-card p-6 text-card-foreground shadow-2xl sm:p-7`,onMouseDown:e=>e.stopPropagation(),children:[(0,P.jsxs)(`div`,{className:`mb-5 flex items-start justify-between gap-4`,children:[(0,P.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,P.jsx)(`span`,{className:`grid size-10 shrink-0 place-items-center rounded-xl bg-primary/10 text-primary`,children:(0,P.jsx)(qt,{className:`size-5`})}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`h2`,{id:`wmc-external-link-title`,className:`text-xl font-bold tracking-tight`,children:`¿Abrir enlace externo?`}),(0,P.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Estás a punto de visitar un sitio web externo.`})]})]}),(0,P.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Cerrar`,className:`grid size-9 shrink-0 place-items-center rounded-lg text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground`,children:(0,P.jsx)(vn,{className:`size-5`})})]}),(0,P.jsx)(`div`,{className:`mb-6 break-all rounded-2xl border border-border bg-secondary/60 px-4 py-3.5 font-mono text-sm leading-relaxed text-foreground`,children:e}),(0,P.jsxs)(`div`,{className:`flex flex-col-reverse gap-3 sm:flex-row sm:justify-end`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:async()=>{try{await navigator.clipboard.writeText(e),a(!0),window.setTimeout(()=>a(!1),1600)}catch{}},className:`inline-flex h-11 items-center justify-center gap-2 rounded-xl border border-border bg-card px-5 text-sm font-semibold transition-colors hover:bg-secondary`,children:[(0,P.jsx)(Wt,{className:`size-4`}),i?`Enlace copiado`:`Copiar enlace`]}),(0,P.jsxs)(`button`,{type:`button`,onClick:r,className:`inline-flex h-11 items-center justify-center gap-2 rounded-xl bg-primary px-5 text-sm font-bold text-primary-foreground transition-opacity hover:opacity-90`,children:[(0,P.jsx)(qt,{className:`size-4`}),`Abrir enlace`]})]})]})}),document.body)}var jv={enabled:!0,renderModal:e=>(0,P.jsx)(Av,{...e})},Mv=(0,M.memo)(({className:e,...t})=>(0,P.jsx)(ft,{className:l(`size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0`,e),plugins:kv,linkSafety:jv,...t}),(e,t)=>e.children===t.children&&t.isAnimating===e.isAnimating);Mv.displayName=`MessageResponse`;var Nv=(0,M.createContext)({});function Pv(e){let t=(0,M.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Fv=typeof window<`u`?M.useLayoutEffect:M.useEffect,Iv=(0,M.createContext)(null);function Lv(e,t){e.indexOf(t)===-1&&e.push(t)}function Rv(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var zv=(e,t,n)=>n>t?t:n<e?e:n,Bv={},Vv=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Hv=e=>typeof e==`object`&&!!e,Uv=e=>/^0[^.\s]+$/u.test(e);function Wv(e){let t;return()=>(t===void 0&&(t=e()),t)}var Gv=e=>e,Kv=(...e)=>e.reduce((e,t)=>n=>t(e(n))),qv=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},Jv=class{constructor(){this.subscriptions=[]}add(e){return Lv(this.subscriptions,e),()=>Rv(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},Yv=e=>e*1e3,Xv=e=>e/1e3,Zv=(e,t)=>t?1e3/t*e:0,Qv=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,$v=1e-7,ey=12;function ty(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Qv(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>$v&&++s<ey);return o}function ny(e,t,n,r){if(e===t&&n===r)return Gv;let i=t=>ty(t,0,1,e,n);return e=>e===0||e===1?e:Qv(i(e),t,r)}var ry=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,iy=e=>t=>1-e(1-t),ay=ny(.33,1.53,.69,.99),oy=iy(ay),sy=ry(oy),cy=e=>e>=1?1:(e*=2)<1?.5*oy(e):.5*(2-2**(-10*(e-1))),ly=e=>1-Math.sin(Math.acos(e)),uy=iy(ly),dy=ry(ly),fy=ny(.42,0,1,1),py=ny(0,0,.58,1),my=ny(.42,0,.58,1),hy=e=>Array.isArray(e)&&typeof e[0]!=`number`,gy=e=>Array.isArray(e)&&typeof e[0]==`number`,_y={linear:Gv,easeIn:fy,easeInOut:my,easeOut:py,circIn:ly,circInOut:dy,circOut:uy,backIn:oy,backInOut:sy,backOut:ay,anticipate:cy},vy=e=>typeof e==`string`,yy=e=>{if(gy(e)){e.length;let[t,n,r,i]=e;return ny(t,n,r,i)}return vy(e)?(_y[e],`${e}`,_y[e]):e},by=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function xy(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var Sy=40;function Cy(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=by.reduce((e,t)=>(e[t]=xy(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=Bv.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,Sy),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:by.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<by.length;t++)o[by[t]].cancel(e)},state:i,steps:o}}var{schedule:K,cancel:wy,state:Ty,steps:Ey}=Cy(typeof requestAnimationFrame<`u`?requestAnimationFrame:Gv,!0),Dy;function Oy(){Dy=void 0}var ky={now:()=>(Dy===void 0&&ky.set(Ty.isProcessing||Bv.useManualTiming?Ty.timestamp:performance.now()),Dy),set:e=>{Dy=e,queueMicrotask(Oy)}},Ay=e=>t=>typeof t==`string`&&t.startsWith(e),jy=Ay(`--`),My=Ay(`var(--`),Ny=e=>My(e)?Py.test(e.split(`/*`)[0].trim()):!1,Py=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Fy(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var Iy={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Ly={...Iy,transform:e=>zv(0,1,e)},Ry={...Iy,default:1},zy=e=>Math.round(e*1e5)/1e5,By=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Vy(e){return e==null}var Hy=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Uy=(e,t)=>n=>!!(typeof n==`string`&&Hy.test(n)&&n.startsWith(e)||t&&!Vy(n)&&Object.prototype.hasOwnProperty.call(n,t)),Wy=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(By);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Gy=e=>zv(0,255,e),Ky={...Iy,transform:e=>Math.round(Gy(e))},qy={test:Uy(`rgb`,`red`),parse:Wy(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+Ky.transform(e)+`, `+Ky.transform(t)+`, `+Ky.transform(n)+`, `+zy(Ly.transform(r))+`)`};function Jy(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var Yy={test:Uy(`#`),parse:Jy,transform:qy.transform},Xy=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Zy=Xy(`deg`),Qy=Xy(`%`),q=Xy(`px`),$y=Xy(`vh`),eb=Xy(`vw`),tb={...Qy,parse:e=>Qy.parse(e)/100,transform:e=>Qy.transform(e*100)},nb={test:Uy(`hsl`,`hue`),parse:Wy(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+Qy.transform(zy(t))+`, `+Qy.transform(zy(n))+`, `+zy(Ly.transform(r))+`)`},J={test:e=>qy.test(e)||Yy.test(e)||nb.test(e),parse:e=>qy.test(e)?qy.parse(e):nb.test(e)?nb.parse(e):Yy.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?qy.transform(e):nb.transform(e),getAnimatableNone:e=>{let t=J.parse(e);return t.alpha=0,J.transform(t)}},rb=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ib(e){return isNaN(e)&&typeof e==`string`&&(e.match(By)?.length||0)+(e.match(rb)?.length||0)>0}var ab=`number`,ob=`color`,sb=`var`,cb=`var(`,lb="${}",ub=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function db(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(ub,e=>(J.test(e)?(r.color.push(a),i.push(ob),n.push(J.parse(e))):e.startsWith(cb)?(r.var.push(a),i.push(sb),n.push(e)):(r.number.push(a),i.push(ab),n.push(parseFloat(e))),++a,lb)).split(lb),indexes:r,types:i}}function fb(e){return db(e).values}function pb({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===ab?zy(r[a]):e===ob?J.transform(r[a]):r[a]}return i}}function mb(e){return pb(db(e))}var hb=e=>typeof e==`number`?0:J.test(e)?J.getAnimatableNone(e):e,gb=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:hb(e);function _b(e){let t=db(e);return pb(t)(t.values.map((e,n)=>gb(e,t.split[n])))}var vb={test:ib,parse:fb,createTransformer:mb,getAnimatableNone:_b};function yb(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function bb({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=yb(s,r,e+1/3),a=yb(s,r,e),o=yb(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function xb(e,t){return n=>n>0?t:e}var Y=(e,t,n)=>e+(t-e)*n,Sb=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Cb=[Yy,qy,nb],wb=e=>Cb.find(t=>t.test(e));function Tb(e){let t=wb(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===nb&&(n=bb(n)),n}var Eb=(e,t)=>{let n=Tb(e),r=Tb(t);if(!n||!r)return xb(e,t);let i={...n};return e=>(i.red=Sb(n.red,r.red,e),i.green=Sb(n.green,r.green,e),i.blue=Sb(n.blue,r.blue,e),i.alpha=Y(n.alpha,r.alpha,e),qy.transform(i))},Db=new Set([`none`,`hidden`]);function Ob(e,t){return Db.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function kb(e,t){return n=>Y(e,t,n)}function Ab(e){return typeof e==`number`?kb:typeof e==`string`?Ny(e)?xb:J.test(e)?Eb:Pb:Array.isArray(e)?jb:typeof e==`object`?J.test(e)?Eb:Mb:xb}function jb(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Ab(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Mb(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Ab(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Nb(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var Pb=(e,t)=>{let n=vb.createTransformer(t),r=db(e),i=db(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Db.has(e)&&!i.values.length||Db.has(t)&&!r.values.length?Ob(e,t):Kv(jb(Nb(r,i),i.values),n):(`${e}${t}`,xb(e,t))};function Fb(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?Y(e,t,n):Ab(e)(e,t)}var Ib=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>K.update(t,e),stop:()=>wy(t),now:()=>Ty.isProcessing?Ty.timestamp:ky.now()}},Lb=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},Rb=2e4;function zb(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function Bb(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(zb(r),Rb);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:Xv(i)}}var X={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Vb(e,t){return e*Math.sqrt(1-t*t)}var Hb=12;function Ub(e,t,n){let r=n;for(let n=1;n<Hb;n++)r-=e(r)/t(r);return r}var Wb=.001;function Gb({duration:e=X.duration,bounce:t=X.bounce,velocity:n=X.velocity,mass:r=X.mass}){let i,a;X.maxDuration;let o=1-t;o=zv(X.minDamping,X.maxDamping,o),e=zv(X.minDuration,X.maxDuration,Xv(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=Vb(t,o),c=Math.exp(-i);return Wb-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=Vb(t**2,o);return(-i(t)+Wb>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Ub(i,a,s);if(e=Yv(e),isNaN(c))return{stiffness:X.stiffness,damping:X.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var Kb=[`duration`,`bounce`],qb=[`stiffness`,`damping`,`mass`];function Jb(e,t){return t.some(t=>e[t]!==void 0)}function Yb(e){let t={velocity:X.velocity,stiffness:X.stiffness,damping:X.damping,mass:X.mass,isResolvedFromDuration:!1,...e};if(!Jb(e,qb)&&Jb(e,Kb)){if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*zv(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:X.mass,stiffness:i,damping:a}}else{let n=Gb({...e,velocity:0});t={...t,...n,mass:X.mass},t.isResolvedFromDuration=!0}}return t}function Xb(e=X.visualDuration,t=X.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Yb({...n,velocity:-Xv(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=Xv(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?X.restSpeed.granular:X.restSpeed.default,i||=v?X.restDelta.granular:X.restDelta.default;let y,b,x,S,C,w;if(h<1)x=Vb(_,h),S=(m+h*_*g)/x,y=e=>{let t=Math.exp(-h*_*e);return o-t*(S*Math.sin(x*e)+g*Math.cos(x*e))},C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>Yv(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=Yv(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=Yv(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(zb(T),Rb),t=Lb(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}Xb.applyToOptions=e=>{let t=Bb(e,100,Xb);return e.ease=t.ease,e.duration=Yv(t.duration),e.type=`keyframes`,e};var Zb=5;function Qb(e,t,n){let r=Math.max(t-Zb,0);return Zv(n-e(r),t-r)}function $b({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Xb({keyframes:[f.value,m(f.value)],velocity:Qb(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function ex(e,t,n){let r=[],i=n||Bv.mix||Fb,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=Kv(Array.isArray(t)?t[n]||Gv:t,a)),r.push(a)}return r}function tx(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=ex(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=qv(e[r],e[r+1],n);return s[r](i)};return n?t=>l(zv(e[0],e[a-1],t)):l}function nx(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=qv(0,t,r);e.push(Y(n,1,i))}}function rx(e){let t=[0];return nx(t,e.length-1),t}function ix(e,t){return e.map(e=>e*t)}function ax(e,t){return e.map(()=>t||my).splice(0,e.length-1)}function ox({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=hy(r)?r.map(yy):yy(r),a={done:!1,value:t[0]},o=tx(ix(n&&n.length===t.length?n:rx(t),e),t,{ease:Array.isArray(i)?i:ax(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var sx=e=>e!==null;function cx(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(sx),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var lx={decay:$b,inertia:$b,tween:ox,keyframes:ox,spring:Xb};function ux(e){typeof e.type==`string`&&(e.type=lx[e.type])}var dx=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},fx=e=>e/100,px=class extends dx{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==ky.now()&&this.tick(ky.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;ux(e);let{type:t=ox,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||ox;s!==ox&&typeof o[0]!=`number`&&(this.mixKeyframes=Kv(fx,Fb(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=zb(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=zv(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==$b&&(b.value=cx(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return Xv(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Xv(e)}get time(){return Xv(this.currentTime)}set time(e){e=Yv(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return Qb(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(ky.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Xv(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Ib,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(ky.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function mx(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var hx=e=>e*180/Math.PI,gx=e=>vx(hx(Math.atan2(e[1],e[0]))),_x={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:gx,rotateZ:gx,skewX:e=>hx(Math.atan(e[1])),skewY:e=>hx(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},vx=e=>(e%=360,e<0&&(e+=360),e),yx=gx,bx=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),xx=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Sx={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:bx,scaleY:xx,scale:e=>(bx(e)+xx(e))/2,rotateX:e=>vx(hx(Math.atan2(e[6],e[5]))),rotateY:e=>vx(hx(Math.atan2(-e[2],e[0]))),rotateZ:yx,rotate:yx,skewX:e=>hx(Math.atan(e[4])),skewY:e=>hx(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Cx(e){return+!!e.includes(`scale`)}function wx(e,t){if(!e||e===`none`)return Cx(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Sx,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=_x,i=t}if(!i)return Cx(t);let a=r[t],o=i[1].split(`,`).map(Ex);return typeof a==`function`?a(o):o[a]}var Tx=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return wx(n,t)};function Ex(e){return parseFloat(e.trim())}var Dx=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Ox=new Set([...Dx,`pathRotation`]),kx=e=>e===Iy||e===q,Ax=new Set([`x`,`y`,`z`]),jx=Dx.filter(e=>!Ax.has(e));function Mx(e){let t=[];return jx.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var Nx={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>wx(t,`x`),y:(e,{transform:t})=>wx(t,`y`)};Nx.translateX=Nx.x,Nx.translateY=Nx.y;var Px=new Set,Fx=!1,Ix=!1,Lx=!1;function Rx(){if(Ix){let e=Array.from(Px).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=Mx(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Ix=!1,Fx=!1,Px.forEach(e=>e.complete(Lx)),Px.clear()}function zx(){Px.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ix=!0)})}function Bx(){Lx=!0,zx(),Rx(),Lx=!1}var Vx=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Px.add(this),Fx||(Fx=!0,K.read(zx),K.resolveKeyframes(Rx))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}mx(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Px.delete(this)}cancel(){this.state===`scheduled`&&(Px.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Hx=e=>e.startsWith(`--`);function Ux(e,t,n){Hx(t)?e.style.setProperty(t,n):e.style[t]=n}var Wx={};function Gx(e,t){let n=Wv(e);return()=>Wx[t]??n()}var Kx=Gx(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),qx=Gx(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Jx=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Yx={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Jx([0,.65,.55,1]),circOut:Jx([.55,0,1,.45]),backIn:Jx([.31,.01,.66,-.59]),backOut:Jx([.33,1.53,.69,.99])};function Xx(e,t){if(e)return typeof e==`function`?qx()?Lb(e,t):`ease-out`:gy(e)?Jx(e):Array.isArray(e)?e.map(e=>Xx(e,t)||Yx.easeOut):Yx[e]}function Zx(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Xx(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function Qx(e){return typeof e==`function`&&`applyToOptions`in e}function $x({type:e,...t}){return Qx(e)&&qx()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var eS=class extends dx{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=$x(e);this.animation=Zx(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=cx(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Ux(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return Xv(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+Xv(e)}get time(){return Xv(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Yv(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&Kx()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),Gv):r(this)}},tS={anticipate:cy,backInOut:sy,circInOut:dy};function nS(e){return e in tS}function rS(e){typeof e.ease==`string`&&nS(e.ease)&&(e.ease=tS[e.ease])}var iS=10,aS=class extends eS{constructor(e){rS(e),ux(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new px({...a,autoplay:!1}),s=Math.max(iS,ky.now()-this.startTime),c=zv(0,iS,s-iS),l=o.sample(s).value,{name:u}=this.options;i&&u&&Ux(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},oS=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(vb.test(e)||e===`0`)&&!e.startsWith(`url(`));function sS(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function cS(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=oS(i,t),s=oS(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:sS(e)||(n===`spring`||Qx(n))&&r}function lS(e){e.duration=0,e.type=`keyframes`}var uS=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),dS=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function fS(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&dS.test(e[t]))return!0;return!1}var pS=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),mS=Wv(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function hS(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e,c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return mS()&&n&&(uS.has(n)||pS.has(n)&&fS(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var gS=40,_S=class extends dx{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ky.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||Vx;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=ky.now();let u=!0;cS(e,i,a,o)||(u=!1,(Bv.instantAnimations||!s)&&l?.(cx(e,n,t)),e[0]=e[e.length-1],lS(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>gS?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&hS(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new aS({...d,element:p})}catch{m=new px(d)}else m=new px(d);m.finished.then(()=>{this.notifyFinished()}).catch(Gv),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Bx()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function vS(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var yS=30,bS=e=>!isNaN(parseFloat(e)),xS={current:void 0},SS=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=ky.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=ky.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=bS(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new Jv);let n=this.events[e].add(t);return e===`change`?()=>{n(),K.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return xS.current&&xS.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=ky.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>yS)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,yS);return Zv(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function CS(e,t){return new SS(e,t)}function wS(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function TS(e,t){let n=e?.[t]??e?.default??e;return n===e?n:wS(n,e)}var ES={type:`spring`,stiffness:500,damping:25,restSpeed:10},DS=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),OS={type:`keyframes`,duration:.8},kS={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},AS=(e,{keyframes:t})=>t.length>2?OS:Ox.has(e)?e.startsWith(`scale`)?DS(t[1]):ES:kS,jS=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function MS(e){for(let t in e)if(!jS.has(t))return!0;return!1}var NS=(e,t,n,r={},i,a)=>o=>{let s=TS(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=Yv(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};MS(s)||Object.assign(u,AS(e,u)),u.duration&&=Yv(u.duration),u.repeatDelay&&=Yv(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(lS(u),u.delay===0&&(d=!0)),(Bv.instantAnimations||Bv.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,lS(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=cx(u.keyframes,s);if(e!==void 0){K.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new px(u):new _S(u)},PS=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function FS(e){let t=PS.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function IS(e,t,n=1){`${e}`;let[r,i]=FS(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Vv(e)?parseFloat(e):e}return Ny(i)?IS(i,t,n+1):i}function LS(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function RS(e,t,n,r){if(typeof t==`function`){let[i,a]=LS(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=LS(r);t=t(n===void 0?e.custom:n,i,a)}return t}function zS(e,t,n){let r=e.getProps();return RS(r,t,n===void 0?r.custom:n,e)}var BS=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Dx]),VS=e=>Array.isArray(e);function HS(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,CS(n))}function US(e){return VS(e)?e[e.length-1]||0:e}function WS(e,t){let{transitionEnd:n={},transition:r={},...i}=zS(e,t)||{};i={...i,...n};for(let t in i)HS(e,t,US(i[t]))}var GS=e=>!!(e&&e.getVelocity);function KS(e){return!!(GS(e)&&e.add)}function qS(e,t){let n=e.getValue(`willChange`);if(KS(n))return n.add(t);if(!n&&Bv.WillChange){let n=new Bv.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function JS(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var YS=`data-`+JS(`framerAppearId`);function XS(e){return e.props[YS]}function ZS({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function QS(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?wS(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&ZS(f,t))continue;let o={delay:n,...TS(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){K.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=XS(e);if(n){let e=window.MotionHandoffAnimation(n,t,K);e!==null&&(o.startTime=e,p=!0)}}qS(e,t);let m=l??e.shouldReduceMotion;r.start(NS(t,r,i,m&&BS.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>K.update(()=>{o&&WS(e,o)});d.length?Promise.all(d).then(t):t()}return d}function $S(e,t,n={}){let r=zS(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(QS(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return eC(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function eC(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push($S(c,t,{...o,delay:n+(typeof r==`function`?0:r)+vS(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function tC(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>$S(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=$S(e,t,n);else{let i=typeof t==`function`?zS(e,t,n.custom):t;r=Promise.all(QS(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var nC={test:e=>e===`auto`,parse:e=>e},rC=e=>t=>t.test(e),iC=[Iy,q,Qy,Zy,eb,$y,nC],aC=e=>iC.find(rC(e));function oC(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Uv(e)}var sC=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function cC(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(By)||[];if(!r)return e;let i=n.replace(r,``),a=+!!sC.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var lC=/\b([a-z-]*)\(.*?\)/gu,uC={...vb,getAnimatableNone:e=>{let t=e.match(lC);return t?t.map(cC).join(` `):e}},dC={...vb,getAnimatableNone:e=>{let t=vb.parse(e);return vb.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},fC={...Iy,transform:Math.round},pC={borderWidth:q,borderTopWidth:q,borderRightWidth:q,borderBottomWidth:q,borderLeftWidth:q,borderRadius:q,borderTopLeftRadius:q,borderTopRightRadius:q,borderBottomRightRadius:q,borderBottomLeftRadius:q,width:q,maxWidth:q,height:q,maxHeight:q,top:q,right:q,bottom:q,left:q,inset:q,insetBlock:q,insetBlockStart:q,insetBlockEnd:q,insetInline:q,insetInlineStart:q,insetInlineEnd:q,padding:q,paddingTop:q,paddingRight:q,paddingBottom:q,paddingLeft:q,paddingBlock:q,paddingBlockStart:q,paddingBlockEnd:q,paddingInline:q,paddingInlineStart:q,paddingInlineEnd:q,margin:q,marginTop:q,marginRight:q,marginBottom:q,marginLeft:q,marginBlock:q,marginBlockStart:q,marginBlockEnd:q,marginInline:q,marginInlineStart:q,marginInlineEnd:q,fontSize:q,backgroundPositionX:q,backgroundPositionY:q,rotate:Zy,pathRotation:Zy,rotateX:Zy,rotateY:Zy,rotateZ:Zy,scale:Ry,scaleX:Ry,scaleY:Ry,scaleZ:Ry,skew:Zy,skewX:Zy,skewY:Zy,distance:q,translateX:q,translateY:q,translateZ:q,x:q,y:q,z:q,perspective:q,transformPerspective:q,opacity:Ly,originX:tb,originY:tb,originZ:q,zIndex:fC,fillOpacity:Ly,strokeOpacity:Ly,numOctaves:fC},mC={...pC,color:J,backgroundColor:J,outlineColor:J,fill:J,stroke:J,borderColor:J,borderTopColor:J,borderRightColor:J,borderBottomColor:J,borderLeftColor:J,filter:uC,WebkitFilter:uC,mask:dC,WebkitMask:dC},hC=e=>mC[e],gC=new Set([uC,dC]);function _C(e,t){let n=hC(e);return gC.has(n)||(n=vb),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var vC=new Set([`auto`,`none`,`0`]);function yC(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!vC.has(t)&&db(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=_C(n,i)}var bC=class extends Vx{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Ny(r))){let i=IS(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!BS.has(n)||e.length!==2)return;let[r,i]=e,a=aC(r),o=aC(i);if(Fy(r)!==Fy(i)&&Nx[n]){this.needsMeasurement=!0;return}if(a!==o){if(kx(a)&&kx(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Nx[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||oC(e[t]))&&n.push(t);n.length&&yC(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Nx[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=Nx[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},xC=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function SC(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var CC=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function wC(e){return Hv(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:TC,cancel:EC}=Cy(queueMicrotask,!1),DC={x:!1,y:!1};function OC(){return DC.x||DC.y}function kC(e){return e===`x`||e===`y`?DC[e]?null:(DC[e]=!0,()=>{DC[e]=!1}):DC.x||DC.y?null:(DC.x=DC.y=!0,()=>{DC.x=DC.y=!1})}function AC(e,t){let n=SC(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function jC(e){return!(e.pointerType===`touch`||OC())}function MC(e,t,n={}){let[r,i,a]=AC(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!jC(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var NC=(e,t)=>t?e===t||NC(e,t.parentElement):!1,PC=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,FC=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function IC(e){return FC.has(e.tagName)||e.isContentEditable===!0}var LC=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function RC(e){return LC.has(e.tagName)||e.isContentEditable===!0}var zC=new WeakSet;function BC(e){return t=>{t.key===`Enter`&&e(t)}}function VC(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var HC=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=BC(()=>{if(zC.has(n))return;VC(n,`down`);let e=BC(()=>{VC(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>VC(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function UC(e){return PC(e)&&!OC()}var WC=new WeakSet;function GC(e,t,n={}){let[r,i,a]=AC(e,n),o=e=>{let r=e.currentTarget;if(!UC(e)||WC.has(e))return;zC.add(r),n.stopPropagation&&WC.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),zC.has(r)&&zC.delete(r),UC(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||NC(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),wC(e)&&(e.addEventListener(`focus`,e=>HC(e,i)),!IC(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function KC(e){return Hv(e)&&`ownerSVGElement`in e}var qC=new WeakMap,JC,YC=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:KC(r)&&`getBBox`in r?r.getBBox()[t]:r[n],XC=YC(`inline`,`width`,`offsetWidth`),ZC=YC(`block`,`height`,`offsetHeight`);function QC({target:e,borderBoxSize:t}){qC.get(e)?.forEach(n=>{n(e,{get width(){return XC(e,t)},get height(){return ZC(e,t)}})})}function $C(e){e.forEach(QC)}function ew(){typeof ResizeObserver>`u`||(JC=new ResizeObserver($C))}function tw(e,t){JC||ew();let n=SC(e);return n.forEach(e=>{let n=qC.get(e);n||(n=new Set,qC.set(e,n)),n.add(t),JC?.observe(e)}),()=>{n.forEach(e=>{let n=qC.get(e);n?.delete(t),n?.size||JC?.unobserve(e)})}}var nw=new Set,rw;function iw(){rw=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};nw.forEach(t=>t(e))},window.addEventListener(`resize`,rw)}function aw(e){return nw.add(e),rw||iw(),()=>{nw.delete(e),!nw.size&&typeof rw==`function`&&(window.removeEventListener(`resize`,rw),rw=void 0)}}function ow(e,t){return typeof e==`function`?aw(e):tw(e,t)}var sw={value:null,addProjectionMetrics:null};function cw(e){return KC(e)&&e.tagName===`svg`}var lw=[...iC,J,vb],uw=e=>lw.find(rC(e)),dw=()=>({translate:0,scale:1,origin:0,originPoint:0}),fw=()=>({x:dw(),y:dw()}),pw=()=>({min:0,max:0}),Z=()=>({x:pw(),y:pw()}),mw=new WeakMap;function hw(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function gw(e){return typeof e==`string`||Array.isArray(e)}var _w=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],vw=[`initial`,..._w];function yw(e){return hw(e.animate)||vw.some(t=>gw(e[t]))}function bw(e){return!!(yw(e)||e.variants)}function xw(e,t,n){for(let r in t){let i=t[r],a=n[r];if(GS(i))e.addValue(r,i);else if(GS(a))e.addValue(r,CS(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,CS(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Sw={current:null},Cw={current:!1},ww=typeof window<`u`;function Tw(){if(Cw.current=!0,ww){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Sw.current=e.matches;e.addEventListener(`change`,t),t()}else Sw.current=!1}}var Ew=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Dw={};function Ow(e){Dw=e}function kw(){return Dw}var Aw=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Vx,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=ky.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,K.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=yw(t),this.isVariantNode=bw(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&GS(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,mw.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Cw.current||Tw(),this.shouldReduceMotion=Sw.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),wy(this.notifyUpdate),wy(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&uS.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new eS({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:Yv(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Ox.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&K.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Dw){let t=Dw[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Z()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Ew.length;t++){let n=Ew[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=xw(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=CS(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Vv(n)||Uv(n))?n=parseFloat(n):!uw(n)&&vb.test(t)&&(n=_C(e,t)),this.setBaseTarget(e,GS(n)?n.get():n)),GS(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=RS(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!GS(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new Jv),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){TC.render(this.render)}},jw=class extends Aw{constructor(){super(...arguments),this.KeyframeResolver=bC}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;GS(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Mw=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Nw({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Pw({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Fw(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Iw(e){return e===void 0||e===1}function Lw({scale:e,scaleX:t,scaleY:n}){return!Iw(e)||!Iw(t)||!Iw(n)}function Rw(e){return Lw(e)||zw(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function zw(e){return Bw(e.x)||Bw(e.y)}function Bw(e){return e&&e!==`0%`}function Vw(e,t,n){return n+t*(e-n)}function Hw(e,t,n,r,i){return i!==void 0&&(e=Vw(e,i,r)),Vw(e,n,r)+t}function Uw(e,t=0,n=1,r,i){e.min=Hw(e.min,t,n,r,i),e.max=Hw(e.max,t,n,r,i)}function Ww(e,{x:t,y:n}){Uw(e.x,t.translate,t.scale,t.originPoint),Uw(e.y,n.translate,n.scale,n.originPoint)}var Gw=.999999999999,Kw=1.0000000000001;function qw(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(Jw(e.x,-a.scroll.offset.x),Jw(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,Ww(e,o)),r&&Rw(a.latestValues)&&Zw(e,a.latestValues,a.layout?.layoutBox))}t.x<Kw&&t.x>Gw&&(t.x=1),t.y<Kw&&t.y>Gw&&(t.y=1)}function Jw(e,t){e.min+=t,e.max+=t}function Yw(e,t,n,r,i=.5){Uw(e,t,n,Y(e.min,e.max,i),r)}function Xw(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Zw(e,t,n){let r=n??e;Yw(e.x,Xw(t.x,r.x),t.scaleX,t.scale,t.originX),Yw(e.y,Xw(t.y,r.y),t.scaleY,t.scale,t.originY)}function Qw(e,t){return Nw(Fw(e.getBoundingClientRect(),t))}function $w(e,t,n){let r=Qw(e,n),{scroll:i}=t;return i&&(Jw(r.x,i.offset.x),Jw(r.y,i.offset.y)),r}var eT={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},tT=Dx.length;function nT(e,t,n){let r=``,i=!0;for(let a=0;a<tT;a++){let o=Dx[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=CC(s,pC[o]);if(!c){i=!1;let t=eT[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${CC(a,pC.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function rT(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Ox.has(e)){o=!0;continue}if(jy(e)){i[e]=n;continue}{let t=CC(n,pC[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=nT(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function iT(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function aT(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var oT={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(q.test(e))e=parseFloat(e);else return e}return`${aT(e,t.target.x)}% ${aT(e,t.target.y)}%`}},sT={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=vb.parse(e);if(i.length>5)return r;let a=vb.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Y(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},cT={borderRadius:{...oT,applyTo:[...xC]},borderTopLeftRadius:oT,borderTopRightRadius:oT,borderBottomLeftRadius:oT,borderBottomRightRadius:oT,boxShadow:sT};function lT(e,{layout:t,layoutId:n}){return Ox.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!cT[e]||e===`opacity`)}function uT(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(GS(r[t])||i&&GS(i[t])||lT(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function dT(e){return window.getComputedStyle(e)}var fT=class extends jw{constructor(){super(...arguments),this.type=`html`,this.renderInstance=iT}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Ox.has(t))return this.projection?.isProjecting?Cx(t):Tx(e,t);{let n=dT(e),r=(jy(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Qw(e,t)}build(e,t,n){rT(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return uT(e,t,n)}},pT={offset:`stroke-dashoffset`,array:`stroke-dasharray`},mT={offset:`strokeDashoffset`,array:`strokeDasharray`};function hT(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?pT:mT;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var gT=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function _T(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(rT(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of gT)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&hT(d,i,a,o,!1)}var vT=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),yT=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function bT(e,t,n,r){iT(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(vT.has(n)?n:JS(n),t.attrs[n])}function xT(e,t,n){let r=uT(e,t,n);for(let n in e)if(GS(e[n])||GS(t[n])){let t=Dx.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var ST=class extends jw{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Z}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Ox.has(t)){let e=hC(t);return e&&e.default||0}return t=vT.has(t)?t:JS(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return xT(e,t,n)}build(e,t,n){_T(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){bT(e,t,n,r)}mount(e){this.isSVGTag=yT(e.tagName),super.mount(e)}},CT=vw.length;function wT(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&wT(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<CT;n++){let r=vw[n],i=e.props[r];(gw(i)||i===!1)&&(t[r]=i)}return t}function TT(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var ET=[..._w].reverse(),DT=_w.length;function OT(e){return t=>Promise.all(t.map(({animation:t,options:n})=>tC(e,t,n)))}function kT(e){let t=OT(e),n=MT(),r=!0,i=!1,a=t=>(n,r)=>{let i=zS(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=wT(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<DT;t++){let p=ET[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=gw(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||hw(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=AT(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},ee=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=VS(t)&&VS(n)?!TT(t,n)||y:t!==n,r?t==null?u.add(e):ee(e):t!==void 0&&u.has(e)?ee(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let E=v&&y;b&&(!E||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!E&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=zS(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=vS(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=zS(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=MT(),i=!0}}}function AT(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!TT(t,e):!1}function jT(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function MT(){return{animate:jT(!0),whileInView:jT(),whileHover:jT(),whileTap:jT(),whileDrag:jT(),whileFocus:jT(),exit:jT()}}function NT(e,t){e.min=t.min,e.max=t.max}function PT(e,t){NT(e.x,t.x),NT(e.y,t.y)}function FT(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var IT=.9999,LT=1.0001,RT=-.01,zT=.01;function BT(e){return e.max-e.min}function VT(e,t,n){return Math.abs(e-t)<=n}function HT(e,t,n,r=.5){e.origin=r,e.originPoint=Y(t.min,t.max,e.origin),e.scale=BT(n)/BT(t),e.translate=Y(n.min,n.max,e.origin)-e.originPoint,(e.scale>=IT&&e.scale<=LT||isNaN(e.scale))&&(e.scale=1),(e.translate>=RT&&e.translate<=zT||isNaN(e.translate))&&(e.translate=0)}function UT(e,t,n,r){HT(e.x,t.x,n.x,r?r.originX:void 0),HT(e.y,t.y,n.y,r?r.originY:void 0)}function WT(e,t,n,r=0){e.min=(r?Y(n.min,n.max,r):n.min)+t.min,e.max=e.min+BT(t)}function GT(e,t,n,r){WT(e.x,t.x,n.x,r?.x),WT(e.y,t.y,n.y,r?.y)}function KT(e,t,n,r=0){let i=r?Y(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+BT(t)}function qT(e,t,n,r){KT(e.x,t.x,n.x,r?.x),KT(e.y,t.y,n.y,r?.y)}function JT(e,t,n,r,i){return e-=t,e=Vw(e,1/n,r),i!==void 0&&(e=Vw(e,1/i,r)),e}function YT(e,t=0,n=1,r=.5,i,a=e,o=e){if(Qy.test(t)&&(t=parseFloat(t),t=Y(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Y(a.min,a.max,r);e===a&&(s-=t),e.min=JT(e.min,t,n,s,i),e.max=JT(e.max,t,n,s,i)}function XT(e,t,[n,r,i],a,o){YT(e,t[n],t[r],t[i],t.scale,a,o)}var ZT=[`x`,`scaleX`,`originX`],QT=[`y`,`scaleY`,`originY`];function $T(e,t,n,r){XT(e.x,t,ZT,n?n.x:void 0,r?r.x:void 0),XT(e.y,t,QT,n?n.y:void 0,r?r.y:void 0)}function eE(e){return e.translate===0&&e.scale===1}function tE(e){return eE(e.x)&&eE(e.y)}function nE(e,t){return e.min===t.min&&e.max===t.max}function rE(e,t){return nE(e.x,t.x)&&nE(e.y,t.y)}function iE(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function aE(e,t){return iE(e.x,t.x)&&iE(e.y,t.y)}function oE(e){return BT(e.x)/BT(e.y)}function sE(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function cE(e){return[e(`x`),e(`y`)]}function lE(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var uE=xC.length,dE=e=>typeof e==`string`?parseFloat(e):e,fE=e=>typeof e==`number`||q.test(e);function pE(e,t,n,r,i,a){i?(e.opacity=Y(0,n.opacity??1,hE(r)),e.opacityExit=Y(t.opacity??1,0,gE(r))):a&&(e.opacity=Y(t.opacity??1,n.opacity??1,r));for(let i=0;i<uE;i++){let a=xC[i],o=mE(t,a),s=mE(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||fE(o)===fE(s)?(e[a]=Math.max(Y(dE(o),dE(s),r),0),(Qy.test(s)||Qy.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=Y(t.rotate||0,n.rotate||0,r))}function mE(e,t){return e[t]===void 0?e.borderRadius:e[t]}var hE=_E(0,.5,uy),gE=_E(.5,.95,Gv);function _E(e,t,n){return r=>r<e?0:r>t?1:n(qv(e,t,r))}function vE(e,t,n){let r=GS(e)?e:CS(e);return r.start(NS(``,r,t,n)),r.animation}function yE(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var bE=(e,t)=>e.depth-t.depth,xE=class{constructor(){this.children=[],this.isDirty=!1}add(e){Lv(this.children,e),this.isDirty=!0}remove(e){Rv(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(bE),this.isDirty=!1,this.children.forEach(e)}};function SE(e,t){let n=ky.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(wy(r),e(a-t))};return K.setup(r,!0),()=>wy(r)}function CE(e){return GS(e)?e.get():e}var wE=class{constructor(){this.members=[]}add(e){Lv(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(Rv(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Rv(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},TE={hasAnimatedSinceResize:!0,hasEverUpdated:!1},EE={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},DE=[``,`X`,`Y`,`Z`],OE=1e3,kE=0;function AE(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function jE(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=XS(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,K,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&jE(r)}function ME({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=kE++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,sw.value&&(EE.nodes=EE.calculatedTargetDeltas=EE.calculatedProjections=0),this.nodes.forEach(FE),this.nodes.forEach(WE),this.nodes.forEach(GE),this.nodes.forEach(IE),sw.addProjectionMetrics&&sw.addProjectionMetrics(EE)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new xE)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Jv),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=KC(t)&&!cw(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;K.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=SE(i,250),TE.hasAnimatedSinceResize&&(TE.hasAnimatedSinceResize=!1,this.nodes.forEach(UE)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||QE,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!aE(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...TS(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||UE(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),wy(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(KE),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&jE(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(zE),this.nodes.forEach(RE);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(BE);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(VE),this.nodes.forEach(HE),this.nodes.forEach(NE),this.nodes.forEach(PE)):this.nodes.forEach(BE),this.clearAllSnapshots();let e=ky.now();Ty.delta=zv(0,1e3/60,e-Ty.timestamp),Ty.timestamp=e,Ty.isProcessing=!0,Ey.update.process(Ty),Ey.preRender.process(Ty),Ey.render.process(Ty),Ty.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,TC.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(LE),this.sharedNodes.forEach(qE)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,K.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){K.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!BT(this.snapshot.measuredBox.x)&&!BT(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=Z(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!tE(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||Rw(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),nD(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Z();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(iD))){let{scroll:e}=this.root;e&&(Jw(t.x,e.offset.x),Jw(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Z();if(PT(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&PT(t,e),Jw(t.x,i.offset.x),Jw(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||Z();PT(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(Jw(r.x,-n.scroll.offset.x),Jw(r.y,-n.scroll.offset.y)),Rw(n.latestValues)&&Zw(r,n.latestValues,n.layout?.layoutBox)}return Rw(this.latestValues)&&Zw(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=Z();PT(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!Rw(n.latestValues))continue;let r;n.instance&&(Lw(n.latestValues)&&n.updateSnapshot(),r=Z(),PT(r,n.measurePageBox())),$T(t,n.latestValues,n.snapshot?.layoutBox,r)}return Rw(this.latestValues)&&$T(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ty.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=Ty.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Z(),this.targetWithTransforms=Z()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),GT(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):PT(this.target,this.layout.layoutBox),Ww(this.target,this.targetDelta)):PT(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),sw.value&&EE.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Lw(this.parent.latestValues)||zw(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Z(),this.relativeTargetOrigin=Z(),qT(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),PT(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Ty.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;PT(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;qw(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Z());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(FT(this.prevProjectionDelta.x,this.projectionDelta.x),FT(this.prevProjectionDelta.y,this.projectionDelta.y)),UT(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!sE(this.projectionDelta.x,this.prevProjectionDelta.x)||!sE(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),sw.value&&EE.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=fw(),this.projectionDelta=fw(),this.projectionDeltaWithTransform=fw()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=fw();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Z(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!!(c&&!u&&this.options.crossfade===!0&&!this.path.some(ZE));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=Y(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=Y(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(JE(o.x,e.x,n),JE(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(qT(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),XE(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&rE(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Z(),PT(f,this.relativeTarget)),c&&(this.animationValues=a,pE(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(wy(this.pendingAnimation),void 0),this.pendingAnimation=K.update(()=>{TE.hasAnimatedSinceResize=!0,this.motionValue||=CS(0),this.motionValue.jump(0,!1),this.currentAnimation=vE(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(OE),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&rD(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Z();let t=BT(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=BT(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}PT(t,n),Zw(t,i),UT(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new wE),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&AE(`z`,e,r,this.animationValues);for(let t=0;t<DE.length;t++)AE(`rotate${DE[t]}`,e,r,this.animationValues),AE(`skew${DE[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=CE(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=CE(t?.pointerEvents)||``),this.hasProjected&&!Rw(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=lE(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in cT){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=cT[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?CE(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(RE),this.root.sharedNodes.clear()}}}function NE(e){e.updateLayout()}function PE(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)cE(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=BT(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;NT(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else rD(i,t.layoutBox,n)&&cE(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=BT(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=fw();UT(o,n,t.layoutBox);let s=fw();a?UT(s,e.applyTransform(r,!0),t.measuredBox):UT(s,n,t.layoutBox);let c=!tE(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=Z();qT(s,t.layoutBox,i.layoutBox,o);let c=Z();qT(c,n,a.layoutBox,o),aE(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function FE(e){sw.value&&EE.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function IE(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function LE(e){e.clearSnapshot()}function RE(e){e.clearMeasurements()}function zE(e){e.isLayoutDirty=!0,e.updateLayout()}function BE(e){e.isLayoutDirty=!1}function VE(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function HE(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function UE(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function WE(e){e.resolveTargetDelta()}function GE(e){e.calcProjection()}function KE(e){e.resetSkewAndRotation()}function qE(e){e.removeLeadSnapshot()}function JE(e,t,n){e.translate=Y(t.translate,0,n),e.scale=Y(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function YE(e,t,n,r){e.min=Y(t.min,n.min,r),e.max=Y(t.max,n.max,r)}function XE(e,t,n,r){YE(e.x,t.x,n.x,r),YE(e.y,t.y,n.y,r)}function ZE(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var QE={duration:.45,ease:[.4,0,.1,1]},$E=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),eD=$E(`applewebkit/`)&&!$E(`chrome/`)?Math.round:Gv;function tD(e){e.min=eD(e.min),e.max=eD(e.max)}function nD(e){tD(e.x),tD(e.y)}function rD(e,t,n){return e===`position`||e===`preserve-aspect`&&!VT(oE(t),oE(n),.2)}function iD(e){return e!==e.root&&e.scroll?.wasRoot}var aD=ME({attachResizeListener:(e,t)=>yE(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),oD={current:void 0},sD=ME({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!oD.current){let e=new aD({});e.mount(window),e.setOptions({layoutScroll:!0}),oD.current=e}return oD.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),cD=(0,M.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function lD(e=!0){let t=(0,M.useContext)(Iv);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,M.useId)();(0,M.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,M.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var uD=(0,M.createContext)({strict:!1}),dD={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]},fD=!1;function pD(){if(fD)return;let e={};for(let t in dD)e[t]={isEnabled:e=>dD[t].some(t=>!!e[t])};Ow(e),fD=!0}function mD(){return pD(),kw()}function hD(e){let t=mD();for(let n in e)t[n]={...t[n],...e[n]};Ow(t)}var gD=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function _D(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||gD.has(e)}var vD=r({default:()=>yD}),yD,bD=n((()=>{throw yD={},Error(`Could not resolve "@emotion/is-prop-valid" imported by "framer-motion". Is it installed?`)})),xD=e=>!_D(e);function SD(e){typeof e==`function`&&(xD=t=>t.startsWith(`on`)?!_D(t):e(t))}try{SD((bD(),t(vD)).default)}catch{}function CD(e,t,n){let r={};for(let i in e)(i!==`values`||typeof e.values!=`object`)&&(GS(e[i])||(xD(i)||n===!0&&_D(i)||!t&&!_D(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]));return r}var wD=(0,M.createContext)({});function TD(e,t){if(yw(e)){let{initial:t,animate:n}=e;return{initial:t===!1||gw(t)?t:void 0,animate:gw(n)?n:void 0}}return e.inherit===!1?{}:t}function ED(e){let{initial:t,animate:n}=TD(e,(0,M.useContext)(wD));return(0,M.useMemo)(()=>({initial:t,animate:n}),[DD(t),DD(n)])}function DD(e){return Array.isArray(e)?e.join(` `):e}var OD=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function kD(e,t,n){for(let r in t)!GS(t[r])&&!lT(r,n)&&(e[r]=t[r])}function AD({transformTemplate:e},t){return(0,M.useMemo)(()=>{let n=OD();return rT(n,t,e),Object.assign({},n.vars,n.style)},[t])}function jD(e,t){let n=e.style||{},r={};return kD(r,n,e),Object.assign(r,AD(e,t)),r}function MD(e,t){let n={},r=jD(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var ND=()=>({...OD(),attrs:{}});function PD(e,t,n,r){let i=(0,M.useMemo)(()=>{let n=ND();return _T(n,t,yT(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};kD(t,e.style,e),i.style={...t,...i.style}}return i}var FD=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function ID(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(FD.indexOf(e)>-1||/[A-Z]/u.test(e))}function LD(e,t,n,{latestValues:r},i,a=!1,o){let s=(o??ID(e)?PD:MD)(t,r,i,e),c=CD(t,typeof e==`string`,a),l=e===M.Fragment?{}:{...c,...s,ref:n},{children:u}=t,d=(0,M.useMemo)(()=>GS(u)?u.get():u,[u]);return(0,M.createElement)(e,{...l,children:d})}function RD({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:zD(n,r,i,e),renderState:t()}}function zD(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=CE(a[e]);let{initial:o,animate:s}=e,c=yw(e),l=bw(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!hw(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=RS(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var BD=e=>(t,n)=>{let r=(0,M.useContext)(wD),i=(0,M.useContext)(Iv),a=()=>RD(e,t,r,i);return n?a():Pv(a)},VD=BD({scrapeMotionValuesFromProps:uT,createRenderState:OD}),HD=BD({scrapeMotionValuesFromProps:xT,createRenderState:ND}),UD=Symbol.for(`motionComponentSymbol`);function WD(e,t,n){let r=(0,M.useRef)(n);(0,M.useInsertionEffect)(()=>{r.current=n});let i=(0,M.useRef)(null);return(0,M.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var GD=(0,M.createContext)({});function KD(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function qD(e,t,n,r,i,a){let{visualElement:o}=(0,M.useContext)(wD),s=(0,M.useContext)(uD),c=(0,M.useContext)(Iv),l=(0,M.useContext)(cD),u=l.reducedMotion,d=l.skipAnimations,f=(0,M.useRef)(null),p=(0,M.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,M.useContext)(GD);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&JD(f.current,n,i,h);let g=(0,M.useRef)(!1);(0,M.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[YS],v=(0,M.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return Fv(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),v.current&&m.animationState&&m.animationState.animateChanges())}),(0,M.useEffect)(()=>{m&&(!v.current&&m.animationState&&m.animationState.animateChanges(),v.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function JD(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:YD(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&KD(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function YD(e){if(e)return e.options.allowProjection===!1?YD(e.parent):e.projection}function XD(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&hD(r);let a=n?n===`svg`:ID(e),o=a?HD:VD;function s(n,s){let c,l={...(0,M.useContext)(cD),...n,layoutId:ZD(n)},{isStatic:u}=l,d=ED(n),f=o(n,u);if(!u&&typeof window<`u`){QD(l,r);let t=$D(l);c=t.MeasureLayout,d.visualElement=qD(e,f,l,i,t.ProjectionNode,a)}return(0,P.jsxs)(wD.Provider,{value:d,children:[c&&d.visualElement?(0,P.jsx)(c,{visualElement:d.visualElement,...l}):null,LD(e,n,WD(f,d.visualElement,s),f,u,t,a)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,M.forwardRef)(s);return c[UD]=e,c}function ZD({layoutId:e}){let t=(0,M.useContext)(Nv).id;return t&&e!==void 0?t+`-`+e:e}function QD(e,t){(0,M.useContext)(uD).strict}function $D(e){let{drag:t,layout:n}=mD();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function eO(e,t){if(typeof Proxy>`u`)return XD;let n=new Map,r=(n,r)=>XD(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,XD(a,void 0,e,t)),n.get(a))})}var tO=(e,t)=>t.isSVG??ID(e)?new ST(t):new fT(t,{allowProjection:e!==M.Fragment}),nO=class extends Mw{constructor(e){super(e),e.animationState||=kT(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();hw(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},rO=0,iO={animation:{Feature:nO},exit:{Feature:class extends Mw{constructor(){super(...arguments),this.id=rO++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=zS(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function aO(e){return{point:{x:e.pageX,y:e.pageY}}}var oO=e=>t=>PC(t)&&e(t,aO(t));function sO(e,t,n,r){return yE(e,t,oO(n),r)}var cO=({current:e})=>e?e.ownerDocument.defaultView:null,lO=(e,t)=>Math.abs(e-t);function uO(e,t){let n=lO(e.x,t.x),r=lO(e.y,t.y);return Math.sqrt(n**2+r**2)}var dO=new Set([`auto`,`scroll`]),fO=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=pO(this.lastRawMoveEventInfo,this.transformPagePoint));let e=hO(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=uO(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=Ty;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=pO(t,this.transformPagePoint),K.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=hO(e.type===`pointercancel`?this.lastMoveEventInfo:pO(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!PC(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=pO(aO(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=Ty;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,hO(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=Kv(sO(this.contextWindow,`pointermove`,this.handlePointerMove,d),sO(this.contextWindow,`pointerup`,this.handlePointerUp,d),sO(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(dO.has(e.overflowX)||dO.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),K.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),wy(this.updatePoint)}};function pO(e,t){return t?{point:t(e.point)}:e}function mO(e,t){return{x:e.x-t.x,y:e.y-t.y}}function hO({point:e},t){return{point:e,delta:mO(e,_O(t)),offset:mO(e,gO(t)),velocity:vO(t,.1)}}function gO(e){return e[0]}function _O(e){return e[e.length-1]}function vO(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=_O(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Yv(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>Yv(t)*2&&(r=e[1]);let a=Xv(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function yO(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Y(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Y(n,e,r.max):Math.min(e,n)),e}function bO(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function xO(e,{top:t,left:n,bottom:r,right:i}){return{x:bO(e.x,n,i),y:bO(e.y,t,r)}}function SO(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function CO(e,t){return{x:SO(e.x,t.x),y:SO(e.y,t.y)}}function wO(e,t){let n=.5,r=BT(e),i=BT(t);return i>r?n=qv(t.min,t.max-r,e.min):r>i&&(n=qv(e.min,e.max-i,t.min)),zv(0,1,n)}function TO(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var EO=.35;function DO(e=EO){return e===!1?e=0:e===!0&&(e=EO),{x:OO(e,`left`,`right`),y:OO(e,`top`,`bottom`)}}function OO(e,t,n){return{min:kO(e,t),max:kO(e,n)}}function kO(e,t){return typeof e==`number`?e:e[t]||0}var AO=new WeakMap,jO=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Z(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(aO(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=kC(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),cE(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Qy.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=BT(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&K.update(()=>i(e,t),!1,!0),qS(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=FO(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&K.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new fO(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:cO(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&K.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!PO(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=yO(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&KD(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?xO(n.layoutBox,e):!1,this.elastic=DO(t),r!==this.constraints&&!KD(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&cE(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=TO(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!KD(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=$w(n,r.root,this.visualElement.getTransformPagePoint()),a=CO(r.layout.layoutBox,i);if(t){let e=t(Pw(a));this.hasMutatedConstraints=!!e,e&&(a=Nw(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=cE(o=>{if(!PO(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return qS(this.visualElement,e),n.start(NS(e,n,0,t,this.visualElement,!1))}stopAnimation(){cE(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){cE(t=>{let{drag:n}=this.getProps();if(!PO(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-Y(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!KD(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};cE(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=wO({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),cE(t=>{if(!PO(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(Y(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;AO.set(this.visualElement,this);let e=this.visualElement.current,t=sO(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&RC(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();KD(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=NO(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),K.read(r);let o=yE(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(cE(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=EO,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function MO(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function NO(e,t,n){let r=ow(e,MO(n)),i=ow(t,MO(n));return()=>{r(),i()}}function PO(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function FO(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var IO=class extends Mw{constructor(e){super(e),this.removeGroupControls=Gv,this.removeListeners=Gv,this.controls=new jO(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Gv}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},LO=e=>(t,n)=>{e&&K.update(()=>e(t,n),!1,!0)},RO=class extends Mw{constructor(){super(...arguments),this.removePointerDownListener=Gv}onPointerDown(e){this.session=new fO(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:cO(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:LO(e),onStart:LO(t),onMove:LO(n),onEnd:(e,t)=>{delete this.session,r&&K.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=sO(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},zO=!1,BO=class extends M.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),zO&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),TE.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),zO=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||K.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),TC.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;zO=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function VO(e){let[t,n]=lD(),r=(0,M.useContext)(Nv);return(0,P.jsx)(BO,{...e,layoutGroup:r,switchLayoutGroup:(0,M.useContext)(GD),isPresent:t,safeToRemove:n})}var HO={pan:{Feature:RO},drag:{Feature:IO,ProjectionNode:sD,MeasureLayout:VO}};function UO(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&K.postRender(()=>i(t,aO(t)))}var WO=class extends Mw{mount(){let{current:e}=this.node;e&&(this.unmount=MC(e,(e,t)=>(UO(this.node,t,`Start`),e=>UO(this.node,e,`End`))))}unmount(){}},GO=class extends Mw{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=Kv(yE(this.node.current,`focus`,()=>this.onFocus()),yE(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function KO(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&K.postRender(()=>i(t,aO(t)))}var qO=class extends Mw{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=GC(e,(e,t)=>(KO(this.node,t,`Start`),(e,{success:t})=>KO(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},JO=new WeakMap,YO=new WeakMap,XO=e=>{let t=JO.get(e.target);t&&t(e)},ZO=e=>{e.forEach(XO)};function QO({root:e,...t}){let n=e||document;YO.has(n)||YO.set(n,{});let r=YO.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(ZO,{root:e,...t})),r[i]}function $O(e,t,n){let r=QO(t);return JO.set(e,n),r.observe(e),()=>{JO.delete(e),r.unobserve(e)}}var ek={some:0,all:1},tk=class extends Mw{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:ek[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=$O(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(nk(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function nk({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var rk={inView:{Feature:tk},tap:{Feature:qO},focus:{Feature:GO},hover:{Feature:WO}},ik={layout:{ProjectionNode:sD,MeasureLayout:VO}},ak=eO({...iO,...rk,...HO,...ik},tO),ok=new Map,sk=e=>{let t=ok.get(e);return t||(t=ak.create(e),ok.set(e,t)),t},ck=(0,M.memo)(({children:e,as:t=`p`,className:n,duration:r=2,spread:i=2})=>{let a=sk(t),o=(0,M.useMemo)(()=>(e?.length??0)*i,[e,i]);return(0,P.jsx)(a,{animate:{backgroundPosition:`0% center`},className:l(`relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent`,`[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]`,n),initial:{backgroundPosition:`100% center`},style:{"--spread":`${o}px`,backgroundImage:`var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))`},transition:{duration:r,ease:`linear`,repeat:1/0},children:e})}),lk=Object.defineProperty,uk=(e,t)=>lk(e,`name`,{value:t,configurable:!0}),dk=`focusScope.autoFocusOnMount`,fk=`focusScope.autoFocusOnUnmount`,pk={bubbles:!1,cancelable:!0},mk=M.forwardRef(uk(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=M.useState(null),l=ne(i),u=ne(a),d=M.useRef(null),f=D(t,c),p=M.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;M.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:xk(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||xk(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&xk(s)};uk(e,`handleFocusIn`),uk(t,`handleFocusOut`),uk(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),M.useEffect(()=>{if(s){Sk.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(dk,pk);s.addEventListener(dk,l),s.dispatchEvent(t),t.defaultPrevented||(hk(Tk(_k(s)),{select:!0}),document.activeElement===e&&xk(s))}return()=>{s.removeEventListener(dk,l),setTimeout(()=>{let t=new CustomEvent(fk,pk);s.addEventListener(fk,u),s.dispatchEvent(t),t.defaultPrevented||xk(e??document.body,{select:!0}),s.removeEventListener(fk,u),Sk.remove(p)},0)}}},[s,l,u,p]);let m=M.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=gk(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&xk(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&xk(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,P.jsx)(O.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function hk(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(xk(r,{select:t}),document.activeElement!==n)return}uk(hk,`focusFirst`);function gk(e){let t=_k(e);return[vk(t,e),vk(t.reverse(),e)]}uk(gk,`getTabbableEdges`);function _k(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:uk(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}uk(_k,`getTabbableCandidates`);function vk(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):yk(r,{upTo:t})))return r}uk(vk,`findVisible`);function yk(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}uk(yk,`isHidden`);function bk(e){return e instanceof HTMLInputElement&&`select`in e}uk(bk,`isSelectableInput`);function xk(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&bk(e)&&t&&e.select()}}uk(xk,`focus`);var Sk=Ck();function Ck(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=wk(e,t),e.unshift(t)},remove(t){e=wk(e,t),e[0]?.resume()}}}uk(Ck,`createFocusScopesStack`);function wk(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}uk(wk,`arrayRemove`);function Tk(e){return e.filter(e=>e.tagName!==`A`)}uk(Tk,`removeLinks`);var Ek=Object.defineProperty,Dk=(e,t)=>Ek(e,`name`,{value:t,configurable:!0}),Ok=0,kk=null;function Ak(e){return jk(),e.children}Dk(Ak,`FocusGuards`);function jk(){M.useEffect(()=>{kk||={start:Mk(),end:Mk()};let{start:e,end:t}=kk;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Ok++,()=>{Ok===1&&(kk?.start.remove(),kk?.end.remove(),kk=null),Ok=Math.max(0,Ok-1)}},[])}Dk(jk,`useFocusGuards`);function Mk(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Dk(Mk,`createFocusGuard`);var Nk=`right-scroll-bar-position`,Pk=`width-before-scroll-bar`,Fk=`with-scroll-bars-hidden`,Ik=`--removed-body-scroll-bar-size`;function Lk(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Rk(e,t){var n=(0,M.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var zk=typeof window<`u`?M.useLayoutEffect:M.useEffect,Bk=new WeakMap;function Vk(e,t){var n=Rk(t||null,function(t){return e.forEach(function(e){return Lk(e,t)})});return zk(function(){var t=Bk.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Lk(e,null)}),i.forEach(function(e){r.has(e)||Lk(e,a)})}Bk.set(n,e)},[e]),n}function Hk(e){return e}function Uk(e,t){t===void 0&&(t=Hk);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Wk(e){e===void 0&&(e={});var t=Uk(null);return t.options=St({async:!0,ssr:!1},e),t}var Gk=function(e){var t=e.sideCar,n=Dt(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return M.createElement(r,St({},n))};Gk.isSideCarExport=!0;function Kk(e,t){return e.useMedium(t),Gk}var qk=Wk(),Jk=function(){},Yk=M.forwardRef(function(e,t){var n=M.useRef(null),r=M.useState({onScrollCapture:Jk,onWheelCapture:Jk,onTouchMoveCapture:Jk}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Dt(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Vk([n,t]),C=St(St({},b),i);return M.createElement(M.Fragment,null,u&&M.createElement(x,{sideCar:qk,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?M.cloneElement(M.Children.only(s),St(St({},C),{ref:S})):M.createElement(v,St({},C,{className:c,ref:S}),s))});Yk.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Yk.classNames={fullWidth:Pk,zeroRight:Nk};var Xk,Zk=function(){if(Xk)return Xk;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Qk(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Zk();return t&&e.setAttribute(`nonce`,t),e}function $k(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function eA(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var tA=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Qk())&&($k(t,n),eA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},nA=function(){var e=tA();return function(t,n){M.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},rA=function(){var e=nA();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},iA={left:0,top:0,right:0,gap:0},aA=function(e){return parseInt(e||``,10)||0},oA=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[aA(n),aA(r),aA(i)]},sA=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return iA;var t=oA(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},cA=rA(),lA=`data-scroll-locked`,uA=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
.${Fk} {
overflow: hidden ${r};
padding-right: ${s}px ${r};
}
body[${lA}] {
overflow: hidden ${r};
overscroll-behavior: contain;
${[t&&`position: relative ${r};`,n===`margin`&&`
padding-left: ${i}px;
padding-top: ${a}px;
padding-right: ${o}px;
margin-left:0;
margin-top:0;
margin-right: ${s}px ${r};
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
}
.${Nk} {
right: ${s}px ${r};
}
.${Pk} {
margin-right: ${s}px ${r};
}
.${Nk} .${Nk} {
right: 0 ${r};
}
.${Pk} .${Pk} {
margin-right: 0 ${r};
}
body[${lA}] {
${Ik}: ${s}px;
}
`},dA=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},fA=function(){M.useEffect(function(){return document.body.setAttribute(lA,(dA()+1).toString()),function(){var e=dA()-1;e<=0?document.body.removeAttribute(lA):document.body.setAttribute(lA,e.toString())}},[])},pA=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;fA();var a=M.useMemo(function(){return sA(i)},[i]);return M.createElement(cA,{styles:uA(a,!t,i,n?``:`!important`)})},mA=!1;if(typeof window<`u`)try{var hA=Object.defineProperty({},"passive",{get:function(){return mA=!0,!0}});window.addEventListener(`test`,hA,hA),window.removeEventListener(`test`,hA,hA)}catch{mA=!1}var gA=mA?{passive:!1}:!1,_A=function(e){return e.tagName===`TEXTAREA`},vA=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!_A(e)&&n[t]===`visible`)},yA=function(e){return vA(e,`overflowY`)},bA=function(e){return vA(e,`overflowX`)},xA=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),wA(e,r)){var i=TA(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},SA=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},CA=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},wA=function(e,t){return e===`v`?yA(t):bA(t)},TA=function(e,t){return e===`v`?SA(t):CA(t)},EA=function(e,t){return e===`h`&&t===`rtl`?-1:1},DA=function(e,t,n,r,i){var a=EA(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=TA(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&wA(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},OA=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},kA=function(e){return[e.deltaX,e.deltaY]},AA=function(e){return e&&`current`in e?e.current:e},jA=function(e,t){return e[0]===t[0]&&e[1]===t[1]},MA=function(e){return`
.block-interactivity-${e} {pointer-events: none;}
.allow-interactivity-${e} {pointer-events: all;}
`},NA=0,PA=[];function FA(e){var t=M.useRef([]),n=M.useRef([0,0]),r=M.useRef(),i=M.useState(NA++)[0],a=M.useState(rA)[0],o=M.useRef(e);M.useEffect(function(){o.current=e},[e]),M.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=bt([e.lockRef.current],(e.shards||[]).map(AA),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=M.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=OA(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=xA(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=xA(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return DA(h,t,e,h===`h`?s:c,!0)},[]),c=M.useCallback(function(e){var n=e;if(!(!PA.length||PA[PA.length-1]!==a)){var r=`deltaY`in n?kA(n):OA(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&jA(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(AA).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=M.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:IA(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=M.useCallback(function(e){n.current=OA(e),r.current=void 0},[]),d=M.useCallback(function(t){l(t.type,kA(t),t.target,s(t,e.lockRef.current))},[]),f=M.useCallback(function(t){l(t.type,OA(t),t.target,s(t,e.lockRef.current))},[]);M.useEffect(function(){return PA.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,gA),document.addEventListener(`touchmove`,c,gA),document.addEventListener(`touchstart`,u,gA),function(){PA=PA.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,gA),document.removeEventListener(`touchmove`,c,gA),document.removeEventListener(`touchstart`,u,gA)}},[]);var p=e.removeScrollBar,m=e.inert;return M.createElement(M.Fragment,null,m?M.createElement(a,{styles:MA(i)}):null,p?M.createElement(pA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function IA(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var LA=Kk(qk,FA),RA=M.forwardRef(function(e,t){return M.createElement(Yk,St({},e,{ref:t,sideCar:LA}))});RA.classNames=Yk.classNames;var zA=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},BA=new WeakMap,VA=new WeakMap,HA={},UA=0,WA=function(e){return e&&(e.host||WA(e.parentNode))},GA=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=WA(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},KA=function(e,t,n,r){var i=GA(t,Array.isArray(e)?e:[e]);HA[n]||(HA[n]=new WeakMap);var a=HA[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(BA.get(e)||0)+1,l=(a.get(e)||0)+1;BA.set(e,c),a.set(e,l),o.push(e),c===1&&i&&VA.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),UA++,function(){o.forEach(function(e){var t=BA.get(e)-1,i=a.get(e)-1;BA.set(e,t),a.set(e,i),t||(VA.has(e)||e.removeAttribute(r),VA.delete(e)),i||e.removeAttribute(n)}),UA--,UA||(BA=new WeakMap,BA=new WeakMap,VA=new WeakMap,HA={})}},qA=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||zA(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),KA(r,i,n,`aria-hidden`)):function(){return null}},JA=Object.defineProperty,YA=(e,t)=>JA(e,`name`,{value:t,configurable:!0}),XA=`Dialog`,[ZA,QA]=u(XA),[$A,ej]=ZA(XA),tj=YA(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=M.useRef(null),c=M.useRef(null),[l,u]=E({prop:r,defaultProp:i??!1,onChange:a,caller:XA}),[d,f]=M.useState(0),[p,m]=M.useState(0);return(0,P.jsx)($A,{scope:t,triggerRef:s,contentRef:c,contentId:S(),titleId:S(),descriptionId:S(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:M.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),nj=`DialogTrigger`,rj=M.forwardRef(YA(function(e,t){let{__scopeDialog:n,...r}=e,i=ej(nj,n),a=D(t,i.triggerRef);return(0,P.jsx)(O.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Cj(i.open),...r,ref:a,onClick:f(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),ij=`DialogPortal`,[aj,oj]=ZA(ij,{forceMount:void 0}),sj=YA(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ej(ij,t);return(0,P.jsx)(aj,{scope:t,forceMount:n,children:M.Children.map(r,e=>(0,P.jsx)(h,{present:n||a.open,children:(0,P.jsx)(x,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),cj=`DialogOverlay`,lj=M.forwardRef(YA(function(e,t){let n=oj(cj,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ej(cj,e.__scopeDialog);return a.modal?(0,P.jsx)(h,{present:r||a.open,children:(0,P.jsx)(dj,{...i,ref:t})}):null},`DialogOverlay`)),uj=d(`DialogOverlay.RemoveScroll`),dj=M.forwardRef(YA(function(e,t){let{__scopeDialog:n,...r}=e,i=ej(cj,n),a=p(),o=D(t,a);return(0,P.jsx)(RA,{as:uj,allowPinchZoom:!0,shards:[i.contentRef],children:(0,P.jsx)(O.div,{"data-state":Cj(i.open),...r,ref:o,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),fj=`DialogContent`,pj=M.forwardRef(YA(function(e,t){let n=oj(fj,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ej(fj,e.__scopeDialog);return(0,P.jsx)(h,{present:r||a.open,children:a.modal?(0,P.jsx)(mj,{...i,ref:t}):(0,P.jsx)(hj,{...i,ref:t})})},`DialogContent`)),mj=M.forwardRef(YA(function(e,t){let n=ej(fj,e.__scopeDialog),r=M.useRef(null),i=D(t,n.contentRef,r);return M.useEffect(()=>{let e=r.current;if(e)return qA(e)},[]),(0,P.jsx)(gj,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:f(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:f(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:f(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),hj=M.forwardRef(YA(function(e,t){let n=ej(fj,e.__scopeDialog),r=M.useRef(!1),i=M.useRef(!1);return(0,P.jsx)(gj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),gj=M.forwardRef(YA(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=ej(fj,n);return jk(),(0,P.jsx)(P.Fragment,{children:(0,P.jsx)(mk,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,P.jsx)(v,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Cj(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),_j=`DialogTitle`,vj=M.forwardRef(YA(function(e,t){let{__scopeDialog:n,...r}=e,i=ej(_j,n),{setTitleCount:a}=i;return y(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,P.jsx)(O.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),yj=`DialogDescription`,bj=M.forwardRef(YA(function(e,t){let{__scopeDialog:n,...r}=e,i=ej(yj,n),{setDescriptionCount:a}=i;return y(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,P.jsx)(O.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),xj=`DialogClose`,Sj=M.forwardRef(YA(function(e,t){let{__scopeDialog:n,...r}=e,i=ej(xj,n);return(0,P.jsx)(O.button,{type:`button`,...r,ref:t,onClick:f(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Cj(e){return e?`open`:`closed`}YA(Cj,`getState`);var wj=tj,Tj=rj,Ej=sj,Dj=M.forwardRef(({className:e,...t},n)=>(0,P.jsx)(lj,{ref:n,className:l(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));Dj.displayName=lj.displayName;var Oj=M.forwardRef(({className:e,children:t,...n},r)=>(0,P.jsxs)(Ej,{children:[(0,P.jsx)(Dj,{}),(0,P.jsxs)(pj,{ref:r,className:l(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg`,e),...n,children:[t,(0,P.jsxs)(Sj,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background cursor-pointer transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,P.jsx)(vn,{className:`h-4 w-4`}),(0,P.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));Oj.displayName=pj.displayName;var kj=({className:e,...t})=>(0,P.jsx)(`div`,{className:l(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});kj.displayName=`DialogHeader`;var Aj=({className:e,...t})=>(0,P.jsx)(`div`,{className:l(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});Aj.displayName=`DialogFooter`;var jj=M.forwardRef(({className:e,...t},n)=>(0,P.jsx)(vj,{ref:n,className:l(`text-lg font-semibold leading-none tracking-tight`,e),...t}));jj.displayName=vj.displayName;var Mj=M.forwardRef(({className:e,...t},n)=>(0,P.jsx)(bj,{ref:n,className:l(`text-sm text-muted-foreground`,e),...t}));Mj.displayName=bj.displayName;var Nj=Object.defineProperty,Q=(e,t)=>Nj(e,`name`,{value:t,configurable:!0});function Pj(e){let t=e+`CollectionProvider`,[n,r]=u(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Q(e=>{let{scope:t,children:n}=e,r=M.useRef(null),a=M.useRef(new Map).current;return(0,P.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=d(s),l=M.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(s,n),o=D(t,i.collectionRef);return(0,P.jsx)(c,{ref:o,children:r})});l.displayName=s;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=d(f),h=M.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=M.useRef(null),s=D(t,o),c=a(f,n);return M.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,P.jsx)(m,{[p]:``,ref:s,children:r})});h.displayName=f;function g(t){let n=a(e+`CollectionConsumer`,t);return M.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return Q(g,`useCollection`),[{Provider:o,Slot:l,ItemSlot:h},g,r]}Q(Pj,`createCollection`);var Fj=new WeakMap,Ij=class e extends Map{static{Q(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Fj.set(this,!0)}set(e,t){return Fj.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=zj(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Lj(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Lj(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Lj(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Lj(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Rj(e,t);return n===-1?void 0:e[n]}Q(Lj,`at`);function Rj(e,t){let n=e.length,r=zj(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Q(Rj,`toSafeIndex`);function zj(e){return e!==e||e===0?0:Math.trunc(e)}Q(zj,`toSafeInteger`);function Bj(e){let t=e+`CollectionProvider`,[n,r]=u(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Ij,setItemMap:Q(()=>void 0,`setItemMap`)}),o=Q(({state:e,...t})=>e?(0,P.jsx)(c,{...t,state:e}):(0,P.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=Q(e=>{let t=_();return(0,P.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=Q(e=>{let{scope:t,children:n,state:r}=e,a=M.useRef(null),[o,s]=M.useState(null),c=D(a,s),[l,u]=r;return M.useEffect(()=>{if(!o)return;let e=Wj(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,P.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,f=d(l),p=M.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(l,n),o=D(t,i.collectionRef);return(0,P.jsx)(f,{ref:o,children:r})});p.displayName=l;let m=e+`CollectionItemSlot`,h=d(m),g=M.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=M.useRef(null),[s,c]=M.useState(null),l=D(t,o,c),{setItemMap:u}=a(m,n),d=M.useRef(i);Vj(d.current,i)||(d.current=i);let f=d.current;return M.useEffect(()=>{let e=f;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(Uj):(t.set(s,{...e,element:s}),t.toSorted(Uj)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new Ij(e)))}},[s,f,u]),(0,P.jsx)(h,{"data-radix-collection-item":``,ref:l,children:r})});g.displayName=m;function _(){return M.useState(new Ij)}Q(_,`useInitCollection`);function v(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return Q(v,`useCollection`),[{Provider:o,Slot:p,ItemSlot:g},{createCollectionScope:r,useCollection:v,useInitCollection:_}]}Q(Bj,`createCollection`);function Vj(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}Q(Vj,`shallowEqual`);function Hj(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Q(Hj,`isElementPreceding`);function Uj(e,t){return!e[1].element||!t[1].element?0:Hj(e[1].element,t[1].element)?-1:1}Q(Uj,`sortByDocumentPosition`);function Wj(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}Q(Wj,`getChildListObserver`);var Gj=Object.defineProperty,Kj=(e,t)=>Gj(e,`name`,{value:t,configurable:!0}),qj=M.createContext(void 0);function Jj(e){let t=M.useContext(qj);return e||t||`ltr`}Kj(Jj,`useDirection`);var Yj=Object.defineProperty,Xj=(e,t)=>Yj(e,`name`,{value:t,configurable:!0}),Zj=!1;function Qj(){let[e,t]=M.useState(Zj);return M.useEffect(()=>{Zj||(Zj=!0,t(!0))},[]),e}Xj(Qj,`useIsHydrated`);var $j=M.useSyncExternalStore;function eM(){return()=>{}}Xj(eM,`subscribe`);function tM(){return $j(eM,()=>!0,()=>!1)}Xj(tM,`useIsHydratedModern`);var nM=typeof $j==`function`?tM:Qj,rM=Object.defineProperty,iM=(e,t)=>rM(e,`name`,{value:t,configurable:!0}),aM=`rovingFocusGroup.onEntryFocus`,oM={bubbles:!1,cancelable:!0},sM=`RovingFocusGroup`,[cM,lM,uM]=Pj(sM),[dM,fM]=u(sM,[uM]),[pM,mM]=dM(sM),hM=M.forwardRef(iM(function(e,t){return(0,P.jsx)(cM.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,P.jsx)(cM.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,P.jsx)(gM,{...e,ref:t})})})},`RovingFocusGroup`)),gM=M.forwardRef(iM(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,p=M.useRef(null),m=D(t,p),h=Jj(a),[g,_]=E({prop:o,defaultProp:s??null,onChange:c,caller:sM}),[v,y]=M.useState(!1),b=ne(l),x=lM(n),S=M.useRef(!1),[C,w]=M.useState(0);return M.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(aM,b),()=>e.removeEventListener(aM,b)},[b]),(0,P.jsx)(pM,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:g,onItemFocus:M.useCallback(e=>_(e),[_]),onItemShiftTab:M.useCallback(()=>y(!0),[]),onFocusableItemAdd:M.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:M.useCallback(()=>w(e=>e-1),[]),children:(0,P.jsx)(O.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:`none`,...e.style},onMouseDown:f(e.onMouseDown,()=>{S.current=!0}),onFocus:f(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(aM,oM);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);SM([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:f(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),_M=`RovingFocusGroupItem`,vM=M.forwardRef(iM(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=S(),l=a||c,u=mM(_M,n),d=u.currentTabStopId===l,p=lM(n),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:g}=u,_=nM();return y(()=>{if(!(!_||!r))return m(),()=>h()},[_,r,m,h]),M.useEffect(()=>{if(!(_||!r))return m(),()=>h()},[_,r,m,h]),(0,P.jsx)(cM.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,P.jsx)(O.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:f(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:f(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:f(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=xM(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=p().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?CM(n,r+1):n.slice(r+1)}setTimeout(()=>SM(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:g!=null}):o})})},`RovingFocusGroupItem`)),yM={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function bM(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}iM(bM,`getDirectionAwareKey`);function xM(e,t,n){let r=bM(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return yM[r]}iM(xM,`getFocusIntent`);function SM(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}iM(SM,`focusFirst`);function CM(e,t){return e.map((n,r)=>e[(t+r)%e.length])}iM(CM,`wrapArray`);var wM=hM,TM=vM,EM=Object.defineProperty,$=(e,t)=>EM(e,`name`,{value:t,configurable:!0}),DM=[`Enter`,` `],OM=[`ArrowDown`,`PageUp`,`Home`],kM=[`ArrowUp`,`PageDown`,`End`],AM=[...OM,...kM],jM={ltr:[...DM,`ArrowRight`],rtl:[...DM,`ArrowLeft`]},MM={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},NM=`Menu`,[PM,FM,IM]=Pj(NM),[LM,RM]=u(NM,[IM,T,fM]),zM=T(),BM=fM(),[VM,HM]=LM(NM),[UM,WM]=LM(NM),GM=$(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=zM(t),[c,l]=M.useState(null),u=M.useRef(!1),d=ne(a),f=Jj(i);return M.useEffect(()=>{let e=$(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=$(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),M.useEffect(()=>{if(!n)return;let e=$(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,P.jsx)(_,{...s,children:(0,P.jsx)(VM,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,P.jsx)(UM,{scope:t,onClose:M.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),KM=M.forwardRef($(function(e,t){let{__scopeMenu:n,...r}=e,i=zM(n);return(0,P.jsx)(te,{...i,...r,ref:t})},`MenuAnchor`)),qM=`MenuPortal`,[JM,YM]=LM(qM,{forceMount:void 0}),XM=$(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=HM(qM,t);return(0,P.jsx)(JM,{scope:t,forceMount:n,children:(0,P.jsx)(h,{present:n||a.open,children:(0,P.jsx)(x,{asChild:!0,container:i,children:r})})})},`MenuPortal`),ZM=`MenuContent`,[QM,$M]=LM(ZM),eN=M.forwardRef($(function(e,t){let n=YM(ZM,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=HM(ZM,e.__scopeMenu),o=WM(ZM,e.__scopeMenu);return(0,P.jsx)(PM.Provider,{scope:e.__scopeMenu,children:(0,P.jsx)(h,{present:r||a.open,children:(0,P.jsx)(PM.Slot,{scope:e.__scopeMenu,children:o.modal?(0,P.jsx)(tN,{...i,ref:t}):(0,P.jsx)(nN,{...i,ref:t})})})})},`MenuContent`)),tN=M.forwardRef($(function(e,t){let n=HM(ZM,e.__scopeMenu),r=M.useRef(null),i=D(t,r);return M.useEffect(()=>{let e=r.current;if(e)return qA(e)},[]),(0,P.jsx)(iN,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:f(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),nN=M.forwardRef($(function(e,t){let n=HM(ZM,e.__scopeMenu);return(0,P.jsx)(iN,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),rN=d(`MenuContent.ScrollLock`),iN=M.forwardRef($(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:m,disableOutsideScroll:h,..._}=e,y=HM(ZM,n),b=WM(ZM,n),x=zM(n),S=BM(n),C=FM(n),[w,T]=M.useState(null),ee=M.useRef(null),E=D(t,ee,y.onContentChange),te=M.useRef(0),ne=M.useRef(``),re=M.useRef(0),O=M.useRef(null),k=M.useRef(`right`),ie=M.useRef(0),A=h?RA:M.Fragment,ae=h?{as:rN,allowPinchZoom:!0}:void 0,j=$(e=>{let t=ne.current+e,n=C().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=jN(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;$((function e(t){ne.current=t,window.clearTimeout(te.current),t!==``&&(te.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);M.useEffect(()=>()=>window.clearTimeout(te.current),[]),jk();let oe=M.useCallback(e=>k.current===O.current?.side&&NN(e,O.current?.area),[]);return(0,P.jsx)(QM,{scope:n,searchRef:ne,onItemEnter:M.useCallback(e=>{oe(e)&&e.preventDefault()},[oe]),onItemLeave:M.useCallback(e=>{oe(e)||(ee.current?.focus(),T(null))},[oe]),onTriggerLeave:M.useCallback(e=>{oe(e)&&e.preventDefault()},[oe]),pointerGraceTimerRef:re,onPointerGraceIntentChange:M.useCallback(e=>{O.current=e},[]),children:(0,P.jsx)(A,{...ae,children:(0,P.jsx)(mk,{asChild:!0,trapped:i,onMountAutoFocus:f(a,e=>{e.preventDefault(),ee.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,P.jsx)(v,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:m,children:(0,P.jsx)(wM,{asChild:!0,...S,dir:b.dir,orientation:`vertical`,loop:r,currentTabStopId:w,onCurrentTabStopIdChange:T,onEntryFocus:f(c,e=>{b.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,P.jsx)(g,{role:`menu`,"aria-orientation":`vertical`,"data-state":EN(y.open),"data-radix-menu-content":``,dir:b.dir,...x,..._,ref:E,style:{outline:`none`,..._.style},onKeyDown:f(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&j(e.key));let i=ee.current;if(e.target!==i||!AM.includes(e.key))return;e.preventDefault();let a=C().filter(e=>!e.disabled).map(e=>e.ref.current);kM.includes(e.key)&&a.reverse(),kN(a)}),onBlur:f(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(te.current),ne.current=``)}),onPointerMove:f(e.onPointerMove,PN(e=>{let t=e.target,n=ie.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>ie.current?`right`:`left`;k.current=t,ie.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),aN=M.forwardRef($(function(e,t){let{__scopeMenu:n,...r}=e;return(0,P.jsx)(O.div,{...r,ref:t})},`MenuLabel`)),oN=`MenuItem`,sN=`menu.itemSelect`,cN=M.forwardRef($(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=M.useRef(null),o=WM(oN,e.__scopeMenu),s=$M(oN,e.__scopeMenu),c=D(t,a),l=M.useRef(!1),u=$(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(sN,{bubbles:!0,cancelable:!0});e.addEventListener(sN,e=>r?.(e),{once:!0}),m(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,P.jsx)(lN,{...i,ref:c,disabled:n,onClick:f(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:f(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:f(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&DM.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),lN=M.forwardRef($(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=$M(oN,n),s=BM(n),c=M.useRef(null),l=D(t,c),[u,d]=M.useState(!1),[p,m]=M.useState(``);return M.useEffect(()=>{let e=c.current;e&&m((e.textContent??``).trim())},[a.children]),(0,P.jsx)(PM.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:(0,P.jsx)(TM,{asChild:!0,...s,focusable:!r,children:(0,P.jsx)(O.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:f(e.onPointerMove,PN(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:f(e.onPointerLeave,PN(e=>o.onItemLeave(e))),onFocus:f(e.onFocus,()=>d(!0)),onBlur:f(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),uN=M.forwardRef($(function(e,t){let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,P.jsx)(gN,{scope:e.__scopeMenu,checked:n,children:(0,P.jsx)(cN,{role:`menuitemcheckbox`,"aria-checked":DN(n)?`mixed`:n,...i,ref:t,"data-state":ON(n),onSelect:f(i.onSelect,()=>r?.(DN(n)?!0:!n),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[dN,fN]=LM(`MenuRadioGroup`,{value:void 0,onValueChange:$(()=>{},`onValueChange`)}),pN=`MenuRadioItem`,mN=M.forwardRef($(function(e,t){let{value:n,...r}=e,i=fN(pN,e.__scopeMenu),a=n===i.value;return(0,P.jsx)(gN,{scope:e.__scopeMenu,checked:a,children:(0,P.jsx)(cN,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":ON(a),onSelect:f(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),hN=`MenuItemIndicator`,[gN,_N]=LM(hN,{checked:!1}),vN=M.forwardRef($(function(e,t){let{__scopeMenu:n,forceMount:r,...i}=e,a=_N(hN,n);return(0,P.jsx)(h,{present:r||DN(a.checked)||a.checked===!0,children:(0,P.jsx)(O.span,{...i,ref:t,"data-state":ON(a.checked)})})},`MenuItemIndicator`)),yN=M.forwardRef($(function(e,t){let{__scopeMenu:n,...r}=e;return(0,P.jsx)(O.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[bN,xN]=LM(`MenuSub`),SN=`MenuSubTrigger`,CN=M.forwardRef($(function(e,t){let n=HM(SN,e.__scopeMenu),r=WM(SN,e.__scopeMenu),i=xN(SN,e.__scopeMenu),a=$M(SN,e.__scopeMenu),o=M.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=M.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);M.useEffect(()=>u,[u]),M.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]);let d=D(t,i.onTriggerChange);return(0,P.jsx)(KM,{asChild:!0,...l,children:(0,P.jsx)(lN,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":EN(n.open),...e,ref:d,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:f(e.onPointerMove,PN(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:f(e.onPointerLeave,PN(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:f(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||(a.searchRef.current===``||t.key!==` `)&&jM[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),wN=`MenuSubContent`,TN=M.forwardRef($(function(e,t){let n=YM(ZM,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=HM(ZM,e.__scopeMenu),s=WM(ZM,e.__scopeMenu),c=xN(wN,e.__scopeMenu),l=M.useRef(null),u=D(t,l);return(0,P.jsx)(PM.Provider,{scope:e.__scopeMenu,children:(0,P.jsx)(h,{present:r||o.open,children:(0,P.jsx)(PM.Slot,{scope:e.__scopeMenu,children:(0,P.jsx)(iN,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:f(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:f(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:f(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=MM[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function EN(e){return e?`open`:`closed`}$(EN,`getOpenState`);function DN(e){return e===`indeterminate`}$(DN,`isIndeterminate`);function ON(e){return DN(e)?`indeterminate`:e?`checked`:`unchecked`}$(ON,`getCheckedState`);function kN(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}$(kN,`focusFirst`);function AN(e,t){return e.map((n,r)=>e[(t+r)%e.length])}$(AN,`wrapArray`);function jN(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=AN(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}$(jN,`getNextMatch`);function MN(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}$(MN,`isPointInPolygon`);function NN(e,t){return t?MN({x:e.clientX,y:e.clientY},t):!1}$(NN,`isPointerInGraceArea`);function PN(e){return t=>t.pointerType===`mouse`?e(t):void 0}$(PN,`whenMouse`);var FN=GM,IN=KM,LN=XM,RN=eN,zN=aN,BN=cN,VN=uN,HN=mN,UN=vN,WN=yN,GN=CN,KN=TN,qN=Object.defineProperty,JN=(e,t)=>qN(e,`name`,{value:t,configurable:!0}),YN=`DropdownMenu`,[XN,ZN]=u(YN,[RM]),QN=RM(),[$N,eP]=XN(YN),tP=JN(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=QN(t),l=M.useRef(null),[u,d]=E({prop:i,defaultProp:a??!1,onChange:o,caller:YN});return(0,P.jsx)($N,{scope:t,triggerId:S(),triggerRef:l,contentId:S(),open:u,onOpenChange:d,onOpenToggle:M.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,P.jsx)(FN,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),nP=`DropdownMenuTrigger`,rP=M.forwardRef(JN(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=eP(nP,n),o=QN(n),s=D(t,a.triggerRef);return(0,P.jsx)(IN,{asChild:!0,...o,children:(0,P.jsx)(O.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:f(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:f(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),iP=JN(e=>{let{__scopeDropdownMenu:t,...n}=e,r=QN(t);return(0,P.jsx)(LN,{...r,...n})},`DropdownMenuPortal`),aP=`DropdownMenuContent`,oP=M.forwardRef(JN(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=eP(aP,n),a=QN(n),o=M.useRef(!1);return(0,P.jsx)(RN,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:f(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:f(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),sP=M.forwardRef(JN(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=QN(n);return(0,P.jsx)(zN,{...i,...r,ref:t})},`DropdownMenuLabel`)),cP=M.forwardRef(JN(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=QN(n);return(0,P.jsx)(BN,{...i,...r,ref:t})},`DropdownMenuItem`)),lP=M.forwardRef(JN(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=QN(n);return(0,P.jsx)(VN,{...i,...r,ref:t})},`DropdownMenuCheckboxItem`)),uP=M.forwardRef(JN(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=QN(n);return(0,P.jsx)(HN,{...i,...r,ref:t})},`DropdownMenuRadioItem`)),dP=M.forwardRef(JN(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=QN(n);return(0,P.jsx)(UN,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),fP=M.forwardRef(JN(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=QN(n);return(0,P.jsx)(WN,{...i,...r,ref:t})},`DropdownMenuSeparator`)),pP=M.forwardRef(JN(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=QN(n);return(0,P.jsx)(GN,{...i,...r,ref:t})},`DropdownMenuSubTrigger`)),mP=M.forwardRef(JN(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=QN(n);return(0,P.jsx)(KN,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuSubContent`)),hP=tP,gP=rP,_P=iP,vP=oP,yP=sP,bP=cP,xP=lP,SP=uP,CP=dP,wP=fP,TP=pP,EP=mP,DP=hP,OP=gP,kP=M.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,P.jsxs)(TP,{ref:i,className:l(`flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,t&&`pl-8`,e),...r,children:[n,(0,P.jsx)(Vt,{className:`ml-auto`})]}));kP.displayName=TP.displayName;var AP=M.forwardRef(({className:e,...t},n)=>(0,P.jsx)(EP,{ref:n,className:l(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-dropdown-menu-content-transform-origin)`,e),...t}));AP.displayName=EP.displayName;var jP=M.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,P.jsx)(_P,{children:(0,P.jsx)(vP,{ref:r,sideOffset:t,className:l(`z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md`,`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-dropdown-menu-content-transform-origin)`,e),...n})}));jP.displayName=vP.displayName;var MP=M.forwardRef(({className:e,inset:t,...n},r)=>(0,P.jsx)(bP,{ref:r,className:l(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0`,t&&`pl-8`,e),...n}));MP.displayName=bP.displayName;var NP=M.forwardRef(({className:e,children:t,...n},r)=>(0,P.jsxs)(xP,{ref:r,className:l(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,P.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,P.jsx)(CP,{children:(0,P.jsx)(zt,{className:`h-4 w-4`})})}),t]}));NP.displayName=xP.displayName;var PP=M.forwardRef(({className:e,children:t,...n},r)=>(0,P.jsxs)(SP,{ref:r,className:l(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,P.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,P.jsx)(CP,{children:(0,P.jsx)(Ut,{className:`h-2 w-2 fill-current`})})}),t]}));PP.displayName=SP.displayName;var FP=M.forwardRef(({className:e,inset:t,...n},r)=>(0,P.jsx)(yP,{ref:r,className:l(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));FP.displayName=yP.displayName;var IP=M.forwardRef(({className:e,...t},n)=>(0,P.jsx)(wP,{ref:n,className:l(`-mx-1 my-1 h-px bg-muted`,e),...t}));IP.displayName=wP.displayName;var LP=M.forwardRef(({className:e,type:t,...n},r)=>(0,P.jsx)(`input`,{type:t,className:l(`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:r,...n}));LP.displayName=`Input`;var RP=M.forwardRef(({className:e,...t},n)=>(0,P.jsx)(`textarea`,{className:l(`flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:n,...t}));RP.displayName=`Textarea`;function zP({className:e,...t}){return(0,P.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:l(`group/input-group border-input dark:bg-input/30 shadow-xs relative flex w-full items-center rounded-md border outline-none transition-[color,box-shadow]`,`h-9 has-[>textarea]:h-auto`,`has-[>[data-align=inline-start]]:[&>input]:pl-2`,`has-[>[data-align=inline-end]]:[&>input]:pr-2`,`has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3`,`has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3`,`has-[[data-slot=input-group-control]:focus-visible]:ring-ring has-[[data-slot=input-group-control]:focus-visible]:ring-1`,`has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40`,e),...t})}var BP=xn(`text-muted-foreground flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]`,"inline-end":`order-last pr-3 has-[>button]:mr-[-0.4rem] has-[>kbd]:mr-[-0.35rem]`,"block-start":`[.border-b]:pb-3 order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5`,"block-end":`[.border-t]:pt-3 order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5`}},defaultVariants:{align:`inline-start`}});function VP({className:e,align:t=`inline-start`,...n}){return(0,P.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":t,className:l(BP({align:t}),e),onClick:e=>{e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()},...n})}var HP=xn(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5`,sm:`h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5`,"icon-xs":`size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function UP({className:e,type:t=`button`,variant:n=`ghost`,size:r=`xs`,...i}){return(0,P.jsx)(Cn,{type:t,"data-size":r,variant:n,className:l(HP({size:r}),e),...i})}function WP({className:e,...t}){return(0,P.jsx)(RP,{"data-slot":`input-group-control`,className:l(`flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent`,e),...t})}function GP({className:e,...t}){return(0,P.jsx)(Zt,{role:`status`,"aria-label":`Loading`,className:l(`size-4 animate-spin`,e),...t})}var KP=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,qP=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=KP[n[e]&63];return t},JP=async e=>{try{let t=await(await fetch(e)).blob();return new Promise(e=>{let n=new FileReader;n.onloadend=()=>e(n.result),n.onerror=()=>e(null),n.readAsDataURL(t)})}catch{return null}},YP=(0,M.createContext)(null),XP=(0,M.createContext)(null),ZP=()=>(0,M.useContext)(YP),QP=()=>(0,M.useContext)(XP),$P=(0,M.createContext)(null),eF=()=>{let e=QP(),t=(0,M.useContext)($P)??e;if(!t)throw Error(`usePromptInputAttachments must be used within a PromptInput or PromptInputProvider`);return t},tF=(0,M.createContext)(null),nF=({className:e,inputGroupClassName:t,accept:n,multiple:r,globalDrop:i,syncHiddenInput:a,maxFiles:o,maxFileSize:s,onError:c,onSubmit:u,children:d,...f})=>{let p=ZP(),m=!!p,h=(0,M.useRef)(null),g=(0,M.useRef)(null),[_,v]=(0,M.useState)([]),y=m?p.attachments.files:_,[b,x]=(0,M.useState)([]),S=(0,M.useRef)(y);(0,M.useEffect)(()=>{S.current=y},[y]);let C=(0,M.useCallback)(()=>{h.current?.click()},[]),w=(0,M.useCallback)(e=>!n||n.trim()===``||n.split(`,`).map(e=>e.trim()).filter(Boolean).some(t=>{if(t.endsWith(`/*`)){let n=t.slice(0,-1);return e.type.startsWith(n)}return e.type===t}),[n]),T=(0,M.useCallback)(e=>{let t=[...e],n=t.filter(e=>w(e));if(t.length&&n.length===0){c?.({code:`accept`,message:`No files match the accepted types.`});return}let r=n.filter(e=>!s||e.size<=s);if(n.length>0&&r.length===0){c?.({code:`max_file_size`,message:`All files exceed the maximum size.`});return}v(e=>{let t=typeof o==`number`?Math.max(0,o-e.length):void 0,n=typeof t==`number`?r.slice(0,t):r;typeof t==`number`&&r.length>t&&c?.({code:`max_files`,message:`Too many files. Some were not added.`});let i=[];for(let e of n)i.push({filename:e.name,id:qP(),mediaType:e.type,type:`file`,url:URL.createObjectURL(e)});return[...e,...i]})},[w,o,s,c]),ee=(0,M.useCallback)(e=>v(t=>{let n=t.find(t=>t.id===e);return n?.url&&URL.revokeObjectURL(n.url),t.filter(t=>t.id!==e)}),[]),E=(0,M.useCallback)(e=>{let t=[...e],n=t.filter(e=>w(e));if(t.length&&n.length===0){c?.({code:`accept`,message:`No files match the accepted types.`});return}let r=n.filter(e=>!s||e.size<=s);if(n.length>0&&r.length===0){c?.({code:`max_file_size`,message:`All files exceed the maximum size.`});return}let i=y.length,a=typeof o==`number`?Math.max(0,o-i):void 0,l=typeof a==`number`?r.slice(0,a):r;typeof a==`number`&&r.length>a&&c?.({code:`max_files`,message:`Too many files. Some were not added.`}),l.length>0&&p?.attachments.add(l)},[w,s,o,c,y.length,p]),te=(0,M.useCallback)(()=>m?p?.attachments.clear():v(e=>{for(let t of e)t.url&&URL.revokeObjectURL(t.url);return[]}),[m,p]),ne=(0,M.useCallback)(()=>x([]),[]),D=m?E:T,re=m?p.attachments.remove:ee,O=m?p.attachments.openFileDialog:C,k=(0,M.useCallback)(()=>{te(),ne()},[te,ne]);(0,M.useEffect)(()=>{m&&p.__registerFileInput(h,()=>h.current?.click())},[m,p]),(0,M.useEffect)(()=>{a&&h.current&&y.length===0&&(h.current.value=``)},[y,a]),(0,M.useEffect)(()=>{let e=g.current;if(!e||i)return;let t=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},n=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault(),e.dataTransfer?.files&&e.dataTransfer.files.length>0&&D(e.dataTransfer.files)};return e.addEventListener(`dragover`,t),e.addEventListener(`drop`,n),()=>{e.removeEventListener(`dragover`,t),e.removeEventListener(`drop`,n)}},[D,i]),(0,M.useEffect)(()=>{if(!i)return;let e=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault()},t=e=>{e.dataTransfer?.types?.includes(`Files`)&&e.preventDefault(),e.dataTransfer?.files&&e.dataTransfer.files.length>0&&D(e.dataTransfer.files)};return document.addEventListener(`dragover`,e),document.addEventListener(`drop`,t),()=>{document.removeEventListener(`dragover`,e),document.removeEventListener(`drop`,t)}},[D,i]),(0,M.useEffect)(()=>()=>{if(!m)for(let e of S.current)e.url&&URL.revokeObjectURL(e.url)},[m]);let ie=(0,M.useCallback)(e=>{e.currentTarget.files&&D(e.currentTarget.files),e.currentTarget.value=``},[D]),A=(0,M.useMemo)(()=>({add:D,clear:te,fileInputRef:h,files:y.map(e=>({...e,id:e.id})),openFileDialog:O,remove:re}),[y,D,re,te,O]),ae=(0,M.useMemo)(()=>({add:e=>{let t=Array.isArray(e)?e:[e];x(e=>[...e,...t.map(e=>({...e,id:qP()}))])},clear:ne,remove:e=>{x(t=>t.filter(t=>t.id!==e))},sources:b}),[b,ne]),j=(0,M.useCallback)(async e=>{e.preventDefault();let t=e.currentTarget,n=m?p.textInput.value:new FormData(t).get(`message`)||``;m||t.reset();try{let t=u({files:await Promise.all(y.map(async({id:e,...t})=>{if(t.url?.startsWith(`blob:`)){let e=await JP(t.url);return{...t,url:e??t.url}}return t})),text:n},e);if(t instanceof Promise)try{await t,k(),m&&p.textInput.clear()}catch{}else k(),m&&p.textInput.clear()}catch{}},[m,p,y,u,k]),oe=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(`input`,{accept:n,"aria-label":`Upload files`,className:`hidden`,multiple:r,onChange:ie,ref:h,title:`Upload files`,type:`file`}),(0,P.jsx)(`form`,{className:l(`w-full`,e),onSubmit:j,ref:g,...f,children:(0,P.jsx)(zP,{className:l(`overflow-hidden`,t),children:d})})]}),se=(0,P.jsx)(tF.Provider,{value:ae,children:oe});return(0,P.jsx)($P.Provider,{value:A,children:se})},rF=({onChange:e,onKeyDown:t,className:n,placeholder:r=`What would you like to know?`,...i})=>{let a=ZP(),o=eF(),[s,c]=(0,M.useState)(!1),u=(0,M.useCallback)(e=>{if(t?.(e),!e.defaultPrevented){if(e.key===`Enter`){if(s||e.nativeEvent.isComposing||e.shiftKey)return;e.preventDefault();let{form:t}=e.currentTarget;if(t?.querySelector(`button[type="submit"]`)?.disabled)return;t?.requestSubmit()}if(e.key===`Backspace`&&e.currentTarget.value===``&&o.files.length>0){e.preventDefault();let t=o.files.at(-1);t&&o.remove(t.id)}}},[t,s,o]),d=(0,M.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let n=[];for(let e of t)if(e.kind===`file`){let t=e.getAsFile();t&&n.push(t)}n.length>0&&(e.preventDefault(),o.add(n))},[o]),f=(0,M.useCallback)(()=>c(!1),[]),p=(0,M.useCallback)(()=>c(!0),[]),m=a?{onChange:t=>{a.textInput.setInput(t.currentTarget.value),e?.(t)},value:a.textInput.value}:{onChange:e};return(0,P.jsx)(WP,{className:l(`field-sizing-content max-h-48 min-h-16`,n),name:`message`,onCompositionEnd:f,onCompositionStart:p,onKeyDown:u,onPaste:d,placeholder:r,...i,...m})},iF=({className:e,...t})=>(0,P.jsx)(VP,{align:`block-end`,className:l(`order-first flex-wrap gap-1`,e),...t}),aF=({className:e,...t})=>(0,P.jsx)(VP,{align:`block-end`,className:l(`justify-between gap-1`,e),...t}),oF=({className:e,...t})=>(0,P.jsx)(`div`,{className:l(`flex min-w-0 items-center gap-1`,e),...t}),sF=({variant:e=`ghost`,className:t,size:n,tooltip:r,...i})=>{let a=n??(M.Children.count(i.children)>1?`sm`:`icon-sm`),o=(0,P.jsx)(UP,{className:l(t),size:a,type:`button`,variant:e,...i});if(!r)return o;let s=typeof r==`string`?r:r.content,c=typeof r==`string`?void 0:r.shortcut,u=typeof r==`string`?`top`:r.side??`top`;return(0,P.jsxs)(ee,{children:[(0,P.jsx)(w,{asChild:!0,children:o}),(0,P.jsxs)(b,{side:u,children:[s,c&&(0,P.jsx)(`span`,{className:`ml-2 text-muted-foreground`,children:c})]})]})},cF=({className:e,variant:t=`default`,size:n=`icon-sm`,status:r,onStop:i,onClick:a,children:o,...s})=>{let c=r===`submitted`||r===`streaming`,u=(0,P.jsx)(Gt,{className:`size-4`});r===`submitted`?u=(0,P.jsx)(GP,{}):r===`streaming`?u=(0,P.jsx)(pn,{className:`size-4`}):r===`error`&&(u=(0,P.jsx)(vn,{className:`size-4`}));let d=(0,M.useCallback)(e=>{if(c&&i){e.preventDefault(),i();return}a?.(e)},[c,i,a]);return(0,P.jsx)(UP,{"aria-label":c?`Stop`:`Submit`,className:l(e),onClick:d,size:n,type:c&&i?`button`:`submit`,variant:t,...s,children:o??u})};function lF(e){let t=e.lastIndexOf(`.`);return t>-1&&t<e.length-1?e.slice(t+1).toUpperCase():`ARCHIVO`}function uF(e){return!Number.isFinite(e)||e<0?`0:00`:`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,`0`)}`}function dF(e){let t=e.match(/nota-de-voz-(\d+)/i);if(!t)return e;let n=new Date(Number(t[1]));return Number.isNaN(n.getTime())?e:`Nota de voz ${`${n.getDate()}/${n.getMonth()+1}/${n.getFullYear()}`} - ${new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,minute:`2-digit`,hour12:!0}).format(n)}`}function fF({filename:e,onRemove:t}){return(0,P.jsx)(`button`,{type:`button`,"aria-label":`Quitar ${e}`,onClick:t,className:`absolute right-2 top-2 z-10 grid size-7 place-items-center rounded-full border border-border/80 bg-card/95 text-muted-foreground shadow-sm transition-colors hover:bg-card hover:text-foreground`,children:(0,P.jsx)(vn,{className:`size-3.5`})})}function pF({src:e}){let t=(0,M.useRef)(null),[n,r]=(0,M.useState)(!1),[i,a]=(0,M.useState)(0),[o,s]=(0,M.useState)(0);(0,M.useEffect)(()=>{r(!1),a(0),s(0)},[e]);let c=(0,M.useCallback)(()=>{let e=t.current;if(e){if(Number.isFinite(e.duration)&&e.duration>0){s(e.duration);return}if(e.seekable.length>0){let t=e.seekable.end(e.seekable.length-1);Number.isFinite(t)&&t>0&&s(t)}}},[]),l=(0,M.useCallback)(async()=>{let e=t.current;if(e){if(e.paused)try{await e.play()}catch{r(!1)}else e.pause()}},[]),u=(0,M.useCallback)(e=>{let n=t.current;n&&(n.currentTime=e,a(e))},[]);return(0,P.jsxs)(`div`,{className:`flex w-full items-center gap-2.5`,children:[(0,P.jsx)(`audio`,{ref:t,src:e,preload:`metadata`,onLoadedMetadata:c,onLoadedData:c,onCanPlay:c,onDurationChange:c,onProgress:c,onTimeUpdate:e=>a(e.currentTarget.currentTime),onPlay:()=>r(!0),onPause:()=>r(!1),onEnded:()=>r(!1)}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>void l(),"aria-label":n?`Pausar nota de voz`:`Reproducir nota de voz`,className:`grid size-9 shrink-0 place-items-center rounded-full bg-primary text-primary-foreground transition-transform hover:scale-[1.03]`,children:n?(0,P.jsx)(on,{className:`size-4`}):(0,P.jsx)(cn,{className:`ml-0.5 size-4`})}),(0,P.jsx)(`span`,{className:`w-9 shrink-0 text-right text-[0.68rem] tabular-nums text-foreground`,children:uF(i)}),(0,P.jsx)(`input`,{type:`range`,min:0,max:o||0,step:.05,value:Math.min(i,o||0),disabled:!o,onChange:e=>u(Number(e.currentTarget.value)),"aria-label":`Posición de la nota de voz`,className:`voice-note-range min-w-0 flex-1 disabled:cursor-default disabled:opacity-50`}),(0,P.jsx)(`span`,{className:`w-9 shrink-0 text-[0.68rem] tabular-nums text-muted-foreground`,children:uF(o)})]})}function mF({file:e,onRemove:t,compact:n=!1}){let r=e.filename?.trim()||`archivo`,i=e.mediaType||`application/octet-stream`,a=e.url||``,o=i.startsWith(`image/`),s=i.startsWith(`video/`),c=i.startsWith(`audio/`),u=lF(r);if(o)return(0,P.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:l(`group relative overflow-hidden rounded-xl border border-border bg-card shadow-sm`,n?`w-[8.75rem] sm:w-[9.5rem]`:`w-full max-w-[18rem]`),children:[t?(0,P.jsx)(fF,{filename:r,onRemove:t}):null,(0,P.jsxs)(`a`,{href:a,target:`_blank`,rel:`noreferrer`,className:`block`,title:r,children:[(0,P.jsx)(`img`,{src:a,alt:r,className:l(`w-full bg-secondary object-cover transition-transform duration-200 group-hover:scale-[1.015]`,n?`h-20`:`max-h-56 min-h-28`)}),(0,P.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border px-2.5 py-2`,children:[(0,P.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center rounded-lg bg-brand-soft text-primary`,children:(0,P.jsx)(Xt,{className:`size-3.5`})}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`truncate text-xs font-bold text-foreground`,children:r}),(0,P.jsxs)(`p`,{className:`text-[0.65rem] text-muted-foreground`,children:[`Imagen · `,u]})]})]})]})]});if(s)return(0,P.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:l(`relative overflow-hidden rounded-xl border border-border bg-card shadow-sm`,n?`w-[12rem] sm:w-[13rem]`:`w-full max-w-[21rem]`),children:[t?(0,P.jsx)(fF,{filename:r,onRemove:t}):null,(0,P.jsx)(`video`,{src:a,controls:!0,preload:`metadata`,className:l(`w-full bg-black object-contain`,n?`h-20`:`max-h-64`),children:`Tu navegador no puede reproducir este video.`}),(0,P.jsxs)(`div`,{className:`flex items-center gap-2 border-t border-border px-2.5 py-2`,children:[(0,P.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center rounded-lg bg-brand-soft text-primary`,children:(0,P.jsx)(Xt,{className:`size-3.5`})}),(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`p`,{className:`truncate text-xs font-bold text-foreground`,children:r}),(0,P.jsxs)(`p`,{className:`text-[0.65rem] text-muted-foreground`,children:[`Video · `,u]})]})]})]});if(c){let e=dF(r);return(0,P.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:l(`relative rounded-xl border border-border bg-card p-3 shadow-sm`,n?`w-[20rem] max-w-[82vw]`:`w-full max-w-[34rem]`,t&&`pr-11`),children:[t?(0,P.jsx)(fF,{filename:r,onRemove:t}):null,(0,P.jsxs)(`div`,{className:l(`flex min-w-0 items-center`,n?`gap-2`:`gap-3`),children:[(0,P.jsx)(`span`,{className:l(`grid shrink-0 place-items-center rounded-xl bg-brand-soft text-primary`,n?`size-8`:`size-10`),children:(0,P.jsx)(nn,{className:`size-4`})}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`p`,{className:`text-xs font-bold leading-snug text-foreground`,children:e}),(0,P.jsxs)(`p`,{className:`mt-0.5 text-[0.65rem] text-muted-foreground`,children:[`Audio · `,u]})]})]}),(0,P.jsx)(`div`,{className:l(`w-full`,n?`mt-2`:`mt-3`),children:(0,P.jsx)(pF,{src:a})})]})}return(0,P.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:l(`relative flex items-center gap-3 rounded-xl border border-border bg-card p-3 shadow-sm`,n?`w-[16rem] max-w-[78vw]`:`w-full max-w-[20rem]`,t&&`pr-11`),children:[t?(0,P.jsx)(fF,{filename:r,onRemove:t}):null,(0,P.jsx)(`span`,{className:`grid size-10 shrink-0 place-items-center rounded-xl bg-secondary text-primary`,children:(0,P.jsx)(Jt,{className:`size-4`})}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`p`,{className:`truncate text-xs font-bold text-foreground`,title:r,children:r}),(0,P.jsxs)(`p`,{className:`mt-0.5 text-[0.65rem] text-muted-foreground`,children:[`Archivo · `,u]})]}),a?(0,P.jsx)(`a`,{href:a,target:`_blank`,rel:`noreferrer`,className:`shrink-0 rounded-lg border border-border bg-background px-2.5 py-1.5 text-[0.68rem] font-bold text-primary transition-colors hover:bg-secondary`,children:`Abrir`}):null]})}function hF(){let e=eF();return e.files.length===0?null:(0,P.jsx)(`div`,{className:`min-w-0 w-full`,children:(0,P.jsx)(`div`,{className:`scrollbar-slim flex min-w-0 max-w-full snap-x snap-proximity flex-nowrap items-stretch gap-2.5 overflow-x-auto overflow-y-hidden overscroll-x-contain pb-1.5 pr-1`,"aria-label":`Archivos adjuntos`,children:e.files.map(t=>(0,P.jsx)(`div`,{className:`shrink-0 snap-start`,children:(0,P.jsx)(mF,{file:t,compact:!0,onRemove:()=>e.remove(t.id)})},t.id))})})}function gF(){let e=eF();return(0,P.jsx)(sF,{type:`button`,onClick:e.openFileDialog,"aria-label":`Adjuntar archivo`,tooltip:`Adjuntar archivo`,children:(0,P.jsx)(an,{className:`size-4`})})}function _F(e){return`${Math.floor(e/60)}:${(e%60).toString().padStart(2,`0`)}`}function vF(){let e=eF(),t=(0,M.useRef)(null),[n,r]=(0,M.useState)(!1),[i,a]=(0,M.useState)(0);(0,M.useEffect)(()=>{if(!n)return;let e=window.setInterval(()=>a(e=>e+1),1e3);return()=>window.clearInterval(e)},[n]);let o=(0,M.useCallback)(()=>{t.current?.stop(),t.current=null,r(!1)},[]),s=(0,M.useCallback)(async()=>{try{let n=await navigator.mediaDevices.getUserMedia({audio:!0}),i=new MediaRecorder(n),o=[];i.ondataavailable=e=>o.push(e.data),i.onstop=()=>{n.getTracks().forEach(e=>e.stop());let t=new Blob(o,{type:i.mimeType||`audio/webm`}),r=new File([t],`nota-de-voz-${Date.now()}.webm`,{type:t.type});e.add([r])},i.start(),t.current=i,a(0),r(!0)}catch{r(!1)}},[e]);return(0,P.jsxs)(sF,{onClick:()=>n?o():void s(),"aria-label":n?`Detener grabación`:`Grabar nota de voz`,tooltip:n?`Detener grabación`:`Grabar nota de voz`,className:l(n&&`bg-destructive/10 text-destructive`),children:[n?(0,P.jsx)(pn,{className:`size-4`}):(0,P.jsx)(nn,{className:`size-4`}),n?(0,P.jsx)(`span`,{className:`tabular-nums`,children:_F(i)}):null]})}function yF({onSend:e,busy:t,onStop:n,draft:r,onDraftChange:i}){return(0,P.jsxs)(nF,{onSubmit:n=>{t||!n.text.trim()&&n.files.length===0||(e(n),i(``))},multiple:!0,maxFiles:8,maxFileSize:26214400,className:`rounded-2xl border-0 bg-card shadow-[var(--shadow-soft)] transition-shadow focus-within:shadow-[var(--shadow-lift)]`,inputGroupClassName:`rounded-2xl border-0 shadow-none ring-0 has-[[data-slot=input-group-control]:focus-visible]:ring-0`,children:[(0,P.jsx)(iF,{className:`min-w-0 w-full flex-nowrap empty:hidden`,children:(0,P.jsx)(hF,{})}),(0,P.jsx)(rF,{autoFocus:!0,value:r,onChange:e=>i(e.currentTarget.value),placeholder:`Describe el espacio, las tiendas y las semanas a cotizar...`,className:`min-h-[3.25rem] text-[0.95rem]`}),(0,P.jsxs)(aF,{children:[(0,P.jsxs)(oF,{children:[(0,P.jsx)(gF,{}),(0,P.jsx)(vF,{})]}),(0,P.jsx)(cF,{...t?{status:`streaming`}:{},onStop:n,className:`rounded-lg`})]})]})}var bF=`glm-cotizador-chats-v2`;function xF(e){return`${bF}:${e}`}function SF(){return Math.random().toString(36).slice(2,11)}function CF(e){let t=e.find(e=>e.role===`user`),n=(t?.text.trim()||t?.attachments[0]?.filename?.trim()||`Nuevo chat`).replace(/\s+/g,` `);return n.length>42?`${n.slice(0,39).trimEnd()}...`:n}function wF(e){if(typeof window>`u`||!e)return[];try{let t=window.localStorage.getItem(xF(e));if(!t)return[];let n=JSON.parse(t);return Array.isArray(n)?n.filter(e=>e&&typeof e.id==`string`&&typeof e.title==`string`&&Array.isArray(e.messages)).sort((e,t)=>t.updatedAt-e.updatedAt):[]}catch{return[]}}function TF(e,t){if(!(typeof window>`u`||!e))try{window.localStorage.setItem(xF(e),JSON.stringify(t))}catch{}}var EF=`cotizador_wmc`,DF=`cotizador-wmc-uploads`,OF=`cotizador_wmc_app_session_id`,kF=`cotizador_wmc_app_open_tracked`;function AF(){return`https://agenteit.digitalcompass.agency/webhook/cotizador-wmc-chat`}function jF(e){return e.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/[^a-zA-Z0-9._-]+/g,`-`).replace(/-+/g,`-`).replace(/^-|-$/g,``).slice(0,120)||`archivo`}async function MF(e){let{data:{session:t},error:n}=await e.auth.getSession();if(n)throw n;if(t?.access_token)return t.access_token;let{data:r,error:i}=await e.auth.refreshSession();if(i||!r.session?.access_token)throw Error(`Tu sesión expiró. Vuelve a iniciar sesión.`);return r.session.access_token}function NF(){if(typeof window>`u`)return`server-${Date.now()}`;let e=window.sessionStorage.getItem(OF);return e||(e=`wmc-${Date.now()}-${SF()}`,window.sessionStorage.setItem(OF,e)),e}function PF(){typeof window>`u`||(window.sessionStorage.removeItem(OF),window.sessionStorage.removeItem(kF))}async function FF(e,t,n,r={},i,a){try{let{error:o}=await e.rpc(`glm_track_app_event`,{p_app_key:EF,p_event_name:n,p_session_id:NF(),p_metadata:r,p_entity_type:i??null,p_entity_id:a??null,p_display_name:t.name});if(o)throw o;return!0}catch(e){return console.warn(`No se pudo registrar analítica del Cotizador WMC:`,e),!1}}async function IF(e,t){typeof window>`u`||window.sessionStorage.getItem(kF)!==t.id&&await FF(e,t,`app_open`,{path:window.location.pathname,userAgent:navigator.userAgent})&&window.sessionStorage.setItem(kF,t.id)}async function LF(e){let{data:t,error:n}=await e.from(`cotizador_wmc_tariff_items`).select(`id,country_code,country_name,item_code,category,name,detail,mandatory_requirement,format_scope,period,unit_type,base_cost_usd,source_name,effective_from,effective_to,is_active`).eq(`is_active`,!0).order(`country_code`,{ascending:!0}).order(`category`,{ascending:!0}).order(`name`,{ascending:!0});if(n)throw n;return(t??[]).map(e=>({...e,base_cost_usd:Number(e.base_cost_usd??0)}))}async function RF(e,t,n,r){let i=`tarifario-ui-${NF()}`,a={operation:n,tariffItemId:r.id??null,item:{id:r.id??null,countryCode:r.countryCode,country:r.country,itemCode:r.itemCode,category:r.category,name:r.name,detail:r.detail??null,mandatoryRequirement:r.mandatoryRequirement??null,formatScope:r.formatScope??`WM, SP, BF`,period:r.period??null,unitType:r.unitType??null,baseCostUsd:r.baseCostUsd,sourceName:r.sourceName??`Edición manual desde módulo Tarifario`,effectiveFrom:r.effectiveFrom??new Date().toISOString().slice(0,10)},reason:`Cambio realizado manualmente desde el módulo Tarifario del Cotizador WMC`},{data:o,error:s}=await e.rpc(`cotizador_wmc_process_my_agent_action`,{p_action:{action:`tariff_change_proposal`,pendingAction:a},p_conversation_id:i,p_display_name:t.name,p_session_id:NF()});if(s)throw s;if(!o?.ok||!o?.pendingActionId)throw Error(o?.error||`No se pudo preparar el cambio del tarifario.`);let{data:c,error:l}=await e.rpc(`cotizador_wmc_process_my_agent_action`,{p_action:{action:`confirm_tariff_change`,pendingActionId:o.pendingActionId},p_conversation_id:i,p_display_name:t.name,p_session_id:NF()});if(l)throw l;if(!c?.ok)throw Error(c?.error||`No se pudo aplicar el cambio del tarifario.`);return c}function zF(e){if(!e||typeof e!=`object`)return null;let t=e;return{filename:typeof t.filename==`string`?t.filename:`archivo`,mediaType:typeof t.mediaType==`string`?t.mediaType:`application/octet-stream`,url:typeof t.url==`string`?t.url:``,storagePath:typeof t.storagePath==`string`?t.storagePath:null}}async function BF(e,t){return Promise.all(t.map(async t=>{if(!t.storagePath)return t;let{data:n,error:r}=await e.storage.from(DF).createSignedUrl(t.storagePath,3600);return r||!n?.signedUrl?t:{...t,url:n.signedUrl}}))}async function VF(e,t){return Promise.all(t.map(async t=>({...t,attachments:await BF(e,t.attachments)})))}async function HF(e,t){let{data:n,error:r}=await e.from(`cotizador_wmc_conversations`).select(`id,title,created_at,updated_at`).eq(`user_id`,t.id).order(`updated_at`,{ascending:!1}).limit(100);if(r)throw r;if(!n?.length)return[];let i=n.map(e=>e.id),{data:a,error:o}=await e.from(`cotizador_wmc_messages`).select(`id,conversation_id,role,content,attachments,metadata,created_at`).in(`conversation_id`,i).order(`created_at`,{ascending:!0});if(o)throw o;let s=new Map;for(let t of a??[]){let n=await BF(e,(Array.isArray(t.attachments)?t.attachments:[]).map(zF).filter(e=>!!e)),r=t.metadata&&typeof t.metadata==`object`?t.metadata:{},i={id:t.id,role:t.role,text:t.content??``,attachments:n,createdAt:new Date(t.created_at).getTime(),metadata:r},a=s.get(t.conversation_id)??[];a.push(i),s.set(t.conversation_id,a)}return n.map(e=>({id:e.id,title:e.title||`Nuevo chat`,messages:s.get(e.id)??[],createdAt:new Date(e.created_at).getTime(),updatedAt:new Date(e.updated_at).getTime()}))}async function UF(e,t,n,r){let i=new Date().toISOString(),{error:a}=await e.from(`cotizador_wmc_conversations`).upsert({id:n,user_id:t.id,user_email:t.email.toLowerCase(),title:r||`Nuevo chat`,updated_at:i},{onConflict:`id`});if(a)throw a}async function WF(e,t,n,r,i){let a=i?.trim()||CF(r),{error:o}=await e.from(`cotizador_wmc_conversations`).update({title:a,updated_at:new Date().toISOString()}).eq(`id`,n).eq(`user_id`,t.id);if(o)throw o}async function GF(e,t,n,r){let i=r.replace(/\s+/g,` `).trim().slice(0,80);if(!i)throw Error(`El nombre del chat no puede estar vacío.`);let{error:a}=await e.from(`cotizador_wmc_conversations`).update({title:i,updated_at:new Date().toISOString()}).eq(`id`,n).eq(`user_id`,t.id);if(a)throw a}async function KF(e,t,n,r){if(!r.length)return;let i=r.map(e=>({id:e.id,conversation_id:n,user_id:t.id,role:e.role,content:e.text,attachments:e.attachments.map(e=>({filename:e.filename,mediaType:e.mediaType,url:e.url,storagePath:e.storagePath??null})),metadata:e.metadata??{},created_at:new Date(e.createdAt).toISOString()})),{error:a}=await e.from(`cotizador_wmc_messages`).upsert(i,{onConflict:`id`});if(a)throw a}async function qF(e,t){if(!t)return;let n=Array.from(new Set(t.messages.flatMap(e=>e.attachments).map(e=>e.storagePath).filter(e=>!!e)));if(!n.length)return;let{error:r}=await e.storage.from(DF).remove(n);if(r)throw r}async function JF(e,t,n){let{error:r}=await e.from(`cotizador_wmc_conversations`).delete().eq(`id`,n).eq(`user_id`,t.id);if(r)throw r}async function YF(e,t,n,r,i){let a=i.slice(0,8),o=[];for(let i=0;i<a.length;i+=1){let s=a[i],c=s.filename||`archivo-${i+1}`,l=s.mediaType||`application/octet-stream`,u=s.url||``;if(!u)continue;let d=await fetch(u);if(!d.ok)throw Error(`No se pudo preparar ${c} para subirlo.`);let f=await d.blob();if(f.size>26214400)throw Error(`${c} supera el límite de 25 MB.`);let p=`${t.id}/${n}/${r}/${Date.now()}-${i}-${jF(c)}`,{error:m}=await e.storage.from(DF).upload(p,f,{contentType:l,upsert:!1});if(m)throw m;let{data:h,error:g}=await e.storage.from(DF).createSignedUrl(p,3600);if(g||!h?.signedUrl)throw g||Error(`No se pudo crear acceso temporal para ${c}.`);o.push({filename:c,mediaType:l,url:h.signedUrl,storagePath:p})}return o}async function XF(e,t,n,r){let i=await MF(e),a=await fetch(AF(),{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${i}`},body:JSON.stringify({text:n.text,conversationId:n.conversationId,messageId:n.messageId,userEmail:t.email,userName:t.name,appSessionId:NF(),sentAt:new Date().toISOString(),attachments:n.attachments.map(e=>({filename:e.filename,mediaType:e.mediaType,url:e.url,storagePath:e.storagePath??null}))}),...r?{signal:r}:{}}),o=null;try{o=await a.json()}catch{o=null}if(!a.ok||o?.ok===!1){let e=typeof o?.reply==`string`&&o.reply||typeof o?.message==`string`&&o.message||`El agente respondió con HTTP ${a.status}.`;throw Error(e)}if(!o)throw Error(`El agente no devolvió una respuesta válida.`);return o}function ZF(e){let t=typeof e.reply==`string`&&e.reply.trim()?e.reply.trim():`Listo.`;return e.artifactUrl?`${t}\n\n[${e.artifactType===`quote`?`Abrir cotización en Google Sheets`:e.artifactType===`monthly_glm`?`Abrir mensualización GLM`:e.artifactType===`proposal`?`Abrir propuesta en Google Slides`:e.artifactType===`image`?`Abrir imagen generada`:`Abrir archivo generado`}](${e.artifactUrl})`:t}function QF(e){return{action:e.action??`chat`,model:e.model??null,warnings:Array.isArray(e.warnings)?e.warnings:[],confidence:e.confidence??null,requiresConfirmation:!!e.requiresConfirmation,pendingActionId:e.pendingActionId??null,artifactUrl:e.artifactUrl??null,artifactType:e.artifactType??null,quoteId:e.quoteId??null}}var $F=5e3;function eI(){return`https://agenteit.digitalcompass.agency/webhook/cotizador-wmc-reportar`}function tI({user:e}){let[t,n]=(0,M.useState)(!1),[r,i]=(0,M.useState)(``),[a,o]=(0,M.useState)(!1),[s,c]=(0,M.useState)(``),[l,u]=(0,M.useState)(!1),d=()=>{i(``),o(!1),c(``),u(!1)};return(0,P.jsxs)(wj,{open:t,onOpenChange:e=>{n(e),e&&d()},children:[(0,P.jsx)(Tj,{asChild:!0,children:(0,P.jsxs)(`button`,{type:`button`,"aria-label":`Reportar`,title:`Reportar`,className:`inline-flex h-9 items-center gap-1.5 rounded-lg border border-border bg-card px-2.5 text-xs font-bold text-foreground transition-colors hover:bg-secondary sm:px-3`,children:[(0,P.jsx)(tn,{className:`size-4`}),(0,P.jsx)(`span`,{className:`hidden sm:inline`,children:`Reportar`})]})}),(0,P.jsxs)(Oj,{className:`overflow-hidden border-border bg-card p-0 sm:max-w-[32rem]`,children:[(0,P.jsx)(`div`,{className:`h-1 bg-brand`}),(0,P.jsx)(`div`,{className:`p-6 pt-5`,children:l?(0,P.jsxs)(`div`,{className:`py-2 text-center`,children:[(0,P.jsx)(`div`,{className:`mx-auto grid size-12 place-items-center rounded-full bg-brand-soft text-brand`,children:(0,P.jsx)(Ht,{className:`size-6`})}),(0,P.jsx)(`h2`,{className:`mt-4 text-lg font-bold text-primary`,children:`Reporte enviado`}),(0,P.jsx)(`p`,{className:`mx-auto mt-2 max-w-sm text-sm leading-relaxed text-muted-foreground`,children:`Tu reporte fue enviado correctamente al equipo de IT.`}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>n(!1),className:`mt-5 inline-flex h-9 items-center justify-center rounded-lg bg-primary px-4 text-sm font-bold text-primary-foreground transition-colors hover:bg-primary/90`,children:`Cerrar`})]}):(0,P.jsxs)(`form`,{onSubmit:async t=>{t.preventDefault();let n=r.trim();if(!n){c(`Escribe la descripción del reporte antes de enviarlo.`);return}let a=eI();if(!a){c(`El canal de reportes no está configurado. Contacta a IT para revisar VITE_REPORT_WEBHOOK_URL.`);return}o(!0),c(``);try{let{data:{session:t},error:r}=await wt().auth.getSession();if(r||!t?.access_token)throw Error(`Tu sesión expiró. Vuelve a iniciar sesión.`);let o=await fetch(a,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${t.access_token}`},body:JSON.stringify({userEmail:e.email,userName:e.name,message:n,submittedAt:new Date().toISOString(),appSessionId:NF()})}),s=null;try{s=await o.json()}catch{s=null}if(!o.ok||s?.ok===!1)throw Error(s?.message||`No se pudo enviar el reporte.`);u(!0),i(``)}catch(e){console.error(`No se pudo enviar el reporte de usuario:`,e),c(e instanceof Error&&e.message?e.message:`No se pudo enviar el reporte. Intenta nuevamente.`)}finally{o(!1)}},children:[(0,P.jsxs)(kj,{className:`gap-0`,children:[(0,P.jsx)(`div`,{className:`mb-2 grid size-10 place-items-center rounded-xl bg-brand-soft text-primary`,children:(0,P.jsx)(tn,{className:`size-5`})}),(0,P.jsx)(jj,{className:`text-xl font-bold text-primary`,children:`Reporte`})]}),(0,P.jsxs)(`div`,{className:`mt-4`,children:[(0,P.jsxs)(`label`,{htmlFor:`report-description`,className:`mb-2 block text-sm font-bold text-foreground`,children:[`Descripción del Reporte `,(0,P.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,P.jsx)(RP,{id:`report-description`,value:r,onChange:e=>{i(e.target.value),s&&c(``)},maxLength:$F,required:!0,autoFocus:!0,disabled:a,placeholder:`Describe claramente lo que ocurrió, qué esperabas que pasara y cualquier detalle que pueda ayudar a revisarlo...`,className:`min-h-36 resize-y rounded-xl bg-background px-3.5 py-3 leading-relaxed`}),(0,P.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-between gap-3`,children:[(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`El reporte incluirá automáticamente tu nombre y correo.`}),(0,P.jsxs)(`span`,{className:`shrink-0 text-[0.7rem] text-muted-foreground`,children:[r.length,`/`,$F]})]}),s?(0,P.jsx)(`p`,{role:`alert`,className:`mt-3 text-sm leading-relaxed text-destructive`,children:s}):null]}),(0,P.jsxs)(Aj,{className:`mt-6 gap-2 sm:space-x-0`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:()=>n(!1),disabled:a,className:`inline-flex h-9 items-center justify-center rounded-lg border border-border bg-card px-4 text-sm font-bold text-foreground transition-colors hover:bg-secondary disabled:cursor-not-allowed disabled:opacity-50`,children:`Cancelar`}),(0,P.jsxs)(`button`,{type:`submit`,disabled:a||!r.trim(),className:`inline-flex h-9 items-center justify-center gap-2 rounded-lg bg-primary px-4 text-sm font-bold text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-50`,children:[a?(0,P.jsx)(`span`,{className:`size-4 animate-spin rounded-full border-2 border-primary-foreground/40 border-t-primary-foreground`}):(0,P.jsx)(dn,{className:`size-4`}),a?`Enviando...`:`Enviar reporte`]})]})]})})]})]})}var nI=[{code:`GT`,name:`Guatemala`},{code:`CR`,name:`Costa Rica`},{code:`SV`,name:`El Salvador`},{code:`HN`,name:`Honduras`},{code:`NI`,name:`Nicaragua`}],rI={countryCode:`GT`,country:`Guatemala`,itemCode:``,category:`Personal`,name:``,detail:``,mandatoryRequirement:``,formatScope:`WM, SP, BF`,period:``,unitType:``,baseCostUsd:0,sourceName:`Edición manual desde módulo Tarifario`};function iI(e){return{countryCode:e.country_code,country:e.country_name,itemCode:e.item_code,category:e.category,name:e.name,detail:e.detail??``,mandatoryRequirement:e.mandatory_requirement??``,formatScope:e.format_scope,period:e.period??``,unitType:e.unit_type??``,baseCostUsd:Number(e.base_cost_usd),sourceName:e.source_name,effectiveFrom:e.effective_from}}function aI({user:e}){let[t,n]=(0,M.useState)(!1),[r,i]=(0,M.useState)([]),[a,o]=(0,M.useState)(!1),[s,c]=(0,M.useState)(!1),[l,u]=(0,M.useState)(``),[d,f]=(0,M.useState)(``),[p,m]=(0,M.useState)(``),[h,g]=(0,M.useState)(`TODOS`),[_,v]=(0,M.useState)(null),[y,b]=(0,M.useState)(!1),[x,S]=(0,M.useState)(rI),C=async()=>{o(!0),u(``);try{let e=await LF(wt());i(e)}catch(e){console.error(e),u(`No se pudo cargar el Tarifario desde Supabase.`)}finally{o(!1)}};(0,M.useEffect)(()=>{t&&(C(),FF(wt(),e,`tariff_opened`))},[t,e]);let w=(0,M.useMemo)(()=>{let e=p.trim().toLowerCase();return r.filter(t=>h!==`TODOS`&&t.country_code!==h?!1:!e||[t.name,t.category,t.item_code,t.detail??``,t.country_name].join(` `).toLowerCase().includes(e))},[h,r,p]),T=()=>{v(null),S(rI),u(``),f(``),b(!0)},ee=e=>{v(e),S(iI(e)),u(``),f(``),b(!0)},E=e=>{let t=nI.find(t=>t.code===e)??{code:`GT`,name:`Guatemala`};S(e=>({...e,countryCode:t.code,country:t.name}))},te=async t=>{if(t.preventDefault(),!x.name.trim()||!x.category.trim()||!x.itemCode.trim()){u(`Nombre, código y categoría son obligatorios.`);return}if(!Number.isFinite(Number(x.baseCostUsd))||Number(x.baseCostUsd)<0){u(`El costo USD debe ser un número válido mayor o igual a cero.`);return}let n=_?`actualizar`:`crear`;if(window.confirm(`¿Confirmas ${n} esta tarifa? El cambio quedará auditado en Supabase.`)){c(!0),u(``),f(``);try{await RF(wt(),e,_?`update`:`insert`,_?{...x,id:_.id}:x),f(_?`Tarifa actualizada correctamente.`:`Tarifa creada correctamente.`),b(!1),v(null),await C()}catch(e){console.error(e),u(e instanceof Error?e.message:`No se pudo guardar la tarifa.`)}finally{c(!1)}}},ne=async t=>{if(window.confirm(`¿Confirmas eliminar/desactivar “${t.name}” del tarifario vigente?`)){c(!0),u(``),f(``);try{await RF(wt(),e,`deactivate`,{id:t.id,countryCode:t.country_code,country:t.country_name,itemCode:t.item_code,category:t.category,name:t.name,baseCostUsd:Number(t.base_cost_usd)}),f(`Tarifa desactivada correctamente.`),await C()}catch(e){console.error(e),u(e instanceof Error?e.message:`No se pudo desactivar la tarifa.`)}finally{c(!1)}}};return(0,P.jsxs)(wj,{open:t,onOpenChange:n,children:[(0,P.jsx)(Tj,{asChild:!0,children:(0,P.jsxs)(`button`,{type:`button`,"aria-label":`Tarifario`,className:`inline-flex h-9 items-center gap-1.5 rounded-lg border border-border bg-card px-2.5 text-xs font-bold text-foreground transition-colors hover:bg-secondary sm:px-3`,children:[(0,P.jsx)(Rt,{className:`size-4`}),(0,P.jsx)(`span`,{className:`hidden sm:inline`,children:`Tarifario`})]})}),(0,P.jsxs)(Oj,{className:`flex max-h-[88dvh] w-[min(96vw,70rem)] max-w-none flex-col overflow-hidden border-border bg-card p-0`,children:[(0,P.jsx)(`div`,{className:`h-1 shrink-0 bg-brand`}),(0,P.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col p-5 sm:p-6`,children:[(0,P.jsxs)(kj,{className:`shrink-0`,children:[(0,P.jsxs)(jj,{className:`flex items-center gap-2 text-xl font-bold text-primary`,children:[(0,P.jsx)(Rt,{className:`size-5`}),`Tarifario Walmart Connect`]}),(0,P.jsx)(Mj,{children:`Consulta, agrega, edita o elimina tarifas vigentes. Cada modificación requiere confirmación y queda auditada.`})]}),(0,P.jsxs)(`div`,{className:`mt-5 flex shrink-0 flex-col gap-2 sm:flex-row`,children:[(0,P.jsxs)(`label`,{className:`relative min-w-0 flex-1`,children:[(0,P.jsx)(un,{className:`absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`}),(0,P.jsx)(`input`,{value:p,onChange:e=>m(e.target.value),placeholder:`Buscar por nombre, código, categoría...`,className:`h-10 w-full rounded-lg border border-border bg-background pl-9 pr-3 text-sm outline-none focus:border-primary`})]}),(0,P.jsxs)(`div`,{className:`relative shrink-0 sm:w-48`,children:[(0,P.jsxs)(`select`,{value:h,onChange:e=>g(e.target.value),className:`h-10 w-full appearance-none rounded-lg border border-border bg-background pl-3 pr-10 text-sm outline-none transition-colors focus:border-primary focus:ring-2 focus:ring-primary/10`,children:[(0,P.jsx)(`option`,{value:`TODOS`,children:`Todos los países`}),nI.map(e=>(0,P.jsx)(`option`,{value:e.code,children:e.name},e.code))]}),(0,P.jsx)(Bt,{className:`pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground`})]}),(0,P.jsxs)(`button`,{type:`button`,onClick:T,className:`inline-flex h-10 items-center justify-center gap-2 rounded-lg bg-primary px-4 text-sm font-bold text-primary-foreground hover:bg-primary/90`,children:[(0,P.jsx)(ln,{className:`size-4`}),`Agregar tarifa`]})]}),l?(0,P.jsx)(`p`,{className:`mt-3 shrink-0 text-sm text-destructive`,children:l}):null,d?(0,P.jsxs)(`p`,{className:`mt-3 flex shrink-0 items-center gap-2 text-sm font-medium text-brand`,children:[(0,P.jsx)(Ht,{className:`size-4`}),` `,d]}):null,y?(0,P.jsxs)(`form`,{onSubmit:te,className:`mt-4 shrink-0 rounded-xl border border-border bg-secondary/35 p-4`,children:[(0,P.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-bold text-primary`,children:_?`Editar tarifa`:`Nueva tarifa`}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>b(!1),className:`text-muted-foreground hover:text-foreground`,children:(0,P.jsx)(vn,{className:`size-4`})})]}),(0,P.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,P.jsxs)(`label`,{className:`text-xs font-bold text-foreground`,children:[`País`,(0,P.jsxs)(`span`,{className:`relative mt-1 block`,children:[(0,P.jsx)(`select`,{value:x.countryCode,onChange:e=>E(e.target.value),className:`h-9 w-full appearance-none rounded-md border border-border bg-background pl-2 pr-9 text-sm font-normal outline-none focus:border-primary`,children:nI.map(e=>(0,P.jsx)(`option`,{value:e.code,children:e.name},e.code))}),(0,P.jsx)(Bt,{className:`pointer-events-none absolute right-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`})]})]}),(0,P.jsxs)(`label`,{className:`text-xs font-bold text-foreground`,children:[`Código *`,(0,P.jsx)(`input`,{value:x.itemCode,onChange:e=>S(t=>({...t,itemCode:e.target.value})),className:`mt-1 h-9 w-full rounded-md border border-border bg-background px-2 text-sm font-normal`})]}),(0,P.jsxs)(`label`,{className:`text-xs font-bold text-foreground`,children:[`Categoría *`,(0,P.jsx)(`input`,{value:x.category,onChange:e=>S(t=>({...t,category:e.target.value})),className:`mt-1 h-9 w-full rounded-md border border-border bg-background px-2 text-sm font-normal`})]}),(0,P.jsxs)(`label`,{className:`text-xs font-bold text-foreground`,children:[`Costo unitario USD *`,(0,P.jsx)(`input`,{type:`number`,min:`0`,step:`0.01`,value:x.baseCostUsd,onChange:e=>S(t=>({...t,baseCostUsd:Number(e.target.value)})),className:`mt-1 h-9 w-full rounded-md border border-border bg-background px-2 text-sm font-normal`})]}),(0,P.jsxs)(`label`,{className:`text-xs font-bold text-foreground sm:col-span-2`,children:[`Nombre *`,(0,P.jsx)(`input`,{value:x.name,onChange:e=>S(t=>({...t,name:e.target.value})),className:`mt-1 h-9 w-full rounded-md border border-border bg-background px-2 text-sm font-normal`})]}),(0,P.jsxs)(`label`,{className:`text-xs font-bold text-foreground`,children:[`Período`,(0,P.jsx)(`input`,{value:x.period??``,onChange:e=>S(t=>({...t,period:e.target.value})),placeholder:`1 día / Por unidad`,className:`mt-1 h-9 w-full rounded-md border border-border bg-background px-2 text-sm font-normal`})]}),(0,P.jsxs)(`label`,{className:`text-xs font-bold text-foreground`,children:[`Tipo de unidad`,(0,P.jsx)(`input`,{value:x.unitType??``,onChange:e=>S(t=>({...t,unitType:e.target.value})),placeholder:`persona/día / unidad`,className:`mt-1 h-9 w-full rounded-md border border-border bg-background px-2 text-sm font-normal`})]}),(0,P.jsxs)(`label`,{className:`text-xs font-bold text-foreground sm:col-span-2`,children:[`Detalle`,(0,P.jsx)(`textarea`,{value:x.detail??``,onChange:e=>S(t=>({...t,detail:e.target.value})),rows:2,className:`mt-1 w-full rounded-md border border-border bg-background px-2 py-2 text-sm font-normal`})]}),(0,P.jsxs)(`label`,{className:`text-xs font-bold text-foreground`,children:[`Requisito`,(0,P.jsx)(`input`,{value:x.mandatoryRequirement??``,onChange:e=>S(t=>({...t,mandatoryRequirement:e.target.value})),className:`mt-1 h-9 w-full rounded-md border border-border bg-background px-2 text-sm font-normal`})]}),(0,P.jsxs)(`label`,{className:`text-xs font-bold text-foreground`,children:[`Alcance formato`,(0,P.jsx)(`input`,{value:x.formatScope??``,onChange:e=>S(t=>({...t,formatScope:e.target.value})),className:`mt-1 h-9 w-full rounded-md border border-border bg-background px-2 text-sm font-normal`})]})]}),(0,P.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:()=>b(!1),disabled:s,className:`h-9 rounded-lg border border-border bg-card px-4 text-sm font-bold hover:bg-secondary`,children:`Cancelar`}),(0,P.jsx)(`button`,{type:`submit`,disabled:s,className:`h-9 rounded-lg bg-primary px-4 text-sm font-bold text-primary-foreground disabled:opacity-50`,children:s?`Guardando...`:_?`Guardar cambios`:`Crear tarifa`})]})]}):null,(0,P.jsx)(`div`,{className:`scrollbar-slim mt-4 min-h-0 flex-1 overflow-auto rounded-xl border border-border`,children:(0,P.jsxs)(`table`,{className:`w-full min-w-[900px] border-collapse text-left text-sm`,children:[(0,P.jsx)(`thead`,{className:`sticky top-0 z-10 bg-secondary text-xs uppercase tracking-wide text-muted-foreground`,children:(0,P.jsxs)(`tr`,{children:[(0,P.jsx)(`th`,{className:`px-3 py-3`,children:`País`}),(0,P.jsx)(`th`,{className:`px-3 py-3`,children:`Código`}),(0,P.jsx)(`th`,{className:`px-3 py-3`,children:`Categoría`}),(0,P.jsx)(`th`,{className:`px-3 py-3`,children:`Concepto`}),(0,P.jsx)(`th`,{className:`px-3 py-3`,children:`Unidad / período`}),(0,P.jsx)(`th`,{className:`px-3 py-3 text-right`,children:`USD`}),(0,P.jsx)(`th`,{className:`px-3 py-3 text-right`,children:`Acciones`})]})}),(0,P.jsx)(`tbody`,{children:a?(0,P.jsx)(`tr`,{children:(0,P.jsx)(`td`,{colSpan:7,className:`px-4 py-10 text-center text-muted-foreground`,children:`Cargando tarifario...`})}):w.length===0?(0,P.jsx)(`tr`,{children:(0,P.jsx)(`td`,{colSpan:7,className:`px-4 py-10 text-center text-muted-foreground`,children:`No se encontraron tarifas.`})}):w.map(e=>(0,P.jsxs)(`tr`,{className:`border-t border-border align-top hover:bg-secondary/30`,children:[(0,P.jsx)(`td`,{className:`px-3 py-3 font-bold text-primary`,children:e.country_code}),(0,P.jsx)(`td`,{className:`px-3 py-3 font-mono text-xs`,children:e.item_code}),(0,P.jsx)(`td`,{className:`px-3 py-3`,children:e.category}),(0,P.jsxs)(`td`,{className:`max-w-[24rem] px-3 py-3`,children:[(0,P.jsx)(`div`,{className:`font-semibold text-foreground`,children:e.name}),e.detail?(0,P.jsx)(`div`,{className:`mt-1 line-clamp-2 text-xs text-muted-foreground`,children:e.detail}):null]}),(0,P.jsx)(`td`,{className:`px-3 py-3 text-xs text-muted-foreground`,children:[e.unit_type,e.period].filter(Boolean).join(` · `)||`—`}),(0,P.jsxs)(`td`,{className:`px-3 py-3 text-right font-bold tabular-nums`,children:[`$`,Number(e.base_cost_usd).toLocaleString(`en-US`,{minimumFractionDigits:2,maximumFractionDigits:2})]}),(0,P.jsx)(`td`,{className:`px-3 py-3`,children:(0,P.jsxs)(`div`,{className:`flex justify-end gap-1`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:()=>ee(e),title:`Editar`,className:`grid size-8 place-items-center rounded-md text-primary hover:bg-primary/10`,children:(0,P.jsx)(sn,{className:`size-4`})}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>void ne(e),disabled:s,title:`Eliminar / desactivar`,className:`grid size-8 place-items-center rounded-md text-destructive hover:bg-destructive/10 disabled:opacity-50`,children:(0,P.jsx)(hn,{className:`size-4`})})]})})]},e.id))})]})}),(0,P.jsxs)(`p`,{className:`mt-3 shrink-0 text-xs text-muted-foreground`,children:[w.length,` tarifa(s) visible(s).`]})]})]})]})}var oI=`https://drive.google.com/drive/folders/19EmZsJ7PzWCaFzeij9AZ3-mkPctNyK0G`,sI=[{icon:_n,title:`Cotizar cabecera de gondola`,prompt:`Cotiza una cabecera de góndola para Guatemala en 3 tiendas Walmart durante 4 semanas.`},{icon:gn,title:`Actualizar el tarifario`,prompt:`Actualiza el tarifario: la Impulsadora A Capital de Guatemala pasa a US$40 por día.`},{icon:Jt,title:`Comparar con cotizaciones previas`,prompt:`Compara esta cotización con cotizaciones históricas similares de Walmart Connect.`},{icon:Xt,title:`Generar arte de propuesta`,prompt:`Genera una referencia visual profesional para una isla promocional de Walmart Connect.`}];function cI({attachments:e}){return e.length===0?null:(0,P.jsx)(`div`,{className:`flex w-full flex-wrap justify-end gap-2.5`,children:e.map((e,t)=>(0,P.jsx)(mF,{file:e},`${e.filename}-${t}`))})}function lI({user:e}){let[t,n]=(0,M.useState)(!1);return(0,M.useEffect)(()=>{n(!1)},[e.avatarUrl]),e.avatarUrl&&!t?(0,P.jsx)(`img`,{src:e.avatarUrl,alt:e.name,referrerPolicy:`no-referrer`,onError:()=>n(!0),className:`size-full rounded-full object-cover`}):(0,P.jsx)(`span`,{children:e.initials})}function uI({chats:e,activeChatId:t,open:n,user:r,onClose:i,onNew:a,onSelect:o,onRename:s,onDelete:c,onSignOut:u}){let[d,f]=(0,M.useState)(null),[p,m]=(0,M.useState)(``),h=e=>{f(e),m(e.title)},g=()=>{if(!d)return;let e=p.replace(/\s+/g,` `).trim().slice(0,80);e&&(s(d.id,e),f(null),m(``))};return(0,P.jsxs)(P.Fragment,{children:[n?(0,P.jsx)(`button`,{type:`button`,"aria-label":`Cerrar historial de chats`,className:`fixed inset-0 z-40 bg-foreground/15 backdrop-blur-[1px] md:hidden`,onClick:i}):null,(0,P.jsxs)(`aside`,{className:l(`fixed inset-y-0 left-0 z-50 flex w-[17rem] flex-col border-r border-sidebar-border bg-secondary/70 px-3 py-4 shadow-xl transition-transform duration-200 md:static md:z-auto md:translate-x-0 md:shadow-none`,n?`translate-x-0`:`-translate-x-full`),children:[(0,P.jsxs)(`div`,{className:`mb-4 flex items-center gap-2`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:a,className:`flex h-11 flex-1 items-center gap-2.5 rounded-xl border border-primary/20 bg-card px-3.5 text-sm font-bold text-primary shadow-sm transition-colors hover:bg-primary hover:text-primary-foreground`,children:[(0,P.jsx)(ln,{className:`size-4.5`}),`Nuevo chat`]}),(0,P.jsx)(`button`,{type:`button`,onClick:i,"aria-label":`Cerrar historial`,className:`grid size-10 place-items-center rounded-xl text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground md:hidden`,children:(0,P.jsx)(vn,{className:`size-4.5`})})]}),(0,P.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,P.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 px-2 text-xs font-bold uppercase tracking-[0.12em] text-primary/80`,children:[(0,P.jsx)(en,{className:`size-3.5`}),`Chats`]}),(0,P.jsx)(`div`,{className:`scrollbar-slim min-h-0 flex-1 space-y-1 overflow-y-auto pr-1`,children:e.length===0?(0,P.jsx)(`p`,{className:`px-2 py-3 text-xs leading-relaxed text-muted-foreground`,children:`Tus conversaciones aparecerán aquí después de enviar el primer mensaje.`}):e.map(e=>{let n=e.id===t;return(0,P.jsxs)(`div`,{className:l(`group flex min-w-0 items-center rounded-lg transition-colors`,n?`bg-primary/10`:`hover:bg-secondary`),children:[(0,P.jsx)(`button`,{type:`button`,onClick:()=>o(e),title:e.title,className:l(`min-w-0 flex-1 truncate px-3 py-2.5 text-left text-sm`,n?`font-bold text-primary`:`font-medium text-sidebar-foreground`),children:e.title}),(0,P.jsxs)(DP,{children:[(0,P.jsx)(OP,{asChild:!0,children:(0,P.jsx)(`button`,{type:`button`,"aria-label":`Opciones de ${e.title}`,onClick:e=>e.stopPropagation(),className:l(`mr-1 grid size-8 shrink-0 place-items-center rounded-md text-muted-foreground opacity-0 transition-all hover:bg-card hover:text-foreground group-hover:opacity-100 group-focus-within:opacity-100`),children:(0,P.jsx)(Kt,{className:`size-4`})})}),(0,P.jsxs)(jP,{align:`end`,side:`right`,className:`min-w-44`,children:[(0,P.jsxs)(MP,{className:`gap-2`,onClick:()=>h(e),children:[(0,P.jsx)(sn,{className:`size-4`}),`Cambiar nombre`]}),(0,P.jsxs)(MP,{className:`gap-2 text-destructive focus:text-destructive`,onClick:()=>c(e.id),children:[(0,P.jsx)(hn,{className:`size-4`}),`Eliminar chat`]})]})]})]},e.id)})})]}),(0,P.jsx)(`div`,{className:`mt-3 border-t border-sidebar-border pt-3`,children:(0,P.jsxs)(DP,{children:[(0,P.jsx)(OP,{asChild:!0,children:(0,P.jsxs)(`button`,{type:`button`,className:`group flex w-full items-center gap-3 rounded-xl px-2.5 py-2 text-left transition-colors hover:bg-secondary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/45`,"aria-label":`Abrir menú de ${r.name}`,children:[(0,P.jsx)(`div`,{className:`grid size-10 shrink-0 place-items-center overflow-hidden rounded-full bg-[image:var(--gradient-brand)] text-xs font-bold text-primary-foreground ring-1 ring-sidebar-border`,children:(0,P.jsx)(lI,{user:r})}),(0,P.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,P.jsx)(`div`,{className:`truncate text-sm font-bold text-sidebar-foreground`,children:r.name})})]})}),(0,P.jsx)(jP,{align:`start`,side:`top`,sideOffset:8,className:`w-52`,children:(0,P.jsxs)(MP,{className:`gap-2 text-destructive focus:text-destructive`,onClick:u,children:[(0,P.jsx)(Qt,{className:`size-4`}),`Cerrar sesión`]})})]})})]}),(0,P.jsx)(wj,{open:!!d,onOpenChange:e=>{e||(f(null),m(``))},children:(0,P.jsxs)(Oj,{className:`max-w-md rounded-2xl border-border bg-card p-5 shadow-2xl`,children:[(0,P.jsxs)(kj,{className:`space-y-2`,children:[(0,P.jsx)(jj,{className:`text-lg font-bold text-foreground`,children:`Cambiar nombre del chat`}),(0,P.jsx)(Mj,{children:`Escribe un nombre corto para identificar esta conversación.`})]}),(0,P.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),g()},children:[(0,P.jsx)(LP,{value:p,onChange:e=>m(e.target.value),maxLength:80,autoFocus:!0,"aria-label":`Nuevo nombre del chat`,className:`h-11 rounded-xl bg-background px-3.5`}),(0,P.jsxs)(`div`,{className:`text-right text-xs text-muted-foreground`,children:[p.length,`/80`]}),(0,P.jsxs)(Aj,{className:`gap-2 sm:space-x-0`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:()=>{f(null),m(``)},className:`inline-flex h-10 items-center justify-center rounded-xl border border-border bg-card px-4 text-sm font-semibold text-foreground transition-colors hover:bg-secondary`,children:`Cancelar`}),(0,P.jsx)(`button`,{type:`submit`,disabled:!p.trim(),className:`inline-flex h-10 items-center justify-center rounded-xl bg-primary px-4 text-sm font-bold text-primary-foreground transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-45`,children:`Guardar`})]})]})]})})]})}function dI(){let e=c(),[t,n]=(0,M.useState)(null),[r,i]=(0,M.useState)([]),[a,o]=(0,M.useState)([]),[s,l]=(0,M.useState)(null),[u,d]=(0,M.useState)(``),[f,p]=(0,M.useState)(!1),[m,h]=(0,M.useState)(!1),[g,_]=(0,M.useState)(!1),{theme:v,toggleTheme:y}=C(),b=(0,M.useRef)([]),x=(0,M.useRef)(null);(0,M.useEffect)(()=>{let t=!0,r=!1,a=wt(),s=async r=>{xt(r),await Ct(a),t&&(n(null),_(!1),e({to:`/`,replace:!0}))},c=async c=>{if(!r){r=!0;try{let r=await Et(a);if(!t)return;if(!r.allowed){if(r.reason===`signed_out`){n(null),_(!1),e({to:`/`,replace:!0});return}await s(r.message);return}if(_(r.permissions.canUseTarifario),!c)return;let u=Tt(r.user),f=[];try{f=await HF(a,u)}catch(e){console.warn(`No se pudo cargar el historial remoto; se usará el respaldo local:`,e),f=wF(u.id)}if(f.length===0){let e=wF(u.id);e.length>0&&(f=e)}n(u),b.current=f,o(f),l(null),i([]),d(``),IF(a,u)}catch(e){console.error(e),t&&await s(`No se pudo validar tu acceso en este momento. Intenta nuevamente o contacta a IT.`)}finally{r=!1}}},{data:{subscription:u}}=a.auth.onAuthStateChange(r=>{t&&r===`SIGNED_OUT`&&(n(null),_(!1),l(null),i([]),d(``),e({to:`/`,replace:!0}))}),f=()=>{c(!1)},p=()=>{document.visibilityState===`visible`&&f()};c(!0),window.addEventListener(`focus`,f),document.addEventListener(`visibilitychange`,p);let m=window.setInterval(f,6e4);return()=>{t=!1,u.unsubscribe(),window.removeEventListener(`focus`,f),document.removeEventListener(`visibilitychange`,p),window.clearInterval(m)}},[e]);let S=(0,M.useCallback)(e=>{let n=[...e].sort((e,t)=>t.updatedAt-e.updatedAt);b.current=n,o(n),t&&TF(t.id,n)},[t]),w=(0,M.useCallback)((e,t)=>{i(t);let n=Date.now(),r=b.current.find(t=>t.id===e),a={id:e,title:r?.title||CF(t),messages:t,createdAt:r?.createdAt??t[0]?.createdAt??n,updatedAt:n};S([a,...b.current.filter(t=>t.id!==e)])},[S]),T=(0,M.useCallback)(()=>{x.current?.abort(),x.current=null,p(!1)},[]);(0,M.useEffect)(()=>T,[T]);let ee=(0,M.useCallback)(async e=>{if(!t||f)return;let n=wt(),i=s??SF(),a=SF(),o=e.files.slice(0,8).map(e=>({filename:e.filename??`archivo`,mediaType:e.mediaType??`application/octet-stream`,url:e.url,storagePath:null})),c={id:a,role:`user`,text:e.text.trim(),attachments:o,createdAt:Date.now()},u=[...r],d=[...u,c];s||l(i),w(i,d),p(!0);let m=new AbortController;x.current=m;try{let r=b.current.find(e=>e.id===i)?.title||CF(d);if(await UF(n,t,i,r),u.length>0){let e=await VF(n,u);await KF(n,t,i,e)}let o=e.files.length?await YF(n,t,i,a,e.files):[],l={...c,attachments:o},f=[...u,l];w(i,f),s||FF(n,t,`chat_created`,{},`conversation`,i),FF(n,t,`message_sent`,{hasAttachments:o.length>0,attachmentCount:o.length},`conversation`,i);let p=await XF(n,t,{text:l.text,conversationId:i,messageId:a,attachments:o},m.signal),h={id:SF(),role:`assistant`,text:ZF(p),attachments:[],createdAt:Date.now(),metadata:QF(p)},g=[...f,h];w(i,g);try{await KF(n,t,i,[l,h]),await WF(n,t,i,g,b.current.find(e=>e.id===i)?.title)}catch(e){console.warn(`La respuesta se generó, pero no se pudo sincronizar el historial remoto:`,e)}}catch(e){if(e instanceof DOMException&&e.name===`AbortError`){try{let e=b.current.find(e=>e.id===i)?.messages??d,r=e.find(e=>e.id===a)??c,o={...r,attachments:r.attachments.filter(e=>e.storagePath||!e.url.startsWith(`data:`)&&!e.url.startsWith(`blob:`))};await KF(n,t,i,[o]),await WF(n,t,i,e,b.current.find(e=>e.id===i)?.title)}catch(e){console.warn(`No se pudo guardar el mensaje detenido:`,e)}return}console.error(`Error al comunicarse con el agente WMC:`,e);let r=e instanceof Error&&e.message?e.message:`No se pudo completar la solicitud. Intenta nuevamente.`,o={id:SF(),role:`assistant`,text:`No pude completar la solicitud.\n\n⚠️ ${r}`,attachments:[],createdAt:Date.now(),metadata:{action:`error`,error:r}},s=[...(b.current.find(e=>e.id===i)?.messages??d).filter(e=>e.id!==o.id),o];w(i,s);try{let e=s.find(e=>e.id===a)??c,r={...e,attachments:e.attachments.filter(e=>e.storagePath||!e.url.startsWith(`data:`)&&!e.url.startsWith(`blob:`))};await KF(n,t,i,[r,o]),await WF(n,t,i,s,b.current.find(e=>e.id===i)?.title)}catch(e){console.warn(`No se pudo persistir el error del agente:`,e)}FF(n,t,`agent_error`,{message:r},`conversation`,i)}finally{x.current===m&&(x.current=null),p(!1)}},[s,f,r,w,t]),E=(0,M.useCallback)(()=>{window.requestAnimationFrame(()=>{document.querySelector(`textarea[name="message"]`)?.focus()})},[]),te=(0,M.useCallback)(()=>{T(),l(null),i([]),d(``),h(!1),E()},[E,T]),ne=(0,M.useCallback)(e=>{T(),l(e.id),i(e.messages),d(``),h(!1)},[T]),D=(0,M.useCallback)((e,n)=>{let r=n.replace(/\s+/g,` `).trim().slice(0,80);if(!r)return;let i=b.current.find(t=>t.id===e);if(!i||i.title===r)return;let a={...i,title:r,updatedAt:Date.now()};if(S([a,...b.current.filter(t=>t.id!==e)]),t){let n=wt();(async()=>{try{await GF(n,t,e,r)}catch(e){console.warn(`No se pudo sincronizar el nuevo nombre del chat:`,e)}})(),FF(n,t,`chat_renamed`,{previousTitle:i.title,title:r},`conversation`,e)}},[S,t]),re=(0,M.useCallback)(e=>{let n=b.current.find(t=>t.id===e),r=b.current.filter(t=>t.id!==e);if(S(r),t){let r=wt();(async()=>{try{await qF(r,n),await JF(r,t,e)}catch(e){console.warn(`No se pudo eliminar completamente el chat remoto:`,e)}})(),FF(r,t,`chat_deleted`,{},`conversation`,e)}s===e&&(T(),l(null),i([]),d(``))},[s,S,T,t]),O=(0,M.useCallback)(e=>{d(e),E()},[E]),k=async()=>{T();let r=wt();t&&await FF(r,t,`logout`,{appSessionId:NF()}),PF();let{error:a}=await r.auth.signOut({scope:`local`});a&&console.error(a),n(null),_(!1),l(null),i([]),d(``),e({to:`/`,replace:!0})};if(!t)return(0,P.jsx)(`div`,{className:`min-h-[100dvh] bg-background`});let ie=r.length===0;return(0,P.jsxs)(`div`,{className:`flex h-[100dvh] overflow-hidden bg-background`,children:[(0,P.jsx)(uI,{chats:a,activeChatId:s,open:m,user:t,onClose:()=>h(!1),onNew:te,onSelect:ne,onRename:D,onDelete:re,onSignOut:()=>void k()}),(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,P.jsx)(`header`,{className:`sticky top-0 z-20 border-b border-border bg-card/85 backdrop-blur`,children:(0,P.jsxs)(`div`,{className:`mx-auto grid w-full max-w-4xl grid-cols-[minmax(0,1fr)_auto] items-center gap-3 px-4 py-3`,children:[(0,P.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:()=>h(!0),"aria-label":`Abrir historial de chats`,className:`grid size-9 shrink-0 place-items-center rounded-lg border border-border bg-card text-primary transition-colors hover:bg-secondary md:hidden`,children:(0,P.jsx)($t,{className:`size-4.5`})}),(0,P.jsx)(yt,{className:`h-6 shrink-0 sm:h-7`}),(0,P.jsx)(`span`,{"aria-hidden":`true`,className:`h-6 w-px shrink-0 bg-border`}),(0,P.jsx)(`div`,{className:`min-w-0`,children:(0,P.jsx)(`h1`,{className:`truncate text-sm font-bold leading-tight text-primary sm:text-[0.95rem]`,children:`Cotizador Walmart Connect`})})]}),(0,P.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[g?(0,P.jsx)(aI,{user:t}):null,(0,P.jsxs)(`a`,{href:oI,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`Abrir archivos generados`,title:`Archivos generados`,className:`inline-flex h-9 items-center gap-1.5 rounded-lg border border-border bg-card px-2.5 text-xs font-bold text-foreground transition-colors hover:bg-secondary sm:px-3`,children:[(0,P.jsx)(Yt,{className:`size-4`}),(0,P.jsx)(`span`,{className:`hidden lg:inline`,children:`Archivos`})]}),(0,P.jsxs)(`button`,{type:`button`,onClick:y,"aria-label":v===`dark`?`Cambiar a modo claro`:`Cambiar a modo oscuro`,title:v===`dark`?`Modo claro`:`Modo oscuro`,className:`inline-flex h-9 items-center gap-1.5 rounded-lg border border-border bg-card px-2.5 text-xs font-bold text-foreground transition-colors hover:bg-secondary sm:px-3`,children:[v===`dark`?(0,P.jsx)(mn,{className:`size-4`}):(0,P.jsx)(rn,{className:`size-4`}),(0,P.jsx)(`span`,{className:`hidden lg:inline`,children:v===`dark`?`Claro`:`Oscuro`})]}),(0,P.jsx)(tI,{user:t})]})]})}),(0,P.jsxs)(Ln,{className:`scrollbar-slim flex-1`,children:[(0,P.jsxs)(Rn,{className:`mx-auto w-full max-w-4xl gap-6 px-4 pb-6 pt-6`,children:[ie?(0,P.jsxs)(`div`,{className:`animate-rise flex flex-col items-center py-8 text-center sm:py-14`,children:[(0,P.jsxs)(`h2`,{className:`text-xl font-bold text-primary sm:text-2xl`,children:[`Hola, `,t.firstName]}),(0,P.jsx)(`p`,{className:`mt-2 max-w-md text-sm leading-relaxed text-muted-foreground`,children:`Pídeme una cotización de Walmart Connect y la armo en segundos con el tarifario interno vigente.`}),(0,P.jsx)(`div`,{className:`mt-8 grid w-full gap-3 sm:grid-cols-2`,children:sI.map(e=>(0,P.jsxs)(`button`,{type:`button`,onClick:()=>O(e.prompt),className:`group flex items-start gap-3 rounded-xl border border-border bg-card p-3.5 text-left transition-all hover:-translate-y-px hover:border-brand hover:shadow-[var(--shadow-soft)]`,children:[(0,P.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-lg bg-brand-soft text-primary transition-colors group-hover:bg-brand group-hover:text-brand-foreground`,children:(0,P.jsx)(e.icon,{className:`size-4`})}),(0,P.jsxs)(`span`,{className:`min-w-0`,children:[(0,P.jsx)(`span`,{className:`block text-sm font-bold text-foreground`,children:e.title}),(0,P.jsx)(`span`,{className:`mt-0.5 block text-xs leading-snug text-muted-foreground`,children:e.prompt})]})]},e.title))})]}):r.map(e=>(0,P.jsxs)(Dv,{from:e.role,children:[e.role===`assistant`?(0,P.jsxs)(`div`,{className:`flex items-center gap-2 text-[0.7rem] font-bold uppercase tracking-[0.14em] text-brand`,children:[(0,P.jsx)(fn,{className:`size-3.5`}),`Cotizador`]}):null,(0,P.jsx)(cI,{attachments:e.attachments}),e.text?(0,P.jsx)(Ov,{children:e.role===`assistant`?(0,P.jsx)(Mv,{children:e.text}):(0,P.jsx)(`p`,{className:`whitespace-pre-wrap`,children:e.text})}):null]},e.id)),f?(0,P.jsx)(Dv,{from:`assistant`,children:(0,P.jsx)(Ov,{children:(0,P.jsx)(ck,{children:`Armando la cotización...`})})}):null]}),(0,P.jsx)(zn,{})]}),(0,P.jsx)(`div`,{className:`border-t border-border bg-card/85 backdrop-blur`,children:(0,P.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-4 pb-[max(1rem,env(safe-area-inset-bottom))] pt-3`,children:[(0,P.jsx)(`p`,{className:`mb-2.5 text-center text-xs font-normal text-muted-foreground`,children:`Para uso interno de GomezLee Marketing · Verifica siempre las tarifas antes de enviar al cliente.`}),(0,P.jsx)(yF,{onSend:ee,busy:f,onStop:T,draft:u,onDraftChange:d})]})})]})]})}export{dI as component};